Refactors throwing (#25946)

* refactors datum/thrownthing

* cleanup

* lewc review

* calling parent doesn't do anything lmao
This commit is contained in:
chuga-git
2024-06-26 16:03:51 -05:00
committed by GitHub
parent 936d19c0a0
commit da42a1c2f6
9 changed files with 173 additions and 92 deletions
+2 -1
View File
@@ -87,7 +87,8 @@
/obj/structure/holohoop/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum)
if(isitem(AM) && !isprojectile(AM))
if(prob(50) || HAS_TRAIT(throwingdatum.thrower, TRAIT_BADASS))
var/atom/movable/thrower = throwingdatum?.get_thrower()
if(prob(50) || HAS_TRAIT(thrower, TRAIT_BADASS))
AM.forceMove(get_turf(src))
visible_message("<span class='notice'>Swish! [AM] lands in [src].</span>")
else
+2 -2
View File
@@ -210,8 +210,8 @@
var/mob/living/victim = hit_atom
if(victim.incorporeal_move || victim.status_flags & GODMODE || HAS_TRAIT(victim, TRAIT_SUPERMATTER_IMMUNE)) //try to keep this in sync with supermatter's consume fail conditions
return ..()
if(throwingdatum?.thrower)
var/mob/user = throwingdatum.thrower
var/mob/user = throwingdatum?.get_thrower()
if(user)
add_attack_logs(user, victim, "[victim] consumed by [src] thrown by [user] ")
message_admins("[src] has consumed [key_name_admin(victim)] [ADMIN_JMP(src)], thrown by [key_name_admin(user)].")
investigate_log("has consumed [key_name(victim)], thrown by [key_name(user)]", "supermatter")
+1 -1
View File
@@ -490,7 +490,7 @@
self_hurt = TRUE
..()
if(shattered)
C.throw_at(throwingdatum.target, throwingdatum.maxrange - 1, throwingdatum.speed - 1) //Annnnnnnd yeet them into space, but slower, now that everything is dealt with
C.throw_at(locateUID(throwingdatum.initial_target_uid), throwingdatum.maxrange - 1, throwingdatum.speed - 1) //Annnnnnnd yeet them into space, but slower, now that everything is dealt with
/obj/structure/window/GetExplosionBlock()
return reinf && fulltile ? real_explosion_block : 0