Implements Status Indicators

This commit is contained in:
Atermonera
2020-07-30 12:29:46 -07:00
committed by VirgoBot
parent daa3307d25
commit 65cfe5f6e3
39 changed files with 311 additions and 68 deletions

View File

@@ -138,6 +138,8 @@ What is the naming convention for planes or layers?
#define PLANE_MESONS 30 //Stuff seen with mesons, like open ceilings. This is 30 for downstreams.
#define PLANE_STATUS 31 //Status Indicators that show over mobs' heads when certain things like stuns affect them.
#define PLANE_ADMIN2 33 //Purely for shenanigans (above lighting)
#define PLANE_BUILDMODE 39 //Things that only show up when you have buildmode on

View File

@@ -399,7 +399,9 @@
#define VIS_CLOAKED 23
#define VIS_COUNT 23 //Must be highest number from above.
#define VIS_STATUS 24
#define VIS_COUNT 24 //Must be highest number from above.
//Some mob icon layering defines
#define BODY_LAYER -100

View File

@@ -19,6 +19,8 @@
var/icon_scale_x = 1 // Used to scale icons up or down horizonally in update_transform().
var/icon_scale_y = 1 // Used to scale icons up or down vertically in update_transform().
var/icon_rotation = 0 // Used to rotate icons in update_transform()
var/icon_expected_height = 32
var/icon_expected_width = 32
var/old_x = 0
var/old_y = 0
var/datum/riding/riding_datum = null
@@ -561,6 +563,14 @@
return null
return text2num(pickweight(candidates))
// Returns the current scaling of the sprite.
// Note this DOES NOT measure the height or width of the icon, but returns what number is being multiplied with to scale the icons, if any.
/atom/movable/proc/get_icon_scale_x()
return icon_scale_x
/atom/movable/proc/get_icon_scale_y()
return icon_scale_y
/atom/movable/proc/update_transform()
var/matrix/M = matrix()
M.Scale(icon_scale_x, icon_scale_y)

View File

@@ -83,7 +83,7 @@
for(var/mob/living/carbon/M in ohearers(6, T))
if(M.get_ear_protection() >= 2)
continue
M.sleeping = 0
M.SetSleeping(0)
M.stuttering += 20
M.ear_deaf += 30
M.Weaken(3)

View File

@@ -216,7 +216,7 @@
occupant.set_stat(UNCONSCIOUS)
occupant.dir = SOUTH
if(occupant.bodytemperature < T0C)
occupant.sleeping = max(5, (1/occupant.bodytemperature)*2000)
occupant.Sleeping(max(5, (1/occupant.bodytemperature)*2000))
occupant.Paralyse(max(5, (1/occupant.bodytemperature)*3000))
if(air_contents.gas["oxygen"] > 2)
if(occupant.getOxyLoss()) occupant.adjustOxyLoss(-1)

View File

@@ -221,7 +221,7 @@
for(var/mob/living/carbon/M in ohearers(6, src))
if(M.get_ear_protection() >= 2)
continue
M.sleeping = 0
M.SetSleeping(0)
M.stuttering += 20
M.ear_deaf += 30
M.Weaken(3)

View File

@@ -26,7 +26,7 @@
return
to_chat(M, "<span class='warning'>Your ears feel like they're bleeding!</span>")
playsound(M, 'sound/effects/bang.ogg', 70, 1, 30)
M.sleeping = 0
M.SetSleeping(0)
M.ear_deaf += 30
M.ear_damage += rand(5, 20)
M.Weaken(3)

View File

@@ -138,7 +138,7 @@
for(var/mob/living/carbon/M in oviewers(4, T))
if(M.get_ear_protection() >= 2)
continue
M.sleeping = 0
M.SetSleeping(0)
M.stuttering += 20
M.ear_deaf += 30
M.Weaken(3)

View File

