diff --git a/Content.Server/Arcade/Components/SpaceVillainArcadeComponent.cs b/Content.Server/Arcade/Components/SpaceVillainArcadeComponent.cs index 48fad3d2d0..9b1124accb 100644 --- a/Content.Server/Arcade/Components/SpaceVillainArcadeComponent.cs +++ b/Content.Server/Arcade/Components/SpaceVillainArcadeComponent.cs @@ -63,6 +63,15 @@ namespace Content.Server.Arcade.Components "HarmonicaInstrument", "OcarinaInstrument", "RecorderInstrument", "GunpetInstrument", "BirdToyInstrument" }; + [DataField("rewardMinAmount")] + public int _rewardMinAmount; + + [DataField("rewardMaxAmount")] + public int _rewardMaxAmount; + + [ViewVariables(VVAccess.ReadWrite)] + public int _rewardAmount = 0; + protected override void Initialize() { base.Initialize(); @@ -71,6 +80,10 @@ namespace Content.Server.Arcade.Components { UserInterface.OnReceiveMessage += UserInterfaceOnOnReceiveMessage; } + + // Random amount of prizes + _rewardAmount = new Random().Next(_rewardMinAmount, _rewardMaxAmount + 1); + } public void OnPowerStateChanged(PowerChangedEvent e) @@ -115,8 +128,11 @@ namespace Content.Server.Arcade.Components /// public void ProcessWin() { - var entityManager = IoCManager.Resolve(); - entityManager.SpawnEntity(_random.Pick(_possibleRewards), entityManager.GetComponent(Owner).MapPosition); + if (_rewardAmount > 0) + { + _entityManager.SpawnEntity(_random.Pick(_possibleRewards), _entityManager.GetComponent(Owner).Coordinates); + _rewardAmount--; + } } /// diff --git a/Resources/Maps/bagel.yml b/Resources/Maps/bagel.yml index f86cd7c33a..3c5f34f8c3 100644 --- a/Resources/Maps/bagel.yml +++ b/Resources/Maps/bagel.yml @@ -58540,7 +58540,7 @@ entities: parent: 60 type: Transform - uid: 4611 - type: SpaceVillainArcade + type: SpaceVillainArcadeFilled components: - rot: -1.5707963267948966 rad pos: -11.5,-64.5 @@ -63374,7 +63374,7 @@ entities: parent: 60 type: Transform - uid: 5301 - type: SpaceVillainArcade + type: SpaceVillainArcadeFilled components: - pos: -37.5,-34.5 parent: 60 @@ -135563,7 +135563,7 @@ entities: parent: 60 type: Transform - uid: 16123 - type: SpaceVillainArcade + type: SpaceVillainArcadeFilled components: - rot: 1.5707963267948966 rad pos: -10.5,-14.5 diff --git a/Resources/Maps/box.yml b/Resources/Maps/box.yml index 757b4e5de0..ce464403b3 100644 --- a/Resources/Maps/box.yml +++ b/Resources/Maps/box.yml @@ -44036,7 +44036,7 @@ entities: parent: 8364 type: Transform - uid: 6971 - type: SpaceVillainArcade + type: SpaceVillainArcadeFilled components: - rot: -1.5707963267948966 rad pos: 27.5,-1.5 @@ -51831,7 +51831,7 @@ entities: parent: 8364 type: Transform - uid: 8201 - type: SpaceVillainArcade + type: SpaceVillainArcadeFilled components: - rot: -1.5707963267948966 rad pos: 27.5,-2.5 @@ -102267,7 +102267,7 @@ entities: parent: 8364 type: Transform - uid: 11688 - type: SpaceVillainArcade + type: SpaceVillainArcadeFilled components: - pos: 72.5,12.5 parent: 8364 @@ -201942,7 +201942,7 @@ entities: parent: 8364 type: Transform - uid: 25880 - type: SpaceVillainArcade + type: SpaceVillainArcadeFilled components: - pos: 18.5,-10.5 parent: 8364 @@ -205408,7 +205408,7 @@ entities: - powerLoad: 0 type: ApcPowerReceiver - uid: 26426 - type: SpaceVillainArcade + type: SpaceVillainArcadeFilled components: - pos: -4.5,45.5 parent: 8364 diff --git a/Resources/Maps/cluster.yml b/Resources/Maps/cluster.yml index 1493153d0e..4ca0eaba9a 100644 --- a/Resources/Maps/cluster.yml +++ b/Resources/Maps/cluster.yml @@ -58695,7 +58695,7 @@ entities: parent: 127 type: Transform - uid: 7176 - type: SpaceVillainArcade + type: SpaceVillainArcadeFilled components: - pos: -32.5,-6.5 parent: 127 @@ -67374,7 +67374,7 @@ entities: parent: 127 type: Transform - uid: 8322 - type: SpaceVillainArcade + type: SpaceVillainArcadeFilled components: - pos: -4.5,31.5 parent: 127 diff --git a/Resources/Maps/marathon.yml b/Resources/Maps/marathon.yml index d6b19cd308..782d51dae0 100644 --- a/Resources/Maps/marathon.yml +++ b/Resources/Maps/marathon.yml @@ -68634,7 +68634,7 @@ entities: parent: 30 type: Transform - uid: 6451 - type: SpaceVillainArcade + type: SpaceVillainArcadeFilled components: - pos: 18.5,44.5 parent: 30 @@ -128800,7 +128800,7 @@ entities: parent: 30 type: Transform - uid: 15237 - type: SpaceVillainArcade + type: SpaceVillainArcadeFilled components: - pos: 37.5,45.5 parent: 30 diff --git a/Resources/Maps/meta.yml b/Resources/Maps/meta.yml index 60adb517c0..02f6dff3f3 100644 --- a/Resources/Maps/meta.yml +++ b/Resources/Maps/meta.yml @@ -73609,7 +73609,7 @@ entities: parent: 0 type: Transform - uid: 6640 - type: SpaceVillainArcade + type: SpaceVillainArcadeFilled components: - pos: -10.5,57.5 parent: 0 @@ -142270,7 +142270,7 @@ entities: parent: 0 type: Transform - uid: 16833 - type: SpaceVillainArcade + type: SpaceVillainArcadeFilled components: - pos: -49.5,-23.5 parent: 0 @@ -180593,7 +180593,7 @@ entities: parent: 0 type: Transform - uid: 22605 - type: SpaceVillainArcade + type: SpaceVillainArcadeFilled components: - pos: 0.5,-64.5 parent: 0 @@ -191615,13 +191615,13 @@ entities: type: Transform - type: ActiveEmergencyLight - uid: 24288 - type: SpaceVillainArcade + type: SpaceVillainArcadeFilled components: - pos: 23.5,0.5 parent: 0 type: Transform - uid: 24289 - type: SpaceVillainArcade + type: SpaceVillainArcadeFilled components: - pos: -61.5,-7.5 parent: 0 @@ -195947,14 +195947,14 @@ entities: parent: 0 type: Transform - uid: 24761 - type: SpaceVillainArcade + type: SpaceVillainArcadeFilled components: - rot: -1.5707963267948966 rad pos: 25.5,33.5 parent: 0 type: Transform - uid: 24762 - type: SpaceVillainArcade + type: SpaceVillainArcadeFilled components: - rot: -1.5707963267948966 rad pos: 25.5,31.5 diff --git a/Resources/Maps/nukieplanet.yml b/Resources/Maps/nukieplanet.yml index d10ac07b82..35b6028fb6 100644 --- a/Resources/Maps/nukieplanet.yml +++ b/Resources/Maps/nukieplanet.yml @@ -14921,13 +14921,13 @@ entities: - unspawnedCount: 35 type: BallisticAmmoProvider - uid: 1652 - type: SpaceVillainArcade + type: SpaceVillainArcadeFilled components: - pos: 10.5,-6.5 parent: 104 type: Transform - uid: 1653 - type: SpaceVillainArcade + type: SpaceVillainArcadeFilled components: - pos: 9.5,-6.5 parent: 104 diff --git a/Resources/Maps/omega.yml b/Resources/Maps/omega.yml index ebd568f7b6..a5ba5df1c0 100644 --- a/Resources/Maps/omega.yml +++ b/Resources/Maps/omega.yml @@ -38616,7 +38616,7 @@ entities: parent: 0 type: Transform - uid: 3774 - type: SpaceVillainArcade + type: SpaceVillainArcadeFilled components: - pos: -21.5,5.5 parent: 0 diff --git a/Resources/Prototypes/Entities/Markers/Spawners/Random/arcade.yml b/Resources/Prototypes/Entities/Markers/Spawners/Random/arcade.yml index ed1ac9cd93..4c4dc2da28 100644 --- a/Resources/Prototypes/Entities/Markers/Spawners/Random/arcade.yml +++ b/Resources/Prototypes/Entities/Markers/Spawners/Random/arcade.yml @@ -11,5 +11,5 @@ - type: RandomSpawner prototypes: - BlockGameArcade - - SpaceVillainArcade + - SpaceVillainArcadeFilled chance: 1 diff --git a/Resources/Prototypes/Entities/Structures/Machines/Computers/arcades.yml b/Resources/Prototypes/Entities/Structures/Machines/Computers/arcades.yml index 2af2d95236..73ef3edd0a 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/Computers/arcades.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/Computers/arcades.yml @@ -41,6 +41,7 @@ parent: ArcadeBase components: - type: SpaceVillainArcade + rewardAmount: 0 - type: Wires LayoutId: Arcade BoardName: "Arcade" @@ -56,6 +57,15 @@ - type: Computer board: SpaceVillainArcadeComputerCircuitboard +- type: entity + id: SpaceVillainArcadeFilled + parent: SpaceVillainArcade + suffix: Filled + components: + - type: SpaceVillainArcade + rewardMinAmount: 5 + rewardMaxAmount: 8 + - type: entity id: BlockGameArcade description: An arcade cabinet with a strangely familiar game.