From e70e40546aebe207befa5305bd8cd5056f065ced Mon Sep 17 00:00:00 2001
From: Nokko <13428215+nok-ko@users.noreply.github.com>
Date: Fri, 10 Apr 2020 20:42:07 -0700
Subject: [PATCH] Allow the Cloning Pod to accept monster meat as a source of
biomass (#13216)
* Make monster meats food/snacks/meat/
Special case: they are not however cutlet-able.
* Revert "Make monster meats food/snacks/meat/"
This reverts commit 1c531d26a6f6f95a802f5df3ec500001912160f2.
* Make the Cloning Pod check for a BIOMASSABLE var on items it sucks in
Begone, hardcoded meat-only biomass!
* Try a different approach to cloning pod item filtering
Globaaaals!
* Adjust comments and remove old unreverted code
* Fix mapfile with lizardmeat in it
* Fix style
Implements all of @farie82's suggestions
---
.../RandomRuins/SpaceRuins/gasthelizards.dmm | 6 ++--
_maps/map_files/cyberiad/z6.dmm | 2 +-
code/game/machinery/cloning.dm | 34 +++++++++++++------
.../food_and_drinks/food/foods/meat.dm | 33 +++++++++++++-----
.../food_and_drinks/food/foods/seafood.dm | 2 +-
code/modules/food_and_drinks/food/snacks.dm | 1 -
.../food_and_drinks/recipes/recipes_grill.dm | 8 ++---
.../recipes/recipes_microwave.dm | 11 +++---
.../food_and_drinks/recipes/recipes_oven.dm | 8 ++---
.../living/carbon/alien/humanoid/humanoid.dm | 2 +-
.../mob/living/simple_animal/hostile/alien.dm | 6 ++--
.../mob/living/simple_animal/hostile/bear.dm | 2 +-
.../simple_animal/hostile/giant_spider.dm | 4 +--
.../simple_animal/hostile/mining/goliath.dm | 4 +--
14 files changed, 74 insertions(+), 49 deletions(-)
diff --git a/_maps/map_files/RandomRuins/SpaceRuins/gasthelizards.dmm b/_maps/map_files/RandomRuins/SpaceRuins/gasthelizards.dmm
index d869d21f539..0f7c36fe634 100644
--- a/_maps/map_files/RandomRuins/SpaceRuins/gasthelizards.dmm
+++ b/_maps/map_files/RandomRuins/SpaceRuins/gasthelizards.dmm
@@ -99,14 +99,14 @@
"m" = (
/obj/structure/closet/crate/freezer,
/obj/item/stack/sheet/animalhide/lizard,
-/obj/item/reagent_containers/food/snacks/lizardmeat,
+/obj/item/reagent_containers/food/snacks/monstermeat/lizardmeat,
/turf/simulated/floor/plasteel{
icon_state = "dark"
},
/area/ruin/unpowered)
"n" = (
/obj/structure/closet/crate/freezer,
-/obj/item/reagent_containers/food/snacks/lizardmeat,
+/obj/item/reagent_containers/food/snacks/monstermeat/lizardmeat,
/obj/machinery/light{
dir = 1
},
@@ -116,7 +116,7 @@
/area/ruin/unpowered)
"o" = (
/obj/structure/closet/crate/freezer,
-/obj/item/reagent_containers/food/snacks/lizardmeat,
+/obj/item/reagent_containers/food/snacks/monstermeat/lizardmeat,
/turf/simulated/floor/plasteel{
icon_state = "dark"
},
diff --git a/_maps/map_files/cyberiad/z6.dmm b/_maps/map_files/cyberiad/z6.dmm
index b2171008b2b..09453cfe542 100644
--- a/_maps/map_files/cyberiad/z6.dmm
+++ b/_maps/map_files/cyberiad/z6.dmm
@@ -5598,7 +5598,7 @@
},
/area/syndicate_depot/outer)
"lZ" = (
-/obj/item/reagent_containers/food/snacks/spiderleg,
+/obj/item/reagent_containers/food/snacks/monstermeat/spiderleg,
/obj/structure/spider,
/turf/simulated/floor/plasteel{
icon_state = "dark"
diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm
index 3aef616eb98..a98d7b08c13 100644
--- a/code/game/machinery/cloning.dm
+++ b/code/game/machinery/cloning.dm
@@ -4,7 +4,19 @@
//Potential replacement for genetics revives or something I dunno (?)
#define CLONE_BIOMASS 150
-#define BIOMASS_MEAT_AMOUNT 50
+
+#define BIOMASS_BASE_AMOUNT 50 // How much biomass a BIOMASSABLE item gives the cloning pod
+
+// Not a comprehensive list: Further PRs should add appropriate items here.
+// Meat as usual, monstermeat covers goliath, xeno, spider, bear meat
+GLOBAL_LIST_INIT(cloner_biomass_items, list(\
+/obj/item/reagent_containers/food/snacks/meat,\
+/obj/item/reagent_containers/food/snacks/monstermeat,
+/obj/item/reagent_containers/food/snacks/carpmeat,
+/obj/item/reagent_containers/food/snacks/salmonmeat,
+/obj/item/reagent_containers/food/snacks/catfishmeat,
+/obj/item/reagent_containers/food/snacks/tofurkey))
+
#define MINIMUM_HEAL_LEVEL 40
#define CLONE_INITIAL_DAMAGE 190
#define BRAIN_INITIAL_DAMAGE 90 // our minds are too feeble for 190
@@ -17,6 +29,7 @@
icon = 'icons/obj/cloning.dmi'
icon_state = "pod_0"
req_access = list(ACCESS_GENETICS) //For premature unlocking.
+
var/mob/living/carbon/human/occupant
var/heal_level //The clone is released once its health reaches this level.
var/obj/machinery/computer/cloning/connected = null //So we remember the connected clone machine.
@@ -302,13 +315,14 @@
attempting = 0
return 1
-//Grow clones to maturity then kick them out. FREELOADERS
+//Grow clones to maturity then kick them out. FREELOADERS
/obj/machinery/clonepod/process()
- var/show_message = 0
- for(var/obj/item/reagent_containers/food/snacks/meat/meat in range(1, src))
- qdel(meat)
- biomass += BIOMASS_MEAT_AMOUNT
- show_message = 1
+ var/show_message = FALSE
+ for(var/obj/item/item in range(1, src))
+ if(is_type_in_list(item, GLOB.cloner_biomass_items))
+ qdel(item)
+ biomass += BIOMASS_BASE_AMOUNT
+ show_message = TRUE
if(show_message)
visible_message("[src] sucks in and processes the nearby biomass.")
@@ -381,11 +395,11 @@
to_chat(user, "You force an emergency ejection.")
go_out()
-//Removing cloning pod biomass
- else if(istype(I, /obj/item/reagent_containers/food/snacks/meat))
+// A user can feed in biomass sources manually.
+ else if(is_type_in_list(I, GLOB.cloner_biomass_items))
if(user.drop_item())
to_chat(user, "[src] processes [I].")
- biomass += BIOMASS_MEAT_AMOUNT
+ biomass += BIOMASS_BASE_AMOUNT
qdel(I)
else
return ..()
diff --git a/code/modules/food_and_drinks/food/foods/meat.dm b/code/modules/food_and_drinks/food/foods/meat.dm
index 991d81f443d..382e2f39022 100644
--- a/code/modules/food_and_drinks/food/foods/meat.dm
+++ b/code/modules/food_and_drinks/food/foods/meat.dm
@@ -77,7 +77,22 @@
new /obj/item/reagent_containers/food/snacks/raw_bacon(loc)
qdel(src)
-/obj/item/reagent_containers/food/snacks/bearmeat
+//////////////////////////
+// Monster Meat //
+//////////////////////////
+
+// Cannot be used in the usual meat-based food recipies but can be used as cloning pod biomass.
+
+/obj/item/reagent_containers/food/snacks/monstermeat
+ // Abstract object used for inheritance. I don't see why you would want one.
+ // It's just a convenience to set all monstermeats as biomass-able at once,
+ // in the GLOB.cloner_biomass_items list.
+ // DOES NOT SPAWN NATURALLY!
+ name = "abstract monster meat"
+ desc = "A slab of abstract monster meat. This shouldn't exist, contact a coder about this if you are seeing it in-game."
+ icon_state = "bearmeat"
+
+/obj/item/reagent_containers/food/snacks/monstermeat/bearmeat
name = "bear meat"
desc = "A very manly slab of meat."
icon_state = "bearmeat"
@@ -86,7 +101,7 @@
list_reagents = list("protein" = 12, "morphine" = 5, "vitamin" = 2)
tastes = list("meat" = 1, "salmon" = 1)
-/obj/item/reagent_containers/food/snacks/xenomeat
+/obj/item/reagent_containers/food/snacks/monstermeat/xenomeat
name = "meat"
desc = "A slab of meat. It's green!"
icon_state = "xenomeat"
@@ -95,7 +110,7 @@
list_reagents = list("protein" = 3, "vitamin" = 1)
tastes = list("meat" = 1, "acid" = 1)
-/obj/item/reagent_containers/food/snacks/spidermeat
+/obj/item/reagent_containers/food/snacks/monstermeat/spidermeat
name = "spider meat"
desc = "A slab of spider meat. Not very appetizing."
icon_state = "spidermeat"
@@ -103,7 +118,7 @@
list_reagents = list("protein" = 3, "toxin" = 3, "vitamin" = 1)
tastes = list("cobwebs" = 1)
-/obj/item/reagent_containers/food/snacks/lizardmeat
+/obj/item/reagent_containers/food/snacks/monstermeat/lizardmeat
name = "mutant lizard meat"
desc = "A peculiar slab of meat. It looks scaly and radioactive."
icon_state = "xenomeat"
@@ -112,7 +127,7 @@
list_reagents = list("protein" = 3, "toxin" = 3)
tastes = list("tough meat" = 1)
-/obj/item/reagent_containers/food/snacks/spiderleg
+/obj/item/reagent_containers/food/snacks/monstermeat/spiderleg
name = "spider leg"
desc = "A still twitching leg of a giant spider. You don't really want to eat this, do you?"
icon_state = "spiderleg"
@@ -126,21 +141,21 @@
list_reagents = list("nutriment" = 1, "porktonium" = 10)
tastes = list("bacon" = 1)
-/obj/item/reagent_containers/food/snacks/spidereggs
+/obj/item/reagent_containers/food/snacks/monstermeat/spidereggs
name = "spider eggs"
desc = "A cluster of juicy spider eggs. A great side dish for when you don't care about your health."
icon_state = "spidereggs"
list_reagents = list("protein" = 2, "toxin" = 2)
tastes = list("cobwebs" = 1, "spider juice" = 1)
-/obj/item/reagent_containers/food/snacks/goliath
+/obj/item/reagent_containers/food/snacks/monstermeat/goliath
name = "goliath meat"
desc = "A slab of goliath meat. It's not very edible now, but it cooks great in lava."
icon_state = "goliathmeat"
list_reagents = list("protein" = 3, "toxin" = 5)
tastes = list("tough meat" = 1)
-/obj/item/reagent_containers/food/snacks/goliath/burn()
+/obj/item/reagent_containers/food/snacks/monstermeat/goliath/burn()
visible_message("[src] finishes cooking!")
new /obj/item/reagent_containers/food/snacks/goliath_steak(loc)
qdel(src)
@@ -243,7 +258,7 @@
trash = null
list_reagents = list("protein" = 6, "vitamin" = 2)
tastes = list("meat" = 1)
-
+
/obj/item/reagent_containers/food/snacks/fried_vox
name = "Kentucky Fried Vox"
desc = "Bucket of voxxy, yaya!"
diff --git a/code/modules/food_and_drinks/food/foods/seafood.dm b/code/modules/food_and_drinks/food/foods/seafood.dm
index 007af8f6eb9..b74ab0c3149 100644
--- a/code/modules/food_and_drinks/food/foods/seafood.dm
+++ b/code/modules/food_and_drinks/food/foods/seafood.dm
@@ -114,7 +114,7 @@
trash = /obj/item/stack/rods
icon = 'icons/obj/food/seafood.dmi'
icon_state = "shrimpskewer"
- bitesize = 3
+ bitesize = 3
list_reagents = list("nutriment" = 8)
tastes = list("shrimp" = 4)
diff --git a/code/modules/food_and_drinks/food/snacks.dm b/code/modules/food_and_drinks/food/snacks.dm
index b2f0f5eb690..8d0408a74fb 100644
--- a/code/modules/food_and_drinks/food/snacks.dm
+++ b/code/modules/food_and_drinks/food/snacks.dm
@@ -273,7 +273,6 @@
// reagents.add_reagent("nutriment", 2) // this line of code for all the contents.
// bitesize = 3 //This is the amount each bite consumes.
-
/obj/item/reagent_containers/food/snacks/badrecipe
name = "burned mess"
desc = "Someone should be demoted from chef for this."
diff --git a/code/modules/food_and_drinks/recipes/recipes_grill.dm b/code/modules/food_and_drinks/recipes/recipes_grill.dm
index 83f9aea745f..047b3968176 100644
--- a/code/modules/food_and_drinks/recipes/recipes_grill.dm
+++ b/code/modules/food_and_drinks/recipes/recipes_grill.dm
@@ -112,7 +112,7 @@
/datum/recipe/grill/wingfangchu
reagents = list("soysauce" = 5)
items = list(
- /obj/item/reagent_containers/food/snacks/xenomeat,
+ /obj/item/reagent_containers/food/snacks/monstermeat/xenomeat
)
result = /obj/item/reagent_containers/food/snacks/wingfangchu
@@ -228,11 +228,9 @@
result = /obj/item/reagent_containers/food/snacks/sushi_Tai
/datum/recipe/grill/goliath
- items = list(
-/obj/item/reagent_containers/food/snacks/goliath
- )
+ items = list(/obj/item/reagent_containers/food/snacks/monstermeat/goliath)
result = /obj/item/reagent_containers/food/snacks/goliath_steak
-
+
/datum/recipe/grill/shrimp_skewer
items = list(
/obj/item/reagent_containers/food/snacks/shrimp,
diff --git a/code/modules/food_and_drinks/recipes/recipes_microwave.dm b/code/modules/food_and_drinks/recipes/recipes_microwave.dm
index 44c572b34e7..f8d720ec56c 100644
--- a/code/modules/food_and_drinks/recipes/recipes_microwave.dm
+++ b/code/modules/food_and_drinks/recipes/recipes_microwave.dm
@@ -87,8 +87,7 @@
/datum/recipe/microwave/xenoburger
items = list(
/obj/item/reagent_containers/food/snacks/bun,
- /obj/item/reagent_containers/food/snacks/xenomeat
- )
+ /obj/item/reagent_containers/food/snacks/monstermeat/xenomeat )
result = /obj/item/reagent_containers/food/snacks/xenoburger
/datum/recipe/microwave/fishburger
@@ -630,22 +629,22 @@ datum/recipe/microwave/slimesandwich
/datum/recipe/microwave/boiledspiderleg
reagents = list("water" = 10)
items = list(
- /obj/item/reagent_containers/food/snacks/spiderleg,
+ /obj/item/reagent_containers/food/snacks/monstermeat/spiderleg
)
result = /obj/item/reagent_containers/food/snacks/boiledspiderleg
/datum/recipe/microwave/spidereggsham
reagents = list("sodiumchloride" = 1)
items = list(
- /obj/item/reagent_containers/food/snacks/spidereggs,
- /obj/item/reagent_containers/food/snacks/spidermeat,
+ /obj/item/reagent_containers/food/snacks/monstermeat/spidereggs,
+ /obj/item/reagent_containers/food/snacks/monstermeat/spidermeat
)
result = /obj/item/reagent_containers/food/snacks/spidereggsham
/datum/recipe/microwave/sashimi
reagents = list("soysauce" = 5)
items = list(
- /obj/item/reagent_containers/food/snacks/spidereggs,
+ /obj/item/reagent_containers/food/snacks/monstermeat/spidereggs,
/obj/item/reagent_containers/food/snacks/carpmeat,
)
result = /obj/item/reagent_containers/food/snacks/sashimi
diff --git a/code/modules/food_and_drinks/recipes/recipes_oven.dm b/code/modules/food_and_drinks/recipes/recipes_oven.dm
index a53ee6e75d9..1a4b7f387a1 100644
--- a/code/modules/food_and_drinks/recipes/recipes_oven.dm
+++ b/code/modules/food_and_drinks/recipes/recipes_oven.dm
@@ -40,9 +40,9 @@
/obj/item/reagent_containers/food/snacks/dough,
/obj/item/reagent_containers/food/snacks/dough,
/obj/item/reagent_containers/food/snacks/dough,
- /obj/item/reagent_containers/food/snacks/xenomeat,
- /obj/item/reagent_containers/food/snacks/xenomeat,
- /obj/item/reagent_containers/food/snacks/xenomeat,
+ /obj/item/reagent_containers/food/snacks/monstermeat/xenomeat,
+ /obj/item/reagent_containers/food/snacks/monstermeat/xenomeat,
+ /obj/item/reagent_containers/food/snacks/monstermeat/xenomeat,
/obj/item/reagent_containers/food/snacks/cheesewedge,
/obj/item/reagent_containers/food/snacks/cheesewedge,
/obj/item/reagent_containers/food/snacks/cheesewedge,
@@ -115,7 +115,7 @@
/datum/recipe/oven/xemeatpie
items = list(
/obj/item/reagent_containers/food/snacks/sliceable/flatdough,
- /obj/item/reagent_containers/food/snacks/xenomeat,
+ /obj/item/reagent_containers/food/snacks/monstermeat/xenomeat
)
result = /obj/item/reagent_containers/food/snacks/xemeatpie
diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm
index 29b37294cc4..63f6d3dcea9 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm
@@ -2,7 +2,7 @@
name = "alien"
icon_state = "alien_s"
- butcher_results = list(/obj/item/reagent_containers/food/snacks/xenomeat = 5, /obj/item/stack/sheet/animalhide/xeno = 1)
+ butcher_results = list(/obj/item/reagent_containers/food/snacks/monstermeat/xenomeat= 5, /obj/item/stack/sheet/animalhide/xeno = 1)
var/obj/item/r_store = null
var/obj/item/l_store = null
var/caste = ""
diff --git a/code/modules/mob/living/simple_animal/hostile/alien.dm b/code/modules/mob/living/simple_animal/hostile/alien.dm
index 5a369a043d7..038b3b3d221 100644
--- a/code/modules/mob/living/simple_animal/hostile/alien.dm
+++ b/code/modules/mob/living/simple_animal/hostile/alien.dm
@@ -11,7 +11,7 @@
response_disarm = "shoves"
response_harm = "hits"
speed = 0
- butcher_results = list(/obj/item/reagent_containers/food/snacks/xenomeat = 3, /obj/item/stack/sheet/animalhide/xeno = 1)
+ butcher_results = list(/obj/item/reagent_containers/food/snacks/monstermeat/xenomeat= 3, /obj/item/stack/sheet/animalhide/xeno = 1)
maxHealth = 125
health = 125
harm_intent_damage = 5
@@ -83,7 +83,7 @@
retreat_distance = 5
minimum_distance = 5
move_to_delay = 4
- butcher_results = list(/obj/item/reagent_containers/food/snacks/xenomeat = 4, /obj/item/stack/sheet/animalhide/xeno = 1)
+ butcher_results = list(/obj/item/reagent_containers/food/snacks/monstermeat/xenomeat= 4, /obj/item/stack/sheet/animalhide/xeno = 1)
projectiletype = /obj/item/projectile/neurotox
projectilesound = 'sound/weapons/pierce.ogg'
status_flags = 0
@@ -130,7 +130,7 @@
move_to_delay = 4
maxHealth = 400
health = 400
- butcher_results = list(/obj/item/reagent_containers/food/snacks/xenomeat = 10, /obj/item/stack/sheet/animalhide/xeno = 2)
+ butcher_results = list(/obj/item/reagent_containers/food/snacks/monstermeat/xenomeat= 10, /obj/item/stack/sheet/animalhide/xeno = 2)
mob_size = MOB_SIZE_LARGE
gold_core_spawnable = NO_SPAWN
diff --git a/code/modules/mob/living/simple_animal/hostile/bear.dm b/code/modules/mob/living/simple_animal/hostile/bear.dm
index 2530fb4b389..d5b7205f09c 100644
--- a/code/modules/mob/living/simple_animal/hostile/bear.dm
+++ b/code/modules/mob/living/simple_animal/hostile/bear.dm
@@ -13,7 +13,7 @@
speak_chance = 1
turns_per_move = 5
see_in_dark = 6
- butcher_results = list(/obj/item/reagent_containers/food/snacks/bearmeat = 5, /obj/item/clothing/head/bearpelt = 1)
+ butcher_results = list(/obj/item/reagent_containers/food/snacks/monstermeat/bearmeat= 5, /obj/item/clothing/head/bearpelt = 1)
response_help = "pets"
response_disarm = "gently pushes aside"
response_harm = "hits"
diff --git a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm
index b456db6efaf..614e814fc25 100644
--- a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm
+++ b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm
@@ -18,7 +18,7 @@
turns_per_move = 5
see_in_dark = 8
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE
- butcher_results = list(/obj/item/reagent_containers/food/snacks/spidermeat = 2, /obj/item/reagent_containers/food/snacks/spiderleg = 8)
+ butcher_results = list(/obj/item/reagent_containers/food/snacks/monstermeat/spidermeat= 2, /obj/item/reagent_containers/food/snacks/monstermeat/spiderleg= 8)
response_help = "pets"
response_disarm = "gently pushes aside"
response_harm = "hits"
@@ -53,7 +53,7 @@
icon_state = "nurse"
icon_living = "nurse"
icon_dead = "nurse_dead"
- butcher_results = list(/obj/item/reagent_containers/food/snacks/spidermeat = 2, /obj/item/reagent_containers/food/snacks/spiderleg = 8, /obj/item/reagent_containers/food/snacks/spidereggs = 4)
+ butcher_results = list(/obj/item/reagent_containers/food/snacks/monstermeat/spidermeat= 2, /obj/item/reagent_containers/food/snacks/monstermeat/spiderleg= 8, /obj/item/reagent_containers/food/snacks/monstermeat/spidereggs= 4)
maxHealth = 40
health = 40
diff --git a/code/modules/mob/living/simple_animal/hostile/mining/goliath.dm b/code/modules/mob/living/simple_animal/hostile/mining/goliath.dm
index 288d45c9b1a..d052dd9bc23 100644
--- a/code/modules/mob/living/simple_animal/hostile/mining/goliath.dm
+++ b/code/modules/mob/living/simple_animal/hostile/mining/goliath.dm
@@ -89,7 +89,7 @@
throw_message = "does nothing to the tough hide of the"
pre_attack_icon = "goliath2"
crusher_loot = /obj/item/crusher_trophy/goliath_tentacle
- butcher_results = list(/obj/item/reagent_containers/food/snacks/goliath = 2, /obj/item/stack/sheet/animalhide/goliath_hide = 1, /obj/item/stack/sheet/bone = 2)
+ butcher_results = list(/obj/item/reagent_containers/food/snacks/monstermeat/goliath= 2, /obj/item/stack/sheet/animalhide/goliath_hide = 1, /obj/item/stack/sheet/bone = 2)
loot = list()
stat_attack = UNCONSCIOUS
robust_searching = TRUE
@@ -113,7 +113,7 @@
pre_attack_icon = "Goliath_preattack"
throw_message = "does nothing to the rocky hide of the"
loot = list(/obj/item/stack/sheet/animalhide/goliath_hide) //A throwback to the asteroid days
- butcher_results = list(/obj/item/reagent_containers/food/snacks/goliath = 2, /obj/item/stack/sheet/bone = 2)
+ butcher_results = list(/obj/item/reagent_containers/food/snacks/monstermeat/goliath= 2, /obj/item/stack/sheet/bone = 2)
crusher_drop_mod = 30
wander = FALSE
var/list/cached_tentacle_turfs