Пример #1
0
void EvBox::changeToMinusBoost()
{
    int minus = sender()->property("stat").toInt();
    int plus = NatureInfo::StatBoosted(poke().nature());

    if (plus == minus) {
        plus = NatureInfo::StatHindered(poke().nature());
    } else if (plus == 0) {
        plus = minus == Attack ? Defense : Attack;
    }

    emit natureChanged(NatureInfo::NatureOf(plus,minus));
    emit natureBoostChanged();
}
Пример #2
0
void TB_PokemonBody::connectWithAdvanced(TB_Advanced *ptr)
{
    connect(ptr, SIGNAL(abilityChanged()), this, SLOT(updateAbility()));
    connect(ptr, SIGNAL(levelChanged()), this, SLOT(updateLevel()));
    connect(ptr, SIGNAL(imageChanged()), this, SLOT(updateImage()));
    connect(ptr, SIGNAL(genderChanged()), this, SLOT(updateGender()));
    connect(ptr, SIGNAL(genderChanged()), this, SLOT(updateImage()));
    connect(ptr, SIGNAL(statChanged()), this, SLOT(updateEVs()));
    connect(ptr, SIGNAL(pokeFormeChanged(Pokemon::uniqueId)), this, SLOT(changeForme(Pokemon::uniqueId)), Qt::QueuedConnection);
    connect(this, SIGNAL(EVChanged(int)), ptr, SLOT(updateStat(int)));
    connect(this, SIGNAL(natureChanged()), ptr, SLOT(updateStats()));
    connect(this, SIGNAL(pokeImageChanged()), ptr, SLOT(updatePokeImage()));
    connect(ptr, SIGNAL(levelChanged()), this, SIGNAL(levelChanged()));
}