@@ -1468,12 +1468,12 @@ var/datum/announcement/minor/admin_min_announcer = new
if(check_rights(R_ADMIN|R_MOD|R_EVENT))
if (H.paralysis == 0)
H.paralysis = 8000
H.SetParalysis(8000)
msg = "has paralyzed [key_name(H)]."
log_and_message_admins(msg)
else
if(alert(src, "[key_name(H)] is paralyzed, would you like to unparalyze them?",,"Yes","No") == "Yes")
H.paralysis = 0
H.SetParalysis(0)
msg = "has unparalyzed [key_name(H)]."
log_and_message_admins(msg)

View File

@@ -266,6 +266,18 @@ var/list/_client_preferences_by_type
enabled_description = "Enabled"
disabled_description = "Disabled"
/datum/client_preference/status_indicators
description = "Status Indicators"
key = "SHOW_STATUS"
enabled_description = "Show"
disabled_description = "Hide"
/datum/client_preference/status_indicators/toggled(mob/preference_mob, enabled)
. = ..()
if(preference_mob && preference_mob.plane_holder)
var/datum/plane_holder/PH = preference_mob.plane_holder
PH.set_vis(VIS_STATUS, enabled)
/********************
* Staff Preferences *
********************/

View File

@@ -334,6 +334,19 @@
You will have to reload VChat and/or reconnect to the server for these changes to take place. \
VChat message persistence is not guaranteed if you change this again before the start of the next round.")
/client/verb/toggle_status_indicators()
set name = "Toggle Status Indicators"
set category = "Preferences"
set desc = "Enable/Disable seeing status indicators over peoples' heads."
var/pref_path = /datum/client_preference/status_indicators
toggle_preference(pref_path)
SScharacter_setup.queue_preferences_save(prefs)
to_chat(src, "You will now [(is_preference_enabled(/datum/client_preference/status_indicators)) ? "see" : "not see"] status indicators.")
feedback_add_details("admin_verb","TStatusIndicators")
// Not attached to a pref datum because those are strict binary toggles
/client/verb/toggle_examine_mode()

View File

@@ -168,12 +168,12 @@ mob/living/carbon/proc/handle_hallucinations()
if(71 to 72)
//Fake death
// src.sleeping_willingly = 1
src.sleeping = 20
SetSleeping(20)
hal_crit = 1
hal_screwyhud = 1
spawn(rand(50,100))
// src.sleeping_willingly = 0
src.sleeping = 0
SetSleeping(0)
hal_crit = 0
hal_screwyhud = 0
handling_hal = 0

View File

@@ -68,9 +68,9 @@
if(health <= 0)
death()
return
weakened = 0
stunned = 0
paralysis = 0
SetWeakened(0)
SetStunned(0)
SetParalysis(0)
if(on && !client && !busy)
spawn(0)

View File

@@ -59,7 +59,7 @@
adjustHalLoss(-3)
if (mind)
if(mind.active && client != null)
sleeping = max(sleeping-1, 0)
AdjustSleeping(-1)
blinded = 1
set_stat(UNCONSCIOUS)
else if(resting)

View File

@@ -1,3 +1,3 @@
/mob/living/carbon/brain/Login()
..()
sleeping = 0
SetSleeping(0)

View File

@@ -287,7 +287,7 @@
M.visible_message("<span class='notice'>[M] shakes [src] trying to wake [T.him] up!</span>", \
"<span class='notice'>You shake [src], but [T.he] [T.does] not respond... Maybe [T.he] [T.has] S.S.D?</span>")
else if(lying || src.sleeping)
src.sleeping = max(0,src.sleeping-5)
AdjustSleeping(-5)
if(src.sleeping == 0)
src.resting = 0
if(H) H.in_stasis = 0 //VOREStation Add - Just In Case
@@ -403,7 +403,7 @@
to_chat(usr, "<font color='red'>You are already sleeping</font>")
return
if(alert(src,"You sure you want to sleep for a while?","Sleep","Yes","No") == "Yes")
usr.sleeping = 20 //Short nap
usr.AdjustSleeping(20)
/mob/living/carbon/Bump(atom/A)
if(now_pushing)

