Skip to content

Commit

Permalink
Armor tech of the current* year | Protect yourself from all them "gun…
Browse files Browse the repository at this point in the history
…cargos" the old people keep warning you about (#24947) (#921)

* oh yeah i havent saved any of this

* fixes some things that weren't quite right

* makes the sacrificial armor actually take damage

* slight numbers tweak

* adds cargo packs to let sec bulk order this stuff

* shortens the normal desc of the hardened vests

* potentially actually fixes the sacrificial armor not working (evil)

* certified copy paste moment

* buffs protection lowers durability of sacrificial armor

* maybe possibly fixes that sound

* tweaks colors of peacekeeper helmet slightly

* makes the import company look nicer

* fixes crate access and armor value sin

* fixes the vest for digitgrades

* fixes sacrificial armor

* removes a bunch of debug messages

* fixes weird compiler thing

* armor defines, buffs sacrificial armor slightly and pk armor more

* adds a face shield for the val

* adds an examine relating to the face shields

* makes the val face shield not hide your face

* Update modular_skyrat/modules/specialist_armor/code/sacrificial.dm



* stuff holden suggests

---------

Co-authored-by: Paxilmaniac <[email protected]>
Co-authored-by: GoldenAlpharex <[email protected]>
  • Loading branch information
3 people authored Dec 4, 2023
1 parent 64eff0e commit 4dbbd2a
Show file tree
Hide file tree
Showing 13 changed files with 507 additions and 5 deletions.
8 changes: 8 additions & 0 deletions code/__DEFINES/~skyrat_defines/armor_defines.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#define ARMOR_LEVEL_TINY 10
#define ARMOR_LEVEL_WEAK 30
#define ARMOR_LEVEL_MID 50
#define ARMOR_LEVEL_INSANE 90

#define WOUND_ARMOR_WEAK 10
#define WOUND_ARMOR_STANDARD 20
#define WOUND_ARMOR_HIGH 30
3 changes: 3 additions & 0 deletions code/__DEFINES/~skyrat_defines/traits/declarations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,7 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai

#define TRAIT_CONDOM_BROKEN "broken"

/// If clothing can also be damaged by piercing wound checks, instead of JUST slashes and burns
#define TRAIT_CLOTHES_DAMAGED_BY_PIERCING "clothing_damaged_by_piercing"

// END TRAIT DEFINES
1 change: 1 addition & 0 deletions code/_globalvars/traits/_traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_XENOARCH_QUALIFIED" = TRAIT_XENOARCH_QUALIFIED,
"TRAIT_XENO_HEAL_AURA" = TRAIT_XENO_HEAL_AURA,
"TRAIT_XENO_INNATE" = TRAIT_XENO_INNATE,
"TRAIT_CLOTHES_DAMAGED_BY_PIERCING" = TRAIT_CLOTHES_DAMAGED_BY_PIERCING,
),
// SKYRAT EDIT ADDITION END
))
Expand Down
1 change: 1 addition & 0 deletions code/_globalvars/traits/admin_tooling.dm
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ GLOBAL_LIST_INIT(admin_visible_traits, list(
"TRAIT_XENOARCH_QUALIFIED" = TRAIT_XENOARCH_QUALIFIED,
"TRAIT_XENO_HEAL_AURA" = TRAIT_XENO_HEAL_AURA,
"TRAIT_XENO_INNATE" = TRAIT_XENO_INNATE,
"TRAIT_CLOTHES_DAMAGED_BY_PIERCING" = TRAIT_CLOTHES_DAMAGED_BY_PIERCING,
),
// SKYRAT EDIT ADDITION END
))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,63 @@
category = SOL_DEFENSE_DEFENSE_NAME
company_bitflag = CARGO_COMPANY_SOL_DEFENSE

// Basic armor vests
// Armor vests for protecting against bullets

/datum/armament_entry/company_import/sol_defense/armor
subcategory = "Light Body Armor"
subcategory = "Ballistic Armor"
cost = PAYCHECK_CREW * 3

/datum/armament_entry/company_import/sol_defense/armor/ballistic_helmet
item_type = /obj/item/clothing/head/helmet/sf_peacekeeper/debranded

/datum/armament_entry/company_import/sol_defense/armor/sf_ballistic_helmet
item_type = /obj/item/clothing/head/helmet/sf_peacekeeper

/datum/armament_entry/company_import/sol_defense/armor/soft_vest
item_type = /obj/item/clothing/suit/armor/sf_peacekeeper/debranded

