Star Wars 14: Shuttle weapon update (#23644)
* setup codebase * make auto-fire, but its broken * collider problem * fix rate, add toggle port * add laser * power cages * ginormous cells * fix inhand * add pirate cannon * salvage gun * functional Nuke cannon * rewrite to standart grenade * fix naming, add emp sprite * grenade cartridge * thruster fix * nuke cannon * audio + visual polish * balance tweak * tweaks * laser balance tweak: new Electronic damage modifier set, reduce structural cannon damage * resprite energy cages, start implementing in game * fix cage recharger craft * add small laser gun * fix colliders * add lasers and ptk to research and crafting * finish implementing weapon to rnd and sec * some fixes * splitted grenades and cannon balls * integrate new cannon balls * tweaks stick * move circuits to sectechfab, fix * fix? * add ability to E shoot, without signals * fix! * fix?!?! and naming tweak * go! * Lank fix * oh * mornings don't start with coffee. * the morning starts with bug fixes. * fucking bugs! * finally * it is now possible to craft projectiles separately from cartridges * +2 fix * refactor * piu * More weight * add AutoShootGunComponent * move autoshoot to partial * SetEnabled() * some fixes * remove CanShootWithoutUser field * remove null-checks ToCoordinates from AttemptShoot() * war without reason * return to home * ? * forgot remove it * review * Fix formatting and update path --------- Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
@@ -37,7 +37,7 @@ namespace Content.Shared.Weapons.Ranged.Systems;
|
||||
|
||||
public abstract partial class SharedGunSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly ActionBlockerSystem _actionBlockerSystem = default!;
|
||||
[Dependency] private readonly ActionBlockerSystem _actionBlockerSystem = default!;
|
||||
[Dependency] protected readonly IGameTiming Timing = default!;
|
||||
[Dependency] protected readonly IMapManager MapManager = default!;
|
||||
[Dependency] private readonly INetManager _netManager = default!;
|
||||
@@ -214,6 +214,17 @@ public abstract partial class SharedGunSystem : EntitySystem
|
||||
gun.ShotCounter = 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shoots by assuming the gun is the user at default coordinates.
|
||||
/// </summary>
|
||||
public void AttemptShoot(EntityUid gunUid, GunComponent gun)
|
||||
{
|
||||
var coordinates = new EntityCoordinates(gunUid, new Vector2(0, -1));
|
||||
gun.ShootCoordinates = coordinates;
|
||||
AttemptShoot(gunUid, gunUid, gun);
|
||||
gun.ShotCounter = 0;
|
||||
}
|
||||
|
||||
private void AttemptShoot(EntityUid user, EntityUid gunUid, GunComponent gun)
|
||||
{
|
||||
if (gun.FireRate <= 0f ||
|
||||
@@ -385,12 +396,9 @@ public abstract partial class SharedGunSystem : EntitySystem
|
||||
var finalLinear = physics.LinearVelocity + targetMapVelocity - currentMapVelocity;
|
||||
Physics.SetLinearVelocity(uid, finalLinear, body: physics);
|
||||
|
||||
if (user != null)
|
||||
{
|
||||
var projectile = EnsureComp<ProjectileComponent>(uid);
|
||||
Projectiles.SetShooter(uid, projectile, user.Value);
|
||||
projectile.Weapon = gunUid;
|
||||
}
|
||||
var projectile = EnsureComp<ProjectileComponent>(uid);
|
||||
Projectiles.SetShooter(uid, projectile, user ?? gunUid);
|
||||
projectile.Weapon = gunUid;
|
||||
|
||||
TransformSystem.SetWorldRotation(uid, direction.ToWorldAngle());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user