Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 44 additions & 32 deletions code/game/objects/items/stacks/nanopaste.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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

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 (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))
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 [A]'s systems are nominal."))
return FALSE

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(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
Expand Down Expand Up @@ -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"]
Expand All @@ -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
Expand All @@ -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(
Expand All @@ -161,7 +173,7 @@
)

if (!do_mob(user, M, 2))
return 0
return FALSE

s.surge_left = rand(2, 5)
s.broken = 0
Expand All @@ -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
4 changes: 3 additions & 1 deletion code/modules/mob/living/silicon/ai/ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
59 changes: 59 additions & 0 deletions html/changelogs/Ben10083 - AI Core Fixes.yml
Original file line number Diff line number Diff line change
@@ -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 changes: 4 additions & 0 deletions maps/sccv_horizon/sccv_horizon.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -154793,6 +154793,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" = (
Expand Down
Loading