Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BOUNTY] Upgraded Emitters can now tear down walls! #5706

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
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
4 changes: 4 additions & 0 deletions code/game/turfs/closed/wall/reinf_walls.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
///Dismantled state, related to deconstruction.
var/d_state = INTACT

//monkestation edit start
wall_integrity = 3000
minimum_damage = 180
//monkestation edit end

/turf/closed/wall/r_wall/deconstruction_hints(mob/user)
switch(d_state)
Expand Down
45 changes: 41 additions & 4 deletions code/game/turfs/closed/walls.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@

var/list/dent_decals

//monkestation edit start
//How much integrity the wall has, Currently only emitter shots is able to damage walls.
/// The damage taken by the wall is multiplied by this number, lower better.
/// Wall integrity
var/wall_integrity = 900
/// Current integrity
var/current_integrity
/// Minimum damage to actually deal damage to the wall
var/minimum_damage = 35
//monkestation edit stop

/turf/closed/wall/MouseDrop_T(mob/living/carbon/carbon_mob, mob/user)
..()
if(carbon_mob != user)
Expand Down Expand Up @@ -107,6 +118,7 @@
//monkestation edit start
if(SSstation_coloring.wall_trims)
trim_color = SSstation_coloring.get_default_color()
current_integrity = wall_integrity

/turf/closed/wall/atom_destruction(damage_flag)
. = ..()
Expand All @@ -120,6 +132,16 @@

/turf/closed/wall/examine(mob/user)
. += ..()
//monkestation edit start
var/healthpercent = round((current_integrity/wall_integrity) * 100, 1)
switch(healthpercent)
if(50 to 99)
. += span_info("It looks slightly damaged.")
if(25 to 50)
. += span_info("It appears heavily damaged.")
if(0 to 25)
. += span_warning("It's falling apart!")
//monkestation edit end
. += deconstruction_hints(user)

/turf/closed/wall/proc/deconstruction_hints(mob/user)
Expand Down Expand Up @@ -147,6 +169,15 @@
ScrapeAway()
QUEUE_SMOOTH_NEIGHBORS(src)

//monkestation edit start
/turf/closed/wall/proc/damage_wall(damage)
if(minimum_damage > damage)
return
current_integrity -= damage
if(current_integrity <= 0)
dismantle_wall()
//monkestation edit end

/turf/closed/wall/proc/break_wall()
var/area/shipbreak/A = get_area(src)
if(istype(A)) //if we are actually in the shipbreaking zone...
Expand Down Expand Up @@ -271,10 +302,16 @@

to_chat(user, span_notice("You begin fixing dents on the wall..."))
if(W.use_tool(src, user, 0, volume=100))
if(iswallturf(src) && LAZYLEN(dent_decals))
to_chat(user, span_notice("You fix some dents on the wall."))
cut_overlay(dent_decals)
dent_decals.Cut()
//monkestation edit start
if(iswallturf(src))
if(LAZYLEN(dent_decals))
to_chat(user, span_notice("You fix some dents on the wall."))
cut_overlay(dent_decals)
dent_decals.Cut()
if(max_integrity > current_integrity)
to_chat(user, span_notice("You fix some damage on the wall."))
current_integrity += clamp(round(max_integrity/100 * 20), 0, max_integrity)
//monkestation edit end
return TRUE

return FALSE
Expand Down
30 changes: 29 additions & 1 deletion code/modules/power/singularity/emitter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@
///stores the direction and orientation of the last projectile
var/last_projectile_params

//monkestation edit start
//Basic Emitters projectile characteristics
///damage modifier on walls
var/wall_dem_mod = 1
///can projectile hit walls
var/is_proj_hit_walls = FALSE
//monkestation edit end

/obj/machinery/power/emitter/Initialize(mapload)
. = ..()
RefreshParts()
Expand Down Expand Up @@ -87,10 +95,20 @@
var/fire_shoot_delay = 12 SECONDS
var/min_fire_delay = 2.4 SECONDS
var/power_usage = 350
//monkestation edit start
var/list/wall_mod_table = list(1, 1.5, 3, 6, 10) //infinite, 20, 10, 5, 3 hits respectively to destroy a normal wall, last two tiers, 20~, 10 shots for r-walls
for(var/datum/stock_part/micro_laser/laser in component_parts)
max_fire_delay -= 2 SECONDS * laser.tier
min_fire_delay -= 0.4 SECONDS * laser.tier
fire_shoot_delay -= 2 SECONDS * laser.tier
var/parts_tier = laser.tier
if(obj_flags & EMAGGED)
parts_tier += 1
if(parts_tier >= 2)
is_proj_hit_walls = TRUE
wall_dem_mod = wall_mod_table[clamp(parts_tier, 0, LAZYLEN(wall_mod_table))]
//monkestation edit end

maximum_fire_delay = max_fire_delay
minimum_fire_delay = min_fire_delay
fire_delay = fire_shoot_delay
Expand Down Expand Up @@ -220,6 +238,15 @@
/obj/machinery/power/emitter/proc/fire_beam(mob/user)
var/obj/projectile/projectile = new projectile_type(get_turf(src))
playsound(src, projectile_sound, 50, TRUE)
//monkestation edit start
if(istype(projectile, /obj/projectile/beam/emitter/hitscan)) //TODO: LESS SNOWFLAKE CHECK
projectile.wall_mod = wall_dem_mod
projectile.can_hit_walls = is_proj_hit_walls
if(obj_flags & EMAGGED)
take_damage((round(max_integrity/100 * 5)))
visible_message(span_warning("The [src] visibly buckles under overloaded pressure!"))

//monkestation edit end
if(prob(35))
sparks.start()
projectile.firer = user ? user : src
Expand Down Expand Up @@ -373,7 +400,8 @@
return FALSE
locked = FALSE
obj_flags |= EMAGGED
balloon_alert(user, "id lock shorted out")
balloon_alert(user, "id lock shorted out and lasers overloaded") //monkestation edit
RefreshParts() //monkestation edit
return TRUE


Expand Down
16 changes: 14 additions & 2 deletions code/modules/projectiles/projectile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@
var/debilitating = FALSE
/// How many stacks the projectile applies per hit. Default is 1, each stack adds 0.05, it stacks up to 2x stamina damage
var/debilitate_mult = 1
/// If true, can damage walls
var/can_hit_walls = FALSE //monkestation edit
/// damage modifier on wall hits
var/wall_mod = 1 //monkestation edit

/obj/projectile/Initialize(mapload)
. = ..()
Expand Down Expand Up @@ -294,11 +298,19 @@
if(!isliving(target))
if(impact_effect_type && !hitscan)
new impact_effect_type(target_turf, hitx, hity)
if(damage > 0 && (damage_type == BRUTE || damage_type == BURN) && iswallturf(target_turf) && prob(75))

//monkestation edit start
if(iswallturf(target_turf))
var/turf/closed/wall/target_wall = target_turf
target_wall.add_dent(WALL_DENT_SHOT, hitx, hity)
if(can_hit_walls == TRUE)
target_wall.add_dent(WALL_DENT_SHOT, hitx, hity)
target_wall.damage_wall(damage * wall_mod)
return BULLET_ACT_HIT
if(damage > 0 && (damage_type == BRUTE || damage_type == BURN) && prob(75))
target_wall.add_dent(WALL_DENT_SHOT, hitx, hity)

return BULLET_ACT_HIT
//monkestation edit end

var/mob/living/living_target = target

Expand Down
Loading