[MIRROR] fixes arnold pizza not checking for TRAIT_NODISMEMBER (#343)

* fixes arnold pizza not checking for TRAIT_NODISMEMBER (#52771)

Fixed Arnold pizza not checking for TRAIT_NODISMEMBER, resulting in a message being sent to the user even if they were fine after eating it.

* fixes arnold pizza not checking for TRAIT_NODISMEMBER

Co-authored-by: ShizCalev <ShizCalev@users.noreply.github.com>
This commit is contained in:
SkyratBot
2020-08-14 23:30:45 +02:00
committed by GitHub
co-authored by ShizCalev
parent d9b246cca9
commit 669a33cc1f
@@ -178,17 +178,17 @@
tastes = list("crust" = 1, "tomato" = 1, "cheese" = 1, "pepperoni" = 2, "9 millimeter bullets" = 2)
value = FOOD_ILLEGAL
/obj/item/reagent_containers/food/snacks/proc/try_break_off(mob/living/M, mob/living/user) //maybe i'll give you a pizza, maybe i'll break off your arm
/obj/item/reagent_containers/food/snacks/proc/try_break_off(mob/living/M, mob/living/user) //maybe i give you a pizza maybe i break off your arm
if(prob(50) || (M != user) || !iscarbon(user) || HAS_TRAIT(user, TRAIT_NODISMEMBER))
return
var/obj/item/bodypart/l_arm = user.get_bodypart(BODY_ZONE_L_ARM)
var/obj/item/bodypart/r_arm = user.get_bodypart(BODY_ZONE_R_ARM)
if(prob(50) && iscarbon(user) && M == user && (r_arm || l_arm))
to_chat(user, "<span class='userdanger'>Maybe I'll give you a pizza, maybe I'll break off your arm.</span>") //makes the reference more obvious
user.visible_message("<span class='warning'>\The [src] breaks off [user]'s arm!</span>", "<span class='warning'>\The [src] breaks off your arm!</span>")
if(l_arm)
l_arm.dismember()
else
r_arm.dismember()
playsound(user, "desecration" ,50, TRUE, -1)
var/did_the_thing = (l_arm?.dismember() || r_arm?.dismember()) //not all limbs can be removed, so important to check that we did. the. thing.
if(!did_the_thing)
return
to_chat(user, "<span class='userdanger'>Maybe I'll give you a pizza, maybe I'll break off your arm.</span>") //makes the reference more obvious
user.visible_message("<span class='warning'>\The [src] breaks off [user]'s arm!</span>", "<span class='warning'>\The [src] breaks off your arm!</span>")
playsound(user, "desecration", 50, TRUE, -1)
/obj/item/reagent_containers/food/snacks/proc/i_kill_you(obj/item/I, mob/user)
if(istype(I, /obj/item/reagent_containers/food/snacks/pineappleslice))