relatively small 71 file 700 lines changed refactor/rework to combat mode/sprint and some miscellaneous things that totally aren't important (#11376)

* combat refactoring

* i hate this

* mobility flags part 2 time xd

* whew

* stuff

* a

* ok

* changes

* Wew

* k

* add flags

* FUCKYOUVORE

* fixes

* typo

* no using this in hard stamcrit

* update icon

* woopsy

* . = ..()

* sigh

* Update living_combat.dm

* wew

* wups

* fix

* i hate you

* wrong button

* k

* ok

* bet

* k

* Update code/modules/mob/living/living_combat.dm

Co-Authored-By: Ghom <42542238+Ghommie@users.noreply.github.com>

* Update code/modules/mob/living/living_combat.dm

Co-Authored-By: Ghom <42542238+Ghommie@users.noreply.github.com>

* Update code/modules/mob/living/living_combat.dm

Co-Authored-By: Ghom <42542238+Ghommie@users.noreply.github.com>

* early returns

* skreee

* agony

* k

* k

* k

* k

* wack

* compile

* wack

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
This commit is contained in:
kevinz000
2020-03-21 08:04:26 -07:00
committed by GitHub
parent 84a44e226c
commit 0e3193e929
79 changed files with 788 additions and 486 deletions
-10
View File
@@ -89,14 +89,6 @@
#define XENOBIO_UPGRADE_SLIMEBASIC 2
#define XENOBIO_UPGRADE_SLIMEADV 4
//stamina stuff
#define STAMINA_SOFTCRIT 100 //softcrit for stamina damage. prevents standing up, prevents performing actions that cost stamina, etc, but doesn't force a rest or stop movement
#define STAMINA_CRIT 140 //crit for stamina damage. forces a rest, and stops movement until stamina goes back to stamina softcrit
#define STAMINA_SOFTCRIT_TRADITIONAL 0 //same as STAMINA_SOFTCRIT except for the more traditional health calculations
#define STAMINA_CRIT_TRADITIONAL -40 //ditto, but for STAMINA_CRIT
#define CRAWLUNDER_DELAY 30 //Delay for crawling under a standing mob
//Citadel toggles because bitflag memes
#define MEDIHOUND_SLEEPER (1<<0)
#define EATING_NOISES (1<<1)
@@ -114,8 +106,6 @@
#define TOGGLES_CITADEL (EATING_NOISES|DIGESTION_NOISES|BREAST_ENLARGEMENT|PENIS_ENLARGEMENT)
//component stuff
#define COMSIG_COMBAT_TOGGLED "combatmode_toggled" //called by combat mode toggle on all equipped items. args: (mob/user, combatmode)
#define COMSIG_VORE_TOGGLED "voremode_toggled" // totally not copypasta
//belly sound pref things
+49
View File
@@ -29,7 +29,54 @@
#define EFFECT_DROWSY "drowsy"
#define EFFECT_JITTER "jitter"
// /mob/living/combat_flags
#define CAN_TOGGLE_COMBAT_MODE(mob) FORCE_BOOLEAN((mob.stat == CONSCIOUS) && !(mob.combat_flags & COMBAT_FLAG_HARD_STAMCRIT))
/// Default combat flags for those affected by ((stamina combat))
#define COMBAT_FLAGS_DEFAULT NONE
/// Default combat flags for everyone else (so literally everyone but humans)
#define COMBAT_FLAGS_STAMSYSTEM_EXEMPT (COMBAT_FLAG_SPRINT_ACTIVE | COMBAT_FLAG_COMBAT_ACTIVE | COMBAT_FLAG_SPRINT_TOGGLED | COMBAT_FLAG_COMBAT_TOGGLED)
/// Default combat flags for those only affected by sprint (so just silicons)
#define COMBAT_FLAGS_STAMEXEMPT_YESSPRINT (COMBAT_FLAG_COMBAT_ACTIVE | COMBAT_FLAG_COMBAT_TOGGLED)
/// The user wants combat mode on
#define COMBAT_FLAG_COMBAT_TOGGLED (1<<0)
/// The user wants sprint mode on
#define COMBAT_FLAG_SPRINT_TOGGLED (1<<1)
/// Combat mode is currently active
#define COMBAT_FLAG_COMBAT_ACTIVE (1<<2)
/// Sprint is currently active
#define COMBAT_FLAG_SPRINT_ACTIVE (1<<3)
/// Currently attempting to crawl under someone
#define COMBAT_FLAG_ATTEMPTING_CRAWL (1<<4)
/// Currently stamcritted
#define COMBAT_FLAG_HARD_STAMCRIT (1<<5)
/// Currently attempting to resist up from the ground
#define COMBAT_FLAG_RESISTING_REST (1<<6)
/// Intentionally resting
#define COMBAT_FLAG_INTENTIONALLY_RESTING (1<<7)
/// Currently stamcritted but not as violently
#define COMBAT_FLAG_SOFT_STAMCRIT (1<<8)
// Helpers for getting someone's stamcrit state. Cast to living.
#define NOT_STAMCRIT 0
#define SOFT_STAMCRIT 1
#define HARD_STAMCRIT 2
// Stamcrit check helpers
#define IS_STAMCRIT(mob) (CHECK_STAMCRIT(mob) != NOT_STAMCRIT)
#define CHECK_STAMCRIT(mob) ((mob.combat_flags & COMBAT_FLAG_HARD_STAMCRIT)? HARD_STAMCRIT : ((mob.combat_flags & COMBAT_FLAG_SOFT_STAMCRIT)? SOFT_STAMCRIT : NOT_STAMCRIT))
//stamina stuff
#define STAMINA_SOFTCRIT 100 //softcrit for stamina damage. prevents standing up, prevents performing actions that cost stamina, etc, but doesn't force a rest or stop movement
#define STAMINA_CRIT 140 //crit for stamina damage. forces a rest, and stops movement until stamina goes back to stamina softcrit
#define STAMINA_SOFTCRIT_TRADITIONAL 0 //same as STAMINA_SOFTCRIT except for the more traditional health calculations
#define STAMINA_CRIT_TRADITIONAL -40 //ditto, but for STAMINA_CRIT
#define CRAWLUNDER_DELAY 30 //Delay for crawling under a standing mob
//Bitflags defining which status effects could be or are inflicted on a mob
// This is a bit out of date/inaccurate in light of all the new status effects and is probably pending rework.
#define CANSTUN (1<<0)
#define CANKNOCKDOWN (1<<1)
#define CANUNCONSCIOUS (1<<2)
@@ -203,3 +250,5 @@ GLOBAL_LIST_INIT(shove_disarming_types, typecacheof(list(
#define BULLET_ACT_BLOCK "BLOCK" //It's a blocked hit, whatever that means in the context of the thing it's hitting.
#define BULLET_ACT_FORCE_PIERCE "PIERCE" //It pierces through the object regardless of the bullet being piercing by default.
#define BULLET_ACT_TURF "TURF" //It hit us but it should hit something on the same turf too. Usually used for turfs.
+3
View File
@@ -186,6 +186,8 @@
#define COMSIG_LIVING_REVIVE "living_revive" //from base of mob/living/revive() (full_heal, admin_revive)
#define COMSIG_MOB_CLIENT_LOGIN "comsig_mob_client_login" //sent when a mob/login() finishes: (client)
#define COMSIG_LIVING_GUN_PROCESS_FIRE "living_gun_process_fire" //from base of /obj/item/gun/proc/process_fire(): (atom/target, params, zone_override)
#define COMSIG_LIVING_COMBAT_ENABLED "combatmode_enabled" //from base of mob/living/enable_combat_mode() (was_forced)
#define COMSIG_LIVING_COMBAT_DISABLED "combatmode_disabled" //from base of mob/living/disable_combat_mode() (was_forced)
//ALL OF THESE DO NOT TAKE INTO ACCOUNT WHETHER AMOUNT IS 0 OR LOWER AND ARE SENT REGARDLESS!
#define COMSIG_LIVING_STATUS_STUN "living_stun" //from base of mob/living/Stun() (amount, update, ignore)
@@ -195,6 +197,7 @@
#define COMSIG_LIVING_STATUS_UNCONSCIOUS "living_unconscious" //from base of mob/living/Unconscious() (amount, update, ignore)
#define COMSIG_LIVING_STATUS_SLEEP "living_sleeping" //from base of mob/living/Sleeping() (amount, update, ignore)
#define COMSIG_LIVING_STATUS_DAZE "living_daze" //from base of mob/living/Daze() (amount, update, ignore)
#define COMSIG_LIVING_STATUS_STAGGER "living_stagger" //from base of mob/living/Stagger() (amount, update, ignore)
#define COMPONENT_NO_STUN 1 //For all of them
// /mob/living/carbon signals
+4 -1
View File
@@ -201,4 +201,7 @@
#define RULE_OF_THREE(a, b, x) ((a*x)/b)
// )
#define MANHATTAN_DISTANCE(a, b) (abs(a.x - b.x) + abs(a.y - b.y))
#define MANHATTAN_DISTANCE(a, b) (abs(a.x - b.x) + abs(a.y - b.y))
/// Make sure something is a boolean TRUE/FALSE 1/0 value, since things like bitfield & bitflag doesn't always give 1s and 0s.
#define FORCE_BOOLEAN(x) ((x)? TRUE : FALSE)
+3
View File
@@ -53,6 +53,9 @@
#define STATUS_EFFECT_SLEEPING /datum/status_effect/incapacitating/sleeping //the affected is asleep
/// Blocks sprint
#define STATUS_EFFECT_STAGGERED /datum/status_effect/staggered
#define STATUS_EFFECT_TASED_WEAK /datum/status_effect/electrode //not as crippling, just slows down
#define STATUS_EFFECT_TASED /datum/status_effect/electrode/no_combat_mode //the affected has been tased, preventing fine muscle control
+9
View File
@@ -162,6 +162,15 @@
#define TRAIT_SWIMMING "swimming" //only applied by /datum/element/swimming, for checking
/**
* COMBAT MODE/SPRINT MODE TRAITS
*/
/// Prevents combat mode from being active.
#define TRAIT_COMBAT_MODE_LOCKED "combatmode_locked"
/// Prevents sprinting from being active.
#define TRAIT_SPRINT_LOCKED "sprint_locked"
//non-mob traits
#define TRAIT_PARALYSIS "paralysis" //Used for limb-based paralysis, where replacing the limb will fix it
+11
View File
@@ -238,5 +238,16 @@ GLOBAL_LIST_INIT(bitfields, list(
"MOBILITY_PULL" = MOBILITY_PULL,
"MOBILITY_HOLD" = MOBILITY_HOLD,
"MOBILITY_RESIST" = MOBILITY_RESIST
),
"combat_flags" = list(
"COMBAT_FLAG_COMBAT_TOGGLED" = COMBAT_FLAG_COMBAT_TOGGLED,
"COMBAT_FLAG_SPRINT_TOGGLED" = COMBAT_FLAG_SPRINT_TOGGLED,
"COMBAT_FLAG_COMBAT_ACTIVE" = COMBAT_FLAG_COMBAT_ACTIVE,
"COMBAT_FLAG_SPRINT_ACTIVE" = COMBAT_FLAG_SPRINT_ACTIVE,
"COMBAT_FLAG_ATTEMPTING_CRAWL" = COMBAT_FLAG_ATTEMPTING_CRAWL,
"COMBAT_FLAG_HARD_STAMCRIT" = COMBAT_FLAG_HARD_STAMCRIT,
"COMBAT_FLAG_SOFT_STAMCRIT" = COMBAT_FLAG_SOFT_STAMCRIT,
"COMBAT_FLAG_INTENTIONALLY_RESTING" = COMBAT_FLAG_INTENTIONALLY_RESTING,
"COMBAT_FLAG_RESISTING_REST" = COMBAT_FLAG_RESISTING_REST
)
))
+1 -1
View File
@@ -128,7 +128,7 @@
//CITADEL CHANGES - sprint button
using = new /obj/screen/sprintbutton
using.icon = tg_ui_icon_to_cit_ui(ui_style)
using.icon_state = (owner.sprinting ? "act_sprint_on" : "act_sprint")
using.icon_state = ((owner.combat_flags & COMBAT_FLAG_SPRINT_ACTIVE) ? "act_sprint_on" : "act_sprint")
using.screen_loc = ui_movi
using.hud = src
static_inventory += using
+5 -7
View File
@@ -11,7 +11,7 @@
if(item_flags & NO_ATTACK_CHAIN_SOFT_STAMCRIT)
if(isliving(user))
var/mob/living/L = user
if(L.getStaminaLoss() >= STAMINA_SOFTCRIT)
if(IS_STAMCRIT(L))
to_chat(L, "<span class='warning'>You are too exhausted to swing [src]!</span>")
return
if(tool_behaviour && target.tool_act(user, src, tool_behaviour))
@@ -58,7 +58,7 @@
if(item_flags & NOBLUDGEON)
return
if(user.getStaminaLoss() >= STAMINA_SOFTCRIT) // CIT CHANGE - makes it impossible to attack in stamina softcrit
if(IS_STAMCRIT(user)) // CIT CHANGE - makes it impossible to attack in stamina softcrit
to_chat(user, "<span class='warning'>You're too exhausted.</span>") // CIT CHANGE - ditto
return // CIT CHANGE - ditto
@@ -88,7 +88,7 @@
return
if(item_flags & NOBLUDGEON)
return
if(user.getStaminaLoss() >= STAMINA_SOFTCRIT) // CIT CHANGE - makes it impossible to attack in stamina softcrit
if(IS_STAMCRIT(user)) // CIT CHANGE - makes it impossible to attack in stamina softcrit
to_chat(user, "<span class='warning'>You're too exhausted.</span>") // CIT CHANGE - ditto
return // CIT CHANGE - ditto
user.adjustStaminaLossBuffered(getweight()*1.2)//CIT CHANGE - makes attacking things cause stamina loss
@@ -109,10 +109,8 @@
/mob/living/attacked_by(obj/item/I, mob/living/user)
//CIT CHANGES START HERE - combatmode and resting checks
var/totitemdamage = I.force
if(iscarbon(user))
var/mob/living/carbon/tempcarb = user
if(!tempcarb.combatmode)
totitemdamage *= 0.5
if(!(user.combat_flags & COMBAT_FLAG_COMBAT_ACTIVE))
totitemdamage *= 0.5
if(!CHECK_MOBILITY(user, MOBILITY_STAND))
totitemdamage *= 0.5
//CIT CHANGES END HERE
@@ -0,0 +1,3 @@
PROCESSING_SUBSYSTEM_DEF(status_effects)
wait = 1
flags = SS_TICKER
+1 -1
View File
@@ -2,7 +2,7 @@
/datum/component/wearertargeting/phantomthief
dupe_mode = COMPONENT_DUPE_UNIQUE_PASSARGS
signals = list(COMSIG_COMBAT_TOGGLED)
signals = list(COMSIG_LIVING_COMBAT_ENABLED)
proctype = .proc/handlefilterstuff
var/filter_x
var/filter_y
+1 -2
View File
@@ -95,8 +95,7 @@
SStgui.on_transfer(current, new_character)
if(iscarbon(current))
var/mob/living/carbon/C = current
if(C.combatmode)
C.toggle_combat_mode(TRUE, TRUE)
C.disable_intentional_combat_mode(TRUE)
if(!language_holder)
var/datum/language_holder/mob_holder = new_character.get_language_holder(shadow = FALSE)
language_holder = mob_holder.copy(src)
+8 -6
View File
@@ -20,11 +20,11 @@
owner.adjustFireLoss(-15)
/datum/status_effect/shadow_mend/on_remove()
. = ..()
owner.visible_message("<span class='warning'>The violet light around [owner] glows black!</span>", "<span class='warning'>The tendrils around you cinch tightly and reap their toll...</span>")
playsound(owner, 'sound/magic/teleport_diss.ogg', 50, 1)
owner.apply_status_effect(STATUS_EFFECT_VOID_PRICE)
/datum/status_effect/void_price
id = "void_price"
duration = 300
@@ -84,6 +84,7 @@
progbar.update(duration - world.time)
/datum/status_effect/vanguard_shield/on_remove()
. = ..()
var/vanguard = owner.stun_absorption["vanguard"]
var/stuns_blocked = 0
if(vanguard)
@@ -107,7 +108,6 @@
owner.visible_message("<span class='warning'>[owner]'s glowing aura fades!</span>", message_to_owner)
owner.log_message("lost Vanguard stun immunity[stuns_blocked ? "and was stunned for [stuns_blocked]":""]", LOG_ATTACK)
/datum/status_effect/inathneqs_endowment
id = "inathneqs_endowment"
duration = 150
@@ -133,12 +133,12 @@
return ..()
/datum/status_effect/inathneqs_endowment/on_remove()
. = ..()
owner.log_message("lost Inath-neq's invulnerability", LOG_ATTACK)
owner.visible_message("<span class='warning'>The light around [owner] flickers and dissipates!</span>", "<span class='boldwarning'>You feel Inath-neq's power fade from your body!</span>")
owner.status_flags &= ~GODMODE
playsound(owner, 'sound/magic/ethereal_exit.ogg', 50, 1)
/datum/status_effect/cyborg_power_regen
id = "power_regen"
duration = 100
@@ -210,11 +210,11 @@
owner.adjustStaminaLoss(-(grace_heal * 25))
/datum/status_effect/his_grace/on_remove()
. = ..()
owner.log_message("lost His Grace's stun immunity", LOG_ATTACK)
if(islist(owner.stun_absorption) && owner.stun_absorption["hisgrace"])
owner.stun_absorption -= "hisgrace"
/datum/status_effect/wish_granters_gift //Fully revives after ten seconds.
id = "wish_granters_gift"
duration = 50
@@ -225,6 +225,7 @@
return ..()
/datum/status_effect/wish_granters_gift/on_remove()
. = ..()
owner.revive(full_heal = TRUE, admin_revive = TRUE)
owner.visible_message("<span class='warning'>[owner] appears to wake from the dead, having healed all wounds!</span>", "<span class='notice'>You have regenerated.</span>")
@@ -366,6 +367,7 @@
last_health = owner.health
/datum/status_effect/blooddrunk/on_remove()
. = ..()
tick()
owner.maxHealth *= 0.1
owner.bruteloss *= 0.1
@@ -404,7 +406,6 @@
playsound(owner, 'sound/weapons/fwoosh.wav', 75, 0)
return ..()
/datum/status_effect/sword_spin/tick()
playsound(owner, 'sound/weapons/fwoosh.wav', 75, 0)
var/obj/item/slashy
@@ -413,9 +414,9 @@
slashy.attack(M, owner)
/datum/status_effect/sword_spin/on_remove()
. = ..()
owner.visible_message("<span class='warning'>[owner]'s inhuman strength dissipates and the sword's runes grow cold!</span>")
//Used by changelings to rapidly heal
//Heals 10 brute and oxygen damage every second, and 5 fire
//Being on fire will suppress this healing
@@ -472,6 +473,7 @@
return ..()
/datum/status_effect/hippocraticOath/on_remove()
. = ..()
REMOVE_TRAIT(owner, TRAIT_PACIFISM, "hippocraticOath")
var/datum/atom_hud/H = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED]
H.remove_hud_from(owner)
+25 -16
View File
@@ -17,6 +17,7 @@
owner.update_stat()
/datum/status_effect/incapacitating/on_remove()
. = ..()
owner.update_mobility()
if(needs_update_stat || issilicon(owner)) //silicons need stat updates in addition to normal canmove updates
owner.update_stat()
@@ -86,6 +87,15 @@
if(prob(10) && owner.health > owner.crit_threshold)
owner.emote("snore")
/datum/status_effect/staggered
id = "staggered"
blocks_sprint = TRUE
/datum/status_effect/staggered/on_creation(mob/living/new_owner, set_duration)
if(isnum(set_duration))
duration = set_duration
return ..()
/obj/screen/alert/status_effect/asleep
name = "Asleep"
desc = "You've fallen asleep. Wait a bit and you should wake up. Unless you don't, considering how helpless you are."
@@ -101,10 +111,6 @@
if(isnum(set_duration))
duration = set_duration
. = ..()
if(iscarbon(owner))
var/mob/living/carbon/C = owner
if(C.combatmode)
C.toggle_combat_mode(TRUE)
/datum/status_effect/no_combat_mode/mesmerize
id = "Mesmerize"
@@ -143,8 +149,6 @@
last_tick = world.time
if(iscarbon(owner))
var/mob/living/carbon/C = owner
if(C.combatmode)
C.toggle_combat_mode(TRUE)
C.add_movespeed_modifier("[MOVESPEED_ID_TASED_STATUS]_[id]", TRUE, priority = slowdown_priority, override = TRUE, multiplicative_slowdown = slowdown, blacklisted_movetypes = affect_crawl? NONE : CRAWLING)
/datum/status_effect/electrode/on_remove()
@@ -174,15 +178,6 @@
blocks_combatmode = TRUE
stamdmg_per_ds = 1
/datum/status_effect/electrode/no_combat_mode/on_creation(mob/living/new_owner, set_duration)
. = ..()
if(iscarbon(owner))
var/mob/living/carbon/C = owner
if(HAS_TRAIT(C, TRAIT_TASED_RESISTANCE))
return
if(C.combatmode)
C.toggle_combat_mode(TRUE)
//OTHER DEBUFFS
/datum/status_effect/his_wrath //does minor damage over time unless holding His Grace
id = "his_wrath"
@@ -220,6 +215,7 @@
alerttooltipstyle = "clockcult"
/datum/status_effect/belligerent/on_apply()
. = ..()
return do_movement_toggle(TRUE)
/datum/status_effect/belligerent/tick()
@@ -250,6 +246,7 @@
/datum/status_effect/belligerent/on_remove()
if(owner.m_intent == MOVE_INTENT_WALK)
owner.toggle_move_intent()
return ..()
/datum/status_effect/maniamotor
id = "maniamotor"
@@ -349,6 +346,7 @@
alert_type = null
/datum/status_effect/cultghost/on_apply()
. = ..()
owner.see_invisible = SEE_INVISIBLE_OBSERVER
owner.see_in_dark = 2
@@ -370,6 +368,7 @@
hammer_synced = new_hammer_synced
/datum/status_effect/crusher_mark/on_apply()
. = ..()
if(owner.mob_size >= MOB_SIZE_LARGE)
marked_underlay = mutable_appearance('icons/effects/effects.dmi', "shield2")
marked_underlay.pixel_x = -owner.pixel_x
@@ -451,6 +450,7 @@
qdel(src)
/datum/status_effect/saw_bleed/on_remove()
. = ..()
if(needs_to_bleed)
var/turf/T = get_turf(owner)
new /obj/effect/temp_visual/bleed/explode(T)
@@ -509,6 +509,7 @@
return ..()
/datum/status_effect/necropolis_curse/on_remove()
. = ..()
remove_curse(curse_flags)
/datum/status_effect/necropolis_curse/proc/apply_curse(set_curse)
@@ -598,6 +599,7 @@
old_oxyloss = owner.getOxyLoss()
/datum/status_effect/kindle/on_remove()
. = ..()
owner.visible_message("<span class='warning'>The light in [owner]'s eyes fades!</span>", \
"<span class='boldannounce'>You snap out of your daze!</span>")
@@ -617,11 +619,13 @@
alert_type = /obj/screen/alert/status_effect/ichorial_stain
/datum/status_effect/ichorial_stain/on_apply()
. = ..()
owner.visible_message("<span class='danger'>[owner] gets back up, [owner.p_their()] body dripping blue ichor!</span>", \
"<span class='userdanger'>Thick blue ichor covers your body; you can't be revived like this again until it dries!</span>")
return TRUE
/datum/status_effect/ichorial_stain/on_remove()
. = ..()
owner.visible_message("<span class='danger'>The blue ichor on [owner]'s body dries out!</span>", \
"<span class='boldnotice'>The ichor on your body is dry - you can now be revived by vitality matrices again!</span>")
@@ -643,6 +647,7 @@
owner.add_movespeed_modifier(MOVESPEED_ID_ELECTROSTAFF, multiplicative_slowdown = 1, movetypes = GROUND)
/datum/status_effect/electrostaff/on_remove()
. = ..()
owner.remove_movespeed_modifier(MOVESPEED_ID_ELECTROSTAFF)
//GOLEM GANG
@@ -694,6 +699,7 @@ datum/status_effect/pacify
/datum/status_effect/pacify/on_remove()
REMOVE_TRAIT(owner, TRAIT_PACIFISM, "status_effect")
return ..()
/datum/status_effect/trance
id = "trance"
@@ -715,6 +721,7 @@ datum/status_effect/pacify
owner.dizziness = 20
/datum/status_effect/trance/on_apply()
. = ..()
if(!iscarbon(owner))
return FALSE
RegisterSignal(owner, COMSIG_MOVABLE_HEAR, .proc/hypnotize)
@@ -735,6 +742,7 @@ datum/status_effect/pacify
owner.dizziness = 0
owner.remove_client_colour(/datum/client_colour/monochrome/trance)
to_chat(owner, "<span class='warning'>You snap out of your trance!</span>")
return ..()
/datum/status_effect/trance/proc/hypnotize(datum/source, list/hearing_args)
if(!owner.can_hear())
@@ -820,8 +828,9 @@ datum/status_effect/pacify
return
var/mob/living/carbon/human/H = owner
H.something_horrible(kill_either_way)
return ..()
/obj/screen/alert/status_effect/dna_melt
name = "Genetic Breakdown"
desc = "I don't feel so good. Your body can't handle the mutations! You have one minute to remove your mutations, or you will be met with a horrible fate."
icon_state = "dna_melt"
icon_state = "dna_melt"
+1
View File
@@ -40,6 +40,7 @@
owner.adjust_bodytemperature(100)
owner.update_mobility()
UnregisterSignal(owner, COMSIG_LIVING_RESIST)
return ..()
/datum/status_effect/freon/watcher
duration = 8
+3 -3
View File
@@ -46,7 +46,7 @@
/datum/status_effect/syphon_mark/on_remove()
get_kill()
. = ..()
return ..()
/obj/screen/alert/status_effect/in_love
name = "In Love"
@@ -81,5 +81,5 @@
ADD_TRAIT(owner, TRAIT_SOOTHED_THROAT, "[STATUS_EFFECT_TRAIT]_[id]")
/datum/status_effect/throat_soothed/on_remove()
. = ..()
REMOVE_TRAIT(owner, TRAIT_SOOTHED_THROAT, "[STATUS_EFFECT_TRAIT]_[id]")
REMOVE_TRAIT(owner, TRAIT_SOOTHED_THROAT, "[STATUS_EFFECT_TRAIT]_[id]")
return ..()
+18 -3
View File
@@ -11,7 +11,10 @@
var/on_remove_on_mob_delete = FALSE //if we call on_remove() when the mob is deleted
var/examine_text //If defined, this text will appear when the mob is examined - to use he, she etc. use "SUBJECTPRONOUN" and replace it in the examines themselves
var/alert_type = /obj/screen/alert/status_effect //the alert thrown by the status effect, contains name and description
var/blocks_combatmode //Does this status effect prevent the user from toggling combat mode?
/// If this is TRUE, the user will have combt mode forcefully disabled while this is active.
var/blocks_combatmode = FALSE
/// If this is TRUE, the user will have sprint forcefully disabled while this is active.
var/blocks_sprint = FALSE
var/obj/screen/alert/status_effect/linked_alert = null //the alert itself, if it exists
/datum/status_effect/New(list/arguments)
@@ -32,11 +35,11 @@
var/obj/screen/alert/status_effect/A = owner.throw_alert(id, alert_type)
A.attached_effect = src //so the alert can reference us, if it needs to
linked_alert = A //so we can reference the alert, if we need to
START_PROCESSING(SSfastprocess, src)
START_PROCESSING(SSstatus_effects, src)
return TRUE
/datum/status_effect/Destroy()
STOP_PROCESSING(SSfastprocess, src)
STOP_PROCESSING(SSstatus_effects, src)
if(owner)
owner.clear_alert(id)
LAZYREMOVE(owner.status_effects, src)
@@ -55,9 +58,21 @@
qdel(src)
/datum/status_effect/proc/on_apply() //Called whenever the buff is applied; returning FALSE will cause it to autoremove itself.
SHOULD_CALL_PARENT(TRUE)
if(blocks_combatmode)
ADD_TRAIT(owner, TRAIT_COMBAT_MODE_LOCKED, src)
if(blocks_sprint)
ADD_TRAIT(owner, TRAIT_SPRINT_LOCKED, src)
return TRUE
/datum/status_effect/proc/tick() //Called every tick.
/datum/status_effect/proc/on_remove() //Called whenever the buff expires or is removed; do note that at the point this is called, it is out of the owner's status_effects but owner is not yet null
SHOULD_CALL_PARENT(TRUE)
REMOVE_TRAIT(owner, TRAIT_COMBAT_MODE_LOCKED, src)
REMOVE_TRAIT(owner, TRAIT_SPRINT_LOCKED, src)
return TRUE
/datum/status_effect/proc/be_replaced() //Called instead of on_remove when a status effect is replaced by itself or when a status effect with on_remove_on_mob_delete = FALSE has its mob deleted
owner.clear_alert(id)
LAZYREMOVE(owner.status_effects, src)
@@ -94,7 +94,7 @@
if(is_ash_immune(L))
return
if(is_species(L, /datum/species/lizard/ashwalker))
if(L.getStaminaLoss() <= STAMINA_SOFTCRIT)
if(!IS_STAMCRIT(L))
L.adjustStaminaLossBuffered(4)
return
L.adjustFireLoss(4)
@@ -409,7 +409,7 @@
if(iscarbon(A))
var/mob/living/carbon/C = A
//If not emagged, only target non downed carbons
if(mode != TURRET_LETHAL && (C.stat || C.handcuffed || C.recoveringstam))//CIT CHANGE - replaces check for lying with check for recoveringstam
if(mode != TURRET_LETHAL && (C.stat || C.handcuffed || (C.combat_flags & COMBAT_FLAG_HARD_STAMCRIT)))//CIT CHANGE - replaces check for lying with check for recoveringstam
continue
//If emagged, target all but dead carbons
+2 -2
View File
@@ -399,7 +399,7 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
//If this were before the above checks, then trying to click on items would act a little funky and signal overrides wouldn't work.
if(iscarbon(usr))
var/mob/living/carbon/C = usr
if(C.combatmode && ((C.CanReach(src) || (src in directaccess)) && (C.CanReach(over) || (over in directaccess))))
if((C.combat_flags & COMBAT_FLAG_COMBAT_ACTIVE) && ((C.CanReach(src) || (src in directaccess)) && (C.CanReach(over) || (over in directaccess))))
if(!C.get_active_held_item())
C.UnarmedAttack(src, TRUE)
if(C.get_active_held_item() == src)
@@ -496,7 +496,7 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
to_chat(user, "<span class='danger'>You cannot locate any organic eyes on this brain!</span>")
return
if(user.getStaminaLoss() >= STAMINA_SOFTCRIT)//CIT CHANGE - makes eyestabbing impossible if you're in stamina softcrit
if(IS_STAMCRIT(user))//CIT CHANGE - makes eyestabbing impossible if you're in stamina softcrit
to_chat(user, "<span class='danger'>You're too exhausted for that.</span>")//CIT CHANGE - ditto
return //CIT CHANGE - ditto
+1 -1
View File
@@ -268,7 +268,7 @@
if(!on)
return ..()
if(user.getStaminaLoss() >= STAMINA_SOFTCRIT)//CIT CHANGE - makes batons unusuable in stamina softcrit
if(IS_STAMCRIT(user))//CIT CHANGE - makes batons unusuable in stamina softcrit
to_chat(user, "<span class='warning'>You're too exhausted for that.</span>")//CIT CHANGE - ditto
return //CIT CHANGE - ditto
+1 -1
View File
@@ -42,7 +42,7 @@
var/mob/living/L = user
if(istype(L) && L.getStaminaLoss() >= STAMINA_SOFTCRIT)
if(istype(L) && IS_STAMCRIT(L))
to_chat(user, "<span class='danger'>You're too exhausted for that.</span>")
return
+2 -2
View File
@@ -80,7 +80,7 @@
else
user.visible_message("<span class='notice'>[user] hugs [M] to make [M.p_them()] feel better!</span>", \
"<span class='notice'>You hug [M] to make [M.p_them()] feel better!</span>")
if(M.resting && !M.recoveringstam)
if(M.resting && !(M.combat_flags & COMBAT_FLAG_HARD_STAMCRIT))
M.set_resting(FALSE, TRUE)
else
user.visible_message("<span class='notice'>[user] pets [M]!</span>", \
@@ -99,7 +99,7 @@
else
user.visible_message("<span class='warning'>[user] hugs [M] in a firm bear-hug! [M] looks uncomfortable...</span>", \
"<span class='warning'>You hug [M] firmly to make [M.p_them()] feel better! [M] looks uncomfortable...</span>")
if(!CHECK_MOBILITY(M, MOBILITY_STAND) && !M.recoveringstam)
if(!CHECK_MOBILITY(M, MOBILITY_STAND) && !(M.combat_flags & COMBAT_FLAG_HARD_STAMCRIT))
M.set_resting(FALSE, TRUE)
else
user.visible_message("<span class='warning'>[user] bops [M] on the head!</span>", \
+1 -1
View File
@@ -153,7 +153,7 @@
return FALSE
if(status && HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50))
clowning_around(user)
if(user.getStaminaLoss() >= STAMINA_SOFTCRIT) //CIT CHANGE - makes it impossible to baton in stamina softcrit
if(IS_STAMCRIT(user)) //CIT CHANGE - makes it impossible to baton in stamina softcrit
to_chat(user, "<span class='danger'>You're too exhausted for that.</span>")
return TRUE
if(ishuman(M))
+2 -2
View File
@@ -248,7 +248,7 @@
/obj/item/twohanded/fireaxe/afterattack(atom/A, mob/living/user, proximity)
. = ..()
if(!proximity || (user.getStaminaLoss() > STAMINA_SOFTCRIT))
if(!proximity || IS_STAMCRIT(user)) //don't make stamcrit message they'll already have gotten one from the primary attack.
return
if(wielded) //destroys windows and grilles in one hit (or more if it has a ton of health like plasmaglass)
if(istype(A, /obj/structure/window))
@@ -1171,7 +1171,7 @@
turn_off()
/obj/item/twohanded/electrostaff/attack(mob/living/target, mob/living/user)
if(user.getStaminaLoss() >= STAMINA_SOFTCRIT)//CIT CHANGE - makes it impossible to baton in stamina softcrit
if(IS_STAMCRIT(user))//CIT CHANGE - makes it impossible to baton in stamina softcrit
to_chat(user, "<span class='danger'>You're too exhausted for that.</span>")//CIT CHANGE - ditto
return //CIT CHANGE - ditto
if(on && HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50))
@@ -101,7 +101,7 @@
if(!user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
return TRUE
if(user.getStaminaLoss() >= STAMINA_SOFTCRIT)
if(IS_STAMCRIT(user))
to_chat(user, "<span class='warning'>You're too exhausted for that.</span>")
return TRUE
var/mob/living/poordude = buckled_mobs[1]
+1 -1
View File
@@ -260,7 +260,7 @@
return FALSE
if(ishuman(C) && !(lube & SLIP_WHEN_JOGGING))
var/mob/living/carbon/human/H = C
if(!H.sprinting && H.getStaminaLoss() <= 20)
if(!(H.combat_flags & COMBAT_FLAG_SPRINT_ACTIVE) && H.getStaminaLoss() <= 20)
return FALSE
if(!(lube&SLIDE_ICE))
to_chat(C, "<span class='notice'>You slipped[ O ? " on the [O.name]" : ""]!</span>")
@@ -35,10 +35,10 @@
return
if(slot != SLOT_GLASSES)
return
RegisterSignal(user, COMSIG_COMBAT_TOGGLED, .proc/injectadrenaline)
RegisterSignal(user, COMSIG_LIVING_COMBAT_ENABLED, .proc/injectadrenaline)
/obj/item/clothing/glasses/phantomthief/syndicate/dropped(mob/user)
. = ..()
if(!istype(user))
return
UnregisterSignal(user, COMSIG_COMBAT_TOGGLED)
UnregisterSignal(user, COMSIG_LIVING_COMBAT_ENABLED)
+1 -1
View File
@@ -4,6 +4,6 @@
toggle_throw_mode()
return
if("C")
toggle_combat_mode()
user_toggle_intentional_combat_mode()
return
return ..()
+2 -2
View File
@@ -59,11 +59,11 @@
switch(_key)
if("Shift")
if(!user.prefs.sprint_spacebar)
user.prefs.sprint_toggle ? togglesprint() : sprint_hotkey(TRUE) //Yes, this looks hacky. Yes, this works.
user.prefs.sprint_toggle ? default_toggle_sprint() : sprint_hotkey(TRUE) //Yes, this looks hacky. Yes, this works.
return
if("Space")
if(user.prefs.sprint_spacebar)
user.prefs.sprint_toggle ? togglesprint() : sprint_hotkey(TRUE)
user.prefs.sprint_toggle ? default_toggle_sprint() : sprint_hotkey(TRUE)
return
return ..()
@@ -21,7 +21,7 @@ In all, this is a lot like the monkey code. /N
return
switch(M.a_intent)
if (INTENT_HELP)
if(!recoveringstam)
if(!(combat_flags & COMBAT_FLAG_HARD_STAMCRIT))
set_resting(FALSE, TRUE, FALSE)
AdjustAllImmobility(-60, FALSE)
AdjustUnconscious(-60, FALSE)
@@ -27,7 +27,7 @@
else
if(stat == UNCONSCIOUS)
stat = CONSCIOUS
if(!recoveringstam)
if(!(combat_flags & COMBAT_FLAG_HARD_STAMCRIT))
set_resting(FALSE, TRUE)
adjust_blindness(-1)
update_mobility()
+5 -8
View File
@@ -153,7 +153,7 @@
return
//CIT CHANGES - makes it impossible to throw while in stamina softcrit
if(getStaminaLoss() >= STAMINA_SOFTCRIT)
if(IS_STAMCRIT(src))
to_chat(src, "<span class='warning'>You're too exhausted.</span>")
return
var/random_turn = a_intent == INTENT_HARM
@@ -448,7 +448,7 @@
modifier -= 40 //Clumsy people are more likely to hit themselves -Honk!
//CIT CHANGES START HERE
else if(combatmode)
else if(combat_flags & COMBAT_FLAG_COMBAT_ACTIVE)
modifier += 50
if(modifier < 100)
@@ -820,15 +820,13 @@
return
if(IsUnconscious() || IsSleeping() || getOxyLoss() > 50 || (HAS_TRAIT(src, TRAIT_DEATHCOMA)) || (health <= HEALTH_THRESHOLD_FULLCRIT && !HAS_TRAIT(src, TRAIT_NOHARDCRIT)))
stat = UNCONSCIOUS
disable_intentional_combat_mode(FALSE, FALSE)
if(!eye_blind)
blind_eyes(1)
if(combatmode)
toggle_combat_mode(TRUE, TRUE)
else
if(health <= crit_threshold && !HAS_TRAIT(src, TRAIT_NOSOFTCRIT))
stat = SOFT_CRIT
if(combatmode)
toggle_combat_mode(TRUE, TRUE)
disable_intentional_combat_mode(FALSE, FALSE)
else
stat = CONSCIOUS
adjust_blindness(-1)
@@ -1011,8 +1009,7 @@
return TRUE
/mob/living/carbon/transfer_ckey(mob/new_mob, send_signal = TRUE)
if(combatmode)
toggle_combat_mode(TRUE, TRUE)
disable_intentional_combat_mode(TRUE, FALSE)
return ..()
/mob/living/carbon/can_see_reagents()
@@ -0,0 +1,6 @@
/mob/living/carbon/enable_intentional_combat_mode()
. = ..()
if(.)
if(voremode)
toggle_vore_mode()
@@ -79,13 +79,11 @@
/mob/living/carbon/attacked_by(obj/item/I, mob/living/user)
//CIT CHANGES START HERE - combatmode and resting checks
var/totitemdamage = I.force
if(iscarbon(user))
var/mob/living/carbon/tempcarb = user
if(!tempcarb.combatmode)
totitemdamage *= 0.5
if(!(user.combat_flags & COMBAT_FLAG_COMBAT_ACTIVE))
totitemdamage *= 0.5
if(!CHECK_MOBILITY(user, MOBILITY_STAND))
totitemdamage *= 0.5
if(!combatmode)
if(!(combat_flags & COMBAT_FLAG_COMBAT_ACTIVE))
totitemdamage *= 1.5
//CIT CHANGES END HERE
if(user != src && check_shields(I, totitemdamage, "the [I.name]", MELEE_ATTACK, I.armour_penetration))
@@ -348,7 +346,7 @@
AdjustAllImmobility(-60, FALSE)
AdjustUnconscious(-60, FALSE)
AdjustSleeping(-100, FALSE)
if(recoveringstam)
if(combat_flags & COMBAT_FLAG_HARD_STAMCRIT)
adjustStaminaLoss(-15)
else
set_resting(FALSE, FALSE)
@@ -0,0 +1,18 @@
/// Sprint buffer ///
/mob/living/carbon/doSprintLossTiles(tiles)
doSprintBufferRegen(FALSE) //first regen.
if(sprint_buffer)
var/use = min(tiles, sprint_buffer)
sprint_buffer -= use
tiles -= use
update_hud_sprint_bar()
if(!tiles) //we had enough, we're done!
return
adjustStaminaLoss(tiles * sprint_stamina_cost) //use stamina to cover deficit.
/mob/living/carbon/proc/doSprintBufferRegen(updating = TRUE)
var/diff = world.time - sprint_buffer_regen_last
sprint_buffer_regen_last = world.time
sprint_buffer = min(sprint_buffer_max, sprint_buffer + sprint_buffer_regen_ds * diff)
if(updating)
update_hud_sprint_bar()
+3 -4
View File
@@ -7,8 +7,8 @@
if(!gibbed)
emote("deathgasp")
if(combatmode)
toggle_combat_mode(TRUE, TRUE)
disable_intentional_combat_mode(TRUE, FALSE)
. = ..()
@@ -67,6 +67,5 @@
BP.throw_at(get_edge_target_turf(src,pick(GLOB.alldirs)),rand(1,3),5)
/mob/living/carbon/ghostize(can_reenter_corpse = TRUE, special = FALSE, penalize = FALSE, voluntary = FALSE)
if(combatmode)
toggle_combat_mode(TRUE, TRUE)
disable_intentional_combat_mode(TRUE, FALSE)
return ..()
+1 -1
View File
@@ -90,7 +90,7 @@
if(digitalcamo)
. += "[t_He] [t_is] moving [t_his] body in an unnatural and blatantly unsimian manner."
if(combatmode)
if(combat_flags & COMBAT_FLAG_COMBAT_ACTIVE)
. += "[t_He] [t_is] visibly tense[CHECK_MOBILITY(src, MOBILITY_STAND) ? "." : ", and [t_is] standing in combative stance."]"
var/trait_exam = common_trait_examine()
@@ -29,7 +29,7 @@
. = ..()
if(CONFIG_GET(flag/disable_stambuffer))
togglesprint()
enable_intentional_sprint_mode()
RegisterSignal(src, COMSIG_COMPONENT_CLEAN_ACT, /atom.proc/clean_blood)
@@ -6,6 +6,9 @@
can_buckle = TRUE
buckle_lying = FALSE
mob_biotypes = MOB_ORGANIC|MOB_HUMANOID
/// Enable stamina combat
combat_flags = COMBAT_FLAGS_DEFAULT
//Hair colour and style
var/hair_color = "000"
var/hair_style = "Bald"
@@ -1,5 +1,5 @@
/mob/living/carbon/human/resist_a_rest(automatic = FALSE, ignoretimer = FALSE)
if(!resting || stat || attemptingstandup)
if(!resting || stat || (combat_flags & COMBAT_FLAG_RESISTING_REST))
return FALSE
if(ignoretimer)
set_resting(FALSE, FALSE)
@@ -13,10 +13,10 @@
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)
if(IS_STAMCRIT(src))
to_chat(src, "<span class='warning'>You're too exhausted to get up!")
return FALSE
attemptingstandup = TRUE
combat_flags |= COMBAT_FLAG_RESISTING_REST
var/health_deficiency = max((maxHealth - (health - getStaminaLoss()))*0.5, 0)
if(!has_gravity())
health_deficiency = health_deficiency*0.2
@@ -37,10 +37,11 @@
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
combat_flags &= ~COMBAT_FLAG_RESISTING_REST
return TRUE
else
attemptingstandup = FALSE
combat_flags &= ~COMBAT_FLAG_RESISTING_REST
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())
@@ -9,6 +9,13 @@
/mob/living/carbon/human/movement_delay()
. = ..()
if(CHECK_MOBILITY(src, MOBILITY_STAND) && m_intent == MOVE_INTENT_RUN && (combat_flags & COMBAT_FLAG_SPRINT_ACTIVE))
var/static/datum/config_entry/number/movedelay/sprint_speed_increase/SSI
if(!SSI)
SSI = CONFIG_GET_ENTRY(number/movedelay/sprint_speed_increase)
. -= SSI.config_entry_value
if(wrongdirmovedelay)
. += 1
if (m_intent == MOVE_INTENT_WALK && HAS_TRAIT(src, TRAIT_SPEEDY_STEP))
. -= 1.5
@@ -42,10 +49,18 @@
return ((shoes && shoes.negates_gravity()) || (dna.species.negates_gravity(src)))
/mob/living/carbon/human/Move(NewLoc, direct)
var/oldpseudoheight = pseudo_z_axis
. = ..()
for(var/datum/mutation/human/HM in dna.mutations)
HM.on_move(src, NewLoc)
if(. && (combat_flags & COMBAT_FLAG_SPRINT_ACTIVE) && !(movement_type & FLYING) && CHECK_ALL_MOBILITY(src, MOBILITY_MOVE|MOBILITY_STAND) && m_intent == MOVE_INTENT_RUN && has_gravity(loc) && !pulledby)
if(!HAS_TRAIT(src, TRAIT_FREESPRINT))
doSprintLossTiles(1)
if((oldpseudoheight - pseudo_z_axis) >= 8)
to_chat(src, "<span class='warning'>You trip off of the elevated surface!</span>")
for(var/obj/item/I in held_items)
accident(I)
DefaultCombatKnockdown(80)
if(shoes)
if(!lying && !buckled)
if(loc == NewLoc)
+17 -20
View File
@@ -1450,15 +1450,11 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
target.grabbedby(user)
return 1
/datum/species/proc/harm(mob/living/carbon/human/user, mob/living/carbon/human/target, datum/martial_art/attacker_style)
if(!attacker_style && HAS_TRAIT(user, TRAIT_PACIFISM))
to_chat(user, "<span class='warning'>You don't want to harm [target]!</span>")
return FALSE
if(user.getStaminaLoss() >= STAMINA_SOFTCRIT) //CITADEL CHANGE - makes it impossible to punch while in stamina softcrit
if(IS_STAMCRIT(user)) //CITADEL CHANGE - makes it impossible to punch while in stamina softcrit
to_chat(user, "<span class='warning'>You're too exhausted.</span>") //CITADEL CHANGE - ditto
return FALSE //CITADEL CHANGE - ditto
if(target.check_block())
@@ -1487,11 +1483,11 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
var/damage = rand(user.dna.species.punchdamagelow, user.dna.species.punchdamagehigh)
//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)
if(!(target.combat_flags & COMBAT_FLAG_COMBAT_ACTIVE) && damage < user.dna.species.punchstunthreshold)
damage = user.dna.species.punchstunthreshold - 1
if(!CHECK_MOBILITY(user, MOBILITY_STAND))
damage *= 0.5
if(!user.combatmode)
if(!(user.combat_flags & COMBAT_FLAG_COMBAT_ACTIVE))
damage *= 0.25
//END OF CITADEL CHANGES
@@ -1540,12 +1536,12 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
var/aim_for_groin = user.zone_selected == "groin"
var/target_aiming_for_groin = target.zone_selected == "groin"
if(target.check_block()) //END EDIT
target.visible_message("<span class='warning'>[target] blocks [user]'s disarm attempt!</span>")
return 0
else if(user.getStaminaLoss() >= STAMINA_SOFTCRIT)
if(IS_STAMCRIT(user))
to_chat(user, "<span class='warning'>You're too exhausted!</span>")
return FALSE
else if(target.check_block())
target.visible_message("<span class='warning'>[target] blocks [user]'s disarm attempt!</span>")
return FALSE
else if(aim_for_mouth && ( target_on_help || target_restrained || target_aiming_for_mouth))
playsound(target.loc, 'sound/weapons/slap.ogg', 50, 1, -1)
@@ -1605,11 +1601,11 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
target.forcesay(GLOB.hit_appends)
log_combat(user, target, "pushed over")
return*/
if(!target.combatmode) // CITADEL CHANGE
if(!(target.combat_flags & COMBAT_FLAG_COMBAT_ACTIVE)) // CITADEL CHANGE
randn += -10 //CITADEL CHANGE - being out of combat mode makes it easier for you to get disarmed
if(!CHECK_MOBILITY(user, MOBILITY_STAND)) //CITADEL CHANGE
randn += 100 //CITADEL CHANGE - No kosher disarming if you're resting
if(!user.combatmode) //CITADEL CHANGE
if(!(target.combat_flags & COMBAT_FLAG_COMBAT_ACTIVE)) //CITADEL CHANGE
randn += 25 //CITADEL CHANGE - Makes it harder to disarm outside of combat mode
if(user.pulling == target)
randn += -20 //If you have the time to get someone in a grab, you should have a greater chance at snatching the thing in their hand. Will be made completely obsolete by the grab rework but i've got a poor track record for releasing big projects on time so w/e i guess
@@ -1686,14 +1682,12 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
var/Iforce = I.force //to avoid runtimes on the forcesay checks at the bottom. Some items might delete themselves if you drop them. (stunning yourself, ninja swords)
//CIT CHANGES START HERE - combatmode and resting checks
var/totitemdamage = I.force
if(iscarbon(user))
var/mob/living/carbon/tempcarb = user
if(!tempcarb.combatmode)
totitemdamage *= 0.5
if(!(user.combat_flags & COMBAT_FLAG_COMBAT_ACTIVE))
totitemdamage *= 0.5
if(!CHECK_MOBILITY(user, MOBILITY_STAND))
totitemdamage *= 0.5
if(istype(H))
if(!H.combatmode)
if(!(H.combat_flags & COMBAT_FLAG_COMBAT_ACTIVE))
totitemdamage *= 1.5
//CIT CHANGES END HERE
var/weakness = H.check_weakness(I, user)
@@ -1803,9 +1797,12 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
/datum/species/proc/althelp(mob/living/carbon/human/user, mob/living/carbon/human/target, datum/martial_art/attacker_style)
if(user == target && istype(user))
if(user.getStaminaLoss() >= STAMINA_SOFTCRIT)
if(IS_STAMCRIT(user))
to_chat(user, "<span class='warning'>You're too exhausted for that.</span>")
return
if(!(user.combat_flags & COMBAT_FLAG_COMBAT_ACTIVE))
to_chat(user, "<span class='warning'>You need combat mode to be active to that!</span>")
return
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
@@ -1818,7 +1815,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
playsound(user, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
/datum/species/proc/altdisarm(mob/living/carbon/human/user, mob/living/carbon/human/target, datum/martial_art/attacker_style)
if(user.getStaminaLoss() >= STAMINA_SOFTCRIT)
if(IS_STAMCRIT(user))
to_chat(user, "<span class='warning'>You're too exhausted.</span>")
return FALSE
if(target.check_block())
+3 -3
View File
@@ -507,10 +507,10 @@ GLOBAL_LIST_INIT(ballmer_windows_me_msg, list("Yo man, what if, we like, uh, put
//this updates all special effects: stun, sleeping, knockdown, druggy, stuttering, etc..
/mob/living/carbon/handle_status_effects()
..()
if(getStaminaLoss() && !combatmode)//CIT CHANGE - prevents stamina regen while combat mode is active
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(getStaminaLoss() && !(combat_flags & COMBAT_FLAG_COMBAT_ACTIVE)) //CIT CHANGE - prevents stamina regen while combat mode is active
adjustStaminaLoss(!CHECK_MOBILITY(src, MOBILITY_STAND) ? ((combat_flags & COMBAT_FLAG_HARD_STAMCRIT) ? -7.5 : -6) : -3)//CIT CHANGE - decreases adjuststaminaloss to stop stamina damage from being such a joke
if(!recoveringstam && incomingstammult != 1)
if(!(combat_flags & COMBAT_FLAG_HARD_STAMCRIT) && incomingstammult != 1)
incomingstammult = max(0.01, incomingstammult)
incomingstammult = min(1, incomingstammult*2)
@@ -35,7 +35,7 @@
gorillize()
return
if(radiation > RAD_MOB_KNOCKDOWN && prob(RAD_MOB_KNOCKDOWN_PROB))
if(!recoveringstam)
if(!(combat_flags & COMBAT_FLAG_HARD_STAMCRIT))
emote("collapse")
DefaultCombatKnockdown(RAD_MOB_KNOCKDOWN_AMOUNT)
to_chat(src, "<span class='danger'>You feel weak.</span>")
+6 -7
View File
@@ -118,22 +118,22 @@
if(!CHECK_MOBILITY(src, MOBILITY_STAND) && CHECK_MOBILITY(L, MOBILITY_STAND))
var/origtargetloc = L.loc
if(!pulledby)
if(attemptingcrawl)
if(combat_flags & COMBAT_FLAG_ATTEMPTING_CRAWL)
return TRUE
if(getStaminaLoss() >= STAMINA_SOFTCRIT)
if(IS_STAMCRIT(src))
to_chat(src, "<span class='warning'>You're too exhausted to crawl under [L].</span>")
return TRUE
attemptingcrawl = TRUE
ENABLE_BITFIELD(combat_flags, COMBAT_FLAG_ATTEMPTING_CRAWL)
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) || CHECK_MOBILITY(src, MOBILITY_STAND))
attemptingcrawl = FALSE
DISABLE_BITFIELD(combat_flags, COMBAT_FLAG_ATTEMPTING_CRAWL)
return TRUE
var/src_passmob = (pass_flags & PASSMOB)
pass_flags |= PASSMOB
Move(origtargetloc)
if(!src_passmob)
pass_flags &= ~PASSMOB
attemptingcrawl = FALSE
DISABLE_BITFIELD(combat_flags, COMBAT_FLAG_ATTEMPTING_CRAWL)
return TRUE
//END OF CIT CHANGES
@@ -368,9 +368,8 @@
to_chat(src, "<span class='notice'>You have given up life and succumbed to death.</span>")
death()
/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)))
if(stat || IsUnconscious() || IsStun() || IsParalyzed() || (combat_flags & COMBAT_FLAG_HARD_STAMCRIT) || (check_immobilized && IsImmobilized()) || (!ignore_restraints && restrained(ignore_grab)))
return TRUE
/mob/living/canUseStorage()
+88
View File
@@ -0,0 +1,88 @@
/mob/living/ComponentInitialize()
. = ..()
RegisterSignal(src, SIGNAL_TRAIT(TRAIT_COMBAT_MODE_LOCKED), .proc/update_combat_lock)
/mob/living/proc/update_combat_lock()
var/locked = HAS_TRAIT(src, TRAIT_COMBAT_MODE_LOCKED)
var/desired = (combat_flags & COMBAT_FLAG_COMBAT_TOGGLED)
var/actual = (combat_flags & COMBAT_FLAG_COMBAT_ACTIVE)
if(actual)
if(locked)
disable_combat_mode(FALSE, TRUE, FALSE, FALSE)
else if(!desired)
disable_combat_mode(TRUE, TRUE, FALSE, FALSE)
else
if(desired && !locked)
enable_combat_mode(FALSE, TRUE, FALSE, FALSE)
update_combat_mode_icon()
/mob/living/proc/disable_combat_mode(silent = TRUE, was_forced = FALSE, visible = FALSE, update_icon = TRUE)
if(!(combat_flags & COMBAT_FLAG_COMBAT_ACTIVE))
return
DISABLE_BITFIELD(combat_flags, COMBAT_FLAG_COMBAT_ACTIVE)
SEND_SIGNAL(src, COMSIG_LIVING_COMBAT_DISABLED, was_forced)
if(visible)
visible_message("<span class='warning'>[src] goes limp.</span>", "<span class='warning'>Your muscles are forcibly relaxed!</span>")
else if(!silent)
to_chat(src, was_forced? "<span class='warning'>Your muscles are forcibly relaxed!</span>" : "<span class='warning'>You relax your muscles.</span>")
if(update_icon)
update_combat_mode_icon()
/mob/living/proc/enable_combat_mode(silent = TRUE, was_forced = FALSE, visible = FALSE, update_icon = TRUE)
if(combat_flags & COMBAT_FLAG_COMBAT_ACTIVE)
return
ENABLE_BITFIELD(combat_flags, COMBAT_FLAG_COMBAT_ACTIVE)
SEND_SIGNAL(src, COMSIG_LIVING_COMBAT_ENABLED, was_forced)
if(visible)
visible_message("<span class='warning'>[src] drops into a combative stance!</span>", "<span class='warning'>You drop into a combative stance!</span>")
else if(!silent)
to_chat(src, was_forced? "<span class='warning'>Your muscles reflexively tighten!</span>" : "<span class='warning'>You tighten your muscles.</span>")
if(update_icon)
update_combat_mode_icon()
/// Updates the combat mode HUD icon.
/mob/living/proc/update_combat_mode_icon()
var/obj/screen/combattoggle/T = locate() in hud_used?.static_inventory
T?.update_icon_state()
/// Enables intentionally being in combat mode. Please try not to use this proc for feedback whenever possible.
/mob/living/proc/enable_intentional_combat_mode(silent = TRUE, visible = FALSE)
if((combat_flags & COMBAT_FLAG_COMBAT_TOGGLED) && (combat_flags & COMBAT_FLAG_COMBAT_ACTIVE))
return
ENABLE_BITFIELD(combat_flags, COMBAT_FLAG_COMBAT_TOGGLED)
if(!HAS_TRAIT(src, TRAIT_COMBAT_MODE_LOCKED) && !(combat_flags & COMBAT_FLAG_COMBAT_ACTIVE))
enable_combat_mode(silent, FALSE, visible, FALSE)
update_combat_mode_icon()
client?.show_popup_menus = FALSE
return TRUE
/// Disables intentionally being in combat mode. Please try not to use this proc for feedback whenever possible.
/mob/living/proc/disable_intentional_combat_mode(silent = TRUE, visible = FALSE)
if(!(combat_flags & COMBAT_FLAG_COMBAT_TOGGLED) && !(combat_flags & COMBAT_FLAG_COMBAT_ACTIVE))
return
DISABLE_BITFIELD(combat_flags, COMBAT_FLAG_COMBAT_TOGGLED)
if(combat_flags & COMBAT_FLAG_COMBAT_ACTIVE)
disable_combat_mode(silent, FALSE, visible, FALSE)
update_combat_mode_icon()
client?.show_popup_menus = TRUE
return TRUE
/// Toggles whether the user is intentionally in combat mode. THIS should be the proc you generally use! Has built in visual/to other player feedback, as well as an audible cue to ourselves.
/mob/living/proc/user_toggle_intentional_combat_mode(visible = TRUE)
var/old = (combat_flags & COMBAT_FLAG_COMBAT_TOGGLED)
if(old)
disable_intentional_combat_mode()
playsound_local(src, 'sound/misc/ui_toggleoff.ogg', 50, FALSE, pressure_affected = FALSE) //Slightly modified version of the above!
else if(CAN_TOGGLE_COMBAT_MODE(src))
enable_intentional_combat_mode()
var/current = (combat_flags & COMBAT_FLAG_COMBAT_ACTIVE) //because we could be locked
if(current != old) //only sound effect if you succeeded. Could have the feedback system be better but shrug, someone else can do it.
if(current)
playsound_local(src, 'sound/misc/ui_toggle.ogg', 50, FALSE, pressure_affected = FALSE) //Sound from interbay!
if(visible)
if(world.time >= combatmessagecooldown)
combatmessagecooldown = world.time + 10 SECONDS
if(a_intent != INTENT_HELP)
visible_message("<span class='warning'>[src] [resting ? "tenses up" : (prob(95)? "drops into a combative stance" : (prob(95)? "poses aggressively" : "asserts dominance with their pose"))].</span>")
else
visible_message("<span class='notice'>[src] [pick("looks","seems","goes")] [pick("alert","attentive","vigilant")].</span>")
+19
View File
@@ -118,3 +118,22 @@
/// Next world.time when we can get the "you can't move while buckled to [thing]" message.
var/buckle_message_cooldown = 0
//// CITADEL STATION COMBAT ////
/// See __DEFINES/combat.dm
var/combat_flags = COMBAT_FLAGS_STAMSYSTEM_EXEMPT
/// Next world.time when we will show a visible message on entering combat mode voluntarily again.
var/combatmessagecooldown = 0
var/incomingstammult = 1
var/bufferedstam = 0
var/stambuffer = 20
var/stambufferregentime
//Sprint buffer---
var/sprint_buffer = 42 //Tiles
var/sprint_buffer_max = 42
var/sprint_buffer_regen_ds = 0.3 //Tiles per world.time decisecond
var/sprint_buffer_regen_last = 0 //last world.time this was regen'd for math.
var/sprint_stamina_cost = 0.70 //stamina loss per tile while insufficient sprint buffer.
//---End
+8 -8
View File
@@ -33,9 +33,9 @@
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)
TOGGLE_BITFIELD(combat_flags, COMBAT_FLAG_INTENTIONALLY_RESTING)
to_chat(src, "<span class='notice'>You are now attempting to [(combat_flags & COMBAT_FLAG_INTENTIONALLY_RESTING) ? "[!resting ? "lay down and ": ""]stay down" : "[resting ? "get up and ": ""]stay up"].</span>")
if((combat_flags & COMBAT_FLAG_INTENTIONALLY_RESTING) && !resting)
set_resting(TRUE, FALSE)
else
resist_a_rest()
@@ -71,8 +71,8 @@
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
var/canmove = !immobilize && !stun && conscious && !paralyze && (!stat_softcrit || !pulledby) && !chokehold && !IsFrozen() && has_limbs && !pinned && !(combat_flags & COMBAT_FLAG_HARD_STAMCRIT)
var/canresist = !stun && conscious && !stat_softcrit && !paralyze && has_limbs && !(combat_flags & COMBAT_FLAG_HARD_STAMCRIT)
if(canmove)
mobility_flags |= MOBILITY_MOVE
@@ -84,7 +84,7 @@
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_involuntary = conscious && !stat_softcrit && !knockdown && !chokehold && !paralyze && (ignore_legs || has_legs) && !(buckled && buckled.buckle_lying) && !(combat_flags & COMBAT_FLAG_HARD_STAMCRIT)
var/canstand = canstand_involuntary && !resting
var/should_be_lying = !canstand
@@ -107,7 +107,7 @@
else
mobility_flags |= MOBILITY_UI|MOBILITY_PULL
var/canitem_general = !paralyze && !stun && conscious && !(stat_softcrit) && !chokehold && !restrained && has_arms && !recoveringstam
var/canitem_general = !paralyze && !stun && conscious && !(stat_softcrit) && !chokehold && !restrained && has_arms && !(combat_flags & COMBAT_FLAG_HARD_STAMCRIT)
if(canitem_general)
mobility_flags |= (MOBILITY_USE | MOBILITY_PICKUP | MOBILITY_STORAGE | MOBILITY_HOLD)
else
@@ -149,7 +149,7 @@
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
if(CHECK_MOBILITY(src, MOBILITY_MOVE) && !(combat_flags & COMBAT_FLAG_INTENTIONALLY_RESTING) && 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
// Movespeed mods based on arms/legs quantity
@@ -31,8 +31,16 @@
/mob/living/update_config_movespeed()
update_move_intent_slowdown()
sprint_buffer_max = CONFIG_GET(number/movedelay/sprint_buffer_max)
sprint_buffer_regen_ds = CONFIG_GET(number/movedelay/sprint_buffer_regen_per_ds)
sprint_stamina_cost = CONFIG_GET(number/movedelay/sprint_stamina_cost)
return ..()
/mob/living/movement_delay(ignorewalk = 0)
. = ..()
if(!CHECK_MOBILITY(src, MOBILITY_STAND))
. += 6
/// 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
+79
View File
@@ -0,0 +1,79 @@
/mob/living/ComponentInitialize()
. = ..()
RegisterSignal(src, SIGNAL_TRAIT(TRAIT_SPRINT_LOCKED), .proc/update_sprint_lock)
/mob/living/proc/update_sprint_icon()
var/obj/screen/sprintbutton/S = locate() in hud_used?.static_inventory
S?.update_icon_state()
/mob/living/proc/update_hud_sprint_bar()
hud_used?.sprint_buffer?.update_to_mob(src)
/mob/living/proc/update_sprint_lock()
var/locked = HAS_TRAIT(src, TRAIT_SPRINT_LOCKED)
var/current = (combat_flags & COMBAT_FLAG_SPRINT_ACTIVE)
var/desired = (combat_flags & COMBAT_FLAG_SPRINT_TOGGLED)
if(locked)
if(current)
disable_sprint_mode(FALSE)
else
if(current)
if(!desired)
disable_sprint_mode(FALSE)
else
if(desired)
enable_sprint_mode(FALSE)
update_sprint_icon()
/mob/living/proc/enable_sprint_mode(update_icon = TRUE)
if(combat_flags & COMBAT_FLAG_SPRINT_ACTIVE)
return
ENABLE_BITFIELD(combat_flags, COMBAT_FLAG_SPRINT_ACTIVE)
if(update_icon)
update_sprint_icon()
/mob/living/proc/disable_sprint_mode(update_icon = TRUE)
if(!(combat_flags & COMBAT_FLAG_SPRINT_ACTIVE))
return
DISABLE_BITFIELD(combat_flags, COMBAT_FLAG_SPRINT_ACTIVE)
if(update_icon)
update_sprint_icon()
/mob/living/proc/enable_intentional_sprint_mode()
if((combat_flags & COMBAT_FLAG_SPRINT_TOGGLED) && (combat_flags & COMBAT_FLAG_SPRINT_ACTIVE))
return
ENABLE_BITFIELD(combat_flags, COMBAT_FLAG_SPRINT_TOGGLED)
if(!HAS_TRAIT(src, TRAIT_SPRINT_LOCKED) && !(combat_flags & COMBAT_FLAG_SPRINT_ACTIVE))
enable_sprint_mode(FALSE)
update_sprint_icon()
return TRUE
/mob/living/proc/disable_intentional_sprint_mode()
if(!(combat_flags & COMBAT_FLAG_SPRINT_TOGGLED) && !(combat_flags & COMBAT_FLAG_SPRINT_ACTIVE))
return
DISABLE_BITFIELD(combat_flags, COMBAT_FLAG_SPRINT_TOGGLED)
if(combat_flags & COMBAT_FLAG_SPRINT_ACTIVE)
disable_sprint_mode(FALSE)
update_sprint_icon()
/mob/living/proc/user_toggle_intentional_sprint_mode()
var/old = (combat_flags & COMBAT_FLAG_SPRINT_TOGGLED)
if(old)
disable_intentional_sprint_mode()
if((m_intent == MOVE_INTENT_RUN) && CHECK_ALL_MOBILITY(src, MOBILITY_STAND|MOBILITY_MOVE))
playsound_local(src, 'sound/misc/sprintdeactivate.ogg', 50, FALSE, pressure_affected = FALSE)
else
enable_intentional_sprint_mode()
if((m_intent == MOVE_INTENT_RUN) && CHECK_ALL_MOBILITY(src, MOBILITY_STAND|MOBILITY_MOVE))
playsound_local(src, 'sound/misc/sprintactivate.ogg', 50, FALSE, pressure_affected = FALSE)
/mob/living/proc/sprint_hotkey(targetstatus)
if(targetstatus != FORCE_BOOLEAN(combat_flags & COMBAT_FLAG_SPRINT_ACTIVE))
default_toggle_sprint()
/mob/living/proc/doSprintLossTiles(amount)
return
// Silicons have snowflake behavior.
/mob/living/proc/default_toggle_sprint()
return user_toggle_intentional_sprint_mode()
@@ -12,3 +12,15 @@
/mob/living/silicon/robot/experience_pressure_difference(pressure_difference, direction)
if(!magpulse)
return ..()
/mob/living/silicon/robot/Move(NewLoc, direct)
. = ..()
if(. && (combat_flags & COMBAT_FLAG_SPRINT_ACTIVE) && !(movement_type & FLYING) && CHECK_ALL_MOBILITY(src, MOBILITY_STAND | MOBILITY_MOVE))
if(!(cell?.use(25)))
default_toggle_sprint(TRUE)
/mob/living/silicon/robot/movement_delay()
. = ..()
if(!resting && !(combat_flags & COMBAT_FLAG_SPRINT_ACTIVE))
. += 1
. += speed
@@ -0,0 +1,12 @@
/mob/living/silicon/robot/default_toggle_sprint(shutdown = FALSE)
var/current = (combat_flags & COMBAT_FLAG_SPRINT_ACTIVE)
if(current || shutdown || !cell || (cell.charge < 25) || !cansprint)
disable_intentional_sprint_mode()
if(CHECK_MULTIPLE_BITFIELDS(mobility_flags, MOBILITY_STAND|MOBILITY_MOVE))
if(shutdown)
playsound_local(src, 'sound/effects/light_flicker.ogg', 50, FALSE, pressure_affected = FALSE)
playsound_local(src, 'sound/misc/sprintdeactivate.ogg', 50, FALSE, pressure_affected = FALSE)
else
enable_intentional_sprint_mode()
if(CHECK_MULTIPLE_BITFIELDS(mobility_flags, MOBILITY_STAND|MOBILITY_MOVE))
playsound_local(src, 'sound/misc/sprintactivate.ogg', 50, FALSE, pressure_affected = FALSE)
@@ -15,6 +15,8 @@
speech_span = SPAN_ROBOT
flags_1 = PREVENT_CONTENTS_EXPLOSION_1 | HEAR_1
no_vore = TRUE
/// Enable sprint system but not stamina
combat_flags = COMBAT_FLAGS_STAMEXEMPT_YESSPRINT
var/datum/ai_laws/laws = null//Now... THEY ALL CAN ALL HAVE LAWS
var/last_lawchange_announce = 0
@@ -276,7 +276,7 @@ Auto Patrol[]"},
if(BOT_PREP_ARREST) // preparing to arrest target
// see if he got away. If he's no no longer adjacent or inside a closet or about to get up, we hunt again.
if(!Adjacent(target) || !isturf(target.loc) || !target.recoveringstam || target.getStaminaLoss() <= 120) // CIT CHANGE - replaces amountknockdown with recoveringstam and staminaloss checks
if(!Adjacent(target) || !isturf(target.loc) || !(target.combat_flags & COMBAT_FLAG_HARD_STAMCRIT) || target.getStaminaLoss() <= 120) // CIT CHANGE - replaces amountknockdown with recoveringstam and staminaloss checks
back_to_hunt()
return
@@ -303,7 +303,7 @@ Auto Patrol[]"},
back_to_idle()
return
if(!Adjacent(target) || !isturf(target.loc) || (target.loc != target_lastloc && !target.recoveringstam && target.getStaminaLoss() <= 120)) //if he's changed loc and about to get up or not adjacent or got into a closet, we prep arrest again. CIT CHANGE - replaces amountknockdown with recoveringstam and staminaloss checks
if(!Adjacent(target) || !isturf(target.loc) || (target.loc != target_lastloc && !(target.combat_flags & COMBAT_FLAG_HARD_STAMCRIT) && target.getStaminaLoss() <= 120)) //if he's changed loc and about to get up or not adjacent or got into a closet, we prep arrest again. CIT CHANGE - replaces amountknockdown with recoveringstam and staminaloss checks
back_to_hunt()
return
else
@@ -312,7 +312,7 @@ Auto Patrol: []"},
if(BOT_PREP_ARREST) // preparing to arrest target
// see if he got away. If he's no no longer adjacent or inside a closet or about to get up, we hunt again.
if( !Adjacent(target) || !isturf(target.loc) || target.getStaminaLoss() <= 120 || !target.recoveringstam) //CIT CHANGE - replaces amountknockdown with checks for stamina so secbots dont run into an infinite loop
if( !Adjacent(target) || !isturf(target.loc) || target.getStaminaLoss() <= 120 || !(target.combat_flags & COMBAT_FLAG_HARD_STAMCRIT)) //CIT CHANGE - replaces amountknockdown with checks for stamina so secbots dont run into an infinite loop
back_to_hunt()
return
@@ -339,7 +339,7 @@ Auto Patrol: []"},
back_to_idle()
return
if(!Adjacent(target) || !isturf(target.loc) || (target.loc != target_lastloc && !target.recoveringstam && target.getStaminaLoss() <= 120)) //if he's changed loc and about to get up or not adjacent or got into a closet, we prep arrest again. CIT CHANGE - replaces amountknockdown with recoveringstam and staminaloss check
if(!Adjacent(target) || !isturf(target.loc) || (target.loc != target_lastloc && !(target.combat_flags & COMBAT_FLAG_HARD_STAMCRIT) && target.getStaminaLoss() <= 120)) //if he's changed loc and about to get up or not adjacent or got into a closet, we prep arrest again. CIT CHANGE - replaces amountknockdown with recoveringstam and staminaloss check
back_to_hunt()
return
else //Try arresting again if the target escapes.
+224 -148
View File
@@ -30,45 +30,48 @@
/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
var/datum/status_effect/incapacitating/stun/S = IsStun()
if(S)
S.duration = max(world.time + amount, S.duration)
else if(amount > 0)
S = apply_status_effect(STATUS_EFFECT_STUN, amount, updating)
return S
if(!ignore_canstun && (!(status_flags & CANSTUN) || HAS_TRAIT(src, TRAIT_STUNIMMUNE)))
return
if(absorb_stun(amount, ignore_canstun))
return
var/datum/status_effect/incapacitating/stun/S = IsStun()
if(S)
S.duration = max(world.time + amount, S.duration)
else if(amount > 0)
S = apply_status_effect(STATUS_EFFECT_STUN, amount, updating)
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)
if(S)
qdel(S)
if(!ignore_canstun && (!(status_flags & CANSTUN) || HAS_TRAIT(src, TRAIT_STUNIMMUNE)))
return
var/datum/status_effect/incapacitating/stun/S = IsStun()
if(amount <= 0)
if(S)
qdel(S)
else
if(absorb_stun(amount, ignore_canstun))
return
if(S)
S.duration = world.time + amount
else
if(absorb_stun(amount, ignore_canstun))
return
if(S)
S.duration = world.time + amount
else
S = apply_status_effect(STATUS_EFFECT_STUN, amount, updating)
return S
S = apply_status_effect(STATUS_EFFECT_STUN, amount, updating)
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
var/datum/status_effect/incapacitating/stun/S = IsStun()
if(S)
S.duration += amount
else if(amount > 0)
S = apply_status_effect(STATUS_EFFECT_STUN, amount, updating)
return S
if(!ignore_canstun && (!(status_flags & CANSTUN) || HAS_TRAIT(src, TRAIT_STUNIMMUNE)))
return
if(absorb_stun(amount, ignore_canstun))
return
var/datum/status_effect/incapacitating/stun/S = IsStun()
if(S)
S.duration += amount
else if(amount > 0)
S = apply_status_effect(STATUS_EFFECT_STUN, amount, updating)
return S
///////////////////////////////// KNOCKDOWN /////////////////////////////////////
@@ -84,45 +87,48 @@
/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 + amount, K.duration)
else if(amount > 0)
K = apply_status_effect(STATUS_EFFECT_KNOCKDOWN, amount, updating)
return K
if(!ignore_canstun && (!(status_flags & CANKNOCKDOWN) || HAS_TRAIT(src, TRAIT_STUNIMMUNE)))
return
if(absorb_stun(amount, ignore_canstun))
return
var/datum/status_effect/incapacitating/knockdown/K = IsKnockdown()
if(K)
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_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)
if(!ignore_canstun && (!(status_flags & CANKNOCKDOWN) || HAS_TRAIT(src, TRAIT_STUNIMMUNE)))
return
var/datum/status_effect/incapacitating/knockdown/K = IsKnockdown()
if(amount <= 0)
if(K)
qdel(K)
else
if(absorb_stun(amount, ignore_canstun))
return
if(K)
K.duration = world.time + amount
else
if(absorb_stun(amount, ignore_canstun))
return
if(K)
K.duration = world.time + amount
else
K = apply_status_effect(STATUS_EFFECT_KNOCKDOWN, amount, updating)
return K
K = apply_status_effect(STATUS_EFFECT_KNOCKDOWN, amount, updating)
return K
/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)
K.duration += amount
else if(amount > 0)
K = apply_status_effect(STATUS_EFFECT_KNOCKDOWN, amount, updating)
return K
if(!ignore_canstun && (!(status_flags & CANKNOCKDOWN) || HAS_TRAIT(src, TRAIT_STUNIMMUNE)))
return
if(absorb_stun(amount, ignore_canstun))
return
var/datum/status_effect/incapacitating/knockdown/K = IsKnockdown()
if(K)
K.duration += amount
else if(amount > 0)
K = apply_status_effect(STATUS_EFFECT_KNOCKDOWN, amount, updating)
return K
///////////////////////////////// IMMOBILIZED ////////////////////////////////////
/mob/living/proc/IsImmobilized() //If we're immobilized
@@ -137,45 +143,48 @@
/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
if(!ignore_canstun && (!(status_flags & CANKNOCKDOWN) || HAS_TRAIT(src, TRAIT_STUNIMMUNE)))
return
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)
if(!ignore_canstun && (!(status_flags & CANKNOCKDOWN) || HAS_TRAIT(src, TRAIT_STUNIMMUNE)))
return
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
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
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
if(!ignore_canstun && (!(status_flags & CANKNOCKDOWN) || HAS_TRAIT(src, TRAIT_STUNIMMUNE)))
return
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
@@ -190,45 +199,48 @@
/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
if(!ignore_canstun && (!(status_flags & CANKNOCKDOWN) || HAS_TRAIT(src, TRAIT_STUNIMMUNE)))
return
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)
if(!ignore_canstun && (!(status_flags & CANKNOCKDOWN) || HAS_TRAIT(src, TRAIT_STUNIMMUNE)))
return
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
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
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
if(!ignore_canstun && (!(status_flags & CANKNOCKDOWN) || HAS_TRAIT(src, TRAIT_STUNIMMUNE)))
return
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
@@ -243,45 +255,104 @@
/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
if(!ignore_canstun && (!(status_flags & CANKNOCKDOWN) || HAS_TRAIT(src, TRAIT_STUNIMMUNE)))
return
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)
if(!ignore_canstun && (!(status_flags & CANKNOCKDOWN) || HAS_TRAIT(src, TRAIT_STUNIMMUNE)))
return
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
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
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(!ignore_canstun && (!(status_flags & CANKNOCKDOWN) || HAS_TRAIT(src, TRAIT_STUNIMMUNE)))
return
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
///////////////////////////////// STAGGERED ////////////////////////////////////
/mob/living/proc/IsStaggered() //If we're Staggered
return has_status_effect(STATUS_EFFECT_STAGGERED)
/mob/living/proc/AmountStaggered() //How many deciseconds remain in our Staggered status effect
var/datum/status_effect/staggered/I = IsStaggered()
if(I)
return I.duration - world.time
return 0
/mob/living/proc/Stagger(amount, updating = TRUE, ignore_canstun = FALSE) //Can't go below remaining duration
if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_STAGGER, amount, updating, ignore_canstun) & COMPONENT_NO_STUN)
return
if(!ignore_canstun && (!(status_flags & CANKNOCKDOWN) || HAS_TRAIT(src, TRAIT_STUNIMMUNE)))
return
if(absorb_stun(amount, ignore_canstun))
return
var/datum/status_effect/staggered/I = IsStaggered()
if(I)
I.duration = max(world.time + amount, I.duration)
else if(amount > 0)
I = apply_status_effect(STATUS_EFFECT_STAGGERED, amount, updating)
return I
/mob/living/proc/SetStaggered(amount, updating = TRUE, ignore_canstun = FALSE) //Sets remaining duration
if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_STAGGER, amount, updating, ignore_canstun) & COMPONENT_NO_STUN)
return
if(!ignore_canstun && (!(status_flags & CANKNOCKDOWN) || HAS_TRAIT(src, TRAIT_STUNIMMUNE)))
return
var/datum/status_effect/staggered/I = IsStaggered()
if(amount <= 0)
if(I)
qdel(I)
else
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
I.duration = world.time + amount
else
I = apply_status_effect(STATUS_EFFECT_STAGGERED, amount, updating)
return I
/mob/living/proc/AdjustStaggered(amount, updating = TRUE, ignore_canstun = FALSE) //Adds to remaining duration
if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_STAGGER, amount, updating, ignore_canstun) & COMPONENT_NO_STUN)
return
if(!ignore_canstun && (!(status_flags & CANKNOCKDOWN) || HAS_TRAIT(src, TRAIT_STUNIMMUNE)))
return
if(absorb_stun(amount, ignore_canstun))
return
var/datum/status_effect/staggered/I = IsStaggered()
if(I)
I.duration += amount
else if(amount > 0)
I = apply_status_effect(STATUS_EFFECT_STAGGERED, amount, updating)
return I
//Blanket
/mob/living/proc/AllImmobility(amount, updating, ignore_canstun = FALSE)
@@ -290,6 +361,7 @@
Stun(amount, FALSE, ignore_canstun)
Immobilize(amount, FALSE, ignore_canstun)
Daze(amount, FALSE, ignore_canstun)
Stagger(amount, FALSE, ignore_canstun)
if(updating)
update_mobility()
@@ -299,6 +371,7 @@
SetStun(amount, FALSE, ignore_canstun)
SetImmobilized(amount, FALSE, ignore_canstun)
SetDazed(amount, FALSE, ignore_canstun)
SetStaggered(amount, FALSE, ignore_canstun)
if(updating)
update_mobility()
@@ -308,6 +381,7 @@
AdjustStun(amount, FALSE, ignore_canstun)
AdjustImmobilized(amount, FALSE, ignore_canstun)
AdjustDazed(amount, FALSE, ignore_canstun)
AdjustStaggered(amount, FALSE, ignore_canstun)
if(updating)
update_mobility()
@@ -323,11 +397,13 @@
SetImmobilized(amount, FALSE, ignore_canstun)
if(AmountDazed() > amount)
SetImmobilized(amount, FALSE, ignore_canstun)
if(AmountStaggered() > amount)
SetStaggered(amount, FALSE, ignore_canstun)
if(updating)
update_mobility()
/mob/living/proc/HighestImmobilityAmount()
return max(max(max(max(AmountStun(), AmountKnockdown()), AmountParalyzed()), AmountImmobilized()), AmountDazed())
return max(AmountStun(), AmountKnockdown(), AmountParalyzed(), AmountImmobilized(), AmountDazed(), AmountStaggered())
//////////////////UNCONSCIOUS
/mob/living/proc/IsUnconscious() //If we're unconscious
+5 -5
View File
@@ -168,7 +168,7 @@
return
if(firing)
return
if(user.getStaminaLoss() >= STAMINA_SOFTCRIT) //respect stamina softcrit
if(IS_STAMCRIT(user)) //respect stamina softcrit
to_chat(user, "<span class='warning'>You are too exhausted to fire [src]!</span>")
return
if(flag) //It's adjacent, is the user, or is on the user's person
@@ -562,11 +562,11 @@
update_icon()
/obj/item/gun/proc/getinaccuracy(mob/living/user)
if(!iscarbon(user))
if(!isliving(user))
return FALSE
else
var/mob/living/carbon/holdingdude = user
if(istype(holdingdude) && holdingdude.combatmode)
return (max((holdingdude.lastdirchange + weapon_weight * 25) - world.time,0) * inaccuracy_modifier)
var/mob/living/holdingdude = user
if(istype(holdingdude) && (holdingdude.combat_flags & COMBAT_FLAG_COMBAT_ACTIVE))
return 0
else
return ((weapon_weight * 25) * inaccuracy_modifier)
@@ -37,7 +37,7 @@
/obj/item/gun/ballistic/shotgun/attack_self(mob/living/user)
if(recentpump > world.time)
return
if(istype(user) && user.getStaminaLoss() >= STAMINA_SOFTCRIT)//CIT CHANGE - makes pumping shotguns impossible in stamina softcrit
if(IS_STAMCRIT(user))//CIT CHANGE - makes pumping shotguns impossible in stamina softcrit
to_chat(user, "<span class='warning'>You're too exhausted for that.</span>")//CIT CHANGE - ditto
return//CIT CHANGE - ditto
pump(user, TRUE)
@@ -27,6 +27,7 @@
REMOVE_TRAIT(owner, TRAIT_PACIFISM, "slimestatus")
owner.visible_message("<span class='notice'>[owner] stops glowing, the rainbow light fading away.</span>",
"<span class='warning'>You no longer feel protected...</span>")
return ..()
/obj/screen/alert/status_effect/slimeskin
name = "Adamantine Slimeskin"
@@ -56,6 +57,7 @@
H.physiology.damage_resistance -= 10
owner.visible_message("<span class='warning'>[owner]'s gel coating liquefies and dissolves away.</span>",
"<span class='notice'>Your gel second-skin dissolves!</span>")
return ..()
/datum/status_effect/slimerecall
id = "slime_recall"
@@ -87,6 +89,7 @@
"<span class='warning'>The unknown force snatches briefly you from reality, and deposits you next to [target]!</span>")
do_sparks(3, TRUE, owner)
owner.forceMove(target.loc)
return ..()
/obj/screen/alert/status_effect/freon/stasis
desc = "You're frozen inside of a protective ice cube! While inside, you can't do anything, but are immune to harm! Resist to get out."
@@ -117,6 +120,7 @@
qdel(cube)
owner.status_flags &= ~GODMODE
UnregisterSignal(owner, COMSIG_LIVING_RESIST)
return ..()
/datum/status_effect/slime_clone
id = "slime_cloned"
@@ -156,6 +160,7 @@
if(clone)
clone.unequip_everything()
qdel(clone)
return ..()
/obj/screen/alert/status_effect/clone_decay
name = "Clone Decay"
@@ -195,6 +200,7 @@
/datum/status_effect/bloodchill/on_remove()
owner.remove_movespeed_modifier("bloodchilled")
return ..()
/obj/screen/alert/status_effect/bloodchill
name = "Bloodchilled"
@@ -218,6 +224,7 @@
/datum/status_effect/bonechill/on_remove()
owner.remove_movespeed_modifier("bonechilled")
return ..()
/obj/screen/alert/status_effect/bonechill
name = "Bonechilled"
@@ -249,6 +256,7 @@ datum/status_effect/rebreathing/tick()
/datum/status_effect/firecookie/on_remove()
REMOVE_TRAIT(owner, TRAIT_RESISTCOLD,"firecookie")
return ..()
/datum/status_effect/watercookie
id = "watercookie"
@@ -266,6 +274,7 @@ datum/status_effect/rebreathing/tick()
/datum/status_effect/watercookie/on_remove()
REMOVE_TRAIT(owner, TRAIT_NOSLIPWATER,"watercookie")
return ..()
/datum/status_effect/metalcookie
id = "metalcookie"
@@ -283,6 +292,7 @@ datum/status_effect/rebreathing/tick()
if(ishuman(owner))
var/mob/living/carbon/human/H = owner
H.physiology.brute_mod /= 0.9
return ..()
/datum/status_effect/sparkcookie
id = "sparkcookie"
@@ -302,6 +312,7 @@ datum/status_effect/rebreathing/tick()
if(ishuman(owner))
var/mob/living/carbon/human/H = owner
H.physiology.siemens_coeff = original_coeff
return ..()
/datum/status_effect/toxincookie
id = "toxincookie"
@@ -315,6 +326,7 @@ datum/status_effect/rebreathing/tick()
/datum/status_effect/toxincookie/on_remove()
REMOVE_TRAIT(owner, TRAIT_TOXINLOVER,"toxincookie")
return ..()
/datum/status_effect/timecookie
id = "timecookie"
@@ -332,6 +344,7 @@ datum/status_effect/rebreathing/tick()
if(ishuman(owner))
var/mob/living/carbon/human/H
H.physiology.do_after_speed /= 0.95
return ..()
/datum/status_effect/lovecookie
id = "lovecookie"
@@ -377,6 +390,7 @@ datum/status_effect/rebreathing/tick()
/datum/status_effect/tarfoot/on_remove()
owner.remove_movespeed_modifier(MOVESPEED_ID_TARFOOT)
return ..()
/datum/status_effect/spookcookie
id = "spookcookie"
@@ -392,6 +406,7 @@ datum/status_effect/rebreathing/tick()
/datum/status_effect/spookcookie/on_remove()
owner.remove_alt_appearance("spookyscary")
return ..()
/datum/status_effect/peacecookie
id = "peacecookie"
@@ -415,6 +430,7 @@ datum/status_effect/rebreathing/tick()
/datum/status_effect/plur/on_remove()
REMOVE_TRAIT(owner, TRAIT_PACIFISM, "peacecookie")
return ..()
/datum/status_effect/adamantinecookie
id = "adamantinecookie"
@@ -432,6 +448,7 @@ datum/status_effect/rebreathing/tick()
if(ishuman(owner))
var/mob/living/carbon/human/H = owner
H.physiology.burn_mod /= 0.9
return ..()
///////////////////////////////////////////////////////
//////////////////STABILIZED EXTRACTS//////////////////
@@ -513,6 +530,7 @@ datum/status_effect/rebreathing/tick()
datum/status_effect/stabilized/blue/on_remove()
REMOVE_TRAIT(owner, TRAIT_NOSLIPWATER, "slimestatus")
return ..()
/datum/status_effect/stabilized/metal
id = "stabilizedmetal"
@@ -536,7 +554,6 @@ datum/status_effect/stabilized/blue/on_remove()
to_chat(owner, "<span class='notice'>[linked_extract] adds a layer of slime to [S], which metamorphosizes into another sheet of material!</span>")
return ..()
/datum/status_effect/stabilized/yellow
id = "stabilizedyellow"
colour = "yellow"
@@ -591,6 +608,7 @@ datum/status_effect/stabilized/blue/on_remove()
/datum/status_effect/stabilized/darkpurple/on_remove()
REMOVE_TRAIT(owner, TRAIT_RESISTHEATHANDS, "slimestatus")
qdel(fire)
return ..()
/datum/status_effect/stabilized/darkblue
id = "stabilizeddarkblue"
@@ -638,6 +656,7 @@ datum/status_effect/stabilized/blue/on_remove()
if(ishuman(owner))
var/mob/living/carbon/human/H = owner
H.physiology.hunger_mod /= 0.8
return ..()
//Bluespace has an icon because it's kinda active.
/obj/screen/alert/status_effect/bluespaceslime
@@ -697,6 +716,7 @@ datum/status_effect/stabilized/blue/on_remove()
/datum/status_effect/stabilized/sepia/on_remove()
owner.remove_movespeed_modifier(MOVESPEED_ID_SEPIA)
return ..()
/datum/status_effect/stabilized/cerulean
id = "stabilizedcerulean"
@@ -733,6 +753,7 @@ datum/status_effect/stabilized/blue/on_remove()
clone.visible_message("<span class='warning'>[clone] dissolves into a puddle of goo!</span>")
clone.unequip_everything()
qdel(clone)
return ..()
/datum/status_effect/stabilized/pyrite
id = "stabilizedpyrite"
@@ -749,6 +770,7 @@ datum/status_effect/stabilized/blue/on_remove()
/datum/status_effect/stabilized/pyrite/on_remove()
owner.color = originalcolor
return ..()
/datum/status_effect/stabilized/red
id = "stabilizedred"
@@ -760,6 +782,7 @@ datum/status_effect/stabilized/blue/on_remove()
/datum/status_effect/stabilized/red/on_remove()
owner.unignore_slowdown("slimestatus")
return ..()
/datum/status_effect/stabilized/green
id = "stabilizedgreen"
@@ -791,6 +814,7 @@ datum/status_effect/stabilized/blue/on_remove()
originalDNA.transfer_identity(H)
H.real_name = originalname
H.updateappearance(mutcolor_update=1)
return ..()
/datum/status_effect/brokenpeace
id = "brokenpeace"
@@ -854,6 +878,7 @@ datum/status_effect/stabilized/blue/on_remove()
for(var/i in owner.faction)
if(i == faction_name)
owner.faction -= faction_name
return ..()
/datum/status_effect/stabilized/oil
id = "stabilizedoil"
@@ -947,6 +972,7 @@ datum/status_effect/stabilized/blue/on_remove()
/datum/status_effect/stabilized/gold/on_remove()
if(familiar)
qdel(familiar)
return ..()
/datum/status_effect/stabilized/adamantine/on_apply()
if(ishuman(owner))
@@ -958,6 +984,7 @@ datum/status_effect/stabilized/blue/on_remove()
if(ishuman(owner))
var/mob/living/carbon/human/H = owner
H.physiology.damage_resistance -= 5
return ..()
/datum/status_effect/stabilized/rainbow
id = "stabilizedrainbow"
+3 -3
View File
@@ -27,9 +27,9 @@
/obj/vehicle/ridden/secway/relaymove(mob/user, direction)
var/new_speed = normalspeed
if(ishuman(user))
var/mob/living/carbon/human/H = user
if(H.sprinting && charge)
if(isliving(user))
var/mob/living/L = user
if((L.combat_flags & COMBAT_FLAG_SPRINT_TOGGLED) && charge)
charge--
new_speed = chargespeed
var/datum/component/riding/D = GetComponent(/datum/component/riding)