Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Aaron Sturtevant
cptr142_group_project
Commits
7356e66e
Commit
7356e66e
authored
Mar 19, 2018
by
Kameron Kinsey
Browse files
Initialize repository
parent
8c80baee
Changes
3
Hide whitespace changes
Inline
Side-by-side
Monster.cpp
View file @
7356e66e
...
...
@@ -20,7 +20,7 @@ Monster::Monster(int seed) {
Monster
monster
;
srand
(
seed
)
srand
(
seed
)
;
switch
(
rand
()
%
147
)
{
case
1
:
...
...
@@ -638,13 +638,10 @@ void Monster::setMonsterStats(int seed) {
fight
=
rand
()
%
20
;
setFight
(
fight
);
// Set Flee Stat and Modifier
int
flee
=
getFlee
();
flee
=
rand
()
%
20
;
setFlee
(
flee
);
// Set Talk Stat and Modifier
int
talk
=
getTalk
();
talk
=
rand
()
%
20
;
setTalk
(
talk
);
}
\ No newline at end of file
Player.cpp
View file @
7356e66e
...
...
@@ -16,46 +16,6 @@
#include
<iostream>
using
namespace
std
;
int
main
()
{
// Declare Character Details
int
seed
;
char
command
;
Player
player
;
string
name
=
player
.
getPlayerName
();
// Set Stats
player
.
setStats
(
seed
);
// Enter Name
cout
<<
"Enter Player Name: "
;
getline
(
cin
,
name
);
player
.
setPlayerName
(
name
);
int
health
=
player
.
getHealth
();
int
fight
=
player
.
getFight
();
int
talk
=
player
.
getTalk
();
cout
<<
name
<<
"'s stats"
<<
endl
<<
"========================"
<<
endl
<<
"Health: "
<<
health
<<
endl
<<
"Fight: "
<<
fight
+
item
.
getEquippedFight
()
<<
endl
<<
"Talk: "
<<
talk
+
item
.
getEquippedTalk
()
<<
endl
<<
"Item: "
<<
item
.
getEquippedItemName
()
<<
endl
;
cout
<<
"Check inventory: i"
;
getline
(
cin
,
command
);
if
(
command
==
'i'
)
{
item
.
listInventory
();
}
return
0
;
}
void
Player
::
setStats
(
int
seed
)
{
getline
(
cin
,
seed
);
...
...
@@ -79,4 +39,43 @@ bool Player::checkVictory(bool win) {
if
(
win
==
true
)
{
cout
<<
"Congratulations "
<<
getPlayerName
()
<<
" you have retrieved the Maguffin of Vauge Desirability!"
<<
endl
;
}
}
\ No newline at end of file
}
// int main() {
// // Declare Character Details
// int seed;
// char command;
// Player player;
// string name = player.getPlayerName();
// // Set Stats
// player.setStats(seed);
// // Enter Name
// cout << "Enter Player Name: ";
// getline(cin,name);
// player.setPlayerName(name);
// int health = player.getHealth();
// int fight = player.getFight();
// int talk = player.getTalk();
// cout << name << "'s stats" << endl
// << "========================" << endl
// << "Health: " << health << endl
// << "Fight: " << fight + item.getEquippedFight() << endl
// << "Talk: " << talk + item.getEquippedTalk() << endl
// << "Item: " << item.getEquippedItemName() << endl;
// cout << "Check inventory: i";
// getline(cin,command);
// if (command == 'i') {
// item.listInventory();
// }
// return 0;
// }
Player.h
View file @
7356e66e
...
...
@@ -24,7 +24,7 @@ class Player {
int
getFight
()
{
return
fight
;
}
int
getTalk
()
{
return
talk
;
}
string
getPlayerName
()
{
return
playerName
;
}
// Set Functions
void
setStats
(
int
);
void
setFight
(
int
Fight
)
{
fight
=
Fight
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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