]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Slimes and their habitats (#15379)
authorNim <128169402+Nimfar11@users.noreply.github.com>
Mon, 1 May 2023 08:21:39 +0000 (11:21 +0300)
committerGitHub <noreply@github.com>
Mon, 1 May 2023 08:21:39 +0000 (18:21 +1000)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
20 files changed:
Content.Server/StationEvents/Components/SpiderSpawnRuleComponent.cs [deleted file]
Content.Server/StationEvents/Components/VentCrittersRuleComponent.cs
Content.Server/StationEvents/Events/SpiderSpawnRule.cs [deleted file]
Content.Server/StationEvents/Events/VentCrittersRule.cs
Resources/Audio/Effects/Footsteps/attributions.yml
Resources/Audio/Effects/Footsteps/slime1.ogg [new file with mode: 0644]
Resources/Locale/en-US/accent/accents.ftl
Resources/Locale/en-US/ghost/roles/ghost-role-component.ftl
Resources/Locale/en-US/interaction/interaction-popup-component.ftl
Resources/Prototypes/Accents/full_replacements.yml
Resources/Prototypes/Entities/Markers/Spawners/mobs.yml
Resources/Prototypes/Entities/Mobs/NPCs/slimes.yml [new file with mode: 0644]
Resources/Prototypes/GameRules/events.yml
Resources/Textures/Mobs/Aliens/slimes.rsi/blue_adult_slime.png [new file with mode: 0644]
Resources/Textures/Mobs/Aliens/slimes.rsi/blue_adult_slime_dead.png [new file with mode: 0644]
Resources/Textures/Mobs/Aliens/slimes.rsi/green_adult_slime.png [new file with mode: 0644]
Resources/Textures/Mobs/Aliens/slimes.rsi/green_adult_slime_dead.png [new file with mode: 0644]
Resources/Textures/Mobs/Aliens/slimes.rsi/meta.json [new file with mode: 0644]
Resources/Textures/Mobs/Aliens/slimes.rsi/yellow_adult_slime.png [new file with mode: 0644]
Resources/Textures/Mobs/Aliens/slimes.rsi/yellow_adult_slime_dead.png [new file with mode: 0644]

diff --git a/Content.Server/StationEvents/Components/SpiderSpawnRuleComponent.cs b/Content.Server/StationEvents/Components/SpiderSpawnRuleComponent.cs
deleted file mode 100644 (file)
index 15e01ac..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-using Content.Server.StationEvents.Events;
-
-namespace Content.Server.StationEvents.Components;
-
-[RegisterComponent, Access(typeof(SpiderSpawnRule))]
-public sealed class SpiderSpawnRuleComponent : Component
-{
-
-}
index 5332796e841ce88e1292217654fbd88c54a74e89..0cb4fc44f56038aa3763614e0b413d4f430b7b4e 100644 (file)
@@ -1,15 +1,11 @@
 using Content.Server.StationEvents.Events;
+using Content.Shared.Storage;
 
 namespace Content.Server.StationEvents.Components;
 
 [RegisterComponent, Access(typeof(VentCrittersRule))]
 public sealed class VentCrittersRuleComponent : Component
 {
-    [DataField("spawnedPrototypeChoices")]
-    public List<string> SpawnedPrototypeChoices = new()
-    {
-        "MobMouse",
-        "MobMouse1",
-        "MobMouse2"
-    };
+    [DataField("entries")]
+    public List<EntitySpawnEntry> Entries = new();
 }
diff --git a/Content.Server/StationEvents/Events/SpiderSpawnRule.cs b/Content.Server/StationEvents/Events/SpiderSpawnRule.cs
deleted file mode 100644 (file)
index ba440f8..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-using Content.Server.StationEvents.Components;
-using System.Linq;
-using Content.Server.GameTicking.Rules.Components;
-
-namespace Content.Server.StationEvents.Events;
-
-public sealed class SpiderSpawnRule : StationEventSystem<SpiderSpawnRuleComponent>
-{
-    protected override void Started(EntityUid uid, SpiderSpawnRuleComponent component, GameRuleComponent gameRule, GameRuleStartedEvent args)
-    {
-        base.Started(uid, component, gameRule, args);
-        var spawnLocations = EntityQuery<VentCritterSpawnLocationComponent>().ToList();
-        RobustRandom.Shuffle(spawnLocations);
-
-        var mod = Math.Sqrt(GetSeverityModifier());
-
-        var spawnAmount = (int) (RobustRandom.Next(4, 8) * mod);
-        Sawmill.Info($"Spawning {spawnAmount} of spiders");
-        foreach (var location in spawnLocations)
-        {
-            if (spawnAmount-- == 0)
-                break;
-
-            var xform = Transform(location.Owner);
-            Spawn("MobGiantSpiderAngry", xform.Coordinates);
-        }
-    }
-}
index 696828838d7b15b6cc90669c342c46957a6d52e4..78188e642b36d4ccf664983cd900c0dbc4b6f1c0 100644 (file)
@@ -7,15 +7,24 @@ namespace Content.Server.StationEvents.Events;
 
 public sealed class VentCrittersRule : StationEventSystem<VentCrittersRuleComponent>
 {
+    /*
+     * DO NOT COPY PASTE THIS TO MAKE YOUR MOB EVENT.
+     * USE THE PROTOTYPE.
+     */
+
     protected override void Started(EntityUid uid, VentCrittersRuleComponent component, GameRuleComponent gameRule, GameRuleStartedEvent args)
     {
         base.Started(uid, component, gameRule, args);
 
-        var spawnChoice = RobustRandom.Pick(component.SpawnedPrototypeChoices);
+        var spawnChoice = RobustRandom.Pick(component.Entries);
+        // TODO: What we should actually do is take the component count and then multiply a prob by that
+        // then just iterate until we get it
+        // This will be on average twice as fast.
         var spawnLocations = EntityManager.EntityQuery<VentCritterSpawnLocationComponent>().ToList();
         RobustRandom.Shuffle(spawnLocations);
 
-        var spawnAmount = RobustRandom.Next(4, 12); // A small colony of critters.
+        // A small colony of critters.
+        var spawnAmount = RobustRandom.Next(spawnChoice.Amount, spawnChoice.MaxAmount);
         Sawmill.Info($"Spawning {spawnAmount} of {spawnChoice}");
         foreach (var location in spawnLocations)
         {
@@ -23,7 +32,7 @@ public sealed class VentCrittersRule : StationEventSystem<VentCrittersRuleCompon
                 break;
 
             var coords = Transform(location.Owner);
-            Spawn(spawnChoice, coords.Coordinates);
+            Spawn(spawnChoice.PrototypeId, coords.Coordinates);
         }
     }
 }
index 14419542ddbb937caf6537c7851bb294b37fd444..c86ce95de9494f9ef5479509aa48e39ed154dc87 100644 (file)
@@ -19,3 +19,9 @@
   license: "CC-BY-SA-3.0"
   copyright: "Made and posted by GentleJester#8754 on the SS14 discord."
   source: "https://discord.com/channels/310555209753690112/311537926376783886/1097222920813674527"
+
+- files:
+  - slime1.ogg
+  license: "CC-BY-SA-3.0"
+  copyright: "Taken from https://github.com/tgstation/tgstation"
+  source: "https://github.com/nero1024/tgstation/blob/83ccc939a20489de8ab81cb47e6f8e84c490adc2/sound/effects/footstep/slime1.ogg"
diff --git a/Resources/Audio/Effects/Footsteps/slime1.ogg b/Resources/Audio/Effects/Footsteps/slime1.ogg
new file mode 100644 (file)
index 0000000..938187d
Binary files /dev/null and b/Resources/Audio/Effects/Footsteps/slime1.ogg differ
index 244310437a5e64f6bd4334981046757687293a79..1331ef4c04856324f3ecb7174d9b1258d174c76a 100644 (file)
@@ -73,3 +73,10 @@ accent-words-kangaroo-1 = Grr!
 accent-words-kangaroo-2 = Hisss!
 accent-words-kangaroo-3 = Shreak!
 accent-words-kangaroo-4 = Chuu!
+
+# Slimes
+accent-words-slimes-1 = Blyump.
+accent-words-slimes-2 = Blimpuf?
+accent-words-slimes-3 = Blump!
+accent-words-slimes-4 = Bluuump...
+accent-words-slimes-5 = Blabl blump!
index 9466d91c5edb1f0f7c13c06e20483e3cf36bb707..9059e9413cf35fe4a43d4addddd597a142ce72ae 100644 (file)
@@ -15,4 +15,7 @@ ghost-role-information-hamster-name = Hamster
 ghost-role-information-hamster-description = A grumpy little ball of fluff.
 
 ghost-role-information-hamlet-name = Hamlet the hamster.
-ghost-role-information-hamlet-description = Lives in the station bridge, has a bit of a temper and is always hungry.
\ No newline at end of file
+ghost-role-information-hamlet-description = Lives in the station bridge, has a bit of a temper and is always hungry.
+
+ghost-role-information-slimes-name = Slime
+ghost-role-information-slimes-description = Everything around you irritates your instincts, destroy them!
index 40ace46de20af0ec69ccbbdd2799d0fbc246ef15..953bd4da67e582226129e80ed72eb97a7d4b8fca 100644 (file)
@@ -24,6 +24,7 @@ petting-success-holo = You pet {THE($target)} on {POSS-ADJ($target)} metallic sp
 petting-success-dragon = Dodging teeth, claws, and flames, you pet {THE($target)} on {POSS-ADJ($target)} massive scaled head.
 petting-success-hamster = You pet {THE($target)} on {POSS-ADJ($target)} fluffy little head.
 petting-success-bear = You reluctantly pet {THE($target)} on {POSS-ADJ($target)} mystical head.
+petting-success-slimes = You pet {THE($target)} on {POSS-ADJ($target)} mucous surface.
 
 petting-failure-generic = You reach out to pet {THE($target)}, but {SUBJECT($target)} {CONJUGATE-BE($target)} aloof towards you.
 
index 659c2aab8970056c2770cec1bbb7723b60e5c67c..bbf6fc6999e7aae24d034d38a259a810387fcfbb 100644 (file)
   - accent-words-kangaroo-2
   - accent-words-kangaroo-3
   - accent-words-kangaroo-4
+
+- type: accent
+  id: slimes
+  fullReplacements:
+  - accent-words-slimes-1
+  - accent-words-slimes-2
+  - accent-words-slimes-3
+  - accent-words-slimes-4
+  - accent-words-slimes-5
index 53e1aa0fcc5d0e0522c73756ef2f2c8f9b8f297d..8d9a4225e978b1306eea375a9e28b464de04af03 100644 (file)
   - type: ConditionalSpawner
     prototypes:
     - MobBoxingKangaroo
-
+  
 - type: entity
   name: Space Spider Spawner
   id: SpawnMobSpaceSpider
   - type: ConditionalSpawner
     prototypes:
     - MobSpiderSpace
+
+- type: entity
+  name: Slimes Spawner Blue Good
+  id: SpawnMobAdultSlimesBlue
+  parent: MarkerBase
+  components:
+  - type: Sprite
+    layers:
+      - state: green
+      - state: ai
+  - type: ConditionalSpawner
+    prototypes:
+      - MobAdultSlimesBlueGood
+
+- type: entity
+  name: Slimes Spawner Blue Angry
+  id: SpawnMobAdultSlimesBlueAngry
+  parent: MarkerBase
+  components:
+  - type: Sprite
+    layers:
+      - state: green
+      - state: ai
+  - type: ConditionalSpawner
+    prototypes:
+      - MobAdultSlimesBlueAngry
+
+- type: entity
+  name: Slimes Spawner Green Good
+  id: SpawnMobAdultSlimesGreen
+  parent: MarkerBase
+  components:
+  - type: Sprite
+    layers:
+      - state: green
+      - state: ai
+  - type: ConditionalSpawner
+    prototypes:
+      - MobAdultSlimesGreenGood
+
+- type: entity
+  name: Slimes Spawner Green Angry
+  id: SpawnMobAdultSlimesGreenAngry
+  parent: MarkerBase
+  components:
+  - type: Sprite
+    layers:
+      - state: green
+      - state: ai
+  - type: ConditionalSpawner
+    prototypes:
+      - MobAdultSlimesGreenAngry
+
+- type: entity
+  name: Slimes Spawner Yellow Good
+  id: SpawnMobAdultSlimesYellow
+  parent: MarkerBase
+  components:
+  - type: Sprite
+    layers:
+      - state: green
+      - state: ai
+  - type: ConditionalSpawner
+    prototypes:
+      - MobAdultSlimesYellowGood
+
+- type: entity
+  name: Slimes Spawner Yellow Angry
+  id: SpawnMobAdultSlimesYellowAngry
+  parent: MarkerBase
+  components:
+  - type: Sprite
+    layers:
+      - state: green
+      - state: ai
+  - type: ConditionalSpawner
+    prototypes:
+      - MobAdultSlimesYellowAngry
diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/slimes.yml b/Resources/Prototypes/Entities/Mobs/NPCs/slimes.yml
new file mode 100644 (file)
index 0000000..91c7b75
--- /dev/null
@@ -0,0 +1,247 @@
+- type: entity
+  name: basic slime
+  id: MobAdultSlimes
+  parent: SimpleMobBase
+  abstract: true
+  description: It looks so much like jelly. I wonder what it tastes like?
+  suffix: Good
+  components:
+  - type: Faction
+    factions:
+    - SimpleNeutral
+  - type: HTN
+    rootTask: SimpleHostileCompound
+  - type: Sprite
+    drawdepth: Mobs
+    netsync: false
+    sprite: Mobs/Aliens/slimes.rsi
+    layers:
+    - map: [ "enum.DamageStateVisualLayers.Base" ]
+      state: blue_adult_slime
+  - type: Fixtures
+    fixtures:
+    - shape:
+        !type:PhysShapeCircle
+        radius: 0.30
+      density: 80
+      mask:
+      - MobMask
+      layer:
+      - MobLayer
+  - type: MobThresholds
+    thresholds:
+      0: Alive
+      120: Dead
+  - type: MovementSpeedModifier
+    baseWalkSpeed: 2
+    baseSprintSpeed: 4
+  - type: FootstepModifier
+    footstepSoundCollection:
+      path: /Audio/Effects/Footsteps/slime1.ogg
+  - type: Tag
+    tags:
+    - FootstepSound
+  - type: Butcherable
+    butcheringType: Knife
+    spawned:
+    - id: FoodMeatSlime
+      amount: 2
+  - type: Respirator
+    damage:
+      types:
+        Asphyxiation: 0.2
+    damageRecovery:
+      types:
+        Asphyxiation: -1.0
+    maxSaturation: 15
+  - type: Damageable
+    damageContainer: Biological
+    damageModifierSet: Slime
+  - type: Bloodstream
+    bloodReagent: Slime
+    bloodlossDamage:
+      types:
+        Bloodloss:
+          1
+    bloodlossHealDamage:
+      types:
+        Bloodloss:
+          -0.25
+  - type: Barotrauma
+    damage:
+      types:
+        Blunt: 0.45
+  - type: Reactive
+    groups:
+      Flammable: [ Touch ]
+      Extinguish: [ Touch ]
+    reactions:
+    - reagents: [ Water, SpaceCleaner ]
+      methods: [ Touch ]
+      effects:
+      - !type:WashCreamPieReaction
+    - reagents: [ Water ]
+      methods: [ Touch ]
+      effects:
+      - !type:HealthChange
+        scaled: true
+        damage:
+          types:
+            Heat: 3
+      - !type:PopupMessage
+        type: Local
+        messages: [ "slime-hurt-by-water-popup" ]
+        probability: 0.25
+  - type: CombatMode
+  - type: MeleeWeapon
+    hidden: true
+    soundHit:
+        path: /Audio/Weapons/punch3.ogg
+    angle: 0
+    animation: WeaponArcPunch
+    damage:
+      types:
+        Blunt: 6
+        Structural: 4
+        Caustic: 4
+  - type: InteractionPopup
+    successChance: 0.5
+    interactSuccessString: petting-success-slimes
+    interactFailureString: petting-failure-generic
+  - type: ReplacementAccent
+    accent: slimes
+  - type: GhostTakeoverAvailable
+    makeSentient: true
+    name: ghost-role-information-slimes-name
+    description: ghost-role-information-slimes-description
+
+- type: entity
+  name: blue slime
+  id: MobAdultSlimesBlueGood
+  parent: MobAdultSlimes
+  suffix: Good
+  components:
+  - type: DamageStateVisuals
+    states:
+      Alive:
+        Base: blue_adult_slime
+      Dead:
+        Base: blue_adult_slime_dead
+
+- type: entity
+  name: blue slime
+  parent: MobAdultSlimes
+  id: MobAdultSlimesBlueAngry
+  suffix: Angry
+  components:
+    - type: Faction
+      factions:
+        - SimpleHostile
+    - type: DamageStateVisuals
+      states:
+        Alive:
+          Base: blue_adult_slime
+        Dead:
+          Base: blue_adult_slime_dead
+
+- type: entity
+  name: green slime
+  parent: MobAdultSlimes
+  id: MobAdultSlimesGreenGood
+  suffix: Good
+  components:
+    - type: Sprite
+      layers:
+      - map: [ "enum.DamageStateVisualLayers.Base" ]
+        state: green_adult_slime
+    - type: DamageStateVisuals
+      states:
+        Alive:
+          Base: green_adult_slime
+        Dead:
+          Base: green_adult_slime_dead
+    - type: MeleeWeapon
+      damage:
+        types:
+          Blunt: 6
+          Structural: 4
+          Caustic: 1
+          Poison: 4
+
+- type: entity
+  name: green slime
+  parent: MobAdultSlimes
+  id: MobAdultSlimesGreenAngry
+  suffix: Angry
+  components:
+    - type: Faction
+      factions:
+        - SimpleHostile
+    - type: Sprite
+      layers:
+      - map: [ "enum.DamageStateVisualLayers.Base" ]
+        state: green_adult_slime
+    - type: DamageStateVisuals
+      states:
+        Alive:
+          Base: green_adult_slime
+        Dead:
+          Base: green_adult_slime_dead
+    - type: MeleeWeapon
+      damage:
+        types:
+          Blunt: 6
+          Structural: 4
+          Caustic: 1
+          Poison: 4
+
+- type: entity
+  name: yellow slime
+  parent: MobAdultSlimes
+  id: MobAdultSlimesYellowGood
+  suffix: Good
+  components:
+    - type: Sprite
+      layers:
+      - map: [ "enum.DamageStateVisualLayers.Base" ]
+        state: yellow_adult_slime
+    - type: DamageStateVisuals
+      states:
+        Alive:
+          Base: yellow_adult_slime
+        Dead:
+          Base: yellow_adult_slime_dead
+    - type: MeleeWeapon
+      damage:
+        types:
+          Blunt: 6
+          Structural: 4
+          Caustic: 1
+          Cellular: 3
+
+- type: entity
+  name: yellow slime
+  parent: MobAdultSlimes
+  id: MobAdultSlimesYellowAngry
+  suffix: Angry
+  components:
+    - type: Faction
+      factions:
+        - SimpleHostile
+    - type: Sprite
+      layers:
+      - map: [ "enum.DamageStateVisualLayers.Base" ]
+        state: yellow_adult_slime
+    - type: DamageStateVisuals
+      states:
+        Alive:
+          Base: yellow_adult_slime
+        Dead:
+          Base: yellow_adult_slime_dead
+    - type: MeleeWeapon
+      damage:
+        types:
+          Blunt: 6
+          Structural: 4
+          Caustic: 1
+          Cellular: 3
index 516241becf554b27e11e30aa94662bd871b402fb..6d9f4a7fb096261a0a0ff4ed6ded2a5bc8187cb9 100644 (file)
     weight: 5
     duration: 60
   - type: VentCrittersRule
+    entries:
+    - id: MobMouse
+      amount: 4
+      maxAmount: 12
+    - id: MobMouse1
+      amount: 4
+      maxAmount: 12
+    - id: MobMouse2
+      amount: 4
+      maxAmount: 12
+
+- type: entity
+  id: SlimesSpawn
+  parent: BaseGameRule
+  noSpawn: true
+  components:
+  - type: StationEvent
+    earliestStart: 20
+    minimumPlayers: 15
+    weight: 5
+    duration: 60
+  - type: VentCrittersRule
+    entries:
+      - id: MobAdultSlimesBlueAngry
+        amount: 6
+        maxAmount: 10
+      - id: MobAdultSlimesGreenAngry
+        amount: 6
+        maxAmount: 10
+      - id: MobAdultSlimesYellowAngry
+        amount: 6
+        maxAmount: 10
 
 - type: entity
   id: SpiderSpawn
     minimumPlayers: 15
     weight: 5
     duration: 60
-  - type: SpiderSpawnRule
+  - type: VentCrittersRule
+    entries:
+      - id: MobGiantSpiderAngry
+        amount: 4
+        maxAmount: 8
 
 - type: entity
   id: ZombieOutbreak
diff --git a/Resources/Textures/Mobs/Aliens/slimes.rsi/blue_adult_slime.png b/Resources/Textures/Mobs/Aliens/slimes.rsi/blue_adult_slime.png
new file mode 100644 (file)
index 0000000..15899ce
Binary files /dev/null and b/Resources/Textures/Mobs/Aliens/slimes.rsi/blue_adult_slime.png differ
diff --git a/Resources/Textures/Mobs/Aliens/slimes.rsi/blue_adult_slime_dead.png b/Resources/Textures/Mobs/Aliens/slimes.rsi/blue_adult_slime_dead.png
new file mode 100644 (file)
index 0000000..c1dc616
Binary files /dev/null and b/Resources/Textures/Mobs/Aliens/slimes.rsi/blue_adult_slime_dead.png differ
diff --git a/Resources/Textures/Mobs/Aliens/slimes.rsi/green_adult_slime.png b/Resources/Textures/Mobs/Aliens/slimes.rsi/green_adult_slime.png
new file mode 100644 (file)
index 0000000..d2dbe52
Binary files /dev/null and b/Resources/Textures/Mobs/Aliens/slimes.rsi/green_adult_slime.png differ
diff --git a/Resources/Textures/Mobs/Aliens/slimes.rsi/green_adult_slime_dead.png b/Resources/Textures/Mobs/Aliens/slimes.rsi/green_adult_slime_dead.png
new file mode 100644 (file)
index 0000000..dbacc8f
Binary files /dev/null and b/Resources/Textures/Mobs/Aliens/slimes.rsi/green_adult_slime_dead.png differ
diff --git a/Resources/Textures/Mobs/Aliens/slimes.rsi/meta.json b/Resources/Textures/Mobs/Aliens/slimes.rsi/meta.json
new file mode 100644 (file)
index 0000000..5371dab
--- /dev/null
@@ -0,0 +1,47 @@
+{
+  "version": 1,
+  "license": "CC-BY-SA-3.0",
+  "copyright": "Taken from the tgstation at https://github.com/tgstation/tgstation/blob/bb89e65aebb14d6ba0ce7fc43363fbc3f1279e79/icons/mob/simple/slimes.dmi",
+  "size": {
+    "x": 32,
+    "y": 32
+  },
+  "states": [
+    {
+      "name": "blue_adult_slime",
+      "delays": [
+        [
+          0.3,
+          0.3
+        ]
+      ]
+    },
+    {
+      "name": "blue_adult_slime_dead"
+    },
+    {
+      "name": "green_adult_slime",
+      "delays": [
+        [
+          0.3,
+          0.3
+        ]
+      ]
+    },
+    {
+      "name": "green_adult_slime_dead"
+    },
+    {
+      "name": "yellow_adult_slime",
+      "delays": [
+        [
+          0.3,
+          0.3
+        ]
+      ]
+       },
+       {
+      "name": "yellow_adult_slime_dead"
+    }
+  ]
+}
diff --git a/Resources/Textures/Mobs/Aliens/slimes.rsi/yellow_adult_slime.png b/Resources/Textures/Mobs/Aliens/slimes.rsi/yellow_adult_slime.png
new file mode 100644 (file)
index 0000000..bb8adb3
Binary files /dev/null and b/Resources/Textures/Mobs/Aliens/slimes.rsi/yellow_adult_slime.png differ
diff --git a/Resources/Textures/Mobs/Aliens/slimes.rsi/yellow_adult_slime_dead.png b/Resources/Textures/Mobs/Aliens/slimes.rsi/yellow_adult_slime_dead.png
new file mode 100644 (file)
index 0000000..30a833c
Binary files /dev/null and b/Resources/Textures/Mobs/Aliens/slimes.rsi/yellow_adult_slime_dead.png differ