Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
C
cptr142_group_project
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Aaron Sturtevant
cptr142_group_project
Commits
4ab552b2
Commit
4ab552b2
authored
Mar 19, 2018
by
Kameron Kinsey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initialize repository
parent
14c90189
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
83 additions
and
43 deletions
+83
-43
Boss.cpp
Boss.cpp
+69
-21
Boss.h
Boss.h
+5
-13
Item.h
Item.h
+4
-4
Monster.h
Monster.h
+3
-3
Player.cpp
Player.cpp
+2
-2
No files found.
Boss.cpp
View file @
4ab552b2
...
...
@@ -9,43 +9,91 @@
*
*/
#include "Boss
"
#include "Boss.h
"
#include <string>
#include <iostream>
using
namespace
std
;
Boss
::
Boss
(
int
floorNumber
)
{
void
Boss
::
summonBoss
(
int
floorNum
)
{
Boss
boss
;
switch
(
floorNumber
)
{
switch
(
floorNum
)
{
case
1
:
cout
<<
"A Minotaur stands before you, Warhammer raised and nose pierced"
<<
endl
;
boss
.
setBossStats
(
seed
);
cout
<<
"What are you going to do?"
<<
endl
;
setFight
(
20
);
setTalk
(
15
)
;
case
2
:
cout
<<
"The Pop-Culture representation of Death Itself stands before you, scythe poised and hungry"
<<
endl
;
boss
.
setBossStats
(
seed
);
cout
<<
"What are you going to do?"
<<
endl
;
setFight
(
17
);
setTalk
(
17
)
;
case
3
:
cout
<<
"A Dragon stands before you. C'mon, you had to see this coming"
<<
endl
;
monster
.
setStats
(
seed
);
cout
<<
"What are you going to do?"
<<
endl
;
setFight
(
15
);
setTalk
(
20
);
case
4
:
cout
<<
"A hooded figure stands before you, dice in one hand, and a rulebook in the other. "
<<
endl
<<
"You cannot escape the power of the Dungen Master."
<<
endl
;
setFight
(
20
);
setTalk
(
20
);
}
}
void
Boss
::
setBossStats
(
int
seed
)
{
srand
(
seed
);
int
Boss
::
getFight
(
int
floorNum
)
{
// Set Fight Stat and Modifier
int
fight
=
getFight
();
fight
=
rand
()
%
20
;
setFight
(
fight
);
switch
(
floorNum
)
{
case
1
:
// Minotaur
return
fight
=
20
;
case
2
:
// Death
return
fight
=
17
;
case
3
:
// Dragon
return
fight
=
15
;
case
4
:
// Dungen Master
return
fight
=
20
}
}
int
Boss
::
getTalk
(
int
floorNum
)
{
// Set Talk Stat and Modifier
int
talk
=
getTalk
();
talk
=
rand
()
%
20
;
setTalk
(
talk
);
switch
(
floorNum
)
{
case
1
:
// Minotaur
return
talk
=
15
;
case
2
:
// Death
return
talk
=
17
;
case
3
:
// Dragon
return
talk
=
20
;
case
4
:
// Dungen Master
return
talk
=
20
}
}
void
Boss
::
bossResponse
(
int
floorNum
,
int
playerWon
)
{
if
(
playerWon
==
true
)
{
switch
(
floorNum
)
{
case
1
:
// Minotaur
cout
<<
"The Minotaur drops its hammer, a bellow escapes its lips as it falls to the floor. Defeated"
<<
endl
;
case
2
:
// Death
cout
<<
"Death drops its scythe, as it disappears into the Soul Realm. Defeated"
<<
endl
;
case
3
:
// Dragon
cout
<<
"The Dragon falls in a bout of flame, its fighting 'til its last breath. Defeated"
<<
endl
;
case
4
:
// Dungen Master
cout
<<
"
\"
How did you defeat me?
\"
The Dungen Master exclaims.
\"
I had everyting prepared with utmost care.
\"
"
<<
endl
<<
"
\"
Perfectly laid traps, well executed enemies, but somehow you still beat me.
\"
"
<<
endl
<<
"
\"
Take it then, if you are willing to endure the consequences. . .
\"
"
<<
endl
;
Player
player
;
player
.
checkVictory
(
playerWon
);
}
}
Boss.h
View file @
4ab552b2
...
...
@@ -15,21 +15,13 @@ using namespace std;
class
Boss
{
private:
int
fight
=
10
,
flee
=
10
,
talk
=
10
,
health
=
5
;
int
fight
,
talk
;
public:
// Constructor
Boss
(
int
);
// Get Functions
int
getFight
()
{
return
fight
;
}
int
getFlee
()
{
return
flee
;
}
int
getTalk
()
{
return
talk
;
}
int
getHealth
()
{
return
health
;
}
int
getFight
(
int
floorNum
);
int
getTalk
(
int
floorNum
);
//
Set Function
void
s
etBossStats
(
int
);
//
Other Functions
void
s
ummonBoss
(
int
floorNum
);
};
\ No newline at end of file
Item.h
View file @
4ab552b2
...
...
@@ -13,19 +13,19 @@ class Item{
int
itemFight
;
int
itemTalk
;
public:
Item
(
string
lootName
,
int
lootFight
,
int
lootTalk
){
Item
(
string
lootName
,
int
lootFight
,
int
lootTalk
)
{
itemName
=
lootName
;
itemFight
=
lootFight
;
itemTalk
=
lootTalk
;
}
string
getName
(){
string
getName
()
{
return
itemName
;
}
int
getFight
(){
int
getFight
()
{
return
itemFight
;
}
int
getTalk
(){
int
getTalk
()
{
return
itemTalk
;
}
};
...
...
Monster.h
View file @
4ab552b2
...
...
@@ -9,14 +9,13 @@
*
*/
#include "
Player
.h"
#include "
Item
.h"
#include <cstdlib>
#include <iostream>
using
namespace
std
;
class
Monster
{
private:
string
waygd
=
"What are you going to do?"
int
fight
,
talk
;
public:
// Constructor
...
...
@@ -25,11 +24,12 @@ class Monster {
// Get Functions
int
getFight
()
{
return
fight
;
}
int
getTalk
()
{
return
talk
;
}
string
getWaygd
()
{
return
waygd
;
}
// Set Function
void
setFight
(
int
Fight
)
{
fight
=
Fight
;
}
void
setTalk
(
int
Talk
)
{
talk
=
Talk
;
}
void
setMonsterStats
(
int
);
// Other Functions
};
\ No newline at end of file
Player.cpp
View file @
4ab552b2
...
...
@@ -35,8 +35,8 @@ void Player::setStats(int seed) {
void
check
bool
Player
::
checkVictory
(
bool
wi
n
)
{
if
(
wi
n
==
true
)
{
bool
Player
::
checkVictory
(
bool
playerWo
n
)
{
if
(
playerWo
n
==
true
)
{
cout
<<
"Congratulations "
<<
getPlayerName
()
<<
" you have retrieved the Maguffin of Vauge Desirability!"
<<
endl
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment