Merge pull request #14482 from silicons/combat_v7

Combat v7 - Sprint removal, automatic block/parry, turns combat mode into a pure UI/interaction toggle with no side effects, and a truckload of other stuff.
This commit is contained in:
Lin
2021-06-27 13:04:29 -07:00
committed by GitHub
76 changed files with 854 additions and 392 deletions

View File

@@ -90,7 +90,6 @@
source.playsound_local(source, 'sound/misc/ui_toggle.ogg', 50, FALSE, pressure_affected = FALSE) //Sound from interbay!
RegisterSignal(source, COMSIG_MOB_CLIENT_MOUSEMOVE, .proc/onMouseMove)
RegisterSignal(source, COMSIG_MOVABLE_MOVED, .proc/on_move)
RegisterSignal(source, COMSIG_MOB_CLIENT_MOVE, .proc/on_client_move)
if(hud_icon)
hud_icon.combat_on = TRUE
hud_icon.update_icon()
@@ -115,7 +114,7 @@
to_chat(source, self_message)
if(playsound)
source.playsound_local(source, 'sound/misc/ui_toggleoff.ogg', 50, FALSE, pressure_affected = FALSE) //Slightly modified version of the toggleon sound!
UnregisterSignal(source, list(COMSIG_MOB_CLIENT_MOUSEMOVE, COMSIG_MOVABLE_MOVED, COMSIG_MOB_CLIENT_MOVE))
UnregisterSignal(source, list(COMSIG_MOB_CLIENT_MOUSEMOVE, COMSIG_MOVABLE_MOVED))
if(hud_icon)
hud_icon.combat_on = FALSE
hud_icon.update_icon()
@@ -128,11 +127,6 @@
if((mode_flags & COMBAT_MODE_ACTIVE) && L.client)
L.setDir(lastmousedir, ismousemovement = TRUE)
/// Added movement delay if moving backward.
/datum/component/combat_mode/proc/on_client_move(mob/source, client/client, direction, n, oldloc, added_delay)
if(oldloc != n && direction == REVERSE_DIR(source.dir))
client.move_delay += added_delay*0.5
///Changes the user direction to (try) match the pointer.
/datum/component/combat_mode/proc/onMouseMove(mob/source, object, location, control, params)
if(source.client.show_popup_menus)

View File

@@ -24,6 +24,7 @@
identification_method_flags = id_method_flags
/datum/component/identification/RegisterWithParent()
RegisterSignal(parent, COMSIG_IDENTIFICATION_KNOWLEDGE_CHECK, .proc/check_knowledge)
RegisterSignal(parent, COMSIG_PARENT_EXAMINE, .proc/on_examine)
if(identification_effect_flags & ID_COMPONENT_EFFECT_NO_ACTIONS)
RegisterSignal(parent, COMSIG_ITEM_EQUIPPED, .proc/on_equip)

View File

@@ -283,14 +283,11 @@
// insanity define to mark the next set of cardinals.
#define CARDINAL_MARK(ndir, cdir, edir) \
if(edir & cdir) { \
CARDINAL_MARK_NOCHECK(ndir, cdir, edir); \
};
#define CARDINAL_MARK_NOCHECK(ndir, cdir, edir) \
expanding = get_step(T,ndir); \
if(expanding && !exploded_last[expanding] && !edges[expanding]) { \
powers_next[expanding] = max(powers_next[expanding], returned); \
edges_next[expanding] = (cdir | edges_next[expanding]); \
expanding = get_step(T,ndir); \
if(expanding && !exploded_last[expanding] && !edges[expanding]) { \
powers_next[expanding] = max(powers_next[expanding], returned); \
edges_next[expanding] = (cdir | edges_next[expanding]); \
}; \
};
// insanity define to do diagonal marking as 2 substeps
@@ -308,24 +305,15 @@
};
// insanity define to mark the diagonals that would otherwise be missed
#define DIAGONAL_MARK(ndir, cdir, edir) \
if(edir & cdir) { \
DIAGONAL_MARK_NOCHECK(ndir, cdir, edir); \
};
// this only works because right now, WEX_DIR_X is the same as a byond dir
// and we know we're only passing in one dir at a time.
// if this ever stops being the case, and explosions break when you touch this, now you know why.
#define DIAGONAL_MARK_NOCHECK(ndir, cdir, edir) \
DIAGONAL_SUBSTEP(turn(ndir, 90), turn(cdir, 90), edir); \
DIAGONAL_SUBSTEP(turn(ndir, -90), turn(cdir, -90), edir);
// mark
#define MARK(ndir, cdir, edir) \
#define DIAGONAL_MARK(ndir, cdir, edir) \
if(edir & cdir) { \
CARDINAL_MARK_NOCHECK(ndir, cdir, edir); \
DIAGONAL_MARK_NOCHECK(ndir, cdir, edir); \
DIAGONAL_SUBSTEP(turn(ndir, 90), turn(cdir, 90), edir); \
DIAGONAL_SUBSTEP(turn(ndir, -90), turn(cdir, -90), edir); \
};
CARDINAL_MARK(NORTH, WEX_DIR_NORTH, dir)
CARDINAL_MARK(SOUTH, WEX_DIR_SOUTH, dir)
CARDINAL_MARK(EAST, WEX_DIR_EAST, dir)
@@ -372,7 +360,9 @@
#undef WEX_ACT
#undef CALCULATE_DIAGONAL_POWER
#undef CALCULATE_DIAGONAL_CROSS_POWER
#undef DIAGONAL_SUBSTEP
#undef DIAGONAL_MARK
#undef CARDINAL_MARK
#undef MARK

