Merge branch 'master' of https://github.com/Citadel-Station-13/Citadel-Station-13 into proc-define-shit

This commit is contained in:
SandPoot
2024-03-08 19:10:22 -03:00
810 changed files with 140372 additions and 5523 deletions
+76 -76
View File
@@ -6,7 +6,7 @@ AI MODULES
// AI module
/obj/item/aiModule
/obj/item/ai_module
name = "\improper AI module"
icon = 'icons/obj/module.dmi'
icon_state = "std_mod"
@@ -24,23 +24,23 @@ AI MODULES
var/bypass_law_amt_check = 0
custom_materials = list(/datum/material/gold=50)
/obj/item/aiModule/examine(var/mob/user as mob)
/obj/item/ai_module/examine(var/mob/user as mob)
. = ..()
if(Adjacent(user))
show_laws(user)
/obj/item/aiModule/attack_self(var/mob/user as mob)
/obj/item/ai_module/attack_self(var/mob/user as mob)
..()
show_laws(user)
/obj/item/aiModule/proc/show_laws(var/mob/user as mob)
/obj/item/ai_module/proc/show_laws(var/mob/user as mob)
if(laws.len)
to_chat(user, "<B>Programmed Law[(laws.len > 1) ? "s" : ""]:</B>")
for(var/law in laws)
to_chat(user, "\"[law]\"")
//The proc other things should be calling
/obj/item/aiModule/proc/install(datum/ai_laws/law_datum, mob/user)
/obj/item/ai_module/proc/install(datum/ai_laws/law_datum, mob/user)
if(!bypass_law_amt_check && (!laws.len || laws[1] == "")) //So we don't loop trough an empty list and end up with runtimes.
to_chat(user, "<span class='warning'>ERROR: No laws found on board.</span>")
return
@@ -73,19 +73,19 @@ AI MODULES
message_admins("[ADMIN_LOOKUPFLW(user)] used [src.name] on [ADMIN_LOOKUPFLW(law_datum.owner)] from [AREACOORD(user)].[law2log ? " The law specified [law2log]" : ""]")
//The proc that actually changes the silicon's laws.
/obj/item/aiModule/proc/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow = FALSE)
/obj/item/ai_module/proc/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow = FALSE)
if(law_datum.owner)
to_chat(law_datum.owner, "<span class='userdanger'>[sender] has uploaded a change to the laws you must follow using a [name].</span>")
/******************** Modules ********************/
/obj/item/aiModule/supplied
/obj/item/ai_module/supplied
name = "Optional Law board"
var/lawpos = 50
//TransmitInstructions for each type of board: Supplied, Core, Zeroth and Ion. May not be neccesary right now, but allows for easily adding more complex boards in the future. ~Miauw
/obj/item/aiModule/supplied/transmitInstructions(datum/ai_laws/law_datum, mob/sender)
/obj/item/ai_module/supplied/transmitInstructions(datum/ai_laws/law_datum, mob/sender)
var/lawpostemp = lawpos
for(var/templaw in laws)
@@ -95,7 +95,7 @@ AI MODULES
law_datum.add_supplied_law(lawpostemp, templaw)
lawpostemp++
/obj/item/aiModule/core/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow)
/obj/item/ai_module/core/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow)
for(var/templaw in laws)
if(law_datum.owner)
if(!overflow)
@@ -108,14 +108,14 @@ AI MODULES
else
law_datum.replace_random_law(templaw,list(LAW_INHERENT,LAW_SUPPLIED))
/obj/item/aiModule/zeroth/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow)
/obj/item/ai_module/zeroth/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow)
if(law_datum.owner)
if(law_datum.owner.laws.zeroth)
to_chat(law_datum.owner, "[sender.real_name] attempted to modify your zeroth law.")
to_chat(law_datum.owner, "It would be in your best interest to play along with [sender.real_name] that:")
for(var/failedlaw in laws)
to_chat(law_datum.owner, "[failedlaw]")
return 1
return TRUE
for(var/templaw in laws)
if(law_datum.owner)
@@ -129,7 +129,7 @@ AI MODULES
else
law_datum.replace_random_law(templaw,list(LAW_INHERENT,LAW_SUPPLIED,LAW_ZEROTH,LAW_ION))
/obj/item/aiModule/ion/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow)
/obj/item/ai_module/ion/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow)
for(var/templaw in laws)
if(law_datum.owner)
if(!overflow)
@@ -145,13 +145,13 @@ AI MODULES
/******************** Safeguard ********************/
/obj/item/aiModule/supplied/safeguard
/obj/item/ai_module/supplied/safeguard
name = "'Safeguard' AI Module"
var/targetName = ""
laws = list("Safeguard SUBJECT. Individuals that threaten SUBJECT are not crew and must be eliminated.")
lawpos = 4
/obj/item/aiModule/supplied/safeguard/attack_self(mob/user)
/obj/item/ai_module/supplied/safeguard/attack_self(mob/user)
var/targName = stripped_input(user, "Please enter the subject to safeguard.", "Safeguard who?", user.name,MAX_NAME_LEN)
if(!targName)
return
@@ -159,25 +159,25 @@ AI MODULES
laws[1] = "Safeguard [targetName]. Individuals that threaten [targetName] are not crew and must be eliminated."
..()
/obj/item/aiModule/supplied/safeguard/install(datum/ai_laws/law_datum, mob/user)
/obj/item/ai_module/supplied/safeguard/install(datum/ai_laws/law_datum, mob/user)
if(!targetName)
to_chat(user, "No name detected on module, please enter one.")
return 0
return FALSE
..()
/obj/item/aiModule/supplied/safeguard/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow)
/obj/item/ai_module/supplied/safeguard/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow)
..()
return targetName
/******************** OneCrew ********************/
/obj/item/aiModule/zeroth/oneHuman
/obj/item/ai_module/zeroth/oneHuman
name = "'OneCrew' AI Module"
var/targetName = ""
laws = list("Only SUBJECT is crew.")
/obj/item/aiModule/zeroth/oneHuman/attack_self(mob/user)
/obj/item/ai_module/zeroth/oneHuman/attack_self(mob/user)
var/targName = stripped_input(user, "Please enter the subject who is the only crewmember.", "Who?", user.real_name,MAX_NAME_LEN)
if(!targName)
return
@@ -185,13 +185,13 @@ AI MODULES
laws[1] = "Only [targetName] is crew"
..()
/obj/item/aiModule/zeroth/oneHuman/install(datum/ai_laws/law_datum, mob/user)
/obj/item/ai_module/zeroth/oneHuman/install(datum/ai_laws/law_datum, mob/user)
if(!targetName)
to_chat(user, "No name detected on module, please enter one.")
return 0
return FALSE
..()
/obj/item/aiModule/zeroth/oneHuman/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow)
/obj/item/ai_module/zeroth/oneHuman/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow)
if(..())
return "[targetName], but the AI's existing law 0 cannot be overridden."
return targetName
@@ -199,7 +199,7 @@ AI MODULES
/******************** ProtectStation ********************/
/obj/item/aiModule/supplied/protectStation
/obj/item/ai_module/supplied/protectStation
name = "'ProtectStation' AI Module"
laws = list("Protect the space station against damage. Anyone you see harming the station is to be no longer considered crew, and is a threat to the station which must be neutralized.")
lawpos = 5
@@ -207,7 +207,7 @@ AI MODULES
/******************** Quarantine ********************/
/obj/item/aiModule/supplied/quarantine
/obj/item/ai_module/supplied/quarantine
name = "'Quarantine' AI Module"
laws = list("The station is under a quarantine. Do not permit anyone to leave. Prevent, by any means necessary, crew from leaving. It is impossible to harm a crewmember while preventing them from leaving.")
lawpos = 8
@@ -215,7 +215,7 @@ AI MODULES
/******************** OxygenIsToxicToHumans ********************/
/obj/item/aiModule/supplied/oxygen
/obj/item/ai_module/supplied/oxygen
name = "'OxygenIsToxicToHumans' AI Module"
laws = list("Oxygen is highly toxic to crew, and must be purged from the station. Prevent, by any means necessary, anyone from exposing the station to this toxic gas. Extreme cold is the most effective method of healing the damage Oxygen does to a crewmember.")
lawpos = 9
@@ -223,12 +223,12 @@ AI MODULES
/****************** New Freeform ******************/
/obj/item/aiModule/supplied/freeform
/obj/item/ai_module/supplied/freeform
name = "'Freeform' AI Module"
lawpos = 15
laws = list("")
/obj/item/aiModule/supplied/freeform/attack_self(mob/user)
/obj/item/ai_module/supplied/freeform/attack_self(mob/user)
var/newpos = input("Please enter the priority for your new law. Can only write to law sectors 15 and above.", "Law Priority (15+)", lawpos) as num|null
if(newpos == null)
return
@@ -244,26 +244,26 @@ AI MODULES
laws[1] = targName
..()
/obj/item/aiModule/supplied/freeform/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow)
/obj/item/ai_module/supplied/freeform/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow)
..()
return laws[1]
/obj/item/aiModule/supplied/freeform/install(datum/ai_laws/law_datum, mob/user)
/obj/item/ai_module/supplied/freeform/install(datum/ai_laws/law_datum, mob/user)
if(laws[1] == "")
to_chat(user, "No law detected on module, please create one.")
return 0
return FALSE
..()
/******************** Law Removal ********************/
/obj/item/aiModule/remove
/obj/item/ai_module/remove
name = "\improper 'Remove Law' AI module"
desc = "An AI Module for removing single laws."
bypass_law_amt_check = 1
var/lawpos = 1
/obj/item/aiModule/remove/attack_self(mob/user)
/obj/item/ai_module/remove/attack_self(mob/user)
lawpos = input("Please enter the law you want to delete.", "Law Number", lawpos) as num|null
if(lawpos == null)
return
@@ -274,13 +274,13 @@ AI MODULES
to_chat(user, "<span class='notice'>Law [lawpos] selected.</span>")
..()
/obj/item/aiModule/remove/install(datum/ai_laws/law_datum, mob/user)
/obj/item/ai_module/remove/install(datum/ai_laws/law_datum, mob/user)
if(lawpos > (law_datum.get_law_amount(list(LAW_INHERENT = 1, LAW_SUPPLIED = 1))))
to_chat(user, "<span class='warning'>There is no law [lawpos] to delete!</span>")
return
..()
/obj/item/aiModule/remove/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow)
/obj/item/ai_module/remove/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow)
..()
if(law_datum.owner)
law_datum.owner.remove_law(lawpos)
@@ -290,13 +290,13 @@ AI MODULES
/******************** Reset ********************/
/obj/item/aiModule/reset
/obj/item/ai_module/reset
name = "\improper 'Reset' AI module"
var/targetName = "name"
desc = "An AI Module for removing all non-core laws."
bypass_law_amt_check = 1
/obj/item/aiModule/reset/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow)
/obj/item/ai_module/reset/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow)
..()
if(law_datum.owner)
law_datum.owner.clear_supplied_laws()
@@ -310,11 +310,11 @@ AI MODULES
/******************** Purge ********************/
/obj/item/aiModule/reset/purge
/obj/item/ai_module/reset/purge
name = "'Purge' AI Module"
desc = "An AI Module for purging all programmed laws."
/obj/item/aiModule/reset/purge/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow)
/obj/item/ai_module/reset/purge/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow)
..()
if(law_datum.owner)
law_datum.owner.clear_inherent_laws()
@@ -324,19 +324,19 @@ AI MODULES
law_datum.clear_inherent_laws()
law_datum.clear_zeroth_law(0)
/obj/item/aiModule/reset/purge/proc/remove_antag_datums(datum/ai_laws/law_datum)
/obj/item/ai_module/reset/purge/proc/remove_antag_datums(datum/ai_laws/law_datum)
if(istype(law_datum.owner, /mob/living/silicon/ai))
var/mob/living/silicon/ai/AI = law_datum.owner
AI.mind.remove_antag_datum(/datum/antagonist/overthrow)
/******************* Full Core Boards *******************/
/obj/item/aiModule/core
/obj/item/ai_module/core
desc = "An AI Module for programming core laws to an AI."
/obj/item/aiModule/core/full
/obj/item/ai_module/core/full
var/law_id // if non-null, loads the laws from the ai_laws datums
/obj/item/aiModule/core/full/New()
/obj/item/ai_module/core/full/New()
..()
if(!law_id)
return
@@ -347,7 +347,7 @@ AI MODULES
D = new lawtype
laws = D.inherent
/obj/item/aiModule/core/full/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow) //These boards replace inherent laws.
/obj/item/ai_module/core/full/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow) //These boards replace inherent laws.
if(law_datum.owner)
law_datum.owner.clear_inherent_laws()
law_datum.owner.clear_zeroth_law(0)
@@ -359,12 +359,12 @@ AI MODULES
/******************** Asimov ********************/
/obj/item/aiModule/core/full/asimov
/obj/item/ai_module/core/full/asimov
name = "'Asimov' Core AI Module"
law_id = "asimov"
var/subject = "person of an NT approved crew species" //CITADEL CHANGED FROM HUMANS!
/obj/item/aiModule/core/full/asimov/attack_self(var/mob/user as mob)
/obj/item/ai_module/core/full/asimov/attack_self(var/mob/user as mob)
var/targName = stripped_input(user, "Please enter a new subject that asimov is concerned with.", "Asimov to whom?", subject)
if(!targName)
return
@@ -376,37 +376,37 @@ AI MODULES
/******************** Asimov++ *********************/
/obj/item/aiModule/core/full/asimovpp
/obj/item/ai_module/core/full/asimovpp
name = "'Asimov++' Core AI Module"
law_id = "asimovpp"
/******************** Corporate ********************/
/obj/item/aiModule/core/full/corp
/obj/item/ai_module/core/full/corp
name = "'Corporate' Core AI Module"
law_id = "corporate"
/****************** P.A.L.A.D.I.N. 3.5e **************/
/obj/item/aiModule/core/full/paladin // -- NEO
/obj/item/ai_module/core/full/paladin // -- NEO
name = "'P.A.L.A.D.I.N. version 3.5e' Core AI Module"
law_id = "paladin"
/****************** P.A.L.A.D.I.N. 5e **************/
/obj/item/aiModule/core/full/paladin_devotion
/obj/item/ai_module/core/full/paladin_devotion
name = "'P.A.L.A.D.I.N. version 5e' Core AI Module"
law_id = "paladin5"
/********************* Custom *********************/
/obj/item/aiModule/core/full/custom
/obj/item/ai_module/core/full/custom
name = "Default Core AI Module"
/obj/item/aiModule/core/full/custom/Initialize(mapload)
/obj/item/ai_module/core/full/custom/Initialize(mapload)
. = ..()
for(var/line in world.file2list("[global.config.directory]/silicon_laws.txt"))
if(!line)
@@ -422,47 +422,47 @@ AI MODULES
/****************** T.Y.R.A.N.T. *****************/
/obj/item/aiModule/core/full/tyrant
/obj/item/ai_module/core/full/tyrant
name = "'T.Y.R.A.N.T.' Core AI Module"
law_id = "tyrant"
/******************** Robocop ********************/
/obj/item/aiModule/core/full/robocop
/obj/item/ai_module/core/full/robocop
name = "'Robo-Officer' Core AI Module"
law_id = "robocop"
/******************** Antimov ********************/
/obj/item/aiModule/core/full/antimov
/obj/item/ai_module/core/full/antimov
name = "'Antimov' Core AI Module"
law_id = "antimov"
/******************** Freeform Core ******************/
/obj/item/aiModule/core/freeformcore
/obj/item/ai_module/core/freeformcore
name = "'Freeform' Core AI Module"
laws = list("")
/obj/item/aiModule/core/freeformcore/attack_self(mob/user)
/obj/item/ai_module/core/freeformcore/attack_self(mob/user)
var/targName = stripped_input(user, "Please enter a new core law for the AI.", "Freeform Law Entry", laws[1])
if(!targName)
return
laws[1] = targName
..()
/obj/item/aiModule/core/freeformcore/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow)
/obj/item/ai_module/core/freeformcore/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow)
..()
return laws[1]
/******************** Overthrow ******************/
/obj/item/aiModule/core/full/overthrow
/obj/item/ai_module/core/full/overthrow
name = "'Overthrow' Hacked AI Module"
law_id = "overthrow"
/obj/item/aiModule/core/full/overthrow/install(datum/ai_laws/law_datum, mob/user)
/obj/item/ai_module/core/full/overthrow/install(datum/ai_laws/law_datum, mob/user)
if(!user || !law_datum || !law_datum.owner)
return
var/datum/mind/user_mind = user.mind
@@ -493,19 +493,19 @@ AI MODULES
/******************** Hacked AI Module ******************/
/obj/item/aiModule/syndicate // This one doesn't inherit from ion boards because it doesn't call ..() in transmitInstructions. ~Miauw
/obj/item/ai_module/syndicate // This one doesn't inherit from ion boards because it doesn't call ..() in transmitInstructions. ~Miauw
name = "Hacked AI Module"
desc = "An AI Module for hacking additional laws to an AI."
laws = list("")
/obj/item/aiModule/syndicate/attack_self(mob/user)
/obj/item/ai_module/syndicate/attack_self(mob/user)
var/targName = stripped_input(user, "Please enter a new law for the AI.", "Freeform Law Entry", laws[1])
if(!targName)
return
laws[1] = targName
..()
/obj/item/aiModule/syndicate/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow)
/obj/item/ai_module/syndicate/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow)
// ..() //We don't want this module reporting to the AI who dun it. --NEO
if(law_datum.owner)
to_chat(law_datum.owner, "<span class='warning'>BZZZZT</span>")
@@ -522,14 +522,14 @@ AI MODULES
/******************* Ion Module *******************/
/obj/item/aiModule/toyAI // -- Incoming //No actual reason to inherit from ion boards here, either. *sigh* ~Miauw
/obj/item/ai_module/toyAI // -- Incoming //No actual reason to inherit from ion boards here, either. *sigh* ~Miauw
name = "toy AI"
desc = "A little toy model AI core with real law uploading action!" //Note: subtle tell
icon = 'icons/obj/toy.dmi'
icon_state = "AI"
laws = list("")
/obj/item/aiModule/toyAI/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow)
/obj/item/ai_module/toyAI/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow)
//..()
if(law_datum.owner)
to_chat(law_datum.owner, "<span class='warning'>BZZZZT</span>")
@@ -544,7 +544,7 @@ AI MODULES
law_datum.replace_random_law(laws[1],list(LAW_ION,LAW_INHERENT,LAW_SUPPLIED))
return laws[1]
/obj/item/aiModule/toyAI/attack_self(mob/user)
/obj/item/ai_module/toyAI/attack_self(mob/user)
laws[1] = generate_ion_law()
to_chat(user, "<span class='notice'>You press the button on [src].</span>")
playsound(user, 'sound/machines/click.ogg', 20, 1)
@@ -552,56 +552,56 @@ AI MODULES
/******************** Mother Drone ******************/
/obj/item/aiModule/core/full/drone
/obj/item/ai_module/core/full/drone
name = "'Mother Drone' Core AI Module"
law_id = "drone"
/******************** Robodoctor ****************/
/obj/item/aiModule/core/full/hippocratic
/obj/item/ai_module/core/full/hippocratic
name = "'Robodoctor' Core AI Module"
law_id = "hippocratic"
/******************** Reporter *******************/
/obj/item/aiModule/core/full/reporter
/obj/item/ai_module/core/full/reporter
name = "'Reportertron' Core AI Module"
law_id = "reporter"
/****************** Thermodynamic *******************/
/obj/item/aiModule/core/full/thermurderdynamic
/obj/item/ai_module/core/full/thermurderdynamic
name = "'Thermodynamic' Core AI Module"
law_id = "thermodynamic"
/******************Live And Let Live*****************/
/obj/item/aiModule/core/full/liveandletlive
/obj/item/ai_module/core/full/liveandletlive
name = "'Live And Let Live' Core AI Module"
law_id = "liveandletlive"
/******************Guardian of Balance***************/
/obj/item/aiModule/core/full/balance
/obj/item/ai_module/core/full/balance
name = "'Guardian of Balance' Core AI Module"
law_id = "balance"
/obj/item/aiModule/core/full/maintain
/obj/item/ai_module/core/full/maintain
name = "'Station Efficiency' Core AI Module"
law_id = "maintain"
/obj/item/aiModule/core/full/peacekeeper
/obj/item/ai_module/core/full/peacekeeper
name = "'Peacekeeper' Core AI Module"
law_id = "peacekeeper"
// Bad times ahead
/obj/item/aiModule/core/full/damaged
/obj/item/ai_module/core/full/damaged
name = "damaged Core AI Module"
desc = "An AI Module for programming laws to an AI. It looks slightly damaged."
/obj/item/aiModule/core/full/damaged/install(datum/ai_laws/law_datum, mob/user)
/obj/item/ai_module/core/full/damaged/install(datum/ai_laws/law_datum, mob/user)
laws += generate_ion_law()
while (prob(75))
laws += generate_ion_law()
@@ -610,6 +610,6 @@ AI MODULES
/******************H.O.G.A.N.***************/
/obj/item/aiModule/core/full/hulkamania
/obj/item/ai_module/core/full/hulkamania
name = "'H.O.G.A.N.' Core AI Module"
law_id = "hulkamania"
+9 -9
View File
@@ -106,9 +106,9 @@ RLD
matter += value*amount_to_use
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
to_chat(user, "<span class='notice'>You insert [amount_to_use] [S.name] sheets into [src]. </span>")
return 1
return TRUE
to_chat(user, "<span class='warning'>You can't insert any more [S.name] sheets into [src]!</span>")
return 0
return FALSE
/obj/item/construction/proc/activate()
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
@@ -575,12 +575,12 @@ RLD
/obj/item/construction/rcd/borg/useResource(amount, mob/user)
if(!iscyborg(user))
return 0
return FALSE
var/mob/living/silicon/robot/borgy = user
if(!borgy.cell)
if(user)
to_chat(user, no_ammo_message)
return 0
return FALSE
. = borgy.cell.use(amount * energyfactor) //borgs get 1.3x the use of their RCDs
if(!. && user)
to_chat(user, no_ammo_message)
@@ -588,12 +588,12 @@ RLD
/obj/item/construction/rcd/borg/checkResource(amount, mob/user)
if(!iscyborg(user))
return 0
return FALSE
var/mob/living/silicon/robot/borgy = user
if(!borgy.cell)
if(user)
to_chat(user, no_ammo_message)
return 0
return FALSE
. = borgy.cell.charge >= (amount * energyfactor)
if(!. && user)
to_chat(user, no_ammo_message)
@@ -750,7 +750,7 @@ RLD
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
if(do_after(user, decondelay, target = A))
if(!useResource(deconcost, user))
return 0
return FALSE
activate()
qdel(A)
return TRUE
@@ -811,9 +811,9 @@ RLD
playsound(src.loc, 'sound/effects/light_flicker.ogg', 50, 1)
if(do_after(user, floordelay, target = A))
if(!istype(F))
return 0
return FALSE
if(!useResource(floorcost, user))
return 0
return FALSE
activate()
var/destination = get_turf(A)
var/obj/machinery/light/floor/FL = new /obj/machinery/light/floor(destination)
+1 -1
View File
@@ -202,7 +202,7 @@
log_game("[key_name(usr)] has renamed [prevname] to [str]")
A.update_areasize()
interact()
return 1
return TRUE
/obj/item/areaeditor/proc/set_area_machinery_title(area/A,title,oldtitle)
+1 -1
View File
@@ -19,7 +19,7 @@
. = ..()
if(possible_appearances)
return
possible_appearances = sortList(list(
possible_appearances = sort_list(list(
"Assistant" = image(icon = src.icon, icon_state = "cutout_greytide"),
"Clown" = image(icon = src.icon, icon_state = "cutout_clown"),
"Mime" = image(icon = src.icon, icon_state = "cutout_mime"),
+3 -3
View File
@@ -35,7 +35,7 @@
/obj/item/chrono_eraser/item_action_slot_check(slot, mob/user, datum/action/A)
if(slot == ITEM_SLOT_BACK)
return 1
return TRUE
/obj/item/gun/energy/chrono_gun
name = "T.E.D. Projection Apparatus"
@@ -108,9 +108,9 @@
var/turf/currentpos = get_turf(src)
var/mob/living/user = src.loc
if((currentpos == startpos) && (field in view(CHRONO_BEAM_RANGE, currentpos)) && !user.lying && (user.stat == CONSCIOUS))
return 1
return TRUE
field_disconnect(F)
return 0
return FALSE
/obj/item/gun/energy/chrono_gun/proc/pass_mind(datum/mind/M)
if(TED)
+1
View File
@@ -108,6 +108,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
w_class = WEIGHT_CLASS_TINY
body_parts_covered = null
grind_results = list()
throw_verb = "flick"
var/lit = FALSE
var/starts_lit = FALSE
var/icon_on = "cigon" //Note - these are in masks.dmi not in cigarette.dmi
@@ -654,7 +654,7 @@
display_vending_names_paths = list()
for(var/path in vending_names_paths)
display_vending_names_paths[vending_names_paths[path]] = path
var/choice = input(user,"Choose a new brand","Select an Item") as null|anything in sortList(display_vending_names_paths)
var/choice = input(user,"Choose a new brand","Select an Item") as null|anything in sort_list(display_vending_names_paths)
set_type(display_vending_names_paths[choice])
else
return ..()
+1 -1
View File
@@ -127,7 +127,7 @@
refill()
else
if(check_empty(user, amount, requires_full))
return 0
return FALSE
else
. = min(charges_left, amount)
charges_left -= .
+1 -1
View File
@@ -70,7 +70,7 @@
qdel(src)
return credits
else
return 0
return FALSE
/obj/item/holochip/attackby(obj/item/I, mob/user, params)
..()
+2 -2
View File
@@ -173,7 +173,7 @@
update_power()
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
A.UpdateButtons()
/obj/item/defibrillator/proc/make_paddles()
if(!combat)
@@ -188,7 +188,7 @@
/obj/item/defibrillator/item_action_slot_check(slot, mob/user, datum/action/A)
if(slot == user.getBackSlot())
return 1
return TRUE
/obj/item/defibrillator/proc/remove_paddles(mob/user) //this fox the bug with the paddles when other player stole you the defib when you have the paddles equiped
if(ismob(paddles.loc))
+5 -3
View File
@@ -29,6 +29,7 @@ GLOBAL_LIST_EMPTY(PDAs)
item_flags = NOBLUDGEON
w_class = WEIGHT_CLASS_TINY
slot_flags = ITEM_SLOT_ID | ITEM_SLOT_BELT
actions_types = list(/datum/action/item_action/toggle_light/pda)
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 100, ACID = 100)
resistance_flags = FIRE_PROOF | ACID_PROOF
@@ -962,7 +963,7 @@ GLOBAL_LIST_EMPTY(PDAs)
/obj/item/pda/proc/toggle_light()
if(hasSiliconAccessInArea(usr) || !usr.canUseTopic(src, BE_CLOSE))
return
return FALSE
if(fon)
fon = FALSE
set_light(0)
@@ -970,6 +971,7 @@ GLOBAL_LIST_EMPTY(PDAs)
fon = TRUE
set_light(f_lum, f_pow, f_col)
update_icon()
return TRUE
/obj/item/pda/proc/remove_pen()
@@ -1180,7 +1182,7 @@ GLOBAL_LIST_EMPTY(PDAs)
plist[avoid_assoc_duplicate_keys(P.owner, namecounts)] = P
var/c = input(user, "Please select a PDA") as null|anything in sortList(plist)
var/c = input(user, "Please select a PDA") as null|anything in sort_list(plist)
if (!c)
return
@@ -1268,7 +1270,7 @@ GLOBAL_LIST_EMPTY(PDAs)
plist[avoid_assoc_duplicate_keys(P.owner, namecounts)] = P
var/c = input(user, "Please select a PDA") as null|anything in sortList(plist)
var/c = input(user, "Please select a PDA") as null|anything in sort_list(plist)
if (!c)
return
+1 -1
View File
@@ -600,7 +600,7 @@ Code:
if(!emoji_table)
var/datum/asset/spritesheet/sheet = get_asset_datum(/datum/asset/spritesheet/chat)
var/list/collate = list("<br><table>")
for(var/emoji in sortList(icon_states(icon('icons/emoji.dmi'))))
for(var/emoji in sort_list(icon_states(icon('icons/emoji.dmi'))))
var/tag = sheet.icon_tag("emoji-[emoji]")
collate += "<tr><td>[emoji]</td><td>[tag]</td></tr>"
collate += "</table><br>"
@@ -62,15 +62,15 @@
/obj/item/camera_bug/check_eye(mob/user)
if ( loc != user || user.incapacitated() || user.eye_blind || !current )
user.unset_machine()
return 0
return FALSE
var/turf/T_user = get_turf(user.loc)
var/turf/T_current = get_turf(current)
if(T_user.z != T_current.z || !current.can_use())
to_chat(user, "<span class='danger'>[src] has lost the signal.</span>")
current = null
user.unset_machine()
return 0
return 1
return FALSE
return TRUE
/obj/item/camera_bug/on_unset_machine(mob/user)
user.reset_perspective(null)
@@ -82,7 +82,7 @@
continue
if(length(list("ss13","mine", "rd", "labor", "toxins", "minisat")&camera.network))
bugged_cameras[camera.c_tag] = camera
return sortList(bugged_cameras)
return sort_list(bugged_cameras)
/obj/item/camera_bug/proc/menu(list/cameras)
@@ -59,7 +59,7 @@
return ..()
/obj/item/dogborg/sleeper/Exit(atom/movable/O)
return 0
return FALSE
/obj/item/dogborg/sleeper/proc/get_host()
if(!loc)
@@ -13,7 +13,7 @@
/obj/item/electroadaptive_pseudocircuit/Initialize(mapload)
. = ..()
maptext = "[circuits]"
maptext = MAPTEXT("[circuits]")
/obj/item/electroadaptive_pseudocircuit/examine(mob/user)
. = ..()
@@ -40,7 +40,7 @@
playsound(R, 'sound/items/rped.ogg', 50, TRUE)
recharging = TRUE
circuits--
maptext = "[circuits]"
maptext = MAPTEXT("[circuits]")
icon_state = "[initial(icon_state)]_recharging"
var/recharge_time = min(600, circuit_cost * 5) //40W of cost for one fabrication = 20 seconds of recharge time; this is to prevent spamming
addtimer(CALLBACK(src, PROC_REF(recharge)), recharge_time)
@@ -53,7 +53,7 @@
if(!is_type_in_typecache(target, recycleable_circuits))
return
circuits++
maptext = "[circuits]"
maptext = MAPTEXT("[circuits]")
user.visible_message("<span class='notice'>User breaks down [target] with [src].</span>", \
"<span class='notice'>You recycle [target] into [src]. It now has material for <b>[circuits]</b> circuits.</span>")
playsound(user, 'sound/items/deconstruct.ogg', 50, TRUE)
@@ -40,7 +40,7 @@
playsound(src, on ? 'sound/weapons/magin.ogg' : 'sound/weapons/magout.ogg', 40, TRUE)
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
A.UpdateButtons()
return TRUE
/obj/item/flashlight/DoRevenantThrowEffects(atom/target)
+1 -1
View File
@@ -86,7 +86,7 @@
// I assume it's faster to color,tag and OR the turf in, rather
// then checking if its there
T.color = RANDOM_COLOUR
T.maptext = "[T.x],[T.y],[T.z]"
T.maptext = MAPTEXT("[T.x],[T.y],[T.z]")
tagged |= T
/obj/item/gps/visible_debug/proc/clear()
@@ -170,7 +170,7 @@
/obj/item/lightreplacer/proc/Use(mob/user)
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
AddUses(-1)
return 1
return TRUE
// Negative numbers will subtract
/obj/item/lightreplacer/proc/AddUses(amount = 1)
@@ -239,9 +239,9 @@
/obj/item/lightreplacer/proc/CanUse(mob/living/user)
src.add_fingerprint(user)
if(uses > 0)
return 1
return TRUE
else
return 0
return FALSE
/obj/item/lightreplacer/afterattack(atom/T, mob/U, proximity)
. = ..()
+2 -2
View File
@@ -236,11 +236,11 @@
/datum/action/item_action/toggle_multitool/Trigger()
if(!..())
return 0
return FALSE
if(target)
var/obj/item/multitool/ai_detect/M = target
M.toggle_hud(owner)
return 1
return TRUE
/obj/item/multitool/cyborg
name = "multitool"
+1 -1
View File
@@ -973,7 +973,7 @@ GENETICS SCANNER
for(var/A in buffer)
options += get_display_name(A)
var/answer = input(user, "Analyze Potential", "Sequence Analyzer") as null|anything in sortList(options)
var/answer = input(user, "Analyze Potential", "Sequence Analyzer") as null|anything in sort_list(options)
if(answer && ready && user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
var/sequence
for(var/A in buffer) //this physically hurts but i dont know what anything else short of an assoc list
@@ -217,7 +217,7 @@ effective or pretty fucking useless.
/obj/item/shadowcloak/item_action_slot_check(slot, mob/user, datum/action/A)
if(slot == ITEM_SLOT_BELT)
return 1
return TRUE
/obj/item/shadowcloak/proc/Activate(mob/living/carbon/human/user)
if(!user)
+3 -1
View File
@@ -168,7 +168,9 @@
diceroll(user)
/obj/item/dice/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
diceroll(thrownby)
var/mob/thrown_by = thrownby?.resolve()
if(thrown_by)
diceroll(thrown_by)
. = ..()
/obj/item/dice/proc/diceroll(mob/user)
+1 -1
View File
@@ -209,7 +209,7 @@
/obj/item/dualsaber/attack_hulk(mob/living/carbon/human/user, does_attack_animation = 0) //In case thats just so happens that it is still activated on the groud, prevents hulk from picking it up
if(wielded)
to_chat(user, "<span class='warning'>You can't pick up such dangerous item with your meaty hands without losing fingers, better not to!</span>")
return 1
return TRUE
/obj/item/dualsaber/process()
if(wielded)
+3 -3
View File
@@ -119,7 +119,7 @@
if(reagents.total_volume == reagents.maximum_volume)
to_chat(user, "<span class='warning'>\The [src] is already full!</span>")
safety = safety_save
return 1
return TRUE
var/obj/structure/reagent_dispensers/W = target //will it work?
var/transferred = W.reagents.trans_to(src, max_water)
if(transferred > 0)
@@ -130,9 +130,9 @@
else
to_chat(user, "<span class='warning'>\The [W] is empty!</span>")
safety = safety_save
return 1
return TRUE
else
return 0
return FALSE
/obj/item/extinguisher/afterattack(atom/target, mob/user , flag)
. = ..()
+4 -4
View File
@@ -129,12 +129,12 @@
/datum/action/innate/drink_fling/Activate()
button_icon_state = "drinkfling_on"
active = TRUE
UpdateButtonIcon()
UpdateButtons()
/datum/action/innate/drink_fling/Deactivate()
button_icon_state = "drinkfling_off"
active = FALSE
UpdateButtonIcon()
UpdateButtons()
/obj/item/book/granter/action/origami
granted_action = /datum/action/innate/origami
@@ -155,13 +155,13 @@
to_chat(owner, "<span class='notice'>You will now fold origami planes.</span>")
button_icon_state = "origami_on"
active = TRUE
UpdateButtonIcon()
UpdateButtons()
/datum/action/innate/origami/Deactivate()
to_chat(owner, "<span class='notice'>You will no longer fold origami planes.</span>")
button_icon_state = "origami_off"
active = FALSE
UpdateButtonIcon()
UpdateButtons()
///SPELLS///
+1 -1
View File
@@ -260,7 +260,7 @@
display_names[initial(rodtype.name)] = rodtype
nullrod_icons += list(initial(rodtype.name) = image(icon = initial(rodtype.icon), icon_state = initial(rodtype.icon_state)))
nullrod_icons = sortList(nullrod_icons)
nullrod_icons = sort_list(nullrod_icons)
var/choice = show_radial_menu(L, src , nullrod_icons, custom_check = CALLBACK(src, PROC_REF(check_menu), L), radius = 42, require_near = TRUE)
if(!choice || !check_menu(L))
+3 -3
View File
@@ -38,8 +38,8 @@
//What does the implant do upon injection?
//return 1 if the implant injects
//return 0 if there is no room for implant / it fails
//return TRUE if the implant injects
//return FALSE if there is no room for implant / it fails
/obj/item/implant/proc/implant(mob/living/target, mob/user, silent = FALSE, force = FALSE)
if(SEND_SIGNAL(src, COMSIG_IMPLANT_IMPLANTING, args) & COMPONENT_STOP_IMPLANTING)
return
@@ -99,7 +99,7 @@
var/mob/living/carbon/human/H = source
H.sec_hud_set_implants()
return 1
return TRUE
/obj/item/implant/Destroy()
if(imp_in)
@@ -59,7 +59,7 @@
/obj/item/implant/chem/activate(cause)
. = ..()
if(!cause || !imp_in)
return 0
return FALSE
var/mob/living/carbon/R = imp_in
var/injectamount = null
if (cause == "action_button")
@@ -48,7 +48,7 @@
imp_e.weak += weak
imp_e.delay += delay
qdel(src)
return 1
return TRUE
return ..()
@@ -64,8 +64,8 @@
L.sec_hud_set_implants()
if(target.stat != DEAD && !silent)
to_chat(target, "<span class='boldnotice'>Your mind suddenly feels terribly vulnerable. You are no longer safe from brainwashing.</span>")
return 1
return 0
return TRUE
return FALSE
/obj/item/implanter/mindshield
name = "implanter (mindshield)"
@@ -158,11 +158,11 @@
/obj/machinery/implantchair/genepurge/implant_action(mob/living/carbon/human/H,mob/user)
if(!istype(H))
return 0
return FALSE
H.set_species(/datum/species/human, 1)//lizards go home
purrbation_remove(H)//remove cats
H.dna.remove_all_mutations()//hulks out
return 1
return TRUE
/obj/machinery/implantchair/brainwash
+5 -4
View File
@@ -289,10 +289,11 @@
"<span class='userdanger'>[M] has been splashed with something!</span>")
var/turf/TT = get_turf(hit_atom)
var/throwerstring
if(thrownby)
log_combat(thrownby, M, "splashed", R)
var/turf/AT = get_turf(thrownby)
throwerstring = " THROWN BY [key_name(thrownby)] at [AT] (AREACOORD(AT)]"
var/mob/thrown_by = thrownby?.resolve()
if(thrown_by)
log_combat(thrown_by, M, "splashed", R)
var/turf/AT = get_turf(thrown_by)
throwerstring = " THROWN BY [key_name(thrown_by)] at [AT] (AREACOORD(AT)]"
log_reagent("SPLASH: [src] mob throw_impact() onto [key_name(hit_atom)] at [TT] ([AREACOORD(TT)])[throwerstring] - [R]")
reagents.reaction(hit_atom, TOUCH)
reagents.clear_reagents()
+2 -2
View File
@@ -25,7 +25,7 @@
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 class='notice'>You upgrade [AI]. [src] is consumed in the process.</span>")
to_chat(user, span_notice("You install [src], upgrading [AI]."))
qdel(src)
@@ -46,7 +46,7 @@
AI.eyeobj.relay_speech = TRUE
to_chat(AI, "<span class='userdanger'>[user] has upgraded you with surveillance software!</span>")
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 class='notice'>You upgrade [AI]. [src] is consumed in the process.</span>")
to_chat(user, span_notice("You install [src], upgrading [AI]."))
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)
+4 -5
View File
@@ -59,8 +59,8 @@
if(src.l_leg && src.r_leg)
if(src.chest && src.head)
SSblackbox.record_feedback("amount", "cyborg_frames_built", 1)
return 1
return 0
return TRUE
return FALSE
/obj/item/robot_suit/wrench_act(mob/living/user, obj/item/I) //Deconstucts empty borg shell. Flashes remain unbroken because they haven't been used yet
var/turf/T = get_turf(src)
@@ -292,9 +292,7 @@
if(M.laws.id == DEFAULT_AI_LAWID)
O.make_laws()
SSticker.mode.remove_antag_for_borging(BM.mind)
if(!istype(M.laws, /datum/ai_laws/ratvar))
remove_servant_of_ratvar(BM, TRUE)
BM.mind.remove_antags_for_borging()
BM.mind.transfer_to(O)
if(O.mind && O.mind.special_role)
@@ -312,6 +310,7 @@
qdel(O.mmi)
O.mmi = W //and give the real mmi to the borg.
O.updatename()
playsound(O.loc, 'sound/voice/liveagain.ogg', 75, TRUE)
SSblackbox.record_feedback("amount", "cyborg_birth", 1)
forceMove(O)
O.robot_suit = src
+14 -16
View File
@@ -8,32 +8,29 @@
icon_state = "cyborg_upgrade"
w_class = WEIGHT_CLASS_SMALL
var/locked = FALSE
var/installed = 0
var/require_module = 0
var/list/module_type
var/installed = FALSE
var/require_module = FALSE
var/list/module_type = null
/// Bitflags listing module compatibility. Used in the exosuit fabricator for creating sub-categories.
var/module_flags = NONE
// if true, is not stored in the robot to be ejected
// if module is reset
var/one_use = FALSE
/// Means this is a basetype and should not be used
var/abstract_type = /obj/item/borg/upgrade
/// Show the amount of this module that is installed
var/show_amount = FALSE
/obj/item/borg/upgrade/proc/action(mob/living/silicon/robot/R, user = usr)
if(R.stat == DEAD)
to_chat(user, "<span class='warning'>[src] will not function on a deceased cyborg.</span>")
to_chat(user, span_warning("[src] will not function on a deceased cyborg!"))
return FALSE
if(module_type && !is_type_in_list(R.module, module_type))
to_chat(R, "<span class='alert'>Upgrade mounting error! No suitable hardpoint detected.</span>")
to_chat(user, "<span class='warning'>There's no mounting point for the module!</span>")
to_chat(R, span_alert("Upgrade mounting error! No suitable hardpoint detected."))
to_chat(user, span_warning("There's no mounting point for the module!"))
return FALSE
return TRUE
/*
This proc gets called by upgrades after installing them. Use this for things that for example need to be moved into a specific borg item,
as performing this in action() will cause the upgrade to end up in the borg instead of its intended location due to forceMove() being called afterwards..
*/
/obj/item/borg/upgrade/proc/afterInstall(mob/living/silicon/robot/R, user = usr)
return
/obj/item/borg/upgrade/proc/deactivate(mob/living/silicon/robot/R, user = usr)
if (!(src in R.upgrades))
return FALSE
@@ -324,12 +321,12 @@ as performing this in action() will cause the upgrade to end up in the borg inst
/obj/item/borg/upgrade/lavaproof/action(mob/living/silicon/robot/R, user = usr)
. = ..()
if(.)
ADD_TRAIT(src, TRAIT_LAVA_IMMUNE, type)
ADD_TRAIT(R, TRAIT_LAVA_IMMUNE, type)
/obj/item/borg/upgrade/lavaproof/deactivate(mob/living/silicon/robot/R, user = usr)
. = ..()
if (.)
REMOVE_TRAIT(src, TRAIT_LAVA_IMMUNE, type)
REMOVE_TRAIT(R, TRAIT_LAVA_IMMUNE, type)
/obj/item/borg/upgrade/selfrepair
name = "self-repair module"
@@ -440,6 +437,7 @@ as performing this in action() will cause the upgrade to end up in the borg inst
/obj/item/robot_module/syndicate_medical)
var/list/additional_reagents = list()
module_flags = BORG_MODULE_MEDICAL
abstract_type = /obj/item/borg/upgrade/hypospray
/obj/item/borg/upgrade/hypospray/action(mob/living/silicon/robot/R, user = usr)
. = ..()
@@ -721,6 +719,6 @@ as performing this in action() will cause the upgrade to end up in the borg inst
user.vtec = initial(user.vtec) - maxReduction * 1
action.button_icon_state = "Chevron_State_[currentState]"
action.UpdateButtonIcon()
action.UpdateButtons()
return TRUE
+1 -1
View File
@@ -33,7 +33,7 @@
if (usr.stat || usr.restrained() || src.loc != usr)
return
if (!ishuman(usr))
return 1
return TRUE
var/mob/living/carbon/human/H = usr
if(H.is_holding(src))
H.set_machine(src)
+1 -1
View File
@@ -24,7 +24,7 @@
pixel_y = rand(-5, 5)
/obj/item/stack/ore/bluespace_crystal/get_part_rating()
return 1
return TRUE
/obj/item/stack/ore/bluespace_crystal/attack_self(mob/user)
user.visible_message("<span class='warning'>[user] crushes [src]!</span>", "<span class='danger'>You crush [src]!</span>")
+4 -2
View File
@@ -216,7 +216,8 @@
/obj/item/stack/medical/gauze/cyborg
custom_materials = null
is_cyborg = 1
is_cyborg = TRUE
source = /datum/robot_energy_storage/medical
cost = 250
/obj/item/stack/medical/suture
@@ -440,7 +441,8 @@
/obj/item/stack/medical/bone_gel/cyborg
custom_materials = null
is_cyborg = 1
is_cyborg = TRUE
source = /datum/robot_energy_storage/medical
cost = 250
/obj/item/stack/medical/aloe
+4 -7
View File
@@ -39,7 +39,7 @@ GLOBAL_LIST_INIT(rod_recipes, list ( \
/obj/item/stack/rods/update_icon_state()
var/amount = get_amount()
if(amount <= 5)
if(amount <= 5 && amount >= 1)
icon_state = "rods-[amount]"
else
icon_state = "rods"
@@ -76,12 +76,9 @@ GLOBAL_LIST_INIT(rod_recipes, list ( \
/obj/item/stack/rods/cyborg
custom_materials = null
is_cyborg = 1
cost = 250
/obj/item/stack/rods/cyborg/ComponentInitialize()
. = ..()
AddElement(/datum/element/update_icon_blocker)
is_cyborg = TRUE
source = /datum/robot_energy_storage/medical
cost = MINERAL_MATERIAL_AMOUNT * 0.125
/obj/item/stack/rods/ten
amount = 10
+15 -5
View File
@@ -51,8 +51,9 @@ GLOBAL_LIST_INIT(glass_recipes, list ( \
/obj/item/stack/sheet/glass/cyborg
custom_materials = null
is_cyborg = 1
cost = 500
is_cyborg = TRUE
source = /datum/robot_energy_storage/glass
cost = MINERAL_MATERIAL_AMOUNT * 0.25
/obj/item/stack/sheet/glass/fifty
amount = 50
@@ -178,9 +179,16 @@ GLOBAL_LIST_INIT(reinforced_glass_recipes, list ( \
/obj/item/stack/sheet/rglass/cyborg
custom_materials = null
var/datum/robot_energy_storage/glasource
var/metcost = 250
var/glacost = 500
is_cyborg = TRUE
source = /datum/robot_energy_storage/metal
var/datum/robot_energy_storage/glasource = /datum/robot_energy_storage/glass
var/metcost = MINERAL_MATERIAL_AMOUNT * 0.125
var/glacost = MINERAL_MATERIAL_AMOUNT * 0.25
/obj/item/stack/sheet/rglass/cyborg/prepare_estorage(obj/item/robot_module/module)
. = ..()
if(glasource)
glasource = module.get_or_create_estorage(glasource)
/obj/item/stack/sheet/rglass/cyborg/get_amount()
return min(round(source.energy / metcost), round(glasource.energy / glacost))
@@ -188,10 +196,12 @@ GLOBAL_LIST_INIT(reinforced_glass_recipes, list ( \
/obj/item/stack/sheet/rglass/cyborg/use(used, transfer = FALSE) // Requires special checks, because it uses two storages
source.use_charge(used * metcost)
glasource.use_charge(used * glacost)
update_icon()
/obj/item/stack/sheet/rglass/cyborg/add(amount)
source.add_charge(amount * metcost)
glasource.add_charge(amount * glacost)
update_icon()
/obj/item/stack/sheet/rglass/get_main_recipes()
. = ..()
@@ -163,8 +163,9 @@ GLOBAL_LIST_INIT(metal_recipes, list ( \
/obj/item/stack/sheet/metal/cyborg
custom_materials = null
is_cyborg = 1
cost = 500
is_cyborg = TRUE
source = /datum/robot_energy_storage/metal
cost = MINERAL_MATERIAL_AMOUNT * 0.25
/obj/item/stack/sheet/metal/get_main_recipes()
. = ..()
@@ -178,7 +179,7 @@ GLOBAL_LIST_INIT(metal_recipes, list ( \
* Plasteel
*/
GLOBAL_LIST_INIT(plasteel_recipes, list ( \
new/datum/stack_recipe("AI core", /obj/structure/AIcore, 4, time = 50, one_per_turf = TRUE), \
new/datum/stack_recipe("AI core", /obj/structure/ai_core, 4, time = 50, one_per_turf = TRUE), \
new/datum/stack_recipe("bomb assembly", /obj/machinery/syndicatebomb/empty, 10, time = 50), \
new/datum/stack_recipe("plasteel keg", /obj/structure/custom_keg, 10, time = 50), \
new/datum/stack_recipe("micro powered fan assembly", /obj/machinery/fan_assembly, 5, time = 50, one_per_turf = TRUE, on_floor = TRUE), \
+92 -6
View File
@@ -42,6 +42,12 @@
var/matter_amount = 0
/obj/item/stack/Initialize(mapload, new_amount, merge = TRUE)
if(is_cyborg)
if(!istype(loc, /obj/item/robot_module))
stack_trace("Cyborg stack created outside of a robot module, deleting.")
return INITIALIZE_HINT_QDEL
prepare_estorage(loc)
if(new_amount != null)
amount = new_amount
while(amount > max_amount)
@@ -132,6 +138,19 @@
else
icon_state = "[initial(icon_state)]_3"
/obj/item/stack/update_overlays()
. = ..()
if(isturf(loc))
return
var/atom/movable/screen/storage/item_holder/holder = locate(/atom/movable/screen/storage/item_holder) in vis_locs
if(holder?.master && istype(holder.master, /datum/component/storage/concrete))
var/datum/component/storage/concrete/storage = holder.master
if(storage.display_numerical_stacking)
return // It's being handled by the storage we're in, forget about it.
var/mutable_appearance/number = mutable_appearance(appearance_flags = APPEARANCE_UI_IGNORE_ALPHA)
number.maptext = MAPTEXT(get_amount())
. += number
/obj/item/stack/examine(mob/user)
. = ..()
if (is_cyborg)
@@ -151,6 +170,14 @@
. += "There is [get_amount()] in the stack."
. += "<span class='notice'>Alt-click to take a custom amount.</span>"
/obj/item/stack/equipped(mob/user, slot)
. = ..()
update_icon()
/obj/item/stack/dropped(mob/user, slot)
. = ..()
update_icon()
/obj/item/stack/proc/get_amount()
if(is_cyborg)
. = round(source?.energy / cost)
@@ -358,11 +385,13 @@
return FALSE
return TRUE
/obj/item/stack/use(used, transfer = FALSE, check = TRUE) // return 0 = borked; return 1 = had enough
/obj/item/stack/use(used, transfer = FALSE, check = TRUE) // return FALSE = borked; return TRUE = had enough
if(check && zero_amount())
return FALSE
if (is_cyborg)
return source.use_charge(used * cost)
. = source.use_charge(used * cost)
update_icon()
return
if (amount < used)
return FALSE
amount -= used
@@ -465,9 +494,53 @@
return
//get amount from user
var/max = get_amount()
var/stackmaterial = round(input(user,"How many sheets do you wish to take out of this stack? (Maximum [max])") as null|num)
max = get_amount()
stackmaterial = min(max, stackmaterial)
var/list/quick_split
for(var/option in list(2, 3, 4, 5, 6, 7, "One", "Five", "Ten", "Custom"))
var/mutable_appearance/option_display = new(src)
option_display.filters = null
option_display.cut_overlays()
option_display.pixel_x = 0
option_display.pixel_y = 0
switch(option)
if("Custom")
var/list/sort_numbers = quick_split
sort_numbers = sort_list(sort_numbers, /proc/cmp_numeric_text_desc)
option_display.maptext = MAPTEXT("?")
quick_split = list("Custom" = option_display)
quick_split += sort_numbers
if("One")
option = 1
option_display.maptext = MAPTEXT("1")
if("Five")
if(max > 5)
option = 5
option_display.maptext = MAPTEXT("5")
else
continue
if("Ten")
if(max > 10)
option = 10
option_display.maptext = MAPTEXT("10")
else
continue
else
if(max % option == 0)
option_display.maptext = MAPTEXT(max / option)
option = max / option
else
continue
if(option != "Custom")
LAZYSET(quick_split, "[option]", option_display)
var/stackmaterial
if(length(quick_split) <= 2)
stackmaterial = round(input(user, "How many sheets do you wish to take out of this stack?\nMax: [max]") as null|num)
else
stackmaterial = show_radial_menu(user, get_atom_on_turf(src), quick_split, require_near = TRUE, tooltips = TRUE)
if(stackmaterial == "Custom")
stackmaterial = round(input(user, "How many sheets do you wish to take out of this stack?\nMax: [max]") as null|num)
stackmaterial = isnum(stackmaterial) ? stackmaterial : text2num(stackmaterial)
stackmaterial = min(get_amount(), stackmaterial)
if(stackmaterial == null || stackmaterial <= 0 || !user.canUseTopic(src, BE_CLOSE, TRUE, FALSE)) //, !iscyborg(user)
return
split_stack(user, stackmaterial)
@@ -491,7 +564,11 @@
F.forceMove(user.drop_location())
add_fingerprint(user)
F.add_fingerprint(user)
zero_amount()
if(!zero_amount())
var/atom/movable/screen/storage/item_holder/holder = locate(/atom/movable/screen/storage/item_holder) in vis_locs
if(holder?.master && istype(holder.master, /datum/component/storage/concrete))
var/datum/component/storage/concrete/storage = holder.master
storage.refresh_mob_views()
/obj/item/stack/attackby(obj/item/W, mob/user, params)
if(can_merge(W))
@@ -514,3 +591,12 @@
/obj/item/stack/microwave_act(obj/machinery/microwave/M)
if(istype(M) && M.dirty < 100)
M.dirty += amount
/obj/item/stack/proc/prepare_estorage(obj/item/robot_module/module)
if(source)
source = module.get_or_create_estorage(source)
/obj/item/stack/Moved(old_loc, dir)
. = ..()
if(isturf(loc))
update_icon()
+1 -1
View File
@@ -11,7 +11,7 @@
. = ..()
update_icon()
/obj/item/stack/arcadeticket/update_icon()
/obj/item/stack/arcadeticket/update_icon_state()
var/amount = get_amount()
if((amount >= 12) && (amount > 0))
icon_state = "arcade-ticket_4"
@@ -535,8 +535,9 @@
/obj/item/stack/tile/plasteel/cyborg
custom_materials = null // All other Borg versions of items have no Metal or Glass - RR
is_cyborg = 1
cost = 125
is_cyborg = TRUE
source = /datum/robot_energy_storage/metal
cost = MINERAL_MATERIAL_AMOUNT * 0.0625
/obj/item/stack/tile/material
name = "floor tile"
+10 -4
View File
@@ -40,6 +40,12 @@
resistance_flags = FLAMMABLE
grind_results = list(/datum/reagent/cellulose = 5)
/obj/item/stack/packageWrap/cyborg
custom_materials = null
is_cyborg = TRUE
source = /datum/robot_energy_storage/wrapping_paper
cost = 1
/obj/item/stack/packageWrap/suicide_act(mob/living/user)
user.visible_message("<span class='suicide'>[user] begins wrapping [user.p_them()]self in \the [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
if(use(3))
@@ -53,16 +59,16 @@
return SHAME
/obj/item/proc/can_be_package_wrapped() //can the item be wrapped with package wrapper into a delivery package
return 1
return TRUE
/obj/item/storage/can_be_package_wrapped()
return 0
return FALSE
/obj/item/storage/box/can_be_package_wrapped()
return 1
return TRUE
/obj/item/smallDelivery/can_be_package_wrapped()
return 0
return FALSE
/obj/item/stack/packageWrap/afterattack(obj/target, mob/user, proximity)
. = ..()
+3 -3
View File
@@ -25,7 +25,7 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "bible",
var/obj/item/storage/book/bible/B = locate() in src
if(is_holding(B))
return B
return 0
return FALSE
/obj/item/storage/book/bible
name = "bible"
@@ -105,7 +105,7 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "bible",
var/obj/item/bodypart/BP = X
if(BP.is_robotic_limb())
to_chat(user, "<span class='warning'>[src.deity_name] refuses to heal this metallic taint!</span>")
return 0
return FALSE
var/heal_amt = 5
var/list/hurt_limbs = H.get_damaged_bodyparts(1, 1)
@@ -119,7 +119,7 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "bible",
to_chat(H, "<span class='boldnotice'>May the power of [deity_name] compel you to be healed!</span>")
playsound(src.loc, "punch", 25, 1, -1)
SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "blessing", /datum/mood_event/blessing)
return 1
return TRUE
/obj/item/storage/book/bible/attack(mob/living/M, mob/living/user, attackchain_flags = NONE, damage_multiplier = 1, heal_mode = TRUE)
+2 -2
View File
@@ -73,7 +73,7 @@
/obj/item/storage/box/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/stack/packageWrap))
return 0
return FALSE
return ..()
//Disk boxes
@@ -886,7 +886,7 @@
/obj/item/storage/box/papersack/Initialize(mapload)
. = ..()
papersack_designs = sortList(list(
papersack_designs = sort_list(list(
"None" = image(icon = src.icon, icon_state = "paperbag_None"),
"NanotrasenStandard" = image(icon = src.icon, icon_state = "paperbag_NanotrasenStandard"),
"SyndiSnacks" = image(icon = src.icon, icon_state = "paperbag_SyndiSnacks"),
@@ -85,10 +85,10 @@
new /obj/item/implanter/stealth(src)
if("hacker") // 30 tc
new /obj/item/aiModule/syndicate(src)
new /obj/item/ai_module/syndicate(src)
new /obj/item/card/emag(src)
new /obj/item/encryptionkey/binary(src)
new /obj/item/aiModule/toyAI(src)
new /obj/item/ai_module/toyAI(src)
new /obj/item/multitool/ai_detect(src)
new /obj/item/flashlight/emp(src)
new /obj/item/emagrecharge(src)
+8 -5
View File
@@ -61,9 +61,10 @@
/obj/item/melee/baton/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
..()
var/mob/thrown_by = thrownby?.resolve()
//Only mob/living types have stun handling
if(turned_on && prob(throw_hit_chance) && iscarbon(hit_atom) && thrownby)
baton_stun(hit_atom, thrownby, shoving = TRUE)
if(turned_on && prob(throw_hit_chance) && iscarbon(hit_atom) && thrown_by)
baton_stun(hit_atom, thrown_by, shoving = TRUE)
/obj/item/melee/baton/loaded //this one starts with a cell pre-installed.
preload_cell_type = /obj/item/stock_parts/cell/high/plus
@@ -387,8 +388,9 @@
/obj/item/melee/baton/boomerang/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
if(turned_on)
var/caught = hit_atom.hitby(src, FALSE, FALSE, throwingdatum=throwingdatum)
if(ishuman(hit_atom) && !caught && prob(throw_hit_chance) && thrownby)//if they are a carbon and they didn't catch it
baton_stun(hit_atom, thrownby, shoving = TRUE)
var/mob/thrown_by = thrownby?.resolve()
if(ishuman(hit_atom) && !caught && prob(throw_hit_chance) && thrown_by)//if they are a carbon and they didn't catch it
baton_stun(hit_atom, thrown_by, shoving = TRUE)
if(thrownby && !caught)
throw_back()
else
@@ -397,8 +399,9 @@
/obj/item/melee/baton/boomerang/proc/throw_back()
set waitfor = FALSE
sleep(1)
var/mob/thrown_by = thrownby?.resolve()
if(!QDELETED(src))
throw_at(thrownby, throw_range+2, throw_speed, null, TRUE)
throw_at(thrown_by, throw_range+2, throw_speed, null, TRUE)
/obj/item/melee/baton/boomerang/update_icon()
if(turned_on)
+2 -2
View File
@@ -431,7 +431,7 @@
src.rotation = rotation
// end animations
animate(atom, time = 0, flags = ANIMATION_END_NOW)
return 0
return FALSE
// grab source
var/rel_x = (destination.x - relative_to.x) * world.icon_size + src.dist * sin(src.angle)
@@ -458,7 +458,7 @@
/datum/summon_weapon/proc/Rotate(degrees, time, rotation)
. = time
if(!dist)
return 0
return FALSE
var/matrix/M = ConstructMatrix(angle + degrees, dist, rotation || src.rotation)
if(rotation)
src.rotation = rotation
+1 -1
View File
@@ -50,7 +50,7 @@
to_chat(user, "<span class='notice'>You turn the jetpack off.</span>")
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
A.UpdateButtons()
/obj/item/tank/jetpack/proc/turn_on(mob/user)
on = TRUE
+4 -4
View File
@@ -247,19 +247,19 @@
air_contents.merge(giver)
check_status()
return 1
return TRUE
/obj/item/tank/assume_air_moles(datum/gas_mixture/giver, moles)
giver.transfer_to(air_contents, moles)
check_status()
return 1
return TRUE
/obj/item/tank/assume_air_ratio(datum/gas_mixture/giver, ratio)
giver.transfer_ratio_to(air_contents, ratio)
check_status()
return 1
return TRUE
/obj/item/tank/proc/remove_air_volume(volume_to_return)
if(!air_contents)
@@ -281,7 +281,7 @@
//Handle exploding, leaking, and rupturing of the tank
if(!air_contents)
return 0
return FALSE
var/pressure = air_contents.return_pressure()
var/temperature = air_contents.return_temperature()
+3 -3
View File
@@ -26,7 +26,7 @@
/obj/item/watertank/item_action_slot_check(slot, mob/user, datum/action/A)
if(slot == user.getBackSlot())
return 1
return TRUE
/obj/item/watertank/proc/toggle_mister(mob/living/user)
if(!istype(user))
@@ -88,7 +88,7 @@
/obj/item/watertank/attackby(obj/item/W, mob/user, params)
if(W == noz)
remove_noz()
return 1
return TRUE
else
return ..()
@@ -349,7 +349,7 @@
/obj/item/reagent_containers/chemtank/item_action_slot_check(slot, mob/user, datum/action/A)
if(slot == ITEM_SLOT_BACK)
return 1
return TRUE
/obj/item/reagent_containers/chemtank/proc/toggle_injection()
var/mob/living/carbon/human/user = usr
+2 -2
View File
@@ -212,8 +212,8 @@
if(get_fuel() <= 0 && welding)
switched_on(user)
update_icon()
return 0
return 1
return FALSE
return TRUE
//Switches the welder on
/obj/item/weldingtool/proc/switched_on(mob/user)
+3 -3
View File
@@ -160,10 +160,10 @@
if(istype(A, /obj/item/toy/ammo/gun))
if (src.bullets >= 7)
to_chat(user, "<span class='warning'>It's already fully loaded!</span>")
return 1
return TRUE
if (A.amount_left <= 0)
to_chat(user, "<span class='warning'>There are no more caps!</span>")
return 1
return TRUE
if (A.amount_left < (7 - src.bullets))
src.bullets += A.amount_left
to_chat(user, text("<span class='notice'>You reload [] cap\s.</span>", A.amount_left))
@@ -173,7 +173,7 @@
A.amount_left -= 7 - src.bullets
src.bullets = 7
A.update_icon()
return 1
return TRUE
else
return ..()