mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-22 06:13:45 -07:00
fix big fairy items
This commit is contained in:
parent
f92e885b0a
commit
2c9169afc2
1 changed files with 11 additions and 10 deletions
|
@ -67,11 +67,11 @@ FairyIdentity ShuffleFairies_GetFairyIdentity(int32_t params) {
|
||||||
return fairyIdentity;
|
return fairyIdentity;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ShuffleFairies_SpawnFairy(f32 posX, f32 posY, f32 posZ, int32_t params) {
|
static bool SpawnFairy(f32 posX, f32 posY, f32 posZ, int32_t params, FairyType fairyType) {
|
||||||
FairyIdentity fairyIdentity = ShuffleFairies_GetFairyIdentity(params);
|
FairyIdentity fairyIdentity = ShuffleFairies_GetFairyIdentity(params);
|
||||||
if (!Flags_GetRandomizerInf(fairyIdentity.randomizerInf)) {
|
if (!Flags_GetRandomizerInf(fairyIdentity.randomizerInf)) {
|
||||||
EnElf* fairy = (EnElf*)Actor_Spawn(&gPlayState->actorCtx, gPlayState, ACTOR_EN_ELF, posX, posY - 30.0f, posZ, 0,
|
EnElf* fairy = (EnElf*)Actor_Spawn(&gPlayState->actorCtx, gPlayState, ACTOR_EN_ELF, posX, posY - 30.0f, posZ, 0,
|
||||||
0, 0, FAIRY_HEAL, true);
|
0, 0, fairyType, true);
|
||||||
fairy->sohFairyIdentity = fairyIdentity;
|
fairy->sohFairyIdentity = fairyIdentity;
|
||||||
fairy->actor.draw = (ActorFunc)ShuffleFairies_DrawRandomizedItem;
|
fairy->actor.draw = (ActorFunc)ShuffleFairies_DrawRandomizedItem;
|
||||||
return true;
|
return true;
|
||||||
|
@ -97,7 +97,7 @@ void RegisterShuffleFairies() {
|
||||||
s16 grottoId = (gPlayState->sceneNum == SCENE_FAIRYS_FOUNTAIN) ? Grotto_CurrentGrotto() : 0;
|
s16 grottoId = (gPlayState->sceneNum == SCENE_FAIRYS_FOUNTAIN) ? Grotto_CurrentGrotto() : 0;
|
||||||
for (s16 index = 0; index < 8; index++) {
|
for (s16 index = 0; index < 8; index++) {
|
||||||
int32_t params = (grottoId << 8) | index;
|
int32_t params = (grottoId << 8) | index;
|
||||||
if (ShuffleFairies_SpawnFairy(actor->world.pos.x, actor->world.pos.y, actor->world.pos.z, params)) {
|
if (SpawnFairy(actor->world.pos.x, actor->world.pos.y, actor->world.pos.z, params, FAIRY_HEAL)) {
|
||||||
fairySpawned = true;
|
fairySpawned = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -112,8 +112,8 @@ void RegisterShuffleFairies() {
|
||||||
bool fairySpawned = false;
|
bool fairySpawned = false;
|
||||||
for (s16 index = 0; index < 3; index++) {
|
for (s16 index = 0; index < 3; index++) {
|
||||||
int32_t params = ((objBean->dyna.actor.params & 0x3F) << 8) | index;
|
int32_t params = ((objBean->dyna.actor.params & 0x3F) << 8) | index;
|
||||||
if (ShuffleFairies_SpawnFairy(objBean->dyna.actor.world.pos.x, objBean->dyna.actor.world.pos.y,
|
if (SpawnFairy(objBean->dyna.actor.world.pos.x, objBean->dyna.actor.world.pos.y,
|
||||||
objBean->dyna.actor.world.pos.z, params)) {
|
objBean->dyna.actor.world.pos.z, params, FAIRY_HEAL)) {
|
||||||
fairySpawned = true;
|
fairySpawned = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -125,9 +125,8 @@ void RegisterShuffleFairies() {
|
||||||
// Spawn a fairy from a ShotSun when playing the right song near it
|
// Spawn a fairy from a ShotSun when playing the right song near it
|
||||||
COND_VB_SHOULD(VB_SPAWN_SONG_FAIRY, shouldRegister, {
|
COND_VB_SHOULD(VB_SPAWN_SONG_FAIRY, shouldRegister, {
|
||||||
ShotSun* shotSun = va_arg(args, ShotSun*);
|
ShotSun* shotSun = va_arg(args, ShotSun*);
|
||||||
if (ShuffleFairies_SpawnFairy(shotSun->actor.world.pos.x, shotSun->actor.world.pos.y,
|
if (SpawnFairy(shotSun->actor.world.pos.x, shotSun->actor.world.pos.y, shotSun->actor.world.pos.z,
|
||||||
shotSun->actor.world.pos.z,
|
TWO_ACTOR_PARAMS(0x1000, (int32_t)shotSun->actor.world.pos.z), FAIRY_HEAL_BIG)) {
|
||||||
TWO_ACTOR_PARAMS(0x1000, (int32_t)shotSun->actor.world.pos.z))) {
|
|
||||||
*should = false;
|
*should = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -135,6 +134,7 @@ void RegisterShuffleFairies() {
|
||||||
// Handle playing both misc songs and song of storms in front of a gossip stone.
|
// Handle playing both misc songs and song of storms in front of a gossip stone.
|
||||||
COND_VB_SHOULD(VB_SPAWN_GOSSIP_STONE_FAIRY, shouldRegister, {
|
COND_VB_SHOULD(VB_SPAWN_GOSSIP_STONE_FAIRY, shouldRegister, {
|
||||||
EnGs* gossipStone = va_arg(args, EnGs*);
|
EnGs* gossipStone = va_arg(args, EnGs*);
|
||||||
|
FairyType fairyType = FAIRY_HEAL;
|
||||||
|
|
||||||
// Mimic vanilla behaviour, only go into this path if song played is one of the ones normally spawning a fairy.
|
// Mimic vanilla behaviour, only go into this path if song played is one of the ones normally spawning a fairy.
|
||||||
// Otherwise fall back to vanilla behaviour.
|
// Otherwise fall back to vanilla behaviour.
|
||||||
|
@ -148,6 +148,7 @@ void RegisterShuffleFairies() {
|
||||||
// Distinguish storms fairies from the normal song fairies
|
// Distinguish storms fairies from the normal song fairies
|
||||||
if (gPlayState->msgCtx.unk_E3F2 == OCARINA_SONG_STORMS) {
|
if (gPlayState->msgCtx.unk_E3F2 == OCARINA_SONG_STORMS) {
|
||||||
params |= 0x1000;
|
params |= 0x1000;
|
||||||
|
fairyType = FAIRY_HEAL_BIG;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Combine actor + song params with position to get the right randomizer check
|
// Combine actor + song params with position to get the right randomizer check
|
||||||
|
@ -160,8 +161,8 @@ void RegisterShuffleFairies() {
|
||||||
// collected, the vanilla code will handle that part automatically.
|
// collected, the vanilla code will handle that part automatically.
|
||||||
FairyIdentity fairyIdentity = ShuffleFairies_GetFairyIdentity(params);
|
FairyIdentity fairyIdentity = ShuffleFairies_GetFairyIdentity(params);
|
||||||
if (!ShuffleFairies_FairyExists(fairyIdentity)) {
|
if (!ShuffleFairies_FairyExists(fairyIdentity)) {
|
||||||
if (ShuffleFairies_SpawnFairy(gossipStone->actor.world.pos.x, gossipStone->actor.world.pos.y,
|
if (SpawnFairy(gossipStone->actor.world.pos.x, gossipStone->actor.world.pos.y,
|
||||||
gossipStone->actor.world.pos.z, params)) {
|
gossipStone->actor.world.pos.z, params, fairyType)) {
|
||||||
Audio_PlayActorSound2(&gossipStone->actor, NA_SE_EV_BUTTERFRY_TO_FAIRY);
|
Audio_PlayActorSound2(&gossipStone->actor, NA_SE_EV_BUTTERFRY_TO_FAIRY);
|
||||||
// Set vanilla check for fairy spawned so it doesn't spawn the vanilla fairy afterwards as well.
|
// Set vanilla check for fairy spawned so it doesn't spawn the vanilla fairy afterwards as well.
|
||||||
gossipStone->unk_19D = 0;
|
gossipStone->unk_19D = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue