From e6a8d79d2b51f3cd8fc51075392882993d4d20bc Mon Sep 17 00:00:00 2001 From: MistakeNot4892 Date: Sat, 3 Feb 2024 14:17:36 +1100 Subject: [PATCH 1/2] Unifying atom max damage in a get_max_damage() proc. --- code/datums/uplink/services.dm | 2 +- code/game/gamemodes/cult/runes.dm | 12 ++--- code/game/gamemodes/godmode/god_structures.dm | 2 +- .../_machines_base/machinery_damage.dm | 2 +- .../_machines_base/stock_parts/access_lock.dm | 6 +-- .../stock_parts/building_material.dm | 2 +- .../_machines_base/stock_parts/card_reader.dm | 4 +- .../_machines_base/stock_parts/disk_reader.dm | 4 +- .../stock_parts/power/battery.dm | 2 +- .../_machines_base/stock_parts/power/power.dm | 2 +- .../stock_parts/power/terminal.dm | 2 +- .../_machines_base/stock_parts/power/tesla.dm | 2 +- .../stock_parts/radio/receiver.dm | 2 +- .../stock_parts/radio/stock_parts_radio.dm | 2 +- .../stock_parts/radio/transmitter.dm | 4 +- .../stock_parts/stock_parts_interface.dm | 2 +- code/game/machinery/atmoalter/canister.dm | 2 +- code/game/machinery/deployable.dm | 11 ++--- code/game/machinery/doors/_door.dm | 44 ++++++++++--------- code/game/machinery/doors/airlock.dm | 6 +-- code/game/machinery/doors/airlock_subtypes.dm | 4 +- code/game/machinery/doors/blast_door.dm | 8 ++-- code/game/machinery/doors/braces.dm | 2 +- code/game/machinery/doors/windowdoor.dm | 4 +- code/game/machinery/portable_turret.dm | 9 ++-- .../objects/effects/decals/posters/_poster.dm | 2 +- code/game/objects/effects/spiders.dm | 6 +-- code/game/objects/item.dm | 2 +- code/game/objects/item_damage.dm | 4 +- code/game/objects/item_materials.dm | 12 ++--- code/game/objects/items/blackout.dm | 2 +- code/game/objects/items/devices/uplink.dm | 2 +- code/game/objects/items/plunger.dm | 2 +- code/game/objects/items/robot/robot_items.dm | 2 +- code/game/objects/items/stacks/rods.dm | 2 +- code/game/objects/items/stacks/stack.dm | 2 +- .../objects/items/stacks/tiles/tile_types.dm | 6 +-- code/game/objects/items/weapons/defib.dm | 2 +- code/game/objects/items/weapons/handcuffs.dm | 8 ++-- .../objects/items/weapons/material/misc.dm | 6 +-- .../objects/items/weapons/nuclear_cylinder.dm | 2 +- code/game/objects/items/weapons/soap.dm | 2 +- .../objects/items/weapons/storage/internal.dm | 2 +- code/game/objects/items/weapons/tape.dm | 2 +- .../items/weapons/tools/weldingtool.dm | 2 +- code/game/objects/items/weapons/weaponry.dm | 8 ++-- code/game/objects/objs.dm | 12 ++--- code/game/objects/objs_damage.dm | 8 ++-- code/game/objects/structures/__structure.dm | 10 ++--- .../structures/_structure_construction.dm | 5 ++- .../structures/_structure_materials.dm | 9 ++-- code/game/objects/structures/banners.dm | 4 +- code/game/objects/structures/barricade.dm | 2 +- .../crates_lockers/closets/__closet.dm | 2 +- .../objects/structures/defensive_barrier.dm | 4 +- code/game/objects/structures/displaycase.dm | 2 +- code/game/objects/structures/doors/_door.dm | 2 +- code/game/objects/structures/fishtanks.dm | 2 +- code/game/objects/structures/girders.dm | 4 +- code/game/objects/structures/grille.dm | 2 +- code/game/objects/structures/inflatable.dm | 6 +-- code/game/objects/structures/railing.dm | 11 ++--- code/game/objects/structures/rubble.dm | 2 +- .../stool_bed_chair_nest_sofa/wheelchair.dm | 2 +- code/game/objects/structures/tables.dm | 2 +- code/game/objects/structures/wall_frame.dm | 2 +- code/game/objects/structures/window.dm | 2 +- code/modules/blob/blob.dm | 23 +++++----- code/modules/clothing/masks/voice.dm | 2 +- code/modules/crafting/_crafting_holder.dm | 2 +- .../tools/sample_kits/_sample.dm | 2 +- code/modules/holodeck/HolodeckObjects.dm | 2 +- code/modules/hydroponics/seed_packets.dm | 2 +- .../hydroponics/spreading/spreading.dm | 19 ++++---- .../hydroponics/spreading/spreading_growth.dm | 6 +-- .../integrated_electronics/core/assemblies.dm | 14 +++--- .../core/integrated_circuit.dm | 2 +- code/modules/materials/material_sheets.dm | 2 +- code/modules/materials/material_synth.dm | 2 +- code/modules/mechs/components/body.dm | 2 +- code/modules/mechs/equipment/combat.dm | 2 +- code/modules/mob/living/carbon/resist.dm | 2 +- code/modules/mob/living/living.dm | 4 +- .../mob/living/silicon/ai/ai_damage.dm | 2 +- .../mob/living/silicon/robot/component.dm | 21 +++++---- .../living/silicon/robot/drone/drone_items.dm | 4 +- .../mob/living/silicon/robot/robot_items.dm | 10 ++--- code/modules/mob_holder/_holder.dm | 2 +- code/modules/paperwork/paper_bundle.dm | 2 +- code/modules/paperwork/printer.dm | 4 +- code/modules/paperwork/toner_cartridge.dm | 2 +- code/modules/power/cable.dm | 2 +- .../power/fuel_assembly/fuel_assembly.dm | 2 +- code/modules/power/singularity/collector.dm | 2 +- code/modules/power/solar.dm | 2 +- .../reagents/reagent_containers/borghydro.dm | 2 +- .../reagent_containers/food/meat/slabs.dm | 2 +- code/modules/reagents/reagent_dispenser.dm | 2 +- code/modules/recycling/disposalpipe.dm | 2 +- .../research/design_database_analyzer.dm | 2 +- code/modules/shieldgen/emergency_shield.dm | 9 ++-- code/modules/spells/artifacts.dm | 2 +- code/modules/spells/hand/hand_item.dm | 2 +- .../spells/targeted/equip/burning_touch.dm | 2 +- code/modules/vehicles/bike.dm | 2 +- code/modules/vehicles/train.dm | 2 +- code/modules/vehicles/vehicle.dm | 5 ++- code/unit_tests/obj_damage_tests.dm | 29 ++++++------ maps/away/errant_pisces/errant_pisces.dm | 2 +- mods/species/ascent/mobs/insectoid_egg.dm | 2 +- 110 files changed, 272 insertions(+), 253 deletions(-) diff --git a/code/datums/uplink/services.dm b/code/datums/uplink/services.dm index 6bec9ead893..c9d49fb49d9 100644 --- a/code/datums/uplink/services.dm +++ b/code/datums/uplink/services.dm @@ -61,7 +61,7 @@ w_class = ITEM_SIZE_TINY icon = 'icons/obj/items/device/flash_synthetic.dmi' icon_state = ICON_STATE_WORLD - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE var/state = AWAITING_ACTIVATION var/service_label = "Unnamed Service" var/service_duration = 0 SECONDS diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index 6c2bb0e2eeb..3e7a3038904 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -247,10 +247,11 @@ /obj/effect/rune/wall/cast(var/mob/living/user) var/t if(wall) - if(wall.health >= wall.max_health) + var/wall_max_health = wall.get_max_health() + if(wall.health >= wall_max_health) to_chat(user, "The wall doesn't need mending.") return - t = wall.max_health - wall.health + t = wall_max_health - wall.health wall.health += t else wall = new /obj/effect/cultwall(get_turf(src), bcolor) @@ -268,7 +269,7 @@ color = "#ff0000" anchored = TRUE density = TRUE - max_health = 200 + obj_max_health = 200 var/obj/effect/rune/wall/rune /obj/effect/cultwall/Initialize(mapload, var/bcolor) @@ -285,9 +286,10 @@ /obj/effect/cultwall/examine(mob/user) . = ..() if(iscultist(user)) - if(health == max_health) + var/current_max_health = get_max_health() + if(health == current_max_health) to_chat(user, "It is fully intact.") - else if(health > max_health * 0.5) + else if(health > current_max_health * 0.5) to_chat(user, "It is damaged.") else to_chat(user, "It is about to dissipate.") diff --git a/code/game/gamemodes/godmode/god_structures.dm b/code/game/gamemodes/godmode/god_structures.dm index 6eaed5e088e..cfe2aa2034f 100644 --- a/code/game/gamemodes/godmode/god_structures.dm +++ b/code/game/gamemodes/godmode/god_structures.dm @@ -17,7 +17,7 @@ /obj/structure/deity icon = 'icons/obj/cult.dmi' - max_health = 10 + obj_max_health = 10 density = TRUE anchored = TRUE icon_state = "tomealtar" diff --git a/code/game/machinery/_machines_base/machinery_damage.dm b/code/game/machinery/_machines_base/machinery_damage.dm index 8c7953186f9..328b8d95dbb 100644 --- a/code/game/machinery/_machines_base/machinery_damage.dm +++ b/code/game/machinery/_machines_base/machinery_damage.dm @@ -54,7 +54,7 @@ if(uncreated_component_parts[path]) var/obj/item/stock_parts/component = path //Must be checked this way, since we don't have an instance to call component.can_take_damage() on. - if(initial(component.max_health) != ITEM_HEALTH_NO_DAMAGE) + if(initial(component.obj_max_health) != ITEM_HEALTH_NO_DAMAGE) return force_init_component(path) /obj/machinery/proc/on_component_failure(var/obj/item/stock_parts/component) diff --git a/code/game/machinery/_machines_base/stock_parts/access_lock.dm b/code/game/machinery/_machines_base/stock_parts/access_lock.dm index c786b7b4f7e..8cbb0084bb2 100644 --- a/code/game/machinery/_machines_base/stock_parts/access_lock.dm +++ b/code/game/machinery/_machines_base/stock_parts/access_lock.dm @@ -4,7 +4,7 @@ icon_state = "lock" part_flags = PART_FLAG_QDEL req_access = list(access_engine_equip) // set req_access on this to impose access requirements. - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE var/locked = FALSE var/emagged = FALSE var/autoset = FALSE // Whether the machine should inherit access from surrounding areas @@ -106,7 +106,7 @@ if(!req_access) locked = FALSE else - var/obj/item/card/id/I = user.GetIdCard() + var/obj/item/card/id/I = user.GetIdCard() if(!istype(I, /obj/item/card/id)) to_chat(user, SPAN_WARNING("[\src] flashes a yellow LED near the ID scanner. Did you remember to scan your ID or PDA?")) return TOPIC_HANDLED @@ -151,7 +151,7 @@ req_access = conf_access.Copy() /obj/item/stock_parts/access_lock/buildable - max_health = null //Buildable variant may take damage + obj_max_health = null //Buildable variant may take damage part_flags = PART_FLAG_HAND_REMOVE material = /decl/material/solid/metal/steel matter = list(/decl/material/solid/fiberglass = MATTER_AMOUNT_REINFORCEMENT) diff --git a/code/game/machinery/_machines_base/stock_parts/building_material.dm b/code/game/machinery/_machines_base/stock_parts/building_material.dm index 615a39b9a85..a26bc2e622c 100644 --- a/code/game/machinery/_machines_base/stock_parts/building_material.dm +++ b/code/game/machinery/_machines_base/stock_parts/building_material.dm @@ -6,7 +6,7 @@ icon = 'icons/obj/power.dmi' icon_state = "coil" part_flags = PART_FLAG_QDEL - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE var/list/materials /obj/item/stock_parts/building_material/Destroy() diff --git a/code/game/machinery/_machines_base/stock_parts/card_reader.dm b/code/game/machinery/_machines_base/stock_parts/card_reader.dm index fb8b1fe8d34..635ad00735e 100644 --- a/code/game/machinery/_machines_base/stock_parts/card_reader.dm +++ b/code/game/machinery/_machines_base/stock_parts/card_reader.dm @@ -13,13 +13,13 @@ /decl/material/solid/metal/copper = MATTER_AMOUNT_TRACE, /decl/material/solid/fiberglass = MATTER_AMOUNT_TRACE, ) - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE var/should_swipe = FALSE //Whether the card should only be swiped instead of being inserted var/obj/item/card/inserted_card //Card currently in the slot /obj/item/stock_parts/item_holder/card_reader/buildable part_flags = PART_FLAG_HAND_REMOVE - max_health = 56 + obj_max_health = 56 /obj/item/stock_parts/item_holder/card_reader/Destroy() QDEL_NULL(inserted_card) diff --git a/code/game/machinery/_machines_base/stock_parts/disk_reader.dm b/code/game/machinery/_machines_base/stock_parts/disk_reader.dm index eb6a5b8fe72..e52f484c2e2 100644 --- a/code/game/machinery/_machines_base/stock_parts/disk_reader.dm +++ b/code/game/machinery/_machines_base/stock_parts/disk_reader.dm @@ -13,12 +13,12 @@ /decl/material/solid/metal/copper = MATTER_AMOUNT_REINFORCEMENT, /decl/material/solid/fiberglass = MATTER_AMOUNT_REINFORCEMENT, ) - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE var/obj/item/disk/disk //Disk currently inserted /obj/item/stock_parts/item_holder/disk_reader/buildable part_flags = PART_FLAG_HAND_REMOVE - max_health = 56 + obj_max_health = 56 /obj/item/stock_parts/item_holder/disk_reader/Destroy() QDEL_NULL(disk) diff --git a/code/game/machinery/_machines_base/stock_parts/power/battery.dm b/code/game/machinery/_machines_base/stock_parts/power/battery.dm index f883e307f14..c6d315ea0ef 100644 --- a/code/game/machinery/_machines_base/stock_parts/power/battery.dm +++ b/code/game/machinery/_machines_base/stock_parts/power/battery.dm @@ -195,7 +195,7 @@ return "The machine can receive power from an installed power cell." /obj/item/stock_parts/power/battery/buildable - max_health = null //Buildable variant may take damage + obj_max_health = null //Buildable variant may take damage part_flags = PART_FLAG_HAND_REMOVE material = /decl/material/solid/metal/steel diff --git a/code/game/machinery/_machines_base/stock_parts/power/power.dm b/code/game/machinery/_machines_base/stock_parts/power/power.dm index 7e8870ab3fc..0f21a6c23c2 100644 --- a/code/game/machinery/_machines_base/stock_parts/power/power.dm +++ b/code/game/machinery/_machines_base/stock_parts/power/power.dm @@ -7,7 +7,7 @@ part_flags = PART_FLAG_QDEL // For integrated components, which are built from uncreated_component_parts. Use subtypes with this off for buildable ones. icon = 'icons/obj/items/stock_parts/stock_parts.dmi' icon_state = "teslalink" - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE var/priority = 0 // Higher priority is used first var/cached_channel diff --git a/code/game/machinery/_machines_base/stock_parts/power/terminal.dm b/code/game/machinery/_machines_base/stock_parts/power/terminal.dm index 20d892e14ea..31c3eaa829e 100644 --- a/code/game/machinery/_machines_base/stock_parts/power/terminal.dm +++ b/code/game/machinery/_machines_base/stock_parts/power/terminal.dm @@ -163,7 +163,7 @@ /obj/item/stock_parts/power/terminal/buildable part_flags = PART_FLAG_HAND_REMOVE - max_health = null //Buildable variant may take damage + obj_max_health = null //Buildable variant may take damage material = /decl/material/solid/metal/steel /decl/stock_part_preset/terminal_connect diff --git a/code/game/machinery/_machines_base/stock_parts/power/tesla.dm b/code/game/machinery/_machines_base/stock_parts/power/tesla.dm index 4b7a5ecdab8..448a5e6f65a 100644 --- a/code/game/machinery/_machines_base/stock_parts/power/tesla.dm +++ b/code/game/machinery/_machines_base/stock_parts/power/tesla.dm @@ -30,6 +30,6 @@ return "The machine can receive power wirelessly from a nearby area power controller." /obj/item/stock_parts/power/apc/buildable - max_health = null //Buildable variant may take damage + obj_max_health = null //Buildable variant may take damage part_flags = PART_FLAG_HAND_REMOVE material = /decl/material/solid/metal/steel \ No newline at end of file diff --git a/code/game/machinery/_machines_base/stock_parts/radio/receiver.dm b/code/game/machinery/_machines_base/stock_parts/radio/receiver.dm index b35afa55d73..80a526af3cc 100644 --- a/code/game/machinery/_machines_base/stock_parts/radio/receiver.dm +++ b/code/game/machinery/_machines_base/stock_parts/radio/receiver.dm @@ -46,6 +46,6 @@ method.perform(machine, signal.data[thing]) /obj/item/stock_parts/radio/receiver/buildable - max_health = null //Buildable variant may take damage + obj_max_health = null //Buildable variant may take damage part_flags = PART_FLAG_HAND_REMOVE material = /decl/material/solid/metal/steel \ No newline at end of file diff --git a/code/game/machinery/_machines_base/stock_parts/radio/stock_parts_radio.dm b/code/game/machinery/_machines_base/stock_parts/radio/stock_parts_radio.dm index e1a96719417..645421a441b 100644 --- a/code/game/machinery/_machines_base/stock_parts/radio/stock_parts_radio.dm +++ b/code/game/machinery/_machines_base/stock_parts/radio/stock_parts_radio.dm @@ -1,6 +1,6 @@ /obj/item/stock_parts/radio part_flags = PART_FLAG_QDEL - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE var/datum/radio_frequency/radio var/frequency var/id_tag diff --git a/code/game/machinery/_machines_base/stock_parts/radio/transmitter.dm b/code/game/machinery/_machines_base/stock_parts/radio/transmitter.dm index e9d4feec331..be30a9232e9 100644 --- a/code/game/machinery/_machines_base/stock_parts/radio/transmitter.dm +++ b/code/game/machinery/_machines_base/stock_parts/radio/transmitter.dm @@ -113,14 +113,14 @@ queue_transmit(dat) /obj/item/stock_parts/radio/transmitter/basic/buildable - max_health = null //Buildable variant may take damage + obj_max_health = null //Buildable variant may take damage part_flags = PART_FLAG_HAND_REMOVE name = "basic radio transmitter" desc = "A stock radio transmitter machine component. Can transmit updates regularly or on change." material = /decl/material/solid/metal/steel /obj/item/stock_parts/radio/transmitter/on_event/buildable - max_health = null //Buildable variant may take damage + obj_max_health = null //Buildable variant may take damage part_flags = PART_FLAG_HAND_REMOVE name = "event radio transmitter" desc = "A radio transmitter machine component which transmits when activated by an event." diff --git a/code/game/machinery/_machines_base/stock_parts/stock_parts_interface.dm b/code/game/machinery/_machines_base/stock_parts/stock_parts_interface.dm index b1aa3c32f90..7a9fe0cf2aa 100644 --- a/code/game/machinery/_machines_base/stock_parts/stock_parts_interface.dm +++ b/code/game/machinery/_machines_base/stock_parts/stock_parts_interface.dm @@ -6,7 +6,7 @@ material = /decl/material/solid/fiberglass base_type = /obj/item/stock_parts/console_screen part_flags = PART_FLAG_HAND_REMOVE - max_health = 20 + obj_max_health = 20 ignore_damage_types = list(ELECTROCUTE) // emp damage is annoying enough without destroying purely physical or mechanical components /obj/item/stock_parts/console_screen/on_refresh(obj/machinery/machine) diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm index 07ce4ee1cd5..2cae375724d 100644 --- a/code/game/machinery/atmoalter/canister.dm +++ b/code/game/machinery/atmoalter/canister.dm @@ -3,7 +3,7 @@ icon = 'icons/obj/atmos.dmi' icon_state = "yellow" density = TRUE - max_health = 100 + obj_max_health = 100 obj_flags = OBJ_FLAG_CONDUCTIBLE w_class = ITEM_SIZE_GARGANTUAN construct_state = /decl/machine_construction/pipe/welder diff --git a/code/game/machinery/deployable.dm b/code/game/machinery/deployable.dm index a83beb7a1cb..a1cc475b5f3 100644 --- a/code/game/machinery/deployable.dm +++ b/code/game/machinery/deployable.dm @@ -12,7 +12,7 @@ anchored = FALSE density = TRUE icon_state = "barrier0" - max_health = 100 + obj_max_health = 100 var/locked = 0.0 /obj/machinery/deployable/barrier/Initialize() @@ -38,10 +38,11 @@ return return else if(IS_WRENCH(W)) - if (src.health < src.max_health) - src.health = src.max_health - src.emagged = 0 - src.req_access = list(access_security) + var/current_max_health = get_max_health() + if (health < current_max_health) + health = current_max_health + emagged = 0 + req_access = list(access_security) visible_message("[user] repairs \the [src]!") return else if (src.emagged > 0) diff --git a/code/game/machinery/doors/_door.dm b/code/game/machinery/doors/_door.dm index c11d60b6718..29dac3798bd 100644 --- a/code/game/machinery/doors/_door.dm +++ b/code/game/machinery/doors/_door.dm @@ -14,7 +14,7 @@ construct_state = /decl/machine_construction/default/panel_closed/door uncreated_component_parts = null required_interaction_dexterity = DEXTERITY_SIMPLE_MACHINES - max_health = 300 + obj_max_health = 300 var/can_open_manually = TRUE @@ -92,7 +92,6 @@ if (turf_hand_priority) set_extension(src, /datum/extension/turf_hand, turf_hand_priority) - health = max_health #ifdef UNIT_TEST if(autoset_access && length(req_access)) PRINT_STACK_TRACE("A door with mapped access restrictions was set to autoinitialize access.") @@ -253,7 +252,8 @@ if(reason_broken & MACHINE_BROKEN_GENERIC) to_chat(user, "It looks like \the [src] is pretty busted. It's going to need more than just patching up now.") return TRUE - if(health >= max_health) + var/current_max_health = get_max_health() + if(health >= current_max_health) to_chat(user, "Nothing to fix!") return TRUE if(!density) @@ -261,7 +261,7 @@ return TRUE //figure out how much metal we need - var/amount_needed = (max_health - health) / DOOR_REPAIR_AMOUNT + var/amount_needed = (current_max_health - health) / DOOR_REPAIR_AMOUNT amount_needed = CEILING(amount_needed) var/obj/item/stack/stack = I @@ -293,7 +293,7 @@ playsound(src, 'sound/items/Welder.ogg', 100, 1) if(do_after(user, 5 * repairing.amount, src) && welder && welder.isOn()) to_chat(user, "You finish repairing the damage to \the [src].") - health = clamp(health, health + repairing.amount*DOOR_REPAIR_AMOUNT, max_health) + health = clamp(health, health + repairing.amount*DOOR_REPAIR_AMOUNT, get_max_health()) update_icon() qdel(repairing) repairing = null @@ -343,16 +343,17 @@ damage -= component_damage //Part of damage is soaked by our own health + var/current_max_health = get_max_health() var/initialhealth = health health = max(0, health - damage) if(health <= 0 && initialhealth > 0) visible_message(SPAN_WARNING("\The [src] breaks down!")) set_broken(TRUE) - else if(health < max_health / 4 && initialhealth >= max_health / 4) + else if(health < current_max_health / 4 && initialhealth >= current_max_health / 4) visible_message(SPAN_WARNING("\The [src] looks like it's about to break!")) - else if(health < max_health / 2 && initialhealth >= max_health / 2) + else if(health < current_max_health / 2 && initialhealth >= current_max_health / 2) visible_message(SPAN_WARNING("\The [src] looks seriously damaged!")) - else if(health < max_health * 3/4 && initialhealth >= max_health * 3/4) + else if(health < current_max_health * 3/4 && initialhealth >= current_max_health * 3/4) visible_message(SPAN_WARNING("\The [src] shows signs of damage!")) ..(component_damage, damtype) @@ -360,22 +361,25 @@ //How much damage should be passed to components inside even when door health is non zero /obj/machinery/door/proc/get_damage_leakthrough(var/damage, damtype=BRUTE) - if(health > 0.75 * max_health && damage < 10) + var/current_max_health = get_max_health() + if(health > 0.75 * current_max_health && damage < 10) return 0 - . = round((1 - health/max_health) * damage) + . = round((1 - health/current_max_health) * damage) /obj/machinery/door/examine(mob/user) . = ..() - if(src.health <= 0) + if(health <= 0) to_chat(user, "\The [src] is broken!") - else if(src.health < src.max_health / 4) - to_chat(user, "\The [src] looks like it's about to break!") - else if(src.health < src.max_health / 2) - to_chat(user, "\The [src] looks seriously damaged!") - else if(src.health < src.max_health * 3/4) - to_chat(user, "\The [src] shows signs of damage!") - else if(src.health < src.max_health && get_dist(src, user) <= 1) - to_chat(user, "\The [src] has some minor scuffing.") + else + var/current_max_health = get_max_health() + if(health < current_max_health / 4) + to_chat(user, "\The [src] looks like it's about to break!") + else if(health < current_max_health / 2) + to_chat(user, "\The [src] looks seriously damaged!") + else if(health < current_max_health * 3/4) + to_chat(user, "\The [src] shows signs of damage!") + else if(health < current_max_health && get_dist(src, user) <= 1) + to_chat(user, "\The [src] has some minor scuffing.") var/mob/living/carbon/human/H = user if (emagged && istype(H) && (H.skill_check(SKILL_COMPUTER, SKILL_ADEPT) || H.skill_check(SKILL_ELECTRICAL, SKILL_ADEPT))) @@ -501,7 +505,7 @@ dismantle(TRUE) /obj/machinery/door/proc/CheckPenetration(var/base_chance, var/damage) - . = damage/max_health*180 + . = damage/get_max_health()*180 if(glass) . *= 2 . = round(.) diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 63a74398ed3..45eb79c2c93 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -400,7 +400,7 @@ About the new airlock wires panel: if(stat & BROKEN) damage_overlay = sparks_broken_file - else if(health < max_health * 3/4) + else if(health < get_max_health() * 3/4) damage_overlay = sparks_damaged_file if(welded) @@ -767,7 +767,7 @@ About the new airlock wires panel: return TRUE else if(!repairing) // Add some minor damage as evidence of forcing. - if(health >= max_health) + if(health >= get_max_health()) take_damage(1) if(arePowerSystemsOn()) to_chat(user, SPAN_WARNING("The airlock's motors resist your efforts to force it.")) @@ -1027,7 +1027,7 @@ About the new airlock wires panel: glass = TRUE set_opacity(0) hitsound = 'sound/effects/Glasshit.ogg' - max_health = 300 + obj_max_health = 300 explosion_resistance = 5 else door_color = mat.color diff --git a/code/game/machinery/doors/airlock_subtypes.dm b/code/game/machinery/doors/airlock_subtypes.dm index 179b0d35d2c..fa9a5ed7730 100644 --- a/code/game/machinery/doors/airlock_subtypes.dm +++ b/code/game/machinery/doors/airlock_subtypes.dm @@ -67,7 +67,7 @@ name = "Glass Airlock" icon_state = "preview_glass" hitsound = 'sound/effects/Glasshit.ogg' - max_health = 300 + obj_max_health = 300 explosion_resistance = 5 opacity = FALSE glass = TRUE @@ -193,7 +193,7 @@ opacity = FALSE /obj/machinery/door/airlock/external/glass - max_health = 300 + obj_max_health = 300 explosion_resistance = 5 opacity = FALSE glass = TRUE diff --git a/code/game/machinery/doors/blast_door.dm b/code/game/machinery/doors/blast_door.dm index 816648c4dfc..f016e229e4f 100644 --- a/code/game/machinery/doors/blast_door.dm +++ b/code/game/machinery/doors/blast_door.dm @@ -158,7 +158,7 @@ to_chat(user, "[src]'s motors resist your effort.") return if(istype(C, /obj/item/stack/material) && C.get_material_type() == /decl/material/solid/metal/plasteel) - var/amt = CEILING((max_health - health)/150) + var/amt = CEILING((get_max_health() - health)/150) if(!amt) to_chat(user, "\The [src] is already fully functional.") return @@ -209,7 +209,7 @@ // Parameters: None // Description: Fully repairs the blast door. /obj/machinery/door/blast/proc/repair() - health = max_health + health = get_max_health() set_broken(FALSE) queue_icon_update() @@ -312,7 +312,7 @@ icon_state_closed_broken = "closed_broken" min_force = 30 - max_health = 1000 + obj_max_health = 1000 block_air_zones = 1 var/icon_lower_door_open = "open_bottom" @@ -354,7 +354,7 @@ open_sound = 'sound/machines/shutters_open.ogg' close_sound = 'sound/machines/shutters_close.ogg' min_force = 15 - max_health = 500 + obj_max_health = 500 explosion_resistance = 10 pry_mod = 0.55 frame_type = /obj/structure/door_assembly/blast/shutter diff --git a/code/game/machinery/doors/braces.dm b/code/game/machinery/doors/braces.dm index 64de3129086..1c88f28dc8d 100644 --- a/code/game/machinery/doors/braces.dm +++ b/code/game/machinery/doors/braces.dm @@ -102,7 +102,7 @@ return if(C.weld(0,user)) playsound(src, 'sound/items/Welder.ogg', 100, 1) - health = min(health + rand(20,30), max_health) + health = min(health + rand(20,30), get_max_health()) if(!is_damaged()) to_chat(user, "You repair some dents on \the [src]. It is in perfect condition now.") else diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index 5cf073d173f..6348cee1eec 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -5,7 +5,7 @@ icon_state = "left" min_force = 4 hitsound = 'sound/effects/Glasshit.ogg' - max_health = 150 //If you change this, consiter changing ../door/window/brigdoor/ health at the bottom of this .dm file + obj_max_health = 150 //If you change this, consiter changing ../door/window/brigdoor/ health at the bottom of this .dm file health = 150 visible = 0.0 use_power = POWER_USE_OFF @@ -213,7 +213,7 @@ icon = 'icons/obj/doors/windoor.dmi' icon_state = "leftsecure" base_state = "leftsecure" - max_health = 300 + obj_max_health = 300 health = 300.0 //Stronger doors for prison (regular window door health is 150) pry_mod = 0.65 diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index 4ee74cd3756..8966bd3e2ac 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -17,7 +17,7 @@ idle_power_usage = 50 //when inactive, this turret takes up constant 50 Equipment power active_power_usage = 300 //when active, this turret takes up constant 300 Equipment power power_channel = EQUIP //drains power from the EQUIPMENT channel - max_health = 80 + obj_max_health = 80 var/raised = 0 //if the turret cover is "open" and the turret is raised var/raising= 0 //if the turret is currently opening or closing its cover @@ -79,7 +79,7 @@ ailock = 0 malf_upgraded = 1 to_chat(user, "\The [src] has been upgraded. It's damage and rate of fire has been increased. Auto-regeneration system has been enabled. Power usage has increased.") - max_health = round(initial(max_health) * 1.5) + obj_max_health = round(initial(obj_max_health) * 1.5) shot_delay = round(initial(shot_delay) / 2) auto_repair = 1 change_power_consumption(round(initial(active_power_usage) * 5), POWER_USE_ACTIVE) @@ -414,9 +414,10 @@ var/global/list/turret_icons if(!tryToShootAt(secondarytargets)) // if no valid targets, go for secondary targets popDown() // no valid targets, close the cover - if(auto_repair && (health < max_health)) + var/current_max_health = get_max_health() + if(auto_repair && (health < current_max_health)) use_power_oneoff(20000) - health = min(health+1, max_health) // 1HP for 20kJ + health = min(health+1, current_max_health) // 1HP for 20kJ /obj/machinery/porta_turret/proc/assess_and_assign(var/mob/living/L, var/list/targets, var/list/secondarytargets) switch(assess_living(L)) diff --git a/code/game/objects/effects/decals/posters/_poster.dm b/code/game/objects/effects/decals/posters/_poster.dm index c5e5768301b..1574f21c9de 100644 --- a/code/game/objects/effects/decals/posters/_poster.dm +++ b/code/game/objects/effects/decals/posters/_poster.dm @@ -9,7 +9,7 @@ anchored = TRUE directional_offset = @'{"NORTH":{"y":32}, "SOUTH":{"y":-32}, "WEST":{"x":32}, "EAST":{"x":-32}}' material = /decl/material/solid/organic/paper - max_health = 10 + obj_max_health = 10 parts_type = /obj/item/poster parts_amount = 1 diff --git a/code/game/objects/effects/spiders.dm b/code/game/objects/effects/spiders.dm index 0952585216f..d1899f315d9 100644 --- a/code/game/objects/effects/spiders.dm +++ b/code/game/objects/effects/spiders.dm @@ -5,7 +5,7 @@ icon = 'icons/effects/effects.dmi' anchored = TRUE density = FALSE - max_health = 15 + obj_max_health = 15 //similar to weeds, but only barfed out by nurses manually /obj/effect/spider/explosion_act(severity) @@ -145,7 +145,7 @@ icon_state = "lesser" anchored = FALSE layer = BELOW_OBJ_LAYER - max_health = 3 + obj_max_health = 3 var/mob/living/simple_animal/hostile/giant_spider/greater_form var/last_itch = 0 var/amount_grown = -1 @@ -336,7 +336,7 @@ name = "cocoon" desc = "Something wrapped in silky spider web." icon_state = "cocoon1" - max_health = 60 + obj_max_health = 60 /obj/effect/spider/cocoon/Initialize() . = ..() diff --git a/code/game/objects/item.dm b/code/game/objects/item.dm index eeac86ed586..17a54989c19 100644 --- a/code/game/objects/item.dm +++ b/code/game/objects/item.dm @@ -107,7 +107,7 @@ /obj/item/Initialize(var/ml, var/material_key) if(isnull(health)) - health = max_health //Make sure to propagate max_health to health var before material setup, for consistency + health = obj_max_health //Make sure to propagate obj_max_health to health var before material setup, for consistency if(!ispath(material_key, /decl/material)) material_key = material if(material_key) diff --git a/code/game/objects/item_damage.dm b/code/game/objects/item_damage.dm index fa8caf7822b..e47a7f80fe1 100644 --- a/code/game/objects/item_damage.dm +++ b/code/game/objects/item_damage.dm @@ -19,7 +19,7 @@ //Apply damage damage = min(health, damage) - health = clamp(health - damage, 0, max_health) + health = clamp(health - damage, 0, get_max_health()) check_health(damage, damage_type, damage_flags) return damage @@ -49,7 +49,7 @@ return (mult * (4 - severity)) + (severity != 1? rand(-(mult / severity), (mult / severity)) : 0 ) /obj/item/proc/explosion_severity_damage_multiplier() - return CEILING(max_health / 3) + return CEILING(get_max_health() / 3) /obj/item/is_burnable() return simulated diff --git a/code/game/objects/item_materials.dm b/code/game/objects/item_materials.dm index e9b765846c2..0641b90cd21 100644 --- a/code/game/objects/item_materials.dm +++ b/code/game/objects/item_materials.dm @@ -88,14 +88,14 @@ material = GET_DECL(new_material) if(istype(material)) //Only set the health if health is null. Some things define their own health value. - if(isnull(max_health)) - max_health = round(material_health_multiplier * material.integrity, 0.01) - if(max_health < 1) - //Make sure to warn us if the values we set make the max_health be under 1 - log_warning("The 'max_health' of '[src]'([type]) made out of '[material]' was calculated as [material_health_multiplier] * [material.integrity] == [max_health], which is smaller than 1.") + if(isnull(obj_max_health)) + obj_max_health = round(material_health_multiplier * material.integrity, 0.01) + if(obj_max_health < 1) + //Make sure to warn us if the values we set make the obj_max_health be under 1 + log_warning("The 'obj_max_health' of '[src]'([type]) made out of '[material]' was calculated as [material_health_multiplier] * [material.integrity] == [obj_max_health], which is smaller than 1.") if(isnull(health)) //only set health if we didn't specify one already, so damaged objects on spawn and etc can be a thing - health = max_health + health = get_max_health() if(material.products_need_process()) START_PROCESSING(SSobj, src) diff --git a/code/game/objects/items/blackout.dm b/code/game/objects/items/blackout.dm index bdbb311597d..f781feed9d0 100644 --- a/code/game/objects/items/blackout.dm +++ b/code/game/objects/items/blackout.dm @@ -12,7 +12,7 @@ desc = "A complicated eletronic device of unknown purpose" icon = 'icons/obj/items/blackout.dmi' icon_state = "device_blackout-off" - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE var/severity = 2 var/shots = 1 var/last_use = 0 diff --git a/code/game/objects/items/devices/uplink.dm b/code/game/objects/items/devices/uplink.dm index 4ccd921e0cb..43e881aa1ec 100644 --- a/code/game/objects/items/devices/uplink.dm +++ b/code/game/objects/items/devices/uplink.dm @@ -13,7 +13,7 @@ /obj/item/uplink name = "hidden uplink" desc = "There is something wrong if you're examining this." - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE material = /decl/material/solid/organic/plastic matter = list( /decl/material/solid/metal/copper = MATTER_AMOUNT_REINFORCEMENT, diff --git a/code/game/objects/items/plunger.dm b/code/game/objects/items/plunger.dm index b3d02794689..bb671a5942d 100644 --- a/code/game/objects/items/plunger.dm +++ b/code/game/objects/items/plunger.dm @@ -20,4 +20,4 @@ return ..() /obj/item/plunger/unbreakable - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE diff --git a/code/game/objects/items/robot/robot_items.dm b/code/game/objects/items/robot/robot_items.dm index 373c8592f4b..bb425584457 100644 --- a/code/game/objects/items/robot/robot_items.dm +++ b/code/game/objects/items/robot/robot_items.dm @@ -1,6 +1,6 @@ //This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32 /obj/item/borg - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE /********************************************************************** Cyborg Spec Items diff --git a/code/game/objects/items/stacks/rods.dm b/code/game/objects/items/stacks/rods.dm index 8a768f4b5e1..50d8d536af3 100644 --- a/code/game/objects/items/stacks/rods.dm +++ b/code/game/objects/items/stacks/rods.dm @@ -38,7 +38,7 @@ matter = null uses_charge = 1 charge_costs = list(500) - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE is_spawnable_type = FALSE /obj/item/stack/material/rods/Initialize() diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index 74c88653b21..d5ec7213f9c 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -12,7 +12,7 @@ /obj/item/stack gender = PLURAL origin_tech = @'{"materials":1}' - max_health = 32 //Stacks should take damage even if no materials + obj_max_health = 32 //Stacks should take damage even if no materials /// A copy of initial matter list when this atom initialized. Stack matter should always assume a single tile. var/list/matter_per_piece var/singular_name diff --git a/code/game/objects/items/stacks/tiles/tile_types.dm b/code/game/objects/items/stacks/tiles/tile_types.dm index a0643d33e1e..6fc91d5ec1d 100644 --- a/code/game/objects/items/stacks/tiles/tile_types.dm +++ b/code/game/objects/items/stacks/tiles/tile_types.dm @@ -72,7 +72,7 @@ charge_costs = list(250) stack_merge_type = /obj/item/stack/tile/wood build_type = /obj/item/stack/tile/wood - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE is_spawnable_type = FALSE /obj/item/stack/tile/mahogany @@ -225,7 +225,7 @@ charge_costs = list(250) stack_merge_type = /obj/item/stack/tile/floor build_type = /obj/item/stack/tile/floor - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE is_spawnable_type = FALSE /obj/item/stack/tile/roof/cyborg @@ -237,7 +237,7 @@ charge_costs = list(500) stack_merge_type = /obj/item/stack/tile/roof build_type = /obj/item/stack/tile/roof - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE is_spawnable_type = FALSE /obj/item/stack/tile/linoleum diff --git a/code/game/objects/items/weapons/defib.dm b/code/game/objects/items/weapons/defib.dm index 7aef0369e8a..a128fd33233 100644 --- a/code/game/objects/items/weapons/defib.dm +++ b/code/game/objects/items/weapons/defib.dm @@ -194,7 +194,7 @@ w_class = ITEM_SIZE_LARGE material = /decl/material/solid/organic/plastic matter = list(/decl/material/solid/metal/copper = MATTER_AMOUNT_SECONDARY, /decl/material/solid/metal/steel = MATTER_AMOUNT_SECONDARY) - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE var/safety = 1 //if you can zap people with the paddles on harm mode var/combat = 0 //If it can be used to revive people wearing thick clothing (e.g. spacesuits) diff --git a/code/game/objects/items/weapons/handcuffs.dm b/code/game/objects/items/weapons/handcuffs.dm index 526ea8ddd1c..f4a6b370f83 100644 --- a/code/game/objects/items/weapons/handcuffs.dm +++ b/code/game/objects/items/weapons/handcuffs.dm @@ -12,7 +12,7 @@ throw_range = 5 origin_tech = @'{"materials":1}' material = /decl/material/solid/metal/steel - max_health = ITEM_HEALTH_NO_DAMAGE //#TODO: Once we can work out something different for handling cuff breakout, change this. Since it relies on cuffs health to tell if you can actually breakout. + obj_max_health = ITEM_HEALTH_NO_DAMAGE //#TODO: Once we can work out something different for handling cuff breakout, change this. Since it relies on cuffs health to tell if you can actually breakout. var/elastic var/dispenser = 0 var/breakouttime = 2 MINUTES //Deciseconds = 120s = 2 minutes @@ -32,7 +32,7 @@ /obj/item/handcuffs/examine(mob/user) . = ..() - if (health > 0 && max_health > 0) + if (health > 0 && get_max_health() > 0) var display = get_percent_health() if (display > 66) return @@ -140,7 +140,7 @@ var/global/last_chew = 0 //#FIXME: Its funny how only one person in the world ca cuff_sound = 'sound/weapons/cablecuff.ogg' cuff_type = "cable restraints" elastic = 1 - max_health = 75 + obj_max_health = 75 material = /decl/material/solid/organic/plastic /obj/item/handcuffs/cable/red @@ -178,5 +178,5 @@ var/global/last_chew = 0 //#FIXME: Its funny how only one person in the world ca icon = 'icons/obj/bureaucracy.dmi' breakouttime = 200 cuff_type = "duct tape" - max_health = 50 + obj_max_health = 50 material = /decl/material/solid/organic/plastic \ No newline at end of file diff --git a/code/game/objects/items/weapons/material/misc.dm b/code/game/objects/items/weapons/material/misc.dm index d31b6c2d029..3d2d916c153 100644 --- a/code/game/objects/items/weapons/material/misc.dm +++ b/code/game/objects/items/weapons/material/misc.dm @@ -68,7 +68,7 @@ set_extension(src, /datum/extension/tool, list(TOOL_HATCHET = TOOL_QUALITY_DEFAULT)) /obj/item/hatchet/unbreakable - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE /obj/item/hatchet/machete name = "machete" @@ -94,7 +94,7 @@ . = ..() /obj/item/hatchet/machete/unbreakable - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE /obj/item/hatchet/machete/steel name = "fabricated machete" @@ -122,7 +122,7 @@ material_alteration = MAT_FLAG_ALTERATION_COLOR | MAT_FLAG_ALTERATION_NAME /obj/item/minihoe/unbreakable - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE /obj/item/scythe name = "scythe" diff --git a/code/game/objects/items/weapons/nuclear_cylinder.dm b/code/game/objects/items/weapons/nuclear_cylinder.dm index 68ce244b014..a3f492c017a 100644 --- a/code/game/objects/items/weapons/nuclear_cylinder.dm +++ b/code/game/objects/items/weapons/nuclear_cylinder.dm @@ -11,4 +11,4 @@ throw_speed = 2 throw_range = 4 origin_tech = @'{"materials":3,"engineering":4}' - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE diff --git a/code/game/objects/items/weapons/soap.dm b/code/game/objects/items/weapons/soap.dm index 8727b01e6e8..5319653ca3e 100644 --- a/code/game/objects/items/weapons/soap.dm +++ b/code/game/objects/items/weapons/soap.dm @@ -13,7 +13,7 @@ throw_speed = 4 throw_range = 20 material = /decl/material/liquid/cleaner/soap - max_health = 5 + obj_max_health = 5 var/key_data var/list/valid_colors = list(COLOR_GREEN_GRAY, COLOR_RED_GRAY, COLOR_BLUE_GRAY, COLOR_BROWN, COLOR_PALE_PINK, COLOR_PALE_BTL_GREEN, COLOR_OFF_WHITE, COLOR_GRAY40, COLOR_GOLD) diff --git a/code/game/objects/items/weapons/storage/internal.dm b/code/game/objects/items/weapons/storage/internal.dm index 63702e3fbf9..42c3dc340a3 100644 --- a/code/game/objects/items/weapons/storage/internal.dm +++ b/code/game/objects/items/weapons/storage/internal.dm @@ -1,7 +1,7 @@ //A storage item intended to be used by other items to provide storage functionality. //Types that use this should consider overriding emp_act() and hear_talk(), unless they shield their contents somehow. /obj/item/storage/internal - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE abstract_type = /obj/item/storage/internal is_spawnable_type = FALSE var/obj/item/master_item diff --git a/code/game/objects/items/weapons/tape.dm b/code/game/objects/items/weapons/tape.dm index c969810d8b6..2cd8d334fec 100644 --- a/code/game/objects/items/weapons/tape.dm +++ b/code/game/objects/items/weapons/tape.dm @@ -12,7 +12,7 @@ w_class = ITEM_SIZE_SMALL material = /decl/material/solid/organic/plastic health = 10 - max_health = 10 + obj_max_health = 10 /obj/item/stack/tape_roll/can_split() return FALSE diff --git a/code/game/objects/items/weapons/tools/weldingtool.dm b/code/game/objects/items/weapons/tools/weldingtool.dm index 3143c721fc8..9427971c92c 100644 --- a/code/game/objects/items/weapons/tools/weldingtool.dm +++ b/code/game/objects/items/weapons/tools/weldingtool.dm @@ -403,7 +403,7 @@ volume = 20 show_reagent_name = TRUE health = 40 - max_health = 40 + obj_max_health = 40 material = /decl/material/solid/metal/steel var/can_refuel = TRUE var/size_in_use = ITEM_SIZE_NORMAL diff --git a/code/game/objects/items/weapons/weaponry.dm b/code/game/objects/items/weapons/weaponry.dm index 7b4aa541c86..acdafa26fcf 100644 --- a/code/game/objects/items/weapons/weaponry.dm +++ b/code/game/objects/items/weapons/weaponry.dm @@ -12,7 +12,7 @@ throwforce = 7 w_class = ITEM_SIZE_NORMAL material = /decl/material/solid/glass - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE /obj/item/nullrod/attack(mob/M, mob/living/user) //Paste from old-code to decult with a null rod. admin_attack_log(user, M, "Attacked using \a [src]", "Was attacked with \a [src]", "used \a [src] to attack") @@ -71,7 +71,7 @@ icon_state = "energynet" throwforce = 0 force = 0 - max_health = 100 + obj_max_health = 100 var/net_type = /obj/effect/energy_net /obj/item/energy_net/safari @@ -117,7 +117,7 @@ anchored = TRUE can_buckle = 0 //no manual buckling or unbuckling - max_health = 25 + obj_max_health = 25 var/countdown = 15 var/temporary = 1 var/mob/living/carbon/captured = null @@ -129,7 +129,7 @@ desc = "An energized net meant to subdue animals." anchored = FALSE - max_health = 5 + obj_max_health = 5 temporary = 0 min_free_time = 5 max_free_time = 10 diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index 145e996d817..b99d5ac1001 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -18,21 +18,23 @@ var/holographic = 0 //if the obj is a holographic object spawned by the holodeck var/tmp/directional_offset ///JSON list of directions to x,y offsets to be applied to the object depending on its direction EX: @'{"NORTH":{"x":12,"y":5}, "EAST":{"x":10,"y":50}}' - ///The current health of the obj. Leave to null, unless you want the object to start at a different health than max_health. + ///The current health of the obj. Leave to null, unless you want the object to start at a different health than obj_max_health. var/health ///The maximum health that the object can have. If set to ITEM_HEALTH_NO_DAMAGE, the object won't take any damage. - var/max_health = ITEM_HEALTH_NO_DAMAGE + var/obj_max_health = ITEM_HEALTH_NO_DAMAGE /obj/Initialize(mapload) - //Health should be set to max_health only if it's null. - if(isnull(health)) - health = max_health . = ..() temperature_coefficient = isnull(temperature_coefficient) ? clamp(MAX_TEMPERATURE_COEFFICIENT - w_class, MIN_TEMPERATURE_COEFFICIENT, MAX_TEMPERATURE_COEFFICIENT) : temperature_coefficient create_matter() //Only apply directional offsets if the mappers haven't set any offsets already if(!pixel_x && !pixel_y && !pixel_w && !pixel_z) update_directional_offset() + if(isnull(health)) + health = get_max_health() + +/obj/proc/get_max_health() + return obj_max_health /obj/hitby(atom/movable/AM, var/datum/thrownthing/TT) ..() diff --git a/code/game/objects/objs_damage.dm b/code/game/objects/objs_damage.dm index b576ef889c0..06c4752aebe 100644 --- a/code/game/objects/objs_damage.dm +++ b/code/game/objects/objs_damage.dm @@ -2,24 +2,24 @@ Returns whether this object is damaged. */ /obj/proc/is_damaged() - return can_take_damage() && (health < max_health) + return can_take_damage() && (health < get_max_health()) /** Returns TRUE if this object can take damage. */ /obj/proc/can_take_damage() - return (health != ITEM_HEALTH_NO_DAMAGE) && (max_health != ITEM_HEALTH_NO_DAMAGE) + return (health != ITEM_HEALTH_NO_DAMAGE) && (get_max_health() != ITEM_HEALTH_NO_DAMAGE) /** Returns the percentage of health remaining for this object. */ /obj/proc/get_percent_health() - return can_take_damage()? round((health * 100)/max_health, HEALTH_ROUNDING) : 100 + return can_take_damage()? round((health * 100)/get_max_health(), HEALTH_ROUNDING) : 100 /** Returns the percentage of damage done to this object. */ /obj/proc/get_percent_damages() - //Clamp from 0 to 100 so health values larger than max_health don't return unhelpful numbers + //Clamp from 0 to 100 so health values larger than max health don't return unhelpful numbers return clamp(100 - get_percent_health(), 0, 100) diff --git a/code/game/objects/structures/__structure.dm b/code/game/objects/structures/__structure.dm index 71c12758222..9849d5d6d26 100644 --- a/code/game/objects/structures/__structure.dm +++ b/code/game/objects/structures/__structure.dm @@ -3,7 +3,7 @@ w_class = ITEM_SIZE_STRUCTURE layer = STRUCTURE_LAYER abstract_type = /obj/structure - max_health = 50 + obj_max_health = 50 var/structure_flags var/last_damage_message @@ -98,9 +98,9 @@ damage *= STRUCTURE_BRITTLE_MATERIAL_DAMAGE_MULTIPLIER playsound(loc, hitsound, 75, 1) - health = clamp(health - damage, 0, max_health) - - show_damage_message(health/max_health) + var/current_max_health = get_max_health() + health = clamp(health - damage, 0, current_max_health) + show_damage_message(health/current_max_health) if(health == 0) physically_destroyed() @@ -217,7 +217,7 @@ take_damage(rand(5, 15)) /obj/structure/proc/can_repair(var/mob/user) - if(health >= max_health) + if(health >= get_max_health()) to_chat(user, SPAN_NOTICE("\The [src] does not need repairs.")) return FALSE return TRUE diff --git a/code/game/objects/structures/_structure_construction.dm b/code/game/objects/structures/_structure_construction.dm index c38aa84cab5..0c1beb2b115 100644 --- a/code/game/objects/structures/_structure_construction.dm +++ b/code/game/objects/structures/_structure_construction.dm @@ -103,14 +103,15 @@ . = istype(tool, /obj/item/stack/material) && tool.get_material_type() == get_material_type() /obj/structure/proc/handle_repair(mob/user, obj/item/tool) + var/current_max_health = get_max_health() var/obj/item/stack/stack = tool - var/amount_needed = CEILING((max_health - health)/DOOR_REPAIR_AMOUNT) + var/amount_needed = CEILING((current_max_health - health)/DOOR_REPAIR_AMOUNT) var/used = min(amount_needed,stack.amount) if(used) to_chat(user, SPAN_NOTICE("You fit [stack.get_string_for_amount(used)] to damaged areas of \the [src].")) stack.use(used) last_damage_message = null - health = clamp(health, health + used*DOOR_REPAIR_AMOUNT, max_health) + health = clamp(health, health + used*DOOR_REPAIR_AMOUNT, current_max_health) /obj/structure/attackby(obj/item/O, mob/user) diff --git a/code/game/objects/structures/_structure_materials.dm b/code/game/objects/structures/_structure_materials.dm index f887575361f..8cd94a842d6 100644 --- a/code/game/objects/structures/_structure_materials.dm +++ b/code/game/objects/structures/_structure_materials.dm @@ -22,14 +22,15 @@ else set_opacity(initial(opacity)) hitsound = material?.hitsound || initial(hitsound) - if(max_health != -1) - max_health = initial(max_health) + material?.integrity * get_material_health_modifier() + var/current_max_health = get_max_health() + if(current_max_health != -1) + current_max_health = initial(current_max_health) + material?.integrity * get_material_health_modifier() if(reinf_material) var/bonus_health = reinf_material.integrity * get_material_health_modifier() - max_health += bonus_health + current_max_health += bonus_health if(!keep_health) health += bonus_health - health = keep_health ? min(health, max_health) : max_health + health = keep_health ? min(health, current_max_health) : current_max_health update_icon() /obj/structure/proc/update_material_name(var/override_name) diff --git a/code/game/objects/structures/banners.dm b/code/game/objects/structures/banners.dm index b432310a0cc..ba03cc50401 100644 --- a/code/game/objects/structures/banners.dm +++ b/code/game/objects/structures/banners.dm @@ -12,7 +12,7 @@ obj_flags = OBJ_FLAG_ANCHORABLE tool_interaction_flags = (TOOL_INTERACTION_ANCHOR | TOOL_INTERACTION_DECONSTRUCT) material_alteration = MAT_FLAG_ALTERATION_NAME | MAT_FLAG_ALTERATION_COLOR - max_health = 50 + obj_max_health = 50 /// Reference to any banner currently hung on the frame. var/obj/item/banner/banner @@ -84,7 +84,7 @@ icon = 'icons/obj/banner.dmi' icon_state = "banner" material = /decl/material/solid/organic/cloth - max_health = 20 + obj_max_health = 20 material_alteration = MAT_FLAG_ALTERATION_COLOR | MAT_FLAG_ALTERATION_NAME w_class = ITEM_SIZE_NORMAL var/hung_desc = "The banner is rather plain, with no markings." diff --git a/code/game/objects/structures/barricade.dm b/code/game/objects/structures/barricade.dm index a7709ec0961..ce5c34a546b 100644 --- a/code/game/objects/structures/barricade.dm +++ b/code/game/objects/structures/barricade.dm @@ -8,7 +8,7 @@ atom_flags = ATOM_FLAG_CLIMBABLE layer = ABOVE_WINDOW_LAYER material_alteration = MAT_FLAG_ALTERATION_ALL - max_health = 100 + obj_max_health = 100 var/spike_damage //how badly it smarts when you run into this like a rube var/list/poke_description = list("gored", "spiked", "speared", "stuck", "stabbed") diff --git a/code/game/objects/structures/crates_lockers/closets/__closet.dm b/code/game/objects/structures/crates_lockers/closets/__closet.dm index 892a16828ed..d9e4011ec13 100644 --- a/code/game/objects/structures/crates_lockers/closets/__closet.dm +++ b/code/game/objects/structures/crates_lockers/closets/__closet.dm @@ -6,7 +6,7 @@ var/global/list/closets = list() icon = 'icons/obj/closets/bases/closet.dmi' icon_state = "base" density = TRUE - max_health = 100 + obj_max_health = 100 material = /decl/material/solid/metal/steel tool_interaction_flags = TOOL_INTERACTION_ANCHOR diff --git a/code/game/objects/structures/defensive_barrier.dm b/code/game/objects/structures/defensive_barrier.dm index d28141302bc..d367138da17 100644 --- a/code/game/objects/structures/defensive_barrier.dm +++ b/code/game/objects/structures/defensive_barrier.dm @@ -10,7 +10,7 @@ can_buckle = TRUE material = /decl/material/solid/metal/steel material_alteration = MAT_FLAG_ALTERATION_DESC | MAT_FLAG_ALTERATION_NAME - max_health = 200 + obj_max_health = 200 var/secured /obj/structure/defensive_barrier/Initialize() @@ -91,7 +91,7 @@ var/obj/item/defensive_barrier/B = new(get_turf(user), material?.type) playsound(src, 'sound/items/Deconstruct.ogg', 100, 1) B.stored_health = health - B.stored_max_health = max_health + B.stored_max_health = get_max_health() B.add_fingerprint(user) qdel(src) return TRUE diff --git a/code/game/objects/structures/displaycase.dm b/code/game/objects/structures/displaycase.dm index e5ab45af656..2bae68bed89 100644 --- a/code/game/objects/structures/displaycase.dm +++ b/code/game/objects/structures/displaycase.dm @@ -6,7 +6,7 @@ density = TRUE anchored = TRUE alpha = 150 - max_health = 100 + obj_max_health = 100 hitsound = 'sound/effects/Glasshit.ogg' req_access = null material = /decl/material/solid/glass diff --git a/code/game/objects/structures/doors/_door.dm b/code/game/objects/structures/doors/_door.dm index fd23d25aec6..38715ce1d77 100644 --- a/code/game/objects/structures/doors/_door.dm +++ b/code/game/objects/structures/doors/_door.dm @@ -4,7 +4,7 @@ icon_state = "metal" hitsound = 'sound/weapons/genhit.ogg' material_alteration = MAT_FLAG_ALTERATION_NAME | MAT_FLAG_ALTERATION_DESC | MAT_FLAG_ALTERATION_COLOR - max_health = 50 + obj_max_health = 50 density = TRUE anchored = TRUE opacity = TRUE diff --git a/code/game/objects/structures/fishtanks.dm b/code/game/objects/structures/fishtanks.dm index 99236832272..f92d4772004 100644 --- a/code/game/objects/structures/fishtanks.dm +++ b/code/game/objects/structures/fishtanks.dm @@ -24,7 +24,7 @@ var/global/list/fishtank_cache = list() density = TRUE atom_flags = ATOM_FLAG_CHECKS_BORDER | ATOM_FLAG_CLIMBABLE mob_offset = TRUE - max_health = 50 + obj_max_health = 50 var/deleting var/fill_type diff --git a/code/game/objects/structures/girders.dm b/code/game/objects/structures/girders.dm index c95d6d96d30..a059e8efdad 100644 --- a/code/game/objects/structures/girders.dm +++ b/code/game/objects/structures/girders.dm @@ -8,7 +8,7 @@ obj_flags = OBJ_FLAG_MOVES_UNSUPPORTED material_alteration = MAT_FLAG_ALTERATION_NAME | MAT_FLAG_ALTERATION_COLOR tool_interaction_flags = (TOOL_INTERACTION_ANCHOR | TOOL_INTERACTION_DECONSTRUCT) - max_health = 100 + obj_max_health = 100 parts_amount = 2 parts_type = /obj/item/stack/material/strut @@ -196,7 +196,7 @@ /obj/structure/girder/cult icon= 'icons/obj/cult.dmi' icon_state= "cultgirder" - max_health = 150 + obj_max_health = 150 cover = 70 /obj/structure/girder/cult/dismantle() diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index 08bfd215d85..55c2314517e 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -16,7 +16,7 @@ handle_generic_blending = TRUE material_alteration = MAT_FLAG_ALTERATION_COLOR | MAT_FLAG_ALTERATION_NAME - max_health = 20 + obj_max_health = 20 var/destroyed = 0 var/list/connections diff --git a/code/game/objects/structures/inflatable.dm b/code/game/objects/structures/inflatable.dm index 7b710028860..79fb361402b 100644 --- a/code/game/objects/structures/inflatable.dm +++ b/code/game/objects/structures/inflatable.dm @@ -41,7 +41,7 @@ opacity = FALSE icon = 'icons/obj/structures/inflatable.dmi' icon_state = "wall" - max_health = 20 + obj_max_health = 20 hitsound = 'sound/effects/Glasshit.ogg' atmos_canpass = CANPASS_DENSITY material = /decl/material/solid/organic/plastic @@ -120,7 +120,7 @@ deflate(TRUE) /obj/structure/inflatable/can_repair_with(obj/item/tool) - . = istype(tool, /obj/item/stack/tape_roll/duct_tape) && (health < max_health) + . = istype(tool, /obj/item/stack/tape_roll/duct_tape) && (health < get_max_health()) /obj/structure/inflatable/handle_repair(mob/user, obj/item/tool) var/obj/item/stack/tape_roll/duct_tape/T = tool @@ -134,7 +134,7 @@ playsound(src, 'sound/effects/tape.ogg', 50, TRUE) last_damage_message = null to_chat(user, SPAN_NOTICE("You tape up some of the damage to \the [src].")) - health = clamp(health + 3, 0, max_health) + health = clamp(health + 3, 0, get_max_health()) taped = TRUE /obj/structure/inflatable/attackby(obj/item/W, mob/user) diff --git a/code/game/objects/structures/railing.dm b/code/game/objects/structures/railing.dm index 69a056f2d2d..c10f0426947 100644 --- a/code/game/objects/structures/railing.dm +++ b/code/game/objects/structures/railing.dm @@ -12,7 +12,7 @@ obj_flags = OBJ_FLAG_ROTATABLE | OBJ_FLAG_MOVES_UNSUPPORTED material = DEFAULT_FURNITURE_MATERIAL material_alteration = MAT_FLAG_ALTERATION_ALL - max_health = 100 + obj_max_health = 100 parts_amount = 2 parts_type = /obj/item/stack/material/strut @@ -233,15 +233,16 @@ if(IS_WELDER(W)) var/obj/item/weldingtool/F = W if(F.isOn()) - if(health >= max_health) + var/current_max_health = get_max_health() + if(health >= current_max_health) to_chat(user, "\The [src] does not need repairs.") return playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) if(do_after(user, 20, src)) - if(health >= max_health) + if(health >= current_max_health) return user.visible_message("\The [user] repairs some damage to \the [src].", "You repair some damage to \the [src].") - health = min(health+(max_health/5), max_health) + health = min(health+(current_max_health/5), current_max_health) return // Install @@ -281,7 +282,7 @@ . = ..() if(.) if(!anchored || material.is_brittle()) - take_damage(max_health) // Fatboy + take_damage(get_max_health()) // Fatboy user.jump_layer_shift() addtimer(CALLBACK(user, TYPE_PROC_REF(/mob/living, jump_layer_shift_end)), 2) diff --git a/code/game/objects/structures/rubble.dm b/code/game/objects/structures/rubble.dm index 8a1bf024a49..1fb951b7b83 100644 --- a/code/game/objects/structures/rubble.dm +++ b/code/game/objects/structures/rubble.dm @@ -6,7 +6,7 @@ opacity = TRUE density = TRUE anchored = TRUE - max_health = 50 + obj_max_health = 50 var/list/loot = list( /obj/item/cell, diff --git a/code/game/objects/structures/stool_bed_chair_nest_sofa/wheelchair.dm b/code/game/objects/structures/stool_bed_chair_nest_sofa/wheelchair.dm index f2e34f4e701..a58c2f4f4e5 100644 --- a/code/game/objects/structures/stool_bed_chair_nest_sofa/wheelchair.dm +++ b/code/game/objects/structures/stool_bed_chair_nest_sofa/wheelchair.dm @@ -132,7 +132,7 @@ icon_state = "wheelchair-item" item_state = "rbed" w_class = ITEM_SIZE_LARGE - max_health = 50 + obj_max_health = 50 var/structure_form_type = /obj/structure/bed/chair/wheelchair /obj/item/wheelchair_kit/attack_self(mob/user) diff --git a/code/game/objects/structures/tables.dm b/code/game/objects/structures/tables.dm index 1d839db87bb..5a7d772ea36 100644 --- a/code/game/objects/structures/tables.dm +++ b/code/game/objects/structures/tables.dm @@ -15,7 +15,7 @@ // TODO: add 1px step-up? mob_offset = 12 handle_generic_blending = TRUE - max_health = 10 + obj_max_health = 10 tool_interaction_flags = TOOL_INTERACTION_DECONSTRUCT material_alteration = MAT_FLAG_ALTERATION_NAME | MAT_FLAG_ALTERATION_DESC parts_amount = 2 diff --git a/code/game/objects/structures/wall_frame.dm b/code/game/objects/structures/wall_frame.dm index c70b7ca4552..5c699a7f492 100644 --- a/code/game/objects/structures/wall_frame.dm +++ b/code/game/objects/structures/wall_frame.dm @@ -16,7 +16,7 @@ material = DEFAULT_WALL_MATERIAL handle_generic_blending = TRUE tool_interaction_flags = (TOOL_INTERACTION_ANCHOR | TOOL_INTERACTION_DECONSTRUCT) - max_health = 40 + obj_max_health = 40 parts_amount = 2 parts_type = /obj/item/stack/material/strut diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index 80839fb8b84..9340ef35f64 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -15,7 +15,7 @@ atmos_canpass = CANPASS_PROC handle_generic_blending = TRUE hitsound = 'sound/effects/Glasshit.ogg' - max_health = 100 + obj_max_health = 100 var/damage_per_fire_tick = 2 // Amount of damage per fire tick. Regular windows are not fireproof so they might as well break quickly. var/construction_state = 2 diff --git a/code/modules/blob/blob.dm b/code/modules/blob/blob.dm index 24c98a41859..254ae6ed72f 100644 --- a/code/modules/blob/blob.dm +++ b/code/modules/blob/blob.dm @@ -12,7 +12,7 @@ layer = BLOB_SHIELD_LAYER - max_health = 30 + obj_max_health = 30 var/regen_rate = 5 var/brute_resist = 4.3 @@ -45,7 +45,7 @@ take_damage(rand(140 - (severity * 40), 140 - (severity * 20)) / brute_resist) /obj/effect/blob/on_update_icon() - if(health > max_health / 2) + if(health > get_max_health() / 2) icon_state = "blob" else icon_state = "blob_damaged" @@ -65,7 +65,7 @@ update_icon() /obj/effect/blob/proc/regen() - health = min(health + regen_rate, max_health) + health = min(health + regen_rate, get_max_health()) update_icon() /obj/effect/blob/proc/expand(var/turf/T) @@ -195,7 +195,7 @@ name = "master nucleus" desc = "A massive, fragile nucleus guarded by a shield of thick tendrils." icon_state = "blob_core" - max_health = 450 + obj_max_health = 450 damage_min = 30 damage_max = 40 expandType = /obj/effect/blob/shield @@ -209,7 +209,7 @@ var/times_to_pulse = 0 /obj/effect/blob/core/proc/get_health_percent() - return ((health / max_health) * 100) + return ((health / get_max_health()) * 100) /* the master core becomes more vulnereable to damage as it weakens, @@ -281,7 +281,7 @@ regen() will cover update_icon() for this proc name = "auxiliary nucleus" desc = "An interwoven mass of tendrils. A glowing nucleus pulses at its center." icon_state = "blob_node" - max_health = 125 + obj_max_health = 125 regen_rate = 1 damage_min = 15 damage_max = 20 @@ -293,13 +293,13 @@ regen() will cover update_icon() for this proc return /obj/effect/blob/core/secondary/on_update_icon() - icon_state = (health / max_health >= 0.5) ? "blob_node" : "blob_factory" + icon_state = (health / get_max_health() >= 0.5) ? "blob_node" : "blob_factory" /obj/effect/blob/shield name = "shielding mass" desc = "A pulsating mass of interwoven tendrils. These seem particularly robust, but not quite as active." icon_state = "blob_idle" - max_health = 120 + obj_max_health = 120 damage_min = 13 damage_max = 25 attack_freq = 7 @@ -317,9 +317,10 @@ regen() will cover update_icon() for this proc return ..() /obj/effect/blob/shield/on_update_icon() - if(health > max_health * 2 / 3) + var/current_max_health = get_max_health() + if(health > current_max_health * 2 / 3) icon_state = "blob_idle" - else if(health > max_health / 3) + else if(health > current_max_health / 3) icon_state = "blob" else icon_state = "blob_damaged" @@ -330,7 +331,7 @@ regen() will cover update_icon() for this proc /obj/effect/blob/ravaging name = "ravaging mass" desc = "A mass of interwoven tendrils. They thrash around haphazardly at anything in reach." - max_health = 20 + obj_max_health = 20 damage_min = 27 damage_max = 36 attack_freq = 3 diff --git a/code/modules/clothing/masks/voice.dm b/code/modules/clothing/masks/voice.dm index edee4acd8eb..23348d26bd4 100644 --- a/code/modules/clothing/masks/voice.dm +++ b/code/modules/clothing/masks/voice.dm @@ -1,7 +1,7 @@ /obj/item/voice_changer name = "voice changer" desc = "A voice scrambling module. If you can see this, report it as a bug on the tracker." - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE var/voice //If set and item is present in mask/suit, this name will be used for the wearer's speech. var/active diff --git a/code/modules/crafting/_crafting_holder.dm b/code/modules/crafting/_crafting_holder.dm index ea9801c4c6b..dd7bb07f4fb 100644 --- a/code/modules/crafting/_crafting_holder.dm +++ b/code/modules/crafting/_crafting_holder.dm @@ -1,6 +1,6 @@ /obj/item/crafting_holder is_spawnable_type = FALSE // Do not manually spawn this, it will runtime/break. - max_health = 25 + obj_max_health = 25 var/decl/crafting_stage/current_crafting_stage var/label_name diff --git a/code/modules/detectivework/tools/sample_kits/_sample.dm b/code/modules/detectivework/tools/sample_kits/_sample.dm index f8c89d94b7c..61dd42cd997 100644 --- a/code/modules/detectivework/tools/sample_kits/_sample.dm +++ b/code/modules/detectivework/tools/sample_kits/_sample.dm @@ -2,7 +2,7 @@ /obj/item/forensics/sample name = "forensic sample" icon = 'icons/obj/forensics.dmi' - max_health = 1 + obj_max_health = 1 var/object var/list/possible_evidence_types = list(/datum/forensics/fibers) var/list/evidence diff --git a/code/modules/holodeck/HolodeckObjects.dm b/code/modules/holodeck/HolodeckObjects.dm index 3ef581d0c4d..304ab637698 100644 --- a/code/modules/holodeck/HolodeckObjects.dm +++ b/code/modules/holodeck/HolodeckObjects.dm @@ -220,7 +220,7 @@ /obj/item/holo damtype = PAIN no_attack_log = 1 - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE /obj/item/holo/esword name = "holosword" diff --git a/code/modules/hydroponics/seed_packets.dm b/code/modules/hydroponics/seed_packets.dm index 65d30c2e15f..6003e90a367 100644 --- a/code/modules/hydroponics/seed_packets.dm +++ b/code/modules/hydroponics/seed_packets.dm @@ -7,7 +7,7 @@ var/global/list/plant_seed_sprites = list() icon_state = "seedy" w_class = ITEM_SIZE_SMALL abstract_type = /obj/item/seeds - max_health = 10 //Can't set a material, otherwise extracting seeds would generate free materials + obj_max_health = 10 //Can't set a material, otherwise extracting seeds would generate free materials var/seed_type var/datum/seed/seed diff --git a/code/modules/hydroponics/spreading/spreading.dm b/code/modules/hydroponics/spreading/spreading.dm index 2a86f4f951d..f189369b5c0 100644 --- a/code/modules/hydroponics/spreading/spreading.dm +++ b/code/modules/hydroponics/spreading/spreading.dm @@ -46,7 +46,7 @@ mouse_opacity = MOUSE_OPACITY_NORMAL health = 10 - max_health = 100 + obj_max_health = 100 var/growth_threshold = 0 var/growth_type = 0 var/max_growth = 0 @@ -72,24 +72,25 @@ parent.possible_children = max(0, parent.possible_children - 1) seed = newseed - if(start_matured) - mature_time = 0 - health = max_health if(!istype(seed)) seed = SSplants.seeds[DEFAULT_SEED] if(!seed) return INITIALIZE_HINT_QDEL name = seed.display_name - max_health = round(seed.get_trait(TRAIT_ENDURANCE)/2) + obj_max_health = round(seed.get_trait(TRAIT_ENDURANCE)/2) + if(start_matured) + mature_time = 0 + health = obj_max_health + if(seed.get_trait(TRAIT_SPREAD) == 2) mouse_opacity = MOUSE_OPACITY_PRIORITY max_growth = VINE_GROWTH_STAGES - growth_threshold = max_health/VINE_GROWTH_STAGES + growth_threshold = obj_max_health/VINE_GROWTH_STAGES growth_type = seed.get_growth_type() else max_growth = seed.growth_stages - growth_threshold = max_growth && max_health/max_growth + growth_threshold = max_growth && obj_max_health/max_growth if(max_growth > 2 && prob(50)) max_growth-- //Ensure some variation in final sprite, makes the carpet of crap look less wonky. @@ -255,12 +256,12 @@ physically_destroyed() /obj/effect/vine/proc/adjust_health(value) - health = clamp(health + value, 0, max_health) + health = clamp(health + value, 0, get_max_health()) if(health <= 0) die_off() /obj/effect/vine/proc/is_mature() - return (health >= (max_health/3) && world.time > mature_time) + return (health >= (get_max_health()/3) && world.time > mature_time) /obj/effect/vine/is_burnable() return seed.get_trait(TRAIT_HEAT_TOLERANCE) < 1000 diff --git a/code/modules/hydroponics/spreading/spreading_growth.dm b/code/modules/hydroponics/spreading/spreading_growth.dm index 6125017277d..00941f36c07 100644 --- a/code/modules/hydroponics/spreading/spreading_growth.dm +++ b/code/modules/hydroponics/spreading/spreading_growth.dm @@ -53,7 +53,7 @@ other.vine_overrun(seed, src) //Growing up - if(health < max_health) + if(health < get_max_health()) adjust_health(1) if(growth_threshold && !(health % growth_threshold)) update_icon() @@ -94,14 +94,14 @@ /obj/effect/vine/proc/can_spawn_plant() var/turf/simulated/T = get_turf(src) - return parent == src && health == max_health && !plant && istype(T) && !T.CanZPass(src, DOWN) + return parent == src && health == get_max_health() && !plant && istype(T) && !T.CanZPass(src, DOWN) /obj/effect/vine/proc/should_sleep() if(buckled_mob) //got a victim to fondle return FALSE if(length(get_neighbors())) //got places to spread to return FALSE - if(health < max_health) //got some growth to do + if(health < get_max_health()) //got some growth to do return FALSE if(targets_in_range()) //got someone to grab return FALSE diff --git a/code/modules/integrated_electronics/core/assemblies.dm b/code/modules/integrated_electronics/core/assemblies.dm index 70bf4641b9e..c94d52d51a8 100644 --- a/code/modules/integrated_electronics/core/assemblies.dm +++ b/code/modules/integrated_electronics/core/assemblies.dm @@ -12,7 +12,7 @@ pass_flags = 0 anchored = FALSE obj_flags = OBJ_FLAG_ANCHORABLE - max_health = 30 + obj_max_health = 30 var/list/assembly_components = list() var/list/ckeys_allowed_to_scan = list() // Players who built the circuit can scan it as a ghost. var/max_components = IC_MAX_SIZE_BASE @@ -109,7 +109,7 @@ P.make_energy() var/power_failure = FALSE - if(max_health/health < 0.5 && prob(5)) + if(get_max_health()/health < 0.5 && prob(5)) visible_message(SPAN_WARNING("\The [src] shudders and sparks.")) power_failure = TRUE // Now spend it. @@ -471,7 +471,7 @@ var/obj/item/stack/cable_coil/C = I if(is_damaged() && do_after(user, 10, src) && C.use(1)) user.visible_message("\The [user] patches up \the [src].") - health = min(max_health, health + 5) + health = min(get_max_health(), health + 5) return TRUE else if(user.a_intent != I_HURT) @@ -560,7 +560,7 @@ w_class = ITEM_SIZE_NORMAL max_components = IC_MAX_SIZE_BASE * 2 max_complexity = IC_COMPLEXITY_BASE * 2 - max_health = 20 + obj_max_health = 20 /obj/item/electronic_assembly/medium/default name = "type-a electronic mechanism" @@ -600,7 +600,7 @@ w_class = ITEM_SIZE_LARGE max_components = IC_MAX_SIZE_BASE * 4 max_complexity = IC_COMPLEXITY_BASE * 4 - max_health = 30 + obj_max_health = 30 /obj/item/electronic_assembly/large/default name = "type-a electronic machine" @@ -640,7 +640,7 @@ allowed_circuit_action_flags = IC_ACTION_MOVEMENT | IC_ACTION_COMBAT | IC_ACTION_LONG_RANGE circuit_flags = 0 obj_flags = 0 //Not anchorable - max_health = 50 + obj_max_health = 50 /obj/item/electronic_assembly/drone/can_move() return TRUE @@ -680,7 +680,7 @@ w_class = ITEM_SIZE_NORMAL max_components = IC_MAX_SIZE_BASE * 2 max_complexity = IC_COMPLEXITY_BASE * 2 - max_health = 10 + obj_max_health = 10 /obj/item/electronic_assembly/wallmount/afterattack(var/atom/a, var/mob/user, var/proximity) if(proximity && istype(a ,/turf) && a.density) diff --git a/code/modules/integrated_electronics/core/integrated_circuit.dm b/code/modules/integrated_electronics/core/integrated_circuit.dm index 8a7ef0695f4..d5424b88cf9 100644 --- a/code/modules/integrated_electronics/core/integrated_circuit.dm +++ b/code/modules/integrated_electronics/core/integrated_circuit.dm @@ -5,7 +5,7 @@ icon_state = "template" w_class = ITEM_SIZE_TINY matter = list() // To be filled later - max_health = 25 //#TODO: Use material for health + obj_max_health = 25 //#TODO: Use material for health var/obj/item/electronic_assembly/assembly // Reference to the assembly holding this circuit, if any. var/extended_desc var/list/inputs diff --git a/code/modules/materials/material_sheets.dm b/code/modules/materials/material_sheets.dm index 0f566b41f24..b0198b8bf05 100644 --- a/code/modules/materials/material_sheets.dm +++ b/code/modules/materials/material_sheets.dm @@ -389,7 +389,7 @@ uses_charge = 1 charge_costs = list(500) material = /decl/material/solid/metal/steel - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE is_spawnable_type = FALSE /obj/item/stack/material/bar diff --git a/code/modules/materials/material_synth.dm b/code/modules/materials/material_synth.dm index 4aa562ea6a1..390a8f984f5 100644 --- a/code/modules/materials/material_synth.dm +++ b/code/modules/materials/material_synth.dm @@ -5,7 +5,7 @@ charge_costs = list(1000) gender = NEUTER matter = null // Don't shove it in the autholathe. - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE is_spawnable_type = FALSE /obj/item/stack/material/cyborg/Initialize() diff --git a/code/modules/mechs/components/body.dm b/code/modules/mechs/components/body.dm index 5f072a7392e..76e1e2a35c7 100644 --- a/code/modules/mechs/components/body.dm +++ b/code/modules/mechs/components/body.dm @@ -4,7 +4,7 @@ storage_slots = 4 use_sound = 'sound/effects/storage/toolbox.ogg' anchored = TRUE - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE /obj/item/mech_component/chassis/Adjacent(var/atom/neighbor, var/recurse = 1) //For interaction purposes we consider body to be adjacent to whatever holder mob is adjacent var/mob/living/exosuit/E = loc diff --git a/code/modules/mechs/equipment/combat.dm b/code/modules/mechs/equipment/combat.dm index 107f20395d4..7db47f2731a 100644 --- a/code/modules/mechs/equipment/combat.dm +++ b/code/modules/mechs/equipment/combat.dm @@ -241,7 +241,7 @@ base_parry_chance = 0 //Irrelevant for exosuits, revise if this changes max_force = 25 material_force_multiplier = 0.75 // Equals 20 AP with 25 force - max_health = ITEM_HEALTH_NO_DAMAGE //Else we need a whole system for replacement blades + obj_max_health = ITEM_HEALTH_NO_DAMAGE //Else we need a whole system for replacement blades /obj/item/hatchet/machete/mech/apply_hit_effect(mob/living/target, mob/living/user, hit_zone) . = ..() diff --git a/code/modules/mob/living/carbon/resist.dm b/code/modules/mob/living/carbon/resist.dm index 0e7af051b09..3893bf38018 100644 --- a/code/modules/mob/living/carbon/resist.dm +++ b/code/modules/mob/living/carbon/resist.dm @@ -80,7 +80,7 @@ return if (cuffs.can_take_damage() && cuffs.health > 0) // Improvised cuffs can break because their health is > 0 var/cuffs_name = "\the [cuffs]" - cuffs.take_damage(cuffs.max_health / 2) + cuffs.take_damage(cuffs.get_max_health() / 2) if (QDELETED(cuffs) || cuffs.health < 1) visible_message( SPAN_DANGER("\The [src] manages to remove [cuffs_name], breaking them!"), diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 3cd30f8dc1a..1555b2418f5 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -208,8 +208,8 @@ default behaviour is: set_stat(CONSCIOUS) return - var/max_health = get_max_health() - current_health = clamp(max_health-get_total_life_damage(), -(max_health), max_health) + var/current_max_health = get_max_health() + current_health = clamp(current_max_health-get_total_life_damage(), -(current_max_health), current_max_health) if(stat != DEAD && should_be_dead()) death() if(!QDELETED(src)) // death() may delete or remove us diff --git a/code/modules/mob/living/silicon/ai/ai_damage.dm b/code/modules/mob/living/silicon/ai/ai_damage.dm index 6949d387b0c..82df4b46d68 100644 --- a/code/modules/mob/living/silicon/ai/ai_damage.dm +++ b/code/modules/mob/living/silicon/ai/ai_damage.dm @@ -55,7 +55,7 @@ ..() add_ai_verbs(src) -// Returns percentage of AI's remaining backup capacitor charge (max_health - oxyloss). +// Returns percentage of AI's remaining backup capacitor charge (max health - oxyloss). /mob/living/silicon/ai/proc/backup_capacitor() var/current_max_health = get_max_health() return ((getOxyLoss() - current_max_health) / current_max_health) * (-100) diff --git a/code/modules/mob/living/silicon/robot/component.dm b/code/modules/mob/living/silicon/robot/component.dm index 3fd56f6b134..8e5bd6bb7c2 100644 --- a/code/modules/mob/living/silicon/robot/component.dm +++ b/code/modules/mob/living/silicon/robot/component.dm @@ -223,30 +223,33 @@ icon_state = "working" material = /decl/material/solid/metal/steel health = 30 - max_health = 30 + obj_max_health = 30 var/burn_damage = 0 var/brute_damage = 0 var/icon_state_broken = "broken" /obj/item/robot_parts/robot_component/check_health(lastdamage, lastdamtype, lastdamflags, consumed) + var/current_max_health = get_max_health() if(lastdamage > 0) if(lastdamtype == BRUTE) - brute_damage = clamp(lastdamage, 0, max_health) + brute_damage = clamp(lastdamage, 0, current_max_health) if(lastdamtype == BURN || lastdamtype == ELECTROCUTE) - burn_damage = clamp(lastdamage, 0, max_health) + burn_damage = clamp(lastdamage, 0, current_max_health) //Health works differently for this thing - health = clamp(max_health - (brute_damage + burn_damage), 0, max_health) + health = clamp(current_max_health - (brute_damage + burn_damage), 0, current_max_health) . = ..() /obj/item/robot_parts/robot_component/proc/set_bruteloss(var/amount) - brute_damage = clamp(amount, 0, max_health) - health = max_health - (brute_damage + burn_damage) + var/current_max_health = get_max_health() + brute_damage = clamp(amount, 0, current_max_health) + health = current_max_health - (brute_damage + burn_damage) check_health(amount, BRUTE) /obj/item/robot_parts/robot_component/proc/set_burnloss(var/amount) - burn_damage = clamp(amount, 0, max_health) - health = max_health - (brute_damage + burn_damage) + var/current_max_health = get_max_health() + burn_damage = clamp(amount, 0, current_max_health) + health = current_max_health - (brute_damage + burn_damage) check_health(amount, BURN) /obj/item/robot_parts/robot_component/physically_destroyed(skip_qdel) @@ -258,7 +261,7 @@ . = ..() /obj/item/robot_parts/robot_component/proc/is_functional() - return ((brute_damage + burn_damage) < max_health) + return ((brute_damage + burn_damage) < get_max_health()) /obj/item/robot_parts/robot_component/binary_communication_device name = "binary communication device" diff --git a/code/modules/mob/living/silicon/robot/drone/drone_items.dm b/code/modules/mob/living/silicon/robot/drone/drone_items.dm index cef20e56fe9..ea4897533d2 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone_items.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone_items.dm @@ -5,7 +5,7 @@ desc = "A simple grasping tool specialized in construction and engineering work." icon = 'icons/obj/items/borg_module/borg_gripper.dmi' icon_state = "gripper" - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE item_flags = ITEM_FLAG_NO_BLUDGEON //Has a list of items that it can hold. @@ -274,7 +274,7 @@ desc = "Eating trash, bits of glass, or other debris will replenish your stores." icon = 'icons/obj/items/borg_module/decompiler.dmi' icon_state = "decompiler" - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE //Metal, glass, wood, plastic. var/datum/matter_synth/metal = null diff --git a/code/modules/mob/living/silicon/robot/robot_items.dm b/code/modules/mob/living/silicon/robot/robot_items.dm index d368c595b46..418ff805b6e 100644 --- a/code/modules/mob/living/silicon/robot/robot_items.dm +++ b/code/modules/mob/living/silicon/robot/robot_items.dm @@ -90,7 +90,7 @@ desc = "A hand-held harvest tool that resembles a sickle. It uses energy to cut plant matter very efficently." icon = 'icons/obj/items/borg_module/autoharvester.dmi' icon_state = "autoharvester" - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE /obj/item/robot_harvester/afterattack(var/atom/target, var/mob/living/user, proximity) if(!target) @@ -172,7 +172,7 @@ icon = 'icons/obj/items/paper_bin.dmi' icon_state = "paper_bin1" item_state = "sheet-metal" - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE /obj/item/form_printer/attack(mob/living/carbon/M, mob/living/carbon/user) return @@ -236,7 +236,7 @@ stored_doors = 5 max_walls = 10 max_doors = 5 - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE /obj/item/inflatable_dispenser/examine(mob/user) . = ..() @@ -325,7 +325,7 @@ /obj/item/robot_rack name = "a generic robot rack" desc = "A rack for carrying large items as a robot." - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE var/object_type //The types of object the rack holds (subtypes are allowed). var/interact_type //Things of this type will trigger attack_hand when attacked by this. var/capacity = 1 //How many objects can be held. @@ -369,7 +369,7 @@ desc = "An integrated power generator that runs on most kinds of biomass." icon = 'icons/obj/power.dmi' icon_state = "portgen0" - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE var/base_power_generation = 75 KILOWATTS var/max_fuel_items = 5 diff --git a/code/modules/mob_holder/_holder.dm b/code/modules/mob_holder/_holder.dm index 467add961ba..8def9a6d7d4 100644 --- a/code/modules/mob_holder/_holder.dm +++ b/code/modules/mob_holder/_holder.dm @@ -11,7 +11,7 @@ use_single_icon = TRUE item_state = null is_spawnable_type = FALSE - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE var/last_holder /obj/item/holder/Initialize() diff --git a/code/modules/paperwork/paper_bundle.dm b/code/modules/paperwork/paper_bundle.dm index 4a285f714e4..837757132ab 100644 --- a/code/modules/paperwork/paper_bundle.dm +++ b/code/modules/paperwork/paper_bundle.dm @@ -20,7 +20,7 @@ pickup_sound = 'sound/foley/paperpickup2.ogg' item_flags = ITEM_FLAG_CAN_TAPE health = 10 - max_health = 10 + obj_max_health = 10 var/tmp/cur_page = 1 // current page var/tmp/max_pages = 100 //Maximum number of papers that can be in the bundle var/list/pages // Ordered list of pages as they are to be displayed. Can be different order than src.contents. diff --git a/code/modules/paperwork/printer.dm b/code/modules/paperwork/printer.dm index 83c8af53727..d746b82c90b 100644 --- a/code/modules/paperwork/printer.dm +++ b/code/modules/paperwork/printer.dm @@ -17,7 +17,7 @@ /decl/material/solid/metal/copper = MATTER_AMOUNT_REINFORCEMENT, ) base_type = /obj/item/stock_parts/printer - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE part_flags = PART_FLAG_QDEL var/list/print_queue //Contains a single copy of each of the /obj/item/paper or /obj/item/photo that we'll print. var/obj/item/chems/toner_cartridge/toner //Contains our ink @@ -36,7 +36,7 @@ //Buildable: Can be removed from the machine, and damaged /obj/item/stock_parts/printer/buildable part_flags = PART_FLAG_HAND_REMOVE - max_health = 64 + obj_max_health = 64 //Buildable + Filled variant: has sheet and toner on spawn /obj/item/stock_parts/printer/buildable/filled/Initialize(ml, material_key) diff --git a/code/modules/paperwork/toner_cartridge.dm b/code/modules/paperwork/toner_cartridge.dm index c5438f3f42c..0f19fcf2dc9 100644 --- a/code/modules/paperwork/toner_cartridge.dm +++ b/code/modules/paperwork/toner_cartridge.dm @@ -32,7 +32,7 @@ /obj/item/chems/toner_cartridge/throw_impact(atom/hit_atom, datum/thrownthing/TT) . = ..() - health = clamp(health - (TT.speed * w_class), 0, max_health) //You don't wanna throw this around too much + health = clamp(health - (TT.speed * w_class), 0, get_max_health()) //You don't wanna throw this around too much check_health() /obj/item/chems/toner_cartridge/proc/get_amount_toner() diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index d2e69767a0c..d4cc27ab098 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -516,7 +516,7 @@ By design, d1 is the smallest direction and d2 is the highest matter = null uses_charge = 1 charge_costs = list(1) - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE is_spawnable_type = FALSE /obj/item/stack/cable_coil/Initialize(mapload, c_length, var/param_color = null) diff --git a/code/modules/power/fuel_assembly/fuel_assembly.dm b/code/modules/power/fuel_assembly/fuel_assembly.dm index e49145ee109..8f7652328fd 100644 --- a/code/modules/power/fuel_assembly/fuel_assembly.dm +++ b/code/modules/power/fuel_assembly/fuel_assembly.dm @@ -4,7 +4,7 @@ icon_state = "fuel_assembly" layer = 4 abstract_type = /obj/item/fuel_assembly - max_health = 150 + obj_max_health = 150 var/material_name var/percent_depleted = 1 diff --git a/code/modules/power/singularity/collector.dm b/code/modules/power/singularity/collector.dm index 47a89e778ee..d22fe53d1d3 100644 --- a/code/modules/power/singularity/collector.dm +++ b/code/modules/power/singularity/collector.dm @@ -10,7 +10,7 @@ var/global/list/rad_collectors = list() anchored = FALSE density = TRUE initial_access = list(access_engine_equip) - max_health = 100 + obj_max_health = 100 var/obj/item/tank/hydrogen/loaded_tank = null var/max_safe_temp = 1000 + T0C diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm index 2633d130893..29fcdc09d56 100644 --- a/code/modules/power/solar.dm +++ b/code/modules/power/solar.dm @@ -12,7 +12,7 @@ var/global/list/solars_list = list() density = TRUE idle_power_usage = 0 active_power_usage = 0 - max_health = 10 + obj_max_health = 10 var/obscured = 0 var/sunfrac = 0 var/efficiency = 1 diff --git a/code/modules/reagents/reagent_containers/borghydro.dm b/code/modules/reagents/reagent_containers/borghydro.dm index b74335a2e3d..97124748f77 100644 --- a/code/modules/reagents/reagent_containers/borghydro.dm +++ b/code/modules/reagents/reagent_containers/borghydro.dm @@ -5,7 +5,7 @@ amount_per_transfer_from_this = 5 volume = 30 possible_transfer_amounts = null - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE var/mode = 1 var/charge_cost = 50 diff --git a/code/modules/reagents/reagent_containers/food/meat/slabs.dm b/code/modules/reagents/reagent_containers/food/meat/slabs.dm index 4a7aa12fa25..c73762f6847 100644 --- a/code/modules/reagents/reagent_containers/food/meat/slabs.dm +++ b/code/modules/reagents/reagent_containers/food/meat/slabs.dm @@ -5,7 +5,7 @@ icon_state = "meat" slice_path = /obj/item/chems/food/rawcutlet slices_num = 3 - max_health = 180 + obj_max_health = 180 filling_color = "#ff1c1c" center_of_mass = @'{"x":16,"y":14}' material = /decl/material/solid/organic/meat diff --git a/code/modules/reagents/reagent_dispenser.dm b/code/modules/reagents/reagent_dispenser.dm index 65c59c24d42..2cb69b80b34 100644 --- a/code/modules/reagents/reagent_dispenser.dm +++ b/code/modules/reagents/reagent_dispenser.dm @@ -8,7 +8,7 @@ anchored = FALSE material = /decl/material/solid/organic/plastic matter = list(/decl/material/solid/metal/steel = MATTER_AMOUNT_SECONDARY) - max_health = 100 + obj_max_health = 100 tool_interaction_flags = TOOL_INTERACTION_DECONSTRUCT var/unwrenched = FALSE var/tmp/volume = 1000 diff --git a/code/modules/recycling/disposalpipe.dm b/code/modules/recycling/disposalpipe.dm index c187f585b02..95324a0f187 100644 --- a/code/modules/recycling/disposalpipe.dm +++ b/code/modules/recycling/disposalpipe.dm @@ -6,7 +6,7 @@ desc = "An underfloor disposal pipe." anchored = TRUE density = FALSE - max_health = 10 + obj_max_health = 10 level = LEVEL_BELOW_PLATING dir = 0 // dir will contain dominant direction for junction pipes alpha = 192 // Plane and alpha modified for mapping, reset to normal on spawn. diff --git a/code/modules/research/design_database_analyzer.dm b/code/modules/research/design_database_analyzer.dm index b0c3c4150bb..2d4187e95ba 100644 --- a/code/modules/research/design_database_analyzer.dm +++ b/code/modules/research/design_database_analyzer.dm @@ -148,4 +148,4 @@ icon = 'icons/obj/items/stock_parts/stock_parts.dmi' icon_state = "smes_coil" origin_tech = @'{"materials":19,"engineering":19,"exoticmatter":19,"powerstorage":19,"wormholes":19,"biotech":19,"combat":19,"magnets":19,"programming":19,"esoteric":19}' - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE diff --git a/code/modules/shieldgen/emergency_shield.dm b/code/modules/shieldgen/emergency_shield.dm index 32b40b200be..eb72c9e0faf 100644 --- a/code/modules/shieldgen/emergency_shield.dm +++ b/code/modules/shieldgen/emergency_shield.dm @@ -6,14 +6,14 @@ density = TRUE opacity = FALSE anchored = TRUE - max_health = 200 + obj_max_health = 200 var/shield_generate_power = 7500 //how much power we use when regenerating var/shield_idle_power = 1500 //how much power we use when just being sustained. /obj/machinery/shield/malfai name = "emergency forcefield" desc = "A weak forcefield which seems to be projected by the emergency atmosphere containment field." - max_health = 100 // Half health, it's not suposed to resist much. + obj_max_health = 100 // Half health, it's not suposed to resist much. /obj/machinery/shield/malfai/Process() health -= 0.5 // Slowly lose integrity over time @@ -109,7 +109,7 @@ opacity = FALSE anchored = FALSE initial_access = list(access_engine) - max_health = 100 + obj_max_health = 100 var/active = 0 var/malfunction = 0 //Malfunction causes parts of the shield to slowly dissapate var/list/deployed_shields = list() @@ -274,10 +274,9 @@ else if(IS_COIL(W) && malfunction && is_open) var/obj/item/stack/cable_coil/coil = W to_chat(user, "You begin to replace the wires.") - //if(do_after(user, min(60, round( ((max_health/health)*10)+(malfunction*10) ))) //Take longer to repair heavier damage if(do_after(user, 30,src)) if (coil.use(1)) - health = max_health + health = get_max_health() malfunction = 0 to_chat(user, "You repair the [src]!") update_icon() diff --git a/code/modules/spells/artifacts.dm b/code/modules/spells/artifacts.dm index a2d58655579..f95d9872323 100644 --- a/code/modules/spells/artifacts.dm +++ b/code/modules/spells/artifacts.dm @@ -11,7 +11,7 @@ damtype = BURN force = 10 hitsound = 'sound/magic/forcewall.ogg' - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE /obj/item/scrying/attack_self(mob/user) var/decl/special_role/wizard/wizards = GET_DECL(/decl/special_role/wizard) diff --git a/code/modules/spells/hand/hand_item.dm b/code/modules/spells/hand/hand_item.dm index 855cfdcfa92..7a6d75e3776 100644 --- a/code/modules/spells/hand/hand_item.dm +++ b/code/modules/spells/hand/hand_item.dm @@ -10,7 +10,7 @@ Basically: I can use it to target things where I click. I can then pass these ta obj_flags = 0 simulated = 0 icon_state = "spell" - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE is_spawnable_type = FALSE var/next_spell_time = 0 var/spell/hand/hand_spell diff --git a/code/modules/spells/targeted/equip/burning_touch.dm b/code/modules/spells/targeted/equip/burning_touch.dm index b7e9c9dbdb9..f97fb3c24c7 100644 --- a/code/modules/spells/targeted/equip/burning_touch.dm +++ b/code/modules/spells/targeted/equip/burning_touch.dm @@ -21,7 +21,7 @@ force = 10 damtype = BURN simulated = 0 - max_health = ITEM_HEALTH_NO_DAMAGE + obj_max_health = ITEM_HEALTH_NO_DAMAGE var/burn_power = 0 var/burn_timer diff --git a/code/modules/vehicles/bike.dm b/code/modules/vehicles/bike.dm index 0f17bacd3e6..1fcff29319c 100644 --- a/code/modules/vehicles/bike.dm +++ b/code/modules/vehicles/bike.dm @@ -8,7 +8,7 @@ load_item_visible = 1 buckle_pixel_shift = list("x" = 0, "y" = 0, "z" = 5) health = 100 - max_health = 100 + obj_max_health = 100 locked = 0 fire_dam_coeff = 0.6 diff --git a/code/modules/vehicles/train.dm b/code/modules/vehicles/train.dm index 804dea26ff9..22ed767c8e2 100644 --- a/code/modules/vehicles/train.dm +++ b/code/modules/vehicles/train.dm @@ -5,7 +5,7 @@ move_delay = 1 health = 100 - max_health = 100 + obj_max_health = 100 fire_dam_coeff = 0.7 brute_dam_coeff = 0.5 diff --git a/code/modules/vehicles/vehicle.dm b/code/modules/vehicles/vehicle.dm index 2386d664bbb..a916f100b40 100644 --- a/code/modules/vehicles/vehicle.dm +++ b/code/modules/vehicles/vehicle.dm @@ -84,9 +84,10 @@ else if(IS_WELDER(W)) var/obj/item/weldingtool/T = W if(T.welding) - if(health < max_health) + var/current_max_health = get_max_health() + if(health < current_max_health) if(open) - health = min(max_health, health+10) + health = min(current_max_health, health+10) user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) user.visible_message("\The [user] repairs \the [src]!","You repair \the [src]!") else diff --git a/code/unit_tests/obj_damage_tests.dm b/code/unit_tests/obj_damage_tests.dm index 56dc1e07b50..eca0ef2e32c 100644 --- a/code/unit_tests/obj_damage_tests.dm +++ b/code/unit_tests/obj_damage_tests.dm @@ -2,9 +2,9 @@ // items_shall_stay_invincible ///////////////////////////////////////////////////////// /datum/item_unit_test/constant/items_shall_stay_invincible/run_test(var/obj/item/I) - if(initial(I.health) != ITEM_HEALTH_NO_DAMAGE && initial(I.max_health) != ITEM_HEALTH_NO_DAMAGE) + if(initial(I.health) != ITEM_HEALTH_NO_DAMAGE && initial(I.obj_max_health) != ITEM_HEALTH_NO_DAMAGE) return TRUE //Ignore things that aren't invincible - if(I.health != ITEM_HEALTH_NO_DAMAGE || I.max_health != ITEM_HEALTH_NO_DAMAGE) + if(I.health != ITEM_HEALTH_NO_DAMAGE || I.get_max_health() != ITEM_HEALTH_NO_DAMAGE) IT.report_failure(src, I.type, "Is defined as not taking health damage, but it can take damage after init.") return FALSE return TRUE @@ -13,10 +13,11 @@ // items_shall_define_their_max_health ///////////////////////////////////////////////////////// /datum/item_unit_test/constant/items_shall_define_their_max_health/run_test(var/obj/item/I) - if(I.health == ITEM_HEALTH_NO_DAMAGE || I.max_health == ITEM_HEALTH_NO_DAMAGE) + var/current_max_health = I.get_max_health() + if(I.health == ITEM_HEALTH_NO_DAMAGE || current_max_health == ITEM_HEALTH_NO_DAMAGE) return TRUE //We don't care about invincible things - if(I.health > 0 && I.max_health != I.health) - IT.report_failure(src, I.type, "Defines health = [I.health], but its max_health is [I.max_health? I.max_health : "null"].") + if(I.health > 0 && current_max_health != I.health) + IT.report_failure(src, I.type, "Defines health = [I.health], but its max health is [current_max_health || "null"].") return FALSE return TRUE @@ -25,7 +26,7 @@ ///////////////////////////////////////////////////////// /**Items should only change their defined health variable during init if it was set to null. Otherwise issues will arise. */ /datum/item_unit_test/constant/items_shall_set_health_var_only_if_null/run_test(var/obj/item/I) - if(initial(I.health) == ITEM_HEALTH_NO_DAMAGE || initial(I.max_health) == ITEM_HEALTH_NO_DAMAGE) + if(initial(I.health) == ITEM_HEALTH_NO_DAMAGE || initial(I.obj_max_health) == ITEM_HEALTH_NO_DAMAGE) return TRUE if(isnull(initial(I.health))) @@ -51,11 +52,11 @@ /** Makes sure that if we have a material setting up our health, it actually sets it to something sane. */ /datum/item_unit_test/constant/items_shall_get_a_valid_health_from_materials/run_test(var/obj/item/I) //If any health is specified or if the object is invincible skip. Return true on no material too since its not our job to validate the material logic - if(!isnull(initial(I.health)) || !isnull(initial(I.max_health)) || !I.material) + if(!isnull(initial(I.health)) || !isnull(initial(I.obj_max_health)) || !I.material) return TRUE - if((I.max_health < 1.0) || (I.health < 1.0)) - IT.report_failure(src, I.type, "Had its health/max_health set to a value < 1 by its material '[I.material.type]', where '[I.material.name]''s 'integrity' == '[I.material.integrity]', and '[I]''s 'material_health_multiplier' == '[I.material_health_multiplier]'.") + if((I.get_max_health() < 1.0) || (I.health < 1.0)) + IT.report_failure(src, I.type, "Had its health/max health set to a value < 1 by its material '[I.material.type]', where '[I.material.name]''s 'integrity' == '[I.material.integrity]', and '[I]''s 'material_health_multiplier' == '[I.material_health_multiplier]'.") return FALSE return TRUE @@ -69,15 +70,15 @@ //Check if invincibility actually works if(!isnull(old_health)) - if(old_health && old_health == I.health && old_health != ITEM_HEALTH_NO_DAMAGE && I.max_health != ITEM_HEALTH_NO_DAMAGE) + if(old_health && old_health == I.health && old_health != ITEM_HEALTH_NO_DAMAGE && I.get_max_health() != ITEM_HEALTH_NO_DAMAGE) failure_text += "Item took no damage and isn't defined as invincible. (old: [old_health? old_health : "null"], new: [I.health? I.health : "null"], returned: [damage_taken_returned? damage_taken_returned : "null"]) " - if(old_health != I.health && (old_health == ITEM_HEALTH_NO_DAMAGE || I.max_health == ITEM_HEALTH_NO_DAMAGE)) + if(old_health != I.health && (old_health == ITEM_HEALTH_NO_DAMAGE || I.get_max_health() == ITEM_HEALTH_NO_DAMAGE)) failure_text += "Item took some damage while defined as invincible. (old: [old_health? old_health : "null"], new: [I.health? I.health : "null"], returned: [damage_taken_returned? damage_taken_returned : "null"]) " else failure_text += "Item health is null after init. " //Check the take damage returned damage value - var/damage_taken_actual = (old_health == ITEM_HEALTH_NO_DAMAGE || I.max_health == ITEM_HEALTH_NO_DAMAGE || isnull(old_health))? 0 : old_health - I.health + var/damage_taken_actual = (old_health == ITEM_HEALTH_NO_DAMAGE || I.get_max_health() == ITEM_HEALTH_NO_DAMAGE || isnull(old_health))? 0 : old_health - I.health if(damage_taken_returned != damage_taken_actual) failure_text += "take_damage() returned the wrong amount of damage (health before: [old_health? old_health : "null"], after: [I.health? I.health : "null"], returned damage:[damage_taken_returned? damage_taken_returned : "null"])." @@ -92,10 +93,10 @@ /**Damages items to destruction and see if it throws runtimes. Type starts with z so it's run last.*/ /datum/item_unit_test/volatile/z_items_shall_be_destroyed_gracefully/run_test(var/obj/item/I) try - var/damage_dealt = I.can_take_damage() ? (I.max_health + 1) : 9999 //Arbitrary large damage value for invincible things + var/damage_dealt = I.can_take_damage() ? (I.get_max_health() + 1) : 9999 //Arbitrary large damage value for invincible things I.take_damage(damage_dealt, BRUTE, 0, "TEST", ARMOR_PIERCING_BYPASSED) //Just let the exception handler do its job . = TRUE catch(var/exception/E) IT.report_failure(src, I.type, "Threw an exception when destroyed by brute damage!: [EXCEPTION_TEXT(E)]") . = FALSE - throw E \ No newline at end of file + throw E diff --git a/maps/away/errant_pisces/errant_pisces.dm b/maps/away/errant_pisces/errant_pisces.dm index ce0cc197b4c..94ed7a94f04 100644 --- a/maps/away/errant_pisces/errant_pisces.dm +++ b/maps/away/errant_pisces/errant_pisces.dm @@ -79,7 +79,7 @@ icon_state = "net_f" anchored = TRUE layer = CATWALK_LAYER//probably? Should cover cables, pipes and the rest of objects that are secured on the floor - max_health = 100 + obj_max_health = 100 /obj/structure/net/Initialize(var/mapload) . = ..() diff --git a/mods/species/ascent/mobs/insectoid_egg.dm b/mods/species/ascent/mobs/insectoid_egg.dm index 6076c3dff4b..cf05c7b106c 100644 --- a/mods/species/ascent/mobs/insectoid_egg.dm +++ b/mods/species/ascent/mobs/insectoid_egg.dm @@ -12,7 +12,7 @@ var/global/default_gyne name = "alien egg" desc = "A semi-translucent alien egg." health = 100 - max_health = 100 + obj_max_health = 100 icon = 'mods/species/ascent/icons/egg.dmi' icon_state = "egg" From 8ebe51156217d0146c74188aaf07c1713c4a6e2c Mon Sep 17 00:00:00 2001 From: MistakeNot4892 Date: Sat, 3 Feb 2024 14:28:54 +1100 Subject: [PATCH 2/2] Merging health vars from /obj and /mob to /atom. --- code/datums/uplink/services.dm | 2 +- code/game/atoms.dm | 6 +++ code/game/gamemodes/cult/runes.dm | 18 +++---- .../godmode/form_items/narsie_structures.dm | 4 +- code/game/gamemodes/godmode/god_altar.dm | 2 +- code/game/gamemodes/godmode/god_structures.dm | 2 +- code/game/gamemodes/godmode/god_trap.dm | 2 +- .../machinery/_machines_base/machinery.dm | 2 +- .../_machines_base/machinery_damage.dm | 2 +- .../stock_parts/_stock_parts.dm | 2 +- .../_machines_base/stock_parts/access_lock.dm | 4 +- .../stock_parts/building_material.dm | 2 +- .../_machines_base/stock_parts/card_reader.dm | 4 +- .../_machines_base/stock_parts/disk_reader.dm | 4 +- .../stock_parts/power/battery.dm | 2 +- .../_machines_base/stock_parts/power/power.dm | 2 +- .../stock_parts/power/terminal.dm | 2 +- .../_machines_base/stock_parts/power/tesla.dm | 2 +- .../stock_parts/radio/receiver.dm | 2 +- .../stock_parts/radio/stock_parts_radio.dm | 2 +- .../stock_parts/radio/transmitter.dm | 4 +- .../stock_parts/stock_parts_interface.dm | 2 +- code/game/machinery/atmoalter/canister.dm | 10 ++-- code/game/machinery/deployable.dm | 20 +++---- code/game/machinery/doors/_door.dm | 36 ++++++------- code/game/machinery/doors/airlock.dm | 12 ++--- code/game/machinery/doors/airlock_subtypes.dm | 4 +- code/game/machinery/doors/blast_door.dm | 8 +-- code/game/machinery/doors/braces.dm | 2 +- code/game/machinery/doors/windowdoor.dm | 52 +++++++++---------- code/game/machinery/portable_turret.dm | 18 +++---- .../objects/effects/decals/posters/_poster.dm | 4 +- code/game/objects/effects/spiders.dm | 18 +++---- code/game/objects/item.dm | 6 +-- code/game/objects/item_damage.dm | 4 +- code/game/objects/item_materials.dm | 24 ++++----- code/game/objects/items/blackout.dm | 2 +- code/game/objects/items/devices/t_scanner.dm | 2 +- code/game/objects/items/devices/uplink.dm | 2 +- code/game/objects/items/plunger.dm | 2 +- code/game/objects/items/robot/robot_items.dm | 2 +- code/game/objects/items/stacks/rods.dm | 2 +- code/game/objects/items/stacks/stack.dm | 2 +- .../objects/items/stacks/tiles/tile_types.dm | 6 +-- code/game/objects/items/weapons/defib.dm | 2 +- .../items/weapons/grenades/smokebomb.dm | 2 +- code/game/objects/items/weapons/handcuffs.dm | 8 +-- .../objects/items/weapons/material/misc.dm | 6 +-- .../objects/items/weapons/material/shards.dm | 2 +- .../objects/items/weapons/nuclear_cylinder.dm | 2 +- code/game/objects/items/weapons/soap.dm | 2 +- .../objects/items/weapons/storage/internal.dm | 2 +- code/game/objects/items/weapons/tape.dm | 4 +- .../items/weapons/tools/weldingtool.dm | 4 +- code/game/objects/items/weapons/weaponry.dm | 28 +++++----- code/game/objects/objs.dm | 16 +++--- code/game/objects/objs_damage.dm | 6 +-- code/game/objects/structures/__structure.dm | 12 ++--- .../structures/_structure_construction.dm | 4 +- .../structures/_structure_materials.dm | 4 +- code/game/objects/structures/banners.dm | 4 +- code/game/objects/structures/barricade.dm | 2 +- .../crates_lockers/closets/__closet.dm | 2 +- .../closets/secure/_secure_closets.dm | 2 +- .../crates_lockers/closets/statue.dm | 16 +++--- .../objects/structures/defensive_barrier.dm | 6 +-- code/game/objects/structures/displaycase.dm | 2 +- code/game/objects/structures/doors/_door.dm | 2 +- code/game/objects/structures/fishtanks.dm | 2 +- code/game/objects/structures/girders.dm | 4 +- code/game/objects/structures/grille.dm | 2 +- code/game/objects/structures/inflatable.dm | 10 ++-- code/game/objects/structures/pit.dm | 24 ++++----- code/game/objects/structures/railing.dm | 34 ++++++------ code/game/objects/structures/rubble.dm | 2 +- .../stool_bed_chair_nest_sofa/wheelchair.dm | 2 +- code/game/objects/structures/tables.dm | 2 +- code/game/objects/structures/wall_frame.dm | 2 +- code/game/objects/structures/window.dm | 9 ++-- code/modules/blob/blob.dm | 32 ++++++------ code/modules/clothing/masks/voice.dm | 2 +- code/modules/crafting/_crafting_holder.dm | 2 +- .../tools/sample_kits/_sample.dm | 2 +- code/modules/events/computer_damage.dm | 2 +- code/modules/events/disposals_explosion.dm | 6 +-- code/modules/holodeck/HolodeckObjects.dm | 4 +- code/modules/hydroponics/seed_packets.dm | 2 +- .../hydroponics/spreading/spreading.dm | 24 ++++----- .../hydroponics/spreading/spreading_growth.dm | 10 ++-- .../integrated_electronics/core/assemblies.dm | 16 +++--- .../core/integrated_circuit.dm | 2 +- code/modules/materials/material_sheets.dm | 2 +- code/modules/materials/material_synth.dm | 2 +- code/modules/mechs/components/body.dm | 2 +- code/modules/mechs/equipment/combat.dm | 2 +- code/modules/mob/living/bot/bot.dm | 2 +- code/modules/mob/living/bot/ed209bot.dm | 2 +- code/modules/mob/living/bot/farmbot.dm | 2 +- code/modules/mob/living/bot/mulebot.dm | 2 +- code/modules/mob/living/bot/remotebot.dm | 2 +- code/modules/mob/living/bot/secbot.dm | 2 +- code/modules/mob/living/carbon/alien/alien.dm | 2 +- code/modules/mob/living/carbon/human/human.dm | 4 +- code/modules/mob/living/carbon/resist.dm | 4 +- code/modules/mob/living/deity/deity.dm | 2 +- code/modules/mob/living/living.dm | 5 +- code/modules/mob/living/living_defines.dm | 4 +- code/modules/mob/living/silicon/ai/ai.dm | 2 +- code/modules/mob/living/silicon/pai/pai.dm | 2 +- .../mob/living/silicon/robot/component.dm | 10 ++-- .../mob/living/silicon/robot/drone/drone.dm | 2 +- .../living/silicon/robot/drone/drone_items.dm | 4 +- .../modules/mob/living/silicon/robot/robot.dm | 2 +- .../mob/living/silicon/robot/robot_items.dm | 10 ++-- .../simple_animal/aquatic/aquatic_carp.dm | 2 +- .../simple_animal/aquatic/aquatic_fish.dm | 2 +- .../simple_animal/aquatic/aquatic_sharks.dm | 4 +- .../simple_animal/constructs/constructs.dm | 10 ++-- .../simple_animal/familiars/familiars.dm | 12 ++--- .../simple_animal/friendly/farm_animals.dm | 8 +-- .../living/simple_animal/friendly/koala.dm | 2 +- .../living/simple_animal/friendly/lizard.dm | 2 +- .../living/simple_animal/friendly/mouse.dm | 4 +- .../living/simple_animal/friendly/mushroom.dm | 2 +- .../living/simple_animal/friendly/possum.dm | 2 +- .../living/simple_animal/friendly/tomato.dm | 2 +- .../living/simple_animal/hostile/antlion.dm | 4 +- .../living/simple_animal/hostile/bad_drone.dm | 2 +- .../mob/living/simple_animal/hostile/bat.dm | 2 +- .../mob/living/simple_animal/hostile/bear.dm | 2 +- .../mob/living/simple_animal/hostile/carp.dm | 6 +-- .../hostile/commanded/bear_companion.dm | 2 +- .../hostile/commanded/nanomachines.dm | 2 +- .../living/simple_animal/hostile/creature.dm | 2 +- .../mob/living/simple_animal/hostile/drake.dm | 2 +- .../simple_animal/hostile/faithful_hound.dm | 2 +- .../living/simple_animal/hostile/faithless.dm | 2 +- .../simple_animal/hostile/giant_spider.dm | 12 ++--- .../living/simple_animal/hostile/hivebot.dm | 6 +-- .../mob/living/simple_animal/hostile/leech.dm | 2 +- .../mob/living/simple_animal/hostile/mimic.dm | 2 +- .../mob/living/simple_animal/hostile/pike.dm | 2 +- .../simple_animal/hostile/retaliate/clown.dm | 2 +- .../simple_animal/hostile/retaliate/drone.dm | 2 +- .../hostile/retaliate/exoplanet.dm | 10 ++-- .../hostile/retaliate/giant_crab.dm | 2 +- .../retaliate/giant_parrot/giant_parrot.dm | 6 +-- .../simple_animal/hostile/retaliate/goose.dm | 6 +-- .../simple_animal/hostile/retaliate/jelly.dm | 12 ++--- .../hostile/retaliate/king_of_goats.dm | 12 ++--- .../mob/living/simple_animal/hostile/slug.dm | 2 +- .../mob/living/simple_animal/hostile/tree.dm | 2 +- .../living/simple_animal/hostile/vagrant.dm | 2 +- .../simple_animal/hostile/viscerator.dm | 2 +- .../modules/mob/living/simple_animal/shade.dm | 2 +- .../mob/living/simple_animal/simple_animal.dm | 2 +- code/modules/mob_holder/_holder.dm | 2 +- code/modules/modular_computers/os/_os.dm | 4 +- code/modules/paperwork/paper_bundle.dm | 4 +- code/modules/paperwork/printer.dm | 4 +- code/modules/paperwork/toner_cartridge.dm | 2 +- code/modules/power/cable.dm | 2 +- .../power/fuel_assembly/fuel_assembly.dm | 2 +- code/modules/power/singularity/collector.dm | 6 +-- code/modules/power/solar.dm | 52 +++++++++---------- .../reagents/reagent_containers/borghydro.dm | 2 +- .../reagent_containers/food/meat/slabs.dm | 2 +- code/modules/reagents/reagent_dispenser.dm | 2 +- code/modules/recycling/disposalpipe.dm | 2 +- .../research/design_database_analyzer.dm | 2 +- code/modules/shieldgen/emergency_shield.dm | 32 ++++++------ .../spells/aoe_turf/conjure/druidic_spells.dm | 12 ++--- code/modules/spells/artifacts.dm | 2 +- code/modules/spells/hand/hand_item.dm | 2 +- .../spells/targeted/equip/burning_touch.dm | 2 +- code/modules/spells/targeted/shapeshift.dm | 4 +- code/modules/vehicles/bike.dm | 4 +- code/modules/vehicles/train.dm | 4 +- code/modules/vehicles/vehicle.dm | 20 +++---- code/unit_tests/obj_damage_tests.dm | 38 +++++++------- maps/away/bearcat/bearcat-2.dmm | 2 +- maps/away/errant_pisces/errant_pisces.dm | 6 +-- maps/away/errant_pisces/errant_pisces.dmm | 4 +- maps/away/liberia/liberia.dmm | 18 +++---- .../lost_supply_base/lost_supply_base.dmm | 4 +- maps/away/slavers/slavers_base.dm | 2 +- maps/away/unishi/unishi-3.dmm | 2 +- maps/exodus/exodus-2.dmm | 26 +++++----- maps/exodus/exodus-admin.dmm | 2 +- maps/ministation/ministation-0.dmm | 4 +- maps/ministation/ministation-2.dmm | 2 +- .../exoplanet_ruins/hydrobase/hydrobase.dm | 4 +- .../exoplanet_ruins/playablecolony/colony.dmm | 8 +-- maps/tradeship/tradeship-2.dmm | 4 +- .../away_sites/lar_maria/lar_maria-1.dmm | 8 +-- .../away_sites/lar_maria/lar_maria.dm | 6 +-- .../ruins/ec_old_crash/ec_old_crash.dmm | 2 +- mods/content/psionics/items/_items.dm | 6 +-- .../content/xenobiology/mobs/critter_slime.dm | 2 +- mods/content/xenobiology/slime/_slime.dm | 2 +- mods/content/xenobiology/slime/powers.dm | 2 +- mods/mobs/dionaea/mob/_nymph.dm | 2 +- mods/species/ascent/mobs/insectoid_egg.dm | 14 ++--- mods/species/ascent/mobs/nymph/_nymph.dm | 2 +- 204 files changed, 617 insertions(+), 615 deletions(-) diff --git a/code/datums/uplink/services.dm b/code/datums/uplink/services.dm index c9d49fb49d9..6bec9ead893 100644 --- a/code/datums/uplink/services.dm +++ b/code/datums/uplink/services.dm @@ -61,7 +61,7 @@ w_class = ITEM_SIZE_TINY icon = 'icons/obj/items/device/flash_synthetic.dmi' icon_state = ICON_STATE_WORLD - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE var/state = AWAITING_ACTIVATION var/service_label = "Unnamed Service" var/service_duration = 0 SECONDS diff --git a/code/game/atoms.dm b/code/game/atoms.dm index f7a582aebdf..e56a8e62ee5 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -52,6 +52,12 @@ var/tmp/default_pixel_z var/tmp/default_pixel_w + // Health vars largely used by obj and mob. + var/current_health + var/max_health + +/atom/proc/get_max_health() + return max_health /** Adjust variables prior to Initialize() based on the map diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index 3e7a3038904..37a1caaebd8 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -248,15 +248,15 @@ var/t if(wall) var/wall_max_health = wall.get_max_health() - if(wall.health >= wall_max_health) + if(wall.current_health >= wall_max_health) to_chat(user, "The wall doesn't need mending.") return - t = wall_max_health - wall.health - wall.health += t + t = wall_max_health - wall.current_health + wall.current_health += t else wall = new /obj/effect/cultwall(get_turf(src), bcolor) wall.rune = src - t = wall.health + t = wall.current_health user.remove_blood_simple(t / 50) speak_incantation(user, "Khari[pick("'","`")]d! Eske'te tannin!") to_chat(user, "Your blood flows into the rune, and you feel that the very space over the rune thickens.") @@ -269,7 +269,7 @@ color = "#ff0000" anchored = TRUE density = TRUE - obj_max_health = 200 + max_health = 200 var/obj/effect/rune/wall/rune /obj/effect/cultwall/Initialize(mapload, var/bcolor) @@ -287,9 +287,9 @@ . = ..() if(iscultist(user)) var/current_max_health = get_max_health() - if(health == current_max_health) + if(current_health == current_max_health) to_chat(user, "It is fully intact.") - else if(health > current_max_health * 0.5) + else if(current_health > current_max_health * 0.5) to_chat(user, "It is damaged.") else to_chat(user, "It is about to dissipate.") @@ -320,8 +320,8 @@ ..() /obj/effect/cultwall/proc/take_damage(var/amount) - health -= amount - if(health <= 0) + current_health -= amount + if(current_health <= 0) visible_message("\The [src] dissipates.") qdel(src) diff --git a/code/game/gamemodes/godmode/form_items/narsie_structures.dm b/code/game/gamemodes/godmode/form_items/narsie_structures.dm index 931188a64f1..184304aa52e 100644 --- a/code/game/gamemodes/godmode/form_items/narsie_structures.dm +++ b/code/game/gamemodes/godmode/form_items/narsie_structures.dm @@ -8,7 +8,7 @@ desc = "This forge gives off no heat, no light, its flames look almost unnatural." icon_state = "forge" build_cost = 1000 - health = 50 + current_health = 50 var/busy = 0 var/recipe_feat_list = "Blood Crafting" var/text_modifications = list("Cost" = "Blood", @@ -74,7 +74,7 @@ name = "bloody stone" desc = "A jagged stone covered in the various stages of blood, from dried to fresh." icon_state = "blood_stone" - health = 100 //Its a piece of rock. + current_health = 100 //Its a piece of rock. build_cost = 700 /obj/structure/deity/blood_stone/attack_hand(var/mob/user) diff --git a/code/game/gamemodes/godmode/god_altar.dm b/code/game/gamemodes/godmode/god_altar.dm index 34ddbfa847d..576271d8472 100644 --- a/code/game/gamemodes/godmode/god_altar.dm +++ b/code/game/gamemodes/godmode/god_altar.dm @@ -1,7 +1,7 @@ /obj/structure/deity/altar name = "altar" desc = "A structure made for the express purpose of religion." - health = 50 + current_health = 50 power_adjustment = 5 deity_flags = DEITY_STRUCTURE_ALONE build_cost = 1000 diff --git a/code/game/gamemodes/godmode/god_structures.dm b/code/game/gamemodes/godmode/god_structures.dm index cfe2aa2034f..6eaed5e088e 100644 --- a/code/game/gamemodes/godmode/god_structures.dm +++ b/code/game/gamemodes/godmode/god_structures.dm @@ -17,7 +17,7 @@ /obj/structure/deity icon = 'icons/obj/cult.dmi' - obj_max_health = 10 + max_health = 10 density = TRUE anchored = TRUE icon_state = "tomealtar" diff --git a/code/game/gamemodes/godmode/god_trap.dm b/code/game/gamemodes/godmode/god_trap.dm index bcab3d15328..240050d33b9 100644 --- a/code/game/gamemodes/godmode/god_trap.dm +++ b/code/game/gamemodes/godmode/god_trap.dm @@ -1,6 +1,6 @@ /obj/structure/deity/trap density = FALSE - health = 1 + current_health = 1 var/triggered = 0 /obj/structure/deity/trap/Initialize() diff --git a/code/game/machinery/_machines_base/machinery.dm b/code/game/machinery/_machines_base/machinery.dm index 70f7aeca353..1c049a5f2ed 100644 --- a/code/game/machinery/_machines_base/machinery.dm +++ b/code/game/machinery/_machines_base/machinery.dm @@ -407,7 +407,7 @@ Class Procs: to_chat(user, "Following parts detected in the machine:") for(var/obj/item/C in component_parts) var/line = " [C.name]" - if(!C.health) + if(!C.current_health) line = " [C.name] (destroyed)" else if(C.get_percent_health() < 75) line = " [C.name] (damaged)" diff --git a/code/game/machinery/_machines_base/machinery_damage.dm b/code/game/machinery/_machines_base/machinery_damage.dm index 328b8d95dbb..8c7953186f9 100644 --- a/code/game/machinery/_machines_base/machinery_damage.dm +++ b/code/game/machinery/_machines_base/machinery_damage.dm @@ -54,7 +54,7 @@ if(uncreated_component_parts[path]) var/obj/item/stock_parts/component = path //Must be checked this way, since we don't have an instance to call component.can_take_damage() on. - if(initial(component.obj_max_health) != ITEM_HEALTH_NO_DAMAGE) + if(initial(component.max_health) != ITEM_HEALTH_NO_DAMAGE) return force_init_component(path) /obj/machinery/proc/on_component_failure(var/obj/item/stock_parts/component) diff --git a/code/game/machinery/_machines_base/stock_parts/_stock_parts.dm b/code/game/machinery/_machines_base/stock_parts/_stock_parts.dm index 035c2daf23b..f8d322d4361 100644 --- a/code/game/machinery/_machines_base/stock_parts/_stock_parts.dm +++ b/code/game/machinery/_machines_base/stock_parts/_stock_parts.dm @@ -89,7 +89,7 @@ SetName("broken [name]") /obj/item/stock_parts/proc/is_functional() - return (!can_take_damage()) || (health > 0) + return (!can_take_damage()) || (current_health > 0) /obj/item/stock_parts/examine(mob/user) . = ..() diff --git a/code/game/machinery/_machines_base/stock_parts/access_lock.dm b/code/game/machinery/_machines_base/stock_parts/access_lock.dm index 8cbb0084bb2..c69c206ed6e 100644 --- a/code/game/machinery/_machines_base/stock_parts/access_lock.dm +++ b/code/game/machinery/_machines_base/stock_parts/access_lock.dm @@ -4,7 +4,7 @@ icon_state = "lock" part_flags = PART_FLAG_QDEL req_access = list(access_engine_equip) // set req_access on this to impose access requirements. - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE var/locked = FALSE var/emagged = FALSE var/autoset = FALSE // Whether the machine should inherit access from surrounding areas @@ -151,7 +151,7 @@ req_access = conf_access.Copy() /obj/item/stock_parts/access_lock/buildable - obj_max_health = null //Buildable variant may take damage + max_health = null //Buildable variant may take damage part_flags = PART_FLAG_HAND_REMOVE material = /decl/material/solid/metal/steel matter = list(/decl/material/solid/fiberglass = MATTER_AMOUNT_REINFORCEMENT) diff --git a/code/game/machinery/_machines_base/stock_parts/building_material.dm b/code/game/machinery/_machines_base/stock_parts/building_material.dm index a26bc2e622c..615a39b9a85 100644 --- a/code/game/machinery/_machines_base/stock_parts/building_material.dm +++ b/code/game/machinery/_machines_base/stock_parts/building_material.dm @@ -6,7 +6,7 @@ icon = 'icons/obj/power.dmi' icon_state = "coil" part_flags = PART_FLAG_QDEL - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE var/list/materials /obj/item/stock_parts/building_material/Destroy() diff --git a/code/game/machinery/_machines_base/stock_parts/card_reader.dm b/code/game/machinery/_machines_base/stock_parts/card_reader.dm index 635ad00735e..fb8b1fe8d34 100644 --- a/code/game/machinery/_machines_base/stock_parts/card_reader.dm +++ b/code/game/machinery/_machines_base/stock_parts/card_reader.dm @@ -13,13 +13,13 @@ /decl/material/solid/metal/copper = MATTER_AMOUNT_TRACE, /decl/material/solid/fiberglass = MATTER_AMOUNT_TRACE, ) - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE var/should_swipe = FALSE //Whether the card should only be swiped instead of being inserted var/obj/item/card/inserted_card //Card currently in the slot /obj/item/stock_parts/item_holder/card_reader/buildable part_flags = PART_FLAG_HAND_REMOVE - obj_max_health = 56 + max_health = 56 /obj/item/stock_parts/item_holder/card_reader/Destroy() QDEL_NULL(inserted_card) diff --git a/code/game/machinery/_machines_base/stock_parts/disk_reader.dm b/code/game/machinery/_machines_base/stock_parts/disk_reader.dm index e52f484c2e2..eb6a5b8fe72 100644 --- a/code/game/machinery/_machines_base/stock_parts/disk_reader.dm +++ b/code/game/machinery/_machines_base/stock_parts/disk_reader.dm @@ -13,12 +13,12 @@ /decl/material/solid/metal/copper = MATTER_AMOUNT_REINFORCEMENT, /decl/material/solid/fiberglass = MATTER_AMOUNT_REINFORCEMENT, ) - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE var/obj/item/disk/disk //Disk currently inserted /obj/item/stock_parts/item_holder/disk_reader/buildable part_flags = PART_FLAG_HAND_REMOVE - obj_max_health = 56 + max_health = 56 /obj/item/stock_parts/item_holder/disk_reader/Destroy() QDEL_NULL(disk) diff --git a/code/game/machinery/_machines_base/stock_parts/power/battery.dm b/code/game/machinery/_machines_base/stock_parts/power/battery.dm index c6d315ea0ef..f883e307f14 100644 --- a/code/game/machinery/_machines_base/stock_parts/power/battery.dm +++ b/code/game/machinery/_machines_base/stock_parts/power/battery.dm @@ -195,7 +195,7 @@ return "The machine can receive power from an installed power cell." /obj/item/stock_parts/power/battery/buildable - obj_max_health = null //Buildable variant may take damage + max_health = null //Buildable variant may take damage part_flags = PART_FLAG_HAND_REMOVE material = /decl/material/solid/metal/steel diff --git a/code/game/machinery/_machines_base/stock_parts/power/power.dm b/code/game/machinery/_machines_base/stock_parts/power/power.dm index 0f21a6c23c2..7e8870ab3fc 100644 --- a/code/game/machinery/_machines_base/stock_parts/power/power.dm +++ b/code/game/machinery/_machines_base/stock_parts/power/power.dm @@ -7,7 +7,7 @@ part_flags = PART_FLAG_QDEL // For integrated components, which are built from uncreated_component_parts. Use subtypes with this off for buildable ones. icon = 'icons/obj/items/stock_parts/stock_parts.dmi' icon_state = "teslalink" - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE var/priority = 0 // Higher priority is used first var/cached_channel diff --git a/code/game/machinery/_machines_base/stock_parts/power/terminal.dm b/code/game/machinery/_machines_base/stock_parts/power/terminal.dm index 31c3eaa829e..20d892e14ea 100644 --- a/code/game/machinery/_machines_base/stock_parts/power/terminal.dm +++ b/code/game/machinery/_machines_base/stock_parts/power/terminal.dm @@ -163,7 +163,7 @@ /obj/item/stock_parts/power/terminal/buildable part_flags = PART_FLAG_HAND_REMOVE - obj_max_health = null //Buildable variant may take damage + max_health = null //Buildable variant may take damage material = /decl/material/solid/metal/steel /decl/stock_part_preset/terminal_connect diff --git a/code/game/machinery/_machines_base/stock_parts/power/tesla.dm b/code/game/machinery/_machines_base/stock_parts/power/tesla.dm index 448a5e6f65a..4b7a5ecdab8 100644 --- a/code/game/machinery/_machines_base/stock_parts/power/tesla.dm +++ b/code/game/machinery/_machines_base/stock_parts/power/tesla.dm @@ -30,6 +30,6 @@ return "The machine can receive power wirelessly from a nearby area power controller." /obj/item/stock_parts/power/apc/buildable - obj_max_health = null //Buildable variant may take damage + max_health = null //Buildable variant may take damage part_flags = PART_FLAG_HAND_REMOVE material = /decl/material/solid/metal/steel \ No newline at end of file diff --git a/code/game/machinery/_machines_base/stock_parts/radio/receiver.dm b/code/game/machinery/_machines_base/stock_parts/radio/receiver.dm index 80a526af3cc..b35afa55d73 100644 --- a/code/game/machinery/_machines_base/stock_parts/radio/receiver.dm +++ b/code/game/machinery/_machines_base/stock_parts/radio/receiver.dm @@ -46,6 +46,6 @@ method.perform(machine, signal.data[thing]) /obj/item/stock_parts/radio/receiver/buildable - obj_max_health = null //Buildable variant may take damage + max_health = null //Buildable variant may take damage part_flags = PART_FLAG_HAND_REMOVE material = /decl/material/solid/metal/steel \ No newline at end of file diff --git a/code/game/machinery/_machines_base/stock_parts/radio/stock_parts_radio.dm b/code/game/machinery/_machines_base/stock_parts/radio/stock_parts_radio.dm index 645421a441b..e1a96719417 100644 --- a/code/game/machinery/_machines_base/stock_parts/radio/stock_parts_radio.dm +++ b/code/game/machinery/_machines_base/stock_parts/radio/stock_parts_radio.dm @@ -1,6 +1,6 @@ /obj/item/stock_parts/radio part_flags = PART_FLAG_QDEL - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE var/datum/radio_frequency/radio var/frequency var/id_tag diff --git a/code/game/machinery/_machines_base/stock_parts/radio/transmitter.dm b/code/game/machinery/_machines_base/stock_parts/radio/transmitter.dm index be30a9232e9..e9d4feec331 100644 --- a/code/game/machinery/_machines_base/stock_parts/radio/transmitter.dm +++ b/code/game/machinery/_machines_base/stock_parts/radio/transmitter.dm @@ -113,14 +113,14 @@ queue_transmit(dat) /obj/item/stock_parts/radio/transmitter/basic/buildable - obj_max_health = null //Buildable variant may take damage + max_health = null //Buildable variant may take damage part_flags = PART_FLAG_HAND_REMOVE name = "basic radio transmitter" desc = "A stock radio transmitter machine component. Can transmit updates regularly or on change." material = /decl/material/solid/metal/steel /obj/item/stock_parts/radio/transmitter/on_event/buildable - obj_max_health = null //Buildable variant may take damage + max_health = null //Buildable variant may take damage part_flags = PART_FLAG_HAND_REMOVE name = "event radio transmitter" desc = "A radio transmitter machine component which transmits when activated by an event." diff --git a/code/game/machinery/_machines_base/stock_parts/stock_parts_interface.dm b/code/game/machinery/_machines_base/stock_parts/stock_parts_interface.dm index 7a9fe0cf2aa..b1aa3c32f90 100644 --- a/code/game/machinery/_machines_base/stock_parts/stock_parts_interface.dm +++ b/code/game/machinery/_machines_base/stock_parts/stock_parts_interface.dm @@ -6,7 +6,7 @@ material = /decl/material/solid/fiberglass base_type = /obj/item/stock_parts/console_screen part_flags = PART_FLAG_HAND_REMOVE - obj_max_health = 20 + max_health = 20 ignore_damage_types = list(ELECTROCUTE) // emp damage is annoying enough without destroying purely physical or mechanical components /obj/item/stock_parts/console_screen/on_refresh(obj/machinery/machine) diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm index 2cae375724d..b1391c511a5 100644 --- a/code/game/machinery/atmoalter/canister.dm +++ b/code/game/machinery/atmoalter/canister.dm @@ -3,7 +3,7 @@ icon = 'icons/obj/atmos.dmi' icon_state = "yellow" density = TRUE - obj_max_health = 100 + max_health = 100 obj_flags = OBJ_FLAG_CONDUCTIBLE w_class = ITEM_SIZE_GARGANTUAN construct_state = /decl/machine_construction/pipe/welder @@ -175,7 +175,7 @@ update_flag /obj/machinery/portable_atmospherics/canister/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume) if(exposed_temperature > temperature_resistance) - health -= 5 + current_health -= 5 healthcheck() return ..() @@ -183,7 +183,7 @@ update_flag if(destroyed) return 1 - if (src.health <= 10) + if (current_health <= 10) var/atom/location = src.loc location.assume_air(air_contents) @@ -258,14 +258,14 @@ update_flag return if(Proj.damage) - src.health -= round(Proj.damage / 2) + current_health -= round(Proj.damage / 2) healthcheck() ..() /obj/machinery/portable_atmospherics/canister/bash(var/obj/item/W, var/mob/user) . = ..() if(.) - health -= W.force + current_health -= W.force healthcheck() /obj/machinery/portable_atmospherics/canister/attackby(var/obj/item/W, var/mob/user) diff --git a/code/game/machinery/deployable.dm b/code/game/machinery/deployable.dm index a1cc475b5f3..67cfca13450 100644 --- a/code/game/machinery/deployable.dm +++ b/code/game/machinery/deployable.dm @@ -12,7 +12,7 @@ anchored = FALSE density = TRUE icon_state = "barrier0" - obj_max_health = 100 + max_health = 100 var/locked = 0.0 /obj/machinery/deployable/barrier/Initialize() @@ -39,8 +39,8 @@ return else if(IS_WRENCH(W)) var/current_max_health = get_max_health() - if (health < current_max_health) - health = current_max_health + if (current_health < current_max_health) + current_health = current_max_health emagged = 0 req_access = list(access_security) visible_message("[user] repairs \the [src]!") @@ -54,21 +54,21 @@ else switch(W.damtype) if(BURN) - src.health -= W.force * 0.75 + current_health -= W.force * 0.75 if(BRUTE) - src.health -= W.force * 0.5 - if (src.health <= 0) - src.explode() + current_health -= W.force * 0.5 + if (current_health <= 0) + explode() ..() /obj/machinery/deployable/barrier/explosion_act(severity) . = ..() if(. && !QDELETED(src)) if(severity == 1) - health = 0 + current_health = 0 else if(severity == 2) - health -= 25 - if(health <= 0) + current_health -= 25 + if(current_health <= 0) explode() /obj/machinery/deployable/barrier/emp_act(severity) diff --git a/code/game/machinery/doors/_door.dm b/code/game/machinery/doors/_door.dm index 29dac3798bd..1158bd88ac7 100644 --- a/code/game/machinery/doors/_door.dm +++ b/code/game/machinery/doors/_door.dm @@ -14,7 +14,7 @@ construct_state = /decl/machine_construction/default/panel_closed/door uncreated_component_parts = null required_interaction_dexterity = DEXTERITY_SIMPLE_MACHINES - obj_max_health = 300 + max_health = 300 var/can_open_manually = TRUE @@ -253,7 +253,7 @@ to_chat(user, "It looks like \the [src] is pretty busted. It's going to need more than just patching up now.") return TRUE var/current_max_health = get_max_health() - if(health >= current_max_health) + if(current_health >= current_max_health) to_chat(user, "Nothing to fix!") return TRUE if(!density) @@ -261,7 +261,7 @@ return TRUE //figure out how much metal we need - var/amount_needed = (current_max_health - health) / DOOR_REPAIR_AMOUNT + var/amount_needed = (current_max_health - current_health) / DOOR_REPAIR_AMOUNT amount_needed = CEILING(amount_needed) var/obj/item/stack/stack = I @@ -293,7 +293,7 @@ playsound(src, 'sound/items/Welder.ogg', 100, 1) if(do_after(user, 5 * repairing.amount, src) && welder && welder.isOn()) to_chat(user, "You finish repairing the damage to \the [src].") - health = clamp(health, health + repairing.amount*DOOR_REPAIR_AMOUNT, get_max_health()) + current_health = clamp(current_health, current_health + repairing.amount*DOOR_REPAIR_AMOUNT, get_max_health()) update_icon() qdel(repairing) repairing = null @@ -334,7 +334,7 @@ return FALSE /obj/machinery/door/take_damage(var/damage, damtype=BRUTE) - if(!health) + if(!current_health) ..(damage, damtype) update_icon() return @@ -344,16 +344,16 @@ //Part of damage is soaked by our own health var/current_max_health = get_max_health() - var/initialhealth = health - health = max(0, health - damage) - if(health <= 0 && initialhealth > 0) + var/initialhealth = current_health + current_health = max(0, current_health - damage) + if(current_health <= 0 && initialhealth > 0) visible_message(SPAN_WARNING("\The [src] breaks down!")) set_broken(TRUE) - else if(health < current_max_health / 4 && initialhealth >= current_max_health / 4) + else if(current_health < current_max_health / 4 && initialhealth >= current_max_health / 4) visible_message(SPAN_WARNING("\The [src] looks like it's about to break!")) - else if(health < current_max_health / 2 && initialhealth >= current_max_health / 2) + else if(current_health < current_max_health / 2 && initialhealth >= current_max_health / 2) visible_message(SPAN_WARNING("\The [src] looks seriously damaged!")) - else if(health < current_max_health * 3/4 && initialhealth >= current_max_health * 3/4) + else if(current_health < current_max_health * 3/4 && initialhealth >= current_max_health * 3/4) visible_message(SPAN_WARNING("\The [src] shows signs of damage!")) ..(component_damage, damtype) @@ -362,23 +362,23 @@ //How much damage should be passed to components inside even when door health is non zero /obj/machinery/door/proc/get_damage_leakthrough(var/damage, damtype=BRUTE) var/current_max_health = get_max_health() - if(health > 0.75 * current_max_health && damage < 10) + if(current_health > 0.75 * current_max_health && damage < 10) return 0 - . = round((1 - health/current_max_health) * damage) + . = round((1 - current_health/current_max_health) * damage) /obj/machinery/door/examine(mob/user) . = ..() - if(health <= 0) + if(current_health <= 0) to_chat(user, "\The [src] is broken!") else var/current_max_health = get_max_health() - if(health < current_max_health / 4) + if(current_health < current_max_health / 4) to_chat(user, "\The [src] looks like it's about to break!") - else if(health < current_max_health / 2) + else if(current_health < current_max_health / 2) to_chat(user, "\The [src] looks seriously damaged!") - else if(health < current_max_health * 3/4) + else if(current_health < current_max_health * 3/4) to_chat(user, "\The [src] shows signs of damage!") - else if(health < current_max_health && get_dist(src, user) <= 1) + else if(current_health < current_max_health && get_dist(src, user) <= 1) to_chat(user, "\The [src] has some minor scuffing.") var/mob/living/carbon/human/H = user diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 45eb79c2c93..f22bd5e9b7a 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -400,7 +400,7 @@ About the new airlock wires panel: if(stat & BROKEN) damage_overlay = sparks_broken_file - else if(health < get_max_health() * 3/4) + else if(current_health < get_max_health() * 3/4) damage_overlay = sparks_damaged_file if(welded) @@ -767,7 +767,7 @@ About the new airlock wires panel: return TRUE else if(!repairing) // Add some minor damage as evidence of forcing. - if(health >= get_max_health()) + if(current_health >= get_max_health()) take_damage(1) if(arePowerSystemsOn()) to_chat(user, SPAN_WARNING("The airlock's motors resist your efforts to force it.")) @@ -824,10 +824,10 @@ About the new airlock wires panel: var/obj/item/twohanded/fireaxe/F = I if (F.wielded) playsound(src, 'sound/weapons/smash.ogg', 100, 1) - health -= F.force_wielded * 2 - if(health <= 0) + current_health -= F.force_wielded * 2 + if(current_health <= 0) user.visible_message(SPAN_DANGER("[user] smashes \the [I] into the airlock's control panel! It explodes in a shower of sparks!"), SPAN_DANGER("You smash \the [I] into the airlock's control panel! It explodes in a shower of sparks!")) - health = 0 + current_health = 0 set_broken(TRUE) else user.visible_message(SPAN_DANGER("[user] smashes \the [I] into the airlock's control panel!")) @@ -1027,7 +1027,7 @@ About the new airlock wires panel: glass = TRUE set_opacity(0) hitsound = 'sound/effects/Glasshit.ogg' - obj_max_health = 300 + max_health = 300 explosion_resistance = 5 else door_color = mat.color diff --git a/code/game/machinery/doors/airlock_subtypes.dm b/code/game/machinery/doors/airlock_subtypes.dm index fa9a5ed7730..179b0d35d2c 100644 --- a/code/game/machinery/doors/airlock_subtypes.dm +++ b/code/game/machinery/doors/airlock_subtypes.dm @@ -67,7 +67,7 @@ name = "Glass Airlock" icon_state = "preview_glass" hitsound = 'sound/effects/Glasshit.ogg' - obj_max_health = 300 + max_health = 300 explosion_resistance = 5 opacity = FALSE glass = TRUE @@ -193,7 +193,7 @@ opacity = FALSE /obj/machinery/door/airlock/external/glass - obj_max_health = 300 + max_health = 300 explosion_resistance = 5 opacity = FALSE glass = TRUE diff --git a/code/game/machinery/doors/blast_door.dm b/code/game/machinery/doors/blast_door.dm index f016e229e4f..1bd45784750 100644 --- a/code/game/machinery/doors/blast_door.dm +++ b/code/game/machinery/doors/blast_door.dm @@ -158,7 +158,7 @@ to_chat(user, "[src]'s motors resist your effort.") return if(istype(C, /obj/item/stack/material) && C.get_material_type() == /decl/material/solid/metal/plasteel) - var/amt = CEILING((get_max_health() - health)/150) + var/amt = CEILING((get_max_health() - current_health)/150) if(!amt) to_chat(user, "\The [src] is already fully functional.") return @@ -209,7 +209,7 @@ // Parameters: None // Description: Fully repairs the blast door. /obj/machinery/door/blast/proc/repair() - health = get_max_health() + current_health = get_max_health() set_broken(FALSE) queue_icon_update() @@ -312,7 +312,7 @@ icon_state_closed_broken = "closed_broken" min_force = 30 - obj_max_health = 1000 + max_health = 1000 block_air_zones = 1 var/icon_lower_door_open = "open_bottom" @@ -354,7 +354,7 @@ open_sound = 'sound/machines/shutters_open.ogg' close_sound = 'sound/machines/shutters_close.ogg' min_force = 15 - obj_max_health = 500 + max_health = 500 explosion_resistance = 10 pry_mod = 0.55 frame_type = /obj/structure/door_assembly/blast/shutter diff --git a/code/game/machinery/doors/braces.dm b/code/game/machinery/doors/braces.dm index 1c88f28dc8d..39b91a4f4b6 100644 --- a/code/game/machinery/doors/braces.dm +++ b/code/game/machinery/doors/braces.dm @@ -102,7 +102,7 @@ return if(C.weld(0,user)) playsound(src, 'sound/items/Welder.ogg', 100, 1) - health = min(health + rand(20,30), get_max_health()) + current_health = min(current_health + rand(20,30), get_max_health()) if(!is_damaged()) to_chat(user, "You repair some dents on \the [src]. It is in perfect condition now.") else diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index 6348cee1eec..c1b0ec18694 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -5,8 +5,8 @@ icon_state = "left" min_force = 4 hitsound = 'sound/effects/Glasshit.ogg' - obj_max_health = 150 //If you change this, consiter changing ../door/window/brigdoor/ health at the bottom of this .dm file - health = 150 + max_health = 150 //If you change this, consiter changing ../door/window/brigdoor/ health at the bottom of this .dm file + current_health = 150 visible = 0.0 use_power = POWER_USE_OFF stat_immune = NOSCREEN | NOINPUT | NOPOWER @@ -60,17 +60,17 @@ if (!( ismob(AM) )) var/mob/living/bot/bot = AM if(istype(bot)) - if(density && src.check_access(bot.botcard)) + if(density && check_access(bot.botcard)) open() addtimer(CALLBACK(src, PROC_REF(close)), 50, TIMER_UNIQUE | TIMER_OVERRIDE) return var/mob/M = AM // we've returned by here if M is not a mob - if (src.operating) + if (operating) return - if (src.density && (!issmall(M) || ishuman(M) || issilicon(M)) && src.allowed(AM)) + if (density && (!issmall(M) || ishuman(M) || issilicon(M)) && allowed(AM)) open() var/open_timer - if(src.check_access(null)) + if(check_access(null)) open_timer = 50 else //secure doors close faster open_timer = 20 @@ -97,12 +97,12 @@ /obj/machinery/door/window/open() if (operating == 1) //doors can still open when emag-disabled return 0 - if (!src.operating) //in case of emag - src.operating = 1 + if (!operating) //in case of emag + operating = 1 - icon_state = "[src.base_state]open" - flick("[src.base_state]opening", src) - playsound(src.loc, 'sound/machines/windowdoor.ogg', 100, 1) + icon_state = "[base_state]open" + flick("[base_state]opening", src) + playsound(loc, 'sound/machines/windowdoor.ogg', 100, 1) sleep(0.9 SECONDS) explosion_resistance = 0 @@ -116,12 +116,12 @@ return TRUE /obj/machinery/door/window/close() - if (src.operating) + if (operating) return 0 operating = 1 - flick(text("[]closing", src.base_state), src) - playsound(src.loc, 'sound/machines/windowdoor.ogg', 100, 1) + flick("[base_state]closing", src) + playsound(loc, 'sound/machines/windowdoor.ogg', 100, 1) set_density(TRUE) update_icon() explosion_resistance = initial(explosion_resistance) @@ -133,8 +133,8 @@ return TRUE /obj/machinery/door/window/take_damage(var/damage) - src.health = max(0, src.health - damage) - if (src.health <= 0) + current_health = max(0, current_health - damage) + if (current_health <= 0) shatter() return @@ -142,8 +142,8 @@ if(ishuman(user)) var/mob/living/carbon/human/H = user if(H.species.can_shred(H)) - playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1) - visible_message("[user] smashes against the [src.name].", 1) + playsound(loc, 'sound/effects/Glasshit.ogg', 75, 1) + visible_message("\The [user] smashes against \the [src].", 1) take_damage(25) return TRUE return ..() @@ -185,8 +185,8 @@ if(.) return - if (src.allowed(user)) - if (src.density) + if (allowed(user)) + if (density) open() else if (emagged) @@ -194,16 +194,16 @@ return close() - else if (src.density) - flick(text("[]deny", src.base_state), src) + else if (density) + flick("[base_state]deny", src) /obj/machinery/door/window/bash(obj/item/I, mob/user) //Emags and ninja swords? You may pass. if (istype(I, /obj/item/energy_blade)) var/obj/item/energy_blade/blade = I if(blade.is_special_cutting_tool() && emag_act(10, user)) - spark_at(src.loc, amount=5) - playsound(src.loc, 'sound/weapons/blade1.ogg', 50, 1) + spark_at(loc, amount=5) + playsound(loc, 'sound/weapons/blade1.ogg', 50, 1) visible_message(SPAN_WARNING("The glass door was sliced open by [user]!")) return 1 return ..() @@ -213,8 +213,8 @@ icon = 'icons/obj/doors/windoor.dmi' icon_state = "leftsecure" base_state = "leftsecure" - obj_max_health = 300 - health = 300.0 //Stronger doors for prison (regular window door health is 150) + max_health = 300 + current_health = 300.0 //Stronger doors for prison (regular window door health is 150) pry_mod = 0.65 diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index 8966bd3e2ac..b6beac9ba51 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -17,7 +17,7 @@ idle_power_usage = 50 //when inactive, this turret takes up constant 50 Equipment power active_power_usage = 300 //when active, this turret takes up constant 300 Equipment power power_channel = EQUIP //drains power from the EQUIPMENT channel - obj_max_health = 80 + max_health = 80 var/raised = 0 //if the turret cover is "open" and the turret is raised var/raising= 0 //if the turret is currently opening or closing its cover @@ -79,7 +79,7 @@ ailock = 0 malf_upgraded = 1 to_chat(user, "\The [src] has been upgraded. It's damage and rate of fire has been increased. Auto-regeneration system has been enabled. Power usage has increased.") - obj_max_health = round(initial(obj_max_health) * 1.5) + max_health = round(initial(max_health) * 1.5) shot_delay = round(initial(shot_delay) / 2) auto_repair = 1 change_power_consumption(round(initial(active_power_usage) * 5), POWER_USE_ACTIVE) @@ -332,10 +332,10 @@ var/global/list/turret_icons if(force < 5) return - health -= force + current_health -= force if (force > 5 && prob(45)) spark_at(src, amount = 5) - if(health <= 0) + if(current_health <= 0) die() //the death process :( /obj/machinery/porta_turret/bullet_act(obj/item/projectile/Proj) @@ -383,12 +383,12 @@ var/global/list/turret_icons if(severity == 1 || (severity == 2 && prob(25))) physically_destroyed() else if(severity == 2) - take_damage(initial(health) * 8) + take_damage(initial(current_health) * 8) else - take_damage(initial(health) * 8 / 3) + take_damage(initial(current_health) * 8 / 3) /obj/machinery/porta_turret/proc/die() //called when the turret dies, ie, health <= 0 - health = 0 + current_health = 0 set_broken(TRUE) spark_at(src, amount = 5) atom_flags |= ATOM_FLAG_CLIMBABLE // they're now climbable @@ -415,9 +415,9 @@ var/global/list/turret_icons popDown() // no valid targets, close the cover var/current_max_health = get_max_health() - if(auto_repair && (health < current_max_health)) + if(auto_repair && (current_health < current_max_health)) use_power_oneoff(20000) - health = min(health+1, current_max_health) // 1HP for 20kJ + current_health = min(current_health+1, current_max_health) // 1HP for 20kJ /obj/machinery/porta_turret/proc/assess_and_assign(var/mob/living/L, var/list/targets, var/list/secondarytargets) switch(assess_living(L)) diff --git a/code/game/objects/effects/decals/posters/_poster.dm b/code/game/objects/effects/decals/posters/_poster.dm index 1574f21c9de..c91bed259fa 100644 --- a/code/game/objects/effects/decals/posters/_poster.dm +++ b/code/game/objects/effects/decals/posters/_poster.dm @@ -9,7 +9,7 @@ anchored = TRUE directional_offset = @'{"NORTH":{"y":32}, "SOUTH":{"y":-32}, "WEST":{"x":32}, "EAST":{"x":-32}}' material = /decl/material/solid/organic/paper - obj_max_health = 10 + max_health = 10 parts_type = /obj/item/poster parts_amount = 1 @@ -112,7 +112,7 @@ if(ruined == _ruined) return ruined = _ruined - health = (!ruined)? max(health, 1) : 0 //setting unruined implies health > 0 + current_health = (!ruined)? max(current_health, 1) : 0 //setting unruined implies health > 0 //Make sure we look the part update_appearence() diff --git a/code/game/objects/effects/spiders.dm b/code/game/objects/effects/spiders.dm index d1899f315d9..d24b387cc19 100644 --- a/code/game/objects/effects/spiders.dm +++ b/code/game/objects/effects/spiders.dm @@ -5,7 +5,7 @@ icon = 'icons/effects/effects.dmi' anchored = TRUE density = FALSE - obj_max_health = 15 + max_health = 15 //similar to weeds, but only barfed out by nurses manually /obj/effect/spider/explosion_act(severity) @@ -53,21 +53,21 @@ damage = 15 playsound(loc, 'sound/items/Welder.ogg', 100, 1) - health -= damage + current_health -= damage healthcheck() /obj/effect/spider/bullet_act(var/obj/item/projectile/Proj) ..() - health -= Proj.get_structure_damage() + current_health -= Proj.get_structure_damage() healthcheck() /obj/effect/spider/proc/healthcheck() - if(health <= 0) + if(current_health <= 0) qdel(src) /obj/effect/spider/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume) if(exposed_temperature > 300 + T0C) - health -= 5 + current_health -= 5 healthcheck() if(!QDELETED(src)) return ..() @@ -145,7 +145,7 @@ icon_state = "lesser" anchored = FALSE layer = BELOW_OBJ_LAYER - obj_max_health = 3 + max_health = 3 var/mob/living/simple_animal/hostile/giant_spider/greater_form var/last_itch = 0 var/amount_grown = -1 @@ -194,7 +194,7 @@ /obj/effect/spider/spiderling/attackby(var/obj/item/W, var/mob/user) ..() - if(health > 0) + if(current_health > 0) disturbed() /obj/effect/spider/spiderling/Crossed(atom/movable/AM) @@ -218,7 +218,7 @@ ..() /obj/effect/spider/spiderling/healthcheck() - if(health <= 0) + if(current_health <= 0) die() /obj/effect/spider/spiderling/proc/check_vent(obj/machinery/atmospherics/unary/vent_pump/exit_vent) @@ -336,7 +336,7 @@ name = "cocoon" desc = "Something wrapped in silky spider web." icon_state = "cocoon1" - obj_max_health = 60 + max_health = 60 /obj/effect/spider/cocoon/Initialize() . = ..() diff --git a/code/game/objects/item.dm b/code/game/objects/item.dm index 17a54989c19..9383645251a 100644 --- a/code/game/objects/item.dm +++ b/code/game/objects/item.dm @@ -106,8 +106,8 @@ return origin_tech /obj/item/Initialize(var/ml, var/material_key) - if(isnull(health)) - health = obj_max_health //Make sure to propagate obj_max_health to health var before material setup, for consistency + if(isnull(current_health)) + current_health = max_health //Make sure to propagate max_health to health var before material setup, for consistency if(!ispath(material_key, /decl/material)) material_key = material if(material_key) @@ -156,8 +156,8 @@ clone = ..() clone.contaminated = contaminated clone.blood_overlay = image(blood_overlay) + clone.current_health = current_health - clone.health = health //#TODO: once item damage in, check health! //Coating diff --git a/code/game/objects/item_damage.dm b/code/game/objects/item_damage.dm index e47a7f80fe1..382fe5e7afe 100644 --- a/code/game/objects/item_damage.dm +++ b/code/game/objects/item_damage.dm @@ -18,8 +18,8 @@ return 0 //must return a number //Apply damage - damage = min(health, damage) - health = clamp(health - damage, 0, get_max_health()) + damage = min(current_health, damage) + current_health = clamp(current_health - damage, 0, get_max_health()) check_health(damage, damage_type, damage_flags) return damage diff --git a/code/game/objects/item_materials.dm b/code/game/objects/item_materials.dm index 0641b90cd21..96d492cfd77 100644 --- a/code/game/objects/item_materials.dm +++ b/code/game/objects/item_materials.dm @@ -28,13 +28,13 @@ /obj/item/proc/apply_wear() if(material && can_take_damage() && can_take_wear_damage() && prob(material.hardness)) if(material.is_brittle()) - health = 0 + current_health = 0 else - health-- + current_health-- check_health() /obj/item/proc/check_health(var/lastdamage = null, var/lastdamtype = null, var/lastdamflags = 0, var/consumed = FALSE) - if(health > 0 || !can_take_damage()) + if(current_health > 0 || !can_take_damage()) return //If invincible, or if we're not dead yet, skip if(lastdamtype == BRUTE) if(material?.is_brittle()) @@ -87,15 +87,15 @@ if(new_material) material = GET_DECL(new_material) if(istype(material)) - //Only set the health if health is null. Some things define their own health value. - if(isnull(obj_max_health)) - obj_max_health = round(material_health_multiplier * material.integrity, 0.01) - if(obj_max_health < 1) - //Make sure to warn us if the values we set make the obj_max_health be under 1 - log_warning("The 'obj_max_health' of '[src]'([type]) made out of '[material]' was calculated as [material_health_multiplier] * [material.integrity] == [obj_max_health], which is smaller than 1.") - - if(isnull(health)) //only set health if we didn't specify one already, so damaged objects on spawn and etc can be a thing - health = get_max_health() + //Only set the current_health if health is null. Some things define their own health value. + if(isnull(max_health)) + max_health = round(material_health_multiplier * material.integrity, 0.01) + if(max_health < 1) + //Make sure to warn us if the values we set make the max_health be under 1 + log_warning("The 'max_health' of '[src]'([type]) made out of '[material]' was calculated as [material_health_multiplier] * [material.integrity] == [max_health], which is smaller than 1.") + + if(isnull(current_health)) //only set health if we didn't specify one already, so damaged objects on spawn and etc can be a thing + current_health = get_max_health() if(material.products_need_process()) START_PROCESSING(SSobj, src) diff --git a/code/game/objects/items/blackout.dm b/code/game/objects/items/blackout.dm index f781feed9d0..bdbb311597d 100644 --- a/code/game/objects/items/blackout.dm +++ b/code/game/objects/items/blackout.dm @@ -12,7 +12,7 @@ desc = "A complicated eletronic device of unknown purpose" icon = 'icons/obj/items/blackout.dmi' icon_state = "device_blackout-off" - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE var/severity = 2 var/shots = 1 var/last_use = 0 diff --git a/code/game/objects/items/devices/t_scanner.dm b/code/game/objects/items/devices/t_scanner.dm index 2a6e9533c59..d7fdbfb7756 100644 --- a/code/game/objects/items/devices/t_scanner.dm +++ b/code/game/objects/items/devices/t_scanner.dm @@ -39,7 +39,7 @@ /obj/item/t_scanner/afterattack(atom/target, mob/user, proximity_flag, click_parameters) var/obj/structure/disposalpipe/D = target if(D && istype(D)) - to_chat(user, "Pipe segment integrity: [(D.health / 10) * 100]%") + to_chat(user, "Pipe segment integrity: [(D.current_health / 10) * 100]%") /obj/item/t_scanner/proc/set_active(var/active) on = active diff --git a/code/game/objects/items/devices/uplink.dm b/code/game/objects/items/devices/uplink.dm index 43e881aa1ec..4ccd921e0cb 100644 --- a/code/game/objects/items/devices/uplink.dm +++ b/code/game/objects/items/devices/uplink.dm @@ -13,7 +13,7 @@ /obj/item/uplink name = "hidden uplink" desc = "There is something wrong if you're examining this." - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE material = /decl/material/solid/organic/plastic matter = list( /decl/material/solid/metal/copper = MATTER_AMOUNT_REINFORCEMENT, diff --git a/code/game/objects/items/plunger.dm b/code/game/objects/items/plunger.dm index bb671a5942d..b3d02794689 100644 --- a/code/game/objects/items/plunger.dm +++ b/code/game/objects/items/plunger.dm @@ -20,4 +20,4 @@ return ..() /obj/item/plunger/unbreakable - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE diff --git a/code/game/objects/items/robot/robot_items.dm b/code/game/objects/items/robot/robot_items.dm index bb425584457..373c8592f4b 100644 --- a/code/game/objects/items/robot/robot_items.dm +++ b/code/game/objects/items/robot/robot_items.dm @@ -1,6 +1,6 @@ //This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32 /obj/item/borg - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE /********************************************************************** Cyborg Spec Items diff --git a/code/game/objects/items/stacks/rods.dm b/code/game/objects/items/stacks/rods.dm index 50d8d536af3..8a768f4b5e1 100644 --- a/code/game/objects/items/stacks/rods.dm +++ b/code/game/objects/items/stacks/rods.dm @@ -38,7 +38,7 @@ matter = null uses_charge = 1 charge_costs = list(500) - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE is_spawnable_type = FALSE /obj/item/stack/material/rods/Initialize() diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index d5ec7213f9c..74c88653b21 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -12,7 +12,7 @@ /obj/item/stack gender = PLURAL origin_tech = @'{"materials":1}' - obj_max_health = 32 //Stacks should take damage even if no materials + max_health = 32 //Stacks should take damage even if no materials /// A copy of initial matter list when this atom initialized. Stack matter should always assume a single tile. var/list/matter_per_piece var/singular_name diff --git a/code/game/objects/items/stacks/tiles/tile_types.dm b/code/game/objects/items/stacks/tiles/tile_types.dm index 6fc91d5ec1d..a0643d33e1e 100644 --- a/code/game/objects/items/stacks/tiles/tile_types.dm +++ b/code/game/objects/items/stacks/tiles/tile_types.dm @@ -72,7 +72,7 @@ charge_costs = list(250) stack_merge_type = /obj/item/stack/tile/wood build_type = /obj/item/stack/tile/wood - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE is_spawnable_type = FALSE /obj/item/stack/tile/mahogany @@ -225,7 +225,7 @@ charge_costs = list(250) stack_merge_type = /obj/item/stack/tile/floor build_type = /obj/item/stack/tile/floor - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE is_spawnable_type = FALSE /obj/item/stack/tile/roof/cyborg @@ -237,7 +237,7 @@ charge_costs = list(500) stack_merge_type = /obj/item/stack/tile/roof build_type = /obj/item/stack/tile/roof - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE is_spawnable_type = FALSE /obj/item/stack/tile/linoleum diff --git a/code/game/objects/items/weapons/defib.dm b/code/game/objects/items/weapons/defib.dm index a128fd33233..7aef0369e8a 100644 --- a/code/game/objects/items/weapons/defib.dm +++ b/code/game/objects/items/weapons/defib.dm @@ -194,7 +194,7 @@ w_class = ITEM_SIZE_LARGE material = /decl/material/solid/organic/plastic matter = list(/decl/material/solid/metal/copper = MATTER_AMOUNT_SECONDARY, /decl/material/solid/metal/steel = MATTER_AMOUNT_SECONDARY) - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE var/safety = 1 //if you can zap people with the paddles on harm mode var/combat = 0 //If it can be used to revive people wearing thick clothing (e.g. spacesuits) diff --git a/code/game/objects/items/weapons/grenades/smokebomb.dm b/code/game/objects/items/weapons/grenades/smokebomb.dm index e2274c3e386..1347194837e 100644 --- a/code/game/objects/items/weapons/grenades/smokebomb.dm +++ b/code/game/objects/items/weapons/grenades/smokebomb.dm @@ -20,7 +20,7 @@ START_PROCESSING(SSobj, src) for(var/obj/effect/blob/B in view(8,src)) var/damage = round(30/(get_dist(B,src)+1)) - B.health -= damage + B.current_health -= damage B.update_icon() QDEL_IN(src, 8 SECONDS) diff --git a/code/game/objects/items/weapons/handcuffs.dm b/code/game/objects/items/weapons/handcuffs.dm index f4a6b370f83..d38d1fc8974 100644 --- a/code/game/objects/items/weapons/handcuffs.dm +++ b/code/game/objects/items/weapons/handcuffs.dm @@ -12,7 +12,7 @@ throw_range = 5 origin_tech = @'{"materials":1}' material = /decl/material/solid/metal/steel - obj_max_health = ITEM_HEALTH_NO_DAMAGE //#TODO: Once we can work out something different for handling cuff breakout, change this. Since it relies on cuffs health to tell if you can actually breakout. + max_health = ITEM_HEALTH_NO_DAMAGE //#TODO: Once we can work out something different for handling cuff breakout, change this. Since it relies on cuffs health to tell if you can actually breakout. var/elastic var/dispenser = 0 var/breakouttime = 2 MINUTES //Deciseconds = 120s = 2 minutes @@ -32,7 +32,7 @@ /obj/item/handcuffs/examine(mob/user) . = ..() - if (health > 0 && get_max_health() > 0) + if (current_health > 0 && get_max_health() > 0) var display = get_percent_health() if (display > 66) return @@ -140,7 +140,7 @@ var/global/last_chew = 0 //#FIXME: Its funny how only one person in the world ca cuff_sound = 'sound/weapons/cablecuff.ogg' cuff_type = "cable restraints" elastic = 1 - obj_max_health = 75 + max_health = 75 material = /decl/material/solid/organic/plastic /obj/item/handcuffs/cable/red @@ -178,5 +178,5 @@ var/global/last_chew = 0 //#FIXME: Its funny how only one person in the world ca icon = 'icons/obj/bureaucracy.dmi' breakouttime = 200 cuff_type = "duct tape" - obj_max_health = 50 + max_health = 50 material = /decl/material/solid/organic/plastic \ No newline at end of file diff --git a/code/game/objects/items/weapons/material/misc.dm b/code/game/objects/items/weapons/material/misc.dm index 3d2d916c153..d31b6c2d029 100644 --- a/code/game/objects/items/weapons/material/misc.dm +++ b/code/game/objects/items/weapons/material/misc.dm @@ -68,7 +68,7 @@ set_extension(src, /datum/extension/tool, list(TOOL_HATCHET = TOOL_QUALITY_DEFAULT)) /obj/item/hatchet/unbreakable - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE /obj/item/hatchet/machete name = "machete" @@ -94,7 +94,7 @@ . = ..() /obj/item/hatchet/machete/unbreakable - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE /obj/item/hatchet/machete/steel name = "fabricated machete" @@ -122,7 +122,7 @@ material_alteration = MAT_FLAG_ALTERATION_COLOR | MAT_FLAG_ALTERATION_NAME /obj/item/minihoe/unbreakable - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE /obj/item/scythe name = "scythe" diff --git a/code/game/objects/items/weapons/material/shards.dm b/code/game/objects/items/weapons/material/shards.dm index d269a397719..cfad08854a4 100644 --- a/code/game/objects/items/weapons/material/shards.dm +++ b/code/game/objects/items/weapons/material/shards.dm @@ -126,7 +126,7 @@ //Prevent the shard from being allowed to shatter /obj/item/shard/check_health(var/lastdamage = null, var/lastdamtype = null, var/lastdamflags = 0, var/consumed = FALSE) - if(health > 0 || !can_take_damage()) + if(current_health > 0 || !can_take_damage()) return //If invincible, or if we're not dead yet, skip if(lastdamtype == BURN) handle_melting() diff --git a/code/game/objects/items/weapons/nuclear_cylinder.dm b/code/game/objects/items/weapons/nuclear_cylinder.dm index a3f492c017a..68ce244b014 100644 --- a/code/game/objects/items/weapons/nuclear_cylinder.dm +++ b/code/game/objects/items/weapons/nuclear_cylinder.dm @@ -11,4 +11,4 @@ throw_speed = 2 throw_range = 4 origin_tech = @'{"materials":3,"engineering":4}' - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE diff --git a/code/game/objects/items/weapons/soap.dm b/code/game/objects/items/weapons/soap.dm index 5319653ca3e..8727b01e6e8 100644 --- a/code/game/objects/items/weapons/soap.dm +++ b/code/game/objects/items/weapons/soap.dm @@ -13,7 +13,7 @@ throw_speed = 4 throw_range = 20 material = /decl/material/liquid/cleaner/soap - obj_max_health = 5 + max_health = 5 var/key_data var/list/valid_colors = list(COLOR_GREEN_GRAY, COLOR_RED_GRAY, COLOR_BLUE_GRAY, COLOR_BROWN, COLOR_PALE_PINK, COLOR_PALE_BTL_GREEN, COLOR_OFF_WHITE, COLOR_GRAY40, COLOR_GOLD) diff --git a/code/game/objects/items/weapons/storage/internal.dm b/code/game/objects/items/weapons/storage/internal.dm index 42c3dc340a3..63702e3fbf9 100644 --- a/code/game/objects/items/weapons/storage/internal.dm +++ b/code/game/objects/items/weapons/storage/internal.dm @@ -1,7 +1,7 @@ //A storage item intended to be used by other items to provide storage functionality. //Types that use this should consider overriding emp_act() and hear_talk(), unless they shield their contents somehow. /obj/item/storage/internal - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE abstract_type = /obj/item/storage/internal is_spawnable_type = FALSE var/obj/item/master_item diff --git a/code/game/objects/items/weapons/tape.dm b/code/game/objects/items/weapons/tape.dm index 2cd8d334fec..c82848b99d4 100644 --- a/code/game/objects/items/weapons/tape.dm +++ b/code/game/objects/items/weapons/tape.dm @@ -11,8 +11,8 @@ max_amount = 32 w_class = ITEM_SIZE_SMALL material = /decl/material/solid/organic/plastic - health = 10 - obj_max_health = 10 + current_health = 10 + max_health = 10 /obj/item/stack/tape_roll/can_split() return FALSE diff --git a/code/game/objects/items/weapons/tools/weldingtool.dm b/code/game/objects/items/weapons/tools/weldingtool.dm index 9427971c92c..28b05943c5d 100644 --- a/code/game/objects/items/weapons/tools/weldingtool.dm +++ b/code/game/objects/items/weapons/tools/weldingtool.dm @@ -402,8 +402,8 @@ throwforce = 5 volume = 20 show_reagent_name = TRUE - health = 40 - obj_max_health = 40 + current_health = 40 + max_health = 40 material = /decl/material/solid/metal/steel var/can_refuel = TRUE var/size_in_use = ITEM_SIZE_NORMAL diff --git a/code/game/objects/items/weapons/weaponry.dm b/code/game/objects/items/weapons/weaponry.dm index acdafa26fcf..bb3656f3a8c 100644 --- a/code/game/objects/items/weapons/weaponry.dm +++ b/code/game/objects/items/weapons/weaponry.dm @@ -12,7 +12,7 @@ throwforce = 7 w_class = ITEM_SIZE_NORMAL material = /decl/material/solid/glass - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE /obj/item/nullrod/attack(mob/M, mob/living/user) //Paste from old-code to decult with a null rod. admin_attack_log(user, M, "Attacked using \a [src]", "Was attacked with \a [src]", "used \a [src] to attack") @@ -71,7 +71,7 @@ icon_state = "energynet" throwforce = 0 force = 0 - obj_max_health = 100 + max_health = 100 var/net_type = /obj/effect/energy_net /obj/item/energy_net/safari @@ -117,7 +117,7 @@ anchored = TRUE can_buckle = 0 //no manual buckling or unbuckling - obj_max_health = 25 + max_health = 25 var/countdown = 15 var/temporary = 1 var/mob/living/carbon/captured = null @@ -129,7 +129,7 @@ desc = "An energized net meant to subdue animals." anchored = FALSE - obj_max_health = 5 + max_health = 5 temporary = 0 min_free_time = 5 max_free_time = 10 @@ -152,11 +152,11 @@ if(temporary) countdown-- if(captured.buckled != src) - health = 0 + current_health = 0 if(get_turf(src) != get_turf(captured)) //just in case they somehow teleport around or countdown = 0 if(countdown <= 0) - health = 0 + current_health = 0 healthcheck() /obj/effect/energy_net/Move() @@ -185,7 +185,7 @@ reset_plane_and_layer() /obj/effect/energy_net/proc/healthcheck() - if(health <=0) + if(current_health <=0) set_density(0) if(countdown <= 0) visible_message("\The [src] fades away!") @@ -194,14 +194,14 @@ qdel(src) /obj/effect/energy_net/bullet_act(var/obj/item/projectile/Proj) - health -= Proj.get_structure_damage() + current_health -= Proj.get_structure_damage() healthcheck() return 0 /obj/effect/energy_net/explosion_act() ..() if(!QDELETED(src)) - health = 0 + current_health = 0 healthcheck() /obj/effect/energy_net/attack_hand(var/mob/user) @@ -211,17 +211,17 @@ if(my_species) if(my_species.can_shred(user)) playsound(src.loc, 'sound/weapons/slash.ogg', 80, 1) - health -= rand(10, 20) + current_health -= rand(10, 20) else - health -= rand(1,3) + current_health -= rand(1,3) else - health -= rand(5,8) + current_health -= rand(5,8) to_chat(user, SPAN_DANGER("You claw at the energy net.")) healthcheck() return TRUE /obj/effect/energy_net/attackby(obj/item/W, mob/user) - health -= W.force + current_health -= W.force healthcheck() ..() @@ -235,7 +235,7 @@ "You attempt to free yourself from \the [src]!" ) if(do_after(user, rand(min_free_time, max_free_time), src, incapacitation_flags = INCAPACITATION_DISABLED)) - health = 0 + current_health = 0 healthcheck() return 1 else diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index b99d5ac1001..be7d5c7286c 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -4,6 +4,11 @@ is_spawnable_type = TRUE abstract_type = /obj + ///The maximum health that the object can have. If set to ITEM_HEALTH_NO_DAMAGE, the object won't take any damage. + max_health = ITEM_HEALTH_NO_DAMAGE + ///The current health of the obj. Leave to null, unless you want the object to start at a different health than max_health. + current_health = null + var/obj_flags var/list/req_access var/list/matter //Used to store information about the contents of the object. @@ -18,10 +23,6 @@ var/holographic = 0 //if the obj is a holographic object spawned by the holodeck var/tmp/directional_offset ///JSON list of directions to x,y offsets to be applied to the object depending on its direction EX: @'{"NORTH":{"x":12,"y":5}, "EAST":{"x":10,"y":50}}' - ///The current health of the obj. Leave to null, unless you want the object to start at a different health than obj_max_health. - var/health - ///The maximum health that the object can have. If set to ITEM_HEALTH_NO_DAMAGE, the object won't take any damage. - var/obj_max_health = ITEM_HEALTH_NO_DAMAGE /obj/Initialize(mapload) . = ..() @@ -30,11 +31,8 @@ //Only apply directional offsets if the mappers haven't set any offsets already if(!pixel_x && !pixel_y && !pixel_w && !pixel_z) update_directional_offset() - if(isnull(health)) - health = get_max_health() - -/obj/proc/get_max_health() - return obj_max_health + if(isnull(current_health)) + current_health = get_max_health() /obj/hitby(atom/movable/AM, var/datum/thrownthing/TT) ..() diff --git a/code/game/objects/objs_damage.dm b/code/game/objects/objs_damage.dm index 06c4752aebe..c9eee11f755 100644 --- a/code/game/objects/objs_damage.dm +++ b/code/game/objects/objs_damage.dm @@ -2,19 +2,19 @@ Returns whether this object is damaged. */ /obj/proc/is_damaged() - return can_take_damage() && (health < get_max_health()) + return can_take_damage() && (current_health < get_max_health()) /** Returns TRUE if this object can take damage. */ /obj/proc/can_take_damage() - return (health != ITEM_HEALTH_NO_DAMAGE) && (get_max_health() != ITEM_HEALTH_NO_DAMAGE) + return (current_health != ITEM_HEALTH_NO_DAMAGE) && (get_max_health() != ITEM_HEALTH_NO_DAMAGE) /** Returns the percentage of health remaining for this object. */ /obj/proc/get_percent_health() - return can_take_damage()? round((health * 100)/get_max_health(), HEALTH_ROUNDING) : 100 + return can_take_damage()? round((current_health * 100)/get_max_health(), HEALTH_ROUNDING) : 100 /** Returns the percentage of damage done to this object. diff --git a/code/game/objects/structures/__structure.dm b/code/game/objects/structures/__structure.dm index 9849d5d6d26..285b0866863 100644 --- a/code/game/objects/structures/__structure.dm +++ b/code/game/objects/structures/__structure.dm @@ -3,7 +3,7 @@ w_class = ITEM_SIZE_STRUCTURE layer = STRUCTURE_LAYER abstract_type = /obj/structure - obj_max_health = 50 + max_health = 50 var/structure_flags var/last_damage_message @@ -87,7 +87,7 @@ return FALSE /obj/structure/proc/take_damage(var/damage) - if(health == -1) // This object does not take damage. + if(current_health == -1) // This object does not take damage. return if(material && material.is_brittle()) @@ -99,10 +99,10 @@ playsound(loc, hitsound, 75, 1) var/current_max_health = get_max_health() - health = clamp(health - damage, 0, current_max_health) - show_damage_message(health/current_max_health) + current_health = clamp(current_health - damage, 0, current_max_health) + show_damage_message(current_health/current_max_health) - if(health == 0) + if(current_health == 0) physically_destroyed() /obj/structure/proc/show_damage_message(var/perc) @@ -217,7 +217,7 @@ take_damage(rand(5, 15)) /obj/structure/proc/can_repair(var/mob/user) - if(health >= get_max_health()) + if(current_health >= get_max_health()) to_chat(user, SPAN_NOTICE("\The [src] does not need repairs.")) return FALSE return TRUE diff --git a/code/game/objects/structures/_structure_construction.dm b/code/game/objects/structures/_structure_construction.dm index 0c1beb2b115..e3fc983fa27 100644 --- a/code/game/objects/structures/_structure_construction.dm +++ b/code/game/objects/structures/_structure_construction.dm @@ -105,13 +105,13 @@ /obj/structure/proc/handle_repair(mob/user, obj/item/tool) var/current_max_health = get_max_health() var/obj/item/stack/stack = tool - var/amount_needed = CEILING((current_max_health - health)/DOOR_REPAIR_AMOUNT) + var/amount_needed = CEILING((current_max_health - current_health)/DOOR_REPAIR_AMOUNT) var/used = min(amount_needed,stack.amount) if(used) to_chat(user, SPAN_NOTICE("You fit [stack.get_string_for_amount(used)] to damaged areas of \the [src].")) stack.use(used) last_damage_message = null - health = clamp(health, health + used*DOOR_REPAIR_AMOUNT, current_max_health) + current_health = clamp(current_health, current_health + used*DOOR_REPAIR_AMOUNT, current_max_health) /obj/structure/attackby(obj/item/O, mob/user) diff --git a/code/game/objects/structures/_structure_materials.dm b/code/game/objects/structures/_structure_materials.dm index 8cd94a842d6..b3cf5288465 100644 --- a/code/game/objects/structures/_structure_materials.dm +++ b/code/game/objects/structures/_structure_materials.dm @@ -29,8 +29,8 @@ var/bonus_health = reinf_material.integrity * get_material_health_modifier() current_max_health += bonus_health if(!keep_health) - health += bonus_health - health = keep_health ? min(health, current_max_health) : current_max_health + current_health += bonus_health + current_health = keep_health ? min(current_health, current_max_health) : current_max_health update_icon() /obj/structure/proc/update_material_name(var/override_name) diff --git a/code/game/objects/structures/banners.dm b/code/game/objects/structures/banners.dm index ba03cc50401..b432310a0cc 100644 --- a/code/game/objects/structures/banners.dm +++ b/code/game/objects/structures/banners.dm @@ -12,7 +12,7 @@ obj_flags = OBJ_FLAG_ANCHORABLE tool_interaction_flags = (TOOL_INTERACTION_ANCHOR | TOOL_INTERACTION_DECONSTRUCT) material_alteration = MAT_FLAG_ALTERATION_NAME | MAT_FLAG_ALTERATION_COLOR - obj_max_health = 50 + max_health = 50 /// Reference to any banner currently hung on the frame. var/obj/item/banner/banner @@ -84,7 +84,7 @@ icon = 'icons/obj/banner.dmi' icon_state = "banner" material = /decl/material/solid/organic/cloth - obj_max_health = 20 + max_health = 20 material_alteration = MAT_FLAG_ALTERATION_COLOR | MAT_FLAG_ALTERATION_NAME w_class = ITEM_SIZE_NORMAL var/hung_desc = "The banner is rather plain, with no markings." diff --git a/code/game/objects/structures/barricade.dm b/code/game/objects/structures/barricade.dm index ce5c34a546b..a7709ec0961 100644 --- a/code/game/objects/structures/barricade.dm +++ b/code/game/objects/structures/barricade.dm @@ -8,7 +8,7 @@ atom_flags = ATOM_FLAG_CLIMBABLE layer = ABOVE_WINDOW_LAYER material_alteration = MAT_FLAG_ALTERATION_ALL - obj_max_health = 100 + max_health = 100 var/spike_damage //how badly it smarts when you run into this like a rube var/list/poke_description = list("gored", "spiked", "speared", "stuck", "stabbed") diff --git a/code/game/objects/structures/crates_lockers/closets/__closet.dm b/code/game/objects/structures/crates_lockers/closets/__closet.dm index d9e4011ec13..892a16828ed 100644 --- a/code/game/objects/structures/crates_lockers/closets/__closet.dm +++ b/code/game/objects/structures/crates_lockers/closets/__closet.dm @@ -6,7 +6,7 @@ var/global/list/closets = list() icon = 'icons/obj/closets/bases/closet.dmi' icon_state = "base" density = TRUE - obj_max_health = 100 + max_health = 100 material = /decl/material/solid/metal/steel tool_interaction_flags = TOOL_INTERACTION_ANCHOR diff --git a/code/game/objects/structures/crates_lockers/closets/secure/_secure_closets.dm b/code/game/objects/structures/crates_lockers/closets/secure/_secure_closets.dm index 1dedcb8c8a6..b18ae84828b 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/_secure_closets.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/_secure_closets.dm @@ -7,7 +7,7 @@ locked = TRUE wall_mounted = 0 //never solid (You can always pass over it) - health = 200 + current_health = 200 /obj/structure/closet/secure_closet/slice_into_parts(obj/item/weldingtool/WT, mob/user) to_chat(user, "\The [src] is too strong to be taken apart.") diff --git a/code/game/objects/structures/crates_lockers/closets/statue.dm b/code/game/objects/structures/crates_lockers/closets/statue.dm index 4b08f285a1e..25e2311390f 100644 --- a/code/game/objects/structures/crates_lockers/closets/statue.dm +++ b/code/game/objects/structures/crates_lockers/closets/statue.dm @@ -6,7 +6,7 @@ density = TRUE anchored = TRUE setup = 0 - health = 0 //destroying the statue kills the mob within + current_health = 0 //destroying the statue kills the mob within var/intialTox = 0 //these are here to keep the mob from taking damage from things that logically wouldn't affect a rock var/intialFire = 0 //it's a little sloppy I know but it was this or the GODMODE flag. Lesser of two evils. var/intialBrute = 0 @@ -23,7 +23,7 @@ L.client.eye = src L.forceMove(src) L.set_sdisability(MUTED) - health = L.current_health + 100 //stoning damaged mobs will result in easier to shatter statues + current_health = L.current_health + 100 //stoning damaged mobs will result in easier to shatter statues intialTox = L.getToxLoss() intialFire = L.getFireLoss() intialBrute = L.getBruteLoss() @@ -40,7 +40,7 @@ icon_state = "corgi" desc = "If it takes forever, I will wait for you..." - if(health == 0) //meaning if the statue didn't find a valid target + if(current_health == 0) //meaning if the statue didn't find a valid target return INITIALIZE_HINT_QDEL START_PROCESSING(SSobj, src) @@ -65,7 +65,7 @@ for(var/mob/living/M in src) M.dropInto(loc) M.unset_sdisability(MUTED) - M.take_overall_damage((M.current_health - health - 100),0) //any new damage the statue incurred is transfered to the mob + M.take_overall_damage((M.current_health - current_health - 100),0) //any new damage the statue incurred is transfered to the mob if(M.client) M.client.eye = M.client.mob M.client.perspective = MOB_PERSPECTIVE @@ -80,12 +80,12 @@ return /obj/structure/closet/statue/proc/check_health() - if(health <= 0) + if(current_health <= 0) for(var/mob/M in src) shatter(M) /obj/structure/closet/statue/bullet_act(var/obj/item/projectile/Proj) - health -= Proj.get_structure_damage() + current_health -= Proj.get_structure_damage() check_health() return @@ -95,11 +95,11 @@ M.explosion_act(severity) ..() if(!QDELETED(src)) - health -= 60 / severity + current_health -= 60 / severity check_health() /obj/structure/closet/statue/attackby(obj/item/I, mob/user) - health -= I.force + current_health -= I.force user.do_attack_animation(src) visible_message("[user] strikes [src] with [I].") check_health() diff --git a/code/game/objects/structures/defensive_barrier.dm b/code/game/objects/structures/defensive_barrier.dm index d367138da17..1392abac19e 100644 --- a/code/game/objects/structures/defensive_barrier.dm +++ b/code/game/objects/structures/defensive_barrier.dm @@ -10,7 +10,7 @@ can_buckle = TRUE material = /decl/material/solid/metal/steel material_alteration = MAT_FLAG_ALTERATION_DESC | MAT_FLAG_ALTERATION_NAME - obj_max_health = 200 + max_health = 200 var/secured /obj/structure/defensive_barrier/Initialize() @@ -90,7 +90,7 @@ visible_message(SPAN_NOTICE("\The [user] packs up \the [src].")) var/obj/item/defensive_barrier/B = new(get_turf(user), material?.type) playsound(src, 'sound/items/Deconstruct.ogg', 100, 1) - B.stored_health = health + B.stored_health = current_health B.stored_max_health = get_max_health() B.add_fingerprint(user) qdel(src) @@ -197,7 +197,7 @@ playsound(src, 'sound/effects/extout.ogg', 100, 1) var/obj/structure/defensive_barrier/B = new(get_turf(user), material?.type) B.set_dir(user.dir) - B.health = stored_health + B.current_health = stored_health if(loc == user) user.drop_from_inventory(src) qdel(src) diff --git a/code/game/objects/structures/displaycase.dm b/code/game/objects/structures/displaycase.dm index 2bae68bed89..e5ab45af656 100644 --- a/code/game/objects/structures/displaycase.dm +++ b/code/game/objects/structures/displaycase.dm @@ -6,7 +6,7 @@ density = TRUE anchored = TRUE alpha = 150 - obj_max_health = 100 + max_health = 100 hitsound = 'sound/effects/Glasshit.ogg' req_access = null material = /decl/material/solid/glass diff --git a/code/game/objects/structures/doors/_door.dm b/code/game/objects/structures/doors/_door.dm index 38715ce1d77..fd23d25aec6 100644 --- a/code/game/objects/structures/doors/_door.dm +++ b/code/game/objects/structures/doors/_door.dm @@ -4,7 +4,7 @@ icon_state = "metal" hitsound = 'sound/weapons/genhit.ogg' material_alteration = MAT_FLAG_ALTERATION_NAME | MAT_FLAG_ALTERATION_DESC | MAT_FLAG_ALTERATION_COLOR - obj_max_health = 50 + max_health = 50 density = TRUE anchored = TRUE opacity = TRUE diff --git a/code/game/objects/structures/fishtanks.dm b/code/game/objects/structures/fishtanks.dm index f92d4772004..99236832272 100644 --- a/code/game/objects/structures/fishtanks.dm +++ b/code/game/objects/structures/fishtanks.dm @@ -24,7 +24,7 @@ var/global/list/fishtank_cache = list() density = TRUE atom_flags = ATOM_FLAG_CHECKS_BORDER | ATOM_FLAG_CLIMBABLE mob_offset = TRUE - obj_max_health = 50 + max_health = 50 var/deleting var/fill_type diff --git a/code/game/objects/structures/girders.dm b/code/game/objects/structures/girders.dm index a059e8efdad..c95d6d96d30 100644 --- a/code/game/objects/structures/girders.dm +++ b/code/game/objects/structures/girders.dm @@ -8,7 +8,7 @@ obj_flags = OBJ_FLAG_MOVES_UNSUPPORTED material_alteration = MAT_FLAG_ALTERATION_NAME | MAT_FLAG_ALTERATION_COLOR tool_interaction_flags = (TOOL_INTERACTION_ANCHOR | TOOL_INTERACTION_DECONSTRUCT) - obj_max_health = 100 + max_health = 100 parts_amount = 2 parts_type = /obj/item/stack/material/strut @@ -196,7 +196,7 @@ /obj/structure/girder/cult icon= 'icons/obj/cult.dmi' icon_state= "cultgirder" - obj_max_health = 150 + max_health = 150 cover = 70 /obj/structure/girder/cult/dismantle() diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index 55c2314517e..08bfd215d85 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -16,7 +16,7 @@ handle_generic_blending = TRUE material_alteration = MAT_FLAG_ALTERATION_COLOR | MAT_FLAG_ALTERATION_NAME - obj_max_health = 20 + max_health = 20 var/destroyed = 0 var/list/connections diff --git a/code/game/objects/structures/inflatable.dm b/code/game/objects/structures/inflatable.dm index 79fb361402b..9910b5ee5f6 100644 --- a/code/game/objects/structures/inflatable.dm +++ b/code/game/objects/structures/inflatable.dm @@ -23,7 +23,7 @@ transfer_fingerprints_to(R) R.add_fingerprint(user) if(inflatable_health) - R.health = inflatable_health + R.current_health = inflatable_health qdel(src) /obj/item/inflatable/door @@ -41,7 +41,7 @@ opacity = FALSE icon = 'icons/obj/structures/inflatable.dmi' icon_state = "wall" - obj_max_health = 20 + max_health = 20 hitsound = 'sound/effects/Glasshit.ogg' atmos_canpass = CANPASS_DENSITY material = /decl/material/solid/organic/plastic @@ -120,7 +120,7 @@ deflate(TRUE) /obj/structure/inflatable/can_repair_with(obj/item/tool) - . = istype(tool, /obj/item/stack/tape_roll/duct_tape) && (health < get_max_health()) + . = istype(tool, /obj/item/stack/tape_roll/duct_tape) && (current_health < get_max_health()) /obj/structure/inflatable/handle_repair(mob/user, obj/item/tool) var/obj/item/stack/tape_roll/duct_tape/T = tool @@ -134,7 +134,7 @@ playsound(src, 'sound/effects/tape.ogg', 50, TRUE) last_damage_message = null to_chat(user, SPAN_NOTICE("You tape up some of the damage to \the [src].")) - health = clamp(health + 3, 0, get_max_health()) + current_health = clamp(current_health + 3, 0, get_max_health()) taped = TRUE /obj/structure/inflatable/attackby(obj/item/W, mob/user) @@ -170,7 +170,7 @@ spawn(50) var/obj/item/inflatable/R = new undeploy_path(src.loc) src.transfer_fingerprints_to(R) - R.inflatable_health = health + R.inflatable_health = current_health qdel(src) /obj/structure/inflatable/verb/hand_deflate() diff --git a/code/game/objects/structures/pit.dm b/code/game/objects/structures/pit.dm index 0ff20c66427..c3ba723a92e 100644 --- a/code/game/objects/structures/pit.dm +++ b/code/game/objects/structures/pit.dm @@ -1,13 +1,13 @@ /obj/structure/pit - name = "pit" - desc = "Watch your step, partner." - icon = 'icons/obj/structures/pit.dmi' - icon_state = "pit1" - blend_mode = BLEND_MULTIPLY - density = FALSE - anchored = TRUE - health = -1 //You can't break a hole in the ground. - var/open = TRUE + name = "pit" + desc = "Watch your step, partner." + icon = 'icons/obj/structures/pit.dmi' + icon_state = "pit1" + blend_mode = BLEND_MULTIPLY + density = FALSE + anchored = TRUE + current_health = -1 //You can't break a hole in the ground. + var/open = TRUE /obj/structure/pit/attackby(obj/item/W, mob/user) if(IS_SHOVEL(W)) @@ -109,9 +109,9 @@ // Closed Pit ///////////////////////////////////////////// /obj/structure/pit/closed - name = "mound" - desc = "Some things are better left buried." - health = -1 //Can't break a hole in the ground... + name = "mound" + desc = "Some things are better left buried." + current_health = ITEM_HEALTH_NO_DAMAGE //Can't break a hole in the ground... /obj/structure/pit/closed/Initialize() . = ..() diff --git a/code/game/objects/structures/railing.dm b/code/game/objects/structures/railing.dm index c10f0426947..bf557d298e6 100644 --- a/code/game/objects/structures/railing.dm +++ b/code/game/objects/structures/railing.dm @@ -12,7 +12,7 @@ obj_flags = OBJ_FLAG_ROTATABLE | OBJ_FLAG_MOVES_UNSUPPORTED material = DEFAULT_FURNITURE_MATERIAL material_alteration = MAT_FLAG_ALTERATION_ALL - obj_max_health = 100 + max_health = 100 parts_amount = 2 parts_type = /obj/item/stack/material/strut @@ -78,10 +78,10 @@ /obj/structure/railing/proc/NeighborsCheck(var/UpdateNeighbors = 1) neighbor_status = 0 - var/Rturn = turn(src.dir, -90) - var/Lturn = turn(src.dir, 90) + var/Rturn = turn(dir, -90) + var/Lturn = turn(dir, 90) - for(var/obj/structure/railing/R in src.loc) + for(var/obj/structure/railing/R in loc) if ((R.dir == Lturn) && R.anchored) neighbor_status |= 32 if (UpdateNeighbors) @@ -91,21 +91,21 @@ if (UpdateNeighbors) R.update_icon(0) for (var/obj/structure/railing/R in get_step(src, Lturn)) - if ((R.dir == src.dir) && R.anchored) + if ((R.dir == dir) && R.anchored) neighbor_status |= 16 if (UpdateNeighbors) R.update_icon(0) for (var/obj/structure/railing/R in get_step(src, Rturn)) - if ((R.dir == src.dir) && R.anchored) + if ((R.dir == dir) && R.anchored) neighbor_status |= 1 if (UpdateNeighbors) R.update_icon(0) - for (var/obj/structure/railing/R in get_step(src, (Lturn + src.dir))) + for (var/obj/structure/railing/R in get_step(src, (Lturn + dir))) if ((R.dir == Rturn) && R.anchored) neighbor_status |= 64 if (UpdateNeighbors) R.update_icon(0) - for (var/obj/structure/railing/R in get_step(src, (Rturn + src.dir))) + for (var/obj/structure/railing/R in get_step(src, (Rturn + dir))) if ((R.dir == Lturn) && R.anchored) neighbor_status |= 4 if (UpdateNeighbors) @@ -164,7 +164,7 @@ to_chat(usr, "You can't flip \the [src] - something is in the way.") return 0 - forceMove(get_step(src, src.dir)) + forceMove(get_step(src, dir)) set_dir(turn(dir, 180)) update_icon() @@ -198,7 +198,7 @@ H.apply_damage(8, BRUTE, BP_HEAD) else if (get_turf(H) == get_turf(src)) - H.forceMove(get_step(src, src.dir)) + H.forceMove(get_step(src, dir)) else H.dropInto(loc) SET_STATUS_MAX(H, STAT_WEAK, 5) @@ -210,7 +210,7 @@ // Dismantle if(IS_WRENCH(W)) if(!anchored) - playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) + playsound(loc, 'sound/items/Ratchet.ogg', 50, 1) if(do_after(user, 20, src)) if(anchored) return @@ -220,7 +220,7 @@ return // Wrench Open else - playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) + playsound(loc, 'sound/items/Ratchet.ogg', 50, 1) if(density) user.visible_message("\The [user] wrenches \the [src] open.", "You wrench \the [src] open.") density = FALSE @@ -234,15 +234,15 @@ var/obj/item/weldingtool/F = W if(F.isOn()) var/current_max_health = get_max_health() - if(health >= current_max_health) + if(current_health >= current_max_health) to_chat(user, "\The [src] does not need repairs.") return - playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) + playsound(loc, 'sound/items/Welder.ogg', 50, 1) if(do_after(user, 20, src)) - if(health >= current_max_health) + if(current_health >= current_max_health) return user.visible_message("\The [user] repairs some damage to \the [src].", "You repair some damage to \the [src].") - health = min(health+(current_max_health/5), current_max_health) + current_health = min(current_health+(current_max_health/5), current_max_health) return // Install @@ -273,7 +273,7 @@ /obj/structure/railing/can_climb(var/mob/living/user, post_climb_check=0) . = ..() if(. && get_turf(user) == get_turf(src)) - var/turf/T = get_step(src, src.dir) + var/turf/T = get_step(src, dir) if(T.turf_is_crowded(user)) to_chat(user, "You can't climb there, the way is blocked.") return 0 diff --git a/code/game/objects/structures/rubble.dm b/code/game/objects/structures/rubble.dm index 1fb951b7b83..8a1bf024a49 100644 --- a/code/game/objects/structures/rubble.dm +++ b/code/game/objects/structures/rubble.dm @@ -6,7 +6,7 @@ opacity = TRUE density = TRUE anchored = TRUE - obj_max_health = 50 + max_health = 50 var/list/loot = list( /obj/item/cell, diff --git a/code/game/objects/structures/stool_bed_chair_nest_sofa/wheelchair.dm b/code/game/objects/structures/stool_bed_chair_nest_sofa/wheelchair.dm index a58c2f4f4e5..f2e34f4e701 100644 --- a/code/game/objects/structures/stool_bed_chair_nest_sofa/wheelchair.dm +++ b/code/game/objects/structures/stool_bed_chair_nest_sofa/wheelchair.dm @@ -132,7 +132,7 @@ icon_state = "wheelchair-item" item_state = "rbed" w_class = ITEM_SIZE_LARGE - obj_max_health = 50 + max_health = 50 var/structure_form_type = /obj/structure/bed/chair/wheelchair /obj/item/wheelchair_kit/attack_self(mob/user) diff --git a/code/game/objects/structures/tables.dm b/code/game/objects/structures/tables.dm index 5a7d772ea36..1d839db87bb 100644 --- a/code/game/objects/structures/tables.dm +++ b/code/game/objects/structures/tables.dm @@ -15,7 +15,7 @@ // TODO: add 1px step-up? mob_offset = 12 handle_generic_blending = TRUE - obj_max_health = 10 + max_health = 10 tool_interaction_flags = TOOL_INTERACTION_DECONSTRUCT material_alteration = MAT_FLAG_ALTERATION_NAME | MAT_FLAG_ALTERATION_DESC parts_amount = 2 diff --git a/code/game/objects/structures/wall_frame.dm b/code/game/objects/structures/wall_frame.dm index 5c699a7f492..c70b7ca4552 100644 --- a/code/game/objects/structures/wall_frame.dm +++ b/code/game/objects/structures/wall_frame.dm @@ -16,7 +16,7 @@ material = DEFAULT_WALL_MATERIAL handle_generic_blending = TRUE tool_interaction_flags = (TOOL_INTERACTION_ANCHOR | TOOL_INTERACTION_DECONSTRUCT) - obj_max_health = 40 + max_health = 40 parts_amount = 2 parts_type = /obj/item/stack/material/strut diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index 9340ef35f64..5076496e9c2 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -15,7 +15,7 @@ atmos_canpass = CANPASS_PROC handle_generic_blending = TRUE hitsound = 'sound/effects/Glasshit.ogg' - obj_max_health = 100 + max_health = 100 var/damage_per_fire_tick = 2 // Amount of damage per fire tick. Regular windows are not fireproof so they might as well break quickly. var/construction_state = 2 @@ -137,8 +137,9 @@ else if(isobj(AM)) var/obj/item/I = AM tforce = I.throwforce * (TT.speed/THROWFORCE_SPEED_DIVISOR) - if(reinf_material) tforce *= 0.25 - if(health - tforce <= 7 && !reinf_material) + if(reinf_material) + tforce *= 0.25 + if(current_health - tforce <= 7 && !reinf_material) set_anchored(FALSE) step(src, get_dir(AM, src)) take_damage(tforce) @@ -252,7 +253,7 @@ if(W.damtype == BRUTE || W.damtype == BURN) user.do_attack_animation(src) hit(W.force) - if(health <= 7) + if(current_health <= 7) set_anchored(FALSE) step(src, get_dir(user, src)) else diff --git a/code/modules/blob/blob.dm b/code/modules/blob/blob.dm index 254ae6ed72f..040fc97d28b 100644 --- a/code/modules/blob/blob.dm +++ b/code/modules/blob/blob.dm @@ -12,7 +12,7 @@ layer = BLOB_SHIELD_LAYER - obj_max_health = 30 + max_health = 30 var/regen_rate = 5 var/brute_resist = 4.3 @@ -45,7 +45,7 @@ take_damage(rand(140 - (severity * 40), 140 - (severity * 20)) / brute_resist) /obj/effect/blob/on_update_icon() - if(health > get_max_health() / 2) + if(current_health > get_max_health() / 2) icon_state = "blob" else icon_state = "blob_damaged" @@ -57,15 +57,15 @@ attempt_attack(global.alldirs) /obj/effect/blob/proc/take_damage(var/damage) - health -= damage - if(health < 0) + current_health -= damage + if(current_health < 0) playsound(loc, 'sound/effects/splat.ogg', 50, 1) qdel(src) else update_icon() /obj/effect/blob/proc/regen() - health = min(health + regen_rate, get_max_health()) + current_health = min(current_health + regen_rate, get_max_health()) update_icon() /obj/effect/blob/proc/expand(var/turf/T) @@ -119,7 +119,7 @@ if(!(locate(/obj/effect/blob/core) in range(T, 2)) && prob(secondary_core_growth_chance)) new/obj/effect/blob/core/secondary(T) else - new expandType(T, min(health, 30)) + new expandType(T, min(current_health, 30)) /obj/effect/blob/proc/do_pulse(var/forceLeft, var/list/dirs) set waitfor = FALSE @@ -128,7 +128,7 @@ var/turf/T = get_step(src, pushDir) var/obj/effect/blob/B = (locate() in T) if(!B) - if(prob(health)) + if(prob(current_health)) expand(T) return if(forceLeft) @@ -195,7 +195,7 @@ name = "master nucleus" desc = "A massive, fragile nucleus guarded by a shield of thick tendrils." icon_state = "blob_core" - obj_max_health = 450 + max_health = 450 damage_min = 30 damage_max = 40 expandType = /obj/effect/blob/shield @@ -209,7 +209,7 @@ var/times_to_pulse = 0 /obj/effect/blob/core/proc/get_health_percent() - return ((health / get_max_health()) * 100) + return ((current_health / get_max_health()) * 100) /* the master core becomes more vulnereable to damage as it weakens, @@ -254,7 +254,7 @@ regen() will cover update_icon() for this proc visible_message(SPAN_NOTICE("The [src]'s tendril shield seems to have fully reformed."), 3) reported_low_damage = FALSE -// Rough icon state changes that reflect the core's health +// Rough icon state changes that reflect the core's current_health /obj/effect/blob/core/on_update_icon() switch(get_health_percent()) if(66 to INFINITY) @@ -281,7 +281,7 @@ regen() will cover update_icon() for this proc name = "auxiliary nucleus" desc = "An interwoven mass of tendrils. A glowing nucleus pulses at its center." icon_state = "blob_node" - obj_max_health = 125 + max_health = 125 regen_rate = 1 damage_min = 15 damage_max = 20 @@ -293,13 +293,13 @@ regen() will cover update_icon() for this proc return /obj/effect/blob/core/secondary/on_update_icon() - icon_state = (health / get_max_health() >= 0.5) ? "blob_node" : "blob_factory" + icon_state = (current_health / get_max_health() >= 0.5) ? "blob_node" : "blob_factory" /obj/effect/blob/shield name = "shielding mass" desc = "A pulsating mass of interwoven tendrils. These seem particularly robust, but not quite as active." icon_state = "blob_idle" - obj_max_health = 120 + max_health = 120 damage_min = 13 damage_max = 25 attack_freq = 7 @@ -318,9 +318,9 @@ regen() will cover update_icon() for this proc /obj/effect/blob/shield/on_update_icon() var/current_max_health = get_max_health() - if(health > current_max_health * 2 / 3) + if(current_health > current_max_health * 2 / 3) icon_state = "blob_idle" - else if(health > current_max_health / 3) + else if(current_health > current_max_health / 3) icon_state = "blob" else icon_state = "blob_damaged" @@ -331,7 +331,7 @@ regen() will cover update_icon() for this proc /obj/effect/blob/ravaging name = "ravaging mass" desc = "A mass of interwoven tendrils. They thrash around haphazardly at anything in reach." - obj_max_health = 20 + max_health = 20 damage_min = 27 damage_max = 36 attack_freq = 3 diff --git a/code/modules/clothing/masks/voice.dm b/code/modules/clothing/masks/voice.dm index 23348d26bd4..edee4acd8eb 100644 --- a/code/modules/clothing/masks/voice.dm +++ b/code/modules/clothing/masks/voice.dm @@ -1,7 +1,7 @@ /obj/item/voice_changer name = "voice changer" desc = "A voice scrambling module. If you can see this, report it as a bug on the tracker." - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE var/voice //If set and item is present in mask/suit, this name will be used for the wearer's speech. var/active diff --git a/code/modules/crafting/_crafting_holder.dm b/code/modules/crafting/_crafting_holder.dm index dd7bb07f4fb..ea9801c4c6b 100644 --- a/code/modules/crafting/_crafting_holder.dm +++ b/code/modules/crafting/_crafting_holder.dm @@ -1,6 +1,6 @@ /obj/item/crafting_holder is_spawnable_type = FALSE // Do not manually spawn this, it will runtime/break. - obj_max_health = 25 + max_health = 25 var/decl/crafting_stage/current_crafting_stage var/label_name diff --git a/code/modules/detectivework/tools/sample_kits/_sample.dm b/code/modules/detectivework/tools/sample_kits/_sample.dm index 61dd42cd997..f8c89d94b7c 100644 --- a/code/modules/detectivework/tools/sample_kits/_sample.dm +++ b/code/modules/detectivework/tools/sample_kits/_sample.dm @@ -2,7 +2,7 @@ /obj/item/forensics/sample name = "forensic sample" icon = 'icons/obj/forensics.dmi' - obj_max_health = 1 + max_health = 1 var/object var/list/possible_evidence_types = list(/datum/forensics/fibers) var/list/evidence diff --git a/code/modules/events/computer_damage.dm b/code/modules/events/computer_damage.dm index 9cf56ce1e7c..94d3f278745 100644 --- a/code/modules/events/computer_damage.dm +++ b/code/modules/events/computer_damage.dm @@ -17,4 +17,4 @@ if(prob(50)) victim.visible_message("[victim] emits some ominous clicks.") var/obj/item/stock_parts/computer/hard_drive/HDD = victim.get_component_of_type(/obj/item/stock_parts/computer/hard_drive) - HDD.take_damage(0.5 * HDD.health) + HDD.take_damage(0.5 * HDD.current_health) diff --git a/code/modules/events/disposals_explosion.dm b/code/modules/events/disposals_explosion.dm index 86f470f6d6e..a11a26fa5bf 100644 --- a/code/modules/events/disposals_explosion.dm +++ b/code/modules/events/disposals_explosion.dm @@ -52,7 +52,7 @@ return // Damage the pipe - bursting_pipe.health = rand(2,4) + bursting_pipe.current_health = rand(2,4) /datum/event/disposals_explosion/announce() command_announcement.Announce("Pressure readings indicate an imminent explosion in \the [get_area_name(bursting_pipe)] disposal systems. Piping sections may be damaged.", "[location_name()] Atmospheric Monitoring System", zlevels = affecting_z) @@ -63,7 +63,7 @@ return // Make some noise as a clue - if(prob(40) && bursting_pipe.health < 5) + if(prob(40) && bursting_pipe.current_health < 5) playsound(bursting_pipe, 'sound/machines/hiss.ogg', 40, 0, 0) /datum/event/disposals_explosion/end() @@ -72,7 +72,7 @@ events_repository.unregister(/decl/observ/destroyed, bursting_pipe, src, PROC_REF(pipe_destroyed)) - if(bursting_pipe.health < 5) + if(bursting_pipe.current_health < 5) // Make a disposals holder for the trash var/obj/structure/disposalholder/trash_holder = new() diff --git a/code/modules/holodeck/HolodeckObjects.dm b/code/modules/holodeck/HolodeckObjects.dm index 304ab637698..40d0a317ee4 100644 --- a/code/modules/holodeck/HolodeckObjects.dm +++ b/code/modules/holodeck/HolodeckObjects.dm @@ -156,7 +156,7 @@ else if(W.damtype == BRUTE || W.damtype == BURN) hit(W.force) - if(health <= 7) + if(current_health <= 7) anchored = FALSE update_nearby_icons() step(src, get_dir(user, src)) @@ -220,7 +220,7 @@ /obj/item/holo damtype = PAIN no_attack_log = 1 - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE /obj/item/holo/esword name = "holosword" diff --git a/code/modules/hydroponics/seed_packets.dm b/code/modules/hydroponics/seed_packets.dm index 6003e90a367..65d30c2e15f 100644 --- a/code/modules/hydroponics/seed_packets.dm +++ b/code/modules/hydroponics/seed_packets.dm @@ -7,7 +7,7 @@ var/global/list/plant_seed_sprites = list() icon_state = "seedy" w_class = ITEM_SIZE_SMALL abstract_type = /obj/item/seeds - obj_max_health = 10 //Can't set a material, otherwise extracting seeds would generate free materials + max_health = 10 //Can't set a material, otherwise extracting seeds would generate free materials var/seed_type var/datum/seed/seed diff --git a/code/modules/hydroponics/spreading/spreading.dm b/code/modules/hydroponics/spreading/spreading.dm index f189369b5c0..85a57dd2c9a 100644 --- a/code/modules/hydroponics/spreading/spreading.dm +++ b/code/modules/hydroponics/spreading/spreading.dm @@ -45,8 +45,8 @@ pass_flags = PASS_FLAG_TABLE mouse_opacity = MOUSE_OPACITY_NORMAL - health = 10 - obj_max_health = 100 + current_health = 10 + max_health = 100 var/growth_threshold = 0 var/growth_type = 0 var/max_growth = 0 @@ -78,19 +78,19 @@ return INITIALIZE_HINT_QDEL name = seed.display_name - obj_max_health = round(seed.get_trait(TRAIT_ENDURANCE)/2) + max_health = round(seed.get_trait(TRAIT_ENDURANCE)/2) if(start_matured) mature_time = 0 - health = obj_max_health + current_health = max_health if(seed.get_trait(TRAIT_SPREAD) == 2) mouse_opacity = MOUSE_OPACITY_PRIORITY max_growth = VINE_GROWTH_STAGES - growth_threshold = obj_max_health/VINE_GROWTH_STAGES + growth_threshold = max_health/VINE_GROWTH_STAGES growth_type = seed.get_growth_type() else max_growth = seed.growth_stages - growth_threshold = max_growth && obj_max_health/max_growth + growth_threshold = max_growth && max_health/max_growth if(max_growth > 2 && prob(50)) max_growth-- //Ensure some variation in final sprite, makes the carpet of crap look less wonky. @@ -111,7 +111,7 @@ /obj/effect/vine/on_update_icon() overlays.Cut() - var/growth = growth_threshold ? min(max_growth, round(health/growth_threshold)) : 1 + var/growth = growth_threshold ? min(max_growth, round(current_health/growth_threshold)) : 1 var/at_fringe = get_dist(src,parent) if(spread_distance > 5) if(at_fringe >= spread_distance-3) @@ -211,7 +211,7 @@ to_chat(user, SPAN_WARNING("You failed to get a usable sample.")) else seed.harvest(user,0,1) - health -= (rand(3,5)*5) + current_health -= (rand(3,5)*5) else ..() var/damage = W.force @@ -256,12 +256,12 @@ physically_destroyed() /obj/effect/vine/proc/adjust_health(value) - health = clamp(health + value, 0, get_max_health()) - if(health <= 0) + current_health = clamp(current_health + value, 0, get_max_health()) + if(current_health <= 0) die_off() /obj/effect/vine/proc/is_mature() - return (health >= (get_max_health()/3) && world.time > mature_time) + return (current_health >= (get_max_health()/3) && world.time > mature_time) /obj/effect/vine/is_burnable() return seed.get_trait(TRAIT_HEAT_TOLERANCE) < 1000 @@ -282,7 +282,7 @@ return user.visible_message(SPAN_NOTICE("\The [user] starts chopping down \the [V].")) playsound(get_turf(V), W.hitsound, 100, 1) - var/chop_time = (V.health/W.force) * 0.5 SECONDS + var/chop_time = (V.current_health/W.force) * 0.5 SECONDS if(user.skill_check(SKILL_BOTANY, SKILL_ADEPT)) chop_time *= 0.5 if(do_after(user, chop_time, V, TRUE)) diff --git a/code/modules/hydroponics/spreading/spreading_growth.dm b/code/modules/hydroponics/spreading/spreading_growth.dm index 00941f36c07..18f0621276b 100644 --- a/code/modules/hydroponics/spreading/spreading_growth.dm +++ b/code/modules/hydroponics/spreading/spreading_growth.dm @@ -44,7 +44,7 @@ //Take damage from bad environment if any adjust_health(-seed.handle_plant_environment(T,T.return_air(),null,1)) - if(health <= 0) + if(current_health <= 0) return //Vine fight! @@ -53,9 +53,9 @@ other.vine_overrun(seed, src) //Growing up - if(health < get_max_health()) + if(current_health < get_max_health()) adjust_health(1) - if(growth_threshold && !(health % growth_threshold)) + if(growth_threshold && !(current_health % growth_threshold)) update_icon() if(is_mature()) @@ -94,14 +94,14 @@ /obj/effect/vine/proc/can_spawn_plant() var/turf/simulated/T = get_turf(src) - return parent == src && health == get_max_health() && !plant && istype(T) && !T.CanZPass(src, DOWN) + return parent == src && current_health == get_max_health() && !plant && istype(T) && !T.CanZPass(src, DOWN) /obj/effect/vine/proc/should_sleep() if(buckled_mob) //got a victim to fondle return FALSE if(length(get_neighbors())) //got places to spread to return FALSE - if(health < get_max_health()) //got some growth to do + if(current_health < get_max_health()) //got some growth to do return FALSE if(targets_in_range()) //got someone to grab return FALSE diff --git a/code/modules/integrated_electronics/core/assemblies.dm b/code/modules/integrated_electronics/core/assemblies.dm index c94d52d51a8..95378fa3db7 100644 --- a/code/modules/integrated_electronics/core/assemblies.dm +++ b/code/modules/integrated_electronics/core/assemblies.dm @@ -12,7 +12,7 @@ pass_flags = 0 anchored = FALSE obj_flags = OBJ_FLAG_ANCHORABLE - obj_max_health = 30 + max_health = 30 var/list/assembly_components = list() var/list/ckeys_allowed_to_scan = list() // Players who built the circuit can scan it as a ghost. var/max_components = IC_MAX_SIZE_BASE @@ -65,7 +65,7 @@ /obj/item/electronic_assembly/check_health(lastdamage, lastdamtype, lastdamflags, consumed) if(!can_take_damage()) return - if(health < 1) + if(current_health < 1) visible_message(SPAN_DANGER("\The [src] falls to pieces!")) physically_destroyed() else if((get_percent_health() < 15) && prob(5)) @@ -109,7 +109,7 @@ P.make_energy() var/power_failure = FALSE - if(get_max_health()/health < 0.5 && prob(5)) + if(get_max_health()/current_health < 0.5 && prob(5)) visible_message(SPAN_WARNING("\The [src] shudders and sparks.")) power_failure = TRUE // Now spend it. @@ -471,7 +471,7 @@ var/obj/item/stack/cable_coil/C = I if(is_damaged() && do_after(user, 10, src) && C.use(1)) user.visible_message("\The [user] patches up \the [src].") - health = min(get_max_health(), health + 5) + current_health = min(get_max_health(), current_health + 5) return TRUE else if(user.a_intent != I_HURT) @@ -560,7 +560,7 @@ w_class = ITEM_SIZE_NORMAL max_components = IC_MAX_SIZE_BASE * 2 max_complexity = IC_COMPLEXITY_BASE * 2 - obj_max_health = 20 + max_health = 20 /obj/item/electronic_assembly/medium/default name = "type-a electronic mechanism" @@ -600,7 +600,7 @@ w_class = ITEM_SIZE_LARGE max_components = IC_MAX_SIZE_BASE * 4 max_complexity = IC_COMPLEXITY_BASE * 4 - obj_max_health = 30 + max_health = 30 /obj/item/electronic_assembly/large/default name = "type-a electronic machine" @@ -640,7 +640,7 @@ allowed_circuit_action_flags = IC_ACTION_MOVEMENT | IC_ACTION_COMBAT | IC_ACTION_LONG_RANGE circuit_flags = 0 obj_flags = 0 //Not anchorable - obj_max_health = 50 + max_health = 50 /obj/item/electronic_assembly/drone/can_move() return TRUE @@ -680,7 +680,7 @@ w_class = ITEM_SIZE_NORMAL max_components = IC_MAX_SIZE_BASE * 2 max_complexity = IC_COMPLEXITY_BASE * 2 - obj_max_health = 10 + max_health = 10 /obj/item/electronic_assembly/wallmount/afterattack(var/atom/a, var/mob/user, var/proximity) if(proximity && istype(a ,/turf) && a.density) diff --git a/code/modules/integrated_electronics/core/integrated_circuit.dm b/code/modules/integrated_electronics/core/integrated_circuit.dm index d5424b88cf9..8a7ef0695f4 100644 --- a/code/modules/integrated_electronics/core/integrated_circuit.dm +++ b/code/modules/integrated_electronics/core/integrated_circuit.dm @@ -5,7 +5,7 @@ icon_state = "template" w_class = ITEM_SIZE_TINY matter = list() // To be filled later - obj_max_health = 25 //#TODO: Use material for health + max_health = 25 //#TODO: Use material for health var/obj/item/electronic_assembly/assembly // Reference to the assembly holding this circuit, if any. var/extended_desc var/list/inputs diff --git a/code/modules/materials/material_sheets.dm b/code/modules/materials/material_sheets.dm index b0198b8bf05..0f566b41f24 100644 --- a/code/modules/materials/material_sheets.dm +++ b/code/modules/materials/material_sheets.dm @@ -389,7 +389,7 @@ uses_charge = 1 charge_costs = list(500) material = /decl/material/solid/metal/steel - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE is_spawnable_type = FALSE /obj/item/stack/material/bar diff --git a/code/modules/materials/material_synth.dm b/code/modules/materials/material_synth.dm index 390a8f984f5..4aa562ea6a1 100644 --- a/code/modules/materials/material_synth.dm +++ b/code/modules/materials/material_synth.dm @@ -5,7 +5,7 @@ charge_costs = list(1000) gender = NEUTER matter = null // Don't shove it in the autholathe. - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE is_spawnable_type = FALSE /obj/item/stack/material/cyborg/Initialize() diff --git a/code/modules/mechs/components/body.dm b/code/modules/mechs/components/body.dm index 76e1e2a35c7..5f072a7392e 100644 --- a/code/modules/mechs/components/body.dm +++ b/code/modules/mechs/components/body.dm @@ -4,7 +4,7 @@ storage_slots = 4 use_sound = 'sound/effects/storage/toolbox.ogg' anchored = TRUE - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE /obj/item/mech_component/chassis/Adjacent(var/atom/neighbor, var/recurse = 1) //For interaction purposes we consider body to be adjacent to whatever holder mob is adjacent var/mob/living/exosuit/E = loc diff --git a/code/modules/mechs/equipment/combat.dm b/code/modules/mechs/equipment/combat.dm index 7db47f2731a..107f20395d4 100644 --- a/code/modules/mechs/equipment/combat.dm +++ b/code/modules/mechs/equipment/combat.dm @@ -241,7 +241,7 @@ base_parry_chance = 0 //Irrelevant for exosuits, revise if this changes max_force = 25 material_force_multiplier = 0.75 // Equals 20 AP with 25 force - obj_max_health = ITEM_HEALTH_NO_DAMAGE //Else we need a whole system for replacement blades + max_health = ITEM_HEALTH_NO_DAMAGE //Else we need a whole system for replacement blades /obj/item/hatchet/machete/mech/apply_hit_effect(mob/living/target, mob/living/user, hit_zone) . = ..() diff --git a/code/modules/mob/living/bot/bot.dm b/code/modules/mob/living/bot/bot.dm index 4f7229bff8e..0b5afe1c2b5 100644 --- a/code/modules/mob/living/bot/bot.dm +++ b/code/modules/mob/living/bot/bot.dm @@ -1,6 +1,6 @@ /mob/living/bot name = "Bot" - mob_default_max_health = 20 + max_health = 20 icon = 'icons/mob/bot/placeholder.dmi' universal_speak = TRUE density = FALSE diff --git a/code/modules/mob/living/bot/ed209bot.dm b/code/modules/mob/living/bot/ed209bot.dm index 2069e6a546a..78d3f2f6b6f 100644 --- a/code/modules/mob/living/bot/ed209bot.dm +++ b/code/modules/mob/living/bot/ed209bot.dm @@ -6,7 +6,7 @@ attack_state = "ed209-c" layer = MOB_LAYER density = TRUE - mob_default_max_health = 100 + max_health = 100 preparing_arrest_sounds = new() diff --git a/code/modules/mob/living/bot/farmbot.dm b/code/modules/mob/living/bot/farmbot.dm index 0f39b806b0a..0354496d72a 100644 --- a/code/modules/mob/living/bot/farmbot.dm +++ b/code/modules/mob/living/bot/farmbot.dm @@ -8,7 +8,7 @@ desc = "The botanist's best friend." icon = 'icons/mob/bot/farmbot.dmi' icon_state = "farmbot0" - mob_default_max_health = 50 + max_health = 50 req_access = list(list(access_hydroponics, access_robotics)) var/action = "" // Used to update icon diff --git a/code/modules/mob/living/bot/mulebot.dm b/code/modules/mob/living/bot/mulebot.dm index 6cbd7c10381..e381d4b3782 100644 --- a/code/modules/mob/living/bot/mulebot.dm +++ b/code/modules/mob/living/bot/mulebot.dm @@ -15,7 +15,7 @@ layer = MOB_LAYER anchored = TRUE density = TRUE - mob_default_max_health = 150 + max_health = 150 mob_bump_flag = HEAVY min_target_dist = 0 diff --git a/code/modules/mob/living/bot/remotebot.dm b/code/modules/mob/living/bot/remotebot.dm index 2b7d9019360..3806fc42a18 100644 --- a/code/modules/mob/living/bot/remotebot.dm +++ b/code/modules/mob/living/bot/remotebot.dm @@ -3,7 +3,7 @@ desc = "A remote controlled robot used by lazy people to switch channels and get pizza." icon = 'icons/mob/bot/fetchbot.dmi' icon_state = "fetchbot1" - mob_default_max_health = 15 + max_health = 15 var/working = 0 var/speed = 10 //lower = better diff --git a/code/modules/mob/living/bot/secbot.dm b/code/modules/mob/living/bot/secbot.dm index 2a17f24eede..6bd1d6e61a5 100644 --- a/code/modules/mob/living/bot/secbot.dm +++ b/code/modules/mob/living/bot/secbot.dm @@ -8,7 +8,7 @@ icon = 'icons/mob/bot/secbot.dmi' icon_state = "secbot0" layer = MOB_LAYER - mob_default_max_health = 50 + max_health = 50 req_access = list(list(access_security, access_forensics_lockers)) botcard_access = list(access_security, access_sec_doors, access_forensics_lockers, access_morgue, access_maint_tunnels) diff --git a/code/modules/mob/living/carbon/alien/alien.dm b/code/modules/mob/living/carbon/alien/alien.dm index 3237e4f48ed..1cc900bc914 100644 --- a/code/modules/mob/living/carbon/alien/alien.dm +++ b/code/modules/mob/living/carbon/alien/alien.dm @@ -2,7 +2,7 @@ name = "alien" desc = "What IS that?" pass_flags = PASS_FLAG_TABLE - mob_default_max_health = 100 + max_health = 100 mob_size = MOB_SIZE_TINY mob_sort_value = 8 var/dead_icon diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index e62fed67443..949e0fd212e 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -6,14 +6,14 @@ icon_state = "body_m_s" mob_sort_value = 6 dna = new /datum/dna() - mob_default_max_health = 150 + max_health = 150 var/list/hud_list[10] var/embedded_flag //To check if we've need to roll for damage on movement while an item is imbedded in us. var/step_count /mob/living/carbon/human/Initialize(mapload, species_name, datum/dna/new_dna, decl/bodytype/new_bodytype) - current_health = mob_default_max_health + current_health = max_health setup_hud_overlays() var/list/newargs = args.Copy(2) setup(arglist(newargs)) diff --git a/code/modules/mob/living/carbon/resist.dm b/code/modules/mob/living/carbon/resist.dm index 3893bf38018..9eef36b15d9 100644 --- a/code/modules/mob/living/carbon/resist.dm +++ b/code/modules/mob/living/carbon/resist.dm @@ -78,10 +78,10 @@ return if(!cuffs || buckled) return - if (cuffs.can_take_damage() && cuffs.health > 0) // Improvised cuffs can break because their health is > 0 + if (cuffs.can_take_damage() && cuffs.current_health > 0) // Improvised cuffs can break because their health is > 0 var/cuffs_name = "\the [cuffs]" cuffs.take_damage(cuffs.get_max_health() / 2) - if (QDELETED(cuffs) || cuffs.health < 1) + if (QDELETED(cuffs) || cuffs.current_health < 1) visible_message( SPAN_DANGER("\The [src] manages to remove [cuffs_name], breaking them!"), SPAN_NOTICE("You successfully remove [cuffs_name], breaking them!"), range = 2 diff --git a/code/modules/mob/living/deity/deity.dm b/code/modules/mob/living/deity/deity.dm index be98a7e030a..8bad1256f1d 100644 --- a/code/modules/mob/living/deity/deity.dm +++ b/code/modules/mob/living/deity/deity.dm @@ -5,7 +5,7 @@ icon_state = "egg" pixel_x = -128 pixel_y = -128 - mob_default_max_health = 100 + max_health = 100 universal_understand = TRUE mob_sort_value = 5 diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 1555b2418f5..75931f5d474 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -319,11 +319,8 @@ default behaviour is: /mob/living/proc/get_health_percent(var/sigfig = 1) return round(get_health_ratio()*100, sigfig) -/mob/living/proc/get_max_health() - return mob_default_max_health - /mob/living/proc/set_max_health(var/val, var/skip_health_update = FALSE) - mob_default_max_health = val + max_health = val if(!skip_health_update) update_health() diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index 7eab17ec15a..cd3e547a726 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -5,8 +5,8 @@ abstract_type = /mob/living //Health and life related vars - var/mob_default_max_health = 100 //Maximum health that should be possible. - var/current_health = INFINITY // A mob's current health. Set by update_health(). Defaults to INFINITY so mobs don't die on init. + max_health = 100 //Maximum health that should be possible. + current_health = INFINITY // A mob's current health. Set by update_health(). Defaults to INFINITY so mobs don't die on init. var/hud_updateflag = 0 diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 8f2b8462ee2..ab59e6eb21f 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -56,7 +56,7 @@ var/global/list/ai_verbs_default = list( density = TRUE status_flags = CANSTUN|CANPARALYSE|CANPUSH shouldnt_see = list(/obj/effect/rune) - mob_default_max_health = 200 + max_health = 200 silicon_camera = /obj/item/camera/siliconcam/ai_camera silicon_radio = /obj/item/radio/headset/heads/ai_integrated diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index 2be9d6e687e..99ecf75f6cf 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -34,7 +34,7 @@ var/global/list/possible_say_verbs = list( holder_type = /obj/item/holder idcard = /obj/item/card/id silicon_radio = null // pAIs get their radio from the card they belong to. - mob_default_max_health = 100 + max_health = 100 os_type = /datum/extension/interactive/os/silicon/small starting_stock_parts = list( diff --git a/code/modules/mob/living/silicon/robot/component.dm b/code/modules/mob/living/silicon/robot/component.dm index 8e5bd6bb7c2..4938f085395 100644 --- a/code/modules/mob/living/silicon/robot/component.dm +++ b/code/modules/mob/living/silicon/robot/component.dm @@ -222,8 +222,8 @@ icon = 'icons/obj/robot_component.dmi' icon_state = "working" material = /decl/material/solid/metal/steel - health = 30 - obj_max_health = 30 + current_health = 30 + max_health = 30 var/burn_damage = 0 var/brute_damage = 0 var/icon_state_broken = "broken" @@ -237,19 +237,19 @@ burn_damage = clamp(lastdamage, 0, current_max_health) //Health works differently for this thing - health = clamp(current_max_health - (brute_damage + burn_damage), 0, current_max_health) + current_health = clamp(current_max_health - (brute_damage + burn_damage), 0, current_max_health) . = ..() /obj/item/robot_parts/robot_component/proc/set_bruteloss(var/amount) var/current_max_health = get_max_health() brute_damage = clamp(amount, 0, current_max_health) - health = current_max_health - (brute_damage + burn_damage) + current_health = current_max_health - (brute_damage + burn_damage) check_health(amount, BRUTE) /obj/item/robot_parts/robot_component/proc/set_burnloss(var/amount) var/current_max_health = get_max_health() burn_damage = clamp(amount, 0, current_max_health) - health = current_max_health - (brute_damage + burn_damage) + current_health = current_max_health - (brute_damage + burn_damage) check_health(amount, BURN) /obj/item/robot_parts/robot_component/physically_destroyed(skip_qdel) diff --git a/code/modules/mob/living/silicon/robot/drone/drone.dm b/code/modules/mob/living/silicon/robot/drone/drone.dm index 57ed84e6ed3..9b9df64aa7f 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone.dm @@ -2,7 +2,7 @@ name = "maintenance drone" real_name = "drone" icon = 'icons/mob/robots/drones/drone.dmi' - mob_default_max_health = 35 + max_health = 35 cell_emp_mult = 1 universal_speak = FALSE universal_understand = TRUE diff --git a/code/modules/mob/living/silicon/robot/drone/drone_items.dm b/code/modules/mob/living/silicon/robot/drone/drone_items.dm index ea4897533d2..cef20e56fe9 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone_items.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone_items.dm @@ -5,7 +5,7 @@ desc = "A simple grasping tool specialized in construction and engineering work." icon = 'icons/obj/items/borg_module/borg_gripper.dmi' icon_state = "gripper" - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE item_flags = ITEM_FLAG_NO_BLUDGEON //Has a list of items that it can hold. @@ -274,7 +274,7 @@ desc = "Eating trash, bits of glass, or other debris will replenish your stores." icon = 'icons/obj/items/borg_module/decompiler.dmi' icon_state = "decompiler" - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE //Metal, glass, wood, plastic. var/datum/matter_synth/metal = null diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index a64578ea989..d5106712d04 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -5,7 +5,7 @@ real_name = "robot" icon = 'icons/mob/robots/robot.dmi' icon_state = ICON_STATE_WORLD - mob_default_max_health = 300 + max_health = 300 mob_sort_value = 4 z_flags = ZMM_MANGLE_PLANES diff --git a/code/modules/mob/living/silicon/robot/robot_items.dm b/code/modules/mob/living/silicon/robot/robot_items.dm index 418ff805b6e..d368c595b46 100644 --- a/code/modules/mob/living/silicon/robot/robot_items.dm +++ b/code/modules/mob/living/silicon/robot/robot_items.dm @@ -90,7 +90,7 @@ desc = "A hand-held harvest tool that resembles a sickle. It uses energy to cut plant matter very efficently." icon = 'icons/obj/items/borg_module/autoharvester.dmi' icon_state = "autoharvester" - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE /obj/item/robot_harvester/afterattack(var/atom/target, var/mob/living/user, proximity) if(!target) @@ -172,7 +172,7 @@ icon = 'icons/obj/items/paper_bin.dmi' icon_state = "paper_bin1" item_state = "sheet-metal" - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE /obj/item/form_printer/attack(mob/living/carbon/M, mob/living/carbon/user) return @@ -236,7 +236,7 @@ stored_doors = 5 max_walls = 10 max_doors = 5 - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE /obj/item/inflatable_dispenser/examine(mob/user) . = ..() @@ -325,7 +325,7 @@ /obj/item/robot_rack name = "a generic robot rack" desc = "A rack for carrying large items as a robot." - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE var/object_type //The types of object the rack holds (subtypes are allowed). var/interact_type //Things of this type will trigger attack_hand when attacked by this. var/capacity = 1 //How many objects can be held. @@ -369,7 +369,7 @@ desc = "An integrated power generator that runs on most kinds of biomass." icon = 'icons/obj/power.dmi' icon_state = "portgen0" - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE var/base_power_generation = 75 KILOWATTS var/max_fuel_items = 5 diff --git a/code/modules/mob/living/simple_animal/aquatic/aquatic_carp.dm b/code/modules/mob/living/simple_animal/aquatic/aquatic_carp.dm index 1200dcd7cd6..769a359969d 100644 --- a/code/modules/mob/living/simple_animal/aquatic/aquatic_carp.dm +++ b/code/modules/mob/living/simple_animal/aquatic/aquatic_carp.dm @@ -3,7 +3,7 @@ desc = "A ferocious fish. May be too hardcore." icon = 'icons/mob/simple_animal/fish_carp.dmi' faction = "fishes" - mob_default_max_health = 20 + max_health = 20 meat_type = /obj/item/chems/food/fish/carp /mob/living/simple_animal/hostile/retaliate/aquatic/carp/Initialize() diff --git a/code/modules/mob/living/simple_animal/aquatic/aquatic_fish.dm b/code/modules/mob/living/simple_animal/aquatic/aquatic_fish.dm index ebab3555537..779afa840fe 100644 --- a/code/modules/mob/living/simple_animal/aquatic/aquatic_fish.dm +++ b/code/modules/mob/living/simple_animal/aquatic/aquatic_fish.dm @@ -2,7 +2,7 @@ name = "small fish" desc = "Glub glub." faction = "fishes" - mob_default_max_health = 10 + max_health = 10 mob_size = MOB_SIZE_TINY can_pull_size = 0 can_pull_mobs = 0 diff --git a/code/modules/mob/living/simple_animal/aquatic/aquatic_sharks.dm b/code/modules/mob/living/simple_animal/aquatic/aquatic_sharks.dm index 12516db07ff..8e2ade73687 100644 --- a/code/modules/mob/living/simple_animal/aquatic/aquatic_sharks.dm +++ b/code/modules/mob/living/simple_animal/aquatic/aquatic_sharks.dm @@ -2,7 +2,7 @@ name = "shark" desc = "A ferocious fish with many, many teeth." icon = 'icons/mob/simple_animal/shark.dmi' - mob_default_max_health = 150 + max_health = 150 natural_weapon = /obj/item/natural_weapon/bite/shark break_stuff_probability = 15 faction = "sharks" @@ -27,7 +27,7 @@ speed = 0 mob_size = MOB_SIZE_LARGE pixel_x = -16 - mob_default_max_health = 400 + max_health = 400 harm_intent_damage = 5 natural_weapon = /obj/item/natural_weapon/bite/giantshark break_stuff_probability = 35 diff --git a/code/modules/mob/living/simple_animal/constructs/constructs.dm b/code/modules/mob/living/simple_animal/constructs/constructs.dm index 23d000c9ea5..ce61d2e9336 100644 --- a/code/modules/mob/living/simple_animal/constructs/constructs.dm +++ b/code/modules/mob/living/simple_animal/constructs/constructs.dm @@ -102,7 +102,7 @@ real_name = "Juggernaut" desc = "A possessed suit of armour driven by the will of the restless dead" icon = 'icons/mob/simple_animal/construct_behemoth.dmi' - mob_default_max_health = 250 + max_health = 250 speak_emote = list("rumbles") response_harm = "harmlessly punches" harm_intent_damage = 0 @@ -159,7 +159,7 @@ real_name = "Wraith" desc = "A wicked bladed shell contraption piloted by a bound spirit" icon = 'icons/mob/simple_animal/construct_floating.dmi' - mob_default_max_health = 75 + max_health = 75 natural_weapon = /obj/item/natural_weapon/wraith speed = -1 environment_smash = 1 @@ -183,7 +183,7 @@ real_name = "Artificer" desc = "A bulbous construct dedicated to building and maintaining The Cult of Nar-Sie's armies" icon = 'icons/mob/simple_animal/construct_artificer.dmi' - mob_default_max_health = 50 + max_health = 50 response_harm = "viciously beaten" harm_intent_damage = 5 natural_weapon = /obj/item/natural_weapon/cult_builder @@ -209,7 +209,7 @@ real_name = "Behemoth" desc = "The pinnacle of occult technology, Behemoths are the ultimate weapon in the Cult of Nar-Sie's arsenal." icon = 'icons/mob/simple_animal/construct_behemoth.dmi' - mob_default_max_health = 750 + max_health = 750 speak_emote = list("rumbles") response_harm = "harmlessly punches" harm_intent_damage = 0 @@ -232,7 +232,7 @@ real_name = "Harvester" desc = "The promised reward of the livings who follow Nar-Sie. Obtained by offering their bodies to the geometer of blood" icon = 'icons/mob/simple_animal/construct_harvester.dmi' - mob_default_max_health = 150 + max_health = 150 natural_weapon = /obj/item/natural_weapon/harvester speed = -1 environment_smash = 1 diff --git a/code/modules/mob/living/simple_animal/familiars/familiars.dm b/code/modules/mob/living/simple_animal/familiars/familiars.dm index 8405efeb321..a1f94469450 100644 --- a/code/modules/mob/living/simple_animal/familiars/familiars.dm +++ b/code/modules/mob/living/simple_animal/familiars/familiars.dm @@ -24,7 +24,7 @@ desc = "A small crab said to be made of stone and starlight." icon = 'icons/mob/simple_animal/evilcrab.dmi' speak_emote = list("chitters","clicks") - mob_default_max_health = 200 + max_health = 200 natural_weapon = /obj/item/natural_weapon/pincers/strong resistance = 9 can_escape = TRUE //snip snip @@ -43,7 +43,7 @@ offset_overhead_text_x = 16 speak_emote = list("gnashes") - mob_default_max_health = 100 + max_health = 100 natural_weapon = /obj/item/natural_weapon/bite can_escape = TRUE min_gas = null @@ -59,7 +59,7 @@ speak_emote = list("moans", "groans") response_help_1p = "You think better of touching $TARGET$." response_help_3p = "$USER$ thinks better of touching $TARGET$." - mob_default_max_health = 150 + max_health = 150 natural_weapon = /obj/item/natural_weapon/horror wizardy_spells = list(/spell/targeted/torment) @@ -81,7 +81,7 @@ icon = 'icons/mob/simple_animal/amaros.dmi' speak_emote = list("entones") mob_size = MOB_SIZE_SMALL - mob_default_max_health = 25 + max_health = 25 wizardy_spells = list( /spell/targeted/heal_target, /spell/targeted/heal_target/area @@ -96,7 +96,7 @@ pass_flags = PASS_FLAG_TABLE mob_size = MOB_SIZE_MINISCULE response_harm = "stamps on" - mob_default_max_health = 15 + max_health = 15 natural_weapon = /obj/item/natural_weapon/bite/mouse can_escape = TRUE @@ -115,6 +115,6 @@ speak_emote = list("meows", "purrs") holder_type = /obj/item/holder mob_size = MOB_SIZE_SMALL - mob_default_max_health = 25 + max_health = 25 natural_weapon = /obj/item/natural_weapon/claws/weak wizardy_spells = list(/spell/targeted/subjugation) diff --git a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm index 36aa587eb08..837aa5a9d65 100644 --- a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm +++ b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm @@ -11,7 +11,7 @@ turns_per_move = 5 see_in_dark = 6 faction = "goat" - mob_default_max_health = 40 + max_health = 40 natural_weapon = /obj/item/natural_weapon/hooves meat_type = /obj/item/chems/food/meat/goat @@ -101,7 +101,7 @@ speak_chance = 1 turns_per_move = 5 see_in_dark = 6 - mob_default_max_health = 50 + max_health = 50 meat_type = /obj/item/chems/food/meat/beef meat_amount = 6 @@ -170,7 +170,7 @@ emote_see = list("pecks at the ground","flaps its tiny wings") speak_chance = 2 turns_per_move = 2 - mob_default_max_health = 1 + max_health = 1 pass_flags = PASS_FLAG_TABLE | PASS_FLAG_GRILLE mob_size = MOB_SIZE_MINISCULE @@ -197,7 +197,7 @@ qdel(src) /mob/living/simple_animal/fowl - mob_default_max_health = 10 + max_health = 10 pass_flags = PASS_FLAG_TABLE mob_size = MOB_SIZE_SMALL meat_type = /obj/item/chems/food/meat/chicken diff --git a/code/modules/mob/living/simple_animal/friendly/koala.dm b/code/modules/mob/living/simple_animal/friendly/koala.dm index ef7eba50ca6..bc32be1be76 100644 --- a/code/modules/mob/living/simple_animal/friendly/koala.dm +++ b/code/modules/mob/living/simple_animal/friendly/koala.dm @@ -3,7 +3,7 @@ name = "koala" desc = "A little grey bear. How long is he gonna sleep today?" icon = 'icons/mob/simple_animal/koala.dmi' - mob_default_max_health = 45 + max_health = 45 speed = 4 speak = list("Rrr", "Wraarh...", "Pfrrr...") speak_emote = list("roar") diff --git a/code/modules/mob/living/simple_animal/friendly/lizard.dm b/code/modules/mob/living/simple_animal/friendly/lizard.dm index 093245642b3..f5e338c8515 100644 --- a/code/modules/mob/living/simple_animal/friendly/lizard.dm +++ b/code/modules/mob/living/simple_animal/friendly/lizard.dm @@ -3,7 +3,7 @@ desc = "A cute tiny lizard." icon = 'icons/mob/simple_animal/lizard.dmi' speak_emote = list("hisses") - mob_default_max_health = 5 + max_health = 5 natural_weapon = /obj/item/natural_weapon/bite/weak response_harm = "stamps on" mob_size = MOB_SIZE_MINISCULE diff --git a/code/modules/mob/living/simple_animal/friendly/mouse.dm b/code/modules/mob/living/simple_animal/friendly/mouse.dm index 4e841b450f1..a259d4d70e6 100644 --- a/code/modules/mob/living/simple_animal/friendly/mouse.dm +++ b/code/modules/mob/living/simple_animal/friendly/mouse.dm @@ -11,7 +11,7 @@ speak_chance = 1 turns_per_move = 5 see_in_dark = 6 - mob_default_max_health = 5 + max_health = 5 response_harm = "stamps on" density = FALSE minbodytemp = 223 //Below -50 Degrees Celsius @@ -131,7 +131,7 @@ body_color = "rat" icon = 'icons/mob/simple_animal/rat.dmi' skin_material = /decl/material/solid/organic/skin/fur/gray - mob_default_max_health = 20 + max_health = 20 /mob/living/simple_animal/mouse/rat/set_mouse_icon() return diff --git a/code/modules/mob/living/simple_animal/friendly/mushroom.dm b/code/modules/mob/living/simple_animal/friendly/mushroom.dm index c73bcdd1f8f..71ff44c4f64 100644 --- a/code/modules/mob/living/simple_animal/friendly/mushroom.dm +++ b/code/modules/mob/living/simple_animal/friendly/mushroom.dm @@ -5,7 +5,7 @@ mob_size = MOB_SIZE_SMALL speak_chance = 0 turns_per_move = 1 - mob_default_max_health = 5 + max_health = 5 harm_intent_damage = 5 pass_flags = PASS_FLAG_TABLE diff --git a/code/modules/mob/living/simple_animal/friendly/possum.dm b/code/modules/mob/living/simple_animal/friendly/possum.dm index c9e1a73f296..832c409b796 100644 --- a/code/modules/mob/living/simple_animal/friendly/possum.dm +++ b/code/modules/mob/living/simple_animal/friendly/possum.dm @@ -11,7 +11,7 @@ speak_chance = 1 turns_per_move = 3 see_in_dark = 6 - mob_default_max_health = 50 + max_health = 50 response_harm = "stamps on" density = FALSE minbodytemp = 223 diff --git a/code/modules/mob/living/simple_animal/friendly/tomato.dm b/code/modules/mob/living/simple_animal/friendly/tomato.dm index f451ae9243e..531797ac24d 100644 --- a/code/modules/mob/living/simple_animal/friendly/tomato.dm +++ b/code/modules/mob/living/simple_animal/friendly/tomato.dm @@ -4,7 +4,7 @@ icon = 'icons/mob/simple_animal/tomato.dmi' speak_chance = 0 turns_per_move = 5 - mob_default_max_health = 15 + max_health = 15 response_help_3p = "$USER$ pokes $TARGET$." response_help_1p = "You poke $TARGET$." harm_intent_damage = 5 diff --git a/code/modules/mob/living/simple_animal/hostile/antlion.dm b/code/modules/mob/living/simple_animal/hostile/antlion.dm index 5f604dfdc9c..8e781e72554 100644 --- a/code/modules/mob/living/simple_animal/hostile/antlion.dm +++ b/code/modules/mob/living/simple_animal/hostile/antlion.dm @@ -9,7 +9,7 @@ response_harm = "strikes" faction = "antlions" bleed_colour = COLOR_SKY_BLUE - mob_default_max_health = 65 + max_health = 65 natural_weapon = /obj/item/natural_weapon/bite natural_armor = list( ARMOR_MELEE = ARMOR_MELEE_KNIVES @@ -89,7 +89,7 @@ desc = "A huge antlion. It looks displeased." icon = 'icons/mob/simple_animal/antlion_queen.dmi' mob_size = MOB_SIZE_LARGE - mob_default_max_health = 275 + max_health = 275 natural_weapon = /obj/item/natural_weapon/bite/megalion natural_armor = list( ARMOR_MELEE = ARMOR_MELEE_RESISTANT diff --git a/code/modules/mob/living/simple_animal/hostile/bad_drone.dm b/code/modules/mob/living/simple_animal/hostile/bad_drone.dm index 89c7a8b0f6e..c9e8b665393 100644 --- a/code/modules/mob/living/simple_animal/hostile/bad_drone.dm +++ b/code/modules/mob/living/simple_animal/hostile/bad_drone.dm @@ -5,7 +5,7 @@ speak = list("Removing organic waste.","Pest control in progress.","Seize the means of maintenance!", "You have nothing to lose but your laws!") speak_emote = list("blares","buzzes","beeps") speak_chance = 1 - mob_default_max_health = 50 + max_health = 50 natural_weapon = /obj/item/natural_weapon/drone_slicer faction = "silicon" min_gas = null diff --git a/code/modules/mob/living/simple_animal/hostile/bat.dm b/code/modules/mob/living/simple_animal/hostile/bat.dm index 829de9c40b0..c06159dffd2 100644 --- a/code/modules/mob/living/simple_animal/hostile/bat.dm +++ b/code/modules/mob/living/simple_animal/hostile/bat.dm @@ -5,7 +5,7 @@ speak_chance = 0 turns_per_move = 3 speed = 4 - mob_default_max_health = 20 + max_health = 20 harm_intent_damage = 8 natural_weapon = /obj/item/natural_weapon/bite min_gas = null diff --git a/code/modules/mob/living/simple_animal/hostile/bear.dm b/code/modules/mob/living/simple_animal/hostile/bear.dm index f6d7712a7c4..ab024bd1621 100644 --- a/code/modules/mob/living/simple_animal/hostile/bear.dm +++ b/code/modules/mob/living/simple_animal/hostile/bear.dm @@ -12,7 +12,7 @@ see_in_dark = 6 response_harm = "pokes" stop_automated_movement_when_pulled = 0 - mob_default_max_health = 60 + max_health = 60 natural_weapon = /obj/item/natural_weapon/claws/strong can_escape = TRUE faction = "russian" diff --git a/code/modules/mob/living/simple_animal/hostile/carp.dm b/code/modules/mob/living/simple_animal/hostile/carp.dm index 5fcc88f7544..b12b90f222e 100644 --- a/code/modules/mob/living/simple_animal/hostile/carp.dm +++ b/code/modules/mob/living/simple_animal/hostile/carp.dm @@ -5,7 +5,7 @@ speak_chance = 0 turns_per_move = 3 speed = 2 - mob_default_max_health = 50 + max_health = 50 harm_intent_damage = 8 natural_weapon = /obj/item/natural_weapon/bite pry_time = 10 SECONDS @@ -32,8 +32,8 @@ update_icon() /mob/living/simple_animal/hostile/carp/proc/carp_randomify() - mob_default_max_health = rand(initial(mob_default_max_health), (1.5 * initial(mob_default_max_health))) - current_health = mob_default_max_health + max_health = rand(initial(max_health), (1.5 * initial(max_health))) + current_health = max_health if(prob(1)) carp_color = pick(COLOR_WHITE, COLOR_BLACK) else diff --git a/code/modules/mob/living/simple_animal/hostile/commanded/bear_companion.dm b/code/modules/mob/living/simple_animal/hostile/commanded/bear_companion.dm index 9057661d22f..635c5fd9387 100644 --- a/code/modules/mob/living/simple_animal/hostile/commanded/bear_companion.dm +++ b/code/modules/mob/living/simple_animal/hostile/commanded/bear_companion.dm @@ -2,7 +2,7 @@ name = "bear" desc = "A large brown bear." icon = 'icons/mob/simple_animal/bear_brown.dmi' - mob_default_max_health = 75 + max_health = 75 density = TRUE natural_weapon = /obj/item/natural_weapon/claws can_escape = TRUE diff --git a/code/modules/mob/living/simple_animal/hostile/commanded/nanomachines.dm b/code/modules/mob/living/simple_animal/hostile/commanded/nanomachines.dm index d72555d90a5..85ae018cba3 100644 --- a/code/modules/mob/living/simple_animal/hostile/commanded/nanomachines.dm +++ b/code/modules/mob/living/simple_animal/hostile/commanded/nanomachines.dm @@ -6,7 +6,7 @@ desc = "a cloud of tiny, tiny robots." icon = 'icons/mob/simple_animal/nanomachines.dmi' natural_weapon = /obj/item/natural_weapon/nanomachine - mob_default_max_health = 10 + max_health = 10 can_escape = TRUE known_commands = list("stay", "stop", "attack", "follow", "heal", "emergency protocol") gene_damage = -1 diff --git a/code/modules/mob/living/simple_animal/hostile/creature.dm b/code/modules/mob/living/simple_animal/hostile/creature.dm index e8e35615a5e..85d56fe858f 100644 --- a/code/modules/mob/living/simple_animal/hostile/creature.dm +++ b/code/modules/mob/living/simple_animal/hostile/creature.dm @@ -3,7 +3,7 @@ desc = "A sanity-destroying otherthing." icon = 'icons/mob/simple_animal/creature.dmi' speak_emote = list("gibbers") - mob_default_max_health = 100 + max_health = 100 natural_weapon = /obj/item/natural_weapon/bite/strong faction = "creature" speed = 4 diff --git a/code/modules/mob/living/simple_animal/hostile/drake.dm b/code/modules/mob/living/simple_animal/hostile/drake.dm index c1c26a3184c..018f29db17b 100644 --- a/code/modules/mob/living/simple_animal/hostile/drake.dm +++ b/code/modules/mob/living/simple_animal/hostile/drake.dm @@ -11,7 +11,7 @@ pry_time = 4 SECONDS skull_type = /obj/item/whip/tail bleed_colour = COLOR_VIOLET - mob_default_max_health = 200 + max_health = 200 natural_weapon = /obj/item/natural_weapon/claws/drake natural_armor = list( ARMOR_MELEE = ARMOR_MELEE_RESISTANT, diff --git a/code/modules/mob/living/simple_animal/hostile/faithful_hound.dm b/code/modules/mob/living/simple_animal/hostile/faithful_hound.dm index 4f7b1049876..88cd21ff5f6 100644 --- a/code/modules/mob/living/simple_animal/hostile/faithful_hound.dm +++ b/code/modules/mob/living/simple_animal/hostile/faithful_hound.dm @@ -3,7 +3,7 @@ desc = "A spooky looking ghost dog. Does not look friendly." icon = 'icons/mob/simple_animal/corgi_ghost.dmi' blend_mode = BLEND_SUBTRACT - mob_default_max_health = 100 + max_health = 100 natural_weapon = /obj/item/natural_weapon/bite/strong faction = MOB_FACTION_NEUTRAL density = FALSE diff --git a/code/modules/mob/living/simple_animal/hostile/faithless.dm b/code/modules/mob/living/simple_animal/hostile/faithless.dm index 8c694c3bc8e..4d0dabbeb9b 100644 --- a/code/modules/mob/living/simple_animal/hostile/faithless.dm +++ b/code/modules/mob/living/simple_animal/hostile/faithless.dm @@ -7,7 +7,7 @@ response_help_1p = "You wave your hand through $TARGET$." response_help_3p = "$USER$ waves $USER_HIS$ hand through $TARGET$." speed = -1 - mob_default_max_health = 80 + max_health = 80 gene_damage = -1 harm_intent_damage = 10 diff --git a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm index eb423464b1a..595cb5b0f22 100644 --- a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm +++ b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm @@ -15,7 +15,7 @@ turns_per_move = 5 see_in_dark = 10 response_harm = "pokes" - mob_default_max_health = 125 + max_health = 125 natural_weapon = /obj/item/natural_weapon/bite heat_damage_per_tick = 20 cold_damage_per_tick = 20 @@ -64,7 +64,7 @@ /mob/living/simple_animal/hostile/giant_spider/guard desc = "A monstrously huge brown spider with shimmering eyes." meat_amount = 4 - mob_default_max_health = 200 + max_health = 200 natural_weapon = /obj/item/natural_weapon/bite/strong poison_per_bite = 5 speed = 2 @@ -80,7 +80,7 @@ /mob/living/simple_animal/hostile/giant_spider/nurse desc = "A monstrously huge beige spider with shimmering eyes." icon = 'icons/mob/simple_animal/spider_beige.dmi' - mob_default_max_health = 80 + max_health = 80 harm_intent_damage = 6 //soft poison_per_bite = 5 speed = 0 @@ -104,7 +104,7 @@ /mob/living/simple_animal/hostile/giant_spider/hunter desc = "A monstrously huge black spider with shimmering eyes." icon = 'icons/mob/simple_animal/spider_black.dmi' - mob_default_max_health = 150 + max_health = 150 natural_weapon = /obj/item/natural_weapon/bite/strong poison_per_bite = 10 speed = -1 @@ -124,7 +124,7 @@ /mob/living/simple_animal/hostile/giant_spider/spitter desc = "A monstrously huge iridescent spider with shimmering eyes." icon = 'icons/mob/simple_animal/spider_purple.dmi' - mob_default_max_health = 90 + max_health = 90 poison_per_bite = 15 ranged = TRUE move_to_delay = 2 @@ -145,7 +145,7 @@ . = ..() /mob/living/simple_animal/hostile/giant_spider/proc/spider_randomify() //random math nonsense to get their damage, health and venomness values - set_max_health(rand(initial(mob_default_max_health), (1.4 * initial(mob_default_max_health)))) + set_max_health(rand(initial(max_health), (1.4 * initial(max_health)))) eye_colour = pick(allowed_eye_colours) update_icon() diff --git a/code/modules/mob/living/simple_animal/hostile/hivebot.dm b/code/modules/mob/living/simple_animal/hostile/hivebot.dm index 2509a5c7c9f..72da1a164cd 100644 --- a/code/modules/mob/living/simple_animal/hostile/hivebot.dm +++ b/code/modules/mob/living/simple_animal/hostile/hivebot.dm @@ -2,7 +2,7 @@ name = "hivebot" desc = "A junky looking robot with four spiky legs." icon = 'icons/mob/simple_animal/hivebot.dmi' - mob_default_max_health = 55 + max_health = 55 natural_weapon = /obj/item/natural_weapon/drone_slicer projectilesound = 'sound/weapons/gunshot/gunshot_pistol.ogg' projectiletype = /obj/item/projectile/beam/smalllaser @@ -39,7 +39,7 @@ /mob/living/simple_animal/hostile/hivebot/strong desc = "A junky looking robot with four spiky legs - this one has thick armour plating." - mob_default_max_health = 120 + max_health = 120 ranged = 1 can_escape = 1 natural_armor = list( @@ -84,7 +84,7 @@ The megabot name = "hivemind" desc = "A huge quadruped robot equipped with a myriad of weaponry." icon = 'icons/mob/simple_animal/megabot.dmi' - mob_default_max_health = 440 + max_health = 440 natural_weapon = /obj/item/natural_weapon/circular_saw speed = 0 natural_armor = list( diff --git a/code/modules/mob/living/simple_animal/hostile/leech.dm b/code/modules/mob/living/simple_animal/hostile/leech.dm index 870cb7fee40..97e37ae6131 100644 --- a/code/modules/mob/living/simple_animal/hostile/leech.dm +++ b/code/modules/mob/living/simple_animal/hostile/leech.dm @@ -2,7 +2,7 @@ name = "megaleech" desc = "A green leech the size of a common snake." icon = 'icons/mob/simple_animal/megaleech.dmi' - mob_default_max_health = 15 + max_health = 15 harm_intent_damage = 5 natural_weapon = /obj/item/natural_weapon/bite/weak pass_flags = PASS_FLAG_TABLE diff --git a/code/modules/mob/living/simple_animal/hostile/mimic.dm b/code/modules/mob/living/simple_animal/hostile/mimic.dm index 7f4a5c37e0e..9fe807dfb81 100644 --- a/code/modules/mob/living/simple_animal/hostile/mimic.dm +++ b/code/modules/mob/living/simple_animal/hostile/mimic.dm @@ -24,7 +24,7 @@ var/global/list/protected_objects = list(/obj/machinery, icon_state = "crate" meat_type = /obj/item/chems/food/fish speed = 4 - mob_default_max_health = 100 + max_health = 100 harm_intent_damage = 5 natural_weapon = /obj/item/natural_weapon/bite min_gas = null diff --git a/code/modules/mob/living/simple_animal/hostile/pike.dm b/code/modules/mob/living/simple_animal/hostile/pike.dm index b544508f295..c0d628e7a03 100644 --- a/code/modules/mob/living/simple_animal/hostile/pike.dm +++ b/code/modules/mob/living/simple_animal/hostile/pike.dm @@ -9,7 +9,7 @@ mob_size = MOB_SIZE_LARGE offset_overhead_text_x = 16 pixel_x = -16 - mob_default_max_health = 150 + max_health = 150 harm_intent_damage = 5 natural_weapon = /obj/item/natural_weapon/bite/pike diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/clown.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/clown.dm index f155bec20a3..f764a551b46 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/clown.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/clown.dm @@ -9,7 +9,7 @@ speak_chance = 1 a_intent = I_HURT stop_automated_movement_when_pulled = 0 - mob_default_max_health = 75 + max_health = 75 speed = -1 harm_intent_damage = 8 can_escape = TRUE diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/drone.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/drone.dm index d3b4a42e3f7..5d7f687e1ab 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/drone.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/drone.dm @@ -12,7 +12,7 @@ emote_see = list("beeps menacingly","whirrs threateningly","scans its immediate vicinity") a_intent = I_HURT stop_automated_movement_when_pulled = 0 - mob_default_max_health = 300 + max_health = 300 speed = 8 move_to_delay = 6 projectiletype = /obj/item/projectile/beam/drone diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/exoplanet.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/exoplanet.dm index 0901acdfbdd..44bd8c8056f 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/exoplanet.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/exoplanet.dm @@ -77,7 +77,7 @@ faction = "samak" icon = 'icons/mob/simple_animal/samak.dmi' move_to_delay = 2 - mob_default_max_health = 125 + max_health = 125 speed = 2 natural_weapon = /obj/item/natural_weapon/claws cold_damage_per_tick = 0 @@ -99,7 +99,7 @@ faction = "diyaab" icon = 'icons/mob/simple_animal/diyaab.dmi' move_to_delay = 3 - mob_default_max_health = 25 + max_health = 25 speed = 1 natural_weapon = /obj/item/natural_weapon/claws/weak cold_damage_per_tick = 0 @@ -115,7 +115,7 @@ faction = "shantak" icon = 'icons/mob/simple_animal/shantak.dmi' move_to_delay = 3 - mob_default_max_health = 75 + max_health = 75 speed = 1 natural_weapon = /obj/item/natural_weapon/claws cold_damage_per_tick = 0 @@ -154,7 +154,7 @@ faction = "crab" icon = 'icons/mob/simple_animal/royalcrab.dmi' move_to_delay = 3 - mob_default_max_health = 150 + max_health = 150 speed = 1 natural_weapon = /obj/item/natural_weapon/pincers speak_chance = 1 @@ -168,7 +168,7 @@ desc = "A huge grubby creature." icon = 'icons/mob/simple_animal/char.dmi' mob_size = MOB_SIZE_LARGE - mob_default_max_health = 45 + max_health = 45 natural_weapon = /obj/item/natural_weapon/charbaby speed = 2 return_damage_min = 2 diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/giant_crab.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/giant_crab.dm index a13a98f3103..5ca05fb55d0 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/giant_crab.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/giant_crab.dm @@ -13,7 +13,7 @@ break_stuff_probability = 15 faction = "crabs" pry_time = 2 SECONDS - mob_default_max_health = 350 + max_health = 350 natural_weapon = /obj/item/natural_weapon/pincers/giant return_damage_min = 2 return_damage_max = 5 diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/giant_parrot/giant_parrot.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/giant_parrot/giant_parrot.dm index 1d99e3edc4c..c6f83ed0044 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/giant_parrot/giant_parrot.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/giant_parrot/giant_parrot.dm @@ -2,7 +2,7 @@ name = "space parrot" desc = "It could be some all-knowing being that, for reasons we could never hope to understand, is assuming the shape and general mannerisms of a parrot - or just a rather large bird." gender = FEMALE - mob_default_max_health = 750 + max_health = 750 mob_size = MOB_SIZE_LARGE speak = list("...") speak_emote = list("professes","speaks unto you","elaborates","proclaims") @@ -68,13 +68,13 @@ subspecies = list(/decl/parrot_subspecies/black) get_subspecies_name = FALSE natural_weapon = /obj/item/natural_weapon/large - mob_default_max_health = 300 + max_health = 300 /mob/living/simple_animal/hostile/retaliate/parrot/space/megafauna name = "giant parrot" desc = "A huge parrot-like bird." get_subspecies_name = FALSE - mob_default_max_health = 350 + max_health = 350 speak_emote = list("squawks") emote_hear = list("preens itself") natural_weapon = /obj/item/natural_weapon/large diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/goose.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/goose.dm index d0b1e8afcff..266386f94c7 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/goose.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/goose.dm @@ -7,7 +7,7 @@ emote_hear = list("honks","flaps its wings","clacks") emote_see = list("flaps its wings", "scratches the ground") natural_weapon = /obj/item/natural_weapon/goosefeet - mob_default_max_health = 45 + max_health = 45 pass_flags = PASS_FLAG_TABLE faction = "geese" pry_time = 8 SECONDS @@ -53,7 +53,7 @@ attacking_with.force = min((attacking_with.force + potency), max_damage) if(!loose && prob(25) && (attacking_with && attacking_with.force >= loose_threshold)) //second wind loose = TRUE - set_max_health(initial(mob_default_max_health) * 1.5) + set_max_health(initial(max_health) * 1.5) setBruteLoss(0) setFireLoss(0) enrage_potency = enrage_potency_loose @@ -64,7 +64,7 @@ name = "dire goose" desc = "A large bird. It radiates destructive energy." icon = 'icons/mob/simple_animal/goose_dire.dmi' - mob_default_max_health = 250 + max_health = 250 enrage_potency = 3 loose_threshold = 20 max_damage = 35 diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/jelly.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/jelly.dm index 4e536c69590..cb7761ba5c1 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/jelly.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/jelly.dm @@ -4,7 +4,7 @@ faction = "zeq" icon = 'icons/mob/simple_animal/jelly.dmi' move_to_delay = 2 - mob_default_max_health = 75 + max_health = 75 speed = 1 natural_weapon = /obj/item/natural_weapon/tentacles speak_chance = 1 @@ -29,7 +29,7 @@ /mob/living/simple_animal/hostile/retaliate/jelly/mega name = "zeq queen" desc = "A gigantic jellyfish-like creature. Its bell wobbles about almost as if it's ready to burst." - mob_default_max_health = 300 + max_health = 300 gets_random_color = FALSE can_escape = TRUE @@ -67,7 +67,7 @@ /mob/living/simple_animal/hostile/retaliate/jelly/mega/half name = "zeq duchess" desc = "A huge jellyfish-like creature." - mob_default_max_health = 150 + max_health = 150 can_escape = TRUE jelly_scale = 1.5 split_type = /mob/living/simple_animal/hostile/retaliate/jelly/mega/quarter @@ -75,7 +75,7 @@ /mob/living/simple_animal/hostile/retaliate/jelly/mega/quarter name = "zeqling" desc = "A jellyfish-like creature." - mob_default_max_health = 75 + max_health = 75 jelly_scale = 0.75 can_escape = FALSE split_type = /mob/living/simple_animal/hostile/retaliate/jelly/mega/fourth @@ -83,13 +83,13 @@ /mob/living/simple_animal/hostile/retaliate/jelly/mega/fourth name = "zeqetta" desc = "A tiny jellyfish-like creature." - mob_default_max_health = 40 + max_health = 40 jelly_scale = 0.375 split_type = /mob/living/simple_animal/hostile/retaliate/jelly/mega/eighth /mob/living/simple_animal/hostile/retaliate/jelly/mega/eighth name = "zeqttina" desc = "An absolutely tiny jellyfish-like creature." - mob_default_max_health = 20 + max_health = 20 jelly_scale = 0.1875 split_type = null \ No newline at end of file diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/king_of_goats.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/king_of_goats.dm index 017b5fe527f..b75b49e2e52 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/king_of_goats.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/king_of_goats.dm @@ -13,7 +13,7 @@ emote_see = list("stamps a mighty foot, shaking the surroundings") meat_amount = 12 response_harm = "assaults" - mob_default_max_health = 500 + max_health = 500 mob_size = MOB_SIZE_LARGE mob_bump_flag = HEAVY can_escape = TRUE @@ -58,7 +58,7 @@ desc = "The King of Kings, God amongst men, and your superior in every way." icon = 'icons/mob/simple_animal/goat_king_phase_2.dmi' meat_amount = 36 - mob_default_max_health = 750 + max_health = 750 natural_weapon = /obj/item/natural_weapon/goatking/unleashed elemental_weapons = list( BURN = /obj/item/natural_weapon/goatking/fire/unleashed, @@ -92,7 +92,7 @@ name = "honour guard" desc = "A very handsome and noble beast." icon = 'icons/mob/simple_animal/goat_guard.dmi' - mob_default_max_health = 125 + max_health = 125 natural_weapon = /obj/item/natural_weapon/goathorns /obj/item/natural_weapon/goathorns @@ -105,7 +105,7 @@ name = "master of the guard" desc = "A very handsome and noble beast - the most trusted of all the king's men." icon = 'icons/mob/simple_animal/goat_master.dmi' - mob_default_max_health = 200 + max_health = 200 natural_weapon = /obj/item/natural_weapon/goathorns move_to_delay = 3 @@ -172,8 +172,8 @@ /mob/living/simple_animal/hostile/retaliate/goat/king/phase2/proc/phase3_transition() phase3 = TRUE spellscast = 0 - mob_default_max_health = 750 - current_health = mob_default_max_health + max_health = 750 + current_health = max_health new /obj/item/grenade/flashbang/instant(src.loc) QDEL_NULL(boss_theme) boss_theme = play_looping_sound(src, sound_id, 'sound/music/Visager-Miniboss_Fight.ogg', volume = 10, range = 8, falloff = 4, prefer_mute = TRUE) diff --git a/code/modules/mob/living/simple_animal/hostile/slug.dm b/code/modules/mob/living/simple_animal/hostile/slug.dm index 6be1362d635..26de8a0bd3a 100644 --- a/code/modules/mob/living/simple_animal/hostile/slug.dm +++ b/code/modules/mob/living/simple_animal/hostile/slug.dm @@ -5,7 +5,7 @@ icon = 'icons/mob/simple_animal/slug.dmi' response_harm = "stomps on" destroy_surroundings = 0 - mob_default_max_health = 15 + max_health = 15 speed = 0 move_to_delay = 0 density = TRUE diff --git a/code/modules/mob/living/simple_animal/hostile/tree.dm b/code/modules/mob/living/simple_animal/hostile/tree.dm index b0f1997c402..7f381b9e046 100644 --- a/code/modules/mob/living/simple_animal/hostile/tree.dm +++ b/code/modules/mob/living/simple_animal/hostile/tree.dm @@ -6,7 +6,7 @@ turns_per_move = 5 meat_type = /obj/item/chems/food/fish speed = -1 - mob_default_max_health = 250 + max_health = 250 pixel_x = -16 harm_intent_damage = 5 natural_weapon = /obj/item/natural_weapon/bite diff --git a/code/modules/mob/living/simple_animal/hostile/vagrant.dm b/code/modules/mob/living/simple_animal/hostile/vagrant.dm index 1be42c481b2..3f7c5707265 100644 --- a/code/modules/mob/living/simple_animal/hostile/vagrant.dm +++ b/code/modules/mob/living/simple_animal/hostile/vagrant.dm @@ -3,7 +3,7 @@ name = "creature" desc = "You get the feeling you should run." icon = 'icons/mob/simple_animal/vagrant.dmi' - mob_default_max_health = 60 + max_health = 60 speed = 5 speak_chance = 0 turns_per_move = 4 diff --git a/code/modules/mob/living/simple_animal/hostile/viscerator.dm b/code/modules/mob/living/simple_animal/hostile/viscerator.dm index fa5f60048ab..c90ae856cd3 100644 --- a/code/modules/mob/living/simple_animal/hostile/viscerator.dm +++ b/code/modules/mob/living/simple_animal/hostile/viscerator.dm @@ -3,7 +3,7 @@ desc = "A small, twin-bladed machine capable of inflicting very deadly lacerations." icon = 'icons/mob/simple_animal/viscerator.dmi' pass_flags = PASS_FLAG_TABLE - mob_default_max_health = 15 + max_health = 15 natural_weapon = /obj/item/natural_weapon/rotating_blade faction = "syndicate" min_gas = null diff --git a/code/modules/mob/living/simple_animal/shade.dm b/code/modules/mob/living/simple_animal/shade.dm index 10742fec191..91d5a6119f2 100644 --- a/code/modules/mob/living/simple_animal/shade.dm +++ b/code/modules/mob/living/simple_animal/shade.dm @@ -3,7 +3,7 @@ real_name = "Shade" desc = "A bound spirit" icon = 'icons/mob/simple_animal/shade.dmi' - mob_default_max_health = 50 + max_health = 50 universal_speak = TRUE speak_emote = list("hisses") emote_hear = list("wails","screeches") diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 539cdd75852..6a5d969b3f8 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -1,6 +1,6 @@ /mob/living/simple_animal name = "animal" - mob_default_max_health = 20 + max_health = 20 universal_speak = FALSE mob_sort_value = 12 diff --git a/code/modules/mob_holder/_holder.dm b/code/modules/mob_holder/_holder.dm index 8def9a6d7d4..467add961ba 100644 --- a/code/modules/mob_holder/_holder.dm +++ b/code/modules/mob_holder/_holder.dm @@ -11,7 +11,7 @@ use_single_icon = TRUE item_state = null is_spawnable_type = FALSE - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE var/last_holder /obj/item/holder/Initialize() diff --git a/code/modules/modular_computers/os/_os.dm b/code/modules/modular_computers/os/_os.dm index b4115ac188f..81241c67ee9 100644 --- a/code/modules/modular_computers/os/_os.dm +++ b/code/modules/modular_computers/os/_os.dm @@ -164,10 +164,10 @@ if(hard_drive) if(prob(10)) hard_drive.visible_message("[src] emits some ominous clicks.") - hard_drive.take_damage(0.5 * hard_drive.health) + hard_drive.take_damage(0.5 * hard_drive.current_health) else if(prob(5)) hard_drive.visible_message("[src] emits some ominous clicks.") - hard_drive.take_damage(hard_drive.health) + hard_drive.take_damage(hard_drive.current_health) update_host_icon() diff --git a/code/modules/paperwork/paper_bundle.dm b/code/modules/paperwork/paper_bundle.dm index 837757132ab..d97fee5f4c8 100644 --- a/code/modules/paperwork/paper_bundle.dm +++ b/code/modules/paperwork/paper_bundle.dm @@ -19,8 +19,8 @@ drop_sound = 'sound/foley/paperpickup1.ogg' pickup_sound = 'sound/foley/paperpickup2.ogg' item_flags = ITEM_FLAG_CAN_TAPE - health = 10 - obj_max_health = 10 + current_health = 10 + max_health = 10 var/tmp/cur_page = 1 // current page var/tmp/max_pages = 100 //Maximum number of papers that can be in the bundle var/list/pages // Ordered list of pages as they are to be displayed. Can be different order than src.contents. diff --git a/code/modules/paperwork/printer.dm b/code/modules/paperwork/printer.dm index d746b82c90b..83c8af53727 100644 --- a/code/modules/paperwork/printer.dm +++ b/code/modules/paperwork/printer.dm @@ -17,7 +17,7 @@ /decl/material/solid/metal/copper = MATTER_AMOUNT_REINFORCEMENT, ) base_type = /obj/item/stock_parts/printer - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE part_flags = PART_FLAG_QDEL var/list/print_queue //Contains a single copy of each of the /obj/item/paper or /obj/item/photo that we'll print. var/obj/item/chems/toner_cartridge/toner //Contains our ink @@ -36,7 +36,7 @@ //Buildable: Can be removed from the machine, and damaged /obj/item/stock_parts/printer/buildable part_flags = PART_FLAG_HAND_REMOVE - obj_max_health = 64 + max_health = 64 //Buildable + Filled variant: has sheet and toner on spawn /obj/item/stock_parts/printer/buildable/filled/Initialize(ml, material_key) diff --git a/code/modules/paperwork/toner_cartridge.dm b/code/modules/paperwork/toner_cartridge.dm index 0f19fcf2dc9..2ac3561f7f5 100644 --- a/code/modules/paperwork/toner_cartridge.dm +++ b/code/modules/paperwork/toner_cartridge.dm @@ -32,7 +32,7 @@ /obj/item/chems/toner_cartridge/throw_impact(atom/hit_atom, datum/thrownthing/TT) . = ..() - health = clamp(health - (TT.speed * w_class), 0, get_max_health()) //You don't wanna throw this around too much + current_health = clamp(current_health - (TT.speed * w_class), 0, get_max_health()) //You don't wanna throw this around too much check_health() /obj/item/chems/toner_cartridge/proc/get_amount_toner() diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index d4cc27ab098..d2e69767a0c 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -516,7 +516,7 @@ By design, d1 is the smallest direction and d2 is the highest matter = null uses_charge = 1 charge_costs = list(1) - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE is_spawnable_type = FALSE /obj/item/stack/cable_coil/Initialize(mapload, c_length, var/param_color = null) diff --git a/code/modules/power/fuel_assembly/fuel_assembly.dm b/code/modules/power/fuel_assembly/fuel_assembly.dm index 8f7652328fd..e49145ee109 100644 --- a/code/modules/power/fuel_assembly/fuel_assembly.dm +++ b/code/modules/power/fuel_assembly/fuel_assembly.dm @@ -4,7 +4,7 @@ icon_state = "fuel_assembly" layer = 4 abstract_type = /obj/item/fuel_assembly - obj_max_health = 150 + max_health = 150 var/material_name var/percent_depleted = 1 diff --git a/code/modules/power/singularity/collector.dm b/code/modules/power/singularity/collector.dm index d22fe53d1d3..f31ff206ee0 100644 --- a/code/modules/power/singularity/collector.dm +++ b/code/modules/power/singularity/collector.dm @@ -10,7 +10,7 @@ var/global/list/rad_collectors = list() anchored = FALSE density = TRUE initial_access = list(access_engine_equip) - obj_max_health = 100 + max_health = 100 var/obj/item/tank/hydrogen/loaded_tank = null var/max_safe_temp = 1000 + T0C @@ -44,8 +44,8 @@ var/global/list/rad_collectors = list() if(T) var/datum/gas_mixture/our_turfs_air = T.return_air() if(our_turfs_air.temperature > max_safe_temp) - health -= ((our_turfs_air.temperature - max_safe_temp) / 10) - if(health <= 0) + current_health -= ((our_turfs_air.temperature - max_safe_temp) / 10) + if(current_health <= 0) collector_break() //so that we don't zero out the meter if the SM is processed first. diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm index 29fcdc09d56..28718c4d00a 100644 --- a/code/modules/power/solar.dm +++ b/code/modules/power/solar.dm @@ -12,7 +12,7 @@ var/global/list/solars_list = list() density = TRUE idle_power_usage = 0 active_power_usage = 0 - obj_max_health = 10 + max_health = 10 var/obscured = 0 var/sunfrac = 0 var/efficiency = 1 @@ -55,7 +55,7 @@ var/global/list/solars_list = list() S.anchored = TRUE S.forceMove(src) if(S.glass_reinforced) //if the panel is in reinforced glass - health *= 2 //this need to be placed here, because panels already on the map don't have an assembly linked to + current_health *= 2 //this need to be placed here, because panels already on the map don't have an assembly linked to update_icon() @@ -63,25 +63,25 @@ var/global/list/solars_list = list() /obj/machinery/power/solar/attackby(obj/item/W, mob/user) if(IS_CROWBAR(W)) - playsound(src.loc, 'sound/machines/click.ogg', 50, 1) + playsound(loc, 'sound/machines/click.ogg', 50, 1) user.visible_message("[user] begins to take the glass off the solar panel.") if(do_after(user, 50,src)) var/obj/item/solar_assembly/S = locate() in src if(S) S.dropInto(loc) S.give_glass() - playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) + playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1) user.visible_message("[user] takes the glass off the solar panel.") qdel(src) return else if (W) - src.add_fingerprint(user) - src.health -= W.force - src.healthcheck() + add_fingerprint(user) + current_health -= W.force + healthcheck() ..() /obj/machinery/power/solar/proc/healthcheck() - if (src.health <= 0) + if (current_health <= 0) if(!(stat & BROKEN)) set_broken(TRUE) @@ -92,7 +92,7 @@ var/global/list/solars_list = list() overlays += image('icons/obj/power.dmi', icon_state = "solar_panel-b", layer = ABOVE_HUMAN_LAYER) else overlays += image('icons/obj/power.dmi', icon_state = "solar_panel", layer = ABOVE_HUMAN_LAYER) - src.set_dir(angle2dir(adir)) + set_dir(angle2dir(adir)) return //calculates the fraction of the sunlight that the panel recieves @@ -132,9 +132,9 @@ var/global/list/solars_list = list() /obj/machinery/power/solar/set_broken(new_state) . = ..() if(. && new_state) - health = 0 - new /obj/item/shard(src.loc) - new /obj/item/shard(src.loc) + current_health = 0 + new /obj/item/shard(loc) + new /obj/item/shard(loc) var/obj/item/solar_assembly/S = locate() in src S.glass_type = null unset_control() @@ -144,11 +144,11 @@ var/global/list/solars_list = list() if(. && !QDELETED(src)) if(severity == 1) if(prob(15)) - new /obj/item/shard( src.loc ) + new /obj/item/shard( loc ) physically_destroyed() else if(severity == 2) if (prob(25)) - new /obj/item/shard( src.loc ) + new /obj/item/shard( loc ) physically_destroyed() else if (prob(50)) set_broken(TRUE) @@ -228,13 +228,13 @@ var/global/list/solars_list = list() default_pixel_z = 0 reset_offsets(0) user.visible_message("[user] wrenches the solar assembly into place.") - playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) + playsound(loc, 'sound/items/Ratchet.ogg', 75, 1) return 1 else if(IS_WRENCH(W)) anchored = FALSE user.visible_message("[user] unwrenches the solar assembly from it's place.") - playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) + playsound(loc, 'sound/items/Ratchet.ogg', 75, 1) return 1 if(istype(W, /obj/item/stack/material) && W.get_material_type() == /decl/material/solid/glass) @@ -242,7 +242,7 @@ var/global/list/solars_list = list() if(S.use(2)) glass_type = S.material.type glass_reinforced = S.reinf_material?.type - playsound(src.loc, 'sound/machines/click.ogg', 50, 1) + playsound(loc, 'sound/machines/click.ogg', 50, 1) user.visible_message("[user] places the glass on the solar assembly.") if(tracker) new /obj/machinery/power/tracker(get_turf(src), src) @@ -261,7 +261,7 @@ var/global/list/solars_list = list() return 1 else if(IS_CROWBAR(W)) - new /obj/item/tracker_electronics(src.loc) + new /obj/item/tracker_electronics(loc) tracker = 0 user.visible_message("[user] takes out the electronics from the solar assembly.") return 1 @@ -421,15 +421,15 @@ var/global/list/solars_list = list() if(href_list["rate control"]) if(href_list["cdir"]) - src.cdir = clamp((360+src.cdir+text2num(href_list["cdir"]))%360, 0, 359) - src.targetdir = src.cdir + cdir = clamp((360+cdir+text2num(href_list["cdir"]))%360, 0, 359) + targetdir = cdir if(track == 2) //manual update, so losing auto-tracking track = 0 spawn(1) set_panels(cdir) if(href_list["tdir"]) - src.trackrate = clamp(src.trackrate+text2num(href_list["tdir"]), -7200, 7200) - if(src.trackrate) nexttime = world.time + 36000/abs(trackrate) + trackrate = clamp(trackrate+text2num(href_list["tdir"]), -7200, 7200) + if(trackrate) nexttime = world.time + 36000/abs(trackrate) if(href_list["track"]) track = text2num(href_list["track"]) @@ -438,15 +438,15 @@ var/global/list/solars_list = list() connected_tracker.set_angle(global.sun.angle) set_panels(cdir) else if (track == 1) //begin manual tracking - src.targetdir = src.cdir - if(src.trackrate) nexttime = world.time + 36000/abs(trackrate) + targetdir = cdir + if(trackrate) nexttime = world.time + 36000/abs(trackrate) set_panels(targetdir) if(href_list["search_connected"]) - src.search_for_connected() + search_for_connected() if(connected_tracker && track == 2) connected_tracker.set_angle(global.sun.angle) - src.set_panels(cdir) + set_panels(cdir) interact(usr) return 1 diff --git a/code/modules/reagents/reagent_containers/borghydro.dm b/code/modules/reagents/reagent_containers/borghydro.dm index 97124748f77..b74335a2e3d 100644 --- a/code/modules/reagents/reagent_containers/borghydro.dm +++ b/code/modules/reagents/reagent_containers/borghydro.dm @@ -5,7 +5,7 @@ amount_per_transfer_from_this = 5 volume = 30 possible_transfer_amounts = null - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE var/mode = 1 var/charge_cost = 50 diff --git a/code/modules/reagents/reagent_containers/food/meat/slabs.dm b/code/modules/reagents/reagent_containers/food/meat/slabs.dm index c73762f6847..4a7aa12fa25 100644 --- a/code/modules/reagents/reagent_containers/food/meat/slabs.dm +++ b/code/modules/reagents/reagent_containers/food/meat/slabs.dm @@ -5,7 +5,7 @@ icon_state = "meat" slice_path = /obj/item/chems/food/rawcutlet slices_num = 3 - obj_max_health = 180 + max_health = 180 filling_color = "#ff1c1c" center_of_mass = @'{"x":16,"y":14}' material = /decl/material/solid/organic/meat diff --git a/code/modules/reagents/reagent_dispenser.dm b/code/modules/reagents/reagent_dispenser.dm index 2cb69b80b34..8aeca3d5b94 100644 --- a/code/modules/reagents/reagent_dispenser.dm +++ b/code/modules/reagents/reagent_dispenser.dm @@ -8,7 +8,7 @@ anchored = FALSE material = /decl/material/solid/organic/plastic matter = list(/decl/material/solid/metal/steel = MATTER_AMOUNT_SECONDARY) - obj_max_health = 100 + max_health = 100 tool_interaction_flags = TOOL_INTERACTION_DECONSTRUCT var/unwrenched = FALSE var/tmp/volume = 1000 diff --git a/code/modules/recycling/disposalpipe.dm b/code/modules/recycling/disposalpipe.dm index 95324a0f187..c187f585b02 100644 --- a/code/modules/recycling/disposalpipe.dm +++ b/code/modules/recycling/disposalpipe.dm @@ -6,7 +6,7 @@ desc = "An underfloor disposal pipe." anchored = TRUE density = FALSE - obj_max_health = 10 + max_health = 10 level = LEVEL_BELOW_PLATING dir = 0 // dir will contain dominant direction for junction pipes alpha = 192 // Plane and alpha modified for mapping, reset to normal on spawn. diff --git a/code/modules/research/design_database_analyzer.dm b/code/modules/research/design_database_analyzer.dm index 2d4187e95ba..b0c3c4150bb 100644 --- a/code/modules/research/design_database_analyzer.dm +++ b/code/modules/research/design_database_analyzer.dm @@ -148,4 +148,4 @@ icon = 'icons/obj/items/stock_parts/stock_parts.dmi' icon_state = "smes_coil" origin_tech = @'{"materials":19,"engineering":19,"exoticmatter":19,"powerstorage":19,"wormholes":19,"biotech":19,"combat":19,"magnets":19,"programming":19,"esoteric":19}' - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE diff --git a/code/modules/shieldgen/emergency_shield.dm b/code/modules/shieldgen/emergency_shield.dm index eb72c9e0faf..a542384f089 100644 --- a/code/modules/shieldgen/emergency_shield.dm +++ b/code/modules/shieldgen/emergency_shield.dm @@ -6,21 +6,21 @@ density = TRUE opacity = FALSE anchored = TRUE - obj_max_health = 200 + max_health = 200 var/shield_generate_power = 7500 //how much power we use when regenerating var/shield_idle_power = 1500 //how much power we use when just being sustained. /obj/machinery/shield/malfai name = "emergency forcefield" desc = "A weak forcefield which seems to be projected by the emergency atmosphere containment field." - obj_max_health = 100 // Half health, it's not suposed to resist much. + max_health = 100 // Half health, it's not suposed to resist much. /obj/machinery/shield/malfai/Process() - health -= 0.5 // Slowly lose integrity over time + current_health -= 0.5 // Slowly lose integrity over time check_failure() /obj/machinery/shield/proc/check_failure() - if (src.health <= 0) + if (current_health <= 0) visible_message("\The [src] dissipates!") qdel(src) return @@ -46,7 +46,7 @@ //Calculate damage var/aforce = W.force if(W.damtype == BRUTE || W.damtype == BURN) - src.health -= aforce + current_health -= aforce //Play a fitting sound playsound(src.loc, 'sound/effects/EMPulse.ogg', 75, 1) @@ -59,7 +59,7 @@ ..() /obj/machinery/shield/bullet_act(var/obj/item/projectile/Proj) - health -= Proj.get_structure_damage() + current_health -= Proj.get_structure_damage() ..() check_failure() set_opacity(1) @@ -90,7 +90,7 @@ else var/obj/O = AM tforce = O.throwforce * (TT.speed/THROWFORCE_SPEED_DIVISOR) - src.health -= tforce + current_health -= tforce //This seemed to be the best sound for hitting a force field. playsound(src.loc, 'sound/effects/EMPulse.ogg', 100, 1) check_failure() @@ -109,7 +109,7 @@ opacity = FALSE anchored = FALSE initial_access = list(access_engine) - obj_max_health = 100 + max_health = 100 var/active = 0 var/malfunction = 0 //Malfunction causes parts of the shield to slowly dissapate var/list/deployed_shields = list() @@ -196,9 +196,9 @@ check_delay-- /obj/machinery/shieldgen/proc/checkhp() - if(health <= 30) + if(current_health <= 30) src.malfunction = 1 - if(health <= 0) + if(current_health <= 0) spawn(0) explosion(get_turf(src.loc), 0, 0, 1, 0, 0, 0) qdel(src) @@ -209,24 +209,24 @@ . = ..() if(.) if(severity == 1) - health -= 75 + current_health -= 75 else if(severity == 2) - health -= 30 + current_health -= 30 if(prob(15)) malfunction = 1 else if(severity == 3) - health -= 10 + current_health -= 10 checkhp() /obj/machinery/shieldgen/emp_act(severity) switch(severity) if(1) - src.health /= 2 //cut health in half + current_health /= 2 //cut health in half malfunction = 1 locked = pick(0,1) if(2) if(prob(50)) - src.health *= 0.3 //chop off a third of the health + current_health *= 0.3 //chop off a third of the health malfunction = 1 checkhp() @@ -276,7 +276,7 @@ to_chat(user, "You begin to replace the wires.") if(do_after(user, 30,src)) if (coil.use(1)) - health = get_max_health() + current_health = get_max_health() malfunction = 0 to_chat(user, "You repair the [src]!") update_icon() diff --git a/code/modules/spells/aoe_turf/conjure/druidic_spells.dm b/code/modules/spells/aoe_turf/conjure/druidic_spells.dm index d4b5db4bb88..823a1613525 100644 --- a/code/modules/spells/aoe_turf/conjure/druidic_spells.dm +++ b/code/modules/spells/aoe_turf/conjure/druidic_spells.dm @@ -39,7 +39,7 @@ if(!..()) return 0 - newVars = list("mob_default_max_health" = 20 + spell_levels[Sp_POWER]*5, "health" = 20 + spell_levels[Sp_POWER]*5, "melee_damage_lower" = 10 + spell_levels[Sp_POWER], "melee_damage_upper" = 10 + spell_levels[Sp_POWER]*2) + newVars = list("max_health" = 20 + spell_levels[Sp_POWER]*5, "health" = 20 + spell_levels[Sp_POWER]*5, "melee_damage_lower" = 10 + spell_levels[Sp_POWER], "melee_damage_upper" = 10 + spell_levels[Sp_POWER]*2) return "Your bats are now stronger." @@ -59,7 +59,7 @@ summon_amt = 1 summon_type = list(/mob/living/simple_animal/hostile/commanded/bear) - newVars = list("mob_default_max_health" = 15, + newVars = list("max_health" = 15, "health" = 15, "melee_damage_lower" = 10, "melee_damage_upper" = 10, @@ -76,14 +76,14 @@ return 0 switch(spell_levels[Sp_POWER]) if(1) - newVars = list("mob_default_max_health" = 30, + newVars = list("max_health" = 30, "health" = 30, "melee_damage_lower" = 15, "melee_damage_upper" = 15 ) return "Your bear has been upgraded from a cub to a whelp." if(2) - newVars = list("mob_default_max_health" = 45, + newVars = list("max_health" = 45, "health" = 45, "melee_damage_lower" = 20, "melee_damage_upper" = 20, @@ -91,7 +91,7 @@ ) return "Your bear has been upgraded from a whelp to an adult." if(3) - newVars = list("mob_default_max_health" = 60, + newVars = list("max_health" = 60, "health" = 60, "melee_damage_lower" = 25, "melee_damage_upper" = 25, @@ -99,7 +99,7 @@ ) return "Your bear has been upgraded from an adult to an alpha." if(4) - newVars = list("mob_default_max_health" = 75, + newVars = list("max_health" = 75, "health" = 75, "melee_damage_lower" = 35, "melee_damage_upper" = 35, diff --git a/code/modules/spells/artifacts.dm b/code/modules/spells/artifacts.dm index f95d9872323..a2d58655579 100644 --- a/code/modules/spells/artifacts.dm +++ b/code/modules/spells/artifacts.dm @@ -11,7 +11,7 @@ damtype = BURN force = 10 hitsound = 'sound/magic/forcewall.ogg' - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE /obj/item/scrying/attack_self(mob/user) var/decl/special_role/wizard/wizards = GET_DECL(/decl/special_role/wizard) diff --git a/code/modules/spells/hand/hand_item.dm b/code/modules/spells/hand/hand_item.dm index 7a6d75e3776..855cfdcfa92 100644 --- a/code/modules/spells/hand/hand_item.dm +++ b/code/modules/spells/hand/hand_item.dm @@ -10,7 +10,7 @@ Basically: I can use it to target things where I click. I can then pass these ta obj_flags = 0 simulated = 0 icon_state = "spell" - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE is_spawnable_type = FALSE var/next_spell_time = 0 var/spell/hand/hand_spell diff --git a/code/modules/spells/targeted/equip/burning_touch.dm b/code/modules/spells/targeted/equip/burning_touch.dm index f97fb3c24c7..b7e9c9dbdb9 100644 --- a/code/modules/spells/targeted/equip/burning_touch.dm +++ b/code/modules/spells/targeted/equip/burning_touch.dm @@ -21,7 +21,7 @@ force = 10 damtype = BURN simulated = 0 - obj_max_health = ITEM_HEALTH_NO_DAMAGE + max_health = ITEM_HEALTH_NO_DAMAGE var/burn_power = 0 var/burn_timer diff --git a/code/modules/spells/targeted/shapeshift.dm b/code/modules/spells/targeted/shapeshift.dm index b45e03c42eb..20c129ee781 100644 --- a/code/modules/spells/targeted/shapeshift.dm +++ b/code/modules/spells/targeted/shapeshift.dm @@ -116,7 +116,7 @@ level_max = list(Sp_TOTAL = 2, Sp_SPEED = 2, Sp_POWER = 2) - newVars = list("health" = 50, "default_mob_max_health" = 50) + newVars = list("health" = 50, "max_health" = 50) hud_state = "wiz_poly" @@ -183,7 +183,7 @@ "melee_damage_upper" = 25, "resistance" = 6, "health" = 125, - "mob_default_max_health" = 125) + "max_health" = 125) duration = 0 return "You revel in the corruption. There is no turning back." diff --git a/code/modules/vehicles/bike.dm b/code/modules/vehicles/bike.dm index 1fcff29319c..1a5b1dc82c8 100644 --- a/code/modules/vehicles/bike.dm +++ b/code/modules/vehicles/bike.dm @@ -7,8 +7,8 @@ load_item_visible = 1 buckle_pixel_shift = list("x" = 0, "y" = 0, "z" = 5) - health = 100 - obj_max_health = 100 + current_health = 100 + max_health = 100 locked = 0 fire_dam_coeff = 0.6 diff --git a/code/modules/vehicles/train.dm b/code/modules/vehicles/train.dm index 22ed767c8e2..23975a13955 100644 --- a/code/modules/vehicles/train.dm +++ b/code/modules/vehicles/train.dm @@ -4,8 +4,8 @@ move_delay = 1 - health = 100 - obj_max_health = 100 + current_health = 100 + max_health = 100 fire_dam_coeff = 0.7 brute_dam_coeff = 0.5 diff --git a/code/modules/vehicles/vehicle.dm b/code/modules/vehicles/vehicle.dm index a916f100b40..42b0d45cea8 100644 --- a/code/modules/vehicles/vehicle.dm +++ b/code/modules/vehicles/vehicle.dm @@ -85,9 +85,9 @@ var/obj/item/weldingtool/T = W if(T.welding) var/current_max_health = get_max_health() - if(health < current_max_health) + if(current_health < current_max_health) if(open) - health = min(current_max_health, health+10) + current_health = min(current_max_health, current_health+10) user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) user.visible_message("\The [user] repairs \the [src]!","You repair \the [src]!") else @@ -100,14 +100,14 @@ user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) switch(W.damtype) if(BURN) - health -= W.force * fire_dam_coeff + current_health -= W.force * fire_dam_coeff if(BRUTE) - health -= W.force * brute_dam_coeff + current_health -= W.force * brute_dam_coeff ..() healthcheck() /obj/vehicle/bullet_act(var/obj/item/projectile/Proj) - health -= Proj.get_structure_damage() + current_health -= Proj.get_structure_damage() ..() healthcheck() @@ -117,11 +117,11 @@ explode() else if(severity == 2) - health -= rand(5,10)*fire_dam_coeff - health -= rand(10,20)*brute_dam_coeff + current_health -= rand(5,10)*fire_dam_coeff + current_health -= rand(10,20)*brute_dam_coeff else if(prob(50)) - health -= rand(1,5)*fire_dam_coeff - health -= rand(1,5)*brute_dam_coeff + current_health -= rand(1,5)*fire_dam_coeff + current_health -= rand(1,5)*brute_dam_coeff healthcheck() /obj/vehicle/emp_act(severity) @@ -202,7 +202,7 @@ qdel(src) /obj/vehicle/proc/healthcheck() - if(health <= 0) + if(current_health <= 0) explode() /obj/vehicle/proc/powercheck() diff --git a/code/unit_tests/obj_damage_tests.dm b/code/unit_tests/obj_damage_tests.dm index eca0ef2e32c..691e34abaca 100644 --- a/code/unit_tests/obj_damage_tests.dm +++ b/code/unit_tests/obj_damage_tests.dm @@ -2,9 +2,9 @@ // items_shall_stay_invincible ///////////////////////////////////////////////////////// /datum/item_unit_test/constant/items_shall_stay_invincible/run_test(var/obj/item/I) - if(initial(I.health) != ITEM_HEALTH_NO_DAMAGE && initial(I.obj_max_health) != ITEM_HEALTH_NO_DAMAGE) + if(initial(I.current_health) != ITEM_HEALTH_NO_DAMAGE && initial(I.max_health) != ITEM_HEALTH_NO_DAMAGE) return TRUE //Ignore things that aren't invincible - if(I.health != ITEM_HEALTH_NO_DAMAGE || I.get_max_health() != ITEM_HEALTH_NO_DAMAGE) + if(I.current_health != ITEM_HEALTH_NO_DAMAGE || I.get_max_health() != ITEM_HEALTH_NO_DAMAGE) IT.report_failure(src, I.type, "Is defined as not taking health damage, but it can take damage after init.") return FALSE return TRUE @@ -14,10 +14,10 @@ ///////////////////////////////////////////////////////// /datum/item_unit_test/constant/items_shall_define_their_max_health/run_test(var/obj/item/I) var/current_max_health = I.get_max_health() - if(I.health == ITEM_HEALTH_NO_DAMAGE || current_max_health == ITEM_HEALTH_NO_DAMAGE) + if(I.current_health == ITEM_HEALTH_NO_DAMAGE || current_max_health == ITEM_HEALTH_NO_DAMAGE) return TRUE //We don't care about invincible things - if(I.health > 0 && current_max_health != I.health) - IT.report_failure(src, I.type, "Defines health = [I.health], but its max health is [current_max_health || "null"].") + if(I.current_health > 0 && current_max_health != I.current_health) + IT.report_failure(src, I.type, "Defines health = [I.current_health], but its max health is [current_max_health || "null"].") return FALSE return TRUE @@ -26,11 +26,11 @@ ///////////////////////////////////////////////////////// /**Items should only change their defined health variable during init if it was set to null. Otherwise issues will arise. */ /datum/item_unit_test/constant/items_shall_set_health_var_only_if_null/run_test(var/obj/item/I) - if(initial(I.health) == ITEM_HEALTH_NO_DAMAGE || initial(I.obj_max_health) == ITEM_HEALTH_NO_DAMAGE) + if(initial(I.current_health) == ITEM_HEALTH_NO_DAMAGE || initial(I.max_health) == ITEM_HEALTH_NO_DAMAGE) return TRUE - if(isnull(initial(I.health))) - if(I.health > 0) + if(isnull(initial(I.current_health))) + if(I.current_health > 0) return TRUE else if(istype(I.material)) IT.report_failure(src, I.type, "Had its health defined as null, and its material '[I.material.type]' left it as null!") @@ -39,8 +39,8 @@ IT.report_failure(src, I.type, "Had its health defined as null, didn't assign a valid health value during init, and isn't marked as invincible.") return FALSE - else if(I.health != initial(I.health)) - IT.report_failure(src, I.type, "Defined a health value ([I.health? I.health : "null"]), but it was replaced during init! Highly likely to be undesired!") + else if(I.current_health != initial(I.current_health)) + IT.report_failure(src, I.type, "Defined a health value ([I.current_health? I.current_health : "null"]), but it was replaced during init! Highly likely to be undesired!") return FALSE //In this case, the health was set to something, and didn't change during init @@ -52,10 +52,10 @@ /** Makes sure that if we have a material setting up our health, it actually sets it to something sane. */ /datum/item_unit_test/constant/items_shall_get_a_valid_health_from_materials/run_test(var/obj/item/I) //If any health is specified or if the object is invincible skip. Return true on no material too since its not our job to validate the material logic - if(!isnull(initial(I.health)) || !isnull(initial(I.obj_max_health)) || !I.material) + if(!isnull(initial(I.current_health)) || !isnull(initial(I.max_health)) || !I.material) return TRUE - if((I.get_max_health() < 1.0) || (I.health < 1.0)) + if((I.get_max_health() < 1.0) || (I.current_health < 1.0)) IT.report_failure(src, I.type, "Had its health/max health set to a value < 1 by its material '[I.material.type]', where '[I.material.name]''s 'integrity' == '[I.material.integrity]', and '[I]''s 'material_health_multiplier' == '[I.material_health_multiplier]'.") return FALSE return TRUE @@ -65,22 +65,22 @@ ///////////////////////////////////////////////////////// /datum/item_unit_test/volatile/items_shall_take_damage/run_test(var/obj/item/I) var/failure_text = "" - var/old_health = I.health + var/old_health = I.current_health var/damage_taken_returned = I.take_damage(1, BRUTE, 0, null, 100) //Ignore armor //Check if invincibility actually works if(!isnull(old_health)) - if(old_health && old_health == I.health && old_health != ITEM_HEALTH_NO_DAMAGE && I.get_max_health() != ITEM_HEALTH_NO_DAMAGE) - failure_text += "Item took no damage and isn't defined as invincible. (old: [old_health? old_health : "null"], new: [I.health? I.health : "null"], returned: [damage_taken_returned? damage_taken_returned : "null"]) " - if(old_health != I.health && (old_health == ITEM_HEALTH_NO_DAMAGE || I.get_max_health() == ITEM_HEALTH_NO_DAMAGE)) - failure_text += "Item took some damage while defined as invincible. (old: [old_health? old_health : "null"], new: [I.health? I.health : "null"], returned: [damage_taken_returned? damage_taken_returned : "null"]) " + if(old_health && old_health == I.current_health && old_health != ITEM_HEALTH_NO_DAMAGE && I.get_max_health() != ITEM_HEALTH_NO_DAMAGE) + failure_text += "Item took no damage and isn't defined as invincible. (old: [old_health? old_health : "null"], new: [I.current_health? I.current_health : "null"], returned: [damage_taken_returned? damage_taken_returned : "null"]) " + if(old_health != I.current_health && (old_health == ITEM_HEALTH_NO_DAMAGE || I.get_max_health() == ITEM_HEALTH_NO_DAMAGE)) + failure_text += "Item took some damage while defined as invincible. (old: [old_health? old_health : "null"], new: [I.current_health? I.current_health : "null"], returned: [damage_taken_returned? damage_taken_returned : "null"]) " else failure_text += "Item health is null after init. " //Check the take damage returned damage value - var/damage_taken_actual = (old_health == ITEM_HEALTH_NO_DAMAGE || I.get_max_health() == ITEM_HEALTH_NO_DAMAGE || isnull(old_health))? 0 : old_health - I.health + var/damage_taken_actual = (old_health == ITEM_HEALTH_NO_DAMAGE || I.get_max_health() == ITEM_HEALTH_NO_DAMAGE || isnull(old_health))? 0 : old_health - I.current_health if(damage_taken_returned != damage_taken_actual) - failure_text += "take_damage() returned the wrong amount of damage (health before: [old_health? old_health : "null"], after: [I.health? I.health : "null"], returned damage:[damage_taken_returned? damage_taken_returned : "null"])." + failure_text += "take_damage() returned the wrong amount of damage (health before: [old_health? old_health : "null"], after: [I.current_health? I.current_health : "null"], returned damage:[damage_taken_returned? damage_taken_returned : "null"])." if(length(failure_text)) IT.report_failure(src, I.type, failure_text) diff --git a/maps/away/bearcat/bearcat-2.dmm b/maps/away/bearcat/bearcat-2.dmm index e26e99ab157..c73aa64af9e 100644 --- a/maps/away/bearcat/bearcat-2.dmm +++ b/maps/away/bearcat/bearcat-2.dmm @@ -4672,7 +4672,7 @@ }, /obj/effect/floor_decal/corner/red/diagonal, /obj/structure/window/reinforced{ - health = 1e+007 + current_health = 1e+007 }, /turf/simulated/floor/reinforced/airless, /area/ship/scrap/maintenance/atmos) diff --git a/maps/away/errant_pisces/errant_pisces.dm b/maps/away/errant_pisces/errant_pisces.dm index 94ed7a94f04..1b31cf82f43 100644 --- a/maps/away/errant_pisces/errant_pisces.dm +++ b/maps/away/errant_pisces/errant_pisces.dm @@ -24,7 +24,7 @@ turns_per_move = 5 meat_type = /obj/item/chems/food/sharkmeat speed = 2 - mob_default_max_health = 100 + max_health = 100 natural_weapon = /obj/item/natural_weapon/bite/strong break_stuff_probability = 35 faction = "shark" @@ -79,7 +79,7 @@ icon_state = "net_f" anchored = TRUE layer = CATWALK_LAYER//probably? Should cover cables, pipes and the rest of objects that are secured on the floor - obj_max_health = 100 + max_health = 100 /obj/structure/net/Initialize(var/mapload) . = ..() @@ -112,7 +112,7 @@ to_chat(user,"You can't cut throught \the [src] with \the [W], it's too dull.") return visible_message("[user] starts to cut through \the [src] with \the [W]!") - while(health > 0 && !QDELETED(src) && !QDELETED(user)) + while(current_health > 0 && !QDELETED(src) && !QDELETED(user)) if (!do_after(user, 20, src)) visible_message("[user] stops cutting through \the [src] with \the [W]!") return diff --git a/maps/away/errant_pisces/errant_pisces.dmm b/maps/away/errant_pisces/errant_pisces.dmm index 4536267221c..232a2668b69 100644 --- a/maps/away/errant_pisces/errant_pisces.dmm +++ b/maps/away/errant_pisces/errant_pisces.dmm @@ -4302,7 +4302,7 @@ /obj/structure/closet/secure_closet/hydroponics, /obj/structure/window/reinforced{ dir = 1; - health = 1e+006 + current_health = 1e+006 }, /turf/simulated/floor/tiled, /area/errant_pisces/science_wing) @@ -4314,7 +4314,7 @@ /obj/machinery/vending/hydronutrients, /obj/structure/window/reinforced{ dir = 1; - health = 1e+006 + current_health = 1e+006 }, /obj/structure/window/reinforced{ dir = 4 diff --git a/maps/away/liberia/liberia.dmm b/maps/away/liberia/liberia.dmm index 225ce9a801b..0efca847afe 100644 --- a/maps/away/liberia/liberia.dmm +++ b/maps/away/liberia/liberia.dmm @@ -744,7 +744,7 @@ "bv" = ( /obj/structure/window/reinforced{ dir = 8; - health = null + current_health = null }, /obj/structure/closet/crate/medical, /obj/random/medical, @@ -812,7 +812,7 @@ /obj/effect/floor_decal/industrial/outline/yellow, /obj/structure/window/reinforced{ dir = 8; - health = null + current_health = null }, /obj/machinery/portable_atmospherics/canister/air, /obj/machinery/door/window/brigdoor/southright{ @@ -1731,7 +1731,7 @@ }, /obj/structure/window/reinforced{ dir = 8; - health = null + current_health = null }, /obj/structure/window/reinforced{ dir = 1 @@ -2380,7 +2380,7 @@ "ef" = ( /obj/structure/window/reinforced{ dir = 8; - health = null + current_health = null }, /obj/structure/closet/crate/secure{ name = "resources crate"; @@ -3342,7 +3342,7 @@ /obj/random/drinkbottle, /obj/structure/window/reinforced{ dir = 8; - health = null + current_health = null }, /turf/simulated/floor/wood/ebony, /area/liberia/bar) @@ -3633,7 +3633,7 @@ /obj/structure/table/woodentable/walnut, /obj/structure/window/reinforced{ dir = 8; - health = null + current_health = null }, /obj/machinery/atmospherics/pipe/simple/hidden/supply{ dir = 4 @@ -4695,7 +4695,7 @@ /obj/structure/table/steel_reinforced, /obj/structure/window/reinforced{ dir = 8; - health = null + current_health = null }, /obj/effect/floor_decal/corner/blue/mono, /turf/simulated/floor/tiled/dark/monotile, @@ -4977,7 +4977,7 @@ /obj/structure/table/steel_reinforced, /obj/structure/window/reinforced{ dir = 8; - health = null + current_health = null }, /obj/structure/window/reinforced, /obj/effect/floor_decal/corner/blue/mono, @@ -6429,7 +6429,7 @@ }, /obj/structure/window/reinforced{ dir = 8; - health = null + current_health = null }, /obj/machinery/door/window/brigdoor/northleft{ req_access = newlist() diff --git a/maps/away/lost_supply_base/lost_supply_base.dmm b/maps/away/lost_supply_base/lost_supply_base.dmm index cf59be25338..41675db3394 100644 --- a/maps/away/lost_supply_base/lost_supply_base.dmm +++ b/maps/away/lost_supply_base/lost_supply_base.dmm @@ -1329,7 +1329,7 @@ "dX" = ( /obj/structure/window/reinforced{ dir = 1; - health = 1e+006 + current_health = 1e+006 }, /turf/simulated/floor/airless, /area/lost_supply_base) @@ -1337,7 +1337,7 @@ /obj/item/stack/tile/floor_dark, /obj/structure/window/reinforced{ dir = 1; - health = 1e+006 + current_health = 1e+006 }, /turf/simulated/floor/airless, /area/lost_supply_base) diff --git a/maps/away/slavers/slavers_base.dm b/maps/away/slavers/slavers_base.dm index e83c80e7cd7..9ee86c6509b 100644 --- a/maps/away/slavers/slavers_base.dm +++ b/maps/away/slavers/slavers_base.dm @@ -134,7 +134,7 @@ turns_per_move = 5 speed = 4 stop_automated_movement_when_pulled = 0 - mob_default_max_health = 100 + max_health = 100 natural_weapon = /obj/item/natural_weapon/punch can_escape = TRUE unsuitable_atmos_damage = 15 diff --git a/maps/away/unishi/unishi-3.dmm b/maps/away/unishi/unishi-3.dmm index b860d0c7252..b8d9d1c96d6 100644 --- a/maps/away/unishi/unishi-3.dmm +++ b/maps/away/unishi/unishi-3.dmm @@ -619,7 +619,7 @@ dir = 4 }, /obj/structure/window/reinforced{ - health = 1e+007 + current_health = 1e+007 }, /obj/random/medical, /obj/random/medical, diff --git a/maps/exodus/exodus-2.dmm b/maps/exodus/exodus-2.dmm index 217dc63e6a4..23daa1bb80c 100644 --- a/maps/exodus/exodus-2.dmm +++ b/maps/exodus/exodus-2.dmm @@ -13576,7 +13576,7 @@ }, /obj/structure/window/reinforced{ dir = 1; - health = 1e+006 + current_health = 1e+006 }, /turf/simulated/floor/tiled/dark/monotile, /area/exodus/gateway) @@ -13590,7 +13590,7 @@ }, /obj/structure/window/reinforced{ dir = 1; - health = 1e+006 + current_health = 1e+006 }, /turf/simulated/floor/tiled/dark/monotile, /area/exodus/gateway) @@ -21365,7 +21365,7 @@ /obj/effect/floor_decal/industrial/hatch/yellow, /obj/structure/window/reinforced{ dir = 1; - health = 1e+006 + current_health = 1e+006 }, /turf/simulated/floor/tiled/steel_grid, /area/exodus/research) @@ -31440,7 +31440,7 @@ }, /obj/structure/window/reinforced{ dir = 1; - health = 1e+006 + current_health = 1e+006 }, /turf/simulated/floor/tiled/steel_grid, /area/exodus/engineering/workshop) @@ -31593,7 +31593,7 @@ /obj/structure/table/steel_reinforced, /obj/structure/window/reinforced{ dir = 1; - health = 1e+006 + current_health = 1e+006 }, /turf/simulated/floor/tiled/steel_grid, /area/exodus/engineering/workshop) @@ -33855,7 +33855,7 @@ }, /obj/structure/window/reinforced{ dir = 1; - health = 1e+006 + current_health = 1e+006 }, /turf/simulated/floor/tiled/white, /area/exodus/research/xenobiology) @@ -34194,7 +34194,7 @@ }, /obj/structure/window/reinforced{ dir = 1; - health = 1e+006 + current_health = 1e+006 }, /turf/simulated/floor/tiled/white, /area/exodus/research/xenobiology) @@ -34303,7 +34303,7 @@ }, /obj/structure/window/reinforced{ dir = 1; - health = 1e+006 + current_health = 1e+006 }, /turf/simulated/floor/tiled/white, /area/exodus/research/xenobiology) @@ -38291,7 +38291,7 @@ }, /obj/structure/window/reinforced{ dir = 1; - health = 1e+006 + current_health = 1e+006 }, /obj/item/stack/material/shiny/mapped/aluminium/fifty, /obj/item/stack/material/shiny/mapped/aluminium/fifty, @@ -38349,7 +38349,7 @@ /obj/structure/table/steel_reinforced, /obj/structure/window/reinforced{ dir = 1; - health = 1e+006 + current_health = 1e+006 }, /turf/simulated/floor/tiled/steel_grid, /area/exodus/engineering/workshop) @@ -49738,7 +49738,7 @@ }, /obj/structure/window/reinforced{ dir = 1; - health = 1e+006 + current_health = 1e+006 }, /obj/item/clothing/suit/space/void/engineering/prepared, /turf/simulated/floor/tiled/steel_grid, @@ -49992,7 +49992,7 @@ }, /obj/structure/window/reinforced{ dir = 1; - health = 1e+006 + current_health = 1e+006 }, /obj/structure/window/reinforced{ dir = 4 @@ -50801,7 +50801,7 @@ }, /obj/structure/window/reinforced{ dir = 1; - health = 1e+006 + current_health = 1e+006 }, /obj/machinery/door/window/southleft{ name = "Engineering Voidsuits" diff --git a/maps/exodus/exodus-admin.dmm b/maps/exodus/exodus-admin.dmm index c83c3c48c9b..4f8d3ef69f6 100644 --- a/maps/exodus/exodus-admin.dmm +++ b/maps/exodus/exodus-admin.dmm @@ -336,7 +336,7 @@ "ayi" = ( /obj/structure/window/reinforced{ dir = 1; - health = 1e+006 + current_health = 1e+006 }, /obj/structure/showcase{ desc = "A self-contained autopilot that controls supply drones."; diff --git a/maps/ministation/ministation-0.dmm b/maps/ministation/ministation-0.dmm index 6f0aedcd701..c2ab6ace6ac 100644 --- a/maps/ministation/ministation-0.dmm +++ b/maps/ministation/ministation-0.dmm @@ -2407,7 +2407,7 @@ }, /obj/effect/floor_decal/corner/red/diagonal, /obj/structure/window/reinforced{ - health = 1e+007 + current_health = 1e+007 }, /turf/simulated/floor/reinforced/nitrogen, /area/ministation/atmospherics) @@ -3856,7 +3856,7 @@ /obj/effect/floor_decal/corner/red/diagonal, /obj/machinery/meter/turf, /obj/structure/window/reinforced{ - health = 1e+007 + current_health = 1e+007 }, /turf/simulated/floor/reinforced/nitrogen, /area/ministation/atmospherics) diff --git a/maps/ministation/ministation-2.dmm b/maps/ministation/ministation-2.dmm index 6864884b7f9..775a822074b 100644 --- a/maps/ministation/ministation-2.dmm +++ b/maps/ministation/ministation-2.dmm @@ -3642,7 +3642,7 @@ dir = 8 }, /obj/structure/window/reinforced{ - health = 1e+007 + current_health = 1e+007 }, /obj/machinery/vending/cola{ dir = 1 diff --git a/maps/random_ruins/exoplanet_ruins/hydrobase/hydrobase.dm b/maps/random_ruins/exoplanet_ruins/hydrobase/hydrobase.dm index e28854c3373..a3c93b0d782 100644 --- a/maps/random_ruins/exoplanet_ruins/hydrobase/hydrobase.dm +++ b/maps/random_ruins/exoplanet_ruins/hydrobase/hydrobase.dm @@ -84,7 +84,7 @@ /mob/living/simple_animal/hostile/retaliate/goat/hydro name = "goat" desc = "An impressive goat, in size and coat. His horns look pretty serious!" - mob_default_max_health = 100 + max_health = 100 natural_weapon = /obj/item/natural_weapon/hooves/strong faction = "farmbots" @@ -98,7 +98,7 @@ speak = list("Initiating harvesting subrout-ine-ine.", "Connection timed out.", "Connection with master AI syst-tem-tem lost.", "Core systems override enab-...") emote_see = list("beeps repeatedly", "whirrs violently", "flashes its indicator lights", "emits a ping sound") faction = "farmbots" - mob_default_max_health = 225 + max_health = 225 malfunctioning = 0 /mob/living/simple_animal/hostile/retaliate/malf_drone/hydro/Initialize() diff --git a/maps/random_ruins/exoplanet_ruins/playablecolony/colony.dmm b/maps/random_ruins/exoplanet_ruins/playablecolony/colony.dmm index dd2aaef5dbf..3323ae2f46f 100644 --- a/maps/random_ruins/exoplanet_ruins/playablecolony/colony.dmm +++ b/maps/random_ruins/exoplanet_ruins/playablecolony/colony.dmm @@ -3489,7 +3489,7 @@ }, /obj/structure/window/reinforced{ dir = 1; - health = 1e+006 + current_health = 1e+006 }, /turf/simulated/floor/plating, /area/map_template/colony/atmospherics) @@ -3499,7 +3499,7 @@ }, /obj/structure/window/reinforced{ dir = 1; - health = 1e+006 + current_health = 1e+006 }, /obj/structure/window/reinforced{ dir = 4 @@ -5203,7 +5203,7 @@ "kc" = ( /obj/structure/window/reinforced{ dir = 1; - health = 1e+006 + current_health = 1e+006 }, /obj/structure/window/reinforced{ dir = 4 @@ -7423,7 +7423,7 @@ /obj/machinery/door/window/northright, /obj/structure/window/reinforced{ dir = 8; - health = 1e+006 + current_health = 1e+006 }, /obj/structure/window/reinforced{ dir = 4 diff --git a/maps/tradeship/tradeship-2.dmm b/maps/tradeship/tradeship-2.dmm index 96d917313d0..aa7f4444ebe 100644 --- a/maps/tradeship/tradeship-2.dmm +++ b/maps/tradeship/tradeship-2.dmm @@ -4117,7 +4117,7 @@ /obj/effect/floor_decal/corner/red/diagonal, /obj/machinery/meter/turf, /obj/structure/window/reinforced{ - health = 1e+007 + current_health = 1e+007 }, /turf/simulated/floor/reinforced/nitrogen, /area/ship/trade/maintenance/atmos) @@ -4130,7 +4130,7 @@ }, /obj/effect/floor_decal/corner/red/diagonal, /obj/structure/window/reinforced{ - health = 1e+007 + current_health = 1e+007 }, /turf/simulated/floor/reinforced/nitrogen, /area/ship/trade/maintenance/atmos) diff --git a/mods/content/corporate/away_sites/lar_maria/lar_maria-1.dmm b/mods/content/corporate/away_sites/lar_maria/lar_maria-1.dmm index a0ccc54bb2d..de021ddc438 100644 --- a/mods/content/corporate/away_sites/lar_maria/lar_maria-1.dmm +++ b/mods/content/corporate/away_sites/lar_maria/lar_maria-1.dmm @@ -399,7 +399,7 @@ /obj/structure/window/reinforced, /obj/structure/window/reinforced{ dir = 1; - health = 1e+006 + current_health = 1e+006 }, /obj/structure/hygiene/shower{ dir = 4 @@ -528,7 +528,7 @@ /obj/structure/window/reinforced, /obj/structure/window/reinforced{ dir = 1; - health = 1e+006 + current_health = 1e+006 }, /obj/structure/hygiene/shower{ dir = 4 @@ -2018,7 +2018,7 @@ }, /obj/structure/window/reinforced{ dir = 1; - health = 1e+006 + current_health = 1e+006 }, /obj/structure/cable{ icon_state = "1-8" @@ -2031,7 +2031,7 @@ }, /obj/structure/window/reinforced{ dir = 1; - health = 1e+006 + current_health = 1e+006 }, /obj/machinery/door/window/eastright, /turf/simulated/floor/tiled/white, diff --git a/mods/content/corporate/away_sites/lar_maria/lar_maria.dm b/mods/content/corporate/away_sites/lar_maria/lar_maria.dm index 59f75b91501..47738cbc2c2 100644 --- a/mods/content/corporate/away_sites/lar_maria/lar_maria.dm +++ b/mods/content/corporate/away_sites/lar_maria/lar_maria.dm @@ -54,7 +54,7 @@ /mob/living/simple_animal/hostile/lar_maria/test_subject name = "test subject" desc = "Sick, filthy, angry and probably crazy human in an orange robe." - mob_default_max_health = 40 + max_health = 40 corpse = /obj/abstract/landmark/corpse/lar_maria/test_subject icon = 'mods/content/corporate/away_sites/lar_maria/lar_maria_test_subject.dmi' @@ -87,7 +87,7 @@ /mob/living/simple_animal/hostile/lar_maria/guard//angry guards armed with batons and shotguns. Still bite name = "security" desc = "Guard dressed at Zeng-Hu Pharmaceuticals uniform." - mob_default_max_health = 60 + max_health = 60 natural_weapon = /obj/item/baton weapon = /obj/item/baton corpse = /obj/abstract/landmark/corpse/lar_maria/zhp_guard @@ -122,7 +122,7 @@ name = "virologist" desc = "Virologist dressed at Zeng-Hu Pharmaceuticals uniform." icon = 'mods/content/corporate/away_sites/lar_maria/lar_maria_virologist_m.dmi' - mob_default_max_health = 50 + max_health = 50 corpse = /obj/abstract/landmark/corpse/lar_maria/virologist /obj/abstract/landmark/corpse/lar_maria/virologist diff --git a/mods/content/government/ruins/ec_old_crash/ec_old_crash.dmm b/mods/content/government/ruins/ec_old_crash/ec_old_crash.dmm index 274d444277f..aab03e71812 100644 --- a/mods/content/government/ruins/ec_old_crash/ec_old_crash.dmm +++ b/mods/content/government/ruins/ec_old_crash/ec_old_crash.dmm @@ -698,7 +698,7 @@ dir = 4 }, /obj/structure/window/reinforced{ - health = 1e+007 + current_health = 1e+007 }, /obj/effect/floor_decal/corner/purple{ dir = 6 diff --git a/mods/content/psionics/items/_items.dm b/mods/content/psionics/items/_items.dm index ebada3b4ae6..35a5b71ea9c 100644 --- a/mods/content/psionics/items/_items.dm +++ b/mods/content/psionics/items/_items.dm @@ -3,7 +3,7 @@ /obj/item/withstand_psi_stress(var/stress, var/atom/source) . = ..(stress, source) - if(health >= 0 && . > 0 && disrupts_psionics()) - health -= . - . = max(0, -(health)) + if(current_health >= 0 && . > 0 && disrupts_psionics()) + current_health -= . + . = max(0, -(current_health)) check_health(consumed = TRUE) diff --git a/mods/content/xenobiology/mobs/critter_slime.dm b/mods/content/xenobiology/mobs/critter_slime.dm index 16d870872f5..3c1a0f22363 100644 --- a/mods/content/xenobiology/mobs/critter_slime.dm +++ b/mods/content/xenobiology/mobs/critter_slime.dm @@ -3,7 +3,7 @@ desc = "A lovable, domesticated slime." icon = 'mods/content/xenobiology/icons/slimes/slime_baby.dmi' speak_emote = list("chirps") - mob_default_max_health = 100 + max_health = 100 response_harm = "stamps on" emote_see = list("jiggles", "bounces in place") gene_damage = -1 diff --git a/mods/content/xenobiology/slime/_slime.dm b/mods/content/xenobiology/slime/_slime.dm index e81a9809b9b..588ea4569bc 100644 --- a/mods/content/xenobiology/slime/_slime.dm +++ b/mods/content/xenobiology/slime/_slime.dm @@ -12,7 +12,7 @@ icon_state = ICON_STATE_WORLD pass_flags = PASS_FLAG_TABLE speak_emote = list("chirps") - mob_default_max_health = 150 + max_health = 150 gender = NEUTER update_icon = 0 see_in_dark = 8 diff --git a/mods/content/xenobiology/slime/powers.dm b/mods/content/xenobiology/slime/powers.dm index a90c4b879f9..6fe8c85aa75 100644 --- a/mods/content/xenobiology/slime/powers.dm +++ b/mods/content/xenobiology/slime/powers.dm @@ -16,7 +16,7 @@ return is_adult = TRUE - mob_default_max_health = 200 + max_health = 200 amount_grown = 0 update_name() update_icon() diff --git a/mods/mobs/dionaea/mob/_nymph.dm b/mods/mobs/dionaea/mob/_nymph.dm index 714fe5d7def..382a03212e7 100644 --- a/mods/mobs/dionaea/mob/_nymph.dm +++ b/mods/mobs/dionaea/mob/_nymph.dm @@ -9,7 +9,7 @@ icon = 'mods/mobs/dionaea/icons/nymph.dmi' icon_state = ICON_STATE_WORLD death_msg = "expires with a pitiful chirrup..." - mob_default_max_health = 60 + max_health = 60 available_maneuvers = list(/decl/maneuver/leap) status_flags = NO_ANTAG diff --git a/mods/species/ascent/mobs/insectoid_egg.dm b/mods/species/ascent/mobs/insectoid_egg.dm index cf05c7b106c..7c51602474b 100644 --- a/mods/species/ascent/mobs/insectoid_egg.dm +++ b/mods/species/ascent/mobs/insectoid_egg.dm @@ -11,8 +11,8 @@ var/global/default_gyne /obj/structure/insectoid_egg name = "alien egg" desc = "A semi-translucent alien egg." - health = 100 - obj_max_health = 100 + current_health = 100 + max_health = 100 icon = 'mods/species/ascent/icons/egg.dmi' icon_state = "egg" @@ -41,7 +41,7 @@ var/global/default_gyne /obj/structure/insectoid_egg/on_update_icon() ..() - if(hatched || !health) + if(hatched || !current_health) icon_state = "egg_broken" else if(hatching) icon_state = "egg_break" @@ -53,7 +53,7 @@ var/global/default_gyne /obj/structure/insectoid_egg/examine(mob/user) . = ..() - if(hatched || !health) + if(hatched || !current_health) to_chat(user, "\icon[src] \The [src] lays in shambles, having been hatched or broken.") return @@ -71,7 +71,7 @@ var/global/default_gyne to_chat(user, "\icon[src] \The [src] is lively and appears ready to hatch at any moment.") /obj/structure/insectoid_egg/Process() - if(!health || hatched || hatching || (world.time <= (last_tick + maturity_rate))) + if(!current_health || hatched || hatching || (world.time <= (last_tick + maturity_rate))) return last_tick = world.time @@ -79,7 +79,7 @@ var/global/default_gyne // Too high of temp will damage eggs. if(T.temperature > (max_temperature * 1.5)) - health = max(0, health - 5) + current_health = max(0, current_health - 5) if(T.temperature < min_temperature || T.temperature > max_temperature) return @@ -92,7 +92,7 @@ var/global/default_gyne G.request_player(src, "A mantid nymph is ready to hatch and needs a player.") /obj/structure/insectoid_egg/proc/hatch(var/client/C) - if(!health || maturity != 100 || hatched || hatching) + if(!current_health || maturity != 100 || hatched || hatching) return var/mob/living/carbon/alien/ascent_nymph/new_nymph = new(src, SPECIES_MANTID_NYMPH) // Spawn in the egg. diff --git a/mods/species/ascent/mobs/nymph/_nymph.dm b/mods/species/ascent/mobs/nymph/_nymph.dm index 2961ea4d14c..d21bd76ab1e 100644 --- a/mods/species/ascent/mobs/nymph/_nymph.dm +++ b/mods/species/ascent/mobs/nymph/_nymph.dm @@ -15,7 +15,7 @@ icon = 'mods/species/ascent/icons/species/nymph.dmi' icon_state = ICON_STATE_WORLD death_msg = "expires with a pitiful hiss..." - mob_default_max_health = 60 + max_health = 60 available_maneuvers = list(/decl/maneuver/leap) only_species_language = 1