/datum/armament_entry/company_import/sol_defense/armor/sf_soft_vest
item_type = /obj/item/clothing/suit/armor/sf_peacekeeper

/datum/armament_entry/company_import/sol_defense/armor/normal_vest
name = "type I vest - normal"
item_type = /obj/item/clothing/suit/armor/vest/alt

/datum/armament_entry/company_import/sol_defense/armor/slim_vest
name = "type I vest - slim"
item_type = /obj/item/clothing/suit/armor/vest

/datum/armament_entry/company_import/sol_defense/armor_hardened
subcategory = "Hardened Armor"
cost = PAYCHECK_CREW * 3

/datum/armament_entry/company_import/sol_defense/armor/normal_vest
name = "type I vest - normal"
item_type = /obj/item/clothing/suit/armor/vest/alt
/datum/armament_entry/company_import/sol_defense/armor_hardened/enclosed_helmet
item_type = /obj/item/clothing/head/helmet/toggleable/sf_hardened


/datum/armament_entry/company_import/sol_defense/armor_hardened/emt_enclosed_helmet
item_type = /obj/item/clothing/head/helmet/toggleable/sf_hardened/emt

/datum/armament_entry/company_import/sol_defense/armor_hardened/hardened_vest
item_type = /obj/item/clothing/suit/armor/sf_hardened

/datum/armament_entry/company_import/sol_defense/armor_hardened/emt_hardened_vest
item_type = /obj/item/clothing/suit/armor/sf_hardened/emt

/datum/armament_entry/company_import/sol_defense/armor_sacrifice
subcategory = "Sacrifical Armor"
cost = PAYCHECK_CREW * 3

/datum/armament_entry/company_import/sol_defense/armor_sacrifice/sacrificial_helmet
item_type = /obj/item/clothing/head/helmet/sf_sacrificial

/datum/armament_entry/company_import/sol_defense/armor_sacrifice/face_shield
item_type = /obj/item/sacrificial_face_shield
cost = PAYCHECK_LOWER

/datum/armament_entry/company_import/sol_defense/armor_sacrifice/sacrificial_vest
item_type = /obj/item/clothing/suit/armor/sf_sacrificial

/datum/armament_entry/company_import/sol_defense/case
subcategory = "Weapon Cases"

Expand Down
30 changes: 30 additions & 0 deletions modular_skyrat/modules/specialist_armor/code/cargo_packs.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/datum/supply_pack/security/armory/soft_armor
name = "Soft Armor Kit Crate"
crate_name = "soft armor kit crate"
desc = "Contains three sets of SolFed-made soft body armor and matching helmets."
cost = CARGO_CRATE_VALUE * 5
contains = list(
/obj/item/clothing/head/helmet/sf_peacekeeper/debranded = 3,
/obj/item/clothing/suit/armor/sf_peacekeeper/debranded = 3,
)

/datum/supply_pack/security/armory/hardened_armor
name = "Hardened Armor Kit Crate"
crate_name = "hardened armor kit crate"
desc = "Contains three sets of SolFed-made hardened body armor and matching helmets."
cost = CARGO_CRATE_VALUE * 5
contains = list(
/obj/item/clothing/head/helmet/toggleable/sf_hardened = 3,
/obj/item/clothing/suit/armor/sf_hardened = 3,
)

