4 * Created on: Aug 9, 2012
11 #include "HeroGroup.h"
12 #include "TargetingMode.h"
31 const char *Name() const { return name; }
33 bool IsMostUseful() const { return usability & USABILITY_MOST_USEFUL; }
34 bool IsEquipable() const { return usability & USABILITY_EQUIPABLE; }
35 bool IsCursed() const { return usability & USABILITY_CURSED; }
36 bool IsFruit() const { return usability & USABILITY_FRUIT; }
37 bool IsScenario() const { return usability & USABILITY_SCENARIO; }
38 bool CanSell() const { return !IsScenario(); }
39 bool CanDrop() const { return !IsScenario(); }
40 bool CanUseOnStatusScreen() const { return usability & USABILITY_STATUS; }
41 bool CanUseInBattle() const { return usability & USABILITY_BATTLE; }
43 TargetingMode &GetTargetingMode() { return targettingMode; }
44 const TargetingMode &GetTargetingMode() const { return targettingMode; }
46 bool HasMenuIcon() const { return menuIcon; }
47 const graphics::Sprite *MenuIcon() const { return menuIcon; }
48 bool HasChestIcon() const { return chestIcon; }
49 const graphics::Sprite *ChestIcon() const { return chestIcon; }
51 bool HasIkari() const { return ikari; }
52 const Ikari *GetIkari() const { return ikari; }
54 graphics::Animation *AttackAnimation() { return attackAnimation; }
55 const graphics::Animation *AttackAnimation() const { return attackAnimation; }
57 Uint16 Value() const { return value; }
59 bool CanEquipWeapon() const { return equipable & EQUIPPABLE_WEAPON; }
60 bool CanEquipArmor() const { return equipable & EQUIPPABLE_ARMOR; }
61 bool CanEquipShield() const { return equipable & EQUIPPABLE_SHIELD; }
62 bool CanEquipHelmet() const { return equipable & EQUIPPABLE_HELMET; }
63 bool CanEquipRing() const { return equipable & EQUIPPABLE_RING; }
64 bool CanEquipJewel() const { return equipable & EQUIPPABLE_JEWEL; }
66 HeroGroup &EquipableBy() { return equipableBy; }
67 const HeroGroup &EquipableBy() const { return equipableBy; }
69 bool HasEffectOnStatusScreen() const { return properties & PROPERTY_HAS_EFFECT_STATUS; }
70 bool HasEffectInBattle() const { return properties & PROPERTY_HAS_EFFECT_BATTLE; }
71 bool HasWeaponEffect() const { return properties & PROPERTY_HAS_WEAPON_EFFECT; }
72 bool HasArmorEffect() const { return properties & PROPERTY_HAS_ARMOR_EFFECT; }
73 bool IncreasesATP() const { return properties & PROPERTY_INCREASE_ATP; }
74 bool IncreasesDFP() const { return properties & PROPERTY_INCREASE_DFP; }
75 bool IncreasesSTR() const { return properties & PROPERTY_INCREASE_STR; }
76 bool IncreasesAGL() const { return properties & PROPERTY_INCREASE_AGL; }
77 bool IncreasesINT() const { return properties & PROPERTY_INCREASE_INT; }
78 bool IncreasesGUT() const { return properties & PROPERTY_INCREASE_GUT; }
79 bool IncreasesMGR() const { return properties & PROPERTY_INCREASE_MGR; }
80 bool HasBattleAnimation() const { return properties & PROPERTY_HAS_BATTLE_ANIMATION; }
81 bool HasIkariEffect() const { return properties & PROPERTY_HAS_IKARI_EFFECT; }
85 void SetName(const char *n) { name = n; }
86 void SetMenuIcon(const graphics::Sprite *icon) { menuIcon = icon; }
87 void SetUsableInBattle() { usability |= USABILITY_BATTLE; }
88 void SetIkari(const Ikari *i) { ikari = i; }
89 void SetAttackAnimation(graphics::Animation *a) { attackAnimation = a; }
93 USABILITY_MOST_USEFUL = 1,
94 USABILITY_EQUIPABLE = 2,
95 // USABILITY_UNUSED = 4,
98 USABILITY_SCENARIO = 32,
99 USABILITY_STATUS = 64,
100 USABILITY_BATTLE = 128,
104 EQUIPPABLE_WEAPON = 1,
105 EQUIPPABLE_ARMOR = 2,
106 EQUIPPABLE_SHIELD = 4,
107 EQUIPPABLE_HELMET = 8,
108 EQUIPPABLE_RING = 16,
109 EQUIPPABLE_JEWEL = 32,
112 PROPERTY_HAS_EFFECT_STATUS = 1,
113 PROPERTY_HAS_EFFECT_BATTLE = 2,
114 PROPERTY_HAS_WEAPON_EFFECT = 4,
115 PROPERTY_HAS_ARMOR_EFFECT = 8,
116 PROPERTY_INCREASE_ATP = 16,
117 PROPERTY_INCREASE_DFP = 32,
118 PROPERTY_INCREASE_STR = 64,
119 PROPERTY_INCREASE_AGL = 128,
120 PROPERTY_INCREASE_INT = 256,
121 PROPERTY_INCREASE_GUT = 512,
122 PROPERTY_INCREASE_MGR = 1024,
123 // PROPERTY_UNUSED = 2048,
124 // PROPERTY_UNUSED = 4096,
125 PROPERTY_HAS_BATTLE_ANIMATION = 8192,
126 // PROPERTY_UNKNOWN = 16384,
127 PROPERTY_HAS_IKARI_EFFECT = 32768,
132 const graphics::Sprite *menuIcon;
133 const graphics::Sprite *chestIcon;
135 graphics::Animation *attackAnimation;
141 TargetingMode targettingMode;
143 HeroGroup equipableBy;
149 #endif /* COMMON_ITEM_H_ */