diff options
| author | David Chavez <david@dcvz.io> | 2022-09-28 04:41:17 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-27 22:41:17 -0400 |
| commit | 083ceb44239b9a26648e0059ca9ce2ad551424a0 (patch) | |
| tree | 988f0a5ca0b3360eac4ae7bb79b20ca32b5c89b4 /soh/src/code | |
| parent | 87125ae334a537f7c28d3ab319b61697e4454b2a (diff) | |
Feature: Crowd Control Integration (#1568)
* Start effects
* Disable input to game when typing in console
* Add gravity support
* noUI placeholder
* Add rest of effects to console
* Remove z_play code
* Add rupee modification
* Add OneHit KO (#27)
* few fix and paper Link
* Better method and now use the reset flag
* Revert "Better method and now use the reset flag"
This reverts commit 2aafcc1df29686940945ebab87372360a06a3cf7.
* Revert "few fix and paper Link"
This reverts commit 65e76dcfeec3924ca9977c931703b4c3232a9733.
* Paper Link & few fixes (#28)
* Implement pacifist mode (#30)
* Implement cucco storm (#31)
* Add no UI functionality (#32)
* Enable CrowdControl on windows (#33)
* Use std::format and implement wallmaster
* Implement defense modifier
* Implement no_z and clean up
* Implement reverse controls
* Some fixes while testing CC connection
* Implement speed modifier and fix defese modifier
* Fail magic effects if magic is not acquired
* Fix queue system
* Implement rainstorm
* Some cleanup
* Use IS_ZERO to handle very low near zero values
* Split some effects
* Fix emptying magic
* Don’t run cucco on pre-rendered backgrounds
* Use correct method for updating ruppees
* Fix decreasing speed
* Remove old SDL stuff
* Remove old fixes
* Enable Crowd Control for both debug and release
* Add missing returns
* Cleanup event firing
* Further clean up on event firing
* Fix some bugs
* CC fixes and enemy spawning (#35)
* Fix icetraps
* Fix title screen
* Fix pause screen
* Fix death screen timer & Code cleanup
* Fix timer during textboxes
* Code cleanup
* Add: Multiple enemy spawning
* More enemies + more code cleanup (#36)
* Enums for returning effect states
* Add more enemies
* Update CrowdControl.cpp
* Remove enums from enemies
* Fix up flow for events (#37)
# Conflicts:
# soh/soh/Enhancements/crowd-control/CrowdControl.cpp
* Fix spawn position of likelike
* CC temp enemy fixes (#38)
* Check for pause in pacifist and allow button presses (#39)
* Fix Pacifist mode (#41)
* First attempt pacifier fix
* Real fix for pacifist mode
* Comment
* Remove cutscene and long delay from cucco_storm (#40)
* Some PR Fixes
* Use standard types
* Handle JSON parsing error and free memory
* Add CC configuration file
* Add: Giving deku shield option. Fix: Giant Lonk (#42)
* Small stalfos fix (#43)
* Syntax Improvements (#44)
* Revert bools to uint32_t
* Add comment about bools
* Fix cucco storm, fix empty heart (#45)
* Protect commands vector with mutex
* prefix effects with chaosEffect (#46)
Co-authored-by: briaguya <briaguya@alice>
Co-authored-by: Baoulettes <perlouzerie@hotmail.fr>
Co-authored-by: aMannus <mannusmenting@gmail.com>
Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>
Co-authored-by: briaguya <briaguya@alice>
Diffstat (limited to 'soh/src/code')
| -rw-r--r-- | soh/src/code/padmgr.c | 21 | ||||
| -rw-r--r-- | soh/src/code/z_parameter.c | 35 | ||||
| -rw-r--r-- | soh/src/code/z_play.c | 6 | ||||
| -rw-r--r-- | soh/src/code/z_player_lib.c | 7 |
4 files changed, 67 insertions, 2 deletions
diff --git a/soh/src/code/padmgr.c b/soh/src/code/padmgr.c index 98b97dc71..e7f8bcf14 100644 --- a/soh/src/code/padmgr.c +++ b/soh/src/code/padmgr.c @@ -1,6 +1,8 @@ #include "global.h" #include "vt.h" +#include "soh/Enhancements/debugconsole.h" + //#include <string.h> #ifdef _MSC_VER @@ -226,6 +228,25 @@ void PadMgr_ProcessInputs(PadMgr* padMgr) { switch (padnow1->err_no) { case 0: input->cur = *padnow1; + + if (chaosEffectNoZ) { + input->cur.button &= ~(BTN_Z); + } + + if (chaosEffectReverseControls) { + if (input->cur.stick_x == -128) { + input->cur.stick_x = 127; + } else { + input->cur.stick_x *= -1; + } + + if (input->cur.stick_y == -128) { + input->cur.stick_y = 127; + } else { + input->cur.stick_y *= -1; + } + } + if (!padMgr->ctrlrIsConnected[i]) { padMgr->ctrlrIsConnected[i] = true; osSyncPrintf(VT_FGCOL(YELLOW)); diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index eb6640d09..f87ba7a25 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -11,6 +11,8 @@ #include <assert.h> #endif +#include "soh/Enhancements/debugconsole.h" + static uint16_t _doActionTexWidth, _doActionTexHeight = -1; static uint16_t DO_ACTION_TEX_WIDTH() { @@ -935,7 +937,11 @@ void func_80083108(GlobalContext* globalCtx) { Interface_ChangeAlpha(50); } } else if (msgCtx->msgMode == MSGMODE_NONE) { - if ((func_8008F2F8(globalCtx) >= 2) && (func_8008F2F8(globalCtx) < 5)) { + if (chaosEffectPacifistMode) { + gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = + gSaveContext.buttonStatus[3] = gSaveContext.buttonStatus[5] = gSaveContext.buttonStatus[6] = + gSaveContext.buttonStatus[7] = gSaveContext.buttonStatus[8] = BTN_DISABLED; + } else if ((func_8008F2F8(globalCtx) >= 2) && (func_8008F2F8(globalCtx) < 5)) { if (gSaveContext.buttonStatus[0] != BTN_DISABLED) { sp28 = 1; } @@ -2913,6 +2919,15 @@ s32 Health_ChangeBy(GlobalContext* globalCtx, s16 healthChange) { osSyncPrintf("***** 増減=%d (now=%d, max=%d) ***", healthChange, gSaveContext.health, gSaveContext.healthCapacity); + // If one-hit ko mode is on, any damage kills you and you cannot gain health. + if (chaosEffectOneHitKO) { + if (healthChange < 0) { + gSaveContext.health = 0; + } + + return 0; + } + // clang-format off if (healthChange > 0) { Audio_PlaySoundGeneral(NA_SE_SY_HP_RECOVER, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); @@ -2922,6 +2937,14 @@ s32 Health_ChangeBy(GlobalContext* globalCtx, s16 healthChange) { } // clang-format on + if (chaosEffectDefenseModifier != 0 && healthChange < 0) { + if (chaosEffectDefenseModifier > 0) { + healthChange /= chaosEffectDefenseModifier; + } else { + healthChange *= abs(chaosEffectDefenseModifier); + } + } + gSaveContext.health += healthChange; if (gSaveContext.health > gSaveContext.healthCapacity) { @@ -2956,6 +2979,10 @@ void Health_GiveHearts(s16 hearts) { gSaveContext.healthCapacity += hearts * 0x10; } +void Health_RemoveHearts(s16 hearts) { + gSaveContext.healthCapacity -= hearts * 0x10; +} + void Rupees_ChangeBy(s16 rupeeChange) { gSaveContext.rupeeAccumulator += rupeeChange; } @@ -3022,7 +3049,7 @@ void Inventory_ChangeAmmo(s16 item, s16 ammoChange) { void Magic_Fill(GlobalContext* globalCtx) { if (gSaveContext.magicAcquired) { gSaveContext.unk_13F2 = gSaveContext.unk_13F0; - gSaveContext.unk_13F6 = (gSaveContext.doubleMagic * 0x30) + 0x30; + gSaveContext.unk_13F6 = (gSaveContext.doubleMagic + 1) * 0x30; gSaveContext.unk_13F0 = 9; } } @@ -4739,6 +4766,10 @@ void Interface_Draw(GlobalContext* globalCtx) { s16 svar6; bool fullUi = !CVar_GetS32("gMinimalUI", 0) || !R_MINIMAP_DISABLED || globalCtx->pauseCtx.state != 0; + if (chaosEffectNoUI) { + return; + } + OPEN_DISPS(globalCtx->state.gfxCtx); // Invalidate Do Action textures as they may have changed diff --git a/soh/src/code/z_play.c b/soh/src/code/z_play.c index 4dfd66e3f..f25163c5e 100644 --- a/soh/src/code/z_play.c +++ b/soh/src/code/z_play.c @@ -6,6 +6,8 @@ #include "soh/Enhancements/gameconsole.h" #include <libultraship/ImGuiImpl.h> #include "soh/frame_interpolation.h" +#include "soh/Enhancements/debugconsole.h" +#include <overlays/actors/ovl_En_Niw/z_en_niw.h> #include <time.h> @@ -1544,6 +1546,10 @@ void Gameplay_Main(GameState* thisx) { } +u8 PlayerGrounded(Player* player) { + return player->actor.bgCheckFlags & 1; +} + // original name: "Game_play_demo_mode_check" s32 Gameplay_InCsMode(GlobalContext* globalCtx) { return (globalCtx->csCtx.state != CS_STATE_IDLE) || Player_InCsMode(globalCtx); diff --git a/soh/src/code/z_player_lib.c b/soh/src/code/z_player_lib.c index 522e7d851..4fa0542fc 100644 --- a/soh/src/code/z_player_lib.c +++ b/soh/src/code/z_player_lib.c @@ -5,6 +5,8 @@ #include "objects/object_triforce_spot/object_triforce_spot.h" #include "overlays/actors/ovl_Demo_Effect/z_demo_effect.h" +#include "soh/Enhancements/debugconsole.h" + typedef struct { /* 0x00 */ u8 flag; /* 0x02 */ u16 textId; @@ -1037,6 +1039,11 @@ s32 func_80090014(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* p } } + if (chaosEffectInvisibleLink) { + this->actor.shape.shadowDraw = NULL; + *dList = NULL; + } + return false; } |
