Purge ExchangeItemID enum (#1026)

* Purge ExchangeItemID enum

* Add stff to namefixer

* Rename FISHING_ROD
This commit is contained in:
Anghelo Carvajal
2022-08-15 15:04:42 -04:00
committed by GitHub
parent 0f130c173d
commit a67571c2bf
49 changed files with 131 additions and 134 deletions
+2 -2
View File
@@ -678,8 +678,8 @@ PosRot* Actor_GetWorldPosShapeRot(PosRot* dest, Actor* actor);
s32 func_800B83F8(Actor* actor, Player* player, s32 flag);
s32 Actor_ProcessTalkRequest(Actor* actor, GameState* gameState);
s32 func_800B8500(Actor* actor, PlayState* play, f32 xzRange, f32 yRange, s32 exchangeItemId);
s32 func_800B85E0(Actor* actor, PlayState* play, f32 radius, s32 exchangeItemId);
s32 func_800B8500(Actor* actor, PlayState* play, f32 xzRange, f32 yRange, PlayerActionParam exchangeItemId);
s32 func_800B85E0(Actor* actor, PlayState* play, f32 radius, PlayerActionParam exchangeItemId);
s32 func_800B8614(Actor* actor, PlayState* play, f32 radius);
s32 func_800B863C(Actor* actor, PlayState* play);
s32 Actor_TextboxIsClosing(Actor* actor, PlayState* play);
+1 -21
View File
@@ -210,7 +210,7 @@ typedef enum {
/* 0x59 */ ITEM_WALLET_DEFAULT,
/* 0x5A */ ITEM_WALLET_ADULT,
/* 0x5B */ ITEM_WALLET_GIANT,
/* 0x5C */ ITEM_FISHING_POLE,
/* 0x5C */ ITEM_FISHING_ROD,
/* 0x5D */ ITEM_REMAINS_ODOLWA,
/* 0x5E */ ITEM_REMAINS_GOHT,
/* 0x5F */ ITEM_REMAINS_GYORG,
@@ -552,24 +552,4 @@ typedef enum {
/* 0x76 */ GID_MAX
} GetItemDrawID;
// This enum may not be real, and actionparam is just used directly.
// Keep using it for now.
// TODO: fill
typedef enum {
/* -1 */ EXCH_ITEM_MINUS1 = -1, // Unknown usage or function
/* 0x00 */ EXCH_ITEM_NONE,
/* 0x13 */ EXCH_ITEM_PICTO_BOX = 0x13,
/* 0x1E */ EXCH_ITEM_1E = 0x1E, // BOTTLE_MUSHROOM
/* 0x2A */ EXCH_ITEM_MOON_TEAR = 0x2A,
/* 0x2B */ EXCH_ITEM_DEED_LAND,
/* 0x2C */ EXCH_ITEM_ROOM_KEY,
/* 0x2D */ EXCH_ITEM_LETTER_TO_KAFEI,
/* 0x2E */ EXCH_ITEM_2E,
/* 0x2F */ EXCH_ITEM_DEED_SWAMP,
/* 0x30 */ EXCH_ITEM_DEED_MOUNTAIN,
/* 0x31 */ EXCH_ITEM_DEED_OCEAN,
/* 0x32 */ EXCH_ITEM_32,
/* 0x33 */ EXCH_ITEM_LETTER_MAMA
} ExchangeItemID;
#endif
+3 -2
View File
@@ -70,10 +70,11 @@ typedef enum {
/* 0x19 */ PLAYER_MASK_MAX
} PlayerMask;
typedef enum {
typedef enum PlayerActionParam {
/* -1 */ PLAYER_AP_MINUS1 = -1,
/* 0x00 */ PLAYER_AP_NONE,
/* 0x01 */ PLAYER_AP_LAST_USED,
/* 0x02 */ PLAYER_AP_FISHING_POLE,
/* 0x02 */ PLAYER_AP_FISHING_ROD,
/* 0x03 */ PLAYER_AP_SWORD_KOKIRI,
/* 0x04 */ PLAYER_AP_SWORD_RAZOR,
/* 0x05 */ PLAYER_AP_SWORD_GILDED,
+1 -1
View File
@@ -189,7 +189,7 @@ void* gItemIcons[] = {
0x08059000, // ITEM_WALLET_DEFAULT
0x0805A000, // ITEM_WALLET_ADULT
0x0805B000, // ITEM_WALLET_GIANT
0x0805C000, // ITEM_FISHING_POLE
0x0805C000, // ITEM_FISHING_ROD
0x0805D000, // ITEM_REMAINS_ODOLWA
0x0805E000, // ITEM_REMAINS_GOHT
0x0805F000, // ITEM_REMAINS_GYORG
+4 -4
View File
@@ -1850,10 +1850,10 @@ s32 Actor_ProcessTalkRequest(Actor* actor, GameState* gameState) {
// Actor_PickUpExchange? Seems to be called with exchangeItemId -1 if the same actor used Actor_PickUp
// This function is also used to toggle the "Speak" action on the A button
s32 func_800B8500(Actor* actor, PlayState* play, f32 xzRange, f32 yRange, s32 exchangeItemId) {
s32 func_800B8500(Actor* actor, PlayState* play, f32 xzRange, f32 yRange, PlayerActionParam exchangeItemId) {
Player* player = GET_PLAYER(play);
if ((player->actor.flags & ACTOR_FLAG_100) || ((exchangeItemId > EXCH_ITEM_NONE) && Player_InCsMode(play)) ||
if ((player->actor.flags & ACTOR_FLAG_100) || ((exchangeItemId > PLAYER_AP_NONE) && Player_InCsMode(play)) ||
(!actor->isTargeted &&
((fabsf(actor->playerHeightRel) > fabsf(yRange)) || ((actor->xzDistToPlayer > player->targetActorDistance)) ||
(xzRange < actor->xzDistToPlayer)))) {
@@ -1868,12 +1868,12 @@ s32 func_800B8500(Actor* actor, PlayState* play, f32 xzRange, f32 yRange, s32 ex
return true;
}
s32 func_800B85E0(Actor* actor, PlayState* play, f32 radius, s32 exchangeItemId) {
s32 func_800B85E0(Actor* actor, PlayState* play, f32 radius, PlayerActionParam exchangeItemId) {
return func_800B8500(actor, play, radius, radius, exchangeItemId);
}
s32 func_800B8614(Actor* actor, PlayState* play, f32 radius) {
return func_800B85E0(actor, play, radius, EXCH_ITEM_NONE);
return func_800B85E0(actor, play, radius, PLAYER_AP_NONE);
}
s32 func_800B863C(Actor* actor, PlayState* play) {
+3 -3
View File
@@ -774,11 +774,11 @@ s32 func_801240DC(Player* player) {
}
s32 func_80124110(Player* player, s32 actionParam) {
s32 temp_v0 = actionParam - PLAYER_AP_FISHING_POLE;
s32 temp_v0 = actionParam - PLAYER_AP_FISHING_ROD;
if (player->transformation != PLAYER_FORM_GORON) {
if (((actionParam - PLAYER_AP_FISHING_POLE) > (PLAYER_AP_FISHING_POLE - PLAYER_AP_FISHING_POLE)) &&
((actionParam - PLAYER_AP_FISHING_POLE) < (PLAYER_AP_SWORD_GREAT_FAIRY - PLAYER_AP_FISHING_POLE))) {
if (((actionParam - PLAYER_AP_FISHING_ROD) > (PLAYER_AP_FISHING_ROD - PLAYER_AP_FISHING_ROD)) &&
((actionParam - PLAYER_AP_FISHING_ROD) < (PLAYER_AP_SWORD_GREAT_FAIRY - PLAYER_AP_FISHING_ROD))) {
return temp_v0;
}
}
+1 -1
View File
@@ -554,7 +554,7 @@ void EnAh_Update(Actor* thisx, PlayState* play) {
radius = this->collider.dim.radius + 60;
height = this->collider.dim.height + 10;
func_8013C964(&this->actor, play, radius, height, EXCH_ITEM_NONE, this->unk_2D8 & 7);
func_8013C964(&this->actor, play, radius, height, PLAYER_AP_NONE, this->unk_2D8 & 7);
if (!(this->unk_2D8 & 0x10)) {
Actor_MoveWithGravity(&this->actor);
Actor_UpdateBgCheckInfo(play, &this->actor, 30.0f, 12.0f, 0.0f, 4);
+2 -2
View File
@@ -659,7 +659,7 @@ s32 func_80BDF308(EnAl* this, PlayState* play, ScheduleOutput* scheduleOutput) {
break;
case 2:
this->unk_4F0 = EXCH_ITEM_NONE;
this->unk_4F0 = PLAYER_AP_NONE;
this->unk_4EA = 0;
func_80BDE27C(this, 2);
break;
@@ -672,7 +672,7 @@ s32 func_80BDF390(EnAl* this, PlayState* play, ScheduleOutput* scheduleOutput) {
this->actor.flags |= ACTOR_FLAG_1;
this->actor.targetMode = 0;
this->unk_4F0 = EXCH_ITEM_NONE;
this->unk_4F0 = PLAYER_AP_NONE;
this->unk_4C2 = 0;
this->unk_4D4 = 40.0f;
+1 -1
View File
@@ -647,7 +647,7 @@ void EnBaba_GaveBlastMask(EnBaba* this, PlayState* play) {
EnBaba_HandleConversation(this, play);
this->actionFunc = EnBaba_Talk;
} else {
func_800B85E0(&this->actor, play, 400.0f, EXCH_ITEM_MINUS1);
func_800B85E0(&this->actor, play, 400.0f, PLAYER_AP_MINUS1);
}
}
@@ -150,7 +150,7 @@ s32 func_809CC270(EnBba01* this, PlayState* play) {
Actor_GetScreenPos(play, &this->enHy.actor, &x, &y);
//! @bug: Both x and y conditionals are always true, || should be an &&
if (!this->enHy.waitingOnInit && ((x >= 0) || (x < SCREEN_WIDTH)) && ((y >= 0) || (y < SCREEN_HEIGHT))) {
func_800B85E0(&this->enHy.actor, play, 30.0f, EXCH_ITEM_2E);
func_800B85E0(&this->enHy.actor, play, 30.0f, PLAYER_AP_MAGIC_BEANS);
}
return true;
}
@@ -109,7 +109,7 @@ void func_809CCEE8(EnBji01* this, PlayState* play) {
} else {
this->moonsTear = (ObjMoonStone*)SubS_FindActor(play, NULL, ACTORCAT_PROP, ACTOR_OBJ_MOON_STONE);
}
func_800B8500(&this->actor, play, 60.0f, 10.0f, EXCH_ITEM_NONE);
func_800B8500(&this->actor, play, 60.0f, 10.0f, PLAYER_AP_NONE);
}
}
@@ -162,7 +162,7 @@ void func_809CD028(EnBji01* this, PlayState* play) {
this->textId = 0x5F1;
}
func_800B8500(&this->actor, play, this->actor.xzDistToPlayer, this->actor.playerHeightRel,
EXCH_ITEM_NONE);
PLAYER_AP_NONE);
break;
case PLAYER_FORM_HUMAN:
this->textId = 0x5F7;
+12 -12
View File
@@ -143,27 +143,27 @@ void EnBjt_UpdateCollision(EnBjt* this, PlayState* play) {
s32 EnBjt_TakeItem(s32 exchangeItem) {
switch (exchangeItem) {
case EXCH_ITEM_LETTER_TO_KAFEI:
case PLAYER_AP_LETTER_TO_KAFEI:
Inventory_DeleteItem(ITEM_LETTER_TO_KAFEI, SLOT(ITEM_LETTER_TO_KAFEI));
break;
case EXCH_ITEM_DEED_SWAMP:
case PLAYER_AP_DEED_SWAMP:
Inventory_DeleteItem(ITEM_DEED_SWAMP, SLOT(ITEM_DEED_SWAMP));
break;
case EXCH_ITEM_DEED_MOUNTAIN:
case PLAYER_AP_DEED_MOUNTAIN:
Inventory_DeleteItem(ITEM_DEED_MOUNTAIN, SLOT(ITEM_DEED_MOUNTAIN));
break;
case EXCH_ITEM_DEED_OCEAN:
case PLAYER_AP_DEED_OCEAN:
Inventory_DeleteItem(ITEM_DEED_OCEAN, SLOT(ITEM_DEED_OCEAN));
break;
case EXCH_ITEM_DEED_LAND:
case PLAYER_AP_DEED_LAND:
Inventory_DeleteItem(ITEM_DEED_LAND, SLOT(ITEM_DEED_LAND));
break;
case EXCH_ITEM_LETTER_MAMA:
case PLAYER_AP_LETTER_MAMA:
Inventory_DeleteItem(ITEM_LETTER_MAMA, SLOT(ITEM_LETTER_MAMA));
break;
@@ -250,9 +250,9 @@ s32 EnBjt_ChooseBehaviour(Actor* thisx, PlayState* play) {
// Fallthrough
case TEXT_STATE_16:
itemAP = func_80123810(play);
if ((itemAP == EXCH_ITEM_DEED_LAND) || (itemAP == EXCH_ITEM_LETTER_TO_KAFEI) ||
(itemAP == EXCH_ITEM_DEED_SWAMP) || (itemAP == EXCH_ITEM_DEED_MOUNTAIN) ||
(itemAP == EXCH_ITEM_DEED_OCEAN) || (itemAP == EXCH_ITEM_LETTER_MAMA)) {
if ((itemAP == PLAYER_AP_DEED_LAND) || (itemAP == PLAYER_AP_LETTER_TO_KAFEI) ||
(itemAP == PLAYER_AP_DEED_SWAMP) || (itemAP == PLAYER_AP_DEED_MOUNTAIN) ||
(itemAP == PLAYER_AP_DEED_OCEAN) || (itemAP == PLAYER_AP_LETTER_MAMA)) {
EnBjt_ChangeAnim(this, TOILET_HAND_ANIM_WAITING_MORPH);
this->playedSfx = false;
this->behaviour++;
@@ -274,9 +274,9 @@ s32 EnBjt_ChooseBehaviour(Actor* thisx, PlayState* play) {
break;
case TOILET_HAND_BEHAVIOUR_TAKE_ITEM:
if (player->exchangeItemId != EXCH_ITEM_NONE) {
if (player->exchangeItemId != PLAYER_AP_NONE) {
EnBjt_TakeItem(player->exchangeItemId);
player->exchangeItemId = EXCH_ITEM_NONE;
player->exchangeItemId = PLAYER_AP_NONE;
}
if (EnBjt_Vanish(this)) {
this->timer = 60;
@@ -446,7 +446,7 @@ void EnBjt_Update(Actor* thisx, PlayState* play) {
if (this->scheduleResult != TOILET_HAND_SCH_NONE) {
EnBjt_UpdateSkelAnime(this);
func_8013C964(&this->actor, play, 60.0f, 10.0f, EXCH_ITEM_NONE, this->stateFlags & 7);
func_8013C964(&this->actor, play, 60.0f, 10.0f, PLAYER_AP_NONE, this->stateFlags & 7);
Actor_SetFocus(&this->actor, 26.0f);
EnBjt_UpdateCollision(this, play);
}
@@ -142,7 +142,7 @@ s32 func_809CB4A0(EnCne01* this, PlayState* play) {
Actor_GetScreenPos(play, &this->enHy.actor, &x, &y);
//! @bug: Both x and y conditionals are always true, || should be an &&
if (!this->enHy.waitingOnInit && ((x >= 0) || (x < SCREEN_WIDTH)) && ((y >= 0) || (y < SCREEN_HEIGHT))) {
func_800B85E0(&this->enHy.actor, play, 30.0f, EXCH_ITEM_2E);
func_800B85E0(&this->enHy.actor, play, 30.0f, PLAYER_AP_MAGIC_BEANS);
}
return true;
}
+1 -1
View File
@@ -561,7 +561,7 @@ void EnDai_Update(Actor* thisx, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
func_80B3E834(this);
if (!(this->unk_1CE & 0x200)) {
func_8013C964(&this->actor, play, 0.0f, 0.0f, EXCH_ITEM_NONE, this->unk_1CE & 7);
func_8013C964(&this->actor, play, 0.0f, 0.0f, PLAYER_AP_NONE, this->unk_1CE & 7);
}
func_80B3E460(this);
}
+1 -1
View File
@@ -517,7 +517,7 @@ void func_80A724B8(EnDno* this, PlayState* play) {
}
void func_80A7256C(EnDno* this, PlayState* play) {
func_800B8500(&this->actor, play, this->actor.xzDistToPlayer, this->actor.playerHeightRel, EXCH_ITEM_MINUS1);
func_800B8500(&this->actor, play, this->actor.xzDistToPlayer, this->actor.playerHeightRel, PLAYER_AP_MINUS1);
}
void func_80A72598(EnDno* this, PlayState* play) {
+2 -2
View File
@@ -304,7 +304,7 @@ void func_80B3D338(EnDnp* this, PlayState* play) {
} else {
this->actor.textId = 0x971;
player->actor.textId = this->actor.textId;
func_800B8500(&this->actor, play, 9999.9f, 9999.9f, EXCH_ITEM_MINUS1);
func_800B8500(&this->actor, play, 9999.9f, 9999.9f, PLAYER_AP_MINUS1);
}
}
}
@@ -409,7 +409,7 @@ void EnDnp_Update(Actor* thisx, PlayState* play) {
if ((this->unk_322 & 0x400) && !(gSaveContext.save.weekEventReg[23] & 0x20)) {
Actor_PickUp(&this->actor, play, GI_MAX, sp2C, sp28);
}
func_8013C964(&this->actor, play, sp2C, sp28, EXCH_ITEM_NONE, this->unk_322 & 7);
func_8013C964(&this->actor, play, sp2C, sp28, PLAYER_AP_NONE, this->unk_322 & 7);
Actor_SetFocus(&this->actor, 30.0f);
func_80B3CC80(this, play);
}
+1 -1
View File
@@ -456,7 +456,7 @@ void EnDnq_Update(Actor* thisx, PlayState* play) {
this->unk_394 = this->picto.actor.xzDistToPlayer;
func_80A52C6C(this, play);
func_8013C964(&this->picto.actor, play, this->unk_390, fabsf(this->picto.actor.playerHeightRel) + 1.0f,
EXCH_ITEM_NONE, this->unk_37C & 7);
PLAYER_AP_NONE, this->unk_37C & 7);
this->picto.actor.xzDistToPlayer = this->unk_394;
Actor_SetFocus(&this->picto.actor, 46.0f);
func_80A52604(this, play);
+1 -1
View File
@@ -550,7 +550,7 @@ void EnDns_Update(Actor* thisx, PlayState* play) {
func_8092C934(this);
func_8092C86C(this, play);
Actor_UpdateBgCheckInfo(play, &this->actor, 30.0f, 12.0f, 0.0f, 4);
func_8013C964(&this->actor, play, 80.0f, 40.0f, EXCH_ITEM_NONE, this->unk_2C6 & 7);
func_8013C964(&this->actor, play, 80.0f, 40.0f, PLAYER_AP_NONE, this->unk_2C6 & 7);
Actor_SetFocus(&this->actor, 34.0f);
func_8092C6FC(this, play);
func_8092C5C0(this);
+4 -4
View File
@@ -212,7 +212,7 @@ void EnFsn_HandleSetupResumeInteraction(EnFsn* this, PlayState* play) {
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play) &&
this->cutsceneState == ENFSN_CUTSCENESTATE_STOPPED) {
Actor_ProcessTalkRequest(&this->actor, &play->state);
func_800B85E0(&this->actor, play, 400.0f, EXCH_ITEM_MINUS1);
func_800B85E0(&this->actor, play, 400.0f, PLAYER_AP_MINUS1);
if (ENFSN_IS_SHOP(&this->actor)) {
this->actor.textId = 0;
}
@@ -839,7 +839,7 @@ void EnFsn_StartBuying(EnFsn* this, PlayState* play) {
this->actionFunc = EnFsn_DeterminePrice;
break;
case 0x29CF:
player->exchangeItemId = EXCH_ITEM_NONE;
player->exchangeItemId = PLAYER_AP_NONE;
this->actionFunc = EnFsn_SetupDeterminePrice;
break;
}
@@ -986,7 +986,7 @@ void EnFsn_MakeOffer(EnFsn* this, PlayState* play) {
break;
case 1:
func_8019F230();
player->exchangeItemId = EXCH_ITEM_NONE;
player->exchangeItemId = PLAYER_AP_NONE;
this->actionFunc = EnFsn_SetupDeterminePrice;
break;
}
@@ -1042,7 +1042,7 @@ void EnFsn_ResumeInteraction(EnFsn* this, PlayState* play) {
this->actionFunc = EnFsn_ConverseBackroom;
}
} else {
func_800B85E0(&this->actor, play, 400.0f, EXCH_ITEM_MINUS1);
func_800B85E0(&this->actor, play, 400.0f, PLAYER_AP_MINUS1);
}
}
+1 -1
View File
@@ -935,7 +935,7 @@ void func_80963630(EnFu* this, PlayState* play) {
player->stateFlags1 &= ~0x20;
} else {
this->actor.child->freezeTimer = 10;
func_800B85E0(&this->actor, play, 500.0f, EXCH_ITEM_MINUS1);
func_800B85E0(&this->actor, play, 500.0f, PLAYER_AP_MINUS1);
}
}

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