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:
clusterfack
2018-04-05 17:32:51 -05:00
committed by Pieter-Jan Briers
parent 63b5d83728
commit 128728bfcb
16 changed files with 329 additions and 8 deletions

View File

@@ -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;
}
}
}