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 RY_SABRINA_ACTOR_CREATURE_H
20 #define RY_SABRINA_ACTOR_CREATURE_H
23 #include "sabrina_actor.h"
24 #include "sabrina_pointers.h"
27 * AI specialisation of Sabrina actor class
29 * \author Nevrax France
33 class CSabrinaActorCreature
: public ISabrinaActor
36 //------------------------------------------------------------------------------------------------------
38 CSabrinaActorCreature(CEntityBase
*parent
);
39 CSabrinaActorCreature(const CSabrinaActorCreature
& other
);
40 virtual ~CSabrinaActorCreature();
43 //------------------------------------------------------------------------------------------------------
44 // Management of the creature's own actions
46 virtual void beginSabrinaAction(const ISabrinaPhraseModel
* phrase
);
47 virtual void cancelSabrinaAction(SABRINA::TEventCode reason
);
50 //------------------------------------------------------------------------------------------------------
51 // Virtual application of results of a Sabrina Action to a target
53 virtual void cbSabrinaActionApplyBegin();
54 virtual void applyHeal(SABRINA::THealType healType
,uint32 value
);
55 virtual void applyDamage(SABRINA::TDmgType damageType
, uint32 value
);
56 virtual void applyBeginSecondaryEffect(SABRINA::TEffectType effectType
, uint32 strength
);
57 virtual void applyEndSecondaryEffect(SABRINA::TEffectType effectType
);
58 virtual void cbSabrinaActionApplyEnd();
61 //------------------------------------------------------------------------------------------------------
62 // Virtual Read Accessor Interface
64 virtual sint32
getSkillValue(SKILLS::ESkills skill
) const;
65 virtual sint32
getAttackSkillValue() const;
66 virtual sint32
getDefenseSkillValue() const;
67 virtual sint32
getDodgeSkillValue() const;
68 virtual bool getRightHandWeaponStats(CWeaponStats
& stats
) const;
69 virtual bool getLeftHandWeaponStats(CWeaponStats
& stats
) const;
70 virtual bool getAmmoStats(CWeaponStats
& stats
) const;
71 virtual bool getArmorProtectionStats(SLOT_EQUIPMENT::TSlotEquipment slot
,CArmorStats
& protection
) const;
72 virtual bool getLeftHandProtectionStats(CShieldStats
& protection
) const;
73 virtual ISabrinaActor
* getTarget() const;
76 //------------------------------------------------------------------------------------------------------
77 // Logical test routines
79 virtual bool isValidOffensiveTarget(ISabrinaActor
* target
) const;
80 virtual bool isValidCurativeTarget(ISabrinaActor
* target
) const;
83 //------------------------------------------------------------------------------------------------------
84 // Virtual callbacks for message sending on activation/ cancelation of Sabrina actions
86 virtual void cbSabrinaActionBegin(const CSabrinaPhraseInstance
* completedPhrase
);
87 virtual void cbSabrinaActionSuccess(const CSabrinaPhraseInstance
* completedPhrase
, SABRINA::TEventCode code
);
88 virtual void cbSabrinaActionFailure(const CSabrinaPhraseInstance
* completedPhrase
, SABRINA::TEventCode code
);
89 virtual void cbSabrinaActionCancel(const CSabrinaPhraseInstance
* completedPhrase
, SABRINA::TEventCode code
);
90 virtual void cbSabrinaActionEnd(const CSabrinaPhraseInstance
* completedPhrase
);
93 //------------------------------------------------------------------------------------------------------
97 const CStaticCreatures
*_CreatureForm
;
99 /// defense value (parry or dodge)
100 sint32 _AttackSkillValue
;
102 /// defense value (parry or dodge)
103 sint32 _DefenseSkillValue
;
105 /// defense value (parry or dodge)
106 sint32 _DodgeSkillValue
;
109 CArmorStats _GlobalArmorStats
;
111 /// Equivalent Weapon stats
112 CWeaponStats _RightHandWeaponStats
;
113 CWeaponStats _LeftHandWeaponStats
;