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/>.
19 #ifndef RYZOM_FABER_PHRASE_H
20 #define RYZOM_FABER_PHRASE_H
22 #include "nel/misc/types_nl.h"
24 #include "faber_action.h"
28 * This class represents a faber phrase in the Sabrina system. See CSPhrase for methods definitions
29 * \author Alain Saffray
30 * \author Nevrax France
33 class CFaberPhrase
: public CSPhrase
41 virtual ~CFaberPhrase() { _Mps
.clear(); if(_FaberAction
) delete _FaberAction
; }
43 /// \name Override methods from CSPhrase
45 virtual bool build( const TDataSetRow
& actorRowId
, const std::vector
< const CStaticBrick
* >& bricks
);
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
);
56 * \return true if phrase is valide
58 virtual bool validate();
59 virtual bool update();
60 virtual void execute();
67 virtual void setActor( const TDataSetRow
&entityRowId
){}
70 * called at the end of the latency time
75 ///\unused basic methods from CSPhrase
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
& ) {}
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
; }
107 IFaberAction
* _FaberAction
;
110 TDataSetRow _ActorRowId
;
112 /// total cost (sabrina system)
114 /// total credit (sabrina system)
115 sint32 _SabrinaCredit
;
116 /// stamina cost of the faber action
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
;
129 sint32 _MBODurability
;
134 sint16 _MBOProtection
;
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 */