diff --git a/code/game/turfs/simulated.dm b/code/game/turfs/simulated.dm index 35b92822b4..c226796cfd 100644 --- a/code/game/turfs/simulated.dm +++ b/code/game/turfs/simulated.dm @@ -19,25 +19,34 @@ var/special_temperature //Used for turf HE-Pipe interaction var/climbable = FALSE //Adds proc to wall if set to TRUE on its initialization, defined here since not all walls are subtypes of wall - var/icon_edge = 'icons/turf/outdoors_edge.dmi' //VOREStation Addition - Allows for alternative edge icon files + var/icon_edge = 'icons/turf/outdoors_edge.dmi' //Allows for alternative edge icon files + var/wet_cleanup_timer // This is not great. /turf/simulated/proc/wet_floor(var/wet_val = 1) if(wet > 2) //Can't mop up ice return - spawn(0) - wet = wet_val - if(wet_overlay) - cut_overlay(wet_overlay) - wet_overlay = image('icons/effects/water.dmi', icon_state = "wet_floor") - add_overlay(wet_overlay) - sleep(800) - if(wet == 2) - sleep(3200) - wet = 0 - if(wet_overlay) - cut_overlay(wet_overlay) - wet_overlay = null + wet = wet_val + if(wet_overlay) + cut_overlay(wet_overlay) + wet_overlay = image('icons/effects/water.dmi', icon_state = "wet_floor") + add_overlay(wet_overlay) + if(wet_cleanup_timer) + deltimer(wet_cleanup_timer) + wet_cleanup_timer = null + if(wet == 2) + wet_cleanup_timer = addtimer(CALLBACK(src, PROC_REF(wet_floor_finish)), 160 SECONDS, TIMER_STOPPABLE) + else + wet_cleanup_timer = addtimer(CALLBACK(src, PROC_REF(wet_floor_finish)), 40 SECONDS, TIMER_STOPPABLE) + +/turf/simulated/proc/wet_floor_finish() + wet = 0 + if(wet_cleanup_timer) + deltimer(wet_cleanup_timer) + wet_cleanup_timer = null + if(wet_overlay) + cut_overlay(wet_overlay) + wet_overlay = null /turf/simulated/proc/freeze_floor() if(!wet) // Water is required for it to freeze. @@ -66,7 +75,7 @@ levelupdate() if(climbable) verbs += /turf/simulated/proc/climb_wall - if(is_outdoors()) //VOREStation edit - quick fix for a planetary lighting issue + if(is_outdoors()) SSplanets.addTurf(src) /turf/simulated/examine(mob/user) @@ -92,8 +101,9 @@ /turf/simulated/Entered(atom/A, atom/OL) if (isliving(A)) + var/dirtslip = FALSE var/mob/living/M = A - if(M.lying || M.flying) //VOREStation Edit + if(M.lying || M.flying || M.is_incorporeal()) return ..() if(M.dirties_floor()) @@ -102,13 +112,17 @@ if(ishuman(M)) var/mob/living/carbon/human/H = M + dirtslip = H.species.dirtslip + if(H.species.mudking) + dirt = min(dirt+2, 101) + update_dirt() // Tracking blood var/list/bloodDNA = null var/bloodcolor="" if(H.shoes) var/obj/item/clothing/shoes/S = H.shoes if(istype(S)) - S.handle_movement(src,(H.m_intent == I_RUN ? 1 : 0)) + S.handle_movement(src,(H.m_intent == I_RUN ? 1 : 0), H) // handle_movement now needs to know who is moving, for inshoe steppies if(S.track_blood && S.blood_DNA) bloodDNA = S.blood_DNA bloodcolor=S.blood_color @@ -127,15 +141,21 @@ bloodDNA = null - if(src.wet) - + if(src.wet || (dirtslip && (dirt > 50 || outdoors == 1))) if(M.buckled || (src.wet == 1 && M.m_intent == I_WALK)) return var/slip_dist = 1 var/slip_stun = 6 var/floor_type = "wet" - + if(dirtslip) + slip_stun = 10 + if(dirt > 50) + floor_type = "dirty" + else if(outdoors) + floor_type = "uneven" + if(src.wet == 0 && M.m_intent == I_WALK) + return switch(src.wet) if(2) // Lube floor_type = "slippery" @@ -144,20 +164,32 @@ if(3) // Ice floor_type = "icy" slip_stun = 4 - slip_dist = 2 + slip_dist = rand(1,3) if(M.slip("the [floor_type] floor", slip_stun)) - for(var/i = 1 to slip_dist) - if(isbelly(M.loc)) //VOREEdit, Stop the slip if we're in a belly. Inspired by a chompedit, cleaned it up with isbelly instead of a variable since the var was resetting too fast. - return - step(M, M.dir) - sleep(1) + addtimer(CALLBACK(src, PROC_REF(handle_slipping), M, slip_dist, dirtslip), 0) else M.inertia_dir = 0 else M.inertia_dir = 0 ..() +/turf/simulated/proc/handle_slipping(var/mob/living/M, var/slip_dist, var/dirtslip) + PRIVATE_PROC(TRUE) + if(!M || !slip_dist) + return + if(isbelly(M.loc)) // Stop the slip if we're in a belly. + return + if(!step(M, M.dir) && !dirtslip) + return // done sliding, failed to move + // check tile for next slip + if(!dirtslip) + var/turf/simulated/ground = get_turf(M) + if(!istype(ground,/turf/simulated)) + return // stop sliding as it is impossible to be on wet terrain? + if(ground.wet != 2) + return // done sliding, not lubed + addtimer(CALLBACK(src, PROC_REF(handle_slipping), M, --slip_dist, dirtslip), 1) //returns 1 if made bloody, returns 0 otherwise /turf/simulated/add_blood(mob/living/carbon/human/M as mob) diff --git a/code/game/turfs/simulated/floor.dm b/code/game/turfs/simulated/floor.dm index eec0bede4b..a13648fd9f 100644 --- a/code/game/turfs/simulated/floor.dm +++ b/code/game/turfs/simulated/floor.dm @@ -109,6 +109,10 @@ /turf/simulated/floor/can_engrave() return (!flooring || flooring.can_engrave) +/turf/simulated/floor/proc/cause_slip(var/mob/living/M) + PROTECTED_PROC(TRUE) + return + /turf/simulated/floor/rcd_values(mob/living/user, obj/item/rcd/the_rcd, passed_mode) switch(passed_mode) if(RCD_FLOORWALL) diff --git a/code/game/turfs/simulated/outdoors/snow.dm b/code/game/turfs/simulated/outdoors/snow.dm index e6d9484429..c1f499c50b 100644 --- a/code/game/turfs/simulated/outdoors/snow.dm +++ b/code/game/turfs/simulated/outdoors/snow.dm @@ -4,10 +4,6 @@ edge_blending_priority = 6 movement_cost = 2 initial_flooring = /decl/flooring/snow - turf_layers = list( - /turf/simulated/floor/outdoors/rocks, - /turf/simulated/floor/outdoors/dirt - ) var/list/crossed_dirs = list() @@ -41,6 +37,8 @@ ..() /turf/simulated/floor/outdoors/snow/attack_hand(mob/user as mob) + if(!Adjacent(user)) + return visible_message("[user] starts scooping up some snow.", "You start scooping up some snow.") if(do_after(user, 1 SECOND)) var/obj/S = new /obj/item/stack/material/snow(user.loc) @@ -66,12 +64,15 @@ desc = "Dark rock that has been smoothened to be perfectly even. It's coated in a layer of slippey ice" /turf/simulated/floor/outdoors/ice/Entered(var/mob/living/M) - sleep(1 * world.tick_lag) if(isliving(M)) - if(M.stunned == 0) - to_chat(M, span_warning("You slide across the ice!")) - M.SetStunned(1) - step(M,M.dir) + if((M.weakened && prob(10)) || (M.m_intent == "walk" && prob(95))) + return ..() + addtimer(CALLBACK(src,TYPE_PROC_REF(/turf/simulated/floor/outdoors/ice,cause_slip),M), 1 * world.tick_lag, TIMER_DELETE_ME) +/turf/simulated/floor/outdoors/ice/cause_slip(var/mob/living/M) + if(M.weakened == 0) + to_chat(M, span_warning("You slide across the ice!")) + M.SetWeakened(3) + step(M,M.dir) // Ice that is used for, say, areas floating on water or similar. /turf/simulated/floor/outdoors/shelfice diff --git a/code/modules/assembly/signaler.dm b/code/modules/assembly/signaler.dm index a474c4b24f..87ded568b2 100644 --- a/code/modules/assembly/signaler.dm +++ b/code/modules/assembly/signaler.dm @@ -15,6 +15,7 @@ var/airlock_wire = null var/datum/wires/connected = null var/datum/radio_frequency/radio_connection + var/deadman = FALSE /obj/item/assembly/signaler/Initialize() . = ..() @@ -122,7 +123,11 @@ if(!frequency) return if(!radio_controller) - sleep(20) + addtimer(CALLBACK(src, PROC_REF(radio_checkup), new_frequency), 2 SECONDS) + + +/obj/item/assembly/signaler/proc/radio_checkup(new_frequency) + PROTECTED_PROC(TRUE) if(!radio_controller) return diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index e8bcb5c029..61102a0dd9 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -209,6 +209,7 @@ var/has_glowing_eyes = 0 // Whether the eyes are shown above all lighting var/water_movement = 0 // How much faster or slower the species is in water var/snow_movement = 0 // How much faster or slower the species is on snow + var/dirtslip = FALSE // If we slip over dirt or not. var/can_space_freemove = FALSE // Can we freely move in space? var/can_zero_g_move = FALSE // What about just in zero-g non-space? @@ -227,6 +228,8 @@ var/vanity_base_fit //when shapeshifting using vanity_copy_to, this allows you to have add something so they can go back to their original species fit + var/mudking = FALSE // If we dirty up tiles quicker + var/vore_belly_default_variant = "H" // Determines the organs that the species spawns with and diff --git a/code/modules/mob/living/carbon/human/species/station/traits_vr/negative.dm b/code/modules/mob/living/carbon/human/species/station/traits_vr/negative.dm index 6d3c506938..b8d1ff7b4b 100644 --- a/code/modules/mob/living/carbon/human/species/station/traits_vr/negative.dm +++ b/code/modules/mob/living/carbon/human/species/station/traits_vr/negative.dm @@ -194,3 +194,9 @@ var_changes = list("bad_swimmer" = 1, "water_movement" = 4, "swim_mult" = 1.25) varchange_type = TRAIT_VARCHANGE_LESS_BETTER excludes = list(/datum/trait/positive/good_swimmer) + +/datum/trait/negative/slipperydirt + name = "Dirt Vulnerability" + desc = "Even the tiniest particles of dirt give you uneasy footing, even through several layers of footwear." + cost = -5 + var_changes = list("dirtslip" = TRUE) diff --git a/code/modules/mob/living/carbon/human/species/station/traits_vr/neutral.dm b/code/modules/mob/living/carbon/human/species/station/traits_vr/neutral.dm index ccc43426a8..47dfae93d1 100644 --- a/code/modules/mob/living/carbon/human/species/station/traits_vr/neutral.dm +++ b/code/modules/mob/living/carbon/human/species/station/traits_vr/neutral.dm @@ -1216,3 +1216,10 @@ else input += "s" return input + +/datum/trait/neutral/mudking + name = "Mudking" + desc = "Somehow you are so filthy that tiles get dirty four times as quick from you walking on them." + cost = 0 + var_changes = list("mudking" = TRUE) + custom_only = FALSE