Skip to content

Commit

Permalink
Ivan the Fairy - Coop Mode (#36)
Browse files Browse the repository at this point in the history
* wip

* hookshotable ivan

* added hookshot item

* new items & changes & fixes & restored navi

* farore, din and nayru's spells are done

* fixed slingshot & bow

* added more items supported

* done with all main items

* bug fixes & ready

* added imgui button

* wip

* hookshotable ivan

* added hookshot item

* new items & changes & fixes & restored navi

* farore, din and nayru's spells are done

* fixed slingshot & bow

* added more items supported

* fix own dungeon items on shuffled boss rooms (#2683)

* bump lus (#2692)

* fix: lowercase package names for vcpkg (#2693)

vcpkg was throwing an error `error: invalid character in package name (must be lowercase, digits, '-')`
this updates our calls to `vcpkg_install_packages` to use lowercase package names instead of uppercase

* fix death mountain cloud in rando (#2691)

* Fix: Switch Age No Longer Reloads Start Room (#2679)

* [Reduced Clutter] Disable Hot/Underwater Warning Text (#2684)

* Disable Warning Text

* Moved to Reduced Clutter

* done with all main items

* bug fixes & ready

* fix: process roms in consistent order (#2696)

* chore: move rando savefile setup and document flags (#2697)

* remove rando save init from sram

* move rando savefile init logic and set more flags

* document flags for rando save creation

* Fix: Use correct fps value for frame interpolation with match refresh rate (#2694)

* Fix: Kak GS placement on construction site (#2695)

* added imgui button

* addressed kenix's comments

* fixed useless null

* added rupee dash mode in extra modes

* changed menu position

---------

Co-authored-by: Adam Bird <Archez@users.noreply.github.com>
Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>
Co-authored-by: inspectredc <78732756+inspectredc@users.noreply.github.com>
Co-authored-by: Patrick12115 <115201185+Patrick12115@users.noreply.github.com>
  • Loading branch information
5 people authored Apr 18, 2023
1 parent da22b24 commit 09d3a3c
Show file tree
Hide file tree
Showing 8 changed files with 999 additions and 12 deletions.
1 change: 1 addition & 0 deletions soh/include/tables/actor_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -481,3 +481,4 @@
/* 0x01D4 */ DEFINE_ACTOR(En_Mm2, ACTOR_EN_MM2, ALLOCTYPE_NORMAL)
/* 0x01D5 */ DEFINE_ACTOR(Bg_Jya_Block, ACTOR_BG_JYA_BLOCK, ALLOCTYPE_NORMAL)
/* 0x01D6 */ DEFINE_ACTOR(Obj_Warp2block, ACTOR_OBJ_WARP2BLOCK, ALLOCTYPE_NORMAL)
/* 0x01D7 */ DEFINE_ACTOR(En_Partner, ACTOR_EN_PARTNER, ALLOCTYPE_NORMAL)
2 changes: 2 additions & 0 deletions soh/include/z64player.h
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,8 @@ typedef struct Player {
// Upstream TODO: Rename this to make it more obvious it is apart of an enhancement
/* */ u8 boomerangQuickRecall; // Has the player pressed the boomerang button while it's in the air still?
// #endregion
u8 ivanFloating;
u8 ivanDamageMultiplier;
} Player; // size = 0xA94

#endif
31 changes: 23 additions & 8 deletions soh/soh/GameMenuBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -614,14 +614,6 @@ namespace GameMenuBar {
ImGui::EndMenu();
}

UIWidgets::Spacer(0);

UIWidgets::PaddedEnhancementCheckbox("Rupee Dash Mode", "gRupeeDash", true, false);
UIWidgets::Tooltip("Rupees reduced over time, Link suffers damage when the count hits 0.");
UIWidgets::PaddedEnhancementSliderInt("Rupee Dash Interval: %d", "##DashInterval", "gDashInterval", 3, 5, "", 5, true, true, false,
!CVarGetInteger("gRupeeDash", 0), "This option is disabled because \"Rupee Dash Mode\" is turned off");
UIWidgets::Tooltip("Interval between Rupee reduction in Rupee Dash Mode");

ImGui::EndMenu();
}

Expand Down Expand Up @@ -824,6 +816,29 @@ namespace GameMenuBar {
ImGui::EndMenu();
}

UIWidgets::Spacer(0);

if (ImGui::BeginMenu("Extra Modes")) {
UIWidgets::PaddedEnhancementCheckbox("Ivan the Fairy (Coop Mode)", "gIvanCoopModeEnabled", true, false);
UIWidgets::Tooltip("Enables Ivan the Fairy upon the next map change. Player 2 can control Ivan and "
"press the C-Buttons to use items and mess with Player 1!");

UIWidgets::Spacer(0);

UIWidgets::PaddedEnhancementCheckbox("Rupee Dash Mode", "gRupeeDash", true, false);

if (CVarGetInteger("gRupeeDash", 0)) {
UIWidgets::Tooltip("Rupees reduced over time, Link suffers damage when the count hits 0.");
UIWidgets::PaddedEnhancementSliderInt(
"Rupee Dash Interval: %d", "##DashInterval", "gDashInterval", 3, 5, "", 5, true, true, false,
!CVarGetInteger("gRupeeDash", 0),
"This option is disabled because \"Rupee Dash Mode\" is turned off");
UIWidgets::Tooltip("Interval between Rupee reduction in Rupee Dash Mode");
}

ImGui::EndMenu();
}

UIWidgets::PaddedSeparator(false, true);

// Autosave enum value of 1 is the default in presets and the old checkbox "on" state for backwards compatibility
Expand Down
4 changes: 4 additions & 0 deletions soh/src/code/z_collision_check.c
Original file line number Diff line number Diff line change
Expand Up @@ -3045,6 +3045,10 @@ void CollisionCheck_ApplyDamage(PlayState* play, CollisionCheckContext* colChkCt
if (!(collider->acFlags & AC_HARD)) {
collider->actor->colChkInfo.damage += damage;
}

if (CVarGetInteger("gIvanCoopModeEnabled", 0)) {
collider->actor->colChkInfo.damage *= GET_PLAYER(play)->ivanDamageMultiplier;
}
}

/**
Expand Down
6 changes: 6 additions & 0 deletions soh/src/code/z_play.c
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,12 @@ void Play_Init(GameState* thisx) {
DmaMgr_DmaRomToRam(0x03FEB000, D_8012D1F0, sizeof(D_801614D0));
}
#endif

if (CVarGetInteger("gIvanCoopModeEnabled", 0)) {
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_PARTNER, GET_PLAYER(play)->actor.world.pos.x,
GET_PLAYER(play)->actor.world.pos.y + Player_GetHeight(GET_PLAYER(play)) + 5.0f,
GET_PLAYER(play)->actor.world.pos.z, 0, 0, 0, 1, true);
}
}

void Play_Update(PlayState* play) {
Expand Down
Loading

0 comments on commit 09d3a3c

Please sign in to comment.