mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-20 11:40:07 +01:00
Converts most spans into span procs. Mostly used regex for this and sorted out any compile time errors afterwards so there could be some bugs. Was initially going to do defines, but ninja said to make it into a proc, and if there's any overhead, they can easily be changed to defines. Makes it easier to control the formatting and prevents typos when creating spans as it'll runtime if you misspell instead of silently failing. Reduces the code you need to write when writing spans, as you don't need to close the span as that's automatically handled by the proc. (Note from Lemon: This should be converted to defines once we update the minimum version to 514. Didn't do it now because byond pain and such)
55 lines
2.3 KiB
Plaintext
55 lines
2.3 KiB
Plaintext
///AI Upgrades
|
|
|
|
|
|
//Malf Picker
|
|
/obj/item/malf_upgrade
|
|
name = "combat software upgrade"
|
|
desc = "A highly illegal, highly dangerous upgrade for artificial intelligence units, granting them a variety of powers as well as the ability to hack APCs.<br>This upgrade does not override any active laws, and must be applied directly to an active AI core."
|
|
icon = 'icons/obj/module.dmi'
|
|
icon_state = "datadisk3"
|
|
|
|
|
|
/obj/item/malf_upgrade/pre_attack(atom/A, mob/living/user, proximity)
|
|
if(!proximity)
|
|
return ..()
|
|
if(!isAI(A))
|
|
return ..()
|
|
var/mob/living/silicon/ai/AI = A
|
|
if(AI.malf_picker)
|
|
AI.malf_picker.processing_time += 50
|
|
to_chat(AI, span_userdanger("[user] has attempted to upgrade you with combat software that you already possess. You gain 50 points to spend on Malfunction Modules instead."))
|
|
else
|
|
to_chat(AI, span_userdanger("[user] has upgraded you with combat software!"))
|
|
to_chat(AI, span_userdanger("Your current laws and objectives remain unchanged.")) //this unlocks malf powers, but does not give the license to plasma flood
|
|
AI.add_malf_picker()
|
|
AI.hack_software = TRUE
|
|
log_game("[key_name(user)] has upgraded [key_name(AI)] with a [src].")
|
|
message_admins("[ADMIN_LOOKUPFLW(user)] has upgraded [ADMIN_LOOKUPFLW(AI)] with a [src].")
|
|
to_chat(user, span_notice("You upgrade [AI]. [src] is consumed in the process."))
|
|
qdel(src)
|
|
return TRUE
|
|
|
|
|
|
//Lipreading
|
|
/obj/item/surveillance_upgrade
|
|
name = "surveillance software upgrade"
|
|
desc = "An illegal software package that will allow an artificial intelligence to 'hear' from its cameras via lip reading and hidden microphones."
|
|
icon = 'icons/obj/module.dmi'
|
|
icon_state = "datadisk3"
|
|
|
|
/obj/item/surveillance_upgrade/pre_attack(atom/A, mob/living/user, proximity)
|
|
if(!proximity)
|
|
return ..()
|
|
if(!isAI(A))
|
|
return ..()
|
|
var/mob/living/silicon/ai/AI = A
|
|
if(AI.eyeobj)
|
|
AI.eyeobj.relay_speech = TRUE
|
|
to_chat(AI, span_userdanger("[user] has upgraded you with surveillance software!"))
|
|
to_chat(AI, "Via a combination of hidden microphones and lip reading software, you are able to use your cameras to listen in on conversations.")
|
|
to_chat(user, span_notice("You upgrade [AI]. [src] is consumed in the process."))
|
|
log_game("[key_name(user)] has upgraded [key_name(AI)] with a [src].")
|
|
message_admins("[ADMIN_LOOKUPFLW(user)] has upgraded [ADMIN_LOOKUPFLW(AI)] with a [src].")
|
|
qdel(src)
|
|
return TRUE
|