Skip to content

Commit

Permalink
Fixes snowflaked turf armor (#12000)
Browse files Browse the repository at this point in the history
* bizarre

* deadend var too

* we are a duplicate of our parent so we can just delete ourself!
  • Loading branch information
Tsar-Salat authored Dec 15, 2024
1 parent 51f110f commit d473da7
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 33 deletions.
13 changes: 11 additions & 2 deletions code/game/turfs/closed/wall/reinf_walls.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
density = TRUE
max_integrity = 900
damage_deflection = 21
armor_type = /datum/armor/r_wall_armor

var/d_state = INTACT
hardness = 10
Expand All @@ -21,8 +22,16 @@
pipe_astar_cost = 50 \
)

/turf/closed/wall/r_wall/get_armour_list()
return list(MELEE = 30, BULLET = 30, LASER = 20, ENERGY = 20, BOMB = 10, BIO = 100, RAD = 100, FIRE = 80, ACID = 70, STAMINA = 0, BLEED = 0)
/datum/armor/r_wall_armor
melee = 30
bullet = 30
laser = 20
energy = 20
bomb = 10
bio = 100
rad = 100
fire = 80
acid = 70

/turf/closed/wall/r_wall/deconstruction_hints(mob/user)
switch(d_state)
Expand Down
29 changes: 0 additions & 29 deletions code/game/turfs/turf_integrity.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
/turf
/// Can this turf be hit by players?
var/can_hit = TRUE
/// Has armour been generated yet?
var/armor_generated
/// The integrity that the turf starts at, defaulting to max_integrity
var/integrity
/// The maximum integrity that the turf has
Expand Down Expand Up @@ -38,15 +36,6 @@
else
. += "<span class='warning'>It doesn't look like you can damage this...</span>"

/// Override this proc to return the armour list
/turf/proc/get_armour_list()
return null

/turf/proc/generate_armor()
armor_generated = TRUE
var/armour_val = get_armour_list()
armor = armour_val

/turf/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir, armour_penetration = 0)
if(QDELETED(src))
CRASH("[src] taking damage after deletion")
Expand All @@ -67,24 +56,6 @@
else
after_damage(damage_amount, damage_type, damage_flag)

//returns the damage value of the attack after processing the obj's various armor protections
/turf/run_atom_armor(damage_amount, damage_type, damage_flag = 0, attack_dir, armour_penetration = 0)
if(damage_flag == MELEE && damage_amount < damage_deflection)
return 0
switch(damage_type)
if(BRUTE)
if(BURN)
else
return 0
var/armor_protection = 0
if(damage_flag)
if (!armor_generated)
generate_armor()
armor_protection = get_armor_rating(damage_flag)
if(armor_protection) //Only apply weak-against-armor/hollowpoint effects if there actually IS armor.
armor_protection = clamp(armor_protection - armour_penetration, min(armor_protection, 0), 100)
return round(damage_amount * (100 - armor_protection)*0.01, DAMAGE_PRECISION)

/turf/proc/after_damage(damage_amount, damage_type, damage_flag)
return

Expand Down
2 changes: 1 addition & 1 deletion code/modules/clothing/clothing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@
if(!added_durability_header)
readout += "\n<b>DURABILITY (I-X)</b>"
added_damage_header = TRUE
readout += "\n[armor_to_protection_name(durability_key)] [armor_to_protection_class(durability_key)]"
readout += "\n[armor_to_protection_name(durability_key)] [armor_to_protection_class(rating)]"

if(flags_cover & HEADCOVERSMOUTH)
readout += "<br /><b>COVERAGE</b>"
Expand Down
6 changes: 5 additions & 1 deletion code/modules/vehicles/mecha/working/ripley.dm
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,12 @@

/obj/vehicle/sealed/mecha/working/ripley/Initialize(mapload)
. = ..()
AddComponent(/datum/component/armor_plate,3,/obj/item/stack/sheet/animalhide/goliath_hide,list(MELEE = 10, BULLET = 5, LASER = 5))
AddComponent(/datum/component/armor_plate, 3 ,/obj/item/stack/sheet/animalhide/goliath_hide, /datum/armor/armor_plate_ripley_goliath)

/datum/armor/armor_plate_ripley_goliath
melee = 10
bullet = 5
laser = 5

/obj/vehicle/sealed/mecha/working/ripley/Destroy()
for(var/atom/movable/A in cargo)
Expand Down

0 comments on commit d473da7

Please sign in to comment.