Drowsiness Changes (#11996)

* Drowsiness Changes

* Spelling Fixes
This commit is contained in:
Doxxmedearly
2021-06-24 21:48:15 -03:00
committed by GitHub
parent da1ba3bd84
commit d548614525
18 changed files with 73 additions and 49 deletions
+4 -1
View File
@@ -495,4 +495,7 @@
return ..()
/mob/living/carbon/get_contained_external_atoms()
. = contents - internal_organs
. = contents - internal_organs
/mob/living/carbon/proc/is_drowsy()
return (drowsiness >= 5)
@@ -303,6 +303,8 @@
if(M.max_stamina > 0)
disarm_cost = M.max_stamina / 6
if(M.is_drowsy())
disarm_cost *= 1.25
usesStamina = TRUE
else if(M.max_stamina <= 0)
if(M.isSynthetic())
@@ -65,7 +65,7 @@
if(aiming && aiming.aiming_at)
tally += 5 // Iron sights make you slower, it's a well-known fact.
if (drowsyness)
if (is_drowsy())
tally += 6
if (!(species.flags & IS_MECHANICAL)) // Machines don't move slower when cold.
@@ -14,7 +14,7 @@
slurring = 0
confused = 0
eye_blurry = 0
drowsyness = 0
drowsiness = 0
paralysis = 0
sleeping = 0
//Many of these parameters normally tick down in life code, but some parts of that code don't run in godmode, so this prevents a BST being stuck with blurred vision
+19 -10
View File
@@ -778,6 +778,7 @@
if(resting)
dizziness = max(0, dizziness - 15)
jitteriness = max(0, jitteriness - 15)
drowsiness = max(0, drowsiness - 5)
adjustHalLoss(-3)
else
dizziness = max(0, dizziness - 3)
@@ -787,15 +788,21 @@
//Other
handle_statuses()
if (drowsyness)
if (drowsyness < 0)
drowsyness = 0
if (drowsiness)
if (drowsiness < 0)
drowsiness = 0
else
drowsyness--
eye_blurry = max(2, eye_blurry)
if (prob(5))
sleeping += 1
Paralyse(5)
drowsiness--
eye_blurry = max(drowsiness, eye_blurry)
if(drowsiness > 5)
if(prob(drowsiness/5))
slurring += rand(1, 5)
if(prob(3))
make_dizzy(100 + drowsiness)
if(!sleeping)
emote("yawn")
if(prob(drowsiness/10))
eye_blind += 2
// If you're dirty, your gloves will become dirty, too.
if(gloves && germ_level > gloves.germ_level && prob(10))
@@ -1376,6 +1383,8 @@
//Any suffocation damage slows stamina regen.
//This includes oxyloss from low blood levels
var/regen = stamina_recovery * (1 - min(((getOxyLoss()) / exhaust_threshold) + ((get_shock()) / exhaust_threshold), 1))
if(is_drowsy())
regen *= 0.85
if (regen > 0)
stamina = min(max_stamina, stamina+regen)
adjustNutritionLoss(stamina_recovery*0.09)
@@ -1446,8 +1455,8 @@
/mob/living/carbon/human/proc/do_fever_effects(var/fever)
if(prob(20/3)) // every 30 seconds, roughly
to_chat(src, SPAN_WARNING(pick("You feel cold and clammy...", "You shiver as if a breeze has passed through.", "Your muscles ache.", "You feel tired and fatigued.")))
if(prob(20)) // once every 10 seconds, roughly
drowsyness += 4
if(prob(25)) // once every 8 seconds, roughly
drowsiness += 5
if(prob(20))
adjustHalLoss(5 * min(fever, 5)) // muscle pain from fever
if(fever >= 7 && prob(10)) // your organs are boiling, figuratively speaking
@@ -555,6 +555,8 @@
cost += H.getOxyLoss() * 0.1 //The less oxygen we get, the more we strain.
cost *= H.sprint_cost_factor
if(H.is_drowsy())
cost *= 1.25
if (H.stamina == -1)
log_debug("Error: Species with special sprint mechanics has not overridden cost function.")
return 0
+1 -1
View File
@@ -66,7 +66,7 @@
if(EYE_BLUR)
eye_blurry = max(eye_blurry, effect * BLOCKED_MULT(blocked))
if(DROWSY)
drowsyness = max(drowsyness, effect * BLOCKED_MULT(blocked))
drowsiness = max(drowsiness, effect * BLOCKED_MULT(blocked))
if(INCINERATE)
IgniteMob(effect * BLOCKED_MULT(blocked))
updatehealth()
+1 -1
View File
@@ -117,7 +117,7 @@
var/bodytemperature = 310.055 //98.7 F
var/old_x = 0
var/old_y = 0
var/drowsyness = 0.0//Carbon
var/drowsiness = 0.0//Carbon
var/charges = 0.0
var/nutrition = BASE_MAX_NUTRITION * CREW_NUTRITION_SLIGHTLYHUNGRY //carbon
var/nutrition_loss = HUNGER_FACTOR //How much hunger is lost per tick. This is modified by species