bitflags not equals
This commit is contained in:
@@ -235,7 +235,7 @@
|
||||
create_with_tank = TRUE
|
||||
|
||||
/obj/item/flamethrower/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return)
|
||||
if(real_attack && (attack_type == ATTACK_TYPE_PROJECTILE))
|
||||
if(real_attack && (attack_type & ATTACK_TYPE_PROJECTILE))
|
||||
var/obj/item/projectile/P = hitby
|
||||
if(istype(P) && (P.damage_type != STAMINA) && damage && !P.nodamage && prob(15))
|
||||
owner.visible_message("<span class='danger'>\The [attack_text] hits the fueltank on [owner]'s [name], rupturing it! What a shot!</span>")
|
||||
|
||||
@@ -116,7 +116,7 @@
|
||||
return attack_hand(user)
|
||||
|
||||
/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, list/block_return)
|
||||
if(real_attack && (attack_type == ATTACK_TYPE_PROJECTILE))
|
||||
if(real_attack && (attack_type & ATTACK_TYPE_PROJECTILE))
|
||||
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>")
|
||||
|
||||
@@ -329,7 +329,7 @@
|
||||
attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
|
||||
|
||||
/obj/item/nullrod/claymore/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return)
|
||||
if(attack_type == ATTACK_TYPE_PROJECTILE) // Don't bring a sword to a gunfight
|
||||
if(attack_type & ATTACK_TYPE_PROJECTILE) // Don't bring a sword to a gunfight
|
||||
return NONE
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -29,9 +29,9 @@
|
||||
/obj/item/shield/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return)
|
||||
if(transparent && (object.pass_flags & PASSGLASS))
|
||||
return FALSE
|
||||
if(attack_type == ATTACK_TYPE_THROWN)
|
||||
if(attack_type & ATTACK_TYPE_THROWN)
|
||||
final_block_chance += 30
|
||||
if(attack_type == ATTACK_TYPE_TACKLE)
|
||||
if(attack_type & ATTACK_TYPE_TACKLE)
|
||||
final_block_chance = 100
|
||||
. = ..()
|
||||
if(. & BLOCK_SUCCESS)
|
||||
@@ -140,7 +140,7 @@
|
||||
icon_state = "[base_icon_state]0"
|
||||
|
||||
/obj/item/shield/energy/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return)
|
||||
if((attack_type == ATTACK_TYPE_PROJECTILE) && is_energy_reflectable_projectile(object))
|
||||
if((attack_type & ATTACK_TYPE_PROJECTILE) && is_energy_reflectable_projectile(object))
|
||||
block_return[BLOCK_RETURN_REDIRECT_METHOD] = REDIRECT_METHOD_REFLECT
|
||||
return BLOCK_SUCCESS | BLOCK_REDIRECTED | BLOCK_SHOULD_REDIRECT
|
||||
return ..()
|
||||
@@ -250,6 +250,6 @@
|
||||
item_flags = SLOWS_WHILE_IN_HAND
|
||||
|
||||
/obj/item/shield/riot/implant/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return)
|
||||
if(attack_type == ATTACK_TYPE_PROJECTILE)
|
||||
if(attack_type & ATTACK_TYPE_PROJECTILE)
|
||||
final_block_chance = 60 //Massive shield
|
||||
return ..()
|
||||
|
||||
@@ -378,7 +378,7 @@
|
||||
/obj/item/twohanded/dualsaber/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return)
|
||||
if(!wielded)
|
||||
return NONE
|
||||
if(can_reflect && is_energy_reflectable_projectile(object) && (attack_type == ATTACK_TYPE_PROJECTILE))
|
||||
if(can_reflect && is_energy_reflectable_projectile(object) && (attack_type & ATTACK_TYPE_PROJECTILE))
|
||||
block_return[BLOCK_RETURN_REDIRECT_METHOD] = REDIRECT_METHOD_RETURN_TO_SENDER //no you
|
||||
return BLOCK_SHOULD_REDIRECT | BLOCK_SUCCESS | BLOCK_REDIRECTED
|
||||
return ..()
|
||||
@@ -752,7 +752,7 @@
|
||||
force_on = 30
|
||||
|
||||
/obj/item/twohanded/required/chainsaw/doomslayer/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return)
|
||||
if(real_attack && (attack_type == ATTACK_TYPE_PROJECTILE))
|
||||
if(real_attack && (attack_type & ATTACK_TYPE_PROJECTILE))
|
||||
owner.visible_message("<span class='danger'>Ranged attacks just make [owner] angrier!</span>")
|
||||
playsound(src, pick('sound/weapons/bulletflyby.ogg', 'sound/weapons/bulletflyby2.ogg', 'sound/weapons/bulletflyby3.ogg'), 75, 1)
|
||||
return BLOCK_SUCCESS | BLOCK_INTERRUPT_CHAIN | BLOCK_PHYSICAL_EXTERNAL
|
||||
@@ -899,9 +899,9 @@
|
||||
/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, list/block_return)
|
||||
if(wielded)
|
||||
final_block_chance *= 2
|
||||
if(wielded || attack_type != ATTACK_TYPE_PROJECTILE)
|
||||
if(wielded || !(attack_type & ATTACK_TYPE_PROJECTILE))
|
||||
if(prob(final_block_chance))
|
||||
if(attack_type == ATTACK_TYPE_PROJECTILE)
|
||||
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)
|
||||
block_return[BLOCK_RETURN_REDIRECT_METHOD] = REDIRECT_METHOD_DEFLECT
|
||||
|
||||
@@ -156,7 +156,7 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301
|
||||
to_chat(user, "<span class='danger'>[src] thrums and points to the [dir2text(get_dir(user, closest_victim))].</span>")
|
||||
|
||||
/obj/item/claymore/highlander/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return)
|
||||
if((attack_type == ATTACK_TYPE_PROJECTILE) && is_energy_reflectable_projectile(object))
|
||||
if((attack_type & ATTACK_TYPE_PROJECTILE) && is_energy_reflectable_projectile(object))
|
||||
return BLOCK_SUCCESS | BLOCK_SHOULD_REDIRECT | BLOCK_PHYSICAL_EXTERNAL | BLOCK_REDIRECT
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -363,7 +363,7 @@
|
||||
qdel(src)
|
||||
|
||||
/obj/item/chair/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return)
|
||||
if(attack_type != ATTACK_TYPE_UNARMED)
|
||||
if(!(attack_type & ATTACK_TYPE_UNARMED))
|
||||
return NONE
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@
|
||||
|
||||
/obj/item/twohanded/required/cult_bastard/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return)
|
||||
if(prob(final_block_chance))
|
||||
if(attack_type == ATTACK_TYPE_PROJECTILE)
|
||||
if(attack_type & ATTACK_TYPE_PROJECTILE)
|
||||
owner.visible_message("<span class='danger'>[owner] deflects [attack_text] with [src]!</span>")
|
||||
playsound(src, pick('sound/weapons/effects/ric1.ogg', 'sound/weapons/effects/ric2.ogg', 'sound/weapons/effects/ric3.ogg', 'sound/weapons/effects/ric4.ogg', 'sound/weapons/effects/ric5.ogg'), 100, 1)
|
||||
return BLOCK_SUCCESS | BLOCK_PHYSICAL_EXTERNAL | BLOCK_REDIRECT | BLOCK_SHOULD_REDIRECT
|
||||
@@ -729,7 +729,7 @@
|
||||
if(wielded)
|
||||
final_block_chance *= 2
|
||||
if(prob(final_block_chance))
|
||||
if(attack_type == PROJECTILE_ATTACK)
|
||||
if(attack_type & PROJECTILE_ATTACK)
|
||||
owner.visible_message("<span class='danger'>[owner] deflects [attack_text] with [src]!</span>")
|
||||
playsound(src, pick('sound/weapons/effects/ric1.ogg', 'sound/weapons/effects/ric2.ogg', 'sound/weapons/effects/ric3.ogg', 'sound/weapons/effects/ric4.ogg', 'sound/weapons/effects/ric5.ogg'), 100, 1)
|
||||
return TRUE
|
||||
|
||||
Reference in New Issue
Block a user