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:
@@ -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
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
owner.adjust_bodytemperature(100)
|
||||
owner.update_mobility()
|
||||
UnregisterSignal(owner, COMSIG_LIVING_RESIST)
|
||||
return ..()
|
||||
|
||||
/datum/status_effect/freon/watcher
|
||||
duration = 8
|
||||
|
||||
@@ -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 ..()
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user