mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 16:18:01 +01:00
[MIRROR] Moblity refactor: hands blocked and restrained edition. (#1051)
* Moblity refactor: hands blocked and restrained edition. * Update carbon_defense.dm * Update emotes.dm Co-authored-by: Rohesie <rohesie@gmail.com> Co-authored-by: Azarak <azarak10@gmail.com>
This commit is contained in:
co-authored by
Rohesie
Azarak
parent
bf45bab485
commit
9be3a7b8f6
@@ -35,7 +35,7 @@
|
||||
/datum/emote/flip
|
||||
key = "flip"
|
||||
key_third_person = "flips"
|
||||
restraint_check = TRUE
|
||||
hands_use_check = TRUE
|
||||
mob_type_allowed_typecache = list(/mob/living, /mob/dead/observer)
|
||||
mob_type_ignore_stat_typecache = list(/mob/dead/observer)
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
/datum/emote/spin
|
||||
key = "spin"
|
||||
key_third_person = "spins"
|
||||
restraint_check = TRUE
|
||||
hands_use_check = TRUE
|
||||
mob_type_allowed_typecache = list(/mob/living, /mob/dead/observer)
|
||||
mob_type_ignore_stat_typecache = list(/mob/dead/observer)
|
||||
|
||||
|
||||
@@ -31,8 +31,6 @@
|
||||
. = ..()
|
||||
AddComponent(/datum/component/footstep, FOOTSTEP_MOB_CLAW, 0.5, -3)
|
||||
|
||||
/mob/living/carbon/alien/humanoid/restrained(ignore_grab)
|
||||
return handcuffed
|
||||
|
||||
/mob/living/carbon/alien/humanoid/show_inv(mob/user)
|
||||
user.set_machine(src)
|
||||
|
||||
@@ -59,8 +59,6 @@
|
||||
/mob/living/carbon/alien/larva/attack_ui(slot_id)
|
||||
return
|
||||
|
||||
/mob/living/carbon/alien/larva/restrained(ignore_grab)
|
||||
. = 0
|
||||
|
||||
// new damage icon system
|
||||
// now constructs damage icon for each organ from mask * damage field
|
||||
|
||||
@@ -173,9 +173,6 @@
|
||||
newtonian_move(get_dir(target, src))
|
||||
thrown_thing.safe_throw_at(target, thrown_thing.throw_range, thrown_thing.throw_speed + power_throw, src, null, null, null, move_force)
|
||||
|
||||
/mob/living/carbon/restrained(ignore_grab)
|
||||
. = (handcuffed || (!ignore_grab && pulledby && pulledby.grab_state >= GRAB_AGGRESSIVE))
|
||||
|
||||
|
||||
/mob/living/carbon/proc/canBeHandcuffed()
|
||||
return FALSE
|
||||
@@ -269,7 +266,7 @@
|
||||
return FALSE
|
||||
|
||||
/mob/living/carbon/resist_buckle()
|
||||
if(restrained())
|
||||
if(HAS_TRAIT(src, TRAIT_RESTRAINED))
|
||||
changeNext_move(CLICK_CD_BREAKOUT)
|
||||
last_special = world.time + CLICK_CD_BREAKOUT
|
||||
var/buckle_cd = 600
|
||||
@@ -350,7 +347,7 @@
|
||||
/mob/living/carbon/proc/uncuff()
|
||||
if (handcuffed)
|
||||
var/obj/item/W = handcuffed
|
||||
handcuffed = null
|
||||
set_handcuffed(null)
|
||||
if (buckled && buckled.buckle_requires_restraints)
|
||||
buckled.unbuckle_mob(src)
|
||||
update_handcuffed()
|
||||
@@ -394,7 +391,7 @@
|
||||
else
|
||||
if(I == handcuffed)
|
||||
handcuffed.forceMove(drop_location())
|
||||
handcuffed = null
|
||||
set_handcuffed(null)
|
||||
I.dropped(src)
|
||||
if(buckled && buckled.buckle_requires_restraints)
|
||||
buckled.unbuckle_mob(src)
|
||||
@@ -880,7 +877,7 @@
|
||||
suiciding = FALSE
|
||||
regenerate_limbs()
|
||||
regenerate_organs()
|
||||
handcuffed = initial(handcuffed)
|
||||
set_handcuffed(null)
|
||||
for(var/obj/item/restraints/R in contents) //actually remove cuffs from inventory
|
||||
qdel(R)
|
||||
update_handcuffed()
|
||||
@@ -1278,3 +1275,18 @@
|
||||
return
|
||||
|
||||
brain.update_skillchips()
|
||||
|
||||
|
||||
/// Modifies the handcuffed value if a different value is passed, returning FALSE otherwise. The variable should only be changed through this proc.
|
||||
/mob/living/carbon/proc/set_handcuffed(new_value)
|
||||
if(handcuffed == new_value)
|
||||
return FALSE
|
||||
. = handcuffed
|
||||
handcuffed = new_value
|
||||
if(.)
|
||||
if(!handcuffed)
|
||||
REMOVE_TRAIT(src, TRAIT_RESTRAINED, HANDCUFFED_TRAIT)
|
||||
REMOVE_TRAIT(src, TRAIT_HANDS_BLOCKED, HANDCUFFED_TRAIT)
|
||||
else if(handcuffed)
|
||||
ADD_TRAIT(src, TRAIT_RESTRAINED, HANDCUFFED_TRAIT)
|
||||
ADD_TRAIT(src, TRAIT_HANDS_BLOCKED, HANDCUFFED_TRAIT)
|
||||
|
||||
@@ -50,9 +50,7 @@
|
||||
return
|
||||
if(get_active_held_item())
|
||||
return
|
||||
if(!(mobility_flags & MOBILITY_MOVE))
|
||||
return
|
||||
if(restrained())
|
||||
if(HAS_TRAIT(src, TRAIT_HANDS_BLOCKED))
|
||||
return
|
||||
return TRUE
|
||||
|
||||
|
||||
@@ -51,9 +51,11 @@
|
||||
if(isnull(.))
|
||||
return
|
||||
if(. == 0)
|
||||
REMOVE_TRAIT(src, TRAIT_HANDS_BLOCKED, LACKING_MANIPULATION_APPENDAGES_TRAIT)
|
||||
if(usable_hands != 0) //From having no usable hands to having some.
|
||||
REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, LACKING_LOCOMOTION_APPENDAGES_TRAIT)
|
||||
else if(usable_hands == 0) //From having usable hands to no longer having them.
|
||||
else if(usable_hands == 0 && default_num_hands > 0) //From having usable hands to no longer having them.
|
||||
ADD_TRAIT(src, TRAIT_HANDS_BLOCKED, LACKING_MANIPULATION_APPENDAGES_TRAIT)
|
||||
if(!usable_legs && !(movement_type & (FLYING | FLOATING)))
|
||||
ADD_TRAIT(src, TRAIT_IMMOBILIZED, LACKING_LOCOMOTION_APPENDAGES_TRAIT)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/datum/emote/living/carbon/airguitar
|
||||
key = "airguitar"
|
||||
message = "is strumming the air and headbanging like a safari chimp."
|
||||
restraint_check = TRUE
|
||||
hands_use_check = TRUE
|
||||
|
||||
/datum/emote/living/carbon/blink
|
||||
key = "blink"
|
||||
@@ -20,7 +20,7 @@
|
||||
key_third_person = "claps"
|
||||
message = "claps."
|
||||
muzzle_ignore = TRUE
|
||||
restraint_check = TRUE
|
||||
hands_use_check = TRUE
|
||||
emote_type = EMOTE_AUDIBLE
|
||||
vary = TRUE
|
||||
|
||||
@@ -64,14 +64,14 @@
|
||||
key_third_person = "rolls"
|
||||
message = "rolls."
|
||||
mob_type_allowed_typecache = list(/mob/living/carbon/monkey, /mob/living/carbon/alien)
|
||||
restraint_check = TRUE
|
||||
hands_use_check = TRUE
|
||||
|
||||
/datum/emote/living/carbon/scratch
|
||||
key = "scratch"
|
||||
key_third_person = "scratches"
|
||||
message = "scratches."
|
||||
mob_type_allowed_typecache = list(/mob/living/carbon/monkey, /mob/living/carbon/alien)
|
||||
restraint_check = TRUE
|
||||
hands_use_check = TRUE
|
||||
|
||||
/datum/emote/living/carbon/screech
|
||||
key = "screech"
|
||||
@@ -84,7 +84,7 @@
|
||||
key_third_person = "signs"
|
||||
message_param = "signs the number %t."
|
||||
mob_type_allowed_typecache = list(/mob/living/carbon/monkey, /mob/living/carbon/alien)
|
||||
restraint_check = TRUE
|
||||
hands_use_check = TRUE
|
||||
|
||||
/datum/emote/living/carbon/sign/select_param(mob/user, params)
|
||||
. = ..()
|
||||
@@ -96,7 +96,7 @@
|
||||
key_third_person = "signals"
|
||||
message_param = "raises %t fingers."
|
||||
mob_type_allowed_typecache = list(/mob/living/carbon/human)
|
||||
restraint_check = TRUE
|
||||
hands_use_check = TRUE
|
||||
|
||||
/datum/emote/living/carbon/tail
|
||||
key = "tail"
|
||||
@@ -111,7 +111,7 @@
|
||||
/datum/emote/living/carbon/circle
|
||||
key = "circle"
|
||||
key_third_person = "circles"
|
||||
restraint_check = TRUE
|
||||
hands_use_check = TRUE
|
||||
|
||||
/datum/emote/living/carbon/circle/run_emote(mob/user, params, type_override, intentional)
|
||||
. = ..()
|
||||
@@ -125,7 +125,7 @@
|
||||
/datum/emote/living/carbon/slap
|
||||
key = "slap"
|
||||
key_third_person = "slaps"
|
||||
restraint_check = TRUE
|
||||
hands_use_check = TRUE
|
||||
|
||||
/datum/emote/living/carbon/slap/run_emote(mob/user, params, type_override, intentional)
|
||||
. = ..()
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
key_third_person = "daps"
|
||||
message = "sadly can't find anybody to give daps to, and daps themself. Shameful."
|
||||
message_param = "give daps to %t."
|
||||
restraint_check = TRUE
|
||||
hands_use_check = TRUE
|
||||
|
||||
/datum/emote/living/carbon/human/eyebrow
|
||||
key = "eyebrow"
|
||||
@@ -28,7 +28,7 @@
|
||||
key = "handshake"
|
||||
message = "shakes their own hands."
|
||||
message_param = "shakes hands with %t."
|
||||
restraint_check = TRUE
|
||||
hands_use_check = TRUE
|
||||
emote_type = EMOTE_AUDIBLE
|
||||
|
||||
/datum/emote/living/carbon/human/hug
|
||||
@@ -36,7 +36,7 @@
|
||||
key_third_person = "hugs"
|
||||
message = "hugs themself."
|
||||
message_param = "hugs %t."
|
||||
restraint_check = TRUE
|
||||
hands_use_check = TRUE
|
||||
emote_type = EMOTE_AUDIBLE
|
||||
|
||||
/datum/emote/living/carbon/human/mumble
|
||||
@@ -78,14 +78,14 @@
|
||||
key = "raise"
|
||||
key_third_person = "raises"
|
||||
message = "raises a hand."
|
||||
restraint_check = TRUE
|
||||
hands_use_check = TRUE
|
||||
|
||||
/datum/emote/living/carbon/human/salute
|
||||
key = "salute"
|
||||
key_third_person = "salutes"
|
||||
message = "salutes."
|
||||
message_param = "salutes to %t."
|
||||
restraint_check = TRUE
|
||||
hands_use_check = TRUE
|
||||
|
||||
/datum/emote/living/carbon/human/shrug
|
||||
key = "shrug"
|
||||
|
||||
@@ -660,10 +660,6 @@
|
||||
|
||||
..()
|
||||
|
||||
/mob/living/carbon/human/RestrainedClickOn(atom/A)
|
||||
. = ..()
|
||||
if(src == A)
|
||||
check_self_for_injuries()
|
||||
|
||||
/mob/living/carbon/human/check_self_for_injuries()
|
||||
if(stat >= UNCONSCIOUS)
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
|
||||
/mob/living/carbon/human/restrained(ignore_grab)
|
||||
. = ((wear_suit && wear_suit.breakouttime) || ..())
|
||||
|
||||
|
||||
/mob/living/carbon/human/canBeHandcuffed()
|
||||
if(num_hands < 2)
|
||||
return FALSE
|
||||
|
||||
@@ -148,6 +148,8 @@
|
||||
if(I.flags_inv & HIDEJUMPSUIT)
|
||||
update_inv_w_uniform()
|
||||
if(wear_suit.breakouttime) //when equipping a straightjacket
|
||||
ADD_TRAIT(src, TRAIT_RESTRAINED, SUIT_TRAIT)
|
||||
ADD_TRAIT(src, TRAIT_HANDS_BLOCKED, SUIT_TRAIT)
|
||||
stop_pulling() //can't pull if restrained
|
||||
update_action_buttons_icon() //certain action buttons will no longer be usable.
|
||||
update_inv_wear_suit()
|
||||
@@ -203,6 +205,8 @@
|
||||
if(s_store && invdrop)
|
||||
dropItemToGround(s_store, TRUE) //It makes no sense for your suit storage to stay on you if you drop your suit.
|
||||
if(wear_suit.breakouttime) //when unequipping a straightjacket
|
||||
REMOVE_TRAIT(src, TRAIT_RESTRAINED, SUIT_TRAIT)
|
||||
REMOVE_TRAIT(src, TRAIT_HANDS_BLOCKED, SUIT_TRAIT)
|
||||
drop_all_held_items() //suit is restraining
|
||||
update_action_buttons_icon() //certain action buttons may be usable again.
|
||||
wear_suit = null
|
||||
|
||||
@@ -1971,7 +1971,7 @@ GLOBAL_LIST_EMPTY(roundstart_races)
|
||||
|
||||
/datum/action/innate/flight
|
||||
name = "Toggle Flight"
|
||||
check_flags = AB_CHECK_CONSCIOUS|AB_CHECK_STUN
|
||||
check_flags = AB_CHECK_CONSCIOUS|AB_CHECK_IMMOBILE
|
||||
icon_icon = 'icons/mob/actions/actions_items.dmi'
|
||||
button_icon_state = "flight"
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
wear_neck = I
|
||||
update_inv_neck(I)
|
||||
if(ITEM_SLOT_HANDCUFFED)
|
||||
handcuffed = I
|
||||
set_handcuffed(I)
|
||||
update_handcuffed()
|
||||
if(ITEM_SLOT_LEGCUFFED)
|
||||
legcuffed = I
|
||||
@@ -125,7 +125,7 @@
|
||||
if(!QDELETED(src))
|
||||
update_inv_neck(I)
|
||||
else if(I == handcuffed)
|
||||
handcuffed = null
|
||||
set_handcuffed(null)
|
||||
if(buckled && buckled.buckle_requires_restraints)
|
||||
buckled.unbuckle_mob(src)
|
||||
if(!QDELETED(src))
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
|
||||
/mob/living/carbon/monkey/proc/handle_combat()
|
||||
if(pickupTarget)
|
||||
if(IsDeadOrIncap() || restrained() || blacklistItems[pickupTarget] || HAS_TRAIT(pickupTarget, TRAIT_NODROP))
|
||||
if(HAS_TRAIT(src, TRAIT_HANDS_BLOCKED) || IsDeadOrIncap() || blacklistItems[pickupTarget] || HAS_TRAIT(pickupTarget, TRAIT_NODROP))
|
||||
pickupTarget = null
|
||||
else
|
||||
pickupTimer++
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
if(!client)
|
||||
if(stat == CONSCIOUS)
|
||||
if(on_fire || buckled || restrained())
|
||||
if(on_fire || buckled || HAS_TRAIT(src, TRAIT_RESTRAINED) || (pulledby && pulledby.grab_state > GRAB_PASSIVE))
|
||||
if(!resisting && prob(MONKEY_RESIST_PROB))
|
||||
resisting = TRUE
|
||||
walk_to(src,0)
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
key_third_person = "bows"
|
||||
message = "bows."
|
||||
message_param = "bows to %t."
|
||||
restraint_check = TRUE
|
||||
hands_use_check = TRUE
|
||||
|
||||
/datum/emote/living/burp
|
||||
key = "burp"
|
||||
@@ -32,7 +32,7 @@
|
||||
key = "cross"
|
||||
key_third_person = "crosses"
|
||||
message = "crosses their arms."
|
||||
restraint_check = TRUE
|
||||
hands_use_check = TRUE
|
||||
|
||||
/datum/emote/living/chuckle
|
||||
key = "chuckle"
|
||||
@@ -67,7 +67,7 @@
|
||||
key = "dance"
|
||||
key_third_person = "dances"
|
||||
message = "dances around happily."
|
||||
restraint_check = TRUE
|
||||
hands_use_check = TRUE
|
||||
|
||||
/datum/emote/living/deathgasp
|
||||
key = "deathgasp"
|
||||
@@ -116,7 +116,7 @@
|
||||
key = "flap"
|
||||
key_third_person = "flaps"
|
||||
message = "flaps their wings."
|
||||
restraint_check = TRUE
|
||||
hands_use_check = TRUE
|
||||
var/wing_time = 20
|
||||
|
||||
/datum/emote/living/flap/run_emote(mob/user, params, type_override, intentional)
|
||||
@@ -136,7 +136,7 @@
|
||||
key = "aflap"
|
||||
key_third_person = "aflaps"
|
||||
message = "flaps their wings ANGRILY!"
|
||||
restraint_check = TRUE
|
||||
hands_use_check = TRUE
|
||||
wing_time = 10
|
||||
|
||||
/datum/emote/living/frown
|
||||
@@ -191,7 +191,7 @@
|
||||
key = "jump"
|
||||
key_third_person = "jumps"
|
||||
message = "jumps!"
|
||||
restraint_check = TRUE
|
||||
hands_use_check = TRUE
|
||||
|
||||
/datum/emote/living/kiss
|
||||
key = "kiss"
|
||||
@@ -240,7 +240,7 @@
|
||||
key_third_person = "points"
|
||||
message = "points."
|
||||
message_param = "points at %t."
|
||||
restraint_check = TRUE
|
||||
hands_use_check = TRUE
|
||||
|
||||
/datum/emote/living/point/run_emote(mob/user, params, type_override, intentional)
|
||||
message_param = initial(message_param) // reset
|
||||
|
||||
@@ -6,6 +6,12 @@
|
||||
RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_DEATHCOMA), .proc/on_deathcoma_trait_gain)
|
||||
RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_DEATHCOMA), .proc/on_deathcoma_trait_loss)
|
||||
|
||||
RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_IMMOBILIZED), .proc/on_immobilized_trait_gain)
|
||||
RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_IMMOBILIZED), .proc/on_immobilized_trait_loss)
|
||||
|
||||
RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_HANDS_BLOCKED), .proc/on_handsblocked_trait_gain)
|
||||
RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_HANDS_BLOCKED), .proc/on_handsblocked_trait_loss)
|
||||
|
||||
RegisterSignal(src, list(
|
||||
SIGNAL_ADDTRAIT(TRAIT_CRITICAL_CONDITION),
|
||||
SIGNAL_REMOVETRAIT(TRAIT_CRITICAL_CONDITION),
|
||||
@@ -14,6 +20,7 @@
|
||||
SIGNAL_REMOVETRAIT(TRAIT_NODEATH),
|
||||
), .proc/update_succumb_action)
|
||||
|
||||
|
||||
///Called when TRAIT_KNOCKEDOUT is added to the mob.
|
||||
/mob/living/proc/on_knockedout_trait_gain(datum/source)
|
||||
if(stat < UNCONSCIOUS)
|
||||
@@ -33,6 +40,26 @@
|
||||
/mob/living/proc/on_deathcoma_trait_loss(datum/source)
|
||||
REMOVE_TRAIT(src, TRAIT_KNOCKEDOUT, TRAIT_DEATHCOMA)
|
||||
|
||||
|
||||
///Called when TRAIT_IMMOBILIZED is added to the mob.
|
||||
/mob/living/proc/on_immobilized_trait_gain(datum/source)
|
||||
mobility_flags &= ~MOBILITY_MOVE
|
||||
|
||||
///Called when TRAIT_IMMOBILIZED is removed from the mob.
|
||||
/mob/living/proc/on_immobilized_trait_loss(datum/source)
|
||||
mobility_flags |= MOBILITY_MOVE
|
||||
|
||||
|
||||
///Called when TRAIT_HANDS_BLOCKED is added to the mob.
|
||||
/mob/living/proc/on_handsblocked_trait_gain(datum/source)
|
||||
mobility_flags &= ~(MOBILITY_USE | MOBILITY_PICKUP | MOBILITY_STORAGE)
|
||||
drop_all_held_items()
|
||||
|
||||
///Called when TRAIT_HANDS_BLOCKED is removed from the mob.
|
||||
/mob/living/proc/on_handsblocked_trait_loss(datum/source)
|
||||
mobility_flags |= (MOBILITY_USE | MOBILITY_PICKUP | MOBILITY_STORAGE)
|
||||
|
||||
|
||||
/// Called when traits that alter succumbing are added/removed.
|
||||
/// Will show or hide the succumb alert prompt.
|
||||
/mob/living/proc/update_succumb_action()
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
ContactContractDisease(D)
|
||||
|
||||
//Should stop you pushing a restrained person out of the way
|
||||
if(L.pulledby && L.pulledby != src && L.restrained())
|
||||
if(L.pulledby && L.pulledby != src && HAS_TRAIT(L, TRAIT_RESTRAINED))
|
||||
if(!(world.time % 5))
|
||||
to_chat(src, "<span class='warning'>[L] is restrained, you cannot push past.</span>")
|
||||
return TRUE
|
||||
@@ -102,7 +102,7 @@
|
||||
if(L.pulling)
|
||||
if(ismob(L.pulling))
|
||||
var/mob/P = L.pulling
|
||||
if(P.restrained())
|
||||
if(HAS_TRAIT(P, TRAIT_RESTRAINED))
|
||||
if(!(world.time % 5))
|
||||
to_chat(src, "<span class='warning'>[L] is restraining [P], you cannot push past.</span>")
|
||||
return TRUE
|
||||
@@ -138,8 +138,8 @@
|
||||
mob_swap = TRUE
|
||||
else if(
|
||||
!(HAS_TRAIT(M, TRAIT_NOMOBSWAP) || HAS_TRAIT(src, TRAIT_NOMOBSWAP))&&\
|
||||
((M.restrained() && !too_strong) || M.a_intent == INTENT_HELP) &&\
|
||||
(restrained() || a_intent == INTENT_HELP)
|
||||
((HAS_TRAIT(M, TRAIT_RESTRAINED) && !too_strong) || M.a_intent == INTENT_HELP) &&\
|
||||
(HAS_TRAIT(src, TRAIT_RESTRAINED) || a_intent == INTENT_HELP)
|
||||
)
|
||||
mob_swap = TRUE
|
||||
if(mob_swap)
|
||||
@@ -401,7 +401,7 @@
|
||||
death()
|
||||
|
||||
/mob/living/incapacitated(ignore_restraints = FALSE, ignore_grab = FALSE, ignore_stasis = FALSE)
|
||||
if(stat || HAS_TRAIT(src, TRAIT_INCAPACITATED) || (!ignore_restraints && restrained(ignore_grab)) || (!ignore_stasis && IS_IN_STASIS(src)))
|
||||
if(stat || HAS_TRAIT(src, TRAIT_INCAPACITATED) || (!ignore_restraints && (HAS_TRAIT(src, TRAIT_RESTRAINED) || (!ignore_grab && pulledby && pulledby.grab_state >= GRAB_AGGRESSIVE))) || (!ignore_stasis && IS_IN_STASIS(src)))
|
||||
return TRUE
|
||||
|
||||
/mob/living/canUseStorage()
|
||||
@@ -786,7 +786,7 @@
|
||||
|
||||
SEND_SIGNAL(src, COMSIG_LIVING_RESIST, src)
|
||||
//resisting grabs (as if it helps anyone...)
|
||||
if(!restrained(ignore_grab = 1) && pulledby)
|
||||
if(!HAS_TRAIT(src, TRAIT_RESTRAINED) && pulledby)
|
||||
log_combat(src, pulledby, "resisted grab")
|
||||
resist_grab()
|
||||
return
|
||||
@@ -1193,19 +1193,9 @@
|
||||
return ..() && !(buckled && buckled.buckle_prevents_pull)
|
||||
|
||||
|
||||
//Updates canmove, lying and icons. Could perhaps do with a rename but I can't think of anything to describe it.
|
||||
//Updates lying and icons. Could perhaps do with a rename but I can't think of anything to describe it.
|
||||
//Robots, animals and brains have their own version so don't worry about them
|
||||
/mob/living/proc/update_mobility()
|
||||
var/stat_softcrit = stat == SOFT_CRIT
|
||||
var/stat_conscious = (stat == CONSCIOUS) || stat_softcrit
|
||||
var/chokehold = pulledby && pulledby.grab_state >= GRAB_NECK
|
||||
var/restrained = restrained()
|
||||
var/paralyzed = IsParalyzed()
|
||||
var/canmove = !HAS_TRAIT(src, TRAIT_IMMOBILIZED)
|
||||
if(canmove)
|
||||
mobility_flags |= MOBILITY_MOVE
|
||||
else
|
||||
mobility_flags &= ~MOBILITY_MOVE
|
||||
var/canstand_involuntary = !HAS_TRAIT(src, TRAIT_FLOORED)
|
||||
var/canstand = canstand_involuntary && !resting
|
||||
|
||||
@@ -1225,18 +1215,11 @@
|
||||
mobility_flags |= MOBILITY_STAND
|
||||
set_lying_angle(0)
|
||||
|
||||
if(lying_angle != 0 || restrained || incapacitated())
|
||||
if(lying_angle != 0 || HAS_TRAIT(src, TRAIT_HANDS_BLOCKED) || incapacitated())
|
||||
mobility_flags &= ~(MOBILITY_UI|MOBILITY_PULL)
|
||||
else
|
||||
mobility_flags |= MOBILITY_UI|MOBILITY_PULL
|
||||
|
||||
var/canitem = !paralyzed && !IsStun() && stat_conscious && !chokehold && !restrained && usable_hands
|
||||
if(canitem)
|
||||
mobility_flags |= (MOBILITY_USE | MOBILITY_PICKUP | MOBILITY_STORAGE)
|
||||
else
|
||||
mobility_flags &= ~(MOBILITY_USE | MOBILITY_PICKUP | MOBILITY_STORAGE)
|
||||
if(!(mobility_flags & MOBILITY_USE))
|
||||
drop_all_held_items()
|
||||
if(!(mobility_flags & MOBILITY_PULL))
|
||||
if(pulling)
|
||||
stop_pulling()
|
||||
@@ -1636,10 +1619,12 @@
|
||||
if(CONSCIOUS)
|
||||
if(stat >= UNCONSCIOUS)
|
||||
ADD_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_KNOCKEDOUT)
|
||||
ADD_TRAIT(src, TRAIT_HANDS_BLOCKED, TRAIT_KNOCKEDOUT)
|
||||
ADD_TRAIT(src, TRAIT_FLOORED, UNCONSCIOUS_TRAIT)
|
||||
if(SOFT_CRIT)
|
||||
if(stat >= UNCONSCIOUS)
|
||||
ADD_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_KNOCKEDOUT) //adding trait sources should come before removing to avoid unnecessary updates
|
||||
ADD_TRAIT(src, TRAIT_HANDS_BLOCKED, TRAIT_KNOCKEDOUT)
|
||||
if(pulledby)
|
||||
REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, PULLED_WHILE_SOFTCRIT_TRAIT)
|
||||
if(UNCONSCIOUS)
|
||||
@@ -1652,6 +1637,7 @@
|
||||
if(CONSCIOUS)
|
||||
if(. >= UNCONSCIOUS)
|
||||
REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_KNOCKEDOUT)
|
||||
REMOVE_TRAIT(src, TRAIT_HANDS_BLOCKED, TRAIT_KNOCKEDOUT)
|
||||
REMOVE_TRAIT(src, TRAIT_FLOORED, UNCONSCIOUS_TRAIT)
|
||||
REMOVE_TRAIT(src, TRAIT_CRITICAL_CONDITION, STAT_TRAIT)
|
||||
if(SOFT_CRIT)
|
||||
@@ -1659,6 +1645,7 @@
|
||||
ADD_TRAIT(src, TRAIT_IMMOBILIZED, PULLED_WHILE_SOFTCRIT_TRAIT) //adding trait sources should come before removing to avoid unnecessary updates
|
||||
if(. >= UNCONSCIOUS)
|
||||
REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_KNOCKEDOUT)
|
||||
REMOVE_TRAIT(src, TRAIT_HANDS_BLOCKED, TRAIT_KNOCKEDOUT)
|
||||
ADD_TRAIT(src, TRAIT_CRITICAL_CONDITION, STAT_TRAIT)
|
||||
if(UNCONSCIOUS)
|
||||
if(. != HARD_CRIT)
|
||||
@@ -1703,6 +1690,20 @@
|
||||
REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, PULLED_WHILE_SOFTCRIT_TRAIT)
|
||||
|
||||
|
||||
/// Updates the grab state of the mob and updates movespeed
|
||||
/mob/living/setGrabState(newstate)
|
||||
. = ..()
|
||||
switch(grab_state)
|
||||
if(GRAB_PASSIVE)
|
||||
remove_movespeed_modifier(MOVESPEED_ID_MOB_GRAB_STATE)
|
||||
if(GRAB_AGGRESSIVE)
|
||||
add_movespeed_modifier(/datum/movespeed_modifier/grab_slowdown/aggressive)
|
||||
if(GRAB_NECK)
|
||||
add_movespeed_modifier(/datum/movespeed_modifier/grab_slowdown/neck)
|
||||
if(GRAB_KILL)
|
||||
add_movespeed_modifier(/datum/movespeed_modifier/grab_slowdown/kill)
|
||||
|
||||
|
||||
/// Only defined for carbons who can wear masks and helmets, we just assume other mobs have visible faces
|
||||
/mob/living/proc/is_face_visible()
|
||||
return TRUE
|
||||
|
||||
@@ -372,8 +372,6 @@
|
||||
else
|
||||
mobility_flags = ALL
|
||||
|
||||
/mob/living/silicon/ai/restrained(ignore_grab)
|
||||
. = 0
|
||||
|
||||
/mob/living/silicon/ai/Topic(href, href_list)
|
||||
..()
|
||||
|
||||
@@ -200,8 +200,6 @@
|
||||
else
|
||||
. += text("Systems nonfunctional")
|
||||
|
||||
/mob/living/silicon/pai/restrained(ignore_grab)
|
||||
. = FALSE
|
||||
|
||||
// See software.dm for Topic()
|
||||
|
||||
|
||||
@@ -336,8 +336,6 @@
|
||||
if(connected_ai)
|
||||
. += "Master AI: [connected_ai.name]"
|
||||
|
||||
/mob/living/silicon/robot/restrained(ignore_grab)
|
||||
return
|
||||
|
||||
/mob/living/silicon/robot/triggerAlarm(class, area/A, O, obj/alarmsource)
|
||||
if(alarmsource.z != z)
|
||||
|
||||
@@ -265,7 +265,7 @@ Auto Patrol: []"},
|
||||
if( !on || !Adjacent(C) || !isturf(C.loc) ) //if he's in a closet or not adjacent, we cancel cuffing.
|
||||
return
|
||||
if(!C.handcuffed)
|
||||
C.handcuffed = new /obj/item/restraints/handcuffs/cable/zipties/used(C)
|
||||
C.set_handcuffed(new /obj/item/restraints/handcuffs/cable/zipties/used(C))
|
||||
C.update_handcuffed()
|
||||
playsound(src, "law", 50, FALSE)
|
||||
back_to_idle()
|
||||
|
||||
@@ -151,7 +151,7 @@
|
||||
background_icon_state = "bg_hive"
|
||||
icon_icon = 'icons/mob/actions/actions_slime.dmi'
|
||||
button_icon_state = "metabolic_boost"
|
||||
check_flags = AB_CHECK_CONSCIOUS|AB_CHECK_STUN
|
||||
check_flags = AB_CHECK_CONSCIOUS|AB_CHECK_IMMOBILE
|
||||
cooldown_time = 24 SECONDS
|
||||
var/nutrition_cost = 10
|
||||
var/active = FALSE
|
||||
@@ -200,7 +200,7 @@
|
||||
background_icon_state = "bg_hive"
|
||||
icon_icon = 'icons/mob/actions/actions_slime.dmi'
|
||||
button_icon_state = "consume"
|
||||
check_flags = AB_CHECK_CONSCIOUS|AB_CHECK_STUN
|
||||
check_flags = AB_CHECK_CONSCIOUS|AB_CHECK_IMMOBILE
|
||||
///The mob thats being consumed by this creature
|
||||
var/mob/living/vored_mob
|
||||
|
||||
@@ -426,7 +426,7 @@
|
||||
background_icon_state = "bg_hive"
|
||||
icon_icon = 'icons/mob/actions/actions_slime.dmi'
|
||||
button_icon_state = "gel_cocoon"
|
||||
check_flags = AB_CHECK_CONSCIOUS|AB_CHECK_STUN
|
||||
check_flags = AB_CHECK_CONSCIOUS|AB_CHECK_IMMOBILE
|
||||
cooldown_time = 10 SECONDS
|
||||
|
||||
///Try to put the pulled mob in a cocoon
|
||||
|
||||
@@ -232,8 +232,3 @@
|
||||
|
||||
/mob/living/simple_animal/hostile/statue/sentience_act()
|
||||
faction -= "neutral"
|
||||
|
||||
/mob/living/simple_animal/hostile/statue/restrained(ignore_grab)
|
||||
. = ..()
|
||||
if(can_be_seen(loc))
|
||||
return 1
|
||||
|
||||
@@ -11,11 +11,11 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, typecacheof(list(
|
||||
if(stat)
|
||||
to_chat(src, "<span class='warning'>You must be conscious to do this!</span>")
|
||||
return
|
||||
if(IsStun() || IsParalyzed())
|
||||
to_chat(src, "<span class='warning'>You can't vent crawl while you're stunned!</span>")
|
||||
if(HAS_TRAIT(src, TRAIT_IMMOBILIZED))
|
||||
to_chat(src, "<span class='warning'>You can't move into the vent!</span>")
|
||||
return
|
||||
if(restrained())
|
||||
to_chat(src, "<span class='warning'>You can't vent crawl while you're restrained!</span>")
|
||||
if(HAS_TRAIT(src, TRAIT_HANDS_BLOCKED))
|
||||
to_chat(src, "<span class='warning'>You need to be able to use your hands to ventcrawl!</span>")
|
||||
return
|
||||
if(has_buckled_mobs())
|
||||
to_chat(src, "<span class='warning'>You can't vent crawl with other creatures on you!</span>")
|
||||
|
||||
+1
-17
@@ -285,9 +285,6 @@
|
||||
/mob/proc/get_item_by_slot(slot_id)
|
||||
return null
|
||||
|
||||
///Is the mob restrained
|
||||
/mob/proc/restrained(ignore_grab)
|
||||
return
|
||||
|
||||
///Is the mob incapacitated
|
||||
/mob/proc/incapacitated(ignore_restraints = FALSE, ignore_grab = FALSE, ignore_stasis = FALSE)
|
||||
@@ -870,7 +867,7 @@
|
||||
return FALSE
|
||||
if(notransform)
|
||||
return FALSE
|
||||
if(restrained())
|
||||
if(HAS_TRAIT(src, TRAIT_RESTRAINED))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
@@ -1309,19 +1306,6 @@
|
||||
update_movespeed(FALSE)
|
||||
|
||||
|
||||
/// Updates the grab state of the mob and updates movespeed
|
||||
/mob/setGrabState(newstate)
|
||||
. = ..()
|
||||
switch(grab_state)
|
||||
if(GRAB_PASSIVE)
|
||||
remove_movespeed_modifier(MOVESPEED_ID_MOB_GRAB_STATE)
|
||||
if(GRAB_AGGRESSIVE)
|
||||
add_movespeed_modifier(/datum/movespeed_modifier/grab_slowdown/aggressive)
|
||||
if(GRAB_NECK)
|
||||
add_movespeed_modifier(/datum/movespeed_modifier/grab_slowdown/neck)
|
||||
if(GRAB_KILL)
|
||||
add_movespeed_modifier(/datum/movespeed_modifier/grab_slowdown/kill)
|
||||
|
||||
/mob/proc/update_equipment_speed_mods()
|
||||
var/speedies = equipped_speed_mods()
|
||||
if(!speedies)
|
||||
|
||||
@@ -170,7 +170,7 @@
|
||||
if(mob.incapacitated(ignore_restraints = 1))
|
||||
move_delay = world.time + 10
|
||||
return TRUE
|
||||
else if(mob.restrained(ignore_grab = 1))
|
||||
else if(HAS_TRAIT(mob, TRAIT_RESTRAINED))
|
||||
move_delay = world.time + 10
|
||||
to_chat(src, "<span class='warning'>You're restrained! You can't move!</span>")
|
||||
return TRUE
|
||||
|
||||
Reference in New Issue
Block a user