diff --git a/aurorastation.dme b/aurorastation.dme index cec9e87fa54..d1aecb7179e 100644 --- a/aurorastation.dme +++ b/aurorastation.dme @@ -672,6 +672,7 @@ #include "code\defines\procs\hud.dm" #include "code\defines\procs\radio.dm" #include "code\game\ambience.dm" +#include "code\game\atom_health.dm" #include "code\game\atoms.dm" #include "code\game\atoms_movable.dm" #include "code\game\base_turf.dm" diff --git a/code/__DEFINES/global.dm b/code/__DEFINES/global.dm index 2e53035bd83..c120def2ba8 100644 --- a/code/__DEFINES/global.dm +++ b/code/__DEFINES/global.dm @@ -173,3 +173,6 @@ GLOBAL_LIST_INIT(department_funds, list( GLOBAL_LIST_EMPTY(exo_beacons) GLOBAL_VAR_INIT(minimum_exterior_lighting_alpha, 255) + +/// The minimum amount of armour for objects in the game. Stops things from being destroyed by objects with a small force. +GLOBAL_LIST_INIT(default_object_armor, list(MELEE = ARMOR_MELEE_MINOR)) diff --git a/code/__DEFINES/obj.dm b/code/__DEFINES/obj.dm index a5a6db48b5a..4162ff99b5b 100644 --- a/code/__DEFINES/obj.dm +++ b/code/__DEFINES/obj.dm @@ -24,3 +24,13 @@ #define BARRICADE_LIQUIDBAG_5 5 #define HELMET_GARB_PASS_ICON "pass_icon" + +/// Defines for object maxhealth. +#define OBJECT_HEALTH_FRAGILE 15 +#define OBJECT_HEALTH_EXTREMELY_LOW 25 +#define OBJECT_HEALTH_VERY_LOW 50 +#define OBJECT_HEALTH_LOW 100 +#define OBJECT_HEALTH_MEDIUM 150 +#define OBJECT_HEALTH_HIGH 200 +#define OBJECT_HEALTH_VERY_HIGH 300 +#define OBJECT_HEALTH_EXTREMELY_HIGH 600 diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index b7d4d6e9424..aa70c4106ce 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -60,7 +60,16 @@ This calls [atom/proc/tool_act], among others. return TRUE if((user?.a_intent == I_HURT) && !(attacking_item.item_flags & ITEM_FLAG_NO_BLUDGEON)) - visible_message(SPAN_DANGER("[src] has been hit by [user] with [attacking_item].")) + if(attacking_item.force && should_use_health && maxhealth) + user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) + user.do_attack_animation(src) + visible_message(SPAN_DANGER("[user] [pick(attacking_item.attack_verb)] \the [src]!")) + add_damage(attacking_item.force, attacking_item.damage_flags(), attacking_item.damtype, attacking_item.armor_penetration, attacking_item) + if(hitsound) + playsound(src, hitsound, attacking_item.get_clamped_volume(), 1, falloff_distance = 0) + else + playsound(src, attacking_item.hitsound, attacking_item.get_clamped_volume(), 1, falloff_distance = 0) + return FALSE var/item_interact_result = src.base_item_interaction(user, attacking_item, modifiers) if(item_interact_result & ITEM_INTERACT_SUCCESS) diff --git a/code/datums/components/armor/_armor.dm b/code/datums/components/armor/_armor.dm index be8e7196262..74b21bac2d9 100644 --- a/code/datums/components/armor/_armor.dm +++ b/code/datums/components/armor/_armor.dm @@ -3,27 +3,33 @@ var/full_block_message = "Your armor absorbs the blow!" var/partial_block_message = "Your armor softens the blow!" - // This controls how some armor types such as mech armor work. + /// If this armour component should be hidden on examine. + var/hidden = FALSE + + /// This controls how some armor types such as mech armor work. var/armor_flags = ARMOR_TYPE_STANDARD - // Armor 'works' for damages in range from 0 to [armor_range_mult * armor]. - // The lower the damage, the harder it gets blocked, tapering to 0 mitigation at [armor_range_mult * armor] + /// Armor 'works' for damages in range from 0 to [armor_range_mult * armor]. + /// The lower the damage, the harder it gets blocked, tapering to 0 mitigation at [armor_range_mult * armor] var/armor_range_mult = 2 - // [under_armor_mult] multiplies how strongly damage that is <= armor value is blocked. - // E.g. setting it to 0 will flat out block all damage below armor + /// [under_armor_mult] multiplies how strongly damage that is <= armor value is blocked. + /// E.g. setting it to 0 will flat out block all damage below armor var/under_armor_mult = 0.7 - // [over_armor_mult] multiplies how strongly damage that is > armor value is blocked. - // E.g. setting it to more than 1 will make mitigation drop off faster, effectively reducing the range of damage mitigation + /// [over_armor_mult] multiplies how strongly damage that is > armor value is blocked. + /// E.g. setting it to more than 1 will make mitigation drop off faster, effectively reducing the range of damage mitigation var/over_armor_mult = 1 - var/sealed = FALSE // Used with ARMOR_TYPE_RIG. + /// Used with ARMOR_TYPE_RIG. + var/sealed = FALSE -/datum/component/armor/Initialize(list/armor, armor_type) +/datum/component/armor/Initialize(list/armor, armor_type, hidden) ..() if(armor) armor_values = armor.Copy() if(armor_type) armor_flags = armor_type + if(hidden) + hidden = TRUE // Takes in incoming damage value // Applies state changes to self, holder, and whatever else caused by damage mitigation diff --git a/code/game/atom_health.dm b/code/game/atom_health.dm new file mode 100644 index 00000000000..59c757e846f --- /dev/null +++ b/code/game/atom_health.dm @@ -0,0 +1,96 @@ +/// If this atom uses the health system at all. +/atom/var/should_use_health = FALSE +/// The health of this atom. If this is null, it will set health to maxhealth on Initialize. Otherwise, you can set a custom health value to use at initialize. +/atom/var/health +/// The maximum health of this atom. If null, health is not used. +/atom/var/maxhealth +/// The sound played when an item hits something OR when something is hit. +/atom/var/hitsound +/// The sound played when this object is destroyed. +/atom/var/destroy_sound + +/** + * This proc is called to add damage to an atom. If there is no health left, it calls on_death(). + */ +/atom/proc/add_damage(damage, damage_flags, damage_type, armor_penetration, obj/weapon) + if(!damage || !maxhealth || (damage < 1) || !should_use_health) + return FALSE + + var/datum/component/armor/armor = GetComponent(/datum/component/armor) + if(armor) + var/blocked = armor.get_blocked(damage_type, damage_flags, armor_penetration, damage) + damage *= 1 - blocked + + health = max(health - damage, 0) + update_health() + if(!health) + if(destroy_sound) + playsound(src, destroy_sound, 75) + on_death() + return TRUE + +/** + * For custom damage condition hints. Some structures may want different ones than the default, like the cult crystal. + */ +/atom/proc/get_damage_condition_hints(mob/user, distance, is_adjacent) + if(!should_use_health) + return FALSE + if(health < maxhealth * 0.25) + . = SPAN_DANGER("\The [src] looks like it's about to break!") + else if(health < maxhealth * 0.5) + . = SPAN_ALERT("\The [src] looks seriously damaged!") + else if(health < maxhealth * 0.75) + . = SPAN_WARNING("\The [src] shows signs of damage!") + +/** + * This proc is called when atom health changes. Use this to set custom states, do messages, etc. + */ +/atom/proc/update_health() + return + +/** + * This proc is called by update_health() when the health of the atom hits zero. Handles the destruction of the atom, or you can override it to do different effects. + */ +/atom/proc/on_death(damage, damage_flags, damage_type, armor_penetration, obj/weapon) + if(!should_use_health) + return FALSE + qdel(src) + +/** + * This proc is called to set the atom's health directly. + */ +/atom/proc/set_health(new_health) + if(!maxhealth || !should_use_health) + return FALSE + + if(health >= maxhealth) + return FALSE + + health = min(new_health, maxhealth) + return TRUE + +/** + * Use this proc to update an atom's maxhealth. Set update_current_health to TRUE if you want to change the current health proportionally to the new maxhealth, or FALSE if you want to keep the current health the same. + */ +/atom/proc/set_maxhealth(new_maxhealth, update_current_health = FALSE) + if(!maxhealth || !should_use_health) + return FALSE + + var/old_maxhealth = maxhealth + maxhealth = new_maxhealth + if(update_current_health || health > maxhealth) + health *= maxhealth / old_maxhealth + return TRUE + +/** + * This proc is called to directly add to an atom's health (basically, to add it). + */ +/atom/proc/add_health(repair_amount) + if(!maxhealth || !should_use_health) + return FALSE + + if(health >= maxhealth) + return FALSE + + health = min(health + repair_amount, maxhealth) + return TRUE diff --git a/code/game/dna/dna_modifier.dm b/code/game/dna/dna_modifier.dm index c6511f9c6a7..600a5a0587e 100644 --- a/code/game/dna/dna_modifier.dm +++ b/code/game/dna/dna_modifier.dm @@ -393,7 +393,7 @@ occupantData["stat"] = null occupantData["isViableSubject"] = null occupantData["health"] = null - occupantData["maxHealth"] = null + occupantData["maxhealth"] = null occupantData["minHealth"] = null occupantData["uniqueEnzymes"] = null occupantData["uniqueIdentity"] = null @@ -406,7 +406,7 @@ if ((connected.occupant.mutations & NOCLONE) || !src.connected.occupant.dna) occupantData["isViableSubject"] = 0 occupantData["health"] = connected.occupant.health - occupantData["maxHealth"] = connected.occupant.maxHealth + occupantData["maxhealth"] = connected.occupant.maxhealth occupantData["minHealth"] = connected.occupant.species.total_health occupantData["uniqueEnzymes"] = connected.occupant.dna.unique_enzymes occupantData["uniqueIdentity"] = connected.occupant.dna.uni_identity diff --git a/code/game/gamemodes/changeling/implements/powers/body.dm b/code/game/gamemodes/changeling/implements/powers/body.dm index 7770cdd4ae0..d13e066746c 100644 --- a/code/game/gamemodes/changeling/implements/powers/body.dm +++ b/code/game/gamemodes/changeling/implements/powers/body.dm @@ -631,9 +631,9 @@ for(var/obj/machinery/door/window/WD in view(7)) if(get_dist(src, WD) > 5) //Windoors are strong, may only take damage instead of break if far away. - WD.take_damage(rand(12, 16) * 10) + WD.add_damage(rand(12, 16) * 10) else - WD.shatter() + WD.on_death() for(var/obj/machinery/light/L in view(7)) L.broken() diff --git a/code/game/gamemodes/cult/runes/armor.dm b/code/game/gamemodes/cult/runes/armor.dm index 90ed4cf5c38..aa6ca967e53 100644 --- a/code/game/gamemodes/cult/runes/armor.dm +++ b/code/game/gamemodes/cult/runes/armor.dm @@ -22,7 +22,7 @@ var/construct_path = construct_types[construct_class] var/mob/living/simple_animal/construct/Z = new construct_path(get_turf(C)) - Z.health = Z.health * (C.health / C.maxHealth) + Z.health = Z.health * (C.health / C.maxhealth) Z.key = C.key if(iscultist(C)) GLOB.cult.add_antagonist(Z.mind) diff --git a/code/game/gamemodes/cult/structures/pylon.dm b/code/game/gamemodes/cult/structures/pylon.dm index 836ec062333..3635e2e808f 100644 --- a/code/game/gamemodes/cult/structures/pylon.dm +++ b/code/game/gamemodes/cult/structures/pylon.dm @@ -9,11 +9,10 @@ light_system = MOVABLE_LIGHT light_range = 5 light_color = "#3e0000" + maxhealth = 30 anchored = FALSE - var/isbroken = FALSE - var/pylonmode = PYLON_IDLE - var/damagetaken = 0 + var/pylonmode = PYLON_IDLE ///Number of empowered, higher-damage shots remaining var/empowered = 0 @@ -30,6 +29,8 @@ var/mob/living/target + var/isbroken = FALSE + /** * Number of times handle_firing has been called without finding anything to shoot at * @@ -45,19 +46,16 @@ var/process_interval = 1 var/ticks -/obj/structure/cult/pylon/condition_hints(mob/user, distance, is_adjacent) - . = list() - . = ..() - if(damagetaken) - switch(damagetaken) - if(1 to 8) - . += SPAN_WARNING("It has very faint hairline fractures.") - if(8 to 20) - . += SPAN_WARNING("It has several cracks across its surface.") - if(20 to 30) - . += SPAN_WARNING("It is chipped and deeply cracked, it may shatter with much more pressure.") - if(30 to INFINITY) - . += SPAN_DANGER("It is almost cleaved in two, the pylon looks like it will fall to shards under its own weight.") +/obj/structure/cult/pylon/get_damage_condition_hints(mob/user, distance, is_adjacent) + switch(health) + if(26 to 30) + . = SPAN_WARNING("It has very faint hairline fractures.") + if(16 to 25) + . = SPAN_WARNING("It has several cracks across its surface.") + if(8 to 15) + . = SPAN_WARNING("It is chipped and deeply cracked, it may shatter with much more pressure.") + if(1 to 7) + . = SPAN_DANGER("It is almost cleaved in two, the pylon looks like it will fall to shards under its own weight.") /obj/structure/cult/pylon/antagonist_hints(mob/user, distance, is_adjacent) . += ..() @@ -155,8 +153,8 @@ if(2) if((ticks % process_interval) == 0) handle_firing() - if(damagetaken && prob(50) && empowered > 0) - damagetaken = max(0, damagetaken-1) //An empowered pylon slowly self repairs + if(prob(50) && empowered > 0) + add_health(1) empowered = max(0, empowered - 0.2) if(prob(10)) visible_message(SPAN_WARNING("Cracks in the [src] gradually seal as new crystalline matter grows to fill them.")) @@ -442,19 +440,19 @@ if(!damage) return - damagetaken += damage + add_damage(damage, weapon = source) if(!isbroken) if(user) user.do_attack_animation(src) - if(prob(damagetaken * 0.75)) + if(prob(maxhealth - health * 0.75)) shatter() else if(user && !ranged) to_chat(user, SPAN_WARNING("You hit the pylon!")) playsound(get_turf(src), 'sound/effects/glass_hit.ogg', 75, 1) else - if(prob(damagetaken)) + if(prob(health)) if(user) to_chat(user, SPAN_WARNING("You pulverize what was left of the pylon!")) qdel(src) @@ -497,14 +495,14 @@ to_chat(user, SPAN_NOTICE("You weave forgotten magic, summoning the shards of the crystal and knitting them anew, until it hovers flawless once more.")) isbroken = 0 density = 1 - else if(damagetaken > 0) + else if(health < maxhealth) to_chat(user, SPAN_NOTICE("You meld the crystal lattice back into integrity, sealing over the cracks until they never were.")) else to_chat(user, SPAN_NOTICE("The crystal lights up at your touch.")) process_interval = 1 //Wake up the crystal notarget = 0 - damagetaken = 0 + set_health(maxhealth) update_icon() /obj/structure/cult/pylon/update_icon() diff --git a/code/game/gamemodes/technomancer/spells/summon/summon_creature.dm b/code/game/gamemodes/technomancer/spells/summon/summon_creature.dm index 3ab3172e0e1..0a8cf35cb20 100644 --- a/code/game/gamemodes/technomancer/spells/summon/summon_creature.dm +++ b/code/game/gamemodes/technomancer/spells/summon/summon_creature.dm @@ -47,7 +47,7 @@ H.friends += owner // Makes their new pal big and strong, if they have spell power. - summoned.maxHealth = calculate_spell_power(summoned.maxHealth) + summoned.maxhealth = calculate_spell_power(summoned.maxhealth) summoned.health = calculate_spell_power(summoned.health) summoned.melee_damage_lower = calculate_spell_power(summoned.melee_damage_lower) summoned.melee_damage_upper = calculate_spell_power(summoned.melee_damage_upper) diff --git a/code/game/gamemodes/vampire/vampire_powers.dm b/code/game/gamemodes/vampire/vampire_powers.dm index 8fdb759658a..5254487944e 100644 --- a/code/game/gamemodes/vampire/vampire_powers.dm +++ b/code/game/gamemodes/vampire/vampire_powers.dm @@ -382,9 +382,9 @@ for(var/obj/machinery/door/window/WD in view(7)) if(get_dist(src, WD) > 5) //Windoors are strong, may only take damage instead of break if far away. - WD.take_damage(rand(12, 16) * 10) + WD.add_damage(rand(12, 16) * 10) else - WD.shatter() + WD.add_damage(WD.health) for(var/obj/machinery/light/L in view(7)) L.broken() diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm index 63d515a4ec2..a3942568c79 100644 --- a/code/game/machinery/atmoalter/canister.dm +++ b/code/game/machinery/atmoalter/canister.dm @@ -5,7 +5,7 @@ icon_state = "yellow" density = TRUE light_system = MOVABLE_LIGHT - var/health = 100.0 + maxhealth = OBJECT_HEALTH_VERY_LOW obj_flags = OBJ_FLAG_SIGNALER | OBJ_FLAG_CONDUCTABLE w_class = WEIGHT_CLASS_HUGE @@ -346,15 +346,12 @@ update_flag . = ..() if(exposed_temperature > temperature_resistance) - health -= 5 - healthcheck() + add_damage(5) -/obj/machinery/portable_atmospherics/canister/proc/healthcheck() - if(destroyed) - return TRUE - - if (src.health <= 10) - var/atom/location = src.loc +/obj/machinery/portable_atmospherics/canister/add_damage(damage, damage_flags, damage_type, armor_penetration, obj/weapon) + . = ..() + if (health <= maxhealth * 0.1) + var/atom/location = loc location.assume_air(air_contents) destroyed = TRUE @@ -362,18 +359,14 @@ update_flag playsound(src.loc, 'sound/effects/spray.ogg', 10, 1, -3) density = FALSE - if (src.holding) - src.holding.forceMove(src.loc) - src.holding = null + if (holding) + holding.forceMove(src.loc) + holding = null detach_signaler() update_icon() - return 1 - else - return 1 - /obj/machinery/portable_atmospherics/canister/process() if (destroyed) return PROCESS_KILL @@ -419,8 +412,7 @@ update_flag return BULLET_ACT_BLOCK if(hitting_projectile.damage) - src.health -= round(hitting_projectile.damage / 2) - healthcheck() + add_damage(round(hitting_projectile.damage / 2)) /obj/machinery/portable_atmospherics/canister/AltClick(var/mob/abstract/ghost/observer/admin) if (istype(admin)) @@ -450,10 +442,9 @@ update_flag visible_message(SPAN_WARNING("\The [user] hits \the [src] with \the [attacking_item]!"), SPAN_NOTICE("You hit \the [src] with \the [attacking_item].")) user.do_attack_animation(src, attacking_item) playsound(src, 'sound/weapons/smash.ogg', 60, 1) - src.health -= attacking_item.force + add_damage(attacking_item.force) if(!istype(attacking_item, /obj/item/forensics)) src.add_fingerprint(user) - healthcheck() return TRUE if(istype(user, /mob/living/silicon/robot) && istype(attacking_item, /obj/item/tank/jetpack)) diff --git a/code/game/machinery/bots/bots.dm b/code/game/machinery/bots/bots.dm index 8636220cccb..2bdff19d86d 100644 --- a/code/game/machinery/bots/bots.dm +++ b/code/game/machinery/bots/bots.dm @@ -8,23 +8,12 @@ light_system = MOVABLE_LIGHT var/obj/item/card/id/botcard // the ID card that the bot "holds" var/on = 1 - var/health = 0 //do not forget to set health for your bot! - var/maxhealth = 0 var/fire_dam_coeff = 1.0 var/brute_dam_coeff = 1.0 var/open = 0//Maint panel var/locked = 1 //var/emagged = 0 //Urist: Moving that var to the general /bot tree as it's used by most bots -/obj/machinery/bot/condition_hints(mob/user, distance, is_adjacent) - . += list() - . = ..() - if (src.health < maxhealth) - if (src.health > maxhealth/3) - . += SPAN_WARNING("[src]'s parts look loose.") - else - . += SPAN_DANGER("[src]'s parts look very loose!") - /obj/machinery/bot/Initialize(mapload, d, populate_components, is_internal) . = ..() add_to_target_grid() @@ -46,9 +35,8 @@ /obj/machinery/bot/proc/explode() qdel(src) -/obj/machinery/bot/proc/healthcheck() - if (src.health <= 0) - src.explode() +/obj/machinery/bot/on_death(damage, damage_flags, damage_type, armor_penetration, obj/weapon) + explode() /obj/machinery/bot/emag_act(var/remaining_charges, var/user) if(locked && !emagged) @@ -72,7 +60,7 @@ else if(attacking_item.tool_behaviour == TOOL_WELDER) if(health < maxhealth) if(open) - health = min(maxhealth, health+10) + add_health(10) user.visible_message(SPAN_WARNING("[user] repairs [src]!"),SPAN_NOTICE("You repair [src]!")) user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) else @@ -81,47 +69,33 @@ to_chat(user, SPAN_NOTICE("[src] does not need a repair.")) return TRUE else - if(hasvar(attacking_item,"force") && hasvar(attacking_item,"damtype")) + if(attacking_item.force && attacking_item.damtype) switch(attacking_item.damtype) - if("fire") - src.health -= attacking_item.force * fire_dam_coeff - if("brute") - src.health -= attacking_item.force * brute_dam_coeff + if(DAMAGE_BURN) + add_damage(attacking_item.force * fire_dam_coeff) + if(DAMAGE_BRUTE) + add_damage(attacking_item.force * brute_dam_coeff) user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) - . = ..() - healthcheck() - return . + return ..() else return ..() /obj/machinery/bot/bullet_act(var/obj/projectile/Proj) if(!(Proj.damage_type == DAMAGE_BRUTE || Proj.damage_type == DAMAGE_BURN)) return BULLET_ACT_BLOCK - . = ..() - if(. != BULLET_ACT_HIT) - return . - - health -= Proj.damage - healthcheck() /obj/machinery/bot/ex_act(severity) switch(severity) - if(1.0) - src.explode() - return - if(2.0) - src.health -= rand(5,10)*fire_dam_coeff - src.health -= rand(10,20)*brute_dam_coeff - healthcheck() - return - if(3.0) + if(1) + explode() + if(2) + add_damage(rand(5,10)*fire_dam_coeff) + add_damage(rand(10,20)*brute_dam_coeff) + if(3) if (prob(50)) - src.health -= rand(1,5)*fire_dam_coeff - src.health -= rand(1,5)*brute_dam_coeff - healthcheck() - return - return + add_damage(rand(1,5)*fire_dam_coeff) + add_damage(rand(1,5)*brute_dam_coeff) /obj/machinery/bot/emp_act(severity) . = ..() @@ -157,12 +131,11 @@ return ..() if(user.species.can_shred(user)) - src.health -= rand(15,30)*brute_dam_coeff + add_damage(rand(15,30) * brute_dam_coeff) src.visible_message(SPAN_DANGER("[user] has slashed [src]!")) playsound(src.loc, 'sound/weapons/slice.ogg', 25, 1, -1) if(prob(10)) new /obj/effect/decal/cleanable/blood/oil(src.loc) - healthcheck() /******************************************************************/ // Navigation procs diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index b3201c4f0ef..4785041f454 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -8,6 +8,12 @@ active_power_usage = 10 layer = CAMERA_LAYER obj_flags = OBJ_FLAG_MOVES_UNSUPPORTED + maxhealth = OBJECT_HEALTH_EXTREMELY_LOW + armor = list( + MELEE = ARMOR_MELEE_SMALL, + BULLET = ARMOR_BALLISTIC_MINOR, + LASER = ARMOR_LASER_MINOR + ) var/list/network = list(NETWORK_STATION) var/c_tag = null @@ -143,7 +149,7 @@ if(. != BULLET_ACT_HIT) return . - take_damage(hitting_projectile.get_structure_damage()) + add_damage(hitting_projectile.get_structure_damage(), hitting_projectile.damage_flags(), hitting_projectile.damage_type, hitting_projectile.armor_penetration, hitting_projectile) /obj/machinery/camera/ex_act(severity) if(src.invuln) @@ -161,7 +167,7 @@ var/obj/O = hitting_atom if (O.throwforce >= src.toughness) visible_message(SPAN_WARNING("[src] was hit by [O].")) - take_damage(O.throwforce) + add_damage(O.throwforce, O.damage_flags(), O.damtype, O.armor_penetration, O) /obj/machinery/camera/proc/setViewRange(var/num = 7) src.view_range = num @@ -264,7 +270,7 @@ var/obj/item/I = attacking_item if (I.hitsound) playsound(loc, I.hitsound, I.get_clamped_volume(), 1, -1) - take_damage(attacking_item.force) + add_damage(attacking_item.force, attacking_item.damage_flags(), attacking_item.damtype, attacking_item.armor_penetration, attacking_item) return TRUE else return ..() @@ -281,17 +287,17 @@ set_status(!src.status) if (!(src.status)) if(user) - visible_message(SPAN_NOTICE(" [user] has deactivated [src]!")) + visible_message(SPAN_NOTICE("[user] has deactivated [src]!")) else - visible_message(SPAN_NOTICE(" [src] clicks and shuts down. ")) + visible_message(SPAN_NOTICE("[src] clicks and shuts down. ")) playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1) icon_state = "[initial(icon_state)]1" add_hiddenprint(user) else if(user) - visible_message(SPAN_NOTICE(" [user] has reactivated [src]!")) + visible_message(SPAN_NOTICE("[user] has reactivated [src]!")) else - visible_message(SPAN_NOTICE(" [src] clicks and reactivates itself. ")) + visible_message(SPAN_NOTICE("[src] clicks and reactivates itself. ")) playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1) icon_state = initial(icon_state) add_hiddenprint(user) @@ -303,9 +309,8 @@ GLOB.cameranet.update_visibility(src) -/obj/machinery/camera/proc/take_damage(var/force, var/message) - //prob(25) gives an average of 3-4 hits - if (force >= toughness && (force > toughness*4 || prob(25))) +/obj/machinery/camera/on_death(damage, damage_flags, damage_type, armor_penetration, obj/weapon) + if(!(stat & BROKEN)) destroy() //Used when someone breaks a camera diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index fe269c0ee37..f60c61fddfb 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -109,7 +109,7 @@ H.real_name = R.dna.real_name //Get the clone body ready - H.setCloneLoss(H.maxHealth - 50) + H.setCloneLoss(H.maxhealth - 50) H.adjustBrainLoss(100, 120) // Even if healed to full health, it will have some brain damage H.Paralyse(4) @@ -162,7 +162,7 @@ if(occupant.getCloneLoss() == 0) // Rare case, but theoretically possible return 100 - return between(0, 100 * (occupant.health - occupant.maxHealth * 75 / 100) / (occupant.maxHealth * (heal_level - 75) / 100), 100) + return between(0, 100 * (occupant.health - occupant.maxhealth * 75 / 100) / (occupant.maxhealth * (heal_level - 75) / 100), 100) //Grow clones to maturity then kick them out. FREELOADERS /obj/machinery/clonepod/process() diff --git a/code/game/machinery/computer/computer.dm b/code/game/machinery/computer/computer.dm index f782227bfb9..f37f54ef407 100644 --- a/code/game/machinery/computer/computer.dm +++ b/code/game/machinery/computer/computer.dm @@ -8,7 +8,7 @@ idle_power_usage = 300 active_power_usage = 300 clicksound = SFX_KEYBOARD - + maxhealth = OBJECT_HEALTH_MEDIUM /// The path to the circuit board type. If circuit==null, the computer can't be disassembled. var/circuit = null var/processing = 0 @@ -173,6 +173,20 @@ text = replacetext(text, "\n", "
") return text +/obj/machinery/computer/on_death(damage, damage_flags, damage_type, armor_penetration, obj/weapon) + var/obj/structure/computerframe/A = new /obj/structure/computerframe(loc) + A.anchored = TRUE + if(prob(50)) + var/obj/item/circuitboard/M = new circuit(A) + A.circuit = M + else + new /obj/effect/decal/cleanable/blood/oil(loc) + new /obj/item/trash/broken_electronics(loc) + new /obj/item/material/shard(loc) + new /obj/effect/decal/cleanable/blood/oil(loc) + spark(A, 5, GLOB.alldirs) + . = ..() + /obj/machinery/computer/attackby(obj/item/attacking_item, mob/user) if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER) if(circuit) diff --git a/code/game/machinery/deployable.dm b/code/game/machinery/deployable.dm index ba65f4b3a67..e3812ac3f09 100644 --- a/code/game/machinery/deployable.dm +++ b/code/game/machinery/deployable.dm @@ -17,10 +17,9 @@ Deployable Kits build_amt = 5 anchored = TRUE density = TRUE + maxhealth = OBJECT_HEALTH_LOW var/force_material - var/health = 100 - var/maxhealth = 100 /obj/structure/blocker/Initialize(mapload, var/material_name) . = ..() @@ -38,8 +37,8 @@ Deployable Kits name = "[material.display_name] [name]" desc = "This space is blocked off by a barricade made of [material.display_name]." color = material.icon_colour - maxhealth = material.integrity - health = maxhealth + set_maxhealth(material.integrity) + set_health(maxhealth) /obj/structure/blocker/bullet_act(obj/projectile/hitting_projectile, def_zone, piercing_hit) . = ..() @@ -71,7 +70,7 @@ Deployable Kits user.visible_message("[user] begins to repair \the [src].", SPAN_NOTICE("You begin to repair \the [src].")) if(I.use_tool(src, user, 20, volume = 50) && health < maxhealth) if(D.use(1)) - health = maxhealth + set_health(maxhealth) visible_message("[user] repairs \the [src].", SPAN_NOTICE("You repair \the [src].")) return TRUE else @@ -146,8 +145,7 @@ Deployable Kits anchored = 0.0 density = 1.0 icon_state = "barrier" - var/health = 100.0 - var/maxhealth = 100.0 + maxhealth = OBJECT_HEALTH_LOW var/locked = 0.0 // req_access = list(ACCESS_MAINT_TUNNELS) diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 7e050b9951a..fe5b9b03e05 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -345,7 +345,7 @@ icon_state = "preview_glass" glass = 1 hitsound = 'sound/effects/glass_hit.ogg' - maxhealth = 300 + maxhealth = OBJECT_HEALTH_VERY_HIGH explosion_resistance = 5 opacity = FALSE panel_visible_while_open = TRUE @@ -453,7 +453,7 @@ return return attackby(null, user) -/obj/machinery/door/airlock/centcom/take_damage() +/obj/machinery/door/airlock/centcom/add_damage(damage, damage_flags, damage_type, armor_penetration, obj/weapon, message) return // No. /obj/machinery/door/airlock/centcom/emag_act() @@ -493,7 +493,7 @@ return return attackby(null, user) -/obj/machinery/door/airlock/glass_centcom/take_damage() +/obj/machinery/door/airlock/glass_centcom/add_damage(damage, damage_flags, damage_type, armor_penetration, obj/weapon, message) return // No. /obj/machinery/door/airlock/glass_centcom/emag_act() @@ -532,7 +532,7 @@ door_color = COLOR_GRAY40 explosion_resistance = 20 secured_wires = TRUE - maxhealth = 600 + maxhealth = OBJECT_HEALTH_EXTREMELY_HIGH features_powerloss_manual_override = FALSE ai_bolting_delay = 10 ai_unbolt_delay = 5 @@ -546,7 +546,7 @@ name = "freezer airlock" door_color = "#b9b8b6" desc = "An extra thick, double-insulated door to preserve the cold atmosphere. Keep closed at all times." - maxhealth = 800 + maxhealth = OBJECT_HEALTH_EXTREMELY_HIGH opacity = TRUE paintable = AIRLOCK_PAINTABLE_MAIN open_duration = 20 @@ -592,7 +592,7 @@ name = "glass airlock" icon_state = "cmd_glass" hitsound = 'sound/effects/glass_hit.ogg' - maxhealth = 300 + maxhealth = OBJECT_HEALTH_HIGH explosion_resistance = 5 opacity = FALSE glass = 1 @@ -606,7 +606,7 @@ name = "glass airlock" icon_state = "eng_glass" hitsound = 'sound/effects/glass_hit.ogg' - maxhealth = 300 + maxhealth = OBJECT_HEALTH_VERY_HIGH explosion_resistance = 5 opacity = FALSE glass = 1 @@ -626,7 +626,7 @@ /obj/machinery/door/airlock/glass_medical name = "glass airlock" hitsound = 'sound/effects/glass_hit.ogg' - maxhealth = 300 + maxhealth = OBJECT_HEALTH_VERY_HIGH explosion_resistance = 5 opacity = FALSE glass = 1 @@ -661,7 +661,7 @@ name = "glass airlock" icon_state = "sci_glass" hitsound = 'sound/effects/glass_hit.ogg' - maxhealth = 300 + maxhealth = OBJECT_HEALTH_VERY_HIGH explosion_resistance = 5 opacity = FALSE glass = 1 @@ -677,7 +677,7 @@ stripe_color = "#5E340B" icon_state = "ops_glass" hitsound = 'sound/effects/glass_hit.ogg' - maxhealth = 300 + maxhealth = OBJECT_HEALTH_VERY_HIGH explosion_resistance = 5 opacity = FALSE glass = 1 @@ -687,7 +687,7 @@ /obj/machinery/door/airlock/glass_atmos name = "glass airlock" hitsound = 'sound/effects/glass_hit.ogg' - maxhealth = 300 + maxhealth = OBJECT_HEALTH_VERY_HIGH explosion_resistance = 5 opacity = FALSE glass = 1 @@ -737,7 +737,7 @@ name = "Diamond Airlock" door_color = COLOR_DIAMOND mineral = "diamond" - maxhealth = 2000 + maxhealth = OBJECT_HEALTH_EXTREMELY_HIGH /obj/machinery/door/airlock/sandstone name = "Sandstone Airlock" @@ -759,7 +759,7 @@ explosion_resistance = 20 secured_wires = TRUE assembly_type = /obj/structure/door_assembly/door_assembly_highsecurity - maxhealth = 600 + maxhealth = OBJECT_HEALTH_EXTREMELY_HIGH features_powerloss_manual_override = FALSE ai_bolting_delay = 10 ai_unbolt_delay = 5 @@ -771,7 +771,7 @@ door_color = COLOR_PURPLE_GRAY explosion_resistance = 20 secured_wires = TRUE - maxhealth = 600 + maxhealth = OBJECT_HEALTH_EXTREMELY_HIGH features_powerloss_manual_override = FALSE hashatch = FALSE @@ -781,9 +781,13 @@ door_frame_color = "#7E6A40" explosion_resistance = 20 secured_wires = TRUE - maxhealth = 600 + maxhealth = OBJECT_HEALTH_EXTREMELY_HIGH features_powerloss_manual_override = FALSE hashatch = FALSE + armor = list( + MELEE = ARMOR_MELEE_MINOR, + BULLET = ARMOR_BALLISTIC_MINOR + ) /// Placeholder object until it gets new sprites. /obj/machinery/door/airlock/diona/external @@ -1436,7 +1440,7 @@ About the new airlock wires panel: user.visible_message(SPAN_DANGER("\The [user] forcefully strikes \the [src] with their [H.default_attack.attack_name]!")) user.do_attack_animation(src, null) playsound(loc, hitsound, 60, TRUE) - take_damage(H.default_attack.attack_door) + add_damage(H.default_attack.attack_door) user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) return @@ -1835,7 +1839,7 @@ About the new airlock wires panel: ) if (do_after(user, 5 SECONDS)) playsound(src, 'sound/weapons/smash.ogg', 100, TRUE, extrarange = MEDIUM_RANGE_SOUND_EXTRARANGE) - take_damage(50) + add_damage(50) set_broken() to_chat(user, SPAN_NOTICE("The hydraulic strength easily overcomes the resistance of the airlock's motors opening the way ahead!")) open(1) @@ -1906,7 +1910,7 @@ About the new airlock wires panel: sleep(1 SECONDS) CreateAssembly() ChainSawVar.cutting = 0 - take_damage(50) + add_damage(50) else if(locked) ChainSawVar.cutting = 1 user.visible_message(\ @@ -1922,7 +1926,7 @@ About the new airlock wires panel: ) unlock(1) ChainSawVar.cutting = 0 - take_damage(50) + add_damage(50) else ChainSawVar.cutting = 1 user.visible_message(\ @@ -1937,7 +1941,7 @@ About the new airlock wires panel: SPAN_NOTICE("You hear a metal clank and some sparks.")\ ) open(1) - take_damage(50) + add_damage(50) ChainSawVar.cutting = 0 return TRUE else @@ -2028,8 +2032,7 @@ About the new airlock wires panel: /obj/machinery/portable_atmospherics/canister/airlock_crush(var/crush_damage) . = ..() - health -= crush_damage - healthcheck() + add_damage(crush_damage) /obj/effect/energy_field/airlock_crush(var/crush_damage) damage_field(crush_damage) @@ -2092,7 +2095,7 @@ About the new airlock wires panel: open_hatch(AM) has_opened_hatch = TRUE else if(AM.airlock_crush(DOOR_CRUSH_DAMAGE)) - take_damage(DOOR_CRUSH_DAMAGE) + add_damage(DOOR_CRUSH_DAMAGE) use_power_oneoff(360) //360 W seems much more appropriate for an actuator moving an industrial door capable of crushing people if(arePowerSystemsOn()) playsound(src.loc, close_sound_powered, 100, TRUE, extrarange = SHORT_RANGE_SOUND_EXTRARANGE) diff --git a/code/game/machinery/doors/blast_door.dm b/code/game/machinery/doors/blast_door.dm index 7a7eda107c0..f3cc1fb5a1d 100644 --- a/code/game/machinery/doors/blast_door.dm +++ b/code/game/machinery/doors/blast_door.dm @@ -189,14 +189,14 @@ for(var/turf/turf in locs) for(var/atom/movable/AM in turf) if(AM.airlock_crush(damage)) - take_damage(damage*0.2) + add_damage(damage * 0.2) /** * Fully repairs the blast door. */ /obj/machinery/door/blast/proc/repair() - health = maxhealth + set_health(maxhealth) if(stat & BROKEN) stat &= ~BROKEN @@ -232,7 +232,7 @@ icon_state_closed = "pdoor1" icon_state_closing = "pdoorc1" icon_state = "pdoor1" - maxhealth = 600 + maxhealth = OBJECT_HEALTH_EXTREMELY_HIGH block_air_zones = 1 /obj/machinery/door/blast/regular/open @@ -267,7 +267,7 @@ icon_state_closed = "pdoor1" icon_state_closing = "pdoorc1" icon_state = "pdoor1" - maxhealth = 1000 + maxhealth = OBJECT_HEALTH_EXTREMELY_HIGH block_air_zones = 1 /obj/machinery/door/blast/odin/open @@ -283,7 +283,7 @@ /obj/machinery/door/blast/odin/ex_act(var/severity) return -/obj/machinery/door/blast/odin/take_damage(var/damage) +/obj/machinery/door/blast/odin/add_damage(damage, damage_flags, damage_type, armor_penetration, obj/weapon, message) return /obj/machinery/door/blast/odin/shuttle diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 86fdd0dddc6..23571eaaa53 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -11,6 +11,16 @@ density = TRUE layer = CLOSED_DOOR_LAYER dir = SOUTH + hitsound = 'sound/weapons/smash.ogg' //sound door makes when hit with a weapon + armor = list( + MELEE = ARMOR_MELEE_RESISTANT, + BULLET = ARMOR_BALLISTIC_SMALL, + LASER = ARMOR_LASER_PISTOL + ) + var/hitsound_light = 'sound/effects/glass_hit.ogg'//Sound door makes when hit very gently + + maxhealth = OBJECT_HEALTH_VERY_HIGH + var/open_layer = OPEN_DOOR_LAYER var/closed_layer = CLOSED_DOOR_LAYER @@ -35,14 +45,10 @@ var/air_properties_vary_with_direction = 0 /// Integer. Corresponds to dirs. If opened from this dir, no access is required. var/unres_dir = null - var/maxhealth = 300 - var/health /// Integer. How many strong hits it takes to destroy the door. var/destroy_hits = 10 /// Integer. Minimum amount of force needed to damage the door with a melee weapon. var/min_force = 10 - var/hitsound = 'sound/weapons/smash.ogg' //sound door makes when hit with a weapon - var/hitsound_light = 'sound/effects/glass_hit.ogg'//Sound door makes when hit very gently var/block_air_zones = 1 //If set, air zones cannot merge across the door even when it is opened. var/open_duration = 150//How long it stays open @@ -61,15 +67,6 @@ can_astar_pass = CANASTARPASS_ALWAYS_PROC -/obj/machinery/door/condition_hints(mob/user, distance, is_adjacent) - . = ..() - if(src.health < src.maxhealth / 4) - . += SPAN_WARNING("\The [src] looks like it's about to break!") - else if(src.health < src.maxhealth / 2) - . += SPAN_WARNING("\The [src] looks seriously damaged!") - else if(src.health < src.maxhealth * 3/4) - . += SPAN_WARNING("\The [src] shows signs of damage!") - /obj/machinery/door/mouse_drop_receive(atom/dropping, mob/user, params) //Adds the component only once. We do it here & not in Initialize() because there are tons of walls & we don't want to add to their init times LoadComponent(/datum/component/leanable, dropping) @@ -78,7 +75,7 @@ if(damage >= 10) visible_message(SPAN_DANGER("\The [user] smashes into the [src]!")) playsound(src.loc, hitsound, 60, 1) - take_damage(damage) + add_damage(damage) else visible_message(SPAN_NOTICE("\The [user] bonks \the [src] harmlessly.")) playsound(src.loc, hitsound_light, 8, TRUE, extrarange = SHORT_RANGE_SOUND_EXTRARANGE) @@ -95,8 +92,6 @@ explosion_resistance = 0 SetBounds() - health = maxhealth - update_nearby_tiles(need_rebuild=1) if(turf_hand_priority) AddComponent(/datum/component/turf_hand, turf_hand_priority) @@ -273,9 +268,7 @@ qdel(src) if(damage) - //cap projectile damage so that there's still a minimum number of hits required to break the door - take_damage(min(damage, 100)) - + add_damage(damage) /obj/machinery/door/hitby(atom/movable/hitting_atom, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) ..() @@ -294,7 +287,7 @@ if (tforce < 20)//No more stupidly loud banging sound from throwing a piece of paper at a door volume *= (tforce / 20) playsound(src.loc, hitsound, volume, TRUE) - take_damage(tforce) + add_damage(tforce) /obj/machinery/door/attack_ai(mob/user) if(!ai_can_interact(user)) @@ -388,7 +381,7 @@ else user.visible_message(SPAN_DANGER("\The [user] forcefully strikes \the [src] with \the [W]!")) playsound(src.loc, hitsound, W.get_clamped_volume(), TRUE, extrarange = MEDIUM_RANGE_SOUND_EXTRARANGE) - take_damage(W.force) + add_damage(W.force, W.damage_flags(), W.damtype, W.armor_penetration, W) return TRUE if(src.operating > 0 || isrobot(user)) @@ -413,12 +406,10 @@ open(1) return 1 -/obj/machinery/door/proc/take_damage(var/damage, message = TRUE) - var/initialhealth = src.health - src.health = max(0, src.health - damage) - if(src.health <= 0 && initialhealth > 0) - src.set_broken() - else if(message) +/obj/machinery/door/add_damage(damage, damage_flags, damage_type, armor_penetration, obj/weapon, message = TRUE) + var/initialhealth = health + . = ..() + if(message) if(src.health < src.maxhealth / 4 && initialhealth >= src.maxhealth / 4) visible_message(SPAN_WARNING("\The [src] looks like it's about to break!")) else if(src.health < src.maxhealth / 2 && initialhealth >= src.maxhealth / 2) @@ -426,13 +417,14 @@ else if(src.health < src.maxhealth * 3/4 && initialhealth >= src.maxhealth * 3/4) visible_message(SPAN_WARNING("\The [src] shows signs of damage!")) update_icon() - return + +/obj/machinery/door/on_death(damage, damage_flags, damage_type, armor_penetration, obj/weapon) + set_broken() /obj/machinery/door/proc/set_broken() stat |= BROKEN visible_message(SPAN_WARNING("[src] breaks!")) update_icon() - return /obj/machinery/door/emp_act(severity) . = ..() @@ -453,7 +445,7 @@ var/damage = rand(300,600) if (bolted) damage *= 0.8 //Bolted doors are a bit tougher - take_damage(damage, FALSE) + add_damage(damage, message = FALSE) if(2.0) if((!bolted && prob(25)) || prob(20)) qdel(src) @@ -461,14 +453,14 @@ var/damage = rand(150,300) if (bolted) damage *= 0.8 //Bolted doors are a bit tougher - take_damage(damage, FALSE) + add_damage(damage, message = FALSE) if(3.0) if(prob(80)) spark(src, 2, GLOB.alldirs) var/damage = rand(100,150) if (bolted) damage *= 0.8 - take_damage(damage, FALSE) + add_damage(damage, message = FALSE) if (health <= 0) qdel(src) diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index a9b7fec7af2..b793171437d 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -8,8 +8,7 @@ layer = SIDE_WINDOW_LAYER min_force = 4 hitsound = 'sound/effects/glass_hit.ogg' - maxhealth = 150 //If you change this, consiter changing ../door/window/brigdoor/ health at the bottom of this .dm file - health = 150 + maxhealth = OBJECT_HEALTH_MEDIUM visible = 0.0 atom_flags = ATOM_FLAG_CHECKS_BORDER opacity = 0 @@ -35,18 +34,6 @@ else icon_state = "[base_state]open" -/obj/machinery/door/window/proc/shatter(var/display_message = 1) - new /obj/item/trash/broken_electronics(loc) - new /obj/item/material/shard(loc) - var/obj/item/stack/cable_coil/CC = new /obj/item/stack/cable_coil(loc) - CC.amount = 2 - CC.update_icon() - src.density = FALSE - playsound(src, SFX_BREAK_GLASS, 70, 1) - if(display_message) - visible_message("[src] shatters!") - qdel(src) - /obj/machinery/door/window/Destroy() density = FALSE update_nearby_tiles() @@ -139,11 +126,17 @@ operating = FALSE return 1 -/obj/machinery/door/window/take_damage(var/damage) - src.health = max(0, src.health - damage) - if (src.health <= 0) - shatter() - return +/obj/machinery/door/window/on_death(damage, damage_flags, damage_type, armor_penetration, obj/weapon, display_message = FALSE) + new /obj/item/trash/broken_electronics(loc) + new /obj/item/material/shard(loc) + var/obj/item/stack/cable_coil/CC = new /obj/item/stack/cable_coil(loc) + CC.amount = 2 + CC.update_icon() + src.density = FALSE + playsound(src, SFX_BREAK_GLASS, 70, 1) + if(display_message) + visible_message("[src] shatters!") + qdel(src) /obj/machinery/door/window/attack_hand(mob/user as mob) var/mob/living/carbon/human/H = user @@ -152,7 +145,7 @@ playsound(src.loc, 'sound/effects/glass_hit.ogg', 75, 1) user.visible_message(SPAN_DANGER("[user] smashes against [src]."), SPAN_DANGER("You smash against [src]!")) - take_damage(25) + add_damage(25) return else return attackby(null, user) @@ -212,7 +205,7 @@ playsound(src.loc, 'sound/effects/glass_hit.ogg', 75, 1) visible_message(SPAN_DANGER("[src] was hit by [attacking_item].")) if(attacking_item.damtype == DAMAGE_BRUTE || attacking_item.damtype == DAMAGE_BURN) - take_damage(aforce) + add_damage(aforce, attacking_item.damage_flags(), attacking_item.damtype, attacking_item.armor_penetration, attacking_item) return TRUE if(!istype(attacking_item, /obj/item/forensics)) @@ -238,10 +231,9 @@ icon_state = "leftsecure" base_state = "leftsecure" req_access = list(ACCESS_SECURITY) - var/id = null - maxhealth = 300 - health = 300.0 //Stronger doors for prison (regular window door health is 150) + maxhealth = OBJECT_HEALTH_VERY_HIGH + var/id = null /obj/machinery/door/window/brigdoor/allowed(mob/M) if(!operable()) // Brigdoors are the exception to the "fail open" windoor - they lock closed diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index b5f0d3fe340..60c1acfe8fa 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -87,6 +87,9 @@ Class Procs: layer = STRUCTURE_LAYER init_flags = INIT_MACHINERY_PROCESS_SELF pass_flags_self = PASSMACHINE | LETPASSCLICKS + destroy_sound = 'sound/effects/meteorimpact.ogg' + hitsound = 'sound/effects/metalhit.ogg' + should_use_health = TRUE /** * 'stat' = 'state'. Controlled by a bitflag, differentiates between a few different possible states including the machine being broken or unpowered. @@ -231,6 +234,30 @@ Class Procs: return ..() +/obj/machinery/on_death(damage, damage_flags, damage_type, armor_penetration, obj/weapon) + var/turf/current_turf = get_turf(src) + spark(current_turf, 3, GLOB.alldirs) + if(component_parts) + for(var/obj/item/stock_parts/part in component_parts) + if(prob(25)) + part.forceMove(current_turf) + component_parts -= part + var/obj/item/circuitboard/board = locate() in component_parts + if(istype(board)) + if(prob(25)) + board.forceMove(current_turf) + component_parts -= board + else + new /obj/item/trash/broken_electronics(current_turf) + var/metal_to_spawn = 0 + for(var/i = 1 to 2) + if(prob(50)) + metal_to_spawn++ + if(metal_to_spawn) + new /obj/item/stack/material/steel(get_turf(src), metal_to_spawn) + . = ..() + + // /obj/machinery/proc/process_all() // /* Uncomment this if/when you need component processing // if(processing_flags & MACHINERY_PROCESS_COMPONENTS) @@ -263,18 +290,12 @@ Class Procs: /obj/machinery/ex_act(severity) switch(severity) - if(1.0) - qdel(src) - return - if(2.0) - if (prob(50)) - qdel(src) - return - if(3.0) - if (prob(25)) - qdel(src) - return - return + if(1) + add_damage(maxhealth) + if(2) + add_damage(maxhealth * 0.5) + if(3) + add_damage(maxhealth * 0.25) /** * Check to see if the machine is operable @@ -371,7 +392,6 @@ Class Procs: user.visible_message("[user] removes \the [signaler] from \the [src].", SPAN_NOTICE("You remove \the [signaler] from \the [src]."), range = 3) user.put_in_hands(detach_signaler()) return TRUE - return ..() /obj/machinery/proc/detach_signaler(var/turf/detach_turf) @@ -573,6 +593,8 @@ Class Procs: if(hitting_projectile.get_structure_damage() > 5) bullet_ping(hitting_projectile) + add_damage(hitting_projectile.damage, hitting_projectile.damage_flags(), hitting_projectile.damage_type, hitting_projectile.armor_penetration, hitting_projectile) + /obj/machinery/proc/do_hair_pull(mob/living/carbon/human/H) if(stat & (NOPOWER|BROKEN)) return diff --git a/code/game/machinery/mech_recharger.dm b/code/game/machinery/mech_recharger.dm index e71a32a23f9..f1be12e7d23 100644 --- a/code/game/machinery/mech_recharger.dm +++ b/code/game/machinery/mech_recharger.dm @@ -109,7 +109,7 @@ // An ugly proc, but apparently mechs don't have maxhealth var of any kind. /obj/machinery/mech_recharger/proc/fully_repaired() - return charging && (charging.health == charging.maxHealth) + return charging && (charging.health == charging.maxhealth) /obj/machinery/mech_recharger/proc/start_charging(var/mob/living/heavy_vehicle/M) var/no_power = FALSE diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index 13c9b217112..3deb4a3cbe0 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -22,19 +22,23 @@ /// drains power from the EQUIPMENT channel power_channel = AREA_USAGE_EQUIP + maxhealth = OBJECT_HEALTH_MEDIUM + req_one_access = list(ACCESS_SECURITY, ACCESS_HEADS) light_range = 3 light_power = 2 + armor = list( + MELEE = ARMOR_MELEE_KEVLAR, + BULLET = ARMOR_BALLISTIC_PISTOL, + LASER = ARMOR_LASER_KEVLAR + ) + /// if the turret cover is "open" and the turret is raised var/raised = 0 /// if the turret is currently opening or closing its cover var/raising= 0 - /// the turret's health - var/health = 80 - /// turrets maximal health. - var/maxhealth = 80 /// if 1 the turret slowly repairs itself. var/auto_repair = 0 /// if the turret's behaviour control access is locked @@ -109,18 +113,15 @@ var/old_angle = 0 -/obj/machinery/porta_turret/condition_hints(mob/user, distance, is_adjacent) - . += ..() - if(!health) - . += SPAN_DANGER("\The [src] is destroyed!") - else if(health / maxhealth < 0.35) - . += SPAN_DANGER("\The [src] is critically damaged!") +/obj/machinery/porta_turret/get_damage_condition_hints(mob/user, distance, is_adjacent) + if(health / maxhealth < 0.35) + . = SPAN_DANGER("\The [src] is critically damaged!") else if(health / maxhealth < 0.6) - . += SPAN_ALERT("\The [src] is badly damaged!") + . = SPAN_ALERT("\The [src] is badly damaged!") else if(health / maxhealth < 1) - . += SPAN_NOTICE("\The [src] is slightly damaged.") + . = SPAN_NOTICE("\The [src] is slightly damaged.") else - . += "\The [src] is in perfect condition." + . = "\The [src] is in perfect condition." /obj/machinery/porta_turret/mechanics_hints(mob/user, distance, is_adjacent) . += ..() @@ -426,8 +427,7 @@ if(QDELETED(src) || !WT.isOn()) return TRUE playsound(src.loc, 'sound/items/welder_pry.ogg', 50, 1) - health += maxhealth / 3 - health = min(maxhealth, health) + add_health(maxhealth * 0.3) else to_chat(user, SPAN_NOTICE("You fail to complete the welding.")) else @@ -436,7 +436,7 @@ else //if the turret was attacked with the intention of harming it: user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) - take_damage(attacking_item.force * 0.5) + add_damage(attacking_item.force * 0.5) if(attacking_item.force * 0.5 > 1) //if the force of impact dealt at least 1 damage, the turret gets pissed off if(!attacked && !emagged) attacked = 1 @@ -477,17 +477,13 @@ enabled = 1 //turns it back on. The cover popUp() popDown() are automatically called in process(), no need to define it here return 1 -/obj/machinery/porta_turret/proc/take_damage(var/force) +/obj/machinery/porta_turret/add_damage(damage, damage_flags, damage_type, armor_penetration, obj/weapon) if(!raised && !raising) - force = force / 8 - if(force < 5) - return + damage = damage / 8 - health -= force - if (force > 5 && prob(45)) + if (damage > 5 && prob(45)) spark_system.queue() - if(health <= 0) - die() //the death process :( + . = ..() /obj/machinery/porta_turret/bullet_act(obj/projectile/hitting_projectile, def_zone, piercing_hit) var/damage = hitting_projectile.get_structure_damage() @@ -504,7 +500,7 @@ if(. != BULLET_ACT_HIT) return . - take_damage(damage) + add_damage(damage) /obj/machinery/porta_turret/emp_act(severity) . = ..() @@ -535,11 +531,11 @@ if (prob(25)) qdel(src) else - take_damage(initial(health) * 8) //should instakill most turrets + add_damage(maxhealth * 8) //should instakill most turrets if (3) - take_damage(initial(health) * 8 / 3) + add_damage(maxhealth * 8 / 3) -/obj/machinery/porta_turret/proc/die() //called when the turret dies, ie, health <= 0 +/obj/machinery/porta_turret/on_death(damage, damage_flags, damage_type, armor_penetration, obj/weapon) health = 0 stat |= BROKEN //enables the BROKEN bit spark_system.queue() //creates some sparks because they look cool @@ -555,7 +551,7 @@ if(auto_repair && (health < maxhealth)) use_power_oneoff(20000) - health = min(health+1, maxhealth) // 1HP for 20kJ + add_health(1) if(raising) return // Don't try to do target acquisition while we're resetting diff --git a/code/game/machinery/telecomms/telecommunications.dm b/code/game/machinery/telecomms/telecommunications.dm index ffbd366aaaa..a1e2412b965 100644 --- a/code/game/machinery/telecomms/telecommunications.dm +++ b/code/game/machinery/telecomms/telecommunications.dm @@ -22,6 +22,7 @@ anchored = TRUE idle_power_usage = 600 // WATTS active_power_usage = 15 KILO WATTS + hitsound = 'sound/weapons/smash.ogg' /// List of machines this machine is linked to var/list/links = list() @@ -56,8 +57,6 @@ /// Is it a hidden machine? var/hide = FALSE - var/hitsound = 'sound/weapons/smash.ogg' - /// Overmap ranges in terms of map tile distance, used by receivers, relays, and broadcasters (and AIOs) var/overmap_range = 0 @@ -78,13 +77,13 @@ var/current_damage = integrity / initial(integrity) switch(current_damage) if(0 to 0.2) - state = SPAN_DANGER("The machine is on its last legs!") + state = SPAN_DANGER("The machine's components are on their last legs!") if(0.2 to 0.4) - state = SPAN_WARNING("The machine looks seriously damaged.") + state = SPAN_WARNING("The machine's components look seriously damaged.") if(0.4 to 0.8) - state = SPAN_WARNING("The machine's condition appears somewhat degraded.") + state = SPAN_WARNING("The machine's components appear somewhat degraded.") if(0.8 to 1) - state = SPAN_NOTICE("The machine shows some indications of minor damage.") + state = SPAN_NOTICE("The machine's components show some indications of minor damage.") . += state /obj/machinery/telecomms/mechanics_hints(mob/user, distance, is_adjacent) diff --git a/code/game/objects/effects/spiders.dm b/code/game/objects/effects/spiders.dm index 02c0d1a77c7..e02e26cc56c 100644 --- a/code/game/objects/effects/spiders.dm +++ b/code/game/objects/effects/spiders.dm @@ -6,7 +6,7 @@ anchored = TRUE density = FALSE mouse_opacity = MOUSE_OPACITY_ICON - var/health = 15 + maxhealth = OBJECT_HEALTH_FRAGILE //similar to weeds, but only barfed out by nurses manually /obj/effect/spider/ex_act(severity) @@ -34,27 +34,20 @@ user.do_attack_animation(src) playsound(loc, attacking_item.hitsound, 50, 1, -1) - health -= damage - healthcheck() + add_damage(damage) /obj/effect/spider/bullet_act(obj/projectile/hitting_projectile, def_zone, piercing_hit) . = ..() if(. != BULLET_ACT_HIT) return . - health -= hitting_projectile.get_structure_damage() - healthcheck() - -/obj/effect/spider/proc/healthcheck() - if(health <= 0) - qdel(src) + add_damage(hitting_projectile.get_structure_damage()) /obj/effect/spider/fire_act(exposed_temperature, exposed_volume) . = ..() if(exposed_temperature > 300 + T0C) - health -= 5 - healthcheck() + add_damage(5) /obj/effect/spider/stickyweb icon_state = "stickyweb1" @@ -89,7 +82,7 @@ name = "egg cluster" desc = "They seem to pulse slightly with an inner life." icon_state = "eggs" - health = 10 + maxhealth = OBJECT_HEALTH_FRAGILE var/amount_grown = 0 /obj/effect/spider/eggcluster/Initialize(var/mapload, var/atom/parent) @@ -119,11 +112,6 @@ new /obj/effect/spider/spiderling(src.loc, src, 0.75) qdel(src) -/obj/effect/spider/eggcluster/proc/take_damage(var/damage) - health -= damage - if(health <= 0) - qdel(src) - /obj/effect/spider/spiderling name = "greimorian larva" desc = "A small, agile alien creature. It oozes some disgusting slime." @@ -133,7 +121,7 @@ icon_state = "spiderling" anchored = FALSE layer = OPEN_DOOR_LAYER // 2.7 - health = 3 + maxhealth = 3 var/last_itch = 0 /// % chance that the spiderling will eventually turn into a fully-grown greimorian. var/can_mature_chance = 50 @@ -185,10 +173,6 @@ new /obj/effect/decal/cleanable/spiderling_remains(loc) qdel(src) -/obj/effect/spider/spiderling/healthcheck() - if(health <= 0) - die() - /obj/effect/spider/spiderling/process() if(travelling_in_vent) if(istype(src.loc, /turf)) @@ -291,11 +275,10 @@ name = "cocoon" desc = "Something wrapped in silky greimorian web" icon_state = "cocoon1" - health = 60 + maxhealth = OBJECT_HEALTH_VERY_LOW /obj/effect/spider/cocoon/Initialize() . = ..() - icon_state = pick("cocoon1","cocoon2","cocoon3") /obj/effect/spider/cocoon/Destroy() diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index d3c1b748fca..ae957de8d17 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -4,6 +4,8 @@ w_class = WEIGHT_CLASS_NORMAL light_system = MOVABLE_LIGHT blocks_emissive = EMISSIVE_BLOCK_GENERIC + /// Generic hit sound + hitsound = SFX_SWING_HIT /// This saves our blood splatter overlay, which will be processed not to go over the edges of the sprite var/image/blood_overlay @@ -11,13 +13,9 @@ var/randpixel = 6 var/abstract = 0 var/r_speed = 1.0 - var/health var/burn_point var/burning - /// Generic hit sound - var/hitsound = SFX_SWING_HIT - var/storage_cost var/storage_slot_sort_by_name = FALSE @@ -151,10 +149,6 @@ /// Sound uses when dropping the item, or when its thrown. var/drop_sound = SFX_DROP - var/list/armor - /// How fast armor will degrade, multiplier to blocked damage to get armor damage value. - var/armor_degradation_speed - //Item_state definition moved to /obj //var/item_state = null // Used to specify the item state for the on-mob overlays. @@ -245,11 +239,6 @@ /obj/item/Initialize(mapload, ...) . = ..() - if(islist(armor)) - for(var/type in armor) - if(armor[type]) - AddComponent(/datum/component/armor, armor) - break if(item_flags & ITEM_FLAG_HELD_MAP_TEXT) set_initial_maptext() check_maptext() @@ -345,7 +334,7 @@ . = ..(user, distance, is_adjacent, "It is a [size] item.", get_extended = get_extended) var/datum/component/armor/armor_component = GetComponent(/datum/component/armor) - if(armor_component) + if(armor_component && !armor_component.hidden) . += FONT_SMALL(SPAN_NOTICE("\[?\] This item has armor values. \[Show Armor Values\]")) /obj/item/Topic(href, href_list) diff --git a/code/game/objects/items/weapons/storage/boxes.dm b/code/game/objects/items/weapons/storage/boxes.dm index ca1eca34511..2a9a63433d9 100644 --- a/code/game/objects/items/weapons/storage/boxes.dm +++ b/code/game/objects/items/weapons/storage/boxes.dm @@ -29,6 +29,7 @@ icon_state = "box" item_state = "box" contained_sprite = TRUE + maxhealth = OBJECT_HEALTH_EXTREMELY_LOW color = COLOR_CARDBOARD var/label = "label" var/illustration = "writing" @@ -39,19 +40,17 @@ ///Boolean, if set, can be crushed into a trash item when empty var/trash = null - var/maxHealth = 20 //health is already defined use_sound = 'sound/items/storage/box.ogg' drop_sound = 'sound/items/drop/cardboardbox.ogg' pickup_sound = 'sound/items/pickup/cardboardbox.ogg' var/chewable = TRUE -/obj/item/storage/box/condition_hints(mob/user, distance, is_adjacent) - . += ..() - if (health < maxHealth) - if (health >= (maxHealth * 0.5)) - . += SPAN_WARNING("It is slightly torn.") +/obj/item/storage/box/get_damage_condition_hints(mob/user, distance, is_adjacent) + if (health < maxhealth) + if (health >= (maxhealth * 0.5)) + . = SPAN_WARNING("It is slightly torn.") else - . += SPAN_DANGER("It is full of tears and holes.") + . = SPAN_DANGER("It is full of tears and holes.") /obj/item/storage/box/mechanics_hints(mob/user, distance, is_adjacent) . += ..() @@ -74,7 +73,8 @@ /obj/item/storage/box/Initialize() . = ..() - health = maxHealth + if(illustration) + AddOverlays(illustration) update_icon() /obj/item/storage/box/proc/damage(var/severity) diff --git a/code/game/objects/items/weapons/storage/fancy.dm b/code/game/objects/items/weapons/storage/fancy.dm index 1ac9b1cff72..9ab3174d76d 100644 --- a/code/game/objects/items/weapons/storage/fancy.dm +++ b/code/game/objects/items/weapons/storage/fancy.dm @@ -556,7 +556,6 @@ /obj/item/reagent_containers/food/snacks/truffle/random ) starts_with = list(/obj/item/reagent_containers/food/snacks/truffle/random = 8) - maxHealth = 40 /obj/item/storage/box/fancy/chocolate_box/fill() for(var/i=1; i <= storage_slots; i++) diff --git a/code/game/objects/items/weapons/weaponry.dm b/code/game/objects/items/weapons/weaponry.dm index bc241ec83ea..a11c21edc2f 100644 --- a/code/game/objects/items/weapons/weaponry.dm +++ b/code/game/objects/items/weapons/weaponry.dm @@ -44,7 +44,8 @@ anchored = TRUE mouse_opacity = MOUSE_OPACITY_ICON - var/health = 50 + maxhealth = OBJECT_HEALTH_VERY_LOW + var/mob/living/affecting = null //Who it is currently affecting, if anyone. /obj/effect/energy_net/Initialize() diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index f112445f28b..1f18bc43479 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -4,64 +4,76 @@ /// Used to store information about the contents of the object. var/list/matter - /// Whether the object can be recycled (eaten) by something like the Autolathe + /// Whether the object can be recycled (eaten) by something like the Autolathe. var/recyclable = FALSE /// Size of the object. var/w_class /// Used by R&D to determine what research bonuses it grants. var/list/origin_tech = null - /// Universal "unacidabliness" var, here so you can use it in any obj. - var/unacidable = FALSE + /// Universal "unacidabliness" var, here so you can use it in any obj. As xeno acid is gone, this is now only used for chemistry acid. + var/unacidable = 0 /// Special flags such as whether or not this object can be rotated. var/obj_flags /// Integer. Used for varied damage and item volume calculations. var/throwforce = 1 - /// Used in attackby() to say how something was attacked "[x] has been [z.attack_verb] by [y] with [z]" + /// Used in attackby() to say how something was attacked "[x] has been [z.attack_verb] by [y] with [z]". var/list/attack_verb - /// Whether this object cuts. - var/sharp = FALSE - /// Whether this object is more likely to dismember its poor foes. + /// Whether this object creates CUT wounds. + var/sharp = 0 + /// Whether this object is more likely to dismember. var/edge = FALSE /// If we have a user using us, this will be set on. We will check if the user has stopped using us, and thus stop updating and LAGGING EVERYTHING! - var/in_use = FALSE - /// Type of damage this object deals. + var/in_use = 0 + /// The type of damage this object deals. var/damtype = DAMAGE_BRUTE + /// The damage this object deals. var/force = 0 + /// The armour penetration this object has. var/armor_penetration = 0 - /// Makes an object not able to slice things. + /// To make it not able to slice things. Used for curtains, flaps, pumpkins... why aren't you just using edge? var/noslice = FALSE + /// The armor of this object, turned into an armor component. + var/list/armor + /// Set to TRUE when shocked by the tesla ball, to not repeatedly shock the object. + var/being_shocked = FALSE - var/being_shocked = 0 - - /// If set, this holds the 3-letter shortname of a species, used for species-specific worn icons. + /// The slot the object will equip to. + var/equip_slot = 0 + /// If set, this holds the 3-letter shortname of a species, used for species-specific worn icons var/icon_species_tag = "" - /// If TRUE, this item will automatically change its species tag to match the wearer's species, given the wearer's species is listed in icon_supported_species_tags. - var/icon_auto_adapt = FALSE + /// If 1, this item will automatically change its species tag to match the wearer's species. Requires that the wearer's species is listed in icon_supported_species_tags. + var/icon_auto_adapt = 0 /** * A list of strings used with icon_auto_adapt, a list of species which have differing appearances for this item, - * based on the specie short name + * based on the species short name */ var/list/icon_supported_species_tags /// If `TRUE`, will use the `icon_species_tag` var for rendering this item in the left/right hand. var/icon_species_in_hand = FALSE - var/equip_slot = 0 - /// Played when the item is used, for example tools. + ///Played when the item is used, for example tools var/usesound - + /// The speed of the tool. This is generally a divisor. var/toolspeed = 1 + /// The sound this tool makes in surgery. var/surgerysound /* START BUCKLING VARS */ + /// A list of things that can buckle to this atom. var/list/can_buckle + /// If the buckled atom can move, and thus face directions. var/buckle_movable = 0 + /// The direction forced on a buckled atom. var/buckle_dir = 0 - var/buckle_lying = -1 //bed-like behavior, forces mob.lying = buckle_lying if != -1 - var/buckle_require_restraints = 0 //require people to be handcuffed before being able to buckle. eg: pipes + /// Causes bed-like behavior, forces mob.lying = buckle_lying if != -1. + var/buckle_lying = -1 + /// Require people to be handcuffed before being able to buckle. eg: pipes. + var/buckle_require_restraints = 0 + /// The atom buckled to us. var/atom/movable/buckled = null /** * Stores the original layer of a buckled atom. @@ -71,11 +83,14 @@ * Used in `/unbuckle()` to restore the original layer. */ var/buckled_original_layer = null - var/buckle_delay = 0 //How much extra time to buckle someone to this object. + /// How much extra time to buckle someone to this object. + var/buckle_delay = 0 /* END BUCKLING VARS */ /* START ACCESS VARS */ + /// Required access. var/list/req_access + /// Only require one of these accesses. var/list/req_one_access /* END ACCESS VARS */ @@ -93,6 +108,20 @@ var/persistant_objects_expiration_time_days = PERSISTENT_DEFAULT_EXPIRATION_DAYS /* END PERSISTENCE VARS */ +/obj/Initialize(mapload, ...) + . = ..() + if(maxhealth) + if(!health) + // Allows you to set dynamic health states on initialize. + health = maxhealth + if(islist(armor)) + for(var/type in armor) + if(armor[type]) + AddComponent(/datum/component/armor, armor) + break + else if(should_use_health) + AddComponent(/datum/component/armor, GLOB.default_object_armor, TRUE) + /obj/Destroy() if(persistent_objects_track_active) // Prevent hard deletion of references in the persistence register by removing it preemptively SSpersistence.objectsDeregisterTrack(src) @@ -127,6 +156,8 @@ /mob/proc/CanUseObjTopic() return 1 + + /obj/proc/CouldUseTopic(var/mob/user) user.AddTopicPrint(src) @@ -169,6 +200,11 @@ if(loc) return loc.return_air() +/obj/condition_hints(mob/user, distance, is_adjacent) + . += ..() + if(health < maxhealth) + . += get_damage_condition_hints(user, distance, is_adjacent) + /obj/proc/updateUsrDialog() if(in_use) var/is_in_use = 0 diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm index b2e2fa6bf18..26d472687b3 100644 --- a/code/game/objects/structures.dm +++ b/code/game/objects/structures.dm @@ -4,10 +4,10 @@ layer = STRUCTURE_LAYER blocks_emissive = EMISSIVE_BLOCK_GENERIC pass_flags_self = PASSSTRUCTURE + should_use_health = TRUE var/material_alteration = MATERIAL_ALTERATION_ALL // Overrides for material shit. Set them manually if you don't want colors etc. See wood chairs/office chairs. var/climbable - var/breakable var/parts var/list/climbers var/list/footstep_sound //footstep sounds when stepped on @@ -40,15 +40,23 @@ material = null return ..() +/obj/structure/attackby(obj/item/attacking_item, mob/user, params) + . = ..() + if(user?.a_intent == I_HURT && maxhealth) + user.do_attack_animation(src) + user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) + add_damage(attacking_item.force, attacking_item.damage_flags(), attacking_item.damtype, attacking_item.armor_penetration, attacking_item) + if(hitsound) + playsound(user, hitsound, attacking_item.get_clamped_volume()) + /obj/structure/attack_hand(mob/living/user) - if(breakable) - if((user.mutations & HULK) && !(user.isSynthetic()) && !(isvaurca(user))) - user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" )) - attack_generic(user,1,"smashes") - else if(istype(user,/mob/living/carbon/human)) - var/mob/living/carbon/human/H = user - if(H.species.can_shred(user)) - attack_generic(user,1,"slices") + if((user.mutations & HULK) && !(user.isSynthetic()) && !(isvaurca(user))) + user.say(pick("RAAAAAAAARGH!!!", "HNNNNNNNNNGGGGGGH!!!", "GWAAAAAAAARRRHHH!!!", "NNNNNNNNGGGGGGGGHH!!!", "AAAAAAARRRGH!!!" )) + attack_generic(user, 25, "smashes") + else if(istype(user,/mob/living/carbon/human)) + var/mob/living/carbon/human/H = user + if(H.species.can_shred(user)) + attack_generic(user, 25, "slices") if(LAZYLEN(climbers) && !(user in climbers)) user.visible_message(SPAN_WARNING("[user] shakes \the [src]."), \ @@ -75,6 +83,8 @@ dismantle_material = SSmaterials.get_material_by_name(DEFAULT_WALL_MATERIAL) //if there is no defined material, it will use steel else dismantle_material = get_material() + if(should_use_health && health <= 0) + build_amt /= rand(2, 4) //if the structure is destroyed by damage, it will yield less materials for(var/i = 1 to build_amt) dismantle_material.place_sheet(loc) qdel(src) @@ -227,13 +237,8 @@ return 0 return 1 -/obj/structure/attack_generic(mob/user, damage, attack_message, environment_smash, armor_penetration, attack_flags, damage_type) - if(!breakable || !damage || !environment_smash) - return 0 - visible_message(SPAN_DANGER("[user] [attack_verb] the [src] apart!")) - user.do_attack_animation(src) - qdel(src) - return 1 +/obj/structure/on_death(damage, damage_flags, damage_type, armor_penetration, obj/weapon) + dismantle() /obj/structure/get_material() return material diff --git a/code/game/objects/structures/barricades/_barricade.dm b/code/game/objects/structures/barricades/_barricade.dm index 35f230f6fff..da34d5d05e3 100644 --- a/code/game/objects/structures/barricades/_barricade.dm +++ b/code/game/objects/structures/barricades/_barricade.dm @@ -4,20 +4,13 @@ anchored = TRUE density = TRUE atom_flags = ATOM_FLAG_CHECKS_BORDER + maxhealth = OBJECT_HEALTH_LOW /// The type of stack the barricade dropped when disassembled if any. var/stack_type /// The amount of stack dropped when disassembled at full health var/stack_amount = 5 /// to specify a non-zero amount of stack to drop when destroyed var/destroyed_stack_amount - /// Pretty tough. Changes sprites at 300 and 150 - var/health = 100 - /// Basic code functions - var/maxhealth = 100 - - /// Used for calculating some stuff related to maxhealth as it constantly changes due to e.g. barbed wire. set to 100 to avoid possible divisions by zero - var/starting_maxhealth = 100 - /// How much force an item needs to even damage it at all. var/force_level_absorption = 5 var/barricade_hitsound @@ -33,19 +26,17 @@ /obj/structure/barricade/Initialize(mapload, mob/user) . = ..() update_icon() - starting_maxhealth = maxhealth -/obj/structure/barricade/condition_hints(mob/user, distance, is_adjacent) - . += ..() +/obj/structure/barricade/get_damage_condition_hints(mob/user, distance, is_adjacent) switch(damage_state) if(BARRICADE_DMG_NONE) - . += SPAN_INFO("It appears to be in good shape.") + . = SPAN_INFO("It appears to be in good shape.") if(BARRICADE_DMG_SLIGHT) - . += SPAN_WARNING("It's slightly damaged, but still very functional.") + . = SPAN_WARNING("It's slightly damaged, but still very functional.") if(BARRICADE_DMG_MODERATE) - . += SPAN_WARNING("It's quite beat up, but it's holding together.") + . = SPAN_WARNING("It's quite beat up, but it's holding together.") if(BARRICADE_DMG_HEAVY) - . += SPAN_WARNING("It's crumbling apart, just a few more blows will tear it apart!") + . = SPAN_WARNING("It's crumbling apart, just a few more blows will tear it apart!") /obj/structure/barricade/mechanics_hints(mob/user, distance, is_adjacent) . += ..() @@ -164,7 +155,7 @@ visible_message(SPAN_DANGER("\The [src]'s barbed wire slices into [L]!")) L.apply_damage((5), DAMAGE_BRUTE, pick(BP_R_HAND, BP_L_HAND), "barbed wire", DAMAGE_FLAG_SHARP|DAMAGE_FLAG_EDGE, 25) L.do_attack_animation(src) - take_damage(damage) + add_damage(damage) /obj/structure/barricade/attackby(obj/item/attacking_item, mob/user) if(istype(attacking_item, /obj/item/stack/barbed_wire)) @@ -181,8 +172,8 @@ user.visible_message(SPAN_NOTICE("[user] sets up [attacking_item.name] on [src]."), SPAN_NOTICE("You set up [attacking_item.name] on [src].")) - maxhealth += 50 - update_health(-50) + set_maxhealth(maxhealth + 50) + add_health(50) can_wire = FALSE is_wired = TRUE climbable = FALSE @@ -196,12 +187,11 @@ if(do_after(user, 20, src, DO_REPAIR_CONSTRUCT)) if(!is_wired) return - playsound(src.loc, 'sound/items/Wirecutter.ogg', 25, 1) user.visible_message(SPAN_NOTICE("[user] removes the barbed wire on [src]."), SPAN_NOTICE("You remove the barbed wire on [src].")) - maxhealth -= 50 - update_health(50) + set_maxhealth(maxhealth - 50) + add_damage(50) can_wire = TRUE is_wired = FALSE climbable = TRUE @@ -222,7 +212,7 @@ bullet_ping(hitting_projectile) var/damage_to_take = hitting_projectile.damage * hitting_projectile.anti_materiel_potential - take_damage(damage_to_take) + add_damage(damage_to_take, hitting_projectile.damage_flags(), hitting_projectile.damtype, hitting_projectile.armor_penetration, hitting_projectile) /obj/structure/barricade/proc/barricade_deconstruct(deconstruct) if(deconstruct && is_wired) @@ -232,7 +222,7 @@ if(!deconstruct && destroyed_stack_amount) stack_amt = destroyed_stack_amount else - stack_amt = round(stack_amount * (health/starting_maxhealth)) //Get an amount of sheets back equivalent to remaining health. Obviously, fully destroyed means 0 + stack_amt = round(stack_amount * (health/initial(maxhealth))) //Get an amount of sheets back equivalent to remaining health. Obviously, fully destroyed means 0 if(stack_amt) new stack_type (loc, stack_amt) @@ -242,7 +232,7 @@ for(var/obj/structure/barricade/B in get_step(src,dir)) //discourage double-stacking barricades by removing health from opposing barricade if(B.dir == REVERSE_DIR(dir)) INVOKE_ASYNC(B, TYPE_PROC_REF(/atom, ex_act), severity, direction) - update_health(round(severity)) + add_damage(round(severity)) // This proc is called whenever the cade is moved, so I thought it was appropriate, // especially since the barricade's direction needs to be handled when moving @@ -267,26 +257,20 @@ var/message = pick(I.attack_verb) visible_message(SPAN_DANGER("[L] has [message] the [src]!")) L.do_attack_animation(src) - take_damage(I.force) + add_damage(I.force, I.damage_flags(), I.damtype, I.armor_penetration, I) -/obj/structure/barricade/proc/take_damage(var/damage) +/obj/structure/barricade/add_damage(damage, damage_flags, damage_type, armor_penetration, obj/weapon) for(var/obj/structure/barricade/B in get_step(src,dir)) //discourage double-stacking barricades by removing health from opposing barricade if(B.dir == REVERSE_DIR(dir)) - B.update_health(damage) - update_health(damage) - -/obj/structure/barricade/proc/update_health(damage, nomessage) - health -= damage - health = clamp(health, 0, maxhealth) + B.add_damage(damage, damage_flags, damage_type, armor_penetration, weapon) + if(..()) + update_damage_state() + update_icon() +/obj/structure/barricade/on_death(damage, damage_flags, damage_type, armor_penetration, obj/weapon) if(!health) - if(!nomessage) - visible_message(SPAN_DANGER("[src] falls apart!")) + visible_message(SPAN_DANGER("[src] falls apart!")) barricade_deconstruct() - return - - update_damage_state() - update_icon() /obj/structure/barricade/proc/update_damage_state() var/health_percent = round(health/maxhealth * 100) @@ -309,7 +293,7 @@ if(WT.use_tool(src, user, 7 SECONDS, volume = 40)) user.visible_message(SPAN_NOTICE("[user] repairs some damage on [src]."), SPAN_NOTICE("You repair \the [src].")) - update_health(-200) + add_health(200) return TRUE diff --git a/code/game/objects/structures/barricades/liquid.dm b/code/game/objects/structures/barricades/liquid.dm index 4cee55999e9..79d2ab4852b 100644 --- a/code/game/objects/structures/barricades/liquid.dm +++ b/code/game/objects/structures/barricades/liquid.dm @@ -120,7 +120,7 @@ health = BARRICADE_LIQUIDBAG_TRESHOLD_5 maxhealth = BARRICADE_LIQUIDBAG_TRESHOLD_5 maxhealth += 50 - update_health(-50) + add_health(50) stack_amount = 5 can_wire = FALSE is_wired = TRUE diff --git a/code/game/objects/structures/barricades/metal.dm b/code/game/objects/structures/barricades/metal.dm index b5b226a8bd1..170b39200f7 100644 --- a/code/game/objects/structures/barricades/metal.dm +++ b/code/game/objects/structures/barricades/metal.dm @@ -109,7 +109,7 @@ /obj/structure/barricade/metal/wired/Initialize(mapload, mob/user) . = ..() maxhealth += 50 - update_health(-50) + add_health(50) can_wire = FALSE is_wired = TRUE climbable = FALSE diff --git a/code/game/objects/structures/barricades/wood.dm b/code/game/objects/structures/barricades/wood.dm index 87e3238b716..f2f2d8ca2b4 100644 --- a/code/game/objects/structures/barricades/wood.dm +++ b/code/game/objects/structures/barricades/wood.dm @@ -29,7 +29,7 @@ visible_message(SPAN_NOTICE("[user] begins to repair [src].")) if(do_after(user, 2 SECONDS, src, DO_REPAIR_CONSTRUCT) && (health < maxhealth)) if(D.use(1)) - update_health(-0.5*maxhealth) + add_health(maxhealth*0.5) update_damage_state() visible_message(SPAN_NOTICE("[user] haphazardly repairs [src].")) return diff --git a/code/game/objects/structures/coatrack.dm b/code/game/objects/structures/coatrack.dm index d8f04df6c53..3c31739caf1 100644 --- a/code/game/objects/structures/coatrack.dm +++ b/code/game/objects/structures/coatrack.dm @@ -4,6 +4,7 @@ icon = 'icons/obj/coatrack.dmi' icon_state = "coatrack" layer = ABOVE_HUMAN_LAYER + maxhealth = OBJECT_HEALTH_VERY_LOW var/obj/item/clothing/coat var/obj/item/clothing/head/hat /// Custom manual sprite override. diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index 7c584e212a0..a9d4626a753 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -3,10 +3,13 @@ desc = "It's a basic storage unit." icon = 'icons/obj/containers/closet.dmi' icon_state = "generic" + hitsound = 'sound/effects/metalhit.ogg' density = TRUE build_amt = 2 slowdown = 2.5 pass_flags_self = PASSSTRUCTURE | LETPASSCLICKS | PASSTRACE + maxhealth = OBJECT_HEALTH_MEDIUM + armor = list(MELEE = ARMOR_MELEE_RESISTANT, BULLET = ARMOR_BALLISTIC_PISTOL, LASER = ARMOR_LASER_KEVLAR) var/icon_door = null /// Override to have open overlay use icon different to its base's @@ -34,7 +37,6 @@ /// Never solid (You can always pass over it) var/wall_mounted = FALSE - var/health = 100 /// If someone is currently breaking out. mutex var/breakout = 0 @@ -157,6 +159,10 @@ . = ..() +/obj/structure/closet/on_death(damage, damage_flags, damage_type, armor_penetration, obj/weapon) + dump_contents() + . = ..() + /// Fill lockers with this. /obj/structure/closet/proc/fill() return @@ -318,11 +324,11 @@ /obj/structure/closet/ex_act(severity) switch(severity) if(1) - health -= rand(120, 240) + add_damage(rand(120, 240)) if(2) - health -= rand(60, 120) + add_damage(rand(60, 120)) if(3) - health -= rand(30, 60) + add_damage(rand(30, 60)) if(health <= 0) for (var/atom/movable/A as mob|obj in src) @@ -525,9 +531,13 @@ playsound(loc, 'sound/weapons/blade.ogg', 50, 1) else attack_hand(user) + else + return ..() else - attack_hand(user) - return + if(attacking_item.force < 10 && user.a_intent != I_HURT) + attack_hand(user) + else + return ..() // helper procs for callbacks /obj/structure/closet/proc/is_closed() diff --git a/code/game/objects/structures/crates_lockers/closets/secure/locker.dm b/code/game/objects/structures/crates_lockers/closets/secure/locker.dm index 6a95ecdaa35..eed8c66d439 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/locker.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/locker.dm @@ -7,7 +7,13 @@ secure = TRUE opened = FALSE locked = TRUE - health = 200 + health = OBJECT_HEALTH_VERY_HIGH + armor = list( + MELEE = ARMOR_MELEE_RESISTANT, + BULLET = ARMOR_BALLISTIC_MEDIUM, + LASER = ARMOR_LASER_MEDIUM, + ENERGY = ARMOR_ENERGY_RESISTANT, + ) /obj/structure/closet/emp_act(severity) . = ..() diff --git a/code/game/objects/structures/crates_lockers/crates.dm b/code/game/objects/structures/crates_lockers/crates.dm index 2832bae0d70..111508c30a8 100644 --- a/code/game/objects/structures/crates_lockers/crates.dm +++ b/code/game/objects/structures/crates_lockers/crates.dm @@ -243,7 +243,13 @@ locked = TRUE secure = TRUE secure_lights = TRUE - health = 200 + maxhealth = OBJECT_HEALTH_VERY_HIGH + armor = list( + MELEE = ARMOR_MELEE_RESISTANT, + BULLET = ARMOR_BALLISTIC_MEDIUM, + LASER = ARMOR_LASER_MEDIUM, + ENERGY = ARMOR_ENERGY_RESISTANT, + ) /obj/structure/closet/crate/plastic name = "plastic crate" diff --git a/code/game/objects/structures/crystals.dm b/code/game/objects/structures/crystals.dm index 6268536dbf8..796ffc9fc32 100644 --- a/code/game/objects/structures/crystals.dm +++ b/code/game/objects/structures/crystals.dm @@ -5,25 +5,25 @@ icon_state = "scattered" anchored = TRUE density = FALSE + maxhealth = OBJECT_HEALTH_HIGH + var/singleton/reagent/reagent_id var/state = 0 - var/health = 100 var/mine_rate = 1 // how fast you can mine it var/obj/machinery/power/crystal_agitator/creator // used to re-add dense turfs to agitation list when destroyed -/obj/structure/reagent_crystal/condition_hints(mob/user, distance, is_adjacent) - . += ..() - var/current_damage = health / initial(health) +/obj/structure/reagent_crystal/get_damage_condition_hints(mob/user, distance, is_adjacent) + var/current_damage = health / maxhealth switch(current_damage) if(0 to 0.2) - . += SPAN_DANGER("The crystal is barely holding together!") + . = SPAN_DANGER("The crystal is barely holding together!") if(0.2 to 0.4) - . += SPAN_WARNING("The crystal has various cracks visible!") + . = SPAN_WARNING("The crystal has various cracks visible!") if(0.4 to 0.8) - . += SPAN_WARNING("The crystal has scratches and deeper grooves on its surface.") + . = SPAN_WARNING("The crystal has scratches and deeper grooves on its surface.") if(0.8 to 1) - . += SPAN_NOTICE("The crystal looks structurally sound.") + . = SPAN_NOTICE("The crystal looks structurally sound.") /obj/structure/reagent_crystal/Initialize(mapload, var/reagent_i = null, var/our_creator = null) . = ..() @@ -39,16 +39,15 @@ if(our_creator) creator = our_creator -/obj/structure/reagent_crystal/proc/take_damage(var/damage) - health -= damage - if(health <= 0) - visible_message(SPAN_WARNING("\The [src] collapses into smaller crystals!")) - harvest() +/obj/structure/reagent_crystal/on_death(damage, damage_flags, damage_type, armor_penetration, obj/weapon) + visible_message(SPAN_WARNING("\The [src] collapses into smaller crystals!")) + new /obj/item/reagent_crystal(get_turf(src), reagent_id, 5) + qdel(src) /obj/structure/reagent_crystal/attack_hand(mob/user) if((user.mutations & HULK)) user.visible_message(SPAN_WARNING("\The [user] smashes \the [src] apart!"), SPAN_WARNING("You smash \the [src] apart!")) - harvest() + add_damage(health) return return ..() @@ -75,7 +74,7 @@ user.do_attack_animation(src) playsound(get_turf(src), 'sound/weapons/smash.ogg', 50) visible_message(SPAN_WARNING("\The [user] smashes \the [attacking_item] into \the [src].")) - take_damage(attacking_item.force * 4) + add_damage(attacking_item.force * 4) /obj/structure/reagent_crystal/proc/mine_crystal(var/mob/user, var/time_to_dig, var/use_sound) if(!user) @@ -86,46 +85,35 @@ if(do_after(user, time_to_dig * mine_rate, src)) if(!src) return - harvest() + add_damage(health) if(use_sound) playsound(get_turf(src), use_sound, 30, TRUE) -/obj/structure/reagent_crystal/proc/harvest() - new /obj/item/reagent_crystal(get_turf(src), reagent_id, 5) - qdel(src) - /obj/structure/reagent_crystal/ex_act(severity) switch(severity) if(1.0) qdel(src) - return if(2.0) if(prob(30)) - harvest() - return + add_damage(health) else - health -= rand(60,180) + add_damage(rand(60,180)) if(3.0) if(prob(5)) - harvest() - return + add_damage(health) else - health -= rand(40,80) - - if(health <= 0) - harvest() - return + add_damage(rand(40,80)) /obj/structure/reagent_crystal/attack_generic(mob/user, damage, attack_message, environment_smash, armor_penetration, attack_flags, damage_type) if(!damage || !environment_smash) return FALSE user.do_attack_animation(src) visible_message(SPAN_WARNING("\The [user] [attack_message] \the [src]!")) - harvest() + add_damage(health) return TRUE /obj/structure/reagent_crystal/proc/become_dense() - var/health_mod = health / initial(health) + var/health_mod = health / maxhealth var/obj/structure/reagent_crystal/dense/P = new /obj/structure/reagent_crystal/dense(get_turf(src), reagent_id, creator) P.health *= health_mod if(creator) @@ -136,10 +124,10 @@ name = "dense chemical crystal cluster" desc = "A dense cluster of hardened chemical crystals." icon_state = "dense" - health = 200 + maxhealth = OBJECT_HEALTH_HIGH mine_rate = 2 -/obj/structure/reagent_crystal/dense/harvest() +/obj/structure/reagent_crystal/dense/on_death(damage, damage_flags, damage_type, armor_penetration, obj/weapon) var/turf/our_turf = get_turf(src) for(var/i = 0 to 2) new /obj/item/reagent_crystal(our_turf, reagent_id, 5) diff --git a/code/game/objects/structures/displaycase.dm b/code/game/objects/structures/displaycase.dm index a801b057d87..4196991a951 100644 --- a/code/game/objects/structures/displaycase.dm +++ b/code/game/objects/structures/displaycase.dm @@ -7,7 +7,7 @@ anchored = TRUE unacidable = TRUE req_access = list(ACCESS_CAPTAIN) - var/health = 30 + maxhealth = OBJECT_HEALTH_VERY_LOW var/obj/held_obj var/open = FALSE var/destroyed = FALSE diff --git a/code/game/objects/structures/full_window_frame.dm b/code/game/objects/structures/full_window_frame.dm index 353f805b2d9..b3064361d7e 100644 --- a/code/game/objects/structures/full_window_frame.dm +++ b/code/game/objects/structures/full_window_frame.dm @@ -3,6 +3,7 @@ desc = "A steel window frame." icon = 'icons/obj/smooth/window/full_window_frame_color.dmi' icon_state = "window_frame" + maxhealth = OBJECT_HEALTH_MEDIUM color = COLOR_GRAY20 build_amt = 4 layer = WINDOW_FRAME_LAYER @@ -10,7 +11,6 @@ density = TRUE climbable = TRUE smoothing_flags = SMOOTH_MORE - breakable = TRUE can_be_unanchored = TRUE canSmoothWith = list( /turf/simulated/wall, @@ -169,6 +169,7 @@ new_grille.shock(user, 70) // You haven't forgotten your precautions, have you? has_grille_installed = TRUE return + else return ..() /obj/structure/window_frame/hitby(atom/movable/hitting_atom, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) . = ..() @@ -177,6 +178,7 @@ W.hitby(arglist(args)) /obj/structure/window_frame/wood + maxhealth = OBJECT_HEALTH_LOW color = "#8f5847" /obj/structure/window_frame/unanchored // Used during in-game construction. @@ -187,6 +189,7 @@ should_check_mapload = FALSE // No glass. /obj/structure/window_frame/shuttle + maxhealth = OBJECT_HEALTH_HIGH icon = 'icons/obj/smooth/window/full_window_frame_color.dmi' color = null smoothing_flags = SMOOTH_MORE diff --git a/code/game/objects/structures/girders.dm b/code/game/objects/structures/girders.dm index 100866b7f1c..68b9e1f3ef0 100644 --- a/code/game/objects/structures/girders.dm +++ b/code/game/objects/structures/girders.dm @@ -7,8 +7,8 @@ w_class = WEIGHT_CLASS_HUGE obj_flags = OBJ_FLAG_MOVES_UNSUPPORTED pass_flags_self = PASSTABLE + maxhealth = OBJECT_HEALTH_HIGH var/state = 0 - var/health = 200 /// How much cover the girder provides against projectiles. var/cover = 50 build_amt = 2 @@ -16,10 +16,9 @@ var/reinforcing = 0 var/plating = FALSE -/obj/structure/girder/condition_hints(mob/user, distance, is_adjacent) - . += ..() +/obj/structure/girder/get_damage_condition_hints(mob/user, distance, is_adjacent) var/state - var/current_damage = health / initial(health) + var/current_damage = health / maxhealth switch(current_damage) if(0 to 0.2) state = SPAN_DANGER("The support struts are collapsing!") @@ -29,7 +28,7 @@ state = SPAN_NOTICE("The support struts are dented, but holding together.") if(0.8 to 1) state = SPAN_NOTICE("The support struts look completely intact.") - . += state + . = state /obj/structure/girder/mechanics_hints(mob/user, distance, is_adjacent) . += ..() @@ -68,7 +67,7 @@ name = "displaced girder" icon_state = "displaced" anchored = 0 - health = 50 + maxhealth = OBJECT_HEALTH_VERY_LOW cover = 25 /obj/structure/girder/bullet_act(obj/projectile/hitting_projectile, def_zone, piercing_hit) @@ -83,20 +82,18 @@ if(!istype(hitting_projectile, /obj/projectile/beam)) damage *= 0.4 //non beams do reduced damage - take_damage(damage) + add_damage(damage) return ..() -/obj/structure/girder/proc/take_damage(var/damage) - health -= damage - if(health <= 0) - visible_message(SPAN_WARNING("\The [src] falls apart!")) - dismantle() +/obj/structure/girder/on_death(damage, damage_flags, damage_type, armor_penetration, obj/weapon) + visible_message(SPAN_WARNING("\The [src] falls apart!")) + . = ..() /obj/structure/girder/proc/reset_girder() - anchored = 1 + anchored = TRUE cover = initial(cover) - health = min(health,initial(health)) + set_health(maxhealth) state = 0 icon_state = initial(icon_state) reinforcing = 0 @@ -200,7 +197,7 @@ to_chat(user, SPAN_NOTICE("You dislodged the girder!")) icon_state = "displaced" anchored = 0 - health = 50 + set_maxhealth(OBJECT_HEALTH_VERY_LOW, TRUE) cover = 25 else if(istype(attacking_item, /obj/item/stack/material)) @@ -222,7 +219,7 @@ if(damage_to_deal > weaken && (damage_to_deal > MIN_DAMAGE_TO_HIT)) damage_to_deal -= weaken visible_message(SPAN_WARNING("[user] strikes \the [src] with \the [attacking_item], [is_sharp(attacking_item) ? "slicing" : "denting"] a support rod!")) - take_damage(damage_to_deal) + add_damage(damage_to_deal) else visible_message(SPAN_WARNING("[user] strikes \the [src] with \the [attacking_item], but it bounces off!")) user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) @@ -301,7 +298,7 @@ /obj/structure/girder/proc/reinforce_girder() cover = reinf_material.hardness - health = 500 + set_maxhealth(OBJECT_HEALTH_EXTREMELY_HIGH, TRUE) state = 2 icon_state = "reinforced" reinforcing = 0 @@ -316,26 +313,18 @@ /obj/structure/girder/ex_act(severity) switch(severity) - if(1.0) + if(1) qdel(src) - return - if(2.0) + if(2) if (prob(30)) dismantle() - return else - health -= rand(60,180) - - if(3.0) + add_damage(rand(60,180)) + if(3) if (prob(5)) dismantle() - return else - health -= rand(40,80) - - if(health <= 0) - dismantle() - return + add_damage(rand(40,80)) /obj/structure/girder/attack_generic(mob/user, damage, attack_message, environment_smash, armor_penetration, attack_flags, damage_type) if(!damage || !environment_smash) diff --git a/code/game/objects/structures/gore/core.dm b/code/game/objects/structures/gore/core.dm index b512b773876..b0009d853d0 100644 --- a/code/game/objects/structures/gore/core.dm +++ b/code/game/objects/structures/gore/core.dm @@ -4,18 +4,13 @@ icon = 'icons/obj/gore_structures.dmi' anchored = TRUE density = FALSE + maxhealth = OBJECT_HEALTH_VERY_LOW var/destroy_message = "THE STRUCTURE collapses in on itself!" - var/maxHealth = 50 - var/health = 50 - -/obj/structure/gore/Initialize(mapload) - . = ..() - health = maxHealth /obj/structure/gore/get_examine_text(mob/user, distance, is_adjacent, infix, suffix) . = ..() if(distance <= 2) - var/health_div = health / maxHealth + var/health_div = health / maxhealth if(health_div >= 0.9) . += SPAN_NOTICE("\The [src] appears completely intact.") else if(health_div >= 0.7) @@ -25,32 +20,29 @@ else . += SPAN_WARNING("\The [src] is barely holding itself together!") -/obj/structure/gore/proc/healthcheck() - if(health <= 0) - var/final_message = replacetext(destroy_message, "THE STRUCTURE", "\The [src]") - visible_message(SPAN_WARNING(final_message)) - qdel(src) +/obj/structure/gore/on_death(damage, damage_flags, damage_type, armor_penetration, obj/weapon) + var/final_message = replacetext(destroy_message, "THE STRUCTURE", "\The [src]") + visible_message(SPAN_WARNING(final_message)) + qdel(src) /obj/structure/gore/bullet_act(obj/projectile/hitting_projectile, def_zone, piercing_hit) . = ..() if(. != BULLET_ACT_HIT) return . - health -= hitting_projectile.damage - healthcheck() + add_damage(hitting_projectile.damage) /obj/structure/gore/ex_act(severity) switch(severity) if(1.0) - health -= 50 + add_damage(50) if(2.0) - health -= 50 + add_damage(50) if(3.0) if(prob(50)) - health -= 50 + add_damage(50) else - health -= 25 - healthcheck() + add_damage(25) /obj/structure/gore/hitby(atom/movable/hitting_atom, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) . = ..() @@ -62,21 +54,18 @@ throw_force = O.throwforce else if(ismob(hitting_atom)) throw_force = 10 - health -= throw_force - healthcheck() + add_damage(throw_force) /obj/structure/gore/attack_generic(mob/user, damage, attack_message, environment_smash, armor_penetration, attack_flags, damage_type) attack_hand(usr) /obj/structure/gore/attackby(obj/item/attacking_item, mob/user) - user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) - user.do_attack_animation(src, attacking_item) - var/force_damage = attacking_item.force + var/damage = attacking_item.force if(attacking_item.damtype == DAMAGE_BURN) - force_damage *= 1.25 - health -= force_damage + damage *= 1.25 + . = ..() + add_damage(damage) playsound(loc, 'sound/effects/attackblob.ogg', 80, TRUE) - healthcheck() /obj/structure/gore/CanPass(atom/movable/mover, turf/target, height=0, air_group=0) if(air_group) diff --git a/code/game/objects/structures/gore/nest.dm b/code/game/objects/structures/gore/nest.dm index 098da1e2df9..540ae773179 100644 --- a/code/game/objects/structures/gore/nest.dm +++ b/code/game/objects/structures/gore/nest.dm @@ -5,18 +5,13 @@ desc = "It's a gruesome pile of thick, sticky flesh shaped like a nest." icon = 'icons/obj/gore_structures.dmi' icon_state = "nest" + maxhealth = OBJECT_HEALTH_LOW var/destroy_message = "THE STRUCTURE collapses in on itself!" - var/maxHealth = 100 - var/health = 100 - -/obj/structure/bed/nest/Initialize(mapload, new_material, new_padding_material) - . = ..() - health = maxHealth /obj/structure/bed/nest/get_examine_text(mob/user, distance, is_adjacent, infix, suffix) . = ..() if(distance <= 2) - var/health_div = health / maxHealth + var/health_div = health / maxhealth if(health_div >= 0.9) . += SPAN_NOTICE("\The [src] appears completely intact.") else if(health_div >= 0.7) @@ -51,19 +46,16 @@ unbuckle() /obj/structure/bed/nest/attackby(obj/item/attacking_item, mob/user) - user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) - user.do_attack_animation(src, attacking_item) - var/force_damage = attacking_item.force + var/damage = attacking_item.force if(attacking_item.damtype == DAMAGE_BURN) - force_damage *= 1.25 - health -= force_damage + damage *= 1.25 + . = ..() + add_damage(damage) playsound(loc, 'sound/effects/attackblob.ogg', 80, TRUE) - healthcheck() -/obj/structure/bed/nest/proc/healthcheck() - if(health <= 0) - var/final_message = replacetext(destroy_message, "THE STRUCTURE", "\The [src]") - visible_message(SPAN_WARNING(final_message)) - qdel(src) +/obj/structure/bed/nest/on_death(damage, damage_flags, damage_type, armor_penetration, obj/weapon) + var/final_message = replacetext(destroy_message, "THE STRUCTURE", "\The [src]") + visible_message(SPAN_WARNING(final_message)) + qdel(src) #undef NEST_RESIST_TIME diff --git a/code/game/objects/structures/gore/tendrils.dm b/code/game/objects/structures/gore/tendrils.dm index e710b34e0ae..de0e7918e2c 100644 --- a/code/game/objects/structures/gore/tendrils.dm +++ b/code/game/objects/structures/gore/tendrils.dm @@ -4,7 +4,7 @@ name = "bloody tendrils" desc = "Bloody, pulsating tendrils." icon_state = "tendril" - maxHealth = 40 + maxhealth = OBJECT_HEALTH_VERY_LOW pass_flags = PASSTABLE | PASSMOB | PASSTRACE | PASSRAILING var/being_destroyed = FALSE var/is_node = FALSE @@ -18,7 +18,7 @@ desc = "Clumped up flesh, pulsating in rhythm with the tendrils that surround it." icon_state = "tendril_node" density = TRUE - maxHealth = 150 + maxhealth = OBJECT_HEALTH_MEDIUM light_range = NODERANGE light_color = LIGHT_COLOR_EMERGENCY is_node = TRUE @@ -125,18 +125,16 @@ /obj/structure/gore/tendrils/ex_act(severity) switch(severity) if(1.0) - health = 0 + add_damage(maxhealth) if(2.0) - health -= maxHealth / 2 + add_damage(maxhealth / 2) if(3.0) - health -= maxHealth / 5 - healthcheck() + add_damage(maxhealth / 5) /obj/structure/gore/tendrils/fire_act(exposed_temperature, exposed_volume) . = ..() if(exposed_temperature > 300 + T0C) - health -= 5 - healthcheck() + add_damage(5) #undef NODERANGE diff --git a/code/game/objects/structures/gore/wall.dm b/code/game/objects/structures/gore/wall.dm index 3c5ac66e7fd..4b8a45cdfc9 100644 --- a/code/game/objects/structures/gore/wall.dm +++ b/code/game/objects/structures/gore/wall.dm @@ -2,21 +2,21 @@ name = "flesh floor" desc = "Looks like the floor was covered by some fleshlike growth." icon_state = "flesh_floor" - maxHealth = 100 + maxhealth = OBJECT_HEALTH_LOW /obj/structure/gore/wall name = "flesh wall" desc = "Chunks of flesh sculpted to form an impassable wall." icon_state = "flesh_wall" opacity = TRUE - maxHealth = 200 + maxhealth = OBJECT_HEALTH_HIGH /obj/structure/gore/wall/membrane name = "flesh membrane" desc = "Skin and muscle stretched just thin enough to let light pass through." icon_state = "flesh_membrane" opacity = FALSE - maxHealth = 120 + maxhealth = 120 /obj/structure/gore/wall/Initialize() . = ..() @@ -33,8 +33,7 @@ user.do_attack_animation(src, FIST_ATTACK_ANIMATION) if((user.mutations & HULK)) visible_message(SPAN_DANGER("\The [user] destroys \the [src]!")) - health = 0 + add_damage(maxhealth) else visible_message(SPAN_DANGER("\The [user] claws at \the [src]!")) - health -= rand(5, 10) - healthcheck() + add_damage(rand(5, 10)) diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index 75e1318c48c..15986b4ecea 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -9,11 +9,15 @@ obj_flags = OBJ_FLAG_CONDUCTABLE | OBJ_FLAG_MOVES_UNSUPPORTED explosion_resistance = 1 layer = BELOW_WINDOW_LAYER - var/health = 10 + maxhealth = OBJECT_HEALTH_FRAGILE + armor = list( + MELEE = ARMOR_MELEE_KNIVES, + LASER = ARMOR_LASER_SMALL, + ENERGY = ARMOR_ENERGY_SMALL + ) var/destroyed = 0 -/obj/structure/grille/condition_hints(mob/user, distance, is_adjacent) - . += ..() +/obj/structure/grille/get_damage_condition_hints(mob/user, distance, is_adjacent) if(health < initial(health)) var/state var/current_damage = health / initial(health) @@ -24,7 +28,7 @@ state = SPAN_ALERT("The grille has taken some serious damage.") if(0.8 to 1) state = SPAN_NOTICE("The grille is in less than perfect condition.") - . += state + . = state /obj/structure/grille/mechanics_hints(mob/user, distance, is_adjacent) . += ..() @@ -179,8 +183,7 @@ . = BULLET_ACT_HIT damage = between(0, (damage - hitting_projectile.damage)*(hitting_projectile.damage_type == DAMAGE_BRUTE? 0.4 : 1), 10) //if the bullet passes through then the grille avoids most of the damage - src.health -= damage*0.2 - spawn(0) healthcheck() //spawn to make sure we return properly if the grille is deleted + add_damage(damage * 0.2) /obj/structure/grille/attackby(obj/item/attacking_item, mob/user) if(attacking_item.tool_behaviour == TOOL_WIRECUTTER) @@ -262,30 +265,19 @@ user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) user.do_attack_animation(src) playsound(loc, 'sound/effects/grillehit.ogg', 80, 1) - switch(attacking_item.damtype) - if("fire") - health -= attacking_item.force - if("brute") - health -= attacking_item.force * 0.1 - healthcheck() + add_damage(attacking_item.force) + ..() - return +/obj/structure/grille/on_death(damage, damage_flags, damage_type, armor_penetration, obj/weapon) + if(!destroyed) + density = FALSE + destroyed = TRUE + update_icon() + new /obj/item/stack/rods(get_turf(src)) -/obj/structure/grille/proc/healthcheck() - if(health <= 0) - if(!destroyed) - density = 0 - destroyed = 1 - update_icon() - new /obj/item/stack/rods(get_turf(src)) - - else - if(health <= -6) - new /obj/item/stack/rods(get_turf(src)) - qdel(src) - return - return + else + . = ..() // shock user with probability prb (if all connections & power are working) // returns 1 if shocked, 0 otherwise @@ -314,17 +306,9 @@ /obj/structure/grille/fire_act(exposed_temperature, exposed_volume) if(!destroyed) if(exposed_temperature > T0C + 1500) - health -= 1 - healthcheck() + add_damage(1) ..() -/obj/structure/grille/attack_generic(mob/user, damage, attack_message, environment_smash, armor_penetration, attack_flags, damage_type) - visible_message(SPAN_DANGER("[user] [attack_verb] the [src]!")) - user.do_attack_animation(src) - health -= damage - spawn(1) healthcheck() - return 1 - // Used in mapping to avoid /obj/structure/grille/broken destroyed = 1 @@ -333,8 +317,7 @@ /obj/structure/grille/broken/New() ..() - health = rand(-5, -1) //In the destroyed but not utterly threshold. - healthcheck() //Send this to healthcheck just in case we want to do something else with it. + add_damage(rand(-5, -1)) //In the destroyed but not utterly threshold. /obj/structure/grille/diagonal icon_state = "grille_diagonal" @@ -343,7 +326,7 @@ name = "cult grille" desc = "A matrice built out of an unknown material, with some sort of force field blocking air around it" icon_state = "grillecult" - health = 40 //Make it strong enough to avoid people breaking in too easily + maxhealth = OBJECT_HEALTH_VERY_LOW //Make it strong enough to avoid people breaking in too easily appearance_flags = NO_CLIENT_COLOR /obj/structure/grille/cult/CanPass(atom/movable/mover, turf/target, height = 1.5, air_group = 0) diff --git a/code/game/objects/structures/hadii_statue.dm b/code/game/objects/structures/hadii_statue.dm index 188da667c7f..98fac7d1e2d 100644 --- a/code/game/objects/structures/hadii_statue.dm +++ b/code/game/objects/structures/hadii_statue.dm @@ -6,11 +6,11 @@ density = TRUE anchored = TRUE layer = ABOVE_HUMAN_LAYER + maxhealth = OBJECT_HEALTH_MEDIUM var/toppled = FALSE var/outside = FALSE var/already_toppled = FALSE var/toppling_sound = 'sound/effects/metalhit.ogg' - var/health = 100 /obj/structure/hadii_statue/stone icon_state = "stone" diff --git a/code/game/objects/structures/hivebot_head.dm b/code/game/objects/structures/hivebot_head.dm index 428366d541f..6a05d060d3e 100644 --- a/code/game/objects/structures/hivebot_head.dm +++ b/code/game/objects/structures/hivebot_head.dm @@ -3,8 +3,8 @@ desc = "The central core of the Hivebot Secondary Transmitter Drone - all that remains after the machine's destruction. Perhaps some data as to the threat can be gleaned from this?" icon = 'icons/obj/structure/hivebot_head.dmi' icon_state = "hivebot_head" + maxhealth = null w_class = WEIGHT_CLASS_BULKY - breakable = FALSE climbable = FALSE density = FALSE diff --git a/code/game/objects/structures/inflatable.dm b/code/game/objects/structures/inflatable.dm index 5f817db0cc5..d71f4c60601 100644 --- a/code/game/objects/structures/inflatable.dm +++ b/code/game/objects/structures/inflatable.dm @@ -47,10 +47,12 @@ anchored = TRUE atmos_canpass = CANPASS_DENSITY + maxhealth = OBJECT_HEALTH_FRAGILE + var/deflating = FALSE var/undeploy_path = null var/torn_path = null - var/health = 15 + /obj/structure/inflatable/mechanics_hints(mob/user, distance, is_adjacent) . += ..() diff --git a/code/game/objects/structures/railing.dm b/code/game/objects/structures/railing.dm index 42e76802f5d..cd2c12dd1c7 100644 --- a/code/game/objects/structures/railing.dm +++ b/code/game/objects/structures/railing.dm @@ -13,9 +13,10 @@ obj_flags = OBJ_FLAG_ROTATABLE|OBJ_FLAG_MOVES_UNSUPPORTED build_amt = 2 + + maxhealth = OBJECT_HEALTH_EXTREMELY_LOW + var/broken = FALSE - var/health = 70 - var/maxhealth = 70 var/neighbor_status = 0 /// If the object shouldn't inherit a material, set this to True. @@ -25,16 +26,15 @@ can_astar_pass = CANASTARPASS_ALWAYS_PROC -/obj/structure/railing/condition_hints(mob/user, distance, is_adjacent) - . += ..() +/obj/structure/railing/get_damage_condition_hints(mob/user, distance, is_adjacent) if (health < maxhealth) switch(health / maxhealth) if (0.0 to 0.5) - . += SPAN_WARNING("It looks severely damaged!") + . = SPAN_WARNING("It looks severely damaged!") if (0.25 to 0.5) - . += SPAN_WARNING("It looks damaged!") + . = SPAN_WARNING("It looks damaged!") if (0.5 to 1.0) - . += SPAN_NOTICE("It has a few scrapes and dents.") + . = SPAN_NOTICE("It has a few scrapes and dents.") /obj/structure/railing/mechanics_hints(mob/user, distance, is_adjacent) . += ..() @@ -88,8 +88,8 @@ name = "[material.display_name] [initial(name)]" desc = "A simple [material.display_name] railing designed to protect against careless trespass." - maxhealth = round(material.integrity / 5) - health = maxhealth + set_maxhealth(round(material.integrity / 5)) + set_health(maxhealth) color = material.icon_colour if(material.products_need_process()) @@ -124,13 +124,11 @@ return !density return TRUE -/obj/structure/railing/proc/take_damage(amount) - health -= amount - if(health <= 0) - visible_message(SPAN_WARNING("\The [src] [material.destruction_desc]!")) - playsound(get_turf(src), 'sound/effects/grillehit.ogg', 50, TRUE) - material.place_shard(get_turf(src)) - qdel(src) +/obj/structure/railing/on_death(damage, damage_flags, damage_type, armor_penetration, obj/weapon) + visible_message(SPAN_WARNING("\The [src] [material.destruction_desc]!")) + playsound(get_turf(src), 'sound/effects/grillehit.ogg', 50, TRUE) + material.place_shard(get_turf(src)) + qdel(src) /obj/structure/railing/proc/NeighborsCheck(var/UpdateNeighbors = 1) neighbor_status = 0 @@ -298,7 +296,7 @@ if(health >= maxhealth) return user.visible_message(SPAN_NOTICE("\The [user] repairs some damage to \the [src]."), SPAN_NOTICE("You repair some damage to \the [src].")) - health = min(health + (maxhealth / 5), maxhealth) + add_health(maxhealth * 0.5) return // Install @@ -320,7 +318,7 @@ if(attacking_item.force && (attacking_item.damtype == DAMAGE_BURN || attacking_item.damtype == DAMAGE_BRUTE)) user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) visible_message(SPAN_WARNING("\The [src] has been [LAZYLEN(attacking_item.attack_verb) ? pick(attacking_item.attack_verb) : "attacked"] with \the [attacking_item] by \the [user]!")) - take_damage(attacking_item.force) + add_damage(attacking_item.force, attacking_item.damage_flags(), attacking_item.damtype, attacking_item.armor_penetration, attacking_item) return . = ..() @@ -367,7 +365,7 @@ LAZYREMOVE(climbers, user) if(!anchored || material.is_brittle()) - take_damage(maxhealth) // Fatboy + add_damage(maxhealth) // Fatboy /obj/structure/railing/proc/get_destination_turf(var/mob/user) . = get_turf(src) // by default, we pop into the turf the railing's on @@ -394,8 +392,7 @@ icon = 'icons/obj/doors/retractable_railing.dmi' icon_state = "railing1" anchored = TRUE - health = 150 - maxhealth = 150 + maxhealth = OBJECT_HEALTH_MEDIUM non_material_object = TRUE can_wrench = FALSE can_screwdriver = FALSE diff --git a/code/game/objects/structures/simple_doors.dm b/code/game/objects/structures/simple_doors.dm index 6fda4ba3344..6c3d00a8e1e 100644 --- a/code/game/objects/structures/simple_doors.dm +++ b/code/game/objects/structures/simple_doors.dm @@ -2,18 +2,19 @@ name = "door" density = 1 anchored = 1 + maxhealth = OBJECT_HEALTH_VERY_LOW icon = 'icons/obj/doors/material_doors.dmi' icon_state = "metal" build_amt = 10 + var/state = 0 //closed, 1 == open var/isSwitchingStates = 0 var/oreAmount = 7 var/datum/lock/lock var/initial_lock_value //for mapping purposes. Basically if this value is set, it sets the lock to this value. - var/health = 100 - var/maxhealth = 100 + /obj/structure/simple_door/feedback_hints(mob/user, distance, is_adjacent) . += ..() @@ -41,8 +42,8 @@ name = "[material.display_name] door" color = material.icon_colour - maxhealth = max(1,round(material.integrity)) - health = maxhealth + set_health(material.integrity) + set_health(maxhealth) if(initial_lock_value) locked = initial_lock_value diff --git a/code/game/objects/structures/stool_bed_chair_nest/bed.dm b/code/game/objects/structures/stool_bed_chair_nest/bed.dm index ad18f9390cc..8d14b21176e 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/bed.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/bed.dm @@ -252,12 +252,15 @@ update_icon() /obj/structure/bed/dismantle(obj/item/W, mob/user) - user.visible_message("[user] begins dismantling \the [src].", SPAN_NOTICE("You begin dismantling \the [src].")) - if(W.use_tool(src, user, 20, volume = 50)) - user.visible_message("\The [user] dismantles \the [src].", SPAN_NOTICE("You dismantle \the [src].")) - if(padding_material) - padding_material.place_sheet(get_turf(src)) - ..() + if(user) + user.visible_message("[user] begins dismantling \the [src].", SPAN_NOTICE("You begin dismantling \the [src].")) + if(W.use_tool(src, user, 20, volume = 50)) + user.visible_message("\The [user] dismantles \the [src].", SPAN_NOTICE("You dismantle \the [src].")) + else + return FALSE + if(padding_material) + padding_material.place_sheet(get_turf(src)) + ..() /obj/structure/bed/Move() . = ..() diff --git a/code/game/objects/structures/urban.dm b/code/game/objects/structures/urban.dm index b80d6c73adc..62556aaf3bb 100644 --- a/code/game/objects/structures/urban.dm +++ b/code/game/objects/structures/urban.dm @@ -744,7 +744,7 @@ ABSTRACT_TYPE(/obj/structure/stairs/urban/road_ramp) icon = 'icons/obj/structure/urban/windows_tall.dmi' icon_state = "wood" basestate = "wood" - maxhealth = 60 + maxhealth = OBJECT_HEALTH_VERY_LOW alpha = 255 /obj/structure/window/urban/framed @@ -791,8 +791,7 @@ ABSTRACT_TYPE(/obj/structure/stairs/urban/road_ramp) icon = 'icons/obj/structure/urban/building_external.dmi' icon_state = "wall_half" //basestate = "wall_half" - health = 200 - maxhealth = 200 + maxhealth = OBJECT_HEALTH_HIGH layer = ABOVE_HUMAN_LAYER /obj/structure/blocker/exterior_wall/red diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index 78a1e15e233..27fbd3a99a2 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -17,11 +17,11 @@ anchored = TRUE atom_flags = ATOM_FLAG_CHECKS_BORDER obj_flags = OBJ_FLAG_ROTATABLE|OBJ_FLAG_MOVES_UNSUPPORTED - var/hitsound = 'sound/effects/glass_hit.ogg' - var/maxhealth = 14 + maxhealth = OBJECT_HEALTH_FRAGILE + hitsound = 'sound/effects/glass_hit.ogg' + var/maximal_heat = T0C + 100 // Maximal heat before this window begins taking damage from fire 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/health var/ini_dir = null var/state = 2 var/reinf = FALSE @@ -34,27 +34,26 @@ atmos_canpass = CANPASS_PROC -/obj/structure/window/condition_hints(mob/user, distance, is_adjacent) - . += ..() +/obj/structure/window/get_damage_condition_hints(mob/user, distance, is_adjacent) if(health == maxhealth) - . += SPAN_NOTICE("It looks fully intact.") + . = SPAN_NOTICE("It looks fully intact.") else var/perc = health / maxhealth if(perc > 0.75) - . += SPAN_NOTICE("It has a few cracks.") + . = SPAN_NOTICE("It has a few cracks.") else if(perc > 0.5) - . += SPAN_WARNING("It looks slightly damaged.") + . = SPAN_WARNING("It looks slightly damaged.") else if(perc > 0.25) - . += SPAN_WARNING("It looks moderately damaged.") + . = SPAN_WARNING("It looks moderately damaged.") else - . += SPAN_DANGER("It looks heavily damaged.") + . = SPAN_DANGER("It looks heavily damaged.") if(silicate) if (silicate < 30) - . += SPAN_NOTICE("It has a thin layer of silicate.") + . = SPAN_NOTICE("It has a thin layer of silicate.") else if (silicate < 70) - . += SPAN_NOTICE("It is covered in silicate.") + . = SPAN_NOTICE("It is covered in silicate.") else - . += SPAN_NOTICE("There is a thick layer of silicate covering it.") + . = SPAN_NOTICE("There is a thick layer of silicate covering it.") /obj/structure/window/proc/update_nearby_icons() QUEUE_SMOOTH_NEIGHBORS(src) @@ -65,38 +64,14 @@ layer = ABOVE_HUMAN_LAYER QUEUE_SMOOTH(src) -/obj/structure/window/proc/take_damage(var/damage = 0, var/sound_effect = 1, message = TRUE) - var/initialhealth = health - - if(silicate) - damage = damage * (1 - silicate / 200) - - health = max(0, health - damage) - - if(health <= 0) - shatter(message) - else - if(sound_effect) - playsound(loc, 'sound/effects/glass_hit.ogg', 100, 1) - if(health < maxhealth / 4 && initialhealth >= maxhealth / 4) - if(message) - visible_message(SPAN_DANGER("[src] looks like it's about to shatter!")) - playsound(loc, SFX_GLASS_CRACK, 100, 1) - else if(health < maxhealth / 2 && initialhealth >= maxhealth / 2) - if(message) - visible_message(SPAN_WARNING("[src] looks seriously damaged!")) - playsound(loc, SFX_GLASS_CRACK, 100, 1) - else if(health < maxhealth * 3/4 && initialhealth >= maxhealth * 3/4) - if(message) - visible_message(SPAN_WARNING("Cracks begin to appear in [src]!")) - playsound(loc, SFX_GLASS_CRACK, 100, 1) - return +/obj/structure/window/on_death(damage, damage_flags, damage_type, armor_penetration, obj/weapon, message) + shatter(message) /obj/structure/window/proc/apply_silicate(var/amount) if(health < maxhealth) // Mend the damage. - health = min(health + amount * 3, maxhealth) + add_health(amount * 3) if(health == maxhealth) - visible_message("[src] looks fully repaired." ) + visible_message(SPAN_NOTICE("The silicate fully mends the damage on \the [src].")) else // Reinforce. silicate = min(silicate + amount, 100) updateSilicate() @@ -145,23 +120,19 @@ if(. != BULLET_ACT_HIT) return . - take_damage(proj_damage) - return + add_damage(proj_damage) /obj/structure/window/ex_act(severity) switch(severity) if(1) qdel(src) - return if(2) shatter(0) - return if(3) if(prob(50)) shatter(0) - return else - take_damage(rand(10,30), TRUE, FALSE) + add_damage(rand(10,30), TRUE, FALSE) // This and relevant verbs/procs can probably be removed since full windows are a thing now. -Gem /obj/structure/window/proc/is_full_window() @@ -210,7 +181,7 @@ anchored = 0 update_nearby_icons() step(src, get_dir(hitting_atom, src)) - take_damage(tforce) + add_damage(tforce) /obj/structure/window/attack_hand(var/mob/living/user) user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) @@ -243,7 +214,7 @@ user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) if(damage >= 10) visible_message(SPAN_DANGER("[user] smashes into [src]!")) - take_damage(damage) + add_damage(damage) else visible_message(SPAN_NOTICE("\The [user] bonks \the [src] harmlessly.")) playsound(src.loc, 'sound/effects/glass_hit.ogg', 10, 1, -2) @@ -347,8 +318,7 @@ /obj/structure/window/proc/hit(var/damage, var/sound_effect = 1) if(reinf) damage *= 0.5 - take_damage(damage) - return + add_damage(damage) /obj/structure/window/proc/dismantle_window() if(dir == SOUTHWEST) @@ -369,8 +339,6 @@ if (start_dir) set_dir(start_dir) - health = maxhealth - ini_dir = dir update_nearby_tiles(need_rebuild=1) @@ -429,7 +397,7 @@ glasstype = /obj/item/stack/material/glass maximal_heat = T0C + 100 damage_per_fire_tick = 2 - maxhealth = 12 + maxhealth = OBJECT_HEALTH_FRAGILE /obj/structure/window/basic/full name = "glass" @@ -441,7 +409,7 @@ desc = "It looks rather strong. Might take a few good hits to shatter it." icon_state = "rwindow" basestate = "rwindow" - maxhealth = 40 + maxhealth = OBJECT_HEALTH_LOW reinf = TRUE maximal_heat = T0C + 750 damage_per_fire_tick = 2 @@ -462,7 +430,7 @@ /obj/structure/window/reinforced/tinted/frosted name = "reinforced frosted glass pane" desc = "It looks rather strong and frosted over. Looks like it might take a few less hits then a normal reinforced window." - maxhealth = 30 + maxhealth = OBJECT_HEALTH_EXTREMELY_LOW /obj/structure/window/reinforced/polarized name = "reinforced electrochromic glass pane" @@ -489,9 +457,6 @@ /obj/structure/window/reinforced/crescent/hitby(atom/movable/hitting_atom, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) return -/obj/structure/window/reinforced/crescent/take_damage() - return - /obj/structure/window/reinforced/crescent/shatter() return @@ -536,7 +501,7 @@ glasstype = /obj/item/stack/material/glass/phoronglass maximal_heat = T0C + 2000 damage_per_fire_tick = 1 // This should last for 80 fire ticks if the window is not damaged at all. The idea is that borosilicate windows have something like ablative layer that protects them for a while. - maxhealth = 40 + maxhealth = OBJECT_HEALTH_VERY_LOW /// Phoron-infused silicate rad_resistance_modifier = 4 @@ -547,13 +512,13 @@ glasstype = /obj/item/stack/material/glass/phoronrglass reinf = TRUE maximal_heat = T0C + 4000 - maxhealth = 80 + maxhealth = OBJECT_HEALTH_LOW /obj/structure/window/borosilicate/reinforced/skrell name = "advanced borosilicate alloy window" desc = "A window made out of a higly advanced borosilicate alloy. It seems to be extremely strong." color = GLASS_COLOR_PHORON - maxhealth = 250 + maxhealth = OBJECT_HEALTH_HIGH /********** Shuttle Windows **********/ /obj/structure/window/shuttle @@ -564,7 +529,7 @@ basestate = "w" atom_flags = 0 obj_flags = null - maxhealth = 40 + maxhealth = OBJECT_HEALTH_VERY_LOW reinf = TRUE dir = 5 smoothing_flags = SMOOTH_TRUE @@ -579,8 +544,7 @@ /obj/structure/window/shuttle/legion name = "reinforced cockpit window" icon = 'icons/obj/smooth/shuttle_window_legion.dmi' - health = 160 - maxhealth = 160 + maxhealth = OBJECT_HEALTH_HIGH /obj/structure/window/shuttle/palepurple icon = 'icons/obj/smooth/shuttle_window_palepurple.dmi' @@ -589,8 +553,7 @@ name = "advanced borosilicate alloy window" desc = "It looks extremely strong. Might take many good hits to crack it." icon = 'icons/obj/smooth/skrell_window_purple.dmi' - health = 500 - maxhealth = 500 + maxhealth = OBJECT_HEALTH_VERY_HIGH smoothing_flags = SMOOTH_MORE | SMOOTH_DIAGONAL canSmoothWith = list( /turf/simulated/wall/shuttle/skrell, @@ -602,8 +565,7 @@ desc = "It looks extremely strong. Might take many good hits to crack it." icon = 'icons/turf/smooth/scc_ship/scc_ship_windows.dmi' icon_state = "map_window" - health = 500 - maxhealth = 500 + maxhealth = OBJECT_HEALTH_VERY_HIGH alpha = 255 smoothing_flags = SMOOTH_MORE canSmoothWith = list( @@ -629,15 +591,11 @@ /obj/structure/window/shuttle/scc icon = 'icons/obj/smooth/scc_shuttle_window.dmi' - health = 160 - maxhealth = 160 + maxhealth = OBJECT_HEALTH_HIGH /obj/structure/window/shuttle/crescent desc = "It looks rather strong." -/obj/structure/window/shuttle/crescent/take_damage() - return - // // Full Windows // @@ -647,7 +605,7 @@ atom_flags = 0 obj_flags = null dir = 5 - maxhealth = 28 // Two glass panes worth of health, since that's the minimum you need to break through to get to the other side. + maxhealth = OBJECT_HEALTH_EXTREMELY_LOW glasstype = /obj/item/stack/material/glass shardtype = /obj/item/material/shard full = TRUE @@ -757,14 +715,12 @@ qdel(src) return -/obj/structure/window/full/take_damage(var/damage = 0, var/sound_effect = 1) +/obj/structure/window/full/add_damage(damage, damage_flags, damage_type, armor_penetration, obj/weapon, sound_effect = TRUE) var/initialhealth = health if(silicate) damage = damage * (1 - silicate / 200) - health = max(0, health - damage) - if(health <= 0) shatter() else @@ -779,7 +735,6 @@ else if(health < maxhealth * 3/4 && initialhealth >= maxhealth * 3/4) visible_message(SPAN_WARNING("Cracks begin to appear in [src]!")) playsound(loc, SFX_GLASS_CRACK, 100, 1) - return /obj/structure/window/full/dismantle_window() var/obj/item/stack/material/mats = new glasstype(loc) @@ -803,7 +758,7 @@ icon = 'icons/obj/smooth/window/full_window.dmi' icon_state = "window_glass" basestate = "window_glass" - maxhealth = 80 // Two reinforced panes worth of health, since that's the minimum you need to break through to get to the other side. + maxhealth = OBJECT_HEALTH_LOW reinf = TRUE maximal_heat = T0C + 750 glasstype = /obj/item/stack/material/glass/reinforced @@ -834,9 +789,6 @@ /obj/structure/window/full/reinforced/indestructible/hitby(atom/movable/hitting_atom, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) return -/obj/structure/window/full/reinforced/indestructible/take_damage() - return - /obj/structure/window/full/reinforced/indestructible/shatter() return @@ -867,9 +819,6 @@ /obj/structure/window/full/reinforced/polarized/indestructible/hitby(atom/movable/hitting_atom, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) return -/obj/structure/window/full/reinforced/polarized/indestructible/take_damage() - return - /obj/structure/window/full/reinforced/polarized/indestructible/shatter() return @@ -898,7 +847,7 @@ basestate = "window_glass" glasstype = /obj/item/stack/material/glass/phoronglass shardtype = /obj/item/material/shard/phoron - maxhealth = 80 // Two borosilicate glass panes worth of health, since that's the minimum you need to break through to get to the other side. + maxhealth = OBJECT_HEALTH_LOW maximal_heat = T0C + 2000 damage_per_fire_tick = 1 @@ -907,7 +856,7 @@ name = "reinforced borosilicate window" desc = "A borosilicate alloy window, with rods supporting it. It seems to be very strong." glasstype = /obj/item/stack/material/glass/phoronrglass - maxhealth = 160 // Two reinforced borosilicate glass panes worth of health, since that's the minimum you need to break through to get to the other side. + maxhealth = OBJECT_HEALTH_MEDIUM reinf = TRUE maximal_heat = T0C + 4000 rad_resistance_modifier = 4 diff --git a/code/game/turfs/simulated/wall_attacks.dm b/code/game/turfs/simulated/wall_attacks.dm index ae374ff897e..55c13be8bff 100644 --- a/code/game/turfs/simulated/wall_attacks.dm +++ b/code/game/turfs/simulated/wall_attacks.dm @@ -28,7 +28,7 @@ user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN*2.5) to_chat(user, SPAN_DANGER("You smash against the wall!")) user.do_attack_animation(src) - take_damage(rand(60,135)*multiplier) + add_damage(rand(60,135)*multiplier) return 1 /turf/simulated/wall/proc/success_smash(var/mob/user) @@ -167,7 +167,7 @@ var/turf/T = user.loc //get user's location for delay checks - if(damage && attacking_item.tool_behaviour == TOOL_WELDER) + if(health < maxhealth && attacking_item.tool_behaviour == TOOL_WELDER) var/obj/item/weldingtool/WT = attacking_item @@ -177,9 +177,9 @@ if(WT.use(0,user)) to_chat(user, SPAN_NOTICE("You start repairing the damage to [src].")) playsound(src, 'sound/items/Welder.ogg', 50, 1) - if(WT.use_tool(src, user, max(5, damage / 5), volume = 50) && WT && WT.isOn()) + if(WT.use_tool(src, user, max(5, abs(health - maxhealth) / 5), volume = 50) && WT && WT.isOn()) to_chat(user, SPAN_NOTICE("You finish repairing the damage to [src].")) - take_damage(-damage) + add_health(maxhealth - health) clear_bulletholes() else to_chat(user, SPAN_NOTICE("You need more welding fuel to complete this task.")) @@ -389,7 +389,7 @@ //Steel walls take 3 & 15 minimum damage. damage_to_deal -= weaken visible_message(SPAN_WARNING("[user] strikes \the [src] with \the [attacking_item], [is_sharp(attacking_item) ? "slicing some of the plating" : "putting a heavy dent on it"]!")) - take_damage(damage_to_deal) + add_damage(damage_to_deal, attacking_item.damage_flags(), attacking_item.damtype, attacking_item.armor_penetration, attacking_item) else visible_message(SPAN_WARNING("[user] strikes \the [src] with \the [attacking_item], but it bounces off!")) playsound(src, hitsound, 25, 1) diff --git a/code/game/turfs/simulated/wall_icon.dm b/code/game/turfs/simulated/wall_icon.dm index 6ba0a3d1a7b..354b02315e5 100644 --- a/code/game/turfs/simulated/wall_icon.dm +++ b/code/game/turfs/simulated/wall_icon.dm @@ -91,12 +91,12 @@ if (reinforcement_images) overlays_to_add += reinforcement_images - if(damage != 0) + if(health < maxhealth) var/integrity = material.integrity if(reinf_material) integrity += reinf_material.integrity - var/overlay = round(damage / integrity * damage_overlays.len) + 1 + var/overlay = round(abs(health - maxhealth) / integrity * damage_overlays.len) + 1 if(overlay > damage_overlays.len) overlay = damage_overlays.len diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm index 87adbae457c..0f0e8ddcf59 100644 --- a/code/game/turfs/simulated/walls.dm +++ b/code/game/turfs/simulated/walls.dm @@ -5,6 +5,7 @@ icon_state = "wall" opacity = TRUE density = TRUE + should_use_health = TRUE blocks_air = TRUE pass_flags_self = PASSCLOSEDTURF thermal_conductivity = WALL_HEAT_TRANSFER_COEFFICIENT @@ -22,10 +23,9 @@ /obj/machinery/door, /obj/machinery/door/airlock ) - + hitsound = 'sound/weapons/Genhit.ogg' explosion_resistance = 10 - var/damage = 0 var/damage_overlay = 0 var/global/damage_overlays[16] var/active @@ -34,7 +34,6 @@ var/material/reinf_material var/last_state var/construction_stage - var/hitsound = 'sound/weapons/Genhit.ogg' var/use_set_icon_state var/under_turf = /turf/simulated/floor/plating @@ -51,7 +50,7 @@ /turf/simulated/wall/condition_hints(mob/user, distance, is_adjacent) . += ..() - if(!damage) + if(health >= maxhealth) . += SPAN_NOTICE("It looks fully intact.") else // Total damage is based of base material integrity and optionally, if reinforced, reinforcement material integrity on top @@ -59,7 +58,7 @@ if(reinf_material) integrity += reinf_material.integrity - var/relative_damage = damage / integrity + var/relative_damage = health / maxhealth if(relative_damage <= 0.25) . += SPAN_NOTICE("It looks slightly damaged.") @@ -113,6 +112,7 @@ reinf_material = SSmaterials.get_material_by_name(rmaterialtype) update_material() hitsound = material.hitsound + set_maxhealth(material.integrity + (reinf_material ? reinf_material.integrity : 0)) if (material.radioactivity || (reinf_material && reinf_material.radioactivity)) START_PROCESSING(SSprocessing, src) @@ -152,7 +152,7 @@ if(hitting_projectile.anti_materiel_potential <= 1) damage = min(proj_damage, 100) - take_damage(damage) + add_damage(damage) /turf/simulated/wall/hitby(atom/movable/hitting_atom, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) ..() @@ -166,7 +166,7 @@ var/tforce = O.throwforce * (throwingdatum.speed/THROWFORCE_SPEED_DIVISOR) playsound(src, hitsound, tforce >= 15? 60 : 25, TRUE) if(tforce >= 15) - take_damage(tforce) + add_damage(tforce) /turf/simulated/wall/proc/clear_plants() for(var/obj/effect/overlay/wallrot/WR in src) @@ -197,26 +197,15 @@ if(do_message) visible_message(SPAN_DANGER("\The [src] spontaneously combusts!")) //!!OH SHIT!! -/turf/simulated/wall/proc/take_damage(dam) - if(dam) - damage = max(0, damage + dam) - update_damage() - return - -/turf/simulated/wall/proc/update_damage() - var/cap = material.integrity - if(reinf_material) - cap += reinf_material.integrity - +/turf/simulated/wall/add_damage(damage, damage_flags, damage_type, armor_penetration, obj/weapon) if(locate(/obj/effect/overlay/wallrot) in src) - cap = cap / 10 + visible_message(SPAN_WARNING("\The [src] crumbles further under the rot!")) + damage *= 10 + . = ..() + update_icon() - if(damage >= cap) - dismantle_wall() - else - update_icon() - - return +/turf/simulated/wall/on_death(damage, damage_flags, damage_type, armor_penetration, obj/weapon) + dismantle_wall() /turf/simulated/wall/fire_act(exposed_temperature, exposed_volume) //Doesn't fucking work because walls don't interact with air :[ . = ..() @@ -225,7 +214,7 @@ /turf/simulated/wall/adjacent_fire_act(turf/simulated/floor/adj_turf, datum/gas_mixture/adj_air, adj_temp, adj_volume) burn(adj_temp) if(adj_temp > material.melting_point) - take_damage(log(RAND_F(0.9, 1.1) * (adj_temp - material.melting_point))) + add_damage(log(RAND_F(0.9, 1.1) * (adj_temp - material.melting_point))) return ..() @@ -262,11 +251,11 @@ return if(2.0) if(prob(75)) - take_damage(rand(150, 250)) + add_damage(rand(150, 250)) else dismantle_wall(1,1) if(3.0) - take_damage(rand(0, 250)) + add_damage(rand(0, 250)) return diff --git a/code/game/turfs/turf_changing.dm b/code/game/turfs/turf_changing.dm index 00733701fac..336b1658378 100644 --- a/code/game/turfs/turf_changing.dm +++ b/code/game/turfs/turf_changing.dm @@ -251,7 +251,7 @@ /turf/simulated/wall/copy_turf(turf/simulated/wall/other, ignore_air = FALSE) .=..() - other.damage = damage + other.health = health /turf/simulated/floor/copy_turf(turf/simulated/floor/other, ignore_air = FALSE) .=..() diff --git a/code/modules/blob/blob.dm b/code/modules/blob/blob.dm index 46d7e19b541..4f8ddeef897 100644 --- a/code/modules/blob/blob.dm +++ b/code/modules/blob/blob.dm @@ -12,8 +12,8 @@ layer = BLOB_SHIELD_LAYER - var/maxHealth = 30 - var/health + maxhealth = 30 + var/regen_rate = 5 /// Damage gets divided by these modifiers, based on damage type @@ -40,7 +40,6 @@ /obj/effect/blob/Initialize() . = ..() - health = maxHealth update_icon() START_PROCESSING(SSprocessing, src) @@ -54,37 +53,37 @@ /obj/effect/blob/ex_act(var/severity) switch(severity) if(1) - take_damage(rand(100, 120) / brute_resist) + add_damage(rand(100, 120) / brute_resist) if(2) - take_damage(rand(60, 100) / brute_resist) + add_damage(rand(60, 100) / brute_resist) if(3) - take_damage(rand(20, 60) / brute_resist) + add_damage(rand(20, 60) / brute_resist) /obj/effect/blob/update_icon() - if(health > maxHealth / 2) + if(health > maxhealth / 2) icon_state = "blob" else icon_state = "blob_damaged" /obj/effect/blob/process() if(!parent_core || QDELETED(parent_core)) - take_damage(maxHealth / 4) // four processes to die if main core is deddo + add_damage(maxhealth / 4) // four processes to die if main core is deddo return regen() if(world.time < (attack_time + attack_cooldown)) return attempt_attack() -/obj/effect/blob/proc/take_damage(var/damage) - health -= damage - if(health < 0) - playsound(get_turf(src), 'sound/effects/splat.ogg', 50, TRUE) - qdel(src) - else - update_icon() +/obj/effect/blob/add_damage(damage, damage_flags, damage_type, armor_penetration, obj/weapon) + . = ..() + update_icon() + +/obj/effect/blob/on_death(damage, damage_flags, damage_type, armor_penetration, obj/weapon) + playsound(get_turf(src), 'sound/effects/splat.ogg', 50, TRUE) + . = ..() /obj/effect/blob/proc/regen() - health = min(health + regen_rate, maxHealth) + health = min(health + regen_rate, maxhealth) update_icon() /obj/effect/blob/proc/expand(var/turf/T) @@ -92,11 +91,11 @@ return if(istype(T, /turf/simulated/wall)) var/turf/simulated/wall/SW = T - SW.take_damage(80) + SW.add_damage(80) return var/obj/structure/girder/G = locate() in T if(G) - G.take_damage(rand(40, 80)) + G.add_damage(rand(40, 80)) return var/obj/structure/window/W = locate() in T if(W) @@ -108,7 +107,7 @@ return var/obj/structure/tank_wall/TW = locate() in T if(TW) - TW.take_damage(rand(5,20)) + TW.add_damage(rand(5,20)) return for(var/obj/machinery/door/D in T) // There can be several - and some of them can be open, locate() is not suitable if(D.density) @@ -139,7 +138,7 @@ return var/obj/machinery/camera/CA = locate() in T if(CA && !(CA.stat & BROKEN)) - CA.take_damage(30) + CA.add_damage(30) return // Above things, we destroy completely and thus can use locate. Mobs are different. @@ -180,7 +179,7 @@ if(!D) return attack_msg(D) - D.take_damage(rand(damage_min, damage_max)) + D.add_damage(rand(damage_min, damage_max)) /obj/effect/blob/proc/attack_living(var/mob/living/L) if(!L) @@ -207,9 +206,9 @@ switch(hitting_projectile.damage_type) if(DAMAGE_BRUTE) - take_damage(hitting_projectile.damage / brute_resist) + add_damage(hitting_projectile.damage / brute_resist) if(DAMAGE_BURN) - take_damage((hitting_projectile.damage / laser_resist) / fire_resist) + add_damage((hitting_projectile.damage / laser_resist) / fire_resist) /obj/effect/blob/attackby(obj/item/attacking_item, mob/user) user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) @@ -235,12 +234,12 @@ if(DAMAGE_BRUTE) damage = (attacking_item.force / brute_resist) - take_damage(damage) + add_damage(damage) /obj/effect/blob/fire_act(exposed_temperature, exposed_volume) . = ..() - take_damage(rand(5, 20) / fire_resist) + add_damage(rand(5, 20) / fire_resist) #define CORE_SHIELD_HIGH "high" #define CORE_SHIELD_LOW "low" @@ -249,7 +248,7 @@ name = "master nucleus" desc = "A massive, fragile nucleus guarded by a shield of thick tendrils." icon_state = "blob_core" - maxHealth = 450 + maxhealth = 450 damage_min = 25 damage_max = 35 expandType = /obj/effect/blob/shield @@ -265,7 +264,7 @@ var/times_to_pulse = 4 /obj/effect/blob/core/proc/get_health_percent() - return ((health / maxHealth) * 100) + return ((health / maxhealth) * 100) /obj/effect/blob/core/proc/process_core_health() var/health_percent = get_health_percent() @@ -313,7 +312,7 @@ name = "auxiliary nucleus" desc = "An interwoven mass of tendrils. A glowing nucleus pulses at its center." icon_state = "blob_node" - maxHealth = 125 + maxhealth = 125 regen_rate = 1 damage_min = 15 damage_max = 20 @@ -324,7 +323,7 @@ /obj/effect/blob/core/secondary/process() if(!parent_core || QDELETED(parent_core)) - take_damage(maxHealth / 4) // four processes to die if main core is deddo + add_damage(maxhealth / 4) // four processes to die if main core is deddo return ..() @@ -332,13 +331,13 @@ return /obj/effect/blob/core/secondary/update_icon() - icon_state = (health / maxHealth >= 0.5) ? "blob_node" : "blob_factory" + icon_state = (health / maxhealth >= 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" - maxHealth = 120 + maxhealth = 120 damage_min = 15 damage_max = 25 attack_cooldown = 45 @@ -357,9 +356,9 @@ return ..() /obj/effect/blob/shield/update_icon() - if(health > maxHealth * 2 / 3) + if(health > maxhealth * 2 / 3) icon_state = "blob_idle" - else if(health > maxHealth / 3) + else if(health > maxhealth / 3) icon_state = "blob" else icon_state = "blob_damaged" @@ -372,7 +371,7 @@ /obj/effect/blob/ravaging name = "ravaging mass" desc = "A mass of interwoven tendrils. They thrash around haphazardly at anything in reach." - maxHealth = 20 + maxhealth = 20 damage_min = 20 damage_max = 25 attack_cooldown = 30 diff --git a/code/modules/heavy_vehicle/components/_components.dm b/code/modules/heavy_vehicle/components/_components.dm index 07688994f92..bf3ac8791f5 100644 --- a/code/modules/heavy_vehicle/components/_components.dm +++ b/code/modules/heavy_vehicle/components/_components.dm @@ -78,7 +78,7 @@ user.visible_message(SPAN_NOTICE("\The [user] installs \the [thing] in \the [src].")) return 1 -/obj/item/mech_component/proc/update_health() +/obj/item/mech_component/proc/update_component_damage() total_damage = brute_damage + burn_damage if(total_damage > max_damage) total_damage = max_damage damage_state = clamp(round((total_damage/max_damage) * 4), MECH_COMPONENT_DAMAGE_UNDAMAGED, MECH_COMPONENT_DAMAGE_DAMAGED_TOTAL) @@ -94,13 +94,13 @@ /obj/item/mech_component/proc/take_brute_damage(var/amt) brute_damage = max(0, brute_damage + amt) - update_health() + update_component_damage() if(total_damage == max_damage) take_component_damage(amt,0) /obj/item/mech_component/proc/take_burn_damage(var/amt) burn_damage = max(0, burn_damage + amt) - update_health() + update_component_damage() if(total_damage == max_damage) take_component_damage(0,amt) diff --git a/code/modules/heavy_vehicle/mech_damage.dm b/code/modules/heavy_vehicle/mech_damage.dm index 0a0d06b7e1e..f830b001f00 100644 --- a/code/modules/heavy_vehicle/mech_damage.dm +++ b/code/modules/heavy_vehicle/mech_damage.dm @@ -28,31 +28,31 @@ . += chassis_armor /mob/living/heavy_vehicle/updatehealth() - maxHealth = body.mech_health - health = maxHealth-(getFireLoss()+getBruteLoss()) + maxhealth = body.mech_health + health = maxhealth-(getFireLoss()+getBruteLoss()) /mob/living/heavy_vehicle/adjustFireLoss(var/amount, var/obj/item/mech_component/C) if(C) C.take_brute_damage(amount) - C.update_health() + C.update_component_damage() else var/list/components = list(body, arms, legs, head) components = shuffle(components) for(var/obj/item/mech_component/MC in components) MC.take_burn_damage(amount) - MC.update_health() + MC.update_component_damage() break /mob/living/heavy_vehicle/adjustBruteLoss(var/amount, var/obj/item/mech_component/C) if(C) C.take_brute_damage(amount) - C.update_health() + C.update_component_damage() else var/list/components = list(body, arms, legs, head) components = shuffle(components) for(var/obj/item/mech_component/MC in components) MC.take_burn_damage(amount) - MC.update_health() + MC.update_component_damage() break /mob/living/heavy_vehicle/proc/zoneToComponent(var/zone) diff --git a/code/modules/holodeck/HolodeckObjects.dm b/code/modules/holodeck/HolodeckObjects.dm index b5dc3123bda..50bbc8e18bb 100644 --- a/code/modules/holodeck/HolodeckObjects.dm +++ b/code/modules/holodeck/HolodeckObjects.dm @@ -213,7 +213,7 @@ playsound(src.loc, 'sound/effects/glass_hit.ogg', 75, 1) visible_message(SPAN_DANGER("[src] was hit by [attacking_item].")) if(attacking_item.damtype == DAMAGE_BRUTE || attacking_item.damtype == DAMAGE_BURN) - take_damage(aforce) + add_damage(aforce) return src.add_fingerprint(user) @@ -231,12 +231,12 @@ return -/obj/machinery/door/window/holowindoor/shatter(var/display_message = 1) - src.density = 0 +/obj/machinery/door/window/holowindoor/on_death(damage, damage_flags, damage_type, armor_penetration, obj/weapon, display_message = TRUE) + density = FALSE playsound(src, SFX_BREAK_GLASS, 70, 1) if(display_message) - visible_message("[src] fades away as it shatters!") - qdel(src) + visible_message(SPAN_WARNING("[src] fades away as it shatters!")) + . = ..() /obj/structure/bed/stool/chair/holochair held_item = null diff --git a/code/modules/hydroponics/spreading/spreading.dm b/code/modules/hydroponics/spreading/spreading.dm index 2808bb90b61..9f2b7f930bc 100644 --- a/code/modules/hydroponics/spreading/spreading.dm +++ b/code/modules/hydroponics/spreading/spreading.dm @@ -31,7 +31,7 @@ //make vine zero start off fully matured var/obj/effect/plant/vine = new(T,seed) - vine.health = vine.max_health + vine.health = vine.maxhealth vine.mature_time = 0 vine.process() var/area_display_name = get_area_display_name(get_area(T)) @@ -67,9 +67,7 @@ movable_flags = MOVABLE_FLAG_PROXMOVE pass_flags = PASSTABLE mouse_opacity = MOUSE_OPACITY_OPAQUE - - var/health = 10 - var/max_health = 100 + maxhealth = 100 var/growth_threshold = 0 var/growth_type = 0 @@ -93,6 +91,7 @@ for(var/obj/effect/plant/neighbor in range(1,src)) if (!QDELETED(neighbor)) SSplants.add_plant(neighbor) + QDEL_NULL(plant) return ..() /obj/effect/plant/single @@ -119,15 +118,15 @@ return name = seed.display_name - max_health = round(GET_SEED_TRAIT(seed, TRAIT_ENDURANCE)/2) + maxhealth = round(GET_SEED_TRAIT(seed, TRAIT_ENDURANCE)/2) if(GET_SEED_TRAIT(seed, TRAIT_SPREAD) == 2) mouse_opacity = 2 max_growth = VINE_GROWTH_STAGES - growth_threshold = max_health/VINE_GROWTH_STAGES + growth_threshold = maxhealth/VINE_GROWTH_STAGES growth_type = seed.get_growth_type() else max_growth = seed.growth_stages - growth_threshold = max_health/seed.growth_stages + growth_threshold = maxhealth/seed.growth_stages if(max_growth > 2 && prob(50)) max_growth-- //Ensure some variation in final sprite, makes the carpet of crap look less wonky. @@ -322,7 +321,7 @@ die_off() /obj/effect/plant/proc/is_mature() - return (health >= (max_health/3) && world.time > mature_time) + return (health >= (maxhealth/3) && world.time > mature_time) #undef DEFAULT_SEED diff --git a/code/modules/hydroponics/spreading/spreading_growth.dm b/code/modules/hydroponics/spreading/spreading_growth.dm index d57d3f0e4a7..c30f282bfdb 100644 --- a/code/modules/hydroponics/spreading/spreading_growth.dm +++ b/code/modules/hydroponics/spreading/spreading_growth.dm @@ -47,12 +47,12 @@ var/turf/simulated/T = get_turf(src) if(istype(T)) health -= seed.handle_environment(T,T.return_air(),null,1) - if(health < max_health) + if(health < maxhealth) health += rand(3,5) refresh_icon() - if(health > max_health) - health = max_health - else if(health == max_health && !plant) + if(health > maxhealth) + health = maxhealth + else if(health == maxhealth && !plant) plant = new(T,seed) plant.dir = src.dir plant.transform = src.transform @@ -90,7 +90,7 @@ // We shouldn't have spawned if the controller doesn't exist. check_health() - if(neighbors.len || health != max_health || buckled || !is_mature()) + if(neighbors.len || health != maxhealth || buckled || !is_mature()) SSplants.add_plant(src) /obj/effect/plant/proc/do_spread(spread_chance, max_spread) diff --git a/code/modules/hydroponics/trays/tray.dm b/code/modules/hydroponics/trays/tray.dm index dddd0210365..72ff2ac8c6d 100644 --- a/code/modules/hydroponics/trays/tray.dm +++ b/code/modules/hydroponics/trays/tray.dm @@ -59,7 +59,7 @@ // Mechanical concerns. /// Plant health. - var/health = 0 + var/plant_health = 0 /// Last time tray was harvested var/lastproduce = 0 /// Cycle timing/tracking var. @@ -296,7 +296,7 @@ /// If the plant should be dead, kill it. Otherwise, don't. /obj/machinery/portable_atmospherics/hydroponics/proc/check_health() - if(seed && !dead && health <= 0) + if(seed && !dead && plant_health <= 0) die() check_level_sanity() update_icon() @@ -337,9 +337,9 @@ if(pestkiller_reagents[_R]) pestlevel += pestkiller_reagents[_R] * reagent_total - // Beneficial reagents have a few impacts along with health buffs. + // Beneficial reagents have a few impacts along with plant_health buffs. if(beneficial_reagents[_R]) - health += beneficial_reagents[_R][1] * reagent_total + plant_health += beneficial_reagents[_R][1] * reagent_total yield_mod += beneficial_reagents[_R][2] * reagent_total mutation_mod += beneficial_reagents[_R][3] * reagent_total @@ -430,7 +430,7 @@ dead = FALSE age = 0 - health = GET_SEED_TRAIT(seed, TRAIT_ENDURANCE) + plant_health = GET_SEED_TRAIT(seed, TRAIT_ENDURANCE) lastcycle = world.time stunted = FALSE harvest = FALSE @@ -486,9 +486,9 @@ /// Verifies that all values are what they should be. /obj/machinery/portable_atmospherics/hydroponics/proc/check_level_sanity() if(seed) - health = max(0,min(GET_SEED_TRAIT(seed, TRAIT_ENDURANCE),health)) + plant_health = max(0,min(GET_SEED_TRAIT(seed, TRAIT_ENDURANCE), plant_health)) else - health = 0 + plant_health = 0 dead = FALSE update_icon() @@ -510,7 +510,7 @@ dead = FALSE mutate(1) age = 0 - health = GET_SEED_TRAIT(seed, TRAIT_ENDURANCE) + plant_health = GET_SEED_TRAIT(seed, TRAIT_ENDURANCE) lastcycle = world.time harvest = FALSE weedlevel = 0 @@ -560,7 +560,7 @@ if(do_after(user, 1 SECOND)) playsound(src, 'sound/items/Wirecutter.ogg', 25, 1) seed.harvest(user,yield_mod,1) - health -= (rand(3,5)*10) + plant_health -= (rand(3,5)*10) if(prob(30)) sampled = 1 @@ -610,7 +610,7 @@ dead = 0 age = 1 //Snowflakey, maybe move this to the seed datum - health = (istype(S, /obj/item/seeds/cutting) ? round(GET_SEED_TRAIT(seed, TRAIT_ENDURANCE)/rand(2,5)) : GET_SEED_TRAIT(seed, TRAIT_ENDURANCE)) + plant_health = (istype(S, /obj/item/seeds/cutting) ? round(GET_SEED_TRAIT(seed, TRAIT_ENDURANCE)/rand(2,5)) : GET_SEED_TRAIT(seed, TRAIT_ENDURANCE)) lastcycle = world.time qdel(attacking_item) @@ -636,7 +636,7 @@ // Hatchets can uproot the contents of trays to kill the plant with one click. else if (istype(attacking_item, /obj/item/material/hatchet) && !closed_system) - if(health > 0) + if(plant_health > 0) user.visible_message(SPAN_DANGER("[user] begins uprooting the contents of \the [src]."), SPAN_DANGER("You begin to uproot the contents of \the [src].")) @@ -644,7 +644,7 @@ playsound(src, SFX_SHOVEL, 25, 1) user.visible_message(SPAN_DANGER("[user] uproots the contents of \the [src]!"), SPAN_DANGER("You successfully uproot the contents of \the [src].")) - health = 0 + plant_health = 0 check_health() else to_chat(user, SPAN_DANGER("There is nothing in this plot for you to uproot!")) @@ -686,7 +686,7 @@ var/total_damage = attacking_item.force if ((attacking_item.sharp) || (attacking_item.damtype == "fire")) //fire and sharp things are more effective when dealing with plants total_damage = 2*attacking_item.force - health -= total_damage + plant_health -= total_damage check_health() return @@ -801,7 +801,7 @@ if(seed) if(dead) . += SPAN_DANGER("The plant is dead.") - else if(health <= (GET_SEED_TRAIT(seed, TRAIT_ENDURANCE)/ 2)) + else if(plant_health <= (GET_SEED_TRAIT(seed, TRAIT_ENDURANCE)/ 2)) . += SPAN_BAD("The plant looks unhealthy.") if(stunted) . += SPAN_BAD("This harvest is stunted due to improper growing conditions, reducing yield.") diff --git a/code/modules/hydroponics/trays/tray_process.dm b/code/modules/hydroponics/trays/tray_process.dm index 45155ceb600..9d2088fcf9e 100644 --- a/code/modules/hydroponics/trays/tray_process.dm +++ b/code/modules/hydroponics/trays/tray_process.dm @@ -66,9 +66,9 @@ // water and nutrients will cause a plant to become healthier. var/healthmod = rand(1,3) * HYDRO_SPEED_MULTIPLIER if(GET_SEED_TRAIT(seed, TRAIT_REQUIRES_NUTRIENTS) && prob(35)) - health += (nutrilevel < 2 ? -healthmod : healthmod) + plant_health += (nutrilevel < 2 ? -healthmod : healthmod) if(GET_SEED_TRAIT(seed, TRAIT_REQUIRES_WATER) && prob(35)) - health += (waterlevel < 10 ? -healthmod : healthmod) + plant_health += (waterlevel < 10 ? -healthmod : healthmod) // Check that pressure, heat and light are all within bounds. // First, handle an open system or an unconnected closed system. @@ -94,8 +94,8 @@ environmental_damage = seed.handle_environment(T,environment) probability_of_growth = seed.get_probability_of_growth(T,environment) - // Reduce health by however much handle_environent returned. - health -= environmental_damage + // Reduce plant_health by however much handle_environent returned. + plant_health -= environmental_damage // If we're attached to a pipenet, then we should let the pipenet know we might have modified some gasses if (closed_system && connected_port) @@ -118,25 +118,25 @@ if(toxins > 0) var/toxin_uptake = max(1,round(toxins/10)) if(toxins > GET_SEED_TRAIT(seed, TRAIT_TOXINS_TOLERANCE)) - health -= toxin_uptake + plant_health -= toxin_uptake toxins -= toxin_uptake // Check for pests and weeds. // Some carnivorous plants happily eat pests. if(pestlevel > 0) if(GET_SEED_TRAIT(seed, TRAIT_CARNIVOROUS)) - health += HYDRO_SPEED_MULTIPLIER + plant_health += HYDRO_SPEED_MULTIPLIER pestlevel -= HYDRO_SPEED_MULTIPLIER else if (pestlevel >= GET_SEED_TRAIT(seed, TRAIT_PEST_TOLERANCE)) - health -= HYDRO_SPEED_MULTIPLIER + plant_health -= HYDRO_SPEED_MULTIPLIER // Some plants thrive and live off of weeds. if(weedlevel > 0) if(GET_SEED_TRAIT(seed, TRAIT_PARASITE)) - health += HYDRO_SPEED_MULTIPLIER + plant_health += HYDRO_SPEED_MULTIPLIER weedlevel -= HYDRO_SPEED_MULTIPLIER else if (weedlevel >= GET_SEED_TRAIT(seed, TRAIT_WEED_TOLERANCE)) - health -= HYDRO_SPEED_MULTIPLIER + plant_health -= HYDRO_SPEED_MULTIPLIER // Handle life and death. // When the plant dies, weeds thrive and pests die off. diff --git a/code/modules/hydroponics/trays/tray_soil.dm b/code/modules/hydroponics/trays/tray_soil.dm index 8ffa14d7c4e..6be89061d7e 100644 --- a/code/modules/hydroponics/trays/tray_soil.dm +++ b/code/modules/hydroponics/trays/tray_soil.dm @@ -5,6 +5,7 @@ density = FALSE use_power = POWER_USE_OFF mechanical = FALSE + maxhealth = null tray_light = 0 /// Water level begins at zero. waterlevel = 0 @@ -55,7 +56,7 @@ Hence using a blank icon. */ seed = newseed dead = 0 age = start_mature ? GET_SEED_TRAIT(seed, TRAIT_MATURATION) : 1 - health = GET_SEED_TRAIT(seed, TRAIT_ENDURANCE) + plant_health = GET_SEED_TRAIT(seed, TRAIT_ENDURANCE) lastcycle = world.time pixel_y = rand(-5,5) waterlevel = 100 diff --git a/code/modules/hydroponics/trays/tray_update_icons.dm b/code/modules/hydroponics/trays/tray_update_icons.dm index d873e83841b..0aaea581157 100644 --- a/code/modules/hydroponics/trays/tray_update_icons.dm +++ b/code/modules/hydroponics/trays/tray_update_icons.dm @@ -2,7 +2,7 @@ . = 0 var/overlay_stage if (seed) - if (mechanical && health <= (GET_SEED_TRAIT(seed, TRAIT_ENDURANCE) / 2)) + if (mechanical && plant_health <= (GET_SEED_TRAIT(seed, TRAIT_ENDURANCE) / 2)) . |= TRAY_LOW_HEALTH if (dead) diff --git a/code/modules/mining/minebot.dm b/code/modules/mining/minebot.dm index 299673ddf61..dc0afaddd6a 100644 --- a/code/modules/mining/minebot.dm +++ b/code/modules/mining/minebot.dm @@ -6,7 +6,7 @@ law_type = /datum/ai_laws/mining_drone module_type = /obj/item/robot_module/mining_drone holder_type = /obj/item/holder/drone/mining - maxHealth = 45 + maxhealth = 45 health = 45 pass_flags = PASSTABLE|PASSRAILING req_access = list(ACCESS_MINING, ACCESS_ROBOTICS) @@ -105,7 +105,7 @@ if(seeking_player) to_chat(user, SPAN_WARNING("\The [src] is already in the reboot process.")) return - if(!GLOB.config.allow_drone_spawn || emagged || health < -maxHealth) //It's dead, Dave. + if(!GLOB.config.allow_drone_spawn || emagged || health < -maxhealth) //It's dead, Dave. to_chat(user, SPAN_WARNING("The interface is fried, and a distressing burned smell wafts from the robot's interior. You're not rebooting this one.")) return @@ -168,7 +168,7 @@ if(M.health_upgrade) to_chat(user, SPAN_WARNING("[src] already has a reinforced chassis!")) return - M.maxHealth = 100 + M.maxhealth = 100 M.health += 55 for(var/V in M.components) if(V != "power cell") diff --git a/code/modules/mob/living/bot/bot.dm b/code/modules/mob/living/bot/bot.dm index f57d5dcf3ad..a142f60e719 100644 --- a/code/modules/mob/living/bot/bot.dm +++ b/code/modules/mob/living/bot/bot.dm @@ -2,7 +2,7 @@ name = "Bot" accent = ACCENT_TTS health = 20 - maxHealth = 20 + maxhealth = 20 icon = 'icons/mob/npc/aibots.dmi' layer = MOB_LAYER universal_speak = TRUE @@ -72,10 +72,10 @@ /mob/living/bot/updatehealth() if(status_flags & GODMODE) - health = maxHealth + health = maxhealth set_stat(CONSCIOUS) else - health = maxHealth - getFireLoss() - getBruteLoss() + health = maxhealth - getFireLoss() - getBruteLoss() /mob/living/bot/death() explode() @@ -117,9 +117,9 @@ to_chat(user, SPAN_WARNING("You need to unlock the controls first.")) return else if(attacking_item.tool_behaviour == TOOL_WELDER) - if(health < maxHealth) + if(health < maxhealth) if(open) - health = min(maxHealth, health + 10) + health = min(maxhealth, health + 10) user.visible_message(SPAN_NOTICE("\The [user] repairs [src]."), SPAN_NOTICE("You repair [src].")) else to_chat(user, SPAN_WARNING("You are unable to repair [src] with the maintenance panel closed.")) diff --git a/code/modules/mob/living/bot/farmbot.dm b/code/modules/mob/living/bot/farmbot.dm index baa63276a02..373348b5bc3 100644 --- a/code/modules/mob/living/bot/farmbot.dm +++ b/code/modules/mob/living/bot/farmbot.dm @@ -10,7 +10,7 @@ icon = 'icons/mob/npc/aibots.dmi' icon_state = "farmbot0" health = 50 - maxHealth = 50 + maxhealth = 50 req_one_access = list(ACCESS_HYDROPONICS, ACCESS_ROBOTICS, ACCESS_XENOBOTANY) var/action = "" // Used to update icon diff --git a/code/modules/mob/living/carbon/alien/alien.dm b/code/modules/mob/living/carbon/alien/alien.dm index 74ccaef1d6c..8722be6d0cd 100644 --- a/code/modules/mob/living/carbon/alien/alien.dm +++ b/code/modules/mob/living/carbon/alien/alien.dm @@ -5,7 +5,7 @@ icon_state = "la_creatura" pass_flags = PASSTABLE health = 50 - maxHealth = 50 + maxhealth = 50 mob_size = 4 var/adult_form diff --git a/code/modules/mob/living/carbon/alien/diona/diona_nymph.dm b/code/modules/mob/living/carbon/alien/diona/diona_nymph.dm index 12b25d1bbab..f9ec170034c 100644 --- a/code/modules/mob/living/carbon/alien/diona/diona_nymph.dm +++ b/code/modules/mob/living/carbon/alien/diona/diona_nymph.dm @@ -24,7 +24,7 @@ holder_type = /obj/item/holder/diona meat_type = /obj/item/reagent_containers/food/snacks/meat/dionanymph meat_amount = 2 - maxHealth = 50 + maxhealth = 50 health = 50 max_stamina = -1 pass_flags = PASSTABLE @@ -238,7 +238,7 @@ DS = new/datum/dionastats() DS.max_energy = energy_duration * MLS DS.stored_energy = (DS.max_energy / 2) - DS.max_health = maxHealth + DS.max_health = maxhealth DS.pain_factor = (50 / dark_consciousness) / MLS DS.trauma_factor = (DS.max_health / dark_survival) / MLS DS.dionatype = DIONA_NYMPH @@ -250,7 +250,7 @@ var/mob/living/carbon/human/H = gestalt if(!H.bad_internal_organs) return - if(health < maxHealth) + if(health < maxhealth) if (!(src in H.bad_internal_organs)) H.bad_internal_organs.Add(src) else @@ -387,10 +387,10 @@ /mob/living/carbon/alien/diona/adjustBruteLoss(var/amount) if (status_flags & GODMODE) return - health = min(health - amount, maxHealth) + health = min(health - amount, maxhealth) /mob/living/carbon/alien/diona/getHalLoss() if(status_flags & GODMODE) return - return max((maxHealth - health), 0) + return max((maxhealth - health), 0) diff --git a/code/modules/mob/living/carbon/alien/life.dm b/code/modules/mob/living/carbon/alien/life.dm index 3a92e77e5d9..6c06c8ee14a 100644 --- a/code/modules/mob/living/carbon/alien/life.dm +++ b/code/modules/mob/living/carbon/alien/life.dm @@ -104,7 +104,7 @@ if (healths) if (stat != DEAD) - switch((health - getHalLoss()) / maxHealth * 100) // Halloss should be factored in here for displaying + switch((health - getHalLoss()) / maxhealth * 100) // Halloss should be factored in here for displaying if(100 to INFINITY) healths.icon_state = "health0" if(80 to 100) diff --git a/code/modules/mob/living/carbon/carbon_defense.dm b/code/modules/mob/living/carbon/carbon_defense.dm index 815f6a32625..f46b0119694 100644 --- a/code/modules/mob/living/carbon/carbon_defense.dm +++ b/code/modules/mob/living/carbon/carbon_defense.dm @@ -15,7 +15,7 @@ if(H && show_ssd && !client && !teleop) if(H.bg) visible_message(SPAN_DANGER("[src] is hit by [hitting_atom] waking [get_pronoun("him")] up!")) - if(H.health / H.maxHealth < 0.5) + if(H.health / H.maxhealth < 0.5) H.bg.awaken_impl(TRUE) sleeping = 0 willfully_sleeping = FALSE @@ -52,7 +52,7 @@ if(!hitting_projectile.do_not_log) visible_message(SPAN_DANGER("[hitting_projectile] hit [src] waking [get_pronoun("him")] up!")) - if(H.health / H.maxHealth < 0.5) + if(H.health / H.maxhealth < 0.5) H.bg.awaken_impl(TRUE) sleeping = 0 willfully_sleeping = FALSE @@ -79,7 +79,7 @@ show_ssd = H.species.show_ssd if(H && show_ssd && !client && !teleop) if(H.bg) - if(H.health / H.maxHealth < 0.5) + if(H.health / H.maxhealth < 0.5) H.bg.awaken_impl(TRUE) sleeping = 0 willfully_sleeping = FALSE diff --git a/code/modules/mob/living/carbon/diona_base.dm b/code/modules/mob/living/carbon/diona_base.dm index 961ec4504a6..4fe9ca0082e 100644 --- a/code/modules/mob/living/carbon/diona_base.dm +++ b/code/modules/mob/living/carbon/diona_base.dm @@ -501,7 +501,7 @@ Lightstates: if (DS.dionatype == 0) return health else - return health+(maxHealth*0.5) + return health+(maxhealth*0.5) /mob/living/carbon/proc/get_dionastats() return diff --git a/code/modules/mob/living/carbon/human/devour.dm b/code/modules/mob/living/carbon/human/devour.dm index 796d8d389a9..24d8db3acbe 100644 --- a/code/modules/mob/living/carbon/human/devour.dm +++ b/code/modules/mob/living/carbon/human/devour.dm @@ -51,7 +51,7 @@ victim.calculate_composition() var/dam_multiplier = 1 - var/victim_maxhealth = victim.maxHealth //We cache this here in case we need to edit it. + var/victim_maxhealth = victim.maxhealth //We cache this here in case we need to edit it. var/damage_dealt = victim_maxhealth * PEPB * dam_multiplier diff --git a/code/modules/mob/living/carbon/human/diona_gestalt.dm b/code/modules/mob/living/carbon/human/diona_gestalt.dm index a980c188828..1f6085d19e0 100644 --- a/code/modules/mob/living/carbon/human/diona_gestalt.dm +++ b/code/modules/mob/living/carbon/human/diona_gestalt.dm @@ -149,7 +149,7 @@ Nymphs have 100 health, so without armor there is a small possibility for each n var/MLS = (1.5 / 2.1) DS = new/datum/dionastats() DS.max_energy = energy_duration * MLS - DS.max_health = maxHealth*2 + DS.max_health = maxhealth*2 DS.stored_energy = DS.max_energy DS.pain_factor = (100 / dark_consciousness) / MLS DS.trauma_factor = (DS.max_health / dark_survival) / MLS @@ -329,10 +329,10 @@ Nymphs have 100 health, so without armor there is a small possibility for each n bestNymph = D nymphos += D D.forceMove(T) - if(gestalt_health >= D.maxHealth * 0.20) + if(gestalt_health >= D.maxhealth * 0.20) D.health = gestalt_health else - D.health = D.maxHealth * 0.20 + D.health = D.maxhealth * 0.20 D.split_languages(src) D.set_dir(pick(NORTH, SOUTH, EAST, WEST)) D.gestalt = null diff --git a/code/modules/mob/living/carbon/human/exercise.dm b/code/modules/mob/living/carbon/human/exercise.dm index fee7f5b0bf1..aabbfa6212d 100644 --- a/code/modules/mob/living/carbon/human/exercise.dm +++ b/code/modules/mob/living/carbon/human/exercise.dm @@ -99,6 +99,6 @@ Exercise Verbs stamina_loss += 2 if(on_knees) stamina_loss -= 2 - if(health <= ((maxHealth / 10) * 9)) + if(health <= ((maxhealth / 10) * 9)) stamina_loss += 2 return max(stamina_loss, 1) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 22d1f687067..653c183c179 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1284,8 +1284,8 @@ /mob/living/carbon/human/succumb() set hidden = TRUE - if(shock_stage > 50 && (maxHealth * 0.6) > get_total_health()) - adjustBrainLoss(health + maxHealth * 2) // Deal 2x health in BrainLoss damage, as before but variable. + if(shock_stage > 50 && (maxhealth * 0.6) > get_total_health()) + adjustBrainLoss(health + maxhealth * 2) // Deal 2x health in BrainLoss damage, as before but variable. to_chat(src, SPAN_NOTICE("You have given up life and succumbed to death.")) else to_chat(src, SPAN_WARNING("You are not injured enough to succumb to death!")) @@ -1556,8 +1556,8 @@ species.handle_post_spawn(src,kpg) // should be zero by default - maxHealth = species.total_health - health = maxHealth + maxhealth = species.total_health + health = maxhealth regenerate_icons() if (vessel) @@ -2102,7 +2102,7 @@ //Point at which you dun breathe no more. Separate from asystole crit, which is heart-related. /mob/living/carbon/human/nervous_system_failure() - return getBrainLoss() >= maxHealth * 0.75 + return getBrainLoss() >= maxhealth * 0.75 // Check if we should die. /mob/living/carbon/human/proc/handle_death_check() diff --git a/code/modules/mob/living/carbon/human/human_damage.dm b/code/modules/mob/living/carbon/human/human_damage.dm index 481ec59853f..e758f917f65 100644 --- a/code/modules/mob/living/carbon/human/human_damage.dm +++ b/code/modules/mob/living/carbon/human/human_damage.dm @@ -4,11 +4,11 @@ return ..() if(status_flags & GODMODE) - health = maxHealth + health = maxhealth set_stat(CONSCIOUS) return - health = maxHealth - getBrainLoss() + health = maxhealth - getBrainLoss() if(stat == DEAD) var/genetic_damage = getCloneLoss() @@ -17,15 +17,15 @@ ChangeToSkeleton(FALSE) else var/fire_dmg = getFireLoss() - if(fire_dmg > maxHealth * 3) + if(fire_dmg > maxhealth * 3) ChangeToSkeleton(FALSE) - else if(fire_dmg > maxHealth * 1.5) + else if(fire_dmg > maxhealth * 1.5) ChangeToHusk() UpdateDamageIcon() // to fix that darn overlay bug /mob/living/carbon/human/proc/get_total_health() - var/amount = maxHealth - getFireLoss() - getBruteLoss() - getOxyLoss() - getToxLoss() - getBrainLoss() + var/amount = maxhealth - getFireLoss() - getBruteLoss() - getOxyLoss() - getToxLoss() - getBrainLoss() return amount /mob/living/carbon/human/adjustBrainLoss(var/amount) @@ -164,7 +164,7 @@ breathe_organ = internal_organs_by_name[species.breathing_organ] if(!breathe_organ) - return maxHealth/2 + return maxhealth/2 return breathe_organ.get_oxygen_deprivation() /mob/living/carbon/human/setOxyLoss(var/amount) diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index 5b9a1d3762a..aae22c8172f 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -19,7 +19,7 @@ if(embedded_flag) handle_embedded_objects() //Moving with objects stuck in you can cause bad times. - var/health_deficiency = maxHealth - health + var/health_deficiency = maxhealth - health if(health_deficiency >= 40) tally += (health_deficiency / 25) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 504a721a31e..8b662af405c 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -877,10 +877,10 @@ return if(stat != DEAD) - if((stat == UNCONSCIOUS && health < maxHealth / 2) || paralysis || InStasis()) + if((stat == UNCONSCIOUS && health < maxhealth / 2) || paralysis || InStasis()) //Critical damage passage overlay var/severity = 0 - switch(health - maxHealth/2) + switch(health - maxhealth/2) if(-20 to -10) severity = 1 if(-30 to -20) severity = 2 if(-40 to -30) severity = 3 @@ -1267,7 +1267,7 @@ Paralyse(3) return if(!can_feel_pain()) - if(isSynthetic() &&(get_total_health() < maxHealth * 0.5)) + if(isSynthetic() &&(get_total_health() < maxhealth * 0.5)) stuttering = max(stuttering, 5) return diff --git a/code/modules/mob/living/carbon/human/species/outsider/undead.dm b/code/modules/mob/living/carbon/human/species/outsider/undead.dm index f61d776d29b..929ffaf62c1 100644 --- a/code/modules/mob/living/carbon/human/species/outsider/undead.dm +++ b/code/modules/mob/living/carbon/human/species/outsider/undead.dm @@ -511,7 +511,7 @@ if(target.reagents) target.reagents.add_reagent(/singleton/reagent/toxin/hylemnomil, min(10, ZOMBIE_MAX_HYLEMNOMIL - hylemnomil_amount)) - if (target.getBruteLoss() > target.maxHealth * 3) + if (target.getBruteLoss() > target.maxhealth * 3) if (target.stat != DEAD) to_chat(src,SPAN_WARNING("You've scraped \the [target] down to the bones already!.")) else @@ -539,7 +539,7 @@ playsound(loc, 'sound/effects/splat.ogg', 20, 1) new /obj/effect/decal/cleanable/blood/splatter(get_turf(src), target.get_blood_color()) - if (target.getBruteLoss() > target.maxHealth*0.75) + if (target.getBruteLoss() > target.maxhealth*0.75) if (prob(50)) gibs(get_turf(src), target.dna) src.visible_message(SPAN_DANGER("\The [src] tears out \the [target]'s insides!")) diff --git a/code/modules/mob/living/carbon/human/species/station/diona/diona.dm b/code/modules/mob/living/carbon/human/species/station/diona/diona.dm index fc22f43bc4f..5681cd8b5b2 100644 --- a/code/modules/mob/living/carbon/human/species/station/diona/diona.dm +++ b/code/modules/mob/living/carbon/human/species/station/diona/diona.dm @@ -197,7 +197,7 @@ They are very slow, reasonably strong, and quite durable. They also require ligh H.adjustHalLoss(cost*0.3) H.updatehealth() - if(H.getHalLoss() > (H.maxHealth*0.6)) + if(H.getHalLoss() > (H.maxhealth*0.6)) var/shock = H.get_shock() if(prob(shock * 2)) to_chat(H, SPAN_DANGER("You feel a sharp pain in your nervous system! You can't run anymore, or you might die!")) diff --git a/code/modules/mob/living/carbon/human/species/station/golem.dm b/code/modules/mob/living/carbon/human/species/station/golem.dm index ff3f39ea97a..a183608e234 100644 --- a/code/modules/mob/living/carbon/human/species/station/golem.dm +++ b/code/modules/mob/living/carbon/human/species/station/golem.dm @@ -691,7 +691,7 @@ GLOBAL_LIST_INIT(golem_types, list( glassify(H) return - if(H.getFireLoss() >= (H.health - H.maxHealth)) //if the sand golem suffered enough burn damage it turns into a glass one + if(H.getFireLoss() >= (H.health - H.maxhealth)) //if the sand golem suffered enough burn damage it turns into a glass one glassify(H) return diff --git a/code/modules/mob/living/carbon/slime/death.dm b/code/modules/mob/living/carbon/slime/death.dm index fbaae09e232..b6c84ec9a0b 100644 --- a/code/modules/mob/living/carbon/slime/death.dm +++ b/code/modules/mob/living/carbon/slime/death.dm @@ -13,7 +13,7 @@ M.mutation_chance = clamp(mutation_chance + rand(-3, 3), 0, 100) step_away(M, src) is_adult = FALSE - maxHealth = 150 + maxhealth = 150 revive() if(!client) rabid = TRUE diff --git a/code/modules/mob/living/carbon/slime/life.dm b/code/modules/mob/living/carbon/slime/life.dm index f1f6ec1fbe7..789abc10dfa 100644 --- a/code/modules/mob/living/carbon/slime/life.dm +++ b/code/modules/mob/living/carbon/slime/life.dm @@ -94,7 +94,7 @@ src.blinded = null - health = maxHealth - (getOxyLoss() + getToxLoss() + getFireLoss() + getBruteLoss() + getCloneLoss()) + health = maxhealth - (getOxyLoss() + getToxLoss() + getFireLoss() + getBruteLoss() + getCloneLoss()) if(health < 0 && stat != DEAD) death() diff --git a/code/modules/mob/living/carbon/slime/powers.dm b/code/modules/mob/living/carbon/slime/powers.dm index 1599118626f..655ade3b44b 100644 --- a/code/modules/mob/living/carbon/slime/powers.dm +++ b/code/modules/mob/living/carbon/slime/powers.dm @@ -23,7 +23,7 @@ return "This subject is too far away..." if(ishuman(M) && !istype(M, /mob/living/carbon/human/monkey) && content) // don't eat humans while content return "I'm already content..." - if(istype(M, /mob/living/carbon) && M.getCloneLoss() >= M.maxHealth * 2 || istype(M, /mob/living/simple_animal) && M.stat == DEAD) + if(istype(M, /mob/living/carbon) && M.getCloneLoss() >= M.maxhealth * 2 || istype(M, /mob/living/simple_animal) && M.stat == DEAD) return "This subject does not have any edible life energy..." if(istype(M, /mob/living/carbon)) var/mob/living/carbon/human/H = M @@ -123,8 +123,8 @@ if(amount_grown >= 5) is_adult = TRUE mob_size = 6 // Adult slimes are bigger - maxHealth = 200 - health = maxHealth + maxhealth = 200 + health = maxhealth amount_grown = 0 regenerate_icons() name = "[colour] [is_adult ? "adult" : "baby"] slime ([number])" diff --git a/code/modules/mob/living/carbon/slime/slime.dm b/code/modules/mob/living/carbon/slime/slime.dm index d55f8b16b2e..477d3478121 100644 --- a/code/modules/mob/living/carbon/slime/slime.dm +++ b/code/modules/mob/living/carbon/slime/slime.dm @@ -9,7 +9,7 @@ mob_size = 4 composition_reagent = /singleton/reagent/slimejelly layer = MOB_LAYER - maxHealth = 150 + maxhealth = 150 health = 150 gender = NEUTER accent = ACCENT_BLUESPACE @@ -156,7 +156,7 @@ return toxloss /mob/living/carbon/slime/adjustToxLoss(var/amount) - toxloss = clamp(toxloss + amount, 0, maxHealth) + toxloss = clamp(toxloss + amount, 0, maxhealth) /mob/living/carbon/slime/setToxLoss(var/amount) adjustToxLoss(amount-getToxLoss()) @@ -167,7 +167,7 @@ var/tally = 0 - var/health_deficiency = (maxHealth - health) + var/health_deficiency = (maxhealth - health) if(health_deficiency >= 30) tally += (health_deficiency / 25) @@ -240,7 +240,7 @@ /mob/living/carbon/slime/get_status_tab_items() . = ..() - . += "Health: [round((health / maxHealth) * 100)]%" + . += "Health: [round((health / maxhealth) * 100)]%" . += "Intent: [a_intent]" if(client.statpanel == "Status") diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 61baa0e98c0..2bcaa02e77d 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -223,8 +223,8 @@ default behaviour is: /mob/living/verb/succumb() set hidden = 1 - if(health < maxHealth / 3) - adjustBrainLoss(health + maxHealth * 2) // Deal 2x health in BrainLoss damage, as before but variable. + if(health < maxhealth / 3) + adjustBrainLoss(health + maxhealth * 2) // Deal 2x health in BrainLoss damage, as before but variable. to_chat(src, SPAN_NOTICE("You have given up life and succumbed to death.")) else to_chat(src, SPAN_WARNING("You are not injured enough to succumb to death!")) @@ -232,10 +232,10 @@ default behaviour is: /mob/living/proc/updatehealth() if(status_flags & GODMODE) - health = maxHealth + health = maxhealth set_stat(CONSCIOUS) else - health = maxHealth - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss() - getCloneLoss() + health = maxhealth - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss() - getCloneLoss() //This proc is used for mobs which are affected by pressure to calculate the amount of pressure that actually //affects them once clothing is factored in. ~Errorage @@ -280,12 +280,12 @@ default behaviour is: // I touched them without asking... I'm soooo edgy ~Erro (added nodamage checks) /mob/living/proc/getBruteLoss() - return maxHealth - health + return maxhealth - health /mob/living/proc/adjustBruteLoss(var/amount) if(status_flags & GODMODE) return - health = clamp(health - amount, 0, maxHealth) + health = clamp(health - amount, 0, maxhealth) /mob/living/proc/getOxyLoss() return 0 @@ -345,10 +345,10 @@ default behaviour is: adjustBruteLoss((amount * 0.5)-getBruteLoss()) /mob/living/proc/getMaxHealth() - return maxHealth + return maxhealth /mob/living/proc/setMaxHealth(var/newMaxHealth) - maxHealth = newMaxHealth + maxhealth = newMaxHealth // ++++ROCKDTBEN++++ MOB PROCS //END @@ -704,7 +704,7 @@ default behaviour is: /mob/living/proc/escape_inventory(obj/item/holder/H) if(H != src.loc) return - if(health < maxHealth * 0.6) + if(health < maxhealth * 0.6) to_chat(src, SPAN_WARNING("You're too injured to escape...")) return diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index 858a414a09c..032446b4ad7 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -1,12 +1,8 @@ /mob/living + health = 100 + maxhealth = 100 see_invisible = SEE_INVISIBLE_LIVING - //Health and life related vars - /// Maximum health that should be possible. - var/maxHealth = 100 - /// A mob's current health - var/health = 100 - var/hud_updateflag = 0 // Virtual Reality diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 91752127dc1..ffd159e92a5 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -283,7 +283,7 @@ GLOBAL_LIST_INIT(ai_verbs_default, list( /mob/living/silicon/ai/adjustOxyLoss(var/amount) if(status_flags & GODMODE) return - oxyloss = max(0, oxyloss + min(amount, maxHealth - oxyloss)) + oxyloss = max(0, oxyloss + min(amount, maxhealth - oxyloss)) /mob/living/silicon/ai/setFireLoss(var/amount) if(status_flags & GODMODE) @@ -299,11 +299,11 @@ GLOBAL_LIST_INIT(ai_verbs_default, list( /mob/living/silicon/ai/updatehealth() if(status_flags & GODMODE) - health = maxHealth + health = maxhealth set_stat(CONSCIOUS) setOxyLoss(0) else - health = maxHealth - getFireLoss() - getBruteLoss() // Oxyloss is not part of health as it represents AIs backup power. AI is immune against ToxLoss as it is machine. + health = maxhealth - getFireLoss() - getBruteLoss() // Oxyloss is not part of health as it represents AIs backup power. AI is immune against ToxLoss as it is machine. /mob/living/silicon/ai/proc/setup_icon() var/datum/custom_synth/sprite = null diff --git a/code/modules/mob/living/silicon/ai/malf.dm b/code/modules/mob/living/silicon/ai/malf.dm index d5f750139e3..4ac199d5bea 100644 --- a/code/modules/mob/living/silicon/ai/malf.dm +++ b/code/modules/mob/living/silicon/ai/malf.dm @@ -102,11 +102,11 @@ // Returns percentage of AI's remaining backup capacitor charge (maxhealth - oxyloss). /mob/living/silicon/ai/proc/backup_capacitor() - return ((getOxyLoss() - maxHealth) / maxHealth) * -100 + return ((getOxyLoss() - maxhealth) / maxhealth) * -100 // Returns percentage of AI's remaining hardware integrity (maxhealth - (bruteloss + fireloss)) /mob/living/silicon/ai/proc/hardware_integrity() - return (health / maxHealth) * 100 + return (health / maxhealth) * 100 // Shows AI Malfunction related information to the AI. /mob/living/silicon/ai/show_malf_ai() diff --git a/code/modules/mob/living/silicon/decoy/life.dm b/code/modules/mob/living/silicon/decoy/life.dm index 719169cad96..d326be7effe 100644 --- a/code/modules/mob/living/silicon/decoy/life.dm +++ b/code/modules/mob/living/silicon/decoy/life.dm @@ -13,7 +13,7 @@ /mob/living/silicon/decoy/updatehealth() if(status_flags & GODMODE) - health = maxHealth + health = maxhealth set_stat(CONSCIOUS) else - health = maxHealth - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss() + health = maxhealth - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss() diff --git a/code/modules/mob/living/silicon/pai/life.dm b/code/modules/mob/living/silicon/pai/life.dm index a0354176403..7853bb0e375 100644 --- a/code/modules/mob/living/silicon/pai/life.dm +++ b/code/modules/mob/living/silicon/pai/life.dm @@ -33,7 +33,7 @@ /mob/living/silicon/pai/updatehealth() if(status_flags & GODMODE) - health = maxHealth + health = maxhealth set_stat(CONSCIOUS) else - health = maxHealth - getBruteLoss() - getFireLoss() + health = maxhealth - getBruteLoss() - getFireLoss() diff --git a/code/modules/mob/living/silicon/robot/drone/drone.dm b/code/modules/mob/living/silicon/robot/drone/drone.dm index ae8ce06fa74..7ecfd9290e6 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone.dm @@ -35,7 +35,7 @@ gender = NEUTER // Health - maxHealth = 35 + maxhealth = 35 health = 35 // Components @@ -227,7 +227,7 @@ module_type = /obj/item/robot_module/drone/construction/matriarch law_type = /datum/ai_laws/matriarch_drone can_swipe = FALSE - maxHealth = 50 + maxhealth = 50 health = 50 var/matrix_tag @@ -356,7 +356,7 @@ to_chat(user, SPAN_WARNING("\The [src] doesn't have an ID swipe interface.")) return if(stat == DEAD) - if(!GLOB.config.allow_drone_spawn || emagged || health < -maxHealth) //It's dead, Dave. + if(!GLOB.config.allow_drone_spawn || emagged || health < -maxhealth) //It's dead, Dave. to_chat(user, SPAN_WARNING("The interface is fried, and a distressing burned smell wafts from the robot's interior. You're not rebooting this one.")) return if(!allowed(usr)) @@ -454,17 +454,17 @@ //For some goddamn reason robots have this hardcoded. Redefining it for our fragile friends here. /mob/living/silicon/robot/drone/updatehealth() if(status_flags & GODMODE) - health = maxHealth + health = maxhealth set_stat(CONSCIOUS) return - health = maxHealth - (getBruteLoss() + getFireLoss()) + health = maxhealth - (getBruteLoss() + getFireLoss()) return //Easiest to check this here, then check again in the robot proc. //Standard robots use config for crit, which is somewhat excessive for these guys. //Drones killed by damage will gib. /mob/living/silicon/robot/drone/handle_regular_status_updates() - if(health <= -maxHealth && src.stat != DEAD) + if(health <= -maxhealth && src.stat != DEAD) gib() return ..() diff --git a/code/modules/mob/living/silicon/robot/drone/matrix_hive.dm b/code/modules/mob/living/silicon/robot/drone/matrix_hive.dm index 9cc6cc9a35c..fcf63c0ea96 100644 --- a/code/modules/mob/living/silicon/robot/drone/matrix_hive.dm +++ b/code/modules/mob/living/silicon/robot/drone/matrix_hive.dm @@ -80,7 +80,7 @@ GLOBAL_LIST_EMPTY(drone_matrices) if(MTX_UPG_CELL) D.cell.maxcharge = D.cell.maxcharge * 1.5 if(MTX_UPG_HEALTH) - D.maxHealth += 15 + D.maxhealth += 15 LAZYADD(D.matrix_upgrades, upgrade_type) /proc/assign_drone_to_matrix(mob/living/silicon/robot/drone/D, var/matrix_tag) diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index fa9d7f28307..a0ec9892664 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -25,7 +25,7 @@ var/wires_exposed = FALSE // Health and interaction - maxHealth = 200 + maxhealth = 200 health = 200 mob_size = 16 //robots are heavy mob_bump_flag = ROBOT @@ -1221,7 +1221,7 @@ /mob/living/silicon/robot/succumb() set hidden = TRUE - if(health < maxHealth / 3) + if(health < maxhealth / 3) death() to_chat(src, SPAN_NOTICE("You have given up life and succumbed to death.")) else diff --git a/code/modules/mob/living/silicon/robot/robot_damage.dm b/code/modules/mob/living/silicon/robot/robot_damage.dm index e39c80bf3aa..2b72b021642 100644 --- a/code/modules/mob/living/silicon/robot/robot_damage.dm +++ b/code/modules/mob/living/silicon/robot/robot_damage.dm @@ -1,9 +1,9 @@ /mob/living/silicon/robot/updatehealth() if(status_flags & GODMODE) - health = maxHealth + health = maxhealth set_stat(CONSCIOUS) return - health = maxHealth - (getBruteLoss() + getFireLoss()) + health = maxhealth - (getBruteLoss() + getFireLoss()) return /mob/living/silicon/robot/getBruteLoss() diff --git a/code/modules/mob/living/silicon/say.dm b/code/modules/mob/living/silicon/say.dm index 87e75c1e06c..55160c3eaaf 100644 --- a/code/modules/mob/living/silicon/say.dm +++ b/code/modules/mob/living/silicon/say.dm @@ -9,7 +9,7 @@ . = TRUE message = Gibberish(message, C.max_damage / C.get_damage()) else - var/damaged = 100 - (clamp(health, 0, maxHealth) / maxHealth) * 100 + var/damaged = 100 - (clamp(health, 0, maxhealth) / maxhealth) * 100 if(damaged > 40) . = TRUE message = Gibberish(message, damaged - 10) diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index 4b7b0b600a8..45661ae21a7 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -187,7 +187,7 @@ . += "" if(!stat) - . += "System Integrity: [round((health/maxHealth)*100)]%" + . += "System Integrity: [round((health/maxhealth)*100)]%" else . += "System Integrity: NON-FUNCTIONAL" show_malf_ai() diff --git a/code/modules/mob/living/simple_animal/bees.dm b/code/modules/mob/living/simple_animal/bees.dm index 1a8896fdf29..17595202190 100644 --- a/code/modules/mob/living/simple_animal/bees.dm +++ b/code/modules/mob/living/simple_animal/bees.dm @@ -7,7 +7,7 @@ icon_dead = "bees1" mob_size = 0.5 unsuitable_atoms_damage = 2.5 - maxHealth = 20 + maxhealth = 20 density = 0 var/strength = 1 var/feral = 0 @@ -51,7 +51,7 @@ qdel(src) return else - health = maxHealth + health = maxhealth if (prob(25))//probability to reduce spam src.visible_message(SPAN_WARNING("The bee swarm starts to thin out a little.")) @@ -283,7 +283,7 @@ update_icon() /mob/living/simple_animal/bee/beegun - maxHealth = 30 + maxhealth = 30 strength = 5 feral = 30 diff --git a/code/modules/mob/living/simple_animal/borer/borer.dm b/code/modules/mob/living/simple_animal/borer/borer.dm index 5bb21e68589..0363df62117 100644 --- a/code/modules/mob/living/simple_animal/borer/borer.dm +++ b/code/modules/mob/living/simple_animal/borer/borer.dm @@ -16,10 +16,10 @@ a_intent = I_HURT stop_automated_movement = 1 status_flags = CANPUSH - attacktext = "nipped" + attacktext = "nips" friendly = "prods" wander = 0 - maxHealth = 40 + maxhealth = 40 health = 40 pass_flags = PASSTABLE universal_understand = TRUE diff --git a/code/modules/mob/living/simple_animal/constructs/constructs/artificer.dm b/code/modules/mob/living/simple_animal/constructs/constructs/artificer.dm index 197d1568baf..0c8265d0a7e 100644 --- a/code/modules/mob/living/simple_animal/constructs/constructs/artificer.dm +++ b/code/modules/mob/living/simple_animal/constructs/constructs/artificer.dm @@ -5,13 +5,13 @@ icon = 'icons/mob/mob.dmi' icon_state = "artificer" icon_living = "artificer" - maxHealth = 250 // Was undertuned prior to our damage numbers + maxhealth = 250 // Was undertuned prior to our damage numbers health_prefix = "artificer" response_harm = "viciously beaten" melee_damage_lower = 10 melee_damage_upper = 10 armor_penetration = 20 - attacktext = "rammed" + attacktext = "rams" organ_names = list("core", "production array", "sensor array") speed = 0 environment_smash = TRUE diff --git a/code/modules/mob/living/simple_animal/constructs/constructs/cult_construct.dm b/code/modules/mob/living/simple_animal/constructs/constructs/cult_construct.dm index de3a350c9de..2e0ac483a5c 100644 --- a/code/modules/mob/living/simple_animal/constructs/constructs/cult_construct.dm +++ b/code/modules/mob/living/simple_animal/constructs/constructs/cult_construct.dm @@ -98,7 +98,7 @@ adjustFireLoss(-5) user.visible_message(SPAN_NOTICE("\The [user] mends some of \the [src]'s wounds.")) else - if (health < maxHealth) + if (health < maxhealth) to_chat(user, SPAN_NOTICE("Healing \the [src] any further is beyond your abilities.")) else to_chat(user, SPAN_NOTICE("\The [src] is undamaged.")) @@ -107,8 +107,8 @@ /mob/living/simple_animal/construct/get_examine_text(mob/user, distance, is_adjacent, infix, suffix) . = ..() - if(health < maxHealth) - if(health >= maxHealth / 2) + if(health < maxhealth) + if(health >= maxhealth / 2) . += SPAN_WARNING("It looks slightly dented.") else . += SPAN_WARNING("It looks severely dented!") @@ -149,7 +149,7 @@ silence_spells(purge) if(healths) - var/health_percent = (health / maxHealth) * 100 + var/health_percent = (health / maxhealth) * 100 var/newstate = 0 switch(health_percent) if(84 to INFINITY) diff --git a/code/modules/mob/living/simple_animal/constructs/constructs/harvester.dm b/code/modules/mob/living/simple_animal/constructs/constructs/harvester.dm index 5b2ac78cfc0..d19b95d713b 100644 --- a/code/modules/mob/living/simple_animal/constructs/constructs/harvester.dm +++ b/code/modules/mob/living/simple_animal/constructs/constructs/harvester.dm @@ -5,12 +5,12 @@ icon = 'icons/mob/mob.dmi' icon_state = "harvester" icon_living = "harvester" - maxHealth = 300 + maxhealth = 300 health_prefix = "harvester" melee_damage_lower = 25 melee_damage_upper = 25 armor_penetration = 60 - attacktext = "violently stabbed" + attacktext = "violently stabs" organ_names = list("core", "harvesting array") speed = -1 environment_smash = 1 diff --git a/code/modules/mob/living/simple_animal/constructs/constructs/juggernaut.dm b/code/modules/mob/living/simple_animal/constructs/constructs/juggernaut.dm index 91242257343..31ecc925338 100644 --- a/code/modules/mob/living/simple_animal/constructs/constructs/juggernaut.dm +++ b/code/modules/mob/living/simple_animal/constructs/constructs/juggernaut.dm @@ -5,14 +5,14 @@ icon = 'icons/mob/mob.dmi' icon_state = "behemoth" icon_living = "behemoth" - maxHealth = 350 // Slow, melee only and can't sprint. So needs to be a beefcake. + maxhealth = 350 // Slow, melee only and can't sprint. So needs to be a beefcake. health_prefix = "juggernaut" response_harm = "harmlessly punches" harm_intent_damage = 0 melee_damage_lower = 30 melee_damage_upper = 30 armor_penetration = 40 - attacktext = "smashed their armored gauntlet into" + attacktext = "smashes their armored gauntlet into" organ_names = list("core", "right arm", "left arm") mob_size = MOB_LARGE speed = 3 diff --git a/code/modules/mob/living/simple_animal/constructs/constructs/wraith.dm b/code/modules/mob/living/simple_animal/constructs/constructs/wraith.dm index 2f482c95bc3..ab2c0219c83 100644 --- a/code/modules/mob/living/simple_animal/constructs/constructs/wraith.dm +++ b/code/modules/mob/living/simple_animal/constructs/constructs/wraith.dm @@ -5,11 +5,11 @@ icon = 'icons/mob/mob.dmi' icon_state = "floating" icon_living = "floating" - maxHealth = 250 + maxhealth = 250 health_prefix = "wraith" melee_damage_lower = 25 melee_damage_upper = 25 - attacktext = "slashed" + attacktext = "slashes" organ_names = list("core", "right arm", "left arm") speed = -1 environment_smash = TRUE diff --git a/code/modules/mob/living/simple_animal/constructs/soulstone.dm b/code/modules/mob/living/simple_animal/constructs/soulstone.dm index 1720ab401bf..4acb7109122 100644 --- a/code/modules/mob/living/simple_animal/constructs/soulstone.dm +++ b/code/modules/mob/living/simple_animal/constructs/soulstone.dm @@ -170,7 +170,7 @@ T.forceMove(src) //put shade in stone T.status_flags |= GODMODE T.canmove = 0 - T.health = T.maxHealth + T.health = T.maxhealth src.icon_state = "soulstone2" to_chat(T, "Your soul has been recaptured by the soul stone, its arcane energies are reknitting your ethereal form") diff --git a/code/modules/mob/living/simple_animal/friendly/adhomai.dm b/code/modules/mob/living/simple_animal/friendly/adhomai.dm index f3beb13a0b1..33b030bcb69 100644 --- a/code/modules/mob/living/simple_animal/friendly/adhomai.dm +++ b/code/modules/mob/living/simple_animal/friendly/adhomai.dm @@ -16,7 +16,7 @@ canbrush = TRUE faction = "Adhomai" gender = FEMALE - maxHealth = 50 + maxhealth = 50 health = 50 mob_size = 5 var/eggsleft = 0 @@ -63,7 +63,7 @@ icon_state = "tunneler_baby" icon_living = "tunneler_baby" icon_dead = "tunneler_baby_dead" - maxHealth = 10 + maxhealth = 10 health = 10 mob_size = 2 meat_amount = 1 @@ -85,9 +85,9 @@ response_help = "pets" response_disarm = "gently pushes aside" response_harm = "kicks" - attacktext = "kicked" + attacktext = "kicks" health = 200 - maxHealth = 200 + maxhealth = 200 mob_size = 15 canbrush = TRUE @@ -124,13 +124,13 @@ meat_type = /obj/item/reagent_containers/food/snacks/meat/adhomai organ_names = list("head", "chest", "right fore leg", "left fore leg", "right rear leg", "left rear leg") - maxHealth = 150 + maxhealth = 150 health = 150 melee_damage_lower = 15 melee_damage_upper = 15 armor_penetration = 20 - attacktext = "gored" + attacktext = "gores" attack_sound = 'sound/weapons/bite.ogg' hostile_nameable = TRUE @@ -151,7 +151,7 @@ icon_living = "rafama_baby" icon_dead = "rafama_baby_dead" gender = MALE - maxHealth = 30 + maxhealth = 30 health = 30 mob_size = 5 melee_damage_lower = 5 @@ -169,7 +169,7 @@ meat_amount = 1 organ_names = list("thorax", "legs", "head") faction = "Adhomai" - maxHealth = 20 + maxhealth = 20 health = 20 mob_size = 3 @@ -192,7 +192,7 @@ organ_names = list("shell", "tentacles") faction = "Adhomai" - maxHealth = 50 + maxhealth = 50 health = 50 mob_size = 3 pixel_x = -8 @@ -272,13 +272,13 @@ response_help = "pets" response_disarm = "gently pushes aside" response_harm = "kicks" - attacktext = "kicked" + attacktext = "kicks" meat_type = /obj/item/reagent_containers/food/snacks/meat/adhomai faction = "Adhomai" - maxHealth = 100 + maxhealth = 100 health = 100 mob_size = 12 pixel_x = -8 @@ -318,7 +318,7 @@ meat_type = /obj/item/reagent_containers/food/snacks/meat/adhomai organ_names = list("head", "chest", "right fore leg", "left fore leg", "right rear leg", "left rear leg") - maxHealth = 150 + maxhealth = 150 health = 150 butchering_products = list(/obj/item/stack/material/animalhide = 10) @@ -343,9 +343,9 @@ response_help = "pets" response_disarm = "gently pushes aside" response_harm = "kicks" - attacktext = "kicked" + attacktext = "kicks" health = 450 - maxHealth = 452 + maxhealth = 452 mob_size = 30 pixel_x = -32 diff --git a/code/modules/mob/living/simple_animal/friendly/cosmozoan.dm b/code/modules/mob/living/simple_animal/friendly/cosmozoan.dm index 71a80211459..c6a518ee381 100644 --- a/code/modules/mob/living/simple_animal/friendly/cosmozoan.dm +++ b/code/modules/mob/living/simple_animal/friendly/cosmozoan.dm @@ -5,7 +5,7 @@ icon_state = "cosmozoan" icon_living = "cosmozoan" icon_dead = "cosmozoan_dead" - maxHealth = 15 + maxhealth = 15 health = 15 meat_type = /obj/item/reagent_containers/food/snacks/fish/cosmozoan meat_amount = 2 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 a08b7eb011c..9a47b4c17ee 100644 --- a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm +++ b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm @@ -20,8 +20,8 @@ response_disarm = "gently pushes aside" response_harm = "kicks" faction = "goat" - attacktext = "kicked" - maxHealth = 40 + attacktext = "kicks" + maxhealth = 40 melee_damage_lower = 1 melee_damage_upper = 5 udder = null @@ -94,7 +94,7 @@ response_help = "pets" response_disarm = "gently pushes aside" response_harm = "kicks" - attacktext = "kicked" + attacktext = "kicks" health = 250 mob_size = 20//based on mass of holstein fresian dairy cattle, what the sprite is based on emote_sounds = list('sound/effects/creatures/cow.ogg') @@ -140,7 +140,7 @@ response_help = "pets" response_disarm = "gently pushes aside" response_harm = "kicks" - attacktext = "kicked" + attacktext = "kicks" health = 120 emote_sounds = list('sound/effects/creatures/pigsnort.ogg') butchering_products = list(/obj/item/stack/material/animalhide/barehide = 6) @@ -166,8 +166,8 @@ response_help = "pets" response_disarm = "gently pushes aside" response_harm = "kicks" - attacktext = "kicked" - maxHealth = 1 + attacktext = "kicks" + maxhealth = 1 var/amount_grown = 0 pass_flags = PASSTABLE | PASSGRILLE holder_type = /obj/item/holder/chick @@ -214,8 +214,8 @@ response_help = "pets" response_disarm = "gently pushes aside" response_harm = "kicks" - attacktext = "kicked" - maxHealth = 10 + attacktext = "kicks" + maxhealth = 10 var/eggsleft = 0 var/body_color pass_flags = PASSTABLE @@ -302,7 +302,7 @@ response_help = "pets" response_disarm = "bops" response_harm = "kicks" - attacktext = "kicked" + attacktext = "kicks" mob_size = 2 /mob/living/simple_animal/penguin/baby diff --git a/code/modules/mob/living/simple_animal/friendly/hakhma.dm b/code/modules/mob/living/simple_animal/friendly/hakhma.dm index f1c8cc5de46..cdd12ca7f97 100644 --- a/code/modules/mob/living/simple_animal/friendly/hakhma.dm +++ b/code/modules/mob/living/simple_animal/friendly/hakhma.dm @@ -17,9 +17,9 @@ response_help = "pets" response_disarm = "gently pushes aside" response_harm = "kicks" - attacktext = "kicked" + attacktext = "kicks" health = 250 - maxHealth = 250 + maxhealth = 250 canbrush = TRUE brush = /obj/item/reagent_containers/glass/rag diff --git a/code/modules/mob/living/simple_animal/friendly/lizard.dm b/code/modules/mob/living/simple_animal/friendly/lizard.dm index 2841c4dea78..ad9da289267 100644 --- a/code/modules/mob/living/simple_animal/friendly/lizard.dm +++ b/code/modules/mob/living/simple_animal/friendly/lizard.dm @@ -6,7 +6,7 @@ icon_dead = "lizard_dead" speak_emote = list("hisses") health = 5 - maxHealth = 5 + maxhealth = 5 attacktext = "bitten" melee_damage_lower = 1 melee_damage_upper = 2 diff --git a/code/modules/mob/living/simple_animal/friendly/moghes.dm b/code/modules/mob/living/simple_animal/friendly/moghes.dm index 6c3d222ea30..baf396802a3 100644 --- a/code/modules/mob/living/simple_animal/friendly/moghes.dm +++ b/code/modules/mob/living/simple_animal/friendly/moghes.dm @@ -15,10 +15,10 @@ response_help = "pets" response_disarm = "gently pushes aside" response_harm = "kicks" - attacktext = "kicked" + attacktext = "kicks" faction = "Moghes" - maxHealth = 100 + maxhealth = 100 health = 100 mob_size = 12 pixel_x = -15 @@ -61,10 +61,10 @@ response_help = "pets" response_disarm = "gently pushes aside" response_harm = "kicks" - attacktext = "gored" + attacktext = "gores" faction = "Moghes" - maxHealth = 200 + maxhealth = 200 health = 200 mob_size = 16 pixel_x = -14 @@ -109,7 +109,7 @@ icon_state = "otzek" icon_living = "otzek" icon_dead = "otzek-dead" - maxHealth = 80 + maxhealth = 80 health = 80 mob_size = 10 speak_emote = list("chuffs", "hisses", "bellows") @@ -123,7 +123,7 @@ response_help = "pets" response_disarm = "gently pushes aside" response_harm = "kicks" - attacktext = "kicked" + attacktext = "kicks" canbrush = TRUE brush = /obj/item/reagent_containers/glass/rag speed = -1 @@ -141,7 +141,7 @@ icon_living = "miervesh-1" icon_dead = "miervesh-1-dead" speed = -2 - maxHealth = 30 + maxhealth = 30 health = 30 speak_emote = list("chirps", "hisses", "croons") emote_hear = list("chirps", "hisses", "croons") @@ -154,7 +154,7 @@ response_help = "pets" response_disarm = "gently pushes aside" response_harm = "swats" - attacktext = "swatted" + attacktext = "swats" flying = TRUE butchering_products = list(/obj/item/stack/material/animalhide = 1) meat_type = /obj/item/reagent_containers/food/snacks/meat/moghes diff --git a/code/modules/mob/living/simple_animal/friendly/mushroom.dm b/code/modules/mob/living/simple_animal/friendly/mushroom.dm index 752cb02d7bd..c2ae4bf08c3 100644 --- a/code/modules/mob/living/simple_animal/friendly/mushroom.dm +++ b/code/modules/mob/living/simple_animal/friendly/mushroom.dm @@ -9,7 +9,7 @@ mob_size = MOB_TINY speak_chance = 0 turns_per_move = 1 - maxHealth = 5 + maxhealth = 5 health = 5 meat_type = /obj/item/reagent_containers/food/snacks/hugemushroomslice organ_names = list("cap", "chest", "left leg", "right leg") diff --git a/code/modules/mob/living/simple_animal/friendly/rat.dm b/code/modules/mob/living/simple_animal/friendly/rat.dm index 8680679e45f..74d3e9d437a 100644 --- a/code/modules/mob/living/simple_animal/friendly/rat.dm +++ b/code/modules/mob/living/simple_animal/friendly/rat.dm @@ -26,7 +26,7 @@ pass_flags = PASSTABLE speak_chance = 3 turns_per_move = 5 - maxHealth = 5 + maxhealth = 5 health = 5 meat_type = /obj/item/reagent_containers/food/snacks/meat/rat organ_names = list("head", "chest", "right fore leg", "left fore leg", "right rear leg", "left rear leg") diff --git a/code/modules/mob/living/simple_animal/friendly/ratking.dm b/code/modules/mob/living/simple_animal/friendly/ratking.dm index 4714ba0016f..2e4ba977e81 100644 --- a/code/modules/mob/living/simple_animal/friendly/ratking.dm +++ b/code/modules/mob/living/simple_animal/friendly/ratking.dm @@ -12,7 +12,7 @@ to_chat(R, message) /mob/living/simple_animal/rat/king - attacktext = "bitten" + attacktext = "bites" a_intent = "harm" icon_state = "rat_gray" @@ -74,10 +74,10 @@ swarm_name = "creation" announce_name = "commandment" desc = "A titanic swarm of rats." - attacktext = "swarmed" + attacktext = "swarm" melee_damage_lower = 15 melee_damage_upper = 20 - maxHealth = 260 + maxhealth = 260 health = 260 mob_size = 10 universal_speak = 1 @@ -86,10 +86,10 @@ swarm_name = "flock" announce_name = "pronouncement" desc = "A massive swarm of rats." - attacktext = "swarmed" + attacktext = "swarm" melee_damage_lower = 10 melee_damage_upper = 10 - maxHealth = 160 + maxhealth = 160 health = 160 mob_size = 9 else if(rats.len >= RAT_EMPEROR_LEVEL) @@ -97,10 +97,10 @@ swarm_name = "empire" announce_name = "command" desc = "A large swarm of rats." - attacktext = "swarmed" + attacktext = "swarm" melee_damage_lower = 7 melee_damage_upper = 5 - maxHealth = 110 + maxhealth = 110 health = 110 mob_size = 8 else if(rats.len >= RAT_KING_LEVEL) @@ -108,10 +108,10 @@ swarm_name = "kingdom" announce_name = "decree" desc = "A big swarm of rats." - attacktext = "swarmed" + attacktext = "swarm" melee_damage_lower = 5 melee_damage_upper = 5 - maxHealth = 60 + maxhealth = 60 health = 60 mob_size = 7 else if(rats.len >= RAT_DUKE_LEVEL) @@ -119,8 +119,8 @@ swarm_name = "duchy" announce_name = "decree" desc = "A swarm of rats." - attacktext = "bitten" - maxHealth = 35 + attacktext = "bites" + maxhealth = 35 health = 35 mob_size = 6 else if(rats.len >= RAT_BARON_LEVEL) @@ -128,8 +128,8 @@ swarm_name = "barony" announce_name = "decree" desc = "A group of rats." - attacktext = "bitten" - maxHealth = 25 + attacktext = "bites" + maxhealth = 25 health = 25 mob_size = 4 else if(rats.len >= RAT_MAYOR_LEVEL) @@ -137,8 +137,8 @@ swarm_name = "hamlet" announce_name = "decree" desc = "A couple of rats." - attacktext = "bitten" - maxHealth = 15 + attacktext = "bites" + maxhealth = 15 health = 15 mob_size = 3 else @@ -146,8 +146,8 @@ swarm_name = "peasentry" announce_name = "request" desc = "A single rat. This one seems special." - attacktext = "scratched" - maxHealth = 10 + attacktext = "scratches" + maxhealth = 10 health = 10 mob_size = 2 diff --git a/code/modules/mob/living/simple_animal/friendly/schlorrgo.dm b/code/modules/mob/living/simple_animal/friendly/schlorrgo.dm index 064cf563403..83954c99e6d 100644 --- a/code/modules/mob/living/simple_animal/friendly/schlorrgo.dm +++ b/code/modules/mob/living/simple_animal/friendly/schlorrgo.dm @@ -23,7 +23,7 @@ hunger_enabled = TRUE canbrush = TRUE - maxHealth = 30 + maxhealth = 30 health = 30 can_be_milked = TRUE @@ -146,7 +146,7 @@ current_size = BABY_SCHLORRGO max_nutrition = 100 nutrition_threshold = 80 - maxHealth = 30 + maxhealth = 30 health = 30 mob_size = MOB_TINY meat_amount = 1 @@ -163,7 +163,7 @@ current_size = NORMAL_SCHLORRGO max_nutrition = 200 nutrition_threshold = 150 - maxHealth = 50 + maxhealth = 50 health = 50 mob_size = MOB_SMALL meat_amount = 3 @@ -180,7 +180,7 @@ current_size = FAT_SCHLORRGO max_nutrition = 400 nutrition_threshold = 300 - maxHealth = 100 + maxhealth = 100 health = 100 mob_size = MOB_MEDIUM meat_amount = 6 @@ -198,7 +198,7 @@ current_size = WIDE_SCHLORRGO max_nutrition = 1000 nutrition_threshold = 800 - maxHealth = 250 + maxhealth = 250 health = 250 mob_size = MOB_LARGE meat_amount = 12 @@ -209,7 +209,7 @@ response_help = "rubs [name]'s belly" melee_damage_lower = 15 melee_damage_upper = 15 - attacktext = "crushed" + attacktext = "crushes" environment_smash = 1 resistance = 2 mob_swap_flags = HUMAN|ROBOT @@ -225,7 +225,7 @@ desc = "A fat creature native to the world of Hro'zamal. This one has been immobilized by its massive weight." current_size = COLOSSAL_SCHLORRGO max_nutrition = 1500 - maxHealth = 450 + maxhealth = 450 health = 450 mob_size = MOB_LARGE meat_amount = 25 @@ -290,7 +290,7 @@ hunger_enabled = FALSE - maxHealth = 80 + maxhealth = 80 health = 80 can_be_milked = FALSE @@ -338,12 +338,12 @@ faction = "PRA" // Evil PRA Machine - maxHealth = 80 + maxhealth = 80 health = 80 melee_damage_lower = 10 melee_damage_upper = 10 - attacktext = "sawed" + attacktext = "saws" attack_sound = 'sound/weapons/saw/circsawhit.ogg' mob_size = MOB_SMALL diff --git a/code/modules/mob/living/simple_animal/friendly/slime.dm b/code/modules/mob/living/simple_animal/friendly/slime.dm index 9f1d2f9c4a0..8d3c7cce267 100644 --- a/code/modules/mob/living/simple_animal/friendly/slime.dm +++ b/code/modules/mob/living/simple_animal/friendly/slime.dm @@ -7,7 +7,7 @@ icon_dead = "grey baby slime dead" speak_emote = list("chirps") health = 100 - maxHealth = 100 + maxhealth = 100 accent = ACCENT_BLUESPACE response_help = "pets" response_disarm = "shoos" @@ -32,7 +32,7 @@ desc = "A lovable, domesticated slime." icon = 'icons/mob/npc/slimes.dmi' health = 200 - maxHealth = 200 + maxhealth = 200 icon_state = "grey adult slime" icon_living = "grey adult slime" icon_dead = "grey baby slime dead" diff --git a/code/modules/mob/living/simple_animal/friendly/snake.dm b/code/modules/mob/living/simple_animal/friendly/snake.dm index 149e0334b33..84e1f0e6fb0 100644 --- a/code/modules/mob/living/simple_animal/friendly/snake.dm +++ b/code/modules/mob/living/simple_animal/friendly/snake.dm @@ -8,7 +8,7 @@ speak_emote = list("hisses") emote_see = list("flicks out its tongue", "looks around") health = 15 - maxHealth = 15 + maxhealth = 15 organ_names = list("head", "body") response_help = "pets" response_disarm = "boops" diff --git a/code/modules/mob/living/simple_animal/friendly/spiderbot.dm b/code/modules/mob/living/simple_animal/friendly/spiderbot.dm index 52ea370b9a0..b9d8f6d5b3b 100644 --- a/code/modules/mob/living/simple_animal/friendly/spiderbot.dm +++ b/code/modules/mob/living/simple_animal/friendly/spiderbot.dm @@ -29,10 +29,10 @@ wander = 0 density = 0 health = 25 - maxHealth = 25 + maxhealth = 25 hunger_enabled = 0 - attacktext = "shocked" + attacktext = "shocks" melee_damage_lower = 1 melee_damage_upper = 3 @@ -122,10 +122,10 @@ if (attacking_item.tool_behaviour == TOOL_WELDER) var/obj/item/weldingtool/WT = attacking_item if (WT.use(0)) - if(health < maxHealth) + if(health < maxhealth) health += pick(1,1,1,2,2,3) - if(health > maxHealth) - health = maxHealth + if(health > maxhealth) + health = maxhealth add_fingerprint(user) src.visible_message(SPAN_NOTICE("\The [user] has spot-welded some of the damage to \the [src]!")) else diff --git a/code/modules/mob/living/simple_animal/friendly/tomato.dm b/code/modules/mob/living/simple_animal/friendly/tomato.dm index 69a7c2bebfc..94f452a1b62 100644 --- a/code/modules/mob/living/simple_animal/friendly/tomato.dm +++ b/code/modules/mob/living/simple_animal/friendly/tomato.dm @@ -6,7 +6,7 @@ icon_dead = "tomato_dead" speak_chance = 0 turns_per_move = 5 - maxHealth = 15 + maxhealth = 15 health = 15 meat_type = /obj/item/reagent_containers/food/snacks/tomatomeat organ_names = list("head") @@ -16,5 +16,5 @@ harm_intent_damage = 5 melee_damage_upper = 15 melee_damage_lower = 10 - attacktext = "mauled" + attacktext = "mauls" mob_size = 2 diff --git a/code/modules/mob/living/simple_animal/hostile/adhomai.dm b/code/modules/mob/living/simple_animal/hostile/adhomai.dm index 8d26e16e110..e49647b5a7d 100644 --- a/code/modules/mob/living/simple_animal/hostile/adhomai.dm +++ b/code/modules/mob/living/simple_animal/hostile/adhomai.dm @@ -12,7 +12,7 @@ response_disarm = "gently pushes aside the" response_harm = "hits the" speed = -2 - maxHealth = 80 + maxhealth = 80 health = 80 mob_size = 10 @@ -20,7 +20,7 @@ melee_damage_lower = 15 melee_damage_upper = 15 - attacktext = "bitten" + attacktext = "bites" attack_sound = 'sound/weapons/bite.ogg' environment_smash = 1 @@ -49,14 +49,14 @@ response_harm = "hits the" speed = -1 - maxHealth = 75 + maxhealth = 75 health = 75 mob_size = 5 melee_damage_lower = 15 melee_damage_upper = 15 - attacktext = "bitten" + attacktext = "bites" attack_sound = 'sound/weapons/bite.ogg' faction = "Adhomai" @@ -76,7 +76,7 @@ meat_amount = 5 organ_names = list("body", "tentacles") faction = "Adhomai" - maxHealth = 100 + maxhealth = 100 health = 100 speak_emote = list("gurgles") @@ -93,7 +93,7 @@ mob_swap_flags = HUMAN|SIMPLE_ANIMAL|SLIME|MONKEY mob_push_flags = ALLMOBS - attacktext = "strangled" + attacktext = "strangles" attack_sound = 'sound/effects/noosed.ogg' speed = 1 @@ -119,12 +119,12 @@ emote_hear = list("hums") emote_see = list("hums ominously", "crackles with energy", "floats around") - maxHealth = 50 + maxhealth = 50 health = 50 melee_damage_lower = 5 melee_damage_upper = 5 - attacktext = "shocked" + attacktext = "shocks" attack_sound = 'sound/magic/LightningShock.ogg' speed = 1 diff --git a/code/modules/mob/living/simple_animal/hostile/alien.dm b/code/modules/mob/living/simple_animal/hostile/alien.dm index 95eb9d312b1..c8fd579102a 100644 --- a/code/modules/mob/living/simple_animal/hostile/alien.dm +++ b/code/modules/mob/living/simple_animal/hostile/alien.dm @@ -8,11 +8,11 @@ icon_dead = "samak_dead" icon = 'icons/jungle.dmi' speed = 2 - maxHealth = 125 + maxhealth = 125 health = 125 melee_damage_lower = 5 melee_damage_upper = 15 - attacktext = "mauled" + attacktext = "mauls" cold_damage_per_tick = 0 speak_chance = 5 speak = list("Hruuugh!","Hrunnph") @@ -29,11 +29,11 @@ icon_dead = "diyaab_dead" icon = 'icons/jungle.dmi' speed = 1 - maxHealth = 25 + maxhealth = 25 health = 25 melee_damage_lower = 1 melee_damage_upper = 8 - attacktext = "gouged" + attacktext = "gouges" cold_damage_per_tick = 0 speak_chance = 5 speak = list("Awrr?","Aowrl!","Worrl") @@ -54,11 +54,11 @@ icon_dead = "shantak_dead" icon = 'icons/jungle.dmi' speed = 1 - maxHealth = 75 + maxhealth = 75 health = 75 melee_damage_lower = 3 melee_damage_upper = 12 - attacktext = "gouged" + attacktext = "gouges" cold_damage_per_tick = 0 speak_chance = 5 speak = list("Shuhn","Shrunnph?","Shunpf") diff --git a/code/modules/mob/living/simple_animal/hostile/bat.dm b/code/modules/mob/living/simple_animal/hostile/bat.dm index cc7b213a78a..d7ef9f3e938 100644 --- a/code/modules/mob/living/simple_animal/hostile/bat.dm +++ b/code/modules/mob/living/simple_animal/hostile/bat.dm @@ -15,7 +15,7 @@ response_disarm = "gently pushes aside the" response_harm = "hits the" speed = 4 - maxHealth = 20 + maxhealth = 20 health = 20 mob_size = 2.5 diff --git a/code/modules/mob/living/simple_animal/hostile/bear.dm b/code/modules/mob/living/simple_animal/hostile/bear.dm index 552eba706ac..ec1f67df7f8 100644 --- a/code/modules/mob/living/simple_animal/hostile/bear.dm +++ b/code/modules/mob/living/simple_animal/hostile/bear.dm @@ -22,7 +22,7 @@ response_disarm = "gently pushes aside" response_harm = "hits" stop_automated_movement_when_pulled = 0 - maxHealth = 80 + maxhealth = 80 melee_damage_lower = 10 melee_damage_upper = 18 armor_penetration = 30 //Standard armor probably doesn't help against a bear, does it? @@ -354,18 +354,18 @@ var/healthpercent if (bearmode == BEARMODE_SPACE) custom_emote(VISIBLE_MESSAGE, "looks bright, energised and aggressive!" ) - healthpercent = health / maxHealth - maxHealth = initial(maxHealth) * 1.5 - health = maxHealth * healthpercent + healthpercent = health / maxhealth + maxhealth = initial(maxhealth) * 1.5 + health = maxhealth * healthpercent melee_damage_lower = initial(melee_damage_lower)*1.2 melee_damage_upper = initial(melee_damage_upper)*1.2 turns_per_move -= 2 growl_loud() else custom_emote(VISIBLE_MESSAGE, "looks darker and more subdued." ) - healthpercent = health / maxHealth - maxHealth = initial(maxHealth) - health = maxHealth * healthpercent + healthpercent = health / maxhealth + maxhealth = initial(maxhealth) + health = maxhealth * healthpercent melee_damage_lower = initial(melee_damage_lower) melee_damage_upper = initial(melee_damage_upper) growl_soft() @@ -408,7 +408,7 @@ /mob/living/simple_animal/hostile/bear/spatial name = "bluespace bear" desc = "*bzzt*..Rawr!!" - maxHealth = 130 + maxhealth = 130 turns_per_move = 7 break_stuff_probability = 100//Constantly smashing everything nearby speak_chance = 15 diff --git a/code/modules/mob/living/simple_animal/hostile/cavern_geist.dm b/code/modules/mob/living/simple_animal/hostile/cavern_geist.dm index 168123e81cf..89df833f51c 100644 --- a/code/modules/mob/living/simple_animal/hostile/cavern_geist.dm +++ b/code/modules/mob/living/simple_animal/hostile/cavern_geist.dm @@ -21,7 +21,7 @@ response_disarm = "shoves" response_harm = "harmlessly punches" blood_amount = 600 - maxHealth = 500 + maxhealth = 500 health = 500 harm_intent_damage = 0 melee_damage_lower = 40 @@ -30,7 +30,7 @@ resist_mod = 15 mob_size = 25 environment_smash = 2 - attacktext = "mangled" + attacktext = "mangles" attack_sound = 'sound/weapons/bloodyslice.ogg' lighting_alpha = LIGHTING_PLANE_ALPHA_SOMEWHAT_INVISIBLE @@ -104,7 +104,7 @@ icon_state = "cybergeist" icon_living = "cybergeist" icon_dead = "cybergeist_dead" - maxHealth = 700 + maxhealth = 700 health = 700 speed = -2 diff --git a/code/modules/mob/living/simple_animal/hostile/changeling.dm b/code/modules/mob/living/simple_animal/hostile/changeling.dm index 25e489b1746..e4df40d8bf1 100644 --- a/code/modules/mob/living/simple_animal/hostile/changeling.dm +++ b/code/modules/mob/living/simple_animal/hostile/changeling.dm @@ -21,7 +21,7 @@ response_disarm = "shoves" response_harm = "harmlessly punches" blood_amount = 1000 - maxHealth = 1250 + maxhealth = 1250 health = 1250 harm_intent_damage = 0 melee_damage_lower = 30 @@ -33,7 +33,7 @@ resist_mod = 15 mob_size = 25 environment_smash = 2 - attacktext = "mangled" + attacktext = "mangles" attack_sound = 'sound/weapons/bloodyslice.ogg' emote_sounds = list('sound/effects/creatures/bear_loud_1.ogg', 'sound/effects/creatures/bear_loud_2.ogg', 'sound/effects/creatures/bear_loud_3.ogg', 'sound/effects/creatures/bear_loud_4.ogg') @@ -157,13 +157,13 @@ response_help = "pets" response_disarm = "shoves" response_harm = "harmlessly punches" - maxHealth = 50 + maxhealth = 50 health = 50 harm_intent_damage = 5 melee_damage_lower = 5 melee_damage_upper = 10 mob_size = 15 - attacktext = "mangled" + attacktext = "mangles" attack_sound = 'sound/weapons/bloodyslice.ogg' lighting_alpha = LIGHTING_PLANE_ALPHA_SOMEWHAT_INVISIBLE 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 eb1fca96264..e282387782f 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 @@ -8,12 +8,12 @@ icon_gib = "brownbear_gib" health = 100 - maxHealth = 100 + maxhealth = 100 density = TRUE belongs_to_station = FALSE - attacktext = "swatted" + attacktext = "swats" melee_damage_lower = 25 melee_damage_upper = 25 resist_mod = 5 diff --git a/code/modules/mob/living/simple_animal/hostile/commanded/guard_dog.dm b/code/modules/mob/living/simple_animal/hostile/commanded/guard_dog.dm index 8ec4a03625e..72df7d5fa24 100644 --- a/code/modules/mob/living/simple_animal/hostile/commanded/guard_dog.dm +++ b/code/modules/mob/living/simple_animal/hostile/commanded/guard_dog.dm @@ -9,7 +9,7 @@ icon_dead = "german_dead" health = 75 - maxHealth = 75 + maxhealth = 75 stop_automated_movement_when_pulled = 1 //so people can drag the dog around density = 1 @@ -23,7 +23,7 @@ sad_emote = list("whines") emote_sounds = list('sound/effects/creatures/dog_bark.ogg', 'sound/effects/creatures/dog_bark2.ogg', 'sound/effects/creatures/dog_bark3.ogg') - attacktext = "bitten" + attacktext = "bites" attack_sound = 'sound/effects/creatures/dog_bark.ogg' harm_intent_damage = 5 melee_damage_lower = 15 @@ -83,7 +83,7 @@ gender = MALE health = 125 - maxHealth = 125 + maxhealth = 125 icon_state = "columbo" icon_living = "columbo" @@ -98,7 +98,7 @@ icon_dead = "pug_dead" health = 25 - maxHealth = 25 + maxhealth = 25 density = 0 @@ -146,7 +146,7 @@ resist_mod = 4 health = 100 - maxHealth = 100 + maxhealth = 100 meat_amount = 3 diff --git a/code/modules/mob/living/simple_animal/hostile/commanded/ives.dm b/code/modules/mob/living/simple_animal/hostile/commanded/ives.dm index b451efec839..44084900bce 100644 --- a/code/modules/mob/living/simple_animal/hostile/commanded/ives.dm +++ b/code/modules/mob/living/simple_animal/hostile/commanded/ives.dm @@ -12,7 +12,7 @@ blood_overlay_icon = null health = 70 - maxHealth = 70 + maxhealth = 70 belongs_to_station = TRUE stop_automated_movement_when_pulled = TRUE @@ -35,7 +35,7 @@ projectilesound = 'sound/weapons/taser2.ogg' projectiletype = /obj/projectile/beam/hivebot/harmless - attacktext = "harmlessly clawed" + attacktext = "harmlessly claws" harm_intent_damage = 5 // the damage we take melee_damage_lower = 0 melee_damage_upper = 0 diff --git a/code/modules/mob/living/simple_animal/hostile/creature.dm b/code/modules/mob/living/simple_animal/hostile/creature.dm index 20f6ff6ebc5..420a9f07bf7 100644 --- a/code/modules/mob/living/simple_animal/hostile/creature.dm +++ b/code/modules/mob/living/simple_animal/hostile/creature.dm @@ -6,11 +6,11 @@ icon_living = "otherthing" icon_dead = "otherthing-dead" health = 80 - maxHealth = 80 + maxhealth = 80 melee_damage_lower = 20 melee_damage_upper = 30 organ_names = list("meaty core") - attacktext = "chomped" + attacktext = "chomps" attack_sound = 'sound/weapons/bite.ogg' faction = "creature" speed = 4 diff --git a/code/modules/mob/living/simple_animal/hostile/faithless.dm b/code/modules/mob/living/simple_animal/hostile/faithless.dm index 90a58866544..6e437761dca 100644 --- a/code/modules/mob/living/simple_animal/hostile/faithless.dm +++ b/code/modules/mob/living/simple_animal/hostile/faithless.dm @@ -12,7 +12,7 @@ response_disarm = "shoves" response_harm = "hits" speed = 4 - maxHealth = 80 + maxhealth = 80 health = 80 environment_smash = 2 @@ -20,7 +20,7 @@ melee_damage_lower = 15 melee_damage_upper = 15 - attacktext = "gripped" + attacktext = "grips" attack_sound = 'sound/hallucinations/growl1.ogg' min_oxy = 0 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 cb25b4672c2..daf99b9cfa9 100644 --- a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm +++ b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm @@ -28,7 +28,7 @@ blood_type = "#51C404" blood_amount = 150 stop_automated_movement_when_pulled = 0 - maxHealth = 200 + maxhealth = 200 health = 200 melee_damage_lower = 15 melee_damage_upper = 20 @@ -45,7 +45,7 @@ mob_size = 6 smart_melee = FALSE - attacktext = "bitten" + attacktext = "bites" attack_emote = "skitters toward" attack_sound = 'sound/weapons/bite.ogg' emote_sounds = list('sound/effects/creatures/spider_critter.ogg') @@ -59,7 +59,7 @@ icon_living = "greimorian_worker" icon_dead = "greimorian_worker_dead" blood_amount = 50 - maxHealth = 40 + maxhealth = 40 health = 40 melee_damage_lower = 5 melee_damage_upper = 10 @@ -77,7 +77,7 @@ icon_living = "greimorian_servant" icon_dead = "greimorian_servant_dead" blood_amount = 150 - maxHealth = 200 + maxhealth = 200 health = 200 melee_damage_lower = 15 melee_damage_upper = 20 @@ -102,7 +102,7 @@ icon_living = "greimorian_hunter" icon_dead = "greimorian_hunter_dead" blood_amount = 90 - maxHealth = 120 + maxhealth = 120 health = 120 melee_damage_lower = 10 melee_damage_upper = 20 @@ -118,7 +118,7 @@ icon_state = "greimorian_jackal" icon_living = "greimorian_jackal" icon_dead = "greimorian_jackal_dead" - maxHealth = 100 + maxhealth = 100 health = 100 melee_damage_lower = 5 melee_damage_upper = 10 @@ -135,7 +135,7 @@ icon_state = "greimorian_bombardier" icon_living = "greimorian_bombardier" icon_dead = "greimorian_bombardier_dead" - maxHealth = 60 + maxhealth = 60 health = 60 melee_damage_lower = 5 melee_damage_upper = 10 diff --git a/code/modules/mob/living/simple_animal/hostile/hivebots/hivebot.dm b/code/modules/mob/living/simple_animal/hostile/hivebots/hivebot.dm index a7d86507e4e..db8b7e903b2 100644 --- a/code/modules/mob/living/simple_animal/hostile/hivebots/hivebot.dm +++ b/code/modules/mob/living/simple_animal/hostile/hivebots/hivebot.dm @@ -6,13 +6,13 @@ blood_type = COLOR_OIL blood_overlay_icon = 'icons/mob/npc/blood_overlay_hivebot.dmi' health = 15 - maxHealth = 15 + maxhealth = 15 melee_damage_lower = 10 melee_damage_upper = 10 armor_penetration = 40 attack_flags = DAMAGE_FLAG_SHARP|DAMAGE_FLAG_EDGE break_stuff_probability = 25 - attacktext = "slashed" + attacktext = "slashes" attack_sound = SFX_HIVEBOT_MELEE projectilesound = 'sound/weapons/gunshot/gunshot_suppressed.ogg' projectiletype = /obj/projectile/bullet/pistol/hivebotspike @@ -159,7 +159,7 @@ */ /mob/living/simple_animal/hostile/hivebot/guardian health = 80 - maxHealth = 45 + maxhealth = 45 melee_damage_lower = 20 melee_damage_upper = 20 wander = 0 @@ -180,10 +180,10 @@ /mob/living/simple_animal/hostile/hivebot/bomber desc = "A primitive in design, hovering robot, with some menacing looking blades jutting out from it. It bears no manufacturer markings of any kind. This one appears round in design and moves slower than its brethren." health = 100 - maxHealth = 100 + maxhealth = 100 icon_state = "hivebotbomber" organ_names = list("head", "core", "bottom thruster") - attacktext = "bumped" + attacktext = "bumps" speed = 8 var/has_exploded = FALSE @@ -231,11 +231,11 @@ desc = "A primitive-yet-sturdy hovering robot, with some menacing looking blades jutting out from it. This one seems unusually aware of its surroundings." icon_state = "hivebotdestroyer" health = 350 - maxHealth = 350 + maxhealth = 350 melee_damage_lower = 20 melee_damage_upper = 30 armor_penetration = 20 - attacktext = "eviscerated" + attacktext = "eviscerates" projectiletype = null var/playable = TRUE speed = -2 @@ -258,11 +258,11 @@ desc = "A primitive-yet-sturdy hovering robot, with some menacing looking blades jutting out from it. This one seems to be carefully surveying all activity." icon_state = "hivebotmarksman" health = 250 - maxHealth = 250 + maxhealth = 250 melee_damage_lower = 10 melee_damage_upper = 20 armor_penetration = 20 - attacktext = "stabbed" + attacktext = "stabs" ranged = 1 projectiletype = /obj/projectile/bullet/pistol/medium speed = -3 @@ -285,11 +285,11 @@ desc = "A primitive-yet-sturdy hovering robot, with some menacing looking blades jutting out from it. This one seems to be buzzing with unseen activity from within." icon_state = "hivebotoverseer" health = 300 - maxHealth = 300 + maxhealth = 300 melee_damage_lower = 10 melee_damage_upper = 10 armor_penetration = 10 - attacktext = "slashed" + attacktext = "slashes" ranged = -1 projectiletype = /obj/projectile/bullet/pistol/ diff --git a/code/modules/mob/living/simple_animal/hostile/hivebots/hivebot_beacon.dm b/code/modules/mob/living/simple_animal/hostile/hivebots/hivebot_beacon.dm index a6d411fc4a9..78e2842aeea 100644 --- a/code/modules/mob/living/simple_animal/hostile/hivebots/hivebot_beacon.dm +++ b/code/modules/mob/living/simple_animal/hostile/hivebots/hivebot_beacon.dm @@ -12,7 +12,7 @@ icon_state = "hivebotbeacon_active" icon_living = "hivebotbeacon_active" health = 300 - maxHealth = 300 + maxhealth = 300 blood_type = COLOR_OIL projectilesound = 'sound/weapons/taser2.ogg' projectiletype = /obj/projectile/beam/hivebot diff --git a/code/modules/mob/living/simple_animal/hostile/hivebots/hivebot_harvester.dm b/code/modules/mob/living/simple_animal/hostile/hivebots/hivebot_harvester.dm index 03c039255ad..d10252bc401 100644 --- a/code/modules/mob/living/simple_animal/hostile/hivebots/hivebot_harvester.dm +++ b/code/modules/mob/living/simple_animal/hostile/hivebots/hivebot_harvester.dm @@ -4,7 +4,7 @@ icon = 'icons/mob/npc/hivebot.dmi' icon_state = "hivebotharvester" health = 100 - maxHealth = 100 + maxhealth = 100 blood_type = COLOR_OIL blood_overlay_icon = 'icons/mob/npc/blood_overlay_hivebot.dmi' melee_damage_lower = 30 @@ -12,7 +12,7 @@ destroy_surroundings = 0 wander = 0 ranged = 1 - attacktext = "skewered" + attacktext = "skewers" projectilesound = 'sound/weapons/lasercannonfire.ogg' projectiletype = /obj/projectile/beam/hivebot/incendiary/heavy organ_names = list("head", "core", "side thruster", "harvesting array") diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm index dd543b57c19..f0aab6a2c55 100644 --- a/code/modules/mob/living/simple_animal/hostile/hostile.dm +++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm @@ -271,7 +271,7 @@ ABSTRACT_TYPE(/mob/living/simple_animal/hostile) return face_atom(T) src.do_attack_animation(T) - T.take_damage(max(melee_damage_lower, melee_damage_upper) / 2) + T.add_damage(max(melee_damage_lower, melee_damage_upper) / 2, armor_penetration = armor_penetration) visible_message(SPAN_DANGER("\The [src] [attacktext] \the [T]!")) return T // no need to take a step back here if(loc && attack_sound) @@ -478,7 +478,7 @@ ABSTRACT_TYPE(/mob/living/simple_animal/hostile) found_obj = locate(/obj/structure/table) in target_turf if(found_obj) var/obj/structure/table/table = found_obj - if(!table.breakable) + if(!table.maxhealth) continue found_obj.attack_generic(src, rand(melee_damage_lower, melee_damage_upper), attacktext, TRUE) hostile_last_attack = world.time diff --git a/code/modules/mob/living/simple_animal/hostile/icarus_drone.dm b/code/modules/mob/living/simple_animal/hostile/icarus_drone.dm index e7ec42a57c5..46a5d802ead 100644 --- a/code/modules/mob/living/simple_animal/hostile/icarus_drone.dm +++ b/code/modules/mob/living/simple_animal/hostile/icarus_drone.dm @@ -19,7 +19,7 @@ a_intent = I_HURT stop_automated_movement_when_pulled = FALSE health = 300 - maxHealth = 300 + maxhealth = 300 blood_type = COLOR_OIL speed = 8 projectiletype = /obj/projectile/beam/drone @@ -168,7 +168,7 @@ speak_chance = 5 //repair a bit of damage - if(prob(1) && health < maxHealth) + if(prob(1) && health < maxhealth) visible_message(SPAN_NOTICE("\The [src] shudders and shakes as some of its damaged systems come back online.")) spark(src, 3, GLOB.alldirs) health += rand(25, 100) @@ -186,16 +186,16 @@ src.visible_message(SPAN_ALERT("\The [src] suddenly lights up, and additional targetting vanes slide into place.")) hostile_drone = TRUE - if(health / maxHealth > 0.9) + if(health / maxhealth > 0.9) icon_state = "drone3" explode_chance = 0 - else if(health / maxHealth > 0.7) + else if(health / maxhealth > 0.7) icon_state = "drone2" explode_chance = 0 - else if(health / maxHealth > 0.5) + else if(health / maxhealth > 0.5) icon_state = "drone1" explode_chance = 0.5 - else if(health / maxHealth > 0.3) + else if(health / maxhealth > 0.3) icon_state = "drone0" explode_chance = 5 else if(health > 0) diff --git a/code/modules/mob/living/simple_animal/hostile/ipc_zombie.dm b/code/modules/mob/living/simple_animal/hostile/ipc_zombie.dm index 855e297bb41..0933467441a 100644 --- a/code/modules/mob/living/simple_animal/hostile/ipc_zombie.dm +++ b/code/modules/mob/living/simple_animal/hostile/ipc_zombie.dm @@ -6,12 +6,12 @@ icon_dead = "baseline_grey_off" blood_type = COLOR_OIL health = 100 - maxHealth = 100 + maxhealth = 100 melee_damage_lower = 15 melee_damage_upper = 20 armor_penetration = 20 attack_sound = 'sound/weapons/smash.ogg' - attacktext = "smashed" + attacktext = "smashes" faction = "hivebot" min_oxy = 0 max_oxy = 0 diff --git a/code/modules/mob/living/simple_animal/hostile/krampus.dm b/code/modules/mob/living/simple_animal/hostile/krampus.dm index 208e0b17131..4de8ecd64a2 100644 --- a/code/modules/mob/living/simple_animal/hostile/krampus.dm +++ b/code/modules/mob/living/simple_animal/hostile/krampus.dm @@ -19,7 +19,7 @@ response_help = "pets" response_disarm = "shoves" response_harm = "harmlessly punches" - maxHealth = 1000 + maxhealth = 1000 health = 1000 harm_intent_damage = 0 melee_damage_lower = 30 @@ -27,7 +27,7 @@ resist_mod = 15 mob_size = 25 environment_smash = 2 - attacktext = "punished" + attacktext = "punishes" attack_sound = 'sound/weapons/bladeslice.ogg' lighting_alpha = LIGHTING_PLANE_ALPHA_SOMEWHAT_INVISIBLE @@ -134,13 +134,13 @@ response_disarm = "pushes" response_harm = "hits" speed = 4 - maxHealth = 50 + maxhealth = 50 health = 50 harm_intent_damage = 5 melee_damage_lower = 5 melee_damage_upper = 5 - attacktext = "nibbled" + attacktext = "nibbles" attack_sound = 'sound/weapons/bite.ogg' min_oxy = 0 @@ -170,7 +170,7 @@ icon_state = "gift2_evil" icon_living = "gift2_evil" icon_dead = "gift2" - maxHealth = 100 + maxhealth = 100 health = 100 melee_damage_lower = 10 melee_damage_upper = 10 @@ -179,7 +179,7 @@ icon_state = "gift3_evil" icon_living = "gift3_evil" icon_dead = "gift3" - maxHealth = 150 + maxhealth = 150 health = 150 melee_damage_lower = 15 melee_damage_upper = 15 diff --git a/code/modules/mob/living/simple_animal/hostile/mimic.dm b/code/modules/mob/living/simple_animal/hostile/mimic.dm index 0bc4eba64f9..f7f618b4626 100644 --- a/code/modules/mob/living/simple_animal/hostile/mimic.dm +++ b/code/modules/mob/living/simple_animal/hostile/mimic.dm @@ -15,13 +15,13 @@ response_disarm = "pushes" response_harm = "hits" speed = 4 - maxHealth = 250 + maxhealth = 250 health = 250 harm_intent_damage = 5 melee_damage_lower = 8 melee_damage_upper = 12 - attacktext = "attacked" + attacktext = "attacks" attack_sound = 'sound/weapons/bite.ogg' min_oxy = 0 @@ -57,7 +57,7 @@ // Aggro when you try to open them. Will also pickup loot when spawns and drop it when dies. /mob/living/simple_animal/hostile/mimic/crate - attacktext = "bitten" + attacktext = "bites" stop_automated_movement = 1 wander = 0 @@ -125,7 +125,7 @@ GLOBAL_LIST_INIT(protected_objects, list(/obj/structure/table, /obj/structure/ca /mob/living/simple_animal/hostile/mimic/copy health = 100 - maxHealth = 100 + maxhealth = 100 var/mob/living/creator = null // the creator var/destroy_objects = 0 var/knockdown_people = 0 @@ -165,7 +165,7 @@ GLOBAL_LIST_INIT(protected_objects, list(/obj/structure/table, /obj/structure/ca melee_damage_upper = 2 + I.force speed = 2 * I.w_class - maxHealth = health + maxhealth = health if(creator) src.creator = creator faction = "[REF(creator)]" // very unique diff --git a/code/modules/mob/living/simple_animal/hostile/moghes.dm b/code/modules/mob/living/simple_animal/hostile/moghes.dm index a88c5558c55..3a372249719 100644 --- a/code/modules/mob/living/simple_animal/hostile/moghes.dm +++ b/code/modules/mob/living/simple_animal/hostile/moghes.dm @@ -19,7 +19,7 @@ response_disarm = "shoves" response_harm = "harmlessly punches" blood_overlay_icon = null - maxHealth = 400 + maxhealth = 400 health = 400 harm_intent_damage = 0 melee_damage_lower = 40 @@ -28,7 +28,7 @@ resist_mod = 10 mob_size = 30 environment_smash = 2 - attacktext = "chomped" + attacktext = "chomps" attack_sound = 'sound/weapons/bloodyslice.ogg' lighting_alpha = LIGHTING_PLANE_ALPHA_SOMEWHAT_INVISIBLE @@ -150,7 +150,7 @@ response_disarm = "gently pushes aside the" response_harm = "hits the" speed = -1 - maxHealth = 50 + maxhealth = 50 health = 50 mob_size = 10 @@ -158,7 +158,7 @@ melee_damage_lower = 5 melee_damage_upper = 8 - attacktext = "rammed" + attacktext = "rams" attack_sound = 'sound/weapons/punch4_bass.ogg' environment_smash = 1 diff --git a/code/modules/mob/living/simple_animal/hostile/morph.dm b/code/modules/mob/living/simple_animal/hostile/morph.dm index 512237860b2..94ed89f2906 100644 --- a/code/modules/mob/living/simple_animal/hostile/morph.dm +++ b/code/modules/mob/living/simple_animal/hostile/morph.dm @@ -25,7 +25,7 @@ status_flags = CANPUSH pass_flags = PASSTABLE - maxHealth = 125 + maxhealth = 125 health = 125 max_stamina = -1 @@ -43,7 +43,7 @@ wander = FALSE - attacktext = "glomped" + attacktext = "glomps" attack_sound = 'sound/effects/blobattack.ogg' blood_overlay_icon = null @@ -71,7 +71,7 @@ healths.icon_state = "health6" if(.) if(healths) - switch(health / maxHealth * 100) + switch(health / maxhealth * 100) if(100 to INFINITY) healths.icon_state = "health0" if(80 to 100) @@ -88,7 +88,7 @@ healths.icon_state = "health6" if((stat == UNCONSCIOUS || resting) && locate(/obj/structure/gore/tendrils) in loc) - health = min(maxHealth, health + 1) + health = min(maxhealth, health + 1) /mob/living/simple_animal/hostile/morph/verb/toggle_darkview() set name = "Toggle Darkvision" diff --git a/code/modules/mob/living/simple_animal/hostile/phoron_worm.dm b/code/modules/mob/living/simple_animal/hostile/phoron_worm.dm index 28e7fcf4e18..b6c41c4fb09 100644 --- a/code/modules/mob/living/simple_animal/hostile/phoron_worm.dm +++ b/code/modules/mob/living/simple_animal/hostile/phoron_worm.dm @@ -15,7 +15,7 @@ response_help = "pets" response_disarm = "shoves" response_harm = "harmlessly punches" - maxHealth = 850 + maxhealth = 850 health = 850 harm_intent_damage = 0 melee_damage_lower = 30 @@ -23,7 +23,7 @@ resist_mod = 2 mob_size = 30 environment_smash = 2 - attacktext = "chomped" + attacktext = "chomps" attack_sound = 'sound/weapons/bite.ogg' faction = "worm" @@ -70,7 +70,7 @@ visible_message(SPAN_WARNING("\The [src] starts consuming \the [P]..."), SPAN_NOTICE("You start consuming \the [P].")) if(!do_after(src, 1 SECOND, P)) return - var/self_msg = "You consume \the [P][health < maxHealth ? ", healing yourself" : ""]." + var/self_msg = "You consume \the [P][health < maxhealth ? ", healing yourself" : ""]." adjustBruteLoss(-5 * P.amount) visible_message(SPAN_WARNING("\The [src] consumes \the [P]!"), SPAN_NOTICE(self_msg)) P.amount /= 2 @@ -144,7 +144,7 @@ name = "black trident worm" desc = "An utterly tremendous, disgustingly bloated worm which relishes in the consumption of phoron." icon = 'icons/mob/npc/small_phoron_worm.dmi' - maxHealth = 80 + maxhealth = 80 health = 80 melee_damage_lower = 15 melee_damage_upper = 15 diff --git a/code/modules/mob/living/simple_animal/hostile/pirate.dm b/code/modules/mob/living/simple_animal/hostile/pirate.dm index 93191e6f1bc..fffc98ea875 100644 --- a/code/modules/mob/living/simple_animal/hostile/pirate.dm +++ b/code/modules/mob/living/simple_animal/hostile/pirate.dm @@ -13,13 +13,13 @@ response_harm = "hits" speed = 4 stop_automated_movement_when_pulled = 0 - maxHealth = 100 + maxhealth = 100 health = 100 harm_intent_damage = 5 melee_damage_lower = 30 melee_damage_upper = 30 - attacktext = "slashed" + attacktext = "slashes" attack_sound = 'sound/weapons/bladeslice.ogg' min_oxy = 5 diff --git a/code/modules/mob/living/simple_animal/hostile/pra.dm b/code/modules/mob/living/simple_animal/hostile/pra.dm index 46022240be0..22e30716ab8 100644 --- a/code/modules/mob/living/simple_animal/hostile/pra.dm +++ b/code/modules/mob/living/simple_animal/hostile/pra.dm @@ -24,7 +24,7 @@ attack_emote = "buzzes menacingly at" stop_automated_movement_when_pulled = FALSE health = 300 - maxHealth = 300 + maxhealth = 300 destroy_surroundings = FALSE @@ -35,7 +35,7 @@ melee_damage_upper = 15 mob_size = 5 - attacktext = "slashed" + attacktext = "slashes" attack_sound = 'sound/weapons/bladeslice.ogg' speed = 2 @@ -116,7 +116,7 @@ speed = 3 health = 200 - maxHealth = 200 + maxhealth = 200 ranged = TRUE rapid = TRUE @@ -168,7 +168,7 @@ mob_size = 3 health = 100 - maxHealth = 100 + maxhealth = 100 melee_damage_lower = 5 melee_damage_upper = 5 diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/aquatic.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/aquatic.dm index ba30508f69e..4d7c3df37a1 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/aquatic.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/aquatic.dm @@ -43,7 +43,7 @@ ABSTRACT_TYPE(/mob/living/simple_animal/hostile/retaliate/aquatic) icon_dead = "thresher_dead" icon_rest = "thresher_rest" health = 230 - maxHealth = 230 + maxhealth = 230 melee_damage_lower = 40 melee_damage_upper = 70 armor_penetration = 80 @@ -53,7 +53,7 @@ ABSTRACT_TYPE(/mob/living/simple_animal/hostile/retaliate/aquatic) name = "large toothed aquatic creature" desc = "A threatening-looking aquatic creature with a mouth full of densely-packed, razor sharp teeth. This one has grown to a substantial size." health = 370 - maxHealth = 370 + maxhealth = 370 melee_damage_lower = 50 melee_damage_upper = 90 armor_penetration = 100 diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/cavern.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/cavern.dm index e475be21cfb..ca019a5cea9 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/cavern.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/cavern.dm @@ -19,11 +19,11 @@ mob_size = 12 health = 60 - maxHealth = 60 + maxhealth = 60 blood_type = "#006666" melee_damage_lower = 10 melee_damage_upper = 10 - attacktext = "chomped" + attacktext = "chomps" attack_sound = 'sound/weapons/bite.ogg' speed = 4 projectiletype = /obj/projectile/beam/cavern @@ -84,7 +84,7 @@ icon_dead = "sadrone_dead" speed = 5 health = 60 - maxHealth = 60 + maxhealth = 60 harm_intent_damage = 5 ranged = 1 smart_ranged = TRUE 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 ad2478c7a7b..570cd1c9484 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/clown.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/clown.dm @@ -16,13 +16,13 @@ universal_speak = FALSE a_intent = I_HURT stop_automated_movement_when_pulled = 0 - maxHealth = 75 + maxhealth = 75 health = 75 speed = -1 harm_intent_damage = 8 melee_damage_lower = 10 melee_damage_upper = 10 - attacktext = "attacked" + attacktext = "attacks" attack_sound = 'sound/items/bikehorn.ogg' min_oxy = 5 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 57fd0fb4b5e..bb43982057b 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/exoplanet.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/exoplanet.dm @@ -17,7 +17,7 @@ icon_state = "royalcrab" icon_living = "royalcrab" icon_dead = "royalcrab_dead" - maxHealth = 150 + maxhealth = 150 health = 150 speed = 3 melee_damage_lower = 10 @@ -36,7 +36,7 @@ icon_dead = "char_dead" mob_size = MOB_LARGE health = 45 - maxHealth = 45 + maxhealth = 45 speed = 2 response_help = "pats briefly" response_disarm = "gently pushes" diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/konyang.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/konyang.dm index 9b985db8fd8..3e0e1da202f 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/konyang.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/konyang.dm @@ -14,13 +14,13 @@ mob_size = 12 organ_names = list("torso", "left wing", "right wing", "head") - maxHealth = 300 + maxhealth = 300 health = 300 melee_damage_lower = 20 melee_damage_upper = 30 armor_penetration = 20 - attacktext = "clawed" + attacktext = "claws" attack_sound = 'sound/weapons/slice.ogg' meat_amount = 8 diff --git a/code/modules/mob/living/simple_animal/hostile/rogue_maint_drone.dm b/code/modules/mob/living/simple_animal/hostile/rogue_maint_drone.dm index 51370933036..6630372ee12 100644 --- a/code/modules/mob/living/simple_animal/hostile/rogue_maint_drone.dm +++ b/code/modules/mob/living/simple_animal/hostile/rogue_maint_drone.dm @@ -10,11 +10,11 @@ universal_speak = FALSE density = FALSE health = 50 - maxHealth = 50 + maxhealth = 50 melee_damage_lower = 5 melee_damage_upper = 8 armor_penetration = 5 - attacktext = "sliced" + attacktext = "slices" faction = "silicon" min_oxy = 0 minbodytemp = 0 diff --git a/code/modules/mob/living/simple_animal/hostile/russian.dm b/code/modules/mob/living/simple_animal/hostile/russian.dm index e754504a9c7..3823b5ecedf 100644 --- a/code/modules/mob/living/simple_animal/hostile/russian.dm +++ b/code/modules/mob/living/simple_animal/hostile/russian.dm @@ -14,12 +14,12 @@ response_harm = "hits" speed = 4 stop_automated_movement_when_pulled = 0 - maxHealth = 100 + maxhealth = 100 health = 100 harm_intent_damage = 5 melee_damage_lower = 15 melee_damage_upper = 15 - attacktext = "punched" + attacktext = "punches" a_intent = I_HURT var/corpse = /obj/effect/landmark/mobcorpse/russian var/weapon1 = /obj/item/material/knife diff --git a/code/modules/mob/living/simple_animal/hostile/sarlacc.dm b/code/modules/mob/living/simple_animal/hostile/sarlacc.dm index 74c3627dcec..b639175bcee 100644 --- a/code/modules/mob/living/simple_animal/hostile/sarlacc.dm +++ b/code/modules/mob/living/simple_animal/hostile/sarlacc.dm @@ -96,7 +96,7 @@ icon = 'icons/mob/npc/cavern.dmi' icon_state = "sarlacc" health = 100 - maxHealth = 100 + maxhealth = 100 gender = NEUTER status_flags = 0 anchored = 1 @@ -168,11 +168,11 @@ sated -= 1 if(prob(5) && tentacles < 6) tentacles += 1 - if(health < maxHealth) + if(health < maxhealth) health += 1 sated -= 1 - if(health >= maxHealth) - health = maxHealth + if(health >= maxhealth) + health = maxhealth if(sarlacc && sarlacc.deployed) sarlacc.deployed = 0 else @@ -260,7 +260,7 @@ icon = 'icons/mob/npc/cavern.dmi' icon_state = "sarlacctentacle" health = 25 - maxHealth = 25 + maxhealth = 25 gender = NEUTER status_flags = 0 anchored = 1 @@ -322,7 +322,7 @@ universal_understand = 1 health = 450 - maxHealth = 450 + maxhealth = 450 gender = MALE status_flags = 0 diff --git a/code/modules/mob/living/simple_animal/hostile/space_fauna.dm b/code/modules/mob/living/simple_animal/hostile/space_fauna.dm index 4abc6db2259..ed8cef6a75c 100644 --- a/code/modules/mob/living/simple_animal/hostile/space_fauna.dm +++ b/code/modules/mob/living/simple_animal/hostile/space_fauna.dm @@ -18,7 +18,7 @@ response_disarm = "gently pushes aside the" response_harm = "hits the" speed = 4 - maxHealth = 25 + maxhealth = 25 health = 25 mob_size = 10 @@ -33,7 +33,7 @@ melee_damage_upper = 15 armor_penetration = 5 attack_flags = DAMAGE_FLAG_EDGE - attacktext = "bitten" + attacktext = "bites" attack_sound = 'sound/weapons/bite.ogg' //Space carp aren't affected by atmos. @@ -108,7 +108,7 @@ icon_state = "carp_russian" icon_living = "carp_russian" icon_dead = "carp_russian_dead" - maxHealth = 50 //stronk + maxhealth = 50 //stronk health = 50 /mob/living/simple_animal/hostile/carp/russian/FindTarget() @@ -131,7 +131,7 @@ icon_rest = "shark_rest" meat_amount = 5 - maxHealth = 100 + maxhealth = 100 health = 100 mob_size = 15 @@ -149,7 +149,7 @@ icon_dead = "reaver" meat_amount = 5 - maxHealth = 100 + maxhealth = 100 health = 100 speed = 10 @@ -174,7 +174,7 @@ icon_dead = "eel" meat_amount = 5 - maxHealth = 150 + maxhealth = 150 health = 150 speed = 6 @@ -212,7 +212,7 @@ icon_dead = "bloater" meat_amount = 5 - maxHealth = 50 + maxhealth = 50 health = 50 mob_size = 5 @@ -288,7 +288,7 @@ response_disarm = "gently pushes aside the" response_harm = "hits the" speed = 2 - maxHealth = 5 + maxhealth = 5 health = 5 mob_size = 2 density = FALSE @@ -298,7 +298,7 @@ harm_intent_damage = 5 melee_damage_lower = 5 melee_damage_upper = 5 - attacktext = "bitten" + attacktext = "bites" attack_sound = 'sound/weapons/bite.ogg' min_oxy = 0 diff --git a/code/modules/mob/living/simple_animal/hostile/spider_queen.dm b/code/modules/mob/living/simple_animal/hostile/spider_queen.dm index a7732fdaa5c..a1f945e356e 100644 --- a/code/modules/mob/living/simple_animal/hostile/spider_queen.dm +++ b/code/modules/mob/living/simple_animal/hostile/spider_queen.dm @@ -22,7 +22,7 @@ blood_type = "#51C404" blood_overlay_icon = null stop_automated_movement_when_pulled = 0 - maxHealth = 1000 + maxhealth = 1000 health = 1000 melee_damage_lower = 35 melee_damage_upper = 40 @@ -37,7 +37,7 @@ mob_swap_flags = HUMAN|SIMPLE_ANIMAL|SLIME|MONKEY mob_push_flags = ALLMOBS - attacktext = "bit" + attacktext = "bites" attack_sound = 'sound/weapons/bite.ogg' pass_flags = PASSTABLE|PASSRAILING diff --git a/code/modules/mob/living/simple_animal/hostile/syndicate.dm b/code/modules/mob/living/simple_animal/hostile/syndicate.dm index 34168ee73a0..24f41ceaa04 100644 --- a/code/modules/mob/living/simple_animal/hostile/syndicate.dm +++ b/code/modules/mob/living/simple_animal/hostile/syndicate.dm @@ -14,12 +14,12 @@ response_harm = "hits" speed = 4 stop_automated_movement_when_pulled = 0 - maxHealth = 100 + maxhealth = 100 health = 100 harm_intent_damage = 5 melee_damage_lower = 10 melee_damage_upper = 10 - attacktext = "punched" + attacktext = "punches" a_intent = I_HURT var/corpse = /obj/effect/landmark/mobcorpse/syndicatesoldier var/weapon1 @@ -59,7 +59,7 @@ icon_living = "syndicatemelee" weapon1 = /obj/item/melee/energy/sword/red weapon2 = /obj/item/shield/energy - attacktext = "slashed" + attacktext = "slashes" status_flags = 0 /mob/living/simple_animal/hostile/syndicate/melee/attackby(obj/item/attacking_item, mob/user) diff --git a/code/modules/mob/living/simple_animal/hostile/toy/mech.dm b/code/modules/mob/living/simple_animal/hostile/toy/mech.dm index a3d0d1e466f..26282399d89 100644 --- a/code/modules/mob/living/simple_animal/hostile/toy/mech.dm +++ b/code/modules/mob/living/simple_animal/hostile/toy/mech.dm @@ -9,12 +9,12 @@ universal_speak = FALSE health = 10 - maxHealth = 10 + maxhealth = 10 melee_damage_lower = 1 melee_damage_upper = 2 organ_names = list("chest", "lower body", "left arm", "right arm", "left leg", "right leg", "head") attack_emote = "raises its fist at" - attacktext = "smashed" + attacktext = "smashes" attack_sound = 'sound/weapons/woodenhit.ogg' speed = 2 mob_size = MOB_MINISCULE diff --git a/code/modules/mob/living/simple_animal/hostile/tree.dm b/code/modules/mob/living/simple_animal/hostile/tree.dm index 0ff5f57dfe2..7e8a0173bf5 100644 --- a/code/modules/mob/living/simple_animal/hostile/tree.dm +++ b/code/modules/mob/living/simple_animal/hostile/tree.dm @@ -15,7 +15,7 @@ response_harm = "hits" blood_overlay_icon = null speed = -1 - maxHealth = 250 + maxhealth = 250 health = 250 pixel_x = -16 @@ -23,7 +23,7 @@ harm_intent_damage = 5 melee_damage_lower = 8 melee_damage_upper = 12 - attacktext = "bitten" + attacktext = "bites" attack_sound = 'sound/weapons/bite.ogg' //Space carp aren't affected by atmos. diff --git a/code/modules/mob/living/simple_animal/hostile/vannatusk.dm b/code/modules/mob/living/simple_animal/hostile/vannatusk.dm index e0fe113d165..466ec6629c2 100644 --- a/code/modules/mob/living/simple_animal/hostile/vannatusk.dm +++ b/code/modules/mob/living/simple_animal/hostile/vannatusk.dm @@ -15,7 +15,7 @@ response_help = "pets" response_disarm = "shoves" response_harm = "harmlessly punches" - maxHealth = 350 + maxhealth = 350 health = 350 harm_intent_damage = 5 melee_damage_lower = 30 @@ -24,7 +24,7 @@ resist_mod = 3 mob_size = 15 environment_smash = 2 - attacktext = "mangled" + attacktext = "mangles" attack_emote = "charges toward" attack_sound = 'sound/effects/creatures/vannatusk_attack.ogg' emote_sounds = list('sound/effects/creatures/vannatusk_sound.ogg', 'sound/effects/creatures/vannatusk_sound_2.ogg') diff --git a/code/modules/mob/living/simple_animal/hostile/viscerator.dm b/code/modules/mob/living/simple_animal/hostile/viscerator.dm index 2f278006e93..04068366006 100644 --- a/code/modules/mob/living/simple_animal/hostile/viscerator.dm +++ b/code/modules/mob/living/simple_animal/hostile/viscerator.dm @@ -6,12 +6,12 @@ icon_living = "viscerator_attack" pass_flags = PASSTABLE|PASSRAILING health = 15 - maxHealth = 15 + maxhealth = 15 melee_damage_lower = 10 melee_damage_upper = 15 armor_penetration = 20 density = 0 - attacktext = "cut" + attacktext = "cuts" attack_sound = 'sound/weapons/bladeslice.ogg' blood_overlay_icon = null faction = "syndicate" diff --git a/code/modules/mob/living/simple_animal/shade.dm b/code/modules/mob/living/simple_animal/shade.dm index 70ea0dc296a..57c860db1c1 100644 --- a/code/modules/mob/living/simple_animal/shade.dm +++ b/code/modules/mob/living/simple_animal/shade.dm @@ -6,7 +6,7 @@ icon_state = "shade" icon_living = "shade" icon_dead = "shade_dead" - maxHealth = 50 + maxhealth = 50 health = 50 universal_speak = 1 speak_emote = list("hisses") @@ -17,7 +17,7 @@ response_harm = "punches" melee_damage_lower = 5 melee_damage_upper = 15 - attacktext = "drained the life from" + attacktext = "drains the life from" minbodytemp = 0 maxbodytemp = 4000 min_oxy = 0 @@ -75,7 +75,7 @@ icon_state = "blank" icon_living = "blank" icon_dead = "blank" - maxHealth = 100 + maxhealth = 100 health = 100 universal_speak = 1 universal_understand = 1 diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 802ad65b314..b25da250e65 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -8,7 +8,7 @@ name = "animal" icon = 'icons/mob/npc/animal.dmi' health = 20 - maxHealth = 20 + maxhealth = 20 mob_bump_flag = SIMPLE_ANIMAL mob_swap_flags = MONKEY|SLIME|SIMPLE_ANIMAL @@ -121,7 +121,7 @@ var/melee_reach = 1 var/armor_penetration = 0 var/attack_flags = 0 - var/attacktext = "attacked" + var/attacktext = "attacks" var/attack_sound = SFX_SWING_HIT var/friendly = "nuzzles" var/environment_smash = 0 @@ -225,9 +225,9 @@ . = ..() seek_move_delay = (1 / seek_speed) * 10 //number of ds between moves turns_since_scan = rand(min_scan_interval, max_scan_interval)//Randomise this at the start so animals don't sync up - health = maxHealth + health = maxhealth remove_verb(src, /mob/verb/observe) - health = maxHealth + health = maxhealth if (mob_size) update_nutrition_stats() reagents = new/datum/reagents(stomach_size_mult*mob_size, src) @@ -293,9 +293,9 @@ . = ..() if (stat == DEAD) . += SPAN_DANGER("It looks dead.") - if (health < maxHealth * 0.5) + if (health < maxhealth * 0.5) . += SPAN_DANGER("It looks badly wounded.") - else if (health < maxHealth) + else if (health < maxhealth) . += SPAN_WARNING("It looks wounded.") /mob/living/simple_animal/can_name(var/mob/living/M) @@ -315,8 +315,8 @@ //Health updatehealth() - if(health > maxHealth) - health = maxHealth + if(health > maxhealth) + health = maxhealth handle_blood() handle_stunned() @@ -450,7 +450,7 @@ death() var/current_blood_state = blood_state - var/blood_mod = health / maxHealth + var/blood_mod = health / maxhealth if(blood_mod > 0.9) blood_state = BLOOD_NONE else if(blood_mod >= 0.7) @@ -533,7 +533,7 @@ if (!hunger_enabled || nutrition > max_nutrition * 0.9) return 0//full - else if ((nutrition > max_nutrition * 0.8) || health < maxHealth) + else if ((nutrition > max_nutrition * 0.8) || health < maxhealth) return 1//content else return 2//hungry @@ -634,7 +634,7 @@ if(istype(attacking_item, /obj/item/saddle) && vehicle_version && (stat != DEAD)) var/obj/vehicle/V = new vehicle_version (get_turf(src)) V.health = health - V.maxhealth = maxHealth + V.maxhealth = maxhealth to_chat(user, SPAN_WARNING("You place \the [attacking_item] on the \the [src].")) user.drop_from_inventory(attacking_item) attacking_item.forceMove(get_turf(src)) @@ -774,7 +774,7 @@ . = ..() if(show_stat_health) - . += "Health: [round((health / maxHealth) * 100)]%" + . += "Health: [round((health / maxhealth) * 100)]%" . += "Nutrition: [nutrition]/[max_nutrition]" /mob/living/simple_animal/updatehealth() diff --git a/code/modules/mob/living/simple_animal/worm.dm b/code/modules/mob/living/simple_animal/worm.dm index 60e49ee0762..096f2e83a12 100644 --- a/code/modules/mob/living/simple_animal/worm.dm +++ b/code/modules/mob/living/simple_animal/worm.dm @@ -17,7 +17,7 @@ harm_intent_damage = 2 - maxHealth = 30 + maxhealth = 30 health = 30 universal_speak =1 @@ -185,12 +185,12 @@ icon_living = "spacewormhead0" icon_dead = "spacewormheaddead" - maxHealth = 20 + maxhealth = 20 health = 20 melee_damage_lower = 10 melee_damage_upper = 15 - attacktext = "bitten" + attacktext = "bites" animate_movement = SLIDE_STEPS diff --git a/code/modules/modular_computers/computers/modular_computer/core.dm b/code/modules/modular_computers/computers/modular_computer/core.dm index 55f7d502dd0..d4dd9ded97e 100644 --- a/code/modules/modular_computers/computers/modular_computer/core.dm +++ b/code/modules/modular_computers/computers/modular_computer/core.dm @@ -5,7 +5,7 @@ last_power_usage = 0 return FALSE - if(damage > broken_damage) + if(health <= broken_damage) shutdown_computer() return FALSE @@ -41,7 +41,7 @@ else enabled_services -= service - working = hard_drive && processor_unit && damage < broken_damage && computer_use_power() + working = hard_drive && processor_unit && health >= broken_damage && computer_use_power() check_update_ui_need() if(looping_sound && working && enabled && world.time > ambience_last_played_time + 30 SECONDS && prob(3)) @@ -168,7 +168,7 @@ icon_state = icon_state_unpowered ClearOverlays() - if(damage >= broken_damage) + if(health <= broken_damage) icon_state = icon_state_broken AddOverlays("broken") return @@ -264,7 +264,7 @@ if(tesla_link) tesla_link.enabled = TRUE var/issynth = issilicon(user) // Robots and AIs get different activation messages. - if(damage > broken_damage) + if(health <= broken_damage) if(issynth) to_chat(user, SPAN_WARNING("You send an activation signal to \the [src], but it responds with an error code. It must be damaged.")) else diff --git a/code/modules/modular_computers/computers/modular_computer/damage.dm b/code/modules/modular_computers/computers/modular_computer/damage.dm index 5d1d3a0c8cd..18dce50a8c8 100644 --- a/code/modules/modular_computers/computers/modular_computer/damage.dm +++ b/code/modules/modular_computers/computers/modular_computer/damage.dm @@ -4,50 +4,47 @@ . += FONT_SMALL(SPAN_NOTICE("It contains the following hardware:")) for(var/obj/CH in get_all_components()) . += FONT_SMALL(SPAN_NOTICE(" - [capitalize_first_letters(CH.name)]")) - if(damage > broken_damage) + if(health <= broken_damage) . += SPAN_DANGER("It is heavily damaged!") - else if(damage) + else if(health <= maxhealth) . += SPAN_WARNING("It is damaged.") -/obj/item/modular_computer/proc/break_apart(msg = TRUE) - if(msg) - visible_message(SPAN_WARNING("\The [src] breaks apart!")) +/obj/item/modular_computer/add_damage(damage, damage_flags, damage_type, armor_penetration, obj/weapon) + . = ..() + var/component_probability = 0 + switch(damage_type) + if(DAMAGE_BRUTE) + component_probability = damage / 2 + if(DAMAGE_BURN) + component_probability = damage / 1.5 + + if(component_probability) + for(var/obj/item/computer_hardware/H in get_all_components()) + if(prob(component_probability)) + H.take_damage(round(damage / 2)) + + update_icon() + +/obj/item/modular_computer/on_death() + visible_message(SPAN_WARNING("\The [src] breaks apart!")) new /obj/item/stack/material/steel(get_turf(src), round(steel_sheet_cost/2)) for(var/obj/item/computer_hardware/H in get_all_components()) uninstall_component(null, H) H.forceMove(get_turf(src)) if(prob(25)) H.take_damage(rand(10, 30)) - qdel(src) - -/obj/item/modular_computer/proc/take_damage(var/amount, var/component_probability, var/damage_casing = TRUE, var/randomize = TRUE, msg=TRUE) - if(randomize) - // 75%-125%, rand() works with integers, apparently. - amount *= (rand(75, 125) / 100.0) - amount = round(amount) - if(damage_casing) - damage += amount - damage = between(0, damage, max_damage) - - if(component_probability) - for(var/obj/item/computer_hardware/H in get_all_components()) - if(prob(component_probability)) - H.take_damage(round(amount / 2)) - - if(damage >= max_damage) - break_apart(msg) - update_icon() + . = ..() // Stronger explosions cause serious damage to internal components // Minor explosions are mostly mitigitated by casing. /obj/item/modular_computer/ex_act(var/severity) - take_damage(rand(125, 200) / severity, 30 / severity, msg = FALSE) + add_damage(rand(125, 200) / severity, 30 / severity) // EMPs are similar to explosions, but don't cause physical damage to the casing. Instead they screw up the components /obj/item/modular_computer/emp_act(severity) . = ..() - take_damage(rand(100, 200) / severity, 50 / severity, FALSE) + add_damage(rand(100, 200) / severity, 50 / severity) // "Stun" weapons can cause minor damage to components (short-circuits?) // "Burn" damage is equally strong against internal components and exterior casing @@ -57,10 +54,4 @@ if(. != BULLET_ACT_HIT) return . - switch(hitting_projectile.damage_type) - if(DAMAGE_BRUTE) - take_damage(hitting_projectile.damage, hitting_projectile.damage / 2) - if(DAMAGE_PAIN) - take_damage(hitting_projectile.damage, hitting_projectile.damage / 3, 0) - if(DAMAGE_BURN) - take_damage(hitting_projectile.damage, hitting_projectile.damage / 1.5) + add_damage(hitting_projectile, hitting_projectile.damage_flags(), hitting_projectile.damage_type, hitting_projectile.armor_penetration) diff --git a/code/modules/modular_computers/computers/modular_computer/interaction.dm b/code/modules/modular_computers/computers/modular_computer/interaction.dm index 012f9613cae..5f3cc8b45e8 100644 --- a/code/modules/modular_computers/computers/modular_computer/interaction.dm +++ b/code/modules/modular_computers/computers/modular_computer/interaction.dm @@ -311,14 +311,15 @@ to_chat(user, SPAN_WARNING("\The [attacking_item] is off.")) return TRUE - if(!damage) + if(health >= maxhealth) to_chat(user, SPAN_WARNING("\The [src] does not require repairs.")) return TRUE to_chat(user, SPAN_NOTICE("You begin repairing the damage to \the [src]...")) playsound(get_turf(src), 'sound/items/Welder.ogg', 100, 1) + var/damage = maxhealth - health if(WT.use(round(damage / 75)) && do_after(user, damage / 10, src, DO_REPAIR_CONSTRUCT)) - damage = 0 + health = maxhealth to_chat(user, SPAN_NOTICE("You fully repair \the [src].")) update_icon() return TRUE @@ -354,6 +355,15 @@ if(do_after(user, 1 SECONDS)) visible_message(SPAN_NOTICE("[user] slots \the [access_cable] into \the [src].")) universal_port.insert_cable(access_cable, user) + + if(user?.a_intent == I_HURT && maxhealth) + user.do_attack_animation(src) + user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) + visible_message(SPAN_DANGER("[user] [pick(attacking_item.attack_verb)] \the [src]!")) + add_damage(attacking_item.force, attacking_item.damage_flags(), attacking_item.damtype, attacking_item.armor_penetration, attacking_item) + playsound(user, 'sound/effects/metalhit.ogg', attacking_item.get_clamped_volume()) + return TRUE + return ..() /obj/item/modular_computer/mouse_drop_dragged(atom/over, mob/user, src_location, over_location, params) diff --git a/code/modules/modular_computers/computers/modular_computer/variables.dm b/code/modules/modular_computers/computers/modular_computer/variables.dm index e093253646e..63a29dafca2 100644 --- a/code/modules/modular_computers/computers/modular_computer/variables.dm +++ b/code/modules/modular_computers/computers/modular_computer/variables.dm @@ -3,6 +3,8 @@ /obj/item/modular_computer name = "Modular Computer" desc = DESC_PARENT + maxhealth = OBJECT_HEALTH_MEDIUM + should_use_health = TRUE var/lexical_name = "computer" /// Whether the computer is turned on. @@ -94,13 +96,8 @@ var/power_has_failed = FALSE var/is_holographic = FALSE - /// Damage of the chassis. If the chassis takes too much damage it will break apart. - /// Current damage level - var/damage = 0 /// Damage level at which the computer ceases to operate var/broken_damage = 50 - /// Damage level at which the computer breaks apart. - var/max_damage = 100 /// Important hardware (must be installed for computer to work) /// CPU. Without it the computer won't run. Better CPUs can run more programs at once. diff --git a/code/modules/modular_computers/computers/subtypes/dev_laptop.dm b/code/modules/modular_computers/computers/subtypes/dev_laptop.dm index c250bb00139..3eea7ae972e 100644 --- a/code/modules/modular_computers/computers/subtypes/dev_laptop.dm +++ b/code/modules/modular_computers/computers/subtypes/dev_laptop.dm @@ -16,7 +16,7 @@ message_output_range = 1 max_hardware_size = 2 light_range = 3 - max_damage = 50 + maxhealth = OBJECT_HEALTH_VERY_LOW broken_damage = 25 var/icon_state_closed = "laptop-closed" @@ -43,7 +43,7 @@ ..() else ClearOverlays() - if(damage >= broken_damage) + if(health <= broken_damage) icon_state = icon_state_broken + "-closed" else icon_state = icon_state_closed diff --git a/code/modules/modular_computers/computers/subtypes/dev_silicon.dm b/code/modules/modular_computers/computers/subtypes/dev_silicon.dm index 31bc55dd425..6721a1b8222 100644 --- a/code/modules/modular_computers/computers/subtypes/dev_silicon.dm +++ b/code/modules/modular_computers/computers/subtypes/dev_silicon.dm @@ -9,7 +9,7 @@ base_idle_power_usage = 5 base_active_power_usage = 25 max_hardware_size = 3 - max_damage = 50 + maxhealth = OBJECT_HEALTH_LOW w_class = WEIGHT_CLASS_NORMAL enrolled = DEVICE_PRIVATE /// Thing that contains this computer. Used for silicon computers diff --git a/code/modules/organs/internal/heart.dm b/code/modules/organs/internal/heart.dm index e2a364f9980..2748482cf0e 100644 --- a/code/modules/organs/internal/heart.dm +++ b/code/modules/organs/internal/heart.dm @@ -175,7 +175,7 @@ return else //and if it's beating, let's see if it should var/should_stop = prob(80) && circulation < BLOOD_VOLUME_SURVIVE //cardiovascular shock, not enough liquid to pump - should_stop = should_stop || prob(max(0, owner.getBrainLoss() - owner.maxHealth * 0.75)) //brain failing to work heart properly + should_stop = should_stop || prob(max(0, owner.getBrainLoss() - owner.maxhealth * 0.75)) //brain failing to work heart properly should_stop = should_stop || (prob(fibrillation_stop_risk) && pulse == PULSE_THREADY) //erratic heart patterns, usually caused by oxyloss should_stop = should_stop || owner.chem_effects[CE_NOPULSE] if(should_stop) // The heart has stopped due to going into traumatic or cardiovascular shock. diff --git a/code/modules/organs/organ.dm b/code/modules/organs/organ.dm index af4428ff51d..703093937c0 100644 --- a/code/modules/organs/organ.dm +++ b/code/modules/organs/organ.dm @@ -107,7 +107,7 @@ INITIALIZE_IMMEDIATE(/obj/item/organ) /obj/item/organ/attack_self(var/mob/user) return (owner && loc == owner && owner == user) -/obj/item/organ/proc/update_health() +/obj/item/organ/proc/update_organ_health() return /obj/item/organ/proc/set_dna(var/datum/dna/new_dna) diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index e989ca3f273..2a1fb76d06b 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -381,9 +381,8 @@ return remove_verb(owner, /mob/living/carbon/human/proc/undislocate) -/obj/item/organ/external/update_health() +/obj/item/organ/external/update_organ_health() damage = min(max_damage, (brute_dam + burn_dam)) - return /obj/item/organ/external/replaced(var/mob/living/carbon/human/target) ..() @@ -685,7 +684,7 @@ This function completely restores a damaged organ to perfect condition. fluid_loss_severity = FLUIDLOSS_WIDE_BURN if(INJURY_TYPE_LASER) fluid_loss_severity = FLUIDLOSS_CONC_BURN - var/fluid_loss = (damage/(owner.maxHealth - GLOB.config.health_threshold_dead)) * DEFAULT_BLOOD_AMOUNT * fluid_loss_severity + var/fluid_loss = (damage/(owner.maxhealth - GLOB.config.health_threshold_dead)) * DEFAULT_BLOOD_AMOUNT * fluid_loss_severity owner.remove_blood_simple(fluid_loss) // first check whether we can widen an existing wound diff --git a/code/modules/overmap/ship_weaponry/_ship_ammo_loader.dm b/code/modules/overmap/ship_weaponry/_ship_ammo_loader.dm index c7a53835bc1..fa98719467b 100644 --- a/code/modules/overmap/ship_weaponry/_ship_ammo_loader.dm +++ b/code/modules/overmap/ship_weaponry/_ship_ammo_loader.dm @@ -5,8 +5,7 @@ icon_state = "ammo_loader" density = TRUE anchored = TRUE - var/damage = 0 - var/max_damage = 1000 + maxhealth = 1000 var/obj/machinery/ship_weapon/weapon var/weapon_id //Used to connect weapon systems to the relevant ammunition loader. @@ -41,14 +40,6 @@ if(3) add_damage(10) -/obj/machinery/ammunition_loader/proc/add_damage(var/amount) - damage = max(0, min(damage + amount, max_damage)) - update_damage() - -/obj/machinery/ammunition_loader/proc/update_damage() - if(damage >= max_damage) - qdel(src) - /obj/machinery/ammunition_loader/attackby(obj/item/attacking_item, mob/user) if(isliving(user)) var/mob/living/carbon/human/H = user diff --git a/code/modules/overmap/ship_weaponry/_ship_gun.dm b/code/modules/overmap/ship_weaponry/_ship_gun.dm index 910c54e6914..63e2a9ea35d 100644 --- a/code/modules/overmap/ship_weaponry/_ship_gun.dm +++ b/code/modules/overmap/ship_weaponry/_ship_gun.dm @@ -6,8 +6,7 @@ active_power_usage = 50000 anchored = TRUE density = TRUE - var/damage = 0 - var/max_damage = 1000 + health = 1000 var/heavy_firing_sound = 'sound/weapons/gunshot/ship_weapons/120mm_mortar.ogg' //The sound in the immediate firing area. Very loud. var/light_firing_sound = 'sound/effects/explosionfar.ogg' //The sound played when you're a few walls away. Kind of loud. var/projectile_type = /obj/projectile/ship_ammo @@ -30,25 +29,28 @@ var/list/obj/structure/ship_weapon_dummy/connected_dummies = list() var/obj/structure/ship_weapon_dummy/barrel -/obj/machinery/ship_weapon/condition_hints(mob/user, distance, is_adjacent) - . += ..() - var/ratio = (damage / max_damage) * 100 +/obj/machinery/ship_weapon/Initialize(mapload) + . = ..() + AddComponent(/datum/component/armor, list(MELEE = ARMOR_MELEE_MAJOR, BULLET = ARMOR_BALLISTIC_RIFLE, LASER = ARMOR_LASER_MAJOR)) + +/obj/machinery/ship_weapon/get_damage_condition_hints(mob/user, distance, is_adjacent) + var/ratio = (health / maxhealth) * 100 switch(ratio) if(1 to 10) - . += SPAN_NOTICE("It looks to be in tip top shape apart from a few minor scratches and dings.") + . = SPAN_NOTICE("It looks to be in tip top shape apart from a few minor scratches and dings.") if(10 to 20) - . += SPAN_ALERT("It has some kinks and bends here and there.") + . = SPAN_ALERT("It has some kinks and bends here and there.") if(20 to 40) - . += SPAN_ALERT("It has a few holes through which you can see some machinery.") + . = SPAN_ALERT("It has a few holes through which you can see some machinery.") if(40 to 60) - . += SPAN_WARNING("Some fairly important parts are missing... but it should work anyway.") + . = SPAN_WARNING("Some fairly important parts are missing... but it should work anyway.") if(60 to 80) - . += SPAN_WARNING("It needs repairs direly. Both aiming and firing components are missing or broken. It has a lot of holes, too. It definitely wouldn't \ + . = SPAN_WARNING("It needs repairs direly. Both aiming and firing components are missing or broken. It has a lot of holes, too. It definitely wouldn't \ pass inspection.") if(90 to 100) - . += SPAN_DANGER("It's falling apart! Just touching it might make the whole thing collapse!") + . = SPAN_DANGER("It's falling apart! Just touching it might make the whole thing collapse!") else //At roundstart, weapons start with 0 damage, so it'd be 0 / 1000 * 100 -> 0 - . += SPAN_NOTICE("It looks to be in tip top shape and not damaged at all.") + . = SPAN_NOTICE("It looks to be in tip top shape and not damaged at all.") /obj/machinery/ship_weapon/mechanics_hints(mob/user, distance, is_adjacent) . += ..() @@ -58,9 +60,7 @@ /obj/machinery/ship_weapon/assembly_hints(mob/user, distance, is_adjacent) . += ..() - var/ratio = (damage / max_damage) * 100 - if(ratio > 0) - . += "The damage can be repaired with a welder, but given the size of \the [src] it will take a lot of time and welding fuel." + . += "If damaged, it can be repaired with a welder, but given the size of \the [src] it will take a lot of time and welding fuel." /obj/machinery/ship_weapon/feedback_hints(mob/user, distance, is_adjacent) . += ..() @@ -105,13 +105,10 @@ if(3) add_damage(10) -/obj/machinery/ship_weapon/proc/add_damage(var/amount) - damage = max(0, min(damage + amount, max_damage)) - update_damage() - -/obj/machinery/ship_weapon/proc/update_damage() - if(damage >= max_damage) - qdel(src) +/obj/machinery/ship_weapon/on_death(damage, damage_flags, damage_type, armor_penetration, obj/weapon) + visible_message(FONT_LARGE(SPAN_DANGER("\The [src] explodes in a shower of sparks and fire!"))) + explosion(get_turf(src), 5, 7, 9) + . = ..() /obj/machinery/ship_weapon/attackby(obj/item/attacking_item, mob/user) if(istype(attacking_item, /obj/item/multitool)) @@ -127,13 +124,13 @@ weapon_id = new_id to_chat(user, SPAN_NOTICE("With some finicking, you change the identification tag to [new_id].")) return TRUE - if(istype(attacking_item, /obj/item/weldingtool) && damage) + if(istype(attacking_item, /obj/item/weldingtool) && (health < maxhealth)) var/obj/item/weldingtool/WT = attacking_item if(WT.get_fuel() >= 20) user.visible_message(SPAN_NOTICE("[user] starts slowly welding kinks and holes in \the [src] back to working shape..."), SPAN_NOTICE("You start welding kinks and holes back to working shape. This'll take a long while...")) if(do_after(user, 15 SECONDS)) - add_damage(-max_damage) + set_health(maxhealth) user.visible_message(SPAN_NOTICE("[user] finally finishes patching up \the [src]'s exterior! It's not a pretty job, but it'll do."), SPAN_NOTICE("You finally finish patching up \the [src]'s exterior! It's not a pretty job, but it'll do.")) WT.use(20) diff --git a/code/modules/overmap/ship_weaponry/weaponry/leviathan.dm b/code/modules/overmap/ship_weaponry/weaponry/leviathan.dm index fea7ff1aa9e..b27ab0a2bfa 100644 --- a/code/modules/overmap/ship_weaponry/weaponry/leviathan.dm +++ b/code/modules/overmap/ship_weaponry/weaponry/leviathan.dm @@ -4,7 +4,7 @@ icon = 'icons/obj/machinery/ship_guns/leviathan.dmi' icon_state = "weapon_off" special_firing_mechanism = TRUE - max_damage = 10000 + maxhealth = 10000 projectile_type = /obj/projectile/ship_ammo/leviathan use_ammunition = FALSE diff --git a/code/modules/overmap/ships/computers/sensors.dm b/code/modules/overmap/ships/computers/sensors.dm index d2c9801bbc1..de6b79ddfb3 100644 --- a/code/modules/overmap/ships/computers/sensors.dm +++ b/code/modules/overmap/ships/computers/sensors.dm @@ -130,8 +130,8 @@ if(sensors) data["on"] = sensors.use_power data["range"] = sensors.range - data["health"] = sensors.health - data["max_health"] = sensors.max_health + data["integrity"] = sensors.health + data["max_health"] = sensors.maxhealth data["deep_scan_name"] = sensors.deep_scan_sensor_name data["deep_scan_range"] = sensors.deep_scan_range data["deep_scan_toggled"] = sensors.deep_scan_toggled @@ -401,8 +401,7 @@ icon = 'icons/obj/machinery/sensors.dmi' icon_state = "sensors" anchored = 1 - var/max_health = 200 - var/health = 200 + maxhealth = OBJECT_HEALTH_HIGH var/critical_heat = 50 // sparks and takes damage when active & above this heat var/heat_reduction = 1.7 // mitigates this much heat per tick - can sustain range 4 var/heat = 0 @@ -438,7 +437,7 @@ return TRUE if(default_part_replacement(user, attacking_item)) return TRUE - var/damage = max_health - health + var/damage = maxhealth - health if(damage && attacking_item.tool_behaviour == TOOL_WELDER) var/obj/item/weldingtool/WT = attacking_item @@ -496,17 +495,6 @@ if(heat_percentage > 85) AddOverlays("sensors-effect-hot") -/obj/machinery/shipsensors/condition_hints(mob/user, distance, is_adjacent) - . += ..() - if(health <= 0) - . += "\The [src] is wrecked." - else if(health < max_health * 0.25) - . += SPAN_DANGER("\The [src] looks like it's about to break!") - else if(health < max_health * 0.5) - . += SPAN_ALERT("\The [src] looks seriously damaged!") - else if(health < max_health * 0.75) - . += "\The [src] shows signs of damage!" - /obj/machinery/shipsensors/bullet_act(obj/projectile/hitting_projectile, def_zone, piercing_hit) . = ..() if(. != BULLET_ACT_HIT) @@ -575,7 +563,7 @@ toggle() /obj/machinery/shipsensors/proc/take_damage(value) - health = min(max(health - value, 0),max_health) + health = min(max(health - value, 0), maxhealth) if(use_power && health == 0) toggle() diff --git a/code/modules/paperwork/filingcabinet.dm b/code/modules/paperwork/filingcabinet.dm index f386cd11de3..b051524cf4f 100644 --- a/code/modules/paperwork/filingcabinet.dm +++ b/code/modules/paperwork/filingcabinet.dm @@ -16,6 +16,9 @@ icon_state = "filingcabinet" density = 1 anchored = 1 + maxhealth = OBJECT_HEALTH_VERY_LOW + armor = list(MELEE = ARMOR_MELEE_SMALL, BULLET = ARMOR_BALLISTIC_MINOR) + var/static/list/accepted_items = list( /obj/item/paper, /obj/item/folder, @@ -46,14 +49,12 @@ /obj/structure/filingcabinet/filingcabinet //not changing the path to avoid unecessary map issues, but please don't name stuff like this in the future -Pete icon_state = "tallcabinet" - /obj/structure/filingcabinet/Initialize() . = ..() for(var/obj/item/I in loc) if(is_type_in_list(I, accepted_items)) I.forceMove(src) - /obj/structure/filingcabinet/attackby(obj/item/attacking_item, mob/user) if(is_type_in_list(attacking_item, accepted_items)) to_chat(user, SPAN_NOTICE("You put [attacking_item] in [src].")) @@ -70,6 +71,15 @@ else to_chat(user, SPAN_NOTICE("You can't put [attacking_item] in [src]!")) +/obj/structure/filingcabinet/on_death(damage, damage_flags, damage_type, armor_penetration, obj/weapon) + for(var/obj/item/thing in src) + if(prob(25)) + if(istype(thing, /obj/item/paper)) + if(prob(50)) + var/obj/item/paper/paper = thing + paper.crumple() + thing.forceMove(get_turf(src)) + . = ..() /obj/structure/filingcabinet/attack_hand(mob/user as mob) if(contents.len <= 0) @@ -83,8 +93,6 @@ dat += "" user << browse("[name][dat]", "window=filingcabinet;size=350x300") - return - /obj/structure/filingcabinet/Topic(href, href_list) if(href_list["retrieve"]) usr << browse("", "window=filingcabinet") // Close the menu) diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index 184181cbb50..43359f5487d 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -188,15 +188,7 @@ user.show_message(SPAN_WARNING("\The [src] is already crumpled.")) return //crumple dat paper - info = stars(info,85) - user.visible_message("\The [user] crumples \the [src] into a ball!", "You crumple \the [src] into a ball.") - playsound(src, 'sound/items/bureaucracy/papercrumple.ogg', 50, 1) - if(istype(src, /obj/item/paper/stickynotes)) - icon_state = "stickynote_scrap" - else - icon_state = "scrap" - throw_range = 4 //you can now make epic paper ball hoops into the disposals (kinda dumb that you could only throw crumpled paper 1 tile) -wezzy - crumpled = TRUE + crumple(user) return if (user.a_intent == I_GRAB && !crumpled && can_fold) @@ -244,6 +236,17 @@ playsound(src.loc, 'sound/items/bikehorn.ogg', 50, 1) src.add_fingerprint(user) +/** + * Turns a paper into a crumpled ball. Only prints a message and makes a sound if user is present. + */ +/obj/item/paper/proc/crumple(mob/user) + info = stars(info,85) + if(user) + user.visible_message("\The [user] crumples \the [src] into a ball!", "You crumple \the [src] into a ball.") + playsound(src, 'sound/items/bureaucracy/papercrumple.ogg', 50, 1) + icon_state = "scrap" + throw_range = 4 + /obj/item/paper/attack_ai(var/mob/living/silicon/ai/user) show_content(user) diff --git a/code/modules/paperwork/papershredder.dm b/code/modules/paperwork/papershredder.dm index b0f1641d026..8b355609e8a 100644 --- a/code/modules/paperwork/papershredder.dm +++ b/code/modules/paperwork/papershredder.dm @@ -5,6 +5,7 @@ icon_state = "papershredder0" density = 1 anchored = 1 + maxhealth = OBJECT_HEALTH_LOW var/max_paper = 10 var/paperamount = 0 var/list/shred_amounts = list( diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm index 6bc54da7540..b369ab02372 100644 --- a/code/modules/paperwork/photocopier.dm +++ b/code/modules/paperwork/photocopier.dm @@ -7,6 +7,9 @@ idle_power_usage = 30 active_power_usage = 200 power_channel = AREA_USAGE_EQUIP + maxhealth = OBJECT_HEALTH_VERY_LOW + armor = list(MELEE = ARMOR_MELEE_SMALL, BULLET = ARMOR_BALLISTIC_MINOR) + /// Item to copy. var/obj/item/copy_item /// How much toner is left. @@ -132,7 +135,7 @@ attacking_item.play_tool_sound(get_turf(src), 50) anchored = !anchored to_chat(user, SPAN_NOTICE("You [anchored ? "wrench" : "unwrench"] \the [src].")) - return + return ..() /proc/copy_type(var/obj/machinery/target, var/c_item, var/toner, var/do_print = TRUE, var/mob/user) // helper proc to reduce ctrl+c ctrl+v if (istype(c_item, /obj/item/paper)) diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index 7f05b9278b5..cedf23e3dae 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -33,19 +33,21 @@ If d1 = dir1 and d2 = dir2, it's a full X-X cable, getting from dir1 to dir2 By design, d1 is the smallest direction and d2 is the highest */ /obj/structure/cable - level = 1 - anchored =1 - var/datum/powernet/powernet name = "power cable" desc = "A flexible superconducting cable for heavy-duty power transfer." icon = 'icons/obj/power_cond_white.dmi' icon_state = "0-1" + level = 1 + anchored = TRUE + maxhealth = null //why is this even a structure? obj_flags = OBJ_FLAG_MOVES_UNSUPPORTED - var/d1 = 0 - var/d2 = 1 layer = EXPOSED_WIRE_LAYER color = COLOR_RED + + var/datum/powernet/powernet var/obj/machinery/power/breakerbox/breaker_box + var/d1 = 0 + var/d2 = 1 /obj/structure/cable/feedback_hints(mob/user, distance, is_adjacent) . += ..() diff --git a/code/modules/power/collector.dm b/code/modules/power/collector.dm index d8fd7eae13b..e1de18bae73 100644 --- a/code/modules/power/collector.dm +++ b/code/modules/power/collector.dm @@ -12,8 +12,7 @@ GLOBAL_LIST_INIT_TYPED(rad_collectors, /obj/machinery/power/rad_collector, list( /// The tank of phoron currently attached to the radiation collector var/obj/item/tank/phoron/loaded_tank = null - /// Current health of the collector. TODO: replace with global health - var/health = 100 + maxhealth = OBJECT_HEALTH_LOW /// The maximum safe temperature that the radiation collector can handle var/max_safe_temp = 1000 + T0C /// A boolean determining whether the collector has melted or not. diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm index 73a5b3e5d26..71fedac1ece 100644 --- a/code/modules/power/smes.dm +++ b/code/modules/power/smes.dm @@ -36,7 +36,8 @@ use_power = POWER_USE_OFF clicksound = SFX_SWITCH - var/health = 500 + maxhealth = OBJECT_HEALTH_MEDIUM + /// this it to prevent the damage text from playing repeatedly var/busted = FALSE /// maximum charge diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm index fd60f32e8cd..88345cd791b 100644 --- a/code/modules/power/solar.dm +++ b/code/modules/power/solar.dm @@ -8,8 +8,8 @@ use_power = POWER_USE_OFF idle_power_usage = 0 active_power_usage = 0 + var/id = 0 - var/health = 10 var/obscured = 0 var/sunfrac = 0 var/adir = SOUTH // actual dir @@ -51,11 +51,9 @@ S.anchored = 1 S.forceMove(src) if(S.glass_type == /obj/item/stack/material/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 + set_maxhealth(maxhealth * 2, TRUE) //this need to be placed here, because panels already on the map don't have an assembly linked to update_icon() - - /obj/machinery/power/solar/attackby(obj/item/attacking_item, mob/user) if(attacking_item.tool_behaviour == TOOL_CROWBAR) @@ -72,22 +70,17 @@ return else if (attacking_item) src.add_fingerprint(user) - src.health -= attacking_item.force - src.healthcheck() + add_damage(attacking_item.force) ..() -/obj/machinery/power/solar/proc/healthcheck() - if (src.health <= 0) - if(!(stat & BROKEN)) - broken() - else - new /obj/item/material/shard(src.loc) - new /obj/item/material/shard(src.loc) - qdel(src) - return - return - +/obj/machinery/power/solar/on_death(damage, damage_flags, damage_type, armor_penetration, obj/weapon) + if(!(stat & BROKEN)) + broken() + else + new /obj/item/material/shard(src.loc) + new /obj/item/material/shard(src.loc) + qdel(src) /obj/machinery/power/solar/update_icon() ..() @@ -134,8 +127,6 @@ stat |= BROKEN unset_control() update_icon() - return - /obj/machinery/power/solar/ex_act(severity) switch(severity) diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 7e7b72e5955..8eae1b56e3c 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -346,6 +346,12 @@ else return 50 //if the projectile doesn't do damage, play its hitsound at 50% volume +/obj/projectile/proc/get_structure_damage_sound() + if(damage_type == DAMAGE_BRUTE) + return 'sound/effects/metalping.ogg' + else if(damage_type == DAMAGE_BURN) + return pick(SOUNDS_LASER_METAL) + /obj/projectile/proc/on_ricochet(atom/A) if(!ricochet_auto_aim_angle || !ricochet_auto_aim_range) return @@ -1226,7 +1232,7 @@ if(!P || !P.ping_effect) return - var/image/I = image('icons/obj/projectiles.dmi', src,P.ping_effect,10, pixel_x = pixel_x_offset, pixel_y = pixel_y_offset) + var/image/I = image('icons/obj/projectiles.dmi', src, P.ping_effect, 10, pixel_x = pixel_x_offset, pixel_y = pixel_y_offset) var/angle = (P.firer && prob(60)) ? round(get_angle(P.firer,src)) : round(rand(1,359)) I.pixel_x += rand(-6,6) I.pixel_y += rand(-6,6) @@ -1235,6 +1241,7 @@ rotate.Turn(angle) I.transform = rotate // Need to do this in order to prevent the ping from being deleted + playsound(src, P.get_structure_damage_sound(), P.vol_by_damage()) addtimer(CALLBACK(I, TYPE_PROC_REF(/image, flick_overlay), src, 3), 1) /image/proc/flick_overlay(var/atom/A, var/duration) diff --git a/code/modules/projectiles/projectile/bullets.dm b/code/modules/projectiles/projectile/bullets.dm index eb6a3109e38..24eaefb936c 100644 --- a/code/modules/projectiles/projectile/bullets.dm +++ b/code/modules/projectiles/projectile/bullets.dm @@ -8,6 +8,7 @@ embed = TRUE sharp = TRUE shrapnel_type = /obj/item/material/shard/shrapnel + ping_effect = "ping_b" projectile_piercing = PASSMOB|PASSFLAPS|PASSGRILLE //These are the things it can piece, a number of times up to 'penetrating', if it actually does pierce is decided by projectile/prehit_pierce() muzzle_type = /obj/effect/projectile/muzzle/bullet diff --git a/code/modules/random_map/automata/diona.dm b/code/modules/random_map/automata/diona.dm index bcd7f8fdbec..f292f79632f 100644 --- a/code/modules/random_map/automata/diona.dm +++ b/code/modules/random_map/automata/diona.dm @@ -13,14 +13,9 @@ density = TRUE opacity = FALSE layer = ABOVE_TILE_LAYER - var/max_health = 50 - var/health + maxhealth = OBJECT_HEALTH_VERY_LOW var/destroy_spawntype = /mob/living/carbon/alien/diona -/obj/structure/diona/Initialize(mapload) - . = ..() - health = max_health - /obj/structure/diona/attackby(obj/item/attacking_item, mob/user) user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) if(attacking_item.tool_behaviour == TOOL_WELDER) diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm index 664c5c6c319..48a1ab8fb3a 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm @@ -37,7 +37,7 @@ var/obj/item/organ/external/O = organ var/obj/effect/spider/eggcluster/C = locate() in O if(C) - C.take_damage(removed * 2) + C.add_damage(removed * 2) if(dam) M.adjustToxLoss(target_organ ? (dam * 0.5) : dam) M.add_chemical_effect(CE_TOXIN, removed * strength) diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index a179ca95f89..14d28aa9232 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -857,11 +857,12 @@ desc = "An underfloor disposal pipe." anchored = 1 density = 0 + maxhealth = OBJECT_HEALTH_FRAGILE level = 1 // underfloor only + var/dpdir = 0 // bitmask of pipe directions //dir = 0 // dir will contain dominant direction for junction pipes - var/health = 10 // health points 0-10 layer = EXPOSED_DISPOSALS_PIPE_LAYER var/sortType = "" var/subtype = 0 @@ -1003,7 +1004,7 @@ * Call to break the pipe: will expel any holder inside at the time then delete the pipe * remains: Set to leave broken pipe pieces in place. */ -/obj/structure/disposalpipe/proc/broken(var/remains = 0) +/obj/structure/disposalpipe/proc/broken(var/remains = FALSE) if(remains) for(var/D in GLOB.cardinals) if(D & dpdir) @@ -1039,26 +1040,17 @@ /obj/structure/disposalpipe/ex_act(severity) switch(severity) if(1.0) - broken(0) - return + broken(FALSE) if(2.0) - health -= rand(5,15) - healthcheck() - return + add_damage(rand(5,15)) if(3.0) - health -= rand(0,15) - healthcheck() - return + add_damage(rand(0,15)) - -/** - * Test pipe's health. Am I broken? - */ -/obj/structure/disposalpipe/proc/healthcheck() +/obj/structure/disposalpipe/on_death(damage, damage_flags, damage_type, armor_penetration, obj/weapon) if(health < -2) - broken(0) - else if(health<1) - broken(1) + broken(FALSE) + else if(health < 1) + broken(TRUE) /** * Attack by item diff --git a/code/modules/research/protolathe.dm b/code/modules/research/protolathe.dm index 1819e1f5f0b..a248537044b 100644 --- a/code/modules/research/protolathe.dm +++ b/code/modules/research/protolathe.dm @@ -103,35 +103,38 @@ AddOverlays("[icon_state]_lights_working") /obj/machinery/r_n_d/protolathe/attackby(obj/item/attacking_item, mob/user) + if(user.a_intent == I_HURT) + return ..() + if(build_callback_timer) to_chat(user, SPAN_NOTICE("\The [src] is busy. Please wait for completion of previous operation.")) - return 1 + return TRUE if(default_deconstruction_screwdriver(user, attacking_item)) if(linked_console) linked_console.linked_lathe = null linked_console = null - return + return TRUE if(default_deconstruction_crowbar(user, attacking_item)) - return + return TRUE if(default_part_replacement(user, attacking_item)) - return + return TRUE if(attacking_item.is_open_container()) - return 1 + return TRUE if(panel_open) to_chat(user, SPAN_NOTICE("You can't load \the [src] while it's opened.")) - return 1 + return TRUE if(!linked_console) to_chat(user, SPAN_NOTICE("The [src] must be linked to an R&D console first!")) - return 1 + return TRUE if(!istype(attacking_item, /obj/item/stack/material)) to_chat(user, SPAN_NOTICE("You cannot insert this item into \the [src]!")) - return 1 + return TRUE if(stat) - return 1 + return TRUE if(TotalMaterials() + SHEET_MATERIAL_AMOUNT > max_material_storage) to_chat(user, SPAN_NOTICE("The [src]'s material bin is full. Please remove material before adding more.")) - return 1 + return TRUE var/obj/item/stack/material/stack = attacking_item if(!stack.default_type) diff --git a/code/modules/research/server.dm b/code/modules/research/server.dm index 93e2ad576d7..14111686d44 100644 --- a/code/modules/research/server.dm +++ b/code/modules/research/server.dm @@ -2,8 +2,9 @@ name = "\improper R&D server" desc = "A server which houses a back-up of all station research. It can be used to restore lost data, or to act as another point of retrieval." icon_state = "RD-server" + maxhealth = OBJECT_HEALTH_LOW + var/datum/research/files - var/health = 100 var/list/id_with_upload = list() //List of R&D consoles with upload to server access. var/list/id_with_download = list() //List of R&D consoles with download from server access. var/id_with_upload_string = "" //String versions for easy editing in map editor. diff --git a/code/modules/shieldgen/emergency_shield.dm b/code/modules/shieldgen/emergency_shield.dm index 5b6ee926f30..a9f1edfced5 100644 --- a/code/modules/shieldgen/emergency_shield.dm +++ b/code/modules/shieldgen/emergency_shield.dm @@ -7,7 +7,7 @@ opacity = FALSE anchored = FALSE req_access = list(ACCESS_ENGINE) - var/health = 100 + maxhealth = 100 var/active = FALSE /// Malfunction causes parts of the shield to slowly dissipate var/malfunction = FALSE @@ -270,8 +270,7 @@ anchored = TRUE unacidable = TRUE atmos_canpass = CANPASS_NEVER - /// The shield can only take so much beating (prevents perma-prisons) - var/health = 75 + maxhealth = 75 /// How much power we use when first creating the shield var/shield_generate_power = 75 KILO WATTS /// How much power we use when just being sustained. diff --git a/code/modules/spell_system/spells/spell_list/self/conjure/druidic_spells.dm b/code/modules/spell_system/spells/spell_list/self/conjure/druidic_spells.dm index 82919cb7df1..80007c495c1 100644 --- a/code/modules/spell_system/spells/spell_list/self/conjure/druidic_spells.dm +++ b/code/modules/spell_system/spells/spell_list/self/conjure/druidic_spells.dm @@ -37,6 +37,6 @@ if(!..()) return 0 - newVars = list("maxHealth" = 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("maxhealth" = 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." diff --git a/code/modules/spell_system/spells/spell_list/shapeshift.dm b/code/modules/spell_system/spells/spell_list/shapeshift.dm index 5bbde48b17e..3fec2a4bf68 100644 --- a/code/modules/spell_system/spells/spell_list/shapeshift.dm +++ b/code/modules/spell_system/spells/spell_list/shapeshift.dm @@ -65,12 +65,12 @@ M.status_flags |= GODMODE //dont want him to die or breathe or do ANYTHING spawn(duration) M.status_flags &= ~GODMODE //no more godmode. - var/ratio = trans.health/trans.maxHealth + var/ratio = trans.health/trans.maxhealth if(ratio <= 0) //if he dead dont bother transforming them. qdel(M) return if(share_damage) - M.adjustBruteLoss(M.maxHealth - round(M.maxHealth*(trans.health/trans.maxHealth))) //basically I want the % hp to be the same afterwards + M.adjustBruteLoss(M.maxhealth - round(M.maxhealth*(trans.health/trans.maxhealth))) //basically I want the % hp to be the same afterwards if(trans.mind) trans.mind.transfer_to(M) else diff --git a/code/modules/supermatter/supermatter.dm b/code/modules/supermatter/supermatter.dm index 45a3b71e3ec..71573a52870 100644 --- a/code/modules/supermatter/supermatter.dm +++ b/code/modules/supermatter/supermatter.dm @@ -46,6 +46,7 @@ light_range = 4 light_power = 1 layer = ABOVE_HUMAN_LAYER + maxhealth = null var/gasefficency = 0.25 diff --git a/code/modules/tables/tables.dm b/code/modules/tables/tables.dm index 46322f4a968..dbd3b91d89b 100644 --- a/code/modules/tables/tables.dm +++ b/code/modules/tables/tables.dm @@ -8,7 +8,6 @@ pass_flags_self = PASSTABLE | LETPASSTHROW climbable = TRUE layer = TABLE_LAYER - breakable = TRUE build_amt = 1 //Preset shit @@ -17,8 +16,7 @@ var/no_cargo var/flipped = 0 - var/maxhealth = 10 - var/health = 10 + maxhealth = 10 // For racks (which cannot be either of these things) var/can_reinforce = 1 @@ -34,8 +32,7 @@ var/list/connections = list("nw0", "ne0", "sw0", "se0") -/obj/structure/table/condition_hints(mob/user, distance, is_adjacent) - . += ..() +/obj/structure/table/get_damage_condition_hints(mob/user, distance, is_adjacent) if(health < maxhealth) switch(health / maxhealth) if(0.0 to 0.5) @@ -139,8 +136,7 @@ material = SSmaterials.get_material_by_name(table_mat) if(table_reinf) reinforced = SSmaterials.get_material_by_name(table_reinf) - if(reinforced) - breakable = FALSE + AddComponent(/datum/component/armor, list(MELEE = ARMOR_MELEE_KNIVES, BULLET = ARMOR_BALLISTIC_MINOR)) . = ..() @@ -194,10 +190,10 @@ reinforced = common_material_add(S, user, "reinforc") if(reinforced) - breakable = FALSE update_desc() queue_icon_update() update_material() + AddComponent(/datum/component/armor, list(MELEE = ARMOR_MELEE_KNIVES, BULLET = ARMOR_BALLISTIC_MINOR)) /obj/structure/table/proc/update_desc() if(material) @@ -254,7 +250,6 @@ /obj/structure/table/proc/remove_reinforced(obj/item/screwdriver/S, mob/user) reinforced = common_material_remove(user, reinforced, 40, "reinforcements", "screws", 'sound/items/Screwdriver.ogg') - breakable = TRUE /obj/structure/table/proc/remove_material(obj/item/wrench/W, mob/user) material = common_material_remove(user, material, 20, "plating", "bolts", W.usesound) diff --git a/code/modules/vehicles/vehicle.dm b/code/modules/vehicles/vehicle.dm index 596d0b17b91..f275ab2a3b3 100644 --- a/code/modules/vehicles/vehicle.dm +++ b/code/modules/vehicles/vehicle.dm @@ -12,7 +12,6 @@ anchored = 1 animate_movement=1 light_range = 3 - buckle_movable = 1 buckle_lying = 0 @@ -20,8 +19,6 @@ var/attack_log = null var/on = 0 - var/health = 0 //do not forget to set health for your vehicle! - var/maxhealth = 0 var/fire_dam_coeff = 1.0 var/brute_dam_coeff = 1.0 var/open = 0 //Maint panel @@ -106,7 +103,7 @@ if(T.welding) if(health < maxhealth) if(open) - health = min(maxhealth, health+10) + add_health(10) user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) user.visible_message(SPAN_WARNING("[user] repairs [src]!"), SPAN_NOTICE("You repair [src]!")) @@ -119,12 +116,11 @@ else if(hasvar(attacking_item,"force") && hasvar(attacking_item,"damtype")) user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) switch(attacking_item.damtype) - if("fire") - health -= attacking_item.force * fire_dam_coeff - if("brute") - health -= attacking_item.force * brute_dam_coeff + if(DAMAGE_BURN) + add_damage(attacking_item.force * fire_dam_coeff) + if(DAMAGE_BRUTE) + add_damage(attacking_item.force * brute_dam_coeff) ..() - healthcheck() else ..() @@ -132,31 +128,21 @@ . = ..() if(. != BULLET_ACT_HIT) return . - - health -= hitting_projectile.get_structure_damage() - + add_damage(hitting_projectile.get_structure_damage()) if (prob(20) && !organic) spark(src, 5, GLOB.alldirs) - healthcheck() - /obj/vehicle/ex_act(severity) switch(severity) if(1.0) explode() - return if(2.0) - health -= rand(5,10)*fire_dam_coeff - health -= rand(10,20)*brute_dam_coeff - healthcheck() - return + add_damage(rand(5,10)*fire_dam_coeff) + add_damage(rand(10,20)*brute_dam_coeff) if(3.0) if (prob(50)) - health -= rand(1,5)*fire_dam_coeff - health -= rand(1,5)*brute_dam_coeff - healthcheck() - return - return + add_damage(rand(1,5)*fire_dam_coeff) + add_damage(rand(1,5)*brute_dam_coeff) /obj/vehicle/emp_act(severity) . = ..() @@ -253,9 +239,8 @@ unload() qdel(src) -/obj/vehicle/proc/healthcheck() - if(health <= 0) - explode() +/obj/vehicle/on_death(damage, damage_flags, damage_type, armor_penetration, obj/weapon) + explode() /obj/vehicle/proc/powercheck() if(!cell && !powered) @@ -431,11 +416,10 @@ visible_message(SPAN_DANGER("[user] [attack_message] the [src]!")) user.attack_log += "\[[time_stamp()]\] attacked [src.name]" user.do_attack_animation(src) - src.health -= damage + add_damage(damage) if(prob(10)) new /obj/effect/decal/cleanable/blood/oil(src.loc) - spawn(1) healthcheck() - return 1 + return TRUE /obj/vehicle/can_fall(turf/below, turf/simulated/open/dest = src.loc) if (flying) diff --git a/html/changelogs/mattatlas-universalhealth.yml b/html/changelogs/mattatlas-universalhealth.yml new file mode 100644 index 00000000000..6b2c349533e --- /dev/null +++ b/html/changelogs/mattatlas-universalhealth.yml @@ -0,0 +1,58 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# - (fixes bugs) +# wip +# - (work in progress) +# qol +# - (quality of life) +# soundadd +# - (adds a sound) +# sounddel +# - (removes a sound) +# rscadd +# - (adds a feature) +# rscdel +# - (removes a feature) +# imageadd +# - (adds an image or sprite) +# imagedel +# - (removes an image or sprite) +# spellcheck +# - (fixes spelling or grammar) +# experiment +# - (experimental change) +# balance +# - (balance changes) +# code_imp +# - (misc internal code change) +# refactor +# - (refactors code) +# config +# - (makes a change to the config files) +# admin +# - (makes changes to administrator tools) +# server +# - (miscellaneous changes to server) +################################# + +# Your name. +author: MattAtlas + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit. +# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog. +changes: + - experiment: "Adds an universal health system. This means that objects can dynamically be made destructible. Currently, this applies to things like machinery or some structures." diff --git a/maps/away/away_site/hivebot_hub/hivebot_hub.dm b/maps/away/away_site/hivebot_hub/hivebot_hub.dm index 138581c9a96..18fd65c21ce 100644 --- a/maps/away/away_site/hivebot_hub/hivebot_hub.dm +++ b/maps/away/away_site/hivebot_hub/hivebot_hub.dm @@ -119,7 +119,7 @@ /mob/living/simple_animal/hostile/hivebotbeacon/weakened name = "dilapidated hivebot beacon" desc = "An odd and primitive looking machine. It emanates of strange and powerful energies. It bears no manufacturer markings of any kind. This one appears to have been badly damaged." - maxHealth = 100 + maxhealth = 100 health = 100 /obj/item/paper/hivebot_hub/diary diff --git a/maps/away/away_site/phoron_deposit/phoron_deposit_objects.dm b/maps/away/away_site/phoron_deposit/phoron_deposit_objects.dm index 7cbd05195a2..d8ba398a662 100644 --- a/maps/away/away_site/phoron_deposit/phoron_deposit_objects.dm +++ b/maps/away/away_site/phoron_deposit/phoron_deposit_objects.dm @@ -1,20 +1,20 @@ // Mob stuff /mob/living/simple_animal/hostile/carp/shark/phoron_deposit - maxHealth = 60 + maxhealth = 60 health = 60 /mob/living/simple_animal/hostile/carp/shark/reaver/phoron_deposit - maxHealth = 60 + maxhealth = 60 health = 60 speed = 6 /mob/living/simple_animal/hostile/gnat/phoron_deposit - maxHealth = 15 + maxhealth = 15 health = 15 destroy_surroundings = TRUE /mob/living/simple_animal/hostile/carp/shark/reaver/eel/phoron_deposit - maxHealth = 90 + maxhealth = 90 health = 90 speed = 3 var/tmp/wall_breaking_allowed = FALSE // The eel gets to break walls just to make sure the event can't be cheesed by building them diff --git a/maps/away/away_site/quarantined_outpost/quarantined_outpost_objects.dm b/maps/away/away_site/quarantined_outpost/quarantined_outpost_objects.dm index 68399b56aa1..7d2a1be8704 100644 --- a/maps/away/away_site/quarantined_outpost/quarantined_outpost_objects.dm +++ b/maps/away/away_site/quarantined_outpost/quarantined_outpost_objects.dm @@ -48,7 +48,7 @@ GLOBAL_LIST_EMPTY(trackables_pool) tameable = FALSE blood_type = "#490d0d" - maxHealth = 300 + maxhealth = 300 health = 300 speed = 6 @@ -138,7 +138,7 @@ GLOBAL_LIST_EMPTY(trackables_pool) icon_living = "the_thing" icon_dead = "the_thing_dead" faction = "abominations" - maxHealth = 250 + maxhealth = 250 health = 250 speed = 6 @@ -149,7 +149,7 @@ GLOBAL_LIST_EMPTY(trackables_pool) icon_living = "the_thing_chitin" icon_dead = "the_thing_chitin_dead" - maxHealth = 350 // chitinous armor + maxhealth = 350 // chitinous armor health = 350 speed = 7 // armor heavy @@ -188,7 +188,7 @@ GLOBAL_LIST_EMPTY(trackables_pool) trap_split = TRUE if(prob(20) || starts_disguised) mob_in_disguise = TRUE - maxHealth = 400 // the mob in disguise makes it easy target for a few bullets. This should even the odds. + maxhealth = 400 // the mob in disguise makes it easy target for a few bullets. This should even the odds. health = 400 speed = 15 melee_damage_upper = 60 // punishment for clueless preys. @@ -291,7 +291,7 @@ GLOBAL_LIST_EMPTY(trackables_pool) tameable = FALSE faction = "abominations" - maxHealth = 50 + maxhealth = 50 health = 50 speed = 1 @@ -375,7 +375,7 @@ GLOBAL_LIST_EMPTY(trackables_pool) /mob/living/simple_animal/hostile/revivable/husked_creature/quarantined_outpost/horde var/tmp/breaking_wall = FALSE break_stuff_probability = 100 - maxHealth = 200 + maxhealth = 200 health = 200 /mob/living/simple_animal/hostile/revivable/husked_creature/quarantined_outpost/horde/Move(NewLoc) @@ -433,7 +433,7 @@ GLOBAL_LIST_EMPTY(trackables_pool) var/tmp/breaking_wall = FALSE break_stuff_probability = 100 disguise_disabled = TRUE - maxHealth = 250 + maxhealth = 250 health = 250 /mob/living/simple_animal/hostile/revivable/abomination/quarantined_outpost/horde/Move(NewLoc) diff --git a/maps/sccv_horizon/code/sccv_horizon_structures.dm b/maps/sccv_horizon/code/sccv_horizon_structures.dm index 38388513583..88042f11b20 100644 --- a/maps/sccv_horizon/code/sccv_horizon_structures.dm +++ b/maps/sccv_horizon/code/sccv_horizon_structures.dm @@ -8,7 +8,7 @@ icon_state = "m-1" atmos_canpass = CANPASS_DENSITY - var/health = 1000 + maxhealth = 1000 /obj/structure/tank_wall/Initialize(mapload) . = ..() diff --git a/nano/templates/dna_modifier.tmpl b/nano/templates/dna_modifier.tmpl index 9a2804ba987..600600fd23c 100644 --- a/nano/templates/dna_modifier.tmpl +++ b/nano/templates/dna_modifier.tmpl @@ -1,5 +1,5 @@ -

Status

@@ -18,7 +18,7 @@ Used In File(s): D:\Development\SS13-BS12\code\game\dna\dna_modifier.dm DEAD {{/if}} - + {{if !data.occupant.isViableSubject || !data.occupant.uniqueIdentity || !data.occupant.structuralEnzymes}}
The occupant's DNA structure is ruined beyond recognition, please insert a subject with an intact DNA structure. @@ -27,33 +27,33 @@ Used In File(s): D:\Development\SS13-BS12\code\game\dna\dna_modifier.dm
Health:
{{if data.occupant.health >= 0}} - {{:helper.displayBar(data.occupant.health, 0, data.occupant.maxHealth, 'good')}} + {{:helper.displayBar(data.occupant.health, 0, data.occupant.maxhealth, 'good')}} {{else}} {{:helper.displayBar(data.occupant.health, 0, data.occupant.minHealth, 'average alignRight')}} {{/if}}
{{:helper.round(data.occupant.health)}}
- +
Radiation:
{{:helper.displayBar(data.occupant.radiationLevel, 0, 100, 'average')}}
{{:helper.round(data.occupant.radiationLevel)}}
- +
Unique Enzymes:
{{:data.occupant.uniqueEnzymes ? data.occupant.uniqueEnzymes : 'Unknown'}}
- + +
--> {{/if}} {{/if}}
@@ -78,8 +78,8 @@ Used In File(s): D:\Development\SS13-BS12\code\game\dna\dna_modifier.dm Target:
- {{:helper.link('-', null, {'changeUITarget' : 0}, (data.selectedUITarget > 0) ? null : 'disabled')}} -
 {{:data.selectedUITargetHex}} 
+ {{:helper.link('-', null, {'changeUITarget' : 0}, (data.selectedUITarget > 0) ? null : 'disabled')}} +
 {{:data.selectedUITargetHex}} 
{{:helper.link('+', null, {'changeUITarget' : 1}, (data.selectedUITarget < 15) ? null : 'disabled')}}
@@ -87,7 +87,7 @@ Used In File(s): D:\Development\SS13-BS12\code\game\dna\dna_modifier.dm
{{:helper.link('Irradiate Block', 'radiation', {'pulseUIRadiation' : 1}, !data.occupant.isViableSubject ? 'disabled' : null)}}
- + {{else data.selectedMenuKey == 'se'}}

Modify Structural Enzymes

{{:helper.displayDNABlocks(data.occupant.structuralEnzymes, data.selectedSEBlock, data.selectedSESubBlock, data.dnaBlockSize, 'SE')}} @@ -96,13 +96,13 @@ Used In File(s): D:\Development\SS13-BS12\code\game\dna\dna_modifier.dm
{{:helper.link('Irradiate Block', 'radiation', {'pulseSERadiation' : 1}, !data.occupant.isViableSubject ? 'disabled' : null)}}
- + {{else data.selectedMenuKey == 'buffer'}}

Transfer Buffers

{{for data.buffers}}

Buffer {{:(index + 1)}}

-
+
Load Data:
@@ -114,7 +114,7 @@ Used In File(s): D:\Development\SS13-BS12\code\game\dna\dna_modifier.dm
{{if value.data}} -
+
Label:
@@ -122,7 +122,7 @@ Used In File(s): D:\Development\SS13-BS12\code\game\dna\dna_modifier.dm {{:helper.link(value.label, 'document-b', {'bufferOption' : 'changeLabel', 'bufferId' : (index + 1)})}}
-
+
Subject:
@@ -130,7 +130,7 @@ Used In File(s): D:\Development\SS13-BS12\code\game\dna\dna_modifier.dm {{:value.owner ? value.owner : 'Unknown'}}
-
+
Stored Data:
@@ -140,13 +140,13 @@ Used In File(s): D:\Development\SS13-BS12\code\game\dna\dna_modifier.dm
{{else}} -
+
This buffer is empty.
{{/if}} -
+
Options:
@@ -160,12 +160,12 @@ Used In File(s): D:\Development\SS13-BS12\code\game\dna\dna_modifier.dm
{{/for}} - -

Data Disk

+ +

Data Disk

{{if data.hasDisk}} {{if data.disk.data}} -
+
Label:
@@ -173,7 +173,7 @@ Used In File(s): D:\Development\SS13-BS12\code\game\dna\dna_modifier.dm {{:data.disk.label ? data.disk.label : 'No Label'}}
-
+
Subject:
@@ -181,7 +181,7 @@ Used In File(s): D:\Development\SS13-BS12\code\game\dna\dna_modifier.dm {{:data.disk.owner ? data.disk.owner : 'Unknown'}}
-
+
Stored Data:
@@ -191,20 +191,20 @@ Used In File(s): D:\Development\SS13-BS12\code\game\dna\dna_modifier.dm
{{else}} -
+
Disk is blank.
{{/if}} {{else}} -
+
No disk inserted.
{{/if}} -
+
Options:
@@ -234,7 +234,7 @@ Used In File(s): D:\Development\SS13-BS12\code\game\dna\dna_modifier.dm Beaker:
- {{if data.isBeakerLoaded}} + {{if data.isBeakerLoaded}} {{:data.beakerLabel ? data.beakerLabel : 'No label'}}
{{if data.beakerVolume}} {{:data.beakerVolume}} units remaining
@@ -260,8 +260,8 @@ Used In File(s): D:\Development\SS13-BS12\code\game\dna\dna_modifier.dm Intensity:
- {{:helper.link('-', null, {'radiationIntensity' : 0}, (data.radiationIntensity > 1) ? null : 'disabled')}} -
 {{:data.radiationIntensity}} 
+ {{:helper.link('-', null, {'radiationIntensity' : 0}, (data.radiationIntensity > 1) ? null : 'disabled')}} +
 {{:data.radiationIntensity}} 
{{:helper.link('+', null, {'radiationIntensity' : 1}, (data.radiationIntensity < 10) ? null : 'disabled')}}
@@ -270,7 +270,7 @@ Used In File(s): D:\Development\SS13-BS12\code\game\dna\dna_modifier.dm Duration:
- {{:helper.link('-', null, {'radiationDuration' : 0}, (data.radiationDuration > 2) ? null : 'disabled')}} + {{:helper.link('-', null, {'radiationDuration' : 0}, (data.radiationDuration > 2) ? null : 'disabled')}}
 {{:data.radiationDuration}} 
{{:helper.link('+', null, {'radiationDuration' : 1}, (data.radiationDuration < 20) ? null : 'disabled')}}
diff --git a/sound/attributions.txt b/sound/attributions.txt index b3bd00e6133..71b097a4366 100644 --- a/sound/attributions.txt +++ b/sound/attributions.txt @@ -205,4 +205,7 @@ sound/species/synthetic/fragmentation.ogg -- https://freesound.org/s/390531/ -- sound/species/synthetic/sizzle_*.ogg -- https://freesound.org/s/35872/ -- License: Attribution NonCommercial 3.0 sound/species/synthetic/synthetic_bootup.ogg -- https://freesound.org/s/320664/ -- License: Creative Commons 0 mixed with VHS Startup by Sassaby -- https://freesound.org/s/264934/ -- License: Creative Commons 0 sound/species/synthetic/synthetic_restart.ogg -- https://freesound.org/s/176796/ -- License: Attribution 4.0, remixed with Audacity + +ATTRIBUTIONS SECTION START +sound/effects/metalping.ogg - ported from CM-SS13 ATTRIBUTIONS SECTION END diff --git a/sound/effects/metalping.ogg b/sound/effects/metalping.ogg new file mode 100644 index 00000000000..430fce60b46 Binary files /dev/null and b/sound/effects/metalping.ogg differ