Skip to content
Open
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -245,4 +245,5 @@ base-hack/modelling/*.obj
*.i4
*.ia4
*.i8
*.ia8
*.ia8
batch_spoilers/
10 changes: 10 additions & 0 deletions archipelago/Logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1302,6 +1302,16 @@ def canFulfillProgHint(self, value: int) -> bool:
raise Exception("Invalid Item for progressive hints")
return self.ItemCheck(barrier_item, value)

def canUnlockHintDoor(self, level: int) -> bool:
"""Determine whether the player can unlock a hint door."""
req_item = self.settings.hint_door_item
if req_item == ProgressiveHintItem.off:
return True
barrier_item = getProgHintBarrierItem(req_item)
if barrier_item is None:
raise Exception("Invalid Item for locking hint doors")
return self.ItemCheck(barrier_item, self.settings.hint_door_item_counts_level[level])

def CanMoontail(self):
"""Determine whether the player can perform a Moontail."""
return self.moontail and self.isdiddy and self.settings.kong_model_diddy == KongModels.default # Krusha doesnt have the jump height that Diddy has
Expand Down
3 changes: 2 additions & 1 deletion base-hack/asm/functions/actor.asm
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,5 @@
.definelabel cutsceneLankyCode, 0x806C19F4
.definelabel cutsceneTinyCode, 0x806C1B50
.definelabel cutsceneChunkyCode, 0x806C1CCC
.definelabel warpActorToParent, 0x8067B238
.definelabel warpActorToParent, 0x8067B238
.definelabel pauseMenuCode, 0x806A8158
8 changes: 7 additions & 1 deletion base-hack/asm/hookcode/pause.asm
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,10 @@ ExitMapHook:
jal exitMap
addiu $a1, $zero, 1
j 0x806A8A20
nop
nop

SetBackdropColor:
lui $a1, hi(PauseBackdropRedness)
lbu $a1, lo(PauseBackdropRedness) ($a1)
j 0x806AC064
or $a2, $zero, $zero
60 changes: 30 additions & 30 deletions base-hack/asm/objects.asm
Original file line number Diff line number Diff line change
@@ -1,86 +1,86 @@
.importobj "obj/src_a.o"
.importobj "obj/src_lib_dropsanity.o"
.importobj "obj/src_f3dex2.o"
.importobj "obj/src_lib.o"
.importobj "obj/src_lib_dropsanity.o"
.importobj "obj/src_lib_items.o"
.importobj "obj/src_main.o"
.importobj "obj/src_fixes_cannon_game.o"
.importobj "obj/src_fixes_spiders.o"
.importobj "obj/src_fixes_dk_free_softlock.o"
.importobj "obj/src_fixes_guardCatch.o"
.importobj "obj/src_fixes_helm.o"
.importobj "obj/src_fixes_level_modifiers.o"
.importobj "obj/src_fixes_parent.o"
.importobj "obj/src_fixes_quality_fixes.o"
.importobj "obj/src_fixes_spiders.o"
.importobj "obj/src_fixes_helm.o"
.importobj "obj/src_fixes_guardCatch.o"
.importobj "obj/src_fixes_level_modifiers.o"
.importobj "obj/src_fixes_tag_anywhere.o"
.importobj "obj/src_initialization_stack_trace.o"
.importobj "obj/src_initialization_text.o"
.importobj "obj/src_initialization_cosmetic.o"
.importobj "obj/src_initialization_init.o"
.importobj "obj/src_initialization_item_rando.o"
.importobj "obj/src_initialization_qol.o"
.importobj "obj/src_initialization_stack_trace.o"
.importobj "obj/src_initialization_text.o"
.importobj "obj/src_instances_bananaport.o"
.importobj "obj/src_instances_boss_portal.o"
.importobj "obj/src_instances_cannon.o"
.importobj "obj/src_instances_crown_pad.o"
.importobj "obj/src_instances_instances.o"
.importobj "obj/src_instances_instance_lib.o"
.importobj "obj/src_instances_instances.o"
.importobj "obj/src_instances_melon_crate.o"
.importobj "obj/src_instances_misc_pads.o"
.importobj "obj/src_instances_switches.o"
.importobj "obj/src_item rando_text.o"
.importobj "obj/src_item rando_defs.o"
.importobj "obj/src_item rando_enemy_items.o"
.importobj "obj/src_item rando_actors.o"
.importobj "obj/src_item rando_archipelago.o"
.importobj "obj/src_item rando_collision.o"
.importobj "obj/src_item rando_defs.o"
.importobj "obj/src_item rando_enemy_items.o"
.importobj "obj/src_item rando_ice_trap.o"
.importobj "obj/src_item rando_item_fixes.o"
.importobj "obj/src_item rando_item_grab.o"
.importobj "obj/src_item rando_item_handler.o"
.importobj "obj/src_item rando_spawning.o"
.importobj "obj/src_item rando_text.o"
.importobj "obj/src_misc_bonus.o"
.importobj "obj/src_misc_exit_parser.o"
.importobj "obj/src_misc_move_hints.o"
.importobj "obj/src_misc_short_tiny.o"
.importobj "obj/src_misc_cutscene_remove.o"
.importobj "obj/src_misc_enemies.o"
.importobj "obj/src_misc_item_db.o"
.importobj "obj/src_misc_warp_to_isles.o"
.importobj "obj/src_misc_music_text.o"
.importobj "obj/src_misc_enemy_drop_table.o"
.importobj "obj/src_misc_exit_parser.o"
.importobj "obj/src_misc_shop_indicator.o"
.importobj "obj/src_misc_bonus.o"
.importobj "obj/src_misc_file_screen.o"
.importobj "obj/src_misc_hard_mode.o"
.importobj "obj/src_misc_helm_hurry.o"
.importobj "obj/src_misc_hud.o"
.importobj "obj/src_misc_item_db.o"
.importobj "obj/src_misc_krusha.o"
.importobj "obj/src_misc_move_hints.o"
.importobj "obj/src_misc_music_text.o"
.importobj "obj/src_misc_perma_kong_loss.o"
.importobj "obj/src_misc_shop_indicator.o"
.importobj "obj/src_misc_short_tiny.o"
.importobj "obj/src_misc_stats.o"
.importobj "obj/src_misc_tns_number.o"
.importobj "obj/src_misc_warp_to_isles.o"
.importobj "obj/src_misc_win_condition.o"
.importobj "obj/src_overlays_arcade.o"
.importobj "obj/src_overlays_bonus.o"
.importobj "obj/src_overlays_boss.o"
.importobj "obj/src_overlays_changes.o"
.importobj "obj/src_overlays_jetpac.o"
.importobj "obj/src_overlays_menu.o"
.importobj "obj/src_overlays_race.o"
.importobj "obj/src_overlays_arcade.o"
.importobj "obj/src_overlays_jetpac.o"
.importobj "obj/src_overlays_bonus.o"
.importobj "obj/src_overlays_boss.o"
.importobj "obj/src_pause_hint_region_list.o"
.importobj "obj/src_pause_regions.o"
.importobj "obj/src_pause_carousel.o"
.importobj "obj/src_pause_hints.o"
.importobj "obj/src_pause_hint_region_list.o"
.importobj "obj/src_pause_lib.o"
.importobj "obj/src_pause_regions.o"
.importobj "obj/src_randomizers_b_locker_requirement.o"
.importobj "obj/src_randomizers_misc_requirements.o"
.importobj "obj/src_randomizers_move_text.o"
.importobj "obj/src_randomizers_k_rool_order.o"
.importobj "obj/src_randomizers_crowd_control.o"
.importobj "obj/src_randomizers_every_lz_rando.o"
.importobj "obj/src_randomizers_k_rool_order.o"
.importobj "obj/src_randomizers_misc_requirements.o"
.importobj "obj/src_randomizers_move_rando.o"
.importobj "obj/src_randomizers_move_text.o"
.importobj "obj/src_shorteners_bonus.o"
.importobj "obj/src_shorteners_helm.o"
.importobj "obj/src_shorteners_moves.o"
.importobj "obj/src_shorteners_pre_turns.o"
.importobj "obj/src_shorteners_quality_shorteners.o"
.importobj "obj/src_shorteners_vulture.o"
.importobj "obj/src_shorteners_helm.o"
.importobj "obj/src_shorteners_moves.o"
1 change: 1 addition & 0 deletions base-hack/asm/variables/hack.asm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
.definelabel PauseText, 0x807FFFE6
.definelabel ShorterBosses, 0x807FFFE5
.definelabel ForceStandardAmmo, 0x807FFFE4
.definelabel PauseBackdropRedness, 0x807FFFE1
.definelabel KKOPhaseRandoOn, 0x807FFFE0
.definelabel MultiBunchCount, 0x807FFFDE
.definelabel QueueHelmTimer, 0x807FFFDD
Expand Down
35 changes: 18 additions & 17 deletions base-hack/include/common_structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -372,23 +372,6 @@ typedef struct ISGFadeoutData {
/* 0x005 */ char unk_05[0x3];
} ISGFadeoutData;

