Makes being thrown into airlocks/doors/machines hurt, mobs can now be thrown over railings. (#15054)

* Makes being thrown into airlocks/doors/machines hurt, mobs can now be thrown over railings.

* Apply suggestions from code review

Co-authored-by: SleepyGemmy <99297919+SleepyGemmy@users.noreply.github.com>

* Update code/game/machinery/machinery.dm

Co-authored-by: SleepyGemmy <99297919+SleepyGemmy@users.noreply.github.com>

Co-authored-by: Matt Atlas <liermattia@gmail.com>
Co-authored-by: SleepyGemmy <99297919+SleepyGemmy@users.noreply.github.com>
This commit is contained in:
Matt Atlas
2022-11-11 01:51:40 +01:00
committed by GitHub
co-authored by SleepyGemmy Matt Atlas
parent 49f340a999
commit 4db452cfa8
10 changed files with 74 additions and 11 deletions
+1 -1
View File
@@ -49,7 +49,7 @@
health -= 25
healthcheck()
/obj/structure/gore/hitby(atom/movable/AM)
/obj/structure/gore/hitby(atom/movable/AM, var/speed = THROWFORCE_SPEED_DIVISOR)
. = ..()
visible_message(SPAN_WARNING("\The [src] was hit by \the [AM]."))
playsound(loc, 'sound/effects/attackblob.ogg', 100, TRUE)
+2
View File
@@ -81,6 +81,8 @@
return TRUE
if(!istype(mover) || mover.checkpass(PASSRAILING))
return TRUE
if(mover.throwing)
return TRUE
if(get_dir(loc, target) == dir)
return !density
return TRUE
+10 -3
View File
@@ -171,16 +171,23 @@
return 0
return 1
/obj/structure/window/hitby(AM as mob|obj)
/obj/structure/window/hitby(AM as mob|obj, var/speed = THROWFORCE_SPEED_DIVISOR)
..()
visible_message(SPAN_DANGER("[src] was hit by [AM]."))
var/tforce = 0
if(ismob(AM))
if(isliving(AM))
var/mob/living/M = AM
M.turf_collision(src, speed, /decl/sound_category/glasscrack_sound)
return
else
visible_message(SPAN_DANGER("\The [src] was hit by \the [AM]."))
tforce = 40
else if(isobj(AM))
visible_message(SPAN_DANGER("\The [src] was hit by \the [AM]."))
var/obj/item/I = AM
tforce = I.throwforce
if(reinf) tforce *= 0.25
if(reinf)
tforce *= 0.25
if(health - tforce <= 7 && !reinf)
anchored = 0
update_nearby_icons()