Resolve "Toggle Free Look with Hotkey"
[ryzomcore.git] / ryzom / server / src / sabrina / faber_phrase.h
blobbba3c565d8c518b3aff2e6350a0ad416d583bed2
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
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.
8 //
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/>.
19 #ifndef RYZOM_FABER_PHRASE_H
20 #define RYZOM_FABER_PHRASE_H
22 #include "nel/misc/types_nl.h"
23 #include "s_phrase.h"
24 #include "faber_action.h"
27 /**
28 * This class represents a faber phrase in the Sabrina system. See CSPhrase for methods definitions
29 * \author Alain Saffray
30 * \author Nevrax France
31 * \date 2003
33 class CFaberPhrase : public CSPhrase
35 public:
37 /// ctor
38 CFaberPhrase();
40 /// dtor
41 virtual ~CFaberPhrase() { _Mps.clear(); if(_FaberAction) delete _FaberAction; }
43 /// \name Override methods from CSPhrase
44 //@{
45 virtual bool build( const TDataSetRow & actorRowId, const std::vector< const CStaticBrick* >& bricks );
47 /**
48 * evaluate phrase
49 * \param evalReturnInfos struct that will receive evaluation results
50 * \return true if eval has been made without errors
52 virtual bool evaluate(CEvalReturnInfos *msg = NULL);
54 /**
55 * validate phrase
56 * \return true if phrase is valide
58 virtual bool validate();
59 virtual bool update();
60 virtual void execute();
61 virtual void apply();
62 //@}
64 /**
65 * set the actor
67 virtual void setActor( const TDataSetRow &entityRowId ){}
69 /**
70 * called at the end of the latency time
72 virtual void end(){}
73 //@}
75 ///\unused basic methods from CSPhrase
76 //@{
77 virtual void setPrimaryItem( CGameItemPtr itemPtr ){}
78 virtual void setSecondaryItem( CGameItemPtr itemPtr ){}
79 virtual void addConsumableItem( CGameItemPtr itemPtr ){}
80 virtual void setPrimaryTarget( const TDataSetRow& ) {}
81 virtual void addTargetEntity( const TDataSetRow& ) {}
82 //@}
84 inline const TDataSetRow & getActor() { return _ActorRowId;}
85 inline sint32 getSabrinaCost() { return _SabrinaCost; }
86 inline sint32 getSabrinaCredit() { return _SabrinaCredit; }
87 inline const CStaticItem * getRootFaberPlan() { return _RootFaberPlan; }
88 inline const CStaticItem * getTool() { return _Tool; }
89 inline std::vector< const CStaticItem * > getMps() { return _Mps; }
92 inline sint16 getMBOQuality() { return _MBOQuality; }
93 inline sint32 getMBODurability() { return _MBODurability; }
94 inline float getMBOWeight() { return _MBOMBOWeight; }
95 inline sint16 getMBODmg() { return _MBODmg; }
96 inline float getMBOSpeed() { return _MBOSpeed; }
97 inline float getMBORange() { return _MBORange; }
98 inline sint16 getMBOProtection() { return _MBOProtection; }
99 inline sint16 getMBOSapLoad() { return _MBOSapLoad; }
101 // craft item for system item instanciate
102 CGameItemPtr systemCraftItem( const NLMISC::CSheetId& sheet, const std::vector< NLMISC::CSheetId >& Mp );
103 inline void setCraftedItem( CGameItemPtr item ) { _CraftedItem = item; }
105 private:
106 // Faber action
107 IFaberAction * _FaberAction;
109 /// acting entity
110 TDataSetRow _ActorRowId;
112 /// total cost (sabrina system)
113 sint32 _SabrinaCost;
114 /// total credit (sabrina system)
115 sint32 _SabrinaCredit;
116 /// stamina cost of the faber action
117 sint32 _StaminaCost;
118 /// hp cost
119 sint32 _HPCost;
120 /// faber time in ticks
121 NLMISC::TGameCycle _FaberTime;
123 // craft action params for result
124 const CStaticItem * _RootFaberPlan;
125 const CStaticItem * _Tool;
126 std::vector< const CStaticItem * > _Mps;
128 sint16 _MBOQuality;
129 sint32 _MBODurability;
130 float _MBOMBOWeight;
131 sint16 _MBODmg;
132 float _MBOSpeed;
133 float _MBORange;
134 sint16 _MBOProtection;
135 sint16 _MBOSapLoad;
136 CGameItemPtr _CraftedItem; // only for internal use for system craft, no persistant pointers
139 #endif // RYZOM_FABER_PHRASE_H
141 /* End of faber_phrase.h */