Game: Finish HardModeManager

This commit is contained in:
Léo Lam
2022-02-09 19:36:02 +01:00
parent 29ffc51ad8
commit 97f3d2943b
3 changed files with 24 additions and 1 deletions
+22
View File
@@ -1,5 +1,7 @@
#include "Game/DLC/aocHardModeManager.h"
#include <math/seadMathCalcCommon.h>
#include "KingSystem/ActorSystem/actActor.h"
#include "KingSystem/ActorSystem/actActorUtil.h"
#include "KingSystem/ActorSystem/actTag.h"
#include "KingSystem/Utils/InitTimeInfo.h"
@@ -75,6 +77,26 @@ void HardModeManager::modifyEnemyNoticeDuration(f32* value) const {
*value = sead::Mathf::max(*value * getMultiplier(MultiplierType::EnemyNoticeDuration), 0);
}
bool HardModeManager::shouldCreateLifeRecoverInfo(ksys::act::Actor* actor) {
// Health regen should only apply to enemy actors.
if (!ksys::act::isEnemyProfile(actor))
return false;
// But not to wolves or bears...
if (ksys::act::isWolfOrBear(actor))
return false;
// and not to Dark Beast Ganon...
if (actor->getName() == "Enemy_GanonBeast")
return false;
// and not to enemy swarms...
if (actor->getProfile() == "EnemySwarm")
return false;
return actor->getMaxLife() > 1;
}
bool HardModeManager::shouldApplyMasterModeDamageMultiplier(
const ksys::act::ActorConstDataAccess& accessor) {
if (!accessor.hasProc())
+1
View File
@@ -40,6 +40,7 @@ public:
void nerfHpRestore(s32* hp) const;
void modifyEnemyNoticeDuration(f32* value) const;
static bool shouldCreateLifeRecoverInfo(ksys::act::Actor* actor);
static bool
shouldApplyMasterModeDamageMultiplier(const ksys::act::ActorConstDataAccess& accessor);
static void buffDamage(s32& damage);