Reworks armor damage reduction + armor components + more goodies. (#11106)

Ports Baystation12/Baystation12#27254 and Baystation12/Baystation12#24787 and everything inbetween I guess.

Note that this PR makes guns and armor overall stronger. Lasers also once again do organ damage.
This commit is contained in:
Matt Atlas
2021-02-14 17:54:45 +02:00
committed by GitHub
parent 3ab59b8ff7
commit c30cd94024
138 changed files with 2187 additions and 848 deletions
+11 -1
View File
@@ -41,7 +41,6 @@
var/slowdown = 0 // How much clothing is slowing you down. Negative values speeds you up
var/canremove = 1 //Mostly for Ninja code at this point but basically will not allow the item to be removed if set to 0. /N
var/can_embed = 1//If zero, this item/weapon cannot become embedded in people when you hit them with it
var/list/armor //= list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0) If null, object has 0 armor.
var/list/allowed = null //suit storage stuff.
var/obj/item/device/uplink/hidden/hidden_uplink // All items can have an uplink hidden inside, just remember to add the triggers.
var/zoomdevicename //name used for message when binoculars/scope is used
@@ -57,6 +56,9 @@
///Sound uses when dropping the item, or when its thrown.
var/drop_sound = /decl/sound_category/generic_drop_sound // drop sound - this is the default
var/list/armor
var/armor_degradation_speed //How fast armor will degrade, multiplier to blocked damage to get armor damage value.
//Item_state definition moved to /obj
//var/item_state = null // Used to specify the item state for the on-mob overlays.
var/item_state_slots //overrides the default item_state for particular slots.
@@ -95,6 +97,14 @@
var/lock_picking_level = 0 //used to determine whether something can pick a lock, and how well.
// Its vital that if you make new power tools or new recipies that you include this
/obj/item/Initialize()
. = ..()
if(islist(armor))
for(var/type in armor)
if(armor[type])
AddComponent(/datum/component/armor, armor, armor_degradation_speed)
break
/obj/item/Destroy()
if(ismob(loc))
var/mob/m = loc
@@ -43,7 +43,7 @@
to_chat(user, SPAN_WARNING("You break \the [src] apart, spilling its contents everywhere!"))
fuel = 0
new /obj/effect/decal/cleanable/greenglow(get_turf(user))
user.apply_effect((rand(15,30)),IRRADIATE,blocked = user.getarmor(null, "rad"))
user.apply_damage(rand(15,30), IRRADIATE, damage_flags = DAM_DISPERSED)
qdel(src)
return
@@ -49,9 +49,7 @@
damage_coef -= 0.2
return
var/armor_block = H.run_armor_check(affecting, "melee")
if(H.apply_damage(25 * damage_coef, BRUTE, affecting, armor_block))
if(H.apply_damage(25 * damage_coef, BRUTE, affecting))
H.updatehealth()
if(H.can_feel_pain())
@@ -32,7 +32,9 @@ Protectiveness | Armor %
icon_state = "material_armor"
item_state = "material_armor"
contained_sprite = 1
armor = list(melee = 5, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0)
armor = list(
melee = ARMOR_MELEE_MINOR
)
pocket_slots = 1
/obj/item/clothing/suit/armor/material/makeshift/plasteel
@@ -96,7 +98,9 @@ Protectiveness | Armor %
)
icon_state = "bucket"
item_state = "bucket"
armor = list(melee = 5, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0)
armor = list(
melee = ARMOR_MELEE_MINOR
)
contained_sprite = 1
/obj/item/clothing/head/helmet/bucket/wood
@@ -36,7 +36,7 @@
return 0
/obj/item/material/sword/perform_technique(var/mob/living/carbon/human/target, var/mob/living/carbon/human/user, var/target_zone)
var/armor_reduction = target.run_armor_check(target_zone,"melee")
var/armor_reduction = target.get_blocked_ratio(target_zone, BRUTE, DAM_EDGE|DAM_SHARP, damage = force)*100
var/obj/item/organ/external/affecting = target.get_organ(target_zone)
if(!affecting)
return
@@ -195,10 +195,6 @@
if(status)
deductcharge(hitcost)
if(ishuman(L))
var/mob/living/carbon/human/H = L
H.forcesay(hit_appends)
return 1
/obj/item/melee/baton/emp_act(severity)
@@ -102,9 +102,7 @@
if(user.a_intent == I_DISARM)
if(ishuman(target))
var/mob/living/carbon/human/T = target
var/armor = T.run_armor_check(target_zone,"melee")
T.apply_damage(40, PAIN, target_zone, armor)
T.apply_damage(40, PAIN, target_zone)
return
else
return ..()
+5 -14
View File
@@ -15,7 +15,7 @@
matter = list(DEFAULT_WALL_MATERIAL = 18750)
var/deployed = FALSE
var/time_to_escape = 60
var/ignore_armor = FALSE
var/activated_armor_penetration = 0
/obj/item/trap/proc/can_use(mob/user)
return (user.IsAdvancedToolUser() && !issilicon(user) && !user.stat && !user.restrained())
@@ -98,18 +98,9 @@
else
target_zone = pick(BP_L_FOOT, BP_R_FOOT, BP_L_LEG, BP_R_LEG)
if(!ignore_armor)
//armor
var/blocked = L.run_armor_check(target_zone, "melee")
if(blocked >= 100)
return
var/success = L.apply_damage(30, BRUTE, target_zone, blocked, src)
if(!success)
return FALSE
else
var/success = L.apply_damage(30, BRUTE, target_zone, 0, src)
if(!success)
return FALSE
var/success = L.apply_damage(30, BRUTE, target_zone, used_weapon = src, armor_pen = activated_armor_penetration)
if(!success)
return FALSE
var/did_trap = TRUE
if(ishuman(L))
@@ -156,7 +147,7 @@
/obj/item/trap/sharpened
name = "sharpened mechanical trap"
desc_antag = "This device has an even higher chance of penetrating armor and locking foes in place."
ignore_armor = TRUE
activated_armor_penetration = 100
/obj/item/trap/animal
name = "small trap"
@@ -243,7 +243,7 @@
species_restricted = list(BODYTYPE_VAURCA,BODYTYPE_VAURCA_WARFORM)
sprite_sheets = list(
BODYTYPE_VAURCA_WARFORM = 'icons/mob/species/warriorform/shoes.dmi'
)
)
action_button_name = "Toggle the magclaws"
@@ -257,8 +257,13 @@
slowdown = -1
species_restricted = list(BODYTYPE_VAURCA)
armor = list(melee = 50, bullet = 20, laser = 50, energy = 30, bomb = 45, bio = 100, rad = 10)
armor = list(
melee = ARMOR_MELEE_RESISTANT,
bullet = ARMOR_BALLISTIC_SMALL,
laser = ARMOR_LASER_SMALL,
bomb = ARMOR_BOMB_PADDED,
bio = ARMOR_BIO_SHIELDED
)
/obj/item/clothing/head/helmet/space/void/scout
name = "scout helmet"
desc = "A helmet designed for K'laxan scouts, made of lightweight sturdy material that does not restrict movement."
@@ -268,8 +273,13 @@
item_state = "helm_scout"
species_restricted = list(BODYTYPE_VAURCA)
armor = list(melee = 40, bullet = 20, laser = 40, energy = 30, bomb = 45, bio = 100, rad = 10)
armor = list(
melee = ARMOR_MELEE_RESISTANT,
bullet = ARMOR_BALLISTIC_SMALL,
laser = ARMOR_LASER_SMALL,
bomb = ARMOR_BOMB_PADDED,
bio = ARMOR_BIO_SHIELDED
)
light_overlay = "helmet_light_dual_green"
light_color = "#3e7c3e"
@@ -282,8 +292,14 @@
desc = "A design perfected by the Zo'ra, this helmet is commonly used by frontline warriors of a hive. Ablative design deflects lasers away from the body while providing moderate physical protection."
species_restricted = list(BODYTYPE_VAURCA)
armor = list(melee = 40, bullet = 40, laser = 60, energy = 50, bomb = 45, bio = 100, rad = 10)
armor = list(
melee = ARMOR_MELEE_RESISTANT,
bullet = ARMOR_BALLISTIC_RESISTANT,
laser = ARMOR_LASER_MAJOR,
bomb = ARMOR_BOMB_PADDED,
bio = ARMOR_BIO_SHIELDED,
rad = ARMOR_RAD_MINOR
)
/obj/item/clothing/head/helmet/space/void/commando
name = "commando helmet"
desc = "A design perfected by the Zo'ra, this helmet is commonly used by frontline warriors of a hive. Ablative design deflects lasers away from the body while providing moderate physical protection."
@@ -293,7 +309,14 @@
item_state = "helm_commando"
species_restricted = list(BODYTYPE_VAURCA)
armor = list(melee = 30, bullet = 30, laser = 60, energy = 50, bomb = 45, bio = 100, rad = 10)
armor = list(
melee = ARMOR_MELEE_RESISTANT,
bullet = ARMOR_BALLISTIC_RESISTANT,
laser = ARMOR_LASER_MAJOR,
bomb = ARMOR_BOMB_PADDED,
bio = ARMOR_BIO_SHIELDED,
rad = ARMOR_RAD_MINOR
)
light_overlay = "helmet_light_dual_green"
light_color = "#3e7c3e"
@@ -307,7 +330,13 @@
gas_filter_strength = 3
w_class = ITEMSIZE_SMALL
filtered_gases = list(GAS_NITROGEN, GAS_N2O)
armor = list(melee = 25, bullet = 10, laser = 25, energy = 25, bomb = 0, bio = 50, rad = 15)
armor = list(
melee = ARMOR_MELEE_RESISTANT,
bullet = ARMOR_BALLISTIC_MINOR,
laser = ARMOR_LASER_SMALL,
bio = ARMOR_BIO_STRONG,
rad = ARMOR_RAD_MINOR
)
icon = 'icons/obj/vaurca_items.dmi'
icon_state = "m_metalg"
item_state = "m_metalg"
+1 -1
View File
@@ -211,7 +211,7 @@
if(!material.radioactivity)
return
for(var/mob/living/L in range(1,src))
L.apply_effect(round(material.radioactivity/3),IRRADIATE,0)
L.apply_damage(round(material.radioactivity/3),IRRADIATE, damage_flags = DAM_DISPERSED)
/obj/structure/simple_door/iron/New(var/newloc,var/material_name, var/complexity)
..(newloc, MATERIAL_IRON, complexity)
@@ -157,21 +157,19 @@
var/mob/living/occupant = unbuckle_mob()
var/def_zone = ran_zone()
var/blocked = occupant.run_armor_check(def_zone, "melee")
occupant.throw_at(A, 3, propelled)
occupant.apply_effect(6, STUN, blocked)
occupant.apply_effect(6, WEAKEN, blocked)
occupant.apply_effect(6, STUTTER, blocked)
occupant.apply_damage(10, BRUTE, def_zone, blocked)
occupant.apply_effect(6, STUN)
occupant.apply_effect(6, WEAKEN)
occupant.apply_effect(6, STUTTER)
occupant.apply_damage(10, BRUTE, def_zone)
playsound(src.loc, "punch", 50, 1, -1)
if(istype(A, /mob/living))
if(isliving(A))
var/mob/living/victim = A
def_zone = ran_zone()
blocked = victim.run_armor_check(def_zone, "melee")
victim.apply_effect(6, STUN, blocked)
victim.apply_effect(6, WEAKEN, blocked)
victim.apply_effect(6, STUTTER, blocked)
victim.apply_damage(10, BRUTE, def_zone, blocked)
victim.apply_effect(6, STUN)
victim.apply_effect(6, WEAKEN)
victim.apply_effect(6, STUTTER)
victim.apply_damage(10, BRUTE, def_zone)
occupant.visible_message("<span class='danger'>[occupant] crashed into \the [A]!</span>")
/obj/structure/bed/chair/office/light
@@ -115,8 +115,8 @@
dismantle()
qdel(src)
var/blocked = target.run_armor_check(hit_zone, "melee")
target.Weaken(10 * BLOCKED_MULT(blocked))
var/blocked = target.get_blocked_ratio(hit_zone, BRUTE)
target.Weaken(10 * (1 - blocked))
target.apply_damage(20, BRUTE, hit_zone, blocked, src)
return
@@ -150,21 +150,19 @@
occupant.throw_at(A, 3, propelled)
var/def_zone = ran_zone()
var/blocked = occupant.run_armor_check(def_zone, "melee")
occupant.throw_at(A, 3, propelled)
occupant.apply_effect(6, STUN, blocked)
occupant.apply_effect(6, WEAKEN, blocked)
occupant.apply_effect(6, STUTTER, blocked)
occupant.apply_damage(10, BRUTE, def_zone, blocked)
occupant.apply_effect(6, STUN)
occupant.apply_effect(6, WEAKEN)
occupant.apply_effect(6, STUTTER)
occupant.apply_damage(10, BRUTE, def_zone)
playsound(src.loc, "punch", 50, 1, -1)
if(istype(A, /mob/living))
if(isliving(A))
var/mob/living/victim = A
def_zone = ran_zone()
blocked = victim.run_armor_check(def_zone, "melee")
victim.apply_effect(6, STUN, blocked)
victim.apply_effect(6, WEAKEN, blocked)
victim.apply_effect(6, STUTTER, blocked)
victim.apply_damage(10, BRUTE, def_zone, blocked)
victim.apply_effect(6, STUN)
victim.apply_effect(6, WEAKEN)
victim.apply_effect(6, STUTTER)
victim.apply_damage(10, BRUTE, def_zone)
if(pulling)
occupant.visible_message("<span class='danger'>[pulling] has thrusted \the [name] into \the [A], throwing \the [occupant] out of it!</span>")
+1 -2
View File
@@ -119,8 +119,7 @@
to_chat(user, SPAN_NOTICE("[GM.name] needs to be on the urinal."))
return
user.visible_message(SPAN_DANGER("[user] slams [GM.name] into the [src]!"), SPAN_NOTICE("You slam [GM.name] into the [src]!"))
var/blocked = GM.run_armor_check("melee")
GM.apply_damage(8, def_zone = BP_HEAD, blocked = blocked, used_weapon = "blunt force")
GM.apply_damage(8, def_zone = BP_HEAD, used_weapon = "blunt force")
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN * 1.5)
else
to_chat(user, SPAN_NOTICE("You need a tighter grip."))
+3 -4
View File
@@ -278,22 +278,21 @@
qdel(G) //gotta delete it here because if window breaks, it won't get deleted
var/def_zone = ran_zone(BP_HEAD, 20)
var/blocked = M.run_armor_check(def_zone, "melee")
switch (state)
if(1)
M.visible_message(SPAN_WARNING("[user] slams [M] against \the [src]!"))
M.apply_damage(7, damtype, def_zone, blocked, src)
M.apply_damage(7, damtype, def_zone, used_weapon = src)
hit(10)
if(2)
M.visible_message(SPAN_DANGER("[user] bashes [M] against \the [src]!"))
if (prob(50))
M.Weaken(1)
M.apply_damage(10, damtype, def_zone, blocked, src)
M.apply_damage(10, damtype, def_zone, used_weapon = src)
hit(25)
if(3)
M.visible_message(SPAN_DANGER("<big>[user] crushes [M] against \the [src]!</big>"))
M.Weaken(5)
M.apply_damage(20, damtype, def_zone, blocked, src)
M.apply_damage(20, damtype, def_zone, used_weapon = src)
hit(50)
/obj/structure/window/proc/hit(var/damage, var/sound_effect = 1)