/datum/supply_pack/security/armory/sacrificial_armor
name = "Sacrificial Armor Kit Crate"
crate_name = "sacrificial armor kit crate"
desc = "Contains three sets of SolFed-made sacrificial body armor and matching helmets."
cost = CARGO_CRATE_VALUE * 5
contains = list(
/obj/item/clothing/head/helmet/sf_sacrificial = 3,
/obj/item/sacrificial_face_shield = 3,
/obj/item/clothing/suit/armor/sf_sacrificial = 3,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/// Component that lets clothing be damaged in zones by piercing bullets. The parent MUST have limb_integrity set.
/datum/component/clothing_damaged_by_bullets
/// How much of the incoming projectile damage is taken, multiplier
var/projectile_damage_multiplier
/// Who is wearing the target?
var/mob/living/wearer

/datum/component/clothing_damaged_by_bullets/Initialize(projectile_damage_multiplier = 1)
if(!istype(parent, /obj/item/clothing)) // Just in case someone loses it and tries to put this on something that's not clothing
return COMPONENT_INCOMPATIBLE

var/obj/item/clothing/parent_clothing = parent

src.projectile_damage_multiplier = projectile_damage_multiplier

if(ismob(parent_clothing.loc))
var/mob/holder = parent_clothing.loc
if(holder.is_holding(parent_clothing))
return
set_wearer(holder)

/datum/component/clothing_damaged_by_bullets/RegisterWithParent()
RegisterSignal(parent, COMSIG_ATOM_EXAMINE, PROC_REF(on_examine))
RegisterSignal(parent, COMSIG_ITEM_EQUIPPED, PROC_REF(on_equipped))
RegisterSignal(parent, COMSIG_ITEM_DROPPED, PROC_REF(lost_wearer))

/datum/component/clothing_damaged_by_bullets/UnregisterFromParent()
UnregisterSignal(parent, list(COMSIG_ATOM_EXAMINE, COMSIG_ITEM_DROPPED, COMSIG_ITEM_EQUIPPED, COMSIG_QDELETING, COMSIG_ATOM_BULLET_ACT))

/// Check if we've been equipped to a valid slot to shield
/datum/component/clothing_damaged_by_bullets/proc/on_equipped(datum/source, mob/user, slot)
SIGNAL_HANDLER

if((slot & ITEM_SLOT_HANDS))
lost_wearer(source, user)
return
set_wearer(user)

/// Either we've been dropped or our wearer has been QDEL'd. Either way, they're no longer our problem
/datum/component/clothing_damaged_by_bullets/proc/lost_wearer(datum/source, mob/user)
SIGNAL_HANDLER

wearer = null
UnregisterSignal(parent, list(COMSIG_QDELETING, COMSIG_ATOM_BULLET_ACT))

/// Sets the wearer and registers the appropriate signals for them
/datum/component/clothing_damaged_by_bullets/proc/set_wearer(mob/user)
if(wearer == user)
return
if(!isnull(wearer))
CRASH("[type] called set_wearer with [user] but [wearer] was already the wearer!")

wearer = user
RegisterSignal(wearer, COMSIG_QDELETING, PROC_REF(lost_wearer))
RegisterSignal(wearer, COMSIG_ATOM_BULLET_ACT, PROC_REF(hit_by_projectile))

/// Checks an incoming projectile to see if it should damage the thing we're attached to,
/datum/component/clothing_damaged_by_bullets/proc/hit_by_projectile(mob/living/dude_getting_hit, obj/projectile/hitting_projectile, def_zone)
SIGNAL_HANDLER

var/obj/item/clothing/clothing_parent = parent

if(!(def_zone in cover_flags2body_zones(clothing_parent.body_parts_covered)))
return
if(hitting_projectile.sharpness == SHARP_EDGED)
return
if(hitting_projectile.damage_type != BRUTE)
return

/// This seems complex but the actual math is simple, the damage of the projectile * vest damage multiplier, divided by two if the projectile is weak to armour, then modified by wound bonus
var/total_damage = ((hitting_projectile.damage * projectile_damage_multiplier) * (hitting_projectile.weak_against_armour ? 0.5 : 1) * (1 + (hitting_projectile.wound_bonus / 10)))
var/damage_dealt = clothing_parent.take_damage(total_damage, BRUTE, hitting_projectile.armour_penetration, FALSE)

if(clothing_parent.limb_integrity)
clothing_parent.take_damage_zone(def_zone, damage_dealt, BRUTE)

/// Warns any examiner that the clothing we're stuck to will be damaged by piercing bullets
/datum/component/clothing_damaged_by_bullets/proc/on_examine(obj/item/source, mob/examiner, list/examine_list)
SIGNAL_HANDLER

examine_list += "<br>[span_warning("This will be <b>damaged</b> when it protects you from bullets, taking <b>[projectile_damage_multiplier]</b> times the damage that the bullet deals.")]"
99 changes: 99 additions & 0 deletions modular_skyrat/modules/specialist_armor/code/hardened.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
// Hardened vests negate any and all projectile armor penetration, in exchange for having mid af bullet armor
/datum/armor/armor_sf_hardened
melee = ARMOR_LEVEL_WEAK
bullet = ARMOR_LEVEL_MID
laser = ARMOR_LEVEL_WEAK
energy = ARMOR_LEVEL_TINY
bomb = ARMOR_LEVEL_WEAK
fire = ARMOR_LEVEL_MID
acid = ARMOR_LEVEL_WEAK
wound = WOUND_ARMOR_WEAK

/obj/item/clothing/suit/armor/sf_hardened
name = "'Muur' hardened armor vest"
desc = "A large white breastplate, and a semi-flexible mail of dense panels that cover the torso. \
While not so incredible at directly stopping bullets, the vest is uniquely suited to cause bullets \
to lose much of their armor penetrating energy before any damage can be done."
icon = 'modular_skyrat/modules/specialist_armor/icons/armor.dmi'
icon_state = "hardened_standard"
worn_icon = 'modular_skyrat/modules/specialist_armor/icons/armor_worn.dmi'
inhand_icon_state = "armor"
blood_overlay_type = "armor"
armor_type = /datum/armor/armor_sf_hardened
supports_variations_flags = CLOTHING_DIGITIGRADE_VARIATION_NO_NEW_ICON

/obj/item/clothing/suit/armor/sf_hardened/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text, final_block_chance, damage, attack_type, damage_type)
. = ..()

