Converts drunkness and dizziness to status effects. Refactors status effect examine text (and, subsequently, stabilized black extracts). (#66340)

* Refactors dizziness into a status effect

* Refactors the dizziness setter to use the new kind

* Drunkness.
- Should drunk continue to work off of a magic value or be swapped to duration? I've not yet decided: For understandability it's preferabale for "drunk" to use a timer (they are drunk for 3 more minutes), but both adding drunk and decreasing drunk currently use weird calculations which would be difficult to carry over.
- Ballmer is a liver trait

* Dizzy was a setter, not an adjuster

* Does all the drunk effects over
- refactors examine text fully
- refactors stabilized blacks because of this

* Removed

* repaths, fixes some issues

* Minor fixes

* Some erroneous changes

* Fixes some dizziness errors

* Consistency thing

* Warning

* Undoes this change, I dont like its implementation

* max_duration

* Max amount

* Should be a negative

* max duration

* drunk doesn't tick on death

* Rework dizziness strength

* Erroneous dizzy change

* Fixes return type
This commit is contained in:
MrMelbert
2022-05-04 23:33:59 -04:00
committed by GitHub
parent 7866e09bc3
commit 074da65fc7
63 changed files with 627 additions and 362 deletions
+3 -3
View File
@@ -74,7 +74,7 @@ Finally we give a longer multi paragraph description of the class and it's detai
```
### Documenting a variable/define
Give a short explanation of what the variable, in the context of the class, or define is.
Give a short explanation of what the variable, in the context of the class, or define is.
```
/// Type path of item to go in suit slot
var/suit = null
@@ -96,13 +96,13 @@ You can use certain special template variables in DM DOC comments and they will
```
[DEFINE_NAME] - Expands to a link to the define definition if documented
[/mob] - Expands to a link to the docs for the /mob class
[/mob/proc/Dizzy] - Expands to a link that will take you to the /mob class and anchor you to the dizzy proc docs
[/mob/proc/adjust_drunk_effect] - Expands to a link that will take you to the /mob class and anchor you to the adjust_drunk_effect proc docs
[/mob/var/stat] - Expands to a link that will take you to the /mob class and anchor you to the stat var docs
```
You can customise the link name by using `[link name][link shorthand].`
eg. `[see more about dizzy here] [/mob/proc/Dizzy]`
eg. `[see more about adjust drunk effect here] [/mob/proc/adjust_drunk_effect]`
This is very useful to quickly link to other parts of the autodoc code to expand
upon a comment made, or reasoning about code
-3
View File
@@ -33,9 +33,6 @@
#define ALERT_ETHEREAL_CHARGE "ethereal_charge"
#define ALERT_ETHEREAL_OVERCHARGE "ethereal_overcharge"
//drunk alerts
#define ALERT_DRUNK "drunk"
/** Alien related */
#define ALERT_XENO_FIRE "alien_fire"
#define ALERT_XENO_PLASMA "alien_plas"
+1
View File
@@ -424,6 +424,7 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define TRAIT_ENGINEER_METABOLISM "engineer_metabolism"
#define TRAIT_ROYAL_METABOLISM "royal_metabolism"
#define TRAIT_PRETENDER_ROYAL_METABOLISM "pretender_royal_metabolism"
#define TRAIT_BALLMER_SCIENTIST "ballmer_scientist"
/// This mob can strip other mobs.
#define TRAIT_CAN_STRIP "can_strip"
-5
View File
@@ -244,11 +244,6 @@
return
to_chat(owner, span_mind_control("[command]"))
/atom/movable/screen/alert/drunk
name = "Drunk"
desc = "All that alcohol you've been drinking is impairing your speech, motor skills, and mental cognition. Make sure to act like it."
icon_state = ALERT_DRUNK
/atom/movable/screen/alert/embeddedobject
name = "Embedded Object"
desc = "Something got lodged into your flesh and is causing major bleeding. It might fall out with time, but surgery is the safest way. \
+1 -1
View File
@@ -103,7 +103,7 @@
to_chat(owner, span_userdanger("You feel your heart lurching in your chest..."))
if(81 to 100)
INVOKE_ASYNC(owner, /mob.proc/emote, "cough")
owner.dizziness += 10
owner.adjust_timed_status_effect(20 SECONDS, /datum/status_effect/dizziness)
owner.adjust_disgust(5)
to_chat(owner, span_userdanger("You gag and swallow a bit of bile..."))
+1 -1
View File
@@ -86,7 +86,7 @@
if(1)
owner.vomit()
if(2,3)
owner.dizziness += 10
owner.adjust_timed_status_effect(20 SECONDS, /datum/status_effect/dizziness)
if(4,5)
owner.add_confusion(10)
owner.blur_eyes(10)
+1 -1
View File
@@ -123,7 +123,7 @@
owner.Jitter(5)
owner.blind_eyes(10)
if(4)
owner.dizziness += 10
owner.adjust_timed_status_effect(20 SECONDS, /datum/status_effect/dizziness)
owner.add_confusion(10)
owner.Jitter(10)
owner.adjust_timed_status_effect(20 SECONDS, /datum/status_effect/speech/stutter)
+2 -2
View File
@@ -189,12 +189,12 @@
if(2)
if(!high_stress)
to_chat(owner, span_warning("You can't stop shaking..."))
owner.dizziness += 20
owner.adjust_timed_status_effect(40 SECONDS, /datum/status_effect/dizziness)
owner.add_confusion(20)
owner.Jitter(20)
else
to_chat(owner, span_warning("You feel weak and scared! If only you weren't alone..."))
owner.dizziness += 20
owner.adjust_timed_status_effect(40 SECONDS, /datum/status_effect/dizziness)
owner.add_confusion(20)
owner.Jitter(20)
owner.adjustStaminaLoss(50)
+3 -1
View File
@@ -146,7 +146,6 @@
/// The dedicated status effect for the hazard_area component - use with caution and know what it does!
/datum/status_effect/hazard_area
id = "hazard_area"
examine_text = "SUBJECTPRONOUN appears to be largely immobilized through unknown means."
status_type = STATUS_EFFECT_UNIQUE
alert_type = /atom/movable/screen/alert/status_effect/hazard_area
@@ -163,6 +162,9 @@
owner.remove_movespeed_modifier(/datum/movespeed_modifier/status_effect/hazard_area, update=TRUE)
owner.remove_actionspeed_modifier(/datum/actionspeed_modifier/status_effect/hazard_area, update=TRUE)
/datum/status_effect/hazard_area/get_examine_text()
return span_notice("[owner.p_they(TRUE)] appear[owner.p_s()] to be largely immobilized through unknown means.")
/atom/movable/screen/alert/status_effect/hazard_area
name = "Hazardous Area"
desc = "The area you are currently within is incredibly hazardous to you. Check your surroundings and vacate as soon as possible."
+10 -5
View File
@@ -247,10 +247,14 @@
var/attack_mod = 0
// DE-FENSE
if(target.drunkenness > 60) // drunks are easier to knock off balance
// Drunks are easier to knock off balance
var/target_drunkenness = target.get_drunk_amount()
if(target_drunkenness > 60)
defense_mod -= 3
else if(target.drunkenness > 30)
else if(target_drunkenness > 30)
defense_mod -= 1
if(HAS_TRAIT(target, TRAIT_CLUMSY))
defense_mod -= 2
if(HAS_TRAIT(target, TRAIT_FAT)) // chonkers are harder to knock over
@@ -291,11 +295,12 @@
// OF-FENSE
var/mob/living/carbon/sacker = parent
if(sacker.drunkenness > 60) // you're far too drunk to hold back!
var/sacker_drunkenness = sacker.get_drunk_amount()
if(sacker_drunkenness > 60) // you're far too drunk to hold back!
attack_mod += 1
else if(sacker.drunkenness > 30) // if you're only a bit drunk though, you're just sloppy
else if(sacker_drunkenness > 30) // if you're only a bit drunk though, you're just sloppy
attack_mod -= 1
if(HAS_TRAIT(sacker, TRAIT_CLUMSY))
attack_mod -= 2
if(HAS_TRAIT(sacker, TRAIT_DWARF))
+1 -1
View File
@@ -32,7 +32,7 @@
affected_mob.adjust_timed_status_effect(14 SECONDS, /datum/status_effect/speech/slurring/drunk)
if(DT_PROB(7, delta_time))
affected_mob.Dizzy(10)
affected_mob.set_timed_status_effect(20 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
if(DT_PROB(2.5, delta_time))
to_chat(affected_mob, span_warning(pick("You feel pain shoot down your legs!", "You feel like you are going to pass out at any moment.", "You feel really dizzy.")))
@@ -44,7 +44,6 @@
to_chat(M, span_warning("[pick("You feel dizzy.", "Your head spins.")]"))
else
to_chat(M, span_userdanger("A wave of dizziness washes over you!"))
if(M.dizziness <= 70)
M.dizziness += 30
M.adjust_timed_status_effect(1 MINUTES, /datum/status_effect/dizziness, max_duration = 140 SECONDS)
if(power >= 2)
M.set_timed_status_effect(80 SECONDS, /datum/status_effect/drugginess)
@@ -43,16 +43,14 @@
if(A.stage >= 3)
M.dizziness = max(0, M.dizziness - 2)
M.adjust_timed_status_effect(4 SECONDS, /datum/status_effect/dizziness)
M.adjust_drowsyness(-2)
M.adjust_timed_status_effect(-1 SECONDS, /datum/status_effect/speech/slurring/drunk)
M.set_confusion(max(0, M.get_confusion() - 2))
if(purge_alcohol)
M.reagents.remove_all_type(/datum/reagent/consumable/ethanol, 3)
if(ishuman(M))
var/mob/living/carbon/human/H = M
H.drunkenness = max(H.drunkenness - 5, 0)
M.adjust_drunk_effect(-5)
if(A.stage >= 4)
M.adjust_drowsyness(-2)
+1 -1
View File
@@ -30,7 +30,7 @@
if(4)
if(DT_PROB(1, delta_time))
to_chat(affected_mob, span_userdanger("You see four of everything!"))
affected_mob.Dizzy(5)
affected_mob.set_timed_status_effect(10 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
if(DT_PROB(1, delta_time))
to_chat(affected_mob, span_danger("You feel a sharp pain from your lower chest!"))
affected_mob.adjustOxyLoss(5, FALSE)
+7 -8
View File
@@ -40,17 +40,16 @@
processing_quirk = TRUE
/datum/quirk/drunkhealing/process(delta_time)
var/mob/living/carbon/carbon_holder = quirk_holder
switch(carbon_holder.drunkenness)
switch(quirk_holder.get_drunk_amount())
if (6 to 40)
carbon_holder.adjustBruteLoss(-0.1*delta_time, FALSE)
carbon_holder.adjustFireLoss(-0.05*delta_time, FALSE)
quirk_holder.adjustBruteLoss(-0.1 * delta_time, FALSE)
quirk_holder.adjustFireLoss(-0.05 * delta_time)
if (41 to 60)
carbon_holder.adjustBruteLoss(-0.4*delta_time, FALSE)
carbon_holder.adjustFireLoss(-0.2*delta_time, FALSE)
quirk_holder.adjustBruteLoss(-0.4 * delta_time, FALSE)
quirk_holder.adjustFireLoss(-0.2 * delta_time)
if (61 to INFINITY)
carbon_holder.adjustBruteLoss(-0.8*delta_time, FALSE)
carbon_holder.adjustFireLoss(-0.4*delta_time, FALSE)
quirk_holder.adjustBruteLoss(-0.8 * delta_time, FALSE)
quirk_holder.adjustFireLoss(-0.4 * delta_time)
/datum/quirk/empath
name = "Empath"
+5 -3
View File
@@ -17,9 +17,6 @@
var/status_type = STATUS_EFFECT_UNIQUE
/// If TRUE, we call [proc/on_remove] when owner is deleted. Otherwise, we call [proc/be_replaced].
var/on_remove_on_mob_delete = FALSE
/// If defined, this text will appear when the mob is examined
/// To use he, she etc. use "SUBJECTPRONOUN" and replace it in the examines themselves
var/examine_text
/// The typepath to the alert thrown by the status effect when created.
/// Status effect "name"s and "description"s are shown to the owner here.
var/alert_type = /atom/movable/screen/alert/status_effect
@@ -93,6 +90,11 @@
/datum/status_effect/proc/on_apply()
return TRUE
/// Gets and formats examine text associated with our status effect.
/// Return 'null' to have no examine text appear (default behavior).
/datum/status_effect/proc/get_examine_text()
return null
/// Called every tick from process().
/datum/status_effect/proc/tick()
return
+7 -3
View File
@@ -210,7 +210,6 @@
status_type = STATUS_EFFECT_UNIQUE
duration = -1
tick_interval = 25
examine_text = "<span class='notice'>They seem to have an aura of healing and helpfulness about them.</span>"
alert_type = null
var/datum/component/aura_healing/aura_healing
@@ -248,6 +247,9 @@
var/datum/atom_hud/H = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED]
H.remove_hud_from(owner)
/datum/status_effect/hippocratic_oath/get_examine_text()
return span_notice("[owner.p_they(TRUE)] seem[owner.p_s()] to have an aura of healing and helpfulness about [owner.p_them()].")
/datum/status_effect/hippocratic_oath/tick()
if(owner.stat == DEAD)
if(deathTick < 4)
@@ -316,7 +318,7 @@
/datum/status_effect/good_music/tick()
if(owner.can_hear())
owner.dizziness = max(0, owner.dizziness - 2)
owner.adjust_timed_status_effect(-4 SECONDS, /datum/status_effect/dizziness)
owner.jitteriness = max(0, owner.jitteriness - 2)
owner.set_confusion(max(0, owner.get_confusion() - 1))
SEND_SIGNAL(owner, COMSIG_ADD_MOOD_EVENT, "goodmusic", /datum/mood_event/goodmusic)
@@ -350,7 +352,6 @@
id = "Blessing of Crucible Soul"
status_type = STATUS_EFFECT_REFRESH
duration = 15 SECONDS
examine_text = "<span class='notice'>They don't seem to be all here.</span>"
alert_type = /atom/movable/screen/alert/status_effect/crucible_soul
var/turf/location
@@ -368,6 +369,9 @@
owner.forceMove(location)
location = null
/datum/status_effect/crucible_soul/get_examine_text()
return span_notice("[owner.p_they(TRUE)] [owner.p_do()]n't seem to be all here.")
/datum/status_effect/duskndawn
id = "Blessing of Dusk and Dawn"
status_type = STATUS_EFFECT_REFRESH
+20 -25
View File
@@ -133,21 +133,6 @@
alert_type = /atom/movable/screen/alert/status_effect/asleep
needs_update_stat = TRUE
tick_interval = 2 SECONDS
var/mob/living/carbon/carbon_owner
var/mob/living/carbon/human/human_owner
/datum/status_effect/incapacitating/sleeping/on_creation(mob/living/new_owner)
. = ..()
if(.)
if(iscarbon(owner)) //to avoid repeated istypes
carbon_owner = owner
if(ishuman(owner))
human_owner = owner
/datum/status_effect/incapacitating/sleeping/Destroy()
carbon_owner = null
human_owner = null
return ..()
/datum/status_effect/incapacitating/sleeping/on_apply()
. = ..()
@@ -196,10 +181,14 @@
owner.adjustFireLoss(healing)
owner.adjustToxLoss(healing * 0.5, TRUE, TRUE)
owner.adjustStaminaLoss(healing)
if(human_owner?.drunkenness)
human_owner.drunkenness *= 0.997 //reduce drunkenness by 0.3% per tick, 6% per 2 seconds
if(carbon_owner)
// Drunkenness gets reduced by 0.3% per tick (6% per 2 seconds)
owner.set_drunk_effect(owner.get_drunk_amount() * 0.997)
if(iscarbon(owner))
var/mob/living/carbon/carbon_owner = owner
carbon_owner.handle_dreams()
if(prob(2) && owner.health > owner.crit_threshold)
owner.emote("snore")
@@ -267,7 +256,6 @@
//OTHER DEBUFFS
/datum/status_effect/strandling //get it, strand as in durathread strand + strangling = strandling hahahahahahahahahahhahahaha i want to die
id = "strandling"
examine_text = "SUBJECTPRONOUN seems to be being choked by some durathread strands. You may be able to <b>cut</b> them off."
status_type = STATUS_EFFECT_UNIQUE
alert_type = /atom/movable/screen/alert/status_effect/strandling
@@ -279,6 +267,9 @@
REMOVE_TRAIT(owner, TRAIT_MAGIC_CHOKE, STATUS_EFFECT_TRAIT)
return ..()
/datum/status_effect/strandling/get_examine_text()
return span_warning("[owner.p_they(TRUE)] seem[owner.p_s()] to be being choked by some durathread strands. You may be able to <b>cut</b> them off.")
/atom/movable/screen/alert/status_effect/strandling
name = "Choking strand"
desc = "A magical strand of Durathread is wrapped around your neck, preventing you from breathing! Click this icon to remove the strand."
@@ -744,7 +735,6 @@
status_type = STATUS_EFFECT_UNIQUE
duration = 300
tick_interval = 10
examine_text = span_warning("SUBJECTPRONOUN seems slow and unfocused.")
var/stun = TRUE
alert_type = /atom/movable/screen/alert/status_effect/trance
@@ -755,8 +745,8 @@
/datum/status_effect/trance/tick()
if(stun)
owner.Stun(60, TRUE)
owner.dizziness = 20
owner.Stun(6 SECONDS, TRUE)
owner.set_timed_status_effect(40 SECONDS, /datum/status_effect/dizziness)
/datum/status_effect/trance/on_apply()
if(!iscarbon(owner))
@@ -776,10 +766,13 @@
/datum/status_effect/trance/on_remove()
UnregisterSignal(owner, COMSIG_MOVABLE_HEAR)
REMOVE_TRAIT(owner, TRAIT_MUTE, STATUS_EFFECT_TRAIT)
owner.dizziness = 0
owner.remove_status_effect(/datum/status_effect/dizziness)
owner.remove_client_colour(/datum/client_colour/monochrome/trance)
to_chat(owner, span_warning("You snap out of your trance!"))
/datum/status_effect/trance/get_examine_text()
return span_warning("[owner.p_they(TRUE)] seem[owner.p_s()] slow and unfocused.")
/datum/status_effect/trance/proc/hypnotize(datum/source, list/hearing_args)
SIGNAL_HANDLER
@@ -989,7 +982,7 @@
if(0 to 10)
human_owner.vomit()
if(20 to 30)
human_owner.Dizzy(50)
human_owner.set_timed_status_effect(100 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
human_owner.Jitter(50)
if(30 to 40)
human_owner.adjustOrganLoss(ORGAN_SLOT_LIVER, 5)
@@ -1073,7 +1066,6 @@
status_type = STATUS_EFFECT_REFRESH
alert_type = /atom/movable/screen/alert/status_effect/ants
duration = 2 MINUTES //Keeping the normal timer makes sure people can't somehow dump 300+ ants on someone at once so they stay there for like 30 minutes. Max w/ 1 dump is 57.6 brute.
examine_text = span_warning("SUBJECTPRONOUN is covered in ants!")
processing_speed = STATUS_EFFECT_NORMAL_PROCESS
/// Will act as the main timer as well as changing how much damage the ants do.
var/ants_remaining = 0
@@ -1117,6 +1109,9 @@
owner.remove_status_effect(/datum/status_effect/ants)
return COMPONENT_CLEANED
/datum/status_effect/ants/get_examine_text()
return span_warning("[owner.p_they(TRUE)] [owner.p_are()] covered in ants!")
/datum/status_effect/ants/tick()
var/mob/living/carbon/human/victim = owner
victim.adjustBruteLoss(max(0.1, round((ants_remaining * 0.004),0.1))) //Scales with # of ants (lowers with time). Roughly 10 brute over 50 seconds.
@@ -0,0 +1,75 @@
/datum/status_effect/dizziness
id = "dizziness"
tick_interval = 2 SECONDS
alert_type = null
/datum/status_effect/dizziness/on_creation(mob/living/new_owner, duration = 10 SECONDS)
src.duration = duration
return ..()
/datum/status_effect/dizziness/on_apply()
RegisterSignal(owner, list(COMSIG_LIVING_POST_FULLY_HEAL, COMSIG_LIVING_DEATH), .proc/clear_dizziness)
return TRUE
/datum/status_effect/dizziness/on_remove()
UnregisterSignal(owner, list(COMSIG_LIVING_POST_FULLY_HEAL, COMSIG_LIVING_DEATH))
// In case our client's offset is somewhere wacky from the dizziness effect
owner.client?.pixel_x = initial(owner.client?.pixel_x)
owner.client?.pixel_y = initial(owner.client?.pixel_y)
/// Signal proc that self deletes our dizziness effect
/datum/status_effect/dizziness/proc/clear_dizziness(datum/source)
SIGNAL_HANDLER
qdel(src)
/datum/status_effect/dizziness/tick()
// How much time is left, in seconds
var/amount = (duration - world.time) / 10
if(amount <= 0)
return
// How strong the dizziness effect is on us.
// If we're resting, the effect is 5x as strong, but also decays 5x fast.
// Meaning effectively, 1 tick is actually dizziness_strength ticks of duration
var/dizziness_strength = owner.resting ? 5 : 1
var/time_between_ticks = initial(tick_interval)
// How much time will be left, in seconds, next tick
var/next_amount = max((amount - (dizziness_strength * time_between_ticks * 0.1)), 0)
// If we have a dizziness strength > 1, we will subtract ticks off of the total duration
duration -= ((dizziness_strength - 1) * time_between_ticks)
// Now we can do the actual dizzy effects.
// Don't bother animating if they're clientless.
if(!owner.client)
return
// Want to be able to offset things by the time the animation should be "playing" at
var/time = world.time
var/delay = 0
var/pixel_x_diff = 0
var/pixel_y_diff = 0
// This shit is annoying at high strengthvar/pixel_x_diff = 0
var/amplitude = amount * (sin(amount * (time)) + 1)
var/x_diff = amplitude * sin(amount * time)
var/y_diff = amplitude * cos(amount * time)
pixel_x_diff += x_diff
pixel_y_diff += y_diff
// Brief explanation. We're basically snapping between different pixel_x/ys instantly, with delays between
// Doing this with relative changes. This way we don't override any existing pixel_x/y values
// We use EASE_OUT here for similar reasons, we want to act at the end of the delay, not at its start
// Relative animations are weird, so we do actually need this
animate(owner.client, pixel_x = x_diff, pixel_y = y_diff, 3, easing = JUMP_EASING | EASE_OUT, flags = ANIMATION_RELATIVE)
delay += 0.3 SECONDS // This counts as a 0.3 second wait, so we need to shift the sine wave by that much
x_diff = amplitude * sin(next_amount * (time + delay))
y_diff = amplitude * cos(next_amount * (time + delay))
pixel_x_diff += x_diff
pixel_y_diff += y_diff
animate(pixel_x = x_diff, pixel_y = y_diff, 3, easing = JUMP_EASING | EASE_OUT, flags = ANIMATION_RELATIVE)
// Now we reset back to our old pixel_x/y, since these animates are relative
animate(pixel_x = -pixel_x_diff, pixel_y = -pixel_y_diff, 3, easing = JUMP_EASING | EASE_OUT, flags = ANIMATION_RELATIVE)
+222
View File
@@ -0,0 +1,222 @@
// Defines for the ballmer peak.
#define BALLMER_PEAK_LOW_END 12.9
#define BALLMER_PEAK_HIGH_END 13.8
#define BALLMER_PEAK_WINDOWS_ME 26
/// The threshld which determine if someone is tipsy vs drunk
#define TIPSY_THRESHOLD 6
/**
* The drunk status effect.
* Slowly decreases in drunk_value over time, causing effects based on that value.
*/
/datum/status_effect/inebriated
id = "drunk"
tick_interval = 2 SECONDS
status_type = STATUS_EFFECT_REPLACE
/// The level of drunkness we are currently at.
var/drunk_value = 0
/datum/status_effect/inebriated/on_creation(mob/living/new_owner, drunk_value = 0)
. = ..()
set_drunk_value(drunk_value)
/datum/status_effect/inebriated/on_apply()
RegisterSignal(owner, COMSIG_LIVING_POST_FULLY_HEAL, .proc/clear_drunkenness)
return TRUE
/datum/status_effect/inebriated/on_remove()
UnregisterSignal(owner, COMSIG_LIVING_POST_FULLY_HEAL)
/datum/status_effect/inebriated/get_examine_text()
// Dead people don't look drunk
if(owner.stat == DEAD || HAS_TRAIT(owner, TRAIT_FAKEDEATH))
return null
// Having your face covered conceals your drunkness
if(iscarbon(owner))
var/mob/living/carbon/carbon_owner = owner
if(carbon_owner.wear_mask?.flags_inv & HIDEFACE)
return null
if(carbon_owner.head?.flags_inv & HIDEFACE)
return null
// .01s are used in case the drunk value ends up to be a small decimal.
switch(drunk_value)
if(11 to 21)
return span_warning("[owner.p_they(TRUE)] [owner.p_are()] slightly flushed.")
if(21.01 to 41)
return span_warning("[owner.p_they(TRUE)] [owner.p_are()] flushed.")
if(41.01 to 51)
return span_warning("[owner.p_they(TRUE)] [owner.p_are()] quite flushed and [owner.p_their()] breath smells of alcohol.")
if(51.01 to 61)
return span_warning("[owner.p_they(TRUE)] [owner.p_are()] very flushed and [owner.p_their()] movements jerky, with breath reeking of alcohol.")
if(61.01 to 91)
return span_warning("[owner.p_they(TRUE)] look[owner.p_s()] like a drunken mess.")
if(91.01 to INFINITY)
return span_warning("[owner.p_they(TRUE)] [owner.p_are()] a shitfaced, slobbering wreck.")
return null
/// Removes all of our drunkenness (self-deletes) on signal.
/datum/status_effect/inebriated/proc/clear_drunkenness(mob/living/source)
SIGNAL_HANDLER
qdel(src)
/// Sets the drunk value to set_to, deleting if the value drops to 0 or lower
/datum/status_effect/inebriated/proc/set_drunk_value(set_to)
if(!isnum(set_to))
CRASH("[type] - invalid value passed to set_drunk_value. (Got: [set_to])")
drunk_value = set_to
if(drunk_value <= 0)
qdel(src)
/datum/status_effect/inebriated/tick()
// Drunk value does not decrease while dead
if(owner.stat == DEAD)
return
// Every tick, the drunk value decrases by
// 4% the current drunk_value + 0.01
// (until it reaches 0 and terminates)
set_drunk_value(drunk_value - (0.01 + drunk_value * 0.04))
if(QDELETED(src))
return
on_tick_effects()
/// Side effects done by this level of drunkness on tick.
/datum/status_effect/inebriated/proc/on_tick_effects()
return
/**
* Stage 1 of drunk, applied at drunk values between 0 and 6.
* Basically is the "drunk but no side effects" stage.
*/
/datum/status_effect/inebriated/tipsy
alert_type = null
/datum/status_effect/inebriated/tipsy/set_drunk_value(set_to)
. = ..()
if(QDELETED(src))
return
// Become fully drunk at over than 6 drunk value
if(drunk_value >= TIPSY_THRESHOLD)
owner.apply_status_effect(/datum/status_effect/inebriated/drunk, drunk_value)
/**
* Stage 2 of being drunk, applied at drunk values between 6 and onward.
* Has all the main side effects of being drunk, scaling up as they get more drunk.
*/
/datum/status_effect/inebriated/drunk
alert_type = /atom/movable/screen/alert/status_effect/drunk
/datum/status_effect/inebriated/drunk/on_apply()
. = ..()
owner.sound_environment_override = SOUND_ENVIRONMENT_PSYCHOTIC
SEND_SIGNAL(owner, COMSIG_ADD_MOOD_EVENT, id, /datum/mood_event/drunk)
/datum/status_effect/inebriated/drunk/on_remove()
clear_effects()
return ..()
// Going from "drunk" to "tipsy" should remove effects like on_remove
/datum/status_effect/inebriated/drunk/be_replaced()
clear_effects()
return ..()
/// Clears any side effects we set due to being drunk.
/datum/status_effect/inebriated/drunk/proc/clear_effects()
SEND_SIGNAL(owner, COMSIG_CLEAR_MOOD_EVENT, id)
if(owner.sound_environment_override == SOUND_ENVIRONMENT_PSYCHOTIC)
owner.sound_environment_override = SOUND_ENVIRONMENT_NONE
/datum/status_effect/inebriated/drunk/set_drunk_value(set_to)
. = ..()
if(QDELETED(src))
return
// Return to "tipsyness" when we're below 6.
if(drunk_value < TIPSY_THRESHOLD)
owner.apply_status_effect(/datum/status_effect/inebriated/tipsy, drunk_value)
/datum/status_effect/inebriated/drunk/on_tick_effects()
// Handle the Ballmer Peak.
// If our owner is a scientist (has the trait "TRAIT_BALLMER_SCIENTIST"), there's a 5% chance
// that they'll say one of the special "ballmer message" lines, depending their drunk-ness level.
if(HAS_TRAIT(owner, TRAIT_BALLMER_SCIENTIST) && prob(5))
if(drunk_value >= BALLMER_PEAK_LOW_END && drunk_value <= BALLMER_PEAK_HIGH_END)
owner.say(pick_list_replacements(VISTA_FILE, "ballmer_good_msg"), forced = "ballmer")
if(drunk_value > BALLMER_PEAK_WINDOWS_ME) // by this point you're into windows ME territory
owner.say(pick_list_replacements(VISTA_FILE, "ballmer_windows_me_msg"), forced = "ballmer")
// There's always a 30% chance to gain some drunken slurring
if(prob(30))
owner.adjust_timed_status_effect(4 SECONDS, /datum/status_effect/speech/slurring/drunk)
// And drunk people will always lose jitteriness
owner.jitteriness = max(owner.jitteriness - 3, 0)
// Over 11, we will constantly gain slurring up to 10 seconds of slurring.
if(drunk_value >= 11)
owner.adjust_timed_status_effect(2.4 SECONDS, /datum/status_effect/speech/slurring/drunk, max_duration = 10 SECONDS)
// Over 41, we have a 30% chance to gain confusion, and we will always have 20 seconds of dizziness.
if(drunk_value >= 41)
if(prob(30))
owner.add_confusion(2)
owner.set_timed_status_effect(20 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
// Over 51, we have a 3% chance to gain a lot of confusion and vomit, and we will always have 50 seconds of dizziness
if(drunk_value >= 51)
owner.set_timed_status_effect(50 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
if(prob(3))
owner.add_confusion(15)
if(iscarbon(owner))
var/mob/living/carbon/carbon_owner = owner
carbon_owner.vomit() // Vomiting clears toxloss - consider this a blessing
// Over 71, we will constantly have blurry eyes
if(drunk_value >= 71)
owner.blur_eyes(5)
// Over 81, we will gain constant toxloss
if(drunk_value >= 81)
owner.adjustToxLoss(1)
if(owner.stat == CONSCIOUS && prob(5))
to_chat(owner, span_warning("Maybe you should lie down for a bit..."))
// Over 91, we gain even more toxloss, brain damage, and have a chance of dropping into a long sleep
if(drunk_value >= 91)
owner.adjustToxLoss(1)
owner.adjustOrganLoss(ORGAN_SLOT_BRAIN, 0.4)
if(owner.stat == CONSCIOUS && prob(20))
// Don't put us in a deep sleep if the shuttle's here. QoL, mainly.
if(SSshuttle.emergency.mode == SHUTTLE_DOCKED && is_station_level(owner.z))
to_chat(owner, span_warning("You're so tired... but you can't miss that shuttle..."))
else
to_chat(owner, span_warning("Just a quick nap..."))
owner.Sleeping(90 SECONDS)
// And finally, over 100 - let's be honest, you shouldn't be alive by now.
if(drunk_value >= 101)
owner.adjustToxLoss(2)
/// Status effect for being fully drunk (not tipsy).
/atom/movable/screen/alert/status_effect/drunk
name = "Drunk"
desc = "All that alcohol you've been drinking is impairing your speech, \
motor skills, and mental cognition. Make sure to act like it."
icon_state = "drunk"
#undef BALLMER_PEAK_LOW_END
#undef BALLMER_PEAK_HIGH_END
#undef BALLMER_PEAK_WINDOWS_ME
#undef TIPSY_THRESHOLD
+4 -1
View File
@@ -21,7 +21,6 @@
id = "antimagic"
status_type = STATUS_EFFECT_REFRESH
duration = 10 SECONDS
examine_text = "<span class='notice'>They seem to be covered in a dull, grey aura.</span>"
aura_desc = "dull"
/datum/status_effect/song/antimagic/on_apply()
@@ -31,3 +30,7 @@
/datum/status_effect/song/antimagic/on_remove()
REMOVE_TRAIT(owner, TRAIT_ANTIMAGIC, MAGIC_TRAIT)
return ..()
/datum/status_effect/song/antimagic/get_examine_text()
return span_notice("[owner.p_they(TRUE)] seem[owner.p_s()] to be covered in a dull, grey aura.")
+1 -1
View File
@@ -390,7 +390,7 @@
to_chat(victim, span_userdanger("[user] finishes applying [I] to your [limb.plaintext_zone], and you can feel the bones exploding with pain as they begin melting and reforming!"))
else
var/painkiller_bonus = 0
if(victim.drunkenness > 10)
if(victim.get_drunk_amount() > 10)
painkiller_bonus += 10
if(victim.reagents.has_reagent(/datum/reagent/medicine/morphine))
painkiller_bonus += 20
+3 -3
View File
@@ -155,17 +155,17 @@
switch(time_diff)
if(0 to 100)
victim.add_confusion(10)
victim.Dizzy(100)
victim.set_timed_status_effect(200 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
victim.blur_eyes(5)
if(101 to 200)
victim.add_confusion(15)
victim.Dizzy(200)
victim.set_timed_status_effect(400 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
victim.blur_eyes(10)
if(prob(25))
victim.apply_status_effect(/datum/status_effect/trance, rand(50,150), FALSE)
if(201 to INFINITY)
victim.add_confusion(20)
victim.Dizzy(300)
victim.set_timed_status_effect(600 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
victim.blur_eyes(15)
if(prob(65))
victim.apply_status_effect(/datum/status_effect/trance, rand(50,150), FALSE)
+1 -1
View File
@@ -493,7 +493,7 @@ INITIALIZE_IMMEDIATE(/obj/effect/landmark/start/new_player)
if(prob(50))
spawned_carbon.adjust_timed_status_effect(rand(30 SECONDS, 40 SECONDS), /datum/status_effect/drugginess)
else
spawned_carbon.drunkenness += rand(15, 25)
spawned_carbon.adjust_drunk_effect(rand(15, 25))
spawned_carbon.adjust_disgust(rand(5, 55)) //How hungover are you?
if(spawned_carbon.head)
return
+1 -1
View File
@@ -66,5 +66,5 @@
else
to_chat(target, span_hypnophrase("The light is so pretty..."))
target.add_confusion(min(target.get_confusion() + 10, 20))
target.dizziness += min(target.dizziness + 10, 20)
target.adjust_drowsyness(min(target.drowsyness + 10, 20))
target.adjust_timed_status_effect(20 SECONDS, /datum/status_effect/dizziness, max_duration = 40 SECONDS)
+2 -4
View File
@@ -129,10 +129,8 @@
stuffed = FALSE
else
to_chat(user, span_notice("What a fool you are. [src] is a god, how can you kill a god? What a grand and intoxicating innocence."))
if(iscarbon(user))
var/mob/living/carbon/C = user
if(C.drunkenness < 50)
C.drunkenness = min(C.drunkenness + 20, 50)
user.adjust_drunk_effect(20, up_to = 50)
var/turf/current_location = get_turf(user)
var/area/current_area = current_location.loc //copied from hand tele code
if(current_location && current_area && (current_area.area_flags & NOTELEPORT))
-11
View File
@@ -15,17 +15,6 @@
SSblackbox.record_feedback("tally", "admin_verb", 1, "Toggle Debug Two") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/* 21st Sept 2010
Updated by Skie -- Still not perfect but better!
Stuff you can't do:
Call proc /mob/proc/Dizzy() for some player
Because if you select a player mob as owner it tries to do the proc for
/mob/living/carbon/human/ instead. And that gives a run-time error.
But you can call procs that are of type /mob/living/carbon/human/proc/ for that player.
*/
/client/proc/Cell()
set category = "Debug"
set name = "Air Status in Location"
+5 -5
View File
@@ -466,7 +466,7 @@ Striking a noncultist, however, will tear their flesh."}
to_chat(user, span_cultlarge("\"I wouldn't advise that.\""))
to_chat(user, span_warning("An overwhelming sense of nausea overpowers you!"))
user.dropItemToGround(src, TRUE)
user.Dizzy(30)
user.set_timed_status_effect(1 MINUTES, /datum/status_effect/dizziness, only_if_higher = TRUE)
user.Paralyze(100)
/obj/item/clothing/suit/hooded/cultrobes/berserker
@@ -488,7 +488,7 @@ Striking a noncultist, however, will tear their flesh."}
to_chat(user, span_cultlarge("\"I wouldn't advise that.\""))
to_chat(user, span_warning("An overwhelming sense of nausea overpowers you!"))
user.dropItemToGround(src, TRUE)
user.Dizzy(30)
user.set_timed_status_effect(1 MINUTES, /datum/status_effect/dizziness, only_if_higher = TRUE)
user.Paralyze(100)
/obj/item/clothing/glasses/hud/health/night/cultblind
@@ -503,7 +503,7 @@ Striking a noncultist, however, will tear their flesh."}
if(user.stat != DEAD && !IS_CULTIST(user) && slot == ITEM_SLOT_EYES)
to_chat(user, span_cultlarge("\"You want to be blind, do you?\""))
user.dropItemToGround(src, TRUE)
user.Dizzy(30)
user.set_timed_status_effect(1 MINUTES, /datum/status_effect/dizziness, only_if_higher = TRUE)
user.Paralyze(100)
user.blind_eyes(30)
@@ -1077,12 +1077,12 @@ Striking a noncultist, however, will tear their flesh."}
if(target.can_block_magic() || IS_CULTIST(target))
target.visible_message(span_warning("[src] bounces off of [target], as if repelled by an unseen force!"))
return
return
if(IS_CULTIST(target) && target.put_in_active_hand(src))
playsound(src, 'sound/weapons/throwtap.ogg', 50)
target.visible_message(span_warning("[target] catches [src] out of the air!"))
return
if(!..())
if(!..())
target.Paralyze(30)
if(D?.thrower)
for(var/mob/living/Next in orange(2, T))
@@ -71,4 +71,4 @@
human_in_range.adjustStaminaLoss(10)
if(DT_PROB(25, delta_time))
human_in_range.Dizzy(5)
human_in_range.set_timed_status_effect(10 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
@@ -46,7 +46,7 @@
if(owner.health > owner.crit_threshold && prob(4))
owner.Jitter(10)
owner.Dizzy(5)
owner.set_timed_status_effect(10 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
owner.hallucination = min(owner.hallucination + 3, 24)
if(prob(2))
@@ -312,7 +312,7 @@
sac_target.flash_act()
sac_target.blur_eyes(15)
sac_target.Jitter(10)
sac_target.Dizzy(10)
sac_target.set_timed_status_effect(20 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
sac_target.hallucination += 12
sac_target.emote("scream")
@@ -434,7 +434,7 @@
sac_target.add_confusion(60)
sac_target.Jitter(60)
sac_target.blur_eyes(50)
sac_target.Dizzy(30)
sac_target.set_timed_status_effect(1 MINUTES, /datum/status_effect/dizziness, only_if_higher = TRUE)
sac_target.AdjustKnockdown(80)
sac_target.adjustStaminaLoss(120)
@@ -242,7 +242,7 @@
carbon_victim.adjust_timed_status_effect(1 MINUTES, /datum/status_effect/speech/stutter)
carbon_victim.add_confusion(5)
carbon_victim.Jitter(10)
carbon_victim.Dizzy(20)
carbon_victim.set_timed_status_effect(40 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
carbon_victim.blind_eyes(2)
SEND_SIGNAL(carbon_victim, COMSIG_ADD_MOOD_EVENT, "gates_of_mansus", /datum/mood_event/gates_of_mansus)
playsound(src, 'sound/magic/blind.ogg', 75, TRUE)
@@ -264,7 +264,9 @@
var/obj/item/soulstone/SS = O
if(!IS_CULTIST(user) && !IS_WIZARD(user) && !SS.theme == THEME_HOLY)
to_chat(user, span_danger("An overwhelming feeling of dread comes over you as you attempt to place [SS] into the shell. It would be wise to be rid of this quickly."))
user.Dizzy(30)
if(isliving(user))
var/mob/living/living_user = user
living_user.set_timed_status_effect(1 MINUTES, /datum/status_effect/dizziness, only_if_higher = TRUE)
return
if(SS.theme == THEME_HOLY && IS_CULTIST(user))
SS.hot_potato(user)
+2 -2
View File
@@ -392,7 +392,7 @@
if(!hypnosis)
to_chat(M, span_hypnophrase("The light makes you feel oddly relaxed..."))
M.add_confusion(min(M.get_confusion() + 10, 20))
M.dizziness += min(M.dizziness + 10, 20)
M.adjust_timed_status_effect(20 SECONDS, /datum/status_effect/dizziness, max_duration = 40 SECONDS)
M.adjust_drowsyness(min(M.drowsyness+10, 20))
M.apply_status_effect(/datum/status_effect/pacify, 100)
else
@@ -406,7 +406,7 @@
else if(M.flash_act())
to_chat(M, span_notice("Such a pretty light..."))
M.add_confusion(min(M.get_confusion() + 4, 20))
M.dizziness += min(M.dizziness + 4, 20)
M.adjust_timed_status_effect(8 SECONDS, /datum/status_effect/dizziness, max_duration = 40 SECONDS)
M.adjust_drowsyness(min(M.drowsyness+4, 20))
M.apply_status_effect(/datum/status_effect/pacify, 40)
@@ -28,7 +28,7 @@
paycheck = PAYCHECK_COMMAND
paycheck_department = ACCOUNT_SCI
liver_traits = list(TRAIT_ROYAL_METABOLISM)
liver_traits = list(TRAIT_ROYAL_METABOLISM, TRAIT_BALLMER_SCIENTIST)
display_order = JOB_DISPLAY_ORDER_RESEARCH_DIRECTOR
bounty_types = CIV_JOB_SCI
+2
View File
@@ -17,6 +17,8 @@
paycheck = PAYCHECK_CREW
paycheck_department = ACCOUNT_SCI
liver_traits = list(TRAIT_BALLMER_SCIENTIST)
display_order = JOB_DISPLAY_ORDER_SCIENTIST
bounty_types = CIV_JOB_SCI
departments_list = list(
+3 -3
View File
@@ -5,7 +5,7 @@
///How often a carbon becomes penalized
#define BEYBLADE_DIZZINESS_PROBABILITY 20
///How long the screenshake lasts
#define BEYBLADE_DIZZINESS_VALUE 10
#define BEYBLADE_DIZZINESS_DURATION 20 SECONDS
///How much confusion a carbon gets when penalized
#define BEYBLADE_CONFUSION_INCREMENT 10
///A max for how penalized a carbon will be for beyblading
@@ -121,13 +121,13 @@
return
if(prob(BEYBLADE_DIZZINESS_PROBABILITY))
to_chat(user, span_warning("You feel woozy from spinning."))
user.Dizzy(BEYBLADE_DIZZINESS_VALUE)
user.set_timed_status_effect(BEYBLADE_DIZZINESS_DURATION, /datum/status_effect/dizziness, only_if_higher = TRUE)
if(current_confusion < BEYBLADE_CONFUSION_LIMIT)
user.add_confusion(BEYBLADE_CONFUSION_INCREMENT)
#undef BEYBLADE_PUKE_THRESHOLD
#undef BEYBLADE_PUKE_NUTRIENT_LOSS
#undef BEYBLADE_DIZZINESS_PROBABILITY
#undef BEYBLADE_DIZZINESS_VALUE
#undef BEYBLADE_DIZZINESS_DURATION
#undef BEYBLADE_CONFUSION_INCREMENT
#undef BEYBLADE_CONFUSION_LIMIT
@@ -86,8 +86,6 @@
var/next_hallucination = 0
var/damageoverlaytemp = 0
///Overall drunkenness
var/drunkenness = 0
///used to halt stamina regen temporarily
var/stam_regen_start_time = 0
@@ -27,7 +27,6 @@ GLOBAL_LIST_EMPTY(dead_players_during_shift)
. = ..()
dizziness = 0
jitteriness = 0
if(client && !suiciding && !(client in GLOB.dead_players_during_shift))
GLOB.dead_players_during_shift += client
+18 -30
View File
@@ -17,8 +17,6 @@
. = list("<span class='info'>*---------*\nThis is <EM>[!obscure_name ? name : "Unknown"]</EM>!")
var/obscured = check_obscured_slots()
var/skipface = (wear_mask && (wear_mask.flags_inv & HIDEFACE)) || (head && (head.flags_inv & HIDEFACE))
//uniform
if(w_uniform && !(obscured & ITEM_SLOT_ICLOTHING) && !(w_uniform.item_flags & EXAMINE_SKIP))
@@ -98,7 +96,7 @@
. += wear_id.get_id_examine_strings(user)
//Status effects
var/list/status_examines = status_effect_examines()
var/list/status_examines = get_status_effect_examinations()
if (length(status_examines))
. += status_examines
@@ -304,21 +302,6 @@
msg += "[t_He] [t_is]n't responding to anything around [t_him] and seem[p_s()] to be asleep.\n"
if(!appears_dead)
if(drunkenness && !skipface) //Drunkenness
switch(drunkenness)
if(11 to 21)
msg += "[t_He] [t_is] slightly flushed.\n"
if(21.01 to 41) //.01s are used in case drunkenness ends up to be a small decimal
msg += "[t_He] [t_is] flushed.\n"
if(41.01 to 51)
msg += "[t_He] [t_is] quite flushed and [t_his] breath smells of alcohol.\n"
if(51.01 to 61)
msg += "[t_He] [t_is] very flushed and [t_his] movements jerky, with breath reeking of alcohol.\n"
if(61.01 to 91)
msg += "[t_He] look[p_s()] like a drunken mess.\n"
if(91.01 to INFINITY)
msg += "[t_He] [t_is] a shitfaced, slobbering wreck.\n"
if(src != user)
if(HAS_TRAIT(user, TRAIT_EMPATH))
if (combat_mode)
@@ -430,18 +413,23 @@
SEND_SIGNAL(src, COMSIG_PARENT_EXAMINE, user, .)
/mob/living/proc/status_effect_examines(pronoun_replacement) //You can include this in any mob's examine() to show the examine texts of status effects!
var/list/dat = list()
if(!pronoun_replacement)
pronoun_replacement = p_they(TRUE)
for(var/V in status_effects)
var/datum/status_effect/E = V
if(E.examine_text)
var/new_text = replacetext(E.examine_text, "SUBJECTPRONOUN", pronoun_replacement)
new_text = replacetext(new_text, "[pronoun_replacement] is", "[pronoun_replacement] [p_are()]") //To make sure something become "They are" or "She is", not "They are" and "She are"
dat += "[new_text]\n" //dat.Join("\n") doesn't work here, for some reason
if(dat.len)
return dat.Join()
/**
* Shows any and all examine text related to any status effects the user has.
*/
/mob/living/proc/get_status_effect_examinations()
var/list/examine_list = list()
for(var/datum/status_effect/effect as anything in status_effects)
var/effect_text = effect.get_examine_text()
if(!effect_text)
continue
examine_list += effect_text
if(!length(examine_list))
return
return examine_list.Join("\n")
/mob/living/carbon/human/examine_more(mob/user)
. = ..()
@@ -759,7 +759,6 @@
regenerate_organs()
remove_all_embedded_objects()
set_heartattack(FALSE)
drunkenness = 0
for(var/datum/mutation/human/HM in dna.mutations)
if(HM.quality != POSITIVE)
dna.remove_mutation(HM.name)
-98
View File
@@ -426,39 +426,6 @@ All effects don't start immediately, but rather get worse over time; the rate is
var/restingpwr = 0.5 + 2 * resting
//Dizziness
if(dizziness)
var/old_dizzy = dizziness
dizziness = max(dizziness - (restingpwr * delta_time), 0)
if(client)
//Want to be able to offset things by the time the animation should be "playing" at
var/time = world.time
var/delay = 0
var/pixel_x_diff = 0
var/pixel_y_diff = 0
var/amplitude = old_dizzy*(sin(old_dizzy * (time)) + 1) // This shit is annoying at high strengthvar/pixel_x_diff = 0
var/x_diff = amplitude * sin(old_dizzy * time)
var/y_diff = amplitude * cos(old_dizzy * time)
pixel_x_diff += x_diff
pixel_y_diff += y_diff
// Brief explanation. We're basically snapping between different pixel_x/ys instantly, with delays between
// Doing this with relative changes. This way we don't override any existing pixel_x/y values
// We use EASE_OUT here for similar reasons, we want to act at the end of the delay, not at its start
// Relative animations are weird, so we do actually need this
animate(client, pixel_x = x_diff, pixel_y = y_diff, 3, easing = JUMP_EASING | EASE_OUT, flags = ANIMATION_RELATIVE)
delay += 0.3 SECONDS // This counts as a 0.3 second wait, so we need to shift the sine wave by that much
x_diff = amplitude * sin(dizziness * (time + delay))
y_diff = amplitude * cos(dizziness * (time + delay))
pixel_x_diff += x_diff
pixel_y_diff += y_diff
animate(pixel_x = x_diff, pixel_y = y_diff, 3, easing = JUMP_EASING | EASE_OUT, flags = ANIMATION_RELATIVE)
// Now we reset back to our old pixel_x/y, since these animates are relative
animate(pixel_x = -pixel_x_diff, pixel_y = -pixel_y_diff, 3, easing = JUMP_EASING | EASE_OUT, flags = ANIMATION_RELATIVE)
if(drowsyness)
adjust_drowsyness(-1 * restingpwr * delta_time)
blur_eyes(1 * delta_time)
@@ -479,71 +446,6 @@ All effects don't start immediately, but rather get worse over time; the rate is
if(hallucination)
handle_hallucinations(delta_time, times_fired)
if(drunkenness)
drunkenness = max(drunkenness - ((0.005 + (drunkenness * 0.02)) * delta_time), 0)
if(drunkenness >= 6)
SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "drunk", /datum/mood_event/drunk)
if(DT_PROB(16, delta_time))
adjust_timed_status_effect(4 SECONDS, /datum/status_effect/speech/slurring/drunk)
jitteriness = max(jitteriness - (1.5 * delta_time), 0)
throw_alert(ALERT_DRUNK, /atom/movable/screen/alert/drunk)
sound_environment_override = SOUND_ENVIRONMENT_PSYCHOTIC
else
SEND_SIGNAL(src, COMSIG_CLEAR_MOOD_EVENT, "drunk")
clear_alert(ALERT_DRUNK)
sound_environment_override = SOUND_ENVIRONMENT_NONE
if(drunkenness >= 11)
var/datum/status_effect/speech/slurring/drunk/already_slurring = has_status_effect(/datum/status_effect/speech/slurring/drunk)
if(!already_slurring || already_slurring.duration - world.time <= 10 SECONDS)
adjust_timed_status_effect(1.2 SECONDS * delta_time, /datum/status_effect/speech/slurring/drunk)
if(mind && (is_scientist_job(mind.assigned_role) || is_research_director_job(mind.assigned_role)))
if(SSresearch.science_tech)
if(drunkenness >= 12.9 && drunkenness <= 13.8)
drunkenness = round(drunkenness, 0.01)
if(DT_PROB(2.5, delta_time))
say(pick_list_replacements(VISTA_FILE, "ballmer_good_msg"), forced = "ballmer")
if(drunkenness > 26) // by this point you're into windows ME territory
if(DT_PROB(2.5, delta_time))
say(pick_list_replacements(VISTA_FILE, "ballmer_windows_me_msg"), forced = "ballmer")
if(drunkenness >= 41)
if(DT_PROB(16, delta_time))
add_confusion(2)
Dizzy(5 * delta_time)
if(drunkenness >= 51)
if(DT_PROB(1.5, delta_time))
add_confusion(15)
vomit() // vomiting clears toxloss, consider this a blessing
Dizzy(12.5 * delta_time)
if(drunkenness >= 61)
if(DT_PROB(30, delta_time))
blur_eyes(5)
if(drunkenness >= 71)
blur_eyes(2.5 * delta_time)
if(drunkenness >= 81)
adjustToxLoss(0.5 * delta_time)
if(!stat && DT_PROB(2.5, delta_time))
to_chat(src, span_warning("Maybe you should lie down for a bit..."))
if(drunkenness >= 91)
adjustToxLoss(0.5 * delta_time)
adjustOrganLoss(ORGAN_SLOT_BRAIN, 0.2 * delta_time)
if(DT_PROB(10, delta_time) && !stat)
if(SSshuttle.emergency.mode == SHUTTLE_DOCKED && is_station_level(z)) //QoL mainly
to_chat(src, span_warning("You're so tired... but you can't miss that shuttle..."))
else
to_chat(src, span_warning("Just a quick nap..."))
Sleeping(900)
if(drunkenness >= 101)
adjustToxLoss(1 * delta_time) //Let's be honest you shouldn't be alive by now
/// Base carbon environment handler, adds natural stabilization
/mob/living/carbon/handle_environment(datum/gas_mixture/environment, delta_time, times_fired)
var/areatemp = get_temperature(environment)
-2
View File
@@ -833,7 +833,6 @@
bodytemperature = get_body_temp_normal(apply_change=FALSE)
set_blindness(0)
set_blurriness(0)
set_dizziness(0)
cure_nearsighted()
cure_blind()
cure_husk()
@@ -842,7 +841,6 @@
extinguish_mob()
fire_stacks = 0
set_confusion(0)
dizziness = 0
set_drowsyness(0)
jitteriness = 0
stop_sound_channel(CHANNEL_HEARTBEAT)
@@ -6,7 +6,7 @@
var/obj/act_module = get_active_held_item()
if(act_module)
. += "It is holding [icon2html(act_module, user)] \a [act_module]."
. += status_effect_examines()
. += get_status_effect_examinations()
if (getBruteLoss())
if (getBruteLoss() < maxHealth*0.5)
. += span_warning("It looks slightly dented.")
@@ -211,7 +211,7 @@ Difficulty: Hard
animate(src, pixel_z = rand(5, 15), time = 1, loop = 20)
animate(pixel_z = 0, time = 1)
for(var/mob/living/dizzy_target in get_hearers_in_view(7, src) - src)
dizzy_target.Dizzy(6)
dizzy_target.set_timed_status_effect(12 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
to_chat(dizzy_target, span_danger("The wendigo screams loudly!"))
SLEEP_CHECK_DEATH(1 SECONDS, src)
spiral_attack()
+46
View File
@@ -727,3 +727,49 @@
else if(duration > 0)
apply_status_effect(effect, duration)
/**
* Adjust the "drunk value" the mob is currently experiencing,
* or applies a drunk effect if the mob isn't currently drunk (or tipsy)
*
* The drunk effect doesn't have a set duration, like dizziness or drugginess,
* but instead relies on a value that decreases every status effect tick (2 seconds) by:
* 4% the current drunk_value + 0.01
*
* A "drunk value" of 6 is the border between "tipsy" and "drunk".
*
* amount - the amount of "drunkness" to apply to the mob.
* down_to - the lower end of the clamp, when adding the value
* up_to - the upper end of the clamp, when adding the value
*/
/mob/living/proc/adjust_drunk_effect(amount, down_to = 0, up_to = INFINITY)
if(!isnum(amount))
CRASH("adjust_drunk_effect: called with an invalid amount. (Got: [amount])")
var/datum/status_effect/inebriated/inebriation = has_status_effect(/datum/status_effect/inebriated)
if(inebriation)
inebriation.set_drunk_value(clamp(inebriation.drunk_value + amount, down_to, up_to))
else if(amount > 0)
apply_status_effect(/datum/status_effect/inebriated/tipsy, amount)
/**
* Directly sets the "drunk value" the mob is currently experiencing to the passed value,
* or applies a drunk effect with the passed value if the mob isn't currently drunk
*
* set_to - the amount of "drunkness" to set on the mob.
*/
/mob/living/proc/set_drunk_effect(set_to)
if(!isnum(set_to) || set_to < 0)
CRASH("set_drunk_effect: called with an invalid value. (Got: [set_to])")
var/datum/status_effect/inebriated/inebriation = has_status_effect(/datum/status_effect/inebriated)
if(inebriation)
inebriation.set_drunk_value(set_to)
else if(set_to > 0)
apply_status_effect(/datum/status_effect/inebriated/tipsy, set_to)
/// Helper to get the amount of drunkness the mob's currently experiencing.
/mob/living/proc/get_drunk_amount()
var/datum/status_effect/inebriated/inebriation = has_status_effect(/datum/status_effect/inebriated)
return inebriation?.drunk_value || 0
-3
View File
@@ -1289,9 +1289,6 @@
if(NAMEOF(src, stat))
set_stat(var_value)
. = TRUE
if(NAMEOF(src, dizziness))
set_dizziness(var_value)
. = TRUE
if(NAMEOF(src, eye_blind))
set_blindness(var_value)
. = TRUE
-2
View File
@@ -108,8 +108,6 @@
var/old_bodytemperature = 0
/// Drowsyness level of the mob
var/drowsyness = 0//Carbon
/// Dizziness level of the mob
var/dizziness = 0//Carbon
/// Jitteryness level of the mob
var/jitteriness = 0//Carbon
/// Hunger level of the mob
-12
View File
@@ -7,18 +7,6 @@
/mob/proc/Jitter(amount)
jitteriness = max(jitteriness,amount,0)
/**
* Set the dizzyness of a mob to a passed in amount
*
* Except if dizziness is already higher in which case it does nothing
*/
/mob/proc/Dizzy(amount)
dizziness = max(dizziness,amount,0)
///FOrce set the dizzyness of a mob
/mob/proc/set_dizziness(amount)
dizziness = max(amount, 0)
/**
* Set drowsyness of a mob to passed value
*/
@@ -57,6 +57,6 @@
var/mob/living/L = target
if(L.mob_biotypes & MOB_PLANT)
L.show_message(span_notice("The radiation beam leaves you feeling disoriented!"))
L.Dizzy(15)
L.set_timed_status_effect(30 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
L.emote("flip")
L.emote("spin")
@@ -42,13 +42,14 @@ All effects don't start immediately, but rather get worse over time; the rate is
return ..()
/datum/reagent/consumable/ethanol/on_mob_life(mob/living/carbon/drinker, delta_time, times_fired)
if(drinker.drunkenness < volume * boozepwr * ALCOHOL_THRESHOLD_MODIFIER || boozepwr < 0)
if(drinker.get_drunk_amount() < volume * boozepwr * ALCOHOL_THRESHOLD_MODIFIER || boozepwr < 0)
var/booze_power = boozepwr
if(HAS_TRAIT(drinker, TRAIT_ALCOHOL_TOLERANCE)) //we're an accomplished drinker
booze_power *= 0.7
if(HAS_TRAIT(drinker, TRAIT_LIGHT_DRINKER))
booze_power *= 2
drinker.drunkenness = max((drinker.drunkenness + (sqrt(volume) * booze_power * ALCOHOL_RATE * REM * delta_time)), 0) //Volume, power, and server alcohol rate effect how quickly one gets drunk
// Volume, power, and server alcohol rate effect how quickly one gets drunk
drinker.adjust_drunk_effect(sqrt(volume) * booze_power * ALCOHOL_RATE * REM * delta_time)
if(boozepwr > 0)
var/obj/item/organ/liver/liver = drinker.getorganslot(ORGAN_SLOT_LIVER)
if (istype(liver))
@@ -163,7 +164,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
/datum/reagent/consumable/ethanol/kahlua/on_mob_life(mob/living/carbon/drinker, delta_time, times_fired)
drinker.dizziness = max(drinker.dizziness - (5 * REM * delta_time), 0)
drinker.set_timed_status_effect(10 SECONDS * REM * delta_time, /datum/status_effect/dizziness, only_if_higher = TRUE)
drinker.adjust_drowsyness(-3 * REM * delta_time)
drinker.AdjustSleeping(-40 * REM * delta_time)
if(!HAS_TRAIT(drinker, TRAIT_ALCOHOL_TOLERANCE))
@@ -1469,7 +1470,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
drinker.set_timed_status_effect(100 SECONDS * REM * delta_time, /datum/status_effect/drugginess)
if(!HAS_TRAIT(drinker, TRAIT_ALCOHOL_TOLERANCE))
drinker.set_confusion(max(drinker.get_confusion() + (2 * REM * delta_time),0))
drinker.Dizzy(10 * REM * delta_time)
drinker.set_timed_status_effect(20 SECONDS * REM * delta_time, /datum/status_effect/dizziness, only_if_higher = TRUE)
drinker.adjust_timed_status_effect(6 SECONDS * REM * delta_time, /datum/status_effect/speech/slurring/drunk)
switch(current_cycle)
if(51 to 200)
@@ -1494,7 +1495,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
/datum/reagent/consumable/ethanol/gargle_blaster/on_mob_life(mob/living/carbon/drinker, delta_time, times_fired)
drinker.dizziness += 1.5 * REM * delta_time
drinker.adjust_timed_status_effect(3 SECONDS * REM * delta_time, /datum/status_effect/dizziness)
switch(current_cycle)
if(15 to 45)
drinker.adjust_timed_status_effect(3 SECONDS * REM * delta_time, /datum/status_effect/speech/slurring/drunk)
@@ -1527,7 +1528,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
/datum/reagent/consumable/ethanol/neurotoxin/on_mob_life(mob/living/carbon/drinker, delta_time, times_fired)
drinker.set_timed_status_effect(100 SECONDS * REM * delta_time, /datum/status_effect/drugginess)
drinker.dizziness += 2 * REM * delta_time
drinker.adjust_timed_status_effect(4 SECONDS * REM * delta_time, /datum/status_effect/dizziness)
drinker.adjustOrganLoss(ORGAN_SLOT_BRAIN, 1 * REM * delta_time, 150)
if(DT_PROB(10, delta_time))
drinker.adjustStaminaLoss(10)
@@ -1575,25 +1576,25 @@ All effects don't start immediately, but rather get worse over time; the rate is
switch(current_cycle)
if(1 to 5)
drinker.Dizzy(10 * REM * delta_time)
drinker.set_timed_status_effect(20 SECONDS * REM * delta_time, /datum/status_effect/dizziness, only_if_higher = TRUE)
drinker.set_timed_status_effect(1 MINUTES * REM * delta_time, /datum/status_effect/drugginess)
if(DT_PROB(5, delta_time))
drinker.emote(pick("twitch","giggle"))
if(5 to 10)
drinker.Jitter(20 * REM * delta_time)
drinker.Dizzy(20 * REM * delta_time)
drinker.set_timed_status_effect(40 SECONDS * REM * delta_time, /datum/status_effect/dizziness, only_if_higher = TRUE)
drinker.set_timed_status_effect(1.5 MINUTES * REM * delta_time, /datum/status_effect/drugginess)
if(DT_PROB(10, delta_time))
drinker.emote(pick("twitch","giggle"))
if (10 to 200)
drinker.Jitter(40 * REM * delta_time)
drinker.Dizzy(40 * REM * delta_time)
drinker.set_timed_status_effect(80 SECONDS * REM * delta_time, /datum/status_effect/dizziness, only_if_higher = TRUE)
drinker.set_timed_status_effect(2 MINUTES * REM * delta_time, /datum/status_effect/drugginess)
if(DT_PROB(16, delta_time))
drinker.emote(pick("twitch","giggle"))
if(200 to INFINITY)
drinker.Jitter(60 * REM * delta_time)
drinker.Dizzy(60 * REM * delta_time)
drinker.set_timed_status_effect(120 SECONDS * REM * delta_time, /datum/status_effect/dizziness, only_if_higher = TRUE)
drinker.set_timed_status_effect(2.5 MINUTES * REM * delta_time, /datum/status_effect/drugginess)
if(DT_PROB(23, delta_time))
drinker.emote(pick("twitch","giggle"))
@@ -2304,7 +2305,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
/datum/reagent/consumable/ethanol/turbo/on_mob_life(mob/living/carbon/drinker, delta_time, times_fired)
if(DT_PROB(2, delta_time))
to_chat(drinker, span_notice("[pick("You feel disregard for the rule of law.", "You feel pumped!", "Your head is pounding.", "Your thoughts are racing..")]"))
drinker.adjustStaminaLoss(-0.25 * drinker.drunkenness * REM * delta_time)
drinker.adjustStaminaLoss(-0.25 * drinker.get_drunk_amount() * REM * delta_time)
return ..()
/datum/reagent/consumable/ethanol/old_timer
@@ -2401,7 +2402,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
var/stored_teleports = 0
/datum/reagent/consumable/ethanol/blazaam/on_mob_life(mob/living/carbon/drinker, delta_time, times_fired)
if(drinker.drunkenness > 40)
if(drinker.get_drunk_amount() > 40)
if(stored_teleports)
do_teleport(drinker, get_turf(drinker), rand(1,3), channel = TELEPORT_CHANNEL_WORMHOLE)
stored_teleports--
@@ -536,7 +536,7 @@
H.adjustOrganLoss(ORGAN_SLOT_HEART, max(volume/10, 1) * REM * delta_time) // your heart is barely keeping up!
H.Jitter(rand(0, 2) * REM * delta_time)
H.Dizzy(rand(0, 2) * REM * delta_time)
H.set_timed_status_effect(rand(0 SECONDS, 4 SECONDS) * REM * delta_time, /datum/status_effect/dizziness, only_if_higher = TRUE)
if(DT_PROB(18, delta_time))
to_chat(H,span_danger("Your body is trying to give up, but your heart is still beating!"))
@@ -288,7 +288,7 @@
..()
/datum/reagent/consumable/coffee/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
M.dizziness = max(M.dizziness - (5 * REM * delta_time), 0)
M.adjust_timed_status_effect(-10 SECONDS * REM * delta_time, /datum/status_effect/dizziness)
M.adjust_drowsyness(-3 * REM * delta_time)
M.AdjustSleeping(-40 * REM * delta_time)
//310.15 is the normal bodytemp.
@@ -311,7 +311,7 @@
glass_price = DRINK_PRICE_STOCK
/datum/reagent/consumable/tea/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
M.dizziness = max(M.dizziness - (2 * REM * delta_time), 0)
M.adjust_timed_status_effect(-4 SECONDS * REM * delta_time, /datum/status_effect/dizziness)
M.adjust_drowsyness(-1 * REM * delta_time)
M.jitteriness = max(M.jitteriness - (3 * REM * delta_time), 0)
M.AdjustSleeping(-20 * REM * delta_time)
@@ -363,7 +363,7 @@
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
/datum/reagent/consumable/icecoffee/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
M.dizziness = max(M.dizziness - (5 * REM * delta_time), 0)
M.adjust_timed_status_effect(-10 SECONDS * REM * delta_time, /datum/status_effect/dizziness)
M.adjust_drowsyness(-3 * REM * delta_time)
M.AdjustSleeping(-40 * REM * delta_time)
M.adjust_bodytemperature(-5 * REM * TEMPERATURE_DAMAGE_COEFFICIENT * delta_time, M.get_body_temp_normal())
@@ -383,7 +383,7 @@
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
/datum/reagent/consumable/hot_ice_coffee/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
M.dizziness = max(M.dizziness - (5 * REM * delta_time), 0)
M.adjust_timed_status_effect(-10 SECONDS * REM * delta_time, /datum/status_effect/dizziness)
M.adjust_drowsyness(-3 * REM * delta_time)
M.AdjustSleeping(-60 * REM * delta_time)
M.adjust_bodytemperature(-7 * REM * TEMPERATURE_DAMAGE_COEFFICIENT * delta_time, M.get_body_temp_normal())
@@ -404,7 +404,7 @@
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
/datum/reagent/consumable/icetea/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
M.dizziness = max(M.dizziness - (2 * REM * delta_time), 0)
M.adjust_timed_status_effect(-4 SECONDS * REM * delta_time, /datum/status_effect/dizziness)
M.adjust_drowsyness(-1 * REM * delta_time)
M.AdjustSleeping(-40 * REM * delta_time)
if(M.getToxLoss() && DT_PROB(10, delta_time))
@@ -467,7 +467,7 @@
/datum/reagent/consumable/nuka_cola/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
M.Jitter(20 * REM * delta_time)
M.set_timed_status_effect(1 MINUTES * REM * delta_time, /datum/status_effect/drugginess)
M.dizziness += 1.5 * REM * delta_time
M.adjust_timed_status_effect(3 SECONDS * REM * delta_time, /datum/status_effect/dizziness)
M.set_drowsyness(0)
M.AdjustSleeping(-40 * REM * delta_time)
M.adjust_bodytemperature(-5 * REM * TEMPERATURE_DAMAGE_COEFFICIENT * delta_time, M.get_body_temp_normal())
@@ -506,9 +506,9 @@
M.Jitter(2 * REM * delta_time)
if(prob(50))
M.dizziness += 1 * REM * delta_time
M.adjust_timed_status_effect(2 SECONDS * REM * delta_time, /datum/status_effect/dizziness)
if(current_cycle > 10)
M.dizziness += 1.5 * REM * delta_time
M.adjust_timed_status_effect(3 SECONDS * REM * delta_time, /datum/status_effect/dizziness)
..()
. = TRUE
@@ -534,7 +534,7 @@
/datum/reagent/consumable/grey_bull/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
M.Jitter(20 * REM * delta_time)
M.dizziness += 1 * REM * delta_time
M.adjust_timed_status_effect(2 SECONDS * REM * delta_time, /datum/status_effect/dizziness)
M.set_drowsyness(0)
M.AdjustSleeping(-40 * REM * delta_time)
M.adjust_bodytemperature(-5 * REM * TEMPERATURE_DAMAGE_COEFFICIENT * delta_time, M.get_body_temp_normal())
@@ -661,7 +661,7 @@
mytray.adjust_plant_health(round(chems.get_reagent_amount(type) * 0.1))
/datum/reagent/consumable/sodawater/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
M.dizziness = max(M.dizziness - (5 * REM * delta_time), 0)
M.adjust_timed_status_effect(-10 SECONDS * REM * delta_time, /datum/status_effect/dizziness)
M.adjust_drowsyness(-3 * REM * delta_time)
M.adjust_bodytemperature(-5 * REM * TEMPERATURE_DAMAGE_COEFFICIENT * delta_time, M.get_body_temp_normal())
..()
@@ -677,7 +677,7 @@
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
/datum/reagent/consumable/tonic/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
M.dizziness = max(M.dizziness - (5 * REM * delta_time), 0)
M.adjust_timed_status_effect(10 SECONDS * REM * delta_time, /datum/status_effect/dizziness)
M.adjust_drowsyness(-3 * REM * delta_time)
M.AdjustSleeping(-40 * REM * delta_time)
M.adjust_bodytemperature(-5 * REM * TEMPERATURE_DAMAGE_COEFFICIENT * delta_time, M.get_body_temp_normal())
@@ -697,7 +697,7 @@
/datum/reagent/consumable/monkey_energy/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
M.Jitter(40 * REM * delta_time)
M.dizziness += 1 * REM * delta_time
M.adjust_timed_status_effect(2 SECONDS * REM * delta_time, /datum/status_effect/dizziness)
M.set_drowsyness(0)
M.AdjustSleeping(-40 * REM * delta_time)
M.adjust_bodytemperature(-5 * REM * TEMPERATURE_DAMAGE_COEFFICIENT * delta_time, M.get_body_temp_normal())
@@ -745,7 +745,7 @@
glass_price = DRINK_PRICE_EASY
/datum/reagent/consumable/soy_latte/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
M.dizziness = max(M.dizziness - (5 * REM * delta_time), 0)
M.adjust_timed_status_effect(-10 SECONDS * REM * delta_time, /datum/status_effect/dizziness)
M.adjust_drowsyness(-3 *REM * delta_time)
M.SetSleeping(0)
M.adjust_bodytemperature(5 * REM * TEMPERATURE_DAMAGE_COEFFICIENT * delta_time, 0, M.get_body_temp_normal())
@@ -768,7 +768,7 @@
glass_price = DRINK_PRICE_EASY
/datum/reagent/consumable/cafe_latte/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
M.dizziness = max(M.dizziness - (5 * REM * delta_time), 0)
M.adjust_timed_status_effect(-10 SECONDS * REM * delta_time, /datum/status_effect/dizziness)
M.adjust_drowsyness(-6 * REM * delta_time)
M.SetSleeping(0)
M.adjust_bodytemperature(5 * REM * TEMPERATURE_DAMAGE_COEFFICIENT * delta_time, 0, M.get_body_temp_normal())
@@ -295,7 +295,7 @@
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "happiness_drug", /datum/mood_event/happiness_drug_good_od)
if(2)
M.emote("sway")
M.Dizzy(25)
M.set_timed_status_effect(50 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
if(3)
M.emote("frown")
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "happiness_drug", /datum/mood_event/happiness_drug_bad_od)
@@ -376,7 +376,7 @@
if(prob(10))
victim.blur_eyes(1)
if(prob(10))
victim.Dizzy(1)
victim.set_timed_status_effect(2 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
if(prob(5))
victim.vomit()
@@ -80,7 +80,7 @@
M.SetSleeping(0)
M.silent = FALSE
M.dizziness = 0
M.remove_status_effect(/datum/status_effect/dizziness)
M.disgust = 0
M.drowsyness = 0
// Remove all speech related status effects
@@ -252,7 +252,7 @@
/datum/reagent/medicine/rezadone/overdose_process(mob/living/M, delta_time, times_fired)
M.adjustToxLoss(1 * REM * delta_time, 0)
M.Dizzy(5 * REM * delta_time)
M.set_timed_status_effect(10 SECONDS * REM * delta_time, /datum/status_effect/dizziness, only_if_higher = TRUE)
M.Jitter(5 * REM * delta_time)
..()
. = TRUE
@@ -629,7 +629,7 @@
/datum/reagent/medicine/morphine/overdose_process(mob/living/M, delta_time, times_fired)
if(DT_PROB(18, delta_time))
M.drop_all_held_items()
M.Dizzy(2)
M.set_timed_status_effect(4 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
M.Jitter(2)
..()
@@ -773,14 +773,14 @@
. = TRUE
M.losebreath = 0
if(DT_PROB(10, delta_time))
M.Dizzy(5)
M.set_timed_status_effect(10 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
M.Jitter(5)
..()
/datum/reagent/medicine/atropine/overdose_process(mob/living/M, delta_time, times_fired)
M.adjustToxLoss(0.5 * REM * delta_time, 0)
. = TRUE
M.Dizzy(1 * REM * delta_time)
M.set_timed_status_effect(2 SECONDS * REM * delta_time, /datum/status_effect/dizziness, only_if_higher = TRUE)
M.Jitter(1 * REM * delta_time)
..()
@@ -991,15 +991,13 @@
inverse_chem = /datum/reagent/inverse/antihol
/datum/reagent/medicine/antihol/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
M.dizziness = 0
M.remove_status_effect(/datum/status_effect/dizziness)
M.set_drowsyness(0)
M.remove_status_effect(/datum/status_effect/speech/slurring/drunk)
M.set_confusion(0)
M.reagents.remove_all_type(/datum/reagent/consumable/ethanol, 3 * REM * delta_time * normalise_creation_purity(), FALSE, TRUE)
M.adjustToxLoss(-0.2 * REM * delta_time, 0)
if(ishuman(M))
var/mob/living/carbon/human/H = M
H.drunkenness = max(H.drunkenness - (10 * REM * delta_time * normalise_creation_purity()), 0)
M.adjust_drunk_effect(-10 * REM * delta_time * normalise_creation_purity())
..()
. = TRUE
@@ -1215,7 +1213,7 @@
metabolizer.AdjustAllImmobility(-20 * REM * delta_time)
metabolizer.adjustStaminaLoss(-10 * REM * delta_time, 0)
metabolizer.Jitter(10 * REM * delta_time)
metabolizer.Dizzy(10 * REM * delta_time)
metabolizer.set_timed_status_effect(20 SECONDS * REM * delta_time, /datum/status_effect/dizziness, only_if_higher = TRUE)
return TRUE
/datum/reagent/medicine/changelingadrenaline/on_mob_metabolize(mob/living/L)
@@ -1229,7 +1227,7 @@
REMOVE_TRAIT(L, TRAIT_SLEEPIMMUNE, type)
REMOVE_TRAIT(L, TRAIT_STUNRESISTANCE, type)
L.remove_movespeed_mod_immunities(type, /datum/movespeed_modifier/damage_slowdown)
L.Dizzy(0)
L.remove_status_effect(/datum/status_effect/dizziness)
L.Jitter(0)
/datum/reagent/medicine/changelingadrenaline/overdose_process(mob/living/metabolizer, delta_time, times_fired)
@@ -1342,7 +1340,7 @@
if(1 to 40)
M.jitteriness = min(M.jitteriness + (1 * REM * delta_time), 10)
M.adjust_timed_status_effect(2 SECONDS * REM * delta_time, /datum/status_effect/speech/stutter, max_duration = 20 SECONDS)
M.Dizzy(5 * REM * delta_time)
M.set_timed_status_effect(10 SECONDS * REM * delta_time, /datum/status_effect/dizziness, only_if_higher = TRUE)
if(DT_PROB(30, delta_time))
M.losebreath++
if(41 to 80)
@@ -1350,7 +1348,7 @@
M.adjustStaminaLoss(0.1 * REM * delta_time, 0)
M.jitteriness = min(M.jitteriness + (1 * REM * delta_time), 20)
M.adjust_timed_status_effect(2 SECONDS * REM * delta_time, /datum/status_effect/speech/stutter, max_duration = 40 SECONDS)
M.Dizzy(10 * REM * delta_time)
M.set_timed_status_effect(20 SECONDS * REM * delta_time, /datum/status_effect/dizziness, only_if_higher = TRUE)
if(DT_PROB(30, delta_time))
M.losebreath++
if(DT_PROB(10, delta_time))
@@ -1388,7 +1386,7 @@
/datum/reagent/medicine/psicodine/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
M.jitteriness = max(M.jitteriness - (6 * REM * delta_time), 0)
M.dizziness = max(M.dizziness - (6 * REM * delta_time), 0)
M.adjust_timed_status_effect(-12 SECONDS * REM * delta_time, /datum/status_effect/dizziness)
M.set_confusion(max(M.get_confusion() - (6 * REM * delta_time), 0))
M.disgust = max(M.disgust - (6 * REM * delta_time), 0)
var/datum/component/mood/mood = M.GetComponent(/datum/component/mood)
@@ -292,7 +292,7 @@
qdel(BS)
if(data["misc"] >= (25 SECONDS)) // 10 units
M.adjust_timed_status_effect(4 SECONDS * delta_time, /datum/status_effect/speech/stutter, max_duration = 20 SECONDS)
M.Dizzy(5)
M.set_timed_status_effect(10 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
if(IS_CULTIST(M) && DT_PROB(10, delta_time))
M.say(pick("Av'te Nar'Sie","Pa'lid Mors","INO INO ORA ANA","SAT ANA!","Daim'niodeis Arc'iai Le'eones","R'ge Na'sie","Diabo us Vo'iscum","Eld' Mon Nobis"), forced = "holy water")
if(prob(10))
@@ -1229,7 +1229,7 @@
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
/datum/reagent/cryptobiolin/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
M.Dizzy(1)
M.set_timed_status_effect(2 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
M.set_confusion(clamp(M.get_confusion(), 1, 20))
..()
@@ -2499,8 +2499,7 @@
/datum/reagent/peaceborg/confuse/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
if(M.get_confusion() < 6)
M.set_confusion(clamp(M.get_confusion() + (3 * REM * delta_time), 0, 5))
if(M.dizziness < 6)
M.dizziness = clamp(M.dizziness + (3 * REM * delta_time), 0, 5)
M.adjust_timed_status_effect(6 SECONDS * REM * delta_time, /datum/status_effect/dizziness, max_duration = 12 SECONDS)
if(DT_PROB(10, delta_time))
to_chat(M, "You feel confused and disoriented.")
..()
@@ -1176,7 +1176,13 @@
/datum/reagent/toxin/bungotoxin/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
M.adjustOrganLoss(ORGAN_SLOT_HEART, 3 * REM * delta_time)
M.set_confusion(M.dizziness) //add a tertiary effect here if this is isn't an effective poison.
//add a tertiary effect here if this is isn't an effective poison.
var/datum/status_effect/dizziness/mob_dizziness = M.has_status_effect(/datum/status_effect/dizziness)
if(mob_dizziness)
// Gain confusion = (seconds remaining in dizziness) / 2
M.set_confusion((mob_dizziness.duration - world.time) / 20)
if(current_cycle >= 12 && DT_PROB(4, delta_time))
var/tox_message = pick("You feel your heart spasm in your chest.", "You feel faint.","You feel you need to catch your breath.","You feel a prickle of pain in your chest.")
to_chat(M, span_notice("[tox_message]"))
@@ -137,7 +137,7 @@
var/lums = T.get_lumcount()
if(lums > 0.5)
SEND_SIGNAL(affected_human, COMSIG_ADD_MOOD_EVENT, "too_bright", /datum/mood_event/bright_light)
affected_human.dizziness = min(40, affected_human.dizziness + 3)
affected_human.adjust_timed_status_effect(6 SECONDS, /datum/status_effect/dizziness, max_duration = 80 SECONDS)
affected_human.set_confusion(min(affected_human.get_confusion() + (0.5 * delta_time), 20))
else
SEND_SIGNAL(affected_carbon, COMSIG_CLEAR_MOOD_EVENT, "too_bright")
@@ -503,24 +503,36 @@
/datum/status_effect/stabilized/purple
id = "stabilizedpurple"
colour = "purple"
/// Whether we healed from our last tick
var/healed_last_tick = FALSE
/datum/status_effect/stabilized/purple/tick()
var/is_healing = FALSE
healed_last_tick = FALSE
if(owner.getBruteLoss() > 0)
owner.adjustBruteLoss(-0.2)
is_healing = TRUE
healed_last_tick = TRUE
if(owner.getFireLoss() > 0)
owner.adjustFireLoss(-0.2)
is_healing = TRUE
healed_last_tick = TRUE
if(owner.getToxLoss() > 0)
owner.adjustToxLoss(-0.2, forced = TRUE) //Slimepeople should also get healed.
is_healing = TRUE
if(is_healing)
examine_text = "<span class='warning'>SUBJECTPRONOUN is regenerating slowly, purplish goo filling in small injuries!</span>"
// Forced, so slimepeople are healed as well.
owner.adjustToxLoss(-0.2, forced = TRUE)
healed_last_tick = TRUE
// Technically, "healed this tick" by now.
if(healed_last_tick)
new /obj/effect/temp_visual/heal(get_turf(owner), "#FF0000")
else
examine_text = null
..()
return ..()
/datum/status_effect/stabilized/purple/get_examine_text()
if(healed_last_tick)
return span_warning("[owner.p_they(TRUE)] [owner.p_are()] regenerating slowly, purplish goo filling in small injuries!")
return null
/datum/status_effect/stabilized/blue
id = "stabilizedblue"
@@ -562,7 +574,9 @@
colour = "yellow"
var/cooldown = 10
var/max_cooldown = 10
examine_text = "<span class='warning'>Nearby electronics seem just a little more charged wherever SUBJECTPRONOUN goes.</span>"
/datum/status_effect/stabilized/yellow/get_examine_text()
return span_warning("Nearby electronics seem just a little more charged wherever [owner.p_they()] go[owner.p_es()].")
/datum/status_effect/stabilized/yellow/tick()
if(cooldown > 0)
@@ -590,7 +604,6 @@
id = "stabilizeddarkpurple"
colour = "dark purple"
var/obj/item/hothands/fire
examine_text = "<span class='notice'>Their fingertips burn brightly!</span>"
/datum/status_effect/stabilized/darkpurple/on_apply()
ADD_TRAIT(owner, TRAIT_RESISTHEATHANDS, "slimestatus")
@@ -599,17 +612,20 @@
/datum/status_effect/stabilized/darkpurple/tick()
var/obj/item/item = owner.get_active_held_item()
if(IS_EDIBLE(item))
if(item.microwave_act())
if(item)
if(IS_EDIBLE(item) && item.microwave_act())
to_chat(owner, span_warning("[linked_extract] flares up brightly, and your hands alone are enough cook [item]!"))
else
item.attackby(fire, owner)
else
item.attackby(fire, owner)
return ..()
/datum/status_effect/stabilized/darkpurple/on_remove()
REMOVE_TRAIT(owner, TRAIT_RESISTHEATHANDS, "slimestatus")
qdel(fire)
/datum/status_effect/stabilized/darkpurple/get_examine_text()
return span_notice("[owner.p_their(TRUE)] fingertips burn brightly!")
/datum/status_effect/stabilized/darkblue
id = "stabilizeddarkblue"
colour = "dark blue"
@@ -797,12 +813,12 @@
H.dna.update_dna_identity()
return ..()
/datum/status_effect/stabilized/green/tick() //Only occasionally give examiners a warning.
// Only occasionally give examiners a warning.
/datum/status_effect/stabilized/green/get_examine_text()
if(prob(50))
examine_text = "<span class='warning'>SUBJECTPRONOUN looks a bit green and gooey...</span>"
else
examine_text = null
return ..()
return span_warning("[owner.p_they(TRUE)] look[owner.p_s()] a bit green and gooey...")
return null
/datum/status_effect/stabilized/green/on_remove()
to_chat(owner, span_notice("You feel more like yourself."))
@@ -878,47 +894,87 @@
/datum/status_effect/stabilized/oil
id = "stabilizedoil"
colour = "oil"
examine_text = "<span class='warning'>SUBJECTPRONOUN smells of sulfer and oil!</span>"
/datum/status_effect/stabilized/oil/tick()
if(owner.stat == DEAD)
explosion(owner, devastation_range = 1, heavy_impact_range = 2, light_impact_range = 4, flame_range = 5, explosion_cause = src)
return ..()
/datum/status_effect/stabilized/oil/get_examine_text()
return span_warning("[owner.p_they(TRUE)] smell[owner.p_s()] of sulfer and oil!")
/// How much damage is dealt per healing done for the stabilized back.
/// This multiplier is applied to prevent two people from converting each other's damage away.
#define DRAIN_DAMAGE_MULTIPLIER 1.2
/datum/status_effect/stabilized/black
id = "stabilizedblack"
colour = "black"
var/messagedelivered = FALSE
/// How much we heal per tick (also how much we damage per tick times DRAIN_DAMAGE_MULTIPLIER).
var/heal_amount = 1
/// Weakref to the mob we're currently draining every tick.
var/datum/weakref/draining_ref
/datum/status_effect/stabilized/black/on_apply()
RegisterSignal(owner, COMSIG_MOVABLE_SET_GRAB_STATE, .proc/on_grab)
return ..()
/datum/status_effect/stabilized/black/on_remove()
UnregisterSignal(owner, COMSIG_MOVABLE_SET_GRAB_STATE)
return ..()
/// Whenever we grab someone by the neck, set "draining" to a weakref of them.
/datum/status_effect/stabilized/black/proc/on_grab(mob/living/source, new_state)
SIGNAL_HANDLER
if(new_state < GRAB_KILL || !isliving(source.pulling))
draining_ref = null
return
var/mob/living/draining = source.pulling
if(draining.stat == DEAD)
return
draining_ref = WEAKREF(draining)
to_chat(owner, span_boldnotice("You feel your hands melt around [draining]'s neck as you start to drain [draining.p_them()] of [draining.p_their()] life!"))
to_chat(draining, span_userdanger("[owner]'s hands melt around your neck as you can feel your life starting to drain away!"))
/datum/status_effect/stabilized/black/get_examine_text()
var/mob/living/draining = draining_ref?.resolve()
if(!draining)
return null
return span_warning("[owner.p_they(TRUE)] [owner.p_are()] draining health from [draining]!")
/datum/status_effect/stabilized/black/tick()
if(owner.pulling && isliving(owner.pulling) && owner.grab_state == GRAB_KILL)
var/mob/living/M = owner.pulling
if(M.stat == DEAD)
return
if(!messagedelivered)
to_chat(owner,span_notice("You feel your hands melt around [M]'s neck and start to drain [M.p_them()] of life."))
to_chat(owner.pulling, span_userdanger("[owner]'s hands melt around your neck, and you can feel your life starting to drain away!"))
messagedelivered = TRUE
examine_text = "<span class='warning'>SUBJECTPRONOUN is draining health from [owner.pulling]!</span>"
var/list/healing_types = list()
if(owner.getBruteLoss() > 0)
healing_types += BRUTE
if(owner.getFireLoss() > 0)
healing_types += BURN
if(owner.getToxLoss() > 0)
healing_types += TOX
if(owner.getCloneLoss() > 0)
healing_types += CLONE
if(length(healing_types))
owner.apply_damage_type(-heal_amount, damagetype=pick(healing_types))
owner.adjust_nutrition(3)
M.adjustCloneLoss(heal_amount * 1.2) //This way, two people can't just convert each other's damage away.
else
messagedelivered = FALSE
examine_text = null
if(owner.grab_state < GRAB_KILL || !IS_WEAKREF_OF(owner.pulling, draining_ref))
return
var/mob/living/drained = draining_ref.resolve()
if(drained.stat == DEAD)
to_chat(owner, span_warning("[drained] is dead, you cannot drain anymore life from them!"))
draining_ref = null
return
var/list/healing_types = list()
if(owner.getBruteLoss() > 0)
healing_types += BRUTE
if(owner.getFireLoss() > 0)
healing_types += BURN
if(owner.getToxLoss() > 0)
healing_types += TOX
if(owner.getCloneLoss() > 0)
healing_types += CLONE
if(length(healing_types))
owner.apply_damage_type(-heal_amount, damagetype = pick(healing_types))
owner.adjust_nutrition(3)
drained.adjustCloneLoss(heal_amount * DRAIN_DAMAGE_MULTIPLIER)
return ..()
#undef DRAIN_DAMAGE_MULTIPLIER
/datum/status_effect/stabilized/lightpink
id = "stabilizedlightpink"
colour = "light pink"
@@ -942,7 +998,9 @@
/datum/status_effect/stabilized/adamantine
id = "stabilizedadamantine"
colour = "adamantine"
examine_text = "<span class='warning'>SUBJECTPRONOUN has a strange metallic coating on their skin.</span>"
/datum/status_effect/stabilized/adamantine/get_examine_text()
return span_warning("[owner.p_they(TRUE)] [owner.p_have()] strange metallic coating on [owner.p_their()] skin.")
/datum/status_effect/stabilized/gold
id = "stabilizedgold"
+1 -1
View File
@@ -215,7 +215,7 @@
if(. & EMP_PROTECT_SELF)
return
if(!COOLDOWN_FINISHED(src, severe_cooldown)) //So we cant just spam emp to kill people.
owner.Dizzy(10)
owner.set_timed_status_effect(20 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
owner.losebreath += 10
COOLDOWN_START(src, severe_cooldown, 20 SECONDS)
if(prob(emp_vulnerability/severity)) //Chance of permanent effects
@@ -226,7 +226,7 @@
disgusted.add_confusion(2.5)
disgusted.adjust_timed_status_effect(2 SECONDS, /datum/status_effect/speech/stutter)
disgusted.vomit(10, 0, 1, 0, 1, 0)
disgusted.Dizzy(5)
disgusted.set_timed_status_effect(10 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
if(disgust >= DISGUST_LEVEL_DISGUSTED)
if(DT_PROB(13, delta_time))
disgusted.blur_eyes(3) //We need to add more shit down here
+2
View File
@@ -1118,7 +1118,9 @@
#include "code\datums\status_effects\stacking_effect.dm"
#include "code\datums\status_effects\wound_effects.dm"
#include "code\datums\status_effects\debuffs\debuffs.dm"
#include "code\datums\status_effects\debuffs\dizziness.dm"
#include "code\datums\status_effects\debuffs\drugginess.dm"
#include "code\datums\status_effects\debuffs\drunk.dm"
#include "code\datums\status_effects\debuffs\speech_debuffs.dm"
#include "code\datums\weather\weather.dm"
#include "code\datums\weather\weather_types\ash_storm.dm"