You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
250 B
15 lines
250 B
4 weeks ago
|
#include "combat.hpp"
|
||
|
#include "rand.hpp"
|
||
|
|
||
|
int Combat::fight(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;
|
||
|
}
|