fixes and render

This commit is contained in:
kevinz000
2020-05-30 22:29:41 -07:00
parent 1fef5825a9
commit 2232271ea5
5 changed files with 17 additions and 16 deletions
+1
View File
@@ -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)
+4 -3
View File
@@ -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. <a href='?src=[REF(data)];name=[name];block=[item_flags & ITEM_CAN_BLOCK];parry=[item_flags & ITEM_CAN_PARRY];render=1'>\[Show Stats\]</a>"
if(!user.research_scanner)
return
+2 -2
View File
@@ -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
@@ -20,9 +20,6 @@
if(!(combat_flags & COMBAT_FLAG_PARRY_CAPABLE))
to_chat(src, "<span class='warning'>You are not something that can parry attacks.</span>")
return
if(!CHECK_MOBILITY(src, MOBILITY_USE))
to_chat(src, "<span class='warning'>You are incapacitated, or otherwise unable to swing a weapon to parry with!</span>")
return FALSE
if(!SEND_SIGNAL(src, COMSIG_COMBAT_MODE_CHECK, COMBAT_MODE_ACTIVE))
to_chat(src, "<span class='warning'>You must be in combat mode to parry!</span>")
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, "<span class='warning'>Your parry is interrupted!</span>")
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
@@ -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)]</th>";
/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, "<span class='warning'>Your parry is interrupted!</span>")
end_parry_sequence()
/mob/living/on_item_dropped(obj/item/I)
if(I == active_block_item)