Disassemble KMR 2 Battle (#597)

This commit is contained in:
JoshDuMan 2022-01-01 08:08:04 -05:00 committed by GitHub
parent 5a5d158920
commit 5962ce37fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
135 changed files with 3833 additions and 918 deletions

View File

@ -13,11 +13,6 @@ typedef ApiStatus(*ApiFunc)(struct Evt*, s32);
typedef Bytecode EvtSource[0];
typedef struct DictionaryEntry {
/* 0x00 */ s32 key;
/* 0x04 */ s32 value;
} DictionaryEntry; // size = 0x08
typedef struct {
u8 r, g, b, a;
} Color_RGBA8;
@ -1717,7 +1712,7 @@ typedef struct Actor {
/* 0x207 */ s8 extraCoinBonus;
/* 0x208 */ s8 unk_208;
/* 0x209 */ char unk_209[3];
/* 0x20C */ struct DictionaryEntry* statusTable;
/* 0x20C */ struct s32* statusTable;
/* 0x210 */ s8 debuff;
/* 0x211 */ s8 debuffDuration;
/* 0x212 */ s8 staticStatus; /* 0B = yes */

View File

@ -2905,7 +2905,6 @@ enum NpcDropFlags {
};
enum ElementImmunityFlags {
ELEMENT_IMMUNITY_FLAGS_0 = 0x00000000,
ELEMENT_IMMUNITY_FLAGS_1 = 0x00000001,
ELEMENT_IMMUNITY_FLAGS_2 = 0x00000002,
ELEMENT_IMMUNITY_FLAGS_4 = 0x00000004,
@ -3012,4 +3011,10 @@ enum BattleSubmenuStatus {
BATTLE_SUBMENU_STATUS_NO_TARGETS_2 = -2, // TODO: determine difference, probably uses a different error message
};
enum DictionaryIndex {
DICTIONARY_KEY = 0,
DICTIONARY_VALUE = 1,
DICTIONARY_SIZE,
};
#endif

View File

@ -272,6 +272,7 @@ ApiStatus func_8024C944(Evt* script, s32 isInitialCall);
ApiStatus func_8024CB68(Evt* script, s32 isInitialCall);
ApiStatus func_8024E9B0(Evt* script, s32 isInitialCall);
ApiStatus func_8024E748(Evt* script, s32 isInitialCall);
ApiStatus func_8026DF88(Evt* script, s32 isInitialCall);
ApiStatus InitVirtualEntityList(Evt* script, s32 isInitialCall);
ApiStatus InitAnimatedModels(Evt* script, s32 isInitialCall);
ApiStatus func_8024CE9C(Evt* script, s32 isInitialCall);

View File

@ -2344,57 +2344,57 @@ s32 func_80265D44(s32 animID) {
return ret;
}
s32 lookup_defense(DictionaryEntry* defenseTable, s32 elementKey) {
s32 lookup_defense(s32* defenseTable, s32 elementKey) {
s32 normalDefense = 0;
while (defenseTable->key != ELEMENT_END) {
if (defenseTable->key == ELEMENT_NORMAL) {
normalDefense = defenseTable->value;
while (defenseTable[DICTIONARY_KEY] != ELEMENT_END) {
if (defenseTable[DICTIONARY_KEY] == ELEMENT_NORMAL) {
normalDefense = defenseTable[DICTIONARY_VALUE];
}
if (defenseTable->key == elementKey) {
normalDefense = defenseTable->value;
if (defenseTable[DICTIONARY_KEY] == elementKey) {
normalDefense = defenseTable[DICTIONARY_VALUE];
break;
}
defenseTable++;
defenseTable += DICTIONARY_SIZE;
}
// Fall back to normal defense if given element is not specified in table
return normalDefense;
}
s32 lookup_status_chance(DictionaryEntry* statusTable, s32 statusKey) {
s32 lookup_status_chance(s32* statusTable, s32 statusKey) {
s32 defaultChance = 0;
while (statusTable->key != STATUS_END) {
if (statusTable->key == STATUS_DEFAULT) {
defaultChance = statusTable->value;
while (statusTable[DICTIONARY_KEY] != STATUS_END) {
if (statusTable[DICTIONARY_KEY] == STATUS_DEFAULT) {
defaultChance = statusTable[DICTIONARY_VALUE];
}
if (statusTable->key == statusKey) {
defaultChance = statusTable->value;
if (statusTable[DICTIONARY_KEY] == statusKey) {
defaultChance = statusTable[DICTIONARY_VALUE];
break;
}
statusTable++;
statusTable += DICTIONARY_SIZE;
}
// Fall back to normal chance if given element is not specified in table
return defaultChance;
}
s32 lookup_status_duration_mod(DictionaryEntry* statusTable, s32 statusKey) {
s32 lookup_status_duration_mod(s32* statusTable, s32 statusKey) {
s32 defaultTurnMod = 0;
while (statusTable->key != ELEMENT_END) {
if (statusTable->key == STATUS_DEFAULT_TURN_MOD) {
defaultTurnMod = statusTable->value;
while (statusTable[DICTIONARY_KEY] != ELEMENT_END) {
if (statusTable[DICTIONARY_KEY] == STATUS_DEFAULT_TURN_MOD) {
defaultTurnMod = statusTable[DICTIONARY_VALUE];
}
if (statusTable->key == statusKey) {
defaultTurnMod = statusTable->value;
if (statusTable[DICTIONARY_KEY] == statusKey) {
defaultTurnMod = statusTable[DICTIONARY_VALUE];
break;
}
statusTable++;
statusTable += DICTIONARY_SIZE;
}
// Fall back to normal duration if given element is not specified in table
@ -2536,7 +2536,7 @@ s32 inflict_partner_ko(Actor* target, s32 statusTypeKey, s32 duration) {
return TRUE;
}
s32 get_defense(Actor* actor, DictionaryEntry* defenseTable, s32 elementFlags) {
s32 get_defense(Actor* actor, s32* defenseTable, s32 elementFlags) {
s32 defense;
s32 minDefense = 255;

View File

@ -3,4 +3,4 @@
#define NAMESPACE EC2610
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"

View File

@ -3,7 +3,7 @@
#define NAMESPACE EC7590
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"
INCLUDE_ASM(s32, "EC7590", func_8024061C_EC77CC);

View File

@ -3,4 +3,4 @@
#define NAMESPACE ECB930
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"

View File

@ -3,4 +3,4 @@
#define NAMESPACE ED00D0
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"

View File

@ -3,4 +3,4 @@
#define NAMESPACE ED5540
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"

View File

@ -18,7 +18,7 @@ extern s32 D_80241850_EDD834 = {
};
*/
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"
#ifdef NON_MATCHING // TODO(data)
ApiStatus func_8024027C_EDC25C(Evt* script, s32 isInitialCall) {

View File

@ -3,4 +3,4 @@
#define NAMESPACE EF8010
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"

View File

@ -2744,7 +2744,7 @@ s32 func_8026F1A0(Evt* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
ApiStatus GetStatusFlags(Evt* script, s32 isInitialCall) {
ApiStatus GetStatusFlags(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
BattleStatus* battleStatus = &gBattleStatus;
s32 actorID = evt_get_variable(script, *args++);

View File

@ -1,76 +0,0 @@
#include "common.h"
// TODO: determine purpose and name accordingly
f32 N(angleTable)[] = {
0.000000f, 0.017452f, 0.034899f, 0.052336f, 0.069756f, 0.087156f, 0.104528f, 0.121869f,
0.139173f, 0.156434f, 0.173648f, 0.190809f, 0.207912f, 0.224951f, 0.241922f, 0.258819f,
0.275637f, 0.292372f, 0.309017f, 0.325568f, 0.342020f, 0.358368f, 0.374607f, 0.390731f,
0.406737f, 0.422618f, 0.438371f, 0.453990f, 0.469472f, 0.484810f, 0.500000f, 0.515038f,
0.529919f, 0.544639f, 0.559193f, 0.573576f, 0.587785f, 0.601815f, 0.615661f, 0.629320f,
0.642788f, 0.656059f, 0.669131f, 0.681998f, 0.694658f, 0.707107f, 0.719340f, 0.731354f,
0.743145f, 0.754710f, 0.766044f, 0.777146f, 0.788011f, 0.798636f, 0.809017f, 0.819152f,
0.829038f, 0.838671f, 0.848048f, 0.857167f, 0.866025f, 0.874620f, 0.882948f, 0.891007f,
0.898794f, 0.906308f, 0.913545f, 0.920505f, 0.927184f, 0.933580f, 0.939693f, 0.945519f,
0.951057f, 0.956305f, 0.961262f, 0.965926f, 0.970296f, 0.974370f, 0.978148f, 0.981627f,
0.984808f, 0.987688f, 0.990268f, 0.992546f, 0.994522f, 0.996195f, 0.997564f, 0.998630f,
0.999391f, 0.999848f, 1.000000f,
};
u32 N(angle_calculate)(f32 x, f32 y) {
f32 tempF = abs(y) / length2D(x, y);
u16 angle1 = 0;
u16 angle2 = 90;
u16 ret;
u16 i;
for (i = 0; i < 7; i++) {
u16 temp_v1 = angle1 + ((angle2 - angle1) / 2);
if (N(angleTable)[temp_v1] < tempF) {
angle1 = temp_v1;
} else {
angle2 = temp_v1;
}
}
if (fabsf(N(angleTable)[angle1] - tempF) < fabsf(N(angleTable)[angle2] - tempF)) {
ret = angle1;
} else {
ret = angle2;
}
if (x < 0.0f && y >= 0.0f) {
ret = 180 - ret;
}
if (x < 0.0f && y < 0.0f) {
ret += 180;
}
if (x >= 0.0f && y < 0.0f) {
ret = 360 - ret;
}
return ret;
}
ApiStatus N(AngleCalculate)(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 var1 = evt_get_variable(script, *args++);
s32 var2 = evt_get_variable(script, *args++);
s32 var3 = evt_get_variable(script, *args++);
s32 var4 = evt_get_variable(script, *args++);
s32 var5 = evt_get_variable(script, *args);
var3 -= var1;
var4 -= var2;
if (var3 == 0 && var4 == 0) {
evt_set_variable(script, *args, var5);
return ApiStatus_DONE2;
} else {
evt_set_variable(script, *args, N(angle_calculate)(var3, var4) - 90);
return ApiStatus_DONE2;
}
}

View File

@ -35,8 +35,8 @@ s32 N(statusTable_8021961C)[] = {
STATUS_END,
};
s32 N(idleAnimations_80219714)[];
EvtSource N(init_802197AC);
extern s32 N(idleAnimations_80219714)[];
extern EvtSource N(init_802197AC);
ActorPartDesc N(partsTable_802196C8)[] = {
{
@ -48,7 +48,7 @@ ActorPartDesc N(partsTable_802196C8)[] = {
.idleAnimations = N(idleAnimations_80219714),
.defenseTable = N(defenseTable_80219610),
.eventFlags = ACTOR_EVENT_FLAG_0,
.elementImmunityFlags = ELEMENT_IMMUNITY_FLAGS_0,
.elementImmunityFlags = 0,
.unk_1C = 246,
},
};
@ -102,9 +102,9 @@ s32 N(idleAnimations_80219760)[] = {
STATUS_END,
};
EvtSource N(takeTurn_8021A300);
EvtSource N(idle_802197F8);
EvtSource N(handleEvent_80219AD4);
extern EvtSource N(takeTurn_8021A300);
extern EvtSource N(idle_802197F8);
extern EvtSource N(handleEvent_80219AD4);
EvtSource N(init_802197AC) = {
EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021A300)))
@ -281,7 +281,7 @@ EvtSource N(handleEvent_80219AD4) = {
EVT_END
};
#include "anglestuff.inc.c"
#include "common/anglestuff.inc.c"
EvtSource N(takeTurn_8021A300) = {
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)

View File

@ -68,11 +68,11 @@ s32 N(statusTable_8021CBC4)[] = {
STATUS_END,
};
s32 N(idleAnimations_8021E4EC)[];
s32 N(idleAnimations_8021CD28)[];
s32 N(idleAnimations_8021CDC0)[];
s32 N(idleAnimations_8021CDCC)[];
EvtSource N(init_8021CDD8);
extern s32 N(idleAnimations_8021E4EC)[];
extern s32 N(idleAnimations_8021CD28)[];
extern s32 N(idleAnimations_8021CDC0)[];
extern s32 N(idleAnimations_8021CDCC)[];
extern EvtSource N(init_8021CDD8);
ActorPartDesc N(partsTable_8021CC70)[] = {
{
@ -84,7 +84,7 @@ ActorPartDesc N(partsTable_8021CC70)[] = {
.idleAnimations = N(idleAnimations_8021E4EC),
.defenseTable = N(defenseTable_8021CB00),
.eventFlags = ACTOR_EVENT_FLAG_0,
.elementImmunityFlags = ELEMENT_IMMUNITY_FLAGS_0,
.elementImmunityFlags = 0,
.unk_1C = 246,
},
{
@ -96,7 +96,7 @@ ActorPartDesc N(partsTable_8021CC70)[] = {
.idleAnimations = N(idleAnimations_8021CD28),
.defenseTable = N(defenseTable_8021CB0C),
.eventFlags = ACTOR_EVENT_FLAG_GROUNDABLE,
.elementImmunityFlags = ELEMENT_IMMUNITY_FLAGS_0,
.elementImmunityFlags = 0,
.unk_1C = 246,
},
{
@ -108,7 +108,7 @@ ActorPartDesc N(partsTable_8021CC70)[] = {
.idleAnimations = N(idleAnimations_8021CDC0),
.defenseTable = N(defenseTable_8021CB00),
.eventFlags = ACTOR_EVENT_FLAG_0,
.elementImmunityFlags = ELEMENT_IMMUNITY_FLAGS_0,
.elementImmunityFlags = 0,
.unk_1C = 246,
},
{
@ -120,7 +120,7 @@ ActorPartDesc N(partsTable_8021CC70)[] = {
.idleAnimations = N(idleAnimations_8021CDCC),
.defenseTable = N(defenseTable_8021CB00),
.eventFlags = ACTOR_EVENT_FLAG_0,
.elementImmunityFlags = ELEMENT_IMMUNITY_FLAGS_0,
.elementImmunityFlags = 0,
.unk_1C = 246,
},
};
@ -184,9 +184,9 @@ s32 N(idleAnimations_8021CDCC)[] = {
STATUS_END,
};
EvtSource N(takeTurn_8021D74C);
EvtSource N(idle_8021CE24);
EvtSource N(handleEvent_8021D158);
extern EvtSource N(takeTurn_8021D74C);
extern EvtSource N(idle_8021CE24);
extern EvtSource N(handleEvent_8021D158);
EvtSource N(init_8021CDD8) = {
EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021D74C)))
@ -254,7 +254,7 @@ EvtSource N(8021D0E0) = {
EVT_END
};
EvtSource N(8021DF64);
extern EvtSource N(8021DF64);
EvtSource N(handleEvent_8021D158) = {
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
@ -480,7 +480,7 @@ EvtSource N(takeTurn_8021D74C) = {
EVT_END
};
EvtSource N(8021E584);
extern EvtSource N(8021E584);
#include "common/StartRumbleWithParams.inc.c"
@ -580,9 +580,9 @@ s32 N(idleAnimations_8021E538)[] = {
STATUS_END,
};
EvtSource N(takeTurn_8021F0D8);
EvtSource N(idle_8021E5D0);
EvtSource N(handleEvent_8021E8AC);
extern EvtSource N(takeTurn_8021F0D8);
extern EvtSource N(idle_8021E5D0);
extern EvtSource N(handleEvent_8021E8AC);
EvtSource N(8021E584) = {
EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021F0D8)))
@ -759,7 +759,7 @@ EvtSource N(handleEvent_8021E8AC) = {
EVT_END
};
#include "anglestuff.inc.c"
#include "common/anglestuff.inc.c"
EvtSource N(takeTurn_8021F0D8) = {
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)

View File

@ -35,8 +35,8 @@ s32 N(statusTable_8021AFDC)[] = {
STATUS_END,
};
s32 N(idleAnimations_8021B0D4)[];
EvtSource N(init_8021B16C);
extern s32 N(idleAnimations_8021B0D4)[];
extern EvtSource N(init_8021B16C);
ActorPartDesc N(partsTable_8021B088)[] = {
{
@ -48,7 +48,7 @@ ActorPartDesc N(partsTable_8021B088)[] = {
.idleAnimations = N(idleAnimations_8021B0D4),
.defenseTable = N(defenseTable_8021AFD0),
.eventFlags = ACTOR_EVENT_FLAG_SPIKY_TOP,
.elementImmunityFlags = ELEMENT_IMMUNITY_FLAGS_0,
.elementImmunityFlags = 0,
.unk_1C = 244,
},
};
@ -102,9 +102,9 @@ s32 N(idleAnimations_8021B120)[] = {
STATUS_END,
};
EvtSource N(takeTurn_8021BDDC);
EvtSource N(idle_8021B1B8);
EvtSource N(handleEvent_8021B494);
extern EvtSource N(takeTurn_8021BDDC);
extern EvtSource N(idle_8021B1B8);
extern EvtSource N(handleEvent_8021B494);
EvtSource N(init_8021B16C) = {
EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_8021BDDC)))
@ -296,7 +296,7 @@ EvtSource N(handleEvent_8021B494) = {
EVT_END
};
#include "anglestuff.inc.c"
#include "common/anglestuff.inc.c"
EvtSource N(takeTurn_8021BDDC) = {
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)

View File

@ -19,66 +19,66 @@ extern Stage N(kmr_05);
extern Stage N(kmr_06);
Formation N(formation_00) = {
{ &N(goomba), .position = 1, .priority = 10 },
{ &N(goomba), .home = { .index = 1 }, .priority = 10 },
};
Formation N(formation_01) = {
{ &N(goomba), .position = 1, .priority = 10 },
{ &N(goomba), .position = 2, .priority = 9 },
{ &N(goomba), .home = { .index = 1 }, .priority = 10 },
{ &N(goomba), .home = { .index = 2 }, .priority = 9 },
};
Formation N(formation_02) = {
{ &N(goomba), .position = 0, .priority = 10 },
{ &N(goomba), .position = 1, .priority = 9 },
{ &N(goomba), .position = 2, .priority = 8 },
{ &N(goomba), .home = { .index = 0 }, .priority = 10 },
{ &N(goomba), .home = { .index = 1 }, .priority = 9 },
{ &N(goomba), .home = { .index = 2 }, .priority = 8 },
};
Formation N(formation_03) = {
{ &N(goomba), .position = 1, .priority = 10 },
{ &N(paragoomba), .position = 6, .priority = 9 },
{ &N(goomba), .home = { .index = 1 }, .priority = 10 },
{ &N(paragoomba), .home = { .index = 6 }, .priority = 9 },
};
Formation N(formation_04) = {
{ &N(goomba), .position = 0, .priority = 10 },
{ &N(goomba), .position = 1, .priority = 9 },
{ &N(goomba), .position = 2, .priority = 8 },
{ &N(goomba), .position = 3, .priority = 7 },
{ &N(goomba), .home = { .index = 0 }, .priority = 10 },
{ &N(goomba), .home = { .index = 1 }, .priority = 9 },
{ &N(goomba), .home = { .index = 2 }, .priority = 8 },
{ &N(goomba), .home = { .index = 3 }, .priority = 7 },
};
Formation N(formation_05) = {
{ &N(goomba), .position = 1, .priority = 10 },
{ &N(spiked_goomba), .position = 2, .priority = 9 },
{ &N(goomba), .home = { .index = 1 }, .priority = 10 },
{ &N(spiked_goomba), .home = { .index = 2 }, .priority = 9 },
};
Formation N(formation_06) = {
{ &N(goomba), .position = 0, .priority = 10 },
{ &N(paragoomba), .position = 5, .priority = 9 },
{ &N(goomba), .position = 2, .priority = 8 },
{ &N(paragoomba), .position = 7, .priority = 7 },
{ &N(goomba), .home = { .index = 0 }, .priority = 10 },
{ &N(paragoomba), .home = { .index = 5 }, .priority = 9 },
{ &N(goomba), .home = { .index = 2 }, .priority = 8 },
{ &N(paragoomba), .home = { .index = 7 }, .priority = 7 },
};
Formation N(formation_07) = {
{ &N(paragoomba), .position = 5, .priority = 10 },
{ &N(paragoomba), .home = { .index = 5 }, .priority = 10 },
};
Formation N(formation_08) = {
{ &N(paragoomba), .position = 5, .priority = 10 },
{ &N(paragoomba), .position = 6, .priority = 9 },
{ &N(paragoomba), .home = { .index = 5 }, .priority = 10 },
{ &N(paragoomba), .home = { .index = 6 }, .priority = 9 },
};
Formation N(formation_09) = {
{ &N(paragoomba), .position = 4, .priority = 10 },
{ &N(paragoomba), .position = 5, .priority = 9 },
{ &N(paragoomba), .position = 6, .priority = 8 },
{ &N(paragoomba), .home = { .index = 4 }, .priority = 10 },
{ &N(paragoomba), .home = { .index = 5 }, .priority = 9 },
{ &N(paragoomba), .home = { .index = 6 }, .priority = 8 },
};
Formation N(formation_0A) = {
{ &N(spiked_goomba), .position = 1, .priority = 10 },
{ &N(spiked_goomba), .home = { .index = 1 }, .priority = 10 },
};
Formation N(formation_0B) = {
{ &N(spiked_goomba), .position = 1, .priority = 10 },
{ &N(goomba), .position = 2, .priority = 9 },
{ &N(spiked_goomba), .home = { .index = 1 }, .priority = 10 },
{ &N(goomba), .home = { .index = 2 }, .priority = 9 },
};
BattleList N(formationTable) = {

View File

@ -3,7 +3,7 @@
#define NAMESPACE b_area_kmr_part_1_kmr_03
#include "clouds.inc.c"
#include "world/common/clouds.inc.c"
EvtSource N(beforeBattle_80220188) = {
EVT_CALL(SetSpriteShading, -1)

View File

@ -3,7 +3,7 @@
#define NAMESPACE b_area_kmr_part_1_kmr_04
#include "clouds.inc.c"
#include "world/common/clouds.inc.c"
EvtSource N(beforeBattle_802205D8) = {
EVT_CALL(SetSpriteShading, -1)

View File

@ -3,7 +3,7 @@
#define NAMESPACE b_area_kmr_part_1_kmr_05
#include "clouds.inc.c"
#include "world/common/clouds.inc.c"
EvtSource N(beforeBattle_80220A28) = {
EVT_CALL(SetSpriteShading, -1)

View File

@ -3,7 +3,7 @@
#define NAMESPACE b_area_kmr_part_1_kmr_06
#include "clouds.inc.c"
#include "world/common/clouds.inc.c"
#include "common/UnkFogFunc.inc.c"
EvtSource N(beforeBattle_80220E28) = {

View File

@ -1,33 +0,0 @@
#include "common.h"
#include "effects.h"
#define NAMESPACE b_area_kmr_part_2
#include "common/BattleAreaAngleStuff.inc.c"
#define NAMESPACE dup_b_area_kmr_part_2
#include "common/BattleAreaAngleStuff.inc.c"
#define NAMESPACE b_area_kmr_part_2
#define NAMESPACE dup2_b_area_kmr_part_2
#include "common/BattleAreaAngleStuff.inc.c"
#define NAMESPACE b_area_kmr_part_2
#include "common/DivActorLevel4.inc.c"
#define NAMESPACE dup3_b_area_kmr_part_2
#include "common/BattleAreaAngleStuff.inc.c"
#define NAMESPACE b_area_kmr_part_2
#define NAMESPACE dup_b_area_kmr_part_2
#include "common/DivActorLevel4.inc.c"
#define NAMESPACE b_area_kmr_part_2
ApiStatus func_80218A60_43A4F0(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 var1 = evt_get_variable(script, *args++);
s32 var2 = evt_get_variable(script, *args++);
fx_land(2, var1, var2, evt_get_variable(script, *args++), 0);
return ApiStatus_DONE2;
}

View File

@ -1,5 +0,0 @@
#include "common.h"
#define NAMESPACE b_area_kmr_part_2
#include "world/common/foliage.inc.c"

View File

@ -1,5 +0,0 @@
#include "common.h"
#define NAMESPACE b_area_kmr_part_2
#include "common/UnkAngleFunc2.inc.c"

View File

@ -1,7 +0,0 @@
#include "common.h"
#define NAMESPACE b_area_kmr_part_2
#define NAMESPACE dup_b_area_kmr_part_2
#include "common/UnkAngleFunc2.inc.c"
#define NAMESPACE b_area_kmr_part_2

View File

@ -1,7 +0,0 @@
#include "common.h"
#define NAMESPACE b_area_kmr_part_2
#define NAMESPACE dup2_b_area_kmr_part_2
#include "common/UnkAngleFunc2.inc.c"
#define NAMESPACE b_area_kmr_part_2

View File

@ -1,9 +0,0 @@
#include "common.h"
#define NAMESPACE b_area_kmr_part_2
#define NAMESPACE dup3_b_area_kmr_part_2
#include "common/UnkAngleFunc2.inc.c"
#define NAMESPACE b_area_kmr_part_2
#include "common/UnkFogFunc.inc.c"

View File

@ -0,0 +1,530 @@
#include "common.h"
#include "battle/battle.h"
#include "script_api/battle.h"
#include "sprite/npc/goomba_bros.h"
#define NAMESPACE b_area_kmr_part_2_blue_goomba
s32 N(defenseTable_802198B0)[] = {
ELEMENT_NORMAL, 0,
ELEMENT_END,
};
s32 N(statusTable_802198BC)[] = {
STATUS_NORMAL, 0,
STATUS_DEFAULT, 0,
STATUS_SLEEP, 100,
STATUS_POISON, 0,
STATUS_FROZEN, 0,
STATUS_DIZZY, 100,
STATUS_FEAR, 0,
STATUS_STATIC, 0,
STATUS_PARALYZE, 100,
STATUS_SHRINK, 100,
STATUS_STOP, 100,
STATUS_DEFAULT_TURN_MOD, 0,
STATUS_SLEEP_TURN_MOD, 0,
STATUS_POISON_TURN_MOD, 0,
STATUS_FROZEN_TURN_MOD, 0,
STATUS_DIZZY_TURN_MOD, 0,
STATUS_FEAR_TURN_MOD, 0,
STATUS_STATIC_TURN_MOD, 0,
STATUS_PARALYZE_TURN_MOD, 0,
STATUS_SHRINK_TURN_MOD, 0,
STATUS_STOP_TURN_MOD, 0,
STATUS_END,
};
extern s32 N(idleAnimations_802199B4)[];
extern EvtSource N(init_8021B268);
extern EvtSource N(doDeath_8021B388);
extern EvtSource N(takeTurn_8021A5A0);
extern EvtSource N(idle_80219A98);
extern EvtSource N(handleEvent_80219D74);
extern EvtSource N(takeTurn_8021B2C8);
ActorPartDesc N(partsTable_80219968)[] = {
{
.flags = ACTOR_PART_FLAG_MULTI_TARGET,
.index = 1,
.posOffset = { 0, 0, 0 },
.targetOffset = { 0, 24 },
.opacity = 255,
.idleAnimations = N(idleAnimations_802199B4),
.defenseTable = N(defenseTable_802198B0),
.eventFlags = ACTOR_EVENT_FLAG_0,
.elementImmunityFlags = 0,
.unk_1C = 253,
},
};
ActorDesc NAMESPACE = {
.flags = 0,
.type = ACTOR_TYPE_BLUE_GOOMBA_BOSS,
.level = 20,
.maxHP = 6,
.partCount = ARRAY_COUNT(N(partsTable_80219968)),
.partsData = N(partsTable_80219968),
.script = N(init_8021B268),
.statusTable = N(statusTable_802198BC),
.escapeChance = 0,
.airLiftChance = 0,
.spookChance = 0,
.baseStatusChance = 0,
.upAndAwayChance = 0,
.spinSmashReq = 0,
.powerBounceChance = 80,
.coinReward = 0,
.size = { 32, 32 },
.hpBarOffset = { 0, 0 },
.statusIconOffset = { -10, 20 },
.statusMessageOffset = { 8, 25 },
};
s32 N(idleAnimations_802199B4)[] = {
STATUS_NORMAL, NPC_ANIM_goomba_bros_Palette_01_Anim_2,
STATUS_STONE, NPC_ANIM_goomba_bros_Palette_01_Anim_0,
STATUS_SLEEP, NPC_ANIM_goomba_bros_Palette_01_Anim_D,
STATUS_POISON, NPC_ANIM_goomba_bros_Palette_01_Anim_2,
STATUS_STOP, NPC_ANIM_goomba_bros_Palette_01_Anim_0,
STATUS_STATIC, NPC_ANIM_goomba_bros_Palette_01_Anim_2,
STATUS_PARALYZE, NPC_ANIM_goomba_bros_Palette_01_Anim_0,
STATUS_DIZZY, NPC_ANIM_goomba_bros_Palette_01_Anim_C,
STATUS_FEAR, NPC_ANIM_goomba_bros_Palette_01_Anim_C,
STATUS_END,
};
s32 N(idleAnimations_80219A00)[] = {
STATUS_NORMAL, NPC_ANIM_goomba_bros_Palette_01_Anim_6,
STATUS_STONE, NPC_ANIM_goomba_bros_Palette_01_Anim_0,
STATUS_SLEEP, NPC_ANIM_goomba_bros_Palette_01_Anim_D,
STATUS_POISON, NPC_ANIM_goomba_bros_Palette_01_Anim_2,
STATUS_STOP, NPC_ANIM_goomba_bros_Palette_01_Anim_0,
STATUS_STATIC, NPC_ANIM_goomba_bros_Palette_01_Anim_6,
STATUS_PARALYZE, NPC_ANIM_goomba_bros_Palette_01_Anim_0,
STATUS_DIZZY, NPC_ANIM_goomba_bros_Palette_01_Anim_C,
STATUS_FEAR, NPC_ANIM_goomba_bros_Palette_01_Anim_C,
STATUS_END,
};
EvtSource N(init_80219A4C) = {
EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_ADDR(N(takeTurn_8021A5A0)))
EVT_CALL(BindIdle, ACTOR_SELF, EVT_ADDR(N(idle_80219A98)))
EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_ADDR(N(handleEvent_80219D74)))
EVT_RETURN
EVT_END
};
EvtSource N(idle_80219A98) = {
EVT_LABEL(10)
EVT_CALL(RandInt, 80, LW(0))
EVT_ADD(LW(0), 80)
EVT_LOOP(LW(0))
EVT_LABEL(0)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(1))
EVT_IF_FLAG(LW(1), 0x35D000)
EVT_WAIT_FRAMES(1)
EVT_GOTO(0)
EVT_END_IF
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(0), 5)
EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0))
EVT_CALL(SetIdleAnimations, ACTOR_SELF, 1, EVT_ADDR(N(idleAnimations_80219A00)))
EVT_CALL(SetIdleGoal, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(IdleRunToGoal, -127, 0)
EVT_CALL(SetIdleAnimations, ACTOR_SELF, 1, EVT_ADDR(N(idleAnimations_802199B4)))
EVT_LOOP(20)
EVT_LABEL(1)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(1))
EVT_IF_FLAG(LW(1), 0x35D000)
EVT_WAIT_FRAMES(1)
EVT_GOTO(1)
EVT_END_IF
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_SUB(LW(0), 5)
EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0))
EVT_CALL(SetIdleAnimations, ACTOR_SELF, 1, EVT_ADDR(N(idleAnimations_80219A00)))
EVT_CALL(SetIdleGoal, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(IdleRunToGoal, -127, 0)
EVT_CALL(SetIdleAnimations, ACTOR_SELF, 1, EVT_ADDR(N(idleAnimations_802199B4)))
EVT_LOOP(80)
EVT_LABEL(2)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(1))
EVT_IF_FLAG(LW(1), 0x35D000)
EVT_WAIT_FRAMES(1)
EVT_GOTO(2)
EVT_END_IF
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_GOTO(10)
EVT_RETURN
EVT_END
};
EvtSource N(handleEvent_80219D74) = {
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 0)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0))
EVT_CALL(GetLastEvent, ACTOR_SELF, LW(0))
EVT_SWITCH(LW(0))
EVT_CASE_OR_EQ(9)
EVT_CASE_OR_EQ(10)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_01_Anim_9)
EVT_EXEC_WAIT(DoNormalHit)
EVT_END_CASE_GROUP
EVT_CASE_EQ(14)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_01_Anim_E)
EVT_SET_CONST(LW(2), NPC_ANIM_goomba_bros_Palette_01_Anim_F)
EVT_EXEC_WAIT(DoBurnHit)
EVT_CASE_EQ(36)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_01_Anim_E)
EVT_SET_CONST(LW(2), NPC_ANIM_goomba_bros_Palette_01_Anim_F)
EVT_EXEC_WAIT(DoBurnHit)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_01_Anim_F)
EVT_EXEC_WAIT(N(doDeath_8021B388))
EVT_RETURN
EVT_CASE_EQ(11)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_01_Anim_9)
EVT_EXEC_WAIT(DoSpinSmashHit)
EVT_CASE_EQ(33)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_01_Anim_9)
EVT_EXEC_WAIT(DoSpinSmashHit)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_01_Anim_9)
EVT_EXEC_WAIT(N(doDeath_8021B388))
EVT_RETURN
EVT_CASE_EQ(47)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_01_Anim_9)
EVT_EXEC_WAIT(DoShockHit)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_01_Anim_9)
EVT_EXEC_WAIT(DoJumpBack)
EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(2.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_01_Anim_C)
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0))
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(1.0))
EVT_WAIT_FRAMES(5)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_01_Anim_2)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6005859375))
EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
EVT_CASE_EQ(38)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_01_Anim_9)
EVT_EXEC_WAIT(DoShockHit)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_01_Anim_9)
EVT_EXEC_WAIT(N(doDeath_8021B388))
EVT_RETURN
EVT_CASE_EQ(19)
EVT_CASE_OR_EQ(23)
EVT_CASE_OR_EQ(25)
EVT_CASE_OR_EQ(31)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_01_Anim_2)
EVT_EXEC_WAIT(DoImmune)
EVT_END_CASE_GROUP
EVT_CASE_EQ(32)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_01_Anim_9)
EVT_EXEC_WAIT(DoNormalHit)
EVT_WAIT_FRAMES(10)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_01_Anim_9)
EVT_EXEC_WAIT(N(doDeath_8021B388))
EVT_RETURN
EVT_CASE_EQ(53)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(2.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_01_Anim_6)
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0))
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(1.0))
EVT_CALL(HPBarToHome, ACTOR_SELF)
EVT_CASE_EQ(49)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_01_Anim_2)
EVT_EXEC_WAIT(DoRecover)
EVT_CASE_EQ(57)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_01_Anim_6)
EVT_SET_CONST(LW(2), NPC_ANIM_goomba_bros_Palette_01_Anim_9)
EVT_EXEC_WAIT(DoScareAway)
EVT_RETURN
EVT_CASE_EQ(58)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_01_Anim_6)
EVT_EXEC_WAIT(DoAirLift)
EVT_CASE_EQ(22)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_01_Anim_9)
EVT_EXEC_WAIT(DoBlowAway)
EVT_RETURN
EVT_CASE_DEFAULT
EVT_END_SWITCH
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_01_Anim_2)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END
};
#include "common/anglestuff.inc.c"
EvtSource N(takeTurn_8021A5A0) = {
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 0)
EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
EVT_CALL(UseBattleCamPreset, 63)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_CALL(func_8024ECF8, -1, 1, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_01_Anim_6)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, 0)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0))
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_01_Anim_2)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -1, 0)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0)
EVT_WAIT_FRAMES(5)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_01_Anim_8)
EVT_CALL(EnemyTestTarget, ACTOR_SELF, LW(0), ((0)), 0, 1, 16)
EVT_SWITCH(LW(0))
EVT_CASE_OR_EQ(6)
EVT_CASE_OR_EQ(5)
EVT_SET(LW(10), LW(0))
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(GetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_SUB(LW(0), 10)
EVT_SET(LW(1), 10)
EVT_ADD(LW(2), 3)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2001953125))
EVT_THREAD
EVT_CALL(GetActorPos, ACTOR_SELF, LW(1), LW(2), LW(0))
EVT_SET(LW(0), 0)
EVT_LOOP(16)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(4), LW(5), LW(6))
EVT_CALL(N(AngleCalculate), LW(1), LW(2), LW(4), LW(5), LW(0))
EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LW(0))
EVT_SET(LW(1), LW(4))
EVT_SET(LW(2), LW(5))
EVT_SET(LW(3), LW(6))
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_END_THREAD
EVT_THREAD
EVT_WAIT_FRAMES(6)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_01_Anim_8)
EVT_END_THREAD
EVT_CALL(JumpToGoal, ACTOR_SELF, 16, FALSE, TRUE, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_01_Anim_D)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1005859375), EVT_FLOAT(0.80078125), EVT_FLOAT(1.0))
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 5, 0)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.30078125), EVT_FLOAT(0.5), EVT_FLOAT(1.0))
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0))
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 7, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_01_Anim_9)
EVT_WAIT_FRAMES(5)
EVT_IF_EQ(LW(10), 5)
EVT_CALL(EnemyTestTarget, ACTOR_SELF, LW(0), 0x80000000, 0, 0, 0)
EVT_END_IF
EVT_WAIT_FRAMES(5)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_01_Anim_8)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(GetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(0), 20)
EVT_SET(LW(1), 0)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0))
EVT_THREAD
EVT_WAIT_FRAMES(4)
EVT_SET(LW(0), 180)
EVT_LOOP(4)
EVT_SUB(LW(0), 45)
EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LW(0))
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_01_Anim_8)
EVT_END_THREAD
EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_01_Anim_C)
EVT_WAIT_FRAMES(5)
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(YieldTurn)
EVT_CALL(SetActorYaw, ACTOR_SELF, 180)
EVT_CALL(AddActorDecoration, ACTOR_SELF, 1, 0, 2)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(2.0))
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0))
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(1.0))
EVT_CALL(SetActorYaw, ACTOR_SELF, 0)
EVT_WAIT_FRAMES(5)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_01_Anim_2)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6005859375))
EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
EVT_CALL(RemoveActorDecoration, ACTOR_SELF, 1, 0)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END_CASE_GROUP
EVT_CASE_DEFAULT
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2001953125))
EVT_THREAD
EVT_CALL(GetActorPos, ACTOR_SELF, LW(1), LW(2), LW(0))
EVT_SET(LW(0), 0)
EVT_LOOP(16)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(4), LW(5), LW(6))
EVT_CALL(N(AngleCalculate), LW(1), LW(2), LW(4), LW(5), LW(0))
EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LW(0))
EVT_SET(LW(1), LW(4))
EVT_SET(LW(2), LW(5))
EVT_SET(LW(3), LW(6))
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_END_THREAD
EVT_THREAD
EVT_WAIT_FRAMES(6)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_01_Anim_8)
EVT_END_THREAD
EVT_CALL(JumpToGoal, ACTOR_SELF, 16, FALSE, TRUE, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_01_Anim_8)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1005859375), EVT_FLOAT(0.80078125), EVT_FLOAT(1.0))
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.30078125), EVT_FLOAT(0.5), EVT_FLOAT(1.0))
EVT_WAIT_FRAMES(1)
EVT_END_SWITCH
EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LW(0), ((0)), 0, 0, 1, 32)
EVT_SWITCH(LW(0))
EVT_CASE_OR_EQ(0)
EVT_CASE_OR_EQ(2)
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1005859375), EVT_FLOAT(0.80078125), EVT_FLOAT(1.0))
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0))
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_01_Anim_2)
EVT_CALL(GetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(0), 40)
EVT_SET(LW(1), 0)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.80078125))
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE)
EVT_ADD(LW(0), 30)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE)
EVT_ADD(LW(0), 20)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_01_Anim_2)
EVT_WAIT_FRAMES(3)
EVT_CALL(YieldTurn)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(2.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_01_Anim_6)
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0))
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(1.0))
EVT_END_CASE_GROUP
EVT_END_SWITCH
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END
};
EvtSource N(init_8021B268) = {
EVT_EXEC_WAIT(N(init_80219A4C))
EVT_CALL(SetActorVar, -127, 0, 0)
EVT_CALL(SetActorVar, -127, 1, 0)
EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_ADDR(N(takeTurn_8021B2C8)))
EVT_RETURN
EVT_END
};
EvtSource N(takeTurn_8021B2C8) = {
EVT_CALL(GetActorVar, -127, 0, LW(0))
EVT_IF_EQ(LW(0), 0)
EVT_CALL(UseBattleCamPreset, 14)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_CALL(MoveBattleCamOver, 30)
EVT_WAIT_FRAMES(30)
EVT_CALL(SetActorVar, -127, 0, 1)
EVT_CALL(ActorSpeak, 721087, -127, 1, -1, -1)
EVT_END_IF
EVT_EXEC_WAIT(N(takeTurn_8021A5A0))
EVT_RETURN
EVT_END
};
EvtSource N(doDeath_8021B388) = {
EVT_CALL(func_8027D32C, -127)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_SET(LW(2), 0)
EVT_CALL(SetAnimation, ACTOR_SELF, LW(0), LW(1))
EVT_WAIT_FRAMES(10)
EVT_LOOP(24)
EVT_CALL(SetActorYaw, ACTOR_SELF, LW(2))
EVT_ADD(LW(2), 30)
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(SetActorYaw, ACTOR_SELF, 0)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(2), LW(3), LW(4))
EVT_CALL(PlayEffect, 0x1, LW(2), LW(3), LW(4), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_DEATH)
EVT_CALL(DropStarPoints, -127)
EVT_SET(LW(3), 0)
EVT_LOOP(12)
EVT_CALL(SetActorRotation, ACTOR_SELF, LW(3), 0, 0)
EVT_ADD(LW(3), 8)
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(SetPartFlagBits, -127, 0, 1, 1)
EVT_CALL(SetActorFlagBits, ACTOR_SELF, 4, 1)
EVT_WAIT_FRAMES(30)
EVT_CALL(ActorExists, 513, LW(0))
EVT_IF_EQ(LW(0), 1)
EVT_CALL(GetActorHP, 513, LW(0))
EVT_END_IF
EVT_IF_NE(LW(0), 0)
EVT_CALL(UseBattleCamPreset, 14)
EVT_CALL(BattleCamTargetActor, ACTOR_ENEMY1)
EVT_CALL(MoveBattleCamOver, 20)
EVT_WAIT_FRAMES(20)
EVT_CALL(UseIdleAnimation, ACTOR_ENEMY1, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_ENEMY1, 0)
EVT_CALL(SetAnimation, ACTOR_ENEMY1, 1, NPC_ANIM_goomba_bros_Palette_00_Anim_B)
EVT_CALL(ActorSpeak, 721089, 513, 1, -1, -1)
EVT_CALL(EnableIdleScript, ACTOR_ENEMY1, 1)
EVT_CALL(UseIdleAnimation, ACTOR_ENEMY1, TRUE)
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(MoveBattleCamOver, 30)
EVT_WAIT_FRAMES(30)
EVT_END_IF
EVT_CALL(RemoveActor, -127)
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,465 @@
#include "common.h"
#include "battle/battle.h"
#include "script_api/battle.h"
#include "sprite/npc/goomba_bros.h"
#define NAMESPACE b_area_kmr_part_2_blue_goomba_2
s32 N(defenseTable_8021D400)[] = {
ELEMENT_NORMAL, 0,
ELEMENT_END,
};
s32 N(statusTable_8021D40C)[] = {
STATUS_NORMAL, 0,
STATUS_DEFAULT, 0,
STATUS_SLEEP, 100,
STATUS_POISON, 0,
STATUS_FROZEN, 0,
STATUS_DIZZY, 100,
STATUS_FEAR, 0,
STATUS_STATIC, 0,
STATUS_PARALYZE, 100,
STATUS_SHRINK, 100,
STATUS_STOP, 100,
STATUS_DEFAULT_TURN_MOD, 0,
STATUS_SLEEP_TURN_MOD, 0,
STATUS_POISON_TURN_MOD, 0,
STATUS_FROZEN_TURN_MOD, 0,
STATUS_DIZZY_TURN_MOD, 0,
STATUS_FEAR_TURN_MOD, 0,
STATUS_STATIC_TURN_MOD, 0,
STATUS_PARALYZE_TURN_MOD, 0,
STATUS_SHRINK_TURN_MOD, 0,
STATUS_STOP_TURN_MOD, 0,
STATUS_END,
};
extern s32 N(idleAnimations_8021D504)[];
extern EvtSource N(init_8021EDB8);
extern EvtSource N(takeTurn_8021E0F0);
extern EvtSource N(idle_8021D5E8);
extern EvtSource N(handleEvent_8021D8C4);
ActorPartDesc N(partsTable_8021D4B8)[] = {
{
.flags = ACTOR_PART_FLAG_MULTI_TARGET,
.index = 1,
.posOffset = { 0, 0, 0 },
.targetOffset = { 0, 24 },
.opacity = 255,
.idleAnimations = N(idleAnimations_8021D504),
.defenseTable = N(defenseTable_8021D400),
.eventFlags = 0,
.elementImmunityFlags = 0,
.unk_1C = 253,
},
};
ActorDesc NAMESPACE = {
.flags = 0,
.type = ACTOR_TYPE_BLUE_GOOMBA_BOSS,
.level = 20,
.maxHP = 6,
.partCount = ARRAY_COUNT(N(partsTable_8021D4B8)),
.partsData = N(partsTable_8021D4B8),
.script = N(init_8021EDB8),
.statusTable = N(statusTable_8021D40C),
.escapeChance = 0,
.airLiftChance = 0,
.spookChance = 0,
.baseStatusChance = 0,
.upAndAwayChance = 0,
.spinSmashReq = 0,
.powerBounceChance = 80,
.coinReward = 0,
.size = { 32, 32 },
.hpBarOffset = { 0, 0 },
.statusIconOffset = { -10, 20 },
.statusMessageOffset = { 8, 25 },
};
s32 N(idleAnimations_8021D504)[] = {
STATUS_NORMAL, NPC_ANIM_goomba_bros_Palette_01_Anim_2,
STATUS_STONE, NPC_ANIM_goomba_bros_Palette_01_Anim_0,
STATUS_SLEEP, NPC_ANIM_goomba_bros_Palette_01_Anim_D,
STATUS_POISON, NPC_ANIM_goomba_bros_Palette_01_Anim_2,
STATUS_STOP, NPC_ANIM_goomba_bros_Palette_01_Anim_0,
STATUS_STATIC, NPC_ANIM_goomba_bros_Palette_01_Anim_2,
STATUS_PARALYZE, NPC_ANIM_goomba_bros_Palette_01_Anim_0,
STATUS_DIZZY, NPC_ANIM_goomba_bros_Palette_01_Anim_C,
STATUS_FEAR, NPC_ANIM_goomba_bros_Palette_01_Anim_C,
STATUS_END,
};
s32 N(idleAnimations_8021D550)[] = {
STATUS_NORMAL, NPC_ANIM_goomba_bros_Palette_01_Anim_6,
STATUS_STONE, NPC_ANIM_goomba_bros_Palette_01_Anim_0,
STATUS_SLEEP, NPC_ANIM_goomba_bros_Palette_01_Anim_D,
STATUS_POISON, NPC_ANIM_goomba_bros_Palette_01_Anim_2,
STATUS_STOP, NPC_ANIM_goomba_bros_Palette_01_Anim_0,
STATUS_STATIC, NPC_ANIM_goomba_bros_Palette_01_Anim_6,
STATUS_PARALYZE, NPC_ANIM_goomba_bros_Palette_01_Anim_0,
STATUS_DIZZY, NPC_ANIM_goomba_bros_Palette_01_Anim_C,
STATUS_FEAR, NPC_ANIM_goomba_bros_Palette_01_Anim_C,
STATUS_END,
};
EvtSource N(init_8021D59C) = {
EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_ADDR(N(takeTurn_8021E0F0)))
EVT_CALL(BindIdle, ACTOR_SELF, EVT_ADDR(N(idle_8021D5E8)))
EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_ADDR(N(handleEvent_8021D8C4)))
EVT_RETURN
EVT_END
};
EvtSource N(idle_8021D5E8) = {
EVT_LABEL(10)
EVT_CALL(RandInt, 80, LW(0))
EVT_ADD(LW(0), 80)
EVT_LOOP(LW(0))
EVT_LABEL(0)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(1))
EVT_IF_FLAG(LW(1), 0x35D000)
EVT_WAIT_FRAMES(1)
EVT_GOTO(0)
EVT_END_IF
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(0), 5)
EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0))
EVT_CALL(SetIdleAnimations, ACTOR_SELF, 1, EVT_ADDR(N(idleAnimations_8021D550)))
EVT_CALL(SetIdleGoal, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(IdleRunToGoal, -127, 0)
EVT_CALL(SetIdleAnimations, ACTOR_SELF, 1, EVT_ADDR(N(idleAnimations_8021D504)))
EVT_LOOP(20)
EVT_LABEL(1)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(1))
EVT_IF_FLAG(LW(1), 0x35D000)
EVT_WAIT_FRAMES(1)
EVT_GOTO(1)
EVT_END_IF
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_SUB(LW(0), 5)
EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0))
EVT_CALL(SetIdleAnimations, ACTOR_SELF, 1, EVT_ADDR(N(idleAnimations_8021D550)))
EVT_CALL(SetIdleGoal, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(IdleRunToGoal, -127, 0)
EVT_CALL(SetIdleAnimations, ACTOR_SELF, 1, EVT_ADDR(N(idleAnimations_8021D504)))
EVT_LOOP(80)
EVT_LABEL(2)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(1))
EVT_IF_FLAG(LW(1), 0x35D000)
EVT_WAIT_FRAMES(1)
EVT_GOTO(2)
EVT_END_IF
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_GOTO(10)
EVT_RETURN
EVT_END
};
EvtSource N(handleEvent_8021D8C4) = {
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 0)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0))
EVT_CALL(GetLastEvent, ACTOR_SELF, LW(0))
EVT_SWITCH(LW(0))
EVT_CASE_OR_EQ(9)
EVT_CASE_OR_EQ(10)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_01_Anim_9)
EVT_EXEC_WAIT(DoNormalHit)
EVT_END_CASE_GROUP
EVT_CASE_EQ(14)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_01_Anim_E)
EVT_SET_CONST(LW(2), NPC_ANIM_goomba_bros_Palette_01_Anim_F)
EVT_EXEC_WAIT(DoBurnHit)
EVT_CASE_EQ(36)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_01_Anim_E)
EVT_SET_CONST(LW(2), NPC_ANIM_goomba_bros_Palette_01_Anim_F)
EVT_EXEC_WAIT(DoBurnHit)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_01_Anim_F)
EVT_EXEC_WAIT(DoDeath)
EVT_RETURN
EVT_CASE_EQ(11)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_01_Anim_9)
EVT_EXEC_WAIT(DoSpinSmashHit)
EVT_CASE_EQ(33)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_01_Anim_9)
EVT_EXEC_WAIT(DoSpinSmashHit)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_01_Anim_9)
EVT_EXEC_WAIT(DoDeath)
EVT_RETURN
EVT_CASE_EQ(47)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_01_Anim_9)
EVT_EXEC_WAIT(DoShockHit)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_01_Anim_9)
EVT_EXEC_WAIT(DoJumpBack)
EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(2.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_01_Anim_C)
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0))
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(1.0))
EVT_WAIT_FRAMES(5)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_01_Anim_2)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6005859375))
EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
EVT_CASE_EQ(38)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_01_Anim_9)
EVT_EXEC_WAIT(DoShockHit)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_01_Anim_9)
EVT_EXEC_WAIT(DoDeath)
EVT_RETURN
EVT_CASE_EQ(19)
EVT_CASE_OR_EQ(23)
EVT_CASE_OR_EQ(25)
EVT_CASE_OR_EQ(31)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_01_Anim_2)
EVT_EXEC_WAIT(DoImmune)
EVT_END_CASE_GROUP
EVT_CASE_EQ(32)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_01_Anim_9)
EVT_EXEC_WAIT(DoNormalHit)
EVT_WAIT_FRAMES(10)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_01_Anim_9)
EVT_EXEC_WAIT(DoDeath)
EVT_RETURN
EVT_CASE_EQ(53)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(2.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_01_Anim_6)
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0))
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(1.0))
EVT_CALL(HPBarToHome, ACTOR_SELF)
EVT_CASE_EQ(49)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_01_Anim_2)
EVT_EXEC_WAIT(DoRecover)
EVT_CASE_EQ(57)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_01_Anim_6)
EVT_SET_CONST(LW(2), NPC_ANIM_goomba_bros_Palette_01_Anim_9)
EVT_EXEC_WAIT(DoScareAway)
EVT_RETURN
EVT_CASE_EQ(58)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_01_Anim_6)
EVT_EXEC_WAIT(DoAirLift)
EVT_CASE_EQ(22)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_01_Anim_9)
EVT_EXEC_WAIT(DoBlowAway)
EVT_RETURN
EVT_CASE_DEFAULT
EVT_END_SWITCH
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_01_Anim_2)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END
};
#include "common/anglestuff.inc.c"
EvtSource N(takeTurn_8021E0F0) = {
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 0)
EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
EVT_CALL(UseBattleCamPreset, 63)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_CALL(func_8024ECF8, -1, 1, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_01_Anim_6)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, 0)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0))
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_01_Anim_2)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -1, 0)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0)
EVT_WAIT_FRAMES(5)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_01_Anim_8)
EVT_CALL(EnemyTestTarget, ACTOR_SELF, LW(0), ((0)), 0, 1, 16)
EVT_SWITCH(LW(0))
EVT_CASE_OR_EQ(6)
EVT_CASE_OR_EQ(5)
EVT_SET(LW(10), LW(0))
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(GetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_SUB(LW(0), 10)
EVT_SET(LW(1), 10)
EVT_ADD(LW(2), 3)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2001953125))
EVT_THREAD
EVT_CALL(GetActorPos, ACTOR_SELF, LW(1), LW(2), LW(0))
EVT_SET(LW(0), 0)
EVT_LOOP(16)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(4), LW(5), LW(6))
EVT_CALL(N(AngleCalculate), LW(1), LW(2), LW(4), LW(5), LW(0))
EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LW(0))
EVT_SET(LW(1), LW(4))
EVT_SET(LW(2), LW(5))
EVT_SET(LW(3), LW(6))
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_END_THREAD
EVT_THREAD
EVT_WAIT_FRAMES(6)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_01_Anim_8)
EVT_END_THREAD
EVT_CALL(JumpToGoal, ACTOR_SELF, 16, FALSE, TRUE, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_01_Anim_D)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1005859375), EVT_FLOAT(0.80078125), EVT_FLOAT(1.0))
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 5, 0)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.30078125), EVT_FLOAT(0.5), EVT_FLOAT(1.0))
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0))
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 7, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_01_Anim_9)
EVT_WAIT_FRAMES(5)
EVT_IF_EQ(LW(10), 5)
EVT_CALL(EnemyTestTarget, ACTOR_SELF, LW(0), 0x80000000, 0, 0, 0)
EVT_END_IF
EVT_WAIT_FRAMES(5)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_01_Anim_8)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(GetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(0), 20)
EVT_SET(LW(1), 0)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0))
EVT_THREAD
EVT_WAIT_FRAMES(4)
EVT_SET(LW(0), 180)
EVT_LOOP(4)
EVT_SUB(LW(0), 45)
EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LW(0))
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_01_Anim_8)
EVT_END_THREAD
EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_01_Anim_C)
EVT_WAIT_FRAMES(5)
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(YieldTurn)
EVT_CALL(SetActorYaw, ACTOR_SELF, 180)
EVT_CALL(AddActorDecoration, ACTOR_SELF, 1, 0, 2)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(2.0))
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0))
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(1.0))
EVT_CALL(SetActorYaw, ACTOR_SELF, 0)
EVT_WAIT_FRAMES(5)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_01_Anim_2)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6005859375))
EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
EVT_CALL(RemoveActorDecoration, ACTOR_SELF, 1, 0)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END_CASE_GROUP
EVT_CASE_DEFAULT
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2001953125))
EVT_THREAD
EVT_CALL(GetActorPos, ACTOR_SELF, LW(1), LW(2), LW(0))
EVT_SET(LW(0), 0)
EVT_LOOP(16)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(4), LW(5), LW(6))
EVT_CALL(N(AngleCalculate), LW(1), LW(2), LW(4), LW(5), LW(0))
EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LW(0))
EVT_SET(LW(1), LW(4))
EVT_SET(LW(2), LW(5))
EVT_SET(LW(3), LW(6))
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_END_THREAD
EVT_THREAD
EVT_WAIT_FRAMES(6)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_01_Anim_8)
EVT_END_THREAD
EVT_CALL(JumpToGoal, ACTOR_SELF, 16, FALSE, TRUE, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_01_Anim_8)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1005859375), EVT_FLOAT(0.80078125), EVT_FLOAT(1.0))
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.30078125), EVT_FLOAT(0.5), EVT_FLOAT(1.0))
EVT_WAIT_FRAMES(1)
EVT_END_SWITCH
EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LW(0), ((0)), 0, 0, 1, 32)
EVT_SWITCH(LW(0))
EVT_CASE_OR_EQ(0)
EVT_CASE_OR_EQ(2)
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1005859375), EVT_FLOAT(0.80078125), EVT_FLOAT(1.0))
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0))
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_01_Anim_2)
EVT_CALL(GetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(0), 40)
EVT_SET(LW(1), 0)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.80078125))
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE)
EVT_ADD(LW(0), 30)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE)
EVT_ADD(LW(0), 20)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_01_Anim_2)
EVT_WAIT_FRAMES(3)
EVT_CALL(YieldTurn)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(2.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_01_Anim_6)
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0))
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(1.0))
EVT_END_CASE_GROUP
EVT_END_SWITCH
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END
};
#include "common/DivActorLevel4.inc.c"
EvtSource N(init_8021EDB8) = {
EVT_EXEC_WAIT(N(init_8021D59C))
EVT_CALL(SetEnemyHP, -127, 2)
EVT_CALL(N(DivActorLevel4))
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,774 @@
#include "common.h"
#include "effects.h"
#include "battle/battle.h"
#include "script_api/battle.h"
#include "sprite/npc/goomba_king.h"
#define NAMESPACE b_area_kmr_part_2_goomba_king
s32 N(idleAnimations_80220800)[] = {
STATUS_NORMAL, NPC_ANIM_goomba_king_Palette_00_Anim_1,
STATUS_STONE, NPC_ANIM_goomba_king_Palette_00_Anim_0,
STATUS_SLEEP, NPC_ANIM_goomba_king_Palette_00_Anim_8,
STATUS_POISON, NPC_ANIM_goomba_king_Palette_00_Anim_0,
STATUS_STOP, NPC_ANIM_goomba_king_Palette_00_Anim_0,
STATUS_STATIC, NPC_ANIM_goomba_king_Palette_00_Anim_0,
STATUS_PARALYZE, NPC_ANIM_goomba_king_Palette_00_Anim_0,
STATUS_DIZZY, NPC_ANIM_goomba_king_Palette_00_Anim_7,
STATUS_END,
};
s32 N(idleAnimations_80220844)[] = {
STATUS_NORMAL, NPC_ANIM_goomba_king_Palette_00_Anim_4,
STATUS_STONE, NPC_ANIM_goomba_king_Palette_00_Anim_0,
STATUS_SLEEP, NPC_ANIM_goomba_king_Palette_00_Anim_8,
STATUS_POISON, NPC_ANIM_goomba_king_Palette_00_Anim_0,
STATUS_STOP, NPC_ANIM_goomba_king_Palette_00_Anim_0,
STATUS_STATIC, NPC_ANIM_goomba_king_Palette_00_Anim_0,
STATUS_PARALYZE, NPC_ANIM_goomba_king_Palette_00_Anim_0,
STATUS_DIZZY, NPC_ANIM_goomba_king_Palette_00_Anim_7,
STATUS_END,
};
s32 N(idleAnimations_80220888)[] = {
STATUS_NORMAL, NPC_ANIM_goomba_king_Palette_00_Anim_7,
STATUS_STONE, NPC_ANIM_goomba_king_Palette_00_Anim_0,
STATUS_SLEEP, NPC_ANIM_goomba_king_Palette_00_Anim_8,
STATUS_POISON, NPC_ANIM_goomba_king_Palette_00_Anim_0,
STATUS_STOP, NPC_ANIM_goomba_king_Palette_00_Anim_0,
STATUS_STATIC, NPC_ANIM_goomba_king_Palette_00_Anim_0,
STATUS_PARALYZE, NPC_ANIM_goomba_king_Palette_00_Anim_0,
STATUS_DIZZY, NPC_ANIM_goomba_king_Palette_00_Anim_7,
STATUS_END,
};
s32 N(idleAnimations_802208CC)[] = {
STATUS_NORMAL, NPC_ANIM_goomba_king_Palette_00_Anim_9,
STATUS_STONE, NPC_ANIM_goomba_king_Palette_00_Anim_0,
STATUS_SLEEP, NPC_ANIM_goomba_king_Palette_00_Anim_8,
STATUS_POISON, NPC_ANIM_goomba_king_Palette_00_Anim_0,
STATUS_STOP, NPC_ANIM_goomba_king_Palette_00_Anim_0,
STATUS_STATIC, NPC_ANIM_goomba_king_Palette_00_Anim_0,
STATUS_PARALYZE, NPC_ANIM_goomba_king_Palette_00_Anim_0,
STATUS_DIZZY, NPC_ANIM_goomba_king_Palette_00_Anim_7,
STATUS_END,
};
s32 N(defenseTable_80220910)[] = {
ELEMENT_NORMAL, 0,
ELEMENT_END,
};
s32 N(statusTable_8022091C)[] = {
STATUS_NORMAL, 0,
STATUS_DEFAULT, 0,
STATUS_SLEEP, 100,
STATUS_POISON, 0,
STATUS_FROZEN, 0,
STATUS_DIZZY, 100,
STATUS_FEAR, 0,
STATUS_STATIC, 0,
STATUS_PARALYZE, 100,
STATUS_SHRINK, 100,
STATUS_STOP, 100,
STATUS_DEFAULT_TURN_MOD, 0,
STATUS_SLEEP_TURN_MOD, -1,
STATUS_POISON_TURN_MOD, 0,
STATUS_FROZEN_TURN_MOD, 0,
STATUS_DIZZY_TURN_MOD, -1,
STATUS_FEAR_TURN_MOD, 0,
STATUS_STATIC_TURN_MOD, -1,
STATUS_PARALYZE_TURN_MOD, -1,
STATUS_SHRINK_TURN_MOD, -1,
STATUS_STOP_TURN_MOD, -1,
STATUS_END,
};
ActorPartDesc N(partsTable_802209C8)[] = {
{
.flags = ACTOR_PART_FLAG_20 | ACTOR_PART_FLAG_NO_TARGET,
.index = 1,
.posOffset = { 0, 0, 0 },
.targetOffset = { -25, 15 },
.opacity = 255,
.idleAnimations = N(idleAnimations_80220800),
.defenseTable = N(defenseTable_80220910),
.eventFlags = 0,
.elementImmunityFlags = 0,
.unk_1C = 0,
},
{
.flags = ACTOR_PART_FLAG_20 | ACTOR_PART_FLAG_MULTI_TARGET,
.index = 2,
.posOffset = { 0, 0, 0 },
.targetOffset = { 0, 80 },
.opacity = 255,
.idleAnimations = NULL,
.defenseTable = N(defenseTable_80220910),
.eventFlags = 0,
.elementImmunityFlags = 0,
.unk_1C = 0,
},
};
extern EvtSource N(init_80220A38);
extern EvtSource N(takeTurn_80221530);
extern EvtSource N(idle_80220B50);
extern EvtSource N(handleEvent_80220F34);
extern EvtSource N(nextTurn_802229C4);
extern EvtSource N(80222D9C);
extern EvtSource N(80221CD4);
extern EvtSource N(80221680);
extern EvtSource N(doDeath_80222F50);
ActorDesc NAMESPACE = {
.flags = 0,
.type = ACTOR_TYPE_GOOMBA_KING,
.level = 49,
.maxHP = 10,
.partCount = ARRAY_COUNT(N(partsTable_802209C8)),
.partsData = N(partsTable_802209C8),
.script = N(init_80220A38),
.statusTable = N(statusTable_8022091C),
.escapeChance = 0,
.airLiftChance = 0,
.spookChance = 0,
.baseStatusChance = 0,
.upAndAwayChance = 0,
.spinSmashReq = 4,
.powerBounceChance = 80,
.coinReward = 0,
.size = { 56, 80 },
.hpBarOffset = { 0, 0 },
.statusIconOffset = { -6, 38 },
.statusMessageOffset = { 12, 75 },
};
// Unused function
ApiStatus func_80218A60_43A4F0(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 var1 = evt_get_variable(script, *args++);
s32 var2 = evt_get_variable(script, *args++);
fx_land(2, var1, var2, evt_get_variable(script, *args++), 0);
return ApiStatus_DONE2;
}
EvtSource N(init_80220A38) = {
EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_ADDR(N(takeTurn_80221530)))
EVT_CALL(BindIdle, ACTOR_SELF, EVT_ADDR(N(idle_80220B50)))
EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_ADDR(N(handleEvent_80220F34)))
EVT_CALL(BindNextTurn, -127, EVT_ADDR(N(nextTurn_802229C4)))
EVT_EXEC_GET_TID(N(80222D9C), LW(0))
EVT_CALL(SetActorVar, -127, 4, LW(0))
EVT_CALL(SetActorVar, -127, 0, 0)
EVT_CALL(SetActorVar, -127, 1, 0)
EVT_CALL(SetActorVar, -127, 2, 0)
EVT_CALL(SetActorVar, -127, 3, 0)
EVT_CALL(SetActorVar, -127, 5, 0)
EVT_CALL(SetActorVar, -127, 6, 0)
EVT_RETURN
EVT_END
};
EvtSource N(idle_80220B50) = {
EVT_LABEL(0)
EVT_CALL(RandInt, 80, LW(0))
EVT_ADD(LW(0), 80)
EVT_WAIT_FRAMES(LW(0))
EVT_LABEL(1)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(0))
EVT_IF_FLAG(LW(0), 0x35D000)
EVT_WAIT_FRAMES(1)
EVT_GOTO(1)
EVT_END_IF
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(GetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(0), 5)
EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0))
EVT_CALL(SetIdleAnimations, ACTOR_SELF, 1, EVT_ADDR(N(idleAnimations_80220844)))
EVT_CALL(SetIdleGoal, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(IdleRunToGoal, -127, 0)
EVT_CALL(SetIdleAnimations, ACTOR_SELF, 1, EVT_ADDR(N(idleAnimations_80220800)))
EVT_WAIT_FRAMES(20)
EVT_LABEL(2)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(0))
EVT_IF_FLAG(LW(0), 0x35D000)
EVT_WAIT_FRAMES(1)
EVT_GOTO(2)
EVT_END_IF
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(GetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0))
EVT_CALL(SetIdleAnimations, ACTOR_SELF, 1, EVT_ADDR(N(idleAnimations_80220844)))
EVT_CALL(SetIdleGoal, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(IdleRunToGoal, -127, 0)
EVT_CALL(SetIdleAnimations, ACTOR_SELF, 1, EVT_ADDR(N(idleAnimations_80220800)))
EVT_WAIT_FRAMES(80)
EVT_GOTO(0)
EVT_RETURN
EVT_END
};
EvtSource N(80220DB0) = {
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(SetAnimation, ACTOR_SELF, LW(0), LW(1))
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_SET(LW(1), 0)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.400390625))
EVT_CALL(AddGoalPos, ACTOR_SELF, 30, 0, 0)
EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, 0x20B4)
EVT_CALL(AddGoalPos, ACTOR_SELF, 15, 0, 0)
EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, 0x20B4)
EVT_CALL(AddGoalPos, ACTOR_SELF, 5, 0, 0)
EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, 0x20B4)
EVT_RETURN
EVT_END
};
EvtSource N(handleEvent_80220F34) = {
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 0)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
EVT_CALL(GetLastEvent, ACTOR_SELF, LW(0))
EVT_SWITCH(LW(0))
EVT_CASE_EQ(9)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_king_Palette_00_Anim_6)
EVT_EXEC_WAIT(DoNormalHit)
EVT_CASE_EQ(10)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_king_Palette_00_Anim_6)
EVT_EXEC_WAIT(DoNormalHit)
EVT_CASE_EQ(14)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_king_Palette_00_Anim_D)
EVT_SET_CONST(LW(2), NPC_ANIM_goomba_king_Palette_00_Anim_E)
EVT_EXEC_WAIT(DoBurnHit)
EVT_CASE_EQ(11)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_king_Palette_00_Anim_6)
EVT_EXEC_WAIT(DoSpinSmashHit)
EVT_CASE_EQ(47)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_king_Palette_00_Anim_6)
EVT_EXEC_WAIT(DoShockHit)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_king_Palette_00_Anim_6)
EVT_EXEC_WAIT(N(80220DB0))
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_king_Palette_00_Anim_4)
EVT_EXEC_WAIT(DoReturnHome)
EVT_CASE_EQ(38)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_king_Palette_00_Anim_6)
EVT_EXEC_WAIT(DoShockHit)
EVT_CALL(GetActorVar, -127, 4, LW(0))
EVT_KILL_THREAD(LW(0))
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_king_Palette_00_Anim_6)
EVT_EXEC_WAIT(N(doDeath_80222F50))
EVT_RETURN
EVT_CASE_OR_EQ(23)
EVT_CASE_OR_EQ(25)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_king_Palette_00_Anim_1)
EVT_EXEC_WAIT(DoImmune)
EVT_END_CASE_GROUP
EVT_CASE_EQ(32)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_king_Palette_00_Anim_6)
EVT_EXEC_WAIT(DoNormalHit)
EVT_WAIT_FRAMES(10)
EVT_CALL(GetActorVar, -127, 4, LW(0))
EVT_KILL_THREAD(LW(0))
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_king_Palette_00_Anim_6)
EVT_EXEC_WAIT(N(doDeath_80222F50))
EVT_RETURN
EVT_CASE_EQ(36)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_king_Palette_00_Anim_D)
EVT_SET_CONST(LW(2), NPC_ANIM_goomba_king_Palette_00_Anim_E)
EVT_EXEC_WAIT(DoBurnHit)
EVT_WAIT_FRAMES(10)
EVT_CALL(GetActorVar, -127, 4, LW(0))
EVT_KILL_THREAD(LW(0))
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_king_Palette_00_Anim_E)
EVT_EXEC_WAIT(N(doDeath_80222F50))
EVT_RETURN
EVT_CASE_EQ(33)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_king_Palette_00_Anim_6)
EVT_EXEC_WAIT(DoSpinSmashHit)
EVT_CALL(GetActorVar, -127, 4, LW(0))
EVT_KILL_THREAD(LW(0))
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_king_Palette_00_Anim_6)
EVT_EXEC_WAIT(N(doDeath_80222F50))
EVT_RETURN
EVT_CASE_EQ(42)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_king_Palette_00_Anim_6)
EVT_WAIT_FRAMES(20)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_king_Palette_00_Anim_4)
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0))
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_king_Palette_00_Anim_1)
EVT_CASE_EQ(53)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_king_Palette_00_Anim_1)
EVT_EXEC_WAIT(DoReturnHome)
EVT_CALL(HPBarToHome, ACTOR_SELF)
EVT_CASE_EQ(49)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_king_Palette_00_Anim_1)
EVT_EXEC_WAIT(DoRecover)
EVT_CASE_DEFAULT
EVT_END_SWITCH
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END
};
EvtSource N(takeTurn_80221530) = {
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 0)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(0))
EVT_IF_NOT_FLAG(LW(0), 0x80000)
EVT_CALL(GetActorVar, 515, 6, LW(0))
EVT_IF_NE(LW(0), 0)
EVT_CALL(RandInt, 100, LW(1))
EVT_IF_LT(LW(1), 60)
EVT_SUB(LW(0), 1)
EVT_CALL(SetActorVar, 515, 6, LW(0))
EVT_EXEC_WAIT(N(80221CD4))
EVT_RETURN
EVT_END_IF
EVT_END_IF
EVT_END_IF
EVT_EXEC_WAIT(N(80221680))
EVT_RETURN
EVT_RETURN
EVT_END
};
EvtSource N(80221680) = {
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(0))
EVT_IF_NOT_FLAG(LW(0), 0x80000)
EVT_CALL(UseBattleCamPreset, 63)
EVT_CALL(AddBattleCamZoom, -100)
EVT_CALL(SetBattleCamOffsetZ, 20)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_CALL(MoveBattleCamOver, 30)
EVT_CALL(func_8024ECF8, -1, 1, 0)
EVT_ELSE
EVT_CALL(UseBattleCamPreset, 63)
EVT_CALL(AddBattleCamZoom, -100)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_CALL(MoveBattleCamOver, 20)
EVT_CALL(func_8024ECF8, -1, 1, 0)
EVT_END_IF
EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(0))
EVT_IF_NOT_FLAG(LW(0), 0x80000)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(AddGoalPos, ACTOR_SELF, 32, 0, 0)
EVT_ELSE
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(AddGoalPos, ACTOR_SELF, 12, 0, 0)
EVT_END_IF
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(2.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_king_Palette_00_Anim_4)
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_king_Palette_00_Anim_1)
EVT_WAIT_FRAMES(8)
EVT_THREAD
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, 0x20ED)
EVT_WAIT_FRAMES(10)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, 0x20ED)
EVT_END_THREAD
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_king_Palette_00_Anim_5)
EVT_SET(LW(0), 0)
EVT_LOOP(20)
EVT_ADD(LW(0), 18)
EVT_CALL(SetActorYaw, ACTOR_SELF, LW(0))
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(SetActorYaw, ACTOR_SELF, 0)
EVT_CALL(EnemyTestTarget, ACTOR_SELF, LW(10), ((0)), 0, 2, 16)
EVT_SWITCH(LW(10))
EVT_CASE_OR_EQ(6)
EVT_CASE_OR_EQ(5)
EVT_IF_EQ(LW(10), 5)
EVT_CALL(EnemyTestTarget, ACTOR_SELF, LW(0), 0x80000000, 0, 0, 0)
EVT_END_IF
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_king_Palette_00_Anim_7)
EVT_SET(LW(0), 0)
EVT_LOOP(20)
EVT_ADD(LW(0), 18)
EVT_CALL(SetActorYaw, ACTOR_SELF, LW(0))
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(SetActorYaw, ACTOR_SELF, 0)
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(MoveBattleCamOver, 20)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_king_Palette_00_Anim_1)
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_king_Palette_00_Anim_4)
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_king_Palette_00_Anim_1)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END_CASE_GROUP
EVT_END_SWITCH
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(MoveBattleCamOver, 20)
EVT_WAIT_FRAMES(2)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LW(10), ((0)), 0, 0, 1, 32)
EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0)
EVT_CALL(SetActorYaw, ACTOR_SELF, 0)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_king_Palette_00_Anim_1)
EVT_SWITCH(LW(10))
EVT_CASE_DEFAULT
EVT_WAIT_FRAMES(20)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_king_Palette_00_Anim_1)
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(3.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_king_Palette_00_Anim_4)
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_king_Palette_00_Anim_1)
EVT_END_SWITCH
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END
};
EvtSource N(80221CD4) = {
EVT_CALL(UseBattleCamPreset, 15)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_CALL(MoveBattleCamOver, 40)
EVT_WAIT_FRAMES(15)
EVT_CALL(func_8024ECF8, 0, 1, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_king_Palette_00_Anim_9)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.80078125))
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, 0x20B4)
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(MoveBattleCamOver, 30)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_king_Palette_00_Anim_0)
EVT_THREAD
EVT_CALL(StartRumble, 11)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(0))
EVT_IF_NOT_FLAG(LW(0), 0x80000)
EVT_CALL(ShakeCam, 1, 0, 10, EVT_FLOAT(4.0))
EVT_END_IF
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_king_Palette_00_Anim_1)
EVT_CALL(PlayEffect, 0x14, 0, -80, 125, 0, 100, 0, 0, 0, 0, 0, 0, 0, 0)
EVT_CALL(PlayEffect, 0x14, 0, -15, 135, 0, 85, 0, 0, 0, 0, 0, 0, 0, 0)
EVT_CALL(PlayEffect, 0x14, 0, 100, 103, 0, 70, 0, 0, 0, 0, 0, 0, 0, 0)
EVT_END_THREAD
EVT_CALL(EnemyTestTarget, ACTOR_SELF, LW(10), ((0)), 0, 2, 16)
EVT_SWITCH(LW(10))
EVT_CASE_OR_EQ(6)
EVT_CASE_OR_EQ(5)
EVT_THREAD
EVT_WAIT_FRAMES(12)
EVT_CALL(PlaySoundAtPart, 515, 3, 769)
EVT_END_THREAD
EVT_THREAD
EVT_WAIT_FRAMES(10)
EVT_CALL(SetPartJumpGravity, 515, 3, EVT_FLOAT(1.5))
EVT_CALL(GetPartOffset, 515, 3, LW(0), LW(1), LW(2))
EVT_CALL(FallPartTo, 515, 3, LW(0), 10, LW(2), 14)
EVT_SUB(LW(0), 12)
EVT_CALL(JumpPartTo, 515, 3, LW(0), 10, LW(2), 10, 1)
EVT_SUB(LW(0), 7)
EVT_CALL(JumpPartTo, 515, 3, LW(0), 10, LW(2), 7, 1)
EVT_LOOP(20)
EVT_CALL(SetPartFlagBits, 515, 3, 1, 0)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetPartFlagBits, 515, 3, 1, 1)
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_END_THREAD
EVT_THREAD
EVT_WAIT_FRAMES(5)
EVT_CALL(PlaySoundAtPart, 515, 4, 769)
EVT_END_THREAD
EVT_THREAD
EVT_WAIT_FRAMES(3)
EVT_CALL(SetPartJumpGravity, 515, 4, EVT_FLOAT(1.5))
EVT_CALL(GetPartOffset, 515, 4, LW(0), LW(1), LW(2))
EVT_CALL(FallPartTo, 515, 4, LW(0), 10, LW(2), 15)
EVT_SUB(LW(0), 12)
EVT_CALL(JumpPartTo, 515, 4, LW(0), 10, LW(2), 10, 1)
EVT_SUB(LW(0), 7)
EVT_CALL(JumpPartTo, 515, 4, LW(0), 10, LW(2), 7, 1)
EVT_LOOP(20)
EVT_CALL(SetPartFlagBits, 515, 4, 1, 0)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetPartFlagBits, 515, 4, 1, 1)
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_END_THREAD
EVT_THREAD
EVT_WAIT_FRAMES(17)
EVT_CALL(PlaySoundAtPart, 515, 5, 769)
EVT_END_THREAD
EVT_THREAD
EVT_WAIT_FRAMES(15)
EVT_CALL(SetPartJumpGravity, 515, 5, EVT_FLOAT(1.5))
EVT_CALL(GetPartOffset, 515, 5, LW(0), LW(1), LW(2))
EVT_CALL(FallPartTo, 515, 5, LW(0), 10, LW(2), 17)
EVT_ADD(LW(0), 12)
EVT_CALL(JumpPartTo, 515, 5, LW(0), 10, LW(2), 10, 1)
EVT_ADD(LW(0), 7)
EVT_CALL(JumpPartTo, 515, 5, LW(0), 10, LW(2), 7, 1)
EVT_LOOP(20)
EVT_CALL(SetPartFlagBits, 515, 5, 1, 0)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetPartFlagBits, 515, 5, 1, 1)
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_END_THREAD
EVT_WAIT_FRAMES(15)
EVT_IF_EQ(LW(10), 5)
EVT_CALL(EnemyTestTarget, ACTOR_SELF, LW(0), 0x80000000, 0, 0, 0)
EVT_END_IF
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END_CASE_GROUP
EVT_END_SWITCH
EVT_THREAD
EVT_WAIT_FRAMES(12)
EVT_CALL(PlaySoundAtPart, 515, 3, 769)
EVT_END_THREAD
EVT_THREAD
EVT_WAIT_FRAMES(10)
EVT_CALL(SetPartJumpGravity, 515, 3, EVT_FLOAT(1.5))
EVT_CALL(GetPartOffset, 515, 3, LW(0), LW(1), LW(2))
EVT_CALL(FallPartTo, 515, 3, LW(0), 35, LW(2), 14)
EVT_SUB(LW(0), 12)
EVT_CALL(JumpPartTo, 515, 3, LW(0), 10, LW(2), 10, 1)
EVT_SUB(LW(0), 7)
EVT_CALL(JumpPartTo, 515, 3, LW(0), 10, LW(2), 7, 1)
EVT_LOOP(20)
EVT_CALL(SetPartFlagBits, 515, 3, 1, 0)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetPartFlagBits, 515, 3, 1, 1)
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_END_THREAD
EVT_THREAD
EVT_WAIT_FRAMES(5)
EVT_CALL(PlaySoundAtPart, 515, 4, 769)
EVT_END_THREAD
EVT_THREAD
EVT_WAIT_FRAMES(3)
EVT_CALL(SetPartJumpGravity, 515, 4, EVT_FLOAT(1.5))
EVT_CALL(GetPartOffset, 515, 4, LW(0), LW(1), LW(2))
EVT_CALL(FallPartTo, 515, 4, LW(0), 10, LW(2), 15)
EVT_SUB(LW(0), 12)
EVT_CALL(JumpPartTo, 515, 4, LW(0), 10, LW(2), 10, 1)
EVT_SUB(LW(0), 7)
EVT_CALL(JumpPartTo, 515, 4, LW(0), 10, LW(2), 7, 1)
EVT_LOOP(20)
EVT_CALL(SetPartFlagBits, 515, 4, 1, 0)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetPartFlagBits, 515, 4, 1, 1)
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_END_THREAD
EVT_THREAD
EVT_WAIT_FRAMES(17)
EVT_CALL(PlaySoundAtPart, 515, 5, 769)
EVT_END_THREAD
EVT_THREAD
EVT_WAIT_FRAMES(15)
EVT_CALL(SetPartJumpGravity, 515, 5, EVT_FLOAT(1.5))
EVT_CALL(GetPartOffset, 515, 5, LW(0), LW(1), LW(2))
EVT_CALL(FallPartTo, 515, 5, LW(0), 10, LW(2), 17)
EVT_ADD(LW(0), 12)
EVT_CALL(JumpPartTo, 515, 5, LW(0), 10, LW(2), 10, 1)
EVT_ADD(LW(0), 7)
EVT_CALL(JumpPartTo, 515, 5, LW(0), 10, LW(2), 7, 1)
EVT_LOOP(20)
EVT_CALL(SetPartFlagBits, 515, 5, 1, 0)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetPartFlagBits, 515, 5, 1, 1)
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_END_THREAD
EVT_WAIT_FRAMES(24)
EVT_WAIT_FRAMES(2)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LW(0), ((0)), 65535, 0, 2, 32)
EVT_SWITCH(LW(0))
EVT_CASE_EQ(10)
EVT_RETURN
EVT_END_SWITCH
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END
};
EvtSource N(nextTurn_802229C4) = {
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 0)
EVT_CALL(GetBattlePhase, LW(0))
EVT_SWITCH(LW(0))
EVT_CASE_EQ(10)
EVT_CALL(GetActorVar, -127, 3, LW(0))
EVT_IF_EQ(LW(0), 0)
EVT_CALL(func_802535B4, 0)
EVT_CALL(UseBattleCamPreset, 13)
EVT_CALL(BattleCamTargetActor, ACTOR_ENEMY1)
EVT_CALL(MoveBattleCamOver, 20)
EVT_WAIT_FRAMES(20)
EVT_CALL(UseIdleAnimation, ACTOR_ENEMY1, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_ENEMY1, 0)
EVT_CALL(ActorSpeak, 721099, 513, 1, 6422538, 6422538)
EVT_CALL(EnableIdleScript, ACTOR_ENEMY1, 1)
EVT_CALL(UseIdleAnimation, ACTOR_ENEMY1, TRUE)
EVT_CALL(UseBattleCamPreset, 13)
EVT_CALL(BattleCamTargetActor, ACTOR_ENEMY2)
EVT_CALL(MoveBattleCamOver, 10)
EVT_WAIT_FRAMES(10)
EVT_CALL(UseIdleAnimation, ACTOR_ENEMY2, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_ENEMY2, 0)
EVT_CALL(ActorSpeak, 721100, 514, 1, 6422794, 6422794)
EVT_CALL(EnableIdleScript, ACTOR_ENEMY2, 1)
EVT_CALL(UseIdleAnimation, ACTOR_ENEMY2, TRUE)
EVT_CALL(UseBattleCamPreset, 14)
EVT_CALL(BattleCamTargetActor, ACTOR_ENEMY0)
EVT_CALL(MoveBattleCamOver, 20)
EVT_WAIT_FRAMES(20)
EVT_CALL(ActorSpeak, 721101, 512, 1, 6488073, 6488073)
EVT_CALL(SetActorVar, -127, 3, 1)
EVT_CALL(UseBattleCamPreset, 14)
EVT_CALL(BattleCamTargetActor, ACTOR_PLAYER)
EVT_CALL(MoveBattleCamOver, 10)
EVT_WAIT_FRAMES(10)
EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, FALSE)
EVT_CALL(UseIdleAnimation, ACTOR_PLAYER, FALSE)
EVT_CALL(SetActorYaw, ACTOR_PLAYER, 180)
EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_QUESTION)
EVT_CALL(ActorSpeak, 721102, 256, 0, -1, -1)
EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_NOD_YES)
EVT_WAIT_FRAMES(15)
EVT_CALL(SetActorYaw, ACTOR_PLAYER, 0)
EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, TRUE)
EVT_CALL(UseIdleAnimation, ACTOR_PLAYER, TRUE)
EVT_CALL(UseBattleCamPreset, 2)
EVT_WAIT_FRAMES(20)
EVT_CALL(func_802535B4, 1)
EVT_END_IF
EVT_END_SWITCH
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END
};
EvtSource N(80222D9C) = {
EVT_LABEL(0)
EVT_WAIT_FRAMES(1)
EVT_CALL(GetAnimation, -127, 1, LW(0))
EVT_IF_NE(LW(0), 6488068)
EVT_GOTO(0)
EVT_END_IF
EVT_CALL(GetAnimation, -127, 1, LW(0))
EVT_IF_NE(LW(0), 6488068)
EVT_GOTO(0)
EVT_END_IF
EVT_CALL(StartRumble, 1)
EVT_CALL(func_8026DF88, -127, 1, LW(0))
EVT_IF_EQ(LW(0), 1)
EVT_CALL(GetActorVar, -127, 2, LW(0))
EVT_IF_EQ(LW(0), 0)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(0))
EVT_IF_NOT_FLAG(LW(0), 0x80000)
EVT_CALL(ShakeCam, 1, 0, 2, EVT_FLOAT(0.2001953125))
EVT_END_IF
EVT_ELSE
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(0))
EVT_IF_NOT_FLAG(LW(0), 0x80000)
EVT_CALL(ShakeCam, 1, 0, 2, EVT_FLOAT(0.7001953125))
EVT_END_IF
EVT_END_IF
EVT_END_IF
EVT_GOTO(0)
EVT_RETURN
EVT_END
};
EvtSource N(doDeath_80222F50) = {
EVT_CALL(func_8027D32C, -127)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_SET(LW(2), 0)
EVT_CALL(SetAnimation, ACTOR_SELF, LW(0), LW(1))
EVT_WAIT_FRAMES(10)
EVT_LOOP(24)
EVT_CALL(SetActorYaw, ACTOR_SELF, LW(2))
EVT_ADD(LW(2), 30)
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(SetActorYaw, ACTOR_SELF, 0)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(2), LW(3), LW(4))
EVT_CALL(PlayEffect, 0x1, LW(2), LW(3), LW(4), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_DEATH)
EVT_CALL(DropStarPoints, -127)
EVT_SET(LW(3), 0)
EVT_LOOP(12)
EVT_CALL(SetActorRotation, ACTOR_SELF, LW(3), 0, 0)
EVT_ADD(LW(3), 8)
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(SetPartFlagBits, -127, 1, 1, 1)
EVT_CALL(SetActorFlagBits, ACTOR_SELF, 4, 1)
EVT_WAIT_FRAMES(30)
EVT_CALL(ActorExists, 513, LW(0))
EVT_IF_EQ(LW(0), 1)
EVT_CALL(GetActorHP, 513, LW(0))
EVT_END_IF
EVT_IF_NE(LW(0), 0)
EVT_CALL(UseIdleAnimation, ACTOR_ENEMY1, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_ENEMY1, 0)
EVT_CALL(ActorSpeak, 721103, 513, 1, 6422539, 6422539)
EVT_CALL(EnableIdleScript, ACTOR_ENEMY1, 1)
EVT_CALL(UseIdleAnimation, ACTOR_ENEMY1, TRUE)
EVT_END_IF
EVT_CALL(ActorExists, 514, LW(0))
EVT_IF_EQ(LW(0), 1)
EVT_CALL(GetActorHP, 514, LW(0))
EVT_END_IF
EVT_IF_NE(LW(0), 0)
EVT_CALL(UseIdleAnimation, ACTOR_ENEMY2, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_ENEMY2, 0)
EVT_CALL(ActorSpeak, 721104, 514, 1, 6422795, 6422795)
EVT_CALL(EnableIdleScript, ACTOR_ENEMY2, 1)
EVT_CALL(UseIdleAnimation, ACTOR_ENEMY2, TRUE)
EVT_END_IF
EVT_CALL(RemoveActor, -127)
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,455 @@
#include "common.h"
#include "battle/battle.h"
#include "script_api/battle.h"
#include "sprite/npc/spiky_goomnut.h"
#define NAMESPACE b_area_kmr_part_2_goomnut_tree
s32 N(idleAnimations_802232D0)[] = {
STATUS_NORMAL, NPC_ANIM_spiky_goomnut_Palette_00_Anim_0,
STATUS_END,
};
s32 N(defenseTable_802232DC)[] = {
ELEMENT_NORMAL, 0,
ELEMENT_HAMMER, 0,
ELEMENT_END,
};
s32 N(statusTable_802232F0)[] = {
STATUS_NORMAL, 0,
STATUS_DEFAULT, 0,
STATUS_SLEEP, 0,
STATUS_POISON, 0,
STATUS_FROZEN, 0,
STATUS_DIZZY, 0,
STATUS_FEAR, 0,
STATUS_STATIC, 0,
STATUS_PARALYZE, 0,
STATUS_SHRINK, 0,
STATUS_STOP, 0,
STATUS_DEFAULT_TURN_MOD, 0,
STATUS_SLEEP_TURN_MOD, 0,
STATUS_POISON_TURN_MOD, 0,
STATUS_FROZEN_TURN_MOD, 0,
STATUS_DIZZY_TURN_MOD, 0,
STATUS_FEAR_TURN_MOD, 0,
STATUS_STATIC_TURN_MOD, 0,
STATUS_PARALYZE_TURN_MOD, 0,
STATUS_SHRINK_TURN_MOD, 0,
STATUS_STOP_TURN_MOD, 0,
STATUS_END,
};
extern EvtSource N(init_80223488);
extern EvtSource N(takeTurn_80223804);
extern EvtSource N(idle_80223678);
extern EvtSource N(handleEvent_80223688);
extern EvtSource N(shake_goomnut_tree);
extern EvtSource N(80223DBC);
ActorPartDesc N(partsTable_8022339C)[] = {
{
.flags = ACTOR_PART_FLAG_MULTI_TARGET,
.index = 1,
.posOffset = { 0, 0, 0 },
.targetOffset = { 0, 10 },
.opacity = 255,
.idleAnimations = NULL,
.defenseTable = N(defenseTable_802232DC),
.eventFlags = ACTOR_EVENT_FLAG_0,
.elementImmunityFlags = 0,
.unk_1C = 0,
},
{
.flags = ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_100000,
.index = 2,
.posOffset = { 0, 0, 0 },
.targetOffset = { 0, 10 },
.opacity = 255,
.idleAnimations = N(idleAnimations_802232D0),
.defenseTable = N(defenseTable_802232DC),
.eventFlags = ACTOR_EVENT_FLAG_0,
.elementImmunityFlags = 0,
.unk_1C = 0,
},
{
.flags = ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_100000,
.index = 3,
.posOffset = { 0, 0, 0 },
.targetOffset = { 0, 10 },
.opacity = 255,
.idleAnimations = N(idleAnimations_802232D0),
.defenseTable = N(defenseTable_802232DC),
.eventFlags = ACTOR_EVENT_FLAG_0,
.elementImmunityFlags = 0,
.unk_1C = 0,
},
{
.flags = ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_100000,
.index = 4,
.posOffset = { 0, 0, 0 },
.targetOffset = { 0, 10 },
.opacity = 255,
.idleAnimations = N(idleAnimations_802232D0),
.defenseTable = N(defenseTable_802232DC),
.eventFlags = ACTOR_EVENT_FLAG_0,
.elementImmunityFlags = 0,
.unk_1C = 0,
},
{
.flags = ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_100000,
.index = 5,
.posOffset = { 0, 0, 0 },
.targetOffset = { 0, 10 },
.opacity = 255,
.idleAnimations = N(idleAnimations_802232D0),
.defenseTable = N(defenseTable_802232DC),
.eventFlags = ACTOR_EVENT_FLAG_0,
.elementImmunityFlags = 0,
.unk_1C = 0,
},
};
ActorDesc NAMESPACE = {
.flags = ACTOR_FLAG_NO_SHADOW | ACTOR_FLAG_TARGET_ONLY | ACTOR_FLAG_NO_DMG_POPUP,
.type = ACTOR_TYPE_GOOMNUT_TREE,
.level = 1,
.maxHP = 255,
.partCount = ARRAY_COUNT(N(partsTable_8022339C)),
.partsData = N(partsTable_8022339C),
.script = N(init_80223488),
.statusTable = N(statusTable_802232F0),
.escapeChance = 0,
.airLiftChance = 0,
.spookChance = 0,
.baseStatusChance = 0,
.upAndAwayChance = 0,
.spinSmashReq = 4,
.powerBounceChance = 0,
.coinReward = 0,
.size = { 0, 0 },
.hpBarOffset = { 0, 0 },
.statusIconOffset = { 0, 0 },
.statusMessageOffset = { 0, 0 },
};
// Perhaps a status table
s32 N(unk_missing_80223478)[] = {
2, 0,
1, 0,
};
EvtSource N(init_80223488) = {
EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_ADDR(N(takeTurn_80223804)))
EVT_CALL(BindIdle, ACTOR_SELF, EVT_ADDR(N(idle_80223678)))
EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_ADDR(N(handleEvent_80223688)))
EVT_CALL(SetActorVar, -127, 0, 0)
EVT_CALL(SetActorVar, -127, 1, 0)
EVT_CALL(SetActorVar, -127, 2, 0)
EVT_CALL(SetActorVar, -127, 3, 0)
EVT_CALL(SetActorVar, -127, 4, 0)
EVT_CALL(SetActorVar, -127, 5, 0)
EVT_CALL(SetActorVar, -127, 6, 1)
EVT_CALL(SetPartPos, ACTOR_SELF, 2, 10, 140, 10)
EVT_CALL(SetPartPos, ACTOR_SELF, 3, -95, 140, 10)
EVT_CALL(SetPartPos, ACTOR_SELF, 4, -115, 130, 0)
EVT_CALL(SetPartPos, ACTOR_SELF, 5, -65, 118, 5)
EVT_CALL(SetPartScale, -127, 3, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(1.0))
EVT_CALL(SetPartScale, -127, 4, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(1.0))
EVT_CALL(SetPartScale, -127, 5, EVT_FLOAT(0.5), EVT_FLOAT(0.5), EVT_FLOAT(1.0))
EVT_CALL(SetPartTargetFlagBits, -127, 1, 4, 1)
EVT_RETURN
EVT_END
};
EvtSource N(idle_80223678) = {
EVT_RETURN
EVT_END
};
EvtSource N(handleEvent_80223688) = {
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 0)
EVT_CALL(GetLastElement, LW(14))
EVT_CALL(GetLastEvent, ACTOR_SELF, LW(0))
EVT_SWITCH(LW(0))
EVT_CASE_OR_EQ(9)
EVT_CASE_OR_EQ(23)
EVT_EXEC_WAIT(N(shake_goomnut_tree))
EVT_END_CASE_GROUP
EVT_CASE_OR_EQ(10)
EVT_CASE_OR_EQ(25)
EVT_EXEC_WAIT(N(shake_goomnut_tree))
EVT_EXEC_WAIT(N(80223DBC))
EVT_END_CASE_GROUP
EVT_CASE_EQ(11)
EVT_EXEC_WAIT(N(shake_goomnut_tree))
EVT_EXEC_WAIT(N(80223DBC))
EVT_CASE_EQ(32)
EVT_EXEC_WAIT(N(shake_goomnut_tree))
EVT_CASE_EQ(33)
EVT_EXEC_WAIT(N(shake_goomnut_tree))
EVT_CASE_EQ(42)
EVT_CASE_EQ(47)
EVT_CASE_EQ(53)
EVT_CASE_DEFAULT
EVT_END_SWITCH
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END
};
EvtSource N(takeTurn_80223804) = {
EVT_SWITCH(LW(0))
EVT_CASE_EQ(6)
EVT_RETURN
EVT_END_SWITCH
EVT_SWITCH(LW(0))
EVT_CASE_EQ(0)
EVT_CASE_EQ(10)
EVT_END_SWITCH
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END
};
#include "common/FoliageTransform.inc.c"
EvtSource N(shakeTree) = {
EVT_SET_TIMESCALE(EVT_FLOAT(2.0))
EVT_USE_BUF(LW(0))
EVT_BUF_READ4(LW(1), LW(2), LW(3), LW(4))
EVT_BUF_READ1(LW(5))
EVT_CALL(GetActorPos, ACTOR_PLAYER, LW(6), LW(15), LW(8))
EVT_CALL(PlaySound, SOUND_SMASH_GOOMNUT_TREE)
EVT_CALL(PlaySound, 0x166)
EVT_THREAD
EVT_SET(LF(0), 0)
EVT_IF_NE(LW(1), 0)
EVT_WAIT_FRAMES(1)
EVT_LOOP(5)
EVT_USE_BUF(LW(1))
EVT_BUF_READ1(LW(2))
EVT_LOOP(LW(2))
EVT_BUF_READ1(LW(3))
EVT_CALL(N(TransformFoliage), LW(3), EVT_FLOAT(0.1005859375), EVT_FLOAT(0.2001953125), LW(15), 0)
EVT_IF_EQ(LF(0), 0)
EVT_SET(LF(0), 1)
EVT_CALL(PlaySoundAtModel, LW(3), 358, 0)
EVT_END_IF
EVT_END_LOOP
EVT_WAIT_FRAMES(1)
EVT_USE_BUF(LW(1))
EVT_BUF_READ1(LW(2))
EVT_LOOP(LW(2))
EVT_BUF_READ1(LW(3))
EVT_CALL(N(TransformFoliage), LW(3), EVT_FLOAT(0.1005859375), EVT_FLOAT(-0.19921875), LW(15), 0)
EVT_END_LOOP
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_USE_BUF(LW(1))
EVT_BUF_READ1(LW(2))
EVT_LOOP(LW(2))
EVT_BUF_READ1(LW(3))
EVT_CALL(TranslateModel, LW(3), 0, 0, 0)
EVT_END_LOOP
EVT_WAIT_FRAMES(1)
EVT_END_IF
EVT_END_THREAD
EVT_THREAD
EVT_SET(LF(0), 0)
EVT_IF_NE(LW(2), 0)
EVT_LOOP(5)
EVT_USE_BUF(LW(2))
EVT_BUF_READ1(LW(3))
EVT_LOOP(LW(3))
EVT_BUF_READ1(LW(4))
EVT_CALL(N(TransformFoliage), LW(4), EVT_FLOAT(0.1005859375), EVT_FLOAT(0.2001953125), LW(15), 0)
EVT_IF_EQ(LF(0), 0)
EVT_SET(LF(0), 1)
EVT_CALL(PlaySoundAtModel, LW(4), 357, 0)
EVT_END_IF
EVT_END_LOOP
EVT_WAIT_FRAMES(1)
EVT_USE_BUF(LW(2))
EVT_BUF_READ1(LW(3))
EVT_LOOP(LW(3))
EVT_BUF_READ1(LW(4))
EVT_CALL(N(TransformFoliage), LW(4), EVT_FLOAT(0.1005859375), EVT_FLOAT(-0.19921875), LW(15), 0)
EVT_END_LOOP
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_USE_BUF(LW(2))
EVT_BUF_READ1(LW(3))
EVT_LOOP(LW(3))
EVT_BUF_READ1(LW(4))
EVT_CALL(TranslateModel, LW(4), 0, 0, 0)
EVT_END_LOOP
EVT_WAIT_FRAMES(1)
EVT_END_IF
EVT_END_THREAD
EVT_THREAD
EVT_IF_NE(LW(4), 0)
EVT_USE_BUF(LW(4))
EVT_BUF_READ1(LW(5))
EVT_LOOP(LW(5))
EVT_BUF_READ3(LW(6), LW(7), LW(8))
EVT_CALL(PlayEffect, 0x14, 0, LW(6), LW(7), LW(8), 100, 0, 0, 0, 0, 0, 0, 0, 0)
EVT_END_LOOP
EVT_END_IF
EVT_END_THREAD
EVT_WAIT_FRAMES(15)
EVT_RETURN
EVT_END
};
FoliageModelList N(tree_leaves) = {
.count = 2,
.models = { 33, 36 }
};
FoliageModelList N(tree_trunk) = {
.count = 3,
.models = { 38, 39, 40 }
};
FoliageVectorList N(D_80223D60_41D7F0) = {
.count = 2,
.vectors = {
{ -10, 140, 0 },
{ 100, 140, 0 },
},
};
ShakeTreeConfig N(tree) = {
.leaves = &N(tree_leaves),
.trunk = &N(tree_trunk),
.vectors = &N(D_80223D60_41D7F0),
};
EvtSource N(shake_goomnut_tree) = {
EVT_SET(LW(0), EVT_ADDR(N(tree)))
EVT_EXEC_WAIT(N(shakeTree))
EVT_RETURN
EVT_END
};
EvtSource N(80223DBC) = {
EVT_CALL(PlayEffect, 0x14, 0, -25, 120, 0, 90, 0, 0, 0, 0, 0, 0, 0, 0)
EVT_CALL(GetActorVar, -127, 5, LW(0))
EVT_IF_NE(LW(0), 0)
EVT_RETURN
EVT_END_IF
EVT_CALL(UseBattleCamPreset, 15)
EVT_CALL(BattleCamTargetActor, ACTOR_ENEMY0)
EVT_WAIT_FRAMES(20)
EVT_CALL(SetActorVar, -127, 5, 1)
EVT_CALL(ActorExists, 512, LW(0))
EVT_IF_EQ(LW(0), 0)
EVT_CALL(SetGoalPos, ACTOR_SELF, 10, 0, 10)
EVT_CALL(SetPartFlagBits, -127, 2, 1, 0)
EVT_CALL(PlaySoundAtPart, -127, 2, 769)
EVT_CALL(SetPartJumpGravity, -127, 2, EVT_FLOAT(0.80078125))
EVT_CALL(SetPartMoveSpeed, -127, 2, EVT_FLOAT(4.0))
EVT_CALL(FallPartTo, -127, 2, 10, 20, 10, 20)
EVT_CALL(JumpPartTo, -127, 2, 30, 20, 10, 10, 1)
EVT_CALL(JumpPartTo, -127, 2, 40, 20, 10, 5, 1)
EVT_LOOP(20)
EVT_CALL(SetPartFlagBits, -127, 2, 1, 0)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetPartFlagBits, -127, 2, 1, 1)
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_RETURN
EVT_END_IF
EVT_CALL(PlaySoundAtPart, -127, 2, 769)
EVT_CALL(SetPartJumpGravity, -127, 2, EVT_FLOAT(0.80078125))
EVT_CALL(SetPartMoveSpeed, -127, 2, EVT_FLOAT(4.0))
EVT_CALL(GetStatusFlags, ACTOR_ENEMY0, LW(0))
EVT_IF_NOT_FLAG(LW(0), 0x80000)
EVT_CALL(FallPartTo, -127, 2, 10, 80, 10, 10)
EVT_ELSE
EVT_CALL(FallPartTo, -127, 2, 10, 32, 10, 10)
EVT_END_IF
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(MoveBattleCamOver, 30)
EVT_CALL(SetOwnerTarget, 512, 2)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LW(0), ((DAMAGE_TYPE_IGNORE_DEFENSE)), 0, 0, 3, 32)
EVT_CALL(ActorExists, 513, LW(0))
EVT_IF_EQ(LW(0), 0)
EVT_CALL(GetPartOffset, -127, 2, LW(0), LW(1), LW(2))
EVT_ADD(LW(0), 65)
EVT_SET(LW(1), 20)
EVT_CALL(SetPartJumpGravity, -127, 2, EVT_FLOAT(0.7001953125))
EVT_CALL(JumpPartTo, -127, 2, LW(0), LW(1), LW(2), 20, 1)
EVT_ADD(LW(0), 12)
EVT_CALL(JumpPartTo, -127, 2, LW(0), LW(1), LW(2), 8, 1)
EVT_LOOP(20)
EVT_CALL(SetPartFlagBits, -127, 2, 1, 0)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetPartFlagBits, -127, 2, 1, 1)
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_RETURN
EVT_END_IF
EVT_CALL(GetActorPos, ACTOR_ENEMY1, LW(0), LW(1), LW(2))
EVT_CALL(GetStatusFlags, ACTOR_ENEMY1, LW(3))
EVT_IF_NOT_FLAG(LW(3), 0x80000)
EVT_ADD(LW(1), 50)
EVT_ELSE
EVT_ADD(LW(1), 20)
EVT_END_IF
EVT_CALL(SetPartJumpGravity, -127, 2, EVT_FLOAT(0.7001953125))
EVT_CALL(JumpPartTo, -127, 2, LW(0), LW(1), LW(2), 20, 1)
EVT_CALL(SetOwnerTarget, 513, 1)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LW(0), ((DAMAGE_TYPE_IGNORE_DEFENSE)), 0, 0, 3, 32)
EVT_CALL(ActorExists, 514, LW(0))
EVT_IF_EQ(LW(0), 0)
EVT_CALL(GetPartOffset, -127, 2, LW(0), LW(1), LW(2))
EVT_ADD(LW(0), 35)
EVT_SET(LW(1), 20)
EVT_CALL(SetPartJumpGravity, -127, 2, EVT_FLOAT(0.7001953125))
EVT_CALL(JumpPartTo, -127, 2, LW(0), LW(1), LW(2), 20, 1)
EVT_ADD(LW(0), 12)
EVT_CALL(JumpPartTo, -127, 2, LW(0), LW(1), LW(2), 8, 1)
EVT_LOOP(20)
EVT_CALL(SetPartFlagBits, -127, 2, 1, 0)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetPartFlagBits, -127, 2, 1, 1)
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_RETURN
EVT_END_IF
EVT_CALL(GetActorPos, ACTOR_ENEMY2, LW(0), LW(1), LW(2))
EVT_CALL(GetStatusFlags, ACTOR_ENEMY2, LW(3))
EVT_IF_NOT_FLAG(LW(3), 0x80000)
EVT_ADD(LW(1), 50)
EVT_ELSE
EVT_ADD(LW(1), 20)
EVT_END_IF
EVT_CALL(SetPartJumpGravity, -127, 2, EVT_FLOAT(0.7001953125))
EVT_CALL(JumpPartTo, -127, 2, LW(0), LW(1), LW(2), 20, 1)
EVT_CALL(SetOwnerTarget, 514, 1)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LW(0), ((DAMAGE_TYPE_IGNORE_DEFENSE)), 0, 0, 3, 32)
EVT_CALL(GetPartOffset, -127, 2, LW(0), LW(1), LW(2))
EVT_ADD(LW(0), 20)
EVT_SET(LW(1), 20)
EVT_CALL(SetPartJumpGravity, -127, 2, EVT_FLOAT(0.7001953125))
EVT_CALL(JumpPartTo, -127, 2, LW(0), LW(1), LW(2), 20, 1)
EVT_ADD(LW(0), 12)
EVT_CALL(JumpPartTo, -127, 2, LW(0), LW(1), LW(2), 8, 1)
EVT_LOOP(20)
EVT_CALL(SetPartFlagBits, -127, 2, 1, 0)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetPartFlagBits, -127, 2, 1, 1)
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,514 @@
#include "common.h"
#include "battle/battle.h"
#include "script_api/battle.h"
#include "sprite/npc/goomba_bros.h"
#define NAMESPACE b_area_kmr_part_2_red_goomba
s32 N(defenseTable_8021B6C0)[] = {
ELEMENT_NORMAL, 0,
ELEMENT_END,
};
s32 N(statusTable_8021B6CC)[] = {
STATUS_NORMAL, 0,
STATUS_DEFAULT, 0,
STATUS_SLEEP, 100,
STATUS_POISON, 0,
STATUS_FROZEN, 0,
STATUS_DIZZY, 100,
STATUS_FEAR, 0,
STATUS_STATIC, 0,
STATUS_PARALYZE, 100,
STATUS_SHRINK, 100,
STATUS_STOP, 100,
STATUS_DEFAULT_TURN_MOD, 0,
STATUS_SLEEP_TURN_MOD, 0,
STATUS_POISON_TURN_MOD, 0,
STATUS_FROZEN_TURN_MOD, 0,
STATUS_DIZZY_TURN_MOD, 0,
STATUS_FEAR_TURN_MOD, 0,
STATUS_STATIC_TURN_MOD, 0,
STATUS_PARALYZE_TURN_MOD, 0,
STATUS_SHRINK_TURN_MOD, 0,
STATUS_STOP_TURN_MOD, 0,
STATUS_END,
};
extern s32 N(idleAnimations_8021B7C4)[];
extern EvtSource N(idle_8021B8A8);
extern EvtSource N(handleEvent_8021BB84);
extern EvtSource N(takeTurn_8021C3B0);
extern EvtSource N(init_8021D078);
extern EvtSource N(doDeath_8021D0C4);
ActorPartDesc N(partsTable_8021B778)[] = {
{
.flags = ACTOR_PART_FLAG_MULTI_TARGET,
.index = 1,
.posOffset = { 0, 0, 0 },
.targetOffset = { 0, 24 },
.opacity = 255,
.idleAnimations = N(idleAnimations_8021B7C4),
.defenseTable = N(defenseTable_8021B6C0),
.eventFlags = 0,
.elementImmunityFlags = 0,
.unk_1C = 253,
},
};
ActorDesc NAMESPACE = {
.flags = 0,
.type = ACTOR_TYPE_RED_GOOMBA_BOSS,
.level = 20,
.maxHP = 7,
.partCount = ARRAY_COUNT(N(partsTable_8021B778)),
.partsData = N(partsTable_8021B778),
.script = N(init_8021D078),
.statusTable = N(statusTable_8021B6CC),
.escapeChance = 0,
.airLiftChance = 0,
.spookChance = 0,
.baseStatusChance = 0,
.upAndAwayChance = 0,
.spinSmashReq = 0,
.powerBounceChance = 80,
.coinReward = 0,
.size = { 32, 32 },
.hpBarOffset = { 0, 0 },
.statusIconOffset = { -10, 20 },
.statusMessageOffset = { 8, 25 },
};
s32 N(idleAnimations_8021B7C4)[] = {
STATUS_NORMAL, NPC_ANIM_goomba_bros_Palette_00_Anim_2,
STATUS_STONE, NPC_ANIM_goomba_bros_Palette_00_Anim_0,
STATUS_SLEEP, NPC_ANIM_goomba_bros_Palette_00_Anim_D,
STATUS_POISON, NPC_ANIM_goomba_bros_Palette_00_Anim_2,
STATUS_STOP, NPC_ANIM_goomba_bros_Palette_00_Anim_0,
STATUS_STATIC, NPC_ANIM_goomba_bros_Palette_00_Anim_2,
STATUS_PARALYZE, NPC_ANIM_goomba_bros_Palette_00_Anim_0,
STATUS_DIZZY, NPC_ANIM_goomba_bros_Palette_00_Anim_C,
STATUS_FEAR, NPC_ANIM_goomba_bros_Palette_00_Anim_C,
STATUS_END,
};
s32 N(idleAnimations_8021B810)[] = {
STATUS_NORMAL, NPC_ANIM_goomba_bros_Palette_00_Anim_6,
STATUS_STONE, NPC_ANIM_goomba_bros_Palette_00_Anim_0,
STATUS_SLEEP, NPC_ANIM_goomba_bros_Palette_00_Anim_D,
STATUS_POISON, NPC_ANIM_goomba_bros_Palette_00_Anim_2,
STATUS_STOP, NPC_ANIM_goomba_bros_Palette_00_Anim_0,
STATUS_STATIC, NPC_ANIM_goomba_bros_Palette_00_Anim_6,
STATUS_PARALYZE, NPC_ANIM_goomba_bros_Palette_00_Anim_0,
STATUS_DIZZY, NPC_ANIM_goomba_bros_Palette_00_Anim_C,
STATUS_FEAR, NPC_ANIM_goomba_bros_Palette_00_Anim_C,
STATUS_END,
};
EvtSource N(init_8021B85C) = {
EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_ADDR(N(takeTurn_8021C3B0)))
EVT_CALL(BindIdle, ACTOR_SELF, EVT_ADDR(N(idle_8021B8A8)))
EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_ADDR(N(handleEvent_8021BB84)))
EVT_RETURN
EVT_END
};
EvtSource N(idle_8021B8A8) = {
EVT_LABEL(10)
EVT_CALL(RandInt, 80, LW(0))
EVT_ADD(LW(0), 80)
EVT_LOOP(LW(0))
EVT_LABEL(0)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(1))
EVT_IF_FLAG(LW(1), 0x35D000)
EVT_WAIT_FRAMES(1)
EVT_GOTO(0)
EVT_END_IF
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(0), 5)
EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0))
EVT_CALL(SetIdleAnimations, ACTOR_SELF, 1, EVT_ADDR(N(idleAnimations_8021B810)))
EVT_CALL(SetIdleGoal, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(IdleRunToGoal, -127, 0)
EVT_CALL(SetIdleAnimations, ACTOR_SELF, 1, EVT_ADDR(N(idleAnimations_8021B7C4)))
EVT_LOOP(20)
EVT_LABEL(1)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(1))
EVT_IF_FLAG(LW(1), 0x35D000)
EVT_WAIT_FRAMES(1)
EVT_GOTO(1)
EVT_END_IF
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_SUB(LW(0), 5)
EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0))
EVT_CALL(SetIdleAnimations, ACTOR_SELF, 1, EVT_ADDR(N(idleAnimations_8021B810)))
EVT_CALL(SetIdleGoal, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(IdleRunToGoal, -127, 0)
EVT_CALL(SetIdleAnimations, ACTOR_SELF, 1, EVT_ADDR(N(idleAnimations_8021B7C4)))
EVT_LOOP(80)
EVT_LABEL(2)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(1))
EVT_IF_FLAG(LW(1), 0x35D000)
EVT_WAIT_FRAMES(1)
EVT_GOTO(2)
EVT_END_IF
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_GOTO(10)
EVT_RETURN
EVT_END
};
EvtSource N(handleEvent_8021BB84) = {
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 0)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0))
EVT_CALL(GetLastEvent, ACTOR_SELF, LW(0))
EVT_SWITCH(LW(0))
EVT_CASE_OR_EQ(9)
EVT_CASE_OR_EQ(10)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_00_Anim_9)
EVT_EXEC_WAIT(DoNormalHit)
EVT_END_CASE_GROUP
EVT_CASE_EQ(14)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_00_Anim_E)
EVT_SET_CONST(LW(2), NPC_ANIM_goomba_bros_Palette_00_Anim_F)
EVT_EXEC_WAIT(DoBurnHit)
EVT_CASE_EQ(36)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_00_Anim_E)
EVT_SET_CONST(LW(2), NPC_ANIM_goomba_bros_Palette_00_Anim_F)
EVT_EXEC_WAIT(DoBurnHit)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_00_Anim_F)
EVT_EXEC_WAIT(N(doDeath_8021D0C4))
EVT_RETURN
EVT_CASE_EQ(11)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_00_Anim_9)
EVT_EXEC_WAIT(DoSpinSmashHit)
EVT_CASE_EQ(33)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_00_Anim_9)
EVT_EXEC_WAIT(DoSpinSmashHit)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_00_Anim_9)
EVT_EXEC_WAIT(N(doDeath_8021D0C4))
EVT_RETURN
EVT_CASE_EQ(47)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_00_Anim_9)
EVT_EXEC_WAIT(DoShockHit)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_00_Anim_9)
EVT_EXEC_WAIT(DoJumpBack)
EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(2.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_00_Anim_C)
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0))
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(1.0))
EVT_WAIT_FRAMES(5)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_00_Anim_2)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6005859375))
EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
EVT_CASE_EQ(38)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_00_Anim_9)
EVT_EXEC_WAIT(DoShockHit)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_00_Anim_9)
EVT_EXEC_WAIT(N(doDeath_8021D0C4))
EVT_RETURN
EVT_CASE_EQ(19)
EVT_CASE_OR_EQ(23)
EVT_CASE_OR_EQ(25)
EVT_CASE_OR_EQ(31)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_00_Anim_2)
EVT_EXEC_WAIT(DoImmune)
EVT_END_CASE_GROUP
EVT_CASE_EQ(32)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_00_Anim_9)
EVT_EXEC_WAIT(DoNormalHit)
EVT_WAIT_FRAMES(10)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_00_Anim_9)
EVT_EXEC_WAIT(N(doDeath_8021D0C4))
EVT_RETURN
EVT_CASE_EQ(53)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(2.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_00_Anim_6)
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0))
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(1.0))
EVT_CALL(HPBarToHome, ACTOR_SELF)
EVT_CASE_EQ(49)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_00_Anim_2)
EVT_EXEC_WAIT(DoRecover)
EVT_CASE_EQ(57)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_00_Anim_6)
EVT_SET_CONST(LW(2), NPC_ANIM_goomba_bros_Palette_00_Anim_9)
EVT_EXEC_WAIT(DoScareAway)
EVT_RETURN
EVT_CASE_EQ(58)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_00_Anim_6)
EVT_EXEC_WAIT(DoAirLift)
EVT_CASE_EQ(22)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_00_Anim_9)
EVT_EXEC_WAIT(DoBlowAway)
EVT_RETURN
EVT_CASE_DEFAULT
EVT_END_SWITCH
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_00_Anim_2)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END
};
#include "common/anglestuff.inc.c"
EvtSource N(takeTurn_8021C3B0) = {
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 0)
EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
EVT_CALL(UseBattleCamPreset, 63)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_CALL(func_8024ECF8, -1, 1, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_00_Anim_6)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, 0)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0))
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_00_Anim_2)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -1, 0)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0)
EVT_WAIT_FRAMES(5)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_00_Anim_8)
EVT_CALL(EnemyTestTarget, ACTOR_SELF, LW(0), ((0)), 0, 1, 16)
EVT_SWITCH(LW(0))
EVT_CASE_OR_EQ(6)
EVT_CASE_OR_EQ(5)
EVT_SET(LW(10), LW(0))
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(GetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_SUB(LW(0), 10)
EVT_SET(LW(1), 10)
EVT_ADD(LW(2), 3)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2001953125))
EVT_THREAD
EVT_CALL(GetActorPos, ACTOR_SELF, LW(1), LW(2), LW(0))
EVT_SET(LW(0), 0)
EVT_LOOP(16)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(4), LW(5), LW(6))
EVT_CALL(N(AngleCalculate), LW(1), LW(2), LW(4), LW(5), LW(0))
EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LW(0))
EVT_SET(LW(1), LW(4))
EVT_SET(LW(2), LW(5))
EVT_SET(LW(3), LW(6))
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_END_THREAD
EVT_THREAD
EVT_WAIT_FRAMES(6)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_00_Anim_8)
EVT_END_THREAD
EVT_CALL(JumpToGoal, ACTOR_SELF, 16, FALSE, TRUE, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_00_Anim_D)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1005859375), EVT_FLOAT(0.80078125), EVT_FLOAT(1.0))
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 5, 0)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.30078125), EVT_FLOAT(0.5), EVT_FLOAT(1.0))
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0))
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 7, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_00_Anim_9)
EVT_WAIT_FRAMES(5)
EVT_IF_EQ(LW(10), 5)
EVT_CALL(EnemyTestTarget, ACTOR_SELF, LW(0), 0x80000000, 0, 0, 0)
EVT_END_IF
EVT_WAIT_FRAMES(5)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_00_Anim_8)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(GetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(0), 20)
EVT_SET(LW(1), 0)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0))
EVT_THREAD
EVT_WAIT_FRAMES(4)
EVT_SET(LW(0), 180)
EVT_LOOP(4)
EVT_SUB(LW(0), 45)
EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LW(0))
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_00_Anim_8)
EVT_END_THREAD
EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_00_Anim_C)
EVT_WAIT_FRAMES(5)
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(YieldTurn)
EVT_CALL(SetActorYaw, ACTOR_SELF, 180)
EVT_CALL(AddActorDecoration, ACTOR_SELF, 1, 0, 2)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(2.0))
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0))
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(1.0))
EVT_CALL(SetActorYaw, ACTOR_SELF, 0)
EVT_WAIT_FRAMES(5)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_00_Anim_2)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6005859375))
EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
EVT_CALL(RemoveActorDecoration, ACTOR_SELF, 1, 0)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END_CASE_GROUP
EVT_CASE_DEFAULT
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2001953125))
EVT_THREAD
EVT_CALL(GetActorPos, ACTOR_SELF, LW(1), LW(2), LW(0))
EVT_SET(LW(0), 0)
EVT_LOOP(16)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(4), LW(5), LW(6))
EVT_CALL(N(AngleCalculate), LW(1), LW(2), LW(4), LW(5), LW(0))
EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LW(0))
EVT_SET(LW(1), LW(4))
EVT_SET(LW(2), LW(5))
EVT_SET(LW(3), LW(6))
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_END_THREAD
EVT_THREAD
EVT_WAIT_FRAMES(6)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_00_Anim_8)
EVT_END_THREAD
EVT_CALL(JumpToGoal, ACTOR_SELF, 16, FALSE, TRUE, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_00_Anim_8)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1005859375), EVT_FLOAT(0.80078125), EVT_FLOAT(1.0))
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.30078125), EVT_FLOAT(0.5), EVT_FLOAT(1.0))
EVT_WAIT_FRAMES(1)
EVT_END_SWITCH
EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LW(0), ((0)), 0, 0, 1, 32)
EVT_SWITCH(LW(0))
EVT_CASE_OR_EQ(0)
EVT_CASE_OR_EQ(2)
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1005859375), EVT_FLOAT(0.80078125), EVT_FLOAT(1.0))
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0))
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_00_Anim_2)
EVT_CALL(GetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(0), 40)
EVT_SET(LW(1), 0)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.80078125))
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE)
EVT_ADD(LW(0), 30)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE)
EVT_ADD(LW(0), 20)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_00_Anim_2)
EVT_WAIT_FRAMES(3)
EVT_CALL(YieldTurn)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(2.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_00_Anim_6)
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0))
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(1.0))
EVT_END_CASE_GROUP
EVT_END_SWITCH
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END
};
EvtSource N(init_8021D078) = {
EVT_EXEC_WAIT(N(init_8021B85C))
EVT_CALL(SetActorVar, -127, 0, 0)
EVT_CALL(SetActorVar, -127, 1, 0)
EVT_RETURN
EVT_END
};
EvtSource N(doDeath_8021D0C4) = {
EVT_CALL(func_8027D32C, -127)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_SET(LW(2), 0)
EVT_CALL(SetAnimation, ACTOR_SELF, LW(0), LW(1))
EVT_WAIT_FRAMES(10)
EVT_LOOP(24)
EVT_CALL(SetActorYaw, ACTOR_SELF, LW(2))
EVT_ADD(LW(2), 30)
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(SetActorYaw, ACTOR_SELF, 0)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(2), LW(3), LW(4))
EVT_CALL(PlayEffect, 0x1, LW(2), LW(3), LW(4), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_DEATH)
EVT_CALL(DropStarPoints, -127)
EVT_SET(LW(3), 0)
EVT_LOOP(12)
EVT_CALL(SetActorRotation, ACTOR_SELF, LW(3), 0, 0)
EVT_ADD(LW(3), 8)
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(SetPartFlagBits, -127, 0, 1, 1)
EVT_CALL(SetActorFlagBits, ACTOR_SELF, 4, 1)
EVT_WAIT_FRAMES(30)
EVT_CALL(ActorExists, 512, LW(0))
EVT_IF_EQ(LW(0), 1)
EVT_CALL(GetActorHP, 512, LW(0))
EVT_END_IF
EVT_IF_NE(LW(0), 0)
EVT_CALL(UseBattleCamPreset, 14)
EVT_CALL(BattleCamTargetActor, ACTOR_ENEMY0)
EVT_CALL(MoveBattleCamOver, 20)
EVT_WAIT_FRAMES(20)
EVT_CALL(UseIdleAnimation, ACTOR_ENEMY0, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_ENEMY0, 0)
EVT_CALL(SetAnimation, ACTOR_ENEMY0, 1, NPC_ANIM_goomba_bros_Palette_01_Anim_B)
EVT_CALL(ActorSpeak, 721088, 512, 1, -1, -1)
EVT_CALL(EnableIdleScript, ACTOR_ENEMY0, 1)
EVT_CALL(UseIdleAnimation, ACTOR_ENEMY0, TRUE)
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(MoveBattleCamOver, 30)
EVT_WAIT_FRAMES(30)
EVT_END_IF
EVT_CALL(RemoveActor, -127)
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,465 @@
#include "common.h"
#include "battle/battle.h"
#include "script_api/battle.h"
#include "sprite/npc/goomba_bros.h"
#define NAMESPACE b_area_kmr_part_2_red_goomba_2
s32 N(defenseTable_8021EE00)[] = {
ELEMENT_NORMAL, 0,
ELEMENT_END,
};
s32 N(statusTable_8021EE0C)[] = {
STATUS_NORMAL, 0,
STATUS_DEFAULT, 0,
STATUS_SLEEP, 100,
STATUS_POISON, 0,
STATUS_FROZEN, 0,
STATUS_DIZZY, 100,
STATUS_FEAR, 0,
STATUS_STATIC, 0,
STATUS_PARALYZE, 100,
STATUS_SHRINK, 100,
STATUS_STOP, 100,
STATUS_DEFAULT_TURN_MOD, 0,
STATUS_SLEEP_TURN_MOD, 0,
STATUS_POISON_TURN_MOD, 0,
STATUS_FROZEN_TURN_MOD, 0,
STATUS_DIZZY_TURN_MOD, 0,
STATUS_FEAR_TURN_MOD, 0,
STATUS_STATIC_TURN_MOD, 0,
STATUS_PARALYZE_TURN_MOD, 0,
STATUS_SHRINK_TURN_MOD, 0,
STATUS_STOP_TURN_MOD, 0,
STATUS_END,
};
extern s32 N(idleAnimations_8021EF04)[];
extern EvtSource N(init_802207B8);
extern EvtSource N(takeTurn_8021FAF0);
extern EvtSource N(idle_8021EFE8);
extern EvtSource N(handleEvent_8021F2C4);
ActorPartDesc N(partsTable_8021EEB8)[] = {
{
.flags = ACTOR_PART_FLAG_MULTI_TARGET,
.index = 1,
.posOffset = { 0, 0, 0 },
.targetOffset = { 0, 24 },
.opacity = 255,
.idleAnimations = N(idleAnimations_8021EF04),
.defenseTable = N(defenseTable_8021EE00),
.eventFlags = 0,
.elementImmunityFlags = 0,
.unk_1C = 253,
},
};
ActorDesc NAMESPACE = {
.flags = 0,
.type = ACTOR_TYPE_RED_GOOMBA_BOSS,
.level = 20,
.maxHP = 7,
.partCount = ARRAY_COUNT(N(partsTable_8021EEB8)),
.partsData = N(partsTable_8021EEB8),
.script = N(init_802207B8),
.statusTable = N(statusTable_8021EE0C),
.escapeChance = 0,
.airLiftChance = 0,
.spookChance = 0,
.baseStatusChance = 0,
.upAndAwayChance = 0,
.spinSmashReq = 0,
.powerBounceChance = 80,
.coinReward = 0,
.size = { 32, 32 },
.hpBarOffset = { 0, 0 },
.statusIconOffset = { -10, 20 },
.statusMessageOffset = { 8, 25 },
};
s32 N(idleAnimations_8021EF04)[] = {
STATUS_NORMAL, NPC_ANIM_goomba_bros_Palette_00_Anim_2,
STATUS_STONE, NPC_ANIM_goomba_bros_Palette_00_Anim_0,
STATUS_SLEEP, NPC_ANIM_goomba_bros_Palette_00_Anim_D,
STATUS_POISON, NPC_ANIM_goomba_bros_Palette_00_Anim_2,
STATUS_STOP, NPC_ANIM_goomba_bros_Palette_00_Anim_0,
STATUS_STATIC, NPC_ANIM_goomba_bros_Palette_00_Anim_2,
STATUS_PARALYZE, NPC_ANIM_goomba_bros_Palette_00_Anim_0,
STATUS_DIZZY, NPC_ANIM_goomba_bros_Palette_00_Anim_C,
STATUS_FEAR, NPC_ANIM_goomba_bros_Palette_00_Anim_C,
STATUS_END,
};
s32 N(idleAnimations_8021EF50)[] = {
STATUS_NORMAL, NPC_ANIM_goomba_bros_Palette_00_Anim_6,
STATUS_STONE, NPC_ANIM_goomba_bros_Palette_00_Anim_0,
STATUS_SLEEP, NPC_ANIM_goomba_bros_Palette_00_Anim_D,
STATUS_POISON, NPC_ANIM_goomba_bros_Palette_00_Anim_2,
STATUS_STOP, NPC_ANIM_goomba_bros_Palette_00_Anim_0,
STATUS_STATIC, NPC_ANIM_goomba_bros_Palette_00_Anim_6,
STATUS_PARALYZE, NPC_ANIM_goomba_bros_Palette_00_Anim_0,
STATUS_DIZZY, NPC_ANIM_goomba_bros_Palette_00_Anim_C,
STATUS_FEAR, NPC_ANIM_goomba_bros_Palette_00_Anim_C,
STATUS_END,
};
EvtSource N(init_8021EF9C) = {
EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_ADDR(N(takeTurn_8021FAF0)))
EVT_CALL(BindIdle, ACTOR_SELF, EVT_ADDR(N(idle_8021EFE8)))
EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_ADDR(N(handleEvent_8021F2C4)))
EVT_RETURN
EVT_END
};
EvtSource N(idle_8021EFE8) = {
EVT_LABEL(10)
EVT_CALL(RandInt, 80, LW(0))
EVT_ADD(LW(0), 80)
EVT_LOOP(LW(0))
EVT_LABEL(0)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(1))
EVT_IF_FLAG(LW(1), 0x35D000)
EVT_WAIT_FRAMES(1)
EVT_GOTO(0)
EVT_END_IF
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(0), 5)
EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0))
EVT_CALL(SetIdleAnimations, ACTOR_SELF, 1, EVT_ADDR(N(idleAnimations_8021EF50)))
EVT_CALL(SetIdleGoal, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(IdleRunToGoal, -127, 0)
EVT_CALL(SetIdleAnimations, ACTOR_SELF, 1, EVT_ADDR(N(idleAnimations_8021EF04)))
EVT_LOOP(20)
EVT_LABEL(1)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(1))
EVT_IF_FLAG(LW(1), 0x35D000)
EVT_WAIT_FRAMES(1)
EVT_GOTO(1)
EVT_END_IF
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_SUB(LW(0), 5)
EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0))
EVT_CALL(SetIdleAnimations, ACTOR_SELF, 1, EVT_ADDR(N(idleAnimations_8021EF50)))
EVT_CALL(SetIdleGoal, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(IdleRunToGoal, -127, 0)
EVT_CALL(SetIdleAnimations, ACTOR_SELF, 1, EVT_ADDR(N(idleAnimations_8021EF04)))
EVT_LOOP(80)
EVT_LABEL(2)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(1))
EVT_IF_FLAG(LW(1), 0x35D000)
EVT_WAIT_FRAMES(1)
EVT_GOTO(2)
EVT_END_IF
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_GOTO(10)
EVT_RETURN
EVT_END
};
EvtSource N(handleEvent_8021F2C4) = {
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 0)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0))
EVT_CALL(GetLastEvent, ACTOR_SELF, LW(0))
EVT_SWITCH(LW(0))
EVT_CASE_OR_EQ(9)
EVT_CASE_OR_EQ(10)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_00_Anim_9)
EVT_EXEC_WAIT(DoNormalHit)
EVT_END_CASE_GROUP
EVT_CASE_EQ(14)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_00_Anim_E)
EVT_SET_CONST(LW(2), NPC_ANIM_goomba_bros_Palette_00_Anim_F)
EVT_EXEC_WAIT(DoBurnHit)
EVT_CASE_EQ(36)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_00_Anim_E)
EVT_SET_CONST(LW(2), NPC_ANIM_goomba_bros_Palette_00_Anim_F)
EVT_EXEC_WAIT(DoBurnHit)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_00_Anim_F)
EVT_EXEC_WAIT(DoDeath)
EVT_RETURN
EVT_CASE_EQ(11)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_00_Anim_9)
EVT_EXEC_WAIT(DoSpinSmashHit)
EVT_CASE_EQ(33)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_00_Anim_9)
EVT_EXEC_WAIT(DoSpinSmashHit)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_00_Anim_9)
EVT_EXEC_WAIT(DoDeath)
EVT_RETURN
EVT_CASE_EQ(47)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_00_Anim_9)
EVT_EXEC_WAIT(DoShockHit)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_00_Anim_9)
EVT_EXEC_WAIT(DoJumpBack)
EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(2.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_00_Anim_C)
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0))
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(1.0))
EVT_WAIT_FRAMES(5)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_00_Anim_2)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6005859375))
EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
EVT_CASE_EQ(38)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_00_Anim_9)
EVT_EXEC_WAIT(DoShockHit)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_00_Anim_9)
EVT_EXEC_WAIT(DoDeath)
EVT_RETURN
EVT_CASE_EQ(19)
EVT_CASE_OR_EQ(23)
EVT_CASE_OR_EQ(25)
EVT_CASE_OR_EQ(31)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_00_Anim_2)
EVT_EXEC_WAIT(DoImmune)
EVT_END_CASE_GROUP
EVT_CASE_EQ(32)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_00_Anim_9)
EVT_EXEC_WAIT(DoNormalHit)
EVT_WAIT_FRAMES(10)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_00_Anim_9)
EVT_EXEC_WAIT(DoDeath)
EVT_RETURN
EVT_CASE_EQ(53)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(2.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_00_Anim_6)
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0))
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(1.0))
EVT_CALL(HPBarToHome, ACTOR_SELF)
EVT_CASE_EQ(49)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_00_Anim_2)
EVT_EXEC_WAIT(DoRecover)
EVT_CASE_EQ(57)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_00_Anim_6)
EVT_SET_CONST(LW(2), NPC_ANIM_goomba_bros_Palette_00_Anim_9)
EVT_EXEC_WAIT(DoScareAway)
EVT_RETURN
EVT_CASE_EQ(58)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_00_Anim_6)
EVT_EXEC_WAIT(DoAirLift)
EVT_CASE_EQ(22)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_bros_Palette_00_Anim_9)
EVT_EXEC_WAIT(DoBlowAway)
EVT_RETURN
EVT_CASE_DEFAULT
EVT_END_SWITCH
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_00_Anim_2)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END
};
#include "common/anglestuff.inc.c"
EvtSource N(takeTurn_8021FAF0) = {
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 0)
EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
EVT_CALL(UseBattleCamPreset, 63)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_CALL(func_8024ECF8, -1, 1, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_00_Anim_6)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, 0)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0))
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_00_Anim_2)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -1, 0)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0)
EVT_WAIT_FRAMES(5)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_00_Anim_8)
EVT_CALL(EnemyTestTarget, ACTOR_SELF, LW(0), ((0)), 0, 1, 16)
EVT_SWITCH(LW(0))
EVT_CASE_OR_EQ(6)
EVT_CASE_OR_EQ(5)
EVT_SET(LW(10), LW(0))
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(GetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_SUB(LW(0), 10)
EVT_SET(LW(1), 10)
EVT_ADD(LW(2), 3)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2001953125))
EVT_THREAD
EVT_CALL(GetActorPos, ACTOR_SELF, LW(1), LW(2), LW(0))
EVT_SET(LW(0), 0)
EVT_LOOP(16)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(4), LW(5), LW(6))
EVT_CALL(N(AngleCalculate), LW(1), LW(2), LW(4), LW(5), LW(0))
EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LW(0))
EVT_SET(LW(1), LW(4))
EVT_SET(LW(2), LW(5))
EVT_SET(LW(3), LW(6))
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_END_THREAD
EVT_THREAD
EVT_WAIT_FRAMES(6)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_00_Anim_8)
EVT_END_THREAD
EVT_CALL(JumpToGoal, ACTOR_SELF, 16, FALSE, TRUE, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_00_Anim_D)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1005859375), EVT_FLOAT(0.80078125), EVT_FLOAT(1.0))
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 5, 0)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.30078125), EVT_FLOAT(0.5), EVT_FLOAT(1.0))
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0))
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 7, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_00_Anim_9)
EVT_WAIT_FRAMES(5)
EVT_IF_EQ(LW(10), 5)
EVT_CALL(EnemyTestTarget, ACTOR_SELF, LW(0), 0x80000000, 0, 0, 0)
EVT_END_IF
EVT_WAIT_FRAMES(5)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_00_Anim_8)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(GetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(0), 20)
EVT_SET(LW(1), 0)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0))
EVT_THREAD
EVT_WAIT_FRAMES(4)
EVT_SET(LW(0), 180)
EVT_LOOP(4)
EVT_SUB(LW(0), 45)
EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LW(0))
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_00_Anim_8)
EVT_END_THREAD
EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_00_Anim_C)
EVT_WAIT_FRAMES(5)
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(YieldTurn)
EVT_CALL(SetActorYaw, ACTOR_SELF, 180)
EVT_CALL(AddActorDecoration, ACTOR_SELF, 1, 0, 2)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(2.0))
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0))
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(1.0))
EVT_CALL(SetActorYaw, ACTOR_SELF, 0)
EVT_WAIT_FRAMES(5)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_00_Anim_2)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6005859375))
EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
EVT_CALL(RemoveActorDecoration, ACTOR_SELF, 1, 0)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END_CASE_GROUP
EVT_CASE_DEFAULT
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2001953125))
EVT_THREAD
EVT_CALL(GetActorPos, ACTOR_SELF, LW(1), LW(2), LW(0))
EVT_SET(LW(0), 0)
EVT_LOOP(16)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(4), LW(5), LW(6))
EVT_CALL(N(AngleCalculate), LW(1), LW(2), LW(4), LW(5), LW(0))
EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LW(0))
EVT_SET(LW(1), LW(4))
EVT_SET(LW(2), LW(5))
EVT_SET(LW(3), LW(6))
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_END_THREAD
EVT_THREAD
EVT_WAIT_FRAMES(6)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_00_Anim_8)
EVT_END_THREAD
EVT_CALL(JumpToGoal, ACTOR_SELF, 16, FALSE, TRUE, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_00_Anim_8)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1005859375), EVT_FLOAT(0.80078125), EVT_FLOAT(1.0))
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.30078125), EVT_FLOAT(0.5), EVT_FLOAT(1.0))
EVT_WAIT_FRAMES(1)
EVT_END_SWITCH
EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LW(0), ((0)), 0, 0, 1, 32)
EVT_SWITCH(LW(0))
EVT_CASE_OR_EQ(0)
EVT_CASE_OR_EQ(2)
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1005859375), EVT_FLOAT(0.80078125), EVT_FLOAT(1.0))
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0))
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_00_Anim_2)
EVT_CALL(GetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(0), 40)
EVT_SET(LW(1), 0)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.80078125))
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE)
EVT_ADD(LW(0), 30)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE)
EVT_ADD(LW(0), 20)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_00_Anim_2)
EVT_WAIT_FRAMES(3)
EVT_CALL(YieldTurn)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(2.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_bros_Palette_00_Anim_6)
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0))
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(1.0))
EVT_END_CASE_GROUP
EVT_END_SWITCH
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END
};
#include "common/DivActorLevel4.inc.c"
EvtSource N(init_802207B8) = {
EVT_EXEC_WAIT(N(init_8021EF9C))
EVT_CALL(SetEnemyHP, -127, 2)
EVT_CALL(N(DivActorLevel4))
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,55 @@
#include "common.h"
#include "battle/battle.h"
#include "script_api/battle.h"
#include "message_ids.h"
#include "sprite/npc/goomba_bros.h"
#define NAMESPACE b_area_kmr_part_2
extern ActorDesc N(blue_goomba);
extern ActorDesc N(red_goomba);
extern ActorDesc N(goomba_king);
extern ActorDesc N(red_goomba_2);
extern ActorDesc N(blue_goomba_2);
extern ActorDesc N(goomnut_tree);
extern Stage N(kmr_02);
extern Stage N(kmr_03);
extern Stage N(kmr_04);
extern Stage N(kmr_05);
extern Stage N(kmr_06);
Vec3i N(pos00) = { 14, 0, -10 };
Vec3i N(pos01) = { 54, 0, 32 };
Formation N(formation_00) = {
{ .actor = &N(blue_goomba), .home = { .vec = &N(pos00) }, .priority = 10 },
{ .actor = &N(red_goomba), .home = { .vec = &N(pos01) }, .priority = 10 },
};
Vec3i N(pos02) = { 10, 0, 10 };
Vec3i N(pos03) = { 70, 0, 30 };
Vec3i N(pos04) = { 125, 0, 20 };
Vec3i N(pos05) = { -40, 0, -45 };
Formation N(formation_01) = {
{ .actor = &N(goomba_king), .home = { .vec = &N(pos02) }, .priority = 10 },
{ .actor = &N(red_goomba_2), .home = { .vec = &N(pos03) }, .priority = 10 },
{ .actor = &N(blue_goomba_2), .home = { .vec = &N(pos04) }, .priority = 10 },
{ .actor = &N(goomnut_tree), .home = { .vec = &N(pos05) }, .priority = 10 },
};
BattleList N(formationTable) = {
BATTLE("クリレッド,クリブルー", N(formation_00), &N(kmr_03)),
BATTLE("クリキング,クリレッド,クリブルー", N(formation_01), &N(kmr_06)),
{},
};
StageList N(stageTable) = {
{ "kmr_02", &N(kmr_02), },
{ "kmr_03", &N(kmr_03), },
{ "kmr_04", &N(kmr_04), },
{ "kmr_05", &N(kmr_05), },
{ "kmr_06", &N(kmr_06), },
{},
};

View File

@ -0,0 +1,23 @@
#include "common.h"
#include "battle/battle.h"
#define NAMESPACE b_area_kmr_part_2_kmr_02
EvtSource N(beforeBattle_80224700) = {
EVT_CALL(SetSpriteShading, -1)
EVT_RETURN
EVT_END
};
EvtSource N(afterBattle_80224720) = {
EVT_RETURN
EVT_END
};
Stage NAMESPACE = {
.texture = "kmr_tex",
.shape = "kmr_bt02_shape",
.bg = "kmr_bg",
.preBattle = N(beforeBattle_80224700),
.postBattle = N(afterBattle_80224720),
};

View File

@ -0,0 +1,37 @@
#include "common.h"
#include "battle/battle.h"
#define NAMESPACE b_area_kmr_part_2_kmr_03
#include "world/common/clouds.inc.c"
EvtSource N(beforeBattle_80224AE8) = {
EVT_CALL(SetSpriteShading, -1)
EVT_SET(LW(0), 1)
EVT_SET(LW(2), 0)
EVT_EXEC(N(clouds1))
EVT_SET(LW(0), 4)
EVT_SET(LW(2), 70)
EVT_EXEC(N(clouds1))
EVT_RETURN
EVT_END
};
EvtSource N(afterBattle_80224B60) = {
EVT_RETURN
EVT_END
};
s32 N(foregroundModelList_80224B70)[] = {
0x00000027, 0x0000002B, 0x00000000,
};
Stage NAMESPACE = {
.texture = "kmr_tex",
.shape = "kmr_bt03_shape",
.hit = "kmr_bt03_hit",
.bg = "kmr_bg",
.preBattle = N(beforeBattle_80224AE8),
.postBattle = N(afterBattle_80224B60),
.foregroundModelList = N(foregroundModelList_80224B70),
};

View File

@ -0,0 +1,37 @@
#include "common.h"
#include "battle/battle.h"
#define NAMESPACE b_area_kmr_part_2_kmr_04
#include "world/common/clouds.inc.c"
EvtSource N(beforeBattle_80224F38) = {
EVT_CALL(SetSpriteShading, -1)
EVT_SET(LW(0), 1)
EVT_SET(LW(2), 0)
EVT_EXEC(N(clouds1))
EVT_SET(LW(0), 4)
EVT_SET(LW(2), 70)
EVT_EXEC(N(clouds1))
EVT_RETURN
EVT_END
};
EvtSource N(afterBattle_80224FB0) = {
EVT_RETURN
EVT_END
};
s32 N(foregroundModelList_80224FC0)[] = {
0x00000024, 0x00000020, 0x00000000,
};
Stage NAMESPACE = {
.texture = "kmr_tex",
.shape = "kmr_bt04_shape",
.hit = "kmr_bt04_hit",
.bg = "kmr_bg",
.preBattle = N(beforeBattle_80224F38),
.postBattle = N(afterBattle_80224FB0),
.foregroundModelList = N(foregroundModelList_80224FC0),
};

View File

@ -0,0 +1,32 @@
#include "common.h"
#include "battle/battle.h"
#define NAMESPACE b_area_kmr_part_2_kmr_05
#include "world/common/clouds.inc.c"
EvtSource N(beforeBattle_80225388) = {
EVT_CALL(SetSpriteShading, -1)
EVT_CALL(EnableModel, 27, 0)
EVT_RETURN
EVT_END
};
EvtSource N(afterBattle_802253BC) = {
EVT_RETURN
EVT_END
};
s32 N(foregroundModelList_802253CC)[] = {
0x00000020, 0x00000024, 0x00000000,
};
Stage NAMESPACE = {
.texture = "kmr_tex",
.shape = "kmr_bt05_shape",
.hit = "kmr_bt05_hit",
.bg = "kmr_bg",
.preBattle = N(beforeBattle_80225388),
.postBattle = N(afterBattle_802253BC),
.foregroundModelList = N(foregroundModelList_802253CC),
};

View File

@ -0,0 +1,40 @@
#include "common.h"
#include "battle/battle.h"
#define NAMESPACE b_area_kmr_part_2_kmr_06
#include "world/common/clouds.inc.c"
#include "common/UnkFogFunc.inc.c"
EvtSource N(beforeBattle_80225788) = {
EVT_CALL(SetSpriteShading, -1)
EVT_CALL(N(UnkFogFunc))
EVT_SET(LW(0), 1)
EVT_SET(LW(2), 0)
EVT_EXEC(N(clouds1))
EVT_SET(LW(0), 4)
EVT_SET(LW(2), 70)
EVT_EXEC(N(clouds1))
EVT_RETURN
EVT_END
};
EvtSource N(afterBattle_8022580C) = {
EVT_RETURN
EVT_END
};
s32 N(foregroundModelList_8022581C)[] = {
0x0000001D, 0x00000022, 0x00000021, 0x00000000,
};
Stage NAMESPACE = {
.texture = "kmr_tex",
.shape = "kmr_bt06_shape",
.hit = "kmr_bt06_hit",
.bg = "kmr_bg",
.preBattle = N(beforeBattle_80225788),
.postBattle = N(afterBattle_8022580C),
.foregroundModelList = N(foregroundModelList_8022581C),
};

View File

@ -10,6 +10,9 @@ extern Stage* D_800DC064;
extern BattleList b_area_kmr_part_1_formationTable;
extern StageList b_area_kmr_part_1_stageTable;
extern BattleList b_area_kmr_part_2_formationTable;
extern StageList b_area_kmr_part_2_stageTable;
BattleArea gBattleAreas[0x30] = {
{
AREA(area_kmr_part_1),
@ -20,8 +23,8 @@ BattleArea gBattleAreas[0x30] = {
{
AREA(area_kmr_part_2),
.name = "エリア その2",
.battles = 0x80219840,
.stages = 0x8021987C,
.battles = b_area_kmr_part_2_formationTable,
.stages = b_area_kmr_part_2_stageTable,
},
{
AREA(area_kmr_part_3),

View File

@ -254,7 +254,7 @@ typedef struct ActorDesc {
/* 0x0A */ char unk_0A[2];
/* 0x0C */ struct ActorPartDesc* partsData;
/* 0x10 */ Bytecode* script;
/* 0x14 */ DictionaryEntry* statusTable;
/* 0x14 */ s32* statusTable;
/* 0x18 */ u8 escapeChance;
/* 0x19 */ u8 airLiftChance;
/* 0x1A */ u8 spookChance;
@ -271,7 +271,10 @@ typedef struct ActorDesc {
typedef struct FormationRow {
/* 0x00 */ ActorDesc* actor;
/* 0x04 */ s32 position; ///< Home position. May also be a `Vector3*`.
/* 0x04 */ union {
s32 index;
Vec3i* vec;
} home;
/* 0x08 */ s32 priority; ///< Actors with higher priority values take their turn first.
/* 0x0C */ s32 var0;
/* 0x10 */ s32 var1;
@ -324,10 +327,6 @@ extern BattleArea gBattleAreas[0x30];
// TODO: enum for home position (0..3 are floor, 4..7 are air, etc.)
typedef DictionaryEntry DefenseTable[];
typedef DictionaryEntry StatusTable[];
typedef struct ActorSounds {
/* 0x00 */ s32 walk[2];
/* 0x08 */ s32 fly[2];

View File

@ -288,7 +288,7 @@ ActorPartDesc N(partsTable_802392A4)[] = {
.idleAnimations = N(idleAnimations_802391B0),
.defenseTable = N(defenseTable_802391EC),
.eventFlags = ACTOR_EVENT_FLAG_0,
.elementImmunityFlags = ELEMENT_IMMUNITY_FLAGS_0,
.elementImmunityFlags = 0,
},
};
@ -296,7 +296,7 @@ extern EvtSource N(init_802392F0);
ActorDesc N(goombario) = {
.flags = 0,
.type = 111,
.type = ACTOR_TYPE_GOOMBARIO,
.level = 0,
.maxHP = 99,
.partCount = ARRAY_COUNT(N(partsTable_802392A4)),

View File

@ -1,5 +1,6 @@
#include "common.h"
// TODO: Define the table.
extern f32 N(floatTable)[];
u32 N(BattleAreaAngleStuff1)(f32 x, f32 y) {
@ -40,7 +41,7 @@ u32 N(BattleAreaAngleStuff1)(f32 x, f32 y) {
return ret;
}
ApiStatus N(BattleAreaAngleStuff2)(Evt* script, s32 isInitialCall) {
ApiStatus N(AngleCalculate)(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 var1 = evt_get_variable(script, *args++);
s32 var2 = evt_get_variable(script, *args++);

View File

@ -0,0 +1,80 @@
#include "common.h"
#include "npc.h"
#include "model.h"
typedef struct FoliageModelList {
s32 count;
s32 models[0];
} FoliageModelList;
typedef struct FoliageDropList {
s32 count;
struct {
s32 itemID;
Vec3i pos;
s32 spawnMode;
Bytecode pickupFlag;
Bytecode spawnFlag;
} drops[0];
} FoliageDropList;
typedef struct FoliageVectorList {
s32 count;
Vec3i vectors[0];
} FoliageVectorList;
typedef struct SearchBushConfig {
FoliageModelList* bush;
FoliageDropList* drops;
FoliageVectorList* vectors;
EvtSource* callback;
} SearchBushConfig;
typedef struct ShakeTreeConfig {
FoliageModelList* leaves;
FoliageModelList* trunk;
FoliageDropList* drops;
FoliageVectorList* vectors;
EvtSource* callback;
} ShakeTreeConfig;
void N(foliage_setup_shear_mtx)(Matrix4f mtx, f32 scale, f32 xAmount, f32 zAmount) {
guMtxIdentF(mtx);
mtx[1][0] = scale * xAmount;
mtx[1][1] = 1.0f;
mtx[1][2] = scale * zAmount;
}
/// @apiparam int model ID
/// @apiparam float scale
/// @apiparam float dx
/// @apiparam float dy
/// @apiparam float dz
ApiStatus N(TransformFoliage)(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 modelListIndex = get_model_list_index_from_tree_index(evt_get_variable(script, *args++));
f32 scale = evt_get_float_variable(script, *args++);
f32 dx = evt_get_float_variable(script, *args++);
f32 dy = evt_get_float_variable(script, *args++);
f32 dz = evt_get_float_variable(script, *args++);
Model* model = get_model_from_list_index(modelListIndex);
Matrix4f mtx;
if (!(model->flags & MODEL_FLAGS_HAS_TRANSFORM_APPLIED)) {
guTranslateF(model->transformMatrix, 0.0f, dy, 0.0f);
N(foliage_setup_shear_mtx)(mtx, scale, dx, dz);
guMtxCatF(mtx, model->transformMatrix, model->transformMatrix);
guTranslateF(mtx, 0.0f, -dy, 0.0f);
guMtxCatF(mtx, model->transformMatrix, model->transformMatrix);
model->flags |= (MODEL_FLAGS_HAS_TRANSFORM_APPLIED | MODEL_FLAGS_USES_TRANSFORM_MATRIX);
} else {
guTranslateF(mtx, 0.0f, dy, 0.0f);
guMtxCatF(mtx, model->transformMatrix, model->transformMatrix);
N(foliage_setup_shear_mtx)(mtx, scale, dx, dz);
guMtxCatF(mtx, model->transformMatrix, model->transformMatrix);
guTranslateF(mtx, 0.0f, -dy, 0.0f);
guMtxCatF(mtx, model->transformMatrix, model->transformMatrix);
}
return ApiStatus_DONE2;
}

View File

@ -0,0 +1,19 @@
#include "common.h"
#include "BattleAreaAngleStuff.inc.c"
// TODO Merge this file with the included file when all data is disassembled.
f32 N(floatTable)[] = {
0.000000f, 0.017452f, 0.034899f, 0.052336f, 0.069756f, 0.087156f, 0.104528f, 0.121869f,
0.139173f, 0.156434f, 0.173648f, 0.190809f, 0.207912f, 0.224951f, 0.241922f, 0.258819f,
0.275637f, 0.292372f, 0.309017f, 0.325568f, 0.342020f, 0.358368f, 0.374607f, 0.390731f,
0.406737f, 0.422618f, 0.438371f, 0.453990f, 0.469472f, 0.484810f, 0.500000f, 0.515038f,
0.529919f, 0.544639f, 0.559193f, 0.573576f, 0.587785f, 0.601815f, 0.615661f, 0.629320f,
0.642788f, 0.656059f, 0.669131f, 0.681998f, 0.694658f, 0.707107f, 0.719340f, 0.731354f,
0.743145f, 0.754710f, 0.766044f, 0.777146f, 0.788011f, 0.798636f, 0.809017f, 0.819152f,
0.829038f, 0.838671f, 0.848048f, 0.857167f, 0.866025f, 0.874620f, 0.882948f, 0.891007f,
0.898794f, 0.906308f, 0.913545f, 0.920505f, 0.927184f, 0.933580f, 0.939693f, 0.945519f,
0.951057f, 0.956305f, 0.961262f, 0.965926f, 0.970296f, 0.974370f, 0.978148f, 0.981627f,
0.984808f, 0.987688f, 0.990268f, 0.992546f, 0.994522f, 0.996195f, 0.997564f, 0.998630f,
0.999391f, 0.999848f, 1.000000f,
};

View File

@ -1,83 +1,6 @@
#include "common.h"
#include "npc.h"
#include "model.h"
typedef struct FoliageModelList {
s32 count;
s32 models[0];
} FoliageModelList;
typedef struct FoliageDropList {
s32 count;
struct {
s32 itemID;
Vec3i pos;
s32 spawnMode;
Bytecode pickupFlag;
Bytecode spawnFlag;
} drops[0];
} FoliageDropList;
typedef struct FoliageVectorList {
s32 count;
Vec3i vectors[0];
} FoliageVectorList;
typedef struct SearchBushConfig {
FoliageModelList* bush;
FoliageDropList* drops;
FoliageVectorList* vectors;
EvtSource* callback;
} SearchBushConfig;
typedef struct ShakeTreeConfig {
FoliageModelList* leaves;
FoliageModelList* trunk;
FoliageDropList* drops;
FoliageVectorList* vectors;
EvtSource* callback;
} ShakeTreeConfig;
void N(foliage_setup_shear_mtx)(Matrix4f mtx, f32 scale, f32 xAmount, f32 zAmount) {
guMtxIdentF(mtx);
mtx[1][0] = scale * xAmount;
mtx[1][1] = 1.0f;
mtx[1][2] = scale * zAmount;
}
/// @apiparam int model ID
/// @apiparam float scale
/// @apiparam float dx
/// @apiparam float dy
/// @apiparam float dz
ApiStatus N(TransformFoliage)(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 modelListIndex = get_model_list_index_from_tree_index(evt_get_variable(script, *args++));
f32 scale = evt_get_float_variable(script, *args++);
f32 dx = evt_get_float_variable(script, *args++);
f32 dy = evt_get_float_variable(script, *args++);
f32 dz = evt_get_float_variable(script, *args++);
Model* model = get_model_from_list_index(modelListIndex);
Matrix4f mtx;
if (!(model->flags & MODEL_FLAGS_HAS_TRANSFORM_APPLIED)) {
guTranslateF(model->transformMatrix, 0.0f, dy, 0.0f);
N(foliage_setup_shear_mtx)(mtx, scale, dx, dz);
guMtxCatF(mtx, model->transformMatrix, model->transformMatrix);
guTranslateF(mtx, 0.0f, -dy, 0.0f);
guMtxCatF(mtx, model->transformMatrix, model->transformMatrix);
model->flags |= (MODEL_FLAGS_HAS_TRANSFORM_APPLIED | MODEL_FLAGS_USES_TRANSFORM_MATRIX);
} else {
guTranslateF(mtx, 0.0f, dy, 0.0f);
guMtxCatF(mtx, model->transformMatrix, model->transformMatrix);
N(foliage_setup_shear_mtx)(mtx, scale, dx, dz);
guMtxCatF(mtx, model->transformMatrix, model->transformMatrix);
guTranslateF(mtx, 0.0f, -dy, 0.0f);
guMtxCatF(mtx, model->transformMatrix, model->transformMatrix);
}
return ApiStatus_DONE2;
}
#include "FoliageTransform.inc.c"
EvtSource N(searchBush) = {
EVT_USE_BUF(EVT_VAR(0))

View File

@ -24,7 +24,7 @@
#include "world/common/SomeXYZFunc2.inc.c"
#define NAMESPACE dro_01
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"
FoliageModelList N(tree1_Leaves) = {
.count = 1,

View File

@ -1164,7 +1164,7 @@ ApiStatus N(func_80240158_CA73F8)(Evt* script, s32 isInitialCall) {
return ApiStatus_BLOCK;
}
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"
FoliageModelList N(tree1_Leaves) = {
.count = 1,

View File

@ -224,7 +224,7 @@ NpcSettings N(npcSettings_80241220) = {
.level = 99,
};
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"
s32** N(D_80241BB0_CADDA0) = NULL;

View File

@ -1263,7 +1263,7 @@ ApiStatus N(func_80241BCC_CB090C)(Evt* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"
FoliageModelList N(tree1_Leaves) = {
.count = 1,

View File

@ -292,7 +292,7 @@ static s32 N(pad_2874)[] = {
0x00000000, 0x00000000, 0x00000000,
};
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"
EvtSource N(802431E4) = {
EVT_CALL(GetNpcPos, 3, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2))

View File

@ -1,6 +1,6 @@
#include "flo_10.h"
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"
FoliageModelList N(tree1_Leaves) = {
.count = 3,

View File

@ -165,7 +165,7 @@ NpcSettings N(npcSettings_80240E5C) = {
.level = 99,
};
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"
s32** N(D_802417EC_CC261C) = NULL;

View File

@ -1,6 +1,6 @@
#include "flo_18.h"
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"
EvtSource N(80247024) = {
EVT_RETURN

View File

@ -1,6 +1,6 @@
#include "flo_22.h"
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"
FoliageModelList N(tree1_Trunk) = {
.count = 3,

View File

@ -133,7 +133,7 @@ static s32 N(pad_D38)[] = {
0x00000000, 0x00000000,
};
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"
FoliageModelList N(tree1_Leaves) = {
.count = 6,

View File

@ -1,6 +1,6 @@
#include "flo_25.h"
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"
FoliageModelList N(tree1_Leaves) = {
.count = 3,

View File

@ -1,4 +1,4 @@
#include "hos_03.h"
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"

View File

@ -1,4 +1,4 @@
#include "iwa_10.h"
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"

View File

@ -1,4 +1,4 @@
#include "jan_00.h"
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"

View File

@ -1,4 +1,4 @@
#include "jan_01.h"
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"

View File

@ -1,4 +1,4 @@
#include "jan_02.h"
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"

View File

@ -1,4 +1,4 @@
#include "jan_03.h"
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"

View File

@ -1,4 +1,4 @@
#include "jan_04.h"
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"

View File

@ -34,5 +34,5 @@ INCLUDE_ASM(s32, "world/area_jan/jan_04/B451F0", func_80240BE8_B45358);
INCLUDE_ASM(s32, "world/area_jan/jan_04/B451F0", func_80240D0C_B4547C);
#define NAMESPACE dup_jan_04
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"
#define NAMESPACE jan_04

View File

@ -1,6 +1,6 @@
#include "jan_05.h"
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"
INCLUDE_ASM(s32, "world/area_jan/jan_05/B4AF10", func_802406DC_B4B14C);

View File

@ -39,7 +39,7 @@ INCLUDE_ASM(s32, "world/area_jan/jan_05/B4B260", func_802407F0_B4B260);
#include "world/common/UnkNpcAIFunc28.inc.c"
#define NAMESPACE dup_jan_05
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"
#define NAMESPACE jan_05
ApiStatus func_8024268C_B4D0FC(Evt* script) {

View File

@ -1,4 +1,4 @@
#include "jan_06.h"
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"

View File

@ -39,5 +39,5 @@ INCLUDE_ASM(s32, "world/area_jan/jan_06/B52F70", func_80241554_B53D84);
#include "world/common/UnkNpcAIFunc28.inc.c"
#define NAMESPACE dup_jan_06
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"
#define NAMESPACE jan_06

View File

@ -1,4 +1,4 @@
#include "jan_07.h"
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"

View File

@ -1,7 +1,7 @@
#include "jan_07.h"
#define NAMESPACE dup_jan_07
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"
#define NAMESPACE jan_07

View File

@ -1,6 +1,6 @@
#include "jan_08.h"
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"
INCLUDE_ASM(s32, "world/area_jan/jan_08/B5E5C0", func_8024054C_B5E7FC);

View File

@ -1,7 +1,7 @@
#include "jan_08.h"
#define NAMESPACE dup_jan_08
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"
#define NAMESPACE jan_08

View File

@ -1,6 +1,6 @@
#include "jan_09.h"
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"
INCLUDE_ASM(s32, "world/area_jan/jan_09/B660A0", func_8024082C_B662DC);

View File

@ -1,5 +1,5 @@
#include "jan_09.h"
#define NAMESPACE dup_jan_09
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"
#define NAMESPACE jan_09

View File

@ -1,6 +1,6 @@
#include "jan_10.h"
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"
INCLUDE_ASM(s32, "world/area_jan/jan_10/B6D610", func_802414BC_B6D84C);

View File

@ -1,5 +1,5 @@
#include "jan_10.h"
#define NAMESPACE dup_jan_10
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"
#define NAMESPACE jan_10

View File

@ -11,5 +11,5 @@ INCLUDE_ASM(s32, "world/area_jan/jan_12/B730B0", func_80240170_B73220);
INCLUDE_ASM(s32, "world/area_jan/jan_12/B730B0", func_802401CC_B7327C);
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"

View File

@ -11,5 +11,5 @@ INCLUDE_ASM(s32, "world/area_jan/jan_13/B767B0", func_80240214_B769C4);
INCLUDE_ASM(s32, "world/area_jan/jan_13/B767B0", func_802402B8_B76A68);
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"

View File

@ -11,5 +11,5 @@ INCLUDE_ASM(s32, "world/area_jan/jan_14/B7A050", func_80240170_B7A1C0);
INCLUDE_ASM(s32, "world/area_jan/jan_14/B7A050", func_802401CC_B7A21C);
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"

View File

@ -1,4 +1,4 @@
#include "jan_15.h"
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"

View File

@ -1,4 +1,4 @@
#include "jan_16.h"
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"

View File

@ -8,7 +8,7 @@ INCLUDE_ASM(s32, "world/area_jan/jan_22/B851A0", func_80241168_B852E8);
INCLUDE_ASM(s32, "world/area_jan/jan_22/B851A0", func_802412E0_B85460);
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"
INCLUDE_ASM(s32, "world/area_jan/jan_22/B851A0", func_8024160C_B8578C);

View File

@ -1,5 +1,5 @@
#include "jan_22.h"
#define NAMESPACE dup_jan_22
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"
#define NAMESPACE jan_22

View File

@ -1,4 +1,4 @@
#include "kmr_02.h"
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"

View File

@ -1,6 +1,6 @@
#include "kmr_03.h"
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"
FoliageModelList N(treeModelList_Bush1_Bush) = {
.count = 1,

View File

@ -1,6 +1,6 @@
#include "kmr_04.h"
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"
#define NAMESPACE dup_kmr_04
#include "world/common/CheckPartnerFlags1000.inc.c"

View File

@ -1,6 +1,6 @@
#include "kmr_05.h"
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"
ApiStatus func_8024173C_8CF7AC(Evt* script, s32 isInitialCall) {
if (get_enemy_safe(6) == NULL) {

View File

@ -1,4 +1,4 @@
#include "kmr_10.h"
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"

View File

@ -5,7 +5,7 @@ static char* N(exit_str_1) = "kmr_12";
static char* N(exit_str_2) = "kmr_10";
static char* N(exit_str_3) = "";
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"
#include "common/UnkFogFunc.inc.c"

View File

@ -1,6 +1,6 @@
#include "kmr_11.h"
#define NAMESPACE dup_kmr_11
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"
#define NAMESPACE kmr_11

View File

@ -18,7 +18,7 @@ INCLUDE_ASM(s32, "world/area_kmr/kmr_20/8EBE50", func_80240330_8EC150);
INCLUDE_ASM(s32, "world/area_kmr/kmr_20/8EBE50", func_80240358_8EC178);
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"
INCLUDE_ASM(s32, "world/area_kmr/kmr_20/8EBE50", func_802405BC_8EC3DC);

View File

@ -1,6 +1,6 @@
#include "kmr_20.h"
#define NAMESPACE dup_kmr_20
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"
#define NAMESPACE kmr_20

View File

@ -1,6 +1,6 @@
#include "kmr_20.h"
#define NAMESPACE dup2_kmr_20
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"
#define NAMESPACE kmr_20

View File

@ -25,7 +25,7 @@
#define NAMESPACE kmr_20
#define NAMESPACE dup3_kmr_20
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"
#define NAMESPACE kmr_20
INCLUDE_ASM(s32, "world/area_kmr/kmr_20/8ED5A0", func_80241C9C_8EDABC);

View File

@ -1,4 +1,4 @@
#include "mac_01.h"
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"

View File

@ -1,4 +1,4 @@
#include "mac_02.h"
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"

View File

@ -1,4 +1,4 @@
#include "mac_03.h"
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"

View File

@ -1,4 +1,4 @@
#include "mac_04.h"
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"

View File

@ -1,4 +1,4 @@
#include "mim_11.h"
#include "world/common/foliage.inc.c"
#include "common/foliage.inc.c"

Some files were not shown because too many files have changed in this diff Show More