mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +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
|
||||
|
||||
Reference in New Issue
Block a user