Mechs can now only be repaired once every 1.5 seconds

This commit is contained in:
joep van der velden
2018-10-29 20:01:22 +01:00
parent 3bf765208b
commit b5b3fca2af

View File

@@ -43,6 +43,8 @@
var/lights_power = 6
var/emagged = FALSE
var/list/repairers = new
//inner atmos
var/use_internal_tank = 0
var/internal_tank_valve = ONE_ATMOSPHERE
@@ -778,15 +780,22 @@
var/obj/item/weldingtool/WT = W
if(health<initial(health))
if (WT.remove_fuel(0,user))
if (internal_damage & MECHA_INT_TANK_BREACH)
clearInternalDamage(MECHA_INT_TANK_BREACH)
to_chat(user, "<span class='notice'>You repair the damaged gas tank.</span>")
if(!(user in repairers)) // Can only repair it once at a time
repairers += user
user.visible_message("<span class='notice'>[user] starts repairing some damage to [name].</span>", "<span class='notice'>You start repairing some damage to [name]</span>")
playsound(user, WT.usesound, 50, 1)
if(do_after(user, 15 * WT.toolspeed, target = src)) // Takes 1.5 seconds to repair
if (internal_damage & MECHA_INT_TANK_BREACH)
clearInternalDamage(MECHA_INT_TANK_BREACH)
user.visible_message("<span class='notice'>[user] repairs the damaged gas tank.</span>", "<span class='notice'>You repair the damaged gas tank.</span>")
else
user.visible_message("<span class='notice'>[user] repairs some damage to [name].</span>", "<span class='notice'>You repair some damage to [name]</span>")
health += min(10, initial(health)-health)
repairers -= user
else
user.visible_message("<span class='notice'>[user] repairs some damage to [name].</span>")
health += min(10, initial(health)-health)
to_chat(user, "<span class='warning'>You are already repairing [name]!</span>")
else
to_chat(user, "<span class='warning'>The welder must be on for this task!</span>")
return 1
else
to_chat(user, "<span class='warning'>The [name] is at full integrity!</span>")
return 1