|
578 | 578 | (assert-hp [6 0] 10))
|
579 | 579 |
|
580 | 580 |
|
| 581 | +(defn test-wand-remote-action [] |
| 582 | + (init [ |
| 583 | + :width 30 :height 1 |
| 584 | + :tiles [ |
| 585 | + "pile of gold" "treasure chest" "key" |
| 586 | + "phase trigger" "phasing wall (in phase)" "cracked wall" "orc"]]) |
| 587 | + (defn remote [x] |
| 588 | + (use-item "wand of remote action" x 0)) |
| 589 | + (setv G.rules.reality-bubble-size 20) |
| 590 | + (setv nothing "There isn't anything you can affect there.") |
| 591 | + |
| 592 | + ; Wands of remote action can do lots of things. |
| 593 | + ; Pick up gold. |
| 594 | + (remote 1) |
| 595 | + (assert (= G.score 100)) |
| 596 | + ; Try to unlock a chest. |
| 597 | + (set-square [2 0] "treasure chest" "pile of gold") |
| 598 | + (cant (remote 2) "It's locked, and you're keyless at the moment.") |
| 599 | + ; Get a key, unlock it, and get the gold. |
| 600 | + (remote 3) |
| 601 | + (assert (= G.player.keys 1)) |
| 602 | + (assert (= G.score 150)) |
| 603 | + (remote 2) |
| 604 | + (assert (= G.player.keys 0)) |
| 605 | + (assert (= G.score 150)) |
| 606 | + (remote 2) |
| 607 | + (assert (= G.score 250)) |
| 608 | + ; Hit a phase trigger. |
| 609 | + (remote 4) |
| 610 | + (assert-at [5 0] "phasing wall (out of phase)") |
| 611 | + |
| 612 | + ; Things that wands of remote action can't do include: |
| 613 | + ; - Break a cracked wall |
| 614 | + (cant (remote 6) nothing) |
| 615 | + ; - Attack a monster |
| 616 | + (cant (remote 7) nothing) |
| 617 | + ; - Affect an empty square |
| 618 | + (cant (remote 15) nothing) |
| 619 | + ; - Pick up a key when you're already full. |
| 620 | + (setv G.player.keys G.rules.max-keys) |
| 621 | + (set-square 'E "key") |
| 622 | + (cant (remote 1) "Your keyring has no room for another key.")) |
| 623 | + |
| 624 | + |
581 | 625 | (defn test-fire-bomb []
|
582 | 626 | "Put some orcs in a line and check how much damage is done to each."
|
583 | 627 |
|
|
0 commit comments