From 87aced83925298ed80c9d8c2d3fcba59e92e82a5 Mon Sep 17 00:00:00 2001 From: Swept Date: Thu, 11 Mar 2021 00:06:57 +0000 Subject: [PATCH] Adds mice (#3594) * Initial * Mmm * Adds them to map * Makes mice grindable * meta.json looking nice * Mice go squeak * Ye * E * Review * Update Content.Server/GameObjects/Components/Mobs/Speech/MouseAccentComponent.cs Co-authored-by: Paul Ritter --- Content.Client/IgnoredComponents.cs | 2 + .../Mobs/Speech/MouseAccentComponent.cs | 24 ++++ Resources/Maps/saltern.yml | 30 +++++ .../Entities/Clothing/Head/animals.yml | 33 ------ .../Effects/Markers/timed_spawners.yml | 23 +++- .../Prototypes/Entities/Mobs/NPCs/animals.yml | 99 +++++++++++++++++ .../Head/Animals/mouse_brown.rsi/icon.png | Bin 236 -> 0 bytes .../Head/Animals/mouse_brown.rsi/meta.json | 26 ----- .../Head/Animals/mouse_gray.rsi/icon.png | Bin 229 -> 0 bytes .../Head/Animals/mouse_gray.rsi/meta.json | 26 ----- .../Head/Animals/mouse_white.rsi/icon.png | Bin 232 -> 0 bytes .../Head/Animals/mouse_white.rsi/meta.json | 26 ----- .../Animals/mouse.rsi/0-equipped-HELMET.png} | Bin .../Animals/mouse.rsi/0-inhand-left.png} | Bin .../Animals/mouse.rsi/0-inhand-right.png} | Bin .../Animals/mouse.rsi/1-equipped-HELMET.png} | Bin .../Animals/mouse.rsi/1-inhand-left.png} | Bin .../Animals/mouse.rsi/1-inhand-right.png} | Bin .../Animals/mouse.rsi/2-equipped-HELMET.png} | Bin .../Animals/mouse.rsi/2-inhand-left.png} | Bin .../Animals/mouse.rsi/2-inhand-right.png} | Bin .../Textures/Mobs/Animals/mouse.rsi/meta.json | 103 ++++++++---------- 22 files changed, 222 insertions(+), 170 deletions(-) create mode 100644 Content.Server/GameObjects/Components/Mobs/Speech/MouseAccentComponent.cs delete mode 100644 Resources/Textures/Clothing/Head/Animals/mouse_brown.rsi/icon.png delete mode 100644 Resources/Textures/Clothing/Head/Animals/mouse_brown.rsi/meta.json delete mode 100644 Resources/Textures/Clothing/Head/Animals/mouse_gray.rsi/icon.png delete mode 100644 Resources/Textures/Clothing/Head/Animals/mouse_gray.rsi/meta.json delete mode 100644 Resources/Textures/Clothing/Head/Animals/mouse_white.rsi/icon.png delete mode 100644 Resources/Textures/Clothing/Head/Animals/mouse_white.rsi/meta.json rename Resources/Textures/{Clothing/Head/Animals/mouse_white.rsi/equipped-HELMET.png => Mobs/Animals/mouse.rsi/0-equipped-HELMET.png} (100%) rename Resources/Textures/{Clothing/Head/Animals/mouse_white.rsi/inhand-left.png => Mobs/Animals/mouse.rsi/0-inhand-left.png} (100%) rename Resources/Textures/{Clothing/Head/Animals/mouse_white.rsi/inhand-right.png => Mobs/Animals/mouse.rsi/0-inhand-right.png} (100%) rename Resources/Textures/{Clothing/Head/Animals/mouse_brown.rsi/equipped-HELMET.png => Mobs/Animals/mouse.rsi/1-equipped-HELMET.png} (100%) rename Resources/Textures/{Clothing/Head/Animals/mouse_brown.rsi/inhand-left.png => Mobs/Animals/mouse.rsi/1-inhand-left.png} (100%) rename Resources/Textures/{Clothing/Head/Animals/mouse_brown.rsi/inhand-right.png => Mobs/Animals/mouse.rsi/1-inhand-right.png} (100%) rename Resources/Textures/{Clothing/Head/Animals/mouse_gray.rsi/equipped-HELMET.png => Mobs/Animals/mouse.rsi/2-equipped-HELMET.png} (100%) rename Resources/Textures/{Clothing/Head/Animals/mouse_gray.rsi/inhand-left.png => Mobs/Animals/mouse.rsi/2-inhand-left.png} (100%) rename Resources/Textures/{Clothing/Head/Animals/mouse_gray.rsi/inhand-right.png => Mobs/Animals/mouse.rsi/2-inhand-right.png} (100%) diff --git a/Content.Client/IgnoredComponents.cs b/Content.Client/IgnoredComponents.cs index bc72033ad1..83f2187bf6 100644 --- a/Content.Client/IgnoredComponents.cs +++ b/Content.Client/IgnoredComponents.cs @@ -243,6 +243,8 @@ namespace Content.Client "Shovel", "ReagentTank", "UtilityAI", + "MouseAccent", + "GhostTakeoverAvailable", "GhostRoleMobSpawner", }; } diff --git a/Content.Server/GameObjects/Components/Mobs/Speech/MouseAccentComponent.cs b/Content.Server/GameObjects/Components/Mobs/Speech/MouseAccentComponent.cs new file mode 100644 index 0000000000..2862562014 --- /dev/null +++ b/Content.Server/GameObjects/Components/Mobs/Speech/MouseAccentComponent.cs @@ -0,0 +1,24 @@ +using System; +using Robust.Shared.GameObjects; +using System.Collections.Generic; +using Robust.Shared.Random; +using Robust.Shared.IoC; + +namespace Content.Server.GameObjects.Components.Mobs.Speech +{ + [RegisterComponent] + public class MouseAccentComponent : Component, IAccentComponent + { + [Dependency] private readonly IRobustRandom _random = default!; + public override string Name => "MouseAccent"; + + private static readonly IReadOnlyList Squeek = new List{ + "Squeak!", "Piep!", "Chuu!" + }.AsReadOnly(); + + public string Accentuate(string message) + { + return _random.Pick(Squeek); + } + } +} diff --git a/Resources/Maps/saltern.yml b/Resources/Maps/saltern.yml index f6d0fc5fd8..b2d47a1170 100644 --- a/Resources/Maps/saltern.yml +++ b/Resources/Maps/saltern.yml @@ -40729,4 +40729,34 @@ entities: - pos: -36.5,4.5 parent: 853 type: Transform +- uid: 4724 + type: MouseAITimedSpawner + components: + - pos: -15.5,25.5 + parent: 853 + type: Transform +- uid: 4725 + type: MouseAITimedSpawner + components: + - pos: 13.5,18.5 + parent: 853 + type: Transform +- uid: 4726 + type: MouseAITimedSpawner + components: + - pos: 27.5,-1.5 + parent: 853 + type: Transform +- uid: 4727 + type: MouseAITimedSpawner + components: + - pos: -9.5,-25.5 + parent: 853 + type: Transform +- uid: 4728 + type: MouseAITimedSpawner + components: + - pos: -33.5,-11.5 + parent: 853 + type: Transform ... diff --git a/Resources/Prototypes/Entities/Clothing/Head/animals.yml b/Resources/Prototypes/Entities/Clothing/Head/animals.yml index 4405f7fce3..4ea1c92242 100644 --- a/Resources/Prototypes/Entities/Clothing/Head/animals.yml +++ b/Resources/Prototypes/Entities/Clothing/Head/animals.yml @@ -52,36 +52,3 @@ sprite: Clothing/Head/Animals/monkey.rsi - type: Clothing sprite: Clothing/Head/Animals/monkey.rsi - -- type: entity - parent: ClothingHeadBase - id: ClothingHeadHatAnimalMouseBrown - name: mouse brown - description: This is a head of a brown mouse. Squeak! - components: - - type: Sprite - sprite: Clothing/Head/Animals/mouse_brown.rsi - - type: Clothing - sprite: Clothing/Head/Animals/mouse_brown.rsi - -- type: entity - parent: ClothingHeadBase - id: ClothingHeadHatAnimalMouseGray - name: mouse gray - description: This is a head of a grey mouse. Squeak! - components: - - type: Sprite - sprite: Clothing/Head/Animals/mouse_gray.rsi - - type: Clothing - sprite: Clothing/Head/Animals/mouse_gray.rsi - -- type: entity - parent: ClothingHeadBase - id: ClothingHeadHatAnimalMouseWhite - name: mouse white - description: This is a head of a white mouse. Squeak! - components: - - type: Sprite - sprite: Clothing/Head/Animals/mouse_white.rsi - - type: Clothing - sprite: Clothing/Head/Animals/mouse_white.rsi diff --git a/Resources/Prototypes/Entities/Effects/Markers/timed_spawners.yml b/Resources/Prototypes/Entities/Effects/Markers/timed_spawners.yml index 8dafb70910..0ce439b354 100644 --- a/Resources/Prototypes/Entities/Effects/Markers/timed_spawners.yml +++ b/Resources/Prototypes/Entities/Effects/Markers/timed_spawners.yml @@ -8,7 +8,6 @@ visible: false sprite: Interface/Misc/markers.rsi state: cross_blue - - type: Marker - type: Clickable - type: InteractionOutline @@ -27,7 +26,6 @@ visible: false sprite: Interface/Misc/markers.rsi state: spawner_ai - - type: TimedSpawner prototypes: - HumanMob_Spirate @@ -47,7 +45,6 @@ visible: false sprite: Interface/Misc/markers.rsi state: spawner_xenoai - - type: TimedSpawner prototypes: - XenoMob_Content @@ -55,3 +52,23 @@ intervalSeconds: 30 minimumEntitiesSpawned: 2 maximumEntitiesSpawned: 4 + +- type: entity + name: Mouse AI Timed Spawner + id: MouseAITimedSpawner + parent: BaseTimedSpawner + components: + - type: Sprite + netsync: false + visible: false + sprite: Mobs/Animals/mouse.rsi + state: icon-2 + - type: TimedSpawner + prototypes: + - MouseMob_Content + - MouseMob1_Content + - MouseMob2_Content + chance: 0.75 + intervalSeconds: 100 + minimumEntitiesSpawned: 1 + maximumEntitiesSpawned: 1 diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml b/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml index 84451c7186..271b61e75e 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml @@ -434,3 +434,102 @@ - type: DamageStateVisualizer normal: penguin dead: penguin_dead + +- type: entity + name: mouse + parent: SimpleMobBase + id: MouseMob_Content + description: Squeak! + components: + - type: Tag + tags: + - Grindable + - type: GhostTakeoverAvailable + makeSentient: true + name: mouse + description: A mouse in maint. + - type: Sprite + drawdepth: Mobs + layers: + - map: ["enum.DamageStateVisualLayers.Base"] + state: mouse-0 + sprite: Mobs/Animals/mouse.rsi + - type: Clothing + QuickEquip: false + sprite: Mobs/Animals/mouse.rsi + HeldPrefix: 0 + ClothingPrefix: 0 + Slots: + - Helmet + - type: Physics + bodyType: Dynamic + mass: 10 + fixtures: + - shape: + !type:PhysShapeAabb + bounds: "-0.50,-0.30,0.35,0.30" + mask: + - Impassable + - VaultImpassable + - SmallImpassable + layer: + - Opaque + - type: MovementSpeedModifier + baseWalkSpeed : 5 + baseSprintSpeed : 5 + - type: Appearance + visuals: + - type: DamageStateVisualizer + normal: mouse-0 + crit: dead-0 + dead: splat-0 +# Eek! You can eat them alive for now until someone makes something that detects when +# a mob is dead or something idk + - type: Food + - type: LoopingSound + - type: SolutionContainer + contents: + reagents: + - ReagentId: chem.Nutriment + Quantity: 5 + - type: MouseAccent + +- type: entity + parent: MouseMob_Content + id: MouseMob1_Content + components: + - type: Sprite + drawdepth: Mobs + layers: + - map: ["enum.DamageStateVisualLayers.Base"] + state: mouse-1 + sprite: Mobs/Animals/mouse.rsi + - type: Clothing + HeldPrefix: 1 + ClothingPrefix: 1 + - type: Appearance + visuals: + - type: DamageStateVisualizer + normal: mouse-1 + crit: dead-1 + dead: splat-1 + +- type: entity + parent: MouseMob_Content + id: MouseMob2_Content + components: + - type: Sprite + drawdepth: Mobs + layers: + - map: ["enum.DamageStateVisualLayers.Base"] + state: mouse-2 + sprite: Mobs/Animals/mouse.rsi + - type: Clothing + HeldPrefix: 1 + ClothingPrefix: 2 + - type: Appearance + visuals: + - type: DamageStateVisualizer + normal: mouse-2 + crit: dead-2 + dead: splat-2 diff --git a/Resources/Textures/Clothing/Head/Animals/mouse_brown.rsi/icon.png b/Resources/Textures/Clothing/Head/Animals/mouse_brown.rsi/icon.png deleted file mode 100644 index acb82ac99853826887b19a2db56dbee84f19bc52..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 236 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJ&7LlfAr*7pPFTowC_tobzqZm1 zF}-(Tt{Z#})^MKwR@%M(VRuJqf5P2UuMQZbT}YXjXmINpcSp1F!3RHI?R{>4|EFW% zl=|aaYENuhbGb>Q%WmIy)rH3ouPeN^*iO7>8F$`y_Rm+BeVtMMMaB7CRfwmbL1Bnz z-{yHLYyxHv+Ba6lb+aYxk$Kd<@kNz@8N-BWrpr$^Y+18ZuwesZ!`HHWhP1iY$}=8B kuV~-`qCYVXfg(>?YnCfm&U|&E9_V}qPgg&ebxsLQ0AqA$G5`Po diff --git a/Resources/Textures/Clothing/Head/Animals/mouse_brown.rsi/meta.json b/Resources/Textures/Clothing/Head/Animals/mouse_brown.rsi/meta.json deleted file mode 100644 index a470e00944..0000000000 --- a/Resources/Textures/Clothing/Head/Animals/mouse_brown.rsi/meta.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "version": 1, - "license": "CC-BY-SA-3.0", - "copyright": "Taken from tgstation at commit https://github.com/tgstation/tgstation/commit/4f6190e2895e09116663ef282d3ce1d8b35c032e", - "size": { - "x": 32, - "y": 32 - }, - "states": [ - { - "name": "icon" - }, - { - "name": "equipped-HELMET", - "directions": 4 - }, - { - "name": "inhand-left", - "directions": 4 - }, - { - "name": "inhand-right", - "directions": 4 - } - ] -} diff --git a/Resources/Textures/Clothing/Head/Animals/mouse_gray.rsi/icon.png b/Resources/Textures/Clothing/Head/Animals/mouse_gray.rsi/icon.png deleted file mode 100644 index 8b61e2c277d4a51029adc7f5c2e8a739d837dd87..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 229 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJHJ&bxAr*7pPEzDM$xWQ!SR)y5PTiHPGD*p00i_>zopr0P4k7K>z>% diff --git a/Resources/Textures/Clothing/Head/Animals/mouse_gray.rsi/meta.json b/Resources/Textures/Clothing/Head/Animals/mouse_gray.rsi/meta.json deleted file mode 100644 index a470e00944..0000000000 --- a/Resources/Textures/Clothing/Head/Animals/mouse_gray.rsi/meta.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "version": 1, - "license": "CC-BY-SA-3.0", - "copyright": "Taken from tgstation at commit https://github.com/tgstation/tgstation/commit/4f6190e2895e09116663ef282d3ce1d8b35c032e", - "size": { - "x": 32, - "y": 32 - }, - "states": [ - { - "name": "icon" - }, - { - "name": "equipped-HELMET", - "directions": 4 - }, - { - "name": "inhand-left", - "directions": 4 - }, - { - "name": "inhand-right", - "directions": 4 - } - ] -} diff --git a/Resources/Textures/Clothing/Head/Animals/mouse_white.rsi/icon.png b/Resources/Textures/Clothing/Head/Animals/mouse_white.rsi/icon.png deleted file mode 100644 index bb5e161745ebe0d8b6494b4de0d2ee32fda35fbe..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 232 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJ^`0({Ar*7pPEzDMb>Hrul2)`o7GJuwQ$W-#;|T|2)c@4@U94O~F< eCkCkEDdQeZ+20?M0@Z*{XYh3Ob6Mw<&;$T