diff --git a/CommonLibSF/include/RE/A/ActorValueInfo.h b/CommonLibSF/include/RE/A/ActorValueInfo.h index 99242043..3493a525 100644 --- a/CommonLibSF/include/RE/A/ActorValueInfo.h +++ b/CommonLibSF/include/RE/A/ActorValueInfo.h @@ -1,12 +1,66 @@ #pragma once +#include "RE/A/ActorValues.h" +#include "RE/B/BGSEditorID.h" #include "RE/T/TESForm.h" +#include "RE/T/TESFullName.h" namespace RE { - class ActorValueInfo + class BGSResource; + + class ActorValueInfo : + public TESForm, // 00 + public TESFullName // 38 { public: SF_RTTI_VTABLE(ActorValueInfo); + + ~ActorValueInfo() override; // 00 + + // members + BGSEditorID editorID; // 048 + std::uint64_t unk058; // 058 + std::uint64_t unk060; // 060 + std::uint64_t unk068; // 068 + std::uint64_t unk070; // 070 + std::uint64_t unk078; // 078 + std::uint64_t unk080; // 080 + std::uint64_t unk088; // 088 + std::uint64_t unk090; // 090 + std::uint64_t unk098; // 098 + std::uint64_t unk0A0; // 0A0 + std::uint64_t unk0A8; // 0A8 + std::uint64_t unk0B0; // 0B0 + std::uint64_t unk0B8; // 0B8 + std::uint64_t unk0C0; // 0C0 + std::uint64_t unk0C8; // 0C8 + std::uint64_t unk0D0; // 0D0 + std::uint64_t unk0D8; // 0D8 + std::uint64_t unk0E0; // 0E0 + std::uint64_t unk0E8; // 0E8 + std::uint64_t unk0F0; // 0F0 + std::uint64_t unk0F8; // 0F8 + std::uint64_t unk100; // 100 + std::uint64_t unk108; // 108 + std::uint64_t unk110; // 110 + std::uint64_t unk118; // 118 + std::uint64_t unk120; // 120 + std::uint64_t unk128; // 128 + std::uint64_t unk130; // 130 + std::uint64_t unk138; // 138 + std::uint64_t unk140; // 140 + BGSResource* resource; // 148 + BSFixedString abbreviation; // 150 + std::uint32_t index; // 158 + std::uint32_t flags; // 15C + stl::enumeration avType; // 160 + std::uint32_t unk164; // 164 + std::uint32_t fullCacheIndex; // 168 + std::uint32_t permanentCacheIndex; // 16C + std::uint64_t unk170; // 170 + std::uint32_t unk178; // 178 + std::uint32_t sortIndex; // 17C }; + static_assert(sizeof(ActorValueInfo) == 0x180); } diff --git a/CommonLibSF/include/RE/A/ActorValueOwner.h b/CommonLibSF/include/RE/A/ActorValueOwner.h index c59379f5..2f2cafe9 100644 --- a/CommonLibSF/include/RE/A/ActorValueOwner.h +++ b/CommonLibSF/include/RE/A/ActorValueOwner.h @@ -5,23 +5,27 @@ namespace RE { + class TESObjectREFR; + class ActorValueOwner { public: - SF_RTTI_VTABLE(ActorValueOwner); + SF_RTTI(ActorValueOwner); virtual ~ActorValueOwner(); // add - virtual float GetActorValue(const ActorValueInfo& a_info); - virtual float GetPermanentActorValue(const ActorValueInfo& a_info); - virtual float GetBaseActorValue(const ActorValueInfo& a_info); - virtual void SetBaseActorValue(const ActorValueInfo& a_info, float a_value); - virtual void ModBaseActorValue(const ActorValueInfo& a_info, float a_delta); - virtual void ModActorValue(ACTOR_VALUE_MODIFIER a_modifier, const ActorValueInfo& a_info); - virtual float GetModifier(ACTOR_VALUE_MODIFIER a_modifier, const ActorValueInfo& a_info); - virtual void RestorActorValue(const ActorValueInfo& a_info, float a_amount); - virtual void SetActorValue(const ActorValueInfo& a_info, float afValue); + virtual float GetActorValue(const ActorValueInfo& a_info); // 01 + virtual float GetPermanentActorValue(const ActorValueInfo& a_info); // 02 + virtual float GetBaseActorValue(const ActorValueInfo& a_info); // 03 + virtual void SetBaseActorValue(const ActorValueInfo& a_info, float a_value); // 04 + virtual void ModBaseActorValue(const ActorValueInfo& a_info, float a_delta); // 05 + virtual void ModActorValue(ACTOR_VALUE_MODIFIER a_modifier, const ActorValueInfo& a_info, float a_delta, TESObjectREFR* a_ref); // 06 - new + virtual void ModActorValue(ACTOR_VALUE_MODIFIER a_modifier, const ActorValueInfo& a_info, float a_delta); // 07 + virtual float GetModifier(ACTOR_VALUE_MODIFIER a_modifier, const ActorValueInfo& a_info); // 08 + virtual void RestoreActorValue(const ActorValueInfo& a_info, float a_amount); // 09 + virtual void SetActorValue(const ActorValueInfo& a_info, float a_value); // 0A + [[nodiscard]] virtual bool GetIsPlayerOwner() const; // 0B }; static_assert(sizeof(ActorValueOwner) == 0x8); } diff --git a/CommonLibSF/include/RE/A/ActorValues.h b/CommonLibSF/include/RE/A/ActorValues.h index 5f6e1078..a0432e5e 100644 --- a/CommonLibSF/include/RE/A/ActorValues.h +++ b/CommonLibSF/include/RE/A/ActorValues.h @@ -1,7 +1,11 @@ #pragma once +#include "RE/B/BSTSingleton.h" + namespace RE { + class ActorValueInfo; + enum class ACTOR_VALUE_MODIFIER { kPermanent = 0, @@ -10,4 +14,211 @@ namespace RE kTotal = 3 }; + + class ActorValue : + public BSTSingletonImplicit // 000 + { + public: + enum class AVType + { + kDerivedAttribute, + kAttribute, + kSkill, + kAIAttribute, + kResistance, + kCondition, + kCharge, + kIntValue, + kVariable, + kResource + }; + + [[nodiscard]] static ActorValue* GetSingleton() + { + using func_t = decltype(&ActorValue::GetSingleton); + REL::Relocation func{ REL::Offset(0x00824D90) }; + return func(); + } + + // members + ActorValueInfo* absorbChance; // 000 + ActorValueInfo* oxygen; // 008 + ActorValueInfo* aggression; // 010 + ActorValueInfo* agility; // 018 + ActorValueInfo* aimStability; // 020 + ActorValueInfo* alchemy; // 028 + ActorValueInfo* animationMult; // 030 + ActorValueInfo* armorPerks; // 038 + ActorValueInfo* assistance; // 040 + ActorValueInfo* attackDamageMult; // 048 + ActorValueInfo* blindness; // 050 + ActorValueInfo* block; // 058 + ActorValueInfo* bloodyMess; // 060 + ActorValueInfo* bowSpeedBonus; // 068 + ActorValueInfo* bowStaggerBonus; // 070 + ActorValueInfo* brainCondition; // 078 + ActorValueInfo* carryWeight; // 080 + ActorValueInfo* charisma; // 088 + ActorValueInfo* combatHealthRegenMult; // 090 + ActorValueInfo* confidence; // 098 + ActorValueInfo* criticalHitChance; // 0A0 + ActorValueInfo* criticalHitIncMult; // 0A8 + ActorValueInfo* criticalHitDamageMult; // 0B0 + ActorValueInfo* damageResist; // 0B8 + ActorValueInfo* deafness; // 0C0 + ActorValueInfo* electromagneticDamageResist; // 0C8 + ActorValueInfo* electromagneticHealth; // 0D0 + ActorValueInfo* electromagneticToDamageConversionRate; // 0D8 + ActorValueInfo* electromagneticRecoverRateMult; // 0E0 + ActorValueInfo* unkE8; // 0E8 - null + ActorValueInfo* endurance; // 0F0 + ActorValueInfo* enduranceCondition; // 0F8 + ActorValueInfo* experience; // 100 + ActorValueInfo* health; // 108 + ActorValueInfo* healRateMult; // 110 + ActorValueInfo* idleChatterTimeMin; // 118 + ActorValueInfo* idleChatterTimeMax; // 120 + ActorValueInfo* ignoreCrippledLimbs; // 128 + ActorValueInfo* intelligence; // 130 + ActorValueInfo* invisibility; // 138 + ActorValueInfo* invulnerable; // 140 + ActorValueInfo* karma; // 148 + ActorValueInfo* leftAttackCondition; // 150 + ActorValueInfo* leftItemCharge; // 158 + ActorValueInfo* leftMobilityCondition; // 160 + ActorValueInfo* leftWeaponSpeedMult; // 168 + ActorValueInfo* lockpicking; // 170 + ActorValueInfo* luck; // 178 + ActorValueInfo* mass; // 180 + ActorValueInfo* meleeDamage; // 188 + ActorValueInfo* morality; // 190 + ActorValueInfo* movementNoiseMult; // 198 + ActorValueInfo* nightEye; // 1A0 + ActorValueInfo* perception; // 1A8 + ActorValueInfo* perceptionCondition; // 1B0 + ActorValueInfo* unk1B8; // 1B8 - null + ActorValueInfo* poisonResist; // 1C0 + ActorValueInfo* powerArmorBattery; // 1C8 + ActorValueInfo* powerArmorHeadCondition; // 1D0 + ActorValueInfo* powerArmorTorsoCondition; // 1D8 + ActorValueInfo* powerArmorLeftArmCondition; // 1E0 + ActorValueInfo* powerArmorRightArmCondition; // 1E8 + ActorValueInfo* powerArmorLeftLegCondition; // 1F0 + ActorValueInfo* powerArmorRightLegCondition; // 1F8 + ActorValueInfo* envDamageHealthMax; // 200 + ActorValueInfo* envDamage; // 208 + ActorValueInfo* carbonDioxideOxygenMax; // 210 + ActorValueInfo* carbonDioxide; // 218 + ActorValueInfo* reflectDamage; // 220 + ActorValueInfo* conditionRate; // 228 + ActorValueInfo* rightAttackCondition; // 230 + ActorValueInfo* rightItemCharge; // 238 + ActorValueInfo* rightMobilityCondition; // 240 + ActorValueInfo* rotationSpeedCondition; // 248 + ActorValueInfo* shieldDamageResist; // 250 + ActorValueInfo* shieldPerks; // 258 + ActorValueInfo* sneak; // 260 + ActorValueInfo* unk268; // 268 - null + ActorValueInfo* speedMult; // 270 + ActorValueInfo* unusedStamina; // 278 + ActorValueInfo* strength; // 280 + ActorValueInfo* suspicious; // 288 + ActorValueInfo* telekinesis; // 290 + ActorValueInfo* unarmedDamage; // 298 + ActorValueInfo* vansPerk; // 2A0 + ActorValueInfo* wardPower; // 2A8 + ActorValueInfo* waitingForPlayer; // 2B0 + ActorValueInfo* waterBreathing; // 2B8 + ActorValueInfo* waterWalking; // 2C0 + ActorValueInfo* weaponSpeedMult; // 2C8 + ActorValueInfo* weapReloadSpeedMult; // 2D0 + ActorValueInfo* healRate; // 2D8 + ActorValueInfo* oxygenRate; // 2E0 + ActorValueInfo* electromagneticRecoverRate; // 2E8 + ActorValueInfo* oxygenRateMult; // 2F0 + ActorValueInfo* envDamageRate; // 2F8 + ActorValueInfo* envDamageRateMult; // 300 + ActorValueInfo* carbonDioxideRate; // 308 + ActorValueInfo* carbonDioxideRateMult; // 310 + ActorValueInfo* conditionRateMult; // 318 + ActorValueInfo* fireResist; // 320 + ActorValueInfo* electricResist; // 328 + ActorValueInfo* frostResist; // 330 + ActorValueInfo* magicResist; // 338 + ActorValueInfo* radResistIngestion; // 340 + ActorValueInfo* radResistExposure; // 348 + ActorValueInfo* energy; // 350 + ActorValueInfo* energyResist; // 358 + ActorValueInfo* paralysis; // 360 + ActorValueInfo* attackConditionAlt1; // 368 + ActorValueInfo* attackConditionAlt2; // 370 + ActorValueInfo* attackConditionAlt3; // 378 + ActorValueInfo* powerGenerated; // 380 + ActorValueInfo* powerRadiation; // 388 + ActorValueInfo* powerRequired; // 390 + ActorValueInfo* food; // 398 + ActorValueInfo* water; // 3A0 + ActorValueInfo* safety; // 3A8 + ActorValueInfo* bed; // 3B0 + ActorValueInfo* happiness; // 3B8 + ActorValueInfo* fallSpeedMult; // 3C0 + ActorValueInfo* workshopItemOverlap; // 3C8 + ActorValueInfo* workshopProduceUntilNextCycle; // 3D0 + ActorValueInfo* workshopItemClampDirection; // 3D8 + ActorValueInfo* workshopItemZOffset; // 3E0 + ActorValueInfo* workshopLevel; // 3E8 + ActorValueInfo* workshopLevelHealthPercent; // 3F0 + ActorValueInfo* workshopLevelObject; // 3F8 + ActorValueInfo* workshopPlayerOwned; // 400 + ActorValueInfo* workshopActorWounded; // 408 + ActorValueInfo* workshopStackableItem; // 410 + ActorValueInfo* workshopState; // 418 + ActorValueInfo* workshopStateTransition; // 420 + ActorValueInfo* workshopStateTimeout; // 428 + ActorValueInfo* workshopSnapPointRadius; // 430 + ActorValueInfo* workshopAnythingIsGround; // 438 + ActorValueInfo* workshopMaxTriangles; // 440 + ActorValueInfo* workshopMaxDraws; // 448 + ActorValueInfo* workshopCurrentBudget; // 450 + ActorValueInfo* workshopCurrentTriangles; // 458 + ActorValueInfo* workshopCurrentDraws; // 460 + ActorValueInfo* workshopIgnoreSimpleIntersections; // 468 + ActorValueInfo* workshopAllowUnsupportedStacking; // 470 + ActorValueInfo* workshopSnapTransmitsPower; // 478 + ActorValueInfo* workshopPowerConnection; // 480 + ActorValueInfo* workshopPowerConnectionAndReceiver; // 488 + ActorValueInfo* ignorePlayerWhileFrenzied; // 490 + ActorValueInfo* produceUses; // 498 + ActorValueInfo* starPower; // 4A0 + ActorValueInfo* starPowerRecoverRate; // 4A8 + ActorValueInfo* starPowerRateMult; // 4B0 + ActorValueInfo* rangedDamage; // 4B8 + ActorValueInfo* dockingPermission; // 4C0 + ActorValueInfo* organicResourceType; // 4C8 + ActorValueInfo* envDamageSoak; // 4D0 + ActorValueInfo* envCapacity; // 4D8 + ActorValueInfo* shipSystemWeaponGroup1Health; // 4E0 + ActorValueInfo* shipSystemWeaponGroup2Health; // 4E8 + ActorValueInfo* shipSystemWeaponGroup3Health; // 4F0 + ActorValueInfo* spaceshipWeaponGroup1EMHealth; // 4F8 + ActorValueInfo* spaceshipWeaponGroup2EMHealth; // 500 + ActorValueInfo* spaceshipWeaponGroup3EMHealth; // 508 + ActorValueInfo* spaceshipWeaponGroup1DamageChance; // 510 + ActorValueInfo* spaceshipWeaponGroup2DamageChance; // 518 + ActorValueInfo* spaceshipWeaponGroup3DamageChance; // 520 + ActorValueInfo* legendaryRank; // 528 + ActorValueInfo* weatherTransitionPercent; // 530 + ActorValueInfo* securityMenuRingHighlightingEnabled; // 538 + ActorValueInfo* securityMenuDisableUnusedKeysOptionEnabled; // 540 + ActorValueInfo* securityMenuAutoattemptPointsMultiplier; // 548 + ActorValueInfo* securityMenuMaxAutoattemptPoints; // 550 + ActorValueInfo* galaxyBodyScanAbility; // 558 + ActorValueInfo* distantContainerAbility; // 560 + ActorValueInfo* spaceshipCustomized; // 568 + ActorValueInfo* spaceshipPainted; // 570 + std::uint8_t unk578[0x10]; // 578 - BSTArray + std::uint8_t unk588[0x10]; // 588 - BSTArray + std::uint32_t avTypeCounts[10]; // 598 + }; + static_assert(sizeof(ActorValue) == 0x5C0); } diff --git a/CommonLibSF/include/RE/B/BSTSingleton.h b/CommonLibSF/include/RE/B/BSTSingleton.h new file mode 100644 index 00000000..31abbe43 --- /dev/null +++ b/CommonLibSF/include/RE/B/BSTSingleton.h @@ -0,0 +1,61 @@ +#pragma once + +namespace RE +{ + template + class BSTSingletonImplicit + { + public: + using value_type = T; + }; + + template + class BSTSingletonExplicit + { + public: + using value_type = T; + }; + + template + struct BSTSingletonSDMOpStaticBuffer + { + public: + using value_type = T; + }; + + template + struct BSTSingletonSDMBase : + public Traits, + public BSTSingletonSDMOpStaticBuffer + { + public: + }; + + template + struct BSTSDMTraits + { + public: + using value_type = T; + }; + +#ifdef __EDG__ + + template class Buffer = BSTSingletonSDMOpStaticBuffer> + struct BSTSingletonSDM + { + public: + std::uint8_t padding; + }; + +#else + + template class Buffer = BSTSingletonSDMOpStaticBuffer> + struct BSTSingletonSDM : + public BSTSingletonSDMBase>> + { + public: + using value_type = T; + }; + +#endif +} diff --git a/CommonLibSF/include/RE/T/TESFullName.h b/CommonLibSF/include/RE/T/TESFullName.h index 10cab01d..0bc68ba8 100644 --- a/CommonLibSF/include/RE/T/TESFullName.h +++ b/CommonLibSF/include/RE/T/TESFullName.h @@ -1,6 +1,6 @@ #pragma once -#include "RE/B/BSFixedString.h" +#include "RE/B/BGSLocalizedString.h" #include "RE/B/BaseFormComponent.h" namespace RE @@ -10,8 +10,15 @@ namespace RE public: SF_RTTI_VTABLE(TESFullName); + ~TESFullName() override; + + // add + virtual std::uint32_t GetFullNameLength() const; // 11 + virtual const char* GetFullName() const; // 12 + virtual const BGSLocalizedString& GetFullNameLocalized() const; // 13 + // members - BSFixedString fullName; // 08 - FULL + BGSLocalizedString fullName; // 08 - FULL }; static_assert(sizeof(TESFullName) == 0x10); }