aoc2: Add shouldApplyMasterModeDamageMultiplier

This commit is contained in:
Léo Lam 2020-09-17 18:38:06 +02:00
parent 7553861fb8
commit 1176af740b
No known key found for this signature in database
GPG Key ID: 0DF30F9081000741
6 changed files with 61 additions and 4 deletions

View File

@ -72747,7 +72747,7 @@
0x0000007100d6d394,aoc2::nerfCookCureItemHitPointRecover,64,
0x0000007100d6d3d4,aoc2::modifyEnemyNoticeDuration,60,
0x0000007100d6d410,sub_7100D6D410,304,
0x0000007100d6d540,aoc2::shouldApplyMasterModeDamageMultiplier,6164,
0x0000007100d6d540,aoc2::shouldApplyMasterModeDamageMultiplier,6164,_ZN5uking4aoc237shouldApplyMasterModeDamageMultiplierERKN4ksys3act20ActorConstDataAccessE|
0x0000007100d6ed54,aoc2::buffDamage,40,
0x0000007100d6ed7c,aoc2::initHardModeFlag,172,
0x0000007100d6ee28,aoc2::setAocFlag2,172,

Can't render this file because it is too large.

View File

@ -2,7 +2,45 @@
namespace uking {
using namespace ksys;
bool aoc2::shouldApplyMasterModeDamageMultiplier(const ksys::act::ActorConstDataAccess& accessor) {
if (!accessor.hasProc())
return false;
ksys::act::ActorConstDataAccess parent;
if (accessor.hasConnectedCalcParent() && accessor.acquireConnectedCalcParent(&parent))
return shouldApplyMasterModeDamageMultiplier(parent);
if (accessor.hasTag(ksys::act::tags::IsMasterModeDamageMultiplierActor) ||
(aoc2::instance() && aoc2::instance()->isTestOfStrengthShrine() &&
accessor.hasTag(ksys::act::tags::AncientGuardTarget))) {
return true;
}
const sead::SafeString& profile = accessor.getProfile();
const sead::SafeString& name = accessor.getName();
if (profile == "LastBoss" || profile == "SiteBoss")
return true;
if (name == "Enemy_GanonBeast" || name == "GanonShockWave" || name == "EnemyGanonShockWave" ||
name == "GanonSeaOfFlame" || name == "GanonFlameBall" || name == "GanonPillarOfFlame" ||
name == "GanonNormalArrow" || name == "GanonSpearForThrowing" || name == "CurseGanonBeam" ||
name == "GanonBeam" || name == "GanonIceBullet" || name == "GanonThunder" ||
name == "GanonIronPile" || name == "GanonTornado" || name == "GanonBeastBeam" ||
name == "SiteBossSeaOfFlame" || name == "SiteBossSeaOfFlameRotate" ||
name == "SiteBossFlameBall" || name == "SiteBossBigFlameBall" ||
name == "SiteBossPillarOfFlame" || name == "SiteBossWearFlame" ||
name == "SiteBossDrawingFlameTornado" || name == "SiteBossGaleArrow" ||
name == "SiteBossNormalArrow" || name == "SiteBossSpearForThrowing" ||
name == "SiteBossReflectArrow" || name == "ArrowRainChild" ||
name == "SiteBossSpearIceBullet" || name == "SiteBossTornado" ||
name == "LastBossThunder" || name == "Enemy_Assassin_Senior" ||
name == "AssassinRockBall" || name == "AssassinIronBall") {
return true;
}
return false;
}
bool aoc2::rankUpEnemy(const sead::SafeString& actor_name, const ksys::map::Object& obj,
const char** new_name) {

View File

@ -2,6 +2,7 @@
#include <heap/seadDisposer.h>
#include <prim/seadSafeString.h>
#include "KingSystem/ActorSystem/actActorConstDataAccess.h"
#include "KingSystem/Map/mapObject.h"
namespace uking {
@ -16,6 +17,9 @@ class aoc2 {
public:
void init(sead::Heap* heap);
static bool
shouldApplyMasterModeDamageMultiplier(const ksys::act::ActorConstDataAccess& accessor);
bool isTestOfStrengthShrine() const;
bool rankUpEnemy(const sead::SafeString& actor_name, const ksys::map::Object& obj,

View File

@ -2,13 +2,19 @@
#include "KingSystem/ActorSystem/actActorLinkConstDataAccess.h"
#include "KingSystem/ActorSystem/actBaseProcLink.h"
#include "KingSystem/ActorSystem/actTag.h"
#include "KingSystem/Utils/Types.h"
namespace ksys::act {
class ActorConstDataAccess : public ActorLinkConstDataAccess {
public:
ActorConstDataAccess() = default;
bool acquireActor(const ActorLinkConstDataAccess& other);
bool hasProc() const { return ActorLinkConstDataAccess::hasProc(); }
/// Checks whether the acquired BaseProc is `proc`.
bool hasProc(BaseProc* proc) const;
@ -21,12 +27,19 @@ public:
void debugLog(s32, const sead::SafeString& method_name) const;
const sead::SafeString& getProfile() const;
const sead::SafeString& getName() const;
bool hasTag(const sead::SafeString& tag) const;
bool hasTag(Tag tag) const;
u32 getId() const;
bool acquireConnectedCalcParent(ActorLinkConstDataAccess* accessor) const;
bool acquireConnectedCalcChild(ActorLinkConstDataAccess* accessor) const;
bool hasConnectedCalcParent() const;
private:
u8 _10 = 0;
};
KSYS_CHECK_SIZE_NX150(ActorConstDataAccess, 0x18);
bool acquireActor(BaseProcLink* link, ActorConstDataAccess* accessor);

View File

@ -23,6 +23,8 @@ public:
void release() { acquire(nullptr); }
bool hasProc() const { return mProc != nullptr; }
protected:
friend class ActorConstDataAccess;

View File

@ -10,8 +10,8 @@ namespace ksys::act {
class Tag {
public:
Tag() = default;
constexpr Tag(u32 hash) : mHash(hash) {}
constexpr Tag(std::string_view name) : mHash(util::calcCrc32(name)) {}
explicit constexpr Tag(u32 hash) : mHash(hash) {}
explicit constexpr Tag(std::string_view name) : mHash(util::calcCrc32(name)) {}
constexpr bool operator==(Tag other) const { return mHash == other.mHash; }
constexpr bool operator!=(Tag other) const { return mHash != other.mHash; }