Adds creampie launcher
This commit is contained in:
@@ -5,6 +5,8 @@ using Content.Shared.Interfaces.GameObjects.Components;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
namespace Content.Server.GameObjects.Components.Nutrition
|
||||
{
|
||||
@@ -13,6 +15,10 @@ namespace Content.Server.GameObjects.Components.Nutrition
|
||||
{
|
||||
public override string Name => "CreamPie";
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[field: DataField("paralyzeTime")]
|
||||
public float ParalyzeTime { get; set; } = 1f;
|
||||
|
||||
public void PlaySound()
|
||||
{
|
||||
SoundSystem.Play(Filter.Pvs(Owner), AudioHelpers.GetRandomFileFromSoundCollection("desecration"), Owner,
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace Content.Server.GameObjects.Components.Nutrition
|
||||
|
||||
void IThrowCollide.HitBy(ThrowCollideEventArgs eventArgs)
|
||||
{
|
||||
if (!eventArgs.Thrown.HasComponent<CreamPieComponent>() || CreamPied) return;
|
||||
if (CreamPied || eventArgs.Thrown.Deleted || !eventArgs.Thrown.TryGetComponent(out CreamPieComponent? creamPie)) return;
|
||||
|
||||
CreamPied = true;
|
||||
Owner.PopupMessage(Loc.GetString("You have been creamed by {0:theName}!", eventArgs.Thrown));
|
||||
@@ -59,7 +59,7 @@ namespace Content.Server.GameObjects.Components.Nutrition
|
||||
|
||||
if (Owner.TryGetComponent(out StunnableComponent? stun))
|
||||
{
|
||||
stun.Paralyze(1f);
|
||||
stun.Paralyze(creamPie.ParalyzeTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace Content.Server.GameObjects.Components.Projectiles
|
||||
set => _damages = value;
|
||||
}
|
||||
|
||||
[field: DataField("delete_on_collide")]
|
||||
[field: DataField("deleteOnCollide")]
|
||||
public bool DeleteOnCollide { get; } = true;
|
||||
|
||||
// Get that juicy FPS hit sound
|
||||
@@ -95,7 +95,8 @@ namespace Content.Server.GameObjects.Components.Projectiles
|
||||
recoilComponent.Kick(direction);
|
||||
}
|
||||
|
||||
Owner.Delete();
|
||||
if(DeleteOnCollide)
|
||||
Owner.Delete();
|
||||
}
|
||||
|
||||
public override ComponentState GetComponentState(ICommonSession player)
|
||||
|
||||
@@ -176,5 +176,6 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Ammunition
|
||||
Dart, // Placeholder
|
||||
Grenade,
|
||||
Energy,
|
||||
CreamPie, // I can't wait for this enum to be a prototype type...
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user