Merge pull request #421 from octorock/playerUtils

Merge playerUtils
This commit is contained in:
notyourav
2022-03-02 15:56:31 -08:00
committed by GitHub
271 changed files with 18871 additions and 23256 deletions
+2 -2
View File
@@ -67,8 +67,8 @@ void sub_08098DC4(Entity* this) {
gPlayerEntity.collisionLayer = 1;
SortEntityAbove(this, &gPlayerEntity);
gPlayerState.queued_action = PLAYER_PARACHUTE;
gPlayerState.field_0x34[4] = 1;
gPlayerState.field_0x34[5] = this->type2;
gPlayerState.field_0x38 = 1;
gPlayerState.field_0x39 = this->type2;
this->action = 4;
if (this->type2 == 1) {
SetGlobalFlag(TATSUMAKI);
+2 -2
View File
@@ -17,7 +17,7 @@ void Book(Entity* this) {
void sub_0809B3C4(Entity* this) {
u32 obtained;
obtained = GetInventoryValue(this->type + 0x39);
obtained = GetInventoryValue(this->type + ITEM_QST_BOOK1);
if (this->type2 != 3) {
if (obtained) {
DeleteThisEntity();
@@ -188,7 +188,7 @@ void sub_0809B5EC(Entity* this) {
break;
}
case 0: {
if (GetInventoryValue(this->type + 0x39) == 2) {
if (GetInventoryValue(this->type + ITEM_QST_BOOK1) == 2) {
this->subAction = 1;
}
break;
+1 -1
View File
@@ -65,7 +65,7 @@ void sub_08081BE0(Entity* this) {
if (!sub_08081D28(this)) {
this->action = 4;
this->field_0xf = 1;
if ((gPlayerState.heldObject == 2) || (!(gPlayerState.field_0x34[1] & 0x80))) {
if ((gPlayerState.heldObject == 2) || (!(gPlayerState.field_0x35 & 0x80))) {
this->actionDelay = 0x18;
} else {
this->actionDelay = 0x8;
+1 -1
View File
@@ -13,7 +13,7 @@ extern void (*gUnk_081247AC[])(Entity*);
extern void* gUnk_080DD750;
extern u8 gUnk_081247C0[];
extern u16 gUnk_081247C8[];
extern u32 gUnk_081247D0;
extern u16 gUnk_081247D0;
void Cloud(Entity* this) {
gUnk_08124798[this->type](this);
+1 -1
View File
@@ -40,7 +40,7 @@ typedef struct {
#endif
} FigurineDeviceEntity;
extern void sub_080542C0(s32);
extern void ModShells(s32);
extern u8 gUnk_020227F0;
typedef struct {
u32 unk_0;
+1 -1
View File
@@ -159,7 +159,7 @@ void sub_080819B4(ItemForSaleEntity* this) {
void sub_08081A5C(ItemForSaleEntity* this) {
u32 tmp = sub_080787D8(super);
if (super->actionDelay == 1) {
gUnk_03003DF0[tmp].unk4[2] = 0;
gUnk_03003DF0.array[tmp].unk_2 = 0;
}
}
+2 -2
View File
@@ -51,7 +51,7 @@ void Object43_Init(Object43Entity* this) {
super->actionDelay = 0x28;
} else {
super->spriteSettings.draw = 1;
if ((gPlayerState.field_0xac & 0x200) != 0) {
if ((gPlayerState.skills & SKILL_FAST_SPIN) != 0) {
super->actionDelay = 0x28;
} else {
super->actionDelay = 0x50;
@@ -102,7 +102,7 @@ void Object43_Action1(Object43Entity* this) {
if (super->actionDelay != 0) {
super->actionDelay--;
tmp2 = 3;
if ((super->type2 == 0) && ((gPlayerState.field_0xac & 0x200) == 0)) {
if ((super->type2 == 0) && ((gPlayerState.skills & SKILL_FAST_SPIN) == 0)) {
tmp2 = 7;
}
if ((super->actionDelay & tmp2) == 0) {
+2 -2
View File
@@ -402,7 +402,7 @@ void sub_08094FA8(Object6AEntity* this) {
}
break;
case 2:
if (GetInventoryValue(54) == 2) {
if (GetInventoryValue(ITEM_QST_DOGFOOD) == 2) {
super->action = 3;
super->spriteSettings.draw = 1;
}
@@ -437,7 +437,7 @@ void sub_08095088(Object6AEntity* this) {
switch (super->action) {
case 0:
if (GetInventoryValue(91))
if (GetInventoryValue(ITEM_JABBERNUT))
DeleteThisEntity();
super->action = 1;
super->spritePriority.b0 = 7;
+3 -2
View File
@@ -1,4 +1,5 @@
#include "object.h"
#include "item.h"
void sub_08099ECC(Entity*);
extern void sub_0805B390(u32);
@@ -14,7 +15,7 @@ void sub_08099DD0(Entity* this) {
this->spriteRendering.b3 = 3;
this->spritePriority.b0 = 7;
this->subAction = 0;
if (GetInventoryValue(0x46)) {
if (GetInventoryValue(ITEM_FLIPPERS)) {
this->action = 4;
this->frameIndex = 0;
} else {
@@ -68,6 +69,6 @@ void sub_08099ECC(Entity* this) {
this->subAction = 1;
CopyPosition(this, &gPlayerEntity);
gPlayerState.queued_action = PLAYER_FALL;
gPlayerState.field_0x34[4] = 0;
gPlayerState.field_0x38 = 0;
gPlayerState.flags |= PL_FLAGS8000;
}
+1 -1
View File
@@ -107,7 +107,7 @@ void ObjectOnSpinyBeetle_Action1(ObjectOnSpinyBeetleEntity* this) {
case 0x18:
case 0x19:
case 0x1a:
if (super->type == 0 || (gPlayerState.field_0xac & 8) != 0) {
if (super->type == 0 || (gPlayerState.skills & SKILL_ROCK_BREAKER) != 0) {
sub_080989C0(this);
}
break;
-6
View File
@@ -7,12 +7,6 @@
#include "functions.h"
#include "effects.h"
extern void sub_0809E96C(Entity*);
extern void CreateSparkle(Entity*);
extern u32 sub_0809E9A0(void);
extern void sub_0809E918(Entity*);
extern void CreateMinishEntrance(u32 tile);
extern void (*const gUnk_08124354[])(Entity*);
extern s16 gUnk_08124364[];