Rename the Class::attack method to Class::hit

actorid
Chris Robinson 12 years ago
parent fb0ee7f2fc
commit 92cc566fdc

@ -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
{
}

@ -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;

@ -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;

@ -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;

@ -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);
}

@ -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

@ -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;

Loading…
Cancel
Save