OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
combat.hpp
Go to the documentation of this file.
1 #ifndef OPENMW_MECHANICS_COMBAT_H
2 #define OPENMW_MECHANICS_COMBAT_H
3 
4 #include "../mwworld/ptr.hpp"
5 
6 namespace MWMechanics
7 {
8 
9 bool applyOnStrikeEnchantment(const MWWorld::Ptr& attacker, const MWWorld::Ptr& victim, const MWWorld::Ptr& object, const osg::Vec3f& hitPosition,
10  const bool fromProjectile=false);
11 
13 bool blockMeleeAttack (const MWWorld::Ptr& attacker, const MWWorld::Ptr& blocker, const MWWorld::Ptr& weapon, float damage, float attackStrength);
14 
15 void resistNormalWeapon (const MWWorld::Ptr& actor, const MWWorld::Ptr& attacker, const MWWorld::Ptr& weapon, float& damage);
16 
19 void projectileHit (const MWWorld::Ptr& attacker, const MWWorld::Ptr& victim, MWWorld::Ptr weapon, const MWWorld::Ptr& projectile,
20  const osg::Vec3f& hitPosition, float attackStrength);
21 
23 float getHitChance (const MWWorld::Ptr& attacker, const MWWorld::Ptr& victim, int skillValue);
24 
26 void applyElementalShields(const MWWorld::Ptr& attacker, const MWWorld::Ptr& victim);
27 
32 void reduceWeaponCondition (float damage, bool hit, MWWorld::Ptr& weapon, const MWWorld::Ptr& attacker);
33 
35 void adjustWeaponDamage (float& damage, const MWWorld::Ptr& weapon, const MWWorld::Ptr& attacker);
36 
37 void getHandToHandDamage (const MWWorld::Ptr& attacker, const MWWorld::Ptr& victim, float& damage, bool& healthdmg, float attackStrength);
38 
40 void applyFatigueLoss(const MWWorld::Ptr& attacker, const MWWorld::Ptr& weapon, float attackStrength);
41 
44 bool isEnvironmentCompatible(const MWWorld::Ptr& attacker, const MWWorld::Ptr& victim);
45 
46 float getFightDistanceBias(const MWWorld::Ptr& actor1, const MWWorld::Ptr& actor2);
47 }
48 
49 #endif
bool isEnvironmentCompatible(const MWWorld::Ptr &attacker, const MWWorld::Ptr &victim)
Definition: combat.cpp:415
void projectileHit(const MWWorld::Ptr &attacker, const MWWorld::Ptr &victim, MWWorld::Ptr weapon, const MWWorld::Ptr &projectile, const osg::Vec3f &hitPosition, float attackStrength)
Definition: combat.cpp:168
void applyElementalShields(const MWWorld::Ptr &attacker, const MWWorld::Ptr &victim)
Applies damage to attacker based on the victim's elemental shields.
Definition: combat.cpp:272
void adjustWeaponDamage(float &damage, const MWWorld::Ptr &weapon, const MWWorld::Ptr &attacker)
Adjust weapon damage based on its condition. A used weapon will be less effective.
Definition: combat.cpp:342
void resistNormalWeapon(const MWWorld::Ptr &actor, const MWWorld::Ptr &attacker, const MWWorld::Ptr &weapon, float &damage)
Definition: combat.cpp:148
bool blockMeleeAttack(const MWWorld::Ptr &attacker, const MWWorld::Ptr &blocker, const MWWorld::Ptr &weapon, float damage, float attackStrength)
Definition: combat.cpp:54
void applyFatigueLoss(const MWWorld::Ptr &attacker, const MWWorld::Ptr &weapon, float attackStrength)
Apply the fatigue loss incurred by attacking with the given weapon (weapon may be empty = hand-to-han...
Definition: combat.cpp:398
float getHitChance(const MWWorld::Ptr &attacker, const MWWorld::Ptr &victim, int skillValue)
Get the chance (in percent) for attacker to successfully hit victim with a given weapon skill value...
Definition: combat.cpp:233
void getHandToHandDamage(const MWWorld::Ptr &attacker, const MWWorld::Ptr &victim, float &damage, bool &healthdmg, float attackStrength)
Definition: combat.cpp:363
void reduceWeaponCondition(float damage, bool hit, MWWorld::Ptr &weapon, const MWWorld::Ptr &attacker)
Definition: combat.cpp:317
bool applyOnStrikeEnchantment(const MWWorld::Ptr &attacker, const MWWorld::Ptr &victim, const MWWorld::Ptr &object, const osg::Vec3f &hitPosition, const bool fromProjectile)
Definition: combat.cpp:36
Pointer to a LiveCellRef.
Definition: ptr.hpp:19
float getFightDistanceBias(const MWWorld::Ptr &actor1, const MWWorld::Ptr &actor2)
Definition: combat.cpp:435