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
14c90189
Commit
14c90189
authored
Mar 19, 2018
by
Aaron Sturtevant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commiting
parent
86e1f43f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
11 deletions
+26
-11
Dungeon.cpp
Dungeon.cpp
+1
-1
main.cpp
main.cpp
+25
-10
No files found.
Dungeon.cpp
View file @
14c90189
...
...
@@ -25,7 +25,7 @@ using namespace std;
}
void
Dungeon
::
bossResponse
(
int
floorNum
,
bool
playerWon
)
{
Boss
.
bossResponse
(
floorNum
,
response
);
Boss
.
bossResponse
(
floorNum
,
playerWon
);
}
void
giveItems
(
int
floorNum
,
Inventory
inventory
)
{
...
...
main.cpp
View file @
14c90189
...
...
@@ -49,20 +49,28 @@ int main() {
do
{
cout
<<
"How do you respond? (Fight, Talk, Or Flee): "
;
cin
>>
response
;
if
((
response
==
'
Fight
'
)
||
(
response
==
'
Talk
'
)
{
if
(
dungeon
.
compareStats
(
playerPtr
,
dungeon
.
floorNum
,
response
))
{
if
(
response
==
"Fight"
){
if
(
playerPtr
.
getFight
()
>=
BossPtr
.
getFight
(
encounterNum
))
{
playerWon
=
true
;
dungeonPtr
.
bossResponse
(
dungeonPtr
.
floorNum
,
playerWon
);
dungeonPtr
.
floorNum
++
;
monsterPtr
.
giveBossItems
(
dungeonPtr
.
floorNum
,
inventoryPtr
);
}
else
{
dungeonPtr
.
bossResponse
(
dungeonPtr
.
floorNum
,
playerWon
);
playerPtr
}
}
else
if
(
response
==
"Talk"
)
{
if
(
playerPtr
.
getFight
()
>=
BossPtr
.
getTalk
(
encounterNum
))
{
playerWon
=
true
;
dungeonPtr
.
bossResponse
(
dungeonPtr
.
floorNum
,
playerWon
);
dungeonPtr
.
floorNum
++
;
monsterPtr
.
giveBossItems
(
dungeonPtr
.
floorNum
,
inventoryPtr
);
}
else
{
dungeonPtr
.
bossResponse
(
dungeonPtr
.
floorNum
,
playerWon
);
}
}
else
{
cout
<<
"You run crying out of the room. Shame haunts your footsteps"
<<
endl
;
playerWon
=
true
;
}
}
while
(
playerWon
==
false
;);
...
...
@@ -76,19 +84,26 @@ int main() {
do
{
cout
<<
"How do you respond? (Fight, Talk, Or Flee): "
;
cin
>>
response
;
if
((
response
==
'
Fight
'
)
||
(
response
==
'
Talk
'
)
{
if
(
dungeon
.
compareStats
(
playerPtr
,
monsterPtr
,
dungeon
.
roomEncounter
,
response
))
{
if
(
response
==
"Fight"
){
if
(
playerPtr
.
getFight
()
>=
monsterPtr
.
getFight
(
encounterNum
))
{
playerWon
=
true
;
dungeonPtr
.
monsterResponse
(
dungeonPtr
.
encounterNum
,
playerWon
);
monsterPtr
.
giveMonsterItems
(
dungeonPtr
.
encounterNum
,
inventoryPtr
);
}
else
{
dungeonPtr
.
monsterResponse
(
dungeonPtr
.
encounterNum
,
playerWon
);
}
}
else
if
(
response
==
"Talk"
)
{
if
(
playerPtr
.
getFight
()
>=
monsterPtr
.
getTalk
(
encounterNum
))
{
playerWon
=
true
;
dungeonPtr
.
monsterResponse
(
dungeonPtr
.
encounterNum
,
playerWon
);
dungeonPtr
.
floorNum
++
;
monsterPtr
.
giveMonsterItems
(
dungeonPtr
.
encounterNum
,
inventoryPtr
);
}
else
{
dungeonPtr
.
boss
Response
(
dungeonPtr
.
encounterNum
,
playerWon
);
dungeonPtr
.
monster
Response
(
dungeonPtr
.
encounterNum
,
playerWon
);
}
}
else
{
cout
<<
"You run crying out of the room. Shame haunts your footsteps"
<<
endl
;
playerWon
=
true
;
}
}
while
(
playerWon
==
false
;);
...
...
@@ -125,7 +140,7 @@ int main() {
dungeon
.
floorNum
--
;
}
delete
response
;
}
while
(
playerWon
==
false
;
);
}
while
(
playerWon
==
false
);
}
...
...
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