@@ -127,19 +127,42 @@ s16 func_80A9C6C0(PlayState* play, Actor* thisx) {
127
127
s16 ret = NPC_TALK_STATE_TALKING ;
128
128
129
129
switch (Message_GetState (& play -> msgCtx )) {
130
+ case TEXT_STATE_DONE :
131
+ if (CVarGetInteger ("gRestorations.EarlyEyeballFrog" , 0 )) {
132
+ if (Message_ShouldAdvance (play )) {
133
+ ret = NPC_TALK_STATE_ITEM_GIVEN ;
134
+ }
135
+ } else {
136
+ ret = NPC_TALK_STATE_IDLE ;
137
+ switch (this -> actor .textId ) {
138
+ case 0x4012 :
139
+ Flags_SetInfTable (INFTABLE_139 );
140
+ ret = NPC_TALK_STATE_ACTION ;
141
+ break ;
142
+ case 0x401B :
143
+ ret = !Message_ShouldAdvance (play ) ? NPC_TALK_STATE_TALKING : NPC_TALK_STATE_ACTION ;
144
+ break ;
145
+ case 0x401F :
146
+ Flags_SetInfTable (INFTABLE_139 );
147
+ break ;
148
+ }
149
+ }
150
+ break ;
130
151
case TEXT_STATE_CLOSING :
131
- ret = NPC_TALK_STATE_IDLE ;
132
- switch (this -> actor .textId ) {
133
- case 0x4012 :
134
- Flags_SetInfTable (INFTABLE_139 );
135
- ret = NPC_TALK_STATE_ACTION ;
136
- break ;
137
- case 0x401B :
138
- ret = !Message_ShouldAdvance (play ) ? NPC_TALK_STATE_TALKING : NPC_TALK_STATE_ACTION ;
139
- break ;
140
- case 0x401F :
141
- Flags_SetInfTable (INFTABLE_139 );
142
- break ;
152
+ if (CVarGetInteger ("gRestorations.EarlyEyeballFrog" , 0 )) {
153
+ ret = NPC_TALK_STATE_IDLE ;
154
+ switch (this -> actor .textId ) {
155
+ case 0x4012 :
156
+ Flags_SetInfTable (INFTABLE_139 );
157
+ ret = NPC_TALK_STATE_ACTION ;
158
+ break ;
159
+ case 0x401B :
160
+ ret = !Message_ShouldAdvance (play ) ? NPC_TALK_STATE_TALKING : NPC_TALK_STATE_ACTION ;
161
+ break ;
162
+ case 0x401F :
163
+ Flags_SetInfTable (INFTABLE_139 );
164
+ break ;
165
+ }
143
166
}
144
167
break ;
145
168
case TEXT_STATE_DONE_FADING :
@@ -159,8 +182,10 @@ s16 func_80A9C6C0(PlayState* play, Actor* thisx) {
159
182
break ;
160
183
}
161
184
if (this -> actor .textId == 0x4014 ) {
162
- if (play -> msgCtx .choiceIndex == 0 && this -> actor .textId == 0x4014 ) {
163
- // EnKz_SetupGetItem(this, play);
185
+ if (play -> msgCtx .choiceIndex == 0 && (CVarGetInteger ("gRestorations.EarlyEyeballFrog" , 0 ) && this -> actor .textId == 0x4014 )) {
186
+ if (!CVarGetInteger ("gRestorations.EarlyEyeballFrog" , 0 )) {
187
+ EnKz_SetupGetItem (this , play );
188
+ }
164
189
ret = NPC_TALK_STATE_ACTION ;
165
190
} else {
166
191
this -> actor .textId = 0x4016 ;
@@ -173,11 +198,6 @@ s16 func_80A9C6C0(PlayState* play, Actor* thisx) {
173
198
ret = NPC_TALK_STATE_ACTION ;
174
199
}
175
200
break ;
176
- case TEXT_STATE_DONE :
177
- if (Message_ShouldAdvance (play )) {
178
- ret = NPC_TALK_STATE_ITEM_GIVEN ;
179
- }
180
- break ;
181
201
case TEXT_STATE_NONE :
182
202
case TEXT_STATE_DONE_HAS_NEXT :
183
203
case TEXT_STATE_SONG_DEMO_DONE :
@@ -204,30 +224,39 @@ s32 func_80A9C95C(PlayState* play, EnKz* this, s16* talkState, f32 unkf, NpcGetT
204
224
s16 sp32 ;
205
225
s16 sp30 ;
206
226
f32 xzDistToPlayer ;
207
- // f32 yaw;
227
+ f32 yaw ;
208
228
209
229
if (Actor_ProcessTalkRequest (& this -> actor , play )) {
210
230
* talkState = NPC_TALK_STATE_TALKING ;
211
231
return 1 ;
212
232
}
213
233
214
- // yaw = Math_Vec3f_Yaw(&this->actor.home.pos, &player->actor.world.pos);
215
- // yaw -= this->actor.shape.rot.y;
216
- // if ((fabsf(yaw) > 1638.0f) || (this->actor.xzDistToPlayer < 265.0f)) {
217
- // this->actor.flags &= ~ACTOR_FLAG_TARGETABLE;
218
- // return 0;
219
- // }
234
+ if (!CVarGetInteger ("gRestorations.EarlyEyeballFrog" , 0 )) {
235
+ if (* talkState != NPC_TALK_STATE_IDLE ) {
236
+ * talkState = updateTalkState (play , & this -> actor );
237
+ return 0 ;
238
+ }
220
239
221
- // this->actor.flags |= ACTOR_FLAG_TARGETABLE;
240
+ yaw = Math_Vec3f_Yaw (& this -> actor .home .pos , & player -> actor .world .pos );
241
+ yaw -= this -> actor .shape .rot .y ;
242
+ if ((fabsf (yaw ) > 1638.0f ) || (this -> actor .xzDistToPlayer < 265.0f )) {
243
+ this -> actor .flags &= ~ACTOR_FLAG_TARGETABLE ;
244
+ return 0 ;
245
+ }
246
+
247
+ this -> actor .flags |= ACTOR_FLAG_TARGETABLE ;
248
+ }
222
249
223
250
Actor_GetScreenPos (play , & this -> actor , & sp32 , & sp30 );
224
251
if (!((sp32 >= -30 ) && (sp32 < 361 ) && (sp30 >= -10 ) && (sp30 < 241 ))) {
225
252
return 0 ;
226
253
}
227
254
228
- if (* talkState != NPC_TALK_STATE_IDLE ) {
229
- * talkState = updateTalkState (play , & this -> actor );
230
- return 0 ;
255
+ if (CVarGetInteger ("gRestorations.EarlyEyeballFrog" , 0 )) {
256
+ if (* talkState != NPC_TALK_STATE_IDLE ) {
257
+ * talkState = updateTalkState (play , & this -> actor );
258
+ return 0 ;
259
+ }
231
260
}
232
261
233
262
xzDistToPlayer = this -> actor .xzDistToPlayer ;
@@ -244,16 +273,18 @@ s32 func_80A9C95C(PlayState* play, EnKz* this, s16* talkState, f32 unkf, NpcGetT
244
273
245
274
void func_80A9CB18 (EnKz * this , PlayState * play ) {
246
275
Player * player = GET_PLAYER (play );
247
- f32 yaw ;
248
276
249
- yaw = Math_Vec3f_Yaw (& this -> actor .home .pos , & player -> actor .world .pos );
250
- yaw -= this -> actor .shape .rot .y ;
251
- if ((fabsf (yaw ) > 1638.0f ) || (this -> actor .xzDistToPlayer < 265.0f )) {
252
- this -> actor .flags &= ~ACTOR_FLAG_TARGETABLE ;
253
- return 0 ;
254
- }
277
+ if (CVarGetInteger ("gRestorations.EarlyEyeballFrog" , 0 )) {
278
+ f32 yaw ;
279
+ yaw = Math_Vec3f_Yaw (& this -> actor .home .pos , & player -> actor .world .pos );
280
+ yaw -= this -> actor .shape .rot .y ;
281
+ if ((fabsf (yaw ) > 1638.0f ) || (this -> actor .xzDistToPlayer < 265.0f )) {
282
+ this -> actor .flags &= ~ACTOR_FLAG_TARGETABLE ;
283
+ return 0 ;
284
+ }
255
285
256
- this -> actor .flags |= ACTOR_FLAG_TARGETABLE ;
286
+ this -> actor .flags |= ACTOR_FLAG_TARGETABLE ;
287
+ }
257
288
258
289
if (func_80A9C95C (play , this , & this -> interactInfo .talkState , 340.0f , EnKz_GetText , func_80A9C6C0 )) {
259
290
if (GameInteractor_Should (GI_VB_BE_ABLE_TO_EXCHANGE_RUTOS_LETTER , (this -> actor .textId == 0x401A ), this ) &&
@@ -276,12 +307,15 @@ void func_80A9CB18(EnKz* this, PlayState* play) {
276
307
this -> actor .textId = 0x4014 ;
277
308
this -> sfxPlayed = false;
278
309
player -> actor .textId = this -> actor .textId ;
279
- // this->isTrading = true;
310
+ if (!CVarGetInteger ("gRestorations.EarlyEyeballFrog" , 0 )) {
311
+ this -> isTrading = true;
312
+ }
280
313
return ;
281
314
}
282
315
}
283
-
284
- // this->isTrading = false;
316
+ if (!CVarGetInteger ("gRestorations.EarlyEyeballFrog" , 0 )) {
317
+ this -> isTrading = false;
318
+ }
285
319
if (Flags_GetInfTable (INFTABLE_139 )) {
286
320
this -> actor .textId = CHECK_QUEST_ITEM (QUEST_SONG_SERENADE ) ? 0x4045 : 0x401A ;
287
321
player -> actor .textId = this -> actor .textId ;
@@ -448,7 +482,9 @@ void EnKz_StopMweep(EnKz* this, PlayState* play) {
448
482
449
483
void EnKz_Wait (EnKz * this , PlayState * play ) {
450
484
if (this -> interactInfo .talkState == NPC_TALK_STATE_ACTION ) {
451
- this -> interactInfo .talkState = NPC_TALK_STATE_IDLE ;
485
+ if (CVarGetInteger ("gRestorations.EarlyEyeballFrog" , 0 )) {
486
+ this -> interactInfo .talkState = NPC_TALK_STATE_IDLE ;
487
+ }
452
488
this -> actionFunc = EnKz_SetupGetItem ;
453
489
EnKz_SetupGetItem (this , play );
454
490
} else {
@@ -475,7 +511,11 @@ void EnKz_SetupGetItem(EnKz* this, PlayState* play) {
475
511
Flags_SetRandomizerInf (RAND_INF_ADULT_TRADES_ZD_TRADE_PRESCRIPTION );
476
512
}
477
513
} else {
478
- getItemId = func_8002F368 (play ) == EXCH_ITEM_PRESCRIPTION ? GI_FROG : GI_TUNIC_ZORA ;
514
+ if (CVarGetInteger ("gRestorations.EarlyEyeballFrog" , 0 )) {
515
+ getItemId = func_8002F368 (play ) == EXCH_ITEM_PRESCRIPTION ? GI_FROG : GI_TUNIC_ZORA ;
516
+ } else {
517
+ getItemId = this -> isTrading ? GI_FROG : GI_TUNIC_ZORA ;
518
+ }
479
519
yRange = fabsf (this -> actor .yDistToPlayer ) + 1.0f ;
480
520
xzRange = this -> actor .xzDistToPlayer + 1.0f ;
481
521
func_8002F434 (& this -> actor , play , getItemId , xzRange , yRange );
0 commit comments