2 #include "BipedObject.h" 52 float m_fDefense, m_fDefenseflat, m_fDefenseMental;
55 float m_fAttackMelee, m_fAttackRanged, m_fAttackMental;
78 virtual CBaseObject::_SceneObjectType GetType(){
return CBaseObject::RPGBiped;};
92 ATTRIBUTE_METHOD1(
CRpgCharacter, GetCharacterID_s,
int*) {*p1 = cls->GetCharacterID();
return S_OK;}
93 ATTRIBUTE_METHOD1(
CRpgCharacter, SetCharacterID_s,
int) {cls->SetCharacterID(p1);
return S_OK;}
95 ATTRIBUTE_METHOD1(
CRpgCharacter, GetCharacterType_s,
int*) {*p1 = cls->GetCharacterType();
return S_OK;}
96 ATTRIBUTE_METHOD1(
CRpgCharacter, SetCharacterType_s,
int) {cls->SetCharacterType(p1);
return S_OK;}
98 ATTRIBUTE_METHOD1(
CRpgCharacter, GetMentalState0_s,
int*) {*p1 = cls->GetMentalState(0);
return S_OK;}
99 ATTRIBUTE_METHOD1(
CRpgCharacter, SetMentalState0_s,
int) {cls->SetMentalState(0, (byte)p1);
return S_OK;}
100 ATTRIBUTE_METHOD1(
CRpgCharacter, GetMentalState1_s,
int*) {*p1 = cls->GetMentalState(1);
return S_OK;}
101 ATTRIBUTE_METHOD1(
CRpgCharacter, SetMentalState1_s,
int) {cls->SetMentalState(1, (byte)p1);
return S_OK;}
102 ATTRIBUTE_METHOD1(
CRpgCharacter, GetMentalState2_s,
int*) {*p1 = cls->GetMentalState(2);
return S_OK;}
103 ATTRIBUTE_METHOD1(
CRpgCharacter, SetMentalState2_s,
int) {cls->SetMentalState(2, (byte)p1);
return S_OK;}
104 ATTRIBUTE_METHOD1(
CRpgCharacter, GetMentalState3_s,
int*) {*p1 = cls->GetMentalState(3);
return S_OK;}
105 ATTRIBUTE_METHOD1(
CRpgCharacter, SetMentalState3_s,
int) {cls->SetMentalState(3, (byte)p1);
return S_OK;}
107 #ifndef DEFINE_ATTRIBUTE_METHODS_DND 108 #define DEFINE_ATTRIBUTE_METHODS_DND(type, AttriName) \ 109 ATTRIBUTE_METHOD1(CRpgCharacter, Get##AttriName##_s, type*) {*p1 = cls->Get##AttriName(); return S_OK;}\ 110 ATTRIBUTE_METHOD1(CRpgCharacter, Set##AttriName##_s, type) {cls->Set##AttriName(p1); return S_OK;} 113 DEFINE_ATTRIBUTE_METHODS_DND(
float, LifePoint);
114 DEFINE_ATTRIBUTE_METHODS_DND(
float, Age);
115 DEFINE_ATTRIBUTE_METHODS_DND(
float, BodyHeight);
116 DEFINE_ATTRIBUTE_METHODS_DND(
float, Weight);
117 DEFINE_ATTRIBUTE_METHODS_DND(
int, Occupation);
118 DEFINE_ATTRIBUTE_METHODS_DND(
int, RaceSex);
119 DEFINE_ATTRIBUTE_METHODS_DND(
float, Strength);
120 DEFINE_ATTRIBUTE_METHODS_DND(
float, Dexterity);
121 DEFINE_ATTRIBUTE_METHODS_DND(
float, Intelligence);
122 DEFINE_ATTRIBUTE_METHODS_DND(
float, BaseDefense);
123 DEFINE_ATTRIBUTE_METHODS_DND(
float, Defense);
124 DEFINE_ATTRIBUTE_METHODS_DND(
float, Defenseflat);
125 DEFINE_ATTRIBUTE_METHODS_DND(
float, DefenseMental);
126 DEFINE_ATTRIBUTE_METHODS_DND(
float, BaseAttack);
128 DEFINE_ATTRIBUTE_METHODS_DND(
float, AttackMelee);
129 DEFINE_ATTRIBUTE_METHODS_DND(
float, AttackRanged);
130 DEFINE_ATTRIBUTE_METHODS_DND(
float, AttackMental);
131 DEFINE_ATTRIBUTE_METHODS_DND(
float, MaxLifeLoad);
132 DEFINE_ATTRIBUTE_METHODS_DND(
int, HeroPoints);
165 void SetCharacterType(
int nType);
172 DWORD GetMentalState(
int nIndex);
178 void SetMentalState(
int nIndex, DWORD data);
185 #ifndef DEFINE_CLASS_ATTRIBUTE_DND 186 #define DEFINE_CLASS_ATTRIBUTE_DND(type, AttriName, memberName, defaultValue) \ 187 type Get##AttriName(){return (m_pDnDAttribute!=0)?m_pDnDAttribute->memberName : defaultValue;} \ 188 void Set##AttriName(type p1){if(m_pDnDAttribute!=0) m_pDnDAttribute->memberName = p1;} 191 DEFINE_CLASS_ATTRIBUTE_DND(
float, LifePoint, m_fLifePoint, 1);
192 DEFINE_CLASS_ATTRIBUTE_DND(
float, Age, m_fAge, 1);
193 DEFINE_CLASS_ATTRIBUTE_DND(
float, BodyHeight, m_fHeight, 1);
194 DEFINE_CLASS_ATTRIBUTE_DND(
float, Weight, m_fWeight, 1);
195 DEFINE_CLASS_ATTRIBUTE_DND(
int, Occupation, m_nOccupation, 1);
196 DEFINE_CLASS_ATTRIBUTE_DND(
int, RaceSex, m_nRaceSex, 1);
197 DEFINE_CLASS_ATTRIBUTE_DND(
float, Strength, m_fStrength, 1);
198 DEFINE_CLASS_ATTRIBUTE_DND(
float, Dexterity, m_fDexterity, 1);
199 DEFINE_CLASS_ATTRIBUTE_DND(
float, Intelligence, m_fIntelligence, 1);
200 DEFINE_CLASS_ATTRIBUTE_DND(
float, BaseDefense, m_fBaseDefense, 1);
201 DEFINE_CLASS_ATTRIBUTE_DND(
float, Defense, m_fDefense, 1);
202 DEFINE_CLASS_ATTRIBUTE_DND(
float, Defenseflat, m_fDefenseflat, 1);
203 DEFINE_CLASS_ATTRIBUTE_DND(
float, DefenseMental, m_fDefenseMental, 1);
204 DEFINE_CLASS_ATTRIBUTE_DND(
float, BaseAttack, m_fBaseAttack, 1);
205 DEFINE_CLASS_ATTRIBUTE_DND(
float, AttackMelee, m_fAttackMelee, 1);
206 DEFINE_CLASS_ATTRIBUTE_DND(
float, AttackRanged, m_fAttackRanged, 1);
207 DEFINE_CLASS_ATTRIBUTE_DND(
float, AttackMental, m_fAttackMental, 1);
208 DEFINE_CLASS_ATTRIBUTE_DND(
float, MaxLifeLoad, m_fMaxLifeLoad, 1);
209 DEFINE_CLASS_ATTRIBUTE_DND(
int, HeroPoints, m_nHeroPoints, 1);
216 int GetSkill(
int nIndex);
222 void SetSkill(
int nIndex,
int nSkillID);
229 int GetTool(
int nIndex);
235 void SetTool(
int nIndex,
int ntoolID);
252 bool UpdateFromNPCDbItem(
const CNpcDbItem& npc, DWORD dwFields);
257 int m_nCharacterType;
260 vector<DWORD> m_MentalStates;
float m_fHeight
the height of the character.
Definition: RpgCharacter.h:35
virtual int GetAttributeClassID()
attribute class ID should be identical, unless one knows how overriding rules work.
Definition: RpgCharacter.h:84
an attribute class is a collection of attribute fields.
Definition: AttributeClass.h:10
int GetCharacterID()
get character ID in the database
Definition: RpgCharacter.h:149
float m_fAge
the age of the character.
Definition: RpgCharacter.h:33
float m_fWeight
the weight of the character.
Definition: RpgCharacter.h:38
A typical character in role playing game.
Definition: RpgCharacter.h:73
different physics engine has different winding order.
Definition: EventBinding.h:32
virtual const char * GetAttributeClassName()
a static string, describing the attribute class object's name
Definition: RpgCharacter.h:86
float m_fStrength
character strength
Definition: RpgCharacter.h:45
float m_fMaxLifeLoad
the maximum load that a character can lift or carry
Definition: RpgCharacter.h:57
virtual const char * GetAttributeClassDescription()
a static string, describing the attribute class object
Definition: RpgCharacter.h:88
vector< int > m_tools
character tool ID lists: such as weapons, medicines as in its inventory
Definition: RpgCharacter.h:65
vector< int > m_skills
character skill ID lists: such as magics
Definition: RpgCharacter.h:63
int m_nHeroPoints
levels can be deducted from this value.
Definition: RpgCharacter.h:60
int m_nRaceSex
the race and sex of the character.
Definition: RpgCharacter.h:42
int m_nOccupation
the occupation of the character.
Definition: RpgCharacter.h:40
virtual const char * GetAttributeClassName()
a static string, describing the attribute class object's name
Definition: RpgCharacter.h:23
float m_fBaseDefense
character base defense
Definition: RpgCharacter.h:51
CHARACTER_TYPE
character type.
Definition: RpgCharacter.h:137
void SetCharacterID(int nID)
set character ID in the database
Definition: RpgCharacter.h:154
NPC database item (complete)
Definition: NpcDatabase.h:8
float m_fDexterity
character dexterity
Definition: RpgCharacter.h:47
A common interface for all classes implementing IAttributeFields By implementing this class's virtual...
Definition: IAttributeFields.h:59
Dungeons and Dragons character attributes.
Definition: RpgCharacter.h:13
float m_fIntelligence
character Intelligence
Definition: RpgCharacter.h:49
float m_fBaseAttack
character base attack
Definition: RpgCharacter.h:54
virtual const char * GetAttributeClassDescription()
a static string, describing the attribute class object
Definition: RpgCharacter.h:25
virtual int GetAttributeClassID()
attribute class ID should be identical, unless one knows how overriding rules work.
Definition: RpgCharacter.h:21
float m_fLifePoint
the life or hit point of the character.
Definition: RpgCharacter.h:31
int GetCharacterType()
get type
Definition: RpgCharacter.h:160
It can be used to represent biped object(like human, re spawning monsters) in the scene without inher...
Definition: BipedObject.h:60