|  | Routines | 
| Prev: 37790 | Up: Map | Next: 38381 | 
| 
Used by the routine at ActionClimbOut.
 | ||||
| Action_Examine | 37850 | CALL 40260 | Call 40260. | |
| 37853 | LD A,(46824) | A=CurrentObject | ||
| 37856 | CALL LocateObject | Call LocateObject. | ||
| 37859 | LD L,(IX+14) | HL=offset for object help text. | ||
| 37862 | LD H,(IX+15) | |||
| 37865 | LD A,H | If this value is not $0000 then jump to PrintMsg. | ||
| 37866 | OR L | |||
| 37867 | JP NZ,PrintMsg | |||
| 37870 | LD HL,45056 | HL="You see[0x16]" | ||
| 37873 | CALL PrintMsg | Call PrintMsg. | ||
| 37876 | PUSH IX | IY=IX | ||
| 37878 | POP IY | |||
| 37880 | CALL 40647 | Call 40647. | ||
| 37883 | LD A,46 | |||
| 37885 | CALL 34187 | Call 34187. | ||
| 37888 | CALL 34179 | Call 34179. | ||
| 37891 | RET | Return. | ||
| 37892 | LD IX,(46856) | |||
| 37896 | CALL ActionClimbOut_4 | |||
| 37899 | JP Z,DisplayExits_3 | |||
| 37902 | LD A,(46824) | |||
| 37905 | CALL ObjectCount | |||
| 37908 | CP 0 | |||
| 37910 | JR Z,Action_Examine_0 | |||
| 37912 | CALL 40260 | |||
| 37915 | CALL 40272 | |||
| 37918 | RES 2,(IX+7) | |||
| 37922 | RET | |||
| Action_Examine_0 | 37923 | LD A,2 | ||
| 37925 | JP DisplayExits_3 | |||
| 37928 | CALL Action_Putdown_4 | |||
| 37931 | CALL 40260 | |||
| 37934 | LD A,(46838) | |||
| 37937 | LD IX,(46858) | |||
| 37941 | LD B,(IX+0) | |||
| Action_Examine_1 | 37944 | CP (IX+16) | ||
| 37947 | JR Z,Action_Examine_2 | |||
| 37949 | INC IX | |||
| 37951 | DJNZ Action_Examine_1 | |||
| 37953 | JP ICannotDoThat | |||
| Action_Examine_2 | 37956 | LD A,(IX+17) | ||
| 37959 | DEC B | |||
| 37960 | JR NZ,Action_Examine_3 | |||
| 37962 | XOR A | |||
| Action_Examine_3 | 37963 | PUSH AF | ||
| 37964 | LD HL,44540 | HL="and it get(s|d|ing|es) swept away" | ||
| 37967 | CALL PrintMsg | Call PrintMsg. | ||
| 37970 | POP AF | |||
| 37971 | LD IX,(46856) | |||
| 37975 | LD (IX+16),A | |||
| 37978 | LD (IX+1),255 | |||
| 37982 | LD B,A | |||
| 37983 | LD A,(46824) | |||
| 37986 | CALL 39901 | |||
| 37989 | LD A,(49451) | |||
| 37992 | AND A | |||
| 37993 | JP Z,YouAreDead | |||
| 37996 | RET | |||
| 
This entry point is used by the routine at ActionBurn.
 | ||||
| Action_Examine_4 | 37997 | CALL DisplayExits_15 | ||
| 38000 | JP NZ,DisplayExits_3 | |||
| 38003 | LD A,198 | |||
| Action_Examine_5 | 38005 | LD (38027),A | ||
| 38008 | LD IY,(46858) | |||
| 38012 | BIT 3,(IY+7) | |||
| 38016 | LD A,131 | |||
| 38018 | JP NZ,DisplayExits_2 | |||
| 38021 | CALL 40260 | |||
| 38024 | SET 0,(IX+7) | |||
| 38028 | RET | |||
| 
This entry point is used by the routine at ActionBurn.
 | ||||
