ogs-changes Mailing List for Open Gaming System (Page 3)
Status: Alpha
Brought to you by:
elemings
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
(35) |
Apr
(96) |
May
(22) |
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
---|
From: <ele...@us...> - 2003-04-18 01:41:33
|
Update of /cvsroot/ogs/dist/c++ In directory sc8-pr-cvs1:/tmp/cvs-serv25962/c++ Modified Files: ChangeLog Log Message: See C++ ChangeLog (Apr 17) for details. Index: ChangeLog =================================================================== RCS file: /cvsroot/ogs/dist/c++/ChangeLog,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** ChangeLog 15 Apr 2003 16:58:28 -0000 1.18 --- ChangeLog 18 Apr 2003 01:40:59 -0000 1.19 *************** *** 1,3 **** --- 1,47 ---- + Thu Apr 17 18:10:12 UTC 2003 Eric Lemings <ele...@us...> + + * ogs/support/Class.h, ogs/support/Object.*: Doc fixes. Inline + Object::getClass() function. (It has to go in Class.h: putting + it in Object.h causes a recursive include dependency.) + + * ogs/core/Abilities.*: Doc fixes. + * ogs/core/Ability.h: Doc fixes. Add missing getType() fucntion. + + * ogs/core/Types.h: Add ItemPtr type. + * ogs/core/BodyPart.*, ogs/core/Saves.h, ogs/core/Skill.*, + ogs/core/details/*.h: Doc fixes. + + * ogs/core/Creature.cpp: Add setPoints() function. + + * ogs/core/Creature.*: Add removeSkill() function. Access hit + dice like other member objects. + + * ogs/core/Entity.h: Add getDefense() function. + + * ogs/core/Experience.h: Removed get*AttackLevel() functions. + Don't need them right now. Don't know if they'll ever be + needed. + + * ogs/core/Item.cpp: Add setWorth() function. + + * ogs/cclasses/Monk.h: Implemented a couple of monk-specific + functions. + + * ogs/cclasses/*.h, ogs/magic/Ability.*, ogs/magic/Types.h: + Move SpellCounts type to new magic type defnitions header. + + * ogs/magic/MetamagicFeat.h: Add getCost() function. + * ogs/magic/AbsoluteRange.h, ogs/magic/ExperienceCost.h: + Doc fixes. + * ogs/magic/abilities/*.h: Fix includes. Add constructors. + + * ogs/items/Ring.h, ogs/items/rings/*.h: Doc fixes. Added + constructors. + + * ogs/spells/Namespace.h, ogs/spells/conjurations/CureWounds.*: + Doc fixes. Added parameter to switch behavior to Inflict + Wounds spell. Define named constructors. + Tue Apr 15 03:46:35 UTC 2003 Eric Lemings <ele...@us...> |
From: <ele...@us...> - 2003-04-18 01:41:32
|
Update of /cvsroot/ogs/dist In directory sc8-pr-cvs1:/tmp/cvs-serv25962 Modified Files: NEWS Log Message: See C++ ChangeLog (Apr 17) for details. Index: NEWS =================================================================== RCS file: /cvsroot/ogs/dist/NEWS,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** NEWS 15 Apr 2003 16:58:26 -0000 1.6 --- NEWS 18 Apr 2003 01:40:59 -0000 1.7 *************** *** 18,21 **** the core rules have been extensively tested (more or less), then more elements can be added and the combat and magic systems should have a ! fairly stable design and implementation to build on. --- 18,32 ---- the core rules have been extensively tested (more or less), then more elements can be added and the combat and magic systems should have a ! fairly stable design and implementation to build on. Have a look at ! the current test drivers for all the gory details. ! ! There are of course some things that are still missing that just haven't ! been added yet. Things such as attacks and damage which should probably ! be an element of the Core Rules package just as defense is (even though ! these concepts exist solely for use by the Combat System package). ! Another missing piece at the highest level is the campaign that holds ! binds all the elements together and defines several key relationships ! between them all. Missing pieces such as this have not been included ! yet since they are still in the formative stages: the design for these ! concepts is not finished and therefore not yet ready for implementation. |
From: <ele...@us...> - 2003-04-18 01:41:11
|
Update of /cvsroot/ogs/dist/c++/ogs/support In directory sc8-pr-cvs1:/tmp/cvs-serv25962/c++/ogs/support Modified Files: Class.h Object.cpp Object.h Log Message: See C++ ChangeLog (Apr 17) for details. Index: Class.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/support/Class.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Class.h 7 Jan 2003 07:41:34 -0000 1.1 --- Class.h 18 Apr 2003 01:41:07 -0000 1.2 *************** *** 36,45 **** /** * An object representing the class of another object. This class is ! * actually a thin wrapper for the type_info class from the <typeinfo> ! * header of the standard C++ library. */ class Class { public: ! template <class C> static Class getClass (); bool operator== (const Class& cls) const; --- 36,46 ---- /** * An object representing the class of another object. This class is ! * actually a thin wrapper for the type_info class declared in the ! * @<typeinfo@> header of the standard C++ library. */ class Class { public: ! template <class C> ! static Class getClass (); bool operator== (const Class& cls) const; *************** *** 74,78 **** * @return True if the two objects describe the same class. */ ! inline bool Class::operator== (const Class& cls) const { return (typeInfo == cls.typeInfo); } --- 75,80 ---- * @return True if the two objects describe the same class. */ ! inline bool ! Class::operator== (const Class& cls) const { return (typeInfo == cls.typeInfo); } *************** *** 85,89 **** * @return True if each object describes a different class. */ ! inline bool Class::operator!= (const Class& cls) const { return (typeInfo != cls.typeInfo); } --- 87,92 ---- * @return True if each object describes a different class. */ ! inline bool ! Class::operator!= (const Class& cls) const { return (typeInfo != cls.typeInfo); } *************** *** 96,99 **** --- 99,112 ---- inline std::string Class::getName () const { return (std::string (typeInfo.name ())); + } + + /** + * Determine the class of this object. + * + * @return Class of this object. + */ + inline Class + Object::getClass () const { + return (Class (typeid (*this))); } Index: Object.cpp =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/support/Object.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Object.cpp 25 Mar 2003 06:13:15 -0000 1.3 --- Object.cpp 18 Apr 2003 01:41:07 -0000 1.4 *************** *** 33,43 **** /** ! * Add an event observer. * * @param observer An event observer. */ void Object::addObserver (Observer& observer) { ! // Will std::list allow the same observer to be added more than once? ! observers.push_front (&observer); } --- 33,46 ---- /** ! * Add an event observer. This function adds the observer only if it is ! * not already in the list of observers for this object. * * @param observer An event observer. */ void Object::addObserver (Observer& observer) { ! Observers::iterator end = this->_observers.end (); ! if (std::find (this->_observers.begin (), end, &observer) == end) { ! _observers.push_front (&observer); ! } } *************** *** 48,52 **** */ void Object::removeObserver (Observer& observer) { ! observers.remove (&observer); } --- 51,55 ---- */ void Object::removeObserver (Observer& observer) { ! this->_observers.remove (&observer); } *************** *** 60,69 **** */ void Object::notifyObservers (Event& event) { ! std::list<Observer*>::iterator itor = observers.begin (); ! while (itor != observers.end ()) { ! Observer* observer = *itor; observer->handleEvent (event); - ++itor; } } --- 63,71 ---- */ void Object::notifyObservers (Event& event) { ! Observers::iterator itor = this->_observers.begin (); ! while (itor != this->_observers.end ()) { ! Observer* observer = *itor++; observer->handleEvent (event); } } *************** *** 75,94 **** * * @return A string representation of this object. */ std::string Object::toString () const { std::ostringstream ostr; ostr << (typeid (*this)).name () << "@" << this; ! ostr << " [observers " << &observers << ! " [size " << observers.size () << "]]"; return (ostr.str ()); - } - - /** - * Determine the class of this object. - * - * @return Class of this object. - */ - Class Object::getClass () const { - return (Class (typeid (*this))); } --- 77,88 ---- * * @return A string representation of this object. + * @todo Change this function into an operator<< function? */ std::string Object::toString () const { std::ostringstream ostr; ostr << (typeid (*this)).name () << "@" << this; ! ostr << " [observers " << &this->_observers << ! " [size " << this->_observers.size () << "]]"; return (ostr.str ()); } Index: Object.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/support/Object.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Object.h 18 Feb 2003 04:17:21 -0000 1.2 --- Object.h 18 Apr 2003 01:41:07 -0000 1.3 *************** *** 55,58 **** --- 55,59 ---- Object (); + /** A list of observers. */ typedef std::list<Observer*> Observers; Observers getObservers () const; *************** *** 60,64 **** private: ! Observers observers; }; --- 61,65 ---- private: ! Observers _observers; }; *************** *** 68,72 **** * observers as an empty list. */ ! inline Object::Object (): observers () { } /** --- 69,76 ---- * observers as an empty list. */ ! inline Object::Object (): ! _observers () { ! // empty constructor body ! } /** *************** *** 74,80 **** * * @return List of observers. */ ! inline Object::Observers Object::getObservers () const { ! return (this->observers); } --- 78,86 ---- * * @return List of observers. + * @todo Change the return type to a const reference? */ ! inline Object::Observers ! Object::getObservers () const { ! return (this->_observers); } |
From: <ele...@us...> - 2003-04-18 01:41:11
|
Update of /cvsroot/ogs/dist/c++/ogs/spells/conjurations In directory sc8-pr-cvs1:/tmp/cvs-serv25962/c++/ogs/spells/conjurations Modified Files: CureWounds.cpp CureWounds.h Log Message: See C++ ChangeLog (Apr 17) for details. Index: CureWounds.cpp =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/spells/conjurations/CureWounds.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CureWounds.cpp 13 Apr 2003 05:28:46 -0000 1.3 --- CureWounds.cpp 18 Apr 2003 01:41:07 -0000 1.4 *************** *** 44,50 **** * @param casterLevel Level of caster. * @param degree Degree of cure wounds spell. */ ! CureWounds::CureWounds (CasterLevel casterLevel, Degree degree): ! _casterLevel (casterLevel), _degree (degree) { // empty } --- 44,55 ---- * @param casterLevel Level of caster. * @param degree Degree of cure wounds spell. + * @param inflict True if this spell inflicts wounds instead. */ ! CureWounds::CureWounds (CasterLevel casterLevel, ! Degree degree, ! bool inflict): ! _casterLevel (casterLevel), ! _degree (degree), ! _inflict (inflict) { // empty } *************** *** 92,95 **** --- 97,102 ---- * points are added to the current hit points of the creature (up to its * maximum points). + * + * @todo Implement inflict wounds behavior. */ void CureWounds::castSpell () { Index: CureWounds.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/spells/conjurations/CureWounds.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CureWounds.h 13 Apr 2003 05:28:46 -0000 1.2 --- CureWounds.h 18 Apr 2003 01:41:07 -0000 1.3 *************** *** 26,32 **** # define OGS_SPELLS_CONJURATIONS_CURE_WOUNDS_H - # include <ogs/core/CClass.h> # include <ogs/core/Die.h> - # include <ogs/core/Entity.h> # include <ogs/core/Experience.h> # include <ogs/magic/Subschool.h> --- 26,30 ---- *************** *** 36,40 **** OGS_BEGIN_SPELLS_CONJURATIONS_NAMESPACE ! using ogs::core::CClass; /** --- 34,38 ---- OGS_BEGIN_SPELLS_CONJURATIONS_NAMESPACE ! class ogs::core::Entity; /** *************** *** 43,47 **** * to undead creatures instead of curing it. Cure wounds spells can * have different degrees. The degree of the spell determines how much ! * damage is healed (or dealt in the case of undead creatures). */ class CureWounds: public ogs::spells::Conjuration { --- 41,52 ---- * to undead creatures instead of curing it. Cure wounds spells can * have different degrees. The degree of the spell determines how much ! * damage is healed (or dealt in the case of undead creatures). The ! * level of the spell caster also increases the amount of damage cured ! * (or inflicted) by the spell. ! * ! * The opposite version of this spell inflicts wounds instead of curing ! * damage to living creatures and heals undead creatures. ! * ! * @todo Determine effects of metamagic feats and implement them. */ class CureWounds: public ogs::spells::Conjuration { *************** *** 80,88 **** }; ! static CureWounds* createMinor (CasterLevel casterLevel); ! static CureWounds* createLight (CasterLevel casterLevel); ! static CureWounds* createModerate (CasterLevel casterLevel); ! static CureWounds* createSerious (CasterLevel casterLevel); ! static CureWounds* createCritical (CasterLevel casterLevel); const ogs::magic::School& getSchool () const; --- 85,103 ---- }; ! static CureWounds* ! createMinor (CasterLevel casterLevel, ! bool inflict = false); ! static CureWounds* ! createLight (CasterLevel casterLevel, ! bool inflict = false); ! static CureWounds* ! createModerate (CasterLevel casterLevel, ! bool inflict = false); ! static CureWounds* ! createSerious (CasterLevel casterLevel, ! bool inflict = false); ! static CureWounds* ! createCritical (CasterLevel casterLevel, ! bool inflict = false); const ogs::magic::School& getSchool () const; *************** *** 92,101 **** Degree getDegree () const; Target getTarget () const; ! void setTarget (ogs::core::Entity& entity); void castSpell (); protected: ! CureWounds (CasterLevel casterLevel, Degree degree); private: --- 107,119 ---- Degree getDegree () const; Target getTarget () const; ! void setTarget (Target target); ! bool inflictsWounds () const; void castSpell (); protected: ! CureWounds (CasterLevel casterLevel, ! Degree degree, ! bool inflict = false); private: *************** *** 103,106 **** --- 121,125 ---- Target _target; Degree _degree; + bool _inflict; ogs::core::Die::Value rollHitPoints () const; *************** *** 110,113 **** --- 129,197 ---- /** + * Create a new Cure Minor Wounds spell. + * + * @param casterLevel Level of spell caster. + * @param inflict True if this spell inflicts wounds instead. + * @return A new Cure Minor Wounds spell. + */ + inline CureWounds* + CureWounds::createMinor (CasterLevel casterLevel, + bool inflict) { + return (new CureWounds (casterLevel, MINOR, inflict)); + } + + /** + * Create a new Cure Light Wounds spell. + * + * @param casterLevel Level of spell caster. + * @param inflict True if this spell inflicts wounds instead. + * @return A new Cure Light Wounds spell. + */ + inline CureWounds* + CureWounds::createLight (CasterLevel casterLevel, + bool inflict) { + return (new CureWounds (casterLevel, LIGHT)); + } + + /** + * Create a new Cure Moderate Wounds spell. + * + * @param casterLevel Level of spell caster. + * @param inflict True if this spell inflicts wounds instead. + * @return A new Cure Moderate Wounds spell. + */ + inline CureWounds* + CureWounds::createModerate (CasterLevel casterLevel, + bool inflict) { + return (new CureWounds (casterLevel, MODERATE)); + } + + /** + * Create a new Cure Serious Wounds spell. + * + * @param casterLevel Level of spell caster. + * @param inflict True if this spell inflicts wounds instead. + * @return A new Cure Serious Wounds spell. + */ + inline CureWounds* + CureWounds::createSerious (CasterLevel casterLevel, + bool inflict) { + return (new CureWounds (casterLevel, SERIOUS, inflict)); + } + + /** + * Create a new Cure Critical Wounds spell. + * + * @param casterLevel Level of spell caster. + * @param inflict True if this spell inflicts wounds instead. + * @return A new Cure Critical Wounds spell. + */ + inline CureWounds* + CureWounds::createCritical (CasterLevel casterLevel, + bool inflict) { + return (new CureWounds (casterLevel, CRITICAL, inflict)); + } + + /** * Determine the school (or subschool) for this type of spell. All cure * wounds spells are in the Healing subschool of the Conjuration school. *************** *** 147,150 **** --- 231,245 ---- /** + * Change the target of this spell. + * + * @param target Target of this spell. + * @todo Complete the implementation of this function. + */ + inline void + CureWounds::setTarget (Target target) { + this->_target = target; + } + + /** * Determine the degree of this cure wounds spell. * *************** *** 154,157 **** --- 249,262 ---- CureWounds::getDegree () const { return (this->_degree); + } + + /** + * Determine if this spell inflicts wounds instead of curing wounds. + * + * @return True if the spell inflicts wounds instead. + */ + inline bool + CureWounds::inflictsWounds () const { + return (this->_inflict); } |
From: <ele...@us...> - 2003-04-18 01:41:10
|
Update of /cvsroot/ogs/dist/c++/ogs/spells In directory sc8-pr-cvs1:/tmp/cvs-serv25962/c++/ogs/spells Modified Files: Namespace.h Log Message: See C++ ChangeLog (Apr 17) for details. Index: Namespace.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/spells/Namespace.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Namespace.h 5 Feb 2003 06:01:29 -0000 1.2 --- Namespace.h 18 Apr 2003 01:41:07 -0000 1.3 *************** *** 36,39 **** --- 36,44 ---- * to organize the spell classes. The classes in this package are used * as the base classes for these spells. + * + * @todo + * Change the school and subschool virtual functions into data members + * of the @c Spell class passed in by the constructor. Remove the base + * classes for spells. */ # define OGS_BEGIN_SPELLS_NAMESPACE \ |
From: <ele...@us...> - 2003-04-18 01:41:10
|
Update of /cvsroot/ogs/dist/c++/ogs/magic In directory sc8-pr-cvs1:/tmp/cvs-serv25962/c++/ogs/magic Modified Files: Ability.cpp Ability.h AbsoluteRange.h ExperienceCost.h MetamagicFeat.h Removed Files: Level.h Log Message: See C++ ChangeLog (Apr 17) for details. Index: Ability.cpp =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/magic/Ability.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Ability.cpp 13 Apr 2003 05:27:50 -0000 1.5 --- Ability.cpp 18 Apr 2003 01:41:06 -0000 1.6 *************** *** 21,28 **** --- 21,32 ---- */ + #include "ogs/core/Modifier.h" #include "ogs/magic/Ability.h" + #include "ogs/magic/Types.h" using ogs::core::Modifier; using ogs::magic::Ability; + using ogs::magic::SpellCounts; + using ogs::magic::SpellLevel; /** *************** *** 32,40 **** * @return Number of bonus spells per spell level. */ ! Ability::SpellCounts ! Ability::getBonusSpells (ogs::core::Modifier::Value modifier) { SpellCounts spellCounts; ! for (int spellLevel = 1; spellLevel < 10; ++spellLevel) { spellCounts [spellLevel] = (modifier + 3) / 4; --modifier; --- 36,43 ---- * @return Number of bonus spells per spell level. */ ! SpellCounts Ability::getBonusSpells (Modifier::Value modifier) { SpellCounts spellCounts; ! for (SpellLevel spellLevel = 1; spellLevel < 10; ++spellLevel) { spellCounts [spellLevel] = (modifier + 3) / 4; --modifier; Index: Ability.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/magic/Ability.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Ability.h 8 Apr 2003 21:43:11 -0000 1.3 --- Ability.h 18 Apr 2003 01:41:06 -0000 1.4 *************** *** 31,34 **** --- 31,35 ---- # include <ogs/core/Modifier.h> # include <ogs/magic/Namespace.h> + # include <ogs/magic/Types.h> OGS_BEGIN_MAGIC_NAMESPACE *************** *** 42,47 **** class Ability { public: - typedef std::vector<unsigned> SpellCounts; - /** * Determine highest spell level that can be cast with this ability. --- 43,46 ---- Index: AbsoluteRange.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/magic/AbsoluteRange.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AbsoluteRange.h 7 Jan 2003 07:41:33 -0000 1.1 --- AbsoluteRange.h 18 Apr 2003 01:41:06 -0000 1.2 *************** *** 41,45 **** --- 41,47 ---- protected: + /** Maximum distance of this spell range. */ float distance; + AbsoluteRange (Range::Type type, float distance); }; Index: ExperienceCost.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/magic/ExperienceCost.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ExperienceCost.h 13 Apr 2003 05:27:50 -0000 1.3 --- ExperienceCost.h 18 Apr 2003 01:41:06 -0000 1.4 *************** *** 28,32 **** # include <ogs/core/Experience.h> # include <ogs/magic/Component.h> ! # include <ogs/magic/components/Namespace.h> OGS_BEGIN_MAGIC_NAMESPACE --- 28,32 ---- # include <ogs/core/Experience.h> # include <ogs/magic/Component.h> ! # include <ogs/magic/Namespace.h> OGS_BEGIN_MAGIC_NAMESPACE *************** *** 39,47 **** class ExperienceCost: public Component { public: ! ExperienceCost (XP::Points xpCost); ! XP::Points getCost () const; private: ! XP::Points _xpCost; }; --- 39,47 ---- class ExperienceCost: public Component { public: ! ExperienceCost (ogs::core::XP::Points xpCost); ! ogs::core::XP::Points getCost () const; private: ! ogs::core::XP::Points _xpCost; }; *************** *** 54,58 **** * @param xpCost Cost of casting spell in experience points. */ ! inline ExperienceCost::ExperienceCost (XP::Points xpCost): Component (Component::EXPERIENCE_COST) { this->_xpCost = xpCost; --- 54,58 ---- * @param xpCost Cost of casting spell in experience points. */ ! inline ExperienceCost::ExperienceCost (ogs::core::XP::Points xpCost): Component (Component::EXPERIENCE_COST) { this->_xpCost = xpCost; *************** *** 64,68 **** * @return Cost in experience points. */ ! inline XP::Points ExperienceCost::getCost () const { return (this->_xpCost); } --- 64,69 ---- * @return Cost in experience points. */ ! inline ogs::core::XP::Points ! ExperienceCost::getCost () const { return (this->_xpCost); } Index: MetamagicFeat.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/magic/MetamagicFeat.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** MetamagicFeat.h 15 Apr 2003 16:58:46 -0000 1.6 --- MetamagicFeat.h 18 Apr 2003 01:41:06 -0000 1.7 *************** *** 28,31 **** --- 28,32 ---- # include <ogs/core/Feat.h> # include <ogs/magic/Namespace.h> + # include <ogs/magic/Types.h> OGS_BEGIN_MAGIC_NAMESPACE *************** *** 46,50 **** public: /** The number of spell levels added by a metamagic feat. */ ! typedef unsigned Cost; Cost getCost () const; --- 47,51 ---- public: /** The number of spell levels added by a metamagic feat. */ ! typedef SpellLevel Cost; Cost getCost () const; *************** *** 77,80 **** --- 78,91 ---- _spell (NULL) { // empty constructor body + } + + /** + * Determine the cost of this metamagic feat. + * + * @return Cost of this metamagic feat. + */ + inline MetamagicFeat::Cost + MetamagicFeat::getCost () const { + return (this->_cost); } --- Level.h DELETED --- |
From: <ele...@us...> - 2003-04-18 01:41:10
|
Update of /cvsroot/ogs/dist/c++/ogs/skills In directory sc8-pr-cvs1:/tmp/cvs-serv25962/c++/ogs/skills Modified Files: CommonSkills.h Log Message: See C++ ChangeLog (Apr 17) for details. Index: CommonSkills.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/skills/CommonSkills.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CommonSkills.h 15 Apr 2003 16:58:48 -0000 1.2 --- CommonSkills.h 18 Apr 2003 01:41:07 -0000 1.3 *************** *** 105,109 **** static const ogs::core::Skill::Type SPOT = 40; ! /* A skill for moving through varying currents of water. */ static const ogs::core::Skill::Type SWIM = 41; --- 105,109 ---- static const ogs::core::Skill::Type SPOT = 40; ! /** A skill for moving through varying currents of water. */ static const ogs::core::Skill::Type SWIM = 41; |
From: <ele...@us...> - 2003-04-18 01:41:09
|
Update of /cvsroot/ogs/dist/c++/ogs/magic/abilities In directory sc8-pr-cvs1:/tmp/cvs-serv25962/c++/ogs/magic/abilities Modified Files: Charisma.h Intelligence.h Wisdom.h Log Message: See C++ ChangeLog (Apr 17) for details. Index: Charisma.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/magic/abilities/Charisma.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Charisma.h 8 Apr 2003 21:43:11 -0000 1.2 --- Charisma.h 18 Apr 2003 01:41:06 -0000 1.3 *************** *** 26,31 **** # define OGS_MAGIC_ABILITIES_CHARISMA_H ! # include <ogs/core/abilities/Charisma.h> # include <ogs/magic/Ability.h> # include <ogs/magic/abilities/Namespace.h> --- 26,32 ---- # define OGS_MAGIC_ABILITIES_CHARISMA_H ! # include <ogs/core/Ability.h> # include <ogs/magic/Ability.h> + # include <ogs/magic/Types.h> # include <ogs/magic/abilities/Namespace.h> *************** *** 38,44 **** * determining the highest spell level and bonus number of spells. */ ! class Charisma: public ogs::core::abilities::Charisma, public ogs::magic::Ability { public: int getHighestSpellLevel () const; SpellCounts getBonusSpells () const; --- 39,48 ---- * determining the highest spell level and bonus number of spells. */ ! class Charisma: public ogs::core::Ability, public ogs::magic::Ability { public: + Charisma (); + Charisma (ogs::core::Ability::Method& method); + int getHighestSpellLevel () const; SpellCounts getBonusSpells () const; *************** *** 46,49 **** --- 50,72 ---- /** + * Create a new Charisma score. The Charisma score is generated using + * the standard method. + */ + inline Charisma::Charisma (): + ogs::core::Ability (ogs::core::Ability::CHA) { + // empty constructor body + } + + /** + * Create a new Strength score using a method. + * + * @param method A method for generating ability scores. + */ + inline Charisma::Charisma (ogs::core::Ability::Method& method): + ogs::core::Ability (ogs::core::Ability::STR, method) { + // empty constructor body + } + + /** * Determine highest spell level that can be cast. A negative value * indicates that spells can not be cast based on this ability. *************** *** 51,55 **** * @return Highest spell level. */ ! inline int Charisma::getHighestSpellLevel () const { return (Ability::getHighestSpellLevel (getCurrentScore ())); } --- 74,79 ---- * @return Highest spell level. */ ! inline int ! Charisma::getHighestSpellLevel () const { return (Ability::getHighestSpellLevel (getCurrentScore ())); } *************** *** 60,64 **** * @return Number of bonus spells per spell level. */ ! inline Ability::SpellCounts Charisma::getBonusSpells () const { return (Ability::getBonusSpells ((getModifier ()).getValue ())); } --- 84,89 ---- * @return Number of bonus spells per spell level. */ ! inline SpellCounts ! Charisma::getBonusSpells () const { return (Ability::getBonusSpells ((getModifier ()).getValue ())); } Index: Intelligence.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/magic/abilities/Intelligence.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Intelligence.h 8 Apr 2003 21:43:12 -0000 1.2 --- Intelligence.h 18 Apr 2003 01:41:06 -0000 1.3 *************** *** 26,31 **** # define OGS_MAGIC_ABILITIES_INTELLIGENCE_H ! # include <ogs/core/abilities/Intelligence.h> # include <ogs/magic/Ability.h> # include <ogs/magic/abilities/Namespace.h> --- 26,32 ---- # define OGS_MAGIC_ABILITIES_INTELLIGENCE_H ! # include <ogs/core/Ability.h> # include <ogs/magic/Ability.h> + # include <ogs/magic/Types.h> # include <ogs/magic/abilities/Namespace.h> *************** *** 38,44 **** * determining the highest spell level and bonus number of spells. */ ! class Intelligence: public ogs::core::abilities::Intelligence, ! public ogs::magic::Ability { public: int getHighestSpellLevel () const; SpellCounts getBonusSpells () const; --- 39,48 ---- * determining the highest spell level and bonus number of spells. */ ! class Intelligence: public ogs::core::Ability, ! public ogs::magic::Ability { public: + Intelligence (); + Intelligence (ogs::core::Ability::Method& method); + int getHighestSpellLevel () const; SpellCounts getBonusSpells () const; *************** *** 46,49 **** --- 50,72 ---- /** + * Create a new Intelligence score. The Intelligence score is generated + * using the standard method. + */ + inline Intelligence::Intelligence (): + ogs::core::Ability (ogs::core::Ability::CHA) { + // empty constructor body + } + + /** + * Create a new Strength score using a method. + * + * @param method A method for generating ability scores. + */ + inline Intelligence::Intelligence (ogs::core::Ability::Method& method): + ogs::core::Ability (ogs::core::Ability::STR, method) { + // empty constructor body + } + + /** * Determine highest spell level that can be cast. A negative value * indicates that spells can not be cast based on this ability. *************** *** 51,55 **** * @return Highest spell level. */ ! inline int Intelligence::getHighestSpellLevel () const { return (Ability::getHighestSpellLevel (getCurrentScore ())); } --- 74,79 ---- * @return Highest spell level. */ ! inline int ! Intelligence::getHighestSpellLevel () const { return (Ability::getHighestSpellLevel (getCurrentScore ())); } *************** *** 60,64 **** * @return Number of bonus spells per spell level. */ ! inline Ability::SpellCounts Intelligence::getBonusSpells () const { return (Ability::getBonusSpells ((getModifier ()).getValue ())); } --- 84,89 ---- * @return Number of bonus spells per spell level. */ ! inline SpellCounts ! Intelligence::getBonusSpells () const { return (Ability::getBonusSpells ((getModifier ()).getValue ())); } Index: Wisdom.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/magic/abilities/Wisdom.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Wisdom.h 8 Apr 2003 21:43:12 -0000 1.2 --- Wisdom.h 18 Apr 2003 01:41:06 -0000 1.3 *************** *** 26,31 **** # define OGS_MAGIC_ABILITIES_WISDOM_H ! # include <ogs/core/abilities/Wisdom.h> # include <ogs/magic/Ability.h> # include <ogs/magic/abilities/Namespace.h> --- 26,32 ---- # define OGS_MAGIC_ABILITIES_WISDOM_H ! # include <ogs/core/Ability.h> # include <ogs/magic/Ability.h> + # include <ogs/magic/Types.h> # include <ogs/magic/abilities/Namespace.h> *************** *** 38,44 **** * determining the highest spell level and bonus number of spells. */ ! class Wisdom: public ogs::core::abilities::Wisdom, public ogs::magic::Ability { public: int getHighestSpellLevel () const; SpellCounts getBonusSpells () const; --- 39,48 ---- * determining the highest spell level and bonus number of spells. */ ! class Wisdom: public ogs::core::Ability, public ogs::magic::Ability { public: + Wisdom (); + Wisdom (ogs::core::Ability::Method& method); + int getHighestSpellLevel () const; SpellCounts getBonusSpells () const; *************** *** 46,49 **** --- 50,72 ---- /** + * Create a new Wisdom score. The Wisdom score is generated using + * the standard method. + */ + inline Wisdom::Wisdom (): + ogs::core::Ability (ogs::core::Ability::CHA) { + // empty constructor body + } + + /** + * Create a new Strength score using a method. + * + * @param method A method for generating ability scores. + */ + inline Wisdom::Wisdom (ogs::core::Ability::Method& method): + ogs::core::Ability (ogs::core::Ability::STR, method) { + // empty constructor body + } + + /** * Determine highest spell level that can be cast. A negative value * indicates that spells can not be cast based on this ability. *************** *** 51,55 **** * @return Highest spell level. */ ! inline int Wisdom::getHighestSpellLevel () const { return (Ability::getHighestSpellLevel (getCurrentScore ())); } --- 74,79 ---- * @return Highest spell level. */ ! inline int ! Wisdom::getHighestSpellLevel () const { return (Ability::getHighestSpellLevel (getCurrentScore ())); } *************** *** 60,64 **** * @return Number of bonus spells per spell level. */ ! inline Ability::SpellCounts Wisdom::getBonusSpells () const { return (Ability::getBonusSpells ((getModifier ()).getValue ())); } --- 84,89 ---- * @return Number of bonus spells per spell level. */ ! inline SpellCounts ! Wisdom::getBonusSpells () const { return (Ability::getBonusSpells ((getModifier ()).getValue ())); } |
From: <ele...@us...> - 2003-04-15 17:09:14
|
Update of /cvsroot/ogs/dist/c++/ogs/magic In directory sc8-pr-cvs1:/tmp/cvs-serv26541 Removed Files: SpellList.cpp Log Message: Removed unused file. --- SpellList.cpp DELETED --- |
From: <ele...@us...> - 2003-04-15 16:59:29
|
Update of /cvsroot/ogs/dist/c++/test In directory sc8-pr-cvs1:/tmp/cvs-serv20206/c++/test Modified Files: AbilitiesTest.cpp DieTest.cpp Makefile.am ModifiersTest.cpp SupportTest.cpp Added Files: CreatureTest.cpp Log Message: See C++ ChangeLog (Apr 15) for details. --- NEW FILE: CreatureTest.cpp --- /* * CreatureTest.cpp -- test driver for creatures * Copyright (C) 2003 Eric Lemings <ele...@us...> * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this software; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA * * RCS: $Id: CreatureTest.cpp,v 1.1 2003/04/15 16:58:52 elemings Exp $ */ // Need to add configure checks before using <mcheck.h> and mtrace(). //#include <mcheck.h> #include <cassert> #include <cstdlib> #include <ctime> #include <iostream> #include <sstream> #include <ogs/Core.h> #include <ogs/Creatures.h> #include <ogs/Skills.h> using std::cout; using std::endl; using namespace ogs::core; using namespace ogs::core::details; using namespace ogs::creatures; using namespace ogs::skills; #define TEST_DRIVER "CreatureTest" // NOTE: Some of the following functions should be considered for // integration into the library (after a few minor changes). /** * Format a string using conventional die notation for this die. The * conventional die notation is "NdT+M" where N is the roll count, * T is the die sides, and M is the total modifier. The total modifier * may be omitted if it is zero (0). * * @return Formatted die notation string. */ std::string formatDieNotation (const Die& die) { std::ostringstream ostr; ostr << die.getCount (); ostr << "d" << die.getSides (); if (die.getModifier () != 0) { ostr << std::showpos << die.getModifier (); } return (ostr.str ()); } const char* getAbilityAbbreviation (Ability::Type abilityType) { switch (abilityType) { case Ability::STR: return ("Str"); case Ability::DEX: return ("Dex"); case Ability::CON: return ("Con"); case Ability::INT: return ("Int"); case Ability::WIS: return ("Wis"); case Ability::CHA: return ("Cha"); default: return (""); } } void printAbilities (Abilities& abilities) { Abilities::Iterator itor = abilities.getBegin (); cout << "Abilities: "; while (itor != abilities.getEnd ()) { Abilities::Value& value = *itor++; cout << getAbilityAbbreviation (value.first) << " " << (value.second)->getCurrentScore () << " (" << ((value.second)->getModifier ()).getValue () << ")"; if (itor != abilities.getEnd ()) { cout << ", "; } } cout << endl; } /** * Determine the name of a skill type. This function returns an empty * string if the type of skill is unknown. (This is really just a big * map and should be implemented as such.) * * @param skillType A type of common skill. * @return Name of the skill type or an empty string. */ const char* getSkillName (Skill::Type skillType) { switch (skillType) { case CommonSkills::APPRAISE: return ("Appraise"); case CommonSkills::BLUFF: return ("Bluff"); case CommonSkills::CLIMB: return ("Climb"); case CommonSkills::CRAFT: return ("Craft"); case CommonSkills::DIPLOMACY: return ("Diplomacy"); case CommonSkills::DISABLE_DEVICE: return ("Disable Device"); case CommonSkills::DISGUISE: return ("Disguise"); case CommonSkills::ESCAPE_ARTIST: return ("Escape Artist"); case CommonSkills::FORGERY: return ("Forgery"); case CommonSkills::GATHER_INFORMATION: return ("Gather Information"); case CommonSkills::HANDLE_ANIMAL: return ("Handle Animal"); case CommonSkills::HIDE: return ("Hide"); case CommonSkills::INTIMIDATE: return ("Intimidate"); case CommonSkills::JUMP: return ("Jump"); case CommonSkills::KNOWLEDGE: return ("Knowledge"); case CommonSkills::LISTEN: return ("Listen"); case CommonSkills::MOVE_SILENTLY: return ("Move Silently"); case CommonSkills::PROFESSION: return ("Profession"); case CommonSkills::RIDE: return ("Ride"); case CommonSkills::SEARCH: return ("Search"); case CommonSkills::SENSE_MOTIVE: return ("Sense Motive"); case CommonSkills::SPEAK_LANGUAGE: return ("Speak Language"); case CommonSkills::SPOT: return ("Spot"); case CommonSkills::SWIM: return ("Swim"); case CommonSkills::TUMBLE: return ("Tumble"); default: return (""); } } void printSkills (Skills& skills) { Skills::iterator itor = skills.begin (); cout << "Skills: "; while (itor != skills.end ()) { SkillPtr skillPtr = *itor++; cout << getSkillName (skillPtr->getType ()) << " (" << (skillPtr->getModifiers ()).getValue () << ")"; if (itor != skills.end ()) { cout << ", "; } } cout << endl; } const char* getAlignmentName (const Alignment& alignment) { switch (alignment.getValue ()) { case Alignment::LAWFUL_GOOD: return ("Lawful Good"); case Alignment::NEUTRAL_GOOD: return ("Neutral Good"); case Alignment::CHAOTIC_GOOD: return ("Chaotic Good"); case Alignment::LAWFUL_NEUTRAL: return ("Lawful Neutral"); case Alignment::TRUE_NEUTRAL: return ("Neutral Neutral"); case Alignment::CHAOTIC_NEUTRAL: return ("Chaotic Neutral"); case Alignment::LAWFUL_EVIL: return ("Lawful Evil"); case Alignment::NEUTRAL_EVIL: return ("Neutral Evil"); case Alignment::CHAOTIC_EVIL: return ("Chaotic Evil"); default: return ("Unknown"); } } void printFeatures (Features& features) { Features::iterator itor = features.begin (); while (itor != features.end ()) { FeaturePtr featurePtr = *itor++; Alignment* alignment = dynamic_cast<Alignment*> (featurePtr.get ()); if (alignment != NULL) { cout << "Alignment: " << getAlignmentName (*alignment) << endl;; } Gender* gender= dynamic_cast<Gender*> (featurePtr.get ()); if (gender != NULL) { cout << "Gender: " << gender->getName () << endl; } } } void testCreature (Creature& creature) { cout << "Size: " << char ((creature.getSize ()).getType ()) << endl; cout << "Hit Dice: " << formatDieNotation (creature.getHitDice ()) << endl; cout << "Initiative: " << (creature.getInitiative ()).getValue () << endl; cout << "Defense: " << (creature.getDefense ()).getValue () << endl; const Saves& saves = creature.getSaves (); cout << "Saves: Fort " << saves.fort.getValue () << ", " << "Ref " << saves.ref.getValue () << ", " << "Will " << saves.will.getValue () << endl; printAbilities (creature.getAbilities ()); Skills skills (creature.getSkills ()); printSkills (skills); cout << "Feats: " << endl; Features features = creature.getFeatures (); printFeatures (features); cout << endl; } int main (void) { //mtrace (); cout << "BEGIN: " TEST_DRIVER "\n\n"; // Seed random number generator with current time. std::srand (std::time (NULL)); using namespace ogs::creatures::humanoids; Human human; cout << "sizeof (Human) = " << sizeof (Human) << endl; cout << "&human = " << &human << endl; human.addFeature (* (new Gender (Gender::FEMALE))); testCreature (human); //testHuman (human); using namespace ogs::creatures::undeads; Wraith wraith; cout << "sizeof (Wraith) = " << sizeof (Wraith) << endl; cout << "&wraith = " << &wraith << endl; testCreature (wraith); //testWraith (wraith); cout << "END: " TEST_DRIVER "\n"; //muntrace (); return (0); } Index: AbilitiesTest.cpp =================================================================== RCS file: /cvsroot/ogs/dist/c++/test/AbilitiesTest.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AbilitiesTest.cpp 13 Apr 2003 05:31:13 -0000 1.2 --- AbilitiesTest.cpp 15 Apr 2003 16:58:51 -0000 1.3 *************** *** 1,5 **** /* * AbilitiesTest.cpp -- test driver for ability scores ! * Copyright (C) 2002 Eric Lemings <ele...@us...> * * This software is free software; you can redistribute it and/or --- 1,5 ---- /* * AbilitiesTest.cpp -- test driver for ability scores ! * Copyright (C) 2003 Eric Lemings <ele...@us...> * * This software is free software; you can redistribute it and/or Index: DieTest.cpp =================================================================== RCS file: /cvsroot/ogs/dist/c++/test/DieTest.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DieTest.cpp 8 Apr 2003 21:43:17 -0000 1.1 --- DieTest.cpp 15 Apr 2003 16:58:53 -0000 1.2 *************** *** 1,5 **** /* * DieTest.cpp -- test driver for polyhedral dice ! * Copyright (C) 2002 Eric Lemings <ele...@us...> * * This software is free software; you can redistribute it and/or --- 1,5 ---- /* * DieTest.cpp -- test driver for polyhedral dice ! * Copyright (C) 2003 Eric Lemings <ele...@us...> * * This software is free software; you can redistribute it and/or Index: Makefile.am =================================================================== RCS file: /cvsroot/ogs/dist/c++/test/Makefile.am,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makefile.am 8 Apr 2003 21:43:18 -0000 1.4 --- Makefile.am 15 Apr 2003 16:58:54 -0000 1.5 *************** *** 37,40 **** --- 37,41 ---- DieTest \ AbilitiesTest \ + CreatureTest \ CombatTest01 *************** *** 47,50 **** --- 48,53 ---- AbilitiesTest_SOURCES = \ AbilitiesTest.cpp + CreatureTest_SOURCES = \ + CreatureTest.cpp CombatTest01_SOURCES = \ CombatTest01.cpp Index: ModifiersTest.cpp =================================================================== RCS file: /cvsroot/ogs/dist/c++/test/ModifiersTest.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ModifiersTest.cpp 13 Apr 2003 05:31:14 -0000 1.2 --- ModifiersTest.cpp 15 Apr 2003 16:58:54 -0000 1.3 *************** *** 1,5 **** /* * ModifiersTest.cpp -- test driver for modifiers ! * Copyright (C) 2002 Eric Lemings <ele...@us...> * * This software is free software; you can redistribute it and/or --- 1,5 ---- /* * ModifiersTest.cpp -- test driver for modifiers ! * Copyright (C) 2003 Eric Lemings <ele...@us...> * * This software is free software; you can redistribute it and/or Index: SupportTest.cpp =================================================================== RCS file: /cvsroot/ogs/dist/c++/test/SupportTest.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SupportTest.cpp 8 Apr 2003 21:43:19 -0000 1.1 --- SupportTest.cpp 15 Apr 2003 16:58:54 -0000 1.2 *************** *** 1,5 **** /* * SupportTest.cpp -- test driver for library support ! * Copyright (C) 2002 Eric Lemings <ele...@us...> * * This software is free software; you can redistribute it and/or --- 1,5 ---- /* * SupportTest.cpp -- test driver for library support ! * Copyright (C) 2003 Eric Lemings <ele...@us...> * * This software is free software; you can redistribute it and/or *************** *** 153,171 **** */ void testEventObserver () { ! Foo foo; ! cout << "&foo = " << &foo << endl; Bar obs1; cout << "&obs1 = " << &obs1 << endl; ! foo.addObserver (obs1); Bar obs2; cout << "&obs2 = " << &obs2 << endl; ! foo.addObserver (obs2); // Trigger event. ! foo.setName ("first name"); ! foo.removeObserver (obs1); ! foo.setName ("second name"); cout << endl; --- 153,182 ---- */ void testEventObserver () { ! Foo foo1; ! cout << "&foo1 = " << &foo1 << endl; Bar obs1; cout << "&obs1 = " << &obs1 << endl; ! foo1.addObserver (obs1); Bar obs2; cout << "&obs2 = " << &obs2 << endl; ! foo1.addObserver (obs2); // Trigger event. ! foo1.setName ("first name"); ! foo1.removeObserver (obs1); ! foo1.setName ("second name"); ! ! // Check copy/assign semantics of observers. ! foo1.addObserver (obs2); ! Foo foo2 (foo1); ! cout << "&foo2 = " << &foo2 << endl; ! foo2.setName ("default copy constructor"); ! ! Foo foo3; ! cout << "&foo3 = " << &foo3 << endl; ! foo3 = foo1; ! foo3.setName ("default assignment operator"); cout << endl; |
From: <ele...@us...> - 2003-04-15 16:59:25
|
Update of /cvsroot/ogs/dist/c++/ogs/support In directory sc8-pr-cvs1:/tmp/cvs-serv20206/c++/ogs/support Modified Files: Attachable.h Log Message: See C++ ChangeLog (Apr 15) for details. Index: Attachable.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/support/Attachable.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Attachable.h 25 Mar 2003 06:13:15 -0000 1.1 --- Attachable.h 15 Apr 2003 16:58:50 -0000 1.2 *************** *** 33,40 **** /** ! * An object that can be attached to another object. While attached, a ! * attachable may modify the object that it is attached to. These ! * modifications should be reversible if and when the attachable is ! * detached from the object. */ class Attachable { --- 33,43 ---- /** ! * An object that can be attached to another object. An attachable ! * object follows the Decorator design pattern. While attached, an ! * attachable object may (or may not) modify its subject (the object ! * that it is attached to). These modifications may (or may not) be ! * reversible when (and if) the attachable is detached from the subject. ! * Attachable objects that do not modify the subject simply add ! * additional detail to the object. */ class Attachable { |
From: <ele...@us...> - 2003-04-15 16:59:23
|
Update of /cvsroot/ogs/dist/c++/ogs/skills In directory sc8-pr-cvs1:/tmp/cvs-serv20206/c++/ogs/skills Modified Files: CommonSkills.cpp CommonSkills.h SkillFactory.h Spot.cpp Spot.h Log Message: See C++ ChangeLog (Apr 15) for details. Index: CommonSkills.cpp =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/skills/CommonSkills.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CommonSkills.cpp 13 Apr 2003 05:26:28 -0000 1.1 --- CommonSkills.cpp 15 Apr 2003 16:58:48 -0000 1.2 *************** *** 35,46 **** /** * Create a new common skill of a specified type. If the skill type is ! * unknown, this function will return an empty pointer. * * @param skillType Type of skill to create. ! * @return A skill pointer or an empty pointer. */ ! SkillFactory::SkillPtr ! CommonSkills::createSkill (Skill::Type skillType) { ! SkillFactory::SkillPtr skillPtr; const bool trainedOnly = false; const bool useUntrained = true; --- 35,47 ---- /** * Create a new common skill of a specified type. If the skill type is ! * unknown, this function will return a NULL pointer. * * @param skillType Type of skill to create. ! * @param cclassPoints Points spent for cclass skill. ! * @return A skill pointer or a NULL pointer if skill type is invalid. */ ! Skill* ! CommonSkills::createSkill (Skill::Type skillType, ! Skill::Points cclassPoints) const { const bool trainedOnly = false; const bool useUntrained = true; *************** *** 50,156 **** switch (skillType) { case APPRAISE: ! skillPtr.reset (new Skill (skillType, Ability::INT, ! useUntrained, noArmorPenalty)); ! break; case BLUFF: ! skillPtr.reset (new Skill (skillType, Ability::CHA, ! useUntrained, noArmorPenalty)); ! break; case CLIMB: ! skillPtr.reset (new Skill (skillType, Ability::STR, ! useUntrained, useArmorPenalty)); ! break; case CRAFT: ! skillPtr.reset (new Skill (skillType, Ability::INT, ! useUntrained, noArmorPenalty)); ! break; case DIPLOMACY: ! skillPtr.reset (new Skill (skillType, Ability::CHA, ! useUntrained, noArmorPenalty)); ! break; case DISABLE_DEVICE: ! skillPtr.reset (new Skill (skillType, Ability::INT, ! trainedOnly, noArmorPenalty)); ! break; case DISGUISE: ! skillPtr.reset (new Skill (skillType, Ability::CHA, ! useUntrained, noArmorPenalty)); ! break; case ESCAPE_ARTIST: ! skillPtr.reset (new Skill (skillType, Ability::DEX, ! useUntrained, useArmorPenalty)); ! break; case FORGERY: ! skillPtr.reset (new Skill (skillType, Ability::INT, ! useUntrained, noArmorPenalty)); ! break; case GATHER_INFORMATION: ! skillPtr.reset (new Skill (skillType, Ability::CHA, ! useUntrained, noArmorPenalty)); ! break; case HANDLE_ANIMAL: ! skillPtr.reset (new Skill (skillType, Ability::CHA, ! trainedOnly, noArmorPenalty)); ! break; case HIDE: ! skillPtr.reset (new Skill (skillType, Ability::WIS, ! useUntrained, useArmorPenalty)); ! break; case INTIMIDATE: ! skillPtr.reset (new Skill (skillType, Ability::CHA, ! useUntrained, noArmorPenalty)); ! break; case JUMP: ! skillPtr.reset (new Skill (skillType, Ability::STR, ! useUntrained, useArmorPenalty)); ! break; case KNOWLEDGE: ! skillPtr.reset (new Skill (skillType, Ability::INT, ! trainedOnly, noArmorPenalty)); ! break; case LISTEN: ! skillPtr.reset (new Skill (skillType, Ability::WIS, ! useUntrained, noArmorPenalty)); ! break; case MOVE_SILENTLY: ! skillPtr.reset (new Skill (skillType, Ability::DEX, ! useUntrained, useArmorPenalty)); ! break; case PROFESSION: ! skillPtr.reset (new Skill (skillType, Ability::WIS, ! trainedOnly, noArmorPenalty)); ! break; case RIDE: ! skillPtr.reset (new Skill (skillType, Ability::DEX, ! useUntrained, noArmorPenalty)); ! break; case SEARCH: ! skillPtr.reset (new Skill (skillType, Ability::INT, ! useUntrained, noArmorPenalty)); ! break; case SENSE_MOTIVE: ! skillPtr.reset (new Skill (skillType, Ability::WIS, ! useUntrained, noArmorPenalty)); ! break; case SPEAK_LANGUAGE: ! skillPtr.reset (new Skill (skillType, Ability::INT, ! trainedOnly, noArmorPenalty)); ! break; case SPOT: ! skillPtr.reset (new Spot ()); ! break; case SWIM: ! skillPtr.reset (new Skill (skillType, Ability::STR, ! useUntrained, noArmorPenalty)); ! break; case TUMBLE: ! skillPtr.reset (new Skill (skillType, Ability::DEX, ! trainedOnly, useArmorPenalty)); ! break; default: ! break; } - - return (skillPtr); } --- 51,131 ---- switch (skillType) { case APPRAISE: ! return (new Skill (skillType, Ability::INT, ! useUntrained, noArmorPenalty, cclassPoints)); case BLUFF: ! return (new Skill (skillType, Ability::CHA, ! useUntrained, noArmorPenalty, cclassPoints)); case CLIMB: ! return (new Skill (skillType, Ability::STR, ! useUntrained, useArmorPenalty, cclassPoints)); case CRAFT: ! return (new Skill (skillType, Ability::INT, ! useUntrained, noArmorPenalty, cclassPoints)); case DIPLOMACY: ! return (new Skill (skillType, Ability::CHA, ! useUntrained, noArmorPenalty, cclassPoints)); case DISABLE_DEVICE: ! return (new Skill (skillType, Ability::INT, ! trainedOnly, noArmorPenalty, cclassPoints)); case DISGUISE: ! return (new Skill (skillType, Ability::CHA, ! useUntrained, noArmorPenalty, cclassPoints)); case ESCAPE_ARTIST: ! return (new Skill (skillType, Ability::DEX, ! useUntrained, useArmorPenalty, cclassPoints)); case FORGERY: ! return (new Skill (skillType, Ability::INT, ! useUntrained, noArmorPenalty, cclassPoints)); case GATHER_INFORMATION: ! return (new Skill (skillType, Ability::CHA, ! useUntrained, noArmorPenalty, cclassPoints)); case HANDLE_ANIMAL: ! return (new Skill (skillType, Ability::CHA, ! trainedOnly, noArmorPenalty, cclassPoints)); case HIDE: ! return (new Skill (skillType, Ability::DEX, ! useUntrained, useArmorPenalty, cclassPoints)); case INTIMIDATE: ! return (new Skill (skillType, Ability::CHA, ! useUntrained, noArmorPenalty, cclassPoints)); case JUMP: ! return (new Skill (skillType, Ability::STR, ! useUntrained, useArmorPenalty, cclassPoints)); case KNOWLEDGE: ! return (new Skill (skillType, Ability::INT, ! trainedOnly, noArmorPenalty, cclassPoints)); case LISTEN: ! return (new Skill (skillType, Ability::WIS, ! useUntrained, noArmorPenalty, cclassPoints)); case MOVE_SILENTLY: ! return (new Skill (skillType, Ability::DEX, ! useUntrained, useArmorPenalty, cclassPoints)); case PROFESSION: ! return (new Skill (skillType, Ability::WIS, ! trainedOnly, noArmorPenalty, cclassPoints)); case RIDE: ! return (new Skill (skillType, Ability::DEX, ! useUntrained, noArmorPenalty, cclassPoints)); case SEARCH: ! return (new Skill (skillType, Ability::INT, ! useUntrained, noArmorPenalty, cclassPoints)); case SENSE_MOTIVE: ! return (new Skill (skillType, Ability::WIS, ! useUntrained, noArmorPenalty, cclassPoints)); case SPEAK_LANGUAGE: ! return (new Skill (skillType, Ability::INT, ! trainedOnly, noArmorPenalty, cclassPoints)); case SPOT: ! return (new Spot (cclassPoints)); case SWIM: ! return (new Skill (skillType, Ability::STR, ! useUntrained, noArmorPenalty, cclassPoints)); case TUMBLE: ! return (new Skill (skillType, Ability::DEX, ! trainedOnly, useArmorPenalty, cclassPoints)); ! default: ! return (NULL); } } Index: CommonSkills.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/skills/CommonSkills.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CommonSkills.h 13 Apr 2003 05:26:28 -0000 1.1 --- CommonSkills.h 15 Apr 2003 16:58:48 -0000 1.2 *************** *** 111,115 **** static const ogs::core::Skill::Type TUMBLE = 42; ! SkillPtr createSkill (ogs::core::Skill::Type skillType); }; --- 111,117 ---- static const ogs::core::Skill::Type TUMBLE = 42; ! ogs::core::Skill* ! createSkill (ogs::core::Skill::Type skillType, ! ogs::core::Skill::Points cclassPoints = 0) const; }; Index: SkillFactory.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/skills/SkillFactory.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SkillFactory.h 13 Apr 2003 05:26:29 -0000 1.1 --- SkillFactory.h 15 Apr 2003 16:58:49 -0000 1.2 *************** *** 26,31 **** # define OGS_SKILLS_SKILL_FACTORY_H - # include <boost/shared_ptr.hpp> - # include <ogs/core/Skill.h> # include <ogs/skills/Namespace.h> --- 26,29 ---- *************** *** 37,50 **** */ struct SkillFactory { - /** A smart pointer for a skill object. */ - typedef boost::shared_ptr<ogs::core::Skill> SkillPtr; - /** * Create a new skill of a specified type. * ! * @param skillType Type of skill to create. * @return A new skill of the specified type. */ ! virtual SkillPtr createSkill (ogs::core::Skill::Type skillType) = 0; }; --- 35,48 ---- */ struct SkillFactory { /** * Create a new skill of a specified type. * ! * @param skillType Type of skill. ! * @param cclassPoints Points spent on cclass skill. * @return A new skill of the specified type. */ ! virtual ogs::core::Skill* ! createSkill (ogs::core::Skill::Type skillType, ! ogs::core::Skill::Points cclassPoints = 0) const = 0; }; Index: Spot.cpp =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/skills/Spot.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Spot.cpp 13 Apr 2003 05:26:29 -0000 1.3 --- Spot.cpp 15 Apr 2003 16:58:49 -0000 1.4 *************** *** 42,50 **** * default. * * @param distance Distance of the target from the spotter. * @param distracted True if the spotter is distracted. */ ! Spot::Spot (float distance, bool distracted): ! Skill (CommonSkills::SPOT, Ability::WIS, true, false), _distance (distance), _distanceModifier (), --- 42,51 ---- * default. * + * @param cclassPoints Points spent for cclass skill. * @param distance Distance of the target from the spotter. * @param distracted True if the spotter is distracted. */ ! Spot::Spot (Points cclassPoints, float distance, bool distracted): ! Skill (CommonSkills::SPOT, Ability::WIS, true, false, cclassPoints), _distance (distance), _distanceModifier (), Index: Spot.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/skills/Spot.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Spot.h 13 Apr 2003 05:26:29 -0000 1.4 --- Spot.h 15 Apr 2003 16:58:49 -0000 1.5 *************** *** 38,42 **** class Spot: public ogs::core::Skill { public: ! Spot (float distance = 0.0, bool distracted = false); float getDistance () const; --- 38,43 ---- class Spot: public ogs::core::Skill { public: ! Spot (Points cclassPoints = 0, float distance = 0.0, ! bool distracted = false); float getDistance () const; |
Update of /cvsroot/ogs/dist/c++/ogs/magic/feats In directory sc8-pr-cvs1:/tmp/cvs-serv20206/c++/ogs/magic/feats Modified Files: EmpowerSpell.h EnlargeSpell.h ExtendSpell.h HeightenSpell.h MaximizeSpell.h Namespace.h QuickenSpell.h SilentSpell.h StillSpell.h Log Message: See C++ ChangeLog (Apr 15) for details. Index: EmpowerSpell.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/magic/feats/EmpowerSpell.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** EmpowerSpell.h 5 Feb 2003 06:01:29 -0000 1.2 --- EmpowerSpell.h 15 Apr 2003 16:58:47 -0000 1.3 *************** *** 35,51 **** * one-half. An empowered spell uses up a spell slot two levels higher * than a spell's normal level. */ class EmpowerSpell: public ogs::magic::MetamagicFeat { public: ! int getAddedLevels () const; }; /** ! * Determine number of levels added to normal spell level. ! * ! * @return Number of added levels. */ ! inline int EmpowerSpell::getAddedLevels () const { ! return (2); } --- 35,69 ---- * one-half. An empowered spell uses up a spell slot two levels higher * than a spell's normal level. + * + * @todo + * This feat affects different spells in different ways and, for some, + * not at all. In other words, the effects of this feat depend on the + * the type of spell and the spell class itself will have to determine + * how this feat affects it. Consequently, the spell class will also + * have to determine if these effects can be reversed and somehow allow + * the feat to store this information. So the attach and detach + * operations will basically just store and retrieve this information + * for the spell. */ class EmpowerSpell: public ogs::magic::MetamagicFeat { public: ! /** ! * The cost of using this metamagic feat. Empower Spell feats use ! * up a spell slot 2 levels higher than normal. ! */ ! static const Cost COST = 2; ! ! EmpowerSpell (); ! ! bool attachSpell (Spell& spell); ! bool detachSpell (Spell& spell); }; /** ! * Create a new Empower Spell metamagic feat. */ ! inline EmpowerSpell::EmpowerSpell (): ! MetamagicFeat (COST) { ! // empty constructor body } Index: EnlargeSpell.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/magic/feats/EnlargeSpell.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** EnlargeSpell.h 5 Feb 2003 06:01:29 -0000 1.2 --- EnlargeSpell.h 15 Apr 2003 16:58:47 -0000 1.3 *************** *** 35,51 **** * enlarged spell uses up a spell slot one level higher than a spell's * normal level. */ class EnlargeSpell: public ogs::magic::MetamagicFeat { public: ! int getAddedLevels () const; }; /** ! * Determine number of levels added to normal spell level. ! * ! * @return Number of added levels. */ ! inline int EnlargeSpell::getAddedLevels () const { ! return (1); } --- 35,62 ---- * enlarged spell uses up a spell slot one level higher than a spell's * normal level. + * + * @todo + * Should be able to completely implement this feat. */ class EnlargeSpell: public ogs::magic::MetamagicFeat { public: ! /** ! * The cost of using this metamagic feat. Enlarge Spell feats use ! * up a spell slot 1 level higher than normal. ! */ ! static const Cost COST = 1; ! ! EnlargeSpell (); ! ! bool attachSpell (Spell& spell); ! bool detachSpell (Spell& spell); }; /** ! * Create a new Enlarge Spell metamagic feat. */ ! inline EnlargeSpell::EnlargeSpell (): ! MetamagicFeat (COST) { ! // empty constructor body } Index: ExtendSpell.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/magic/feats/ExtendSpell.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ExtendSpell.h 5 Feb 2003 06:01:29 -0000 1.2 --- ExtendSpell.h 15 Apr 2003 16:58:47 -0000 1.3 *************** *** 35,51 **** * spell uses up a spell slot one level higher than a spell's normal * level. */ class ExtendSpell: public ogs::magic::MetamagicFeat { public: ! int getAddedLevels () const; }; /** ! * Determine number of levels added to normal spell level. ! * ! * @return Number of added levels. */ ! inline int ExtendSpell::getAddedLevels () const { ! return (1); } --- 35,64 ---- * spell uses up a spell slot one level higher than a spell's normal * level. + * + * @todo + * Should be able to completely implement this spell. The only spells + * that this feat does not affect (AFAIK) are instantaneous and + * permanent spells. */ class ExtendSpell: public ogs::magic::MetamagicFeat { public: ! /** ! * The cost of using this metamagic feat. Extend Spell feats use ! * up a spell slot 1 level higher than normal. ! */ ! static const Cost COST = 1; ! ! ExtendSpell (); ! ! bool attachSpell (Spell& spell); ! bool detachSpell (Spell& spell); }; /** ! * Create a new Extend Spell metamagic feat. */ ! inline ExtendSpell::ExtendSpell (): ! MetamagicFeat (COST) { ! // empty constructor body } Index: HeightenSpell.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/magic/feats/HeightenSpell.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** HeightenSpell.h 5 Feb 2003 06:01:29 -0000 1.2 --- HeightenSpell.h 15 Apr 2003 16:58:47 -0000 1.3 *************** *** 35,54 **** * heightened spell uses up a spell slot equal to the increased spell * level. */ class HeightenSpell: public ogs::magic::MetamagicFeat { public: ! int getAddedLevels () const; ! private: ! int addedLevels; }; /** ! * Determine number of levels added to a spell's normal level. ! * ! * @return Number of added levels. */ ! int HeightenSpell::getAddedLevels () const { ! return (this->addedLevels); } --- 35,56 ---- * heightened spell uses up a spell slot equal to the increased spell * level. + * + * @todo + * See notes in EmpowerSpell class. */ class HeightenSpell: public ogs::magic::MetamagicFeat { public: ! HeightenSpell (Cost cost); ! bool attachSpell (Spell& spell); ! bool detachSpell (Spell& spell); }; /** ! * Create a new Heighten Spell metamagic feat. */ ! inline HeightenSpell::HeightenSpell (Cost cost): ! MetamagicFeat (cost) { ! // empty constructor body } Index: MaximizeSpell.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/magic/feats/MaximizeSpell.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MaximizeSpell.h 5 Feb 2003 06:01:29 -0000 1.2 --- MaximizeSpell.h 15 Apr 2003 16:58:47 -0000 1.3 *************** *** 35,51 **** * or other numeric ranges. A maximized spell uses up a slot three * levels higher than the spell's normal. */ class MaximizeSpell: public ogs::magic::MetamagicFeat { public: ! int getAddedLevels () const; }; /** ! * Determine number of levels added to normal spell level. ! * ! * @return Number of added levels. */ ! int MaximizeSpell::getAddedLevels () const { ! return (3); } --- 35,62 ---- * or other numeric ranges. A maximized spell uses up a slot three * levels higher than the spell's normal. + * + * @todo + * See notes in EmpowerSpell class. */ class MaximizeSpell: public ogs::magic::MetamagicFeat { public: ! /** ! * The cost of using this metamagic feat. Maximize Spell feats use ! * up a spell slot 2 levels higher than normal. ! */ ! static const Cost COST = 3; ! ! MaximizeSpell (); ! ! bool attachSpell (Spell& spell); ! bool detachSpell (Spell& spell); }; /** ! * Create a new Maximize Spell metamagic feat. */ ! inline MaximizeSpell::MaximizeSpell (): ! MetamagicFeat (COST) { ! // empty constructor body } Index: Namespace.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/magic/feats/Namespace.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Namespace.h 7 Jan 2003 07:41:34 -0000 1.1 --- Namespace.h 15 Apr 2003 16:58:47 -0000 1.2 *************** *** 30,34 **** /** * @namespace ogs::magic::feats ! * Provides declarations for metamagic feats. */ # define OGS_BEGIN_MAGIC_FEATS_NAMESPACE \ --- 30,36 ---- /** * @namespace ogs::magic::feats ! * ! * Contains metamagic feats and other spell related feats. These ! * include the Spell Focus feat and the Spell Mastery feat. */ # define OGS_BEGIN_MAGIC_FEATS_NAMESPACE \ Index: QuickenSpell.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/magic/feats/QuickenSpell.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** QuickenSpell.h 5 Feb 2003 06:01:29 -0000 1.2 --- QuickenSpell.h 15 Apr 2003 16:58:47 -0000 1.3 *************** *** 37,53 **** * round. A quickened spell uses up a spell slot four levels higher * than the spell's normal level. */ class QuickenSpell: public ogs::magic::MetamagicFeat { public: ! int getAddedLevels () const; }; /** ! * Determine number of levels added to normal spell level. ! * ! * @return Number of added levels. */ ! int QuickenSpell::getAddedLevels () const { ! return (4); } --- 37,64 ---- * round. A quickened spell uses up a spell slot four levels higher * than the spell's normal level. + * + * @todo + * Should be able to completely implement this feat. */ class QuickenSpell: public ogs::magic::MetamagicFeat { public: ! /** ! * The cost of using this metamagic feat. Quicken Spell feats use ! * up a spell slot 4 levels higher than normal. ! */ ! static const Cost COST = 4; ! ! QuickenSpell (); ! ! bool attachSpell (Spell& spell); ! bool detachSpell (Spell& spell); }; /** ! * Create a new Quicken Spell metamagic feat. */ ! inline QuickenSpell::QuickenSpell (): ! MetamagicFeat (COST) { ! // empty constructor body } Index: SilentSpell.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/magic/feats/SilentSpell.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SilentSpell.h 5 Feb 2003 06:01:29 -0000 1.2 --- SilentSpell.h 15 Apr 2003 16:58:47 -0000 1.3 *************** *** 36,52 **** * component. A silent spell uses up a spell slot one level higher than * the spell's normal level. */ class SilentSpell: public ogs::magic::MetamagicFeat { public: ! int getAddedLevels () const; }; /** ! * Determine number of levels added to normal spell level. ! * ! * @return Number of added levels. */ ! int SilentSpell::getAddedLevels () const { ! return (1); } --- 36,63 ---- * component. A silent spell uses up a spell slot one level higher than * the spell's normal level. + * + * @todo + * This feat can be completely implemented. */ class SilentSpell: public ogs::magic::MetamagicFeat { public: ! /** ! * The cost of using this metamagic feat. Silent Spell feats use ! * up a spell slot 1 level higher than normal. ! */ ! static const Cost COST = 1; ! ! SilentSpell (); ! ! bool attachSpell (Spell& spell); ! bool detachSpell (Spell& spell); }; /** ! * Create a new Silent Spell metamagic feat. */ ! inline SilentSpell::SilentSpell (): ! MetamagicFeat (COST) { ! // empty constructor body } Index: StillSpell.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/magic/feats/StillSpell.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** StillSpell.h 5 Feb 2003 06:01:29 -0000 1.2 --- StillSpell.h 15 Apr 2003 16:58:47 -0000 1.3 *************** *** 34,52 **** * A metamagic feat that allows spells to be cast without a somantic * component. This metamagic feat only applies to spells with somantic ! * component. A still spell uses up a spell slot one level higher than ! * the spell's normal level. */ class StillSpell: public ogs::magic::MetamagicFeat { public: ! int getAddedLevels () const; }; /** ! * Determine number of levels added to normal spell level. ! * ! * @return Number of added levels. */ ! int StillSpell::getAddedLevels () const { ! return (1); } --- 34,62 ---- * A metamagic feat that allows spells to be cast without a somantic * component. This metamagic feat only applies to spells with somantic ! * component. ! * ! * @todo ! * This feat can be completely implemented. */ class StillSpell: public ogs::magic::MetamagicFeat { public: ! /** ! * The cost of using this metamagic feat. Still Spell feats use ! * up a spell slot 1 level higher than normal. ! */ ! static const Cost COST = 1; ! ! StillSpell (); ! ! bool attachSpell (Spell& spell); ! bool detachSpell (Spell& spell); }; /** ! * Create a new Still Spell metamagic feat. */ ! inline StillSpell::StillSpell (): ! MetamagicFeat (COST) { ! // empty constructor body } |
From: <ele...@us...> - 2003-04-15 16:59:22
|
Update of /cvsroot/ogs/dist/c++/ogs/feats In directory sc8-pr-cvs1:/tmp/cvs-serv20206/c++/ogs/feats Modified Files: Alertness.cpp Alertness.h AllWeapons.cpp AllWeapons.h ArmorProficiency.cpp ArmorProficiency.h ImprovedInitiative.cpp ImprovedSave.cpp Makefile.am ShieldProficiency.h Toughness.h WeaponProficiency.h Log Message: See C++ ChangeLog (Apr 15) for details. Index: Alertness.cpp =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/feats/Alertness.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Alertness.cpp 13 Apr 2003 05:27:06 -0000 1.4 --- Alertness.cpp 15 Apr 2003 16:58:41 -0000 1.5 *************** *** 31,35 **** * Create a new Alertness feat. */ ! Alertness::Alertness (): _modifier (+2) { // empty constructor body } --- 31,37 ---- * Create a new Alertness feat. */ ! Alertness::Alertness (): ! Feat (EXCLUSIVE), ! _modifier (+2) { // empty constructor body } *************** *** 57,61 **** */ bool Alertness::attachObject (Object& object) { ! bool attached = attachObject (object); if (attached) { --- 59,63 ---- */ bool Alertness::attachObject (Object& object) { ! bool attached = Feat::attachObject (object); if (attached) { *************** *** 86,97 **** SkillPtr skillPtr = *itor++; ! if (skillPtr->getType () == CommonSkills::LISTEN) { Modifiers& modifiers = skillPtr->getModifiers (); modifiers.addModifier (this->_modifier); - } else { - if (skillPtr->getType () == CommonSkills::SPOT) { - Modifiers& modifiers = skillPtr->getModifiers (); - modifiers.addModifier (this->_modifier); - } } } --- 88,95 ---- SkillPtr skillPtr = *itor++; ! if (skillPtr->getType () == CommonSkills::LISTEN || ! skillPtr->getType () == CommonSkills::SPOT) { Modifiers& modifiers = skillPtr->getModifiers (); modifiers.addModifier (this->_modifier); } } Index: Alertness.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/feats/Alertness.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Alertness.h 29 Mar 2003 02:10:36 -0000 1.3 --- Alertness.h 15 Apr 2003 16:58:41 -0000 1.4 *************** *** 41,46 **** bool attachObject (Object& object); bool dettachObject (); - Feat::Compatibility getCompatibility () const; - Feat::Group getGroup () const; private: --- 41,44 ---- *************** *** 50,75 **** void addSkillModifier (Object& object); }; - - /** - * Determine the compatability of this feat. Alertness feats are - * exclusive feats. - * - * @return Feat::EXCLUSIVE - */ - inline ogs::core::Feat::Compatibility - Alertness::getCompatibility () const { - return (Feat::EXCLUSIVE); - } - - /** - * Determine the group that this feat belongs to. Alertness feats are - * general feats. - * - * @return Feat::GENERAL - */ - inline ogs::core::Feat::Group - Alertness::getGroup () const { - return (Feat::GENERAL); - } OGS_END_FEATS_NAMESPACE --- 48,51 ---- Index: AllWeapons.cpp =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/feats/AllWeapons.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AllWeapons.cpp 13 Apr 2003 05:27:06 -0000 1.3 --- AllWeapons.cpp 15 Apr 2003 16:58:41 -0000 1.4 *************** *** 23,41 **** #include "ogs/core/Creature.h" #include "ogs/feats/AllWeapons.h" - #include "ogs/items/Weapon.h" using ogs::feats::AllWeapons; - using ogs::items::Weapon; - - /** - * Create a new weapon proficiency feat for all wapons of a specified - * group. - * - * @param proficiency Group of weapons that this feat applies to. - */ - AllWeapons::AllWeapons (Weapon::Proficiency proficiency): - _proficiency (proficiency) { - // empty constructor body - } /** --- 23,28 ---- *************** *** 63,67 **** AllWeapons* allWeapons = dynamic_cast <AllWeapons*> (featPtr.get ()); if (allWeapons != NULL) { ! if (allWeapons->getProficiency () == _proficiency) { return (false); } --- 50,54 ---- AllWeapons* allWeapons = dynamic_cast <AllWeapons*> (featPtr.get ()); if (allWeapons != NULL) { ! if (allWeapons->getProficiency () == this->getProficiency ()) { return (false); } Index: AllWeapons.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/feats/AllWeapons.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AllWeapons.h 4 Apr 2003 20:22:46 -0000 1.2 --- AllWeapons.h 15 Apr 2003 16:58:42 -0000 1.3 *************** *** 48,58 **** static AllWeapons* createMartial (); - Feat::Compatibility getCompatibility () const; - ogs::items::Weapon::Proficiency getProficiency () const; bool isProficient (const ogs::items::Weapon& weapon) const; private: - ogs::items::Weapon::Proficiency _proficiency; - AllWeapons (ogs::items::Weapon::Proficiency proficiency); --- 48,54 ---- *************** *** 81,105 **** /** - * Determine the compatability of this feat. Weapon proficiency feats - * for all weapons are exclusive feats. - * - * @return Feat::EXCLUSIVE - */ - inline ogs::core::Feat::Compatibility - AllWeapons::getCompatibility () const { - return (Feat::EXCLUSIVE); - } - - /** - * Determine weapon proficiency that this feat applies to. - * - * @return Proficiency of weapon: SIMPLE or MARTIAL. - */ - inline ogs::items::Weapon::Proficiency - AllWeapons::getProficiency () const { - return (this->_proficiency); - } - - /** * Determine if a weapon is a proficient weapon. A proficient weapon is * a weapon that a creature with this feat is proficient with. If this --- 77,80 ---- *************** *** 111,115 **** inline bool AllWeapons::isProficient (const ogs::items::Weapon& weapon) const { ! return (weapon.getProficiency () == this->_proficiency); } --- 86,102 ---- inline bool AllWeapons::isProficient (const ogs::items::Weapon& weapon) const { ! return (weapon.getProficiency () == this->getProficiency ()); ! } ! ! /** ! * Create a new weapon proficiency feat. The new feat applies to all ! * wapons in the specified proficiency group. ! * ! * @param proficiency Group of weapons that this feat applies to. ! */ ! inline ! AllWeapons::AllWeapons (ogs::items::Weapon::Proficiency proficiency): ! WeaponProficiency (EXCLUSIVE, proficiency) { ! // empty constructor body } Index: ArmorProficiency.cpp =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/feats/ArmorProficiency.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ArmorProficiency.cpp 13 Apr 2003 05:27:06 -0000 1.7 --- ArmorProficiency.cpp 15 Apr 2003 16:58:42 -0000 1.8 *************** *** 67,70 **** --- 67,71 ---- */ ArmorProficiency::ArmorProficiency (Armor::Proficiency proficiency): + Feat (EXCLUSIVE, GENERAL), _proficiency (proficiency) { // empty constructor body Index: ArmorProficiency.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/feats/ArmorProficiency.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ArmorProficiency.h 29 Mar 2003 02:10:36 -0000 1.4 --- ArmorProficiency.h 15 Apr 2003 16:58:43 -0000 1.5 *************** *** 48,54 **** static ArmorProficiency* createHeavy (); - ogs::core::Feat::Compatibility getCompatibility () const; - ogs::core::Feat::Group getGroup () const; - ogs::items::Armor::Proficiency getProficiency () const; bool isProficient (const ogs::items::Armor& armor) const; --- 48,51 ---- *************** *** 61,86 **** bool canAttach (const Object& object) const; }; - - /** - * Determine the compatability of this feat. Armor proficiency feats - * are exclusive feats. - * - * @return Feat::EXCLUSIVE - */ - inline ogs::core::Feat::Compatibility - ArmorProficiency::getCompatibility () const { - return (ogs::core::Feat::EXCLUSIVE); - } - - /** - * Determine the group that this feat belongs to. Armor proficiency - * feats are general feats. - * - * @return Feat::GENERAL - */ - inline ogs::core::Feat::Group - ArmorProficiency::getGroup () const { - return (ogs::core::Feat::GENERAL); - } /** --- 58,61 ---- Index: ImprovedInitiative.cpp =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/feats/ImprovedInitiative.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ImprovedInitiative.cpp 29 Mar 2003 02:10:36 -0000 1.4 --- ImprovedInitiative.cpp 15 Apr 2003 16:58:44 -0000 1.5 *************** *** 35,39 **** * Create a new Improved Initiative feat. */ ! ImprovedInitiative::ImprovedInitiative () { // empty constructor body } --- 35,40 ---- * Create a new Improved Initiative feat. */ ! ImprovedInitiative::ImprovedInitiative (): ! Feat (EXCLUSIVE) { // empty constructor body } *************** *** 59,63 **** */ bool ImprovedInitiative::attachObject (Object& object) { ! bool attached = attachObject (object); if (attached) { --- 60,64 ---- */ bool ImprovedInitiative::attachObject (Object& object) { ! bool attached = Feat::attachObject (object); if (attached) { Index: ImprovedSave.cpp =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/feats/ImprovedSave.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ImprovedSave.cpp 13 Apr 2003 05:27:06 -0000 1.4 --- ImprovedSave.cpp 15 Apr 2003 16:58:44 -0000 1.5 *************** *** 58,62 **** * @param type One of the three types of improved saves. */ ! ImprovedSave::ImprovedSave (Type type): _type (type) { // empty constructor body } --- 58,64 ---- * @param type One of the three types of improved saves. */ ! ImprovedSave::ImprovedSave (Type type): ! Feat (EXCLUSIVE), ! _type (type) { // empty constructor body } *************** *** 103,107 **** */ bool ImprovedSave::attachObject (Object& object) { ! bool attached = attachObject (object); if (attached) { --- 105,109 ---- */ bool ImprovedSave::attachObject (Object& object) { ! bool attached = Feat::attachObject (object); if (attached) { Index: Makefile.am =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/feats/Makefile.am,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Makefile.am 29 Mar 2003 02:10:37 -0000 1.6 --- Makefile.am 15 Apr 2003 16:58:45 -0000 1.7 *************** *** 27,31 **** AllWeapons.h \ ArmorProficiency.h \ - BonusFeat.h \ ImprovedInitiative.h \ ImprovedSave.h \ --- 27,30 ---- *************** *** 48,52 **** AllWeapons.cpp \ ArmorProficiency.cpp \ - BonusFeat.cpp \ ImprovedInitiative.cpp \ ImprovedSave.cpp \ --- 47,50 ---- Index: ShieldProficiency.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/feats/ShieldProficiency.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ShieldProficiency.h 29 Mar 2003 02:10:38 -0000 1.2 --- ShieldProficiency.h 15 Apr 2003 16:58:45 -0000 1.3 *************** *** 41,47 **** ShieldProficiency (); - Feat::Compatibility getCompatibility () const; - Feat::Group getGroup () const; - private: bool canAttach (const Object& object) const; --- 41,44 ---- *************** *** 51,78 **** * Create a new Shield Proficiency feat. */ ! inline ShieldProficiency::ShieldProficiency () { // empty constructor body - } - - /** - * Determine the compatability of this feat. Shield proficiency feats - * are exclusive feats. - * - * @return Feat::EXCLUSIVE - */ - inline ogs::core::Feat::Compatibility - ShieldProficiency::getCompatibility () const { - return (Feat::EXCLUSIVE); - } - - /** - * Determine the group that this feat belongs to. Shield proficiency - * feats are general feats. - * - * @return Feat::GENERAL - */ - inline ogs::core::Feat::Group - ShieldProficiency::getGroup () const { - return (Feat::GENERAL); } --- 48,54 ---- * Create a new Shield Proficiency feat. */ ! inline ShieldProficiency::ShieldProficiency (), ! Feat (EXCLUSIVE) { // empty constructor body } Index: Toughness.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/feats/Toughness.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Toughness.h 29 Mar 2003 02:10:38 -0000 1.2 --- Toughness.h 15 Apr 2003 16:58:45 -0000 1.3 *************** *** 41,74 **** bool attachObject (Object& object); bool dettachObject (); - Feat::Compatibility getCompatibility () const; - Feat::Group getGroup () const; - - private: - ogs::core::Modifier _modifier; - - bool canAttach (const Object& object) const; - void addHealthModifier (Object& object); }; /** ! * Determine the compatability of this feat. Toughness feats are ! * cumulative feats. ! * ! * @return Feat::CUMULATIVE ! */ ! inline ogs::core::Feat::Compatibility ! Toughness::getCompatibility () const { ! return (Feat::CUMULATIVE); ! } ! ! /** ! * Determine the group that this feat belongs to. Toughness feats are ! * general feats. ! * ! * @return Feat::GENERAL */ ! inline ogs::core::Feat::Group ! Toughness::getGroup () const { ! return (Feat::GENERAL); } --- 41,52 ---- bool attachObject (Object& object); bool dettachObject (); }; /** ! * Create a new Toughness feat. */ ! inline Toughness::Toughness (): ! Feat (CUMULATIVE) { ! // empty constructor body } Index: WeaponProficiency.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/feats/WeaponProficiency.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** WeaponProficiency.h 29 Mar 2003 02:10:38 -0000 1.2 --- WeaponProficiency.h 15 Apr 2003 16:58:45 -0000 1.3 *************** *** 40,75 **** class WeaponProficiency: public ogs::core::Feat { public: ! ogs::core::Feat::Group getGroup () const; ! ! /** ! * Determine weapon proficiency that this feat applies to. ! * ! * @return Proficiency of weapon: SIMPLE, MARTIAL, or EXOTIC. ! */ ! virtual ogs::items::Weapon::Proficiency getProficiency () const = 0; ! /** ! * Determine if a weapon is a proficient weapon. A proficient ! * weapon is a weapon that a creature with this feat is proficient ! * with. If this feat is not attached to a creature, the weapon is ! * not a proficient weapon. ! * ! * @return True if weapon is a proficient weapon. ! */ ! virtual bool isProficient (const ogs::items::Weapon& weapon) const = 0; ! virtual ~WeaponProficiency (); }; /** ! * Determine the group that this feat belongs to. Weapon proficiency ! * feats are general feats. * ! * @return Feat::GENERAL */ ! inline ogs::core::Feat::Group ! WeaponProficiency::getGroup () const { ! return (ogs::core::Feat::GENERAL); } --- 40,77 ---- class WeaponProficiency: public ogs::core::Feat { public: + ogs::items::Weapon::Proficiency getProficiency () const; ! virtual ~WeaponProficiency () = 0; ! protected: ! WeaponProficiency (Compatibility compatibility, ! ogs::items::Weapon::Proficiency weaponProficiency); ! private: ! ogs::items::Weapon::Proficiency _proficiency; }; /** ! * Create a new weapon proficiency. * ! * @param compatibility Compatibility of feat. ! * @param weaponProficiency Proficiency of weapons covered by this feat. */ ! inline ! WeaponProficiency::WeaponProficiency (Compatibility compatibility, ! ogs::items::Weapon::Proficiency weaponProficiency): ! Feat (compatibility, GENERAL), ! _proficiency (_proficiency) { ! // empty constructor body ! } ! ! /** ! * Determine weapon proficiency that this feat applies to. ! * ! * @return Proficiency of weapon: SIMPLE, MARTIAL, or EXOTIC. ! */ ! inline ogs::items::Weapon::Proficiency ! WeaponProficiency::getProficiency () const { ! return (this->_proficiency); } |
From: <ele...@us...> - 2003-04-15 16:59:22
|
Update of /cvsroot/ogs/dist/c++/ogs/magic In directory sc8-pr-cvs1:/tmp/cvs-serv20206/c++/ogs/magic Modified Files: Feats.h Makefile.am MetamagicFeat.cpp MetamagicFeat.h SpellList.h Log Message: See C++ ChangeLog (Apr 15) for details. Index: Feats.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/magic/Feats.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Feats.h 19 Feb 2003 22:36:51 -0000 1.1 --- Feats.h 15 Apr 2003 16:58:46 -0000 1.2 *************** *** 31,35 **** # include <ogs/magic/feats/HeightenSpell.h> # include <ogs/magic/feats/MaximizeSpell.h> - # include <ogs/magic/feats/Namespace.h> # include <ogs/magic/feats/QuickenSpell.h> # include <ogs/magic/feats/SilentSpell.h> --- 31,34 ---- Index: Makefile.am =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/magic/Makefile.am,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Makefile.am 4 Mar 2003 03:24:42 -0000 1.6 --- Makefile.am 15 Apr 2003 16:58:46 -0000 1.7 *************** *** 62,66 **** School.cpp \ Spell.cpp \ - SpellList.cpp \ Subschool.cpp libogs_magic_la_LIBADD = \ --- 62,65 ---- Index: MetamagicFeat.cpp =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/magic/MetamagicFeat.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MetamagicFeat.cpp 25 Mar 2003 06:13:13 -0000 1.4 --- MetamagicFeat.cpp 15 Apr 2003 16:58:46 -0000 1.5 *************** *** 21,26 **** */ - #include <typeinfo> - #include "ogs/magic/MetamagicFeat.h" #include "ogs/magic/Spell.h" --- 21,24 ---- *************** *** 29,54 **** /** ! * Attach this metamagic feat to a spell. Metamagic feats can only be ! * attached to spells. This, this function returns false if the object ! * is not an instance of a class derived from the <code>Spell</code> ! * class. Derived classes should always call this function first before ! * modifing the object. * ! * @param object An instance of a class derived from <code>Spell</code>. * @return True if this metamagic feat is attached to the spell */ ! bool MetamagicFeat::attachObject (Object& object) { ! if (! Feature::attachObject (object)) { ! return (false); } ! bool success = true; ! try { ! dynamic_cast<Spell&> (object); ! } catch (std::bad_cast) { ! success = false; } ! return (success); } --- 27,62 ---- /** ! * Attach this metamagic feat to a spell. This method should always be ! * called first by derived objects that override this function. * ! * @param spell A spell instance. * @return True if this metamagic feat is attached to the spell */ ! bool MetamagicFeat::attachSpell (Spell& spell) { ! bool attach = canAttachSpell (spell); ! ! if (attach) { ! this->_spell = &spell; } ! return (attach); ! } ! ! /** ! * Detach this metamagic feat from a spell. This function resets the ! * spell pointer to null. Derived classes that override this function ! * should therefore call the getObject() function before calling this ! * function. ! * ! * @return True if this feat is detached from the spell. ! */ ! bool MetamagicFeat::detachSpell () { ! bool detach = canDetachSpell (); ! ! if (detach) { ! this->_spell = NULL; } ! return (detach); } Index: MetamagicFeat.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/magic/MetamagicFeat.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MetamagicFeat.h 29 Mar 2003 02:10:39 -0000 1.5 --- MetamagicFeat.h 15 Apr 2003 16:58:46 -0000 1.6 *************** *** 31,67 **** OGS_BEGIN_MAGIC_NAMESPACE /** ! * A feat that enhances spells at the cost of higher level spell slots. */ class MetamagicFeat: public ogs::core::Feat { public: ! virtual bool attachObject (Object& object); ! ogs::core::Feat::Compatibility getCompatibility () const; ! /** ! * Determine number of levels added to normal spell level. ! * Metamagic feats use up spell slots higher than a spell's normal ! * level. These added spell levels are used only when filling spell ! * slots. <em>Derived classes must override this function.</em> ! * ! * @return Number of added levels. ! */ ! virtual int getAddedLevels () = 0; ! virtual ~MetamagicFeat () { } }; /** ! * Determine the compatibility of this type of feat. Metamagic feats ! * are exclusive feats: only one instance of each metamagic feat can ! * be attached to a spell at one time. * ! * @return Feat::EXCLUSIVE. */ ! inline ogs::core::Feat::Compatibility ! MetamagicFeat::getCompatibility () const { ! return (ogs::core::Feat::EXCLUSIVE); } OGS_END_MAGIC_NAMESPACE --- 31,114 ---- OGS_BEGIN_MAGIC_NAMESPACE + class Spell; + /** ! * A feat that enhances spells. The cost of using a metamagic feat ! * however is that it increases the spell level of the spell. This ! * requires that spell casters use a higher slot in their daily ! * allowance of spells. ! * ! * @todo ! * Could modify the Attachable operations to accept both creatures and ! * spells and perform the correct behavior appropriate to that class. */ class MetamagicFeat: public ogs::core::Feat { public: ! /** The number of spell levels added by a metamagic feat. */ ! typedef unsigned Cost; ! Cost getCost () const; ! virtual bool attachSpell (Spell& spell); ! virtual bool detachSpell (); ! Spell* getSpell () const; ! virtual ~MetamagicFeat () = 0; ! ! protected: ! MetamagicFeat (Cost cost); ! ! virtual bool canAttachSpell (Spell& spell) const; ! virtual bool canDetachSpell () const; ! ! private: ! Cost _cost; ! Spell* _spell; }; /** ! * Create a new metamagic feat. * ! * @param cost Cost of using a metamagic feat. */ ! inline MetamagicFeat::MetamagicFeat (Cost cost): ! Feat (EXCLUSIVE, MAGIC), ! _cost (cost), ! _spell (NULL) { ! // empty constructor body ! } ! ! /** ! * Detemine the spell that this feat is attached to. ! * ! * @return Spell that this feat is attached to or NULL if not attached. ! */ ! inline Spell* ! MetamagicFeat::getSpell () const { ! return (this->_spell); } + + /** + * Determine if this metamagic feat can be attached to a spell. A + * metamagic feat can only be attached to a spell if it is not already + * attached. + */ + inline bool + MetamagicFeat::canAttachSpell (Spell& spell) const { + return (this->_spell == NULL); + } + + /** + * Determine if this metamagic feat can be detached from a spell. + * Metamagic feats can not be detached from spells by default. + * + * @return True if the feature is detached from the object. + */ + inline bool + MetamagicFeat::canDetachSpell () const { + return (false); + } + + inline MetamagicFeat::~MetamagicFeat () { } OGS_END_MAGIC_NAMESPACE Index: SpellList.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/magic/SpellList.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SpellList.h 28 Feb 2003 11:11:25 -0000 1.1 --- SpellList.h 15 Apr 2003 16:58:47 -0000 1.2 *************** *** 68,72 **** * spell maps. */ ! CasterMap _casterMap; SpellList (); --- 68,72 ---- * spell maps. */ ! CasterMap casterMap; SpellList (); *************** *** 80,84 **** * Create an empty spell list. */ ! inline SpellList::SpellList (): _casterMap () { } OGS_END_MAGIC_NAMESPACE --- 80,149 ---- * Create an empty spell list. */ ! inline SpellList::SpellList (): ! casterMap () { ! // empty constructor body ! } ! ! /** ! * Determine the spell level for a class of spell and caster. The class ! * of spell must be a class dervied from the <code>Spell</code> class. ! * The class of caster must be a class derived from <code>CClass</code> ! * or <code>Domain</code>. ! * ! * @return Spell level or null if not caster and spell not found. ! * @throws std::bad_cast If one of the classes is not derived from ! * the correct class. ! * @throws NotFound If the spell or caster are not found. ! */ ! template <class CasterClass, class SpellClass> ! int SpellList::getLevel () const { ! ! // Throw bad_cast if casterClass is not derived from CClass or Domain. ! checkCasterClass<CasterClass> (); ! ! // Throw bad_cast if spellClass is not derived from Spell. ! SpellClass spell; ! dynamic_cast<Spell&> (spell); ! ! Class casterClass = Class::getClass<CasterClass> (); ! CasterMap::iterator casterItor = casterMap.find (casterClass); ! if (casterItor == casterMap.end ()) { ! //throw NotFound (); ! } ! ! SpellMap spellMap = *casterItor; ! SpellMap::iterator spellItor = spellMap.find (spellClass); ! if (spellItor == spellMap.end ()) { ! //throw NotFound (); ! } ! ! return (*spellItor); ! } ! ! template <class CasterClass> ! void SpellList::checkCasterClass () { ! // TODO: Implement. ! } ! ! /** ! * Determine the spell level for a spell and a class of caster. This ! * function takes into account any metamagic feats that are attached to ! * the spell. If the spell has any metamagic feats, the total slots ! * from the metamagic feats are added to the spell's normal level. The ! * class of caster may be a class derived from <code>CClass</code> or ! * <code>Domain</code>. ! * ! * @param spell A spell object. ! * @return Spell level or null if not caster and spell not found. ! * @throws std::bad_cast If one of the classes is not derived from ! * the correct class. ! * @throws NotRelated If the spell and caster are not related. ! */ ! template <class CasterClass, class SpellClass> ! int SpellList::getLevel (const SpellClass& spell) const { ! int spellLevel = getLevel<CasterClass, SpellClass> (); ! //spelLevel += spell.getMetamagicSlots (); ! return (spellLevel); ! } OGS_END_MAGIC_NAMESPACE |
Update of /cvsroot/ogs/dist/c++/ogs/core In directory sc8-pr-cvs1:/tmp/cvs-serv20206/c++/ogs/core Modified Files: Abilities.h Creature.cpp Creature.h Entity.cpp Entity.h Feat.h Feature.h Saves.h Size.h Skill.cpp Skill.h Strength.h Log Message: See C++ ChangeLog (Apr 15) for details. Index: Abilities.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/core/Abilities.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Abilities.h 13 Apr 2003 05:25:51 -0000 1.5 --- Abilities.h 15 Apr 2003 16:58:33 -0000 1.6 *************** *** 52,55 **** --- 52,61 ---- typedef PtrMap::iterator Iterator; + /** + * A pair of an ability type and ability pointer. Iterators point + * to values of this type. + */ + typedef PtrMap::value_type Value; + struct PartialMethod; Index: Creature.cpp =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/core/Creature.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Creature.cpp 13 Apr 2003 05:25:51 -0000 1.10 --- Creature.cpp 15 Apr 2003 16:58:34 -0000 1.11 *************** *** 41,45 **** * @param abilities Ability scores of creature. * @param size Size of creature. ! * @param body Body of creature. */ Creature::Creature (Die hitDice, Abilities abilities, --- 41,45 ---- * @param abilities Ability scores of creature. * @param size Size of creature. ! * @param parts An array of body part types. */ Creature::Creature (Die hitDice, Abilities abilities, *************** *** 57,71 **** // Add Dexterity modifier to Reflex save, initiative, and defense. AbilityPtr ability = this->_abilities [Ability::DEX]; ! Modifier& modifier = ability->getModifier (); ! this->_saves.ref.addModifier (modifier); ! this->_initiative.addModifier (modifier); ! Defense& defense = getDefense (); ! defense.addModifier (modifier); // Add ability modifiers to saving throws. ability = this->_abilities [Ability::CON]; ! this->_saves.fort.addModifier (ability->getModifier ()); ability = this->_abilities [Ability::WIS]; ! this->_saves.will.addModifier (ability->getModifier ()); // Add hit dice modifiers to saving throws. --- 57,78 ---- // Add Dexterity modifier to Reflex save, initiative, and defense. AbilityPtr ability = this->_abilities [Ability::DEX]; ! if (ability) { ! Modifier& modifier = ability->getModifier (); ! this->_saves.ref.addModifier (modifier); ! this->_initiative.addModifier (modifier); ! Defense& defense = getDefense (); ! defense.addModifier (modifier); ! } // Add ability modifiers to saving throws. ability = this->_abilities [Ability::CON]; ! if (ability) { ! this->_saves.fort.addModifier (ability->getModifier ()); ! } ! ability = this->_abilities [Ability::WIS]; ! if (ability) { ! this->_saves.will.addModifier (ability->getModifier ()); ! } // Add hit dice modifiers to saving throws. *************** *** 80,98 **** /** ! * Add a skill to this creature. * ! * @param skillPtr A smart pointer for a new skill. * @return True if the skill was added to this creature. */ ! bool Creature::addSkill (SkillPtr skillPtr) { bool added = false; ! if (skillPtr) { ! // Make sure the skill isn't already in the list of skills. ! Skills::iterator end = _skills.end (); ! if (std::find (_skills.begin (), end, skillPtr) != end) { ! _skills.push_back (skillPtr); ! added = true; } } --- 87,121 ---- /** ! * Add a skill to this creature. This function adds the skill only if ! * another skill of the same type is not already present. * ! * @param skill A skill to be added to this creature. * @return True if the skill was added to this creature. */ ! bool Creature::addSkill (Skill& skill) { bool added = false; ! Skills::iterator itor = this->_skills.begin (); ! while (itor != this->_skills.end ()) { ! if ((*itor)->getType () == skill.getType ()) { ! break; ! } ! ! ++itor; ! } ! ! if (itor == this->_skills.end ()) { ! // Add key ability to skill. One or two skills do not have key ! // abilities and this creature may not have the key ability anyway. ! Ability::Type abilityType = skill.getKeyAbility (); ! if (Ability::isValidType (abilityType)) { ! AbilityPtr abilityPtr = this->_abilities [abilityType]; ! if (abilityPtr) { ! (skill.getModifiers ()).addModifier (abilityPtr->getModifier ()); ! } } + + this->_skills.push_back (SkillPtr (&skill)); + added = true; } *************** *** 100,115 **** } /** * Add a feat to this creature. * ! * @param featPtr A smart pointer to a new feat. * @return True if the feat was added to this creature. */ ! bool Creature::addFeat (FeatPtr featPtr) { ! Feat* feat = featPtr.get (); bool added = false; ! if (added = feat->attachObject (*this)) { ! _feats.push_back (featPtr); } --- 123,139 ---- } + // TODO: Implement removeSkill() function. + /** * Add a feat to this creature. * ! * @param feat A feat to be added to this creature. * @return True if the feat was added to this creature. */ ! bool Creature::addFeat (Feat& feat) { bool added = false; ! if (added = feat.attachObject (*this)) { ! this->_feats.push_back (FeatPtr (&feat)); } *************** *** 120,135 **** * Remove a feat from this creature. * ! * @param featPtr A smart pointer to a feat. * @return True if the feat was removed from this creature. */ ! bool Creature::removeFeat (FeatPtr featPtr) { bool removed = false; ! Feats::iterator end = _feats.end (); ! Feats::iterator itor = std::find (_feats.begin (), end, featPtr); if (itor != end) { ! Feat* feat = featPtr.get (); ! if (removed = feat->detachObject ()) { ! _feats.erase (itor); } } --- 144,159 ---- * Remove a feat from this creature. * ! * @param feat A feat to be removed from this creature. * @return True if the feat was removed from this creature. */ ! bool Creature::removeFeat (Feat& feat) { bool removed = false; ! Feats::iterator end = this->_feats.end (); ! FeatPtr featPtr (&feat); ! Feats::iterator itor = std::find (this->_feats.begin (), end, featPtr); if (itor != end) { ! if (removed = feat.detachObject ()) { ! this->_feats.erase (itor); } } Index: Creature.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/core/Creature.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Creature.h 13 Apr 2003 05:25:51 -0000 1.9 --- Creature.h 15 Apr 2003 16:58:34 -0000 1.10 *************** *** 75,84 **** Skills getSkills () const; ! bool addSkill (SkillPtr skillPtr); ! bool removeSkill (SkillPtr skillPtr); Feats getFeats () const; ! bool addFeat (FeatPtr featPtr); ! bool removeFeat (FeatPtr featPtr); Body getBody () const; --- 75,84 ---- Skills getSkills () const; ! bool addSkill (Skill& skill); ! bool removeSkill (Skill& skill); Feats getFeats () const; ! bool addFeat (Feat& feat); ! bool removeFeat (Feat& feat); Body getBody () const; Index: Entity.cpp =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/core/Entity.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Entity.cpp 13 Apr 2003 05:25:51 -0000 1.6 --- Entity.cpp 15 Apr 2003 16:58:35 -0000 1.7 *************** *** 76,94 **** * entity, this function does nothing. * ! * @param featurePtr A shared pointer to a feature object. * @return True if feature is added to this entity. */ ! bool Entity::addFeature (FeaturePtr featurePtr) { bool added = false; ! if (featurePtr) { ! Features::iterator end = this->_features.end (); ! ! if (std::find (this->_features.begin (), end, featurePtr) != end) { ! Feature* feature = featurePtr.get (); ! ! if (added = feature->attachObject (*this)) { ! this->_features.push_front (featurePtr); ! } } } --- 76,90 ---- * entity, this function does nothing. * ! * @param feature A feature to add to this enitty. * @return True if feature is added to this entity. */ ! bool Entity::addFeature (Feature& feature) { bool added = false; ! Features::iterator end = this->_features.end (); ! FeaturePtr featurePtr (&feature); ! if (std::find (this->_features.begin (), end, featurePtr) == end) { ! if (added = feature.attachObject (*this)) { ! this->_features.push_front (featurePtr); } } *************** *** 101,116 **** * from this entity, this function does nothing. * ! * @param featurePtr A shared pointer to a feature object. * @return True if feature is removed from this entity. */ ! bool Entity::removeFeature (FeaturePtr featurePtr) { bool removed = true; ! if (featurePtr) { ! Feature* feature = featurePtr.get (); ! ! if (removed = feature->detachObject ()) { ! this->_features.remove (featurePtr); ! } } --- 97,108 ---- * from this entity, this function does nothing. * ! * @param feature A feature to remove from this enitty. * @return True if feature is removed from this entity. */ ! bool Entity::removeFeature (Feature& feature) { bool removed = true; ! if (removed = feature.detachObject ()) { ! this->_features.remove (FeaturePtr (&feature)); } Index: Entity.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/core/Entity.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Entity.h 13 Apr 2003 05:25:51 -0000 1.6 --- Entity.h 15 Apr 2003 16:58:35 -0000 1.7 *************** *** 74,79 **** Features getFeatures () const; ! bool addFeature (FeaturePtr featurePtr); ! bool removeFeature (FeaturePtr featurePtr); virtual ~Entity () = 0; --- 74,79 ---- Features getFeatures () const; ! bool addFeature (Feature& feature); ! bool removeFeature (Feature& feature); virtual ~Entity () = 0; Index: Feat.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/core/Feat.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Feat.h 13 Apr 2003 05:25:51 -0000 1.9 --- Feat.h 15 Apr 2003 16:58:36 -0000 1.10 *************** *** 44,48 **** */ enum Compatibility { - /** * Indicates that the feat may be taken only once. Only one --- 44,47 ---- *************** *** 75,79 **** */ enum Group { - /** * A general-purpose feat. General feats are feats that can be --- 74,77 ---- *************** *** 81,85 **** * situations. */ ! GENERAL = 0, /** --- 79,83 ---- * situations. */ ! GENERAL = 1, /** *************** *** 88,92 **** * granted to fighters are limited to combat feats. */ ! COMBAT = 1, /** --- 86,90 ---- * granted to fighters are limited to combat feats. */ ! COMBAT = 2, /** *************** *** 96,100 **** * feats. */ ! MAGIC = 2, /** --- 94,98 ---- * feats. */ ! MAGIC = 3, /** *************** *** 103,107 **** * particular cclasses or creatures or used in certain situations. */ ! SPECIAL = 3, }; --- 101,105 ---- * particular cclasses or creatures or used in certain situations. */ ! SPECIAL = 4, }; *************** *** 109,130 **** static XP::Level getSlotCountLevel (unsigned slotCount); ! /** ! * Determine the compatability of this feat. ! * ! * @return Compatibility of this feat. ! */ ! virtual Compatibility getCompatibility () const = 0; ! ! /** ! * Determine the group that this feat belongs to. ! * ! * @return Group that this feat belongs to. ! */ ! virtual Group getGroup () const = 0; virtual ~Feat () { } protected: virtual bool canAttach (const Object& object) const; /** --- 107,120 ---- static XP::Level getSlotCountLevel (unsigned slotCount); ! Compatibility getCompatibility () const; ! Group getGroup () const; virtual ~Feat () { } protected: + Feat (Compatibility compatibility, Group group = GENERAL); + virtual bool canAttach (const Object& object) const; + Creature* getCreature (); /** *************** *** 139,145 **** --- 129,148 ---- template <class T> bool findFeat (const Object& object) const; + + private: + Compatibility _compatibility; + Group _group; }; /** + * Create a new feat. + */ + inline Feat::Feat (Compatibility compatibility, Group group): + _compatibility (compatibility), + _group (group) { + // empty constructor body + } + + /** * Determine number of slots available for feats at a given experience * level. *************** *** 154,161 **** /** * Determine if a feat is an instance of a specific feat. The * specific feat is specified by the template parameter T. * ! * @param feat An instance of a feat. * @return True if feat is an instance of the specific feat. */ --- 157,196 ---- /** + * Determine the compatibility of this feat. + * + * @return Compatibility of this feat. + */ + inline Feat::Compatibility + Feat::getCompatibility () const { + return (this->_compatibility); + } + + /** + * Determine the group that this feat belongs to. + * + * @return Group that this feat belongs to. + */ + inline Feat::Group + Feat::getGroup () const { + return (this->_group); + } + + /** + * Determine the creature that this feat is attached to. This function + * returns the same value as the Feature::getObject() function. It is + * provided solely for the convenience of derived classes. + * + * @return Creature that this feat is attached to or NULL if not attached. + */ + inline Creature* + Feat::getCreature () { + return (dynamic_cast<Creature*> (getObject ())); + } + + /** * Determine if a feat is an instance of a specific feat. The * specific feat is specified by the template parameter T. * ! * @param featPtr A shared pointer to a feat object. * @return True if feat is an instance of the specific feat. */ Index: Feature.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/core/Feature.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Feature.h 4 Apr 2003 20:22:44 -0000 1.5 --- Feature.h 15 Apr 2003 16:58:36 -0000 1.6 *************** *** 26,29 **** --- 26,30 ---- # define OGS_CORE_FEATURE_H + # include <ogs/support/Attachable.h> # include <ogs/support/Object.h> # include <ogs/core/Namespace.h> *************** *** 37,47 **** * detached from the object. */ ! class Feature: public ogs::support::Object { public: virtual bool attachObject (Object& object); virtual bool detachObject (); ! ! const Object* getObject () const; ! Object* getObject (); virtual ~Feature () = 0; --- 38,47 ---- * detached from the object. */ ! class Feature: public ogs::support::Object, ! public ogs::support::Attachable { public: virtual bool attachObject (Object& object); virtual bool detachObject (); ! Object* getObject () const; virtual ~Feature () = 0; *************** *** 60,64 **** * Create a new feature. */ ! inline Feature::Feature (): _object (NULL) { // empty constructor body } --- 60,65 ---- * Create a new feature. */ ! inline Feature::Feature (): ! _object (NULL) { // empty constructor body } *************** *** 69,84 **** * @return Attached object or NULL if not attached. */ - inline const ogs::support::Object* - Feature::getObject () const { - return (this->_object); - } - - /** - * Determine the object that this feature is currently attached to. - * - * @return Attached object or NULL if not attached. - */ inline ogs::support::Object* ! Feature::getObject () { return (this->_object); } --- 70,75 ---- * @return Attached object or NULL if not attached. */ inline ogs::support::Object* ! Feature::getObject () const { return (this->_object); } Index: Saves.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/core/Saves.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Saves.h 13 Apr 2003 05:25:51 -0000 1.4 --- Saves.h 15 Apr 2003 16:58:36 -0000 1.5 *************** *** 34,39 **** /** ! * A set of saving throws. The set contains a list of modifiers that ! * are added to rolls for each type of saving throw. */ struct Saves { --- 34,44 ---- /** ! * A set of saving throws. A set of saving throws contains a separate ! * list of modifiers for each type of saving throw. There are three ! * types of saving throws: Fortitude, Reflex, and Will. These modifiers ! * are added to the roll of 1d20 when a saving throw check is made. The ! * @c Saves class encapsulates these modifiers and also contains helper ! * functions for determining base saving throw bonuses at a given ! * experience level and actually checking the roll of a saving throw. */ struct Saves { *************** *** 50,54 **** bool rollRefSave (Die::Value dc) const; bool rollWillSave (Die::Value dc) const; - bool rollSave (Die::Value dc, Modifier::Value totalModifier) const; }; --- 55,58 ---- *************** *** 57,61 **** * * @param xpLevel Experience level of cclass. ! * @return Value of save bonus. */ inline Modifier::Value --- 61,65 ---- * * @param xpLevel Experience level of cclass. ! * @return Value of base save bonus. */ inline Modifier::Value *************** *** 68,72 **** * * @param xpLevel Experience level of cclass. ! * @return Value of save bonus. */ inline Modifier::Value --- 72,76 ---- * * @param xpLevel Experience level of cclass. ! * @return Value of base save bonus. */ inline Modifier::Value *************** *** 76,129 **** /** ! * Create a new set of saves. Each saving throw in the set is created ! * as an empty list of modifiers. */ ! inline Saves::Saves (): fort (), ref (), will () { } /** * Roll a Fortitude saving throw. The Fortitude modifiers are added to ! * the roll of 1d20 and compared to a difficulty class. * * @param dc Difficulty class of saving throw. * @return True if saving throw succeeded. */ ! inline bool Saves::rollFortSave (Die::Value dc) const { ! return (rollSave (dc, fort.getValue ())); } /** * Roll a Reflex saving throw. The Reflex modifiers are added to the ! * roll of 1d20 and compared to a difficulty class. * * @param dc Difficulty class of saving throw. * @return True if saving throw succeeded. */ ! inline bool Saves::rollRefSave (Die::Value dc) const { ! return (rollSave (dc, ref.getValue ())); } /** * Roll a Will saving throw. The Will modifiers are added to the roll ! * of 1d20 and compared to a difficulty class. ! * ! * @param dc Difficulty class of saving throw. ! * @return True if saving throw succeeded. ! */ ! inline bool Saves::rollWillSave (Die::Value dc) const { ! return (rollSave (dc, will.getValue ())); ! } ! ! /** ! * Roll a saving throw. The total modifier is added to the roll of 1d20 ! * and compared to a difficulty class (DC). If the result is greater * than or equal to the DC, the saving throw is successful. * * @param dc Difficulty class of saving throw. - * @param totalModifier Total value of all saving throw modifiers. * @return True if saving throw succeeded. */ inline bool ! Saves::rollSave (Die::Value dc, Modifier::Value totalModifier) const { ! return (Die::roll () + totalModifier >= dc); } --- 80,128 ---- /** ! * Create a new set of saves. A new set of saving throws does not ! * contain any modifiers when initially created. */ ! inline Saves::Saves (): ! fort (), ref (), will () { ! // empty constructor body ! } /** * Roll a Fortitude saving throw. The Fortitude modifiers are added to ! * the roll of 1d20 and compared to a difficulty class. If the result ! * is greater than or equal to the DC, the saving throw is successful. * * @param dc Difficulty class of saving throw. * @return True if saving throw succeeded. */ ! inline bool ! Saves::rollFortSave (Die::Value dc) const { ! return ((Die::roll () + fort.getValue ()) >= dc); } /** * Roll a Reflex saving throw. The Reflex modifiers are added to the ! * roll of 1d20 and compared to a difficulty class. If the result is ! * greater than or equal to the DC, the saving throw is successful. * * @param dc Difficulty class of saving throw. * @return True if saving throw succeeded. */ ! inline bool ! Saves::rollRefSave (Die::Value dc) const { ! return ((Die::roll () + ref.getValue ()) >= dc); } /** * Roll a Will saving throw. The Will modifiers are added to the roll ! * of 1d20 and compared to a difficulty class. If the result is greater * than or equal to the DC, the saving throw is successful. * * @param dc Difficulty class of saving throw. * @return True if saving throw succeeded. */ inline bool ! Saves::rollWillSave (Die::Value dc) const { ! return ((Die::roll () + will.getValue ()) >= dc); } Index: Size.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/core/Size.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Size.h 18 Feb 2003 04:17:21 -0000 1.2 --- Size.h 15 Apr 2003 16:58:37 -0000 1.3 *************** *** 55,59 **** /** As big as a tree. */ HUGE = 'H', ! /** * As big as a house. */ GARGANTUAN = 'G', /** As big as a castle. */ --- 55,59 ---- /** As big as a tree. */ HUGE = 'H', ! /** As big as a house. */ GARGANTUAN = 'G', /** As big as a castle. */ Index: Skill.cpp =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/core/Skill.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Skill.cpp 13 Apr 2003 05:25:51 -0000 1.5 --- Skill.cpp 15 Apr 2003 16:58:37 -0000 1.6 *************** *** 37,40 **** --- 37,41 ---- * @param useUntrained True if new skill can be used untrained. * @param useArmorPenalty True if armor penalty applies to skill checks. + * @param cclassPoints Points spent on cclass skill. * @return A new skill. * *************** *** 45,56 **** Ability::Type keyAbility, bool useUntrained, ! bool useArmorPenalty): _keyAbility (keyAbility), _useUntrained (useUntrained), _useArmorPenalty (useArmorPenalty), ! _cclassPoints (0), _xclassPoints (0), _maxPoints (0), ! _rankModifier (), _modifiers () { --- 46,59 ---- Ability::Type keyAbility, bool useUntrained, ! bool useArmorPenalty, ! Points cclassPoints): ! _type (type), _keyAbility (keyAbility), _useUntrained (useUntrained), _useArmorPenalty (useArmorPenalty), ! _cclassPoints (cclassPoints), _xclassPoints (0), _maxPoints (0), ! _rankModifier (getRanks (cclassPoints, 0)), _modifiers () { Index: Skill.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/core/Skill.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Skill.h 13 Apr 2003 05:25:51 -0000 1.6 --- Skill.h 15 Apr 2003 16:58:37 -0000 1.7 *************** *** 78,82 **** Skill (Type type, Ability::Type keyAbility, ! bool useUntrained, bool useArmorPenalty); virtual ~Skill () { } --- 78,83 ---- Skill (Type type, Ability::Type keyAbility, ! bool useUntrained, bool useArmorPenalty, ! Points cclassPoints = 0); virtual ~Skill () { } *************** *** 94,97 **** --- 95,102 ---- Modifiers& getModifiers (); + protected: + static Ranks getRanks (Points cclass, Points xclass); + bool checkMaximumRanks (Points points, bool cclassSkill); + private: Type _type; *************** *** 104,110 **** Modifier _rankModifier; Modifiers _modifiers; - - Ranks getRanks (Points cclass, Points xclass) const; - bool checkMaximumRanks (Points points, bool cclassSkill); }; --- 109,112 ---- *************** *** 247,254 **** /** * Determine ranks from cclass skill points and cross-cclass skill * points. This function is just a convenient helper function. */ inline Skill::Ranks ! Skill::getRanks (Points cclass, Points xclass) const { ! return (cclass + (xclass / 2)); } --- 249,259 ---- /** * Determine ranks from cclass skill points and cross-cclass skill * points. This function is just a convenient helper function. + * + * @param cclassPoints Points spent for cclass skill. + * @param xclassPoints Points spent for cross-cclass skill. */ inline Skill::Ranks ! Skill::getRanks (Points cclassPoints, Points xclassPoints) { ! return (cclassPoints + (xclassPoints / 2)); } Index: Strength.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/core/Strength.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Strength.h 4 Apr 2003 20:22:44 -0000 1.2 --- Strength.h 15 Apr 2003 16:58:37 -0000 1.3 *************** *** 33,37 **** /** ! * An ability that determines physical power and force. A Strength * modifier is added to attack rolls with melee weapons and damage * rolls with melee weapons, thrown weapons, and specially designed * projectile weapons. Strength is a special ability that has * additional operations for determining carrying capacities. */ class Strength: public Ability { --- 33,43 ---- /** ! * An ability that determines physical power and force. A Strength ! * modifier is added to attack rolls with melee weapons and damage ! * rolls with melee weapons, thrown weapons, and specially designed ! * projectile weapons. Strength is a special ability that has ! * additional operations for determining carrying capacities. ! * ! * @todo Change pounds in load functions to locale-dependent units. */ class Strength: public Ability { *************** *** 54,58 **** */ inline ! Strength::Strength (): Ability (Ability::STR) { // empty constructor body } --- 60,65 ---- */ inline ! Strength::Strength (): ! Ability (Ability::STR) { // empty constructor body } |
From: <ele...@us...> - 2003-04-15 16:59:16
|
Update of /cvsroot/ogs/dist/c++/ogs/creatures In directory sc8-pr-cvs1:/tmp/cvs-serv20206/c++/ogs/creatures Modified Files: Humanoid.h Makefile.am Undead.h Added Files: Undeads.h Log Message: See C++ ChangeLog (Apr 15) for details. --- NEW FILE: Undeads.h --- /* * Undeads.h -- declarations for undead creatures * Copyright (C) 2003 Eric Lemings <ele...@us...> * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this software; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA * * RCS: $Id: Undeads.h,v 1.1 2003/04/15 16:58:39 elemings Exp $ */ #ifndef OGS_CREATURES_UNDEADS_H # define OGS_CREATURES_UNDEADS_H // Uncomment these as they are completed. //# include <ogs/creatures/undeads/Ghast.h> //# include <ogs/creatures/undeads/Ghost.h> //# include <ogs/creatures/undeads/Ghoul.h> //# include <ogs/creatures/undeads/Lich.h> //# include <ogs/creatures/undeads/Mummy.h> //# include <ogs/creatures/undeads/Skeleton.h> //# include <ogs/creatures/undeads/Vampire.h> //# include <ogs/creatures/undeads/Wight.h> # include <ogs/creatures/undeads/Wraith.h> //# include <ogs/creatures/undeads/Zombie.h> #endif /* !defined OGS_CREATURES_UNDEADS_H */ Index: Humanoid.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/creatures/Humanoid.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Humanoid.h 13 Apr 2003 05:25:20 -0000 1.4 --- Humanoid.h 15 Apr 2003 16:58:37 -0000 1.5 *************** *** 64,68 **** * @param abilities Ability scores of creature. * @param size Size of creature. ! * @param body Body of creature. */ inline --- 64,68 ---- * @param abilities Ability scores of creature. * @param size Size of creature. ! * @param parts An array of body part types. */ inline Index: Makefile.am =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/creatures/Makefile.am,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makefile.am 29 Mar 2003 02:10:34 -0000 1.4 --- Makefile.am 15 Apr 2003 16:58:37 -0000 1.5 *************** *** 22,26 **** SUBDIRS = \ ! humanoids pkgincludedir = $(includedir)/ogs/creatures --- 22,27 ---- SUBDIRS = \ ! humanoids \ ! undeads pkgincludedir = $(includedir)/ogs/creatures *************** *** 30,34 **** Humanoids.h \ Namespace.h \ ! Undead.h INCLUDES = \ --- 31,36 ---- Humanoids.h \ Namespace.h \ ! Undead.h \ ! Undeads.h INCLUDES = \ *************** *** 41,48 **** libogs_creatures_la_DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ libogs_creatures_la_DEPENDENCIES = \ ! humanoids/libogs-humanoids.la libogs_creatures_la_SOURCES = \ Humanoid.cpp libogs_creatures_la_LIBADD = \ ! humanoids/libogs-humanoids.la --- 43,52 ---- libogs_creatures_la_DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ libogs_creatures_la_DEPENDENCIES = \ ! humanoids/libogs-humanoids.la \ ! undeads/libogs-undeads.la libogs_creatures_la_SOURCES = \ Humanoid.cpp libogs_creatures_la_LIBADD = \ ! humanoids/libogs-humanoids.la \ ! undeads/libogs-undeads.la Index: Undead.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/creatures/Undead.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Undead.h 13 Apr 2003 05:25:20 -0000 1.3 --- Undead.h 15 Apr 2003 16:58:38 -0000 1.4 *************** *** 64,68 **** * @param abilities Ability scores of creature. * @param size Size of creature. ! * @param body Body of creature. */ inline --- 64,68 ---- * @param abilities Ability scores of creature. * @param size Size of creature. ! * @param parts An array of body part types. */ inline |
Update of /cvsroot/ogs/dist/c++/ogs/cclasses In directory sc8-pr-cvs1:/tmp/cvs-serv20206/c++/ogs/cclasses Modified Files: Bard.h Cleric.h Druid.h Paladin.cpp Paladin.h Ranger.h Sorcerer.h Wizard.h Log Message: See C++ ChangeLog (Apr 15) for details. Index: Bard.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/cclasses/Bard.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Bard.h 13 Apr 2003 05:24:49 -0000 1.3 --- Bard.h 15 Apr 2003 16:58:30 -0000 1.4 *************** *** 71,75 **** --- 71,81 ---- Bard (ogs::core::XP::Level xpLevel = 1); + /** + * An array of spell counts. Each element in the array represents + * the number of spells for that spell level. The spell level is + * the same as the index of the array. + */ typedef std::vector<unsigned> SpellCounts; + SpellCounts getSpellsPerDay () const; SpellCounts getSpellsKnown () const; Index: Cleric.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/cclasses/Cleric.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Cleric.h 13 Apr 2003 05:24:49 -0000 1.3 --- Cleric.h 15 Apr 2003 16:58:30 -0000 1.4 *************** *** 71,75 **** --- 71,81 ---- Cleric (ogs::core::XP::Level xpLevel = 1); + /** + * An array of spell counts. Each element in the array represents + * the number of spells for that spell level. The spell level is + * the same as the index of the array. + */ typedef std::vector<unsigned> SpellCounts; + SpellCounts getSpellsPerDay () const; Index: Druid.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/cclasses/Druid.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Druid.h 13 Apr 2003 05:24:49 -0000 1.3 --- Druid.h 15 Apr 2003 16:58:30 -0000 1.4 *************** *** 73,77 **** --- 73,83 ---- Druid (ogs::core::XP::Level xpLevel = 1); + /** + * An array of spell counts. Each element in the array represents + * the number of spells for that spell level. The spell level is + * the same as the index of the array. + */ typedef std::vector<unsigned> SpellCounts; + SpellCounts getSpellsPerDay () const; Index: Paladin.cpp =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/cclasses/Paladin.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Paladin.cpp 13 Apr 2003 05:24:49 -0000 1.5 --- Paladin.cpp 15 Apr 2003 16:58:30 -0000 1.6 *************** *** 67,70 **** --- 67,78 ---- } + inline void + Paladin::addProficiency (ogs::core::Creature& creature, + ogs::core::Feat* feat) { + if (creature.addFeat (*feat)) { + this->_feats.push_back (FeatPtr (feat)); + } + } + /** * Add armor and weapon proficiency feats to creature. Paladins are *************** *** 113,135 **** std::list<Armor::Proficiency>::iterator end = armors.end (); if (std::find (armors.begin (), end, Armor::HEAVY) == end) { ! addProficiency (creature, FeatPtr (ArmorProficiency::createHeavy ())); } if (std::find (armors.begin (), end, Armor::MEDIUM) == end) { ! addProficiency (creature, FeatPtr (ArmorProficiency::createMedium ())); } if (std::find (armors.begin (), end, Armor::LIGHT) == end) { ! addProficiency (creature, FeatPtr (ArmorProficiency::createLight ())); } std::list<Weapon::Proficiency>::iterator wend = weapons.end (); if (std::find (weapons.begin (), wend, Weapon::MARTIAL) == wend) { ! addProficiency (creature, FeatPtr (AllWeapons::createMartial ())); } if (std::find (weapons.begin (), wend, Weapon::SIMPLE) == wend) { ! addProficiency (creature, FeatPtr (AllWeapons::createSimple ())); } } --- 121,145 ---- std::list<Armor::Proficiency>::iterator end = armors.end (); if (std::find (armors.begin (), end, Armor::HEAVY) == end) { ! addProficiency (creature, ArmorProficiency::createHeavy ()); } if (std::find (armors.begin (), end, Armor::MEDIUM) == end) { ! addProficiency (creature, ArmorProficiency::createMedium ()); } if (std::find (armors.begin (), end, Armor::LIGHT) == end) { ! addProficiency (creature, ArmorProficiency::createLight ()); } std::list<Weapon::Proficiency>::iterator wend = weapons.end (); if (std::find (weapons.begin (), wend, Weapon::MARTIAL) == wend) { ! addProficiency (creature, AllWeapons::createMartial ()); } if (std::find (weapons.begin (), wend, Weapon::SIMPLE) == wend) { ! addProficiency (creature, AllWeapons::createSimple ()); } + + // TODO: Add shield proficiency. } *************** *** 181,185 **** itor != this->_feats.end (); ++itor) { FeatPtr featPtr = *itor; ! if (creature.removeFeat (featPtr)) { this->_feats.erase (itor); } --- 191,195 ---- itor != this->_feats.end (); ++itor) { FeatPtr featPtr = *itor; ! if (creature.removeFeat (*featPtr)) { this->_feats.erase (itor); } Index: Paladin.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/cclasses/Paladin.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Paladin.h 13 Apr 2003 05:24:49 -0000 1.3 --- Paladin.h 15 Apr 2003 16:58:31 -0000 1.4 *************** *** 32,36 **** # include <ogs/core/Experience.h> # include <ogs/core/Saves.h> - # include <ogs/core/Types.h> # include <ogs/cclasses/Namespace.h> --- 32,35 ---- *************** *** 88,92 **** class ogs::core::Creature; void addProficiency (ogs::core::Creature& creature, ! ogs::core::FeatPtr featPtr); void addProficiencies (); --- 87,91 ---- class ogs::core::Creature; void addProficiency (ogs::core::Creature& creature, ! ogs::core::Feat* featPtr); void addProficiencies (); *************** *** 95,106 **** void removeDivineGrace (); }; - - inline void - Paladin::addProficiency (ogs::core::Creature& creature, - ogs::core::FeatPtr featPtr) { - if (creature.addFeat (featPtr)) { - this->_feats.push_back (featPtr); - } - } OGS_END_CCLASSES_NAMESPACE --- 94,97 ---- Index: Ranger.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/cclasses/Ranger.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Ranger.h 13 Apr 2003 05:24:49 -0000 1.3 --- Ranger.h 15 Apr 2003 16:58:31 -0000 1.4 *************** *** 74,78 **** --- 74,84 ---- Ranger (ogs::core::XP::Level xpLevel = 1); + /** + * An array of spell counts. Each element in the array represents + * the number of spells for that spell level. The spell level is + * the same as the index of the array. + */ typedef std::vector<unsigned> SpellCounts; + SpellCounts getSpellsPerDay () const; Index: Sorcerer.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/cclasses/Sorcerer.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Sorcerer.h 13 Apr 2003 05:24:49 -0000 1.3 --- Sorcerer.h 15 Apr 2003 16:58:31 -0000 1.4 *************** *** 60,64 **** --- 60,70 ---- Sorcerer (ogs::core::XP::Level xpLevel = 1); + /** + * An array of spell counts. Each element in the array represents + * the number of spells for that spell level. The spell level is + * the same as the index of the array. + */ typedef std::vector<unsigned> SpellCounts; + SpellCounts getSpellsPerDay () const; SpellCounts getSpellsKnown () const; Index: Wizard.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/cclasses/Wizard.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Wizard.h 13 Apr 2003 05:24:49 -0000 1.3 --- Wizard.h 15 Apr 2003 16:58:32 -0000 1.4 *************** *** 79,83 **** --- 79,89 ---- Wizard (ogs::core::XP::Level xpLevel = 1); + /** + * An array of spell counts. Each element in the array represents + * the number of spells for that spell level. The spell level is + * the same as the index of the array. + */ typedef std::vector<unsigned> SpellCounts; + SpellCounts getSpellsPerDay () const; |
From: <ele...@us...> - 2003-04-15 16:59:03
|
Update of /cvsroot/ogs/dist/c++ In directory sc8-pr-cvs1:/tmp/cvs-serv20206/c++ Modified Files: ChangeLog TODO configure.in Log Message: See C++ ChangeLog (Apr 15) for details. Index: ChangeLog =================================================================== RCS file: /cvsroot/ogs/dist/c++/ChangeLog,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** ChangeLog 13 Apr 2003 05:40:27 -0000 1.17 --- ChangeLog 15 Apr 2003 16:58:28 -0000 1.18 *************** *** 1,3 **** --- 1,51 ---- + Tue Apr 15 03:46:35 UTC 2003 Eric Lemings <ele...@us...> + + * configure.in, ogs/creatures/Makefile.am, ogs/Creatures.h, + ogs/creatures/Undeads.h, ogs/creatures/undeads/*: Add package + for undead creatures. + + * doc/Doxyfile.in: Updated to Doxygen 1.3. + + * ogs/Skills.h: Removed old headers. Added new ones. + + * ogs/core/Abilities.h: Added Value type. + + * ogs/core/Creature.*: Use smart pointers only when needed. + Fixed bug for missing abilities. Fixed addSkill() and + addFeat() functions. Add key ability in addSkill() function. + + * ogs/core/Entity.*: Use smart pointers only when needed. + + * ogs/core/Feat.*: Changed static attributes from pure virtual + functions to data members in base class and static constants + in derived classes. + + * ogs/core/Feature.h: Derived from Attachable interface. + + * ogs/core/Saves.h: Removed the rollSave () function. + + * ogs/core/Skill.*: Added default cclass points parameter for + initializing skill rank modifier. + + * ogs/cclasses/Paladin.*: Updated for changes to Creature interface. + + * ogs/classes/*.h: Minor doc updates. + + * ogs/feats/*, ogs/magic/MetamagicFeat.*, ogs/magic/feats/*: + Updates for changes to Feat interface. Made similar changes + in base feat classes. Fixed recursive attachObject() bug. + Temporarily removed BonusFeat from dist. + + * ogs/magic/SpellList.*: Move templates from source to header. + + * ogs/skills/*: Use smart pointers only when needed. Fixed + key ability of Hide skill. Updates for added parameter. + + * test/SupportTest.cpp: Added some copy semantics tests. + + * test/Makefile.am, test/CreatureTest.cpp: Added test for + creatures (using humans and wraiths as test subjects). + Sun Apr 13 04:24:59 UTC 2003 Eric Lemings <ele...@us...> Index: TODO =================================================================== RCS file: /cvsroot/ogs/dist/c++/TODO,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** TODO 13 Apr 2003 05:40:27 -0000 1.10 --- TODO 15 Apr 2003 16:58:28 -0000 1.11 *************** *** 12,21 **** items in the section that follows. ! * Make Size class a nested class of Entity? ! * Separate ability methods into their own Methods.h header? * Put version information in top-level ogs namespace. ! * Add more test drivers. Future Minor Releases --- 12,21 ---- items in the section that follows. ! * Add more test drivers, namely saves, defense, skills, and feats. * Put version information in top-level ogs namespace. ! * Make Size class a nested class of Entity? ! * Separate ability methods into their own Methods.h header? Future Minor Releases *************** *** 27,30 **** --- 27,33 ---- * Implement more cclasses, more creatures, more items, more skills, more feats, and more spells! + + * Add more test drivers, namely creatures, cclasses, characters, items, + and body parts. * Add interface to Defense class for determining defense when Index: configure.in =================================================================== RCS file: /cvsroot/ogs/dist/c++/configure.in,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** configure.in 13 Apr 2003 05:40:27 -0000 1.13 --- configure.in 15 Apr 2003 16:58:28 -0000 1.14 *************** *** 119,122 **** --- 119,123 ---- ogs/creatures/Makefile ogs/creatures/humanoids/Makefile + ogs/creatures/undeads/Makefile ogs/feats/Makefile ogs/items/Makefile |
From: <ele...@us...> - 2003-04-15 16:59:03
|
Update of /cvsroot/ogs/dist In directory sc8-pr-cvs1:/tmp/cvs-serv20206 Modified Files: ChangeLog NEWS README Log Message: See C++ ChangeLog (Apr 15) for details. Index: ChangeLog =================================================================== RCS file: /cvsroot/ogs/dist/ChangeLog,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** ChangeLog 4 Apr 2003 20:22:38 -0000 1.27 --- ChangeLog 15 Apr 2003 16:58:26 -0000 1.28 *************** *** 1,3 **** --- 1,7 ---- + Tue Apr 15 04:44:20 UTC 2003 + + * README, NEWS: Updated. + Thu Apr 3 22:35:57 UTC 2003 Eric Lemings <ele...@us...> Index: NEWS =================================================================== RCS file: /cvsroot/ogs/dist/NEWS,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** NEWS 27 Feb 2003 01:24:36 -0000 1.5 --- NEWS 15 Apr 2003 16:58:26 -0000 1.6 *************** *** 1,9 **** ! This release contains a whole new API for C++ and Java. The C API has ! not changed since the last release. (This includes some design changes ! that have been integrated into the new API for C++ and Java but not yet ! into the C API. The C API will be updated in a future release.) Please ! note that the brand new API for C++ and Java API is just that: brand ! new. The design and implementation are bound to change over the course ! of future releases. --- 1,21 ---- ! Release Notes ! ------------- ! ! The API continues to evolve but there's still plenty of room for ! improvement. Most of the work for this release is being done in the C++ ! API. The Library Support package and the component classes (modifiers, ! die, saves, defense, abilities) of the Core Rules package are not ! expected to change much in the future. Test drivers have been written ! for the core components. The composite classes (entities, creatures, ! cclasses, items, characters) are still changing rapidly. The Java API ! is being kept more or less in sync with C++. Not much work has been ! recently done on the C API. ! ! The API now contains a few elements of fantasy campaign settings and ! game worlds. These elements have been added as models for implementing ! more elements but, more importantly, for testing the core rules. Once ! the core rules have been extensively tested (more or less), then more ! elements can be added and the combat and magic systems should have a ! fairly stable design and implementation to build on. Index: README =================================================================== RCS file: /cvsroot/ogs/dist/README,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** README 19 Feb 2003 20:18:00 -0000 1.6 --- README 15 Apr 2003 16:58:26 -0000 1.7 *************** *** 1,6 **** ! Open Gaming System (OGS) ! Version 0.1.0 (??-???-2003) Introduction --- 1,13 ---- ! "I desired to do this for my own satisfaction, and I had little ! hope that other people would be interested in this work, ..." + J.R.R. Tokien, + Forward to the Second Edition of + The Lord of the Rings + + + Open Gaming System (OGS) + Version 0.1.1 (Apr 20 2003) Introduction |
From: <ele...@us...> - 2003-04-15 16:59:03
|
Update of /cvsroot/ogs/dist/c++/ogs In directory sc8-pr-cvs1:/tmp/cvs-serv20206/c++/ogs Modified Files: Creatures.h Skills.h Log Message: See C++ ChangeLog (Apr 15) for details. Index: Creatures.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/Creatures.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Creatures.h 25 Mar 2003 06:13:10 -0000 1.2 --- Creatures.h 15 Apr 2003 16:58:29 -0000 1.3 *************** *** 25,28 **** --- 25,29 ---- # include <ogs/creatures/Humanoids.h> + # include <ogs/creatures/Undeads.h> #endif /* !defined OGS_CREATURES_H */ Index: Skills.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/Skills.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Skills.h 13 Apr 2003 05:28:46 -0000 1.3 --- Skills.h 15 Apr 2003 16:58:29 -0000 1.4 *************** *** 24,52 **** # define OGS_SKILLS_H ! //# include <ogs/skills/Appraise.h> ! //# include <ogs/skills/Bluff.h> ! //# include <ogs/skills/Climb.h> ! //# include <ogs/skills/Craft.h> ! # include <ogs/skills/Diplomacy.h> ! //# include <ogs/skills/DisableDevice.h> ! //# include <ogs/skills/Disguise.h> ! //# include <ogs/skills/EscapeArtist.h> ! //# include <ogs/skills/Forgery.h> ! //# include <ogs/skills/GatherInformation.h> ! //# include <ogs/skills/HandleAnimal.h> ! //# include <ogs/skills/Hide.h> ! //# include <ogs/skills/Intimidate.h> ! //# include <ogs/skills/Jump.h> ! //# include <ogs/skills/Knowledge.h> ! //# include <ogs/skills/Listen.h> ! //# include <ogs/skills/MoveSilently.h> ! //# include <ogs/skills/Profession.h> ! //# include <ogs/skills/Ride.h> ! //# include <ogs/skills/Search.h> ! //# include <ogs/skills/SenseMotive.h> ! //# include <ogs/skills/SpeakLanguage.h> ! //# include <ogs/skills/Spot.h> ! # include <ogs/skills/Swim.h> ! //# include <ogs/skills/Tumble.h> #endif /* !defined OGS_SKILLS_H */ --- 24,30 ---- # define OGS_SKILLS_H ! # include <ogs/skills/CommonSkills.h> ! # include <ogs/skills/SkillFactory.h> ! # include <ogs/skills/Spot.h> #endif /* !defined OGS_SKILLS_H */ |
From: <ele...@us...> - 2003-04-15 16:59:02
|
Update of /cvsroot/ogs/dist/c++/doc In directory sc8-pr-cvs1:/tmp/cvs-serv20206/c++/doc Modified Files: Doxyfile.in Log Message: See C++ ChangeLog (Apr 15) for details. Index: Doxyfile.in =================================================================== RCS file: /cvsroot/ogs/dist/c++/doc/Doxyfile.in,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Doxyfile.in 13 Apr 2003 05:31:56 -0000 1.1 --- Doxyfile.in 15 Apr 2003 16:58:28 -0000 1.2 *************** *** 1,3 **** ! # Doxyfile 1.2.18 # This file describes the settings to be used by the documentation system --- 1,3 ---- ! # Doxyfile 1.3 # This file describes the settings to be used by the documentation system *************** *** 44,47 **** --- 44,57 ---- OUTPUT_LANGUAGE = English + # This tag can be used to specify the encoding used in the generated output. + # The encoding is not always determined by the language that is chosen, + # but also whether or not the output is meant for Windows or non-Windows users. + # In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES + # forces the Windows enconding, (this is the default for the Windows binary), + # whereas setting the tag to NO uses a Unix-style encoding (the default for the + # all platforms other than Windows). + + USE_WINDOWS_ENCODING = NO + # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. *************** *** 89,92 **** --- 99,109 ---- HIDE_FRIEND_COMPOUNDS = NO + # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any + # documentation blocks found inside the body of a function. + # If set to NO (the default) these blocks will be appended to the + # function's detailed documentation block. + + HIDE_IN_BODY_DOCS = NO + # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in *************** *** 136,145 **** INTERNAL_DOCS = NO - # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct - # doxygen to hide any special comment blocks from generated source code - # fragments. Normal C and C++ comments will always remain visible. - - STRIP_CODE_COMMENTS = YES - # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower case letters. If set to YES upper case letters are also --- 153,156 ---- *************** *** 246,250 **** # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or ! # disable (NO) the deprecated list. This list is created by putting \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES --- 257,262 ---- # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or ! # disable (NO) the deprecated list. This list is created by putting ! # \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES *************** *** 315,318 **** --- 327,337 ---- WARN_IF_UNDOCUMENTED = YES + # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for + # potential errors in the documentation, such as not documenting some + # parameters in a documented function, or documenting parameters that + # don't exist or using markup commands wrongly. + + WARN_IF_DOC_ERROR = YES + # The WARN_FORMAT tag determines the format of the warning messages that # doxygen can produce. The string should contain the $file, $line, and $text *************** *** 444,447 **** --- 463,472 ---- INLINE_SOURCES = NO + # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct + # doxygen to hide any special comment blocks from generated source code + # fragments. Normal C and C++ comments will always remain visible. + + STRIP_CODE_COMMENTS = YES + # If the REFERENCED_BY_RELATION tag is set to YES (the default) # then for each documented function all documented *************** *** 577,584 **** # generated containing a tree-like index structure (just like the one that # is generated for HTML Help). For this to work a browser that supports ! # JavaScript and frames is required (for instance Mozilla, Netscape 4.0+, ! # or Internet explorer 4.0+). Note that for large projects the tree generation ! # can take a very long time. In such cases it is better to disable this feature. ! # Windows users are probably better off using the HTML help feature. GENERATE_TREEVIEW = NO --- 602,608 ---- # generated containing a tree-like index structure (just like the one that # is generated for HTML Help). For this to work a browser that supports ! # JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, ! # Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are ! # probably better off using the HTML help feature. GENERATE_TREEVIEW = NO *************** *** 605,609 **** LATEX_OUTPUT = latex ! # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be invoked. If left blank `latex' will be used as the default command name. LATEX_CMD_NAME = latex --- 629,634 ---- LATEX_OUTPUT = latex ! # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be ! # invoked. If left blank `latex' will be used as the default command name. LATEX_CMD_NAME = latex *************** *** 659,662 **** --- 684,693 ---- LATEX_BATCHMODE = NO + # If LATEX_HIDE_INDICES is set to YES then doxygen will not + # include the index chapters (such as File Index, Compound Index, etc.) + # in the output. + + LATEX_HIDE_INDICES = NO + #--------------------------------------------------------------------------- # configuration options related to the RTF output *************** *** 766,769 **** --- 797,833 ---- #--------------------------------------------------------------------------- + # configuration options related to the Perl module output + #--------------------------------------------------------------------------- + + # If the GENERATE_PERLMOD tag is set to YES Doxygen will + # generate a Perl module file that captures the structure of + # the code including all documentation. Note that this + # feature is still experimental and incomplete at the + # moment. + + GENERATE_PERLMOD = NO + + # If the PERLMOD_LATEX tag is set to YES Doxygen will generate + # the necessary Makefile rules, Perl scripts and LaTeX code to be able + # to generate PDF and DVI output from the Perl module output. + + PERLMOD_LATEX = NO + + # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be + # nicely formatted so it can be parsed by a human reader. This is useful + # if you want to understand what is going on. On the other hand, if this + # tag is set to NO the size of the Perl module output will be much smaller + # and Perl will parse it just the same. + + PERLMOD_PRETTY = YES + + # The names of the make variables in the generated doxyrules.make file + # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. + # This is useful so different doxyrules.make files included by the same + # Makefile don't overwrite each other's variables. + + PERLMOD_MAKEVAR_PREFIX = + + #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- *************** *** 797,801 **** # the preprocessor. ! INCLUDE_PATH = .. # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard --- 861,865 ---- # the preprocessor. ! INCLUDE_PATH = @top_srcdir@ # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard *************** *** 814,818 **** PREDEFINED = __cplusplus ! # If the MACRO_EXPANSION and EXPAND_PREDEF_ONLY tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. --- 878,882 ---- PREDEFINED = __cplusplus ! # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. *************** *** 833,837 **** #--------------------------------------------------------------------------- ! # The TAGFILES tag can be used to specify one or more tagfiles. TAGFILES = --- 897,914 ---- #--------------------------------------------------------------------------- ! # The TAGFILES option can be used to specify one or more tagfiles. ! # Optionally an initial location of the external documentation ! # can be added for each tagfile. The format of a tag file without ! # this location is as follows: ! # TAGFILES = file1 file2 ... ! # Adding location for the tag files is done as follows: ! # TAGFILES = file1=loc1 "file2 = loc2" ... ! # where "loc1" and "loc2" can be relative or absolute paths or ! # URLs. If a location is present for each tag, the installdox tool ! # does not have to be run to correct the links. ! # Note that each tag file must have a unique name ! # (where the name does NOT include the path) ! # If a tag file is not located in the directory in which doxygen ! # is run, you must also specify the path to the tagfile here. TAGFILES = *************** *** 954,957 **** --- 1031,1045 ---- MAX_DOT_GRAPH_HEIGHT = 1024 + + # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the + # graphs generated by dot. A depth value of 3 means that only nodes reachable + # from the root by following a path via at most 3 edges will be shown. Nodes that + # lay further from the root node will be omitted. Note that setting this option to + # 1 or 2 may greatly reduce the computation time needed for large code bases. Also + # note that a graph may be further truncated if the graph's image dimensions are + # not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH and MAX_DOT_GRAPH_HEIGHT). + # If 0 is used fot the depth value (the default), the graph is not depth constraint. + + MAX_DOT_GRAPH_DEPTH = 0 # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will |
From: <ele...@us...> - 2003-04-15 16:58:45
|
Update of /cvsroot/ogs/dist/c++/ogs/creatures/undeads In directory sc8-pr-cvs1:/tmp/cvs-serv20206/c++/ogs/creatures/undeads Added Files: Makefile.am Namespace.h Wraith.cpp Wraith.h Log Message: See C++ ChangeLog (Apr 15) for details. --- NEW FILE: Makefile.am --- ## ## Makefile.am -- Automake file for Open Gaming System (OGS) ## Copyright (C) 2003 Eric Lemings <ele...@us...> ## ## This software is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License ## as published by the Free Software Foundation; either version 2 ## of the License, or (at your option) any later version. ## ## This software is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this software; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, ## USA ## ## RCS: $Id: Makefile.am,v 1.1 2003/04/15 16:58:40 elemings Exp $ ## pkgincludedir = $(includedir)/ogs/creatures/undeads pkginclude_HEADERS = \ Namespace.h \ Wraith.h INCLUDES = \ -I$(top_srcdir) \ -I$(top_builddir) \ -I$(top_srcdir)/intl noinst_LTLIBRARIES = libogs-undeads.la localedir = $(datadir)/locale libogs_undeads_la_DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ libogs_undeads_la_SOURCES = \ Wraith.cpp --- NEW FILE: Namespace.h --- /* * Namespace.h -- namespace for undead creatures * Copyright (C) 2002 Eric Lemings <ele...@us...> * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this software; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA * * RCS: $Id: Namespace.h,v 1.1 2003/04/15 16:58:40 elemings Exp $ */ #ifdef __cplusplus # ifndef OGS_CREATURES_UNDEADS_NAMESPACE_H # define OGS_CREATURES_UNDEADS_NAMESPACE_H # include <ogs/creatures/Namespace.h> /** * @namespace ogs::creatures::undeads * * A collection of restless undead creatures. */ # define OGS_BEGIN_CREATURES_UNDEADS_NAMESPACE \ OGS_BEGIN_CREATURES_NAMESPACE \ namespace undeads { # define OGS_END_CREATURES_UNDEADS_NAMESPACE \ } \ OGS_END_CREATURES_NAMESPACE # endif /* !defined OGS_CREATURES_UNDEADS_NAMESPACE_H */ #endif /* defined __cplusplus */ --- NEW FILE: Wraith.cpp --- /* * Wraith.cpp -- class implementation for wraiths * Copyright (C) 2003 Eric Lemings <ele...@us...> * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this software; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA * * RCS: $Id: Wraith.cpp,v 1.1 2003/04/15 16:58:40 elemings Exp $ */ #include "ogs/core/Abilities.h" #include "ogs/core/Die.h" #include "ogs/core/Modifier.h" #include "ogs/core/Skill.h" #include "ogs/core/details/Alignment.h" #include "ogs/Skills.h" #include "ogs/feats/Alertness.h" #include "ogs/feats/ImprovedInitiative.h" //#include "ogs/combat/feats/BlindFighting.h" //#include "ogs/combat/feats/CombatReflexes.h" #include "ogs/creatures/Undead.h" #include "ogs/creatures/undeads/Wraith.h" using ogs::core::Abilities; using ogs::core::Die; using ogs::core::Modifier; using ogs::core::Skill; using ogs::creatures::undeads::Wraith; using ogs::skills::SkillFactory; /** * Create a hit dice object for this type of creature. The die object * is created within the range of hit dice for this type of creature. * * @param hitDieCount Number of hit die to create. * @return A hit dice object. */ Die Wraith::createHitDice (Die::Count hitDieCount) { if (hitDieCount < DEFAULT_HIT_DIE_COUNT) { hitDieCount = DEFAULT_HIT_DIE_COUNT; } else if (hitDieCount > MAXIMUM_HIT_DIE_COUNT) { hitDieCount = MAXIMUM_HIT_DIE_COUNT; } using ogs::creatures::Undead; return (Die (Undead::HIT_DIE, hitDieCount)); } /** * Create a set of abilities for this type of creature. * * @return A set of abilities for this type of creature. */ Abilities Wraith::createAbilities () { using ogs::core::Ability; Abilities::PartialMethod::Value dex (Ability::DEX, 16); Abilities::PartialMethod::Value intl (Ability::INT, 14); Abilities::PartialMethod::Value wis (Ability::WIS, 14); Abilities::PartialMethod::Value cha (Ability::CHA, 15); Abilities::PartialMethod::Value values [] = { dex, intl, wis, cha }; Abilities::PartialMethod partialMethod (& values [0], & values [4]); return (Abilities (partialMethod)); } /** * Create a new wraith. Wraiths normally use 5d12 for hit dice although * exceptional specimens can have up to 10d12 hit dice. If the given * hit dice is outside this range, this constructor will round off to * the nearest value. * * @param hitDieCount Number of hit dice of the wraith. */ Wraith::Wraith (Die::Count hitDieCount): Undead (createHitDice (hitDieCount), createAbilities ()) { using ogs::skills::CommonSkills; CommonSkills commonSkills; addSkill (*(commonSkills.createSkill (CommonSkills::HIDE, +8))); addSkill (*(commonSkills.createSkill (CommonSkills::INTIMIDATE, +8))); //addSkill (*(commonSkills.createSkill (CommonSkills::INTUIT_DIRECTION, +6 (total)))); addSkill (*(commonSkills.createSkill (CommonSkills::LISTEN, +8))); addSkill (*(commonSkills.createSkill (CommonSkills::SEARCH, +8))); addSkill (*(commonSkills.createSkill (CommonSkills::SENSE_MOTIVE, +6))); addSkill (*(commonSkills.createSkill (CommonSkills::SPOT, +8))); using ogs::feats::Alertness; using ogs::feats::ImprovedInitiative; //using ogs::combat::feats::BlindFighting; //using ogs::combat::feats::CombatReflexes; addFeat (*(new Alertness ())); addFeat (*(new ImprovedInitiative ())); //addFeat (new BlindFighting ()); //addFeat (new CombatReflexes ()); using ogs::core::details::Alignment; addFeature (*(new Alignment (Alignment::LAWFUL_EVIL))); } --- NEW FILE: Wraith.h --- /* * Wraith.h -- class interface for wraiths * Copyright (C) 2003 Eric Lemings <ele...@us...> * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this software; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA * * RCS: $Id: Wraith.h,v 1.1 2003/04/15 16:58:40 elemings Exp $ */ #ifdef __cplusplus # ifndef OGS_CREATURES_UNDEADS_WRAITH_H # define OGS_CREATURES_UNDEADS_WRAITH_H # include <map> # include <boost/shared_ptr.hpp> # include <ogs/core/Abilities.h> # include <ogs/core/Die.h> # include <ogs/core/Skill.h> # include <ogs/skills/SkillFactory.h> # include <ogs/creatures/Undead.h> # include <ogs/creatures/undeads/Namespace.h> OGS_BEGIN_CREATURES_UNDEADS_NAMESPACE using ogs::core::Die; /** * An incorporeal undead creature composed of darkness and evil. A * wraith appears vaguely humanoid in shape with two glowing red eyes. * Some may carry some semblance of their former life but this has no * effect on their abilities. Their touch is deadly as it permanently * drains Constitution from living creatures and those unfortunate souls * slain by a wraith will themselves rise as undead in a matter of * seconds. Natural daylight (not from magic) however renders them * totally powerless and they will flee in fear from it. Wraiths also * radiate an unnatural aura such that all animals (wild or domestic) * within 30 ft. can automatically sense their presence. */ class Wraith: public ogs::creatures::Undead { public: Wraith (Die::Count hitDieCount = DEFAULT_HIT_DIE_COUNT); protected: static const Die::Count DEFAULT_HIT_DIE_COUNT = 5; static const Die::Count MAXIMUM_HIT_DIE_COUNT = 10; static Die createHitDice (Die::Count hitDieCount); static ogs::core::Abilities createAbilities (); }; OGS_END_CREATURES_UNDEADS_NAMESPACE # endif /* !defined OGS_CREATURES_UNDEADS_WRAITH_H */ #endif /* defined __cplusplus */ |
From: <ele...@us...> - 2003-04-15 03:28:50
|
Update of /cvsroot/ogs/dist/c++/ogs/creatures/undeads In directory sc8-pr-cvs1:/tmp/cvs-serv10662/undeads Log Message: Directory /cvsroot/ogs/dist/c++/ogs/creatures/undeads added to the repository |
From: <ele...@us...> - 2003-04-13 05:40:30
|
Update of /cvsroot/ogs/dist/c++ In directory sc8-pr-cvs1:/tmp/cvs-serv12475/c++ Modified Files: ChangeLog Makefile.am TODO configure.in Log Message: See C++ ChangeLog (Apr 13) for details. Index: ChangeLog =================================================================== RCS file: /cvsroot/ogs/dist/c++/ChangeLog,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ChangeLog 8 Apr 2003 21:43:04 -0000 1.16 --- ChangeLog 13 Apr 2003 05:40:27 -0000 1.17 *************** *** 1,3 **** --- 1,69 ---- + Sun Apr 13 04:24:59 UTC 2003 Eric Lemings <ele...@us...> + + * Makefile.am, configure.in, ogs/Makefile.am: Moved doc target + and Doxyfile.in from ogs directory to doc directory. Added + doc/Makefile.am file. + + * ogs/Core.h, ogs/core/Makefile.am, ogs/core/Types.h: Added + header for common types that do not require class definitions. + Updated lots of files to use new types. + + * ogs/cclasses/*.h, ogs/cclassee/Paladin.cpp: Updated for new + CClass interface changes. Removed inline spell count functions + since the actual implementations probably won't be inlined. + Added weapon proficiencies to Paladin implementation. + + * ogs/core/Abilities.h, test/AbilitiesTest.cpp: Fixed partial + method. + + * ogs/core/Ability.*: Added ability events. + + * ogs/core/BodyPart.*, ogs/core/Character.*: Changed creature + references to pointers. Inlined BodyPart constructor. Added + BodyPart::getCreature inline function. + + * ogs/core/CClass.*: Moved hit die and skill rate up to base + class. Rewrote constructor so modifiers could be initialized + from derived classes and, at the same time, be updated when + the XP level changes. Modelled implementations of Attachable + functions after Feature class. + + * ogs/core/Creature.h, ogs/Humanoid.*, ogs/core/humanoids/Human.*: + Changed body from list of body part pointers to body part + objects. Changed body parameter in constructor to a vector of + part types to allow derived classes to tell the Creature + constructor how to construct the creature's body without a + reference to the object (which derived classes don't have but + the Creature constructor body does). + + * ogs/core/Defense.*: Derived class from Modifiers instead of + using them as a component. + + * ogs/core/Entity.*, ogs/combat/Combatant.h, : Changed current + and maximum health into a pair of Health values. Added + functions for adding/removing features to/from entities. + + * ogs/core/Experience.h: Added XP alias and changed lots of + files to utiliize shorter name. + + * ogs/core/Modifiers.*: Derived class from STL list. Made + event constructor protected so it could be used by ability + events. + + * ogs/core/Skill.*: Changed class from abstract to concrete to + allow use of "generic" skills. + + * ogs/core/details/Gender.h: Added missing inline keyword. + + * ogs/skills/SkillFactory.h, ogs/skills/CommonSkills.*, + ogs/skills/Makefile.am: Added new files. + + * ogs/skills/Spot.*, ogs/feats/*.cpp: Updated with new skill + classes and smart pointers. + + * ogs/spells/conjurations/CurewWounds.*: Updated with Entity + health pair. + Tue Apr 8 19:59:15 UTC 2003 Eric Lemings <ele...@us...> Index: Makefile.am =================================================================== RCS file: /cvsroot/ogs/dist/c++/Makefile.am,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Makefile.am 4 Apr 2003 20:22:40 -0000 1.8 --- Makefile.am 13 Apr 2003 05:40:27 -0000 1.9 *************** *** 30,34 **** # target so that the target is run in the current directory AFTER # it is run in the po directory. (Automake reverses the order.) ! SUBDIRS = . m4 po ogs test EXTRA_DIST = \ --- 30,34 ---- # target so that the target is run in the current directory AFTER # it is run in the po directory. (Automake reverses the order.) ! SUBDIRS = . m4 po ogs test doc EXTRA_DIST = \ *************** *** 39,43 **** if HAVE_DOXYGEN doc: ! @subdir=ogs; \ echo "Making $@ in $$subdir"; \ cd $$subdir && make $@ || exit 1 --- 39,43 ---- if HAVE_DOXYGEN doc: ! @subdir=doc; \ echo "Making $@ in $$subdir"; \ cd $$subdir && make $@ || exit 1 Index: TODO =================================================================== RCS file: /cvsroot/ogs/dist/c++/TODO,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** TODO 4 Apr 2003 20:22:40 -0000 1.9 --- TODO 13 Apr 2003 05:40:27 -0000 1.10 *************** *** 12,25 **** items in the section that follows. ! * Put all includes of OGS headers in quotes in source files so that ! previously installed versions are not included by mistake. Also ! use full path name of header file. ! ! * Review each header file and use forward declarations instead of ! include directives wherever possible. ! * Declare virtual destructors for base classes. ! * Make Size class a nested class of Entity? Future Minor Releases --- 12,21 ---- items in the section that follows. ! * Make Size class a nested class of Entity? ! * Separate ability methods into their own Methods.h header? ! * Put version information in top-level ogs namespace. ! * Add more test drivers. Future Minor Releases *************** *** 29,40 **** the items in the section above. ! * Require Boost library? Lots of stuff from this library is being ! integrated into the next revision of Standard C++ anyway. ! ! * Add smart pointers. ! ! * Put version information in top-level ogs namespace. ! * Define interface in Humanoid class for equiping items. * Add effective character level (ECL) to Creature class. --- 25,34 ---- the items in the section above. ! * Implement more cclasses, more creatures, more items, more skills, ! more feats, and more spells! ! * Add interface to Defense class for determining defense when ! flat-footed (no Dex mod) or for touch attacks (no Armor mod). Does ! the class really need that base value attribute? Is it *always* 10? * Add effective character level (ECL) to Creature class. *************** *** 42,45 **** * Remove standard include and library search paths if possible when building test drivers or at least make sure the local search paths ! are searched first.. --- 36,46 ---- * Remove standard include and library search paths if possible when building test drivers or at least make sure the local search paths ! are searched first. ! ! Planned Major Releases ! ---------------------- ! ! * Design, implement, and test a virtual combat simulation engine. (The ! current contents of the ogs::combat namespace are the veritable tip of ! the iceberg.) Index: configure.in =================================================================== RCS file: /cvsroot/ogs/dist/c++/configure.in,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** configure.in 8 Apr 2003 21:43:05 -0000 1.12 --- configure.in 13 Apr 2003 05:40:27 -0000 1.13 *************** *** 107,111 **** m4/Makefile ogs/Makefile - ogs/Doxyfile ogs/support/Makefile ogs/core/Makefile --- 107,110 ---- *************** *** 128,131 **** --- 127,132 ---- ogs/spells/conjurations/Makefile test/Makefile + doc/Makefile + doc/Doxyfile ]) |