mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-14 20:23:26 +00:00
Merge pull request #14859 from KillianKirilenko/kk-nanofix
Mech Nanopaste repairs fix
This commit is contained in:
committed by
CHOMPStation2
parent
f7eb1e0ec8
commit
dc9fca2f8a
@@ -138,12 +138,26 @@
|
||||
var/obj/item/stack/nanopaste/NP = W
|
||||
|
||||
if(integrity < max_integrity)
|
||||
to_chat(user, "<span class='notice'>You start to repair damage to \the [src].</span>")
|
||||
while(integrity < max_integrity && NP)
|
||||
if(do_after(user, 1 SECOND, src) && NP.use(1))
|
||||
adjust_integrity(10)
|
||||
if(do_after(user, 1 SECOND, src))
|
||||
NP.use(1)
|
||||
adjust_integrity(NP.mech_repair)
|
||||
|
||||
if(integrity >= max_integrity)
|
||||
to_chat(user, "<span class='notice'>You finish repairing \the [src].</span>")
|
||||
break
|
||||
|
||||
else if(NP.amount == 0)
|
||||
to_chat(user, "<span class='warning'>Insufficient nanopaste to complete repairs!</span>")
|
||||
break
|
||||
|
||||
|
||||
return
|
||||
|
||||
else
|
||||
to_chat(user, "<span class='notice'>\The [src] doesn't require repairs.</span>")
|
||||
|
||||
return ..()
|
||||
|
||||
// Various procs to handle different calls by Exosuits. IE, movement actions, damage actions, etc.
|
||||
|
||||
@@ -1567,15 +1567,27 @@
|
||||
for(var/slot in internal_components)
|
||||
var/obj/item/mecha_parts/component/C = internal_components[slot]
|
||||
|
||||
if(C)
|
||||
if(!C)
|
||||
to_chat(user, "<span class='notice'>There are no components installed!</span>")
|
||||
return
|
||||
|
||||
if(C.integrity < C.max_integrity)
|
||||
while(C.integrity < C.max_integrity && NP && do_after(user, 1 SECOND, src))
|
||||
if(NP.use(1))
|
||||
C.adjust_integrity(10)
|
||||
if(C.integrity >= C.max_integrity)
|
||||
to_chat(user, "<span class='notice'>\The [C] does not require repairs.</span>")
|
||||
|
||||
to_chat(user, "<span class='notice'>You repair damage to \the [C].</span>")
|
||||
else if(C.integrity < C.max_integrity)
|
||||
to_chat(user, "<span class='notice'>You start to repair damage to \the [C].</span>")
|
||||
while(C.integrity < C.max_integrity && NP)
|
||||
if(do_after(user, 1 SECOND, src))
|
||||
NP.use(1)
|
||||
C.adjust_integrity(NP.mech_repair)
|
||||
|
||||
if(C.integrity >= C.max_integrity)
|
||||
to_chat(user, "<span class='notice'>You finish repairing \the [C].</span>")
|
||||
break
|
||||
|
||||
else if(NP.amount == 0)
|
||||
to_chat(user, "<span class='warning'>Insufficient nanopaste to complete repairs!</span>")
|
||||
break
|
||||
return
|
||||
|
||||
else
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
var/restoration_external = 5
|
||||
var/restoration_internal = 20
|
||||
var/repair_external = FALSE
|
||||
var/mech_repair = 10
|
||||
|
||||
/obj/item/stack/nanopaste/advanced
|
||||
name = "advanced nanopaste"
|
||||
@@ -11,3 +12,4 @@
|
||||
icon_state = "adv_nanopaste"
|
||||
restoration_external = 10
|
||||
repair_external = TRUE
|
||||
mech_repair = 20
|
||||
@@ -17,7 +17,7 @@
|
||||
center_of_mass = null
|
||||
var/list/datum/stack_recipe/recipes
|
||||
var/singular_name
|
||||
VAR_PROTECTED/amount = 1
|
||||
var/amount = 1
|
||||
var/max_amount //also see stack recipes initialisation, param "max_res_amount" must be equal to this max_amount
|
||||
var/stacktype //determines whether different stack types can merge
|
||||
var/build_type = null //used when directly applied to a turf
|
||||
|
||||
Reference in New Issue
Block a user