Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
RogueReborn
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mikhail Andrenkov
RogueReborn
Commits
af6c422c
Commit
af6c422c
authored
8 years ago
by
Ian Prins
Browse files
Options
Downloads
Patches
Plain Diff
move HP up from PlayerChar to Mob
parent
64e479ce
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/include/mob.h
+5
-1
5 additions, 1 deletion
src/include/mob.h
src/include/playerchar.h
+2
-4
2 additions, 4 deletions
src/include/playerchar.h
src/mob.cpp
+11
-1
11 additions, 1 deletion
src/mob.cpp
src/playerchar.cpp
+1
-12
1 addition, 12 deletions
src/playerchar.cpp
with
19 additions
and
18 deletions
src/include/mob.h
+
5
−
1
View file @
af6c422c
...
...
@@ -6,7 +6,10 @@
class
Mob
{
public:
Mob
(
std
::
string
,
Coord
);
Mob
(
std
::
string
,
Coord
,
int
);
int
getHP
();
void
setHP
();
int
getMaxHP
();
Coord
&
getCoord
();
void
setCoord
(
Coord
);
int
&
operator
[](
int
);
...
...
@@ -14,6 +17,7 @@ class Mob {
private:
std
::
string
name
;
Coord
coord
;
int
HP
,
maxHP
;
};
#endif
This diff is collapsed.
Click to expand it.
src/include/playerchar.h
+
2
−
4
View file @
af6c422c
...
...
@@ -13,14 +13,12 @@ class PlayerChar : public Mob {
int
getMaxStrength
();
int
getArmor
();
int
getGold
();
int
getHP
();
int
getMaxHP
();
int
getLevel
();
bool
foundAmulet
();
int
maxDelved
();
private:
const
int
START_HP
=
10
,
START_ARMOR
=
0
,
START_STR
=
1
,
START_GOLD
=
0
,
START_LEVEL
=
1
;
int
HP
,
maxHP
,
armor
,
strength
,
maxStrength
,
gold
,
level
;
const
int
START_HP
=
10
,
START_ARMOR
=
0
,
START_STR
=
1
5
,
START_GOLD
=
0
,
START_LEVEL
=
1
;
int
armor
,
strength
,
maxStrength
,
gold
,
level
;
ItemZone
backpack
;
bool
hasFoundAmulet
;
int
maxDepth
;
...
...
This diff is collapsed.
Click to expand it.
src/mob.cpp
+
11
−
1
View file @
af6c422c
...
...
@@ -2,11 +2,21 @@
#include
"include/coord.h"
#include
<string>
Mob
::
Mob
(
std
::
string
name
,
Coord
coord
)
Mob
::
Mob
(
std
::
string
name
,
Coord
coord
,
int
hp
)
:
name
(
name
)
,
coord
(
coord
)
,
HP
(
hp
)
,
maxHP
(
hp
)
{}
int
Mob
::
getHP
()
{
return
HP
;
}
int
Mob
::
getMaxHP
()
{
return
maxHP
;
}
Coord
&
Mob
::
getCoord
()
{
return
coord
;
}
...
...
This diff is collapsed.
Click to expand it.
src/playerchar.cpp
+
1
−
12
View file @
af6c422c
...
...
@@ -4,9 +4,7 @@
#include
"include/coord.h"
PlayerChar
::
PlayerChar
(
Coord
pos
)
:
Mob
(
"@Rogue"
,
pos
)
,
HP
(
START_HP
)
,
maxHP
(
START_HP
)
:
Mob
(
"@Rogue"
,
pos
,
START_HP
)
,
armor
(
START_ARMOR
)
,
strength
(
START_STR
)
,
maxStrength
(
START_STR
)
...
...
@@ -16,15 +14,6 @@ PlayerChar::PlayerChar(Coord pos)
,
hasFoundAmulet
(
false
)
,
maxDepth
(
1
)
{}
int
PlayerChar
::
getHP
()
{
return
HP
;
}
int
PlayerChar
::
getMaxHP
()
{
return
maxHP
;
}
int
PlayerChar
::
getArmor
()
{
return
armor
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment