mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-12 07:33:34 +01:00
Redo of jitteriness and dizziness.
Fixes #2923 Conflicts: code/game/gamemodes/changeling/changeling_powers.dm code/game/mecha/equipment/weapons/weapons.dm code/modules/mob/living/carbon/human/life.dm code/modules/mob/mob.dm code/modules/mob/mob_defines.dm code/modules/reagents/Chemistry-Reagents.dm
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
/* 21st Sept 2010
|
||||
Updated by Skie -- Still not perfect but better!
|
||||
Stuff you can't do:
|
||||
Call proc /mob/proc/make_dizzy() for some player
|
||||
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.
|
||||
|
||||
@@ -186,12 +186,12 @@
|
||||
msg += "[t_He] [t_is] wearing \icon[wear_id] \a [wear_id].\n"
|
||||
|
||||
//Jitters
|
||||
if(is_jittery)
|
||||
if(jitteriness >= 300)
|
||||
switch(jitteriness)
|
||||
if(300 to INFINITY)
|
||||
msg += "<span class='warning'><B>[t_He] [t_is] convulsing violently!</B></span>\n"
|
||||
else if(jitteriness >= 200)
|
||||
if(200 to 300)
|
||||
msg += "<span class='warning'>[t_He] [t_is] extremely jittery.</span>\n"
|
||||
else if(jitteriness >= 100)
|
||||
if(1 to 100)
|
||||
msg += "<span class='warning'>[t_He] [t_is] twitching ever so slightly.</span>\n"
|
||||
|
||||
//splints
|
||||
|
||||
@@ -164,6 +164,7 @@
|
||||
else
|
||||
return ONE_ATMOSPHERE - pressure_difference
|
||||
|
||||
|
||||
/mob/living/carbon/human
|
||||
|
||||
proc/handle_disabilities()
|
||||
@@ -175,7 +176,7 @@
|
||||
continue
|
||||
O.show_message(text("\red <B>[src] starts having a seizure!"), 1)
|
||||
Paralyse(10)
|
||||
make_jittery(1000)
|
||||
Jitter(1000)
|
||||
|
||||
// If we have the gene for being crazy, have random events.
|
||||
if(dna.GetSEState(HALLUCINATIONBLOCK))
|
||||
@@ -185,26 +186,19 @@
|
||||
if (disabilities & COUGHING)
|
||||
if ((prob(5) && paralysis <= 1))
|
||||
drop_item()
|
||||
spawn( 0 )
|
||||
emote("cough")
|
||||
return
|
||||
emote("cough")
|
||||
if (disabilities & TOURETTES)
|
||||
if ((prob(10) && paralysis <= 1))
|
||||
Stun(10)
|
||||
spawn( 0 )
|
||||
switch(rand(1, 3))
|
||||
if(1)
|
||||
emote("twitch")
|
||||
if(2 to 3)
|
||||
say("[prob(50) ? ";" : ""][pick("SHIT", "PISS", "FUCK", "CUNT", "COCKSUCKER", "MOTHERFUCKER", "TITS")]")
|
||||
var/old_x = pixel_x
|
||||
var/old_y = pixel_y
|
||||
pixel_x += rand(-2,2)
|
||||
pixel_y += rand(-1,1)
|
||||
sleep(2)
|
||||
pixel_x = old_x
|
||||
pixel_y = old_y
|
||||
return
|
||||
switch(rand(1, 3))
|
||||
if(1)
|
||||
emote("twitch")
|
||||
if(2 to 3)
|
||||
say("[prob(50) ? ";" : ""][pick("SHIT", "PISS", "FUCK", "CUNT", "COCKSUCKER", "MOTHERFUCKER", "TITS")]")
|
||||
var/x_offset = pixel_x + rand(-2,2)
|
||||
var/y_offset = pixel_y + rand(-1,1)
|
||||
animate(src, pixel_x = x_offset, pixel_y = y_offset, time = 1)
|
||||
animate(pixel_x = pixel_x, pixel_y = pixel_y, time = 1)
|
||||
if (disabilities & NERVOUS)
|
||||
if (prob(10))
|
||||
stuttering = max(10, stuttering)
|
||||
@@ -1176,6 +1170,50 @@
|
||||
else if(ear_damage < 25) //ear damage heals slowly under this threshold. otherwise you'll need earmuffs
|
||||
ear_damage = max(ear_damage-0.05, 0)
|
||||
|
||||
//Dizziness
|
||||
if(dizziness)
|
||||
var/client/C = client
|
||||
var/pixel_x_diff = 0
|
||||
var/pixel_y_diff = 0
|
||||
var/temp
|
||||
var/saved_dizz = dizziness
|
||||
dizziness = max(dizziness-1, 0)
|
||||
if(C)
|
||||
var/oldsrc = src
|
||||
var/amplitude = dizziness*(sin(dizziness * 0.044 * world.time) + 1) / 70 // This shit is annoying at high strength
|
||||
src = null
|
||||
spawn(0)
|
||||
if(C)
|
||||
temp = amplitude * sin(0.008 * saved_dizz * world.time)
|
||||
pixel_x_diff += temp
|
||||
C.pixel_x += temp
|
||||
temp = amplitude * cos(0.008 * saved_dizz * world.time)
|
||||
pixel_y_diff += temp
|
||||
C.pixel_y += temp
|
||||
sleep(3)
|
||||
if(C)
|
||||
temp = amplitude * sin(0.008 * saved_dizz * world.time)
|
||||
pixel_x_diff += temp
|
||||
C.pixel_x += temp
|
||||
temp = amplitude * cos(0.008 * saved_dizz * world.time)
|
||||
pixel_y_diff += temp
|
||||
C.pixel_y += temp
|
||||
sleep(3)
|
||||
if(C)
|
||||
C.pixel_x -= pixel_x_diff
|
||||
C.pixel_y -= pixel_y_diff
|
||||
src = oldsrc
|
||||
|
||||
//Jitteryness
|
||||
if(jitteriness)
|
||||
var/amplitude = min(4, (jitteriness/100) + 1)
|
||||
var/pixel_x_diff = rand(-amplitude, amplitude)
|
||||
var/pixel_y_diff = rand(-amplitude/3, amplitude/3)
|
||||
|
||||
animate(src, pixel_x = pixel_x + pixel_x_diff, pixel_y = pixel_y + pixel_y_diff , time = 2, loop = -1)
|
||||
animate(pixel_x = pixel_x - pixel_x_diff, pixel_y = pixel_y - pixel_y_diff, time = 2)
|
||||
jitteriness = max(jitteriness-1, 0)
|
||||
|
||||
//Other
|
||||
if(stunned)
|
||||
AdjustStunned(-1)
|
||||
|
||||
+1194
-1261
File diff suppressed because it is too large
Load Diff
@@ -99,8 +99,6 @@
|
||||
var/bodytemperature = 310.055 //98.7 F
|
||||
var/drowsyness = 0.0//Carbon
|
||||
var/dizziness = 0//Carbon
|
||||
var/is_dizzy = 0
|
||||
var/is_jittery = 0
|
||||
var/jitteriness = 0//Carbon
|
||||
var/charges = 0.0
|
||||
var/nutrition = 400.0//Carbon
|
||||
@@ -226,4 +224,4 @@
|
||||
|
||||
var/list/active_genes=list()
|
||||
|
||||
var/last_movement = -100 // Last world.time the mob actually moved of its own accord.
|
||||
var/last_movement = -100 // Last world.time the mob actually moved of its own accord.
|
||||
@@ -1475,7 +1475,7 @@ datum
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if(!M) M = holder.my_atom
|
||||
M.make_dizzy(1)
|
||||
M.Dizzy(1)
|
||||
if(!M.confused) M.confused = 1
|
||||
M.confused = max(M.confused, 20)
|
||||
holder.remove_reagent(src.id, 0.5 * REAGENTS_METABOLISM)
|
||||
@@ -1906,8 +1906,8 @@ datum
|
||||
M.status_flags &= ~DISFIGURED
|
||||
if(35 to INFINITY)
|
||||
M.adjustToxLoss(1)
|
||||
M.make_dizzy(5)
|
||||
M.make_jittery(5)
|
||||
M.Dizzy(5)
|
||||
M.Jitter(5)
|
||||
|
||||
..()
|
||||
return
|
||||
@@ -2036,7 +2036,7 @@ datum
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if(!data) data = 1
|
||||
data++
|
||||
M.make_dizzy(5)
|
||||
M.Dizzy(5)
|
||||
M.jitteriness = max(M.jitteriness-5,0)
|
||||
if(data >= 25)
|
||||
if (!M.stuttering) M.stuttering = 1
|
||||
@@ -2464,18 +2464,18 @@ datum
|
||||
switch(data)
|
||||
if(1 to 5)
|
||||
if (!M.stuttering) M.stuttering = 1
|
||||
M.make_dizzy(5)
|
||||
M.Dizzy(5)
|
||||
if(prob(10)) M.emote(pick("twitch","giggle"))
|
||||
if(5 to 10)
|
||||
if (!M.stuttering) M.stuttering = 1
|
||||
M.make_jittery(10)
|
||||
M.make_dizzy(10)
|
||||
M.Jitter(10)
|
||||
M.Dizzy(10)
|
||||
M.druggy = max(M.druggy, 35)
|
||||
if(prob(20)) M.emote(pick("twitch","giggle"))
|
||||
if (10 to INFINITY)
|
||||
if (!M.stuttering) M.stuttering = 1
|
||||
M.make_jittery(20)
|
||||
M.make_dizzy(20)
|
||||
M.Jitter(20)
|
||||
M.Dizzy(20)
|
||||
M.druggy = max(M.druggy, 40)
|
||||
if(prob(30)) M.emote(pick("twitch","giggle"))
|
||||
holder.remove_reagent(src.id, 0.2)
|
||||
@@ -2731,6 +2731,7 @@ datum
|
||||
if(M.getToxLoss() && prob(20)) M.adjustToxLoss(-1)
|
||||
return
|
||||
|
||||
|
||||
carrotjuice
|
||||
name = "Carrot juice"
|
||||
id = "carrotjuice"
|
||||
@@ -2860,7 +2861,7 @@ datum
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
..()
|
||||
M.make_jittery(5)
|
||||
M.Jitter(5)
|
||||
if(adj_temp > 0 && holder.has_reagent("frostoil"))
|
||||
holder.remove_reagent("frostoil", 10*REAGENTS_METABOLISM)
|
||||
|
||||
@@ -2916,12 +2917,13 @@ datum
|
||||
M.adjustToxLoss(-1)
|
||||
return
|
||||
|
||||
icetea
|
||||
name = "Iced Tea"
|
||||
id = "icetea"
|
||||
description = "No relation to a certain rap artist/ actor."
|
||||
color = "#104038" // rgb: 16, 64, 56
|
||||
adj_temp = -5
|
||||
|
||||
icetea
|
||||
name = "Iced Tea"
|
||||
id = "icetea"
|
||||
description = "No relation to a certain rap artist/ actor."
|
||||
color = "#104038" // rgb: 16, 64, 56
|
||||
adj_temp = -5
|
||||
|
||||
kahlua
|
||||
name = "Kahlua"
|
||||
@@ -2934,7 +2936,7 @@ datum
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
..()
|
||||
M.make_jittery(5)
|
||||
M.Jitter(5)
|
||||
return
|
||||
|
||||
cold
|
||||
@@ -2981,7 +2983,7 @@ datum
|
||||
adj_sleepy = -2
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
M.make_jittery(20)
|
||||
M.Jitter(20)
|
||||
M.druggy = max(M.druggy, 30)
|
||||
M.dizziness +=5
|
||||
M.drowsyness = 0
|
||||
@@ -3075,7 +3077,7 @@ datum
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
..()
|
||||
M.make_jittery(5)
|
||||
M.Jitter(5)
|
||||
return
|
||||
|
||||
hippies_delight
|
||||
@@ -3092,18 +3094,18 @@ datum
|
||||
switch(data)
|
||||
if(1 to 5)
|
||||
if (!M.stuttering) M.stuttering = 1
|
||||
M.make_dizzy(10)
|
||||
M.Dizzy(10)
|
||||
if(prob(10)) M.emote(pick("twitch","giggle"))
|
||||
if(5 to 10)
|
||||
if (!M.stuttering) M.stuttering = 1
|
||||
M.make_jittery(20)
|
||||
M.make_dizzy(20)
|
||||
M.Jitter(20)
|
||||
M.Dizzy(20)
|
||||
M.druggy = max(M.druggy, 45)
|
||||
if(prob(20)) M.emote(pick("twitch","giggle"))
|
||||
if (10 to INFINITY)
|
||||
if (!M.stuttering) M.stuttering = 1
|
||||
M.make_jittery(40)
|
||||
M.make_dizzy(40)
|
||||
M.Jitter(40)
|
||||
M.Dizzy(40)
|
||||
M.druggy = max(M.druggy, 60)
|
||||
if(prob(30)) M.emote(pick("twitch","giggle"))
|
||||
holder.remove_reagent(src.id, 0.2)
|
||||
@@ -3164,7 +3166,6 @@ datum
|
||||
if (istype(L))
|
||||
L.take_damage(0.1, 1)
|
||||
H.adjustToxLoss(0.1)
|
||||
|
||||
holder.remove_reagent(src.id, 0.4)
|
||||
..()
|
||||
return
|
||||
@@ -3327,7 +3328,7 @@ datum
|
||||
// M:sleeping = max(0,M.sleeping-2)
|
||||
if (M.bodytemperature > 310)
|
||||
M.bodytemperature = max(310, M.bodytemperature-5)
|
||||
M.make_jittery(1)
|
||||
M.Jitter(1)
|
||||
return
|
||||
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
C.adjustBrainLoss(rand(5,25) * weakness)
|
||||
C.radiation += 25 * weakness
|
||||
C.nutrition -= min(50 * weakness, C.nutrition)
|
||||
C.make_dizzy(6 * weakness)
|
||||
C.Dizzy(6 * weakness)
|
||||
C.weakened += 6 * weakness
|
||||
|
||||
/datum/artifact_effect/hurt/DoEffectAura()
|
||||
|
||||
Reference in New Issue
Block a user