Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sliders use Multispawners instead of boxes. #33732

Merged
merged 7 commits into from
Dec 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion code/game/objects/items/weapons/storage/fancy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@
/obj/item/weapon/storage/fancy/food_box/slider_box/spider
name = "spidey slidey box"
icon_type = "spider slider"
slider_type = /obj/item/weapon/reagent_containers/food/snacks/slider/carp/spider
slider_type = /obj/item/weapon/reagent_containers/food/snacks/slider/spider

/obj/item/weapon/storage/fancy/food_box/slider_box/clown
name = "honky slider box"
Expand Down
25 changes: 15 additions & 10 deletions code/modules/food/recipes_microwave.dm
Original file line number Diff line number Diff line change
Expand Up @@ -237,51 +237,55 @@
/obj/item/weapon/reagent_containers/food/snacks/meat,
/obj/item/weapon/reagent_containers/food/snacks/meat
)
result = /obj/item/weapon/storage/fancy/food_box/slider_box
result = /obj/item/weapon/reagent_containers/food/snacks/multispawner/slider

/datum/recipe/sliders/synth
priority = 1
items = list(
/obj/item/weapon/reagent_containers/food/snacks/meat/syntiflesh,
/obj/item/weapon/reagent_containers/food/snacks/meat/syntiflesh
)
result = /obj/item/weapon/storage/fancy/food_box/slider_box/synth
result = /obj/item/weapon/reagent_containers/food/snacks/multispawner/slider/synth

/datum/recipe/sliders/xeno
priority = 1
items = list(
/obj/item/weapon/reagent_containers/food/snacks/meat/xenomeat,
/obj/item/weapon/reagent_containers/food/snacks/meat/xenomeat
)
result = /obj/item/weapon/storage/fancy/food_box/slider_box/xeno
result = /obj/item/weapon/reagent_containers/food/snacks/multispawner/slider/xeno

/datum/recipe/sliders/chicken
priority = 1
items = list(
/obj/item/weapon/reagent_containers/food/snacks/meat/rawchicken,
/obj/item/weapon/reagent_containers/food/snacks/meat/rawchicken
)
result = /obj/item/weapon/storage/fancy/food_box/slider_box/chicken
result = /obj/item/weapon/reagent_containers/food/snacks/multispawner/slider/chicken

/datum/recipe/sliders/spider
priority = 1
items = list(
/obj/item/weapon/reagent_containers/food/snacks/meat/spidermeat,
/obj/item/weapon/reagent_containers/food/snacks/meat/spidermeat
)
result = /obj/item/weapon/storage/fancy/food_box/slider_box/spider
result = /obj/item/weapon/reagent_containers/food/snacks/multispawner/slider/spider

/datum/recipe/sliders/clown
items = list(
/obj/item/weapon/reagent_containers/food/snacks/meat,
/obj/item/weapon/reagent_containers/food/snacks/meat,
/obj/item/clothing/mask/gas/clown_hat
)
result = /obj/item/weapon/storage/fancy/food_box/slider_box/clown
result = /obj/item/weapon/reagent_containers/food/snacks/multispawner/slider/clown

/datum/recipe/sliders/mime
items = list(
/obj/item/weapon/reagent_containers/food/snacks/meat,
/obj/item/weapon/reagent_containers/food/snacks/meat,
/obj/item/clothing/head/beret
)
result = /obj/item/weapon/storage/fancy/food_box/slider_box/mime
result = /obj/item/weapon/reagent_containers/food/snacks/multispawner/slider/mime

/datum/recipe/sliders/slippery
reagents = list(FLOUR = 10, LUBE = 5)
Expand All @@ -290,7 +294,7 @@
/obj/item/weapon/reagent_containers/food/snacks/meat,
/obj/item/weapon/reagent_containers/food/snacks/grown/banana
)
result = /obj/item/weapon/storage/fancy/food_box/slider_box/slippery
result = /obj/item/weapon/reagent_containers/food/snacks/multispawner/slider/slippery

// Eggs ////////////////////////////////////////////////////////

Expand Down Expand Up @@ -2338,15 +2342,16 @@
result = /obj/item/weapon/reagent_containers/food/snacks/cubancarp

/datum/recipe/sliders/carp
priority = 1
items = list(
/obj/item/weapon/reagent_containers/food/snacks/meat/carpmeat
)
result = /obj/item/weapon/storage/fancy/food_box/slider_box/carp
result = /obj/item/weapon/reagent_containers/food/snacks/multispawner/slider/carp

