Fixes bloodbath effects not working on people in crit (#36598)

Also some minor improvements to performance by caching the nearby mobs list once
This commit is contained in:
kevinz000
2018-04-03 17:08:52 -07:00
committed by CitadelStationBot
parent 5dddb2db45
commit 4fb2e612df
3 changed files with 12 additions and 9 deletions

View File

@@ -123,8 +123,8 @@
to_chat(victim, "<span class='reallybig redtext'>RIP AND TEAR</span>")
SEND_SOUND(victim, sound('sound/misc/e1m1.ogg'))
var/old_color = victim.client.color
var/red_splash = list(1,0,0,0.8,0.2,0, 0.8,0,0.2,0.1,0,0)
var/pure_red = list(0,0,0,0,0,0,0,0,0,1,0,0)
var/static/list/red_splash = list(1,0,0,0.8,0.2,0, 0.8,0,0.2,0.1,0,0)
var/static/list/pure_red = list(0,0,0,0,0,0,0,0,0,1,0,0)
spawn(0)
new /datum/hallucination/delusion(victim, TRUE, "demon",duration,0)
@@ -132,7 +132,7 @@
var/obj/item/twohanded/required/chainsaw/doomslayer/chainsaw = new(victim.loc)
chainsaw.flags_1 |= NODROP_1
victim.drop_all_held_items()
victim.put_in_hands(chainsaw)
victim.put_in_hands(chainsaw, forced = TRUE)
chainsaw.attack_self(victim)
chainsaw.wield(victim)
victim.reagents.add_reagent("adminordrazine",25)

View File

@@ -471,10 +471,13 @@ GLOBAL_LIST_INIT(hallucinations_major, list(
var/image/A = null
var/kind = force_kind ? force_kind : pick("monkey","corgi","carp","skeleton","demon","zombie")
feedback_details += "Type: [kind]"
var/list/nearby
if(skip_nearby)
nearby = get_hearers_in_view(7, target)
for(var/mob/living/carbon/human/H in GLOB.alive_mob_list)
if(H == target)
continue
if(skip_nearby && (H in view(target)))
if(skip_nearby && (H in nearby))
continue
switch(kind)
if("monkey")//Monkey

View File

@@ -208,8 +208,8 @@
//Puts the item into our active hand if possible. returns TRUE on success.
/mob/proc/put_in_active_hand(obj/item/I)
return put_in_hand(I, active_hand_index)
/mob/proc/put_in_active_hand(obj/item/I, forced = FALSE)
return put_in_hand(I, active_hand_index, forced)
//Puts the item into our inactive hand if possible, returns TRUE on success
@@ -220,7 +220,7 @@
//Puts the item our active hand if possible. Failing that it tries other hands. Returns TRUE on success.
//If both fail it drops it on the floor and returns FALSE.
//This is probably the main one you need to know :)
/mob/proc/put_in_hands(obj/item/I, del_on_fail = FALSE, merge_stacks = TRUE)
/mob/proc/put_in_hands(obj/item/I, del_on_fail = FALSE, merge_stacks = TRUE, forced = FALSE)
if(!I)
return FALSE
@@ -244,14 +244,14 @@
to_chat(usr, "<span class='notice'>Your [inactive_stack.name] stack now contains [inactive_stack.get_amount()] [inactive_stack.singular_name]\s.</span>")
return TRUE
if(put_in_active_hand(I))
if(put_in_active_hand(I, forced))
return TRUE
var/hand = get_empty_held_index_for_side("l")
if(!hand)
hand = get_empty_held_index_for_side("r")
if(hand)
if(put_in_hand(I, hand))
if(put_in_hand(I, hand, forced))
return TRUE
if(del_on_fail)
qdel(I)