4 * Created on: Aug 9, 2012
12 #include "TargetingMode.h"
13 #include "../graphics/fwd.h"
22 static const int TYPE_ID = 303;
28 const char *Name() const { return name; }
30 bool IsMostUseful() const { return mostUseful; }
31 bool IsEquipable() const { return equipability; }
32 bool IsCursed() const { return cursed; }
33 bool IsFruit() const { return fruit; }
34 bool IsScenario() const { return scenario; }
35 bool CanSell() const { return !IsScenario(); }
36 bool CanDrop() const { return !IsScenario(); }
37 bool CanUseOnStatusScreen() const { return status; }
38 bool CanUseInBattle() const { return battle; }
40 TargetingMode &GetTargetingMode() { return targettingMode; }
41 const TargetingMode &GetTargetingMode() const { return targettingMode; }
43 bool HasMenuIcon() const { return menuIcon; }
44 const graphics::Sprite *MenuIcon() const { return menuIcon; }
45 bool HasChestIcon() const { return chestIcon; }
46 const graphics::Sprite *ChestIcon() const { return chestIcon; }
48 bool HasIkari() const { return ikari; }
49 const Ikari *GetIkari() const { return ikari; }
51 graphics::Animation *AttackAnimation() { return attackAnimation; }
52 const graphics::Animation *AttackAnimation() const { return attackAnimation; }
54 Uint16 Value() const { return value; }
56 bool CanEquipWeapon() const { return equipability & EQUIPPABLE_WEAPON; }
57 bool CanEquipArmor() const { return equipability & EQUIPPABLE_ARMOR; }
58 bool CanEquipShield() const { return equipability & EQUIPPABLE_SHIELD; }
59 bool CanEquipHelmet() const { return equipability & EQUIPPABLE_HELMET; }
60 bool CanEquipRing() const { return equipability & EQUIPPABLE_RING; }
61 bool CanEquipJewel() const { return equipability & EQUIPPABLE_JEWEL; }
63 int HeroMask() const { return heroMask; }
65 bool HasEffectOnStatusScreen() const { return properties & PROPERTY_HAS_EFFECT_STATUS; }
66 bool HasEffectInBattle() const { return properties & PROPERTY_HAS_EFFECT_BATTLE; }
67 bool HasWeaponEffect() const { return properties & PROPERTY_HAS_WEAPON_EFFECT; }
68 bool HasArmorEffect() const { return properties & PROPERTY_HAS_ARMOR_EFFECT; }
69 bool IncreasesATP() const { return properties & PROPERTY_INCREASE_ATP; }
70 bool IncreasesDFP() const { return properties & PROPERTY_INCREASE_DFP; }
71 bool IncreasesSTR() const { return properties & PROPERTY_INCREASE_STR; }
72 bool IncreasesAGL() const { return properties & PROPERTY_INCREASE_AGL; }
73 bool IncreasesINT() const { return properties & PROPERTY_INCREASE_INT; }
74 bool IncreasesGUT() const { return properties & PROPERTY_INCREASE_GUT; }
75 bool IncreasesMGR() const { return properties & PROPERTY_INCREASE_MGR; }
76 bool HasBattleAnimation() const { return properties & PROPERTY_HAS_BATTLE_ANIMATION; }
77 bool HasIkariEffect() const { return properties & PROPERTY_HAS_IKARI_EFFECT; }
79 static bool Less(const Item &, const Item &);
83 void SetName(const char *n) { name = n; }
84 void SetMenuIcon(const graphics::Sprite *icon) { menuIcon = icon; }
85 void SetUsableInBattle() { battle = true; }
86 void SetIkari(const Ikari *i) { ikari = i; }
87 void SetAttackAnimation(graphics::Animation *a) { attackAnimation = a; }
89 static void CreateTypeDescription();
90 static void Construct(void *);
95 EQUIPPABLE_WEAPON = 1,
97 EQUIPPABLE_SHIELD = 4,
98 EQUIPPABLE_HELMET = 8,
100 EQUIPPABLE_JEWEL = 32,
103 PROPERTY_HAS_EFFECT_STATUS = 1,
104 PROPERTY_HAS_EFFECT_BATTLE = 2,
105 PROPERTY_HAS_WEAPON_EFFECT = 4,
106 PROPERTY_HAS_ARMOR_EFFECT = 8,
107 PROPERTY_INCREASE_ATP = 16,
108 PROPERTY_INCREASE_DFP = 32,
109 PROPERTY_INCREASE_STR = 64,
110 PROPERTY_INCREASE_AGL = 128,
111 PROPERTY_INCREASE_INT = 256,
112 PROPERTY_INCREASE_GUT = 512,
113 PROPERTY_INCREASE_MGR = 1024,
114 // PROPERTY_UNUSED = 2048,
115 // PROPERTY_UNUSED = 4096,
116 PROPERTY_HAS_BATTLE_ANIMATION = 8192,
117 // PROPERTY_UNKNOWN = 16384,
118 PROPERTY_HAS_IKARI_EFFECT = 32768,
123 const graphics::Sprite *menuIcon;
124 const graphics::Sprite *chestIcon;
126 graphics::Animation *attackAnimation;
131 TargetingMode targettingMode;
135 // TODO: turn these back into bits as soon as fields are implemented in the loader
147 #endif /* COMMON_ITEM_H_ */