1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef CL_CHARACTER_SHEET_H
21 #define CL_CHARACTER_SHEET_H
27 #include "client_sheets.h"
29 #include "nel/misc/types_nl.h"
30 #include "nel/misc/rgba.h"
32 #include "entity_sheet.h"
33 #include "ground_fx_sheet.h"
34 #include "body_to_bone_sheet.h"
36 #include "game_share/loot_harvest_state.h"
37 #include "game_share/people.h"
57 * Class to manage the character sheet.
58 * \author Guillaume PUZIN
59 * \author Nevrax France
62 class CCharacterSheet
: public CEntitySheet
65 enum { NumAttackLists
= 8 };
70 NLMISC::TSStringId IdItem
;
71 NLMISC::TSStringId IdBindPoint
;
77 IdItem
= NLMISC::CStaticStringMapper::emptyId();
78 IdBindPoint
= NLMISC::CStaticStringMapper::emptyId();
83 std::string
getItem() const { return ClientSheetsStrings
.get(IdItem
); }
84 std::string
getBindPoint() const { return ClientSheetsStrings
.get(IdBindPoint
); }
86 /// Serialize character sheet into binary data file.
87 virtual void serial(NLMISC::IStream
&f
)
90 ClientSheetsStrings
.serial(f
, IdItem
);
93 ClientSheetsStrings
.serial(f
, IdBindPoint
);
100 EGSPD::CPeople::TPeople Race
;
101 // Character's skeleton.
102 NLMISC::TSStringId IdSkelFilename
;
103 // Base Name of the animation set.
104 NLMISC::TSStringId IdAnimSetBaseName
;
106 NLMISC::TSStringId IdAutomaton
;
108 // The sound familly (used for sound context var 2)
110 // The sound variation (used for sound context var 3)
111 uint32 SoundVariation
;
113 NLMISC::TSStringId IdLodCharacterName
;
114 float LodCharacterDistance
;
115 // value to scale the "pos" channel of the animation of the creature.
116 float CharacterScalePos
;
117 // The name of the faction the creature belongs to
118 NLMISC::TSStringId IdFame
;
120 // Possible(impossible) Actions.
127 bool SelectableBySpace
;
128 //character harvest/loot state
129 LHSTATE::TLHState HLState
;
132 // Equipment worm or creature body.
140 CEquipment ObjectInRightHand
;
141 CEquipment ObjectInLeftHand
;
142 // Yoyo: if you add some, modify getWholeEquipmentList()
149 // NLMISC::TSStringId IdFirstName;
150 // NLMISC::TSStringId IdLastName;
166 // New flags created for bot objects
167 bool DisplayInRadar
; // display the entity in the radar
168 bool DisplayOSDName
; // name is displayed if (DisplayOSD && DisplayName)
169 bool DisplayOSDBars
; // bars are displayed if (DisplayOSD && DisplayBars)
170 bool DisplayOSDForceOver
; // even if ClientCfg.ShowNameUnderCursor==false, force OSD to display when under cursor (DisplayOSD must be true)
171 bool Traversable
; // the client can traverse this entity after some force time
173 // Name positions on Z axis
175 float NamePosZNormal
;
179 std::vector
<NLMISC::TSStringId
> IdAlternativeClothes
;
182 std::vector
<CEquipment
> HairItemList
;
184 // list of fx for some ground type (step fxs)
185 std::vector
<CGroundFXSheet
> GroundFX
;
187 // name of static FX played on entity (empty if none)
188 NLMISC::TSStringId IdStaticFX
;
191 CBodyToBoneSheet BodyToBone
;
193 // spell casting prefix. This prefix is used to see which sheet contains datas about spell casting
194 NLMISC::TSStringId SpellCastingPrefix
;
196 // attack lists filenames
197 std::vector
<NLMISC::TSStringId
> AttackLists
;
200 sint8 RegionForce
; // Force depending on the region the creature belongs
201 sint8 ForceLevel
; // Level of creature inside the same region
202 uint16 Level
; // Precise level of the creature
209 NLMISC::CVector Origin
;
211 void serial(NLMISC::IStream
&f
)
217 // offset for projectile casting (useful for watchtowers as they got no bones)
218 std::vector
<CCastRay
> ProjectileCastRay
;
223 std::string
getSkelFilename() const { return ClientSheetsStrings
.get(IdSkelFilename
); }
224 std::string
getAnimSetBaseName() const { return ClientSheetsStrings
.get(IdAnimSetBaseName
); }
225 std::string
getAutomaton() const { return ClientSheetsStrings
.get(IdAutomaton
); }
226 std::string
getLodCharacterName() const { return ClientSheetsStrings
.get(IdLodCharacterName
); }
227 std::string
getFame() const { return ClientSheetsStrings
.get(IdFame
); }
228 // std::string getFirstName() const { return ClientSheetsStrings.get(IdFirstName); }
229 // std::string getLastName() const { return ClientSheetsStrings.get(IdLastName); }
230 std::string
getAlternativeClothes(uint i
) const { return ClientSheetsStrings
.get(IdAlternativeClothes
[i
]); }
231 std::string
getStaticFX() const { return ClientSheetsStrings
.get(IdStaticFX
); }
233 /// Build the sheet from an external script.
234 virtual void build(const NLGEORGES::UFormElm
&item
);
236 /// Serialize character sheet into binary data file.
237 virtual void serial(NLMISC::IStream
&f
);
239 /// Return the list of all equipement possibles (body... + HairList). Pointers should be used localy
240 void getWholeEquipmentList(std::vector
<const CEquipment
*> &equipList
) const;
243 /// Read an equipment slot.
244 void readEquipment(const NLGEORGES::UFormElm
&form
, const std::string
&key
, CEquipment
&slot
);
248 #endif // CL_CHARACTER_SHEET_H
250 /* End of character_sheet.h */