mirror of
https://github.com/fulpstation/fulpstation.git
synced 2025-12-10 01:57:01 +00:00
Stun is now a status effect (#28654)
* Stun is now a status effect * I'D RATHER NOT * smart * very smart * pideyview * small fixes * slight fix
This commit is contained in:
@@ -30,6 +30,8 @@
|
||||
// DEBUFFS //
|
||||
/////////////
|
||||
|
||||
#define STATUS_EFFECT_STUN /datum/status_effect/incapacitating/stun //the affected is stunned
|
||||
|
||||
#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
|
||||
|
||||
@@ -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.stun || (!drifting && user.loc != Uloc) || (extra_checks && !extra_checks.Invoke()))
|
||||
if(QDELETED(user) || user.stat || user.knockdown || user.IsStun() || (!drifting && user.loc != Uloc) || (extra_checks && !extra_checks.Invoke()))
|
||||
. = 0
|
||||
break
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
if(call(client.click_intercept,"InterceptClickOn")(src,params,A))
|
||||
return
|
||||
|
||||
if(stat || lockcharge || knockdown || stun || unconscious)
|
||||
if(stat || lockcharge || knockdown || IsStun() || unconscious)
|
||||
return
|
||||
|
||||
var/list/modifiers = params2list(params)
|
||||
|
||||
@@ -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.stun || usr.knockdown)
|
||||
if(usr.stat || usr.unconscious || usr.knockdown || usr.IsStun())
|
||||
return 1
|
||||
if (istype(usr.loc,/obj/mecha)) // stops inventory actions in a mech
|
||||
return 1
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
if(owner.restrained())
|
||||
return 0
|
||||
if(check_flags & AB_CHECK_STUN)
|
||||
if(owner.stun || owner.knockdown)
|
||||
if(owner.knockdown || owner.IsStun())
|
||||
return 0
|
||||
if(check_flags & AB_CHECK_LYING)
|
||||
if(owner.lying)
|
||||
|
||||
@@ -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.stun && !D.knockdown)
|
||||
if(!D.stat && !D.IsStun() && !D.knockdown)
|
||||
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>")
|
||||
|
||||
@@ -16,6 +16,10 @@
|
||||
if(update_canmove)
|
||||
owner.update_canmove()
|
||||
|
||||
//STUN
|
||||
/datum/status_effect/incapacitating/stun
|
||||
id = "stun"
|
||||
|
||||
//SLEEPING
|
||||
/datum/status_effect/incapacitating/sleeping
|
||||
id = "sleeping"
|
||||
|
||||
@@ -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.stun || user.knockdown)
|
||||
if(user.restrained() || user.lying || user.stat || user.IsStun() || user.knockdown)
|
||||
return 0
|
||||
if(!(src in user.contents))
|
||||
return 0
|
||||
|
||||
@@ -838,10 +838,10 @@
|
||||
icon_state ="bookforcewall"
|
||||
desc = "This book has a dedication to mimes everywhere inside the front cover."
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/forcewall/recoil(mob/user)
|
||||
/obj/item/weapon/spellbook/oneuse/forcewall/recoil(mob/living/user)
|
||||
..()
|
||||
to_chat(user,"<span class='warning'>You suddenly feel very solid!</span>")
|
||||
user.Stun(40)
|
||||
user.Stun(40, ignore_canstun = TRUE)
|
||||
user.petrify(30)
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/knock
|
||||
|
||||
@@ -618,7 +618,9 @@
|
||||
if(emagged) //has to be here because otherwise it doesn't work
|
||||
playsound(loc, 'sound/effects/supermatter.ogg', 100, 1)
|
||||
say("A miniature black hole suddenly appears in front of [src], devouring [usr] alive!")
|
||||
usr.Stun(200) //you can't run :^)
|
||||
if(isliving(usr))
|
||||
var/mob/living/L = usr
|
||||
L.Stun(200, ignore_canstun = TRUE) //you can't run :^)
|
||||
var/S = new /obj/singularity/academy(usr.loc)
|
||||
emagged = 0 //immediately removes emagged status so people can't kill themselves by sprinting up and interacting
|
||||
sleep(50)
|
||||
|
||||
@@ -905,7 +905,7 @@
|
||||
if(!user.transferItemToLoc(mmi_as_oc, src))
|
||||
to_chat(user, "<span class='warning'>\the [mmi_as_oc] is stuck to your hand, you cannot put it in \the [src]!</span>")
|
||||
return FALSE
|
||||
var/mob/brainmob = mmi_as_oc.brainmob
|
||||
var/mob/living/brainmob = mmi_as_oc.brainmob
|
||||
mmi_as_oc.mecha = src
|
||||
occupant = brainmob
|
||||
brainmob.forceMove(src) //should allow relaymove
|
||||
|
||||
@@ -41,10 +41,10 @@
|
||||
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 60, acid = 50)
|
||||
|
||||
|
||||
/obj/item/weapon/storage/backpack/holding/suicide_act(mob/user)
|
||||
/obj/item/weapon/storage/backpack/holding/suicide_act(mob/living/user)
|
||||
user.visible_message("<span class='suicide'>[user] is jumping into [src]! It looks like [user.p_theyre()] trying to commit suicide.</span>")
|
||||
user.drop_item()
|
||||
user.Stun(100)
|
||||
user.Stun(100, ignore_canstun = TRUE)
|
||||
sleep(20)
|
||||
playsound(src, "rustle", 50, 1, -5)
|
||||
qdel(user)
|
||||
|
||||
@@ -91,13 +91,13 @@
|
||||
origin_tech = "materials=1;engineering=1;biotech=3"
|
||||
attack_verb = list("wrenched", "medicaled", "tapped", "jabbed", "whacked")
|
||||
|
||||
/obj/item/weapon/wrench/medical/suicide_act(mob/user)
|
||||
/obj/item/weapon/wrench/medical/suicide_act(mob/living/user)
|
||||
user.visible_message("<span class='suicide'>[user] is praying to the medical wrench to take [user.p_their()] soul. It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
// TODO Make them glow with the power of the M E D I C A L W R E N C H
|
||||
// during their ascension
|
||||
|
||||
// Stun stops them from wandering off
|
||||
user.Stun(100)
|
||||
user.Stun(100, ignore_canstun = TRUE)
|
||||
playsound(loc, 'sound/effects/pray.ogg', 50, 1, -1)
|
||||
|
||||
// Let the sound effect finish playing
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
. = step(A,get_dir(A,src.loc))
|
||||
density = 1
|
||||
|
||||
/obj/structure/proc/climb_structure(mob/user)
|
||||
/obj/structure/proc/climb_structure(mob/living/user)
|
||||
src.add_fingerprint(user)
|
||||
user.visible_message("<span class='warning'>[user] starts climbing onto [src].</span>", \
|
||||
"<span class='notice'>You start climbing onto [src]...</span>")
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
var/egged = 0
|
||||
|
||||
/obj/structure/closet/cardboard/relaymove(mob/user, direction)
|
||||
if(opened || move_delay || user.stat || user.stun || user.knockdown || user.unconscious || !isturf(loc) || !has_gravity(loc))
|
||||
if(opened || move_delay || user.stat || user.IsStun() || user.knockdown || user.unconscious || !isturf(loc) || !has_gravity(loc))
|
||||
return
|
||||
move_delay = 1
|
||||
if(step(src, direction))
|
||||
|
||||
@@ -142,17 +142,17 @@
|
||||
..()
|
||||
|
||||
|
||||
/obj/item/device/assembly/flash/proc/terrible_conversion_proc(mob/M, mob/user)
|
||||
if(ishuman(M) && ishuman(user) && M.stat != DEAD)
|
||||
/obj/item/device/assembly/flash/proc/terrible_conversion_proc(mob/living/carbon/human/H, mob/user)
|
||||
if(istype(H) && ishuman(user) && H.stat != DEAD)
|
||||
if(user.mind && (user.mind in SSticker.mode.head_revolutionaries))
|
||||
if(M.client)
|
||||
if(M.stat == CONSCIOUS)
|
||||
M.mind_initialize() //give them a mind datum if they don't have one.
|
||||
if(H.client)
|
||||
if(H.stat == CONSCIOUS)
|
||||
H.mind_initialize() //give them a mind datum if they don't have one.
|
||||
var/resisted
|
||||
if(!M.isloyal())
|
||||
if(!H.isloyal())
|
||||
if(user.mind in SSticker.mode.head_revolutionaries)
|
||||
if(SSticker.mode.add_revolutionary(M.mind))
|
||||
M.Stun(60)
|
||||
if(SSticker.mode.add_revolutionary(H.mind))
|
||||
H.Stun(60)
|
||||
times_used -- //Flashes less likely to burn out for headrevs when used for conversion
|
||||
else
|
||||
resisted = 1
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
density = 1
|
||||
anchored = 1
|
||||
|
||||
/obj/structure/stacklifter/attack_hand(mob/user as mob)
|
||||
/obj/structure/stacklifter/attack_hand(mob/living/user)
|
||||
if(in_use)
|
||||
to_chat(user, "It's already in use - wait a bit.")
|
||||
return
|
||||
@@ -58,7 +58,7 @@
|
||||
density = 1
|
||||
anchored = 1
|
||||
|
||||
/obj/structure/weightlifter/attack_hand(mob/user as mob)
|
||||
/obj/structure/weightlifter/attack_hand(mob/living/user)
|
||||
if(in_use)
|
||||
to_chat(user, "It's already in use - wait a bit.")
|
||||
return
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
|
||||
if(stat == DEAD)
|
||||
icon_state = "larva[state]_dead"
|
||||
else if (handcuffed || legcuffed) //This should be an overlay. Who made this an icon_state?
|
||||
else if(handcuffed || legcuffed) //This should be an overlay. Who made this an icon_state?
|
||||
icon_state = "larva[state]_cuff"
|
||||
else if(stat == UNCONSCIOUS || lying || resting)
|
||||
icon_state = "larva[state]_sleep"
|
||||
else if (stun)
|
||||
else if(IsStun())
|
||||
icon_state = "larva[state]_stun"
|
||||
else
|
||||
icon_state = "larva[state]"
|
||||
|
||||
@@ -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 || src.stun || src.restrained())
|
||||
return !(src.stat || src.knockdown || IsStun() || src.restrained())
|
||||
|
||||
/mob/living/carbon/human/can_inject(mob/user, error_msg, target_zone, var/penetrate_thick = 0)
|
||||
. = 1 // Default to returning true.
|
||||
|
||||
@@ -105,9 +105,7 @@
|
||||
|
||||
/mob/living/carbon/human/proc/check_block()
|
||||
if(mind)
|
||||
if(mind.martial_art && mind.martial_art.block_chance \
|
||||
&& prob(mind.martial_art.block_chance) && in_throw_mode \
|
||||
&& !stat && !knockdown && !stun)
|
||||
if(mind.martial_art && prob(mind.martial_art.block_chance) && in_throw_mode && !stat && !knockdown && !IsStun())
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
|
||||
@@ -452,7 +452,7 @@
|
||||
return 1
|
||||
if(unconscious)
|
||||
return 1
|
||||
if(stun)
|
||||
if(IsStun())
|
||||
return 1
|
||||
if(stat)
|
||||
return 1
|
||||
@@ -1536,8 +1536,8 @@
|
||||
if(ispath(A,/obj/item/ammo_casing/energy/electrode))
|
||||
stunning = 1
|
||||
var/shouldFire = 1
|
||||
var/mob/stunCheck = TARGET
|
||||
if(stunning && stunCheck.stun)
|
||||
var/mob/living/stunCheck = TARGET
|
||||
if(stunning && isliving(stunCheck) && stunCheck.IsStun())
|
||||
shouldFire = 0
|
||||
if(shouldFire)
|
||||
if(P.cell.charge <= 10) // can shoot seems to bug out for tasers, using this hacky method instead
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
return 0
|
||||
|
||||
/datum/species/angel/proc/CanFly(mob/living/carbon/human/H)
|
||||
if(H.stat || H.stun || H.knockdown)
|
||||
if(H.stat || H.IsStun() || H.knockdown)
|
||||
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!")
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
return 1
|
||||
if(unconscious)
|
||||
return 1
|
||||
if(stun)
|
||||
if(IsStun())
|
||||
return 1
|
||||
if(stat)
|
||||
return 1
|
||||
|
||||
@@ -61,7 +61,6 @@
|
||||
if(!gibbed)
|
||||
GLOB.dead_mob_list += src
|
||||
unconscious = 0
|
||||
stun = 0
|
||||
knockdown = 0
|
||||
set_drugginess(0)
|
||||
SetSleeping(0, 0)
|
||||
|
||||
@@ -97,10 +97,8 @@
|
||||
/mob/living/proc/handle_stomach()
|
||||
return
|
||||
|
||||
//this updates all special effects: stun, sleeping, knockdown, druggy, stuttering, etc..
|
||||
//this updates all special effects: knockdown, druggy, stuttering, etc..
|
||||
/mob/living/proc/handle_status_effects()
|
||||
if(stun)
|
||||
AdjustStun(-20, 1, 1)
|
||||
if(knockdown)
|
||||
AdjustKnockdown(-20, 1, 1)
|
||||
if(unconscious)
|
||||
|
||||
@@ -237,7 +237,7 @@
|
||||
death()
|
||||
|
||||
/mob/living/incapacitated(ignore_restraints, ignore_grab)
|
||||
if(stat || unconscious || stun || knockdown || (!ignore_restraints && restrained(ignore_grab)))
|
||||
if(stat || unconscious || IsStun() || knockdown || (!ignore_restraints && restrained(ignore_grab)))
|
||||
return 1
|
||||
|
||||
/mob/living/proc/InCritical()
|
||||
@@ -931,3 +931,42 @@
|
||||
|
||||
/mob/living/can_be_pulled()
|
||||
return ..() && !(buckled && buckled.buckle_prevents_pull)
|
||||
|
||||
//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/chokehold = pulledby && pulledby.grab_state >= GRAB_NECK
|
||||
var/buckle_lying = !(buckled && !buckled.buckle_lying)
|
||||
var/has_legs = get_num_legs()
|
||||
var/has_arms = get_num_arms()
|
||||
var/ignore_legs = get_leg_ignore()
|
||||
if(ko || resting || has_status_effect(STATUS_EFFECT_STUN) || chokehold)
|
||||
drop_all_held_items()
|
||||
unset_machine()
|
||||
if(pulling)
|
||||
stop_pulling()
|
||||
else if(has_legs || ignore_legs)
|
||||
lying = 0
|
||||
|
||||
if(buckled)
|
||||
lying = 90*buckle_lying
|
||||
else if(!lying)
|
||||
if(resting)
|
||||
fall()
|
||||
else if(ko || (!has_legs && !ignore_legs) || chokehold)
|
||||
fall(forced = 1)
|
||||
canmove = !(ko || resting || has_status_effect(STATUS_EFFECT_STUN) || has_status_effect(/datum/status_effect/freon) || chokehold || buckled || (!has_legs && !ignore_legs && !has_arms))
|
||||
density = !lying
|
||||
if(lying)
|
||||
if(layer == initial(layer)) //to avoid special cases like hiding larvas.
|
||||
layer = LYING_MOB_LAYER //so mob lying always appear behind standing mobs
|
||||
else
|
||||
if(layer == LYING_MOB_LAYER)
|
||||
layer = initial(layer)
|
||||
update_transform()
|
||||
if(!lying && lying_prev)
|
||||
if(client)
|
||||
client.move_delay = world.time + movement_delay()
|
||||
lying_prev = lying
|
||||
return canmove
|
||||
|
||||
@@ -591,7 +591,7 @@
|
||||
/mob/living/silicon/robot/update_icons()
|
||||
cut_overlays()
|
||||
icon_state = module.cyborg_base_icon
|
||||
if(stat != DEAD && !(unconscious || stun || knockdown || low_power_mode)) //Not dead, not stunned.
|
||||
if(stat != DEAD && !(unconscious || IsStun() || knockdown || 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 || stun || knockdown || getOxyLoss() > maxHealth*0.5)
|
||||
if(unconscious || IsStun() || knockdown || getOxyLoss() > maxHealth*0.5)
|
||||
if(stat == CONSCIOUS)
|
||||
stat = UNCONSCIOUS
|
||||
blind_eyes(1)
|
||||
|
||||
@@ -504,7 +504,7 @@ Auto Patrol[]"},
|
||||
return
|
||||
if(iscarbon(A))
|
||||
var/mob/living/carbon/C = A
|
||||
if(!C.stun || arrest_type)
|
||||
if(!C.IsStun() || arrest_type)
|
||||
stun_attack(A)
|
||||
else if(C.canBeHandcuffed() && !C.handcuffed)
|
||||
cuff(A)
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
maxHealth = 20
|
||||
pass_flags = PASSMOB
|
||||
|
||||
status_flags = (CANPUSH | CANSTUN)
|
||||
|
||||
radio_key = /obj/item/device/encryptionkey/headset_med
|
||||
radio_channel = "Medical"
|
||||
|
||||
@@ -77,6 +79,9 @@
|
||||
if(!on)
|
||||
icon_state = "medibot0"
|
||||
return
|
||||
if(IsStun())
|
||||
icon_state = "medibota"
|
||||
return
|
||||
if(mode == BOT_HEALING)
|
||||
icon_state = "medibots[stationary_mode]"
|
||||
return
|
||||
@@ -97,6 +102,10 @@
|
||||
prev_access = access_card.access
|
||||
qdel(J)
|
||||
|
||||
/mob/living/simple_animal/bot/medbot/update_canmove()
|
||||
. = ..()
|
||||
update_icon()
|
||||
|
||||
/mob/living/simple_animal/bot/medbot/bot_reset()
|
||||
..()
|
||||
patient = null
|
||||
@@ -265,17 +274,10 @@
|
||||
if(mode == BOT_HEALING)
|
||||
return
|
||||
|
||||
if(stun)
|
||||
icon_state = "medibota"
|
||||
stun--
|
||||
|
||||
if(IsStun())
|
||||
oldpatient = patient
|
||||
patient = null
|
||||
mode = BOT_IDLE
|
||||
|
||||
if(stun <= 0)
|
||||
update_icon()
|
||||
stun = 0
|
||||
return
|
||||
|
||||
if(frustration > 8)
|
||||
@@ -504,11 +506,6 @@
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/mob/living/simple_animal/bot/medbot/bullet_act(obj/item/projectile/Proj)
|
||||
if(Proj.flag == "taser")
|
||||
stun = min(stun+10,20)
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/bot/medbot/explode()
|
||||
on = 0
|
||||
visible_message("<span class='boldannounce'>[src] blows apart!</span>")
|
||||
|
||||
@@ -190,7 +190,7 @@ Auto Patrol: []"},
|
||||
return
|
||||
if(iscarbon(A))
|
||||
var/mob/living/carbon/C = A
|
||||
if(!C.stun || arrest_type)
|
||||
if(!C.IsStun() || arrest_type)
|
||||
stun_attack(A)
|
||||
else if(C.canBeHandcuffed() && !C.handcuffed)
|
||||
cuff(A)
|
||||
|
||||
@@ -387,7 +387,7 @@
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/update_canmove()
|
||||
if(unconscious || stun || knockdown || stat || resting)
|
||||
if(unconscious || IsStun() || knockdown || stat || resting)
|
||||
drop_all_held_items()
|
||||
canmove = 0
|
||||
else if(buckled)
|
||||
|
||||
@@ -369,9 +369,9 @@
|
||||
|
||||
if(pulling)
|
||||
pulling.pulledby = null
|
||||
if(ismob(pulling))
|
||||
var/mob/M = pulling
|
||||
M.update_canmove()// mob gets up if it was lyng down in a chokehold
|
||||
if(isliving(pulling))
|
||||
var/mob/living/L = pulling
|
||||
L.update_canmove()// mob gets up if it was lyng down in a chokehold
|
||||
pulling = null
|
||||
grab_state = 0
|
||||
update_pull_hud_icon()
|
||||
@@ -657,52 +657,6 @@
|
||||
return 0
|
||||
return 1
|
||||
|
||||
|
||||
//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/proc/update_canmove()
|
||||
var/ko = knockdown || unconscious || 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()
|
||||
var/has_arms = get_num_arms()
|
||||
var/ignore_legs = get_leg_ignore()
|
||||
if(ko || resting || stun || chokehold)
|
||||
drop_all_held_items()
|
||||
unset_machine()
|
||||
if(pulling)
|
||||
stop_pulling()
|
||||
else if(has_legs || ignore_legs)
|
||||
lying = 0
|
||||
|
||||
if(buckled)
|
||||
lying = 90*buckle_lying
|
||||
else if(!lying)
|
||||
if(resting)
|
||||
fall()
|
||||
else if(ko || (!has_legs && !ignore_legs) || chokehold)
|
||||
fall(forced = 1)
|
||||
canmove = !(ko || resting || stun || chokehold || buckled || (!has_legs && !ignore_legs && !has_arms))
|
||||
density = !lying
|
||||
if(lying)
|
||||
if(layer == initial(layer)) //to avoid special cases like hiding larvas.
|
||||
layer = LYING_MOB_LAYER //so mob lying always appear behind standing mobs
|
||||
else
|
||||
if(layer == LYING_MOB_LAYER)
|
||||
layer = initial(layer)
|
||||
update_transform()
|
||||
update_action_buttons_icon(status_only=TRUE)
|
||||
if(isliving(src))
|
||||
var/mob/living/L = src
|
||||
if(L.has_status_effect(/datum/status_effect/freon))
|
||||
canmove = 0
|
||||
if(!lying && lying_prev)
|
||||
if(client)
|
||||
client.move_delay = world.time + movement_delay()
|
||||
lying_prev = lying
|
||||
return canmove
|
||||
|
||||
|
||||
/mob/proc/fall(forced)
|
||||
drop_all_held_items()
|
||||
|
||||
|
||||
@@ -69,7 +69,6 @@
|
||||
|
||||
var/overeatduration = 0 // How long this guy is overeating //Carbon
|
||||
var/unconscious = 0
|
||||
var/stun = 0
|
||||
var/knockdown = 0
|
||||
var/losebreath = 0//Carbon
|
||||
var/a_intent = INTENT_HELP//Living
|
||||
|
||||
@@ -7,50 +7,88 @@
|
||||
|
||||
/////////////////////////////////// STUN ////////////////////////////////////
|
||||
|
||||
/mob/proc/Stun(amount, updating = 1, ignore_canstun = 0)
|
||||
if(status_flags & CANSTUN || ignore_canstun)
|
||||
stun = max(max(stun,amount * STUN_TIME_MULTIPLIER),0) //can't go below 0, getting a low amount of stun doesn't lower your current stun
|
||||
if(updating)
|
||||
update_canmove()
|
||||
return TRUE
|
||||
/mob/proc/IsStun() //non-living mobs shouldn't be stunned
|
||||
return FALSE
|
||||
|
||||
/mob/proc/SetStun(amount, updating = 1, ignore_canstun = 0) //if you REALLY need to set stun to a set amount without the whole "can't go below current stun"
|
||||
if(status_flags & CANSTUN || ignore_canstun)
|
||||
stun = max(amount * STUN_TIME_MULTIPLIER,0)
|
||||
if(updating)
|
||||
update_canmove()
|
||||
return TRUE
|
||||
/mob/living/IsStun() //If we're stunned
|
||||
return has_status_effect(STATUS_EFFECT_STUN)
|
||||
|
||||
/mob/proc/AdjustStun(amount, updating = 1, ignore_canstun = 0)
|
||||
if(status_flags & CANSTUN || ignore_canstun)
|
||||
stun = max(stun + (amount * STUN_TIME_MULTIPLIER),0)
|
||||
if(updating)
|
||||
update_canmove()
|
||||
return TRUE
|
||||
/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 = 1, ignore_canknockdown = 0)
|
||||
/mob/proc/Knockdown(amount, updating = TRUE, ignore_canknockdown = FALSE)
|
||||
if((status_flags & CANKNOCKDOWN) || ignore_canknockdown)
|
||||
knockdown = max(max(knockdown,amount * STUN_TIME_MULTIPLIER),0)
|
||||
if(updating)
|
||||
update_canmove() //updates lying, canmove and icons
|
||||
return TRUE
|
||||
|
||||
/mob/proc/SetKnockdown(amount, updating = 1, ignore_canknockdown = 0)
|
||||
/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)
|
||||
if(updating)
|
||||
update_canmove() //updates lying, canmove and icons
|
||||
return TRUE
|
||||
|
||||
/mob/proc/AdjustKnockdown(amount, updating = 1, ignore_canknockdown = 0)
|
||||
/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)
|
||||
if(updating)
|
||||
update_canmove() //updates lying, canmove and icons
|
||||
return TRUE
|
||||
|
||||
/mob/living/AdjustKnockdown(amount, updating = TRUE, ignore_canknockdown = FALSE)
|
||||
. = ..()
|
||||
if(. && updating)
|
||||
update_canmove() //updates lying, canmove and icons
|
||||
|
||||
/////////////////////////////////// UNCONSCIOUS ////////////////////////////////////
|
||||
|
||||
/mob/proc/Unconscious(amount, updating = TRUE, ignore_canunconscious = FALSE)
|
||||
@@ -88,7 +126,7 @@
|
||||
/mob/living/proc/AmountSleeping() //How many deciseconds remain in our sleep
|
||||
var/datum/status_effect/incapacitating/sleeping/S = IsSleeping()
|
||||
if(S)
|
||||
return world.time - S.duration
|
||||
return S.duration - world.time
|
||||
return 0
|
||||
|
||||
/mob/living/proc/Sleeping(amount, updating = TRUE) //Can't go below remaining duration
|
||||
@@ -108,9 +146,10 @@
|
||||
if(S)
|
||||
S.update_canmove = updating
|
||||
qdel(S)
|
||||
else if(S)
|
||||
S.duration = world.time + amount
|
||||
else
|
||||
S = apply_status_effect(STATUS_EFFECT_SLEEPING)
|
||||
if(S)
|
||||
S.duration = amount
|
||||
S.update_canmove = updating
|
||||
return S
|
||||
@@ -129,14 +168,23 @@
|
||||
|
||||
/mob/proc/Resting(amount)
|
||||
resting = max(max(resting,amount),0)
|
||||
|
||||
/mob/living/Resting(amount)
|
||||
..()
|
||||
update_canmove()
|
||||
|
||||
/mob/proc/SetResting(amount)
|
||||
resting = max(amount,0)
|
||||
|
||||
/mob/living/SetResting(amount)
|
||||
..()
|
||||
update_canmove()
|
||||
|
||||
/mob/proc/AdjustResting(amount)
|
||||
resting = max(resting + amount,0)
|
||||
|
||||
/mob/living/AdjustResting(amount)
|
||||
..()
|
||||
update_canmove()
|
||||
|
||||
/////////////////////////////////// JITTERINESS ////////////////////////////////////
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
//Make mob invisible and spawn animation
|
||||
notransform = 1
|
||||
canmove = 0
|
||||
stun = 1
|
||||
Stun(22, ignore_canstun = TRUE)
|
||||
icon = null
|
||||
cut_overlays()
|
||||
invisibility = INVISIBILITY_MAXIMUM
|
||||
@@ -182,7 +182,7 @@
|
||||
//Make mob invisible and spawn animation
|
||||
notransform = 1
|
||||
canmove = 0
|
||||
stun = 1
|
||||
Stun(22, ignore_canstun = TRUE)
|
||||
icon = null
|
||||
cut_overlays()
|
||||
invisibility = INVISIBILITY_MAXIMUM
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
internalPaper = null
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/paperplane/suicide_act(mob/user)
|
||||
/obj/item/weapon/paperplane/suicide_act(mob/living/user)
|
||||
user.Stun(200)
|
||||
user.visible_message("<span class='suicide'>[user] jams the [src] in [user.p_their()] nose. It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
user.adjust_blurriness(6)
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
if(crit_fail)
|
||||
return
|
||||
|
||||
if(owner.stun > STUN_CHECK_AMOUNT)
|
||||
if(owner.AmountStun() > STUN_SET_AMOUNT)
|
||||
owner.SetStun(STUN_SET_AMOUNT)
|
||||
if(owner.knockdown > STUN_CHECK_AMOUNT)
|
||||
owner.SetKnockdown(STUN_SET_AMOUNT)
|
||||
|
||||
Reference in New Issue
Block a user