mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-26 03:12:18 -05:00
Add freeze timer hook for Gold Skulltula collection (#4445)
* Add freeze timer hook for Gold Skulltula collection * Remove unused player references * Replace magic number text IDs * Separate hook for freezing player on token collection * Revert one unintended change
This commit is contained in:
parent
17d8487730
commit
3a4bd1164a
@ -348,6 +348,7 @@ typedef enum {
|
|||||||
VB_GIVE_ITEM_FROM_ITEM_00,
|
VB_GIVE_ITEM_FROM_ITEM_00,
|
||||||
// Opt: *EnSi
|
// Opt: *EnSi
|
||||||
VB_GIVE_ITEM_SKULL_TOKEN,
|
VB_GIVE_ITEM_SKULL_TOKEN,
|
||||||
|
VB_FREEZE_ON_SKULL_TOKEN,
|
||||||
// Opt: *EnCow
|
// Opt: *EnCow
|
||||||
VB_GIVE_ITEM_FROM_COW,
|
VB_GIVE_ITEM_FROM_COW,
|
||||||
// Opt: *EnDns
|
// Opt: *EnDns
|
||||||
|
@ -529,6 +529,11 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li
|
|||||||
*should = false;
|
*should = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case VB_FREEZE_ON_SKULL_TOKEN:
|
||||||
|
if (CVarGetInteger(CVAR_ENHANCEMENT("SkulltulaFreeze"), 0)) {
|
||||||
|
*should = false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case VB_DAMPE_IN_GRAVEYARD_DESPAWN:
|
case VB_DAMPE_IN_GRAVEYARD_DESPAWN:
|
||||||
if (CVarGetInteger(CVAR_ENHANCEMENT("DampeAllNight"), 0)) {
|
if (CVarGetInteger(CVAR_ENHANCEMENT("DampeAllNight"), 0)) {
|
||||||
*should = LINK_IS_ADULT || gPlayState->sceneNum != SCENE_GRAVEYARD;
|
*should = LINK_IS_ADULT || gPlayState->sceneNum != SCENE_GRAVEYARD;
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "z_en_si.h"
|
#include "z_en_si.h"
|
||||||
|
#include "soh/Enhancements/custom-message/CustomMessageTypes.h"
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||||
|
|
||||||
#define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOOKSHOT_DRAGS)
|
#define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOOKSHOT_DRAGS)
|
||||||
@ -96,8 +97,10 @@ void func_80AFB768(EnSi* this, PlayState* play) {
|
|||||||
this->collider.base.ocFlags2 &= ~OC2_HIT_PLAYER;
|
this->collider.base.ocFlags2 &= ~OC2_HIT_PLAYER;
|
||||||
if (GameInteractor_Should(VB_GIVE_ITEM_SKULL_TOKEN, true, this)) {
|
if (GameInteractor_Should(VB_GIVE_ITEM_SKULL_TOKEN, true, this)) {
|
||||||
Item_Give(play, ITEM_SKULL_TOKEN);
|
Item_Give(play, ITEM_SKULL_TOKEN);
|
||||||
|
if (GameInteractor_Should(VB_FREEZE_ON_SKULL_TOKEN, true, this)) {
|
||||||
player->actor.freezeTimer = 10;
|
player->actor.freezeTimer = 10;
|
||||||
Message_StartTextbox(play, 0xB4, NULL);
|
}
|
||||||
|
Message_StartTextbox(play, TEXT_GS_NO_FREEZE, NULL);
|
||||||
Audio_PlayFanfare(NA_BGM_SMALL_ITEM_GET);
|
Audio_PlayFanfare(NA_BGM_SMALL_ITEM_GET);
|
||||||
}
|
}
|
||||||
this->actionFunc = func_80AFB950;
|
this->actionFunc = func_80AFB950;
|
||||||
@ -120,8 +123,10 @@ void func_80AFB89C(EnSi* this, PlayState* play) {
|
|||||||
if (!CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_HOOKSHOT_ATTACHED)) {
|
if (!CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_HOOKSHOT_ATTACHED)) {
|
||||||
if (GameInteractor_Should(VB_GIVE_ITEM_SKULL_TOKEN, true, this)) {
|
if (GameInteractor_Should(VB_GIVE_ITEM_SKULL_TOKEN, true, this)) {
|
||||||
Item_Give(play, ITEM_SKULL_TOKEN);
|
Item_Give(play, ITEM_SKULL_TOKEN);
|
||||||
|
if (GameInteractor_Should(VB_FREEZE_ON_SKULL_TOKEN, true, this)) {
|
||||||
player->actor.freezeTimer = 10;
|
player->actor.freezeTimer = 10;
|
||||||
Message_StartTextbox(play, 0xB4, NULL);
|
}
|
||||||
|
Message_StartTextbox(play, TEXT_GS_NO_FREEZE, NULL);
|
||||||
Audio_PlayFanfare(NA_BGM_SMALL_ITEM_GET);
|
Audio_PlayFanfare(NA_BGM_SMALL_ITEM_GET);
|
||||||
}
|
}
|
||||||
this->actionFunc = func_80AFB950;
|
this->actionFunc = func_80AFB950;
|
||||||
@ -131,7 +136,7 @@ void func_80AFB89C(EnSi* this, PlayState* play) {
|
|||||||
void func_80AFB950(EnSi* this, PlayState* play) {
|
void func_80AFB950(EnSi* this, PlayState* play) {
|
||||||
Player* player = GET_PLAYER(play);
|
Player* player = GET_PLAYER(play);
|
||||||
|
|
||||||
if (Message_GetState(&play->msgCtx) != TEXT_STATE_CLOSING && GameInteractor_Should(VB_GIVE_ITEM_SKULL_TOKEN, true, this)) {
|
if (Message_GetState(&play->msgCtx) != TEXT_STATE_CLOSING && GameInteractor_Should(VB_FREEZE_ON_SKULL_TOKEN, true, this)) {
|
||||||
player->actor.freezeTimer = 10;
|
player->actor.freezeTimer = 10;
|
||||||
} else {
|
} else {
|
||||||
SET_GS_FLAGS((this->actor.params & 0x1F00) >> 8, this->actor.params & 0xFF);
|
SET_GS_FLAGS((this->actor.params & 0x1F00) >> 8, this->actor.params & 0xFF);
|
||||||
|
Loading…
Reference in New Issue
Block a user