Files
tbd-station-14/Content.Server/GameObjects/Components/Weapon/Ranged/RangedWeapon.cs
Pieter-Jan Briers 147aad5064 Some work on the mess that is this power code.
Jesus.

Tons of fixes, refactors and other things.
The powernet's code is still awful though.
2018-05-27 16:44:50 +02:00

36 lines
913 B
C#

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";
void IAfterAttack.Afterattack(IEntity user, LocalCoordinates clicklocation, IEntity attacked)
{
if (UserCanFire(user) && WeaponCanFire())
{
Fire(user, clicklocation);
}
}
protected virtual bool WeaponCanFire()
{
return true;
}
protected virtual bool UserCanFire(IEntity user)
{
return true;
}
protected virtual void Fire(IEntity user, LocalCoordinates clicklocation)
{
return;
}
}
}