From 2232271ea5f9f2476d812368de6c715518a69a59 Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Sat, 30 May 2020 22:29:41 -0700
Subject: [PATCH] fixes and render
---
code/datums/components/combat_mode.dm | 1 +
code/game/objects/items.dm | 7 ++++---
code/game/objects/items/twohanded.dm | 4 ++--
code/modules/mob/living/living_active_parry.dm | 6 ------
.../mob/living/living_blocking_parrying.dm | 15 ++++++++++-----
5 files changed, 17 insertions(+), 16 deletions(-)
diff --git a/code/datums/components/combat_mode.dm b/code/datums/components/combat_mode.dm
index ad860c1309..b9952e9133 100644
--- a/code/datums/components/combat_mode.dm
+++ b/code/datums/components/combat_mode.dm
@@ -120,6 +120,7 @@
hud_icon.combat_on = FALSE
hud_icon.update_icon()
source.stop_active_blocking()
+ source.end_parry_sequence()
///Changes the user direction to (try) keep match the pointer.
/datum/component/combat_mode/proc/on_move(atom/movable/source, dir, atom/oldloc, forced)
diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm
index 28c60c9eba..2433419b55 100644
--- a/code/game/objects/items.dm
+++ b/code/game/objects/items.dm
@@ -238,9 +238,10 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
. += "[src] is made of cold-resistant materials."
if(resistance_flags & FIRE_PROOF)
. += "[src] is made of fire-retardant materials."
-
-
-
+
+ if(item_flags & (ITEM_CAN_BLOCK | ITEM_CAN_PARRY))
+ var/datum/block_parry_data/data = return_block_parry_datum(block_parry_data)
+ . += "[src] has the capacity to be used to block and/or parry. \[Show Stats\]"
if(!user.research_scanner)
return
diff --git a/code/game/objects/items/twohanded.dm b/code/game/objects/items/twohanded.dm
index d3bc35cea7..f908d41ca5 100644
--- a/code/game/objects/items/twohanded.dm
+++ b/code/game/objects/items/twohanded.dm
@@ -335,7 +335,7 @@
parry_efficiency_perfect = 90
parry_failed_stagger_duration = 3 SECONDS
parry_failed_clickcd_duration = CLICK_CD_MELEE
- parry_cooldown = 3 SECONDS
+ parry_cooldown = 2 SECONDS
// more efficient vs projectiles
block_stamina_efficiency_override = list(
@@ -1122,7 +1122,7 @@
TEXT_ATTACK_TYPE_PROJECTILE = 1 // extremely harsh window for projectiles
)
// not extremely punishing to fail, but no spamming the parry.
- parry_cooldown = 5 SECONDS
+ parry_cooldown = 2.5 SECONDS
parry_failed_stagger_duration = 1.5 SECONDS
parry_failed_clickcd_duration = 1 SECONDS
diff --git a/code/modules/mob/living/living_active_parry.dm b/code/modules/mob/living/living_active_parry.dm
index 9e8a756b68..af8278ee68 100644
--- a/code/modules/mob/living/living_active_parry.dm
+++ b/code/modules/mob/living/living_active_parry.dm
@@ -20,9 +20,6 @@
if(!(combat_flags & COMBAT_FLAG_PARRY_CAPABLE))
to_chat(src, "You are not something that can parry attacks.")
return
- if(!CHECK_MOBILITY(src, MOBILITY_USE))
- to_chat(src, "You are incapacitated, or otherwise unable to swing a weapon to parry with!")
- return FALSE
if(!SEND_SIGNAL(src, COMSIG_COMBAT_MODE_CHECK, COMBAT_MODE_ACTIVE))
to_chat(src, "You must be in combat mode to parry!")
return FALSE
@@ -209,9 +206,6 @@
var/stage = get_parry_stage()
if(stage != PARRY_ACTIVE)
return BLOCK_NONE
- if(!CHECK_MOBILITY(src, MOBILITY_USE))
- to_chat(src, "Your parry is interrupted!")
- end_parry_sequence()
var/datum/block_parry_data/data = get_parry_data()
if(attack_type && (!(attack_type & data.parry_attack_types) || (attack_type & ATTACK_TYPE_PARRY_COUNTERATTACK))) // if this attack is from a parry do not parry it lest we infinite loop.
return BLOCK_NONE
diff --git a/code/modules/mob/living/living_blocking_parrying.dm b/code/modules/mob/living/living_blocking_parrying.dm
index 81db6945f1..1da3da5551 100644
--- a/code/modules/mob/living/living_blocking_parrying.dm
+++ b/code/modules/mob/living/living_blocking_parrying.dm
@@ -30,7 +30,7 @@ GLOBAL_LIST_EMPTY(block_parry_data)
/// Our slowdown added while blocking
var/block_slowdown = 2
/// Clickdelay added to user after block ends
- var/block_end_click_cd_add = 4
+ var/block_end_click_cd_add = 0
/// Disallow attacking during block
var/block_lock_attacking = TRUE
/// The priority we get in [mob/do_run_block()] while we're being used to parry.
@@ -180,6 +180,15 @@ GLOBAL_LIST_EMPTY(block_parry_data)
} \
dat += "[english_list(assembled__##varname)]";
+/datum/block_parry_data/Topic(href, href_list)
+ . = ..()
+ if(.)
+ return
+ if(href_list["render"])
+ var/datum/browser/B = new(usr, REF(src), href_list["name"], 400, 1000)
+ B.set_content(render_html_readout(href_list["block"], href_list["parry"]))
+ B.open()
+
/**
* Generates a HTML render of this datum for self-documentation
* Maybe make this tgui-next someday haha god this is ugly as sin.
@@ -256,10 +265,6 @@ GLOBAL_LIST_EMPTY(block_parry_data)
if(combat_flags & COMBAT_FLAG_ACTIVE_BLOCKING)
var/datum/block_parry_data/data = return_block_parry_datum(active_block_item.block_parry_data)
adjustStaminaLossBuffered(data.block_stamina_cost_per_second * seconds)
- if(parrying)
- if(!CHECK_MOBILITY(src, MOBILITY_USE))
- to_chat(src, "Your parry is interrupted!")
- end_parry_sequence()
/mob/living/on_item_dropped(obj/item/I)
if(I == active_block_item)