* Adds weapons - Adds melee weapons - Adds projectile weapons - Adds hitscan weapons (like lasers) * Adds a separate sprite for projectile weapons
36 lines
894 B
C#
36 lines
894 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)
|
|
{
|
|
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;
|
|
}
|
|
}
|
|
}
|