| Action_Examine_6 | 38029 | LD IX,(46856) | ||
| 38033 | BIT 0,(IX+7) | |||
| 38037 | LD A,0 | |||
| 38039 | JP Z,DisplayExits_3 | |||
| 38042 | CALL DisplayExits_16 | |||
| 38045 | JP NZ,DisplayExits_3 | |||
| 38048 | LD A,134 | |||
| 38050 | JR Action_Examine_5 | |||
| 38052 | CALL Action_Look_1 | |||
| 38055 | LD A,(46825) | |||
| 38058 | CALL 40744 | |||
| 38061 | CP 255 | |||
| 38063 | JP Z,40822 | |||
| 38066 | LD IY,(46858) | |||
| 38070 | BIT 5,(IY+7) | |||
| 38074 | LD A,5 | |||
| 38076 | JP Z,DisplayExits_2 | |||
| 38079 | CALL 40260 | |||
| 38082 | LD B,(IX+2) | |||
| 38085 | LD IX,(46856) | |||
| 38089 | LD (IX+1),255 | |||
| 38093 | LD (IX+16),B | |||
| 38096 | LD A,(46824) | |||
| 38099 | JP 39901 | |||
| 
This entry point is used by the routine at 30673.
 | ||||
| Action_Examine_7 | 38102 | PUSH IX | ||
| 38104 | PUSH HL | |||
| 38105 | CALL 39748 | |||
| 38108 | LD A,0 | |||
| 38110 | JR Z,Action_Examine_8 | |||
| 38112 | LD A,(46823) | |||
| 38115 | LD IX,50992 | |||
| 38119 | CALL IndexIdTable | |||
| 38122 | CP 255 | |||
| 38124 | LD A,1 | |||
| 38126 | JR NZ,Action_Examine_8 | |||
| 38128 | CALL DisplayExits_11 | |||
| 38131 | LD A,1 | |||
| 38133 | JR Z,Action_Examine_8 | |||
| 38135 | LD A,(46824) | |||
| 38138 | CALL LocateObject | |||
| 38141 | LD A,(46823) | |||
| 38144 | CALL 39809 | |||
| 38147 | LD A,1 | |||
| 38149 | JR C,Action_Examine_8 | |||
| 38151 | SUB A | |||
| Action_Examine_8 | 38152 | LD (46843),A | ||
| 38155 | POP HL | |||
| 38156 | POP IX | |||
| 38158 | RET | |||
| Action_Examine_9 | 38159 | PUSH HL | ||
| 38160 | PUSH IX | |||
| 38162 | PUSH BC | |||
| 38163 | CALL 39748 | |||
| 38166 | JP Z,Action_Examine_15 | |||
| 38169 | CALL LocationLit | |||
| 38172 | JR NC,Action_Examine_11 | |||
| 38174 | LD A,(46865) | |||
| 38177 | AND A | |||
| 38178 | JR NZ,Action_Examine_10 | |||
| 38180 | CALL 40056 | |||
| 38183 | JR NC,Action_Examine_10 | |||
| 38185 | LD A,(46825) | |||
| 38188 | CALL 40059 | |||
| 38191 | JR C,Action_Examine_11 | |||
| Action_Examine_10 | 38193 | LD HL,44996 | HL="i see nothing here" | |
| 38196 | CALL PrintMsg | Call PrintMsg. | ||
| 38199 | JR CheckLit | |||
| Action_Examine_11 | 38201 | LD A,(46846) | ||
| 38204 | CP 1 | |||
| 38206 | JP Z,CheckValidAction | |||
| 38209 | LD A,(46824) | |||
| 38212 | CP 255 | |||
| 38214 | JP Z,CheckValidAction | |||
| 38217 | CALL LocateObject | |||
| 38220 | LD (46856),IX | |||
| 38224 | LD A,(46824) | |||
| 38227 | CALL 38696 | |||
| 38230 | JR NZ,CheckLit | |||
| 38232 | LD A,(46825) | |||
| 38235 | CP 255 | |||
| 38237 | JR Z,Action_Examine_12 | |||
| 38239 | LD A,(46847) | |||
| 38242 | CP 1 | |||
| 38244 | JR Z,CheckValidAction | |||
| 38246 | LD A,(46825) | |||
| 38249 | CALL LocateObject | |||
| 38252 | LD (46858),IX | |||
| 38256 | CALL 38696 | |||
| 38259 | JR NZ,CheckLit | |||
| 38261 | CALL DisplayExits_11 | |||
| 38264 | JR Z,Action_Examine_13 | |||
| Action_Examine_12 | 38266 | LD IX,(46856) | ||
| Action_Examine_13 | 38270 | LD A,(46823) | ||
| 38273 | CALL 39809 | |||
| 38276 | JR NC,CheckValidAction | |||
| Action_Examine_14 | 38278 | LD L,(IX+1) | Fetch the action address from the action table and store it in HL. | |
| 38281 | LD H,(IX+2) | |||
| 38284 | CALL TriggerAction | Call TriggerAction. | ||
| 38287 | INC IX | |||
| 38289 | INC IX | |||
| 38291 | INC IX | |||
| 38293 | SUB A | |||
| 38294 | CP (IX+0) | |||
| 38297 | JR Z,Action_Examine_14 | |||
| CheckLit | 38299 | LD A,(46842) | If 46842 is not $01 then jump to CheckReturn. | |
| 38302 | CP 1 | |||
| 38304 | JR NZ,CheckReturn | |||
| 
This check is a little unnecessary as the first thing the routine at LocationLit does, is to check exactly this...
 | ||||
