ogs-changes Mailing List for Open Gaming System (Page 5)
Status: Alpha
Brought to you by:
elemings
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
(35) |
Apr
(96) |
May
(22) |
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
---|
From: <ele...@us...> - 2003-04-04 20:38:08
|
Update of /cvsroot/ogs/dist/java/ogs/magic In directory sc8-pr-cvs1:/tmp/cvs-serv9450/java/ogs/magic Modified Files: MetamagicFeat.java School.java Spell.java Log Message: See ChangeLog files (Apr 3-4) for details. Index: MetamagicFeat.java =================================================================== RCS file: /cvsroot/ogs/dist/java/ogs/magic/MetamagicFeat.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MetamagicFeat.java 27 Feb 2003 01:24:44 -0000 1.2 --- MetamagicFeat.java 4 Apr 2003 20:22:55 -0000 1.3 *************** *** 67,70 **** --- 67,80 ---- /** + * Determine the group that this feat belongs to. Metamagic feats + * feats are magic feats. + * + * @return Feat.MAGIC + */ + public int getGroup () { + return (Feat.MAGIC); + } + + /** * Determine number of levels added to normal spell level. Metamagic * feats use up spell slots higher than a spell's normal level. These Index: School.java =================================================================== RCS file: /cvsroot/ogs/dist/java/ogs/magic/School.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** School.java 27 Feb 2003 22:42:20 -0000 1.3 --- School.java 4 Apr 2003 20:22:55 -0000 1.4 *************** *** 34,59 **** public static final int UNIVERSAL = 0; ! /** Spells that provide protection or banish other creatures. */ public static final int ABJURATION = 1; ! /** Spells that bring creatures or materials to the caster. */ public static final int CONJURATION = 2; ! /** Spells that reveal information. */ public static final int DIVINATION = 3; ! /** Spells that enchant items and charm creatures. */ public static final int ENCHANTMENT = 4; ! /** Spells that manipulate matter and energy. */ public static final int EVOCATION = 5; ! /** Spells that alter perception and create false images. */ public static final int ILLUSION = 6; ! /** Spells that manipulate life and death. */ public static final int NECROMANCY = 7; ! /** Spells that alter physical forms. */ public static final int TRANSMUTATION = 8; --- 34,99 ---- public static final int UNIVERSAL = 0; ! /** ! * Spells that provide protection or banish other creatures. A ! * wizard that specializes in this school is prohibited to one of ! * Conjuration, Enchantment, Evocation, Illusion, or ! * Transmutation; or both Divination and Necromancy. ! */ public static final int ABJURATION = 1; ! /** ! * Spells that bring creatures or materials to the caster. A ! * wizard that specializes in this school is prohibited to any one ! * of the following: (a) Evocation; (b) any two of Abjuration, ! * Enchantment, and Illusion; (c) Transmutation; or (d) any three ! * schools. ! */ public static final int CONJURATION = 2; ! /** ! * Spells that reveal information. A wizard that specializes in ! * this school is prohibited to any one of the other schools of ! * the wizard's choice. ! */ public static final int DIVINATION = 3; ! /** ! * Spells that enchant items and charm creatures. A wizard that ! * specializes in this school is prohibited to one of Abjuration, ! * Conjuration, Evocation, Illusion, or Transmutation; or both ! * Divination and Necromancy. ! */ public static final int ENCHANTMENT = 4; ! /** ! * Spells that manipulate matter and energy. A wizard that ! * specializes in this school is prohibited to one of the ! * following: (a) Conjuration; (b) Transmutation; (c) any two of ! * Abjuration, Enchantment, and Illusion; or (d) any three ! * schools. ! */ public static final int EVOCATION = 5; ! /** ! * Spells that alter perception and create false images. A wizard ! * that specializes in this school is prohibited to one of ! * Abjuration, Conjuration, Enchantment, Evocation, or ! * Transmutation; or both Divination and Necromancy. ! */ public static final int ILLUSION = 6; ! /** ! * Spells that manipulate life and death. A wizard that ! * specializes in this school is prohibited to any other school of ! * the wizard's choice. ! */ public static final int NECROMANCY = 7; ! /** ! * Spells that alter physical forms. A wizard that specializes in ! * this school is prohibited to any one of the following: ! * (a) Conjuration; (b) Evocation; (c) any two of Abjuration, ! * Enchantment, and Illusion; or (d) any three schools. ! */ public static final int TRANSMUTATION = 8; Index: Spell.java =================================================================== RCS file: /cvsroot/ogs/dist/java/ogs/magic/Spell.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Spell.java 28 Feb 2003 11:11:26 -0000 1.4 --- Spell.java 4 Apr 2003 20:22:56 -0000 1.5 *************** *** 61,65 **** * @return A set of descriptors for this spell. */ ! public abstract Descriptors getDescriptors (); /** --- 61,67 ---- * @return A set of descriptors for this spell. */ ! public Descriptors getDescriptors () { ! return (new Descriptors ()); ! } /** |
From: <ele...@us...> - 2003-04-04 20:38:08
|
Update of /cvsroot/ogs/dist/java/ogs/items In directory sc8-pr-cvs1:/tmp/cvs-serv9450/java/ogs/items Modified Files: Armor.java Log Message: See ChangeLog files (Apr 3-4) for details. Index: Armor.java =================================================================== RCS file: /cvsroot/ogs/dist/java/ogs/items/Armor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Armor.java 7 Jan 2003 08:02:15 -0000 1.1 --- Armor.java 4 Apr 2003 20:22:55 -0000 1.2 *************** *** 27,31 **** /** ! * An item worn for protection in combat. */ public abstract class Armor extends Item { --- 27,37 ---- /** ! * An item worn for protection in combat. Armor is typically a suit or ! * partial suit of steel, leather, or other material that is worn over ! * the body. Armor belongs to one of three proficiencies: light, ! * medium, or heavy. The armor proficiency determines the armor ! * proficiency feat required to use it effectively. ! * ! * @see ogs::feats::ArmorProficiency */ public abstract class Armor extends Item { |
Update of /cvsroot/ogs/dist/java/ogs/feats In directory sc8-pr-cvs1:/tmp/cvs-serv9450/java/ogs/feats Modified Files: ArmorProficiency.java ImprovedInitiative.java ShieldProficiency.java Toughness.java WeaponProficiency.java Added Files: Alertness.java AllWeapons.java ImprovedSave.java SingleWeapon.java Removed Files: ExoticWeapon.java GreatFortitude.java HeavyArmor.java IronWill.java LightArmor.java LightningReflexes.java MartialWeapon.java MediumArmor.java SimpleWeapon.java Log Message: See ChangeLog files (Apr 3-4) for details. --- NEW FILE: Alertness.java --- /* * Alertness.java -- class declaration for Alertness 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: Alertness.java,v 1.1 2003/04/04 20:22:54 elemings Exp $ */ package ogs.feats; import ogs.support.Object; import ogs.core.Feat; import ogs.core.Modifier; /** * A feat that adds a +2 bonus to all Listen and Spot skill checks. */ public class Alertness extends Feat { private static Modifier modifier = new Modifier (+2); /** * Create a new Alertness feat. */ public Alertness () { super (); } /** * Determine the compatability of this feat. Alertness feats are * exclusive feats. * * @return Feat.EXCLUSIVE */ public int getCompatibility () { return (Feat.EXCLUSIVE); } /** * Determine the group that this feat belongs to. Alertness feats are * general feats. * * @return Feat.GENERAL */ public int getGroup () { return (Feat.GENERAL); } /** * Determine if this feat can be attached to an object. Since * Alertness 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. */ protected boolean canAttach (Object object) { return (super.canAttach (object) && !super.findFeat (object, getClass ())); } /** * Attach this feat to an object. This function adds a +2 bonus to * Listen and Spot skill checks if the creature has either or both of * these skills. * * @param object Object to attach this feat to. * @return True if feat is attached to object. */ public boolean attachObject (Object object) { boolean canAttach = super.attachObject (object); if (canAttach) { addSkillModifier (object); } return (canAttach); } /** * Add modifier of this feat to Listen and Spot skills. * * @param object Object to add skill modifier to. */ private void addSkillModifier (Object object) { } /** * Detach this feat from an object. * * @return True if this feat is detached from the object. */ public boolean detachObject () { Object object = getObject (); boolean canDetach = super.detachObject (); if (canDetach) { removeSkillModifier (object); } return (canDetach); } /** * Remove modifier of this feat from Listen and Spot skills. */ private void removeSkillModifier (Object object) { } } --- NEW FILE: AllWeapons.java --- /* * Alertness.java -- class declaration for Alertness 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.java,v 1.1 2003/04/04 20:22:54 elemings Exp $ */ package ogs.feats; import ogs.core.Creature; import ogs.feats.WeaponProficiency; import ogs.items.Weapon; /** * 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 */ public class AllWeapons extends WeaponProficiency { private int proficiency; /** * Create a new Simple Weapon Proficiency feat. * * @return A new Simple Weapon Proficiency feat. */ public static AllWeapons createSimple () { return (new AllWeapons (Weapon.SIMPLE)); } /** * Create a new Martial Weapon Proficiency feat. * * @return A new Simple Weapon Proficiency feat. */ public static AllWeapons createMartial () { return (new AllWeapons (Weapon.MARTIAL)); } /** * Create a new All Weapons Proficiency feat. */ private AllWeapons (int proficiency) { this.proficiency = proficiency; } /** * Determine the compatability of this feat. Weapon proficiency feats * for all weapons are exclusive feats. * * @return Feat.EXCLUSIVE */ public int getCompatibility () { return (Feat.EXCLUSIVE); } /** * Determine weapon proficiency that this feat applies to. * * @return Proficiency of weapon: SIMPLE or MARTIAL. */ public int getProficiency () { return (this.proficiency); } /** * 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. */ private boolean canAttach (Object object) { if (!super.canAttach (object)) { return (false); } Creature creature = (Creature) object; Vector feats = creature.getFeats (); for (int i = 0; i < feats.size (); ++i) { AllWeapons allWeapons = null; try { allWeapons = (AllWeapons) feats.elementAt (i); } catch (ClassCastException exception) { // Object is not an All Weapons feat. Skip it. } if (allWeapons != null) { if (allWeapons.getProficiency () == this.proficiency) { return (false); } } } return (true); } /** * 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. */ public boolean isProficient (Weapon weapon) { return (weapon.getProficiency () == this.proficiency); } } --- NEW FILE: ImprovedSave.java --- /* * Alertness.java -- class declaration for Alertness 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: ImprovedSave.java,v 1.1 2003/04/04 20:22:54 elemings Exp $ */ package ogs.feats; import java.util.Collection; import java.util.Iterator; import ogs.support.Object; import ogs.core.Creature; import ogs.core.Feat; import ogs.core.Modifier; import ogs.core.Saves; /** * A feat that adds a +2 bonus to saving throws. Improved Save feats * come in three varieties: Great Fortitude, Iron Will, and Lightning * Reflexes. Each variety applies to a different type of save. */ public class ImprovedSave extends Feat { /** Bonus is added to all Fortitude saves. */ public static final byte GREAT_FORTITUDE = 1; /** Bonus is added to all Will saves. */ public static final byte IRON_WILL = 2; /** Bonus is added to all Reflex saves. */ public static final byte LIGHTNING_REFLEXES = 3; /** * Create a new Great Fortitude feat. * * @return A new Great Fortitude feat. */ public static ImprovedSave createGreatFortitude () { return (new ImprovedSave (GREAT_FORTITUDE)); } /** * Create a new Iron Will feat. * * @return A new Iron Will feat. */ public static ImprovedSave createIronWill () { return (new ImprovedSave (IRON_WILL)); } /** * Create a new Lightning Reflexes feat. * * @return A new Lightning Reflexes feat. */ public static ImprovedSave createLightningReflexes () { return (new ImprovedSave (LIGHTNING_REFLEXES)); } private byte type; private Modifier modifier; /** * Create a new Improved Save feat. * * @param type One of the three types of improved saves. */ private ImprovedSave (byte type) { this.type = type; this.modifier = new Modifier (+2); } /** * Determine the compatability of this feat. Improved Save feats are * exclusive feats. * * @return Feat.EXCLUSIVE */ public int getCompatibility () { return (Feat.EXCLUSIVE); } /** * Determine the group that this feat belongs to. Improved Save feats * are general feats. * * @return Feat.GENERAL */ public int getGroup () { return (Feat.GENERAL); } /** * Determine the type of this Improved Save feat. * * @return GREAT_FORTITUDE, IRON_WILL, or LIGHTNING_REFLEXES. */ public int getType () { return (this.type); } /** * 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. */ protected boolean canAttach (Object object) { if (! super.canAttach (object)) { return (false); } Creature creature = (Creature) object; Collection feats = creature.getFeats (); Iterator itor = feats.iterator (); while (itor.hasNext ()) { ImprovedSave improvedSave = null; try { improvedSave = (ImprovedSave) itor.next (); } catch (ClassCastException exception) { // Object is not an Improved Save feat. Skip it. } if (improvedSave != null) { if (improvedSave.getType () == this.type) { return (false); } } } return (true); } /** * Attach this Improved Save feat to a creature. * * @param object Creature to attach Improved Save to. * @return True if feat is attached to creature. */ public boolean attachObject (Object object) { boolean attached = super.attachObject (object); if (attached) { Creature creature = (Creature) object; Saves saves = creature.getSaves (); if (this.type == GREAT_FORTITUDE) { saves.fort.addModifier (this.modifier); } else if (this.type == IRON_WILL) { saves.will.addModifier (this.modifier); } else if (this.type == LIGHTNING_REFLEXES) { saves.ref.addModifier (this.modifier); } } return (attached); } /** * Detach this Improved Save feat from a creature. * * @return True if feat is detached from creature. */ public boolean detachObject () { Creature creature = (Creature) getObject (); boolean detached = detachObject (); if (creature != null && detached) { Saves saves = creature.getSaves (); if (this.type == GREAT_FORTITUDE) { saves.fort.removeModifier (this.modifier); } else if (this.type == IRON_WILL) { saves.will.removeModifier (this.modifier); } else if (this.type == LIGHTNING_REFLEXES) { saves.ref.removeModifier (this.modifier); } } return (detached); } } --- NEW FILE: SingleWeapon.java --- /* * Alertness.java -- class declaration for Alertness 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.java,v 1.1 2003/04/04 20:22:55 elemings Exp $ */ package ogs.feats; import ogs.core.Feat; import ogs.feats.WeaponProficiency; import ogs.items.Weapon; /** * 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. */ public class SingleWeapon extends WeaponProficiency { private Class weaponClass = null; /** * Create a new Weapon Proficiency feat for a single weapon. * * @param weaponClass A class of weapon. * @throws ClassCastException If class is not a weapon class. */ public SingleWeapon (Class weaponClass) { if (! Weapon.class.isAssignableFrom (weaponClass)) { String s = "weaponClass (" + weaponClass.toString () + ") is not a weapon class."; throw new ClassCastException (s); } else { this.weaponClass = weaponClass; } } /** * 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 */ public int getCompatibility () { return (Feat.REPEATABLE); } /** * Determine proficiency of weapon that this feat applies to. * * @return Proficiency of weapon: SIMPLE, MARTIAL, or EXOTIC. */ public int getProficiency () { Weapon weapon = null; try { weapon = (Weapon) weaponClass.newInstance (); } catch (Exception exception) { // Shouldn't happen but has to be caught at least. } return (weapon == null? 0: weapon.getProficiency ()); } /** * 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. */ public boolean isProficient (Weapon weapon) { return (weaponClass.isInstance (weapon)); } } Index: ArmorProficiency.java =================================================================== RCS file: /cvsroot/ogs/dist/java/ogs/feats/ArmorProficiency.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ArmorProficiency.java 27 Feb 2003 01:24:44 -0000 1.2 --- ArmorProficiency.java 4 Apr 2003 20:22:54 -0000 1.3 *************** *** 23,32 **** package ogs.feats; import ogs.core.Feat; /** ! * A feat that allows the use of armor without penalties. */ ! public abstract class ArmorProficiency extends Feat { /** * Determine the compatibility of this type of feat. Armor --- 23,84 ---- package ogs.feats; + import java.util.Collection; + import java.util.Iterator; + + import ogs.support.Object; + import ogs.core.Creature; import ogs.core.Feat; + import ogs.items.Armor; /** ! * 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. */ ! public class ArmorProficiency extends Feat { ! ! private int proficiency; ! ! /** ! * Create a new Light Armor Proficiency feat. ! * ! * @return A new Light Armor Proficiency feat. ! */ ! public static ArmorProficiency createLight () { ! return (new ArmorProficiency (Armor.LIGHT)); ! } ! ! /** ! * Create a new Medium Armor Proficiency feat. ! * ! * @return A new Medium Armor Proficiency feat. ! */ ! public static ArmorProficiency createMedium () { ! return (new ArmorProficiency (Armor.MEDIUM)); ! } ! ! /** ! * Create a new Heavy Armor Proficiency feat. ! * ! * @return A new Heavy Armor Proficiency feat. ! */ ! public static ArmorProficiency createHeavy () { ! return (new ArmorProficiency (Armor.HEAVY)); ! } ! ! /** ! * Create a new armor proficiency feat. ! * ! * @param proficiency Proficiency of armor: LIGHT, MEDIUM, or HEAVY. ! */ ! protected ArmorProficiency (int proficiency) { ! this.proficiency = proficiency; ! } ! /** * Determine the compatibility of this type of feat. Armor *************** *** 38,41 **** --- 90,187 ---- public int getCompatibility () { return (Feat.EXCLUSIVE); + } + + /** + * Determine the group that this feat belongs to. Armor proficiency + * feats are general feats. + * + * @return Feat.GENERAL + */ + public int getGroup () { + return (Feat.GENERAL); + } + + /** + * Determine the proficiency of this feat. + * + * @return Type of armor proficiency: LIGHT, MEDIUM, or HEAVY. + */ + public int getProficiency () { + return (this.proficiency); + } + + /** + * 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. + */ + protected boolean canAttach (Object object) { + if (! super.canAttach (object)) { + return (false); + } + + boolean attach = false; + Creature creature = (Creature) object; + if (this.proficiency == Armor.LIGHT) { + attach = !findArmorProficiency (creature, Armor.LIGHT); + } else if (this.proficiency == Armor.MEDIUM) { + attach = findArmorProficiency (creature, Armor.LIGHT) && + !findArmorProficiency (creature, Armor.MEDIUM); + } else if (this.proficiency == Armor.HEAVY) { + attach = findArmorProficiency (creature, Armor.MEDIUM) && + !findArmorProficiency (creature, Armor.HEAVY); + } + + return (attach); + } + + /** + * Determine if a creature has an armor proficiency. + * + * @param creature Creature to be checked for proficiency. + * @param proficiency Proficiency of armor. + * @return True if creature has armor proficiency. + */ + private boolean findArmorProficiency (Creature creature, int proficiency) { + Collection feats = creature.getFeats (); + Iterator itor = feats.iterator (); + boolean found = false; + + while (!found && itor.hasNext ()) { + ArmorProficiency armorProficiency = null; + try { + armorProficiency = (ArmorProficiency) itor.next (); + } catch (ClassCastException exception) { + // Ignore it. + } + + if (armorProficiency != null) { + found = armorProficiency.getProficiency () == proficiency; + } + } + + return (found); + } + + /** + * Determine if armor is proficient armor. Proficient armor is armor + * that a creature is proficient with. If this armor proficiency feat + * is not attached to a creature, then the armor is not proficient + * armor. + * + * @param armor A suit of armor. + * @return True if armor is proficient armor. + */ + public boolean isProficient (Armor armor) { + int proficiency = armor.getProficiency (); + return (getObject () != null && + this.proficiency == Armor.HEAVY || + (this.proficiency == Armor.MEDIUM && + proficiency != Armor.HEAVY) || + proficiency == Armor.LIGHT); } } Index: ImprovedInitiative.java =================================================================== RCS file: /cvsroot/ogs/dist/java/ogs/feats/ImprovedInitiative.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ImprovedInitiative.java 27 Feb 2003 01:24:44 -0000 1.2 --- ImprovedInitiative.java 4 Apr 2003 20:22:54 -0000 1.3 *************** *** 48,51 **** --- 48,61 ---- /** + * Determine the group that this feat belongs to. Improved Initiative + * feats are general feats. + * + * @return Feat.GENERAL + */ + public int getGroup () { + return (Feat.GENERAL); + } + + /** * Attach this feat to a creature. This method adds the initative * modifier to the list of intiative modifiers for the creature. Index: ShieldProficiency.java =================================================================== RCS file: /cvsroot/ogs/dist/java/ogs/feats/ShieldProficiency.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ShieldProficiency.java 27 Feb 2003 01:24:44 -0000 1.2 --- ShieldProficiency.java 4 Apr 2003 20:22:54 -0000 1.3 *************** *** 33,38 **** /** * Determine the compatibility of this type of feat. Shield profiency ! * feats are exclusive feats: only one instance of the feat can be ! * attached to a creature at one time. * * @return Feat.EXCLUSIVE. --- 33,37 ---- /** * Determine the compatibility of this type of feat. Shield profiency ! * feats are exclusive feats. * * @return Feat.EXCLUSIVE. *************** *** 40,43 **** --- 39,52 ---- public int getCompatibility () { return (Feat.EXCLUSIVE); + } + + /** + * Determine the group that this feat belongs to. Shield Proficiency + * feats are general feats. + * + * @return Feat.GENERAL + */ + public int getGroup () { + return (Feat.GENERAL); } Index: Toughness.java =================================================================== RCS file: /cvsroot/ogs/dist/java/ogs/feats/Toughness.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Toughness.java 27 Feb 2003 01:24:44 -0000 1.2 --- Toughness.java 4 Apr 2003 20:22:55 -0000 1.3 *************** *** 32,37 **** /** * Determine the compatibility of this type of feat. Toughness feats ! * are exclusive feats: only one instance of the feat can be attached ! * to a creature at one time. * * @return Feat.EXCLUSIVE. --- 32,36 ---- /** * Determine the compatibility of this type of feat. Toughness feats ! * are exclusive feats. * * @return Feat.EXCLUSIVE. *************** *** 39,42 **** --- 38,51 ---- public int getCompatibility () { return (Feat.EXCLUSIVE); + } + + /** + * Determine the group that this feat belongs to. Toughness feats are + * general feats. + * + * @return Feat.GENERAL + */ + public int getGroup () { + return (Feat.GENERAL); } Index: WeaponProficiency.java =================================================================== RCS file: /cvsroot/ogs/dist/java/ogs/feats/WeaponProficiency.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** WeaponProficiency.java 27 Feb 2003 01:24:44 -0000 1.2 --- WeaponProficiency.java 4 Apr 2003 20:22:55 -0000 1.3 *************** *** 23,80 **** package ogs.feats; - import java.lang.reflect.InvocationTargetException; - import java.lang.reflect.Method; - import ogs.core.Feat; import ogs.items.Weapon; /** ! * A weapon proficiency allows the use of certain weapons without ! * a penalty to attack rolls. */ public abstract class WeaponProficiency extends Feat { /** ! * Calls the getProficiency() method of a weapon class. * ! * @param weaponClass A subclass of the Weapon class. ! * @return SIMPLE, MARTIAL, or EXOTIC ! * @throws ClassCastException If weaponClass is not a subclass ! * of Weapon. */ ! protected int getProficiency (Class weaponClass) { ! Integer result = null; ! ! if (! Weapon.class.isAssignableFrom (weaponClass)) { ! String msg = "weaponClass (" + weaponClass.getName () + ! ") is not a subclass of Weapon"; ! throw new ClassCastException (msg); ! } ! ! // None of these exceptions should be thrown so catch them here. ! try { ! Method method = weaponClass.getMethod ("getProficiency", null); ! result = (Integer) method.invoke (weaponClass, null); ! } catch (NoSuchMethodException e) { ! System.out.println (e); ! } catch (IllegalAccessException e) { ! System.out.println (e); ! } catch (InvocationTargetException e) { ! System.out.println (e); ! } ! ! return (result.intValue ()); } /** ! * Determine the compatibility of this type of feat. Weapon ! * proficiency feats are exclusive feats: only one instance of each ! * feat can be attached to a creature at one time. * ! * @return Feat.EXCLUSIVE. */ ! public int getCompatibility () { ! return (Feat.EXCLUSIVE); ! } } --- 23,63 ---- package ogs.feats; import ogs.core.Feat; import ogs.items.Weapon; /** ! * 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. */ public abstract class WeaponProficiency extends Feat { /** ! * Determine the group that this feat belongs to. Weapon proficiency ! * feats are general feats. * ! * @return Feat.GENERAL */ ! public int getGroup () { ! return (Feat.GENERAL); } /** ! * Determine weapon proficiency that this feat applies to. * ! * @return Proficiency of weapon: SIMPLE, MARTIAL, or EXOTIC. */ ! public abstract int getProficiency (); ! ! /** ! * 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. ! */ ! public abstract boolean isProficient (Weapon weapon); } --- ExoticWeapon.java DELETED --- --- GreatFortitude.java DELETED --- --- HeavyArmor.java DELETED --- --- IronWill.java DELETED --- --- LightArmor.java DELETED --- --- LightningReflexes.java DELETED --- --- MartialWeapon.java DELETED --- --- MediumArmor.java DELETED --- --- SimpleWeapon.java DELETED --- |
Update of /cvsroot/ogs/dist/java/ogs/core In directory sc8-pr-cvs1:/tmp/cvs-serv9450/java/ogs/core Modified Files: Abilities.java Ability.java CClass.java Creature.java Feat.java Feature.java Skill.java Added Files: BodyPart.java Strength.java Log Message: See ChangeLog files (Apr 3-4) for details. --- NEW FILE: BodyPart.java --- /* * BodyPart.java -- class declaration 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.java,v 1.1 2003/04/04 20:22:50 elemings Exp $ */ package ogs.core; import java.util.Collection; import java.util.Vector; import ogs.core.Creature; import ogs.core.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. This * class defines humanoid body parts. Body parts of other creatures *(such as tails, wings, horns, whatever) may be defined by other * classes. */ public class BodyPart { public static final byte HEAD = 1; public static final byte EYES = 2; public static final byte LEFT_EYE = 3; public static final byte RIGHT_EYE = 4; public static final byte NECK = 5; public static final byte TORSO = 6; public static final byte BACK = 7; public static final byte ARMS = 8; public static final byte LEFT_ARM = 9; public static final byte RIGHT_ARM = 10; public static final byte HANDS = 11; public static final byte LEFT_HAND = 12; public static final byte RIGHT_HAND = 13; public static final byte WAIST = 14; public static final byte LEGS = 15; public static final byte LEFT_LEG = 16; public static final byte RIGHT_LEG = 17; public static final byte LEFT_FOOT = 18; public static final byte RIGHT_FOOT = 19; private Creature creature = null; private byte type = 0; private Vector items = null; /** * 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. The new body part has * not equipped items. * * @param creature Creature that this body part belongs to. * @param type Type of body part. */ public BodyPart (Creature creature, byte type) { this.creature = creature; this.type = type; this.items = new Vector (); } /** * Determine the creature that this body part belongs to. * * @return Creature that this body part belongs to. */ public Creature getCreature () { return (this.creature); } /** * Determine the type of this body part. * * @return Type of body part. */ public byte getType () { return (this.type); } /** * Determine the equipped items for this body part. * * @return An array of equipped items for this body part. */ public Collection getItems () { return ((Collection) items); } /** * 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 on this body part. */ public boolean equipItem (Item item) { return (false); // TODO: Implement this function. } /** * Drop an item from this body part. If the item cannot be dropped * (maybe it is cursed or grafted onto the body part), this function * will return false. * * @return True if item is dropped from this body part. */ public boolean dropItem (Item item) { return (true); // TODO: Implement this function. } } --- NEW FILE: Strength.java --- /* * Strength.java -- class declaration for Strength scores * 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: Strength.java,v 1.1 2003/04/04 20:22:51 elemings Exp $ */ package ogs.core; import ogs.core.Ability; import ogs.core.Size; /** * An ability that determines physical power and force. A Strength * modifier is added to attack rolls with melee weapons and damage * rolls with melee weapons, thrown weapons, and specially designed * projectile weapons. Strength is a special ability that has * additional operations for determining carrying capacities. */ public class Strength extends Ability { /** * Create a new Strength score. The Strength score is rolled using * the standard method. */ public Strength () { super (Ability.STR); } /** * 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. */ public Strength (Ability.Method method) { super (Ability.STR, method); } /** * Determine the limit of light loads for this ability. * * @param sizeType Size type of creature. * @return Weight in pounds. */ public double getLightLoad (char sizeType) { return (getHeavyLoad (sizeType) / 3); } /** * Determine the limit of medium loads for this ability. * * @param sizeType Size type of creature. * @return Weight in pounds. */ public double getMediumLoad (char sizeType) { return ((2 * getHeavyLoad (sizeType)) / 3); } /** * Determine the limit of heavy loads for this ability. * * @param sizeType Size type of creature. * @return Weight in pounds. */ public double getHeavyLoad (char sizeType) { return (getMediumSizeHeavyLoad () * getLoadFactor (sizeType)); } private static double table11To19 [] = { 115, 130, 150, 175, 200, 230, 260, 300, 350, 400, }; private static double table20AndAbove [] = { 400, 460, 520, 600, 700, 800, 920, 1040, 1200, 1400 }; /** * Determine the limit of heavy loads for a medium-size creature. * * @return Weight in pounds. */ private double getMediumSizeHeavyLoad () { int score = getCurrentScore (); double load = 0.0; if (score < 11) { load = score * 10.0; } else if (score < 20) { load = table11To19 [score - 11]; } else { load = table20AndAbove [score % 10]; int factor = (score - 20) / 10; load *= Math.pow (4.0, factor); } return (load); } /** * Determine the load factor of a size. * * @param sizeType Size type of creature. * @return Load factor of size. */ private double getLoadFactor (char 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); } } Index: Abilities.java =================================================================== RCS file: /cvsroot/ogs/dist/java/ogs/core/Abilities.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Abilities.java 27 Feb 2003 22:42:19 -0000 1.4 --- Abilities.java 4 Apr 2003 20:22:50 -0000 1.5 *************** *** 23,97 **** package ogs.core; ! import ogs.core.abilities.*; /** * A set of ability scores. A set of ability scores normally consists ! * of one score for each type of ability. Some entities however may not ! * possess all six abilities. Certain creatures by their very nature ! * may lack for example Intelligence, Constitution, Strength, or some ! * other ability. ! * ! * @see ogs.core.abilities */ public class Abilities { ! /** A Charisma score. */ ! public Charisma cha; ! /** A Constitution score. */ ! public Constitution con; ! /** A Dexterity score. */ ! public Dexterity dex; /** ! * An Intelligence score. Note the difference in naming convention ! * since <code>int</code> is a reserved word in Java. */ ! public Intelligence intl; ! /** A Strength score. */ ! public Strength str; ! /** A Wisdom score. */ ! public Wisdom wis; /** ! * Create a new set of ability scores. The ability scores are rolled ! * with the standard method. */ ! public Abilities () { ! this.cha = new Charisma (); ! this.con = new Constitution (); ! this.dex = new Dexterity (); ! this.intl = new Intelligence (); ! this.str = new Strength (); ! this.wis = new Wisdom (); } /** ! * Determine which ability in this set is an instance of an ability ! * class. This method will return null if the class is not derived ! * from the <code>Ability</code> class or if the ability does not ! * exist in the set. * ! * @param abilityClass A class dervied from <code>Ability</code>. ! * @return An ability from the set or null. */ ! public Ability getAbility (Class abilityClass) { ! Ability ability = null; ! if (Ability.class.isAssignableFrom (abilityClass)) { ! if (abilityClass.isInstance (this.cha)) { ! ability = this.cha; ! } else if (abilityClass.isInstance (this.con)) { ! ability = this.con; ! } else if (abilityClass.isInstance (this.dex)) { ! ability = this.dex; ! } else if (abilityClass.isInstance (this.intl)) { ! ability = this.intl; ! } else if (abilityClass.isInstance (this.str)) { ! ability = this.str; ! } else if (abilityClass.isInstance (this.wis)) { ! ability = this.wis; ! } ! } ! return (ability); } --- 23,128 ---- package ogs.core; ! import java.util.Map; ! import java.util.HashMap; ! import java.util.Iterator; ! import java.util.Set; ! ! import ogs.core.Ability; ! import ogs.core.Strength; /** * A set of ability scores. A set of ability scores normally consists ! * of one score for each ability. Some entities however may not possess ! * all six abilities. Certain creatures for example may lack ! * Intelligence, Constitution, Strength, or some other ability by their ! * very nature. */ public class Abilities { ! private Map map = null; ! /** ! * Create a new set of ability scores. This constructor uses the ! * standard method to create a complete set of all six ability scores. */ ! public Abilities () { ! this.map = new HashMap (Ability.NUM); ! Ability ability = new Ability (Ability.CHA); ! this.map.put (new Integer (Ability.CHA), ability); ! ability = new Ability (Ability.CON); ! this.map.put (new Integer (Ability.CON), ability); ! ability = new Ability (Ability.DEX); ! this.map.put (new Integer (Ability.DEX), ability); ! ability = new Ability (Ability.INT); ! this.map.put (new Integer (Ability.INT), ability); ! ability = new Strength (); ! this.map.put (new Integer (Ability.STR), ability); ! ability = new Ability (Ability.WIS); ! this.map.put (new Integer (Ability.WIS), ability); ! } /** ! * Create a new set of ability scores using a method. This ! * constructor uses the provided method to create a complete set of ! * all six ability scores. ! * ! * @param method A method for generating ability scores. */ ! public Abilities (Ability.Method method) { ! this.map = new HashMap (Ability.NUM); ! Ability ability = new Ability (Ability.CHA); ! this.map.put (new Integer (Ability.CHA), ability); ! ability = new Ability (Ability.CON); ! this.map.put (new Integer (Ability.CON), ability); ! ability = new Ability (Ability.DEX); ! this.map.put (new Integer (Ability.DEX), ability); ! ability = new Ability (Ability.INT); ! this.map.put (new Integer (Ability.INT), ability); ! ability = new Strength (method); ! this.map.put (new Integer (Ability.STR), ability); ! ability = new Ability (Ability.WIS); ! this.map.put (new Integer (Ability.WIS), ability); } /** ! * Determine the iterator for this set of abilities. * ! * @return Iterator for this set of abilities. */ ! public Iterator getIterator () { ! Set set = this.map.entrySet (); ! return (set.iterator ()); ! } ! /** ! * 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. ! */ ! public Ability getAbility (int abilityType) { ! Object object = new Integer (abilityType); ! return ((Ability) this.map.get (object)); ! } ! /** ! * Remove an ability from this set of abilities. ! * ! * @param abilityType Type of ability to be removed. ! */ ! public void removeAbility (int abilityType) { ! Object object = new Integer (abilityType); ! this.map.remove (object); ! } ! ! /** ! * Determine if this set 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. ! */ ! public boolean isComplete () { ! return (map.size () == Ability.NUM); } *************** *** 141,179 **** * @param score Highest score. * @return True if this set of abilities can be rerolled. - * @throw RuntimeException If all six abilities are not present. */ private boolean canReroll (int modifier, int score) { ! if (this.cha == null || this.con == null || ! this.dex == null || this.intl == null || ! this.str == null || this.wis == null) { ! String msg = "All six abilities required to perform this operation."; ! throw new RuntimeException (msg); ! } else { ! int total = 0; ! // TODO: Finish tranlsating from C++ implementation. ! ! int 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); } } } --- 172,201 ---- * @param score Highest score. * @return True if this set of abilities can be rerolled. */ private boolean canReroll (int modifier, int score) { ! boolean canReroll = false; ! if (isComplete ()) { ! int total = 0; ! Ability ability = null; ! int highest = 0; ! int abilityTypes [] = { ! Ability.CHA, Ability.CON, Ability.DEX, ! Ability.INT, Ability.STR, Ability.WIS ! }; ! for (int i = 0; i < Ability.NUM; ++i) { ! Object object = new Integer (abilityTypes [i]); ! ability = (Ability) this.map.get (object); ! total += (ability.getModifier ()).getValue (); ! if (ability.getOriginalScore () > highest) { ! highest = ability.getOriginalScore (); ! } } ! canReroll = total <= modifier || highest <= score; } + + return (canReroll); } } Index: Ability.java =================================================================== RCS file: /cvsroot/ogs/dist/java/ogs/core/Ability.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Ability.java 27 Feb 2003 01:24:43 -0000 1.3 --- Ability.java 4 Apr 2003 20:22:50 -0000 1.4 *************** *** 30,74 **** import ogs.core.Die; import ogs.core.Modifier; /** ! * 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>. */ ! public abstract class Ability extends Object { /** ! * The modifier resulting from the current score of an ability. */ ! public class Modifier extends ogs.core.Modifier { ! /** ! * Create a new ability modifier. ! * ! * @param value Value of this modifier. ! */ ! public Modifier (int value) { ! super (value); ! } /** ! * Update the value of this modifier. * ! * @param event The event that occurred. */ ! protected void handleEvent (EventObject event) { ! setValue (getModifier (current)); ! } } ! private byte original; ! private Vector modifiers; ! private byte current; ! private Ability.Modifier modifier; /** --- 30,131 ---- import ogs.core.Die; import ogs.core.Modifier; + import ogs.core.Modifiers; /** ! * 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: zero or more <I>score modifiers</I> that ! * are added to the original score and one <I>ability modifier</I> ! * resulting from the current score. <P> */ ! public class Ability extends ogs.support.Object { /** ! * An ability that determines physical power and force. ! * ! * @see ogs.core.Strength */ ! public static final byte STR = 1; ! ! /** ! * An ability that determines agility and quickness. A Dexterity ! * modifier is added to ranged attacks with thrown weapons and ! * projectile weapons, defense ratings, and Reflex saving throws. ! * ! * @see Defense ! * @see Saves::ref ! */ ! public static final byte DEX = 2; + /** + * An ability that determines fitness and vigor. A Constiution + * modifier is added to hit die rolls and Fortitude saving throws. + * + * @see Saves::fort + */ + public static final byte CON = 3; + + /** An ability that determines reasoning and deduction. */ + public static final byte INT = 4; + + /** + * An ability that determines intuition and judgement. The Wisdom + * modifier is added to all Will saving throws. + * + * @see Saves::will + */ + public static final byte WIS = 5; + + /** A ability that determines leadership and charm. */ + public static final byte CHA = 6; + + /** Number of ability types. */ + public static final byte NUM = 6; + + /** + * A function object that generates an ability score. Ability methods + * have at least one member: an operation that generates an ability + * score. + */ + public abstract class Method { /** ! * Generate an ability score for a type of ability. The type of ! * ability may be ignored if it is not needed to generate a score. * ! * @param abilityType Type of ability score to generate. ! * @return A score for the given type of ability. */ ! public abstract byte generateScore (int abilityType); } ! /** ! * Determine if an integer value is a valid type of ability. ! * ! * @return True if integer value is a valid type of ability. ! */ ! private boolean isValid (int i) { ! return (i == Ability.CHA || i == Ability.CON || ! i == Ability.DEX || i == Ability.INT || ! i == Ability.STR || i == Ability.WIS); ! } ! ! /** ! * 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. ! */ ! public class StandardMethod extends Method { ! public byte generateScore (int abilityType) { ! return (rollStandard ()); ! } ! } /** *************** *** 81,85 **** * @return An ability score. */ ! public static byte rollStandard () { int total = Die.roll (Die.d6); int lowest = total; --- 138,142 ---- * @return An ability score. */ ! private static byte rollStandard () { int total = Die.roll (Die.d6); int lowest = total; *************** *** 98,101 **** --- 155,170 ---- /** + * 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. + */ + public class AverageMethod extends Method { + public byte generateScore (int abilityType) { + return (rollAverage ()); + } + } + + /** * Produce an ability score using the average method. With * the average method, three d6 die are rolled and added together. *************** *** 105,113 **** * @return An ability score. */ ! public static byte rollCommon () { return ((byte) Die.roll (Die.d6, 3)); } /** * Produce an ability score using the high-powered method. With the * high-powered method, five d6 die are rolled, the lowest two rolls --- 174,194 ---- * @return An ability score. */ ! private static byte rollAverage () { return ((byte) Die.roll (Die.d6, 3)); } /** + * 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 + */ + public class HighPoweredMethod extends Method { + public byte generateScore (int abilityType) { + return (rollHighPowered ()); + } + } + + /** * Produce an ability score using the high-powered method. With the * high-powered method, five d6 die are rolled, the lowest two rolls *************** *** 118,122 **** * @return An ability score. */ ! public static byte rollHighPowered () { int lowest1 = Die.roll (Die.d6); int lowest2 = Die.roll (Die.d6); --- 199,203 ---- * @return An ability score. */ ! private static byte rollHighPowered () { int lowest1 = Die.roll (Die.d6); int lowest2 = Die.roll (Die.d6); *************** *** 179,246 **** /** ! * Determine the original ability score. */ ! public byte getOriginalScore () { ! return (original); } /** ! * Change the original ability score. * ! * @param original The original ability score. */ ! public void setOriginalScore (byte original) { ! this.original = original; ! notifyListeners (null); } /** ! * Determine the current ability score. */ ! public byte getCurrentScore () { ! return (current); } /** ! * Add a modifier to the ability score. * ! * @param modifier An ability score modifier. */ ! public void addModifier (Modifier modifier) { ! // Ability score needs to be updated if the modifier changes. ! modifier.addListener (this); ! modifiers.add (modifier); ! notifyListeners (null); } /** ! * Remove a modifier from the ability score. * ! * @param modifier An ability score modifier. */ ! public void removeModifier (Modifier modifier) { ! // TODO: See if the modifier is present first. ! modifier.removeListener (this); ! modifiers.remove (modifier); ! notifyListeners (null); } /** ! * Produce a copy of the ability modifier. */ ! public Ability.Modifier getModifier () { ! return (modifier); } /** ! * Initialize an ability rolled using the standard method. Called ! * only by constructors of subclasses of the <code>Ability</code> ! * class. */ ! protected Ability () { ! original = current = rollStandard (); ! modifiers = new Vector (); ! modifier = new Ability.Modifier (getModifier (current)); ! this.addListener (modifier); } --- 260,371 ---- /** ! * The modifier resulting from the current score of an ability. */ ! public class Modifier extends ogs.core.Modifier { ! /** ! * Create a new ability modifier. ! * ! * @param value Value of this modifier. ! */ ! public Modifier (int value) { ! super (value); ! } ! ! /** ! * Update the value of this modifier. ! * ! * @param event The event that occurred. ! */ ! protected void handleEvent (EventObject event) { ! setValue (getModifier (current)); ! } } + private int type; + private byte original; + private Modifiers modifiers; + private byte current; + private Ability.Modifier modifier; + /** ! * Create a new ability score using a method. The public constructors ! * are defined in terms of this constructor. * ! * @param abilityType A type of ability. ! * @param method A method for generating an ability score. ! * @throws IllegalArgumentException If abilityType is not valid. */ ! private void createAbility (int abilityType, Method method) { ! if (! isValid (abilityType)) { ! String s = "abilityType (" + abilityType + ! ") is not a valid type of ability"; ! throw (new IllegalArgumentException (s)); ! } ! ! this.type = abilityType; ! this.original = method.generateScore (abilityType); ! this.modifiers = new Modifiers (); ! this.current = this.original; ! this.modifier = new Ability.Modifier (getModifier (this.current)); ! this.addListener (modifier); } /** ! * Create a new ability score. The ability score is generated using ! * the standard method. ! * ! * @param abilityType A type of ability. ! * @throws IllegalArgumentException If abilityType is not valid. */ ! public Ability (int abilityType) { ! StandardMethod method = new StandardMethod (); ! createAbility (abilityType, method); } /** ! * Create a new ability score using a method. * ! * @param abilityType A type of ability. ! * @param method A method for generating an ability score. ! * @throws IllegalArgumentException If abilityType is not valid. */ ! public Ability (int abilityType, Method method) { ! createAbility (abilityType, method); } /** ! * Determine the original ability score. * ! * @return The original score of this ability. */ ! public byte getOriginalScore () { ! return (this.original); } /** ! * Determine the current ability score. ! * ! * @return The current score of this ability. */ ! public byte getCurrentScore () { ! return (this.current); } /** ! * Determine the score modifiers for this ability. ! * ! * @return A list of score modifiers for this ability. */ ! public Modifiers getModifiers () { ! return (this.modifiers); ! } ! ! /** ! * Determine the ability modifier for this ability. ! * ! * @return The ability modifier for this ability. ! */ ! public Ability.Modifier getModifier () { ! return (this.modifier); } *************** *** 252,272 **** */ protected void handleEvent (EventObject event) { ! current = original; ! ! // Add all modifiers to current score. ! Iterator iterator = modifiers.iterator (); ! while (iterator.hasNext ()) { ! Modifier mod = (Modifier) iterator.next (); ! current += mod.getValue (); ! } // No such thing as negative ability scores. ! if (current < 0) { ! current = 0; } notifyListeners (event); } - } --- 377,390 ---- */ protected void handleEvent (EventObject event) { ! this.current = this.original; ! this.current += this.modifiers.getValue (); // No such thing as negative ability scores. ! if (this.current < 0) { ! this.current = 0; } notifyListeners (event); } } Index: CClass.java =================================================================== RCS file: /cvsroot/ogs/dist/java/ogs/core/CClass.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CClass.java 24 Feb 2003 11:32:15 -0000 1.2 --- CClass.java 4 Apr 2003 20:22:50 -0000 1.3 *************** *** 154,158 **** * different advvancement rate is required. */ ! public int getBaseAttackValue () { return (Experience.getAverageAttack (getLevel ())); } --- 154,158 ---- * different advvancement rate is required. */ ! protected int getBaseAttackValue () { return (Experience.getAverageAttack (getLevel ())); } *************** *** 164,168 **** * this method if a different advancement rate is required. */ ! public int getBaseFortSaveValue () { return (Saves.getWeakBonus (getLevel ())); } --- 164,168 ---- * this method if a different advancement rate is required. */ ! protected int getBaseFortSaveValue () { return (Saves.getWeakBonus (getLevel ())); } *************** *** 174,178 **** * a different advancement rate is required. */ ! public int getBaseRefSaveValue () { return (Saves.getWeakBonus (getLevel ())); } --- 174,178 ---- * a different advancement rate is required. */ ! protected int getBaseRefSaveValue () { return (Saves.getWeakBonus (getLevel ())); } *************** *** 184,188 **** * a different advancement rate is required. */ ! public int getBaseWillSaveValue () { return (Saves.getWeakBonus (getLevel ())); } --- 184,188 ---- * a different advancement rate is required. */ ! protected int getBaseWillSaveValue () { return (Saves.getWeakBonus (getLevel ())); } Index: Creature.java =================================================================== RCS file: /cvsroot/ogs/dist/java/ogs/core/Creature.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Creature.java 7 Jan 2003 07:20:33 -0000 1.1 --- Creature.java 4 Apr 2003 20:22:51 -0000 1.2 *************** *** 78,112 **** /** The ability scores for this creature. */ ! protected Abilities abilities; /** The saving throw modifiers for this creature. */ ! protected Saves saves = new Saves (); /** The movement speed for this creature when walking. */ ! protected double walk = 0.0; /** The movement speed for this creature when climbing. */ ! protected double climb = 0.0; /** The movement speed for this creature when swimming. */ ! protected double swim = 0.0; /** The movement speed for this creature when flying. */ ! protected double fly = 0.0; /** The movement speed for this creature when burrowing. */ ! protected double burrow = 0.0; /** A list of skills for this creature. */ ! protected Vector skills = new Vector (); /** A list of feats for this creature. */ ! protected Vector feats = new Vector (); /** The initiative modifiers for this creature. */ ! protected Modifiers init = new Modifiers (); /** The hit dice for this creature. */ ! protected Vector hitDice = new Vector (); /** --- 78,115 ---- /** The ability scores for this creature. */ ! private Abilities abilities = null; /** The saving throw modifiers for this creature. */ ! private Saves saves = null; /** The movement speed for this creature when walking. */ ! private double walk = 0.0; /** The movement speed for this creature when climbing. */ ! private double climb = 0.0; /** The movement speed for this creature when swimming. */ ! private double swim = 0.0; /** The movement speed for this creature when flying. */ ! private double fly = 0.0; /** The movement speed for this creature when burrowing. */ ! private double burrow = 0.0; /** A list of skills for this creature. */ ! private Vector skills = null; /** A list of feats for this creature. */ ! private Vector feats = null; /** The initiative modifiers for this creature. */ ! private Modifiers init = null; /** The hit dice for this creature. */ ! private Vector hitDice = null; ! ! /** The body parts that compose the body of this creature. */ ! private Vector body = null; /** *************** *** 119,125 **** --- 122,156 ---- protected Creature () { super (); + + this.abilities = new Abilities (); + this.saves = new Saves (); + this.skills = new Vector (); + this.feats = new Vector (); + this.init = new Modifiers (); + this.hitDice = new Vector (); + addModifiers (); } + private void addModifiers () { + Ability ability = abilities.getAbility (Ability.DEX); + if (ability != null) { + Modifier modifier = ability.getModifier (); + init.addModifier (modifier); + defense.addModifier (modifier); + saves.ref.addModifier (modifier); + } + + ability = abilities.getAbility (Ability.CON); + if (ability != null) { + saves.fort.addModifier (ability.getModifier ()); + } + + ability = abilities.getAbility (Ability.WIS); + if (ability != null) { + saves.will.addModifier (ability.getModifier ()); + } + } + /** * Determine the ability scores for this creature. *************** *** 199,203 **** */ public void addSkill (Skill skill) { ! } --- 230,234 ---- */ public void addSkill (Skill skill) { ! // TODO: Implement this function. } *************** *** 208,212 **** */ public void removeSkill (Skill skill) { ! } --- 239,243 ---- */ public void removeSkill (Skill skill) { ! // TODO: Implement this function. } *************** *** 226,230 **** */ public void addFeat (Feat feat) { ! } --- 257,261 ---- */ public void addFeat (Feat feat) { ! // TODO: Implement this function. } *************** *** 235,249 **** */ public void removeFeat (Feat feat) { ! } ! private void addModifiers () { ! init.addModifier (abilities.dex.getModifier ()); ! defense.addModifier (abilities.dex.getModifier ()); ! ! saves.fort.addModifier (abilities.con.getModifier ()); ! saves.ref.addModifier (abilities.dex.getModifier ()); ! saves.will.addModifier (abilities.wis.getModifier ()); } } --- 266,281 ---- */ public void removeFeat (Feat feat) { ! // TODO: Implement this function. } ! /** ! * Determine the body parts that compose the body of this creature. ! * ! * @return A collection of body parts for this creature. ! */ ! public Collection getBody () { ! return ((Collection) this.body); } + } Index: Feat.java =================================================================== RCS file: /cvsroot/ogs/dist/java/ogs/core/Feat.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Feat.java 27 Feb 2003 01:24:44 -0000 1.2 --- Feat.java 4 Apr 2003 20:22:51 -0000 1.3 *************** *** 23,26 **** --- 23,31 ---- package ogs.core; + import java.util.Collection; + import java.util.Iterator; + + import ogs.support.Object; + import ogs.core.Creature; import ogs.core.Feature; *************** *** 55,63 **** /** ! * Determine the compatibility of this type of feat. ! * ! * @return EXCLUSIVE, REPEATBLE, or CUMULATIVE. */ ! public abstract int getCompatibility (); /** --- 60,90 ---- /** ! * A general-purpose feat. General feats are feats that can be ! * used by all creatures and cclasses or apply to many different ! * situations. */ ! public static final int 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. ! */ ! public static final int 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. ! */ ! public static final int MAGIC = 2; ! ! /** ! * 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. ! */ ! public static final int SPECIAL = 3; /** *************** *** 88,91 **** --- 115,177 ---- return (xpLevel); + } + + /** + * Determine the compatibility of this type of feat. + * + * @return EXCLUSIVE, REPEATBLE, or CUMULATIVE. + */ + public abstract int getCompatibility (); + + /** + * Determine the group of this type of feat. + * + * @return GENERAL, COMBAT, MAGIC, or SPECIAL. + */ + public abstract int getGroup (); + + /** + * 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. + */ + protected boolean canAttach (Object object) { + return (super.canAttach (object) && + Creature.class.isAssignableFrom (object.getClass ())); + } + + /** + * Determine if a creature has a feat. If the specified object is not + * a creature, this method will return false. + * + * @param creatureObject Object (creature) to check for feat. + * @param featClass Class of feat. + * @return True if creature has an instance of the feat. + */ + protected boolean findFeat (Object creatureObject, Class featClass) { + boolean found = false; + + Creature creature = null; + try { + creature = (Creature) creatureObject; + } catch (ClassCastException exception) { + // Object not a creature? Feat not found. + } + + if (creature != null) { + Collection feats = creature.getFeats (); + Iterator itor = feats.iterator (); + while (!found && itor.hasNext ()) { + Feat feat = (Feat) itor.next (); + if (featClass.isAssignableFrom (feat.getClass ())) { + found = true; + } + } + } + + return (found); } } Index: Feature.java =================================================================== RCS file: /cvsroot/ogs/dist/java/ogs/core/Feature.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Feature.java 27 Feb 2003 22:42:19 -0000 1.3 --- Feature.java 4 Apr 2003 20:22:51 -0000 1.4 *************** *** 44,51 **** /** * Attach this feature to an object. This method should always be ! * called first by derived classes that override this method. It ! * simply makes sure that the feature is not being attached to ! * itself and then attaches the given object. * * @param object Object to attach this feature to. --- 44,60 ---- /** + * 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. + */ + protected boolean canAttach (Object object) { + return (this.object != null && object != this); + } + + /** * Attach this feature to an object. This method should always be ! * called first by derived classes that override this method. * * @param object Object to attach this feature to. *************** *** 53,63 **** */ public boolean attachObject (Object object) { ! boolean success = false; ! // A feature can not be attached to itself. ! if (object != this) { this.object = object; } return (true); } --- 62,81 ---- */ public boolean attachObject (Object object) { ! boolean attached = canAttach (object); ! if (attached) { this.object = object; } + return (attached); + } + + /** + * 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. + */ + protected boolean canDetach () { return (true); } *************** *** 65,77 **** /** * Detach this feature from an object. This method should always be ! * called by derived classes that override this method. It should ! * <em>never</em> be called before a call to the {@link #getObject()} ! * method. * * @return True if the feature is detached from the object. */ public boolean detachObject () { ! this.object = null; ! return (true); } --- 83,98 ---- /** * Detach this feature from an object. This method should always be ! * called by derived classes that override this method. * * @return True if the feature is detached from the object. */ public boolean detachObject () { ! boolean detached = canDetach (); ! ! if (detached) { ! this.object = null; ! } ! ! return (detached); } Index: Skill.java =================================================================== RCS file: /cvsroot/ogs/dist/java/ogs/core/Skill.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Skill.java 27 Feb 2003 01:24:44 -0000 1.3 --- Skill.java 4 Apr 2003 20:22:51 -0000 1.4 *************** *** 89,96 **** * Determine the key ability for this type of skill. The modifier of * the key ability is always added to the skill check. Derived ! * classes must implement this method to return the appropriate class ! * of Ability. */ ! public abstract Class getKeyAbility (); /** --- 89,98 ---- * Determine the key ability for this type of skill. The modifier of * the key ability is always added to the skill check. Derived ! * classes must implement this method to return the appropriate type ! * of ability. ! * ! * @return Type of ability: STR, DEX, CON, INT, WIS, or CHA. */ ! public abstract int getKeyAbility (); /** *************** *** 145,150 **** */ private Ability getKeyAbility (Abilities abilities) { ! Class keyAbility = getKeyAbility (); ! return (keyAbility == null? null: abilities.getAbility (keyAbility)); } --- 147,152 ---- */ private Ability getKeyAbility (Abilities abilities) { ! int keyAbility = getKeyAbility (); ! return (keyAbility == 0? null: abilities.getAbility (keyAbility)); } |
From: <ele...@us...> - 2003-04-04 20:23:23
|
Update of /cvsroot/ogs/dist/java/ogs/cclasses In directory sc8-pr-cvs1:/tmp/cvs-serv9450/java/ogs/cclasses Modified Files: Fighter.java package.html Added Files: Barbarian.java Bard.java Cleric.java Druid.java Monk.java Paladin.java Ranger.java Rogue.java Sorcerer.java Wizard.java Log Message: See ChangeLog files (Apr 3-4) for details. --- NEW FILE: Barbarian.java --- /* * Barbarian.java -- class declaration for barbarians * 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: Barbarian.java,v 1.1 2003/04/04 20:22:48 elemings Exp $ */ package ogs.cclasses; import ogs.core.CClass; import ogs.core.Die; import ogs.core.Experience; import ogs.core.Saves; /** * A savage, uncivilized, warlike character class. Barbarians are * fearsome warriors that have unique features that give them an edge in * combat. First of all, a barbarian moves faster than other members of * his or her race. A barbarian can also fly into a screaming, * bloodthirsty frenzy that gives them offensive bonuses at the expense * of defensive ability. At higher levels, barbarians gain the uncanny * dodge feature (the same feature available to rogues) and the * extrodinary ability to ignore a little damage that may be inflicted * by others. <P> * * Barbarians are naturally proficient with light and medium armor as * well as all simple and martial weapons. But because of their chaotic * natures, all barbarians have one alignment restriction: they can not * be of lawful alignment Any barbarian that becomes lawful in * alignment can no longer use their rage ability and cannot advance in * level. <P> * * Barbarians are typically used in fantasy campaign settings though * this class can be used in other settings as well.. */ public class Barbarian extends CClass { /** * Create a new 1st-level Barbarian cclass. */ public Barbarian () { super (); } /** * Create a new Nth-level Barbarian cclass. * * @param xpLevel Experience level of barbarian. */ public Barbarian (int xpLevel) { super (xpLevel); } /** * Determine the hit die for barbarians. * * @return Die.d12. */ public int getHitDie () { return (Die.d4); } /** * Determine the skill points per experience level for barbarians. * * @return 4 skill points. */ public int getSkillPoints () { return (4); } /** * Determine the value of base attack bonus for barbarians. * * @return Value of base attack bonus. */ protected int getBaseAttackValue () { return (Experience.getStrongAttack (getLevel ())); } /** * Determine the value of base Fortitude save bonus for barbarians. * * @return Value of base Fortitude save bonus. */ protected int getBaseFortSaveValue () { return (Saves.getStrongBonus (getLevel ())); } } --- NEW FILE: Bard.java --- /* * Bard.java -- class declaration for bards * 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: Bard.java,v 1.1 2003/04/04 20:22:48 elemings Exp $ */ package ogs.cclasses; import java.util.Vector; import ogs.core.CClass; import ogs.core.Die; import ogs.core.Experience; import ogs.core.Saves; /** * A "jack-of-all-trades" character class well versed in music and lore. * Bards have the ability to cast spells through their song and music. * Charisma is the ability used by bards to cast spells. In addition to * spells, bards can produce other unique effects that can charm other * creatures or inspire their allies. These effects include inspire * courage, countersong, fascinate, inspire competance, suggestion, and * inspire greatness. In addition to song and music, bards are * proficient at many roguish skills and acquire knowledge on many * esoteric subjects. <P> * * At 2st-level, bards automatically gain the Simple Weapon, Light * Armor, Medium Armor, and Shield Proficiency feats. They also select * one proficiency from the following weapons: any bow, shortsword, * longsword, rapier, sap, or whip. Bards have the same alignment * restriction as barbarians: bards can not be of lawful alignment. Any * bard that becomes lawful in alignment can still use all bardic * abilities but cannot advance in level. <P> * * Bards are typically found in fantasy campaign settings. */ public class Bard extends CClass { /** * Create a new 1st-level Bard cclass. */ public Bard () { super (); } /** * Create a new Nth-level Bard cclass. * * @param xpLevel Experience level of bard. */ public Bard (int xpLevel) { super (xpLevel); } /** * Determine the hit die for this cclass. Bards use d6 for their hit * die. * * @return Die.d6. */ public int getHitDie () { return (Die.d6); } /** * Determine the skill points per experience level for this cclass. * Bards gain 4 skill points for each experience level. * * @return 4 skill points. */ public int getSkillPoints () { return (4); } /** * Determine the value of base Reflex save bonus for this cclass. * Bards use the strong advancement rate for base Reflex save bonuses. * * @return Value of base Reflex save bonus. */ protected int getBaseRefSaveValue () { return (Saves.getStrongBonus (getLevel ())); } /** * Determine the value of base Will save bonus for this cclass. Bards * use the strong advancement rate for base Will save bonuses. * * @return Value of base Will save bonus. */ protected int getBaseWillSaveValue () { return (Saves.getStrongBonus (getLevel ())); } /** * Determine the number of spells that this bard can cast per day. * * @return Number of spells at each spell leve. */ public Vector getSpellsPerDay () { return (new Vector ()); // TODO: Implement. } /** * Determine the number of spells knonwn by this bard. * * @return Number of spells at each spell level. */ public Vector getSpellsKnown () { return (new Vector ()); // TODO: Implement. } } --- NEW FILE: Cleric.java --- /* * Cleric.java -- class declaration for clerics * 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: Cleric.java,v 1.1 2003/04/04 20:22:48 elemings Exp $ */ package ogs.cclasses; import java.util.Vector; import ogs.core.CClass; import ogs.core.Die; import ogs.core.Experience; import ogs.core.Saves; /** * A pious character class devoted to the service of a deity. Clerics * are spell casters of divine magic. Their spells are granted to them * from their diety through their faith and prayers. In addition, * clerics may select two domains governed by their diety. Domains * grant clerics additionaly spells and features. Clerics also have a * feature called spontaneous casting. A cleric can replace a prepared * spell (other than a domain spell) with a cure wounds spell (or * inflict wounds spell depending on his or her alignment) of the same * spell level or lower. <P> * * The most prominent feature of clerics however is the ability to turn * (or rebuke depending on alignment) undead creatures. Neutral clerics * choose whether they spontaneous cast cure wounds or inflict wounds * and whether they turn or rebuke undead. Once a neutral cleric makes * their choice, it cannot be changed. Clerics can also take up arms * when duty requires it. As such, clerics are automatically proficient * with all types of armor and shields and all simple weapons. <P> * * Clerics are typically found in fantasy campaign settings. */ public class Cleric extends CClass { /** * Create a new 1st-level Cleric cclass. */ public Cleric () { super (); } /** * Create a new Nth-level Cleric cclass. * * @param xpLevel Experience level of cleric. */ public Cleric (int xpLevel) { super (xpLevel); } /** * Determine the hit die for this cclass. Clerics use d8 for their * hit die. * * @return Die.d8. */ public int getHitDie () { return (Die.d8); } /** * Determine the skill points per experience level for this cclass. * Clerics gain 2 skill points for each experience level. * * @return 2 skill points. */ public int getSkillPoints () { return (2); } /** * Determine the value of base Fortitude save bonus for this cclass. * Clerics use the strong advancement rate for base Fortitude save * bonuses. * * @return Value of base Fortitude save bonus. */ protected int getBaseFortSaveValue () { return (Saves.getStrongBonus (getLevel ())); } /** * Determine the value of base Will save bonus for this cclass. * Clerics use the strong advancment rate for base Will save bonuses. * * @return Value of base Will save bonus. */ protected int getBaseWillSaveValue () { return (Saves.getStrongBonus (getLevel ())); } /** * Determine the number of spells that this cleric can cast per day. * * @return Number of spells at each spell leve. */ public Vector getSpellsPerDay () { return (new Vector ()); // TODO: Implement. } } --- NEW FILE: Druid.java --- /* * Druid.java -- class declaration for druids * 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: Druid.java,v 1.1 2003/04/04 20:22:48 elemings Exp $ */ package ogs.cclasses; import java.util.Vector; import ogs.core.CClass; import ogs.core.Die; import ogs.core.Experience; import ogs.core.Saves; /** * A character class that reveres nature. Druids are protectors and * servants of nature.. As such, they are rarely if ever found in or * near large cities. They are most often found in remote and isolated * wilderness areas. Their intimate knowledge of the natural world is * their source of power. Like clerics, druids are also spell casters * of diving magic and Wisdom is their primary spell casting ability. * In addition to spells, druids gain many special features as they * advance in level including nature sense, animal companion, woodland * stride, trackless step, wild shape, venom immunity, alter self, and * timeless body. <P> * * At 1st-level, druids are proficient with light and medium armor * though they are prohibited from wearing metal armor. They are * proficient with clubs, daggers, darts, slings, quarterstaffs, spears * (short, half, long), scimitars, and sickles. Druids must be of * partially neutral alignment. They can be neutral good, lawful * neutral, true neutral, chaotic neutral, or neutral evil. A druid * who becomes any other alignment loses all spells and druidic * abilities until he or she atones as per the Atonement spell). <P> * * This cclass is typically used in fantasy campaign settings. */ public class Druid extends CClass { /** * Create a new 1st-level Druid cclass. */ public Druid () { super (); } /** * Create a new Nth-level Druid cclass. * * @param xpLevel Experience level of druid. */ public Druid (int xpLevel) { super (xpLevel); } /** * Determine the hit die for this cclass. Druids use d8 for their hit * die. * * @return Die.d8. */ public int getHitDie () { return (Die.d8); } /** * Determine the skill points per experience level for this cclass. * Druids gain 4 skill points for each experience level. * * @return 4 skill points. */ public int getSkillPoints () { return (4); } /** * Determine the value of base Fortitude save bonus for this cclass. * Druids use the strong advancement rate for base Fortitude save * bonuses. * * @return Value of base Fortitude save bonus. */ protected int getBaseFortSaveValue () { return (Saves.getStrongBonus (getLevel ())); } /** * Determine the value of base Will save bonus for this cclass. * Druids use the strong advancement rate for base Will save bonuses. * * @return Value of base Will save bonus. */ protected int getBaseWillSaveValue () { return (Saves.getStrongBonus (getLevel ())); } /** * Determine the number of spells that this druid can cast per day. * * @return Number of spells at each spell leve. */ public Vector getSpellsPerDay () { return (new Vector ()); // TODO: Implement. } } --- NEW FILE: Monk.java --- /* * Monk.java -- class declaration for monks * 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: Monk.java,v 1.1 2003/04/04 20:22:48 elemings Exp $ */ package ogs.cclasses; import ogs.core.CClass; import ogs.core.Die; import ogs.core.Experience; import ogs.core.Saves; /** * A character class dedicated to martial arts. Monks are well known * for their discipline and dedication. They are continually in pursuit * of perfection in mind, body, and spirit. They often live in isolated * monastaries where they strive to achieve this goal through long hours * of meditation and practice. Monks therefore have one alignment * restriction: a monk must be of lawful alignment. A monk who becomes * non-lawful can no longer advance in level but can still use all monk * abilities. <P> * * Monks are masters of unarmed combat. They gain the Improved Unarmed * Strike feat at 1st-level and can stun opponents with unarmed strikes. * Monks are not initially proficient with any armors or shields but * they are proficient with clubs, light and heavy crossbows, daggers, * handaxes, javelins, kamas, nunchaku, quaterstaffs, shuriken, and * slings. Monks also gain many special features as they advance in * experience level. <P> * * This cclass is typically used in fantasy campaign settings. */ public class Monk extends CClass { /** * Create a new 1st-level Monk cclass. */ public Monk () { super (); } /** * Create a new Nth-level Monk cclass. * * @param xpLevel Experience level of monk. */ public Monk (int xpLevel) { super (xpLevel); } /** * Determine the hit die for this cclass. Monks use d8 for their hit * die. * * @return Die.d8. */ public int getHitDie () { return (Die.d8); } /** * Determine the skill points per experience level for this cclass. * Monks gain 4 skill points for each experience level. * * @return 4 skill points. */ public int getSkillPoints () { return (4); } /** * Determine the value of base Fortitude save bonus for this cclass. * Monks use the strong advancement rate for base Fortitude save * bonuses. * * @return Value of base Fortitude save bonus. */ protected int getBaseFortSaveValue () { return (Saves.getStrongBonus (getLevel ())); } /** * Determine the value of base Reflex save bonus for this cclass. * Monks use the strong advancement rate for base Reflex save bonuses. * * @return Value of base Reflex save bonus. */ protected int getBaseRefSaveValue () { return (Saves.getStrongBonus (getLevel ())); } /** * Determine the value of base Will save bonus for this cclass. Monks * use the strong advancement rate for base Will save bonuses. * * @return Value of base Will save bonus. */ protected int getBaseWillSaveValue () { return (Saves.getStrongBonus (getLevel ())); } } --- NEW FILE: Paladin.java --- /* * Paladin.java -- class declaration for paladins * 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: Paladin.java,v 1.1 2003/04/04 20:22:48 elemings Exp $ */ package ogs.cclasses; import java.util.Vector; import ogs.core.CClass; import ogs.core.Die; import ogs.core.Experience; import ogs.core.Saves; /** * A character class that strives to be the paragon of virtue. Paladins * are champions of all that is pure and just. They are exemplars and * the epitome of chilvary. Paladins are often called knights, * cavaliers, and crusaders. As such, their alignment must always be * lawful good. Any paladin who ceases to be lawful good or otherwise * betrays their code of conduct immediately looses all paladin * abilities and can no longer advance in level as a paladin. * Ex-paladins may make reparations with an atonement spell. <P> * * Paladins begin proficient with all simple and martial weapons, all * light, medium, and heavy armors, and all shields. Paladins can gain * many special abilities including detect evil, divine grace, lay on * hands, divine health, aura of courage, smite evil, remove disease, * turn undead, special mount, and divine spell casting. Wisdom is used * as the spell casting ability for paladins. <P> * * Paladins are typically found in fantasy campaigns. */ public class Paladin extends CClass { private Vector _feats; /** * Create a new 1st-level Paladin cclass. */ public Paladin () { super (); } /** * Create a new Nth-level Paladin cclass. * * @param xpLevel Experience level of paladin. */ public Paladin (int xpLevel) { super (xpLevel); } /** * Determine the hit die for this cclass. Paladins use d10 for their * hit die. * * @return Die.d10. */ public int getHitDie () { return (Die.d10); } /** * Determine the skill points per experience level for this cclass. * Paladins gain 2 skill points for each experience level. * * @return 2 skill points. */ public int getSkillPoints () { return (2); } /** * Determine the value of base attack bonus for this cclass. Paladins * use the strong advancement rate for base attack bonuses. * * @return Value of base attack bonus. */ protected int getBaseAttackValue () { return (Experience.getStrongAttack (getLevel ())); } /** * Determine the value of base Fortitude save bonus for this cclass. * Paladins use the strong advancement rate for base Fortitude save * bonuses. * * @return Value of base Fortitude save bonus. */ protected int getBaseFortSaveValue () { return (Saves.getStrongBonus (getLevel ())); } /** * Attach this Paladin cclass to a character. * * @param object Object to attach this paladin to. */ public boolean attachObject (Object object) { //if (! super.attachObject (object)) { //return (false); //} Character character = (Character) object; //addDivineGrace (character); //addProficiencies (character); return (true); } /** * Determine the number of spells that this paladin can cast per day. * The vector index of the return value is the spell level. If the * number of spells for a given spell level is zero (0), the number of * spells that can be cast for that level is the same as the bonus * spells from the Charisma score of the paladin (if any). * * @return Number of spells that can be cast per spell level per day. */ public Vector getSpellsPerDay () { int INT_MAX = Integer.MAX_VALUE; int spellTable [][] = { { 0, INT_MAX, INT_MAX, INT_MAX }, { 0, INT_MAX, INT_MAX, INT_MAX }, { 1, INT_MAX, INT_MAX, INT_MAX }, { 1, INT_MAX, INT_MAX, INT_MAX }, { 1, 0, INT_MAX, INT_MAX }, { 1, 0, INT_MAX, INT_MAX }, { 1, 1, INT_MAX, INT_MAX }, { 1, 1, 0, INT_MAX }, { 1, 1, 1, INT_MAX }, { 1, 1, 1, INT_MAX }, { 2, 1, 1, 0 }, { 2, 1, 1, 1 }, { 2, 2, 1, 1 }, { 2, 2, 2, 1 }, { 3, 2, 2, 1 }, { 3, 3, 3, 2 }, { 3, 3, 3, 3 }, }; Vector spellCounts = new Vector (); int xpLevel = getLevel (); if (xpLevel >= 4) { for (int i = 0; spellTable [xpLevel][i] != INT_MAX; ++i) { spellCounts.add (i, new Integer (spellTable [xpLevel][i])); } } return (spellCounts); } } --- NEW FILE: Ranger.java --- /* * Ranger.java -- class declaration for rangers * 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: Ranger.java,v 1.1 2003/04/04 20:22:48 elemings Exp $ */ package ogs.cclasses; import java.util.Vector; import ogs.core.CClass; import ogs.core.Die; import ogs.core.Experience; import ogs.core.Saves; /** * A character class skilled at outdoor hunting and survival. Rangers * are often found serving as scouts, trackers, bounty hunters, * frontiersmen, and explorers. They often chase and defend against * certain species that they have an advantage when fighting with these * creatures. Starting at 1st-level and every five levels after that, a * ranger may select a favored enemy. Rangers gain a +1 bonus to Bluff, * Listen, Sense Motive, Spot, and Wilderness Lore skill checks against * favored enemies. They get the same bonus to damage (unless the * creature is immune to critical hits) for melee weapons and ranged * weapons when within 30 feet. Each bonus for a new favored enemy * starts at +1 and goes up by +1 every five levels. <P> * * Rangers gain the Light Armor, Medium Armor, and Shield Proficiency * feats at 1st-level as well as the Simple Weapon and Martial Weapon * (All) Proficiency feats. They also gain the Track feat automatically * at 1st-level. Rangers with a +9 base attack bonus can also select the * Improved Two-Weapon Fighting feat if they do not have the other * prerequisites for the feat. Rangers can also cast divine spells * starting at 4th-level. Their caster level is one-half their cclass * experience level. <P> * * Rangers typically exist in fantasy campaign settings. */ public class Ranger extends CClass { /** * Create a new 1st-level Ranger cclass. */ public Ranger () { super (); } /** * Create a new Nth-level Ranger cclass. * * @param xpLevel Experience level of ranger. */ public Ranger (int xpLevel) { super (xpLevel); } /** * Determine the hit die for this cclass. Rangers use d10 for their * hit die. * * @return Die.d10. */ public int getHitDie () { return (Die.d10); } /** * Determine the skill points per experience level for this cclass. * Rangers gain 4 skill points for each experience level. * * @return 4 skill points. */ public int getSkillPoints () { return (4); } /** * Determine the value of base attack bonus for this cclass. Rangers * use the strong advancement rate for base attack bonuses. * * @return Value of base attack bonus. */ protected int getBaseAttackValue () { return (Experience.getStrongAttack (getLevel ())); } /** * Determine the value of base Fortitude save bonus for this cclass. * Rangers use the strong advancement rate for base Fortitude save * bonuses. * * @return Value of base Fortitude save bonus. */ protected int getBaseFortSaveValue () { return (Saves.getStrongBonus (getLevel ())); } /** * Determine the number of spells that this ranger can cast per day. * * @return Number of spells at each spell leve. */ public Vector getSpellsPerDay () { return (new Vector ()); // TODO: Implement. } } --- NEW FILE: Rogue.java --- /* * Rogue.java -- class declaration for rogues * 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: Rogue.java,v 1.1 2003/04/04 20:22:48 elemings Exp $ */ package ogs.cclasses; import ogs.core.CClass; import ogs.core.Die; import ogs.core.Experience; import ogs.core.Saves; /** * A character class adept at "obtaining the unobtainable". Rogues * excel at breaking into safes, eluding intricate traps, infiltrating * secret organizations, gathering intelligence, and usually parting * others from their money one way or the other. Rogues can be of any * alignment. While most are considered neutral or evil, good rogues * are just as common. Their skills however are targeted at enemies * rather than their own kind. Dexterity ,and wisdom are their most * valuable assets. Intelligence and charisma are also useful in many * situations. <P> * * * Rogues can exist in just about any campaign setting. */ public class Rogue extends CClass { /** * Create a new 1st-level Rogue cclass. */ public Rogue () { super (); } /** * Create a new Nth-level Rogue cclass. * * @param xpLevel Experience level of rogue. */ public Rogue (int xpLevel) { super (xpLevel); } /** * Determine the hit die for this cclass. Rogues use d6 for their hit * die. * * @return Die.d6. */ public int getHitDie () { return (Die.d6); } /** * Determine the skill points per experience level for this cclass. * Rogues gain 8 skill points for each experience level. * * @return 8 skill points. */ public int getSkillPoints () { return (8); } /** * Determine the value of base Reflex save bonus for this cclass. * Rogues use the strong advancement rate for base Reflex save * bonuses. * * @return Value of base Reflex save bonus. */ protected int getBaseRefSaveValue () { return (Saves.getWeakBonus (getLevel ())); } } --- NEW FILE: Sorcerer.java --- /* * Sorcerer.java -- class declaration for sorcerer * 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: Sorcerer.java,v 1.1 2003/04/04 20:22:48 elemings Exp $ */ package ogs.cclasses; import java.util.Vector; import ogs.core.CClass; import ogs.core.Die; import ogs.core.Experience; import ogs.core.Saves; /** * A character class with inherent spell casting abilities. Sorcerers * are much like wizards. They have no alignment restrictions and can * summon a familliar at 1st-level. Unlike wizards however, sorcerers * are more limited in their range of spell casting abilities but do not * have to memorize spells before casting them. They are also * proficient with all simple weapons. */ public class Sorcerer extends CClass { /** * Create a new 1st-level Sorcerer cclass. */ public Sorcerer () { super (); } /** * Create a new Nth-level Sorcerer cclass. * * @param xpLevel Experience level of sorcerer. */ public Sorcerer (int xpLevel) { super (xpLevel); } /** * Determine the hit die for this cclass. Sorcerers use d4 for their * hit die. * * @return Die.d4. */ public int getHitDie () { return (Die.d4); } /** * Determine the skill points per experience level for this cclass. * Sorcerers gain 2 skill points for each experience level. * * @return 2 skill points. */ public int getSkillPoints () { return (2); } /** * Determine the value of base attack bonus for this cclass. * Sorcerers use the weak advancment rate for base attack bonuses. * * @return Value of base attack bonus. */ protected int getBaseAttackValue () { return (Experience.getWeakAttack (getLevel ())); } /** * Determine the value of base Will save bonus for sorcerers. * Sorcerers use the strong advancment rate for base Will save * bonuses. * * @return Value of base Will save bonus. */ protected int getBaseWillSaveValue () { return (Saves.getStrongBonus (getLevel ())); } /** * Determine the number of spells that this sorcerer can cast per day. * * @return Number of spells at each spell leve. */ public Vector getSpellsPerDay () { return (new Vector ()); // TODO: Implement. } /** * Determine the number of spells knonwn by this sorcerer. * * @return Number of spells at each spell level. */ public Vector getSpellsKnown () { return (new Vector ()); // TODO: Implement. } } --- NEW FILE: Wizard.java --- /* * Wizard.java -- class declaration for wizards * 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: Wizard.java,v 1.1 2003/04/04 20:22:48 elemings Exp $ */ package ogs.cclasses; import java.util.Vector; import ogs.core.CClass; import ogs.core.Die; import ogs.core.Experience; import ogs.core.Saves; /** * A character class devoted to the mastery of arcane magic. Wizards * are the quintessential wielders of arcane magic. They are * practically unlimited in their expertise with it. Wizards cast magic * by scribing known spells into their spellbooks or scrolls, studying * their spellbooks to prepare selected spells for casting, and then * triggering the spell to be cast from memory or scrolls. After a * spell is cast, the process must be repeated to cast it again. <P> * * Wizards can specialize in a school of magic. A wizard who * specializes in a school of magic must select one of the eight schools * of magic to specialize in and a combination of one or more schools * that are prohibited. The speciallist can cast extra spells in this * school but can never cast spells from one or more of the prohibited * schools. Wizards (only) may also select the Spell Mastery feat that * allows them to prepare spells without studying a spellbook. <P> * * At 1st-level, wizards may summon a familliar just like a sorcerer and * automatically gain the Scribe Scroll feat. Wizards gain a metamagic * feat every five levels in addition to feats normally gained. * Initially, wizards are not proficient with armor or shields and they * are only proficient with clubs, daggers, light and heavy crossbows, * and quarterstaffs. Wizard have no alignment restrictions; they may * be of any alignment. <P> * * This cclass is typcially used in fantasy campaign settings. * * @see ogs.magic.School */ public class Wizard extends CClass { /** * Create a new 1st-level Wizard cclass. */ public Wizard () { super (); } /** * Create a new Nth-level Wizard cclass. * * @param xpLevel Experience level of wizard. */ public Wizard (int xpLevel) { super (xpLevel); } /** * Determine the hit die for this class. Wizards use d4 for their hit * die. * * @return Die.d4. */ public int getHitDie () { return (Die.d4); } /** * Determine the skill points per experience level for wizards. * Wizards gain 2 skill points for each experience level. * * @return 2 skill points. */ public int getSkillPoints () { return (2); } /** * Determine the value of base attack bonus for wizards. Wizards use * the weak advancement rate for base attack bonuses. * * @return Value of base attack bonus. */ protected int getBaseAttackValue () { return (Experience.getWeakAttack (getLevel ())); } /** * Determine the value of base Will save bonus for wizards. Wizards * use the strong advancement rate for base Will save bonuses. * * @return Value of base Will save bonus. */ protected int getBaseWillSaveValue () { return (Saves.getStrongBonus (getLevel ())); } /** * Determine the number of spells that this wizard can cast per day. * * @return Number of spells at each spell leve. */ public Vector getSpellsPerDay () { return (new Vector ()); // TODO: Implement. } } Index: Fighter.java =================================================================== RCS file: /cvsroot/ogs/dist/java/ogs/cclasses/Fighter.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Fighter.java 24 Feb 2003 11:32:15 -0000 1.2 --- Fighter.java 4 Apr 2003 20:22:48 -0000 1.3 *************** *** 29,38 **** /** ! * A character class that specializes in weapons, armor, and combat. ! * Fighters gain a bonus combat feat at 1st level and every two levels ! * after that (2nd, 4th, 6th, etc). */ public class Fighter extends CClass { - /** * Create a new 1st-level Fighter cclass. --- 29,47 ---- /** ! * A character class formally trained in weapons, armor, and tactics. ! * Fighters are prototypical soldiers and mercenaries. Fighters have no ! * alignment restrictions. They may be of any alignment. ! * ! * At 1st-level, fighers automatically gain the Light, Medium, and Heavy ! * Armor proficiency feats. They are also proficient with all simple ! * and martial weapons. Since fighters have no special features, ! * fighters instead gain a bonus feat at 1st level and every ! * even-numbered level thereafter. Fighters can also select the Weapon ! * Specialization feat at 4th-level or higher. ! * ! * Fighters are a universal cclass. They can be found in virtually all ! * campaign settings. */ public class Fighter extends CClass { /** * Create a new 1st-level Fighter cclass. *************** *** 45,49 **** * Create a new Nth-level Fighter cclass. * ! * @param xpLevel Experience level of the cclass. */ public Fighter (int xpLevel) { --- 54,58 ---- * Create a new Nth-level Fighter cclass. * ! * @param xpLevel Experience level of fighter. */ public Fighter (int xpLevel) { *************** *** 52,56 **** /** ! * Determine the hit die for fighters. Fighters use d10 for hit die. * * @return Die.d10. --- 61,66 ---- /** ! * Determine the hit die for this cclass. Fighters use d10 for their ! * hit die. * * @return Die.d10. *************** *** 61,66 **** /** ! * Determine the skill points per experience level for fighters. ! * Fighters get 2 skill points per experience level. * * @return 2 skill points. --- 71,76 ---- /** ! * Determine the skill points per experience level for this cclass. ! * Fighters gain 2 skill points for each experience level. * * @return 2 skill points. *************** *** 71,88 **** /** ! * Determine the value of base attack bonus for fighters. * * @return Value of base attack bonus. */ ! public int getBaseAttackValue () { return (Experience.getStrongAttack (getLevel ())); } /** ! * Determine the value of base Fortitude save bonus for fighters. * * @return Value of base Fortitude save bonus. */ ! public int getBaseFortSaveValue () { return (Saves.getStrongBonus (getLevel ())); } --- 81,101 ---- /** ! * Determine the value of base attack bonus for this cclass. Fighters ! * use the strong advancment rate for base attack bonuses. * * @return Value of base attack bonus. */ ! protected int getBaseAttackValue () { return (Experience.getStrongAttack (getLevel ())); } /** ! * Determine the value of base Fortitude save bonus for this cclass. ! * Fighters use the strong advancement rate for base Fortitude save ! * bonuses. * * @return Value of base Fortitude save bonus. */ ! protected int getBaseFortSaveValue () { return (Saves.getStrongBonus (getLevel ())); } Index: package.html =================================================================== RCS file: /cvsroot/ogs/dist/java/ogs/cclasses/package.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** package.html 7 Jan 2003 08:02:09 -0000 1.1 --- package.html 4 Apr 2003 20:22:48 -0000 1.2 *************** *** 6,11 **** <BODY> ! The <CODE>ogs.cclasses</CODE> package provides two universal ! character classes. </BODY> </HTML> --- 6,13 ---- <BODY> ! A collection of common character classes. Most of the character ! classes (cclasses) contained within this namespace are typically ! used in fantasy campaign settings. The Fighter cclass however can ! be used in just about any open game regardless of campaign setting. </BODY> </HTML> |
From: <ele...@us...> - 2003-04-04 20:23:21
|
Update of /cvsroot/ogs/dist/java In directory sc8-pr-cvs1:/tmp/cvs-serv9450/java Modified Files: ChangeLog Makefile.am configure.in Log Message: See ChangeLog files (Apr 3-4) for details. Index: ChangeLog =================================================================== RCS file: /cvsroot/ogs/dist/java/ChangeLog,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ChangeLog 6 Mar 2003 03:11:57 -0000 1.5 --- ChangeLog 4 Apr 2003 20:22:47 -0000 1.6 *************** *** 1,3 **** --- 1,35 ---- + Fri Apr 4 04:27:24 UTC 2003 Eric Lemings <ele...@us...> + + * configure.in: Increment version number to 0.1.1. + + * Makefile.am: Removed old packages/files. Added new + packages/files. + + * ogs/cclasses: Added new cclasses. Updated existing cclasses. + + * ogs/core/Abilities.java, ogs/core/Ability.java, + ogs/core/Strength.java, ogs/core/Feature.java, + ogs/core/Feat.java, ogs/feats/*.java: New interfaces and + implementations ported from C++. Removed ogs/core/abilities + package. + + * ogs/core/CClass.java: Changed value functions from public to + protected. + + * ogs/core/Creature.java, ogs/core/Skill.java, + ogs/magic/abilities/*.java, ogs/skills/*.java: Updates for + abilities. + + * ogs/core/details/Maturity.java: Added Maturity interface. + + * ogs/creatures/humanoids: Added new humanoid creatures. + + * ogs/magic/MetamagicFeat.java: Add getGroup() function. + + * ogs/magic/School.java: Doc updates. + + * ogs/magic/Spell.java: Removed static descriptors member. + Thu Mar 6 03:07:11 UTC 2003 Eric Lemings <ele...@us...> Index: Makefile.am =================================================================== RCS file: /cvsroot/ogs/dist/java/Makefile.am,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Makefile.am 6 Mar 2003 03:11:59 -0000 1.5 --- Makefile.am 4 Apr 2003 20:22:47 -0000 1.6 *************** *** 33,39 **** ogs/combat/package.html \ ogs/core/package.html \ - ogs/core/abilities/package.html \ ogs/core/details/package.html \ ogs/creatures/package.html \ ogs/feats/package.html \ ogs/items/package.html \ --- 33,39 ---- ogs/combat/package.html \ ogs/core/package.html \ ogs/core/details/package.html \ ogs/creatures/package.html \ + ogs/creatures/humanoids/package.html \ ogs/feats/package.html \ ogs/items/package.html \ *************** *** 44,47 **** --- 44,48 ---- ogs/skills/package.html \ ogs/spells/package.html \ + ogs/spells/conjurations/package.html \ ogs/support/package.html *************** *** 73,77 **** ogs.combat \ ogs.core \ - ogs.core.abilities \ ogs.core.details \ ogs.creatures \ --- 74,77 ---- *************** *** 90,93 **** --- 90,94 ---- ogs/core/Abilities.java \ ogs/core/Ability.java \ + ogs/core/BodyPart.java \ ogs/core/CClass.java \ ogs/core/Character.java \ *************** *** 106,118 **** ogs/core/Size.java \ ogs/core/Skill.java \ ! ogs/core/abilities/Charisma.java \ ! ogs/core/abilities/Constitution.java \ ! ogs/core/abilities/Dexterity.java \ ! ogs/core/abilities/Intelligence.java \ ! ogs/core/abilities/Strength.java \ ! ogs/core/abilities/Wisdom.java \ ogs/core/details/Alignment.java \ ogs/core/details/Description.java \ ogs/core/details/Gender.java \ ogs/core/details/Quantity.java \ ogs/magic/Ability.java \ --- 107,115 ---- ogs/core/Size.java \ ogs/core/Skill.java \ ! ogs/core/Strength.java \ ogs/core/details/Alignment.java \ ogs/core/details/Description.java \ ogs/core/details/Gender.java \ + ogs/core/details/Maturity.java \ ogs/core/details/Quantity.java \ ogs/magic/Ability.java \ *************** *** 142,161 **** ogs/magic/feats/SilentSpell.java \ ogs/magic/feats/StillSpell.java \ ! ogs/cclasses/Commoner.java \ ogs/cclasses/Fighter.java \ ! ogs/creatures/Human.java \ ogs/creatures/Humanoid.java \ ogs/feats/ArmorProficiency.java \ - ogs/feats/ExoticWeapon.java \ - ogs/feats/GreatFortitude.java \ - ogs/feats/HeavyArmor.java \ ogs/feats/ImprovedInitiative.java \ ! ogs/feats/IronWill.java \ ! ogs/feats/LightArmor.java \ ! ogs/feats/LightningReflexes.java \ ! ogs/feats/MartialWeapon.java \ ! ogs/feats/MediumArmor.java \ ogs/feats/ShieldProficiency.java \ ! ogs/feats/SimpleWeapon.java \ ogs/feats/Toughness.java \ ogs/feats/WeaponProficiency.java \ --- 139,168 ---- ogs/magic/feats/SilentSpell.java \ ogs/magic/feats/StillSpell.java \ ! ogs/cclasses/Barbarian.java \ ! ogs/cclasses/Bard.java \ ! ogs/cclasses/Cleric.java \ ! ogs/cclasses/Druid.java \ ogs/cclasses/Fighter.java \ ! ogs/cclasses/Monk.java \ ! ogs/cclasses/Paladin.java \ ! ogs/cclasses/Ranger.java \ ! ogs/cclasses/Rogue.java \ ! ogs/cclasses/Sorcerer.java \ ! ogs/cclasses/Wizard.java \ ogs/creatures/Humanoid.java \ + ogs/creatures/Undead.java \ + ogs/creatures/humanoids/Dwarf.java \ + ogs/creatures/humanoids/Elf.java \ + ogs/creatures/humanoids/Gnome.java \ + ogs/creatures/humanoids/HalfElf.java \ + ogs/creatures/humanoids/HalfOrc.java \ + ogs/creatures/humanoids/Halfling.java \ + ogs/creatures/humanoids/Human.java \ + ogs/feats/Alertness.java \ ogs/feats/ArmorProficiency.java \ ogs/feats/ImprovedInitiative.java \ ! ogs/feats/ImprovedSave.java \ ogs/feats/ShieldProficiency.java \ ! ogs/feats/SingleWeapon.java \ ogs/feats/Toughness.java \ ogs/feats/WeaponProficiency.java \ *************** *** 168,171 **** --- 175,179 ---- ogs/spells/Abjuration.java \ ogs/spells/Conjuration.java \ + ogs/spells/conjurations/CureWounds.java \ ogs/spells/Divination.java \ ogs/spells/Enchantment.java \ Index: configure.in =================================================================== RCS file: /cvsroot/ogs/dist/java/configure.in,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** configure.in 6 Mar 2003 03:11:59 -0000 1.3 --- configure.in 4 Apr 2003 20:22:47 -0000 1.4 *************** *** 29,33 **** OGS_MAJOR_VERSION=0 OGS_MINOR_VERSION=1 ! OGS_PATCH_VERSION=0 OGS_VERSION=$OGS_MAJOR_VERSION.$OGS_MINOR_VERSION.$OGS_PATCH_VERSION --- 29,33 ---- OGS_MAJOR_VERSION=0 OGS_MINOR_VERSION=1 ! OGS_PATCH_VERSION=1 OGS_VERSION=$OGS_MAJOR_VERSION.$OGS_MINOR_VERSION.$OGS_PATCH_VERSION |
From: <ele...@us...> - 2003-04-04 20:23:21
|
Update of /cvsroot/ogs/dist/c++/ogs/creatures/humanoids In directory sc8-pr-cvs1:/tmp/cvs-serv9450/c++/ogs/creatures/humanoids Modified Files: Dwarf.h Elf.h Gnome.h HalfElf.h HalfOrc.h Halfling.h Log Message: See ChangeLog files (Apr 3-4) for details. Index: Dwarf.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/creatures/humanoids/Dwarf.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Dwarf.h 23 Mar 2003 22:14:36 -0000 1.1 --- Dwarf.h 4 Apr 2003 20:22:45 -0000 1.2 *************** *** 67,71 **** unsigned getAdultAge () const; - const Die& getStartingAge () const; unsigned getMiddleAge () const; unsigned getOldAge () const; --- 67,70 ---- *************** *** 74,80 **** private: - static Die _startingAge; static Die _maximumAge; - }; --- 73,77 ---- *************** *** 87,100 **** inline unsigned Dwarf::getAdultAge () const { return (40); - } - - /** - * Access the die used to roll a random starting age for a PC. The die - * used to roll starting ages for dwarves is 3d6. - * - * @return 3d6 - */ - inline const Die& Dwarf::getStartingAge () const { - return (_startingAge); } --- 84,87 ---- Index: Elf.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/creatures/humanoids/Elf.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Elf.h 23 Mar 2003 22:14:36 -0000 1.1 --- Elf.h 4 Apr 2003 20:22:45 -0000 1.2 *************** *** 66,70 **** unsigned getAdultAge () const; - const Die& getStartingAge () const; unsigned getMiddleAge () const; unsigned getOldAge () const; --- 66,69 ---- *************** *** 73,79 **** private: - static Die _startingAge; static Die _maximumAge; - }; --- 72,76 ---- *************** *** 86,99 **** inline unsigned Elf::getAdultAge () const { return (110); - } - - /** - * Access the die used to roll a random starting age for a PC. The die - * used to roll starting ages for elves is 4d6. - * - * @return 4d6 - */ - inline const Die& Elf::getStartingAge () const { - return (_startingAge); } --- 83,86 ---- Index: Gnome.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/creatures/humanoids/Gnome.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Gnome.h 23 Mar 2003 22:14:36 -0000 1.1 --- Gnome.h 4 Apr 2003 20:22:45 -0000 1.2 *************** *** 43,47 **** unsigned getAdultAge () const; - const Die& getStartingAge () const; unsigned getMiddleAge () const; unsigned getOldAge () const; --- 43,46 ---- *************** *** 49,58 **** const Die& getMaximumAge () const; - protected: - private: - static Die _startingAge; static Die _maximumAge; - }; --- 48,53 ---- *************** *** 65,78 **** inline unsigned Gnome::getAdultAge () const { return (40); - } - - /** - * Access the die used to roll a random starting age for a PC. The die - * used to roll starting ages for gnomes is 4d6. - * - * @return 4d6 - */ - inline const Die& Gnome::getStartingAge () const { - return (_startingAge); } --- 60,63 ---- Index: HalfElf.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/creatures/humanoids/HalfElf.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** HalfElf.h 23 Mar 2003 22:14:36 -0000 1.1 --- HalfElf.h 4 Apr 2003 20:22:45 -0000 1.2 *************** *** 42,46 **** unsigned getAdultAge () const; - const Die& getStartingAge () const; unsigned getMiddleAge () const; unsigned getOldAge () const; --- 42,45 ---- *************** *** 48,57 **** const Die& getMaximumAge () const; - protected: - private: - static Die _startingAge; static Die _maximumAge; - }; --- 47,52 ---- *************** *** 64,77 **** inline unsigned HalfElf::getAdultAge () const { return (20); - } - - /** - * Access the die used to roll a random starting age for a PC. The die - * used to roll starting ages for half-elves is 1d6. - * - * @return 1d6 - */ - inline const Die& HalfElf::getStartingAge () const { - return (_startingAge); } --- 59,62 ---- Index: HalfOrc.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/creatures/humanoids/HalfOrc.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** HalfOrc.h 23 Mar 2003 22:14:36 -0000 1.1 --- HalfOrc.h 4 Apr 2003 20:22:45 -0000 1.2 *************** *** 33,37 **** /** ! * A progeny of a human and an orc. * * Half-orcs typically exist in fantasy campaign settings. --- 33,37 ---- /** ! * A progeny of a human and an orc. TODO: Finish this description. * * Half-orcs typically exist in fantasy campaign settings. *************** *** 42,46 **** unsigned getAdultAge () const; - const Die& getStartingAge () const; unsigned getMiddleAge () const; unsigned getOldAge () const; --- 42,45 ---- *************** *** 48,57 **** const Die& getMaximumAge () const; - protected: - private: - static Die _startingAge; static Die _maximumAge; - }; --- 47,52 ---- *************** *** 64,77 **** inline unsigned HalfOrc::getAdultAge () const { return (14); - } - - /** - * Access the die used to roll a random starting age for a PC. The die - * used to roll starting ages for half-orcs is 1d4. - * - * @return 1d4 - */ - inline const Die& HalfOrc::getStartingAge () const { - return (_startingAge); } --- 59,62 ---- Index: Halfling.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/creatures/humanoids/Halfling.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Halfling.h 23 Mar 2003 22:14:36 -0000 1.1 --- Halfling.h 4 Apr 2003 20:22:45 -0000 1.2 *************** *** 42,46 **** unsigned getAdultAge () const; - const Die& getStartingAge () const; unsigned getMiddleAge () const; unsigned getOldAge () const; --- 42,45 ---- *************** *** 49,55 **** private: - static Die _startingAge; static Die _maximumAge; - }; --- 48,52 ---- *************** *** 62,75 **** inline unsigned Halfling::getAdultAge () const { return (20); - } - - /** - * Access the die used to roll a random starting age for a PC. The die - * used to roll starting ages for halflings is 2d4. - * - * @return 2d4 - */ - inline const Die& Halfling::getStartingAge () const { - return (_startingAge); } --- 59,62 ---- |
From: <ele...@us...> - 2003-04-04 20:23:21
|
Update of /cvsroot/ogs/dist/c++/test In directory sc8-pr-cvs1:/tmp/cvs-serv9450/c++/test Modified Files: CoreTest03.cpp Log Message: See ChangeLog files (Apr 3-4) for details. Index: CoreTest03.cpp =================================================================== RCS file: /cvsroot/ogs/dist/c++/test/CoreTest03.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CoreTest03.cpp 5 Feb 2003 06:01:31 -0000 1.1 --- CoreTest03.cpp 4 Apr 2003 20:22:47 -0000 1.2 *************** *** 28,32 **** #include <ogs/Support.h> ! #include <ogs/core/Ability.h> #include <ogs/core/Modifier.h> --- 28,32 ---- #include <ogs/Support.h> ! #include <ogs/core/Abilities.h> #include <ogs/core/Modifier.h> *************** *** 46,75 **** class Dexterity: public Ability { public: ! Dexterity (Ability::Method method = Ability::standardMethod); ! }; ! ! Dexterity::Dexterity (Ability::Method method): Ability (method) { } ! ! void print (Dexterity& dex) { ! std::cout << "dex.getOriginalScore () = " << ! dex.getOriginalScore () << std::endl; ! std::cout << "dex.getCurrentScore () = " << ! dex.getCurrentScore () << std::endl; ! Modifier& mod = dex.getModifier (); ! std::cout << "mod.getValue () = " << ! mod.getValue () << std::endl; ! std::cout << std::endl; ! } ! void test (void) { ! std::cout << "Defining dex2 with average method..." << std::endl; ! Dexterity dex2 (Ability::averageMethod);; ! print (dex2); ! std::cout << "Defining dex3 with high-powered method..." << std::endl; ! Dexterity dex3 (Ability::highPoweredMethod);; ! print (dex3); ! } int main (void) --- 46,65 ---- class Dexterity: public Ability { public: ! Dexterity (): Ability (Ability::DEX) { ! // empty constructor body ! } ! Dexterity (Ability::Method& method): ! Ability (Ability::DEX, method) { ! // empty constructor body ! } ! }; ! void print (Dexterity& dex); ! void test (void); ! Ability::StandardMethod standardMethod; ! Ability::AverageMethod averageMethod; ! Ability::HighPoweredMethod highPoweredMethod; int main (void) *************** *** 77,84 **** std::srand (std::time (NULL)); std::cout << "Ability modifiers are in parentheses" << std::endl; std::cout << "Printing 6 sample rolls of rollStandard ()" << std::endl; for (int i = 0; i < 6; ++i) { ! Ability::Score score = Ability::rollStandard (); std::cout << score << " (" << std::showpos << Ability::getModifier (score) << "), "; --- 67,75 ---- std::srand (std::time (NULL)); + /* Print a some scores generated by predefined methods. */ std::cout << "Ability modifiers are in parentheses" << std::endl; std::cout << "Printing 6 sample rolls of rollStandard ()" << std::endl; for (int i = 0; i < 6; ++i) { ! Ability::Score score = standardMethod (Ability::DEX); std::cout << score << " (" << std::showpos << Ability::getModifier (score) << "), "; *************** *** 88,92 **** std::cout << "Printing 6 sample rolls of rollAverage ()" << std::endl; for (int i = 0; i < 6; ++i) { ! Ability::Score score = Ability::rollAverage (); std::cout << score << " (" << std::showpos << Ability::getModifier (score) << "), "; --- 79,83 ---- std::cout << "Printing 6 sample rolls of rollAverage ()" << std::endl; for (int i = 0; i < 6; ++i) { ! Ability::Score score = averageMethod (Ability::DEX); std::cout << score << " (" << std::showpos << Ability::getModifier (score) << "), "; *************** *** 96,100 **** std::cout << "Printing 6 sample rolls of rollHighPowered()" << std::endl; for (int i = 0; i < 6; ++i) { ! Ability::Score score = Ability::rollHighPowered (); std::cout << score << " (" << std::showpos << Ability::getModifier (score) << "), "; --- 87,91 ---- std::cout << "Printing 6 sample rolls of rollHighPowered()" << std::endl; for (int i = 0; i < 6; ++i) { ! Ability::Score score = highPoweredMethod (Ability::DEX); std::cout << score << " (" << std::showpos << Ability::getModifier (score) << "), "; *************** *** 112,116 **** std::cout << "Adding +1 modifier to dex1..." << std::endl; Modifier mod1 (+1); ! dex1.addModifier (mod1); print (dex1); --- 103,107 ---- std::cout << "Adding +1 modifier to dex1..." << std::endl; Modifier mod1 (+1); ! (dex1.getModifiers ()).addModifier (mod1); print (dex1); *************** *** 121,129 **** std::cout << "Adding +3 modifier to dex1..." << std::endl; Modifier mod2 (+3); ! dex1.addModifier (mod2); ! print (dex1); ! ! std::cout << "Changing original score of dex1 to 20..." << std::endl; ! dex1.setOriginalScore (20); print (dex1); --- 112,116 ---- std::cout << "Adding +3 modifier to dex1..." << std::endl; Modifier mod2 (+3); ! (dex1.getModifiers ()).addModifier (mod2); print (dex1); *************** *** 133,136 **** --- 120,145 ---- return (0); + } + + void print (Dexterity& dex) { + std::cout << "dex.getOriginalScore () = " << + dex.getOriginalScore () << std::endl; + std::cout << "dex.getCurrentScore () = " << + dex.getCurrentScore () << std::endl; + Modifier& mod = dex.getModifier (); + std::cout << "mod.getValue () = " << + mod.getValue () << std::endl; + + std::cout << std::endl; + } + + void test (void) { + std::cout << "Defining dex2 with average method..." << std::endl; + Dexterity dex2 (averageMethod); + print (dex2); + + std::cout << "Defining dex3 with high-powered method..." << std::endl; + Dexterity dex3 (highPoweredMethod);; + print (dex3); } |
From: <ele...@us...> - 2003-04-04 20:23:20
|
Update of /cvsroot/ogs/dist/c++/ogs/feats In directory sc8-pr-cvs1:/tmp/cvs-serv9450/c++/ogs/feats Modified Files: AllWeapons.cpp AllWeapons.h ArmorProficiency.cpp ImprovedSave.cpp Removed Files: SimpleWeapon.h Log Message: See ChangeLog files (Apr 3-4) for details. Index: AllWeapons.cpp =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/feats/AllWeapons.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AllWeapons.cpp 29 Mar 2003 02:10:36 -0000 1.1 --- AllWeapons.cpp 4 Apr 2003 20:22:45 -0000 1.2 *************** *** 30,51 **** /** - * 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. --- 30,33 ---- Index: AllWeapons.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/feats/AllWeapons.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AllWeapons.h 29 Mar 2003 02:10:36 -0000 1.1 --- AllWeapons.h 4 Apr 2003 20:22:46 -0000 1.2 *************** *** 28,31 **** --- 28,32 ---- # include <ogs/feats/Namespace.h> # include <ogs/feats/WeaponProficiency.h> + # include <ogs/items/Weapon.h> OGS_BEGIN_FEATS_NAMESPACE *************** *** 58,61 **** --- 59,82 ---- bool canAttach (const Object& object) const; }; + + /** + * Create a new Simple Weapons Proficiency feat. + * + * @return A new Simple Weapons Proficiency feat. + */ + inline AllWeapons* + AllWeapons::createSimple () { + return (new AllWeapons (ogs::items::Weapon::SIMPLE)); + } + + /** + * Create a new Martial Weapons Proficiency feat. + * + * @return A new Martial Weapons Proficiency feat. + */ + inline AllWeapons* + AllWeapons::createMartial () { + return (new AllWeapons (ogs::items::Weapon::MARTIAL)); + } /** Index: ArmorProficiency.cpp =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/feats/ArmorProficiency.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ArmorProficiency.cpp 29 Mar 2003 02:10:36 -0000 1.5 --- ArmorProficiency.cpp 4 Apr 2003 20:22:46 -0000 1.6 *************** *** 88,104 **** const Creature& creature = dynamic_cast<const Creature&> (object); if (this->_proficiency == Armor::LIGHT) { ! if (! findArmorProficiency (creature, Armor::LIGHT)) { ! success = true; ! } } else if (this->_proficiency == Armor::MEDIUM) { ! if (findArmorProficiency (creature, Armor::LIGHT) && ! !findArmorProficiency (creature, Armor::MEDIUM)) { ! success = true; ! } } else if (this->_proficiency == Armor::HEAVY) { ! if (findArmorProficiency (creature, Armor::MEDIUM) && ! !findArmorProficiency (creature, Armor::HEAVY)) { ! success = true; ! } } --- 88,98 ---- const Creature& creature = dynamic_cast<const Creature&> (object); if (this->_proficiency == Armor::LIGHT) { ! success = ! findArmorProficiency (creature, Armor::LIGHT); } else if (this->_proficiency == Armor::MEDIUM) { ! success = findArmorProficiency (creature, Armor::LIGHT) && ! !findArmorProficiency (creature, Armor::MEDIUM); } else if (this->_proficiency == Armor::HEAVY) { ! success = findArmorProficiency (creature, Armor::MEDIUM) && ! !findArmorProficiency (creature, Armor::HEAVY); } *************** *** 110,114 **** * * @param creature Creature to be checked for proficiency. ! * @param proficiency Proficiency of armor proficiency. * @return True if creature has armor proficiency. */ --- 104,108 ---- * * @param creature Creature to be checked for proficiency. ! * @param proficiency Proficiency of armor. * @return True if creature has armor proficiency. */ *************** *** 120,132 **** bool found = false; ! while (itor != feats.end ()) { using ogs::core::Feat; Feat* feat = *itor++; ArmorProficiency* armorProficiency = dynamic_cast <ArmorProficiency*> (feat); if (armorProficiency != NULL) { ! if (armorProficiency->getProficiency () == proficiency) { ! found = true; ! } } } --- 114,125 ---- bool found = false; ! while (!found && itor != feats.end ()) { using ogs::core::Feat; Feat* feat = *itor++; ArmorProficiency* armorProficiency = dynamic_cast <ArmorProficiency*> (feat); + if (armorProficiency != NULL) { ! found = armorProficiency->getProficiency () == proficiency; } } *************** *** 144,162 **** */ bool ArmorProficiency::isProficient (const Armor& armor) const { ! bool proficient = false; ! ! if (getObject () != NULL) { ! Armor::Proficiency proficiency = armor.getProficiency (); ! if (this->_proficiency == Armor::HEAVY) { ! proficient = true; ! } else if (this->_proficiency == Armor::MEDIUM && ! proficiency != Armor::HEAVY) { ! proficient = true; ! } else if (proficiency == Armor::LIGHT) { ! proficient = true; ! } ! } ! ! return (proficient); } --- 137,146 ---- */ bool ArmorProficiency::isProficient (const Armor& armor) const { ! Armor::Proficiency proficiency = armor.getProficiency (); ! return (getObject () != NULL && ! this->_proficiency == Armor::HEAVY || ! (this->_proficiency == Armor::MEDIUM && ! proficiency != Armor::HEAVY) || ! proficiency == Armor::LIGHT); } Index: ImprovedSave.cpp =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/feats/ImprovedSave.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ImprovedSave.cpp 29 Mar 2003 02:10:37 -0000 1.2 --- ImprovedSave.cpp 4 Apr 2003 20:22:46 -0000 1.3 *************** *** 127,134 **** bool ImprovedSave::detachObject () { Creature* creature = dynamic_cast<Creature*> (getObject ()); - assert (creature != NULL); - bool detached = detachObject (); ! if (detached) { Saves& saves = creature->getSaves (); if (this->_type == GREAT_FORTITUDE) { --- 127,133 ---- bool ImprovedSave::detachObject () { Creature* creature = dynamic_cast<Creature*> (getObject ()); bool detached = detachObject (); ! ! if (creature != NULL && detached) { Saves& saves = creature->getSaves (); if (this->_type == GREAT_FORTITUDE) { --- SimpleWeapon.h DELETED --- |
From: <ele...@us...> - 2003-04-04 20:23:20
|
Update of /cvsroot/ogs/dist/c++/ogs/magic In directory sc8-pr-cvs1:/tmp/cvs-serv9450/c++/ogs/magic Modified Files: Spell.cpp Spell.h Log Message: See ChangeLog files (Apr 3-4) for details. Index: Spell.cpp =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/magic/Spell.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Spell.cpp 25 Mar 2003 06:13:13 -0000 1.3 --- Spell.cpp 4 Apr 2003 20:22:46 -0000 1.4 *************** *** 21,30 **** */ #include "ogs/magic/Spell.h" ! using ogs::magic::Descriptors; using ogs::magic::Spell; - - Descriptors Spell::_descriptors; /** --- 21,29 ---- */ + #include "ogs/magic/MetamagicFeat.h" #include "ogs/magic/Spell.h" ! using ogs::magic::MetamagicFeat; using ogs::magic::Spell; /** Index: Spell.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/magic/Spell.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Spell.h 29 Mar 2003 02:10:39 -0000 1.4 --- Spell.h 4 Apr 2003 20:22:47 -0000 1.5 *************** *** 32,36 **** # include <ogs/magic/Component.h> # include <ogs/magic/Descriptors.h> - # include <ogs/magic/MetamagicFeat.h> # include <ogs/magic/Namespace.h> # include <ogs/magic/Range.h> --- 32,35 ---- *************** *** 39,42 **** --- 38,43 ---- OGS_BEGIN_MAGIC_NAMESPACE + class MetamagicFeat; + /** * A magical effect produced by a caster. *************** *** 82,88 **** private: - static Descriptors _descriptors; - - /** An array of metamagic feats. */ typedef std::vector<MetamagicFeat*> MetamagicFeats; MetamagicFeats _metamagicFeats; --- 83,86 ---- *************** *** 98,102 **** */ inline Descriptors Spell::getDescriptors () const { ! return (_descriptors); } --- 96,101 ---- */ inline Descriptors Spell::getDescriptors () const { ! Descriptors descriptors; ! return (descriptors); } |
Update of /cvsroot/ogs/dist/c++/ogs/core In directory sc8-pr-cvs1:/tmp/cvs-serv9450/c++/ogs/core Modified Files: Abilities.cpp Abilities.h Ability.cpp Ability.h CClass.cpp Feat.cpp Feat.h Feature.h Strength.h Log Message: See ChangeLog files (Apr 3-4) for details. Index: Abilities.cpp =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/core/Abilities.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Abilities.cpp 29 Mar 2003 02:10:28 -0000 1.3 --- Abilities.cpp 4 Apr 2003 20:22:43 -0000 1.4 *************** *** 30,46 **** /** ! * 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); } --- 30,59 ---- /** ! * Create a complete set of abilities. The ability scores are generated ! * with the standard method. ! */ ! Abilities::Abilities () { ! Map& map = *this; ! map [Ability::CHA] = new Ability (Ability::CHA); ! map [Ability::CON] = new Ability (Ability::CON); ! map [Ability::DEX] = new Ability (Ability::DEX); ! map [Ability::INT] = new Ability (Ability::INT); ! map [Ability::STR] = new Strength (); ! map [Ability::WIS] = new Ability (Ability::WIS); ! } ! ! /** ! * Create a complete set of abilities using a method. * ! * @param method A method for generating ability scores. */ Abilities::Abilities (Ability::Method& method) { Map& map = *this; ! map [Ability::CHA] = new Ability (Ability::CHA, method); ! map [Ability::CON] = new Ability (Ability::CON, method); ! map [Ability::DEX] = new Ability (Ability::DEX, method); ! map [Ability::INT] = new Ability (Ability::INT, method); map [Ability::STR] = new Strength (method); ! map [Ability::WIS] = new Ability (Ability::WIS, method); } Index: Abilities.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/core/Abilities.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Abilities.h 29 Mar 2003 02:10:28 -0000 1.2 --- Abilities.h 4 Apr 2003 20:22:43 -0000 1.3 *************** *** 44,48 **** typedef std::map<Ability::Type, Ability*>::iterator Iterator; ! Abilities (Ability::Method& method = Ability::standardMethod); ~Abilities (); --- 44,49 ---- typedef std::map<Ability::Type, Ability*>::iterator Iterator; ! Abilities (); ! Abilities (Ability::Method& method); ~Abilities (); Index: Ability.cpp =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/core/Ability.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Ability.cpp 29 Mar 2003 02:10:28 -0000 1.4 --- Ability.cpp 4 Apr 2003 20:22:43 -0000 1.5 *************** *** 21,25 **** */ ! #include <algorithm> #include "ogs/Support.h" --- 21,26 ---- */ ! #include <sstream> // ostringstream ! #include <stdexcept> // invalid_argument #include "ogs/Support.h" *************** *** 33,38 **** using ogs::core::Modifier; - Ability::StandardMethod Ability::standardMethod; - /** * Produce an ability score using the standard method. With --- 34,37 ---- *************** *** 109,115 **** /** * Create a new ability. The ability score is rolled using the standard ! * method. The ability has no modifiers. This constructor is ! * protected: it is called only by constructors of classes derived from ! * the <code>Ability</code> class. */ Ability::Ability (Type type, Method& method): --- 108,136 ---- /** * Create a new ability. The ability score is rolled using the standard ! * method. The ability score has no modifiers. ! * ! * @param type A type of ability. ! * @throws std::invalid_argument If type is not a valid ability type. ! */ ! Ability::Ability (Type type): ! _type (type), ! _originalScore (rollStandard ()), ! _currentScore (_originalScore), ! _modifier (getModifier (_originalScore)) { ! if (! isValidType (type)) { ! std::ostringstream ostr; ! ostr << "ability type (" << (int) type; ! ostr << ") is not a valid type of ability"; ! throw std::invalid_argument (ostr.str ()); ! } ! } ! ! /** ! * Create a new ability using a method. The ability score has no ! * modifiers. ! * ! * @param type A type of ability. ! * @param method A method for generating ability scores. ! * @throws std::invalid_argument If type is not a valid ability type. */ Ability::Ability (Type type, Method& method): *************** *** 118,122 **** _currentScore (_originalScore), _modifier (getModifier (_originalScore)) { ! // empty constructor body } --- 139,148 ---- _currentScore (_originalScore), _modifier (getModifier (_originalScore)) { ! if (! isValidType (type)) { ! std::ostringstream ostr; ! ostr << "ability type (" << (int) type; ! ostr << ") is not a valid type of ability"; ! throw std::invalid_argument (ostr.str ()); ! } } Index: Ability.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/core/Ability.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Ability.h 29 Mar 2003 02:10:28 -0000 1.3 --- Ability.h 4 Apr 2003 20:22:43 -0000 1.4 *************** *** 45,50 **** * 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, --- 45,51 ---- * 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: zero or more <I>score modifiers</I> that ! * are added to the original score and one <I>ability modifier</I> ! * resulting from the current score. <P> */ class Ability: public ogs::support::Object, *************** *** 59,65 **** 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 --- 60,64 ---- enum Type { /** ! * An ability that determines physical power and force. * * @see Strength *************** *** 68,74 **** /** ! * An ability that determines agility and quickness. The ! * Dexterity modifier is added to all Reflex saving throws. * * @see Saves::ref */ --- 67,75 ---- /** ! * An ability that determines agility and quickness. A Dexterity ! * modifier is added to ranged attacks with thrown weapons and ! * projectile weapons, defense ratings, and Reflex saving throws. * + * @see Defense * @see Saves::ref */ *************** *** 76,81 **** /** ! * An ability that determines fitness and vigor. The Constiution ! * modifier is added to all Fortitude saving throws. * * @see Saves::fort --- 77,82 ---- /** ! * An ability that determines fitness and vigor. A Constiution ! * modifier is added to hit die rolls and Fortitude saving throws. * * @see Saves::fort *************** *** 110,114 **** */ struct Method { ! virtual Score operator() (Ability::Type) = 0; virtual ~Method () { } }; --- 111,115 ---- */ struct Method { ! virtual Score operator() (Type type) = 0; virtual ~Method () { } }; *************** *** 121,125 **** */ struct StandardMethod: public Method { ! Score operator() (Ability::Type) { return (rollStandard ()); } --- 122,132 ---- */ struct StandardMethod: public Method { ! /** ! * Generate a score using the standard method. The type parameter ! * is not used. ! * ! * @return An ability score. ! */ ! Score operator() (Type) { return (rollStandard ()); } *************** *** 133,137 **** */ struct AverageMethod: public Method { ! Score operator() (Ability::Type) { return (rollAverage ()); } --- 140,150 ---- */ struct AverageMethod: public Method { ! /** ! * Generate a score using the average method. The type parameter ! * is not used. ! * ! * @return An ability score. ! */ ! Score operator() (Type) { return (rollAverage ()); } *************** *** 145,163 **** */ 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; --- 158,179 ---- */ struct HighPoweredMethod: public Method { ! /** ! * Generate a score using the high-powered method. The type ! * parameter is not used. ! * ! * @return An ability score. ! */ ! Score operator() (Type) { return (rollHighPowered ()); } }; + static bool isValidType (int i); static Modifier::Value getModifier (Score score); static unsigned getIncreaseCount (Experience::Level xpLevel); static Experience::Level getIncreaseCountLevel (unsigned count); ! Ability (Type type); ! Ability (Type type, Method& method); Type getType () const; *************** *** 169,175 **** void handleEvent (ogs::support::Event& event); - protected: - Ability (Type type, Method& method = standardMethod); - private: Type _type; --- 185,188 ---- *************** *** 185,188 **** --- 198,213 ---- /** + * Determine if an integer value is a valid ability type. + * + * @param i An integer value. + * @return True if integer value is a valid ability type. + */ + inline bool + Ability::isValidType (int i) { + return (i == STR || i == DEX || i == CON || + i == INT || i == WIS || i == CHA); + } + + /** * Produce an ability score using the average method. With * the average method, three d6 die are rolled and added together. *************** *** 220,283 **** Ability::getIncreaseCount (Experience::Level xpLevel) { return (xpLevel == 0? 0: xpLevel / 4); - } - - /** - * 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)); } --- 245,248 ---- Index: CClass.cpp =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/core/CClass.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CClass.cpp 23 Mar 2003 22:14:36 -0000 1.3 --- CClass.cpp 4 Apr 2003 20:22:44 -0000 1.4 *************** *** 103,107 **** * Detach this cclass from a character. * ! * @param True if this cclass is detached from character. */ bool CClass::detachObject () { --- 103,107 ---- * Detach this cclass from a character. * ! * @return True if this cclass is detached from character. */ bool CClass::detachObject () { Index: Feat.cpp =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/core/Feat.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Feat.cpp 29 Mar 2003 02:10:29 -0000 1.4 --- Feat.cpp 4 Apr 2003 20:22:44 -0000 1.5 *************** *** 59,86 **** } - /** - * 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 (const Object& object) const { - bool found = false; - const Creature* creature = dynamic_cast<const 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; - } - } - } - - return (found); - } - --- 59,60 ---- Index: Feat.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/core/Feat.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Feat.h 29 Mar 2003 02:10:29 -0000 1.7 --- Feat.h 4 Apr 2003 20:22:44 -0000 1.8 *************** *** 26,29 **** --- 26,30 ---- # define OGS_CORE_FEAT_H + # include <ogs/core/Creature.h> # include <ogs/core/Experience.h> # include <ogs/core/Feature.h> *************** *** 127,131 **** virtual bool canAttach (const Object& object) const; ! template <class FeatClass> bool findFeat (const Object& object) const; }; --- 128,137 ---- virtual bool canAttach (const Object& object) const; ! template <class T> ! struct IsInstance { ! bool operator() (Feat* feat); ! }; ! ! template <class T> bool findFeat (const Object& object) const; }; *************** *** 140,143 **** --- 146,182 ---- inline unsigned Feat::getSlotCount (Experience::Level xpLevel) { return (xpLevel < 2? xpLevel: xpLevel / 3 + 1); + } + + /** + * Determine if a feat is an instance of a specific feat. The + * specific feat is specified by the template parameter T. + * + * @param feat An instance of a feat. + * @return True if feat is an instance of the specific feat. + */ + template <class T> + bool Feat::IsInstance<T>::operator() (Feat* feat) { + return (dynamic_cast<T*> (feat) != NULL); + } + + /** + * Determine if a creature has a feat. This function only checks for an + * instance of the template parameter T. If the object is not a + * creature, this function will return false. + * + * @param object Object (Creature) to check. + * @return True if creature has an instance of T. + */ + template <class T> + bool Feat::findFeat (const Object& object) const { + const Creature* creature = dynamic_cast<const Creature*> (&object); + + if (creature != NULL) { + Creature::Feats feats = creature->getFeats (); + Creature::Feats::iterator end = feats.end (); + return (end != std::find_if (feats.begin (), end, IsInstance<T> ())); + } + + return (false); } Index: Feature.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/core/Feature.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Feature.h 29 Mar 2003 02:10:29 -0000 1.4 --- Feature.h 4 Apr 2003 20:22:44 -0000 1.5 *************** *** 58,61 **** --- 58,68 ---- /** + * Create a new feature. + */ + inline Feature::Feature (): _object (NULL) { + // empty constructor body + } + + /** * Determine the object that this feature is currently attached to. * *************** *** 90,96 **** /** ! * 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. */ --- 97,102 ---- /** ! * Determine if this feature can be detached from an object. * * @return True if the feature is detached from the object. */ *************** *** 99,107 **** return (true); } - - /** - * Create a new feature. - */ - inline Feature::Feature (): _object (NULL) { } inline Feature::~Feature () { } --- 105,108 ---- Index: Strength.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/core/Strength.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Strength.h 29 Mar 2003 02:10:31 -0000 1.1 --- Strength.h 4 Apr 2003 20:22:44 -0000 1.2 *************** *** 33,42 **** /** ! * 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; --- 33,42 ---- /** ! * An ability that determines physical power and force. A Strength * modifier is added to attack rolls with melee weapons and damage * rolls with melee weapons, thrown weapons, and specially designed * projectile weapons. Strength is a special ability that has * additional operations for determining carrying capacities. */ class Strength: public Ability { public: ! Strength (); ! Strength (Ability::Method& method); float getLightLoad (Size::Type sizeType = Size::MEDIUM) const; *************** *** 50,57 **** /** ! * 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 --- 50,65 ---- /** ! * Create a new Strength score. The Strength score is generated using ! * the standard method. ! */ ! inline ! Strength::Strength (): Ability (Ability::STR) { ! // empty constructor body ! } ! ! /** ! * Create a new Strength score using a method. * ! * @param method A method for generating ability scores. */ inline *************** *** 64,68 **** * Determine the limit of light loads for this ability. * ! * @param size Size of creature. * @return Weight in pounds. */ --- 72,76 ---- * Determine the limit of light loads for this ability. * ! * @param sizeType Size type of creature. * @return Weight in pounds. */ *************** *** 75,79 **** * Determine the limit of medium loads for this ability. * ! * @param size Size of creature. * @return Weight in pounds. */ --- 83,87 ---- * Determine the limit of medium loads for this ability. * ! * @param sizeType Size type of creature. * @return Weight in pounds. */ *************** *** 86,90 **** * Determine the limit of heavy loads for this ability. * ! * @param size Size of creature. * @return Weight in pounds. */ --- 94,98 ---- * Determine the limit of heavy loads for this ability. * ! * @param sizeType Size type of creature. * @return Weight in pounds. */ |
Update of /cvsroot/ogs/dist/c++/ogs/cclasses In directory sc8-pr-cvs1:/tmp/cvs-serv9450/c++/ogs/cclasses Modified Files: Barbarian.h Bard.h Cleric.h Druid.h Fighter.h Monk.h Paladin.h Ranger.h Rogue.h Sorcerer.h Wizard.h Log Message: See ChangeLog files (Apr 3-4) for details. Index: Barbarian.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/cclasses/Barbarian.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Barbarian.h 23 Mar 2003 22:14:36 -0000 1.1 --- Barbarian.h 4 Apr 2003 20:22:41 -0000 1.2 *************** *** 74,78 **** /** ! * Determine the hit die for barbarians. * * @return Die::d12. --- 74,89 ---- /** ! * Create a new Barbarian cclass. ! * ! * @param xpLevel Experience level of barbarian. ! */ ! inline Barbarian::Barbarian (Experience::Level xpLevel): ! CClass (xpLevel) { ! // empty constructor body ! } ! ! /** ! * Determine the hit die for this cclass. Barbarians use d12 for their ! * hit die. * * @return Die::d12. *************** *** 83,87 **** /** ! * Determine the skill points per experience level for barbarians. * * @return 4 skill points. --- 94,99 ---- /** ! * Determine the skill points per experience level for this cclass. ! * Barbarians gain 4 skill points for each experience level. * * @return 4 skill points. *************** *** 92,96 **** /** ! * Determine the value of base attack bonus for barbarians. * * @return Value of base attack bonus. --- 104,109 ---- /** ! * Determine the value of base attack bonus for this cclass. Barbarians ! * use the strong advancement rate for base attack bonuses. * * @return Value of base attack bonus. *************** *** 101,105 **** /** ! * Determine the value of base Fortitude save bonus for barbarians. * * @return Value of base Fortitude save bonus. --- 114,120 ---- /** ! * Determine the value of base Fortitude save bonus for this cclass. ! * Barbarians use the strong advancement rate for base Fortitude save ! * bonuases. * * @return Value of base Fortitude save bonus. Index: Bard.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/cclasses/Bard.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Bard.h 23 Mar 2003 22:14:36 -0000 1.1 --- Bard.h 4 Apr 2003 20:22:41 -0000 1.2 *************** *** 80,84 **** /** ! * Determine the hit die for bards. * * @return Die::d6. --- 80,95 ---- /** ! * Create a new Bard cclass. ! * ! * @param xpLevel Experience level of bard. ! */ ! inline Bard::Bard (Experience::Level xpLevel): ! CClass (xpLevel) { ! // empty constructor body ! } ! ! /** ! * Determine the hit die for this cclass. Bards use d6 for their hit ! * die. * * @return Die::d6. *************** *** 89,93 **** /** ! * Determine the skill points per experience level for bards. * * @return 4 skill points. --- 100,105 ---- /** ! * Determine the skill points per experience level for this cclass. ! * Bards gain 4 skill points for each experience level. * * @return 4 skill points. *************** *** 97,102 **** } /** ! * Determine the value of base Reflex save bonus for bards. * * @return Value of base Reflex save bonus. --- 109,116 ---- } + /** ! * Determine the value of base Reflex save bonus for this cclass. Bards ! * use the strong advancement rate for base Reflex save bonuses. * * @return Value of base Reflex save bonus. *************** *** 107,111 **** /** ! * Determine the value of base Will save bonus for bards. * * @return Value of base Will save bonus. --- 121,126 ---- /** ! * Determine the value of base Will save bonus for this cclass. Bards ! * use the strong advancement rate for base Will save bonuses. * * @return Value of base Will save bonus. *************** *** 113,116 **** --- 128,149 ---- inline Modifier::Value Bard::getBaseWillSaveValue () const { return (Saves::getStrongBonus (getLevel ())); + } + + /** + * Determine the number of spells that this bard can cast per day. + * + * @return Number of spells at each spell leve. + */ + inline Bard::SpellCounts Bard::getSpellsPerDay () const { + return (SpellCounts ()); // TODO: Implement. + } + + /** + * Determine the number of spells knonwn by this bard. + * + * @return Number of spells at each spell level. + */ + inline Bard::SpellCounts Bard::getSpellsKnown () const { + return (SpellCounts ()); // TODO: Implement. } Index: Cleric.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/cclasses/Cleric.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Cleric.h 23 Mar 2003 22:14:36 -0000 1.1 --- Cleric.h 4 Apr 2003 20:22:41 -0000 1.2 *************** *** 79,83 **** /** ! * Determine the hit die for clerics. * * @return Die::d8. --- 79,94 ---- /** ! * Create a new Cleric cclass. ! * ! * @param xpLevel Experience level of cleric. ! */ ! inline Cleric::Cleric (Experience::Level xpLevel): ! CClass (xpLevel) { ! // empty constructor body ! } ! ! /** ! * Determine the hit die for this cclass. Clerics use d8 for their hit ! * die. * * @return Die::d8. *************** *** 88,92 **** /** ! * Determine the skill points per experience level for clerics. * * @return 2 skill points. --- 99,104 ---- /** ! * Determine the skill points per experience level for this cclass. ! * Clerics gain 2 skill points for each experience level. * * @return 2 skill points. *************** *** 97,101 **** /** ! * Determine the value of base Fortitude save bonus for clerics. * * @return Value of base Fortitude save bonus. --- 109,114 ---- /** ! * Determine the value of base Fortitude save bonus for this cclass. ! * Clerics use the strong advancement rate for base Fortitude save * * @return Value of base Fortitude save bonus. *************** *** 106,110 **** /** ! * Determine the value of base Will save bonus for clerics. * * @return Value of base Will save bonus. --- 119,124 ---- /** ! * Determine the value of base Will save bonus for this cclass. Clerics ! * use the strong advancment rate for base Will save bonuses. * * @return Value of base Will save bonus. *************** *** 112,115 **** --- 126,138 ---- inline Modifier::Value Cleric::getBaseWillSaveValue () const { return (Saves::getStrongBonus (getLevel ())); + } + + /** + * Determine the number of spells that this cleric can cast per day. + * + * @return Number of spells at each spell leve. + */ + inline Cleric::SpellCounts Cleric::getSpellsPerDay () const { + return (SpellCounts ()); // TODO: Implement. } Index: Druid.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/cclasses/Druid.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Druid.h 23 Mar 2003 22:14:36 -0000 1.1 --- Druid.h 4 Apr 2003 20:22:41 -0000 1.2 *************** *** 47,51 **** * near large cities. They are most often found in remote and isolated * wilderness areas. Their intimate knowledge of the natural world is ! * their source of power. Like clerics, druids are also spell casters * of diving magic and Wisdom is their primary spell casting ability. * In addition to spells, druids gain many special features as they --- 47,51 ---- * near large cities. They are most often found in remote and isolated * wilderness areas. Their intimate knowledge of the natural world is ! * their source of power. Like druids, druids are also spell casters * of diving magic and Wisdom is their primary spell casting ability. * In addition to spells, druids gain many special features as they *************** *** 81,85 **** /** ! * Determine the hit die for druids. * * @return Die::d8. --- 81,96 ---- /** ! * Create a new Druid cclass. ! * ! * @param xpLevel Experience level of druid. ! */ ! inline Druid::Druid (Experience::Level xpLevel): ! CClass (xpLevel) { ! // empty constructor body ! } ! ! /** ! * Determine the hit die for this cclass. Druids use d8 for their hit ! * die. * * @return Die::d8. *************** *** 90,94 **** /** ! * Determine the skill points per experience level for druids. * * @return 4 skill points. --- 101,106 ---- /** ! * Determine the skill points per experience level for this cclass. ! * Druids gain 4 skill points for each experience level. * * @return 4 skill points. *************** *** 99,103 **** /** ! * Determine the value of base Fortitude save bonus for druids. * * @return Value of base Fortitude save bonus. --- 111,117 ---- /** ! * Determine the value of base Fortitude save bonus for this cclass. ! * Druids use the strong advancement rate for base Fortitude save ! * bonuses. * * @return Value of base Fortitude save bonus. *************** *** 108,112 **** /** ! * Determine the value of base Will save bonus for druids. * * @return Value of base Will save bonus. --- 122,127 ---- /** ! * Determine the value of base Will save bonus for this cclass. Druids ! * use the strong advancement rate for base Will save bonuses. * * @return Value of base Will save bonus. *************** *** 114,117 **** --- 129,141 ---- inline Modifier::Value Druid::getBaseWillSaveValue () const { return (Saves::getStrongBonus (getLevel ())); + } + + /** + * Determine the number of spells that this druid can cast per day. + * + * @return Number of spells at each spell leve. + */ + inline Druid::SpellCounts Druid::getSpellsPerDay () const { + return (SpellCounts ()); // TODO: Implement. } Index: Fighter.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/cclasses/Fighter.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Fighter.h 23 Mar 2003 22:14:36 -0000 1.6 --- Fighter.h 4 Apr 2003 20:22:41 -0000 1.7 *************** *** 27,30 **** --- 27,33 ---- # include <ogs/core/CClass.h> + # include <ogs/core/Die.h> + # include <ogs/core/Experience.h> + # include <ogs/core/Skill.h> # include <ogs/cclasses/Namespace.h> *************** *** 63,67 **** * Create a new Fighter cclass. * ! * @param xpLevel Experience level of fighter (default 1). */ inline Fighter::Fighter (ogs::core::Experience::Level xpLevel): --- 66,70 ---- * Create a new Fighter cclass. * ! * @param xpLevel Experience level of fighter. */ inline Fighter::Fighter (ogs::core::Experience::Level xpLevel): *************** *** 71,75 **** /** ! * Determine the hit die for fighters. * * @return Die::d10. --- 74,79 ---- /** ! * Determine the hit die for this cclass. Fighters use d10 for their ! * hit die. * * @return Die::d10. *************** *** 81,85 **** /** ! * Determine the skill points per experience level for fighters. * * @return 2 skill points. --- 85,90 ---- /** ! * Determine the skill points per experience level for this cclass. ! * Fighters gain 2 skill poitns for each experience level. * * @return 2 skill points. *************** *** 91,95 **** /** ! * Determine the value of base attack bonus for fighters. * * @return Value of base attack bonus. --- 96,101 ---- /** ! * Determine the value of base attack bonus for this cclass. Fighters ! * use the strong advancement rate for base attack bonuses. * * @return Value of base attack bonus. *************** *** 101,105 **** /** ! * Determine the value of base Fortitude save bonus for fighters. * * @return Value of base Fortitude save bonus. --- 107,113 ---- /** ! * Determine the value of base Fortitude save bonus for this cclass. ! * Fighters use the strong advancement rate for base Fortitude save ! * bonuses. * * @return Value of base Fortitude save bonus. Index: Monk.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/cclasses/Monk.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Monk.h 23 Mar 2003 22:14:36 -0000 1.1 --- Monk.h 4 Apr 2003 20:22:42 -0000 1.2 *************** *** 77,81 **** /** ! * Determine the hit die for monks. * * @return Die::d8. --- 77,92 ---- /** ! * Create a new Monk cclass. ! * ! * @param xpLevel Experience level of monk. ! */ ! inline Monk::Monk (Experience::Level xpLevel): ! CClass (xpLevel) { ! // empty constructor body ! } ! ! /** ! * Determine the hit die for this cclass. Monks use d8 for their hit ! * die. * * @return Die::d8. *************** *** 86,90 **** /** ! * Determine the skill points per experience level for monks. * * @return 4 skill points. --- 97,102 ---- /** ! * Determine the skill points per experience level for this cclass. ! * Monks gain 4 skill points for each experience level. * * @return 4 skill points. *************** *** 95,99 **** /** ! * Determine the value of base Fortitude save bonus for monks. * * @return Value of base Fortitude save bonus. --- 107,113 ---- /** ! * Determine the value of base Fortitude save bonus for this cclass. ! * Monks use the strong advancement rate for base Fortitude save ! * bonuses. * * @return Value of base Fortitude save bonus. *************** *** 104,108 **** /** ! * Determine the value of base Reflex save bonus for monks. * * @return Value of base Reflex save bonus. --- 118,123 ---- /** ! * Determine the value of base Reflex save bonus for this cclass. Monks ! * use the strong advancement rate for base Reflex save bonuses. * * @return Value of base Reflex save bonus. *************** *** 113,117 **** /** ! * Determine the value of base Will save bonus for monks. * * @return Value of base Will save bonus. --- 128,133 ---- /** ! * Determine the value of base Will save bonus for this cclass. Monks ! * use the strong advancement rate for base Will save bonuses. * * @return Value of base Will save bonus. Index: Paladin.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/cclasses/Paladin.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Paladin.h 23 Mar 2003 22:14:36 -0000 1.1 --- Paladin.h 4 Apr 2003 20:22:42 -0000 1.2 *************** *** 86,90 **** /** ! * Determine the hit die for paladins. * * @return Die::d10. --- 86,91 ---- /** ! * Determine the hit die for this cclass. Paladins use d10 for their ! * hit die. * * @return Die::d10. *************** *** 95,99 **** /** ! * Determine the skill points per experience level for paladins. * * @return 2 skill points. --- 96,101 ---- /** ! * Determine the skill points per experience level for this cclass. ! * Paladins gain 2 skill points for each experience level. * * @return 2 skill points. *************** *** 104,108 **** /** ! * Determine the value of base attack bonus for paladins. * * @return Value of base attack bonus. --- 106,111 ---- /** ! * Determine the value of base attack bonus for this cclass. Paladins ! * use the strong advancement rate for base attack bonuses. * * @return Value of base attack bonus. *************** *** 113,117 **** /** ! * Determine the value of base Fortitude save bonus for paladins. * * @return Value of base Fortitude save bonus. --- 116,122 ---- /** ! * Determine the value of base Fortitude save bonus for this cclass. ! * Paladins use the strong advancement rate for base Fortitude save ! * bonuses. * * @return Value of base Fortitude save bonus. Index: Ranger.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/cclasses/Ranger.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Ranger.h 23 Mar 2003 22:14:36 -0000 1.1 --- Ranger.h 4 Apr 2003 20:22:42 -0000 1.2 *************** *** 82,86 **** /** ! * Determine the hit die for rangers. * * @return Die::d10. --- 82,97 ---- /** ! * Create a new Ranger cclass. ! * ! * @param xpLevel Experience level of ranger. ! */ ! inline Ranger::Ranger (Experience::Level xpLevel): ! CClass (xpLevel) { ! // empty constructor body ! } ! ! /** ! * Determine the hit die for this cclass. Rangers use d10 for their hit ! * die. * * @return Die::d10. *************** *** 91,95 **** /** ! * Determine the skill points per experience level for rangers. * * @return 4 skill points. --- 102,107 ---- /** ! * Determine the skill points per experience level for this cclass. ! * Rangers gain 4 skill points for each experience level. * * @return 4 skill points. *************** *** 100,104 **** /** ! * Determine the value of base attack bonus for rangers. * * @return Value of base attack bonus. --- 112,117 ---- /** ! * Determine the value of base attack bonus for this cclass. Rangers ! * use the strong advancement rate for base attack bonuses. * * @return Value of base attack bonus. *************** *** 109,113 **** /** ! * Determine the value of base Fortitude save bonus for rangers. * * @return Value of base Fortitude save bonus. --- 122,128 ---- /** ! * Determine the value of base Fortitude save bonus for this cclass. ! * Rangers use the strong advancement rate for base Fortitude save ! * bonuses. * * @return Value of base Fortitude save bonus. *************** *** 115,118 **** --- 130,142 ---- inline Modifier::Value Ranger::getBaseFortSaveValue () const { return (Saves::getStrongBonus (getLevel ())); + } + + /** + * Determine the number of spells that this ranger can cast per day. + * + * @return Number of spells at each spell leve. + */ + inline Ranger::SpellCounts Ranger::getSpellsPerDay () const { + return (SpellCounts ()); // TODO: Implement. } Index: Rogue.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/cclasses/Rogue.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Rogue.h 23 Mar 2003 22:14:36 -0000 1.1 --- Rogue.h 4 Apr 2003 20:22:42 -0000 1.2 *************** *** 68,72 **** /** ! * Determine the hit die for rogues. * * @return Die::d6. --- 68,83 ---- /** ! * Create a new Rogue cclass. ! * ! * @param xpLevel Experience level of rogue. ! */ ! inline Rogue::Rogue (Experience::Level xpLevel): ! CClass (xpLevel) { ! // empty constructor body ! } ! ! /** ! * Determine the hit die for this cclass. Rogues use d6 for their hit ! * die. * * @return Die::d6. *************** *** 77,81 **** /** ! * Determine the skill points per experience level for rogues. * * @return 8 skill points. --- 88,93 ---- /** ! * Determine the skill points per experience level for this cclass. ! * Rogues gain 8 skill points for each experience level. * * @return 8 skill points. *************** *** 86,90 **** /** ! * Determine the value of base Reflex save bonus for rogues. * * @return Value of base Reflex save bonus. --- 98,103 ---- /** ! * Determine the value of base Reflex save bonus for this cclass. ! * Rogues use the strong advancement rate for base Reflex save bonuses. * * @return Value of base Reflex save bonus. Index: Sorcerer.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/cclasses/Sorcerer.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Sorcerer.h 23 Mar 2003 22:14:36 -0000 1.1 --- Sorcerer.h 4 Apr 2003 20:22:42 -0000 1.2 *************** *** 67,71 **** /** ! * Determine the hit die for sorcerers. * * @return Die::d4. --- 67,82 ---- /** ! * Create a new Sorcerer cclass. ! * ! * @param xpLevel Experience level of sorcerer. ! */ ! inline Sorcerer::Sorcerer (Experience::Level xpLevel): ! CClass (xpLevel) { ! // empty constructor body ! } ! ! /** ! * Determine the hit die for this cclass. Sorcerers use d4 for their ! * hit die. * * @return Die::d4. *************** *** 76,80 **** /** ! * Determine the skill points per experience level for sorcerers. * * @return 2 skill points. --- 87,92 ---- /** ! * Determine the skill points per experience level for this cclass. ! * Sorcerers gain 2 skill points for each experience level. * * @return 2 skill points. *************** *** 85,89 **** /** ! * Determine the value of base attack bonus for sorcerers. * * @return Value of base attack bonus. --- 97,102 ---- /** ! * Determine the value of base attack bonus for this cclass. Sorcerers ! * use the weak advancment rate for base attack bonuses. * * @return Value of base attack bonus. *************** *** 94,98 **** /** ! * Determine the value of base Will save bonus for sorcerers. * * @return Value of base Will save bonus. --- 107,112 ---- /** ! * Determine the value of base Will save bonus for sorcerers. Sorcerers ! * use the strong advancment rate for base Will save bonuses. * * @return Value of base Will save bonus. Index: Wizard.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/cclasses/Wizard.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Wizard.h 23 Mar 2003 22:14:36 -0000 1.1 --- Wizard.h 4 Apr 2003 20:22:42 -0000 1.2 *************** *** 57,61 **** * school but can never cast spells from one or more of the prohibited * schools. Wizards (only) may also select the Spell Mastery feat that ! * allows them to prepare spells without studying a spellbook. * * At 1st-level, wizards may summon a familliar just like a sorcerer and --- 57,61 ---- * school but can never cast spells from one or more of the prohibited * schools. Wizards (only) may also select the Spell Mastery feat that ! * allows them to prepare spells without studying a spellbook. <P> * * At 1st-level, wizards may summon a familliar just like a sorcerer and *************** *** 65,69 **** * are only proficient with clubs, daggers, light and heavy crossbows, * and quarterstaffs. Wizard have no alignment restrictions; they may ! * be of any alignment. * * This cclass is typcially used in fantasy campaign settings. --- 65,69 ---- * are only proficient with clubs, daggers, light and heavy crossbows, * and quarterstaffs. Wizard have no alignment restrictions; they may ! * be of any alignment. <P> * * This cclass is typcially used in fantasy campaign settings. *************** *** 90,94 **** /** ! * Determine the hit die for wizards. * * @return Die::d4. --- 90,105 ---- /** ! * Create a new Wizard cclass. ! * ! * @param xpLevel Experience level of wizard. ! */ ! inline Wizard::Wizard (Experience::Level xpLevel): ! CClass (xpLevel) { ! // empty constructor body ! } ! ! /** ! * Determine the hit die for this class. Wizards use d4 for their hit ! * die. * * @return Die::d4. *************** *** 99,103 **** /** ! * Determine the skill points per experience level for wizards. * * @return 2 skill points. --- 110,115 ---- /** ! * Determine the skill points per experience level for wizards. Wizards ! * gain 2 skill points for each experience level. * * @return 2 skill points. *************** *** 108,112 **** /** ! * Determine the value of base attack bonus for wizards. * * @return Value of base attack bonus. --- 120,125 ---- /** ! * Determine the value of base attack bonus for wizards. Wizards use ! * the weak advancement rate for base attack bonuses. * * @return Value of base attack bonus. *************** *** 117,121 **** /** ! * Determine the value of base Will save bonus for wizards. * * @return Value of base Will save bonus. --- 130,135 ---- /** ! * Determine the value of base Will save bonus for wizards. Wizards use ! * the strong advancement rate for base Will save bonuses. * * @return Value of base Will save bonus. *************** *** 123,126 **** --- 137,149 ---- inline Modifier::Value Wizard::getBaseWillSaveValue () const { return (Saves::getStrongBonus (getLevel ())); + } + + /** + * Determine the number of spells that this wizard can cast per day. + * + * @return Number of spells at each spell leve. + */ + inline Wizard::SpellCounts Wizard::getSpellsPerDay () const { + return (SpellCounts ()); // TODO: Implement. } |
From: <ele...@us...> - 2003-04-04 20:23:18
|
Update of /cvsroot/ogs/dist/c++/ogs/creatures In directory sc8-pr-cvs1:/tmp/cvs-serv9450/c++/ogs/creatures Modified Files: Undead.h Log Message: See ChangeLog files (Apr 3-4) for details. Index: Undead.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/creatures/Undead.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Undead.h 23 Mar 2003 22:14:36 -0000 1.1 --- Undead.h 4 Apr 2003 20:22:44 -0000 1.2 *************** *** 26,29 **** --- 26,30 ---- # define OGS_CREATURES_UNDEAD_H + # include <ogs/core/Creature.h> # include <ogs/creatures/Namespace.h> *************** *** 41,45 **** * with positive energy.. */ ! class Undead { public: --- 42,46 ---- * with positive energy.. */ ! class Undead: public ogs::core::Creature { public: |
From: <ele...@us...> - 2003-04-04 20:23:14
|
Update of /cvsroot/ogs/dist/c++ In directory sc8-pr-cvs1:/tmp/cvs-serv9450/c++ Modified Files: ChangeLog Makefile.am TODO configure.in Log Message: See ChangeLog files (Apr 3-4) for details. Index: ChangeLog =================================================================== RCS file: /cvsroot/ogs/dist/c++/ChangeLog,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** ChangeLog 29 Mar 2003 02:31:34 -0000 1.14 --- ChangeLog 4 Apr 2003 20:22:39 -0000 1.15 *************** *** 1,3 **** --- 1,33 ---- + Thu Apr 3 22:35:57 UTC 2003 Eric Lemings <ele...@us...> + + * TODO: Remove completed items. + + * Makefile.am, ogs/Makefile.am, ogs/Doxyfile.in: Move doc target + back to original location. Made top-level doc target phony so + make will ignore the doc directory. Added a few doc build + updates and enhancments. + + * configure.in: Increment version number to 0.1.1. + + * ogs/core/Abilit*, ogs/core/Strength.h: Removed factory methods. + Abilities are now created with constructors that throw an + exception if the type of ability is invalid. Added overloaded + operators so static method member could be removed. + + * ogs/core/Feat.h: Moved findFeat() template from source file. + + * ogs/cclasses/*.h: Added constructors. Update docs. + + * ogs/creatures/humanoids/*.h: Remove starting ages. + + * ogs/feats/AllWeapons.*: Inlined factory methods. + + * ogs/feats/ArmorProficiency.cpp: Optimizations. + + * ogs/magic/Spell.h: Removed static descriptors member. + + * ogs/test/CoreTest03.cpp: Updated for ability interface changes. + Fri Mar 28 18:36:05 UTC 2003 Eric Lemings <ele...@us...> Index: Makefile.am =================================================================== RCS file: /cvsroot/ogs/dist/c++/Makefile.am,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Makefile.am 29 Mar 2003 02:31:34 -0000 1.7 --- Makefile.am 4 Apr 2003 20:22:40 -0000 1.8 *************** *** 37,49 **** @PACKAGE@.spec.in - docdir = $(top_builddir)/doc if HAVE_DOXYGEN doc: ! rm -rf $(docdir)/html $(docdir)/latex ! $(DOXYGEN) ogs/Doxyfile else doc: @echo "Doxygen (www.doxygen.org) is required to build documantation." endif # Cleans all files not contained in the CVS repository. --- 37,51 ---- @PACKAGE@.spec.in if HAVE_DOXYGEN doc: ! @subdir=ogs; \ ! echo "Making $@ in $$subdir"; \ ! cd $$subdir && make $@ || exit 1 else doc: @echo "Doxygen (www.doxygen.org) is required to build documantation." endif + + .PHONY: doc # Cleans all files not contained in the CVS repository. Index: TODO =================================================================== RCS file: /cvsroot/ogs/dist/c++/TODO,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TODO 29 Mar 2003 02:31:34 -0000 1.8 --- TODO 4 Apr 2003 20:22:40 -0000 1.9 *************** *** 23,31 **** * 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 --------------------- --- 23,26 ---- *************** *** 33,40 **** 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 --- 28,31 ---- Index: configure.in =================================================================== RCS file: /cvsroot/ogs/dist/c++/configure.in,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** configure.in 29 Mar 2003 02:31:34 -0000 1.10 --- configure.in 4 Apr 2003 20:22:40 -0000 1.11 *************** *** 29,33 **** OGS_MAJOR_VERSION=0 OGS_MINOR_VERSION=1 ! OGS_PATCH_VERSION=0 OGS_VERSION=$OGS_MAJOR_VERSION.$OGS_MINOR_VERSION.$OGS_PATCH_VERSION OGS_INTERFACE_AGE=0 --- 29,33 ---- OGS_MAJOR_VERSION=0 OGS_MINOR_VERSION=1 ! OGS_PATCH_VERSION=1 OGS_VERSION=$OGS_MAJOR_VERSION.$OGS_MINOR_VERSION.$OGS_PATCH_VERSION OGS_INTERFACE_AGE=0 |
From: <ele...@us...> - 2003-04-04 20:23:14
|
Update of /cvsroot/ogs/dist/c++/ogs In directory sc8-pr-cvs1:/tmp/cvs-serv9450/c++/ogs Modified Files: Doxyfile.in Makefile.am Log Message: See ChangeLog files (Apr 3-4) for details. Index: Doxyfile.in =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/Doxyfile.in,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Doxyfile.in 13 Jan 2003 05:22:14 -0000 1.1 --- Doxyfile.in 4 Apr 2003 20:22:41 -0000 1.2 *************** *** 337,342 **** # with spaces. ! INPUT = . support core magic ! INPUT += cclasses creatures feats items skills spells # If the value of the INPUT tag contains directories, you can use the --- 337,359 ---- # with spaces. ! INPUT = @top_srcdir@/ogs ! INPUT += @top_srcdir@/ogs/support ! INPUT += @top_srcdir@/ogs/core ! INPUT += @top_srcdir@/ogs/core/details ! #INPUT += @top_srcdir@/ogs/combat ! #INPUT += @top_srcdir@/ogs/combat/actions ! INPUT += @top_srcdir@/ogs/magic ! INPUT += @top_srcdir@/ogs/magic/abilities ! INPUT += @top_srcdir@/ogs/magic/feats ! INPUT += @top_srcdir@/ogs/cclasses ! INPUT += @top_srcdir@/ogs/creatures ! INPUT += @top_srcdir@/ogs/creatures/humanoids ! INPUT += @top_srcdir@/ogs/feats ! INPUT += @top_srcdir@/ogs/items ! INPUT += @top_srcdir@/ogs/items/rings ! INPUT += @top_srcdir@/ogs/items/wonders ! INPUT += @top_srcdir@/ogs/skills ! INPUT += @top_srcdir@/ogs/spells ! INPUT += @top_srcdir@/ogs/spells/conjurations # If the value of the INPUT tag contains directories, you can use the *************** *** 370,374 **** # certain files from those directories. ! EXCLUDE_PATTERNS = Template.* *.java test* # The EXAMPLE_PATH tag can be used to specify one or more files or --- 387,391 ---- # certain files from those directories. ! EXCLUDE_PATTERNS = # The EXAMPLE_PATH tag can be used to specify one or more files or *************** *** 500,504 **** # will generate a default style sheet ! HTML_STYLESHEET = @top_builddir@doc/stylesheet.css # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, --- 517,521 ---- # will generate a default style sheet ! HTML_STYLESHEET = @top_srcdir@/doc/stylesheet.css # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, Index: Makefile.am =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/Makefile.am,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Makefile.am 29 Mar 2003 02:31:34 -0000 1.8 --- Makefile.am 4 Apr 2003 20:22:41 -0000 1.9 *************** *** 82,83 **** --- 82,96 ---- spells/libogs-spells.la + docdir = $(top_builddir)/doc + + if HAVE_DOXYGEN + doc: Doxyfile + rm -rf $(docdir)/html $(docdir)/latex + $(DOXYGEN) + else + doc: + @echo "Doxygen (www.doxygen.org) is required to build documantation." + endif + + .PHONY: doc + |
From: <ele...@us...> - 2003-04-04 20:23:11
|
Update of /cvsroot/ogs/dist In directory sc8-pr-cvs1:/tmp/cvs-serv9450 Modified Files: ChangeLog configure.in Log Message: See ChangeLog files (Apr 3-4) for details. Index: ChangeLog =================================================================== RCS file: /cvsroot/ogs/dist/ChangeLog,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** ChangeLog 23 Mar 2003 22:14:35 -0000 1.26 --- ChangeLog 4 Apr 2003 20:22:38 -0000 1.27 *************** *** 1,3 **** --- 1,7 ---- + Thu Apr 3 22:35:57 UTC 2003 Eric Lemings <ele...@us...> + + * configure.in: Increment version number to 0.1.1. + Fri Mar 21 22:11:32 UTC 2003 Eric Lemings <ele...@us...> Index: configure.in =================================================================== RCS file: /cvsroot/ogs/dist/configure.in,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** configure.in 9 Mar 2003 00:18:36 -0000 1.13 --- configure.in 4 Apr 2003 20:22:38 -0000 1.14 *************** *** 29,33 **** OGS_MAJOR_VERSION=0 OGS_MINOR_VERSION=1 ! OGS_PATCH_VERSION=0 OGS_VERSION=$OGS_MAJOR_VERSION.$OGS_MINOR_VERSION.$OGS_PATCH_VERSION --- 29,33 ---- OGS_MAJOR_VERSION=0 OGS_MINOR_VERSION=1 ! OGS_PATCH_VERSION=1 OGS_VERSION=$OGS_MAJOR_VERSION.$OGS_MINOR_VERSION.$OGS_PATCH_VERSION |
From: <ele...@us...> - 2003-04-04 20:23:11
|
Update of /cvsroot/ogs/dist/c In directory sc8-pr-cvs1:/tmp/cvs-serv9450/c Modified Files: ChangeLog configure.in Log Message: See ChangeLog files (Apr 3-4) for details. Index: ChangeLog =================================================================== RCS file: /cvsroot/ogs/dist/c/ChangeLog,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ChangeLog 23 Mar 2003 22:14:35 -0000 1.9 --- ChangeLog 4 Apr 2003 20:22:38 -0000 1.10 *************** *** 1,3 **** --- 1,7 ---- + Thu Apr 3 22:35:57 UTC 2003 Eric Lemings <ele...@us...> + + * configure.in: Increment version number to 0.1.1. + Sun Mar 23 20:08:38 UTC 2003 Eric Lemings <ele...@us...> Index: configure.in =================================================================== RCS file: /cvsroot/ogs/dist/c/configure.in,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** configure.in 23 Mar 2003 22:14:36 -0000 1.7 --- configure.in 4 Apr 2003 20:22:39 -0000 1.8 *************** *** 30,34 **** OGS_MAJOR_VERSION=0 OGS_MINOR_VERSION=1 ! OGS_PATCH_VERSION=0 OGS_VERSION=$OGS_MAJOR_VERSION.$OGS_MINOR_VERSION.$OGS_PATCH_VERSION OGS_INTERFACE_AGE=0 --- 30,34 ---- OGS_MAJOR_VERSION=0 OGS_MINOR_VERSION=1 ! OGS_PATCH_VERSION=1 OGS_VERSION=$OGS_MAJOR_VERSION.$OGS_MINOR_VERSION.$OGS_PATCH_VERSION OGS_INTERFACE_AGE=0 |
Update of /cvsroot/ogs/dist/java/ogs/creatures/humanoids In directory sc8-pr-cvs1:/tmp/cvs-serv9450/java/ogs/creatures/humanoids Added Files: Dwarf.java Elf.java Gnome.java HalfElf.java HalfOrc.java Halfling.java Human.java package.html Log Message: See ChangeLog files (Apr 3-4) for details. --- NEW FILE: Dwarf.java --- /* * Dwarf.java -- class declaration for dwarves * 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: Dwarf.java,v 1.1 2003/04/04 20:22:54 elemings Exp $ */ package ogs.creatures.humanoids; import ogs.core.Die; import ogs.core.details.Maturity; import ogs.creatures.Humanoid; /** * A sturdy humanoid creature skilled in stonework and metalcraft. * Dwarves are shorter but broader and just as heavy as humans and thus * considered as medium-size creatures but they cannot move quite as * fast. Dwarves are most at home in areas with a preponderance of * stone and metals such as mountains or rocky hillsides. Most of them * live in underground mansions where they work in vast complexes of * mines and forges. <P> * * They have many special racial traits that make them well suited to * life underground. Dwarves have darkvision that allows them to see * without color up to 60 feet in total darkness. They share a feature * common to many earth dwellers called stonecunning. Their favored * class is fighter. Dwarves also get the following modifiers: <P> * * <UL> * <LI> +2 bonus when rolling Constitution scores * <LI> -2 penalty when rolling Charisma scores * <LI> +2 bonus to Fortitude saves against poison * <LI> +2 bonus to all saves against spells and spell-like effects * <LI> +1 bonus to attacks against orckind and goblinoids * <LI> +4 bonus to defense against giantkin. * <LI> +2 bonus to Appraise skill check for rare or exotic items * <LI> +2 bonus to Craft checks for stone or metal * </UL> * * Dwarves typically exist in fantasy campaign settings. */ public class Dwarf extends Humanoid implements Maturity { private static Die maximumAge = new Die (Die.d100, 2, 250); /** * Create a new dwarf. */ public Dwarf () { // empty constructor body } /** * Determine the average adult age for this type of creature. The * adult age for dwarves is 40 years. * * @return 40 years */ public int getAdultAge () { return (40); } /** * Determine the average middle age for this type of creature. The * middle age for dwarves is 125 years. * * @return 125 years */ public int getMiddleAge () { return (125); } /** * Determine the average old age for this type of creature. The old * age for dwarves is 188 years. * * @return 188 years */ public int getOldAge () { return (188); } /** * Determine the average venerable age for this type of creature. The * venerable age for dwarves is 250 years. * * @return 250 years */ public int getVenerableAge () { return (this.maximumAge.getModifier ()); } /** * Access the die used to roll a random maximum age for a PC. The die * used to roll maximum ages for dwarves is 2d100. * * @return 2d100+250 */ public Die getMaximumAge () { return (this.maximumAge); } } --- NEW FILE: Elf.java --- /* * Elf.java -- class declaration for elves * 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: Elf.java,v 1.1 2003/04/04 20:22:54 elemings Exp $ */ package ogs.creatures.humanoids; import ogs.core.Die; import ogs.core.details.Maturity; import ogs.creatures.Humanoid; /** * A mystical humanoid creature with an affinity for nature and magic. * Elves can live for hundreds of years. Their skill and knowledge are * usually superior to humans but they are usually more fraile and less * resilient. Their resolve however can be just as strong as any other * creature. In stature, they are slightly shorter and lighter than most * humans and are generally considered fairer in appearance. They can * move just as fast as humans and their senses are significantly * sharper. Elves have low-light vision which allows them to see twice * as far as humans even in near darkness. <P> * * Most elves are sylvan folk. They tend to live in great forests where * they are in harmony with nature and free to uncover natural and * arcane secrets of the world without interference from less * sympathetic civilizations. Many elves thus become rangers and druids * though wizard is their favored character class. Elves are also * inherently resistant to certain forms of magic. They are immune to * all sleep spells. In addition, elves have the following racial traits.<P> * * <UL> * <LI> +2 bonus when rolling Dexterity scores * <LI> -2 penalty when rolling Constitution scores * <LI> +2 bonus to saves against Enchantment spells and spell-like effects * <LI> +2 bonus to Listen, Search, and Spot skill checks * <LI> * </UL> * * Elves typically exist in fantasy campaign settings. */ public class Elf extends Humanoid implements Maturity { private static Die maximumAge = new Die (Die.d100, 4, 350); /** * Create a new elf. */ public Elf () { // empty constructor body } /** * Determine the average adult age for this type of creature. The * adult age for elves is 110 years. * * @return 110 years */ public int getAdultAge () { return (110); } /** * Determine the average middle age for this type of creature. The * middle age for elves is 175 years. * * @return 175 years */ public int getMiddleAge () { return (175); } /** * Determine the average old age for this type of creature. The old * age for elves is 263 years. * * @return 263 years */ public int getOldAge () { return (263); } /** * Determine the average venerable age for this type of creature. The * venerable age for elves is 350 years. * * @return 350 years */ public int getVenerableAge () { return (this.maximumAge.getModifier ()); } /** * Access the die used to roll a random maximum age for a PC. The die * used to roll maximum ages for elves is 4d100. * * @return 4d100+350 */ public Die getMaximumAge () { return (this.maximumAge); } } --- NEW FILE: Gnome.java --- /* * Gnome.java -- class declaration for gnomes * 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: Gnome.java,v 1.1 2003/04/04 20:22:54 elemings Exp $ */ package ogs.creatures.humanoids; import ogs.core.Die; import ogs.core.details.Maturity; import ogs.creatures.Humanoid; /** * A curious humanoid creature with a propensity for mechanics and * pranks. TODO: Finish this description. * * Gnomes are typically found in fantasy campaign settings. */ public class Gnome extends Humanoid implements Maturity { private static Die maximumAge = new Die (Die.d100, 3, 200); /** * Create a new gnome. */ public Gnome () { // empty constructor body } /** * Determine the average adult age for this type of creature. The * adult age for gnomes is 40 years. * * @return 40 years */ public int getAdultAge () { return (40); } /** * Determine the average middle age for this type of creature. The * middle age for gnomes is 100 years. * * @return 100 years */ public int getMiddleAge () { return (100); } /** * Determine the average old age for this type of creature. The old * age for gnomes is 150 years. * * @return 150 years */ public int getOldAge () { return (150); } /** * Determine the average venerable age for this type of creature. The * venerable age for gnomes is 200 years. * * @return 200 years */ public int getVenerableAge () { return (this.maximumAge.getModifier ()); } /** * Access the die used to roll a random maximum age for a PC. The die * used to roll maximum ages for gnomes is 3d100. * * @return 3d100+200 */ public Die getMaximumAge () { return (this.maximumAge); } } --- NEW FILE: HalfElf.java --- /* * HalfElf.java -- class declaration for half-elves * 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: HalfElf.java,v 1.1 2003/04/04 20:22:54 elemings Exp $ */ package ogs.creatures.humanoids; import ogs.core.Die; import ogs.core.details.Maturity; import ogs.creatures.Humanoid; /** * A progeny of a human and an elf. TODO: Finish this description. * * Half-elves typically exist in fantasy campaign settings. */ public class HalfElf extends Humanoid implements Maturity { private static Die maximumAge = new Die (Die.d20, 3, 125); /** * Create a new half-elf. */ public HalfElf() { // empty constructor body } /** * Determine the average adult age for this type of creature. The * adult age for half-elves is 20 years. * * @return 20 years */ public int getAdultAge () { return (20); } /** * Determine the average middle age for this type of creature. The * middle age for half-elves is 62 years. * * @return 62 years */ public int getMiddleAge () { return (62); } /** * Determine the average old age for this type of creature. The old * age for half-elves is 93 years. * * @return 93 years */ public int getOldAge () { return (93); } /** * Determine the average venerable age for this type of creature. The * venerable age for half-elves is 125 years. * * @return 125 years */ public int getVenerableAge () { return (this.maximumAge.getModifier ()); } /** * Access the die used to roll a random maximum age for a PC. The die * used to roll maximum ages for half-elves is 3d20. * * @return 3d20+125 */ public Die getMaximumAge () { return (this.maximumAge); } } --- NEW FILE: HalfOrc.java --- /* * HalfOrc.java -- class declaration for half-orcs * 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: HalfOrc.java,v 1.1 2003/04/04 20:22:54 elemings Exp $ */ package ogs.creatures.humanoids; import ogs.core.Die; import ogs.core.details.Maturity; import ogs.creatures.Humanoid; /** * A progeny of a human and an orc. TODO: Finish this description. * * Half-orcs typically exist in fantasy campaign settings. */ public class HalfOrc extends Humanoid implements Maturity { private static Die maximumAge = new Die (Die.d10, 2, 60); /** * Create a new half-orc. */ public HalfOrc () { // empty constructor body } /** * Determine the average adult age for this type of creature. The * adult age for half-orcs is 14 years. * * @return 14 years */ public int getAdultAge () { return (14); } /** * Determine the average middle age for this type of creature. The * middle age for half-orcs is 30 years. * * @return 30 years */ public int getMiddleAge () { return (30); } /** * Determine the average old age for this type of creature. The old * age for half-orcs is 45 years. * * @return 45 years */ public int getOldAge () { return (45); } /** * Determine the average venerable age for this type of creature. The * venerable age for half-orcs is 60 years. * * @return 60 years */ public int getVenerableAge () { return (this.maximumAge.getModifier ()); } /** * Access the die used to roll a random maximum age for a PC. The die * used to roll maximum ages for half-orcs is 2d10. * * @return 2d10+60 */ public Die getMaximumAge () { return (this.maximumAge); } } --- NEW FILE: Halfling.java --- /* * Halfling.java -- class declaration for halflings * 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: Halfling.java,v 1.1 2003/04/04 20:22:54 elemings Exp $ */ package ogs.creatures.humanoids; import ogs.core.Die; import ogs.core.details.Maturity; import ogs.creatures.Humanoid; /** * A creature much like a human but about half the size. TODO: Finish * this description. * * Halfings are typically found in fantasy campaign settings. */ public class Halfling extends Humanoid implements Maturity { private static Die maximumAge = new Die (Die.d100, 2, 100); /** * Create a new halfling. */ public Halfling () { // empty constructor body } /** * Determine the average adult age for this type of creature. The * adult age for halflings is 20 years. * * @return 20 years */ public int getAdultAge () { return (20); } /** * Determine the average middle age for this type of creature. The * middle age for halflings is 50 years. * * @return 50 years */ public int getMiddleAge () { return (50); } /** * Determine the average old age for this type of creature. The old * age for halflings is 75 years. * * @return 75 years */ public int getOldAge () { return (75); } /** * Determine the average venerable age for this type of creature. The * venerable age for halflings is 100 years. * * @return 100 years */ public int getVenerableAge () { return (this.maximumAge.getModifier ()); } /** * Access the die used to roll a random maximum age for a PC. The die * used to roll maximum ages for halflings is 5d20. * * @return 5d20+100 */ public Die getMaximumAge () { return (this.maximumAge); } } --- NEW FILE: Human.java --- /* * Human.java -- class for humans * Copyright (C) 2003 Eric Lemings <ele...@us...> * * This library 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 library 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 program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA * * RCS: $Id: Human.java,v 1.1 2003/04/04 20:22:54 elemings Exp $ */ package ogs.creatures.humanoids; import ogs.core.Die; import ogs.core.details.Maturity; import ogs.creatures.Humanoid; /** * The human race. Humans have the fewest special features. A human * character gains one (1) bonus feat and four (4) extra skill points * at 1st-level and one (1) extra skill point for each additional level. * Also, humans have no inherent favored class; the favored cclass of a * particular human character is his or her cclass with the highest * level. */ public class Human extends Humanoid implements Maturity { private static Die maximumAge = new Die (Die.d20, 2, 70); /** * Create a new human. */ public Human () { // empty constructor body } /** * Determine the average adult age for this type of creature. The * adult age for humans is 15 years. * * @return 15 years */ public int getAdultAge () { return (15); } /** * Determine the average middle age for this type of creature. The * middle age for humans is 35 years. * * @return 35 years */ public int getMiddleAge () { return (35); } /** * Determine the average old age for this type of creature. The old * age for humans is 53 years. * * @return 53 years */ public int getOldAge () { return (53); } /** * Determine the average venerable age for this type of creature. The * venerable age for humans is 70 years. * * @return 70 years */ public int getVenerableAge () { return (this.maximumAge.getModifier ()); } /** * Access the die used to roll a random maximum age for a PC. The die * used to roll maximum ages for humans is 2d20. * * @return 2d20+70 */ public Die getMaximumAge () { return (this.maximumAge); } } --- NEW FILE: package.html --- <HTML> <HEAD> <TITLE>ogs.creatures.humanoids (Open Gaming System)</TITLE> </HEAD> <BODY> A collection of common humanoid creatures. </BODY> </HTML> |
From: <ele...@us...> - 2003-04-04 20:22:56
|
Update of /cvsroot/ogs/dist/java/ogs/creatures In directory sc8-pr-cvs1:/tmp/cvs-serv9450/java/ogs/creatures Added Files: Undead.java Removed Files: Human.java Log Message: See ChangeLog files (Apr 3-4) for details. --- NEW FILE: Undead.java --- /* * Undead.java -- class declaration for undead creatures * Copyright (C) 2003 Eric Lemings <ele...@us...> * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this software; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA * * RCS: $Id: Undead.java,v 1.1 2003/04/04 20:22:53 elemings Exp $ */ package ogs.creatures; import ogs.core.Creature; /** * A creature that is, technically speaking, dead. The word "undead" is * something of a misnomer. It suggests that an undead creature is "not * dead". Just the opposite. An undead creature is a creature that * lingers on after death within the world of the living. In this * respect, undead creatures are often created from other creatures. * Many classes of undead creatures can be implemented as templates. * Undead creatures have a special connection with negative energy. * Consequently, undead creatures can be turned, rebuked, or destroyed * with positive energy.. */ public class Undead extends Creature { } --- Human.java DELETED --- |
From: <ele...@us...> - 2003-04-04 20:22:56
|
Update of /cvsroot/ogs/dist/java/ogs/core/details In directory sc8-pr-cvs1:/tmp/cvs-serv9450/java/ogs/core/details Added Files: Maturity.java Log Message: See ChangeLog files (Apr 3-4) for details. --- NEW FILE: Maturity.java --- /* * Maturity.java -- interface declaration for maturity ranges * 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: Maturity.java,v 1.1 2003/04/04 20:22:53 elemings Exp $ */ package ogs.core.details; import ogs.core.Die; import ogs.core.Detail; /** * The various stages of life for a creature. The <code>Maturity</code> * class is an interface that determines the longevity or lifespan of a * creature. This class is implemented by <code>Creature</code> classes * such as <code>Human</code> that can be used as a player character * (PC) race. It provides players and referees with average age ranges * such as adult, starting, middle, old, venerable, and maximum. Each * of these stages have effects that are applied once a creature reaches * that age. The pure virtual member functions should behave the same * for all instances of a <code>Creature</code> class (i.e., as static * member functions). All ages are expressed in years by default. */ public interface Maturity { /** * Determine the average adult age for this type of creature. The * adult age is the base value for determining the starting age of * a PC. * * @return Average adult age of a creature. */ public int getAdultAge (); /** * Determine the average middle age for this type of creature. At * middle age, a character recieves a -1 modifier to physical * abilities (Strength, Constitution, and Dexterity) and a +1 * modifier to mental abilities (Intelligence, Wisdom, and * Charisma). * * @return Average middle age of a creature. */ public int getMiddleAge (); /** * Determine the average old age for this type of creature. At old * age, a character recieves a -2 modifier to physical abilities and * a +1 modifier to mental abilities. * * @return Average old age of a creature. */ public int getOldAge (); /** * Determine the average venerable age for this type of creature. * At venerable age, a character recieves a -3 modifier to physical * abilities and a +1 modifier to mental abilities. The venerable * age is also used as the base value for determining maximum age. * * @return Average venerable age of a creature. */ public int getVenerableAge (); /** * Access the die used to roll a random maximum age for a PC. The * modifier of this die is the same as the venerage age. A PC dies of * natural causes when he or she reaches this maximum age. * * @return Die used to roll random maximum ages. */ public Die getMaximumAge (); } |
Update of /cvsroot/ogs/dist/java/ogs/core/abilities In directory sc8-pr-cvs1:/tmp/cvs-serv9450/java/ogs/core/abilities Removed Files: Charisma.java Constitution.java Dexterity.java Intelligence.java Strength.java Wisdom.java package.html Log Message: See ChangeLog files (Apr 3-4) for details. --- Charisma.java DELETED --- --- Constitution.java DELETED --- --- Dexterity.java DELETED --- --- Intelligence.java DELETED --- --- Strength.java DELETED --- --- Wisdom.java DELETED --- --- package.html DELETED --- |
From: <ele...@us...> - 2003-04-03 08:44:39
|
Update of /cvsroot/ogs/dist/java/ogs/spells/conjurations In directory sc8-pr-cvs1:/tmp/cvs-serv9461/conjurations Log Message: Directory /cvsroot/ogs/dist/java/ogs/spells/conjurations added to the repository |
From: <ele...@us...> - 2003-04-01 08:44:50
|
Update of /cvsroot/ogs/dist/java/ogs/creatures/humanoids In directory sc8-pr-cvs1:/tmp/cvs-serv27167/humanoids Log Message: Directory /cvsroot/ogs/dist/java/ogs/creatures/humanoids added to the repository |
From: <ele...@us...> - 2003-03-29 02:31:45
|
Update of /cvsroot/ogs/dist/c++ In directory sc8-pr-cvs1:/tmp/cvs-serv2092/c++ Modified Files: ChangeLog Makefile.am TODO configure.in Log Message: See C++ ChangeLog (Mar 28) for details. Index: ChangeLog =================================================================== RCS file: /cvsroot/ogs/dist/c++/ChangeLog,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ChangeLog 25 Mar 2003 06:13:09 -0000 1.13 --- ChangeLog 29 Mar 2003 02:31:34 -0000 1.14 *************** *** 1,3 **** --- 1,64 ---- + Fri Mar 28 18:36:05 UTC 2003 Eric Lemings <ele...@us...> + + * ogs/Makefile.am: Fixed library dependencies. + + * ogs/core/Ability.*: Added Ability type attribute. Changed + methods into function objects. Updated implementation for + interface changes. Used Modifiers object for score modifiers. + + * ogs/core/Abilities.*: Changed struct interface of individual + pointers to private map of Ability type to pointers. Made + copy constructor and assignment operator private (for now). + Revised canReroll() function. Moved and updated Strength from + ogs/core/abilities module to ogs/core. + + * ogs/core/Character.cpp: Changed _cclass reference to pointer. + Removed assignment operator. Updated access to Intelligence + ability. + + * ogs/core/Creature.*: Added body parts! Added (draft) + interface for equipping items. Added some missing inline + functions. + + * ogs/core/Entity.*: Added weight to constructor. Changed + include directive from installed search path to local path. + + * ogs/core/Feat*: Added constness. Namespace fixes. + + * ogs/core/Item.*: Added more attributes and (draft) code for + equipping items. + + * ogs/core/Skill: Use Modifier object for skill check modifiers. + + * configure.in, ogs/core/Makefile.am: Removed abilities module. + + * ogs/core/details/Maturity.h: Removed starting age. Will (be + a campaign relation in the future.) + + * ogs/combat/Combatant.*: Fixed warnings. Changed creature + reference to a pointer to work better with STL. Removed + assignment operator. + + * ogs/combat/Encounter.*, ogs/combat/actions/[DR]*.cpp: Changed + include to forward delcaration. Updates for Combatant changes. + + * ogs/cclasses/Paladin.cpp, ogs/skills/Diplomacy.h, + ogs/skills/Spot.h: Updated for core interface changes. + + * ogs/creatures/Humanoid.*: Added function to create humanoid + bodies. + + * ogs/creatures/humanoids/Human.*: Namespace fixes. Added + static Die object for maximum age. + + * ogs/feats/*: Updates for core interface changes. Fixed + ImprovedSave::canAttach() function. Implemented weapon + and shield proficiency feats. Added interface for Toughness. + + * ogs/items/Weapon.h: Fleshed out interface. + + * ogs/Feats.h: Updated with new feats. Removed old headers. + Tue Mar 25 04:42:42 UTC 2003 Eric Lemings <ele...@us...> Index: Makefile.am =================================================================== RCS file: /cvsroot/ogs/dist/c++/Makefile.am,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Makefile.am 4 Mar 2003 08:19:57 -0000 1.6 --- Makefile.am 29 Mar 2003 02:31:34 -0000 1.7 *************** *** 37,45 **** @PACKAGE@.spec.in ! doc: if HAVE_DOXYGEN ! @subdir=ogs; \ ! echo "Making $@ in $$subdir"; \ ! cd $$subdir && make $@ || exit 1 endif --- 37,48 ---- @PACKAGE@.spec.in ! docdir = $(top_builddir)/doc if HAVE_DOXYGEN ! doc: ! rm -rf $(docdir)/html $(docdir)/latex ! $(DOXYGEN) ogs/Doxyfile ! else ! doc: ! @echo "Doxygen (www.doxygen.org) is required to build documantation." endif Index: TODO =================================================================== RCS file: /cvsroot/ogs/dist/c++/TODO,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TODO 25 Mar 2003 06:13:09 -0000 1.7 --- TODO 29 Mar 2003 02:31:34 -0000 1.8 *************** *** 41,45 **** integrated into the next revision of Standard C++ anyway. ! * Add reference counting to Object class. * Put version information in top-level ogs namespace. --- 41,45 ---- integrated into the next revision of Standard C++ anyway. ! * Add smart pointers. * Put version information in top-level ogs namespace. *************** *** 48,50 **** --- 48,54 ---- * Add effective character level (ECL) to Creature class. + + * Remove standard include and library search paths if possible when + building test drivers or at least make sure the local search paths + are searched first.. Index: configure.in =================================================================== RCS file: /cvsroot/ogs/dist/c++/configure.in,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** configure.in 23 Mar 2003 22:14:36 -0000 1.9 --- configure.in 29 Mar 2003 02:31:34 -0000 1.10 *************** *** 105,109 **** ogs/support/Makefile ogs/core/Makefile - ogs/core/abilities/Makefile ogs/core/details/Makefile ogs/combat/Makefile --- 105,108 ---- |
From: <ele...@us...> - 2003-03-29 02:31:44
|
Update of /cvsroot/ogs/dist/c++/test In directory sc8-pr-cvs1:/tmp/cvs-serv2092/c++/test Modified Files: CombatTest01.cpp Log Message: See C++ ChangeLog (Mar 28) for details. Index: CombatTest01.cpp =================================================================== RCS file: /cvsroot/ogs/dist/c++/test/CombatTest01.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CombatTest01.cpp 14 Feb 2003 21:15:24 -0000 1.2 --- CombatTest01.cpp 29 Mar 2003 02:31:34 -0000 1.3 *************** *** 29,33 **** #include <ogs/core/Creature.h> #include <ogs/Combat.h> ! #include <ogs/creatures/Human.h> #include <ogs/cclasses/Fighter.h> //#include <ogs/items/Dagger.h> --- 29,33 ---- #include <ogs/core/Creature.h> #include <ogs/Combat.h> ! #include <ogs/creatures/humanoids/Human.h> #include <ogs/cclasses/Fighter.h> //#include <ogs/items/Dagger.h> *************** *** 37,41 **** using namespace ogs::combat; using namespace ogs::combat::actions; ! using namespace ogs::creatures; using namespace ogs::cclasses; --- 37,41 ---- using namespace ogs::combat; using namespace ogs::combat::actions; ! using namespace ogs::creatures::humanoids; using namespace ogs::cclasses; |