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
Kameron Kinsey
cptr142_group_project
Commits
4202373f
Commit
4202373f
authored
Mar 01, 2018
by
Kameron Kinsey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initialize repository
parent
730412bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
34 deletions
+12
-34
Kam_set_stats.cpp
Kam_set_stats.cpp
+12
-34
No files found.
Kam_set_stats.cpp
View file @
4202373f
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
#include <iostream>
#include <iostream>
using
namespace
std
;
using
namespace
std
;
// class
Stats
{
// class
Player
{
// private:
// private:
// int fight,
// int fight,
// flight,
// flight,
...
@@ -16,16 +16,15 @@ using namespace std;
...
@@ -16,16 +16,15 @@ using namespace std;
// int setStats(Stats);
// int setStats(Stats);
// };
// };
void
setStats
(
int
&
,
int
&
,
int
&
,
int
&
,
int
&
,
int
&
,
int
&
,
int
&
);
void
setStats
(
int
&
,
int
&
,
int
&
,
int
&
,
int
&
,
int
&
);
int
main
()
{
int
main
()
{
int
seed
,
int
seed
,
fight
,
fightMod
,
fight
=
10
,
flee
,
fleeMod
,
flee
=
10
,
think
,
thinkMod
,
talk
=
10
,
talk
,
talkMod
,
health
=
100
;
health
=
100
;
string
playerName
;
string
playerName
;
...
@@ -36,14 +35,14 @@ int main() {
...
@@ -36,14 +35,14 @@ int main() {
cout
<<
"Enter Player Name: "
;
cout
<<
"Enter Player Name: "
;
cin
>>
playerName
;
cin
>>
playerName
;
setStats
(
fight
,
flee
,
t
hink
,
talk
,
fightMod
,
fleeMod
,
think
Mod
,
talkMod
);
setStats
(
fight
,
flee
,
t
alk
,
fightMod
,
flee
Mod
,
talkMod
);
cout
<<
playerName
<<
"'s stats"
<<
endl
cout
<<
playerName
<<
"'s stats"
<<
endl
<<
"========================"
<<
endl
<<
"========================"
<<
endl
<<
"Health: "
<<
health
<<
endl
<<
"Health: "
<<
health
<<
endl
<<
"Fight: "
<<
fight
<<
" "
<<
fightMod
<<
endl
<<
"Fight: "
<<
fight
<<
" "
<<
endl
<<
"Talk: "
<<
talk
<<
" "
<<
talkMod
<<
endl
<<
"Talk: "
<<
talk
<<
" "
<<
endl
<<
"Flee: "
<<
flee
<<
" "
<<
fleeMod
<<
endl
;
<<
"Flee: "
<<
flee
<<
" "
<<
endl
;
...
@@ -54,7 +53,7 @@ int main() {
...
@@ -54,7 +53,7 @@ int main() {
return
0
;
return
0
;
}
}
//
Stats::Stats
() {
//
Player::Player
() {
// fight = rand() % 20 + 5;
// fight = rand() % 20 + 5;
// flight = rand() % 20 + 5;
// flight = rand() % 20 + 5;
// think = rand() % 20 + 5;
// think = rand() % 20 + 5;
...
@@ -62,35 +61,14 @@ int main() {
...
@@ -62,35 +61,14 @@ int main() {
// return
// return
// }
// }
void
setStats
(
int
&
fight
,
int
&
flee
,
int
&
t
hink
,
int
&
talk
,
int
&
fightMod
,
int
&
fleeMod
,
int
&
think
Mod
,
int
&
talkMod
)
{
void
setStats
(
int
&
fight
,
int
&
flee
,
int
&
t
alk
,
int
&
fightMod
,
int
&
flee
Mod
,
int
&
talkMod
)
{
// Set Fight Stat and Modifier
// Set Fight Stat and Modifier
fight
=
rand
()
%
20
+
5
;
fight
=
rand
()
%
20
+
5
;
if
(
fight
==
5
)
fightMod
=
-
3
;
else
if
(
fight
==
6
||
7
)
fightMod
=
-
2
;
else
if
(
fight
==
8
||
9
)
fightMod
=
-
1
;
else
if
(
fight
==
12
||
13
)
fightMod
=
1
;
else
if
(
fight
==
14
||
15
)
fightMod
=
2
;
else
if
(
fight
==
16
||
17
)
fightMod
=
3
;
else
if
(
fight
==
18
||
19
)
fightMod
=
4
;
else
if
(
fight
<
20
)
fightMod
=
5
;
else
fightMod
=
0
;
// Set Flee Stat and Modifier
// Set Flee Stat and Modifier
flee
=
rand
()
%
20
+
5
;
flee
=
rand
()
%
20
+
5
;
if
(
fight
==
5
)
fightMod
=
-
3
;
else
if
(
fight
==
6
||
7
)
fightMod
=
-
2
;
else
if
(
fight
==
8
||
9
)
fightMod
=
-
1
;
else
if
(
fight
==
12
||
13
)
fightMod
=
1
;
else
if
(
fight
==
14
||
15
)
fightMod
=
2
;
else
if
(
fight
==
16
||
17
)
fightMod
=
3
;
else
if
(
fight
==
18
||
19
)
fightMod
=
4
;
else
if
(
fight
<
20
)
fightMod
=
5
;
else
fightMod
=
0
;
// Set Think Stat and Modifier
think
=
rand
()
%
20
+
5
;
// Set Talk Stat and Modifier
// Set Talk Stat and Modifier
talk
=
rand
()
%
20
+
5
;
talk
=
rand
()
%
20
+
5
;
...
...
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