if(istype(hitby, /obj/projectile))
var/obj/projectile/incoming_projectile = hitby
incoming_projectile.armour_penetration = 0
playsound(owner, SFX_RICOCHET, BLOCK_SOUND_VOLUME, vary = TRUE)

/obj/item/clothing/suit/armor/sf_hardened/examine_more(mob/user)
. = ..()

. += "What do you do in an age where armor penetration technology keeps getting better and better, \
and you're quite fond of not being a corpse? The 'Muur' type armor was a pretty successful attempt at an answer \
to the question. Using some advanced materials, micro-scale projectile dampener fields, and a whole \
host of other technologies that some poor SolFed procurement general had to talked to death about, \
it offers a unique advantage over many armor piercing bullets. Why stop the bullet from piercing the armor \
with more armor, when you could simply force the bullet to penetrate less and get away with less protection? \
Some people would rather the bullet just be stopped, of course, but when you have to make choices, many choose \
this one."

return .

/obj/item/clothing/suit/armor/sf_hardened/emt
name = "'Archangel' hardened armor vest"
desc = "A large white breastplate with a lone red stripe, and a semi-flexible mail of dense panels that cover the torso. \
While not so incredible at directly stopping bullets, the vest is uniquely suited to cause bullets \
to lose much of their armor penetrating energy before any damage can be done."
icon_state = "hardened_emt"

/obj/item/clothing/head/helmet/toggleable/sf_hardened
name = "'Muur' enclosed helmet"
desc = "A thick-fronted helmet with extendable visor for whole face protection. The materials and geometry of the helmet \
combine in such a way that bullets lose much of their armor penetrating energy before any damage can be done, rather than penetrate into it."
icon = 'modular_skyrat/modules/specialist_armor/icons/armor.dmi'
icon_state = "enclosed_standard"
worn_icon = 'modular_skyrat/modules/specialist_armor/icons/armor_worn.dmi'
inhand_icon_state = "helmet"
armor_type = /datum/armor/armor_sf_hardened
toggle_message = "You extend the visor on"
alt_toggle_message = "You retract the visor on"
flags_inv = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE|HIDEHAIR|HIDEFACIALHAIR|HIDESNOUT
visor_flags_inv = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE|HIDEHAIR|HIDEFACIALHAIR
flags_cover = HEADCOVERSEYES | HEADCOVERSMOUTH | PEPPERPROOF
visor_flags_cover = HEADCOVERSEYES
dog_fashion = null
supports_variations_flags = CLOTHING_SNOUTED_VARIATION_NO_NEW_ICON

/obj/item/clothing/head/helmet/toggleable/sf_hardened/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text, final_block_chance, damage, attack_type, damage_type)
. = ..()

if(istype(hitby, /obj/projectile))
var/obj/projectile/incoming_projectile = hitby
incoming_projectile.armour_penetration = 0
playsound(src, SFX_RICOCHET, BLOCK_SOUND_VOLUME, vary = TRUE)

/obj/item/clothing/head/helmet/toggleable/sf_hardened/examine_more(mob/user)
. = ..()

. += "What do you do in an age where armor penetration technology keeps getting better and better, \
and you're quite fond of not being a corpse? The 'Muur' type armor was a pretty successful attempt at an answer \
to the question. Using some advanced materials, micro-scale projectile dampener fields, and a whole \
host of other technologies that some poor SolFed procurement general had to talked to death about, \
it offers a unique advantage over many armor piercing bullets. Why stop the bullet from piercing the armor \
with more armor, when you could simply force the bullet to penetrate less and get away with less protection? \
Some people would rather the bullet just be stopped, of course, but when you have to make choices, many choose \
this one."

return .

