OpenEnroth 73e68f7
Loading...
Searching...
No Matches
Classes | Functions | Variables
Character.cpp File Reference
#include "Engine/Objects/Character.h"
#include <algorithm>
#include <memory>
#include <string>
#include "Engine/Engine.h"
#include "Engine/EngineCallObserver.h"
#include "Engine/AssetsManager.h"
#include "Engine/Data/AwardEnums.h"
#include "Engine/Spells/CastSpellInfo.h"
#include "Engine/Spells/Spells.h"
#include "Engine/Spells/SpellEnumFunctions.h"
#include "Engine/Graphics/Indoor.h"
#include "Engine/Graphics/Image.h"
#include "Engine/Graphics/Renderer/Renderer.h"
#include "Engine/Localization.h"
#include "Engine/MapInfo.h"
#include "Engine/Random/Random.h"
#include "Engine/Objects/Actor.h"
#include "Engine/Objects/ObjectList.h"
#include "Engine/Objects/SpriteObject.h"
#include "Engine/Objects/NPC.h"
#include "Engine/Objects/CharacterEnumFunctions.h"
#include "Engine/Objects/MonsterEnumFunctions.h"
#include "Engine/OurMath.h"
#include "Engine/Party.h"
#include "Engine/PriceCalculator.h"
#include "Engine/SpellFxRenderer.h"
#include "Engine/AttackList.h"
#include "Engine/Tables/AwardTable.h"
#include "Engine/Tables/HouseTable.h"
#include "Engine/Tables/ItemTable.h"
#include "Engine/Tables/PortraitFrameTable.h"
#include "Engine/Tables/HistoryTable.h"
#include "Engine/Tables/AutonoteTable.h"
#include "Engine/Tables/QuestTable.h"
#include "Engine/TurnEngine/TurnEngine.h"
#include "Engine/Conditions.h"
#include "Engine/Events/EventEnumFunctions.h"
#include "Io/Mouse.h"
#include "Media/Audio/AudioPlayer.h"
#include "GUI/GUIWindow.h"
#include "GUI/GUIMessageQueue.h"
#include "GUI/UI/UIGame.h"
#include "GUI/UI/UIStatusBar.h"
#include "GUI/UI/UIMessageScroll.h"
#include "GUI/UI/UISpell.h"
#include "GUI/UI/UIDialogue.h"
#include "GUI/UI/Books/AutonotesBook.h"
#include "Library/Logger/Logger.h"
#include "Utility/Memory/MemSet.h"
#include "Utility/IndexedArray.h"

Classes

struct  CharacterCreationAttributeProps
 

Functions

int CharacterCreation_GetUnspentAttributePointCount ()
 
bool CmpSkillValue (int valToCompare, CombinedSkillValue skillValue)
 
int cycleCharacter (bool backwards)
 
bool ShouldLoadTexturesForRaceAndGender (unsigned int _this)
 
bool IsDwarfPresentInParty (bool a1)
 
void DamageCharacterFromMonster (Pid uObjID, ActorAbility dmgSource, signed int targetchar)
 

Variables

static SpellFxRendererspell_fx_renderer = EngineIocContainer::ResolveSpellFxRenderer()
 
static constexpr IndexedArray< IndexedArray< CharacterCreationAttributeProps, ATTRIBUTE_FIRST_STAT, ATTRIBUTE_LAST_STAT >, RACE_FIRST, RACE_LASTStatTable
 
static constexpr IndexedArray< int, CHARACTER_SKILL_MASTERY_FIRST, CHARACTER_SKILL_MASTERY_LASTStealingMasteryBonuses
 
static constexpr std::array< int, 5 > StealingRandomBonuses = { -200, -100, 0, 100, 200 }
 
static constexpr IndexedArray< int, CHARACTER_SKILL_MASTERY_FIRST, CHARACTER_SKILL_MASTERY_LASTgoldStealingDieSidesByMastery
 
static constexpr IndexedArray< ItemSlot, ITEM_TYPE_FIRST, ITEM_TYPE_LASTpEquipTypeToBodyAnchor
 