typedef struct SwapObjectData {
/* 0x000 */ char unk_00[0x4];
/* 0x004 */ playerData* player;
/* 0x008 */ char unk_08[0x210-0x8];
/* 0x210 */ floatPos cameraPositions[4];
/* 0x240 */ char unk_21C[0x284-0x240];
/* 0x284 */ float near;
/* 0x288 */ char unk_288[0x290-0x288];
/* 0x290 */ short chunk;
/* 0x292 */ char unk_292[0x29C-0x292];
/* 0x29C */ short action_type;
/* 0x29E */ char unk_29E[0x2C0 - 0x29E];
/* 0x2C0 */ char size;
/* 0x2C1 */ char unk_2C1[0x2E2 - 0x2C1];
/* 0x2E2 */ unsigned short unk_2e2;
} SwapObjectData;

typedef struct behaviour_data {
/* 0x000 */ void* extra_data;
/* 0x004 */ char unk_04[0x10-0x4];
Expand Down Expand Up @@ -1639,6 +1622,24 @@ typedef struct Controller {
/* 0x003 */ char stickY;
} Controller;

typedef struct SwapObjectData {
/* 0x000 */ char unk_00[0x4];
/* 0x004 */ playerData* player;
/* 0x008 */ char unk_08[0x210-0x8];
/* 0x210 */ floatPos cameraPositions[4];
/* 0x240 */ char unk_21C[0x284-0x240];
/* 0x284 */ float near;
/* 0x288 */ char unk_288[0x290-0x288];
/* 0x290 */ short chunk;
/* 0x292 */ char unk_292[0x298-0x292];
/* 0x298 */ Controller *new_inputs;
/* 0x29C */ short action_type;
/* 0x29E */ char unk_29E[0x2C0 - 0x29E];
/* 0x2C0 */ char size;
/* 0x2C1 */ char unk_2C1[0x2E2 - 0x2C1];
/* 0x2E2 */ unsigned short unk_2e2;
} SwapObjectData;

typedef struct Border {
/* 0x000 */ char player_count;
/* 0x001 */ char unk1;
Expand Down
2 changes: 2 additions & 0 deletions base-hack/include/dk64.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ extern int unkTextFunction1(int unk0, void *text, int unk2, float unk3, float un
extern int getObjectID(int index);
extern void HUDSpriteUpdate(sprite_info *sprite);
extern void PauseSpriteUpdate(sprite_info *sprite);
extern void pauseMenuCode(void);

extern void warpActorToParent(void *actor, void *parent, float scale);

Expand Down Expand Up @@ -890,6 +891,7 @@ extern unsigned char PauseText;
extern unsigned char ShorterBosses;
extern char ForceStandardAmmo;
extern char KKOPhaseRandoOn;
extern unsigned char PauseBackdropRedness;
extern unsigned short MultiBunchCount;
extern char QueueHelmTimer;
extern char ToggleAmmoOn;
Expand Down
2 changes: 2 additions & 0 deletions base-hack/include/global.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ extern void applyPaperMode(void);
extern void checkDimCache(void);

extern void resolveBonusContainer(void);
extern void handleHintScreenLockout(void);
extern void initLockout(void);

extern enemy_item_db_item *getEnemyItem(int id);
extern int getEnemyFlag(int id);
Expand Down
10 changes: 6 additions & 4 deletions base-hack/include/variable_space_structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,13 @@ typedef struct varspace {
/* 0x132 */ LZREntrance museum_to_ballroom; // Same as "aztec_beetle_enter" but for the loading zone dictated by the nametc
/* 0x134 */ char shop_indicator_on; // 0 = Off, 1 = Only kong displayed, 2 = Both item and kong
/* 0x135 */ char warp_to_isles_enabled; // 0 = Off, 1 = Add Warp to Isles option
/* 0x136 */ char unk_136[2];
/* 0x136 */ unsigned short hint_screen_lockout;
/* 0x138 */ char activate_all_bananaports; // 0 = Vanilla, 1 = Most bananaports are activated from the start
/* 0x139 */ char dpad_visual_enabled; // 0 = Vanilla, 1 = Visual shown
/* 0x13A */ char fast_warp; // 0 = Vanilla, 1 = Use Multiplayer warp
/* 0x13B */ char short_bosses; // 0 = Vanilla fights, 1 = Short fights
/* 0x13C */ char unk_13c[0x14C - 0x13C];
/* 0x13C */ unsigned short hint_door_item_requirement[7];
/* 0x14a */ char unk_14a[0x14C - 0x14A];
/* 0x14C */ unsigned char lobbies_open_bitfield; // hccf gfaj
/* 0x14D */ char perma_lose_kongs; // 0 = Off, 1 = On. AKA "iateyourpie mode"
/* 0x14E */ char unk_14E[2];
Expand Down Expand Up @@ -135,14 +136,15 @@ typedef struct varspace {
/* 0x1C6 */ RandomSwitchesSetting switchsanity; // Size 0x15
/* 0x1DB */ unsigned char fungi_time_of_day_setting; // See fungi_time enum
/* 0x1DC */ unsigned char galleon_water_raised;
/* 0x1DD */ unsigned char unk_1dd;
/* 0x1DD */ unsigned char disable_hint_screen;
/* 0x1DE */ RemovedBarriers removed_barriers; // Size: 2
/* 0x1E0 */ FasterChecks faster_checks; // Size: 1
/* 0x1E1 */ char big_head_mode; // 0 = off, 1 = on, 2 = small head
/* 0x1E2 */ BooleanModelSwaps model_swaps; // Size: 1
/* 0x1E3 */ unsigned char chunky_phase_krool_slam_req; // Slam level required for Chunky Phase
/* 0x1E4 */ unsigned char pause_hints_colored;
/* 0x1E5 */ char unk_1e5[0x1E8-0x1E5];
/* 0x1E5 */ unsigned char wrinkly_door_unlock_item;
/* 0x1E6 */ char unk_1e6[0x1E8-0x1E6];
/* 0x1E8 */ unsigned char jetman_rgb[3];
/* 0x1EB */ unsigned char mermaid_requirement; // Amount of pearls to get the mermaid reward
/* 0x1EC */ unsigned char check_shop_flags; // Bitfield of pre-given shops: rfcs 0000. r = Cranky, f = Funky, c = Candy, s = Snide
Expand Down
3 changes: 3 additions & 0 deletions base-hack/src/initialization/item_rando.c
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,9 @@ void initItemRando(void) {

// Checks Screen
pausescreenlist screen_count = PAUSESCREEN_TERMINATOR; // 4 screens vanilla + hint screen + check screen + move tracker
if (Rando.disable_hint_screen) {
screen_count--;
}
*(short*)(0x806A8672) = screen_count - 1; // Screen decrease cap
*(short*)(0x806A8646) = screen_count; // Screen increase cap

Expand Down
33 changes: 22 additions & 11 deletions base-hack/src/instances/instances.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,19 +224,30 @@ void spawnWrinklyWrapper(behaviour_data* behaviour, int index, int kong, int unk
int world = getWorld(CurrentMap, 0);
int wrinkly_index = kong + (5 * world);
int flag = FLAG_WRINKLYVIEWED + wrinkly_index;
if (Rando.hints_are_items) {
if (!checkFlag(flag, FLAGTYPE_PERMANENT)) {
item_packet *item_send = &wrinkly_item_table[wrinkly_index];
displayMedalOverlay(flag, item_send);
int locked = 0;
if (Rando.wrinkly_door_unlock_item) {
if (getItemCountReq(Rando.wrinkly_door_unlock_item) < Rando.hint_door_item_requirement[world]) {
locked = 1;
}
} else {
setPermFlag(flag);
giveItem(REQITEM_HINT, world, kong, (giveItemConfig){.apply_helm_hurry = 1});
}
if ((CurrentMap != MAP_FUNGILOBBY) || (Rando.quality_of_life.no_wrinkly_puzzles)) {
// Display hint tick
displayImageOnObject(index, 1, 2, 0);
displayImageOnObject(index, 2, 2, 0);
if (locked) {
kong = 35 - (world * 5);
textParameter = Rando.hint_door_item_requirement[world];
} else {
if (Rando.hints_are_items) {
if (!checkFlag(flag, FLAGTYPE_PERMANENT)) {
item_packet *item_send = &wrinkly_item_table[wrinkly_index];
displayMedalOverlay(flag, item_send);
}
} else {
setPermFlag(flag);
giveItem(REQITEM_HINT, world, kong, (giveItemConfig){.apply_helm_hurry = 1});
}
if ((CurrentMap != MAP_FUNGILOBBY) || (Rando.quality_of_life.no_wrinkly_puzzles)) {
// Display hint tick
displayImageOnObject(index, 1, 2, 0);
displayImageOnObject(index, 2, 2, 0);
}
}
//
spawnWrinkly(behaviour, index, kong, unk0);
Expand Down
1 change: 1 addition & 0 deletions base-hack/src/misc/file_screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -1073,6 +1073,7 @@ void startFile(void) {
determineStartKong_PermaLossMode();
giveCollectables();
}
initLockout();
initAPCounter();
resetProgressive();
updateBarrierCounts();
Expand Down
Loading
Loading