mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
Merge pull request #43036 from BuffEngineering/sip-fix
Fixes non-shameful, nonlethal suicides
This commit is contained in:
committed by
yogstation13-bot
parent
91decdc8c8
commit
b8de7dbb9f
@@ -12,12 +12,13 @@
|
||||
#define BRAIN "brain"
|
||||
|
||||
//bitflag damage defines used for suicide_act
|
||||
#define BRUTELOSS (1<<0)
|
||||
#define FIRELOSS (1<<1)
|
||||
#define TOXLOSS (1<<2)
|
||||
#define OXYLOSS (1<<3)
|
||||
#define SHAME (1<<4)
|
||||
#define MANUAL_SUICIDE (1<<5) //suicide_act will do the actual killing.
|
||||
#define BRUTELOSS (1<<0)
|
||||
#define FIRELOSS (1<<1)
|
||||
#define TOXLOSS (1<<2)
|
||||
#define OXYLOSS (1<<3)
|
||||
#define SHAME (1<<4)
|
||||
#define MANUAL_SUICIDE (1<<5) //suicide_act will do the actual killing.
|
||||
#define MANUAL_SUICIDE_NONLETHAL (1<<6) //when the suicide is conditionally lethal
|
||||
|
||||
#define EFFECT_STUN "stun"
|
||||
#define EFFECT_KNOCKDOWN "knockdown"
|
||||
|
||||
@@ -21,12 +21,14 @@
|
||||
playsound(src, 'sound/items/eatfood.ogg', 50, TRUE)
|
||||
user.transferItemToLoc(src, user, TRUE)
|
||||
suicider = user
|
||||
return MANUAL_SUICIDE
|
||||
return MANUAL_SUICIDE_NONLETHAL
|
||||
|
||||
/obj/item/assembly/signaler/proc/manual_suicide(mob/living/carbon/user)
|
||||
user.visible_message("<span class='suicide'>[user]'s \the [src] receives a signal, killing [user.p_them()] instantly!</span>")
|
||||
user.adjustOxyLoss(200)//it sends an electrical pulse to their heart, killing them. or something.
|
||||
user.death(0)
|
||||
user.set_suicide(TRUE)
|
||||
user.suicide_log()
|
||||
|
||||
/obj/item/assembly/signaler/Initialize()
|
||||
. = ..()
|
||||
|
||||
@@ -39,17 +39,19 @@
|
||||
if(!canSuicide())
|
||||
return
|
||||
if(confirm == "Yes")
|
||||
set_suicide(TRUE)
|
||||
var/obj/item/held_item = get_active_held_item()
|
||||
if(held_item)
|
||||
var/damagetype = held_item.suicide_act(src)
|
||||
if(damagetype)
|
||||
if(damagetype & SHAME)
|
||||
adjustStaminaLoss(200)
|
||||
set_suicide(FALSE)
|
||||
SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "shameful_suicide", /datum/mood_event/shameful_suicide)
|
||||
return
|
||||
|
||||
if(damagetype & MANUAL_SUICIDE_NONLETHAL) //Make sure to call the necessary procs if it does kill later
|
||||
return
|
||||
|
||||
set_suicide(TRUE)
|
||||
suicide_log()
|
||||
|
||||
var/damage_mod = 0
|
||||
@@ -103,6 +105,7 @@
|
||||
|
||||
visible_message("<span class='danger'>[suicide_message]</span>", "<span class='userdanger'>[suicide_message]</span>")
|
||||
|
||||
set_suicide(TRUE)
|
||||
suicide_log()
|
||||
|
||||
adjustOxyLoss(max(200 - getToxLoss() - getFireLoss() - getBruteLoss() - getOxyLoss(), 0))
|
||||
|
||||
@@ -417,7 +417,7 @@
|
||||
sleep(50)
|
||||
playsound(H,'sound/items/drink.ogg', 80, 1)
|
||||
H.say(pick("Another day, another dollar.", "I wonder if I should hold?", "Diversifying is for young'ns.", "Yeap, times were good back then."))
|
||||
return MANUAL_SUICIDE
|
||||
return MANUAL_SUICIDE_NONLETHAL
|
||||
sleep(20) //dramatic pause
|
||||
return TOXLOSS
|
||||
|
||||
|
||||
@@ -323,7 +323,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
|
||||
user.visible_message("<span class='suicide'>[user] couldn't flip \the [src]!</span>")
|
||||
return SHAME
|
||||
addtimer(CALLBACK(src, .proc/manual_suicide, user), 10)//10 = time takes for flip animation
|
||||
return MANUAL_SUICIDE
|
||||
return MANUAL_SUICIDE_NONLETHAL
|
||||
|
||||
/obj/item/coin/proc/manual_suicide(mob/living/user)
|
||||
var/index = sideslist.Find(coinflip)
|
||||
@@ -331,6 +331,8 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
|
||||
user.visible_message("<span class='suicide'>\the [src] lands on [coinflip]! [user] promptly falls over, dead!</span>")
|
||||
user.adjustOxyLoss(200)
|
||||
user.death(0)
|
||||
user.set_suicide(TRUE)
|
||||
user.suicide_log()
|
||||
else
|
||||
user.visible_message("<span class='suicide'>\the [src] lands on [coinflip]! [user] keeps on living!</span>")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user