static constexpr unsigned char pBaseHealthByClass [12]
 
static constexpr unsigned char pBaseManaByClass [12] = {0, 0, 0, 5, 5, 0, 10, 10, 15, 0, 0, 0}
 
static constexpr IndexedArray< int, CLASS_FIRST, CLASS_LASTpBaseHealthPerLevelByClass
 
static constexpr IndexedArray< int, CLASS_FIRST, CLASS_LASTpBaseManaPerLevelByClass
 
static constexpr IndexedArray< std::array< int, 19 >, ATTRIBUTE_FIRST_STAT, ATTRIBUTE_LAST_STATpConditionAttributeModifier
 
static constexpr IndexedArray< std::array< int, 4 >, ATTRIBUTE_FIRST_STAT, ATTRIBUTE_LAST_STATpAgingAttributeModifier
 
static constexpr unsigned int pAgeingTable [4] = {50, 100, 150, 0xFFFF}
 
static constexpr short param_to_bonus_table [29]
 
static constexpr signed int parameter_to_bonus_value [29]
 

Function Documentation

◆ CharacterCreation_GetUnspentAttributePointCount()

int CharacterCreation_GetUnspentAttributePointCount ( )

◆ CmpSkillValue()

bool CmpSkillValue ( int  valToCompare,
CombinedSkillValue  skillValue 
)

◆ cycleCharacter()

int cycleCharacter ( bool  backwards)
Original binary offset:
0x49387A

◆ DamageCharacterFromMonster()

void DamageCharacterFromMonster ( Pid  uObjID,
ActorAbility  dmgSource,
signed int  targetchar 
)

◆ IsDwarfPresentInParty()

bool IsDwarfPresentInParty ( bool  a1)

◆ ShouldLoadTexturesForRaceAndGender()

bool ShouldLoadTexturesForRaceAndGender ( unsigned int  _this)

Variable Documentation

◆ goldStealingDieSidesByMastery

constexpr IndexedArray<int, CHARACTER_SKILL_MASTERY_FIRST, CHARACTER_SKILL_MASTERY_LAST> goldStealingDieSidesByMastery
staticconstexpr
Initial value:

The amount of gold that a character can steal in one go is determined as [skill_level]d[mastery_die], where skill_level is the level of stealing skill, and mastery_die is picked from the table below.

◆ pAgeingTable

constexpr unsigned int pAgeingTable[4] = {50, 100, 150, 0xFFFF}
staticconstexpr

◆ pAgingAttributeModifier

constexpr IndexedArray<std::array<int, 4>, ATTRIBUTE_FIRST_STAT, ATTRIBUTE_LAST_STAT> pAgingAttributeModifier
staticconstexpr
Initial value:
= {
{ATTRIBUTE_MIGHT, {100, 75, 40, 10}},
{ATTRIBUTE_INTELLIGENCE, {100, 150, 100, 10}},
{ATTRIBUTE_PERSONALITY, {100, 150, 100, 10}},
{ATTRIBUTE_ENDURANCE, {100, 75, 40, 10}},
{ATTRIBUTE_ACCURACY, {100, 100, 40, 10}},
{ATTRIBUTE_SPEED, {100, 100, 40, 10}},
{ATTRIBUTE_LUCK, {100, 100, 100, 100}}
}

◆ param_to_bonus_table

constexpr short param_to_bonus_table[29]
staticconstexpr
Initial value:
= {
500, 400, 350, 300, 275, 250, 225, 200, 175, 150, 125, 100, 75, 50, 40,
35, 30, 25, 21, 19, 17, 15, 13, 11, 9, 7, 5, 3, 0}

◆ parameter_to_bonus_value

constexpr signed int parameter_to_bonus_value[29]
staticconstexpr
Initial value:
= {
30, 25, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8,
7, 6, 5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5, -6}

◆ pBaseHealthByClass

constexpr unsigned char pBaseHealthByClass[12]
staticconstexpr
Initial value:
= {40, 35, 35, 30, 30, 30,
25, 20, 20, 0, 0, 0}

◆ pBaseHealthPerLevelByClass

