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:
MrPerson
2014-02-27 23:19:44 -08:00
committed by ZomgPonies
parent 207959cc7d
commit 5bb608e56e
13 changed files with 1291 additions and 1321 deletions
@@ -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
+56 -18
View File
@@ -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
View File
File diff suppressed because it is too large Load Diff
+1 -3
View File
@@ -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.