GUNS PELASE WORK.

This commit is contained in:
Pieter-Jan Briers
2020-06-24 20:00:31 +02:00
parent 9b6455519b
commit 74a63c9555
7 changed files with 54 additions and 48 deletions

View File

@@ -69,7 +69,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Ammunition
/// </summary>
public float Velocity => _velocity;
private float _velocity;
private string _muzzleFlashSprite;
public string SoundCollectionEject => _soundCollectionEject;
@@ -104,7 +104,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Ammunition
}
}
public IEntity TakeBullet()
public IEntity TakeBullet(GridCoordinates spawnAt)
{
if (_ammoIsProjectile)
{
@@ -121,12 +121,12 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Ammunition
{
appearanceComponent.SetData(AmmoVisuals.Spent, true);
}
var entity = Owner.EntityManager.SpawnEntity(_projectileId, Owner.Transform.GridPosition);
var entity = Owner.EntityManager.SpawnEntity(_projectileId, spawnAt);
DebugTools.AssertNotNull(entity);
return entity;
}
public void MuzzleFlash(GridCoordinates grid, Angle angle)
{
if (_muzzleFlashSprite == null)
@@ -138,7 +138,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Ammunition
var deathTime = time + TimeSpan.FromMilliseconds(200);
// Offset the sprite so it actually looks like it's coming from the gun
var offset = angle.ToVec().Normalized / 2;
var message = new EffectSystemMessage
{
EffectSprite = _muzzleFlashSprite,