For registration, write to webmaster@brn.systems amd include gitea registration. This is due to spam.
#pragma once #include "hitpointypes.h"
class hp { public: // returns 1 if sccss bool setMaxHP(hptype new_max_hp) { if (new_max_hp < 1) return false; MaxHP = new_max_hp;
if (CurrentHP > MaxHP) CurrentHP = MaxHP; return true; } hptype getMaxHP(){ return MaxHP; } hptype getCurrentHP(){ return CurrentHP; } void TakeDamage(hptype damage){ if (damage > CurrentHP ){ CurrentHP = 0; return; } CurrentHP -= damage; } void heal(hptype amount){ if (amount + CurrentHP > MaxHP){ CurrentHP + MaxHP; return; } CurrentHP += amount; }
private: hptype MaxHP; hptype CurrentHP;
};``
No dependencies set.
The note is not visible to the blocked user.
#pragma once
#include "hitpointypes.h"
class hp {
public:
// returns 1 if sccss
bool setMaxHP(hptype new_max_hp) {
if (new_max_hp < 1)
return false;
MaxHP = new_max_hp;
private:
hptype MaxHP;
hptype CurrentHP;
};``