![]() |
Routines |
| Prev: 914A | Up: Map | Next: 9213 |
|
The attacker's strength, byte 5 of its record, plus the weapon's if there is one -- bare hands are a FIST -- against the target's defence, byte 6, each jostled by JOSTLE -- meant as a random -10 to +10, but in practice 0 to +10, and about one time in 25 zero instead (see JOSTLE); a guard of 0 loses to any blow over 16. A blow no stronger than the defence is wasted: "but the effort is wasted. his defense is too strong.". One more than 16 stronger kills: "with one well placed blow you cleave his skull." and KILL. Anything between picks a message from WOUNDS by how much stronger it was, and wears the target's strength and defence down by it.
Only something in one place can be a weapon: "you cannot kill with the ...". And no one attacks their own side (SAME_SIDE).
|
||||
| DO_ATTACK | 9171 | CALL SAME_SIDE | Not against its own side | |
| 9174 | LD A,(INSTRUMENT) | The weapon's name, or FIST, for the messages | ||
| 9177 | LD HL,$026B | |||
| 917A | CP $FF | |||
| 917C | JR Z,DO_ATTACK_0 | |||
| 917E | LD IX,(INSTRUMENT_RECORD) | |||
| 9182 | LD L,(IX+$08) | |||
| 9185 | LD H,(IX+$09) | |||
| DO_ATTACK_0 | 9188 | LD (WEAPON_NAME),HL | ||
| 918B | LD IX,(ACTOR) | B = the attacker's strength | ||
| 918F | LD B,(IX+$05) | |||
| 9192 | LD A,(INSTRUMENT) | No weapon: that is all | ||
| 9195 | INC A | |||
| 9196 | JR Z,DO_ATTACK_2 | |||
| 9198 | LD IY,(INSTRUMENT_RECORD) | A weapon in more than one place: "you cannot kill with the ..." | ||
| 919C | LD A,(IY+$00) | |||
| 919F | DEC A | |||
| 91A0 | LD HL,MSG_YOU_CANNOT_KILL_WITH | |||
| 91A3 | JP NZ,RUN_MESSAGE_HL | |||
| 91A6 | LD A,(IY+$05) | Otherwise its strength is added, at most 255 | ||
| 91A9 | ADD A,B | |||
| 91AA | JR NC,DO_ATTACK_1 | |||
| 91AC | LD A,$FF | |||
| DO_ATTACK_1 | 91AE | LD B,A | ||
| DO_ATTACK_2 | 91AF | LD A,B | A random share of it | |
| 91B0 | CALL JOSTLE | |||
| 91B3 | LD B,A | |||
| 91B4 | CALL FOR_REAL | The test ends here | ||
| 91B7 | LD IX,(TARGET_RECORD) | A random share of the target's defence | ||
| 91BB | LD A,(IX+$06) | |||
| 91BE | CALL JOSTLE | |||
| 91C1 | CP B | No stronger: "but the effort is wasted..." | ||
| 91C2 | LD HL,MSG_BUT_THE_EFFORT_IS | |||
| 91C5 | JP NC,RUN_MESSAGE_HL | |||
| 91C8 | LD C,A | More than 16 stronger? | ||
| 91C9 | ADD A,$10 | |||
| 91CB | JR NC,DO_ATTACK_3 | |||
| 91CD | LD A,$FF | |||
| DO_ATTACK_3 | 91CF | CP B | ||
| 91D0 | JR C,DO_ATTACK_6 | |||
| 91D2 | LD A,B | Otherwise a wound: the message for how much stronger... | ||
| 91D3 | SUB C | |||
| 91D4 | RLCA | |||
| 91D5 | LD E,A | |||
| 91D6 | LD D,$00 | |||
| 91D8 | LD IY,WOUNDS | |||
| 91DC | ADD IY,DE | |||
| 91DE | LD L,(IY+$00) | |||
| 91E1 | LD H,(IY+$01) | |||
| 91E4 | RRCA | ...and the target's strength and defence worn down by it -- halved with RRCA, which rotates the margin's low bit into bit 7: an odd margin takes 129 or more off a strong target and nothing off a weak one. Tried in four fights with Thorin (104/120): a margin of 8 left him 99/117, 10 98/120, 11 unhurt and 13 104/52 | ||
| 91E5 | RRCA | |||
| 91E6 | LD B,A | |||
| 91E7 | CPL | |||
| 91E8 | ADD A,(IX+$05) | |||
| 91EB | JR NC,DO_ATTACK_4 | |||
| 91ED | LD (IX+$05),A | |||
| DO_ATTACK_4 | 91F0 | LD A,B | ||
| 91F1 | RRCA | |||
| 91F2 | CPL | |||
| 91F3 | ADD A,(IX+$06) | |||
| 91F6 | JR NC,DO_ATTACK_5 | |||
| 91F8 | LD (IX+$06),A | |||
| DO_ATTACK_5 | 91FB | JP RUN_MESSAGE_HL | Print the wound | |
| DO_ATTACK_6 | 91FE | LD HL,MSG_WITH_ONE_WELL_PLACE | A kill: "...you cleave his skull.", dead, and it is said | |
| 9201 | CALL RUN_MESSAGE_HL | |||
| 9204 | SET 3,(IX+$07) | |||
| 9208 | LD A,(TARGET) | |||
| 920B | CALL KILL | |||
| 920E | LD A,$06 | |||
| 9210 | JP SAY_STATE | |||
| Prev: 914A | Up: Map | Next: 9213 |