View File

@@ -240,7 +240,11 @@
message = "faints."
if(sleeping)
return //Can't faint while asleep
<<<<<<< HEAD
sleeping += 10 //Short-short nap
=======
Sleeping(10)
>>>>>>> 55b2c8d... Merge pull request #7354 from Neerti/status_indicators
m_type = 1
if("cough", "coughs")

View File

@@ -1103,7 +1103,7 @@
drowsyness = max(0, drowsyness - 1)
eye_blurry = max(2, eye_blurry)
if (prob(5))
sleeping += 1
Sleeping(1)
Paralyse(5)
// If you're dirty, your gloves will become dirty, too.
@@ -1258,7 +1258,18 @@
if(blinded)
overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
throw_alert("blind", /obj/screen/alert/blind)
<<<<<<< HEAD
=======
else
clear_fullscreens()
clear_alert("blind")
if(blinded)
overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
>>>>>>> 55b2c8d... Merge pull request #7354 from Neerti/status_indicators
else if(!machine)
clear_fullscreens()
clear_alert("blind")

View File

@@ -126,10 +126,14 @@
/mob/living/proc/handle_weakened()
if(weakened)
<<<<<<< HEAD
weakened = max(weakened-1,0)
throw_alert("weakened", /obj/screen/alert/weakened)
else
clear_alert("weakened")
=======
AdjustWeakened(-1)
>>>>>>> 55b2c8d... Merge pull request #7354 from Neerti/status_indicators
return weakened
/mob/living/proc/handle_stuttering()

View File

