Merge pull request #10451 from kevinz000/mobility_flags

Mobility flags + combat rework stuff refactoring, fixes a few edge cases including the Oh Dreaded Xenomorph Hardstuns, etc etc time to break the game
This commit is contained in:
deathride58
2020-03-05 20:03:56 -05:00
committed by GitHub
290 changed files with 2244 additions and 1819 deletions

View File

@@ -47,6 +47,10 @@
#define COMSIG_PARENT_PREQDELETED "parent_preqdeleted" //before a datum's Destroy() is called: (force), returning a nonzero value will cancel the qdel operation
#define COMSIG_PARENT_QDELETING "parent_qdeleting" //just before a datum's Destroy() is called: (force), at this point none of the other components chose to interrupt qdel and Destroy will be called
/// Trait signals
#define COMPONENT_ADD_TRAIT (1<<0)
#define COMPONENT_REMOVE_TRAIT (1<<1)
// /atom signals
#define COMSIG_PARENT_ATTACKBY "atom_attackby" //from base of atom/attackby(): (/obj/item, /mob/living, params)
#define COMPONENT_NO_AFTERATTACK 1 //Return this in response if you don't want afterattack to be called
@@ -208,6 +212,16 @@
#define COMSIG_MOB_CLIENT_LOGIN "comsig_mob_client_login" //sent when a mob/login() finishes: (client)
#define COMSIG_LIVING_GUN_PROCESS_FIRE "living_gun_process_fire" //from base of /obj/item/gun/proc/process_fire(): (atom/target, params, zone_override)
//ALL OF THESE DO NOT TAKE INTO ACCOUNT WHETHER AMOUNT IS 0 OR LOWER AND ARE SENT REGARDLESS!
#define COMSIG_LIVING_STATUS_STUN "living_stun" //from base of mob/living/Stun() (amount, update, ignore)
#define COMSIG_LIVING_STATUS_KNOCKDOWN "living_knockdown" //from base of mob/living/Knockdown() (amount, update, ignore)
#define COMSIG_LIVING_STATUS_PARALYZE "living_paralyze" //from base of mob/living/Paralyze() (amount, update, ignore)
#define COMSIG_LIVING_STATUS_IMMOBILIZE "living_immobilize" //from base of mob/living/Immobilize() (amount, update, ignore)
#define COMSIG_LIVING_STATUS_UNCONSCIOUS "living_unconscious" //from base of mob/living/Unconscious() (amount, update, ignore)
#define COMSIG_LIVING_STATUS_SLEEP "living_sleeping" //from base of mob/living/Sleeping() (amount, update, ignore)
#define COMSIG_LIVING_STATUS_DAZE "living_daze" //from base of mob/living/Daze() (amount, update, ignore)
#define COMPONENT_NO_STUN 1 //For all of them
// /mob/living/carbon signals
#define COMSIG_CARBON_SOUNDBANG "carbon_soundbang" //from base of mob/living/carbon/soundbang_act(): (list(intensity))

View File

@@ -92,3 +92,30 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
// radiation
#define RAD_PROTECT_CONTENTS (1<<0)
#define RAD_NO_CONTAMINATE (1<<1)
//Mob mobility var flags
/// any flag
#define CHECK_MOBILITY(target, flags) CHECK_BITFIELD(target.mobility_flags, flags)
#define CHECK_ALL_MOBILITY(target, flags) CHECK_MULTIPLE_BITFIELDS(target.mobility_flags, flags)
/// can move
#define MOBILITY_MOVE (1<<0)
/// can, and is, standing up.
#define MOBILITY_STAND (1<<1)
/// can pickup items
#define MOBILITY_PICKUP (1<<2)
/// can use items and interact with world objects like opening closets/etc
#define MOBILITY_USE (1<<3)
/// can use interfaces like consoles
#define MOBILITY_UI (1<<4)
/// can use storage item
#define MOBILITY_STORAGE (1<<5)
/// can pull things
#define MOBILITY_PULL (1<<6)
/// can hold non-nodropped items voluntarily
#define MOBILITY_HOLD (1<<7)
/// Can resist out of buckling, grabs, cuffs, etc, in the usual order (buckle --> cuffs --> grab)
#define MOBILITY_RESIST (1<<8)
#define MOBILITY_FLAGS_DEFAULT (MOBILITY_MOVE | MOBILITY_STAND | MOBILITY_PICKUP | MOBILITY_USE | MOBILITY_UI | MOBILITY_STORAGE | MOBILITY_PULL | MOBILITY_RESIST)
#define MOBILITY_FLAGS_ANY_INTERACTION (MOBILITY_USE | MOBILITY_PICKUP | MOBILITY_UI | MOBILITY_STORAGE)

View File

@@ -37,10 +37,17 @@
/////////////
// DEBUFFS //
/////////////
/// The affected is unable to move, or to use, hold, or pickup items.
#define STATUS_EFFECT_STUN /datum/status_effect/incapacitating/stun
#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 unable to stand up
#define STATUS_EFFECT_KNOCKDOWN /datum/status_effect/incapacitating/knockdown //the affected is knocked down
#define STATUS_EFFECT_IMMOBILIZED /datum/status_effect/incapacitating/immobilized //the affected is unable to move
#define STATUS_EFFECT_PARALYZED /datum/status_effect/incapacitating/paralyzed //the affected is unable to move, use items, or stand up.
/// The affected is unable to use or pickup items
#define STATUS_EFFECT_DAZED /datum/status_effect/incapacitating/dazed
#define STATUS_EFFECT_UNCONSCIOUS /datum/status_effect/incapacitating/unconscious //the affected is unconscious

View File

@@ -1,3 +1,5 @@
#define SIGNAL_TRAIT(trait_ref) "trait [trait_ref]"
// trait accessor defines
#define ADD_TRAIT(target, trait, source) \
do { \
@@ -6,12 +8,14 @@
target.status_traits = list(); \
_L = target.status_traits; \
_L[trait] = list(source); \
SEND_SIGNAL(target, SIGNAL_TRAIT(trait), COMPONENT_ADD_TRAIT); \
} else { \
_L = target.status_traits; \
if (_L[trait]) { \
_L[trait] |= list(source); \
} else { \
_L[trait] = list(source); \
SEND_SIGNAL(target, SIGNAL_TRAIT(trait), COMPONENT_ADD_TRAIT); \
} \
} \
} while (0)
@@ -31,7 +35,8 @@
} \
};\
if (!length(_L[trait])) { \
_L -= trait \
_L -= trait; \
SEND_SIGNAL(target, SIGNAL_TRAIT(trait), COMPONENT_REMOVE_TRAIT); \
}; \
if (!length(_L)) { \
target.status_traits = null \
@@ -46,7 +51,8 @@
for (var/_T in _L) { \
_L[_T] &= _S;\
if (!length(_L[_T])) { \
_L -= _T } \
_L -= _T ; \
SEND_SIGNAL(target, SIGNAL_TRAIT(_T), COMPONENT_REMOVE_TRAIT); } \
};\
if (!length(_L)) { \
target.status_traits = null\
@@ -137,6 +143,19 @@
#define TRAIT_NOMARROW "nomarrow" // You don't make blood, with chemicals or nanites.
#define TRAIT_NOPULSE "nopulse" // Your heart doesn't beat.
#define TRAIT_EXEMPT_HEALTH_EVENTS "exempt-health-events"
// mobility flag traits
// IN THE FUTURE, IT WOULD BE NICE TO DO SOMETHING SIMILAR TO https://github.com/tgstation/tgstation/pull/48923/files (ofcourse not nearly the same because I have my.. thoughts on it)
// BUT FOR NOW, THESE ARE HOOKED TO DO update_mobility() VIA COMSIG IN living_mobility.dm
// SO IF YOU ADD MORE, BESURE TO UPDATE IT THERE.
/// Disallow movement
#define TRAIT_MOBILITY_NOMOVE "mobility_nomove"
/// Disallow pickup
#define TRAIT_MOBILITY_NOPICKUP "mobility_nopickup"
/// Disallow item use
#define TRAIT_MOBILITY_NOUSE "mobility_nouse"
#define TRAIT_SWIMMING "swimming" //only applied by /datum/element/swimming, for checking
//non-mob traits

View File

@@ -356,7 +356,7 @@ GLOBAL_LIST_EMPTY(species_list)
checked_health["health"] = health
return ..()
/proc/do_after(mob/user, var/delay, needhand = 1, atom/target = null, progress = 1, datum/callback/extra_checks = null)
/proc/do_after(mob/user, var/delay, needhand = 1, atom/target = null, progress = 1, datum/callback/extra_checks = null, required_mobility_flags = (MOBILITY_USE|MOBILITY_MOVE))
if(!user)
return 0
var/atom/Tloc = null
@@ -384,6 +384,7 @@ GLOBAL_LIST_EMPTY(species_list)
var/endtime = world.time + delay
var/starttime = world.time
. = 1
var/mob/living/L = isliving(user) && user //evals to last thing eval'd
while (world.time < endtime)
stoplag(1)
if (progress)
@@ -393,15 +394,13 @@ GLOBAL_LIST_EMPTY(species_list)
drifting = 0
Uloc = user.loc
if(QDELETED(user) || user.stat || user.IsKnockdown() || user.IsStun() || (!drifting && user.loc != Uloc) || (extra_checks && !extra_checks.Invoke()))
if(L && !CHECK_ALL_MOBILITY(L, required_mobility_flags))
. = 0
break
if(isliving(user))
var/mob/living/L = user
if(L.recoveringstam)
. = 0
break
if(QDELETED(user) || user.stat || (!drifting && user.loc != Uloc) || (extra_checks && !extra_checks.Invoke()))
. = 0
break
if(!QDELETED(Tloc) && (QDELETED(target) || Tloc != target.loc))
if((Uloc != Tloc || Tloc != user) && !drifting)

View File

@@ -214,7 +214,7 @@ GLOBAL_LIST_INIT(bitfields, list(
"CAN_MASTURBATE_WITH" = CAN_MASTURBATE_WITH,
"MASTURBATE_LINKED_ORGAN" = MASTURBATE_LINKED_ORGAN,
"CAN_CLIMAX_WITH" = CAN_CLIMAX_WITH
),
"mob_biotypes" = list (
"MOB_ORGANIC" = MOB_ORGANIC,
@@ -227,5 +227,16 @@ GLOBAL_LIST_INIT(bitfields, list(
"MOB_EPIC" = MOB_EPIC,
"MOB_REPTILE" = MOB_REPTILE,
"MOB_SPIRIT" = MOB_SPIRIT
),
"mobility_flags" = list(
"MOBILITY_MOVE" = MOBILITY_MOVE,
"MOBILITY_STAND" = MOBILITY_STAND,
"MOBILITY_PICKUP" = MOBILITY_PICKUP,
"MOBILITY_USE" = MOBILITY_USE,
"MOBILITY_UI" = MOBILITY_UI,
"MOBILITY_STORAGE" = MOBILITY_STORAGE,
"MOBILITY_PULL" = MOBILITY_PULL,
"MOBILITY_HOLD" = MOBILITY_HOLD,
"MOBILITY_RESIST" = MOBILITY_RESIST
)
))

View File

@@ -14,7 +14,7 @@
if(check_click_intercept(params,A))
return
if(stat || lockcharge || IsKnockdown() || IsStun() || IsUnconscious())
if(stat || locked_down || IsParalyzed() || IsStun() || IsUnconscious())
return
var/list/modifiers = params2list(params)
@@ -66,7 +66,7 @@
if(C.user_unbuckle_mob(C.buckled_mobs[1],src))
return
if(!W && get_dist(src,A) <= interaction_range)
if(!W && (get_dist(src,A) <= interaction_range))
A.attack_robot(src)
return

View File

@@ -273,7 +273,7 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
if(!istype(L) || !L.can_resist())
return
L.changeNext_move(CLICK_CD_RESIST)
if(L.canmove)
if(CHECK_MOBILITY(L, MOBILITY_MOVE))
return L.resist_fire() //I just want to start a flame in your hearrrrrrtttttt.
@@ -601,7 +601,7 @@ so as to remain in compliance with the most up-to-date laws."
if(!istype(L) || !L.can_resist())
return
L.changeNext_move(CLICK_CD_RESIST)
if((L.canmove) && (L.last_special <= world.time))
if(CHECK_MOBILITY(L, MOBILITY_MOVE) && (L.last_special <= world.time))
return L.resist_restraints()
/obj/screen/alert/restrained/buckled/Click()

View File

@@ -113,7 +113,7 @@
var/mob/living/carbon/tempcarb = user
if(!tempcarb.combatmode)
totitemdamage *= 0.5
if(user.resting)
if(!CHECK_MOBILITY(user, MOBILITY_STAND))
totitemdamage *= 0.5
//CIT CHANGES END HERE
if(user != src && check_shields(I, totitemdamage, "the [I.name]", MELEE_ATTACK, I.armour_penetration))

View File

@@ -8,6 +8,7 @@
var/desc = null
var/obj/target = null
var/check_flags = 0
var/required_mobility_flags = MOBILITY_USE
var/processing = FALSE
var/obj/screen/movable/action_button/button = null
var/buttontooltipstyle = ""
@@ -96,20 +97,23 @@
/datum/action/proc/IsAvailable()
if(!owner)
return 0
return FALSE
var/mob/living/L = owner
if(istype(L) && !CHECK_ALL_MOBILITY(L, required_mobility_flags))
return FALSE
if(check_flags & AB_CHECK_RESTRAINED)
if(owner.restrained())
return 0
return FALSE
if(check_flags & AB_CHECK_STUN)
if(owner.IsKnockdown() || owner.IsStun())
return 0
if(istype(L) && !CHECK_MOBILITY(L, MOBILITY_USE))
return FALSE
if(check_flags & AB_CHECK_LYING)
if(owner.lying)
return 0
if(istype(L) && !CHECK_MOBILITY(L, MOBILITY_STAND))
return FALSE
if(check_flags & AB_CHECK_CONSCIOUS)
if(owner.stat)
return 0
return 1
return FALSE
return TRUE
/datum/action/proc/UpdateButtonIcon(status_only = FALSE, force = FALSE)
if(button)
@@ -430,7 +434,8 @@
name = "Shift Nerves"
/datum/action/item_action/explosive_implant
check_flags = 0
check_flags = NONE
required_mobility_flags = NONE
name = "Activate Explosive Implant"
/datum/action/item_action/toggle_research_scanner

View File

@@ -136,7 +136,7 @@
fall_chance += 2
if(prob(fall_chance) && !owner.lying && !owner.buckled)
to_chat(owner, "<span class='warning'>Your leg gives out!</span>")
owner.Knockdown(35)
owner.DefaultCombatKnockdown(35)
else if(owner.get_active_held_item())
var/drop_chance = 1

View File

@@ -13,7 +13,7 @@
/datum/brain_trauma/special/godwoken/on_life()
..()
if(prob(4))
if(prob(33) && (owner.IsStun() || owner.IsKnockdown() || owner.IsUnconscious()))
if(prob(33) && owner.HighestImmobilityAmount())
speak("unstun", TRUE)
else if(prob(60) && owner.health <= owner.crit_threshold)
speak("heal", TRUE)

View File

@@ -59,4 +59,4 @@
"<span class='userdanger'>You slide on [A]!</span>")
cooldown = world.time
H.Knockdown(60)
H.DefaultCombatKnockdown(60)

View File

@@ -100,7 +100,7 @@
AM.forceMove(T)
if(isliving(AM))
var/mob/living/L = AM
L.Knockdown(100)
L.DefaultCombatKnockdown(100)
L.adjustBruteLoss(30)
falling_atoms -= AM
@@ -110,8 +110,7 @@
if (isliving(AM))
var/mob/living/L = AM
L.notransform = TRUE
L.Stun(200)
L.resting = TRUE
L.Paralyze(200)
var/oldtransform = AM.transform
var/oldcolor = AM.color

View File

@@ -18,7 +18,7 @@
var/mob/living/LM = parent
var/v = volume
var/e = e_range
if(!T.footstep || LM.buckled || LM.lying || !LM.canmove || LM.resting || LM.buckled || LM.throwing || LM.movement_type & (VENTCRAWLING | FLYING))
if(!T.footstep || LM.buckled || !CHECK_MOBILITY(LM, MOBILITY_STAND) || LM.buckled || LM.throwing || (LM.movement_type & (VENTCRAWLING | FLYING)))
if (LM.lying && !LM.buckled && !(!T.footstep || LM.movement_type & (VENTCRAWLING | FLYING))) //play crawling sound if we're lying
playsound(T, 'sound/effects/footstep/crawl1.ogg', 15 * v)
return

View File

@@ -54,7 +54,7 @@
msg += " and knocks [target] [target_buckled? "off of [target.buckled]" : "down"]"
if(target_buckled)
target.buckled.unbuckle_mob(target)
target.Knockdown(knockdown_time)
target.DefaultCombatKnockdown(knockdown_time)
if(length(msg))
user.visible_message("<span class='danger'>[msg]!</span>")

View File

@@ -240,7 +240,7 @@
/datum/component/riding/human/force_dismount(mob/living/user)
var/atom/movable/AM = parent
AM.unbuckle_mob(user)
user.Knockdown(60)
user.DefaultCombatKnockdown(60)
user.visible_message("<span class='warning'>[AM] pushes [user] off of [AM.p_them()]!</span>")
/datum/component/riding/cyborg
@@ -298,7 +298,7 @@
M.Move(targetm)
M.visible_message("<span class='warning'>[M] is thrown clear of [AM]!</span>")
M.throw_at(target, 14, 5, AM)
M.Knockdown(60)
M.DefaultCombatKnockdown(60)
/datum/component/riding/proc/equip_buckle_inhands(mob/living/carbon/human/user, amount_required = 1, mob/living/riding_target_override)
var/list/equipped

View File

@@ -22,7 +22,7 @@
return //undeads are unaffected by the spook-pocalypse.
if(istype(H.dna.species, /datum/species/zombie))
H.adjustStaminaLoss(25)
H.Knockdown(15) //zombies can't resist the doot
H.DefaultCombatKnockdown(15) //zombies can't resist the doot
C.Jitter(35)
C.stuttering = 20
if((!istype(H.dna.species, /datum/species/skeleton)) && (!istype(H.dna.species, /datum/species/golem)) && (!istype(H.dna.species, /datum/species/android)) && (!istype(H.dna.species, /datum/species/jelly)))
@@ -36,7 +36,7 @@
/datum/component/spooky/proc/spectral_change(mob/living/carbon/human/H, mob/user)
if((H.getStaminaLoss() > 95) && (!istype(H.dna.species, /datum/species/skeleton)) && (!istype(H.dna.species, /datum/species/golem)) && (!istype(H.dna.species, /datum/species/android)) && (!istype(H.dna.species, /datum/species/jelly)))
H.Knockdown(20)
H.DefaultCombatKnockdown(20)
H.set_species(/datum/species/skeleton)
H.visible_message("<span class='warning'>[H] has given up on life as a mortal.</span>")
var/T = get_turf(H)

View File

@@ -11,7 +11,7 @@
var/turf/loccheck = get_turf(A)
if(is_reebe(loccheck.z))
user.visible_message("<span class='warning'>An unseen force knocks [user] to the ground!</span>", "<span class='big_brass'>\"I think not!\"</span>")
user.Knockdown(60)
user.DefaultCombatKnockdown(60)
return
if(istype(loccheck.loc, /area/fabric_of_reality))
to_chat(user, "<span class='danger'>You can't do that here!</span>")
@@ -25,7 +25,7 @@
for(var/mob/living/M in T)
if(M.movement_type & FLYING)
M.visible_message("<span class='danger'>The bluespace collapse crushes the air towards it, pulling [M] towards the ground...</span>")
M.Knockdown(5, TRUE, TRUE) //Overrides stun absorbs.
M.DefaultCombatKnockdown(5, TRUE, TRUE) //Overrides stun absorbs.
T.TerraformTurf(/turf/open/chasm/magic, /turf/open/chasm/magic)
for (var/obj/structure/ladder/unbreakable/binary/ladder in GLOB.ladders)
ladder.ActivateAlmonds()

View File

@@ -279,7 +279,7 @@
M.emote("deathgasp")
M.fakedeath("regenerative_coma")
M.update_stat()
M.update_canmove()
M.update_mobility()
addtimer(CALLBACK(src, .proc/uncoma, M), 300)
/datum/symptom/heal/coma/proc/uncoma(mob/living/M)
@@ -288,7 +288,7 @@
active_coma = FALSE
M.cure_fakedeath("regenerative_coma")
M.update_stat()
M.update_canmove()
M.update_mobility()
/datum/symptom/heal/coma/Heal(mob/living/carbon/M, datum/disease/advance/A, actual_power)
var/heal_amt = 4 * actual_power

View File

@@ -44,7 +44,7 @@
if(prob(25))
affected_mob.vomit(95)
H.emote("cough")
H.Knockdown(40)
H.DefaultCombatKnockdown(40)
H.losebreath += 4
if(prob(3))
to_chat(H, "<span class='danger'>You feel very weak and dizzy...</span>")

View File

@@ -118,7 +118,8 @@
if(DEAD)
to_chat(user, "<span class='notice'>You cannot [key] while dead.</span>")
return FALSE
if(restraint_check && (user.IsStun() || user.IsKnockdown()))
var/mob/living/L = user
if(restraint_check && (istype(L) && !CHECK_MOBILITY(L, MOBILITY_USE)))
if(!intentional)
return FALSE
to_chat(user, "<span class='notice'>You cannot [key] while stunned.</span>")

View File

@@ -42,19 +42,19 @@
/datum/martial_art/cqc/proc/Slam(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(!can_use(A))
return FALSE
if(!D.stat || !D.IsKnockdown())
if(CHECK_MOBILITY(D, MOBILITY_STAND))
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)
D.apply_damage(10, BRUTE)
D.Knockdown(120)
D.DefaultCombatKnockdown(120)
log_combat(A, D, "slammed (CQC)")
return TRUE
/datum/martial_art/cqc/proc/Kick(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(!can_use(A))
return FALSE
if(!D.stat || !D.IsKnockdown())
if(CHECK_MOBILITY(D, MOBILITY_STAND))
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)
@@ -62,7 +62,7 @@
D.throw_at(throw_target, 1, 14, A)
D.apply_damage(10, BRUTE)
log_combat(A, D, "kicked (CQC)")
if(D.IsKnockdown() && !D.stat)
if(!CHECK_MOBILITY(D, MOBILITY_STAND) && CHECK_MOBILITY(D, MOBILITY_USE))
log_combat(A, D, "knocked out (Head kick)(CQC)")
D.visible_message("<span class='warning'>[A] kicks [D]'s head, knocking [D.p_them()] out!</span>", \
"<span class='userdanger'>[A] kicks your head, knocking you out!</span>")
@@ -136,7 +136,7 @@
A.do_attack_animation(D)
var/picked_hit_type = pick("CQC'd", "Big Bossed")
var/bonus_damage = 13
if(D.IsKnockdown() || D.resting || D.lying)
if(!CHECK_MOBILITY(D, MOBILITY_STAND))
bonus_damage += 5
picked_hit_type = "stomps on"
D.apply_damage(bonus_damage, BRUTE)
@@ -147,12 +147,12 @@
D.visible_message("<span class='danger'>[A] [picked_hit_type] [D]!</span>", \
"<span class='userdanger'>[A] [picked_hit_type] you!</span>")
log_combat(A, D, "[picked_hit_type] (CQC)")
if(A.resting && !D.stat && !D.IsKnockdown())
if(!CHECK_MOBILITY(A, MOBILITY_STAND) && !D.stat && CHECK_MOBILITY(D, MOBILITY_STAND))
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)
D.apply_damage(10, BRUTE)
D.Knockdown(60)
D.DefaultCombatKnockdown(60)
log_combat(A, D, "sweeped (CQC)")
return TRUE
@@ -164,7 +164,7 @@
if(check_streak(A,D))
return TRUE
if(prob(65))
if(!D.stat || !D.IsKnockdown() || !restraining)
if(CHECK_MOBILITY(D, MOBILITY_MOVE) || !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

@@ -96,13 +96,13 @@
return 0
/datum/martial_art/krav_maga/proc/leg_sweep(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(D.lying || D.IsKnockdown())
if(!CHECK_MOBILITY(D, MOBILITY_STAND))
return 0
D.visible_message("<span class='warning'>[A] leg sweeps [D]!</span>", \
"<span class='userdanger'>[A] leg sweeps you!</span>")
playsound(get_turf(A), 'sound/effects/hit_kick.ogg', 50, 1, -1)
D.apply_damage(5, BRUTE)
D.Knockdown(40, override_hardstun = 0.01, override_stamdmg = 25)
D.DefaultCombatKnockdown(40, override_hardstun = 0.01, override_stamdmg = 25)
log_combat(A, D, "leg sweeped")
return 1
@@ -138,7 +138,7 @@
log_combat(A, D, "punched")
var/picked_hit_type = pick("punches", "kicks")
var/bonus_damage = 10
if(D.IsKnockdown() || D.resting || D.lying)
if(CHECK_MOBILITY(D, MOBILITY_STAND))
bonus_damage += 5
picked_hit_type = "stomps on"
D.apply_damage(bonus_damage, BRUTE)

View File

@@ -16,7 +16,7 @@
playsound(D, 'sound/effects/meteorimpact.ogg', 25, 1, -1)
var/throwtarget = get_edge_target_turf(A, get_dir(A, get_step_away(D, A)))
D.throw_at(throwtarget, 4, 2, A)//So stuff gets tossed around at the same time.
D.Knockdown(20)
D.DefaultCombatKnockdown(20)
if(atk_verb)
log_combat(A, D, "[atk_verb] (Mushroom Punch)")
return TRUE

View File

@@ -49,7 +49,7 @@
if(!istype(D.head,/obj/item/clothing/head/helmet/) && !istype(D.head,/obj/item/clothing/head/hardhat))
D.adjustOrganLoss(ORGAN_SLOT_BRAIN, 5)
A.Stun(rand(10,45))
D.Knockdown(rand(5,30))//CIT CHANGE - makes stuns from martial arts always use Knockdown instead of Stun for the sake of consistency
D.DefaultCombatKnockdown(rand(5,30))//CIT CHANGE - makes stuns from martial arts always use Knockdown instead of Stun for the sake of consistency
if(5,6)
A.do_attack_animation(D, ATTACK_EFFECT_PUNCH)
atk_verb = pick("punches", "kicks", "hits", "slams into")
@@ -59,7 +59,7 @@
playsound(get_turf(D), 'sound/effects/meteorimpact.ogg', 25, 1, -1)
var/throwtarget = get_edge_target_turf(A, get_dir(A, get_step_away(D, A)))
D.throw_at(throwtarget, 4, 2, A)//So stuff gets tossed around at the same time.
D.Knockdown(60)
D.DefaultCombatKnockdown(60)
if(7,8)
basic_hit(A,D)

View File

@@ -79,7 +79,7 @@
return TRUE
/datum/martial_art/the_rising_bass/proc/sideKick(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(!D.IsKnockdown() || D.lying == 0)
if(CHECK_MOBILITY(D, MOBILITY_STAND))
var/dir = A.dir & (NORTH | SOUTH) ? pick(EAST, WEST) : pick(NORTH, SOUTH)
var/oppdir = dir == NORTH ? SOUTH : dir == SOUTH ? NORTH : dir == EAST ? WEST : EAST
var/turf/H = get_step(D, dir)
@@ -89,7 +89,7 @@
"<span class='userdanger'>[A] kicks you in the side, forcing you to step away!</span>")
playsound(get_turf(A), 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
D.apply_damage(5, BRUTE, BODY_ZONE_CHEST)
D.Knockdown(60)
D.DefaultCombatKnockdown(60)
var/L = !checkfordensity(H,D) ? (!checkfordensity(K,D) ? D.loc : K) : H
D.forceMove(L)
log_combat(A, D, "side kicked (Rising Bass)")
@@ -97,7 +97,7 @@
return basic_hit(A,D)
/datum/martial_art/the_rising_bass/proc/shoulderFlip(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(!D.IsKnockdown() || !D.lying)
if(CHECK_MOBILITY(D, MOBILITY_STAND))
var/turf/H = get_step(A, get_dir(D,A))
var/L = checkfordensity(H,D) ? H : A.loc
A.do_attack_animation(D, ATTACK_EFFECT_PUNCH)
@@ -108,14 +108,14 @@
D.apply_damage(10, BRUTE, BODY_ZONE_CHEST)
D.apply_damage(30, BRUTE, BODY_ZONE_HEAD)
D.Sleeping(60)
D.Knockdown(300)
D.DefaultCombatKnockdown(300)
D.forceMove(L)
log_combat(A, D, "shoulder flipped (Rising Bass)")
return TRUE
return basic_hit(A,D)
/datum/martial_art/the_rising_bass/proc/repulsePunch(mob/living/carbon/human/A, mob/living/carbon/human/D)
if((!D.IsKnockdown() || !D.lying) && repulsecool > world.time)
if(CHECK_MOBILITY(D, MOBILITY_STAND) && repulsecool < world.time)
A.do_attack_animation(D, ATTACK_EFFECT_PUNCH)
D.visible_message("<span class='warning'>[A] smashes [D] in the chest, throwing them away!</span>", \
"<span class='userdanger'>[A] smashes you in the chest, repelling you away!</span>")
@@ -123,14 +123,14 @@
var/atom/F = get_edge_target_turf(D, get_dir(A, get_step_away(D, A)))
D.throw_at(F, 10, 1)
D.apply_damage(10, BRUTE, BODY_ZONE_CHEST)
D.Knockdown(90)
D.DefaultCombatKnockdown(90)
log_combat(A, D, "repulse punched (Rising Bass)")
repulsecool = world.time + 3 SECONDS
return TRUE
return basic_hit(A,D)
/datum/martial_art/the_rising_bass/proc/footSmash(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(!D.IsKnockdown() || !D.lying)
if(CHECK_MOBILITY(D, MOBILITY_STAND))
A.do_attack_animation(D, ATTACK_EFFECT_KICK)
D.visible_message("<span class='warning'>[A] smashes their foot down on [D]'s foot!</span>", \
"<span class='userdanger'>[A] smashes your foot!</span>")
@@ -142,7 +142,7 @@
return basic_hit(A,D)
/datum/martial_art/the_rising_bass/proc/deftSwitch(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(!D.IsKnockdown() || !D.lying)
if(CHECK_MOBILITY(D, MOBILITY_STAND))
if (D.get_active_held_item())
var/obj/item/G = D.get_active_held_item()
if (G && !(G.item_flags & (ABSTRACT|DROPDEL)) && D.temporarilyRemoveItemFromInventory(G))
@@ -205,4 +205,4 @@
deftswitch.Remove(H)
sidekick.Remove(H)
REMOVE_TRAIT(H, TRAIT_NOGUNS, RISING_BASS_TRAIT)
REMOVE_TRAIT(H, TRAIT_AUTO_CATCH_ITEM, RISING_BASS_TRAIT)
REMOVE_TRAIT(H, TRAIT_AUTO_CATCH_ITEM, RISING_BASS_TRAIT)

View File

@@ -37,7 +37,7 @@
return FALSE
/datum/martial_art/the_sleeping_carp/proc/wristWrench(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(!D.stat && !D.IsStun() && !D.IsKnockdown())
if(CHECK_MOBILITY(D, MOBILITY_USE))
log_combat(A, D, "wrist wrenched (Sleeping Carp)")
A.do_attack_animation(D, ATTACK_EFFECT_PUNCH)
D.visible_message("<span class='warning'>[A] grabs [D]'s wrist and wrenches it sideways!</span>", \
@@ -46,19 +46,19 @@
D.emote("scream")
D.dropItemToGround(D.get_active_held_item())
D.apply_damage(5, BRUTE, pick(BODY_ZONE_L_ARM, BODY_ZONE_R_ARM))
D.Knockdown(60)//CIT CHANGE - makes sleepingcarp use knockdown() for its stuns instead of stun()
D.DefaultCombatKnockdown(60)//CIT CHANGE - makes sleepingcarp use knockdown() for its stuns instead of stun()
return TRUE
return basic_hit(A,D)
/datum/martial_art/the_sleeping_carp/proc/backKick(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(!D.stat && !D.IsKnockdown())
if(CHECK_MOBILITY(D, MOBILITY_STAND))
if(A.dir == D.dir)
log_combat(A, D, "back-kicked (Sleeping Carp)")
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>")
step_to(D,get_step(D,D.dir),1)
D.Knockdown(80)
D.DefaultCombatKnockdown(80)
playsound(get_turf(D), 'sound/weapons/punch1.ogg', 50, 1, -1)
return TRUE
else
@@ -68,20 +68,20 @@
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.IsKnockdown())
if(CHECK_MOBILITY(D, MOBILITY_STAND))
log_combat(A, D, "stomach kneed (Sleeping Carp)")
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>")
D.audible_message("<b>[D]</b> gags!")
D.losebreath += 3
D.Knockdown(40)//CIT CHANGE - makes sleepingcarp use knockdown() for its stuns instead of stun()
D.DefaultCombatKnockdown(40)//CIT CHANGE - makes sleepingcarp use knockdown() for its stuns instead of stun()
playsound(get_turf(D), 'sound/weapons/punch1.ogg', 50, 1, -1)
return TRUE
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.IsKnockdown())
if(CHECK_MOBILITY(D, MOBILITY_STAND))
log_combat(A, D, "head kicked (Sleeping Carp)")
A.do_attack_animation(D, ATTACK_EFFECT_KICK)
D.visible_message("<span class='warning'>[A] kicks [D] in the head!</span>", \
@@ -89,12 +89,12 @@
D.apply_damage(20, BRUTE, BODY_ZONE_HEAD)
D.drop_all_held_items()
playsound(get_turf(D), 'sound/weapons/punch1.ogg', 50, 1, -1)
D.Knockdown(80)//CIT CHANGE - makes sleepingcarp use knockdown() for its stuns instead of stun()
D.DefaultCombatKnockdown(80)//CIT CHANGE - makes sleepingcarp use knockdown() for its stuns instead of stun()
return TRUE
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.IsKnockdown() || D.resting || D.stat)
if(!CHECK_MOBILITY(D, MOBILITY_STAND))
log_combat(A, D, "elbow dropped (Sleeping Carp)")
A.do_attack_animation(D, ATTACK_EFFECT_PUNCH)
D.visible_message("<span class='warning'>[A] elbow drops [D]!</span>", \
@@ -134,7 +134,7 @@
playsound(get_turf(D), 'sound/weapons/punch1.ogg', 25, 1, -1)
if(prob(D.getBruteLoss()) && !D.lying)
D.visible_message("<span class='warning'>[D] stumbles and falls!</span>", "<span class='userdanger'>The blow sends you to the ground!</span>")
D.Knockdown(80)
D.DefaultCombatKnockdown(80)
log_combat(A, D, "[atk_verb] (Sleeping Carp)")
return TRUE
@@ -192,7 +192,7 @@
add_fingerprint(user)
if((HAS_TRAIT(user, TRAIT_CLUMSY)) && prob(50))
to_chat(user, "<span class ='warning'>You club yourself over the head with [src].</span>")
user.Knockdown(60)
user.DefaultCombatKnockdown(60)
if(ishuman(user))
var/mob/living/carbon/human/H = user
H.apply_damage(2*force, BRUTE, BODY_ZONE_HEAD)
@@ -226,7 +226,7 @@
if(prob(10))
H.visible_message("<span class='warning'>[H] collapses!</span>", \
"<span class='userdanger'>Your legs give out!</span>")
H.Knockdown(80)
H.DefaultCombatKnockdown(80)
if(H.staminaloss && !H.IsSleeping())
var/total_health = (H.health - H.staminaloss)
if(total_health <= HEALTH_THRESHOLD_CRIT && !H.stat)

View File

@@ -207,7 +207,7 @@
if (T && isturf(T))
if (!D.stat)
D.emote("scream")
D.throw_at(T, 10, 4, A, TRUE, TRUE, callback = CALLBACK(D, /mob/living/carbon/human.proc/Knockdown, 20))
D.throw_at(T, 10, 4, A, TRUE, TRUE, callback = CALLBACK(D, /mob/living/carbon/human.proc/DefaultCombatKnockdown, 20))
log_combat(A, D, "has thrown with wrestling")
return 0
@@ -303,7 +303,7 @@
playsound(A.loc, "swing_hit", 50, 1)
if (!D.stat)
D.emote("scream")
D.Knockdown(40)
D.DefaultCombatKnockdown(40)
switch(rand(1,3))
if (2)
@@ -361,7 +361,7 @@
var/turf/T = get_edge_target_turf(A, get_dir(A, get_step_away(D, A)))
if (T && isturf(T))
D.Knockdown(20)
D.DefaultCombatKnockdown(20)
D.throw_at(T, 3, 2)
log_combat(A, D, "roundhouse-kicked")
@@ -400,7 +400,7 @@
if (falling == 1)
A.visible_message("<span class = 'danger'><B>...and dives head-first into the ground, ouch!</b></span>")
A.adjustBruteLoss(rand(10,20))
A.Knockdown(60)
A.DefaultCombatKnockdown(60)
to_chat(A, "[D] is too far away!")
return 0
@@ -429,7 +429,7 @@
else
D.adjustBruteLoss(rand(20,30))
D.Knockdown(40)
D.DefaultCombatKnockdown(40)
A.pixel_y = 0

View File

@@ -73,8 +73,7 @@
owner.log_message("gained Vanguard stun immunity", LOG_ATTACK)
owner.add_stun_absorption("vanguard", INFINITY, 1, "'s yellow aura momentarily intensifies!", "Your ward absorbs the stun!", " radiating with a soft yellow light!")
owner.visible_message("<span class='warning'>[owner] begins to faintly glow!</span>", "<span class='brass'>You will absorb all stuns for the next twenty seconds.</span>")
owner.SetStun(0, FALSE)
owner.SetKnockdown(0)
owner.SetAllImmobility(0, FALSE)
owner.setStaminaLoss(0, FALSE)
progbar = new(owner, duration, owner)
progbar.bar.color = list("#FAE48C", "#FAE48C", "#FAE48C", rgb(0,0,0))
@@ -97,7 +96,7 @@
if(owner.stun_absorption[i]["end_time"] > world.time && owner.stun_absorption[i]["priority"] > vanguard["priority"])
otheractiveabsorptions = TRUE
if(!GLOB.ratvar_awakens && stuns_blocked && !otheractiveabsorptions)
owner.Knockdown(stuns_blocked)
owner.DefaultCombatKnockdown(stuns_blocked)
message_to_owner = "<span class='boldwarning'>The weight of the Vanguard's protection crashes down upon you!</span>"
if(stuns_blocked >= 300)
message_to_owner += "\n<span class='userdanger'>You faint from the exertion!</span>"
@@ -226,9 +225,8 @@
return ..()
/datum/status_effect/wish_granters_gift/on_remove()
owner.revive(full_heal = 1, admin_revive = 1)
owner.revive(full_heal = TRUE, admin_revive = TRUE)
owner.visible_message("<span class='warning'>[owner] appears to wake from the dead, having healed all wounds!</span>", "<span class='notice'>You have regenerated.</span>")
owner.update_canmove()
/obj/screen/alert/status_effect/wish_granters_gift
name = "Wish Granter's Immortality"

View File

@@ -12,12 +12,12 @@
. = ..()
if(.)
if(updating_canmove)
owner.update_canmove()
owner.update_mobility()
if(needs_update_stat || issilicon(owner))
owner.update_stat()
/datum/status_effect/incapacitating/on_remove()
owner.update_canmove()
owner.update_mobility()
if(needs_update_stat || issilicon(owner)) //silicons need stat updates in addition to normal canmove updates
owner.update_stat()
@@ -29,10 +29,22 @@
/datum/status_effect/incapacitating/knockdown
id = "knockdown"
/datum/status_effect/incapacitating/knockdown/tick()
//IMMOBILIZED
/datum/status_effect/incapacitating/immobilized
id = "immobilized"
//PARALYZED
/datum/status_effect/incapacitating/paralyzed
id = "paralyzed"
/datum/status_effect/incapacitating/paralyzed/tick()
if(owner.getStaminaLoss())
owner.adjustStaminaLoss(-0.3) //reduce stamina loss by 0.3 per tick, 6 per 2 seconds
//DAZED
/datum/status_effect/incapacitating/dazed
id = "dazed"
//UNCONSCIOUS
/datum/status_effect/incapacitating/unconscious
id = "unconscious"
@@ -211,7 +223,7 @@
if(iscarbon(owner) && !is_servant_of_ratvar(owner) && !owner.anti_magic_check(chargecost = 0) && number_legs)
if(force_damage || owner.m_intent != MOVE_INTENT_WALK)
if(GLOB.ratvar_awakens)
owner.Knockdown(20)
owner.DefaultCombatKnockdown(20)
if(iscultist(owner))
owner.apply_damage(cultist_damage_on_toggle * 0.5, BURN, BODY_ZONE_L_LEG)
owner.apply_damage(cultist_damage_on_toggle * 0.5, BURN, BODY_ZONE_R_LEG)
@@ -558,7 +570,7 @@
var/old_oxyloss
/datum/status_effect/kindle/tick()
owner.Knockdown(15, TRUE, FALSE, 15)
owner.DefaultCombatKnockdown(15, TRUE, FALSE, 15)
if(iscarbon(owner))
var/mob/living/carbon/C = owner
C.silent = max(2, C.silent)

View File

@@ -17,11 +17,11 @@
to_chat(owner, "<span class='userdanger'>You become frozen in a cube!</span>")
cube = icon('icons/effects/freeze.dmi', "ice_cube")
owner.add_overlay(cube)
owner.update_canmove()
owner.update_mobility()
return ..()
/datum/status_effect/freon/tick()
owner.update_canmove()
owner.update_mobility()
if(can_melt && owner.bodytemperature >= BODYTEMP_NORMAL)
qdel(src)
@@ -31,14 +31,14 @@
if(!QDELETED(src))
to_chat(owner, "You break out of the ice cube!")
owner.remove_status_effect(/datum/status_effect/freon)
owner.update_canmove()
owner.update_mobility()
/datum/status_effect/freon/on_remove()
if(!owner.stat)
to_chat(owner, "The cube melts!")
owner.cut_overlay(cube)
owner.adjust_bodytemperature(100)
owner.update_canmove()
owner.update_mobility()
UnregisterSignal(owner, COMSIG_LIVING_RESIST)
/datum/status_effect/freon/watcher

View File

@@ -22,7 +22,7 @@
status += "The law sync module is [R.lawupdate ? "on" : "off"]."
status += "The intelligence link display shows [R.connected_ai ? R.connected_ai.name : "NULL"]."
status += "The camera light is [!isnull(R.builtInCamera) && R.builtInCamera.status ? "on" : "off"]."
status += "The lockdown indicator is [R.lockcharge ? "on" : "off"]."
status += "The lockdown indicator is [R.locked_down ? "on" : "off"]."
status += "The reset module hardware light is [R.has_module() ? "on" : "off"]."
return status
@@ -54,7 +54,7 @@
R.lawsync()
R.show_laws()
if(WIRE_LOCKDOWN)
R.SetLockdown(!R.lockcharge) // Toggle
R.SetLockdown(!R.locked_down) // Toggle
if(WIRE_RESET_MODULE)
if(R.has_module())
R.visible_message("[R]'s module servos twitch.", "Your module display flickers.")

View File

@@ -172,7 +172,7 @@
.["security_level"] = get_security_level()
.["round_duration"] = SSticker ? round((world.time-SSticker.round_start_time)/10) : 0
// Amount of world's ticks in seconds, useful for calculating round duration
//Time dilation stats.
.["time_dilation_current"] = SStime_track.time_dilation_current
.["time_dilation_avg"] = SStime_track.time_dilation_avg
@@ -187,3 +187,4 @@
if(!key_valid)
GLOB.topic_status_cache = .

View File

@@ -28,7 +28,6 @@
var/list/managed_overlays
var/datum/proximity_monitor/proximity_monitor
var/buckle_message_cooldown = 0
var/fingerprintslast
var/list/filter_data //For handling persistent filters
@@ -361,11 +360,12 @@
. = list()
SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_OVERLAYS, .)
/atom/proc/relaymove(mob/user)
if(buckle_message_cooldown <= world.time)
buckle_message_cooldown = world.time + 50
/atom/proc/relaymove(mob/living/user)
if(!istype(user))
return //why are you buckling nonliving mobs to atoms?
if(user.buckle_message_cooldown <= world.time)
user.buckle_message_cooldown = world.time + 50
to_chat(user, "<span class='warning'>You can't move while buckled to [src]!</span>")
return
/atom/proc/contents_explosion(severity, target)
return //For handling the effects of explosions on contents that would not normally be effected

View File

@@ -158,7 +158,7 @@
grab_state = 0
if(isliving(ex_pulled))
var/mob/living/L = ex_pulled
L.update_canmove()// mob gets up if it was lyng down in a chokehold
L.update_mobility()// mob gets up if it was lyng down in a chokehold
/atom/movable/proc/Move_Pulled(atom/A)
if(!pulling)
@@ -194,160 +194,6 @@
stop_pulling()
return
////////////////////////////////////////
// Here's where we rewrite how byond handles movement except slightly different
// To be removed on step_ conversion
// All this work to prevent a second bump
/atom/movable/Move(atom/newloc, direct=0)
. = FALSE
if(!newloc || newloc == loc)
return
if(!direct)
direct = get_dir(src, newloc)
setDir(direct)
if(!loc.Exit(src, newloc))
return
if(!newloc.Enter(src, src.loc))
return
// Past this is the point of no return
var/atom/oldloc = loc
var/area/oldarea = get_area(oldloc)
var/area/newarea = get_area(newloc)
loc = newloc
. = TRUE
oldloc.Exited(src, newloc)
if(oldarea != newarea)
oldarea.Exited(src, newloc)
for(var/i in oldloc)
if(i == src) // Multi tile objects
continue
var/atom/movable/thing = i
thing.Uncrossed(src)
newloc.Entered(src, oldloc)
if(oldarea != newarea)
newarea.Entered(src, oldloc)
for(var/i in loc)
if(i == src) // Multi tile objects
continue
var/atom/movable/thing = i
thing.Crossed(src)
//
////////////////////////////////////////
/atom/movable/Move(atom/newloc, direct)
var/atom/movable/pullee = pulling
var/turf/T = loc
if(pulling)
if(pullee && get_dist(src, pullee) > 1)
stop_pulling()
if(pullee && pullee.loc != loc && !isturf(pullee.loc) ) //to be removed once all code that changes an object's loc uses forceMove().
log_game("DEBUG:[src]'s pull on [pullee] wasn't broken despite [pullee] being in [pullee.loc]. Pull stopped manually.")
stop_pulling()
if(!loc || !newloc)
return FALSE
var/atom/oldloc = loc
if(loc != newloc)
if (!(direct & (direct - 1))) //Cardinal move
. = ..()
else //Diagonal move, split it into cardinal moves
moving_diagonally = FIRST_DIAG_STEP
var/first_step_dir
// The `&& moving_diagonally` checks are so that a forceMove taking
// place due to a Crossed, Bumped, etc. call will interrupt
// the second half of the diagonal movement, or the second attempt
// at a first half if step() fails because we hit something.
if (direct & NORTH)
if (direct & EAST)
if (step(src, NORTH) && moving_diagonally)
first_step_dir = NORTH
moving_diagonally = SECOND_DIAG_STEP
. = step(src, EAST)
else if (moving_diagonally && step(src, EAST))
first_step_dir = EAST
moving_diagonally = SECOND_DIAG_STEP
. = step(src, NORTH)
else if (direct & WEST)
if (step(src, NORTH) && moving_diagonally)
first_step_dir = NORTH
moving_diagonally = SECOND_DIAG_STEP
. = step(src, WEST)
else if (moving_diagonally && step(src, WEST))
first_step_dir = WEST
moving_diagonally = SECOND_DIAG_STEP
. = step(src, NORTH)
else if (direct & SOUTH)
if (direct & EAST)
if (step(src, SOUTH) && moving_diagonally)
first_step_dir = SOUTH
moving_diagonally = SECOND_DIAG_STEP
. = step(src, EAST)
else if (moving_diagonally && step(src, EAST))
first_step_dir = EAST
moving_diagonally = SECOND_DIAG_STEP
. = step(src, SOUTH)
else if (direct & WEST)
if (step(src, SOUTH) && moving_diagonally)
first_step_dir = SOUTH
moving_diagonally = SECOND_DIAG_STEP
. = step(src, WEST)
else if (moving_diagonally && step(src, WEST))
first_step_dir = WEST
moving_diagonally = SECOND_DIAG_STEP
. = step(src, SOUTH)
if(moving_diagonally == SECOND_DIAG_STEP)
if(!.)
setDir(first_step_dir)
else if (!inertia_moving)
inertia_next_move = world.time + inertia_move_delay
newtonian_move(direct)
moving_diagonally = 0
return
if(!loc || (loc == oldloc && oldloc != newloc))
last_move = 0
return
if(.)
Moved(oldloc, direct)
if(. && pulling && pulling == pullee) //we were pulling a thing and didn't lose it during our move.
if(pulling.anchored)
stop_pulling()
else
var/pull_dir = get_dir(src, pulling)
//puller and pullee more than one tile away or in diagonal position
if(get_dist(src, pulling) > 1 || (moving_diagonally != SECOND_DIAG_STEP && ((pull_dir - 1) & pull_dir)))
pulling.Move(T, get_dir(pulling, T)) //the pullee tries to reach our previous position
if(pulling && get_dist(src, pulling) > 1) //the pullee couldn't keep up
stop_pulling()
if(pulledby && moving_diagonally != FIRST_DIAG_STEP && get_dist(src, pulledby) > 1)//separated from our puller and not in the middle of a diagonal move.
pulledby.stop_pulling()
last_move = direct
setDir(direct)
if(. && has_buckled_mobs() && !handle_buckled_mob_movement(loc,direct)) //movement failed due to buckled mob(s)
return FALSE
//Called after a successful Move(). By this point, we've already moved
/atom/movable/proc/Moved(atom/OldLoc, Dir, Forced = FALSE)
SEND_SIGNAL(src, COMSIG_MOVABLE_MOVED, OldLoc, Dir, Forced)
if (!inertia_moving)
inertia_next_move = world.time + inertia_move_delay
newtonian_move(Dir)
if (length(client_mobs_in_contents))
update_parallax_contents()
return TRUE
/atom/movable/Destroy(force)
QDEL_NULL(proximity_monitor)
QDEL_NULL(language_holder)
@@ -372,143 +218,6 @@
orbiting.end_orbit(src)
orbiting = null
// Make sure you know what you're doing if you call this, this is intended to only be called by byond directly.
// You probably want CanPass()
/atom/movable/Cross(atom/movable/AM)
. = TRUE
SEND_SIGNAL(src, COMSIG_MOVABLE_CROSS, AM)
return CanPass(AM, AM.loc, TRUE)
//oldloc = old location on atom, inserted when forceMove is called and ONLY when forceMove is called!
/atom/movable/Crossed(atom/movable/AM, oldloc)
SEND_SIGNAL(src, COMSIG_MOVABLE_CROSSED, AM)
/atom/movable/Uncross(atom/movable/AM, atom/newloc)
. = ..()
if(SEND_SIGNAL(src, COMSIG_MOVABLE_UNCROSS, AM) & COMPONENT_MOVABLE_BLOCK_UNCROSS)
return FALSE
if(isturf(newloc) && !CheckExit(AM, newloc))
return FALSE
/atom/movable/Uncrossed(atom/movable/AM)
SEND_SIGNAL(src, COMSIG_MOVABLE_UNCROSSED, AM)
/atom/movable/Bump(atom/A)
if(!A)
CRASH("Bump was called with no argument.")
SEND_SIGNAL(src, COMSIG_MOVABLE_BUMP, A)
. = ..()
if(!QDELETED(throwing))
throwing.hit_atom(A)
. = TRUE
if(QDELETED(A))
return
A.Bumped(src)
/atom/movable/proc/forceMove(atom/destination)
. = FALSE
if(destination)
. = doMove(destination)
else
CRASH("No valid destination passed into forceMove")
/atom/movable/proc/moveToNullspace()
return doMove(null)
/atom/movable/proc/doMove(atom/destination)
. = FALSE
if(destination)
if(pulledby)
pulledby.stop_pulling()
var/atom/oldloc = loc
var/same_loc = oldloc == destination
var/area/old_area = get_area(oldloc)
var/area/destarea = get_area(destination)
loc = destination
moving_diagonally = 0
if(!same_loc)
if(oldloc)
oldloc.Exited(src, destination)
if(old_area && old_area != destarea)
old_area.Exited(src, destination)
for(var/atom/movable/AM in oldloc)
AM.Uncrossed(src)
var/turf/oldturf = get_turf(oldloc)
var/turf/destturf = get_turf(destination)
var/old_z = (oldturf ? oldturf.z : null)
var/dest_z = (destturf ? destturf.z : null)
if (old_z != dest_z)
onTransitZ(old_z, dest_z)
destination.Entered(src, oldloc)
if(destarea && old_area != destarea)
destarea.Entered(src, oldloc)
for(var/atom/movable/AM in destination)
if(AM == src)
continue
AM.Crossed(src, oldloc)
Moved(oldloc, NONE, TRUE)
. = TRUE
//If no destination, move the atom into nullspace (don't do this unless you know what you're doing)
else
. = TRUE
if (loc)
var/atom/oldloc = loc
var/area/old_area = get_area(oldloc)
oldloc.Exited(src, null)
if(old_area)
old_area.Exited(src, null)
loc = null
/atom/movable/proc/onTransitZ(old_z,new_z)
SEND_SIGNAL(src, COMSIG_MOVABLE_Z_CHANGED, old_z, new_z)
for (var/item in src) // Notify contents of Z-transition. This can be overridden IF we know the items contents do not care.
var/atom/movable/AM = item
AM.onTransitZ(old_z,new_z)
/atom/movable/proc/setMovetype(newval)
movement_type = newval
//Called whenever an object moves and by mobs when they attempt to move themselves through space
//And when an object or action applies a force on src, see newtonian_move() below
//Return 0 to have src start/keep drifting in a no-grav area and 1 to stop/not start drifting
//Mobs should return 1 if they should be able to move of their own volition, see client/Move() in mob_movement.dm
//movement_dir == 0 when stopping or any dir when trying to move
/atom/movable/proc/Process_Spacemove(movement_dir = 0)
if(has_gravity(src))
return 1
if(pulledby)
return 1
if(throwing)
return 1
if(!isturf(loc))
return 1
if(locate(/obj/structure/lattice) in range(1, get_turf(src))) //Not realistic but makes pushing things in space easier
return 1
return 0
/atom/movable/proc/newtonian_move(direction) //Only moves the object if it's under no gravity
if(!loc || Process_Spacemove(0))
inertia_dir = 0
return 0
inertia_dir = direction
if(!direction)
return 1
inertia_last_loc = loc
SSspacedrift.processing[src] = src
return 1
/atom/movable/proc/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
set waitfor = 0
SEND_SIGNAL(src, COMSIG_MOVABLE_IMPACT, hit_atom, throwingdatum)
@@ -610,17 +319,6 @@
SSthrowing.currentrun[src] = TT
TT.tick()
/atom/movable/proc/handle_buckled_mob_movement(newloc,direct)
for(var/m in buckled_mobs)
var/mob/living/buckled_mob = m
if(!buckled_mob.Move(newloc, direct))
forceMove(buckled_mob.loc)
last_move = buckled_mob.last_move
inertia_dir = last_move
buckled_mob.inertia_dir = last_move
return 0
return 1
/atom/movable/proc/force_pushed(atom/movable/pusher, force = MOVE_FORCE_DEFAULT, direction)
return FALSE
@@ -639,7 +337,7 @@
/atom/movable/CanPass(atom/movable/mover, turf/target)
if(mover in buckled_mobs)
return 1
return TRUE
return ..()
// called when this atom is removed from a storage item, which is passed on as S. The loc variable is already set to the new destination before this is called.

307
code/game/atoms_movement.dm Normal file
View File

@@ -0,0 +1,307 @@
// File for movement procs for atom/movable
////////////////////////////////////////
// Here's where we rewrite how byond handles movement except slightly different
// To be removed on step_ conversion
// All this work to prevent a second bump
/atom/movable/Move(atom/newloc, direct=0)
. = FALSE
if(!newloc || newloc == loc)
return
if(!direct)
direct = get_dir(src, newloc)
setDir(direct)
if(!loc.Exit(src, newloc))
return
if(!newloc.Enter(src, src.loc))
return
// Past this is the point of no return
var/atom/oldloc = loc
var/area/oldarea = get_area(oldloc)
var/area/newarea = get_area(newloc)
loc = newloc
. = TRUE
oldloc.Exited(src, newloc)
if(oldarea != newarea)
oldarea.Exited(src, newloc)
for(var/i in oldloc)
if(i == src) // Multi tile objects
continue
var/atom/movable/thing = i
thing.Uncrossed(src)
newloc.Entered(src, oldloc)
if(oldarea != newarea)
newarea.Entered(src, oldloc)
for(var/i in loc)
if(i == src) // Multi tile objects
continue
var/atom/movable/thing = i
thing.Crossed(src)
//
////////////////////////////////////////
/atom/movable/Move(atom/newloc, direct)
var/atom/movable/pullee = pulling
var/turf/T = loc
if(pulling)
if(pullee && get_dist(src, pullee) > 1)
stop_pulling()
if(pullee && pullee.loc != loc && !isturf(pullee.loc) ) //to be removed once all code that changes an object's loc uses forceMove().
log_game("DEBUG:[src]'s pull on [pullee] wasn't broken despite [pullee] being in [pullee.loc]. Pull stopped manually.")
stop_pulling()
if(!loc || !newloc)
return FALSE
var/atom/oldloc = loc
if(loc != newloc)
if (!(direct & (direct - 1))) //Cardinal move
. = ..()
else //Diagonal move, split it into cardinal moves
moving_diagonally = FIRST_DIAG_STEP
var/first_step_dir
// The `&& moving_diagonally` checks are so that a forceMove taking
// place due to a Crossed, Bumped, etc. call will interrupt
// the second half of the diagonal movement, or the second attempt
// at a first half if step() fails because we hit something.
if (direct & NORTH)
if (direct & EAST)
if (step(src, NORTH) && moving_diagonally)
first_step_dir = NORTH
moving_diagonally = SECOND_DIAG_STEP
. = step(src, EAST)
else if (moving_diagonally && step(src, EAST))
first_step_dir = EAST
moving_diagonally = SECOND_DIAG_STEP
. = step(src, NORTH)
else if (direct & WEST)
if (step(src, NORTH) && moving_diagonally)
first_step_dir = NORTH
moving_diagonally = SECOND_DIAG_STEP
. = step(src, WEST)
else if (moving_diagonally && step(src, WEST))
first_step_dir = WEST
moving_diagonally = SECOND_DIAG_STEP
. = step(src, NORTH)
else if (direct & SOUTH)
if (direct & EAST)
if (step(src, SOUTH) && moving_diagonally)
first_step_dir = SOUTH
moving_diagonally = SECOND_DIAG_STEP
. = step(src, EAST)
else if (moving_diagonally && step(src, EAST))
first_step_dir = EAST
moving_diagonally = SECOND_DIAG_STEP
. = step(src, SOUTH)
else if (direct & WEST)
if (step(src, SOUTH) && moving_diagonally)
first_step_dir = SOUTH
moving_diagonally = SECOND_DIAG_STEP
. = step(src, WEST)
else if (moving_diagonally && step(src, WEST))
first_step_dir = WEST
moving_diagonally = SECOND_DIAG_STEP
. = step(src, SOUTH)
if(moving_diagonally == SECOND_DIAG_STEP)
if(!.)
setDir(first_step_dir)
else if (!inertia_moving)
inertia_next_move = world.time + inertia_move_delay
newtonian_move(direct)
moving_diagonally = 0
return
if(!loc || (loc == oldloc && oldloc != newloc))
last_move = NONE
return
if(.)
last_move = direct
setDir(direct)
if(has_buckled_mobs() && !handle_buckled_mob_movement(loc,direct)) //movement failed due to buckled mob(s)
return FALSE
if(pulling && pulling == pullee) //we were pulling a thing and didn't lose it during our move.
if(pulling.anchored)
stop_pulling()
else
var/pull_dir = get_dir(src, pulling)
//puller and pullee more than one tile away or in diagonal position
if(get_dist(src, pulling) > 1 || (moving_diagonally != SECOND_DIAG_STEP && ((pull_dir - 1) & pull_dir)))
pulling.Move(T, get_dir(pulling, T)) //the pullee tries to reach our previous position
if(pulling && get_dist(src, pulling) > 1) //the pullee couldn't keep up
stop_pulling()
if(pulledby && moving_diagonally != FIRST_DIAG_STEP && get_dist(src, pulledby) > 1)//separated from our puller and not in the middle of a diagonal move.
pulledby.stop_pulling()
Moved(oldloc, direct)
/atom/movable/proc/handle_buckled_mob_movement(newloc,direct)
for(var/m in buckled_mobs)
var/mob/living/buckled_mob = m
if(!buckled_mob.Move(newloc, direct))
forceMove(buckled_mob.loc)
last_move = buckled_mob.last_move
inertia_dir = last_move
buckled_mob.inertia_dir = last_move
return FALSE
return TRUE
//Called after a successful Move(). By this point, we've already moved
/atom/movable/proc/Moved(atom/OldLoc, Dir, Forced = FALSE)
SEND_SIGNAL(src, COMSIG_MOVABLE_MOVED, OldLoc, Dir, Forced)
if (!inertia_moving)
inertia_next_move = world.time + inertia_move_delay
newtonian_move(Dir)
if (length(client_mobs_in_contents))
update_parallax_contents()
return TRUE
// Make sure you know what you're doing if you call this, this is intended to only be called by byond directly.
// You probably want CanPass()
/atom/movable/Cross(atom/movable/AM)
. = TRUE
SEND_SIGNAL(src, COMSIG_MOVABLE_CROSS, AM)
return CanPass(AM, AM.loc, TRUE)
//oldloc = old location on atom, inserted when forceMove is called and ONLY when forceMove is called!
/atom/movable/Crossed(atom/movable/AM, oldloc)
SEND_SIGNAL(src, COMSIG_MOVABLE_CROSSED, AM)
/atom/movable/Uncross(atom/movable/AM, atom/newloc)
. = ..()
if(SEND_SIGNAL(src, COMSIG_MOVABLE_UNCROSS, AM) & COMPONENT_MOVABLE_BLOCK_UNCROSS)
return FALSE
if(isturf(newloc) && !CheckExit(AM, newloc))
return FALSE
/atom/movable/Uncrossed(atom/movable/AM)
SEND_SIGNAL(src, COMSIG_MOVABLE_UNCROSSED, AM)
/atom/movable/Bump(atom/A)
if(!A)
CRASH("Bump was called with no argument.")
SEND_SIGNAL(src, COMSIG_MOVABLE_BUMP, A)
. = ..()
if(!QDELETED(throwing))
throwing.hit_atom(A)
. = TRUE
if(QDELETED(A))
return
A.Bumped(src)
/atom/movable/proc/onTransitZ(old_z,new_z)
SEND_SIGNAL(src, COMSIG_MOVABLE_Z_CHANGED, old_z, new_z)
for (var/item in src) // Notify contents of Z-transition. This can be overridden IF we know the items contents do not care.
var/atom/movable/AM = item
AM.onTransitZ(old_z,new_z)
/atom/movable/proc/setMovetype(newval)
movement_type = newval
///////////// FORCED MOVEMENT /////////////
/atom/movable/proc/forceMove(atom/destination)
. = FALSE
if(destination)
. = doMove(destination)
else
CRASH("No valid destination passed into forceMove")
/atom/movable/proc/moveToNullspace()
return doMove(null)
/atom/movable/proc/doMove(atom/destination)
. = FALSE
if(destination)
if(pulledby)
pulledby.stop_pulling()
var/atom/oldloc = loc
var/same_loc = oldloc == destination
var/area/old_area = get_area(oldloc)
var/area/destarea = get_area(destination)
loc = destination
moving_diagonally = 0
if(!same_loc)
if(oldloc)
oldloc.Exited(src, destination)
if(old_area && old_area != destarea)
old_area.Exited(src, destination)
for(var/atom/movable/AM in oldloc)
AM.Uncrossed(src)
var/turf/oldturf = get_turf(oldloc)
var/turf/destturf = get_turf(destination)
var/old_z = (oldturf ? oldturf.z : null)
var/dest_z = (destturf ? destturf.z : null)
if (old_z != dest_z)
onTransitZ(old_z, dest_z)
destination.Entered(src, oldloc)
if(destarea && old_area != destarea)
destarea.Entered(src, oldloc)
for(var/atom/movable/AM in destination)
if(AM == src)
continue
AM.Crossed(src, oldloc)
Moved(oldloc, NONE, TRUE)
. = TRUE
//If no destination, move the atom into nullspace (don't do this unless you know what you're doing)
else
. = TRUE
if (loc)
var/atom/oldloc = loc
var/area/old_area = get_area(oldloc)
oldloc.Exited(src, null)
if(old_area)
old_area.Exited(src, null)
loc = null
//Called whenever an object moves and by mobs when they attempt to move themselves through space
//And when an object or action applies a force on src, see newtonian_move() below
//Return 0 to have src start/keep drifting in a no-grav area and 1 to stop/not start drifting
//Mobs should return 1 if they should be able to move of their own volition, see client/Move() in mob_movement.dm
//movement_dir == 0 when stopping or any dir when trying to move
/atom/movable/proc/Process_Spacemove(movement_dir = 0)
if(has_gravity(src))
return 1
if(pulledby)
return 1
if(throwing)
return 1
if(!isturf(loc))
return 1
if(locate(/obj/structure/lattice) in range(1, get_turf(src))) //Not realistic but makes pushing things in space easier
return 1
return 0
/atom/movable/proc/newtonian_move(direction) //Only moves the object if it's under no gravity
if(!loc || Process_Spacemove(0))
inertia_dir = 0
return 0
inertia_dir = direction
if(!direction)
return 1
inertia_last_loc = loc
SSspacedrift.processing[src] = src
return 1

View File

@@ -54,6 +54,6 @@
return
var/mob/living/carbon/human/H = gangster_mind.current // we are sure the dude's human cause it's checked in attack()
H.silent = max(H.silent, 5)
H.Knockdown(100)
H.DefaultCombatKnockdown(100)
gangster_mind.add_antag_datum(/datum/antagonist/gang, gang)
return TRUE

View File

@@ -185,7 +185,7 @@ Class Procs:
A.forceMove(T)
if(isliving(A))
var/mob/living/L = A
L.update_canmove()
L.update_mobility()
if(occupant)
SEND_SIGNAL(src, COMSIG_MACHINE_EJECT_OCCUPANT, occupant)
occupant = null

View File

@@ -217,7 +217,7 @@
M.vomit(10, distance = 5)
if(ORION_TRAIL_FLUX)
if(prob(75))
M.Knockdown(60)
M.DefaultCombatKnockdown(60)
say("A sudden gust of powerful wind slams [M] into the floor!")
M.take_bodypart_damage(25)
playsound(loc, 'sound/weapons/genhit.ogg', 100, 1)

View File

@@ -37,12 +37,11 @@
dat += "[R.name] |"
if(R.stat)
dat += " Not Responding |"
else if (!R.canmove)
else if(R.locked_down)
dat += " Locked Down |"
else
dat += " Operating Normally |"
if (!R.canmove)
else if(R.cell)
if(R.cell)
dat += " Battery Installed ([R.cell.charge]/[R.cell.maxcharge]) |"
else
dat += " No Cell Installed |"
@@ -62,7 +61,7 @@
dat += "<A href='?src=[REF(src)];magbot=[REF(R)]'>(<font color=blue><i>Hack</i></font>)</A> "
else if(IsAdminGhost(user) && !R.emagged)
dat += "<A href='?src=[REF(src)];magbot=[REF(R)]'>(<font color=blue><i>Hack</i></font>)</A> "
dat += "<A href='?src=[REF(src)];stopbot=[REF(R)]'>(<font color=green><i>[R.canmove ? "Lockdown" : "Release"]</i></font>)</A> "
dat += "<A href='?src=[REF(src)];stopbot=[REF(R)]'>(<font color=green><i>[R.locked_down? "Lockdown" : "Release"]</i></font>)</A> "
dat += "<A href='?src=[REF(src)];killbot=[REF(R)]'>(<font color=red><i>Destroy</i></font>)</A>"
dat += "<BR>"
@@ -116,14 +115,14 @@
if(src.allowed(usr))
var/mob/living/silicon/robot/R = locate(href_list["stopbot"]) in GLOB.silicon_mobs
if(can_control(usr, R))
var/choice = input("Are you certain you wish to [R.canmove ? "lock down" : "release"] [R.name]?") in list("Confirm", "Abort")
var/choice = input("Are you certain you wish to [R.locked_down? "lock down" : "release"] [R.name]?") in list("Confirm", "Abort")
if(choice == "Confirm" && can_control(usr, R) && !..())
message_admins("<span class='notice'>[ADMIN_LOOKUPFLW(usr)] [R.canmove ? "locked down" : "released"] [key_name(R, R.client)][ADMIN_LOOKUPFLW(R)]!</span>")
log_game("[key_name(usr)] [R.canmove ? "locked down" : "released"] [key_name(R)]!")
R.SetLockdown(!R.lockcharge)
to_chat(R, "[!R.lockcharge ? "<span class='notice'>Your lockdown has been lifted!" : "<span class='alert'>You have been locked down!"]</span>")
message_admins("<span class='notice'>[ADMIN_LOOKUPFLW(usr)] [R.locked_down? "locked down" : "released"] [key_name(R, R.client)][ADMIN_LOOKUPFLW(R)]!</span>")
log_game("[key_name(usr)] [R.locked_down? "locked down" : "released"] [key_name(R)]!")
R.SetLockdown(!R.locked_down)
to_chat(R, "[!R.locked_down ? "<span class='notice'>Your lockdown has been lifted!" : "<span class='alert'>You have been locked down!"]</span>")
if(R.connected_ai)
to_chat(R.connected_ai, "[!R.lockcharge ? "<span class='notice'>NOTICE - Cyborg lockdown lifted" : "<span class='alert'>ALERT - Cyborg lockdown detected"]: <a href='?src=[REF(R.connected_ai)];track=[html_encode(R.name)]'>[R.name]</a></span><br>")
to_chat(R.connected_ai, "[!R.locked_down ? "<span class='notice'>NOTICE - Cyborg lockdown lifted" : "<span class='alert'>ALERT - Cyborg lockdown detected"]: <a href='?src=[REF(R.connected_ai)];track=[html_encode(R.name)]'>[R.name]</a></span><br>")
else
to_chat(usr, "<span class='danger'>Access Denied.</span>")

View File

@@ -433,5 +433,5 @@
. = ..()
if(active)
for(var/mob/living/M in rangers)
if(prob(5+(allowed(M)*4)) && M.canmove)
if(prob(5+(allowed(M)*4)) && CHECK_MOBILITY(M, MOBILITY_MOVE))
dance(M)

View File

@@ -769,7 +769,7 @@
if(!istype(H.head, /obj/item/clothing/head/helmet))
H.visible_message("<span class='danger'>[user] headbutts the airlock.</span>", \
"<span class='userdanger'>You headbutt the airlock!</span>")
H.Knockdown(100)
H.DefaultCombatKnockdown(100)
H.apply_damage(10, BRUTE, BODY_ZONE_HEAD)
else
visible_message("<span class='danger'>[user] headbutts the airlock. Good thing [user.p_theyre()] wearing a helmet.</span>")
@@ -1033,7 +1033,7 @@
if(!I.use_tool(src, user, 150, volume=50))
to_chat(user, "<span class='warning'>You slip and [charge] detonates!</span>")
charge.ex_act(EXPLODE_DEVASTATE)
user.Knockdown(60)
user.DefaultCombatKnockdown(60)
return
user.visible_message("<span class='notice'>[user] removes [charge] from [src].</span>", \
"<span class='notice'>You gently pry out [charge] from [src] and unhook its wires.</span>")

View File

@@ -508,7 +508,7 @@
throwtarget = get_edge_target_turf(src, get_dir(src, get_step_away(L, src)))
SEND_SOUND(L, sound(pick('sound/hallucinations/turn_around1.ogg','sound/hallucinations/turn_around2.ogg'),0,1,50))
flash_color(L, flash_color="#960000", flash_time=20)
L.Knockdown(40)
L.DefaultCombatKnockdown(40)
L.throw_at(throwtarget, 5, 1)
return 0

View File

@@ -319,10 +319,10 @@
else if(ishuman(L)) //For humans
L.adjustBruteLoss(DOOR_CRUSH_DAMAGE)
L.emote("scream")
L.Knockdown(100)
L.DefaultCombatKnockdown(100)
else if(ismonkey(L)) //For monkeys
L.adjustBruteLoss(DOOR_CRUSH_DAMAGE)
L.Knockdown(100)
L.DefaultCombatKnockdown(100)
else //for simple_animals & borgs
L.adjustBruteLoss(DOOR_CRUSH_DAMAGE)
var/turf/location = get_turf(src)

View File

@@ -115,7 +115,7 @@
continue
if(L.flash_act(affect_silicon = 1))
L.Knockdown(strength)
L.DefaultCombatKnockdown(strength)
flashed = TRUE
if(flashed)

View File

@@ -90,7 +90,8 @@ Buildable meters
set name = "Flip Pipe"
set src in view(1)
if ( usr.stat || usr.restrained() || !usr.canmove )
var/mob/living/L = usr
if(!istype(L) || !CHECK_MOBILITY(L, MOBILITY_USE))
return
do_a_flip()

View File

@@ -34,7 +34,8 @@
/obj/machinery/pipedispenser/Topic(href, href_list)
if(..())
return 1
if(!anchored|| !usr.canmove || usr.stat || usr.restrained() || !in_range(loc, usr))
var/mob/living/L = usr
if(!anchored || !istype(L) || !CHECK_MOBILITY(L, MOBILITY_USE))
usr << browse(null, "window=pipedispenser")
return 1
usr.set_machine(src)
@@ -93,14 +94,14 @@
//Allow you to drag-drop disposal pipes and transit tubes into it
/obj/machinery/pipedispenser/disposal/MouseDrop_T(obj/structure/pipe, mob/usr)
if(!usr.canmove || usr.stat || usr.restrained())
/obj/machinery/pipedispenser/disposal/MouseDrop_T(obj/structure/pipe, mob/living/user)
if(!istype(user) || !CHECK_MOBILITY(user, MOBILITY_USE))
return
if (!istype(pipe, /obj/structure/disposalconstruct) && !istype(pipe, /obj/structure/c_transit_tube) && !istype(pipe, /obj/structure/c_transit_tube_pod))
return
if (get_dist(usr, src) > 1 || get_dist(src,pipe) > 1 )
if (get_dist(user, src) > 1 || get_dist(src,pipe) > 1 )
return
if (pipe.anchored)

View File

@@ -226,8 +226,7 @@
return
if(M.health > 0)
M.adjustOxyLoss(-1)
M.AdjustStun(-80)
M.AdjustKnockdown(-80)
M.AdjustAllImmobility(-80)
M.AdjustUnconscious(-80)
if(M.reagents.get_reagent_amount(/datum/reagent/medicine/epinephrine) < 5)
M.reagents.add_reagent(/datum/reagent/medicine/epinephrine, 5)

View File

@@ -177,7 +177,7 @@
M.SetSleeping(0)
M.stuttering += 20
M.adjustEarDamage(0, 30)
M.Knockdown(60)
M.DefaultCombatKnockdown(60)
if(prob(30))
M.Stun(200)
M.Unconscious(80)

View File

@@ -755,7 +755,7 @@
AI.cancel_camera()
AI.controlled_mech = src
AI.remote_control = src
AI.canmove = 1 //Much easier than adding AI checks! Be sure to set this back to 0 if you decide to allow an AI to leave a mech somehow.
AI.mobility_flags = MOBILITY_FLAGS_DEFAULT //Much easier than adding AI checks! Be sure to set this back to 0 if you decide to allow an AI to leave a mech somehow.
AI.can_shunt = 0 //ONE AI ENTERS. NO AI LEAVES.
to_chat(AI, AI.can_dominate_mechs ? "<span class='announce'>Takeover of [name] complete! You are now loaded onto the onboard computer. Do not attempt to leave the station sector!</span>" :\
"<span class='notice'>You have been uploaded to a mech's onboard computer.</span>")
@@ -927,7 +927,7 @@
brainmob.forceMove(src) //should allow relaymove
brainmob.reset_perspective(src)
brainmob.remote_control = src
brainmob.update_canmove()
brainmob.update_mobility()
brainmob.update_mouse_pointer()
icon_state = initial(icon_state)
update_icon()
@@ -941,7 +941,6 @@
/obj/mecha/container_resist(mob/living/user)
go_out()
/obj/mecha/Exited(atom/movable/M, atom/newloc)
if(occupant && occupant == M) // The occupant exited the mech without calling go_out()
go_out(TRUE, newloc)
@@ -993,7 +992,7 @@
L.reset_perspective()
mmi.mecha = null
mmi.update_icon()
L.canmove = 0
L.mobility_flags = NONE
icon_state = initial(icon_state)+"-open"
setDir(dir_in)

View File

@@ -36,8 +36,7 @@
//procs that handle the actual buckling and unbuckling
/atom/movable/proc/buckle_mob(mob/living/M, force = FALSE, check_loc = TRUE)
if(!buckled_mobs)
buckled_mobs = list()
LAZYINITLIST(buckled_mobs)
if(!istype(M))
return FALSE
@@ -66,7 +65,7 @@
M.buckled = src
M.setDir(dir)
buckled_mobs |= M
M.update_canmove()
M.update_mobility()
M.throw_alert("buckled", /obj/screen/alert/restrained/buckled)
post_buckle_mob(M)
@@ -85,7 +84,7 @@
. = buckled_mob
buckled_mob.buckled = null
buckled_mob.anchored = initial(buckled_mob.anchored)
buckled_mob.update_canmove()
buckled_mob.update_mobility()
buckled_mob.clear_alert("buckled")
buckled_mobs -= buckled_mob
SEND_SIGNAL(src, COMSIG_MOVABLE_UNBUCKLE, buckled_mob, force)

View File

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

View File

@@ -104,4 +104,5 @@
if(explosion_message)
location.visible_message("<span class='danger'>The solution violently explodes!</span>", \
"<span class='italics'>You hear an explosion!</span>")
dyn_explosion(location, amount, flashing_factor)
dyn_explosion(location, amount, flashing_factor)

View File

@@ -48,7 +48,7 @@
/obj/effect/mine/stun/mineEffect(mob/living/victim)
if(isliving(victim))
victim.Knockdown(stun_time)
victim.DefaultCombatKnockdown(stun_time)
/obj/effect/mine/kickmine
name = "kick mine"

View File

@@ -61,10 +61,11 @@
if(AM in T.affecting)
return
if(ismob(AM))
var/mob/M = AM
if(isliving(AM))
var/mob/living/M = AM
if(immobilize)
M.canmove = 0
ADD_TRAIT(M, TRAIT_MOBILITY_NOMOVE, src)
M.update_mobility()
affecting.Add(AM)
while(AM && !stopthrow)
@@ -98,10 +99,11 @@
affecting.Remove(AM)
if(ismob(AM))
var/mob/M = AM
if(isliving(AM))
var/mob/living/M = AM
if(immobilize)
M.canmove = 1
REMOVE_TRAIT(M, TRAIT_MOBILITY_NOMOVE, src)
M.update_mobility()
/* Stops things thrown by a thrower, doesn't do anything */

View File

@@ -175,14 +175,13 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
set category = "Object"
set src in oview(1)
if(!isturf(loc) || usr.stat || usr.restrained() || !usr.canmove)
var/mob/living/L = usr
if(!istype(L) || !isturf(loc) || !CHECK_MOBILITY(L, MOBILITY_USE))
return
var/turf/T = src.loc
src.loc = null
src.loc = T
var/turf/T = loc
loc = null
loc = T
/obj/item/examine(mob/user) //This might be spammy. Remove?
. = ..()
@@ -544,7 +543,7 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
to_chat(M, "<span class='danger'>You drop what you're holding and clutch at your eyes!</span>")
M.adjust_blurriness(10)
M.Unconscious(20)
M.Knockdown(40)
M.DefaultCombatKnockdown(40)
if (prob(eyes.damage - 10 + 1))
M.become_blind(EYE_DAMAGE)
to_chat(M, "<span class='danger'>You go blind!</span>")

View File

@@ -856,7 +856,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
if(prob(5))//small chance for the vape to break and deal damage if it's emagged
playsound(get_turf(src), 'sound/effects/pop_expl.ogg', 50, 0)
M.apply_damage(20, BURN, BODY_ZONE_HEAD)
M.Knockdown(300, 1, 0)
M.DefaultCombatKnockdown(300, 1, 0)
var/datum/effect_system/spark_spread/sp = new /datum/effect_system/spark_spread
sp.set_up(5, 1, src)
sp.start()

View File

@@ -694,7 +694,7 @@
C.blind_eyes(1)
if(C.get_eye_protection() <= 0) // no eye protection? ARGH IT BURNS.
C.confused = max(C.confused, 3)
C.Knockdown(60)
C.DefaultCombatKnockdown(60)
if(ishuman(C) && actually_paints)
var/mob/living/carbon/human/H = C
H.lip_style = "spray_face"

View File

@@ -449,7 +449,7 @@
M.visible_message("<span class='danger'>[user] zaps [M] with [src]!</span>", \
"<span class='userdanger'>[user] zaps [M] with [src]!</span>")
M.adjustStaminaLoss(50)
M.Knockdown(100)
M.DefaultCombatKnockdown(100)
M.updatehealth() //forces health update before next life tick
playsound(src, 'sound/machines/defib_zap.ogg', 50, 1, -1)
M.emote("gasp")
@@ -506,7 +506,7 @@
H.set_heartattack(TRUE)
H.apply_damage(50, BURN, BODY_ZONE_CHEST)
log_combat(user, H, "overloaded the heart of", defib)
H.Knockdown(100)
H.DefaultCombatKnockdown(100)
H.Jitter(100)
if(req_defib)
defib.deductcharge(revivecost)

View File

@@ -469,7 +469,7 @@ GLOBAL_LIST_EMPTY(PDAs)
var/mob/living/U = usr
//Looking for master was kind of pointless since PDAs don't appear to have one.
if(usr.canUseTopic(src, BE_CLOSE, FALSE, NO_TK) && !href_list["close"])
if(usr.canUseTopic(src, BE_CLOSE, FALSE, NO_TK, FALSE) && !href_list["close"])
add_fingerprint(U)
U.set_machine(src)
@@ -757,7 +757,7 @@ GLOBAL_LIST_EMPTY(PDAs)
var/t = stripped_input(U, "Please enter message", name)
if (!t || toff)
return
if(!U.canUseTopic(src, BE_CLOSE))
if(!U.canUseTopic(src, BE_CLOSE, FALSE, NO_TK, FALSE))
return
if(emped)
t = Gibberish(t, 100)

View File

@@ -116,7 +116,7 @@
//chance to actually hit the eyes depends on internal component
if(prob(effectchance * diode.rating))
S.flash_act(affect_silicon = 1)
S.Knockdown(rand(100,200))
S.DefaultCombatKnockdown(rand(100,200))
to_chat(S, "<span class='danger'>Your sensors were overloaded by a laser!</span>")
outmsg = "<span class='notice'>You overload [S] by shining [src] at [S.p_their()] sensors.</span>"
else
@@ -152,8 +152,7 @@
if(prob(50))
C.visible_message("<span class='notice'>[C] pounces on the light!</span>","<span class='warning'>LIGHT!</span>")
C.Move(targloc)
C.resting = TRUE
C.update_canmove()
C.set_resting(TRUE)
else
C.visible_message("<span class='notice'>[C] looks uninterested in your games.</span>","<span class='warning'>You spot [user] shining [src] at you. How insulting!</span>")

View File

@@ -118,7 +118,7 @@
s.set_up(3, 1, L)
s.start()
L.Knockdown(100)
L.DefaultCombatKnockdown(100)
if(master)
master.receive_signal()
@@ -192,7 +192,7 @@ Code:
s.set_up(3, 1, L)
s.start()
L.Knockdown(100)
L.DefaultCombatKnockdown(100)
if(master)
master.receive_signal()

View File

@@ -484,7 +484,8 @@ SLIME SCANNER
set name = "Switch Verbosity"
set category = "Object"
if(usr.stat || !usr.canmove || usr.restrained())
var/mob/living/L = usr
if(!istype(L) || !CHECK_MOBILITY(L, MOBILITY_USE))
return
mode = !mode

View File

@@ -44,7 +44,7 @@ effective or pretty fucking useless.
for(var/mob/living/carbon/human/M in urange(10, user, 1))
if(prob(50))
M.Knockdown(rand(200,400))
M.DefaultCombatKnockdown(rand(200,400))
to_chat(M, "<span class='userdanger'>You feel a tremendous, paralyzing wave flood your mind.</span>")
else

View File

@@ -294,7 +294,7 @@
/obj/item/book/granter/spell/knock/recoil(mob/living/user)
..()
to_chat(user,"<span class='warning'>You're knocked down!</span>")
user.Knockdown(40)
user.DefaultCombatKnockdown(40)
/obj/item/book/granter/spell/barnyard
spell = /obj/effect/proc_holder/spell/targeted/barnyardcurse

View File

@@ -31,7 +31,7 @@
M.show_message("<span class='warning'>BANG</span>", MSG_AUDIBLE)
var/distance = get_dist(get_turf(M), source)
if(!distance || loc == M || loc == M.loc) //Stop allahu akbarring rooms with this.
M.Knockdown(200)
M.DefaultCombatKnockdown(200)
M.soundbang_act(1, 200, 10, 15)
else
M.soundbang_act(1, max(200/max(1,distance), 60), rand(0, 5))
@@ -41,4 +41,4 @@
return
var/distance = get_dist(get_turf(M), source)
if(M.flash_act(affect_silicon = 1))
M.Knockdown(max(200/max(1,distance), 60))
M.DefaultCombatKnockdown(max(200/max(1,distance), 60))

View File

@@ -349,7 +349,7 @@
C.update_inv_legcuffed()
SSblackbox.record_feedback("tally", "handcuffs", 1, type)
to_chat(C, "<span class='userdanger'>\The [src] ensnares you!</span>")
C.Knockdown(knockdown)
C.DefaultCombatKnockdown(knockdown)
/obj/item/restraints/legcuffs/bola/tactical//traitor variant
name = "reinforced bola"

View File

@@ -92,7 +92,7 @@
master.emote("scream")
master.remove_status_effect(STATUS_EFFECT_HISGRACE)
REMOVE_TRAIT(src, TRAIT_NODROP, HIS_GRACE_TRAIT)
master.Knockdown(60)
master.DefaultCombatKnockdown(60)
master.adjustBruteLoss(master.maxHealth)
playsound(master, 'sound/effects/splat.ogg', 100, 0)
else

View File

@@ -64,16 +64,16 @@
else
playsound(src, 'sound/machines/buzz-sigh.ogg', 40, 1)
/obj/item/holybeacon/proc/beacon_armor(mob/M)
/obj/item/holybeacon/proc/beacon_armor(mob/living/L)
var/list/holy_armor_list = typesof(/obj/item/storage/box/holy)
var/list/display_names = list()
for(var/V in holy_armor_list)
var/atom/A = V
display_names += list(initial(A.name) = A)
var/choice = input(M,"What holy armor kit would you like to order?","Holy Armor Theme") as null|anything in display_names
var/turf/T = get_turf(M)
if(!T || QDELETED(src) || !choice || M.stat || !in_range(M, src) || M.restrained() || !M.canmove || GLOB.holy_armor_type)
var/choice = input(L,"What holy armor kit would you like to order?","Holy Armor Theme") as null|anything in display_names
var/turf/T = get_turf(src)
if(!T || QDELETED(src) || !choice || !CHECK_MOBILITY(L, MOBILITY_USE) || !in_range(L, src) || GLOB.holy_armor_type)
return
var/index = display_names.Find(choice)
@@ -86,7 +86,7 @@
if(holy_armor_box)
qdel(src)
M.put_in_hands(holy_armor_box)
L.put_in_hands(holy_armor_box)
/obj/item/storage/box/holy
name = "Templar Kit"
@@ -244,7 +244,7 @@
if(user.mind && (user.mind.isholy) && !reskinned)
reskin_holy_weapon(user)
/obj/item/nullrod/proc/reskin_holy_weapon(mob/M)
/obj/item/nullrod/proc/reskin_holy_weapon(mob/living/L)
if(GLOB.holy_weapon_type)
return
var/obj/item/holy_weapon
@@ -255,8 +255,8 @@
if (initial(rodtype.chaplain_spawnable))
display_names[initial(rodtype.name)] = rodtype
var/choice = input(M,"What theme would you like for your holy weapon?","Holy Weapon Theme") as null|anything in display_names
if(QDELETED(src) || !choice || M.stat || !in_range(M, src) || M.restrained() || !M.canmove || reskinned)
var/choice = input(L, "What theme would you like for your holy weapon?","Holy Weapon Theme") as null|anything in display_names
if(QDELETED(src) || !choice || !in_range(L, src) || !CHECK_MOBILITY(L, MOBILITY_USE) || reskinned)
return
var/A = display_names[choice] // This needs to be on a separate var as list member access is not allowed for new
@@ -269,7 +269,7 @@
if(holy_weapon)
holy_weapon.reskinned = TRUE
qdel(src)
M.put_in_active_hand(holy_weapon)
L.put_in_active_hand(holy_weapon)
/obj/item/nullrod/proc/jedi_spin(mob/living/user)
for(var/i in list(NORTH,SOUTH,EAST,WEST,EAST,SOUTH,NORTH,SOUTH,EAST,WEST,EAST,SOUTH))
@@ -674,7 +674,7 @@
add_fingerprint(user)
if((HAS_TRAIT(user, TRAIT_CLUMSY)) && prob(50))
to_chat(user, "<span class ='warning'>You club yourself over the head with [src].</span>")
user.Knockdown(60)
user.DefaultCombatKnockdown(60)
if(ishuman(user))
var/mob/living/carbon/human/H = user
H.apply_damage(2*force, BRUTE, BODY_ZONE_HEAD)

View File

@@ -71,8 +71,7 @@
if(stimulant)
if(isliving(loc))
var/mob/living/L = loc
L.SetStun(0)
L.SetKnockdown(0)
L.SetAllImmobility(0)
L.SetSleeping(0)
L.SetUnconscious(0)
L.reagents.add_reagent(/datum/reagent/medicine/muscle_stimulant, CLAMP(5 - L.reagents.get_reagent_amount(/datum/reagent/medicine/muscle_stimulant), 0, 5)) //If you don't have legs or get bola'd, tough luck!

View File

@@ -78,7 +78,7 @@
return
if(message && imp_in.stat == CONSCIOUS)
imp_in.visible_message("<span class='warning'>[imp_in] doubles over in pain!</span>")
imp_in.Knockdown(140)
imp_in.DefaultCombatKnockdown(140)
/obj/item/implant/explosive/proc/boom_goes_the_weasel()
explosion(get_turf(imp_in ? imp_in : src), heavy, medium, weak, weak, flame_range = weak)

View File

@@ -200,7 +200,7 @@
add_fingerprint(user)
if((HAS_TRAIT(user, TRAIT_CLUMSY)) && prob(50))
to_chat(user, "<span class ='danger'>You club yourself over the head.</span>")
user.Knockdown(60 * force)
user.DefaultCombatKnockdown(60 * force)
if(ishuman(user))
var/mob/living/carbon/human/H = user
H.apply_damage(2*force, BRUTE, BODY_ZONE_HEAD)
@@ -225,7 +225,7 @@
if(check_martial_counter(H, user))
return
playsound(get_turf(src), 'sound/effects/woodhit.ogg', 75, 1, -1)
target.Knockdown(softstun_ds, TRUE, FALSE, hardstun_ds, stam_dmg)
target.DefaultCombatKnockdown(softstun_ds, TRUE, FALSE, hardstun_ds, stam_dmg)
log_combat(user, target, "stunned", src)
src.add_fingerprint(user)
target.visible_message("<span class ='danger'>[user] has knocked down [target] with [src]!</span>", \

View File

@@ -168,7 +168,7 @@
if(pressureSetting >= 3 && iscarbon(user))
var/mob/living/carbon/C = user
C.visible_message("<span class='warning'>[C] is thrown down by the force of the cannon!</span>", "<span class='userdanger'>[src] slams into your shoulder, knocking you down!")
C.Knockdown(60)
C.DefaultCombatKnockdown(60)
/obj/item/pneumatic_cannon/proc/fire_items(turf/target, mob/user)
if(fire_mode == PCANNON_FIREALL)

View File

@@ -64,8 +64,7 @@
/obj/item/banner/proc/inspiration(mob/living/carbon/human/H)
H.adjustBruteLoss(-15)
H.adjustFireLoss(-15)
H.AdjustStun(-40)
H.AdjustKnockdown(-40)
H.AdjustAllImmobility(-40)
H.AdjustUnconscious(-40)
playsound(H, 'sound/magic/staff_healing.ogg', 25, FALSE)

View File

@@ -20,7 +20,7 @@
return
user.do_attack_animation(M)
M.Knockdown(100)
M.DefaultCombatKnockdown(100)
M.apply_effect(EFFECT_STUTTER, 5)
M.visible_message("<span class='danger'>[user] has prodded [M] with [src]!</span>", \
@@ -81,8 +81,7 @@
user.visible_message("<span class='notice'>[user] hugs [M] to make [M.p_them()] feel better!</span>", \
"<span class='notice'>You hug [M] to make [M.p_them()] feel better!</span>")
if(M.resting && !M.recoveringstam)
M.resting = FALSE
M.update_canmove()
M.set_resting(FALSE, TRUE)
else
user.visible_message("<span class='notice'>[user] pets [M]!</span>", \
"<span class='notice'>You pet [M]!</span>")
@@ -100,9 +99,8 @@
else
user.visible_message("<span class='warning'>[user] hugs [M] in a firm bear-hug! [M] looks uncomfortable...</span>", \
"<span class='warning'>You hug [M] firmly to make [M.p_them()] feel better! [M] looks uncomfortable...</span>")
if(M.resting && !M.recoveringstam)
M.resting = FALSE
M.update_canmove()
if(!CHECK_MOBILITY(M, MOBILITY_STAND) && !M.recoveringstam)
M.set_resting(FALSE, TRUE)
else
user.visible_message("<span class='warning'>[user] bops [M] on the head!</span>", \
"<span class='warning'>You bop [M] on the head!</span>")
@@ -114,7 +112,6 @@
M.electrocute_act(5, "[user]", safety = 1)
user.visible_message("<span class='userdanger'>[user] electrocutes [M] with [user.p_their()] touch!</span>", \
"<span class='danger'>You electrocute [M] with your touch!</span>")
M.update_canmove()
else
if(!iscyborg(M))
M.adjustFireLoss(10)
@@ -326,7 +323,7 @@
C.stuttering += 10
C.Jitter(10)
if(2)
C.Knockdown(40)
C.DefaultCombatKnockdown(40)
C.confused += 10
C.stuttering += 15
C.Jitter(25)

View File

@@ -317,8 +317,7 @@
O.robot_suit = src
if(!locomotion)
O.lockcharge = 1
O.update_canmove()
O.SetLockdown(TRUE)
to_chat(O, "<span class='warning'>Error: Servo motors unresponsive.</span>")
else
@@ -356,8 +355,7 @@
forceMove(O)
O.robot_suit = src
if(!locomotion)
O.lockcharge = TRUE
O.update_canmove()
O.SetLockdown(TRUE)
else if(istype(W, /obj/item/pen))
to_chat(user, "<span class='warning'>You need to use a multitool to name [src]!</span>")

View File

@@ -577,7 +577,7 @@
return FALSE
R.notransform = TRUE
var/prev_lockcharge = R.lockcharge
var/prev_locked_down = R.locked_down
R.SetLockdown(1)
R.anchored = TRUE
var/datum/effect_system/smoke_spread/smoke = new
@@ -587,7 +587,7 @@
for(var/i in 1 to 4)
playsound(R, pick('sound/items/drill_use.ogg', 'sound/items/jaws_cut.ogg', 'sound/items/jaws_pry.ogg', 'sound/items/welder.ogg', 'sound/items/ratchet.ogg'), 80, 1, -1)
sleep(12)
if(!prev_lockcharge)
if(!prev_locked_down)
R.SetLockdown(0)
R.anchored = FALSE
R.notransform = FALSE

View File

@@ -246,7 +246,8 @@
set name = "Activate Seed Extraction"
set category = "Object"
set desc = "Activate to convert your plants into plantable seeds."
if(usr.stat || !usr.canmove || usr.restrained())
var/mob/living/L = usr
if(istype(L) && !CHECK_MOBILITY(L, MOBILITY_USE))
return
for(var/obj/item/O in contents)
seedify(O, 1)
@@ -353,7 +354,7 @@
if(ishuman(M) || ismonkey(M))
if(prob(10))
M.Knockdown(40)
M.DefaultCombatKnockdown(40)
update_icon()
/obj/item/storage/bag/tray/update_overlays()

View File

@@ -191,7 +191,7 @@
if(!disarming)
if(knockdown)
L.Knockdown(50, override_stamdmg = 0) //knockdown
L.DefaultCombatKnockdown(50, override_stamdmg = 0) //knockdown
L.adjustStaminaLoss(stunpwr)
else
L.drop_all_held_items() //no knockdown/stamina damage, instead disarm.
@@ -218,7 +218,7 @@
user.visible_message("<span class='danger'>[user] accidentally hits [user.p_them()]self with [src]!</span>", \
"<span class='userdanger'>You accidentally hit yourself with [src]!</span>")
SEND_SIGNAL(user, COMSIG_LIVING_MINOR_SHOCK)
user.Knockdown(stamforce*6)
user.DefaultCombatKnockdown(stamforce*6)
playsound(loc, 'sound/weapons/egloves.ogg', 50, 1, -1)
deductcharge(hitcost)

View File

@@ -16,7 +16,7 @@
user.visible_message("<span class='danger'>[user] accidentally hits [user.p_them()]self with [src]!</span>", \
"<span class='userdanger'>You accidentally hit yourself with [src]!</span>")
SEND_SIGNAL(user, COMSIG_LIVING_MINOR_SHOCK)
user.Knockdown(stamforce * 6)
user.DefaultCombatKnockdown(stamforce * 6)
playsound(loc, 'sound/weapons/egloves.ogg', 50, 1, -1)
if(do_teleport(user, get_turf(user), 50, channel = TELEPORT_CHANNEL_BLUESPACE))
deductcharge(hitcost)

View File

@@ -1078,8 +1078,13 @@
else
return ..()
/obj/item/toy/cards/singlecard/attack_self(mob/user)
if(usr.stat || !ishuman(usr) || !usr.canmove || usr.restrained())
/obj/item/toy/cards/singlecard/attack_self(mob/living/user)
. = ..()
if(.)
return
if(!ishuman(user))
return
if(!CHECK_MOBILITY(user, MOBILITY_USE))
return
Flip()

View File

@@ -33,7 +33,7 @@
if(structureclimber && structureclimber != user)
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src)
structureclimber.Knockdown(40)
structureclimber.DefaultCombatKnockdown(40)
structureclimber.visible_message("<span class='warning'>[structureclimber] has been knocked off [src].", "You're knocked off [src]!", "You see [structureclimber] get knocked off [src].</span>")
/obj/structure/ui_act(action, params)
@@ -45,7 +45,8 @@
if(!climbable)
return
if(user == O && iscarbon(O))
if(user.canmove)
var/mob/living/L = O
if(CHECK_MOBILITY(L, MOBILITY_MOVE))
climb_structure(user)
return
if(!istype(O, /obj/item) || user.get_active_held_item() != O)

View File

@@ -110,7 +110,7 @@
user.visible_message("<span class='notice'>[user] pulls [src] out from under [poordude].</span>", "<span class='notice'>You pull [src] out from under [poordude].</span>")
var/C = new item_chair(loc)
user.put_in_hands(C)
poordude.Knockdown(20)//rip in peace
poordude.DefaultCombatKnockdown(20)//rip in peace
user.adjustStaminaLoss(5)
unbuckle_all_mobs(TRUE)
qdel(src)
@@ -377,7 +377,7 @@
if(iscarbon(target))
var/mob/living/carbon/C = target
if(C.health < C.maxHealth*0.5)
C.Knockdown(20)
C.DefaultCombatKnockdown(20)
smash(user)
/obj/item/chair/greyscale

View File

@@ -431,7 +431,7 @@
"<span class='italics'>You hear a loud metal bang.</span>")
var/mob/living/L = O
if(!issilicon(L))
L.Knockdown(40)
L.DefaultCombatKnockdown(40)
O.forceMove(T)
close()
else
@@ -474,8 +474,9 @@
set category = "Object"
set name = "Toggle Open"
if(!usr.canmove || usr.stat || usr.restrained())
return
var/mob/living/L = usr
if(!istype(L) || !CHECK_MOBILITY(L, MOBILITY_USE))
return FALSE
if(iscarbon(usr) || issilicon(usr) || isdrone(usr))
return attack_hand(usr)
@@ -510,7 +511,7 @@
user.visible_message("<span class='warning'>[src] begins to shake violently!</span>", \
"<span class='notice'>You lean on the back of [src] and start pushing the door open... (this will take about [DisplayTimeText(breakout_time)].)</span>", \
"<span class='italics'>You hear banging from [src].</span>")
if(do_after(user,(breakout_time), target = src))
if(do_after(user,(breakout_time), target = src, required_mobility_flags = MOBILITY_RESIST))
if(!user || user.stat != CONSCIOUS || user.loc != src || opened || (!locked && !welded) )
return
//we check after a while whether there is a point of resisting anymore and whether the user is capable of resisting
@@ -603,12 +604,12 @@
step_towards(user, T2)
T1 = get_turf(user)
if(T1 == T2)
user.resting = TRUE //so people can jump into crates without slamming the lid on their head
user.set_resting(TRUE, TRUE)
if(!close(user))
to_chat(user, "<span class='warning'>You can't get [src] to close!</span>")
user.resting = FALSE
user.set_resting(FALSE, TRUE)
return
user.resting = FALSE
user.set_resting(FALSE, TRUE)
togglelock(user)
T1.visible_message("<span class='warning'>[user] dives into [src]!</span>")

View File

@@ -18,8 +18,8 @@
var/egged = 0
var/use_mob_movespeed = FALSE //Citadel adds snowflake box handling
/obj/structure/closet/cardboard/relaymove(mob/user, direction)
if(opened || move_delay || user.stat || user.IsStun() || user.IsKnockdown() || user.IsUnconscious() || !isturf(loc) || !has_gravity(loc))
/obj/structure/closet/cardboard/relaymove(mob/living/user, direction)
if(opened || move_delay || !CHECK_MOBILITY(user, MOBILITY_MOVE) || !isturf(loc) || !has_gravity(loc))
return
move_delay = TRUE
var/oldloc = loc

View File

@@ -139,7 +139,7 @@
src.visible_message(text("<span class='danger'>[M] falls free of [src]!</span>"))
unbuckle_mob(M,force=1)
M.emote("scream")
M.AdjustKnockdown(20)
M.DefaultCombatKnockdown(20)
/obj/structure/kitchenspike/Destroy()
if(has_buckled_mobs())

View File

@@ -82,7 +82,7 @@
/datum/song/proc/shouldStopPlaying(mob/user)
if(instrumentObj)
if(!user.canUseTopic(instrumentObj))
if(!user.canUseTopic(instrumentObj, TRUE, FALSE, FALSE, FALSE))
return TRUE
return !instrumentObj.anchored // add special cases to stop in subclasses
else
@@ -220,7 +220,7 @@
updateDialog(usr) // make sure updates when complete
/datum/song/Topic(href, href_list)
if(!usr.canUseTopic(instrumentObj))
if(!usr.canUseTopic(instrumentObj, TRUE, FALSE, FALSE, FALSE))
usr << browse(null, "window=instrument")
usr.unset_machine()
return

View File

@@ -49,7 +49,7 @@
if(S.mind)
if(petrified_mob)
S.mind.transfer_to(petrified_mob)
petrified_mob.Knockdown(100)
petrified_mob.DefaultCombatKnockdown(100)
to_chat(petrified_mob, "<span class='notice'>You slowly come back to your senses. You are in control of yourself again!</span>")
qdel(S)

View File

@@ -109,8 +109,7 @@
/obj/structure/table/proc/tableplace(mob/living/user, mob/living/pushed_mob)
pushed_mob.forceMove(src.loc)
pushed_mob.resting = TRUE
pushed_mob.update_canmove()
pushed_mob.set_resting(TRUE, FALSE)
pushed_mob.visible_message("<span class='notice'>[user] places [pushed_mob] onto [src].</span>", \
"<span class='notice'>[user] places [pushed_mob] onto [src].</span>")
log_combat(user, pushed_mob, "placed")
@@ -128,7 +127,7 @@
pushed_mob.pass_flags &= ~PASSTABLE
if(pushed_mob.loc != loc) //Something prevented the tabling
return
pushed_mob.Knockdown(40)
pushed_mob.DefaultCombatKnockdown(40)
pushed_mob.visible_message("<span class='danger'>[user] slams [pushed_mob] onto [src]!</span>", \
"<span class='userdanger'>[user] slams you onto [src]!</span>")
log_combat(user, pushed_mob, "tabled", null, "onto [src]")
@@ -138,11 +137,11 @@
SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "table", /datum/mood_event/table)
/obj/structure/table/shove_act(mob/living/target, mob/living/user)
if(!target.resting)
target.Knockdown(SHOVE_KNOCKDOWN_TABLE)
if(CHECK_MOBILITY(target, MOBILITY_STAND))
target.DefaultCombatKnockdown(SHOVE_KNOCKDOWN_TABLE)
user.visible_message("<span class='danger'>[user.name] shoves [target.name] onto \the [src]!</span>",
"<span class='danger'>You shove [target.name] onto \the [src]!</span>", null, COMBAT_MESSAGE_RANGE)
target.forceMove(src.loc)
target.forceMove(loc)
log_combat(user, target, "shoved", "onto [src] (table)")
return TRUE
@@ -270,7 +269,7 @@
debris -= AM
if(istype(AM, /obj/item/shard))
AM.throw_impact(L)
L.Knockdown(100)
L.DefaultCombatKnockdown(100)
qdel(src)
/obj/structure/table/glass/deconstruct(disassembled = TRUE, wrench_disassembly = 0)
@@ -568,23 +567,20 @@
break
/obj/structure/table/optable/tablepush(mob/living/user, mob/living/pushed_mob)
pushed_mob.forceMove(src.loc)
pushed_mob.resting = 1
pushed_mob.update_canmove()
pushed_mob.forceMove(loc)
pushed_mob.set_resting(TRUE, TRUE)
visible_message("<span class='notice'>[user] has laid [pushed_mob] on [src].</span>")
check_patient()
/obj/structure/table/optable/proc/check_patient()
var/mob/M = locate(/mob/living/carbon/human, loc)
if(M)
if(M.resting)
patient = M
return 1
var/mob/living/carbon/human/H = locate() in loc
if(H)
if(!CHECK_MOBILITY(H, MOBILITY_STAND))
patient = H
return TRUE
else
patient = null
return 0
return FALSE
/*
* Racks
@@ -644,7 +640,7 @@
. = ..()
if(.)
return
if(user.IsKnockdown() || user.resting || user.lying || user.get_num_legs() < 2)
if(CHECK_MULTIPLE_BITFIELDS(user.mobility_flags, MOBILITY_STAND|MOBILITY_MOVE) || user.get_num_legs() < 2)
return
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src, ATTACK_EFFECT_KICK)

View File

@@ -43,10 +43,10 @@
//pod insertion
/obj/structure/transit_tube/station/MouseDrop_T(obj/structure/c_transit_tube_pod/R, mob/user)
if(!user.canmove || user.stat || user.restrained())
/obj/structure/transit_tube/station/MouseDrop_T(obj/structure/c_transit_tube_pod/R, mob/living/user)
if(!istype(user) || !CHECK_MOBILITY(user, MOBILITY_USE))
return
if (!istype(R) || get_dist(user, src) > 1 || get_dist(src,R) > 1)
if(!istype(R) || get_dist(user, src) > 1 || get_dist(src,R) > 1)
return
for(var/obj/structure/transit_tube_pod/pod in loc)
return //no fun allowed
@@ -74,7 +74,7 @@
pod.visible_message("<span class='warning'>[user] starts putting [GM] into the [pod]!</span>")
if(do_after(user, 15, target = src))
if(open_status == STATION_TUBE_OPEN && GM && user.grab_state >= GRAB_AGGRESSIVE && user.pulling == GM && !GM.buckled && !GM.has_buckled_mobs())
GM.Knockdown(100)
GM.DefaultCombatKnockdown(100)
src.Bumped(GM)
break
else

View File

@@ -83,7 +83,7 @@
/obj/structure/trap/stun/trap_effect(mob/living/L)
L.electrocute_act(30, src, safety=1) // electrocute act does a message.
L.Knockdown(100)
L.DefaultCombatKnockdown(100)
/obj/structure/trap/fire
name = "flame trap"
@@ -92,7 +92,7 @@
/obj/structure/trap/fire/trap_effect(mob/living/L)
to_chat(L, "<span class='danger'><B>Spontaneous combustion!</B></span>")
L.Knockdown(20)
L.DefaultCombatKnockdown(20)
/obj/structure/trap/fire/flare()
..()
@@ -106,7 +106,7 @@
/obj/structure/trap/chill/trap_effect(mob/living/L)
to_chat(L, "<span class='danger'><B>You're frozen solid!</B></span>")
L.Knockdown(20)
L.DefaultCombatKnockdown(20)
L.adjust_bodytemperature(-300)
L.apply_status_effect(/datum/status_effect/freon)
@@ -119,7 +119,7 @@
/obj/structure/trap/damage/trap_effect(mob/living/L)
to_chat(L, "<span class='danger'><B>The ground quakes beneath your feet!</B></span>")
L.Knockdown(100)
L.DefaultCombatKnockdown(100)
L.adjustBruteLoss(35)
/obj/structure/trap/damage/flare()
@@ -147,7 +147,7 @@
/obj/structure/trap/cult/trap_effect(mob/living/L)
to_chat(L, "<span class='danger'><B>With a crack, the hostile constructs come out of hiding, stunning you!</B></span>")
L.electrocute_act(10, src, safety = TRUE) // electrocute act does a message.
L.Knockdown(20)
L.DefaultCombatKnockdown(20)
new /mob/living/simple_animal/hostile/construct/proteon/hostile(loc)
new /mob/living/simple_animal/hostile/construct/proteon/hostile(loc)
QDEL_IN(src, 30)
QDEL_IN(src, 30)

View File

@@ -529,7 +529,7 @@
if(B.cell.charge > 0 && B.status == 1)
flick("baton_active", src)
var/stunforce = B.stamforce
user.Knockdown(stunforce * 2)
user.DefaultCombatKnockdown(stunforce * 2)
user.stuttering = stunforce/20
B.deductcharge(B.hitcost)
user.visible_message("<span class='warning'>[user] shocks [user.p_them()]self while attempting to wash the active [B.name]!</span>", \

View File

@@ -343,7 +343,8 @@
set name = "Flip Windoor Assembly"
set category = "Object"
set src in oview(1)
if(usr.stat || !usr.canmove || usr.restrained())
var/mob/living/L = usr
if(!CHECK_MOBILITY(L, MOBILITY_PULL))
return
if(facing == "l")
@@ -354,4 +355,3 @@
to_chat(usr, "<span class='notice'>The windoor will now slide to the left.</span>")
update_icon()
return

View File

@@ -272,7 +272,7 @@
var/olddir = C.dir
if(!(lube & SLIDE_ICE))
C.Knockdown(knockdown_amount)
C.DefaultCombatKnockdown(knockdown_amount)
C.stop_pulling()
else
C.Stun(20)

View File

@@ -21,6 +21,6 @@
target.gib(1, 1)
else
target.adjustBruteLoss(min(99,(target.health - 1)))
target.Knockdown(400)
target.DefaultCombatKnockdown(400)
target.stuttering = 20

View File

@@ -47,7 +47,7 @@
"emagged" = borg.emagged,
"active_module" = "[borg.module.type]",
"lawupdate" = borg.lawupdate,
"lockdown" = borg.lockcharge,
"lockdown" = borg.locked_down,
"scrambledcodes" = borg.scrambledcodes
)
.["upgrades"] = list()
@@ -122,8 +122,8 @@
message_admins("[key_name_admin(user)] disabled lawsync on [ADMIN_LOOKUPFLW(borg)].")
log_admin("[key_name(user)] disabled lawsync on [key_name(borg)].")
if ("toggle_lockdown")
borg.SetLockdown(!borg.lockcharge)
if (borg.lockcharge)
borg.SetLockdown(!borg.locked_down)
if (borg.locked_down)
message_admins("[key_name_admin(user)] locked down [ADMIN_LOOKUPFLW(borg)].")
log_admin("[key_name(user)] locked down [key_name(borg)].")
else

View File

@@ -116,14 +116,13 @@
var/mob/living/carbon/human/M = loc
M.adjustStaminaLoss(-75)
M.SetUnconscious(0)
M.SetStun(0)
M.SetKnockdown(0)
M.SetAllImmobility(0)
combat_cooldown = 0
START_PROCESSING(SSobj, src)
/obj/item/clothing/suit/armor/abductor/vest/process()
combat_cooldown++
if(combat_cooldown==initial(combat_cooldown))
if(combat_cooldown == initial(combat_cooldown))
STOP_PROCESSING(SSobj, src)
/obj/item/clothing/suit/armor/abductor/Destroy()
@@ -512,7 +511,7 @@
L.lastattackerckey = user.ckey
L.adjustStaminaLoss(35) //because previously it took 5-6 hits to actually "incapacitate" someone for the purposes of the sleep inducement
L.Knockdown(140)
L.DefaultCombatKnockdown(140)
L.apply_effect(EFFECT_STUTTER, 7)
SEND_SIGNAL(L, COMSIG_LIVING_MINOR_SHOCK)

View File

@@ -96,7 +96,7 @@
// Incap?
if(must_be_capacitated)
var/mob/living/L = owner
if (L.incapacitated(TRUE, TRUE) || L.resting && !can_be_immobilized)
if (L.incapacitated(TRUE, TRUE) || !CHECK_MOBILITY(L, MOBILITY_STAND) && !can_be_immobilized)
if(display_error)
to_chat(owner, "<span class='warning'>Not while you're incapacitated!</span>")
return FALSE

View File

@@ -1,9 +1,5 @@
// organ_internal.dm -- /obj/item/organ
// Do I have a stake in my heart?
/mob/living/AmStaked()
var/obj/item/bodypart/BP = get_bodypart("chest")
@@ -13,16 +9,14 @@
if (istype(I,/obj/item/stake/))
return TRUE
return FALSE
/mob/proc/AmStaked()
return FALSE
/mob/living/proc/StakeCanKillMe()
return IsSleeping() || stat >= UNCONSCIOUS || blood_volume <= 0 || HAS_TRAIT(src, TRAIT_DEATHCOMA) // NOTE: You can't go to sleep in a coffin with a stake in you.
///obj/item/weapon/melee/stake
/obj/item/stake/
/obj/item/stake
name = "wooden stake"
desc = "A simple wooden stake carved to a sharp point."
icon = 'icons/obj/items_and_weapons.dmi'
@@ -112,8 +106,7 @@
// Can this target be staked? If someone stands up before this is complete, it fails. Best used on someone stationary.
/mob/living/carbon/proc/can_be_staked()
//return resting || IsKnockdown() || IsUnconscious() || (stat && (stat != SOFT_CRIT || pulledby)) || (has_trait(TRAIT_FAKEDEATH)) || resting || IsStun() || IsFrozen() || (pulledby && pulledby.grab_state >= GRAB_NECK)
return (resting || lying || IsUnconscious() || pulledby && pulledby.grab_state >= GRAB_NECK)
return !CHECK_MOBILITY(src, MOBILITY_STAND)
// ABOVE: Taken from update_mobility() in living.dm
/obj/item/stake/hardened

Some files were not shown because too many files have changed in this diff Show More