|  | Routines | 
| Prev: 36249 | Up: Map | Next: 36781 | 
| 
Used by the routine at Action_Run.
 | ||||
| Action_Dir | 36253 | CALL LocationLit | Jump to Action_Dir_0 if LocationLit reports that it is light. | |
| 36256 | JR NC,Action_Dir_0 | |||
| 36258 | LD A,9 | |||
| 36260 | CALL GetRandomNum | |||
| 36263 | INC A | |||
| 36264 | LD (46823),A | |||
| 
This entry point is used by the routine at ActionUntie.
 | ||||
| Action_Dir_0 | 36267 | LD IY,(46860) | ||
| 36271 | LD A,(IY+1) | |||
| 36274 | CP 255 | |||
| 36276 | JR Z,Action_Dir_1 | |||
| 36278 | CALL LocateObject | |||
| 36281 | BIT 6,(IX+7) | |||
| 36285 | JR Z,Action_Dir_2 | |||
| 36287 | LD (IY+1),255 | |||
| Action_Dir_1 | 36291 | LD A,(46826) | ||
| 36294 | CALL 40168 | |||
| 36297 | ADD A,(IY+2) | |||
| 36300 | LD (36252),A | |||
| 36303 | LD A,(46823) | |||
| 36306 | CALL 40712 | |||
| 36309 | CP 255 | |||
| 36311 | JR NZ,Action_Dir_3 | |||
| Action_Dir_2 | 36313 | CALL LocationLit | Jump to 40822 if LocationLit reports that it is light. | |
| 36316 | JP NC,40822 | |||
| 36319 | CALL 40260 | Call 40260. | ||
| 36322 | LD IX,49435 | IX=Objects. | ||
| 36326 | AND A | |||
| 36327 | LD HL,44413 | HL="but fall and hit your head[0x15]" | ||
| 36330 | RR (IX+5) | |||
| 36334 | JP NZ,PrintMsg | |||
| 36337 | LD HL,44426 | HL="but fall and smash your skull" | ||
| 36340 | CALL PrintMsg | Call PrintMsg. | ||
| 36343 | JP YouAreDead | Jump to YouAreDead. | ||
| Action_Dir_3 | 36346 | LD A,(IX+2) | ||
| 36349 | AND A | |||
| 36350 | JR Z,Action_Dir_2 | |||
| 36352 | LD (36251),A | |||
| 36355 | LD A,(IX+1) | |||
| 36358 | CALL Action_Dir_8 | |||
| 36361 | DEC A | |||
| 36362 | JR Z,Action_Dir_2 | |||
| 36364 | DEC A | |||
| 36365 | JR Z,Action_Dir_5 | |||
| 36367 | DEC A | |||
| 36368 | JR Z,Action_Dir_6 | |||
| 
This entry point is used by the routine at 39900.
 | ||||
