Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions code/__DEFINES/obj.dm
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,13 @@
return null

#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
2 changes: 1 addition & 1 deletion code/_onclick/item_attack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ avoid code duplication. This includes items that may sometimes act as a standard
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]."))
visible_message(SPAN_DANGER("[src] has been [attacking_item.attack_verb ? pick(attacking_item.attack_verb) : "hit"] by [user] with [attacking_item]."))

/mob/living/attackby(obj/item/attacking_item, mob/user, params)
if(..())
Expand Down
41 changes: 19 additions & 22 deletions code/game/gamemodes/cult/structures/pylon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
var/isbroken = FALSE
light_range = 5
light_color = "#3e0000"
var/pylonmode = PYLON_IDLE
maxhealth = 30

var/damagetaken = 0
var/pylonmode = PYLON_IDLE

///Number of empowered, higher-damage shots remaining
var/empowered = 0
Expand Down Expand Up @@ -44,19 +44,16 @@
var/ticks
anchored = FALSE

/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)
. += ..()
Expand Down Expand Up @@ -154,8 +151,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."))
Expand Down Expand Up @@ -441,19 +438,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)
Expand Down Expand Up @@ -496,14 +493,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
health = maxhealth
update_icon()

/obj/structure/cult/pylon/update_icon()
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/atmoalter/canister.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
icon = 'icons/obj/atmos.dmi'
icon_state = "yellow"
density = 1
var/health = 100.0
health = 50
obj_flags = OBJ_FLAG_SIGNALER | OBJ_FLAG_CONDUCTABLE
w_class = WEIGHT_CLASS_HUGE

Expand Down
1 change: 0 additions & 1 deletion code/game/machinery/autolathe/autolathe.dm
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@
return TRUE
if(default_part_replacement(user, attacking_item))
return TRUE

if(stat)
return TRUE

Expand Down
11 changes: 0 additions & 11 deletions code/game/machinery/bots/bots.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,12 @@
use_power = POWER_USE_OFF
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()
Expand Down
6 changes: 2 additions & 4 deletions code/game/machinery/deployable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
. = ..()
Expand Down Expand Up @@ -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)

Expand Down
26 changes: 13 additions & 13 deletions code/game/machinery/doors/airlock.dm
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,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
Expand Down Expand Up @@ -526,7 +526,7 @@
door_color = COLOR_GRAY40
explosion_resistance = 20
secured_wires = TRUE
maxhealth = 600
maxhealth = OBJECT_HEALTH_EXTREMELY_HIGH
insecure = 0
ai_bolting_delay = 10
ai_unbolt_delay = 5
Expand All @@ -540,7 +540,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
Expand Down Expand Up @@ -586,7 +586,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
Expand All @@ -600,7 +600,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
Expand All @@ -620,7 +620,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
Expand Down Expand Up @@ -655,7 +655,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
Expand All @@ -671,7 +671,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
Expand All @@ -681,7 +681,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
Expand Down Expand Up @@ -731,7 +731,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"
Expand All @@ -753,7 +753,7 @@
explosion_resistance = 20
secured_wires = TRUE
assembly_type = /obj/structure/door_assembly/door_assembly_highsecurity
maxhealth = 600
maxhealth = OBJECT_HEALTH_EXTREMELY_HIGH
insecure = 0
ai_bolting_delay = 10
ai_unbolt_delay = 5
Expand All @@ -765,7 +765,7 @@
door_color = COLOR_PURPLE_GRAY
explosion_resistance = 20
secured_wires = TRUE
maxhealth = 600
maxhealth = OBJECT_HEALTH_EXTREMELY_HIGH
insecure = 0
hashatch = FALSE

Expand All @@ -775,7 +775,7 @@
door_frame_color = "#7E6A40"
explosion_resistance = 20
secured_wires = TRUE
maxhealth = 600
maxhealth = OBJECT_HEALTH_EXTREMELY_HIGH
insecure = FALSE
hashatch = FALSE

Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/doors/blast_door.dm
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,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
Expand Down Expand Up @@ -264,7 +264,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
Expand Down
14 changes: 3 additions & 11 deletions code/game/machinery/doors/door.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
density = TRUE
layer = CLOSED_DOOR_LAYER
dir = SOUTH

maxhealth = OBJECT_HEALTH_VERY_HIGH

var/open_layer = OPEN_DOOR_LAYER
var/closed_layer = CLOSED_DOOR_LAYER

Expand All @@ -35,8 +38,6 @@
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.
Expand All @@ -61,15 +62,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)
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/doors/windowdoor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +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
maxhealth = OBJECT_HEALTH_MEDIUM
health = 150
visible = 0.0
atom_flags = ATOM_FLAG_CHECKS_BORDER
Expand Down Expand Up @@ -239,7 +239,7 @@
base_state = "leftsecure"
req_access = list(ACCESS_SECURITY)
var/id = null
maxhealth = 300
maxhealth = OBJECT_HEALTH_VERY_HIGH
health = 300.0 //Stronger doors for prison (regular window door health is 150)


Expand Down
Loading
Loading