From f7e4ab6975ad2eb6510a720882e3a6f826b1fa50 Mon Sep 17 00:00:00 2001 From: Ren Erthilo Date: Wed, 2 May 2012 00:21:18 +0100 Subject: [PATCH] TG: Adds randomlly spawning rooms to the mining asteroid that contain various goodies. (Among them are a modified traitor beacon, a cloaking device and a closet full of resources so you can go build your own honk.) These rooms will spawn at least out of range of space and the explored pathways, so at the very least some mining is required to even detect them with mesons. Adds a borg upgrade system. Right now, it just contians a borg reset module that allows the borg to choose their module again. Adds some support code to borgs to suppot flashproofing and renaming. Adds a few various admin commands like a quick-list of objects (which is hardcoded) and a command to break the local air group. Revision: r3415 Author: VivianFoxfoot --- baystation12.dme | 5 + code/defines/area/Space Station 13 areas.dm | 18 +++ code/defines/global.dm | 2 +- code/game/asteroid/artifacts.dm | 115 +++++++++++++++ code/game/asteroid/asteroid.dm | 135 +++++++++++++++--- code/game/atom_procs.dm | 4 +- code/game/gamemodes/newobjective.dm | 32 ++++- code/game/machinery/flasher.dm | 12 +- code/game/master_controller.dm | 3 + code/game/mecha/mech_fabricator.dm | 19 ++- code/game/objects/alien/facehugger.dm | 50 ++++++- code/game/objects/devices/flash.dm | 5 +- code/game/turf.dm | 4 +- code/modules/admin/admin.dm | 9 ++ code/modules/admin/admin_verbs.dm | 2 + code/modules/admin/create_object.dm | 19 +++ code/modules/admin/verbs/diagnostics.dm | 22 +++ .../modules/mob/living/silicon/robot/robot.dm | 22 ++- .../living/silicon/robot/robot_upgrades.dm | 113 +++++++++++++++ 19 files changed, 554 insertions(+), 37 deletions(-) create mode 100644 code/game/asteroid/artifacts.dm create mode 100644 code/modules/mob/living/silicon/robot/robot_upgrades.dm diff --git a/baystation12.dme b/baystation12.dme index 01c9d5c6651..fdf1317104d 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -392,6 +392,10 @@ #include "code\game\vote.dm" #include "code\game\area\ai_monitored.dm" #include "code\game\area\areas.dm" +#include "code\game\asteroid\artifacts.dm" +#include "code\game\asteroid\asteroid.dm" +#include "code\game\asteroid\device.dm" +#include "code\game\asteroid\turf.dm" #include "code\game\events\Event.dm" #include "code\game\events\EventsMain.dm" #include "code\game\events\EventProcs\black_hole.dm" @@ -1006,6 +1010,7 @@ #include "code\modules\mob\living\silicon\robot\robot_defense.dm" #include "code\modules\mob\living\silicon\robot\robot_modules.dm" #include "code\modules\mob\living\silicon\robot\robot_movement.dm" +#include "code\modules\mob\living\silicon\robot\robot_upgrades.dm" #include "code\modules\mob\living\silicon\robot\say.dm" #include "code\modules\mob\living\silicon\robot\wires.dm" #include "code\modules\mob\new_player\hud.dm" diff --git a/code/defines/area/Space Station 13 areas.dm b/code/defines/area/Space Station 13 areas.dm index 0283b04f679..37418038f3d 100755 --- a/code/defines/area/Space Station 13 areas.dm +++ b/code/defines/area/Space Station 13 areas.dm @@ -383,6 +383,24 @@ proc/process_ghost_teleport_locs() icon_state = "cave" requires_power = 0 +/area/asteroid/artifactroom + name = "Asteroid - Artifact" + icon_state = "cave" + + + + + + + + + + + + + + + /area/planet/clown name = "Clown Planet" icon_state = "honk" diff --git a/code/defines/global.dm b/code/defines/global.dm index 1c52793d5e9..37dcd5f139f 100644 --- a/code/defines/global.dm +++ b/code/defines/global.dm @@ -12,7 +12,7 @@ var/global defer_powernet_rebuild = 0 // true if net rebuild will be called manually after an event -// list/global_map = null + list/global_map = null //list/global_map = list(list(1,5),list(4,3))//an array of map Z levels. //Resulting sector map looks like //|_1_|_4_| diff --git a/code/game/asteroid/artifacts.dm b/code/game/asteroid/artifacts.dm new file mode 100644 index 00000000000..3898632d46b --- /dev/null +++ b/code/game/asteroid/artifacts.dm @@ -0,0 +1,115 @@ +var/global/list/space_surprises = list( /obj/item/clothing/mask/facehugger/angry =4, + // /obj/effect/critter/spesscarp =2, + /obj/effect/critter/spesscarp/elite =2, + // /obj/creature =0, + // /obj/item/weapon/rcd =0, + // /obj/item/weapon/rcd_ammo =0, + // /obj/item/weapon/spacecash =0, + // /obj/item/weapon/cloaking_device =1, + // /obj/item/weapon/gun/energy/teleport_gun =0, + // /obj/item/weapon/rubber_chicken =0, + /obj/item/weapon/melee/energy/sword/pirate =3, + /obj/structure/closet/syndicate/resources =2, + // /obj/machinery/wish_granter =1, // Okayyyy... Mayyyybe Kor is kinda sorta right. A little. Tiny bit. >.> + // /obj/item/clothing/glasses/thermal =2, // Could maybe be cool as its own rapid mode, sorta like wizard. Maybe. + // /obj/item/weapon/storage/box/stealth/ =2 + + // =11 + ) + +var/global/list/spawned_surprises = list() + + + + + + + +/obj/machinery/wish_granter + name = "Wish Granter" + desc = "You're not so sure about this, anymore..." + icon = 'device.dmi' + icon_state = "syndbeacon" + + anchored = 1 + density = 1 + + var + charges = 1 + insisting = 0 + +/obj/machinery/wish_granter/attack_hand(var/mob/user as mob) + usr.machine = src + + if(charges <= 0) + user << "The Wish Granter lies silent." + return + + else if(!istype(user, /mob/living/carbon/human)) + user << "You feel a dark stirring inside of the Wish Granter, something you want nothing of. Your instincts are better than any man's." + return + + else if(is_special_character(user)) + user << "Even to a heart as dark as yours, you know nothing good will come of this. Something instinctual makes you pull away." + + else if (!insisting) + user << "Your first touch makes the Wish Granter stir, listening to you. Are you really sure you want to do this?" + insisting++ + + else + user << "You speak. [pick("I want the station to disappear","Humanity is corrupt, mankind must be destroyed","I want to be rich", "I want to rule the world","I want immortality.")]. The Wish Granter answers." + user << "Your head pounds for a moment, before your vision clears. You are the avatar of the Wish Granter, and your power is LIMITLESS! And it's all yours. You need to make sure no one can take it from you. No one can know, first." + + charges-- + insisting = 0 + + if (!(user.mutations & HULK)) + user.mutations |= HULK + + if (!(user.mutations & LASER)) + user.mutations |= LASER + + if (!(user.mutations & XRAY)) + user.mutations |= XRAY + user.sight |= (SEE_MOBS|SEE_OBJS|SEE_TURFS) + user.see_in_dark = 8 + user.see_invisible = 2 + + if (!(user.mutations & COLD_RESISTANCE)) + user.mutations |= COLD_RESISTANCE + + if (!(user.mutations & TK)) + user.mutations |= TK + + if(!(user.mutations & HEAL)) + user.mutations |= HEAL + + ticker.mode.traitors += user.mind + user.mind.special_role = "Avatar of the Wish Granter" + + var/datum/objective/silence/silence = new + silence.owner = user.mind + user.mind.objectives += silence + + var/obj_count = 1 + for(var/datum/objective/OBJ in user.mind.objectives) + user << "Objective #[obj_count]: [OBJ.explanation_text]" + obj_count++ + + world << "You have a very bad feeling about this." + + return + +/obj/item/weapon/storage/box/stealth/ + name = "Infiltration Gear" + desc = "An old box full of old equipment. It doesn't look like it was ever opened." + + +/obj/item/weapon/storage/box/stealth/New() + ..() + + new /obj/item/clothing/under/chameleon(src) + new /obj/item/clothing/mask/gas/voice(src) + new /obj/item/weapon/card/id/syndicate(src) + new /obj/item/clothing/shoes/syndigaloshes(src) + return diff --git a/code/game/asteroid/asteroid.dm b/code/game/asteroid/asteroid.dm index e3c7f684215..ad71d8e66cc 100644 --- a/code/game/asteroid/asteroid.dm +++ b/code/game/asteroid/asteroid.dm @@ -1,3 +1,8 @@ +var/global/max_secret_rooms = 3 + + + + proc/spawn_asteroid(var/turf/start_loc,var/type,var/size,var/richness)//type: 0 or null - random, 1 - nothing, 2 - iron, 3 - silicon if(!size) size = pick(100;2,50;3,35;4,25;6,10;12) @@ -51,7 +56,8 @@ proc/spawn_asteroid(var/turf/start_loc,var/type,var/size,var/richness)//type: 0 density-- return - +//this is terrible! -Pete +/* /datum/game_mode/proc/setup_sectors() world << "\blue \b Randomizing space sectors." var/list/sectors = list(1,3,4,0,0,0,0,0,0) @@ -95,9 +101,9 @@ proc/spawn_asteroid(var/turf/start_loc,var/type,var/size,var/richness)//type: 0 new /obj/item/weapon/storage/explorers_box(L.loc) del(L) return +*/ - -proc/spawn_room(var/atom/start_loc,var/x_size,var/y_size,var/wall,var/floor) +proc/spawn_room(var/atom/start_loc,var/x_size,var/y_size,var/wall,var/floor , var/clean = 0 , var/name) var/list/room_turfs = list("walls"=list(),"floors"=list()) //world << "Room spawned at [start_loc.x],[start_loc.y],[start_loc.z]" @@ -110,24 +116,45 @@ proc/spawn_room(var/atom/start_loc,var/x_size,var/y_size,var/wall,var/floor) for(var/y = 0,y 100) + return 0 + + T=pick(turfs) + if(!T) + return 0 + + var/list/surroundings = list() + + surroundings += range(7, locate(T.x,T.y,T.z)) + surroundings += range(7, locate(T.x+size,T.y,T.z)) + surroundings += range(7, locate(T.x,T.y+size,T.z)) + surroundings += range(7, locate(T.x+size,T.y+size,T.z)) + + if(locate(/area/mine/explored) in surroundings) // +5s are for view range + valid = 0 + continue + + if(locate(/turf/space) in surroundings) + valid = 0 + continue + + if(locate(/area/asteroid/artifactroom) in surroundings) + valid = 0 + continue + + if(locate(/turf/simulated/floor/plating/airless/asteroid) in surroundings) + valid = 0 + continue + + if(!T) + return 0 + + room = spawn_room(T,size,size,,,1) + + if(room) + T = pick(room["floors"]) + if(T) + var/surprise = null + valid = 0 + while(!valid) + surprise = pickweight(space_surprises) + if(surprise in spawned_surprises) + if(prob(20)) + valid++ + else + continue + else + valid++ + + spawned_surprises.Add(surprise) + new surprise(T) + + return 1 + + diff --git a/code/game/atom_procs.dm b/code/game/atom_procs.dm index cf6fa3c275d..f01f0820f45 100644 --- a/code/game/atom_procs.dm +++ b/code/game/atom_procs.dm @@ -1071,7 +1071,7 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl return -/*/atom/proc/get_global_map_pos() +/atom/proc/get_global_map_pos() if(!islist(global_map) || isemptylist(global_map)) return var/cur_x = null var/cur_y = null @@ -1085,7 +1085,7 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl if(cur_x && cur_y) return list("x"=cur_x,"y"=cur_y) else - return 0 */ + return 0 /atom/proc/checkpass(passflag) return pass_flags&passflag diff --git a/code/game/gamemodes/newobjective.dm b/code/game/gamemodes/newobjective.dm index 0aacfc362ca..5d92803d2f3 100644 --- a/code/game/gamemodes/newobjective.dm +++ b/code/game/gamemodes/newobjective.dm @@ -1355,4 +1355,34 @@ datum captured_amount+=2 if(captured_amount 15 && prob(O.eye_stat + 50))) diff --git a/code/game/master_controller.dm b/code/game/master_controller.dm index 79afc790561..df8612e44a6 100644 --- a/code/game/master_controller.dm +++ b/code/game/master_controller.dm @@ -34,6 +34,9 @@ datum/controller/game_controller setupgenetics() + for(var/i = 0, i < max_secret_rooms, i++) + make_mining_asteroid_secret() + syndicate_code_phrase = generate_code_phrase()//Sets up code phrase for traitors, for the round. syndicate_code_response = generate_code_phrase() diff --git a/code/game/mecha/mech_fabricator.dm b/code/game/mecha/mech_fabricator.dm index 0bb8336a7f8..c6ac19dfb63 100644 --- a/code/game/mecha/mech_fabricator.dm +++ b/code/game/mecha/mech_fabricator.dm @@ -111,6 +111,21 @@ /obj/item/mecha_parts/mecha_equipment/weapon/honker ), + "Cyborg Upgrade Modules" = list( + /obj/item/borg/upgrade/reset, + /obj/item/borg/upgrade/restart, + /obj/item/borg/upgrade/vtec + ///obj/item/borg/upgrade/tasercooler + ///obj/item/borg/upgrade/flashproof + + + ), + + + + + + "Misc"=list(/obj/item/mecha_parts/mecha_tracking) ) @@ -128,6 +143,8 @@ component_parts += new /obj/item/weapon/stock_parts/console_screen(src) RefreshParts() + // part_sets["Cyborg Upgrade Modules"] = typesof(/obj/item/borg/upgrade/) - /obj/item/borg/upgrade/ // Eh. This does it dymaically, but to support having the items referenced otherwhere in the code but not being constructable, going to do it manaully. + for(var/part_set in part_sets) convert_part_set(part_set) files = new /datum/research(src) //Setup the research data holder. @@ -299,7 +316,7 @@ return proc/check_resources(var/obj/item/mecha_parts/part) - if(istype(part, /obj/item/robot_parts) || istype(part, /obj/item/mecha_parts)) + if(istype(part, /obj/item/robot_parts) || istype(part, /obj/item/mecha_parts) || istype(part,/obj/item/borg/upgrade)) for(var/resource in part.construction_cost) if(resource in src.resources) if(src.resources[resource] < get_resource_cost_w_coeff(part,resource)) diff --git a/code/game/objects/alien/facehugger.dm b/code/game/objects/alien/facehugger.dm index 7c54a78d604..3c35491fa39 100644 --- a/code/game/objects/alien/facehugger.dm +++ b/code/game/objects/alien/facehugger.dm @@ -19,6 +19,8 @@ var/const var/strength = 5 + var/attached = 0 + attack_paw(user as mob) //can be picked up by aliens if(isalien(user)) attack_hand(user) @@ -87,6 +89,13 @@ var/const if(!isliving(M) || isalien(M)) return + if(attached) + return + else + attached++ + spawn(MAX_IMPREGNATION_TIME) + attached = 0 + var/mob/living/L = M //just so I don't need to use : if(stat != CONSCIOUS) @@ -180,7 +189,8 @@ var/const for(var/mob/living/carbon/alien/alien in world) var/image/activeIndicator = image('alien.dmi', loc = src, icon_state = "facehugger_active") activeIndicator.override = 1 - alien.client.images += activeIndicator + if(alien && alien.client) + alien.client.images += activeIndicator spawn(rand(MIN_ACTIVE_TIME,MAX_ACTIVE_TIME)) GoIdle() @@ -220,3 +230,41 @@ var/const return +/obj/item/clothing/mask/facehugger/angry + stat = CONSCIOUS + +/obj/item/clothing/mask/facehugger/angry/HasProximity(atom/movable/AM as mob|obj) + if(istype(AM , /mob/living/)) + Attach(AM) + + +/* +/obj/item/clothing/mask/facehugger/angry/New() + processing_objects.Add(src) + +/obj/item/clothing/mask/facehugger/angry/process() + if(!src || src.stat == (DEAD)) + return + + for(var/mob/living/carbon/C in range(1,src)) + Attach(C) + return + + for(var/mob/living/carbon/C in range(5,src)) + if(isInSight(C,src)) + step_to(src,C,0) + spawn(5) + if(C in range(1,src)) + Attach(C) + return + + step_rand(src) + + return + +/obj/item/clothing/mask/facehugger/angry/Attach(var/mob/M as mob) + + ..(M) + processing_objects.Remove(src) + +*/ \ No newline at end of file diff --git a/code/game/objects/devices/flash.dm b/code/game/objects/devices/flash.dm index cbe3dfd1768..3485a6c940f 100644 --- a/code/game/objects/devices/flash.dm +++ b/code/game/objects/devices/flash.dm @@ -97,7 +97,10 @@ flashfail = 1 else if(issilicon(M)) - M.Weaken(rand(5,10)) + if(!M:flashproof()) + M.Weaken(rand(5,10)) + else + flashfail++ if(isrobot(user)) spawn(0) diff --git a/code/game/turf.dm b/code/game/turf.dm index 7f1d1b64f7e..7fe3fc87a76 100644 --- a/code/game/turf.dm +++ b/code/game/turf.dm @@ -1421,7 +1421,7 @@ turf/simulated/floor/return_siding_icon_state() spawn (0) if ((A && A.loc)) A.loc.Entered(A) -/* + /turf/space/proc/Sandbox_Spacemove(atom/movable/A as mob|obj) var/cur_x var/cur_y @@ -1530,7 +1530,7 @@ turf/simulated/floor/return_siding_icon_state() if ((A && A.loc)) A.loc.Entered(A) return -*/ + /obj/effect/vaultspawner var/maxX = 6 var/maxY = 6 diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index e1e8fd34101..71811b312da 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -1372,11 +1372,19 @@ var/global/BSACooldown = 0 else alert("You are not a high enough administrator! Sorry!!!!") + if (href_list["quick_create_object"]) + if (src.rank in list("Admin Candidate", "Trial Admin", "Badmin", "Game Admin", "Game Master")) + return quick_create_object(usr) + else + alert("You are not a high enough administrator! Sorry!!!!") + + if (href_list["create_turf"]) if (src.rank in list("Admin Candidate", "Trial Admin", "Badmin", "Game Admin", "Game Master")) return create_turf(usr) else alert("You are not a high enough administrator! Sorry!!!!") + if (href_list["create_mob"]) if (src.rank in list("Badmin", "Game Admin", "Game Master")) return create_mob(usr) @@ -2519,6 +2527,7 @@ var/global/BSACooldown = 0 if(lvl >= 3 ) dat += "Create Object
" + dat += "Quick Create Object
" dat += "Create Turf
" if(lvl >= 5) dat += "Create Mob
" diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 8003709e898..ae551810a05 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -244,6 +244,7 @@ verbs += /client/proc/check_words verbs += /client/proc/drop_bomb verbs += /client/proc/cmd_admin_grantfullaccess + verbs += /client/proc/kill_airgroup verbs += /client/proc/cmd_admin_drop_everything verbs += /client/proc/make_sound verbs += /client/proc/play_local_sound @@ -443,6 +444,7 @@ //verbs -= /obj/admins/proc/unprison --Merged with player panel //verbs -= /client/proc/cmd_switch_radio --removed because tcommsat is staying verbs -= /client/proc/togglebuildmodeself + verbs -= /client/proc/kill_airgroup verbs -= /client/proc/admin_deny_shuttle verbs -= /client/proc/cmd_admin_christmas verbs -= /client/proc/editappear diff --git a/code/modules/admin/create_object.dm b/code/modules/admin/create_object.dm index 944ab89c7a6..248eebb5ab9 100644 --- a/code/modules/admin/create_object.dm +++ b/code/modules/admin/create_object.dm @@ -1,4 +1,5 @@ /var/create_object_html = null + /obj/admins/proc/create_object(var/mob/user) if (!create_object_html) var/objectjs = null @@ -7,3 +8,21 @@ create_object_html = dd_replacetext(create_object_html, "null /* object types */", "\"[objectjs]\"") user << browse(dd_replacetext(create_object_html, "/* ref src */", "\ref[src]"), "window=create_object;size=425x475") + + +/obj/admins/proc/quick_create_object(var/mob/user) + + var/quick_create_object_html = null + var/pathtext = null + + pathtext = input("Select the path of the object you wish to create.", "Path", "/obj") in list("/obj","/obj/structure","/obj/item","/obj/machinery") + + var path = text2path(pathtext) + + if (!quick_create_object_html) + var/objectjs = null + objectjs = dd_list2text(typesof(path), ";") + quick_create_object_html = file2text('create_object.html') + quick_create_object_html = dd_replacetext(quick_create_object_html, "null /* object types */", "\"[objectjs]\"") + + user << browse(dd_replacetext(quick_create_object_html, "/* ref src */", "\ref[src]"), "window=quick_create_object;size=425x475") \ No newline at end of file diff --git a/code/modules/admin/verbs/diagnostics.dm b/code/modules/admin/verbs/diagnostics.dm index 4c028c9e7f9..7d0a8710b86 100644 --- a/code/modules/admin/verbs/diagnostics.dm +++ b/code/modules/admin/verbs/diagnostics.dm @@ -202,6 +202,28 @@ //feedback_add_details("admin_verb","JDAG") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! return + kill_airgroup() + set name = "Kill Local Airgroup" + set desc = "Use this to allow manual manupliation of atmospherics." + set category = "Debug" + if(!holder) + src << "Only administrators may use this command." + return + + if(!air_master) + usr << "Cannot find air_system" + return + + var/turf/T = get_turf(usr) + if(istype(T, /turf/simulated)) + var/datum/air_group/AG = T:parent + AG.next_check = 30 + AG.group_processing = 0 + else + usr << "Local airgroup is unsimulated!" + //feedback_add_details("admin_verb","KLAG") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + + tension_report() set category = "Debug" set name = "Show Tension Report" diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 55799d5dc50..6a07be57098 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -551,6 +551,24 @@ if(prob(25)) src << "Hack attempt detected." return + + else if(istype(W, /obj/item/borg/upgrade/)) + var/obj/item/borg/upgrade/U = W + if(!opened) + usr << "You must access the borgs internals!" + else if(!src.module && U.require_module) + usr << "The borg must choose a module before he can be upgraded!" + else if(U.locked) + usr << "The upgrade is locked and cannot be used yet!" + else + if(U.action(src)) + usr << "You apply the upgrade to [src]!" + usr.drop_item() + U.loc = src + else + usr << "Upgrade error!" + + else spark_system.start() return ..() @@ -1207,9 +1225,9 @@ Frequency: src.verbs -= /mob/living/silicon/robot/proc/ResetSecurityCodes -/*/mob/living/silicon/robot/proc/flashproof() +/mob/living/silicon/robot/proc/flashproof() if(module) for(var/obj/item/borg/upgrade/flashproof/F in module.modules) return 1 - return 0*/ \ No newline at end of file + return 0 \ No newline at end of file diff --git a/code/modules/mob/living/silicon/robot/robot_upgrades.dm b/code/modules/mob/living/silicon/robot/robot_upgrades.dm new file mode 100644 index 00000000000..fe8d77dd7c8 --- /dev/null +++ b/code/modules/mob/living/silicon/robot/robot_upgrades.dm @@ -0,0 +1,113 @@ +// robot_upgrades.dm +// Contains various borg upgrades. + +/obj/item/borg/upgrade/ + name = "A borg upgrade module." + desc = "Protected by FRM." + icon = 'module.dmi' + icon_state = "id_mod" + var/construction_time = 120 + var/construction_cost = list("metal"=10000) + var/locked = 0 + var/require_module = 0 + var/installed = 0 + +/obj/item/borg/upgrade/proc/action() + return + + +/obj/item/borg/upgrade/reset/ + name = "Borg module reset board" + desc = "Used to reset a borg's module. Destroys any other upgrades applied to the borg." + require_module = 1 + +/obj/item/borg/upgrade/reset/action(var/mob/living/silicon/robot/R) + R.uneq_all() + R.hands.icon_state = "nomod" + R.icon_state = "robot" + del(R.module) + R.module = null + R.modtype = "robot" + R.real_name = "Cyborg [R.ident]" + R.name = R.real_name + R.nopush = 0 + R.updateicon() + + return 1 + + + +/obj/item/borg/upgrade/flashproof/ + name = "Borg Flash-Supression" + desc = "A highly advanced, complicated system for supressing incoming flashes directed at the borg's optical processing system." + construction_cost = list("metal"=10000,"gold"=2000,"silver"=3000,"glass"=2000, "diamond"=5000) + require_module = 1 + + +/obj/item/borg/upgrade/flashproof/New() // Why the fuck does the fabricator make a new instance of all the items? + //desc = "Sunglasses with duct tape." // Why? D: + +/obj/item/borg/upgrade/flashproof/action(var/mob/living/silicon/robot/R) + if(R.module) + R.module += src + + return 1 + +/obj/item/borg/upgrade/restart/ + name = "Borg emergancy restart module" + desc = "Used to force a restart of a disabled-but-repaired borg, bringing it back online." + construction_cost = list("metal"=60000 , "glass"=5000) + + +/obj/item/borg/upgrade/restart/action(var/mob/living/silicon/robot/R) + if(!R.key) + for(var/mob/dead/observer/ghost in world) + if(ghost.corpse == R && ghost.client) + ghost.client.mob = ghost.corpse + + if(R.health < 0) + usr << "You have to repair the borg before using this module!" + return 0 + + R.stat = 0 + return 1 + + +/obj/item/borg/upgrade/vtec/ + name = "Borg VTEC Module" + desc = "Used to kick in a borgs VTEC systems, increasing their speed." + construction_cost = list("metal"=80000 , "glass"=6000 , "gold"= 5000) + require_module = 1 + +/obj/item/borg/upgrade/vtec/action(var/mob/living/silicon/robot/R) + if(R.speed == -1) + return 0 + + R.speed-- + return 1 + + +/obj/item/borg/upgrade/tasercooler/ + name = "Borg Rapid Taser Cooling Module" + desc = "Used to cool a mounted taser, increasing the potential current in it and thus its recharge rate.." + construction_cost = list("metal"=80000 , "glass"=6000 , "gold"= 2000, "diamond" = 500) + require_module = 1 + + +/obj/item/borg/upgrade/tasercooler/action(var/mob/living/silicon/robot/R) + if(R.module != /obj/item/weapon/robot_module/security) + R << "Upgrade mounting error! No suitable hardpoint detected!" + return 0 + + var/obj/item/weapon/gun/energy/taser/cyborg/T = locate() in R + if(!T) + return 0 + + if(T.recharge_time <= 2) + R << "Maximum cooling achieved for this hardpoint!" + return 0 + + else + T.recharge_time = min(2 , T.recharge_time - 4) + + return 1 \ No newline at end of file