From 159ce32cc7ed547c2004fcc260c16282a415afbc Mon Sep 17 00:00:00 2001 From: SkyMarshal Date: Thu, 15 Dec 2011 23:58:17 -0700 Subject: [PATCH] Improved pepper spray, added a safety catch to pepper spray and space cleaner, added a wire to reset the module of a borg. --- code/defines/mob/living/silicon/robot.dm | 4 ++- code/defines/obj/weapon.dm | 2 ++ .../objects/items/weapons/mops_cleaners.dm | 30 +++++++++++++++- code/modules/chemical/Chemistry-Reagents.dm | 12 +++---- .../modules/mob/living/silicon/robot/robot.dm | 35 +++++++++++++------ .../modules/mob/living/silicon/robot/wires.dm | 33 ++++++++++++----- 6 files changed, 88 insertions(+), 28 deletions(-) diff --git a/code/defines/mob/living/silicon/robot.dm b/code/defines/mob/living/silicon/robot.dm index ebcf1457b69..f059433a17a 100644 --- a/code/defines/mob/living/silicon/robot.dm +++ b/code/defines/mob/living/silicon/robot.dm @@ -45,10 +45,12 @@ var/datum/effect/effect/system/ion_trail_follow/ion_trail = null var/datum/effect/effect/system/spark_spread/spark_system//So they can initialize sparks whenever/N var/jeton = 0 - var/borgwires = 15 + var/borgwires = 31 var/killswitch = 0 var/killswitch_time = 60 var/weapon_lock = 0 var/weaponlock_time = 120 var/lawupdate = 1 //Cyborgs will sync their laws with their AI by default var/lockcharge //Used when locking down a borg to preserve cell charge + var/channels = list() + var/modlock = 0 diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm index d0c014248b4..46357c867cf 100644 --- a/code/defines/obj/weapon.dm +++ b/code/defines/obj/weapon.dm @@ -510,6 +510,7 @@ w_class = 2.0 throw_speed = 2 throw_range = 10 + var/catch = 1 /obj/item/weapon/chemsprayer desc = "A utility used to spray large amounts of reagent in a given area." @@ -535,6 +536,7 @@ w_class = 2.0 throw_speed = 2 throw_range = 10 + var/catch = 1 /obj/item/weapon/clipboard name = "clipboard" diff --git a/code/game/objects/items/weapons/mops_cleaners.dm b/code/game/objects/items/weapons/mops_cleaners.dm index d1e81e6d614..ca4ce5544a4 100644 --- a/code/game/objects/items/weapons/mops_cleaners.dm +++ b/code/game/objects/items/weapons/mops_cleaners.dm @@ -13,11 +13,25 @@ MOP /obj/item/weapon/cleaner/attack(mob/living/carbon/human/M as mob, mob/user as mob) return +/obj/item/weapon/cleaner/attack_self(var/mob/user as mob) + switch(catch) + if(0) + user << "\blue You flip the safety back on." + catch = 1 + return + if(1) + user << "\blue You flip the safety off." + catch = 0 + return + /obj/item/weapon/cleaner/afterattack(atom/A as mob|obj, mob/user as mob) if (istype(A, /obj/item/weapon/storage )) return if (istype(A, /obj/effect/proc_holder/spell )) return + else if (catch == 1) + user << "\blue The safety is on!" + return else if (src.reagents.total_volume < 1) user << "\blue [src] is empty!" return @@ -174,6 +188,17 @@ MOP /obj/item/weapon/pepperspray/attack(mob/living/carbon/human/M as mob, mob/user as mob) return +/obj/item/weapon/pepperspray/attack_self(var/mob/user as mob) + switch(catch) + if(0) + user << "\blue You flip the safety on." + catch = 1 + return + if(1) + user << "\blue You flip the safety off." + catch = 0 + return + /obj/item/weapon/pepperspray/afterattack(atom/A as mob|obj, mob/user as mob) if (istype(A, /obj/item/weapon/storage )) return @@ -188,6 +213,9 @@ MOP else user << "\blue Pepper spray is already full!" return + else if (catch == 1) + user << "\blue The safety is on!" + return else if (src.reagents.total_volume < 1) user << "\blue [src] is empty!" return @@ -259,7 +287,7 @@ MOP /obj/item/weapon/pepperspray/examine() set src in usr - usr << text("\icon[] [] units of cleaner left!", src, src.reagents.total_volume) + usr << text("\icon[] [] units of pepperspray left!", src, src.reagents.total_volume) ..() return diff --git a/code/modules/chemical/Chemistry-Reagents.dm b/code/modules/chemical/Chemistry-Reagents.dm index fa3ee20e83d..8e4e7863458 100644 --- a/code/modules/chemical/Chemistry-Reagents.dm +++ b/code/modules/chemical/Chemistry-Reagents.dm @@ -1705,19 +1705,17 @@ datum M << "\red Your mask protects you from the pepperspray!" return - if(M:head) - M << "\red Your helmet protects you from the pepperspray!" - return if(M:glasses) M << "\red Your glasses protect you from most of the pepperspray!" M:emote("scream") - M.eye_blurry = max(M.eye_blurry, 2) + M.eye_blurry = max(M.eye_blurry, 20) + M.eye_blind = max(M.eye_blind, 6) return M:emote("scream") M << "\red You're sprayed directly in the eyes with pepperspray!" - M.eye_blurry = max(M.eye_blurry, 10) - M.eye_blind = max(M.eye_blind, 4) - M:paralysis = max(M:paralysis, 2) + M.eye_blurry = max(M.eye_blurry, 60) + M.eye_blind = max(M.eye_blind, 20) + M:paralysis = max(M:paralysis, 16) M.drop_item() frostoil diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 59fc7a2dbb0..6911ec8364f 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -60,10 +60,10 @@ ..() /mob/living/silicon/robot/proc/pick_module() - if(module) + if(module || modlock) return var/mod = input("Please, select a module!", "Robot", null, null) in list("Standard", "Engineering", "Medical", "Miner", "Janitor","Service", "Security") - if(module) + if(module || modlock) return switch(mod) if("Standard") @@ -71,7 +71,7 @@ hands.icon_state = "standard" icon_state = "robot" modtype = "Stand" - radio.borg(src, list()) + channels = list() if("Service") module = new /obj/item/weapon/robot_module/butler(src) @@ -88,14 +88,14 @@ else icon_state = "Service2" modtype = "Butler" - radio.borg(src, list()) + channels = list() if("Miner") module = new /obj/item/weapon/robot_module/miner(src) hands.icon_state = "miner" icon_state = "Miner" modtype = "Miner" - radio.borg(src, list("Mining" = 1)) + channels = list("Mining" = 1) if("Medical") var/sprite = input(src,"Chassis Style", "Chassis Style", "Cancel") in list("Humanoid","Non-Humanoid") @@ -106,7 +106,7 @@ if (sprite == "Non-Humanoid") src.icon_state = "surgeon" modtype = "Med" - radio.borg(src, list("Medical" = 1)) + channels = list("Medical" = 1) if("Security") var/sprite = input(src,"Chassis Style", "Chassis Style", "Cancel") in list("Humanoid","Non-Humanoid") @@ -117,7 +117,7 @@ if (sprite == "Non-Humanoid") src.icon_state = "bloodhound" modtype = "Sec" - radio.borg(src, list("Security" = 1)) + channels = list("Security" = 1) if("Engineering") var/sprite = input(src,"Chassis Style", "Chassis Style", "Cancel") in list("Humanoid","Non-Humanoid") @@ -128,7 +128,7 @@ if (sprite == "Non-Humanoid") src.icon_state = "landmate" modtype = "Eng" - radio.borg(src, list("Engineering" = 1)) + channels = list("Engineering" = 1) if("Janitor") var/sprite = input(src,"Chassis Style", "Chassis Style", "Cancel") in list("Humanoid","Non-Humanoid") @@ -139,9 +139,10 @@ if (sprite == "Non-Humanoid") src.icon_state = "mopgearrex" modtype = "Jan" - radio.borg(src, list()) + channels = list() overlays -= "eyes" //Takes off the eyes that it started with + radio.borg(src, channels) updateicon() /mob/living/silicon/robot/verb/cmd_robot_alerts() @@ -869,8 +870,10 @@ Frequency: [format_frequency(radio.frequency)] + +
-------- -"} +"} + for (var/ch_name in channels) + dat+=src.radio.text_sec_channel(ch_name, channels[ch_name]) + dat+={""} src << browse(dat, "window=radio") onclose(src, "radio") return @@ -947,6 +950,16 @@ Frequency: s_active.close(src) return +/mob/living/silicon/robot/proc/reset_module() + modtype = "robot" + hands.icon_state = "standard" + icon_state = "robot" + updateicon() + channels = list() + radio.borg(src, channels) + uneq_all() + del(module) + /mob/living/silicon/robot/proc/self_destruct() gib(1) diff --git a/code/modules/mob/living/silicon/robot/wires.dm b/code/modules/mob/living/silicon/robot/wires.dm index acf3c0dfcbb..8281d055116 100644 --- a/code/modules/mob/living/silicon/robot/wires.dm +++ b/code/modules/mob/living/silicon/robot/wires.dm @@ -2,18 +2,19 @@ #define BORG_WIRE_MAIN_POWER1 2 #define BORG_WIRE_MAIN_POWER2 3 #define BORG_WIRE_AI_CONTROL 4 +#define BORG_WIRE_MODULE 5 /proc/RandomBorgWires() //to make this not randomize the wires, just set index to 1 and increment it in the flag for loop (after doing everything else). - var/list/Borgwires = list(0, 0, 0, 0) - BorgIndexToFlag = list(0, 0, 0, 0) - BorgIndexToWireColor = list(0, 0, 0, 0) - BorgWireColorToIndex = list(0, 0, 0, 0) + var/list/Borgwires = list(0, 0, 0, 0, 0) + BorgIndexToFlag = list(0, 0, 0, 0, 0) + BorgIndexToWireColor = list(0, 0, 0, 0, 0) + BorgWireColorToIndex = list(0, 0, 0, 0, 0) var/flagIndex = 1 - for (var/flag=1, flag<16, flag+=flag) + for (var/flag=1, flag<32, flag+=flag) var/valid = 0 while (!valid) - var/colorIndex = rand(1, 4) + var/colorIndex = rand(1, 5) if (Borgwires[colorIndex]==0) valid = 1 Borgwires[colorIndex] = flag @@ -40,9 +41,17 @@ if (src.lawupdate == 1) src << "LawSync protocol engaged." src.show_laws() - if (BORG_WIRE_AI_CONTROL) //Cut the AI wire to reset AI control + if(BORG_WIRE_AI_CONTROL) //Cut the AI wire to reset AI control if (src.connected_ai) src.connected_ai = null + if(BORG_WIRE_MODULE) + if (src.module) + src.reset_module() + src.modlock = 1 + src << "\blue Your module has been reset, \red But you are locked into the standard module!" + else + src.modlock = 1 + src << "\red You are locked into the standard module!" src.interact(usr) /mob/living/silicon/robot/proc/mend(var/wireColor) @@ -53,6 +62,9 @@ if(BORG_WIRE_LAWCHECK) //turns law updates back on assuming the borg hasn't been emagged if (src.lawupdate == 0 && !src.emagged) src.lawupdate = 1 + if(BORG_WIRE_MODULE) + src.modlock = 0 + src << "\blue You are no longer locked into the standard module." src.interact(usr) @@ -66,6 +78,10 @@ if (BORG_WIRE_AI_CONTROL) //pule the AI wire to make the borg reselect an AI if(!src.emagged) src.connected_ai = activeais() + if(BORG_WIRE_MODULE) + if (src.module) + src.reset_module() + src << "\blue Your module has been reset." src.interact(usr) /mob/living/silicon/robot/proc/interact(mob/user) @@ -77,6 +93,7 @@ "Dark red" = 2, "White" = 3, "Yellow" = 4, + "Blue" = 5, ) for(var/wiredesc in Borgwires) var/is_uncut = src.borgwires & BorgWireColorToFlag[Borgwires[wiredesc]] @@ -87,7 +104,7 @@ t1 += "Cut " t1 += "Pulse " t1 += "
" - t1 += text("
\n[(src.lawupdate ? "The LawSync light is on." : "The LawSync light is off.")]
\n[(src.connected_ai ? "The AI link light is on." : "The AI link light is off.")]") + t1 += text("
\n[(src.lawupdate ? "The LawSync light is on." : "The LawSync light is off.")]
\n[(src.connected_ai ? "The AI link light is on." : "The AI link light is off.")]
\n[(src.modlock ? "The Module Lock light is on." : "The Module Lock light is off.")]") t1 += text("

Close

\n") user << browse(t1, "window=borgwires") onclose(user, "borgwires")