@@ -491,6 +491,15 @@ default behaviour is:
if(!isnull(M.disable_duration_percent))
amount = round(amount * M.disable_duration_percent)
..(amount)
if(stunned > 0)
add_status_indicator("stunned")
/mob/living/SetStunned(amount)
..()
if(stunned <= 0)
remove_status_indicator("stunned")
else
add_status_indicator("stunned")
/mob/living/AdjustStunned(amount)
if(amount > 0)
@@ -498,12 +507,25 @@ default behaviour is:
if(!isnull(M.disable_duration_percent))
amount = round(amount * M.disable_duration_percent)
..(amount)
if(stunned <= 0)
remove_status_indicator("stunned")
else
add_status_indicator("stunned")
/mob/living/Weaken(amount)
for(var/datum/modifier/M in modifiers)
if(!isnull(M.disable_duration_percent))
amount = round(amount * M.disable_duration_percent)
..(amount)
if(weakened > 0)
add_status_indicator("weakened")
/mob/living/SetWeakened(amount)
..()
if(weakened <= 0)
remove_status_indicator("weakened")
else
add_status_indicator("weakened")
/mob/living/AdjustWeakened(amount)
if(amount > 0)
@@ -511,12 +533,25 @@ default behaviour is:
if(!isnull(M.disable_duration_percent))
amount = round(amount * M.disable_duration_percent)
..(amount)
if(weakened <= 0)
remove_status_indicator("weakened")
else
add_status_indicator("weakened")
/mob/living/Paralyse(amount)
for(var/datum/modifier/M in modifiers)
if(!isnull(M.disable_duration_percent))
amount = round(amount * M.disable_duration_percent)
..(amount)
if(paralysis > 0)
add_status_indicator("paralysis")
/mob/living/SetParalysis(amount)
..()
if(paralysis <= 0)
remove_status_indicator("paralysis")
else
add_status_indicator("paralysis")
/mob/living/AdjustParalysis(amount)
if(amount > 0)
@@ -524,12 +559,25 @@ default behaviour is:
if(!isnull(M.disable_duration_percent))
amount = round(amount * M.disable_duration_percent)
..(amount)
if(paralysis <= 0)
remove_status_indicator("paralysis")
else
add_status_indicator("paralysis")
/mob/living/Sleeping(amount)
for(var/datum/modifier/M in modifiers)
if(!isnull(M.disable_duration_percent))
amount = round(amount * M.disable_duration_percent)
..(amount)
if(sleeping > 0)
add_status_indicator("sleeping")
/mob/living/SetSleeping(amount)
..()
if(sleeping <= 0)
remove_status_indicator("sleeping")
else
add_status_indicator("sleeping")
/mob/living/AdjustSleeping(amount)
if(amount > 0)
@@ -537,12 +585,25 @@ default behaviour is:
if(!isnull(M.disable_duration_percent))
amount = round(amount * M.disable_duration_percent)
..(amount)
if(sleeping <= 0)
remove_status_indicator("sleeping")
else
add_status_indicator("sleeping")
/mob/living/Confuse(amount)
for(var/datum/modifier/M in modifiers)
if(!isnull(M.disable_duration_percent))
amount = round(amount * M.disable_duration_percent)
..(amount)
if(confused > 0)
add_status_indicator("confused")
/mob/living/SetConfused(amount)
..()
if(confused <= 0)
remove_status_indicator("confused")
else
add_status_indicator("confused")
/mob/living/AdjustConfused(amount)
if(amount > 0)
@@ -550,12 +611,25 @@ default behaviour is:
if(!isnull(M.disable_duration_percent))
amount = round(amount * M.disable_duration_percent)
..(amount)
if(confused <= 0)
remove_status_indicator("confused")
else
add_status_indicator("confused")
/mob/living/Blind(amount)
for(var/datum/modifier/M in modifiers)
if(!isnull(M.disable_duration_percent))
amount = round(amount * M.disable_duration_percent)
..(amount)
if(eye_blind > 0)
add_status_indicator("blinded")
/mob/living/SetBlinded(amount)
..()
if(eye_blind <= 0)
remove_status_indicator("blinded")
else
add_status_indicator("blinded")
/mob/living/AdjustBlinded(amount)
if(amount > 0)
@@ -563,6 +637,10 @@ default behaviour is:
if(!isnull(M.disable_duration_percent))
amount = round(amount * M.disable_duration_percent)
..(amount)
if(eye_blind <= 0)
remove_status_indicator("blinded")
else
add_status_indicator("blinded")
// ++++ROCKDTBEN++++ MOB PROCS //END
@@ -1145,22 +1223,42 @@ default behaviour is:
/mob/living/proc/is_sentient()
return TRUE
<<<<<<< HEAD
/mob/living/update_transform()
// First, get the correct size.
var/desired_scale_x = size_multiplier //VOREStation edit
var/desired_scale_y = size_multiplier //VOREStation edit
=======
/mob/living/get_icon_scale_x()
. = ..()
>>>>>>> 55b2c8d... Merge pull request #7354 from Neerti/status_indicators
for(var/datum/modifier/M in modifiers)
if(!isnull(M.icon_scale_x_percent))
desired_scale_x *= M.icon_scale_x_percent
. *= M.icon_scale_x_percent
/mob/living/get_icon_scale_y()
. = ..()
for(var/datum/modifier/M in modifiers)
if(!isnull(M.icon_scale_y_percent))
desired_scale_y *= M.icon_scale_y_percent
. *= M.icon_scale_y_percent
/mob/living/update_transform()
// First, get the correct size.
var/desired_scale_x = get_icon_scale_x()
var/desired_scale_y = get_icon_scale_y()
// Now for the regular stuff.
var/matrix/M = matrix()
M.Scale(desired_scale_x, desired_scale_y)
<<<<<<< HEAD
M.Translate(0, (vis_height/2)*(desired_scale_y-1)) //VOREStation edit
src.transform = M //VOREStation edit
=======
M.Translate(0, 16*(desired_scale_y-1))
animate(src, transform = M, time = 10)
handle_status_indicators()
>>>>>>> 55b2c8d... Merge pull request #7354 from Neerti/status_indicators
// This handles setting the client's color variable, which makes everything look a specific color.
// This proc is here so it can be called without needing to check if the client exists, or if the client relogs.

