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

Slug things, slime, dropSweat and wetify procs #17155

Merged
merged 10 commits into from Dec 8, 2023
6 changes: 6 additions & 0 deletions code/datums/cookingrecipes.dm
Expand Up @@ -34,6 +34,12 @@ ABSTRACT_TYPE(/datum/cookingrecipe)
cookbonus = 13
output = /obj/item/reagent_containers/food/snacks/burger/synthburger

/datum/cookingrecipe/slugburger
item1 = /obj/item/reagent_containers/food/snacks/ingredient/dough
item2 = /obj/item/reagent_containers/food/snacks/ingredient/meat/lesserSlug
cookbonus = 13
output = /obj/item/reagent_containers/food/snacks/burger/slugburger

/datum/cookingrecipe/spicychickensandwich_2
item1 = /obj/item/reagent_containers/food/snacks/ingredient/dough
item2 = /obj/item/reagent_containers/food/snacks/ingredient/meat/mysterymeat/nugget/spicy
Expand Down
21 changes: 15 additions & 6 deletions code/mob/living/carbon.dm
Expand Up @@ -31,6 +31,18 @@
wet_adjusted = max(wet_adjusted, 2) //whee

switch (wet_adjusted)
if (-1) //slime
if(src.getStatusDuration("slowed")<1)
boutput(src, SPAN_NOTICE("You get slowed down by the slimy floor!"))
if(src.getStatusDuration("slowed")< 10 SECONDS)
src.changeStatus("slowed", 3 SECONDS)

if (-2) //glue
if(src.getStatusDuration("slowed")<1)
boutput(src, SPAN_NOTICE("You get slowed down by the sticky floor!"))
if(src.getStatusDuration("slowed")< 10 SECONDS)
src.changeStatus("slowed", 3 SECONDS)

if (1) //ATM only the ancient mop does this
if (locate(/obj/item/clothing/under/towel) in T)
src.inertia_dir = 0
Expand All @@ -42,12 +54,14 @@
else
src.inertia_dir = 0
return

if (2) //lube
CalliopeSoups marked this conversation as resolved.
Show resolved Hide resolved
src.remove_pulling()
boutput(src, SPAN_NOTICE("You slipped on the floor!"))
playsound(T, 'sound/misc/slip.ogg', 50, TRUE, -3)
var/atom/target = get_edge_target_turf(src, src.dir)
src.throw_at(target, 12, 1, throw_type = THROW_SLIP)

if (3) // superlube
src.remove_pulling()
src.changeStatus("weakened", 3.5 SECONDS)
Expand All @@ -57,12 +71,7 @@
src.throw_at(target, 30, 1, throw_type = THROW_SLIP)
random_brute_damage(src, 10)

var/turf/T = NewLoc
if(T.sticky)
if(src.getStatusDuration("slowed")<1)
boutput(src, SPAN_NOTICE("You get slowed down by the sticky floor!"))
if(src.getStatusDuration("slowed")< 10 SECONDS)
src.changeStatus("slowed", 2 SECONDS)


