Nanopaste now can repair mecha (#25251)

* Nanopaste now can repair mecha

* Update nanopaste.dm

* refactor mech code

* fix

* Update code/game/objects/items/stacks/nanopaste.dm

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
Signed-off-by: Сиротка <114731039+ErdGinalD@users.noreply.github.com>

* Update nanopaste.dm

* Update nanopaste.dm

* Update nanopaste.dm

* Update nanopaste.dm

* Update code/game/objects/items/stacks/nanopaste.dm

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Signed-off-by: Сиротка <114731039+ErdGinalD@users.noreply.github.com>

* Update nanopaste.dm

* Update code/game/objects/items/stacks/nanopaste.dm

Co-authored-by: Matt <116982774+Burzah@users.noreply.github.com>
Signed-off-by: Сиротка <114731039+ErdGinalD@users.noreply.github.com>

* Update code/game/mecha/mecha.dm

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Signed-off-by: Сиротка <114731039+ErdGinalD@users.noreply.github.com>

* Update code/game/objects/items/stacks/nanopaste.dm

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Signed-off-by: Сиротка <114731039+ErdGinalD@users.noreply.github.com>

---------

Signed-off-by: Сиротка <114731039+ErdGinalD@users.noreply.github.com>
Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Co-authored-by: Matt <116982774+Burzah@users.noreply.github.com>
Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com>
This commit is contained in:
Сиротка
2024-05-23 00:57:37 +00:00
committed by GitHub
co-authored by Henri215 DGamerL Matt S34N
parent d32d6ee9eb
commit ccf5ef4fc4
4 changed files with 98 additions and 76 deletions
+23 -1
View File
@@ -18,7 +18,7 @@
if(R.getBruteLoss() || R.getFireLoss())
R.heal_overall_damage(15, 15)
use(1)
user.visible_message("<span class='notice'>\The [user] applied some [src] at [R]'s damaged areas.</span>",\
user.visible_message("<span class='notice'>[user] applies some [src] at [R]'s damaged areas.</span>",\
"<span class='notice'>You apply some [src] at [R]'s damaged areas.</span>")
else
to_chat(user, "<span class='notice'>All [R]'s systems are nominal.</span>")
@@ -32,6 +32,28 @@
else
to_chat(user, "<span class='notice'>[src] won't work on that.</span>")
/obj/item/stack/nanopaste/afterattack(atom/A, mob/user, proximity_flag)
if(!ismecha(A) || user.a_intent == INTENT_HARM || !proximity_flag)
return
var/obj/mecha/mecha = A
if((mecha.obj_integrity >= mecha.max_integrity) && !mecha.internal_damage)
to_chat(user, "<span class='notice'>[mecha] is at full integrity!</span>")
return
if(mecha.state == MECHA_MAINT_OFF)
to_chat(user, "<span class='warning'>[mecha] cannot be repaired without maintenance protocols active!</span>")
return
if(mecha.repairing)
to_chat(user, "<span class='notice'>[mecha] is currently being repaired!</span>")
return
if(mecha.internal_damage & MECHA_INT_TANK_BREACH)
mecha.clearInternalDamage(MECHA_INT_TANK_BREACH)
user.visible_message("<span class='notice'>[user] repairs the damaged air tank.</span>", "<span class='notice'>You repair the damaged air tank.</span>")
else if(mecha.obj_integrity < mecha.max_integrity)
mecha.obj_integrity += min(20, mecha.max_integrity - mecha.obj_integrity)
use(1)
user.visible_message("<span class='notice'>[user] applies some [src] to [mecha]'s damaged areas.</span>",\
"<span class='notice'>You apply some [src] to [mecha]'s damaged areas.</span>")
/obj/item/stack/nanopaste/proc/robotic_limb_repair(mob/user, obj/item/organ/external/external_limb, mob/living/carbon/human/H)
if(!external_limb.get_damage())
to_chat(user, "<span class='notice'>Nothing to fix here.</span>")