diff --git a/Content.Server/GameObjects/Components/Nutrition/CreamPieComponent.cs b/Content.Server/GameObjects/Components/Nutrition/CreamPieComponent.cs index c82479e0d2..4467f31ee6 100644 --- a/Content.Server/GameObjects/Components/Nutrition/CreamPieComponent.cs +++ b/Content.Server/GameObjects/Components/Nutrition/CreamPieComponent.cs @@ -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, diff --git a/Content.Server/GameObjects/Components/Nutrition/CreamPiedComponent.cs b/Content.Server/GameObjects/Components/Nutrition/CreamPiedComponent.cs index 12ed187642..bbf48768a5 100644 --- a/Content.Server/GameObjects/Components/Nutrition/CreamPiedComponent.cs +++ b/Content.Server/GameObjects/Components/Nutrition/CreamPiedComponent.cs @@ -51,7 +51,7 @@ namespace Content.Server.GameObjects.Components.Nutrition void IThrowCollide.HitBy(ThrowCollideEventArgs eventArgs) { - if (!eventArgs.Thrown.HasComponent() || 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); } } } diff --git a/Content.Server/GameObjects/Components/Projectiles/ProjectileComponent.cs b/Content.Server/GameObjects/Components/Projectiles/ProjectileComponent.cs index 9fa7ec69d7..47f5b06fcc 100644 --- a/Content.Server/GameObjects/Components/Projectiles/ProjectileComponent.cs +++ b/Content.Server/GameObjects/Components/Projectiles/ProjectileComponent.cs @@ -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) diff --git a/Content.Server/GameObjects/Components/Weapon/Ranged/Ammunition/AmmoComponent.cs b/Content.Server/GameObjects/Components/Weapon/Ranged/Ammunition/AmmoComponent.cs index 223c39a383..8968aee8b0 100644 --- a/Content.Server/GameObjects/Components/Weapon/Ranged/Ammunition/AmmoComponent.cs +++ b/Content.Server/GameObjects/Components/Weapon/Ranged/Ammunition/AmmoComponent.cs @@ -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... } } diff --git a/Resources/Changelog/Parts/launcher.yml b/Resources/Changelog/Parts/launcher.yml new file mode 100644 index 0000000000..c18ea7aa31 --- /dev/null +++ b/Resources/Changelog/Parts/launcher.yml @@ -0,0 +1,4 @@ +author: Your_Name_Here +changes: + - type: Add + message: Adds cream pie launcher. Honk! diff --git a/Resources/Prototypes/Entities/Constructible/Specific/Engines/PA/particles.yml b/Resources/Prototypes/Entities/Constructible/Specific/Engines/PA/particles.yml index 04a252a4c9..01e11baf02 100644 --- a/Resources/Prototypes/Entities/Constructible/Specific/Engines/PA/particles.yml +++ b/Resources/Prototypes/Entities/Constructible/Specific/Engines/PA/particles.yml @@ -10,7 +10,7 @@ state: particle0 shader: unshaded - type: Projectile - delete_on_collide: false + deleteOnCollide: false soundHit: /Audio/Weapons/Guns/Hits/bullet_hit.ogg damages: Radiation: 10 diff --git a/Resources/Prototypes/Entities/Objects/Consumable/food.yml b/Resources/Prototypes/Entities/Objects/Consumable/food.yml index 847ab7434a..5414aaf180 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/food.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/food.yml @@ -228,6 +228,10 @@ Quantity: 8 - type: Sprite sprite: Objects/Consumable/Food/pie.rsi + - type: Ammo + caliber: CreamPie + caseless: true + projectile: BulletCreampie #- type: entity diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Launchers/launchers.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Launchers/launchers.yml index c0cda2dbbd..161a49e291 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Launchers/launchers.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Launchers/launchers.yml @@ -23,7 +23,6 @@ map: ["enum.RangedBarrelVisualLayers.Base"] - state: bolt-closed map: ["enum.RangedBarrelVisualLayers.Bolt"] - - type: Item size: 24 sprite: Objects/Weapons/Guns/Launchers/china_lake.rsi @@ -56,7 +55,6 @@ map: ["enum.RangedBarrelVisualLayers.Base"] - state: mag-0 map: ["enum.RangedBarrelVisualLayers.Mag"] - - type: Item size: 24 sprite: Objects/Weapons/Guns/Launchers/rocket.rsi @@ -78,3 +76,29 @@ magState: mag steps: 1 zeroVisible: true + +- type: entity + name: pie cannon + parent: LauncherBase + id: LauncherCreamPie + description: Load cream pie for optimal results. + components: + - type: Sprite + sprite: Objects/Weapons/Guns/Launchers/pie_cannon.rsi + state: piecannon + - type: Item + size: 24 + sprite: Objects/Weapons/Guns/Launchers/pie_cannon.rsi + - type: RangedWeapon + clumsyCheck: false + - type: RevolverBarrel + caliber: CreamPie + currentSelector: Single + allSelectors: + - Single + fillPrototype: FoodBananaCreamPie + fireRate: 5 + capacity: 15 + soundEmpty: /Audio/Weapons/Guns/Empty/empty.ogg + soundGunshot: /Audio/Effects/bang.ogg + soundInsert: /Audio/Items/bikehorn.ogg diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml index 42cf16a064..f3239aa4c7 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml @@ -150,7 +150,7 @@ state: frag - type: ExplosiveProjectile - type: Projectile - delete_on_collide: false + deleteOnCollide: false - type: Explosive devastationRange: 1 heavyImpactRange: 2 @@ -172,7 +172,7 @@ sprite: Objects/Weapons/Guns/Projectiles/grenade.rsi state: grenade - type: Projectile - delete_on_collide: false + deleteOnCollide: false soundHit: /Audio/Effects/gen_hit.ogg - type: StunnableProjectile paralyzeAmount: 8 @@ -189,7 +189,7 @@ state: grenade - type: ExplosiveProjectile - type: Projectile - delete_on_collide: false + deleteOnCollide: false - type: Explosive devastationRange: 1 heavyImpactRange: 2 @@ -207,7 +207,7 @@ sprite: Objects/Weapons/Guns/Projectiles/grenade.rsi state: grenade - type: Projectile - delete_on_collide: false + deleteOnCollide: false soundHit: /Audio/Effects/flash_bang.ogg - type: FlashProjectile range: 7 @@ -225,7 +225,7 @@ state: grenade - type: ExplosiveProjectile - type: Projectile - delete_on_collide: false + deleteOnCollide: false - type: Explosive devastationRange: 0 heavyImpactRange: 1 @@ -243,7 +243,7 @@ sprite: Objects/Fun/toys.rsi state: foamdart - type: Projectile - delete_on_collide: true + deleteOnCollide: true soundHit: /Audio/Guns/Hits/snap.ogg damages: Blunt: 2 @@ -259,6 +259,27 @@ sprite: Objects/Fun/toys.rsi state: capbullet - type: Projectile - delete_on_collide: true + deleteOnCollide: true damages: Piercing: 0 + +- type: entity + id: BulletCreampie + name: cream pie + parent: BulletBase + description: get creampied, honk!! + abstract: true + components: + - type: Projectile + deleteOnCollide: false # CreamPie component handles this. + - type: CreamPie + - type: ThrownItem + - type: Sprite + netsync: false + sprite: Objects/Consumable/Food/pie.rsi + state: icon + - type: SolutionContainer + contents: + reagents: + - ReagentId: chem.Nutriment + Quantity: 8 diff --git a/Resources/Textures/Objects/Weapons/Guns/Launchers/pie_cannon.rsi/meta.json b/Resources/Textures/Objects/Weapons/Guns/Launchers/pie_cannon.rsi/meta.json new file mode 100644 index 0000000000..310bee7a9b --- /dev/null +++ b/Resources/Textures/Objects/Weapons/Guns/Launchers/pie_cannon.rsi/meta.json @@ -0,0 +1,14 @@ +{ + "version": 1, + "size": { + "x": 32, + "y": 32 + }, + "license": "CC-BY-SA-3.0", + "copyright": "Taken from https://github.com/tgstation/tgstation at dc9cef40447ee86c2b9fff9f690385cd63b655fa", + "states": [ + { + "name": "piecannon" + }, + ] +} diff --git a/Resources/Textures/Objects/Weapons/Guns/Launchers/pie_cannon.rsi/piecannon.png b/Resources/Textures/Objects/Weapons/Guns/Launchers/pie_cannon.rsi/piecannon.png new file mode 100644 index 0000000000..741faa01c6 Binary files /dev/null and b/Resources/Textures/Objects/Weapons/Guns/Launchers/pie_cannon.rsi/piecannon.png differ diff --git a/RobustToolbox b/RobustToolbox index 92f44b390e..0dac17ae5e 160000 --- a/RobustToolbox +++ b/RobustToolbox @@ -1 +1 @@ -Subproject commit 92f44b390eaf8a62c44f396dc9de3a2a042c99ae +Subproject commit 0dac17ae5e941264fb22ba556d1c5e803f74478e