From abab5bedcd97fec10f0e0e692dd0bedbea877338 Mon Sep 17 00:00:00 2001
From: Rane <60792108+Elijahrane@users.noreply.github.com>
Date: Fri, 15 Jul 2022 03:54:34 -0400
Subject: [PATCH] Port honkbots from nyano (#9698)
---
.../Components/SpamEmitSoundComponent.cs | 18 +++
Content.Server/Sound/EmitSoundSystem.cs | 19 +++
Resources/Maps/lighthouse.yml | 4 +-
Resources/Prototypes/Body/Parts/silicon.yml | 10 +-
Resources/Prototypes/Body/Presets/drone.yml | 12 +-
.../Catalog/Research/technologies.yml | 16 +++
.../Prototypes/Entities/Mobs/NPCs/silicon.yml | 130 ++++++++++++++++++
.../Entities/Objects/Misc/botparts.yml | 12 ++
.../Entities/Structures/Machines/lathe.yml | 3 +
.../Graphs/weapons/modular_mine.yml | 7 +
.../Recipes/Crafting/Graphs/bots/honkbot.yml | 38 +++++
.../Prototypes/Recipes/Crafting/bots.yml | 12 ++
.../Prototypes/Recipes/Lathes/robotics.yml | 32 +++++
Resources/Prototypes/tags.yml | 6 +
.../Mobs/Silicon/Bots/honkbot.rsi/honkbot.png | Bin 0 -> 628 bytes
.../Mobs/Silicon/Bots/honkbot.rsi/meta.json | 15 ++
.../Misc/proximity_sensor.rsi/icon.png | Bin 0 -> 185 bytes
.../Misc/proximity_sensor.rsi/meta.json | 15 ++
18 files changed, 337 insertions(+), 12 deletions(-)
create mode 100644 Content.Server/Sound/Components/SpamEmitSoundComponent.cs
create mode 100644 Resources/Prototypes/Entities/Mobs/NPCs/silicon.yml
create mode 100644 Resources/Prototypes/Entities/Objects/Misc/botparts.yml
create mode 100644 Resources/Prototypes/Recipes/Crafting/Graphs/bots/honkbot.yml
create mode 100644 Resources/Prototypes/Recipes/Crafting/bots.yml
create mode 100644 Resources/Prototypes/Recipes/Lathes/robotics.yml
create mode 100644 Resources/Textures/Mobs/Silicon/Bots/honkbot.rsi/honkbot.png
create mode 100644 Resources/Textures/Mobs/Silicon/Bots/honkbot.rsi/meta.json
create mode 100644 Resources/Textures/Objects/Misc/proximity_sensor.rsi/icon.png
create mode 100644 Resources/Textures/Objects/Misc/proximity_sensor.rsi/meta.json
diff --git a/Content.Server/Sound/Components/SpamEmitSoundComponent.cs b/Content.Server/Sound/Components/SpamEmitSoundComponent.cs
new file mode 100644
index 0000000000..d839dc2f91
--- /dev/null
+++ b/Content.Server/Sound/Components/SpamEmitSoundComponent.cs
@@ -0,0 +1,18 @@
+namespace Content.Server.Sound.Components
+{
+ ///
+ /// Rolls to play a sound every few seconds.
+ ///
+ [RegisterComponent]
+ public sealed class SpamEmitSoundComponent : BaseEmitSoundComponent
+ {
+ [DataField("accumulator")]
+ public float Accumulator = 0f;
+
+ [DataField("rollInterval")]
+ public float RollInterval = 2f;
+
+ [DataField("playChance")]
+ public float PlayChance = 0.5f;
+ }
+}
diff --git a/Content.Server/Sound/EmitSoundSystem.cs b/Content.Server/Sound/EmitSoundSystem.cs
index 7f423e0e2f..7e7b458b85 100644
--- a/Content.Server/Sound/EmitSoundSystem.cs
+++ b/Content.Server/Sound/EmitSoundSystem.cs
@@ -26,6 +26,25 @@ namespace Content.Server.Sound
[Dependency] private readonly ITileDefinitionManager _tileDefMan = default!;
///
+
+ public override void Update(float frameTime)
+ {
+ base.Update(frameTime);
+ foreach (var soundSpammer in EntityQuery())
+ {
+ soundSpammer.Accumulator += frameTime;
+ if (soundSpammer.Accumulator < soundSpammer.RollInterval)
+ {
+ continue;
+ }
+ soundSpammer.Accumulator -= soundSpammer.RollInterval;
+
+ if (_random.Prob(soundSpammer.PlayChance))
+ {
+ TryEmitSound(soundSpammer);
+ }
+ }
+ }
public override void Initialize()
{
base.Initialize();
diff --git a/Resources/Maps/lighthouse.yml b/Resources/Maps/lighthouse.yml
index f85f7b433c..d846d79982 100644
--- a/Resources/Maps/lighthouse.yml
+++ b/Resources/Maps/lighthouse.yml
@@ -45550,7 +45550,7 @@ entities:
- canCollide: False
type: Physics
- uid: 3411
- type: RightHandDrone
+ type: RightArmBorg
components:
- pos: -10.454098,-16.275398
parent: 100
@@ -45562,7 +45562,7 @@ entities:
ents: []
type: ContainerContainer
- uid: 3412
- type: LeftHandDrone
+ type: LeftArmBorg
components:
- pos: -10.563473,-16.494148
parent: 100
diff --git a/Resources/Prototypes/Body/Parts/silicon.yml b/Resources/Prototypes/Body/Parts/silicon.yml
index c3243be82b..581634f985 100644
--- a/Resources/Prototypes/Body/Parts/silicon.yml
+++ b/Resources/Prototypes/Body/Parts/silicon.yml
@@ -8,8 +8,8 @@
damageContainer: Inorganic
- type: entity
- id: LeftHandDrone
- name: "left drone hand"
+ id: LeftArmBorg
+ name: "left borg arm"
parent: PartSilicon
components:
- type: Sprite
@@ -27,11 +27,12 @@
- type: Tag
tags:
- Trash
+ - BorgArm
- type: Recyclable
- type: entity
- id: RightHandDrone
- name: "right drone hand"
+ id: RightArmBorg
+ name: "right borg arm"
parent: PartSilicon
components:
- type: Sprite
@@ -49,4 +50,5 @@
- type: Tag
tags:
- Trash
+ - BorgArm
- type: Recyclable
diff --git a/Resources/Prototypes/Body/Presets/drone.yml b/Resources/Prototypes/Body/Presets/drone.yml
index 6e4813ad40..214acc4b3e 100644
--- a/Resources/Prototypes/Body/Presets/drone.yml
+++ b/Resources/Prototypes/Body/Presets/drone.yml
@@ -2,9 +2,9 @@
name: "drone"
id: DronePreset
partIDs:
- hand 1: LeftHandDrone
- hand 2: LeftHandDrone
- hand 3: LeftHandDrone
- hand 4: LeftHandDrone
- hand 5: RightHandDrone
- hand 6: RightHandDrone
+ hand 1: LeftArmBorg
+ hand 2: LeftArmBorg
+ hand 3: LeftArmBorg
+ hand 4: LeftArmBorg
+ hand 5: RightArmBorg
+ hand 6: RightArmBorg
diff --git a/Resources/Prototypes/Catalog/Research/technologies.yml b/Resources/Prototypes/Catalog/Research/technologies.yml
index 9b6d42cefb..7a4a83ba5a 100644
--- a/Resources/Prototypes/Catalog/Research/technologies.yml
+++ b/Resources/Prototypes/Catalog/Research/technologies.yml
@@ -278,6 +278,7 @@
requiredPoints: 10000
requiredTechnologies:
- IndustrialEngineering
+ - RoboticsTechnology
unlockedRecipes:
- ShuttleConsoleCircuitboard
- Drone
@@ -403,6 +404,21 @@
- MicroManipulatorStockPart
- ScanningModuleStockPart
+- type: technology
+ name: "robotics technology"
+ id: RoboticsTechnology
+ description: Robot parts.
+ icon:
+ sprite: Mobs/Silicon/Bots/honkbot.rsi
+ state: honkbot
+ requiredPoints: 10000
+ requiredTechnologies:
+ - CompactPowerTechnology
+ unlockedRecipes:
+ - ProximitySensor
+ - LeftArmBorg
+ - RightArmBorg
+
# Bluespace Theory Technology Tree
# - type: technology
diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/silicon.yml b/Resources/Prototypes/Entities/Mobs/NPCs/silicon.yml
new file mode 100644
index 0000000000..bc6e8b2c66
--- /dev/null
+++ b/Resources/Prototypes/Entities/Mobs/NPCs/silicon.yml
@@ -0,0 +1,130 @@
+- type: entity
+ save: false
+ abstract: true
+ id: MobSiliconBase
+ components:
+ - type: Reactive
+ groups:
+ Acidic: [Touch]
+ - type: Clickable
+ - type: Damageable
+ damageContainer: Inorganic
+ - type: Bloodstream
+ bloodReagent: Oil
+ bloodlossDamage:
+ types:
+ Bloodloss:
+ 1
+ bloodlossHealDamage:
+ types:
+ Bloodloss:
+ -0.25
+ - type: InteractionOutline
+ - type: Fixtures
+ fixtures:
+ - shape:
+ !type:PhysShapeCircle
+ radius: 0.35
+ mass: 20
+ mask:
+ - MobMask
+ layer:
+ - MobLayer
+ - type: MovementSpeedModifier
+ baseWalkSpeed : 3
+ baseSprintSpeed : 4
+ - type: Sprite
+ noRot: true
+ drawdepth: Mobs
+ netsync: false
+ - type: Recyclable
+ safe: false
+ - type: UtilityAI
+ behaviorSets:
+ - Idle
+ - type: AiFactionTag
+ factions:
+ - SimpleNeutral
+ - type: HealthExaminable
+ examinableTypes:
+ - Blunt
+ - Slash
+ - Piercing
+ - Heat
+ - Shock
+ - type: MovedByPressure
+ - type: Physics
+ bodyType: KinematicController # Same for all inheritors
+ - type: DrawableSolution
+ solution: bloodstream
+ - type: StatusEffects
+ allowed:
+ - Stun
+ - KnockedDown
+ - SlowedDown
+ - Stutter
+ - Electrocution
+ - type: NameIdentifier
+ group: GenericNumber
+ - type: Repairable
+ fuelcost: 15
+ doAfterDelay: 8
+ - type: Pullable
+ - type: Tag
+ tags:
+ - DoorBumpOpener
+ - type: MobState
+ thresholds:
+ 0: Alive
+ 120: Dead
+ - type: Destructible
+ thresholds:
+ - trigger:
+ !type:DamageTrigger
+ damage: 120
+ behaviors:
+ - !type:DoActsBehavior
+ acts: [ "Destruction" ]
+ - type: Input
+ context: "human"
+ - type: PlayerInputMover
+ - type: PlayerMobMover
+
+- type: entity
+ parent: MobSiliconBase
+ id: MobHonkBot
+ name: honkbot
+ description: Horrifying.
+ components:
+ - type: SpamEmitSound
+ sound:
+ collection: BikeHorn
+ - type: UtilityAI
+ behaviorSets:
+ - Idle
+ - type: Sprite
+ drawdepth: Mobs
+ sprite: Mobs/Silicon/Bots/honkbot.rsi
+ state: honkbot
+ - type: Slippery
+ launchForwardsMultiplier: 6.0
+ - type: StepTrigger
+ intersectRatio: 0.2
+ - type: Fixtures
+ fixtures:
+ - shape:
+ !type:PhysShapeCircle
+ radius: 0.35
+ mass: 8
+ mask:
+ - MobMask
+ layer:
+ - MobLayer
+ - SlipLayer
+ - type: Construction
+ graph: HonkBot
+ node: bot
+ - type: GhostTakeoverAvailable
+ makeSentient: true
+ name: honkbot
+ description: An artificial being of pure evil.
diff --git a/Resources/Prototypes/Entities/Objects/Misc/botparts.yml b/Resources/Prototypes/Entities/Objects/Misc/botparts.yml
new file mode 100644
index 0000000000..a0dffdc3f6
--- /dev/null
+++ b/Resources/Prototypes/Entities/Objects/Misc/botparts.yml
@@ -0,0 +1,12 @@
+- type: entity
+ parent: BaseItem
+ id: ProximitySensor
+ name: proximity sensor
+ description: Senses things in close proximity.
+ components:
+ - type: Sprite
+ sprite: Objects/Misc/proximity_sensor.rsi
+ state: icon
+ - type: Tag
+ tags:
+ - ProximitySensor
diff --git a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml
index 618fe6b643..30ae9989cd 100644
--- a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml
+++ b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml
@@ -196,6 +196,9 @@
- PowerCellSmall
- PowerCellMedium
- PowerCellHigh
+ - ProximitySensor
+ - LeftArmBorg
+ - RightArmBorg
- type: ActivatableUI
key: enum.LatheUiKey.Key #Yes only having 1 of them here doesn't break anything
- type: ActivatableUIRequiresPower
diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/weapons/modular_mine.yml b/Resources/Prototypes/Recipes/Construction/Graphs/weapons/modular_mine.yml
index afb90f4d02..28c3ba1674 100644
--- a/Resources/Prototypes/Recipes/Construction/Graphs/weapons/modular_mine.yml
+++ b/Resources/Prototypes/Recipes/Construction/Graphs/weapons/modular_mine.yml
@@ -18,6 +18,11 @@
steps:
- material: Cable
doAfter: 0.5
+ - prototype: ProximitySensor
+ icon:
+ sprite: Objects/Misc/proximity_sensor.rsi
+ state: icon
+ name: proximity sensor
- node: wiredCase
entity: LandMineModular
@@ -32,6 +37,8 @@
completed:
- !type:SpawnPrototype
prototype: CableApcStack1
+ - !type:SpawnPrototype
+ prototype: ProximitySensor
- to: mine
steps:
- tag: Payload
diff --git a/Resources/Prototypes/Recipes/Crafting/Graphs/bots/honkbot.yml b/Resources/Prototypes/Recipes/Crafting/Graphs/bots/honkbot.yml
new file mode 100644
index 0000000000..cc6d81e033
--- /dev/null
+++ b/Resources/Prototypes/Recipes/Crafting/Graphs/bots/honkbot.yml
@@ -0,0 +1,38 @@
+- type: constructionGraph
+ id: HonkBot
+ start: start
+ graph:
+ - node: start
+ edges:
+ - to: bot
+ steps:
+ - prototype: BoxHug
+ icon:
+ sprite: Objects/Storage/boxes.rsi
+ state: box_hug
+ name: box of hugs
+ - prototype: RubberStampClown
+ icon:
+ sprite: Objects/Misc/bureaucracy.rsi
+ state: stamp-clown
+ name: clown's rubber stamp
+ doAfter: 2
+ - prototype: BikeHorn
+ icon:
+ sprite: Objects/Fun/bikehorn.rsi
+ state: icon
+ name: bike horn
+ doAfter: 2
+ - tag: ProximitySensor
+ icon:
+ sprite: Objects/Misc/proximity_sensor.rsi
+ state: icon
+ name: proximity sensor
+ - tag: BorgArm
+ icon:
+ sprite: Mobs/Silicon/drone.rsi
+ state: l_hand
+ name: borg arm
+ doAfter: 2
+ - node: bot
+ entity: MobHonkBot
diff --git a/Resources/Prototypes/Recipes/Crafting/bots.yml b/Resources/Prototypes/Recipes/Crafting/bots.yml
new file mode 100644
index 0000000000..24d70aa503
--- /dev/null
+++ b/Resources/Prototypes/Recipes/Crafting/bots.yml
@@ -0,0 +1,12 @@
+- type: construction
+ name: honkbot
+ id: honkbot
+ graph: HonkBot
+ startNode: start
+ targetNode: bot
+ category: Utilities
+ objectType: Item
+ description: This bot honks and slips people.
+ icon:
+ sprite: Mobs/Silicon/Bots/honkbot.rsi
+ state: honkbot
diff --git a/Resources/Prototypes/Recipes/Lathes/robotics.yml b/Resources/Prototypes/Recipes/Lathes/robotics.yml
new file mode 100644
index 0000000000..0f25f33ea7
--- /dev/null
+++ b/Resources/Prototypes/Recipes/Lathes/robotics.yml
@@ -0,0 +1,32 @@
+- type: latheRecipe
+ id: ProximitySensor
+ icon:
+ sprite: Objects/Misc/proximity_sensor.rsi
+ state: icon
+ result: ProximitySensor
+ completetime: 2
+ materials:
+ Steel: 200
+ Glass: 300
+
+- type: latheRecipe
+ id: LeftArmBorg
+ icon:
+ sprite: Mobs/Silicon/drone.rsi
+ state: "l_hand"
+ result: LeftArmBorg
+ completetime: 2
+ materials:
+ Steel: 70
+ Glass: 25
+
+- type: latheRecipe
+ id: RightArmBorg
+ icon:
+ sprite: Mobs/Silicon/drone.rsi
+ state: "r_hand"
+ result: RightArmBorg
+ completetime: 2
+ materials:
+ Steel: 70
+ Glass: 25
diff --git a/Resources/Prototypes/tags.yml b/Resources/Prototypes/tags.yml
index 8404f07924..2c0db23646 100644
--- a/Resources/Prototypes/tags.yml
+++ b/Resources/Prototypes/tags.yml
@@ -21,6 +21,9 @@
- type: Tag
id: BodyBag
+- type: Tag
+ id: BorgArm
+
- type: Tag
id: BotanyHatchet
@@ -359,6 +362,9 @@
- type: Tag
id: Powerdrill
+- type: Tag
+ id: ProximitySensor
+
- type: Tag
id: PussyWagonKeys
diff --git a/Resources/Textures/Mobs/Silicon/Bots/honkbot.rsi/honkbot.png b/Resources/Textures/Mobs/Silicon/Bots/honkbot.rsi/honkbot.png
new file mode 100644
index 0000000000000000000000000000000000000000..9000a3cbaaaada6552f7acd0a0a58eeb644e7c78
GIT binary patch
literal 628
zcmV-)0*n2LP)FkW4F)NpUUG;@jfj_AEL9Ob#l##UO!J*)muxoKt{U*N
z-^L08oZegBrG$*I@0zqfCQ(*RWSa=ENcMx#-dN~QRgshPvv<#JHAbYKdA
z7{mr&2FPsJG=O|QulqKBzn{6?ZvII!nT(*CfBy7^tZHd_k@}o2)0nQepja#lfVi&L
z$>;Uz4qhM-pv%=Ky#ILhR2y#{D-;TrAWiE4AYi^$D$#qt&tL>4lS!>Fwa&lUygL9i
zet1Y*ZDYvrcf6nXr>A9NOdvsEbo8#u$DS*VbJU9+fIbolD@2C74-;h1l*WTF+JL}r
ztdlIu6bgkXkx29gK!p%HK)?(TGRysIo8}iE1}PSc@te>SfOfSWFptN>pVbzb!yGMc
zK~DitSky($vU}usz~d0#DpbQe0jLnD2V&5?5+VjdC4{!qKWOIdEGdd|JAnM|9*U86
z4pajx5KzL*XliO285!Bx*#!gy
zl$DhwCMGUkytt#IgE3#4FC_V
zi5Q0y3{%g)km}J=m?W0f5Z| manW0urz#>(yZxYZf22WQ%mvv4FO#tX;J7@p^
literal 0
HcmV?d00001
diff --git a/Resources/Textures/Objects/Misc/proximity_sensor.rsi/meta.json b/Resources/Textures/Objects/Misc/proximity_sensor.rsi/meta.json
new file mode 100644
index 0000000000..3fb15166fc
--- /dev/null
+++ b/Resources/Textures/Objects/Misc/proximity_sensor.rsi/meta.json
@@ -0,0 +1,15 @@
+{
+ "copyright" : "Taken from https://github.com/tgstation/tgstation at at https://github.com/tgstation/tgstation/commit/40d89d11ea4a5cb81d61dc1018b46f4e7d32c62a",
+ "license" : "CC-BY-SA-3.0",
+ "size" : {
+ "x" : 32,
+ "y" : 32
+ },
+ "states" : [
+ {
+ "directions" : 1,
+ "name" : "icon"
+ }
+ ],
+ "version" : 1
+}
|