/mob/living/carbon/relaymove(mob/user, direction, delay, running)
src.organHolder?.stomach?.relaymove(user, direction, delay, running)
Expand Down
6 changes: 5 additions & 1 deletion code/mob/living/critter/small_animal.dm
Expand Up @@ -3099,10 +3099,14 @@ var/list/mob_bird_species = list("smallowl" = /mob/living/critter/small_animal/b
base_move_delay = 6
base_walk_delay = 8
var/slime_chance = 22
butcherable = TRUE
name_the_meat = FALSE
meat_type = /obj/item/reagent_containers/food/snacks/ingredient/meat/lesserSlug


New()
..()
AddComponent(/datum/component/floor_slime, "badgrease", slime_chance, 10)
AddComponent(/datum/component/floor_slime, "slime", slime_chance, 10)

setup_hands()
..()
Expand Down
102 changes: 29 additions & 73 deletions code/modules/chemistry/Reagents-Misc.dm
Expand Up @@ -803,32 +803,9 @@ datum
block_slippy = -1

reaction_turf(var/turf/target, var/volume)
var/list/covered = holder.covered_turf()
var/turf/simulated/T = target
var/volume_mult = 1

if (length(covered))
if (volume/length(covered) < 2) //reduce time based on dilution
volume_mult = min(volume / 9, 1)

if (istype(T))
if (T.wet >= 2) return
var/image/wet = image('icons/effects/water.dmi',"wet_floor")
wet.blend_mode = BLEND_ADD
wet.alpha = 60
T.UpdateOverlays(wet, "wet_overlay")
T.wet = 2
playsound(T, 'sound/impact_sounds/Slimy_Splat_1.ogg', 50, TRUE)
var/obj/grille/catwalk/catwalk = null
if (istype(T, /turf/simulated/floor/airless/plating/catwalk)) //guh
catwalk = locate() in T
catwalk.UpdateOverlays(wet, "wet_overlay")
SPAWN(800 * volume_mult)
if (istype(T))
T.wet = 0
T.UpdateOverlays(null, "wet_overlay")
catwalk?.UpdateOverlays(null, "wet_overlay")
return
if (istype(target, /turf/simulated))
var/turf/simulated/simulated_target = target
simulated_target.wetify(2, 60, 60 SECONDS)

superlube
name = "organic superlubricant"
Expand All @@ -844,28 +821,36 @@ datum
var/visible = 1

reaction_turf(var/turf/target, var/volume)
var/visible = src.visible
var/turf/simulated/T = target
if (istype(T))
if (T.wet >= 3) return
if (istype(target, /turf/simulated))
var/turf/simulated/simulated_target = target
if (visible)
var/image/wet = image('icons/effects/water.dmi',"wet_floor")
wet.blend_mode = BLEND_ADD
wet.alpha = 60
T.UpdateOverlays(wet, "wet_overlay")
playsound(T, 'sound/impact_sounds/Slimy_Splat_1.ogg', 50, TRUE)
T.wet = 3
SPAWN(80 SECONDS)
if (istype(T))
T.wet = 0
T.UpdateOverlays(null, "wet_overlay")
return
simulated_target.wetify(3, 60 SECONDS)
else
simulated_target.wetify(3, 60 SECONDS, null, TRUE)

invisible
name = "invisible organic superlubricant"
id = "invislube"
visible = 0

slime
name = "slug slime"
id = "slime"
description = "Gross goop that sticks to everything it touches."
reagent_state = LIQUID
depletion_rate = 0.6
fluid_r = 116
fluid_b = 73
fluid_g = 226
transparency = 180
viscosity = 0.8
block_slippy = 1

reaction_turf(var/turf/target, var/volume)
if (istype(target, /turf/simulated))
var/turf/simulated/simulated_target = target
simulated_target.wetify(-1, 60 SECONDS, rgb(116,226,73))

glue
name = "space glue"
id = "spaceglue"
Expand All @@ -880,39 +865,10 @@ datum
block_slippy = 1
var/counter

reaction_mob(var/mob/M, var/method=TOUCH, var/volume, var/paramslist = 0, var/raw_volume)
. = ..()
if(method == TOUCH)
var/mob/living/L = M
. = 0

if(L.getStatusDuration("slowed")>=10 SECONDS)
L.setStatusMin("staggered", (0.3 SECONDS)*raw_volume)
if(!ON_COOLDOWN(M, "stuck in glue", 15 SECOND))
boutput(M, SPAN_NOTICE("You get stuck in the glue!"))
else
L.changeStatus("slowed", min((0.4 SECONDS)*raw_volume, 10 SECONDS))
return

reaction_turf(var/turf/target, var/volume)
var/list/covered = holder.covered_turf()
var/turf/simulated/T = target
var/volume_mult = 1

if (length(covered))
if (volume/length(covered) < 2) //reduce time based on dilution
volume_mult = min(volume / 9, 1)

if (istype(T))
if(T.sticky == TRUE) return
var/wet = image('icons/effects/water.dmi',"sticky_floor")
T.UpdateOverlays(wet, "wet_overlay")
T.sticky = TRUE
T.wet = 0
SPAWN(80 SECONDS * volume_mult)
T.UpdateOverlays(null, "wet_overlay")
T.sticky = FALSE
return
if (istype(target, /turf/simulated))
var/turf/simulated/simulated_target = target
simulated_target.wetify(-2, 60 SECONDS)

on_mob_life(var/mob/M, var/mult = 1, var/method, var/volume_passed)
if (!M) M = holder.my_atom
Expand Down
12 changes: 12 additions & 0 deletions code/modules/food_and_drink/ingredients.dm
Expand Up @@ -57,6 +57,18 @@ ABSTRACT_TYPE(/obj/item/reagent_containers/food/snacks/ingredient)
name = "monkeymeat"
desc = "A slab of meat from a monkey."

/obj/item/reagent_containers/food/snacks/ingredient/meat/lesserSlug
name = "lesser slug"
desc = "Chopped up slug meat that's grown its own head, how talented."
icon_state = "lesserSlug"
fill_amt = 2
initial_volume = 25
initial_reagents = "slime"

heal(var/mob/M)
boutput(M, SPAN_ALERT("You can feel it wriggling..."))
..()

/obj/item/reagent_containers/food/snacks/ingredient/meat/fish/fillet
name = "fish fillet"
desc = "A slab of meat from a fish."
Expand Down
7 changes: 7 additions & 0 deletions code/modules/food_and_drink/sandwiches.dm
Expand Up @@ -238,6 +238,13 @@
desc = "This burger's all buns. It seems to be made out of a green synthetic butt."
icon_state = "synthbuttburger"

/obj/item/reagent_containers/food/snacks/burger/slugburger
name = "slurger"
desc = "Unspeakable... And chewy."
icon_state = "slugBurger"
initial_reagents = "slime"
food_effects = list("food_slimy", "food_bad_breath")

/obj/item/reagent_containers/food/snacks/burger/buttburger/cyber
name = "buttburger"
desc = "This burger's all buns. It seems to made out of a cybernetic butt."
Expand Down
18 changes: 17 additions & 1 deletion code/modules/status_system/statusEffects.dm
Expand Up @@ -80,6 +80,22 @@
proc/onUpdate(timePassed)
return

/**
* Called by some foods, use inside onUpdate(timePassed)
*
* Required: sweatReagent - the chemical you're sweating
* targetTurf should be left default
*/
proc/dropSweat(var/sweatReagent, var/sweatAmount = 5, var/sweatChance = 2, var/turf/targetTurf = get_turf(owner))
var/datum/reagents/tempHolder = new
if (prob(sweatChance))
tempHolder.add_reagent(sweatReagent, sweatAmount)
targetTurf.fluid_react_single(sweatReagent,sweatAmount)
tempHolder.reaction(targetTurf, TOUCH)
return



/**
* Called when the status is changed using setStatus. Called after duration is updated etc.
*
Expand Down Expand Up @@ -2545,4 +2561,4 @@
var/mob/M = owner
M.max_health += change
current_bonus = newBonus
health_update_queue |= M
health_update_queue |= M
30 changes: 16 additions & 14 deletions code/modules/status_system/statusFoodBuffs.dm
Expand Up @@ -420,41 +420,43 @@
getChefHint()
. = "Gives the consumer an absolutely terrible breath smell."

/datum/statusEffect/slimy
id = "food_slimy"
name ="Food (Slimy)"
desc = "You're oozing..."
maxDuration = 600
icon_state = "-"
unique = 1

onUpdate(timePassed)
dropSweat("slime", 5, 5)

/datum/statusEffect/sweaty
id = "food_sweaty"
name = "Food (Sweaty)"
desc = "You feel sweaty!"
icon_state = "foodbuff"
exclusiveGroup = "Food"
maxDuration = 6000
maxDuration = 3000
unique = 1

var/sweat_prob = 1
var/tickCount = 0
var/static/tickSpacing = 20 //Time between ticks.
var/sweat_adjective = "" // used for getChefHint()


onUpdate(timePassed)
dropSweat("water")

big
name = "Food (Sweaty+)"
id = "food_sweaty_big"
desc = "You feel really sweaty!"
sweat_prob = 5
sweat_adjective = "REALLY "
maxDuration = 600

getChefHint()
. = "Makes the consumer [sweat_adjective]sweaty."

onUpdate(timePassed)
tickCount += timePassed
var/times = (tickCount / tickSpacing)
if(times >= 1 && ismob(owner))
tickCount -= (round(times) * tickSpacing)
for(var/i in 1 to times)
if (prob(sweat_prob))
var/turf/T = get_turf(owner)
T.fluid_react_single("water",5)
dropSweat("water", 10, 20)

/datum/statusEffect/brainfood
id = "brain_food"
Expand Down
1 change: 1 addition & 0 deletions code/obj/submachine/cooking.dm
Expand Up @@ -571,6 +571,7 @@ table#cooktime a#start {
src.recipes += new /datum/cookingrecipe/humanburger(src)
src.recipes += new /datum/cookingrecipe/monkeyburger(src)
src.recipes += new /datum/cookingrecipe/synthburger(src)
src.recipes += new /datum/cookingrecipe/slugburger(src)
src.recipes += new /datum/cookingrecipe/baconburger(src)
src.recipes += new /datum/cookingrecipe/spicychickensandwich_2(src)
src.recipes += new /datum/cookingrecipe/spicychickensandwich(src)
Expand Down
25 changes: 25 additions & 0 deletions code/turf/floors.dm
Expand Up @@ -1456,6 +1456,31 @@ TYPEINFO(/turf/simulated/floor/grass)
/turf/proc/grassify()
.=0

/// wetType: [-2 = glue, -1 = slime, 0 = dry, 1 = water, 2 = lube, 3 = superlube]
TobleroneSwordfish marked this conversation as resolved.
Show resolved Hide resolved
/turf/simulated/proc/wetify(var/wetType = 2, var/timeout = 80 SECONDS, var/color = null, var/silent = FALSE)
var/image/overlay = null
var/image/alpha = 60
CalliopeSoups marked this conversation as resolved.
Show resolved Hide resolved

if (wetType <= 0)
overlay = image('icons/effects/water.dmi', "sticky_floor")
else
overlay = image('icons/effects/water.dmi', "wet_floor")

if (silent == FALSE)
TobleroneSwordfish marked this conversation as resolved.
Show resolved Hide resolved
playsound(src, 'sound/impact_sounds/Slimy_Splat_1.ogg', 50, TRUE)
else
alpha = 0

overlay.blend_mode = BLEND_ADD
overlay.alpha = alpha
overlay.color = color
src.UpdateOverlays(overlay, "wet_overlay")
src.wet = wetType

SPAWN(timeout)
src.UpdateOverlays(null, "wet_overlay")
src.wet = 0

/turf/simulated/floor/grassify()
src.icon = 'icons/turf/outdoors.dmi'
src.icon_state = "grass"
Expand Down
1 change: 0 additions & 1 deletion code/turf/turf.dm
Expand Up @@ -39,7 +39,6 @@
/// this turf is allowing unrestricted hotbox reactions
var/tmp/allow_unrestricted_hotbox = FALSE
var/wet = 0
var/sticky = FALSE
throw_unlimited = FALSE //throws cannot stop on this tile if true (also makes space drift)

var/step_material = 0
Expand Down
Binary file modified icons/obj/foodNdrink/food_ingredient.dmi
Binary file not shown.
Binary file modified icons/obj/foodNdrink/food_meals.dmi
Binary file not shown.