-
Notifications
You must be signed in to change notification settings - Fork 0
/
PokeFire.cpp
102 lines (84 loc) · 2.02 KB
/
PokeFire.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 "PokeFire.h"
PokeFire::PokeFire(int ID, const std::string& pokemonName): Pokemon(ID,pokemonName)
{
HP=600;
ATK=60;
MAG_DEF=20;
PHY_DEF=10;
burning=false;
electrified=false;
drowning=false;
rooted=false;
//Default values
defHP=600;
defATK=60;
defMAG_DEF=20;
defPHY_DEF=10;
}
void PokeFire::getDamage()//MAG-Attack (Attacked Pokemon)
{
if(isDrowning() && HP>0)
{
cout<<"\t\t\t"<<name<<"("<<HP<<") "<<getEffectName(DROWNING)<<"!!!!"<<endl;
setHP(getHP()-max(0,DROWN_DAMAGE*2-getMAG_DEF()));
}
if(isElectrified() && HP>0)
{
cout<<"\t\t\t"<<name<<"("<<HP<<") "<<getEffectName(ELECTRIFIED)<<"!!"<<endl;
setHP(getHP()-max(0,ELECTRIFY_DAMAGE-getMAG_DEF()));
}
if(isRooted() && HP>0)
{
cout<<"\t\t\t"<<name<<"("<<HP<<") "<<getEffectName(ROOTED)<<"!!"<<endl;
setHP(getHP()-max(0,ROOT_DAMAGE-getMAG_DEF()));
}
}
void PokeFire::attackTo(Pokemon* target, Arena currentArena)//PHY-Attack (Attacking Pokemon)
{
int phyDam=max(1,ATK-target->getPHY_DEF());
string arena=getArenaName(currentArena);
target->setBurning(true);
if(arena=="Magma")
cout<<"\t\t\t"<<name<<"("<<HP<<") hit "<<target->getName()<<"("<<target->getHP()<<") "<<phyDam<<"(+)"<<endl;
else if(arena=="Ocean" || arena=="Sky")
cout<<"\t\t\t"<<name<<"("<<HP<<") hit "<<target->getName()<<"("<<target->getHP()<<") "<<phyDam<<"(-)"<<endl;
else
cout<<"\t\t\t"<<name<<"("<<HP<<") hit "<<target->getName()<<"("<<target->getHP()<<") "<<phyDam<<"(/)"<<endl;
target->setHP(target->getHP()-phyDam);
}
void PokeFire::levelUp()
{
HP+=60;
ATK+=6;
MAG_DEF+=2;
PHY_DEF+=1;
defHP+=60;
defATK+=6;
defMAG_DEF+=2;
defPHY_DEF+=1;
}
void PokeFire::buff(string arena)
{
if(arena=="Magma")
(*this)++;
else if(arena=="Ocean" || arena=="Sky")
(*this)--;
else
;
}
PokeFire::~PokeFire()
{}
void PokeFire::setBurning(bool burning)
{}
void PokeFire::setDrowning(bool drowning)
{
this->drowning=drowning;
}
void PokeFire::setElectrified(bool electrified)
{
this->electrified=electrified;
}
void PokeFire::setRooted(bool rooted)
{
this->rooted=rooted;
}