| Action_Dir_4 | 36370 | CALL 40260 | Call 40260. | |
| 36373 | LD (IY+16),B | Update the location. | ||
| 36376 | LD A,(46826) | A=CurrentCharacter. | ||
| 36379 | CALL 39901 | Call 39901. | ||
| 36382 | LD A,(46826) | A=CurrentCharacter. | ||
| 36385 | CP 0 | Return if the character is not 0 - "You". | ||
| 36387 | RET NZ | |||
| 36388 | LD IX,51086 | Call IndexIdTable using the events table, looking for a match with ActionLocationID. | ||
| 36392 | LD A,(36251) | |||
| 36395 | CALL IndexIdTable | |||
| 36398 | JR Z,PercentageLocation | Jump to PercentageLocation if no event was found. | ||
| 36400 | LD L,(IX+1) | Load the event from the events table. | ||
| 36403 | LD H,(IX+2) | |||
| 36406 | CALL TriggerAction | Call TriggerAction to execute it. | ||
| 
The game adds a one-time only value to the completion percentage once certain locations are reached (as long as it's not dark).
 | ||||
| PercentageLocation | 36409 | CALL LocationLit | Return if LocationLit reports that it is dark. | |
| 36412 | RET C | |||
| 36413 | LD A,(46826) | A=CurrentCharacter. | ||
| 36416 | AND A | Set zero flag if the character is 0 - "You". | ||
| 36417 | LD A,(36251) | A=ActionLocationID. | ||
| 36420 | JR NZ,PercentageLocation_Skip | Jump to PercentageLocation_Skip to deal with any other object. | ||
| 36422 | LD HL,(36249) | HL=ActionLocationData. | ||
| 36425 | BIT 6,(HL) | If bit 6 is already (percentage is already added) set jump to YouSeeController. | ||
| 36427 | JP NZ,YouSeeController | |||
| 36430 | SET 6,(HL) | Set bit 6 of the location attributes, this sets that the percentage has already been added and hence will be skipped the next time this location is accessed. | ||
| 36432 | PUSH AF | Stash AF on the stack. | ||
| 36433 | LD IX,36206 | Call IndexIdTable with PercentageLocationTable. | ||
| 36437 | CALL IndexIdTable | |||
| 36440 | JR Z,PercentageLocation_Return | Jump to PercentageLocation_Return if there was no match. | ||
| 36442 | PUSH DE | Stash DE on the stack. | ||
| 36443 | LD E,(IX+1) | DE=the percentage value to add from the match of PercentageLocationTable. | ||
| 36446 | LD D,(IX+2) | |||
| 36449 | LD HL,(46839) | Add the percentage value to PercentageComplete and write it. | ||
| 36452 | ADD HL,DE | |||
| 36453 | LD (46839),HL | |||
| 36456 | POP DE | Restore DE from the stack. | ||
| PercentageLocation_Return | 36457 | POP AF | Restore AF from the stack. | |
| PercentageLocation_Skip | 36458 | JP YouSeePreposition | Jump to YouSeePreposition. | |
| Action_Dir_5 | 36461 | LD HL,44579 | HL="[0x04] is too small for you to enter". | |
| 36464 | JR Action_Dir_7 | |||
| Action_Dir_6 | 36466 | LD IX,(36249) | ||
| 36470 | LD HL,44590 | HL="[0x04] is too full for you to{5} enter[0x15]". | ||
| Action_Dir_7 | 36473 | PUSH HL | ||
| 36474 | LD L,(IX+2) | |||
| 36477 | LD H,(IX+3) | |||
| 36480 | EX (SP),HL | |||
| 36481 | CALL PrintMsg | Call PrintMsg. | ||
| 36484 | RET | Return. | ||
| Action_Dir_8 | 36485 | AND A | ||
| 36486 | JR Z,Action_Dir_10 | |||
| 36488 | CALL LocateObject | |||
| 36491 | LD A,(IX+7) | |||
| 36494 | AND 40 | |||
| 36496 | JR Z,Action_Dir_14 | |||
| 36498 | LD A,(46826) | |||
| 36501 | AND A | |||
| 36502 | JR NZ,Action_Dir_9 | |||
| 36504 | BIT 7,(IX+4) | |||
| 36508 | JR NZ,Action_Dir_14 | |||
| Action_Dir_9 | 36510 | LD A,(36252) | ||
| 36513 | LD B,(IX+2) | |||
| 36516 | SUB B | |||
| 36517 | JR NC,Action_Dir_13 | |||
| Action_Dir_10 | 36519 | LD A,(36251) | ||
| 36522 | LD B,A | |||
| 36523 | CALL LocateLocation | |||
| 36526 | LD (36249),IX | |||
| 36530 | LD A,255 | |||
| 36532 | CP (IX+1) | |||
| 36535 | JR Z,Action_Dir_11 | |||
| 36537 | LD A,B | |||
| 36538 | CALL 40001 | |||
| 36541 | LD C,A | |||
| 36542 | LD A,(36252) | |||
| 36545 | SUB C | |||
| 36546 | JR NC,Action_Dir_12 | |||
| Action_Dir_11 | 36548 | XOR A | ||
| 36549 | RET | |||
| Action_Dir_12 | 36550 | LD A,3 | ||
| 36552 | AND A | |||
| 36553 | RET | |||
| Action_Dir_13 | 36554 | LD A,2 | ||
| 36556 | AND A | |||
| 36557 | RET | |||
| Action_Dir_14 | 36558 | LD A,1 | ||
| 36560 | AND A | |||
| 36561 | RET | |||
| Action_Dir_15 | 36562 | PUSH IX | ||
| 36564 | CALL LocateObject | |||
| Action_Dir_16 | 36567 | LD A,(IX+1) | ||
| 36570 | CP 255 | |||
| 36572 | JR Z,Action_Dir_17 | |||
| 36574 | CALL LocateObject | |||
| 36577 | BIT 5,(IX+7) | |||
| 36581 | JR NZ,Action_Dir_16 | |||
| 36583 | OR 1 | |||
| Action_Dir_17 | 36585 | POP IX | ||
| 36587 | RET | |||
| 
This entry point is used by the routine at ActionClimbOut.
 | ||||
| Action_Dir_18 | 36588 | LD A,(46824) | ||
| 36591 | CALL LocateObject | |||
| 36594 | CALL ActionClimbOut_4 | |||
| 36597 | JP Z,DisplayExits_3 | |||
| 36600 | LD A,(46826) | |||
| 36603 | CALL Action_Dir_15 | |||
| 36606 | RET NZ | |||
| 36607 | CALL 40741 | |||
| 36610 | CP 255 | |||
| 36612 | JP Z,40822 | |||
| 36615 | LD A,(IX+2) | |||
| 36618 | CP 0 | |||
| 36620 | JP Z,40822 | |||
| 36623 | CALL 40260 | |||
| 36626 | PUSH IX | |||
| 36628 | CALL LocateLocation | |||
| 36631 | BIT 7,(IX+0) | |||
| 36635 | POP IX | |||
| 36637 | JR Z,Action_Dir_19 | |||
| 36639 | LD IY,(46860) | |||
| 36643 | LD A,(IY+16) | |||
| 36646 | PUSH AF | |||
| 36647 | LD A,(IX+2) | |||
| 36650 | LD (IY+16),A | |||
| 36653 | CALL YouSeeEntry | |||
| 36656 | POP AF | |||
| 36657 | LD (IY+16),A | |||
| 36660 | RET | |||
| Action_Dir_19 | 36661 | LD HL,44575 | HL="it is dark" | |
| 36664 | JP PrintMsg | Jump to PrintMsg. | ||
| 
This entry point is used by the routine at ActionClimbOut.
 | ||||
| Action_Dir_20 | 36667 | CALL 40741 | ||
| 
This entry point is used by the routines at Action_Enter and Action_Follow.
 | ||||
| Action_Dir_21 | 36670 | CP 255 | ||
| 36672 | JP Z,40822 | |||
| 36675 | LD A,(IX+2) | |||
| 36678 | CP 0 | |||
| 36680 | JP Z,40822 | |||
| 36683 | LD A,(IX+1) | |||
| 36686 | PUSH IX | |||
| 36688 | CALL Action_Dir_8 | |||
| 36691 | POP IX | |||
| 36693 | JP NZ,40822 | |||
| 36696 | CALL 40260 | |||
| 36699 | LD A,(IX+0) | |||
| 36702 | LD (46823),A | |||
| 36705 | LD A,255 | |||
| 36707 | LD (46824),A | |||
| 36710 | JP Action_Dir_0 | |||
| 36713 | LD IX,(46856) | |||
| 36717 | LD A,(46825) | |||
| 36720 | CP 23 | |||
| 36722 | JR Z,Action_Dir_23 | |||
| 36724 | CP 24 | |||
| 36726 | JR Z,Action_Dir_24 | |||
| Action_Dir_22 | 36728 | LD IY,(46858) | ||
| 36732 | BIT 1,(IY+7) | |||
| 36736 | JP Z,40822 | |||
| 36739 | BIT 2,(IX+7) | |||
| 36743 | LD A,130 | |||
| 36745 | JP NZ,DisplayExits_3 | |||
| 36748 | LD HL,37455 | |||
| 36751 | JP 40778 | |||
| Action_Dir_23 | 36754 | LD A,21 | ||
| 36756 | LD IY,50260 | |||
| 36760 | JR Action_Dir_25 | |||
| Action_Dir_24 | 36762 | LD A,22 | ||
| 36764 | LD IY,50281 | |||
| Action_Dir_25 | 36768 | LD (46825),A | ||
| 36771 | LD (46858),IY | |||
| 36775 | LD (IY+1),255 | |||
| 36779 | JR Action_Dir_22 | |||
| Prev: 36249 | Up: Map | Next: 36781 |