mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-23 13:05:44 +01:00
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:
@@ -74,17 +74,17 @@
|
||||
|
||||
return last_increment
|
||||
|
||||
/obj/item/reagent_containers/throw_impact(atom/hit_atom, var/speed)
|
||||
/obj/item/reagent_containers/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
|
||||
. = ..()
|
||||
if(ismob(loc))
|
||||
return
|
||||
if(fragile && (speed >= fragile))
|
||||
if(fragile && (throwingdatum.speed >= fragile))
|
||||
shatter()
|
||||
if(atom_flags && ATOM_FLAG_NO_REACT)
|
||||
return
|
||||
if(!reagents)
|
||||
return
|
||||
reagents.apply_force(speed)
|
||||
reagents.apply_force(throwingdatum.speed)
|
||||
|
||||
/obj/item/reagent_containers/proc/shatter(var/obj/item/W, var/mob/user)
|
||||
if(reagents?.total_volume)
|
||||
|
||||
@@ -33,13 +33,13 @@
|
||||
return ..()
|
||||
|
||||
//when thrown on impact, bottles smash and spill their contents
|
||||
/obj/item/reagent_containers/food/drinks/bottle/throw_impact(atom/hit_atom, var/speed)
|
||||
/obj/item/reagent_containers/food/drinks/bottle/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
|
||||
..()
|
||||
|
||||
var/mob/M = thrower
|
||||
var/mob/M = throwing?.thrower?.resolve()
|
||||
if((drink_flags & IS_GLASS) && istype(M) && M.a_intent == I_HURT)
|
||||
var/throw_dist = get_dist(throw_source, loc)
|
||||
if(speed >= throw_speed && smash_check(throw_dist)) //not as reliable as smashing directly
|
||||
var/throw_dist = get_dist(throwing?.thrower?.resolve(), loc)
|
||||
if(throwingdatum.speed >= throw_speed && smash_check(throw_dist)) //not as reliable as smashing directly
|
||||
if(reagents)
|
||||
hit_atom.visible_message(SPAN_NOTICE("The contents of \the [src] splash all over [hit_atom]!"))
|
||||
reagents.splash(hit_atom, reagents.total_volume)
|
||||
|
||||
Reference in New Issue
Block a user