Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Player.h"
- #include "Stats.h"
- #include<iostream>
- #include<cmath>
- Player::Player(int hp, int atk, int def, int skil)
- {
- Player::stats.setHealth(hp);
- Player::stats.setAttack(atk);
- Player::stats.setDefense(def);
- Player::stats.setSkill(skil);
- }
- Stats Player::getStats()
- {
- return Player::stats;
- }
- void Player::displayHP()
- {
- std::cout << "Hero HP: " << Player::stats.getHealth() << std::endl;
- }
- int Player::getHit(int attackerATK, int victimDEF, int victimHP)
- {
- return (victimHP - rand()%(attackerATK - victimDEF));
- }
- int Player::healSelf(int hp, int skil)
- {
- return (hp + rand()%(5*skil));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement