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_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_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
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
break

View File

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

View File

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

View File

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

View File

@@ -35,7 +35,7 @@
return 0
/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>", \
"<span class='userdanger'>[A] slams you into the ground!</span>")
playsound(get_turf(A), 'sound/weapons/slam.ogg', 50, 1, -1)
@@ -45,7 +45,7 @@
return 1
/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>", \
"<span class='userdanger'>[A] kicks you back!</span>")
playsound(get_turf(A), 'sound/weapons/cqchit1.ogg', 50, 1, -1)
@@ -53,7 +53,7 @@
D.throw_at(throw_target, 1, 14, A)
D.apply_damage(10, BRUTE)
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>", \
"<span class='userdanger'>[A] kicks your head, knocking you out!</span>")
playsound(get_turf(A), 'sound/weapons/genhit1.ogg', 50, 1, -1)
@@ -114,7 +114,7 @@
A.do_attack_animation(D)
var/picked_hit_type = pick("CQC'd", "Big Bossed")
var/bonus_damage = 13
if(D.knockdown || D.resting || D.lying)
if(D.IsKnockdown() || D.resting || D.lying)
bonus_damage += 5
picked_hit_type = "stomps on"
D.apply_damage(bonus_damage, BRUTE)
@@ -125,7 +125,7 @@
D.visible_message("<span class='danger'>[A] [picked_hit_type] [D]!</span>", \
"<span class='userdanger'>[A] [picked_hit_type] you!</span>")
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]!", \
"<span class='userdanger'>[A] leg sweeps you!</span>")
playsound(get_turf(A), 'sound/effects/hit_kick.ogg', 50, 1, -1)
@@ -140,7 +140,7 @@
if(check_streak(A,D))
return 1
if(prob(65))
if(!D.stat || !D.knockdown || !restraining)
if(!D.stat || !D.IsKnockdown() || !restraining)
I = D.get_active_held_item()
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>")

View File

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

View File

@@ -35,7 +35,7 @@
return 0
/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)
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>")
@@ -49,7 +49,7 @@
return basic_hit(A,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)
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>")
@@ -61,7 +61,7 @@
return basic_hit(A,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)
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>")
@@ -74,7 +74,7 @@
return basic_hit(A,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)
D.visible_message("<span class='warning'>[A] kicks [D] in the head!</span>", \
"<span class='userdanger'>[A] kicks you in the jaw!</span>")
@@ -87,7 +87,7 @@
return basic_hit(A,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)
D.visible_message("<span class='warning'>[A] elbow drops [D]!</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>"
/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.Unconscious(200)
owner.Jitter(1000)
@@ -269,7 +269,7 @@ GLOBAL_LIST_EMPTY(mutations_list)
text_gain_indication = "<span class='danger'>You start coughing.</span>"
/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.emote("cough")
@@ -317,7 +317,7 @@ GLOBAL_LIST_EMPTY(mutations_list)
text_gain_indication = "<span class='danger'>You twitch.</span>"
/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)
switch(rand(1, 3))
if(1)

View File

@@ -60,8 +60,8 @@
if(istype(L)) //this is probably more safety than actually needed
var/vanguard = L.stun_absorption["vanguard"]
desc = initial(desc)
desc += "<br><b>[vanguard["stuns_absorbed"] * 2]</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."]"
desc += "<br><b>[Floor(vanguard["stuns_absorbed"] * 0.1)]</b> seconds of stuns held back.\
[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()
@@ -98,7 +98,7 @@
vanguard["end_time"] = 0 //so it doesn't absorb the stuns we're about to apply
owner.Knockdown(stuns_blocked)
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>"
stuns_blocked *= 2
owner.Unconscious(stuns_blocked)

View File

@@ -6,20 +6,37 @@
alert_type = null
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)
owner.update_canmove()
if(issilicon(owner))
owner.update_stat()
/datum/status_effect/incapacitating/on_apply()
. = ..()
update_canmove = TRUE
return ..()
/datum/status_effect/incapacitating/on_remove()
if(update_canmove)
owner.update_canmove()
if(issilicon(owner)) //silicons need stat updates in addition to normal canmove updates
owner.update_stat()
//STUN
/datum/status_effect/incapacitating/stun
id = "stun"
//KNOCKDOWN
/datum/status_effect/incapacitating/knockdown
id = "knockdown"
//UNCONSCIOUS
/datum/status_effect/incapacitating/unconscious
id = "unconscious"
//SLEEPING
/datum/status_effect/incapacitating/sleeping
id = "sleeping"
@@ -27,18 +44,18 @@
var/mob/living/carbon/carbon_owner
var/mob/living/carbon/human/human_owner
/datum/status_effect/incapacitating/sleeping/Destroy()
carbon_owner = null
human_owner = null
return ..()
/datum/status_effect/incapacitating/sleeping/on_apply()
/datum/status_effect/incapacitating/sleeping/on_creation(mob/living/new_owner, updating_canmove)
..()
if(update_canmove)
owner.update_stat()
if(iscarbon(owner)) //to avoid repeated istypes
carbon_owner = owner
if(ishuman(owner))
human_owner = owner
/datum/status_effect/incapacitating/sleeping/Destroy()
carbon_owner = null
human_owner = null
return ..()
/datum/status_effect/incapacitating/sleeping/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/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)
owner = new_owner
if(owner)
@@ -76,7 +79,7 @@
// 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
var/datum/status_effect/S1 = effect
LAZYINITLIST(status_effects)
@@ -86,7 +89,9 @@
S.be_replaced()
else
return
S1 = new effect(src)
var/list/arguments = args.Copy()
arguments[1] = src
S1 = new effect(arguments)
. = 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

View File

@@ -440,6 +440,8 @@
if(!no_effect && (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_y_diff = 0
var/final_pixel_y = initial(pixel_y)

View File

@@ -69,7 +69,7 @@
if(iscultist(L))
to_chat(L, "<span class='heavy_brass'>\"Watch your step, wretch.\"</span>")
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>", \
"<span class='userdanger'>[target_flashed ? "An unseen force":"The glowing sigil around you"] holds you in place!</span>")
L.Stun(100)

View File

@@ -260,7 +260,7 @@
darkness_view = 8
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))
to_chat(user, "<span class='cultlarge'>\"You want to be blind, do you?\"</span>")
@@ -283,7 +283,7 @@
icon_state ="shuttlecurse"
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))
user.dropItemToGround(src, TRUE)
user.Knockdown(100)

View File

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

View File

@@ -44,7 +44,7 @@
//////////////////////////////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)
user.Unconscious(100)
to_chat(user, "<span class='userdanger'>Your body is wracked with debilitating pain!</span>")
@@ -63,7 +63,7 @@
///////////////////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))
return
if(!iscultist(user) && !iswizard(user) && !usability)

View File

@@ -850,7 +850,7 @@
icon_state ="bookknock"
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>")
user.Knockdown(40)

View File

@@ -1200,7 +1200,7 @@
/obj/machinery/door/airlock/proc/weld_checks(obj/item/weapon/weldingtool/W, mob/user)
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
if(istype(I, /obj/item/weapon/crowbar) )
beingcrowbarred = 1

View File

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

View File

@@ -113,7 +113,7 @@
/obj/effect/anomaly/grav/Bumped(mob/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)
A.Knockdown(40)
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.start()
for(var/mob/M in viewers(1, location))
if (prob (50 * amount))
to_chat(M, "<span class='danger'>The explosion knocks you down.</span>")
M.Knockdown(rand(20,100))
for(var/mob/living/L in viewers(1, location))
if(prob(50 * amount))
to_chat(L, "<span class='danger'>The explosion knocks you down.</span>")
L.Knockdown(rand(20,100))
return
else
dyn_explosion(location, amount, flashing_factor)

View File

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

View File

@@ -100,21 +100,21 @@
if(!signal || signal.encryption != code)
return
if(ismob(loc) && on)
if(isliving(loc) && on)
if(shock_cooldown != 0)
return
shock_cooldown = 1
spawn(100)
shock_cooldown = 0
var/mob/M = loc
step(M, pick(GLOB.cardinal))
var/mob/living/L = loc
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
s.set_up(3, 1, M)
s.set_up(3, 1, L)
s.start()
M.Knockdown(100)
L.Knockdown(100)
if(master)
master.receive_signal()

View File

@@ -77,7 +77,7 @@
var/cooldown = 0
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)
return ..()

View File

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

View File

@@ -20,7 +20,7 @@
var/egged = 0
/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
move_delay = 1
if(step(src, direction))

View File

@@ -198,7 +198,7 @@
if(M.has_gravity() && M.mob_size > MOB_SIZE_SMALL && !(M.movement_type & FLYING))
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>",
"<span class='danger'>You hear breaking glass.</span>")
var/turf/T = get_turf(src)
@@ -208,8 +208,8 @@
AM.forceMove(T)
debris -= AM
if(istype(AM, /obj/item/weapon/shard))
AM.throw_impact(M)
M.Knockdown(100)
AM.throw_impact(L)
L.Knockdown(100)
qdel(src)
/obj/structure/table/glass/deconstruct(disassembled = TRUE, wrench_disassembly = 0)
@@ -451,7 +451,7 @@
attack_hand(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
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src, ATTACK_EFFECT_KICK)

View File

@@ -463,7 +463,7 @@
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)
to_chat(user, "<span class='warning'>Someone's already washing here!</span>")
return

View File

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

View File

@@ -1,6 +1,6 @@
/mob/living/carbon/proc/dream()
set waitfor = 0
dreaming = 1
dreaming = TRUE
var/list/dreams = list(
"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",
@@ -9,18 +9,18 @@
"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"
)
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)
dreams -= dream_image
to_chat(src, "<span class='notice'><i>... [dream_image] ...</i></span>")
sleep(rand(40,70))
if(unconscious <= 0)
dreaming = 0
return 0
dreaming = 0
if(stat != UNCONSCIOUS || InCritical())
break
dreaming = FALSE
return 1
/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
icon_state = "alien[caste]_dead"
else if((stat == UNCONSCIOUS && !asleep) || knockdown)
else if((stat == UNCONSCIOUS && !asleep) || IsKnockdown())
icon_state = "alien[caste]_unconscious"
else if(leap_on_click)
icon_state = "alien[caste]_pounce"

View File

@@ -20,7 +20,7 @@
if(health<= -maxHealth || !getorgan(/obj/item/organ/brain))
death()
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)
stat = UNCONSCIOUS
blind_eyes(1)

View File

@@ -683,7 +683,7 @@
if(health<= HEALTH_THRESHOLD_DEAD)
death()
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)
stat = UNCONSCIOUS
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>")
/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)
. = 1 // Default to returning true.

View File

@@ -105,7 +105,7 @@
/mob/living/carbon/human/proc/check_block()
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 FALSE

View File

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

View File

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

View File

@@ -47,7 +47,7 @@
return 0
/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
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!")

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -237,7 +237,7 @@
death()
/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
/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.
//Robots, animals and brains have their own version so don't worry about them
/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/buckle_lying = !(buckled && !buckled.buckle_lying)
var/has_legs = get_num_legs()

View File

@@ -591,7 +591,7 @@
/mob/living/silicon/robot/update_icons()
cut_overlays()
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)
eye_lights = new()
if(lamp_intensity > 2)
@@ -917,7 +917,7 @@
if(health <= -maxHealth) //die only once
death()
return
if(unconscious || IsStun() || knockdown || getOxyLoss() > maxHealth*0.5)
if(IsUnconscious() || IsStun() || IsKnockdown() || getOxyLoss() > maxHealth*0.5)
if(stat == CONSCIOUS)
stat = UNCONSCIOUS
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
// 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()
return
@@ -282,7 +282,7 @@ Auto Patrol[]"},
back_to_idle()
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()
return
else

View File

@@ -634,16 +634,15 @@
// called when bot bumps into anything
/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
var/mob/M = obs
if(ismob(M))
if(iscyborg(M))
visible_message("<span class='danger'>[src] bumps into [M]!</span>")
if(isliving(obs))
var/mob/living/L = obs
if(iscyborg(L))
visible_message("<span class='danger'>[src] bumps into [L]!</span>")
else
if(!paicard)
add_logs(src, M, "knocked down")
visible_message("<span class='danger'>[src] knocks over [M]!</span>")
M.stop_pulling()
M.Knockdown(160)
add_logs(src, L, "knocked down")
visible_message("<span class='danger'>[src] knocks over [L]!</span>")
L.Knockdown(160)
return ..()
// called from mob/living/carbon/human/Crossed()

View File

@@ -286,7 +286,7 @@ Auto Patrol: []"},
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.
if( !Adjacent(target) || !isturf(target.loc) || target.knockdown < 2 )
if( !Adjacent(target) || !isturf(target.loc) || target.AmountKnockdown() < 40)
back_to_hunt()
return
@@ -313,7 +313,7 @@ Auto Patrol: []"},
back_to_idle()
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()
return
else //Try arresting again if the target escapes.

View File

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

View File

@@ -5,19 +5,126 @@
////////////////////////////// STUN ////////////////////////////////////
/mob/living/Stun(amount, updating = 1, ignore_canstun = 0)
if(!stat && islist(stun_absorption) && (status_flags & CANSTUN || ignore_canstun))
if(absorb_stun(amount))
/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)
if(S.isprocessing)
return S.duration - world.time
else
return S.duration
return 0
return ..()
/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 /////////////////////////////////////
/mob/living/Knockdown(amount, updating = TRUE, ignore_canknockdown = FALSE)
if(!stat && islist(stun_absorption) && (status_flags & CANKNOCKDOWN || ignore_canknockdown))
if(absorb_stun(amount))
/mob/living/IsKnockdown() //If we're knocked down
return has_status_effect(STATUS_EFFECT_KNOCKDOWN)
/mob/living/proc/AmountKnockdown() //How many deciseconds remain in our knockdown
var/datum/status_effect/incapacitating/knockdown/K = IsKnockdown()
if(K)
if(K.isprocessing)
return K.duration - world.time
else
return K.duration
return 0
return ..()
/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 /////////////////////////////////////
@@ -33,7 +140,9 @@
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)
/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/highest_priority
for(var/i in stun_absorption)

