Ejemplo n.º 1
0
bool Infatuation::whenAttacks(Pokemon& defending)
{
    if(&defending == &infatSrc)
    {
        if(rand() % 100 < 50 and oppositeGender(afflictedPokemon.getGender(),
            defending.getGender()))
        {
            cout << afflictedPokemon.getNickname() << " is infatuated." << endl;
            return true;
        }
        else
        {
            cout << afflictedPokemon.getNickname() << " resists infatuation." << endl;
            return false;
        }
    }
    else
    {
        infatSrcHasChanged = true;
        return false;
    }
}