Files
OldThink/Content.Server/GameObjects/Components/Weapon/Ranged/RangedWeapon.cs

36 lines
921 B
C#
Raw Normal View History

using SS14.Shared.GameObjects;
using Content.Server.GameObjects.EntitySystems;
using SS14.Shared.Interfaces.GameObjects;
using SS14.Shared.Map;
namespace Content.Server.GameObjects.Components.Weapon.Ranged
{
public class RangedWeaponComponent : Component, IAfterAttack
{
public override string Name => "RangedWeapon";
2018-06-10 01:03:49 +02:00
void IAfterAttack.Afterattack(IEntity user, GridLocalCoordinates clicklocation, IEntity attacked)
{
if (UserCanFire(user) && WeaponCanFire())
{
Fire(user, clicklocation);
}
}
protected virtual bool WeaponCanFire()
{
return true;
}
protected virtual bool UserCanFire(IEntity user)
{
return true;
}
2018-06-10 01:03:49 +02:00
protected virtual void Fire(IEntity user, GridLocalCoordinates clicklocation)
{
return;
}
}
}