2018-04-05 17:32:51 -05:00
|
|
|
|
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)
|
2018-04-05 17:32:51 -05:00
|
|
|
|
{
|
2018-05-27 16:44:50 +02:00
|
|
|
|
if (UserCanFire(user) && WeaponCanFire())
|
2018-04-05 17:32:51 -05:00
|
|
|
|
{
|
|
|
|
|
|
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)
|
2018-04-05 17:32:51 -05:00
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|