Skip to content

Commit

Permalink
Merge pull request #3561 from X0-11/experimental-combat-changes
Browse files Browse the repository at this point in the history
Armour thickness now degrades.
  • Loading branch information
BDpuffy420 authored Jun 8, 2024
2 parents 6b2f536 + 53879a5 commit b5d5d91
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 13 deletions.
7 changes: 3 additions & 4 deletions code/modules/halo/clothing/armor_repair/clothing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
/obj/item/clothing
var/armor_thickness = 20 //The thickness of the armor, in mm. Keep null to opt-out usage of system for item. This value, set at compile time is the maximum value of thickness for this item. Armor can only lose 10% of this value per-hit.
var/armor_thickness_max = 20
var/list/armor_thickness_modifiers = list()//A list containing the weaknesses of the armor, used when performing armor-thickness depletion. Format: damage_type - multiplier
var/dam_desc = ""
var/next_warning_time = 0
var/armor_break_sound = 'code/modules/halo/sounds/effects/armor_break.ogg'
Expand All @@ -16,10 +15,8 @@
/obj/item/clothing/proc/degrade_armor_thickness(var/damage,var/damage_type)
damage /= 10
var/thickness_dam_cap = ARMOUR_THICKNESS_DAMAGE_CAP
if(damage_type in armor_thickness_modifiers)
thickness_dam_cap /= armor_thickness_modifiers[damage_type]

var/new_thickness = round(armor_thickness - min(damage,thickness_dam_cap))
var/new_thickness = armor_thickness - min(damage,thickness_dam_cap)
new_thickness = max(0, new_thickness)

var/mob/user = src.loc
Expand All @@ -32,6 +29,8 @@
else if(istype(user))
to_chat(user, "<span class = 'warning'>Your [name]'s armor plating is [damage_type == BURN ? "scorched" : "damaged"]! </span>")
next_warning_time = world.time + WARNING_DELAY
armor_thickness = new_thickness
update_damage_description()

/obj/item/clothing/proc/update_damage_description(var/damage_type = BRUTE)
var/desc_addition_to_apply = "Its armor plating is nominal."
Expand Down
1 change: 0 additions & 1 deletion code/modules/halo/covenant/species/kigyar/clothing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
"Tvaoan Kig-Yar" = 'code/modules/halo/covenant/species/tvoan/skirm_clothing.dmi')
species_restricted = list("Kig-Yar","Tvaoan Kig-Yar")
armor = list(melee = 55, bullet = 50, laser = 55, energy = 50, bomb = 40, bio = 25, rad = 25)
armor_thickness_modifiers = list()
body_parts_covered = UPPER_TORSO|LOWER_TORSO|ARMS
matter = list("nanolaminate" = 1)

Expand Down
1 change: 0 additions & 1 deletion code/modules/halo/covenant/species/sangheili/clothing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
/obj/item/ammo_casing, /obj/item/weapon/melee/baton, /obj/item/weapon/melee/energy/elite_sword)
specials = list(/datum/armourspecials/shields/elite,/datum/armourspecials/shieldmonitor/sangheili)
armor = list(melee = 55, bullet = 50, laser = 55, energy = 45, bomb = 40, bio = 25, rad = 25)
armor_thickness_modifiers = list()
unacidable = 1
max_suitstore_w_class = ITEM_SIZE_HUGE
matter = list("nanolaminate" = 2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
sprite_sheets = list("Tvaoan Kig-Yar" = 'code/modules/halo/covenant/species/tvoan/skirm_clothing.dmi')
species_restricted = list("Tvaoan Kig-Yar")
armor = list(melee = 55, bullet = 50, laser = 55, energy = 45, bomb = 40, bio = 25, rad = 25)
armor_thickness_modifiers = list()
body_parts_covered = ARMS|UPPER_TORSO|LOWER_TORSO
matter = list("nanolaminate" = 1)

Expand Down
1 change: 0 additions & 1 deletion code/modules/halo/covenant/species/unggoy/armour.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
icon_state = "combatharness_minor"
body_parts_covered = UPPER_TORSO|LOWER_TORSO|LEGS|ARMS //Essentially, the entire body besides the head,feet,hands
flags_inv = HIDESUITSTORAGE|HIDEBACK
armor_thickness_modifiers = list()
unacidable = 1
allowed = list(\
/obj/item/weapon/grenade/plasma,\
Expand Down
6 changes: 2 additions & 4 deletions code/modules/mob/living/carbon/human/human_defense.dm
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,9 @@ cloak disrupt override
if(gear)
var/obj/item/clothing/C = gear
if(istype(C) && C.body_parts_covered & def_zone.body_part)
var/effective_armor_thickness = 0
var/effective_armor_thickness = 1
if(!isnull(C.armor_thickness_max))
effective_armor_thickness = (C.armor_thickness/10) + 1
if(type in C.armor_thickness_modifiers)
effective_armor_thickness *= C.armor_thickness_modifiers[type]
effective_armor_thickness += (C.armor_thickness/10)
protection = add_armor(protection, (C.armor[type] * effective_armor_thickness * (lore_accuracy ? 0.4 : 1) ))
return protection

Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/human/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1219,4 +1219,4 @@
var/obj/item/clothing/c = i
if(istype(c))
if(c.armor_thickness < c.armor_thickness_max)
c.armor_thickness = min(c.armor_thickness + 0.1,c.armor_thickness_max)
c.armor_thickness = min(c.armor_thickness + 0.05,c.armor_thickness_max)

0 comments on commit b5d5d91

Please sign in to comment.