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"
@@ -12,6 +12,19 @@
/obj/effect/decal/chempuff/blob_act(obj/structure/blob/B)
return
/obj/effect/decal/chempuff/proc/loop_ended(datum/source)
SIGNAL_HANDLER // COMSIG_PARENT_QDELETING
if(QDELETED(src))
return
qdel(src)
/obj/effect/decal/chempuff/proc/check_move(datum/move_loop/source, succeeded)
SIGNAL_HANDLER // COMSIG_MOVELOOP_POSTPROCESS
var/turf/our_turf = get_turf(src)
reagents.reaction(our_turf)
for(var/atom/T in our_turf)
reagents.reaction(T)
/obj/effect/decal/snow
name = "snow"
density = FALSE
@@ -1,3 +1,59 @@
/datum/effect_system/trail_follow
var/turf/oldposition
var/active = FALSE
var/allow_overlap = FALSE
var/auto_process = TRUE
var/qdel_in_time = 10
var/fadetype = "ion_fade"
var/fade = TRUE
var/nograv_required = FALSE
/datum/effect_system/trail_follow/set_up(atom/atom)
attach(atom)
oldposition = get_turf(atom)
/datum/effect_system/trail_follow/Destroy()
oldposition = null
stop()
return ..()
/datum/effect_system/trail_follow/proc/stop()
oldposition = null
STOP_PROCESSING(SSfastprocess, src)
active = FALSE
return TRUE
/datum/effect_system/trail_follow/start()
oldposition = get_turf(holder)
if(!check_conditions())
return FALSE
if(auto_process)
START_PROCESSING(SSfastprocess, src)
active = TRUE
return TRUE
/datum/effect_system/trail_follow/process()
generate_effect()
/datum/effect_system/trail_follow/generate_effect()
if(!check_conditions())
return stop()
if(oldposition && !(oldposition == get_turf(holder)))
if(!has_gravity(oldposition) || !nograv_required)
var/obj/effect/E = new effect_type(oldposition)
set_dir(E)
if(fade)
flick(fadetype, E)
E.icon_state = ""
if(qdel_in_time)
QDEL_IN(E, qdel_in_time)
oldposition = get_turf(holder)
/datum/effect_system/trail_follow/proc/check_conditions()
if(!get_turf(holder))
return FALSE
return TRUE
/// Ion trails for jetpacks, ion thrusters and other space-flying things
/obj/effect/particle_effect/ion_trails
name = "ion trails"
@@ -8,6 +64,17 @@
dir = targetdir
QDEL_IN(src, 0.6 SECONDS)
/datum/effect_system/trail_follow/ion
effect_type = /obj/effect/particle_effect/ion_trails
nograv_required = TRUE
qdel_in_time = 20
/datum/effect_system/trail_follow/proc/set_dir(obj/effect/particle_effect/ion_trails/I)
I.setDir(holder.dir)
/datum/effect_system/trail_follow/ion/grav_allowed
nograv_required = FALSE
//Reagent-based explosion effect
/datum/effect_system/reagents_explosion
var/amount // TNT equivalent
+5 -2
View File
@@ -97,7 +97,7 @@ GLOBAL_LIST_INIT(meteors_gore, list(/obj/effect/meteor/meaty = 5, /obj/effect/me
if(timerid)
deltimer(timerid)
GLOB.meteor_list -= src
walk(src, 0) //this cancels the walk_towards() proc
GLOB.move_manager.stop_looping(src) //this cancels the GLOB.move_manager.home_onto() proc
return ..()
/obj/effect/meteor/Initialize(mapload, target)
@@ -109,6 +109,9 @@ GLOBAL_LIST_INIT(meteors_gore, list(/obj/effect/meteor/meaty = 5, /obj/effect/me
timerid = QDEL_IN(src, lifetime)
chase_target(target)
/obj/effect/meteor/Process_Spacemove(movement_dir, continuous_move)
return TRUE
/obj/effect/meteor/Bump(atom/A)
if(A)
ram_turf(get_turf(A))
@@ -158,7 +161,7 @@ GLOBAL_LIST_INIT(meteors_gore, list(/obj/effect/meteor/meaty = 5, /obj/effect/me
/obj/effect/meteor/proc/chase_target(atom/chasing, delay = 1)
set waitfor = FALSE
if(chasing)
walk_towards(src, chasing, delay)
GLOB.move_manager.home_onto(src, chasing, delay)
/obj/effect/meteor/proc/meteor_effect()
if(heavy)
@@ -140,7 +140,7 @@
/obj/effect/spawner/random/bluespace_tap/cultural_rare
name = "rare cultural artifacts"
loot = list(
/obj/vehicle/space/speedbike/red,
/obj/tgvehicle/speedbike/red,
/obj/item/gun/projectile/automatic/l6_saw/toy,
/obj/item/gun/projectile/automatic/sniper_rifle/toy,
/obj/item/bedsheet/centcom,
@@ -181,8 +181,8 @@
/obj/vehicle/motorcycle,
/obj/vehicle/snowmobile,
/obj/vehicle/snowmobile/blue,
/obj/vehicle/space/speedbike/red,
/obj/vehicle/space/speedbike,
/obj/tgvehicle/speedbike/red,
/obj/tgvehicle/speedbike,
)
/obj/effect/spawner/random/traders/vehicle/make_item(spawn_loc, type_path_to_make)