mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-21 11:07:12 +01:00
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:
@@ -297,3 +297,13 @@
|
||||
// In the event that the object doesn't have an overriden version of this proc to do it, log a runtime so one can be added.
|
||||
CRASH("Proc force_eject_occupant() is not overridden on a machine containing a mob.")
|
||||
|
||||
/obj/hit_by_thrown_carbon(mob/living/carbon/human/C, datum/thrownthing/throwingdatum, damage, mob_hurt, self_hurt)
|
||||
damage *= 0.75 //Define this probably somewhere, we want objects to hurt less than walls, unless special impact effects.
|
||||
playsound(src, 'sound/weapons/punch1.ogg', 35, 1)
|
||||
if(mob_hurt) //Density check probably not needed, one should only bump into something if it is dense, and blob tiles are not dense, because of course they are not.
|
||||
return
|
||||
C.visible_message("<span class='danger'>[C] slams into [src]!</span>", "<span class='userdanger'>You slam into [src]!</span>")
|
||||
C.take_organ_damage(damage)
|
||||
if(!self_hurt)
|
||||
take_damage(damage, BRUTE)
|
||||
C.KnockDown(3 SECONDS)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user