My Project
 
Loading...
Searching...
No Matches
items.h
Go to the documentation of this file.
1#pragma once
2
3#include "item.h"
4#include "typedefine.h"
5#include "bpt.h"
6
7class Bomb :public Item{
8public:
9 Bomb();
10
11 virtual std::string getClassName() { return "Bomb"; }
12 static Item* Create() { return new Bomb(); }
13
14 virtual boolean isUpgradable() {
15 return false;
16 }
17 virtual boolean isIdentified() {
18 return true;
19 }
20 virtual Item* random();
21 virtual int price() {
22 return 10 * quantity;
23 }
24 virtual String info() {
25 return BPT::getText("lang.Bomb_Info");
26 //"This is a relatively small bomb, filled with black powder. Conveniently, its fuse is lit automatically when the bomb is thrown.";
27 }
28protected:
29 virtual void onThrow(int cell);
30};
31
32class Honeypot :public Item{
33public:
34 static const String AC_SHATTER;
35
36 Honeypot();
37 virtual std::string getClassName() { return "Honeypot"; }
38 static Item* Create() { return new Honeypot(); }
39
40 virtual void actions(Hero* hero, std::vector<std::string>& actions);
41 virtual void execute(Hero* hero, std::string action);
42 virtual boolean isUpgradable() {
43 return false;
44 }
45 virtual boolean isIdentified() {
46 return true;
47 }
48 virtual int price() {
49 return 50 * quantity;
50 }
51 virtual String info() {
52 return BPT::getText("lang.Honeypot_Info");
53 //"There is not much honey in this small honeypot, but there is a golden bee there and it doesn't want to leave it.";
54 }
55private:
56 void shatter(int pos);
57};
58
59class Amulet :public Item{
60private:
61 static const String AC_END;
62
63 void showAmuletScene(boolean showText);
64public:
65 Amulet();
67
68 virtual void actions(Hero* hero, std::vector<std::string>& actions);
69 virtual void execute(Hero* hero, std::string action);
70 virtual bool doPickUp(Hero* hero);
71
72 virtual boolean isIdentified() {
73 return true;
74 }
75 virtual boolean isUpgradable() {
76 return false;
77 }
78 virtual String info() {
79 return BPT::getText("lang.Amulet_Info");
80 //"The Amulet of Yendor is the most powerful known artifact of unknown origin. It is said that the amulet " +
81 //"is able to fulfil any wish if its owner's will-power is strong enough to \"persuade\" it to do it.";
82 }
83};
CLASSNAME(Amulet)
virtual String info()
Definition items.h:78
Amulet()
Definition items.cpp:158
virtual boolean isUpgradable()
Definition items.h:75
virtual void execute(Hero *hero, std::string action)
Definition items.cpp:172
virtual void actions(Hero *hero, std::vector< std::string > &actions)
Definition items.cpp:166
virtual boolean isIdentified()
Definition items.h:72
virtual bool doPickUp(Hero *hero)
Definition items.cpp:186
static std::string getText(const std::string &key)
Definition bpt.cpp:26
virtual std::string getClassName()
Definition items.h:11
virtual boolean isUpgradable()
Definition items.h:14
Bomb()
Definition items.cpp:18
virtual boolean isIdentified()
Definition items.h:17
virtual Item * random()
Definition items.cpp:26
virtual int price()
Definition items.h:21
virtual String info()
Definition items.h:24
static Item * Create()
Definition items.h:12
virtual void onThrow(int cell)
Definition items.cpp:32
Definition hero.h:18
virtual boolean isUpgradable()
Definition items.h:42
virtual void actions(Hero *hero, std::vector< std::string > &actions)
Definition items.cpp:93
virtual boolean isIdentified()
Definition items.h:45
virtual void execute(Hero *hero, std::string action)
Definition items.cpp:99
virtual std::string getClassName()
Definition items.h:37
static Item * Create()
Definition items.h:38
static const String AC_SHATTER
Definition items.h:34
Honeypot()
Definition items.cpp:85
virtual String info()
Definition items.h:51
virtual int price()
Definition items.h:48
Definition item.h:15
Item()
Definition item.cpp:65
int quantity
Definition item.h:62
std::string String
Definition typedefine.h:8