Skip to content

Commit

Permalink
integrate a variable to handle damage beyond you can't fix the barric…
Browse files Browse the repository at this point in the history
…ade with an welder.
  • Loading branch information
Julien committed Jan 31, 2024
1 parent 039de6b commit 686dc84
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
6 changes: 6 additions & 0 deletions code/game/objects/structures/barricade/barricade.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
var/burn_flame_multiplier = 1
var/repair_materials = list()
var/metallic = TRUE
/// var that say what state a barricade can't be fix by welder. null mean it can be repair no matter the state.
var/welder_fix

/obj/structure/barricade/Initialize(mapload, mob/user)
. = ..()
Expand Down Expand Up @@ -480,3 +482,7 @@

if(user.action_busy)
return

if(damage_state == welder_fix && damage_state != null)
to_chat(user, SPAN_WARNING("[src] has sustained too much structural damage to be repaired."))
return
5 changes: 2 additions & 3 deletions code/game/objects/structures/barricade/metal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
var/build_state = BARRICADE_BSTATE_SECURED //Look at __game.dm for barricade defines
var/upgrade = null

welder_fix = BARRICADE_DMG_HEAVY

/obj/structure/barricade/metal/update_icon()
. = ..()
if(dir > 2)
Expand Down Expand Up @@ -46,9 +48,6 @@
if(iswelder(item))
attackby_welder(item, user)// the idea is to replace a bunch of repetitive task with a prop

if(damage_state == BARRICADE_DMG_HEAVY)
to_chat(user, SPAN_WARNING("[src] has sustained too much structural damage to be repaired."))
return
if(!skillcheck(user, SKILL_ENGINEER, SKILL_ENGINEER_TRAINED))
to_chat(user, SPAN_WARNING("You're not trained to repair [src]..."))
return
Expand Down
6 changes: 2 additions & 4 deletions code/game/objects/structures/barricade/plasteel.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
var/recentlyflipped = FALSE
var/hasconnectionoverlay = TRUE
var/linkable = TRUE
welder_fix = BARRICADE_DMG_HEAVY

/obj/structure/barricade/plasteel/update_icon()
..()
Expand Down Expand Up @@ -64,11 +65,8 @@

/obj/structure/barricade/plasteel/attackby(obj/item/item, mob/user)
if(iswelder(item))
attackby_welder(item, user)// the idea is to replace a bunch of repetitive task with a prop
attackby_welder(item, user)// the idea is to replace a bunch of repetitive test that return.

if(damage_state == BARRICADE_DMG_HEAVY)
to_chat(user, SPAN_WARNING("[src] has sustained too much structural damage to be repaired."))
return
if(!skillcheck(user, SKILL_ENGINEER, SKILL_ENGINEER_TRAINED))
to_chat(user, SPAN_WARNING("You're not trained to repair [src]..."))
return
Expand Down

0 comments on commit 686dc84

Please sign in to comment.