Merge pull request #14859 from KillianKirilenko/kk-nanofix

Mech Nanopaste repairs fix
This commit is contained in:
Heroman3003
2023-05-20 04:56:34 +10:00
committed by CHOMPStation2
parent f7eb1e0ec8
commit dc9fca2f8a
4 changed files with 38 additions and 10 deletions

View File

@@ -138,12 +138,26 @@
var/obj/item/stack/nanopaste/NP = W var/obj/item/stack/nanopaste/NP = W
if(integrity < max_integrity) if(integrity < max_integrity)
to_chat(user, "<span class='notice'>You start to repair damage to \the [src].</span>")
while(integrity < max_integrity && NP) while(integrity < max_integrity && NP)
if(do_after(user, 1 SECOND, src) && NP.use(1)) if(do_after(user, 1 SECOND, src))
adjust_integrity(10) 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 return
else
to_chat(user, "<span class='notice'>\The [src] doesn't require repairs.</span>")
return ..() return ..()
// Various procs to handle different calls by Exosuits. IE, movement actions, damage actions, etc. // Various procs to handle different calls by Exosuits. IE, movement actions, damage actions, etc.

View File

@@ -1567,15 +1567,27 @@
for(var/slot in internal_components) for(var/slot in internal_components)
var/obj/item/mecha_parts/component/C = internal_components[slot] 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) if(C.integrity >= C.max_integrity)
while(C.integrity < C.max_integrity && NP && do_after(user, 1 SECOND, src)) to_chat(user, "<span class='notice'>\The [C] does not require repairs.</span>")
if(NP.use(1))
C.adjust_integrity(10)
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 return
else else

View File

@@ -2,6 +2,7 @@
var/restoration_external = 5 var/restoration_external = 5
var/restoration_internal = 20 var/restoration_internal = 20
var/repair_external = FALSE var/repair_external = FALSE
var/mech_repair = 10
/obj/item/stack/nanopaste/advanced /obj/item/stack/nanopaste/advanced
name = "advanced nanopaste" name = "advanced nanopaste"
@@ -10,4 +11,5 @@
icon = 'icons/obj/stacks_vr.dmi' icon = 'icons/obj/stacks_vr.dmi'
icon_state = "adv_nanopaste" icon_state = "adv_nanopaste"
restoration_external = 10 restoration_external = 10
repair_external = TRUE repair_external = TRUE
mech_repair = 20

View File

@@ -17,7 +17,7 @@
center_of_mass = null center_of_mass = null
var/list/datum/stack_recipe/recipes var/list/datum/stack_recipe/recipes
var/singular_name 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/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/stacktype //determines whether different stack types can merge
var/build_type = null //used when directly applied to a turf var/build_type = null //used when directly applied to a turf