global_skills.h

Go to the documentation of this file.
00001 
00002 //            Copyright (C) 2004-2007 by The Allacrost Project
00003 //                         All Rights Reserved
00004 //
00005 // This code is licensed under the GNU GPL version 2. It is free software 
00006 // and you may modify it and/or redistribute it under the terms of this license.
00007 // See http://www.gnu.org/copyleft/gpl.html for details.
00009 
00021 #ifndef __GLOBAL_SKILLS_HEADER__
00022 #define __GLOBAL_SKILLS_HEADER__
00023 
00024 #include "defs.h"
00025 #include "utils.h"
00026 
00027 #include "global_actors.h"
00028 
00029 namespace hoa_global {
00030 
00031 namespace private_global {
00032 
00041 const uint32 MAX_ATTACK_ID   = 10000;
00042 const uint32 MAX_DEFEND_ID   = 20000;
00043 const uint32 MAX_SUPPORT_ID  = 30000;
00045 
00046 } // namespace private_global
00047 
00052 enum GLOBAL_ELEMENTAL {
00053   GLOBAL_ELEMENTAL_INVALID    = 0,
00054   GLOBAL_ELEMENTAL_FIRE       = 1,
00055   GLOBAL_ELEMENTAL_WATER      = 2,
00056   GLOBAL_ELEMENTAL_VOLT       = 3,
00057   GLOBAL_ELEMENTAL_EARTH      = 4,
00058   GLOBAL_ELEMENTAL_SLICING    = 5,
00059   GLOBAL_ELEMENTAL_SMASHING   = 6,
00060   GLOBAL_ELEMENTAL_MAULING    = 7,
00061   GLOBAL_ELEMENTAL_PIERCING   = 8,
00062   GLOBAL_ELEMENTAL_TOTAL      = 9
00063 };
00064 
00068 enum GLOBAL_STATUS {
00069   GLOBAL_STATUS_INVALID    = -1,
00070   GLOBAL_STATUS_POISON     = 0,
00071   GLOBAL_STATUS_SLOW       = 1,
00072   GLOBAL_STATUS_TOTAL      = 2
00073 };
00074 
00080 enum GLOBAL_INTENSITY {
00081   GLOBAL_INTENSITY_INVALID       = -5,
00082   GLOBAL_INTENSITY_NEG_EXTREME   = -4,
00083   GLOBAL_INTENSITY_NEG_GREATER   = -3,
00084   GLOBAL_INTENSITY_NEG_MODERATE  = -2,
00085   GLOBAL_INTENSITY_NEG_LESSER    = -1,
00086   GLOBAL_INTENSITY_NEUTRAL       = 0,
00087   GLOBAL_INTENSITY_POS_LESSER    = 1,
00088   GLOBAL_INTENSITY_POS_MODERATE  = 2,
00089   GLOBAL_INTENSITY_POS_GREATER   = 3,
00090   GLOBAL_INTENSITY_POS_EXTREME   = 4,
00091   GLOBAL_INTENSITY_TOTAL         = 5
00092 };
00093 
00097 enum GLOBAL_SKILL {
00098   GLOBAL_SKILL_INVALID  = -1,
00099   GLOBAL_SKILL_ATTACK   =  0,
00100   GLOBAL_SKILL_DEFEND   =  1,
00101   GLOBAL_SKILL_SUPPORT  =  2,
00102   GLOBAL_SKILL_TOTAL    =  3
00103 };
00104 
00105 
00119 class GlobalElementalEffect {
00120 public:
00121   GlobalElementalEffect() :
00122     _type(GLOBAL_ELEMENTAL_INVALID), _intensity(GLOBAL_INTENSITY_NEUTRAL) {}
00123 
00124   ~GlobalElementalEffect()
00125     {}
00126 
00131   GLOBAL_ELEMENTAL GetType() const
00132     { return _type; }
00133 
00134   GLOBAL_INTENSITY GetIntensity() const
00135     { return _intensity; }
00136 
00137   void SetIntensity(GLOBAL_INTENSITY intensity)
00138     { _intensity = intensity; }
00140 
00144   void IncrementIntensity(uint8 amount = 1);
00145   
00149   void DecrementIntensity(uint8 amount = 1);
00150 
00151 private:
00156   GLOBAL_ELEMENTAL _type;
00157 
00163   GLOBAL_INTENSITY _intensity;
00164 }; // class GlobalElementalEffect
00165 
00166 
00167 
00184 class GlobalStatusEffect {
00185 public:
00186   GlobalStatusEffect(GLOBAL_STATUS type, GLOBAL_INTENSITY intensity = GLOBAL_INTENSITY_NEUTRAL) :
00187     _type(type), _intensity(intensity) {}
00188 
00189   ~GlobalStatusEffect()
00190     {}
00191 
00192   // TODO: Return a pointer from image stored in GameGlobal
00193   // hoa_video::StillImage* GetIconImage();
00194 
00196 
00197   GLOBAL_STATUS GetType() const
00198     { return _type; }
00199 
00200   GLOBAL_INTENSITY GetIntensity() const
00201     { return _intensity; }
00202 
00203   void SetIntensity(GLOBAL_INTENSITY intensity)
00204     { _intensity = intensity; }
00206 
00219   bool IncrementIntensity(uint8 amount);
00220   
00229   bool DecrementIntensity(uint8 amount);
00230 
00231 private:
00236   GLOBAL_STATUS _type;
00237 
00242   GLOBAL_INTENSITY _intensity;
00243 }; // class GlobalStatusEffect
00244 
00245 
00266 class GlobalSkill {
00267 public:
00269   GlobalSkill(uint32 id);
00270 
00271   ~GlobalSkill();
00272 
00274   bool IsExecutableInBattle() const
00275     { return ((_usage == GLOBAL_USE_BATTLE) || (_usage == GLOBAL_USE_ALL)); }
00276 
00278   bool IsExecutableInMenu() const
00279     { return ((_usage == GLOBAL_USE_MENU) || (_usage == GLOBAL_USE_ALL)); }
00280   //@
00281 
00287   void BattleExecute(hoa_battle::private_battle::BattleActor* target, hoa_battle::private_battle::BattleActor* instigator);
00288 
00293   void MenuExecute(GlobalCharacter* target, GlobalCharacter* instigator);
00294 
00300   hoa_utils::ustring GetName() const
00301     { return _name; }
00302 
00303   hoa_utils::ustring GetDescription() const
00304     { return _description; }
00305 
00306   uint32 GetID() const
00307     { return _id; }
00308 
00309   uint8 GetType() const
00310     { return _type; }
00311 
00312   uint32 GetSPRequired() const
00313     { return _sp_required; }
00314 
00315   uint32 GetWarmupTime() const
00316     { return _warmup_time; }
00317 
00318   uint32 GetCooldownTime() const
00319     { return _cooldown_time; }
00320 
00321   GLOBAL_USE GetUsage() const
00322     { return _usage; }
00323 
00324   GLOBAL_TARGET GetTargetType() const
00325     { return _target_type; }
00326 
00327   bool IsTargetAlly() const
00328     { return _target_ally; }
00329     
00330 //  std::vector<GlobalElementalEffect*>& GetElementalEffects() const
00331 //    { return _elemental_effects; }
00332 
00333 //  std::vector<std::pair<float, GlobalStatusEffect*> >& GetStatusEffects() const
00334 //    { return _status_effects; }
00336 
00337 private:
00339   hoa_utils::ustring _name;
00340 
00342   hoa_utils::ustring _description;
00343 
00345   uint32 _id;
00346 
00350   GLOBAL_SKILL _type;
00351 
00356   uint32 _sp_required;
00357 
00363   uint32 _warmup_time;
00364 
00369   uint32 _cooldown_time;
00370 
00372   GLOBAL_USE _usage;
00373 
00375   GLOBAL_TARGET _target_type;
00376 
00378   bool _target_ally;
00379 
00385 //  std::vector<GlobalElementalEffect*> _elemental_effects;
00386 
00393 //  std::vector<std::pair<float, GlobalStatusEffect*> > _status_effects;
00394 
00396   ScriptObject* _battle_execute_function;
00397 
00399   ScriptObject* _menu_execute_function;
00400 }; // class GlobalSkill
00401 
00402 } // namespace hoa_global
00403 
00404 #endif // __GLOBAL_SKILLS_HEADER__

Generated on Fri Jul 6 23:11:15 2007 for Hero of Allacrost by  doxygen 1.5.1