View File

@@ -1,3 +1,3 @@
/mob/living/silicon/Login()
sleeping = 0
SetSleeping(0)
..()

View File

@@ -32,7 +32,7 @@
// SetStunned(min(stunned, 30))
SetParalysis(min(paralysis, 30))
// SetWeakened(min(weakened, 20))
sleeping = 0
SetSleeping(0)
adjustBruteLoss(0)
adjustToxLoss(0)
adjustOxyLoss(0)
@@ -78,7 +78,7 @@
if(src.sleeping)
Paralyse(3)
src.sleeping--
AdjustSleeping(-1)
//if(src.resting) // VOREStation edit. Our borgos would rather not.
// Weaken(5)

View File

@@ -115,25 +115,7 @@
/mob/living/silicon/apply_effect(var/effect = 0,var/effecttype = STUN, var/blocked = 0)
return 0//The only effect that can hit them atm is flashes and they still directly edit so this works for now
/*
if(!effect || (blocked >= 2)) return 0
switch(effecttype)
if(STUN)
stunned = max(stunned,(effect/(blocked+1)))
if(WEAKEN)
weakened = max(weakened,(effect/(blocked+1)))
if(PARALYZE)
paralysis = max(paralysis,(effect/(blocked+1)))
if(IRRADIATE)
radiation += min((effect - (effect*getarmor(null, "rad"))), 0)//Rads auto check armor
if(STUTTER)
stuttering = max(stuttering,(effect/(blocked+1)))
if(EYE_BLUR)
eye_blurry = max(eye_blurry,(effect/(blocked+1)))
if(DROWSY)
drowsyness = max(drowsyness,(effect/(blocked+1)))
updatehealth()
return 1*/
/proc/islinked(var/mob/living/silicon/robot/bot, var/mob/living/silicon/ai/ai)
if(!istype(bot) || !istype(ai))

View File

@@ -64,6 +64,8 @@
pixel_x = -16
old_x = -16
icon_expected_width = 64
icon_expected_height = 64
meat_amount = 5
/mob/living/simple_mob/animal/space/alien/queen
@@ -95,6 +97,8 @@
pixel_x = -16
old_x = -16
icon_expected_width = 64
icon_expected_height = 64
/mob/living/simple_mob/animal/space/alien/queen/empress/mother
name = "alien mother"
@@ -111,6 +115,8 @@
pixel_x = -32
old_x = -32
icon_expected_width = 96
icon_expected_height = 96
/mob/living/simple_mob/animal/space/alien/death()
..()

View File

@@ -87,6 +87,8 @@
pixel_x = -16
default_pixel_x = -16
icon_expected_width = 64
icon_expected_height = 32
meat_amount = 3
@@ -108,6 +110,8 @@
pixel_y = -16
default_pixel_y = -16
icon_expected_width = 64
icon_expected_height = 64
meat_amount = 10

View File

@@ -45,7 +45,7 @@
"rad" = 100)
/mob/living/simple_mob/construct/juggernaut/Life()
weakened = 0
SetWeakened(0)
..()
/mob/living/simple_mob/construct/juggernaut/bullet_act(var/obj/item/projectile/P)

View File

