From 39363749ca27a22d1e860e92ff5d3ec8549201cb Mon Sep 17 00:00:00 2001 From: mwerezak Date: Sat, 21 Feb 2015 12:54:46 -0500 Subject: [PATCH] Fixes suit breach_threshold not being applied. --- code/modules/clothing/spacesuits/breaches.dm | 17 ++++++++++------- .../clothing/spacesuits/rig/rig_pieces.dm | 4 +++- code/modules/clothing/spacesuits/void/void.dm | 1 + 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/code/modules/clothing/spacesuits/breaches.dm b/code/modules/clothing/spacesuits/breaches.dm index ee2746cccd..a3bb5a3e35 100644 --- a/code/modules/clothing/spacesuits/breaches.dm +++ b/code/modules/clothing/spacesuits/breaches.dm @@ -3,7 +3,7 @@ //They can be healed with plastic or metal sheeting. /datum/breach - var/class = 0 // Size. Lower is smaller. + var/class = 0 // Size. Lower is smaller. Uses floating point values! var/descriptor // 'gaping hole' etc. var/damtype = BURN // Punctured or melted var/obj/item/clothing/suit/space/holder // Suit containing the list of breaches holding this instance. @@ -12,8 +12,8 @@ var/can_breach = 1 // Set to 0 to disregard all breaching. var/list/breaches = list() // Breach datum container. - var/resilience = 0.2 // Multiplier that turns damage into breach class. 1 is 100% of damage to breach, 0.1 is 10%. - var/breach_threshold = 3 // Min damage before a breach is possible. + var/resilience = 0.2 // Multiplier that turns damage into breach class. 1 is 100% of damage to breach, 0.1 is 10%. 0.2 -> 50 brute/burn damage to cause 10 breach damage + var/breach_threshold = 3 // Min damage before a breach is possible. Damage is subtracted by this amount, it determines the "hardness" of the suit. var/damage = 0 // Current total damage var/brute_damage = 0 // Specifically brute damage. var/burn_damage = 0 // Specifically burn damage. @@ -44,7 +44,7 @@ var/global/list/breach_burn_descriptors = list( /datum/breach/proc/update_descriptor() //Sanity... - class = max(1,min(class,5)) + class = between(1, round(class), 5) //Apply the correct descriptor. if(damtype == BURN) descriptor = breach_burn_descriptors[class] @@ -86,7 +86,10 @@ var/global/list/breach_burn_descriptors = list( /obj/item/clothing/suit/space/proc/create_breaches(var/damtype, var/amount) - if(!can_breach || !amount) + amount -= src.breach_threshold + amount *= src.resilience + + if(!can_breach || amount <= 0) return if(!breaches) @@ -98,14 +101,14 @@ var/global/list/breach_burn_descriptors = list( var/turf/T = get_turf(src) if(!T) return - amount = amount * src.resilience - //Increase existing breaches. for(var/datum/breach/existing in breaches) if(existing.damtype != damtype) continue + //keep in mind that 10 breach damage == full pressure loss. + //a breach can have at most 5 breach damage if (existing.class < 5) var/needs = 5 - existing.class if(amount < needs) diff --git a/code/modules/clothing/spacesuits/rig/rig_pieces.dm b/code/modules/clothing/spacesuits/rig/rig_pieces.dm index de18d5e020..6a0d7012f9 100644 --- a/code/modules/clothing/spacesuits/rig/rig_pieces.dm +++ b/code/modules/clothing/spacesuits/rig/rig_pieces.dm @@ -38,7 +38,9 @@ flags_inv = HIDEJUMPSUIT|HIDETAIL flags = STOPSPRESSUREDMAGE | THICKMATERIAL | AIRTIGHT slowdown = 0 - breach_threshold = 35 + //With 0.2 resiliance, will reach 10 breach damage after 9 laser carbine blasts. Completely immune to smg hits. + breach_threshold = 28 + resilience = 0.1 can_breach = 1 supporting_limbs = list() diff --git a/code/modules/clothing/spacesuits/void/void.dm b/code/modules/clothing/spacesuits/void/void.dm index 1cab4a659c..68a619ba28 100644 --- a/code/modules/clothing/spacesuits/void/void.dm +++ b/code/modules/clothing/spacesuits/void/void.dm @@ -48,6 +48,7 @@ ) //Breach thresholds, should ideally be inherited by most (if not all) voidsuits. + //With 0.2 resiliance, will reach 10 breach damage after 3 laser carbine blasts or 8 smg hits. breach_threshold = 18 can_breach = 1