mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-07-16 10:02:59 -07:00
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 commit2aafcc1df2
. * Revert "few fix and paper Link" This reverts commit65e76dcfee
. * 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>
This commit is contained in:
parent
87125ae334
commit
083ceb4423
18 changed files with 1531 additions and 47 deletions
|
@ -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));
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue