Skip to content

Commit

Permalink
AI rewie
Browse files Browse the repository at this point in the history
  • Loading branch information
Spatison committed Oct 5, 2024
1 parent 0717f11 commit f434a2c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ protected override void OnAppearanceChange(EntityUid uid, StretchedVisualsCompon
_appearance.TryGetData<bool>(uid, StretchedVisuals.Stretched, out var stretched, args.Component);
_appearance.TryGetData<bool>(uid, AmmoVisuals.HasAmmo, out var hasAmmo, args.Component);

args.Sprite.LayerSetState(StretchedVisuals.Layer, stretched ? component.StretchedState : hasAmmo ? component.LoadedState : component.UnstrungVisible);
// StretchedState: Weapon is stretched and ready to fire
// LoadedState: Weapon is loaded but not stretched
// UnstrungState: Weapon is neither stretched nor loaded
args.Sprite.LayerSetState(StretchedVisuals.Layer, stretched ? component.StretchedState : hasAmmo ? component.LoadedState : component.UnstrungState);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ public sealed partial class StretchedVisualsComponent : Component
public string? StretchedState;

[DataField]
public string? UnstrungVisible;
public string? UnstrungState;
}
7 changes: 6 additions & 1 deletion Content.Server/Projectiles/ProjectileSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,13 @@ private void OnEmbedRemove(EntityUid uid, EmbeddableProjectileComponent componen
return;
}

if (!TryComp<PhysicsComponent>(uid, out var physics))
{
FreePenetrated(uid);
return;
}

var xform = Transform(uid);
TryComp<PhysicsComponent>(uid, out var physics);
_physics.SetBodyType(uid, BodyType.Dynamic, body: physics, xform: xform);
_transform.AttachToGridOrMap(uid, xform);

Expand Down
3 changes: 3 additions & 0 deletions Content.Server/_White/Guns/PoweredComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ public sealed partial class PoweredComponent : Component
[DataField]
public float EnergyPerUse = 180f;

/// <summary>
/// Modifies the speed of projectiles fired from this powered weapon.
/// </summary>
[DataField]
public float ProjectileSpeedModified = 15f;
}
6 changes: 0 additions & 6 deletions Content.Shared/Projectiles/SharedProjectileSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,6 @@ public void SetShooter(EntityUid id, ProjectileComponent component, EntityUid sh
Dirty(id, component);
}

[Serializable, NetSerializable]
private sealed partial class RemoveEmbeddedProjectileEvent : DoAfterEvent
{
public override DoAfterEvent Clone() => this;
}

/// <summary>
/// Prevent players with the Pacified status effect from throwing embeddable projectiles.
/// </summary>
Expand Down

0 comments on commit f434a2c

Please sign in to comment.