My Project
 
Loading...
Searching...
No Matches
weapon.h
Go to the documentation of this file.
1#pragma once
2
3#include "kindofweapon.h"
4#include "typedefine.h"
5#include "wndbag.h"
6#include "bpt.h"
7
8class Weapon :public KindOfWeapon{
9public:
10 class Enchantment :public Bundlable{
11 private:
12 static std::string _enchants[];
13 static std::vector<std::string> enchants;
14 static float _chances[];
15 static std::vector<float> chances;
16
17 typedef Enchantment* (*CreateEnchant)();
18 static std::map<std::string, CreateEnchant> clsToInst;
19
20 public:
21 virtual boolean proc(Weapon* weapon, Char* attacker, Char* defender, int damage) = 0;
22 virtual String name(const String& weaponName) {
23 return weaponName;
24 }
25 virtual void restoreFromBundle(Bundle* bundle) {
26 }
27 virtual void storeInBundle(Bundle* bundle) {
28 }
30
31 static Enchantment* random();
32 static void init();
33 };
34private:
35 static const int HITS_TO_KNOW = 20;
36
37 static const String TXT_IDENTIFY;
38 static const String TXT_INCOMPATIBLE;
39
40 static const String TXT_TO_STRING;
41 static const String TXT_BROKEN;
42 static const String UNFAMILIRIARITY;
43 static const String ENCHANTMENT;
44 static const String IMBUE;
45
46 int hitsToKnow;
47public:
48 int STR;
49 float ACU;
50 float DLY;
51
52 enum Imbue {
54 };
56
57 Weapon();
58 virtual void proc(Char* attacker, Char* defender, int damage);
59
60 virtual std::string getClassName() { return "Weapon"; }
61
62 virtual void storeInBundle(Bundle* bundle);
63 virtual void restoreFromBundle(Bundle* bundle);
64 virtual float acuracyFactor(Hero* hero);
65 virtual float speedFactor(Hero* hero);
66 virtual int damageRoll(Hero* owner);
67
68 Item* upgrade(boolean enchant);
69
70 virtual int maxDurability(int lvl) {
71 return 5 * (lvl < 16 ? 16 - lvl : 1);
72 }
73 virtual String toString();
74 virtual String Name();
75 virtual Item* random();
76 Weapon* enchant(Enchantment* ench);
77 Weapon* enchant();
78 boolean isEnchanted() {
79 return enchantment != NULL;
80 }
82protected:
84};
85
87private:
88 static const String TXT_BLAZING;
89
90 static ItemSprite::Glowing* ORANGE;
91
92public:
93 virtual boolean proc(Weapon* weapon, Char* attacker, Char* defender, int damage);
94 virtual ItemSprite::Glowing* glowing() { return ORANGE; }
95 virtual String name(const String& weaponName);
96
97 virtual std::string getClassName() { return "EnchantmentFire"; }
98 static Weapon::Enchantment* Create() { return new EnchantmentFire(); }
99};
100
102private:
103 static const String TXT_VENOMOUS;
104
105 static ItemSprite::Glowing* PURPLE;
106
107public:
108 virtual boolean proc(Weapon* weapon, Char* attacker, Char* defender, int damage);
109 virtual ItemSprite::Glowing* glowing() { return PURPLE; }
110 virtual String name(const String& weaponName);
111
112 virtual std::string getClassName() { return "EnchantmentPoison"; }
113 static Weapon::Enchantment* Create() { return new EnchantmentPoison(); }
114};
115
117private:
118 static const String TXT_GRIM;
119
120 static ItemSprite::Glowing* BLACK;
121
122public:
123 virtual boolean proc(Weapon* weapon, Char* attacker, Char* defender, int damage);
124 virtual ItemSprite::Glowing* glowing() { return BLACK; }
125 virtual String name(const String& weaponName);
126
127 virtual std::string getClassName() { return "Death"; }
128 static Weapon::Enchantment* Create() { return new Death(); }
129};
130
132private:
133 static const String TXT_STUNNING;
134
135 static ItemSprite::Glowing* YELLOW;
136
137public:
138 virtual boolean proc(Weapon* weapon, Char* attacker, Char* defender, int damage);
139 virtual ItemSprite::Glowing* glowing() { return YELLOW; }
140 virtual String name(const String& weaponName);
141
142 virtual std::string getClassName() { return "EnchantmentParalysis"; }
144};
145
147private:
148 static const String TXT_VAMPIRIC;
149
150 static ItemSprite::Glowing* RED;
151
152public:
153 virtual boolean proc(Weapon* weapon, Char* attacker, Char* defender, int damage);
154 virtual ItemSprite::Glowing* glowing() { return RED; }
155 virtual String name(const String& weaponName);
156
157 virtual std::string getClassName() { return "Leech"; }
158 static Weapon::Enchantment* Create() { return new Leech(); }
159};
160
162private:
163 static const String TXT_CHILLING;
164
165 static ItemSprite::Glowing* BLUE;
166
167public:
168 virtual boolean proc(Weapon* weapon, Char* attacker, Char* defender, int damage);
169 virtual ItemSprite::Glowing* glowing() { return BLUE; }
170 virtual String name(const String& weaponName);
171
172 virtual std::string getClassName() { return "EnchantmentSlow"; }
173 static Weapon::Enchantment* Create() { return new EnchantmentSlow(); }
174};
175
177private:
178 static const String TXT_SHOCKING;
179
180 List<Char*> affected;
181 int points[20];;
182 int nPoints;
183
184 void hit(Char* ch, int damage);
185public:
186 virtual boolean proc(Weapon* weapon, Char* attacker, Char* defender, int damage);
187 virtual String name(const String& weaponName);
188
189 virtual std::string getClassName() { return "Shock"; }
190 static Weapon::Enchantment* Create() { return new Shock(); }
191};
192
194private:
195 static const String TXT_UNSTABLE;
196public:
197 virtual boolean proc(Weapon* weapon, Char* attacker, Char* defender, int damage);
198 virtual String name(const String& weaponName);
199
200 virtual std::string getClassName() { return "Instability"; }
201 static Weapon::Enchantment* Create() { return new Instability(); }
202};
203
205private:
206 static const String TXT_ELDRITCH;
207
208 static ItemSprite::Glowing* GREY;
209
210public:
211 virtual boolean proc(Weapon* weapon, Char* attacker, Char* defender, int damage);
212 virtual ItemSprite::Glowing* glowing() { return GREY; }
213 virtual String name(const String& weaponName);
214
215 virtual std::string getClassName() { return "Horror"; }
216 static Weapon::Enchantment* Create() { return new Horror(); }
217};
218
220private:
221 static const String TXT_LUCKY;
222
223 static ItemSprite::Glowing* GREEN;
224
225public:
226 virtual std::string getClassName() { return "Luck"; }
227
228 virtual boolean proc(Weapon* weapon, Char* attacker, Char* defender, int damage);
229 virtual ItemSprite::Glowing* glowing() { return GREEN; }
230 virtual String name(const String& weaponName);
231
232 static Weapon::Enchantment* Create() { return new Luck(); }
233};
234
236private:
237 static const String TXT_TEMPERED;
238
239 static ItemSprite::Glowing* GRAY;
240
241public:
242 virtual std::string getClassName() { return "Tempering"; }
243
244 virtual boolean proc(Weapon* weapon, Char* attacker, Char* defender, int damage);
245 virtual ItemSprite::Glowing* glowing() { return GRAY; }
246 virtual String name(const String& weaponName);
247
248 static Weapon::Enchantment* Create() { return new Tempering(); }
249};
250
251class MeleeWeapon :public Weapon{
252public:
253 MeleeWeapon(int tier, float acu, float dly);
254
255 virtual std::string getClassName() { return "MeleeWeapon"; }
256
257 virtual int min() {
258 return isBroken() ? min0() : min0() + Level();
259 }
260 virtual int max() {
261 return isBroken() ? max0() : max0() + Level() * tier;
262 }
263 virtual Item* upgrade() {
264 return upgrade(false);
265 }
266
267 Item* upgrade(boolean enchant) {
268 STR--;
269 return Weapon::upgrade(enchant);
270 }
272 return upgrade(enchantment != NULL);
273 }
274
275 virtual Item* degrade() {
276 STR++;
277 return Weapon::degrade();
278 }
279
281 return 8 + tier * 2;
282 }
283 virtual String info();
284 virtual int price();
285
286 virtual Item* random();
287private:
288 int tier;
289
290protected:
291 virtual int min0() { return tier; }
292
293 virtual int max0() { return (int)((tier * tier - tier + 10) / ACU * DLY); }
294};
295
296class Dagger :public MeleeWeapon{
297public:
298 Dagger();
299
300 virtual String desc() {
301 //return "A simple iron dagger with a well worn wooden handle.";
302 return BPT::getText("lang.dagger_desc");
303 }
304
305 virtual std::string getClassName() { return "Dagger"; }
306 static Item* Create() { return new Dagger(); }
307};
308
309class Knuckles :public MeleeWeapon{
310public:
311 Knuckles();
312 virtual String desc() {
313 //return "A piece of iron shaped to fit around the knuckles.";
314 return BPT::getText("lang.knuckles_desc");
315 }
316
317 virtual std::string getClassName() { return "Knuckles"; }
318 static Item* Create() { return new Knuckles(); }
319};
320
322public:
323 Quarterstaff();
324 virtual String desc() {
325 //return "A staff of hardwood, its ends are shod with iron.";
326 return BPT::getText("lang.quarterstaff_desc");
327 }
328 virtual std::string getClassName() { return "Quarterstaff"; }
329 static Item* Create() { return new Quarterstaff(); }
330};
331
332class Spear :public MeleeWeapon{
333public:
334 Spear();
335 virtual String desc() {
336 //return "A slender wooden rod tipped with sharpened iron.";
337 return BPT::getText("lang.spear_desc");
338 }
339 virtual std::string getClassName() { return "Spear"; }
340 static Item* Create() { return new Spear(); }
341};
342
343class Mace :public MeleeWeapon{
344public:
345 Mace();
346 virtual String desc() {
347 //return "The iron head of this weapon inflicts substantial damage.";
348 return BPT::getText("lang.mace_desc");
349 }
350 virtual std::string getClassName() { return "Mace"; }
351 static Item* Create() { return new Mace(); }
352};
353
354class Sword :public MeleeWeapon{
355public:
356 Sword();
357
358 virtual String desc() {
359 //return "The razor-sharp length of steel blade shines reassuringly.";
360 return BPT::getText("lang.sword_desc");
361 }
362 virtual std::string getClassName() { return "Sword"; }
363 static Item* Create() { return new Sword(); }
364};
365
366class Longsword :public MeleeWeapon{
367public:
368 Longsword();
369 virtual String desc() {
370 //return "This towering blade inflicts heavy damage by investing its heft into every cut.";
371 return BPT::getText("lang.longsword_desc");
372 }
373 virtual std::string getClassName() { return "Longsword"; }
374 static Item* Create() { return new Longsword(); }
375};
376
377class BattleAxe :public MeleeWeapon{
378public:
379 BattleAxe();
380
381 virtual String desc() {
382 //return "The enormous steel head of this battle axe puts considerable heft behind each stroke.";
383 return BPT::getText("lang.battleaxe_desc");
384 }
385 virtual std::string getClassName() { return "BattleAxe"; }
386 static Item* Create() { return new BattleAxe(); }
387};
388
389class WarHammer :public MeleeWeapon{
390public:
391 WarHammer();
392 virtual String desc() {
393 //return
394 // std::string("Few creatures can withstand the crushing blow of this towering mass of lead and steel, ") +
395 // std::string("but only the strongest of adventurers can use it effectively.");
396 return BPT::getText("lang.warhammer_desc");
397 }
398
399 virtual std::string getClassName() { return "WarHammer"; }
400 static Item* Create() { return new WarHammer(); }
401};
402
403class Glaive :public MeleeWeapon{
404public:
405 Glaive();
406 virtual String desc() {
407 //return "A polearm consisting of a sword blade on the end of a pole.";
408 return BPT::getText("lang.glaive_desc");
409 }
410
411 virtual std::string getClassName() { return "Glaive"; }
412 static Item* Create() { return new Glaive(); }
413};
414
416public:
417 static const String AC_REFORGE;
419
420 static const String TXT_REFORGED;
422
423 static const float TIME_TO_REFORGE;
424
425 boolean equipped;
426
427private:
428 WndBag::Listener* itemSelector;
429public:
430 ShortSword();
431
432 virtual void actions(Hero* hero, std::vector<std::string>& actions);
433 virtual void execute(Hero* hero, std::string action);
434 virtual String desc() {
435 //return
436 // "It is indeed quite short, just a few inches longer, than a dagger.";
437 return BPT::getText("lang.shortsword_desc");
438 }
439
440 virtual std::string getClassName() { return "ShortSword"; }
441 static Item* Create() { return new ShortSword(); }
442protected:
443 virtual int max0() {
444 return 12;
445 }
446};
447
448class MissileWeapon :public Weapon{
449private:
450 static const String TXT_MISSILES;
451 static const String TXT_YES;
452 static const String TXT_NO;
453 static const String TXT_R_U_SURE;
454
455public:
457
458 virtual void actions(Hero* hero, std::vector<std::string>& actions);
459 virtual void proc(Char* attacker, Char* defender, int damage);
460 virtual bool doEquip(Hero* hero);
461 virtual Item* random() {
462 return this;
463 }
464 virtual boolean isUpgradable() {
465 return false;
466 }
467 virtual boolean isIdentified() {
468 return true;
469 }
470 virtual String info();
471protected:
472 virtual void onThrow(int cell);
473 virtual void miss(int cell) {
474 Weapon::onThrow(cell);
475 }
476};
477
479public:
480 Boomerang();
481
482 virtual int min() {
483 return isBroken() ? 1 : 1 + Level();
484 }
485 virtual int max() {
486 return isBroken() ? 4 : 4 + 2 * Level();
487 }
488 virtual boolean isUpgradable() {
489 return true;
490 }
491 virtual Item* upgrade() {
492 return upgrade(false);
493 }
494 virtual Item* upgrade(boolean enchant) {
496
498
499 return this;
500 }
501 virtual int maxDurability(int lvl) {
502 return 8 * (lvl < 16 ? 16 - lvl : 1);
503 }
504 virtual void proc(Char* attacker, Char* defender, int damage);
505 virtual void cast(Hero* user, int dst);
506
507 virtual String desc() {
508 //return
509 // "Thrown to the enemy this flat curved wooden missile will return to the hands of its thrower.";
510 return BPT::getText("lang.boomerang_desc");
511 }
512 virtual std::string getClassName() { return "Boomerang"; }
513 static Item* Create() { return new Boomerang(); }
514protected:
515 virtual void miss(int cell) {
516 circleBack(cell, curUser);
517 }
518
519private:
520 boolean throwEquiped;
521 void circleBack(int from, Hero* owner);
522};
523
524class Dart :public MissileWeapon{
525public:
526 Dart();
527 Dart(int number);
528 virtual std::string getClassName() { return "Dart"; }
529 static Item* Create() { return new Dart(); }
530
531 virtual int min() {
532 return 1;
533 }
534 virtual int max() {
535 return 4;
536 }
537 virtual String desc() {
538 //return
539 // std::string("These simple metal spikes are weighted to fly true and ") +
540 // std::string("sting their prey with a flick of the wrist.");
541 return BPT::getText("lang.dart_desc");
542 }
543 virtual Item* random();
544 virtual int price() {
545 return quantity * 2;
546 }
547};
548
549class Javelin :public MissileWeapon{
550public:
551 Javelin();
552 Javelin(int number);
553 virtual std::string getClassName() { return "Javelin"; }
554 static Item* Create() { return new Javelin(); }
555
556 virtual int min() {
557 return 2;
558 }
559 virtual int max() {
560 return 15;
561 }
562 virtual void proc(Char* attacker, Char* defender, int damage);
563 virtual String desc() {
564 //return
565 // std::string("This length of metal is weighted to keep the spike ") +
566 // std::string("at its tip foremost as it sails through the air.");
567 return BPT::getText("lang.javelin_desc");
568 }
569 virtual Item* random();
570 virtual int price() {
571 return 15 * quantity;
572 }
573};
574
576public:
578 IncendiaryDart(int number);
579 virtual std::string getClassName() { return "IncendiaryDart"; }
580 static Item* Create() { return new IncendiaryDart(); }
581
582 virtual int min() {
583 return 1;
584 }
585 virtual int max() {
586 return 2;
587 }
588 virtual void proc(Char* attacker, Char* defender, int damage);
589 virtual String desc() {
590 //return
591 // std::string("The spike on each of these darts is designed to pin it to its target ") +
592 // std::string("while the unstable compounds strapped to its length burst into brilliant flames.");
593 return BPT::getText("lang.incendiarydart_desc");
594 }
595 virtual Item* random();
596 virtual int price() {
597 return 10 * quantity;
598 }
599
600protected:
601 virtual void onThrow(int cell);
602};
603
605public:
606 static const float DURATION;
607 CurareDart();
608 CurareDart(int number);
609 virtual std::string getClassName() { return "CurareDart"; }
610 static Item* Create() { return new CurareDart(); }
611
612 virtual int min() {
613 return 1;
614 }
615 virtual int max() {
616 return 3;
617 }
618
619 virtual void proc(Char* attacker, Char* defender, int damage);
620
621 virtual String desc() {
622 //return
623 // std::string("These little evil darts don't do much damage but they can paralyze ") +
624 // std::string("the target leaving it helpless and motionless for some time.");
625 return BPT::getText("lang.curaredart_desc");
626 }
627 virtual Item* random();
628 virtual int price() {
629 return 12 * quantity;
630 }
631};
632
634public:
635 Shuriken();
636 Shuriken(int number);
637 virtual std::string getClassName() { return "Shuriken"; }
638 static Item* Create() { return new Shuriken(); }
639
640 virtual int min() {
641 return 2;
642 }
643
644 virtual int max() {
645 return 6;
646 }
647
648 virtual String desc() {
649 //return
650 // std::string("Star-shaped pieces of metal with razor-sharp blades do significant damage ") +
651 // std::string("when they hit a target. They can be thrown at very high rate.");
652 return BPT::getText("lang.shuriken_desc");
653 }
654 virtual Item* random();
655 virtual int price() {
656 return 15 * quantity;
657 }
658};
659
661public:
662 Tamahawk();
663 Tamahawk(int number);
664 virtual std::string getClassName() { return "Tamahawk"; }
665 static Item* Create() { return new Tamahawk(); }
666
667 virtual int min() {
668 return 4;
669 }
670
671 virtual int max() {
672 return 20;
673 }
674
675 virtual void proc(Char* attacker, Char* defender, int damage);
676 virtual String desc() {
677 //return
678 // std::string("This throwing axe is not that heavy, but it still ") +
679 // std::string("requires significant strength to be used effectively.");
680 return BPT::getText("lang.tamahawk_desc");
681 }
682 virtual Item* random();
683 virtual int price() {
684 return 20 * quantity;
685 }
686};
static std::string getText(const std::string &key)
Definition bpt.cpp:26
virtual std::string getClassName()
Definition weapon.h:385
static Item * Create()
Definition weapon.h:386
virtual String desc()
Definition weapon.h:381
BattleAxe()
Definition weapon.cpp:747
virtual void proc(Char *attacker, Char *defender, int damage)
Definition weapon.cpp:984
virtual String desc()
Definition weapon.h:507
static Item * Create()
Definition weapon.h:513
virtual int maxDurability(int lvl)
Definition weapon.h:501
virtual int max()
Definition weapon.h:485
virtual Item * upgrade(boolean enchant)
Definition weapon.h:494
virtual Item * upgrade()
Definition weapon.h:491
virtual void miss(int cell)
Definition weapon.h:515
virtual void cast(Hero *user, int dst)
Definition weapon.cpp:992
virtual int min()
Definition weapon.h:482
Boomerang()
Definition weapon.cpp:974
virtual std::string getClassName()
Definition weapon.h:512
virtual boolean isUpgradable()
Definition weapon.h:488
Definition char.h:9
virtual int min()
Definition weapon.h:612
virtual void proc(Char *attacker, Char *defender, int damage)
Definition weapon.cpp:1114
CurareDart()
Definition weapon.cpp:1103
virtual String desc()
Definition weapon.h:621
static const float DURATION
Definition weapon.h:606
virtual int max()
Definition weapon.h:615
static Item * Create()
Definition weapon.h:610
virtual int price()
Definition weapon.h:628
virtual std::string getClassName()
Definition weapon.h:609
virtual Item * random()
Definition weapon.cpp:1120
Dagger()
Definition weapon.cpp:698
virtual String desc()
Definition weapon.h:300
static Item * Create()
Definition weapon.h:306
virtual std::string getClassName()
Definition weapon.h:305
virtual std::string getClassName()
Definition weapon.h:528
static Item * Create()
Definition weapon.h:529
virtual String desc()
Definition weapon.h:537
Dart()
Definition weapon.cpp:1018
virtual int price()
Definition weapon.h:544
virtual Item * random()
Definition weapon.cpp:1031
virtual int max()
Definition weapon.h:534
virtual int min()
Definition weapon.h:531
Definition weapon.h:116
virtual boolean proc(Weapon *weapon, Char *attacker, Char *defender, int damage)
Definition weapon.cpp:314
virtual ItemSprite::Glowing * glowing()
Definition weapon.h:124
virtual String name(const String &weaponName)
Definition weapon.cpp:337
static Weapon::Enchantment * Create()
Definition weapon.h:128
virtual std::string getClassName()
Definition weapon.h:127
Definition weapon.h:86
virtual boolean proc(Weapon *weapon, Char *attacker, Char *defender, int damage)
Definition weapon.cpp:258
virtual std::string getClassName()
Definition weapon.h:97
virtual ItemSprite::Glowing * glowing()
Definition weapon.h:94
virtual String name(const String &weaponName)
Definition weapon.cpp:280
static Weapon::Enchantment * Create()
Definition weapon.h:98
Definition weapon.h:131
virtual ItemSprite::Glowing * glowing()
Definition weapon.h:139
virtual String name(const String &weaponName)
Definition weapon.cpp:363
virtual boolean proc(Weapon *weapon, Char *attacker, Char *defender, int damage)
Definition weapon.cpp:345
virtual std::string getClassName()
Definition weapon.h:142
static Weapon::Enchantment * Create()
Definition weapon.h:143
Definition weapon.h:101
virtual ItemSprite::Glowing * glowing()
Definition weapon.h:109
virtual boolean proc(Weapon *weapon, Char *attacker, Char *defender, int damage)
Definition weapon.cpp:288
virtual String name(const String &weaponName)
Definition weapon.cpp:306
virtual std::string getClassName()
Definition weapon.h:112
static Weapon::Enchantment * Create()
Definition weapon.h:113
Definition weapon.h:161
virtual std::string getClassName()
Definition weapon.h:172
virtual String name(const String &weaponName)
Definition weapon.cpp:421
virtual ItemSprite::Glowing * glowing()
Definition weapon.h:169
static Weapon::Enchantment * Create()
Definition weapon.h:173
virtual boolean proc(Weapon *weapon, Char *attacker, Char *defender, int damage)
Definition weapon.cpp:403
virtual std::string getClassName()
Definition weapon.h:411
virtual String desc()
Definition weapon.h:406
Glaive()
Definition weapon.cpp:761
static Item * Create()
Definition weapon.h:412
Definition hero.h:18
Definition weapon.h:204
virtual ItemSprite::Glowing * glowing()
Definition weapon.h:212
virtual boolean proc(Weapon *weapon, Char *attacker, Char *defender, int damage)
Definition weapon.cpp:505
virtual std::string getClassName()
Definition weapon.h:215
static Weapon::Enchantment * Create()
Definition weapon.h:216
virtual String name(const String &weaponName)
Definition weapon.cpp:528
virtual std::string getClassName()
Definition weapon.h:579
virtual String desc()
Definition weapon.h:589
static Item * Create()
Definition weapon.h:580
virtual Item * random()
Definition weapon.cpp:1077
virtual void proc(Char *attacker, Char *defender, int damage)
Definition weapon.cpp:1071
virtual int price()
Definition weapon.h:596
virtual void onThrow(int cell)
Definition weapon.cpp:1083
virtual int max()
Definition weapon.h:585
virtual int min()
Definition weapon.h:582
IncendiaryDart()
Definition weapon.cpp:1060
Definition weapon.h:193
virtual std::string getClassName()
Definition weapon.h:200
virtual String name(const String &weaponName)
Definition weapon.cpp:496
static Weapon::Enchantment * Create()
Definition weapon.h:201
virtual boolean proc(Weapon *weapon, Char *attacker, Char *defender, int damage)
Definition weapon.cpp:491
Definition item.h:15
int Level()
Definition item.h:119
virtual Item * upgrade()
Definition item.h:124
bool isBroken()
Definition item.h:106
virtual Item * degrade()
Definition item.h:134
void updateQuickslot()
Definition item.cpp:381
static Hero * curUser
Definition item.h:43
int quantity
Definition item.h:62
virtual void onThrow(int cell)
Definition item.cpp:35
Definition itemsprite.h:10
virtual Item * random()
Definition weapon.cpp:1054
Javelin()
Definition weapon.cpp:1037
virtual int min()
Definition weapon.h:556
static Item * Create()
Definition weapon.h:554
virtual String desc()
Definition weapon.h:563
virtual void proc(Char *attacker, Char *defender, int damage)
Definition weapon.cpp:1048
virtual int max()
Definition weapon.h:559
virtual int price()
Definition weapon.h:570
virtual std::string getClassName()
Definition weapon.h:553
Definition kindofweapon.h:5
virtual std::string getClassName()
Definition weapon.h:317
static Item * Create()
Definition weapon.h:318
virtual String desc()
Definition weapon.h:312
Knuckles()
Definition weapon.cpp:705
Definition weapon.h:146
virtual std::string getClassName()
Definition weapon.h:157
static Weapon::Enchantment * Create()
Definition weapon.h:158
virtual boolean proc(Weapon *weapon, Char *attacker, Char *defender, int damage)
Definition weapon.cpp:371
virtual String name(const String &weaponName)
Definition weapon.cpp:395
virtual ItemSprite::Glowing * glowing()
Definition weapon.h:154
Definition typedefine.h:33
Longsword()
Definition weapon.cpp:740
virtual String desc()
Definition weapon.h:369
virtual std::string getClassName()
Definition weapon.h:373
static Item * Create()
Definition weapon.h:374
Definition weapon.h:219
static Weapon::Enchantment * Create()
Definition weapon.h:232
virtual String name(const String &weaponName)
Definition weapon.cpp:554
virtual boolean proc(Weapon *weapon, Char *attacker, Char *defender, int damage)
Definition weapon.cpp:536
virtual std::string getClassName()
Definition weapon.h:226
virtual ItemSprite::Glowing * glowing()
Definition weapon.h:229
virtual String desc()
Definition weapon.h:346
static Item * Create()
Definition weapon.h:351
virtual std::string getClassName()
Definition weapon.h:350
Mace()
Definition weapon.cpp:726
virtual std::string getClassName()
Definition weapon.h:255
virtual Item * degrade()
Definition weapon.h:275
virtual Item * random()
Definition weapon.cpp:687
Item * safeUpgrade()
Definition weapon.h:271
virtual int min0()
Definition weapon.h:291
virtual int max0()
Definition weapon.h:293
MeleeWeapon(int tier, float acu, float dly)
Definition weapon.cpp:573
Item * upgrade(boolean enchant)
Definition weapon.h:267
virtual Item * upgrade()
Definition weapon.h:263
virtual int price()
Definition weapon.cpp:678
virtual String info()
Definition weapon.cpp:583
virtual int min()
Definition weapon.h:257
virtual int max()
Definition weapon.h:260
int typicalSTR()
Definition weapon.h:280
virtual void proc(Char *attacker, Char *defender, int damage)
Definition weapon.cpp:892
MissileWeapon()
Definition weapon.cpp:862
virtual boolean isUpgradable()
Definition weapon.h:464
virtual Item * random()
Definition weapon.h:461
virtual String info()
Definition weapon.cpp:934
virtual void onThrow(int cell)
Definition weapon.cpp:961
virtual void actions(Hero *hero, std::vector< std::string > &actions)
Definition weapon.cpp:869
virtual void miss(int cell)
Definition weapon.h:473
virtual boolean isIdentified()
Definition weapon.h:467
virtual bool doEquip(Hero *hero)
Definition weapon.cpp:924
virtual String desc()
Definition weapon.h:324
virtual std::string getClassName()
Definition weapon.h:328
static Item * Create()
Definition weapon.h:329
Quarterstaff()
Definition weapon.cpp:712
Definition weapon.h:176
virtual std::string getClassName()
Definition weapon.h:189
virtual String name(const String &weaponName)
Definition weapon.cpp:457
virtual boolean proc(Weapon *weapon, Char *attacker, Char *defender, int damage)
Definition weapon.cpp:428
static Weapon::Enchantment * Create()
Definition weapon.h:190
static const float TIME_TO_REFORGE
Definition weapon.h:423
static const String TXT_NOT_BOOMERANG
Definition weapon.h:421
ShortSword()
Definition weapon.cpp:813
virtual void actions(Hero *hero, std::vector< std::string > &actions)
Definition weapon.cpp:824
static const String TXT_REFORGED
Definition weapon.h:420
static Item * Create()
Definition weapon.h:441
virtual int max0()
Definition weapon.h:443
virtual void execute(Hero *hero, std::string action)
Definition weapon.cpp:832
virtual String desc()
Definition weapon.h:434
static const String AC_REFORGE
Definition weapon.h:417
static const String TXT_SELECT_WEAPON
Definition weapon.h:418
virtual std::string getClassName()
Definition weapon.h:440
boolean equipped
Definition weapon.h:425
static Item * Create()
Definition weapon.h:638
Shuriken()
Definition weapon.cpp:1126
virtual Item * random()
Definition weapon.cpp:1144
virtual std::string getClassName()
Definition weapon.h:637
virtual int price()
Definition weapon.h:655
virtual String desc()
Definition weapon.h:648
virtual int max()
Definition weapon.h:644
virtual int min()
Definition weapon.h:640
Spear()
Definition weapon.cpp:719
virtual std::string getClassName()
Definition weapon.h:339
static Item * Create()
Definition weapon.h:340
virtual String desc()
Definition weapon.h:335
virtual String desc()
Definition weapon.h:358
virtual std::string getClassName()
Definition weapon.h:362
static Item * Create()
Definition weapon.h:363
Sword()
Definition weapon.cpp:733
virtual int price()
Definition weapon.h:683
virtual std::string getClassName()
Definition weapon.h:664
static Item * Create()
Definition weapon.h:665
virtual String desc()
Definition weapon.h:676
virtual int min()
Definition weapon.h:667
Tamahawk()
Definition weapon.cpp:1150
virtual int max()
Definition weapon.h:671
virtual void proc(Char *attacker, Char *defender, int damage)
Definition weapon.cpp:1166
virtual Item * random()
Definition weapon.cpp:1172
Definition weapon.h:235
virtual boolean proc(Weapon *weapon, Char *attacker, Char *defender, int damage)
Definition weapon.cpp:562
virtual std::string getClassName()
Definition weapon.h:242
virtual ItemSprite::Glowing * glowing()
Definition weapon.h:245
virtual String name(const String &weaponName)
Definition weapon.cpp:568
static Weapon::Enchantment * Create()
Definition weapon.h:248
virtual std::string getClassName()
Definition weapon.h:399
static Item * Create()
Definition weapon.h:400
virtual String desc()
Definition weapon.h:392
WarHammer()
Definition weapon.cpp:754
Definition weapon.h:10
virtual ItemSprite::Glowing * glowing()
Definition weapon.cpp:225
virtual String name(const String &weaponName)
Definition weapon.h:22
virtual void restoreFromBundle(Bundle *bundle)
Definition weapon.h:25
virtual void storeInBundle(Bundle *bundle)
Definition weapon.h:27
static Enchantment * random()
Definition weapon.cpp:230
static void init()
Definition weapon.cpp:240
virtual boolean proc(Weapon *weapon, Char *attacker, Char *defender, int damage)=0
Definition weapon.h:8
virtual void proc(Char *attacker, Char *defender, int damage)
Definition weapon.cpp:50
virtual float acuracyFactor(Hero *hero)
Definition weapon.cpp:85
boolean isEnchanted()
Definition weapon.h:78
Weapon()
Definition weapon.cpp:37
Weapon * enchant(Enchantment *ench)
Definition weapon.cpp:186
virtual Item * random()
Definition weapon.cpp:165
virtual ItemSprite::Glowing * glowing()
Definition weapon.cpp:208
virtual std::string getClassName()
Definition weapon.h:60
float ACU
Definition weapon.h:49
virtual String toString()
Definition weapon.cpp:151
int STR
Definition weapon.h:48
virtual String Name()
Definition weapon.cpp:160
Enchantment * enchantment
Definition weapon.h:83
Imbue
Definition weapon.h:52
@ SPEED
Definition weapon.h:53
@ NONE
Definition weapon.h:53
@ ACCURACY
Definition weapon.h:53
virtual void storeInBundle(Bundle *bundle)
Definition weapon.cpp:67
Imbue imbue
Definition weapon.h:55
Weapon * enchant()
Definition weapon.cpp:192
virtual int damageRoll(Hero *owner)
Definition weapon.cpp:120
virtual int maxDurability(int lvl)
Definition weapon.h:70
float DLY
Definition weapon.h:50
virtual float speedFactor(Hero *hero)
Definition weapon.cpp:108
virtual void restoreFromBundle(Bundle *bundle)
Definition weapon.cpp:75
Definition wndbag.h:23
std::string String
Definition typedefine.h:8