From 92cc566fdc16c344564884f0eaf1666b1ca76762 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 25 Jul 2013 00:30:01 -0700 Subject: [PATCH] Rename the Class::attack method to Class::hit --- apps/openmw/mwclass/creature.cpp | 2 +- apps/openmw/mwclass/creature.hpp | 2 +- apps/openmw/mwclass/npc.cpp | 2 +- apps/openmw/mwclass/npc.hpp | 2 +- apps/openmw/mwrender/animation.cpp | 8 ++++---- apps/openmw/mwworld/class.cpp | 4 ++-- apps/openmw/mwworld/class.hpp | 6 +++--- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/apps/openmw/mwclass/creature.cpp b/apps/openmw/mwclass/creature.cpp index 30d84abc2b..003eb1d148 100644 --- a/apps/openmw/mwclass/creature.cpp +++ b/apps/openmw/mwclass/creature.cpp @@ -149,7 +149,7 @@ namespace MWClass } - void Creature::attack(const MWWorld::Ptr& ptr, int type) const + void Creature::hit(const MWWorld::Ptr& ptr, int type) const { } diff --git a/apps/openmw/mwclass/creature.hpp b/apps/openmw/mwclass/creature.hpp index b90b07f3f5..a15128ac72 100644 --- a/apps/openmw/mwclass/creature.hpp +++ b/apps/openmw/mwclass/creature.hpp @@ -42,7 +42,7 @@ namespace MWClass virtual MWMechanics::CreatureStats& getCreatureStats (const MWWorld::Ptr& ptr) const; ///< Return creature stats - virtual void attack(const MWWorld::Ptr& ptr, int type) const; + virtual void hit(const MWWorld::Ptr& ptr, int type) const; virtual void setActorHealth(const MWWorld::Ptr& ptr, float health, const MWWorld::Ptr& attacker) const; diff --git a/apps/openmw/mwclass/npc.cpp b/apps/openmw/mwclass/npc.cpp index 229954dace..b19544f868 100644 --- a/apps/openmw/mwclass/npc.cpp +++ b/apps/openmw/mwclass/npc.cpp @@ -290,7 +290,7 @@ namespace MWClass } - void Npc::attack(const MWWorld::Ptr& ptr, int type) const + void Npc::hit(const MWWorld::Ptr& ptr, int type) const { // FIXME: Detect what was hit MWWorld::Ptr victim; diff --git a/apps/openmw/mwclass/npc.hpp b/apps/openmw/mwclass/npc.hpp index 15f715f14e..05c4b1e8f0 100644 --- a/apps/openmw/mwclass/npc.hpp +++ b/apps/openmw/mwclass/npc.hpp @@ -68,7 +68,7 @@ namespace MWClass virtual MWWorld::InventoryStore& getInventoryStore (const MWWorld::Ptr& ptr) const; ///< Return inventory store - virtual void attack(const MWWorld::Ptr& ptr, int type) const; + virtual void hit(const MWWorld::Ptr& ptr, int type) const; virtual void setActorHealth(const MWWorld::Ptr& ptr, float health, const MWWorld::Ptr& attacker) const; diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp index 54e199059a..8d6a47e5ec 100644 --- a/apps/openmw/mwrender/animation.cpp +++ b/apps/openmw/mwrender/animation.cpp @@ -538,13 +538,13 @@ void Animation::handleTextKey(AnimState &state, const std::string &groupname, co else if(evt.compare(off, len, "unequip detach") == 0) showWeapons(false); else if(evt.compare(off, len, "chop hit") == 0) - MWWorld::Class::get(mPtr).attack(mPtr, MWMechanics::CreatureStats::AT_Chop); + MWWorld::Class::get(mPtr).hit(mPtr, MWMechanics::CreatureStats::AT_Chop); else if(evt.compare(off, len, "slash hit") == 0) - MWWorld::Class::get(mPtr).attack(mPtr, MWMechanics::CreatureStats::AT_Slash); + MWWorld::Class::get(mPtr).hit(mPtr, MWMechanics::CreatureStats::AT_Slash); else if(evt.compare(off, len, "thrust hit") == 0) - MWWorld::Class::get(mPtr).attack(mPtr, MWMechanics::CreatureStats::AT_Thrust); + MWWorld::Class::get(mPtr).hit(mPtr, MWMechanics::CreatureStats::AT_Thrust); else if(evt.compare(off, len, "hit") == 0) - MWWorld::Class::get(mPtr).attack(mPtr, -1); + MWWorld::Class::get(mPtr).hit(mPtr); } diff --git a/apps/openmw/mwworld/class.cpp b/apps/openmw/mwworld/class.cpp index b64b5119a5..c30fb51c17 100644 --- a/apps/openmw/mwworld/class.cpp +++ b/apps/openmw/mwworld/class.cpp @@ -77,9 +77,9 @@ namespace MWWorld throw std::runtime_error ("class does not have item health"); } - void Class::attack(const Ptr& ptr, int type) const + void Class::hit(const Ptr& ptr, int type) const { - throw std::runtime_error("class cannot attack"); + throw std::runtime_error("class cannot hit"); } void Class::setActorHealth(const Ptr& ptr, float health, const Ptr& attacker) const diff --git a/apps/openmw/mwworld/class.hpp b/apps/openmw/mwworld/class.hpp index 26ce65d0eb..2f5ac3ec84 100644 --- a/apps/openmw/mwworld/class.hpp +++ b/apps/openmw/mwworld/class.hpp @@ -105,11 +105,11 @@ namespace MWWorld ///< Return item max health or throw an exception, if class does not have item health /// (default implementation: throw an exceoption) - virtual void attack(const Ptr& ptr, int type) const; + virtual void hit(const Ptr& ptr, int type=-1) const; ///< Execute a melee hit, using the current weapon. This will check the relevant skills /// of the given attacker, and whoever is hit. - /// \a type - type of attack, one of the MWMechanics::CreatureStats::AttackType enums. - /// ignored for creature attacks. + /// \param type - type of attack, one of the MWMechanics::CreatureStats::AttackType + /// enums. ignored for creature attacks. /// (default implementation: throw an exceoption) virtual void setActorHealth(const Ptr& ptr, float health, const Ptr& attacker=Ptr()) const;