clean up coconut.c main

This commit is contained in:
Alex Bates 2021-02-05 14:56:42 +00:00
parent 45b3ed2a18
commit 0a18a59a9d
2 changed files with 38 additions and 23 deletions

View File

@ -286,6 +286,7 @@ typedef UNK_TYPE SoundId;
#define SoundId_MOLE_THROW 0x000003E8 #define SoundId_MOLE_THROW 0x000003E8
#define SoundId_CLOSE_SHELL 0x000002FF #define SoundId_CLOSE_SHELL 0x000002FF
#define SoundId_OPEN_SHELL 0x000003D4 #define SoundId_OPEN_SHELL 0x000003D4
#define SoundId_THROW 0x3FA
#define SoundId_BOW_VANISH 0x0000200E #define SoundId_BOW_VANISH 0x0000200E
#define SoundId_BOW_APPEAR 0x0000200F #define SoundId_BOW_APPEAR 0x0000200F
#define SoundId_CANNON1 0x00002016 #define SoundId_CANNON1 0x00002016

View File

@ -32,45 +32,59 @@ s32 D_802A1B50_7304B0[] = {
Script N(main) = SCRIPT({ Script N(main) = SCRIPT({
SI_VAR(10) =c ItemId_COCONUT; SI_VAR(10) =c ItemId_COCONUT;
await D_802A1240_72F960; await D_802A1240_72F960;
UseCamPreset(3); UseCamPreset(3);
MoveBattleCamOver(15); MoveBattleCamOver(15);
SetAnimation(0, 0, 0x10016);
PlaySound(1018); SetAnimation(ActorID_PLAYER, 0, PlayerAnim_THROW);
PlaySound(SoundId_THROW);
sleep 3; sleep 3;
func_802D3474(SI_VAR(10), D_802A1B50_7304B0); func_802D3474(SI_VAR(10), D_802A1B50_7304B0);
SI_VAR(0) = 1.0;
MultiplyByActorScale(SI_VAR(0)); $x = 1.0;
func_802D38EC(SI_VAR(10), SI_VAR(0), SI_VAR(0), SI_VAR(0)); MultiplyByActorScale($x);
GetActorPos(0, SI_VAR(0), SI_VAR(1), SI_VAR(2)); func_802D38EC(SI_VAR(10), $x, $x, $x);
GetActorPos(ActorID_PLAYER, $x, $y, $z);
SI_VAR(3) = 20; SI_VAR(3) = 20;
SI_VAR(4) = 42; SI_VAR(4) = 42;
SI_VAR(5) = 5; SI_VAR(5) = 5;
MultiplyVec3ByActorScale(SI_VAR(3), SI_VAR(4), SI_VAR(5)); MultiplyVec3ByActorScale(SI_VAR(3), SI_VAR(4), SI_VAR(5));
SI_VAR(0) += SI_VAR(3); $x += SI_VAR(3);
SI_VAR(1) += SI_VAR(4); $y += SI_VAR(4);
SI_VAR(2) += SI_VAR(5); $z += SI_VAR(5);
func_802D36E0(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2)); func_802D36E0(SI_VAR(10), $x, $y, $z);
InitTargetIterator(); InitTargetIterator();
SetGoalToTarget(ActorID_SELF); SetGoalToTarget(ActorID_SELF);
GetGoalPos(ActorID_SELF, SI_VAR(0), SI_VAR(1), SI_VAR(2)); GetGoalPos(ActorID_SELF, $x, $y, $z);
spawn { spawn {
SI_VAR(0) = 0; $x = 0;
loop 18 { loop 18 {
SI_VAR(0) += -60; $x += -60;
func_802D3840(SI_VAR(10), 0, 0, SI_VAR(0)); func_802D3840(SI_VAR(10), 0, 0, $x);
sleep 1; sleep 1;
} }
} }
func_802D39FC(SI_VAR(10), 0.8); func_802D39FC(SI_VAR(10), 0.8);
SI_VAR(2) += 5; $z += 5;
func_802D3C58(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2), 18); func_802D3C58(SI_VAR(10), $x, $y, $z, 18);
GetItemPower(ItemId_COCONUT, SI_VAR(3), SI_VAR(4));
ApplyShrinkFromOwner(SI_VAR(3)); GetItemPower(ItemId_COCONUT, $damage, SI_VAR(4));
ItemDamageEnemy(SI_VAR(9), 0x18000000, 0, SI_VAR(3), 32); ApplyShrinkFromOwner($damage);
SI_VAR(0) += 60; ItemDamageEnemy(SI_VAR(9), 0x18000000, 0, $damage, 32);
SI_VAR(1) += 0;
func_802D3C58(SI_VAR(10), SI_VAR(0), SI_VAR(1), SI_VAR(2), 16); // Bounce off
$x += 60;
$y += 0;
func_802D3C58(SI_VAR(10), $x, $y, $z, 16);
func_802D3624(SI_VAR(10)); func_802D3624(SI_VAR(10));
await D_802A1670_72FFD0;
await D_802A1670_72FFD0; // back to home pos
}); });