Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
player_events.c
Go to the documentation of this file.
1#include "common.h"
2#include "effects.h"
3#include "model.h"
4#include "hud_element.h"
5#include "script_api/battle.h"
6#include "sprite/npc/Twink.h"
7#include "sprite/npc/BattleMerlee.h"
9#include "battle/battle.h"
10#include "sprite/player.h"
11
12extern HudScript HES_Happy;
14
19
21
31
32enum {
33 MERLEE_EFFECTS_HOLD = 0, // effects appear and track Merlee's position
34 MERLEE_EFFECTS_RELEASE = 1, // effects grow larger before vanishing
35 MERLEE_EFFECTS_DISMISS = 2, // effects vanish and are dismissed
36};
37
38API_CALLABLE(ForceDisablePlayerBlurImmediately);
39
41 BattleStatus* battleStatus = &gBattleStatus;
42 ActorPart* actorPart = &battleStatus->playerActor->partsTable[0];
43
44 if (battleStatus->flags2 & BS_FLAGS2_PEACH_BATTLE) {
46 set_actor_anim(0, 0, ANIM_Peach1_Walk);
47 } else if (!battleStatus->outtaSightActive) {
49 }
50}
51
52API_CALLABLE(IsPartnerImmobile) {
53 BattleStatus* battleStatus = &gBattleStatus;
54 Actor* playerActor = battleStatus->playerActor;
55 s32 isImmobile = playerActor->debuff == STATUS_KEY_FEAR
56 || playerActor->debuff == STATUS_KEY_DIZZY
57 || playerActor->debuff == STATUS_KEY_PARALYZE
58 || playerActor->debuff == STATUS_KEY_SLEEP
59 || playerActor->debuff == STATUS_KEY_FROZEN
60 || playerActor->debuff == STATUS_KEY_STOP;
61
62 if (playerActor->stoneStatus == STATUS_KEY_STONE) {
63 isImmobile = TRUE;
64 }
65
66 script->varTable[0] = isImmobile;
67 return ApiStatus_DONE2;
68}
69
70API_CALLABLE(ActivateDefend) {
72
76 set_actor_anim(0, 0, ANIM_Mario1_Crouch);
77 return ApiStatus_DONE2;
78}
79
80// (out) LVar0: skip playing lucky animation
81API_CALLABLE(TryPlayerLucky) {
83
84 show_action_rating(ACTION_RATING_LUCKY, player, player->curPos.x, player->curPos.y + 20.0f, player->curPos.z);
86
87 script->varTable[0] = FALSE;
88 if (player->debuff == STATUS_KEY_FEAR
89 || player->debuff == STATUS_KEY_DIZZY
90 || player->debuff == STATUS_KEY_PARALYZE
91 || player->debuff == STATUS_KEY_SLEEP
92 || player->debuff == STATUS_KEY_FROZEN
93 || player->debuff == STATUS_KEY_STOP
94 ) {
95 script->varTable[0] = TRUE;
96 }
97 return ApiStatus_DONE2;
98}
99
100API_CALLABLE(ChoosePlayerCelebrationAnim) {
102 PlayerData* playerData = &gPlayerData;
103 s32 temp;
104 s32 i;
105
106 if (rand_int(pcao->randomChance + pcao->hpBasedChance) < pcao->randomChance) {
107 temp = 0;
108 for (i = 0; i < 8; i++) {
109 temp += pcao->options[i * 2];
110 }
111 temp = rand_int(temp);
112 for (i = 0; i < 8; i++) {
113 temp -= pcao->options[i * 2];
114 if (temp <= 0) {
115 break;
116 }
117 }
118
119 script->varTable[0] = pcao->options[i * 2 + 1];
120 } else {
121 s32* opts;
122 f32 healthRatio = playerData->curHP / (f32) playerData->curMaxHP;
123
124 if (healthRatio <= 0.25) {
125 opts = &pcao->options[16];
126 } else if (healthRatio <= 0.5) {
127 opts = &pcao->options[32];
128 } else if (healthRatio <= 0.75) {
129 opts = &pcao->options[48];
130 } else {
131 opts = &pcao->options[64];
132 }
133
134 temp = 0;
135 for (i = 0; i < 8; i++) {
136 temp += opts[i * 2];
137 }
138 temp = rand_int(temp);
139 for (i = 0; i < 8; i++) {
140 temp -= opts[i * 2];
141 if (temp <= 0) {
142 break;
143 }
144 }
145 script->varTable[0] = opts[i * 2 + 1];
146 }
147 return ApiStatus_DONE2;
148}
149
150API_CALLABLE(SetFledBattleFlag) {
152 return ApiStatus_DONE2;
153}
154
155API_CALLABLE(DetermineAutoRunAwaySuccess) {
157 s32 var;
158
160 return ApiStatus_DONE2;
161 }
162
163 var = player->state.varTable[0];
164 if (var >= rand_int(100)) {
165 script->varTable[0] = TRUE;
166 } else {
167 script->varTable[0] = FALSE;
168 }
169 return ApiStatus_DONE2;
170}
171
172API_CALLABLE(func_80260E38) {
174 return ApiStatus_DONE2;
175}
176
177API_CALLABLE(func_80260E5C) {
178 gBattleStatus.flags1 &= ~BS_FLAGS1_FREE_ACTION_COMMAND;
179 gBattleStatus.flags1 &= ~BS_FLAGS1_2000;
180 gBattleStatus.flags1 &= ~BS_FLAGS1_4000;
181 return ApiStatus_DONE2;
182}
183
184// out LVar0: time caller should wait for coin spawns
185API_CALLABLE(GiveRefund) {
186 BattleStatus* battleStatus = &gBattleStatus;
187 Actor* player = battleStatus->playerActor;
188 s32 sellValue = gItemTable[battleStatus->moveArgument].sellValue;
189 f32 angle = 0.0f;
190 s32 delayTime = 0;
191 f32 posX, posY, posZ;
192 posY = player->curPos.y + player->size.y;
193
194 if (player_team_is_ability_active(player, ABILITY_REFUND) && sellValue > 0) {
195 s32 i;
196 s32 iconPosX, iconPosY, iconPosZ;
197
198 // 75% of the item's sell value, rounded up
199 sellValue = (sellValue * 75 + 99) / 100;
200
201 for (i = 0; i < sellValue; i++) {
202 posX = player->curPos.x;
203 posZ = player->curPos.z;
204
205 make_item_entity(ITEM_COIN, posX, posY, posZ, ITEM_SPAWN_MODE_TOSS_FADE1, (i * 3) + 1, angle, 0);
206 add_coins(1);
207 angle += 30.0f;
208 }
209
210 delayTime = (i * 3) + 30;
211
212 posX = player->curPos.x;
213 posY = player->curPos.y;
214 posZ = player->curPos.z;
215 get_screen_coords(gCurrentCameraID, posX, posY, posZ, &iconPosX, &iconPosY, &iconPosZ);
217 hud_element_set_render_pos(HID_Refund, iconPosX + 36, iconPosY - 63);
218 }
219
220 script->varTable[0] = delayTime;
221
222 return ApiStatus_DONE2;
223}
224
225API_CALLABLE(GiveRefundCleanup) {
227
230 }
231
232 return ApiStatus_DONE2;
233}
234
235API_CALLABLE(LifeShroomShroudWorld) {
236 if (isInitialCall) {
239 mdl_set_shroud_tint_params(0, 0, 0, 0);
240 script->functionTemp[0] = 20;
241 }
242
243 mdl_set_shroud_tint_params(0, 0, 0, ((20 - script->functionTemp[0]) * 12) & 0xFC);
244
245 script->functionTemp[0] -= 1;
246
247 if (script->functionTemp[0] == 0) {
248 return ApiStatus_DONE2;
249 }
250
251 return ApiStatus_BLOCK;
252}
253
254API_CALLABLE(LifeShroomRevealWorld) {
255 if (isInitialCall) {
256 script->functionTemp[0] = 20;
258 }
259
260 mdl_set_shroud_tint_params(0, 0, 0, (script->functionTemp[0] * 12) & 0xFC);
261
262 script->functionTemp[0] -= 1;
263 if (script->functionTemp[0] == 0) {
264 mdl_set_shroud_tint_params(0, 0, 0, 0);
265 return ApiStatus_DONE2;
266 }
267
268 return ApiStatus_BLOCK;
269}
270
271API_CALLABLE(ConsumeLifeShroom) {
272 PlayerData* playerData = &gPlayerData;
273 ItemData* item = &gItemTable[ITEM_LIFE_SHROOM];
274
275 playerData->curHP += item->potencyA;
276 if (playerData->curMaxHP < playerData->curHP) {
277 playerData->curHP = playerData->curMaxHP;
278 }
279 playerData->invItems[find_item(ITEM_LIFE_SHROOM)] = ITEM_NONE;
281 script->varTable[3] = item->potencyA;
282
283 return ApiStatus_DONE2;
284}
285
286API_CALLABLE(RestorePreDefeatState) {
287 PlayerData* playerData = &gPlayerData;
288 BattleStatus* battleStatus = &gBattleStatus;
289
293
294 // clear rush flags to initialize
295 battleStatus->rushFlags = RUSH_FLAG_NONE;
296 battleStatus->flags2 &= ~BS_FLAGS2_HAS_RUSH;
297
298 // set rush flags based on danger/peril status
299 if (!(battleStatus->flags2 & BS_FLAGS2_PEACH_BATTLE)) {
302 battleStatus->rushFlags |= RUSH_FLAG_MEGA;
303 }
304
306 if (!(battleStatus->rushFlags & RUSH_FLAG_MEGA)) {
308 battleStatus->rushFlags |= RUSH_FLAG_POWER;
309 }
310 }
311 }
312 return ApiStatus_DONE2;
313}
314
315API_CALLABLE(func_80261388) {
316 s32 partnerActorExists = gBattleStatus.partnerActor != NULL;
317
318 script->varTable[0] = FALSE;
319 if (partnerActorExists) {
320 script->varTable[0] = TRUE;
321 }
322 return ApiStatus_DONE2;
323}
324
325API_CALLABLE(SetItemAsLifeShroom) {
326 gBattleStatus.moveArgument = ITEM_LIFE_SHROOM;
327 return ApiStatus_DONE2;
328}
329
330API_CALLABLE(PlayBattleMerleeGatherFX) {
331 Bytecode* args = script->ptrReadPos;
332 s32 var1 = evt_get_variable(script, *args++);
333 s32 var2 = evt_get_variable(script, *args++);
334 s32 var3 = evt_get_variable(script, *args++);
335
336 fx_energy_in_out(6, var1, var2 + 15, var3, 1.2f, 30);
337 return ApiStatus_DONE2;
338}
339
340API_CALLABLE(PlayBattleMerleeOrbFX) {
341 Bytecode* args = script->ptrReadPos;
342 s32 var1 = evt_get_variable(script, *args++);
343 s32 var2 = evt_get_variable(script, *args++);
344 s32 var3 = evt_get_variable(script, *args++);
345
346 fx_energy_orb_wave(9, var1, var2 + 15, var3, 5.0f, 15);
347 return ApiStatus_DONE2;
348}
349
350API_CALLABLE(BattleMerleeFadeStageToBlack) {
351 if (isInitialCall) {
354 mdl_set_shroud_tint_params(0, 0, 0, 0);
355 script->functionTemp[0] = 25;
356 }
357
358 mdl_set_shroud_tint_params(0, 0, 0, ((25 - script->functionTemp[0]) * 10) & 254);
359 script->functionTemp[0]--;
360
361 if (script->functionTemp[0] == 0) {
362 return ApiStatus_DONE2;
363 } else {
364 return ApiStatus_BLOCK;
365 }
366}
367
368API_CALLABLE(BattleMerleeFadeStageFromBlack) {
369 if (isInitialCall) {
370 script->functionTemp[0] = 25;
371 }
372
373 mdl_set_shroud_tint_params(0, 0, 0, (script->functionTemp[0] * 10) & 0xFF);
374
375 script->functionTemp[0] -= 5;
376 if (script->functionTemp[0] == 0) {
377 mdl_set_shroud_tint_params(0, 0, 0, 0);
378 return ApiStatus_DONE2;
379 }
380
381 return ApiStatus_BLOCK;
382}
383
384API_CALLABLE(BattleFadeInMerlee) {
386
387 if (isInitialCall) {
389 merlee->alpha = 0;
390 }
391
392 merlee->alpha += 17;
393 if (merlee->alpha >= 255) {
394 merlee->alpha = 255;
395 return ApiStatus_DONE1;
396 }
397
398 return ApiStatus_BLOCK;
399}
400
401API_CALLABLE(BattleFadeOutMerlee) {
403
404 merlee->alpha -= 17;
405 if (merlee->alpha == 0) {
406 merlee->alpha = 0;
407 return ApiStatus_DONE1;
408 }
409
410 return ApiStatus_BLOCK;
411}
412
413API_CALLABLE(BattleMerleeUpdateFX) {
416
417 if (isInitialCall) {
418 script->functionTemp[1] = 0;
419 BattleMerleeBasePosY = merlee->pos.y;
420 BattleMerleeOrbEffect = fx_energy_orb_wave(0, merlee->pos.x, merlee->pos.y, merlee->pos.z, 0.4f, 0);
421 BattleMerleeWaveEffect = fx_energy_orb_wave(3, merlee->pos.x, merlee->pos.y, merlee->pos.z, 0.00001f, 0);
425 }
426 merlee->pos.y = BattleMerleeBasePosY + (sin_rad(DEG_TO_RAD(script->functionTemp[1])) * 3.0f);
427
428 script->functionTemp[1] += 10;
429 script->functionTemp[1] = clamp_angle(script->functionTemp[1]);
430
432 data->pos.x = merlee->pos.x;
433 data->pos.y = merlee->pos.y + 16.0f;
434 data->pos.z = merlee->pos.z;
435
437 data->pos.x = merlee->pos.x;
438 data->pos.y = merlee->pos.y + 16.0f;
439 data->pos.z = merlee->pos.z + 5.0f;
440
446 return ApiStatus_DONE1;
447 }
448
451 data->scale += 0.35;
452 if (data->scale > 3.5) {
453 data->scale = 3.5;
454 }
455
456 if (BattleMerleeEffectsTime != 0) {
458 } else {
460 data->scale += 0.5;
461 if (data->scale > 5.0) {
463 }
464 }
465 }
466 return ApiStatus_BLOCK;
467}
468
469API_CALLABLE(BattleMerleeStopFX) {
471 return ApiStatus_DONE2;
472}
473
474API_CALLABLE(HasMerleeCastsLeft) {
475 PlayerData* playerData = &gPlayerData;
476
477 script->varTable[0] = FALSE;
478 if (playerData->merleeCastsLeft > 0) {
479 script->varTable[0] = TRUE;
480 }
481 return ApiStatus_DONE2;
482}
483
484API_CALLABLE(SpawnTurnEndFX) {
485 Bytecode* args = script->ptrReadPos;
486 s32 x = evt_get_variable(script, *args++);
487 s32 y = evt_get_variable(script, *args++);
488 s32 z = evt_get_variable(script, *args++);
489 s32 screenX;
490 s32 screenY;
491 s32 screenZ;
492
493 get_screen_coords(gCurrentCameraID, x, y, z, &screenX, &screenY, &screenZ);
494
495 screenX += 30;
496 screenY -= 19;
497
498 if (script->varTable[10] > 0) {
500 hud_element_set_render_pos(HID_HPDrain, screenX, screenY);
501 screenY += 9;
502 }
503
504 if (script->varTable[11] > 0 || script->varTable[12] > 0) {
506 hud_element_set_render_pos(HID_Happy, screenX, screenY);
507 }
508 return ApiStatus_DONE2;
509}
510
511API_CALLABLE(RemoveTurnEndFX) {
512 if (script->varTable[10] > 0) {
514 }
515 if (script->varTable[11] > 0 || script->varTable[12] > 0) {
517 }
518 return ApiStatus_DONE2;
519}
520
521API_CALLABLE(SpawnRecoverHeartFX) {
522 Bytecode* args = script->ptrReadPos;
523 s32 var1 = evt_get_variable(script, *args++);
524 s32 var2 = evt_get_variable(script, *args++);
525 s32 var3 = evt_get_variable(script, *args++);
526 s32 var4 = evt_get_variable(script, *args++);
527
528 fx_recover(0, var1, var2, var3, var4);
529 return ApiStatus_DONE2;
530}
531
532API_CALLABLE(SpawnRecoverFlowerFX) {
533 Bytecode* args = script->ptrReadPos;
534 s32 var1 = evt_get_variable(script, *args++);
535 s32 var2 = evt_get_variable(script, *args++);
536 s32 var3 = evt_get_variable(script, *args++);
537 s32 var4 = evt_get_variable(script, *args++);
538
539 fx_recover(1, var1, var2, var3, var4);
540 return ApiStatus_DONE2;
541}
542
543API_CALLABLE(IncrementPlayerHP) {
544 PlayerData* playerData = &gPlayerData;
545
546 playerData->curHP++;
547 if (playerData->curHP > playerData->curMaxHP) {
548 playerData->curHP = playerData->curMaxHP;
549 }
550 return ApiStatus_DONE2;
551}
552
553API_CALLABLE(IncrementPlayerFP) {
554 PlayerData* playerData = &gPlayerData;
555
556 playerData->curFP++;
557 if (playerData->curFP > playerData->curMaxFP) {
558 playerData->curFP = playerData->curMaxFP;
559 }
560 return ApiStatus_DONE2;
561}
562
563API_CALLABLE(InflictDizzyAttackStatus) {
564 inflict_status_set_duration(get_actor(script->owner1.actorID), STATUS_KEY_DIZZY, 0, 1);
566 return ApiStatus_DONE2;
567}
568
569API_CALLABLE(GetLostHammerAndBootsLevel) {
570 PlayerData* playerData = &gPlayerData;
571
572 script->varTable[11] = playerData->bootsLevel;
573 script->varTable[12] = playerData->hammerLevel;
574 return ApiStatus_DONE2;
575}
576
577API_CALLABLE(DropAbilityItem) {
578 ItemEntity* item = get_item_entity(script->varTable[10]);
579
580 if (isInitialCall) {
581 script->functionTemp[0] = 0;
582 script->functionTemp[1] = 0;
583 }
584
585 switch (script->functionTemp[1]) {
586 case 0:
587 script->functionTemp[0]--;
588 item->pos.y += script->functionTemp[0];
589 if (item->pos.y < 0.0f) {
590 item->pos.y = 0.0f;
591 script->functionTemp[0] = 8;
592 script->functionTemp[1] = 1;
593 }
594 break;
595 case 1:
596 script->functionTemp[0]--;
597 item->pos.y += script->functionTemp[0];
598 item->pos.x += 1.5;
599 if (item->pos.y < 0.0f) {
600 item->pos.y = 0.0f;
601 script->functionTemp[0] = 4;
602 script->functionTemp[1] = 2;
603 }
604 break;
605 case 2:
606 script->functionTemp[0]--;
607 item->pos.y += script->functionTemp[0];
608 item->pos.x += 1.2;
609 if (item->pos.y < 0.0f) {
610 item->pos.y = 0.0f;
611 script->functionTemp[1] = 3;
612 }
613 break;
614 case 3:
615 D_8029FBB0[0] = 20;
616 D_8029FBB0[1] = 20;
617 D_8029FBB0[2] = 20;
618 return ApiStatus_DONE2;
619 }
620 return ApiStatus_BLOCK;
621}
622
623API_CALLABLE(PlayerGatherAbilityItem) {
624 ItemEntity* item = get_item_entity(script->varTable[10]);
626 s32 interpAmt;
627 f32 deltaX;
628 f32 deltaY;
629 f32 deltaZ;
630
631 if (isInitialCall) {
632 script->functionTemp[0] = 0;
633 script->functionTemp[1] = 10;
634 }
635
636 switch (script->functionTemp[0]) {
637 case 0:
638 interpAmt = script->functionTemp[1];
639 deltaX = player->curPos.x - item->pos.x;
640 deltaY = player->curPos.y + 12.0f - item->pos.y;
641 deltaZ = player->curPos.z - 5.0f - item->pos.z;
642
643 item->pos.x += deltaX / interpAmt;
644 item->pos.y += deltaY / interpAmt;
645 item->pos.z += deltaZ / interpAmt;
646
647 item->pos.y += dist2D(item->pos.x, item->pos.y, player->curPos.x,
648 player->curPos.y + 12.0f) / 5.0f;
649
650 if (script->functionTemp[1] == 1) {
651 script->functionTemp[0] = 1;
652 }
653
654 script->functionTemp[1]--;
655 break;
656 case 1:
657 return ApiStatus_DONE2;
658 }
659 return ApiStatus_BLOCK;
660}
661
662API_CALLABLE(AbilityItemUnkDelay) {
663 s32* delayCounter = &D_8029FBB0[script->varTable[14]];
664
665 if (*delayCounter != 0) {
666 (*delayCounter)--;
667 return ApiStatus_BLOCK;
668 }
669
670 return ApiStatus_DONE2;
671}
672
677
682
684 Call(UseBattleCamPreset, BTL_CAM_PLAYER_ENTRY)
685 Call(SetBattleCamTarget, -80, 35, 8)
686 Call(BattleCamTargetActor, ACTOR_PLAYER)
687 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
688 Sub(LVar0, 100)
689 Call(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
690 Call(RandInt, 100, LVar0)
692 CaseGt(50)
693 Call(SetGoalToHome, ACTOR_SELF)
694 Call(SetAnimation, ACTOR_SELF, 0, ANIM_Mario1_Run)
695 Call(PlayerRunToGoal, 25)
696 Call(SetAnimation, ACTOR_SELF, 0, ANIM_Mario1_Idle)
697 CaseGt(20)
698 Call(SetGoalToHome, ACTOR_SELF)
699 Call(SetActorSpeed, ACTOR_SELF, Float(4.0))
700 Call(SetActorJumpGravity, ACTOR_SELF, Float(1.0))
701 Call(SetJumpAnimations, ACTOR_PLAYER, 0, ANIM_Mario1_Jump, ANIM_Mario1_Fall, ANIM_Mario1_BeforeJump)
702 Call(PlayerHopToGoal, 18, 0, 0)
703 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_BeforeJump)
704 Wait(7)
705 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Idle)
707 Call(SetGoalToHome, ACTOR_SELF)
708 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Run)
709 Call(PlayerRunToGoal, 20)
710 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Idle)
712 Call(ShakeCam, 1, 0, 5, Float(1.0))
714 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_TRIP)
715 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_GetUp)
716 Wait(10)
717 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_DustOff)
718 Wait(10)
719 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Idle)
721 Return
722 End
723};
724
726 Call(FreezeBattleState, TRUE)
727 Call(UseBattleCamPreset, BTL_CAM_PLAYER_ENTRY)
728 Call(SetBattleCamTarget, -80, 35, 8)
729 Call(BattleCamTargetActor, ACTOR_PLAYER)
731 Call(GetActorPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
732 Sub(LVar0, 100)
733 Add(LVar1, 50)
734 Call(SetActorPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
735 Call(SetGoalToHome, ACTOR_PARTNER)
736 Call(SetAnimation, ACTOR_PARTNER, 0, ANIM_Twink_Angry)
737 Call(FlyToGoal, ACTOR_PARTNER, 45, -10, 10)
739 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
740 Sub(LVar0, 100)
741 Call(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
742 Call(SetGoalToHome, ACTOR_SELF)
743 Call(SetAnimation, ACTOR_SELF, 0, ANIM_Peach1_Run)
744 Call(PlayerRunToGoal, 40)
745 Call(SetAnimation, ACTOR_SELF, 0, ANIM_Peach1_Walk)
746 Wait(15)
747 Call(FreezeBattleState, FALSE)
748 Return
749 End
750};
751
783
793
795 Call(UseIdleAnimation, ACTOR_PLAYER, FALSE)
796 Call(SetBattleFlagBits, BS_FLAGS1_4000, FALSE)
797 Call(GetMenuSelection, LVar0, LVar1, LVar2)
800 Call(LoadMoveScript)
803 Call(LoadMoveScript)
806 Call(LoadItemScript)
809 Call(LoadStarPowerScript)
812 Call(EnablePlayerBlur, ACTOR_BLUR_DISABLE)
813 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
814 Return
815 End
816};
817
819 Call(UseIdleAnimation, ACTOR_PLAYER, FALSE)
820 Call(GetMenuSelection, LVar0, LVar1, LVar2)
823 Call(LoadStarPowerScript)
826 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
827 Return
828 End
829};
830
832 Call(UseIdleAnimation, ACTOR_PLAYER, FALSE)
833 Call(GetMenuSelection, LVar0, LVar1, LVar2)
835 CaseEq(0)
836 Call(LoadMoveScript)
838 CaseEq(1)
839 Call(LoadMoveScript)
842 Call(EnablePlayerBlur, ACTOR_BLUR_DISABLE)
843 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
844 Return
845 End
846};
847
849 Call(ActivateDefend)
850 Return
851 End
852};
853
855 Call(GetLastEvent, ACTOR_PLAYER, LVarF)
858 Call(UseIdleAnimation, ACTOR_PLAYER, FALSE)
860 Call(CloseActionCommandInfo)
861 Call(SetBattleFlagBits, BS_FLAGS1_EXECUTING_MOVE, FALSE)
862 Call(func_802693F0)
863 Call(ForceDisablePlayerBlurImmediately)
864 Call(GetLastEvent, ACTOR_PLAYER, LVarF)
868 Call(SetActorRotation, ACTOR_SELF, 0, 0, 0)
869 Call(UseBattleCamPreset, BTL_CAM_PLAYER_HIT_SPIKE)
870 Call(GetGoalPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
871 Sub(LVar0, 60)
872 Add(LVar1, 40)
873 Call(SetActorJumpGravity, ACTOR_PLAYER, Float(0.1))
874 Call(SetJumpAnimations, ACTOR_PLAYER, 0, ANIM_Mario1_HurtFoot, ANIM_Mario1_HurtFoot, ANIM_Mario1_HurtFoot)
875 Call(SetGoalPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
876 Call(PlayerHopToGoal, 5, 0, 1)
877 SetConst(LVar1, ANIM_Mario1_HurtFoot)
878 Set(LVar2, 0)
880 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
881 Call(SetGoalToHome, ACTOR_PLAYER)
882 Call(GetGoalPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
883 Add(LVar0, 30)
884 Set(LVar1, 0)
885 Call(SetActorJumpGravity, ACTOR_PLAYER, Float(1.4))
886 Call(SetGoalPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
887 Call(PlayerHopToGoal, 10, 0, 2)
888 Sub(LVar0, 20)
889 Call(SetGoalPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
890 Call(PlayerHopToGoal, 7, 0, 2)
891 Sub(LVar0, 10)
892 Call(SetGoalPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
893 Call(PlayerHopToGoal, 4, 0, 2)
894 IfEq(LVarF, 39)
895 Return
896 EndIf
900 Call(SetActorRotation, ACTOR_SELF, 0, 0, 0)
901 Call(UseBattleCamPreset, BTL_CAM_PLAYER_HIT_HAZARD)
902 Call(GetGoalPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
903 Sub(LVar0, 60)
904 Add(LVar1, 40)
905 Call(SetActorJumpGravity, ACTOR_PLAYER, Float(0.1))
906 Call(SetJumpAnimations, ACTOR_PLAYER, 0, ANIM_MarioB3_BurnHurt, ANIM_MarioB3_BurnHurt, ANIM_MarioB3_BurnHurt)
907 Call(SetGoalPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
908 Call(PlayerHopToGoal, 5, 0, 1)
910 Call(GetActorPos, ACTOR_PLAYER, LVar5, LVar6, LVar7)
911 Add(LVar5, 5)
912 Add(LVar6, 4)
913 Add(LVar7, 5)
914 PlayEffect(EFFECT_RING_BLAST, 0, LVar5, LVar6, LVar7, Float(1.5), 15)
915 Wait(2)
916 Call(GetActorPos, ACTOR_PLAYER, LVar5, LVar6, LVar7)
917 Add(LVar5, -5)
918 Add(LVar6, 18)
919 Add(LVar7, 5)
920 PlayEffect(EFFECT_RING_BLAST, 0, LVar5, LVar6, LVar7, Float(1.5), 15)
922 SetConst(LVar1, ANIM_MarioB3_BurnHurt)
923 Set(LVar2, 0)
925 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
926 Call(SetGoalToHome, ACTOR_PLAYER)
927 Call(GetGoalPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
928 Add(LVar0, 30)
929 Set(LVar1, 0)
930 Call(SetActorJumpGravity, ACTOR_PLAYER, Float(1.4))
931 Call(SetGoalPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
932 Call(PlayerHopToGoal, 10, 0, 2)
933 Sub(LVar0, 20)
934 Call(SetGoalPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
935 Call(PlayerHopToGoal, 7, 0, 2)
936 Sub(LVar0, 10)
937 Call(SetGoalPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
938 Call(PlayerHopToGoal, 4, 0, 2)
939 IfEq(LVarF, 36)
940 Return
941 EndIf
945 Call(SetActorRotation, ACTOR_SELF, 0, 0, 0)
946 Call(UseBattleCamPreset, BTL_CAM_PLAYER_HIT_HAZARD)
947 Call(GetGoalPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
948 Sub(LVar0, 60)
949 Add(LVar1, 40)
950 Call(SetActorJumpGravity, ACTOR_PLAYER, Float(0.1))
951 Call(SetJumpAnimations, ACTOR_PLAYER, 0, ANIM_Mario1_HurtFoot, ANIM_Mario1_HurtFoot, ANIM_Mario1_HurtFoot)
952 Call(SetGoalPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
953 Call(PlayerHopToGoal, 5, 0, 1)
954 Call(ShowShockEffect, ACTOR_SELF)
955 SetConst(LVar1, ANIM_Mario1_HurtFoot)
956 Set(LVar2, 0)
958 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
959 Call(SetGoalToHome, ACTOR_PLAYER)
960 Call(GetGoalPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
961 Add(LVar0, 30)
962 Set(LVar1, 0)
963 Call(SetActorJumpGravity, ACTOR_PLAYER, Float(1.4))
964 Call(SetGoalPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
965 Call(PlayerHopToGoal, 10, 0, 2)
966 Sub(LVar0, 20)
967 Call(SetGoalPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
968 Call(PlayerHopToGoal, 7, 0, 2)
969 Sub(LVar0, 10)
970 Call(SetGoalPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
971 Call(PlayerHopToGoal, 4, 0, 2)
972 IfEq(LVarF, 38)
973 Return
974 EndIf
977 Call(TryPlayerLucky)
979 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_AdjustCap)
980 Wait(30)
981 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Idle)
982 Else
983 Wait(30)
984 EndIf
986 Call(SetActorJumpGravity, ACTOR_PLAYER, Float(1.8))
987 Call(SetJumpAnimations, ACTOR_PLAYER, 0, ANIM_Mario1_Jump, ANIM_Mario1_Fall, ANIM_Mario1_Land)
988 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
989 Call(SetGoalPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
990 Call(PlayerHopToGoal, 15, 0, 0)
991 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Idle)
992 Call(SetGoalToHome, ACTOR_PLAYER)
993 Call(SetActorSpeed, ACTOR_PLAYER, Float(4.0))
994 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Run)
995 Call(PlayerRunToGoal, 0)
996 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Idle)
998 Wait(10)
999 Call(UseIdleAnimation, ACTOR_PLAYER, FALSE)
1000 Call(SetActorJumpGravity, ACTOR_PLAYER, Float(1.8))
1001 Call(SetJumpAnimations, ACTOR_PLAYER, 0, ANIM_Mario1_Jump, ANIM_Mario1_Fall, ANIM_Mario1_Land)
1002 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1003 Call(SetGoalPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1004 Call(PlayerHopToGoal, 15, 0, 0)
1005 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Idle)
1006 Call(SetGoalToHome, ACTOR_PLAYER)
1007 Call(SetActorSpeed, ACTOR_PLAYER, Float(4.0))
1008 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Run)
1009 Call(PlayerRunToGoal, 0)
1010 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Idle)
1013 SetConst(LVar1, ANIM_Mario1_Hurt)
1014 Set(LVar2, 0)
1016 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Idle)
1020 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_NO_DAMGE)
1021 SetConst(LVar1, ANIM_Mario1_Idle)
1026 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_NO_DAMGE)
1027 SetConst(LVar0, 1)
1028 SetConst(LVar1, ANIM_Mario1_Crouch)
1030 Wait(10)
1033 SetConst(LVar1, ANIM_MarioB3_BurnHurt)
1034 Set(LVar2, 0)
1036 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Idle)
1038 SetConst(LVar1, ANIM_MarioB3_BurnHurt)
1039 Set(LVar2, 0)
1041 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Idle)
1042 Return
1044 SetConst(LVar1, ANIM_Mario1_Hurt)
1045 Set(LVar2, 0)
1047 Return
1049 Call(SetActorJumpGravity, ACTOR_PLAYER, Float(1.8))
1050 Call(GetActorPos, ACTOR_PLAYER, LVar7, LVar8, LVar9)
1051 Call(SetJumpAnimations, ACTOR_PLAYER, 0, ANIM_Mario1_Jump, ANIM_Mario1_Fall, ANIM_Mario1_BeforeJump)
1052 Call(SetGoalPos, ACTOR_PLAYER, LVar7, LVar8, LVar9)
1053 Call(PlayerHopToGoal, 15, 0, 0)
1054 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_BeforeJump)
1056 EndSwitch
1057 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
1058 Return
1059 End
1060};
1061
1063 Set(LVar0, 0)
1064 Loop(5)
1065 Add(LVar0, 72)
1066 Call(SetActorYaw, ACTOR_SELF, LVar0)
1067 Wait(1)
1068 EndLoop
1069 Call(ChoosePlayerCelebrationAnim)
1070 Call(SetAnimation, ACTOR_PLAYER, 0, LVar0)
1071 Wait(31)
1072 Return
1073 End
1074};
1075
1077 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB3_Hustled)
1078 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_PLAYER_RUN_IN_PLACE)
1079 Call(SetActorYaw, ACTOR_PLAYER, 30)
1080 Wait(1)
1081 Call(SetActorYaw, ACTOR_PLAYER, 60)
1082 Wait(1)
1083 Call(SetActorYaw, ACTOR_PLAYER, 90)
1084 Wait(1)
1085 Call(SetActorYaw, ACTOR_PLAYER, 120)
1086 Wait(1)
1087 Call(SetActorYaw, ACTOR_PLAYER, 150)
1088 Wait(1)
1089 Call(SetActorYaw, ACTOR_PLAYER, 180)
1090 Wait(5)
1091 Call(AddActorPos, ACTOR_PLAYER, 2, 0, 0)
1092 Wait(2)
1093 Call(AddActorPos, ACTOR_PLAYER, 2, 0, 0)
1094 Wait(5)
1095 Call(AddActorPos, ACTOR_PLAYER, 2, 0, 0)
1096 Wait(2)
1097 Call(AddActorPos, ACTOR_PLAYER, 2, 0, 0)
1098 Wait(2)
1099 Call(AddActorPos, ACTOR_PLAYER, 2, 0, 0)
1100 Wait(5)
1101 Call(AddActorPos, ACTOR_PLAYER, 2, 0, 0)
1102 Wait(2)
1103 Call(AddActorPos, ACTOR_PLAYER, 2, 0, 0)
1104 Wait(5)
1105 Call(AddActorPos, ACTOR_PLAYER, 2, 0, 0)
1106 Wait(15)
1107 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1108 Call(SetActorJumpGravity, ACTOR_PLAYER, Float(1.8))
1109 Call(SetJumpAnimations, ACTOR_PLAYER, 0, ANIM_Mario1_Jump, ANIM_Mario1_Fall, ANIM_Mario1_Land)
1110 Call(SetGoalPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1111 Call(PlayerHopToGoal, 8, 0, 0)
1112 Call(DetermineAutoRunAwaySuccess)
1113 IfEq(LVar0, 1)
1114 Call(SetFledBattleFlag)
1115 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_PLAYER_RUN_AWAY)
1116 Call(SetGoalPos, ACTOR_PLAYER, -240, 0, 10)
1117 Call(SetActorSpeed, ACTOR_PLAYER, Float(16.0))
1118 Call(PlayerRunToGoal, 0)
1119 Wait(5)
1120 Else
1122 Call(ShakeCam, 1, 0, 5, Float(1.0))
1124 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Trip)
1125 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_TRIP)
1126 Call(SetGoalPos, ACTOR_PLAYER, -100, 0, 10)
1127 Call(SetActorSpeed, ACTOR_PLAYER, Float(10.0))
1128 Call(PlayerRunToGoal, 0)
1129 Set(LVar3, 6)
1130 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1132 Loop(2)
1133 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1134 PlayEffect(EFFECT_LANDING_DUST, 1, LVar0, LVar1, LVar2, Float(1.0))
1135 Wait(5)
1136 EndLoop
1138 Loop(10)
1139 Sub(LVar0, LVar3)
1140 Sub(LVar3, 1)
1141 IfLt(LVar3, 1)
1142 Set(LVar3, 1)
1143 EndIf
1144 Call(SetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1145 Wait(1)
1146 EndLoop
1147 Wait(15)
1148 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_DUST_OFF)
1149 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_GetUp)
1150 Wait(20)
1151 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_DustOff)
1153 Wait(7)
1154 Loop(2)
1155 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1156 Sub(LVar0, 8)
1157 Add(LVar1, 14)
1158 Add(LVar2, 5)
1159 PlayEffect(EFFECT_WALKING_DUST, 0, LVar0, LVar1, LVar2, Float(1.0), Float(1.0))
1160 Wait(5)
1161 EndLoop
1163 Wait(5)
1164 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
1165 Wait(10)
1166 EndIf
1167 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
1168 Return
1169 End
1170};
1171
1173 Call(UseIdleAnimation, ACTOR_PLAYER, FALSE)
1174 Call(GetActionCommandMode, LVar2)
1177 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
1178 Return
1179 EndIf
1180 Call(ShowActionHud, 1)
1181 Call(GetActorVar, ACTOR_SELF, 0, LVar0)
1182 Call(LoadActionCommand, ACTION_COMMAND_FLEE)
1183 Call(action_command_flee_init, LVar0)
1184 Call(SetupMashMeter, 1, 100, 0, 0, 0, 0)
1185 Call(func_80260E38)
1186 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB3_Hustled)
1187 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_PLAYER_RUN_IN_PLACE)
1188 Call(SetActorYaw, ACTOR_PLAYER, 30)
1189 Wait(1)
1190 Call(SetActorYaw, ACTOR_PLAYER, 60)
1191 Wait(1)
1192 Call(SetActorYaw, ACTOR_PLAYER, 90)
1193 Wait(1)
1194 Call(SetActorYaw, ACTOR_PLAYER, 120)
1195 Wait(1)
1196 Call(SetActorYaw, ACTOR_PLAYER, 150)
1197 Wait(1)
1198 Call(SetActorYaw, ACTOR_PLAYER, 180)
1199 Wait(5)
1200 Call(action_command_flee_start, 0, 60, 3)
1201 Call(func_80260E5C)
1202 Wait(5)
1203 Call(AddActorPos, ACTOR_PLAYER, 2, 0, 0)
1204 Wait(2)
1205 Call(AddActorPos, ACTOR_PLAYER, 2, 0, 0)
1206 Wait(5)
1207 Call(AddActorPos, ACTOR_PLAYER, 2, 0, 0)
1208 Wait(2)
1209 Call(AddActorPos, ACTOR_PLAYER, 2, 0, 0)
1210 Wait(2)
1211 Call(AddActorPos, ACTOR_PLAYER, 2, 0, 0)
1212 Wait(5)
1213 Call(AddActorPos, ACTOR_PLAYER, 2, 0, 0)
1214 Wait(2)
1215 Call(AddActorPos, ACTOR_PLAYER, 2, 0, 0)
1216 Wait(5)
1217 Call(AddActorPos, ACTOR_PLAYER, 2, 0, 0)
1218 Wait(15)
1219 Wait(30)
1220 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1221 Call(SetActorJumpGravity, ACTOR_PLAYER, Float(1.8))
1222 Call(SetJumpAnimations, ACTOR_PLAYER, 0, ANIM_Mario1_Jump, ANIM_Mario1_Fall, ANIM_Mario1_Land)
1223 Call(SetGoalPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1224 Call(PlayerHopToGoal, 8, 0, 0)
1225 Call(GetActionSuccess, LVar0)
1226 Call(DetermineAutoRunAwaySuccess)
1227 IfEq(LVar0, 1)
1228 Call(SetFledBattleFlag)
1229 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_PLAYER_RUN_AWAY)
1230 Call(SetGoalPos, ACTOR_PLAYER, -240, 0, 10)
1231 Call(SetActorSpeed, ACTOR_PLAYER, Float(16.0))
1232 Call(PlayerRunToGoal, 0)
1233 Wait(5)
1234 Else
1236 Call(ShakeCam, 1, 0, 5, Float(1.0))
1238 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Trip)
1239 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_TRIP)
1240 Call(SetGoalPos, ACTOR_PLAYER, -100, 0, 10)
1241 Call(SetActorSpeed, ACTOR_PLAYER, Float(10.0))
1242 Call(PlayerRunToGoal, 0)
1243 Set(LVar3, 6)
1244 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1246 Loop(2)
1247 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1248 PlayEffect(EFFECT_LANDING_DUST, 1, LVar0, LVar1, LVar2, Float(1.0))
1249 Wait(5)
1250 EndLoop
1252 Loop(10)
1253 Sub(LVar0, LVar3)
1254 Sub(LVar3, 1)
1255 IfLt(LVar3, 1)
1256 Set(LVar3, 1)
1257 EndIf
1258 Call(SetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1259 Wait(1)
1260 EndLoop
1261 Wait(15)
1262 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_DUST_OFF)
1263 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_GetUp)
1264 Wait(20)
1265 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_DustOff)
1267 Wait(7)
1268 Loop(2)
1269 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1270 Sub(LVar0, 8)
1271 Add(LVar1, 14)
1272 Add(LVar2, 5)
1273 PlayEffect(EFFECT_WALKING_DUST, 0, LVar0, LVar1, LVar2, Float(1.0), Float(1.0))
1274 Wait(5)
1275 EndLoop
1277 Wait(5)
1278 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
1279 Wait(10)
1280 EndIf
1281 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
1282 Return
1283 End
1284};
1285
1287 Call(UseIdleAnimation, ACTOR_PLAYER, FALSE)
1288 Call(SetGoalToHome, ACTOR_PLAYER)
1289 Call(SetActorSpeed, ACTOR_PLAYER, Float(4.0))
1290 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Run)
1291 Call(SetActorYaw, ACTOR_PLAYER, 0)
1292 Call(PlayerRunToGoal, 0)
1293 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Idle)
1294 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
1295 Return
1296 End
1297};
1298
1300 Call(UseIdleAnimation, ACTOR_PLAYER, FALSE)
1301 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Dying)
1302 Call(UseBattleCamPreset, BTL_CAM_PLAYER_DIES)
1303 Wait(15)
1304 Call(EnablePlayerBlur, ACTOR_BLUR_ENABLE)
1305 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_PLAYER_SPINNING)
1306 Set(LVar0, 0)
1307 Loop(30)
1308 Add(LVar0, 60)
1309 Call(SetActorYaw, ACTOR_PLAYER, LVar0)
1310 Wait(1)
1311 EndLoop
1312 Set(LVar0, 0)
1313 Loop(10)
1314 Add(LVar0, 36)
1315 Call(SetActorYaw, ACTOR_PLAYER, LVar0)
1316 Wait(1)
1317 EndLoop
1318 Call(EnablePlayerBlur, ACTOR_BLUR_DISABLE)
1319 Wait(30)
1320 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_PLAYER_COLLAPSE)
1321 Set(LVar0, 0)
1322 Set(LVar1, 1)
1323 Loop(0)
1324 IfEq(LVar0, 90)
1325 BreakLoop
1326 EndIf
1327 Add(LVar0, LVar1)
1328 Add(LVar1, 2)
1329 IfGt(LVar0, 90)
1330 Set(LVar0, 90)
1331 EndIf
1332 Call(SetActorRotation, ACTOR_PLAYER, LVar0, 0, 0)
1333 Wait(1)
1334 EndLoop
1335 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1336 Add(LVar1, 2)
1337 Call(SetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1338 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1339 Add(LVar2, 20)
1340 PlayEffect(EFFECT_WALKING_DUST, 1, LVar0, LVar1, LVar2, Float(1.0), Float(1.0))
1341 Wait(15)
1342 Return
1343 End
1344};
1345
1347 IfEq(LVar1, 0)
1348 Call(UseBattleCamPreset, BTL_CAM_PLAYER_WISH)
1349 Wait(10)
1350 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_USE_ITEM)
1351 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_UsePower)
1352 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1353 Add(LVar0, 18)
1354 Call(SetActorSpeed, ACTOR_PLAYER, Float(4.0))
1355 Call(SetGoalPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1356 Call(PlayerRunToGoal, 0)
1357 Add(LVar1, 45)
1358 Set(LVar3, LVar1)
1359 Add(LVar3, 10)
1360 Add(LVar3, 2)
1361 PlayEffect(EFFECT_RADIAL_SHIMMER, 1, LVar0, LVar3, LVar2, Float(1.0), 30)
1363 Set(LVarA, LVar0)
1364 Call(GiveRefund)
1365 Wait(LVar0)
1366 Wait(15)
1367 Call(GiveRefundCleanup)
1369 Else
1370 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1371 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_USE_ITEM)
1372 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_UsePower)
1373 Wait(4)
1374 Add(LVar1, 45)
1375 Set(LVar3, LVar1)
1376 Add(LVar3, 10)
1377 Add(LVar3, 2)
1378 PlayEffect(EFFECT_RADIAL_SHIMMER, 1, LVar0, LVar3, LVar2, Float(1.0), 30)
1380 Set(LVarA, LVar0)
1381 Wait(15)
1383 EndIf
1384 Return
1385 End
1386};
1387
1389 Call(UseBattleCamPreset, BTL_CAM_REPOSITION)
1390 Call(SetBattleCamTarget, -85, 1, 0)
1391 Call(SetBattleCamOffsetY, 41)
1392 Call(SetBattleCamDist, 248)
1393 Call(MoveBattleCamOver, 30)
1394 Wait(10)
1395 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_UsePower)
1396 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1397 Add(LVar1, 45)
1399 Set(LVarE, LVar0)
1400 Call(GiveRefund)
1401 Wait(LVar0)
1402 Wait(15)
1403 Call(GiveRefundCleanup)
1405 Return
1406 End
1407};
1408
1410 Call(UseIdleAnimation, ACTOR_PLAYER, FALSE)
1411 Call(SetGoalToHome, ACTOR_PLAYER)
1412 Call(SetActorSpeed, ACTOR_PLAYER, Float(8.0))
1413 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Run)
1414 Call(PlayerRunToGoal, 0)
1415 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Idle)
1416 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
1417 Return
1418 End
1419};
1420
1422 Thread
1423 Loop(4)
1424 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_EAT_OR_DRINK)
1425 Wait(10)
1426 EndLoop
1427 EndThread
1428 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Eat)
1429 Wait(45)
1430 Return
1431 End
1432};
1433
1435 Thread
1436 Loop(4)
1437 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_EAT_OR_DRINK)
1438 Wait(10)
1439 EndLoop
1440 EndThread
1441 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Drink)
1442 Wait(45)
1443 Return
1444 End
1445};
1446
1448 Call(UseIdleAnimation, ACTOR_PLAYER, FALSE)
1450 Call(func_80261388)
1451 IfEq(LVar0, 1)
1453 Call(SetActorFlagBits, ACTOR_PARTNER, ACTOR_FLAG_NO_SHADOW, 1)
1454 Set(LVar0, 255)
1455 Loop(10)
1456 Sub(LVar0, 25)
1457 IfLt(LVar0, 0)
1458 Set(LVar0, 0)
1459 EndIf
1460 Call(SetPartAlpha, ACTOR_PARTNER, -1, LVar0)
1461 Wait(1)
1462 EndLoop
1463 Call(SetPartAlpha, ACTOR_PARTNER, -1, 0)
1464 EndIf
1466 Call(LifeShroomShroudWorld)
1467 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1468 Call(MakeItemEntity, ITEM_LIFE_SHROOM, LVar0, LVar1, LVar2, 1, 0)
1469 Set(LVarA, LVar0)
1470 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1471 Set(LVar3, 30)
1472 Set(LVar4, 16)
1473 Loop(LVar3)
1474 Add(LVar4, 8)
1475 IfGt(LVar4, 255)
1476 Set(LVar4, 255)
1477 EndIf
1478 AddF(LVar1, Float(1.0))
1480 Wait(1)
1481 EndLoop
1482 Set(LVar3, LVar0)
1483 Set(LVar4, LVar1)
1484 Set(LVar5, LVar2)
1485 Call(SetItemAsLifeShroom)
1486 Call(GiveRefund)
1487 IfGt(LVar0, 0)
1488 Wait(LVar0)
1489 Wait(15)
1490 Call(GiveRefundCleanup)
1491 EndIf
1492 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_LIFE_SHROOM_CHIME)
1493 Add(LVar4, 15)
1494 PlayEffect(EFFECT_ENERGY_IN_OUT, 3, LVar3, LVar4, LVar5, Float(1.0))
1495 Set(LVar0, LVarF)
1496 Loop(4)
1497 Call(SetItemFlags, LVarA, 64, 1)
1498 Wait(2)
1499 Call(SetItemFlags, LVarA, 64, 0)
1500 Wait(8)
1501 EndLoop
1504 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_START_RECOVERY)
1505 PlayEffect(EFFECT_STARS_SHIMMER, 1, LVar3, LVar4, LVar5, 70, 70, 10, 20)
1506 Wait(20)
1507 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_REVIVAL_MAGIC)
1508 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1509 PlayEffect(EFFECT_STARS_SHIMMER, 2, LVar0, LVar1, LVar2, 50, 20, 32, 30)
1510 Wait(40)
1511 PlayEffect(EFFECT_STARS_SHIMMER, 2, LVar0, LVar1, LVar2, 30, 50, 32, 30)
1513 Loop(3)
1514 Call(SetActorDispOffset, ACTOR_PLAYER, 1, 0, 0)
1515 Wait(4)
1516 Call(SetActorDispOffset, ACTOR_PLAYER, -1, 0, 0)
1517 Wait(4)
1518 EndLoop
1519 Loop(3)
1520 Call(SetActorDispOffset, ACTOR_PLAYER, 1, 0, 0)
1521 Wait(2)
1522 Call(SetActorDispOffset, ACTOR_PLAYER, -1, 0, 0)
1523 Wait(2)
1524 EndLoop
1525 Loop(7)
1526 Call(SetActorDispOffset, ACTOR_PLAYER, 1, 0, 0)
1527 Wait(1)
1528 Call(SetActorDispOffset, ACTOR_PLAYER, -1, 0, 0)
1529 Wait(1)
1530 EndLoop
1532 Wait(50)
1534 Call(LifeShroomRevealWorld)
1536 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_PLAYER_REVIVE)
1537 Call(SetActorRotation, ACTOR_PLAYER, 0, 0, 0)
1538 Call(SetActorYaw, ACTOR_SELF, 0)
1539 Call(ConsumeLifeShroom)
1540 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1541 Add(LVar1, 25)
1542 PlayEffect(EFFECT_RECOVER, 0, LVar0, LVar1, LVar2, LVar3)
1543 Call(FreezeBattleCam, 0)
1544 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
1545 Call(MoveBattleCamOver, 15)
1547 Call(func_80261388)
1548 IfEq(LVar0, 1)
1549 Call(SetActorFlagBits, ACTOR_PARTNER, ACTOR_FLAG_NO_SHADOW, 0)
1550 Set(LVar0, 0)
1551 Loop(10)
1552 Add(LVar0, 25)
1553 IfGt(LVar0, 255)
1554 Set(LVar0, 255)
1555 EndIf
1556 Call(SetPartAlpha, ACTOR_PARTNER, -1, LVar0)
1557 Wait(1)
1558 EndLoop
1559 Call(DispatchEvent, ACTOR_PARTNER, EVENT_REVIVE)
1560 Call(SetPartAlpha, ACTOR_PARTNER, -1, 255)
1561 EndIf
1564 Loop(5)
1565 Wait(2)
1566 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1567 PlayEffect(EFFECT_MISC_PARTICLES, 2, LVar0, LVar1, LVar2, 20, 20, Float(1.0), 10, 50)
1568 EndLoop
1570 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_LONG_PLAYER_JUMP)
1571 Call(SetActorJumpGravity, ACTOR_PLAYER, Float(1.0))
1572 Call(SetActorSpeed, ACTOR_PLAYER, Float(1.0))
1573 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1574 Set(LVar1, 0)
1575 Call(SetJumpAnimations, ACTOR_PLAYER, 0, ANIM_Mario1_Jump, ANIM_Mario1_Fall, ANIM_Mario1_Land)
1576 Call(SetGoalPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1577 Call(PlayerHopToGoal, 20, 0, 0)
1578 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Land)
1579 Wait(4)
1580 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Idle)
1581 Wait(10)
1582 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
1583 Call(RestorePreDefeatState)
1584 Return
1585 End
1586};
1587
1589 Call(HasMerleeCastsLeft)
1590 IfEq(LVar0, 1)
1591 Return
1592 EndIf
1593 Wait(15)
1594 Call(ShowMessageBox, BTL_MSG_MERLEE_DONE, 60)
1595 Call(WaitForMessageBoxDone)
1596 Return
1597 End
1598};
1599
1601 Call(UseIdleAnimation, ACTOR_PLAYER, FALSE)
1602 Call(BattleMerleeFadeStageToBlack)
1603 Wait(10)
1604 Call(UseBattleCamPreset, BTL_CAM_REPOSITION)
1605 Call(SetBattleCamTarget, 0, 80, 0)
1606 Call(SetBattleCamOffsetY, 0)
1607 Call(SetBattleCamDist, 246)
1608 Call(MoveBattleCamOver, 20)
1609 Wait(10)
1610 Call(CreateNpc, NPC_BTL_MERLEE, ANIM_BattleMerlee_Gather)
1613 Call(SetNpcPos, NPC_BTL_MERLEE, 0, 65, 20)
1615 Call(BattleMerleeUpdateFX)
1617 Call(BattleFadeInMerlee)
1618 Wait(30)
1619 Call(SetNpcAnimation, NPC_BTL_MERLEE, ANIM_BattleMerlee_Release)
1620 Call(BattleMerleeStopFX)
1621 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
1622 Call(MoveBattleCamOver, 4)
1623 Call(BattleMerleeFadeStageFromBlack)
1624 Wait(20)
1626 Call(BattleFadeOutMerlee)
1629 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_MAGIC_DESCENDING)
1630 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1631 Call(PlayBattleMerleeGatherFX, LVar0, LVar1, LVar2)
1632 Call(PlayBattleMerleeOrbFX, LVar0, LVar1, LVar2)
1633 Wait(15)
1634 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1635 Call(SetActorJumpGravity, ACTOR_SELF, Float(1.8))
1636 Call(SetJumpAnimations, ACTOR_PLAYER, 0, ANIM_Mario1_Jump, ANIM_Mario1_Fall, ANIM_Mario1_Land)
1637 Call(SetGoalPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1638 Call(PlayerHopToGoal, 18, 0, 0)
1639 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Land)
1640 Wait(4)
1641 Call(SetAnimation, ACTOR_SELF, 0, ANIM_Mario1_Idle)
1642 Call(ShowMessageBox, BTL_MSG_MERLEE_ATK_UP, 60)
1643 Call(WaitForMessageBoxDone)
1645 Return
1646 End
1647};
1648
1650 Call(UseIdleAnimation, ACTOR_PLAYER, FALSE)
1651 Call(BattleMerleeFadeStageToBlack)
1652 Wait(10)
1653 Call(UseBattleCamPreset, BTL_CAM_REPOSITION)
1654 Call(SetBattleCamTarget, 0, 80, 0)
1655 Call(SetBattleCamOffsetY, 0)
1656 Call(SetBattleCamDist, 246)
1657 Call(MoveBattleCamOver, 20)
1658 Wait(10)
1659 Call(CreateNpc, NPC_BTL_MERLEE, ANIM_BattleMerlee_Gather)
1662 Call(SetNpcPos, NPC_BTL_MERLEE, 0, 65, 20)
1664 Call(BattleMerleeUpdateFX)
1666 Call(BattleFadeInMerlee)
1667 Wait(30)
1668 Call(SetNpcAnimation, NPC_BTL_MERLEE, ANIM_BattleMerlee_Release)
1669 Call(BattleMerleeStopFX)
1670 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
1671 Call(MoveBattleCamOver, 4)
1672 Call(BattleMerleeFadeStageFromBlack)
1673 Wait(20)
1675 Call(BattleFadeOutMerlee)
1678 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_MAGIC_DESCENDING)
1679 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1680 Call(PlayBattleMerleeGatherFX, LVar0, LVar1, LVar2)
1681 Call(PlayBattleMerleeOrbFX, LVar0, LVar1, LVar2)
1682 Wait(15)
1683 Call(GetStatusFlags, ACTOR_PLAYER, LVar0)
1685 Wait(22)
1686 Else
1687 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1688 Call(SetActorJumpGravity, ACTOR_SELF, Float(1.8))
1689 Call(SetJumpAnimations, ACTOR_PLAYER, 0, ANIM_Mario1_Jump, ANIM_Mario1_Fall, ANIM_Mario1_Land)
1690 Call(SetGoalPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1691 Call(PlayerHopToGoal, 18, 0, 0)
1692 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Land)
1693 Wait(4)
1694 Call(SetAnimation, ACTOR_SELF, 0, ANIM_Mario1_Idle)
1695 EndIf
1696 Call(ShowMessageBox, BTL_MSG_MERLEE_DEF_UP, 60)
1697 Call(WaitForMessageBoxDone)
1699 Return
1700 End
1701};
1702
1704 Call(UseIdleAnimation, ACTOR_PLAYER, FALSE)
1705 Call(BattleMerleeFadeStageToBlack)
1706 Wait(10)
1707 Call(UseBattleCamPreset, BTL_CAM_REPOSITION)
1708 Call(SetBattleCamTarget, 0, 80, 0)
1709 Call(SetBattleCamOffsetY, 0)
1710 Call(SetBattleCamDist, 246)
1711 Call(MoveBattleCamOver, 20)
1712 Wait(10)
1713 Call(CreateNpc, NPC_BTL_MERLEE, ANIM_BattleMerlee_Gather)
1716 Call(SetNpcPos, NPC_BTL_MERLEE, 0, 65, 20)
1718 Call(BattleMerleeUpdateFX)
1720 Call(BattleFadeInMerlee)
1721 Wait(30)
1722 Call(SetNpcAnimation, NPC_BTL_MERLEE, ANIM_BattleMerlee_Release)
1723 Call(BattleMerleeStopFX)
1724 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
1725 Call(MoveBattleCamOver, 4)
1726 Call(BattleMerleeFadeStageFromBlack)
1727 Wait(20)
1729 Call(BattleFadeOutMerlee)
1732 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_MAGIC_DESCENDING)
1733 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1734 Call(PlayBattleMerleeGatherFX, LVar0, LVar1, LVar2)
1735 Call(PlayBattleMerleeOrbFX, LVar0, LVar1, LVar2)
1736 Wait(15)
1737 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1738 Call(SetActorJumpGravity, ACTOR_SELF, Float(1.8))
1739 Call(SetJumpAnimations, ACTOR_PLAYER, 0, ANIM_Mario1_Jump, ANIM_Mario1_Fall, ANIM_Mario1_Land)
1740 Call(SetGoalPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1741 Call(PlayerHopToGoal, 18, 0, 0)
1742 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Land)
1743 Wait(4)
1744 Call(SetAnimation, ACTOR_SELF, 0, ANIM_Mario1_Idle)
1745 Call(ShowMessageBox, BTL_MSG_MERLEE_EXP_UP, 60)
1746 Call(WaitForMessageBoxDone)
1748 Return
1749 End
1750};
1751
1753 Call(UseIdleAnimation, ACTOR_PLAYER, FALSE)
1754 Call(UseBattleCamPresetWait, BTL_CAM_DEFAULT)
1755 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_ThumbsUp)
1756 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1757 Call(SpawnTurnEndFX, LVar0, LVar1, LVar2)
1758 Add(LVar0, 0)
1759 Add(LVar1, 35)
1760 Set(LVar3, LVarA)
1761 Add(LVar3, LVarB)
1762 IfGt(LVar3, 0)
1763 Call(SpawnRecoverHeartFX, LVar0, LVar1, LVar2, LVar3)
1764 EndIf
1765 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1766 Add(LVar0, 20)
1767 Add(LVar1, 25)
1768 IfGt(LVarC, 0)
1769 Call(SpawnRecoverFlowerFX, LVar0, LVar1, LVar2, LVarC)
1770 EndIf
1771 Set(LVar3, LVarA)
1772 Add(LVar3, LVarB)
1773 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1774 Add(LVar1, 25)
1776 Wait(10)
1777 Set(LVar0, LVarA)
1778 IfGt(LVar0, 0)
1779 Loop(LVar0)
1780 Call(IncrementPlayerHP)
1781 Wait(1)
1782 EndLoop
1783 EndIf
1784 Set(LVar0, LVarB)
1785 IfGt(LVar0, 0)
1786 Loop(LVar0)
1787 Call(IncrementPlayerHP)
1788 Wait(1)
1789 EndLoop
1790 EndIf
1791 Set(LVar0, LVarC)
1792 IfGt(LVar0, 0)
1793 Loop(LVar0)
1794 Call(IncrementPlayerFP)
1795 Wait(1)
1796 EndLoop
1797 EndIf
1798 Wait(30)
1799 Call(SetAnimation, ACTOR_SELF, 0, ANIM_Mario1_Idle)
1800 Call(RemoveTurnEndFX)
1801 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
1802 Return
1803 End
1804};
1805
1807 Set(LVar0, 0)
1808 Loop(40)
1809 Add(LVar0, 72)
1810 Call(SetActorRotation, ACTOR_ENEMY0, 0, LVar0, 0)
1811 Wait(1)
1812 EndLoop
1813 Call(InflictDizzyAttackStatus)
1814 Call(SetActorRotation, ACTOR_ENEMY0, 0, 0, 0)
1815 Return
1816 End
1817};
1818
1820 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
1821 Call(GetActorPos, ACTOR_PLAYER, LVarF, LVar1, LVar2)
1822 Loop(LVar0)
1823 Add(LVarF, 3)
1824 Wait(1)
1825 EndLoop
1826 Call(GetLostHammerAndBootsLevel)
1827 Switch(LVarA)
1829 Set(LVarE, 0)
1830 Set(LVarA, ITEM_MENU_ITEMS)
1832 Set(LVarE, 1)
1833 Switch(LVarC)
1834 CaseEq(0)
1835 Set(LVarA, ITEM_MENU_HAMMER1)
1836 CaseEq(1)
1837 Set(LVarA, ITEM_MENU_HAMMER2)
1838 CaseEq(2)
1839 Set(LVarA, ITEM_MENU_HAMMER3)
1840 EndSwitch
1842 Set(LVarE, 2)
1843 Switch(LVarB)
1844 CaseEq(0)
1845 Set(LVarA, ITEM_MENU_BOOTS1)
1846 CaseEq(1)
1847 Set(LVarA, ITEM_MENU_BOOTS2)
1848 CaseEq(2)
1849 Set(LVarA, ITEM_MENU_BOOTS3)
1850 EndSwitch
1851 EndSwitch
1852 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1853 Add(LVarF, 24)
1854 Add(LVar1, 150)
1856 Set(LVarA, LVar0)
1857 Call(DropAbilityItem)
1858 Call(AbilityItemUnkDelay)
1859 Call(PlayerGatherAbilityItem)
1860 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1861 Add(LVar1, 20)
1862 PlayEffect(EFFECT_STARS_SHIMMER, 0, LVar0, LVar1, LVar2, 30, 30, 10, 30)
1864 Call(FreezeBattleState, FALSE)
1865 Return
1866 End
1867};
@ ACTION_COMMAND_MODE_NOT_LEARNED
Definition action_cmd.h:38
u32 * idleAnimations
ActorState state
struct ActorPart * partsTable
Vec2bu size
Vec3f curPos
Bytecode EvtScript[]
s16 invItems[10]
#define rand_int
#define clamp_angle
struct EnergyOrbWaveFXData * energyOrbWave
Definition effects.h:2546
EffectData data
Definition effects.h:2605
#define STATUS_FLAGS_IMMOBILIZED
Definition enums.h:2834
@ FX_INSTANCE_FLAG_DISMISS
Definition enums.h:3517
@ ACTION_RATING_LUCKY
clears nice hits
Definition enums.h:1981
@ ENV_TINT_SHROUD
Definition enums.h:4387
@ ACTION_COMMAND_FLEE
Definition enums.h:3475
@ BS_FLAGS1_BATTLE_FLED
Definition enums.h:3587
@ BS_FLAGS1_PLAYER_DEFENDING
Definition enums.h:3591
@ BS_FLAGS1_SHOW_PLAYER_DECORATIONS
Definition enums.h:3568
@ BS_FLAGS1_4000
Definition enums.h:3583
@ BS_FLAGS1_EXECUTING_MOVE
Definition enums.h:3578
@ BTL_MSG_MERLEE_ATK_UP
Definition enums.h:4058
@ BTL_MSG_MERLEE_EXP_UP
Definition enums.h:4060
@ BTL_MSG_ACTION_TIP_MASH_BUTTON
Definition enums.h:4108
@ BTL_MSG_MERLEE_DONE
Definition enums.h:4061
@ BTL_MSG_MERLEE_DEF_UP
Definition enums.h:4059
@ RUSH_FLAG_NONE
Definition enums.h:5330
@ RUSH_FLAG_MEGA
Definition enums.h:5331
@ RUSH_FLAG_POWER
Definition enums.h:5332
@ ITEM_SPAWN_MODE_TOSS_FADE1
Definition enums.h:2314
@ PHASE_PLAYER_HAPPY
Definition enums.h:2073
@ PHASE_MERLEE_ATTACK_BONUS
Definition enums.h:2070
@ PHASE_USE_DEFEND
Definition enums.h:2063
@ PHASE_RUN_AWAY_START
Definition enums.h:2060
@ PHASE_EXECUTE_ACTION
Definition enums.h:2058
@ PHASE_MERLEE_EXP_BONUS
Definition enums.h:2072
@ PHASE_CELEBRATE
Definition enums.h:2062
@ PHASE_USE_LIFE_SHROOM
Definition enums.h:2065
@ PHASE_MERLEE_DEFENSE_BONUS
Definition enums.h:2071
@ PHASE_DEATH
Definition enums.h:2061
@ PHASE_RUN_AWAY_FAIL
Definition enums.h:2064
@ PHASE_FIRST_STRIKE
Definition enums.h:2059
@ BTL_MENU_TYPE_SMASH
Definition enums.h:4228
@ BTL_MENU_TYPE_JUMP
Definition enums.h:4227
@ BTL_MENU_TYPE_STAR_POWERS
Definition enums.h:4235
@ BTL_MENU_TYPE_ITEMS
Definition enums.h:4229
@ BS_FLAGS2_HAS_RUSH
Definition enums.h:3621
@ BS_FLAGS2_PEACH_BATTLE
Definition enums.h:3610
@ STATUS_KEY_PARALYZE
Definition enums.h:2201
@ STATUS_KEY_FROZEN
Definition enums.h:2203
@ STATUS_KEY_FEAR
Definition enums.h:2199
@ STATUS_KEY_SLEEP
Definition enums.h:2202
@ STATUS_KEY_STONE
Definition enums.h:2208
@ STATUS_KEY_STOP
Definition enums.h:2204
@ STATUS_KEY_DIZZY
Definition enums.h:2200
@ BTL_CAM_DEFAULT
Definition enums.h:4824
@ BTL_CAM_PLAYER_ENTRY
Definition enums.h:4844
@ BTL_CAM_PLAYER_HIT_HAZARD
Definition enums.h:4853
@ BTL_CAM_REPOSITION
Definition enums.h:4841
@ BTL_CAM_PLAYER_WISH
Definition enums.h:4891
@ BTL_CAM_PLAYER_HIT_SPIKE
Definition enums.h:4852
@ BTL_CAM_PLAYER_DIES
Definition enums.h:4846
@ NPC_BTL_MERLEE
Definition enums.h:2529
@ ABILITY_POWER_RUSH
Definition enums.h:466
@ ABILITY_REFUND
Definition enums.h:465
@ ABILITY_MEGA_RUSH
Definition enums.h:456
@ SOUND_PLAYER_RUN_IN_PLACE
Definition enums.h:780
@ SOUND_MAGIC_DESCENDING
Definition enums.h:1414
@ SOUND_REVIVAL_MAGIC
Definition enums.h:1187
@ SOUND_NO_DAMGE
Definition enums.h:1433
@ SOUND_START_RECOVERY
Definition enums.h:1385
@ SOUND_PLAYER_REVIVE
Definition enums.h:1188
@ SOUND_MAGIC_ASCENDING
Definition enums.h:1413
@ SOUND_LUCKY
Definition enums.h:1313
@ SOUND_EAT_OR_DRINK
Definition enums.h:1441
@ SOUND_TRIP
Definition enums.h:784
@ SOUND_MERLEE_APPEAR
Definition enums.h:972
@ SOUND_PLAYER_COLLAPSE
Definition enums.h:1312
@ SOUND_DUST_OFF
Definition enums.h:791
@ SOUND_LIFE_SHROOM_CHIME
Definition enums.h:1186
@ SOUND_USE_ITEM
Definition enums.h:1434
@ SOUND_PLAYER_RUN_AWAY
Definition enums.h:781
@ SOUND_LONG_PLAYER_JUMP
Definition enums.h:782
@ SOUND_PLAYER_SPINNING
Definition enums.h:1185
@ ACTOR_PLAYER
Definition enums.h:2085
@ ACTOR_PARTNER
Definition enums.h:2086
@ ACTOR_ENEMY0
Definition enums.h:2087
@ ACTOR_SELF
Definition enums.h:2084
@ ACTOR_FLAG_NO_SHADOW
Hide shadow.
Definition enums.h:3325
@ ACTOR_BLUR_ENABLE
Definition enums.h:6414
@ ACTOR_BLUR_DISABLE
Definition enums.h:6413
@ EVENT_LUCKY
Definition enums.h:2172
@ EVENT_HIT
Definition enums.h:2132
@ EVENT_SPIKE_DEATH
Definition enums.h:2160
@ EVENT_BURN_HIT
Definition enums.h:2136
@ EVENT_SPIKE_CONTACT
Definition enums.h:2163
@ EVENT_FIRE_DEATH
Definition enums.h:2162
@ EVENT_IMMUNE
Definition enums.h:2146
@ EVENT_BURN_DEATH
Definition enums.h:2157
@ EVENT_ZERO_DAMAGE
Definition enums.h:2144
@ EVENT_SHOCK_DEATH
Definition enums.h:2159
@ EVENT_BLOCK
Definition enums.h:2147
@ EVENT_REVIVE
Definition enums.h:2180
@ EVENT_18
Definition enums.h:2145
@ EVENT_HIT_COMBO
Definition enums.h:2131
@ EVENT_DEATH
Definition enums.h:2153
@ EVENT_RECOVER_FROM_KO
Definition enums.h:2170
@ EVENT_LIFE_SHROOM_PROC
Definition enums.h:2179
@ EVENT_SHOCK_HIT
Definition enums.h:2165
@ EVENT_32
Definition enums.h:2168
@ EVENT_BURN_CONTACT
Definition enums.h:2164
@ EVENT_RECOVER_STATUS
Definition enums.h:2167
@ NPC_FLAG_IGNORE_CAMERA_FOR_YAW
Definition enums.h:3016
#define ApiStatus_DONE2
Definition evt.h:118
s32 Bytecode
Definition evt.h:7
#define ApiStatus_DONE1
Definition evt.h:117
#define ApiStatus_BLOCK
Definition evt.h:116
s32 evt_get_variable(Evt *script, Bytecode var)
Definition evt.c:1690
s32 is_ability_active(s32 arg0)
Definition inventory.c:1725
s32 player_team_is_ability_active(Actor *actor, s32 ability)
Definition 190B20.c:2765
void get_screen_coords(s32 camID, f32 x, f32 y, f32 z, s32 *screenX, s32 *screenY, s32 *screenZ)
Definition cam_main.c:410
void sort_consumables(void)
Bubbles up player inventory items such that all ITEM_NONE values are at the bottom.
Definition inventory.c:404
ItemEntity * get_item_entity(s32 itemEntityIndex)
void btl_update_ko_status(void)
Definition 190B20.c:2869
void mdl_set_all_tint_type(s32)
Definition model.c:4521
f32 dist2D(f32 ax, f32 ay, f32 bx, f32 by)
Definition 43F0.c:670
s32 make_item_entity(s32 itemID, f32 x, f32 y, f32 z, s32 itemSpawnMode, s32 pickupDelay, s32 angle, s32 pickupVar)
s32 find_item(s32)
Search player inventory for itemID and return first matching array index.
Definition inventory.c:258
void set_actor_anim(s32 actorID, s32 partID, AnimID animID)
Definition 190B20.c:1005
Actor * get_actor(s32 actorID)
Definition actor_api.c:155
void btl_show_battle_message(s32 messageIndex, s32 duration)
void deduct_current_move_fp(void)
Definition 190B20.c:961
s32 inflict_status_set_duration(Actor *actor, s32 statusTypeKey, s32 statusDurationKey, s32 duration)
Definition 190B20.c:2581
f32 sin_rad(f32 x)
Definition 43F0.c:713
s32 add_coins(s32 amt)
Definition inventory.c:2065
void btl_cam_unfreeze(void)
Definition camera.c:2002
void show_action_rating(s32, Actor *, f32, f32, f32)
Definition 190B20.c:2360
HudScript HES_Refund
void hud_element_set_render_pos(s32 id, s32 x, s32 y)
s32 hud_element_create(HudScript *anim)
Creates a new HUD element and returns its ID.
void hud_element_free(s32 id)
s32 HudScript[]
Definition hud_element.h:9
void mdl_set_shroud_tint_params(u8 r, u8 g, u8 b, u8 a)
Definition model.c:3906
Npc * get_npc_unsafe(s32 npcID)
Definition npc.c:995
BSS s32 BattleMerleeEffectsTime
EvtScript EVS_MerleeRunOut
EvtScript EVS_Player_NoDamageHit
BSS EffectInstance * BattleMerleeWaveEffect
EvtScript EVS_Player_SimpleHit
HudScript HES_Happy
EvtScript EVS_Player_HandleEvent
EvtScript EVS_PlayerFirstStrike
@ MERLEE_EFFECTS_DISMISS
@ MERLEE_EFFECTS_RELEASE
@ MERLEE_EFFECTS_HOLD
EvtScript EVS_MerleeExpBonus
EvtScript EVS_PeachEnterStage
EvtScript EVS_ApplyDizzyAttack
EvtScript EVS_ExecuteMarioAction
EvtScript EVS_PlayerRegainAbility
EvtScript EVS_Peach_HandlePhase
EvtScript EVS_PlayerDies
void btl_set_player_idle_anims(void)
EvtScript EVS_Unused_UseItemWithEffect
BSS s16 BattleMerleeEffectsState
BSS s32 D_8029FBB0[3]
EvtScript EVS_Unused_PlayerGoHome
EvtScript EVS_Mario_HandlePhase
EvtScript EVS_Peach_OnActorCreate
EvtScript EVS_Unused_UseItem
HudScript HES_HPDrain
EvtScript EVS_MerleeDefenseBonus
EvtScript EVS_Player_ComplexHit
EvtScript EVS_Unused_DrinkItem
EvtScript EVS_MarioEnterStage
BSS EffectInstance * BattleMerleeOrbEffect
PlayerCelebrationAnimOptions bPlayerCelebrations
Definition actors.c:5
EvtScript EVS_Player_Celebrate
BSS s32 HID_Happy
BSS s32 HID_Refund
EvtScript EVS_StartDefend
EvtScript EVS_PlayerHappy
EvtScript EVS_Mario_OnActorCreate
EvtScript EVS_UseLifeShroom
BSS s32 HID_HPDrain
EvtScript EVS_RunAwayFail
EvtScript EVS_MerleeAttackBonus
EvtScript EVS_RunAwayStart
EvtScript EVS_Unused_EatItem
BSS f32 BattleMerleeBasePosY
EvtScript EVS_ExecutePeachAction
EvtScript EVS_RunAwayNoCommand
void sfx_play_sound(s32 soundID)
Definition sfx.c:517
ApiStatus RemoveItemEntity(Evt *script, b32 isInitialCall)
ApiStatus DeleteNpc(Evt *script, b32 isInitialCall)
ApiStatus SetItemPos(Evt *script, b32 isInitialCall)
ApiStatus SetItemFlags(Evt *script, b32 isInitialCall)
ApiStatus RemoveEffect(Evt *script, b32 isInitialCall)
ApiStatus SetNpcAnimation(Evt *script, b32 isInitialCall)
ApiStatus SetNpcRenderMode(Evt *script, b32 isInitialCall)
ApiStatus CreateNpc(Evt *script, b32 isInitialCall)
ApiStatus SetNpcPos(Evt *script, b32 isInitialCall)
ApiStatus MakeItemEntity(Evt *script, b32 isInitialCall)
ApiStatus ShowStartRecoveryShimmer(Evt *script, b32 isInitialCall)
ApiStatus RandInt(Evt *script, b32 isInitialCall)
ApiStatus ShakeCam(Evt *script, b32 isInitialCall)
ApiStatus SetNpcFlagBits(Evt *script, b32 isInitialCall)
#define Else
Marks the end of an if statement and the start of the else block.
Definition macros.h:295
#define Switch(LVAR)
Marks the start of a switch statement.
Definition macros.h:311
#define LVar6
Definition macros.h:154
#define Set(VAR, INT_VALUE)
Sets the given variable to a given value casted to an integer.
Definition macros.h:365
#define AddF(VAR, FLOAT_VALUE)
Definition macros.h:383
#define CaseEq(RVAR)
Marks the start of a switch case that executes only if LVAR == RVAR. It also marks the end of any pre...
Definition macros.h:319
#define CaseNe(RVAR)
Marks the start of a switch case that executes only if LVAR != RVAR. It also marks the end of any pre...
Definition macros.h:322
#define EndChildThread
Marks the end of a child thread block.
Definition macros.h:563
#define Sub(VAR, INT_VALUE)
Definition macros.h:377
#define LVarF
Definition macros.h:163
#define End
Signals the end of EVT script data. A script missing this will likely crash on load.
Definition macros.h:213
#define Add(VAR, INT_VALUE)
Definition macros.h:376
#define IfFalse(b)
Definition macros.h:646
#define EndLoop
Marks the end of a loop.
Definition macros.h:248
#define EndCaseGroup
Marks the end of a switch case group (CaseOrEq and/or CaseAndEq), stopping fallthrough.
Definition macros.h:352
#define BSS
Definition macros.h:7
#define LVarC
Definition macros.h:160
#define IfGt(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR <= RVAR.
Definition macros.h:278
#define IfLt(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR < RVAR.
Definition macros.h:275
#define Float(DOUBLE)
Definition macros.h:51
#define CaseOrEq(RVAR)
Marks the start of a switch case that executes only if LVAR == RVAR.
Definition macros.h:341
#define EndIf
Marks the end of an if statement or an else block.
Definition macros.h:298
#define LVar5
Definition macros.h:153
#define CaseDefault
Marks the start of a switch case that executes unconditionally. It also marks the end of any previous...
Definition macros.h:337
#define LVarB
Definition macros.h:159
#define ExecWait(EVT_SOURCE)
Launches a new child thread.
Definition macros.h:475
#define LVar7
Definition macros.h:155
#define BreakLoop
Breaks out of the innermost loop.
Definition macros.h:251
#define Thread
Marks the start of a thread block.
Definition macros.h:544
#define EndThread
Marks the end of a thread block.
Definition macros.h:547
#define IfFlag(LVAR, RVAR)
Marks the beginning of an if statement that only executes if the RVAR flag is set on LVAR,...
Definition macros.h:288
#define LVar8
Definition macros.h:156
#define LVar2
Definition macros.h:150
#define DEG_TO_RAD(deg)
Definition macros.h:134
#define LVar1
Definition macros.h:149
#define LVarA
Definition macros.h:158
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
Definition macros.h:254
#define LVar9
Definition macros.h:157
#define PlayEffect(args...)
Definition macros.h:807
#define EndSwitch
Marks the end of a switch statement and any case.
Definition macros.h:362
#define IfEq(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR == RVAR.
Definition macros.h:269
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
Definition macros.h:576
#define ChildThread
Marks the start of a child thread block.
Definition macros.h:560
#define CaseGt(RVAR)
Marks the start of a switch case that executes only if LVAR <= RVAR. It also marks the end of any pre...
Definition macros.h:328
#define Loop(TIMES)
Marks the beginning of a loop.
Definition macros.h:245
#define LVar4
Definition macros.h:152
#define LVar3
Definition macros.h:151
#define LVarE
Definition macros.h:162
#define LVar0
Definition macros.h:148
#define SetConst(VAR, CONST)
Sets the given variable to a given value, skipping the evt_get_variable call.
Definition macros.h:370
#define Return
Kills the current EVT thread.
Definition macros.h:217
#define PERIL_THRESHOLD
Definition battle.h:267
#define DANGER_THRESHOLD
Definition battle.h:266
struct Actor * partnerActor
struct Actor * playerActor
Vec3f pos
s32 gBattleState
Definition battle.c:10
s32 gDefeatedBattleState
Definition battle.c:15
ItemData gItemTable[]
s32 bPeachIdleAnims[]
Definition actors.c:122
s32 bMarioDefendAnims[]
Definition actors.c:76
PlayerData gPlayerData
Definition 77480.c:40
u8 * gBackgroundTintModePtr
Definition model.c:105
BattleStatus gBattleStatus
Definition battle.c:11
u32 bMarioIdleAnims[]
Definition actors.c:53
s32 gCurrentCameraID
Definition cam_math.c:4
s32 gBattleSubState
Definition battle.c:14
s32 gDefeatedBattleSubstate
Definition battle.c:13