Colourblind fixing fix (#16698)

This commit is contained in:
SabreML
2021-09-16 18:18:55 +01:00
committed by GitHub
parent 63b297a73c
commit ec1b49875f
5 changed files with 20 additions and 26 deletions
@@ -205,10 +205,9 @@ Difficulty: Very Hard
shoot_projectile(E)
/mob/living/simple_animal/hostile/megafauna/colossus/proc/telegraph()
for(var/mob/M in range(10,src))
if(M.client)
flash_color(M.client, "#C80000", 1)
shake_camera(M, 4, 3)
for(var/mob/M in range(10, src))
M.flash_screen_color("#C80000", 1)
shake_camera(M, 4, 3)
playsound(src, 'sound/magic/narsie_attack.ogg', 200, TRUE)
@@ -670,8 +670,7 @@ Difficulty: Hard
hit_things += L
if((friendly_fire_check && caster && caster.faction_check_mob(L)) || L.stat == DEAD)
continue
if(L.client)
flash_color(L.client, "#660099", 1)
L.flash_screen_color("#660099", 1)
playsound(L,'sound/weapons/sear.ogg', 50, TRUE, -4)
to_chat(L, "<span class='userdanger'>You're struck by a [name]!</span>")
var/limb_to_hit = L.get_organ(pick(BODY_ZONE_HEAD, BODY_ZONE_CHEST, BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_R_LEG, BODY_ZONE_L_LEG))
+14
View File
@@ -13,6 +13,7 @@
return 0
/mob/proc/get_screen_colour()
return
/mob/proc/update_client_colour(time = 10) //Update the mob's client.color with an animation the specified time in length.
if(!client) //No client_colour without client. If the player logs back in they'll be back through here anyway.
@@ -31,6 +32,19 @@
else if(eyes) //If they're not, check to see if their eyes got one of them there colour matrices. Will be null if eyes are robotic/the mob isn't colourblind and they have no default colour matrix.
return eyes.get_colourmatrix()
/**
* Flash up a color as an overlay on a player's screen, then fade back to normal.
*
* Arguments:
* * flash_color - The color to overlay on the screen.
* * flash_time - The time it takes for the color to fade back to normal.
*/
/mob/proc/flash_screen_color(flash_color, flash_time)
if(!client)
return
client.color = flash_color
INVOKE_ASYNC(client, /client/.proc/colour_transition, get_screen_colour(), flash_time)
/proc/ismindshielded(A) //Checks to see if the person contains a mindshield implant, then checks that the implant is actually inside of them
for(var/obj/item/implant/mindshield/L in A)
if(L && L.implanted)