mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-22 22:33:43 -07:00
first test of item replacement (hardcoded midos)
This commit is contained in:
parent
40f13ff2e6
commit
6e77ed57e9
1 changed files with 27 additions and 1 deletions
|
@ -383,6 +383,32 @@ void EnBox_AppearAnimation(EnBox* this, GlobalContext* globalCtx) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
KF_MIDOS_TOP_LEFT_CHEST = 22944,
|
||||||
|
KF_MIDOS_TOP_RIGHT_CHEST = 22945,
|
||||||
|
KF_MIDOS_BOTTOM_LEFT_CHEST = 22914,
|
||||||
|
KF_MIDOS_BOTTOM_RIGHT_CHEST = 22787
|
||||||
|
} AllOfTheChests;
|
||||||
|
|
||||||
|
s32 GetCustomizedItemId(s16 params) {
|
||||||
|
s32 itemId = params >> 5 & 0x7F;
|
||||||
|
switch(params) {
|
||||||
|
case KF_MIDOS_TOP_LEFT_CHEST:
|
||||||
|
itemId = GI_ARROW_LIGHT;
|
||||||
|
break;
|
||||||
|
case KF_MIDOS_TOP_RIGHT_CHEST:
|
||||||
|
itemId = GI_BEAN;
|
||||||
|
break;
|
||||||
|
case KF_MIDOS_BOTTOM_LEFT_CHEST:
|
||||||
|
itemId = GI_BOMBCHUS_20;
|
||||||
|
break;
|
||||||
|
case KF_MIDOS_BOTTOM_RIGHT_CHEST:
|
||||||
|
itemId = GI_ICE_TRAP;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return 0 - itemId;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Chest is ready to be open
|
* Chest is ready to be open
|
||||||
*/
|
*/
|
||||||
|
@ -424,7 +450,7 @@ void EnBox_WaitOpen(EnBox* this, GlobalContext* globalCtx) {
|
||||||
func_8002DBD0(&this->dyna.actor, &sp4C, &player->actor.world.pos);
|
func_8002DBD0(&this->dyna.actor, &sp4C, &player->actor.world.pos);
|
||||||
if (sp4C.z > -50.0f && sp4C.z < 0.0f && fabsf(sp4C.y) < 10.0f && fabsf(sp4C.x) < 20.0f &&
|
if (sp4C.z > -50.0f && sp4C.z < 0.0f && fabsf(sp4C.y) < 10.0f && fabsf(sp4C.x) < 20.0f &&
|
||||||
Player_IsFacingActor(&this->dyna.actor, 0x3000, globalCtx)) {
|
Player_IsFacingActor(&this->dyna.actor, 0x3000, globalCtx)) {
|
||||||
func_8002F554(&this->dyna.actor, globalCtx, 0 - (this->dyna.actor.params >> 5 & 0x7F));
|
func_8002F554(&this->dyna.actor, globalCtx, GetCustomizedItemId(this->dyna.actor.params));
|
||||||
}
|
}
|
||||||
if (Flags_GetTreasure(globalCtx, this->dyna.actor.params & 0x1F)) {
|
if (Flags_GetTreasure(globalCtx, this->dyna.actor.params & 0x1F)) {
|
||||||
EnBox_SetupAction(this, EnBox_Open);
|
EnBox_SetupAction(this, EnBox_Open);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue