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
@@ -10,7 +10,6 @@
density = FALSE
stat = DEAD
canmove = FALSE
var/mob/living/new_character //for instant transfer once the round is set up
+1 -1
View File
@@ -11,7 +11,7 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
layer = GHOST_LAYER
stat = DEAD
density = FALSE
canmove = 0
move_resist = INFINITY
see_invisible = SEE_INVISIBLE_OBSERVER
see_in_dark = 100
invisibility = INVISIBILITY_OBSERVER
+2 -6
View File
@@ -39,12 +39,8 @@
container = null
return ..()
/mob/living/brain/update_canmove()
if(in_contents_of(/obj/mecha))
canmove = 1
else
canmove = 0
return canmove
/mob/living/brain/update_mobility()
return ((mobility_flags = (in_contents_of(/obj/mecha)? MOBILITY_FLAGS_DEFAULT : NONE)))
/mob/living/brain/ex_act() //you cant blow up brainmobs because it makes transfer_to() freak out when borgs blow up.
return
@@ -22,11 +22,11 @@ In all, this is a lot like the monkey code. /N
switch(M.a_intent)
if (INTENT_HELP)
if(!recoveringstam)
resting = 0
AdjustStun(-60)
AdjustKnockdown(-60)
AdjustUnconscious(-60)
AdjustSleeping(-100)
set_resting(FALSE, TRUE, FALSE)
AdjustAllImmobility(-60, FALSE)
AdjustUnconscious(-60, FALSE)
AdjustSleeping(-100, FALSE)
update_mobility()
visible_message("<span class='notice'>[M.name] nuzzles [src] trying to wake [p_them()] up!</span>")
if(INTENT_DISARM, INTENT_HARM)
if(health > 0)
@@ -31,7 +31,7 @@
#define MAX_ALIEN_LEAP_DIST 7
/mob/living/carbon/alien/humanoid/hunter/proc/leap_at(atom/A)
if(!canmove || leaping)
if(!CHECK_MULTIPLE_BITFIELDS(mobility_flags, MOBILITY_STAND | MOBILITY_MOVE) || leaping)
return
if(pounce_cooldown > world.time)
@@ -65,21 +65,21 @@
var/mob/living/L = hit_atom
if(!L.check_shields(src, 0, "the [name]", attack_type = LEAP_ATTACK))
L.visible_message("<span class ='danger'>[src] pounces on [L]!</span>", "<span class ='userdanger'>[src] pounces on you!</span>")
L.Knockdown(100)
L.DefaultCombatKnockdown(100)
sleep(2)//Runtime prevention (infinite bump() calls on hulks)
step_towards(src,L)
else
Knockdown(40, 1, 1)
DefaultCombatKnockdown(40, 1, 1)
toggle_leap(0)
else if(hit_atom.density && !hit_atom.CanPass(src))
visible_message("<span class ='danger'>[src] smashes into [hit_atom]!</span>", "<span class ='alertalien'>[src] smashes into [hit_atom]!</span>")
Knockdown(40, 1, 1)
Paralyze(40, TRUE, TRUE)
if(leaping)
leaping = 0
update_icons()
update_canmove()
update_mobility()
/mob/living/carbon/alien/humanoid/float(on)
@@ -4,7 +4,7 @@
. = ..()
update_canmove()
update_mobility()
update_icons()
status_flags |= CANPUSH
@@ -69,11 +69,11 @@
playsound(src, 'sound/voice/hiss5.ogg', 40, 1, 1) //Alien roars when starting to break free
..(I, cuff_break = INSTANT_CUFFBREAK)
/mob/living/carbon/alien/humanoid/resist_grab(moving_resist)
if(pulledby.grab_state)
/mob/living/carbon/alien/humanoid/do_resist_grab(moving_resist, forced, silent = FALSE)
if(pulledby.grab_state && !silent)
visible_message("<span class='danger'>[src] has broken free of [pulledby]'s grip!</span>")
pulledby.stop_pulling()
. = 0
return TRUE
/mob/living/carbon/alien/humanoid/get_standard_pixel_y_offset(lying = 0)
if(leaping)
@@ -12,12 +12,12 @@
else
icon_state = "alien[caste]_dead"
else if((stat == UNCONSCIOUS && !asleep) || stat == SOFT_CRIT || IsKnockdown())
else if((stat == UNCONSCIOUS && !asleep) || stat == SOFT_CRIT || IsParalyzed())
icon_state = "alien[caste]_unconscious"
else if(leap_on_click)
icon_state = "alien[caste]_pounce"
else if(lying || resting || asleep)
else if(lying || !CHECK_MOBILITY(src, MOBILITY_STAND) || asleep)
icon_state = "alien[caste]_sleep"
else if(mob_size == MOB_SIZE_LARGE)
icon_state = "alien[caste]"
@@ -22,13 +22,13 @@
if(stat == CONSCIOUS)
stat = UNCONSCIOUS
blind_eyes(1)
update_canmove()
update_mobility()
else
if(stat == UNCONSCIOUS)
stat = CONSCIOUS
if(!recoveringstam)
resting = 0
set_resting(FALSE, TRUE)
adjust_blindness(-1)
update_canmove()
update_mobility()
update_damage_hud()
update_health_hud()
@@ -14,9 +14,9 @@
icon_state = "larva[state]_dead"
else if(handcuffed || legcuffed) //This should be an overlay. Who made this an icon_state?
icon_state = "larva[state]_cuff"
else if(stat == UNCONSCIOUS || lying || resting)
else if(stat == UNCONSCIOUS || !CHECK_MOBILITY(src, MOBILITY_STAND))
icon_state = "larva[state]_sleep"
else if(IsStun())
else if(IsStun() || IsParalyzed())
icon_state = "larva[state]_stun"
else
icon_state = "larva[state]"
@@ -140,7 +140,7 @@
else if(ishuman(owner)) //Humans, being more fragile, are more overwhelmed by the mental backlash.
to_chat(owner, "<span class='danger'>You feel a splitting pain in your head, and are struck with a wave of nausea. You cannot hear the hivemind anymore!</span>")
owner.emote("scream")
owner.Knockdown(100)
owner.DefaultCombatKnockdown(100)
owner.jitteriness += 30
owner.confused += 30
@@ -89,8 +89,8 @@
var/mob/living/carbon/alien/larva/new_xeno = new(xeno_loc)
ghost.transfer_ckey(new_xeno, FALSE)
SEND_SOUND(new_xeno, sound('sound/voice/hiss5.ogg',0,0,0,100)) //To get the player's attention
new_xeno.canmove = 0 //so we don't move during the bursting animation
new_xeno.notransform = 1
new_xeno.Paralyze(6)
new_xeno.notransform = TRUE
new_xeno.invisibility = INVISIBILITY_MAXIMUM
sleep(6)
@@ -99,8 +99,8 @@
return
if(new_xeno)
new_xeno.canmove = 1
new_xeno.notransform = 0
new_xeno.SetParalyzed(0)
new_xeno.notransform = FALSE
new_xeno.invisibility = 0
var/mob/living/carbon/old_owner = owner
+26 -18
View File
@@ -103,7 +103,7 @@
hurt = FALSE
if(hit_atom.density && isturf(hit_atom))
if(hurt)
Knockdown(20)
DefaultCombatKnockdown(20)
take_bodypart_damage(10)
if(iscarbon(hit_atom) && hit_atom != src)
var/mob/living/carbon/victim = hit_atom
@@ -112,8 +112,8 @@
if(hurt)
victim.take_bodypart_damage(10)
take_bodypart_damage(10)
victim.Knockdown(20)
Knockdown(20)
victim.DefaultCombatKnockdown(20)
DefaultCombatKnockdown(20)
visible_message("<span class='danger'>[src] crashes into [victim], knocking them both over!</span>",\
"<span class='userdanger'>You violently crash into [victim]!</span>")
playsound(src,'sound/weapons/punch1.ogg',50,1)
@@ -281,19 +281,23 @@
return FALSE
/mob/living/carbon/resist_buckle()
. = FALSE
if(restrained())
changeNext_move(CLICK_CD_BREAKOUT)
last_special = world.time + CLICK_CD_BREAKOUT
// too soon.
if(last_special > world.time)
return
var/buckle_cd = 600
if(handcuffed)
var/obj/item/restraints/O = src.get_item_by_slot(SLOT_HANDCUFFED)
buckle_cd = O.breakouttime
changeNext_move(min(CLICK_CD_BREAKOUT, buckle_cd))
last_special = world.time + min(CLICK_CD_BREAKOUT, buckle_cd)
visible_message("<span class='warning'>[src] attempts to unbuckle [p_them()]self!</span>", \
"<span class='notice'>You attempt to unbuckle yourself... (This will take around [round(buckle_cd/600,1)] minute\s, and you need to stay still.)</span>")
if(do_after(src, buckle_cd, 0, target = src))
if(do_after(src, buckle_cd, 0, target = src, required_mobility_flags = MOBILITY_RESIST))
if(!buckled)
return
buckled.user_unbuckle_mob(src,src)
buckled.user_unbuckle_mob(src, src)
else
if(src && buckled)
to_chat(src, "<span class='warning'>You fail to unbuckle yourself!</span>")
@@ -301,21 +305,26 @@
buckled.user_unbuckle_mob(src,src)
/mob/living/carbon/resist_fire()
if(last_special > world.time)
return
fire_stacks -= 5
Knockdown(60, TRUE, TRUE)
DefaultCombatKnockdown(60, TRUE, TRUE)
spin(32,2)
visible_message("<span class='danger'>[src] rolls on the floor, trying to put [p_them()]self out!</span>", \
"<span class='notice'>You stop, drop, and roll!</span>")
last_special = world.time + 30
sleep(30)
if(fire_stacks <= 0)
visible_message("<span class='danger'>[src] has successfully extinguished [p_them()]self!</span>", \
"<span class='notice'>You extinguish yourself.</span>")
ExtinguishMob()
return
/mob/living/carbon/resist_restraints()
/mob/living/carbon/resist_restraints(ignore_delay = FALSE)
var/obj/item/I = null
var/type = 0
if(!ignore_delay && (last_special > world.time))
to_chat(src, "<span class='warning'>You don't have the energy to resist your restraints that fast!</span>")
return
if(handcuffed)
I = handcuffed
type = 1
@@ -324,14 +333,13 @@
type = 2
if(I)
if(type == 1)
changeNext_move(CLICK_CD_BREAKOUT)
changeNext_move(min(CLICK_CD_BREAKOUT, I.breakouttime))
last_special = world.time + CLICK_CD_BREAKOUT
if(type == 2)
changeNext_move(CLICK_CD_RANGE)
changeNext_move(min(CLICK_CD_RANGE, I.breakouttime))
last_special = world.time + CLICK_CD_RANGE
cuff_resist(I)
/mob/living/carbon/proc/cuff_resist(obj/item/I, breakouttime = 600, cuff_break = 0)
if(I.item_flags & BEING_REMOVED)
to_chat(src, "<span class='warning'>You're already attempting to remove [I]!</span>")
@@ -341,7 +349,7 @@
if(!cuff_break)
visible_message("<span class='warning'>[src] attempts to remove [I]!</span>")
to_chat(src, "<span class='notice'>You attempt to remove [I]... (This will take around [DisplayTimeText(breakouttime)] and you need to stand still.)</span>")
if(do_after(src, breakouttime, 0, target = src))
if(do_after(src, breakouttime, 0, target = src, required_mobility_flags = MOBILITY_RESIST))
clear_cuffs(I, cuff_break)
else
to_chat(src, "<span class='warning'>You fail to remove [I]!</span>")
@@ -488,7 +496,7 @@
visible_message("<span class='warning'>[src] dry heaves!</span>", \
"<span class='userdanger'>You try to throw up, but there's nothing in your stomach!</span>")
if(stun)
Knockdown(200)
DefaultCombatKnockdown(200)
return 1
if(is_mouth_covered()) //make this add a blood/vomit overlay later it'll be hilarious
@@ -572,9 +580,9 @@
if(stam > DAMAGE_PRECISION)
var/total_health = (health - stam)
if(total_health <= crit_threshold && !stat)
if(!IsKnockdown())
if(CHECK_MOBILITY(src, MOBILITY_STAND))
to_chat(src, "<span class='notice'>You're too exhausted to keep going...</span>")
Knockdown(100)
KnockToFloor(TRUE)
update_health_hud()
/mob/living/carbon/update_sight()
@@ -814,7 +822,7 @@
else
stat = CONSCIOUS
adjust_blindness(-1)
update_canmove()
update_mobility()
update_damage_hud()
update_health_hud()
med_hud_set_status()
@@ -82,7 +82,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
if(!combatmode)
totitemdamage *= 1.5
@@ -193,7 +193,7 @@
do_sparks(5, TRUE, src)
var/power = M.powerlevel + rand(0,3)
Knockdown(power*20)
DefaultCombatKnockdown(power*20)
if(stuttering < power)
stuttering = power
if (prob(stunprob) && M.powerlevel >= 8)
@@ -267,7 +267,7 @@
spawn(20)
jitteriness = max(jitteriness - 990, 10) //Still jittery, but vastly less
if((!tesla_shock || (tesla_shock && siemens_coeff > 0.5)) && stun)
Knockdown(60)
DefaultCombatKnockdown(60)
if(override)
return override
else
@@ -346,16 +346,14 @@
else if (mood.sanity >= SANITY_DISTURBED)
SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "friendly_hug", /datum/mood_event/betterhug, M)
AdjustStun(-60)
AdjustKnockdown(-60)
AdjustUnconscious(-60)
AdjustSleeping(-100)
AdjustAllImmobility(-60, FALSE)
AdjustUnconscious(-60, FALSE)
AdjustSleeping(-100, FALSE)
if(recoveringstam)
adjustStaminaLoss(-15)
else if(resting)
resting = 0
update_canmove()
else
set_resting(FALSE, FALSE)
update_mobility()
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
@@ -419,7 +417,7 @@
var/effect_amount = intensity - ear_safety
if(effect_amount > 0)
if(stun_pwr)
Knockdown(stun_pwr*effect_amount)
DefaultCombatKnockdown(stun_pwr*effect_amount)
if(istype(ears) && (deafen_pwr || damage_pwr))
var/ear_damage = damage_pwr * effect_amount
@@ -41,3 +41,10 @@
nutrition -= HUNGER_FACTOR/10
if(m_intent == MOVE_INTENT_RUN)
nutrition -= HUNGER_FACTOR/10
/mob/living/carbon/can_move_under_living(mob/living/other)
. = ..()
if(!.) //we failed earlier don't need to fail again
return
if(!other.lying && lying) //they're up, we're down.
return FALSE
+1 -1
View File
@@ -91,7 +91,7 @@
. += "[t_He] [t_is] moving [t_his] body in an unnatural and blatantly unsimian manner."
if(combatmode)
. += "[t_He] [t_is] visibly tense[resting ? "." : ", and [t_is] standing in combative stance."]"
. += "[t_He] [t_is] visibly tense[CHECK_MOBILITY(src, MOBILITY_STAND) ? "." : ", and [t_is] standing in combative stance."]"
var/trait_exam = common_trait_examine()
if (!isnull(trait_exam))
@@ -491,7 +491,7 @@
to_chat(usr, "<span class='warning'>Unable to locate a data core entry for this person.</span>")
/mob/living/carbon/human/proc/canUseHUD()
return !(src.stat || IsKnockdown() || IsStun() || src.restrained())
return CHECK_MOBILITY(src, MOBILITY_UI)
/mob/living/carbon/human/can_inject(mob/user, error_msg, target_zone, penetrate_thick = FALSE, bypass_immunity = FALSE)
. = 1 // Default to returning true.
@@ -724,8 +724,8 @@
remove_atom_colour(TEMPORARY_COLOUR_PRIORITY, "#000000")
cut_overlay(MA)
/mob/living/carbon/human/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE, no_tk=FALSE)
if(incapacitated() || lying )
/mob/living/carbon/human/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE, no_tk=FALSE, check_resting = TRUE)
if(incapacitated() || (check_resting && !CHECK_MOBILITY(src, MOBILITY_STAND)))
to_chat(src, "<span class='warning'>You can't do that right now!</span>")
return FALSE
if(!Adjacent(M) && (M.loc != src))
@@ -836,7 +836,7 @@
visible_message("<span class='warning'>[src] dry heaves!</span>", \
"<span class='userdanger'>You try to throw up, but there's nothing in your stomach!</span>")
if(stun)
Knockdown(200)
DefaultCombatKnockdown(200)
return 1
..()
@@ -870,7 +870,7 @@
return (istype(target) && target.stat == CONSCIOUS)
/mob/living/carbon/human/proc/can_be_firemanned(mob/living/carbon/target)
return (ishuman(target) && target.lying)
return (ishuman(target) && !CHECK_MOBILITY(target, MOBILITY_STAND))
/mob/living/carbon/human/proc/fireman_carry(mob/living/carbon/target)
if(can_be_firemanned(target))
@@ -879,7 +879,7 @@
if(do_after(src, 30, TRUE, target))
//Second check to make sure they're still valid to be carried
if(can_be_firemanned(target) && !incapacitated(FALSE, TRUE))
target.resting = FALSE
target.set_resting(FALSE, TRUE)
buckle_mob(target, TRUE, TRUE, 90, 1, 0)
return
visible_message("<span class='warning'>[src] fails to fireman carry [target]!")
@@ -892,7 +892,7 @@
/mob/living/carbon/human/proc/piggyback(mob/living/carbon/target)
if(can_piggyback(target))
visible_message("<span class='notice'>[target] starts to climb onto [src]...</span>")
if(do_after(target, 15, target = src))
if(do_after(target, 15, target = src, required_mobility_flags = MOBILITY_STAND))
if(can_piggyback(target))
if(target.incapacitated(FALSE, TRUE) || incapacitated(FALSE, TRUE))
target.visible_message("<span class='warning'>[target] can't hang onto [src]!</span>")
@@ -179,7 +179,7 @@
"<span class='userdanger'>[M] disarmed [src]!</span>")
else if(!M.client || prob(5)) // only natural monkeys get to stun reliably, (they only do it occasionaly)
playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1)
Knockdown(100)
DefaultCombatKnockdown(100)
log_combat(M, src, "tackled")
visible_message("<span class='danger'>[M] has tackled down [src]!</span>", \
"<span class='userdanger'>[M] has tackled down [src]!</span>")
@@ -228,9 +228,9 @@
else
playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1)
if(!lying) //CITADEL EDIT
Knockdown(100, TRUE, FALSE, 30, 25)
DefaultCombatKnockdown(100, TRUE, FALSE, 30, 25)
else
Knockdown(100)
DefaultCombatKnockdown(100)
log_combat(M, src, "tackled")
visible_message("<span class='danger'>[M] has tackled down [src]!</span>", \
"<span class='userdanger'>[M] has tackled down [src]!</span>")
@@ -297,10 +297,10 @@
switch(M.damtype)
if("brute")
if(M.force > 35) // durand and other heavy mechas
Knockdown(50)
DefaultCombatKnockdown(50)
src.throw_at(throw_target, rand(1,5), 7)
else if(M.force >= 20 && !IsKnockdown()) // lightweight mechas like gygax
Knockdown(30)
else if(M.force >= 20 && CHECK_MOBILITY(src, MOBILITY_STAND)) // lightweight mechas like gygax
DefaultCombatKnockdown(30)
src.throw_at(throw_target, rand(1,3), 7)
update |= temp.receive_damage(dmg, 0)
playsound(src, 'sound/weapons/punch4.ogg', 50, 1)
@@ -0,0 +1,48 @@
/mob/living/carbon/human/resist_a_rest(automatic = FALSE, ignoretimer = FALSE)
if(!resting || stat || attemptingstandup)
return FALSE
if(ignoretimer)
set_resting(FALSE, FALSE)
return TRUE
if(!lying) //if they're in a chair or something they don't need to force themselves off the ground.
set_resting(FALSE, FALSE)
return TRUE
else if(!CHECK_MOBILITY(src, MOBILITY_RESIST))
if(!automatic)
to_chat(src, "<span class='warning'>You are unable to stand up right now.</span>")
return FALSE
else
var/totaldelay = 3 //A little bit less than half of a second as a baseline for getting up from a rest
if(getStaminaLoss() >= STAMINA_SOFTCRIT)
to_chat(src, "<span class='warning'>You're too exhausted to get up!")
return FALSE
attemptingstandup = TRUE
var/health_deficiency = max((maxHealth - (health - getStaminaLoss()))*0.5, 0)
if(!has_gravity())
health_deficiency = health_deficiency*0.2
totaldelay += health_deficiency
var/standupwarning = "[src] and everyone around them should probably yell at the dev team"
switch(health_deficiency)
if(-INFINITY to 10)
standupwarning = "[src] stands right up!"
if(10 to 35)
standupwarning = "[src] tries to stand up."
if(35 to 60)
standupwarning = "[src] slowly pushes [p_them()]self upright."
if(60 to 80)
standupwarning = "[src] weakly attempts to stand up."
if(80 to INFINITY)
standupwarning = "[src] struggles to stand up."
var/usernotice = automatic ? "<span class='notice'>You are now getting up. (Auto)</span>" : "<span class='notice'>You are now getting up.</span>"
visible_message("<span class='notice'>[standupwarning]</span>", usernotice, vision_distance = 5)
if(do_after(src, totaldelay, target = src, required_mobility_flags = MOBILITY_RESIST))
set_resting(FALSE, TRUE)
attemptingstandup = FALSE
return TRUE
else
attemptingstandup = FALSE
if(resting) //we didn't shove ourselves up or something
visible_message("<span class='notice'>[src] falls right back down.</span>", "<span class='notice'>You fall right back down.</span>")
if(has_gravity())
playsound(src, "bodyfall", 20, 1)
return FALSE
+17 -15
View File
@@ -1364,9 +1364,9 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
return TRUE
if(radiation > RAD_MOB_KNOCKDOWN && prob(RAD_MOB_KNOCKDOWN_PROB))
if(!H.IsKnockdown())
if(CHECK_MOBILITY(H, MOBILITY_STAND))
H.emote("collapse")
H.Knockdown(RAD_MOB_KNOCKDOWN_AMOUNT)
H.DefaultCombatKnockdown(RAD_MOB_KNOCKDOWN_AMOUNT)
to_chat(H, "<span class='danger'>You feel weak.</span>")
if(radiation > RAD_MOB_VOMIT && prob(RAD_MOB_VOMIT_PROB))
@@ -1514,7 +1514,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
//CITADEL CHANGES - makes resting and disabled combat mode reduce punch damage, makes being out of combat mode result in you taking more damage
if(!target.combatmode && damage < user.dna.species.punchstunthreshold)
damage = user.dna.species.punchstunthreshold - 1
if(user.resting)
if(!CHECK_MOBILITY(user, MOBILITY_STAND))
damage *= 0.5
if(!user.combatmode)
damage *= 0.25
@@ -1632,7 +1632,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
return*/
if(!target.combatmode) // CITADEL CHANGE
randn += -10 //CITADEL CHANGE - being out of combat mode makes it easier for you to get disarmed
if(user.resting) //CITADEL CHANGE
if(!CHECK_MOBILITY(user, MOBILITY_STAND)) //CITADEL CHANGE
randn += 100 //CITADEL CHANGE - No kosher disarming if you're resting
if(!user.combatmode) //CITADEL CHANGE
randn += 25 //CITADEL CHANGE - Makes it harder to disarm outside of combat mode
@@ -1715,7 +1715,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
var/mob/living/carbon/tempcarb = user
if(!tempcarb.combatmode)
totitemdamage *= 0.5
if(user.resting)
if(!CHECK_MOBILITY(user, MOBILITY_STAND))
totitemdamage *= 0.5
if(istype(H))
if(!H.combatmode)
@@ -1831,12 +1831,14 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
if(user.getStaminaLoss() >= STAMINA_SOFTCRIT)
to_chat(user, "<span class='warning'>You're too exhausted for that.</span>")
return
if(!user.resting)
if(user.IsKnockdown() || user.IsParalyzed() || user.IsStun())
to_chat(user, "<span class='warning'>You can't seem to force yourself up right now!</span>")
return
if(CHECK_MOBILITY(user, MOBILITY_STAND))
to_chat(user, "<span class='notice'>You can only force yourself up if you're on the ground.</span>")
return
user.visible_message("<span class='notice'>[user] forces [p_them()]self up to [p_their()] feet!</span>", "<span class='notice'>You force yourself up to your feet!</span>")
user.resting = 0
user.update_canmove()
user.set_resting(FALSE, TRUE)
user.adjustStaminaLossBuffered(user.stambuffer) //Rewards good stamina management by making it easier to instantly get up from resting
playsound(user, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
@@ -1849,7 +1851,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
return FALSE
if(attacker_style && attacker_style.disarm_act(user,target))
return TRUE
if(user.resting)
if(!CHECK_MOBILITY(user, MOBILITY_STAND))
return FALSE
else
if(user == target)
@@ -1862,7 +1864,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
target.w_uniform.add_fingerprint(user)
SEND_SIGNAL(target, COMSIG_HUMAN_DISARM_HIT, user, user.zone_selected)
if(!target.resting)
if(CHECK_MOBILITY(target, MOBILITY_STAND))
target.adjustStaminaLoss(5)
if(target.is_shove_knockdown_blocked())
@@ -1876,7 +1878,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
//Thank you based whoneedsspace
target_collateral_human = locate(/mob/living/carbon/human) in target_shove_turf.contents
if(target_collateral_human && !target_collateral_human.resting)
if(target_collateral_human && CHECK_MOBILITY(target_collateral_human, MOBILITY_STAND))
shove_blocked = TRUE
else
target_collateral_human = null
@@ -1887,15 +1889,15 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
var/append_message = ""
if(shove_blocked && !target.buckled)
var/directional_blocked = !target.Adjacent(target_shove_turf)
var/targetatrest = target.resting
var/targetatrest = !CHECK_MOBILITY(target, MOBILITY_STAND)
if((directional_blocked || !(target_collateral_human || target_shove_turf.shove_act(target, user))) && !targetatrest)
target.Knockdown(SHOVE_KNOCKDOWN_SOLID)
target.DefaultCombatKnockdown(SHOVE_KNOCKDOWN_SOLID)
user.visible_message("<span class='danger'>[user.name] shoves [target.name], knocking them down!</span>",
"<span class='danger'>You shove [target.name], knocking them down!</span>", null, COMBAT_MESSAGE_RANGE)
log_combat(user, target, "shoved", "knocking them down")
else if(target_collateral_human && !targetatrest)
target.Knockdown(SHOVE_KNOCKDOWN_HUMAN)
target_collateral_human.Knockdown(SHOVE_KNOCKDOWN_COLLATERAL)
target.DefaultCombatKnockdown(SHOVE_KNOCKDOWN_HUMAN)
target_collateral_human.DefaultCombatKnockdown(SHOVE_KNOCKDOWN_COLLATERAL)
user.visible_message("<span class='danger'>[user.name] shoves [target.name] into [target_collateral_human.name]!</span>",
"<span class='danger'>You shove [target.name] into [target_collateral_human.name]!</span>", null, COMBAT_MESSAGE_RANGE)
append_message += ", into [target_collateral_human.name]"
@@ -52,21 +52,20 @@
return 0
/datum/species/angel/proc/CanFly(mob/living/carbon/human/H)
if(H.stat || H.IsStun() || H.IsKnockdown())
return 0
if(!CHECK_MOBILITY(H, MOBILITY_MOVE))
return FALSE
if(H.wear_suit && ((H.wear_suit.flags_inv & HIDEJUMPSUIT) && (!H.wear_suit.species_exception || !is_type_in_list(src, H.wear_suit.species_exception)))) //Jumpsuits have tail holes, so it makes sense they have wing holes too
to_chat(H, "Your suit blocks your wings from extending!")
return 0
return FALSE
var/turf/T = get_turf(H)
if(!T)
return 0
return FALSE
var/datum/gas_mixture/environment = T.return_air()
if(environment && !(environment.return_pressure() > 30))
to_chat(H, "<span class='warning'>The atmosphere is too thin for you to fly!</span>")
return 0
else
return 1
return FALSE
return TRUE
/datum/action/innate/flight
name = "Toggle Flight"
@@ -81,12 +80,12 @@
if(H.movement_type & FLYING)
to_chat(H, "<span class='notice'>You settle gently back onto the ground...</span>")
A.ToggleFlight(H,0)
H.update_canmove()
H.update_mobility()
else
to_chat(H, "<span class='notice'>You beat your wings and begin to hover gently above the ground...</span>")
H.resting = 0
H.set_resting(FALSE, TRUE)
A.ToggleFlight(H,1)
H.update_canmove()
H.update_mobility()
/datum/species/angel/proc/flyslip(mob/living/carbon/human/H)
var/obj/buckled_obj
@@ -83,6 +83,7 @@
button_icon_state = "slimeheal"
icon_icon = 'icons/mob/actions/actions_slime.dmi'
background_icon_state = "bg_alien"
required_mobility_flags = NONE
/datum/action/innate/regenerate_limbs/IsAvailable()
if(..())
@@ -58,7 +58,7 @@
if(/obj/item/projectile/energy/floramut)
if(prob(15))
H.rad_act(rand(30,80))
H.Knockdown(100)
H.DefaultCombatKnockdown(100)
H.visible_message("<span class='warning'>[H] writhes in pain as [H.p_their()] vacuoles boil.</span>", "<span class='userdanger'>You writhe in pain as your vacuoles boil!</span>", "<span class='italics'>You hear the crunching of leaves.</span>")
if(prob(80))
H.randmutb()
@@ -3,7 +3,7 @@
amount = dna.species.spec_stun(src,amount)
return ..()
/mob/living/carbon/human/Knockdown(amount, updating = TRUE, ignore_canknockdown = FALSE, override_hardstun, override_stamdmg)
/mob/living/carbon/human/DefaultCombatKnockdown(amount, updating = TRUE, ignore_canknockdown = FALSE, override_hardstun, override_stamdmg)
amount = dna.species.spec_stun(src,amount)
return ..()
+2 -2
View File
@@ -509,7 +509,7 @@ GLOBAL_LIST_INIT(ballmer_windows_me_msg, list("Yo man, what if, we like, uh, put
/mob/living/carbon/handle_status_effects()
..()
if(getStaminaLoss() && !combatmode)//CIT CHANGE - prevents stamina regen while combat mode is active
adjustStaminaLoss(resting ? (recoveringstam ? -7.5 : -6) : -3)//CIT CHANGE - decreases adjuststaminaloss to stop stamina damage from being such a joke
adjustStaminaLoss(!CHECK_MOBILITY(src, MOBILITY_STAND) ? (recoveringstam ? -7.5 : -6) : -3)//CIT CHANGE - decreases adjuststaminaloss to stop stamina damage from being such a joke
if(!recoveringstam && incomingstammult != 1)
incomingstammult = max(0.01, incomingstammult)
@@ -521,7 +521,7 @@ GLOBAL_LIST_INIT(ballmer_windows_me_msg, list("Yo man, what if, we like, uh, put
bufferedstam = max(bufferedstam - drainrate, 0)
//END OF CIT CHANGES
var/restingpwr = 1 + 4 * resting
var/restingpwr = 1 + 4 * !CHECK_MOBILITY(src, MOBILITY_STAND)
//Dizziness
if(dizziness)
@@ -50,17 +50,11 @@
// taken from /mob/living/carbon/human/interactive/
/mob/living/carbon/monkey/proc/IsDeadOrIncap(checkDead = TRUE)
if(!canmove)
return 1
if(!CHECK_MOBILITY(src, MOBILITY_MOVE))
return TRUE
if(health <= 0 && checkDead)
return 1
if(IsUnconscious())
return 1
if(IsStun() || IsKnockdown())
return 1
if(stat)
return 1
return 0
return TRUE
return FALSE
/mob/living/carbon/monkey/proc/battle_screech()
if(next_battle_screech < world.time)
@@ -13,7 +13,7 @@
if(!client)
if(stat == CONSCIOUS)
if(on_fire || buckled || restrained() || (resting && canmove)) //CIT CHANGE - makes it so monkeys attempt to resist if they're resting)
if(on_fire || buckled || restrained() || (!CHECK_MOBILITY(src, MOBILITY_STAND) && CHECK_MOBILITY(src, MOBILITY_MOVE))) //CIT CHANGE - makes it so monkeys attempt to resist if they're resting)
if(!resisting && prob(MONKEY_RESIST_PROB))
resisting = TRUE
walk_to(src,0)
@@ -21,7 +21,7 @@
else if(resisting)
resisting = FALSE
else if((mode == MONKEY_IDLE && !pickupTarget && !prob(MONKEY_SHENANIGAN_PROB)) || !handle_combat())
if(prob(25) && canmove && isturf(loc) && !pulledby)
if(prob(25) && CHECK_MOBILITY(src, MOBILITY_MOVE) && isturf(loc) && !pulledby)
step(src, pick(GLOB.cardinals))
else if(prob(1))
emote(pick("scratch","jump","roll","tail"))
@@ -34,9 +34,9 @@
gorillize()
return
if(radiation > RAD_MOB_KNOCKDOWN && prob(RAD_MOB_KNOCKDOWN_PROB))
if(!IsKnockdown())
if(!recoveringstam)
emote("collapse")
Knockdown(RAD_MOB_KNOCKDOWN_AMOUNT)
DefaultCombatKnockdown(RAD_MOB_KNOCKDOWN_AMOUNT)
to_chat(src, "<span class='danger'>You feel weak.</span>")
if(radiation > RAD_MOB_MUTATE)
if(prob(1))
@@ -82,7 +82,7 @@
if(!IsUnconscious())
M.do_attack_animation(src, ATTACK_EFFECT_DISARM)
if (prob(25))
Knockdown(40)
DefaultCombatKnockdown(40)
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
log_combat(M, src, "pushed")
visible_message("<span class='danger'>[M] has pushed down [src]!</span>", \
@@ -126,7 +126,7 @@
var/obj/item/I = null
playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1)
if(prob(95))
Knockdown(20)
DefaultCombatKnockdown(20)
visible_message("<span class='danger'>[M] has tackled down [name]!</span>", \
"<span class='userdanger'>[M] has tackled down [name]!</span>", null, COMBAT_MESSAGE_RANGE)
else
+1 -1
View File
@@ -88,7 +88,7 @@
if(EFFECT_STUN)
Stun(effect * hit_percent)
if(EFFECT_KNOCKDOWN)
Knockdown(effect * hit_percent, override_stamdmg = knockdown_stammax ? CLAMP(knockdown_stamoverride, 0, knockdown_stammax-getStaminaLoss()) : knockdown_stamoverride)
DefaultCombatKnockdown(effect * hit_percent, override_stamdmg = knockdown_stammax ? CLAMP(knockdown_stamoverride, 0, knockdown_stammax-getStaminaLoss()) : knockdown_stamoverride)
if(EFFECT_UNCONSCIOUS)
Unconscious(effect * hit_percent)
if(EFFECT_IRRADIATE)
+1 -1
View File
@@ -78,7 +78,7 @@
update_action_buttons_icon()
update_damage_hud()
update_health_hud()
update_canmove()
update_mobility()
med_hud_set_health()
med_hud_set_status()
if(!gibbed && !QDELETED(src))
+2 -2
View File
@@ -273,7 +273,7 @@
if(H.get_num_arms() == 0)
if(H.get_num_legs() != 0)
message_param = "tries to point at %t with a leg, <span class='userdanger'>falling down</span> in the process!"
H.Knockdown(20)
H.DefaultCombatKnockdown(20)
else
message_param = "<span class='userdanger'>bumps [user.p_their()] head on the ground</span> trying to motion towards %t."
H.adjustOrganLoss(ORGAN_SLOT_BRAIN, 5)
@@ -377,7 +377,7 @@
. = ..()
if(. && isliving(user))
var/mob/living/L = user
L.Knockdown(200)
L.DefaultCombatKnockdown(200)
/datum/emote/living/sway
key = "sway"
+78 -173
View File
@@ -48,7 +48,7 @@
/mob/living/proc/ZImpactDamage(turf/T, levels)
visible_message("<span class='danger'>[src] crashes into [T] with a sickening noise!</span>")
adjustBruteLoss((levels * 5) ** 1.5)
Knockdown(levels * 50)
DefaultCombatKnockdown(levels * 50)
/mob/living/proc/OpenCraftingMenu()
@@ -88,7 +88,7 @@
var/they_can_move = TRUE
if(isliving(M))
var/mob/living/L = M
they_can_move = L.canmove //L.mobility_flags & MOBILITY_MOVE
they_can_move = CHECK_MOBILITY(L, MOBILITY_MOVE)
//Also spread diseases
for(var/thing in diseases)
var/datum/disease/D = thing
@@ -115,7 +115,7 @@
return 1
//CIT CHANGES START HERE - makes it so resting stops you from moving through standing folks without a short delay
if(resting && !L.resting)
if(!CHECK_MOBILITY(src, MOBILITY_STAND) && CHECK_MOBILITY(L, MOBILITY_STAND))
var/origtargetloc = L.loc
if(!pulledby)
if(attemptingcrawl)
@@ -125,7 +125,7 @@
return TRUE
attemptingcrawl = TRUE
visible_message("<span class='notice'>[src] is attempting to crawl under [L].</span>", "<span class='notice'>You are now attempting to crawl under [L].</span>")
if(!do_after(src, CRAWLUNDER_DELAY, target = src) || !resting)
if(!do_after(src, CRAWLUNDER_DELAY, target = src) || CHECK_MOBILITY(src, MOBILITY_STAND))
attemptingcrawl = FALSE
return TRUE
var/src_passmob = (pass_flags & PASSMOB)
@@ -369,8 +369,8 @@
death()
/mob/living/incapacitated(ignore_restraints, ignore_grab)
if(stat || IsUnconscious() || IsStun() || IsKnockdown() || recoveringstam || (!ignore_restraints && restrained(ignore_grab))) // CIT CHANGE - adds recoveringstam check here
/mob/living/incapacitated(ignore_restraints = FALSE, ignore_grab = FALSE, check_immobilized = FALSE)
if(stat || IsUnconscious() || IsStun() || IsParalyzed() || recoveringstam || (check_immobilized && IsImmobilized()) || (!ignore_restraints && restrained(ignore_grab)))
return TRUE
/mob/living/canUseStorage()
@@ -428,7 +428,6 @@
else
if(alert(src, "You sure you want to sleep for a while?", "Sleep", "Yes", "No") == "Yes")
SetSleeping(400) //Short nap
update_canmove()
/mob/proc/get_contents()
@@ -493,7 +492,7 @@
stat = UNCONSCIOUS //the mob starts unconscious,
blind_eyes(1)
updatehealth() //then we check if the mob should wake up.
update_canmove()
update_mobility()
update_sight()
clear_alert("not_enough_oxy")
reload_fullscreen()
@@ -512,8 +511,7 @@
setStaminaLoss(0, 0)
SetUnconscious(0, FALSE)
set_disgust(0)
SetStun(0, FALSE)
SetKnockdown(0, FALSE)
SetAllImmobility(0, FALSE)
SetSleeping(0, FALSE)
radiation = 0
nutrition = NUTRITION_LEVEL_FED + 50
@@ -528,7 +526,7 @@
ExtinguishMob()
fire_stacks = 0
confused = 0
update_canmove()
update_mobility()
//Heal all organs
if(iscarbon(src))
var/mob/living/carbon/C = src
@@ -552,30 +550,6 @@
var/obj/item/item = i
SEND_SIGNAL(item, COMSIG_ITEM_WEARERCROSSED, AM)
/mob/living/Move(atom/newloc, direct)
if (buckled && buckled.loc != newloc) //not updating position
if (!buckled.anchored)
return buckled.Move(newloc, direct)
else
return 0
var/old_direction = dir
var/turf/T = loc
if(pulling)
update_pull_movespeed()
. = ..()
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()
if(active_storage && !(CanReach(active_storage.parent,view_only = TRUE)))
active_storage.close(src)
if(lying && !buckled && prob(getBruteLoss()*200/maxHealth))
makeTrail(newloc, T, old_direction)
/mob/living/proc/makeTrail(turf/target_turf, turf/start, direction)
if(!has_gravity())
return
@@ -648,66 +622,97 @@
..(pressure_difference, direction, pressure_resistance_prob_delta)
/mob/living/can_resist()
return !((next_move > world.time) || incapacitated(ignore_restraints = TRUE))
return !((next_move > world.time) || !CHECK_MOBILITY(src, MOBILITY_RESIST))
/// Resist verb for attempting to get out of whatever is restraining your motion. Gives you resist clickdelay if do_resist() returns true.
/mob/living/verb/resist()
set name = "Resist"
set category = "IC"
if(!can_resist())
return
changeNext_move(CLICK_CD_RESIST)
if(do_resist())
changeNext_move(CLICK_CD_RESIST)
/// The actual proc for resisting. Return TRUE to give clickdelay.
/mob/living/proc/do_resist()
SEND_SIGNAL(src, COMSIG_LIVING_RESIST, src)
//resisting grabs (as if it helps anyone...)
if(!restrained(ignore_grab = 1) && pulledby)
visible_message("<span class='danger'>[src] resists against [pulledby]'s grip!</span>")
log_combat(src, pulledby, "resisted grab")
resist_grab()
return
// only works if you're not cuffed.
if(!restrained(ignore_grab = TRUE) && pulledby)
var/old_gs = pulledby.grab_state
attempt_resist_grab(FALSE)
// Return as we should only resist one thing at a time. Give clickdelay if the grab wasn't passive.
return old_gs? TRUE : FALSE
//unbuckling yourself
// unbuckling yourself. stops the chain if you try it.
if(buckled && last_special <= world.time)
resist_buckle()
log_combat(src, buckled, "resisted buckle")
return resist_buckle()
// CIT CHANGE - climbing out of a gut
if(attempt_vr(src,"vore_process_resist",args)) return TRUE
// CIT CHANGE - climbing out of a gut.
if(attempt_vr(src,"vore_process_resist",args))
//Sure, give clickdelay for anti spam. shouldn't be combat voring anyways.
return TRUE
//Breaking out of a container (Locker, sleeper, cryo...)
else if(isobj(loc))
if(isobj(loc))
var/obj/C = loc
C.container_resist(src)
// This shouldn't give clickdelays sometime (e.g. going out of a mech/unwelded and unlocked locker/disposals bin/etc) but there's so many overrides that I am not going to bother right now.
return TRUE
else if(canmove)
if(CHECK_MOBILITY(src, MOBILITY_MOVE))
if(on_fire)
resist_fire() //stop, drop, and roll
return
if(resting) //cit change - allows resisting out of resting
resist_a_rest() // ditto
return
if(resist_embedded()) //Citadel Change for embedded removal memes
return
if(last_special <= world.time)
resist_restraints() //trying to remove cuffs.
return
// Give clickdelay
return TRUE
if(resting) //cit change - allows resisting out of resting
resist_a_rest() // ditto
// DO NOT GIVE CLCIKDELAY - resist_a_rest() handles spam prevention. Somewhat.
return FALSE
if(last_special <= world.time)
resist_restraints() //trying to remove cuffs.
// DO NOT GIVE CLICKDELAY - last_special handles this.
return FALSE
if(CHECK_MOBILITY(src, MOBILITY_USE) && resist_embedded()) //Citadel Change for embedded removal memes - requires being able to use items.
// DO NOT GIVE DEFAULT CLICKDELAY - This is a combat action.
changeNext_move(CLICK_CD_MELEE)
return FALSE
/// Proc to resist a grab. moving_resist is TRUE if this began by someone attempting to move. Return FALSE if still grabbed/failed to break out. Use this instead of resist_grab() directly.
/mob/proc/attempt_resist_grab(moving_resist, forced, log = TRUE)
if(!pulledby) //not being grabbed
return TRUE
var/old_gs = pulledby.grab_state //how strong the grab is
var/old_pulled = pulledby
var/success = do_resist_grab(moving_resist, forced)
if(log)
log_combat(src, old_pulled, "[success? "successfully broke free of" : "failed to resist"] a grab of strength [old_gs][moving_resist? " (moving)":""][forced? " (forced)":""]")
return success
/mob/proc/resist_grab(moving_resist)
return 1 //returning 0 means we successfully broke free
/*!
* Proc that actually does the grab resisting. Return TRUE if successful. Does not check that a grab exists! Use attempt_resist_grab() instead of this in general!
* Forced is if something other than the user mashing movement keys/pressing resist button did it, silent is if it makes messages (like "attempted to resist" and "broken free").
* Forced does NOT force success!
*/
/mob/proc/do_resist_grab(moving_resist, forced, silent = FALSE)
return FALSE
/mob/living/resist_grab(moving_resist)
. = 1
/mob/living/do_resist_grab(moving_resist, forced, silent = FALSE)
. = ..()
if(pulledby.grab_state)
if(!resting && prob(30/pulledby.grab_state))
if(CHECK_MOBILITY(src, MOBILITY_STAND) && prob(30/pulledby.grab_state))
visible_message("<span class='danger'>[src] has broken free of [pulledby]'s grip!</span>")
log_combat(pulledby, src, "broke grab")
pulledby.stop_pulling()
return 0
if(moving_resist && client) //we resisted by trying to move
return TRUE
else if(moving_resist && client) //we resisted by trying to move // this is a horrible system and whoever thought using client instead of mob is okay is not an okay person
client.move_delay = world.time + 20
visible_message("<span class='danger'>[src] resists against [pulledby]'s grip!</span>")
else
pulledby.stop_pulling()
return 0
return TRUE
/mob/living/proc/resist_buckle()
buckled.user_unbuckle_mob(src,src)
@@ -1048,7 +1053,7 @@
"[C] trips over [src] and falls!", \
"[C] topples over [src]!", \
"[C] leaps out of [src]'s way!")]</span>")
C.Knockdown(40)
C.DefaultCombatKnockdown(40)
/mob/living/ConveyorMove()
if((movement_type & FLYING) && !stat)
@@ -1058,61 +1063,6 @@
/mob/living/can_be_pulled()
return ..() && !(buckled && buckled.buckle_prevents_pull)
//Updates canmove, lying and icons. Could perhaps do with a rename but I can't think of anything to describe it.
//Robots, animals and brains have their own version so don't worry about them
/mob/living/proc/update_canmove()
var/ko = IsKnockdown() || IsUnconscious() || (stat && (stat != SOFT_CRIT || pulledby)) || (HAS_TRAIT(src, TRAIT_DEATHCOMA))
var/move_and_fall = stat == SOFT_CRIT && !pulledby
var/chokehold = pulledby && pulledby.grab_state >= GRAB_NECK
var/buckle_lying = !(buckled && !buckled.buckle_lying)
var/has_legs = get_num_legs()
var/has_arms = get_num_arms()
var/ignore_legs = get_leg_ignore()
var/pinned = resting && pulledby && pulledby.grab_state >= GRAB_AGGRESSIVE // Cit change - adds pinning for aggressive-grabbing people on the ground
if(ko || move_and_fall || IsStun() || chokehold) // Cit change - makes resting not force you to drop everything
drop_all_held_items()
unset_machine()
if(pulling)
stop_pulling()
else if(resting) //CIT CHANGE - makes resting make you stop pulling and interacting with machines
unset_machine() //CIT CHANGE - Ditto!
if(pulling) //CIT CHANGE - Ditto.
stop_pulling() //CIT CHANGE - Ditto...
else if(has_legs || ignore_legs)
lying = 0
if (pulledby && isliving(pulledby))
var/mob/living/L = pulledby
L.update_pull_movespeed()
if(buckled)
lying = 90*buckle_lying
else if(!lying)
if(resting)
lying = pick(90, 270) // Cit change - makes resting not force you to drop your held items
if(has_gravity()) // Cit change - Ditto
playsound(src, "bodyfall", 50, 1) // Cit change - Ditto!
else if(ko || move_and_fall || (!has_legs && !ignore_legs) || chokehold)
fall(forced = 1)
canmove = !(ko || recoveringstam || pinned || IsStun() || IsFrozen() || chokehold || buckled || (!has_legs && !ignore_legs && !has_arms)) //Cit change - makes it plausible to move while resting, adds pinning and stamina crit
density = !lying
if(resting)
ENABLE_BITFIELD(movement_type, CRAWLING)
else
DISABLE_BITFIELD(movement_type, CRAWLING)
if(lying)
if(layer == initial(layer)) //to avoid special cases like hiding larvas.
layer = LYING_MOB_LAYER //so mob lying always appear behind standing mobs
else
if(layer == LYING_MOB_LAYER)
layer = initial(layer)
update_transform()
if(!lying && lying_prev)
if(client)
client.move_delay = world.time + movement_delay()
lying_prev = lying
if(canmove && !intentionalresting && iscarbon(src) && client && client.prefs && client.prefs.autostand)//CIT CHANGE - adds autostanding as a preference
addtimer(CALLBACK(src, .proc/resist_a_rest, TRUE), 0) //CIT CHANGE - ditto
return canmove
/mob/living/proc/AddAbility(obj/effect/proc_holder/A)
abilities.Add(A)
A.on_gain(src)
@@ -1140,42 +1090,6 @@
return LINGHIVE_LINK
return LINGHIVE_NONE
/mob/living/forceMove(atom/destination)
stop_pulling()
if(buckled)
buckled.unbuckle_mob(src, force = TRUE)
if(has_buckled_mobs())
unbuckle_all_mobs(force = TRUE)
. = ..()
if(.)
if(client)
reset_perspective()
update_canmove() //if the mob was asleep inside a container and then got forceMoved out we need to make them fall.
/mob/living/proc/update_z(new_z) // 1+ to register, null to unregister
if(isnull(new_z) && audiovisual_redirect)
return
if (registered_z != new_z)
if (registered_z)
SSmobs.clients_by_zlevel[registered_z] -= src
if (client || audiovisual_redirect)
if (new_z)
SSmobs.clients_by_zlevel[new_z] += src
for (var/I in length(SSidlenpcpool.idle_mobs_by_zlevel[new_z]) to 1 step -1) //Backwards loop because we're removing (guarantees optimal rather than worst-case performance), it's fine to use .len here but doesn't compile on 511
var/mob/living/simple_animal/SA = SSidlenpcpool.idle_mobs_by_zlevel[new_z][I]
if (SA)
SA.toggle_ai(AI_ON) // Guarantees responsiveness for when appearing right next to mobs
else
SSidlenpcpool.idle_mobs_by_zlevel[new_z] -= SA
registered_z = new_z
else
registered_z = null
/mob/living/onTransitZ(old_z,new_z)
..()
update_z(new_z)
/mob/living/MouseDrop(mob/over)
. = ..()
var/mob/living/user = usr
@@ -1222,14 +1136,6 @@
GLOB.dead_mob_list += src
. = ..()
switch(var_name)
if("knockdown")
SetKnockdown(var_value)
if("stun")
SetStun(var_value)
if("unconscious")
SetUnconscious(var_value)
if("sleeping")
SetSleeping(var_value)
if("eye_blind")
set_blindness(var_value)
if("eye_damage")
@@ -1261,21 +1167,20 @@
SetSleeping(clamp_unconscious_to)
if(AmountUnconscious() > clamp_unconscious_to)
SetUnconscious(clamp_unconscious_to)
if(AmountStun() > clamp_immobility_to)
SetStun(clamp_immobility_to)
if(AmountKnockdown() > clamp_immobility_to)
SetKnockdown(clamp_immobility_to)
HealAllImmobilityUpTo(clamp_immobility_to)
adjustStaminaLoss(min(0, -stamina_boost))
adjustStaminaLossBuffered(min(0, -stamina_buffer_boost))
if(scale_stamina_loss_recovery)
adjustStaminaLoss(min(-((getStaminaLoss() - stamina_loss_recovery_bypass) * scale_stamina_loss_recovery), 0))
if(put_on_feet)
resting = FALSE
lying = FALSE
set_resting(FALSE, TRUE, FALSE)
if(reset_misc)
stuttering = 0
updatehealth()
update_stamina()
update_canmove()
update_mobility()
if(healing_chems)
reagents.add_reagent_list(healing_chems)
/mob/living/canface()
return ..() && CHECK_MOBILITY(src, MOBILITY_MOVE)
+3 -3
View File
@@ -261,21 +261,21 @@
else
visible_message("<span class='danger'>[user] has grabbed [src] aggressively!</span>", \
"<span class='userdanger'>[user] has grabbed you aggressively!</span>")
drop_all_held_items()
update_mobility()
stop_pulling()
log_combat(user, src, "grabbed", addition="aggressive grab[add_log]")
if(GRAB_NECK)
log_combat(user, src, "grabbed", addition="neck grab")
visible_message("<span class='danger'>[user] has grabbed [src] by the neck!</span>",\
"<span class='userdanger'>[user] has grabbed you by the neck!</span>")
update_canmove() //we fall down
update_mobility() //we fall down
if(!buckled && !density)
Move(user.loc)
if(GRAB_KILL)
log_combat(user, src, "strangled", addition="kill grab")
visible_message("<span class='danger'>[user] is strangling [src]!</span>", \
"<span class='userdanger'>[user] is strangling you!</span>")
update_canmove() //we fall down
update_mobility() //we fall down
if(!buckled && !density)
Move(user.loc)
return 1
+6 -1
View File
@@ -22,6 +22,8 @@
var/staminaloss = 0 //Stamina damage, or exhaustion. You recover it slowly naturally, and are knocked down if it gets too high. Holodeck and hallucinations deal this.
var/crit_threshold = HEALTH_THRESHOLD_CRIT // when the mob goes from "normal" to crit
var/mobility_flags = MOBILITY_FLAGS_DEFAULT
var/confused = 0 //Makes the mob move in random directions.
var/hallucination = 0 //Directly affects how long a mob will hallucinate for
@@ -112,4 +114,7 @@
var/drag_slowdown = TRUE //Whether the mob is slowed down when dragging another prone mob
var/rotate_on_lying = FALSE
var/rotate_on_lying = FALSE
/// Next world.time when we can get the "you can't move while buckled to [thing]" message.
var/buckle_message_cooldown = 0
+155
View File
@@ -0,0 +1,155 @@
/// IN THE FUTURE, WE WILL PROBABLY REFACTOR TO LESSEN THE NEED FOR UPDATE_MOBILITY, BUT FOR NOW.. WE CAN START DOING THIS.
/// FOR BLOCKING MOVEMENT, USE TRAIT_MOBILITY_NOMOVE AS MUCH AS POSSIBLE. IT WILL MAKE REFACTORS IN THE FUTURE EASIER.
/mob/living/ComponentInitialize()
. = ..()
RegisterSignal(src, SIGNAL_TRAIT(TRAIT_MOBILITY_NOMOVE), .proc/update_mobility)
RegisterSignal(src, SIGNAL_TRAIT(TRAIT_MOBILITY_NOPICKUP), .proc/update_mobility)
RegisterSignal(src, SIGNAL_TRAIT(TRAIT_MOBILITY_NOUSE), .proc/update_mobility)
//Stuff like mobility flag updates, resting updates, etc.
//Force-set resting variable, without needing to resist/etc.
/mob/living/proc/set_resting(new_resting, silent = FALSE, updating = TRUE)
if(new_resting != resting)
resting = new_resting
if(!silent)
to_chat(src, "<span class='notice'>You are now [resting? "resting" : "getting up"].</span>")
update_resting(updating)
/mob/living/proc/update_resting(update_mobility = TRUE)
if(update_mobility)
update_mobility()
//Force mob to rest, does NOT do stamina damage.
//It's really not recommended to use this proc to give feedback, hence why silent is defaulting to true.
/mob/living/proc/KnockToFloor(disarm_items = FALSE, silent = TRUE, updating = TRUE)
if(!silent && !resting)
to_chat(src, "<span class='warning'>You are knocked to the floor!</span>")
set_resting(TRUE, TRUE, updating)
if(disarm_items)
drop_all_held_items()
/mob/living/proc/lay_down()
set name = "Rest"
set category = "IC"
if(client?.prefs?.autostand)
intentionalresting = !intentionalresting
to_chat(src, "<span class='notice'>You are now attempting to [intentionalresting ? "[!resting ? "lay down and ": ""]stay down" : "[resting ? "get up and ": ""]stay up"].</span>")
if(intentionalresting && !resting)
set_resting(TRUE, FALSE)
else
resist_a_rest()
else
if(!resting)
set_resting(TRUE, FALSE)
to_chat(src, "<span class='notice'>You are now laying down.</span>")
else
resist_a_rest()
/mob/living/proc/resist_a_rest(automatic = FALSE, ignoretimer = FALSE) //Lets mobs resist out of resting. Major QOL change with combat reworks.
set_resting(FALSE, TRUE)
return TRUE
//Updates canmove, lying and icons. Could perhaps do with a rename but I can't think of anything to describe it.
//Robots, animals and brains have their own version so don't worry about them
/mob/living/proc/update_mobility()
var/stat_softcrit = stat == SOFT_CRIT
var/stat_conscious = (stat == CONSCIOUS) || stat_softcrit
var/conscious = !IsUnconscious() && stat_conscious && !HAS_TRAIT(src, TRAIT_DEATHCOMA)
var/has_arms = get_num_arms()
var/has_legs = get_num_legs()
var/ignore_legs = get_leg_ignore()
var/stun = IsStun()
var/paralyze = IsParalyzed()
var/knockdown = IsKnockdown()
var/daze = IsDazed()
var/immobilize = IsImmobilized()
var/chokehold = pulledby && pulledby.grab_state >= GRAB_NECK
var/restrained = restrained()
var/pinned = resting && pulledby && pulledby.grab_state >= GRAB_AGGRESSIVE // Cit change - adds pinning for aggressive-grabbing people on the ground
var/has_limbs = has_arms || ignore_legs || has_legs
var/canmove = !immobilize && !stun && conscious && !paralyze && (!stat_softcrit || !pulledby) && !chokehold && !IsFrozen() && has_limbs && !pinned && !recoveringstam
var/canresist = !stun && conscious && !stat_softcrit && !paralyze && has_limbs && !recoveringstam
if(canmove)
mobility_flags |= MOBILITY_MOVE
else
mobility_flags &= ~MOBILITY_MOVE
if(canresist)
mobility_flags |= MOBILITY_RESIST
else
mobility_flags &= ~MOBILITY_RESIST
var/canstand_involuntary = conscious && !stat_softcrit && !knockdown && !chokehold && !paralyze && (ignore_legs || has_legs) && !(buckled && buckled.buckle_lying) && !recoveringstam
var/canstand = canstand_involuntary && !resting
var/should_be_lying = !canstand
if(buckled)
if(buckled.buckle_lying != -1)
should_be_lying = buckled.buckle_lying
if(should_be_lying)
mobility_flags &= ~MOBILITY_STAND
if(!lying) //force them on the ground
lying = pick(90, 270)
if(has_gravity() && !buckled)
playsound(src, "bodyfall", 20, 1)
else
mobility_flags |= MOBILITY_STAND
lying = 0
if(should_be_lying || restrained || incapacitated())
mobility_flags &= ~(MOBILITY_UI|MOBILITY_PULL)
else
mobility_flags |= MOBILITY_UI|MOBILITY_PULL
var/canitem_general = !paralyze && !stun && conscious && !(stat_softcrit) && !chokehold && !restrained && has_arms && !recoveringstam
if(canitem_general)
mobility_flags |= (MOBILITY_USE | MOBILITY_PICKUP | MOBILITY_STORAGE | MOBILITY_HOLD)
else
mobility_flags &= ~(MOBILITY_USE | MOBILITY_PICKUP | MOBILITY_STORAGE | MOBILITY_HOLD)
if(HAS_TRAIT(src, TRAIT_MOBILITY_NOMOVE))
DISABLE_BITFIELD(mobility_flags, MOBILITY_MOVE)
if(HAS_TRAIT(src, TRAIT_MOBILITY_NOPICKUP))
DISABLE_BITFIELD(mobility_flags, MOBILITY_PICKUP)
if(HAS_TRAIT(src, TRAIT_MOBILITY_NOUSE))
DISABLE_BITFIELD(mobility_flags, MOBILITY_USE)
if(daze)
DISABLE_BITFIELD(mobility_flags, MOBILITY_USE)
//Handle update-effects.
if(!CHECK_MOBILITY(src, MOBILITY_HOLD))
drop_all_held_items()
if(!CHECK_MOBILITY(src, MOBILITY_PULL))
if(pulling)
stop_pulling()
if(!CHECK_MOBILITY(src, MOBILITY_UI))
unset_machine()
if(isliving(pulledby))
var/mob/living/L = pulledby
L.update_pull_movespeed()
//Handle lying down, voluntary or involuntary
density = !lying
if(lying)
set_resting(TRUE, TRUE, FALSE)
if(layer == initial(layer)) //to avoid special cases like hiding larvas.
layer = LYING_MOB_LAYER //so mob lying always appear behind standing mobs
else
if(layer == LYING_MOB_LAYER)
layer = initial(layer)
update_transform()
lying_prev = lying
//Handle citadel autoresist
if(CHECK_MOBILITY(src, MOBILITY_MOVE) && !intentionalresting && canstand_involuntary && iscarbon(src) && client?.prefs?.autostand)//CIT CHANGE - adds autostanding as a preference
addtimer(CALLBACK(src, .proc/resist_a_rest, TRUE), 0) //CIT CHANGE - ditto
return mobility_flags
+77 -4
View File
@@ -12,10 +12,14 @@
return (!density || lying)
if(buckled == mover)
return TRUE
if(ismob(mover))
if (mover in buckled_mobs)
if(!ismob(mover))
if(mover.throwing?.thrower == src)
return TRUE
return (!mover.density || !density || lying || (mover.throwing && mover.throwing.thrower == src && !ismob(mover)))
if(ismob(mover))
if(mover in buckled_mobs)
return TRUE
var/mob/living/L = mover //typecast first, check isliving and only check this if living using short circuit
return (!density || (isliving(mover)? L.can_move_under_living(src) : !mover.density))
/mob/living/toggle_move_intent()
. = ..()
@@ -25,6 +29,10 @@
update_move_intent_slowdown()
return ..()
/// whether or not we can slide under another living mob. defaults to if we're not dense. CanPass should check "overriding circumstances" like buckled mobs/having PASSMOB flag, etc.
/mob/living/proc/can_move_under_living(mob/living/other)
return !density
/mob/living/proc/update_move_intent_slowdown()
var/mod = 0
if(m_intent == MOVE_INTENT_WALK)
@@ -50,4 +58,69 @@
remove_movespeed_modifier(MOVESPEED_ID_PRONE_DRAGGING)
/mob/living/canZMove(dir, turf/target)
return can_zTravel(target, dir) && (movement_type & FLYING)
return can_zTravel(target, dir) && (movement_type & FLYING)
/mob/living/Move(atom/newloc, direct)
if (buckled && buckled.loc != newloc) //not updating position
if (!buckled.anchored)
return buckled.Move(newloc, direct)
else
return 0
var/old_direction = dir
var/turf/T = loc
if(pulling)
update_pull_movespeed()
. = ..()
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()
if(active_storage && !(CanReach(active_storage.parent,view_only = TRUE)))
active_storage.close(src)
if(lying && !buckled && prob(getBruteLoss()*200/maxHealth))
makeTrail(newloc, T, old_direction)
/mob/living/forceMove(atom/destination)
stop_pulling()
if(buckled)
buckled.unbuckle_mob(src, force = TRUE)
if(has_buckled_mobs())
unbuckle_all_mobs(force = TRUE)
. = ..()
if(.)
if(client)
reset_perspective()
update_mobility() //if the mob was asleep inside a container and then got forceMoved out we need to make them fall.
/mob/living/proc/update_z(new_z) // 1+ to register, null to unregister
if(isnull(new_z) && audiovisual_redirect)
return
if (registered_z != new_z)
if (registered_z)
SSmobs.clients_by_zlevel[registered_z] -= src
if (client || audiovisual_redirect)
if (new_z)
SSmobs.clients_by_zlevel[new_z] += src
for (var/I in length(SSidlenpcpool.idle_mobs_by_zlevel[new_z]) to 1 step -1) //Backwards loop because we're removing (guarantees optimal rather than worst-case performance), it's fine to use .len here but doesn't compile on 511
var/mob/living/simple_animal/SA = SSidlenpcpool.idle_mobs_by_zlevel[new_z][I]
if (SA)
SA.toggle_ai(AI_ON) // Guarantees responsiveness for when appearing right next to mobs
else
SSidlenpcpool.idle_mobs_by_zlevel[new_z] -= SA
registered_z = new_z
else
registered_z = null
/mob/living/onTransitZ(old_z,new_z)
..()
update_z(new_z)
/mob/living/canface()
if(!CHECK_MOBILITY(src, MOBILITY_MOVE))
return FALSE
return ..()
+6 -4
View File
@@ -18,7 +18,7 @@
icon_state = "ai"
move_resist = MOVE_FORCE_OVERPOWERING
density = TRUE
canmove = FALSE
mobility_flags = ALL
status_flags = CANSTUN|CANPUSH
a_intent = INTENT_HARM //so we always get pushed instead of trying to swap
sight = SEE_TURFS | SEE_MOBS | SEE_OBJS
@@ -324,8 +324,10 @@
to_chat(src, "<b>You are now [is_anchored ? "" : "un"]anchored.</b>")
// the message in the [] will change depending whether or not the AI is anchored
/mob/living/silicon/ai/update_canmove() //If the AI dies, mobs won't go through it anymore
return 0
// AIs are immobile
/mob/living/silicon/ai/update_mobility()
mobility_flags = ALL
return ALL
/mob/living/silicon/ai/proc/ai_cancel_call()
set category = "Malfunction"
@@ -987,7 +989,7 @@
deployed_shell.undeploy()
diag_hud_set_deployed()
/mob/living/silicon/ai/resist()
/mob/living/silicon/ai/do_resist()
return
/mob/living/silicon/ai/spawned/Initialize(mapload, datum/ai_laws/L, mob/target_ai)
+1 -1
View File
@@ -15,7 +15,7 @@
cameraFollow = null
move_resist = MOVE_FORCE_NORMAL
update_canmove()
update_mobility()
if(eyeobj)
eyeobj.setLoc(get_turf(src))
set_eyeobj_visible(FALSE)
+1 -1
View File
@@ -2,7 +2,7 @@
if(stat == DEAD)
return
stat = DEAD
canmove = 0
update_mobility()
update_sight()
clear_fullscreens()
+1 -2
View File
@@ -80,7 +80,7 @@
var/radio_short_cooldown = 3 MINUTES
var/radio_short_timerid
canmove = FALSE
mobility_flags = NONE
var/silent = FALSE
var/brightness_power = 5
@@ -101,7 +101,6 @@
START_PROCESSING(SSfastprocess, src)
GLOB.pai_list += src
make_laws()
canmove = 0
if(!istype(P)) //when manually spawning a pai, we create a card to put it into.
var/newcardloc = P
P = new /obj/item/paicard(newcardloc)
@@ -8,7 +8,7 @@
if(. & EMP_PROTECT_SELF)
return
take_holo_damage(50/severity)
Knockdown(400/severity)
DefaultCombatKnockdown(400/severity)
silent = max(silent, (PAI_EMP_SILENCE_DURATION) / SSmobs.wait / severity)
if(holoform)
fold_in(force = TRUE)
@@ -23,10 +23,10 @@
qdel(src)
if(2)
fold_in(force = 1)
Knockdown(400)
DefaultCombatKnockdown(400)
if(3)
fold_in(force = 1)
Knockdown(200)
DefaultCombatKnockdown(200)
//ATTACK HAND IGNORING PARENT RETURN VALUE
/mob/living/silicon/pai/attack_hand(mob/living/carbon/human/user)
@@ -98,7 +98,7 @@
take_holo_damage(amount * 0.25)
/mob/living/silicon/pai/adjustOrganLoss(slot, amount, maximum = 500) //I kept this in, unlike tg
Knockdown(amount * 0.2)
DefaultCombatKnockdown(amount * 0.2)
/mob/living/silicon/pai/getBruteLoss()
return emittermaxhealth - emitterhealth
@@ -17,7 +17,6 @@
return FALSE
emitter_next_use = world.time + emittercd
canmove = TRUE
density = TRUE
if(istype(card.loc, /obj/item/pda))
var/obj/item/pda/P = card.loc
@@ -37,6 +36,7 @@
C.push_data()
forceMove(get_turf(card))
card.forceMove(src)
update_mobility()
if(client)
client.perspective = EYE_PERSPECTIVE
client.eye = src
@@ -63,12 +63,11 @@
var/turf/T = drop_location()
card.forceMove(T)
forceMove(card)
canmove = FALSE
density = FALSE
set_light(0)
holoform = FALSE
if(resting)
lay_down()
set_resting(FALSE, TRUE, FALSE)
update_mobility()
/mob/living/silicon/pai/proc/choose_chassis()
if(!isturf(loc) && loc != card)
@@ -21,7 +21,7 @@
locked = FALSE //unlock cover
update_canmove()
update_mobility()
if(!QDELETED(builtInCamera) && builtInCamera.status)
builtInCamera.toggle_cam(src,0)
update_headlamp(1) //So borg lights are disabled when killed.
@@ -91,12 +91,3 @@
add_overlay(fire_overlay)
else
cut_overlay(fire_overlay)
/mob/living/silicon/robot/update_canmove()
if(stat || buckled || lockcharge || resting) //CITADEL EDIT resting dogborg-os
canmove = 0
else
canmove = 1
update_transform()
update_action_buttons_icon()
return canmove
+9 -83
View File
@@ -64,7 +64,7 @@
var/lawupdate = 1 //Cyborgs will sync their laws with their AI by default
var/scrambledcodes = 0 // Used to determine if a borg shows up on the robotics console. Setting to one hides them.
var/lockcharge //Boolean of whether the borg is locked down or not
var/locked_down //Boolean of whether the borg is locked down or not
var/toner = 0
var/tonermax = 40
@@ -493,7 +493,7 @@
update_icons()
else if(istype(W, /obj/item/wrench) && opened && !cell) //Deconstruction. The flashes break from the fall, to prevent this from being a ghetto reset module.
if(!lockcharge)
if(!locked_down)
to_chat(user, "<span class='boldannounce'>[src]'s bolts spark! Maybe you should lock them down first!</span>")
spark_system.start()
return
@@ -655,65 +655,6 @@
/mob/living/silicon/robot/regenerate_icons()
return update_icons()
/mob/living/silicon/robot/update_icons()
cut_overlays()
icon_state = module.cyborg_base_icon
//Citadel changes start here - Allows modules to use different icon files, and allows modules to specify a pixel offset
icon = (module.cyborg_icon_override ? module.cyborg_icon_override : initial(icon))
if(laser)
add_overlay("laser")//Is this even used??? - Yes borg/inventory.dm
if(disabler)
add_overlay("disabler")//ditto
if(sleeper_g && module.sleeper_overlay)
add_overlay("[module.sleeper_overlay]_g[sleeper_nv ? "_nv" : ""]")
if(sleeper_r && module.sleeper_overlay)
add_overlay("[module.sleeper_overlay]_r[sleeper_nv ? "_nv" : ""]")
if(stat == DEAD && module.has_snowflake_deadsprite)
icon_state = "[module.cyborg_base_icon]-wreck"
if(module.cyborg_pixel_offset)
pixel_x = module.cyborg_pixel_offset
//End of citadel changes
if(module.cyborg_base_icon == "robot")
icon = 'icons/mob/robots.dmi'
pixel_x = initial(pixel_x)
if(stat != DEAD && !(IsUnconscious() || IsStun() || IsKnockdown() || low_power_mode)) //Not dead, not stunned.
if(!eye_lights)
eye_lights = new()
if(lamp_intensity > 2)
eye_lights.icon_state = "[module.special_light_key ? "[module.special_light_key]":"[module.cyborg_base_icon]"]_l"
else
eye_lights.icon_state = "[module.special_light_key ? "[module.special_light_key]":"[module.cyborg_base_icon]"]_e[is_servant_of_ratvar(src) ? "_r" : ""]"
eye_lights.icon = icon
add_overlay(eye_lights)
if(opened)
if(wiresexposed)
add_overlay("ov-opencover +w")
else if(cell)
add_overlay("ov-opencover +c")
else
add_overlay("ov-opencover -c")
if(hat)
var/mutable_appearance/head_overlay = hat.build_worn_icon(state = hat.icon_state, default_layer = 20, default_icon_file = 'icons/mob/head.dmi')
head_overlay.pixel_y += hat_offset
add_overlay(head_overlay)
update_fire()
if(client && stat != DEAD && module.dogborg == TRUE)
if(resting)
if(sitting)
icon_state = "[module.cyborg_base_icon]-sit"
if(bellyup)
icon_state = "[module.cyborg_base_icon]-bellyup"
else if(!sitting && !bellyup)
icon_state = "[module.cyborg_base_icon]-rest"
cut_overlays()
else
icon_state = "[module.cyborg_base_icon]"
/mob/living/silicon/robot/proc/self_destruct()
if(emagged)
if(mmi)
@@ -728,8 +669,6 @@
connected_ai.connected_robots -= src
src.connected_ai = null
lawupdate = 0
lockcharge = 0
canmove = 1
scrambledcodes = 1
//Disconnect it's camera so it's not so easily tracked.
if(!QDELETED(builtInCamera))
@@ -738,6 +677,7 @@
// Instead of being listed as "deactivated". The downside is that I'm going
// to have to check if every camera is null or not before doing anything, to prevent runtime errors.
// I could change the network to null but I don't know what would happen, and it seems too hacky for me.
update_mobility()
/mob/living/silicon/robot/mode()
set name = "Activate Held Object"
@@ -759,8 +699,8 @@
throw_alert("locked", /obj/screen/alert/locked)
else
clear_alert("locked")
lockcharge = state
update_canmove()
locked_down = state
update_mobility()
/mob/living/silicon/robot/proc/SetEmagged(new_state)
emagged = new_state
@@ -949,7 +889,7 @@
to_chat(connected_ai, "<br><br><span class='notice'>NOTICE - Remote telemetry lost with [name].</span><br>")
/mob/living/silicon/robot/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE, no_tk=FALSE)
if(stat || lockcharge || low_power_mode)
if(stat || locked_down || low_power_mode)
to_chat(src, "<span class='warning'>You can't do that right now!</span>")
return FALSE
if(be_close && !in_range(M, src))
@@ -1025,17 +965,17 @@
if(health <= -maxHealth) //die only once
death()
return
if(IsUnconscious() || IsStun() || IsKnockdown() || getOxyLoss() > maxHealth*0.5)
if(IsUnconscious() || IsStun() || IsParalyzed() || getOxyLoss() > maxHealth*0.5)
if(stat == CONSCIOUS)
stat = UNCONSCIOUS
blind_eyes(1)
update_canmove()
update_mobility()
update_headlamp()
else
if(stat == UNCONSCIOUS)
stat = CONSCIOUS
adjust_blindness(-1)
update_canmove()
update_mobility()
update_headlamp()
diag_hud_set_status()
diag_hud_set_health()
@@ -1269,20 +1209,6 @@
for(var/i in connected_ai.aicamera.stored)
aicamera.stored[i] = TRUE
/mob/living/silicon/robot/lay_down()
..()
update_canmove()
/mob/living/silicon/robot/update_canmove()
..()
if(client && stat != DEAD && dogborg == FALSE)
if(resting)
cut_overlays()
icon_state = "[module.cyborg_base_icon]-rest"
else
icon_state = "[module.cyborg_base_icon]"
update_icons()
/mob/living/silicon/robot/proc/rest_style()
set name = "Switch Rest Style"
set category = "Robot Commands"
@@ -36,7 +36,7 @@
"<span class='userdanger'>[M] has disabled [src]'s active module!</span>", null, COMBAT_MESSAGE_RANGE)
log_combat(M, src, "disarmed", "[I ? " removing \the [I]" : ""]")
else
Stun(40)
Paralyze(40)
step(src,get_dir(M,src))
log_combat(M, src, "pushed")
visible_message("<span class='danger'>[M] has forced back [src]!</span>", \
@@ -86,9 +86,9 @@
return
switch(severity)
if(1)
Stun(160)
Paralyze(160)
if(2)
Stun(60)
Paralyze(60)
/mob/living/silicon/robot/emag_act(mob/user)
@@ -0,0 +1,15 @@
/mob/living/silicon/robot/update_mobility()
var/newflags = NONE
if(!stat)
if(!resting)
newflags |= (MOBILITY_STAND | MOBILITY_RESIST)
if(!locked_down)
newflags |= MOBILITY_MOVE
newflags |= MOBILITY_PULL
if(!locked_down)
newflags |= MOBILITY_FLAGS_ANY_INTERACTION
mobility_flags = newflags
update_transform()
update_action_buttons_icon()
update_icons()
return mobility_flags
@@ -257,7 +257,7 @@
/obj/item/robot_module/proc/do_transform_delay()
var/mob/living/silicon/robot/R = loc
var/prev_lockcharge = R.lockcharge
var/prev_locked_down = R.locked_down
sleep(1)
flick("[cyborg_base_icon]_transform", R)
R.notransform = TRUE
@@ -267,7 +267,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(7)
if(!prev_lockcharge)
if(!prev_locked_down)
R.SetLockdown(0)
R.setDir(SOUTH)
R.anchored = FALSE
@@ -0,0 +1,59 @@
/// this is bad code
/mob/living/silicon/robot/update_icons()
cut_overlays()
icon_state = module.cyborg_base_icon
//Citadel changes start here - Allows modules to use different icon files, and allows modules to specify a pixel offset
icon = (module.cyborg_icon_override ? module.cyborg_icon_override : initial(icon))
if(laser)
add_overlay("laser")//Is this even used??? - Yes borg/inventory.dm
if(disabler)
add_overlay("disabler")//ditto
if(sleeper_g && module.sleeper_overlay)
add_overlay("[module.sleeper_overlay]_g[sleeper_nv ? "_nv" : ""]")
if(sleeper_r && module.sleeper_overlay)
add_overlay("[module.sleeper_overlay]_r[sleeper_nv ? "_nv" : ""]")
if(stat == DEAD && module.has_snowflake_deadsprite)
icon_state = "[module.cyborg_base_icon]-wreck"
if(module.cyborg_pixel_offset)
pixel_x = module.cyborg_pixel_offset
//End of citadel changes
if(module.cyborg_base_icon == "robot")
icon = 'icons/mob/robots.dmi'
pixel_x = initial(pixel_x)
if(stat != DEAD && !(IsUnconscious() ||IsStun() || IsKnockdown() || IsParalyzed() || low_power_mode)) //Not dead, not stunned.
if(!eye_lights)
eye_lights = new()
if(lamp_intensity > 2)
eye_lights.icon_state = "[module.special_light_key ? "[module.special_light_key]":"[module.cyborg_base_icon]"]_l"
else
eye_lights.icon_state = "[module.special_light_key ? "[module.special_light_key]":"[module.cyborg_base_icon]"]_e[is_servant_of_ratvar(src) ? "_r" : ""]"
eye_lights.icon = icon
add_overlay(eye_lights)
if(opened)
if(wiresexposed)
add_overlay("ov-opencover +w")
else if(cell)
add_overlay("ov-opencover +c")
else
add_overlay("ov-opencover -c")
if(hat)
var/mutable_appearance/head_overlay = hat.build_worn_icon(state = hat.icon_state, default_layer = 20, default_icon_file = 'icons/mob/head.dmi')
head_overlay.pixel_y += hat_offset
add_overlay(head_overlay)
update_fire()
if(client && stat != DEAD && module.dogborg == TRUE)
if(resting)
if(sitting)
icon_state = "[module.cyborg_base_icon]-sit"
if(bellyup)
icon_state = "[module.cyborg_base_icon]-bellyup"
else if(!sitting && !bellyup)
icon_state = "[module.cyborg_base_icon]-rest"
cut_overlays()
else
icon_state = "[module.cyborg_base_icon]"
@@ -32,7 +32,7 @@
var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
if(prob(damage))
for(var/mob/living/N in buckled_mobs)
N.Knockdown(20)
N.DefaultCombatKnockdown(20)
unbuckle_mob(N)
N.visible_message("<span class='boldwarning'>[N] is knocked off of [src] by [M]!</span>")
switch(M.melee_damage_type)
@@ -106,7 +106,7 @@
for(var/mob/living/M in buckled_mobs)
if(prob(severity*50))
unbuckle_mob(M)
M.Knockdown(40)
M.DefaultCombatKnockdown(40)
M.visible_message("<span class='boldwarning'>[M] is thrown off of [src]!</span>")
flash_act(affect_silicon = 1)
@@ -123,7 +123,7 @@
for(var/mob/living/M in buckled_mobs)
M.visible_message("<span class='boldwarning'>[M] is knocked off of [src]!</span>")
unbuckle_mob(M)
M.Knockdown(40)
M.DefaultCombatKnockdown(40)
if(P.stun || P.knockdown)
for(var/mob/living/M in buckled_mobs)
unbuckle_mob(M)
@@ -32,7 +32,6 @@
/mob/living/simple_animal/astral/death()
icon_state = "shade_dead"
Stun(1000)
canmove = 0
friendly = "deads at"
pseudo_death = TRUE
incorporeal_move = 0
@@ -115,7 +115,7 @@
if(stat)
return FALSE
on = TRUE
canmove = TRUE
update_mobility()
set_light(initial(light_range))
update_icon()
diag_hud_set_botstat()
@@ -123,7 +123,7 @@
/mob/living/simple_animal/bot/proc/turn_off()
on = FALSE
canmove = FALSE
update_mobility()
set_light(0)
bot_reset() //Resets an AI's call, should it exist.
update_icon()
@@ -160,11 +160,11 @@
path_hud.add_to_hud(src)
path_hud.add_hud_to(src)
/mob/living/simple_animal/bot/update_canmove()
/mob/living/simple_animal/bot/update_mobility()
. = ..()
if(!on)
. = 0
canmove = .
. = NONE
mobility_flags = .
/mob/living/simple_animal/bot/Destroy()
if(path_hud)
@@ -525,7 +525,7 @@ Auto Patrol[]"},
return
if(iscarbon(A))
var/mob/living/carbon/C = A
if(C.canmove || arrest_type) // CIT CHANGE - makes sentient ed209s check for canmove rather than !isstun.
if(CHECK_MOBILITY(C, MOBILITY_STAND|MOBILITY_MOVE|MOBILITY_USE) || arrest_type) // CIT CHANGE - makes sentient ed209s check for canmove rather than !isstun.
stun_attack(A)
else if(C.canBeHandcuffed() && !C.handcuffed)
cuff(A)
@@ -543,7 +543,7 @@ Auto Patrol[]"},
spawn(2)
icon_state = "[lasercolor]ed209[on]"
var/threat = 5
C.Knockdown(100)
C.DefaultCombatKnockdown(100)
C.stuttering = 5
if(ishuman(C))
var/mob/living/carbon/human/H = C
@@ -170,7 +170,7 @@
if(!..())
return
if(IsStun())
if(IsStun() || IsParalyzed())
old_target_fire = target_fire
target_fire = null
mode = BOT_IDLE
@@ -287,7 +287,7 @@
if(!on)
icon_state = "firebot0"
return
if(IsStun())
if(IsStun() || IsParalyzed())
icon_state = "firebots1"
else if(stationary_mode) //Bot has yellow light to indicate stationary mode.
icon_state = "firebots1"
@@ -196,7 +196,7 @@ Maintenance panel panel is [open ? "opened" : "closed"]"},
C.stuttering = 20
C.adjustEarDamage(0, 5) //far less damage than the H.O.N.K.
C.Jitter(50)
C.Knockdown(60)
C.DefaultCombatKnockdown(60)
var/mob/living/carbon/human/H = C
if(client) //prevent spam from players..
spam_flag = TRUE
@@ -215,7 +215,7 @@ Maintenance panel panel is [open ? "opened" : "closed"]"},
"<span class='userdanger'>[src] has honked you!</span>")
else
C.stuttering = 20
C.Knockdown(80)
C.DefaultCombatKnockdown(80)
addtimer(CALLBACK(src, .proc/spam_flag_false), cooldowntime)
@@ -358,7 +358,7 @@ Maintenance panel panel is [open ? "opened" : "closed"]"},
"[C] trips over [src] and falls!", \
"[C] topples over [src]!", \
"[C] leaps out of [src]'s way!")]</span>")
C.Knockdown(10)
C.DefaultCombatKnockdown(10)
playsound(loc, 'sound/misc/sadtrombone.ogg', 50, 1, -1)
if(!client)
speak("Honk!")
@@ -106,7 +106,7 @@
skin = new_skin
update_icon()
/mob/living/simple_animal/bot/medbot/update_canmove()
/mob/living/simple_animal/bot/medbot/update_mobility()
. = ..()
update_icon()
@@ -662,7 +662,7 @@
if(!paicard)
log_combat(src, L, "knocked down")
visible_message("<span class='danger'>[src] knocks over [L]!</span>")
L.Knockdown(160)
L.DefaultCombatKnockdown(160)
return ..()
// called from mob/living/carbon/human/Crossed()
@@ -747,8 +747,8 @@
else
return null
/mob/living/simple_animal/bot/mulebot/resist()
..()
/mob/living/simple_animal/bot/mulebot/do_resist()
. = ..()
if(load)
unload()
@@ -213,7 +213,7 @@ Auto Patrol: []"},
return
if(iscarbon(A))
var/mob/living/carbon/C = A
if(C.canmove || arrest_type) // CIT CHANGE - makes sentient secbots check for canmove rather than !isstun.
if(CHECK_MOBILITY(C, MOBILITY_MOVE|MOBILITY_USE|MOBILITY_STAND) || arrest_type) // CIT CHANGE - makes sentient secbots check for canmove rather than !isstun.
stun_attack(A)
else if(C.canBeHandcuffed() && !C.handcuffed)
cuff(A)
@@ -254,11 +254,11 @@ Auto Patrol: []"},
var/threat = 5
if(ishuman(C))
C.stuttering = 5
C.Knockdown(100)
C.DefaultCombatKnockdown(100)
var/mob/living/carbon/human/H = C
threat = H.assess_threat(judgement_criteria, weaponcheck=CALLBACK(src, .proc/check_for_weapons))
else
C.Knockdown(100)
C.DefaultCombatKnockdown(100)
C.stuttering = 5
threat = C.assess_threat(judgement_criteria, weaponcheck=CALLBACK(src, .proc/check_for_weapons))
@@ -353,7 +353,7 @@
if(!LAZYLEN(parts))
if(undismembermerable_limbs) //they have limbs we can't remove, and no parts we can, attack!
return ..()
C.Knockdown(60)
C.DefaultCombatKnockdown(60)
visible_message("<span class='danger'>[src] knocks [C] down!</span>")
to_chat(src, "<span class='cultlarge'>\"Bring [C.p_them()] to me.\"</span>")
return FALSE
@@ -33,7 +33,7 @@
. = ..()
AddElement(/datum/element/wuv, "bzzs!")
/mob/living/simple_animal/pet/bumbles/update_canmove()
/mob/living/simple_animal/pet/bumbles/update_mobility()
. = ..()
if(client && stat != DEAD)
if (resting)
@@ -43,10 +43,10 @@
AddElement(/datum/element/wuv, "purrs!", EMOTE_AUDIBLE, /datum/mood_event/pet_animal, "hisses!", EMOTE_AUDIBLE)
AddElement(/datum/element/mob_holder, held_icon)
/mob/living/simple_animal/pet/cat/update_canmove()
..()
/mob/living/simple_animal/pet/cat/update_mobility()
. = ..()
if(client && stat != DEAD)
if (resting)
if(!CHECK_MOBILITY(src, MOBILITY_STAND))
icon_state = "[icon_living]_rest"
collar_type = "[initial(collar_type)]_rest"
else
@@ -180,27 +180,24 @@
emote("me", EMOTE_VISIBLE, pick("stretches out for a belly rub.", "wags its tail.", "lies down."))
icon_state = "[icon_living]_rest"
collar_type = "[initial(collar_type)]_rest"
resting = 1
update_canmove()
set_resting(TRUE)
else if (prob(1))
emote("me", EMOTE_VISIBLE, pick("sits down.", "crouches on its hind legs.", "looks alert."))
icon_state = "[icon_living]_sit"
collar_type = "[initial(collar_type)]_sit"
resting = 1
update_canmove()
set_resting(TRUE)
else if (prob(1))
if (resting)
emote("me", EMOTE_VISIBLE, pick("gets up and meows.", "walks around.", "stops resting."))
icon_state = "[icon_living]"
collar_type = "[initial(collar_type)]"
resting = 0
update_canmove()
set_resting(FALSE)
else
emote("me", EMOTE_VISIBLE, pick("grooms its fur.", "twitches its whiskers.", "shakes out its coat."))
//MICE!
if((src.loc) && isturf(src.loc))
if(!stat && !resting && !buckled)
if(!stat && CHECK_MULTIPLE_BITFIELDS(mobility_flags, MOBILITY_STAND|MOBILITY_MOVE) && !buckled)
for(var/mob/living/simple_animal/mouse/M in view(1,src))
if(!M.stat && Adjacent(M))
emote("me", EMOTE_VISIBLE, "splats \the [M]!")
@@ -217,7 +214,7 @@
make_babies()
if(!stat && !resting && !buckled)
if(!stat && CHECK_MULTIPLE_BITFIELDS(mobility_flags, MOBILITY_STAND|MOBILITY_MOVE) && !buckled)
turns_since_scan++
if(turns_since_scan > 5)
walk_to(src,0)
@@ -309,7 +306,6 @@
if (pseudo_death == TRUE) //secret cat chem
icon_state = "custom_cat_dead"
Stun(1000)
canmove = 0
friendly = "deads at"
return
else
@@ -26,7 +26,7 @@
..()
//CRAB movement
if(!ckey && !stat)
if(isturf(src.loc) && !resting && !buckled) //This is so it only moves if it's not inside a closet, gentics machine, etc.
if(isturf(loc) && !resting && !buckled) //This is so it only moves if it's not inside a closet, gentics machine, etc.
turns_since_move++
if(turns_since_move >= turns_per_move)
var/east_vs_west = pick(4,8)
@@ -425,7 +425,7 @@
..()
//Feeding, chasing food, FOOOOODDDD
if(!stat && !resting && !buckled)
if(!stat && CHECK_MULTIPLE_BITFIELDS(mobility_flags, MOBILITY_STAND|MOBILITY_MOVE) && !buckled)
turns_since_scan++
if(turns_since_scan > 5)
turns_since_scan = 0
@@ -625,7 +625,7 @@
make_babies()
if(!stat && !resting && !buckled)
if(!stat && CHECK_MULTIPLE_BITFIELDS(mobility_flags, MOBILITY_STAND|MOBILITY_MOVE) && !buckled)
if(prob(1))
emote("me", EMOTE_VISIBLE, pick("dances around.","chases her tail."))
spawn(0)
@@ -635,8 +635,7 @@
/mob/living/simple_animal/pet/dog/pug/Life()
..()
if(!stat && !resting && !buckled)
if(!stat && CHECK_MULTIPLE_BITFIELDS(mobility_flags, MOBILITY_STAND|MOBILITY_MOVE) && !buckled)
if(prob(1))
emote("me", EMOTE_VISIBLE, pick("chases its tail."))
spawn(0)
@@ -204,37 +204,6 @@
else
icon_state = "[visualAppearence]_dead"
/mob/living/simple_animal/drone/cogscarab/Stun(amount, updating = 1, ignore_canstun = 0)
/mob/living/simple_animal/drone/cogscarab/update_mobility()
. = ..()
if(.)
update_icons()
/mob/living/simple_animal/drone/cogscarab/SetStun(amount, updating = 1, ignore_canstun = 0)
. = ..()
if(.)
update_icons()
/mob/living/simple_animal/drone/cogscarab/AdjustStun(amount, updating = 1, ignore_canstun = 0)
. = ..()
if(.)
update_icons()
/mob/living/simple_animal/drone/cogscarab/Knockdown(amount, updating = TRUE, ignore_canknockdown = FALSE, override_hardstun, override_stamdmg)
. = ..()
if(.)
update_icons()
/mob/living/simple_animal/drone/cogscarab/SetKnockdown(amount, updating = 1, ignore_canknockdown = 0)
. = ..()
if(.)
update_icons()
/mob/living/simple_animal/drone/cogscarab/AdjustKnockdown(amount, updating = 1, ignore_canknockdown = 0)
. = ..()
if(.)
update_icons()
/mob/living/simple_animal/drone/cogscarab/update_canmove()
. = ..()
if(.)
update_icons()
update_icons()
@@ -160,7 +160,7 @@
M.visible_message("<span class='warning'>[M] tips over [src].</span>",
"<span class='notice'>You tip over [src].</span>")
to_chat(src, "<span class='userdanger'>You are tipped over by [M]!</span>")
Knockdown(60,ignore_canknockdown = TRUE)
DefaultCombatKnockdown(60,ignore_canknockdown = TRUE)
icon_state = icon_dead
spawn(rand(20,50))
if(!stat && M)
@@ -41,6 +41,6 @@
. = ..()
if(. && prob(12) && iscarbon(target))
var/mob/living/carbon/C = target
C.Knockdown(60)
C.DefaultCombatKnockdown(60)
C.visible_message("<span class='danger'>\The [src] knocks down \the [C]!</span>", \
"<span class='userdanger'>\The [src] knocks you down!</span>")
@@ -71,7 +71,7 @@
var/atom/throw_target = get_edge_target_turf(L, dir)
L.throw_at(throw_target, rand(1,2), 7, src)
else
L.Knockdown(20)
L.DefaultCombatKnockdown(20)
visible_message("<span class='danger'>[src] knocks [L] down!</span>")
/mob/living/simple_animal/hostile/gorilla/CanAttack(atom/the_target)
@@ -93,7 +93,7 @@
var/mob/living/L = AM
if(!istype(L, /mob/living/simple_animal/hostile/jungle/leaper))
playsound(src,'sound/effects/snap.ogg',50, 1, -1)
L.Knockdown(50)
L.DefaultCombatKnockdown(50)
if(iscarbon(L))
var/mob/living/carbon/C = L
C.reagents.add_reagent(/datum/reagent/toxin/leaper_venom, 5)
@@ -69,7 +69,7 @@
icon_state = initial(icon_state)
if(prob(15) && iscarbon(target))
var/mob/living/carbon/C = target
C.Knockdown(40)
C.DefaultCombatKnockdown(40)
C.visible_message("<span class='danger'>\The [src] knocks down \the [C]!</span>", \
"<span class='userdanger'>\The [src] knocks you down!</span>")
@@ -179,7 +179,7 @@ GLOBAL_LIST_INIT(protected_objects, list(/obj/structure/table, /obj/structure/ca
. = ..()
if(knockdown_people && . && prob(15) && iscarbon(target))
var/mob/living/carbon/C = target
C.Knockdown(40)
C.DefaultCombatKnockdown(40)
C.visible_message("<span class='danger'>\The [src] knocks down \the [C]!</span>", \
"<span class='userdanger'>\The [src] knocks you down!</span>")
@@ -44,7 +44,7 @@
var/mob/living/carbon/L = .
if(istype(L))
if(prob(25))
L.Knockdown(20)
L.DefaultCombatKnockdown(20)
L.visible_message("<span class='danger'>\the [src] knocks down \the [L]!</span>")
@@ -56,7 +56,7 @@
if(iscarbon(target))
var/mob/living/carbon/C = target
if(prob(15))
C.Knockdown(60)
C.DefaultCombatKnockdown(60)
C.visible_message("<span class='danger'>\The [src] knocks down \the [C]!</span>", \
"<span class='userdanger'>\The [src] knocks you down!</span>")
@@ -94,7 +94,7 @@
if(prob(grasp_pull_chance))
setDir(get_dir(src,L) )//staaaare
step(L,get_dir(L,src)) //reel them in
L.Knockdown(60) //you can't get away now~
L.DefaultCombatKnockdown(60) //you can't get away now~
if(grasping.len < max_grasps)
grasping:
@@ -381,7 +381,7 @@
/mob/living/simple_animal/parrot/handle_automated_movement()
if(!isturf(src.loc) || !canmove || buckled)
if(!isturf(loc) || !CHECK_MOBILITY(src, MOBILITY_MOVE) || buckled)
return //If it can't move, dont let it move. (The buckled check probably isn't necessary thanks to canmove)
if(client && stat == CONSCIOUS && parrot_state != icon_living)
@@ -153,7 +153,7 @@
/mob/living/simple_animal/proc/handle_automated_movement()
set waitfor = FALSE
if(!stop_automated_movement && wander)
if((isturf(src.loc) || allow_movement_on_non_turfs) && !resting && !buckled && canmove) //This is so it only moves if it's not inside a closet, gentics machine, etc.
if((isturf(src.loc) || allow_movement_on_non_turfs) && CHECK_MULTIPLE_BITFIELDS(mobility_flags, MOBILITY_STAND|MOBILITY_MOVE) && !buckled) //This is so it only moves if it's not inside a closet, gentics machine, etc.
turns_since_move++
if(turns_since_move >= turns_per_move)
if(!(stop_automated_movement_when_pulled && pulledby)) //Some animals don't move when pulled
@@ -418,20 +418,19 @@
else
..()
/mob/living/simple_animal/update_canmove(value_otherwise = TRUE)
if(IsUnconscious() || IsStun() || IsKnockdown() || stat || resting)
/mob/living/simple_animal/update_mobility(value_otherwise = MOBILITY_FLAGS_DEFAULT)
if(IsUnconscious() || IsStun() || IsParalyzed() || stat || resting)
drop_all_held_items()
canmove = FALSE
mobility_flags = NONE
else if(buckled)
canmove = FALSE
mobility_flags = ~MOBILITY_MOVE
else
canmove = value_otherwise
if(!canmove) // !(mobility_flags & MOBILITY_MOVE)
mobility_flags = MOBILITY_FLAGS_DEFAULT
if(!CHECK_MOBILITY(src, MOBILITY_MOVE)) // !(mobility_flags & MOBILITY_MOVE)
walk(src, 0) //stop mid walk
update_transform()
update_action_buttons_icon()
return canmove
return mobility_flags
/mob/living/simple_animal/update_transform()
var/matrix/ntransform = matrix(transform) //aka transform.Copy()
@@ -24,7 +24,7 @@
stat = DEAD
cut_overlays()
update_canmove()
update_mobility()
if(SSticker.mode)
SSticker.mode.check_win()
@@ -41,7 +41,7 @@
AIproc = 1
while(AIproc && stat != DEAD && (attacked || hungry || rabid || buckled))
if(!canmove) // !(mobility_flags & MOBILITY_MOVE) //also covers buckling. Not sure why buckled is in the while condition if we're going to immediately break, honestly
if(!CHECK_MOBILITY(src, MOBILITY_MOVE)) //also covers buckling. Not sure why buckled is in the while condition if we're going to immediately break, honestly
break
if(!Target || client)
@@ -140,12 +140,12 @@
stat = UNCONSCIOUS
powerlevel = 0
rabid = 0
update_canmove()
update_mobility()
regenerate_icons()
else if(stat == UNCONSCIOUS && !stasis)
to_chat(src, "<span class='notice'>You wake up from the stasis.</span>")
stat = CONSCIOUS
update_canmove()
update_mobility()
regenerate_icons()
updatehealth()
@@ -272,15 +272,8 @@
if(prob(25-powerlevel*5))
powerlevel++
/mob/living/simple_animal/slime/proc/handle_targets()
if(Tempstun)
if(!buckled) // not while they're eating!
canmove = 0
else
canmove = 1
update_mobility()
if(attacked > 50)
attacked = 50
@@ -298,7 +291,7 @@
Discipline--
if(!client)
if(!canmove)
if(!CHECK_MOBILITY(src, MOBILITY_MOVE))
return
if(buckled)
@@ -383,13 +376,13 @@
if (Leader)
if(holding_still)
holding_still = max(holding_still - 1, 0)
else if(canmove && isturf(loc))
else if(CHECK_MOBILITY(src, MOBILITY_MOVE) && isturf(loc))
step_to(src, Leader)
else if(hungry)
if (holding_still)
holding_still = max(holding_still - hungry, 0)
else if(canmove && isturf(loc) && prob(50))
else if(CHECK_MOBILITY(src, MOBILITY_MOVE) && isturf(loc) && prob(50))
step(src, pick(GLOB.cardinals))
else
@@ -397,7 +390,7 @@
holding_still = max(holding_still - 1, 0)
else if (docile && pulledby)
holding_still = 10
else if(canmove && isturf(loc) && prob(33))
else if(CHECK_MOBILITY(src, MOBILITY_MOVE) && isturf(loc) && prob(33))
step(src, pick(GLOB.cardinals))
else if(!AIproc)
INVOKE_ASYNC(src, .proc/AIprocess)
@@ -454,13 +454,13 @@
SStun = world.time + rand(20,60)
spawn(0)
canmove = 0
DISABLE_BITFIELD(mobility_flags, MOBILITY_MOVE)
if(user)
step_away(src,user,15)
sleep(3)
if(user)
step_away(src,user,15)
update_canmove()
update_mobility()
/mob/living/simple_animal/slime/pet
docile = 1
@@ -0,0 +1,5 @@
/mob/living/simple_animal/slime/update_mobility()
. = ..()
if(Tempstun && !buckled)
DISABLE_BITFIELD(., MOBILITY_MOVE)
mobility_flags = .
+376 -47
View File
@@ -1,11 +1,24 @@
//Here are the procs used to modify status effects of a mob.
//The effects include: stun, knockdown, unconscious, sleeping, resting, jitteriness, dizziness,
// eye damage, eye_blind, eye_blurry, druggy, TRAIT_BLIND trait, and TRAIT_NEARSIGHT trait.
// YEEHAW GAMERS STAMINA REWORK PROC GETS TO BE FIRST
// amount = strength
// updating = update mobility etc etc
// ignore_castun = same logic as Paralyze() in general
// override_duration = If this is set, does Paralyze() for this duration.
// override_stam = If this is set, does this amount of stamina damage.
/mob/living/proc/DefaultCombatKnockdown(amount, updating = TRUE, ignore_canknockdown = FALSE, override_hardstun, override_stamdmg)
if(!iscarbon(src))
return Paralyze(amount, updating, ignore_canknockdown)
if(istype(buckled, /obj/vehicle/ridden))
buckled.unbuckle_mob(src)
var/drop_items = amount > 80 //80 is cutoff for old item dropping behavior
var/stamdmg = isnull(override_stamdmg)? (amount * 0.25) : override_stamdmg
KnockToFloor(drop_items, TRUE, updating)
adjustStaminaLoss(stamdmg)
if(!isnull(override_hardstun))
Paralyze(override_hardstun)
////////////////////////////// STUN ////////////////////////////////////
/mob/living/IsStun() //If we're stunned
/mob/living/proc/IsStun() //If we're stunned
return has_status_effect(STATUS_EFFECT_STUN)
/mob/living/proc/AmountStun() //How many deciseconds remain in our stun
@@ -15,6 +28,8 @@
return 0
/mob/living/proc/Stun(amount, updating = TRUE, ignore_canstun = FALSE) //Can't go below remaining duration
if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_STUN, amount, updating, ignore_canstun) & COMPONENT_NO_STUN)
return
if(((status_flags & CANSTUN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun)
if(absorb_stun(amount, ignore_canstun))
return
@@ -26,6 +41,8 @@
return S
/mob/living/proc/SetStun(amount, updating = TRUE, ignore_canstun = FALSE) //Sets remaining duration
if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_STUN, amount, updating, ignore_canstun) & COMPONENT_NO_STUN)
return
if(((status_flags & CANSTUN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun)
var/datum/status_effect/incapacitating/stun/S = IsStun()
if(amount <= 0)
@@ -41,6 +58,8 @@
return S
/mob/living/proc/AdjustStun(amount, updating = TRUE, ignore_canstun = FALSE) //Adds to remaining duration
if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_STUN, amount, updating, ignore_canstun) & COMPONENT_NO_STUN)
return
if(((status_flags & CANSTUN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun)
if(absorb_stun(amount, ignore_canstun))
return
@@ -53,7 +72,7 @@
///////////////////////////////// KNOCKDOWN /////////////////////////////////////
/mob/living/IsKnockdown() //If we're knocked down
/mob/living/proc/IsKnockdown() //If we're knocked down
return has_status_effect(STATUS_EFFECT_KNOCKDOWN)
/mob/living/proc/AmountKnockdown() //How many deciseconds remain in our knockdown
@@ -62,25 +81,29 @@
return K.duration - world.time
return 0
/mob/living/proc/Knockdown(amount, updating = TRUE, ignore_canknockdown = FALSE, override_hardstun, override_stamdmg) //Can't go below remaining duration
if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canknockdown)
if(absorb_stun(isnull(override_hardstun)? amount : override_hardstun, ignore_canknockdown))
/mob/living/proc/Knockdown(amount, updating = TRUE, ignore_canstun = FALSE) //Can't go below remaining duration
if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_KNOCKDOWN, amount, updating, ignore_canstun) & COMPONENT_NO_STUN)
return
if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun)
if(absorb_stun(amount, ignore_canstun))
return
var/datum/status_effect/incapacitating/knockdown/K = IsKnockdown()
if(K)
K.duration = max(world.time + (isnull(override_hardstun)? amount : override_hardstun), K.duration)
else if((amount || override_hardstun) > 0)
K = apply_status_effect(STATUS_EFFECT_KNOCKDOWN, amount, updating, override_hardstun, override_stamdmg)
K.duration = max(world.time + amount, K.duration)
else if(amount > 0)
K = apply_status_effect(STATUS_EFFECT_KNOCKDOWN, amount, updating)
return K
/mob/living/proc/SetKnockdown(amount, updating = TRUE, ignore_canknockdown = FALSE) //Sets remaining duration
if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canknockdown)
/mob/living/proc/SetKnockdown(amount, updating = TRUE, ignore_canstun = FALSE) //Sets remaining duration
if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_KNOCKDOWN, amount, updating, ignore_canstun) & COMPONENT_NO_STUN)
return
if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun)
var/datum/status_effect/incapacitating/knockdown/K = IsKnockdown()
if(amount <= 0)
if(K)
qdel(K)
else
if(absorb_stun(amount, ignore_canknockdown))
if(absorb_stun(amount, ignore_canstun))
return
if(K)
K.duration = world.time + amount
@@ -88,9 +111,11 @@
K = apply_status_effect(STATUS_EFFECT_KNOCKDOWN, amount, updating)
return K
/mob/living/proc/AdjustKnockdown(amount, updating = TRUE, ignore_canknockdown = FALSE) //Adds to remaining duration
if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canknockdown)
if(absorb_stun(amount, ignore_canknockdown))
/mob/living/proc/AdjustKnockdown(amount, updating = TRUE, ignore_canstun = FALSE) //Adds to remaining duration
if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_KNOCKDOWN, amount, updating, ignore_canstun) & COMPONENT_NO_STUN)
return
if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun)
if(absorb_stun(amount, ignore_canstun))
return
var/datum/status_effect/incapacitating/knockdown/K = IsKnockdown()
if(K)
@@ -99,6 +124,304 @@
K = apply_status_effect(STATUS_EFFECT_KNOCKDOWN, amount, updating)
return K
///////////////////////////////// IMMOBILIZED ////////////////////////////////////
/mob/living/proc/IsImmobilized() //If we're immobilized
return has_status_effect(STATUS_EFFECT_IMMOBILIZED)
/mob/living/proc/AmountImmobilized() //How many deciseconds remain in our Immobilized status effect
var/datum/status_effect/incapacitating/immobilized/I = IsImmobilized()
if(I)
return I.duration - world.time
return 0
/mob/living/proc/Immobilize(amount, updating = TRUE, ignore_canstun = FALSE) //Can't go below remaining duration
if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_IMMOBILIZE, amount, updating, ignore_canstun) & COMPONENT_NO_STUN)
return
if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun)
if(absorb_stun(amount, ignore_canstun))
return
var/datum/status_effect/incapacitating/immobilized/I = IsImmobilized()
if(I)
I.duration = max(world.time + amount, I.duration)
else if(amount > 0)
I = apply_status_effect(STATUS_EFFECT_IMMOBILIZED, amount, updating)
return I
/mob/living/proc/SetImmobilized(amount, updating = TRUE, ignore_canstun = FALSE) //Sets remaining duration
if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_IMMOBILIZE, amount, updating, ignore_canstun) & COMPONENT_NO_STUN)
return
if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun)
var/datum/status_effect/incapacitating/immobilized/I = IsImmobilized()
if(amount <= 0)
if(I)
qdel(I)
else
if(absorb_stun(amount, ignore_canstun))
return
if(I)
I.duration = world.time + amount
else
I = apply_status_effect(STATUS_EFFECT_IMMOBILIZED, amount, updating)
return I
/mob/living/proc/AdjustImmobilized(amount, updating = TRUE, ignore_canstun = FALSE) //Adds to remaining duration
if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_IMMOBILIZE, amount, updating, ignore_canstun) & COMPONENT_NO_STUN)
return
if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun)
if(absorb_stun(amount, ignore_canstun))
return
var/datum/status_effect/incapacitating/immobilized/I = IsImmobilized()
if(I)
I.duration += amount
else if(amount > 0)
I = apply_status_effect(STATUS_EFFECT_IMMOBILIZED, amount, updating)
return I
///////////////////////////////// PARALYZED //////////////////////////////////
/mob/living/proc/IsParalyzed() //If we're immobilized
return has_status_effect(STATUS_EFFECT_PARALYZED)
/mob/living/proc/AmountParalyzed() //How many deciseconds remain in our Paralyzed status effect
var/datum/status_effect/incapacitating/paralyzed/P = IsParalyzed(FALSE)
if(P)
return P.duration - world.time
return 0
/mob/living/proc/Paralyze(amount, updating = TRUE, ignore_canstun = FALSE) //Can't go below remaining duration
if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_PARALYZE, amount, updating, ignore_canstun) & COMPONENT_NO_STUN)
return
if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun)
if(absorb_stun(amount, ignore_canstun))
return
var/datum/status_effect/incapacitating/paralyzed/P = IsParalyzed(FALSE)
if(P)
P.duration = max(world.time + amount, P.duration)
else if(amount > 0)
P = apply_status_effect(STATUS_EFFECT_PARALYZED, amount, updating)
return P
/mob/living/proc/SetParalyzed(amount, updating = TRUE, ignore_canstun = FALSE) //Sets remaining duration
if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_PARALYZE, amount, updating, ignore_canstun) & COMPONENT_NO_STUN)
return
if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun)
var/datum/status_effect/incapacitating/paralyzed/P = IsParalyzed(FALSE)
if(amount <= 0)
if(P)
qdel(P)
else
if(absorb_stun(amount, ignore_canstun))
return
if(P)
P.duration = world.time + amount
else
P = apply_status_effect(STATUS_EFFECT_PARALYZED, amount, updating)
return P
/mob/living/proc/AdjustParalyzed(amount, updating = TRUE, ignore_canstun = FALSE) //Adds to remaining duration
if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_PARALYZE, amount, updating, ignore_canstun) & COMPONENT_NO_STUN)
return
if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun)
if(absorb_stun(amount, ignore_canstun))
return
var/datum/status_effect/incapacitating/paralyzed/P = IsParalyzed(FALSE)
if(P)
P.duration += amount
else if(amount > 0)
P = apply_status_effect(STATUS_EFFECT_PARALYZED, amount, updating)
return P
///////////////////////////////// DAZED ////////////////////////////////////
/mob/living/proc/IsDazed() //If we're Dazed
return has_status_effect(STATUS_EFFECT_DAZED)
/mob/living/proc/AmountDazed() //How many deciseconds remain in our Dazed status effect
var/datum/status_effect/incapacitating/dazed/I = IsDazed()
if(I)
return I.duration - world.time
return 0
/mob/living/proc/Daze(amount, updating = TRUE, ignore_canstun = FALSE) //Can't go below remaining duration
if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_DAZE, amount, updating, ignore_canstun) & COMPONENT_NO_STUN)
return
if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun)
if(absorb_stun(amount, ignore_canstun))
return
var/datum/status_effect/incapacitating/dazed/I = IsDazed()
if(I)
I.duration = max(world.time + amount, I.duration)
else if(amount > 0)
I = apply_status_effect(STATUS_EFFECT_DAZED, amount, updating)
return I
/mob/living/proc/SetDazed(amount, updating = TRUE, ignore_canstun = FALSE) //Sets remaining duration
if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_DAZE, amount, updating, ignore_canstun) & COMPONENT_NO_STUN)
return
if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun)
var/datum/status_effect/incapacitating/dazed/I = IsDazed()
if(amount <= 0)
if(I)
qdel(I)
else
if(absorb_stun(amount, ignore_canstun))
return
if(I)
I.duration = world.time + amount
else
I = apply_status_effect(STATUS_EFFECT_DAZED, amount, updating)
return I
/mob/living/proc/AdjustDazed(amount, updating = TRUE, ignore_canstun = FALSE) //Adds to remaining duration
if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_DAZE, amount, updating, ignore_canstun) & COMPONENT_NO_STUN)
return
if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun)
if(absorb_stun(amount, ignore_canstun))
return
var/datum/status_effect/incapacitating/dazed/I = IsDazed()
if(I)
I.duration += amount
else if(amount > 0)
I = apply_status_effect(STATUS_EFFECT_DAZED, amount, updating)
return I
//Blanket
/mob/living/proc/AllImmobility(amount, updating, ignore_canstun = FALSE)
Paralyze(amount, FALSE, ignore_canstun)
Knockdown(amount, FALSE, ignore_canstun)
Stun(amount, FALSE, ignore_canstun)
Immobilize(amount, FALSE, ignore_canstun)
Daze(amount, FALSE, ignore_canstun)
if(updating)
update_mobility()
/mob/living/proc/SetAllImmobility(amount, updating, ignore_canstun = FALSE)
SetParalyzed(amount, FALSE, ignore_canstun)
SetKnockdown(amount, FALSE, ignore_canstun)
SetStun(amount, FALSE, ignore_canstun)
SetImmobilized(amount, FALSE, ignore_canstun)
SetDazed(amount, FALSE, ignore_canstun)
if(updating)
update_mobility()
/mob/living/proc/AdjustAllImmobility(amount, updating, ignore_canstun = FALSE)
AdjustParalyzed(amount, FALSE, ignore_canstun)
AdjustKnockdown(amount, FALSE, ignore_canstun)
AdjustStun(amount, FALSE, ignore_canstun)
AdjustImmobilized(amount, FALSE, ignore_canstun)
AdjustDazed(amount, FALSE, ignore_canstun)
if(updating)
update_mobility()
/// Makes sure all 5 of the non-knockout immobilizing status effects are lower or equal to amount.
/mob/living/proc/HealAllImmobilityUpTo(amount, updating, ignore_canstun = FALSE)
if(AmountStun() > amount)
SetStun(amount, FALSE, ignore_canstun)
if(AmountKnockdown() > amount)
SetKnockdown(amount, FALSE, ignore_canstun)
if(AmountParalyzed() > amount)
SetParalyzed(amount, FALSE, ignore_canstun)
if(AmountImmobilized() > amount)
SetImmobilized(amount, FALSE, ignore_canstun)
if(AmountDazed() > amount)
SetImmobilized(amount, FALSE, ignore_canstun)
if(updating)
update_mobility()
/mob/living/proc/HighestImmobilityAmount()
return max(max(max(max(AmountStun(), AmountKnockdown()), AmountParalyzed()), AmountImmobilized()), AmountDazed())
//////////////////UNCONSCIOUS
/mob/living/proc/IsUnconscious() //If we're unconscious
return has_status_effect(STATUS_EFFECT_UNCONSCIOUS)
/mob/living/proc/AmountUnconscious() //How many deciseconds remain in our unconsciousness
var/datum/status_effect/incapacitating/unconscious/U = IsUnconscious()
if(U)
return U.duration - world.time
return 0
/mob/living/proc/Unconscious(amount, updating = TRUE, ignore_canstun = FALSE) //Can't go below remaining duration
if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_UNCONSCIOUS, amount, updating, ignore_canstun) & COMPONENT_NO_STUN)
return
if(((status_flags & CANUNCONSCIOUS) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun)
var/datum/status_effect/incapacitating/unconscious/U = IsUnconscious()
if(U)
U.duration = max(world.time + amount, U.duration)
else if(amount > 0)
U = apply_status_effect(STATUS_EFFECT_UNCONSCIOUS, amount, updating)
return U
/mob/living/proc/SetUnconscious(amount, updating = TRUE, ignore_canstun = FALSE) //Sets remaining duration
if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_UNCONSCIOUS, amount, updating, ignore_canstun) & COMPONENT_NO_STUN)
return
if(((status_flags & CANUNCONSCIOUS) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun)
var/datum/status_effect/incapacitating/unconscious/U = IsUnconscious()
if(amount <= 0)
if(U)
qdel(U)
else if(U)
U.duration = world.time + amount
else
U = apply_status_effect(STATUS_EFFECT_UNCONSCIOUS, amount, updating)
return U
/mob/living/proc/AdjustUnconscious(amount, updating = TRUE, ignore_canstun = FALSE) //Adds to remaining duration
if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_UNCONSCIOUS, amount, updating, ignore_canstun) & COMPONENT_NO_STUN)
return
if(((status_flags & CANUNCONSCIOUS) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun)
var/datum/status_effect/incapacitating/unconscious/U = IsUnconscious()
if(U)
U.duration += amount
else if(amount > 0)
U = apply_status_effect(STATUS_EFFECT_UNCONSCIOUS, amount, updating)
return U
/////////////////////////////////// SLEEPING ////////////////////////////////////
/mob/living/proc/IsSleeping() //If we're asleep
return has_status_effect(STATUS_EFFECT_SLEEPING)
/mob/living/proc/AmountSleeping() //How many deciseconds remain in our sleep
var/datum/status_effect/incapacitating/sleeping/S = IsSleeping()
if(S)
return S.duration - world.time
return 0
/mob/living/proc/Sleeping(amount, updating = TRUE, ignore_canstun = FALSE) //Can't go below remaining duration
if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_SLEEP, amount, updating, ignore_canstun) & COMPONENT_NO_STUN)
return
if((!HAS_TRAIT(src, TRAIT_SLEEPIMMUNE)) || ignore_canstun)
var/datum/status_effect/incapacitating/sleeping/S = IsSleeping()
if(S)
S.duration = max(world.time + amount, S.duration)
else if(amount > 0)
S = apply_status_effect(STATUS_EFFECT_SLEEPING, amount, updating)
return S
/mob/living/proc/SetSleeping(amount, updating = TRUE, ignore_canstun = FALSE) //Sets remaining duration
if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_SLEEP, amount, updating, ignore_canstun) & COMPONENT_NO_STUN)
return
if((!HAS_TRAIT(src, TRAIT_SLEEPIMMUNE)) || ignore_canstun)
var/datum/status_effect/incapacitating/sleeping/S = IsSleeping()
if(amount <= 0)
if(S)
qdel(S)
else if(S)
S.duration = world.time + amount
else
S = apply_status_effect(STATUS_EFFECT_SLEEPING, amount, updating)
return S
/mob/living/proc/AdjustSleeping(amount, updating = TRUE, ignore_canstun = FALSE) //Adds to remaining duration
if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_SLEEP, amount, updating, ignore_canstun) & COMPONENT_NO_STUN)
return
if((!HAS_TRAIT(src, TRAIT_SLEEPIMMUNE)) || ignore_canstun)
var/datum/status_effect/incapacitating/sleeping/S = IsSleeping()
if(S)
S.duration += amount
else if(amount > 0)
S = apply_status_effect(STATUS_EFFECT_SLEEPING, amount, updating)
return S
///////////////////////////////// FROZEN /////////////////////////////////////
/mob/living/proc/IsFrozen()
@@ -119,8 +442,10 @@
"visible_message" = message, "self_message" = self_message, "examine_message" = examine_message)
/mob/living/proc/absorb_stun(amount, ignoring_flag_presence)
if(!amount || amount <= 0 || stat || ignoring_flag_presence || !islist(stun_absorption))
if(amount < 0 || stat || ignoring_flag_presence || !islist(stun_absorption))
return FALSE
if(!amount)
amount = 0
var/priority_absorb_key
var/highest_priority
for(var/i in stun_absorption)
@@ -128,20 +453,20 @@
priority_absorb_key = stun_absorption[i]
highest_priority = priority_absorb_key["priority"]
if(priority_absorb_key)
if(priority_absorb_key["visible_message"] || priority_absorb_key["self_message"])
if(priority_absorb_key["visible_message"] && priority_absorb_key["self_message"])
visible_message("<span class='warning'>[src][priority_absorb_key["visible_message"]]</span>", "<span class='boldwarning'>[priority_absorb_key["self_message"]]</span>")
else if(priority_absorb_key["visible_message"])
visible_message("<span class='warning'>[src][priority_absorb_key["visible_message"]]</span>")
else if(priority_absorb_key["self_message"])
to_chat(src, "<span class='boldwarning'>[priority_absorb_key["self_message"]]</span>")
priority_absorb_key["stuns_absorbed"] += amount
if(amount) //don't spam up the chat for continuous stuns
if(priority_absorb_key["visible_message"] || priority_absorb_key["self_message"])
if(priority_absorb_key["visible_message"] && priority_absorb_key["self_message"])
visible_message("<span class='warning'>[src][priority_absorb_key["visible_message"]]</span>", "<span class='boldwarning'>[priority_absorb_key["self_message"]]</span>")
else if(priority_absorb_key["visible_message"])
visible_message("<span class='warning'>[src][priority_absorb_key["visible_message"]]</span>")
else if(priority_absorb_key["self_message"])
to_chat(src, "<span class='boldwarning'>[priority_absorb_key["self_message"]]</span>")
priority_absorb_key["stuns_absorbed"] += amount
return TRUE
/////////////////////////////////// DISABILITIES ////////////////////////////////////
/mob/living/proc/add_quirk(quirktype, spawn_effects) //separate proc due to the way these ones are handled
if(has_quirk(quirktype))
if(HAS_TRAIT(src, quirktype))
return
var/datum/quirk/T = quirktype
var/qname = initial(T.name)
@@ -162,20 +487,23 @@
if(Q.type == quirktype)
return TRUE
return FALSE
/////////////////////////////////// TRAIT PROCS ////////////////////////////////////
/mob/living/proc/cure_blind(list/sources)
REMOVE_TRAIT(src, TRAIT_BLIND, sources)
/mob/living/proc/cure_blind(source)
REMOVE_TRAIT(src, TRAIT_BLIND, source)
if(!HAS_TRAIT(src, TRAIT_BLIND))
adjust_blindness(-1)
update_blindness()
/mob/living/proc/become_blind(source)
if(!HAS_TRAIT(src, TRAIT_BLIND))
blind_eyes(1)
ADD_TRAIT(src, TRAIT_BLIND, source)
if(!HAS_TRAIT(src, TRAIT_BLIND)) // not blind already, add trait then overlay
ADD_TRAIT(src, TRAIT_BLIND, source)
update_blindness()
else
ADD_TRAIT(src, TRAIT_BLIND, source)
/mob/living/proc/cure_nearsighted(list/sources)
REMOVE_TRAIT(src, TRAIT_NEARSIGHT, sources)
/mob/living/proc/cure_nearsighted(source)
REMOVE_TRAIT(src, TRAIT_NEARSIGHT, source)
if(!HAS_TRAIT(src, TRAIT_NEARSIGHT))
clear_fullscreen("nearsighted")
@@ -184,8 +512,8 @@
overlay_fullscreen("nearsighted", /obj/screen/fullscreen/impaired, 1)
ADD_TRAIT(src, TRAIT_NEARSIGHT, source)
/mob/living/proc/cure_husk(list/sources)
REMOVE_TRAIT(src, TRAIT_HUSK, sources)
/mob/living/proc/cure_husk(source)
REMOVE_TRAIT(src, TRAIT_HUSK, source)
if(!HAS_TRAIT(src, TRAIT_HUSK))
REMOVE_TRAIT(src, TRAIT_DISFIGURED, "husk")
update_body()
@@ -193,14 +521,15 @@
/mob/living/proc/become_husk(source)
if(!HAS_TRAIT(src, TRAIT_HUSK))
ADD_TRAIT(src, TRAIT_HUSK, source)
ADD_TRAIT(src, TRAIT_DISFIGURED, "husk")
update_body()
. = TRUE
ADD_TRAIT(src, TRAIT_HUSK, source)
else
ADD_TRAIT(src, TRAIT_HUSK, source)
/mob/living/proc/cure_fakedeath(list/sources)
REMOVE_TRAIT(src, TRAIT_FAKEDEATH, sources)
REMOVE_TRAIT(src, TRAIT_DEATHCOMA, sources)
/mob/living/proc/cure_fakedeath(source)
REMOVE_TRAIT(src, TRAIT_FAKEDEATH, source)
REMOVE_TRAIT(src, TRAIT_DEATHCOMA, source)
if(stat != DEAD)
tod = null
update_stat()
@@ -215,10 +544,10 @@
tod = STATION_TIME_TIMESTAMP("hh:mm:ss", world.time)
update_stat()
/mob/living/proc/unignore_slowdown(list/sources)
REMOVE_TRAIT(src, TRAIT_IGNORESLOWDOWN, sources)
/mob/living/proc/unignore_slowdown(source)
REMOVE_TRAIT(src, TRAIT_IGNORESLOWDOWN, source)
update_movespeed(FALSE)
/mob/living/proc/ignore_slowdown(source)
ADD_TRAIT(src, TRAIT_IGNORESLOWDOWN, source)
update_movespeed(FALSE)
update_movespeed(FALSE)
+1 -1
View File
@@ -50,7 +50,7 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, typecacheof(list(
if(vent_found_parent && (vent_found_parent.members.len || vent_found_parent.other_atmosmch))
visible_message("<span class='notice'>[src] begins climbing into the ventilation system...</span>" ,"<span class='notice'>You begin climbing into the ventilation system...</span>")
if(!do_after(src, 25, target = vent_found))
if(!do_after(src, 25, target = vent_found, required_mobility_flags = MOBILITY_MOVE))
return
if(!client)
+2 -4
View File
@@ -659,8 +659,6 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0)
// facing verbs
/mob/proc/canface()
if(!canmove)
return FALSE
if(world.time < client.last_turn)
return FALSE
if(stat == DEAD || stat == UNCONSCIOUS)
@@ -762,7 +760,7 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0)
//You can buckle on mobs if you're next to them since most are dense
/mob/buckle_mob(mob/living/M, force = FALSE, check_loc = TRUE)
if(M.buckled)
return 0
return FALSE
var/turf/T = get_turf(src)
if(M.loc != T)
var/old_density = density
@@ -770,7 +768,7 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0)
var/can_step = step_towards(M, T)
density = old_density
if(!can_step)
return 0
return FALSE
return ..()
//Default buckling shift visual for mobs
-1
View File
@@ -38,7 +38,6 @@
var/resting = 0 //Carbon
var/lying = 0
var/lying_prev = 0
var/canmove = 1
//MOVEMENT SPEED
var/list/movespeed_modification //Lazy list, see mob_movespeed.dm
+3 -5
View File
@@ -62,7 +62,7 @@
if(mob.buckled) //if we're buckled to something, tell it we moved.
return mob.buckled.relaymove(mob, direction)
if(!mob.canmove)
if(!CHECK_MOBILITY(L, MOBILITY_MOVE))
return FALSE
if(isobj(mob.loc) || ismob(mob.loc)) //Inside an object, tell it we moved
@@ -107,9 +107,7 @@
if(P && !ismob(P) && P.density)
mob.setDir(turn(mob.dir, 180))
///Process_Grab()
///Called by client/Move()
///Checks to see if you are being grabbed and if so attemps to break it
/// Process_Grab(): checks for grab, attempts to break if so. Return TRUE to prevent movement.
/client/proc/Process_Grab()
if(mob.pulledby)
if(mob.incapacitated(ignore_restraints = 1))
@@ -120,7 +118,7 @@
to_chat(src, "<span class='warning'>You're restrained! You can't move!</span>")
return TRUE
else
return mob.resist_grab(1)
return !mob.attempt_resist_grab(TRUE)
///Process_Incorpmove
///Called by client/Move()
+59 -205
View File
@@ -3,222 +3,81 @@
//The effects include: stun, knockdown, unconscious, sleeping, resting, jitteriness, dizziness, ear damage,
// eye damage, eye_blind, eye_blurry, druggy, TRAIT_BLIND trait, and TRAIT_NEARSIGHT trait.
/////////////////////////////////// STUN ////////////////////////////////////
/mob/proc/IsStun() //non-living mobs shouldn't be stunned
return FALSE
/////////////////////////////////// KNOCKDOWN ////////////////////////////////////
/mob/proc/IsKnockdown() //non-living mobs shouldn't be knocked down
return FALSE
/////////////////////////////////// UNCONSCIOUS ////////////////////////////////////
/mob/proc/IsUnconscious() //non-living mobs shouldn't be unconscious
return FALSE
/mob/living/IsUnconscious() //If we're unconscious
return has_status_effect(STATUS_EFFECT_UNCONSCIOUS)
/mob/living/proc/AmountUnconscious() //How many deciseconds remain in our unconsciousness
var/datum/status_effect/incapacitating/unconscious/U = IsUnconscious()
if(U)
return U.duration - world.time
return 0
/mob/living/proc/Unconscious(amount, updating = TRUE, ignore_canunconscious = FALSE) //Can't go below remaining duration
if(((status_flags & CANUNCONSCIOUS) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canunconscious)
var/datum/status_effect/incapacitating/unconscious/U = IsUnconscious()
if(U)
U.duration = max(world.time + amount, U.duration)
else if(amount > 0)
U = apply_status_effect(STATUS_EFFECT_UNCONSCIOUS, amount, updating)
return U
/mob/living/proc/SetUnconscious(amount, updating = TRUE, ignore_canunconscious = FALSE) //Sets remaining duration
if(((status_flags & CANUNCONSCIOUS) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canunconscious)
var/datum/status_effect/incapacitating/unconscious/U = IsUnconscious()
if(amount <= 0)
if(U)
qdel(U)
else if(U)
U.duration = world.time + amount
else
U = apply_status_effect(STATUS_EFFECT_UNCONSCIOUS, amount, updating)
return U
/mob/living/proc/AdjustUnconscious(amount, updating = TRUE, ignore_canunconscious = FALSE) //Adds to remaining duration
if(((status_flags & CANUNCONSCIOUS) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canunconscious)
var/datum/status_effect/incapacitating/unconscious/U = IsUnconscious()
if(U)
U.duration += amount
else if(amount > 0)
U = apply_status_effect(STATUS_EFFECT_UNCONSCIOUS, amount, updating)
return U
/////////////////////////////////// SLEEPING ////////////////////////////////////
/mob/proc/IsSleeping() //non-living mobs shouldn't be sleeping either
return FALSE
/mob/living/IsSleeping() //If we're asleep
return has_status_effect(STATUS_EFFECT_SLEEPING)
/mob/living/proc/AmountSleeping() //How many deciseconds remain in our sleep
var/datum/status_effect/incapacitating/sleeping/S = IsSleeping()
if(S)
return S.duration - world.time
return 0
/mob/living/proc/Sleeping(amount, updating = TRUE, ignore_sleepimmune = FALSE) //Can't go below remaining duration
if((!HAS_TRAIT(src, TRAIT_SLEEPIMMUNE)) || ignore_sleepimmune)
var/datum/status_effect/incapacitating/sleeping/S = IsSleeping()
if(S)
S.duration = max(world.time + amount, S.duration)
else if(amount > 0)
S = apply_status_effect(STATUS_EFFECT_SLEEPING, amount, updating)
return S
/mob/living/proc/SetSleeping(amount, updating = TRUE, ignore_sleepimmune = FALSE) //Sets remaining duration
if((!HAS_TRAIT(src, TRAIT_SLEEPIMMUNE)) || ignore_sleepimmune)
var/datum/status_effect/incapacitating/sleeping/S = IsSleeping()
if(amount <= 0)
if(S)
qdel(S)
else if(S)
S.duration = world.time + amount
else
S = apply_status_effect(STATUS_EFFECT_SLEEPING, amount, updating)
return S
/mob/living/proc/AdjustSleeping(amount, updating = TRUE, ignore_sleepimmune = FALSE) //Adds to remaining duration
if((!HAS_TRAIT(src, TRAIT_SLEEPIMMUNE)) || ignore_sleepimmune)
var/datum/status_effect/incapacitating/sleeping/S = IsSleeping()
if(S)
S.duration += amount
else if(amount > 0)
S = apply_status_effect(STATUS_EFFECT_SLEEPING, amount, updating)
return S
/////////////////////////////////// RESTING ////////////////////////////////////
/mob/proc/Resting(amount)
resting = max(max(resting,amount),0)
/mob/living/Resting(amount)
..()
update_canmove()
/mob/proc/SetResting(amount)
resting = max(amount,0)
/mob/living/SetResting(amount)
..()
update_canmove()
/mob/proc/AdjustResting(amount)
resting = max(resting + amount,0)
/mob/living/AdjustResting(amount)
..()
update_canmove()
/////////////////////////////////// JITTERINESS ////////////////////////////////////
///Set the jitter of a mob
/mob/proc/Jitter(amount)
jitteriness = max(jitteriness,amount,0)
/////////////////////////////////// DIZZINESS ////////////////////////////////////
/**
* Set the dizzyness of a mob to a passed in amount
*
* Except if dizziness is already higher in which case it does nothing
*/
/mob/proc/Dizzy(amount)
dizziness = max(dizziness,amount,0)
/////////////////////////////////// EYE_BLIND ////////////////////////////////////
///FOrce set the dizzyness of a mob
/mob/proc/set_dizziness(amount)
dizziness = max(amount, 0)
///Blind a mobs eyes by amount
/mob/proc/blind_eyes(amount)
if(amount>0)
var/old_eye_blind = eye_blind
eye_blind = max(eye_blind, amount)
if(!old_eye_blind)
if(stat == CONSCIOUS || stat == SOFT_CRIT)
throw_alert("blind", /obj/screen/alert/blind)
overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
adjust_blindness(amount)
/**
* Adjust a mobs blindness by an amount
*
* Will apply the blind alerts if needed
*/
/mob/proc/adjust_blindness(amount)
if(amount>0)
var/old_eye_blind = eye_blind
eye_blind += amount
if(!old_eye_blind)
if(stat == CONSCIOUS || stat == SOFT_CRIT)
throw_alert("blind", /obj/screen/alert/blind)
overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
else if(eye_blind)
var/blind_minimum = 0
if((stat != CONSCIOUS && stat != SOFT_CRIT))
blind_minimum = 1
if(isliving(src))
var/mob/living/L = src
if(HAS_TRAIT(L, TRAIT_BLIND))
blind_minimum = 1
eye_blind = max(eye_blind+amount, blind_minimum)
if(!eye_blind)
clear_alert("blind")
clear_fullscreen("blind")
var/old_eye_blind = eye_blind
eye_blind = max(0, eye_blind + amount)
if(!old_eye_blind || !eye_blind && !HAS_TRAIT(src, TRAIT_BLIND))
update_blindness()
/**
* Force set the blindness of a mob to some level
*/
/mob/proc/set_blindness(amount)
if(amount>0)
var/old_eye_blind = eye_blind
eye_blind = amount
if(client && !old_eye_blind)
if(stat == CONSCIOUS || stat == SOFT_CRIT)
throw_alert("blind", /obj/screen/alert/blind)
overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
else if(eye_blind)
var/blind_minimum = 0
if(stat != CONSCIOUS && stat != SOFT_CRIT)
blind_minimum = 1
if(isliving(src))
var/mob/living/L = src
if(HAS_TRAIT(L, TRAIT_BLIND))
blind_minimum = 1
eye_blind = blind_minimum
if(!eye_blind)
clear_alert("blind")
clear_fullscreen("blind")
/////////////////////////////////// EYE_BLURRY ////////////////////////////////////
var/old_eye_blind = eye_blind
eye_blind = max(amount, 0)
if(!old_eye_blind || !eye_blind && !HAS_TRAIT(src, TRAIT_BLIND))
update_blindness()
/// proc that adds and removes blindness overlays when necessary
/mob/proc/update_blindness()
if(stat == UNCONSCIOUS || HAS_TRAIT(src, TRAIT_BLIND) || eye_blind) // UNCONSCIOUS or has blind trait, or has temporary blindness
if(stat == CONSCIOUS || stat == SOFT_CRIT)
throw_alert("blind", /obj/screen/alert/blind)
overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
// You are blind why should you be able to make out details like color, only shapes near you
// add_client_colour(/datum/client_colour/monochrome/blind)
else // CONSCIOUS no blind trait, no blindness
clear_alert("blind")
clear_fullscreen("blind")
// remove_client_colour(/datum/client_colour/monochrome/blind)
/**
* Make the mobs vision blurry
*/
/mob/proc/blur_eyes(amount)
if(amount>0)
var/old_eye_blurry = eye_blurry
eye_blurry = max(amount, eye_blurry)
if(!old_eye_blurry)
add_eyeblur() //Citadel edit blurry eye memes entailed. syncs beware
else if(eye_blurry > 0)
update_eyeblur()
update_eyeblur()
/**
* Adjust the current blurriness of the mobs vision by amount
*/
/mob/proc/adjust_blurriness(amount)
var/old_eye_blurry = eye_blurry
eye_blurry = max(eye_blurry+amount, 0)
if(amount>0)
if(!old_eye_blurry)
add_eyeblur()
else if(eye_blurry > 0)
update_eyeblur()
else if(old_eye_blurry && !eye_blurry)
remove_eyeblur()
update_eyeblur()
///Set the mobs blurriness of vision to an amount
/mob/proc/set_blurriness(amount)
var/old_eye_blurry = eye_blurry
eye_blurry = max(amount, 0)
if(amount>0)
if(!old_eye_blurry)
add_eyeblur()
else if(eye_blurry > 0)
update_eyeblur()
else if(old_eye_blurry)
remove_eyeblur()
update_eyeblur()
/mob/proc/update_eyeblur()
remove_eyeblur()
if(eye_blurry)
add_eyeblur()
/mob/proc/add_eyeblur()
if(!client)
@@ -228,10 +87,6 @@
GW.add_filter("blurry_eyes", 2, EYE_BLUR(CLAMP(eye_blurry*0.1,0.6,3)))
F.add_filter("blurry_eyes", 2, EYE_BLUR(CLAMP(eye_blurry*0.1,0.6,3)))
/mob/proc/update_eyeblur()
remove_eyeblur()
add_eyeblur()
/mob/proc/remove_eyeblur()
if(!client)
return
@@ -240,24 +95,23 @@
GW.remove_filter("blurry_eyes")
F.remove_filter("blurry_eyes")
/////////////////////////////////// DRUGGY ////////////////////////////////////
///Adjust the drugginess of a mob
/mob/proc/adjust_drugginess(amount)
return
///Set the drugginess of a mob
/mob/proc/set_drugginess(amount)
return
/////////////////////////////////// GROSSED OUT ////////////////////////////////////
///Adjust the disgust level of a mob
/mob/proc/adjust_disgust(amount)
return
///Set the disgust level of a mob
/mob/proc/set_disgust(amount)
return
/////////////////////////////////// TEMPERATURE ////////////////////////////////////
///Adjust the body temperature of a mob, with min/max settings
/mob/proc/adjust_bodytemperature(amount,min_temp=0,max_temp=INFINITY)
if(bodytemperature >= min_temp && bodytemperature <= max_temp)
bodytemperature = CLAMP(bodytemperature + amount,min_temp,max_temp)
+14 -16
View File
@@ -29,9 +29,8 @@
dropItemToGround(W)
//Make mob invisible and spawn animation
notransform = 1
canmove = 0
Stun(22, ignore_canstun = TRUE)
notransform = TRUE
Stun(INFINITY, ignore_canstun = TRUE)
icon = null
cut_overlays()
invisibility = INVISIBILITY_MAXIMUM
@@ -187,8 +186,7 @@
//Make mob invisible and spawn animation
notransform = 1
canmove = 0
notransform = TRUE
Stun(22, ignore_canstun = TRUE)
icon = null
cut_overlays()
@@ -316,13 +314,13 @@
return ..()
/mob/living/carbon/AIize()
if (notransform)
if(notransform)
return
for(var/obj/item/W in src)
dropItemToGround(W)
regenerate_icons()
notransform = 1
canmove = 0
notransform = TRUE
Paralyze(INFINITY)
icon = null
invisibility = INVISIBILITY_MAXIMUM
return ..()
@@ -365,8 +363,8 @@
else
dropItemToGround(W)
regenerate_icons()
notransform = 1
canmove = 0
notransform = TRUE
Paralyze(INFINITY)
icon = null
invisibility = INVISIBILITY_MAXIMUM
for(var/t in bodyparts)
@@ -408,7 +406,7 @@
dropItemToGround(W)
regenerate_icons()
notransform = 1
canmove = 0
Paralyze(INFINITY)
icon = null
invisibility = INVISIBILITY_MAXIMUM
for(var/t in bodyparts)
@@ -441,7 +439,7 @@
dropItemToGround(W)
regenerate_icons()
notransform = 1
canmove = 0
Paralyze(INFINITY)
icon = null
invisibility = INVISIBILITY_MAXIMUM
for(var/t in bodyparts)
@@ -485,8 +483,8 @@
for(var/obj/item/W in src)
dropItemToGround(W)
regenerate_icons()
notransform = 1
canmove = 0
notransform = TRUE
Paralyze(INFINITY)
icon = null
invisibility = INVISIBILITY_MAXIMUM
for(var/t in bodyparts) //this really should not be necessary
@@ -516,7 +514,7 @@
regenerate_icons()
notransform = TRUE
canmove = FALSE
Paralyze(INFINITY)
icon = null
invisibility = INVISIBILITY_MAXIMUM
var/mob/living/simple_animal/hostile/gorilla/new_gorilla = new (get_turf(src))
@@ -545,7 +543,7 @@
regenerate_icons()
notransform = TRUE
canmove = FALSE
Paralyze(INFINITY)
icon = null
invisibility = INVISIBILITY_MAXIMUM