I am making a game, and I am having a problem with making sure that the class value that is being set, stays set and does not return to what the constructor standard value is. I tried looking for something related to my problem, but I did not find one, so I apologize if this is a repeat. 

```
void playerCombat(Hero hero, Enemy enemy, Item heroWeapon, Item enemyWeapon, Item heroArmor, Item enemyArmor)
{
int hp = 0;

int damage = 0;

if (heroWeapon.getType() == "Slice" && enemyArmor.getType() == "Light")
{
    damage = -enemyArmor.getDefense() - enemy.getDefense() + (rand() % 20 + 1) + (hero.getAttack() * 2);

    if (damage > 0)
    {
        hp = (enemy.getHP() - damage);
        enemy.setHp(hp);
    }
    else
    {
        damage = 0;
        cout << hero.getName() << " missed." << endl;
    }
}
else if (heroWeapon.getType() == "Stab" && enemyArmor.getType() == "Medium")
{
    damage = -enemyArmor.getDefense() - enemy.getDefense() + (rand() % 20 + 1) + (hero.getAttack() * 2);

    if (damage > 0)
    {
        hp = (enemy.getHP() - damage);
        enemy.setHp(hp);
    }
    else
    {
        damage = 0;
        cout << hero.getName() << " missed." << endl;
    }
}
else if (heroWeapon.getType() == "Blunt" && enemyArmor.getType() == "Heavy")
{
    damage = -enemyArmor.getDefense() - enemy.getDefense() + (rand() % 20 + 1) + (hero.getAttack() * 2);

    if (damage > 0)
    {
        hp = (enemy.getHP() - damage);
        enemy.setHp(hp);
    }
    else
    {
        damage = 0;
        cout << hero.getName() << " missed." << endl;
    }
}
else if (heroWeapon.getType() == "Sword" && enemyArmor.getType() == "Medium")
{
    damage = -enemyArmor.getDefense() - enemy.getDefense() + (rand() % 20 + 1) + (hero.getAttack() * .5);

    if (damage > 0)
    {
        hp = (enemy.getHP() - damage);
        enemy.setHp(hp);
    }
    else
    {
        damage = 0;
        cout << hero.getName() << "'s weapon was ineffective." << endl;
    }
}
else if (heroWeapon.getType() == "Stab" && enemyArmor.getType() == "Heavy")
{
    damage = -enemyArmor.getDefense() - enemy.getDefense() + (rand() % 20 + 1) + (hero.getAttack() * .5);

    if (damage > 0)
    {
        hp = (enemy.getHP() - damage);
        enemy.setHp(hp);
    }
    else
    {
        damage = 0;
        cout << hero.getName() << "'s weapon was ineffective." << endl;
    }
}
else if (heroWeapon.getType() == "Blunt" && enemyArmor.getType() == "Light")
{
    damage = -enemyArmor.getDefense() - enemy.getDefense() + (rand() % 20 + 1) + (hero.getAttack() * .5);

    if (damage > 0)
    {
        hp = (enemy.getHP() - damage);
        enemy.setHp(hp);
    }
    else
    {
        damage = 0;
        cout << hero.getName() << " missed." << endl;
    }
}
else
{
    damage = -enemyArmor.getDefense() - enemy.getDefense() + (rand() % 20 + 1) + (hero.getAttack());

    if (damage > 0)
    {
        hp = (enemy.getHP() - damage);
        enemy.setHp(hp);
    }
    else
    {
        damage = 0;
        cout << hero.getName() << "'s weapon was ineffective." << endl;
    }
}
cout << hero.getName() << " deals " << damage << " points of damage to " << enemy.getName() << "." << endl;
cout << enemy.getName() << " has " << enemy.getHP() << " out of " << enemy.getMaxHp() << "." << endl;
cout << hero.getName() << " has " << hero.getHP() << " out of " << hero.getMaxHp() << "." << endl;
system("pause");

}

void enemyCombat(Hero hero, Enemy enemy, Item heroWeapon, Item enemyWeapon, Item heroArmor, Item enemyArmor)
{
int hp = 0;
int damage = 0;

if (enemyWeapon.getType() == "Slice" && heroArmor.getType() == "Light")
{
    damage = (rand() % 20 + 1) + (enemy.getAttack() * 2) - enemyArmor.getDefense() - enemy.getDefense();

    if (damage > 0)
    {
        hp = (hero.getHP() - damage);
        hero.setHp(hp);
    }
    else
    {
        damage = 0;
        cout << enemy.getName() << " missed" << endl;
    }
}
else if (enemyWeapon.getType() == "Stab" && heroArmor.getType() == "Medium")
{
    damage = (rand() % 20 + 1) + (enemy.getAttack() * 2) - enemyArmor.getDefense() - enemy.getDefense();

    if (damage > 0)
    {
        hp = (hero.getHP() - damage);
        hero.setHp(hp);
    }
    else
    {
        damage = 0;
        cout << enemy.getName() << " missed" << endl;
    }
}
else if (enemyWeapon.getType() == "Blunt" && heroArmor.getType() == "Heavy")
{
    damage = (rand() % 20 + 1) + (enemy.getAttack() * 2) - enemyArmor.getDefense() - enemy.getDefense();

    if (damage > 0)
    {

        hp = (hero.getHP() - damage);
        hero.setHp(hp);
    }
    else
    {
        damage = 0;
        cout << enemy.getName() << " missed" << endl;
    }
}
else if (enemyWeapon.getType() == "Sword" && heroArmor.getType() == "Medium")
{
    damage = (rand() % 20 + 1) + (enemy.getAttack() * .5) - enemyArmor.getDefense() - enemy.getDefense();

    if (damage > 0)
    {
        hp = (hero.getHP() - damage);
        hero.setHp(hp);
    }
    else
    {
        damage = 0;
        cout << enemy.getName() << "'s attack was ineffective." << endl;
    }
}
else if (enemyWeapon.getType() == "Stab" && heroArmor.getType() == "Heavy")
{
    damage = (rand() % 20 + 1) + (enemy.getAttack() * .5) - enemyArmor.getDefense() - enemy.getDefense();

    if (damage > 0)
    {
        hp = (hero.getHP() - damage);
        hero.setHp(hp);
    }
    else
    {
        damage = 0;
        cout << enemy.getName() << "'s attack was ineffective." << endl;
    }
}
else if (enemyWeapon.getType() == "Blunt" && heroArmor.getType() == "Light")
{
    damage = (rand() % 20 + 1) + (enemy.getAttack() * .5) - enemyArmor.getDefense() - enemy.getDefense();

    if (damage > 0)
    {
        hp = (hero.getHP() - damage);
        hero.setHp(hp);
    }
    else
    {
        damage = 0;
        cout << enemy.getName() << "'s attack was ineffective." << endl;
    }
}
else
{
    damage = (rand() % 20 + 1) + (enemy.getAttack()) - enemyArmor.getDefense() - enemy.getDefense();

    if (damage > 0)
    {
        hp = (hero.getHP() - damage);
        hero.setHp(hp);
    }
    else
    {
        damage = 0;
        cout << enemy.getName() << "' missed." << endl;
    }
}
cout << enemy.getName() << " deals " << damage << " points of damage to " << hero.getName() << "." << endl;
cout << enemy.getName() << " has " << enemy.getHP() << " out of " << enemy.getMaxHp() << "." << endl;
cout << hero.getName() << " has " << hero.getHP() << " out of " << hero.getMaxHp() << "." << endl;
system("pause");

}

void combat(Hero hero, Enemy enemy, Item heroWeapon, Item enemyWeapon, Item heroArmor, Item enemyArmor)
 {

if (hero.getSpeed() > enemy.getSpeed())
{
    playerCombat(hero, enemy, heroWeapon, enemyWeapon, heroArmor, enemyArmor);

    enemyCombat(hero, enemy, heroWeapon, enemyWeapon, heroArmor, enemyArmor);

}
else if (hero.getSpeed() < enemy.getSpeed())
{
    playerCombat(hero, enemy, heroWeapon, enemyWeapon, heroArmor, enemyArmor);

    enemyCombat(hero, enemy, heroWeapon, enemyWeapon, heroArmor, enemyArmor);

}
else
{
    if ((rand() % 2 + 1) == 1)
    {
        playerCombat(hero, enemy, heroWeapon, enemyWeapon, heroArmor, enemyArmor);

        enemyCombat(hero, enemy, heroWeapon, enemyWeapon, heroArmor, enemyArmor);
    }
    else
    {
        playerCombat(hero, enemy, heroWeapon, enemyWeapon, heroArmor, enemyArmor);

        enemyCombat(hero, enemy, heroWeapon, enemyWeapon, heroArmor, enemyArmor);
    }
    cout << hero.getHP() << endl << enemy.getHP() << endl;
}
if (enemy.getHP() < 0)
{
    cout << "You lose!";
}
else if (hero.getHP() < 0)
{
    cout << "You win!";
}
else
{
    combat(hero, enemy, heroWeapon, enemyWeapon, heroArmor, enemyArmor);
}
}

```

For some reason after the functions for the specific character combat ends, it does not retain the new HP value, and simply resets it back their full hp (in this case 100)