mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-05-31 17:41:30 -04:00
Add OneHit KO (#27)
This commit is contained in:
@@ -10,6 +10,8 @@
|
||||
#include <assert.h>
|
||||
#endif
|
||||
|
||||
#include "soh/Enhancements/debugconsole.h"
|
||||
|
||||
|
||||
static uint16_t _doActionTexWidth, _doActionTexHeight = -1;
|
||||
static uint16_t DO_ACTION_TEX_WIDTH() {
|
||||
@@ -2641,6 +2643,14 @@ 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 (oneHitKO) {
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user