This commit is contained in:
Walter Julius Hennecke 2014-03-10 00:23:53 +01:00
parent e6ea22ee1a
commit 61be76cf60

View file

@ -31,56 +31,55 @@ class CombatSubsystem;
//
// Encapsulates combat related data and functionality for the actor
//
class CombatSubsystem
{
class CombatSubsystem {
public:
CombatSubsystem();
CombatSubsystem( Actor *actor );
CombatSubsystem(Actor* actor);
~CombatSubsystem();
bool CanAttackTarget ( Entity *target );
bool CanAttackTargetFrom ( Entity *target , const Vector &startPos );
bool IsTargetInWeaponRange ( Entity *target );
bool UsingWeaponNamed ( const str &weaponName );
bool WeaponIsFireType ( firetype_t fire_type );
bool HaveWeapon ();
bool CanAttackEnemy ();
bool CanAttackTarget(Entity* target);
bool CanAttackTargetFrom(Entity* target, const Vector& startPos);
bool IsTargetInWeaponRange(Entity* target);
bool UsingWeaponNamed(const str& weaponName);
bool WeaponIsFireType(firetype_t fire_type);
bool HaveWeapon();
bool CanAttackEnemy();
void UseActorWeapon (const str &weaponName , weaponhand_t hand );
void SetTraceInterval ( float interval );
void FireWeapon ();
void StopFireWeapon ();
void AimWeaponTag (Entity *target);
void AimWeaponTag (const Vector &targetPos);
void ClearAim ();
void UseActorWeapon(const str& weaponName, weaponhand_t hand);
void SetTraceInterval(float interval);
void FireWeapon();
void StopFireWeapon();
void AimWeaponTag(Entity* target);
void AimWeaponTag(const Vector& targetPos);
void ClearAim();
void GetGunPositionData ( Vector *pos , Vector *forward = NULL, Vector *right = NULL, Vector *up = NULL );
float GetAimGunYaw ( const Vector &target );
float GetAimGunPitch ( const Vector &target );
WeaponPtr GetBestAvailableWeapon ( Entity *target );
float GetActiveWeaponPowerRating ( Entity *target );
str GetActiveWeaponName ();
void GetGunPositionData(Vector* pos, Vector* forward = NULL, Vector* right = NULL, Vector* up = NULL);
float GetAimGunYaw(const Vector& target);
float GetAimGunPitch(const Vector& target);
WeaponPtr GetBestAvailableWeapon(Entity* target);
float GetActiveWeaponPowerRating(Entity* target);
str GetActiveWeaponName();
str GetActiveWeaponArchetype();
bool GetProjectileLaunchAngles( Vector &launchAngles, const Vector &launchPoint, const float initialSpeed, const float gravity , const bool useHighTrajectory = false ) const;
bool GetProjectileLaunchAngles(Vector& launchAngles, const Vector& launchPoint, const float initialSpeed, const float gravity, const bool useHighTrajectory = false) const;
bool shouldArcProjectile();
float GetLowArcRange();
void OverrideSpread ( float spreadX , float spreadY );
void OverrideSpread(float spreadX, float spreadY);
const str GetAnimForMyWeapon( const str& property );
float GetDataForMyWeapon( const str& property );
const str GetAnimForMyWeapon(const str& property);
float GetDataForMyWeapon(const str& property);
Vector GetLeadingTargetPos( float projSpeed , Vector originalTargetPos , Entity *target );
Vector GetLeadingTargetPos(float projSpeed, Vector originalTargetPos, Entity* target);
// Archiving
void DoArchive ( Archiver &arc , Actor *actor );
virtual void Archive ( Archiver &arc );
void DoArchive(Archiver& arc, Actor* actor);
virtual void Archive(Archiver& arc);
protected:
void _init();
bool _traceHitTarget ( Entity *target , const Vector &startPos );
float getModifiedPowerRating ( Entity *target , Weapon *weapon );
bool _traceHitTarget(Entity* target, const Vector& startPos);
float getModifiedPowerRating(Entity* target, Weapon* weapon);
private:
@ -90,8 +89,8 @@ class CombatSubsystem
bool _canShootTarget;
float _yawDiff;
Actor *act;
};
Actor* act;
};
#endif /* __ACTOR_COMBAT_SUBSYSTEM_H__ */