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
0f0ac21c
Commit
0f0ac21c
authored
Mar 20, 2018
by
Eli Chung
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of gitlab.cs.wallawalla.edu:sturaa/cptr142_group_project
parents
d96b695c
0088dd91
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
19 deletions
+25
-19
Boss.cpp
Boss.cpp
+1
-1
Boss.h
Boss.h
+1
-1
DunGen.pptx
DunGen.pptx
+0
-0
Monster.cpp
Monster.cpp
+1
-1
Monster.h
Monster.h
+1
-1
main.cpp
main.cpp
+21
-15
No files found.
Boss.cpp
View file @
0f0ac21c
...
...
@@ -116,7 +116,7 @@ void Boss::bossResponse(int floorNum, bool playerWon) {
}
}
void
Boss
::
giveBossItems
(
int
floorNum
,
Inventory
inventory
)
{
void
Boss
::
giveBossItems
(
int
floorNum
,
Inventory
&
inventory
)
{
switch
(
floorNum
)
{
case
1
:
...
...
Boss.h
View file @
0f0ac21c
...
...
@@ -32,7 +32,7 @@ class Boss {
// Other Functions
void
summonBoss
(
int
floorNum
);
void
bossResponse
(
int
floorNum
,
bool
playerWon
);
void
giveBossItems
(
int
floorNum
,
Inventory
inventory
);
void
giveBossItems
(
int
floorNum
,
Inventory
&
inventory
);
};
...
...
DunGen.pptx
View file @
0f0ac21c
No preview for this file type
Monster.cpp
View file @
0f0ac21c
...
...
@@ -215,7 +215,7 @@ int Monster::getTalk(int encounterNum) {
}
}
void
Monster
::
giveMonsterItems
(
int
encounterNum
,
Inventory
inventory
)
{
void
Monster
::
giveMonsterItems
(
int
encounterNum
,
Inventory
&
inventory
)
{
switch
(
encounterNum
)
{
case
1
:
...
...
Monster.h
View file @
0f0ac21c
...
...
@@ -32,7 +32,7 @@ class Monster {
// Other Functions
void
summon
(
int
encounterNum
);
void
giveMonsterItems
(
int
encounterNum
,
Inventory
inventory
);
void
giveMonsterItems
(
int
encounterNum
,
Inventory
&
inventory
);
void
monsterResponse
(
int
encounterNum
,
int
playerWon
);
...
...
main.cpp
View file @
0f0ac21c
...
...
@@ -3,6 +3,7 @@
#include <cstdlib>
#include <iostream>
#include <iomanip>
#include <time.h>
#include "Player.h"
#include "Boss.h"
#include "Monster.h"
...
...
@@ -12,7 +13,7 @@ using namespace std;
void
introMenu
();
void
ingameMenu
(
Inventory
);
void
ingameMenu
(
Inventory
,
Player
);
int
main
()
{
...
...
@@ -25,9 +26,9 @@ int main() {
bool
playerVictory
=
false
;
string
name
;
int
seed
;
cout
<<
"Enter a seed: "
;
cin
>>
seed
;
srand
(
time
(
NULL
))
;
int
seed
=
rand
()
%
650
+
1
;
introMenu
();
...
...
@@ -39,7 +40,7 @@ int main() {
playerPtr
->
setStats
(
seed
);
inventoryPtr
->
gainItem
(
"Sword"
,
0
,
0
);
cout
<<
"Player has been made"
<<
endl
;
ingameMenu
(
*
inventoryPtr
);
ingameMenu
(
*
inventoryPtr
,
*
playerPtr
);
do
{
//floor 1-3
...
...
@@ -50,6 +51,7 @@ int main() {
dungeonPtr
->
roomEncounter
=
dungeonPtr
->
rollRoom
();
if
(
dungeonPtr
->
roomCounter
%
5
==
0
)
{
cout
<<
endl
;
cout
<<
"You enter the room"
<<
endl
;
dungeonPtr
->
getBoss
(
dungeonPtr
->
floorNum
);
...
...
@@ -60,8 +62,8 @@ int main() {
if
(
playerPtr
->
getFight
()
>=
bossPtr
->
getFight
(
dungeonPtr
->
floorNum
))
{
playerWon
=
true
;
dungeonPtr
->
bossResponse
(
dungeonPtr
->
floorNum
,
playerWon
);
bossPtr
->
giveBossItems
(
dungeonPtr
->
floorNum
,
*
inventoryPtr
);
dungeonPtr
->
floorNum
++
;
dungeonPtr
->
giveBossItems
(
dungeonPtr
->
floorNum
,
*
inventoryPtr
);
}
else
{
dungeonPtr
->
bossResponse
(
dungeonPtr
->
floorNum
,
playerWon
);
playerPtr
->
doDamage
();
...
...
@@ -70,8 +72,8 @@ int main() {
if
(
playerPtr
->
getFight
()
>=
bossPtr
->
getTalk
(
dungeonPtr
->
floorNum
))
{
playerWon
=
true
;
dungeonPtr
->
bossResponse
(
dungeonPtr
->
floorNum
,
playerWon
);
bossPtr
->
giveBossItems
(
dungeonPtr
->
floorNum
,
*
inventoryPtr
);
dungeonPtr
->
floorNum
++
;
dungeonPtr
->
giveBossItems
(
dungeonPtr
->
floorNum
,
*
inventoryPtr
);
}
else
{
dungeonPtr
->
bossResponse
(
dungeonPtr
->
floorNum
,
playerWon
);
}
...
...
@@ -79,13 +81,14 @@ int main() {
cout
<<
"You run crying out of the room. Shame haunts your footsteps"
<<
endl
;
playerWon
=
true
;
}
ingameMenu
(
*
inventoryPtr
,
*
playerPtr
);
}
while
(
playerWon
==
false
);
playerWon
=
false
;
dungeonPtr
->
roomCounter
++
;
}
else
{
cout
<<
endl
;
cout
<<
"You enter the room"
<<
endl
;
dungeonPtr
->
getMonster
(
dungeonPtr
->
roomEncounter
);
do
{
...
...
@@ -95,16 +98,16 @@ int main() {
if
(
playerPtr
->
getFight
()
>=
monsterPtr
->
getFight
(
dungeonPtr
->
roomEncounter
))
{
playerWon
=
true
;
dungeonPtr
->
monsterResponse
(
dungeonPtr
->
roomEncounter
,
playerWon
);
dungeon
Ptr
->
giveMonsterItems
(
dungeonPtr
->
roomEncounter
,
*
inventoryPtr
);
monster
Ptr
->
giveMonsterItems
(
dungeonPtr
->
roomEncounter
,
*
inventoryPtr
);
}
else
{
dungeon
Ptr
->
monsterResponse
(
dungeonPtr
->
roomEncounter
,
playerWon
);
monster
Ptr
->
monsterResponse
(
dungeonPtr
->
roomEncounter
,
playerWon
);
playerPtr
->
doDamage
();
}
}
else
if
(
response
==
"Talk"
)
{
if
(
playerPtr
->
getFight
()
>=
monsterPtr
->
getTalk
(
dungeonPtr
->
roomEncounter
))
{
playerWon
=
true
;
dungeonPtr
->
monsterResponse
(
dungeonPtr
->
roomEncounter
,
playerWon
);
dungeon
Ptr
->
giveMonsterItems
(
dungeonPtr
->
roomEncounter
,
*
inventoryPtr
);
monster
Ptr
->
giveMonsterItems
(
dungeonPtr
->
roomEncounter
,
*
inventoryPtr
);
}
else
{
dungeonPtr
->
monsterResponse
(
dungeonPtr
->
roomEncounter
,
playerWon
);
playerPtr
->
doDamage
();
...
...
@@ -113,7 +116,7 @@ int main() {
cout
<<
"You run crying out of the room. Shame haunts your footsteps"
<<
endl
;
playerWon
=
true
;
}
ingameMenu
(
*
inventoryPtr
,
*
playerPtr
);
}
while
(
playerWon
==
false
);
playerWon
=
false
;
...
...
@@ -125,6 +128,7 @@ int main() {
//floor 4
cout
<<
endl
;
cout
<<
"You enter the room"
<<
endl
;
dungeonPtr
->
getBoss
(
dungeonPtr
->
floorNum
);
do
{
...
...
@@ -155,13 +159,14 @@ int main() {
cout
<<
"You run crying out of the room. Shame haunts your footsteps"
<<
endl
;
playerWon
=
true
;
}
ingameMenu
(
*
inventoryPtr
,
*
playerPtr
);
}
while
(
playerWon
==
false
);
}
while
(
playerVictory
==
false
);
cout
<<
"You win!"
<<
endl
;
cout
<<
"Final Inventory"
<<
endl
;
ingameMenu
(
*
inventoryPtr
);
ingameMenu
(
*
inventoryPtr
,
*
playerPtr
);
delete
monsterPtr
;
delete
bossPtr
;
...
...
@@ -177,9 +182,10 @@ void introMenu() {
<<
" so good luck fighting, talking or fleeing like a little baby!"
<<
endl
;
}
void
ingameMenu
(
Inventory
inventory
)
{
void
ingameMenu
(
Inventory
inventory
,
Player
player
)
{
cout
<<
"--------------------------------"
<<
endl
;
cout
<<
"Inventory"
<<
endl
;;
cout
<<
"Inventory"
<<
endl
;
cout
<<
"Player health: "
<<
player
.
health
<<
endl
;
inventory
.
listInventory
();
cout
<<
"--------------------------------"
<<
endl
;
}
\ No newline at end of file
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