View File

@@ -43,12 +43,8 @@
/datum/martial_art/proc/damage_roll(mob/living/carbon/human/A, mob/living/carbon/human/D)
//Here we roll for our damage to be added into the damage var in the various attack procs. This is changed depending on whether we are in combat mode, lying down, or if our target is in combat mode.
var/damage = rand(A.dna.species.punchdamagelow, A.dna.species.punchdamagehigh)
if(SEND_SIGNAL(D, COMSIG_COMBAT_MODE_CHECK, COMBAT_MODE_INACTIVE))
damage *= 1.2
if(!CHECK_MOBILITY(A, MOBILITY_STAND))
damage *= 0.7
if(SEND_SIGNAL(A, COMSIG_COMBAT_MODE_CHECK, COMBAT_MODE_INACTIVE))
damage *= 0.8
return damage
/datum/martial_art/proc/teach(mob/living/carbon/human/H, make_temporary = FALSE)

View File

@@ -144,14 +144,16 @@
parry_time_active_visual_override = 3
parry_time_spindown_visual_override = 12
parry_flags = PARRY_DEFAULT_HANDLE_FEEDBACK //can attack while
parry_time_perfect = 2.5 // first ds isn't perfect
parry_time_perfect_leeway = 1.5
parry_time_perfect = 2.5
parry_time_perfect_leeway = 2.5
parry_imperfect_falloff_percent = 5
parry_efficiency_to_counterattack = 100
parry_efficiency_considered_successful = 65 // VERY generous
parry_efficiency_perfect = 100
parry_failed_stagger_duration = 4 SECONDS
parry_failed_cooldown_duration = 2 SECONDS
parry_cooldown = 0.5 SECONDS
parry_flags = NONE
/mob/living/carbon/human/UseStaminaBuffer(amount, warn = FALSE, considered_action = TRUE)
amount *= physiology? physiology.stamina_buffer_mod : 1

View File

@@ -95,21 +95,31 @@
/datum/status_effect/staggered/on_creation(mob/living/new_owner, set_duration)
if(isnum(set_duration))
duration = set_duration
if(!CONFIG_GET(flag/sprint_enabled))
new_owner.add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/status_effect/stagger, TRUE, CONFIG_GET(number/sprintless_stagger_slowdown))
return ..()
/datum/status_effect/staggered/on_remove()
owner.remove_movespeed_modifier(/datum/movespeed_modifier/status_effect/stagger)
return ..()
/datum/status_effect/off_balance
id = "offbalance"
blocks_sprint = TRUE
alert_type = null
/datum/status_effect/off_balance/on_creation(mob/living/new_owner, set_duration)
if(isnum(set_duration))
duration = set_duration
if(!CONFIG_GET(flag/sprint_enabled))
new_owner.add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/status_effect/off_balance, TRUE, CONFIG_GET(number/sprintless_off_balance_slowdown))
return ..()
/datum/status_effect/off_balance/on_remove()
var/active_item = owner.get_active_held_item()
if(active_item)
owner.visible_message("<span class='warning'>[owner.name] regains their grip on \the [active_item]!</span>", "<span class='warning'>You regain your grip on \the [active_item]</span>", null, COMBAT_MESSAGE_RANGE)
owner.remove_movespeed_modifier(/datum/movespeed_modifier/status_effect/off_balance)
return ..()
/obj/screen/alert/status_effect/asleep
@@ -117,24 +127,14 @@
desc = "You've fallen asleep. Wait a bit and you should wake up. Unless you don't, considering how helpless you are."
icon_state = "asleep"
/datum/status_effect/grouped/stasis
id = "stasis"
duration = -1
tick_interval = 10
var/last_dead_time
/datum/status_effect/no_combat_mode
id = "no_combat_mode"
alert_type = null
status_type = STATUS_EFFECT_REPLACE
blocks_combatmode = TRUE
/datum/status_effect/no_combat_mode/on_creation(mob/living/new_owner, set_duration)
if(isnum(set_duration))
duration = set_duration
. = ..()
/datum/status_effect/no_combat_mode/robotic_emp
/datum/status_effect/robotic_emp
id = "emp_no_combat_mode"
/datum/status_effect/mesmerize
@@ -144,13 +144,11 @@
/datum/status_effect/mesmerize/on_creation(mob/living/new_owner, set_duration)
. = ..()
ADD_TRAIT(owner, TRAIT_MUTE, "mesmerize")
ADD_TRAIT(owner, TRAIT_COMBAT_MODE_LOCKED, "mesmerize")
owner.add_movespeed_modifier(/datum/movespeed_modifier/status_effect/mesmerize)
/datum/status_effect/mesmerize/on_remove()
. = ..()
REMOVE_TRAIT(owner, TRAIT_MUTE, "mesmerize")
REMOVE_TRAIT(owner, TRAIT_COMBAT_MODE_LOCKED, "mesmerize")
owner.remove_movespeed_modifier(/datum/movespeed_modifier/status_effect/mesmerize)
/datum/status_effect/mesmerize/on_creation(mob/living/new_owner, set_duration)
@@ -168,7 +166,7 @@
id = "tased"
alert_type = null
var/movespeed_mod = /datum/movespeed_modifier/status_effect/tased
var/stamdmg_per_ds = 0 //a 20 duration would do 20 stamdmg, disablers do 24 or something
var/stamdmg_per_ds = 1 //a 20 duration would do 20 stamdmg, disablers do 24 or something
var/last_tick = 0 //fastprocess processing speed is a goddamn sham, don't trust it.
/datum/status_effect/electrode/on_creation(mob/living/new_owner, set_duration)
@@ -199,9 +197,9 @@
/datum/status_effect/electrode/no_combat_mode
id = "tased_strong"
movespeed_mod = /datum/movespeed_modifier/status_effect/tased/no_combat_mode
blocks_combatmode = TRUE
stamdmg_per_ds = 1
//OTHER DEBUFFS
/datum/status_effect/his_wrath //does minor damage over time unless holding His Grace
id = "his_wrath"

