Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/core1/sns.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ extern "C" {
// Flag set used when making a Stop 'n' Swop item visible and collectible in-game
#define SNS_UNLOCKED (1)

/* Which call site raised VB_OVERRIDE_SNS_MAP_CHECK. The pickup site awards the
/* Which call site raised VB_RUN_SNS_MAP_CHECK. The pickup site awards the
item; the spawn site only decides whether the egg actor is drawn. */
#define SNS_MAP_CHECK_PICKUP (0)
#define SNS_MAP_CHECK_SPAWN (1)
Expand Down
4 changes: 2 additions & 2 deletions src/SM/ch/smbottles.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ static void __chSmBottles_textActions(ActorMarker *marker, enum asset_e text_id,
void __chSmBottles_textCallback(ActorMarker *marker, enum asset_e text_id, s32 arg2) {
Actor *actor = marker_getActor(marker);

if (!EventSystem_Should(VB_OVERRIDE_BOTTLES_TEXT_CALLBACK, false, actor)) {
if (EventSystem_Should(VB_RUN_BOTTLES_TEXT_CALLBACK, true, actor)) {
if (!mapSpecificFlags_get(SM_SPECIFIC_FLAG_3_ALL_SM_ABILITIES_LEARNED) && chmole_learnedAllSpiralMountainAbilities()) {
mapSpecificFlags_set(SM_SPECIFIC_FLAG_3_ALL_SM_ABILITIES_LEARNED, true);
gcdialog_showDialog(ASSET_E12_DIALOG_BOTTLES_LEARNED_TUTORIAL_MOVES, 0xe, actor->position, actor->marker, __chSmBottles_textCallback, NULL);
Expand Down Expand Up @@ -338,7 +338,7 @@ void __chSmBottles_talk(Actor *this) {
text_flags = 0xe;
text_id = 0;

if (!EventSystem_Should(VB_OVERRIDE_MOLEHILL_ABILITY, false, this, &text_id, &text_flags)) {
if (EventSystem_Should(VB_TEACH_MOLEHILL_ABILITY, true, this, &text_id, &text_flags)) {
switch (this->actorTypeSpecificField) {
case CH_SM_MOLE_ID_1_INTRO://L8038965C
if (mapSpecificFlags_get(SM_SPECIFIC_FLAG_1_TALKED_TO_BOTTLES)) {
Expand Down
2 changes: 1 addition & 1 deletion src/core2/actor_cubepropsystem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,7 @@ void code7AF80_initCubeFromFile(File *file_ptr, Cube *cube) {
if (!(flags & 1) && !((flags >> 1) & 1)) {
propSpriteAsset = ((s32)((word0 >> 20) & 0xFFF)) + 0x572;
}
if (!EventSystem_Should(VB_OVERRIDE_PROP_SPAWN, false, pos, propSpriteAsset)) {
if (EventSystem_Should(VB_SPAWN_PROP, true, pos, propSpriteAsset)) {
// Extract flag bits using N64 BE bit positions within the u16
{
bool mf = flags & 1; // markerFlag (BE bit 0)
Expand Down
2 changes: 1 addition & 1 deletion src/core2/ba/marker.c
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ void __baMarker_resolveCollision(Prop *other_prop){

case MARKER_169_SNS_EGG: //L8028C908
{ //ONLY THIS CASE DOESN'T MATCH
if (!EventSystem_Should(VB_OVERRIDE_SNS_MAP_CHECK, false, SNS_MAP_CHECK_PICKUP, actor)) {
if (EventSystem_Should(VB_RUN_SNS_MAP_CHECK, true, SNS_MAP_CHECK_PICKUP, actor)) {
switch (gsworld_getMap())
{
case MAP_1D_MMM_CELLAR: //L8028C95C
Expand Down
2 changes: 1 addition & 1 deletion src/core2/bundle.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ Actor *__bundle_spawnWithFirstActor(enum bundle_e bundle_id, f32 position[3], Ac
}

//L802C9114
if (!EventSystem_Should(VB_OVERRIDE_BUNDLE_SPAWN, false, bundle_id, bundle_info, i, position, &actor)) {
if (EventSystem_Should(VB_SPAWN_BUNDLE_ACTOR, true, bundle_id, bundle_info, i, position, &actor)) {
actor = (i == 0 && firstActor) ? firstActor : actor_spawnWithYaw_f32(bundle_info->actor_id, position, 0);
//}
// [port] Suppressed spawn: a cancelled OnActorSpawn returns the listener's actor,
Expand Down
2 changes: 1 addition & 1 deletion src/core2/ch/mole.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ int chmole_learnAbility(Actor *this){
s32 teach_text_id;
s32 sp28 = 0xe;
// [port] Rando hands out its own item here, whether or not the vanilla move is known.
if (!EventSystem_Should(VB_OVERRIDE_MOLEHILL_ABILITY, false, this, &teach_text_id, &sp28)) {
if (EventSystem_Should(VB_TEACH_MOLEHILL_ABILITY, true, this, &teach_text_id, &sp28)) {
// Known Ability: Refresher Dialog
if(player_isAbilityUnlocked(moleTable[this->actorTypeSpecificField - MOLE_ID_TO_TABLE_SHIFT].ability)){
sp28 = 0xf;
Expand Down
2 changes: 1 addition & 1 deletion src/core2/fx/effect_jiggy_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ void jiggy_spawn(enum jiggy_e jiggy_id, f32 pos[3]) {
Struct_core2_ABC00_0 *temp_v0;

jiggy_id = ((jiggy_id <= 0) || (jiggy_id >= (s_jiggyList_level_jiggy_count * 10))) ? JIGGY_A_MM_CONGA : jiggy_id;
if (!EventSystem_Should(VB_OVERRIDE_JIGGY_SPAWN, false, jiggy_id, pos)) {
if (EventSystem_Should(VB_SPAWN_JIGGY, true, jiggy_id, pos)) {
temp_v0 = &jiggylist_list[jiggy_id - 1];
if (jiggylist_list[jiggy_id - 1].unk10.marker == NULL) {
temp_v0->unk10.position[0] = pos[0];
Expand Down
6 changes: 2 additions & 4 deletions src/core2/gc/dialog.c
Original file line number Diff line number Diff line change
Expand Up @@ -949,13 +949,11 @@ int gcdialog_showDialogConditional(s32 text_id, s32 arg1, f32 *pos, ActorMarker
f32 pad;
s32 temp_v1;

if (volatileFlag_get(VOLATILE_FLAG_1) || func_802D686C()) {
// if (volatileFlag_get(VOLATILE_FLAG_1) || func_802D686C()) {
if (EventSystem_Should(VB_REFUSE_DIALOG, volatileFlag_get(VOLATILE_FLAG_1) || func_802D686C(), text_id)) {
return 0;
}

if(EventSystem_Should(VB_OVERRIDE_DIALOG_SHOW, false, text_id))
return 0;

if (!gcdialog_hasCurrentTextId()) {
func_80310B1C(text_id, arg1, marker, (void *)callback, (void *)arg5, arg6);
if (arg1 & 8) {
Expand Down
2 changes: 1 addition & 1 deletion src/core2/quiz/game.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ void chSnsEgg_update(Actor *this){
if(!this->initialized){
this->initialized = true;
func_802D3CE8(this);
if (!EventSystem_Should(VB_OVERRIDE_SNS_MAP_CHECK, false, SNS_MAP_CHECK_SPAWN, this)) {
if (EventSystem_Should(VB_RUN_SNS_MAP_CHECK, true, SNS_MAP_CHECK_SPAWN, this)) {
switch (gsworld_getMap()) {
case MAP_1D_MMM_CELLAR: //L802D4058
if (sns_get_item_state(SNS_ITEM_EGG_CYAN, 1) && !sns_get_item_state(SNS_ITEM_EGG_CYAN, 0)) {
Expand Down
2 changes: 1 addition & 1 deletion src/core2/timedfuncqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ void func_80324D54(f32 time, enum sfx_e sfx_id, f32 arg2, s32 arg3, f32 position
}

void func_80324DBC(f32 time, enum asset_e text_id, s32 arg2, f32 position[3], ActorMarker *caller, void (*callback_method_1)(ActorMarker *, enum asset_e, s32), void (*callback_method_2)(ActorMarker *, enum asset_e, s32)) {
if (!EventSystem_Should(VB_OVERRIDE_TIMED_DIALOGUE, false, text_id)) {
if (EventSystem_Should(VB_QUEUE_TIMED_DIALOG, true, text_id)) {
DelayedTextCallback sp20;
s32 pad;

Expand Down
48 changes: 24 additions & 24 deletions src/port/Enhancements/Events/Hooks/Events.h
Original file line number Diff line number Diff line change
Expand Up @@ -418,35 +418,35 @@ typedef enum VBehaviorID {

// Rando object behavior

// A listener that returns true skips Bottles' text callback in Spiral Mountain.
// A listener that returns false skips Bottles' text callback in Spiral Mountain.
// #### `result`
// ```c
// false
// true
// ```
// #### `args`
// - `*Actor` (Bottles)
VB_OVERRIDE_BOTTLES_TEXT_CALLBACK,
VB_RUN_BOTTLES_TEXT_CALLBACK,

// A listener that returns true skips Bottles' lesson and has to set the text id and flags he shows.
// A listener that returns false skips Bottles' lesson and has to set the text id and flags he shows.
// #### `result`
// ```c
// false
// true
// ```
// #### `args`
// - `*Actor` (Bottles)
// - `*s32` (the text id)
// - `*s32` (the text flags)
VB_OVERRIDE_MOLEHILL_ABILITY,
VB_TEACH_MOLEHILL_ABILITY,

// A listener that returns true skips the jiggy's spawn.
// A listener that returns false skips the jiggy's spawn.
// #### `result`
// ```c
// false
// true
// ```
// #### `args`
// - `s32` (jiggy_e)
// - `*f32` (the position)
VB_OVERRIDE_JIGGY_SPAWN,
VB_SPAWN_JIGGY,

// A witch switch jiggy's jingle in the lair, whose track a listener may change. The result is unused.
// #### `result`
Expand All @@ -469,15 +469,15 @@ typedef enum VBehaviorID {
// - `*f32` (the position)
VB_CC_TOOTH_PLACE_JIGGY,

// A listener that returns true leaves the prop out as its cube loads.
// A listener that returns false leaves the prop out as its cube loads.
// #### `result`
// ```c
// false
// true
// ```
// #### `args`
// - `*s16` (the position)
// - `s32` (enum asset_e, the sprite; -1 for a marker or model prop)
VB_OVERRIDE_PROP_SPAWN,
VB_SPAWN_PROP,

// A spawned actor taking its prop's secondary id, selector and scale.
// #### `result`
Expand All @@ -488,18 +488,18 @@ typedef enum VBehaviorID {
// - `*Actor` (the actor)
VB_APPLY_CUBE_PROP_DATA,

// A listener that returns true skips spawning one of a bundle's actors, and can hand back one it spawned instead.
// A listener that returns false skips spawning one of a bundle's actors, and can hand back one it spawned instead.
// #### `result`
// ```c
// false
// true
// ```
// #### `args`
// - `s32` (bundle_e)
// - `*BundleInfo`
// - `s32` (the actor's index in the bundle)
// - `*f32` (the position)
// - `**Actor` (the actor)
VB_OVERRIDE_BUNDLE_SPAWN,
VB_SPAWN_BUNDLE_ACTOR,

// A listener that returns true skips giving a jiggy list spawn its slot and jiggy id.
// #### `result`
Expand All @@ -518,25 +518,25 @@ typedef enum VBehaviorID {
// - None
VB_NAPPER_SET_JIGGY_POSITION,

// A listener that returns true skips a Stop 'N' Swop egg's map check, which marks the map's egg collected at pickup
// and can despawn the egg at spawn.
// A listener that returns false skips a Stop 'N' Swop egg's map check, which marks the map's egg collected at
// pickup and can despawn the egg at spawn.
// #### `result`
// ```c
// false
// true
// ```
// #### `args`
// - `s32` (SNS_MAP_CHECK_PICKUP or SNS_MAP_CHECK_SPAWN)
// - `*Actor` (the egg)
VB_OVERRIDE_SNS_MAP_CHECK,
VB_RUN_SNS_MAP_CHECK,

// A listener that returns true keeps a delayed dialog from showing.
// A listener that returns false keeps a delayed dialog from showing.
// #### `result`
// ```c
// false
// true
// ```
// #### `args`
// - `s32` (the text id)
VB_OVERRIDE_TIMED_DIALOGUE,
VB_QUEUE_TIMED_DIALOG,

// A listener that returns true skips counting a collected jinjo and OnJinjoCollected.
// #### `result`
Expand Down Expand Up @@ -590,11 +590,11 @@ typedef enum VBehaviorID {
// A listener that returns true keeps a dialog from showing.
// #### `result`
// ```c
// false
// volatileFlag_get(VOLATILE_FLAG_1) || func_802D686C()
// ```
// #### `args`
// - `s32` (the text id)
VB_OVERRIDE_DIALOG_SHOW,
VB_REFUSE_DIALOG,

// Rendering and performance

Expand Down
4 changes: 2 additions & 2 deletions src/port/Enhancements/Fixes/GameFixes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,9 @@ void RegisterChimpySoftlock_Init() {
}
});

REGISTER_VB_SHOULD(VB_OVERRIDE_JIGGY_SPAWN, EVENT_PRIORITY_LOW, {
REGISTER_VB_SHOULD(VB_SPAWN_JIGGY, EVENT_PRIORITY_LOW, {
if (va_arg(args, int) == JIGGY_9_MM_CHIMPY && jiggyscore_isCollected(JIGGY_9_MM_CHIMPY)) {
*should = true;
*should = false;
}
});
}
Expand Down
8 changes: 4 additions & 4 deletions src/port/Enhancements/Retention/ConsumableRetention.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ static bool isConsumableActor(s32 actorId) {
static bool sSpawningDrop = false;

static void RegisterConsumableRetention_Init() {
COND_VB_SHOULD(VB_OVERRIDE_PROP_SPAWN, EVENT_PRIORITY_NORMAL, CVAR_VALUE, {
COND_VB_SHOULD(VB_SPAWN_PROP, EVENT_PRIORITY_NORMAL, CVAR_VALUE, {
s16* position = va_arg(args, s16*);
s32 spriteAsset = va_arg(args, s32);
if (systemActive() && isConsumableSprite(spriteAsset) &&
isCollected(pickupAt(position[0], position[1], position[2]))) {
*should = true;
*should = false;
}
});

Expand All @@ -102,7 +102,7 @@ static void RegisterConsumableRetention_Init() {
});

// Always on: every consumable bundle drop spawns here (see DropLocal).
COND_VB_SHOULD(VB_OVERRIDE_BUNDLE_SPAWN, EVENT_PRIORITY_NORMAL, true, {
COND_VB_SHOULD(VB_SPAWN_BUNDLE_ACTOR, EVENT_PRIORITY_NORMAL, true, {
bundle_e bundleId = (bundle_e)va_arg(args, int);
BundleInfo* bundleInfo = va_arg(args, BundleInfo*);
s32 index = va_arg(args, s32);
Expand All @@ -112,7 +112,7 @@ static void RegisterConsumableRetention_Init() {
if (!systemActive() || !isConsumableActor(bundleInfo->actor_id)) {
return;
}
*should = true;
*should = false;

const bool hutDrop = bundleId == BUNDLE_1_MM_HUT_BLUE_EGG || bundleId == BUNDLE_6_MM_HUT_EXTRA_LIFE;
const ConsumablePickup pickup = pickupAt(position[0], position[1], position[2], index + 1);
Expand Down
4 changes: 2 additions & 2 deletions src/port/Enhancements/Retention/JinjoRetention.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ void RegisterJinjoRetention_Init() {
event->Cancelled = true;
});

COND_VB_SHOULD(VB_OVERRIDE_BUNDLE_SPAWN, EVENT_PRIORITY_NORMAL, CVAR_VALUE, {
COND_VB_SHOULD(VB_SPAWN_BUNDLE_ACTOR, EVENT_PRIORITY_NORMAL, CVAR_VALUE, {
(void)va_arg(args, int);
BundleInfo* bundleInfo = va_arg(args, BundleInfo*);
(void)va_arg(args, s32);
Expand All @@ -253,7 +253,7 @@ void RegisterJinjoRetention_Init() {
if (!retentionActiveForLevel(level) || !(collectedBits(level) & bit)) {
return;
}
*should = true;
*should = false;
});
}

Expand Down
10 changes: 5 additions & 5 deletions src/port/Enhancements/Retention/NoteRetention.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ extern "C" void NoteRetention_SetForced(int32_t forced) {

void RegisterNoteRetention_Init() {
// Bundle notes continue the map's index counter; identity stored in actor->local.
COND_VB_SHOULD(VB_OVERRIDE_BUNDLE_SPAWN, EVENT_PRIORITY_NORMAL, true, {
COND_VB_SHOULD(VB_SPAWN_BUNDLE_ACTOR, EVENT_PRIORITY_NORMAL, true, {
bundle_e bundleId = (bundle_e)va_arg(args, int);
BundleInfo* bundleInfo = va_arg(args, BundleInfo*);
va_arg(args, s32); // index within the bundle (unused)
Expand All @@ -303,7 +303,7 @@ void RegisterNoteRetention_Init() {
}

// We own this note: suppress the vanilla bundle spawn.
*should = true;
*should = false;

int64_t key = noteKey(mapId, noteIndex);
if (activeNoteSet.count(key)) {
Expand Down Expand Up @@ -360,7 +360,7 @@ void RegisterNoteRetention_Init() {
});

// Seeding ITEM_C_NOTE re-triggers vanilla high-score dialogs; suppress them.
COND_VB_SHOULD(VB_OVERRIDE_DIALOG_SHOW, EVENT_PRIORITY_NORMAL, true, {
COND_VB_SHOULD(VB_REFUSE_DIALOG, EVENT_PRIORITY_NORMAL, true, {
s32 textId = va_arg(args, s32);
// Bottles' 50-note-door line assumes vanilla note-door costs, which
// romhacks retune, so it is wrong for them whether or not retention is
Expand Down Expand Up @@ -408,7 +408,7 @@ static void RegisterRetentionSaving_Init() {
event->Cancelled = true;
});

COND_VB_SHOULD(VB_OVERRIDE_PROP_SPAWN, EVENT_PRIORITY_NORMAL, true, {
COND_VB_SHOULD(VB_SPAWN_PROP, EVENT_PRIORITY_NORMAL, true, {
s16* spawnPosition = va_arg(args, s16*);
s32 spriteAsset = va_arg(args, s32);

Expand All @@ -428,7 +428,7 @@ static void RegisterRetentionSaving_Init() {
}

// We own this note: suppress the static sprite prop.
*should = true;
*should = false;

if (activeNoteSet.count(noteKey(mapId, noteIndex))) {
return; // a live actor already exists (re-parse)
Expand Down
8 changes: 4 additions & 4 deletions src/port/Rando/ObjectBehavior/Bundle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void Rando::ObjectBehavior::InitBundleBehavior() {
}
})

COND_VB_SHOULD(VB_OVERRIDE_BUNDLE_SPAWN, EVENT_PRIORITY_NORMAL, IS_RANDO, {
COND_VB_SHOULD(VB_SPAWN_BUNDLE_ACTOR, EVENT_PRIORITY_NORMAL, IS_RANDO, {
bundle_e bundleId = (bundle_e)va_arg(args, int);
BundleInfo* bundleInfo = va_arg(args, BundleInfo*);
s32 bundleCount = va_arg(args, s32);
Expand All @@ -61,7 +61,7 @@ void Rando::ObjectBehavior::InitBundleBehavior() {
if (bundleId == BUNDLE_16__HONEYCOMB &&
(currentMap == MAP_43_CCW_SPRING || currentMap == MAP_B_CC_CLANKERS_CAVERN)) {
if (CheckEnemyOverlapPosition(spawnPosition)) {
*should = false;
*should = true;
return;
}
}
Expand Down Expand Up @@ -282,7 +282,7 @@ void Rando::ObjectBehavior::InitBundleBehavior() {
*actor = CustomObject::ShouldCreateCustomActorEX(randoCheckId, spawnPosition, false);

if (*actor == NULL) {
*should = true;
*should = false;
return;
}

Expand All @@ -293,6 +293,6 @@ void Rando::ObjectBehavior::InitBundleBehavior() {
}
}

*should = true;
*should = false;
})
}
4 changes: 2 additions & 2 deletions src/port/Rando/ObjectBehavior/Jiggy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void Rando::ObjectBehavior::InitJiggyBehavior() {
}
})

COND_VB_SHOULD(VB_OVERRIDE_JIGGY_SPAWN, EVENT_PRIORITY_NORMAL, true, {
COND_VB_SHOULD(VB_SPAWN_JIGGY, EVENT_PRIORITY_NORMAL, true, {
jiggy_e jiggyId = (jiggy_e)va_arg(args, int);
f32* position = va_arg(args, f32*);

Expand Down Expand Up @@ -99,7 +99,7 @@ void Rando::ObjectBehavior::InitJiggyBehavior() {
// Stand in for the jiggyscore_setSpawned this override skips, for the
// jiggies the world reads back as state rather than as a collectable.
MarkWorldStateFromJiggySpawn(randoCheckId);
*should = true;
*should = false;
})

// If Banjo isn't near the jiggy when it's first rewarded, the tooth asks for it every frame.
Expand Down
Loading
Loading