[ogs-changes] dist/c++/ogs/cclasses Bard.h,1.4,1.5 Cleric.h,1.4,1.5 Druid.h,1.4,1.5 Monk.h,1.3,1.4 P
Status: Alpha
Brought to you by:
elemings
Update of /cvsroot/ogs/dist/c++/ogs/cclasses
In directory sc8-pr-cvs1:/tmp/cvs-serv25962/c++/ogs/cclasses
Modified Files:
Bard.h Cleric.h Druid.h Monk.h Paladin.cpp Paladin.h Ranger.h
Sorcerer.h Wizard.h
Log Message:
See C++ ChangeLog (Apr 17) for details.
Index: Bard.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/cclasses/Bard.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Bard.h 15 Apr 2003 16:58:30 -0000 1.4
--- Bard.h 18 Apr 2003 01:41:00 -0000 1.5
***************
*** 31,34 ****
--- 31,35 ----
# include <ogs/core/Die.h>
# include <ogs/core/Saves.h>
+ # include <ogs/magic/Types.h>
# include <ogs/cclasses/Namespace.h>
***************
*** 71,83 ****
Bard (ogs::core::XP::Level xpLevel = 1);
! /**
! * An array of spell counts. Each element in the array represents
! * the number of spells for that spell level. The spell level is
! * the same as the index of the array.
! */
! typedef std::vector<unsigned> SpellCounts;
!
! SpellCounts getSpellsPerDay () const;
! SpellCounts getSpellsKnown () const;
protected:
--- 72,77 ----
Bard (ogs::core::XP::Level xpLevel = 1);
! ogs::magic::SpellCounts getSpellsPerDay () const;
! ogs::magic::SpellCounts getSpellsKnown () const;
protected:
Index: Cleric.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/cclasses/Cleric.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Cleric.h 15 Apr 2003 16:58:30 -0000 1.4
--- Cleric.h 18 Apr 2003 01:41:00 -0000 1.5
***************
*** 31,34 ****
--- 31,35 ----
# include <ogs/core/Die.h>
# include <ogs/core/Saves.h>
+ # include <ogs/magic/Types.h>
# include <ogs/cclasses/Namespace.h>
***************
*** 71,82 ****
Cleric (ogs::core::XP::Level xpLevel = 1);
! /**
! * An array of spell counts. Each element in the array represents
! * the number of spells for that spell level. The spell level is
! * the same as the index of the array.
! */
! typedef std::vector<unsigned> SpellCounts;
!
! SpellCounts getSpellsPerDay () const;
protected:
--- 72,76 ----
Cleric (ogs::core::XP::Level xpLevel = 1);
! ogs::magic::SpellCounts getSpellsPerDay () const;
protected:
Index: Druid.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/cclasses/Druid.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Druid.h 15 Apr 2003 16:58:30 -0000 1.4
--- Druid.h 18 Apr 2003 01:41:00 -0000 1.5
***************
*** 31,34 ****
--- 31,35 ----
# include <ogs/core/Die.h>
# include <ogs/core/Saves.h>
+ # include <ogs/magic/Types.h>
# include <ogs/cclasses/Namespace.h>
***************
*** 73,84 ****
Druid (ogs::core::XP::Level xpLevel = 1);
! /**
! * An array of spell counts. Each element in the array represents
! * the number of spells for that spell level. The spell level is
! * the same as the index of the array.
! */
! typedef std::vector<unsigned> SpellCounts;
!
! SpellCounts getSpellsPerDay () const;
protected:
--- 74,78 ----
Druid (ogs::core::XP::Level xpLevel = 1);
! ogs::magic::SpellCounts getSpellsPerDay () const;
protected:
Index: Monk.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/cclasses/Monk.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Monk.h 13 Apr 2003 05:24:49 -0000 1.3
--- Monk.h 18 Apr 2003 01:41:00 -0000 1.4
***************
*** 28,31 ****
--- 28,33 ----
# include <ogs/core/CClass.h>
# include <ogs/core/Die.h>
+ # include <ogs/core/Experience.h>
+ # include <ogs/core/Modifier.h>
# include <ogs/core/Saves.h>
# include <ogs/cclasses/Namespace.h>
***************
*** 68,73 ****
Monk (ogs::core::XP::Level xpLevel = 1);
ogs::core::Die::Sides getUnarmedDamage () const;
! ogs::core::Modifier& getDefenseBonus () const;
protected:
--- 70,77 ----
Monk (ogs::core::XP::Level xpLevel = 1);
+ void setLevel (ogs::core::XP::Level xpLevel);
+
ogs::core::Die::Sides getUnarmedDamage () const;
! ogs::core::Modifier& getDefenseBonus ();
protected:
***************
*** 75,78 ****
--- 79,85 ----
ogs::core::Modifier::Value getBaseRefSaveValue () const;
ogs::core::Modifier::Value getBaseWillSaveValue () const;
+
+ private:
+ ogs::core::Modifier _defenseBonus;
};
***************
*** 87,92 ****
ogs::core::Saves::getWeakBonus (xpLevel),
ogs::core::Saves::getWeakBonus (xpLevel),
! ogs::core::Saves::getWeakBonus (xpLevel)) {
// empty constructor body
}
--- 94,139 ----
ogs::core::Saves::getWeakBonus (xpLevel),
ogs::core::Saves::getWeakBonus (xpLevel),
! ogs::core::Saves::getWeakBonus (xpLevel)),
! _defenseBonus (xpLevel / 5) {
// empty constructor body
+ }
+
+ /**
+ * Change the experience level of this monk.
+ *
+ * @param xpLevel Experience level of this monk.
+ */
+ inline void
+ Monk::setLevel (ogs::core::XP::Level xpLevel) {
+ _defenseBonus.setValue (xpLevel / 5);
+ CClass::setLevel (xpLevel);
+ }
+
+ /**
+ * Determine the die used to roll unarmed damage for this monk.
+ *
+ * @return Die used to roll unarmed damage for this monk.
+ */
+ inline ogs::core::Die::Sides
+ Monk::getUnarmedDamage () const {
+ using ogs::core::Die;
+ Die::Sides dieSides [] = {
+ Die::d6, Die::d8, Die::d10, Die::d12, Die::d20
+ };
+
+ ogs::core::XP::Level xpLevel = getLevel ();
+ return (dieSides [xpLevel > 16? 4: xpLevel / 4]);
+ }
+
+ /**
+ * Determine the defense bonus for this monk. Monks gain a defense
+ * bonus that increases with experience level. This bonus applies only
+ * when the monk is not wearing armor.
+ *
+ * @return Defense bonus for this monk.
+ */
+ inline ogs::core::Modifier&
+ Monk::getDefenseBonus () {
+ return (this->_defenseBonus);
}
Index: Paladin.cpp
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/cclasses/Paladin.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Paladin.cpp 15 Apr 2003 16:58:30 -0000 1.6
--- Paladin.cpp 18 Apr 2003 01:41:00 -0000 1.7
***************
*** 26,29 ****
--- 26,30 ----
#include "ogs/Core.h"
+ #include "ogs/magic/Types.h"
#include "ogs/cclasses/Paladin.h"
#include "ogs/feats/AllWeapons.h"
***************
*** 31,34 ****
--- 32,36 ----
using namespace ogs::core;
+ using ogs::magic::SpellCounts;
using ogs::cclasses::Paladin;
using ogs::feats::AllWeapons;
***************
*** 225,229 ****
* @return Number of spells that can be cast per spell level per day.
*/
! Paladin::SpellCounts Paladin::getSpellsPerDay () const {
static unsigned spellTable [17][4] = {
{ 0, UINT_MAX, UINT_MAX, UINT_MAX },
--- 227,231 ----
* @return Number of spells that can be cast per spell level per day.
*/
! SpellCounts Paladin::getSpellsPerDay () const {
static unsigned spellTable [17][4] = {
{ 0, UINT_MAX, UINT_MAX, UINT_MAX },
Index: Paladin.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/cclasses/Paladin.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Paladin.h 15 Apr 2003 16:58:31 -0000 1.4
--- Paladin.h 18 Apr 2003 01:41:01 -0000 1.5
***************
*** 32,35 ****
--- 32,36 ----
# include <ogs/core/Experience.h>
# include <ogs/core/Saves.h>
+ # include <ogs/magic/Types.h>
# include <ogs/cclasses/Namespace.h>
***************
*** 73,84 ****
bool detachObject ();
! /**
! * An array of spell counts. Each element in the array represents
! * the number of spells for that spell level. The spell level is
! * the same as the index of the array.
! */
! typedef std::vector<unsigned> SpellCounts;
!
! SpellCounts getSpellsPerDay () const;
private:
--- 74,78 ----
bool detachObject ();
! ogs::magic::SpellCounts getSpellsPerDay () const;
private:
Index: Ranger.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/cclasses/Ranger.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Ranger.h 15 Apr 2003 16:58:31 -0000 1.4
--- Ranger.h 18 Apr 2003 01:41:01 -0000 1.5
***************
*** 31,34 ****
--- 31,35 ----
# include <ogs/core/Die.h>
# include <ogs/core/Saves.h>
+ # include <ogs/magic/Types.h>
# include <ogs/cclasses/Namespace.h>
***************
*** 74,85 ****
Ranger (ogs::core::XP::Level xpLevel = 1);
! /**
! * An array of spell counts. Each element in the array represents
! * the number of spells for that spell level. The spell level is
! * the same as the index of the array.
! */
! typedef std::vector<unsigned> SpellCounts;
!
! SpellCounts getSpellsPerDay () const;
protected:
--- 75,79 ----
Ranger (ogs::core::XP::Level xpLevel = 1);
! ogs::magic::SpellCounts getSpellsPerDay () const;
protected:
Index: Sorcerer.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/cclasses/Sorcerer.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Sorcerer.h 15 Apr 2003 16:58:31 -0000 1.4
--- Sorcerer.h 18 Apr 2003 01:41:01 -0000 1.5
***************
*** 31,34 ****
--- 31,35 ----
# include <ogs/core/Die.h>
# include <ogs/core/Saves.h>
+ # include <ogs/magic/Types.h>
# include <ogs/cclasses/Namespace.h>
***************
*** 60,72 ****
Sorcerer (ogs::core::XP::Level xpLevel = 1);
! /**
! * An array of spell counts. Each element in the array represents
! * the number of spells for that spell level. The spell level is
! * the same as the index of the array.
! */
! typedef std::vector<unsigned> SpellCounts;
!
! SpellCounts getSpellsPerDay () const;
! SpellCounts getSpellsKnown () const;
protected:
--- 61,66 ----
Sorcerer (ogs::core::XP::Level xpLevel = 1);
! ogs::magic::SpellCounts getSpellsPerDay () const;
! ogs::magic::SpellCounts getSpellsKnown () const;
protected:
Index: Wizard.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/cclasses/Wizard.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Wizard.h 15 Apr 2003 16:58:32 -0000 1.4
--- Wizard.h 18 Apr 2003 01:41:01 -0000 1.5
***************
*** 31,34 ****
--- 31,35 ----
# include <ogs/core/Die.h>
# include <ogs/core/Saves.h>
+ # include <ogs/magic/Types.h>
# include <ogs/cclasses/Namespace.h>
***************
*** 79,90 ****
Wizard (ogs::core::XP::Level xpLevel = 1);
! /**
! * An array of spell counts. Each element in the array represents
! * the number of spells for that spell level. The spell level is
! * the same as the index of the array.
! */
! typedef std::vector<unsigned> SpellCounts;
!
! SpellCounts getSpellsPerDay () const;
protected:
--- 80,84 ----
Wizard (ogs::core::XP::Level xpLevel = 1);
! ogs::magic::SpellCounts getSpellsPerDay () const;
protected:
|