[ogs-changes] dist/c++/ogs/feats Alertness.cpp,1.3,1.4 AllWeapons.cpp,1.2,1.3 ArmorProficiency.cpp,1
Status: Alpha
Brought to you by:
elemings
|
From: <ele...@us...> - 2003-04-13 05:27:09
|
Update of /cvsroot/ogs/dist/c++/ogs/feats
In directory sc8-pr-cvs1:/tmp/cvs-serv9407
Modified Files:
Alertness.cpp AllWeapons.cpp ArmorProficiency.cpp
ImprovedSave.cpp
Log Message:
See C++ ChangeLog (Apr 13) for details.
Index: Alertness.cpp
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/feats/Alertness.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Alertness.cpp 29 Mar 2003 02:10:35 -0000 1.3
--- Alertness.cpp 13 Apr 2003 05:27:06 -0000 1.4
***************
*** 22,30 ****
#include "ogs/core/Creature.h"
#include "ogs/feats/Alertness.h"
! #include "ogs/skills/Listen.h"
! #include "ogs/skills/Spot.h"
- using ogs::core::Creature;
using ogs::feats::Alertness;
--- 22,29 ----
#include "ogs/core/Creature.h"
+ #include "ogs/core/Types.h"
#include "ogs/feats/Alertness.h"
! #include "ogs/skills/CommonSkills.h"
using ogs::feats::Alertness;
***************
*** 73,93 ****
*/
void Alertness::addSkillModifier (Object& object) {
Creature* creature = dynamic_cast<Creature*> (&object);
if (creature != NULL) {
! Creature::Skills skills = creature->getSkills ();
! Creature::Skills::iterator itor = skills.begin ();
while (itor != skills.end ()) {
using ogs::core::Modifiers;
! using ogs::skills::Listen;
! Listen* listenSkill = dynamic_cast<Listen*> (*itor++);
! if (listenSkill != NULL) {
! Modifiers& modifiers = listenSkill->getModifiers ();
modifiers.addModifier (this->_modifier);
} else {
! using ogs::skills::Spot;
! Spot* spotSkill = dynamic_cast<Spot*> (*itor);
! if (spotSkill != NULL) {
! Modifiers& modifiers = spotSkill->getModifiers ();
modifiers.addModifier (this->_modifier);
}
--- 72,95 ----
*/
void Alertness::addSkillModifier (Object& object) {
+ using ogs::core::Creature;
Creature* creature = dynamic_cast<Creature*> (&object);
+
if (creature != NULL) {
! using ogs::core::Skills;
! Skills skills = creature->getSkills ();
! Skills::iterator itor = skills.begin ();
while (itor != skills.end ()) {
+ using ogs::core::SkillPtr;
using ogs::core::Modifiers;
! using ogs::skills::CommonSkills;
! SkillPtr skillPtr = *itor++;
!
! if (skillPtr->getType () == CommonSkills::LISTEN) {
! Modifiers& modifiers = skillPtr->getModifiers ();
modifiers.addModifier (this->_modifier);
} else {
! if (skillPtr->getType () == CommonSkills::SPOT) {
! Modifiers& modifiers = skillPtr->getModifiers ();
modifiers.addModifier (this->_modifier);
}
Index: AllWeapons.cpp
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/feats/AllWeapons.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** AllWeapons.cpp 4 Apr 2003 20:22:45 -0000 1.2
--- AllWeapons.cpp 13 Apr 2003 05:27:06 -0000 1.3
***************
*** 25,29 ****
#include "ogs/items/Weapon.h"
- using ogs::core::Creature;
using ogs::feats::AllWeapons;
using ogs::items::Weapon;
--- 25,28 ----
***************
*** 53,64 ****
}
const Creature& creature = dynamic_cast<const Creature&> (object);
! Creature::Feats feats = creature.getFeats ();
! Creature::Feats::iterator itor = feats.begin ();
while (itor != feats.end ()) {
! using ogs::core::Feat;
! Feat* feat = *itor++;
! AllWeapons* allWeapons = dynamic_cast <AllWeapons*> (feat);
if (allWeapons != NULL) {
if (allWeapons->getProficiency () == _proficiency) {
--- 52,65 ----
}
+ using ogs::core::Creature;
const Creature& creature = dynamic_cast<const Creature&> (object);
! using ogs::core::Feats;
! Feats feats = creature.getFeats ();
! Feats::iterator itor = feats.begin ();
while (itor != feats.end ()) {
! using ogs::core::FeatPtr;
! FeatPtr featPtr = *itor++;
! AllWeapons* allWeapons = dynamic_cast <AllWeapons*> (featPtr.get ());
if (allWeapons != NULL) {
if (allWeapons->getProficiency () == _proficiency) {
Index: ArmorProficiency.cpp
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/feats/ArmorProficiency.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** ArmorProficiency.cpp 4 Apr 2003 20:22:46 -0000 1.6
--- ArmorProficiency.cpp 13 Apr 2003 05:27:06 -0000 1.7
***************
*** 110,122 ****
findArmorProficiency (const Creature& creature,
Armor::Proficiency proficiency) {
! Creature::Feats feats = creature.getFeats ();
! Creature::Feats::iterator itor = feats.begin ();
bool found = false;
while (!found && itor != feats.end ()) {
! using ogs::core::Feat;
! Feat* feat = *itor++;
ArmorProficiency* armorProficiency =
! dynamic_cast <ArmorProficiency*> (feat);
if (armorProficiency != NULL) {
--- 110,123 ----
findArmorProficiency (const Creature& creature,
Armor::Proficiency proficiency) {
! using ogs::core::Feats;
! Feats feats = creature.getFeats ();
! Feats::iterator itor = feats.begin ();
bool found = false;
while (!found && itor != feats.end ()) {
! using ogs::core::FeatPtr;
! FeatPtr featPtr = *itor++;
ArmorProficiency* armorProficiency =
! dynamic_cast <ArmorProficiency*> (featPtr.get ());
if (armorProficiency != NULL) {
Index: ImprovedSave.cpp
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/feats/ImprovedSave.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ImprovedSave.cpp 4 Apr 2003 20:22:46 -0000 1.3
--- ImprovedSave.cpp 13 Apr 2003 05:27:06 -0000 1.4
***************
*** 76,88 ****
const Creature& creature = dynamic_cast<const Creature&> (object);
! Creature::Feats feats = creature.getFeats ();
! Creature::Feats::iterator itor = feats.begin ();
while (itor != feats.end ()) {
! using ogs::core::Feat;
! Feat* feat = *itor++;
! ImprovedSave* improvedSave = dynamic_cast <ImprovedSave*> (feat);
if (improvedSave != NULL) {
! if (improvedSave->getType () == _type) {
return (false);
}
--- 76,91 ----
const Creature& creature = dynamic_cast<const Creature&> (object);
! using ogs::core::Feats;
! Feats feats = creature.getFeats ();
! Feats::iterator itor = feats.begin ();
while (itor != feats.end ()) {
! using ogs::core::FeatPtr;
! FeatPtr featPtr = *itor++;
! ImprovedSave* improvedSave =
! dynamic_cast <ImprovedSave*> (featPtr.get ());
!
if (improvedSave != NULL) {
! if (improvedSave->getType () == this->_type) {
return (false);
}
|