Mercurial > might-and-magic-trilogy
diff Player.h @ 0:8b8875f5b359
Initial commit
author | Nomad |
---|---|
date | Fri, 05 Oct 2012 16:07:14 +0200 |
parents | |
children | 509744251c8e |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Player.h Fri Oct 05 16:07:14 2012 +0200 @@ -0,0 +1,401 @@ +#pragma once +#include "Items.h" +#include "Spells.h" + + + + + +/* 339 */ +enum CHARACTER_RACE +{ + CHARACTER_RACE_HUMAN = 0x0, + CHARACTER_RACE_ELF = 0x1, + CHARACTER_RACE_GOBLIN = 0x2, + CHARACTER_RACE_DWARF = 0x3, +}; + + +/* 332 */ +enum CHARACTER_ATTRIBUTE_TYPE +{ + CHARACTER_ATTRIBUTE_STRENGTH = 0x0, + CHARACTER_ATTRIBUTE_INTELLIGENCE = 0x1, + CHARACTER_ATTRIBUTE_WILLPOWER = 0x2, + CHARACTER_ATTRIBUTE_ENDURANCE = 0x3, + CHARACTER_ATTRIBUTE_ACCURACY = 0x4, + CHARACTER_ATTRIBUTE_SPEED = 0x5, + CHARACTER_ATTRIBUTE_LUCK = 0x6, + CHARACTER_ATTRIBUTE_HEALTH = 0x7, + CHARACTER_ATTRIBUTE_MANA = 0x8, + CHARACTER_ATTRIBUTE_AC_BONUS = 0x9, + CHARACTER_ATTRIBUTE_RESIST_FIRE = 0xA, + CHARACTER_ATTRIBUTE_RESIST_AIR = 0xB, + CHARACTER_ATTRIBUTE_RESIST_WATER = 0xC, + CHARACTER_ATTRIBUTE_RESIST_EARTH = 0xD, + CHARACTER_ATTRIBUTE_RESIST_MIND = 0xE, + CHARACTER_ATTRIBUTE_RESIST_BODY = 0xF, + CHARACTER_ATTRIBUTE_LEVEL = 0x18, + CHARACTER_ATTRIBUTE_ATTACK = 0x19, + CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS = 0x1A, + CHARACTER_ATTRIBUTE_MELEE_DMG_MIN = 0x1B, + CHARACTER_ATTRIBUTE_MELEE_DMG_MAX = 0x1C, + CHARACTER_ATTRIBUTE_RANGED_ATTACK = 0x1D, + CHARACTER_ATTRIBUTE_RANGED_DAMAGE_BONUS = 0x1E, + CHARACTER_ATTRIBUTE_RANGED_DAMAGE_MIN = 0x1F, + CHARACTER_ATTRIBUTE_RANGED_DAMAGE_MAX = 0x20, +}; + +/* 328 */ +enum PLAYER_SKILL_TYPE +{ + PLAYER_SKILL_STAFF = 0x0, + PLAYER_SKILL_SWORD = 0x1, + PLAYER_SKILL_DAGGER = 0x2, + PLAYER_SKILL_AXE = 0x3, + PLAYER_SKILL_SPEAR = 0x4, + PLAYER_SKILL_BOW = 0x5, + PLAYER_SKILL_MACE = 0x6, + PLAYER_SKILL_BLASTER = 0x7, + PLAYER_SKILL_SHIELD = 0x8, + PLAYER_SKILL_LEATHER = 0x9, + PLAYER_SKILL_CHAIN = 0xA, + PLAYER_SKILL_PLATE = 0xB, + PLAYER_SKILL_FIRE = 0xC, + PLAYER_SKILL_AIR = 0xD, + PLAYER_SKILL_WATER = 0xE, + PLAYER_SKILL_EARTH = 0xF, + PLAYER_SKILL_SPIRIT = 0x10, + PLAYER_SKILL_MIND = 0x11, + PLAYER_SKILL_BODY = 0x12, + PLAYER_SKILL_LIGHT = 0x13, + PLAYER_SKILL_DARK = 0x14, + PLAYER_SKILL_ITEM_ID = 0x15, + PLAYER_SKILL_MERCHANT = 0x16, + PLAYER_SKILL_REPAIR = 0x17, + PLAYER_SKILL_BODYBUILDING = 0x18, + PLAYER_SKILL_MEDITATION = 0x19, + PLAYER_SKILL_PERCEPTION = 0x1A, + PLAYER_SKILL_DIPLOMACY = 0x1B, + PLAYER_SKILL_TIEVERY = 0x1C, + PLAYER_SKILL_TRAP_DISARM = 0x1D, + PLAYER_SKILL_DODGE = 0x1E, + PLAYER_SKILL_UNARMED = 0x1F, + PLAYER_SKILL_MONSTER_ID = 0x20, + PLAYER_SKILL_ARMSMASTER = 0x21, + PLAYER_SKILL_STEALING = 0x22, + PLAYER_SKILL_ALCHEMY = 0x23, + PLAYER_SKILL_LEARNING = 0x24, +}; + +/* 329 */ +enum PLAYER_CLASS_TYPE +{ + PLAYER_CLASS_KNIGHT = 0x0, + PLAYER_CLASS_THEIF = 0x4, + PLAYER_CLASS_CLERIC = 0x18, + PLAYER_CLASS_SORCERER = 0x20, +}; + + + + +#pragma pack(push, 1) +struct LloydBeacon +{ + unsigned __int64 uBeaconTime; + int field_8; + int field_C; + int field_10; + int field_14; + int field_18; +}; +#pragma pack(pop) + + + +#pragma pack(push, 1) +struct PlayerSpellbook +{ + unsigned __int8 bIsSpellbookAvailable; + char bIsSpellAvailable[10]; +}; +#pragma pack(pop) + + + +#pragma pack(push, 1) +union PlayerEquipment +{ + union + { + struct + { + unsigned int uOffHand; + unsigned int uMainHand; + unsigned int uBow; + unsigned int uBody; + unsigned int uHelm; + unsigned int uBelt; + unsigned int uCloak; + unsigned int field_1C; + unsigned int field_20; + unsigned int field_24; + unsigned int field_28; + unsigned int field_2C; + unsigned int field_30; + unsigned int field_34; + unsigned int field_38; + unsigned int field_3C; + }; + unsigned int pIndices[16]; + }; +}; +#pragma pack(pop) + + + +#pragma pack(push, 1) +struct Player +{ + Player(); + + void SetVariable(enum VariableType var, signed int a3); + void AddVariable(enum VariableType var, signed int val); + void SubtractVariable(enum VariableType var, void *a3); + char CompareVariable(enum VariableType var, signed int a1); + void UseItem_DrinkPotion_etc(signed int a2, int a3); + bool AddItem(struct ItemGen *pItem); + int GetBaseStrength(); + int GetBaseIntelligence(); + int GetBaseWillpower(); + int GetBaseEndurance(); + int GetBaseAccuracy(); + int GetBaseSpeed(); + int GetBaseLuck(); + int GetBaseLevel(); + int GetActualLevel(); + int GetActualMight(); + int GetActualIntelligence(); + int GetActualWillpower(); + int GetActualEndurance(); + int GetActualAccuracy(); + int GetActualSpeed(); + int GetActualLuck(); + int GetActualAttack(int a2); + int GetMeleeDamageMinimal(); + int GetMeleeDamageMaximal(); + int CalculateMeleeDamageTo(int a2, int a3, unsigned int uTargetActorID); + int GetRangedAttack(); + int GetRangedDamageMin(); + int GetRangedDamageMax(); + bool CalculateRangedDamageTo(int a2); + char *GetMeleeDamageString(); + char *GetRangedDamageString(); + bool CanTrainToNextLevel(); + unsigned int GetExperienceDisplayColor(); + int CalculateIncommingDamage(int resistance, signed int type); + int GetEquippedItemEquipType(unsigned int uEquipSlot); + int GetEquippedItemSkillType(enum ITEM_EQUIP_TYPE uEquipSlot); + bool IsUnarmed(); + bool HasItemEquipped(enum ITEM_EQUIP_TYPE uEquipIndex); + int HasEnchantedItemEquipped(int uEnchantment); + bool WearsItem(int a1, signed int a2); + bool StealFromShop(struct ItemGen *a2, int a3, int a4, int a5, int *a6); + int StealFromActor(unsigned int uActorID, int _steal_perm, int reputation); + void Heal(int amount); + int ReceiveDamage(signed int type, int resistance); + int _48DCF6(int a2, struct Actor *pActor); + unsigned int GetSpellSchool(unsigned int uSpellID); + int GetAttackRecoveryTime(int a2); + int GetMaxHealth(); + int GetMaxMana(); + int GetBaseAC(); + int GetActualAC(); + unsigned int GetBaseAge(); + unsigned int GetActualAge(); + int GetBaseResistance(enum CHARACTER_ATTRIBUTE_TYPE a2); + int GetActualResistance(enum CHARACTER_ATTRIBUTE_TYPE a2); + void SetRecoveryTime(signed int sRecoveryTime); + void RandomizeName(); + unsigned int GetMajorConditionrIdx(); + int _48EA1B_get_static_effect(int a2); + int _48EA46_calc_special_bonus_by_items(int a2); + int GetItemsBonus(enum CHARACTER_ATTRIBUTE_TYPE attr, int a3); + int GetMagicalBonus(enum CHARACTER_ATTRIBUTE_TYPE a2); + char GetActualSkillLevel(enum PLAYER_SKILL_TYPE uSkillType); + int GetSkillBonus(enum CHARACTER_ATTRIBUTE_TYPE a2); + enum CHARACTER_RACE GetRace(); + int GetSexByVoice(); + void SetInitialStats(); + int SetSexByVoice(); + void Reset(unsigned __int8 uClass); + enum PLAYER_SKILL_TYPE GetSkillIdxByOrder(signed int order); + unsigned __int16 DecreaseAttribute(int eAttribute); + int IncreaseAttribute(int eAttribute); + void Player::Zero(); + __int16 GetStatColor(unsigned int uStat); + bool DiscardConditionIfLastsLongerThan(unsigned int uCondition, unsigned __int64 uTime); + int _490EEE(ItemGen *pItem, int a3, int a4, int a5); + int GetBodybuilding(); + int GetMediatation(); + int CanIdentify(ItemGen *pItem); + int CanRepair(ItemGen *); + int GetMerchant(); + int GetPerception(); + int GetDisarmTrap(); + char GetLearningPercent(); + bool CanFitItem(unsigned int uSlot, unsigned int uItemID); + unsigned int FindFreeInventorySlot(); + int CreateItemInInventory(unsigned int uSlot, unsigned int uItemID); + int HasSkill(unsigned int uSkillType); + int WearItem(unsigned int uItemID); + int AddItem(unsigned int uSlot, unsigned int uItemID); + int AddItem2(unsigned int uSlot, ItemGen *Src); + int CreateItemInInventory2(unsigned int uSlot, ItemGen *Src); + bool _49298B(ItemGen *a2, int a3, int a4); + unsigned int RemoveItemAtInventoryIndex(unsigned int uSlot); + bool CanAct(); + bool CanSteal(); + bool CanEquip_RaceAndAlignmentCheck(unsigned int uItemID); + int SetCondition(unsigned int uConditionIdx, int a3); + int _49327B(unsigned int uClass, int a3); + __int16 PlaySound(int a2, int a3); + __int16 PlayEmotion(int a2, int a3); + char _4160CA(int a2); + unsigned int GetItemIDAtInventoryIndex(int *a2); + int _4B6FF9(); + int _4B824B(float a2); + int _4B8265(int a2, float a3); + int _4B8233(int a2, float a3); + int _4B8213(int a2, float a3); + int _4B81C3(int a2, float a3); + int _4B8179(float a2); + int _4B8142(int a2, float a3); + int _4B8102(int a2, float a3); + int _4B807C(float a2); + int _4B8040_condition_time(unsigned int uCondition); + bool _43EEF3(); + void _4BE2DD(unsigned int a2, int a3, int _2devent_idx); + bool Recover(signed int a2); + bool CanCastSpell(unsigned int uRequiredMana); + + + + __int64 pConditions[20]; + unsigned __int64 uExperience; + char pName[16]; + unsigned __int8 uSex; + unsigned __int8 uClass; + unsigned __int8 uFace; + char field_BB; + unsigned __int16 uMight; + unsigned __int16 uMightBonus; + unsigned __int16 uIntelligence; + unsigned __int16 uIntelligenceBonus; + unsigned __int16 uWillpower; + unsigned __int16 uWillpowerBonus; + unsigned __int16 uEndurance; + unsigned __int16 uEnduranceBonus; + unsigned __int16 uSpeed; + unsigned __int16 uSpeedBonus; + unsigned __int16 uAccuracy; + unsigned __int16 uAccuracyBonus; + unsigned __int16 uLuck; + unsigned __int16 uLuckBonus; + __int16 sACModifier; + unsigned __int16 uLevel; + __int16 sLevelModifier; + __int16 sAgeModifier; + int field_E0; + int field_E4; + int field_E8; + int field_EC; + int field_F0; + int field_F4; + int field_F8; + int field_FC; + int field_100; + int field_104; + unsigned __int16 pActiveSkills[37]; + char field_152[64]; + PlayerSpellbook pFileSpellbook; + PlayerSpellbook pAirSpellbook; + PlayerSpellbook pWaterSpellbook; + PlayerSpellbook pEarthSpellbook; + PlayerSpellbook pSpiritSpellbook; + PlayerSpellbook pMindSpellbook; + PlayerSpellbook pBodySpellbook; + PlayerSpellbook pLightSpellbook; + PlayerSpellbook pDarkSpellbook; + char field_1F5[31]; + ItemGen pInventoryItems[126]; + ItemGen pEquippedItems[12]; + int pInventoryIndices[126]; + __int16 sResFireBase; + __int16 sResAirBase; + __int16 sResWaterBase; + __int16 sResEarthBase; + __int16 field_177C; + __int16 sResMagicBase; + __int16 sResSpiritBase; + __int16 sResMindBase; + __int16 sResBodyBase; + __int16 sResLightBase; + __int16 sResDarkBase; + __int16 sResFireBonus; + __int16 sResAirBonus; + __int16 sResWaterBonus; + __int16 sResEarthBonus; + __int16 field_1792; + __int16 sResMagicBonus; + __int16 sResSpiritBonus; + __int16 sResMindBonus; + __int16 sResBodyBonus; + __int16 sResLightBonus; + __int16 sResDarkBonus; + SpellBuff pPlayerBuffs[24]; + unsigned int uVoiceID; + int field_1924; + int field_1928; + int field_192C; + int field_1930; + unsigned __int16 uTimeToRecovery; + char field_1936; + char field_1937; + unsigned int uSkillPoints; + int sHealth; + int sMana; + unsigned int uBirthYear; + PlayerEquipment pEquipment; + int field_1988[49]; + char field_1A4C; + char field_1A4D; + char field_1A4E; + unsigned __int8 uQuickSpell; + char field_1A50[64]; + char _some_attack_bonus; + char field_1A91; + char _melee_dmg_bonus; + char field_1A93; + char _ranged_atk_bonus; + char field_1A95; + char _ranged_dmg_bonus; + char field_1A97; + char uFullHealthBonus; + char _health_related; + char uFullManaBonus; + char _mana_related; + unsigned __int16 uExpressionID; + unsigned __int16 uExpressionTimePassed; + unsigned __int16 uExpressionTimeLength; + __int16 field_1AA2; + int field_1AA4; + int field_1AA8; + LloydBeacon pInstalledBeacons[5]; + char uNumDivineInterventionCastsThisDay; + char uNumArmageddonCasts; + char uNumFireSpikeCasts; + char field_1B3B; +}; +#pragma pack(pop)