From 2cf202f25626b96703a5f7dab5cfebec32125a21 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sun, 22 Feb 2009 22:52:19 -0500 Subject: Add completeStats method to Creature --- sigencore/Creature.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'sigencore/Creature.cpp') diff --git a/sigencore/Creature.cpp b/sigencore/Creature.cpp index db2950b6..11affb49 100644 --- a/sigencore/Creature.cpp +++ b/sigencore/Creature.cpp @@ -610,6 +610,21 @@ void Sigencore::Creature::completeData() emit(initialized()); } +void Sigencore::Creature::completeStats() +{ + if (m_sigmod->rules()->specialSplit() && m_sigmod->rules()->specialDVSplit()) + { + for (int i = Sigmod::ST_HP; i <= Sigmod::ST_SpecialDefense; ++i) + m_dv[i] = qrand() & 31; + } + else + { + for (int i = Sigmod::ST_Attack; i <= Sigmod::ST_Special; ++i) + m_dv[i] = qrand() & 15; + m_dv[Sigmod::ST_HP] = ((m_dv[Sigmod::ST_Attack] & 1) << 3) + ((m_dv[Sigmod::ST_Defense] & 1) << 2) + ((m_dv[Sigmod::ST_Speed] & 1) << 1) + (m_dv[Sigmod::ST_Special] & 1); + } +} + void Sigencore::Creature::completeAbilities() { Sigcore::Hat abilityHat = m_species->abilityHat(); -- cgit