save and bone files now can be compressed with ZLib (wow!)
[k8-i-v-a-n.git] / src / game / gear.h
blob7b71bbf07a336aca9677c7356afc386b5be17baa
1 /*
3 * Iter Vehemens ad Necem (IVAN)
4 * Copyright (C) Timo Kiviluoto
5 * Released under the GNU General
6 * Public License
8 * See LICENSING which should be included
9 * along with this file for more details
13 #ifndef __GEAR_H__
14 #define __GEAR_H__
16 #include "item.h"
18 ITEM(meleeweapon, item)
20 public:
21 meleeweapon() { }
22 meleeweapon(const meleeweapon&);
23 virtual ~meleeweapon();
24 virtual truth HitEffect(character*, character*, v2, int, int, truth);
25 virtual void DipInto(liquid*, character*);
26 virtual sLong GetPrice() const;
27 virtual truth IsDippable(ccharacter*) const;
28 virtual material* GetSecondaryMaterial() const { return SecondaryMaterial; }
29 virtual void SetSecondaryMaterial(material*, int = 0);
30 virtual void ChangeSecondaryMaterial(material*, int = 0);
31 void InitMaterials(material*, material*, truth = true);
32 virtual void Save(outputfile&) const;
33 virtual void Load(inputfile&);
34 virtual int GetMaterials() const { return 2; }
35 virtual void AddInventoryEntry(ccharacter*, festring&, int, truth) const;
36 virtual void SignalSpoil(material*);
37 virtual void Be();
38 virtual truth IsWeapon(ccharacter*) const { return true; }
39 virtual int GetEnchantment() const { return Enchantment; }
40 virtual void SetEnchantment(int);
41 virtual void EditEnchantment(int);
42 virtual int GetStrengthValue() const;
43 virtual truth IsFixableBySmith(ccharacter*) const { return IsBroken() || IsRusted(); }
44 virtual truth IsFixableByTailor(ccharacter*) const { return IsBroken(); }
45 virtual double GetTHVBonus() const;
46 virtual double GetDamageBonus() const;
47 virtual int GetSpoilLevel() const;
48 virtual material* GetMaterial(int) const;
49 virtual void TryToRust(sLong);
50 virtual material* GetConsumeMaterial(ccharacter*, materialpredicate = TrueMaterialPredicate) const;
51 virtual pixelpredicate GetFluidPixelAllowedPredicate() const;
52 virtual material* RemoveMaterial(material*);
53 material* RemoveMainMaterial();
54 material* RemoveSecondaryMaterial();
55 virtual v2 GetWieldedBitmapPos(int) const;
56 virtual void CalculateEmitation();
57 virtual void InitMaterials(const materialscript*, const materialscript*, truth);
58 virtual item* Fix();
59 virtual void CalculateEnchantment();
60 virtual truth AllowFluids() const { return true; }
61 virtual int GetSparkleFlags() const;
62 protected:
63 virtual sLong GetMaterialPrice() const;
64 virtual truth CalculateHasBe() const;
65 virtual void PostConstruct();
66 virtual void AddPostFix(festring&, int) const;
67 virtual void GenerateMaterials();
68 virtual col16 GetMaterialColorB(int) const;
69 virtual col16 GetMaterialColorC(int) const;
70 virtual alpha GetAlphaB(int) const;
71 virtual int GetRustDataB() const;
72 virtual col16 GetDripColor() const;
73 virtual truth AllowRegularColors() const;
74 material* SecondaryMaterial;
75 int Enchantment;
78 ITEM(justifier, meleeweapon)
80 public:
81 virtual truth AllowAlphaEverywhere() const { return true; }
82 protected:
83 virtual int GetClassAnimationFrames() const { return 32; }
84 virtual col16 GetOutlineColor(int) const;
85 virtual alpha GetOutlineAlpha(int) const;
88 ITEM(neercseulb, meleeweapon)
90 public:
91 virtual truth HitEffect(character*, character*, v2, int, int, truth);
92 virtual truth AllowAlphaEverywhere() const { return true; }
93 protected:
94 virtual int GetClassAnimationFrames() const { return 32; }
95 virtual col16 GetOutlineColor(int) const;
96 virtual alpha GetOutlineAlpha(int) const;
99 ITEM(pickaxe, meleeweapon)
101 public:
102 virtual truth Apply(character*);
103 virtual truth IsAppliable(ccharacter*) const;
106 ITEM(whip, meleeweapon)
108 public:
109 virtual truth IsWhip() const { return true; }
110 protected:
111 virtual int GetFormModifier() const;
114 ITEM(flamingsword, meleeweapon)
116 public:
117 virtual truth HitEffect(character*, character*, v2, int, int, truth);
118 virtual int GetSpecialFlags() const;
121 ITEM(mjolak, meleeweapon)
123 public:
124 virtual truth HitEffect(character*, character*, v2, int, int, truth);
127 ITEM(vacuumblade, meleeweapon)
129 public:
130 virtual truth HitEffect (character *, character *, v2, int, int, truth);
133 ITEM(vermis, meleeweapon)
135 public:
136 virtual truth HitEffect(character*, character*, v2, int, int, truth);
139 ITEM(turox, meleeweapon)
141 public:
142 virtual truth HitEffect(character*, character*, v2, int, int, truth);
145 ITEM(whipofthievery, whip)
147 public:
148 virtual sLong GetPrice() const;
149 virtual truth HitEffect(character*, character*, v2, int, int, truth);
150 protected:
151 virtual truth CleptiaHelps(ccharacter*, ccharacter*) const;
154 ITEM(gorovitsweapon, meleeweapon)
156 public:
157 virtual truth IsGorovitsFamilyRelic() const { return true; }
158 virtual truth AllowAlphaEverywhere() const { return true; }
159 protected:
160 virtual int GetClassAnimationFrames() const { return 32; }
161 virtual col16 GetOutlineColor(int) const;
162 virtual alpha GetOutlineAlpha(int) const;
165 ITEM(thunderhammer, meleeweapon)
167 public:
168 virtual truth HitEffect(character*, character*, v2, int, int, truth);
169 virtual int GetSpecialFlags() const;
170 virtual truth ReceiveDamage(character*, int, int, int);
173 ITEM(saalthul, meleeweapon)
177 ITEM(armor, item)
179 public:
180 virtual sLong GetPrice() const;
181 virtual void AddInventoryEntry(ccharacter*, festring&, int, truth) const;
182 virtual void Save(outputfile&) const;
183 virtual void Load(inputfile&);
184 virtual truth IsArmor(ccharacter*) const { return true; }
185 virtual int GetEnchantment() const { return Enchantment; }
186 virtual void SetEnchantment(int);
187 virtual void EditEnchantment(int);
188 virtual int GetStrengthValue() const;
189 virtual truth CanBePiledWith(citem*, ccharacter*) const;
190 virtual int GetInElasticityPenalty(int) const;
191 virtual int GetCarryingBonus() const;
192 virtual truth IsFixableBySmith(ccharacter*) const { return IsBroken() || IsRusted(); }
193 virtual truth IsFixableByTailor(ccharacter*) const { return IsBroken(); }
194 virtual truth AllowFluids() const { return true; }
195 virtual void CalculateEnchantment();
196 virtual double GetTHVBonus() const;
197 virtual double GetDamageBonus() const;
198 protected:
199 virtual void AddPostFix(festring&, int) const;
200 virtual void PostConstruct();
201 int Enchantment;
204 ITEM(bodyarmor, armor)
206 public:
207 virtual sLong GetPrice() const;
208 virtual truth IsBodyArmor(ccharacter*) const { return true; }
209 virtual truth IsInCorrectSlot(int) const;
210 protected:
211 virtual cchar* GetBreakVerb() const;
212 virtual truth AddAdjective(festring&, truth) const;
213 virtual cfestring& GetNameSingular() const;
216 ITEM(goldeneagleshirt, bodyarmor)
218 public:
219 virtual truth IsGoldenEagleShirt() const { return true; }
220 virtual truth IsConsumable() const { return false; }
221 virtual truth AllowAlphaEverywhere() const { return true; }
222 protected:
223 virtual int GetClassAnimationFrames() const { return 32; }
224 virtual col16 GetOutlineColor(int) const;
225 virtual alpha GetOutlineAlpha(int) const;
228 ITEM(shield, armor)
230 public:
231 virtual sLong GetPrice() const;
232 virtual truth IsShield(ccharacter*) const { return true; }
233 virtual void AddInventoryEntry(ccharacter*, festring&, int, truth) const;
236 ITEM(cloak, armor)
238 public:
239 virtual sLong GetPrice() const;
240 virtual truth IsCloak(ccharacter*) const { return true; }
241 virtual truth IsInCorrectSlot(int) const;
242 virtual truth ReceiveDamage(character*, int, int, int);
243 protected:
244 virtual int GetSpecialFlags() const;
245 virtual cchar* GetBreakVerb() const;
246 virtual truth AddAdjective(festring&, truth) const;
247 virtual col16 GetMaterialColorB(int) const;
250 ITEM(boot, armor)
252 public:
253 virtual sLong GetPrice() const;
254 virtual truth IsBoot(ccharacter*) const { return true; }
255 virtual truth IsInCorrectSlot(int) const;
258 ITEM(gauntlet, armor)
260 public:
261 virtual sLong GetPrice() const;
262 virtual truth IsGauntlet(ccharacter*) const { return true; }
263 virtual truth IsInCorrectSlot(int) const;
266 ITEM(belt, armor)
268 public:
269 virtual sLong GetPrice() const;
270 virtual truth IsBelt(ccharacter*) const { return true; }
271 virtual int GetFormModifier() const;
272 virtual truth IsInCorrectSlot(int) const;
273 virtual col16 GetMaterialColorB(int Frame) const { return GetMaterialColorA(Frame); }
276 typedef lockable<belt, itemlock> lockablebelt;
278 ITEM(ring, item)
280 public:
281 virtual truth IsRing(ccharacter*) const { return true; }
282 virtual truth IsInCorrectSlot(int) const;
283 virtual truth IsLuxuryItem(ccharacter*) const { return true; }
284 protected:
285 virtual col16 GetMaterialColorB(int) const;
288 ITEM(ringofthieves, ring)
290 public:
291 virtual truth IsRingOfThieves () const { return true; }
294 ITEM(amulet, item)
296 public:
297 virtual truth IsAmulet(ccharacter*) const { return true; }
298 virtual truth IsInCorrectSlot(int) const;
299 virtual truth IsLuxuryItem(ccharacter*) const { return true; }
300 protected:
301 virtual col16 GetMaterialColorB(int) const;
304 ITEM(helmet, armor)
306 public:
307 virtual truth IsGorovitsFamilyRelic() const;
308 virtual sLong GetPrice() const;
309 virtual truth IsHelmet(ccharacter*) const { return true; }
310 virtual truth IsInCorrectSlot(int) const;
311 protected:
312 virtual col16 GetMaterialColorB(int) const;
313 virtual col16 GetMaterialColorC(int) const;
316 ITEM(chameleonwhip, whip)
318 public:
319 virtual truth HitEffect(character*, character*, v2, int, int, truth);
320 protected:
321 virtual truth ScabiesHelps(ccharacter*, ccharacter*) const;
324 ITEM(wondersmellstaff, meleeweapon)
326 public:
327 virtual truth HitEffect(character*, character*, v2, int, int, truth);
328 virtual truth AllowAlphaEverywhere() const { return true; }
329 virtual void Break(character*, int);
330 protected:
331 virtual int GetClassAnimationFrames() const;
332 virtual col16 GetOutlineColor(int) const;
333 virtual alpha GetOutlineAlpha(int) const;
336 ITEM(decosadshirt, bodyarmor)
338 public:
339 decosadshirt();
340 virtual void Be();
341 virtual void Save(outputfile&) const;
342 virtual void Load(inputfile&);
343 feuLong GetEquippedTicks() { return EquippedTicks; }
344 void SetEquippedTicks(feuLong What) { EquippedTicks = What; }
345 virtual truth IsDecosAdShirt(ccharacter*) const { return true; }
346 protected:
347 virtual truth CalculateHasBe() const { return true; }
348 feuLong EquippedTicks;
351 ITEM(weepblade, meleeweapon)
353 public:
354 virtual truth HitEffect(character*, character*, v2, int, int, truth);
357 ITEM(daggerofvenom, meleeweapon)
359 public:
360 daggerofvenom() { Enable(); }
361 virtual void Be();
362 protected:
363 virtual truth CalculateHasBe() const { return true; }
367 ITEM(acidshield, shield)
369 public:
370 virtual void BlockEffect(character*, character*, item*, int Type);
373 ITEM(chastitybelt, lockablebelt)
375 public:
376 virtual int GetFormModifier() const { return item::GetFormModifier(); }
379 ITEM(sunsword, meleeweapon)
383 ITEM(rescuethepeasant, meleeweapon)
387 ITEM(vormav, meleeweapon)
391 ITEM(cronus, meleeweapon)
395 ITEM(defender, meleeweapon)
399 ITEM(aethier, meleeweapon)
403 ITEM(aegis, shield)
407 ITEM(phoenixshield, shield)
411 ITEM(belderiver, meleeweapon)
413 public:
414 virtual truth AllowAlphaEverywhere () const { return true; }
415 protected:
416 virtual int GetClassAnimationFrames () const { return 32; }
417 virtual col16 GetOutlineColor (int) const;
418 virtual alpha GetOutlineAlpha (int) const;
421 ITEM(loricatushammer, meleeweapon)
423 public:
424 virtual truth AllowAlphaEverywhere () const { return true; }
425 protected:
426 virtual int GetClassAnimationFrames() const { return 32; }
427 virtual col16 GetOutlineColor (int) const;
428 virtual alpha GetOutlineAlpha (int) const;
431 ITEM(goldenjaguarshirt, bodyarmor)
433 public:
434 virtual truth IsConsumable () const { return false; }
435 virtual truth AllowAlphaEverywhere () const { return true; }
436 protected:
437 virtual int GetClassAnimationFrames () const { return 32; }
438 virtual col16 GetOutlineColor (int) const;
439 virtual alpha GetOutlineAlpha (int) const;
442 ITEM(demonhead, meleeweapon)
444 public:
445 virtual truth AllowAlphaEverywhere () const { return true; }
446 protected:
447 virtual int GetClassAnimationFrames () const { return 32; }
448 virtual col16 GetOutlineColor (int) const;
449 virtual alpha GetOutlineAlpha (int) const;
452 ITEM(smite, meleeweapon)
454 public:
455 virtual truth HitEffect (character *, character *, v2, int, int, truth);
456 virtual int GetSpecialFlags () const;
457 virtual truth ReceiveDamage (character*, int, int, int);
460 ITEM(muramasa, meleeweapon)
462 public:
463 virtual truth HitEffect (character *, character *, v2, int, int, truth);
464 virtual truth AllowAlphaEverywhere() const { return true; }
465 protected:
466 virtual int GetClassAnimationFrames () const { return 32; }
467 virtual col16 GetOutlineColor (int) const;
468 virtual alpha GetOutlineAlpha (int) const;
471 ITEM(masamune, meleeweapon)
473 public:
474 virtual truth HitEffect (character *, character *, v2, int, int, truth);
475 virtual truth AllowAlphaEverywhere () const { return true; }
476 protected:
477 virtual int GetClassAnimationFrames () const { return 32; }
478 virtual col16 GetOutlineColor(int) const;
479 virtual alpha GetOutlineAlpha(int) const;
482 ITEM(zulfiqar, meleeweapon)
484 public:
485 virtual truth HitEffect (character *, character *, v2, int, int, truth);
488 ITEM(tipswordofpenetration, meleeweapon)
490 public:
491 virtual truth HitEffect (character *, character *, v2, int, int, truth);
494 ITEM(maingauche, meleeweapon)
498 ITEM(gleipnir, whipofthievery)
502 ITEM(kawai, meleeweapon)
504 public:
505 virtual truth HitEffect (character *, character *, v2, int, int, truth);
506 virtual truth AllowAlphaEverywhere() const { return true; }
507 protected:
508 virtual int GetClassAnimationFrames () const { return 32; }
509 virtual col16 GetOutlineColor (int) const;
510 virtual alpha GetOutlineAlpha (int) const;
514 ITEM(eptyron, meleeweapon)
516 public:
517 virtual truth HitEffect(character*, character*, v2, int, int, truth);
518 virtual void BlockEffect(character*, character*, item*, int Type);
519 virtual truth AllowAlphaEverywhere() const { return true; }
520 //virtual void Break(character*, int); //should it have a break effect??
521 protected:
522 virtual int GetClassAnimationFrames() const;
523 virtual col16 GetOutlineColor(int) const;
524 virtual alpha GetOutlineAlpha(int) const;
527 ITEM(taiaha, meleeweapon)
529 public:
530 //virtual truth HitEffect(character*, character*, v2, int, int, truth);
531 //virtual void BlockEffect(character*, character*, item*, int Type);
532 virtual truth AllowAlphaEverywhere() const { return true; }
533 virtual void Save(outputfile&) const;
534 virtual void Load(inputfile&);
535 virtual void ChargeFully(character*) { TimesUsed = 0; }
536 virtual truth IsAppliable(ccharacter*) const { return false; }
537 virtual truth IsZappable(ccharacter*) const { return true; }
538 virtual truth IsChargeable(ccharacter*) const { return true; }
539 virtual truth ReceiveDamage(character*, int, int, int);
540 virtual truth Zap(character*, v2, int);
541 virtual void AddInventoryEntry(ccharacter*, festring&, int, truth) const; //this?
542 virtual truth IsExplosive() const { return true; }
543 protected:
544 virtual int GetClassAnimationFrames() const;
545 virtual col16 GetOutlineColor(int) const;
546 virtual alpha GetOutlineAlpha(int) const;
547 virtual void PostConstruct();
548 void BreakEffect(character*, cfestring&);
549 //feuLong GetSpecialParameters() const;
550 int Charges;
551 int TimesUsed;
555 #endif