diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-06-18 00:59:22 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-06-18 00:59:22 +0000 |
| commit | 5319e90bf8ad9c0f2ee7bc7813bd204c2ce87b5d (patch) | |
| tree | 15e9ddc5c0174ab2415d5a0b3c3b6dfd2194b4ac | |
| parent | ae13010d010b2c4d44c1812c3c6953f819372dee (diff) | |
[FIX] Fractions can now be polled for chances
[FIX] Added some stuff to TeamMember to be usable
[FIX] Arena is no longer static
[FIX] Rules no longer needs to know maxDV (depends on whether the special DV is split)
[FIX] Hat no longer seeds the RNG; it's the apps job
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@209 6ecfd1a5-f3ed-3746-8530-beee90d26b22
| -rw-r--r-- | Changelog | 11 | ||||
| -rw-r--r-- | pokebattle/Arena.cpp | 32 | ||||
| -rw-r--r-- | pokebattle/Arena.h | 24 | ||||
| -rw-r--r-- | pokebattle/Player.h | 9 | ||||
| -rw-r--r-- | pokebattle/Team.h | 13 | ||||
| -rw-r--r-- | pokebattle/TeamMember.cpp | 171 | ||||
| -rw-r--r-- | pokebattle/TeamMember.h | 29 | ||||
| -rw-r--r-- | pokemod/Fraction.cpp | 5 | ||||
| -rw-r--r-- | pokemod/Fraction.h | 1 | ||||
| -rw-r--r-- | pokemod/Hat.h | 11 | ||||
| -rw-r--r-- | pokemod/Rules.cpp | 20 | ||||
| -rw-r--r-- | pokemod/Rules.h | 3 | ||||
| -rw-r--r-- | pokemodr/RulesUI.cpp | 11 | ||||
| -rw-r--r-- | pokemodr/RulesUI.h | 2 | ||||
| -rw-r--r-- | pokemodr/gui/rules.ui | 16 |
15 files changed, 226 insertions, 132 deletions
@@ -1,4 +1,15 @@ ----------------- +Rev: 209 +Date: 17 June 2008 +User: MathStuf +----------------- +[FIX] Fractions can now be polled for chances +[FIX] Added some stuff to TeamMember to be usable +[FIX] Arena is no longer static +[FIX] Rules no longer needs to know maxDV (depends on whether the special DV is split) +[FIX] Hat no longer seeds the RNG; it's the apps job + +----------------- Rev: 208 Date: 17 June 2008 User: MathStuf diff --git a/pokebattle/Arena.cpp b/pokebattle/Arena.cpp index c8e3706a..feda840d 100644 --- a/pokebattle/Arena.cpp +++ b/pokebattle/Arena.cpp @@ -28,24 +28,22 @@ #include <kross/core/action.h> #include <kross/core/childreninterface.h> -Pokebattle::Arena::Arena* Pokebattle::Arena::m_arena = 0; -QList<Pokebattle::Player*> Pokebattle::Arena::m_players; -Kross::ActionCollection* Pokebattle::Arena::m_actions = 0; +int Pokebattle::Arena::m_totalCount = 0; -Pokebattle::Arena::~Arena() +Pokebattle::Arena::Arena(QList<Player*> players) : + m_count(m_totalCount), + m_players(players), + m_actions(new Kross::ActionCollection(QString("arena-%1").arg(m_count), Kross::Manager::self().actionCollection())) { + connect(this, SIGNAL(battleEnd()), SLOT(cleanUp())); + connect(this, SIGNAL(battleEnd()), SLOT(unregisterAllScripts())); + ++m_totalCount; } -void Pokebattle::Arena::setPlayers(QList<Player*> players) -{ - m_players = players; -} - -void Pokebattle::Arena::cleanUp() +Pokebattle::Arena::~Arena() { - delete m_arena; - m_arena = NULL; - m_players.clear(); + --m_totalCount; + delete m_actions; } void Pokebattle::Arena::registerScript(const QString& name, const Pokemod::Script& script) @@ -65,14 +63,8 @@ void Pokebattle::Arena::unregisterScript(const QString& name) m_actions->removeAction(name); } -void Pokebattle::Arena::remakeCollection() -{ - if (!m_actions) - m_actions = new Kross::ActionCollection("arena", Kross::Manager::self().actionCollection()); -} - void Pokebattle::Arena::unregisterAllScripts() { delete m_actions; - m_actions = 0; + m_actions = new Kross::ActionCollection(QString("arena-%1").arg(m_count), Kross::Manager::self().actionCollection()); } diff --git a/pokebattle/Arena.h b/pokebattle/Arena.h index 0983f568..36c7e427 100644 --- a/pokebattle/Arena.h +++ b/pokebattle/Arena.h @@ -44,16 +44,9 @@ class Arena : public QObject Q_OBJECT public: - static Arena* instance() - { - if (!m_arena) - m_arena = new Arena; - m_arena->connect(m_arena, SIGNAL(battleEnd()), SLOT(cleanUp())); - m_arena->connect(m_arena, SIGNAL(battleEnd()), SLOT(unregisterAllScripts())); - return m_arena; - } - - void setPlayers(QList<Player*> players); + Arena(QList<Player*> players); + Arena(const Arena& arena); + ~Arena(); signals: void battleStart(); @@ -82,14 +75,11 @@ class Arena : public QObject void unregisterAllScripts(); void cleanUp(); - protected: - Arena(); - Arena(const Arena& arena); - ~Arena(); private: - static Arena* m_arena; - static QList<Player*> m_players; - static Kross::ActionCollection* m_actions; + int m_count; + QList<Player*> m_players; + Kross::ActionCollection* m_actions; + static int m_totalCount; }; } diff --git a/pokebattle/Player.h b/pokebattle/Player.h index 63033210..761fec02 100644 --- a/pokebattle/Player.h +++ b/pokebattle/Player.h @@ -21,9 +21,14 @@ // Qt includes #include <QObject> +// Forward declarations +namespace Pokemod +{ +class Pokemod; +} + namespace Pokebattle { -// Forward declarations class Team; class Player : public QObject @@ -32,6 +37,8 @@ class Player : public QObject public: Player(Team* team); + + const Pokemod::Pokemod* pokemod() const; signals: public slots: protected slots: diff --git a/pokebattle/Team.h b/pokebattle/Team.h index 5a934bc9..10645b87 100644 --- a/pokebattle/Team.h +++ b/pokebattle/Team.h @@ -21,9 +21,15 @@ // Qt includes #include <QObject> +// Forward declarations +namespace Pokemod +{ +class Pokemod; +} + namespace Pokebattle { -// Forward declarations +class Player; class TeamMember; class Team : public QObject @@ -31,12 +37,17 @@ class Team : public QObject Q_OBJECT public: + const Player* player(); + + const Pokemod::Pokemod* pokemod() const; signals: void teamKnockedOut(); public slots: protected slots: protected: private: + const Player* m_player; + QList<TeamMember*> m_members; }; } diff --git a/pokebattle/TeamMember.cpp b/pokebattle/TeamMember.cpp index 387a2220..3d747b0e 100644 --- a/pokebattle/TeamMember.cpp +++ b/pokebattle/TeamMember.cpp @@ -18,30 +18,77 @@ // Header include #include "TeamMember.h" +// Pokebattle includes +#include "Team.h" + // Pokemod includes #include "../pokemod/Hat.h" +#include "../pokemod/Nature.h" +#include "../pokemod/Pokemod.h" +#include "../pokemod/Rules.h" #include "../pokemod/Species.h" #include "../pokemod/SpeciesAbility.h" #include "../pokemod/SpeciesItem.h" #include "../pokemod/SpeciesMove.h" -Pokebattle::TeamMember::TeamMember(const int species, const int level, const bool suppressItems) +Pokebattle::TeamMember::TeamMember(const int speciesId, const int level, const Team* team, const bool suppressItems) : + m_team(team) { - setSpecies(species); + const Pokemod::Species* species = pokemod()->speciesById(speciesId); + setSpecies(speciesId); setLevel(level); if (!suppressItems) { - // TODO: set items from the SpeciesItem list + const Pokemod::Fraction itemChance = species->itemChance(); + Pokemod::Hat<int> itemHat; + for (int i = 0; i < species->itemCount(); ++i) + { + const Pokemod::SpeciesItem* item = species->item(i); + itemHat.add(item->item(), item->weight()); + } + for (int i = 0; i < pokemod()->rules()->maxHeldItems(); ++i) + { + if (itemChance.poll()) + m_items.append(itemHat.pick()); + } } // TODO: choose moves - // TODO: choose abilities - // TODO: determine DVs - // TODO: set level experience - // TODO: set the gender - // TODO: zero everything else + Pokemod::Hat<int> abilityHat; + for (int i = 0; i < species->abilityCount(); ++i) + { + const Pokemod::SpeciesAbility* ability = species->ability(i); + abilityHat.add(ability->ability(), ability->weight()); + } + for (int i = 0; i < pokemod()->rules()->maxAbilities(); ++i) + { + const int ability = abilityHat.pick(); + m_abilities.append(ability); + abilityHat.setCount(ability, 0); + } + if (pokemod()->rules()->specialDVSplit()) + { + for (int i = 0; i < Pokemod::ST_End_GSC; ++i) + m_dv[i] = qrand() & 31; + } + else + { + for (int i = Pokemod::ST_No_HP_Start; i < Pokemod::ST_End_RBY; ++i) + m_dv[i] = qrand() & 15; + m_dv[Pokemod::ST_HP] = (m_dv[Pokemod::ST_Attack] << 3) + (m_dv[Pokemod::ST_Defense] << 2) + (m_dv[Pokemod::ST_Speed] << 1) + m_dv[Pokemod::ST_Special]; + } + if (species->genderFactor() <= 1) + setGender(species->genderFactor().poll()); + else + setGender(-1); + for (int i = 0; i < Pokemod::ST_End_GSC; ++i) + { + m_statExp[i] = 0; + m_effortValues[i] = 0; + } } -Pokebattle::TeamMember::TeamMember(const Pokemod::MapTrainerTeamMember& teamMember) +Pokebattle::TeamMember::TeamMember(const Pokemod::MapTrainerTeamMember& teamMember, const Team* team) : + m_team(team) { // TODO: grab information from the class // TODO: fill in anything else @@ -59,24 +106,76 @@ int Pokebattle::TeamMember::species() const int Pokebattle::TeamMember::level() const { - return calculateLevel(); + return m_level; } int Pokebattle::TeamMember::stat(const int stat) const { - return calculateStat(stat); + return calcStat(stat); } int Pokebattle::TeamMember::effortValue(const int stat) const { - // TODO: make sure the stat is valid + Q_ASSERT(stat < (pokemod()->rules()->specialSplit() ? Pokemod::ST_End_RBY : Pokemod::ST_End_GSC)); return m_effortValues[stat]; } +int Pokebattle::TeamMember::calcExp(int level) const +{ + if (level < 0) + level = m_level; + const int square = level * level; + const int cube = square * level; + const double p[] = {0.000, 0.008, 0.014}; + switch (pokemod()->speciesById(m_species)->growth()) + { + case Pokemod::Species::Fluctuating: + if (level <= 15) + return cube * ((24 + (level + 1) / 3) / 50.0); + else if (level <= 35) + return cube * ((14 + level) / 50.0); + else if (level <= 100) + return cube * ((32 + (level / 2)) / 50.0); + else if (level <= 102) + return cube * (23 + level) / 75; + else + return 5 * cube / 3; + case Pokemod::Species::Fading: + return 6 * cube / 5 - 15 * square + 100 * level - 140; + case Pokemod::Species::Slow: + return 5 * cube / 4; + case Pokemod::Species::Normal: + return cube; + case Pokemod::Species::Fast: + return 4 * cube / 5; + case Pokemod::Species::Erratic: + if (level <= 50) + return cube * ((100 - level) / 50.0); + else if (level <= 68) + return cube * ((150 - level) / 100.0); + else if (level <= 98) + return cube * (1.274 - (level / 3) / 50.0 - p[level % 3]); + else if (level <= 100) + return cube * ((160 - level) / 100.0); + else + return 3 * cube / 5; + } +} + +int Pokebattle::TeamMember::calcStat(const int stat, int exp) const +{ + // TODO: calculate stat + // TODO: extra factor for HP + // TODO: factor in natures +} + void Pokebattle::TeamMember::boostLevels(const int levels) { - // TODO: check to make sure that the level doesnt push it over the max - // TODO: reset level experience + if ((m_level + levels) < pokemod()->rules()->maxLevel()) + { + setLevel(m_level + levels); + emit(levelChanged(m_level)); + } } void Pokebattle::TeamMember::setName(const QString& name) @@ -100,7 +199,7 @@ void Pokebattle::TeamMember::cureStatus(const int status) void Pokebattle::TeamMember::giveStatus(const int status) { - // TODO: make sure its a valid status + Q_ASSERT(pokemod()->statusIndex(status) != INT_MAX); if (!m_status.contains(status)) { m_status.append(status); @@ -108,22 +207,34 @@ void Pokebattle::TeamMember::giveStatus(const int status) } } -void Pokebattle::TeamMember::giveLevelExperience(const int experience) +void Pokebattle::TeamMember::giveLevelExp(const int exp) { - const int currentLevel = calculateLevel(); - // TODO: make sure the new experience doesn't overflow the level - // TODO: emit a signal if the level was changed + if (m_level == pokemod()->rules()->maxLevel()) + return; + const int expNeeded = calcExp(m_level + 1) - calcExp(); + if (exp < expNeeded) + { + m_levelExp += exp; + emit(expGained(exp)); + } + else + { + setLevel(m_level + 1); + emit(expGained(expNeeded)); + emit(levelChanged(m_level)); + giveLevelExp(exp - expNeeded); + } } -void Pokebattle::TeamMember::giveStatExperience(const int stat, const int experience) +void Pokebattle::TeamMember::giveStatExp(const int stat, const int exp) { // TODO: ensure that the stat is valid - const int currentStat = calculateStat(stat); - // TODO: make sure the new experience doesn't overflow the total experience + const int currentStat = calcStat(stat); + // TODO: make sure the new exp doesn't overflow the total exp // TODO: emit a signal if the stat was changed } -void Pokebattle::TeamMember::giveEffort(const int stat, const int experience) +void Pokebattle::TeamMember::giveEffort(const int stat, const int exp) { // TODO: ensure that the stat is valid const int currentEffort = m_effortValues[stat]; @@ -168,20 +279,26 @@ void Pokebattle::TeamMember::teachMove(const int move) emit(moveLearned(move)); } +const Pokemod::Pokemod* Pokebattle::TeamMember::pokemod() const +{ + return m_team->pokemod(); +} + void Pokebattle::TeamMember::setSpecies(const int species) { - // TODO: make sure the species is valid + Q_ASSERT(pokemod()->speciesIndex(species) != INT_MAX); m_species = species; } void Pokebattle::TeamMember::setGender(const int gender) { - // TODO: make sure the gender is valid + Q_ASSERT((-1 <= gender) && (gender <= 1)); m_gender = gender; } void Pokebattle::TeamMember::setLevel(const int level) { - // TODO: make sure the level is valid - // TODO: set the experience from the level + Q_ASSERT(level <= pokemod()->rules()->maxLevel()); + m_level = level; + m_levelExp = calcExp(); } diff --git a/pokebattle/TeamMember.h b/pokebattle/TeamMember.h index b12c8f1d..8e745c19 100644 --- a/pokebattle/TeamMember.h +++ b/pokebattle/TeamMember.h @@ -30,25 +30,32 @@ namespace Pokemod { class MapTrainerTeamMember; +class Pokemod; } namespace Pokebattle { +class Team; + class TeamMember : public QObject { Q_OBJECT public: - TeamMember(const int species, const int level, const bool suppressItems = false); - TeamMember(const Pokemod::MapTrainerTeamMember& teamMember); + TeamMember(const int speciesId, const int level, const Team* team, const bool suppressItems = false); + TeamMember(const Pokemod::MapTrainerTeamMember& teamMember, const Team* team); QString name() const; int species() const; int level() const; int stat(const int stat) const; int effortValue(const int stat) const; + + int calcExp(int level = -1) const; + int calcStat(const int stat, int exp = -1) const; signals: void nameChanged(const QString& oldName, const QString& newName); + void expGained(const int exp); void statusCured(const int status); void statusInflicted(const int status); void levelChanged(int level); @@ -67,23 +74,28 @@ class TeamMember : public QObject void setName(const QString& name); void cureStatus(const int status); void giveStatus(const int status); - void giveLevelExperience(const int experience); - void giveStatExperience(const int stat, const int experience); - void giveEffort(const int stat, const int experience); + void giveLevelExp(const int exp); + void giveStatExp(const int stat, const int exp); + void giveEffort(const int stat, const int effort); void takeItem(const int itemIndex); void giveItem(const int item); void forgetMove(const int moveIndex); void teachMove(const int move); protected slots: + const Pokemod::Pokemod* pokemod() const; + void setSpecies(const int species); void setGender(const int gender); void setLevel(const int level); protected: + const Team* m_team; + QString m_name; int m_species; int m_gender; - int m_levelExperience; - int m_statExperience[Pokemod::ST_End_GSC]; + int m_levelExp; + int m_level; + int m_statExp[Pokemod::ST_End_GSC]; int m_effortValues[Pokemod::ST_End_GSC]; int m_dv[Pokemod::ST_End_GSC]; QList<int> m_status; @@ -91,9 +103,6 @@ class TeamMember : public QObject QList<int> m_items; QList<int> m_moves; QList<int> m_natures; - private: - int calculateLevel(const int newExperience = -1) const; - int calculateStat(const int stat, const int newExperience = -1) const; }; } diff --git a/pokemod/Fraction.cpp b/pokemod/Fraction.cpp index 50ddfd63..2168f162 100644 --- a/pokemod/Fraction.cpp +++ b/pokemod/Fraction.cpp @@ -33,3 +33,8 @@ void Pokemod::Fraction::reduce() m_numerator /= i; m_denominator /= i; } + +bool Pokemod::Fraction::poll() const +{ + return (qrand() % m_denominator) < m_numerator; +} diff --git a/pokemod/Fraction.h b/pokemod/Fraction.h index a83ac29f..6a50f5ac 100644 --- a/pokemod/Fraction.h +++ b/pokemod/Fraction.h @@ -37,6 +37,7 @@ class Fraction int denominator() const; void reduce(); + bool poll() const; operator double() const; Fraction operator*(const Fraction& rhs) const; diff --git a/pokemod/Hat.h b/pokemod/Hat.h index 416a2afe..09974dd3 100644 --- a/pokemod/Hat.h +++ b/pokemod/Hat.h @@ -20,7 +20,6 @@ // Qt includes #include <QtGlobal> -#include <QDateTime> #include <QMap> namespace Pokemod @@ -47,7 +46,6 @@ template<class T> class Hat template<class T> inline Hat<T>::Hat() : m_count(0) { - qsrand(QDateTime().toTime_t()); } template<class T> inline T Hat<T>::pick() const @@ -74,8 +72,13 @@ template<class T> inline void Hat<T>::setCount(const T& key, const unsigned weig { if (m_objects.contains(key)) m_count -= m_objects[key]; - m_objects[key] = weight; - m_count += weight; + if (weight) + { + m_objects[key] = weight; + m_count += weight; + } + else + m_objects.remove(key); } template<class T> inline void Hat<T>::add(const T& key, const unsigned weight) diff --git a/pokemod/Rules.cpp b/pokemod/Rules.cpp index a999cf1a..38bfe6ef 100644 --- a/pokemod/Rules.cpp +++ b/pokemod/Rules.cpp @@ -51,7 +51,6 @@ Pokemod::Rules::Rules(const Pokemod* parent) : m_allowSwitchStyle(false), m_specialSplit(false), m_specialDVSplit(false), - m_maxDVValue(0), m_happiness(false), m_happyFaintLoss(0), m_happyLevelGain(0), @@ -88,7 +87,6 @@ void Pokemod::Rules::validate() TEST(setMaxLevel, maxLevel); if (!m_maxMoney) emit(warning("Player cannot carry any money")); - TEST(setMaxDVValue, maxDVValue); if (m_effortValuesAllowed) { TEST(setMaxEVPerStat, maxEVPerStat); @@ -120,7 +118,6 @@ void Pokemod::Rules::load(const QDomElement& xml, const int /*id*/) LOAD(bool, allowSwitchStyle); LOAD(bool, specialSplit); LOAD(bool, specialDVSplit); - LOAD(int, maxDVValue); LOAD(bool, happiness); LOAD(int, happyFaintLoss); LOAD(int, happyLevelGain); @@ -154,7 +151,6 @@ QDomElement Pokemod::Rules::save() const SAVE(bool, allowSwitchStyle); SAVE(bool, specialSplit); SAVE(bool, specialDVSplit); - SAVE(int, maxDVValue); SAVE(bool, happiness); SAVE(int, happyFaintLoss); SAVE(int, happyLevelGain); @@ -311,16 +307,6 @@ void Pokemod::Rules::setSpecialDVSplit(const bool specialDVSplit) CHECK(specialDVSplit); } -void Pokemod::Rules::setMaxDVValue(const int maxDVValue) -{ - if (1 < maxDVValue) - { - emit(error(bounds("maxDVValue"))); - return; - } - CHECK(maxDVValue); -} - void Pokemod::Rules::setHappiness(const bool happiness) { CHECK(happiness); @@ -476,11 +462,6 @@ bool Pokemod::Rules::specialDVSplit() const return m_specialDVSplit; } -int Pokemod::Rules::maxDVValue() const -{ - return m_maxDVValue; -} - bool Pokemod::Rules::happiness() const { return m_happiness; @@ -545,7 +526,6 @@ Pokemod::Rules& Pokemod::Rules::operator=(const Rules& rhs) COPY(allowSwitchStyle); COPY(specialSplit); COPY(specialDVSplit); - COPY(maxDVValue); COPY(happiness); COPY(happyFaintLoss); COPY(happyLevelGain); diff --git a/pokemod/Rules.h b/pokemod/Rules.h index 16360c36..5c93115e 100644 --- a/pokemod/Rules.h +++ b/pokemod/Rules.h @@ -64,7 +64,6 @@ class Rules : public Object void setAllowSwitchStyle(const bool allowSwitchStyle); void setSpecialSplit(const bool specialSplit); void setSpecialDVSplit(const bool specialDVSplit); - void setMaxDVValue(const int maxDV); void setHappiness(const bool happiness); void setHappyFaintLoss(const int happyFaint); void setHappyLevelGain(const int happyLevel); @@ -94,7 +93,6 @@ class Rules : public Object bool allowSwitchStyle() const; bool specialSplit() const; bool specialDVSplit() const; - int maxDVValue() const; bool happiness() const; int happyFaintLoss() const; int happyLevelGain() const; @@ -126,7 +124,6 @@ class Rules : public Object bool m_allowSwitchStyle; bool m_specialSplit; bool m_specialDVSplit; - int m_maxDVValue; bool m_happiness; int m_happyFaintLoss; int m_happyLevelGain; diff --git a/pokemodr/RulesUI.cpp b/pokemodr/RulesUI.cpp index c453af43..f1a85c13 100644 --- a/pokemodr/RulesUI.cpp +++ b/pokemodr/RulesUI.cpp @@ -32,11 +32,6 @@ Pokemodr::RulesUI::~RulesUI() { } -void Pokemodr::RulesUI::initGui() -{ - varMaxDV->addItems(Pokemod::Rules::DVStr); -} - void Pokemodr::RulesUI::setGui() { boxGenders->setChecked(static_cast<Pokemod::Rules*>(modified())->genderAllowed() ? Qt::Checked : Qt::Unchecked); @@ -46,7 +41,6 @@ void Pokemodr::RulesUI::setGui() varSwitchStyle->setChecked(static_cast<Pokemod::Rules*>(modified())->allowSwitchStyle() ? Qt::Checked : Qt::Unchecked); boxSplitSpecial->setChecked(static_cast<Pokemod::Rules*>(modified())->specialSplit() ? Qt::Checked : Qt::Unchecked); varSplitSpecialDV->setCheckState(static_cast<Pokemod::Rules*>(modified())->specialDVSplit() ? Qt::Checked : Qt::Unchecked); - varMaxDV->setCurrentIndex(static_cast<Pokemod::Rules*>(modified())->maxDVValue()); boxHappiness->setChecked(static_cast<Pokemod::Rules*>(modified())->happiness() ? Qt::Checked : Qt::Unchecked); varFaintLoss->setValue(static_cast<Pokemod::Rules*>(modified())->happyFaintLoss()); varLevelGain->setValue(static_cast<Pokemod::Rules*>(modified())->happyLevelGain()); @@ -121,11 +115,6 @@ void Pokemodr::RulesUI::on_varSplitSpecialDV_toggled(const bool splitSpecialDV) static_cast<Pokemod::Rules*>(modified())->setSpecialDVSplit(splitSpecialDV); } -void Pokemodr::RulesUI::on_varMaxDV_activated(const int maxDV) -{ - static_cast<Pokemod::Rules*>(modified())->setMaxDVValue(maxDV); -} - void Pokemodr::RulesUI::on_boxHappiness_toggled(const bool happiness) { static_cast<Pokemod::Rules*>(modified())->setHappiness(happiness); diff --git a/pokemodr/RulesUI.h b/pokemodr/RulesUI.h index 8f3b6c2c..9b4c5941 100644 --- a/pokemodr/RulesUI.h +++ b/pokemodr/RulesUI.h @@ -50,7 +50,6 @@ class RulesUI : public ObjectUI, private Ui::formRules void on_varSwitchStyle_toggled(const bool switchStyle); void on_boxSplitSpecial_toggled(const bool specialSplit); void on_varSplitSpecialDV_toggled(const bool specialSplitDV); - void on_varMaxDV_activated(const int maxDV); void on_boxHappiness_toggled(const bool happiness); void on_varFaintLoss_valueChanged(const int faintLoss); void on_varLevelGain_valueChanged(const int levelGain); @@ -72,7 +71,6 @@ class RulesUI : public ObjectUI, private Ui::formRules void on_varMaxStages_valueChanged(const int maxStages); void on_varMaxMoney_valueChanged(const int maxMoney); private slots: - void initGui(); void setGui(); }; } diff --git a/pokemodr/gui/rules.ui b/pokemodr/gui/rules.ui index 5c0e8a51..f02201e7 100644 --- a/pokemodr/gui/rules.ui +++ b/pokemodr/gui/rules.ui @@ -96,22 +96,6 @@ </widget> </item> <item> - <widget class="QGroupBox" name="boxMaxDV" > - <property name="title" > - <string>Max DV</string> - </property> - <layout class="QHBoxLayout" > - <item> - <widget class="KComboBox" name="varMaxDV" > - <property name="toolTip" > - <string>The highest a DV may be</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> <widget class="QGroupBox" name="boxHappiness" > <property name="toolTip" > <string>If checked, happiness will be enabled</string> |
