* Fixes the holosign_creator's sign counter not going back up when one of its holosign is destroyed.

* Fixes the lack of second argument in alien/stun()
* Fixes the sleeping alert not being updated properly when a mob asleep is killed then revived.
* Fixes timestop effect leaving mobs unable to move forever in some cases.
* Fixes teleporter hub and station staying active when the hub's panel is open, despite the hub's open panel sprite looking offline. The Hub and station now use their own iconfile icons/obj/machines/teleporter.dmi (similar what most machines have).

* I've moved all mob's status adjustment procs (Stun(), Paralyse(), blur_eyes() adjust_drugginess(), etc...) into specific files (named "status_procs.dm") so they're easier to find. I've added a third argument to stun adjustments procs to ignore the CANSTUN flag. I've also changed the weaken procs to have the ignore_canweaken argument be the third argument, so all status adjustment procs have amount as first arg, updating the mob or not as second, and when necessary an ignore_x as third arg.
This commit is contained in:
phil235
2016-04-28 00:13:15 +02:00
committed by phil235
parent 3a91fab55c
commit 2ad8d4a392
25 changed files with 553 additions and 432 deletions
+11 -5
View File
@@ -237,7 +237,7 @@
/obj/machinery/teleport
name = "teleport"
icon = 'icons/obj/stationobjs.dmi'
icon = 'icons/obj/machines/teleporter.dmi'
density = 1
anchored = 1
@@ -297,6 +297,9 @@
/obj/machinery/teleport/hub/attackby(obj/item/W, mob/user, params)
if(default_deconstruction_screwdriver(user, "tele-o", "tele0", W))
if(power_station && power_station.engaged)
power_station.engaged = 0 //hub with panel open is off, so the station must be informed.
update_icon()
return
if(exchange_parts(user, W))
return
@@ -450,9 +453,12 @@
if(stat & (BROKEN|NOPOWER) || !teleporter_hub || !teleporter_console )
return
if (teleporter_console.target)
src.engaged = !src.engaged
use_power(5000)
visible_message("<span class='notice'>Teleporter [engaged ? "" : "dis"]engaged!</span>")
if(teleporter_hub.panel_open || teleporter_hub.stat & (BROKEN|NOPOWER))
visible_message("<span class='alert'>The teleporter hub isn't responding.</span>")
else
src.engaged = !src.engaged
use_power(5000)
visible_message("<span class='notice'>Teleporter [engaged ? "" : "dis"]engaged!</span>")
else
visible_message("<span class='alert'>No target detected.</span>")
src.engaged = 0
@@ -469,7 +475,7 @@
/obj/machinery/teleport/station/update_icon()
if(panel_open)
icon_state = "controller-o"
else if(stat & NOPOWER)
else if(stat & (BROKEN|NOPOWER))
icon_state = "controller-p"
else
icon_state = "controller"
@@ -25,7 +25,6 @@
var/obj/effect/overlay/holograph/H = locate(holosign_type) in T
if(H)
user << "<span class='notice'>You use [src] to deactivate [H].</span>"
signs.Remove(H)
qdel(H)
else
if(!is_blocked_turf(T)) //can't put holograms on a tile that has dense stuff
@@ -44,8 +43,7 @@
return
if(is_blocked_turf(T)) //don't try to sneak dense stuff on our tile during the wait.
return
H = new holosign_type(get_turf(target))
signs += H
H = new holosign_type(get_turf(target), src)
user << "<span class='notice'>You create \a [H] with [src].</span>"
else
user << "<span class='notice'>[src] is projecting at max capacity!</span>"
@@ -55,10 +53,8 @@
/obj/item/weapon/holosign_creator/attack_self(mob/user)
if(signs.len)
var/list/L = signs.Copy()
for(var/sign in L)
qdel(sign)
signs -= sign
for(var/H in signs)
qdel(H)
user << "<span class='notice'>You clear all active holograms.</span>"
@@ -83,6 +79,19 @@
icon = 'icons/effects/effects.dmi'
anchored = 1
var/holo_integrity = 1
var/obj/item/weapon/holosign_creator/projector
/obj/effect/overlay/holograph/New(loc, source_projector)
if(source_projector)
projector = source_projector
projector.signs += src
..()
/obj/effect/overlay/holograph/Destroy()
if(projector)
projector.signs -= src
projector = null
return ..()
/obj/effect/overlay/holograph/attacked_by(obj/item/I, mob/user)
..()
@@ -137,14 +137,6 @@
if(statpanel("Status"))
stat(null, "Intent: [a_intent]")
/mob/living/carbon/alien/Stun(amount)
if(status_flags & CANSTUN)
stunned = max(max(stunned,amount),0) //can't go below 0, getting a low amount of stun doesn't lower your current stun
else
// add some movement delay
move_delay_add = min(move_delay_add + round(amount / 2), 10) // a maximum delay of 10
return
/mob/living/carbon/alien/getTrail()
if(getBruteLoss() < 200)
return pick (list("xltrails_1", "xltrails2"))
@@ -0,0 +1,14 @@
//Here are the procs used to modify status effects of a mob.
//The effects include: stunned, weakened, paralysis, sleeping, resting, jitteriness, dizziness, ear damage,
// eye damage, eye_blind, eye_blurry, druggy, BLIND disability, and NEARSIGHT disability.
/////////////////////////////////// STUNNED ////////////////////////////////////
/mob/living/carbon/alien/Stun(amount, updating = 1, ignore_canstun = 0)
if(status_flags & CANSTUN || ignore_canstun)
stunned = max(max(stunned,amount),0) //can't go below 0, getting a low amount of stun doesn't lower your current stun
if(updating)
update_canmove()
else
// add some movement delay
move_delay_add = min(move_delay_add + round(amount / 2), 10) // a maximum delay of 10
@@ -54,33 +54,6 @@
/mob/living/carbon/brain/handle_disabilities()
return
/mob/living/carbon/brain/setEarDamage() // no ears to damage or heal
return
/mob/living/carbon/brain/adjustEarDamage()
return
/mob/living/carbon/brain/blind_eyes() // no eyes to damage or heal
return
/mob/living/carbon/brain/blur_eyes()
return
/mob/living/carbon/brain/adjust_blindness()
return
/mob/living/carbon/brain/adjust_blurriness()
return
/mob/living/carbon/brain/set_blindness()
return
/mob/living/carbon/brain/set_blurriness()
return
/mob/living/carbon/brain/become_blind()
return
/mob/living/carbon/brain/handle_changeling()
return
@@ -0,0 +1,38 @@
//Here are the procs used to modify status effects of a mob.
//The effects include: stunned, weakened, paralysis, sleeping, resting, jitteriness, dizziness, ear damage,
// eye damage, eye_blind, eye_blurry, druggy, BLIND disability, and NEARSIGHT disability.
/////////////////////////////////// EAR DAMAGE ////////////////////////////////////
/mob/living/carbon/brain/adjustEarDamage()
return
/mob/living/carbon/brain/setEarDamage() // no ears to damage or heal
return
/////////////////////////////////// EYE_BLIND ////////////////////////////////////
/mob/living/carbon/brain/blind_eyes() // no eyes to damage or heal
return
/mob/living/carbon/brain/adjust_blindness()
return
/mob/living/carbon/brain/set_blindness()
return
/////////////////////////////////// EYE_BLURRY ////////////////////////////////////
/mob/living/carbon/brain/blur_eyes()
return
/mob/living/carbon/brain/adjust_blurriness()
return
/mob/living/carbon/brain/set_blurriness()
return
/////////////////////////////////// BLIND DISABILITY ////////////////////////////////////
/mob/living/carbon/brain/become_blind()
return
@@ -0,0 +1,79 @@
//Here are the procs used to modify status effects of a mob.
//The effects include: stunned, weakened, paralysis, sleeping, resting, jitteriness, dizziness, ear damage,
// eye damage, eye_blind, eye_blurry, druggy, BLIND disability, and NEARSIGHT disability.
/mob/living/carbon/damage_eyes(amount)
if(amount>0)
eye_damage = amount
if(eye_damage > 20)
if(eye_damage > 30)
overlay_fullscreen("eye_damage", /obj/screen/fullscreen/impaired, 2)
else
overlay_fullscreen("eye_damage", /obj/screen/fullscreen/impaired, 1)
/mob/living/carbon/set_eye_damage(amount)
eye_damage = max(amount,0)
if(eye_damage > 20)
if(eye_damage > 30)
overlay_fullscreen("eye_damage", /obj/screen/fullscreen/impaired, 2)
else
overlay_fullscreen("eye_damage", /obj/screen/fullscreen/impaired, 1)
else
clear_fullscreen("eye_damage")
/mob/living/carbon/adjust_eye_damage(amount)
eye_damage = max(eye_damage+amount, 0)
if(eye_damage > 20)
if(eye_damage > 30)
overlay_fullscreen("eye_damage", /obj/screen/fullscreen/impaired, 2)
else
overlay_fullscreen("eye_damage", /obj/screen/fullscreen/impaired, 1)
else
clear_fullscreen("eye_damage")
/mob/living/carbon/adjust_drugginess(amount)
var/old_druggy = druggy
if(amount>0)
druggy += amount
if(!old_druggy)
overlay_fullscreen("high", /obj/screen/fullscreen/high)
throw_alert("high", /obj/screen/alert/high)
else if(old_druggy)
druggy = max(druggy+amount, 0)
if(!druggy)
clear_fullscreen("high")
clear_alert("high")
/mob/living/carbon/set_drugginess(amount)
var/old_druggy = druggy
druggy = amount
if(amount>0)
if(!old_druggy)
overlay_fullscreen("high", /obj/screen/fullscreen/high)
throw_alert("high", /obj/screen/alert/high)
else if(old_druggy)
clear_fullscreen("high")
clear_alert("high")
/mob/living/carbon/cure_blind()
if(disabilities & BLIND)
disabilities &= ~BLIND
adjust_blindness(-1)
return 1
/mob/living/carbon/become_blind()
if(!(disabilities & BLIND))
disabilities |= BLIND
blind_eyes(1)
return 1
/mob/living/carbon/cure_nearsighted()
if(disabilities & NEARSIGHT)
disabilities &= ~NEARSIGHT
clear_fullscreen("nearsighted")
return 1
/mob/living/carbon/become_nearsighted()
if(!(disabilities & NEARSIGHT))
disabilities |= NEARSIGHT
overlay_fullscreen("nearsighted", /obj/screen/fullscreen/impaired, 1)
return 1
+2 -1
View File
@@ -49,7 +49,8 @@
paralysis = 0
stunned = 0
weakened = 0
sleeping = 0
set_drugginess(0)
SetSleeping(0, 0)
blind_eyes(1)
reset_perspective(null)
hide_fullscreens()
+2 -2
View File
@@ -86,9 +86,9 @@
if(paralysis)
AdjustParalysis(-1)
if(stunned)
AdjustStunned(-1)
AdjustStunned(-1, 1, 1)
if(weakened)
AdjustWeakened(-1, ignore_canweaken=1)
AdjustWeakened(-1, 1, 1)
/mob/living/proc/handle_disabilities()
//Eyes
-183
View File
@@ -429,18 +429,6 @@ Sorry Giacom. Please don't be mad :(
var/obj/item/organ/limb/def_zone = ran_zone(t)
return def_zone
//damage/heal the mob ears and adjust the deaf amount
/mob/living/adjustEarDamage(damage, deaf)
ear_damage = max(0, ear_damage + damage)
ear_deaf = max(0, ear_deaf + deaf)
//pass a negative argument to skip one of the variable
/mob/living/setEarDamage(damage, deaf)
if(damage >= 0)
ear_damage = damage
if(deaf >= 0)
ear_deaf = deaf
// heal ONE external organ, organ gets randomly selected from damaged ones.
/mob/living/proc/heal_organ_damage(brute, burn, updating_health=1)
adjustBruteLoss(-brute, updating_health)
@@ -998,174 +986,3 @@ Sorry Giacom. Please don't be mad :(
/mob/proc/update_sight()
return
/mob/proc/blind_eyes(amount)
if(amount>0)
var/old_eye_blind = eye_blind
eye_blind = max(eye_blind, amount)
if(!old_eye_blind)
throw_alert("blind", /obj/screen/alert/blind)
overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
/mob/proc/adjust_blindness(amount)
if(amount>0)
var/old_eye_blind = eye_blind
eye_blind += amount
if(!old_eye_blind)
throw_alert("blind", /obj/screen/alert/blind)
overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
else if(eye_blind)
var/blind_minimum = 0
if(stat != CONSCIOUS || (disabilities & BLIND))
blind_minimum = 1
eye_blind = max(eye_blind+amount, blind_minimum)
if(!eye_blind)
clear_alert("blind")
clear_fullscreen("blind")
/mob/proc/set_blindness(amount)
if(amount>0)
var/old_eye_blind = eye_blind
eye_blind = amount
if(client && !old_eye_blind)
throw_alert("blind", /obj/screen/alert/blind)
overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
else if(eye_blind)
var/blind_minimum = 0
if(stat != CONSCIOUS || (disabilities & BLIND))
blind_minimum = 1
eye_blind = blind_minimum
if(!eye_blind)
clear_alert("blind")
clear_fullscreen("blind")
/mob/proc/blur_eyes(amount)
if(amount>0)
var/old_eye_blurry = eye_blurry
eye_blurry = max(amount, eye_blurry)
if(!old_eye_blurry)
overlay_fullscreen("blurry", /obj/screen/fullscreen/blurry)
/mob/proc/adjust_blurriness(amount)
var/old_eye_blurry = eye_blurry
eye_blurry = max(eye_blurry+amount, 0)
if(amount>0)
if(!old_eye_blurry)
overlay_fullscreen("blurry", /obj/screen/fullscreen/blurry)
else if(old_eye_blurry && !eye_blurry)
clear_fullscreen("blurry")
/mob/proc/set_blurriness(amount)
var/old_eye_blurry = eye_blurry
eye_blurry = max(amount, 0)
if(amount>0)
if(!old_eye_blurry)
overlay_fullscreen("blurry", /obj/screen/fullscreen/blurry)
else if(old_eye_blurry)
clear_fullscreen("blurry")
/mob/proc/damage_eyes(amount)
return
/mob/living/carbon/damage_eyes(amount)
if(amount>0)
eye_damage = amount
if(eye_damage > 20)
if(eye_damage > 30)
overlay_fullscreen("eye_damage", /obj/screen/fullscreen/impaired, 2)
else
overlay_fullscreen("eye_damage", /obj/screen/fullscreen/impaired, 1)
/mob/proc/set_eye_damage(amount)
return
/mob/living/carbon/set_eye_damage(amount)
eye_damage = max(amount,0)
if(eye_damage > 20)
if(eye_damage > 30)
overlay_fullscreen("eye_damage", /obj/screen/fullscreen/impaired, 2)
else
overlay_fullscreen("eye_damage", /obj/screen/fullscreen/impaired, 1)
else
clear_fullscreen("eye_damage")
/mob/proc/adjust_eye_damage(amount)
return
/mob/living/carbon/adjust_eye_damage(amount)
eye_damage = max(eye_damage+amount, 0)
if(eye_damage > 20)
if(eye_damage > 30)
overlay_fullscreen("eye_damage", /obj/screen/fullscreen/impaired, 2)
else
overlay_fullscreen("eye_damage", /obj/screen/fullscreen/impaired, 1)
else
clear_fullscreen("eye_damage")
/mob/proc/adjust_drugginess(amount)
return
/mob/living/carbon/adjust_drugginess(amount)
var/old_druggy = druggy
if(amount>0)
druggy += amount
if(!old_druggy)
overlay_fullscreen("high", /obj/screen/fullscreen/high)
throw_alert("high", /obj/screen/alert/high)
else if(old_druggy)
druggy = max(druggy+amount, 0)
if(!druggy)
clear_fullscreen("high")
clear_alert("high")
/mob/proc/set_drugginess(amount)
return
/mob/living/carbon/set_drugginess(amount)
var/old_druggy = druggy
druggy = amount
if(amount>0)
if(!old_druggy)
overlay_fullscreen("high", /obj/screen/fullscreen/high)
throw_alert("high", /obj/screen/alert/high)
else if(old_druggy)
clear_fullscreen("high")
clear_alert("high")
/mob/proc/cure_blind() //when we want to cure the BLIND disability only.
return
/mob/living/carbon/cure_blind()
if(disabilities & BLIND)
disabilities &= ~BLIND
adjust_blindness(-1)
return 1
/mob/proc/cure_nearsighted()
return
/mob/living/carbon/cure_nearsighted()
if(disabilities & NEARSIGHT)
disabilities &= ~NEARSIGHT
clear_fullscreen("nearsighted")
return 1
/mob/proc/become_nearsighted()
return
/mob/living/carbon/become_nearsighted()
if(!(disabilities & NEARSIGHT))
disabilities |= NEARSIGHT
overlay_fullscreen("nearsighted", /obj/screen/fullscreen/impaired, 1)
return 1
/mob/proc/become_blind()
return
/mob/living/carbon/become_blind()
if(!(disabilities & BLIND))
disabilities |= BLIND
blind_eyes(1)
return 1
@@ -457,12 +457,6 @@
"<span class='warning'>[M] punches [src], but doesn't leave a dent.</span>")
return 0
/mob/living/silicon/adjustEarDamage()
return
/mob/living/silicon/setEarDamage()
return
/mob/living/silicon/proc/GetPhoto()
if (aicamera)
return aicamera.selectpicture(aicamera)
@@ -489,33 +483,3 @@
animate(src, transform = ntransform, time = 2,easing = EASE_IN|EASE_OUT)
return ..()
/mob/living/silicon/Stun(amount)
if(status_flags & CANSTUN)
stunned = max(max(stunned,amount),0) //can't go below 0, getting a low amount of stun doesn't lower your current stun
update_stat()
/mob/living/silicon/SetStunned(amount) //if you REALLY need to set stun to a set amount without the whole "can't go below current stunned"
if(status_flags & CANSTUN)
stunned = max(amount,0)
update_stat()
/mob/living/silicon/AdjustStunned(amount)
if(status_flags & CANSTUN)
stunned = max(stunned + amount,0)
update_stat()
/mob/living/silicon/Weaken(amount, ignore_canweaken = 0)
if(status_flags & CANWEAKEN || ignore_canweaken)
weakened = max(max(weakened,amount),0)
update_stat()
/mob/living/silicon/SetWeakened(amount)
if(status_flags & CANWEAKEN)
weakened = max(amount,0)
update_stat()
/mob/living/silicon/AdjustWeakened(amount, ignore_canweaken = 0)
if(status_flags & CANWEAKEN || ignore_canweaken)
weakened = max(weakened + amount,0)
update_stat()
@@ -0,0 +1,52 @@
//Here are the procs used to modify status effects of a mob.
//The effects include: stunned, weakened, paralysis, sleeping, resting, jitteriness, dizziness, ear damage,
// eye damage, eye_blind, eye_blurry, druggy, BLIND disability, and NEARSIGHT disability.
/////////////////////////////////// STUNNED ////////////////////////////////////
/mob/living/silicon/Stun(amount, updating = 1, ignore_canstun = 0)
if(status_flags & CANSTUN || ignore_canstun)
stunned = max(max(stunned,amount),0) //can't go below 0, getting a low amount of stun doesn't lower your current stun
if(updating)
update_stat()
/mob/living/silicon/AdjustStunned(amount, updating = 1, ignore_canstun = 0)
if(status_flags & CANSTUN || ignore_canstun)
stunned = max(stunned + amount,0)
if(updating)
update_stat()
/mob/living/silicon/SetStunned(amount, updating = 1, ignore_canstun = 0) //if you REALLY need to set stun to a set amount without the whole "can't go below current stunned"
if(status_flags & CANSTUN || ignore_canstun)
stunned = max(amount,0)
if(updating)
update_stat()
/////////////////////////////////// WEAKENED ////////////////////////////////////
/mob/living/silicon/Weaken(amount, updating = 1, ignore_canweaken = 0)
if(status_flags & CANWEAKEN || ignore_canweaken)
weakened = max(max(weakened,amount),0)
if(updating)
update_stat()
/mob/living/silicon/AdjustWeakened(amount, updating = 1, ignore_canweaken = 0)
if(status_flags & CANWEAKEN || ignore_canweaken)
weakened = max(weakened + amount,0)
if(updating)
update_stat()
/mob/living/silicon/SetWeakened(amount, updating = 1, ignore_canweaken = 0)
if(status_flags & CANWEAKEN || ignore_canweaken)
weakened = max(amount,0)
if(updating)
update_stat()
/////////////////////////////////// EAR DAMAGE ////////////////////////////////////
/mob/living/silicon/adjustEarDamage()
return
/mob/living/silicon/setEarDamage()
return
@@ -111,32 +111,6 @@
else
stat = CONSCIOUS
/mob/living/simple_animal/blind_eyes()
return
/mob/living/simple_animal/blur_eyes()
return
/mob/living/simple_animal/adjust_blindness()
return
/mob/living/simple_animal/adjust_blurriness()
return
/mob/living/simple_animal/set_blindness()
return
/mob/living/simple_animal/set_blurriness()
return
/mob/living/simple_animal/become_blind()
return
/mob/living/simple_animal/setEarDamage()
return
/mob/living/simple_animal/adjustEarDamage()
return
/mob/living/simple_animal/handle_status_effects()
..()
@@ -0,0 +1,34 @@
/mob/living/simple_animal/blind_eyes()
return
/mob/living/simple_animal/adjust_blindness()
return
/mob/living/simple_animal/set_blindness()
return
/mob/living/simple_animal/blur_eyes()
return
/mob/living/simple_animal/adjust_blurriness()
return
/mob/living/simple_animal/set_blurriness()
return
/mob/living/simple_animal/become_blind()
return
/mob/living/simple_animal/adjustEarDamage()
return
/mob/living/simple_animal/setEarDamage()
return
+17
View File
@@ -0,0 +1,17 @@
//Here are the procs used to modify status effects of a mob.
//The effects include: stunned, weakened, paralysis, sleeping, resting, jitteriness, dizziness, ear damage,
// eye damage, eye_blind, eye_blurry, druggy, BLIND disability, and NEARSIGHT disability.
/////////////////////////////////// EAR DAMAGE ////////////////////////////////////
//damage/heal the mob ears and adjust the deaf amount
/mob/living/adjustEarDamage(damage, deaf)
ear_damage = max(0, ear_damage + damage)
ear_deaf = max(0, ear_deaf + deaf)
//pass a negative argument to skip one of the variable
/mob/living/setEarDamage(damage, deaf)
if(damage >= 0)
ear_damage = damage
if(deaf >= 0)
ear_deaf = deaf
+12 -122
View File
@@ -753,120 +753,6 @@ var/next_mob_id = 0
/mob/proc/activate_hand(selhand)
return
/mob/proc/Jitter(amount)
jitteriness = max(jitteriness,amount,0)
/mob/proc/Dizzy(amount)
dizziness = max(dizziness,amount,0)
/mob/proc/Stun(amount, updating_canmove = 1)
if(status_flags & CANSTUN)
stunned = max(max(stunned,amount),0) //can't go below 0, getting a low amount of stun doesn't lower your current stun
if(updating_canmove)
update_canmove()
/mob/proc/SetStunned(amount, updating_canmove = 1) //if you REALLY need to set stun to a set amount without the whole "can't go below current stunned"
if(status_flags & CANSTUN)
stunned = max(amount,0)
if(updating_canmove)
update_canmove()
/mob/proc/AdjustStunned(amount, updating_canmove = 1)
if(status_flags & CANSTUN)
stunned = max(stunned + amount,0)
if(updating_canmove)
update_canmove()
/mob/proc/Weaken(amount, ignore_canweaken = 0, updating_canmove = 1)
if((status_flags & CANWEAKEN) || ignore_canweaken)
weakened = max(max(weakened,amount),0)
if(updating_canmove)
update_canmove() //updates lying, canmove and icons
/mob/proc/SetWeakened(amount, updating_canmove = 1)
if(status_flags & CANWEAKEN)
weakened = max(amount,0)
if(updating_canmove)
update_canmove() //updates lying, canmove and icons
/mob/proc/AdjustWeakened(amount, ignore_canweaken = 0, updating_canmove = 1)
if((status_flags & CANWEAKEN) || ignore_canweaken)
weakened = max(weakened + amount,0)
if(updating_canmove)
update_canmove() //updates lying, canmove and icons
/mob/proc/Paralyse(amount, updating_stat = 1)
if(status_flags & CANPARALYSE)
var/old_paralysis = paralysis
paralysis = max(max(paralysis,amount),0)
if((!old_paralysis && paralysis) || (old_paralysis && !paralysis))
if(updating_stat)
update_stat()
/mob/proc/SetParalysis(amount, updating_stat = 1)
if(status_flags & CANPARALYSE)
var/old_paralysis = paralysis
paralysis = max(amount,0)
if((!old_paralysis && paralysis) || (old_paralysis && !paralysis))
if(updating_stat)
update_stat()
/mob/proc/AdjustParalysis(amount, updating_stat = 1)
if(status_flags & CANPARALYSE)
var/old_paralysis = paralysis
paralysis = max(paralysis + amount,0)
if((!old_paralysis && paralysis) || (old_paralysis && !paralysis))
if(updating_stat)
update_stat()
/mob/proc/Sleeping(amount, updating_stat = 1)
var/old_sleeping = sleeping
sleeping = max(max(sleeping,amount),0)
if(!old_sleeping && sleeping)
throw_alert("asleep", /obj/screen/alert/asleep)
if(updating_stat)
update_stat()
else if(old_sleeping && !sleeping)
clear_alert("asleep")
if(updating_stat)
update_stat()
/mob/proc/SetSleeping(amount, updating_stat = 1)
var/old_sleeping = sleeping
sleeping = max(amount,0)
if(!old_sleeping && sleeping)
throw_alert("asleep", /obj/screen/alert/asleep)
if(updating_stat)
update_stat()
else if(old_sleeping && !sleeping)
clear_alert("asleep")
if(updating_stat)
update_stat()
/mob/proc/AdjustSleeping(amount, updating_stat = 1)
var/old_sleeping = sleeping
sleeping = max(sleeping + amount,0)
if(!old_sleeping && sleeping)
throw_alert("asleep", /obj/screen/alert/asleep)
if(updating_stat)
update_stat()
else if(old_sleeping && !sleeping)
clear_alert("asleep")
if(updating_stat)
update_stat()
/mob/proc/Resting(amount)
resting = max(max(resting,amount),0)
update_canmove()
/mob/proc/SetResting(amount)
resting = max(amount,0)
update_canmove()
/mob/proc/AdjustResting(amount)
resting = max(resting + amount,0)
update_canmove()
/mob/proc/assess_threat() //For sec bot threat assessment
return
@@ -884,14 +770,6 @@ var/next_mob_id = 0
ghost.notify_cloning(message, sound, source)
return ghost
/mob/proc/adjustEarDamage()
return
/mob/proc/setEarDamage()
return
/mob/proc/AddSpell(obj/effect/proc_holder/spell/S)
mob_spell_list += S
S.action.Grant(src)
@@ -1054,3 +932,15 @@ var/next_mob_id = 0
updatehealth()
if("resize")
update_transform()
/mob/living/carbon/alien/adjustToxLoss(amount)
return
/mob/living/carbon/alien/adjustFireLoss(amount) // Weak to Fire
if(amount > 0)
..(amount * 2)
else
..(amount)
return
+255
View File
@@ -0,0 +1,255 @@
//Here are the procs used to modify status effects of a mob.
//The effects include: stunned, weakened, paralysis, sleeping, resting, jitteriness, dizziness, ear damage,
// eye damage, eye_blind, eye_blurry, druggy, BLIND disability, and NEARSIGHT disability.
/////////////////////////////////// STUNNED ////////////////////////////////////
/mob/proc/Stun(amount, updating = 1, ignore_canstun = 0)
if(status_flags & CANSTUN || ignore_canstun)
stunned = max(max(stunned,amount),0) //can't go below 0, getting a low amount of stun doesn't lower your current stun
if(updating)
update_canmove()
/mob/proc/SetStunned(amount, updating = 1, ignore_canstun = 0) //if you REALLY need to set stun to a set amount without the whole "can't go below current stunned"
if(status_flags & CANSTUN || ignore_canstun)
stunned = max(amount,0)
if(updating)
update_canmove()
/mob/proc/AdjustStunned(amount, updating = 1, ignore_canstun = 0)
if(status_flags & CANSTUN || ignore_canstun)
stunned = max(stunned + amount,0)
if(updating)
update_canmove()
/////////////////////////////////// WEAKENED ////////////////////////////////////
/mob/proc/Weaken(amount, updating = 1, ignore_canweaken = 0)
if((status_flags & CANWEAKEN) || ignore_canweaken)
weakened = max(max(weakened,amount),0)
if(updating)
update_canmove() //updates lying, canmove and icons
/mob/proc/SetWeakened(amount, updating = 1, ignore_canweaken = 0)
if(status_flags & CANWEAKEN)
weakened = max(amount,0)
if(updating)
update_canmove() //updates lying, canmove and icons
/mob/proc/AdjustWeakened(amount, updating = 1, ignore_canweaken = 0)
if((status_flags & CANWEAKEN) || ignore_canweaken)
weakened = max(weakened + amount,0)
if(updating)
update_canmove() //updates lying, canmove and icons
/////////////////////////////////// PARALYSIS ////////////////////////////////////
/mob/proc/Paralyse(amount, updating = 1)
if(status_flags & CANPARALYSE)
var/old_paralysis = paralysis
paralysis = max(max(paralysis,amount),0)
if((!old_paralysis && paralysis) || (old_paralysis && !paralysis))
if(updating)
update_stat()
/mob/proc/SetParalysis(amount, updating = 1)
if(status_flags & CANPARALYSE)
var/old_paralysis = paralysis
paralysis = max(amount,0)
if((!old_paralysis && paralysis) || (old_paralysis && !paralysis))
if(updating)
update_stat()
/mob/proc/AdjustParalysis(amount, updating = 1)
if(status_flags & CANPARALYSE)
var/old_paralysis = paralysis
paralysis = max(paralysis + amount,0)
if((!old_paralysis && paralysis) || (old_paralysis && !paralysis))
if(updating)
update_stat()
/////////////////////////////////// SLEEPING ////////////////////////////////////
/mob/proc/Sleeping(amount, updating = 1)
var/old_sleeping = sleeping
sleeping = max(max(sleeping,amount),0)
if(!old_sleeping && sleeping)
throw_alert("asleep", /obj/screen/alert/asleep)
if(updating)
update_stat()
else if(old_sleeping && !sleeping)
clear_alert("asleep")
if(updating)
update_stat()
/mob/proc/SetSleeping(amount, updating = 1)
var/old_sleeping = sleeping
sleeping = max(amount,0)
if(!old_sleeping && sleeping)
throw_alert("asleep", /obj/screen/alert/asleep)
if(updating)
update_stat()
else if(old_sleeping && !sleeping)
clear_alert("asleep")
if(updating)
update_stat()
/mob/proc/AdjustSleeping(amount, updating = 1)
var/old_sleeping = sleeping
sleeping = max(sleeping + amount,0)
if(!old_sleeping && sleeping)
throw_alert("asleep", /obj/screen/alert/asleep)
if(updating)
update_stat()
else if(old_sleeping && !sleeping)
clear_alert("asleep")
if(updating)
update_stat()
/////////////////////////////////// RESTING ////////////////////////////////////
/mob/proc/Resting(amount)
resting = max(max(resting,amount),0)
update_canmove()
/mob/proc/SetResting(amount)
resting = max(amount,0)
update_canmove()
/mob/proc/AdjustResting(amount)
resting = max(resting + amount,0)
update_canmove()
/////////////////////////////////// JITTERINESS ////////////////////////////////////
/mob/proc/Jitter(amount)
jitteriness = max(jitteriness,amount,0)
/////////////////////////////////// DIZZINESS ////////////////////////////////////
/mob/proc/Dizzy(amount)
dizziness = max(dizziness,amount,0)
/////////////////////////////////// EAR DAMAGE ////////////////////////////////////
/mob/proc/adjustEarDamage()
return
/mob/proc/setEarDamage()
return
/////////////////////////////////// EYE DAMAGE ////////////////////////////////////
/mob/proc/damage_eyes(amount)
return
/mob/proc/adjust_eye_damage(amount)
return
/mob/proc/set_eye_damage(amount)
return
/////////////////////////////////// EYE_BLIND ////////////////////////////////////
/mob/proc/blind_eyes(amount)
if(amount>0)
var/old_eye_blind = eye_blind
eye_blind = max(eye_blind, amount)
if(!old_eye_blind)
throw_alert("blind", /obj/screen/alert/blind)
overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
/mob/proc/adjust_blindness(amount)
if(amount>0)
var/old_eye_blind = eye_blind
eye_blind += amount
if(!old_eye_blind)
throw_alert("blind", /obj/screen/alert/blind)
overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
else if(eye_blind)
var/blind_minimum = 0
if(stat != CONSCIOUS || (disabilities & BLIND))
blind_minimum = 1
eye_blind = max(eye_blind+amount, blind_minimum)
if(!eye_blind)
clear_alert("blind")
clear_fullscreen("blind")
/mob/proc/set_blindness(amount)
if(amount>0)
var/old_eye_blind = eye_blind
eye_blind = amount
if(client && !old_eye_blind)
throw_alert("blind", /obj/screen/alert/blind)
overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
else if(eye_blind)
var/blind_minimum = 0
if(stat != CONSCIOUS || (disabilities & BLIND))
blind_minimum = 1
eye_blind = blind_minimum
if(!eye_blind)
clear_alert("blind")
clear_fullscreen("blind")
/////////////////////////////////// EYE_BLURRY ////////////////////////////////////
/mob/proc/blur_eyes(amount)
if(amount>0)
var/old_eye_blurry = eye_blurry
eye_blurry = max(amount, eye_blurry)
if(!old_eye_blurry)
overlay_fullscreen("blurry", /obj/screen/fullscreen/blurry)
/mob/proc/adjust_blurriness(amount)
var/old_eye_blurry = eye_blurry
eye_blurry = max(eye_blurry+amount, 0)
if(amount>0)
if(!old_eye_blurry)
overlay_fullscreen("blurry", /obj/screen/fullscreen/blurry)
else if(old_eye_blurry && !eye_blurry)
clear_fullscreen("blurry")
/mob/proc/set_blurriness(amount)
var/old_eye_blurry = eye_blurry
eye_blurry = max(amount, 0)
if(amount>0)
if(!old_eye_blurry)
overlay_fullscreen("blurry", /obj/screen/fullscreen/blurry)
else if(old_eye_blurry)
clear_fullscreen("blurry")
/////////////////////////////////// DRUGGY ////////////////////////////////////
/mob/proc/adjust_drugginess(amount)
return
/mob/proc/set_drugginess(amount)
return
/////////////////////////////////// BLIND DISABILITY ////////////////////////////////////
/mob/proc/cure_blind() //when we want to cure the BLIND disability only.
return
/mob/proc/become_blind()
return
/////////////////////////////////// NEARSIGHT DISABILITY ////////////////////////////////////
/mob/proc/cure_nearsighted()
return
/mob/proc/become_nearsighted()
return
@@ -62,7 +62,7 @@
M << "<span class='notice'>[high_message]</span>"
M.AdjustParalysis(-1, 0)
M.AdjustStunned(-1, 0)
M.AdjustWeakened(-1, 0, 0)
M.AdjustWeakened(-1, 0)
..()
. = 1
@@ -160,7 +160,7 @@
M << "<span class='notice'>[high_message]</span>"
M.AdjustParalysis(-2, 0)
M.AdjustStunned(-2, 0)
M.AdjustWeakened(-2, 0, 0)
M.AdjustWeakened(-2, 0)
M.adjustStaminaLoss(-2, 0)
M.status_flags |= GOTTAGOREALLYFAST
M.Jitter(2)
@@ -237,7 +237,7 @@
M << "<span class='notice'>[high_message]</span>"
M.AdjustParalysis(-3, 0)
M.AdjustStunned(-3, 0)
M.AdjustWeakened(-3, 0, 0)
M.AdjustWeakened(-3, 0)
M.adjustStaminaLoss(-5, 0)
M.adjustBrainLoss(0.5)
M.adjustToxLoss(0.1, 0)
@@ -80,7 +80,7 @@
M.drowsyness = max(M.drowsyness-5, 0)
M.AdjustParalysis(-1, 0)
M.AdjustStunned(-1, 0)
M.AdjustWeakened(-1, 0, 0)
M.AdjustWeakened(-1, 0)
if(holder.has_reagent("mindbreaker"))
holder.remove_reagent("mindbreaker", 5)
M.hallucination = max(0, M.hallucination - 10)
@@ -493,7 +493,7 @@
M.status_flags |= GOTTAGOFAST
M.AdjustParalysis(-1, 0)
M.AdjustStunned(-1, 0)
M.AdjustWeakened(-1, 0, 0)
M.AdjustWeakened(-1, 0)
M.adjustStaminaLoss(-1*REM, 0)
..()
. = 1
@@ -703,7 +703,7 @@
if(prob(20))
M.AdjustParalysis(-1, 0)
M.AdjustStunned(-1, 0)
M.AdjustWeakened(-1, 0, 0)
M.AdjustWeakened(-1, 0)
..()
/datum/reagent/medicine/epinephrine/overdose_process(mob/living/M)
@@ -807,7 +807,7 @@
M.adjustFireLoss(-1*REM, 0)
M.AdjustParalysis(-3, 0)
M.AdjustStunned(-3, 0)
M.AdjustWeakened(-3, 0, 0)
M.AdjustWeakened(-3, 0)
M.adjustStaminaLoss(-5*REM, 0)
..()
. = 1
@@ -1036,7 +1036,7 @@ datum/reagent/medicine/syndicate_nanites/on_mob_life(mob/living/M)
/datum/reagent/medicine/changelingAdrenaline/on_mob_life(mob/living/M as mob)
M.AdjustParalysis(-1, 0)
M.AdjustStunned(-1, 0)
M.AdjustWeakened(-1, 0, 0)
M.AdjustWeakened(-1, 0)
M.adjustStaminaLoss(-1, 0)
. = 1
..()
@@ -220,7 +220,7 @@
M.drowsyness = max(M.drowsyness-5, 0)
M.AdjustParalysis(-2, 0)
M.AdjustStunned(-2, 0)
M.AdjustWeakened(-2, 0, 0)
M.AdjustWeakened(-2, 0)
else
M.adjustToxLoss(2, 0)
M.adjustFireLoss(2, 0)
@@ -369,7 +369,7 @@
..()
H << "<span class='warning'><b>You crumple in agony as your flesh wildly morphs into new forms!</b></span>"
H.visible_message("<b>[H]</b> falls to the ground and screams as their skin bubbles and froths!") //'froths' sounds painful when used with SKIN.
H.Weaken(3, 0, 0)
H.Weaken(3, 0)
spawn(30)
if(!H || qdeleted(H))
return
@@ -145,7 +145,7 @@
/datum/reagent/toxin/zombiepowder/on_mob_life(mob/living/carbon/M)
M.status_flags |= FAKEDEATH
M.adjustOxyLoss(0.5*REM, 0)
M.Weaken(5, 0, 0)
M.Weaken(5, 0)
M.silent = max(M.silent, 5)
M.tod = worldtime2text()
..()
@@ -492,7 +492,7 @@
switch(picked_option)
if(1)
M.Stun(3, 0)
M.Weaken(3, 0, 0)
M.Weaken(3, 0)
. = 1
if(2)
M.losebreath += 10
@@ -611,7 +611,7 @@
/datum/reagent/toxin/curare/on_mob_life(mob/living/M)
if(current_cycle >= 11)
M.Weaken(3, 0, 0)
M.Weaken(3, 0)
M.adjustOxyLoss(1*REM, 0)
. = 1
..()
@@ -536,7 +536,7 @@
var/mob/living/M = A
if(M in immune)
continue
M.stunned = 10
M.Stun(10, 1, 1)
M.anchored = 1
if(istype(M, /mob/living/simple_animal/hostile))
var/mob/living/simple_animal/hostile/H = M
@@ -566,7 +566,7 @@
/obj/effect/timestop/proc/unfreeze_mob(mob/living/M)
M.stunned = 0
M.AdjustStunned(-10, 1, 1)
M.anchored = 0
if(istype(M, /mob/living/simple_animal/hostile))
var/mob/living/simple_animal/hostile/H = M
Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 55 KiB

+6
View File
@@ -1208,6 +1208,7 @@
#include "code\modules\mob\mob_movement.dm"
#include "code\modules\mob\mob_transformation_simple.dm"
#include "code\modules\mob\say.dm"
#include "code\modules\mob\status_procs.dm"
#include "code\modules\mob\transform_procs.dm"
#include "code\modules\mob\update_icons.dm"
#include "code\modules\mob\camera\camera.dm"
@@ -1227,6 +1228,7 @@
#include "code\modules\mob\living\login.dm"
#include "code\modules\mob\living\logout.dm"
#include "code\modules\mob\living\say.dm"
#include "code\modules\mob\living\status_procs.dm"
#include "code\modules\mob\living\ventcrawling.dm"
#include "code\modules\mob\living\carbon\carbon.dm"
#include "code\modules\mob\living\carbon\carbon_defense.dm"
@@ -1238,6 +1240,7 @@
#include "code\modules\mob\living\carbon\inventory.dm"
#include "code\modules\mob\living\carbon\life.dm"
#include "code\modules\mob\living\carbon\say.dm"
#include "code\modules\mob\living\carbon\status_procs.dm"
#include "code\modules\mob\living\carbon\update_icons.dm"
#include "code\modules\mob\living\carbon\alien\alien.dm"
#include "code\modules\mob\living\carbon\alien\alien_defense.dm"
@@ -1248,6 +1251,7 @@
#include "code\modules\mob\living\carbon\alien\organs.dm"
#include "code\modules\mob\living\carbon\alien\say.dm"
#include "code\modules\mob\living\carbon\alien\screen.dm"
#include "code\modules\mob\living\carbon\alien\status_procs.dm"
#include "code\modules\mob\living\carbon\alien\humanoid\alien_powers.dm"
#include "code\modules\mob\living\carbon\alien\humanoid\death.dm"
#include "code\modules\mob\living\carbon\alien\humanoid\emote.dm"
@@ -1277,6 +1281,7 @@
#include "code\modules\mob\living\carbon\brain\MMI.dm"
#include "code\modules\mob\living\carbon\brain\posibrain.dm"
#include "code\modules\mob\living\carbon\brain\say.dm"
#include "code\modules\mob\living\carbon\brain\status_procs.dm"
#include "code\modules\mob\living\carbon\human\blood.dm"
#include "code\modules\mob\living\carbon\human\death.dm"
#include "code\modules\mob\living\carbon\human\emote.dm"
@@ -1309,6 +1314,7 @@
#include "code\modules\mob\living\silicon\login.dm"
#include "code\modules\mob\living\silicon\say.dm"
#include "code\modules\mob\living\silicon\silicon.dm"
#include "code\modules\mob\living\silicon\status_procs.dm"
#include "code\modules\mob\living\silicon\ai\ai.dm"
#include "code\modules\mob\living\silicon\ai\death.dm"
#include "code\modules\mob\living\silicon\ai\examine.dm"