constexpr IndexedArray<int, CLASS_FIRST, CLASS_LAST> pBaseHealthPerLevelByClass
staticconstexpr

◆ pBaseManaByClass

constexpr unsigned char pBaseManaByClass[12] = {0, 0, 0, 5, 5, 0, 10, 10, 15, 0, 0, 0}
staticconstexpr

◆ pBaseManaPerLevelByClass

constexpr IndexedArray<int, CLASS_FIRST, CLASS_LAST> pBaseManaPerLevelByClass
staticconstexpr

◆ pConditionAttributeModifier

constexpr IndexedArray<std::array<int, 19>, ATTRIBUTE_FIRST_STAT, ATTRIBUTE_LAST_STAT> pConditionAttributeModifier
staticconstexpr
Initial value:
= {
{ATTRIBUTE_MIGHT, {100, 100, 100, 120, 50, 200, 75, 60, 50, 30, 25, 10, 100, 100, 100, 100, 100, 100, 100}},
{ATTRIBUTE_INTELLIGENCE, {100, 100, 100, 50, 25, 10, 100, 100, 75, 60, 50, 30, 100, 100, 100, 100, 100, 1, 100}},
{ATTRIBUTE_PERSONALITY, {100, 100, 100, 50, 25, 10, 100, 100, 75, 60, 50, 30, 100, 100, 100, 100, 100, 1, 100}},
{ATTRIBUTE_ENDURANCE, {100, 100, 100, 100, 50, 150, 75, 60, 50, 30, 25, 10, 100, 100, 100, 100, 100, 100, 100}},
{ATTRIBUTE_ACCURACY, {100, 100, 100, 50, 10, 100, 75, 60, 50, 30, 25, 10, 100, 100, 100, 100, 100, 50, 100}},
{ATTRIBUTE_SPEED, {100, 100, 100, 120, 20, 120, 75, 60, 50, 30, 25, 10, 100, 100, 100, 100, 100, 50, 100}},
{ATTRIBUTE_LUCK, {100, 100, 100, 100, 200, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100}}
}

◆ pEquipTypeToBodyAnchor

constexpr IndexedArray<ItemSlot, ITEM_TYPE_FIRST, ITEM_TYPE_LAST> pEquipTypeToBodyAnchor
staticconstexpr
Initial value:
= {
}
@ ITEM_SLOT_RING1
@ ITEM_SLOT_GAUNTLETS
@ ITEM_SLOT_BELT
@ ITEM_SLOT_INVALID
@ ITEM_SLOT_BOOTS
@ ITEM_SLOT_MAIN_HAND
@ ITEM_SLOT_AMULET
@ ITEM_SLOT_ARMOUR
@ ITEM_SLOT_HELMET
@ ITEM_SLOT_CLOAK
@ ITEM_SLOT_OFF_HAND
@ ITEM_TYPE_SHIELD
@ ITEM_TYPE_NONE
@ ITEM_TYPE_SPELL_SCROLL
@ ITEM_TYPE_AMULET
@ ITEM_TYPE_CLOAK
@ ITEM_TYPE_BELT
@ ITEM_TYPE_MESSAGE_SCROLL
@ ITEM_TYPE_SINGLE_HANDED
@ ITEM_TYPE_HELMET
@ ITEM_TYPE_POTION
@ ITEM_TYPE_ARMOUR
@ ITEM_TYPE_BOOK
@ ITEM_TYPE_TWO_HANDED
@ ITEM_TYPE_GOLD
@ ITEM_TYPE_REAGENT
@ ITEM_TYPE_WAND
@ ITEM_TYPE_RING
@ ITEM_TYPE_GAUNTLETS
@ ITEM_TYPE_BOOTS

◆ spell_fx_renderer

◆ StatTable

◆ StealingMasteryBonuses

constexpr IndexedArray<int, CHARACTER_SKILL_MASTERY_FIRST, CHARACTER_SKILL_MASTERY_LAST> StealingMasteryBonuses
staticconstexpr

◆ StealingRandomBonuses

constexpr std::array<int, 5> StealingRandomBonuses = { -200, -100, 0, 100, 200 }
staticconstexpr