[ogs-changes] dist/c++/ogs/core Creature.cpp,1.12,1.13
Status: Alpha
Brought to you by:
elemings
From: <ele...@us...> - 2003-04-19 18:37:44
|
Update of /cvsroot/ogs/dist/c++/ogs/core In directory sc8-pr-cvs1:/tmp/cvs-serv22457/c++/ogs/core Modified Files: Creature.cpp Log Message: See C++ ChangeLog (Apr 19) for details. Index: Creature.cpp =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/core/Creature.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Creature.cpp 18 Apr 2003 01:41:02 -0000 1.12 --- Creature.cpp 19 Apr 2003 18:37:40 -0000 1.13 *************** *** 42,45 **** --- 42,46 ---- * @param size Size of creature. * @param parts An array of body part types. + * @todo Observe Con modifier and update hit dice modifier and hit points. */ Creature::Creature (Die hitDice, Abilities abilities, *************** *** 61,66 **** this->_saves.ref.addModifier (modifier); this->_initiative.addModifier (modifier); ! Defense& defense = getDefense (); ! defense.addModifier (modifier); } --- 62,66 ---- this->_saves.ref.addModifier (modifier); this->_initiative.addModifier (modifier); ! (getDefense ()).addModifier (modifier); } *************** *** 69,72 **** --- 69,76 ---- if (ability) { this->_saves.fort.addModifier (ability->getModifier ()); + + // Add Con bonus to hit dice. + this->_hitDice.setModifier ((ability->getModifier ()).getValue () * + this->_hitDice.getCount ()); } *************** *** 81,84 **** --- 85,99 ---- //this->_saves.will.addModifier (this->_willModifier); + // Roll hit points. Minimum roll for each hit die is 1 hp. + Die::Value hitPoints = this->_hitDice.rollValue (); + Die::Count count = this->_hitDice.getCount (); + if (hitPoints < count) { + hitPoints = count; + } + + Health health (hitPoints, hitPoints); + setHealth (health); + + // Create a body from array of part types. for (Parts::size_type i = 0; i < parts.size (); ++i) { this->_body.push_back (BodyPart (*this, parts [i])); |