Skip to content

Commit d5eddc9

Browse files
authored
[BOUNTY] Implements atom integrity for walls, (which is needed to do) Upgraded Emitters can now tear down walls! Take Two! (#5938)
## About The Pull Request Ports yogstation13/Yogstation#21336 Retake of #5706 This PR is a double bounty, makes it so that walls behaves the same way as any other structures or machineries, being able to be damaged and destroyed by normal weapons instead of very specific ways/deconstruction Normal walls have 300 damage + armor, with a damage minimum for it to take effect of 25 Normal walls have 600 damage + armor, with a damage minimum for it to take effect of 75 Emitters with upgraded lasers can now be able to tear down walls, stock parts emitters still functions the same. Below are the damage table needed to tear a wall down T1 laser: cannot damage walls, operates normally. T2: 20 hits to break normal walls, r wall or stronger cannot be damaged. T3: 10 hits to kill normal walls, r wall or stronger cannot be damaged. T4: 5 hits to kill normal walls, r walls or strong take 10 hits to be killed. T5: 3 hits to kill normal, 7 to kill r walls or higher Emagging the emitters increases the parts tier above by one (which is how you'd get T5) at the cost of 5% damage to the emitters. This functionality only applies if the projectile emitted by the emitters is the default hitscan emitters shots. Pooba said that for my first PR to go through, we'd need to implement atom integrity, which they'd gracefully posted a bounty for. ## Why It's Good For The Game Here is it in action: https://github.com/user-attachments/assets/34b999b0-a7f6-4fa7-ac26-5e804e3ba5ad Walls being able to use the integrity system means destroying them in a way that isn't instantaneous and no longer needs to rely on tons of snowflake code for each instance/case of something breaking a wall. It also means they aren't totally invincible to damage, which I think could allow for some fun interactions. Anyhow, as for the emitter PR. i'll just copy this verbatim: You know how the emitters looks like a heavy, industrial laser cannon that you'd be able to see be used as an impromptu blaster? How come can it not damage walls? Anyways, this adds a new way of breaching walls besides thermite, tools or c-4/x-4, Albeit a pretty slow and loud one at that. More tools for engineer's arsenal is good! ## Changelog :cl: add: Walls now have atom integrity, being able to be attacked and destroyed like other machineries and structures. they're a tough nut to crack though add: Emitters can now tear down walls! (once upgraded) /:cl:
1 parent 99b346f commit d5eddc9

File tree

6 files changed

+153
-40
lines changed

6 files changed

+153
-40
lines changed

code/game/turfs/closed/_closed.dm

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,20 @@
99
rad_insulation = RAD_MEDIUM_INSULATION
1010
pass_flags_self = PASSCLOSEDTURF
1111

12+
//Monkestation edit start
13+
/turf/closed/examine(mob/user)
14+
. = ..()
15+
if(uses_integrity && atom_integrity < max_integrity)
16+
var/healthpercent = (atom_integrity/max_integrity) * 100
17+
switch(healthpercent)
18+
if(50 to 99)
19+
. += "It looks slightly damaged."
20+
if(25 to 50)
21+
. += "It appears heavily damaged."
22+
if(0 to 25)
23+
. += span_warning("It's falling apart!")
24+
//Monkestation edit end
25+
1226
/turf/closed/AfterChange()
1327
. = ..()
1428
SSair.high_pressure_delta -= src

code/game/turfs/closed/wall/reinf_walls.dm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
sheet_amount = 1
1414
girder_type = /obj/structure/girder/reinforced
1515
explosive_resistance = 2
16+
max_integrity = 600 //Monkestation edit
17+
damage_deflection = 75 // can't be damaged with most conventional weapons or tools Monkestation edit
1618
rad_insulation = RAD_HEAVY_INSULATION
1719
heat_capacity = 312500 //a little over 5 cm thick , 312500 for 1 m by 2.5 m by 0.25 m plasteel wall. also indicates the temperature at wich the wall will melt (currently only able to melt with H/E pipes)
1820
///Dismantled state, related to deconstruction.
@@ -205,7 +207,7 @@
205207
icon_state = "[base_icon_state]-[smoothing_junction]"
206208
return ..()
207209

208-
/turf/closed/wall/r_wall/wall_singularity_pull(current_size)
210+
/turf/closed/wall/r_wall/singularity_pull(current_size) //Monkestation edit
209211
if(current_size >= STAGE_FIVE)
210212
if(prob(30))
211213
dismantle_wall()

code/game/turfs/closed/walls.dm

Lines changed: 96 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,24 @@
3535

3636
var/list/dent_decals
3737

38+
//Monkestation edit start
39+
max_integrity = 300
40+
damage_deflection = 22 // big chunk of solid metal
41+
uses_integrity = TRUE
42+
armor_type = /datum/armor/wall
43+
44+
/datum/armor/wall
45+
melee = 60
46+
bullet = 60
47+
laser = 60
48+
energy = 0
49+
bomb = 0
50+
bio = 0
51+
acid = 50
52+
wound = 0
53+
//Monkestation edit end
54+
55+
3856
/turf/closed/wall/MouseDrop_T(mob/living/carbon/carbon_mob, mob/user)
3957
..()
4058
if(carbon_mob != user)
@@ -108,10 +126,6 @@
108126
if(SSstation_coloring.wall_trims)
109127
trim_color = SSstation_coloring.get_default_color()
110128

111-
/turf/closed/wall/atom_destruction(damage_flag)
112-
. = ..()
113-
dismantle_wall(TRUE, FALSE)
114-
115129
/turf/closed/wall/Destroy()
116130
if(is_station_level(z))
117131
GLOB.station_turfs -= src
@@ -122,6 +136,37 @@
122136
. += ..()
123137
. += deconstruction_hints(user)
124138

139+
//monkestation edit start
140+
/turf/closed/wall/take_damage(damage_amount, damage_type, damage_flag, sound_effect, attack_dir, armour_penetration)
141+
. = ..()
142+
if(.) // add a dent if it took damage
143+
add_dent(WALL_DENT_HIT)
144+
145+
/turf/closed/wall/attacked_by(obj/item/attacking_item, mob/living/user)
146+
if(!uses_integrity)
147+
CRASH("attacked_by() was called on an wall that doesn't use integrity!")
148+
149+
if(!attacking_item.force)
150+
return
151+
152+
var/damage = take_damage(attacking_item.force * attacking_item.demolition_mod, attacking_item.damtype, MELEE, 1)
153+
//only witnesses close by and the victim see a hit message.
154+
user.visible_message(span_danger("[user] hits [src] with [attacking_item][damage ? "." : ", without leaving a mark!"]"), \
155+
span_danger("You hit [src] with [attacking_item][damage ? "." : ", without leaving a mark!"]"), null, COMBAT_MESSAGE_RANGE)
156+
log_combat(user, src, "attacked", attacking_item)
157+
158+
/turf/closed/wall/run_atom_armor(damage_amount, damage_type, damage_flag, attack_dir, armour_penetration)
159+
if(damage_amount < damage_deflection && (damage_type in list(MELEE, BULLET, LASER, ENERGY)))
160+
return 0 // absolutely no bypassing damage deflection by using projectiles
161+
return ..()
162+
163+
/turf/closed/wall/atom_destruction(damage_flag)
164+
. = ..()
165+
if(damage_flag == MELEE)
166+
playsound(src, 'sound/effects/meteorimpact.ogg', 50, TRUE) //Otherwise there's no sound for hitting the wall, since it's just dismantled
167+
dismantle_wall(TRUE, TRUE)
168+
//monkestation edit end
169+
125170
/turf/closed/wall/proc/deconstruction_hints(mob/user)
126171
return span_notice("The outer plating is <b>welded</b> firmly in place.")
127172

@@ -167,7 +212,7 @@
167212

168213
/turf/closed/wall/ex_act(severity, target)
169214
if(target == src)
170-
dismantle_wall(1,1)
215+
dismantle_wall(TRUE, TRUE) //monkestation edit
171216
return
172217

173218
switch(severity)
@@ -179,17 +224,16 @@
179224
if(EXPLODE_HEAVY)
180225
dismantle_wall(prob(50), TRUE)
181226
if(EXPLODE_LIGHT)
182-
if (prob(hardness))
183-
dismantle_wall(0,1)
227+
take_damage(150, BRUTE, BOMB) // less kaboom monkestation edit
184228
if(!density)
185229
..()
186230

187231

188232
/turf/closed/wall/blob_act(obj/structure/blob/B)
189-
if(prob(50))
190-
dismantle_wall()
191-
else
192-
add_dent(WALL_DENT_HIT)
233+
//monkestation edit start
234+
take_damage(400, BRUTE, MELEE, FALSE)
235+
playsound(src, 'sound/effects/meteorimpact.ogg', 100, 1)
236+
//monkestation edit end
193237

194238
/turf/closed/wall/attack_paw(mob/living/user, list/modifiers)
195239
user.changeNext_move(CLICK_CD_MELEE)
@@ -202,19 +246,14 @@
202246
return
203247
if(arm.bodypart_disabled)
204248
return
205-
if(prob(hardness))
206-
playsound(src, 'sound/effects/meteorimpact.ogg', 100, TRUE)
207-
user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" ), forced = "hulk")
208-
hulk_recoil(arm, user)
209-
dismantle_wall(1)
210-
211-
else
212-
playsound(src, 'sound/effects/bang.ogg', 50, TRUE)
213-
add_dent(WALL_DENT_HIT)
214-
user.visible_message(span_danger("[user] smashes \the [src]!"), \
215-
span_danger("You smash \the [src]!"), \
216-
span_hear("You hear a booming smash!"))
249+
//monkestation edit start
250+
user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" ), forced = "hulk")
251+
take_damage(400, BRUTE, MELEE, FALSE)
252+
playsound(src, 'sound/effects/bang.ogg', 50, 1)
253+
to_chat(user, span_notice("You punch the wall."))
254+
hulk_recoil(arm, user)
217255
return TRUE
256+
//monkestation edit end
218257

219258
/**
220259
*Deals damage back to the hulk's arm.
@@ -243,7 +282,7 @@
243282
playsound(src, 'sound/weapons/genhit.ogg', 25, TRUE)
244283
add_fingerprint(user)
245284

246-
/turf/closed/wall/attackby(obj/item/W, mob/user, params)
285+
/turf/closed/wall/attackby(obj/item/attacking_item, mob/user, params) //monkestation edit
247286
user.changeNext_move(CLICK_CD_MELEE)
248287
if (!ISADVANCEDTOOLUSER(user))
249288
to_chat(user, span_warning("You don't have the dexterity to do this!"))
@@ -256,27 +295,34 @@
256295
add_fingerprint(user)
257296

258297
//the istype cascade has been spread among various procs for easy overriding
259-
if(try_clean(W, user) || try_wallmount(W, user) || try_decon(W, user))
298+
if(try_clean(attacking_item, user) || try_wallmount(attacking_item, user) || try_decon(attacking_item, user)) //monkestation edit
260299
return
261300

262-
return ..()
301+
return ..() || (attacking_item.attack_atom(src, user))
263302

264303
/turf/closed/wall/proc/try_clean(obj/item/W, mob/living/user, turf/T)
265-
if(((user.istate & ISTATE_HARM)) || !LAZYLEN(dent_decals))
304+
if(!(user.istate & ISTATE_HARM)) //monkestation edit
266305
return FALSE
267306

307+
//monkestation edit start
268308
if(W.tool_behaviour == TOOL_WELDER)
269-
if(!W.tool_start_check(user, amount=0))
270-
return FALSE
309+
if(atom_integrity >= max_integrity)
310+
to_chat(user, span_warning("[src] is intact!"))
311+
return TRUE
271312

272-
to_chat(user, span_notice("You begin fixing dents on the wall..."))
273-
if(W.use_tool(src, user, 0, volume=100))
274-
if(iswallturf(src) && LAZYLEN(dent_decals))
275-
to_chat(user, span_notice("You fix some dents on the wall."))
276-
cut_overlay(dent_decals)
277-
dent_decals.Cut()
313+
if(!W.tool_start_check(user, amount=0))
314+
to_chat(user, span_warning("You need more fuel to repair [src]!"))
278315
return TRUE
279316

317+
to_chat(user, span_notice("You begin repairing [src]..."))
318+
if(W.use_tool(src, user, 3 SECONDS, volume=100))
319+
update_integrity(max_integrity)
320+
to_chat(user, span_notice("You repair [src]."))
321+
cut_overlay(dent_decals)
322+
dent_decals.Cut()
323+
return TRUE
324+
return TRUE
325+
//monkestation edit end
280326
return FALSE
281327

282328
/turf/closed/wall/proc/try_wallmount(obj/item/W, mob/user)
@@ -308,9 +354,15 @@
308354
return FALSE
309355

310356
/turf/closed/wall/singularity_pull(S, current_size)
311-
..()
312-
wall_singularity_pull(current_size)
357+
. = ..()
358+
//monkestation edit start
359+
if(current_size >= STAGE_FIVE)
360+
take_damage(300, armour_penetration=100) // LORD SINGULOTH CARES NOT FOR YOUR "ARMOR"
361+
else if(current_size == STAGE_FOUR)
362+
take_damage(150, armour_penetration=100)
363+
//monkestation edit end
313364

365+
/* //MONKESTATION REMOVAL: Deprecated, obselete old code proc
314366
/turf/closed/wall/proc/wall_singularity_pull(current_size)
315367
if(current_size >= STAGE_FIVE)
316368
if(prob(50))
@@ -319,6 +371,7 @@
319371
if(current_size == STAGE_FOUR)
320372
if(prob(30))
321373
dismantle_wall()
374+
*/
322375

323376
/turf/closed/wall/narsie_act(force, ignore_mobs, probability = 20)
324377
. = ..()
@@ -358,7 +411,12 @@
358411
return TRUE
359412
return FALSE
360413

361-
/turf/closed/wall/proc/add_dent(denttype, x=rand(-8, 8), y=rand(-8, 8))
414+
//monkestation edit start
415+
/turf/proc/add_dent(denttype, x=rand(-8, 8), y=rand(-8, 8)) // this only exists because turf code is terrible, monkestation
416+
return
417+
418+
/turf/closed/wall/add_dent(denttype, x=rand(-8, 8), y=rand(-8, 8))
419+
//monkestation edit end
362420
if(LAZYLEN(dent_decals) >= MAX_DENT_DECALS)
363421
return
364422

code/modules/power/singularity/emitter.dm

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@
5757
///stores the direction and orientation of the last projectile
5858
var/last_projectile_params
5959

60+
//monkestation edit start
61+
//Basic Emitters projectile characteristics
62+
///damage modifier on walls
63+
var/wall_dem_mod = 1
64+
///can projectile hit walls
65+
var/is_proj_hit_walls = FALSE
66+
//monkestation edit end
67+
6068
/obj/machinery/power/emitter/Initialize(mapload)
6169
. = ..()
6270
RefreshParts()
@@ -87,10 +95,19 @@
8795
var/fire_shoot_delay = 12 SECONDS
8896
var/min_fire_delay = 2.4 SECONDS
8997
var/power_usage = 350
98+
//monkestation edit start
99+
var/list/wall_mod_table = list(1, 1.25, 2.5, 5, 8.35) //infinite, 20, 10, 5, 3 hits respectively to destroy a normal wall, last two tiers, 10, 7 shots for r-walls
90100
for(var/datum/stock_part/micro_laser/laser in component_parts)
91101
max_fire_delay -= 2 SECONDS * laser.tier
92102
min_fire_delay -= 0.4 SECONDS * laser.tier
93103
fire_shoot_delay -= 2 SECONDS * laser.tier
104+
var/parts_tier = laser.tier
105+
if(obj_flags & EMAGGED)
106+
parts_tier += 1
107+
if(parts_tier >= 2)
108+
is_proj_hit_walls = TRUE
109+
wall_dem_mod = wall_mod_table[clamp(parts_tier, 0, LAZYLEN(wall_mod_table))]
110+
//monkestation edit end
94111
maximum_fire_delay = max_fire_delay
95112
minimum_fire_delay = min_fire_delay
96113
fire_delay = fire_shoot_delay
@@ -219,6 +236,15 @@
219236

220237
/obj/machinery/power/emitter/proc/fire_beam(mob/user)
221238
var/obj/projectile/projectile = new projectile_type(get_turf(src))
239+
//monkestation edit start
240+
if(istype(projectile, /obj/projectile/beam/emitter/hitscan)) //TODO: LESS SNOWFLAKE CHECK
241+
projectile.wall_dem_mod = wall_dem_mod
242+
projectile.damage_walls = is_proj_hit_walls
243+
if(obj_flags & EMAGGED)
244+
take_damage((round(max_integrity/100 * 5)))
245+
visible_message(span_warning("The [src] visibly buckles under overloaded pressure!"))
246+
247+
//monkestation edit end
222248
playsound(src, projectile_sound, 50, TRUE)
223249
if(prob(35))
224250
sparks.start()
@@ -373,7 +399,8 @@
373399
return FALSE
374400
locked = FALSE
375401
obj_flags |= EMAGGED
376-
balloon_alert(user, "id lock shorted out")
402+
balloon_alert(user, "id lock shorted out and lasers overloaded") //monkestation edit
403+
RefreshParts() //monkestation edit
377404
return TRUE
378405

379406

code/modules/projectiles/projectile.dm

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@
5050
/// We are flagged PHASING temporarily to not stop moving when we Bump something but want to keep going anyways.
5151
var/temporary_unstoppable_movement = FALSE
5252

53+
//monkestation edit start
54+
/// Do we damage walls?
55+
var/damage_walls = FALSE
56+
/// demolition mod on walls
57+
var/wall_dem_mod = 1
58+
//monkestation edit end
59+
5360
/** PROJECTILE PIERCING
5461
* WARNING:
5562
* Projectile piercing MUST be done using these variables.
@@ -297,6 +304,10 @@
297304
if(damage > 0 && (damage_type == BRUTE || damage_type == BURN) && iswallturf(target_turf) && prob(75))
298305
var/turf/closed/wall/target_wall = target_turf
299306
target_wall.add_dent(WALL_DENT_SHOT, hitx, hity)
307+
//monkestation edit start
308+
if(damage_walls)
309+
target_wall.take_damage(damage * wall_dem_mod, damage_type, armor_flag, armour_penetration = 100)
310+
//monkestation edit end
300311

301312
return BULLET_ACT_HIT
302313

code/modules/projectiles/projectile/beams.dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@
199199
impact_light_intensity = 7
200200
impact_light_outer_range = 2.5
201201
impact_light_color_override = COLOR_LIME
202+
range = 255 //come on, have some fun now! monkestation edit
202203

203204
/obj/projectile/beam/lasertag
204205
name = "laser tag beam"

0 commit comments

Comments
 (0)