diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2009-03-05 11:00:40 -0500 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2009-03-05 11:00:40 -0500 |
| commit | 4e7f18196bf4c638823dc254905341b560ccec49 (patch) | |
| tree | 88b7d07c04d46e78a26d31862151a73894916b6b | |
| parent | f1baae7f6ab1fc0b60333a8e5192e8cc2f17e5aa (diff) | |
Move isWild down to Creature and use Config for it
| -rw-r--r-- | sigencore/Creature.cpp | 3 | ||||
| -rw-r--r-- | sigencore/TeamMember.cpp | 18 | ||||
| -rw-r--r-- | sigencore/TeamMember.h | 6 |
3 files changed, 5 insertions, 22 deletions
diff --git a/sigencore/Creature.cpp b/sigencore/Creature.cpp index 9e9ef34d..f6a0dc80 100644 --- a/sigencore/Creature.cpp +++ b/sigencore/Creature.cpp @@ -662,7 +662,8 @@ void Creature::completeMoves() for (int i = 0; i < m_species->moveCount(); ++i) { SpeciesMoveWrapper* move = m_species->move(i); - const int level = move->level(); + bool isWild = false; + const int level = (valueOfType("wild", &isWild) && isWild) ? move->wild() : move->level(); if ((0 <= level) && (level <= m_level)) moves[level] = move->move(); } diff --git a/sigencore/TeamMember.cpp b/sigencore/TeamMember.cpp index 9ddb96cd..beee45c0 100644 --- a/sigencore/TeamMember.cpp +++ b/sigencore/TeamMember.cpp @@ -98,11 +98,10 @@ int Sigencore::actionPriority(TeamMember* teamMember, const TeamMember::Action& return priority; } -TeamMember::TeamMember(SpeciesWrapper* species, const int level, Team* team, const bool isWild, const bool suppressInitialization) : +TeamMember::TeamMember(SpeciesWrapper* species, const int level, Team* team, const bool suppressInitialization) : Creature(species, level, team, suppressInitialization), m_team(team), - m_arena(NULL), - m_isWild(isWild) + m_arena(NULL) { for (int i = 0; i < (ST_SpecialDefense - ST_Attack + 1); ++i) m_stages[i] = 0; @@ -407,19 +406,6 @@ void TeamMember::exitArena() m_arena = NULL; } -void TeamMember::completeMoves() -{ - QMap<int, MoveWrapper*> moves; - for (int i = 0; i < m_species->moveCount(); ++i) - { - SpeciesMoveWrapper* move = m_species->move(i); - const int level = m_isWild ? move->wild() : move->level(); - if ((0 <= level) && (level <= m_level)) - moves[level] = move->move(); - } - // TODO: give the moves to the creature -} - void TeamMember::makeConnections() { connect(this, SIGNAL(statStageChanged(Stat, int)), SLOT(recalcStat(Stat))); diff --git a/sigencore/TeamMember.h b/sigencore/TeamMember.h index e3b54735..6cebbf6b 100644 --- a/sigencore/TeamMember.h +++ b/sigencore/TeamMember.h @@ -63,7 +63,7 @@ class SIGENCORE_EXPORT TeamMember : public Creature typedef QPair<int, ActionData> Action; typedef QPair<TeamMember*, QFuture<Action> > RequestedAction; - TeamMember(Sigscript::SpeciesWrapper* species, const int level, Team* team, const bool isWild = false, const bool suppressInitialization = true); + TeamMember(Sigscript::SpeciesWrapper* species, const int level, Team* team, const bool suppressInitialization = true); virtual ~TeamMember(); virtual bool setContainment(Containment* containment); @@ -97,13 +97,9 @@ class SIGENCORE_EXPORT TeamMember : public Creature protected: virtual void makeConnections(); - virtual void completeMoves(); - Team* m_team; Arena* m_arena; - const bool m_isWild; - int m_stages[Sigmod::ST_Evasion - Sigmod::ST_Attack + 1]; Kross::ActionCollection* m_abilityBattleScripts; |
