Skip to content

Commit

Permalink
some final clean up before a test...
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien committed Jan 31, 2024
1 parent 686dc84 commit 3250b1f
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 15 deletions.
29 changes: 19 additions & 10 deletions code/game/objects/structures/barricade/barricade.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,28 @@
climbable = TRUE
anchored = TRUE
density = TRUE
throwpass = TRUE //You can throw objects over this, despite its density.
/// You can throw objects over this, despite its density.
throwpass = TRUE
layer = BELOW_OBJ_LAYER
flags_atom = ON_BORDER
var/stack_type //The type of stack the barricade dropped when disassembled if any.
var/stack_amount = 5 //The amount of stack dropped when disassembled at full health
var/destroyed_stack_amount //to specify a non-zero amount of stack to drop when destroyed
/// The type of stack the barricade dropped when disassembled if any.
var/stack_type
/// The amount of stack dropped when disassembled at full health
var/stack_amount = 5
/// to specify a non-zero amount of stack to drop when destroyed
var/destroyed_stack_amount
health = 100 //Pretty tough. Changes sprites at 300 and 150
var/maxhealth = 100 //Basic code functions
var/maxhealth = 100
/// Used for calculating some stuff related to maxhealth as it constantly changes due to e.g. barbed wire. set to 100 to avoid possible divisions by zero
var/starting_maxhealth = 100
var/crusher_resistant = TRUE //Whether a crusher can ram through it.
var/force_level_absorption = 5 //How much force an item needs to even damage it at all.
/// Whether a crusher can ram through it.
var/crusher_resistant = TRUE
/// How much force an item needs to even damage it at all.
var/force_level_absorption = 5
var/barricade_hitsound
var/barricade_type = "barricade" //"metal", "plasteel", etc.
var/wire_icon = 'icons/obj/structures/barricades.dmi' //! Icon file used for the wiring
/// ! Icon file used for the wiring
var/wire_icon = 'icons/obj/structures/barricades.dmi'
var/can_change_dmg_state = TRUE
var/damage_state = BARRICADE_DMG_NONE
var/closed = FALSE
Expand All @@ -36,7 +43,7 @@
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
var/welder_fix = null

/obj/structure/barricade/Initialize(mapload, mob/user)
. = ..()
Expand Down Expand Up @@ -469,7 +476,8 @@
nailgun.load_into_chamber()
return TRUE

// testing making a prop
// testing making a prop the idea is to regroup all the check that would cancel a repair into this prop..
// put it after iswelder check... for repair on installed cades...

/obj/structure/barricade/proc/attackby_welder(obj/item/item, mob/user)
if(!HAS_TRAIT(item, TRAIT_TOOL_BLOWTORCH))
Expand All @@ -481,6 +489,7 @@
return

if(user.action_busy)
to_chat(user, SPAN_WARNING("You are currently doing something else"))
return

if(damage_state == welder_fix && damage_state != null)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/structures/barricade/deployable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
/obj/structure/barricade/deployable/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)

var/obj/item/tool/weldingtool/welder = item
weld_cade(welder, user)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/structures/barricade/metal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

/obj/structure/barricade/metal/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)

if(!skillcheck(user, SKILL_ENGINEER, SKILL_ENGINEER_TRAINED))
to_chat(user, SPAN_WARNING("You're not trained to repair [src]..."))
Expand Down
8 changes: 5 additions & 3 deletions code/game/objects/structures/barricade/plasteel.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@
repair_materials = list("plasteel" = 0.3)

var/build_state = BARRICADE_BSTATE_SECURED //Look at __game.dm for barricade defines
var/tool_cooldown = 0 //Delay to apply tools to prevent spamming
var/busy = FALSE //Standard busy check
/// Delay to apply tools to prevent spamming
var/tool_cooldown = 0
/// Standard busy check
var/busy = FALSE
var/linked = 0
var/recentlyflipped = FALSE
var/hasconnectionoverlay = TRUE
Expand Down Expand Up @@ -65,7 +67,7 @@

/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 test that return.
attackby_welder(item, user)

if(!skillcheck(user, SKILL_ENGINEER, SKILL_ENGINEER_TRAINED))
to_chat(user, SPAN_WARNING("You're not trained to repair [src]..."))
Expand Down

0 comments on commit 3250b1f

Please sign in to comment.