Almost working save sytem but the data I store is totally wrong. I need to also save the entity IDs being used and map them to the components.
This commit is contained in:
parent
babc190525
commit
d113dba42f
15 changed files with 213 additions and 64 deletions
18
combat.cpp
18
combat.cpp
|
@ -1,14 +1,16 @@
|
|||
#include "combat.hpp"
|
||||
#include "rand.hpp"
|
||||
|
||||
int Combat::attack(Combat &target) {
|
||||
int attack = Random::uniform<int>(0,1);
|
||||
int my_dmg = 0;
|
||||
namespace components {
|
||||
int Combat::attack(Combat &target) {
|
||||
int attack = Random::uniform<int>(0,1);
|
||||
int my_dmg = 0;
|
||||
|
||||
if(attack) {
|
||||
my_dmg = Random::uniform<int>(1, damage);
|
||||
target.hp -= my_dmg;
|
||||
if(attack) {
|
||||
my_dmg = Random::uniform<int>(1, damage);
|
||||
target.hp -= my_dmg;
|
||||
}
|
||||
|
||||
return my_dmg;
|
||||
}
|
||||
|
||||
return my_dmg;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue