ksys/eco: Add LevelSensor header

It's not implementable yet because Ecosystem and some act:: code hasn't
been decompiled yet.
This commit is contained in:
Léo Lam 2020-10-15 20:56:46 +02:00
parent eedba1cd95
commit 2d721f8969
No known key found for this signature in database
GPG Key ID: 0DF30F9081000741
5 changed files with 82 additions and 3 deletions

View File

@ -76045,9 +76045,9 @@
0x0000007100e422c8,sub_7100E422C8,356,
0x0000007100e4242c,sub_7100E4242C,96,
0x0000007100e4248c,sub_7100E4248C,104,
0x0000007100e424f4,Ecosystem::LevelSensor::ctor,40,
0x0000007100e4251c,Ecosystem::LevelSensor::dtor,72,
0x0000007100e42564,Ecosystem::LevelSensor::dtor_delete,80,
0x0000007100e424f4,Ecosystem::LevelSensor::ctor,40,_ZN4ksys3eco11LevelSensorC1Ev
0x0000007100e4251c,Ecosystem::LevelSensor::dtor,72,_ZN4ksys3eco11LevelSensorD1Ev
0x0000007100e42564,Ecosystem::LevelSensor::dtor_delete,80,_ZN4ksys3eco11LevelSensorD0Ev
0x0000007100e425b4,Ecosystem::LevelSensor::init,288,
0x0000007100e426d4,Ecosystem::LevelSensor::scaleWeapon,1552,
0x0000007100e42ce4,Ecosystem::LevelSensor::scaleActor,1308,

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

View File

@ -1,4 +1,5 @@
add_subdirectory(ActorSystem)
add_subdirectory(Ecosystem)
add_subdirectory(Framework)
add_subdirectory(Map)
add_subdirectory(MessageSystem)

View File

@ -0,0 +1,4 @@
target_sources(uking PRIVATE
ecoLevelSensor.cpp
ecoLevelSensor.h
)

View File

@ -0,0 +1,14 @@
#include "KingSystem/Ecosystem/ecoLevelSensor.h"
#include "KingSystem/Utils/Byaml.h"
namespace ksys::eco {
LevelSensor::LevelSensor() = default;
LevelSensor::~LevelSensor() {
mResHandle.requestUnload2();
if (mBymlIter)
delete mBymlIter;
}
} // namespace ksys::eco

View File

@ -0,0 +1,60 @@
#pragma once
#include <KingSystem/Map/mapObject.h>
#include <basis/seadTypes.h>
#include "KingSystem/Resource/resHandle.h"
#include "KingSystem/Utils/Types.h"
namespace al {
class ByamlIter;
}
namespace ksys::act {
class Actor;
class InstParamPack;
} // namespace ksys::act
namespace ksys::map {
class Object;
}
namespace ksys::eco {
enum class WeaponModifier {
None = 0,
/// This will be upgraded to Blue randomly.
RandomBlue = 1,
Blue = 2,
Yellow = 3,
/// Chests only: Weapon will never spawn with any modifiers. This overrides regular scaling.
NoneForced = 4,
};
class LevelSensor {
public:
LevelSensor();
virtual ~LevelSensor();
void init(sead::Heap* heap);
bool scaleWeapon(const sead::SafeString& weapon, WeaponModifier min_modifier,
const char** scaled_weapon, WeaponModifier* scaled_modifier,
act::Actor* actor) const;
bool scaleActor(const sead::SafeString& name, map::Object* obj, const char** scaled_weapon,
act::InstParamPack* pack, const sead::Vector3f& position) const;
void calculatePoints();
private:
f32 mPoints{};
f32 mWeaponPoints{};
f32 mEnemyPoints{};
bool _14{};
f32 mDefaultPoints = -1;
al::ByamlIter* mBymlIter = nullptr;
res::Handle mResHandle;
};
KSYS_CHECK_SIZE_NX150(LevelSensor, 0x78);
} // namespace ksys::eco