progress
This commit is contained in:
@@ -50,5 +50,5 @@ GLOBAL_LIST_INIT(dir2blockdir, list(
|
||||
#define PARRY_KNOCKDOWN_ATTACKER "knockdown_attacker"
|
||||
/// List association should be duration.
|
||||
#define PARRY_STAGGER_ATTACKER "stagger_attacker"
|
||||
/// List association should be amount to increase clickcd of attacker to.
|
||||
#define PARRY_CLICKCD_ATTACKER "clickcd_attacker"
|
||||
/// List association should be amount of time to daze attacker.
|
||||
#define PARRY_DAZE_ATTACKER "daze_attacker"
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
name = "shield"
|
||||
icon = 'icons/obj/items_and_weapons.dmi'
|
||||
block_chance = 50
|
||||
item_flags = ITEM_CAN_BLOCK
|
||||
armor = list("melee" = 50, "bullet" = 50, "laser" = 50, "energy" = 0, "bomb" = 30, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 70)
|
||||
var/transparent = FALSE // makes beam projectiles pass through the shield
|
||||
|
||||
@@ -182,13 +183,16 @@
|
||||
throw_speed = 3
|
||||
throw_range = 4
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
var/active = 0
|
||||
var/active = FALSE
|
||||
|
||||
/obj/item/shield/riot/tele/run_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return)
|
||||
if(!active)
|
||||
return BLOCK_NONE
|
||||
return ..()
|
||||
|
||||
/obj/item/shield/riot/tele/can_active_block()
|
||||
return ..() && active
|
||||
|
||||
/obj/item/shield/riot/tele/attack_self(mob/living/user)
|
||||
active = !active
|
||||
icon_state = "teleriot[active]"
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
if(!I)
|
||||
to_chat(src, "<span class='warning'>You can't block with your bare hands!</span>")
|
||||
return
|
||||
if(!(I.can_active_block())
|
||||
if(!I.can_active_block())
|
||||
to_chat(src, "<span class='warning'>[I] is not capable of actively being used to block!</span>")
|
||||
return
|
||||
var/datum/block_parry_data/data = I.get_block_parry_data()
|
||||
@@ -123,7 +123,7 @@
|
||||
* Gets our datum/block_parry_data
|
||||
*/
|
||||
/obj/item/proc/get_block_parry_data()
|
||||
return get_block_parray_data(block_parry_data)
|
||||
return get_block_parry_data(block_parry_data)
|
||||
|
||||
/**
|
||||
* Returns if we can actively block.
|
||||
|
||||
@@ -133,13 +133,19 @@ GLOBAL_LIST_EMPTY(block_parry_data)
|
||||
return
|
||||
/// Yadda yadda WIP access block/parry data...
|
||||
|
||||
/obj/item/proc/active_parry_reflex_counter(atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, list/return_list)
|
||||
|
||||
/mob/living/proc/active_parry_reflex_counter(atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, list/return_list)
|
||||
|
||||
/datum/martial_art/proc/active_parry_reflex_counter(atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, list/return_list)
|
||||
|
||||
/mob/living/proc/get_parry_stage()
|
||||
if(!parrying)
|
||||
return NOT_PARRYING
|
||||
var/datum/block_parry_data/data = get_parry_data()
|
||||
var/windup_end = data.parry_time_windup
|
||||
var/active_end = windup + data.parry_time_active
|
||||
var/spindown_end = active + data.parry_time_spindown
|
||||
var/active_end = windup_end + data.parry_time_active
|
||||
var/spindown_end = active_end + data.parry_time_spindown
|
||||
switch(get_parry_time())
|
||||
if(0 to windup_end)
|
||||
return PARRY_WINDUP
|
||||
@@ -174,26 +180,41 @@ GLOBAL_LIST_EMPTY(block_parry_data)
|
||||
|
||||
/// Run counterattack if any
|
||||
/mob/living/proc/run_parry_countereffects(atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, list/return_list = list())
|
||||
if(!isliving(attacker))
|
||||
return
|
||||
var/mob/living/L = attacker
|
||||
var/datum/block_parry_data/data = get_parry_data()
|
||||
var/list/effect_text = list()
|
||||
if(data.parry_data[PARRY_REFLEX_COUNTERATTACK])
|
||||
switch(data.parry_data[PARRY_REFLEX_COUNTERATTACK])
|
||||
if(PARRY_COUNTERATTACK_PROC)
|
||||
|
||||
switch(parrying)
|
||||
if(ITEM_PARRY)
|
||||
active_parry_item.active_parry_reflex_counter(object, damage, attack_text, attack_type, armour_penetration, attacker, def_zone, return_list)
|
||||
if(UNARMED_PARRY)
|
||||
active_parry_reflex_counter(object, damage, attack_text, attack_type, armour_penetration, attacker, def_zone, return_list)
|
||||
if(MARTIAL_PARRY)
|
||||
mind.martial_art.active_parry_reflex_counter(object, damage, attack_text, attack_type, armour_penetration, attacker, def_zone, return_list)
|
||||
if(PARRY_COUNTERATTACK_MELEE_ATTACK_CHAIN)
|
||||
switch(parrying)
|
||||
if(ITEM_PARRY)
|
||||
|
||||
active_parry_item.melee_attack_chain(src, attacker, null)
|
||||
if(UNARMED_PARRY)
|
||||
|
||||
UnarmedAttack(attacker)
|
||||
if(MARTIAL_PARRY)
|
||||
|
||||
UnarmedAttack(attacker)
|
||||
if(data.parry_data[PARRY_DISARM_ATTACKER])
|
||||
|
||||
L.drop_all_held_items()
|
||||
effect_text += "disarming"
|
||||
if(data.parry_data[PARRY_KNOCKDOWN_ATTACKER])
|
||||
|
||||
L.DefaultCombatKnockdown(data[parry_data[PARRY_KNOCKDOWN_ATTACKER])
|
||||
effect_text += "knocking them to the ground"
|
||||
if(data.parry_data[PARRY_STAGGER_ATTACKER])
|
||||
|
||||
if(data.parry_data[PARRY_CLICKCD_ATTACKER])
|
||||
L.Stagger(data.parry_data[PARRY_STAGGER_ATTACKER])
|
||||
effect_text += "staggering"
|
||||
if(data.parry_data[PARRY_DAZE_ATTACKER])
|
||||
L.Daze(data.parry_data[PARRY_DAZE_ATTACKER])
|
||||
effect_text += "dazing"
|
||||
|
||||
/// Gets the datum/block_parry_data we're going to use to parry.
|
||||
/mob/living/proc/get_parry_data()
|
||||
|
||||
Reference in New Issue
Block a user