View File

@@ -68,8 +68,6 @@
var/satiety = 0//Carbon
var/overeatduration = 0 // How long this guy is overeating //Carbon
var/unconscious = 0
var/knockdown = 0
var/losebreath = 0//Carbon
var/a_intent = INTENT_HELP//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,
// 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 ////////////////////////////////////
/mob/proc/IsStun() //non-living mobs shouldn't be stunned
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 ////////////////////////////////////
/mob/proc/Knockdown(amount, updating = TRUE, ignore_canknockdown = FALSE)
if((status_flags & CANKNOCKDOWN) || ignore_canknockdown)
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
/mob/proc/IsKnockdown() //non-living mobs shouldn't be knocked down
return FALSE
/////////////////////////////////// UNCONSCIOUS ////////////////////////////////////
/mob/proc/Unconscious(amount, updating = TRUE, ignore_canunconscious = FALSE)
if(status_flags & CANUNCONSCIOUS || ignore_canunconscious)
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/IsUnconscious() //non-living mobs shouldn't be unconscious
return FALSE
/mob/proc/SetUnconscious(amount, updating = TRUE, ignore_canunconscious = FALSE)
if(status_flags & CANUNCONSCIOUS || ignore_canunconscious)
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/living/IsUnconscious() //If we're unconscious
return has_status_effect(STATUS_EFFECT_UNCONSCIOUS)
/mob/proc/AdjustUnconscious(amount, updating = TRUE, ignore_canunconscious = FALSE)
if(status_flags & CANUNCONSCIOUS || ignore_canunconscious)
var/old_unconscious = unconscious
unconscious = max(unconscious + (amount * STUN_TIME_MULTIPLIER) ,0)
if((!old_unconscious && unconscious) || (old_unconscious && !unconscious))
if(updating)
update_stat()
return TRUE
/mob/living/proc/AmountUnconscious() //How many deciseconds remain in our unconsciousness
var/datum/status_effect/incapacitating/unconscious/U = IsUnconscious()
if(U)
if(U.isprocessing)
return U.duration - world.time
else
return U.duration
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 ////////////////////////////////////
@@ -126,18 +78,22 @@
/mob/living/proc/AmountSleeping() //How many deciseconds remain in our sleep
var/datum/status_effect/incapacitating/sleeping/S = IsSleeping()
if(S)
if(S.isprocessing)
return S.duration - world.time
else
return S.duration
return 0
/mob/living/proc/Sleeping(amount, updating = TRUE) //Can't go below remaining duration
var/datum/status_effect/incapacitating/sleeping/S = IsSleeping()
if(S)
var/remaining_duration = world.time - S.duration
S.duration = world.time + max(amount, remaining_duration)
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_SLEEPING)
S = apply_status_effect(STATUS_EFFECT_SLEEPING, updating)
S.duration = amount
S.update_canmove = updating
return S
/mob/living/proc/SetSleeping(amount, updating = TRUE) //Sets remaining duration
@@ -147,11 +103,13 @@
S.update_canmove = updating
qdel(S)
else if(S)
if(S.isprocessing)
S.duration = world.time + amount
else
S = apply_status_effect(STATUS_EFFECT_SLEEPING)
S.duration = amount
S.update_canmove = updating
else
S = apply_status_effect(STATUS_EFFECT_SLEEPING, updating)
S.duration = amount
return S
/mob/living/proc/AdjustSleeping(amount, updating = TRUE) //Adds to remaining duration
@@ -159,9 +117,8 @@
if(S)
S.duration += amount
else if(amount > 0)
S = apply_status_effect(STATUS_EFFECT_SLEEPING)
S = apply_status_effect(STATUS_EFFECT_SLEEPING, updating)
S.duration = amount
S.update_canmove = updating
return S
/////////////////////////////////// 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.
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)
to_chat(user, "<span class='warning'>No mind found!</span>")
return
@@ -59,7 +59,7 @@ Also, you never added distance checking after target is selected. I've went ahea
return
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
var/mob/dead/observer/ghost = victim.ghostize(0)

View File

@@ -1,5 +1,4 @@
#define STUN_SET_AMOUNT 40
#define STUN_CHECK_AMOUNT 2
/obj/item/organ/cyberimp
name = "cybernetic implant"
@@ -110,7 +109,7 @@
if(owner.AmountStun() > 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)
/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\silicon.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_defense.dm"
#include "code\modules\mob\living\silicon\ai\death.dm"