@@ -0,0 +1,88 @@
#define STATUS_INDICATOR_Y_OFFSET 2 // Offset from the edge of the icon sprite, so 32 pixels plus whatever number is here.
#define STATUS_INDICATOR_ICON_X_SIZE 16 // Don't need to care about the Y size due to the origin being on the bottom side.
#define STATUS_INDICATOR_ICON_MARGIN 2 // The space between two status indicators.
// 'Status indicators' are icons that display over a mob's head, that visually indicate that the mob is suffering
// from some kind of effect, such as being stunned, blinded, confused, asleep, etc.
// The icons are managed automatically by the mob itself, so that their positions will shift if another indicator is added,
// and it will try to always be above the mob sprite, even for larger sprites like xenos.
/mob/living
var/list/status_indicators = null // Will become a list as needed.
// Adds an icon_state, or image overlay, to the list of indicators to be managed automatically.
// Also initializes the list if one doesn't exist.
/mob/living/proc/add_status_indicator(image/thing)
if(get_status_indicator(thing)) // No duplicates, please.
return
if(!istype(thing, /image))
thing = image(icon = 'icons/mob/status_indicators.dmi', icon_state = thing)
LAZYADD(status_indicators, thing)
handle_status_indicators()
// Similar to above but removes it instead, and nulls the list if it becomes empty as a result.
/mob/living/proc/remove_status_indicator(image/thing)
thing = get_status_indicator(thing)
cut_overlay(thing)
LAZYREMOVE(status_indicators, thing)
handle_status_indicators()
/mob/living/proc/get_status_indicator(image/thing)
if(!istype(thing, /image))
for(var/image/I in status_indicators)
if(I.icon_state == thing)
return I
return LAZYACCESS(status_indicators, LAZYFIND(status_indicators, thing))
// Refreshes the indicators over a mob's head. Should only be called when adding or removing a status indicator with the above procs,
// or when the mob changes size visually for some reason.
/mob/living/proc/handle_status_indicators()
// First, get rid of all the overlays.
for(var/thing in status_indicators)
cut_overlay(thing)
if(!LAZYLEN(status_indicators))
return
if(stat == DEAD)
return
// Now put them back on in the right spot.
var/our_sprite_x = icon_expected_width * get_icon_scale_x()
var/our_sprite_y = icon_expected_height * get_icon_scale_y()
var/x_offset = our_sprite_x // Add your own offset here later if you want.
var/y_offset = our_sprite_y + STATUS_INDICATOR_Y_OFFSET
// Calculates how 'long' the row of indicators and the margin between them should be.
// The goal is to have the center of that row be horizontally aligned with the sprite's center.
var/expected_status_indicator_length = (STATUS_INDICATOR_ICON_X_SIZE * status_indicators.len) + (STATUS_INDICATOR_ICON_MARGIN * max(status_indicators.len - 1, 0))
var/current_x_position = (x_offset / 2) - (expected_status_indicator_length / 2)
// In /mob/living's `update_transform()`, the sprite is horizontally shifted when scaled up, so that the center of the sprite doesn't move to the right.
// Because of that, this adjustment needs to happen with the future indicator row as well, or it will look bad.
current_x_position -= (icon_expected_width / 2) * (get_icon_scale_y() - 1)
// Now the indicator row can actually be built.
for(var/thing in status_indicators)
var/image/I = thing
// This is a semi-HUD element, in a similar manner as medHUDs, in that they're 'above' everything else in the world,
// but don't pierce obfuscation layers such as blindness or darkness, unlike actual HUD elements like inventory slots.
I.plane = PLANE_STATUS
I.layer = HUD_LAYER
I.appearance_flags = PIXEL_SCALE|TILE_BOUND|NO_CLIENT_COLOR|RESET_COLOR|RESET_ALPHA|RESET_TRANSFORM|KEEP_APART
I.pixel_y = y_offset
I.pixel_x = current_x_position
add_overlay(I)
// Adding the margin space every time saves a conditional check on the last iteration,
// and it won't cause any issues since no more icons will be added, and the var is not used for anything else.
current_x_position += STATUS_INDICATOR_ICON_X_SIZE + STATUS_INDICATOR_ICON_MARGIN
#undef STATUS_INDICATOR_Y_OFFSET
#undef STATUS_INDICATOR_ICON_X_SIZE
#undef STATUS_INDICATOR_ICON_MARGIN

View File

@@ -66,6 +66,10 @@
plane_holder.set_ao(VIS_OBJS, ao_enabled)
plane_holder.set_ao(VIS_MOBS, ao_enabled)
// Status indicators
var/status_enabled = client.is_preference_enabled(/datum/client_preference/status_indicators)
plane_holder.set_vis(VIS_STATUS, status_enabled)
//set macro to normal incase it was overriden (like cyborg currently does)
client.set_hotkeys_macro("macro", "hotkeymode")

