Adds some extra toys to the arcade machine (#10637)

This commit is contained in:
Flipp Syder
2022-08-16 02:57:39 -07:00
committed by GitHub
parent ed8414c800
commit 0396f8eb9d
9 changed files with 85 additions and 61 deletions

View File

@@ -8,6 +8,8 @@ using Robust.Shared.Prototypes;
using Robust.Shared.Random; using Robust.Shared.Random;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
// TODO: ECS.
namespace Content.Server.Arcade.Components namespace Content.Server.Arcade.Components
{ {
[RegisterComponent] [RegisterComponent]
@@ -54,7 +56,11 @@ namespace Content.Server.Arcade.Components
{ {
"ToyMouse", "ToyAi", "ToyNuke", "ToyAssistant", "ToyGriffin", "ToyHonk", "ToyIan", "ToyMouse", "ToyAi", "ToyNuke", "ToyAssistant", "ToyGriffin", "ToyHonk", "ToyIan",
"ToyMarauder", "ToyMauler", "ToyGygax", "ToyOdysseus", "ToyOwlman", "ToyDeathRipley", "ToyMarauder", "ToyMauler", "ToyGygax", "ToyOdysseus", "ToyOwlman", "ToyDeathRipley",
"ToyPhazon", "ToyFireRipley", "ToyReticence", "ToyRipley", "ToySeraph", "ToyDurand", "ToySkeleton" "ToyPhazon", "ToyFireRipley", "ToyReticence", "ToyRipley", "ToySeraph", "ToyDurand", "ToySkeleton",
"FoamCrossbow", "RevolverCapGun", "PlushieLizard", "PlushieSpaceLizard",
"PlushieNuke", "PlushieCarp", "PlushieRatvar", "PlushieNar", "PlushieSnake", "Basketball", "Football",
"PlushieRouny", "PlushieBee", "PlushieSlime", "BalloonCorgi", "ToySword", "CrayonBox", "BoxDonkSoftBox", "BoxCartridgeCap",
"HarmonicaInstrument", "OcarinaInstrument", "RecorderInstrument", "GunpetInstrument", "BirdToyInstrument"
}; };
protected override void Initialize() protected override void Initialize()

View File

@@ -12,6 +12,9 @@ namespace Content.Server.Weapon.Melee.EnergySword
public bool Activated = false; public bool Activated = false;
[DataField("isSharp")]
public bool IsSharp = true;
/// <summary> /// <summary>
/// RGB cycle rate for hacked e-swords. /// RGB cycle rate for hacked e-swords.
/// </summary> /// </summary>
@@ -40,10 +43,10 @@ namespace Content.Server.Weapon.Melee.EnergySword
Color.MediumOrchid Color.MediumOrchid
}; };
[DataField("litDamageBonus", required: true)] [DataField("litDamageBonus")]
public DamageSpecifier LitDamageBonus = default!; public DamageSpecifier LitDamageBonus = new();
[DataField("litDisarmMalus", required: true)] [DataField("litDisarmMalus")]
public float litDisarmMalus = 0.6f; public float litDisarmMalus = 0.6f;
} }
} }

View File

@@ -80,7 +80,8 @@ namespace Content.Server.Weapon.Melee.EnergySword
if(TryComp<MeleeWeaponComponent>(comp.Owner, out var weaponComp)) if(TryComp<MeleeWeaponComponent>(comp.Owner, out var weaponComp))
weaponComp.HitSound = comp.OnHitOff; weaponComp.HitSound = comp.OnHitOff;
RemComp<SharpComponent>(comp.Owner); if (comp.IsSharp)
RemComp<SharpComponent>(comp.Owner);
SoundSystem.Play(comp.DeActivateSound.GetSound(), Filter.Pvs(comp.Owner, entityManager: EntityManager), comp.Owner); SoundSystem.Play(comp.DeActivateSound.GetSound(), Filter.Pvs(comp.Owner, entityManager: EntityManager), comp.Owner);
@@ -97,7 +98,8 @@ namespace Content.Server.Weapon.Melee.EnergySword
_item.SetSize(comp.Owner, 9999, item); _item.SetSize(comp.Owner, 9999, item);
} }
EnsureComp<SharpComponent>(comp.Owner); if (comp.IsSharp)
EnsureComp<SharpComponent>(comp.Owner);
if(TryComp<MeleeWeaponComponent>(comp.Owner, out var weaponComp)) if(TryComp<MeleeWeaponComponent>(comp.Owner, out var weaponComp))
weaponComp.HitSound = comp.OnHitOn; weaponComp.HitSound = comp.OnHitOn;

View File

