First part of the largescale shield cleanup, including ensuring shields respect their various counters and strengths appropriately.

This commit is contained in:
necromanceranne
2021-03-25 09:07:52 +11:00
parent 5e6122e554
commit 79de55c58c
5 changed files with 108 additions and 37 deletions
+69 -22
View File
@@ -174,6 +174,10 @@
var/atom/movable/AM = object
if(CHECK_BITFIELD(shield_flags, SHIELD_TRANSPARENT) && (AM.pass_flags & PASSGLASS))
return BLOCK_NONE
if(CHECK_BITFIELD(shield_flags, SHIELD_NO_RANGED) && (attack_type & ATTACK_TYPE_PROJECTILE))
return BLOCK_NONE
if(CHECK_BITFIELD(shield_flags, SHIELD_NO_MELEE) && (attack_type & ATTACK_TYPE_MELEE))
return BLOCK_NONE
if(attack_type & ATTACK_TYPE_THROWN)
final_block_chance += 30
if(attack_type & ATTACK_TYPE_TACKLE)
@@ -238,30 +242,73 @@
new /obj/item/shard((get_turf(src)))
/obj/item/shield/riot/on_shield_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return)
var/final_damage = damage
if(attack_type & ATTACK_TYPE_MELEE)
var/obj/hittingthing = object
if(hittingthing.damtype == BURN)
if(CHECK_BITFIELD(shield_flags, SHIELD_ENERGY_WEAK))
final_damage *= 2
else if(CHECK_BITFIELD(shield_flags, SHIELD_ENERGY_STRONG))
final_damage *= 0.5
if(hittingthing.damtype == BRUTE)
if(CHECK_BITFIELD(shield_flags, SHIELD_KINETIC_WEAK))
final_damage *= 2
else if(CHECK_BITFIELD(shield_flags, SHIELD_KINETIC_STRONG))
final_damage *= 0.5
if(hittingthing.damtype == STAMINA || hittingthing.damtype == TOX || hittingthing.damtype == CLONE || hittingthing.damtype == BRAIN || hittingthing.damtype == OXY)
final_damage = 0
if(attack_type & ATTACK_TYPE_PROJECTILE)
var/obj/item/projectile/shootingthing = object
if(is_energy_reflectable_projectile(shootingthing))
if(CHECK_BITFIELD(shield_flags, SHIELD_ENERGY_WEAK))
final_damage *= 2
else if(CHECK_BITFIELD(shield_flags, SHIELD_ENERGY_STRONG))
final_damage *= 0.5
if(!is_energy_reflectable_projectile(object))
if(CHECK_BITFIELD(shield_flags, SHIELD_KINETIC_WEAK))
final_damage *= 2
else if(CHECK_BITFIELD(shield_flags, SHIELD_KINETIC_STRONG))
final_damage *= 0.5
if(shootingthing.damage_type == STAMINA)
if(CHECK_BITFIELD(shield_flags, SHIELD_DISABLER_DISRUPTED))
final_damage *= 3 //disablers melt these kinds of shields. Really meant more for holoshields.
else
final_damage = 0
if(shootingthing.damage_type == TOX || shootingthing.damage_type == CLONE || shootingthing.damage_type == BRAIN || shootingthing.damage_type == OXY)
final_damage = 0
if(can_shatter && (obj_integrity <= damage))
var/turf/T = get_turf(owner)
T.visible_message("<span class='warning'>[attack_text] destroys [src]!</span>")
shatter(owner)
qdel(src)
return FALSE
take_damage(damage)
take_damage(final_damage)
return ..()
/obj/item/shield/riot/laser_proof
name = "laser resistant shield"
desc = "A far more frail shield made of dark glass meant to block lasers but suffers from being being weak to ballistic projectiles."
/obj/item/shield/riot/energy_proof
name = "energy resistant shield"
desc = "An ablative shield designed to absorb and disperse energy attacks. This comes at significant cost to its ability to withstand ballistics and kinetics, breaking apart easily."
armor = list("melee" = 30, "bullet" = -10, "laser" = 80, "energy" = 80, "bomb" = -40, "bio" = 0, "rad" = 0, "fire" = 0, "acid" = 50)
icon_state = "riot_laser"
item_state = "riot_laser"
lefthand_file = 'icons/mob/inhands/equipment/shields_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/shields_righthand.dmi'
shield_flags = SHIELD_FLAGS_DEFAULT
shield_flags = SHIELD_FLAGS_DEFAULT | SHIELD_ENERGY_STRONG | SHIELD_KINETIC_WEAK
max_integrity = 300
/obj/item/shield/riot/bullet_proof
name = "bullet resistant shield"
desc = "A far more frail shield made of resistant plastics and kevlar meant to block ballistics."
/obj/item/shield/riot/kinetic_proof
name = "kinetic resistant shield"
desc = "A polymer and ceramic shield designed to absorb ballistic projectiles and kinetic force. It doesn't do very well into energy attacks, especially from weapons that inflict burns."
armor = list("melee" = 30, "bullet" = 80, "laser" = 0, "energy" = 0, "bomb" = -40, "bio" = 0, "rad" = 0, "fire" = 0, "acid" = 50)
shield_flags = SHIELD_FLAGS_DEFAULT | SHIELD_KINETIC_STRONG | SHIELD_ENERGY_WEAK
max_integrity = 300
/obj/item/shield/riot/roman
@@ -277,8 +324,8 @@
/obj/item/shield/riot/roman/fake
desc = "Bears an inscription on the inside: <i>\"Romanes venio domus\"</i>. It appears to be a bit flimsy."
block_chance = 0
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 0, "acid" = 0)
shield_flags = SHIELD_ENERGY_WEAK | SHIELD_KINETIC_WEAK | SHIELD_NO_RANGED
max_integrity = 40
/obj/item/shield/riot/roman/shatter(mob/living/carbon/human/owner)
@@ -295,8 +342,7 @@
custom_materials = list(/datum/material/wood = MINERAL_MATERIAL_AMOUNT * 10)
resistance_flags = FLAMMABLE
repair_material = /obj/item/stack/sheet/mineral/wood
block_chance = 30
shield_flags = SHIELD_FLAGS_DEFAULT
shield_flags = SHIELD_FLAGS_DEFAULT | SHIELD_ENERGY_WEAK
max_integrity = 150
/obj/item/shield/riot/buckler/shatter(mob/living/carbon/human/owner)
@@ -348,7 +394,7 @@
/obj/item/shield/makeshift
name = "metal shield"
desc = "A large shield made of wired and welded sheets of metal. The handle is made of cloth and leather making it unwieldy."
desc = "A large shield made of wired and welded sheets of metal. The handle is made of cloth and leather, making it unwieldy."
armor = list("melee" = 25, "bullet" = 25, "laser" = 5, "energy" = 0, "bomb" = 30, "bio" = 0, "rad" = 0, "fire" = 70, "acid" = 80)
lefthand_file = 'icons/mob/inhands/equipment/shields_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/shields_righthand.dmi'
@@ -362,33 +408,34 @@
/obj/item/shield/riot/tower
name = "tower shield"
desc = "A massive shield that can block a lot of attacks, can take a lot of abuse before braking."
desc = "An immense tower shield. Designed to ensure maximum protection to the user, at the expense of mobility."
armor = list("melee" = 95, "bullet" = 95, "laser" = 75, "energy" = 60, "bomb" = 90, "bio" = 90, "rad" = 0, "fire" = 90, "acid" = 10) //Armor for the item, dosnt transfer to user
item_state = "metal"
icon_state = "metal"
force = 16
slowdown = 2
throwforce = 15 //Massive pice of metal
throwforce = 15 //Massive piece of metal
max_integrity = 600
w_class = WEIGHT_CLASS_HUGE
item_flags = SLOWS_WHILE_IN_HAND
item_flags = SLOWS_WHILE_IN_HAND | ITEM_CAN_BLOCK
shield_flags = SHIELD_FLAGS_DEFAULT
/obj/item/shield/riot/tower/swat
name = "swat shield"
desc = "A massive, heavy shield that can block a lot of attacks, can take a lot of abuse before breaking."
max_integrity = 250
/obj/item/shield/riot/implant
name = "telescoping shield implant"
desc = "A compact, arm-mounted telescopic shield. While nigh-indestructible when powered by a host user, it will eventually overload from damage. Recharges while inside its implant."
item_state = "metal"
icon_state = "metal"
name = "hardlight shield implant"
desc = "A hardlight plane of force projected from the implant. While it is capable of withstanding immense amounts of abuse, it will eventually overload from sustained impacts, especially against energy attacks. Recharges while retracted."
item_state = "holoshield"
icon_state = "holoshield"
slowdown = 1
shield_flags = SHIELD_FLAGS_DEFAULT
max_integrity = 100
obj_integrity = 100
can_shatter = FALSE
item_flags = SLOWS_WHILE_IN_HAND | ITEM_CAN_BLOCK
item_flags = ITEM_CAN_BLOCK
shield_flags = SHIELD_FLAGS_DEFAULT | SHIELD_KINETIC_STRONG | SHIELD_DISABLER_DISRUPTED
var/recharge_timerid
var/recharge_delay = 15 SECONDS
@@ -400,7 +447,7 @@
if(obj_integrity == 0)
if(ismob(loc))
var/mob/living/L = loc
playsound(src, 'sound/effects/glassbr3.ogg', 100)
playsound(src, 'sound/effects/zap.ogg', 100)
L.visible_message("<span class='boldwarning'>[src] overloads from the damage sustained!</span>")
L.dropItemToGround(src) //implant component catch hook will grab it.