![]() |
Routines |
| Prev: 92E8 | Up: Map | Next: 939E |
|
Used by the routines at DO_SHOOT and WINDOW_OTHERS.
Not a liquid, not what is broken already ("the ... is broken."), and not what has no defence at all. The blow is the weapon's strength, the striker's and a random 0 to 21 together, against the thing's defence, byte 6: at least equal, and the thing breaks -- flag bit 3, "broken" in its name (BROKEN_OR_DEAD), its strength halved, and a thing that holds others in or on it spills them. Then the weapon itself is tried the same way against the thing's defence, and a weapon weaker than what it hit breaks too: striking the trap door with the sword can cost the sword.
|
||||
| DO_STRIKE | 92ED | LD IX,(TARGET_RECORD) | Not a liquid; broken already: say so | |
| 92F1 | BIT 1,(IX+$07) | |||
| 92F5 | JP NZ,REFUSE | |||
| 92F8 | BIT 3,(IX+$07) | |||
| 92FC | JP NZ,DO_STRIKE_4 | |||
| 92FF | SUB A | Nothing with no defence | ||
| 9300 | CP (IX+$06) | |||
| 9303 | JP Z,REFUSE | |||
| 9306 | LD B,A | B = the weapon's strength, 0 with none | ||
| 9307 | LD A,(INSTRUMENT) | A weapon: one with strength, and one that can itself be struck | ||
| 930A | INC A | |||
| 930B | JR Z,DO_STRIKE_0 | |||
| 930D | LD IY,(INSTRUMENT_RECORD) | |||
| 9311 | LD A,(IY+$05) | |||
| 9314 | AND A | |||
| 9315 | JP Z,REFUSE | |||
| 9318 | PUSH IX | |||
| 931A | LD IX,(INSTRUMENT_RECORD) | |||
| 931E | LD A,$0B | |||
| 9320 | CALL FIND_OBJECT_HANDLER | |||
| 9323 | POP IX | |||
| 9325 | INC A | |||
| 9326 | JP Z,REFUSE | |||
| 9329 | LD B,(IY+$05) | |||
| DO_STRIKE_0 | 932C | CALL FOR_REAL | The test ends here | |
| 932F | LD A,$15 | The blow, against its defence | ||
| 9331 | CALL RANDOM | |||
| 9334 | ADD A,B | |||
| 9335 | LD IY,(ACTOR) | |||
| 9339 | ADD A,(IY+$05) | |||
| 933C | JR NC,DO_STRIKE_1 | |||
| 933E | LD A,$FF | |||
| DO_STRIKE_1 | 9340 | SUB (IX+$06) | ||
| 9343 | JR C,DO_STRIKE_2 | |||
| 9345 | SET 3,(IX+$07) | Broken: named so, weaker, and spilling what it held | ||
| 9349 | LD A,(TARGET) | |||
| 934C | CALL BROKEN_OR_DEAD | |||
| 934F | SRA (IX+$05) | |||
| 9353 | LD A,(IX+$04) | |||
| 9356 | CP $02 | |||
| 9358 | CALL C,EMPTY_FIRST | |||
| 935B | LD A,$83 | |||
| 935D | CALL SAY_STATE | |||
| DO_STRIKE_2 | 9360 | LD A,(INSTRUMENT) | The weapon against the same defence... | |
| 9363 | CP $FF | |||
| 9365 | RET Z | |||
| 9366 | LD IY,(INSTRUMENT_RECORD) | |||
| 936A | BIT 3,(IY+$07) | |||
| 936E | RET NZ | |||
| 936F | LD B,(IY+$06) | |||
| 9372 | LD A,$15 | |||
| 9374 | CALL RANDOM | |||
| 9377 | ADD A,B | |||
| 9378 | JR NC,DO_STRIKE_3 | |||
| 937A | LD A,$FF | |||
| DO_STRIKE_3 | 937C | SUB (IX+$06) | ||
| 937F | RET C | ...and broken too if it was weaker | ||
| 9380 | SET 3,(IY+$07) | |||
| 9384 | LD A,(INSTRUMENT) | |||
| 9387 | CALL BROKEN_OR_DEAD | |||
| 938A | LD A,(IY+$05) | |||
| 938D | SRA A | |||
| 938F | LD (IY+$05),A | |||
| 9392 | CALL EMPTY_FIRST | |||
| 9395 | PUSH IY | |||
| 9397 | POP IX | |||
| DO_STRIKE_4 | 9399 | LD A,$83 | "the ... is broken." | |
| 939B | JP SAY_STATE | |||
| Prev: 92E8 | Up: Map | Next: 939E |