Prev: A3E6 Up: Map Next: AB53
A541: Action: ClimbOut
ActionClimbOut A541 LD IY,($B70C) IY=ptrCurObject.
A545 LD A,($B6E8) A=CurrentObject.
A548 CP (IY+$01) If this is not a mother object (i.e. something to climb out of) jump to 9F76.
A54B JP NZ,$9F76
A54E CALL LocateObject Call LocateObject.
A551 CALL ActionClimbOut_4 Call ActionClimbOut_4.
A554 JP Z,DisplayExits_3
A557 CALL $9D44 Call 9D44.
A55A LD (IY+$01),$FF
A55E RET Return.
A55F LD IY,($B70C)
A563 LD A,($B6E8)
A566 CP (IY+$01)
A569 JP Z,$9F76
A56C LD IY,($B708)
A570 CALL $9E34
A573 JP Z,$9F76
A576 LD A,($B6E8)
ActionClimbOut_0 A579 CALL LocateObject
A57C LD A,(IX+$01)
A57F CP $FF
A581 JR Z,ActionClimbOut_1
A583 LD A,($B6EA)
A586 CP (IX+$01)
A589 LD A,(IX+$01)
A58C JR NZ,ActionClimbOut_0
A58E LD IX,($B708)
A592 LD (IX+$01),$FF
ActionClimbOut_1 A596 LD IY,($B70C)
A59A LD A,($B6EA)
A59D CALL $9CE8
A5A0 ADD A,(IY+$02)
A5A3 JR C,ActionClimbOut_2
A5A5 LD A,$FF
ActionClimbOut_2 A5A7 LD B,A
A5A8 LD IX,($B708)
A5AC CALL ActionClimbOut_4
A5AF JP Z,DisplayExits_3
A5B2 LD A,(IX+$02)
A5B5 CP $FF
A5B7 JR Z,ActionClimbOut_3
A5B9 SUB B
A5BA LD HL,$B13E
A5BD JP NC,PrintMsg
ActionClimbOut_3 A5C0 CALL $9D44
A5C3 LD A,($B6E8)
A5C6 LD (IY+$01),A
A5C9 RET
This entry point is used by the routines at Action_Dir, 910E and Action_Examine.
ActionClimbOut_4 A5CA BIT 5,(IX+$07)
A5CE LD A,$05
A5D0 RET
A5D1 CALL $9D44
A5D4 LD HL,$C452
A5D7 LD A,($C12B)
A5DA CP (HL)
A5DB RET NZ
A5DC LD HL,$B085 HL="the vicious warg run around you and howls.".
A5DF JP $97F4
A5E2 LD A,($B6E8)
A5E5 CP $13
A5E7 RET NZ
A5E8 CALL $97FF
A5EB LD IX,$C3EE IX="Barrel".
A5EF LD A,(IX+$10) A=location of the "Barrel".
A5F2 CP $21 Return if "Barrel" is not at location $21 - "Forestriver".
A5F4 RET NZ
A5F5 LD A,$02
A5F7 LD ($CA85),A
A5FA RET
A5FB SUB A
A5FC LD ($B6F0),A
A5FF LD A,($C11C) A=player mother object.
A602 CP $13 Is the player inside object $13, i.e. using the "Barrel"?
A604 LD HL,$B32C HL="you are thrown onto the bank of the long lake".
A607 CALL Z,PrintMsg If so, call PrintMsg.
A60A LD A,$22
A60C LD ($C3FE),A
A60F LD B,A
A610 LD A,$13
A612 CALL $9BDD
A615 LD IX,$C3EE IX="Barrel".
A619 LD (IX+$10),$20 Update the location of the object to location $20 - "Elvenkings Cellar".
A61D RES 5,(IX+$07)
A621 SET 2,(IX+$07)
A625 SUB A
A626 LD ($B702),A
A629 LD A,$13
A62B CALL $9D53
A62E LD A,$01
A630 LD ($B702),A
A633 LD IY,$C418 IY=Object $14 - "Wine".
A637 LD (IY+$10),$20
A63B LD (IY+$01),$13
A63F RET Return.
A640 LD A,($B6F6)
A643 LD HL,$B6F5
A646 CP (HL)
A647 RET NZ
A648 LD A,($C122)
A64B BIT 7,A
A64D RET NZ
A64E CALL $9D44
A651 LD HL,$B0CB HL="where's the thief ?[0x16]".
A654 JP DisplayExits_14
A657 CALL $9D44
A65A LD A,$08
A65C CALL GetRandomNum
A65F CP $05
A661 RET NC
A662 CP $03
A664 LD HL,$B0F4 HL="thorin wait.".
A667 JP NC,$97F4
A66A LD HL,$B0D5 HL="get us out of this one, thief ![0x16]".
A66D JP Z,DisplayExits_14
A670 LD HL,$B0E5 HL="thorin sit(s|d|ing|es) down and start(s|d|ing|es) sing(s|d|ing|es) about gold.".
A673 CP $00
A675 JP Z,$97F4
A678 LD HL,$B05B HL="hurry up.".
A67B JP DisplayExits_14
A67E LD IX,($B70C)
A682 LD A,(IX+$10)
A685 CP $20
A687 LD HL,$B11B HL="you cannot reach[0x07][0x15]".
A68A JP NZ,PrintMsg
A68D LD A,($B6E7)
A690 CP $0C
A692 JP Z,$9138
A695 JP $910E
A698 LD A,($C12B)
A69B CP $27
A69D JR Z,ActionClimbOut_5
A69F CP $2C
A6A1 JR Z,ActionClimbOut_5
A6A3 CP $29
A6A5 RET NZ
ActionClimbOut_5 A6A6 CALL $9D44
A6A9 LD A,($C12B)
A6AC LD HL,$C143
A6AF CP (HL)
A6B0 RET Z
A6B1 LD (HL),A
A6B2 LD A,$01
A6B4 LD ($B702),A
A6B7 LD HL,$C13B
A6BA PUSH HL
A6BB LD HL,$B017 HL="[0x00] enter(s|d|ing|es).[0x14]".
ActionClimbOut_6 A6BE CALL PrintMsg
A6C1 RET
A6C2 LD A,($C12B)
A6C5 LD HL,$B6F6
A6C8 CP (HL)
A6C9 RET NZ
A6CA CALL $9D44
A6CD LD A,($C122)
A6D0 AND $80
A6D2 LD HL,$B17E
A6D5 JR Z,ActionClimbOut_7
A6D7 LD HL,$B15D
ActionClimbOut_7 A6DA JR ActionClimbOut_6
A6DC LD A,($C5DD)
A6DF CP $29
A6E1 RET Z
A6E2 LD A,($C12B)
A6E5 CALL LocateLocation
A6E8 BIT 7,(IX+$00)
A6EC RET Z
A6ED CALL $9D44
A6F0 LD A,$01
A6F2 LD ($B702),A
A6F5 LD HL,$B1A6
A6F8 LD A,$64
A6FA CALL GetRandomNum
A6FD CP $50
A6FF JR C,ActionClimbOut_6
A701 LD HL,$B1BA
A704 CALL PrintMsg
A707 JP YouAreDead
A70A CALL $9F25
A70D CP $FF
A70F RET Z
A710 SUB A
A711 LD (IX+$00),$00
A715 LD (IX+$01),$00
A719 LD (IX+$02),$00
A71D RET
A71E CALL $9D44
A721 LD IX,($B70C)
A725 BIT 7,(IX+$07)
A729 LD HL,$AFF4
A72C JP NZ,PrintMsg
A72F LD A,($CAA7)
A732 LD ($CAA8),A
A735 LD HL,$B2AA
A738 JP PrintMsg
A73B LD HL,$C3B9
A73E BIT 3,(HL)
A740 RET Z
A741 CALL $97FF
A744 LD IX,$C1AD
A748 SET 3,(IX+$07)
A74C LD A,$02
A74E CALL DisplayExits_6
A751 LD A,$02
A753 LD IY,$C11B
A757 CALL $9E25
A75A RET Z
A75B LD HL,$B109
A75E JP PrintMsg
A761 LD A,($B6EA)
A764 CP $00
A766 JR NZ,ActionClimbOut_8
A768 LD A,($C11C)
A76B LD HL,$B11B
A76E CP $FF
A770 JP Z,PrintMsg
A773 JP $9F76
ActionClimbOut_8 A776 LD A,($B6E7)
A779 CP $0C
A77B JP Z,$9138
A77E CP $10
A780 JP Z,$910E
A783 RET
A784 LD A,($B6EA)
A787 CP $00
A789 JP NZ,ActionClimbOut_9
A78C LD A,($C11C)
A78F CP $FF
A791 LD HL,$B11B
A794 JP Z,PrintMsg
ActionClimbOut_9 A797 LD A,($B6E7)
A79A CP $1E
A79C JP Z,Action_Dir_20
A79F CP $0B
A7A1 JP Z,Action_Attack_17
A7A4 CP $18
A7A6 JP Z,Action_Dir_18
A7A9 RET
A7AA LD A,($C12B)
A7AD CP $1D
A7AF JR NZ,ActionClimbOut_10
A7B1 SUB A
A7B2 LD ($CAA1),A
ActionClimbOut_10 A7B5 LD HL,$B153
A7B8 CALL PrintMsg
A7BB LD A,($CAA1)
A7BE CP $00
A7C0 RET NZ
A7C1 JP YouAreDead
A7C4 LD A,($B6EA)
A7C7 CP $41
A7C9 JP NZ,Action_Examine
A7CC CALL $9D44
A7CF LD IY,$0000
A7D3 LD L,(IY+$01)
A7D6 LD H,(IY+$02)
A7D9 LD A,($B6F1)
A7DC CP $00
A7DE JR NZ,ActionClimbOut_12
A7E0 LD B,$03
ActionClimbOut_11 A7E2 LD A,(IY+$03)
A7E5 LD (HL),A
A7E6 INC HL
A7E7 INC IY
A7E9 DJNZ ActionClimbOut_11
A7EB LD IY,($A7D1)
ActionClimbOut_12 A7EF LD A,(IY+$05)
A7F2 CALL LocateLocation
A7F5 INC IX
A7F7 INC IX
A7F9 PUSH IX
A7FB LD A,(IY+$00)
A7FE CALL LocateLocation
A801 INC IX
A803 INC IX
A805 PUSH IX
A807 LD A,(IY+$03)
A80A CALL $A0BA
A80D PUSH DE
A80E LD HL,$B1D0
A811 JP DisplayExits_14
A814 LD A,($B6E9)
A817 CALL $9F28
A81A CP $FF
A81C JP Z,$9F76
A81F CALL $9D44
A822 LD HL,$AF66
A825 CALL PrintMsg
A828 LD A,($C62B)
A82B CP (IX+$02)
A82E JR NZ,ActionClimbOut_14
A830 CALL ActionClimbOut_16
A833 JR C,ActionClimbOut_13
A835 LD HL,$AF76
A838 CALL ActionClimbOut_16
A83B JR C,ActionClimbOut_15
A83D LD HL,$AF82
A840 JR ActionClimbOut_15
ActionClimbOut_13 A842 LD A,$12
A844 LD ($C61C),A
A847 LD HL,$AF8B
A84A JR ActionClimbOut_15
ActionClimbOut_14 A84C LD HL,$AF76
A84F CALL ActionClimbOut_16
A852 JR C,ActionClimbOut_15
A854 LD A,(IX+$02)
A857 LD IX,($B708)
A85B LD (IX+$10),A
A85E LD (IX+$01),$FF
A862 LD A,($B6E8)
A865 CALL $9BDD
A868 LD HL,$AF6D
ActionClimbOut_15 A86B JP PrintMsg
ActionClimbOut_16 A86E LD A,$64
A870 CALL GetRandomNum
A873 CP $32
A875 RET
A876 CALL $9D44
A879 LD A,($C61C)
A87C CP $12
A87E RET NZ
A87F LD HL,$AF92
ActionClimbOut_17 A882 CALL PrintMsg
A885 LD A,($C62B)
A888 CP $42
A88A LD A,$42
A88C JR NZ,ActionClimbOut_18
A88E LD A,$43
ActionClimbOut_18 A890 LD ($C62B),A
A893 LD B,A
A894 LD A,$FF
A896 LD ($C61C),A
A899 LD A,$29
A89B JP $9BDD
A89E CALL $97FF
A8A1 LD A,($B6EA)
A8A4 AND A
A8A5 RET NZ
A8A6 LD HL,$AFA4
A8A9 JR ActionClimbOut_17
A8AB LD A,($B6F4)
A8AE CP $01
A8B0 RET NZ
A8B1 SUB A
A8B2 LD ($B6F4),A
A8B5 INC A
A8B6 CALL $7F1A
A8B9 RET Z
A8BA SUB A
A8BB LD ($B6FB),A
A8BE LD A,($B6E6)
A8C1 LD ($C9E3),A
A8C4 LD BC,($B6E8)
A8C8 LD ($C9E4),BC
A8CC LD A,$42
A8CE LD ($C9E2),A
A8D1 RET
A8D2 LD A,($C4C1)
A8D5 LD HL,$B6F5
A8D8 CP (HL)
A8D9 RET NZ
A8DA LD HL,$C122
A8DD BIT 7,(HL)
A8DF RET Z
A8E0 CALL $9D44
A8E3 LD HL,($B6EE)
A8E6 INC HL
A8E7 INC HL
A8E8 LD E,(HL)
A8E9 INC HL
A8EA LD D,(HL)
A8EB PUSH DE
A8EC POP HL
A8ED CALL DisplayExits_14
A8F0 LD A,$01
A8F2 LD ($B6F9),A
A8F5 RET
A8F6 CALL $9D44
A8F9 SUB A
A8FA LD ($B6F9),A
A8FD CALL $7F1A
A900 JR Z,ActionClimbOut_20
A902 LD BC,$0018
A905 LD DE,($B6EE)
A909 LD A,(DE)
ActionClimbOut_19 A90A CPIR
A90C JR NZ,ActionClimbOut_20
A90E INC DE
A90F LD A,(DE)
A910 DEC DE
A911 CP (HL)
A912 JR NZ,ActionClimbOut_19
A914 RET
ActionClimbOut_20 A915 CALL $9D44
A918 LD A,$01 Set NightDay to $01 (daytime).
A91A LD ($B702),A
A91D LD HL,$B1DB HL="someone strangle(s|d|ing|es) you from behind".
A920 CALL PrintMsg Call PrintMsg.
A923 JP YouAreDead Jump to YouAreDead.
A926 LD A,($C4C1)
A929 LD HL,$B6F5
A92C CP (HL)
A92D RET NZ
A92E CALL $9D44
A931 LD HL,$B2D9
A934 LD A,$08
A936 CALL GetRandomNum
A939 JP NC,DisplayExits_14
A93C LD IX,$C31A
A940 LD A,$44
A942 CP (IX+$01)
A945 JP Z,DisplayExits_14
A948 LD HL,$B2E7
A94B JP DisplayExits_14
A94E LD A,($B6F6)
A951 LD HL,$B6F5
A954 CP (HL)
A955 RET NZ
A956 CALL $9D44
A959 LD A,$1B
A95B LD ($B6E7),A
A95E LD A,$00
A960 LD ($B6E8),A
A963 LD A,$FF
A965 LD ($B6E9),A
A968 CALL $9F76
A96B CALL Action_Attack_13
A96E JP YouAreDead
A971 CALL $9D44 Call 9D44.
A974 LD A,$47 Call 977F using object $47 - "Hideous Troll".
A976 CALL $977F
A979 LD A,$48 Call 977F using object $48 - "Vicious Troll".
A97B CALL $977F
A97E LD HL,$C646 HL=attributes for $47 - "Hideous Troll".
A981 RES 7,(HL) Reset bit 7 of the attribute byte set to "Visible" = "No".
A983 LD HL,$C658 HL=attributes for $48 - "Vicious Troll".
A986 RES 7,(HL) Reset bit 7 of the attribute byte set to "Visible" = "No".
A988 LD HL,$B262 HL="in a clearing with two stone trolls.".
A98B LD ($BAC4),HL Write HL to the empty location description for $05 - "Trolls Clearing".
A98E LD HL,$BABC HL=Location $05 - "Trolls Clearing".
A991 RES 6,(HL) Reset bit 6 of the attribute byte.
A993 LD A,$47 Call 9D53 using object $47 - "Hideous Troll".
A995 CALL $9D53
A998 LD A,$48 Call 9D53 using object $48 - "Vicious Troll".
A99A CALL $9D53
A99D LD HL,$B30B HL="day dawn(s|d|ing|es)".
A9A0 LD A,$01 Set NightDay to $01 (daytime).
A9A2 LD ($B702),A
A9A5 CALL PrintMsg Call PrintMsg.
A9A8 LD IX,$CC00 IX=LocGFXTable.
A9AC LD A,$05 Load the graphics data for E142 "Trolls Clearing".
A9AE CALL IndexIdTable
A9B1 LD L,(IX+$01) HL=graphics data pointer.
A9B4 LD H,(IX+$02)
A9B7 LD (HL),$05 Change the paper colour to $05 (cyan).
A9B9 INC HL Increment the graphics data pointer by one.
A9BA LD (HL),$28 Change the ??? colour to $28 ().
A9BC RET Return.
A9BD LD A,($B6F5)
A9C0 CP $05
A9C2 RET NZ
A9C3 CALL $9D44
A9C6 LD A,($B6EA)
A9C9 LD HL,$B238 HL="blimey, look at this!! Can yer cook'em?[0x16]".
A9CC CP $47
A9CE JR Z,ActionClimbOut_21
A9D0 LD HL,$B24C HL="yer can try, but he wouldn't make above a mouthfull.".
ActionClimbOut_21 A9D3 JP DisplayExits_14 Jump to DisplayExits_14.
This entry point is used by the routine at 96B3.
ActionClimbOut_22 A9D6 LD A,($C5CE)
A9D9 CP $25
A9DB RET NZ
A9DC LD HL,$B3D9 HL=B3D9.
A9DF CALL PrintMsg Call PrintMsg.
A9E2 JP YouAreDead_WaitForKey Jump to YouAreDead_WaitForKey.
A9E5 LD A,($B6F6)
A9E8 LD HL,$B6F5
A9EB CP (HL)
A9EC RET NZ
A9ED LD IX,$C663
A9F1 LD A,(IX+$10)
A9F4 CP $00
A9F6 JR Z,ActionClimbOut_23
A9F8 LD A,$41
A9FA CP (IX+$01)
A9FD RET NZ
ActionClimbOut_23 A9FE CALL $9D44
AA01 LD A,($B6F6)
AA04 LD (IX+$10),A
AA07 LD (IX+$01),$41
AA0B LD BC,$0026
AA0E LD ($B6E8),BC
AA12 LD A,$1D
AA14 LD ($B6E7),A
AA17 LD ($B708),IX
AA1B LD HL,$C11B
AA1E LD ($B70A),HL
AA21 CALL $9F76
AA24 JP Action_Give
AA27 LD IY,($B708)
AA2B LD A,(IY+$10)
AA2E LD B,A
AA2F CALL $9F2D
AA32 CP $FF
AA34 LD HL,$B301
AA37 JP Z,PrintMsg
AA3A LD A,(IX+$00)
AA3D CP $0A
AA3F JP NZ,$B301
AA42 CALL $9D44
AA45 LD A,($B6E8)
AA48 LD IX,($B70C)
AA4C LD (IX+$01),A
AA4F CALL $9BDD
AA52 LD A,($B6EA)
AA55 CP $00
AA57 RET NZ
AA58 LD A,B
AA59 JP YouSeePreposition
AA5C LD IX,$C205
AA60 RES 3,(IX+$07)
AA64 RES 5,(IX+$07)
AA68 SLA (IX+$05)
AA6C LD DE,$0623
AA6F LD ($C20F),DE
AA73 RET
AA74 LD HL,$C2BC
AA77 BIT 5,(HL)
AA79 RET NZ
AA7A LD A,($CAC3)
AA7D LD ($CAC4),A
AA80 LD HL,$C2BC
AA83 RES 7,(HL)
AA85 LD A,($C12B)
AA88 CP $2A
AA8A RET NZ
ActionClimbOut_24 AA8B LD HL,$B2A4 HL="the hole vanish(s|d|ing|es)[0x15]".
AA8E JP PrintMsg Jump to PrintMsg.
AA91 LD HL,$C2BC HL=attributes for object $0B - "Mountains Side Door".
AA94 SET 7,(HL) Set bit 7 of the attribute byte to "Visible" = "Yes".
AA96 LD A,($C12B)
AA99 CP $2A
AA9B RET NZ
AA9C LD HL,$B277 HL=B277.
AA9F JP PrintMsg Jump to PrintMsg.
AAA2 CALL $97FF
AAA5 LD A,$06
AAA7 LD ($CAC4),A
AAAA LD HL,$C2BC
AAAD SET 0,(HL)
AAAF RES 7,(HL)
AAB1 JR ActionClimbOut_24
AAB3 LD HL,$C388
AAB6 SET 5,(HL)
AAB8 LD HL,$B037 HL="the magic door open(s|d|ing|es).[0x14]".
AABB CALL ActionClimbOut_25
AABE LD HL,$B113
AAC1 CALL ActionClimbOut_25
AAC4 JP ActionClimbOut_26
ActionClimbOut_25 AAC7 LD A,($C12B)
AACA CP $1E
AACC JP Z,PrintMsg
AACF CP $1C
AAD1 JP Z,PrintMsg
AAD4 RET
AAD5 LD HL,$C388
AAD8 RES 5,(HL)
AADA LD HL,$B03F HL="the magic door close(s|d|ing|es).[0x14]".
AADD JP ActionClimbOut_25
ActionClimbOut_26 AAE0 LD IX,$C31A
AAE4 LD A,(IX+$01)
AAE7 CP $FF
AAE9 RET Z
AAEA CALL LocateObject
AAED LD ($B70C),IX
AAF1 BIT 7,(IX+$07)
AAF5 JP Z,ActionBurn_4
AAF8 RET
AAF9 LD A,($B6EA)
AAFC CP $00
AAFE RET NZ
AAFF LD A,$01
AB01 LD ($B700),A
AB04 LD A,($CAB5)
AB07 LD ($CAB6),A
AB0A RET
AB0B SUB A
AB0C LD ($B700),A
AB0F RET
AB10 LD A,($C12B)
AB13 CP $1A
AB15 RET NZ
AB16 LD HL,$B0FD HL="the spider web is slowly smothering you.".
AB19 CALL PrintMsg Call PrintMsg.
AB1C JP YouAreDead Jump to YouAreDead.
AB1F LD HL,$B311 HL="You see some pale bulbous eyes star(s|d|ing|es) at You[0x15]".
AB22 CALL PrintMsg Call PrintMsg.
AB25 LD A,($C12B)
AB28 LD C,A
AB29 LD HL,$B6F3
AB2C CP (HL)
AB2D RET Z
AB2E LD B,(HL)
AB2F LD A,$02
AB31 CP B
AB32 JR NZ,ActionClimbOut_27
AB34 LD A,$03
ActionClimbOut_27 AB36 CP C
AB37 RET Z
AB38 JR ActionClimbOut_29
AB3A LD A,($C12B)
AB3D CP $02
AB3F JR Z,ActionClimbOut_28
AB41 CP $03
AB43 RET NZ
ActionClimbOut_28 AB44 LD HL,$B311 HL="You see some pale bulbous eyes star(s|d|ing|es) at You[0x15]".
AB47 CALL PrintMsg Call PrintMsg.
ActionClimbOut_29 AB4A LD HL,$B31F HL="some thing drop(s|d|ing|es) from above and sting(s|d|ing|es)[0x15]".
AB4D CALL PrintMsg Call PrintMsg.
AB50 JP YouAreDead Jump to YouAreDead.
Prev: A3E6 Up: Map Next: AB53