mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-20 12:29:23 +01:00
Mousetrap, mouse and spawning fixes (#1497)
Adjusts mousetraps a bit. So they'll be triggered by all mobs instead of only humans, and trigger when walked on. Also nerfs the instastun that comes from stepping on them without shoes, because that's pretty broken against giant monsters like vaurca breeders. applies halloss instead based on mob size. Smaller things get hurt more. Fixes #1445 Fixes #1449 Fixes #1450
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
name = "mousetrap"
|
||||
desc = "A handy little spring-loaded trap for catching pesty rodents."
|
||||
icon_state = "mousetrap"
|
||||
origin_tech = list(TECH_COMBAT = 1)
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 100, "waste" = 10)
|
||||
origin_tech = list(TECH_COMBAT = 1)
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 100, "waste" = 10)
|
||||
var/armed = 0
|
||||
|
||||
|
||||
@@ -20,29 +20,32 @@
|
||||
if(holder)
|
||||
holder.update_icon()
|
||||
|
||||
/obj/item/device/assembly/mousetrap/proc/triggered(mob/target as mob, var/type = "feet")
|
||||
if(!armed)
|
||||
/obj/item/device/assembly/mousetrap/proc/triggered(var/mob/living/target, var/type = "feet")
|
||||
if(!armed || !istype(target))
|
||||
return
|
||||
var/obj/item/organ/external/affecting = null
|
||||
if(ishuman(target))
|
||||
var/mob/living/carbon/human/H = target
|
||||
switch(type)
|
||||
if("feet")
|
||||
if(!H.shoes)
|
||||
affecting = H.get_organ(pick("l_leg", "r_leg"))
|
||||
H.Weaken(3)
|
||||
if("l_hand", "r_hand")
|
||||
if(!H.gloves)
|
||||
affecting = H.get_organ(type)
|
||||
H.Stun(3)
|
||||
if(affecting)
|
||||
if(affecting.take_damage(rand(7,12), 0))
|
||||
H.UpdateDamageIcon()
|
||||
H.updatehealth()
|
||||
else if(ismouse(target))
|
||||
|
||||
var/types = target.find_type()
|
||||
if(ismouse(target))
|
||||
var/mob/living/simple_animal/mouse/M = target
|
||||
visible_message("\red <b>SPLAT!</b>")
|
||||
M.splat()
|
||||
else
|
||||
var/zone = "chest"
|
||||
if(ishuman(target) && target.mob_size)
|
||||
var/mob/living/carbon/human/H = target
|
||||
switch(type)
|
||||
if("feet")
|
||||
zone = pick("l_foot", "r_foot")
|
||||
if(!H.shoes)
|
||||
H.apply_effect(400/(target.mob_size*(target.mob_size*0.25)), AGONY)//Halloss instead of instant knockdown
|
||||
//Mainly for the benefit of giant monsters like vaurca breeders
|
||||
if("l_hand", "r_hand")
|
||||
zone = type
|
||||
if(!H.gloves)
|
||||
H.apply_effect(250/(target.mob_size*(target.mob_size*0.25)), AGONY)
|
||||
if (!(types & TYPE_SYNTHETIC))
|
||||
target.apply_damage(rand(6,14), BRUTE, def_zone = zone, used_weapon = src)
|
||||
|
||||
playsound(target.loc, 'sound/effects/snap.ogg', 50, 1)
|
||||
layer = MOB_LAYER - 0.2
|
||||
armed = 0
|
||||
@@ -83,14 +86,14 @@
|
||||
|
||||
/obj/item/device/assembly/mousetrap/Crossed(AM as mob|obj)
|
||||
if(armed)
|
||||
if(ishuman(AM))
|
||||
var/mob/living/carbon/H = AM
|
||||
if(H.m_intent == "run")
|
||||
triggered(H)
|
||||
H.visible_message("<span class='warning'>[H] accidentally steps on [src].</span>", \
|
||||
"<span class='warning'>You accidentally step on [src]</span>")
|
||||
if(ismouse(AM))
|
||||
triggered(AM)
|
||||
else if(istype(AM, /mob/living))
|
||||
var/mob/living/L = AM
|
||||
triggered(L)
|
||||
L.visible_message("<span class='warning'>[L] accidentally steps on [src].</span>", \
|
||||
"<span class='warning'>You accidentally step on [src]</span>")
|
||||
|
||||
..()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user