File tree Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -1126,13 +1126,32 @@ get_found_it_take:
1126
1126
inc hl
1127
1127
ld (hl),255
1128
1128
1129
- ; HACK - Was the item being taken the rug?
1129
+ ;
1130
+ ; HACK - We don't have a notion of a take-handler
1131
+ ; so we can't show the trapdoor when the rug
1132
+ ; is taken.
1133
+ ;
1134
+ ; Hardwire that behaviour here, even though that
1135
+ ; is horrid.
1136
+ ;
1137
+ ; The alternative would have been to give some kind of
1138
+ ; "rug covers other objects" property to the rug.
1139
+ ;
1130
1140
ld de, tmp_buffer+1
1131
1141
ld hl, item_7_name
1132
1142
ld b, 3 ; strlen("RUG")
1133
1143
call CompareStringsWithLength
1134
1144
jp nz, not_taken_rug
1135
1145
1146
+ ; Taking the rug should only trigger this behaviour
1147
+ ; once - store state in `RUG_TAKEN` and ensure it
1148
+ ; doesn't get triggered more than once.
1149
+ ld hl, RUG_TAKEN
1150
+ ld a,(hl)
1151
+ cp 0
1152
+ jr nz, not_taken_rug
1153
+ inc (hl)
1154
+
1136
1155
; show a message telling the user about the trapdoor.
1137
1156
ld de, rug_taken_msg
1138
1157
call show_msg
@@ -1902,7 +1921,8 @@ PLAYER_WON:
1902
1921
db 0
1903
1922
MAGIC_LOCATION
1904
1923
db 0
1905
-
1924
+ RUG_TAKEN:
1925
+ db 0
1906
1926
1907
1927
;********************************************************************
1908
1928
; String Area
You can’t perform that action at this time.
0 commit comments