OpenEnroth 90c43ae
Loading...
Searching...
No Matches
Classes | Functions | Variables
Character.cpp File Reference
#include "Engine/Objects/Character.h"
#include <algorithm>
#include <memory>
#include <string>
#include <vector>
#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/Objects/SpriteEnumFunctions.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/Evt/EvtEnumFunctions.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 "GUI/UI/ItemGrid.h"
#include "Library/Logger/Logger.h"
#include "Utility/IndexedArray.h"

Classes

struct  CharacterCreationAttributeProps
 

Functions

int CharacterCreation_GetUnspentAttributePointCount ()
 
bool CmpSkillValue (int valToCompare, CombinedSkillValue skillValue)
 
int cycleCharacter (bool backwards)
 
bool ShouldLoadTexturesForRaceAndGender (int bodyType)
 
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, MASTERY_FIRST, MASTERY_LASTStealingMasteryBonuses
 
static constexpr std::array< int, 5 > StealingRandomBonuses = { -200, -100, 0, 100, 200 }
 
static constexpr IndexedArray< int, MASTERY_FIRST, MASTERY_LASTgoldStealingDieSidesByMastery
 
static constexpr int pBaseHealthByClass [12] = {40, 35, 35, 30, 30, 30, 25, 20, 20, 0, 0, 0}
 
static constexpr int 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 int pAgeingTable [4] = {50, 100, 150, 0xFFFF}
 
static constexpr int param_to_bonus_table [29]
 
static constexpr 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 ( int  bodyType)

Variable Documentation

◆ goldStealingDieSidesByMastery

constexpr IndexedArray<int, MASTERY_FIRST, MASTERY_LAST> goldStealingDieSidesByMastery
staticconstexpr
Initial value:
= {
}
@ MASTERY_MASTER
@ MASTERY_NOVICE
@ MASTERY_EXPERT
@ MASTERY_GRANDMASTER

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 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}}
}
@ ATTRIBUTE_ACCURACY
@ ATTRIBUTE_ENDURANCE
@ ATTRIBUTE_PERSONALITY
@ ATTRIBUTE_INTELLIGENCE

◆ param_to_bonus_table

constexpr int 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 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 int pBaseHealthByClass[12] = {40, 35, 35, 30, 30, 30, 25, 20, 20, 0, 0, 0}
staticconstexpr

◆ pBaseHealthPerLevelByClass

constexpr IndexedArray<int, CLASS_FIRST, CLASS_LAST> pBaseHealthPerLevelByClass
staticconstexpr

◆ pBaseManaByClass

constexpr int 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}}
}

◆ spell_fx_renderer

◆ StatTable

◆ StealingMasteryBonuses

constexpr IndexedArray<int, MASTERY_FIRST, MASTERY_LAST> StealingMasteryBonuses
staticconstexpr
Initial value:
= {
}

◆ StealingRandomBonuses

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