ogs-changes Mailing List for Open Gaming System (Page 6)
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-03-29 02:31:43
|
Update of /cvsroot/ogs/dist/c++/ogs In directory sc8-pr-cvs1:/tmp/cvs-serv2092/c++/ogs Modified Files: Makefile.am Log Message: See C++ ChangeLog (Mar 28) for details. Index: Makefile.am =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/Makefile.am,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Makefile.am 29 Mar 2003 02:10:25 -0000 1.7 --- Makefile.am 29 Mar 2003 02:31:34 -0000 1.8 *************** *** 82,93 **** spells/libogs-spells.la - docdir = $(top_builddir)/doc - if HAVE_DOXYGEN - $(docdir): - @mkdir $(docdir) - doc: $(docdir) - $(DOXYGEN) - else - doc: - endif - --- 82,83 ---- |
|
From: <ele...@us...> - 2003-03-29 02:11:10
|
Update of /cvsroot/ogs/dist/c++/ogs/creatures/humanoids
In directory sc8-pr-cvs1:/tmp/cvs-serv24985/creatures/humanoids
Modified Files:
Human.h Makefile.am Namespace.h
Added Files:
Human.cpp
Log Message:
See C++ ChangeLog (Mar 28) for details.
--- NEW FILE: Human.cpp ---
/*
* Human.cpp -- class implementation for humans
* 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: Human.cpp,v 1.1 2003/03/29 02:10:35 elemings Exp $
*/
#include "ogs/core/Die.h"
#include "ogs/creatures/humanoids/Human.h"
using ogs::core::Die;
using ogs::creatures::humanoids::Human;
Die Human::_maximumAge (Die::d20, 2);
Index: Human.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/creatures/humanoids/Human.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Human.h 23 Mar 2003 22:14:36 -0000 1.1
--- Human.h 29 Mar 2003 02:10:35 -0000 1.2
***************
*** 23,34 ****
#ifdef __cplusplus
! # ifndef OGS_HUMAN_H
! # define OGS_HUMAN_H
# include <ogs/core/details/Maturity.h>
# include <ogs/creatures/Humanoid.h>
! # include <ogs/creatures/Namespace.h>
! OGS_BEGIN_CREATURES_NAMESPACE
/**
--- 23,35 ----
#ifdef __cplusplus
! # ifndef OGS_CREATURES_HUMANOIDS_HUMAN_H
! # define OGS_CREATURES_HUMANOIDS_HUMAN_H
+ # include <ogs/core/Die.h>
# include <ogs/core/details/Maturity.h>
# include <ogs/creatures/Humanoid.h>
! # include <ogs/creatures/humanoids/Namespace.h>
! OGS_BEGIN_CREATURES_HUMANOIDS_NAMESPACE
/**
***************
*** 41,45 ****
* level.
*
! * Human can exist in any campaign setting.
*/
class Human: public ogs::creatures::Humanoid,
--- 42,46 ----
* level.
*
! * Humans can exist in any campaign setting.
*/
class Human: public ogs::creatures::Humanoid,
***************
*** 47,66 ****
public:
unsigned getAdultAge () const;
- const Die& getStartingAge () const;
unsigned getMiddleAge () const;
unsigned getOldAge () const;
unsigned getVenerableAge () const;
! const Die& getMaximumAge () const;
!
! protected:
private:
! static Die _startingAge;
! static Die _maximumAge;
};
/**
* Determine the average adult age for this type of creature. The
* adult age for humans is 15 years.
--- 48,72 ----
public:
+ Human ();
+
unsigned getAdultAge () const;
unsigned getMiddleAge () const;
unsigned getOldAge () const;
unsigned getVenerableAge () const;
! const ogs::core::Die& getMaximumAge () const;
private:
! static ogs::core::Die _maximumAge;
};
/**
+ * Create a new human creature.
+ */
+ inline Human::Human () {
+ // empty constructor body
+ }
+
+ /**
* Determine the average adult age for this type of creature. The
* adult age for humans is 15 years.
***************
*** 73,86 ****
/**
- * Access the die used to roll a random starting age for a PC. The die
- * used to roll starting ages for humans is 1d4.
- *
- * @return 1d4
- */
- inline const Die& Human::getStartingAge () const {
- return (_startingAge);
- }
-
- /**
* Determine the average middle age for this type of creature. The
* middle age for humans is 35 years.
--- 79,82 ----
***************
*** 118,128 ****
* @return 2d20
*/
! inline const Die& Human::getMaximumAge () const {
return (_maximumAge);
}
! OGS_END_CREATURES_NAMESPACE
! # endif /* !defined OGS_HUMAN_H */
#endif /* defined __cplusplus */
--- 114,124 ----
* @return 2d20
*/
! inline const ogs::core::Die& Human::getMaximumAge () const {
return (_maximumAge);
}
! OGS_END_CREATURES_HUMANOIDS_NAMESPACE
! # endif /* !defined OGS_CREATURES_HUMANOIDS_HUMAN_H */
#endif /* defined __cplusplus */
Index: Makefile.am
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/creatures/humanoids/Makefile.am,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Makefile.am 23 Mar 2003 22:14:36 -0000 1.1
--- Makefile.am 29 Mar 2003 02:10:35 -0000 1.2
***************
*** 41,44 ****
localedir = $(datadir)/locale
libogs_humanoids_la_DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
! libogs_humanoids_la_SOURCES =
--- 41,45 ----
localedir = $(datadir)/locale
libogs_humanoids_la_DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
! libogs_humanoids_la_SOURCES = \
! Human.cpp
Index: Namespace.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/creatures/humanoids/Namespace.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Namespace.h 23 Mar 2003 22:14:36 -0000 1.1
--- Namespace.h 29 Mar 2003 02:10:35 -0000 1.2
***************
*** 31,43 ****
* @namespace ogs::creatures::humanoids
*
! * A set of common humanoid creatures.
*/
# define OGS_BEGIN_CREATURES_HUMANOIDS_NAMESPACE \
! OGS_BEGIN_NAMESPACE \
! namespace creatures {
# define OGS_END_CREATURES_HUMANOIDS_NAMESPACE \
} \
! OGS_END_NAMESPACE
# endif /* !defined OGS_CREATURES_HUMANOIDS_NAMESPACE_H */
--- 31,43 ----
* @namespace ogs::creatures::humanoids
*
! * A collection of common humanoid creatures.
*/
# define OGS_BEGIN_CREATURES_HUMANOIDS_NAMESPACE \
! OGS_BEGIN_CREATURES_NAMESPACE \
! namespace humanoids {
# define OGS_END_CREATURES_HUMANOIDS_NAMESPACE \
} \
! OGS_END_CREATURES_NAMESPACE
# endif /* !defined OGS_CREATURES_HUMANOIDS_NAMESPACE_H */
|
|
From: <ele...@us...> - 2003-03-29 02:11:09
|
Update of /cvsroot/ogs/dist/c++/ogs/creatures
In directory sc8-pr-cvs1:/tmp/cvs-serv24985/creatures
Modified Files:
Humanoid.h Makefile.am
Added Files:
Humanoid.cpp
Removed Files:
Human.cpp Human.h
Log Message:
See C++ ChangeLog (Mar 28) for details.
Index: Humanoid.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/creatures/Humanoid.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Humanoid.h 5 Feb 2003 06:01:28 -0000 1.2
--- Humanoid.h 29 Mar 2003 02:10:34 -0000 1.3
***************
*** 1,4 ****
/*
! * Humanoid.h -- class interface for humanoids
* Copyright (C) 2002 Eric Lemings <ele...@us...>
*
--- 1,4 ----
/*
! * Humanoid.h -- class interface for humanoid creatures
* Copyright (C) 2002 Eric Lemings <ele...@us...>
*
***************
*** 23,28 ****
#ifdef __cplusplus
! # ifndef OGS_HUMANOID_H
! # define OGS_HUMANOID_H
# include <ogs/core/Creature.h>
--- 23,28 ----
#ifdef __cplusplus
! # ifndef OGS_CREATURES_HUMANOID_H
! # define OGS_CREATURES_HUMANOID_H
# include <ogs/core/Creature.h>
***************
*** 32,47 ****
/**
! * A creature with human-like shape.
*/
class Humanoid: public ogs::core::Creature {
! protected:
!
! private:
};
OGS_END_CREATURES_NAMESPACE
! # endif /* !defined OGS_HUMANOID_H */
#endif /* defined __cplusplus */
--- 32,48 ----
/**
! * A creature with qualities similar to a human.
*/
class Humanoid: public ogs::core::Creature {
! public:
! static Body createBody (Creature& creature);
+ protected:
+ Humanoid ();
};
OGS_END_CREATURES_NAMESPACE
! # endif /* !defined OGS_CREATURES_HUMANOID_H */
#endif /* defined __cplusplus */
Index: Makefile.am
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/creatures/Makefile.am,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Makefile.am 23 Mar 2003 22:14:36 -0000 1.3
--- Makefile.am 29 Mar 2003 02:10:34 -0000 1.4
***************
*** 40,43 ****
localedir = $(datadir)/locale
libogs_creatures_la_DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
! libogs_creatures_la_SOURCES =
--- 40,48 ----
localedir = $(datadir)/locale
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
--- Human.cpp DELETED ---
--- Human.h DELETED ---
|
|
From: <ele...@us...> - 2003-03-29 02:11:07
|
Update of /cvsroot/ogs/dist/c++/ogs/core/details
In directory sc8-pr-cvs1:/tmp/cvs-serv24985/core/details
Modified Files:
Maturity.h
Log Message:
See C++ ChangeLog (Mar 28) for details.
Index: Maturity.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/core/details/Maturity.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Maturity.h 23 Mar 2003 22:14:36 -0000 1.1
--- Maturity.h 29 Mar 2003 02:10:33 -0000 1.2
***************
*** 23,33 ****
#ifdef __cplusplus
! # ifndef OGS_CORE_AGES_H
! # define OGS_CORE_AGES_H
# include <ogs/core/Die.h>
! # include <ogs/core/Namespace.h>
! OGS_BEGIN_CORE_NAMESPACE
/**
--- 23,33 ----
#ifdef __cplusplus
! # ifndef OGS_CORE_MATURITY_H
! # define OGS_CORE_MATURITY_H
# include <ogs/core/Die.h>
! # include <ogs/core/details/Namespace.h>
! OGS_BEGIN_CORE_DETAILS_NAMESPACE
/**
***************
*** 99,114 ****
/**
- * Roll a random starting age for a player character (PC). A random
- * starting age is determined by adding the die roll for starting
- * ages to the average adult age.
- *
- * @return Random starting age modifier.
- */
- inline unsigned Ages::rollStartingAge () const {
- const Die& startingAge = getStartingAge ();
- return (getAdultAge () + startingAge.rollValue ());
- }
-
- /**
* Roll a random maximum age for a player character (PC). A random
* maximum age is determined by adding the die roll for maximum ages
--- 99,102 ----
***************
*** 117,128 ****
* @return Random maximum age modifier.
*/
! inline unsigned Ages::rollMaximumAge () const {
const Die& maximumAge = getMaximumAge ();
return (getVenerableAge () + maximumAge.rollValue ());
}
! OGS_END_CORE_NAMESPACE
! # endif /* !defined OGS_CORE_AGES_H */
#endif /* defined __cplusplus */
--- 105,116 ----
* @return Random maximum age modifier.
*/
! inline unsigned Maturity::rollMaximumAge () const {
const Die& maximumAge = getMaximumAge ();
return (getVenerableAge () + maximumAge.rollValue ());
}
! OGS_END_CORE_DETAILS_NAMESPACE
! # endif /* !defined OGS_CORE_MATURITY_H */
#endif /* defined __cplusplus */
|
Update of /cvsroot/ogs/dist/c++/ogs/core
In directory sc8-pr-cvs1:/tmp/cvs-serv24985/core
Modified Files:
Abilities.cpp Abilities.h Ability.cpp Ability.h Character.cpp
Character.h Creature.cpp Creature.h Defense.cpp Entity.cpp
Entity.h Feat.cpp Feat.h Feature.h Item.cpp Item.h Makefile.am
Skill.cpp Skill.h
Added Files:
BodyPart.cpp BodyPart.h Strength.cpp Strength.h
Log Message:
See C++ ChangeLog (Mar 28) for details.
--- NEW FILE: BodyPart.cpp ---
/*
* BodyPart.cpp -- class implementation for body parts
* 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: BodyPart.cpp,v 1.1 2003/03/29 02:10:29 elemings Exp $
*/
#include "ogs/core/Creature.h"
#include "ogs/core/Item.h"
#include "ogs/core/BodyPart.h"
using ogs::core::Creature;
using ogs::core::Item;
using ogs::core::BodyPart;
/**
* Create a new body part. The type of body part does not have to be
* one of the predefined humanoid body parts. It can be any body part
* specific to a particular creature such as tails, wings, horns, or
* whatever. The type value of the body part however must not conflict
* with one of the predefined types.
*/
BodyPart::BodyPart (Creature& creature, Type type):
_creature (creature), _type (type), _items () {
// empty constructor body
}
/**
* Equip an item on this body part. If the item cannot be equipped,
* this function will return false.
*
* @param item Item to be equipped on this body part.
* @return True if item is equipped.
*/
bool BodyPart::equipItem (Item& item) {
return (false); // TODO: Implement this function.
}
--- NEW FILE: BodyPart.h ---
/*
* BodyPart.h -- class interface for body parts
* 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: BodyPart.h,v 1.1 2003/03/29 02:10:29 elemings Exp $
*/
#ifdef __cplusplus
# ifndef OGS_CORE_BODY_PART_H
# define OGS_CORE_BODY_PART_H
# include <ogs/core/Namespace.h>
OGS_BEGIN_CORE_NAMESPACE
class Creature;
class Item;
/**
* A part of the body where items can be equipped. An eqipped item is
* worn, held, or used somehow. The body part determines how many items
* can be equipped and how they are equipped. A normal human hand for
* example can wear one glove, five rings, and hold one item.
*/
class BodyPart: public Object {
public:
/**
* A type of body part. This enumeration defines the omnipresent
* humanoid body parts. Body parts of other creatures (such as
* tails, wings, horns, whatever) may be defined by other classes.
*/
enum Type {
HEAD,
EYES,
LEFT_EYE,
RIGHT_EYE,
NECK,
TORSO,
BACK,
ARMS,
LEFT_ARM,
RIGHT_ARM,
HANDS,
LEFT_HAND,
RIGHT_HAND,
WAIST,
LEGS,
LEFT_LEG,
RIGHT_LEG,
LEFT_FOOT,
RIGHT_FOOT,
};
typedef std::list<Item*> Items;
BodyPart (Creature& creature, Type type);
Creature& getCreature () const;
Type getType () const;
Items getItems () const;
bool equipItem (Item& item);
bool unequipItem (Item& item);
private:
Creature& _creature;
Type _type;
Items _items;
};
/**
* Determine the type of this body part.
*
* @return Type of body part.
*/
inline BodyPart::Type
BodyPart::getType () const {
return (this->_type);
}
/**
* Determine the equipped items for this body part.
*
* @return A list of equipped items for this body part.
*/
inline BodyPart::Items
BodyPart::getItems () const {
return (this->_items);
}
OGS_END_CORE_NAMESPACE
# endif /* !defined OGS_CORE_BODY_PART_H */
#endif /* defined __cplusplus */
--- NEW FILE: Strength.cpp ---
/*
* Strength.cpp -- class implementation for Strength ability
* 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: Strength.cpp,v 1.1 2003/03/29 02:10:31 elemings Exp $
*/
#include <cmath>
#include "ogs/core/Strength.h"
using ogs::core::Strength;
/**
* Determine the limit of heavy loads for a creature of medium size
* using this ability.
*
* @return Weight in pounds.
*/
float Strength::getMediumSizeHeavyLoad () const {
Ability::Score score = getCurrentScore ();
float load = 0.0;
if (score < 11) {
load = score * 10.0;
} else if (score < 20) {
static float table [] = {
115, 130, 150, 175, 200, 230, 260, 300, 350, 400,
};
load = table [score - 11];
} else {
static float table [] = {
400, 460, 520, 600, 700, 800, 920, 1040, 1200, 1400
};
load = table [score % 10];
int factor = (score - 20) / 10;
load *= std::pow (4.0, factor);
}
return (load);
}
/**
* Determine the load factor of a size.
*
* @param size Size of creature.
* @return Load factor of size.
*/
float Strength::getLoadFactor (Size::Type sizeType) {
return (sizeType == Size::FINE? (0.125): // 1/8
sizeType == Size::DIMINUITIVE? (0.25):
sizeType == Size::TINY? (0.5):
sizeType == Size::SMALL? (0.75):
sizeType == Size::LARGE? 2.0:
sizeType == Size::HUGE? 4.0:
sizeType == Size::GARGANTUAN? 8.0:
sizeType == Size::COLLOSAL? 16.0: 1.0);
}
--- NEW FILE: Strength.h ---
/*
* Strength.h -- class interface for Strength abilities
* 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: Strength.h,v 1.1 2003/03/29 02:10:31 elemings Exp $
*/
#ifdef __cplusplus
# ifndef OGS_CORE_STRENGTH_H
# define OGS_CORE_STRENGTH_H
# include <ogs/core/Ability.h>
# include <ogs/core/Namespace.h>
# include <ogs/core/Size.h>
OGS_BEGIN_CORE_NAMESPACE
/**
* An ability that determines physical force, carrying capacities, and
* other similar qualities.
*/
class Strength: public Ability {
public:
Strength (Ability::Method& method = Ability::standardMethod);
float getLightLoad (Size::Type sizeType = Size::MEDIUM) const;
float getMediumLoad (Size::Type sizeType = Size::MEDIUM) const;
float getHeavyLoad (Size::Type sizeType = Size::MEDIUM) const;
private:
float getMediumSizeHeavyLoad () const;
static float getLoadFactor (Size::Type size);
};
/**
* Create a new Strength score using a method. The default method for
* generating a Strength score is the standard method.
*
* @param method Method used to generate score.
*/
inline
Strength::Strength (Ability::Method& method):
Ability (Ability::STR, method) {
// empty constructor body
}
/**
* Determine the limit of light loads for this ability.
*
* @param size Size of creature.
* @return Weight in pounds.
*/
inline float
Strength::getLightLoad (Size::Type sizeType) const {
return (getHeavyLoad (sizeType) / 3);
}
/**
* Determine the limit of medium loads for this ability.
*
* @param size Size of creature.
* @return Weight in pounds.
*/
inline float
Strength::getMediumLoad (Size::Type sizeType) const {
return ((2 * getHeavyLoad (sizeType)) / 3);
}
/**
* Determine the limit of heavy loads for this ability.
*
* @param size Size of creature.
* @return Weight in pounds.
*/
inline float
Strength::getHeavyLoad (Size::Type sizeType) const {
return (getMediumSizeHeavyLoad () * getLoadFactor (sizeType));
}
OGS_END_CORE_NAMESPACE
# endif /* !defined OGS_CORE_STRENGTH_H */
#endif /* defined __cplusplus */
Index: Abilities.cpp
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/core/Abilities.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Abilities.cpp 25 Mar 2003 06:13:11 -0000 1.2
--- Abilities.cpp 29 Mar 2003 02:10:28 -0000 1.3
***************
*** 21,139 ****
*/
- #include <stdexcept>
-
#include "ogs/core/Abilities.h"
using ogs::core::Abilities;
/**
! * Create a set of abilities for this creature. Difference creatures
! * have different sets of abilities and different ways of creating these
! * abilities. The default implementation of this function returns a
! * full set of all six standard abilities created using the standard
! * method.
*
* @return A set of six ability scores.
*/
! Abilities::Abilities (Ability::Method method) {
! this->cha = new Charisma (method);
! this->con = new Constitution (method);
! this->dex = new Dexterity (method);
! this->intl = new Intelligence (method);
! this->str = new Strength (method);
! this->wis = new Wisdom (method);
! }
!
! Abilities::Abilities (const Abilities& abilities) {
! delete this->cha;
! this->cha = abilities.cha;
! delete this->con;
! this->con = abilities.con;
! delete this->dex;
! this->dex = abilities.dex;
! delete this->intl;
! this->intl = abilities.intl;
! delete this->str;
! this->str = abilities.str;
! delete this->wis;
! this->wis = abilities.wis;
}
! Abilities& Abilities::operator= (const Abilities& abilities) {
! delete this->cha;
! this->cha = abilities.cha;
! delete this->con;
! this->con = abilities.con;
! delete this->dex;
! this->dex = abilities.dex;
! delete this->intl;
! this->intl = abilities.intl;
! delete this->str;
! this->str = abilities.str;
! delete this->wis;
! this->wis = abilities.wis;
!
! return (*this);
! }
Abilities::~Abilities () {
! delete this->cha; this->cha = NULL;
! delete this->con; this->con = NULL;
! delete this->dex; this->dex = NULL;
! delete this->intl; this->intl = NULL;
! delete this->str; this->str = NULL;
! delete this->wis; this->wis = NULL;
}
/**
! * Determine if this set of abilities can be rerolled. Abilities can be
* rerolled if the total ability modifier is less than or equal to the
* specified modifier value or all scores are less than or equal to the
! * specified ability score.
*
* @param modifier Total of all abilitiy modifiers.
* @param score Highest score.
* @return True if this set of abilities can be rerolled.
- * @throw runtime_error If all six abilities are not present.
*/
bool Abilities::canReroll (Modifier::Value modifier, Ability::Score score) {
! if (this->cha == NULL || this->con == NULL ||
! this->dex == NULL || this->intl == NULL ||
! this->str == NULL || this->wis == NULL) {
! const char* msg = "Need all six abilities to perform this operation.";
! throw std::runtime_error (msg);
! } else {
Modifier::Value total = 0;
! total += (this->cha->getModifier ()).getValue ();
! total += (this->con->getModifier ()).getValue ();
! total += (this->dex->getModifier ()).getValue ();
! total += (this->intl->getModifier ()).getValue ();
! total += (this->str->getModifier ()).getValue ();
! total += (this->wis->getModifier ()).getValue ();
!
! Ability::Score highest = this->cha->getOriginalScore ();
! if (this->con->getOriginalScore () > highest) {
! highest = this->con->getOriginalScore ();
! }
!
! if (this->dex->getOriginalScore () > highest) {
! highest = this->dex->getOriginalScore ();
! }
!
! if (this->intl->getOriginalScore () > highest) {
! highest = this->intl->getOriginalScore ();
! }
!
! if (this->str->getOriginalScore () > highest) {
! highest = this->str->getOriginalScore ();
! }
! if (this->wis->getOriginalScore () > highest) {
! highest = this->wis->getOriginalScore ();
}
! return (total <= modifier || highest <= score);
}
}
--- 21,95 ----
*/
#include "ogs/core/Abilities.h"
+ #include "ogs/core/Ability.h"
+ #include "ogs/core/Strength.h"
using ogs::core::Abilities;
+ using ogs::core::Ability;
+ using ogs::core::Strength;
/**
! * Create a set of abilities. This constructor uses the standard method
! * by default to create a complete set of all six ability scores.
*
* @return A set of six ability scores.
*/
! Abilities::Abilities (Ability::Method& method) {
! Map& map = *this;
! map [Ability::CHA] = Ability::createCharisma (method);
! map [Ability::CON] = Ability::createConstitution (method);
! map [Ability::DEX] = Ability::createDexterity (method);
! map [Ability::INT] = Ability::createIntelligence (method);
! map [Ability::STR] = new Strength (method);
! map [Ability::WIS] = Ability::createWisdom (method);
}
! struct Abilities::Delete {
! void operator() (ValueType value) { delete value.second; }
! };
+ /**
+ * Destroy this set of abilities.
+ */
Abilities::~Abilities () {
! std::for_each (this->begin (), this->end (), Delete ());
}
/**
! * Determine if this set of abilities can be rerolled. Abilities can be
* rerolled if the total ability modifier is less than or equal to the
* specified modifier value or all scores are less than or equal to the
! * specified ability score. If this set is not a complete set of
! * abilities, then the abilities cannot be rerolled.
*
* @param modifier Total of all abilitiy modifiers.
* @param score Highest score.
* @return True if this set of abilities can be rerolled.
*/
bool Abilities::canReroll (Modifier::Value modifier, Ability::Score score) {
+ bool canReroll = false;
! if (isComplete ()) {
! Map& map = *this;
Modifier::Value total = 0;
! Ability* ability = NULL;
! Ability::Score highest = 0;
! Ability::Type types [] = {
! Ability::CHA, Ability::CON, Ability::DEX,
! Ability::INT, Ability::STR, Ability::WIS
! };
! for (int i = 0; i < Ability::NUM; ++i) {
! ability = map [types [i]];
! total += (ability->getModifier ()).getValue ();
! if (ability->getOriginalScore () > highest) {
! highest = ability->getOriginalScore ();
! }
}
! canReroll = total <= modifier || highest <= score;
}
+
+ return (canReroll);
}
Index: Abilities.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/core/Abilities.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Abilities.h 7 Jan 2003 07:41:32 -0000 1.1
--- Abilities.h 29 Mar 2003 02:10:28 -0000 1.2
***************
*** 26,44 ****
# define OGS_CORE_ABILITIES_H
! # include <ogs/core/Ability.h>
! # include <ogs/core/abilities/Charisma.h>
! # include <ogs/core/abilities/Constitution.h>
! # include <ogs/core/abilities/Dexterity.h>
! # include <ogs/core/abilities/Intelligence.h>
! # include <ogs/core/abilities/Strength.h>
! # include <ogs/core/abilities/Wisdom.h>
OGS_BEGIN_CORE_NAMESPACE
- using ogs::core::Ability;
-
- using namespace ogs::core::abilities;
-
/**
* A set of ability scores. A set of ability scores normally consists
--- 26,35 ----
# define OGS_CORE_ABILITIES_H
! # include <map>
! # include <ogs/core/Ability.h>
OGS_BEGIN_CORE_NAMESPACE
/**
* A set of ability scores. A set of ability scores normally consists
***************
*** 48,71 ****
* very nature.
*/
! struct Abilities {
! Charisma* cha;
! Constitution* con;
! Dexterity* dex;
! Intelligence* intl;
! Strength* str;
! Wisdom* wis;
! Abilities (Ability::Method method = Ability::standardMethod);
! Abilities (const Abilities& abilities);
! Abilities& operator= (const Abilities& rhs);
! ~Abilities ();
! bool canRerollStandard ();
! bool canRerollAverage ();
! bool canRerollHighPowered ();
! bool canReroll (Modifier::Value modifier, Ability::Score score);
};
/**
* Determine if this set of abilities can be rerolled using the standard
* method. Abilities that are rolled using the standard method can be
--- 39,128 ----
* very nature.
*/
! class Abilities: private std::map<Ability::Type, Ability*> {
! public:
! // TODO: Change this to a smart pointer.
! typedef std::map<Ability::Type, Ability*>::iterator Iterator;
! Abilities (Ability::Method& method = Ability::standardMethod);
! ~Abilities ();
! Iterator getBegin ();
! Iterator getEnd ();
! Ability* operator[] (Ability::Type abilityType);
! void removeAbility (Ability::Type abilityType);
! bool isComplete () const;
!
! bool canRerollStandard ();
! bool canRerollAverage ();
! bool canRerollHighPowered ();
!
! private:
! typedef std::map<Ability::Type, Ability*> Map;
! typedef Map::value_type ValueType;
! struct Delete;
!
! Abilities (const Abilities& abilities);
! Abilities& operator= (const Abilities& abilities);
!
! bool canReroll (Modifier::Value modifier, Ability::Score score);
};
/**
+ * Determine the iterator for the beginning of these abilities.
+ *
+ * @return Iterator for the beginning of this set.
+ */
+ inline Abilities::Iterator
+ Abilities::getBegin () {
+ return (this->begin ());
+ }
+
+ /**
+ * Determine the iterator for the end of these abilities.
+ *
+ * @return Iterator for the end of these abilities.
+ */
+ inline Abilities::Iterator
+ Abilities::getEnd () {
+ return (this->end ());
+ }
+
+ /**
+ * Determine the ability for a given type. If an ability for the type
+ * does not exist in this set, this operator returns null.
+ *
+ * @param abilityType Type of ability.
+ * @return An ability or null if the ability does not exist.
+ */
+ inline Ability*
+ Abilities::operator[] (Ability::Type abilityType) {
+ // The map::operator[] inserts the key if not found so this operator
+ // cannot use it. It has to check first and return NULL if not found.
+ Iterator itor = find (abilityType);
+ return (itor == end ()? NULL: itor->second);
+ }
+
+ /**
+ * Remove an ability from this set of abilities.
+ *
+ * @param abilityType Type of ability to be removed.
+ */
+ inline void
+ Abilities::removeAbility (Ability::Type abilityType) {
+ this->erase (abilityType);
+ }
+
+ /**
+ * Determine if this is a complete set of abilities. A complete set of
+ * abilities contains all six ability scores.
+ *
+ * @return True if this set is a complete set of abilities.
+ */
+ inline bool
+ Abilities::isComplete () const {
+ return (this->size () == Ability::NUM);
+ }
+
+ /**
* Determine if this set of abilities can be rerolled using the standard
* method. Abilities that are rolled using the standard method can be
***************
*** 75,79 ****
* @return True if abilities can be rerolled.
*/
! inline bool Abilities::canRerollStandard () {
return (canReroll (0, 13));
}
--- 132,137 ----
* @return True if abilities can be rerolled.
*/
! inline bool
! Abilities::canRerollStandard () {
return (canReroll (0, 13));
}
***************
*** 87,91 ****
* @return True if abilities can be rerolled.
*/
! inline bool Abilities::canRerollAverage () {
return (canReroll (-3, 11));
}
--- 145,150 ----
* @return True if abilities can be rerolled.
*/
! inline bool
! Abilities::canRerollAverage () {
return (canReroll (-3, 11));
}
***************
*** 99,103 ****
* @return True if abilities can be rerolled.
*/
! inline bool Abilities::canRerollHighPowered () {
return (canReroll (+1, 14));
}
--- 158,163 ----
* @return True if abilities can be rerolled.
*/
! inline bool
! Abilities::canRerollHighPowered () {
return (canReroll (+1, 14));
}
Index: Ability.cpp
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/core/Ability.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Ability.cpp 25 Mar 2003 06:13:11 -0000 1.3
--- Ability.cpp 29 Mar 2003 02:10:28 -0000 1.4
***************
*** 23,28 ****
#include <algorithm>
! #include <ogs/Support.h>
!
#include "ogs/core/Ability.h"
--- 23,27 ----
#include <algorithm>
! #include "ogs/Support.h"
#include "ogs/core/Ability.h"
***************
*** 34,37 ****
--- 33,38 ----
using ogs::core::Modifier;
+ Ability::StandardMethod Ability::standardMethod;
+
/**
* Produce an ability score using the standard method. With
***************
*** 87,97 ****
}
- const Ability::Method
- Ability::standardMethod = &Ability::rollStandard;
- const Ability::Method
- Ability::averageMethod = &Ability::rollAverage;
- const Ability::Method
- Ability::highPoweredMethod = &Ability::rollHighPowered;
-
/**
* Determine experience level required for a given number of ability
--- 88,91 ----
***************
*** 119,210 ****
* the <code>Ability</code> class.
*/
! Ability::Ability (Method method) {
! // If the method were guaranteed to be non-NULL, the everything
! // including modifier could be created (instead of set below) with
! // the correct value.
! if (method == NULL) {
! method = standardMethod;
! }
!
! this->originalScore = this->currentScore = method ();
! modifier.setValue (getModifier (this->currentScore));
! }
!
! /**
! * Change the original score of this ability. All current modifiers to
! * this ability are added to this score and the current score is updated
! * accordingly. The ability modifier may also be updated as a result.
! *
! * @param score Original score of this ability.
! */
! void Ability::setOriginalScore (Score score) {
! if (this->originalScore != score) {
! this->originalScore = this->currentScore = score;
!
! // Add modifiers to current score.
! Modifiers::iterator itor = modifiers.begin ();
! while (itor != modifiers.end ()) {
! Modifier* modifier = *itor;
! this->currentScore += modifier->getValue ();
! ++itor;
! }
!
! // Update ability modifier only when necessary.
! if (modifier.getValue () != getModifier (this->currentScore)) {
! modifier.setValue (getModifier (this->currentScore));
! }
!
! Event event (*this);
! notifyObservers (event);
! }
! }
!
! /**
! * Add a modifier to this ability. The current score and ability
! * modifier are updated accordingly. This ability will observe any
! * changes to the value of the modifier.
! *
! * @param modifier Modifier to be added.
! */
! void Ability::addModifier (Modifier& modifier) {
! // Don't add same modifier more than once.
! if (std::find (modifiers.begin (), modifiers.end (),
! &modifier) == modifiers.end ()) {
! modifiers.push_front (&modifier);
! this->currentScore += modifier.getValue ();
! modifier.addObserver (*this);
!
! // Update ability modifier only when neccessary.
! if (this->modifier.getValue () != getModifier (this->currentScore)) {
! this->modifier.setValue (getModifier (this->currentScore));
! }
!
! Event event (*this);
! notifyObservers (event);
! }
! }
!
! /**
! * Remove a modifier to this ability. The current score and ability
! * modifier is updated accordingly.
! *
! * @param modifier Modifier to be removed.
! */
! void Ability::removeModifier (Modifier& modifier) {
! // Make sure modifier is present first.
! if (std::find (modifiers.begin (), modifiers.end (),
! &modifier) != modifiers.end ()) {
! modifiers.remove (&modifier);
! this->currentScore -= modifier.getValue ();
! modifier.removeObserver (*this);
!
! // Update ability modifier only when neccessary.
! if (this->modifier.getValue () != getModifier (this->currentScore)) {
! this->modifier.setValue (getModifier (this->currentScore));
! }
!
! Event event (*this);
! notifyObservers (event);
! }
}
--- 113,122 ----
* the <code>Ability</code> class.
*/
! Ability::Ability (Type type, Method& method):
! _type (type),
! _originalScore (method (type)),
! _currentScore (_originalScore),
! _modifier (getModifier (_originalScore)) {
! // empty constructor body
}
***************
*** 220,229 ****
Modifier& modifier = dynamic_cast<Modifier&> (event.getSource ());
! this->currentScore -= modEvent.getPreviousValue ();
! this->currentScore += modifier.getValue ();
// Update ability modifier only when neccessary.
! if (this->modifier.getValue () != getModifier (this->currentScore)) {
! this->modifier.setValue (getModifier (this->currentScore));
}
--- 132,141 ----
Modifier& modifier = dynamic_cast<Modifier&> (event.getSource ());
! this->_currentScore -= modEvent.getPreviousValue ();
! this->_currentScore += modifier.getValue ();
// Update ability modifier only when neccessary.
! if (this->_modifier.getValue () != getModifier (this->_currentScore)) {
! this->_modifier.setValue (getModifier (this->_currentScore));
}
Index: Ability.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/core/Ability.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Ability.h 13 Jan 2003 05:22:15 -0000 1.2
--- Ability.h 29 Mar 2003 02:10:28 -0000 1.3
***************
*** 29,87 ****
# include <ogs/core/Die.h>
# include <ogs/core/Experience.h>
! # include <ogs/core/Modifier.h>
# include <ogs/core/Namespace.h>
OGS_BEGIN_CORE_NAMESPACE
- using namespace ogs::support;
-
/**
! * A physical or mental characteristic of an entity. Abilities are
! * most often associated with creatures although certain entities, such
! * as powerful magic items, can also have abilities.. The value of an
! * ability is called an ability score. Ability scores can range from
! * 0 up to 20, 30, or 50 but rarely if ever rise above 100. An ability
! * can be modified by adding other modifiers to the original score of
! * the ability. The modified ability score or current score is used to
! * determine the ability modifier. Thus, an ability has two kinds of
! * modifiers: modifiers <I>to the original score</I> and a modifier
! * <I>from the current score</I>.
*/
! class Ability: public Object, public Observer {
public:
typedef unsigned short Score;
- typedef Score (*Method) ();
! static Score rollStandard ();
! static const Method standardMethod;
! static Score rollAverage ();
! static const Method averageMethod;
! static Score rollHighPowered ();
! static const Method highPoweredMethod;
! static Modifier::Value getModifier (Score score);
static unsigned getIncreaseCount (Experience::Level xpLevel);
static Experience::Level getIncreaseCountLevel (unsigned count);
Score getOriginalScore () const;
! void setOriginalScore (Score score);
! void addModifier (Modifier& modifier);
! void removeModifier (Modifier& modifier);
Score getCurrentScore () const;
Modifier& getModifier ();
! void handleEvent (Event& event);
protected:
! Ability (Method method = standardMethod);
private:
! typedef std::list<Modifier*> Modifiers;
! Score originalScore;
! Modifiers modifiers;
! Score currentScore;
! Modifier modifier;
};
--- 29,185 ----
# include <ogs/core/Die.h>
# include <ogs/core/Experience.h>
! # include <ogs/core/Modifiers.h>
# include <ogs/core/Namespace.h>
OGS_BEGIN_CORE_NAMESPACE
/**
! * A basic characteristic of an entity. Abilities are most often
! * associated with creatures although certain entities, such as powerful
! * magic items, can also have abilities.. The value of an ability is
! * called an ability score. Ability scores are non-negative integer
! * values that can range from 0 up to 20, 30, or even 50 but rarely if
! * ever rise above 100. <P>
! *
! * An ability score can be modified by adding other modifiers to the
! * unmodified, original score of the ability. The modified, current
! * score is used to determine the ability modifier. Thus, an ability
! * has two kinds of modifiers: modifiers <I>to</I> the <I>original</I>
! * score and a modifier <I>from</I> the <I>current</I> score. <P>
*/
! class Ability: public ogs::support::Object,
! public ogs::support::Observer {
public:
+ /**
+ * Type of ability. There are only six types of ability scores.
+ * Strength, Dexterity, and Constitution are considered "physical"
+ * abilities. Intelligence, Wisdom, and Charisma are considered
+ * "mental" abilities.
+ */
+ enum Type {
+ /**
+ * An ability that determines physical power and force. Strength
+ * is a special ability that additional special operations for
+ * determining carrying capacities.
+ *
+ * @see Strength
+ */
+ STR = 1,
+
+ /**
+ * An ability that determines agility and quickness. The
+ * Dexterity modifier is added to all Reflex saving throws.
+ *
+ * @see Saves::ref
+ */
+ DEX,
+
+ /**
+ * An ability that determines fitness and vigor. The Constiution
+ * modifier is added to all Fortitude saving throws.
+ *
+ * @see Saves::fort
+ */
+ CON,
+
+ /** An ability that determines reasoning and deduction. */
+ INT,
+
+ /**
+ * An ability that determines intuition and judgement. The Wisdom
+ * modifier is added to all Will saving throws.
+ *
+ * @see Saves::will
+ */
+ WIS,
+
+ /** A ability that determines leadership and charm. */
+ CHA,
+
+ /** Number of ability types. */
+ NUM = 6
+ };
+
+ /** An ability score. */
typedef unsigned short Score;
! /**
! * A function object that generates an ability score. The argument
! * of a method is the type of ability score to generate. A method
! * may ignore this parameter.
! */
! struct Method {
! virtual Score operator() (Ability::Type) = 0;
! virtual ~Method () { }
! };
! /**
! * A method that generates above-average ability scores. The
! * standard method rolls 4d6 and adds the highest three rolls to
! * generate an ability score. The standard method is normally used
! * to generate ability scores for player characters.
! */
! struct StandardMethod: public Method {
! Score operator() (Ability::Type) {
! return (rollStandard ());
! }
! };
+ /**
+ * A method that generates average ability scores. The average
+ * method rolls 3d6 to generate an ability score. The average
+ * method is nnormally used to generate ability scores for
+ * nonplayer characters.
+ */
+ struct AverageMethod: public Method {
+ Score operator() (Ability::Type) {
+ return (rollAverage ());
+ }
+ };
+
+ /**
+ * A method that generates "high-powered" ability scores. The
+ * high-powered method rolls 5d6 and adds the highest three rolls to
+ * generate an ability score. The high-powered method is nnormally
+ * used to generate ability scores for high-level player characters
+ */
+ struct HighPoweredMethod: public Method {
+ Score operator() (Ability::Type) {
+ return (rollHighPowered ());
+ }
+ };
+
+ static Modifier::Value getModifier (Score score);
static unsigned getIncreaseCount (Experience::Level xpLevel);
static Experience::Level getIncreaseCountLevel (unsigned count);
+ static StandardMethod standardMethod;
+ static Ability* createDexterity (Method& method = standardMethod);
+ static Ability* createConstitution (Method& method = standardMethod);
+ static Ability* createIntelligence (Method& method = standardMethod);
+ static Ability* createWisdom (Method& method = standardMethod);
+ static Ability* createCharisma (Method& method = standardMethod);
+
+ Type getType () const;
Score getOriginalScore () const;
! Modifiers& getModifiers ();
Score getCurrentScore () const;
Modifier& getModifier ();
! void handleEvent (ogs::support::Event& event);
protected:
! Ability (Type type, Method& method = standardMethod);
private:
! Type _type;
! Score _originalScore;
! Modifiers _modifiers;
! Score _currentScore;
! Modifier _modifier;
! static Score rollStandard ();
! static Score rollAverage ();
! static Score rollHighPowered ();
};
***************
*** 94,98 ****
* @return An ability score.
*/
! inline Ability::Score Ability::rollAverage () {
return (Score (Die::roll (Die::d6, 3)));
}
--- 192,197 ----
* @return An ability score.
*/
! inline Ability::Score
! Ability::rollAverage () {
return (Score (Die::roll (Die::d6, 3)));
}
***************
*** 106,110 ****
* @return An ability score modifier.
*/
! inline Modifier::Value Ability::getModifier (Score score) {
return (score / 2 - 5);
}
--- 205,210 ----
* @return An ability score modifier.
*/
! inline Modifier::Value
! Ability::getModifier (Score score) {
return (score / 2 - 5);
}
***************
*** 123,132 ****
/**
* Determine the original (unmodified) ability score.
*
* @return Original score of ability.
*/
! inline Ability::Score Ability::getOriginalScore () const {
! return (this->originalScore);
}
--- 223,303 ----
/**
+ * Create a new Dexterity ability using a method. The default method is
+ * the standard method.
+ *
+ * @param method A method for generating an ability score.
+ * @return A new Dexterity ability.
+ */
+ inline Ability*
+ Ability::createDexterity (Method& method) {
+ return (new Ability (DEX, method));
+ }
+
+ /**
+ * Create a new Constitution ability using a method. The default method
+ * is the standard method.
+ *
+ * @param method A method for generating an ability score.
+ * @return A new Constutition ability.
+ */
+ inline Ability*
+ Ability::createConstitution (Method& method) {
+ return (new Ability (CON, method));
+ }
+
+ /**
+ * Create a new Intelligence ability using a method. The default method
+ * is the standard method.
+ *
+ * @param method A method for generating an ability score.
+ * @return A new Intelligence ability.
+ */
+ inline Ability*
+ Ability::createIntelligence (Method& method) {
+ return (new Ability (INT, method));
+ }
+
+ /**
+ * Create a new Wisdom ability using a method. The default method is
+ * the standard method.
+ *
+ * @param method A method for generating an ability score.
+ * @return A new Wisdom ability.
+ */
+ inline Ability*
+ Ability::createWisdom (Method& method) {
+ return (new Ability (WIS, method));
+ }
+
+ /**
+ * Create a new Charisma ability using a method. The default method is
+ * the standard method.
+ *
+ * @param method A method for generating an ability score.
+ * @return A new Charisma ability.
+ */
+ inline Ability*
+ Ability::createCharisma (Method& method) {
+ return (new Ability (CHA, method));
+ }
+
+ /**
* Determine the original (unmodified) ability score.
*
* @return Original score of ability.
*/
! inline Ability::Score
! Ability::getOriginalScore () const {
! return (this->_originalScore);
! }
!
! /**
! * Determine the modifiers added to this ability score.
! *
! * @return A list of modifiers added to this ability score.
! */
! inline Modifiers&
! Ability::getModifiers () {
! return (this->_modifiers);
}
***************
*** 136,141 ****
* @return Current score of ability.
*/
! inline Ability::Score Ability::getCurrentScore () const {
! return (this->currentScore);
}
--- 307,313 ----
* @return Current score of ability.
*/
! inline Ability::Score
! Ability::getCurrentScore () const {
! return (this->_currentScore);
}
***************
*** 145,150 ****
* @return Modifier from this ability.
*/
! inline Modifier& Ability::getModifier () {
! return (modifier);
}
--- 317,323 ----
* @return Modifier from this ability.
*/
! inline Modifier&
! Ability::getModifier () {
! return (this->_modifier);
}
Index: Character.cpp
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/core/Character.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Character.cpp 23 Mar 2003 22:14:36 -0000 1.4
--- Character.cpp 29 Mar 2003 02:10:29 -0000 1.5
***************
*** 24,27 ****
--- 24,29 ----
#include "ogs/core/Character.h"
+ using ogs::core::Abilities;
+ using ogs::core::Ability;
using ogs::core::CClass;
using ogs::core::Character;
***************
*** 29,33 ****
using ogs::core::Modifiers;
using ogs::core::Skill;
- using ogs::core::abilities::Intelligence;
/**
--- 31,34 ----
***************
*** 75,79 ****
// Add Ingelligence bonus if any.
! Ability* intl = (_creature.getAbilities ()).intl;
if (intl != NULL) {
Modifier& modifier = intl->getModifier ();
--- 76,81 ----
// Add Ingelligence bonus if any.
! Abilities& abilities = _creature.getAbilities ();
! Ability* intl = abilities [Ability::INT];
if (intl != NULL) {
Modifier& modifier = intl->getModifier ();
***************
*** 126,152 ****
*/
Character::Advance::Advance (CClass& cclass):
! _cclass (cclass), _hitPoints (0), _ability (NULL),
_skills (), _feats () {
// TODO: Roll hit die for this cclass.
- }
-
- /**
- * Assign an advancement object to another advancement object. This
- * operator is required for STL use.
- *
- * @param rhs Right-hand side of assignment operator.
- * @return Left-hand side of assignment operator.
- */
- Character::Advance&
- Character::Advance::operator= (const Character::Advance& rhs) {
- this->_cclass = rhs._cclass;
- this->_hitPoints = rhs._hitPoints;
- this->_ability = rhs._ability;
- this->_skills = rhs._skills;
- this->_feats = rhs._feats;
-
- // TODO: Anything else done in the body of the constructor.
-
- return (*this);
}
--- 128,134 ----
*/
Character::Advance::Advance (CClass& cclass):
! _cclass (&cclass), _hitPoints (0), _ability (NULL),
_skills (), _feats () {
// TODO: Roll hit die for this cclass.
}
Index: Character.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/core/Character.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Character.h 23 Mar 2003 22:14:36 -0000 1.5
--- Character.h 29 Mar 2003 02:10:29 -0000 1.6
***************
*** 86,90 ****
Advance ();
Advance (CClass& cclass);
- Advance& operator= (const Advance& rhs);
CClass& getCClass () const;
--- 86,89 ----
***************
*** 99,103 ****
typedef std::vector<Feat*> Feats;
! CClass& _cclass;
Die::Value _hitPoints;
Ability* _ability;
--- 98,102 ----
typedef std::vector<Feat*> Feats;
! CClass* _cclass;
Die::Value _hitPoints;
Ability* _ability;
***************
*** 149,153 ****
*/
inline CClass& Character::Advance::getCClass () const {
! return (_cclass);
}
--- 148,152 ----
*/
inline CClass& Character::Advance::getCClass () const {
! return (*_cclass);
}
Index: Creature.cpp
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/core/Creature.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** Creature.cpp 25 Mar 2003 06:13:11 -0000 1.7
--- Creature.cpp 29 Mar 2003 02:10:29 -0000 1.8
***************
*** 26,29 ****
--- 26,30 ----
#include "ogs/core/Feat.h"
+ using ogs::core::BodyPart;
using ogs::core::Creature;
using ogs::core::Die;
***************
*** 32,44 ****
/**
* Create a new creature. This constructor is protected so only derived
! * classes can call it. The new creature has no hit dice, no initiative
! * modifiers, no save modifiers, random ability scores rolled using the
! * standard method, no skills, no feats, and no associated character.
*/
! Creature::Creature ():
! hitDice (), initiative (),
! saves (), abilities (),
! skills (), feats (),
! character (NULL) { }
/**
--- 33,65 ----
/**
* Create a new creature. This constructor is protected so only derived
! * classes can call it. The new creature has no skills, no feats, and
! * no hit dice. Ability scores rolled using the standard method and no
! * character is associated with the creature.
*/
! Creature::Creature (Body body):
! _hitDice (), _initiative (), _saves (), _abilities (),
! _skills (), _feats (), _body (body), _character (NULL) {
! // Add Dexterity modifier to Reflex save, initiative, and defense.
! Ability* 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 other 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 ());
! }
!
! struct Delete {
! void operator() (BodyPart* bodyPart) { delete bodyPart; }
! };
!
! Creature::~Creature () {
! std::for_each (this->_body.begin (), this->_body.end (), Delete ());
! }
/**
***************
*** 51,58 ****
// Make sure the skill isn't already in the list of skills.
! Skills::iterator end = skills.end ();
! if (std::find (skills.begin (), end, &skill) != end) {
//if (skill is not an exclusive skill) {
! skills.push_back (&skill);
//}
}
--- 72,79 ----
// Make sure the skill isn't already in the list of skills.
! Skills::iterator end = _skills.end ();
! if (std::find (_skills.begin (), end, &skill) != end) {
//if (skill is not an exclusive skill) {
! _skills.push_back (&skill);
//}
}
***************
*** 81,85 ****
if (attachFeat) {
if (attachFeat = feat.attachObject (*this)) {
! feats.push_back (&feat);
}
}
--- 102,106 ----
if (attachFeat) {
if (attachFeat = feat.attachObject (*this)) {
! _feats.push_back (&feat);
}
}
***************
*** 96,108 ****
bool removed = false;
! Feats::iterator end = feats.end ();
! Feats::iterator itor = std::find (this->feats.begin (), end, &feat);
if (itor != end) {
if (removed = feat.detachObject ()) {
! feats.erase (itor);
}
}
return (removed);
}
--- 117,166 ----
bool removed = false;
! Feats::iterator end = _feats.end ();
! Feats::iterator itor = std::find (_feats.begin (), end, &feat);
if (itor != end) {
if (removed = feat.detachObject ()) {
! _feats.erase (itor);
}
}
return (removed);
+ }
+
+ /**
+ * Equip an item on this body. This function will cycle through all
+ * body parts until it finds one where the item can be equipped. If it
+ * cannot find a part, this function will return false.
+ *
+ * @param item Item to be equipped on this body.
+ * @return True if item is equipped.
+ */
+ bool Creature::equipItem (Item& item) {
+ return (false); // TODO: Implement this function.
+ }
+
+ /**
+ * Equip an item on a part of this body. If the item can not be
+ * equipped on the specified part of the body, this function will return
+ * false.
+ *
+ * @param item Item to be equipped on this body.
+ * @param part BodyPart of the body to equip item.
+ * @return True if item is equipped.
+ */
+ bool Creature::equipItem (Item& item, BodyPart& part) {
+ return (false); // TODO: Implement this function.
+ }
+
+ /**
+ * Remove an equipped item from this body. If the item is not currently
+ * equipped or cannot be removed (such as cursed items), this function
+ * will return false.
+ *
+ * @param item Item to be removed from this body.
+ * @return True if item is no longer equipped.
+ */
+ bool Creature::unequipItem (Item& item) {
+ return (true); // TODO: Impelement this function.
}
Index: Creature.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/core/Creature.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** Creature.h 25 Mar 2003 06:13:11 -0000 1.7
--- Creature.h 29 Mar 2003 02:10:29 -0000 1.8
***************
*** 34,37 ****
--- 34,38 ----
# include <ogs/core/Modifiers.h>
# include <ogs/core/Namespace.h>
+ # include <ogs/core/BodyPart.h>
# include <ogs/core/Saves.h>
***************
*** 40,43 ****
--- 41,45 ----
class Character;
class Feat;
+ class Item;
class Skill;
***************
*** 50,53 ****
--- 52,56 ----
typedef std::list<Skill*> Skills;
typedef std::list<Feat*> Feats;
+ typedef std::list<BodyPart*> Body;
Dice& getHitDice ();
***************
*** 57,68 ****
Abilities& getAbilities ();
! Skills& getSkills ();
bool addSkill (Skill& skill);
bool removeSkill (Skill& skill);
! Feats getFeats ();
bool addFeat (Feat& feat);
bool removeFeat (Feat& feat);
Character* getCharacter () const;
--- 60,76 ----
Abilities& getAbilities ();
! 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;
+ bool equipItem (Item& item);
+ bool equipItem (Item& item, BodyPart& part);
+ bool unequipItem (Item& item);
+
Character* getCharacter () const;
***************
*** 70,84 ****
protected:
! Creature ();
private:
! Dice hitDice;
! Modifiers initiative;
! //moves;
! Saves saves;
! Abilities abilities;
! Skills skills;
! Feats feats;
! Character* character;
};
--- 78,94 ----
protected:
! Creature (Body body = Body ());
! void setBody (Body body);
private:
! Dice _hitDice;
! Modifiers _initiative;
! //TODO: Add moves;
! Saves _saves;
! Abilities _abilities;
! Skills _skills;
! Feats _feats;
! Body _body;
! Character* _character;
};
***************
*** 90,94 ****
*/
inline Modifiers& Creature::getInitiative () {
! return (initiative);
}
--- 100,104 ----
*/
inline Modifiers& Creature::getInitiative () {
! return (this->_initiative);
}
***************
*** 99,103 ****
*/
inline Die::Value Creature::rollInitiative () const {
! return (Die::roll () + initiative.getValue ());
}
--- 109,113 ----
*/
inline Die::Value Creature::rollInitiative () const {
! return (Die::roll () + _initiative.getValue ());
}
***************
*** 108,112 ****
*/
inline Abilities& Creature::getAbilities () {
! return (abilities);
}
--- 118,161 ----
*/
inline Abilities& Creature::getAbilities () {
! return (this->_abilities);
! }
!
! /**
! * Determine the saving throws for this creature.
! *
! * @return Saving throws for this creature.
! */
! inline Saves& Creature::getSaves () {
! return (this->_saves);
! }
!
! /**
! * Determine the skills for this creature.
! *
! * @return A list of skills for this creature.
! */
! inline Creature::Skills
! Creature::getSkills () const {
! return (this->_skills);
! }
!
! /**
! * Determine the feats for this creature.
! *
! * @return A list of feats for this creature.
! */
! inline Creature::Feats
! Creature::getFeats () const {
! return (this->_feats);
! }
!
! /**
! * Determine the body parts of this creature.
! *
! * @return A list of body parts of this creature.
! */
! inline Creature::Body
! Creature::getBody () const {
! return (this->_body);
}
***************
*** 119,126 ****
*/
inline Character* Creature::getCharacter () const {
! return (this->character);
}
! inline Creature::~Creature () { }
OGS_END_CORE_NAMESPACE
--- 168,183 ----
*/
inline Character* Creature::getCharacter () const {
! return (this->_character);
}
! /**
! * Change the body of this creature.
! *
! * @param body Body of this creature.
! */
! inline void
! Creature::setBody (Body body) {
! this->_body = body;
! }
OGS_END_CORE_NAMESPACE
Index: Defense.cpp
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/core/Defense.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Defense.cpp 25 Mar 2003 06:13:11 -0000 1.2
--- Defense.cpp 29 Mar 2003 02:10:29 -0000 1.3
***************
*** 21,26 ****
*/
! #include <ogs/support/Event.h>
!
#include "ogs/core/Defense.h"
#include "ogs/core/Modifier.h"
--- 21,25 ----
*/
! #include "ogs/support/Event.h"
#include "ogs/core/Defense.h"
#include "ogs/core/Modifier.h"
Index: Entity.cpp
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/core/Entity.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Entity.cpp 25 Mar 2003 06:13:11 -0000 1.4
--- Entity.cpp 29 Mar 2003 02:10:29 -0000 1.5
***************
*** 33,39 ****
* The size modifier is automatically added to defense. So any change
* in size will automatically be reflected in the defense.
*/
! Entity::Entity (Size::Type size):
! _weight (0.0), _size (size), _defense (),
_currentHealth (0), _maximumHealth (0) /*, _features ()*/ {
_defense.addModifier (_size.getDefenseModifier ());
--- 33,42 ----
* The size modifier is automatically added to defense. So any change
* in size will automatically be reflected in the defense.
+ *
+ * @param weight Weight of entity.
+ * @param size Size of entity.
*/
! Entity::Entity (Weight weight, Size::Type size):
! _weight (weight), _size (size), _defense (),
_currentHealth (0), _maximumHealth (0) /*, _features ()*/ {
_defense.addModifier (_size.getDefenseModifier ());
Index: Entity.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/core/Entity.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Entity.h 25 Mar 2003 06:13:11 -0000 1.4
--- Entity.h 29 Mar 2003 02:10:29 -0000 1.5
***************
*** 63,67 ****
protected:
! Entity (Size::Type size = Size::MEDIUM);
private:
--- 63,67 ----
protected:
! Entity (Weight weight = 0.0, Size::Type size = Size::MEDIUM);
private:
Index: Feat.cpp
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/core/Feat.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Feat.cpp 25 Mar 2003 06:13:11 -0000 1.3
--- Feat.cpp 29 Mar 2003 02:10:29 -0000 1.4
***************
*** 54,60 ****
* @return True if the feature is attached to the object.
*/
! bool Feat::canAttach (Object& object) const {
return (Feature::canAttach (object) &&
! dynamic_cast<Creature*> (&object) != NULL);
}
--- 54,60 ----
* @return True if the feature is attached to the object.
*/
! bool Feat::canAttach (const Object& object) const {
return (Feature::canAttach (object) &&
! dynamic_cast<const Creature*> (&object) != NULL);
}
***************
*** 66,72 ****
*/
template <class FeatClass>
! bool Feat::findFeat (Object& object) const {
bool found = false;
! Creature* creature = dynamic_cast<Creature*> (&object);
if (creature != NULL) {
--- 66,72 ----
*/
template <class FeatClass>
! bool Feat::findFeat (const Object& object) const {
bool found = false;
! const Creature* creature = dynamic_cast<const Creature*> (&object);
if (creature != NULL) {
***************
*** 75,84 ****
while (itor != feats.end ()) {
! FeatClass* feat = dynamic_cast <FeatClass*> (*itor);
if (feat != NULL) {
found = true;
}
-
- ++itor;
}
}
--- 75,82 ----
while (itor != feats.end ()) {
! FeatClass* feat = dynamic_cast <FeatClass*> (*itor++);
if (feat != NULL) {
found = true;
}
}
}
Index: Feat.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/core/Feat.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Feat.h 25 Mar 2003 08:12:27 -0000 1.6
--- Feat.h 29 Mar 2003 02:10:29 -0000 1.7
***************
*** 122,132 ****
virtual Group getGroup () const = 0;
! virtual ~Feat ();
protected:
! virtual bool canAttach (ogs::support::Object& object) const;
template <class FeatClass>
! bool findFeat (ogs::support::Object& object) const;
};
--- 122,132 ----
virtual Group getGroup () const = 0;
! virtual ~Feat () { }
protected:
! virtual bool canAttach (const Object& object) const;
template <class FeatClass>
! bool findFeat (const Object& object) const;
};
***************
*** 141,146 ****
return (xpLevel < 2? xpLevel: xpLevel / 3 + 1);
}
-
- inline Feat::~Feat () { }
OGS_END_CORE_NAMESPACE
--- 141,144 ----
Index: Feature.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/core/Feature.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Feature.h 25 Mar 2003 06:13:11 -0000 1.3
--- Feature.h 29 Mar 2003 02:10:29 -0000 1.4
***************
*** 39,56 ****
class Feature: public ogs::support::Object {
public:
! virtual bool attachObject (ogs::support::Object& object);
virtual bool detachObject ();
! const ogs::support::Object* getObject () const;
! ogs::support::Object* getObject ();
! virtual ~Feature ();
protected:
! virtual bool canAttach (ogs::support::Object& object) const;
virtual bool canDetach () const;
private:
! ogs::support::Object* _object;
};
--- 39,58 ----
class Feature: public ogs::support::Object {
public:
! virtual bool attachObject (Object& object);
virtual bool detachObject ();
! const Object* getObject () const;
! Object* getObject ();
! virtual ~Feature () = 0;
protected:
! Feature ();
!
! virtual bool canAttach (const Object& object) const;
virtual bool canDetach () const;
private:
! Object* _object;
};
***************
*** 83,87 ****
*/
inline bool
! Feature::canAttach (Object& object) const {
return (&object != this && _object == NULL);
}
--- 85,89 ----
*/
inline bool
! Feature::canAttach (const Object& object) const {
return (&object != this && _object == NULL);
}
***************
*** 97,100 ****
--- 99,107 ----
return (true);
}
+
+ /**
+ * Create a new feature.
+ */
+ inline Feature::Feature (): _object (NULL) { }
inline Feature::~Feature () { }
Index: Item.cpp
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/core/Item.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Item.cpp 7 Jan 2003 07:41:33 -0000 1.1
--- Item.cpp 29 Mar 2003 02:10:29 -0000 1.2
***************
*** 21,26 ****
*/
! #include "Item.h"
using ogs::core::Item;
--- 21,56 ----
*/
! #include "ogs/core/Entity.h"
! #include "ogs/core/Item.h"
+ using ogs::core::Entity;
using ogs::core::Item;
+
+ /**
+ * Create a new item.
+ */
+ Item::Item (Entity::Weight weight, Size::Type size, Worth worth):
+ Entity (weight, size), _worth (worth) {
+ // empty constructor body
+ }
+
+ /**
+ * Attach this item to an object. This function is called when an item
+ * is equipped. If the item cannot be equipped, this function should
+ * return false. Derived classes should override this function if the
+ * item can affect the object when it is equipped.since
+ * it does not allow an item to be equipped by default.
+ *
+ * @param object Object that will equip this item.
+ * @return True if item is equipped.
+ */
+ bool Item::attachObject (Object& object) {
+ bool equipped = canEquip (object);
+
+ if (equipped) {
+ this->_object = &object;
+ }
+
+ return (equipped);
+ }
Index: Item.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/core/Item.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Item.h 25 Mar 2003 06:13:11 -0000 1.2
--- Item.h 29 Mar 2003 02:10:29 -0000 1.3
***************
*** 26,29 ****
--- 26,32 ----
# define OGS_CORE_ITEM_H
+ # include <string>
+
+ # include <ogs/support/Attachable.h>
# include <ogs/core/Entity.h>
# include <ogs/core/Namespace.h>
***************
*** 32,40 ****
/**
! * An entity that can be utilized or manipulated by a creature.
*/
! class Item: public Entity {
public:
/**
* Measures how hard the material is that the item is made of.
* Higher values indicate harder items that are harder to break.
--- 35,56 ----
/**
! * An entity that can be utilized or manipulated by a creature. Items
! * are attachable entities. They can be equipped, worn, held, or
! * contained within other items.
*/
! class Item: public Entity, public ogs::support::Attachable {
public:
/**
+ * Measures how much the item is worth. Units of measure are
+ * locale-dependent.
+ */
+ typedef double Worth;
+
+ /**
+ * Material that this item is primarily made of.
+ */
+ typedef std::string Material;
+
+ /**
* Measures how hard the material is that the item is made of.
* Higher values indicate harder items that are harder to break.
***************
*** 54,74 ****
typedef Entity::Health Density;
! /**
! * Measures how much the item...
[truncated message content] |
|
From: <ele...@us...> - 2003-03-29 02:11:01
|
Update of /cvsroot/ogs/dist/c++/ogs/combat/actions
In directory sc8-pr-cvs1:/tmp/cvs-serv24985/combat/actions
Modified Files:
Delay.cpp Refocus.cpp
Log Message:
See C++ ChangeLog (Mar 28) for details.
Index: Delay.cpp
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/combat/actions/Delay.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Delay.cpp 5 Feb 2003 06:01:27 -0000 1.2
--- Delay.cpp 29 Mar 2003 02:10:27 -0000 1.3
***************
*** 51,55 ****
*/
Delay::Initiative Delay::getLowestInitiative () const {
! Modifiers initiative = _combatant.creature.getInitiative ();
return (-10 - initiative.getValue ());
}
--- 51,55 ----
*/
Delay::Initiative Delay::getLowestInitiative () const {
! Modifiers initiative = _combatant.creature->getInitiative ();
return (-10 - initiative.getValue ());
}
Index: Refocus.cpp
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/combat/actions/Refocus.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Refocus.cpp 5 Feb 2003 06:01:27 -0000 1.2
--- Refocus.cpp 29 Mar 2003 02:10:28 -0000 1.3
***************
*** 46,50 ****
*/
void Refocus::performAction () {
! Modifiers initiative = _combatant.creature.getInitiative ();
_combatant.initiative = 20 + initiative.getValue ();
--- 46,50 ----
*/
void Refocus::performAction () {
! Modifiers initiative = _combatant.creature->getInitiative ();
_combatant.initiative = 20 + initiative.getValue ();
|
|
From: <ele...@us...> - 2003-03-29 02:11:01
|
Update of /cvsroot/ogs/dist/c++/ogs/combat
In directory sc8-pr-cvs1:/tmp/cvs-serv24985/combat
Modified Files:
Combatant.cpp Combatant.h Encounter.cpp Encounter.h
Log Message:
See C++ ChangeLog (Mar 28) for details.
Index: Combatant.cpp
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/combat/Combatant.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Combatant.cpp 25 Mar 2003 06:13:10 -0000 1.4
--- Combatant.cpp 29 Mar 2003 02:10:26 -0000 1.5
***************
*** 21,24 ****
--- 21,25 ----
*/
+ #include "ogs/core/Creature.h"
#include "ogs/combat/Combatant.h"
***************
*** 34,39 ****
*/
Combatant::Combatant (Creature& combatant):
! creature (combatant), specificActions (), initiative (0),
! defaultAction (NULL), currentAction (NULL) {
// empty
}
--- 35,40 ----
*/
Combatant::Combatant (Creature& combatant):
! creature (&combatant), initiative (0), defaultAction (NULL),
! specificActions (), currentAction (NULL) {
// empty
}
***************
*** 50,73 ****
specificActions.pop ();
}
- }
-
- /**
- * Assign a Combatant object to another Combatant object. This operator
- * is explicitly defined so that STL containers can copy Combatant
- * objects.
- *
- * @param combatant Right-hand value of assignment operator.
- * @return This object.
- */
- Combatant& Combatant::operator= (const Combatant& combatant) {
- if (this != &combatant) {
- this->creature = combatant.creature;
- this->initiative = combatant.initiative;
- this->defaultAction = combatant.defaultAction;
- this->specificActions = combatant.specificActions;
- this->currentAction = combatant.currentAction;
- }
-
- return (*this);
}
--- 51,54 ----
Index: Combatant.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/combat/Combatant.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Combatant.h 5 Feb 2003 06:01:27 -0000 1.2
--- Combatant.h 29 Mar 2003 02:10:26 -0000 1.3
***************
*** 28,32 ****
# include <queue>
- # include <ogs/core/Creature.h>
# include <ogs/core/Die.h>
# include <ogs/combat/Action.h>
--- 28,31 ----
***************
*** 35,38 ****
--- 34,39 ----
OGS_BEGIN_COMBAT_NAMESPACE
+ class ogs::core::Creature;
+
/**
* A participant in a combat encounter.
***************
*** 42,46 ****
typedef std::queue<Action*> Actions;
! ogs::core::Creature& creature;
ogs::core::Die::Value initiative;
Action* defaultAction;
--- 43,47 ----
typedef std::queue<Action*> Actions;
! ogs::core::Creature* creature;
ogs::core::Die::Value initiative;
Action* defaultAction;
***************
*** 49,54 ****
Combatant (ogs::core::Creature& creature);
- //Combatant (const Combatant& combatant);
- Combatant& operator= (const Combatant& combatant);
~Combatant ();
--- 50,53 ----
***************
*** 61,65 ****
*/
inline bool Combatant::isNormal () const {
! return (creature.getCurrentHealth () > 0);
}
--- 60,64 ----
*/
inline bool Combatant::isNormal () const {
! return (creature->getCurrentHealth () > 0);
}
Index: Encounter.cpp
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/combat/Encounter.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Encounter.cpp 25 Mar 2003 06:13:11 -0000 1.4
--- Encounter.cpp 29 Mar 2003 02:10:27 -0000 1.5
***************
*** 23,26 ****
--- 23,27 ----
#include <algorithm>
+ #include "ogs/core/Creature.h"
#include "ogs/combat/Encounter.h"
***************
*** 56,60 ****
Combatants::iterator itor = combatants.begin ();
while (itor != combatants.end ()) {
! itor->initiative = itor->creature.rollInitiative ();
itor++;
}
--- 57,61 ----
Combatants::iterator itor = combatants.begin ();
while (itor != combatants.end ()) {
! itor->initiative = itor->creature->rollInitiative ();
itor++;
}
***************
*** 77,81 ****
for (int i = 0; i < s; ++i) {
Combatant& combatantRef = combatants [i];
! Creature* creaturePtr = &(combatantRef.creature);
if (creaturePtr == &creature) {
combatant = &combatantRef;
--- 78,82 ----
for (int i = 0; i < s; ++i) {
Combatant& combatantRef = combatants [i];
! Creature* creaturePtr = combatantRef.creature;
if (creaturePtr == &creature) {
combatant = &combatantRef;
Index: Encounter.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/combat/Encounter.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Encounter.h 5 Feb 2003 06:01:27 -0000 1.2
--- Encounter.h 29 Mar 2003 02:10:27 -0000 1.3
***************
*** 28,32 ****
# include <list>
- # include <ogs/core/Creature.h>
# include <ogs/combat/Combatant.h>
# include <ogs/combat/Namespace.h>
--- 28,31 ----
***************
*** 34,37 ****
--- 33,37 ----
OGS_BEGIN_COMBAT_NAMESPACE
+ class ogs::core::Creature;
using ogs::core::Creature;
|
|
From: <ele...@us...> - 2003-03-29 02:10:59
|
Update of /cvsroot/ogs/dist/c++/ogs/cclasses
In directory sc8-pr-cvs1:/tmp/cvs-serv24985/cclasses
Modified Files:
Paladin.cpp
Log Message:
See C++ ChangeLog (Mar 28) for details.
Index: Paladin.cpp
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/cclasses/Paladin.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Paladin.cpp 24 Mar 2003 07:45:11 -0000 1.2
--- Paladin.cpp 29 Mar 2003 02:10:26 -0000 1.3
***************
*** 106,110 ****
Creature& creature = character.getCreature ();
Abilities& abilities = creature.getAbilities ();
! Ability* cha = abilities.cha;
if (cha != NULL) {
Modifier& modifier = cha->getModifier ();
--- 106,110 ----
Creature& creature = character.getCreature ();
Abilities& abilities = creature.getAbilities ();
! Ability* cha = abilities [Ability::CHA];
if (cha != NULL) {
Modifier& modifier = cha->getModifier ();
***************
*** 141,145 ****
Creature& creature = character.getCreature ();
Abilities& abilities = creature.getAbilities ();
! Ability* cha = abilities.cha;
if (cha != NULL) {
Modifier& modifier = cha->getModifier ();
--- 141,145 ----
Creature& creature = character.getCreature ();
Abilities& abilities = creature.getAbilities ();
! Ability* cha = abilities [Ability::CHA];
if (cha != NULL) {
Modifier& modifier = cha->getModifier ();
|
|
From: <ele...@us...> - 2003-03-29 02:10:59
|
Update of /cvsroot/ogs/dist/c++/ogs In directory sc8-pr-cvs1:/tmp/cvs-serv24985 Modified Files: Feats.h Makefile.am Log Message: See C++ ChangeLog (Mar 28) for details. Index: Feats.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/Feats.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Feats.h 25 Mar 2003 06:13:10 -0000 1.2 --- Feats.h 29 Mar 2003 02:10:25 -0000 1.3 *************** *** 25,38 **** # include <ogs/feats/Alertness.h> # include <ogs/feats/ArmorProficiency.h> # include <ogs/feats/BonusFeat.h> - # include <ogs/feats/ExoticWeapon.h> - # include <ogs/feats/GreatFortitude.h> # include <ogs/feats/ImprovedInitiative.h> ! # include <ogs/feats/IronWill.h> ! # include <ogs/feats/LightningReflexes.h> ! # include <ogs/feats/MartialWeapon.h> # include <ogs/feats/ShieldProficiency.h> ! # include <ogs/feats/SimpleWeapon.h> # include <ogs/feats/Toughness.h> # include <ogs/feats/WeaponProficiency.h> --- 25,35 ---- # include <ogs/feats/Alertness.h> + # include <ogs/feats/AllWeapons.h> # include <ogs/feats/ArmorProficiency.h> # include <ogs/feats/BonusFeat.h> # include <ogs/feats/ImprovedInitiative.h> ! # include <ogs/feats/ImprovedSave.h> # include <ogs/feats/ShieldProficiency.h> ! # include <ogs/feats/SingleWeapon.h> # include <ogs/feats/Toughness.h> # include <ogs/feats/WeaponProficiency.h> Index: Makefile.am =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/Makefile.am,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Makefile.am 8 Mar 2003 01:08:51 -0000 1.6 --- Makefile.am 29 Mar 2003 02:10:25 -0000 1.7 *************** *** 62,67 **** support/libogs-support.la \ core/libogs-core.la \ ! combat/libogs-combat.la ! magic/libogs-magic.la cclasses/libogs-cclasses.la \ creatures/libogs-creatures.la \ --- 62,67 ---- support/libogs-support.la \ core/libogs-core.la \ ! combat/libogs-combat.la \ ! magic/libogs-magic.la \ cclasses/libogs-cclasses.la \ creatures/libogs-creatures.la \ |
|
From: <ele...@us...> - 2003-03-29 02:10:47
|
Update of /cvsroot/ogs/dist/c++/ogs/support In directory sc8-pr-cvs1:/tmp/cvs-serv24985/support Modified Files: Makefile.am Log Message: See C++ ChangeLog (Mar 28) for details. Index: Makefile.am =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/support/Makefile.am,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Makefile.am 23 Mar 2003 22:14:36 -0000 1.3 --- Makefile.am 29 Mar 2003 02:10:40 -0000 1.4 *************** *** 42,45 **** --- 42,46 ---- Class.cpp \ Event.cpp \ + Object.h \ Object.cpp |
|
From: <ele...@us...> - 2003-03-29 02:10:47
|
Update of /cvsroot/ogs/dist/c++/ogs/skills
In directory sc8-pr-cvs1:/tmp/cvs-serv24985/skills
Modified Files:
Diplomacy.h Spot.h
Log Message:
See C++ ChangeLog (Mar 28) for details.
Index: Diplomacy.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/skills/Diplomacy.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Diplomacy.h 7 Jan 2003 07:41:34 -0000 1.1
--- Diplomacy.h 29 Mar 2003 02:10:39 -0000 1.2
***************
*** 26,31 ****
# define OGS_SKILLS_DIPLOMACY_H
# include <ogs/core/Skill.h>
- # include <ogs/core/abilities/Charisma.h>
# include <ogs/skills/Namespace.h>
--- 26,31 ----
# define OGS_SKILLS_DIPLOMACY_H
+ # include <ogs/core/Ability.h>
# include <ogs/core/Skill.h>
# include <ogs/skills/Namespace.h>
***************
*** 37,41 ****
class Diplomacy: public ogs::core::Skill {
public:
! ogs::support::Class getKeyAbility () const;
bool useUntrained () const;
bool useArmorCheckPenalty () const;
--- 37,41 ----
class Diplomacy: public ogs::core::Skill {
public:
! ogs::core::Ability::Type getKeyAbility () const;
bool useUntrained () const;
bool useArmorCheckPenalty () const;
***************
*** 49,56 ****
* @return Charisma
*/
! inline ogs::support::Class Diplomacy::getKeyAbility () const {
! using ogs::support::Class;
! using ogs::core::abilities::Charisma;
! return (Class::getClass <Charisma> ());
}
--- 49,55 ----
* @return Charisma
*/
! inline ogs::core::Ability::Type
! Diplomacy::getKeyAbility () const {
! return (ogs::core::Ability::CHA);
}
Index: Spot.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/skills/Spot.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Spot.h 5 Feb 2003 06:01:29 -0000 1.2
--- Spot.h 29 Mar 2003 02:10:39 -0000 1.3
***************
*** 28,32 ****
# include <ogs/core/Modifier.h>
# include <ogs/core/Skill.h>
! # include <ogs/core/abilities/Wisdom.h>
# include <ogs/skills/Namespace.h>
--- 28,32 ----
# include <ogs/core/Modifier.h>
# include <ogs/core/Skill.h>
! # include <ogs/core/Ability.h>
# include <ogs/skills/Namespace.h>
***************
*** 38,42 ****
class Spot: public ogs::core::Skill {
public:
! ogs::support::Class getKeyAbility () const;
bool useUntrained () const;
bool useArmorCheckPenalty () const;
--- 38,42 ----
class Spot: public ogs::core::Skill {
public:
! ogs::core::Ability::Type getKeyAbility () const;
bool useUntrained () const;
bool useArmorCheckPenalty () const;
***************
*** 61,68 ****
* @return Wisdom
*/
! inline ogs::support::Class Spot::getKeyAbility () const {
! using ogs::support::Class;
! using ogs::core::abilities::Wisdom;
! return (Class::getClass <Wisdom> ());
}
--- 61,67 ----
* @return Wisdom
*/
! inline ogs::core::Ability::Type
! Spot::getKeyAbility () const {
! return (ogs::core::Ability::WIS);
}
|
|
From: <ele...@us...> - 2003-03-29 02:10:46
|
Update of /cvsroot/ogs/dist/c++/ogs/magic
In directory sc8-pr-cvs1:/tmp/cvs-serv24985/magic
Modified Files:
MetamagicFeat.h Range.h Spell.h
Log Message:
See C++ ChangeLog (Mar 28) for details.
Index: MetamagicFeat.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/magic/MetamagicFeat.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** MetamagicFeat.h 27 Feb 2003 01:24:37 -0000 1.4
--- MetamagicFeat.h 29 Mar 2003 02:10:39 -0000 1.5
***************
*** 50,54 ****
virtual int getAddedLevels () = 0;
! ~MetamagicFeat ();
};
--- 50,54 ----
virtual int getAddedLevels () = 0;
! virtual ~MetamagicFeat () { }
};
Index: Range.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/magic/Range.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Range.h 25 Feb 2003 19:40:26 -0000 1.2
--- Range.h 29 Mar 2003 02:10:39 -0000 1.3
***************
*** 79,83 ****
private:
! Type type;
};
--- 79,83 ----
private:
! Type _type;
};
***************
*** 110,113 ****
--- 110,122 ----
/**
+ * Create a new range.
+ *
+ * @param type Type of range.
+ */
+ inline Range::Range (Type type): _type (type) {
+ // empty constructor body
+ }
+
+ /**
* Determine type of this spell range.
*
***************
*** 115,119 ****
*/
inline Range::Type Range::getType () const {
! return (this->type);
};
--- 124,128 ----
*/
inline Range::Type Range::getType () const {
! return (this->_type);
};
Index: Spell.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/magic/Spell.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Spell.h 25 Feb 2003 19:40:26 -0000 1.3
--- Spell.h 29 Mar 2003 02:10:39 -0000 1.4
***************
*** 76,80 ****
virtual bool attachMetamagicFeat (MetamagicFeat& metamagicFeat);
! virtual ~Spell ();
protected:
--- 76,80 ----
virtual bool attachMetamagicFeat (MetamagicFeat& metamagicFeat);
! virtual ~Spell () { }
protected:
|
Update of /cvsroot/ogs/dist/c++/ogs/feats
In directory sc8-pr-cvs1:/tmp/cvs-serv24985/feats
Modified Files:
Alertness.cpp Alertness.h ArmorProficiency.cpp
ArmorProficiency.h ImprovedInitiative.cpp ImprovedInitiative.h
ImprovedSave.cpp ImprovedSave.h Makefile.am
ShieldProficiency.h Toughness.h WeaponProficiency.h
Added Files:
AllWeapons.cpp AllWeapons.h SingleWeapon.cpp SingleWeapon.h
Removed Files:
ExoticWeapon.cpp ExoticWeapon.h MartialWeapon.cpp
MartialWeapon.h
Log Message:
See C++ ChangeLog (Mar 28) for details.
--- NEW FILE: AllWeapons.cpp ---
/*
* AllWeapons.cpp -- class implementation for all weapon proficiency feats
* 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: AllWeapons.cpp,v 1.1 2003/03/29 02:10:36 elemings Exp $
*/
#include "ogs/core/Creature.h"
#include "ogs/feats/AllWeapons.h"
#include "ogs/items/Weapon.h"
using ogs::core::Creature;
using ogs::feats::AllWeapons;
using ogs::items::Weapon;
/**
* Create a new Simple Weapons Proficiency feat.
*
* @return A new Simple Weapons Proficiency feat.
*/
AllWeapons* AllWeapons::createSimple () {
return (new AllWeapons (Weapon::SIMPLE));
}
/**
* Create a new Martial Weapons Proficiency feat.
*
* @return A new Martial Weapons Proficiency feat.
*/
AllWeapons* AllWeapons::createMartial () {
return (new AllWeapons (Weapon::MARTIAL));
}
/**
* 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
}
/**
* Determine if this feat can be attached to an object. An all weapons
* proficiency feat can be attached to a creature if the creature does
* not already have this feat.
*
* @param object Object to attach this feat to.
* @return True if this feat is attached to object.
*/
bool AllWeapons::canAttach (const Object& object) const {
if (!Feat::canAttach (object)) {
return (false);
}
const Creature& creature = dynamic_cast<const Creature&> (object);
Creature::Feats feats = creature.getFeats ();
Creature::Feats::iterator itor = feats.begin ();
while (itor != feats.end ()) {
using ogs::core::Feat;
Feat* feat = *itor++;
AllWeapons* allWeapons = dynamic_cast <AllWeapons*> (feat);
if (allWeapons != NULL) {
if (allWeapons->getProficiency () == _proficiency) {
return (false);
}
}
}
return (true);
}
--- NEW FILE: AllWeapons.h ---
/*
* AllWeapons.h -- class interface for all weapons proficiency feats
* 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: AllWeapons.h,v 1.1 2003/03/29 02:10:36 elemings Exp $
*/
#ifdef __cplusplus
# ifndef OGS_FEATS_SINGLE_WEAPON_H
# define OGS_FEATS_SINGLE_WEAPON_H
# include <ogs/feats/Namespace.h>
# include <ogs/feats/WeaponProficiency.h>
OGS_BEGIN_FEATS_NAMESPACE
/**
* A weapon proficiency for all weapons of one group. Simple Weapon
* Proficiency is a general feat that indicates that a creature is
* proficient with all simple weapons. Some cclasses are also
* proficient with all martial weapons. Exotic weapons can only be
* selected as single weapons. This class can be used instead of the
* @c SingleWeapon class to indicate that a creature is proficient with
* all weapons in one of these groups.
*
* @see SingleWeapon
*/
class AllWeapons: public WeaponProficiency {
public:
static AllWeapons* createSimple ();
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);
bool canAttach (const Object& object) const;
};
/**
* 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
* feat is not attached to a creature, the weapon is not a proficient
* weapon.
*
* @return True if weapon is a proficient weapon.
*/
inline bool
AllWeapons::isProficient (const ogs::items::Weapon& weapon) const {
return (weapon.getProficiency () == this->_proficiency);
}
OGS_END_FEATS_NAMESPACE
# endif /* !defined OGS_FEATS_SINGLE_WEAPON_H */
#endif /* defined __cplusplus */
--- NEW FILE: SingleWeapon.cpp ---
/*
* SingleWeapon.cpp -- class implementation for single weapon proficiency feats
* 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: SingleWeapon.cpp,v 1.1 2003/03/29 02:10:38 elemings Exp $
*/
#include <typeinfo>
#include "ogs/support/Class.h"
#include "ogs/feats/SingleWeapon.h"
using ogs::feats::SingleWeapon;
using ogs::items::Weapon;
/**
* Create a new single weapon proficiency. This constructor will throw
* an exception if the template parameter is not a class derived from
* the @c Weapon class.
*
* @throws std::bad_cast If WeaponType is not a type of weapon.
*/
template <class _WeaponType>
SingleWeapon<_WeaponType>::SingleWeapon () {
WeaponType object;
Weapon& weapon = dynamic_cast<Weapon&> (object);
}
/**
* Determine if this feat can be attached to an object. Single weapon
* proficiency feats can be attached to a creature if the creature does
* not already have a weapon proficiency feat for this type of weapon.
*
* @param object Object to attach this feat to.
* @return True if this feat is attached to object.
*/
template <class _WeaponType> bool
SingleWeapon<_WeaponType>::canAttach (const Object& object) const {
}
/**
* 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.
*/
template <class _WeaponType> bool
SingleWeapon<_WeaponType>::isProficient (const Weapon& weapon) const {
using ogs::support::Class;
Class thisWeaponClass = Class::getClass<WeaponType> ();
Class weaponClass = weapon.getClass ();
return (thisWeaponClass == weaponClass);
}
--- NEW FILE: SingleWeapon.h ---
/*
* SingleWeapon.h -- class interface for single weapon proficiency feats
* 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: SingleWeapon.h,v 1.1 2003/03/29 02:10:38 elemings Exp $
*/
#ifdef __cplusplus
# ifndef OGS_FEATS_SINGLE_WEAPON_H
# define OGS_FEATS_SINGLE_WEAPON_H
# include <ogs/feats/Namespace.h>
# include <ogs/feats/WeaponProficiency.h>
# include <ogs/items/Weapon.h>
OGS_BEGIN_FEATS_NAMESPACE
/**
* A weapon proficiency for a single weapon. Some classes are
* automatically proficient only with specific types of weapons, some of
* which are simple weapons. Single weapon proficiency feats for
* martial weapons and exotic weapons can also be taken optionally.
*/
template <class _WeaponType>
class SingleWeapon: public WeaponProficiency {
public:
/** Type of weapon that this proficiency applies to. */
typedef _WeaponType WeaponType;
SingleWeapon ();
Feat::Compatibility getCompatibility () const;
ogs::items::Weapon::Proficiency getProficiency () const;
bool isProficient (const ogs::items::Weapon& weapon) const;
private:
bool canAttach (const Object& object) const;
};
/**
* Determine the compatability of this feat. Single weapon proficiency
* feats are repeatable feats. Each time a single weapon feat is taken,
* it applies to a new weapon.
*
* @return Feat::EXCLUSIVE
*/
template <class _WeaponType>
inline ogs::core::Feat::Compatibility
SingleWeapon<_WeaponType>::getCompatibility () const {
return (Feat::REPEATABLE);
}
/**
* Determine proficiency of weapon that this feat applies to.
*
* @return Proficiency of weapon: SIMPLE, MARTIAL, or EXOTIC.
*/
template <class _WeaponType>
inline ogs::items::Weapon::Proficiency
SingleWeapon<_WeaponType>::getProficiency () const {
WeaponType weapon;
return (weapon.getProficiency ());
}
OGS_END_FEATS_NAMESPACE
# endif /* !defined OGS_FEATS_SINGLE_WEAPON_H */
#endif /* defined __cplusplus */
Index: Alertness.cpp
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/feats/Alertness.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Alertness.cpp 25 Mar 2003 06:13:13 -0000 1.2
--- Alertness.cpp 29 Mar 2003 02:10:35 -0000 1.3
***************
*** 44,48 ****
* @return True if the feature is attached to the object.
*/
! bool Alertness::canAttach (Object& object) const {
return (Feat::canAttach (object) &&
!Feat::findFeat<Alertness> (object));
--- 44,48 ----
* @return True if the feature is attached to the object.
*/
! bool Alertness::canAttach (const Object& object) const {
return (Feat::canAttach (object) &&
!Feat::findFeat<Alertness> (object));
***************
*** 79,95 ****
while (itor != skills.end ()) {
using ogs::skills::Listen;
! Listen* listenSkill = dynamic_cast<Listen*> (*itor);
if (listenSkill != NULL) {
! listenSkill->addModifier (this->_modifier);
} else {
using ogs::skills::Spot;
Spot* spotSkill = dynamic_cast<Spot*> (*itor);
if (spotSkill != NULL) {
! spotSkill->addModifier (this->_modifier);
}
}
-
- ++itor;
}
}
--- 79,96 ----
while (itor != skills.end ()) {
+ using ogs::core::Modifiers;
using ogs::skills::Listen;
! Listen* listenSkill = dynamic_cast<Listen*> (*itor++);
if (listenSkill != NULL) {
! Modifiers& modifiers = listenSkill->getModifiers ();
! modifiers.addModifier (this->_modifier);
} else {
using ogs::skills::Spot;
Spot* spotSkill = dynamic_cast<Spot*> (*itor);
if (spotSkill != NULL) {
! Modifiers& modifiers = spotSkill->getModifiers ();
! modifiers.addModifier (this->_modifier);
}
}
}
}
Index: Alertness.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/feats/Alertness.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Alertness.h 25 Mar 2003 06:13:13 -0000 1.2
--- Alertness.h 29 Mar 2003 02:10:36 -0000 1.3
***************
*** 26,30 ****
# define OGS_FEATS_ALERTNESS_H
- # include <ogs/support/Object.h>
# include <ogs/core/Feat.h>
# include <ogs/core/Modifier.h>
--- 26,29 ----
***************
*** 42,54 ****
bool attachObject (Object& object);
bool dettachObject ();
! Object* getObject () const;
! ogs::core::Feat::Compatibility getCompatibility () const;
! ogs::core::Feat::Group getGroup () const;
private:
ogs::core::Modifier _modifier;
! bool canAttach (Object& object) const;
! void addSkillModifier (ogs::support::Object& object);
};
--- 41,52 ----
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 addSkillModifier (Object& object);
};
***************
*** 61,65 ****
inline ogs::core::Feat::Compatibility
Alertness::getCompatibility () const {
! return (ogs::core::Feat::EXCLUSIVE);
}
--- 59,63 ----
inline ogs::core::Feat::Compatibility
Alertness::getCompatibility () const {
! return (Feat::EXCLUSIVE);
}
***************
*** 72,76 ****
inline ogs::core::Feat::Group
Alertness::getGroup () const {
! return (ogs::core::Feat::GENERAL);
}
--- 70,74 ----
inline ogs::core::Feat::Group
Alertness::getGroup () const {
! return (Feat::GENERAL);
}
Index: ArmorProficiency.cpp
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/feats/ArmorProficiency.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** ArmorProficiency.cpp 25 Mar 2003 06:13:13 -0000 1.4
--- ArmorProficiency.cpp 29 Mar 2003 02:10:36 -0000 1.5
***************
*** 21,25 ****
*/
- #include "ogs/support/Object.h"
#include "ogs/core/Creature.h"
#include "ogs/core/Feat.h"
--- 21,24 ----
***************
*** 27,31 ****
#include "ogs/feats/ArmorProficiency.h"
- using ogs::support::Object;
using ogs::core::Creature;
using ogs::items::Armor;
--- 26,29 ----
***************
*** 33,37 ****
static bool
! findArmorProficiency (Creature& creature,
Armor::Proficiency proficiency);
--- 31,35 ----
static bool
! findArmorProficiency (const Creature& creature,
Armor::Proficiency proficiency);
***************
*** 74,83 ****
/**
! * Determine if this feat can be attached to an object.
*
* @param object Object to attach this feat to.
* @return True if this feat is attached to object.
*/
! bool ArmorProficiency::canAttach (Object& object) const {
if (!Feat::canAttach (object)) {
return (false);
--- 72,84 ----
/**
! * Determine if this feat can be attached to an object. An armor
! * proficiency feat can be attached to a creature if the creature does
! * not already have this type of armor proficiency feat and already
! * has the prerequisite feats (if any).
*
* @param object Object to attach this feat to.
* @return True if this feat is attached to object.
*/
! bool ArmorProficiency::canAttach (const Object& object) const {
if (!Feat::canAttach (object)) {
return (false);
***************
*** 85,89 ****
bool success = false;
! Creature& creature = dynamic_cast<Creature&> (object);
if (this->_proficiency == Armor::LIGHT) {
if (! findArmorProficiency (creature, Armor::LIGHT)) {
--- 86,90 ----
bool success = false;
! const Creature& creature = dynamic_cast<const Creature&> (object);
if (this->_proficiency == Armor::LIGHT) {
if (! findArmorProficiency (creature, Armor::LIGHT)) {
***************
*** 113,117 ****
*/
static bool
! findArmorProficiency (Creature& creature,
Armor::Proficiency proficiency) {
Creature::Feats feats = creature.getFeats ();
--- 114,118 ----
*/
static bool
! findArmorProficiency (const Creature& creature,
Armor::Proficiency proficiency) {
Creature::Feats feats = creature.getFeats ();
***************
*** 121,125 ****
while (itor != feats.end ()) {
using ogs::core::Feat;
! Feat* feat = *itor;
ArmorProficiency* armorProficiency =
dynamic_cast <ArmorProficiency*> (feat);
--- 122,126 ----
while (itor != feats.end ()) {
using ogs::core::Feat;
! Feat* feat = *itor++;
ArmorProficiency* armorProficiency =
dynamic_cast <ArmorProficiency*> (feat);
***************
*** 129,134 ****
}
}
-
- ++itor;
}
--- 130,133 ----
Index: ArmorProficiency.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/feats/ArmorProficiency.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ArmorProficiency.h 25 Mar 2003 06:13:13 -0000 1.3
--- ArmorProficiency.h 29 Mar 2003 02:10:36 -0000 1.4
***************
*** 1,5 ****
/*
* ArmorProficiency.h -- class interface for armor proficiency feats
! * Copyright (C) 2002 Eric Lemings <ele...@us...>
*
* This software is free software; you can redistribute it and/or
--- 1,5 ----
/*
* ArmorProficiency.h -- class interface for armor proficiency feats
! * Copyright (C) 2003 Eric Lemings <ele...@us...>
*
* This software is free software; you can redistribute it and/or
***************
*** 26,30 ****
# define OGS_FEATS_ARMOR_PROFICIENCY_H
- # include <ogs/support/Object.h>
# include <ogs/core/Feat.h>
# include <ogs/feats/Namespace.h>
--- 26,29 ----
***************
*** 35,45 ****
/**
* A feat that allows the effective use of armor. A creature that uses
! * armor without begin proficient with it suffers a -4 penalty to attack
! * rolls, ability checks, and skill checks. A creature must be
! * proficient with light armor before the creature can be proficient
! * with medium armor. (The Light Armor Proficiency feat is a
! * prerequisite for the Medium Armor Proficiency feat.) A creature must
! * be proficient with medium armor before the creature can be proficient
! * with heavy armor.
*/
class ArmorProficiency: public ogs::core::Feat {
--- 34,44 ----
/**
* A feat that allows the effective use of armor. A creature that uses
! * armor without begin proficient with it suffers the armor check
! * penalty to attack rolls and skill checks that involve moving
! * including Ride. A creature must be proficient with light armor
! * before the creature can be proficient with medium armor. (The Light
! * Armor Proficiency feat is a prerequisite for the Medium Armor
! * Proficiency feat.) A creature must be proficient with medium armor
! * before the creature can be proficient with heavy armor.
*/
class ArmorProficiency: public ogs::core::Feat {
***************
*** 53,57 ****
ogs::items::Armor::Proficiency getProficiency () const;
! virtual bool isProficient (const ogs::items::Armor& armor) const;
private:
--- 52,56 ----
ogs::items::Armor::Proficiency getProficiency () const;
! bool isProficient (const ogs::items::Armor& armor) const;
private:
***************
*** 60,64 ****
ArmorProficiency (ogs::items::Armor::Proficiency proficiency);
! bool canAttach (Object& object) const;
};
--- 59,63 ----
ArmorProficiency (ogs::items::Armor::Proficiency proficiency);
! bool canAttach (const Object& object) const;
};
Index: ImprovedInitiative.cpp
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/feats/ImprovedInitiative.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ImprovedInitiative.cpp 25 Mar 2003 06:13:13 -0000 1.3
--- ImprovedInitiative.cpp 29 Mar 2003 02:10:36 -0000 1.4
***************
*** 47,51 ****
* @return True if the feature is attached to the object.
*/
! bool ImprovedInitiative::canAttach (Object& object) const {
return (Feat::canAttach (object) &&
!Feat::findFeat<ImprovedInitiative> (object));
--- 47,51 ----
* @return True if the feature is attached to the object.
*/
! bool ImprovedInitiative::canAttach (const Object& object) const {
return (Feat::canAttach (object) &&
!Feat::findFeat<ImprovedInitiative> (object));
Index: ImprovedInitiative.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/feats/ImprovedInitiative.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ImprovedInitiative.h 25 Mar 2003 06:13:13 -0000 1.2
--- ImprovedInitiative.h 29 Mar 2003 02:10:36 -0000 1.3
***************
*** 47,51 ****
static ogs::core::Modifier _modifier;
! bool canAttach (Object& object) const;
};
--- 47,51 ----
static ogs::core::Modifier _modifier;
! bool canAttach (const Object& object) const;
};
Index: ImprovedSave.cpp
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/feats/ImprovedSave.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ImprovedSave.cpp 25 Mar 2003 06:13:13 -0000 1.1
--- ImprovedSave.cpp 29 Mar 2003 02:10:37 -0000 1.2
***************
*** 63,76 ****
/**
! * Determine if this feat can be attached to an object. Since Great
! * Fortitude feats are exclusive feats, they can only be attached to
! * objects that do not already have this feat.
*
* @param object Object to attach this feature to.
* @return True if the feature is attached to the object.
*/
! bool ImprovedSave::canAttach (Object& object) const {
! return (Feat::canAttach (object) &&
! !Feat::findFeat<ImprovedSave> (object));
}
--- 63,94 ----
/**
! * Determine if this feat can be attached to an object. An improved
! * save feat can only be attached to a creature if the creature does not
! * already have this feat.
*
* @param object Object to attach this feature to.
* @return True if the feature is attached to the object.
*/
! bool ImprovedSave::canAttach (const Object& object) const {
! if (! Feat::canAttach (object)) {
! return (false);
! }
!
! const Creature& creature = dynamic_cast<const Creature&> (object);
! Creature::Feats feats = creature.getFeats ();
! Creature::Feats::iterator itor = feats.begin ();
!
! while (itor != feats.end ()) {
! using ogs::core::Feat;
! Feat* feat = *itor++;
! ImprovedSave* improvedSave = dynamic_cast <ImprovedSave*> (feat);
! if (improvedSave != NULL) {
! if (improvedSave->getType () == _type) {
! return (false);
! }
! }
! }
!
! return (true);
}
Index: ImprovedSave.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/feats/ImprovedSave.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ImprovedSave.h 25 Mar 2003 06:13:13 -0000 1.1
--- ImprovedSave.h 29 Mar 2003 02:10:37 -0000 1.2
***************
*** 69,73 ****
ImprovedSave (Type type);
! bool canAttach (Object& object) const;
};
--- 69,73 ----
ImprovedSave (Type type);
! bool canAttach (const Object& object) const;
};
Index: Makefile.am
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/feats/Makefile.am,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Makefile.am 25 Mar 2003 06:13:13 -0000 1.5
--- Makefile.am 29 Mar 2003 02:10:37 -0000 1.6
***************
*** 25,37 ****
pkginclude_HEADERS = \
Alertness.h \
ArmorProficiency.h \
BonusFeat.h \
- ExoticWeapon.h \
ImprovedInitiative.h \
ImprovedSave.h \
- MartialWeapon.h \
Namespace.h \
ShieldProficiency.h \
! SimpleWeapon.h \
Toughness.h \
WeaponProficiency.h
--- 25,36 ----
pkginclude_HEADERS = \
Alertness.h \
+ AllWeapons.h \
ArmorProficiency.h \
BonusFeat.h \
ImprovedInitiative.h \
ImprovedSave.h \
Namespace.h \
ShieldProficiency.h \
! SingleWeapon.h \
Toughness.h \
WeaponProficiency.h
***************
*** 47,55 ****
libogs_feats_la_SOURCES = \
Alertness.cpp \
ArmorProficiency.cpp \
BonusFeat.cpp \
- ExoticWeapon.cpp \
ImprovedInitiative.cpp \
ImprovedSave.cpp \
! MartialWeapon.cpp
--- 46,54 ----
libogs_feats_la_SOURCES = \
Alertness.cpp \
+ AllWeapons.cpp \
ArmorProficiency.cpp \
BonusFeat.cpp \
ImprovedInitiative.cpp \
ImprovedSave.cpp \
! SingleWeapon.cpp
Index: ShieldProficiency.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/feats/ShieldProficiency.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ShieldProficiency.h 7 Jan 2003 07:41:33 -0000 1.1
--- ShieldProficiency.h 29 Mar 2003 02:10:38 -0000 1.2
***************
*** 32,46 ****
/**
! * A shield proficiency feat allows the use of shields without
! * additional penalties.
*/
class ShieldProficiency: public ogs::core::Feat {
public:
! protected:
private:
!
};
OGS_END_FEATS_NAMESPACE
--- 32,79 ----
/**
! * A feat that allows the effective use of shields. A creature that
! * uses a shield without being proficient with it suffers the armor
! * check penalty of the shield on attack rolls and skill checks that
! * involve moving including the Ride skill.
*/
class ShieldProficiency: public ogs::core::Feat {
public:
+ ShieldProficiency ();
! Feat::Compatibility getCompatibility () const;
! Feat::Group getGroup () const;
private:
! bool canAttach (const Object& object) const;
};
+
+ /**
+ * 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);
+ }
OGS_END_FEATS_NAMESPACE
Index: Toughness.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/feats/Toughness.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Toughness.h 7 Jan 2003 07:41:33 -0000 1.1
--- Toughness.h 29 Mar 2003 02:10:38 -0000 1.2
***************
*** 1,5 ****
/*
! * Toughness.h -- class interface for Toughness feat
! * Copyright (C) 2002 Eric Lemings <ele...@us...>
*
* This software is free software; you can redistribute it and/or
--- 1,5 ----
/*
! * Toughness.h -- class interface for Toughness feats
! * Copyright (C) 2003 Eric Lemings <ele...@us...>
*
* This software is free software; you can redistribute it and/or
***************
*** 27,30 ****
--- 27,31 ----
# include <ogs/core/Feat.h>
+ # include <ogs/core/Modifier.h>
# include <ogs/feats/Namespace.h>
***************
*** 32,45 ****
/**
! * A general feat that adds bonus hit points each time it is taken.
*/
class Toughness: public ogs::core::Feat {
public:
! protected:
private:
};
OGS_END_FEATS_NAMESPACE
--- 33,75 ----
/**
! * A feat that adds +3 health points each time it is taken.
*/
class Toughness: public ogs::core::Feat {
public:
+ Toughness ();
! 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);
+ }
OGS_END_FEATS_NAMESPACE
Index: WeaponProficiency.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/feats/WeaponProficiency.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** WeaponProficiency.h 7 Jan 2003 07:41:33 -0000 1.1
--- WeaponProficiency.h 29 Mar 2003 02:10:38 -0000 1.2
***************
*** 1,5 ****
/*
! * WeaponProficiency.h -- class interface for weapon proficiencies
! * Copyright (C) 2002 Eric Lemings <ele...@us...>
*
* This software is free software; you can redistribute it and/or
--- 1,5 ----
/*
! * WeaponProficiency.h -- class interface for weapon proficiency feats
! * Copyright (C) 2003 Eric Lemings <ele...@us...>
*
* This software is free software; you can redistribute it and/or
***************
*** 28,46 ****
# include <ogs/core/Feat.h>
# include <ogs/feats/Namespace.h>
OGS_BEGIN_FEATS_NAMESPACE
/**
! * A weapon proficiency allows the use of certain weapons without a
! * penalty to attack rolls.
*/
class WeaponProficiency: public ogs::core::Feat {
public:
! protected:
! private:
};
OGS_END_FEATS_NAMESPACE
--- 28,78 ----
# include <ogs/core/Feat.h>
# include <ogs/feats/Namespace.h>
+ # include <ogs/items/Weapon.h>
OGS_BEGIN_FEATS_NAMESPACE
/**
! * A feat that allows the effective use of a weapon. A creature that
! * uses a weapon without being proficient with it suffers a -4 penatly
! * to attack rolls. This class is the base class for derived classes
! * that identify specific types of weapons for this proficiency feat.
*/
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);
+ }
+
+ inline WeaponProficiency::~WeaponProficiency () { }
OGS_END_FEATS_NAMESPACE
--- ExoticWeapon.cpp DELETED ---
--- ExoticWeapon.h DELETED ---
--- MartialWeapon.cpp DELETED ---
--- MartialWeapon.h DELETED ---
|
|
From: <ele...@us...> - 2003-03-29 02:10:45
|
Update of /cvsroot/ogs/dist/c++/ogs/items
In directory sc8-pr-cvs1:/tmp/cvs-serv24985/items
Modified Files:
Weapon.cpp Weapon.h
Log Message:
See C++ ChangeLog (Mar 28) for details.
Index: Weapon.cpp
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/items/Weapon.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Weapon.cpp 25 Mar 2003 06:13:13 -0000 1.2
--- Weapon.cpp 29 Mar 2003 02:10:38 -0000 1.3
***************
*** 1,5 ****
/*
! * Weapon.cpp -- class implementation for Weapon item
! * Copyright (C) 2002 Eric Lemings <ele...@us...>
*
* This software is free software; you can redistribute it and/or
--- 1,5 ----
/*
! * Weapon.cpp -- class implementation for weapons
! * Copyright (C) 2003 Eric Lemings <ele...@us...>
*
* This software is free software; you can redistribute it and/or
***************
*** 21,26 ****
--- 21,40 ----
*/
+ #include "ogs/core/Die.h"
+ #include "ogs/core/Size.h"
#include "ogs/items/Weapon.h"
+ using ogs::core::Die;
+ using ogs::core::Size;
using ogs::items::Weapon;
+
+ /**
+ * Create a new weapon. The initial values of the weapon are
+ * unspecified.
+ */
+ Weapon::Weapon (): Item (7.0, Size::MEDIUM, 10), _proficiency (MARTIAL),
+ _type (1 << SLASHING), _damage (Die::d8, 1), _criticalMultiplier (3),
+ _threatRange (20) {
+ // empty constructor body
+ }
Index: Weapon.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/items/Weapon.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Weapon.h 18 Feb 2003 04:17:21 -0000 1.2
--- Weapon.h 29 Mar 2003 02:10:39 -0000 1.3
***************
*** 1,7 ****
/*
* Weapon.h -- class interface for weapons
! * 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
--- 1,6 ----
/*
* Weapon.h -- class interface for weapons
! * 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
***************
*** 26,29 ****
--- 25,30 ----
# define OGS_ITEMS_WEAPON_H
+ # include <bitset>
+
# include <ogs/core/Die.h>
# include <ogs/core/Item.h>
***************
*** 33,37 ****
/**
! * An item used in combat to defeat opponents
*/
class Weapon: public ogs::core::Item {
--- 34,40 ----
/**
! * An item used in combat to damage opponents. Since most weapons
! * differ only in attributes (data) rather than operation (behavior),
! * this class can be instantiated.
*/
class Weapon: public ogs::core::Item {
***************
*** 58,82 ****
* types.
*/
! enum DamageType {
! /** Inflicts bashing damage. */
! BASHING = 4,
! /** Inflicts piercing damage. */
! PIERCING = 8,
! /** Inflicts slashing damage. */
! SLASHING = 16
};
! virtual Proficiency getProficiency () = 0;
! virtual DamageType getDamageType () = 0;
! virtual ogs::core::Die getDamage () = 0;
! protected:
private:
!
};
OGS_END_ITEMS_NAMESPACE
--- 61,147 ----
* types.
*/
! typedef std::bitset<3> Type;
! enum {
! /** Indicates that this weapon inflicts bashing damage. */
! BASHING = 0,
! /** Indicates that this weapon Inflicts piercing damage. */
! PIERCING = 1,
! /** Indicates that this weapon inflicts slashing damage. */
! SLASHING = 2,
};
! Weapon ();
! Weapon (Entity::Weight weight, ogs::core::Size::Type size,
! Item::Worth worth, Proficiency proficiency, Type type,
! const ogs::core::Die& damage, unsigned criticalMultiplier,
! ogs::core::Die::Value threatRange);
! virtual ~Weapon () { }
! Proficiency getProficiency () const;
! Type getType () const;
! ogs::core::Die getDamage () const;
! unsigned getCriticalMultiplier () const;
! ogs::core::Die::Value getThreatRange () const;
private:
! Proficiency _proficiency;
! Type _type;
! ogs::core::Die _damage;
! unsigned _criticalMultiplier;
! ogs::core::Die::Value _threatRange;
};
+
+ /**
+ * Determine the proficiency of this weapon.
+ *
+ * @return Proficiency of this weapon: SIMPLE, MARTIAL, or EXOTIC.
+ */
+ inline Weapon::Proficiency
+ Weapon::getProficiency () const {
+ return (this->_proficiency);
+ }
+
+ /**
+ * Determine the type of this weapon.
+ *
+ * @return Type of this weapon.
+ */
+ inline Weapon::Type
+ Weapon::getType () const {
+ return (this->_type);
+ }
+
+ /**
+ * Determine the damage caused by this weapon.
+ *
+ * @return Damage from this weapon.
+ */
+ inline ogs::core::Die
+ Weapon::getDamage () const {
+ return (this->_damage);
+ }
+
+ /**
+ * Determine the critical multiplier of this weapon.
+ *
+ * @return Critical multiplier of this weapon.
+ */
+ inline unsigned
+ Weapon::getCriticalMultiplier () const {
+ return (this->_criticalMultiplier);
+ }
+
+ /**
+ * Determine the threat range of this weapon.
+ *
+ * @return Threat range of this weapon.
+ */
+ inline ogs::core::Die::Value
+ Weapon::getThreatRange () const {
+ return (this->_threatRange);
+ }
OGS_END_ITEMS_NAMESPACE
|
|
From: <ele...@us...> - 2003-03-29 02:10:38
|
Update of /cvsroot/ogs/dist/c++/ogs/core/abilities In directory sc8-pr-cvs1:/tmp/cvs-serv24985/core/abilities Removed Files: Charisma.cpp Charisma.h Constitution.cpp Constitution.h Dexterity.cpp Dexterity.h Intelligence.cpp Intelligence.h Makefile.am Namespace.h Strength.cpp Strength.h Wisdom.cpp Wisdom.h Log Message: See C++ ChangeLog (Mar 28) for details. --- Charisma.cpp DELETED --- --- Charisma.h DELETED --- --- Constitution.cpp DELETED --- --- Constitution.h DELETED --- --- Dexterity.cpp DELETED --- --- Dexterity.h DELETED --- --- Intelligence.cpp DELETED --- --- Intelligence.h DELETED --- --- Makefile.am DELETED --- --- Namespace.h DELETED --- --- Strength.cpp DELETED --- --- Strength.h DELETED --- --- Wisdom.cpp DELETED --- --- Wisdom.h DELETED --- |
|
From: <ele...@us...> - 2003-03-25 08:13:31
|
Update of /cvsroot/ogs/dist/c++/ogs/feats
In directory sc8-pr-cvs1:/tmp/cvs-serv6091
Modified Files:
BonusFeat.h
Log Message:
Changed group from General to Special.
Index: BonusFeat.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/feats/BonusFeat.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** BonusFeat.h 25 Mar 2003 06:13:13 -0000 1.2
--- BonusFeat.h 25 Mar 2003 08:13:26 -0000 1.3
***************
*** 123,134 ****
/**
* Determine the group that this feat belongs to. Bonus feats are
! * general feats by themselves. After a feat is selected, the group of
* a bonus feat is the same as the selected feat.
*
! * @return Feat::GENERAL or group of selected feat.
*/
inline Feat::Group
BonusFeat::getGroup () const {
! return (_feat != NULL? _feat->getGroup (): Feat::GENERAL);
}
--- 123,134 ----
/**
* Determine the group that this feat belongs to. Bonus feats are
! * special feats by themselves. After a feat is selected, the group of
* a bonus feat is the same as the selected feat.
*
! * @return Feat::SPECIAL or group of selected feat.
*/
inline Feat::Group
BonusFeat::getGroup () const {
! return (_feat != NULL? _feat->getGroup (): Feat::SPECIAL);
}
|
|
From: <ele...@us...> - 2003-03-25 08:12:35
|
Update of /cvsroot/ogs/dist/c++/ogs/core
In directory sc8-pr-cvs1:/tmp/cvs-serv5846
Modified Files:
Feat.h
Log Message:
Minor doc updates.
Index: Feat.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/core/Feat.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Feat.h 25 Mar 2003 06:13:11 -0000 1.5
--- Feat.h 25 Mar 2003 08:12:27 -0000 1.6
***************
*** 76,81 ****
/**
! * A general-purpose feat. General feats are feats that do not
! * fall into one of the other groups.
*/
GENERAL = 0,
--- 76,82 ----
/**
! * A general-purpose feat. General feats are feats that can be
! * used by all creatures and cclasses or apply to many different
! * situations.
*/
GENERAL = 0,
***************
*** 98,101 ****
--- 99,104 ----
/**
* A feat that does not belong to one of the other groups.
+ * Special feats are feats that can only be selected only by
+ * particular cclasses or creatures or used in certain situations.
*/
SPECIAL = 3,
|
|
From: <ele...@us...> - 2003-03-25 06:13:45
|
Update of /cvsroot/ogs/dist/c++/ogs/creatures In directory sc8-pr-cvs1:/tmp/cvs-serv1939/c++/ogs/creatures Modified Files: Humanoids.h Log Message: See C++ ChangeLog file (Mar 24) for details. Index: Humanoids.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/creatures/Humanoids.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Humanoids.h 23 Mar 2003 22:14:36 -0000 1.1 --- Humanoids.h 25 Mar 2003 06:13:12 -0000 1.2 *************** *** 21,28 **** */ ! #ifdef __cplusplus ! ! # ifndef OGS_CREATURES_HUMANOIDS_H ! # define OGS_CREATURES_HUMANOIDS_H // Uncomment these as they are completed. --- 21,26 ---- */ ! #ifndef OGS_CREATURES_HUMANOIDS_H ! # define OGS_CREATURES_HUMANOIDS_H // Uncomment these as they are completed. *************** *** 33,40 **** //# include <ogs/creatures/humanoids/HalfOrc.h> //# include <ogs/creatures/humanoids/Halfling.h> ! # include <ogs/creatures/humanoids/Human.h> ! ! # endif /* !defined OGS_CREATURES_HUMANOIDS_H */ ! #endif /* defined __cplusplus */ --- 31,36 ---- //# include <ogs/creatures/humanoids/HalfOrc.h> //# include <ogs/creatures/humanoids/Halfling.h> ! # include <ogs/creatures/humanoids/Human.h> ! #endif /* !defined OGS_CREATURES_HUMANOIDS_H */ |
|
From: <ele...@us...> - 2003-03-25 06:13:45
|
Update of /cvsroot/ogs/dist/c++/ogs/core/details In directory sc8-pr-cvs1:/tmp/cvs-serv1939/c++/ogs/core/details Modified Files: Gender.cpp Log Message: See C++ ChangeLog file (Mar 24) for details. Index: Gender.cpp =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/core/details/Gender.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Gender.cpp 5 Feb 2003 06:01:28 -0000 1.1 --- Gender.cpp 25 Mar 2003 06:13:12 -0000 1.2 *************** *** 24,28 **** #include <string> ! #include "Gender.h" using ogs::core::details::Gender; --- 24,28 ---- #include <string> ! #include "ogs/core/details/Gender.h" using ogs::core::details::Gender; |
Update of /cvsroot/ogs/dist/c++/ogs/core
In directory sc8-pr-cvs1:/tmp/cvs-serv1939/c++/ogs/core
Modified Files:
Abilities.cpp Ability.cpp Creature.cpp Creature.h Defense.cpp
Details.h Die.cpp Entity.cpp Entity.h Experience.cpp Feat.cpp
Feat.h Feature.cpp Feature.h Item.h Makefile.am Modifier.cpp
Modifiers.cpp Skill.cpp
Removed Files:
Size.cpp
Log Message:
See C++ ChangeLog file (Mar 24) for details.
Index: Abilities.cpp
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/core/Abilities.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Abilities.cpp 7 Jan 2003 07:41:32 -0000 1.1
--- Abilities.cpp 25 Mar 2003 06:13:11 -0000 1.2
***************
*** 23,27 ****
#include <stdexcept>
! #include "Abilities.h"
using ogs::core::Abilities;
--- 23,27 ----
#include <stdexcept>
! #include "ogs/core/Abilities.h"
using ogs::core::Abilities;
Index: Ability.cpp
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/core/Ability.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Ability.cpp 13 Jan 2003 05:22:15 -0000 1.2
--- Ability.cpp 25 Mar 2003 06:13:11 -0000 1.3
***************
*** 25,29 ****
#include <ogs/Support.h>
! #include "Ability.h"
using namespace ogs::support;
--- 25,29 ----
#include <ogs/Support.h>
! #include "ogs/core/Ability.h"
using namespace ogs::support;
Index: Creature.cpp
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/core/Creature.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Creature.cpp 23 Mar 2003 22:14:36 -0000 1.6
--- Creature.cpp 25 Mar 2003 06:13:11 -0000 1.7
***************
*** 23,30 ****
#include <algorithm>
! #include "Creature.h"
using ogs::core::Creature;
using ogs::core::Die;
/**
--- 23,32 ----
#include <algorithm>
! #include "ogs/core/Creature.h"
! #include "ogs/core/Feat.h"
using ogs::core::Creature;
using ogs::core::Die;
+ using ogs::core::Feat;
/**
Index: Creature.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/core/Creature.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Creature.h 23 Mar 2003 22:14:36 -0000 1.6
--- Creature.h 25 Mar 2003 06:13:11 -0000 1.7
***************
*** 32,44 ****
# include <ogs/core/Die.h>
# include <ogs/core/Entity.h>
- # include <ogs/core/Feat.h>
# include <ogs/core/Modifiers.h>
# include <ogs/core/Namespace.h>
# include <ogs/core/Saves.h>
- # include <ogs/core/Skill.h>
OGS_BEGIN_CORE_NAMESPACE
class Character;
/**
--- 32,44 ----
# include <ogs/core/Die.h>
# include <ogs/core/Entity.h>
# include <ogs/core/Modifiers.h>
# include <ogs/core/Namespace.h>
# include <ogs/core/Saves.h>
OGS_BEGIN_CORE_NAMESPACE
class Character;
+ class Feat;
+ class Skill;
/**
Index: Defense.cpp
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/core/Defense.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Defense.cpp 7 Jan 2003 07:41:32 -0000 1.1
--- Defense.cpp 25 Mar 2003 06:13:11 -0000 1.2
***************
*** 23,28 ****
#include <ogs/support/Event.h>
! #include "Defense.h"
! #include "Modifier.h"
using ogs::support::Event;
--- 23,28 ----
#include <ogs/support/Event.h>
! #include "ogs/core/Defense.h"
! #include "ogs/core/Modifier.h"
using ogs::support::Event;
Index: Details.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/core/Details.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Details.h 5 Feb 2003 06:01:28 -0000 1.1
--- Details.h 25 Mar 2003 06:13:11 -0000 1.2
***************
*** 21,36 ****
*/
! #ifdef __cplusplus
!
! # ifndef OGS_DETAILS_H
! # define OGS_DETAILS_H
!
! # include <ogs/core/details/Alignment.h>
! # include <ogs/core/details/Description.h>
! # include <ogs/core/details/Gender.h>
! # include <ogs/core/details/Quantity.h>
! # endif /* !defined OGS_DETAILS_H */
! #endif /* defined __cplusplus */
--- 21,32 ----
*/
! #ifndef OGS_DETAILS_H
! # define OGS_DETAILS_H
! # include <ogs/core/details/Alignment.h>
! # include <ogs/core/details/Description.h>
! # include <ogs/core/details/Gender.h>
! # include <ogs/core/details/Quantity.h>
! #endif /* !defined OGS_DETAILS_H */
Index: Die.cpp
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/core/Die.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Die.cpp 23 Mar 2003 22:14:36 -0000 1.2
--- Die.cpp 25 Mar 2003 06:13:11 -0000 1.3
***************
*** 24,30 ****
#include <cstdlib>
! #include <ogs/support/Event.h>
!
! #include "Die.h"
using ogs::core::Die;
--- 24,29 ----
#include <cstdlib>
! #include "ogs/support/Event.h"
! #include "ogs/core/Die.h"
using ogs::core::Die;
Index: Entity.cpp
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/core/Entity.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Entity.cpp 23 Mar 2003 22:14:36 -0000 1.3
--- Entity.cpp 25 Mar 2003 06:13:11 -0000 1.4
***************
*** 21,27 ****
*/
! #include <ogs/support/Event.h>
!
! #include "Entity.h"
using ogs::support::Event;
--- 21,26 ----
*/
! #include "ogs/support/Event.h"
! #include "ogs/core/Entity.h"
using ogs::support::Event;
***************
*** 47,51 ****
* @param weight Weight of entity.
*/
! void Entity::setWeight (float weight) {
Event event (*this);
this->_weight = weight;
--- 46,50 ----
* @param weight Weight of entity.
*/
! void Entity::setWeight (Weight weight) {
Event event (*this);
this->_weight = weight;
***************
*** 58,62 ****
* @param currentHealth Current health of this entity.
*/
! void Entity::setCurrentHealth (int currentHealth) {
// TODO: Make this a little more robust.
this->_currentHealth = currentHealth;
--- 57,61 ----
* @param currentHealth Current health of this entity.
*/
! void Entity::setCurrentHealth (Health currentHealth) {
// TODO: Make this a little more robust.
this->_currentHealth = currentHealth;
***************
*** 68,72 ****
* @param maximumHealth Maximum health of this entity.
*/
! void Entity::setMaximumHealth (int maximumHealth) {
// TODO: Make this a little more robust.
this->_maximumHealth = maximumHealth;
--- 67,71 ----
* @param maximumHealth Maximum health of this entity.
*/
! void Entity::setMaximumHealth (Health maximumHealth) {
// TODO: Make this a little more robust.
this->_maximumHealth = maximumHealth;
Index: Entity.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/core/Entity.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Entity.h 23 Mar 2003 22:14:36 -0000 1.3
--- Entity.h 25 Mar 2003 06:13:11 -0000 1.4
***************
*** 26,30 ****
# define OGS_CORE_ENTITY_H
! # include <vector>
# include <ogs/support/Object.h>
--- 26,30 ----
# define OGS_CORE_ENTITY_H
! //# include <vector>
# include <ogs/support/Object.h>
***************
*** 37,57 ****
/**
! * An object in the game world. The @c Entity class is an abstract
! * class that contains attributes and operations common to all entities.
*/
class Entity: public ogs::support::Object {
public:
! virtual ~Entity () = 0;
! typedef std::vector<Feature*> Features;
! float getWeight () const;
! void setWeight (float weight);
Size& getSize ();
Defense& getDefense ();
! int getCurrentHealth () const;
! void setCurrentHealth (int currentHealth);
! int getMaximumHealth () const;
! void setMaximumHealth (int maximumHealth);
protected:
--- 37,64 ----
/**
! * An object in the game world. Entities are typically living creatures
! * or nonliving items. The @c Entity class is an abstract class that
! * contains attributes and operations common to all entities.
*/
class Entity: public ogs::support::Object {
public:
! /** Measures weight of entity. */
! typedef double Weight;
! /** Measures health or condition of entity. */
! typedef int Health;
! //typedef std::vector<Feature*> Features;
!
! Weight getWeight () const;
! void setWeight (Weight weight);
Size& getSize ();
Defense& getDefense ();
! Health getCurrentHealth () const;
! void setCurrentHealth (Health currentHealth);
! Health getMaximumHealth () const;
! void setMaximumHealth (Health maximumHealth);
!
! virtual ~Entity () = 0;
protected:
***************
*** 59,67 ****
private:
! float _weight;
Size _size;
Defense _defense;
! int _currentHealth;
! int _maximumHealth;
//Features _features;
};
--- 66,74 ----
private:
! Weight _weight;
Size _size;
Defense _defense;
! Health _currentHealth;
! Health _maximumHealth;
//Features _features;
};
***************
*** 73,77 ****
* @return current weight
*/
! inline float Entity::getWeight () const {
return (this->_weight);
}
--- 80,84 ----
* @return current weight
*/
! inline Entity::Weight Entity::getWeight () const {
return (this->_weight);
}
***************
*** 101,105 ****
* @return current health
*/
! inline int Entity::getCurrentHealth () const {
return (this->_currentHealth);
}
--- 108,112 ----
* @return current health
*/
! inline Entity::Health Entity::getCurrentHealth () const {
return (this->_currentHealth);
}
***************
*** 110,114 ****
* @return maximum health
*/
! inline int Entity::getMaximumHealth () const {
return (this->_maximumHealth);
}
--- 117,121 ----
* @return maximum health
*/
! inline Entity::Health Entity::getMaximumHealth () const {
return (this->_maximumHealth);
}
Index: Experience.cpp
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/core/Experience.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Experience.cpp 13 Jan 2003 05:22:15 -0000 1.2
--- Experience.cpp 25 Mar 2003 06:13:11 -0000 1.3
***************
*** 21,25 ****
*/
! #include "Experience.h"
using ogs::core::Experience;
--- 21,25 ----
*/
! #include "ogs/core/Experience.h"
using ogs::core::Experience;
Index: Feat.cpp
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/core/Feat.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Feat.cpp 13 Jan 2003 05:22:15 -0000 1.2
--- Feat.cpp 25 Mar 2003 06:13:11 -0000 1.3
***************
*** 21,27 ****
*/
! #include <stdexcept>
!
! #include "Feat.h"
using ogs::core::Experience;
--- 21,26 ----
*/
! #include "ogs/core/Creature.h"
! #include "ogs/core/Feat.h"
using ogs::core::Experience;
***************
*** 45,48 ****
--- 44,88 ----
return (xpLevel);
+ }
+
+ /**
+ * Determine if this feat can be attached to an object. Feats can only
+ * be attached to creatures. If the object is not a creature, this
+ * function will return false.
+ *
+ * @param object Object to attach this feature to.
+ * @return True if the feature is attached to the object.
+ */
+ bool Feat::canAttach (Object& object) const {
+ return (Feature::canAttach (object) &&
+ dynamic_cast<Creature*> (&object) != NULL);
+ }
+
+ /**
+ * Determine if a creature has a feat.
+ *
+ * @param creature Creature to check.
+ * @return True if creature has an instance of FeatClass.
+ */
+ template <class FeatClass>
+ bool Feat::findFeat (Object& object) const {
+ bool found = false;
+ Creature* creature = dynamic_cast<Creature*> (&object);
+
+ if (creature != NULL) {
+ Creature::Feats feats = creature->getFeats ();
+ Creature::Feats::iterator itor = feats.begin ();
+
+ while (itor != feats.end ()) {
+ FeatClass* feat = dynamic_cast <FeatClass*> (*itor);
+ if (feat != NULL) {
+ found = true;
+ }
+
+ ++itor;
+ }
+ }
+
+ return (found);
}
Index: Feat.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/core/Feat.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Feat.h 23 Mar 2003 22:14:36 -0000 1.4
--- Feat.h 25 Mar 2003 06:13:11 -0000 1.5
***************
*** 69,72 ****
--- 69,105 ----
};
+ /**
+ * The group that a feat belongs to. Feats can be classified into
+ * several different groups.
+ */
+ enum Group {
+
+ /**
+ * A general-purpose feat. General feats are feats that do not
+ * fall into one of the other groups.
+ */
+ GENERAL = 0,
+
+ /**
+ * A combat-use feat. Combat feats are feats that are
+ * specifically designed for use in combat. The bonus feats
+ * granted to fighters are limited to combat feats.
+ */
+ COMBAT = 1,
+
+ /**
+ * A magic-related feat. Magic feats include metamagic feats for
+ * enhancing spells and item creation feats for creating magic
+ * items. The bonus feats granted to wizards are limited to magic
+ * feats.
+ */
+ MAGIC = 2,
+
+ /**
+ * A feat that does not belong to one of the other groups.
+ */
+ SPECIAL = 3,
+ };
+
static unsigned getSlotCount (Experience::Level xpLevel);
static Experience::Level getSlotCountLevel (unsigned slotCount);
***************
*** 78,81 ****
--- 111,129 ----
*/
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 (ogs::support::Object& object) const;
+
+ template <class FeatClass>
+ bool findFeat (ogs::support::Object& object) const;
};
***************
*** 90,93 ****
--- 138,143 ----
return (xpLevel < 2? xpLevel: xpLevel / 3 + 1);
}
+
+ inline Feat::~Feat () { }
OGS_END_CORE_NAMESPACE
Index: Feature.cpp
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/core/Feature.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Feature.cpp 25 Feb 2003 19:40:18 -0000 1.2
--- Feature.cpp 25 Mar 2003 06:13:11 -0000 1.3
***************
*** 21,25 ****
*/
! #include "Feature.h"
using ogs::core::Feature;
--- 21,25 ----
*/
! #include "ogs/core/Feature.h"
using ogs::core::Feature;
***************
*** 33,45 ****
*/
bool Feature::attachObject (Object& object) {
! bool success = false;
! // A feature can not be attached to itself.
! if (&object != this) {
this->_object = &object;
- success = true;
}
! return (success);
}
--- 33,59 ----
*/
bool Feature::attachObject (Object& object) {
! bool attached = canAttach (object);
! if (attached) {
this->_object = &object;
}
! return (attached);
! }
!
! /**
! * Detach this feature from an object. This method should always be
! * called last by derived classes that override this method.
! *
! * @return True if the feature is detached from the object.
! */
! bool Feature::detachObject () {
! bool detached = canDetach ();
!
! if (detached) {
! this->_object = NULL;
! }
!
! return (detached);
}
Index: Feature.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/core/Feature.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Feature.h 25 Feb 2003 19:40:18 -0000 1.2
--- Feature.h 25 Mar 2003 06:13:11 -0000 1.3
***************
*** 31,36 ****
OGS_BEGIN_CORE_NAMESPACE
- using ogs::support::Object;
-
/**
* A feature is an object that can be attached to another object. While
--- 31,34 ----
***************
*** 39,65 ****
* detached from the object.
*/
! class Feature: public Object {
public:
! virtual bool attachObject (Object& object);
virtual bool detachObject ();
! const Object* getObject () const;
! Object* getObject ();
virtual ~Feature ();
private:
! Object* _object;
};
/**
! * Detach this feature from an object. This method should always be
! * called last by derived classes that override this method.
*
! * @return True if the feature is detached from the object.
*/
! inline bool Feature::detachObject () {
! this->_object = NULL;
! return (true);
}
--- 37,66 ----
* detached from the object.
*/
! class Feature: public ogs::support::Object {
public:
! virtual bool attachObject (ogs::support::Object& object);
virtual bool detachObject ();
! const ogs::support::Object* getObject () const;
! ogs::support::Object* getObject ();
virtual ~Feature ();
+ protected:
+ virtual bool canAttach (ogs::support::Object& object) const;
+ virtual bool canDetach () const;
+
private:
! ogs::support::Object* _object;
};
/**
! * Determine the object that this feature is currently attached to.
*
! * @return Attached object or NULL if not attached.
*/
! inline const ogs::support::Object*
! Feature::getObject () const {
! return (this->_object);
}
***************
*** 69,83 ****
* @return Attached object or NULL if not attached.
*/
! inline const 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 Object* Feature::getObject () {
! return (this->_object);
}
--- 70,99 ----
* @return Attached object or NULL if not attached.
*/
! inline ogs::support::Object*
! Feature::getObject () {
return (this->_object);
}
/**
! * Determine if this feature can be attached to an object. A feature
! * can not be attached to itself or if it is already attached.
*
! * @param object Object to attach this feature to.
! * @return True if the feature is attached to the object.
*/
! inline bool
! Feature::canAttach (Object& object) const {
! return (&object != this && _object == NULL);
! }
!
! /**
! * Determine if this feature can be detached to an object.
! *
! * @param object Object to detach this feature from.
! * @return True if the feature is detached from the object.
! */
! inline bool
! Feature::canDetach () const {
! return (true);
}
Index: Item.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/core/Item.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Item.h 7 Jan 2003 07:41:33 -0000 1.1
--- Item.h 25 Mar 2003 06:13:11 -0000 1.2
***************
*** 35,40 ****
--- 35,82 ----
*/
class Item: public Entity {
+ public:
+ /**
+ * Measures how hard the material is that the item is made of.
+ * Higher values indicate harder items that are harder to break.
+ */
+ typedef unsigned Hardness;
+
+ /**
+ * Measures how thick the item is. Thickness is used to calculate
+ * health of the item. Units of measure are locale-dependent.
+ */
+ typedef double Thickness;
+
+ /**
+ * Number of health points per unit of thickness. Density is also
+ * used to calculate health of the item.
+ */
+ typedef Entity::Health Density;
+
+ /**
+ * Measures how much the item is worth. Units of measure are
+ * locale-dependent.
+ */
+ typedef double Worth;
+
+ Worth getWorth () const;
+ void setWorth (Worth worth);
+ protected:
+ Item ();
+
+ private:
+ Worth _worth;
};
+
+ /**
+ * Determine the worth of this item.
+ *
+ * @return Worth of this item.
+ */
+ inline Item::Worth
+ Item::getWorth () const {
+ return (this->_worth);
+ }
OGS_END_CORE_NAMESPACE
Index: Makefile.am
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/core/Makefile.am,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Makefile.am 4 Mar 2003 03:24:41 -0000 1.5
--- Makefile.am 25 Mar 2003 06:13:11 -0000 1.6
***************
*** 74,78 ****
Modifier.cpp \
Modifiers.cpp \
- Size.cpp \
Skill.cpp
libogs_core_la_LIBADD = \
--- 74,77 ----
Index: Modifier.cpp
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/core/Modifier.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Modifier.cpp 7 Jan 2003 07:41:33 -0000 1.1
--- Modifier.cpp 25 Mar 2003 06:13:11 -0000 1.2
***************
*** 25,31 ****
#include <typeinfo>
! #include <ogs/Support.h>
!
! #include "Modifier.h"
using namespace ogs::support;
--- 25,30 ----
#include <typeinfo>
! #include "ogs/Support.h"
! #include "ogs/core/Modifier.h"
using namespace ogs::support;
Index: Modifiers.cpp
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/core/Modifiers.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Modifiers.cpp 7 Jan 2003 07:41:33 -0000 1.1
--- Modifiers.cpp 25 Mar 2003 06:13:11 -0000 1.2
***************
*** 21,25 ****
*/
! #include "Modifiers.h"
using ogs::support::Event;
--- 21,25 ----
*/
! #include "ogs/core/Modifiers.h"
using ogs::support::Event;
Index: Skill.cpp
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/core/Skill.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Skill.cpp 24 Feb 2003 11:14:21 -0000 1.2
--- Skill.cpp 25 Mar 2003 06:13:11 -0000 1.3
***************
*** 23,29 ****
#include <stdexcept>
! //#include <ogs/support/Event.h>
!
! #include "Skill.h"
using ogs::support::Event;
--- 23,28 ----
#include <stdexcept>
! //#include "ogs/support/Event.h"
! #include "ogs/core/Skill.h"
using ogs::support::Event;
--- Size.cpp DELETED ---
|
|
From: <ele...@us...> - 2003-03-25 06:13:44
|
Update of /cvsroot/ogs/dist/c++/ogs/combat In directory sc8-pr-cvs1:/tmp/cvs-serv1939/c++/ogs/combat Modified Files: Combatant.cpp Encounter.cpp Log Message: See C++ ChangeLog file (Mar 24) for details. Index: Combatant.cpp =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/combat/Combatant.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Combatant.cpp 18 Feb 2003 04:17:21 -0000 1.3 --- Combatant.cpp 25 Mar 2003 06:13:10 -0000 1.4 *************** *** 21,25 **** */ ! #include "Combatant.h" using ogs::core::Creature; --- 21,25 ---- */ ! #include "ogs/combat/Combatant.h" using ogs::core::Creature; Index: Encounter.cpp =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/combat/Encounter.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Encounter.cpp 18 Feb 2003 04:17:21 -0000 1.3 --- Encounter.cpp 25 Mar 2003 06:13:11 -0000 1.4 *************** *** 23,27 **** #include <algorithm> ! #include "Encounter.h" using ogs::combat::Encounter; --- 23,27 ---- #include <algorithm> ! #include "ogs/combat/Encounter.h" using ogs::combat::Encounter; |
|
From: <ele...@us...> - 2003-03-25 06:13:44
|
Update of /cvsroot/ogs/dist/c++/ogs/core/abilities In directory sc8-pr-cvs1:/tmp/cvs-serv1939/c++/ogs/core/abilities Modified Files: Strength.cpp Log Message: See C++ ChangeLog file (Mar 24) for details. Index: Strength.cpp =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/core/abilities/Strength.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Strength.cpp 27 Feb 2003 22:42:16 -0000 1.2 --- Strength.cpp 25 Mar 2003 06:13:11 -0000 1.3 *************** *** 23,27 **** #include <cmath> ! #include "Strength.h" using ogs::core::abilities::Strength; --- 23,27 ---- #include <cmath> ! #include "ogs/core/abilities/Strength.h" using ogs::core::abilities::Strength; |
Update of /cvsroot/ogs/dist/c++/ogs In directory sc8-pr-cvs1:/tmp/cvs-serv1939/c++/ogs Modified Files: CClasses.h Combat.h Core.h Creatures.h Feats.h Magic.h Skills.h Spells.h Support.h Log Message: See C++ ChangeLog file (Mar 24) for details. Index: CClasses.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/CClasses.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CClasses.h 7 Jan 2003 07:41:32 -0000 1.1 --- CClasses.h 25 Mar 2003 06:13:10 -0000 1.2 *************** *** 1,4 **** /* ! * CClasses.h -- declarations for universal cclasses * Copyright (C) 2002 Eric Lemings <ele...@us...> * --- 1,4 ---- /* ! * CClasses.h -- declarations for common cclasses * Copyright (C) 2002 Eric Lemings <ele...@us...> * *************** *** 21,34 **** */ ! #ifdef __cplusplus ! ! # ifndef OGS_CCLASSES_H ! # define OGS_CCLASSES_H ! ! # include <ogs/cclasses/Commoner.h> ! # include <ogs/cclasses/Fighter.h> ! # endif /* !defined OGS_CCLASSES_H */ ! #endif /* defined __cplusplus */ --- 21,39 ---- */ ! #ifndef OGS_CCLASSES_H ! # define OGS_CCLASSES_H ! # include <ogs/cclasses/Barbarian.h> ! # include <ogs/cclasses/Bard.h> ! # include <ogs/cclasses/Cleric.h> ! # include <ogs/cclasses/Druid.h> ! # include <ogs/cclasses/Fighter.h> ! # include <ogs/cclasses/Monk.h> ! # include <ogs/cclasses/Paladin.h> ! # include <ogs/cclasses/Ranger.h> ! # include <ogs/cclasses/Rogue.h> ! # include <ogs/cclasses/Sorcerer.h> ! # include <ogs/cclasses/Wizard.h> ! #endif /* !defined OGS_CCLASSES_H */ Index: Combat.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/Combat.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Combat.h 5 Feb 2003 06:01:27 -0000 1.2 --- Combat.h 25 Mar 2003 06:13:10 -0000 1.3 *************** *** 21,36 **** */ ! #ifdef __cplusplus ! ! # ifndef OGS_COMBAT_H ! # define OGS_COMBAT_H ! ! # include <ogs/combat/Action.h> ! # include <ogs/combat/Actions.h> ! # include <ogs/combat/Combatant.h> ! # include <ogs/combat/Encounter.h> ! # endif /* !defined OGS_COMBAT_H */ ! #endif /* defined __cplusplus */ --- 21,32 ---- */ ! #ifndef OGS_COMBAT_H ! # define OGS_COMBAT_H ! # include <ogs/combat/Action.h> ! # include <ogs/combat/Actions.h> ! # include <ogs/combat/Combatant.h> ! # include <ogs/combat/Encounter.h> ! #endif /* !defined OGS_COMBAT_H */ Index: Core.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/Core.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Core.h 5 Feb 2003 06:01:27 -0000 1.2 --- Core.h 25 Mar 2003 06:13:10 -0000 1.3 *************** *** 21,53 **** */ ! #ifdef __cplusplus ! ! # ifndef OGS_CORE_H ! # define OGS_CORE_H ! ! # include <ogs/core/Ability.h> ! # include <ogs/core/Abilities.h> ! # include <ogs/core/CClass.h> ! # include <ogs/core/Character.h> ! # include <ogs/core/Creature.h> ! # include <ogs/core/Defense.h> ! # include <ogs/core/Detail.h> ! # include <ogs/core/Details.h> ! # include <ogs/core/Die.h> ! # include <ogs/core/Entity.h> ! # include <ogs/core/Experience.h> ! # include <ogs/core/Feat.h> ! # include <ogs/core/Feature.h> ! # include <ogs/core/Item.h> ! # include <ogs/core/Modifier.h> ! # include <ogs/core/Modifiers.h> ! # include <ogs/core/Namespace.h> ! # include <ogs/core/Saves.h> ! # include <ogs/core/Size.h> ! # include <ogs/core/Skill.h> ! # include <ogs/core/Task.h> ! # endif /* !defined OGS_CORE_H */ ! #endif /* defined __cplusplus */ --- 21,49 ---- */ ! #ifndef OGS_CORE_H ! # define OGS_CORE_H ! # include <ogs/core/Ability.h> ! # include <ogs/core/Abilities.h> ! # include <ogs/core/CClass.h> ! # include <ogs/core/Character.h> ! # include <ogs/core/Creature.h> ! # include <ogs/core/Defense.h> ! # include <ogs/core/Detail.h> ! # include <ogs/core/Details.h> ! # include <ogs/core/Die.h> ! # include <ogs/core/Entity.h> ! # include <ogs/core/Experience.h> ! # include <ogs/core/Feat.h> ! # include <ogs/core/Feature.h> ! # include <ogs/core/Item.h> ! # include <ogs/core/Modifier.h> ! # include <ogs/core/Modifiers.h> ! # include <ogs/core/Namespace.h> ! # include <ogs/core/Saves.h> ! # include <ogs/core/Size.h> ! # include <ogs/core/Skill.h> ! # include <ogs/core/Task.h> ! #endif /* !defined OGS_CORE_H */ Index: Creatures.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/Creatures.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Creatures.h 7 Jan 2003 07:41:32 -0000 1.1 --- Creatures.h 25 Mar 2003 06:13:10 -0000 1.2 *************** *** 1,4 **** /* ! * Creatures.h -- declarations for universal creatures * Copyright (C) 2002 Eric Lemings <ele...@us...> * --- 1,4 ---- /* ! * Creatures.h -- declarations for common creatures * Copyright (C) 2002 Eric Lemings <ele...@us...> * *************** *** 21,34 **** */ ! #ifdef __cplusplus ! ! # ifndef OGS_CREATURES_H ! # define OGS_CREATURES_H ! ! # include <ogs/creatures/Human.h> ! # include <ogs/creatures/Humanoid.h> ! # endif /* !defined OGS_CREATURES_H */ ! #endif /* defined __cplusplus */ --- 21,29 ---- */ ! #ifndef OGS_CREATURES_H ! # define OGS_CREATURES_H ! # include <ogs/creatures/Humanoids.h> ! #endif /* !defined OGS_CREATURES_H */ Index: Feats.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/Feats.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Feats.h 7 Jan 2003 07:41:32 -0000 1.1 --- Feats.h 25 Mar 2003 06:13:10 -0000 1.2 *************** *** 1,4 **** /* ! * Feats.h -- declarations for universal feats * Copyright (C) 2002 Eric Lemings <ele...@us...> * --- 1,4 ---- /* ! * Feats.h -- declarations for common feats * Copyright (C) 2002 Eric Lemings <ele...@us...> * *************** *** 21,47 **** */ ! #ifdef __cplusplus ! ! # ifndef OGS_FEATS_H ! # define OGS_FEATS_H ! ! # include <ogs/feats/ArmorProficiency.h> ! # include <ogs/feats/ExoticWeapon.h> ! # include <ogs/feats/GreatFortitude.h> ! # include <ogs/feats/HeavyArmor.h> ! # include <ogs/feats/ImprovedInitiative.h> ! # include <ogs/feats/IronWill.h> ! # include <ogs/feats/LightArmor.h> ! # include <ogs/feats/LightningReflexes.h> ! # include <ogs/feats/MartialWeapon.h> ! # include <ogs/feats/MediumArmor.h> ! # include <ogs/feats/Namespace.h> ! # include <ogs/feats/ShieldProficiency.h> ! # include <ogs/feats/SimpleWeapon.h> ! # include <ogs/feats/Toughness.h> ! # include <ogs/feats/WeaponProficiency.h> ! # endif /* !defined OGS_FEATS_H */ ! #endif /* defined __cplusplus */ --- 21,41 ---- */ ! #ifndef OGS_FEATS_H ! # define OGS_FEATS_H ! # include <ogs/feats/Alertness.h> ! # include <ogs/feats/ArmorProficiency.h> ! # include <ogs/feats/BonusFeat.h> ! # include <ogs/feats/ExoticWeapon.h> ! # include <ogs/feats/GreatFortitude.h> ! # include <ogs/feats/ImprovedInitiative.h> ! # include <ogs/feats/IronWill.h> ! # include <ogs/feats/LightningReflexes.h> ! # include <ogs/feats/MartialWeapon.h> ! # include <ogs/feats/ShieldProficiency.h> ! # include <ogs/feats/SimpleWeapon.h> ! # include <ogs/feats/Toughness.h> ! # include <ogs/feats/WeaponProficiency.h> ! #endif /* !defined OGS_FEATS_H */ Index: Magic.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/Magic.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Magic.h 28 Feb 2003 11:11:25 -0000 1.4 --- Magic.h 25 Mar 2003 06:13:10 -0000 1.5 *************** *** 21,47 **** */ ! #ifdef __cplusplus ! ! # ifndef OGS_MAGIC_H ! # define OGS_MAGIC_H ! ! # include <ogs/magic/Ability.h> ! # include <ogs/magic/Abilities.h> ! # include <ogs/magic/AbsoluteRange.h> ! # include <ogs/magic/Component.h> ! # include <ogs/magic/Descriptors.h> ! # include <ogs/magic/ExperienceCost.h> ! # include <ogs/magic/Feats.h> ! # include <ogs/magic/LevelRange.h> ! # include <ogs/magic/Namespace.h> ! # include <ogs/magic/PhysicalComponent.h> ! # include <ogs/magic/Range.h> ! # include <ogs/magic/School.h> ! # include <ogs/magic/Spell.h> ! # include <ogs/magic/SpellList.h> ! # include <ogs/magic/Subschool.h> ! # endif /* !defined OGS_MAGIC_H */ ! #endif /* defined __cplusplus */ --- 21,43 ---- */ ! #ifndef OGS_MAGIC_H ! # define OGS_MAGIC_H ! # include <ogs/magic/Ability.h> ! # include <ogs/magic/Abilities.h> ! # include <ogs/magic/AbsoluteRange.h> ! # include <ogs/magic/Component.h> ! # include <ogs/magic/Descriptors.h> ! # include <ogs/magic/ExperienceCost.h> ! # include <ogs/magic/Feats.h> ! # include <ogs/magic/LevelRange.h> ! # include <ogs/magic/Namespace.h> ! # include <ogs/magic/PhysicalComponent.h> ! # include <ogs/magic/Range.h> ! # include <ogs/magic/School.h> ! # include <ogs/magic/Spell.h> ! # include <ogs/magic/SpellList.h> ! # include <ogs/magic/Subschool.h> ! #endif /* !defined OGS_MAGIC_H */ Index: Skills.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/Skills.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Skills.h 7 Jan 2003 07:41:32 -0000 1.1 --- Skills.h 25 Mar 2003 06:13:10 -0000 1.2 *************** *** 1,4 **** /* ! * Skills.h -- declarations for universal skills * Copyright (C) 2002 Eric Lemings <ele...@us...> * --- 1,4 ---- /* ! * Skills.h -- declarations for common skills * Copyright (C) 2002 Eric Lemings <ele...@us...> * *************** *** 21,34 **** */ ! #ifdef __cplusplus ! ! # ifndef OGS_SKILLS_H ! # define OGS_SKILLS_H ! ! # include <ogs/skills/Diplomacy.h> ! # include <ogs/skills/Swim.h> ! # endif /* !defined OGS_SKILLS_H */ ! #endif /* defined __cplusplus */ --- 21,54 ---- */ ! #ifndef OGS_SKILLS_H ! # 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/Namespace.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 */ Index: Spells.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/Spells.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Spells.h 7 Jan 2003 07:41:32 -0000 1.1 --- Spells.h 25 Mar 2003 06:13:10 -0000 1.2 *************** *** 21,41 **** */ ! #ifdef __cplusplus ! ! # ifndef OGS_SPELLS_H ! # define OGS_SPELLS_H ! ! # include <ogs/spells/Abjuration.h> ! # include <ogs/spells/Conjuration.h> ! # include <ogs/spells/Divination.h> ! # include <ogs/spells/Enchantment.h> ! # include <ogs/spells/Evocation.h> ! # include <ogs/spells/Illusion.h> ! # include <ogs/spells/Necromancy.h> ! # include <ogs/spells/Transmutation.h> ! # include <ogs/spells/Universal.h> ! # endif /* !defined OGS_SPELLS_H */ ! #endif /* defined __cplusplus */ --- 21,37 ---- */ ! #ifndef OGS_SPELLS_H ! # define OGS_SPELLS_H ! # include <ogs/spells/Abjuration.h> ! # include <ogs/spells/Conjurations.h> ! # include <ogs/spells/Divination.h> ! # include <ogs/spells/Enchantment.h> ! # include <ogs/spells/Evocation.h> ! # include <ogs/spells/Illusion.h> ! # include <ogs/spells/Necromancy.h> ! # include <ogs/spells/Transmutation.h> ! # include <ogs/spells/Universal.h> ! #endif /* !defined OGS_SPELLS_H */ Index: Support.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/Support.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Support.h 7 Jan 2003 07:41:32 -0000 1.1 --- Support.h 25 Mar 2003 06:13:10 -0000 1.2 *************** *** 21,36 **** */ ! #ifdef __cplusplus ! ! # ifndef OGS_SUPPORT_H ! # define OGS_SUPPORT_H ! ! # include <ogs/support/Class.h> ! # include <ogs/support/Event.h> ! # include <ogs/support/Object.h> ! # include <ogs/support/Observer.h> ! # endif /* !defined OGS_SUPPORT_H */ ! #endif /* defined __cplusplus */ --- 21,33 ---- */ ! #ifndef OGS_SUPPORT_H ! # define OGS_SUPPORT_H ! # include <ogs/support/Attachable.h> ! # include <ogs/support/Class.h> ! # include <ogs/support/Event.h> ! # include <ogs/support/Object.h> ! # include <ogs/support/Observer.h> ! #endif /* !defined OGS_SUPPORT_H */ |
|
From: <ele...@us...> - 2003-03-25 06:13:42
|
Update of /cvsroot/ogs/dist/c++
In directory sc8-pr-cvs1:/tmp/cvs-serv1939/c++
Modified Files:
ChangeLog TODO
Log Message:
See C++ ChangeLog file (Mar 24) for details.
Index: ChangeLog
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ChangeLog,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** ChangeLog 23 Mar 2003 22:14:36 -0000 1.12
--- ChangeLog 25 Mar 2003 06:13:09 -0000 1.13
***************
*** 1,3 ****
--- 1,24 ----
+ Tue Mar 25 04:42:42 UTC 2003 Eric Lemings <ele...@us...>
+
+ * ogs/core/Feature.*, ogs/core/Feat.*: Improved implementation
+ of functions by separating "check attach/detach" from
+ "perform attach/detach". Added groups to Feat class.
+
+ * ogs/feats/*: Completed Improved Save and Improved Initiative
+ feat. Improved Alertness, Armor Proficiency, and Bonus Feat.
+
+ * ogs/core/Entity.*, ogs/core/Item.*: Added typedefs for
+ attributes.
+
+ * ogs/*.h, ogs/core/Details.h, ogs/items/Rings.h,
+ ogs/items/Wonders.h, ogs/spells/Conjurations.h: Removed
+ redundant _cplusplus check. Removed old header files, added
+ new header files.
+
+ * Changed includes of header files to use full path in many
+ source files. Also changed installed search path notation
+ (#include <file>) to uninstalled notation (#include "file").
+
Sun Mar 23 20:10:05 UTC 2003 Eric Lemings <ele...@us...>
Index: TODO
===================================================================
RCS file: /cvsroot/ogs/dist/c++/TODO,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** TODO 14 Mar 2003 22:33:32 -0000 1.6
--- TODO 25 Mar 2003 06:13:09 -0000 1.7
***************
*** 12,47 ****
items in the section that follows.
- * Change ogs::core::Ability::Method and all predefined methods into
- function objects. May need to break methods out of the Ability.h
- header.
-
* Put all includes of OGS headers in quotes in source files so that
! previously installed versions are not included by mistake?
* Review each header file and use forward declarations instead of
include directives wherever possible.
- * Integrate the custom Autoconf macros for enable-warnings,
- enable-debug, and enable-optimize.
-
* Declare virtual destructors for base classes.
! * Define interface in Humanoid class for equiping items.
! * Add effective character level (ECL) to Creature class.
! * Add reference counting to Object class.
! * Make Size class a nested class of Entity?
! * Put version information in top-level ogs namespace.
* Require Boost library? Lots of stuff from this library is being
integrated into the next revision of Standard C++ anyway.
! Future Minor Releases
! ---------------------
! These changes and additions are bigger in scope or not as important as
! the items in the section above.
--- 12,50 ----
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?
! * In the ogs::feats namespace, Great Fortitude, Iron Will, and Lightning
! Reflexes classes can be implemented as one "ImprovedSave" class
! similar to ArmorProficiency. Additionally, the modifier may be
! changed to a static member.
! Future Minor Releases
! ---------------------
! These changes and additions are bigger in scope or not as important as
! the items in the section above.
! * Change ogs::core::Ability::Method and all predefined methods into
! function objects. May need to break methods out of the Ability.h
! header.
* Require Boost library? Lots of stuff from this library is being
integrated into the next revision of Standard C++ anyway.
! * Add reference counting to Object class.
! * Put version information in top-level ogs namespace.
!
! * Define interface in Humanoid class for equiping items.
!
! * Add effective character level (ECL) to Creature class.
|
|
From: <ele...@us...> - 2003-03-25 06:13:19
|
Update of /cvsroot/ogs/dist/c++/ogs/spells/conjurations In directory sc8-pr-cvs1:/tmp/cvs-serv1939/c++/ogs/spells/conjurations Modified Files: CureWounds.cpp Log Message: See C++ ChangeLog file (Mar 24) for details. Index: CureWounds.cpp =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/spells/conjurations/CureWounds.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CureWounds.cpp 23 Mar 2003 22:14:36 -0000 1.1 --- CureWounds.cpp 25 Mar 2003 06:13:14 -0000 1.2 *************** *** 21,27 **** */ ! //#include <ogs/support/TypeTraits.h> ! #include <ogs/core/Creature.h> ! #include "ogs/creatures/Undead.h" #include "ogs/spells/conjurations/CureWounds.h" --- 21,26 ---- */ ! //#include "ogs/support/TypeTraits.h" ! #include "ogs/core/Creature.h" #include "ogs/creatures/Undead.h" #include "ogs/spells/conjurations/CureWounds.h" *************** *** 30,34 **** using ogs::core::Experience; using ogs::spells::Conjuration; - using ogs::spells::conjurations::CureWounds; --- 29,32 ---- |