-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBulbasaur.cpp
More file actions
117 lines (101 loc) · 2.48 KB
/
Copy pathBulbasaur.cpp
File metadata and controls
117 lines (101 loc) · 2.48 KB
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/*********************************************************************
** Program name: FinalProject
** Author: James Scanlon
** Date: March 19, 2019
** Description: Interface of the Bulbasaur class. Derived from Pokemon class.
*********************************************************************/
#include "Bulbasaur.hpp"
#include <iostream>
#include <string>
Bulbasaur::Bulbasaur() : Pokemon::Pokemon()
{
attackValue = 6;
defenseValue = 6;
armor = 0;
strength = 12;
maxStrength = 12;
attackDice = 2;
defendDice = 2;
level = 5; // initialized level
setName("Bulbasaur");
hasFainted = false;
hasRazorLeaf = false;
hasSolarBeam = false;
}
void Bulbasaur::increaseLevel()
{
if (!hasFainted)
{
trainingDamage();
}
if (!hasFainted)
{
if (level < 15) // Bulbasaur evolves at 16; implementing in further development
{
attackValue += 1;
defenseValue += 1;
maxStrength += 1;
level += 1;
if (level == 10)
{
cout << "***** Bulbasaur learned Razor Leaf! This should be enough to defeat Brock! *****" << endl;
hasRazorLeaf = true;
}
}
else if (level == 15)
{
attackValue *= 1.5;
defenseValue *= 1.5;
maxStrength *= 1.5;
level += 1;
cout << "***** Your Bulbasaur has evolved into an Ivysaur! *****" << endl;
setName("Ivysaur");
cout << "***** Ivysaur learned Solarbeam! This should be enough to defeat Misty! *****" << endl;
hasSolarBeam = true;
}
else if (level == 24)
{
std::cout << "Ivysaur can't level up any more!" << endl;
}
}
}
void Bulbasaur::trainingDamage()
{
strength -= 2;
if (strength <= 0)
{
strength = 0;
hasFainted = true;
cout << getName() << " has fainted! Take him to the pokeCenter to heal!" << endl;
}
}
void Bulbasaur::healDamage()
{
strength = maxStrength;
hasFainted = false;
}
void Bulbasaur::makeFaint()
{
strength = 0;
trainingDamage();
}
// get functions
int Bulbasaur::getMaxStrength()
{
return maxStrength;
}
bool Bulbasaur::getRazorLeaf()
{
return hasRazorLeaf;
}
bool Bulbasaur::getSolarBeam()
{
return hasSolarBeam;
}
bool Bulbasaur::getHasFainted()
{
return hasFainted;
}
Bulbasaur::~Bulbasaur()
{
}