Skip to content

Commit

Permalink
erm
Browse files Browse the repository at this point in the history
  • Loading branch information
ihatethisengine committed Jul 27, 2023
1 parent 6e84aba commit e05f633
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions code/game/objects/structures/barricade/deployable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -204,19 +204,24 @@
if(user.action_busy)
return

var/obj/item/tool/weldingtool/welder = item
if(min(stack_health) == maxhealth)
var/need_repairs = 0
for(var/counter in 1 to length(stack_health))
if(stack_health[counter] < maxhealth)
need_repairs++

if(!need_repairs)
to_chat(user, SPAN_WARNING("[src.singular_name] doesn't need repairs."))
return

var/obj/item/tool/weldingtool/welder = item
if(!(welder.remove_fuel(2, user)))
return

user.visible_message(SPAN_NOTICE("[user] begins repairing damage to [src]."),
SPAN_NOTICE("You begin repairing the damage to [src]."))
playsound(src.loc, 'sound/items/Welder2.ogg', 25, TRUE)

var/welding_time = (skillcheck(user, SKILL_CONSTRUCTION, SKILL_CONSTRUCTION_TRAINED) ? 5 SECONDS : 10 SECONDS) * amount
var/welding_time = (skillcheck(user, SKILL_CONSTRUCTION, SKILL_CONSTRUCTION_TRAINED) ? 5 SECONDS : 10 SECONDS) * need_repairs

if(src != user.get_inactive_hand())
if(!do_after(user, welding_time, INTERRUPT_NO_NEEDHAND|BEHAVIOR_IMMOBILE, BUSY_ICON_FRIENDLY, src))
Expand Down

0 comments on commit e05f633

Please sign in to comment.