View File

@@ -30,6 +30,8 @@
plane_masters[VIS_CH_SPECIAL] = new /obj/screen/plane_master{plane = PLANE_CH_SPECIAL} //"Special" role stuff
plane_masters[VIS_CH_STATUS_OOC]= new /obj/screen/plane_master{plane = PLANE_CH_STATUS_OOC} //OOC status HUD
plane_masters[VIS_STATUS] = new /obj/screen/plane_master{plane = PLANE_STATUS} //Status indicators that show over mob heads.
plane_masters[VIS_ADMIN1] = new /obj/screen/plane_master{plane = PLANE_ADMIN1} //For admin use
plane_masters[VIS_ADMIN2] = new /obj/screen/plane_master{plane = PLANE_ADMIN2} //For admin use
plane_masters[VIS_ADMIN3] = new /obj/screen/plane_master{plane = PLANE_ADMIN3} //For admin use

View File

@@ -42,7 +42,7 @@ mob/living/carbon/human/proc/handle_pain()
maxdam = dam
if(damaged_organ && chem_effects[CE_PAINKILLER] < maxdam)
if(maxdam > 10 && paralysis)
paralysis = max(0, paralysis - round(maxdam/10))
AdjustParalysis(-round(maxdam/10))
if(maxdam > 50 && prob(maxdam / 5))
drop_item()
var/burning = damaged_organ.burn_dam > damaged_organ.brute_dam

View File

@@ -122,8 +122,8 @@
if(effective_dose >= strength * 6) // Toxic dose
M.add_chemical_effect(CE_ALCOHOL_TOXIC, toxicity*3)
if(effective_dose >= strength * 7) // Pass out
M.paralysis = max(M.paralysis, 60)
M.sleeping = max(M.sleeping, 90)
M.Paralyse(60)
M.Sleeping(90)
if(druggy != 0)
M.druggy = max(M.druggy, druggy*3)
@@ -166,8 +166,8 @@
if(dose * strength_mod >= strength * 6) // Toxic dose
M.add_chemical_effect(CE_ALCOHOL_TOXIC, toxicity)
if(dose * strength_mod >= strength * 7) // Pass out
M.paralysis = max(M.paralysis, 20)
M.sleeping = max(M.sleeping, 30)
M.Paralyse(20)
M.Sleeping(30)
if(druggy != 0)
M.druggy = max(M.druggy, druggy)
@@ -465,7 +465,7 @@
M.Weaken(2)
M.drowsyness = max(M.drowsyness, 20)
else
M.sleeping = max(M.sleeping, 20)
M.Sleeping(20)
M.drowsyness = max(M.drowsyness, 60)
/datum/reagent/sulfur

View File

@@ -327,7 +327,7 @@
M.Weaken(2)
M.drowsyness = max(M.drowsyness, 20)
else
M.sleeping = max(M.sleeping, 20)
M.Sleeping(20)
M.drowsyness = max(M.drowsyness, 60)
/datum/reagent/nutriment/mayo
@@ -834,7 +834,7 @@
M.adjust_nutrition(nutrition * removed)
M.dizziness = max(0, M.dizziness + adj_dizzy)
M.drowsyness = max(0, M.drowsyness + adj_drowsy)
M.sleeping = max(0, M.sleeping + adj_sleepy)
M.AdjustSleeping(adj_sleepy)
if(adj_temp > 0 && M.bodytemperature < 310) // 310 is the normal bodytemp. 310.055
M.bodytemperature = min(310, M.bodytemperature + (adj_temp * TEMPERATURE_DAMAGE_COEFFICIENT))
if(adj_temp < 0 && M.bodytemperature > 310)
@@ -922,7 +922,7 @@
M.Weaken(2)
M.drowsyness = max(M.drowsyness, 20)
else
M.sleeping = max(M.sleeping, 20)
M.Sleeping(20)
M.drowsyness = max(M.drowsyness, 60)
*/
@@ -1506,7 +1506,7 @@
M.Weaken(2)
M.drowsyness = max(M.drowsyness, 20)
else
M.sleeping = max(M.sleeping, 20)
M.Sleeping(20)
M.drowsyness = max(M.drowsyness, 60)
/datum/reagent/drink/milkshake/chocoshake
@@ -2168,7 +2168,7 @@
..()
M.dizziness = max(0, M.dizziness - 5)
M.drowsyness = max(0, M.drowsyness - 3)
M.sleeping = max(0, M.sleeping - 2)
M.AdjustSleeping(-2)
if(M.bodytemperature > 310)
M.bodytemperature = max(310, M.bodytemperature - (5 * TEMPERATURE_DAMAGE_COEFFICIENT))
//if(alien == IS_TAJARA)

