From 84093487464756187ab97f2e019cce520c8e6b01 Mon Sep 17 00:00:00 2001 From: subject217 <38303698+subject217@users.noreply.github.com> Date: Mon, 19 Nov 2018 11:44:19 -0800 Subject: [PATCH] Moves damage deflection code from doors to machines and gives it to the stacking machine (#41551) * moves damage deflection from doors to machines and sets the stacking machine's at 21 * return * NONE --- code/game/machinery/_machinery.dm | 6 ++++++ code/game/machinery/doors/door.dm | 7 +------ code/modules/mining/laborcamp/laborstacker.dm | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/code/game/machinery/_machinery.dm b/code/game/machinery/_machinery.dm index a901228b2ff..049877a9cc4 100644 --- a/code/game/machinery/_machinery.dm +++ b/code/game/machinery/_machinery.dm @@ -113,6 +113,7 @@ Class Procs: var/atom/movable/occupant = null var/speed_process = FALSE // Process as fast as possible? var/obj/item/circuitboard/circuit // Circuit to be created and inserted when the machinery is created + var/damage_deflection = 0 var/interaction_flags_machine = INTERACT_MACHINE_WIRES_IF_OPEN | INTERACT_MACHINE_ALLOW_SILICON | INTERACT_MACHINE_OPEN_SILICON | INTERACT_MACHINE_SET_MACHINE var/fair_market_price = 69 @@ -368,6 +369,11 @@ Class Procs: update_icon() updateUsrDialog() +/obj/machinery/run_obj_armor(damage_amount, damage_type, damage_flag = NONE, attack_dir) + if(damage_flag == "melee" && damage_amount < damage_deflection) + return 0 + return ..() + /obj/machinery/proc/default_deconstruction_screwdriver(mob/user, icon_state_open, icon_state_closed, obj/item/I) if(!(flags_1 & NODECONSTRUCT_1) && I.tool_behaviour == TOOL_SCREWDRIVER) I.play_tool_sound(src, 50) diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index ba8ab87f63d..f3d36b48c04 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -12,6 +12,7 @@ armor = list("melee" = 30, "bullet" = 30, "laser" = 20, "energy" = 20, "bomb" = 10, "bio" = 100, "rad" = 100, "fire" = 80, "acid" = 70) CanAtmosPass = ATMOS_PASS_DENSITY flags_1 = PREVENT_CLICK_UNDER_1 + damage_deflection = 10 interaction_flags_atom = INTERACT_ATOM_UI_INTERACT @@ -31,7 +32,6 @@ var/locked = FALSE //whether the door is bolted or not. var/assemblytype //the type of door frame to drop during deconstruction var/datum/effect_system/spark_spread/spark_system - var/damage_deflection = 10 var/real_explosion_block //ignore this, just use explosion_block var/red_alert_access = FALSE //if TRUE, this door will always open on red alert var/poddoor = FALSE @@ -192,11 +192,6 @@ return 1 return ..() -/obj/machinery/door/run_obj_armor(damage_amount, damage_type, damage_flag = 0, attack_dir) - if(damage_flag == "melee" && damage_amount < damage_deflection) - return 0 - . = ..() - /obj/machinery/door/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir) . = ..() if(. && obj_integrity > 0) diff --git a/code/modules/mining/laborcamp/laborstacker.dm b/code/modules/mining/laborcamp/laborstacker.dm index 8f33ef9f08b..c7e3c5b3e72 100644 --- a/code/modules/mining/laborcamp/laborstacker.dm +++ b/code/modules/mining/laborcamp/laborstacker.dm @@ -137,7 +137,7 @@ GLOBAL_LIST(labor_sheet_values) /obj/machinery/mineral/stacking_machine/laborstacker force_connect = TRUE var/points = 0 //The unclaimed value of ore stacked. - + damage_deflection = 21 /obj/machinery/mineral/stacking_machine/laborstacker/process_sheet(obj/item/stack/sheet/inp) points += inp.point_value * inp.amount ..()