SSthrowing (#19421)

Ported SSThrowing from TG, to handle throwings.
Updated movement system to the latest iteration, made it a datum as per
latest iteration.
Updated pass/hit handling of atoms, introduced pass_flag_self to
determine what atoms allow to pass.
Moved procs and defines around to make them more organized.
This commit is contained in:
Fluffy
2024-06-18 19:32:06 +00:00
committed by GitHub
parent 56a7300903
commit 92c3ec6caf
96 changed files with 1125 additions and 496 deletions
@@ -42,18 +42,18 @@
icon_state = icon_flight
underlays.Cut()
/obj/item/syringe_cartridge/throw_impact(atom/hit_atom, var/speed)
/obj/item/syringe_cartridge/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
..() //handles embedding for us. Should have a decent chance if thrown fast enough
if(syringe)
//check speed to see if we hit hard enough to trigger the rapid injection
//incidentally, this means syringe_cartridges can be used with the pneumatic launcher
if(speed >= 10 && isliving(hit_atom))
if(throwingdatum.speed >= 10 && isliving(hit_atom))
var/mob/living/L = hit_atom
//unfortuately we don't know where the dart will actually hit, since that's done by the parent.
if(L.can_inject() && syringe.reagents)
var/singleton/reagent/reagent_log = syringe.reagents.get_reagents()
syringe.reagents.trans_to_mob(L, 15, CHEM_BLOOD)
admin_inject_log(thrower, L, src, reagent_log, syringe.reagents.get_temperature(), 15, violent=1)
admin_inject_log(throwing?.thrower?.resolve(), L, src, reagent_log, syringe.reagents.get_temperature(), 15, violent=1)
syringe.break_syringe(iscarbon(hit_atom)? hit_atom : null)
syringe.update_icon()
@@ -82,7 +82,6 @@
/obj/item/projectile/bullet/gyro/law/on_hit(var/atom/target, var/blocked = 0)
explosion(target, -1, 0, 2)
sleep(0)
var/obj/T = target
var/throwdir = get_dir(firer,target)
T.throw_at(get_edge_target_turf(target, throwdir),3,3)
@@ -118,8 +117,6 @@
loc = A.loc
return
sleep(-1) //Might not be important enough for a sleep(-1) but the sleep/spawn itself is necessary thanks to explosions and metoerhits
if(src)//Do not add to this if() statement, otherwise the meteor won't delete them
if(A)