View File

@@ -197,7 +197,7 @@
M.drowsyness = 0
M.stuttering = 0
M.SetConfused(0)
M.sleeping = 0
M.SetSleeping(0)
M.jitteriness = 0
M.radiation = 0
M.ExtinguishMob()

View File

@@ -170,7 +170,7 @@
/datum/reagent/toxin/cyanide/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
..()
M.adjustOxyLoss(20 * removed)
M.sleeping += 1
M.Sleeping(1)
/datum/reagent/toxin/mold
name = "Mold"
@@ -645,7 +645,7 @@
else
M.Weaken(2)
else
M.sleeping = max(M.sleeping, 20)
M.Sleeping(20)
M.drowsyness = max(M.drowsyness, 60)
/datum/reagent/chloralhydrate
@@ -689,7 +689,7 @@
M.Weaken(30)
M.Confuse(40)
else
M.sleeping = max(M.sleeping, 30)
M.Sleeping(30)
if(effective_dose > 1 * threshold)
M.adjustToxLoss(removed)

View File

@@ -404,7 +404,7 @@
stage = 2
/datum/disease2/effect/blind/activate(var/mob/living/carbon/mob,var/multiplier)
mob.eye_blind = max(mob.eye_blind, 4)
mob.SetBlinded(4)
/datum/disease2/effect/cough
name = "Severe Cough"

View File

@@ -194,7 +194,7 @@
'sound/hallucinations/turn_around1.ogg',\
'sound/hallucinations/turn_around2.ogg',\
), 50, 1, -3)
M.sleeping = max(M.sleeping,rand(5,10))
M.Sleeping(rand(5, 10))
src.loc = null
else
STOP_PROCESSING(SSobj, src)

View File

@@ -21,7 +21,7 @@
var/turf/T = get_turf(suspension_field)
for(var/mob/living/M in T)
M.weakened = max(M.weakened, 3)
M.Weaken(3)
cell.charge -= power_use
if(prob(5))
to_chat(M, "<span class='warning'>[pick("You feel tingly","You feel like floating","It is hard to speak","You can barely move")].</span>")
@@ -208,7 +208,7 @@
for(var/mob/living/M in T)
to_chat(M, "<span class='info'>You no longer feel like floating.</span>")
M.weakened = min(M.weakened, 3)
M.Weaken(3)
src.visible_message("<font color='blue'>[bicon(src)] [src] deactivates with a gentle shudder.</font>")
qdel(suspension_field)

Binary file not shown.

After

Width:  |  Height:  |  Size: 576 B

View File

@@ -2418,6 +2418,7 @@
#include "code\modules\mob\living\login.dm"
#include "code\modules\mob\living\logout.dm"
#include "code\modules\mob\living\say.dm"
#include "code\modules\mob\living\status_indicators.dm"
#include "code\modules\mob\living\bot\bot.dm"
#include "code\modules\mob\living\bot\bot_vr.dm"
#include "code\modules\mob\living\bot\cleanbot.dm"