-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathspells.cpp
102 lines (84 loc) · 3.44 KB
/
spells.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#include "spells.h"
namespace SpellNames {
// names of spells that can be bought in shops
vector <string> spellNames = {"Flame","Torch","Eruption","Flare","Blaze","Inferno","Fireball",
"Explosion","Meteor","Salamander’s Blade","Dragon Fire","Sinkhole","Pit","Chasm","Vine","Thorn",
"Nettle","Rockfall","Landslide","Avalanche","Chill","Freeze","Frostbite","Douse","Deluge","Flood",
"Wave","Surge","Tsunami","Nyad’s Lore","Sleep","Slumber","Shock","Bolt","Plasma","Gust","Gale",
"Tempest","Whirlwhind","Cyclone","Vortex","Wyvern’s Wings","Daze","Stun","Confuse","Light","Flash",
"Radiance","Cleanse","Scour","Purge","Wrath","Retribution","Judgment","Angel’s Mercy","Darkness",
"Shade","Gloom","Decay","Fester","Corrupt","Spite","Rancor","Malice","Demon’s Rage","Drain","Siphon",
"Void","Bolt Strike","Freeze Wave","Inferno Blaze","Channel Energy","Shadow Blade","Heaven's Sword",
"Blazing Katana","Staff of Ice","Arrow of Purity","Blazing Arrows","Burn the Soul","Fire Wings",
"Fury of Osano-Wo","Gaijin Flames","Hungry Blade","Yakamo’s Wrath","Yakamo’s Eye","Breath of Suitengu",
"The Inner Ocean","Surging Soul","Endless Depth","Kharmic Intent","Whispered Blade"};
}
//////////////////////////////////////////////////////// S p e l l
Spell::Spell(short type, int price, int requiredlevel) {
using namespace SpellNames;
name = spellNames.at(spellNames.size() - 1); // naming the spell using the names from the vector
spellNames.erase(spellNames.end()); //spellNames from namespace SpellNames
this->price = price;
requiredLevel = requiredlevel;
damage = requiredLevel + rand() % 20 + 10;
manaCost = rand() % 5 + 10;
this->type = type;
}
void Spell::print() {
cout << "\nName: " << name << "\nCost: " << price << " \nLevel Required: " << requiredLevel;
cout << "\nDamage: " << damage << "\nMana Cost: " << manaCost << endl;
}
short Spell::getType(){
return type;
}
int Spell::getPrice() {
return price;
}
string Spell::getName() {
return name;
}
int Spell::decrease() {
return -1;
}
int Spell::getMana() {
return manaCost;
}
int Spell::getDamage() {
return damage;
}
/////////////////////////////////////////////////////// I c e S p e l l
IceSpell::IceSpell(int price, int requiredlevel): Spell(0, price, requiredlevel) {
decreaseDmg = rand() % 3 + 2;
}
void IceSpell::print() {
cout << "\n\033[36m" <<"~~~IceSpell~~~" << "\033[0m" <<endl;
Spell::print();
cout << "Decrease Damage: " << decreaseDmg << endl;
}
int IceSpell::decrease() {
return decreaseDmg;
}
/////////////////////////////////////////////////////// F i r e S p e l l
FireSpell::FireSpell(int price, int requiredlevel): Spell(1, price, requiredlevel) {
decreaseDef = rand() % 3 + 2;
}
void FireSpell::print() {
cout << "\n\033[31m" << "~~~FireSpell~~~" << "\033[0m" << endl;
Spell::print();
cout << "Decrease Deffence: " << decreaseDef << endl;
}
int FireSpell::decrease() {
return decreaseDef;
}
/////////////////////////////////////////////////////// L i g h t i n g S p e l l
LightingSpell::LightingSpell(int price ,int requiredlevel): Spell(2, price, requiredlevel) {
decreaseAg = rand() % 3 + 2;
}
void LightingSpell::print(){
cout << "\n\033[33m" << "~~~LightingSpell~~~" << "\033[0m" <<endl;
Spell::print();
cout << "Decrease Agility: " << decreaseAg << endl;
}
int LightingSpell::decrease() {
return decreaseAg;
}