/TGame/TCommon/Combat/CombatDefinition.h

http://awoe.googlecode.com/ · C Header · 96 lines · 71 code · 16 blank · 9 comment · 1 complexity · 25f66b638fdd5bd71202c98fb2321e95 MD5 · raw file

  1. #ifndef __COMBAT_DEFINITION___
  2. #define __COMBAT_DEFINITION___
  3. namespace Combat
  4. {
  5. enum CombatTarget
  6. {
  7. Tgt_Enemy,
  8. Tgt_EnemyInRange,
  9. Tgt_Alies,
  10. Tgt_AliesAndSelf,
  11. Tgt_Self,
  12. };
  13. //
  14. // Combat State:
  15. // state Peace: no combat
  16. // state Ready: in combat, ready for casting a spell to its target
  17. // state Casting: in combat, casting a spell on its target
  18. // state CoolDown: in combat, cool down time interval just after a previous spell is casted
  19. // state Forbidden: in combat, forbidden to cast a spell
  20. // state Charging: in combat, approaching to its target for casting a spell
  21. //
  22. enum CombatState
  23. {
  24. CBS_Begin = -1, // Invalid
  25. CBS_Peace, // not in combat with some others
  26. CBS_Ready, // in combat, ready to cast a spell
  27. CBS_Casting, // in combat, casting spell
  28. CBS_CoolDown, // in combat, cool down time between two spell cast
  29. CBS_Forbidden, // in combat, forbidden to cast a spell
  30. CBS_Charging, // in combat, charging for an melee or ranged attack
  31. CBS_Standby, // out of combat temperately, all casting operation will cancel this state
  32. CBS_End, // Invalid
  33. };
  34. enum CombatFaction
  35. {
  36. FC_Unknown,
  37. FC_Player,
  38. FC_Monster,
  39. FC_Max,
  40. };
  41. enum CombatFlagIndex
  42. {
  43. FIdx_Daze,
  44. FIdx_Forbbiden_CastMelee,
  45. FIdx_CanBeTargeted,
  46. FIdx_75ToHit,
  47. FIdx_ZeroToDodge,
  48. };
  49. enum CombatProperty
  50. {
  51. CBP_Start = 0,
  52. CBP_Class_Start = 0,
  53. CBP_Soldier = 0,
  54. CBP_Wizard,
  55. CBP_Explorer,
  56. CBP_Beauty,
  57. CBP_Dancer,
  58. CBP_Class_End = 5,
  59. CBP_Element_Start = 5,
  60. CBP_Fire = 5,
  61. CBP_Water,
  62. CBP_Light,
  63. CBP_Earth,
  64. CBP_Spirit,
  65. CBP_Element_End = 10,
  66. CBP_Attribute_Start = 10,
  67. CBP_Power = 10,
  68. CBP_Toughness,
  69. CBP_Evade,
  70. CBP_Luck,
  71. CBP_Focus,
  72. CBP_Attribute_End = 15,
  73. CBP_End = 15,
  74. };
  75. inline bool CBP_Validate(const short& nIdx)
  76. {
  77. return nIdx>=CBP_Start && nIdx<CBP_End;
  78. }
  79. }
  80. #endif