From 90ef1faabab2e65dce7811ea7b9758819d1fcbbc Mon Sep 17 00:00:00 2001
From: Gristlebee <56049844+Gristlebee@users.noreply.github.com>
Date: Fri, 30 Aug 2024 01:04:16 -0700
Subject: [PATCH 1/3] start moving stuff up
---
code/game/turfs/closed/_closed.dm | 486 +++++++++----------
code/game/turfs/closed/indestructible.dm | 266 ++++++++++
code/game/turfs/closed/wall/mineral_walls.dm | 6 +-
code/game/turfs/closed/wall/misc_walls.dm | 2 +-
code/game/turfs/closed/walls.dm | 232 +--------
shiptest.dme | 1 +
6 files changed, 521 insertions(+), 472 deletions(-)
create mode 100644 code/game/turfs/closed/indestructible.dm
diff --git a/code/game/turfs/closed/_closed.dm b/code/game/turfs/closed/_closed.dm
index 2b7d93ae2590..ec8ce09b7c33 100644
--- a/code/game/turfs/closed/_closed.dm
+++ b/code/game/turfs/closed/_closed.dm
@@ -7,8 +7,58 @@
rad_insulation = RAD_MEDIUM_INSULATION
pass_flags_self = PASSCLOSEDTURF
+ ///lower numbers are harder. Used to determine the probability of a hulk smashing through.
+ var/hardness = 40
+ var/breakdown_duration = 20 //default time it takes for a tool to break the wall
+
+ var/attack_hitsound = 'sound/weapons/smash.ogg'
+ var/break_sound = 'sound/items/welder.ogg'
+ hitsound_type = PROJECTILE_HITSOUND_METAL
+
+ // The wall will ignore damage from weak items, depending on their
+ // force, damage type, tool behavior, and sharpness. This is the minimum
+ // amount of force that a blunt, brute item must have to damage the wall.
+ var/min_dam = 0
+ var/max_integrity = 100
+ var/integrity
+ var/brute_mod = 1
+ var/burn_mod = 1
+ var/repair_amount = 50
+ // Projectiles that do extra damage to the wall
+ var/list/extra_dam_proj
+
+ var/mutable_appearance/damage_overlay
+ var/damage_visual = 'icons/effects/wall_damage.dmi'
+
/turf/closed/Initialize(mapload, inherited_virtual_z)
. = ..()
+ if(integrity == null)
+ integrity = max_integrity
+
+/turf/closed/update_overlays()
+ . = ..()
+ damage_overlay = null
+ var/adj_dam_pct = 1 - (integrity/(max_integrity))
+ if(adj_dam_pct < 0)
+ adj_dam_pct = 0
+ if(!damage_overlay)
+ damage_overlay = mutable_appearance(damage_visual, "cracks", BULLET_HOLE_LAYER)
+ damage_overlay.alpha = adj_dam_pct*255
+ . += damage_overlay
+
+/turf/closed/examine(mob/user)
+ . = ..()
+ . += damage_hints(user)
+
+/turf/closed/proc/damage_hints(mob/user)
+ switch(integrity / max_integrity)
+ if(0.5 to 0.99)
+ return "[p_they(TRUE)] look[p_s()] slightly damaged."
+ if(0.25 to 0.5)
+ return "[p_they(TRUE)] appear[p_s()] heavily damaged."
+ if(0 to 0.25)
+ return "[p_theyre(TRUE)] falling apart!"
+ return
/turf/closed/AfterChange()
. = ..()
@@ -17,269 +67,183 @@
/turf/closed/get_smooth_underlay_icon(mutable_appearance/underlay_appearance, turf/asking_turf, adjacency_dir)
return FALSE
-/turf/closed/indestructible
- name = "wall"
- desc = "Effectively impervious to conventional methods of destruction."
- icon = 'icons/turf/walls.dmi'
- explosion_block = 50
-
-/turf/closed/indestructible/TerraformTurf(path, new_baseturf, flags, defer_change = FALSE, ignore_air = FALSE)
- return
-
-/turf/closed/indestructible/acid_act(acidpwr, acid_volume, acid_id)
- return 0
-
-/turf/closed/indestructible/Melt()
- to_be_destroyed = FALSE
- return src
-
-/turf/closed/indestructible/singularity_act()
- return
-
-/turf/closed/indestructible/sandstone
- name = "sandstone wall"
- desc = "A wall with sandstone plating. Rough."
- icon = 'icons/turf/walls/sandstone_wall.dmi'
- icon_state = "sandstone_wall-0"
- base_icon_state = "sandstone_wall"
- baseturfs = /turf/closed/indestructible/sandstone
- smoothing_flags = SMOOTH_BITMASK
-
-/turf/closed/indestructible/splashscreen
- name = "Space Station 13"
- icon = 'icons/blank_title.png'
- icon_state = ""
- layer = SPLASHSCREEN_LAYER
- plane = SPLASHSCREEN_PLANE
- bullet_bounce_sound = null
-
-/turf/closed/indestructible/splashscreen/New()
- SStitle.splash_turf = src
- if(SStitle.icon)
- icon = SStitle.icon
- ..()
-
-/turf/closed/indestructible/splashscreen/vv_edit_var(var_name, var_value)
+// negative values reduce integrity, positive values increase integrity.
+// Devastate forces a devestate, safe decon prevents it.
+/turf/closed/proc/alter_integrity(damage, devastate = FALSE, safe_decon = FALSE)
+ integrity += damage
+ if(integrity >= max_integrity)
+ integrity = max_integrity
+ if(integrity <= 0)
+ if(safe_decon)
+ dismantle_wall()
+ return FALSE
+ // if damage put us 50 points or more below 0, and not safe decon we got proper demolished
+ if(integrity <= -50)
+ dismantle_wall(TRUE)
+ return FALSE
+ if(devastate)
+ dismantle_wall(TRUE)
+ return FALSE
+ dismantle_wall()
+ return FALSE
+ integrity = min(integrity, max_integrity)
+ update_stats()
+ return integrity
+
+/turf/closed/proc/set_integrity(amount,devastate = FALSE)
+ integrity = amount
+ update_stats()
+ if(integrity <= 0)
+ dismantle_wall(devastate)
+
+/turf/closed/proc/dismantle_wall(devastate = FALSE)
+ for(var/obj/structure/sign/poster/P in src.contents) //Eject contents!
+ P.roll_and_drop(src)
+
+ ScrapeAway()
+
+/turf/closed/proc/update_stats()
+ update_appearance()
+
+/turf/closed/bullet_act(obj/projectile/P)
. = ..()
- if(.)
- switch(var_name)
- if(NAMEOF(src, icon))
- SStitle.icon = icon
-
-
-/turf/closed/indestructible/reinforced
- name = "reinforced wall"
- desc = "A huge chunk of reinforced metal used to separate rooms. Effectively impervious to conventional methods of destruction."
- icon = 'icons/turf/walls/rwalls/reinforced_wall.dmi'
- icon_state = "reinforced_wall-0"
- base_icon_state = "reinforced_wall"
- smoothing_flags = SMOOTH_BITMASK
- smoothing_groups = list(SMOOTH_GROUP_CLOSED_TURFS, SMOOTH_GROUP_WALLS, SMOOTH_GROUP_AIRLOCK)
- canSmoothWith = list(SMOOTH_GROUP_WALLS, SMOOTH_GROUP_WINDOW_FULLTILE, SMOOTH_GROUP_AIRLOCK)
-
-/turf/closed/indestructible/titanium
- name = "wall"
- desc = "A light-weight titanium wall used in shuttles. Effectively impervious to conventional methods of destruction."
- icon = 'icons/turf/walls/shuttle_wall.dmi'
- icon_state = "shuttle_wall-0"
- base_icon_state = "shuttle_wall"
- flags_ricochet = RICOCHET_SHINY | RICOCHET_HARD
- smoothing_flags = SMOOTH_BITMASK | SMOOTH_DIAGONAL_CORNERS
- smoothing_groups = list(SMOOTH_GROUP_CLOSED_TURFS, SMOOTH_GROUP_WALLS, SMOOTH_GROUP_TITANIUM_WALLS)
- canSmoothWith = list(SMOOTH_GROUP_TITANIUM_WALLS, SMOOTH_GROUP_AIRLOCK, SMOOTH_GROUP_SHUTTLE_PARTS, SMOOTH_GROUP_WALLS, SMOOTH_GROUP_WINDOW_FULLTILE)
-
-/turf/closed/indestructible/riveted
- icon = 'icons/turf/walls/riveted.dmi'
- icon_state = "riveted-0"
- base_icon_state = "riveted"
- smoothing_flags = SMOOTH_BITMASK
- smoothing_groups = list(SMOOTH_GROUP_CLOSED_TURFS)
- canSmoothWith = list(SMOOTH_GROUP_CLOSED_TURFS)
-
-/turf/closed/indestructible/syndicate
- icon = 'icons/turf/walls/plastitanium_wall.dmi'
- icon_state = "plastitanium_wall-0"
- base_icon_state = "plastitanium_wall"
- smoothing_flags = SMOOTH_BITMASK
- smoothing_groups = list(SMOOTH_GROUP_CLOSED_TURFS, SMOOTH_GROUP_WALLS, SMOOTH_GROUP_SYNDICATE_WALLS)
- canSmoothWith = list(SMOOTH_GROUP_SYNDICATE_WALLS, SMOOTH_GROUP_PLASTITANIUM_WALLS, SMOOTH_GROUP_AIRLOCK, SMOOTH_GROUP_SHUTTLE_PARTS)
-
-/turf/closed/indestructible/riveted/uranium
- icon = 'icons/turf/walls/uranium_wall.dmi'
- icon_state = "uranium_wall-0"
- base_icon_state = "uranium_wall"
- smoothing_flags = SMOOTH_BITMASK
-
-/turf/closed/indestructible/riveted/plastinum
- name = "plastinum wall"
- desc = "A luxurious wall made out of a plasma-platinum alloy. Effectively impervious to conventional methods of destruction."
- icon = 'icons/turf/walls/plastinum_wall.dmi'
- icon_state = "plastinum_wall-0"
- base_icon_state = "plastinum_wall"
- smoothing_flags = SMOOTH_BITMASK | SMOOTH_DIAGONAL_CORNERS
-
-/turf/closed/indestructible/wood
- icon = 'icons/turf/walls/wood_wall.dmi'
- icon_state = "wood_wall-0"
- base_icon_state = "wood_wall"
- smoothing_flags = SMOOTH_BITMASK
- smoothing_groups = list(SMOOTH_GROUP_CLOSED_TURFS, SMOOTH_GROUP_WALLS, SMOOTH_GROUP_AIRLOCK)
- canSmoothWith = list(SMOOTH_GROUP_WALLS, SMOOTH_GROUP_WINDOW_FULLTILE, SMOOTH_GROUP_AIRLOCK)
-
-
-/turf/closed/indestructible/alien
- name = "alien wall"
- desc = "A wall with alien alloy plating."
- icon = 'icons/turf/walls/abductor_wall.dmi'
- icon_state = "abductor_wall-0"
- base_icon_state = "abductor_wall"
- smoothing_flags = SMOOTH_BITMASK | SMOOTH_DIAGONAL_CORNERS
- smoothing_groups = list(SMOOTH_GROUP_CLOSED_TURFS, SMOOTH_GROUP_WALLS, SMOOTH_GROUP_ABDUCTOR_WALLS)
- canSmoothWith = list(SMOOTH_GROUP_ABDUCTOR_WALLS)
-
-
-/turf/closed/indestructible/cult
- name = "runed metal wall"
- desc = "A cold metal wall engraved with indecipherable symbols. Studying them causes your head to pound. Effectively impervious to conventional methods of destruction."
- icon = 'icons/turf/walls/cult_wall.dmi'
- icon_state = "cult_wall-0"
- base_icon_state = "cult_wall"
- smoothing_flags = SMOOTH_BITMASK
- smoothing_groups = list(SMOOTH_GROUP_CLOSED_TURFS, SMOOTH_GROUP_WALLS)
- canSmoothWith = list(SMOOTH_GROUP_WALLS)
-
-
-/turf/closed/indestructible/abductor
- icon_state = "alien1"
-
-/turf/closed/indestructible/opshuttle
- icon_state = "wall3"
-
-
-/turf/closed/indestructible/fakeglass
- name = "window"
- icon = 'icons/obj/smooth_structures/reinforced_window.dmi'
- icon_state = "fake_window"
- base_icon_state = "reinforced_window"
- opacity = FALSE
- smoothing_flags = SMOOTH_BITMASK
- smoothing_groups = list(SMOOTH_GROUP_WINDOW_FULLTILE)
- canSmoothWith = list(SMOOTH_GROUP_WINDOW_FULLTILE)
-
-/turf/closed/indestructible/fakeglass/Initialize(mapload, inherited_virtual_z)
- . = ..()
- underlays += mutable_appearance('icons/obj/structures.dmi', "grille") //add a grille underlay
- underlays += mutable_appearance('icons/turf/floors.dmi', "plating") //add the plating underlay, below the grille
-
+ var/dam = get_proj_damage(P)
+ if(!dam)
+ return
+ if(P.suppressed != SUPPRESSED_VERY)
+ visible_message("[src] is hit by \a [P]!", null, null, COMBAT_MESSAGE_RANGE)
+ if(!QDELETED(src))
+ alter_integrity(-dam)
+
+// catch-all for using most items on the closed turf -- attempt to smash
+/turf/closed/proc/try_destroy(obj/item/W, mob/user, turf/T)
+ var/dam = get_item_damage(W)
+ user.do_attack_animation(src)
+ if(!dam)
+ to_chat(user, "[W] isn't strong enough to damage [src]!")
+ playsound(src, 'sound/weapons/tap.ogg', 50, TRUE)
+ return TRUE
+ log_combat(user, src, "attacked", W)
+ user.visible_message("[user] hits [src] with [W]!", \
+ "You hit [src] with [W]!", null, COMBAT_MESSAGE_RANGE)
+ switch(W.damtype)
+ if(BRUTE)
+ playsound(src,attack_hitsound, 100, TRUE)
+ if(BURN)
+ playsound(src, 'sound/items/welder.ogg', 100, TRUE)
+ alter_integrity(-dam)
+ return TRUE
-/turf/closed/indestructible/opsglass
- name = "window"
- icon = 'icons/obj/smooth_structures/plastitanium_window.dmi'
- icon_state = "plastitanium_window-0"
- base_icon_state = "plastitanium_window"
- opacity = FALSE
- smoothing_flags = SMOOTH_BITMASK
- smoothing_groups = list(SMOOTH_GROUP_SHUTTLE_PARTS, SMOOTH_GROUP_WINDOW_FULLTILE_PLASTITANIUM)
- canSmoothWith = list(SMOOTH_GROUP_WINDOW_FULLTILE_PLASTITANIUM)
+/turf/closed/proc/get_item_damage(obj/item/I, t_min = min_dam)
+ var/dam = I.force
+ if(istype(I, /obj/item/clothing/gloves/gauntlets))
+ dam = 20
+ else if(I.tool_behaviour == TOOL_MINING)
+ dam *= (4/3)
+ else
+ switch(I.damtype)
+ if(BRUTE)
+ if(I.get_sharpness())
+ dam *= 2/3
+ if(BURN)
+ dam *= burn_mod
+ else
+ return 0
+ // if dam is below t_min, then the hit has no effect
+ return (dam < t_min ? 0 : dam)
+
+/turf/closed/proc/get_proj_damage(obj/projectile/P, t_min = min_dam)
+ var/dam = P.damage
+ if(is_type_in_list(P, extra_dam_proj))
+ dam = max(dam, 30)
+ else
+ switch(P.damage_type)
+ if(BRUTE)
+ dam *= brute_mod
+ if(BURN)
+ dam *= burn_mod
+ else
+ return 0
+ // if dam is below t_min, then the hit has no effect
+ return (dam < t_min ? 0 : dam)
+
+/turf/closed/ex_act(severity, target)
+ if(target == src || !density)
+ return ..()
+ switch(severity)
+ if(EXPLODE_DEVASTATE)
+ // SN src = null
+ var/turf/NT = ScrapeAway()
+ NT.contents_explosion(severity, target)
+ return
+ if(EXPLODE_HEAVY)
+ alter_integrity(rand(-500, -800))
+ if(EXPLODE_LIGHT)
+ alter_integrity(rand(-200, -700))
+
+/turf/closed/attackby(obj/item/W, mob/user, params)
+ user.changeNext_move(CLICK_CD_MELEE)
+ if (!user.IsAdvancedToolUser())
+ to_chat(user, "You don't have the dexterity to do this!")
+ return
+
+ //get the user's location
+ if(!isturf(user.loc))
+ return //can't do this stuff whilst inside objects and such
+
+ add_fingerprint(user)
+
+ var/turf/T = user.loc //get user's location for delay checks
+
+ attack_override(W,user,T)
+ return ..()
+
+/turf/closed/proc/attack_override(obj/item/W, mob/user, turf/loc)
+ //the istype cascade has been spread among various procs for easy overriding or if we want to call something specific
+ if(try_decon(W, user, loc) || try_destroy(W, user, loc))
+ return
+
+/turf/closed/proc/try_decon(obj/item/I, mob/user, turf/T)
+ if(I.tool_behaviour == TOOL_WELDER)
+ if(!I.tool_start_check(user, amount=0))
+ return FALSE
+
+ to_chat(user, "You begin slicing through the outer plating...")
+ while(I.use_tool(src, user, breakdown_duration, volume=50))
+ if(iswallturf(src))
+ to_chat(user, "You slice through some of the outer plating...")
+ alter_integrity(-(I.wall_decon_damage),FALSE,TRUE)
-/turf/closed/indestructible/opsglass/Initialize()
- . = ..()
- icon_state = null
- underlays += mutable_appearance('icons/obj/structures.dmi', "grille")
- underlays += mutable_appearance('icons/turf/floors.dmi', "plating")
-
-/turf/closed/indestructible/fakedoor
- name = "CentCom Access"
- icon = 'icons/obj/doors/airlocks/centcom/centcom.dmi'
- icon_state = "fakedoor"
-
-/turf/closed/indestructible/rock
- name = "dense rock"
- desc = "An extremely densely-packed rock, most mining tools or explosives would never get through this."
- icon = 'icons/turf/walls/rock_wall.dmi'
- icon_state = "rock_wall-0"
- base_icon_state = "rock_wall"
- smoothing_flags = SMOOTH_BITMASK | SMOOTH_BORDER | SMOOTH_CONNECTORS
- smoothing_groups = list(SMOOTH_GROUP_CLOSED_TURFS, SMOOTH_GROUP_MINERAL_WALLS)
- canSmoothWith = list(SMOOTH_GROUP_MINERAL_WALLS)
- no_connector_typecache = list(/turf/closed/mineral, /turf/closed/indestructible/rock)
- connector_icon = 'icons/turf/connectors/smoothrocks_connector.dmi'
- connector_icon_state = "smoothrocks_connector"
- pixel_x = -4
- pixel_y = -4
-
-/turf/closed/indestructible/rock/snow
- name = "mountainside"
- desc = "Extremely densely-packed sheets of ice and rock, forged over the years of the harsh cold."
- icon = 'icons/turf/walls/icerock_wall.dmi'
- icon_state = "icerock_wall-0"
- base_icon_state = "icerock_wall"
- smoothing_flags = SMOOTH_BITMASK | SMOOTH_BORDER
- smoothing_groups = list(SMOOTH_GROUP_CLOSED_TURFS, SMOOTH_GROUP_MINERAL_WALLS)
- canSmoothWith = list(SMOOTH_GROUP_MINERAL_WALLS)
- pixel_x = -4
- pixel_y = -4
- bullet_sizzle = TRUE
- bullet_bounce_sound = null
-
-/turf/closed/indestructible/rock/schist
- name = "schist"
- desc = "Extremely densely-packed layers of schist. Say it ten times fast."
- icon = 'icons/turf/walls/rockwall_icemoon.dmi'
- icon_state = "rockwall_icemoon-0"
- base_icon_state = "rockwall_icemoon"
-
-/turf/closed/indestructible/paper
- name = "thick paper wall"
- desc = "A wall layered with impenetrable sheets of paper."
- icon = 'icons/turf/walls.dmi'
- icon_state = "paperwall"
-
-/turf/closed/indestructible/necropolis
- name = "necropolis wall"
- desc = "A seemingly impenetrable wall."
- icon = 'icons/turf/walls.dmi'
- icon_state = "necro"
- explosion_block = 50
- baseturfs = /turf/closed/indestructible/necropolis
-
-/turf/closed/indestructible/necropolis/get_smooth_underlay_icon(mutable_appearance/underlay_appearance, turf/asking_turf, adjacency_dir)
- underlay_appearance.icon = 'icons/turf/floors.dmi'
- underlay_appearance.icon_state = "necro1"
- return TRUE
+ return FALSE
-/turf/closed/indestructible/riveted/boss
- name = "thick stone wall"
- desc = "A thick, seemingly indestructible stone wall."
- icon = 'icons/turf/walls/boss_wall.dmi'
- icon_state = "boss_wall-0"
- base_icon_state = "boss_wall"
- smoothing_flags = SMOOTH_BITMASK
- smoothing_groups = list(SMOOTH_GROUP_CLOSED_TURFS, SMOOTH_GROUP_BOSS_WALLS)
- canSmoothWith = list(SMOOTH_GROUP_BOSS_WALLS)
- explosion_block = 50
- baseturfs = /turf/closed/indestructible/riveted/boss
-
-/turf/closed/indestructible/riveted/boss/see_through
- opacity = FALSE
-
-/turf/closed/indestructible/riveted/boss/get_smooth_underlay_icon(mutable_appearance/underlay_appearance, turf/asking_turf, adjacency_dir)
- underlay_appearance.icon = 'icons/turf/floors.dmi'
- underlay_appearance.icon_state = "basalt"
+/turf/closed/mech_melee_attack(obj/mecha/M)
+ M.do_attack_animation(src)
+ switch(M.damtype)
+ if(BRUTE)
+ playsound(src, 'sound/weapons/punch4.ogg', 50, TRUE)
+ if(BURN)
+ playsound(src, 'sound/items/welder.ogg', 100, TRUE)
+ if(TOX)
+ playsound(src, 'sound/effects/spray2.ogg', 100, TRUE)
+
+
+ if(prob(hardness + M.force) && M.force > 20)
+ M.visible_message("[M.name] hits [src] with great force!", \
+ "You hit [src] with incredible force!", null, COMBAT_MESSAGE_RANGE)
+ dismantle_wall(TRUE)
+ playsound(src, 'sound/effects/meteorimpact.ogg', 100, TRUE)
+ else
+ M.visible_message("[M.name] hits [src]!", \
+ "You hit [src]!", null, COMBAT_MESSAGE_RANGE)
+ alter_integrity(M.force * 20)
+
+/turf/closed/attack_hulk(mob/living/carbon/user)
+ ..()
+ var/obj/item/bodypart/arm = user.hand_bodyparts[user.active_hand_index]
+ if(!arm || arm.bodypart_disabled)
+ return
+ alter_integrity(-250)
+ user.visible_message("[user] smashes \the [src]!", \
+ "You smash \the [src]!", \
+ "You hear a booming smash!")
return TRUE
-
-/turf/closed/indestructible/riveted/hierophant
- name = "wall"
- desc = "A wall made out of a strange metal. The squares on it pulse in a predictable pattern."
- icon = 'icons/turf/walls/hierophant_wall.dmi'
- icon_state = "wall"
- smoothing_flags = SMOOTH_CORNERS
- smoothing_groups = list(SMOOTH_GROUP_HIERO_WALL)
- canSmoothWith = list(SMOOTH_GROUP_HIERO_WALL)
-
-/turf/closed/indestructible/blank
- name = "space"
- desc = "It's the end of the world every day, for someone."
- icon = 'icons/turf/space.dmi'
- icon_state = "black"
- explosion_block = 1000 // fuck it, let's go higher
diff --git a/code/game/turfs/closed/indestructible.dm b/code/game/turfs/closed/indestructible.dm
new file mode 100644
index 000000000000..d62958a0ef69
--- /dev/null
+++ b/code/game/turfs/closed/indestructible.dm
@@ -0,0 +1,266 @@
+/turf/closed/indestructible
+ name = "wall"
+ desc = "Effectively impervious to conventional methods of destruction."
+ icon = 'icons/turf/walls.dmi'
+ explosion_block = 50
+
+/turf/closed/indestructible/TerraformTurf(path, new_baseturf, flags, defer_change = FALSE, ignore_air = FALSE)
+ return
+
+/turf/closed/indestructible/acid_act(acidpwr, acid_volume, acid_id)
+ return 0
+
+/turf/closed/indestructible/Melt()
+ to_be_destroyed = FALSE
+ return src
+
+/turf/closed/indestructible/singularity_act()
+ return
+
+/turf/closed/indestructible/sandstone
+ name = "sandstone wall"
+ desc = "A wall with sandstone plating. Rough."
+ icon = 'icons/turf/walls/sandstone_wall.dmi'
+ icon_state = "sandstone_wall-0"
+ base_icon_state = "sandstone_wall"
+ baseturfs = /turf/closed/indestructible/sandstone
+ smoothing_flags = SMOOTH_BITMASK
+
+/turf/closed/indestructible/splashscreen
+ name = "Space Station 13"
+ icon = 'icons/blank_title.png'
+ icon_state = ""
+ layer = SPLASHSCREEN_LAYER
+ plane = SPLASHSCREEN_PLANE
+ bullet_bounce_sound = null
+
+/turf/closed/indestructible/splashscreen/New()
+ SStitle.splash_turf = src
+ if(SStitle.icon)
+ icon = SStitle.icon
+ ..()
+
+/turf/closed/indestructible/splashscreen/vv_edit_var(var_name, var_value)
+ . = ..()
+ if(.)
+ switch(var_name)
+ if(NAMEOF(src, icon))
+ SStitle.icon = icon
+
+
+/turf/closed/indestructible/reinforced
+ name = "reinforced wall"
+ desc = "A huge chunk of reinforced metal used to separate rooms. Effectively impervious to conventional methods of destruction."
+ icon = 'icons/turf/walls/rwalls/reinforced_wall.dmi'
+ icon_state = "reinforced_wall-0"
+ base_icon_state = "reinforced_wall"
+ smoothing_flags = SMOOTH_BITMASK
+ smoothing_groups = list(SMOOTH_GROUP_CLOSED_TURFS, SMOOTH_GROUP_WALLS, SMOOTH_GROUP_AIRLOCK)
+ canSmoothWith = list(SMOOTH_GROUP_WALLS, SMOOTH_GROUP_WINDOW_FULLTILE, SMOOTH_GROUP_AIRLOCK)
+
+/turf/closed/indestructible/titanium
+ name = "wall"
+ desc = "A light-weight titanium wall used in shuttles. Effectively impervious to conventional methods of destruction."
+ icon = 'icons/turf/walls/shuttle_wall.dmi'
+ icon_state = "shuttle_wall-0"
+ base_icon_state = "shuttle_wall"
+ flags_ricochet = RICOCHET_SHINY | RICOCHET_HARD
+ smoothing_flags = SMOOTH_BITMASK | SMOOTH_DIAGONAL_CORNERS
+ smoothing_groups = list(SMOOTH_GROUP_CLOSED_TURFS, SMOOTH_GROUP_WALLS, SMOOTH_GROUP_TITANIUM_WALLS)
+ canSmoothWith = list(SMOOTH_GROUP_TITANIUM_WALLS, SMOOTH_GROUP_AIRLOCK, SMOOTH_GROUP_SHUTTLE_PARTS, SMOOTH_GROUP_WALLS, SMOOTH_GROUP_WINDOW_FULLTILE)
+
+/turf/closed/indestructible/riveted
+ icon = 'icons/turf/walls/riveted.dmi'
+ icon_state = "riveted-0"
+ base_icon_state = "riveted"
+ smoothing_flags = SMOOTH_BITMASK
+ smoothing_groups = list(SMOOTH_GROUP_CLOSED_TURFS)
+ canSmoothWith = list(SMOOTH_GROUP_CLOSED_TURFS)
+
+/turf/closed/indestructible/syndicate
+ icon = 'icons/turf/walls/plastitanium_wall.dmi'
+ icon_state = "plastitanium_wall-0"
+ base_icon_state = "plastitanium_wall"
+ smoothing_flags = SMOOTH_BITMASK
+ smoothing_groups = list(SMOOTH_GROUP_CLOSED_TURFS, SMOOTH_GROUP_WALLS, SMOOTH_GROUP_SYNDICATE_WALLS)
+ canSmoothWith = list(SMOOTH_GROUP_SYNDICATE_WALLS, SMOOTH_GROUP_PLASTITANIUM_WALLS, SMOOTH_GROUP_AIRLOCK, SMOOTH_GROUP_SHUTTLE_PARTS)
+
+/turf/closed/indestructible/riveted/uranium
+ icon = 'icons/turf/walls/uranium_wall.dmi'
+ icon_state = "uranium_wall-0"
+ base_icon_state = "uranium_wall"
+ smoothing_flags = SMOOTH_BITMASK
+
+/turf/closed/indestructible/riveted/plastinum
+ name = "plastinum wall"
+ desc = "A luxurious wall made out of a plasma-platinum alloy. Effectively impervious to conventional methods of destruction."
+ icon = 'icons/turf/walls/plastinum_wall.dmi'
+ icon_state = "plastinum_wall-0"
+ base_icon_state = "plastinum_wall"
+ smoothing_flags = SMOOTH_BITMASK | SMOOTH_DIAGONAL_CORNERS
+
+/turf/closed/indestructible/wood
+ icon = 'icons/turf/walls/wood_wall.dmi'
+ icon_state = "wood_wall-0"
+ base_icon_state = "wood_wall"
+ smoothing_flags = SMOOTH_BITMASK
+ smoothing_groups = list(SMOOTH_GROUP_CLOSED_TURFS, SMOOTH_GROUP_WALLS, SMOOTH_GROUP_AIRLOCK)
+ canSmoothWith = list(SMOOTH_GROUP_WALLS, SMOOTH_GROUP_WINDOW_FULLTILE, SMOOTH_GROUP_AIRLOCK)
+
+
+/turf/closed/indestructible/alien
+ name = "alien wall"
+ desc = "A wall with alien alloy plating."
+ icon = 'icons/turf/walls/abductor_wall.dmi'
+ icon_state = "abductor_wall-0"
+ base_icon_state = "abductor_wall"
+ smoothing_flags = SMOOTH_BITMASK | SMOOTH_DIAGONAL_CORNERS
+ smoothing_groups = list(SMOOTH_GROUP_CLOSED_TURFS, SMOOTH_GROUP_WALLS, SMOOTH_GROUP_ABDUCTOR_WALLS)
+ canSmoothWith = list(SMOOTH_GROUP_ABDUCTOR_WALLS)
+
+
+/turf/closed/indestructible/cult
+ name = "runed metal wall"
+ desc = "A cold metal wall engraved with indecipherable symbols. Studying them causes your head to pound. Effectively impervious to conventional methods of destruction."
+ icon = 'icons/turf/walls/cult_wall.dmi'
+ icon_state = "cult_wall-0"
+ base_icon_state = "cult_wall"
+ smoothing_flags = SMOOTH_BITMASK
+ smoothing_groups = list(SMOOTH_GROUP_CLOSED_TURFS, SMOOTH_GROUP_WALLS)
+ canSmoothWith = list(SMOOTH_GROUP_WALLS)
+
+
+/turf/closed/indestructible/abductor
+ icon_state = "alien1"
+
+/turf/closed/indestructible/opshuttle
+ icon_state = "wall3"
+
+
+/turf/closed/indestructible/fakeglass
+ name = "window"
+ icon = 'icons/obj/smooth_structures/reinforced_window.dmi'
+ icon_state = "fake_window"
+ base_icon_state = "reinforced_window"
+ opacity = FALSE
+ smoothing_flags = SMOOTH_BITMASK
+ smoothing_groups = list(SMOOTH_GROUP_WINDOW_FULLTILE)
+ canSmoothWith = list(SMOOTH_GROUP_WINDOW_FULLTILE)
+
+/turf/closed/indestructible/fakeglass/Initialize(mapload, inherited_virtual_z)
+ . = ..()
+ underlays += mutable_appearance('icons/obj/structures.dmi', "grille") //add a grille underlay
+ underlays += mutable_appearance('icons/turf/floors.dmi', "plating") //add the plating underlay, below the grille
+
+
+/turf/closed/indestructible/opsglass
+ name = "window"
+ icon = 'icons/obj/smooth_structures/plastitanium_window.dmi'
+ icon_state = "plastitanium_window-0"
+ base_icon_state = "plastitanium_window"
+ opacity = FALSE
+ smoothing_flags = SMOOTH_BITMASK
+ smoothing_groups = list(SMOOTH_GROUP_SHUTTLE_PARTS, SMOOTH_GROUP_WINDOW_FULLTILE_PLASTITANIUM)
+ canSmoothWith = list(SMOOTH_GROUP_WINDOW_FULLTILE_PLASTITANIUM)
+
+/turf/closed/indestructible/opsglass/Initialize()
+ . = ..()
+ icon_state = null
+ underlays += mutable_appearance('icons/obj/structures.dmi', "grille")
+ underlays += mutable_appearance('icons/turf/floors.dmi', "plating")
+
+/turf/closed/indestructible/fakedoor
+ name = "CentCom Access"
+ icon = 'icons/obj/doors/airlocks/centcom/centcom.dmi'
+ icon_state = "fakedoor"
+
+/turf/closed/indestructible/rock
+ name = "dense rock"
+ desc = "An extremely densely-packed rock, most mining tools or explosives would never get through this."
+ icon = 'icons/turf/walls/rock_wall.dmi'
+ icon_state = "rock_wall-0"
+ base_icon_state = "rock_wall"
+ smoothing_flags = SMOOTH_BITMASK | SMOOTH_BORDER | SMOOTH_CONNECTORS
+ smoothing_groups = list(SMOOTH_GROUP_CLOSED_TURFS, SMOOTH_GROUP_MINERAL_WALLS)
+ canSmoothWith = list(SMOOTH_GROUP_MINERAL_WALLS)
+ no_connector_typecache = list(/turf/closed/mineral, /turf/closed/indestructible/rock)
+ connector_icon = 'icons/turf/connectors/smoothrocks_connector.dmi'
+ connector_icon_state = "smoothrocks_connector"
+ pixel_x = -4
+ pixel_y = -4
+
+/turf/closed/indestructible/rock/snow
+ name = "mountainside"
+ desc = "Extremely densely-packed sheets of ice and rock, forged over the years of the harsh cold."
+ icon = 'icons/turf/walls/icerock_wall.dmi'
+ icon_state = "icerock_wall-0"
+ base_icon_state = "icerock_wall"
+ smoothing_flags = SMOOTH_BITMASK | SMOOTH_BORDER
+ smoothing_groups = list(SMOOTH_GROUP_CLOSED_TURFS, SMOOTH_GROUP_MINERAL_WALLS)
+ canSmoothWith = list(SMOOTH_GROUP_MINERAL_WALLS)
+ pixel_x = -4
+ pixel_y = -4
+ bullet_sizzle = TRUE
+ bullet_bounce_sound = null
+
+/turf/closed/indestructible/rock/schist
+ name = "schist"
+ desc = "Extremely densely-packed layers of schist. Say it ten times fast."
+ icon = 'icons/turf/walls/rockwall_icemoon.dmi'
+ icon_state = "rockwall_icemoon-0"
+ base_icon_state = "rockwall_icemoon"
+
+/turf/closed/indestructible/paper
+ name = "thick paper wall"
+ desc = "A wall layered with impenetrable sheets of paper."
+ icon = 'icons/turf/walls.dmi'
+ icon_state = "paperwall"
+
+/turf/closed/indestructible/necropolis
+ name = "necropolis wall"
+ desc = "A seemingly impenetrable wall."
+ icon = 'icons/turf/walls.dmi'
+ icon_state = "necro"
+ explosion_block = 50
+ baseturfs = /turf/closed/indestructible/necropolis
+
+/turf/closed/indestructible/necropolis/get_smooth_underlay_icon(mutable_appearance/underlay_appearance, turf/asking_turf, adjacency_dir)
+ underlay_appearance.icon = 'icons/turf/floors.dmi'
+ underlay_appearance.icon_state = "necro1"
+ return TRUE
+
+/turf/closed/indestructible/riveted/boss
+ name = "thick stone wall"
+ desc = "A thick, seemingly indestructible stone wall."
+ icon = 'icons/turf/walls/boss_wall.dmi'
+ icon_state = "boss_wall-0"
+ base_icon_state = "boss_wall"
+ smoothing_flags = SMOOTH_BITMASK
+ smoothing_groups = list(SMOOTH_GROUP_CLOSED_TURFS, SMOOTH_GROUP_BOSS_WALLS)
+ canSmoothWith = list(SMOOTH_GROUP_BOSS_WALLS)
+ explosion_block = 50
+ baseturfs = /turf/closed/indestructible/riveted/boss
+
+/turf/closed/indestructible/riveted/boss/see_through
+ opacity = FALSE
+
+/turf/closed/indestructible/riveted/boss/get_smooth_underlay_icon(mutable_appearance/underlay_appearance, turf/asking_turf, adjacency_dir)
+ underlay_appearance.icon = 'icons/turf/floors.dmi'
+ underlay_appearance.icon_state = "basalt"
+ return TRUE
+
+/turf/closed/indestructible/riveted/hierophant
+ name = "wall"
+ desc = "A wall made out of a strange metal. The squares on it pulse in a predictable pattern."
+ icon = 'icons/turf/walls/hierophant_wall.dmi'
+ icon_state = "wall"
+ smoothing_flags = SMOOTH_CORNERS
+ smoothing_groups = list(SMOOTH_GROUP_HIERO_WALL)
+ canSmoothWith = list(SMOOTH_GROUP_HIERO_WALL)
+
+/turf/closed/indestructible/blank
+ name = "space"
+ desc = "It's the end of the world every day, for someone."
+ icon = 'icons/turf/space.dmi'
+ icon_state = "black"
+ explosion_block = 1000 // fuck it, let's go higher
diff --git a/code/game/turfs/closed/wall/mineral_walls.dm b/code/game/turfs/closed/wall/mineral_walls.dm
index 367e488ba868..04d4bc7895d6 100644
--- a/code/game/turfs/closed/wall/mineral_walls.dm
+++ b/code/game/turfs/closed/wall/mineral_walls.dm
@@ -57,7 +57,7 @@
icon_state = "diamond_wall-0"
base_icon_state = "diamond_wall"
sheet_type = /obj/item/stack/sheet/mineral/diamond
- slicing_duration = 50
+ breakdown_duration = 50
explosion_block = 3
smoothing_flags = SMOOTH_BITMASK | SMOOTH_CONNECTORS
smoothing_groups = list(SMOOTH_GROUP_CLOSED_TURFS, SMOOTH_GROUP_WALLS, SMOOTH_GROUP_DIAMOND_WALLS)
@@ -293,7 +293,7 @@
no_connector_typecache = list(/turf/closed/wall/mineral/snow)
hardness = 80
explosion_block = 0
- slicing_duration = 30
+ breakdown_duration = 30
sheet_type = /obj/item/stack/sheet/mineral/snow
canSmoothWith = null
girder_type = null
@@ -318,7 +318,7 @@
icon_state = "abductor_wall-0"
base_icon_state = "abductor_wall"
sheet_type = /obj/item/stack/sheet/mineral/abductor
- slicing_duration = 100 //alien wall takes twice as much time to slice
+ breakdown_duration = 100 //alien wall takes twice as much time to slice
explosion_block = 3
smoothing_flags = SMOOTH_BITMASK | SMOOTH_DIAGONAL_CORNERS
smoothing_groups = list(SMOOTH_GROUP_CLOSED_TURFS, SMOOTH_GROUP_WALLS, SMOOTH_GROUP_ABDUCTOR_WALLS)
diff --git a/code/game/turfs/closed/wall/misc_walls.dm b/code/game/turfs/closed/wall/misc_walls.dm
index da4599fc3c1b..b674e25fc8f8 100644
--- a/code/game/turfs/closed/wall/misc_walls.dm
+++ b/code/game/turfs/closed/wall/misc_walls.dm
@@ -49,7 +49,7 @@
smoothing_flags = SMOOTH_BITMASK
canSmoothWith = null
hardness = 35
- slicing_duration = 40
+ breakdown_duration = 40
bullet_sizzle = TRUE
burn_mod = 2
diff --git a/code/game/turfs/closed/walls.dm b/code/game/turfs/closed/walls.dm
index 9f0aa58c2180..f69ea753feb3 100644
--- a/code/game/turfs/closed/walls.dm
+++ b/code/game/turfs/closed/walls.dm
@@ -1,5 +1,5 @@
#define MAX_DENT_DECALS 15
-
+// KILL MINING CODE
/turf/closed/wall
name = "wall"
desc = "A huge chunk of metal used to separate rooms."
@@ -19,32 +19,28 @@
smoothing_groups = list(SMOOTH_GROUP_CLOSED_TURFS, SMOOTH_GROUP_WALLS, SMOOTH_GROUP_AIRLOCK)
canSmoothWith = list(SMOOTH_GROUP_WALLS, SMOOTH_GROUP_WINDOW_FULLTILE, SMOOTH_GROUP_AIRLOCK)
- ///lower numbers are harder. Used to determine the probability of a hulk smashing through.
- var/hardness = 40
- var/slicing_duration = 25 //default time taken to slice the wall
+ breakdown_duration = 25
var/sheet_type = /obj/item/stack/sheet/metal
var/sheet_amount = 2
var/obj/girder_type = /obj/structure/girder
/// sound when something hits the wall and deals damage
- var/attack_hitsound = 'sound/weapons/smash.ogg'
- var/break_sound = 'sound/items/welder.ogg'
- hitsound_type = PROJECTILE_HITSOUND_METAL
+
var/list/dent_decals
- // The wall will ignore damage from weak items, depending on their
- // force, damage type, tool behavior, and sharpness. This is the minimum
- // amount of force that a blunt, brute item must have to damage the wall.
- var/min_dam = 8
- var/max_integrity = 400
- var/integrity
- var/brute_mod = 1
- var/burn_mod = 1
- var/repair_amount = 50
- // Projectiles that do extra damage to the wall
- var/list/extra_dam_proj
+ // // The wall will ignore damage from weak items, depending on their
+ // // force, damage type, tool behavior, and sharpness. This is the minimum
+ // // amount of force that a blunt, brute item must have to damage the wall.
+ // var/min_dam = 8
+ // var/max_integrity = 400
+ // var/integrity
+ // var/brute_mod = 1
+ // var/burn_mod = 1
+ // var/repair_amount = 50
+ // // Projectiles that do extra damage to the wall
+ // var/list/extra_dam_proj
+
- var/mutable_appearance/crack_overlay
/turf/closed/wall/yesdiag
icon_state = "wall-255"
@@ -63,10 +59,8 @@
underlay_appearance.icon_state = fixed_underlay["icon_state"]
fixed_underlay = string_assoc_list(fixed_underlay)
underlays += underlay_appearance
- if(integrity == null)
- integrity = max_integrity
-
+// to be changed - move up
/turf/closed/wall/copyTurf(turf/T, copy_air, flags)
. = ..()
var/turf/closed/wall/wall_copy = T
@@ -78,29 +72,11 @@
. = ..()
for(var/decal in dent_decals)
. += decal
- var/adj_dam_pct = 1 - (integrity/(max_integrity))
- if(adj_dam_pct < 0)
- adj_dam_pct = 0
- crack_overlay = null
- if(!crack_overlay)
- crack_overlay = mutable_appearance('icons/effects/wall_damage.dmi', "cracks", BULLET_HOLE_LAYER)
- crack_overlay.alpha = adj_dam_pct*255
- . += crack_overlay
+
/turf/closed/wall/examine(mob/user)
. += ..()
. += deconstruction_hints(user)
- . += damage_hints(user)
-
-/turf/closed/wall/proc/damage_hints(mob/user)
- switch(integrity / max_integrity)
- if(0.5 to 0.99)
- return "[p_they(TRUE)] look[p_s()] slightly damaged."
- if(0.25 to 0.5)
- return "[p_they(TRUE)] appear[p_s()] heavily damaged."
- if(0 to 0.25)
- return "[p_theyre(TRUE)] falling apart!"
- return
/turf/closed/wall/proc/deconstruction_hints(mob/user)
return "The outer plating is welded firmly in place."
@@ -108,100 +84,7 @@
/turf/closed/wall/attack_tk()
return
-// negative values reduce integrity, positive values increase integrity
-/turf/closed/wall/proc/alter_integrity(damage, devastate = FALSE, safe_decon = FALSE)
- integrity += damage
- if(integrity >= max_integrity)
- integrity = max_integrity
- if(integrity <= 0)
- if(safe_decon)
- dismantle_wall()
- return FALSE
- // if damage put us 50 points or more below 0, and not safe decon we got proper demolished
- if(integrity <= -50)
- dismantle_wall(TRUE)
- return FALSE
- if(devastate)
- dismantle_wall(TRUE)
- return FALSE
- dismantle_wall()
- return FALSE
- integrity = min(integrity, max_integrity)
- update_stats()
- return integrity
-
-/turf/closed/wall/proc/set_integrity(amount,devastate = FALSE)
- integrity = amount
- update_stats()
- if(integrity <= 0)
- dismantle_wall(devastate)
-
-/turf/closed/wall/proc/update_stats()
- update_appearance()
-
-/turf/closed/wall/bullet_act(obj/projectile/P)
- . = ..()
- var/dam = get_proj_damage(P)
- if(!dam)
- return
- if(P.suppressed != SUPPRESSED_VERY)
- visible_message("[src] is hit by \a [P]!", null, null, COMBAT_MESSAGE_RANGE)
- if(!QDELETED(src))
- alter_integrity(-dam)
-
-// catch-all for using most items on the wall -- attempt to smash
-/turf/closed/wall/proc/try_destroy(obj/item/W, mob/user, turf/T)
- var/dam = get_item_damage(W)
- user.do_attack_animation(src)
- if(!dam)
- to_chat(user, "[W] isn't strong enough to damage [src]!")
- playsound(src, 'sound/weapons/tap.ogg', 50, TRUE)
- return TRUE
- log_combat(user, src, "attacked", W)
- user.visible_message("[user] hits [src] with [W]!", \
- "You hit [src] with [W]!", null, COMBAT_MESSAGE_RANGE)
- switch(W.damtype)
- if(BRUTE)
- playsound(src,attack_hitsound, 100, TRUE)
- if(BURN)
- playsound(src, 'sound/items/welder.ogg', 100, TRUE)
- alter_integrity(-dam)
- return TRUE
-
-/turf/closed/wall/proc/get_item_damage(obj/item/I, t_min = min_dam)
- var/dam = I.force
- if(istype(I, /obj/item/clothing/gloves/gauntlets))
- dam = 20
- else if(I.tool_behaviour == TOOL_MINING)
- dam *= (4/3)
- else
- switch(I.damtype)
- if(BRUTE)
- if(I.get_sharpness())
- dam *= 2/3
- if(BURN)
- dam *= burn_mod
- else
- return 0
- // if dam is below t_min, then the hit has no effect
- return (dam < t_min ? 0 : dam)
-
-/turf/closed/wall/proc/get_proj_damage(obj/projectile/P, t_min = min_dam)
- var/dam = P.damage
- if(is_type_in_list(P, extra_dam_proj))
- dam = max(dam, 30)
- else
- switch(P.damage_type)
- if(BRUTE)
- dam *= brute_mod
- if(BURN)
- dam *= burn_mod
- else
- return 0
- // if dam is below t_min, then the hit has no effect
- return (dam < t_min ? 0 : dam)
-
-/turf/closed/wall/proc/dismantle_wall(devastated = FALSE)
+/turf/closed/wall/dismantle_wall(devastated = FALSE)
create_sheets()
var/obj/newgirder = create_girder()
if(devastated)
@@ -213,10 +96,7 @@
transfer_fingerprints_to(newgirder)
playsound(src, break_sound, 100, TRUE)
- for(var/obj/structure/sign/poster/P in src.contents) //Eject contents!
- P.roll_and_drop(src)
-
- ScrapeAway()
+ ..()
/turf/closed/wall/proc/create_sheets()
if(sheet_type)
@@ -228,46 +108,11 @@
return new girder_type(src)
return null
-/turf/closed/wall/ex_act(severity, target)
- if(target == src || !density)
- return ..()
- switch(severity)
- if(EXPLODE_DEVASTATE)
- // SN src = null
- var/turf/NT = ScrapeAway()
- NT.contents_explosion(severity, target)
- return
- if(EXPLODE_HEAVY)
- alter_integrity(rand(-500, -800))
- if(EXPLODE_LIGHT)
- alter_integrity(rand(-200, -700))
-
-/turf/closed/wall/mech_melee_attack(obj/mecha/M)
- M.do_attack_animation(src)
- switch(M.damtype)
- if(BRUTE)
- playsound(src, 'sound/weapons/punch4.ogg', 50, TRUE)
- if(BURN)
- playsound(src, 'sound/items/welder.ogg', 100, TRUE)
- if(TOX)
- playsound(src, 'sound/effects/spray2.ogg', 100, TRUE)
-
-
- if(prob(hardness + M.force) && M.force > 20)
- M.visible_message("[M.name] hits [src] with great force!", \
- "You hit [src] with incredible force!", null, COMBAT_MESSAGE_RANGE)
- dismantle_wall(devastated = TRUE)
- playsound(src, 'sound/effects/meteorimpact.ogg', 100, TRUE)
- else
- M.visible_message("[M.name] hits [src]!", \
- "You hit [src]!", null, COMBAT_MESSAGE_RANGE)
- add_dent(WALL_DENT_HIT)
- alter_integrity(M.force * 20)
-
/turf/closed/wall/attack_paw(mob/living/user)
user.changeNext_move(CLICK_CD_MELEE)
return attack_hand(user)
+// to do - bit flags
/turf/closed/wall/attack_animal(mob/living/simple_animal/M)
M.changeNext_move(CLICK_CD_MELEE)
M.do_attack_animation(src)
@@ -276,18 +121,6 @@
alter_integrity(-400)
return
-/turf/closed/wall/attack_hulk(mob/living/carbon/user)
- ..()
- var/obj/item/bodypart/arm = user.hand_bodyparts[user.active_hand_index]
- if(!arm || arm.bodypart_disabled)
- return
- alter_integrity(-250)
- add_dent(WALL_DENT_HIT)
- user.visible_message("[user] smashes \the [src]!", \
- "You smash \the [src]!", \
- "You hear a booming smash!")
- return TRUE
-
/turf/closed/wall/attack_hand(mob/user)
. = ..()
if(.)
@@ -297,25 +130,10 @@
playsound(src, 'sound/weapons/genhit.ogg', 25, TRUE)
add_fingerprint(user)
-/turf/closed/wall/attackby(obj/item/W, mob/user, params)
- user.changeNext_move(CLICK_CD_MELEE)
- if (!user.IsAdvancedToolUser())
- to_chat(user, "You don't have the dexterity to do this!")
- return
-
- //get the user's location
- if(!isturf(user.loc))
- return //can't do this stuff whilst inside objects and such
-
- add_fingerprint(user)
-
- var/turf/T = user.loc //get user's location for delay checks
-
- //the istype cascade has been spread among various procs for easy overriding
- if(try_clean(W, user, T) || try_wallmount(W, user, T) || try_decon(W, user, T) || try_destroy(W, user, T))
+/turf/closed/wall/attack_override(obj/item/W, mob/user, turf/loc)
+ if(try_clean(W, user, loc) || try_wallmount(W, user, loc) || try_decon(W, user, loc) || try_destroy(W, user, loc))
return
- return ..()
/turf/closed/wall/proc/try_clean(obj/item/W, mob/user, turf/T)
if((user.a_intent != INTENT_HELP))
@@ -326,7 +144,7 @@
return FALSE
to_chat(user, "You begin fixing dents on the wall...")
- if(W.use_tool(src, user, slicing_duration, volume=100))
+ if(W.use_tool(src, user, breakdown_duration, volume=100))
if(iswallturf(src) && LAZYLEN(dent_decals))
to_chat(user, "You fix some dents on the wall.")
dent_decals = null
@@ -350,13 +168,13 @@
return FALSE
-/turf/closed/wall/proc/try_decon(obj/item/I, mob/user, turf/T)
+/turf/closed/wall/try_decon(obj/item/I, mob/user, turf/T)
if(I.tool_behaviour == TOOL_WELDER)
if(!I.tool_start_check(user, amount=0))
return FALSE
to_chat(user, "You begin slicing through the outer plating...")
- while(I.use_tool(src, user, slicing_duration, volume=50))
+ while(I.use_tool(src, user, breakdown_duration, volume=50))
if(iswallturf(src))
to_chat(user, "You slice through some of the outer plating...")
alter_integrity(-(I.wall_decon_damage),FALSE,TRUE)
diff --git a/shiptest.dme b/shiptest.dme
index 170e7b91ea81..9e9c0a0935af 100644
--- a/shiptest.dme
+++ b/shiptest.dme
@@ -1497,6 +1497,7 @@
#include "code\game\turfs\change_turf.dm"
#include "code\game\turfs\turf.dm"
#include "code\game\turfs\closed\_closed.dm"
+#include "code\game\turfs\closed\indestructible.dm"
#include "code\game\turfs\closed\minerals.dm"
#include "code\game\turfs\closed\walls.dm"
#include "code\game\turfs\closed\wall\conc_walls.dm"
From 08015f6023a55a7597ca93bb83e2ed022bc88a0d Mon Sep 17 00:00:00 2001
From: Gristlebee <56049844+Gristlebee@users.noreply.github.com>
Date: Sun, 1 Sep 2024 16:06:04 -0700
Subject: [PATCH 2/3] mining stuff
---
code/__DEFINES/projectiles.dm | 6 ++
code/__DEFINES/turfs.dm | 2 +
code/game/turfs/closed/_closed.dm | 95 ++++++++++++-------
code/game/turfs/closed/indestructible.dm | 42 ++++++++
code/game/turfs/closed/minerals.dm | 54 +++++++----
code/game/turfs/closed/wall/reinf_walls.dm | 3 +
code/game/turfs/closed/walls.dm | 47 ++-------
.../mining/equipment/kinetic_crusher.dm | 3 +-
code/modules/mining/equipment/mining_tools.dm | 2 +
.../mining/lavaland/necropolis_chests.dm | 5 +-
.../guns/energy/kinetic_accelerator.dm | 4 +-
code/modules/projectiles/projectile.dm | 4 +
code/modules/projectiles/projectile/beams.dm | 2 +
.../projectiles/projectile/special/plasma.dm | 8 --
14 files changed, 172 insertions(+), 105 deletions(-)
diff --git a/code/__DEFINES/projectiles.dm b/code/__DEFINES/projectiles.dm
index 61038b17c1ec..db31a4b5552d 100644
--- a/code/__DEFINES/projectiles.dm
+++ b/code/__DEFINES/projectiles.dm
@@ -7,3 +7,9 @@
#define PROJECTILE_PIERCE_PHASE 2
// Delete self without hitting
#define PROJECTILE_DELETE_WITHOUT_HITTING 3
+
+#define PROJECTILE_BONUS_DAMAGE_NONE 0
+#define PROJECTILE_BONUS_DAMAGE_MINERALS (1<<0) //minable walls
+#define PROJECTILE_BONUS_DAMAGE_WALLS (1<<1) // walls
+#define PROJECTILE_BONUS_DAMAGE_RWALLS (1<<2) //reinforced walls
+
diff --git a/code/__DEFINES/turfs.dm b/code/__DEFINES/turfs.dm
index 571bade19ef2..ed816cdaa8d5 100644
--- a/code/__DEFINES/turfs.dm
+++ b/code/__DEFINES/turfs.dm
@@ -12,3 +12,5 @@
#define CHANGETURF_DEFER_BATCH (1 << 5)
#define IS_OPAQUE_TURF(turf) (turf.directional_opacity == ALL_CARDINALS)
+
+#define MINERAL_WALL_INTEGRITY 100
diff --git a/code/game/turfs/closed/_closed.dm b/code/game/turfs/closed/_closed.dm
index ec8ce09b7c33..af6056bf3220 100644
--- a/code/game/turfs/closed/_closed.dm
+++ b/code/game/turfs/closed/_closed.dm
@@ -23,12 +23,15 @@
var/integrity
var/brute_mod = 1
var/burn_mod = 1
- var/repair_amount = 50
// Projectiles that do extra damage to the wall
var/list/extra_dam_proj
+ var/mob_smash_flags
+ var/proj_bonus_damage_flags
+
var/mutable_appearance/damage_overlay
var/damage_visual = 'icons/effects/wall_damage.dmi'
+ var/overlay_layer = BULLET_HOLE_LAYER
/turf/closed/Initialize(mapload, inherited_virtual_z)
. = ..()
@@ -42,7 +45,7 @@
if(adj_dam_pct < 0)
adj_dam_pct = 0
if(!damage_overlay)
- damage_overlay = mutable_appearance(damage_visual, "cracks", BULLET_HOLE_LAYER)
+ damage_overlay = mutable_appearance(damage_visual, "cracks", overlay_layer)
damage_overlay.alpha = adj_dam_pct*255
. += damage_overlay
@@ -67,36 +70,38 @@
/turf/closed/get_smooth_underlay_icon(mutable_appearance/underlay_appearance, turf/asking_turf, adjacency_dir)
return FALSE
+/// Damage Code
+
// negative values reduce integrity, positive values increase integrity.
// Devastate forces a devestate, safe decon prevents it.
-/turf/closed/proc/alter_integrity(damage, devastate = FALSE, safe_decon = FALSE)
+/turf/closed/proc/alter_integrity(damage, mob/user, devastate = FALSE, safe_decon = FALSE)
integrity += damage
if(integrity >= max_integrity)
integrity = max_integrity
if(integrity <= 0)
if(safe_decon)
- dismantle_wall()
+ dismantle_wall(FALSE, user)
return FALSE
// if damage put us 50 points or more below 0, and not safe decon we got proper demolished
if(integrity <= -50)
- dismantle_wall(TRUE)
+ dismantle_wall(TRUE, user)
return FALSE
if(devastate)
- dismantle_wall(TRUE)
+ dismantle_wall(TRUE, user)
return FALSE
- dismantle_wall()
+ dismantle_wall(FALSE,user)
return FALSE
integrity = min(integrity, max_integrity)
update_stats()
return integrity
-/turf/closed/proc/set_integrity(amount,devastate = FALSE)
+/turf/closed/proc/set_integrity(amount,devastate = FALSE, mob/user)
integrity = amount
update_stats()
if(integrity <= 0)
- dismantle_wall(devastate)
+ dismantle_wall(devastate, user)
-/turf/closed/proc/dismantle_wall(devastate = FALSE)
+/turf/closed/proc/dismantle_wall(devastate = FALSE, mob/user)
for(var/obj/structure/sign/poster/P in src.contents) //Eject contents!
P.roll_and_drop(src)
@@ -108,31 +113,13 @@
/turf/closed/bullet_act(obj/projectile/P)
. = ..()
var/dam = get_proj_damage(P)
+ var/shooter = P.firer
if(!dam)
return
if(P.suppressed != SUPPRESSED_VERY)
visible_message("[src] is hit by \a [P]!", null, null, COMBAT_MESSAGE_RANGE)
if(!QDELETED(src))
- alter_integrity(-dam)
-
-// catch-all for using most items on the closed turf -- attempt to smash
-/turf/closed/proc/try_destroy(obj/item/W, mob/user, turf/T)
- var/dam = get_item_damage(W)
- user.do_attack_animation(src)
- if(!dam)
- to_chat(user, "[W] isn't strong enough to damage [src]!")
- playsound(src, 'sound/weapons/tap.ogg', 50, TRUE)
- return TRUE
- log_combat(user, src, "attacked", W)
- user.visible_message("[user] hits [src] with [W]!", \
- "You hit [src] with [W]!", null, COMBAT_MESSAGE_RANGE)
- switch(W.damtype)
- if(BRUTE)
- playsound(src,attack_hitsound, 100, TRUE)
- if(BURN)
- playsound(src, 'sound/items/welder.ogg', 100, TRUE)
- alter_integrity(-dam)
- return TRUE
+ alter_integrity(-dam, shooter)
/turf/closed/proc/get_item_damage(obj/item/I, t_min = min_dam)
var/dam = I.force
@@ -154,8 +141,8 @@
/turf/closed/proc/get_proj_damage(obj/projectile/P, t_min = min_dam)
var/dam = P.damage
- if(is_type_in_list(P, extra_dam_proj))
- dam = max(dam, 30)
+ if(proj_bonus_damage_flags & P.wall_damage_flags)
+ dam = P.wall_damage_override
else
switch(P.damage_type)
if(BRUTE)
@@ -181,6 +168,19 @@
if(EXPLODE_LIGHT)
alter_integrity(rand(-200, -700))
+/turf/closed/attack_paw(mob/living/user)
+ user.changeNext_move(CLICK_CD_MELEE)
+ return attack_hand(user)
+
+/turf/closed/attack_hand(mob/user)
+ . = ..()
+ if(.)
+ return
+ user.changeNext_move(CLICK_CD_MELEE)
+ to_chat(user, "You push the wall but nothing happens!")
+ playsound(src, 'sound/weapons/genhit.ogg', 25, TRUE)
+ add_fingerprint(user)
+
/turf/closed/attackby(obj/item/W, mob/user, params)
user.changeNext_move(CLICK_CD_MELEE)
if (!user.IsAdvancedToolUser())
@@ -203,6 +203,25 @@
if(try_decon(W, user, loc) || try_destroy(W, user, loc))
return
+// catch-all for using most items on the closed turf -- attempt to smash
+/turf/closed/proc/try_destroy(obj/item/W, mob/user, turf/T)
+ var/dam = get_item_damage(W)
+ user.do_attack_animation(src)
+ if(!dam)
+ to_chat(user, "[W] isn't strong enough to damage [src]!")
+ playsound(src, 'sound/weapons/tap.ogg', 50, TRUE)
+ return TRUE
+ log_combat(user, src, "attacked", W)
+ user.visible_message("[user] hits [src] with [W]!", \
+ "You hit [src] with [W]!", null, COMBAT_MESSAGE_RANGE)
+ switch(W.damtype)
+ if(BRUTE)
+ playsound(src,attack_hitsound, 100, TRUE)
+ if(BURN)
+ playsound(src, 'sound/items/welder.ogg', 100, TRUE)
+ alter_integrity(-dam, user)
+ return TRUE
+
/turf/closed/proc/try_decon(obj/item/I, mob/user, turf/T)
if(I.tool_behaviour == TOOL_WELDER)
if(!I.tool_start_check(user, amount=0))
@@ -212,7 +231,7 @@
while(I.use_tool(src, user, breakdown_duration, volume=50))
if(iswallturf(src))
to_chat(user, "You slice through some of the outer plating...")
- alter_integrity(-(I.wall_decon_damage),FALSE,TRUE)
+ alter_integrity(-(I.wall_decon_damage),user,FALSE,TRUE)
return FALSE
@@ -242,8 +261,16 @@
var/obj/item/bodypart/arm = user.hand_bodyparts[user.active_hand_index]
if(!arm || arm.bodypart_disabled)
return
- alter_integrity(-250)
+ alter_integrity(-250,user)
user.visible_message("[user] smashes \the [src]!", \
"You smash \the [src]!", \
"You hear a booming smash!")
return TRUE
+
+/turf/closed/attack_animal(mob/living/simple_animal/M)
+ M.changeNext_move(CLICK_CD_MELEE)
+ M.do_attack_animation(src)
+ if((M.environment_smash & mob_smash_flags))
+ playsound(src, 'sound/effects/meteorimpact.ogg', 100, TRUE)
+ alter_integrity(-400)
+ return
diff --git a/code/game/turfs/closed/indestructible.dm b/code/game/turfs/closed/indestructible.dm
index d62958a0ef69..5c3b554c98dd 100644
--- a/code/game/turfs/closed/indestructible.dm
+++ b/code/game/turfs/closed/indestructible.dm
@@ -3,6 +3,7 @@
desc = "Effectively impervious to conventional methods of destruction."
icon = 'icons/turf/walls.dmi'
explosion_block = 50
+ max_integrity = 10000000
/turf/closed/indestructible/TerraformTurf(path, new_baseturf, flags, defer_change = FALSE, ignore_air = FALSE)
return
@@ -10,6 +11,47 @@
/turf/closed/indestructible/acid_act(acidpwr, acid_volume, acid_id)
return 0
+/turf/closed/indestructible/ex_act(severity, target)
+ return
+
+/turf/closed/indestructible/alter_integrity(damage, mob/user, devastate, safe_decon)
+ return FALSE
+
+/turf/closed/indestructible/set_integrity(amount, devastate, mob/user)
+ return
+
+/turf/closed/indestructible/dismantle_wall(devastate, mob/user)
+ return
+
+/turf/closed/indestructible/try_decon(obj/item/I, mob/user, turf/T)
+ return FALSE
+
+/turf/closed/indestructible/try_destroy(obj/item/W, mob/user, turf/T)
+ user.do_attack_animation(src)
+ to_chat(user, "[W] isn't strong enough to damage [src]!")
+ playsound(src, 'sound/weapons/tap.ogg', 50, TRUE)
+ return TRUE
+
+/turf/closed/indestructible/mech_melee_attack(obj/mecha/M)
+ M.do_attack_animation(src)
+ switch(M.damtype)
+ if(BRUTE)
+ playsound(src, 'sound/weapons/punch4.ogg', 50, TRUE)
+ if(BURN)
+ playsound(src, 'sound/items/welder.ogg', 100, TRUE)
+ if(TOX)
+ playsound(src, 'sound/effects/spray2.ogg', 100, TRUE)
+ M.visible_message("[M.name] hits [src] and doesn't even leave a mark!", \
+ "You hit [src] and fail to damage it.", null, COMBAT_MESSAGE_RANGE)
+
+/turf/closed/indestructible/attack_hulk(mob/living/carbon/user)
+ return FALSE
+
+/turf/closed/indestructible/attack_animal(mob/living/simple_animal/M)
+ M.changeNext_move(CLICK_CD_MELEE)
+ M.do_attack_animation(src)
+ return
+
/turf/closed/indestructible/Melt()
to_be_destroyed = FALSE
return src
diff --git a/code/game/turfs/closed/minerals.dm b/code/game/turfs/closed/minerals.dm
index 9936053ea3ad..0d9b3205cc27 100644
--- a/code/game/turfs/closed/minerals.dm
+++ b/code/game/turfs/closed/minerals.dm
@@ -30,8 +30,20 @@
var/x_offset = -4
var/y_offset = -4
+ attack_hitsound = 'sound/effects/break_stone.ogg'
+ break_sound = 'sound/effects/break_stone.ogg'
hitsound_type = PROJECTILE_HITSOUND_STONE
+ min_dam = 5
+ max_integrity = MINERAL_WALL_INTEGRITY
+ brute_mod = 1
+ burn_mod = 1
+
+ mob_smash_flags = ENVIRONMENT_SMASH_MINERALS
+ proj_bonus_damage_flags = PROJECTILE_BONUS_DAMAGE_MINERALS
+
+ overlay_layer = ON_EDGED_TURF_LAYER
+
/turf/closed/mineral/Initialize(mapload, inherited_virtual_z)
. = ..()
if(has_borders)
@@ -66,28 +78,28 @@
return TRUE
return ..()
-
-/turf/closed/mineral/attackby(obj/item/I, mob/user, params)
- if (!user.IsAdvancedToolUser())
- to_chat(usr, "You don't have the dexterity to do this!")
- return
-
+/turf/closed/mineral/try_decon(obj/item/I, mob/user, turf/T)
if(I.tool_behaviour == TOOL_MINING)
- var/turf/T = user.loc
- if (!isturf(T))
- return
+ if(!I.tool_start_check(user, amount=0))
+ return FALSE
- if(last_act + (40 * I.toolspeed) > world.time)//prevents message spam
- return
- last_act = world.time
- balloon_alert(user, "digging...")
-
- if(I.use_tool(src, user, 40, volume=50))
+ to_chat(user, "You begin breaking through the rock...")
+ while(I.use_tool(src, user, breakdown_duration, volume=50))
if(ismineralturf(src))
- gets_drilled(user, TRUE)
+ to_chat(user, "You break through some of the stone...")
SSblackbox.record_feedback("tally", "pick_used_mining", 1, I.type)
+ alter_integrity(-(I.wall_decon_damage),user,FALSE,TRUE)
+
+ return FALSE
+
+/turf/closed/mineral/dismantle_wall(devastate = FALSE,mob/user)
+ var/slagged = 0
+ if(devastate == TRUE)
+ slagged = 100
+ if(ismineralturf(src))
+ gets_drilled(user, TRUE, slagged)
else
- return attack_hand(user)
+ return FALSE
/turf/closed/mineral/proc/gets_drilled(user, give_exp = FALSE, slag_chance = 0)
if (mineralType && (mineralAmt > 0))
@@ -111,9 +123,10 @@
var/flags = NONE
if(defer_change) // TODO: make the defer change var a var for any changeturf flag
flags = CHANGETURF_DEFER_CHANGE
+ playsound(src, break_sound, 50, TRUE) //beautiful destruction
ScrapeAway(null, flags)
addtimer(CALLBACK(src, PROC_REF(AfterChange)), 1, TIMER_UNIQUE)
- playsound(src, 'sound/effects/break_stone.ogg', 50, TRUE) //beautiful destruction
+
/turf/closed/mineral/attack_animal(mob/living/simple_animal/user)
if((user.environment_smash & ENVIRONMENT_SMASH_WALLS) || (user.environment_smash & ENVIRONMENT_SMASH_RWALLS) || (user.environment_smash & ENVIRONMENT_SMASH_MINERALS))
@@ -133,7 +146,10 @@
var/mob/living/carbon/human/H = AM
var/obj/item/I = H.is_holding_tool_quality(TOOL_MINING)
if(I)
- attackby(I, H)
+ if(last_act + (40 * I.toolspeed) > world.time)//prevents message spam
+ return
+ last_act = world.time
+ try_decon(I, H)
return
else if(iscyborg(AM))
var/mob/living/silicon/robot/R = AM
diff --git a/code/game/turfs/closed/wall/reinf_walls.dm b/code/game/turfs/closed/wall/reinf_walls.dm
index c24565a68f25..ed2f0141eaff 100644
--- a/code/game/turfs/closed/wall/reinf_walls.dm
+++ b/code/game/turfs/closed/wall/reinf_walls.dm
@@ -23,6 +23,9 @@
max_integrity = 1400
+ mob_smash_flags = ENVIRONMENT_SMASH_RWALLS
+ proj_bonus_damage_flags = PROJECTILE_BONUS_DAMAGE_RWALLS
+
/turf/closed/wall/r_wall/yesdiag
icon_state = "reinforced_wall-255"
smoothing_flags = SMOOTH_BITMASK | SMOOTH_DIAGONAL_CORNERS
diff --git a/code/game/turfs/closed/walls.dm b/code/game/turfs/closed/walls.dm
index f69ea753feb3..bcc9af026890 100644
--- a/code/game/turfs/closed/walls.dm
+++ b/code/game/turfs/closed/walls.dm
@@ -23,23 +23,17 @@
var/sheet_type = /obj/item/stack/sheet/metal
var/sheet_amount = 2
var/obj/girder_type = /obj/structure/girder
- /// sound when something hits the wall and deals damage
-
var/list/dent_decals
- // // The wall will ignore damage from weak items, depending on their
- // // force, damage type, tool behavior, and sharpness. This is the minimum
- // // amount of force that a blunt, brute item must have to damage the wall.
- // var/min_dam = 8
- // var/max_integrity = 400
- // var/integrity
- // var/brute_mod = 1
- // var/burn_mod = 1
- // var/repair_amount = 50
- // // Projectiles that do extra damage to the wall
- // var/list/extra_dam_proj
+ min_dam = 8
+ max_integrity = 400
+ brute_mod = 1
+ burn_mod = 1
+ var/repair_amount = 50
+ mob_smash_flags = ENVIRONMENT_SMASH_WALLS
+ proj_bonus_damage_flags = PROJECTILE_BONUS_DAMAGE_WALLS
/turf/closed/wall/yesdiag
@@ -73,7 +67,6 @@
for(var/decal in dent_decals)
. += decal
-
/turf/closed/wall/examine(mob/user)
. += ..()
. += deconstruction_hints(user)
@@ -108,32 +101,10 @@
return new girder_type(src)
return null
-/turf/closed/wall/attack_paw(mob/living/user)
- user.changeNext_move(CLICK_CD_MELEE)
- return attack_hand(user)
-
-// to do - bit flags
-/turf/closed/wall/attack_animal(mob/living/simple_animal/M)
- M.changeNext_move(CLICK_CD_MELEE)
- M.do_attack_animation(src)
- if((M.environment_smash & ENVIRONMENT_SMASH_WALLS) || (M.environment_smash & ENVIRONMENT_SMASH_RWALLS))
- playsound(src, 'sound/effects/meteorimpact.ogg', 100, TRUE)
- alter_integrity(-400)
- return
-
-/turf/closed/wall/attack_hand(mob/user)
- . = ..()
- if(.)
- return
- user.changeNext_move(CLICK_CD_MELEE)
- to_chat(user, "You push the wall but nothing happens!")
- playsound(src, 'sound/weapons/genhit.ogg', 25, TRUE)
- add_fingerprint(user)
-
/turf/closed/wall/attack_override(obj/item/W, mob/user, turf/loc)
- if(try_clean(W, user, loc) || try_wallmount(W, user, loc) || try_decon(W, user, loc) || try_destroy(W, user, loc))
+ if(try_clean(W, user, loc) || try_wallmount(W, user, loc))
return
-
+ ..()
/turf/closed/wall/proc/try_clean(obj/item/W, mob/user, turf/T)
if((user.a_intent != INTENT_HELP))
diff --git a/code/modules/mining/equipment/kinetic_crusher.dm b/code/modules/mining/equipment/kinetic_crusher.dm
index b6073d4c86a2..3e0bed238bec 100644
--- a/code/modules/mining/equipment/kinetic_crusher.dm
+++ b/code/modules/mining/equipment/kinetic_crusher.dm
@@ -135,6 +135,8 @@
nodamage = TRUE
damage = 0 //We're just here to mark people. This is still a melee weapon.
damage_type = BRUTE
+ wall_damage_flags = PROJECTILE_BONUS_DAMAGE_MINERALS
+ wall_damage_override = MINERAL_WALL_INTEGRITY
flag = "bomb"
range = 6
log_override = TRUE
@@ -152,7 +154,6 @@
if(ismineralturf(target_turf))
var/turf/closed/mineral/M = target_turf
new /obj/effect/temp_visual/kinetic_blast(M)
- M.gets_drilled(firer, TRUE)
..()
//outdated Nanotrasen prototype of the crusher. Incredibly heavy, but the blade was made at a premium. //to alter this I had to duplicate some code, big moment.
diff --git a/code/modules/mining/equipment/mining_tools.dm b/code/modules/mining/equipment/mining_tools.dm
index d38a3ce8b55b..a0548a2cb9f1 100644
--- a/code/modules/mining/equipment/mining_tools.dm
+++ b/code/modules/mining/equipment/mining_tools.dm
@@ -17,6 +17,7 @@
toolspeed = 0.5
usesound = list('sound/effects/picaxe1.ogg', 'sound/effects/picaxe2.ogg', 'sound/effects/picaxe3.ogg')
attack_verb = list("hit", "pierced", "sliced", "attacked")
+ wall_decon_damage = MINERAL_WALL_INTEGRITY
/obj/item/pickaxe/rusted
name = "rusty pickaxe"
@@ -24,6 +25,7 @@
attack_verb = list("ineffectively hit")
force = 1
throwforce = 1
+ wall_decon_damage = 50
/obj/item/pickaxe/mini
name = "compact pickaxe"
diff --git a/code/modules/mining/lavaland/necropolis_chests.dm b/code/modules/mining/lavaland/necropolis_chests.dm
index a2b48d9319b9..2af5515e47a7 100644
--- a/code/modules/mining/lavaland/necropolis_chests.dm
+++ b/code/modules/mining/lavaland/necropolis_chests.dm
@@ -933,6 +933,8 @@
range = 20
damage = 30
damage_type = BRUTE
+ wall_damage_flags = PROJECTILE_BONUS_DAMAGE_MINERALS
+ wall_damage_override = MINERAL_WALL_INTEGRITY
icon = 'icons/obj/projectiles.dmi'
icon_state = "spur_high"
var/skip = FALSE //this is the hackiest thing ive ever done but i dont know any other solution other than deparent the spur projectile
@@ -994,9 +996,6 @@
spawn(15)
target.overlays -= impact
playsound(loc, impact_sound, 30)
- if(istype(target,/turf/closed/mineral))
- var/turf/closed/mineral/M = target
- M.gets_drilled()
..()
/obj/item/ammo_casing/energy/spur/spur
diff --git a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm
index 2ca71649a6f7..5d0e8d54e4e2 100644
--- a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm
+++ b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm
@@ -192,6 +192,8 @@
icon_state = null
damage = 20
damage_type = BRUTE
+ wall_damage_flags = PROJECTILE_BONUS_DAMAGE_MINERALS
+ wall_damage_override = MINERAL_WALL_INTEGRITY
flag = "bomb"
range = 3
log_override = TRUE
@@ -235,8 +237,6 @@
for(var/obj/item/borg/upgrade/modkit/M in mods)
M.projectile_strike(src, target_turf, target, kinetic_gun)
if(ismineralturf(target_turf))
- var/turf/closed/mineral/M = target_turf
- M.gets_drilled(firer, TRUE)
if(iscarbon(firer))
var/mob/living/carbon/C = firer
var/skill_modifier = C?.mind.get_skill_modifier(/datum/skill/mining, SKILL_SPEED_MODIFIER)
diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm
index 66adeb53ac59..ea640e1a7219 100644
--- a/code/modules/projectiles/projectile.dm
+++ b/code/modules/projectiles/projectile.dm
@@ -156,6 +156,10 @@
var/impact_effect_type //what type of impact effect to show when hitting something
var/log_override = FALSE //is this type spammed enough to not log? (KAs)
+ // if the projectile has the matching flags when hitting a wall, it deals it's override damage instead
+ var/wall_damage_flags = PROJECTILE_BONUS_DAMAGE_NONE
+ var/wall_damage_override = 0
+
///If defined, on hit we create an item of this type then call hitby() on the hit target with this, mainly used for embedding items (bullets) in targets
var/shrapnel_type
///If TRUE, hit mobs even if they're on the floor and not our target
diff --git a/code/modules/projectiles/projectile/beams.dm b/code/modules/projectiles/projectile/beams.dm
index 3aada5ddcb41..c46a4c6cb2f9 100644
--- a/code/modules/projectiles/projectile/beams.dm
+++ b/code/modules/projectiles/projectile/beams.dm
@@ -133,6 +133,8 @@
name = "pulse"
icon_state = "u_laser"
damage = 40
+ wall_damage_flags = PROJECTILE_BONUS_DAMAGE_MINERALS | PROJECTILE_BONUS_DAMAGE_WALLS | PROJECTILE_BONUS_DAMAGE_WALLS
+ wall_damage_override = 200
impact_effect_type = /obj/effect/temp_visual/impact_effect/blue_laser
light_color = LIGHT_COLOR_BLUE
tracer_type = /obj/effect/projectile/tracer/pulse
diff --git a/code/modules/projectiles/projectile/special/plasma.dm b/code/modules/projectiles/projectile/special/plasma.dm
index 736b93c85a63..d957ad924572 100644
--- a/code/modules/projectiles/projectile/special/plasma.dm
+++ b/code/modules/projectiles/projectile/special/plasma.dm
@@ -12,14 +12,6 @@
muzzle_type = /obj/effect/projectile/muzzle/plasma_cutter
impact_type = /obj/effect/projectile/impact/plasma_cutter
-/obj/projectile/plasma/on_hit(atom/target)
- . = ..()
- if(ismineralturf(target))
- var/turf/closed/mineral/M = target
- M.gets_drilled(firer, FALSE, slag_chance)
- if(range > 0)
- return BULLET_ACT_FORCE_PIERCE
-
/obj/projectile/plasma/adv
damage = 7
range = 5
From 51f220bbd77b96ae92e9391485b507a87b132eae Mon Sep 17 00:00:00 2001
From: Gristlebee <56049844+Gristlebee@users.noreply.github.com>
Date: Sun, 1 Sep 2024 16:21:03 -0700
Subject: [PATCH 3/3] dented
---
code/__DEFINES/turfs.dm | 4 ++++
code/game/turfs/closed/_closed.dm | 31 +++++++++++++++++++++++++++++-
code/game/turfs/closed/walls.dm | 32 -------------------------------
3 files changed, 34 insertions(+), 33 deletions(-)
diff --git a/code/__DEFINES/turfs.dm b/code/__DEFINES/turfs.dm
index ed816cdaa8d5..30db6fc98f33 100644
--- a/code/__DEFINES/turfs.dm
+++ b/code/__DEFINES/turfs.dm
@@ -13,4 +13,8 @@
#define IS_OPAQUE_TURF(turf) (turf.directional_opacity == ALL_CARDINALS)
+// Integrity of mineral walls.
#define MINERAL_WALL_INTEGRITY 100
+
+// how many bullet holes a wall can have at a given time
+#define MAX_DENT_DECALS 15
diff --git a/code/game/turfs/closed/_closed.dm b/code/game/turfs/closed/_closed.dm
index af6056bf3220..dc410d027504 100644
--- a/code/game/turfs/closed/_closed.dm
+++ b/code/game/turfs/closed/_closed.dm
@@ -33,11 +33,20 @@
var/damage_visual = 'icons/effects/wall_damage.dmi'
var/overlay_layer = BULLET_HOLE_LAYER
+ var/list/dent_decals
+
/turf/closed/Initialize(mapload, inherited_virtual_z)
. = ..()
if(integrity == null)
integrity = max_integrity
+/turf/closed/copyTurf(turf/T, copy_air, flags)
+ . = ..()
+ var/turf/closed/wall_copy = T
+ if(LAZYLEN(dent_decals))
+ wall_copy.dent_decals = dent_decals.Copy()
+ wall_copy.update_appearance()
+
/turf/closed/update_overlays()
. = ..()
damage_overlay = null
@@ -48,6 +57,24 @@
damage_overlay = mutable_appearance(damage_visual, "cracks", overlay_layer)
damage_overlay.alpha = adj_dam_pct*255
. += damage_overlay
+ for(var/decal in dent_decals)
+ . += decal
+
+/turf/closed/proc/add_dent(denttype, x=rand(-8, 8), y=rand(-8, 8))
+ if(LAZYLEN(dent_decals) >= MAX_DENT_DECALS)
+ return
+
+ var/mutable_appearance/decal = mutable_appearance('icons/effects/effects.dmi', "", BULLET_HOLE_LAYER)
+ switch(denttype)
+ if(WALL_DENT_SHOT)
+ decal.icon_state = "bullet_hole"
+ if(WALL_DENT_HIT)
+ decal.icon_state = "impact[rand(1, 3)]"
+
+ decal.pixel_x = x
+ decal.pixel_y = y
+ LAZYADD(dent_decals, decal)
+ update_appearance()
/turf/closed/examine(mob/user)
. = ..()
@@ -119,6 +146,7 @@
if(P.suppressed != SUPPRESSED_VERY)
visible_message("[src] is hit by \a [P]!", null, null, COMBAT_MESSAGE_RANGE)
if(!QDELETED(src))
+ add_dent(WALL_DENT_SHOT)
alter_integrity(-dam, shooter)
/turf/closed/proc/get_item_damage(obj/item/I, t_min = min_dam)
@@ -177,7 +205,7 @@
if(.)
return
user.changeNext_move(CLICK_CD_MELEE)
- to_chat(user, "You push the wall but nothing happens!")
+ to_chat(user, "You push \the [src] but nothing happens!")
playsound(src, 'sound/weapons/genhit.ogg', 25, TRUE)
add_fingerprint(user)
@@ -219,6 +247,7 @@
playsound(src,attack_hitsound, 100, TRUE)
if(BURN)
playsound(src, 'sound/items/welder.ogg', 100, TRUE)
+ add_dent(WALL_DENT_HIT)
alter_integrity(-dam, user)
return TRUE
diff --git a/code/game/turfs/closed/walls.dm b/code/game/turfs/closed/walls.dm
index bcc9af026890..bed648ff592b 100644
--- a/code/game/turfs/closed/walls.dm
+++ b/code/game/turfs/closed/walls.dm
@@ -1,5 +1,3 @@
-#define MAX_DENT_DECALS 15
-// KILL MINING CODE
/turf/closed/wall
name = "wall"
desc = "A huge chunk of metal used to separate rooms."
@@ -24,8 +22,6 @@
var/sheet_amount = 2
var/obj/girder_type = /obj/structure/girder
- var/list/dent_decals
-
min_dam = 8
max_integrity = 400
brute_mod = 1
@@ -54,19 +50,6 @@
fixed_underlay = string_assoc_list(fixed_underlay)
underlays += underlay_appearance
-// to be changed - move up
-/turf/closed/wall/copyTurf(turf/T, copy_air, flags)
- . = ..()
- var/turf/closed/wall/wall_copy = T
- if(LAZYLEN(dent_decals))
- wall_copy.dent_decals = dent_decals.Copy()
- wall_copy.update_appearance()
-
-/turf/closed/wall/update_overlays()
- . = ..()
- for(var/decal in dent_decals)
- . += decal
-
/turf/closed/wall/examine(mob/user)
. += ..()
. += deconstruction_hints(user)
@@ -195,20 +178,5 @@
return TRUE
return FALSE
-/turf/closed/wall/proc/add_dent(denttype, x=rand(-8, 8), y=rand(-8, 8))
- if(LAZYLEN(dent_decals) >= MAX_DENT_DECALS)
- return
-
- var/mutable_appearance/decal = mutable_appearance('icons/effects/effects.dmi', "", BULLET_HOLE_LAYER)
- switch(denttype)
- if(WALL_DENT_SHOT)
- decal.icon_state = "bullet_hole"
- if(WALL_DENT_HIT)
- decal.icon_state = "impact[rand(1, 3)]"
- decal.pixel_x = x
- decal.pixel_y = y
- LAZYADD(dent_decals, decal)
- update_appearance()
-#undef MAX_DENT_DECALS