mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
[MIRROR] Ice Sliding & Signaler code ( & dirtking and mudslip) (#10110)
Co-authored-by: Cameron Lennox <killer65311@gmail.com> Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
2894f64c83
commit
a12af10147
@@ -19,7 +19,7 @@
|
||||
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.
|
||||
@@ -47,7 +47,6 @@
|
||||
if(wet_overlay)
|
||||
cut_overlay(wet_overlay)
|
||||
wet_overlay = null
|
||||
//ChompEDIT END
|
||||
|
||||
/turf/simulated/proc/freeze_floor()
|
||||
if(!wet) // Water is required for it to freeze.
|
||||
@@ -76,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)
|
||||
@@ -102,9 +101,9 @@
|
||||
|
||||
/turf/simulated/Entered(atom/A, atom/OL)
|
||||
if (isliving(A))
|
||||
var/dirtslip = FALSE //CHOMPEdit
|
||||
var/dirtslip = FALSE
|
||||
var/mob/living/M = A
|
||||
if(M.lying || M.flying || M.is_incorporeal()) //VOREStation Edit - CHOMPADD - Don't forget the phased ones.
|
||||
if(M.lying || M.flying || M.is_incorporeal())
|
||||
return ..()
|
||||
|
||||
if(M.dirties_floor())
|
||||
@@ -113,19 +112,17 @@
|
||||
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
//CHOMPEdit Begin
|
||||
dirtslip = H.species.dirtslip
|
||||
if(H.species.mudking)
|
||||
dirt = min(dirt+2, 101)
|
||||
update_dirt()
|
||||
//CHOMPEdit End
|
||||
// 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), H) // CHOMPEdit handle_movement now needs to know who is moving, for inshoe steppies
|
||||
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
|
||||
@@ -144,15 +141,13 @@
|
||||
|
||||
bloodDNA = null
|
||||
|
||||
if(src.wet || (dirtslip && (dirt > 50 || outdoors == 1))) //CHOMPEdit
|
||||
|
||||
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"
|
||||
//CHOMPEdit Begin
|
||||
if(dirtslip)
|
||||
slip_stun = 10
|
||||
if(dirt > 50)
|
||||
@@ -161,7 +156,6 @@
|
||||
floor_type = "uneven"
|
||||
if(src.wet == 0 && M.m_intent == I_WALK)
|
||||
return
|
||||
//CHOMPEdit End
|
||||
switch(src.wet)
|
||||
if(2) // Lube
|
||||
floor_type = "slippery"
|
||||
@@ -170,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)
|
||||
|
||||
@@ -120,6 +120,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
|
||||
|
||||
/* CHOMPEdit - moved this block to modular_chomp\code\game\objects\items\weapons\rcd.dm
|
||||
/turf/simulated/floor/rcd_values(mob/living/user, obj/item/rcd/the_rcd, passed_mode)
|
||||
switch(passed_mode)
|
||||
|
||||
@@ -4,10 +4,6 @@
|
||||
edge_blending_priority = 6
|
||||
movement_cost = 2
|
||||
initial_flooring = /decl/flooring/snow
|
||||
/*turf_layers = list( CHOMP Removal Begin
|
||||
/turf/simulated/floor/outdoors/rocks,
|
||||
/turf/simulated/floor/outdoors/dirt
|
||||
) CHOMP Removal End*/
|
||||
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
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
var/airlock_wire = null
|
||||
var/datum/wires/connected = null
|
||||
var/datum/radio_frequency/radio_connection
|
||||
var/deadman = FALSE //CHOMPAdd
|
||||
var/deadman = FALSE
|
||||
|
||||
/obj/item/assembly/signaler/Initialize()
|
||||
. = ..()
|
||||
@@ -123,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
|
||||
|
||||
|
||||
@@ -239,6 +239,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?
|
||||
|
||||
@@ -257,6 +258,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
|
||||
|
||||
@@ -197,3 +197,10 @@
|
||||
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)
|
||||
excludes = list(/datum/trait/positive/absorbent) // CHOMPAdd
|
||||
|
||||
@@ -5,13 +5,6 @@
|
||||
/datum/trait/negative/hollow
|
||||
excludes = list(/datum/trait/positive/densebones)
|
||||
|
||||
/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)
|
||||
excludes = list(/datum/trait/positive/absorbent)
|
||||
|
||||
/datum/trait/negative/less_blood
|
||||
name = "Low Blood Volume"
|
||||
desc = "You have 33.3% less blood volume compared to most species, making you more prone to blood loss issues."
|
||||
|
||||
@@ -1225,3 +1225,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
|
||||
|
||||
@@ -37,13 +37,6 @@
|
||||
..()
|
||||
add_verb(H,/mob/living/carbon/proc/toggle_shrinking) //CHOMPEdit TGPanel
|
||||
|
||||
/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
|
||||
|
||||
/datum/trait/neutral/singularity_metabolism
|
||||
name = "Metabolism, Singularity"
|
||||
desc = "You are insanely hungry. You can seemingly never get enough to eat. Perhaps you had a singularity as an ancestor, or maybe one is currently living inside of your gut."
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/datum/species
|
||||
var/crit_mod = 1
|
||||
var/list/env_traits = list()
|
||||
var/dirtslip = FALSE
|
||||
var/photosynthesizing = FALSE
|
||||
var/grows = FALSE
|
||||
var/shrinks = FALSE
|
||||
@@ -13,7 +12,6 @@
|
||||
var/grab_power_victims = 0
|
||||
var/grab_power_self = 0
|
||||
var/waking_speed = 1
|
||||
var/mudking = FALSE
|
||||
var/lightweight_light = 0
|
||||
|
||||
/datum/species/handle_environment_special(var/mob/living/carbon/human/H)
|
||||
|
||||
Reference in New Issue
Block a user