/datum/recipe/sliders/carp/make_food(var/obj/container, var/mob/user)
var/obj/item/weapon/reagent_containers/food/snacks/meat/carpmeat/C = locate() in container
if(C.poisonsacs)
result = /obj/item/weapon/storage/fancy/food_box/slider_box/toxiccarp
result = /obj/item/weapon/reagent_containers/food/snacks/multispawner/slider/toxiccarp
..()

/datum/recipe/turkey
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/simple_animal/friendly/mouse.dm
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
hud_list[STATUS_HUD] = image('icons/mob/hud.dmi', src, "hudhealthy")

var/turf/T = get_turf(src)
if (!client && istype(T.loc,/area/maintenance) && prob(20))
if (!client && (T ? istype(T.loc,/area/maintenance) : FALSE) && prob(20))
MaintInfection()

/mob/living/simple_animal/mouse/can_be_infected()
Expand Down
110 changes: 85 additions & 25 deletions code/modules/reagents/reagent_containers/food/snacks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,13 @@
// and set your recipe's result to your spawner.
// reagents.add_reagent() should take place in your spawner's New() proc, not in its children's.
// Consult sushi types below for examples of usage.

// Multispawners take the total amount of reagents, both the ones added by the recipe and the ingredients's ones, divides the number by the child volume and spawns that many of items.
// For example: If the child volume is 1 and the total reagents, both from the ingredients and the extra upon cooking, add to 10u, then it would spawn 10 items.
// This means that "stronger" ingredients spawn more items.
// If you have child volume 5, the recipe adds 10u reagents and the ingredients' reagents add 10 more, the multispawner would spawn 4 items, since (10+10):5=4.
// Only the fooditem ingredient reagents get tallied, any "raw" reagents the recipe calls for, such as flour, don't get counted for multispawner purposes.

/obj/item/weapon/reagent_containers/food/snacks/multispawner
name = "food spawner"
var/child_type = /obj/item/weapon/reagent_containers/food/snacks
Expand Down Expand Up @@ -5092,86 +5099,139 @@

////////////////SLIDERS////////////////

/obj/item/weapon/reagent_containers/food/snacks/multispawner/slider
name = "sliders"
child_type = /obj/item/weapon/reagent_containers/food/snacks/slider
child_volume = 2.5

/obj/item/weapon/reagent_containers/food/snacks/multispawner/slider/New()
..()
reagents.add_reagent(NUTRIMENT, 10) //spawns 4

/obj/item/weapon/reagent_containers/food/snacks/slider
name = "slider"
desc = "It's so tiny!"
icon_state = "slider"
food_flags = FOOD_MEAT
bitesize = 1.5

/obj/item/weapon/reagent_containers/food/snacks/multispawner/slider/synth
name = "synth sliders"
child_type = /obj/item/weapon/reagent_containers/food/snacks/slider/synth

/obj/item/weapon/reagent_containers/food/snacks/slider/New()
/obj/item/weapon/reagent_containers/food/snacks/multispawner/slider/synth/New()
..()
reagents.add_reagent(NUTRIMENT, 2.5)
bitesize = 1.5

/obj/item/weapon/reagent_containers/food/snacks/slider/synth
name = "synth slider"
desc = "It's made to be tiny!"

/obj/item/weapon/reagent_containers/food/snacks/multispawner/slider/xeno
name = "xeno sliders"
child_type = /obj/item/weapon/reagent_containers/food/snacks/slider/xeno
child_volume = 3.5

/obj/item/weapon/reagent_containers/food/snacks/multispawner/slider/xeno/New()
..()
reagents.add_reagent(NUTRIMENT, 4) //spawns 4

/obj/item/weapon/reagent_containers/food/snacks/slider/xeno
name = "xeno slider"
desc = "It's green!"
icon_state = "slider_xeno"

/obj/item/weapon/reagent_containers/food/snacks/slider/xeno/New()
/obj/item/weapon/reagent_containers/food/snacks/multispawner/slider/chicken
name = "chicken sliders"
child_type = /obj/item/weapon/reagent_containers/food/snacks/slider/chicken
child_volume = 3.5

/obj/item/weapon/reagent_containers/food/snacks/multispawner/slider/chicken/New()
..()
reagents.add_reagent(NUTRIMENT, 1)
bitesize = 2
reagents.add_reagent(NUTRIMENT, 4) //spawns 4

