block args
This commit is contained in:
@@ -217,17 +217,26 @@ GLOBAL_LIST_INIT(shove_disarming_types, typecacheof(list(
|
||||
|
||||
/// The below are for "metadata" on "how" the attack was blocked.
|
||||
|
||||
/// Attack was and should be reflected (NOTE: the SHOULD here is important, as it says "the thing blocking isn't handling the reflecting for you so do it yourself"!)
|
||||
#define BLOCK_SHOULD_REFLECT (1<<2)
|
||||
/// Attack was and should be redirected according to list argument REDIRECT_METHOD (NOTE: the SHOULD here is important, as it says "the thing blocking isn't handling the reflecting for you so do it yourself"!)
|
||||
#define BLOCK_SHOULD_REDIRECT (1<<2)
|
||||
/// Attack was manually redirected (including reflected) by any means by the defender. For when YOU are handling the reflection, rather than the thing hitting you. (see sleeping carp)
|
||||
#define BLOCK_REDIRECTED (1<<3)
|
||||
/// Attack was blocked by something like a shield.
|
||||
#define BLOCK_PHYSICAL_EXTERNAL (1<<4)
|
||||
/// Attack was blocked by something worn on you.
|
||||
#define BLOCK_PHYSICAL_INTERNAL (1<<5)
|
||||
/// Attack should pass through. Like SHOULD_REFLECT but for.. well, passing through harmlessly.
|
||||
#define BLOCK_SHOULD_PASSTHROUGH (1<<6)
|
||||
/// Attack outright missed because the target dodged. Should usually be combined with SHOULD_PASSTHROUGH or something (see martial arts)
|
||||
#define BLOCK_TARGET_DODGED (1<<7)
|
||||
/// Meta-flag for run_block/do_run_block : Whatever triggered this has completely blocked the attack (or failed so miserably hard it wants us to stop for when that's implemented), do not keep checking. Most methods of block should probably use this.
|
||||
#define BLOCK_INTERRUPT_CHAIN (1<<8)
|
||||
#define BLOCK_INTERRUPT_CHAIN (1<<8)
|
||||
|
||||
/// For keys in associative list/block_return as we don't want to saturate our (somewhat) limited flags.
|
||||
#define BLOCK_RETURN_REDIRECT_METOHD "REDIRECT_METHOD"
|
||||
/// Pass through victim
|
||||
#define REDIRECT_MODE_PASSTHROUGH "passthrough"
|
||||
/// Reflect using normal angular/mirrorlike reflection
|
||||
#define REDIRECT_MODE_REFLECT "reflect"
|
||||
/// Deflect at randomish angle
|
||||
#define REDIRECT_MODE_DEFLECT "deflect"
|
||||
/// do not taser the bad man with the desword
|
||||
#define REDIRECT_MODE_RETURN_TO_SENDER "no_you"
|
||||
|
||||
@@ -117,11 +117,11 @@
|
||||
|
||||
/obj/item/grenade/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance)
|
||||
if(real_attack && (attack_type == ATTACK_TYPE_PROJECTILE))
|
||||
var/obj/item/projectile/P = hitby
|
||||
var/obj/item/projectile/P = object
|
||||
if(damage && !P.nodamage && (P.damage_type != STAMINA) && prob(15))
|
||||
owner.visible_message("<span class='danger'>[attack_text] hits [owner]'s [src], setting it off! What a shot!</span>")
|
||||
prime()
|
||||
return BLOCK_SUCESS | BLOCK_PHYSICAL_EXTERNAL | BLOCK_INTERRUPT_CHAIN
|
||||
return BLOCK_SUCCESS | BLOCK_PHYSICAL_EXTERNAL | BLOCK_INTERRUPT_CHAIN
|
||||
return ..()
|
||||
|
||||
/obj/item/proc/grenade_prime_react(obj/item/grenade/nade)
|
||||
|
||||
@@ -897,19 +897,19 @@
|
||||
AddComponent(/datum/component/butchering, 20, 105)
|
||||
AddElement(/datum/element/sword_point)
|
||||
|
||||
/obj/item/twohanded/vibro_weapon/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
|
||||
/obj/item/twohanded/vibro_weapon/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance)
|
||||
if(wielded)
|
||||
final_block_chance *= 2
|
||||
if(wielded || attack_type != PROJECTILE_ATTACK)
|
||||
if(wielded || attack_type != ATTACK_TYPE_PROJECTILE)
|
||||
if(prob(final_block_chance))
|
||||
if(attack_type == PROJECTILE_ATTACK)
|
||||
if(attack_type == ATTACK_TYPE_PROJECTILE)
|
||||
owner.visible_message("<span class='danger'>[owner] deflects [attack_text] with [src]!</span>")
|
||||
playsound(src, pick('sound/weapons/bulletflyby.ogg', 'sound/weapons/bulletflyby2.ogg', 'sound/weapons/bulletflyby3.ogg'), 75, 1)
|
||||
return 1
|
||||
return BLOCK_SUCCESS | BLOCK_SHOULD_DEFLECT | BLOCK_PHYSICAL_EXTERNAL
|
||||
else
|
||||
owner.visible_message("<span class='danger'>[owner] parries [attack_text] with [src]!</span>")
|
||||
return 1
|
||||
return 0
|
||||
return BLOCK_SUCCESS | BLOCK_PARRY
|
||||
return NONE
|
||||
|
||||
/obj/item/twohanded/vibro_weapon/update_icon_state()
|
||||
icon_state = "hfrequency[wielded]"
|
||||
|
||||
Reference in New Issue
Block a user