refactor
This commit is contained in:
@@ -162,7 +162,6 @@
|
||||
righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi'
|
||||
force = 15
|
||||
throwforce = 25
|
||||
block_chance = 50
|
||||
armour_penetration = 200 //Apparently this gives it the ability to pierce block
|
||||
flags_1 = CONDUCT_1
|
||||
obj_flags = UNIQUE_RENAME
|
||||
|
||||
@@ -312,7 +312,7 @@
|
||||
block_damage_absorption = 5
|
||||
block_damage_multiplier = 0.3
|
||||
block_start_delay = 0 // instantaneous block
|
||||
block_stamina_cost_per_second = 6
|
||||
block_stamina_cost_per_second = 3
|
||||
block_stamina_efficiency = 2
|
||||
// slowdown
|
||||
block_slowdown = 1
|
||||
@@ -335,7 +335,6 @@
|
||||
parry_efficiency_perfect = 90
|
||||
parry_failed_stagger_duration = 3 SECONDS
|
||||
parry_failed_clickcd_duration = CLICK_CD_MELEE
|
||||
parry_cooldown = 2 SECONDS
|
||||
|
||||
// more efficient vs projectiles
|
||||
block_stamina_efficiency_override = list(
|
||||
@@ -1079,7 +1078,6 @@
|
||||
total_mass = 5 //yeah this is a heavy thing, beating people with it while it's off is not going to do you any favors. (to curb stun-kill rampaging without it being on)
|
||||
var/obj/item/stock_parts/cell/cell = /obj/item/stock_parts/cell/high
|
||||
var/on = FALSE
|
||||
var/can_block_projectiles = FALSE //can't block guns
|
||||
var/lethal_cost = 400 //10000/400*20 = 500. decent enough?
|
||||
var/lethal_damage = 20
|
||||
var/lethal_stam_cost = 4
|
||||
@@ -1099,24 +1097,24 @@
|
||||
TEXT_ATTACK_TYPE_UNARMED = 0.3
|
||||
)
|
||||
block_start_delay = 0.5 // near instantaneous block
|
||||
block_stamina_cost_per_second = 6
|
||||
block_stamina_cost_per_second = 3
|
||||
block_stamina_efficiency = 2 // haha this is a horrible idea
|
||||
// more slowdown that deswords because security
|
||||
block_slowdown = 2
|
||||
// no attacking while blocking
|
||||
block_lock_attacking = TRUE
|
||||
|
||||
parry_time_windup = 1.5
|
||||
parry_time_windup = 1
|
||||
parry_time_active = 5
|
||||
parry_time_spindown = 0
|
||||
parry_time_spindown_visual_override = 1
|
||||
parry_flags = PARRY_DEFAULT_HANDLE_FEEDBACK | PARRY_LOCK_ATTACKING // no attacking while parrying
|
||||
parry_time_perfect = 0
|
||||
parry_time_perfect_leeway = 1.5
|
||||
parry_time_perfect_leeway = 0.5
|
||||
parry_efficiency_perfect = 100
|
||||
parry_imperfect_falloff_percent = 15
|
||||
parry_imperfect_falloff_percent = 1
|
||||
parry_imperfect_falloff_percent_override = list(
|
||||
TEXT_ATTACK_TYPE_PROJECTILE = 35 // really crappy vs projectiles
|
||||
TEXT_ATTACK_TYPE_PROJECTILE = 45 // really crappy vs projectiles
|
||||
)
|
||||
parry_time_perfect_leeway_override = list(
|
||||
TEXT_ATTACK_TYPE_PROJECTILE = 1 // extremely harsh window for projectiles
|
||||
|
||||
@@ -173,28 +173,6 @@
|
||||
else
|
||||
return NOT_PARRYING
|
||||
|
||||
/**
|
||||
* Gets the percentage efficiency of our parry.
|
||||
*
|
||||
* Returns a percentage in normal 0 to 100 scale, but not clamped to just 0 to 100.
|
||||
*/
|
||||
/mob/living/proc/get_parry_efficiency(attack_type)
|
||||
var/datum/block_parry_data/data = get_parry_data()
|
||||
if(get_parry_stage() != PARRY_ACTIVE)
|
||||
return 0
|
||||
var/difference = abs(get_parry_time() - (data.parry_time_perfect + data.parry_time_windup))
|
||||
var/leeway = data.attack_type_list_scan(data.parry_time_perfect_leeway_override, attack_type)
|
||||
if(isnull(leeway))
|
||||
leeway = data.parry_time_perfect_leeway
|
||||
difference -= leeway
|
||||
. = data.parry_efficiency_perfect
|
||||
if(difference <= 0)
|
||||
return
|
||||
var/falloff = data.attack_type_list_scan(data.parry_imperfect_falloff_percent_override, attack_type)
|
||||
if(isnull(falloff))
|
||||
falloff = data.parry_imperfect_falloff_percent
|
||||
. -= falloff * difference
|
||||
|
||||
/**
|
||||
* Gets the current decisecond "frame" of an active parry.
|
||||
*/
|
||||
|
||||
@@ -123,7 +123,7 @@ GLOBAL_LIST_EMPTY(block_parry_data)
|
||||
var/parry_efficiency_perfect = 120
|
||||
/// Parry effect data.
|
||||
var/list/parry_data = list(
|
||||
PARRY_REFLEX_COUNTERATTACK = PARRY_COUNTERATTACK_MELEE_ATTACK_CHAIN
|
||||
PARRY_COUNTERATTACK_MELEE_ATTACK_CHAIN = 1
|
||||
)
|
||||
/// Efficiency must be at least this to be considered successful
|
||||
var/parry_efficiency_considered_successful = 0.1
|
||||
@@ -159,31 +159,48 @@ GLOBAL_LIST_EMPTY(block_parry_data)
|
||||
return
|
||||
return total/div //groan
|
||||
|
||||
/**
|
||||
* Gets the percentage efficiency of our parry.
|
||||
*
|
||||
* Returns a percentage in normal 0 to 100 scale, but not clamped to just 0 to 100.
|
||||
* This is a proc to allow for overriding.
|
||||
* @params
|
||||
* * attack_type - int, bitfield of the attack type(s)
|
||||
* * parry_time - deciseconds since start of the parry.
|
||||
*/
|
||||
/datum/block_parry_data/proc/get_parry_efficiency(attack_type, parry_time)
|
||||
var/difference = abs(parry_time - (parry_time_perfect + parry_time_windup))
|
||||
var/leeway = attack_type_list_scan(parry_time_perfect_leeway_override, attack_type)
|
||||
if(isnull(leeway))
|
||||
leeway = parry_time_perfect_leeway
|
||||
difference -= leeway
|
||||
. = parry_efficiency_perfect
|
||||
if(difference <= 0)
|
||||
return
|
||||
var/falloff = attack_type_list_scan(parry_imperfect_falloff_percent_override, attack_type)
|
||||
if(isnull(falloff))
|
||||
falloff = parry_imperfect_falloff_percent
|
||||
. -= falloff * difference
|
||||
|
||||
#define RENDER_VARIABLE_SIMPLE(varname, desc) dat += "<tr><th>[#varname]<br><i>[desc]</i></th><th>[varname]</th></tr>"
|
||||
#define RENDER_OVERRIDE_LIST(varname, desc) \
|
||||
dat += "<tr><th>[#varname]<br><i>[desc]</i></th><th>"; \
|
||||
var/list/assembled__##varname = list(); \
|
||||
for(var/textbit in GLOB.attack_type_names){ \
|
||||
if(textbit in varname){ \
|
||||
assembled__##varname += "[GLOB.attack_type_names[textbit]] = [varname[textbit]]"; \
|
||||
} \
|
||||
for(var/textbit in varname){ \
|
||||
assembled__##varname += "[GLOB.attack_type_names[textbit]] = [varname[textbit]]"; \
|
||||
} \
|
||||
dat += "[english_list(assembled__##varname)]</th>";
|
||||
#define RENDER_ATTACK_TYPES(varname, desc) dat += "<tr><th>[#varname]<br><i>[desc]</i></th><th>"; \
|
||||
var/list/assembled__##varname = list(); \
|
||||
for(var/textbit in bitfield2list(varname)){ \
|
||||
if(textbit in varname){ \
|
||||
assembled__##varname += "[GLOB.attack_type_names[textbit]]"; \
|
||||
} \
|
||||
for(var/bit in bitfield2list(varname)){ \
|
||||
assembled__##varname += "[GLOB.attack_type_names[num2text(bit)]]"; \
|
||||
} \
|
||||
dat += "[english_list(assembled__##varname)]</th>";
|
||||
#define RENDER_BLOCK_DIRECTIONS(varname, desc) \
|
||||
dat += "<tr><th>[#varname]<br><i>[desc]</i></th><th>"; \
|
||||
var/list/assembled__##varname = list(); \
|
||||
for(var/textbit in GLOB.block_direction_names){ \
|
||||
if(textbit in varname){ \
|
||||
assembled__##varname += "[GLOB.block_direction_names[textbit]] = [varname[textbit]]"; \
|
||||
} \
|
||||
for(var/bit in bitfield2list(varname)){ \
|
||||
assembled__##varname += "[GLOB.block_direction_names[num2text(bit)]]"; \
|
||||
} \
|
||||
dat += "[english_list(assembled__##varname)]</th>";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user