From 763c835a5338e659675ee3e8dd0d99b8fa8537ad Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Mon, 16 Mar 2020 04:26:19 -0700 Subject: [PATCH] bitflags not equals --- code/game/objects/items/flamethrower.dm | 2 +- code/game/objects/items/grenades/grenade.dm | 2 +- code/game/objects/items/holy_weapons.dm | 2 +- code/game/objects/items/shields.dm | 8 ++++---- code/game/objects/items/twohanded.dm | 8 ++++---- code/game/objects/items/weaponry.dm | 2 +- code/game/objects/structures/beds_chairs/chair.dm | 2 +- code/modules/antagonists/cult/cult_items.dm | 4 ++-- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/code/game/objects/items/flamethrower.dm b/code/game/objects/items/flamethrower.dm index b74acb5677..753c273082 100644 --- a/code/game/objects/items/flamethrower.dm +++ b/code/game/objects/items/flamethrower.dm @@ -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("\The [attack_text] hits the fueltank on [owner]'s [name], rupturing it! What a shot!") diff --git a/code/game/objects/items/grenades/grenade.dm b/code/game/objects/items/grenades/grenade.dm index 3b64496139..85ec9ad634 100644 --- a/code/game/objects/items/grenades/grenade.dm +++ b/code/game/objects/items/grenades/grenade.dm @@ -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("[attack_text] hits [owner]'s [src], setting it off! What a shot!") diff --git a/code/game/objects/items/holy_weapons.dm b/code/game/objects/items/holy_weapons.dm index 8d5fd292dd..20d504a634 100644 --- a/code/game/objects/items/holy_weapons.dm +++ b/code/game/objects/items/holy_weapons.dm @@ -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 ..() diff --git a/code/game/objects/items/shields.dm b/code/game/objects/items/shields.dm index af0147e421..904904f7dc 100644 --- a/code/game/objects/items/shields.dm +++ b/code/game/objects/items/shields.dm @@ -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 ..() diff --git a/code/game/objects/items/twohanded.dm b/code/game/objects/items/twohanded.dm index 3d8accd02a..dafb7430ae 100644 --- a/code/game/objects/items/twohanded.dm +++ b/code/game/objects/items/twohanded.dm @@ -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("Ranged attacks just make [owner] angrier!") 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("[owner] deflects [attack_text] with [src]!") 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 diff --git a/code/game/objects/items/weaponry.dm b/code/game/objects/items/weaponry.dm index 7a95f0daff..8746ac49a5 100644 --- a/code/game/objects/items/weaponry.dm +++ b/code/game/objects/items/weaponry.dm @@ -156,7 +156,7 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301 to_chat(user, "[src] thrums and points to the [dir2text(get_dir(user, closest_victim))].") /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 ..() diff --git a/code/game/objects/structures/beds_chairs/chair.dm b/code/game/objects/structures/beds_chairs/chair.dm index ee07fc4363..691b6cff90 100644 --- a/code/game/objects/structures/beds_chairs/chair.dm +++ b/code/game/objects/structures/beds_chairs/chair.dm @@ -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 ..() diff --git a/code/modules/antagonists/cult/cult_items.dm b/code/modules/antagonists/cult/cult_items.dm index 5bb5837521..7d1bbeeddc 100644 --- a/code/modules/antagonists/cult/cult_items.dm +++ b/code/modules/antagonists/cult/cult_items.dm @@ -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("[owner] deflects [attack_text] with [src]!") 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("[owner] deflects [attack_text] with [src]!") 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