Adds weapons (#48)
* Adds weapons - Adds melee weapons - Adds projectile weapons - Adds hitscan weapons (like lasers) * Adds a separate sprite for projectile weapons
This commit is contained in:
committed by
Pieter-Jan Briers
parent
63b5d83728
commit
128728bfcb
@@ -0,0 +1,35 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user