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 mostUseful; }
34 bool IsEquipable() const { return equipable; }
35 bool IsCursed() const { return cursed; }
36 bool IsFruit() const { return fruit; }
37 bool IsScenario() const { return scenario; }
38 bool CanSell() const { return !IsScenario(); }
39 bool CanDrop() const { return !IsScenario(); }
40 bool CanUseOnStatusScreen() const { return status; }
41 bool CanUseInBattle() const { return 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 equipability & EQUIPPABLE_WEAPON; }
60 bool CanEquipArmor() const { return equipability & EQUIPPABLE_ARMOR; }
61 bool CanEquipShield() const { return equipability & EQUIPPABLE_SHIELD; }
62 bool CanEquipHelmet() const { return equipability & EQUIPPABLE_HELMET; }
63 bool CanEquipRing() const { return equipability & EQUIPPABLE_RING; }
64 bool CanEquipJewel() const { return equipability & 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() { battle = true; }
88 void SetIkari(const Ikari *i) { ikari = i; }
89 void SetAttackAnimation(graphics::Animation *a) { attackAnimation = a; }
91 static void CreateTypeDescription();
92 static void Construct(void *);
97 EQUIPPABLE_WEAPON = 1,
99 EQUIPPABLE_SHIELD = 4,
100 EQUIPPABLE_HELMET = 8,
101 EQUIPPABLE_RING = 16,
102 EQUIPPABLE_JEWEL = 32,
105 PROPERTY_HAS_EFFECT_STATUS = 1,
106 PROPERTY_HAS_EFFECT_BATTLE = 2,
107 PROPERTY_HAS_WEAPON_EFFECT = 4,
108 PROPERTY_HAS_ARMOR_EFFECT = 8,
109 PROPERTY_INCREASE_ATP = 16,
110 PROPERTY_INCREASE_DFP = 32,
111 PROPERTY_INCREASE_STR = 64,
112 PROPERTY_INCREASE_AGL = 128,
113 PROPERTY_INCREASE_INT = 256,
114 PROPERTY_INCREASE_GUT = 512,
115 PROPERTY_INCREASE_MGR = 1024,
116 // PROPERTY_UNUSED = 2048,
117 // PROPERTY_UNUSED = 4096,
118 PROPERTY_HAS_BATTLE_ANIMATION = 8192,
119 // PROPERTY_UNKNOWN = 16384,
120 PROPERTY_HAS_IKARI_EFFECT = 32768,
125 const graphics::Sprite *menuIcon;
126 const graphics::Sprite *chestIcon;
128 graphics::Animation *attackAnimation;
133 TargetingMode targettingMode;
135 HeroGroup equipableBy;
137 // TODO: turn these back into bits as soon as fields are implemented in the loader
150 #endif /* COMMON_ITEM_H_ */