| 38306 | LD A,(46826) | If CurrentCharacter is not $00 (i.e. "You") then skip the "is location lit" check, instead jump to CheckAction. | ||
| 38309 | CP 0 | |||
| 38311 | JR NZ,CheckAction | |||
| 
LocationLit uses the carry flag to indicate if it is light or dark.
 | ||||
| 38313 | CALL LocationLit | If the location is dark then call PrintMsg to tell the user "it is dark". | ||
| 38316 | CALL C,PrintMsg | |||
| CheckAction | 38319 | LD A,(46823) | B=CurrentAction. | |
| 38322 | LD B,A | |||
| 38323 | LD A,(46824) | Call Action_Examine_16 with IX=46856 and A=CurrentObject. | ||
| 38326 | LD IX,(46856) | |||
| 38330 | CALL Action_Examine_16 | |||
| 38333 | LD A,(46825) | Call Action_Examine_16 with IX=46858 and A=46825. | ||
| 38336 | LD IX,(46858) | |||
| 38340 | CALL Action_Examine_16 | |||
| 
Performs housekeeping and returns.
 | ||||
| CheckReturn | 38343 | POP BC | Restore BC, IX and HL from the stack. | |
| 38344 | POP IX | |||
| 38346 | POP HL | |||
| 38347 | RET | Return. | ||
| 
Checks if the action given is valid.
 | ||||
| CheckValidAction | 38348 | LD A,(46823) | Call IndexIdTable with ActionTable, to match the key value of CurrentAction. | |
| 38351 | LD IX,50992 | |||
| 38355 | CALL IndexIdTable | |||
| 38358 | CP 255 | If the termination character was not reached because an action did match, jump to Action_Examine_14. | ||
| 38360 | JR NZ,Action_Examine_14 | |||
| Action_Examine_15 | 38362 | CALL ICannotDoThat | Else, call ICannotDoThat and jump to CheckReturn. | |
| 38365 | JR CheckReturn | |||
| 
This entry point is used by the routine at Action_ThrowAt.
 | ||||
| Action_Examine_16 | 38367 | BIT 6,(IX+7) | Return if the object is marked as being a "Fluid". | |
| 38371 | RET Z | |||
| 38372 | BIT 3,(IX+7) | Return if the object is not marked as "Gives Light". | ||
| 38376 | RET NZ | |||
| 38377 | CALL 39584 | Call 39584. | ||
| 38380 | RET | Return. | ||
| Prev: 37790 | Up: Map | Next: 38381 |