Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Player.h"
- #include "Stats.h"
- #include "Character.h"
- #include<iostream>
- #include "time.h"
- Player::Player(Stats stats):Character(stats) {}
- void Player::getHit(int attackerATK, int victimDEF, int victimHP)
- {
- // division by zero
- if(attackerATK - victimDEF == 0)
- {
- m_stats.setHealth( victimHP - rand() % 4 ); // just make it 4 i don't know why
- }
- else if(attackerATK - victimDEF != 0)
- {
- m_stats.setHealth( victimHP - rand() % (attackerATK - victimDEF) );
- }
- }
- void Player::healSelf(int skill)
- {
- m_stats.incrementHealth(rand() % 3*skill);
- }
- int Player::fireBall(int skill)
- {
- return rand() % 3*skill;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement