Unconscious and Knockdown are now status effects (#28696)

* Unconscious and Knockdown are now status effects

* Fixes #28628

* fixes borgs

* the terrifying second argument

* Much better
This commit is contained in:
Joan Lung
2017-06-23 12:00:49 -04:00
committed by Jordan Brown
parent 06f2b4f45e
commit deae811756
58 changed files with 376 additions and 325 deletions

View File

@@ -32,6 +32,10 @@
#define STATUS_EFFECT_STUN /datum/status_effect/incapacitating/stun //the affected is stunned #define STATUS_EFFECT_STUN /datum/status_effect/incapacitating/stun //the affected is stunned
#define STATUS_EFFECT_KNOCKDOWN /datum/status_effect/incapacitating/knockdown //the affected is knocked down
#define STATUS_EFFECT_UNCONSCIOUS /datum/status_effect/incapacitating/unconscious //the affected is unconscious
#define STATUS_EFFECT_SLEEPING /datum/status_effect/incapacitating/sleeping //the affected is asleep #define STATUS_EFFECT_SLEEPING /datum/status_effect/incapacitating/sleeping //the affected is asleep
#define STATUS_EFFECT_BELLIGERENT /datum/status_effect/belligerent //forces the affected to walk, doing damage if they try to run #define STATUS_EFFECT_BELLIGERENT /datum/status_effect/belligerent //forces the affected to walk, doing damage if they try to run

View File

@@ -307,7 +307,7 @@ Proc for attack log creation, because really why not
drifting = 0 drifting = 0
Uloc = user.loc Uloc = user.loc
if(QDELETED(user) || user.stat || user.knockdown || user.IsStun() || (!drifting && user.loc != Uloc) || (extra_checks && !extra_checks.Invoke())) if(QDELETED(user) || user.stat || user.IsKnockdown() || user.IsStun() || (!drifting && user.loc != Uloc) || (extra_checks && !extra_checks.Invoke()))
. = 0 . = 0
break break

View File

@@ -15,7 +15,7 @@
if(call(client.click_intercept,"InterceptClickOn")(src,params,A)) if(call(client.click_intercept,"InterceptClickOn")(src,params,A))
return return
if(stat || lockcharge || knockdown || IsStun() || unconscious) if(stat || lockcharge || IsKnockdown() || IsStun() || IsUnconscious())
return return
var/list/modifiers = params2list(params) var/list/modifiers = params2list(params)

View File

@@ -348,7 +348,7 @@
/obj/screen/storage/Click(location, control, params) /obj/screen/storage/Click(location, control, params)
if(world.time <= usr.next_move) if(world.time <= usr.next_move)
return 1 return 1
if(usr.stat || usr.unconscious || usr.knockdown || usr.IsStun()) if(usr.stat || usr.IsUnconscious() || usr.IsKnockdown() || usr.IsStun())
return 1 return 1
if (istype(usr.loc,/obj/mecha)) // stops inventory actions in a mech if (istype(usr.loc,/obj/mecha)) // stops inventory actions in a mech
return 1 return 1

View File

@@ -73,7 +73,7 @@
if(owner.restrained()) if(owner.restrained())
return 0 return 0
if(check_flags & AB_CHECK_STUN) if(check_flags & AB_CHECK_STUN)
if(owner.knockdown || owner.IsStun()) if(owner.IsKnockdown() || owner.IsStun())
return 0 return 0
if(check_flags & AB_CHECK_LYING) if(check_flags & AB_CHECK_LYING)
if(owner.lying) if(owner.lying)

View File

@@ -35,7 +35,7 @@
return 0 return 0
/datum/martial_art/cqc/proc/Slam(mob/living/carbon/human/A, mob/living/carbon/human/D) /datum/martial_art/cqc/proc/Slam(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(!D.stat || !D.knockdown) if(!D.stat || !D.IsKnockdown())
D.visible_message("<span class='warning'>[A] slams [D] into the ground!</span>", \ D.visible_message("<span class='warning'>[A] slams [D] into the ground!</span>", \
"<span class='userdanger'>[A] slams you into the ground!</span>") "<span class='userdanger'>[A] slams you into the ground!</span>")
playsound(get_turf(A), 'sound/weapons/slam.ogg', 50, 1, -1) playsound(get_turf(A), 'sound/weapons/slam.ogg', 50, 1, -1)
@@ -45,7 +45,7 @@
return 1 return 1
/datum/martial_art/cqc/proc/Kick(mob/living/carbon/human/A, mob/living/carbon/human/D) /datum/martial_art/cqc/proc/Kick(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(!D.stat || !D.knockdown) if(!D.stat || !D.IsKnockdown())
D.visible_message("<span class='warning'>[A] kicks [D] back!</span>", \ D.visible_message("<span class='warning'>[A] kicks [D] back!</span>", \
"<span class='userdanger'>[A] kicks you back!</span>") "<span class='userdanger'>[A] kicks you back!</span>")
playsound(get_turf(A), 'sound/weapons/cqchit1.ogg', 50, 1, -1) playsound(get_turf(A), 'sound/weapons/cqchit1.ogg', 50, 1, -1)
@@ -53,7 +53,7 @@
D.throw_at(throw_target, 1, 14, A) D.throw_at(throw_target, 1, 14, A)
D.apply_damage(10, BRUTE) D.apply_damage(10, BRUTE)
add_logs(A, D, "cqc kicked") add_logs(A, D, "cqc kicked")
if(D.knockdown && !D.stat) if(D.IsKnockdown() && !D.stat)
D.visible_message("<span class='warning'>[A] kicks [D]'s head, knocking them out!</span>", \ D.visible_message("<span class='warning'>[A] kicks [D]'s head, knocking them out!</span>", \
"<span class='userdanger'>[A] kicks your head, knocking you out!</span>") "<span class='userdanger'>[A] kicks your head, knocking you out!</span>")
playsound(get_turf(A), 'sound/weapons/genhit1.ogg', 50, 1, -1) playsound(get_turf(A), 'sound/weapons/genhit1.ogg', 50, 1, -1)
@@ -114,7 +114,7 @@
A.do_attack_animation(D) A.do_attack_animation(D)
var/picked_hit_type = pick("CQC'd", "Big Bossed") var/picked_hit_type = pick("CQC'd", "Big Bossed")
var/bonus_damage = 13 var/bonus_damage = 13
if(D.knockdown || D.resting || D.lying) if(D.IsKnockdown() || D.resting || D.lying)
bonus_damage += 5 bonus_damage += 5
picked_hit_type = "stomps on" picked_hit_type = "stomps on"
D.apply_damage(bonus_damage, BRUTE) D.apply_damage(bonus_damage, BRUTE)
@@ -125,7 +125,7 @@
D.visible_message("<span class='danger'>[A] [picked_hit_type] [D]!</span>", \ D.visible_message("<span class='danger'>[A] [picked_hit_type] [D]!</span>", \
"<span class='userdanger'>[A] [picked_hit_type] you!</span>") "<span class='userdanger'>[A] [picked_hit_type] you!</span>")
add_logs(A, D, "[picked_hit_type] with CQC") add_logs(A, D, "[picked_hit_type] with CQC")
if(A.resting && !D.stat && !D.knockdown) if(A.resting && !D.stat && !D.IsKnockdown())
D.visible_message("<span class='warning'>[A] leg sweeps [D]!", \ D.visible_message("<span class='warning'>[A] leg sweeps [D]!", \
"<span class='userdanger'>[A] leg sweeps you!</span>") "<span class='userdanger'>[A] leg sweeps you!</span>")
playsound(get_turf(A), 'sound/effects/hit_kick.ogg', 50, 1, -1) playsound(get_turf(A), 'sound/effects/hit_kick.ogg', 50, 1, -1)
@@ -140,7 +140,7 @@
if(check_streak(A,D)) if(check_streak(A,D))
return 1 return 1
if(prob(65)) if(prob(65))
if(!D.stat || !D.knockdown || !restraining) if(!D.stat || !D.IsKnockdown() || !restraining)
I = D.get_active_held_item() I = D.get_active_held_item()
D.visible_message("<span class='warning'>[A] strikes [D]'s jaw with their hand!</span>", \ D.visible_message("<span class='warning'>[A] strikes [D]'s jaw with their hand!</span>", \
"<span class='userdanger'>[A] strikes your jaw, disorienting you!</span>") "<span class='userdanger'>[A] strikes your jaw, disorienting you!</span>")

View File

@@ -84,7 +84,7 @@
return 0 return 0
/datum/martial_art/krav_maga/proc/leg_sweep(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D) /datum/martial_art/krav_maga/proc/leg_sweep(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D)
if(D.stat || D.knockdown) if(D.stat || D.IsKnockdown())
return 0 return 0
D.visible_message("<span class='warning'>[A] leg sweeps [D]!</span>", \ D.visible_message("<span class='warning'>[A] leg sweeps [D]!</span>", \
"<span class='userdanger'>[A] leg sweeps you!</span>") "<span class='userdanger'>[A] leg sweeps you!</span>")
@@ -126,7 +126,7 @@
add_logs(A, D, "punched") add_logs(A, D, "punched")
var/picked_hit_type = pick("punches", "kicks") var/picked_hit_type = pick("punches", "kicks")
var/bonus_damage = 10 var/bonus_damage = 10
if(D.knockdown || D.resting || D.lying) if(D.IsKnockdown() || D.resting || D.lying)
bonus_damage += 5 bonus_damage += 5
picked_hit_type = "stomps on" picked_hit_type = "stomps on"
D.apply_damage(bonus_damage, BRUTE) D.apply_damage(bonus_damage, BRUTE)

View File

@@ -35,7 +35,7 @@
return 0 return 0
/datum/martial_art/the_sleeping_carp/proc/wristWrench(mob/living/carbon/human/A, mob/living/carbon/human/D) /datum/martial_art/the_sleeping_carp/proc/wristWrench(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(!D.stat && !D.IsStun() && !D.knockdown) if(!D.stat && !D.IsStun() && !D.IsKnockdown())
A.do_attack_animation(D, ATTACK_EFFECT_PUNCH) A.do_attack_animation(D, ATTACK_EFFECT_PUNCH)
D.visible_message("<span class='warning'>[A] grabs [D]'s wrist and wrenches it sideways!</span>", \ D.visible_message("<span class='warning'>[A] grabs [D]'s wrist and wrenches it sideways!</span>", \
"<span class='userdanger'>[A] grabs your wrist and violently wrenches it to the side!</span>") "<span class='userdanger'>[A] grabs your wrist and violently wrenches it to the side!</span>")
@@ -49,7 +49,7 @@
return basic_hit(A,D) return basic_hit(A,D)
/datum/martial_art/the_sleeping_carp/proc/backKick(mob/living/carbon/human/A, mob/living/carbon/human/D) /datum/martial_art/the_sleeping_carp/proc/backKick(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(A.dir == D.dir && !D.stat && !D.knockdown) if(A.dir == D.dir && !D.stat && !D.IsKnockdown())
A.do_attack_animation(D, ATTACK_EFFECT_PUNCH) A.do_attack_animation(D, ATTACK_EFFECT_PUNCH)
D.visible_message("<span class='warning'>[A] kicks [D] in the back!</span>", \ D.visible_message("<span class='warning'>[A] kicks [D] in the back!</span>", \
"<span class='userdanger'>[A] kicks you in the back, making you stumble and fall!</span>") "<span class='userdanger'>[A] kicks you in the back, making you stumble and fall!</span>")
@@ -61,7 +61,7 @@
return basic_hit(A,D) return basic_hit(A,D)
/datum/martial_art/the_sleeping_carp/proc/kneeStomach(mob/living/carbon/human/A, mob/living/carbon/human/D) /datum/martial_art/the_sleeping_carp/proc/kneeStomach(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(!D.stat && !D.knockdown) if(!D.stat && !D.IsKnockdown())
A.do_attack_animation(D, ATTACK_EFFECT_KICK) A.do_attack_animation(D, ATTACK_EFFECT_KICK)
D.visible_message("<span class='warning'>[A] knees [D] in the stomach!</span>", \ D.visible_message("<span class='warning'>[A] knees [D] in the stomach!</span>", \
"<span class='userdanger'>[A] winds you with a knee in the stomach!</span>") "<span class='userdanger'>[A] winds you with a knee in the stomach!</span>")
@@ -74,7 +74,7 @@
return basic_hit(A,D) return basic_hit(A,D)
/datum/martial_art/the_sleeping_carp/proc/headKick(mob/living/carbon/human/A, mob/living/carbon/human/D) /datum/martial_art/the_sleeping_carp/proc/headKick(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(!D.stat && !D.knockdown) if(!D.stat && !D.IsKnockdown())
A.do_attack_animation(D, ATTACK_EFFECT_KICK) A.do_attack_animation(D, ATTACK_EFFECT_KICK)
D.visible_message("<span class='warning'>[A] kicks [D] in the head!</span>", \ D.visible_message("<span class='warning'>[A] kicks [D] in the head!</span>", \
"<span class='userdanger'>[A] kicks you in the jaw!</span>") "<span class='userdanger'>[A] kicks you in the jaw!</span>")
@@ -87,7 +87,7 @@
return basic_hit(A,D) return basic_hit(A,D)
/datum/martial_art/the_sleeping_carp/proc/elbowDrop(mob/living/carbon/human/A, mob/living/carbon/human/D) /datum/martial_art/the_sleeping_carp/proc/elbowDrop(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(D.knockdown || D.resting || D.stat) if(D.IsKnockdown() || D.resting || D.stat)
A.do_attack_animation(D, ATTACK_EFFECT_PUNCH) A.do_attack_animation(D, ATTACK_EFFECT_PUNCH)
D.visible_message("<span class='warning'>[A] elbow drops [D]!</span>", \ D.visible_message("<span class='warning'>[A] elbow drops [D]!</span>", \
"<span class='userdanger'>[A] piledrives you with their elbow!</span>") "<span class='userdanger'>[A] piledrives you with their elbow!</span>")

View File

@@ -233,7 +233,7 @@ GLOBAL_LIST_EMPTY(mutations_list)
text_gain_indication = "<span class='danger'>You get a headache.</span>" text_gain_indication = "<span class='danger'>You get a headache.</span>"
/datum/mutation/human/epilepsy/on_life(mob/living/carbon/human/owner) /datum/mutation/human/epilepsy/on_life(mob/living/carbon/human/owner)
if(prob(1) && !owner.unconscious) if(prob(1) && owner.stat == CONSCIOUS)
owner.visible_message("<span class='danger'>[owner] starts having a seizure!</span>", "<span class='userdanger'>You have a seizure!</span>") owner.visible_message("<span class='danger'>[owner] starts having a seizure!</span>", "<span class='userdanger'>You have a seizure!</span>")
owner.Unconscious(200) owner.Unconscious(200)
owner.Jitter(1000) owner.Jitter(1000)
@@ -269,7 +269,7 @@ GLOBAL_LIST_EMPTY(mutations_list)
text_gain_indication = "<span class='danger'>You start coughing.</span>" text_gain_indication = "<span class='danger'>You start coughing.</span>"
/datum/mutation/human/cough/on_life(mob/living/carbon/human/owner) /datum/mutation/human/cough/on_life(mob/living/carbon/human/owner)
if((prob(5) && owner.unconscious <= 1)) if(prob(5) && owner.stat == CONSCIOUS)
owner.drop_item() owner.drop_item()
owner.emote("cough") owner.emote("cough")
@@ -317,7 +317,7 @@ GLOBAL_LIST_EMPTY(mutations_list)
text_gain_indication = "<span class='danger'>You twitch.</span>" text_gain_indication = "<span class='danger'>You twitch.</span>"
/datum/mutation/human/tourettes/on_life(mob/living/carbon/human/owner) /datum/mutation/human/tourettes/on_life(mob/living/carbon/human/owner)
if((prob(10) && owner.unconscious <= 1)) if(prob(10) && owner.stat == CONSCIOUS)
owner.Stun(200) owner.Stun(200)
switch(rand(1, 3)) switch(rand(1, 3))
if(1) if(1)

View File

@@ -60,8 +60,8 @@
if(istype(L)) //this is probably more safety than actually needed if(istype(L)) //this is probably more safety than actually needed
var/vanguard = L.stun_absorption["vanguard"] var/vanguard = L.stun_absorption["vanguard"]
desc = initial(desc) desc = initial(desc)
desc += "<br><b>[vanguard["stuns_absorbed"] * 2]</b> seconds of stuns held back.\ desc += "<br><b>[Floor(vanguard["stuns_absorbed"] * 0.1)]</b> seconds of stuns held back.\
[GLOB.ratvar_awakens ? "":"<br><b>[round(min(vanguard["stuns_absorbed"] * 0.25, 20)) * 2]</b> seconds of stun will affect you."]" [GLOB.ratvar_awakens ? "":"<br><b>[Floor(min(vanguard["stuns_absorbed"] * 0.025, 20))]</b> seconds of stun will affect you."]"
..() ..()
/datum/status_effect/vanguard_shield/Destroy() /datum/status_effect/vanguard_shield/Destroy()
@@ -98,7 +98,7 @@
vanguard["end_time"] = 0 //so it doesn't absorb the stuns we're about to apply vanguard["end_time"] = 0 //so it doesn't absorb the stuns we're about to apply
owner.Knockdown(stuns_blocked) owner.Knockdown(stuns_blocked)
message_to_owner = "<span class='boldwarning'>The weight of the Vanguard's protection crashes down upon you!</span>" message_to_owner = "<span class='boldwarning'>The weight of the Vanguard's protection crashes down upon you!</span>"
if(stuns_blocked >= 15) if(stuns_blocked >= 300)
message_to_owner += "\n<span class='userdanger'>You faint from the exertion!</span>" message_to_owner += "\n<span class='userdanger'>You faint from the exertion!</span>"
stuns_blocked *= 2 stuns_blocked *= 2
owner.Unconscious(stuns_blocked) owner.Unconscious(stuns_blocked)

View File

@@ -6,20 +6,37 @@
alert_type = null alert_type = null
var/update_canmove = TRUE var/update_canmove = TRUE
/datum/status_effect/incapacitating/on_apply() /datum/status_effect/incapacitating/on_creation(mob/living/new_owner, updating_canmove)
..()
if(isnum(updating_canmove))
update_canmove = updating_canmove
if(update_canmove) if(update_canmove)
owner.update_canmove() owner.update_canmove()
if(issilicon(owner))
owner.update_stat()
/datum/status_effect/incapacitating/on_apply()
. = ..()
update_canmove = TRUE update_canmove = TRUE
return ..()
/datum/status_effect/incapacitating/on_remove() /datum/status_effect/incapacitating/on_remove()
if(update_canmove) if(update_canmove)
owner.update_canmove() owner.update_canmove()
if(issilicon(owner)) //silicons need stat updates in addition to normal canmove updates
owner.update_stat()
//STUN //STUN
/datum/status_effect/incapacitating/stun /datum/status_effect/incapacitating/stun
id = "stun" id = "stun"
//KNOCKDOWN
/datum/status_effect/incapacitating/knockdown
id = "knockdown"
//UNCONSCIOUS
/datum/status_effect/incapacitating/unconscious
id = "unconscious"
//SLEEPING //SLEEPING
/datum/status_effect/incapacitating/sleeping /datum/status_effect/incapacitating/sleeping
id = "sleeping" id = "sleeping"
@@ -27,18 +44,18 @@
var/mob/living/carbon/carbon_owner var/mob/living/carbon/carbon_owner
var/mob/living/carbon/human/human_owner var/mob/living/carbon/human/human_owner
/datum/status_effect/incapacitating/sleeping/Destroy() /datum/status_effect/incapacitating/sleeping/on_creation(mob/living/new_owner, updating_canmove)
carbon_owner = null ..()
human_owner = null
return ..()
/datum/status_effect/incapacitating/sleeping/on_apply()
if(update_canmove) if(update_canmove)
owner.update_stat() owner.update_stat()
if(iscarbon(owner)) //to avoid repeated istypes if(iscarbon(owner)) //to avoid repeated istypes
carbon_owner = owner carbon_owner = owner
if(ishuman(owner)) if(ishuman(owner))
human_owner = owner human_owner = owner
/datum/status_effect/incapacitating/sleeping/Destroy()
carbon_owner = null
human_owner = null
return ..() return ..()
/datum/status_effect/incapacitating/sleeping/tick() /datum/status_effect/incapacitating/sleeping/tick()

View File

@@ -12,7 +12,10 @@
var/alert_type = /obj/screen/alert/status_effect //the alert thrown by the status effect, contains name and description var/alert_type = /obj/screen/alert/status_effect //the alert thrown by the status effect, contains name and description
var/obj/screen/alert/status_effect/linked_alert = null //the alert itself, if it exists var/obj/screen/alert/status_effect/linked_alert = null //the alert itself, if it exists
/datum/status_effect/New(mob/living/new_owner) /datum/status_effect/New(list/arguments)
on_creation(arglist(arguments))
/datum/status_effect/proc/on_creation(mob/living/new_owner, ...)
if(new_owner) if(new_owner)
owner = new_owner owner = new_owner
if(owner) if(owner)
@@ -76,7 +79,7 @@
// HELPER PROCS // // HELPER PROCS //
////////////////// //////////////////
/mob/living/proc/apply_status_effect(effect) //applies a given status effect to this mob, returning the effect if it was successful /mob/living/proc/apply_status_effect(effect, ...) //applies a given status effect to this mob, returning the effect if it was successful
. = FALSE . = FALSE
var/datum/status_effect/S1 = effect var/datum/status_effect/S1 = effect
LAZYINITLIST(status_effects) LAZYINITLIST(status_effects)
@@ -86,7 +89,9 @@
S.be_replaced() S.be_replaced()
else else
return return
S1 = new effect(src) var/list/arguments = args.Copy()
arguments[1] = src
S1 = new effect(arguments)
. = S1 . = S1
/mob/living/proc/remove_status_effect(effect) //removes all of a given status effect from this mob, returning TRUE if at least one was removed /mob/living/proc/remove_status_effect(effect) //removes all of a given status effect from this mob, returning TRUE if at least one was removed

View File

@@ -440,6 +440,8 @@
if(!no_effect && (visual_effect_icon || used_item)) if(!no_effect && (visual_effect_icon || used_item))
do_item_attack_animation(A, visual_effect_icon, used_item) do_item_attack_animation(A, visual_effect_icon, used_item)
if(A == src)
return //don't do an animation if attacking self
var/pixel_x_diff = 0 var/pixel_x_diff = 0
var/pixel_y_diff = 0 var/pixel_y_diff = 0
var/final_pixel_y = initial(pixel_y) var/final_pixel_y = initial(pixel_y)

View File

@@ -69,7 +69,7 @@
if(iscultist(L)) if(iscultist(L))
to_chat(L, "<span class='heavy_brass'>\"Watch your step, wretch.\"</span>") to_chat(L, "<span class='heavy_brass'>\"Watch your step, wretch.\"</span>")
L.adjustBruteLoss(10) L.adjustBruteLoss(10)
L.Knockdown(140) L.Knockdown(140, FALSE)
L.visible_message("<span class='warning'>[src] appears around [L] in a burst of light!</span>", \ L.visible_message("<span class='warning'>[src] appears around [L] in a burst of light!</span>", \
"<span class='userdanger'>[target_flashed ? "An unseen force":"The glowing sigil around you"] holds you in place!</span>") "<span class='userdanger'>[target_flashed ? "An unseen force":"The glowing sigil around you"] holds you in place!</span>")
L.Stun(100) L.Stun(100)

View File

@@ -260,7 +260,7 @@
darkness_view = 8 darkness_view = 8
flash_protect = 1 flash_protect = 1
/obj/item/clothing/glasses/night/cultblind/equipped(mob/user, slot) /obj/item/clothing/glasses/night/cultblind/equipped(mob/living/user, slot)
..() ..()
if(!iscultist(user)) if(!iscultist(user))
to_chat(user, "<span class='cultlarge'>\"You want to be blind, do you?\"</span>") to_chat(user, "<span class='cultlarge'>\"You want to be blind, do you?\"</span>")
@@ -283,7 +283,7 @@
icon_state ="shuttlecurse" icon_state ="shuttlecurse"
var/global/curselimit = 0 var/global/curselimit = 0
/obj/item/device/shuttle_curse/attack_self(mob/user) /obj/item/device/shuttle_curse/attack_self(mob/living/user)
if(!iscultist(user)) if(!iscultist(user))
user.dropItemToGround(src, TRUE) user.dropItemToGround(src, TRUE)
user.Knockdown(100) user.Knockdown(100)

View File

@@ -226,7 +226,7 @@
/obj/item/device/gangtool/proc/can_use(mob/living/carbon/human/user) /obj/item/device/gangtool/proc/can_use(mob/living/carbon/human/user)
if(!istype(user)) if(!istype(user))
return 0 return 0
if(user.restrained() || user.lying || user.stat || user.IsStun() || user.knockdown) if(user.incapacitated())
return 0 return 0
if(!(src in user.contents)) if(!(src in user.contents))
return 0 return 0

View File

@@ -44,7 +44,7 @@
//////////////////////////////Capturing//////////////////////////////////////////////////////// //////////////////////////////Capturing////////////////////////////////////////////////////////
/obj/item/device/soulstone/attack(mob/living/carbon/human/M, mob/user) /obj/item/device/soulstone/attack(mob/living/carbon/human/M, mob/living/user)
if(!iscultist(user) && !iswizard(user) && !usability) if(!iscultist(user) && !iswizard(user) && !usability)
user.Unconscious(100) user.Unconscious(100)
to_chat(user, "<span class='userdanger'>Your body is wracked with debilitating pain!</span>") to_chat(user, "<span class='userdanger'>Your body is wracked with debilitating pain!</span>")
@@ -63,7 +63,7 @@
///////////////////Options for using captured souls/////////////////////////////////////// ///////////////////Options for using captured souls///////////////////////////////////////
/obj/item/device/soulstone/attack_self(mob/user) /obj/item/device/soulstone/attack_self(mob/living/user)
if(!in_range(src, user)) if(!in_range(src, user))
return return
if(!iscultist(user) && !iswizard(user) && !usability) if(!iscultist(user) && !iswizard(user) && !usability)

View File

@@ -850,7 +850,7 @@
icon_state ="bookknock" icon_state ="bookknock"
desc = "This book is hard to hold closed properly." desc = "This book is hard to hold closed properly."
/obj/item/weapon/spellbook/oneuse/knock/recoil(mob/user) /obj/item/weapon/spellbook/oneuse/knock/recoil(mob/living/user)
..() ..()
to_chat(user,"<span class='warning'>You're knocked down!</span>") to_chat(user,"<span class='warning'>You're knocked down!</span>")
user.Knockdown(40) user.Knockdown(40)

View File

@@ -1200,7 +1200,7 @@
/obj/machinery/door/airlock/proc/weld_checks(obj/item/weapon/weldingtool/W, mob/user) /obj/machinery/door/airlock/proc/weld_checks(obj/item/weapon/weldingtool/W, mob/user)
return !operating && density && user && W && W.isOn() && user.loc return !operating && density && user && W && W.isOn() && user.loc
/obj/machinery/door/airlock/try_to_crowbar(obj/item/I, mob/user) /obj/machinery/door/airlock/try_to_crowbar(obj/item/I, mob/living/user)
var/beingcrowbarred = null var/beingcrowbarred = null
if(istype(I, /obj/item/weapon/crowbar) ) if(istype(I, /obj/item/weapon/crowbar) )
beingcrowbarred = 1 beingcrowbarred = 1

View File

@@ -379,20 +379,20 @@
/obj/machinery/door/airlock/cult/canAIControl(mob/user) /obj/machinery/door/airlock/cult/canAIControl(mob/user)
return (iscultist(user) && !isAllPowerCut()) return (iscultist(user) && !isAllPowerCut())
/obj/machinery/door/airlock/cult/allowed(mob/M) /obj/machinery/door/airlock/cult/allowed(mob/living/L)
if(!density) if(!density)
return 1 return 1
if(friendly || iscultist(M) || istype(M, /mob/living/simple_animal/shade) || isconstruct(M)) if(friendly || iscultist(L) || istype(L, /mob/living/simple_animal/shade) || isconstruct(L))
new openingoverlaytype(loc) new openingoverlaytype(loc)
return 1 return 1
else else
new /obj/effect/temp_visual/cult/sac(loc) new /obj/effect/temp_visual/cult/sac(loc)
var/atom/throwtarget var/atom/throwtarget
throwtarget = get_edge_target_turf(src, get_dir(src, get_step_away(M, src))) throwtarget = get_edge_target_turf(src, get_dir(src, get_step_away(L, src)))
M << pick(sound('sound/hallucinations/turn_around1.ogg',0,1,50), sound('sound/hallucinations/turn_around2.ogg',0,1,50)) L << pick(sound('sound/hallucinations/turn_around1.ogg',0,1,50), sound('sound/hallucinations/turn_around2.ogg',0,1,50))
flash_color(M, flash_color="#960000", flash_time=20) flash_color(L, flash_color="#960000", flash_time=20)
M.Knockdown(40) L.Knockdown(40)
M.throw_at(throwtarget, 5, 1,src) L.throw_at(throwtarget, 5, 1,src)
return 0 return 0
/obj/machinery/door/airlock/cult/narsie_act() /obj/machinery/door/airlock/cult/narsie_act()

View File

@@ -113,7 +113,7 @@
/obj/effect/anomaly/grav/Bumped(mob/A) /obj/effect/anomaly/grav/Bumped(mob/A)
gravShock(A) gravShock(A)
/obj/effect/anomaly/grav/proc/gravShock(mob/A) /obj/effect/anomaly/grav/proc/gravShock(mob/living/A)
if(boing && isliving(A) && !A.stat) if(boing && isliving(A) && !A.stat)
A.Knockdown(40) A.Knockdown(40)
var/atom/target = get_edge_target_turf(A, get_dir(src, get_step_away(A, src))) var/atom/target = get_edge_target_turf(A, get_dir(src, get_step_away(A, src)))

View File

@@ -128,10 +128,10 @@
s.set_up(2, 1, location) s.set_up(2, 1, location)
s.start() s.start()
for(var/mob/M in viewers(1, location)) for(var/mob/living/L in viewers(1, location))
if (prob (50 * amount)) if(prob(50 * amount))
to_chat(M, "<span class='danger'>The explosion knocks you down.</span>") to_chat(L, "<span class='danger'>The explosion knocks you down.</span>")
M.Knockdown(rand(20,100)) L.Knockdown(rand(20,100))
return return
else else
dyn_explosion(location, amount, flashing_factor) dyn_explosion(location, amount, flashing_factor)

View File

@@ -46,7 +46,7 @@
name = "stun mine" name = "stun mine"
var/stun_time = 80 var/stun_time = 80
/obj/effect/mine/stun/mineEffect(mob/victim) /obj/effect/mine/stun/mineEffect(mob/living/victim)
if(isliving(victim)) if(isliving(victim))
victim.Knockdown(stun_time) victim.Knockdown(stun_time)

View File

@@ -100,21 +100,21 @@
if(!signal || signal.encryption != code) if(!signal || signal.encryption != code)
return return
if(ismob(loc) && on) if(isliving(loc) && on)
if(shock_cooldown != 0) if(shock_cooldown != 0)
return return
shock_cooldown = 1 shock_cooldown = 1
spawn(100) spawn(100)
shock_cooldown = 0 shock_cooldown = 0
var/mob/M = loc var/mob/living/L = loc
step(M, pick(GLOB.cardinal)) step(L, pick(GLOB.cardinal))
to_chat(M, "<span class='danger'>You feel a sharp shock!</span>") to_chat(L, "<span class='danger'>You feel a sharp shock!</span>")
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
s.set_up(3, 1, M) s.set_up(3, 1, L)
s.start() s.start()
M.Knockdown(100) L.Knockdown(100)
if(master) if(master)
master.receive_signal() master.receive_signal()

View File

@@ -77,7 +77,7 @@
var/cooldown = 0 var/cooldown = 0
var/on = 1 var/on = 1
/obj/item/weapon/melee/classic_baton/attack(mob/target, mob/living/user) /obj/item/weapon/melee/classic_baton/attack(mob/living/target, mob/living/user)
if(!on) if(!on)
return ..() return ..()

View File

@@ -6,7 +6,7 @@
var/climb_time = 20 var/climb_time = 20
var/climb_stun = 20 var/climb_stun = 20
var/climbable = FALSE var/climbable = FALSE
var/mob/structureclimber var/mob/living/structureclimber
var/broken = 0 //similar to machinery's stat BROKEN var/broken = 0 //similar to machinery's stat BROKEN
/obj/structure/Initialize() /obj/structure/Initialize()
@@ -48,7 +48,7 @@
. = ..() . = ..()
if(!climbable) if(!climbable)
return return
if(ismob(O) && user == O && iscarbon(user)) if(user == O && iscarbon(O))
if(user.canmove) if(user.canmove)
climb_structure(user) climb_structure(user)
return return

View File

@@ -20,7 +20,7 @@
var/egged = 0 var/egged = 0
/obj/structure/closet/cardboard/relaymove(mob/user, direction) /obj/structure/closet/cardboard/relaymove(mob/user, direction)
if(opened || move_delay || user.stat || user.IsStun() || user.knockdown || user.unconscious || !isturf(loc) || !has_gravity(loc)) if(opened || move_delay || user.stat || user.IsStun() || user.IsKnockdown() || user.IsUnconscious() || !isturf(loc) || !has_gravity(loc))
return return
move_delay = 1 move_delay = 1
if(step(src, direction)) if(step(src, direction))

View File

@@ -198,7 +198,7 @@
if(M.has_gravity() && M.mob_size > MOB_SIZE_SMALL && !(M.movement_type & FLYING)) if(M.has_gravity() && M.mob_size > MOB_SIZE_SMALL && !(M.movement_type & FLYING))
table_shatter(M) table_shatter(M)
/obj/structure/table/glass/proc/table_shatter(mob/M) /obj/structure/table/glass/proc/table_shatter(mob/living/L)
visible_message("<span class='warning'>[src] breaks!</span>", visible_message("<span class='warning'>[src] breaks!</span>",
"<span class='danger'>You hear breaking glass.</span>") "<span class='danger'>You hear breaking glass.</span>")
var/turf/T = get_turf(src) var/turf/T = get_turf(src)
@@ -208,8 +208,8 @@
AM.forceMove(T) AM.forceMove(T)
debris -= AM debris -= AM
if(istype(AM, /obj/item/weapon/shard)) if(istype(AM, /obj/item/weapon/shard))
AM.throw_impact(M) AM.throw_impact(L)
M.Knockdown(100) L.Knockdown(100)
qdel(src) qdel(src)
/obj/structure/table/glass/deconstruct(disassembled = TRUE, wrench_disassembly = 0) /obj/structure/table/glass/deconstruct(disassembled = TRUE, wrench_disassembly = 0)
@@ -451,7 +451,7 @@
attack_hand(user) attack_hand(user)
/obj/structure/rack/attack_hand(mob/living/user) /obj/structure/rack/attack_hand(mob/living/user)
if(user.knockdown || user.resting || user.lying || user.get_num_legs() < 2) if(user.IsKnockdown() || user.resting || user.lying || user.get_num_legs() < 2)
return return
user.changeNext_move(CLICK_CD_MELEE) user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src, ATTACK_EFFECT_KICK) user.do_attack_animation(src, ATTACK_EFFECT_KICK)

View File

@@ -463,7 +463,7 @@
user.clean_blood() user.clean_blood()
/obj/structure/sink/attackby(obj/item/O, mob/user, params) /obj/structure/sink/attackby(obj/item/O, mob/living/user, params)
if(busy) if(busy)
to_chat(user, "<span class='warning'>Someone's already washing here!</span>") to_chat(user, "<span class='warning'>Someone's already washing here!</span>")
return return

View File

@@ -1340,23 +1340,24 @@
return return
var/mob/M = locate(href_list["tdome1"]) var/mob/M = locate(href_list["tdome1"])
if(!ismob(M)) if(!isliving(M))
to_chat(usr, "This can only be used on instances of type /mob.") to_chat(usr, "This can only be used on instances of type /mob/living.")
return return
if(isAI(M)) if(isAI(M))
to_chat(usr, "This cannot be used on instances of type /mob/living/silicon/ai.") to_chat(usr, "This cannot be used on instances of type /mob/living/silicon/ai.")
return return
var/mob/living/L = M
for(var/obj/item/I in M) for(var/obj/item/I in L)
M.dropItemToGround(I, TRUE) L.dropItemToGround(I, TRUE)
M.Unconscious(100) L.Unconscious(100)
sleep(5) sleep(5)
M.loc = pick(GLOB.tdome1) L.forceMove(pick(GLOB.tdome1))
spawn(50) spawn(50)
to_chat(M, "<span class='adminnotice'>You have been sent to the Thunderdome.</span>") to_chat(L, "<span class='adminnotice'>You have been sent to the Thunderdome.</span>")
log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Team 1)") log_admin("[key_name(usr)] has sent [key_name(L)] to the thunderdome. (Team 1)")
message_admins("[key_name_admin(usr)] has sent [key_name_admin(M)] to the thunderdome. (Team 1)") message_admins("[key_name_admin(usr)] has sent [key_name_admin(L)] to the thunderdome. (Team 1)")
else if(href_list["tdome2"]) else if(href_list["tdome2"])
if(!check_rights(R_FUN)) if(!check_rights(R_FUN))
@@ -1366,23 +1367,24 @@
return return
var/mob/M = locate(href_list["tdome2"]) var/mob/M = locate(href_list["tdome2"])
if(!ismob(M)) if(!isliving(M))
to_chat(usr, "This can only be used on instances of type /mob.") to_chat(usr, "This can only be used on instances of type /mob/living.")
return return
if(isAI(M)) if(isAI(M))
to_chat(usr, "This cannot be used on instances of type /mob/living/silicon/ai.") to_chat(usr, "This cannot be used on instances of type /mob/living/silicon/ai.")
return return
var/mob/living/L = M
for(var/obj/item/I in M) for(var/obj/item/I in L)
M.dropItemToGround(I, TRUE) L.dropItemToGround(I, TRUE)
M.Unconscious(100) L.Unconscious(100)
sleep(5) sleep(5)
M.loc = pick(GLOB.tdome2) L.forceMove(pick(GLOB.tdome2))
spawn(50) spawn(50)
to_chat(M, "<span class='adminnotice'>You have been sent to the Thunderdome.</span>") to_chat(L, "<span class='adminnotice'>You have been sent to the Thunderdome.</span>")
log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Team 2)") log_admin("[key_name(usr)] has sent [key_name(L)] to the thunderdome. (Team 2)")
message_admins("[key_name_admin(usr)] has sent [key_name_admin(M)] to the thunderdome. (Team 2)") message_admins("[key_name_admin(usr)] has sent [key_name_admin(L)] to the thunderdome. (Team 2)")
else if(href_list["tdomeadmin"]) else if(href_list["tdomeadmin"])
if(!check_rights(R_FUN)) if(!check_rights(R_FUN))
@@ -1392,20 +1394,21 @@
return return
var/mob/M = locate(href_list["tdomeadmin"]) var/mob/M = locate(href_list["tdomeadmin"])
if(!ismob(M)) if(!isliving(M))
to_chat(usr, "This can only be used on instances of type /mob.") to_chat(usr, "This can only be used on instances of type /mob/living.")
return return
if(isAI(M)) if(isAI(M))
to_chat(usr, "This cannot be used on instances of type /mob/living/silicon/ai.") to_chat(usr, "This cannot be used on instances of type /mob/living/silicon/ai.")
return return
var/mob/living/L = M
M.Unconscious(100) L.Unconscious(100)
sleep(5) sleep(5)
M.loc = pick(GLOB.tdomeadmin) L.forceMove(pick(GLOB.tdomeadmin))
spawn(50) spawn(50)
to_chat(M, "<span class='adminnotice'>You have been sent to the Thunderdome.</span>") to_chat(L, "<span class='adminnotice'>You have been sent to the Thunderdome.</span>")
log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Admin.)") log_admin("[key_name(usr)] has sent [key_name(L)] to the thunderdome. (Admin.)")
message_admins("[key_name_admin(usr)] has sent [key_name_admin(M)] to the thunderdome. (Admin.)") message_admins("[key_name_admin(usr)] has sent [key_name_admin(L)] to the thunderdome. (Admin.)")
else if(href_list["tdomeobserve"]) else if(href_list["tdomeobserve"])
if(!check_rights(R_FUN)) if(!check_rights(R_FUN))
@@ -1415,27 +1418,28 @@
return return
var/mob/M = locate(href_list["tdomeobserve"]) var/mob/M = locate(href_list["tdomeobserve"])
if(!ismob(M)) if(!isliving(M))
to_chat(usr, "This can only be used on instances of type /mob.") to_chat(usr, "This can only be used on instances of type /mob/living.")
return return
if(isAI(M)) if(isAI(M))
to_chat(usr, "This cannot be used on instances of type /mob/living/silicon/ai.") to_chat(usr, "This cannot be used on instances of type /mob/living/silicon/ai.")
return return
var/mob/living/L = M
for(var/obj/item/I in M) for(var/obj/item/I in L)
M.dropItemToGround(I, TRUE) L.dropItemToGround(I, TRUE)
if(ishuman(M)) if(ishuman(L))
var/mob/living/carbon/human/observer = M var/mob/living/carbon/human/observer = L
observer.equip_to_slot_or_del(new /obj/item/clothing/under/suit_jacket(observer), slot_w_uniform) observer.equip_to_slot_or_del(new /obj/item/clothing/under/suit_jacket(observer), slot_w_uniform)
observer.equip_to_slot_or_del(new /obj/item/clothing/shoes/sneakers/black(observer), slot_shoes) observer.equip_to_slot_or_del(new /obj/item/clothing/shoes/sneakers/black(observer), slot_shoes)
M.Unconscious(100) L.Unconscious(100)
sleep(5) sleep(5)
M.loc = pick(GLOB.tdomeobserve) L.forceMove(pick(GLOB.tdomeobserve))
spawn(50) spawn(50)
to_chat(M, "<span class='adminnotice'>You have been sent to the Thunderdome.</span>") to_chat(L, "<span class='adminnotice'>You have been sent to the Thunderdome.</span>")
log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Observer.)") log_admin("[key_name(usr)] has sent [key_name(L)] to the thunderdome. (Observer.)")
message_admins("[key_name_admin(usr)] has sent [key_name_admin(M)] to the thunderdome. (Observer.)") message_admins("[key_name_admin(usr)] has sent [key_name_admin(L)] to the thunderdome. (Observer.)")
else if(href_list["revive"]) else if(href_list["revive"])
if(!check_rights(R_REJUVINATE)) if(!check_rights(R_REJUVINATE))

View File

@@ -1,6 +1,6 @@
/mob/living/carbon/proc/dream() /mob/living/carbon/proc/dream()
set waitfor = 0 set waitfor = 0
dreaming = 1 dreaming = TRUE
var/list/dreams = list( var/list/dreams = list(
"an ID card","a bottle","a familiar face","a crewmember","a toolbox","a security officer","the captain", "an ID card","a bottle","a familiar face","a crewmember","a toolbox","a security officer","the captain",
"voices from all around","deep space","a doctor","the engine","a traitor","an ally","darkness", "voices from all around","deep space","a doctor","the engine","a traitor","an ally","darkness",
@@ -9,18 +9,18 @@
"a blue light","an abandoned laboratory","Nanotrasen","The Syndicate","blood","healing","power","respect", "a blue light","an abandoned laboratory","Nanotrasen","The Syndicate","blood","healing","power","respect",
"riches","space","a crash","happiness","pride","a fall","water","flames","ice","melons","flying" "riches","space","a crash","happiness","pride","a fall","water","flames","ice","melons","flying"
) )
for(var/i = rand(1,4),i > 0, i--) for(var/i in 1 to rand(1, rand(3, 7)))
var/dream_image = pick(dreams) var/dream_image = pick(dreams)
dreams -= dream_image dreams -= dream_image
to_chat(src, "<span class='notice'><i>... [dream_image] ...</i></span>") to_chat(src, "<span class='notice'><i>... [dream_image] ...</i></span>")
sleep(rand(40,70)) sleep(rand(40,70))
if(unconscious <= 0) if(stat != UNCONSCIOUS || InCritical())
dreaming = 0 break
return 0 dreaming = FALSE
dreaming = 0
return 1 return 1
/mob/living/carbon/proc/handle_dreams() /mob/living/carbon/proc/handle_dreams()
if(prob(5) && !dreaming) dream() if(prob(5) && !dreaming)
dream()
/mob/living/carbon/var/dreaming = 0 /mob/living/carbon/var/dreaming = FALSE

View File

@@ -12,7 +12,7 @@
else else
icon_state = "alien[caste]_dead" icon_state = "alien[caste]_dead"
else if((stat == UNCONSCIOUS && !asleep) || knockdown) else if((stat == UNCONSCIOUS && !asleep) || IsKnockdown())
icon_state = "alien[caste]_unconscious" icon_state = "alien[caste]_unconscious"
else if(leap_on_click) else if(leap_on_click)
icon_state = "alien[caste]_pounce" icon_state = "alien[caste]_pounce"

View File

@@ -20,7 +20,7 @@
if(health<= -maxHealth || !getorgan(/obj/item/organ/brain)) if(health<= -maxHealth || !getorgan(/obj/item/organ/brain))
death() death()
return return
if(unconscious || IsSleeping() || getOxyLoss() > 50 || (status_flags & FAKEDEATH) || health <= HEALTH_THRESHOLD_CRIT) if(IsUnconscious() || IsSleeping() || getOxyLoss() > 50 || (status_flags & FAKEDEATH) || health <= HEALTH_THRESHOLD_CRIT)
if(stat == CONSCIOUS) if(stat == CONSCIOUS)
stat = UNCONSCIOUS stat = UNCONSCIOUS
blind_eyes(1) blind_eyes(1)

View File

@@ -683,7 +683,7 @@
if(health<= HEALTH_THRESHOLD_DEAD) if(health<= HEALTH_THRESHOLD_DEAD)
death() death()
return return
if(unconscious || IsSleeping() || getOxyLoss() > 50 || (status_flags & FAKEDEATH) || health <= HEALTH_THRESHOLD_CRIT) if(IsUnconscious() || IsSleeping() || getOxyLoss() > 50 || (status_flags & FAKEDEATH) || health <= HEALTH_THRESHOLD_CRIT)
if(stat == CONSCIOUS) if(stat == CONSCIOUS)
stat = UNCONSCIOUS stat = UNCONSCIOUS
blind_eyes(1) blind_eyes(1)

View File

@@ -501,7 +501,7 @@
to_chat(usr, "<span class='warning'>Unable to locate a data core entry for this person.</span>") to_chat(usr, "<span class='warning'>Unable to locate a data core entry for this person.</span>")
/mob/living/carbon/human/proc/canUseHUD() /mob/living/carbon/human/proc/canUseHUD()
return !(src.stat || src.knockdown || IsStun() || src.restrained()) return !(src.stat || IsKnockdown() || IsStun() || src.restrained())
/mob/living/carbon/human/can_inject(mob/user, error_msg, target_zone, var/penetrate_thick = 0) /mob/living/carbon/human/can_inject(mob/user, error_msg, target_zone, var/penetrate_thick = 0)
. = 1 // Default to returning true. . = 1 // Default to returning true.

View File

@@ -105,7 +105,7 @@
/mob/living/carbon/human/proc/check_block() /mob/living/carbon/human/proc/check_block()
if(mind) if(mind)
if(mind.martial_art && prob(mind.martial_art.block_chance) && in_throw_mode && !stat && !knockdown && !IsStun()) if(mind.martial_art && prob(mind.martial_art.block_chance) && in_throw_mode && !stat && !IsKnockdown() && !IsStun())
return TRUE return TRUE
return FALSE return FALSE

View File

@@ -450,7 +450,7 @@
return 1 return 1
if(restrained()) if(restrained())
return 1 return 1
if(unconscious) if(IsUnconscious())
return 1 return 1
if(IsStun()) if(IsStun())
return 1 return 1

View File

@@ -888,14 +888,14 @@
if(!(RADIMMUNE in species_traits)) if(!(RADIMMUNE in species_traits))
if(H.radiation) if(H.radiation)
if (H.radiation > 100) if (H.radiation > 100)
if(!H.knockdown) if(!H.IsKnockdown())
H.emote("collapse") H.emote("collapse")
H.Knockdown(200) H.Knockdown(200)
to_chat(H, "<span class='danger'>You feel weak.</span>") to_chat(H, "<span class='danger'>You feel weak.</span>")
switch(H.radiation) switch(H.radiation)
if(50 to 75) if(50 to 75)
if(prob(5)) if(prob(5))
if(!H.knockdown) if(!H.IsKnockdown())
H.emote("collapse") H.emote("collapse")
H.Knockdown(60) H.Knockdown(60)
to_chat(H, "<span class='danger'>You feel weak.</span>") to_chat(H, "<span class='danger'>You feel weak.</span>")

View File

@@ -47,7 +47,7 @@
return 0 return 0
/datum/species/angel/proc/CanFly(mob/living/carbon/human/H) /datum/species/angel/proc/CanFly(mob/living/carbon/human/H)
if(H.stat || H.IsStun() || H.knockdown) if(H.stat || H.IsStun() || H.IsKnockdown())
return 0 return 0
if(H.wear_suit && ((H.wear_suit.flags_inv & HIDEJUMPSUIT) && (!H.wear_suit.species_exception || !is_type_in_list(src, H.wear_suit.species_exception)))) //Jumpsuits have tail holes, so it makes sense they have wing holes too if(H.wear_suit && ((H.wear_suit.flags_inv & HIDEJUMPSUIT) && (!H.wear_suit.species_exception || !is_type_in_list(src, H.wear_suit.species_exception)))) //Jumpsuits have tail holes, so it makes sense they have wing holes too
to_chat(H, "Your suit blocks your wings from extending!") to_chat(H, "Your suit blocks your wings from extending!")

View File

@@ -53,7 +53,7 @@
return 1 return 1
if(health <= 0 && checkDead) if(health <= 0 && checkDead)
return 1 return 1
if(unconscious) if(IsUnconscious())
return 1 return 1
if(IsStun()) if(IsStun())
return 1 return 1

View File

@@ -26,7 +26,7 @@
if (radiation) if (radiation)
if (radiation > 100) if (radiation > 100)
if(!knockdown) if(!IsKnockdown())
emote("collapse") emote("collapse")
Knockdown(200) Knockdown(200)
to_chat(src, "<span class='danger'>You feel weak.</span>") to_chat(src, "<span class='danger'>You feel weak.</span>")
@@ -35,7 +35,7 @@
if(50 to 75) if(50 to 75)
if(prob(5)) if(prob(5))
if(!knockdown) if(!IsKnockdown())
emote("collapse") emote("collapse")
Knockdown(60) Knockdown(60)
to_chat(src, "<span class='danger'>You feel weak.</span>") to_chat(src, "<span class='danger'>You feel weak.</span>")

View File

@@ -48,9 +48,9 @@
playsound(loc, "punch", 25, 1, -1) playsound(loc, "punch", 25, 1, -1)
var/damage = rand(5, 10) var/damage = rand(5, 10)
if (prob(40)) if(prob(40))
damage = rand(10, 15) damage = rand(10, 15)
if ( (unconscious < 5) && (health > 0) ) if(AmountUnconscious() < 100 && health > 0)
Unconscious(rand(200, 300)) Unconscious(rand(200, 300))
visible_message("<span class='danger'>[M] has knocked out [name]!</span>", \ visible_message("<span class='danger'>[M] has knocked out [name]!</span>", \
"<span class='userdanger'>[M] has knocked out [name]!</span>", null, 5) "<span class='userdanger'>[M] has knocked out [name]!</span>", null, 5)
@@ -66,7 +66,7 @@
visible_message("<span class='danger'>[M] has attempted to punch [name]!</span>", \ visible_message("<span class='danger'>[M] has attempted to punch [name]!</span>", \
"<span class='userdanger'>[M] has attempted to punch [name]!</span>", null, COMBAT_MESSAGE_RANGE) "<span class='userdanger'>[M] has attempted to punch [name]!</span>", null, COMBAT_MESSAGE_RANGE)
if("disarm") if("disarm")
if (!unconscious) if(!IsUnconscious())
M.do_attack_animation(src, ATTACK_EFFECT_DISARM) M.do_attack_animation(src, ATTACK_EFFECT_DISARM)
if (prob(25)) if (prob(25))
Knockdown(40) Knockdown(40)
@@ -88,7 +88,7 @@
var/damage = rand(15, 30) var/damage = rand(15, 30)
if (damage >= 25) if (damage >= 25)
damage = rand(20, 40) damage = rand(20, 40)
if (unconscious < 15) if(AmountUnconscious() < 300)
Unconscious(rand(200, 300)) Unconscious(rand(200, 300))
visible_message("<span class='danger'>[M] has wounded [name]!</span>", \ visible_message("<span class='danger'>[M] has wounded [name]!</span>", \
"<span class='userdanger'>[M] has wounded [name]!</span>", null, COMBAT_MESSAGE_RANGE) "<span class='userdanger'>[M] has wounded [name]!</span>", null, COMBAT_MESSAGE_RANGE)

View File

@@ -60,8 +60,6 @@
GLOB.living_mob_list -= src GLOB.living_mob_list -= src
if(!gibbed) if(!gibbed)
GLOB.dead_mob_list += src GLOB.dead_mob_list += src
unconscious = 0
knockdown = 0
set_drugginess(0) set_drugginess(0)
SetSleeping(0, 0) SetSleeping(0, 0)
blind_eyes(1) blind_eyes(1)

View File

@@ -62,8 +62,9 @@
/datum/emote/living/collapse/run_emote(mob/user, params) /datum/emote/living/collapse/run_emote(mob/user, params)
. = ..() . = ..()
if(.) if(. && isliving(user))
user.Unconscious(40) var/mob/living/L = user
L.Unconscious(40)
/datum/emote/living/cough /datum/emote/living/cough
key = "cough" key = "cough"
@@ -330,8 +331,9 @@
/datum/emote/living/surrender/run_emote(mob/user, params) /datum/emote/living/surrender/run_emote(mob/user, params)
. = ..() . = ..()
if(.) if(. && isliving(user))
user.Knockdown(200) var/mob/living/L = user
L.Knockdown(200)
/datum/emote/living/sway /datum/emote/living/sway
key = "sway" key = "sway"

View File

@@ -99,10 +99,6 @@
//this updates all special effects: knockdown, druggy, stuttering, etc.. //this updates all special effects: knockdown, druggy, stuttering, etc..
/mob/living/proc/handle_status_effects() /mob/living/proc/handle_status_effects()
if(knockdown)
AdjustKnockdown(-20, 1, 1)
if(unconscious)
AdjustUnconscious(-20, 1, 1)
if(confused) if(confused)
confused = max(0, confused - 1) confused = max(0, confused - 1)

View File

@@ -237,7 +237,7 @@
death() death()
/mob/living/incapacitated(ignore_restraints, ignore_grab) /mob/living/incapacitated(ignore_restraints, ignore_grab)
if(stat || unconscious || IsStun() || knockdown || (!ignore_restraints && restrained(ignore_grab))) if(stat || IsUnconscious() || IsStun() || IsKnockdown() || (!ignore_restraints && restrained(ignore_grab)))
return 1 return 1
/mob/living/proc/InCritical() /mob/living/proc/InCritical()
@@ -935,7 +935,7 @@
//Updates canmove, lying and icons. Could perhaps do with a rename but I can't think of anything to describe it. //Updates canmove, lying and icons. Could perhaps do with a rename but I can't think of anything to describe it.
//Robots, animals and brains have their own version so don't worry about them //Robots, animals and brains have their own version so don't worry about them
/mob/living/proc/update_canmove() /mob/living/proc/update_canmove()
var/ko = knockdown || unconscious || stat || (status_flags & FAKEDEATH) var/ko = IsKnockdown() || IsUnconscious() || stat || (status_flags & FAKEDEATH)
var/chokehold = pulledby && pulledby.grab_state >= GRAB_NECK var/chokehold = pulledby && pulledby.grab_state >= GRAB_NECK
var/buckle_lying = !(buckled && !buckled.buckle_lying) var/buckle_lying = !(buckled && !buckled.buckle_lying)
var/has_legs = get_num_legs() var/has_legs = get_num_legs()

View File

@@ -591,7 +591,7 @@
/mob/living/silicon/robot/update_icons() /mob/living/silicon/robot/update_icons()
cut_overlays() cut_overlays()
icon_state = module.cyborg_base_icon icon_state = module.cyborg_base_icon
if(stat != DEAD && !(unconscious || IsStun() || knockdown || low_power_mode)) //Not dead, not stunned. if(stat != DEAD && !(IsUnconscious() || IsStun() || IsKnockdown() || low_power_mode)) //Not dead, not stunned.
if(!eye_lights) if(!eye_lights)
eye_lights = new() eye_lights = new()
if(lamp_intensity > 2) if(lamp_intensity > 2)
@@ -917,7 +917,7 @@
if(health <= -maxHealth) //die only once if(health <= -maxHealth) //die only once
death() death()
return return
if(unconscious || IsStun() || knockdown || getOxyLoss() > maxHealth*0.5) if(IsUnconscious() || IsStun() || IsKnockdown() || getOxyLoss() > maxHealth*0.5)
if(stat == CONSCIOUS) if(stat == CONSCIOUS)
stat = UNCONSCIOUS stat = UNCONSCIOUS
blind_eyes(1) blind_eyes(1)

View File

@@ -1,38 +0,0 @@
//Here are the procs used to modify status effects of a mob.
//The effects include: stun, knockdown, unconscious, sleeping, resting, jitteriness, dizziness, ear damage,
// eye damage, eye_blind, eye_blurry, druggy, BLIND disability, and NEARSIGHT disability.
/////////////////////////////////// STUN ////////////////////////////////////
/mob/living/silicon/Stun(amount, updating = 1, ignore_canstun = 0)
. = ..()
if(. && updating)
update_stat()
/mob/living/silicon/SetStun(amount, updating = 1, ignore_canstun = 0)
. = ..()
if(. && updating)
update_stat()
/mob/living/silicon/AdjustStun(amount, updating = 1, ignore_canstun = 0)
. = ..()
if(. && updating)
update_stat()
/////////////////////////////////// KNOCKDOWN ////////////////////////////////////
/mob/living/silicon/Knockdown(amount, updating = 1, ignore_canknockdown = 0)
. = ..()
if(. && updating)
update_stat()
/mob/living/silicon/SetKnockdown(amount, updating = 1, ignore_canknockdown = 0)
. = ..()
if(. && updating)
update_stat()
/mob/living/silicon/AdjustKnockdown(amount, updating = 1, ignore_canknockdown = 0)
. = ..()
if(. && updating)
update_stat()

View File

@@ -255,7 +255,7 @@ Auto Patrol[]"},
if(BOT_PREP_ARREST) // preparing to arrest target if(BOT_PREP_ARREST) // preparing to arrest target
// see if he got away. If he's no no longer adjacent or inside a closet or about to get up, we hunt again. // see if he got away. If he's no no longer adjacent or inside a closet or about to get up, we hunt again.
if(!Adjacent(target) || !isturf(target.loc) || target.knockdown < 2) if(!Adjacent(target) || !isturf(target.loc) || target.AmountKnockdown() < 40)
back_to_hunt() back_to_hunt()
return return
@@ -282,7 +282,7 @@ Auto Patrol[]"},
back_to_idle() back_to_idle()
return return
if(!Adjacent(target) || !isturf(target.loc) || (target.loc != target_lastloc && target.knockdown < 2)) //if he's changed loc and about to get up or not adjacent or got into a closet, we prep arrest again. if(!Adjacent(target) || !isturf(target.loc) || (target.loc != target_lastloc && target.AmountKnockdown() < 40)) //if he's changed loc and about to get up or not adjacent or got into a closet, we prep arrest again.
back_to_hunt() back_to_hunt()
return return
else else

View File

@@ -634,16 +634,15 @@
// called when bot bumps into anything // called when bot bumps into anything
/mob/living/simple_animal/bot/mulebot/Bump(atom/obs) /mob/living/simple_animal/bot/mulebot/Bump(atom/obs)
if(wires.is_cut(WIRE_AVOIDANCE)) // usually just bumps, but if avoidance disabled knock over mobs if(wires.is_cut(WIRE_AVOIDANCE)) // usually just bumps, but if avoidance disabled knock over mobs
var/mob/M = obs if(isliving(obs))
if(ismob(M)) var/mob/living/L = obs
if(iscyborg(M)) if(iscyborg(L))
visible_message("<span class='danger'>[src] bumps into [M]!</span>") visible_message("<span class='danger'>[src] bumps into [L]!</span>")
else else
if(!paicard) if(!paicard)
add_logs(src, M, "knocked down") add_logs(src, L, "knocked down")
visible_message("<span class='danger'>[src] knocks over [M]!</span>") visible_message("<span class='danger'>[src] knocks over [L]!</span>")
M.stop_pulling() L.Knockdown(160)
M.Knockdown(160)
return ..() return ..()
// called from mob/living/carbon/human/Crossed() // called from mob/living/carbon/human/Crossed()

View File

@@ -286,7 +286,7 @@ Auto Patrol: []"},
if(BOT_PREP_ARREST) // preparing to arrest target if(BOT_PREP_ARREST) // preparing to arrest target
// see if he got away. If he's no no longer adjacent or inside a closet or about to get up, we hunt again. // see if he got away. If he's no no longer adjacent or inside a closet or about to get up, we hunt again.
if( !Adjacent(target) || !isturf(target.loc) || target.knockdown < 2 ) if( !Adjacent(target) || !isturf(target.loc) || target.AmountKnockdown() < 40)
back_to_hunt() back_to_hunt()
return return
@@ -313,7 +313,7 @@ Auto Patrol: []"},
back_to_idle() back_to_idle()
return return
if(!Adjacent(target) || !isturf(target.loc) || (target.loc != target_lastloc && target.knockdown < 2)) //if he's changed loc and about to get up or not adjacent or got into a closet, we prep arrest again. if(!Adjacent(target) || !isturf(target.loc) || (target.loc != target_lastloc && target.AmountKnockdown() < 40)) //if he's changed loc and about to get up or not adjacent or got into a closet, we prep arrest again.
back_to_hunt() back_to_hunt()
return return
else //Try arresting again if the target escapes. else //Try arresting again if the target escapes.

View File

@@ -387,7 +387,7 @@
..() ..()
/mob/living/simple_animal/update_canmove() /mob/living/simple_animal/update_canmove()
if(unconscious || IsStun() || knockdown || stat || resting) if(IsUnconscious() || IsStun() || IsKnockdown() || stat || resting)
drop_all_held_items() drop_all_held_items()
canmove = 0 canmove = 0
else if(buckled) else if(buckled)

View File

@@ -5,19 +5,126 @@
////////////////////////////// STUN //////////////////////////////////// ////////////////////////////// STUN ////////////////////////////////////
/mob/living/Stun(amount, updating = 1, ignore_canstun = 0) /mob/living/IsStun() //If we're stunned
if(!stat && islist(stun_absorption) && (status_flags & CANSTUN || ignore_canstun)) return has_status_effect(STATUS_EFFECT_STUN)
if(absorb_stun(amount))
return 0 /mob/living/proc/AmountStun() //How many deciseconds remain in our stun
return ..() var/datum/status_effect/incapacitating/stun/S = IsStun()
if(S)
if(S.isprocessing)
return S.duration - world.time
else
return S.duration
return 0
/mob/living/proc/Stun(amount, updating = TRUE, ignore_canstun = FALSE) //Can't go below remaining duration
if((status_flags & CANSTUN) || ignore_canstun)
if(absorb_stun(amount, ignore_canstun))
return
var/datum/status_effect/incapacitating/stun/S = IsStun()
if(S)
if(S.isprocessing)
S.duration = max(world.time + amount, S.duration)
else
S.duration = max(amount, S.duration)
else if(amount > 0)
S = apply_status_effect(STATUS_EFFECT_STUN, updating)
S.duration = amount
S.update_canmove = updating
return S
/mob/living/proc/SetStun(amount, updating = TRUE, ignore_canstun = FALSE) //Sets remaining duration
if((status_flags & CANSTUN) || ignore_canstun)
var/datum/status_effect/incapacitating/stun/S = IsStun()
if(amount <= 0)
if(S)
S.update_canmove = updating
qdel(S)
else
if(absorb_stun(amount, ignore_canstun))
return
if(S)
if(S.isprocessing)
S.duration = world.time + amount
else
S.duration = amount
else
S = apply_status_effect(STATUS_EFFECT_STUN, updating)
S.duration = amount
return S
/mob/living/proc/AdjustStun(amount, updating = TRUE, ignore_canstun = FALSE) //Adds to remaining duration
if((status_flags & CANSTUN) || ignore_canstun)
if(absorb_stun(amount, ignore_canstun))
return
var/datum/status_effect/incapacitating/stun/S = IsStun()
if(S)
S.duration += amount
else if(amount > 0)
S = apply_status_effect(STATUS_EFFECT_STUN, updating)
S.duration = amount
return S
///////////////////////////////// KNOCKDOWN ///////////////////////////////////// ///////////////////////////////// KNOCKDOWN /////////////////////////////////////
/mob/living/Knockdown(amount, updating = TRUE, ignore_canknockdown = FALSE) /mob/living/IsKnockdown() //If we're knocked down
if(!stat && islist(stun_absorption) && (status_flags & CANKNOCKDOWN || ignore_canknockdown)) return has_status_effect(STATUS_EFFECT_KNOCKDOWN)
if(absorb_stun(amount))
return 0 /mob/living/proc/AmountKnockdown() //How many deciseconds remain in our knockdown
return ..() var/datum/status_effect/incapacitating/knockdown/K = IsKnockdown()
if(K)
if(K.isprocessing)
return K.duration - world.time
else
return K.duration
return 0
/mob/living/proc/Knockdown(amount, updating = TRUE, ignore_canknockdown = FALSE) //Can't go below remaining duration
if((status_flags & CANKNOCKDOWN) || ignore_canknockdown)
if(absorb_stun(amount, ignore_canknockdown))
return
var/datum/status_effect/incapacitating/knockdown/K = IsKnockdown()
if(K)
if(K.isprocessing)
K.duration = max(world.time + amount, K.duration)
else
K.duration = max(amount, K.duration)
else if(amount > 0)
K = apply_status_effect(STATUS_EFFECT_KNOCKDOWN, updating)
K.duration = amount
return K
/mob/living/proc/SetKnockdown(amount, updating = TRUE, ignore_canknockdown = FALSE) //Sets remaining duration
if((status_flags & CANKNOCKDOWN) || ignore_canknockdown)
var/datum/status_effect/incapacitating/knockdown/K = IsKnockdown()
if(amount <= 0)
if(K)
K.update_canmove = updating
qdel(K)
else
if(absorb_stun(amount, ignore_canknockdown))
return
if(K)
if(K.isprocessing)
K.duration = world.time + amount
else
K.duration = amount
else
K = apply_status_effect(STATUS_EFFECT_KNOCKDOWN, updating)
K.duration = amount
return K
/mob/living/proc/AdjustKnockdown(amount, updating = TRUE, ignore_canknockdown = FALSE) //Adds to remaining duration
if((status_flags & CANKNOCKDOWN) || ignore_canknockdown)
if(absorb_stun(amount, ignore_canknockdown))
return
var/datum/status_effect/incapacitating/knockdown/K = IsKnockdown()
if(K)
K.duration += amount
else if(amount > 0)
K = apply_status_effect(STATUS_EFFECT_KNOCKDOWN, updating)
K.duration = amount
return K
///////////////////////////////////// STUN ABSORPTION ///////////////////////////////////// ///////////////////////////////////// STUN ABSORPTION /////////////////////////////////////
@@ -33,7 +140,9 @@
stun_absorption[key] = list("end_time" = world.time + duration, "priority" = priority, "stuns_absorbed" = 0, \ stun_absorption[key] = list("end_time" = world.time + duration, "priority" = priority, "stuns_absorbed" = 0, \
"visible_message" = message, "self_message" = self_message, "examine_message" = examine_message) "visible_message" = message, "self_message" = self_message, "examine_message" = examine_message)
/mob/living/proc/absorb_stun(amount) /mob/living/proc/absorb_stun(amount, ignoring_flag_presence)
if(!amount || amount <= 0 || stat || ignoring_flag_presence || !islist(stun_absorption))
return FALSE
var/priority_absorb_key var/priority_absorb_key
var/highest_priority var/highest_priority
for(var/i in stun_absorption) for(var/i in stun_absorption)

View File

@@ -68,8 +68,6 @@
var/satiety = 0//Carbon var/satiety = 0//Carbon
var/overeatduration = 0 // How long this guy is overeating //Carbon var/overeatduration = 0 // How long this guy is overeating //Carbon
var/unconscious = 0
var/knockdown = 0
var/losebreath = 0//Carbon var/losebreath = 0//Carbon
var/a_intent = INTENT_HELP//Living var/a_intent = INTENT_HELP//Living
var/list/possible_a_intents = null//Living var/list/possible_a_intents = null//Living

View File

@@ -3,120 +3,72 @@
//The effects include: stun, knockdown, unconscious, sleeping, resting, jitteriness, dizziness, ear damage, //The effects include: stun, knockdown, unconscious, sleeping, resting, jitteriness, dizziness, ear damage,
// eye damage, eye_blind, eye_blurry, druggy, BLIND disability, and NEARSIGHT disability. // eye damage, eye_blind, eye_blurry, druggy, BLIND disability, and NEARSIGHT disability.
#define STUN_TIME_MULTIPLIER 0.05 //temporary; multiplies input stun times by this, will be removed once stuns are status effects
/////////////////////////////////// STUN //////////////////////////////////// /////////////////////////////////// STUN ////////////////////////////////////
/mob/proc/IsStun() //non-living mobs shouldn't be stunned /mob/proc/IsStun() //non-living mobs shouldn't be stunned
return FALSE return FALSE
/mob/living/IsStun() //If we're stunned
return has_status_effect(STATUS_EFFECT_STUN)
/mob/living/proc/AmountStun() //How many deciseconds remain in our stun
var/datum/status_effect/incapacitating/stun/S = IsStun()
if(S)
return S.duration - world.time
return 0
/mob/living/proc/Stun(amount, updating = TRUE, ignore_canstun = FALSE) //Can't go below remaining duration
if((status_flags & CANSTUN) || ignore_canstun)
var/datum/status_effect/incapacitating/stun/S = IsStun()
if(S)
var/remaining_duration = world.time - S.duration
S.duration = world.time + max(amount, remaining_duration)
else if(amount > 0)
S = apply_status_effect(STATUS_EFFECT_STUN)
S.duration = amount
S.update_canmove = updating
return S
/mob/living/proc/SetStun(amount, updating = TRUE, ignore_canstun = FALSE) //Sets remaining duration
if((status_flags & CANSTUN) || ignore_canstun)
var/datum/status_effect/incapacitating/stun/S = IsStun()
if(amount <= 0)
if(S)
S.update_canmove = updating
qdel(S)
else if(S)
S.duration = world.time + amount
else
S = apply_status_effect(STATUS_EFFECT_STUN)
S.duration = amount
S.update_canmove = updating
return S
/mob/living/proc/AdjustStun(amount, updating = TRUE, ignore_canstun = FALSE) //Adds to remaining duration
if((status_flags & CANSTUN) || ignore_canstun)
var/datum/status_effect/incapacitating/stun/S = IsStun()
if(S)
S.duration += amount
else if(amount > 0)
S = apply_status_effect(STATUS_EFFECT_STUN)
S.duration = amount
S.update_canmove = updating
return S
/////////////////////////////////// KNOCKDOWN //////////////////////////////////// /////////////////////////////////// KNOCKDOWN ////////////////////////////////////
/mob/proc/Knockdown(amount, updating = TRUE, ignore_canknockdown = FALSE) /mob/proc/IsKnockdown() //non-living mobs shouldn't be knocked down
if((status_flags & CANKNOCKDOWN) || ignore_canknockdown) return FALSE
knockdown = max(max(knockdown,amount * STUN_TIME_MULTIPLIER),0)
return TRUE
/mob/living/Knockdown(amount, updating = TRUE, ignore_canknockdown = FALSE)
. = ..()
if(. && updating)
update_canmove() //updates lying, canmove and icons
/mob/proc/SetKnockdown(amount, updating = TRUE, ignore_canknockdown = FALSE)
if(status_flags & CANKNOCKDOWN || ignore_canknockdown)
knockdown = max(amount * STUN_TIME_MULTIPLIER,0)
return TRUE
/mob/living/SetKnockdown(amount, updating = TRUE, ignore_canknockdown = FALSE)
. = ..()
if(. && updating)
update_canmove() //updates lying, canmove and icons
/mob/proc/AdjustKnockdown(amount, updating = TRUE, ignore_canknockdown = FALSE)
if((status_flags & CANKNOCKDOWN) || ignore_canknockdown)
knockdown = max(knockdown + (amount * STUN_TIME_MULTIPLIER) ,0)
return TRUE
/mob/living/AdjustKnockdown(amount, updating = TRUE, ignore_canknockdown = FALSE)
. = ..()
if(. && updating)
update_canmove() //updates lying, canmove and icons
/////////////////////////////////// UNCONSCIOUS //////////////////////////////////// /////////////////////////////////// UNCONSCIOUS ////////////////////////////////////
/mob/proc/Unconscious(amount, updating = TRUE, ignore_canunconscious = FALSE) /mob/proc/IsUnconscious() //non-living mobs shouldn't be unconscious
if(status_flags & CANUNCONSCIOUS || ignore_canunconscious) return FALSE
var/old_unconscious = unconscious
unconscious = max(max(unconscious,amount * STUN_TIME_MULTIPLIER),0)
if((!old_unconscious && unconscious) || (old_unconscious && !unconscious))
if(updating)
update_stat()
return TRUE
/mob/proc/SetUnconscious(amount, updating = TRUE, ignore_canunconscious = FALSE) /mob/living/IsUnconscious() //If we're unconscious
if(status_flags & CANUNCONSCIOUS || ignore_canunconscious) return has_status_effect(STATUS_EFFECT_UNCONSCIOUS)
var/old_unconscious = unconscious
unconscious = max(amount * STUN_TIME_MULTIPLIER,0)
if((!old_unconscious && unconscious) || (old_unconscious && !unconscious))
if(updating)
update_stat()
return TRUE
/mob/proc/AdjustUnconscious(amount, updating = TRUE, ignore_canunconscious = FALSE) /mob/living/proc/AmountUnconscious() //How many deciseconds remain in our unconsciousness
if(status_flags & CANUNCONSCIOUS || ignore_canunconscious) var/datum/status_effect/incapacitating/unconscious/U = IsUnconscious()
var/old_unconscious = unconscious if(U)
unconscious = max(unconscious + (amount * STUN_TIME_MULTIPLIER) ,0) if(U.isprocessing)
if((!old_unconscious && unconscious) || (old_unconscious && !unconscious)) return U.duration - world.time
if(updating) else
update_stat() return U.duration
return TRUE return 0
/mob/living/proc/Unconscious(amount, updating = TRUE, ignore_canunconscious = FALSE) //Can't go below remaining duration
if((status_flags & CANUNCONSCIOUS) || ignore_canunconscious)
var/datum/status_effect/incapacitating/unconscious/U = IsUnconscious()
if(U)
if(U.isprocessing)
U.duration = max(world.time + amount, U.duration)
else
U.duration = max(amount, U.duration)
else if(amount > 0)
U = apply_status_effect(STATUS_EFFECT_UNCONSCIOUS, updating)
U.duration = amount
return U
/mob/living/proc/SetUnconscious(amount, updating = TRUE, ignore_canunconscious = FALSE) //Sets remaining duration
if((status_flags & CANUNCONSCIOUS) || ignore_canunconscious)
var/datum/status_effect/incapacitating/unconscious/U = IsUnconscious()
if(amount <= 0)
if(U)
U.update_canmove = updating
qdel(U)
else if(U)
if(U.isprocessing)
U.duration = world.time + amount
else
U.duration = amount
else
U = apply_status_effect(STATUS_EFFECT_UNCONSCIOUS, updating)
U.duration = amount
return U
/mob/living/proc/AdjustUnconscious(amount, updating = TRUE, ignore_canunconscious = FALSE) //Adds to remaining duration
if((status_flags & CANUNCONSCIOUS) || ignore_canunconscious)
var/datum/status_effect/incapacitating/unconscious/U = IsUnconscious()
if(U)
U.duration += amount
else if(amount > 0)
U = apply_status_effect(STATUS_EFFECT_UNCONSCIOUS, updating)
U.duration = amount
return U
/////////////////////////////////// SLEEPING //////////////////////////////////// /////////////////////////////////// SLEEPING ////////////////////////////////////
@@ -126,18 +78,22 @@
/mob/living/proc/AmountSleeping() //How many deciseconds remain in our sleep /mob/living/proc/AmountSleeping() //How many deciseconds remain in our sleep
var/datum/status_effect/incapacitating/sleeping/S = IsSleeping() var/datum/status_effect/incapacitating/sleeping/S = IsSleeping()
if(S) if(S)
return S.duration - world.time if(S.isprocessing)
return S.duration - world.time
else
return S.duration
return 0 return 0
/mob/living/proc/Sleeping(amount, updating = TRUE) //Can't go below remaining duration /mob/living/proc/Sleeping(amount, updating = TRUE) //Can't go below remaining duration
var/datum/status_effect/incapacitating/sleeping/S = IsSleeping() var/datum/status_effect/incapacitating/sleeping/S = IsSleeping()
if(S) if(S)
var/remaining_duration = world.time - S.duration if(S.isprocessing)
S.duration = world.time + max(amount, remaining_duration) S.duration = max(world.time + amount, S.duration)
else
S.duration = max(amount, S.duration)
else if(amount > 0) else if(amount > 0)
S = apply_status_effect(STATUS_EFFECT_SLEEPING) S = apply_status_effect(STATUS_EFFECT_SLEEPING, updating)
S.duration = amount S.duration = amount
S.update_canmove = updating
return S return S
/mob/living/proc/SetSleeping(amount, updating = TRUE) //Sets remaining duration /mob/living/proc/SetSleeping(amount, updating = TRUE) //Sets remaining duration
@@ -147,11 +103,13 @@
S.update_canmove = updating S.update_canmove = updating
qdel(S) qdel(S)
else if(S) else if(S)
S.duration = world.time + amount if(S.isprocessing)
S.duration = world.time + amount
else
S.duration = amount
else else
S = apply_status_effect(STATUS_EFFECT_SLEEPING) S = apply_status_effect(STATUS_EFFECT_SLEEPING, updating)
S.duration = amount S.duration = amount
S.update_canmove = updating
return S return S
/mob/living/proc/AdjustSleeping(amount, updating = TRUE) //Adds to remaining duration /mob/living/proc/AdjustSleeping(amount, updating = TRUE) //Adds to remaining duration
@@ -159,9 +117,8 @@
if(S) if(S)
S.duration += amount S.duration += amount
else if(amount > 0) else if(amount > 0)
S = apply_status_effect(STATUS_EFFECT_SLEEPING) S = apply_status_effect(STATUS_EFFECT_SLEEPING, updating)
S.duration = amount S.duration = amount
S.update_canmove = updating
return S return S
/////////////////////////////////// RESTING //////////////////////////////////// /////////////////////////////////// RESTING ////////////////////////////////////

View File

@@ -20,7 +20,7 @@ Urist: I don't feel like figuring out how you store object spells so I'm leaving
Make sure spells that are removed from spell_list are actually removed and deleted when mind transfering. Make sure spells that are removed from spell_list are actually removed and deleted when mind transfering.
Also, you never added distance checking after target is selected. I've went ahead and did that. Also, you never added distance checking after target is selected. I've went ahead and did that.
*/ */
/obj/effect/proc_holder/spell/targeted/mind_transfer/cast(list/targets, mob/user = usr, distanceoverride) /obj/effect/proc_holder/spell/targeted/mind_transfer/cast(list/targets, mob/living/user = usr, distanceoverride)
if(!targets.len) if(!targets.len)
to_chat(user, "<span class='warning'>No mind found!</span>") to_chat(user, "<span class='warning'>No mind found!</span>")
return return
@@ -59,7 +59,7 @@ Also, you never added distance checking after target is selected. I've went ahea
return return
var/mob/living/victim = target//The target of the spell whos body will be transferred to. var/mob/living/victim = target//The target of the spell whos body will be transferred to.
var/mob/caster = user//The wizard/whomever doing the body transferring. var/mob/living/caster = user//The wizard/whomever doing the body transferring.
//MIND TRANSFER BEGIN //MIND TRANSFER BEGIN
var/mob/dead/observer/ghost = victim.ghostize(0) var/mob/dead/observer/ghost = victim.ghostize(0)

View File

@@ -1,5 +1,4 @@
#define STUN_SET_AMOUNT 40 #define STUN_SET_AMOUNT 40
#define STUN_CHECK_AMOUNT 2
/obj/item/organ/cyberimp /obj/item/organ/cyberimp
name = "cybernetic implant" name = "cybernetic implant"
@@ -110,7 +109,7 @@
if(owner.AmountStun() > STUN_SET_AMOUNT) if(owner.AmountStun() > STUN_SET_AMOUNT)
owner.SetStun(STUN_SET_AMOUNT) owner.SetStun(STUN_SET_AMOUNT)
if(owner.knockdown > STUN_CHECK_AMOUNT) if(owner.AmountKnockdown() > STUN_SET_AMOUNT)
owner.SetKnockdown(STUN_SET_AMOUNT) owner.SetKnockdown(STUN_SET_AMOUNT)
/obj/item/organ/cyberimp/brain/anti_stun/emp_act(severity) /obj/item/organ/cyberimp/brain/anti_stun/emp_act(severity)

View File

@@ -1618,7 +1618,6 @@
#include "code\modules\mob\living\silicon\say.dm" #include "code\modules\mob\living\silicon\say.dm"
#include "code\modules\mob\living\silicon\silicon.dm" #include "code\modules\mob\living\silicon\silicon.dm"
#include "code\modules\mob\living\silicon\silicon_defense.dm" #include "code\modules\mob\living\silicon\silicon_defense.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\ai.dm"
#include "code\modules\mob\living\silicon\ai\ai_defense.dm" #include "code\modules\mob\living\silicon\ai\ai_defense.dm"
#include "code\modules\mob\living\silicon\ai\death.dm" #include "code\modules\mob\living\silicon\ai\death.dm"