fixes
This commit is contained in:
@@ -14,9 +14,9 @@
|
||||
#define NO_UNIFORM_REQUIRED (1<<11) //Can be worn on certain slots (currently belt and id) that would otherwise require an uniform.
|
||||
#define NO_ATTACK_CHAIN_SOFT_STAMCRIT (1<<12) //Entirely blocks melee_attack_chain() if user is soft stamcritted. Uses getStaminaLoss() to check at this point in time. THIS DOES NOT BLOCK RANGED AFTERATTACK()S, ONLY MELEE RANGE AFTERATTACK()S.
|
||||
/// This item can be used to parry. Only a basic check used to determine if we should proceed with parry chain at all.
|
||||
#define ITEM_CAN_PARRY (1<<0)
|
||||
#define ITEM_CAN_PARRY (1<<13)
|
||||
/// This item can be used in the directional blocking system. Only a basic check used to determine if we should proceed with directional block handling at all.
|
||||
#define ITEM_CAN_BLOCK (1<<1)
|
||||
#define ITEM_CAN_BLOCK (1<<14)
|
||||
|
||||
|
||||
// Flags for the clothing_flags var on /obj/item/clothing
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
#define DO_AFTER_ALLOW_NONSPACEDRIFT_RELATIVITY (1<<8)
|
||||
|
||||
/// Ignores checks.
|
||||
#define DO_AFTER_PROCEED 2
|
||||
#define DO_AFTER_PROCEED "PROCEED"
|
||||
/// Uses all other checks
|
||||
#define DO_AFTER_CONTINUE NONE
|
||||
#define DO_AFTER_CONTINUE "CONTINUE"
|
||||
/// Breaks
|
||||
#define DO_AFTER_STOP 1
|
||||
#define DO_AFTER_STOP "STOP"
|
||||
|
||||
/// Stage - initiating a do_after
|
||||
#define DO_AFTER_STARTING 1
|
||||
|
||||
@@ -18,18 +18,14 @@
|
||||
#define INVOKE_CALLBACK cb_return = extra_checks?.Invoke(user, delay, target, world.time - starttime, do_after_flags, required_mobility_flags, required_combat_flags, mob_redirect, stage, initially_held_item, tool)
|
||||
#define CHECK_FLAG_FAILURE ((required_mobility_flags || required_combat_flags) && (!living_user || !CHECK_ALL_MOBILITY(living_user, required_mobility_flags) || !CHECK_MULTIPLE_BITFIELDS(living_user.combat_flags, required_combat_flags)))
|
||||
#define TIMELEFT (world.time - starttime)
|
||||
#define DEBUG to_chat(world, "DEBUG: [__LINE__] executing")
|
||||
/proc/do_after_advanced(atom/user, delay, atom/target, do_after_flags, datum/callback/extra_checks, required_mobility_flags, required_combat_flags, mob/living/mob_redirect, obj/item/tool)
|
||||
DEBUG
|
||||
// CHECK AND SET VARIABLES
|
||||
if(!user)
|
||||
return FALSE
|
||||
DEBUG
|
||||
if(!target)
|
||||
target = user
|
||||
if((user.loc == null) || (target.loc == null))
|
||||
return FALSE
|
||||
DEBUG
|
||||
var/mob/living/living_user = mob_redirect
|
||||
if(!living_user && isliving(user))
|
||||
living_user = user
|
||||
@@ -38,16 +34,13 @@
|
||||
var/startloctarget = target.loc
|
||||
var/turf/userturf = get_turf(user)
|
||||
var/turf/targetturf = get_turf(target)
|
||||
DEBUG
|
||||
if(!userturf || !targetturf)
|
||||
return FALSE
|
||||
DEBUG
|
||||
if((do_after_flags & DO_AFTER_REQUIRES_USER_ON_TURF) && !isturf(user.loc))
|
||||
return FALSE
|
||||
var/starttime = world.time
|
||||
var/endtime = world.time + delay
|
||||
var/obj/item/initially_held_item = mob_redirect?.get_active_held_item()
|
||||
DEBUG
|
||||
if(!(do_after_flags & DO_AFTER_NO_COEFFICIENT) && living_user)
|
||||
delay *= living_user.do_after_coefficent()
|
||||
var/atom/movable/AM_user = ismovable(user) && user
|
||||
@@ -59,13 +52,11 @@
|
||||
// DO OUR STARTING CHECKS
|
||||
var/cb_return
|
||||
INVOKE_CALLBACK
|
||||
DEBUG
|
||||
if(cb_return == DO_AFTER_STOP)
|
||||
return FALSE
|
||||
else if(cb_return != DO_AFTER_PROCEED)
|
||||
if(CHECK_FLAG_FAILURE)
|
||||
return FALSE
|
||||
DEBUG
|
||||
// SETUP LOOP
|
||||
var/datum/progressbar/progbar
|
||||
if(living_user)
|
||||
@@ -86,13 +77,11 @@
|
||||
. = FALSE
|
||||
break
|
||||
INVOKE_CALLBACK
|
||||
DEBUG
|
||||
if(cb_return == DO_AFTER_STOP)
|
||||
. = FALSE
|
||||
break
|
||||
else if(cb_return == DO_AFTER_PROCEED)
|
||||
continue
|
||||
DEBUG
|
||||
// otherwise, go through our normal checks.
|
||||
if(((do_after_flags & DO_AFTER_DISALLOW_MOVING_ABSOLUTE_USER) && (user.loc != startlocuser)) || ((do_after_flags & DO_AFTER_DISALLOW_MOVING_ABSOLUTE_TARGET) && (target.loc != startloctarget)))
|
||||
. = FALSE
|
||||
@@ -111,24 +100,20 @@
|
||||
if(locchanged && !drifting && !(do_after_flags & DO_AFTER_ALLOW_NONSPACEDRIFT_RELATIVITY))
|
||||
. = FALSE
|
||||
break
|
||||
DEBUG
|
||||
if(!AM_user.inertia_dir)
|
||||
drifting = FALSE
|
||||
if((do_after_flags & DO_AFTER_REQUIRES_USER_ON_TURF) && !isturf(user.loc))
|
||||
return FALSE
|
||||
DEBUG
|
||||
if(CHECK_FLAG_FAILURE)
|
||||
. = FALSE
|
||||
break
|
||||
held = living_user?.get_active_held_item()
|
||||
DEBUG
|
||||
if((do_after_flags & DO_AFTER_DISALLOW_ACTIVE_ITEM_CHANGE) && (held != (tool || initially_held_item)))
|
||||
. = FALSE
|
||||
break
|
||||
if((do_after_flags & DO_AFTER_REQUIRE_FREE_HAND_OR_TOOL) && (!living_user?.is_holding(tool) && !length(living_user?.get_empty_held_indexes())))
|
||||
. = FALSE
|
||||
break
|
||||
DEBUG
|
||||
|
||||
// CLEANUP
|
||||
qdel(progbar)
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
if(!active_blocking)
|
||||
return FALSE
|
||||
var/obj/item/I = active_block_item
|
||||
active_block_effect_end()
|
||||
active_blocking = FALSE
|
||||
active_block_item = null
|
||||
REMOVE_TRAIT(src, TRAIT_MOBILITY_NOUSE, ACTIVE_BLOCK_TRAIT)
|
||||
remove_movespeed_modifier(MOVESPEED_ID_ACTIVE_BLOCK)
|
||||
remove_movespeed_modifier(/datum/movespeed_modifier/active_block)
|
||||
active_block_effect_end()
|
||||
var/datum/block_parry_data/data = I.get_block_parry_data()
|
||||
if(timeToNextMove() < data.block_end_click_cd_add)
|
||||
changeNext_move(data.block_end_click_cd_add)
|
||||
@@ -40,7 +40,7 @@
|
||||
active_block_item = I
|
||||
if(data.block_lock_attacking)
|
||||
ADD_TRAIT(src, TRAIT_MOBILITY_NOUSE, ACTIVE_BLOCK_TRAIT) //probably should be something else at some point
|
||||
add_movespeed_modifier(MOVESPEED_ID_ACTIVE_BLOCK, TRUE, 100, override = TRUE, multiplicative_slowdown = data.block_slowdown, blacklisted_movetypes = FLOATING)
|
||||
add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/active_block, multiplicative_slowdown = data.block_slowdown)
|
||||
active_block_effect_start()
|
||||
return TRUE
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
animate(src, pixel_x = get_standard_pixel_x_offset(), pixel_y = get_standard_pixel_y_offset(), time = 2.5, FALSE, SINE_EASING | EASE_IN)
|
||||
|
||||
/mob/living/proc/continue_starting_active_block()
|
||||
return active_block_starting != ACTIVE_BLOCK_STARTING_INTERRUPT
|
||||
return (active_block_starting != ACTIVE_BLOCK_STARTING_INTERRUPT)? DO_AFTER_CONTINUE : DO_AFTER_STOP
|
||||
|
||||
/mob/living/get_standard_pixel_x_offset()
|
||||
. = ..()
|
||||
|
||||
@@ -60,7 +60,8 @@
|
||||
/mob/living/proc/get_blocking_items()
|
||||
. = list()
|
||||
if(active_block_item)
|
||||
.[active_block_item] = active_block_item.block_parry_data.block_active_priority
|
||||
var/datum/block_parry_data/data = active_block_item.get_block_parry_data()
|
||||
.[active_block_item] = data.block_active_priority
|
||||
SEND_SIGNAL(src, COMSIG_LIVING_GET_BLOCKING_ITEMS, .)
|
||||
for(var/obj/item/I in held_items)
|
||||
// this is a bad check but i am not removing it until a better catchall is made
|
||||
|
||||
@@ -118,3 +118,7 @@
|
||||
/datum/movespeed_modifier/liver_cirrhosis
|
||||
blacklisted_movetypes = FLOATING
|
||||
variable = TRUE
|
||||
|
||||
/datum/movespeed_modifier/active_block
|
||||
variable = TRUE
|
||||
flags = IGNORE_NOSLOW
|
||||
|
||||
Reference in New Issue
Block a user