| The Hobbit (v1.0) | Routines |
| Prev: A2EC | Up: Map | Next: A36A |
|
One character captures another. The target must be alive, and not on the same side as the actor (bits 4-6 of byte 4 of their records must have nothing in common, so goblins do not capture goblins). The captive is taken to a dungeon: room 31 if the captor is the wood elf or the butler (objects 64 and 66), room 13 otherwise. If the captive is Bilbo, the new room is described.
|
||||
| A316 | LD IX,($B5F8) | IX = the captive's record | ||
| A31A | LD A,(IX+$04) | A = the captive's side (bits 4-6 of its attributes) | ||
| A31D | AND $70 | |||
| A31F | PUSH IX | |||
| A321 | LD IX,($B5FC) | IX = the captor's record | ||
| A325 | AND (IX+$04) | Are they on the same side? | ||
| A328 | POP IX | |||
| A32A | JP NZ,$9EBF | Yes: allies do not capture each other | ||
| A32D | BIT 6,(IX+$07) | Is the captive alive? | ||
| A331 | JP Z,$9EBF | No: you cannot capture a corpse or an object | ||
| A334 | LD A,($B5DB) | Who is the captor? | ||
| A337 | LD B,$1F | Room 31 (the dark dungeon)... | ||
| A339 | CP $40 | ...for the wood elf... | ||
| A33B | JR Z,$A343 | |||
| A33D | CP $42 | ...or the butler | ||
| A33F | JR Z,$A343 | |||
| A341 | LD B,$0D | Anyone else: room 13 (the goblins' dungeon) | ||
| A343 | CALL $9C99 | Dry run? Then stop: the capture would work | ||
| A346 | LD IX,($B5F8) | IX = the captive's record | ||
| A34A | LD (IX+$10),B | Put the captive in the dungeon... | ||
| A34D | LD (IX+$01),$FF | ...free of anything holding it | ||
| A351 | LD A,($B5D9) | |||
| A354 | CALL $9B38 | ...and move everything it carries there too | ||
| A357 | LD A,($B5D9) | Was the captive Bilbo? | ||
| A35A | CP $00 | |||
| A35C | RET NZ | No: done | ||
| A35D | LD ($B5DB),A | Yes: he becomes the actor... | ||
| A360 | LD A,B | |||
| A361 | LD HL,$C00B | |||
| A364 | LD ($B5FC),HL | |||
| A367 | JP $958E | ...and the dungeon is described | ||
| Prev: A2EC | Up: Map | Next: A36A |