forked from CaitSith2/z3randomizer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
contrib.asm
183 lines (149 loc) · 4.03 KB
/
contrib.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
;================================================================
; Contributor: Myramong
;================================================================
;Sprite_ShowMessageFromPlayerContact_Edit:
;{
; STZ $1CE8
; JSL.l Sprite_CheckDamageToPlayerSameLayerLong : BCC .dont_show
;
; LDA $4D : CMP.b #$02 : BEQ .dont_show
;
; JSL.l Sprite_DirectionToFacePlayerLong : TYA : EOR.b #$03
; SEC
;RTL
;.dont_show
; LDA $0DE0, X
; CLC
;RTL
;}
;================================================================
;Sprite_ShowSolicitedMessageIfPlayerFacing_Edit:
;{
; JSL.l Sprite_CheckDamageToPlayerSameLayerLong : BCC .alpha
; JSL.l Sprite_CheckIfPlayerPreoccupied : BCS .alpha
; LDA $F6 : BPL .alpha
; LDA $0F10, X : BNE .alpha
;
; LDA $4D : CMP.b #$02 : BEQ .alpha
;
; STZ $1CE8 ; set text choice to 1st option (usually yes/confirm/etc)
; JSL.l Sprite_DirectionToFacePlayerLong : PHX : TYX
;
; ; Make sure that the sprite is facing towards the player, otherwise
; ; talking can't happen. (What sprites actually use this???)
; LDA $05E1A3, X : PLX : CMP $2F : BNE .not_facing_each_other
; PHY
; LDA.b #$40 : STA $0F10, X
; PLA : EOR.b #$03
; SEC
;RTL
;.not_facing_each_other
;.alpha
; LDA $0DE0, X
; CLC
;RTL
;}
;================================================================
;OldMountainMan_TransitionFromTagalong_Edit:
;{
; PHA
;
; LDA.b #$AD : JSL Sprite_SpawnDynamically
;
; PLA : PHX : TAX
;
; LDA $1A64, X : AND.b #$03 : STA $0EB0, Y
; STA $0DE0, Y
;
; LDA $1A00, X : CLC : ADC.b #$02 : STA $0D00, Y
; LDA $1A14, X : ADC.b #$00 : STA $0D20, Y
;
; LDA $1A28, X : CLC : ADC.b #$02 : STA $0D10, Y
; LDA $1A3C, X : ADC.b #$00 : STA $0D30, Y
;
; LDA $EE : STA $0F20, Y
;
; LDA.b #$01 : STA $0BA0, Y
; STA $0E80, Y
;
; LDA.b #$01 : STA $02E4 ; OldMountainMan_FreezePlayer
; STA $037B ; ^
;
; PLX
;
; LDA.b #$00 : STA $7EF3CC
;
; STZ $5E
;
; JML $09A6B6 ; <- 4A6B6 tagalong.asm:1194 (SEP #$30 : RTS)
;}
;================================================================
!MAP_OVERLAY = "$7EF414" ; [2]
Sprite_ShowSolicitedMessageIfPlayerFacing_Alt:
{
STA $1CF0
STY $1CF1
JSL Sprite_CheckDamageToPlayerSameLayerLong : BCC .alpha
JSL Sprite_CheckIfPlayerPreoccupied : BCS .alpha
LDA $F6 : BPL .alpha
LDA $0F10, X : BNE .alpha
LDA $4D : CMP.b #$02 : BEQ .alpha
JSL Sprite_DirectionToFacePlayerLong : PHX : TYX
; Make sure that the sprite is facing towards the player, otherwise
; talking can't happen. (What sprites actually use this???)
LDA $05E1A3, X : PLX : CMP $2F : BNE .not_facing_each_other
PHY
LDA $1CF0
LDY $1CF1
; Check what room we're in so we know which npc we're talking to
LDA.b $A0 : CMP #$05 : BEQ .SahasrahlaDialogs
CMP #$1C : BEQ .BombShopGuyDialog
BRA .SayNothing
.SahasrahlaDialogs
REP #$20 : LDA.l MapReveal_Sahasrahla : ORA !MAP_OVERLAY : STA !MAP_OVERLAY : SEP #$20
JSL DialogSahasrahla : BRA .SayNothing
.BombShopGuyDialog
REP #$20 : LDA.l MapReveal_BombShop : ORA !MAP_OVERLAY : STA !MAP_OVERLAY : SEP #$20
JSL DialogBombShopGuy
.SayNothing
LDA.b #$40 : STA $0F10, X
PLA : EOR.b #$03
SEC
RTL
.not_facing_each_other
.alpha
LDA $0DE0, X
CLC
RTL
}
;================================================================
Sprite_ShowSolicitedMessageIfPlayerFacing_PreserveMessage:
{
PHY
PHA
JSL Sprite_CheckDamageToPlayerSameLayerLong : BCC .alpha
JSL Sprite_CheckIfPlayerPreoccupied : BCS .alpha
LDA $F6 : BPL .alpha
LDA $0F10, X : BNE .alpha
LDA $4D : CMP.b #$02 : BEQ .alpha
JSL Sprite_DirectionToFacePlayerLong : PHX : TYX
; Make sure that the sprite is facing towards the player, otherwise
; talking can't happen. (What sprites actually use this???)
LDA $05E1A3, X : PLX : CMP $2F : BNE .not_facing_each_other
PLA : XBA : PLA
PHY
TAY : XBA
JSL Sprite_ShowMessageUnconditional
LDA.b #$40 : STA $0F10, X
PLA : EOR.b #$03
SEC
RTL
.not_facing_each_other
.alpha
PLY
PLA
LDA $0DE0, X
CLC
RTL
}
;================================================================