4 * Created on: Aug 9, 2012
12 #include "HeroGroup.h"
13 #include "TargetingMode.h"
14 #include "../graphics/fwd.h"
26 const char *Name() const { return name; }
28 bool IsMostUseful() const { return mostUseful; }
29 bool IsEquipable() const { return equipable; }
30 bool IsCursed() const { return cursed; }
31 bool IsFruit() const { return fruit; }
32 bool IsScenario() const { return scenario; }
33 bool CanSell() const { return !IsScenario(); }
34 bool CanDrop() const { return !IsScenario(); }
35 bool CanUseOnStatusScreen() const { return status; }
36 bool CanUseInBattle() const { return battle; }
38 TargetingMode &GetTargetingMode() { return targettingMode; }
39 const TargetingMode &GetTargetingMode() const { return targettingMode; }
41 bool HasMenuIcon() const { return menuIcon; }
42 const graphics::Sprite *MenuIcon() const { return menuIcon; }
43 bool HasChestIcon() const { return chestIcon; }
44 const graphics::Sprite *ChestIcon() const { return chestIcon; }
46 bool HasIkari() const { return ikari; }
47 const Ikari *GetIkari() const { return ikari; }
49 graphics::Animation *AttackAnimation() { return attackAnimation; }
50 const graphics::Animation *AttackAnimation() const { return attackAnimation; }
52 Uint16 Value() const { return value; }
54 bool CanEquipWeapon() const { return equipability & EQUIPPABLE_WEAPON; }
55 bool CanEquipArmor() const { return equipability & EQUIPPABLE_ARMOR; }
56 bool CanEquipShield() const { return equipability & EQUIPPABLE_SHIELD; }
57 bool CanEquipHelmet() const { return equipability & EQUIPPABLE_HELMET; }
58 bool CanEquipRing() const { return equipability & EQUIPPABLE_RING; }
59 bool CanEquipJewel() const { return equipability & EQUIPPABLE_JEWEL; }
61 HeroGroup &EquipableBy() { return equipableBy; }
62 const HeroGroup &EquipableBy() const { return equipableBy; }
64 bool HasEffectOnStatusScreen() const { return properties & PROPERTY_HAS_EFFECT_STATUS; }
65 bool HasEffectInBattle() const { return properties & PROPERTY_HAS_EFFECT_BATTLE; }
66 bool HasWeaponEffect() const { return properties & PROPERTY_HAS_WEAPON_EFFECT; }
67 bool HasArmorEffect() const { return properties & PROPERTY_HAS_ARMOR_EFFECT; }
68 bool IncreasesATP() const { return properties & PROPERTY_INCREASE_ATP; }
69 bool IncreasesDFP() const { return properties & PROPERTY_INCREASE_DFP; }
70 bool IncreasesSTR() const { return properties & PROPERTY_INCREASE_STR; }
71 bool IncreasesAGL() const { return properties & PROPERTY_INCREASE_AGL; }
72 bool IncreasesINT() const { return properties & PROPERTY_INCREASE_INT; }
73 bool IncreasesGUT() const { return properties & PROPERTY_INCREASE_GUT; }
74 bool IncreasesMGR() const { return properties & PROPERTY_INCREASE_MGR; }
75 bool HasBattleAnimation() const { return properties & PROPERTY_HAS_BATTLE_ANIMATION; }
76 bool HasIkariEffect() const { return properties & PROPERTY_HAS_IKARI_EFFECT; }
80 void SetName(const char *n) { name = n; }
81 void SetMenuIcon(const graphics::Sprite *icon) { menuIcon = icon; }
82 void SetUsableInBattle() { battle = true; }
83 void SetIkari(const Ikari *i) { ikari = i; }
84 void SetAttackAnimation(graphics::Animation *a) { attackAnimation = a; }
86 static void CreateTypeDescription();
87 static void Construct(void *);
92 EQUIPPABLE_WEAPON = 1,
94 EQUIPPABLE_SHIELD = 4,
95 EQUIPPABLE_HELMET = 8,
97 EQUIPPABLE_JEWEL = 32,
100 PROPERTY_HAS_EFFECT_STATUS = 1,
101 PROPERTY_HAS_EFFECT_BATTLE = 2,
102 PROPERTY_HAS_WEAPON_EFFECT = 4,
103 PROPERTY_HAS_ARMOR_EFFECT = 8,
104 PROPERTY_INCREASE_ATP = 16,
105 PROPERTY_INCREASE_DFP = 32,
106 PROPERTY_INCREASE_STR = 64,
107 PROPERTY_INCREASE_AGL = 128,
108 PROPERTY_INCREASE_INT = 256,
109 PROPERTY_INCREASE_GUT = 512,
110 PROPERTY_INCREASE_MGR = 1024,
111 // PROPERTY_UNUSED = 2048,
112 // PROPERTY_UNUSED = 4096,
113 PROPERTY_HAS_BATTLE_ANIMATION = 8192,
114 // PROPERTY_UNKNOWN = 16384,
115 PROPERTY_HAS_IKARI_EFFECT = 32768,
120 const graphics::Sprite *menuIcon;
121 const graphics::Sprite *chestIcon;
123 graphics::Animation *attackAnimation;
128 TargetingMode targettingMode;
130 HeroGroup equipableBy;
132 // TODO: turn these back into bits as soon as fields are implemented in the loader
145 #endif /* COMMON_ITEM_H_ */