Getting thrown into things actually hurts now [ready for review] (#21022)

* Getting thrown into things actually hurts now

* add the blob one too dingus

* more changes consoles windows ect

* fucking hell one sec

* now up to date

* Apply suggestions from code review

Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>

* early returns

* rename of proc

---------

Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>
This commit is contained in:
Qwertytoforty
2023-06-07 15:03:36 -04:00
committed by GitHub
parent 252bcfec3c
commit 89f8bba648
9 changed files with 86 additions and 24 deletions
+25
View File
@@ -499,6 +499,31 @@
if(exposed_temperature > (T0C + heat_resistance))
take_damage(round(exposed_volume / 100), BURN, 0, 0)
/obj/structure/window/hit_by_thrown_carbon(mob/living/carbon/human/C, datum/thrownthing/throwingdatum, damage, mob_hurt, self_hurt)
var/shattered = FALSE
if(damage * 2 >= obj_integrity && shardtype && !mob_hurt)
shattered = TRUE
var/obj/item/S = new shardtype(loc)
S.embedded_ignore_throwspeed_threshold = TRUE
S.throw_impact(C)
S.embedded_ignore_throwspeed_threshold = FALSE
damage *= (4/3) //Inverts damage loss from being a structure, since glass breaking on you hurts
var/turf/T = get_turf(src)
for(var/obj/structure/grille/G in T.contents)
var/obj/structure/cable/SC = T.get_cable_node()
if(SC)
playsound(G, 'sound/magic/lightningshock.ogg', 100, TRUE, extrarange = 5)
tesla_zap(G, 3, SC.get_queued_available_power() * 0.05, ZAP_MOB_DAMAGE | ZAP_OBJ_DAMAGE | ZAP_MOB_STUN | ZAP_ALLOW_DUPLICATES) //Zap for 1/20 of the amount of power, because I am evil.
SC.add_queued_power_demand(SC.get_queued_available_power() * 0.0375) // you can gain up to 3.5 via the 4x upgrades power is halved by the pole so thats 2x then 1X then .5X for 3.5x the 3 bounces shock.
qdel(G) //We don't want the grille to block the way, we want rule of cool of throwing people into space!
if(!self_hurt)
take_damage(damage * 2, BRUTE) //Makes windows more vunerable to being thrown so they'll actually shatter in a reasonable ammount of time.
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
/obj/structure/window/GetExplosionBlock()
return reinf && fulltile ? real_explosion_block : 0