Small improvement to AI core area and attack code + AI Repairs (#21292)

- Adds missing blast door to AI Core Area
- Small improvement to AI attackby code
- Nanopaste now can repair AI, allowing AI to be repairable

---------

Signed-off-by: Ben <91219575+Ben10083@users.noreply.github.com>
Co-authored-by: Ben10083 <Ben10083@users.noreply.github.com>
Co-authored-by: Matt Atlas <mattiathebest2000@hotmail.it>
This commit is contained in:
Ben
2025-10-19 10:20:41 +00:00
committed by GitHub
co-authored by Ben10083 Matt Atlas
parent 5a1bd08d69
commit 05c0d5d084
4 changed files with 108 additions and 31 deletions
+42 -30
View File
@@ -36,35 +36,47 @@
var/application_time = time_to_apply // Local variant declared inside the proc so changes to it do not persist.
if(!ismob(target_mob) || !istype(user))
return 0
return FALSE
if (!can_use(1, user))
return 0
return FALSE
if(isrobot(target_mob) || isAI(target_mob))
if (isrobot(target_mob)) //Repairing cyborgs
var/mob/living/silicon/robot/R = target_mob
if (!R.getBruteLoss() && !R.getFireLoss())
to_chat(user, SPAN_NOTICE("All [R]'s systems are nominal."))
return FALSE
else if (isAI(target_mob)) //Repairing AIs
var/mob/living/silicon/ai/A = target_mob
if (!A.getBruteLoss() && !A.getFireLoss())
to_chat(user, SPAN_NOTICE("All of [A]'s systems are nominal."))
return FALSE
if (isrobot(target_mob)) //Repairing cyborgs
var/mob/living/silicon/robot/R = target_mob
if (R.getBruteLoss() || R.getFireLoss() )
if(target_mob == user)
application_time *= application_multiplier // It takes longer to apply nanopaste to yourself than to someone else.
if(target_mob == user)
application_time *= application_multiplier // It takes longer to apply nanopaste to yourself than to someone else.
if (application_in_progress == FALSE)
application_in_progress = TRUE
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
user.visible_message(SPAN_NOTICE("\The [user] begins to apply some [src] to \the [target_mob]."),\
SPAN_NOTICE("You begin to apply some [src] to \the [target_mob]."))
if(do_mob(user, target_mob, application_time))
if (application_in_progress == FALSE)
application_in_progress = TRUE
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
user.visible_message(SPAN_NOTICE("\The [user] begins to apply some [src] to \the [target_mob]."),\
SPAN_NOTICE("You begin to apply some [src] to \the [target_mob]."))
if(do_mob(user, target_mob, application_time))
if(isrobot(target_mob))
var/mob/living/silicon/robot/R = target_mob
R.adjustBruteLoss(-15)
R.adjustFireLoss(-15)
R.updatehealth()
use(1)
user.visible_message(SPAN_NOTICE("\The [user] successfully applies some [src] at [R]'s damaged areas."),\
SPAN_NOTICE("You successfully apply some [src] at [R]'s damaged areas."))
application_in_progress = FALSE
else
to_chat(user, SPAN_WARNING("You are too focused applying \the [src] to do it multiple times simultaneously!"))
else if(isAI(target_mob))
var/mob/living/silicon/ai/A = target_mob
A.adjustBruteLoss(-15)
A.adjustFireLoss(-15)
A.updatehealth()
use(1)
user.visible_message(SPAN_NOTICE("\The [user] successfully applies some [src] on [target_mob]'s damaged areas."),\
SPAN_NOTICE("You successfully apply some [src] on [target_mob]'s damaged areas."))
application_in_progress = FALSE
else
to_chat(user, SPAN_NOTICE("All [R]'s systems are nominal."))
to_chat(user, SPAN_WARNING("You are too focused applying \the [src] to do it multiple times simultaneously!"))
else if(ishuman(target_mob)) //Repairing robolimbs
var/mob/living/carbon/human/H = target_mob
@@ -125,11 +137,11 @@
/obj/item/stack/nanopaste/surge/attack(mob/living/target_mob, mob/living/user, target_zone)
var/mob/living/carbon/human/M = target_mob
if (!istype(M) || !istype(user))
return 0
return FALSE
if(used)
to_chat(user, SPAN_WARNING("[src] has depleted it's nanites."))
return 0
return FALSE
if (isipc(M))
var/obj/item/organ/internal/surge/s = M.internal_organs_by_name["surge"]
@@ -140,7 +152,7 @@
)
if (!do_mob(user, M, 2))
return 0
return FALSE
s = new /obj/item/organ/internal/surge()
M.internal_organs += s
@@ -152,7 +164,7 @@
to_chat(M, SPAN_NOTICE("You can feel nanites inside you creating something new. An internal OS voice states \"Warning: surge prevention module has been installed, it has [s.surge_left] preventions left!\""))
amount = 0
used = TRUE
return 1
return TRUE
else
if(!s.surge_left)
user.visible_message(
@@ -161,7 +173,7 @@
)
if (!do_mob(user, M, 2))
return 0
return FALSE
s.surge_left = rand(2, 5)
s.broken = 0
@@ -174,10 +186,10 @@
to_chat(M, SPAN_NOTICE("You can feel nanites inside you regenerating your surge prevention module. An internal OS voice states \"Warning: surge prevention module repaired, it has [s.surge_left] preventions left!\""))
amount = 0
used = TRUE
return 1
return TRUE
to_chat(user, SPAN_WARNING("[(M == user) ? ("You already have") : ("[M] already has")] fully functional surge prevention module installed."))
return 0
return FALSE
else
to_chat(user, SPAN_WARNING("[src]'s nanites refuse to work on [(M == user) ? ("you") : (M)]."))
return 0
return FALSE
+3 -1
View File
@@ -779,8 +779,10 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
/mob/living/silicon/ai/attackby(obj/item/attacking_item, mob/user)
if(istype(attacking_item, /obj/item/aicard))
if(user.a_intent == I_HURT) // So you can attack an AI with a wrench, if you really wanted to.
return ..()
if(istype(attacking_item, /obj/item/aicard))
var/obj/item/aicard/card = attacking_item
card.grab_ai(src, user)
@@ -0,0 +1,59 @@
################################
# Example Changelog File
#
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
#
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
# When it is, any changes listed below will disappear.
#
# Valid Prefixes:
# bugfix
# - (fixes bugs)
# wip
# - (work in progress)
# qol
# - (quality of life)
# soundadd
# - (adds a sound)
# sounddel
# - (removes a sound)
# rscadd
# - (adds a feature)
# rscdel
# - (removes a feature)
# imageadd
# - (adds an image or sprite)
# imagedel
# - (removes an image or sprite)
# spellcheck
# - (fixes spelling or grammar)
# experiment
# - (experimental change)
# balance
# - (balance changes)
# code_imp
# - (misc internal code change)
# refactor
# - (refactors code)
# config
# - (makes a change to the config files)
# admin
# - (makes changes to administrator tools)
# server
# - (miscellaneous changes to server)
#################################
# Your name.
author: Ben10083
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
delete-after: True
# Any changes you've made. See valid prefix list above.
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
# SCREW THIS UP AND IT WON'T WORK.
# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit.
# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog.
changes:
- rscadd: "AI can can now be fixed with Nanopaste."
- bugfix: "Adds missing blast door to AI Core area."
+4
View File
@@ -155377,6 +155377,10 @@
/obj/structure/cable/green{
icon_state = "4-8"
},
/obj/machinery/door/blast/regular/open{
id = "AICore";
name = "AI Core Blast Door"
},
/turf/simulated/floor/tiled/dark,
/area/horizon/ai/upload)
"vXL" = (