You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(4) |
Nov
(2) |
Dec
(5) |
---|
Update of /cvsroot/wett-p2p/org/wettp2p/creature In directory sc8-pr-cvs1:/tmp/cvs-serv26005 Modified Files: .nbattrs Creature.java HitPoints.java Added Files: AbilityScoresTest.java CreatureBase.java CreatureBaseTest.java CreatureList.java SavesTest.java Log Message: Modifications to creature, this shouldn't break anything --- NEW FILE: AbilityScoresTest.java --- /* Copyright (C) 2002 Heather Cousineau This program 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 program 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 */ /* * AbilityScoresTest.java * NetBeans JUnit based test * * Created on December 9, 2002, 6:37 PM */ package org.wettp2p.creature; import junit.framework.*; import org.netbeans.junit.*; /** Test. * @author Zyrca */ public class AbilityScoresTest extends NbTestCase { /** Test. * @param testName Test. */ public AbilityScoresTest(java.lang.String testName) { super(testName); } /** Test. * @param args Test. */ public static void main(java.lang.String[] args) { junit.textui.TestRunner.run(suite()); } /** Test of setAll method, of class org.wettp2p.creature.AbilityScores. */ public void testSetAll() { System.out.println("testSetAll"); AbilityScores as = new AbilityScores(); as.setAll(15, 10, 11,9, 8, 8); if(as.getStr().getCurrent() != 15) fail("Str should be 15, it is: " + as.getStr().getCurrent()); if(as.getDex().getCurrent() != 10) fail("Dex should be 10, it is: " + as.getDex().getCurrent()); if(as.getCon().getCurrent() != 11) fail("Con should be 11, it is: " + as.getCon().getCurrent()); if(as.getInt().getCurrent() != 9) fail("Int should be 9, it is: " + as.getInt().getCurrent()); if(as.getWis().getCurrent() != 8) fail("Wis should be 8, it is: " + as.getWis().getCurrent()); if(as.getCha().getCurrent() != 8) fail("Cha should be 8, it is: " + as.getCha().getCurrent()); } public static Test suite() { TestSuite suite = new NbTestSuite(AbilityScoresTest.class); return suite; } } --- NEW FILE: CreatureBase.java --- /* Copyright (C) 2002 Heather Cousineau This program 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 program 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 */ /* * Creature.java * * Created on October 20, 2002, 12:07 PM */ package org.wettp2p.creature; import org.wettp2p.intelligentagents.*; import java.util.List; import java.util.LinkedList; /** A Creature, such as a Human, Elf or Dragon. * * @author Zyrca */ public class CreatureBase { protected Agent myCombatAgent; // Creature tree nodes /** The creature "above" the this creature, in social structure, command, or just * the creature that this creature tends to follow. */ protected CreatureBase myLeader; /** The list of creatures that follows this creature. */ protected List myFollowers; // Description /** Creature's name. */ protected String myName; /** The name of the player that controls this creature. */ protected String myPlayerName; /** The creature's alignment. */ protected Alignment myAlig; /** Creature's class. */ protected String myCreatureClass; /** Creature's race. */ protected String myRace; /** Other information, such as a biography, that doesn't fit anywhere else. */ protected String myOtherInfo; /** Creature's size. */ protected CreatureSize mySize; // Stats /** Creature's Hit Points. */ protected HitPoints myHitPoints; /** Creature's Ability Scores. */ protected AbilityScores myAbilityScores; /** Creature's Level, or Hit Dice. */ protected Stat myLevel; /** Creature's xp. */ protected Stat myXP; /** Creature's saving throws. */ protected Saves mySaves; /** Creature's armor class. */ protected ArmorClass myAC; /** Creature's speed. */ protected int mySpeed; // In feet // Combat /** Creature's initiative. */ protected DieRollAdj myInitiative; /** Creature's melee modification. */ protected DieRollAdj myMeleeMod; /** Creatures ranged modification. */ protected DieRollAdj myRangedMod; /** All of the weapons that this creature has on it. */ protected List myWeapons; /** Creates a new instance of Creature */ protected CreatureBase() { myAlig = new Alignment(); myAbilityScores = new AbilityScores(); myLevel = new Stat("Level", "LVL"); myXP = new Stat("Experience Points", "XP"); mySaves = new Saves(myAbilityScores); mySize = new CreatureSize(); myAC = new ArmorClass(); mySpeed = 30; myInitiative = new DieRollAdj("Initiative", "INIT", myAbilityScores.getDex()); myMeleeMod = new DieRollAdj("Melee Attack Mod", "Melee", myAbilityScores.getStr()); myRangedMod = new DieRollAdj("Ranged Attack Mod", "Ranged", myAbilityScores.getDex()); myHitPoints = new HitPoints(myLevel, myAbilityScores.getCon()); myWeapons = new LinkedList(); myCombatAgent = null; } /** Sets the name of the player in control of the creature * @param PlayerName Name of the player. */ //protected final void setPlayerName(String PlayerName){ myPlayerName = PlayerName; } /** Sets the name of the creature * @param Name Name of Creature. */ //protected final void setName( String Name ) { myName = Name; } /** Sets the class of the creature * @param CreatureClass Creature Class. */ //protected final void setCreatureClass( String CreatureClass ) { myCreatureClass = CreatureClass; } /** Sets the race of the creature * @param Race Creature race, such as "Elf" or "Owl Bear". */ //protected final void setRace( String Race ) { myRace = Race; } /** Sets the string of other details about the creature * @param OtherInfo Other information about the creature that doesn't fit anywhere else. */ //protected final void setOtherInfo( String OtherInfo ) { myOtherInfo = OtherInfo; } /** Sets the creature's size. * Use the constants in Creature Size for the size value. * @param critterSize CreatureSize constant. */ //protected final void setCreatureSize( int critterSize ) { mySize.setSize( critterSize ); } /** Sets the creature's size object * @param critterSize CreatureSize object. */ //protected final void setCreatureSize( CreatureSize critterSize ) { mySize = critterSize; } /** Set the creature's speed in feet. (Per round) * @param speed Speed, in feet. */ //protected final void setSpeed( int speed ) { mySpeed = speed; } /** Player in control. * @return Returns the name of the player in control of the creature */ //protected final String getPlayerName(){ return myPlayerName; } /** <CODE>AbilityScores</CODE>. * @return Returns a <CODE>AbilityScores</CODE> object with the creature's ability scores */ protected final AbilityScores getAbilityScores() { return myAbilityScores; } /** Name of Creature. * @return Returns the name of the creature. */ //protected final String getName() { return myName; } /** Creature's Class, such as "Sorcerer" or "Beast". * @return Returns the class of the creature. */ //protected final String getCreatureClass() { return myCreatureClass; } /** Race of a creature, such as "Elf" or "Dragon". * @return Returns the race of the creature. */ //protected final String getRace() { return myRace; } /** Misc details. * @return Returns the string of other details about the creature. */ //protected final String getOtherInfo() { return myOtherInfo; } /** Creature's level. * @return Returns the creature's level. */ protected final Stat getLevel() { return myLevel; } /** Creature's Armor Class. * @return Returns the creature's Armor Class. */ protected final ArmorClass getAC() { return myAC; } /** Get the speed that the creature can move in a round. (In Feet) * @return The creature's speed in feet. */ //protected final int getSpeed() { return mySpeed; } /** Experience Points. * @return Returns the creature's Experience Points. */ protected final Stat getXP() { return myXP; } /** Creature Size. * @return Returns the creature's Size Object */ protected final CreatureSize getSize() { return mySize; } /** Initiative Modifier. * @return The initiative modifier Stat for the creature. */ protected final DieRollAdj getInitiative() { return myInitiative; } /** Hit Points. * @return The HitPoints object for this creature. */ protected final HitPoints getHitPoints() { return myHitPoints; } /** Get the creature's saves object. * @return Saves object. */ protected final Saves getSaves() { return mySaves; } protected final Agent getMyCombatAgent() { return myCombatAgent; } protected final void setMyCombatAgent(Agent combatAgent){ myCombatAgent = combatAgent; } } --- NEW FILE: CreatureBaseTest.java --- /* Copyright (C) 2002 Heather Cousineau This program 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 program 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 */ /* * CreatureTest.java * NetBeans JUnit based test * * Created on October 20, 2002, 12:14 PM */ package org.wettp2p.creature; import java.util.List; import java.util.LinkedList; import junit.framework.*; import org.netbeans.junit.*; /** Test <CODE>Creature</CODE> class. * @author Zyrca */ public class CreatureBaseTest extends NbTestCase { /** Test <CODE>Creature</CODE> class. * @param testName The name of the test. */ public CreatureBaseTest(java.lang.String testName) { super(testName); } /** Test <CODE>Creature</CODE> class. * @param args No args required. */ public static void main(java.lang.String[] args) { junit.textui.TestRunner.run(suite()); } /** Test of PlayerName method, of class org.wettp2p.creature.Creature. */ public void testPlayerName() { System.out.println("org.wettp2p.creature.Creature.testPlayerName"); Creature critter = new Creature(); critter.setPlayerName("Heather"); // Make sure the player name works correctly if(((String)critter.getPlayerName()).compareTo("Heather") != 0) fail("Player name was not saved correctly"); } /** Test of DescriptionObject, of class org.wettp2p.creature.Creature. */ public void testDescriptionObject() { System.out.println("org.wettp2p.creature.Creature.testDescriptionObject"); Creature critter = new Creature(); // Make sure the description object is referenced correctly critter.setName("Zyrca"); if(critter.getName().compareTo("Zyrca") != 0) fail("The description object's name value is not saved correctly."); } /** Test of AbilityScoresObject, of class org.wettp2p.creature.Creature. */ public void testAbilityScoresObject() { System.out.println("org.wettp2p.creature.Creature.testAbilityScoresObject"); Creature critter = new Creature(); // Make sure the AbilitieScores object is referenced correctly critter.getAbilityScores().getStr().setBaseStat(10); if(critter.getAbilityScores().getStr().getBaseStat() != 10) fail("The AbilityScores object's name value is not saved correctly."); } /** Test of getName method, of class org.wettp2p.creature.Description. */ public void testDescription() { System.out.println("org.wettp2p.creature.Creature.testDescription"); Creature critter = new Creature(); critter.setName("Zyrca"); critter.setCreatureClass("Bard"); critter.setRace("Elf"); critter.setOtherInfo("Singing forest humanoid"); if((critter.getName()).compareTo("Zyrca") != 0) fail("Creature name was changed"); if((critter.getCreatureClass()).compareTo("Bard") != 0) fail("Creature class was changed"); if((critter.getRace()).compareTo("Elf") != 0) fail("Creature race was changed"); if((critter.getOtherInfo()).compareTo("Singing forest humanoid") != 0) fail("Creature information was changed"); } /** Test the weapon interaction with CreatureBase */ public void testWeapon(){ System.out.println("org.wettp2p.creature.Creature.testWeapon"); Creature critter = new Creature(); Weapon greatAxe = new Weapon(); StatAdjuster sa = new HitPointAdjuster(); greatAxe.setDamage(sa); greatAxe.setDescription("Great Axe"); greatAxe.setDamageDice("1d12+3"); int greatAxeIDX = critter.addWeapon(greatAxe); if(critter.getWeapon(greatAxeIDX).getDescription().compareTo("Great Axe") != 0) fail("Weapon was not added or retreived properly"); } public static Test suite() { TestSuite suite = new NbTestSuite(CreatureBaseTest.class); return suite; } } --- NEW FILE: CreatureList.java --- /* * CreatureList.java * * Created on December 12, 2002, 10:52 AM */ package org.wettp2p.creature; import java.util.ArrayList; /** CreatureList is simply a convience class so you don't have to cast the creature * objects every time you access them. * @author Zyrca */ public class CreatureList extends ArrayList{ /** Creates a new instance of CreatureList */ public CreatureList() { super(); } /** Get the creature as index idx. * @param idx The index of the Creature. * @return The Creature object at the index idx. */ public Creature getCreature(int idx) { return (Creature)super.get(idx); } /** Set the Creature object at an existing index idx. * @param idx The index of the Creature you are setting. * @param critter The Creature object that you are setting. * @return The resulting Creature Object. */ public Creature setCreature(int idx, Creature critter) { return (Creature)super.set(idx, critter); } } --- NEW FILE: SavesTest.java --- /* Copyright (C) 2002 Heather Cousineau This program 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 program 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 */ /* * SavesTest.java * NetBeans JUnit based test * * Created on December 9, 2002, 6:20 PM */ package org.wettp2p.creature; import junit.framework.*; import org.netbeans.junit.*; /** Test. * @author Zyrca */ public class SavesTest extends NbTestCase { /** Test. * @param testName Test. */ public SavesTest(java.lang.String testName) { super(testName); } /** Test. * @param args Test. */ public static void main(java.lang.String[] args) { junit.textui.TestRunner.run(suite()); } /** Test of getFort method, of class org.wettp2p.creature.Saves. */ public void testGetFort() { System.out.println("org.wettp2p.creature.Saves.testGetFort"); Saves s = new Saves(); AbilityScore con = new AbilityScore(); con.setBaseStat(15); s.getFort().setDependentScore(con); if(s.getFort().getCurrent() != 2) fail("Current Fortitude Save should be 2, is: " + s.getFort().getCurrent()); } /** Test of getWill method, of class org.wettp2p.creature.Saves. */ public void testGetWill() { System.out.println("org.wettp2p.creature.Saves.testGetWill"); Saves s = new Saves(); AbilityScore wis = new AbilityScore(); wis.setBaseStat(8); s.getWill().setDependentScore(wis); if(s.getWill().getCurrent() != -1) fail("Current Will Save should be -1, is: " + s.getWill().getCurrent()); } /** Test of getRef method, of class org.wettp2p.creature.Saves. */ public void testGetRef() { System.out.println("org.wettp2p.creature.Saves.testGetRef"); Saves s = new Saves(); AbilityScore dex = new AbilityScore(); dex.setBaseStat(10); s.getRef().setDependentScore(dex); if(s.getRef().getCurrent() != 0) fail("Current Reflex Save should be 0, is: " + s.getRef().getCurrent()); } /** Test of constructor method, of class org.wettp2p.creature.Saves. */ public void testInit() { System.out.println("org.wettp2p.creature.Saves.testInit"); AbilityScores as = new AbilityScores(); Saves s = new Saves(as); as.setAll(15, 10, 11, 9, 8, 8); if(s.getFort().getCurrent() != 0) fail("Current Fortitude Save should be 0, is: " + s.getFort().getCurrent()); if(s.getWill().getCurrent() != -1) fail("Current Will Save should be -1, is: " + s.getWill().getCurrent()); if(s.getRef().getCurrent() != 0) fail("Current Reflex Save should be -1, is: " + s.getRef().getCurrent()); } public static Test suite() { TestSuite suite = new NbTestSuite(SavesTest.class); return suite; } } Index: .nbattrs =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/.nbattrs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** .nbattrs 11 Dec 2002 20:05:54 -0000 1.13 --- .nbattrs 13 Dec 2002 20:03:50 -0000 1.14 *************** *** 14,17 **** --- 14,20 ---- <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="AbilityScoresTest"/> </fileobject> + <fileobject name="HitPoints.java"> + <attr name="class_dependency_org.wettp2p.creature.Stat" stringvalue="HitPoints"/> + </fileobject> <fileobject name="AbilityScoreTest.java"> <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="AbilityScoreTest"/> *************** *** 21,25 **** </fileobject> <fileobject name="Stat.java"> ! <attr name="EA-OpenIDE-Connection" serialvalue="aced0005737200146a6176612e7574696c2e4c696e6b65644c6973740c29535d4a60882203000078707704000000047372002a6f72672e6f70656e6964652e6c6f61646572732e436f6e6e656374696f6e537570706f72742450616972055f8af6f04a3bd80200024c00047479706574002b4c6f72672f6f70656e6964652f636f6f6b6965732f436f6e6e656374696f6e436f6f6b696524547970653b4c000576616c75657400124c6a6176612f6c616e672f4f626a6563743b78707372002e6f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661436f6e6e656374696f6e732454797065a83dd01001306d7402000149000666696c746572787000000050737200436f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661446174614f626a6563742450657273697374656e74436f6e6e656374696f6e48616e646c65ba16f1d2dd4c1cb60200014c000e646174614e6f646548616e646c6574001f4c6f72672f6f70656e6964652f6e6f6465732f4e6f64652448616e646c653b7870737200296f72672e6f70656e6964652e6c6f61646572732e446174614e6f6465244f626a65637448616e646c655bd0f82e01811d2e0200025a0005636c6f6e654c00036f626a7400244c6f72672f6f70656e6964652f66696c6573797374656d732f46696c654f626a6563743b787000737200326f72672e6f70656e6964652e66696c6573797374656d732e416273747261637446696c654f626a656374245265706c616365896fa1bce4b5219f0200024c000866696c654e616d657400124c6a6176612f6c616e672f537472696e673b4c000666734e616d6571007e000f78707400266f72672f776574747032702f63726561747572652f4162696c69747953636f72652e6a61766174004c433a2f446f63756d656e747320616e642053657474696e67732f486561746865722f4d7920446f63756d656e74732f50726f6772616d732f736f75726365666f7267652f776574742d7032707371007e00027371007e0006000000507371007e00087371007e000b007371007e000e7400246f72672f776574747032702f63726561747572652f446965526f6c6c41646a2e6a61766171007e00127371007e00027371007e0006000000507371007e00087371007e000b007371007e000e7400236f72672f776574747032702f63726561747572652f486974506f696e74732e6a61766171007e00127371007e00027371007e0006000000507371007e00087371007e000b007371007e000e7400246f72672f776574747032702f63726561747572652f41726d6f72436c6173732e6a61766171007e001278"/> </fileobject> <fileobject name="HitPointsTest.java"> --- 24,28 ---- </fileobject> <fileobject name="Stat.java"> ! <attr name="EA-OpenIDE-Connection" serialvalue="aced0005737200146a6176612e7574696c2e4c696e6b65644c6973740c29535d4a60882203000078707704000000047372002a6f72672e6f70656e6964652e6c6f61646572732e436f6e6e656374696f6e537570706f72742450616972055f8af6f04a3bd80200024c00047479706574002b4c6f72672f6f70656e6964652f636f6f6b6965732f436f6e6e656374696f6e436f6f6b696524547970653b4c000576616c75657400124c6a6176612f6c616e672f4f626a6563743b78707372002e6f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661436f6e6e656374696f6e732454797065a83dd01001306d7402000149000666696c746572787000000050737200436f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661446174614f626a6563742450657273697374656e74436f6e6e656374696f6e48616e646c65ba16f1d2dd4c1cb60200014c000e646174614e6f646548616e646c6574001f4c6f72672f6f70656e6964652f6e6f6465732f4e6f64652448616e646c653b7870737200296f72672e6f70656e6964652e6c6f61646572732e446174614e6f6465244f626a65637448616e646c655bd0f82e01811d2e0200025a0005636c6f6e654c00036f626a7400244c6f72672f6f70656e6964652f66696c6573797374656d732f46696c654f626a6563743b787000737200326f72672e6f70656e6964652e66696c6573797374656d732e416273747261637446696c654f626a656374245265706c616365896fa1bce4b5219f0200024c000866696c654e616d657400124c6a6176612f6c616e672f537472696e673b4c000666734e616d6571007e000f78707400266f72672f776574747032702f63726561747572652f4162696c69747953636f72652e6a61766174004c433a2f446f63756d656e747320616e642053657474696e67732f486561746865722f4d7920446f63756d656e74732f50726f6772616d732f736f75726365666f7267652f776574742d7032707371007e00027371007e0006000000507371007e00087371007e000b007371007e000e7400246f72672f776574747032702f63726561747572652f446965526f6c6c41646a2e6a61766171007e00127371007e00027371007e0006000000507371007e00087371007e000b007371007e000e7400246f72672f776574747032702f63726561747572652f41726d6f72436c6173732e6a61766171007e00127371007e00027371007e0006000000507371007e00087371007e000b007371007e000e7400236f72672f776574747032702f63726561747572652f486974506f696e74732e6a61766171007e001278"/> </fileobject> <fileobject name="HitPointsTest.java"> *************** *** 32,35 **** --- 35,41 ---- <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="StatTest"/> </fileobject> + <fileobject name="CreatureList.java"> + <attr name="class_dependency_java.util.ArrayList" stringvalue="CreatureList"/> + </fileobject> <fileobject name="HitPointAdjusterTest.java"> <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="HitPointAdjusterTest"/> *************** *** 47,61 **** <attr name="EA-OpenIDE-Connection" serialvalue="aced0005737200146a6176612e7574696c2e4c696e6b65644c6973740c29535d4a608822030000787077040000000078"/> </fileobject> - <fileobject name="SavesTestTest.java"> - <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="SimpleNbJUnitTest"/> - </fileobject> <fileobject name="CreatureSizeTest.java"> <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="CreatureSizeTest"/> </fileobject> ! <fileobject name="SavesTest.java"> ! <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="SavesTest"/> </fileobject> <fileobject name="Creature.java"> <attr name="class_dependency_org.wettp2p.creature.CreatureBase" stringvalue="Creature"/> </fileobject> <fileobject name="AlignmentTest.java"> --- 53,67 ---- <attr name="EA-OpenIDE-Connection" serialvalue="aced0005737200146a6176612e7574696c2e4c696e6b65644c6973740c29535d4a608822030000787077040000000078"/> </fileobject> <fileobject name="CreatureSizeTest.java"> <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="CreatureSizeTest"/> </fileobject> ! <fileobject name="SavesTestTest.java"> ! <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="SimpleNbJUnitTest"/> </fileobject> <fileobject name="Creature.java"> <attr name="class_dependency_org.wettp2p.creature.CreatureBase" stringvalue="Creature"/> + </fileobject> + <fileobject name="SavesTest.java"> + <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="SavesTest"/> </fileobject> <fileobject name="AlignmentTest.java"> Index: Creature.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/Creature.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Creature.java 11 Dec 2002 20:05:55 -0000 1.11 --- Creature.java 13 Dec 2002 20:03:51 -0000 1.12 *************** *** 25,28 **** --- 25,29 ---- package org.wettp2p.creature; import java.util.List; + import org.wettp2p.intelligentagents.*; /** Container class for all creature information, such as stats, ability scores, *************** *** 69,72 **** --- 70,77 ---- } + public int getStrMod(){ + return super.getAbilityScores().getStr().getModifier(); + } + /** Set the dexterity base. * @param dex Current adjusted dexterity *************** *** 82,85 **** --- 87,94 ---- } + public int getDexMod(){ + return super.getAbilityScores().getDex().getModifier(); + } + /** Set the constitution base. * @param Con Current adjusted constituion *************** *** 95,98 **** --- 104,111 ---- } + public int getConMod(){ + return super.getAbilityScores().getCon().getModifier(); + } + /** Set the inteligence base. * @param intl Current adjusted inteligence *************** *** 108,111 **** --- 121,128 ---- } + public int getIntMod(){ + return super.getAbilityScores().getInt().getModifier(); + } + /** Set the wisdom base. * @param wis Current adjusted wisdom *************** *** 119,122 **** --- 136,143 ---- public int getWis(){ return super.getAbilityScores().getWis().getCurrent(); + } + + public int getWisMod(){ + return super.getAbilityScores().getWis().getModifier(); } *************** *** 134,137 **** --- 155,162 ---- } + public int getChaMod(){ + return super.getAbilityScores().getCha().getModifier(); + } + /** Set the name of the creature. * @param cName The creature's name. *************** *** 315,318 **** --- 340,354 ---- } + public boolean isStable(){ + return super.getHitPoints().isStable(); + } + + public void setIsStable(boolean stable){ + super.getHitPoints().setIsStable(stable); + } + + public void adjHP(int adj){ + super.getHitPoints().adjAdj(adj); + } /** If a particular weapon has been marked as the favored one, then return that * weapon. If none have been marked, looks for the first melee weapon starting at *************** *** 326,330 **** } else { List weapons = getWeapons(); ! for(int i = weapons.size(); i >= 0; i--){ if(((Weapon)weapons.get(i)).IsMelee()) return (Weapon)weapons.get(i); --- 362,366 ---- } else { List weapons = getWeapons(); ! for(int i = (weapons.size()-1); i >= 0; i--){ if(((Weapon)weapons.get(i)).IsMelee()) return (Weapon)weapons.get(i); *************** *** 486,488 **** --- 522,532 ---- } + + public Agent getCombatAgent(){ return super.myCombatAgent; } + public void setCombatAgent(Agent combatAgent){ + super.myCombatAgent = combatAgent; + } + + public int getMeleeMod() { return super.myMeleeMod.getCurrent(); } + public int getRangedMod(){ return super.myRangedMod.getCurrent(); } } Index: HitPoints.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/HitPoints.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** HitPoints.java 9 Dec 2002 20:13:33 -0000 1.6 --- HitPoints.java 13 Dec 2002 20:03:51 -0000 1.7 *************** *** 37,40 **** --- 37,41 ---- private AbilityScore myCon; private Stat myLevel; + private boolean isStable; /** Tha character is alive and kicking. */ *************** *** 91,95 **** myStatName = "Hit Points"; myStatAbbrev = "HP"; ! myCon = Constitution; } --- 92,110 ---- myStatName = "Hit Points"; myStatAbbrev = "HP"; ! myCon = Constitution; ! // This only matters if the character is dying. So we set it ! // to false by default. ! isStable = false; ! } ! ! public boolean isStable(){ ! if(this.health() == DYING) ! return isStable; ! else ! return true; ! } ! ! public void setIsStable(boolean stable){ ! isStable = stable; } |
From: <zy...@us...> - 2002-12-11 20:06:31
|
Update of /cvsroot/wett-p2p/org/wettp2p/creature In directory sc8-pr-cvs1:/tmp/cvs-serv2091 Modified Files: .nbattrs AbilityScoreTest.java AlignmentTest.java ArmorClassTest.java Creature.java CreatureSizeTest.java DieRollAdjTest.java HitPointAdjusterTest.java HitPointsTest.java StatTest.java Log Message: Moved more stuff around in Creature and CreatureBase. Index: .nbattrs =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/.nbattrs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** .nbattrs 10 Dec 2002 04:49:37 -0000 1.12 --- .nbattrs 11 Dec 2002 20:05:54 -0000 1.13 *************** *** 8,29 **** <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="SubdualAdjusterTest"/> </fileobject> ! <fileobject name="AbilityScore.java"> ! <attr name="class_dependency_org.wettp2p.creature.Stat" stringvalue="AbilityScore"/> </fileobject> <fileobject name="AbilityScoresTest.java"> <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="AbilityScoresTest"/> </fileobject> - <fileobject name="CreatureSuite.java"> - <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="CreatureSuite"/> - </fileobject> - <fileobject name="ArmorClass.java"> - <attr name="class_dependency_org.wettp2p.creature.Stat" stringvalue="ArmorClass"/> - </fileobject> - <fileobject name="HitPoints.java"> - <attr name="class_dependency_org.wettp2p.creature.Stat" stringvalue="HitPoints"/> - </fileobject> - <fileobject name="TemporaryHitPointAdjusterTest.java"> - <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="TemporaryHitPointAdjusterTest"/> - </fileobject> <fileobject name="AbilityScoreTest.java"> <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="AbilityScoreTest"/> --- 8,17 ---- <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="SubdualAdjusterTest"/> </fileobject> ! <fileobject name="AbilityScoresTestTest.java"> ! <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="SimpleNbJUnitTest"/> </fileobject> <fileobject name="AbilityScoresTest.java"> <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="AbilityScoresTest"/> </fileobject> <fileobject name="AbilityScoreTest.java"> <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="AbilityScoreTest"/> *************** *** 38,47 **** <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="HitPointsTest"/> </fileobject> <fileobject name="StatTest.java"> <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="StatTest"/> </fileobject> - <fileobject name="SubdualAdjuster.java"> - <attr name="class_dependency_org.wettp2p.creature.StatAdjuster" stringvalue="SubdualAdjuster"/> - </fileobject> <fileobject name="HitPointAdjusterTest.java"> <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="HitPointAdjusterTest"/> --- 26,35 ---- <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="HitPointsTest"/> </fileobject> + <fileobject name="AbilityScoreTestTest.java"> + <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="SimpleNbJUnitTest"/> + </fileobject> <fileobject name="StatTest.java"> <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="StatTest"/> </fileobject> <fileobject name="HitPointAdjusterTest.java"> <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="HitPointAdjusterTest"/> *************** *** 56,75 **** <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="SimpleNbJUnitTest"/> </fileobject> - <fileobject name="WeaponTest.java"> - <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="WeaponTest"/> - </fileobject> - <fileobject name="Alignment.java"> - <attr name="class_dependency_java.lang.Comparable" stringvalue="Alignment"/> - </fileobject> <fileobject name="DieRollAdj.java"> <attr name="EA-OpenIDE-Connection" serialvalue="aced0005737200146a6176612e7574696c2e4c696e6b65644c6973740c29535d4a608822030000787077040000000078"/> ! <attr name="class_dependency_org.wettp2p.creature.Stat" stringvalue="DieRollAdj"/> </fileobject> <fileobject name="CreatureSizeTest.java"> <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="CreatureSizeTest"/> </fileobject> - <fileobject name="HitPointAdjuster.java"> - <attr name="class_dependency_org.wettp2p.creature.StatAdjuster" stringvalue="HitPointAdjuster"/> - </fileobject> <fileobject name="SavesTest.java"> <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="SavesTest"/> --- 44,56 ---- <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="SimpleNbJUnitTest"/> </fileobject> <fileobject name="DieRollAdj.java"> <attr name="EA-OpenIDE-Connection" serialvalue="aced0005737200146a6176612e7574696c2e4c696e6b65644c6973740c29535d4a608822030000787077040000000078"/> ! </fileobject> ! <fileobject name="SavesTestTest.java"> ! <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="SimpleNbJUnitTest"/> </fileobject> <fileobject name="CreatureSizeTest.java"> <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="CreatureSizeTest"/> </fileobject> <fileobject name="SavesTest.java"> <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="SavesTest"/> *************** *** 83,92 **** <fileobject name="DieRollAdjTest.java"> <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="DieRollAdjTest"/> - </fileobject> - <fileobject name="TemporaryHitPointAdjuster.java"> - <attr name="class_dependency_org.wettp2p.creature.StatAdjuster" stringvalue="TemporaryHitPointAdjuster"/> - </fileobject> - <fileobject name="CreatureSize.java"> - <attr name="class_dependency_java.lang.Comparable" stringvalue="CreatureSize"/> </fileobject> </attributes> --- 64,67 ---- Index: AbilityScoreTest.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/AbilityScoreTest.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** AbilityScoreTest.java 10 Dec 2002 04:49:37 -0000 1.6 --- AbilityScoreTest.java 11 Dec 2002 20:05:55 -0000 1.7 *************** *** 48,60 **** } - /** The Suite. - * @return Returns the Test Suite. - */ - public static Test suite() { - TestSuite suite = new NbTestSuite(AbilityScoreTest.class); - - return suite; - } - /** Test of getModifier method, of class org.wettp2p.creature.AbilityScore. */ --- 48,51 ---- *************** *** 107,109 **** --- 98,107 ---- fail("Ability Score Mod: " + as.getModifier() + " but should be 5"); } + + public static Test suite() { + TestSuite suite = new NbTestSuite(AbilityScoreTest.class); + + return suite; + } + } Index: AlignmentTest.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/AlignmentTest.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AlignmentTest.java 9 Dec 2002 20:13:33 -0000 1.4 --- AlignmentTest.java 11 Dec 2002 20:05:55 -0000 1.5 *************** *** 212,222 **** } - /** Test suite for class <CODE>Alignment</CODE>. - * @return Returns the test suite. - */ public static Test suite() { TestSuite suite = new NbTestSuite(AlignmentTest.class); return suite; ! } } --- 212,222 ---- } public static Test suite() { TestSuite suite = new NbTestSuite(AlignmentTest.class); return suite; ! } ! ! ! } Index: ArmorClassTest.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/ArmorClassTest.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ArmorClassTest.java 10 Dec 2002 04:49:37 -0000 1.4 --- ArmorClassTest.java 11 Dec 2002 20:05:55 -0000 1.5 *************** *** 48,60 **** } - /** Test - * @return Test - */ - public static Test suite() { - TestSuite suite = new NbTestSuite(ArmorClassTest.class); - - return suite; - } - /** Test the default values of the class org.wettp2p.creature.ArmorClass. */ public void testDefaults() { --- 48,51 ---- *************** *** 125,128 **** --- 116,125 ---- } + public static Test suite() { + TestSuite suite = new NbTestSuite(ArmorClassTest.class); + + return suite; + } + } Index: Creature.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/Creature.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Creature.java 10 Dec 2002 04:49:37 -0000 1.10 --- Creature.java 11 Dec 2002 20:05:55 -0000 1.11 *************** *** 134,137 **** --- 134,163 ---- } + /** Set the name of the creature. + * @param cName The creature's name. + */ + public void setCreatureName(String cName){ + super.myName = cName; + } + /** Get the creature's name. + * @return The creature's name. + */ + public String getCreatureName(){ + return super.myName; + } + + /** Set the player's name. + * @param pName The player's name. + */ + public void setPlayerName(String pName){ + super.myPlayerName = pName; + } + /** Get the player's name. + * @return The player's name. + */ + public String getPlayerName(){ + return super.myPlayerName; + } + /** Set the creature's total hit points. * @param HP Total hit points. *************** *** 146,149 **** --- 172,191 ---- return super.getHitPoints().getCurrent(); } + /** Get the HP status. + * + * The constats are found in the class org.wettp2p.HitPoints. + * The values are: NORMAL, STAGGERED, DIABLED, UNCONSCIOUS, DYING and DEAD. + * @return Hit point status. + */ + public int getHPStatus(){ + return super.getHitPoints().health(); + } + /** The string representing the creature's hit point status, such as "Dead" or + * "Dying". + * @return The creature's hit point status in a string. + */ + public String getHPStatusStr(){ + return super.getHitPoints().healthStr(); + } /** Set the creature's bonus to armor class from armor. *************** *** 171,174 **** --- 213,219 ---- super.getAC().setBaseStat(baseAC); } + public void setWisAsBonusToAC(){ + super.getAC().setAltDep(super.getAbilityScores().getWis()); + } /** Get the current adjusted armor class for the creature. * @return Current adjusted Armor Class. *************** *** 177,180 **** --- 222,232 ---- return super.getAC().getAC(); } + /** Get the creature's flatfooted AC, which is the creature's AC without the + * dexterity modifier. + * @return Flatfooted AC. + */ + public int getFlatFootedAC(){ + return super.getAC().getFlatFootedAC(); + } /** Set the base saving throws of all three saving throws. *************** *** 271,277 **** public Weapon getFavoredMeleeWeapon(){ if(myFavoredMeleeIdx != -1){ ! return super.getWeapon( myFavoredMeleeIdx ); } else { ! List weapons = super.getWeapons(); for(int i = weapons.size(); i >= 0; i--){ if(((Weapon)weapons.get(i)).IsMelee()) --- 323,329 ---- public Weapon getFavoredMeleeWeapon(){ if(myFavoredMeleeIdx != -1){ ! return getWeapon( myFavoredMeleeIdx ); } else { ! List weapons = getWeapons(); for(int i = weapons.size(); i >= 0; i--){ if(((Weapon)weapons.get(i)).IsMelee()) *************** *** 289,295 **** public Weapon getFavoredRangedWeapon(){ if(myFavoredMeleeIdx != -1){ ! return super.getWeapon( myFavoredRangedIdx ); } else { ! List weapons = super.getWeapons(); for(int i = weapons.size(); i >= 0; i--){ if(((Weapon)weapons.get(i)).IsRanged()) --- 341,347 ---- public Weapon getFavoredRangedWeapon(){ if(myFavoredMeleeIdx != -1){ ! return getWeapon( myFavoredRangedIdx ); } else { ! List weapons = getWeapons(); for(int i = weapons.size(); i >= 0; i--){ if(((Weapon)weapons.get(i)).IsRanged()) *************** *** 329,331 **** --- 381,488 ---- } + /** Sets the name of the creature + * @param Name Name of Creature. + */ + public void setName( String Name ) { + super.myName = Name; + } + /** Sets the class of the creature + * @param CreatureClass Creature Class. + */ + public void setCreatureClass( String CreatureClass ) { + super.myCreatureClass = CreatureClass; + } + /** Sets the race of the creature + * @param Race Creature race, such as "Elf" or "Owl Bear". + */ + public void setRace( String Race ) { + super.myRace = Race; + } + /** Sets the string of other details about the creature + * @param OtherInfo Other information about the creature that doesn't fit anywhere else. + */ + public void setOtherInfo( String OtherInfo ) { + super.myOtherInfo = OtherInfo; + } + /** Sets the creature's size. + * Use the constants in Creature Size for the size value. + * @param critterSize CreatureSize constant. + */ + public void setCreatureSize( int critterSize ) { + super.mySize.setSize( critterSize ); + } + /** Sets the creature's size object + * @param critterSize CreatureSize object. + */ + public void setCreatureSize( CreatureSize critterSize ) { + super.mySize = critterSize; + } + /** Set the creature's speed in feet. (Per round) + * @param speed Speed, in feet. + */ + public void setSpeed( int speed ) { + super.mySpeed = speed; + } + + /** Name of Creature. + * @return Returns the name of the creature. + */ + public String getName() { + return super.myName; + } + /** Creature's Class, such as "Sorcerer" or "Beast". + * @return Returns the class of the creature. + */ + public String getCreatureClass() { + return super.myCreatureClass; + } + /** Race of a creature, such as "Elf" or "Dragon". + * @return Returns the race of the creature. + */ + public String getRace() { + return super.myRace; + } + /** Misc details. + * @return Returns the string of other details about the creature. + */ + public String getOtherInfo() { + return super.myOtherInfo; + } + /** Get the speed that the creature can move in a round. (In Feet) + * @return The creature's speed in feet. + */ + public int getSpeed() { + return super.mySpeed; + } + + /** Get all of the weapons that the creature is carrying. + * @return A List of Weapon objects. + */ + public List getWeapons() { + return super.myWeapons; + } + /** Get a particular weapon. + * @param idx The weapon's index in the List. + * @return A Weapon object. + */ + public Weapon getWeapon(int idx) { + return (Weapon)super.myWeapons.get(idx); + } + /** Add a Weapon object to the List of weapons this creature is carrying. + * @param weap A Weapon object. + * @return The index of the weapon you just added. + */ + public int addWeapon(Weapon weap) { + super.myWeapons.add(weap); + return super.myWeapons.indexOf(weap); + } + + public int getInitModifier(){ + return super.getInitiative().getCurrent(); + } + + public void setInitBaseModifier(int baseInitiative){ + super.getInitiative().setBaseStat(baseInitiative); + } + } Index: CreatureSizeTest.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/CreatureSizeTest.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CreatureSizeTest.java 9 Dec 2002 20:13:33 -0000 1.4 --- CreatureSizeTest.java 11 Dec 2002 20:05:55 -0000 1.5 *************** *** 49,61 **** } - /** Test <CODE>CreatureSize</CODE>. - * @return Test suite. - */ - public static Test suite() { - TestSuite suite = new NbTestSuite(CreatureSizeTest.class); - - return suite; - } - /** Test default values of class org.wettp2p.creature.CreatureSize. */ public void testDefaults(){ --- 49,52 ---- *************** *** 160,162 **** --- 151,160 ---- fail("Set Size did not set the creature's size properly."); } + + public static Test suite() { + TestSuite suite = new NbTestSuite(CreatureSizeTest.class); + + return suite; + } + } Index: DieRollAdjTest.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/DieRollAdjTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DieRollAdjTest.java 9 Dec 2002 20:13:33 -0000 1.3 --- DieRollAdjTest.java 11 Dec 2002 20:05:55 -0000 1.4 *************** *** 48,60 **** } - /** Test <CODE>DieRollAdj</CODE>. - * @return The test suite. - */ - public static Test suite() { - TestSuite suite = new NbTestSuite(DieRollAdjTest.class); - - return suite; - } - /** Test default values of class org.wettp2p.creature.DieRollAdj. */ public void testDefaults(){ --- 48,51 ---- *************** *** 110,113 **** --- 101,111 ---- } + + public static Test suite() { + TestSuite suite = new NbTestSuite(DieRollAdjTest.class); + + return suite; + } + } Index: HitPointAdjusterTest.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/HitPointAdjusterTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** HitPointAdjusterTest.java 9 Dec 2002 20:13:33 -0000 1.3 --- HitPointAdjusterTest.java 11 Dec 2002 20:05:55 -0000 1.4 *************** *** 48,60 **** } - /** Test. - * @return Test. - */ - public static Test suite() { - TestSuite suite = new NbTestSuite(HitPointAdjusterTest.class); - - return suite; - } - /** Test of inflict method, of class org.wettp2p.creature.HitPointAdjuster. */ public void testDamage() { --- 48,51 ---- *************** *** 126,129 **** --- 117,125 ---- } + public static Test suite() { + TestSuite suite = new NbTestSuite(HitPointAdjusterTest.class); + + return suite; + } } Index: HitPointsTest.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/HitPointsTest.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** HitPointsTest.java 9 Dec 2002 20:13:33 -0000 1.5 --- HitPointsTest.java 11 Dec 2002 20:05:55 -0000 1.6 *************** *** 48,60 **** } - /** Test - * @return Test - */ - public static Test suite() { - TestSuite suite = new NbTestSuite(HitPointsTest.class); - - return suite; - } - /** Test default values of class org.wettp2p.creature.HitPoints. */ public void testDefaultBaseHP(){ --- 48,51 ---- *************** *** 226,229 **** --- 217,227 ---- } + public static Test suite() { + TestSuite suite = new NbTestSuite(HitPointsTest.class); + + return suite; + } + + } Index: StatTest.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/StatTest.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** StatTest.java 9 Dec 2002 20:13:33 -0000 1.5 --- StatTest.java 11 Dec 2002 20:05:55 -0000 1.6 *************** *** 48,60 **** } - /** Test the <CODE>Stat</CODE> class. - * @return Test suite. - */ - public static Test suite() { - TestSuite suite = new NbTestSuite(StatTest.class); - - return suite; - } - /** Test the default values of the class org.wettp2p.creature.Stat. */ public void testDefaults() { --- 48,51 ---- *************** *** 113,116 **** } ! } --- 104,112 ---- } ! public static Test suite() { ! TestSuite suite = new NbTestSuite(StatTest.class); ! ! return suite; ! } ! } |
From: <zy...@us...> - 2002-12-10 04:49:41
|
Update of /cvsroot/wett-p2p/org/wettp2p/creature In directory sc8-pr-cvs1:/tmp/cvs-serv13604 Modified Files: .nbattrs AbilityScoreTest.java AbilityScores.java ArmorClass.java ArmorClassTest.java Creature.java CreatureSuite.java TemporaryHitPointAdjuster.java TemporaryHitPointAdjusterTest.java Log Message: * Renamed the Creature class to CreatureBase, then made a Creature class which extends CreatureBase and has all sorts of nice methods for manipulating the creature's stats since the strutrue of creature was very non-intuitive. * Added a list of weapons to the CreatureBase class. * Added test classes for AbilityScores and Saves. * Various other minor additions that I can't recall now. Index: .nbattrs =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/.nbattrs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** .nbattrs 9 Dec 2002 20:13:33 -0000 1.11 --- .nbattrs 10 Dec 2002 04:49:37 -0000 1.12 *************** *** 2,14 **** <!DOCTYPE attributes PUBLIC "-//NetBeans//DTD DefaultAttributes 1.0//EN" "http://www.netbeans.org/dtds/attributes-1_0.dtd"> <attributes version="1.0"> - <fileobject name="SubdualAdjusterTest.java"> - <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="SubdualAdjusterTest"/> - </fileobject> <fileobject name="StatAdjuster.java"> <attr name="EA-OpenIDE-Connection" serialvalue="aced0005737200146a6176612e7574696c2e4c696e6b65644c6973740c29535d4a60882203000078707704000000037372002a6f72672e6f70656e6964652e6c6f61646572732e436f6e6e656374696f6e537570706f72742450616972055f8af6f04a3bd80200024c00047479706574002b4c6f72672f6f70656e6964652f636f6f6b6965732f436f6e6e656374696f6e436f6f6b696524547970653b4c000576616c75657400124c6a6176612f6c616e672f4f626a6563743b78707372002e6f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661436f6e6e656374696f6e732454797065a83dd01001306d7402000149000666696c746572787000000050737200436f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661446174614f626a6563742450657273697374656e74436f6e6e656374696f6e48616e646c65ba16f1d2dd4c1cb60200014c000e646174614e6f646548616e646c6574001f4c6f72672f6f70656e6964652f6e6f6465732f4e6f64652448616e646c653b7870737200296f72672e6f70656e6964652e6c6f61646572732e446174614e6f6465244f626a65637448616e646c655bd0f82e01811d2e0200025a0005636c6f6e654c00036f626a7400244c6f72672f6f70656e6964652f66696c6573797374656d732f46696c654f626a6563743b787000737200326f72672e6f70656e6964652e66696c6573797374656d732e416273747261637446696c654f626a656374245265706c616365896fa1bce4b5219f0200024c000866696c654e616d657400124c6a6176612f6c616e672f537472696e673b4c000666734e616d6571007e000f787074002a6f72672f776574747032702f63726561747572652f486974506f696e7441646a75737465722e6a61766174004c433a2f446f63756d656e747320616e642053657474696e67732f486561746865722f4d7920446f63756d656e74732f50726f6772616d732f736f75726365666f7267652f776574742d7032707371007e00027371007e0006000000507371007e00087371007e000b007371007e000e7400296f72672f776574747032702f63726561747572652f5375626475616c41646a75737465722e6a61766171007e00127371007e00027371007e0006000000507371007e00087371007e000b007371007e000e7400336f72672f776574747032702f63726561747572652f54656d706f72617279486974506f696e7441646a75737465722e6a61766171007e001278"/> </fileobject> <fileobject name="AbilityScore.java"> <attr name="class_dependency_org.wettp2p.creature.Stat" stringvalue="AbilityScore"/> </fileobject> <fileobject name="CreatureSuite.java"> <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="CreatureSuite"/> --- 2,17 ---- <!DOCTYPE attributes PUBLIC "-//NetBeans//DTD DefaultAttributes 1.0//EN" "http://www.netbeans.org/dtds/attributes-1_0.dtd"> <attributes version="1.0"> <fileobject name="StatAdjuster.java"> <attr name="EA-OpenIDE-Connection" serialvalue="aced0005737200146a6176612e7574696c2e4c696e6b65644c6973740c29535d4a60882203000078707704000000037372002a6f72672e6f70656e6964652e6c6f61646572732e436f6e6e656374696f6e537570706f72742450616972055f8af6f04a3bd80200024c00047479706574002b4c6f72672f6f70656e6964652f636f6f6b6965732f436f6e6e656374696f6e436f6f6b696524547970653b4c000576616c75657400124c6a6176612f6c616e672f4f626a6563743b78707372002e6f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661436f6e6e656374696f6e732454797065a83dd01001306d7402000149000666696c746572787000000050737200436f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661446174614f626a6563742450657273697374656e74436f6e6e656374696f6e48616e646c65ba16f1d2dd4c1cb60200014c000e646174614e6f646548616e646c6574001f4c6f72672f6f70656e6964652f6e6f6465732f4e6f64652448616e646c653b7870737200296f72672e6f70656e6964652e6c6f61646572732e446174614e6f6465244f626a65637448616e646c655bd0f82e01811d2e0200025a0005636c6f6e654c00036f626a7400244c6f72672f6f70656e6964652f66696c6573797374656d732f46696c654f626a6563743b787000737200326f72672e6f70656e6964652e66696c6573797374656d732e416273747261637446696c654f626a656374245265706c616365896fa1bce4b5219f0200024c000866696c654e616d657400124c6a6176612f6c616e672f537472696e673b4c000666734e616d6571007e000f787074002a6f72672f776574747032702f63726561747572652f486974506f696e7441646a75737465722e6a61766174004c433a2f446f63756d656e747320616e642053657474696e67732f486561746865722f4d7920446f63756d656e74732f50726f6772616d732f736f75726365666f7267652f776574742d7032707371007e00027371007e0006000000507371007e00087371007e000b007371007e000e7400296f72672f776574747032702f63726561747572652f5375626475616c41646a75737465722e6a61766171007e00127371007e00027371007e0006000000507371007e00087371007e000b007371007e000e7400336f72672f776574747032702f63726561747572652f54656d706f72617279486974506f696e7441646a75737465722e6a61766171007e001278"/> </fileobject> + <fileobject name="SubdualAdjusterTest.java"> + <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="SubdualAdjusterTest"/> + </fileobject> <fileobject name="AbilityScore.java"> <attr name="class_dependency_org.wettp2p.creature.Stat" stringvalue="AbilityScore"/> </fileobject> + <fileobject name="AbilityScoresTest.java"> + <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="AbilityScoresTest"/> + </fileobject> <fileobject name="CreatureSuite.java"> <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="CreatureSuite"/> *************** *** 17,34 **** <attr name="class_dependency_org.wettp2p.creature.Stat" stringvalue="ArmorClass"/> </fileobject> - <fileobject name="TemporaryHitPointAdjusterTest.java"> - <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="TemporaryHitPointAdjusterTest"/> - </fileobject> <fileobject name="HitPoints.java"> <attr name="class_dependency_org.wettp2p.creature.Stat" stringvalue="HitPoints"/> </fileobject> <fileobject name="AbilityScoreTest.java"> <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="AbilityScoreTest"/> </fileobject> ! <fileobject name="CreatureTest.java"> ! <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="CreatureTest"/> </fileobject> <fileobject name="Stat.java"> ! <attr name="EA-OpenIDE-Connection" serialvalue="aced0005737200146a6176612e7574696c2e4c696e6b65644c6973740c29535d4a60882203000078707704000000047372002a6f72672e6f70656e6964652e6c6f61646572732e436f6e6e656374696f6e537570706f72742450616972055f8af6f04a3bd80200024c00047479706574002b4c6f72672f6f70656e6964652f636f6f6b6965732f436f6e6e656374696f6e436f6f6b696524547970653b4c000576616c75657400124c6a6176612f6c616e672f4f626a6563743b78707372002e6f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661436f6e6e656374696f6e732454797065a83dd01001306d7402000149000666696c746572787000000050737200436f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661446174614f626a6563742450657273697374656e74436f6e6e656374696f6e48616e646c65ba16f1d2dd4c1cb60200014c000e646174614e6f646548616e646c6574001f4c6f72672f6f70656e6964652f6e6f6465732f4e6f64652448616e646c653b7870737200296f72672e6f70656e6964652e6c6f61646572732e446174614e6f6465244f626a65637448616e646c655bd0f82e01811d2e0200025a0005636c6f6e654c00036f626a7400244c6f72672f6f70656e6964652f66696c6573797374656d732f46696c654f626a6563743b787000737200326f72672e6f70656e6964652e66696c6573797374656d732e416273747261637446696c654f626a656374245265706c616365896fa1bce4b5219f0200024c000866696c654e616d657400124c6a6176612f6c616e672f537472696e673b4c000666734e616d6571007e000f78707400266f72672f776574747032702f63726561747572652f4162696c69747953636f72652e6a61766174004c433a2f446f63756d656e747320616e642053657474696e67732f486561746865722f4d7920446f63756d656e74732f50726f6772616d732f736f75726365666f7267652f776574742d7032707371007e00027371007e0006000000507371007e00087371007e000b007371007e000e7400246f72672f776574747032702f63726561747572652f41726d6f72436c6173732e6a61766171007e00127371007e00027371007e0006000000507371007e00087371007e000b007371007e000e7400246f72672f776574747032702f63726561747572652f446965526f6c6c41646a2e6a61766171007e00127371007e00027371007e0006000000507371007e00087371007e000b007371007e000e7400236f72672f776574747032702f63726561747572652f486974506f696e74732e6a61766171007e001278"/> </fileobject> <fileobject name="HitPointsTest.java"> --- 20,37 ---- <attr name="class_dependency_org.wettp2p.creature.Stat" stringvalue="ArmorClass"/> </fileobject> <fileobject name="HitPoints.java"> <attr name="class_dependency_org.wettp2p.creature.Stat" stringvalue="HitPoints"/> </fileobject> + <fileobject name="TemporaryHitPointAdjusterTest.java"> + <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="TemporaryHitPointAdjusterTest"/> + </fileobject> <fileobject name="AbilityScoreTest.java"> <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="AbilityScoreTest"/> </fileobject> ! <fileobject name="CreatureBase.java"> ! <attr name="EA-OpenIDE-Connection" serialvalue="aced0005737200146a6176612e7574696c2e4c696e6b65644c6973740c29535d4a60882203000078707704000000017372002a6f72672e6f70656e6964652e6c6f61646572732e436f6e6e656374696f6e537570706f72742450616972055f8af6f04a3bd80200024c00047479706574002b4c6f72672f6f70656e6964652f636f6f6b6965732f436f6e6e656374696f6e436f6f6b696524547970653b4c000576616c75657400124c6a6176612f6c616e672f4f626a6563743b78707372002e6f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661436f6e6e656374696f6e732454797065a83dd01001306d7402000149000666696c746572787000000050737200436f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661446174614f626a6563742450657273697374656e74436f6e6e656374696f6e48616e646c65ba16f1d2dd4c1cb60200014c000e646174614e6f646548616e646c6574001f4c6f72672f6f70656e6964652f6e6f6465732f4e6f64652448616e646c653b7870737200296f72672e6f70656e6964652e6c6f61646572732e446174614e6f6465244f626a65637448616e646c655bd0f82e01811d2e0200025a0005636c6f6e654c00036f626a7400244c6f72672f6f70656e6964652f66696c6573797374656d732f46696c654f626a6563743b787000737200326f72672e6f70656e6964652e66696c6573797374656d732e416273747261637446696c654f626a656374245265706c616365896fa1bce4b5219f0200024c000866696c654e616d657400124c6a6176612f6c616e672f537472696e673b4c000666734e616d6571007e000f78707400226f72672f776574747032702f63726561747572652f43726561747572652e6a61766174004c433a2f446f63756d656e747320616e642053657474696e67732f486561746865722f4d7920446f63756d656e74732f50726f6772616d732f736f75726365666f7267652f776574742d70327078"/> </fileobject> <fileobject name="Stat.java"> ! <attr name="EA-OpenIDE-Connection" serialvalue="aced0005737200146a6176612e7574696c2e4c696e6b65644c6973740c29535d4a60882203000078707704000000047372002a6f72672e6f70656e6964652e6c6f61646572732e436f6e6e656374696f6e537570706f72742450616972055f8af6f04a3bd80200024c00047479706574002b4c6f72672f6f70656e6964652f636f6f6b6965732f436f6e6e656374696f6e436f6f6b696524547970653b4c000576616c75657400124c6a6176612f6c616e672f4f626a6563743b78707372002e6f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661436f6e6e656374696f6e732454797065a83dd01001306d7402000149000666696c746572787000000050737200436f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661446174614f626a6563742450657273697374656e74436f6e6e656374696f6e48616e646c65ba16f1d2dd4c1cb60200014c000e646174614e6f646548616e646c6574001f4c6f72672f6f70656e6964652f6e6f6465732f4e6f64652448616e646c653b7870737200296f72672e6f70656e6964652e6c6f61646572732e446174614e6f6465244f626a65637448616e646c655bd0f82e01811d2e0200025a0005636c6f6e654c00036f626a7400244c6f72672f6f70656e6964652f66696c6573797374656d732f46696c654f626a6563743b787000737200326f72672e6f70656e6964652e66696c6573797374656d732e416273747261637446696c654f626a656374245265706c616365896fa1bce4b5219f0200024c000866696c654e616d657400124c6a6176612f6c616e672f537472696e673b4c000666734e616d6571007e000f78707400266f72672f776574747032702f63726561747572652f4162696c69747953636f72652e6a61766174004c433a2f446f63756d656e747320616e642053657474696e67732f486561746865722f4d7920446f63756d656e74732f50726f6772616d732f736f75726365666f7267652f776574742d7032707371007e00027371007e0006000000507371007e00087371007e000b007371007e000e7400246f72672f776574747032702f63726561747572652f446965526f6c6c41646a2e6a61766171007e00127371007e00027371007e0006000000507371007e00087371007e000b007371007e000e7400236f72672f776574747032702f63726561747572652f486974506f696e74732e6a61766171007e00127371007e00027371007e0006000000507371007e00087371007e000b007371007e000e7400246f72672f776574747032702f63726561747572652f41726d6f72436c6173732e6a61766171007e001278"/> </fileobject> <fileobject name="HitPointsTest.java"> *************** *** 47,50 **** --- 50,56 ---- <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="ArmorClassTest"/> </fileobject> + <fileobject name="CreatureBaseTest.java"> + <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="CreatureBaseTest"/> + </fileobject> <fileobject name="CreatureTestTest.java"> <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="SimpleNbJUnitTest"/> *************** *** 57,62 **** </fileobject> <fileobject name="DieRollAdj.java"> - <attr name="class_dependency_org.wettp2p.creature.Stat" stringvalue="DieRollAdj"/> <attr name="EA-OpenIDE-Connection" serialvalue="aced0005737200146a6176612e7574696c2e4c696e6b65644c6973740c29535d4a608822030000787077040000000078"/> </fileobject> <fileobject name="CreatureSizeTest.java"> --- 63,68 ---- </fileobject> <fileobject name="DieRollAdj.java"> <attr name="EA-OpenIDE-Connection" serialvalue="aced0005737200146a6176612e7574696c2e4c696e6b65644c6973740c29535d4a608822030000787077040000000078"/> + <attr name="class_dependency_org.wettp2p.creature.Stat" stringvalue="DieRollAdj"/> </fileobject> <fileobject name="CreatureSizeTest.java"> *************** *** 65,68 **** --- 71,80 ---- <fileobject name="HitPointAdjuster.java"> <attr name="class_dependency_org.wettp2p.creature.StatAdjuster" stringvalue="HitPointAdjuster"/> + </fileobject> + <fileobject name="SavesTest.java"> + <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="SavesTest"/> + </fileobject> + <fileobject name="Creature.java"> + <attr name="class_dependency_org.wettp2p.creature.CreatureBase" stringvalue="Creature"/> </fileobject> <fileobject name="AlignmentTest.java"> Index: AbilityScoreTest.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/AbilityScoreTest.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** AbilityScoreTest.java 9 Dec 2002 20:13:33 -0000 1.5 --- AbilityScoreTest.java 10 Dec 2002 04:49:37 -0000 1.6 *************** *** 107,111 **** fail("Ability Score Mod: " + as.getModifier() + " but should be 5"); } - - } --- 107,109 ---- Index: AbilityScores.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/AbilityScores.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** AbilityScores.java 9 Dec 2002 20:13:33 -0000 1.5 --- AbilityScores.java 10 Dec 2002 04:49:37 -0000 1.6 *************** *** 47,50 **** --- 47,67 ---- } + /** A method to set all of the base ability scores. + * @param str The base Strength score + * @param dex The base Dexterity score + * @param con The base Constitution score + * @param intl The base Inteligence score + * @param wis The base Wisdom score + * @param cha The base Charisma score + */ + public void setAll(int str, int dex, int con, int intl, int wis, int cha){ + myStr.setBaseStat(str); + myDex.setBaseStat(dex); + myCon.setBaseStat(con); + myInt.setBaseStat(intl); + myWis.setBaseStat(wis); + myCha.setBaseStat(cha); + } + /** Strength. * @return Returns the <CODE>AbilityScore</CODE> Object for Strength Index: ArmorClass.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/ArmorClass.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ArmorClass.java 9 Dec 2002 20:13:33 -0000 1.4 --- ArmorClass.java 10 Dec 2002 04:49:37 -0000 1.5 *************** *** 32,35 **** --- 32,36 ---- private int myArmor; private int myShield; + private int myDexCap; // -1 is flag case for no cap private AbilityScore myDex; private AbilityScore myAltDependency; *************** *** 37,43 **** /** Creates a new instance of ArmorClass */ public ArmorClass() { ! initialize(10, 0, 0, 0, new AbilityScore(), new AbilityScore()); } /** Creates a new instance of ArmorClass * @param base The base armor class. This value is 10 by default. * @param adj The adjustment to the armor class. This value is 0 by default. --- 38,46 ---- /** Creates a new instance of ArmorClass */ public ArmorClass() { ! initialize(10, 0, 0, 0, -1, new AbilityScore(), new AbilityScore()); } /** Creates a new instance of ArmorClass + * @param dexCap The maximum dexterity bonus you can receive to your Armor class. (This is used + * in the current AC calculation) * @param base The base armor class. This value is 10 by default. * @param adj The adjustment to the armor class. This value is 0 by default. *************** *** 47,54 **** * your armor class. */ ! public ArmorClass(int base, int adj, int armor, int shield, AbilityScore dex){ ! initialize(base, adj, armor, shield, dex, new AbilityScore()); } /** Creates a new instance of ArmorClass * @param base The base armor class. This value is 10 by default. * @param adj The adjustment to the armor class. This value is 0 by default. --- 50,59 ---- * your armor class. */ ! public ArmorClass(int base, int adj, int armor, int shield, int dexCap, AbilityScore dex){ ! initialize(base, adj, armor, shield, dexCap, dex, new AbilityScore()); } /** Creates a new instance of ArmorClass + * @param dexCap The maximum dexterity bonus you can receive to your Armor class. (This is used + * in the current AC calculation) * @param base The base armor class. This value is 10 by default. * @param adj The adjustment to the armor class. This value is 0 by default. *************** *** 64,75 **** * wisdom modifier. */ ! public ArmorClass(int base, int adj, int armor, int shield, AbilityScore dex, AbilityScore altDep) { ! initialize(base, adj, armor, shield, dex, altDep); } /** Initializes the values for the object * @param base See ArmorClass constructor for details. * @param adj See ArmorClass constructor for details. --- 69,82 ---- * wisdom modifier. */ ! public ArmorClass(int base, int adj, int armor, int shield, int dexCap, AbilityScore dex, AbilityScore altDep) { ! initialize(base, adj, armor, shield, dexCap, dex, altDep); } /** Initializes the values for the object + * @param dexCap The maximum dexterity bonus you can receive to your Armor class. (This is used + * in the current AC calculation) * @param base See ArmorClass constructor for details. * @param adj See ArmorClass constructor for details. *************** *** 80,84 **** */ protected void initialize(int base, int adj, int armor, int shield, ! AbilityScore dex, AbilityScore altDep) { myStatName = "Armor Class"; --- 87,91 ---- */ protected void initialize(int base, int adj, int armor, int shield, ! int dexCap, AbilityScore dex, AbilityScore altDep) { myStatName = "Armor Class"; *************** *** 90,93 **** --- 97,101 ---- myShield = shield; myDex = dex; + myDexCap = dexCap; myAltDependency = altDep; } *************** *** 97,101 **** */ public int getStat(){ ! return myStat + myAdj + myArmor + myShield + myDex.getModifier() + myAltDependency.getModifier(); } --- 105,124 ---- */ public int getStat(){ ! int dexMod = myDex.getModifier(); ! ! // There is a dexterity cap due to armor and ! // your dexterity modifier is larger then that ! // cap, so reduce your dexterity mod to the ! // cap ammount. ! if(( myDexCap != -1 ) && ( dexMod > myDexCap )){ ! dexMod = myDexCap; ! } ! ! return myStat + ! myAdj + ! myArmor + ! myShield + ! dexMod + ! myAltDependency.getModifier(); } *************** *** 165,168 **** --- 188,198 ---- public void setDex( AbilityScore dex ){ myDex = dex; + } + /** Set the dexterity cap. + * @param dexCap The maximum dexterity bonus you can receive to your Armor class. (This is used + * in the current AC calculation) + */ + public void setDexCap( int dexCap ){ + myDexCap = dexCap; } Index: ArmorClassTest.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/ArmorClassTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ArmorClassTest.java 9 Dec 2002 20:13:33 -0000 1.3 --- ArmorClassTest.java 10 Dec 2002 04:49:37 -0000 1.4 *************** *** 82,86 **** AbilityScore dex = new AbilityScore("Dexterity", "DEX", 10); ! ArmorClass ac = new ArmorClass(10, 0, 3, 1, dex); if(ac.getAC() != 14) fail("Armor class calculated incorrectly, should be 14, is: " + ac.getAC()); --- 82,86 ---- AbilityScore dex = new AbilityScore("Dexterity", "DEX", 10); ! ArmorClass ac = new ArmorClass(10, 0, 3, 1, -1, dex); if(ac.getAC() != 14) fail("Armor class calculated incorrectly, should be 14, is: " + ac.getAC()); *************** *** 94,100 **** AbilityScore dex = new AbilityScore("Dexterity", "DEX", 18); AbilityScore wis = new AbilityScore("Wisdom", "WIS", 15); ! ArmorClass ac = new ArmorClass(10, 0, 3, 1, dex); ! ac = new ArmorClass(10, 0, 0, 0, dex, wis); if(ac.getStat() != 16) fail("Armor class calculated incorrectly, should be 16, is: " + ac.getAC()); --- 94,100 ---- AbilityScore dex = new AbilityScore("Dexterity", "DEX", 18); AbilityScore wis = new AbilityScore("Wisdom", "WIS", 15); ! ArmorClass ac; ! ac = new ArmorClass(10, 0, 0, 0, -1, dex, wis); if(ac.getStat() != 16) fail("Armor class calculated incorrectly, should be 16, is: " + ac.getAC()); *************** *** 107,115 **** AbilityScore dex = new AbilityScore("Dexterity", "DEX", 18); AbilityScore wis = new AbilityScore("Wisdom", "WIS", 15); ! ArmorClass ac = new ArmorClass(10, 0, 0, 0, dex, wis); if(ac.getFlatFootedAC() != 12) fail("Armor class calculated incorrectly, should be 12, is: " + ac.getAC());; } } --- 107,128 ---- AbilityScore dex = new AbilityScore("Dexterity", "DEX", 18); AbilityScore wis = new AbilityScore("Wisdom", "WIS", 15); ! ArmorClass ac = new ArmorClass(10, 0, 0, 0, -1, dex, wis); if(ac.getFlatFootedAC() != 12) fail("Armor class calculated incorrectly, should be 12, is: " + ac.getAC());; } + + /** Test of testDexCap method, of class org.wettp2p.creature.ArmorClass. */ + public void testDexCap(){ + System.out.println("org.wettp2p.creature.ArmorClass.testDexCap"); + + AbilityScore dex = new AbilityScore("Dexterity", "DEX", 18); + AbilityScore wis = new AbilityScore("Wisdom", "WIS", 15); + ArmorClass ac = new ArmorClass(10, 0, 0, 0, 2, dex, wis); + + if(ac.getAC() != 14) + fail("Armor class calculated incorrectly, should be 14, is: " + ac.getAC());; + } + } Index: Creature.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/Creature.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Creature.java 9 Dec 2002 20:13:33 -0000 1.9 --- Creature.java 10 Dec 2002 04:49:37 -0000 1.10 *************** *** 20,158 **** * Creature.java * ! * Created on October 20, 2002, 12:07 PM */ package org.wettp2p.creature; - import java.util.List; - import java.util.LinkedList; ! /** A Creature, such as a Human, Elf or Dragon. * ! * @author Zyrca */ ! public class Creature { ! // Creature tree nodes ! private Creature myLeader; ! private List myFollowers; ! // Description ! private String myName; ! private String myPlayerName; ! private Alignment myAlig; ! private String myCreatureClass; ! private String myRace; ! private String myOtherInfo; ! private CreatureSize mySize; ! // Stats ! private HitPoints myHitPoints; ! private AbilityScores myAbilityScores; ! private Stat myLevel; ! private Stat myXP; ! private Saves mySaves; ! private ArmorClass myAC; ! // Combat ! private DieRollAdj myInitiative; ! private DieRollAdj myMeleeMod; ! private DieRollAdj myRangedMod; ! ! /** Creates a new instance of Creature */ public Creature() { ! myAlig = new Alignment(); ! myAbilityScores = new AbilityScores(); ! myLevel = new Stat("Level", "LVL"); ! myXP = new Stat("Experience Points", "XP"); ! mySaves = new Saves(myAbilityScores); ! mySize = new CreatureSize(); ! myAC = new ArmorClass(); ! myInitiative = new DieRollAdj("Initiative", "INIT", myAbilityScores.getDex()); ! myMeleeMod = new DieRollAdj("Melee Attack Mod", "Melee", myAbilityScores.getStr()); ! myRangedMod = new DieRollAdj("Ranged Attack Mod", "Ranged", myAbilityScores.getDex()); ! ! myHitPoints = new HitPoints(myLevel, myAbilityScores.getCon()); } - - /** Sets the name of the player in control of the creature - * @param PlayerName Name of the player. - */ - public void setPlayerName(String PlayerName){ myPlayerName = PlayerName; } - /** Sets the name of the creature - * @param Name Name of Creature. - */ - public void setName( String Name ) { myName = Name; } - /** Sets the class of the creature - * @param CreatureClass Creature Class. - */ - public void setCreatureClass( String CreatureClass ) { myCreatureClass = CreatureClass; } - /** Sets the race of the creature - * @param Race Creature race, such as "Elf" or "Owl Bear". - */ - public void setRace( String Race ) { myRace = Race; } - /** Sets the string of other details about the creature - * @param OtherInfo Other information about the creature that doesn't fit anywhere else. - */ - public void setOtherInfo( String OtherInfo ) { myOtherInfo = OtherInfo; } - /** Sets the creature's size. - * Use the constants in Creature Size for the size value. - * @param critterSize CreatureSize constant. - */ - public void setCreatureSize( int critterSize ) { mySize.setSize( critterSize ); } - /** Sets the creature's size object - * @param critterSize CreatureSize object. - */ - public void setCreatureSize( CreatureSize critterSize ) { mySize = critterSize; } ! /** Player in control. ! * @return Returns the name of the player in control of the creature ! */ ! public String getPlayerName(){ return myPlayerName; } ! /** <CODE>AbilityScores</CODE>. ! * @return Returns a <CODE>AbilityScores</CODE> object with the creature's ability scores ! */ ! public AbilityScores getAbilityScores() { return myAbilityScores; } ! /** Name of Creature. ! * @return Returns the name of the creature. ! */ ! public String getName() { return myName; } ! /** Creature's Class, such as "Sorcerer" or "Beast". ! * @return Returns the class of the creature. ! */ ! public String getCreatureClass() { return myCreatureClass; } ! /** Race of a creature, such as "Elf" or "Dragon". ! * @return Returns the race of the creature. ! */ ! public String getRace() { return myRace; } ! /** Misc details. ! * @return Returns the string of other details about the creature. ! */ ! public String getOtherInfo() { return myOtherInfo; } ! /** Creature's level. ! * @return Returns the creature's level. ! */ ! public Stat getLevel() { return myLevel; } ! /** Creature's Armor Class. ! * @return Returns the creature's Armor Class. ! */ ! public ArmorClass getAC() { return myAC; } ! /** Experience Points. ! * @return Returns the creature's Experience Points. ! */ ! public Stat getXP() { return myXP; } ! /** Creature Size. ! * @return Returns the creature's Size Object ! */ ! public CreatureSize getSize() { return mySize; } ! /** Initiative Modifier. ! * @return The initiative modifier Stat for the creature. */ ! public DieRollAdj getInitiative() { return myInitiative; } ! /** Hit Points. ! * @return The HitPoints object for this creature. ! */ ! public HitPoints getHitPoints() { return myHitPoints; } ! } --- 20,331 ---- * Creature.java * ! * Created on December 9, 2002, 7:08 PM */ package org.wettp2p.creature; import java.util.List; ! /** Container class for all creature information, such as stats, ability scores, ! * weapons, inventory, spells ... (when it's done!) * ! * This class is acctually a bunch of short cut methods to the data inside ! * CreatureBase, since the syntax for it was confusing ! * @author Zyrca */ ! public class Creature extends CreatureBase { ! private int myFavoredMeleeIdx; ! private int myFavoredRangedIdx; /** Creates a new instance of Creature */ public Creature() { ! super(); ! myFavoredMeleeIdx = -1; ! myFavoredRangedIdx = -1; } + /** Set all of the creature's ability scores at once. + * @param str Strength + * @param dex Dexterity + * @param con Constitution + * @param intl Inteligence + * @param wis Wisdom + * @param cha Charisma + */ + public void setAbilityScores(int str, int dex, int con, int intl, int wis, int cha){ + super.getAbilityScores().setAll(str, dex, con, intl, wis, cha); + } ! /** Set the strength base. ! * @param str Strength */ ! public void setStr(int str){ ! super.getAbilityScores().getStr().setBaseStat(str); ! } ! /** Get the creature's current strength. ! * @return Current adjusted Strength ! */ ! public int getStr(){ ! return super.getAbilityScores().getStr().getCurrent(); ! } + /** Set the dexterity base. + * @param dex Current adjusted dexterity + */ + public void setDex(int dex){ + super.getAbilityScores().getDex().setBaseStat(dex); + } + /** Get the creature's current dexterity. + * @return Current adjusted dexterity + */ + public int getDex(){ + return super.getAbilityScores().getDex().getCurrent(); + } + + /** Set the constitution base. + * @param Con Current adjusted constituion + */ + public void setCon(int Con){ + super.getAbilityScores().getCon().setBaseStat(Con); + } + /** Get the creature's current constituion. + * @return Current adjusted constitution + */ + public int getCon(){ + return super.getAbilityScores().getCon().getCurrent(); + } + + /** Set the inteligence base. + * @param intl Current adjusted inteligence + */ + public void setInt(int intl){ + super.getAbilityScores().getInt().setBaseStat(intl); + } + /** Get the creature's current inteligence. + * @return Current adjusted inteligence + */ + public int getInt(){ + return super.getAbilityScores().getInt().getCurrent(); + } + + /** Set the wisdom base. + * @param wis Current adjusted wisdom + */ + public void setWis(int wis){ + super.getAbilityScores().getWis().setBaseStat(wis); + } + /** Get the creature's current wisdom. + * @return Current adjusted wisdom + */ + public int getWis(){ + return super.getAbilityScores().getWis().getCurrent(); + } + + /** Set the charisma base. + * @param cha Current adjusted charisma + */ + public void setCha(int cha){ + super.getAbilityScores().getCha().setBaseStat(cha); + } + /** Get the creature's current charisma. + * @return Current adjusted charisma + */ + public int getCha(){ + return super.getAbilityScores().getCha().getCurrent(); + } + + /** Set the creature's total hit points. + * @param HP Total hit points. + */ + public void setCurHP(int HP){ + super.getHitPoints().setByTotal(HP); + } + /** Get the creature's current hit points. + * @return Current adjusted hit points. + */ + public int getCurHP(){ + return super.getHitPoints().getCurrent(); + } + + /** Set the creature's bonus to armor class from armor. + * @param armorAC Armor's AC + */ + public void setArmorAC(int armorAC){ + super.getAC().setArmorValue(armorAC); + } + /** Set the creature's bonus to armor class from a shield. + * @param shieldAC Shield AC. + */ + public void setShieldAC(int shieldAC){ + super.getAC().setShieldValue(shieldAC); + } + /** Set the dexterity cap. + * @param dexCap Dexterity Cap from armor. + */ + public void setDexCap(int dexCap){ + super.getAC().setDexCap(dexCap); + } + /** Set the base AC for the creature. + * @param baseAC Base Armor Class + */ + public void setBaseAC(int baseAC){ + super.getAC().setBaseStat(baseAC); + } + /** Get the current adjusted armor class for the creature. + * @return Current adjusted Armor Class. + */ + public int getCurAC(){ + return super.getAC().getAC(); + } + + /** Set the base saving throws of all three saving throws. + * @param fort Fortitude saving throw base + * @param will Will saving throw base + * @param ref Reflex saving throw base + */ + public void setSaveBases(int fort, int will, int ref){ + super.getSaves().getFort().setBaseStat(fort); + super.getSaves().getWill().setBaseStat(will); + super.getSaves().getRef().setBaseStat(ref); + } + /** Set all three saving throws from their total. This is useful if your creature + * information is comming from a monster manual where you are given thier final + * saving throws, but don't know the base saving throws. + * @param fort Fortitude saving throw + * @param ref Reflex saving throw + * @param will Will saving throw + */ + public void setSaveBasesFromTotal(int fort, int ref, int will){ + // Fortitude + super.getSaves().getFort().setBaseStat( + fort - super.getSaves().getFort().getCurrent()); + // Reflex + super.getSaves().getRef().setBaseStat( + ref - super.getSaves().getRef().getCurrent()); + // Will + super.getSaves().getWill().setBaseStat( + will - super.getSaves().getWill().getCurrent()); + } + /** Get the current adjusted fortitude saving throw. + * @return Fortitude roll mod. + */ + public int getFort(){ + return super.getSaves().getFort().getCurrent(); + } + /** Get the current adjusted will saving throw. + * @return Will roll mod. + */ + public int getWill(){ + return super.getSaves().getWill().getCurrent(); + } + /** Get the current adjusted reflex saving throw. + * @return Reflex roll mod. + */ + public int getRef(){ + return super.getSaves().getRef().getCurrent(); + } + + /** Set the creature's level. This value is used in calculating hit points. + * @param level Creature's level. + */ + public void setLevel(int level){ + super.getLevel().setBaseStat(level); + } + /** Same as the creature's level. + * @param hd Number of hit dice the monster has. + */ + public void setHitDice(int hd){ + setLevel(hd); + } + /** Gets the current level. + * @return Current level. + */ + public int getCurLevel(){ + return super.getLevel().getCurrent(); + } + /** Current hit dice (same as level) + * @return Current hit dice. + */ + public int getCurHitDice(){ + return getCurLevel(); + } + + /** Set the hit points from a total value. + * @param totalHP Total hit points. + */ + public void setHPfromTotal(int totalHP){ + super.getHitPoints().setByTotal(totalHP); + } + /** Get the current adjusted hit points. + * @return Current adjusted hit points. + */ + public int getHP(){ + return super.getHitPoints().getCurrent(); + } + /** If a particular weapon has been marked as the favored one, then return that + * weapon. If none have been marked, looks for the first melee weapon starting at + * the end of the List. (The last one added.) This should avoid getting the subdual + * attack with your fists weapon if possible. + * @return Favored melee weapon or the last melee weapon added. + */ + public Weapon getFavoredMeleeWeapon(){ + if(myFavoredMeleeIdx != -1){ + return super.getWeapon( myFavoredMeleeIdx ); + } else { + List weapons = super.getWeapons(); + for(int i = weapons.size(); i >= 0; i--){ + if(((Weapon)weapons.get(i)).IsMelee()) + return (Weapon)weapons.get(i); + } + } + return null; + } + /** If a particular weapon has been marked as the favored one, then return that + * weapon. If none have been marked, looks for the first ranged weapon starting at + * the end of the List. (The last one added.) + * attack with your fists weapon if possible. + * @return Favored melee weapon or the last ranged weapon added. + */ + public Weapon getFavoredRangedWeapon(){ + if(myFavoredMeleeIdx != -1){ + return super.getWeapon( myFavoredRangedIdx ); + } else { + List weapons = super.getWeapons(); + for(int i = weapons.size(); i >= 0; i--){ + if(((Weapon)weapons.get(i)).IsRanged()) + return (Weapon)weapons.get(i); + } + } + + return null; + } + + /** Set the favored weapon based on its index. + * @param idx The index of the favored melee weapon. + */ + public void setFavoredMelee(int idx){ + myFavoredMeleeIdx = idx; + } + /** Set the favored melee weapon by the weapon object. (NOTE: It must be the <B>same</B> + * object as you added to the weapon list, not just an identical one.) + * @param weap A Weapon object. + */ + public void setFavoriteMelee(Weapon weap){ + myFavoredMeleeIdx = myWeapons.indexOf(weap); + } + + /** Set the favored weapon based on its index. + * @param idx The index of the favored ranged weapon. + */ + public void setFavoredRanged(int idx){ + myFavoredRangedIdx = idx; + } + /** Set the favored ranged weapon by the weapon object. (NOTE: It must be the <B>same</B> + * object as you added to the weapon list, not just an identical one.) + * @param weap A Weapon object. + */ + public void setFavoredRanged(Weapon weap){ + myFavoredRangedIdx = myWeapons.indexOf(weap); + } + } Index: CreatureSuite.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/CreatureSuite.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** CreatureSuite.java 9 Dec 2002 20:13:33 -0000 1.8 --- CreatureSuite.java 10 Dec 2002 04:49:37 -0000 1.9 *************** *** 58,62 **** TestSuite suite = new NbTestSuite("CreatureSuite"); suite.addTest(org.wettp2p.creature.AlignmentTest.suite()); ! suite.addTest(org.wettp2p.creature.CreatureTest.suite()); suite.addTest(org.wettp2p.creature.AbilityScoreTest.suite()); suite.addTest(org.wettp2p.creature.StatTest.suite()); --- 58,62 ---- TestSuite suite = new NbTestSuite("CreatureSuite"); suite.addTest(org.wettp2p.creature.AlignmentTest.suite()); ! suite.addTest(org.wettp2p.creature.CreatureBaseTest.suite()); suite.addTest(org.wettp2p.creature.AbilityScoreTest.suite()); suite.addTest(org.wettp2p.creature.StatTest.suite()); *************** *** 69,72 **** --- 69,74 ---- suite.addTest(org.wettp2p.creature.SubdualAdjusterTest.suite()); suite.addTest(org.wettp2p.creature.TemporaryHitPointAdjusterTest.suite()); + suite.addTest(org.wettp2p.creature.SavesTest.suite()); + suite.addTest(org.wettp2p.creature.AbilityScoresTest.suite()); // Not repeat //:JUNIT-- //This value MUST ALWAYS be returned from this function. Index: TemporaryHitPointAdjuster.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/TemporaryHitPointAdjuster.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TemporaryHitPointAdjuster.java 9 Dec 2002 20:13:33 -0000 1.2 --- TemporaryHitPointAdjuster.java 10 Dec 2002 04:49:37 -0000 1.3 *************** *** 25,30 **** package org.wettp2p.creature; ! /** ! * * @author Zyrca */ --- 25,30 ---- package org.wettp2p.creature; ! /** Create an object that can affect a creature's temporary hit points. (Such as a ! * wand that casts a spell to give a creature +5 temporary hit points.) * @author Zyrca */ Index: TemporaryHitPointAdjusterTest.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/TemporaryHitPointAdjusterTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TemporaryHitPointAdjusterTest.java 9 Dec 2002 20:13:33 -0000 1.2 --- TemporaryHitPointAdjusterTest.java 10 Dec 2002 04:49:37 -0000 1.3 *************** *** 29,46 **** import org.netbeans.junit.*; ! /** ! * * @author Zyrca */ public class TemporaryHitPointAdjusterTest extends NbTestCase { public TemporaryHitPointAdjusterTest(java.lang.String testName) { super(testName); } public static void main(java.lang.String[] args) { junit.textui.TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new NbTestSuite(TemporaryHitPointAdjusterTest.class); --- 29,54 ---- import org.netbeans.junit.*; ! /** Test. * @author Zyrca */ public class TemporaryHitPointAdjusterTest extends NbTestCase { + /** Test. + * @param testName Test. + */ public TemporaryHitPointAdjusterTest(java.lang.String testName) { super(testName); } + /** Test. + * @param args Test. + */ public static void main(java.lang.String[] args) { junit.textui.TestRunner.run(suite()); } + /** Test. + * @return Test. + */ public static Test suite() { TestSuite suite = new NbTestSuite(TemporaryHitPointAdjusterTest.class); |
Update of /cvsroot/wett-p2p/org/wettp2p/creature In directory sc8-pr-cvs1:/tmp/cvs-serv18104 Modified Files: .nbattrs AbilityScore.java AbilityScoreTest.java AbilityScores.java Alignment.java AlignmentTest.java ArmorClass.java ArmorClassTest.java Creature.java CreatureSize.java CreatureSizeTest.java CreatureSuite.java CreatureTest.java DieRollAdj.java DieRollAdjTest.java HitPointAdjuster.java HitPointAdjusterTest.java HitPoints.java HitPointsTest.java Saves.java Stat.java StatAdjuster.java StatTest.java SubdualAdjuster.java SubdualAdjusterTest.java TemporaryHitPointAdjuster.java TemporaryHitPointAdjusterTest.java Weapon.java WeaponTest.java Log Message: Added GPL info to the top of all the source files in creature. Index: .nbattrs =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/.nbattrs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** .nbattrs 9 Dec 2002 19:54:04 -0000 1.10 --- .nbattrs 9 Dec 2002 20:13:33 -0000 1.11 *************** *** 2,28 **** <!DOCTYPE attributes PUBLIC "-//NetBeans//DTD DefaultAttributes 1.0//EN" "http://www.netbeans.org/dtds/attributes-1_0.dtd"> <attributes version="1.0"> ! <fileobject name="DieRollAdj.java"> ! <attr name="EA-OpenIDE-Connection" serialvalue="aced0005737200146a6176612e7574696c2e4c696e6b65644c6973740c29535d4a608822030000787077040000000078"/> </fileobject> ! <fileobject name="StatTest.java"> ! <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="StatTest"/> </fileobject> <fileobject name="ArmorClass.java"> <attr name="class_dependency_org.wettp2p.creature.Stat" stringvalue="ArmorClass"/> </fileobject> <fileobject name="HitPoints.java"> <attr name="class_dependency_org.wettp2p.creature.Stat" stringvalue="HitPoints"/> </fileobject> ! <fileobject name="StatAdjuster.java"> ! <attr name="EA-OpenIDE-Connection" serialvalue="aced0005737200146a6176612e7574696c2e4c696e6b65644c6973740c29535d4a60882203000078707704000000037372002a6f72672e6f70656e6964652e6c6f61646572732e436f6e6e656374696f6e537570706f72742450616972055f8af6f04a3bd80200024c00047479706574002b4c6f72672f6f70656e6964652f636f6f6b6965732f436f6e6e656374696f6e436f6f6b696524547970653b4c000576616c75657400124c6a6176612f6c616e672f4f626a6563743b78707372002e6f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661436f6e6e656374696f6e732454797065a83dd01001306d7402000149000666696c746572787000000050737200436f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661446174614f626a6563742450657273697374656e74436f6e6e656374696f6e48616e646c65ba16f1d2dd4c1cb60200014c000e646174614e6f646548616e646c6574001f4c6f72672f6f70656e6964652f6e6f6465732f4e6f64652448616e646c653b7870737200296f72672e6f70656e6964652e6c6f61646572732e446174614e6f6465244f626a65637448616e646c655bd0f82e01811d2e0200025a0005636c6f6e654c00036f626a7400244c6f72672f6f70656e6964652f66696c6573797374656d732f46696c654f626a6563743b787000737200326f72672e6f70656e6964652e66696c6573797374656d732e416273747261637446696c654f626a656374245265706c616365896fa1bce4b5219f0200024c000866696c654e616d657400124c6a6176612f6c616e672f537472696e673b4c000666734e616d6571007e000f787074002a6f72672f776574747032702f63726561747572652f486974506f696e7441646a75737465722e6a61766174004c433a2f446f63756d656e747320616e642053657474696e67732f486561746865722f4d7920446f63756d656e74732f50726f6772616d732f736f75726365666f7267652f776574742d7032707371007e00027371007e0006000000507371007e00087371007e000b007371007e000e7400296f72672f776574747032702f63726561747572652f5375626475616c41646a75737465722e6a61766171007e00127371007e00027371007e0006000000507371007e00087371007e000b007371007e000e7400336f72672f776574747032702f63726561747572652f54656d706f72617279486974506f696e7441646a75737465722e6a61766171007e001278"/> </fileobject> ! <fileobject name="AbilityScore.java"> ! <attr name="class_dependency_org.wettp2p.creature.Stat" stringvalue="AbilityScore"/> </fileobject> <fileobject name="CreatureTestTest.java"> <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="SimpleNbJUnitTest"/> </fileobject> ! <fileobject name="Stat.java"> ! <attr name="EA-OpenIDE-Connection" serialvalue="aced0005737200146a6176612e7574696c2e4c696e6b65644c6973740c29535d4a60882203000078707704000000037372002a6f72672e6f70656e6964652e6c6f61646572732e436f6e6e656374696f6e537570706f72742450616972055f8af6f04a3bd80200024c00047479706574002b4c6f72672f6f70656e6964652f636f6f6b6965732f436f6e6e656374696f6e436f6f6b696524547970653b4c000576616c75657400124c6a6176612f6c616e672f4f626a6563743b78707372002e6f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661436f6e6e656374696f6e732454797065a83dd01001306d7402000149000666696c746572787000000050737200436f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661446174614f626a6563742450657273697374656e74436f6e6e656374696f6e48616e646c65ba16f1d2dd4c1cb60200014c000e646174614e6f646548616e646c6574001f4c6f72672f6f70656e6964652f6e6f6465732f4e6f64652448616e646c653b7870737200296f72672e6f70656e6964652e6c6f61646572732e446174614e6f6465244f626a65637448616e646c655bd0f82e01811d2e0200025a0005636c6f6e654c00036f626a7400244c6f72672f6f70656e6964652f66696c6573797374656d732f46696c654f626a6563743b787000737200326f72672e6f70656e6964652e66696c6573797374656d732e416273747261637446696c654f626a656374245265706c616365896fa1bce4b5219f0200024c000866696c654e616d657400124c6a6176612f6c616e672f537472696e673b4c000666734e616d6571007e000f78707400266f72672f776574747032702f63726561747572652f4162696c69747953636f72652e6a61766174004c433a2f446f63756d656e747320616e642053657474696e67732f486561746865722f4d7920446f63756d656e74732f50726f6772616d732f736f75726365666f7267652f776574742d7032707371007e00027371007e0006000000507371007e00087371007e000b007371007e000e7400246f72672f776574747032702f63726561747572652f41726d6f72436c6173732e6a61766171007e00127371007e00027371007e0006000000507371007e00087371007e000b007371007e000e7400236f72672f776574747032702f63726561747572652f486974506f696e74732e6a61766171007e001278"/> </fileobject> </attributes> --- 2,80 ---- <!DOCTYPE attributes PUBLIC "-//NetBeans//DTD DefaultAttributes 1.0//EN" "http://www.netbeans.org/dtds/attributes-1_0.dtd"> <attributes version="1.0"> ! <fileobject name="SubdualAdjusterTest.java"> ! <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="SubdualAdjusterTest"/> </fileobject> ! <fileobject name="StatAdjuster.java"> ! <attr name="EA-OpenIDE-Connection" serialvalue="aced0005737200146a6176612e7574696c2e4c696e6b65644c6973740c29535d4a60882203000078707704000000037372002a6f72672e6f70656e6964652e6c6f61646572732e436f6e6e656374696f6e537570706f72742450616972055f8af6f04a3bd80200024c00047479706574002b4c6f72672f6f70656e6964652f636f6f6b6965732f436f6e6e656374696f6e436f6f6b696524547970653b4c000576616c75657400124c6a6176612f6c616e672f4f626a6563743b78707372002e6f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661436f6e6e656374696f6e732454797065a83dd01001306d7402000149000666696c746572787000000050737200436f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661446174614f626a6563742450657273697374656e74436f6e6e656374696f6e48616e646c65ba16f1d2dd4c1cb60200014c000e646174614e6f646548616e646c6574001f4c6f72672f6f70656e6964652f6e6f6465732f4e6f64652448616e646c653b7870737200296f72672e6f70656e6964652e6c6f61646572732e446174614e6f6465244f626a65637448616e646c655bd0f82e01811d2e0200025a0005636c6f6e654c00036f626a7400244c6f72672f6f70656e6964652f66696c6573797374656d732f46696c654f626a6563743b787000737200326f72672e6f70656e6964652e66696c6573797374656d732e416273747261637446696c654f626a656374245265706c616365896fa1bce4b5219f0200024c000866696c654e616d657400124c6a6176612f6c616e672f537472696e673b4c000666734e616d6571007e000f787074002a6f72672f776574747032702f63726561747572652f486974506f696e7441646a75737465722e6a61766174004c433a2f446f63756d656e747320616e642053657474696e67732f486561746865722f4d7920446f63756d656e74732f50726f6772616d732f736f75726365666f7267652f776574742d7032707371007e00027371007e0006000000507371007e00087371007e000b007371007e000e7400296f72672f776574747032702f63726561747572652f5375626475616c41646a75737465722e6a61766171007e00127371007e00027371007e0006000000507371007e00087371007e000b007371007e000e7400336f72672f776574747032702f63726561747572652f54656d706f72617279486974506f696e7441646a75737465722e6a61766171007e001278"/> ! </fileobject> ! <fileobject name="AbilityScore.java"> ! <attr name="class_dependency_org.wettp2p.creature.Stat" stringvalue="AbilityScore"/> ! </fileobject> ! <fileobject name="CreatureSuite.java"> ! <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="CreatureSuite"/> </fileobject> <fileobject name="ArmorClass.java"> <attr name="class_dependency_org.wettp2p.creature.Stat" stringvalue="ArmorClass"/> </fileobject> + <fileobject name="TemporaryHitPointAdjusterTest.java"> + <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="TemporaryHitPointAdjusterTest"/> + </fileobject> <fileobject name="HitPoints.java"> <attr name="class_dependency_org.wettp2p.creature.Stat" stringvalue="HitPoints"/> </fileobject> ! <fileobject name="AbilityScoreTest.java"> ! <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="AbilityScoreTest"/> </fileobject> ! <fileobject name="CreatureTest.java"> ! <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="CreatureTest"/> ! </fileobject> ! <fileobject name="Stat.java"> ! <attr name="EA-OpenIDE-Connection" serialvalue="aced0005737200146a6176612e7574696c2e4c696e6b65644c6973740c29535d4a60882203000078707704000000047372002a6f72672e6f70656e6964652e6c6f61646572732e436f6e6e656374696f6e537570706f72742450616972055f8af6f04a3bd80200024c00047479706574002b4c6f72672f6f70656e6964652f636f6f6b6965732f436f6e6e656374696f6e436f6f6b696524547970653b4c000576616c75657400124c6a6176612f6c616e672f4f626a6563743b78707372002e6f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661436f6e6e656374696f6e732454797065a83dd01001306d7402000149000666696c746572787000000050737200436f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661446174614f626a6563742450657273697374656e74436f6e6e656374696f6e48616e646c65ba16f1d2dd4c1cb60200014c000e646174614e6f646548616e646c6574001f4c6f72672f6f70656e6964652f6e6f6465732f4e6f64652448616e646c653b7870737200296f72672e6f70656e6964652e6c6f61646572732e446174614e6f6465244f626a65637448616e646c655bd0f82e01811d2e0200025a0005636c6f6e654c00036f626a7400244c6f72672f6f70656e6964652f66696c6573797374656d732f46696c654f626a6563743b787000737200326f72672e6f70656e6964652e66696c6573797374656d732e416273747261637446696c654f626a656374245265706c616365896fa1bce4b5219f0200024c000866696c654e616d657400124c6a6176612f6c616e672f537472696e673b4c000666734e616d6571007e000f78707400266f72672f776574747032702f63726561747572652f4162696c69747953636f72652e6a61766174004c433a2f446f63756d656e747320616e642053657474696e67732f486561746865722f4d7920446f63756d656e74732f50726f6772616d732f736f75726365666f7267652f776574742d7032707371007e00027371007e0006000000507371007e00087371007e000b007371007e000e7400246f72672f776574747032702f63726561747572652f41726d6f72436c6173732e6a61766171007e00127371007e00027371007e0006000000507371007e00087371007e000b007371007e000e7400246f72672f776574747032702f63726561747572652f446965526f6c6c41646a2e6a61766171007e00127371007e00027371007e0006000000507371007e00087371007e000b007371007e000e7400236f72672f776574747032702f63726561747572652f486974506f696e74732e6a61766171007e001278"/> ! </fileobject> ! <fileobject name="HitPointsTest.java"> ! <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="HitPointsTest"/> ! </fileobject> ! <fileobject name="StatTest.java"> ! <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="StatTest"/> ! </fileobject> ! <fileobject name="SubdualAdjuster.java"> ! <attr name="class_dependency_org.wettp2p.creature.StatAdjuster" stringvalue="SubdualAdjuster"/> ! </fileobject> ! <fileobject name="HitPointAdjusterTest.java"> ! <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="HitPointAdjusterTest"/> ! </fileobject> ! <fileobject name="ArmorClassTest.java"> ! <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="ArmorClassTest"/> </fileobject> <fileobject name="CreatureTestTest.java"> <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="SimpleNbJUnitTest"/> </fileobject> ! <fileobject name="WeaponTest.java"> ! <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="WeaponTest"/> ! </fileobject> ! <fileobject name="Alignment.java"> ! <attr name="class_dependency_java.lang.Comparable" stringvalue="Alignment"/> ! </fileobject> ! <fileobject name="DieRollAdj.java"> ! <attr name="class_dependency_org.wettp2p.creature.Stat" stringvalue="DieRollAdj"/> ! <attr name="EA-OpenIDE-Connection" serialvalue="aced0005737200146a6176612e7574696c2e4c696e6b65644c6973740c29535d4a608822030000787077040000000078"/> ! </fileobject> ! <fileobject name="CreatureSizeTest.java"> ! <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="CreatureSizeTest"/> ! </fileobject> ! <fileobject name="HitPointAdjuster.java"> ! <attr name="class_dependency_org.wettp2p.creature.StatAdjuster" stringvalue="HitPointAdjuster"/> ! </fileobject> ! <fileobject name="AlignmentTest.java"> ! <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="AlignmentTest"/> ! </fileobject> ! <fileobject name="DieRollAdjTest.java"> ! <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="DieRollAdjTest"/> ! </fileobject> ! <fileobject name="TemporaryHitPointAdjuster.java"> ! <attr name="class_dependency_org.wettp2p.creature.StatAdjuster" stringvalue="TemporaryHitPointAdjuster"/> ! </fileobject> ! <fileobject name="CreatureSize.java"> ! <attr name="class_dependency_java.lang.Comparable" stringvalue="CreatureSize"/> </fileobject> </attributes> Index: AbilityScore.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/AbilityScore.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** AbilityScore.java 27 Oct 2002 03:12:09 -0000 1.5 --- AbilityScore.java 9 Dec 2002 20:13:33 -0000 1.6 *************** *** 1,3 **** --- 1,21 ---- /* + Copyright (C) 2002 Heather Cousineau + + This program 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 program 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 + */ + + /* * AbilityScore.java * Index: AbilityScoreTest.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/AbilityScoreTest.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AbilityScoreTest.java 27 Oct 2002 03:12:09 -0000 1.4 --- AbilityScoreTest.java 9 Dec 2002 20:13:33 -0000 1.5 *************** *** 1,3 **** --- 1,21 ---- /* + Copyright (C) 2002 Heather Cousineau + + This program 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 program 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 + */ + + /* * AbilityScoreTest.java * NetBeans JUnit based test Index: AbilityScores.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/AbilityScores.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AbilityScores.java 24 Oct 2002 01:40:16 -0000 1.4 --- AbilityScores.java 9 Dec 2002 20:13:33 -0000 1.5 *************** *** 1,3 **** --- 1,21 ---- /* + Copyright (C) 2002 Heather Cousineau + + This program 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 program 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 + */ + + /* * AbilityScores.java * *************** *** 9,13 **** /** Keeps your 7 basic Ability Scores, Str, Dex, Con, Int, Wis and Cha. * ! * @author Heather */ public class AbilityScores { --- 27,31 ---- /** Keeps your 7 basic Ability Scores, Str, Dex, Con, Int, Wis and Cha. * ! * @author Zyrca */ public class AbilityScores { Index: Alignment.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/Alignment.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Alignment.java 27 Oct 2002 03:12:09 -0000 1.3 --- Alignment.java 9 Dec 2002 20:13:33 -0000 1.4 *************** *** 1,3 **** --- 1,21 ---- /* + Copyright (C) 2002 Heather Cousineau + + This program 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 program 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 + */ + + /* * Alignment.java * *************** *** 11,15 **** /** Keeps an Alignment such as Lawful Good. * ! * @author Heather */ public class Alignment implements Comparable { --- 29,33 ---- /** Keeps an Alignment such as Lawful Good. * ! * @author Zyrca */ public class Alignment implements Comparable { Index: AlignmentTest.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/AlignmentTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AlignmentTest.java 27 Oct 2002 03:12:09 -0000 1.3 --- AlignmentTest.java 9 Dec 2002 20:13:33 -0000 1.4 *************** *** 1,3 **** --- 1,21 ---- /* + Copyright (C) 2002 Heather Cousineau + + This program 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 program 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 + */ + + /* * AlignmentTest.java * NetBeans JUnit based test Index: ArmorClass.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/ArmorClass.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ArmorClass.java 27 Oct 2002 03:12:09 -0000 1.3 --- ArmorClass.java 9 Dec 2002 20:13:33 -0000 1.4 *************** *** 1,3 **** --- 1,21 ---- /* + Copyright (C) 2002 Heather Cousineau + + This program 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 program 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 + */ + + /* * ArmorClass.java * *************** *** 9,13 **** /** Keeps an Armor Class. * ! * @author Heather */ public class ArmorClass extends Stat { --- 27,31 ---- /** Keeps an Armor Class. * ! * @author Zyrca */ public class ArmorClass extends Stat { Index: ArmorClassTest.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/ArmorClassTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ArmorClassTest.java 27 Oct 2002 03:51:36 -0000 1.2 --- ArmorClassTest.java 9 Dec 2002 20:13:33 -0000 1.3 *************** *** 1,3 **** --- 1,21 ---- /* + Copyright (C) 2002 Heather Cousineau + + This program 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 program 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 + */ + + /* * ArmorClassTest.java * NetBeans JUnit based test Index: Creature.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/Creature.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Creature.java 28 Oct 2002 18:27:38 -0000 1.8 --- Creature.java 9 Dec 2002 20:13:33 -0000 1.9 *************** *** 1,3 **** --- 1,21 ---- /* + Copyright (C) 2002 Heather Cousineau + + This program 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 program 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 + */ + + /* * Creature.java * *************** *** 12,16 **** /** A Creature, such as a Human, Elf or Dragon. * ! * @author Heather */ public class Creature { --- 30,34 ---- /** A Creature, such as a Human, Elf or Dragon. * ! * @author Zyrca */ public class Creature { Index: CreatureSize.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/CreatureSize.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CreatureSize.java 27 Oct 2002 03:12:09 -0000 1.3 --- CreatureSize.java 9 Dec 2002 20:13:33 -0000 1.4 *************** *** 1,3 **** --- 1,21 ---- /* + Copyright (C) 2002 Heather Cousineau + + This program 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 program 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 + */ + + /* * CreatureSize.java * Index: CreatureSizeTest.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/CreatureSizeTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CreatureSizeTest.java 27 Oct 2002 03:12:09 -0000 1.3 --- CreatureSizeTest.java 9 Dec 2002 20:13:33 -0000 1.4 *************** *** 1,3 **** --- 1,21 ---- /* + Copyright (C) 2002 Heather Cousineau + + This program 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 program 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 + */ + + /* * CreatureSizeTest.java * NetBeans JUnit based test Index: CreatureSuite.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/CreatureSuite.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CreatureSuite.java 9 Dec 2002 19:54:04 -0000 1.7 --- CreatureSuite.java 9 Dec 2002 20:13:33 -0000 1.8 *************** *** 1,3 **** --- 1,21 ---- /* + Copyright (C) 2002 Heather Cousineau + + This program 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 program 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 + */ + + /* * CreatureSuite.java * NetBeans JUnit based test Index: CreatureTest.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/CreatureTest.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CreatureTest.java 27 Oct 2002 03:12:09 -0000 1.4 --- CreatureTest.java 9 Dec 2002 20:13:33 -0000 1.5 *************** *** 1,3 **** --- 1,21 ---- /* + Copyright (C) 2002 Heather Cousineau + + This program 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 program 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 + */ + + /* * CreatureTest.java * NetBeans JUnit based test Index: DieRollAdj.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/DieRollAdj.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DieRollAdj.java 24 Oct 2002 03:44:59 -0000 1.1 --- DieRollAdj.java 9 Dec 2002 20:13:33 -0000 1.2 *************** *** 1,3 **** --- 1,21 ---- /* + Copyright (C) 2002 Heather Cousineau + + This program 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 program 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 + */ + + /* * Save.java * Index: DieRollAdjTest.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/DieRollAdjTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DieRollAdjTest.java 27 Oct 2002 03:12:09 -0000 1.2 --- DieRollAdjTest.java 9 Dec 2002 20:13:33 -0000 1.3 *************** *** 1,3 **** --- 1,21 ---- /* + Copyright (C) 2002 Heather Cousineau + + This program 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 program 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 + */ + + /* * DieRollAdjTest.java * NetBeans JUnit based test Index: HitPointAdjuster.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/HitPointAdjuster.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** HitPointAdjuster.java 28 Oct 2002 19:36:11 -0000 1.2 --- HitPointAdjuster.java 9 Dec 2002 20:13:33 -0000 1.3 *************** *** 1,3 **** --- 1,21 ---- /* + Copyright (C) 2002 Heather Cousineau + + This program 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 program 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 + */ + + /* * HitPointDamage.java * Index: HitPointAdjusterTest.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/HitPointAdjusterTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** HitPointAdjusterTest.java 28 Oct 2002 19:36:11 -0000 1.2 --- HitPointAdjusterTest.java 9 Dec 2002 20:13:33 -0000 1.3 *************** *** 1,3 **** --- 1,21 ---- /* + Copyright (C) 2002 Heather Cousineau + + This program 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 program 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 + */ + + /* * HitPointDamageTest.java * NetBeans JUnit based test Index: HitPoints.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/HitPoints.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** HitPoints.java 9 Dec 2002 19:54:04 -0000 1.5 --- HitPoints.java 9 Dec 2002 20:13:33 -0000 1.6 *************** *** 1,3 **** --- 1,21 ---- /* + Copyright (C) 2002 Heather Cousineau + + This program 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 program 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 + */ + + /* * HitPoints.java * Index: HitPointsTest.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/HitPointsTest.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** HitPointsTest.java 28 Oct 2002 19:36:11 -0000 1.4 --- HitPointsTest.java 9 Dec 2002 20:13:33 -0000 1.5 *************** *** 1,3 **** --- 1,21 ---- /* + Copyright (C) 2002 Heather Cousineau + + This program 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 program 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 + */ + + /* * HitPointsTest.java * NetBeans JUnit based test Index: Saves.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/Saves.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Saves.java 27 Oct 2002 03:12:10 -0000 1.4 --- Saves.java 9 Dec 2002 20:13:33 -0000 1.5 *************** *** 1,3 **** --- 1,21 ---- /* + Copyright (C) 2002 Heather Cousineau + + This program 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 program 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 + */ + + /* * Saves.java * Index: Stat.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/Stat.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Stat.java 9 Dec 2002 19:54:04 -0000 1.4 --- Stat.java 9 Dec 2002 20:13:33 -0000 1.5 *************** *** 1,3 **** --- 1,21 ---- /* + Copyright (C) 2002 Heather Cousineau + + This program 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 program 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 + */ + + /* * Stat.java * Index: StatAdjuster.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/StatAdjuster.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** StatAdjuster.java 28 Oct 2002 19:36:11 -0000 1.2 --- StatAdjuster.java 9 Dec 2002 20:13:33 -0000 1.3 *************** *** 1,3 **** --- 1,21 ---- /* + Copyright (C) 2002 Heather Cousineau + + This program 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 program 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 + */ + + /* * Damage.java * Index: StatTest.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/StatTest.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** StatTest.java 9 Dec 2002 19:54:04 -0000 1.4 --- StatTest.java 9 Dec 2002 20:13:33 -0000 1.5 *************** *** 1,3 **** --- 1,21 ---- /* + Copyright (C) 2002 Heather Cousineau + + This program 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 program 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 + */ + + /* * StatTest.java * NetBeans JUnit based test Index: SubdualAdjuster.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/SubdualAdjuster.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SubdualAdjuster.java 28 Oct 2002 19:36:11 -0000 1.2 --- SubdualAdjuster.java 9 Dec 2002 20:13:33 -0000 1.3 *************** *** 1,3 **** --- 1,21 ---- /* + Copyright (C) 2002 Heather Cousineau + + This program 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 program 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 + */ + + /* * SubdualAdjuster.java * Index: SubdualAdjusterTest.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/SubdualAdjusterTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SubdualAdjusterTest.java 28 Oct 2002 19:36:11 -0000 1.2 --- SubdualAdjusterTest.java 9 Dec 2002 20:13:33 -0000 1.3 *************** *** 1,3 **** --- 1,21 ---- /* + Copyright (C) 2002 Heather Cousineau + + This program 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 program 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 + */ + + /* * SubdualAdjusterTest.java * NetBeans JUnit based test Index: TemporaryHitPointAdjuster.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/TemporaryHitPointAdjuster.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TemporaryHitPointAdjuster.java 28 Oct 2002 19:36:11 -0000 1.1 --- TemporaryHitPointAdjuster.java 9 Dec 2002 20:13:33 -0000 1.2 *************** *** 1,3 **** --- 1,21 ---- /* + Copyright (C) 2002 Heather Cousineau + + This program 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 program 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 + */ + + /* * TemporaryHitPointAdjuster.java * Index: TemporaryHitPointAdjusterTest.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/TemporaryHitPointAdjusterTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TemporaryHitPointAdjusterTest.java 28 Oct 2002 19:36:12 -0000 1.1 --- TemporaryHitPointAdjusterTest.java 9 Dec 2002 20:13:33 -0000 1.2 *************** *** 1,3 **** --- 1,21 ---- /* + Copyright (C) 2002 Heather Cousineau + + This program 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 program 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 + */ + + /* * TemporaryHitPointAdjusterTest.java * NetBeans JUnit based test Index: Weapon.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/Weapon.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Weapon.java 28 Oct 2002 18:27:38 -0000 1.3 --- Weapon.java 9 Dec 2002 20:13:33 -0000 1.4 *************** *** 1,3 **** --- 1,21 ---- /* + Copyright (C) 2002 Heather Cousineau + + This program 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 program 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 + */ + + /* * Weapon.java * Index: WeaponTest.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/WeaponTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** WeaponTest.java 28 Oct 2002 19:36:12 -0000 1.2 --- WeaponTest.java 9 Dec 2002 20:13:33 -0000 1.3 *************** *** 1,3 **** --- 1,21 ---- /* + Copyright (C) 2002 Heather Cousineau + + This program 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 program 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 + */ + + /* * WeaponTest.java * NetBeans JUnit based test |
From: <zy...@us...> - 2002-12-09 19:54:08
|
Update of /cvsroot/wett-p2p/org/wettp2p/creature In directory sc8-pr-cvs1:/tmp/cvs-serv27705 Modified Files: .nbattrs CreatureSuite.java HitPoints.java Stat.java StatTest.java Log Message: * Changed the HitPoints class so it extends Stat instead of DieRollAdj since it was not using anything in DieRollAdj (and was just confusing) * Added an alias for getStat(), getCurrent() Index: .nbattrs =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/.nbattrs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** .nbattrs 28 Oct 2002 19:36:10 -0000 1.9 --- .nbattrs 9 Dec 2002 19:54:04 -0000 1.10 *************** *** 2,80 **** <!DOCTYPE attributes PUBLIC "-//NetBeans//DTD DefaultAttributes 1.0//EN" "http://www.netbeans.org/dtds/attributes-1_0.dtd"> <attributes version="1.0"> ! <fileobject name="StatAdjuster.java"> ! <attr name="EA-OpenIDE-Connection" serialvalue="aced0005737200146a6176612e7574696c2e4c696e6b65644c6973740c29535d4a60882203000078707704000000037372002a6f72672e6f70656e6964652e6c6f61646572732e436f6e6e656374696f6e537570706f72742450616972055f8af6f04a3bd80200024c00047479706574002b4c6f72672f6f70656e6964652f636f6f6b6965732f436f6e6e656374696f6e436f6f6b696524547970653b4c000576616c75657400124c6a6176612f6c616e672f4f626a6563743b78707372002e6f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661436f6e6e656374696f6e732454797065a83dd01001306d7402000149000666696c746572787000000050737200436f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661446174614f626a6563742450657273697374656e74436f6e6e656374696f6e48616e646c65ba16f1d2dd4c1cb60200014c000e646174614e6f646548616e646c6574001f4c6f72672f6f70656e6964652f6e6f6465732f4e6f64652448616e646c653b7870737200296f72672e6f70656e6964652e6c6f61646572732e446174614e6f6465244f626a65637448616e646c655bd0f82e01811d2e0200025a0005636c6f6e654c00036f626a7400244c6f72672f6f70656e6964652f66696c6573797374656d732f46696c654f626a6563743b787000737200326f72672e6f70656e6964652e66696c6573797374656d732e416273747261637446696c654f626a656374245265706c616365896fa1bce4b5219f0200024c000866696c654e616d657400124c6a6176612f6c616e672f537472696e673b4c000666734e616d6571007e000f787074002a6f72672f776574747032702f63726561747572652f486974506f696e7441646a75737465722e6a61766174004c433a2f446f63756d656e747320616e642053657474696e67732f486561746865722f4d7920446f63756d656e74732f50726f6772616d732f736f75726365666f7267652f776574742d7032707371007e00027371007e0006000000507371007e00087371007e000b007371007e000e7400296f72672f776574747032702f63726561747572652f5375626475616c41646a75737465722e6a61766171007e00127371007e00027371007e0006000000507371007e00087371007e000b007371007e000e7400336f72672f776574747032702f63726561747572652f54656d706f72617279486974506f696e7441646a75737465722e6a61766171007e001278"/> ! </fileobject> ! <fileobject name="SubdualAdjusterTest.java"> ! <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="SubdualAdjusterTest"/> ! </fileobject> ! <fileobject name="AbilityScore.java"> ! <attr name="class_dependency_org.wettp2p.creature.Stat" stringvalue="AbilityScore"/> </fileobject> ! <fileobject name="CreatureSuite.java"> ! <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="CreatureSuite"/> </fileobject> <fileobject name="ArmorClass.java"> <attr name="class_dependency_org.wettp2p.creature.Stat" stringvalue="ArmorClass"/> </fileobject> - <fileobject name="TemporaryHitPointAdjusterTest.java"> - <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="TemporaryHitPointAdjusterTest"/> - </fileobject> <fileobject name="HitPoints.java"> ! <attr name="class_dependency_org.wettp2p.creature.DieRollAdj" stringvalue="HitPoints"/> ! </fileobject> ! <fileobject name="AbilityScoreTest.java"> ! <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="AbilityScoreTest"/> ! </fileobject> ! <fileobject name="CreatureTest.java"> ! <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="CreatureTest"/> ! </fileobject> ! <fileobject name="Stat.java"> ! <attr name="EA-OpenIDE-Connection" serialvalue="aced0005737200146a6176612e7574696c2e4c696e6b65644c6973740c29535d4a60882203000078707704000000027372002a6f72672e6f70656e6964652e6c6f61646572732e436f6e6e656374696f6e537570706f72742450616972055f8af6f04a3bd80200024c00047479706574002b4c6f72672f6f70656e6964652f636f6f6b6965732f436f6e6e656374696f6e436f6f6b696524547970653b4c000576616c75657400124c6a6176612f6c616e672f4f626a6563743b78707372002e6f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661436f6e6e656374696f6e732454797065a83dd01001306d7402000149000666696c746572787000000050737200436f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661446174614f626a6563742450657273697374656e74436f6e6e656374696f6e48616e646c65ba16f1d2dd4c1cb60200014c000e646174614e6f646548616e646c6574001f4c6f72672f6f70656e6964652f6e6f6465732f4e6f64652448616e646c653b7870737200296f72672e6f70656e6964652e6c6f61646572732e446174614e6f6465244f626a65637448616e646c655bd0f82e01811d2e0200025a0005636c6f6e654c00036f626a7400244c6f72672f6f70656e6964652f66696c6573797374656d732f46696c654f626a6563743b787000737200326f72672e6f70656e6964652e66696c6573797374656d732e416273747261637446696c654f626a656374245265706c616365896fa1bce4b5219f0200024c000866696c654e616d657400124c6a6176612f6c616e672f537472696e673b4c000666734e616d6571007e000f78707400266f72672f776574747032702f63726561747572652f4162696c69747953636f72652e6a61766174004c433a2f446f63756d656e747320616e642053657474696e67732f486561746865722f4d7920446f63756d656e74732f50726f6772616d732f736f75726365666f7267652f776574742d7032707371007e00027371007e0006000000507371007e00087371007e000b007371007e000e7400246f72672f776574747032702f63726561747572652f41726d6f72436c6173732e6a61766171007e001278"/> ! </fileobject> ! <fileobject name="HitPointsTest.java"> ! <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="HitPointsTest"/> ! </fileobject> ! <fileobject name="StatTest.java"> ! <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="StatTest"/> ! </fileobject> ! <fileobject name="SubdualAdjuster.java"> ! <attr name="class_dependency_org.wettp2p.creature.StatAdjuster" stringvalue="SubdualAdjuster"/> </fileobject> ! <fileobject name="HitPointAdjusterTest.java"> ! <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="HitPointAdjusterTest"/> </fileobject> ! <fileobject name="ArmorClassTest.java"> ! <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="ArmorClassTest"/> </fileobject> <fileobject name="CreatureTestTest.java"> <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="SimpleNbJUnitTest"/> </fileobject> ! <fileobject name="WeaponTest.java"> ! <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="WeaponTest"/> ! </fileobject> ! <fileobject name="Alignment.java"> ! <attr name="class_dependency_java.lang.Comparable" stringvalue="Alignment"/> ! </fileobject> ! <fileobject name="DieRollAdj.java"> ! <attr name="EA-OpenIDE-Connection" serialvalue="aced0005737200146a6176612e7574696c2e4c696e6b65644c6973740c29535d4a60882203000078707704000000017372002a6f72672e6f70656e6964652e6c6f61646572732e436f6e6e656374696f6e537570706f72742450616972055f8af6f04a3bd80200024c00047479706574002b4c6f72672f6f70656e6964652f636f6f6b6965732f436f6e6e656374696f6e436f6f6b696524547970653b4c000576616c75657400124c6a6176612f6c616e672f4f626a6563743b78707372002e6f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661436f6e6e656374696f6e732454797065a83dd01001306d7402000149000666696c746572787000000050737200436f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661446174614f626a6563742450657273697374656e74436f6e6e656374696f6e48616e646c65ba16f1d2dd4c1cb60200014c000e646174614e6f646548616e646c6574001f4c6f72672f6f70656e6964652f6e6f6465732f4e6f64652448616e646c653b7870737200296f72672e6f70656e6964652e6c6f61646572732e446174614e6f6465244f626a65637448616e646c655bd0f82e01811d2e0200025a0005636c6f6e654c00036f626a7400244c6f72672f6f70656e6964652f66696c6573797374656d732f46696c654f626a6563743b787000737200326f72672e6f70656e6964652e66696c6573797374656d732e416273747261637446696c654f626a656374245265706c616365896fa1bce4b5219f0200024c000866696c654e616d657400124c6a6176612f6c616e672f537472696e673b4c000666734e616d6571007e000f78707400236f72672f776574747032702f63726561747572652f486974506f696e74732e6a61766174004c433a2f446f63756d656e747320616e642053657474696e67732f486561746865722f4d7920446f63756d656e74732f50726f6772616d732f736f75726365666f7267652f776574742d70327078"/> ! <attr name="class_dependency_org.wettp2p.creature.Stat" stringvalue="DieRollAdj"/> ! </fileobject> ! <fileobject name="CreatureSizeTest.java"> ! <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="CreatureSizeTest"/> ! </fileobject> ! <fileobject name="HitPointAdjuster.java"> ! <attr name="class_dependency_org.wettp2p.creature.StatAdjuster" stringvalue="HitPointAdjuster"/> ! </fileobject> ! <fileobject name="AlignmentTest.java"> ! <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="AlignmentTest"/> ! </fileobject> ! <fileobject name="DieRollAdjTest.java"> ! <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="DieRollAdjTest"/> ! </fileobject> ! <fileobject name="TemporaryHitPointAdjuster.java"> ! <attr name="class_dependency_org.wettp2p.creature.StatAdjuster" stringvalue="TemporaryHitPointAdjuster"/> ! </fileobject> ! <fileobject name="CreatureSize.java"> ! <attr name="class_dependency_java.lang.Comparable" stringvalue="CreatureSize"/> </fileobject> </attributes> --- 2,28 ---- <!DOCTYPE attributes PUBLIC "-//NetBeans//DTD DefaultAttributes 1.0//EN" "http://www.netbeans.org/dtds/attributes-1_0.dtd"> <attributes version="1.0"> ! <fileobject name="DieRollAdj.java"> ! <attr name="EA-OpenIDE-Connection" serialvalue="aced0005737200146a6176612e7574696c2e4c696e6b65644c6973740c29535d4a608822030000787077040000000078"/> </fileobject> ! <fileobject name="StatTest.java"> ! <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="StatTest"/> </fileobject> <fileobject name="ArmorClass.java"> <attr name="class_dependency_org.wettp2p.creature.Stat" stringvalue="ArmorClass"/> </fileobject> <fileobject name="HitPoints.java"> ! <attr name="class_dependency_org.wettp2p.creature.Stat" stringvalue="HitPoints"/> </fileobject> ! <fileobject name="StatAdjuster.java"> ! <attr name="EA-OpenIDE-Connection" serialvalue="aced0005737200146a6176612e7574696c2e4c696e6b65644c6973740c29535d4a60882203000078707704000000037372002a6f72672e6f70656e6964652e6c6f61646572732e436f6e6e656374696f6e537570706f72742450616972055f8af6f04a3bd80200024c00047479706574002b4c6f72672f6f70656e6964652f636f6f6b6965732f436f6e6e656374696f6e436f6f6b696524547970653b4c000576616c75657400124c6a6176612f6c616e672f4f626a6563743b78707372002e6f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661436f6e6e656374696f6e732454797065a83dd01001306d7402000149000666696c746572787000000050737200436f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661446174614f626a6563742450657273697374656e74436f6e6e656374696f6e48616e646c65ba16f1d2dd4c1cb60200014c000e646174614e6f646548616e646c6574001f4c6f72672f6f70656e6964652f6e6f6465732f4e6f64652448616e646c653b7870737200296f72672e6f70656e6964652e6c6f61646572732e446174614e6f6465244f626a65637448616e646c655bd0f82e01811d2e0200025a0005636c6f6e654c00036f626a7400244c6f72672f6f70656e6964652f66696c6573797374656d732f46696c654f626a6563743b787000737200326f72672e6f70656e6964652e66696c6573797374656d732e416273747261637446696c654f626a656374245265706c616365896fa1bce4b5219f0200024c000866696c654e616d657400124c6a6176612f6c616e672f537472696e673b4c000666734e616d6571007e000f787074002a6f72672f776574747032702f63726561747572652f486974506f696e7441646a75737465722e6a61766174004c433a2f446f63756d656e747320616e642053657474696e67732f486561746865722f4d7920446f63756d656e74732f50726f6772616d732f736f75726365666f7267652f776574742d7032707371007e00027371007e0006000000507371007e00087371007e000b007371007e000e7400296f72672f776574747032702f63726561747572652f5375626475616c41646a75737465722e6a61766171007e00127371007e00027371007e0006000000507371007e00087371007e000b007371007e000e7400336f72672f776574747032702f63726561747572652f54656d706f72617279486974506f696e7441646a75737465722e6a61766171007e001278"/> </fileobject> ! <fileobject name="AbilityScore.java"> ! <attr name="class_dependency_org.wettp2p.creature.Stat" stringvalue="AbilityScore"/> </fileobject> <fileobject name="CreatureTestTest.java"> <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="SimpleNbJUnitTest"/> </fileobject> ! <fileobject name="Stat.java"> ! <attr name="EA-OpenIDE-Connection" serialvalue="aced0005737200146a6176612e7574696c2e4c696e6b65644c6973740c29535d4a60882203000078707704000000037372002a6f72672e6f70656e6964652e6c6f61646572732e436f6e6e656374696f6e537570706f72742450616972055f8af6f04a3bd80200024c00047479706574002b4c6f72672f6f70656e6964652f636f6f6b6965732f436f6e6e656374696f6e436f6f6b696524547970653b4c000576616c75657400124c6a6176612f6c616e672f4f626a6563743b78707372002e6f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661436f6e6e656374696f6e732454797065a83dd01001306d7402000149000666696c746572787000000050737200436f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661446174614f626a6563742450657273697374656e74436f6e6e656374696f6e48616e646c65ba16f1d2dd4c1cb60200014c000e646174614e6f646548616e646c6574001f4c6f72672f6f70656e6964652f6e6f6465732f4e6f64652448616e646c653b7870737200296f72672e6f70656e6964652e6c6f61646572732e446174614e6f6465244f626a65637448616e646c655bd0f82e01811d2e0200025a0005636c6f6e654c00036f626a7400244c6f72672f6f70656e6964652f66696c6573797374656d732f46696c654f626a6563743b787000737200326f72672e6f70656e6964652e66696c6573797374656d732e416273747261637446696c654f626a656374245265706c616365896fa1bce4b5219f0200024c000866696c654e616d657400124c6a6176612f6c616e672f537472696e673b4c000666734e616d6571007e000f78707400266f72672f776574747032702f63726561747572652f4162696c69747953636f72652e6a61766174004c433a2f446f63756d656e747320616e642053657474696e67732f486561746865722f4d7920446f63756d656e74732f50726f6772616d732f736f75726365666f7267652f776574742d7032707371007e00027371007e0006000000507371007e00087371007e000b007371007e000e7400246f72672f776574747032702f63726561747572652f41726d6f72436c6173732e6a61766171007e00127371007e00027371007e0006000000507371007e00087371007e000b007371007e000e7400236f72672f776574747032702f63726561747572652f486974506f696e74732e6a61766171007e001278"/> </fileobject> </attributes> Index: CreatureSuite.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/CreatureSuite.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CreatureSuite.java 28 Oct 2002 18:27:38 -0000 1.6 --- CreatureSuite.java 9 Dec 2002 19:54:04 -0000 1.7 *************** *** 50,53 **** --- 50,54 ---- suite.addTest(org.wettp2p.creature.WeaponTest.suite()); suite.addTest(org.wettp2p.creature.SubdualAdjusterTest.suite()); + suite.addTest(org.wettp2p.creature.TemporaryHitPointAdjusterTest.suite()); //:JUNIT-- //This value MUST ALWAYS be returned from this function. Index: HitPoints.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/HitPoints.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** HitPoints.java 28 Oct 2002 19:36:11 -0000 1.4 --- HitPoints.java 9 Dec 2002 19:54:04 -0000 1.5 *************** *** 7,14 **** package org.wettp2p.creature; /** Keeps track of the current hit points of a creature, including subdual damage. * @author Zyrca */ ! public class HitPoints extends DieRollAdj { private int mySubdual; private int myTemporary; --- 7,18 ---- package org.wettp2p.creature; + //import java.util.List; + //import java.util.ArrayList; + /** Keeps track of the current hit points of a creature, including subdual damage. * @author Zyrca */ ! //public class HitPoints extends DieRollAdj { ! public class HitPoints extends Stat { private int mySubdual; private int myTemporary; Index: Stat.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/Stat.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Stat.java 24 Oct 2002 01:40:16 -0000 1.3 --- Stat.java 9 Dec 2002 19:54:04 -0000 1.4 *************** *** 85,88 **** --- 85,93 ---- */ public int getStat() { return myStat + myAdj; } + /** Adjusted Stat. + * Alias for getStat() + * @return Returns the Adjusted Stat. + */ + public int getCurrent() { return getStat(); } /** Current Stat adjustment * @return Returns the current Stat adjustment Index: StatTest.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/StatTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** StatTest.java 27 Oct 2002 03:12:10 -0000 1.3 --- StatTest.java 9 Dec 2002 19:54:04 -0000 1.4 *************** *** 68,71 **** --- 68,75 ---- if( as.getStat() != 20 ) fail("The score is " + as.getStat() + " but should be 20"); + // Test getStat()'s alias getCurrent() + if( as.getCurrent() != 20 ) + fail("The score is " + as.getCurrent() + " but should be 20"); + if( as.getAdj() != 5 ) fail("The adjustment score is " + as.getAdj() + " but should be 5"); |
From: <zy...@us...> - 2002-11-27 00:15:34
|
Update of /cvsroot/wett-p2p/org/wettp2p/creature In directory sc8-pr-cvs1:/tmp/cvs-serv2324 Removed Files: testfile Log Message: removing - testfile --- testfile DELETED --- |
From: <zy...@us...> - 2002-11-27 00:15:04
|
Update of /cvsroot/wett-p2p/org/wettp2p/creature In directory sc8-pr-cvs1:/tmp/cvs-serv2136 Added Files: testfile Log Message: testfile --- NEW FILE: testfile --- This is the base directory. The packege structure is as follows: org -> wettp2p -> creature |
From: <zy...@us...> - 2002-10-28 19:36:17
|
Update of /cvsroot/wett-p2p/org/wettp2p/creature In directory usw-pr-cvs1:/tmp/cvs-serv24983 Modified Files: .nbattrs HitPointAdjuster.java HitPointAdjusterTest.java HitPoints.java HitPointsTest.java StatAdjuster.java SubdualAdjuster.java SubdualAdjusterTest.java WeaponTest.java Added Files: TemporaryHitPointAdjuster.java TemporaryHitPointAdjusterTest.java Log Message: Added the TemporaryHitPointsAdjuster class and test and adjusted the behavior of the temporary hit points in the HitPoints class so that they could never be negative. --- NEW FILE: TemporaryHitPointAdjuster.java --- /* * TemporaryHitPointAdjuster.java * * Created on October 28, 2002, 11:42 AM */ package org.wettp2p.creature; /** * * @author Zyrca */ public class TemporaryHitPointAdjuster implements StatAdjuster { /** Creates a new instance of TemporaryHitPointAdjuster */ public TemporaryHitPointAdjuster() { } /** Increase a creature's stat. * @return The creature's new stat value. * @param statBenefit The ammount to increase the stat of the creature. * @param critter The creature that is getting its stat adjusted. * */ public int benefit(Creature critter, int statBenefit) { critter.getHitPoints().adjTemporary(Math.abs(statBenefit)); return critter.getHitPoints().getStat(); } /** Decrease a creature's stat. * @return The creature's new stat value. * @param statDamage The ammount of damage to apply to the creature. * @param critter The creature that is getting hit. * */ public int damage(Creature critter, int statDamage) { critter.getHitPoints().adjTemporary(- Math.abs(statDamage)); return critter.getHitPoints().getStat(); } /** Remove all adjustments to a creature's stat. * @param critter The creature that is having its stat zero'ed. * @return The creature's new stat value. * */ public int zero(Creature critter) { critter.getHitPoints().setTemporary(0); return critter.getHitPoints().getStat(); } } --- NEW FILE: TemporaryHitPointAdjusterTest.java --- /* * TemporaryHitPointAdjusterTest.java * NetBeans JUnit based test * * Created on October 28, 2002, 11:44 AM */ package org.wettp2p.creature; import junit.framework.*; import org.netbeans.junit.*; /** * * @author Zyrca */ public class TemporaryHitPointAdjusterTest extends NbTestCase { public TemporaryHitPointAdjusterTest(java.lang.String testName) { super(testName); } public static void main(java.lang.String[] args) { junit.textui.TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new NbTestSuite(TemporaryHitPointAdjusterTest.class); return suite; } /** Test of benefit method, of class org.wettp2p.creature.TemporaryHitPointAdjuster. */ public void testBenefit() { System.out.println("org.wettp2p.creature.TemporaryHitPointAdjuster.testBenefit"); Creature critter = new Creature(); critter.getAbilityScores().getCon().setBaseStat(13); critter.getLevel().setBaseStat(3); critter.getHitPoints().setByTotal(24); StatAdjuster sa = new TemporaryHitPointAdjuster(); sa.benefit(critter, 5); if(critter.getHitPoints().getStat() != 29) fail("Temporary hit points were not applied properly, should be 29, is: " + critter.getHitPoints().getStat()); } /** Test of damage method, of class org.wettp2p.creature.TemporaryHitPointAdjuster. */ public void testDamage() { System.out.println("org.wettp2p.creature.TemporaryHitPointAdjuster.testDamage"); Creature critter = new Creature(); critter.getAbilityScores().getCon().setBaseStat(13); critter.getLevel().setBaseStat(3); critter.getHitPoints().setByTotal(24); StatAdjuster sa = new TemporaryHitPointAdjuster(); sa.benefit(critter, 5); sa.damage(critter, 3); if(critter.getHitPoints().getStat() != 26) fail("Temporary hit points were not applied properly, should be 26, is: " + critter.getHitPoints().getStat()); sa.damage(critter, 5); if(critter.getHitPoints().getStat() != 24) fail("Temporary hit points were not applied properly, should be 24, is: " + critter.getHitPoints().getStat()); } /** Test of zero method, of class org.wettp2p.creature.TemporaryHitPointAdjuster. */ public void testZero() { System.out.println("org.wettp2p.creature.TemporaryHitPointAdjuster.testZero"); Creature critter = new Creature(); critter.getAbilityScores().getCon().setBaseStat(13); critter.getLevel().setBaseStat(3); critter.getHitPoints().setByTotal(24); StatAdjuster sa = new TemporaryHitPointAdjuster(); sa.benefit(critter, 5); sa.zero(critter); if(critter.getHitPoints().getStat() != 24) fail("Temporary hit points were not zero'ed properly, should be 24, is: " + critter.getHitPoints().getStat()); } } Index: .nbattrs =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/.nbattrs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** .nbattrs 28 Oct 2002 18:27:38 -0000 1.8 --- .nbattrs 28 Oct 2002 19:36:10 -0000 1.9 *************** *** 2,11 **** <!DOCTYPE attributes PUBLIC "-//NetBeans//DTD DefaultAttributes 1.0//EN" "http://www.netbeans.org/dtds/attributes-1_0.dtd"> <attributes version="1.0"> <fileobject name="SubdualAdjusterTest.java"> <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="SubdualAdjusterTest"/> </fileobject> - <fileobject name="StatAdjuster.java"> - <attr name="EA-OpenIDE-Connection" serialvalue="aced0005737200146a6176612e7574696c2e4c696e6b65644c6973740c29535d4a60882203000078707704000000027372002a6f72672e6f70656e6964652e6c6f61646572732e436f6e6e656374696f6e537570706f72742450616972055f8af6f04a3bd80200024c00047479706574002b4c6f72672f6f70656e6964652f636f6f6b6965732f436f6e6e656374696f6e436f6f6b696524547970653b4c000576616c75657400124c6a6176612f6c616e672f4f626a6563743b78707372002e6f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661436f6e6e656374696f6e732454797065a83dd01001306d7402000149000666696c746572787000000050737200436f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661446174614f626a6563742450657273697374656e74436f6e6e656374696f6e48616e646c65ba16f1d2dd4c1cb60200014c000e646174614e6f646548616e646c6574001f4c6f72672f6f70656e6964652f6e6f6465732f4e6f64652448616e646c653b7870737200296f72672e6f70656e6964652e6c6f61646572732e446174614e6f6465244f626a65637448616e646c655bd0f82e01811d2e0200025a0005636c6f6e654c00036f626a7400244c6f72672f6f70656e6964652f66696c6573797374656d732f46696c654f626a6563743b787000737200326f72672e6f70656e6964652e66696c6573797374656d732e416273747261637446696c654f626a656374245265706c616365896fa1bce4b5219f0200024c000866696c654e616d657400124c6a6176612f6c616e672f537472696e673b4c000666734e616d6571007e000f787074002a6f72672f776574747032702f63726561747572652f486974506f696e7441646a75737465722e6a61766174004c433a2f446f63756d656e747320616e642053657474696e67732f486561746865722f4d7920446f63756d656e74732f50726f6772616d732f736f75726365666f7267652f776574742d7032707371007e00027371007e0006000000507371007e00087371007e000b007371007e000e7400296f72672f776574747032702f63726561747572652f5375626475616c41646a75737465722e6a61766171007e001278"/> - </fileobject> <fileobject name="AbilityScore.java"> <attr name="class_dependency_org.wettp2p.creature.Stat" stringvalue="AbilityScore"/> --- 2,11 ---- <!DOCTYPE attributes PUBLIC "-//NetBeans//DTD DefaultAttributes 1.0//EN" "http://www.netbeans.org/dtds/attributes-1_0.dtd"> <attributes version="1.0"> + <fileobject name="StatAdjuster.java"> + <attr name="EA-OpenIDE-Connection" serialvalue="aced0005737200146a6176612e7574696c2e4c696e6b65644c6973740c29535d4a60882203000078707704000000037372002a6f72672e6f70656e6964652e6c6f61646572732e436f6e6e656374696f6e537570706f72742450616972055f8af6f04a3bd80200024c00047479706574002b4c6f72672f6f70656e6964652f636f6f6b6965732f436f6e6e656374696f6e436f6f6b696524547970653b4c000576616c75657400124c6a6176612f6c616e672f4f626a6563743b78707372002e6f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661436f6e6e656374696f6e732454797065a83dd01001306d7402000149000666696c746572787000000050737200436f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661446174614f626a6563742450657273697374656e74436f6e6e656374696f6e48616e646c65ba16f1d2dd4c1cb60200014c000e646174614e6f646548616e646c6574001f4c6f72672f6f70656e6964652f6e6f6465732f4e6f64652448616e646c653b7870737200296f72672e6f70656e6964652e6c6f61646572732e446174614e6f6465244f626a65637448616e646c655bd0f82e01811d2e0200025a0005636c6f6e654c00036f626a7400244c6f72672f6f70656e6964652f66696c6573797374656d732f46696c654f626a6563743b787000737200326f72672e6f70656e6964652e66696c6573797374656d732e416273747261637446696c654f626a656374245265706c616365896fa1bce4b5219f0200024c000866696c654e616d657400124c6a6176612f6c616e672f537472696e673b4c000666734e616d6571007e000f787074002a6f72672f776574747032702f63726561747572652f486974506f696e7441646a75737465722e6a61766174004c433a2f446f63756d656e747320616e642053657474696e67732f486561746865722f4d7920446f63756d656e74732f50726f6772616d732f736f75726365666f7267652f776574742d7032707371007e00027371007e0006000000507371007e00087371007e000b007371007e000e7400296f72672f776574747032702f63726561747572652f5375626475616c41646a75737465722e6a61766171007e00127371007e00027371007e0006000000507371007e00087371007e000b007371007e000e7400336f72672f776574747032702f63726561747572652f54656d706f72617279486974506f696e7441646a75737465722e6a61766171007e001278"/> + </fileobject> <fileobject name="SubdualAdjusterTest.java"> <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="SubdualAdjusterTest"/> </fileobject> <fileobject name="AbilityScore.java"> <attr name="class_dependency_org.wettp2p.creature.Stat" stringvalue="AbilityScore"/> *************** *** 17,20 **** --- 17,23 ---- <attr name="class_dependency_org.wettp2p.creature.Stat" stringvalue="ArmorClass"/> </fileobject> + <fileobject name="TemporaryHitPointAdjusterTest.java"> + <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="TemporaryHitPointAdjusterTest"/> + </fileobject> <fileobject name="HitPoints.java"> <attr name="class_dependency_org.wettp2p.creature.DieRollAdj" stringvalue="HitPoints"/> *************** *** 54,59 **** </fileobject> <fileobject name="DieRollAdj.java"> - <attr name="class_dependency_org.wettp2p.creature.Stat" stringvalue="DieRollAdj"/> <attr name="EA-OpenIDE-Connection" serialvalue="aced0005737200146a6176612e7574696c2e4c696e6b65644c6973740c29535d4a60882203000078707704000000017372002a6f72672e6f70656e6964652e6c6f61646572732e436f6e6e656374696f6e537570706f72742450616972055f8af6f04a3bd80200024c00047479706574002b4c6f72672f6f70656e6964652f636f6f6b6965732f436f6e6e656374696f6e436f6f6b696524547970653b4c000576616c75657400124c6a6176612f6c616e672f4f626a6563743b78707372002e6f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661436f6e6e656374696f6e732454797065a83dd01001306d7402000149000666696c746572787000000050737200436f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661446174614f626a6563742450657273697374656e74436f6e6e656374696f6e48616e646c65ba16f1d2dd4c1cb60200014c000e646174614e6f646548616e646c6574001f4c6f72672f6f70656e6964652f6e6f6465732f4e6f64652448616e646c653b7870737200296f72672e6f70656e6964652e6c6f61646572732e446174614e6f6465244f626a65637448616e646c655bd0f82e01811d2e0200025a0005636c6f6e654c00036f626a7400244c6f72672f6f70656e6964652f66696c6573797374656d732f46696c654f626a6563743b787000737200326f72672e6f70656e6964652e66696c6573797374656d732e416273747261637446696c654f626a656374245265706c616365896fa1bce4b5219f0200024c000866696c654e616d657400124c6a6176612f6c616e672f537472696e673b4c000666734e616d6571007e000f78707400236f72672f776574747032702f63726561747572652f486974506f696e74732e6a61766174004c433a2f446f63756d656e747320616e642053657474696e67732f486561746865722f4d7920446f63756d656e74732f50726f6772616d732f736f75726365666f7267652f776574742d70327078"/> </fileobject> <fileobject name="CreatureSizeTest.java"> --- 57,62 ---- </fileobject> <fileobject name="DieRollAdj.java"> <attr name="EA-OpenIDE-Connection" serialvalue="aced0005737200146a6176612e7574696c2e4c696e6b65644c6973740c29535d4a60882203000078707704000000017372002a6f72672e6f70656e6964652e6c6f61646572732e436f6e6e656374696f6e537570706f72742450616972055f8af6f04a3bd80200024c00047479706574002b4c6f72672f6f70656e6964652f636f6f6b6965732f436f6e6e656374696f6e436f6f6b696524547970653b4c000576616c75657400124c6a6176612f6c616e672f4f626a6563743b78707372002e6f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661436f6e6e656374696f6e732454797065a83dd01001306d7402000149000666696c746572787000000050737200436f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661446174614f626a6563742450657273697374656e74436f6e6e656374696f6e48616e646c65ba16f1d2dd4c1cb60200014c000e646174614e6f646548616e646c6574001f4c6f72672f6f70656e6964652f6e6f6465732f4e6f64652448616e646c653b7870737200296f72672e6f70656e6964652e6c6f61646572732e446174614e6f6465244f626a65637448616e646c655bd0f82e01811d2e0200025a0005636c6f6e654c00036f626a7400244c6f72672f6f70656e6964652f66696c6573797374656d732f46696c654f626a6563743b787000737200326f72672e6f70656e6964652e66696c6573797374656d732e416273747261637446696c654f626a656374245265706c616365896fa1bce4b5219f0200024c000866696c654e616d657400124c6a6176612f6c616e672f537472696e673b4c000666734e616d6571007e000f78707400236f72672f776574747032702f63726561747572652f486974506f696e74732e6a61766174004c433a2f446f63756d656e747320616e642053657474696e67732f486561746865722f4d7920446f63756d656e74732f50726f6772616d732f736f75726365666f7267652f776574742d70327078"/> + <attr name="class_dependency_org.wettp2p.creature.Stat" stringvalue="DieRollAdj"/> </fileobject> <fileobject name="CreatureSizeTest.java"> *************** *** 68,71 **** --- 71,77 ---- <fileobject name="DieRollAdjTest.java"> <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="DieRollAdjTest"/> + </fileobject> + <fileobject name="TemporaryHitPointAdjuster.java"> + <attr name="class_dependency_org.wettp2p.creature.StatAdjuster" stringvalue="TemporaryHitPointAdjuster"/> </fileobject> <fileobject name="CreatureSize.java"> Index: HitPointAdjuster.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/HitPointAdjuster.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** HitPointAdjuster.java 28 Oct 2002 18:27:38 -0000 1.1 --- HitPointAdjuster.java 28 Oct 2002 19:36:11 -0000 1.2 *************** *** 17,23 **** /** Decrease a critter's Hit Points. - * @param critter The creature that is getting hit. - * @param damage The ammount of damage to apply to the creature. * @return The creature's new stat value. */ public int damage(Creature critter, int statDamage) { --- 17,23 ---- /** Decrease a critter's Hit Points. * @return The creature's new stat value. + * @param statDamage The ammount of damage to apply to a creature's stat. + * @param critter The creature that is getting hit. */ public int damage(Creature critter, int statDamage) { *************** *** 27,34 **** /** Increase a critter's Hit Points. - * @param critter The creature that is getting its stat adjusted. - * @param damage The ammount to increase the stat of the creature. * @return The creature's new stat value. ! * */ public int benefit(Creature critter, int statBenefit) { --- 27,33 ---- /** Increase a critter's Hit Points. * @return The creature's new stat value. ! * @param statBenefit The ammount to increase the stat of the creature. ! * @param critter The creature that is getting its stat adjusted. */ public int benefit(Creature critter, int statBenefit) { Index: HitPointAdjusterTest.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/HitPointAdjusterTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** HitPointAdjusterTest.java 28 Oct 2002 18:27:38 -0000 1.1 --- HitPointAdjusterTest.java 28 Oct 2002 19:36:11 -0000 1.2 *************** *** 11,28 **** import org.netbeans.junit.*; ! /** ! * ! * @author Heather */ public class HitPointAdjusterTest extends NbTestCase { public HitPointAdjusterTest(java.lang.String testName) { super(testName); } public static void main(java.lang.String[] args) { junit.textui.TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new NbTestSuite(HitPointAdjusterTest.class); --- 11,36 ---- import org.netbeans.junit.*; ! /** Test. ! * @author Zyrca */ public class HitPointAdjusterTest extends NbTestCase { + /** Test. + * @param testName Test. + */ public HitPointAdjusterTest(java.lang.String testName) { super(testName); } + /** Test. + * @param args Test. + */ public static void main(java.lang.String[] args) { junit.textui.TestRunner.run(suite()); } + /** Test. + * @return Test. + */ public static Test suite() { TestSuite suite = new NbTestSuite(HitPointAdjusterTest.class); *************** *** 81,85 **** ! --- 89,110 ---- ! /** Test of zero method, of class org.wettp2p.creature.HitPointAdjuster. */ ! public void testZero() { ! System.out.println("org.wettp2p.creature.HitPointAdjuster.testZero"); ! ! Creature critter = new Creature(); ! critter.getAbilityScores().getCon().setBaseStat(13); ! critter.getLevel().setBaseStat(3); ! critter.getHitPoints().setByTotal(24); ! StatAdjuster sa = new HitPointAdjuster(); ! ! sa.benefit(critter, 5); ! sa.zero(critter); ! ! if(critter.getHitPoints().getStat() != 24) ! fail("Temporary hit points were not zero'ed properly, should be 24, is: " ! + critter.getHitPoints().getStat()); ! ! } Index: HitPoints.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/HitPoints.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** HitPoints.java 28 Oct 2002 18:27:38 -0000 1.3 --- HitPoints.java 28 Oct 2002 19:36:11 -0000 1.4 *************** *** 132,135 **** --- 132,137 ---- public void adjTemporary(int adj){ myTemporary += adj; + // Cannot have negative temporary hit points. + if(myTemporary < 0) myTemporary = 0; } *************** *** 146,149 **** --- 148,153 ---- public void setTemporary(int temp){ myTemporary = temp; + // Cannot have negative temporary hit points. + if(myTemporary < 0) myTemporary = 0; } Index: HitPointsTest.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/HitPointsTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** HitPointsTest.java 28 Oct 2002 18:27:38 -0000 1.3 --- HitPointsTest.java 28 Oct 2002 19:36:11 -0000 1.4 *************** *** 40,54 **** /** Test default values of class org.wettp2p.creature.HitPoints. */ ! public void testDefaults(){ ! System.out.println("org.wettp2p.creature.HitPoints.testDefaults"); HitPoints hp = new HitPoints(); - if(hp.getBaseHP() != 1) fail("Default base HP should be 1, is: " + hp.getBaseHP()); ! ! } /** Test of setByTotal method, of class org.wettp2p.creature.HitPoints. */ --- 40,69 ---- /** Test default values of class org.wettp2p.creature.HitPoints. */ ! public void testDefaultBaseHP(){ ! System.out.println("org.wettp2p.creature.HitPoints.testDefaultBaseHP"); HitPoints hp = new HitPoints(); if(hp.getBaseHP() != 1) fail("Default base HP should be 1, is: " + hp.getBaseHP()); + } + + /** Test default values of class org.wettp2p.creature.HitPoints. */ + public void testDefaultSubdual(){ + System.out.println("org.wettp2p.creature.HitPoints.testDefaultSubdual"); + + HitPoints hp = new HitPoints(); + if(hp.getSubdual() != 0) + fail("Default subdaul should be 0, is: " + hp.getSubdual()); + } + + /** Test default values of class org.wettp2p.creature.HitPoints. */ + public void testDefaultTemporary(){ + System.out.println("org.wettp2p.creature.HitPoints.testDefaultTemporary"); + HitPoints hp = new HitPoints(); + if(hp.getTemporary() != 0) + fail("Default temporary should be 0, is: " + hp.getTemporary()); ! } /** Test of setByTotal method, of class org.wettp2p.creature.HitPoints. */ *************** *** 160,162 **** --- 175,211 ---- + " Should be 21, is: " + hp.getStat()); } + + /** Test Temporary Hit Points behavior, of class org.wettp2p.creature.HitPoints. */ + public void testTemporaryHitPoints() { + System.out.println("org.wettp2p.creature.HitPoints.testTemporaryHitPoints"); + + Stat lvl = new Stat("Level", "LVL", 5); + AbilityScore con = new AbilityScore("Constitution", "CON", 15); + HitPoints hp = new HitPoints(lvl, con, 16); + // Hit Points are 26 + + hp.setTemporary(4); + + if(hp.getStat() != 30) + fail("Temporary hit points did not adjust the hit points correctly." + + " Should be 25, is: " + hp.getStat()); + + hp.adjTemporary(-4); + if(hp.getStat() != 26) + fail("Temporary hit points did not adjust the hit points correctly." + + " Should be 26, is: " + hp.getStat()); + + hp.adjTemporary(-5); + if(hp.getStat() != 26) + fail("Temporary hit points cannot negativly affect the total hit points. " + + "(adjTemporary) Should be 26, is: " + hp.getStat()); + + hp.setTemporary(-7); + if(hp.getStat() != 26) + fail("Temporary hit points cannot negativly affect the total hit points. " + + "(setTemporary) Should be 26, is: " + hp.getStat()); + + } + + } Index: StatAdjuster.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/StatAdjuster.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** StatAdjuster.java 28 Oct 2002 18:27:38 -0000 1.1 --- StatAdjuster.java 28 Oct 2002 19:36:11 -0000 1.2 *************** *** 13,26 **** public interface StatAdjuster { /** Decrease a creature's stat. - * @param critter The creature that is getting hit. - * @param damage The ammount of damage to apply to the creature. * @return The creature's new stat value. */ public abstract int damage(Creature critter, int statDamage); ! /** Increase a creature's stat. ! * @param critter The creature that is getting its stat adjusted. ! * @param damage The ammount to increase the stat of the creature. * @return The creature's new stat value. */ public abstract int benefit(Creature critter, int statBenefit); --- 13,26 ---- public interface StatAdjuster { /** Decrease a creature's stat. * @return The creature's new stat value. + * @param statDamage The ammount of damage to apply to the creature. + * @param critter The creature that is getting hit. */ public abstract int damage(Creature critter, int statDamage); ! /** Increase a creature's stat. * @return The creature's new stat value. + * @param statBenefit The ammount to increase the stat of the creature. + * @param critter The creature that is getting its stat adjusted. */ public abstract int benefit(Creature critter, int statBenefit); Index: SubdualAdjuster.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/SubdualAdjuster.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SubdualAdjuster.java 28 Oct 2002 18:27:38 -0000 1.1 --- SubdualAdjuster.java 28 Oct 2002 19:36:11 -0000 1.2 *************** *** 7,13 **** package org.wettp2p.creature; ! /** ! * ! * @author Zyrca */ public class SubdualAdjuster implements StatAdjuster { --- 7,12 ---- package org.wettp2p.creature; ! /** Adjust the subdual damage to a creature. ! * @author Zyrca */ public class SubdualAdjuster implements StatAdjuster { *************** *** 18,25 **** /** Apply damage to a creature. - * @param critter The creature that is getting hit. - * @param damage The ammount of damage to apply to the creature. * @return The creature's new stat value. ! * */ public int damage(Creature critter, int statDamage) { --- 17,23 ---- /** Apply damage to a creature. * @return The creature's new stat value. ! * @param statDamage The ammount of damage to apply to the creature. ! * @param critter The creature that is getting hit. */ public int damage(Creature critter, int statDamage) { *************** *** 29,36 **** /** Increase a creature's stat. - * @param critter The creature that is getting its stat adjusted. - * @param damage The ammount to increase the stat of the creature. * @return The creature's new stat value. ! * */ public int benefit(Creature critter, int statBenefit) { --- 27,33 ---- /** Increase a creature's stat. * @return The creature's new stat value. ! * @param statBenefit The ammount to increase the stat of the creature. ! * @param critter The creature that is getting its stat adjusted. */ public int benefit(Creature critter, int statBenefit) { Index: SubdualAdjusterTest.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/SubdualAdjusterTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SubdualAdjusterTest.java 28 Oct 2002 18:27:38 -0000 1.1 --- SubdualAdjusterTest.java 28 Oct 2002 19:36:11 -0000 1.2 *************** *** 11,28 **** import org.netbeans.junit.*; ! /** ! * ! * @author Heather */ public class SubdualAdjusterTest extends NbTestCase { public SubdualAdjusterTest(java.lang.String testName) { super(testName); } public static void main(java.lang.String[] args) { junit.textui.TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new NbTestSuite(SubdualAdjusterTest.class); --- 11,36 ---- import org.netbeans.junit.*; ! /** Test. ! * @author Zyrca */ public class SubdualAdjusterTest extends NbTestCase { + /** Test. + * @param testName Test. + */ public SubdualAdjusterTest(java.lang.String testName) { super(testName); } + /** Test. + * @param args Test. + */ public static void main(java.lang.String[] args) { junit.textui.TestRunner.run(suite()); } + /** Test. + * @return Test. + */ public static Test suite() { TestSuite suite = new NbTestSuite(SubdualAdjusterTest.class); *************** *** 83,86 **** --- 91,113 ---- } + + /** Test of zero method, of class org.wettp2p.creature.SubdualAdjuster. */ + public void testZero() { + System.out.println("org.wettp2p.creature.SubdualAdjuster.testZero"); + + Creature critter = new Creature(); + critter.getAbilityScores().getCon().setBaseStat(13); + critter.getLevel().setBaseStat(3); + critter.getHitPoints().setByTotal(24); + StatAdjuster sa = new SubdualAdjuster(); + + sa.benefit(critter, 5); + sa.zero(critter); + + if(critter.getHitPoints().getStat() != 24) + fail("Temporary hit points were not zero'ed properly, should be 24, is: " + + critter.getHitPoints().getStat()); + + } } Index: WeaponTest.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/WeaponTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** WeaponTest.java 28 Oct 2002 18:27:38 -0000 1.1 --- WeaponTest.java 28 Oct 2002 19:36:12 -0000 1.2 *************** *** 11,28 **** import org.netbeans.junit.*; ! /** ! * ! * @author Heather */ public class WeaponTest extends NbTestCase { public WeaponTest(java.lang.String testName) { super(testName); } public static void main(java.lang.String[] args) { junit.textui.TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new NbTestSuite(WeaponTest.class); --- 11,36 ---- import org.netbeans.junit.*; ! /** Test. ! * @author Zyrca */ public class WeaponTest extends NbTestCase { + /** Test. + * @param testName Test. + */ public WeaponTest(java.lang.String testName) { super(testName); } + /** Test. + * @param args Test. + */ public static void main(java.lang.String[] args) { junit.textui.TestRunner.run(suite()); } + /** Test. + * @return Test. + */ public static Test suite() { TestSuite suite = new NbTestSuite(WeaponTest.class); |
Update of /cvsroot/wett-p2p/org/wettp2p/creature In directory usw-pr-cvs1:/tmp/cvs-serv18663 Modified Files: .nbattrs Creature.java CreatureSuite.java HitPoints.java HitPointsTest.java Weapon.java Added Files: HitPointAdjuster.java HitPointAdjusterTest.java StatAdjuster.java SubdualAdjuster.java SubdualAdjusterTest.java WeaponTest.java Removed Files: DCCheck.java~ Damage.java HitPointDamage.java Log Message: * Changed the StatAdjuster interface. * Added Temporary hit points to the HitPoints object. * Added the SubdualAdjuster class. --- NEW FILE: HitPointAdjuster.java --- /* * HitPointDamage.java * * Created on October 26, 2002, 1:26 PM */ package org.wettp2p.creature; /** Apply "normal" damage to a creature's hit points. * @author Zyrca */ public class HitPointAdjuster implements StatAdjuster { /** Creates a new instance of HitPointDamage */ public HitPointAdjuster() { } /** Decrease a critter's Hit Points. * @param critter The creature that is getting hit. * @param damage The ammount of damage to apply to the creature. * @return The creature's new stat value. */ public int damage(Creature critter, int statDamage) { critter.getHitPoints().adjAdj(- Math.abs(statDamage)); return critter.getHitPoints().getStat(); } /** Increase a critter's Hit Points. * @param critter The creature that is getting its stat adjusted. * @param damage The ammount to increase the stat of the creature. * @return The creature's new stat value. * */ public int benefit(Creature critter, int statBenefit) { critter.getHitPoints().adjAdj(Math.abs(statBenefit)); return critter.getHitPoints().getStat(); } /** Remove all adjustments to a creature's stat. * @param critter The creature that is having its stat zero'ed. * @return The creature's new stat value. */ public int zero(Creature critter) { critter.getHitPoints().setAdj(0); return critter.getHitPoints().getStat(); } } --- NEW FILE: HitPointAdjusterTest.java --- /* * HitPointDamageTest.java * NetBeans JUnit based test * * Created on October 26, 2002, 10:18 PM */ package org.wettp2p.creature; import junit.framework.*; import org.netbeans.junit.*; /** * * @author Heather */ public class HitPointAdjusterTest extends NbTestCase { public HitPointAdjusterTest(java.lang.String testName) { super(testName); } public static void main(java.lang.String[] args) { junit.textui.TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new NbTestSuite(HitPointAdjusterTest.class); return suite; } /** Test of inflict method, of class org.wettp2p.creature.HitPointAdjuster. */ public void testDamage() { System.out.println("org.wettp2p.creature.HitPointAdjuster.testDamage"); Creature critter = new Creature(); critter.getAbilityScores().getCon().setBaseStat(13); critter.getLevel().setBaseStat(3); critter.getHitPoints().setByTotal(24); StatAdjuster hurt = new HitPointAdjuster(); hurt.damage(critter, 10); hurt.benefit(critter, 5); if(critter.getHitPoints().getStat() != 19) fail("Creature was not damaged correctly, should be 19, is: " + critter.getHitPoints().getStat()); } /** Test of inflict method, of class org.wettp2p.creature.HitPointAdjuster. */ public void testBenefit() { System.out.println("org.wettp2p.creature.HitPointAdjuster.testBenefit"); Creature critter = new Creature(); critter.getAbilityScores().getCon().setBaseStat(13); critter.getLevel().setBaseStat(3); critter.getHitPoints().setByTotal(24); StatAdjuster hurt = new HitPointAdjuster(); hurt.damage(critter, 10); if(critter.getHitPoints().getStat() != 14) fail("Creature was not damaged correctly, should be 14, is: " + critter.getHitPoints().getStat()); hurt.benefit(critter, 15); if(critter.getHitPoints().getStat() != 24) fail("Creature was not damaged correctly, should be 24, is: " + critter.getHitPoints().getStat()); } } --- NEW FILE: StatAdjuster.java --- /* * Damage.java * * Created on October 26, 2002, 1:18 PM */ package org.wettp2p.creature; /** An interface which describes a method for applying a weapon's damage to a * creature. * @author Zyrca */ public interface StatAdjuster { /** Decrease a creature's stat. * @param critter The creature that is getting hit. * @param damage The ammount of damage to apply to the creature. * @return The creature's new stat value. */ public abstract int damage(Creature critter, int statDamage); /** Increase a creature's stat. * @param critter The creature that is getting its stat adjusted. * @param damage The ammount to increase the stat of the creature. * @return The creature's new stat value. */ public abstract int benefit(Creature critter, int statBenefit); /** Remove all adjustments to a creature's stat. * @param critter The creature that is having its stat zero'ed. * @return The creature's new stat value. */ public abstract int zero(Creature critter); } --- NEW FILE: SubdualAdjuster.java --- /* * SubdualAdjuster.java * * Created on October 28, 2002, 9:24 AM */ package org.wettp2p.creature; /** * * @author Zyrca */ public class SubdualAdjuster implements StatAdjuster { /** Creates a new instance of SubdualAdjuster */ public SubdualAdjuster() { } /** Apply damage to a creature. * @param critter The creature that is getting hit. * @param damage The ammount of damage to apply to the creature. * @return The creature's new stat value. * */ public int damage(Creature critter, int statDamage) { critter.getHitPoints().adjSubdual(- Math.abs(statDamage)); return critter.getHitPoints().getStat(); } /** Increase a creature's stat. * @param critter The creature that is getting its stat adjusted. * @param damage The ammount to increase the stat of the creature. * @return The creature's new stat value. * */ public int benefit(Creature critter, int statBenefit) { critter.getHitPoints().adjSubdual(Math.abs(statBenefit)); return critter.getHitPoints().getStat(); } /** Remove all adjustments to a creature's stat. * @param critter The creature that is having its stat zero'ed. * @return The creature's new stat value. */ public int zero(Creature critter) { critter.getHitPoints().setSubdual(0); return critter.getHitPoints().getStat(); } } --- NEW FILE: SubdualAdjusterTest.java --- /* * SubdualAdjusterTest.java * NetBeans JUnit based test * * Created on October 28, 2002, 9:29 AM */ package org.wettp2p.creature; import junit.framework.*; import org.netbeans.junit.*; /** * * @author Heather */ public class SubdualAdjusterTest extends NbTestCase { public SubdualAdjusterTest(java.lang.String testName) { super(testName); } public static void main(java.lang.String[] args) { junit.textui.TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new NbTestSuite(SubdualAdjusterTest.class); return suite; } /** Test of decrease method, of class org.wettp2p.creature.SubdualAdjuster. */ public void testDamage() { System.out.println("org.wettp2p.creature.SubdualAdjuster.testDamage"); Creature critter = new Creature(); critter.getAbilityScores().getCon().setBaseStat(15); critter.getLevel().setBaseStat(3); critter.getHitPoints().setByTotal(16); StatAdjuster hurt = new SubdualAdjuster(); hurt.damage(critter, 10); if(critter.getHitPoints().getStat() != 6) fail("Creature was not damaged correctly, should be 6, is: " + critter.getHitPoints().getStat()); if(critter.getHitPoints().getSubdual() != -10) fail("Creature was not damage correctly, subdual damage should be -10 is: " + critter.getHitPoints().getSubdual()); hurt.damage(critter, 6); if(critter.getHitPoints().health() != HitPoints.STAGGERED) fail("Creature was not damaged correctly, should be Staggered, is: " + critter.getHitPoints().healthStr()); } /** Test of increase method, of class org.wettp2p.creature.SubdualAdjuster. */ public void testBenefit() { System.out.println("org.wettp2p.creature.SubdualAdjuster.testBenefit"); Creature critter = new Creature(); critter.getAbilityScores().getCon().setBaseStat(15); critter.getLevel().setBaseStat(3); critter.getHitPoints().setByTotal(16); StatAdjuster hurt = new SubdualAdjuster(); hurt.damage(critter, 10); if(critter.getHitPoints().getStat() != 6) fail("Creature was not damaged correctly, should be 19, is: " + critter.getHitPoints().getStat()); hurt.benefit(critter, 20); if(critter.getHitPoints().getStat() != 16) fail("Creature was not banefitted correctly, should be 16, is: " + critter.getHitPoints().getStat()); } } --- NEW FILE: WeaponTest.java --- /* * WeaponTest.java * NetBeans JUnit based test * * Created on October 28, 2002, 8:56 AM */ package org.wettp2p.creature; import junit.framework.*; import org.netbeans.junit.*; /** * * @author Heather */ public class WeaponTest extends NbTestCase { public WeaponTest(java.lang.String testName) { super(testName); } public static void main(java.lang.String[] args) { junit.textui.TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new NbTestSuite(WeaponTest.class); return suite; } /** Test defaults of class org.wettp2p.creature.Weapon. */ public void testDefaultDamage(){ System.out.println("org.wettp2p.creature.Weapon.testDefaultDamage"); Weapon ua = new Weapon(); if(ua.getDamage().getClass().getName().compareTo("org.wettp2p.creature.SubdualAdjuster") != 0) fail("Wrong default damage type, should be org.wettp2p.creature.SubdualAdjuster, is: " + ua.getDamage().getClass().getName()); } /** Test defaults of class org.wettp2p.creature.Weapon. */ public void testDefaultDamageDice(){ System.out.println("org.wettp2p.creature.Weapon.testDefaultDamageDice"); Weapon ua = new Weapon(); if(ua.getDamageDice().compareTo("1d3") != 0) fail("Wrong default dice string, should be 1d3, is: " + ua.getDamage()); } /** Test defaults of class org.wettp2p.creature.Weapon. */ public void testDefaultSize(){ System.out.println("org.wettp2p.creature.Weapon.testDefaultSize"); Weapon ua = new Weapon(); if(ua.getSize().compareTo("Medium") != 0) fail("Wrong default weapon size, should be Medium, is: " + ua.getSize()); } /** Test defaults of class org.wettp2p.creature.Weapon. */ public void testDefaultIsMelee(){ System.out.println("org.wettp2p.creature.Weapon.testDefaultIsMelee"); Weapon ua = new Weapon(); if(!ua.IsMelee()) fail("Default weapon type should be Melee, it is not."); } /** Test defaults of class org.wettp2p.creature.Weapon. */ public void testDefaultIsRanged(){ System.out.println("org.wettp2p.creature.Weapon.testDefaultIsRanged"); Weapon ua = new Weapon(); if(ua.IsRanged()) fail("Default weapon should not be ranged, it is."); } /** Test defaults of class org.wettp2p.creature.Weapon. */ public void testDefaultRangeIncrement(){ System.out.println("org.wettp2p.creature.Weapon.testDefaultRangeIncrement"); Weapon ua = new Weapon(); if(ua.getRangeIncrement() != 0) fail("Default range increment should be 0, it is: " + ua.getRangeIncrement()); } /** Test defaults of class org.wettp2p.creature.Weapon. */ public void testDefaultCritical(){ System.out.println("org.wettp2p.creature.Weapon.testDefaultCritical"); Weapon ua = new Weapon(); if(ua.getCritical() != 2) fail("Default critical multiplier should be 2, it is: " + ua.getCritical()); } /** Test defaults of class org.wettp2p.creature.Weapon. */ public void testDefaultWeight(){ System.out.println("org.wettp2p.creature.Weapon.testDefaultWeight"); Weapon ua = new Weapon(); if(ua.getWeight() != 0) fail("Default weight should be 0, it is: " + ua.getWeight()); } /** Test defaults of class org.wettp2p.creature.Weapon. */ public void testDefaultDescription(){ System.out.println("org.wettp2p.creature.Weapon.testDefaultDescription"); Weapon ua = new Weapon(); if(ua.getDescription().compareTo("Standard Unarmed Attack.") != 0) fail("Default description should be 'Standard Unarmed Attack.' it is:" + ua.getDescription()); } } Index: .nbattrs =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/.nbattrs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** .nbattrs 27 Oct 2002 03:51:36 -0000 1.7 --- .nbattrs 28 Oct 2002 18:27:38 -0000 1.8 *************** *** 2,5 **** --- 2,11 ---- <!DOCTYPE attributes PUBLIC "-//NetBeans//DTD DefaultAttributes 1.0//EN" "http://www.netbeans.org/dtds/attributes-1_0.dtd"> <attributes version="1.0"> + <fileobject name="SubdualAdjusterTest.java"> + <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="SubdualAdjusterTest"/> + </fileobject> + <fileobject name="StatAdjuster.java"> + <attr name="EA-OpenIDE-Connection" serialvalue="aced0005737200146a6176612e7574696c2e4c696e6b65644c6973740c29535d4a60882203000078707704000000027372002a6f72672e6f70656e6964652e6c6f61646572732e436f6e6e656374696f6e537570706f72742450616972055f8af6f04a3bd80200024c00047479706574002b4c6f72672f6f70656e6964652f636f6f6b6965732f436f6e6e656374696f6e436f6f6b696524547970653b4c000576616c75657400124c6a6176612f6c616e672f4f626a6563743b78707372002e6f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661436f6e6e656374696f6e732454797065a83dd01001306d7402000149000666696c746572787000000050737200436f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661446174614f626a6563742450657273697374656e74436f6e6e656374696f6e48616e646c65ba16f1d2dd4c1cb60200014c000e646174614e6f646548616e646c6574001f4c6f72672f6f70656e6964652f6e6f6465732f4e6f64652448616e646c653b7870737200296f72672e6f70656e6964652e6c6f61646572732e446174614e6f6465244f626a65637448616e646c655bd0f82e01811d2e0200025a0005636c6f6e654c00036f626a7400244c6f72672f6f70656e6964652f66696c6573797374656d732f46696c654f626a6563743b787000737200326f72672e6f70656e6964652e66696c6573797374656d732e416273747261637446696c654f626a656374245265706c616365896fa1bce4b5219f0200024c000866696c654e616d657400124c6a6176612f6c616e672f537472696e673b4c000666734e616d6571007e000f787074002a6f72672f776574747032702f63726561747572652f486974506f696e7441646a75737465722e6a61766174004c433a2f446f63756d656e747320616e642053657474696e67732f486561746865722f4d7920446f63756d656e74732f50726f6772616d732f736f75726365666f7267652f776574742d7032707371007e00027371007e0006000000507371007e00087371007e000b007371007e000e7400296f72672f776574747032702f63726561747572652f5375626475616c41646a75737465722e6a61766171007e001278"/> + </fileobject> <fileobject name="AbilityScore.java"> <attr name="class_dependency_org.wettp2p.creature.Stat" stringvalue="AbilityScore"/> *************** *** 26,35 **** <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="HitPointsTest"/> </fileobject> - <fileobject name="HitPointDamage.java"> - <attr name="class_dependency_org.wettp2p.creature.Damage" stringvalue="HitPointDamage"/> - </fileobject> <fileobject name="StatTest.java"> <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="StatTest"/> </fileobject> <fileobject name="ArmorClassTest.java"> <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="ArmorClassTest"/> --- 32,44 ---- <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="HitPointsTest"/> </fileobject> <fileobject name="StatTest.java"> <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="StatTest"/> </fileobject> + <fileobject name="SubdualAdjuster.java"> + <attr name="class_dependency_org.wettp2p.creature.StatAdjuster" stringvalue="SubdualAdjuster"/> + </fileobject> + <fileobject name="HitPointAdjusterTest.java"> + <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="HitPointAdjusterTest"/> + </fileobject> <fileobject name="ArmorClassTest.java"> <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="ArmorClassTest"/> *************** *** 38,43 **** <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="SimpleNbJUnitTest"/> </fileobject> ! <fileobject name="Damage.java"> ! <attr name="EA-OpenIDE-Connection" serialvalue="aced0005737200146a6176612e7574696c2e4c696e6b65644c6973740c29535d4a60882203000078707704000000017372002a6f72672e6f70656e6964652e6c6f61646572732e436f6e6e656374696f6e537570706f72742450616972055f8af6f04a3bd80200024c00047479706574002b4c6f72672f6f70656e6964652f636f6f6b6965732f436f6e6e656374696f6e436f6f6b696524547970653b4c000576616c75657400124c6a6176612f6c616e672f4f626a6563743b78707372002e6f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661436f6e6e656374696f6e732454797065a83dd01001306d7402000149000666696c746572787000000050737200436f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661446174614f626a6563742450657273697374656e74436f6e6e656374696f6e48616e646c65ba16f1d2dd4c1cb60200014c000e646174614e6f646548616e646c6574001f4c6f72672f6f70656e6964652f6e6f6465732f4e6f64652448616e646c653b7870737200296f72672e6f70656e6964652e6c6f61646572732e446174614e6f6465244f626a65637448616e646c655bd0f82e01811d2e0200025a0005636c6f6e654c00036f626a7400244c6f72672f6f70656e6964652f66696c6573797374656d732f46696c654f626a6563743b787000737200326f72672e6f70656e6964652e66696c6573797374656d732e416273747261637446696c654f626a656374245265706c616365896fa1bce4b5219f0200024c000866696c654e616d657400124c6a6176612f6c616e672f537472696e673b4c000666734e616d6571007e000f78707400286f72672f776574747032702f63726561747572652f486974506f696e7444616d6167652e6a61766174004c433a2f446f63756d656e747320616e642053657474696e67732f486561746865722f4d7920446f63756d656e74732f50726f6772616d732f736f75726365666f7267652f776574742d70327078"/> </fileobject> <fileobject name="Alignment.java"> --- 47,52 ---- <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="SimpleNbJUnitTest"/> </fileobject> ! <fileobject name="WeaponTest.java"> ! <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="WeaponTest"/> </fileobject> <fileobject name="Alignment.java"> *************** *** 50,53 **** --- 59,65 ---- <fileobject name="CreatureSizeTest.java"> <attr name="class_dependency_org.netbeans.junit.NbTestCase" stringvalue="CreatureSizeTest"/> + </fileobject> + <fileobject name="HitPointAdjuster.java"> + <attr name="class_dependency_org.wettp2p.creature.StatAdjuster" stringvalue="HitPointAdjuster"/> </fileobject> <fileobject name="AlignmentTest.java"> Index: Creature.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/Creature.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Creature.java 27 Oct 2002 03:12:09 -0000 1.7 --- Creature.java 28 Oct 2002 18:27:38 -0000 1.8 *************** *** 44,48 **** myAlig = new Alignment(); myAbilityScores = new AbilityScores(); - myHitPoints = new HitPoints(); myLevel = new Stat("Level", "LVL"); myXP = new Stat("Experience Points", "XP"); --- 44,47 ---- *************** *** 53,56 **** --- 52,57 ---- myMeleeMod = new DieRollAdj("Melee Attack Mod", "Melee", myAbilityScores.getStr()); myRangedMod = new DieRollAdj("Ranged Attack Mod", "Ranged", myAbilityScores.getDex()); + + myHitPoints = new HitPoints(myLevel, myAbilityScores.getCon()); } Index: CreatureSuite.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/CreatureSuite.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CreatureSuite.java 27 Oct 2002 03:12:09 -0000 1.5 --- CreatureSuite.java 28 Oct 2002 18:27:38 -0000 1.6 *************** *** 47,50 **** --- 47,53 ---- suite.addTest(org.wettp2p.creature.HitPointsTest.suite()); suite.addTest(org.wettp2p.creature.ArmorClassTest.suite()); + suite.addTest(org.wettp2p.creature.HitPointAdjusterTest.suite()); + suite.addTest(org.wettp2p.creature.WeaponTest.suite()); + suite.addTest(org.wettp2p.creature.SubdualAdjusterTest.suite()); //:JUNIT-- //This value MUST ALWAYS be returned from this function. Index: HitPoints.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/HitPoints.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** HitPoints.java 27 Oct 2002 03:51:36 -0000 1.2 --- HitPoints.java 28 Oct 2002 18:27:38 -0000 1.3 *************** *** 12,15 **** --- 12,16 ---- public class HitPoints extends DieRollAdj { private int mySubdual; + private int myTemporary; private AbilityScore myCon; private Stat myLevel; *************** *** 65,68 **** --- 66,70 ---- myAdj = 0; mySubdual = 0; + myTemporary = 0; myStatName = "Hit Points"; myStatAbbrev = "HP"; *************** *** 100,106 **** */ public int getStat(){ ! return myStat + myAdj + mySubdual + myCon.getModifier() * myLevel.getStat(); } /** Make an adjustment to the creature's subdual hit points. * @param adj An adjustment to the creature's subdual hit points. --- 102,124 ---- */ public int getStat(){ ! int curHP = myStat + myAdj + mySubdual + myTemporary + myCon.getModifier() * myLevel.getStat(); ! ! if(curHP > (getBaseHP() + myTemporary)) return (getBaseHP() + myTemporary); ! else return curHP; } + + /** Get subdual hit points. + * @return Subdual Hit Points. + */ + public int getSubdual(){ + return mySubdual; + } + /** Get temporary hit points. + * @return Temporary Hit Points. + */ + public int getTemporary(){ + return myTemporary; + } /** Make an adjustment to the creature's subdual hit points. * @param adj An adjustment to the creature's subdual hit points. *************** *** 109,112 **** --- 127,150 ---- mySubdual += adj; } + /** Adjust temporary hit points. + * @param adj Temporary hit point adjustment. + */ + public void adjTemporary(int adj){ + myTemporary += adj; + } + + /** Set the subdual hit points. + * @param subd Subdual hit points. + */ + public void setSubdual(int subd){ + mySubdual = subd; + } + + /** Set temporary hit points. + * @param temp Temporary Hit Points. + */ + public void setTemporary(int temp){ + myTemporary = temp; + } /** Remove all adjustment and subdual damage from the character. */ *************** *** 114,117 **** --- 152,156 ---- mySubdual = 0; myAdj = 0; + myTemporary = 0; } Index: HitPointsTest.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/HitPointsTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** HitPointsTest.java 27 Oct 2002 03:51:36 -0000 1.2 --- HitPointsTest.java 28 Oct 2002 18:27:38 -0000 1.3 *************** *** 47,50 **** --- 47,52 ---- if(hp.getBaseHP() != 1) fail("Default base HP should be 1, is: " + hp.getBaseHP()); + + } Index: Weapon.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/Weapon.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Weapon.java 27 Oct 2002 03:51:36 -0000 1.2 --- Weapon.java 28 Oct 2002 18:27:38 -0000 1.3 *************** *** 11,15 **** */ public class Weapon { ! private String myDamage; private String mySize; private String myDescription; --- 11,16 ---- */ public class Weapon { ! private StatAdjuster myDamage; ! private String myDamageDice; private String mySize; private String myDescription; *************** *** 22,26 **** /** Creates a new instance of Weapon */ public Weapon() { ! myDamage = "1d3"; mySize = "Medium"; myIsMelee = true; --- 23,28 ---- /** Creates a new instance of Weapon */ public Weapon() { ! myDamage = new SubdualAdjuster(); ! myDamageDice = "1d3"; mySize = "Medium"; myIsMelee = true; *************** *** 30,34 **** myWeight = 0; ! myDescription = "No description given."; } --- 32,36 ---- myWeight = 0; ! myDescription = "Standard Unarmed Attack."; } *************** *** 36,40 **** * @return Get the weapon's damage object. */ ! public String getDamage(){ return myDamage; } /** Weapon Size * @return The size of the weapon. --- 38,47 ---- * @return Get the weapon's damage object. */ ! public StatAdjuster getDamage() { return myDamage; } ! ! /** Weapon Damage Dice ! * @return Get the weapon's damage dice string. ! */ ! public String getDamageDice(){ return myDamageDice; } /** Weapon Size * @return The size of the weapon. *************** *** 67,99 **** public int getWeight() { return myWeight; } /** Set the weapon's damage roll. ! * @param Damage Weapon's damage roll as a string, such as 1d4. */ ! public void setDamage( String Damage ) { myDamage = Damage; } /** Set the size of the weapon. ! * @param Size The size of the weapon. */ ! public void setSize( String Size ) { mySize = Size; } //public void setDamageType( String DamageType ) { myDamageType = DamageType; } /** Set the description of the weapon. ! * @param Description The description of the weapon. */ ! public void setDescription( String Description ) { myDescription = Description; } /** Set if the weapon can be used as a ranged weapon. ! * @param IsRanged If the weapon can be used as a ranged weapon. */ ! public void setIsRanged( boolean IsRanged ) { myIsRanged = IsRanged; } /** Set the critical multiplier on the weapon. ! * @param Critical The critical multiplier on the weapon. */ ! public void setCritical( int Critical ) { myCritical = Critical; } /** Set the range increment on the weapon if its a ranged weapon. ! * @param RangeIncrement The range increment. */ ! public void setRangeIncrement( int RangeIncrement ) { myRangeIncrement = RangeIncrement; } /** Set the weight (in lbs) of the weapon. ! * @param Weight The weight of the weapon. */ ! public void setWeight( int Weight ) { myWeight = Weight; } } --- 74,110 ---- public int getWeight() { return myWeight; } + /** Set the weapon's damage object. + * @param damage Weapon damage object. + */ + public void setDamage( StatAdjuster damage ) { myDamage = damage; } /** Set the weapon's damage roll. ! * @param damage Weapon's damage roll as a string, such as 1d4. */ ! public void setDamageDice( String damage ) { myDamageDice = damage; } /** Set the size of the weapon. ! * @param size The size of the weapon. */ ! public void setSize( String size ) { mySize = size; } //public void setDamageType( String DamageType ) { myDamageType = DamageType; } /** Set the description of the weapon. ! * @param description The description of the weapon. */ ! public void setDescription( String description ) { myDescription = description; } /** Set if the weapon can be used as a ranged weapon. ! * @param isRanged If the weapon can be used as a ranged weapon. */ ! public void setIsRanged( boolean isRanged ) { myIsRanged = isRanged; } /** Set the critical multiplier on the weapon. ! * @param critical The critical multiplier on the weapon */ ! public void setCritical( int critical ) { myCritical = critical; } /** Set the range increment on the weapon if its a ranged weapon. ! * @param rangeIncrement The range increment. */ ! public void setRangeIncrement( int rangeIncrement ) { myRangeIncrement = rangeIncrement; } /** Set the weight (in lbs) of the weapon. ! * @param weight The weight of the weapon. */ ! public void setWeight( int weight ) { myWeight = weight; } } --- DCCheck.java~ DELETED --- --- Damage.java DELETED --- --- HitPointDamage.java DELETED --- |
Update of /cvsroot/wett-p2p/org/wettp2p/creature In directory usw-pr-cvs1:/tmp/cvs-serv29219 Modified Files: .nbattrs ArmorClassTest.java Damage.java HitPointDamage.java HitPoints.java HitPointsTest.java Weapon.java Log Message: Finished filling in the JavaDoc. Index: .nbattrs =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/.nbattrs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** .nbattrs 27 Oct 2002 03:12:09 -0000 1.6 --- .nbattrs 27 Oct 2002 03:51:36 -0000 1.7 *************** *** 45,50 **** </fileobject> <fileobject name="DieRollAdj.java"> - <attr name="EA-OpenIDE-Connection" serialvalue="aced0005737200146a6176612e7574696c2e4c696e6b65644c6973740c29535d4a60882203000078707704000000017372002a6f72672e6f70656e6964652e6c6f61646572732e436f6e6e656374696f6e537570706f72742450616972055f8af6f04a3bd80200024c00047479706574002b4c6f72672f6f70656e6964652f636f6f6b6965732f436f6e6e656374696f6e436f6f6b696524547970653b4c000576616c75657400124c6a6176612f6c616e672f4f626a6563743b78707372002e6f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661436f6e6e656374696f6e732454797065a83dd01001306d7402000149000666696c746572787000000050737200436f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661446174614f626a6563742450657273697374656e74436f6e6e656374696f6e48616e646c65ba16f1d2dd4c1cb60200014c000e646174614e6f646548616e646c6574001f4c6f72672f6f70656e6964652f6e6f6465732f4e6f64652448616e646c653b7870737200296f72672e6f70656e6964652e6c6f61646572732e446174614e6f6465244f626a65637448616e646c655bd0f82e01811d2e0200025a0005636c6f6e654c00036f626a7400244c6f72672f6f70656e6964652f66696c6573797374656d732f46696c654f626a6563743b787000737200326f72672e6f70656e6964652e66696c6573797374656d732e416273747261637446696c654f626a656374245265706c616365896fa1bce4b5219f0200024c000866696c654e616d657400124c6a6176612f6c616e672f537472696e673b4c000666734e616d6571007e000f78707400236f72672f776574747032702f63726561747572652f486974506f696e74732e6a61766174004c433a2f446f63756d656e747320616e642053657474696e67732f486561746865722f4d7920446f63756d656e74732f50726f6772616d732f736f75726365666f7267652f776574742d70327078"/> <attr name="class_dependency_org.wettp2p.creature.Stat" stringvalue="DieRollAdj"/> </fileobject> <fileobject name="CreatureSizeTest.java"> --- 45,50 ---- </fileobject> <fileobject name="DieRollAdj.java"> <attr name="class_dependency_org.wettp2p.creature.Stat" stringvalue="DieRollAdj"/> + <attr name="EA-OpenIDE-Connection" serialvalue="aced0005737200146a6176612e7574696c2e4c696e6b65644c6973740c29535d4a60882203000078707704000000017372002a6f72672e6f70656e6964652e6c6f61646572732e436f6e6e656374696f6e537570706f72742450616972055f8af6f04a3bd80200024c00047479706574002b4c6f72672f6f70656e6964652f636f6f6b6965732f436f6e6e656374696f6e436f6f6b696524547970653b4c000576616c75657400124c6a6176612f6c616e672f4f626a6563743b78707372002e6f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661436f6e6e656374696f6e732454797065a83dd01001306d7402000149000666696c746572787000000050737200436f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661446174614f626a6563742450657273697374656e74436f6e6e656374696f6e48616e646c65ba16f1d2dd4c1cb60200014c000e646174614e6f646548616e646c6574001f4c6f72672f6f70656e6964652f6e6f6465732f4e6f64652448616e646c653b7870737200296f72672e6f70656e6964652e6c6f61646572732e446174614e6f6465244f626a65637448616e646c655bd0f82e01811d2e0200025a0005636c6f6e654c00036f626a7400244c6f72672f6f70656e6964652f66696c6573797374656d732f46696c654f626a6563743b787000737200326f72672e6f70656e6964652e66696c6573797374656d732e416273747261637446696c654f626a656374245265706c616365896fa1bce4b5219f0200024c000866696c654e616d657400124c6a6176612f6c616e672f537472696e673b4c000666734e616d6571007e000f78707400236f72672f776574747032702f63726561747572652f486974506f696e74732e6a61766174004c433a2f446f63756d656e747320616e642053657474696e67732f486561746865722f4d7920446f63756d656e74732f50726f6772616d732f736f75726365666f7267652f776574742d70327078"/> </fileobject> <fileobject name="CreatureSizeTest.java"> Index: ArmorClassTest.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/ArmorClassTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ArmorClassTest.java 27 Oct 2002 03:12:09 -0000 1.1 --- ArmorClassTest.java 27 Oct 2002 03:51:36 -0000 1.2 *************** *** 11,28 **** import org.netbeans.junit.*; ! /** ! * ! * @author Heather */ public class ArmorClassTest extends NbTestCase { public ArmorClassTest(java.lang.String testName) { super(testName); } public static void main(java.lang.String[] args) { junit.textui.TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new NbTestSuite(ArmorClassTest.class); --- 11,36 ---- import org.netbeans.junit.*; ! /** Test ! * @author Zyrca */ public class ArmorClassTest extends NbTestCase { + /** Test + * @param testName Test + */ public ArmorClassTest(java.lang.String testName) { super(testName); } + /** Test + * @param args Test + */ public static void main(java.lang.String[] args) { junit.textui.TestRunner.run(suite()); } + /** Test + * @return Test + */ public static Test suite() { TestSuite suite = new NbTestSuite(ArmorClassTest.class); Index: Damage.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/Damage.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Damage.java 27 Oct 2002 03:12:09 -0000 1.1 --- Damage.java 27 Oct 2002 03:51:36 -0000 1.2 *************** *** 7,15 **** package org.wettp2p.creature; ! /** ! * ! * @author Zyrca */ public interface Damage { public abstract int inflict(Creature critter, int damage); } --- 7,20 ---- package org.wettp2p.creature; ! /** An interface which describes a method for applying a weapon's damage to a ! * creature. ! * @author Zyrca */ public interface Damage { + /** Apply damage to a critter. + * @param critter The creature that is getting hit. + * @param damage The ammount of damage to apply to the creature. + * @return The creature's new stat value. + */ public abstract int inflict(Creature critter, int damage); } Index: HitPointDamage.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/HitPointDamage.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** HitPointDamage.java 27 Oct 2002 03:12:09 -0000 1.1 --- HitPointDamage.java 27 Oct 2002 03:51:36 -0000 1.2 *************** *** 7,13 **** package org.wettp2p.creature; ! /** ! * ! * @author Zyrca */ public class HitPointDamage implements Damage { --- 7,12 ---- package org.wettp2p.creature; ! /** Apply "normal" damage to a creature's hit points. ! * @author Zyrca */ public class HitPointDamage implements Damage { *************** *** 17,20 **** --- 16,24 ---- } + /** Inflict hit point damage onto a creature. + * @param critter The creature being damaged. + * @param damage The ammount of damage to apply to the creature's hit points. + * @return The ammount of hit points the creature has after the attack. + */ public int inflict(Creature critter, int damage) { critter.getHitPoints().adjAdj(damage); Index: HitPoints.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/HitPoints.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** HitPoints.java 27 Oct 2002 03:12:09 -0000 1.1 --- HitPoints.java 27 Oct 2002 03:51:36 -0000 1.2 *************** *** 89,92 **** --- 89,95 ---- } + /** Get the base hit point value. + * @return The base hit point value before constitution mod or any other mods. + */ public int getBaseHP(){ return myStat + myCon.getModifier() * myLevel.getStat(); Index: HitPointsTest.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/HitPointsTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** HitPointsTest.java 27 Oct 2002 03:12:09 -0000 1.1 --- HitPointsTest.java 27 Oct 2002 03:51:36 -0000 1.2 *************** *** 11,28 **** import org.netbeans.junit.*; ! /** ! * * @author Zyrca */ public class HitPointsTest extends NbTestCase { public HitPointsTest(java.lang.String testName) { super(testName); } public static void main(java.lang.String[] args) { junit.textui.TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new NbTestSuite(HitPointsTest.class); --- 11,36 ---- import org.netbeans.junit.*; ! /** Test * @author Zyrca */ public class HitPointsTest extends NbTestCase { + /** Test + * @param testName Test + */ public HitPointsTest(java.lang.String testName) { super(testName); } + /** Test + * @param args Test + */ public static void main(java.lang.String[] args) { junit.textui.TestRunner.run(suite()); } + /** Test + * @return Test + */ public static Test suite() { TestSuite suite = new NbTestSuite(HitPointsTest.class); Index: Weapon.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/Weapon.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Weapon.java 27 Oct 2002 03:12:10 -0000 1.1 --- Weapon.java 27 Oct 2002 03:51:36 -0000 1.2 *************** *** 7,11 **** package org.wettp2p.creature; ! /** * @author Zyrca */ --- 7,11 ---- package org.wettp2p.creature; ! /** A weapon that is used to hurt another creature. * @author Zyrca */ *************** *** 33,53 **** --- 33,98 ---- } + /** Weapon Damage + * @return Get the weapon's damage object. + */ public String getDamage(){ return myDamage; } + /** Weapon Size + * @return The size of the weapon. + */ public String getSize() { return mySize; } //public String getDamageType() { return myDamageType; } + /** Weapon Description. + * @return The weapon's description. + */ public String getDescription() { return myDescription; } + /** Flag to tell if the weapon can be used in melee combat or not. + * @return Can the weapon be used in melee combat. + */ public boolean IsMelee() { return myIsMelee; } + /** Flag to tell if the weapon can be used in ranged combat or not. + * @return Can the weapon be used in ranged combat. + */ public boolean IsRanged() { return myIsRanged; } + /** Get the multiplier on critical hits. + * @return The multiplier on critical hits. + */ public int getCritical() { return myCritical; } + /** Get the range increment on ranged weapons. + * @return Range increment. + */ public int getRangeIncrement() { return myRangeIncrement; } + /** The weight (in lbs) of the weapon. + * @return Weight of the weapon. + */ public int getWeight() { return myWeight; } + /** Set the weapon's damage roll. + * @param Damage Weapon's damage roll as a string, such as 1d4. + */ public void setDamage( String Damage ) { myDamage = Damage; } + /** Set the size of the weapon. + * @param Size The size of the weapon. + */ public void setSize( String Size ) { mySize = Size; } //public void setDamageType( String DamageType ) { myDamageType = DamageType; } + /** Set the description of the weapon. + * @param Description The description of the weapon. + */ public void setDescription( String Description ) { myDescription = Description; } + /** Set if the weapon can be used as a ranged weapon. + * @param IsRanged If the weapon can be used as a ranged weapon. + */ public void setIsRanged( boolean IsRanged ) { myIsRanged = IsRanged; } + /** Set the critical multiplier on the weapon. + * @param Critical The critical multiplier on the weapon. + */ public void setCritical( int Critical ) { myCritical = Critical; } + /** Set the range increment on the weapon if its a ranged weapon. + * @param RangeIncrement The range increment. + */ public void setRangeIncrement( int RangeIncrement ) { myRangeIncrement = RangeIncrement; } + /** Set the weight (in lbs) of the weapon. + * @param Weight The weight of the weapon. + */ public void setWeight( int Weight ) { myWeight = Weight; } |
From: <zy...@us...> - 2002-10-26 06:48:57
|
Update of /cvsroot/wett-p2p/org/wettp2p/creature In directory usw-pr-cvs1:/tmp/cvs-serv23868 Modified Files: Creature.java Creature.java~ Log Message: Added melee and ranged modifiers. Index: Creature.java =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/Creature.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Creature.java 24 Oct 2002 03:44:59 -0000 1.5 --- Creature.java 26 Oct 2002 06:48:51 -0000 1.6 *************** *** 34,37 **** --- 34,40 ---- // Combat private DieRollAdj myInitiative; + private DieRollAdj myMeleeMod; + private DieRollAdj myRangedMod; + *************** *** 45,49 **** mySize = new CreatureSize(); myAC = new ArmorClass(); ! myInitiative = new DieRollAdj(); } --- 48,54 ---- mySize = new CreatureSize(); myAC = new ArmorClass(); ! myInitiative = new DieRollAdj("Initiative", "INIT", myAbilityScores.getDex()); ! myMeleeMod = new DieRollAdj("Melee Attack Mod", "Melee", myAbilityScores.getStr()); ! myRangedMod = new DieRollAdj("Ranged Attack Mod", "Ranged", myAbilityScores.getDex()); } Index: Creature.java~ =================================================================== RCS file: /cvsroot/wett-p2p/org/wettp2p/creature/Creature.java~,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Creature.java~ 24 Oct 2002 03:44:59 -0000 1.5 --- Creature.java~ 26 Oct 2002 06:48:51 -0000 1.6 *************** *** 33,37 **** private ArmorClass myAC; // Combat ! private DCCheck myInitiative; --- 33,39 ---- private ArmorClass myAC; // Combat ! private DieRollAdj myInitiative; ! private DieRollAdj myMeleeMod; ! private DieRollAdj myRangedMod; *************** *** 45,49 **** mySize = new CreatureSize(); myAC = new ArmorClass(); ! myInitiative = new DCCheck(); } --- 47,53 ---- mySize = new CreatureSize(); myAC = new ArmorClass(); ! myInitiative = new DieRollAdj("Initiative", "INIT", myAbilityScores.getDex()); ! myMeleeMod = new DieRollAdj("Melee Attack Mod", "Melee", myAbilityScores.getStr()); ! myRangedMod = new DieRollAdj("Ranged Attack Mod", "Ranged", myAbilityScores.getDex()); } *************** *** 119,123 **** */ public CreatureSize getSize() { return mySize; } ! public DCCheck getInitiative() { return myInitiative; } --- 123,127 ---- */ public CreatureSize getSize() { return mySize; } ! public DieRollAdj getInitiative() { return myInitiative; } |