/obj/item/clothing/head/helmet/toggleable/sf_hardened/emt
name = "'Archangel' enclosed helmet"
desc = "A thick-fronted helmet with extendable visor for whole face protection. The materials and geometry of the helmet \
combine in such a way that bullets lose much of their armor penetrating energy before any damage can be done, rather than penetrate into it. \
This one has a red stripe down the front."
icon_state = "enclosed_emt"
75 changes: 75 additions & 0 deletions modular_skyrat/modules/specialist_armor/code/peacekeeper.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
// The peacekeeper armors and helmets will be less effective at stopping bullet damage than bulletproof vests, but stronger against wounds especially, and some other damage types
/datum/armor/armor_sf_peacekeeper
melee = ARMOR_LEVEL_WEAK
bullet = ARMOR_LEVEL_MID
laser = ARMOR_LEVEL_TINY
energy = ARMOR_LEVEL_TINY
bomb = ARMOR_LEVEL_WEAK
fire = ARMOR_LEVEL_MID
acid = ARMOR_LEVEL_WEAK
wound = WOUND_ARMOR_HIGH

/obj/item/clothing/suit/armor/sf_peacekeeper
name = "'Touvou' peacekeeper armor vest"
desc = "A bright blue vest, proudly bearing 'SF' in white on its front and back. Dense fabric with a thin layer of rolled metal \
will protect you from bullets best, a few blunt blows, and the wounds they cause. Lasers will burn more or less straight through it."
icon = 'modular_skyrat/modules/specialist_armor/icons/armor.dmi'
icon_state = "soft_peacekeeper"
worn_icon = 'modular_skyrat/modules/specialist_armor/icons/armor_worn.dmi'
inhand_icon_state = "armor"
blood_overlay_type = "armor"
armor_type = /datum/armor/armor_sf_peacekeeper
supports_variations_flags = CLOTHING_DIGITIGRADE_VARIATION_NO_NEW_ICON

/obj/item/clothing/suit/armor/sf_peacekeeper/examine_more(mob/user)
. = ..()

. += "A common SolFed designed armor vest for a common cause, not having your innards become outards. \
While heavier armors certainly exist, the 'Touvou' is relatively cheap for the protection you do get, \
and many soldiers and officers around the galaxy will tell you the convenience of a mostly soft body armor. \
Not for any of the protection, but for the relative comfort, especially in areas where you don't need to care \
much if you're able to stop an anti materiel round with your chest. Likely due to all those factors, \
it is a common sight on SolFed peacekeepers around the galaxy, alongside other misfits and corporate baddies \
across the galaxy."

return .

/obj/item/clothing/suit/armor/sf_peacekeeper/debranded
name = "'Touvou' soft armor vest"
desc = "A bright white vest, notably missing an 'SF' marking on either its front or back. Dense fabric with a thin layer of rolled metal \
will protect you from bullets best, a few blunt blows, and the wounds they cause. Lasers will burn more or less straight through it."
icon_state = "soft_civilian"

/obj/item/clothing/head/helmet/sf_peacekeeper
name = "'Kastrol' peacekeeper helmet"
desc = "A large, almost always ill-fitting helmet painted in bright blue. It proudly bears the emblems of SolFed on its sides. \
It will protect from bullets best, with some protection against blunt blows, but falters easily in the presence of lasers."
icon = 'modular_skyrat/modules/specialist_armor/icons/armor.dmi'
icon_state = "helmet_peacekeeper"
worn_icon = 'modular_skyrat/modules/specialist_armor/icons/armor_worn.dmi'
inhand_icon_state = "helmet"
armor_type = /datum/armor/armor_sf_peacekeeper
dog_fashion = null
flags_inv = null
supports_variations_flags = CLOTHING_SNOUTED_VARIATION_NO_NEW_ICON

/obj/item/clothing/head/helmet/sf_peacekeeper/examine_more(mob/user)
. = ..()

. += "A common SolFed designed ballistic helmet for a common cause, keeping your brain inside your head. \
While heavier helmets certainly exist, the 'Kastrol' is relatively cheap for the protection you do get, \
and many soldiers don't mind it much due to its large over-head size bypassing a lot of the fitting issues \
some more advanced or more protective helmets might have. \
Especially in areas where you don't need to care \
much if you're able to stop an anti materiel round with your forehead, it does the job just fine. \
Likely due to all those factors, \
it is a common sight on SolFed peacekeepers around the galaxy, alongside other misfits and corporate baddies \
across the galaxy."

return .

/obj/item/clothing/head/helmet/sf_peacekeeper/debranded
name = "'Kastrol' ballistic helmet"
desc = "A large, almost always ill-fitting helmet painted a dull grey. This one seems to lack any special markings. \
It will protect from bullets best, with some protection against blunt blows, but falters easily in the presence of lasers."
icon_state = "helmet_grey"
Loading

0 comments on commit 4dbbd2a

Please sign in to comment.