mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-23 21:12:24 +01:00
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:
co-authored by
SleepyGemmy
Matt Atlas
parent
49f340a999
commit
4db452cfa8
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user