[ogs-changes] dist/c++/ogs/feats AllWeapons.cpp,1.1,1.2 AllWeapons.h,1.1,1.2 ArmorProficiency.cpp,1.
Status: Alpha
Brought to you by:
elemings
|
From: <ele...@us...> - 2003-04-04 20:23:20
|
Update of /cvsroot/ogs/dist/c++/ogs/feats
In directory sc8-pr-cvs1:/tmp/cvs-serv9450/c++/ogs/feats
Modified Files:
AllWeapons.cpp AllWeapons.h ArmorProficiency.cpp
ImprovedSave.cpp
Removed Files:
SimpleWeapon.h
Log Message:
See ChangeLog files (Apr 3-4) for details.
Index: AllWeapons.cpp
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/feats/AllWeapons.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** AllWeapons.cpp 29 Mar 2003 02:10:36 -0000 1.1
--- AllWeapons.cpp 4 Apr 2003 20:22:45 -0000 1.2
***************
*** 30,51 ****
/**
- * Create a new Simple Weapons Proficiency feat.
- *
- * @return A new Simple Weapons Proficiency feat.
- */
- AllWeapons* AllWeapons::createSimple () {
- return (new AllWeapons (Weapon::SIMPLE));
- }
-
- /**
- * Create a new Martial Weapons Proficiency feat.
- *
- * @return A new Martial Weapons Proficiency feat.
- */
- AllWeapons* AllWeapons::createMartial () {
- return (new AllWeapons (Weapon::MARTIAL));
- }
-
- /**
* Create a new weapon proficiency feat for all wapons of a specified
* group.
--- 30,33 ----
Index: AllWeapons.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/feats/AllWeapons.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** AllWeapons.h 29 Mar 2003 02:10:36 -0000 1.1
--- AllWeapons.h 4 Apr 2003 20:22:46 -0000 1.2
***************
*** 28,31 ****
--- 28,32 ----
# include <ogs/feats/Namespace.h>
# include <ogs/feats/WeaponProficiency.h>
+ # include <ogs/items/Weapon.h>
OGS_BEGIN_FEATS_NAMESPACE
***************
*** 58,61 ****
--- 59,82 ----
bool canAttach (const Object& object) const;
};
+
+ /**
+ * Create a new Simple Weapons Proficiency feat.
+ *
+ * @return A new Simple Weapons Proficiency feat.
+ */
+ inline AllWeapons*
+ AllWeapons::createSimple () {
+ return (new AllWeapons (ogs::items::Weapon::SIMPLE));
+ }
+
+ /**
+ * Create a new Martial Weapons Proficiency feat.
+ *
+ * @return A new Martial Weapons Proficiency feat.
+ */
+ inline AllWeapons*
+ AllWeapons::createMartial () {
+ return (new AllWeapons (ogs::items::Weapon::MARTIAL));
+ }
/**
Index: ArmorProficiency.cpp
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/feats/ArmorProficiency.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ArmorProficiency.cpp 29 Mar 2003 02:10:36 -0000 1.5
--- ArmorProficiency.cpp 4 Apr 2003 20:22:46 -0000 1.6
***************
*** 88,104 ****
const Creature& creature = dynamic_cast<const Creature&> (object);
if (this->_proficiency == Armor::LIGHT) {
! if (! findArmorProficiency (creature, Armor::LIGHT)) {
! success = true;
! }
} else if (this->_proficiency == Armor::MEDIUM) {
! if (findArmorProficiency (creature, Armor::LIGHT) &&
! !findArmorProficiency (creature, Armor::MEDIUM)) {
! success = true;
! }
} else if (this->_proficiency == Armor::HEAVY) {
! if (findArmorProficiency (creature, Armor::MEDIUM) &&
! !findArmorProficiency (creature, Armor::HEAVY)) {
! success = true;
! }
}
--- 88,98 ----
const Creature& creature = dynamic_cast<const Creature&> (object);
if (this->_proficiency == Armor::LIGHT) {
! success = ! findArmorProficiency (creature, Armor::LIGHT);
} else if (this->_proficiency == Armor::MEDIUM) {
! success = findArmorProficiency (creature, Armor::LIGHT) &&
! !findArmorProficiency (creature, Armor::MEDIUM);
} else if (this->_proficiency == Armor::HEAVY) {
! success = findArmorProficiency (creature, Armor::MEDIUM) &&
! !findArmorProficiency (creature, Armor::HEAVY);
}
***************
*** 110,114 ****
*
* @param creature Creature to be checked for proficiency.
! * @param proficiency Proficiency of armor proficiency.
* @return True if creature has armor proficiency.
*/
--- 104,108 ----
*
* @param creature Creature to be checked for proficiency.
! * @param proficiency Proficiency of armor.
* @return True if creature has armor proficiency.
*/
***************
*** 120,132 ****
bool found = false;
! while (itor != feats.end ()) {
using ogs::core::Feat;
Feat* feat = *itor++;
ArmorProficiency* armorProficiency =
dynamic_cast <ArmorProficiency*> (feat);
if (armorProficiency != NULL) {
! if (armorProficiency->getProficiency () == proficiency) {
! found = true;
! }
}
}
--- 114,125 ----
bool found = false;
! while (!found && itor != feats.end ()) {
using ogs::core::Feat;
Feat* feat = *itor++;
ArmorProficiency* armorProficiency =
dynamic_cast <ArmorProficiency*> (feat);
+
if (armorProficiency != NULL) {
! found = armorProficiency->getProficiency () == proficiency;
}
}
***************
*** 144,162 ****
*/
bool ArmorProficiency::isProficient (const Armor& armor) const {
! bool proficient = false;
!
! if (getObject () != NULL) {
! Armor::Proficiency proficiency = armor.getProficiency ();
! if (this->_proficiency == Armor::HEAVY) {
! proficient = true;
! } else if (this->_proficiency == Armor::MEDIUM &&
! proficiency != Armor::HEAVY) {
! proficient = true;
! } else if (proficiency == Armor::LIGHT) {
! proficient = true;
! }
! }
!
! return (proficient);
}
--- 137,146 ----
*/
bool ArmorProficiency::isProficient (const Armor& armor) const {
! Armor::Proficiency proficiency = armor.getProficiency ();
! return (getObject () != NULL &&
! this->_proficiency == Armor::HEAVY ||
! (this->_proficiency == Armor::MEDIUM &&
! proficiency != Armor::HEAVY) ||
! proficiency == Armor::LIGHT);
}
Index: ImprovedSave.cpp
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/feats/ImprovedSave.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ImprovedSave.cpp 29 Mar 2003 02:10:37 -0000 1.2
--- ImprovedSave.cpp 4 Apr 2003 20:22:46 -0000 1.3
***************
*** 127,134 ****
bool ImprovedSave::detachObject () {
Creature* creature = dynamic_cast<Creature*> (getObject ());
- assert (creature != NULL);
-
bool detached = detachObject ();
! if (detached) {
Saves& saves = creature->getSaves ();
if (this->_type == GREAT_FORTITUDE) {
--- 127,133 ----
bool ImprovedSave::detachObject () {
Creature* creature = dynamic_cast<Creature*> (getObject ());
bool detached = detachObject ();
!
! if (creature != NULL && detached) {
Saves& saves = creature->getSaves ();
if (this->_type == GREAT_FORTITUDE) {
--- SimpleWeapon.h DELETED ---
|