Files are now in a src directory and I'm using a src/meson.build and tests/meson.build to specify what to build.
This commit is contained in:
parent
4778677647
commit
1d4ae911b9
108 changed files with 94 additions and 83 deletions
16
src/combat.cpp
Normal file
16
src/combat.cpp
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#include "components.hpp"
|
||||
#include "rand.hpp"
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
return my_dmg;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue