Skip to content

Commit

Permalink
Randomizer v1.2 (#34)
Browse files Browse the repository at this point in the history
* push my ER stuff

* Inital commit of reading custom text from seed data.

* Patched Faron and Lanayru CS crashes. Changed skipper patch from automatic to seed-based.

* Multiple Changes

- Updated version to 1.2
- Updated skipper code to be more optimized
- Added ER code just as a framework.

* Added quick game over feature and modified item wheel menu to close on item wheel close

* Multiple changes

- Added fourth mirror shard item
- Added function definitions for shop functions
- Added function definitions for custom signs

* Multiple Changes

- Created a framework to give items to the player when they are not doing anything.
- Applied a patch to the master sword actor that adds two checks to the game.
- Added code that gives the player a check when they have defeated Stallord
- Updated various code to reflect fleshed out libtp definitions

* Remove skipper code since it is no longer needed here.

* Added another patch for MS Pedestal checks to fix giving MS.

- modified it so save warping in N Faron spawns you in central area.

* Created support for starting time of day and adjusted message headers to support simplified format

* Update ER to use state as an additonal condition.

* Start updating angles for signs.

* Clean up and update libtp references to match wii support

* Various adjustments

* Small optimization in handle_dComIfGp_setNextStage

* Make sure randomizer seed is loaded in certain functions

This is to prevent game crashes if a seed is not loaded.

* Multiple changes to event item system

- Changed the custom event item process to be a queue based system instead of a true/false. The old system assumed that the next event is always a get-item event, which is not always true.
- removed the calls to verifyProgressiveItem before adding an item to the event queue because when giving an item, the event system calls createItemForPresentDemo, which also calls verifyProgressiveItem.

* Update message flow for broken signs and adjust angle on GBoH sign. Adjusted spawn for FW sign as well

* Update KV, KGY, DMT, Ordon, SG

* Update WoCT and SoCT

* Update LH and LS

* Update HV and ZD

* Update UZR and SP

* Update GD, BC, AG, FT

* Update LBT and SPR

* Update ToT, CitS, LLC, CoO

* Update Hyrule Field signs

* Add back include

* Update all of Lake Hylia to use the proper node. Removed unnecessary check for swimming from quick transform.

* Add function to allow the red potion item to be bought.

* Keep lantern meter color vanilla when color set to default

* Minor changes

- Set Ordon Ranch to use post Faron Twilight state when not doing goats or during night stealth
- fixed bug with shop flags
- Set red potion model to only change in kak malo mart
- Updated 60 poe soul reward asm patch

* Remove unneeded info for donation text

* Update hint signs to use mStayNo to check for the current room.

* Move positions; add ToT midpoint sign

* Added patch for layer specific actors that rely on environmental checks to spawn.

* Adjust position of PoT and HC signs

* Add CT hint sign; fix Ordon sign issue

* Modify custom room actors to use event manager room to validate the room that is being loaded instead of the room we are in.

* Msg work gci

* Add patch for giving souls to jovani pre-mdh

* Remove unused code since we handle required dungeons on the generator side now.

* Added a third . to the ellipses on the foolish item message

* Add translations for first mirror shard text

* Add check specifically for Malo mart before spawning the sold out sign.

* Adjust wooden shield shop item flag

* Fix setting 20 poe souls flag when killing poes

The flag is now set when 20 poe souls have actually been collected, via the _00_handle_poeItem function.

* Fix being able to lose Poe items

This causes defeated Poes (excluding Arbiter Poes) to immediately despawn, and the item they would give is added to the queue to give to the player when they are free.

Also adjusted _00_handle_poeItem to not increment the Poe count if it is already at 60 or greater.

Also increased the amount of bytes used for queued items to 8.

* Update wooden shield model for shops and fix Kak Malo Mart shop state

* Revert "Fix setting 20 poe souls flag when killing poes"

This reverts commit 6bd200e.

* Reset giveItemToPlayer upon starting/loading a file

This is necessary because the player potentially could have died after initializing getting an item (which would set giveItemToPlayer to ITEM_IN_QUEUE), and then chosen to return to the title screen.

* Update comment to include saving

* Minor patch so that queued items show the correct model/text

* Update allowed procs for item queue. Fixed wooden shield flag check

* Update item wheel menu and fix quick transform affecting item usage

* Accounted to Ordon Shield when buying Ordon Shield check

* Add rel patch to fix MA/ZA MS check crash

* Update shop models for City

* Adjust killing poes to skip the backflip and trigger the item get immediately

* Clear reserved bytes upon reaching title screen

This is because the reserved bytes that the queue uses to store the items to give are not cleared upon starting a new file, which means that the player could soft reset during the process of being given item(s), and then start a new file to be given those items on that new file.

Also moved resetting giveItemToPlayer to QUEUE_EMPTY to resetQueueOnFileSelectScreen as well, since it makes more sense for it to be reset there alongside the reserved bytes being cleared.

* Fix issue with shield house/existing conversations messing with goats

* Fix flag check for putting midna on back if Eldin twilight is last twilight

---------

Co-authored-by: Zephiles
Co-authored-by: Isaac
  • Loading branch information
lunarsoap5 authored Aug 2, 2024
1 parent 802510d commit 0267d6a
Show file tree
Hide file tree
Showing 45 changed files with 2,451 additions and 1,290 deletions.
2 changes: 1 addition & 1 deletion GameCube/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export BUILDID:='"$(shell date +'%Y%m%d%H%M')"'

# Version
export _VERSION_MAJOR:=1
export _VERSION_MINOR:=1
export _VERSION_MINOR:=2
export _VERSION_PATCH:=0
export _VERSION:='"$(_VERSION_MAJOR).$(_VERSION_MINOR).$(_VERSION_PATCH)"'
# Variant: i.e. Public, NoLogic, Race, etc.
Expand Down
27 changes: 24 additions & 3 deletions GameCube/assets/eu.lst
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@
800428A8:defaultSkipStb
80042B04:skipper

// d_event_manager.o
80047888:getEventIdx3

// DynamicLink.o
80263460:DynamicModuleControl_ct
80263A5C:do_link
Expand All @@ -97,6 +100,10 @@
80019B50:CreateAppend
80019e40:fopAcM_create
8001bbbc:fopAcM_getTalkEventPartner
8001b68c:fopAcM_orderChangeEventId

// f_op_msg_mng.o
8001ff2c:fopMsgM_messageSet

// f_pc_node_req
803A5718:l_fpcNdRq_Queue
Expand Down Expand Up @@ -124,13 +131,13 @@
8039325C:getSeType
800c7a00:procCoMetamorphoseInit
80115E2C:checkEventRun
803DEDF4:linkStatus
800e2728:checkBootsMoveAnime
800d9148:procDamageInit
800d7e4c:checkDamageAction
801183ac:setGetItemFace
801362f8:procWolfDamageInit
8011ae34:procCoGetItem
8011a9a4:procCoGetItemInit
800d01b0:dComIfGp_setItemLifeCount
800be5f0:checkRestartRoom
8011fbf8:checkWarpStart
Expand All @@ -142,6 +149,7 @@
800c5120:procFrontRollCrashInit
8012dacc:procWolfDashReverseInit
8013cad4:procWolfAttackReverseInit
8012ddb4:procWolfAtnActorMoveInit

// data
8039038C:climbVars
Expand All @@ -152,7 +160,6 @@

//d_meter2_info.o
80432148:g_meter2_info
80432164:wZButtonPtr
8021e388:resetMiniGameItem

//d_meter2_draw.o
Expand Down Expand Up @@ -314,6 +321,7 @@
// Z2SeqMgr
802B5CB0:startBattleBgm
802ad30c:seStartLevel
802b4cac:checkBgmIDPlaying

// Z2SoundMgr.o
802AACE8:startSound
Expand Down Expand Up @@ -357,10 +365,15 @@
//d_a_shop_item_static.o
8037a178:shopItemData

//d_shop_system.o
8019a080:seq_decide_yes
8019a5ac:setSoldOutFlag

//d_menu_window.o
801fa854:collect_save_open_init

//d_msg_flow.o
8024b7dc:query001
8024bf88:query022
8024bfbc:query023
8024c018:query025
Expand All @@ -373,6 +386,8 @@
8024e11c:event041
8024d138:event017
8024c944:query049
8024a97c:doFlow
8024b0f4:setNormalMsg


//d_a_npc.o
Expand Down Expand Up @@ -456,4 +471,10 @@
8034E630:VISetNextFrameBuffer

// f_op_actor_iter.o
800198A0:fopAcIt_Judge
800198A0:fopAcIt_Judge

// d_gameover.o
8019b664:dispWait_init

// d_file_select.o
801845d8:dFile_select_c___create
27 changes: 24 additions & 3 deletions GameCube/assets/jp.lst
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@
80042778:defaultSkipStb
800429D4:skipper

// d_event_manager.o
80047758:getEventIdx3

// DynamicLink.o
80264A90:DynamicModuleControl_ct
8026508C:do_link
Expand All @@ -97,6 +100,10 @@
80019AA8:CreateAppend
80019d98:fopAcM_create
8001bb14:fopAcM_getTalkEventPartner
8001b5e4:fopAcM_orderChangeEventId

// f_op_msg_mng.o
8001fe84:fopMsgM_messageSet

// f_pc_node_req
8039DB98:l_fpcNdRq_Queue
Expand Down Expand Up @@ -125,12 +132,12 @@
800e2554:checkBootsMoveAnime
801181d8:setGetItemFace
8038badc:getSeType
803D6F94:linkStatus
80141188:mDoAud_seStartLevel
80136138:procWolfDamageInit
800d8f74:procDamageInit
801412b0:dComIfGs_isItemFirstBit
8011ac60:procCoGetItem
8011a7d0:procCoGetItemInit
800cffdc:dComIfGp_setItemLifeCount
800be41c:checkRestartRoom
8011fa24:checkWarpStart
Expand All @@ -142,6 +149,7 @@
800c4f4c:procFrontRollCrashInit
8012d90c:procWolfDashReverseInit
8013c914:procWolfAttackReverseInit
8012dbf4:procWolfAtnActorMoveInit

// data
80388C0C:climbVars
Expand Down Expand Up @@ -303,6 +311,7 @@

// Z2SeqMgr.o
802B72F0:startBattleBgm
802b62ec:checkBgmIDPlaying

// Z2SoundMgr.o
802AC328:startSound
Expand Down Expand Up @@ -360,6 +369,7 @@
802ab8d0:parseCharacter_1Byte

// d_msg_flow.o
8024caa0:query001
8024d24c:query022
8024d280:query023
8024d2dc:query025
Expand All @@ -372,6 +382,8 @@
8024f3e0:event041
8024f130:event035
8024dc08:query049
8024bc40:doFlow
8024c3b8:setNormalMsg

// d_a_npc.o
8014ca78:daNpcT_onEvtBit
Expand All @@ -387,8 +399,11 @@
// d_a_shop_item_static.o
8037b790:shopItemData

// d_shop_system.o
80199de8:seq_decide_yes
8019a314:setSoldOutFlag

// d_meter2_info.o
8042A2E4:wZButtonPtr
8042a2c8:g_meter2_info
8021e81c:resetMiniGameItem

Expand Down Expand Up @@ -451,4 +466,10 @@
8034FC60:VISetNextFrameBuffer

// f_op_actor_iter.o
800197F8:fopAcIt_Judge
800197F8:fopAcIt_Judge

// d_gameover.o
8019b3cc:dispWait_init

// d_file_select.o
80184418:dFile_select_c___create
36 changes: 33 additions & 3 deletions GameCube/assets/us.lst
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@
80042778:defaultSkipStb
800429D4:skipper

// d_event_manager.o
80047758:getEventIdx3

// DynamicLink.o
80262660:DynamicModuleControl_ct
80262C5C:do_link
Expand All @@ -97,6 +100,10 @@
80019AA8:CreateAppend
80019D98:fopAcM_create
8001bb14:fopAcM_getTalkEventPartner
8001b5e4:fopAcM_orderChangeEventId

// f_op_msg_mng.o
8001fe84:fopMsgM_messageSet

// f_pc_node_req
803A3A38:l_fpcNdRq_Queue
Expand Down Expand Up @@ -130,7 +137,6 @@
800d29d4:checkDownAttackState
800c77f4:procCoMetamorphoseInit
80115c20:checkEventRun
803DCE54:linkStatus
800e251c:checkBootsMoveAnime
80119d98:procCoTalkInit
800d8f3c:procDamageInit
Expand All @@ -139,6 +145,7 @@
801181a0:setGetItemFace
800d96dc:procCoLargeDamageInit
8011ac28:procCoGetItem
8011a798:procCoGetItemInit
800cffa4:dComIfGp_setItemLifeCount
800be3e4:checkRestartRoom
8011f9ec:checkWarpStart
Expand All @@ -150,6 +157,7 @@
800c4f14:procFrontRollCrashInit
8012d8c0:procWolfDashReverseInit
8013c8c8:procWolfAttackReverseInit
8012dba8:procWolfAtnActorMoveInit

// data
8038EB8C:climbVars
Expand Down Expand Up @@ -317,6 +325,7 @@

// Z2SeqMgr.o
802B4EB0:startBattleBgm
802b3eac:checkBgmIDPlaying

// Z2SoundMgr.o
802A9EE8:startSound
Expand All @@ -338,7 +347,6 @@

//d_meter2_info.o
80430188:g_meter2_info
804301A4:wZButtonPtr
8021e0c4:resetMiniGameItem

//d_meter2_draw.o
Expand All @@ -358,11 +366,13 @@

// d_msg_object.o
802369D8:isSend
802383d0:getMessageID

// processor.o
802A7C54:getResource_groupID

//d_msg_flow.o
8024b138:query001
8024b250:query004
8024b8e4:query022
8024b918:query023
Expand All @@ -375,6 +385,9 @@
8024da78:event041
8024bc80:query037
8024c2a0:query049
8024a2d8:doFlow
8024a528:getEventId
8024aa50:setNormalMsg

//d_menu_window.o
801fa590:collect_save_open_init
Expand All @@ -383,6 +396,7 @@
8014ca2c:daNpcT_onEvtBit
8014caac:daNpcT_chkEvtBit
80155634:daNpcF_chkEvtBit
8014a224:evtChange

//resource.o
802a9490:parseCharacter_1Byte
Expand Down Expand Up @@ -458,4 +472,20 @@
8034D7C4:VISetNextFrameBuffer

// f_op_actor_iter.o
800197F8:fopAcIt_Judge
800197F8:fopAcIt_Judge

// d_gameover.o
8019b40c:dispWait_init

// d_shop_system.o
80199e28:seq_decide_yes
801975dc:offFlag
8019a4f4:setSoldOutItemHide
8019a344:setSeq
8019a354:setSoldOutFlag

// f_pc_executor.o
8002139c:fpcEx_IsExist

// d_file_select.o
801843cc:dFile_select_c___create
2 changes: 1 addition & 1 deletion GameCube/externals/libtp_rel
Submodule libtp_rel updated 65 files
+80 −0 include/SSystem/SComponent/c_cc_d.h
+25 −0 include/SSystem/SComponent/c_m3d_g_cps.h
+25 −0 include/SSystem/SComponent/c_m3d_g_cyl.h
+24 −0 include/SSystem/SComponent/c_m3d_g_sph.h
+25 −0 include/SSystem/SComponent/c_m3d_g_tri.h
+24 −0 include/SSystem/SComponent/c_phase.h
+23 −2 include/Z2AudioLib/Z2AudioMgr.h
+1 −1 include/Z2AudioLib/Z2SceneMgr.h
+16 −5 include/Z2AudioLib/Z2SeMgr.h
+8 −0 include/Z2AudioLib/Z2SeqMgr.h
+34 −0 include/dolphin/gx/GXStruct.h
+28 −0 include/gc_wii/OSAlarm.h
+38 −0 include/gc_wii/OSContext.h
+19 −0 include/gc_wii/OSThead.h
+5 −1 include/gc_wii/OSTime.h
+125 −39 include/gc_wii/card.h
+38 −0 include/gc_wii/dsp.h
+78 −4 include/gc_wii/nand.h
+21 −0 include/gc_wii/os.h
+7 −0 include/tools.h
+2 −0 include/tp/J2DPane.h
+6 −6 include/tp/J2DTextBox.h
+68 −1 include/tp/J3DAnimation.h
+40 −0 include/tp/J3DModel.h
+46 −0 include/tp/J3DShape.h
+40 −0 include/tp/JUTNameTab.h
+7 −7 include/tp/bmgres.h
+2 −2 include/tp/control.h
+1,061 −26 include/tp/d_a_alink.h
+115 −0 include/tp/d_a_npc.h
+76 −0 include/tp/d_a_player.h
+88 −0 include/tp/d_cc_d.h
+58 −41 include/tp/d_com_inf_game.h
+3 −0 include/tp/d_event.h
+18 −0 include/tp/d_event_manager.h
+16 −0 include/tp/d_file_select.h
+41 −0 include/tp/d_gameover.h
+26 −0 include/tp/d_kankyo_data.h
+18 −3 include/tp/d_meter2.h
+33 −3 include/tp/d_meter2_draw.h
+1 −5 include/tp/d_meter2_info.h
+84 −0 include/tp/d_msg_flow.h
+18 −0 include/tp/d_msg_unit.h
+2 −2 include/tp/d_s_logo.h
+69 −38 include/tp/d_save.h
+24 −0 include/tp/d_shop_item_ctrl.h
+148 −0 include/tp/d_shop_system.h
+497 −16 include/tp/d_stage.h
+48 −17 include/tp/f_op_actor.h
+10 −0 include/tp/f_op_actor_mng.h
+25 −0 include/tp/f_pc_executor.h
+25 −0 include/tp/m_Do_graphic.h
+20 −0 include/tp/m_Do_machine.h
+5 −5 include/tp/m_do_audio.h
+26 −0 include/tp/m_do_ext.h
+8 −2 include/tp/m_do_printf.h
+44 −32 include/tp/m_re_controller_pad.h
+6 −9 include/tp/rel/d_a_obj_Lv5Key.h
+27 −0 include/tp/rel/d_a_tag_shop_item.h
+766 −760 include/tp/rel/ids.h
+42 −73 source/gc_wii/card.cpp
+15 −0 source/gc_wii/nand.cpp
+120 −9 source/tools.cpp
+28 −0 source/tp/d_com_inf_game.cpp
+16 −0 source/tp/m_do_audio.cpp
22 changes: 13 additions & 9 deletions GameCube/include/asm.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@

// Original: li 0xE0
// Normally loads the poesoul item id into r4
#define e_hp_ExecDead_liOffset 0x247C
#define e_hp_ExecDead_beqOffset 0x2440
#define e_po_ExecDead_liOffset 0x3C9C

// Original:
// stb r0, 0x10c( r4 ) = > numPoeSouls
// Normally increments poe count
#define e_hp_ExecDead_incOffset 0x2354
#define e_po_ExecDead_incOffset 0x36A8
// lis r3,dComIfG_gameInfo@h
// Normally increments poe count if not at 255
#define e_hp_ExecDead_incOffset 0x233C
#define e_po_ExecDead_incOffset 0x3690

// d_a_obj_Lv5Key__Wait_offset:
// 0xBC is offset to the text section relative to the start of the decompressed
// REL. 0x4E4 is offset to Wait function relative to the start of the text
// section (as seen on line 14 of d_a_obj_Lv5Key.map).
#define d_a_obj_Lv5Key__Wait_offset 0xBC + 0x4E4
#define d_a_obj_Lv5Key__Wait_offset (0xBC + 0x4E4)

namespace mod::assembly
{
Expand All @@ -46,9 +46,8 @@ namespace mod::assembly
void handleDoLinkHook(libtp::tp::dynamic_link::DynamicModuleControl* dmc);

// d_e_hp.rel
void asmAdjustPoeItemStart(void);
void asmAdjustPoeItemEnd(void);
int32_t handleAdjustPoeItem(void*);
void asmAdjustPoeItem(void);
void handleAdjustPoeItem(void*);

// d_e_po.rel
void asmAdjustAGPoeItemStart(void);
Expand Down Expand Up @@ -97,6 +96,11 @@ namespace mod::assembly
void asmReplaceGWolfWithItem(void);
bool handleReplaceGWolfWithItem(const int16_t* l_delFlag, void* daNpcGWolf);

// d_a_obj_master_sword.o
void asmGiveMasterSwordItemsStart();
void asmGiveMasterSwordItemsEnd();
void handleGiveMasterSwordItems();

// vi.o
void asmCallCodehandler();

Expand Down
Loading

0 comments on commit 0267d6a

Please sign in to comment.