Port /tg/ move manager, drift and jetpack components. (#27698)

* Port /tg/ move manager, drift and jetpack components.

* don't add go through newtonian movement if not moved to a turf

* various cleans for blood drifts and mob speed

* fix slow meteors

* why on fuck's earth aren't speedbikes vehicles

* style lint

* also wtf

* okay i'm an idiot

* fix meaty ore speed and blood decal double stepping

* fix not unbuckling pulled object occupants

* don't bother dealing with immovable rods just yet

* exclude bubblegum and vetus from move manager for now

* fix issues related to null weightless blood icons

* reset blood icon state properly

* fuck it, we'll deal with mobs when basic mobs happen

* break infinite loop in decal splat
This commit is contained in:
warriorstar-orion
2025-01-22 22:49:58 +00:00
committed by GitHub
parent 3954981ff2
commit 157276d6cb
105 changed files with 2366 additions and 538 deletions
@@ -2,7 +2,7 @@
name = "xeno blood"
desc = "It's green and acidic. It looks like... <i>blood?</i>"
icon = 'icons/effects/blood.dmi'
basecolor = "#05EE05"
basecolor = COLOR_BLOOD_XENO
bloodiness = BLOOD_AMOUNT_PER_DECAL
blood_state = BLOOD_STATE_XENO
@@ -15,11 +15,7 @@
desc = "Gnarly..."
icon_state = "xgib1"
random_icon_states = list("xgib1", "xgib2", "xgib3", "xgib4", "xgib5", "xgib6")
basecolor = "#05EE05"
/obj/effect/decal/cleanable/blood/gibs/xeno/update_icon()
color = "#FFFFFF"
. = ..(NONE)
basecolor = COLOR_BLOOD_XENO
/obj/effect/decal/cleanable/blood/gibs/xeno/up
random_icon_states = list("xgib1", "xgib2", "xgib3", "xgib4", "xgib5", "xgib6", "xgibup1", "xgibup1", "xgibup1")
@@ -37,7 +33,7 @@
random_icon_states = list("xgibmid1", "xgibmid2", "xgibmid3")
/obj/effect/decal/cleanable/blood/xtracks
basecolor = "#05EE05"
basecolor = COLOR_BLOOD_XENO
/// this is the alien blood file, slimes are aliens.
/obj/effect/decal/cleanable/blood/slime
@@ -14,6 +14,7 @@
random_icon_states = list("mfloor1", "mfloor2", "mfloor3", "mfloor4", "mfloor5", "mfloor6", "mfloor7")
blood_DNA = list()
var/base_icon = 'icons/effects/blood.dmi'
base_icon_state = "mfloor1"
var/blood_state = BLOOD_STATE_HUMAN
bloodiness = BLOOD_AMOUNT_PER_DECAL
var/basecolor = "#A10808" // Color when wet.
@@ -21,7 +22,8 @@
var/dry_timer = 0
var/off_floor = FALSE
var/image/weightless_image
inertia_move_delay = 1 // so they dont collide with who emitted them
var/weightless_icon = 'icons/effects/blood_weightless.dmi'
inertia_move_delay = 5 // so they dont collide with who emitted them
/obj/effect/decal/cleanable/blood/replace_decal(obj/effect/decal/cleanable/blood/C)
if(C == src)
@@ -33,18 +35,32 @@
C.bloodiness += bloodiness
return ..()
/obj/effect/decal/cleanable/blood/Initialize(mapload)
/obj/effect/decal/cleanable/blood/Initialize(mapload, decal_color)
. = ..()
weightless_image = new()
if(decal_color)
basecolor = decal_color
else
if(basecolor == "rainbow")
basecolor = "#[pick("FF0000","FF7F00","FFFF00","00FF00","0000FF","4B0082","8F00FF")]"
color = basecolor
base_icon_state = icon_state
var/turf/T = get_turf(src)
check_gravity(T)
update_icon()
if(!gravity_check)
if(gravity_check)
if(!. && !QDELETED(src))
dry_timer = addtimer(CALLBACK(src, PROC_REF(dry)), DRYING_TIME * (amount+1), TIMER_STOPPABLE)
else
if(prob(50))
animate_float(src, -1, rand(30,120))
else
animate_levitate(src, -1, rand(30,120))
//weightless blood cannot dry
return
if(!. && !QDELETED(src))
dry_timer = addtimer(CALLBACK(src, PROC_REF(dry)), DRYING_TIME * (amount+1), TIMER_STOPPABLE)
var/static/list/loc_connections = list(
COMSIG_ATOM_ENTERED = PROC_REF(on_atom_entered),
)
@@ -56,38 +72,32 @@
QDEL_NULL(weightless_image)
return ..()
/obj/effect/decal/cleanable/blood/update_icon()
var/turf/T = get_turf(src)
check_gravity(T)
/obj/effect/decal/cleanable/blood/update_overlays()
. = ..()
if(gravity_check)
return
if(!weightless_image)
color = COLOR_WHITE
weightless_image = image(weightless_icon, base_icon_state)
weightless_image.icon += basecolor
. += weightless_image
/obj/effect/decal/cleanable/blood/update_icon()
if(should_be_off_floor())
off_floor = TRUE
layer = ABOVE_MOB_LAYER
plane = GAME_PLANE
if(basecolor == "rainbow")
basecolor = "#[pick("FF0000","FF7F00","FFFF00","00FF00","0000FF","4B0082","8F00FF")]"
color = basecolor
if(!gravity_check)
if(prob(50))
animate_float(src, -1, rand(30,120))
else
animate_levitate(src, -1, rand(30,120))
if(weightless_image && weightless_image.icon_state)
icon_state = weightless_image.icon_state
overlays -= weightless_image
color = "#FFFFFF"
icon = 'icons/effects/blood_weightless.dmi'
weightless_image = image(icon, icon_state)
icon_state = "empty"
weightless_image.icon += basecolor
overlays += weightless_image
if(gravity_check)
icon = initial(icon)
icon_state = base_icon_state
color = basecolor
else
overlays.Cut()
icon_state = null
..()
/obj/effect/decal/cleanable/blood/proc/should_be_off_floor()
@@ -116,32 +126,17 @@
return
if(loc != T)
forceMove(T) //move to the turf to splatter on
animate(src) //stop floating
gravity_check = ALWAYS_IN_GRAVITY
icon = initial(icon)
icon_state = weightless_image.icon_state
layer = initial(layer)
plane = initial(plane)
animate(src)
update_icon()
/obj/effect/decal/cleanable/blood/Process_Spacemove(movement_dir)
/obj/effect/decal/cleanable/blood/Process_Spacemove(movement_dir = 0, continuous_move = FALSE)
if(gravity_check)
return TRUE
if(has_gravity(src))
if(!gravity_check)
splat(get_step(src, movement_dir))
return TRUE
if(pulledby && !pulledby.pulling)
return TRUE
if(throwing)
return TRUE
return FALSE
return ..()
/obj/effect/decal/cleanable/blood/Bump(atom/A)
if(gravity_check)
@@ -162,8 +157,11 @@
return ..()
/obj/effect/decal/cleanable/blood/proc/bloodyify_human(mob/living/carbon/human/H)
if(inertia_dir && H.inertia_dir == inertia_dir) //if they are moving the same direction we are, no collison
return
// Originally this code would check to see if both us and the human
// we collided with had inertia in the same direction, and avoided collision
// if so. This might be possible with movement loops but, realistically,
// if we've gotten here, the objects have collided no matter what direction
// they were going in.
var/list/obj/item/things_to_potentially_bloody = list()
var/count = amount + 1
@@ -317,17 +315,21 @@
mergeable_decal = TRUE
/obj/effect/decal/cleanable/blood/gibs/proc/streak(list/directions)
set waitfor = 0
var/delay = 2
var/range = pick(1, 200; 2, 150; 3, 50; 4)
var/direction = pick(directions)
for(var/i = 0, i < pick(1, 200; 2, 150; 3, 50; 4), i++)
sleep(3)
if(i > 0)
var/obj/effect/decal/cleanable/blood/b = new /obj/effect/decal/cleanable/blood/splatter(loc)
b.basecolor = src.basecolor
b.update_icon()
if(step_to(src, get_step(src, direction), 0))
break
var/datum/move_loop/loop = GLOB.move_manager.move_to(src, get_step(src, direction), delay = delay, timeout = range * delay, priority = MOVEMENT_ABOVE_SPACE_PRIORITY)
RegisterSignal(loop, COMSIG_MOVELOOP_POSTPROCESS, PROC_REF(spread_movement_effects))
/obj/effect/decal/cleanable/blood/gibs/proc/spread_movement_effects(datum/move_loop/has_target/source)
SIGNAL_HANDLER // COMSIG_MOVELOOP_POSTPROCESS
var/obj/effect/decal/cleanable/blood/target = source.target
var/obj/effect/decal/cleanable/blood/splatter/splatter = new(loc, istype(target) ? target.basecolor : basecolor)
if(istype(target))
splatter.basecolor = target.basecolor
splatter.update_icon()
/obj/effect/decal/cleanable/blood/old/Initialize(mapload)
. = ..()
@@ -159,9 +159,8 @@
/obj/effect/decal/cleanable/vomit/Initialize(mapload)
. = ..()
var/turf/T = get_turf(src)
gravity_check = has_gravity(src, T)
if(loc != T)
forceMove(T)
check_gravity(T)
if(!gravity_check)
layer = MOB_LAYER
plane = GAME_PLANE
@@ -177,9 +176,17 @@
AddElement(/datum/element/connect_loc, loc_connections)
/obj/effect/decal/cleanable/vomit/Bump(atom/A)
. = ..()
if(A.density)
if(gravity_check)
return ..()
if(iswallturf(A) || istype(A, /obj/structure/window))
splat(A)
return
else if(A.density)
splat(get_turf(A))
return
return ..()
/obj/effect/decal/cleanable/vomit/proc/on_atom_entered(datum/source, atom/movable/entered)
if(!gravity_check)
@@ -204,22 +211,11 @@
plane = initial(plane)
animate(src)
/obj/effect/decal/cleanable/vomit/Process_Spacemove(movement_dir)
/obj/effect/decal/cleanable/vomit/Process_Spacemove(movement_dir = 0, continuous_move = FALSE)
if(gravity_check)
return 1
return TRUE
if(has_gravity(src))
if(!gravity_check)
splat(get_step(src, movement_dir))
return 1
if(pulledby && !pulledby.pulling)
return 1
if(throwing)
return 1
return 0
return ..()
/obj/effect/decal/cleanable/vomit/green
name = "green vomit"