View File

@@ -11,8 +11,6 @@
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
/// 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
@@ -61,8 +59,6 @@
/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
@@ -74,8 +70,6 @@
/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)
if(blocks_combatmode)
REMOVE_TRAIT(owner, TRAIT_COMBAT_MODE_LOCKED, src)
if(blocks_sprint)
REMOVE_TRAIT(owner, TRAIT_SPRINT_LOCKED, src)
return TRUE
@@ -83,8 +77,6 @@
/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)
if(blocks_combatmode)
REMOVE_TRAIT(owner, TRAIT_COMBAT_MODE_LOCKED, src)
if(blocks_sprint)
REMOVE_TRAIT(owner, TRAIT_SPRINT_LOCKED, src)
owner = null

View File

@@ -128,7 +128,7 @@
initial_flow = 1.5
gauzed_clot_rate = 0.8
internal_bleeding_chance = 30
internal_bleeding_coefficient = 1.25
internal_bleeding_coefficient = 1
threshold_minimum = 40
threshold_penalty = 15
status_effect_type = /datum/status_effect/wound/pierce/moderate
@@ -142,10 +142,10 @@
occur_text = "looses a violent spray of blood, revealing a pierced wound"
sound_effect = 'sound/effects/wounds/pierce2.ogg'
severity = WOUND_SEVERITY_SEVERE
initial_flow = 2.25
initial_flow = 2
gauzed_clot_rate = 0.6
internal_bleeding_chance = 60
internal_bleeding_coefficient = 1.5
internal_bleeding_coefficient = 1.25
threshold_minimum = 60
threshold_penalty = 25
status_effect_type = /datum/status_effect/wound/pierce/severe
@@ -159,10 +159,10 @@
occur_text = "blasts apart, sending chunks of viscera flying in all directions"
sound_effect = 'sound/effects/wounds/pierce3.ogg'
severity = WOUND_SEVERITY_CRITICAL
initial_flow = 3
initial_flow = 2.7
gauzed_clot_rate = 0.4
internal_bleeding_chance = 80
internal_bleeding_coefficient = 1.75
internal_bleeding_coefficient = 1.5
threshold_minimum = 110
threshold_penalty = 40
status_effect_type = /datum/status_effect/wound/pierce/critical

View File

@@ -253,7 +253,7 @@
occur_text = "is cut open, slowly leaking blood"
sound_effect = 'sound/effects/wounds/blood1.ogg'
severity = WOUND_SEVERITY_MODERATE
initial_flow = 1.5
initial_flow = 1.25
minimum_flow = 0.375
max_per_type = 3
clot_rate = 0.12
@@ -270,8 +270,8 @@
occur_text = "is ripped open, veins spurting blood"
sound_effect = 'sound/effects/wounds/blood2.ogg'
severity = WOUND_SEVERITY_SEVERE
initial_flow = 2.4375
minimum_flow = 2.0625
initial_flow = 2
minimum_flow = 1.75
clot_rate = 0.07
max_per_type = 4
threshold_minimum = 60
@@ -288,8 +288,8 @@
occur_text = "is torn open, spraying blood wildly"
sound_effect = 'sound/effects/wounds/blood3.ogg'
severity = WOUND_SEVERITY_CRITICAL
initial_flow = 3.1875
minimum_flow = 3
initial_flow = 2.75
minimum_flow = 2.5
clot_rate = -0.05 // critical cuts actively get worse instead of better
max_per_type = 5
threshold_minimum = 90