@@ -151,15 +151,17 @@ public abstract partial class SharedGunSystem
{ {
entity = component.Entities[^1]; entity = component.Entities[^1];
args.Ammo.Add(EnsureComp<AmmoComponent>(entity));
// Leave the entity as is if it doesn't auto cycle // Leave the entity as is if it doesn't auto cycle
// TODO: Suss this out with NewAmmoComponent as I don't think it gets removed from container properly // TODO: Suss this out with NewAmmoComponent as I don't think it gets removed from container properly
if (HasComp<CartridgeAmmoComponent>(entity) && component.AutoCycle) if (!component.AutoCycle)
{ {
component.Entities.RemoveAt(component.Entities.Count - 1); return;
component.Container.Remove(entity);
} }
args.Ammo.Add(EnsureComp<AmmoComponent>(entity)); component.Entities.RemoveAt(component.Entities.Count - 1);
component.Container.Remove(entity);
} }
else if (component.UnspawnedCount > 0) else if (component.UnspawnedCount > 0)
{ {

View File

@@ -487,7 +487,7 @@
- type: BallisticAmmoProvider - type: BallisticAmmoProvider
whitelist: whitelist:
tags: tags:
- CartridgeRocket - BulletFoam
capacity: 1 capacity: 1
soundInsert: soundInsert:
path: /Audio/Weapons/drawbow2.ogg path: /Audio/Weapons/drawbow2.ogg
@@ -648,3 +648,49 @@
size: 24 size: 24
sprite: Objects/Fun/toys.rsi sprite: Objects/Fun/toys.rsi
heldPrefix: orb heldPrefix: orb
- type: entity
id: ToySword
name: toy sword
description: New Sandy-Cat plastic sword! Comes with realistic sound and full color! Looks almost like the real thing!
components:
- type: EnergySword
isSharp: false
colorOptions:
- DodgerBlue
- type: Sprite
sprite: Objects/Weapons/Melee/e_sword.rsi
layers:
- state: e_sword
- state: e_sword_blade
color: "#FFFFFF"
visible: false
shader: unshaded
map: [ "blade" ]
- type: Item
size: 5
sprite: Objects/Weapons/Melee/e_sword.rsi
- type: UseDelay
delay: 1.0
- type: PointLight
netsync: false
enabled: false
radius: 2
energy: 2
color: white
- type: Appearance
- type: ToggleableLightVisuals
spriteLayer: blade
inhandVisuals:
left:
- state: inhand-left-blade
shader: unshaded
right:
- state: inhand-right-blade
shader: unshaded
- type: DisarmMalus
malus: 0
- type: MeleeWeapon
damage:
types:
Blunt: 0

View File

@@ -20,7 +20,7 @@
components: components:
- type: BallisticAmmoProvider - type: BallisticAmmoProvider
capacity: 40 capacity: 40
proto: BulletDonkSoft proto: BulletFoam
- type: Sprite - type: Sprite
sprite: Objects/Fun/toys.rsi sprite: Objects/Fun/toys.rsi
state: foambox state: foambox

View File

@@ -1,34 +1,14 @@
- type: entity - type: entity
id: BaseBulletDonkSoft id: BulletFoam
description: I hope you're wearing eye protection.
name: foam dart name: foam dart
parent: BaseItem parent: BaseItem
abstract: true
components: components:
- type: Tag - type: Tag
tags: tags:
- Cartridge - BulletFoam
- CartridgeRocket - type: Ammo
- type: Projectile - type: Sprite
damage: sprite: Objects/Fun/toys.rsi
types: layers:
Blunt: 1 - state: foamdart
soundHit:
path: /Audio/Weapons/Guns/Hits/bullet_hit.ogg
- type: entity
id: BulletDonkSoft
name: foam dart
parent: BaseBulletDonkSoft
description: I hope you're wearing eye protection.
components:
- type: CartridgeAmmo
proto: BulletFoam
deleteOnSpawn: true
- type: Sprite
sprite: Objects/Fun/toys.rsi
layers:
- state: foamdart
- type: Projectile
damage:
types:
Blunt: 1

View File

@@ -323,24 +323,6 @@
intensitySlope: 1 intensitySlope: 1
maxIntensity: 10 maxIntensity: 10
- type: entity
id: BulletFoam
name: foam dart
parent: BaseBullet
noSpawn: true
components:
- type: Sprite
sprite: Objects/Fun/toys.rsi
layers:
- state: foamdart
- type: Projectile
deleteOnCollide: true
damage:
types:
Blunt: 2
soundHit:
path: /Audio/Weapons/Guns/Hits/snap.ogg
- type: entity - type: entity
id: BulletCap id: BulletCap
name: cap bullet name: cap bullet

View File

@@ -36,6 +36,9 @@
- type: Tag - type: Tag
id: Bottle id: Bottle
- type: Tag
id: BulletFoam
- type: Tag - type: Tag
id: CableCoil id: CableCoil
@@ -307,7 +310,7 @@
- type: Tag - type: Tag
id: MailingUnitElectronics id: MailingUnitElectronics
- type: Tag - type: Tag
id: Medkit id: Medkit