]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Add Snails (#30765)
authorIProduceWidgets <107586145+IProduceWidgets@users.noreply.github.com>
Tue, 3 Sep 2024 10:33:44 +0000 (06:33 -0400)
committerGitHub <noreply@github.com>
Tue, 3 Sep 2024 10:33:44 +0000 (12:33 +0200)
* add snails

* scuffix

* migrate

* mo-grate

* oopsied the ftls

* Revert "oopsied the ftls"

This reverts commit 0d3c6c17f31ec904679d6a48799cea71e77c1f99.

* the curse of staging the wrong file, resolved.

* Snoth

* fix my dumbs

* reviews 1

* anti space technology

* salt hurty

* spelling

* Its a slotherhouse out here

* sequencing

* cooked snail

* volfix

* speed reversal

21 files changed:
Content.Shared/Mobs/Systems/MobStateActionsSystem.cs
Resources/Locale/en-US/ghost/roles/ghost-role-component.ftl
Resources/Locale/en-US/nutrition/components/food-sequence.ftl
Resources/Locale/en-US/species/species.ftl
Resources/Prototypes/Entities/Mobs/NPCs/space.yml
Resources/Prototypes/Entities/Objects/Consumable/Food/meat.yml
Resources/Prototypes/Entities/Objects/Consumable/Food/soup.yml
Resources/Prototypes/GameRules/events.yml
Resources/Prototypes/Recipes/Cooking/meal_recipes.yml
Resources/Textures/Mobs/Animals/snail.rsi/dead.png [new file with mode: 0644]
Resources/Textures/Mobs/Animals/snail.rsi/meta.json [new file with mode: 0644]
Resources/Textures/Mobs/Animals/snail.rsi/snail.png [new file with mode: 0644]
Resources/Textures/Mobs/Animals/snail.rsi/snoth.png [new file with mode: 0644]
Resources/Textures/Mobs/Animals/snail.rsi/snothdead.png [new file with mode: 0644]
Resources/Textures/Mobs/Animals/snail.rsi/spacedead.png [new file with mode: 0644]
Resources/Textures/Mobs/Animals/snail.rsi/spacesnail.png [new file with mode: 0644]
Resources/Textures/Objects/Consumable/Food/bowl.rsi/escargot.png [new file with mode: 0644]
Resources/Textures/Objects/Consumable/Food/bowl.rsi/meta.json
Resources/Textures/Objects/Consumable/Food/meat.rsi/meta.json
Resources/Textures/Objects/Consumable/Food/meat.rsi/snail-cooked.png [new file with mode: 0644]
Resources/Textures/Objects/Consumable/Food/meat.rsi/snail.png [new file with mode: 0644]

index 5e631719864140cb3350400f9f050da933eb70d8..9419daf348151643f9e30a7a797aef717bfe8f56 100644 (file)
@@ -1,4 +1,4 @@
-using Content.Shared.Actions;
+using Content.Shared.Actions;
 using Content.Shared.Mobs.Components;
 
 namespace Content.Shared.Mobs.Systems;
@@ -14,9 +14,26 @@ public sealed class MobStateActionsSystem : EntitySystem
     public override void Initialize()
     {
         SubscribeLocalEvent<MobStateActionsComponent, MobStateChangedEvent>(OnMobStateChanged);
+        SubscribeLocalEvent<MobStateComponent, ComponentInit>(OnMobStateComponentInit);
     }
 
     private void OnMobStateChanged(EntityUid uid, MobStateActionsComponent component, MobStateChangedEvent args)
+    {
+        ComposeActions(uid, component, args.NewMobState);
+    }
+
+    private void OnMobStateComponentInit(EntityUid uid, MobStateComponent component, ComponentInit args)
+    {
+        if (!TryComp<MobStateActionsComponent>(uid, out var mobStateActionsComp))
+            return;
+
+        ComposeActions(uid, mobStateActionsComp, component.CurrentState);
+    }
+
+    /// <summary>
+    /// Adds or removes actions from a mob based on mobstate.
+    /// </summary>
+    private void ComposeActions(EntityUid uid, MobStateActionsComponent component, MobState newMobState)
     {
         if (!TryComp<ActionsComponent>(uid, out var action))
             return;
@@ -27,7 +44,7 @@ public sealed class MobStateActionsSystem : EntitySystem
         }
         component.GrantedActions.Clear();
 
-        if (!component.Actions.TryGetValue(args.NewMobState, out var toGrant))
+        if (!component.Actions.TryGetValue(newMobState, out var toGrant))
             return;
 
         foreach (var id in toGrant)
index 79b98691b879768c7b8fb4b5e5ef3b156d86f1d3..bb816ba29786be0104ce3de5a6ec60bc1eb911bd 100644 (file)
@@ -30,6 +30,15 @@ ghost-role-information-mouse-description = A hungry and mischievous mouse.
 ghost-role-information-mothroach-name = Mothroach
 ghost-role-information-mothroach-description = A cute but mischievous mothroach.
 
+ghost-role-information-snail-name = Snail
+ghost-role-information-snail-description = A little snail who doesn't mind a bit of space. Just stay on grid!
+
+ghost-role-information-snailspeed-name = Snail
+ghost-role-information-snailspeed-description = A little snail with snailborn thrusters.
+
+ghost-role-information-snoth-name = Snoth
+ghost-role-information-snoth-description = A little snoth who doesn't mind a bit of space. Just stay on grid!
+
 ghost-role-information-giant-spider-name = Giant spider
 ghost-role-information-giant-spider-description = This station's inhabitants look mighty tasty, and your sticky web is perfect to catch them!
 ghost-role-information-giant-spider-rules = You are a [color=red][bold]Team Antagonist[/bold][/color] with all other giant spiders.
index 672b0a0e7adddb0a58dfb187c46ffb981751d330..36ce47d5cf5c03078ad24b313c0224fc6ce9292a 100644 (file)
@@ -73,6 +73,7 @@ food-sequence-content-capfruit = capfruit
 food-sequence-content-berries = berries
 food-sequence-content-spacemans-trumpet = spacemans trupmet
 food-sequence-content-cherry = cherry
+food-sequence-content-snail = snail
 
 # BURGERS
 
index f31b1fa0f00d71d9148b6f50155ae80c13262c95..bb5c3a67ac5eed439b062bf537c5230794d05e4d 100644 (file)
@@ -9,3 +9,7 @@ species-name-arachnid = Arachnid
 species-name-moth = Moth Person
 species-name-skeleton = Skeleton
 species-name-vox = Vox
+
+## Misc species things
+
+snail-hurt-by-salt-popup = The salty solution burns like acid!
\ No newline at end of file
index 91f5e952e92087b477bd98e5199ea265792d7b7d..493449e3f33bc0ea7f7b812c7c560fb26599f0ec 100644 (file)
   suffix: "Salvage Ruleset"
   components:
     - type: SalvageMobRestrictions
+
+- type: entity
+  parent: SimpleSpaceMobBase
+  id: MobSnail
+  name: snail
+  description: Revolting unless you're french.
+  components:
+  - type: Body
+    prototype: Mouse
+  - type: GhostRole
+    makeSentient: true
+    allowSpeech: false
+    allowMovement: true
+    name: ghost-role-information-snail-name
+    description: ghost-role-information-snail-description
+    rules: ghost-role-information-freeagent-rules
+  - type: GhostTakeoverAvailable
+  - type: Sprite
+    drawdepth: SmallMobs
+    sprite: Mobs/Animals/snail.rsi
+    layers:
+    - map: ["enum.DamageStateVisualLayers.Base"]
+      state: snail
+  - type: Item
+    size: Tiny
+  - type: NpcFactionMember
+    factions:
+      - Mouse
+  - type: HTN
+    rootTask:
+      task: MouseCompound
+  - type: Physics
+  - type: Fixtures
+    fixtures:
+      fix1:
+        shape:
+          !type:PhysShapeCircle
+          radius: 0.2
+        density: 100
+        mask:
+        - SmallMobMask
+        layer:
+        - SmallMobLayer
+  - type: MobState
+  - type: Deathgasp
+  - type: MobStateActions
+    actions:
+      Critical:
+      - ActionCritSuccumb
+      - ActionCritFakeDeath
+      - ActionCritLastWords
+  - type: MobThresholds
+    thresholds:
+      0: Alive
+      10: Critical
+      20: Dead
+  - type: MovementSpeedModifier
+    baseWalkSpeed : 2
+    baseSprintSpeed : 3
+  - type: DamageStateVisuals
+    states:
+      Alive:
+        Base: snail
+      Critical:
+        Base: dead
+      Dead:
+        Base: dead
+  - type: Food
+  - type: Thirst
+    startingThirst: 25  # spawn with Okay thirst state
+    thresholds:
+      OverHydrated: 35
+      Okay: 25
+      Thirsty: 15
+      Parched: 10
+      Dead: 0
+    baseDecayRate: 0.04
+  - type: Hunger
+    currentHunger: 25   # spawn with Okay hunger state
+    thresholds:
+      Overfed: 35
+      Okay: 25
+      Peckish: 15
+      Starving: 10
+      Dead: 0
+    baseDecayRate: 0.1
+  - type: Extractable
+    grindableSolutionName: food
+  - type: SolutionContainerManager
+    solutions:
+      food:
+        reagents:
+        - ReagentId: UncookedAnimalProteins
+          Quantity: 3
+  - type: Butcherable
+    spawned:
+    - id: FoodMeatSnail
+      amount: 1
+  - type: Tag
+    tags:
+    - Trash
+    - VimPilot
+    - ChefPilot
+    - Meat
+  - type: CombatMode
+    combatToggleAction: ActionCombatModeToggleOff
+  - type: Bloodstream
+    bloodMaxVolume: 30
+    bloodReagent: Cryoxadone
+  - type: CanEscapeInventory
+  - type: MobPrice
+    price: 50
+  - type: BadFood
+  - type: NonSpreaderZombie
+  - type: PreventSpiller
+  - type: FireVisuals
+    sprite: Mobs/Effects/onfire.rsi
+    normalState: Mouse_burning
+  - type: Temperature
+    heatDamageThreshold: 500
+    coldDamageThreshold: 0
+  - type: Reactive
+    reactions:
+    - reagents: [TableSalt, Saline]
+      methods: [Touch, Ingestion, Injection]
+      effects:
+      - !type:HealthChange
+        scaleByQuantity: true
+        damage:
+          types:
+            Caustic: 1
+      - !type:PopupMessage
+        type: Local
+        visualType: Large
+        messages: [ "snail-hurt-by-salt-popup" ]
+        probability: 0.66
+    
+- type: entity
+  parent: MobSnail
+  id: MobSnailInstantDeath
+  suffix: Smite
+  components:
+  - type: MobStateActions
+    actions:
+      Alive:
+      - ActionSmite
+      Critical:
+      - ActionCritSuccumb
+      - ActionCritFakeDeath
+      - ActionCritLastWords
+  - type: Godmode
+  - type: MovementAlwaysTouching
+
+- type: entity
+  parent: MobSnail
+  id: MobSnailSpeed
+  suffix: Speed
+  components:
+  - type: GhostRole
+    name: ghost-role-information-snailspeed-name
+    description: ghost-role-information-snailspeed-description
+    rules: ghost-role-information-freeagent-rules
+  - type: Sprite
+    layers:
+    - map: ["enum.DamageStateVisualLayers.Base"]
+      state: spacesnail
+  - type: DamageStateVisuals
+    states:
+      Alive:
+        Base: spacesnail
+      Critical:
+        Base: spacesnaildead
+      Dead:
+        Base: spacesnaildead
+  - type: MovementSpeedModifier
+    baseWalkSpeed : 5 #he go fast, also they cant slip so its probably fine.
+    baseSprintSpeed : 7
+#  - type: ActiveJetpack # I think this will need a custom component to not make tests angry.
+  - type: MovementAlwaysTouching
+
+- type: entity
+  parent: MobSnail
+  id: MobSnailMoth
+  name: Snoth
+  components:
+  - type: Body
+    prototype: Mothroach
+  - type: GhostRole
+    name: ghost-role-information-snoth-name
+    description: ghost-role-information-snoth-description
+    rules: ghost-role-information-freeagent-rules
+  - type: Sprite
+    layers:
+    - map: ["enum.DamageStateVisualLayers.Base"]
+      state: snoth
+  - type: DamageStateVisuals
+    states:
+      Alive:
+        Base: snoth
+      Critical:
+        Base: snothdead
+      Dead:
+        Base: snothdead
index 22ebbda7c9f0e6545489693ddcf00dda744b15b4..53fbf62399f4e1dccab7140fde388d96d7b0f32d 100644 (file)
       taco:
         name: food-sequence-content-slime
 
+- type: entity
+  name: raw snail meat
+  parent: FoodMeatRawBase
+  id: FoodMeatSnail
+  description: Improved with salt.
+  components:
+  - type: Sprite
+    state: snail
+  - type: FoodSequenceElement
+    sprite:
+      sprite: Objects/Consumable/Food/meat.rsi
+      state: snail
+    entries:
+      burger:
+        name: food-sequence-content-snail
+      taco:
+        name: food-sequence-content-snail
+  - type: SolutionContainerManager
+    solutions:
+      food:
+        maxVol: 15
+        reagents:
+        - ReagentId: UncookedAnimalProteins
+          Quantity: 3
+        - ReagentId: Fat
+          Quantity: 3
+        - ReagentId: Water
+          Quantity: 4 #It makes saline if you add salt!
+
 # Cooked
 
 - type: entity
           sprite: Objects/Consumable/Food/skewer.rsi
           state: skewer-meat
 
+- type: entity
+  name: boiled snail
+  parent: FoodMeatBase
+  id: FoodMeatSnailCooked
+  description: Improved with salt.
+  components:
+  - type: Tag
+    tags:
+    - Cooked
+    - Meat
+  - type: Sprite
+    layers:
+    - state: snail-cooked
+  - type: FoodSequenceElement
+    sprite:
+      sprite: Objects/Consumable/Food/meat.rsi
+      state: snail-cooked
+    entries:
+      burger:
+        name: food-sequence-content-snail
+      taco:
+        name: food-sequence-content-snail
+  - type: SolutionContainerManager
+    solutions:
+      food:
+        maxVol: 15
+        reagents:
+        - ReagentId: Nutriment
+          Quantity: 3
+        - ReagentId: Protein
+          Quantity: 3
+        - ReagentId: Water
+          Quantity: 4 # makes saline if you add salt!
+
 # Cutlets
 
 # Raw
index 5c2a87c2b11db4fe50e92298f1ed59bb9e805bf1..d5cb4311c4678a4bdc75a6784ffd04ab226a7a67 100644 (file)
     - Fruit
     - Soup
 # Tastes like bungo, hot curry.
+
+- type: entity
+  name: escargot
+  parent: FoodBowlBase
+  id: FoodSoupEscargot
+  description: A creamy and rich bowl of snails, bon appetit!
+  components:
+  - type: FlavorProfile
+    flavors:
+      - creamy
+      - slimy
+  - type: Sprite
+    layers:
+    - state: bowl
+    - state: escargot
+  - type: SolutionContainerManager
+    solutions:
+      food:
+        maxVol: 20
+        reagents:
+          - ReagentId: Nutriment
+            Quantity: 6
+          - ReagentId: Vitamin
+            Quantity: 6
+          - ReagentId: Allicin
+            Quantity: 3
+  - type: Tag
+    tags:
+    - Meat
+    - Soup
index 56ffeda7f035c3c8b546bfd374c0567ed2010f1b..901fd299e8c7b828dfe98508f1ba56f690d725f2 100644 (file)
     - id: MobMothroach
       prob: 0.008
 
+- type: entity
+  id: SnailMigrationLowPop
+  parent: BaseStationEventShortDelay
+  components:
+  - type: StationEvent
+    startAnnouncement: station-event-vent-creatures-start-announcement
+    startAudio:
+      path: /Audio/Announcements/attention.ogg
+    weight: 6
+    duration: 50
+  - type: VentCrittersRule
+    entries:
+    - id: MobSnail
+      prob: 0.02
+    - id: MobSnailSpeed
+      prob: 0.002
+    - id: MobSnailMoth
+      prob: 0.002
+
+- type: entity
+  id: SnailMigration
+  parent: BaseStationEventShortDelay
+  components:
+  - type: StationEvent
+    startAnnouncement: station-event-vent-creatures-start-announcement
+    startAudio:
+      path: /Audio/Announcements/attention.ogg
+    earliestStart: 15
+    weight: 6
+    duration: 50
+    minimumPlayers: 30
+  - type: VentCrittersRule
+    entries:
+    - id: MobSnail
+      prob: 0.02
+    - id: MobSnailSpeed
+      prob: 0.002
+    - id: MobSnailMoth
+      prob: 0.002
+    - id: MobSnailInstantDeath
+      prob: 0.00001 #  ~ 1:2000 snails
+
 - type: entity
   id: PowerGridCheck
   parent: BaseStationEventShortDelay
index bf39e1487bb7942063df96cdcce7247ec258e25f..fb1280daffab1ebbede4fab68113f1dfdc1a583e 100644 (file)
     FoodBungo: 2
     FoodChiliPepper: 1
 
+- type: microwaveMealRecipe
+  id: RecipeBoiledSnail
+  name: boiled snail recipe
+  result: FoodMeatSnailCooked
+  time: 5
+  reagents:
+    Water: 10
+  solids:
+    FoodMeatSnail: 1
+
+- type: microwaveMealRecipe
+  id: RecipeEscargotSoup
+  name: escargot recipe
+  result: FoodSoupEscargot
+  time: 10
+  reagents:
+    Water: 5
+  solids:
+    FoodBowlBig: 1
+    FoodOnionSlice: 1
+    FoodButter: 1
+    FoodMeatSnailCooked: 1
+
 #Pies
 
 - type: microwaveMealRecipe
diff --git a/Resources/Textures/Mobs/Animals/snail.rsi/dead.png b/Resources/Textures/Mobs/Animals/snail.rsi/dead.png
new file mode 100644 (file)
index 0000000..bdaecda
Binary files /dev/null and b/Resources/Textures/Mobs/Animals/snail.rsi/dead.png differ
diff --git a/Resources/Textures/Mobs/Animals/snail.rsi/meta.json b/Resources/Textures/Mobs/Animals/snail.rsi/meta.json
new file mode 100644 (file)
index 0000000..ca42ca9
--- /dev/null
@@ -0,0 +1,32 @@
+{
+  "version": 1,
+  "license": "CC-BY-SA-3.0",
+  "copyright": "Created by Kezu (discord) & IProduceWidgets (github)",
+  "size": {
+    "x": 32,
+    "y": 32
+  },
+  "states": [
+    {
+      "name": "snail",
+      "directions": 4
+    },
+    {
+      "name": "dead"
+    },
+       {
+      "name": "spacesnail",
+      "directions": 4
+    },
+    {
+      "name": "spacedead"
+    },
+    {
+      "name": "snoth",
+      "directions": 4
+    },
+    {
+      "name": "snothdead"
+    }
+  ]
+}
\ No newline at end of file
diff --git a/Resources/Textures/Mobs/Animals/snail.rsi/snail.png b/Resources/Textures/Mobs/Animals/snail.rsi/snail.png
new file mode 100644 (file)
index 0000000..26d112c
Binary files /dev/null and b/Resources/Textures/Mobs/Animals/snail.rsi/snail.png differ
diff --git a/Resources/Textures/Mobs/Animals/snail.rsi/snoth.png b/Resources/Textures/Mobs/Animals/snail.rsi/snoth.png
new file mode 100644 (file)
index 0000000..5e634d1
Binary files /dev/null and b/Resources/Textures/Mobs/Animals/snail.rsi/snoth.png differ
diff --git a/Resources/Textures/Mobs/Animals/snail.rsi/snothdead.png b/Resources/Textures/Mobs/Animals/snail.rsi/snothdead.png
new file mode 100644 (file)
index 0000000..7296239
Binary files /dev/null and b/Resources/Textures/Mobs/Animals/snail.rsi/snothdead.png differ
diff --git a/Resources/Textures/Mobs/Animals/snail.rsi/spacedead.png b/Resources/Textures/Mobs/Animals/snail.rsi/spacedead.png
new file mode 100644 (file)
index 0000000..37cbde9
Binary files /dev/null and b/Resources/Textures/Mobs/Animals/snail.rsi/spacedead.png differ
diff --git a/Resources/Textures/Mobs/Animals/snail.rsi/spacesnail.png b/Resources/Textures/Mobs/Animals/snail.rsi/spacesnail.png
new file mode 100644 (file)
index 0000000..3a2d97c
Binary files /dev/null and b/Resources/Textures/Mobs/Animals/snail.rsi/spacesnail.png differ
diff --git a/Resources/Textures/Objects/Consumable/Food/bowl.rsi/escargot.png b/Resources/Textures/Objects/Consumable/Food/bowl.rsi/escargot.png
new file mode 100644 (file)
index 0000000..2ae8f5a
Binary files /dev/null and b/Resources/Textures/Objects/Consumable/Food/bowl.rsi/escargot.png differ
index 8e2c4444fc4b48f59744ae3e0cf14fea3b36cdb0..d6c3ed7676616410a7d07bf4acdabba2b26f3468 100644 (file)
@@ -1,7 +1,7 @@
 {
   "version": 1,
   "license": "CC-BY-SA-3.0",
-  "copyright": "Taken from tgstation and modified by Swept at https://github.com/tgstation/tgstation/commit/40d75cc340c63582fb66ce15bf75a36115f6bdaa. Fills created by potato1234_x",
+  "copyright": "Taken from tgstation and modified by Swept at https://github.com/tgstation/tgstation/commit/40d75cc340c63582fb66ce15bf75a36115f6bdaa. escargot from tgstation at https://github.com/tgstation/tgstation/commit/7ffd61b6fa6a6183daa8900f9a490f46f7a81955. Fills created by potato1234_x",
   "size": {
     "x": 32,
     "y": 32
@@ -66,6 +66,9 @@
           0.1
         ]
       ]
+    },
+       {
+      "name": "escargot"
     },
     {
       "name": "eyeball"
index 824d3b968123cc14ad956990cb1bec988c7df1d5..4ad75849d1af7635b0b1c8e7070ce4696833162b 100644 (file)
@@ -1,7 +1,7 @@
 {
   "version": 1,
   "license": "CC-BY-SA-3.0",
-  "copyright": "Taken from tgstation and modified by Swept, potato1234x and deltanedas at https://github.com/tgstation/tgstation/commit/40d75cc340c63582fb66ce15bf75a36115f6bdaa",
+  "copyright": "Taken from tgstation and modified by Swept, potato1234x and deltanedas at https://github.com/tgstation/tgstation/commit/40d75cc340c63582fb66ce15bf75a36115f6bdaa, snail by IproduceWidgets (github) and Kezu (discord)",
   "size": {
     "x": 32,
     "y": 32
     },
     {
       "name": "slime"
+    },
+       {
+      "name": "snail"
+    },
+       {
+      "name": "snail-cooked"
     },
     {
       "name": "snake"
diff --git a/Resources/Textures/Objects/Consumable/Food/meat.rsi/snail-cooked.png b/Resources/Textures/Objects/Consumable/Food/meat.rsi/snail-cooked.png
new file mode 100644 (file)
index 0000000..81d8f43
Binary files /dev/null and b/Resources/Textures/Objects/Consumable/Food/meat.rsi/snail-cooked.png differ
diff --git a/Resources/Textures/Objects/Consumable/Food/meat.rsi/snail.png b/Resources/Textures/Objects/Consumable/Food/meat.rsi/snail.png
new file mode 100644 (file)
index 0000000..c3c7ffc
Binary files /dev/null and b/Resources/Textures/Objects/Consumable/Food/meat.rsi/snail.png differ