Skip to content

Commit

Permalink
Guaranteed damage reduction visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
WeNeedMorePhoron committed May 25, 2023
1 parent dbd85b1 commit faecdc8
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
5 changes: 5 additions & 0 deletions code/__DEFINES/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -341,3 +341,8 @@
/// Required minimum values to see reagents in a beaker
#define HUMAN_REQ_COG_FOR_REG 35
#define HUMAN_REQ_BIO_FOR_REG 50

// Occulus Edit: COMBAT VARIABLES
#define ARMOR_GDR_COEFFICIENT 0.1

// Occulus Edit: End
9 changes: 8 additions & 1 deletion code/modules/clothing/clothing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,20 @@
var/list/armorlist = armor.getList()
if(armorlist.len)
var/list/armor_vals = list()
// Occulus Edit Start: Armor Flat Damage Reduction Transparency
// Occulus Edit: The tmpl is edited too but they are not friendly to comments. Be careful.
for(var/i in armorlist)
if(armorlist[i])
var/perc_reduction = armorlist[i]
var/flat_reduction = armorlist[i] * ARMOR_GDR_COEFFICIENT
var/armor_string = "[flat_reduction] + [armorlist[i]]%"
armor_vals += list(list(
"name" = i,
"value" = armorlist[i]
"value" = perc_reduction,
"armor_string" = armor_string
))
data["armor_info"] = armor_vals
// Occulus Edit End
if(body_parts_covered)
var/body_part_string = body_part_coverage_to_string(body_parts_covered)
data["body_coverage"] = body_part_string
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/living_defense.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define ARMOR_HALLOS_COEFFICIENT 0.4
#define ARMOR_GDR_COEFFICIENT 0.1
// #define ARMOR_GDR_COEFFICIENT 0.1 // Occulus Edit: Factored out to misc.dm for reuse

//This calculation replaces old run_armor_check in favor of more complex and better system
//If you need to do something else with armor - just use getarmor() proc and do with those numbers all you want
Expand Down
2 changes: 1 addition & 1 deletion nano/templates/clothing_stats.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{{:value.name}}
</div>
<div class="itemContent">
{{:helper.displayBar(value.value, 0, 100, value.value <= 25 ? 'bad' : value.value < 50 ? 'average' : 'good', value.value + '%')}}
{{:helper.displayBar(value.value, 0, 100, value.value <= 25 ? 'bad' : value.value < 50 ? 'average' : 'good', value.armor_string)}}
</div>
{{/for}}
<br>
Expand Down

0 comments on commit faecdc8

Please sign in to comment.