summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorchandler <chandlerm2016@yahoo.com>2020-06-15 02:39:21 -0400
committerchandler <chandlerm2016@yahoo.com>2020-06-15 02:39:21 -0400
commita9ef27fa23c8fde7373eb73cc901a08369007a18 (patch)
tree6fc6ee51def8babd88ec81313265ba5a8aed98d1 /src
parent4d8721d19a34794eec31aaa36bce8582e64695d7 (diff)
talon OK
Diffstat (limited to 'src')
-rw-r--r--src/bladeBrothers.c191
-rw-r--r--src/cow.c6
-rw-r--r--src/enemy.c208
-rw-r--r--src/mailbox.c15
-rw-r--r--src/object.c2
-rw-r--r--src/talon.c163
-rw-r--r--src/textbox.c1
7 files changed, 364 insertions, 222 deletions
diff --git a/src/bladeBrothers.c b/src/bladeBrothers.c
index f2f01a18..db07d9b1 100644
--- a/src/bladeBrothers.c
+++ b/src/bladeBrothers.c
@@ -33,123 +33,110 @@ extern struct_030010A0 gUnk_030010A0;
extern u16 gUnk_081115DC[];
extern Entity gLinkEntity;
-void sub_080689C0(Entity *this)
-{
-
- if ((this->flags & 2) != 0) {
- gUnk_081115D0[this->action](this);
- }
- else {
- gUnk_081115C0[this->action](this);
- sub_0806ED78(this);
- }
- if ((this->frames.all & 1) != 0) {
- this->frames.all &= 0xfe;
- sub_08068BEC(this, 0);
- }
+void sub_080689C0(Entity* this) {
+
+ if ((this->flags & 2) != 0) {
+ gUnk_081115D0[this->action](this);
+ } else {
+ gUnk_081115C0[this->action](this);
+ sub_0806ED78(this);
+ }
+ if ((this->frames.all & 1) != 0) {
+ this->frames.all &= 0xfe;
+ sub_08068BEC(this, 0);
+ }
}
-void sub_08068A1C(Entity *this)
-{
- u8 bVar1;
- int offset;
-
- (this->entityType).parameter2 = (this->entityType).parameter1;
- if (gUnk_030010A0.unk != 0) {
- offset = 6;
- bVar1 = 3;
-
- }
- else {
- sub_08078778(this);
- offset = 2;
- bVar1 = 1;
- }
- this->action = bVar1;
- InitializeAnimation(this, offset);
+void sub_08068A1C(Entity* this) {
+ u8 bVar1;
+ int offset;
+
+ (this->entityType).parameter2 = (this->entityType).parameter1;
+ if (gUnk_030010A0.unk != 0) {
+ offset = 6;
+ bVar1 = 3;
+
+ } else {
+ sub_08078778(this);
+ offset = 2;
+ bVar1 = 1;
+ }
+ this->action = bVar1;
+ InitializeAnimation(this, offset);
}
-void sub_08068A4C(Entity *this)
-{
- s32 uVar1;
- s32 iVar2;
-
- uVar1 = sub_0806ED9C(this, 0x28, 0x28);
- if (uVar1 < 0) {
- uVar1 = 2;
- }
- else {
- if (this->field_0xf == 0) {
- this->field_0xf = 0x10;
+void sub_08068A4C(Entity* this) {
+ s32 uVar1;
+ s32 iVar2;
+
+ uVar1 = sub_0806ED9C(this, 0x28, 0x28);
+ if (uVar1 < 0) {
+ uVar1 = 2;
+ } else {
+ if (this->field_0xf == 0) {
+ this->field_0xf = 0x10;
+ } else {
+ this->field_0xf--;
+ uVar1 = (u32)this->field_0x58;
+ }
+ }
+ iVar2 = sub_0806F078(this, uVar1);
+ if (iVar2 == 0) {
+ sub_08004274(this);
}
- else {
- this->field_0xf--;
- uVar1 = (u32)this->field_0x58;
+ if (this->interactType != 0) {
+ this->interactType = 0;
+ this->action = 2;
+ TextboxNoOverlapFollow(0);
}
- }
- iVar2 = sub_0806F078(this,uVar1);
- if (iVar2 == 0) {
- sub_08004274(this);
- }
- if (this->interactType != 0) {
- this->interactType = 0;
- this->action = 2;
- TextboxNoOverlapFollow(0);
- }
}
-void sub_08068AA4(Entity *this)
-{
- u8 bVar1;
-
- this->action = 1;
- if (this->entityType.parameter1 != 0) {
- this->entityType.parameter2++;
- this->entityType.parameter2 &= 7;
- if (this->entityType.parameter2 == 0) {
- this->entityType.parameter2 += 1;
+void sub_08068AA4(Entity* this) {
+ u8 bVar1;
+
+ this->action = 1;
+ if (this->entityType.parameter1 != 0) {
+ this->entityType.parameter2++;
+ this->entityType.parameter2 &= 7;
+ if (this->entityType.parameter2 == 0) {
+ this->entityType.parameter2 += 1;
+ }
+ sub_0801D2B4(this, gUnk_081115DC[this->entityType.parameter2]);
}
- sub_0801D2B4(this, gUnk_081115DC[this->entityType.parameter2]);
- }
}
-void sub_08068ADC(Entity *this)
-{
- if (gUnk_030010A0.unk == 2) {
- sub_08004274(this);
- }
- sub_0806FD3C(this);
+void sub_08068ADC(Entity* this) {
+ if (gUnk_030010A0.unk == 2) {
+ sub_08004274(this);
+ }
+ sub_0806FD3C(this);
}
-void sub_08068AFC(Entity *this)
-{
- this->action = 1;
- this->spriteSettings.b.ss0 = 1;
- *(u8*)&this->field_0x68 = sub_0801E99C(this);
- sub_08078784(this, *(u8*)&this->field_0x68);
- sub_0807DD50(this);
+void sub_08068AFC(Entity* this) {
+ this->action = 1;
+ this->spriteSettings.b.ss0 = 1;
+ *(u8*)&this->field_0x68 = sub_0801E99C(this);
+ sub_08078784(this, *(u8*)&this->field_0x68);
+ sub_0807DD50(this);
}
-void FUN_08068b2c(Entity *this)
-{
- u32 uVar1;
-
- if (this->interactType == '\x02') {
- this->action = 2;
- this->interactType = '\0';
- sub_080045C4(this,&gLinkEntity);
- uVar1 = sub_0806F5A4();
- InitAnimationForceUpdate(this, uVar1);
- sub_0806F118(this);
- }
- else {
- sub_0807DD94(this, 0);
- }
+void FUN_08068b2c(Entity* this) {
+ u32 uVar1;
+
+ if (this->interactType == '\x02') {
+ this->action = 2;
+ this->interactType = '\0';
+ sub_080045C4(this, &gLinkEntity);
+ uVar1 = sub_0806F5A4();
+ InitAnimationForceUpdate(this, uVar1);
+ sub_0806F118(this);
+ } else {
+ sub_0807DD94(this, 0);
+ }
}
-void sub_08068B70(Entity *this)
-{
- if (UpdateFuseInteraction()) {
- this->action = 1;
- }
+void sub_08068B70(Entity* this) {
+ if (UpdateFuseInteraction()) {
+ this->action = 1;
+ }
}
diff --git a/src/cow.c b/src/cow.c
index 80a44ddd..c78f69e0 100644
--- a/src/cow.c
+++ b/src/cow.c
@@ -46,12 +46,12 @@ void sub_08068FC0(Entity* ent) {
*(u16*)&ent->field_0x68 = x;
y = ent->y.HALF.HI;
- ent->field_0x6a = y;
+ ent->field_0x6a.HWORD = y;
} else {
u32 var1 = r2 >> 16;
// 0x68+0x69 probably a SplitWord
*(u16*)&ent->field_0x68 = var1;
- ent->field_0x6a = r2;
+ ent->field_0x6a.HWORD = r2;
}
ent->field_0x6c = sub_0801E99C(ent);
@@ -116,7 +116,7 @@ void sub_08069068(Entity* ent) {
}
{
s32 y = ent->y.HALF.HI;
- s16* y2 = &ent->field_0x6a;
+ s16* y2 = &ent->field_0x6a.HWORD;
y -= *y2;
if (y > 16) {
ent->y.HALF.HI = *y2 + 16;
diff --git a/src/enemy.c b/src/enemy.c
index 90ca8912..5bf4fb8e 100644
--- a/src/enemy.c
+++ b/src/enemy.c
@@ -2,108 +2,106 @@
#include "entity.h"
#include "enemy.h"
-void (*const gEnemyFunctions[])(Entity* ent) = {
- Octorok,
- Chuchu,
- Leever,
- Peahat,
- Rollobite,
- DarkNut,
- HangingSeed,
- Beetle,
- Keese,
- DoorMimic,
- RockChuchu,
- SpinyChuchu,
- CuccoChickAggr,
- Moldorm,
- EnemyE,
- Moldworm,
- Sluggula,
- Pesto,
- Puffstool,
- ChuchuBoss,
- LikeLike,
- SpearMoblin,
- BusinessScrub,
- RupeeLike,
- Madderpillar,
- WaterDrop,
- WallMaster,
- BombPeahat,
- Spark,
- Chaser,
- SpikedBeetle,
- SensorBladeTrap,
- Helmasaur,
- FallingBoulder,
- Bobomb,
- WallMaster2,
- Gleerok,
- VaatiEyesMacro,
- Tektite,
- WizzrobeWind,
- WizzrobeFire,
- WizzrobeIce,
- Armos,
- Eyegore,
- Rope,
- SmallPesto,
- AcroBandit,
- BladeTrap,
- Keaton,
- Crow,
- Mulldozer,
- Bombarossa,
- Wisp,
- SpinyBeetle,
- MazaalHead,
- MazaalMacro,
- MazaalHand,
- OctorokBoss,
- FlyingPot,
- Gibdo,
- OctorokGolden,
- TektiteGolden,
- RopeGolden,
- CloudPiranha,
- ScissorsBeetle,
- CuccoAggr,
- Stalfos,
- FlyingSkull,
- MazaalBracelet,
- Takkuri,
- BowMoblin,
- Lakitu,
- LakituCloud,
- Enemy49,
- VaatiRebornEnemy,
- VaatiProjectile,
- BallChainSoldier,
- Enemy4D,
- Ghini,
- VaatiTransfigured,
- Enemy50,
- VaatiWrath,
- VaatiArm,
- Dust,
- VaatiBall,
- Octorok,
- Slime,
- MiniSlime,
- FireballGuy,
- MiniFireballGuy,
- Enemy5A,
- BusinessScrubPrologue,
- GyorgFemale,
- GyorgMale,
- Curtain,
- Enemy5F,
- GyorgChild,
- GyorgFemaleEye,
- Enemy62,
- GyorgFemaleMouth,
- Enemy64,
- TreeItem,
- Enemy66
-};
+void (*const gEnemyFunctions[])(Entity* ent) = { Octorok,
+ Chuchu,
+ Leever,
+ Peahat,
+ Rollobite,
+ DarkNut,
+ HangingSeed,
+ Beetle,
+ Keese,
+ DoorMimic,
+ RockChuchu,
+ SpinyChuchu,
+ CuccoChickAggr,
+ Moldorm,
+ EnemyE,
+ Moldworm,
+ Sluggula,
+ Pesto,
+ Puffstool,
+ ChuchuBoss,
+ LikeLike,
+ SpearMoblin,
+ BusinessScrub,
+ RupeeLike,
+ Madderpillar,
+ WaterDrop,
+ WallMaster,
+ BombPeahat,
+ Spark,
+ Chaser,
+ SpikedBeetle,
+ SensorBladeTrap,
+ Helmasaur,
+ FallingBoulder,
+ Bobomb,
+ WallMaster2,
+ Gleerok,
+ VaatiEyesMacro,
+ Tektite,
+ WizzrobeWind,
+ WizzrobeFire,
+ WizzrobeIce,
+ Armos,
+ Eyegore,
+ Rope,
+ SmallPesto,
+ AcroBandit,
+ BladeTrap,
+ Keaton,
+ Crow,
+ Mulldozer,
+ Bombarossa,
+ Wisp,
+ SpinyBeetle,
+ MazaalHead,
+ MazaalMacro,
+ MazaalHand,
+ OctorokBoss,
+ FlyingPot,
+ Gibdo,
+ OctorokGolden,
+ TektiteGolden,
+ RopeGolden,
+ CloudPiranha,
+ ScissorsBeetle,
+ CuccoAggr,
+ Stalfos,
+ FlyingSkull,
+ MazaalBracelet,
+ Takkuri,
+ BowMoblin,
+ Lakitu,
+ LakituCloud,
+ Enemy49,
+ VaatiRebornEnemy,
+ VaatiProjectile,
+ BallChainSoldier,
+ Enemy4D,
+ Ghini,
+ VaatiTransfigured,
+ Enemy50,
+ VaatiWrath,
+ VaatiArm,
+ Dust,
+ VaatiBall,
+ Octorok,
+ Slime,
+ MiniSlime,
+ FireballGuy,
+ MiniFireballGuy,
+ Enemy5A,
+ BusinessScrubPrologue,
+ GyorgFemale,
+ GyorgMale,
+ Curtain,
+ Enemy5F,
+ GyorgChild,
+ GyorgFemaleEye,
+ Enemy62,
+ GyorgFemaleMouth,
+ Enemy64,
+ TreeItem,
+ Enemy66 };
diff --git a/src/mailbox.c b/src/mailbox.c
index 53864436..0a200d30 100644
--- a/src/mailbox.c
+++ b/src/mailbox.c
@@ -18,14 +18,12 @@ void sub_080631E8(Entity* this) {
}
}
-void sub_08063210(Entity* this)
-{
+void sub_08063210(Entity* this) {
this->action = 1;
InitAnimationForceUpdate(this, 0);
}
-void sub_08063220(Entity* this)
-{
+void sub_08063220(Entity* this) {
u8 bVar1;
if (this->interactType != 0) {
@@ -42,8 +40,7 @@ void sub_08063220(Entity* this)
}
}
-void sub_08063254(Entity* this, u32 unused)
-{
+void sub_08063254(Entity* this, u32 unused) {
sub_08063280(this, unused);
if ((this->frames.all & 0x80) != 0) {
this->action = 3;
@@ -51,13 +48,11 @@ void sub_08063254(Entity* this, u32 unused)
}
}
-void sub_08063278(Entity* this, u32 unused)
-{
+void sub_08063278(Entity* this, u32 unused) {
sub_08063280(this, unused);
}
-void sub_08063280(Entity* this, u32 unused)
-{
+void sub_08063280(Entity* this, u32 unused) {
Entity* e; // r4@1
u8 var; // r2@1
diff --git a/src/object.c b/src/object.c
index 36a3db2c..8bf04b80 100644
--- a/src/object.c
+++ b/src/object.c
@@ -197,4 +197,4 @@ void (*const gObjectFunctions[])(Entity*) = {
ObjectBF,
EnemyItem,
ObjectC1,
-}; \ No newline at end of file
+};
diff --git a/src/talon.c b/src/talon.c
new file mode 100644
index 00000000..2262d66d
--- /dev/null
+++ b/src/talon.c
@@ -0,0 +1,163 @@
+#include "global.h"
+#include "entity.h"
+#include "textbox.h"
+#include "functions.h"
+#include "link.h"
+
+extern Entity gLinkEntity;
+
+extern void (*gUnk_0810FEC4[])(Entity* this);
+extern void (*gUnk_0810FEBC[])(Entity* this);
+extern u32 gUnk_0810FEB0;
+extern u8 gUnk_0800B41C;
+extern u8 gUnk_0810FED8[];
+
+void sub_0806574C(Entity* this);
+
+void sub_08065534(Entity* this) {
+ if (this->flags & 2) {
+ gUnk_0810FEC4[this->action](this);
+ } else {
+ gUnk_0810FEBC[this->action](this);
+ }
+}
+
+void sub_08065570(Entity* this) {
+ if (sub_0806FDEC(this, &gUnk_0810FEB0) != 0) {
+ InitializeAnimation(this, 0);
+ sub_08078778(this);
+ this->action = 1;
+ this->field_0xf = 1;
+ this->animationState = 2;
+ }
+}
+
+void sub_0806559C(Entity* this) {
+ s32 offset;
+ s32 result;
+
+ this->parameter3++;
+ if (this->parameter3 >= 9) {
+ this->parameter3 = 0;
+ result = sub_0806ED9C(this, 0x20, 0x20);
+ if (result < 0) {
+ offset = this->animationState + 4;
+ } else {
+ this->animationState = result;
+ offset = result;
+ }
+ } else {
+ offset = this->field_0x58;
+ }
+
+ if (this->field_0x58 != offset) {
+ InitializeAnimation(this, offset);
+ } else {
+ sub_08004274(this);
+ }
+ sub_0806ED78(this);
+ if (this->interactType != 0) {
+ this->interactType = 0;
+ sub_080791D0();
+ }
+}
+
+void sub_08065608(Entity* this) {
+ if (sub_0806FDEC(this, &gUnk_0810FEB0) != 0) {
+ this->action = 1;
+ this->spriteSettings.b.ss0 = 1;
+ this->field_0x68 = sub_0801E99C(this);
+ sub_08078784(this, this->field_0x68);
+ sub_0807DD50(this);
+ }
+}
+
+void sub_08065648(Entity* this) {
+ if (this->interactType == 2) {
+ this->field_0x69 = this->action;
+ this->action = 4;
+ this->interactType = 0;
+ sub_0806F118(this);
+ } else {
+ sub_0807DD94(this, 0);
+ }
+}
+
+void sub_08065680(Entity* this) {
+ if (UpdateFuseInteraction() != 0) {
+ this->action = this->field_0x69;
+ InitAnimationForceUpdate(this, this->field_0x6a.HALF.LO);
+ }
+}
+
+void sub_080656A4(Entity* this) {
+ if ((gTextBox.doTextBox & 0x7F) == 0) {
+ this->action = this->field_0x69;
+ InitAnimationForceUpdate(this, this->field_0x6a.HALF.LO);
+ }
+ UpdateAnimationSingleFrame(this);
+}
+
+void sub_080656D4(Entity* this) {
+ if (this->interactType == 2) {
+ this->field_0x69 = this->action;
+ this->action = 4;
+ this->interactType = 0;
+ sub_0806F118(this);
+ goto label;
+ } else {
+ if (this->interactType != 0) {
+ if (GetInventoryValue(0x37) != 0) { // keyLonLon
+ sub_0807DAD0(this, &gUnk_0800B41C);
+ goto label2;
+ } else {
+ this->field_0x69 = this->action;
+ this->action = 3;
+ this->interactType = 0;
+ TextboxNoOverlap(*(u32*)(*(u32*)&this->cutsceneBeh.HWORD + 4), this);
+ label:
+ sub_0806574C(this);
+ }
+ } else {
+ label2:
+ sub_0807DD94(this, 0);
+ }
+ }
+}
+
+void sub_0806574C(Entity* this) {
+ u32 j;
+
+ j = (this->field_0x58 & ~3) + sub_0806F5A4(sub_080045C4(this, &gLinkEntity));
+ if (this->field_0x58 != j) {
+ InitAnimationForceUpdate(this, j);
+ }
+ this->field_0x6a.HALF.LO = this->field_0x58;
+}
+
+void sub_08065780(Entity* this, u16* param_2) {
+ u32 rand;
+
+ rand = Random();
+ this->animationState = rand & 6;
+ param_2[8] = gUnk_0810FED8[rand >> 8 & 7];
+}
+
+void sub_080657A8(Entity* this) {
+ sub_0806FF60(this, 0, ((this->frames.all & 7) + 0xB));
+ sub_0806FF60(this, 1, this->animationList);
+ sub_0806FF88(this, 1, 0);
+ sub_0807000C(this);
+}
+
+void sub_080657DC(Entity* this) {
+ if (this->action == 0) {
+ if (sub_0806FDEC(this, &gUnk_0810FEB0) != 0) {
+ this->action++;
+ this->spriteSettings.b.ss0 = 1;
+ InitializeAnimation(this, 6);
+ }
+ } else {
+ sub_08004274(this);
+ }
+}
diff --git a/src/textbox.c b/src/textbox.c
index 5e557d01..1ec017d8 100644
--- a/src/textbox.c
+++ b/src/textbox.c
@@ -3,7 +3,6 @@
#include "entity.h"
#include "textbox.h"
-void TextboxNoOverlap(u32 index, Entity* ent);
void sub_0801D630();
void ShowTextbox();
void TextboxAtPosition();