/obj/item/weapon/reagent_containers/food/snacks/slider/chicken
name = "chicken slider"
desc = "Chicken sliders? That's new."
icon_state = "slider_chicken"

/obj/item/weapon/reagent_containers/food/snacks/slider/chicken/New()
/obj/item/weapon/reagent_containers/food/snacks/multispawner/slider/carp
name = "carp sliders"
child_type = /obj/item/weapon/reagent_containers/food/snacks/slider/carp
child_volume = 3.5

/obj/item/weapon/reagent_containers/food/snacks/multispawner/slider/carp/New()
..()
reagents.add_reagent(NUTRIMENT, 1)
bitesize = 2
reagents.add_reagent(NUTRIMENT, 4) //spawns 4

/obj/item/weapon/reagent_containers/food/snacks/slider/carp
name = "carp slider"
desc = "I wonder how it tastes!"
icon_state = "slider_carp"

/obj/item/weapon/reagent_containers/food/snacks/slider/carp/New()
/obj/item/weapon/reagent_containers/food/snacks/multispawner/slider/toxiccarp
name = "carp sliders"
child_type = /obj/item/weapon/reagent_containers/food/snacks/slider/toxiccarp
child_volume = 5.5

/obj/item/weapon/reagent_containers/food/snacks/multispawner/slider/toxiccarp/New()
..()
reagents.add_reagent(NUTRIMENT, 1)
bitesize = 2.5
reagents.add_reagent(NUTRIMENT, 4) //spawns 4
reagents.add_reagent(CARPOTOXIN, 8)

/obj/item/weapon/reagent_containers/food/snacks/slider/toxiccarp
name = "carp slider"
desc = "I wonder how it tastes!"
icon_state = "slider_carp"

/obj/item/weapon/reagent_containers/food/snacks/slider/toxiccarp/New()
/obj/item/weapon/reagent_containers/food/snacks/multispawner/slider/spider
name = "spidey slideys"
child_type = /obj/item/weapon/reagent_containers/food/snacks/slider/spider
child_volume = 3.5

/obj/item/weapon/reagent_containers/food/snacks/multispawner/slider/spider/New()
..()
reagents.add_reagent(NUTRIMENT, 1)
reagents.add_reagent(CARPOTOXIN, 2)
bitesize = 2.5
reagents.add_reagent(NUTRIMENT, 4) //spawns 4

/obj/item/weapon/reagent_containers/food/snacks/slider/carp/spider
/obj/item/weapon/reagent_containers/food/snacks/slider/spider
name = "spidey slidey"
desc = "I think there's still a leg in there!"
icon_state = "slider_spider"

/obj/item/weapon/reagent_containers/food/snacks/multispawner/slider/clown
name = "honky sliders"
child_type = /obj/item/weapon/reagent_containers/food/snacks/slider/clown
child_volume = 5

/obj/item/weapon/reagent_containers/food/snacks/multispawner/slider/clown/New()
..()
reagents.add_reagent(HONKSERUM, 10) //spawns 4

/obj/item/weapon/reagent_containers/food/snacks/slider/clown
name = "honky slider"
desc = "HONK!"
icon_state = "slider_clown"

/obj/item/weapon/reagent_containers/food/snacks/slider/clown/New()
/obj/item/weapon/reagent_containers/food/snacks/multispawner/slider/mime
name = "quiet sliders"
child_type = /obj/item/weapon/reagent_containers/food/snacks/slider/mime
child_volume = 5

/obj/item/weapon/reagent_containers/food/snacks/multispawner/slider/mime/New()
..()
reagents.add_reagent(HONKSERUM, 2.5)
bitesize = 2.5
reagents.add_reagent(SILENCER, 10) //spawns 4

/obj/item/weapon/reagent_containers/food/snacks/slider/mime
name = "quiet Slider"
name = "quiet slider"
desc = "..."
icon_state = "slider_mime"

/obj/item/weapon/reagent_containers/food/snacks/slider/mime/New()
..()
reagents.add_reagent(SILENCER, 2.5)
bitesize = 2.5
/obj/item/weapon/reagent_containers/food/snacks/multispawner/slider/slippery
name = "slippery sliders"
child_type = /obj/item/weapon/reagent_containers/food/snacks/slider/slippery
child_volume = 5

/obj/item/weapon/reagent_containers/food/snacks/multispawner/slider/slippery/New()
..() //spawns 2

/obj/item/weapon/reagent_containers/food/snacks/slider/slippery
name = "slippery slider"
Expand Down