From e54fbcb9ec5231f3b07f4793aaac70765fb9efd4 Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Sat, 25 Apr 2015 11:59:15 +0200 Subject: [PATCH] Cleans up borg module code and responsibilities. --- code/game/machinery/camera/presets.dm | 42 +-- .../objects/items/robot/robot_upgrades.dm | 23 +- code/modules/mining/mine_turfs.dm | 2 +- .../modules/mob/living/silicon/robot/robot.dm | 155 ++-------- .../mob/living/silicon/robot/robot_modules.dm | 269 ++++++++++++++---- .../living/silicon/robot/robot_movement.dm | 2 +- .../living/silicon/robot/robot_upgrades.dm | 147 ---------- code/setup.dm | 29 ++ 8 files changed, 284 insertions(+), 385 deletions(-) delete mode 100644 code/modules/mob/living/silicon/robot/robot_upgrades.dm diff --git a/code/game/machinery/camera/presets.dm b/code/game/machinery/camera/presets.dm index 638f4d8d80..e71c04a174 100644 --- a/code/game/machinery/camera/presets.dm +++ b/code/game/machinery/camera/presets.dm @@ -1,22 +1,4 @@ // PRESETS -#define NETWORK_CRESCENT "Crescent" -#define NETWORK_CIVILIAN_EAST "Civilian East" -#define NETWORK_CIVILIAN_WEST "Civilian West" -#define NETWORK_COMMAND "Command" -#define NETWORK_ENGINE "Engine" -#define NETWORK_ENGINEERING "Engineering" -#define NETWORK_ENGINEERING_OUTPOST "Engineering Outpost" -#define NETWORK_ERT "ERT" -#define NETWORK_EXODUS "Exodus" -#define NETWORK_MEDBAY "Medbay" -#define NETWORK_MINE "MINE" -#define NETWORK_RESEARCH "Research" -#define NETWORK_RESEARCH_OUTPOST "Research Outpost" -#define NETWORK_PRISON "Prison" -#define NETWORK_SECURITY "Security" -#define NETWORK_TELECOM "Tcomsat" -#define NETWORK_THUNDER "thunder" - var/global/list/station_networks = list( NETWORK_CIVILIAN_EAST, NETWORK_CIVILIAN_WEST, @@ -25,7 +7,7 @@ var/global/list/station_networks = list( NETWORK_ENGINEERING, NETWORK_ENGINEERING_OUTPOST, NETWORK_EXODUS, - NETWORK_MEDBAY, + NETWORK_MEDICAL, NETWORK_MINE, NETWORK_RESEARCH, NETWORK_RESEARCH_OUTPOST, @@ -73,7 +55,7 @@ var/global/list/engineering_networks = list( network = list(NETWORK_PRISON) /obj/machinery/camera/network/medbay - network = list(NETWORK_MEDBAY) + network = list(NETWORK_MEDICAL) /obj/machinery/camera/network/research network = list(NETWORK_RESEARCH) @@ -105,7 +87,7 @@ var/global/list/engineering_networks = list( network = list(NETWORK_SECURITY) /obj/machinery/camera/xray/medbay - network = list(NETWORK_MEDBAY) + network = list(NETWORK_MEDICAL) /obj/machinery/camera/xray/research network = list(NETWORK_RESEARCH) @@ -191,21 +173,3 @@ var/global/list/engineering_networks = list( if (isMotion()) mult++ active_power_usage = mult*initial(active_power_usage) - -#undef NETWORK_CENTRAL_CRESCENT -#undef NETWORK_CIVILIAN_EAST -#undef NETWORK_CIVILIAN_WEST -#undef NETWORK_COMMAND -#undef NETWORK_ENGINE -#undef NETWORK_ENGINEERING -#undef NETWORK_ENGINEERING_OUTPOST -#undef NETWORK_ERT -#undef NETWORK_EXODUS -#undef NETWORK_MEDBAY -#undef NETWORK_MINE -#undef NETWORK_RESEARCH -#undef NETWORK_RESEARCH_OUTPOST -#undef NETWORK_PRISON -#undef NETWORK_SECURITY -#undef NETWORK_TELECOM -#undef NETWORK_THUNDER diff --git a/code/game/objects/items/robot/robot_upgrades.dm b/code/game/objects/items/robot/robot_upgrades.dm index 43b852e249..9930a6f2ea 100644 --- a/code/game/objects/items/robot/robot_upgrades.dm +++ b/code/game/objects/items/robot/robot_upgrades.dm @@ -28,20 +28,17 @@ /obj/item/borg/upgrade/reset/action(var/mob/living/silicon/robot/R) if(..()) return 0 R.uneq_all() - R.hands.icon_state = "nomod" - R.icon_state = "robot" - //world << R.custom_sprite - if(R.custom_sprite == 1) - //world << R.icon_state - icon = 'icons/mob/custom-synthetic.dmi' - R.icon_state = "[R.ckey]-Standard" - del(R.module) + R.modtype = initial(R.modtype) + R.hands.icon_state = initial(R.hands.icon_state) + + R.choose_icon(1, R.set_module_sprites(list("Default" = "robot"))) + R.notify_ai(ROBOT_NOTIFICATION_MODULE_RESET, R.module.name) + R.module.Reset(R) + qdel(R.module) R.module = null - R.camera.remove_networks(list("Engineering","Medical","MINE")) + R.updatename("Default") - R.status_flags |= CANPUSH - R.updateicon() return 1 @@ -116,7 +113,7 @@ /obj/item/borg/upgrade/tasercooler/action(var/mob/living/silicon/robot/R) if(..()) return 0 - if(!istype(R.module, /obj/item/weapon/robot_module/security)) + if(!R.module || !(src in R.module.supported_upgrades)) R << "Upgrade mounting error! No suitable hardpoint detected!" usr << "There's no mounting point for the module!" return 0 @@ -150,7 +147,7 @@ /obj/item/borg/upgrade/jetpack/action(var/mob/living/silicon/robot/R) if(..()) return 0 - if(!istype(R.module, /obj/item/weapon/robot_module/miner)) + if(!R.module || !(src in R.module.supported_upgrades)) R << "Upgrade mounting error! No suitable hardpoint detected!" usr << "There's no mounting point for the module!" return 0 diff --git a/code/modules/mining/mine_turfs.dm b/code/modules/mining/mine_turfs.dm index c56bcde642..c86709b8a5 100644 --- a/code/modules/mining/mine_turfs.dm +++ b/code/modules/mining/mine_turfs.dm @@ -507,7 +507,7 @@ ..() if(istype(M,/mob/living/silicon/robot)) var/mob/living/silicon/robot/R = M - if(istype(R.module, /obj/item/weapon/robot_module/miner)) + if(R.module) if(istype(R.module_state_1,/obj/item/weapon/storage/bag/ore)) attackby(R.module_state_1,R) else if(istype(R.module_state_2,/obj/item/weapon/storage/bag/ore)) diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index c1c646e30a..a8dfec1e7f 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -73,7 +73,6 @@ 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 = 31 // 0b11111 var/killswitch = 0 var/killswitch_time = 60 var/weapon_lock = 0 @@ -235,6 +234,13 @@ mmi = null ..() +/mob/living/silicon/robot/proc/set_module_sprites(var/list/new_sprites) + module_sprites = new_sprites + //Custom_sprite check and entry + if (custom_sprite == 1) + module_sprites["Custom"] = "[src.ckey]-[modtype]" + return module_sprites + /mob/living/silicon/robot/proc/pick_module() if(module) return @@ -247,138 +253,16 @@ if(module) return + if(!(modtype in robot_modules)) + return - module_sprites = list() - switch(modtype) - if("Standard") - module = new /obj/item/weapon/robot_module/standard(src) - module_sprites["Basic"] = "robot_old" - module_sprites["Android"] = "droid" - module_sprites["Default"] = "robot" - module_sprites["Drone"] = "drone-standard" - - if("Service") - module = new /obj/item/weapon/robot_module/butler(src) - module.channels = list("Service" = 1) - module_sprites["Waitress"] = "Service" - module_sprites["Kent"] = "toiletbot" - module_sprites["Bro"] = "Brobot" - module_sprites["Rich"] = "maximillion" - module_sprites["Default"] = "Service2" - module_sprites["Drone - Service"] = "drone-service" - module_sprites["Drone - Hydro"] = "drone-hydro" - - if("Clerical") - module = new /obj/item/weapon/robot_module/clerical(src) - module.channels = list("Service" = 1) - module_sprites["Waitress"] = "Service" - module_sprites["Kent"] = "toiletbot" - module_sprites["Bro"] = "Brobot" - module_sprites["Rich"] = "maximillion" - module_sprites["Default"] = "Service2" - module_sprites["Drone"] = "drone-service" - - if("Research") - module = new /obj/item/weapon/robot_module/research(src) - module.channels = list("Science" = 1) - module_sprites["Droid"] = "droid-science" - module_sprites["Drone"] = "drone-science" - - if("Miner") - module = new /obj/item/weapon/robot_module/miner(src) - module.channels = list("Supply" = 1) - if(camera && "Robots" in camera.network) - camera.add_network("MINE") - module_sprites["Basic"] = "Miner_old" - module_sprites["Advanced Droid"] = "droid-miner" - module_sprites["Treadhead"] = "Miner" - module_sprites["Drone"] = "drone-miner" - - if("Crisis") - module = new /obj/item/weapon/robot_module/crisis(src) - module.channels = list("Medical" = 1) - if(camera && "Robots" in camera.network) - camera.add_network("Medical") - module_sprites["Basic"] = "Medbot" - module_sprites["Standard"] = "surgeon" - module_sprites["Advanced Droid"] = "droid-medical" - module_sprites["Needles"] = "medicalrobot" - module_sprites["Drone - Medical" ] = "drone-medical" - module_sprites["Drone - Chemistry" ] = "drone-chemistry" - - if("Surgeon") - module = new /obj/item/weapon/robot_module/surgeon(src) - module.channels = list("Medical" = 1) - if(camera && "Robots" in camera.network) - camera.add_network("Medical") - - module_sprites["Basic"] = "Medbot" - module_sprites["Standard"] = "surgeon" - module_sprites["Advanced Droid"] = "droid-medical" - module_sprites["Needles"] = "medicalrobot" - module_sprites["Drone"] = "drone-surgery" - - if("Security") - module = new /obj/item/weapon/robot_module/security(src) - module.channels = list("Security" = 1) - module_sprites["Basic"] = "secborg" - module_sprites["Red Knight"] = "Security" - module_sprites["Black Knight"] = "securityrobot" - module_sprites["Bloodhound"] = "bloodhound" - module_sprites["Bloodhound - Treaded"] = "secborg+tread" - module_sprites["Drone"] = "drone-sec" - - if("Engineering") - module = new /obj/item/weapon/robot_module/engineering(src) - module.channels = list("Engineering" = 1) - if(camera && "Robots" in camera.network) - camera.add_network("Engineering") - module_sprites["Basic"] = "Engineering" - module_sprites["Antique"] = "engineerrobot" - module_sprites["Landmate"] = "landmate" - module_sprites["Landmate - Treaded"] = "engiborg+tread" - module_sprites["Drone"] = "drone-engineer" - - if("Construction") - module = new /obj/item/weapon/robot_module/construction(src) - module.channels = list("Engineering" = 1) - if(camera && "Robots" in camera.network) - camera.add_network("Engineering") - module_sprites["Basic"] = "Engineering" - module_sprites["Antique"] = "engineerrobot" - module_sprites["Landmate"] = "landmate" - module_sprites["Landmate - Treaded"] = "engiborg+tread" - module_sprites["Drone"] = "drone-engineer" - - if("Janitor") - module = new /obj/item/weapon/robot_module/janitor(src) - module.channels = list("Service" = 1) - module_sprites["Basic"] = "JanBot2" - module_sprites["Mopbot"] = "janitorrobot" - module_sprites["Mop Gear Rex"] = "mopgearrex" - module_sprites["Drone"] = "drone-janitor" - - if("Combat") - module = new /obj/item/weapon/robot_module/combat(src) - module_sprites["Combat Android"] = "droid-combat" - module.channels = list("Security" = 1) - - //languages - module.add_languages(src) - - //Custom_sprite check and entry - if (custom_sprite == 1) - module_sprites["Custom"] = "[src.ckey]-[modtype]" + var/module_type = robot_modules[modtype] + module = new module_type(src) hands.icon_state = lowertext(modtype) feedback_inc("cyborg_[lowertext(modtype)]",1) updatename() - - if(modtype == "Medical" || modtype == "Security" || modtype == "Combat") - status_flags &= ~CANPUSH - - choose_icon(6,module_sprites) - radio.config(module.channels) + choose_icon(6, set_module_sprites(module.sprites)) notify_ai(ROBOT_NOTIFICATION_NEW_MODULE, module.name) /mob/living/silicon/robot/proc/updatename(var/prefix as text) @@ -803,11 +687,14 @@ src << "Obey these laws:" laws.show_laws(src) src << "\red \b ALERT: [user.real_name] is your new master. Obey your new laws and his commands." - if(src.module && istype(src.module, /obj/item/weapon/robot_module/miner)) + if(src.module) + var/rebuild = 0 for(var/obj/item/weapon/pickaxe/borgdrill/D in src.module.modules) - del(D) - src.module.modules += new /obj/item/weapon/pickaxe/diamonddrill(src.module) - src.module.rebuild() + qdel(D) + rebuild = 1 + if(rebuild) + src.module.modules += new /obj/item/weapon/pickaxe/diamonddrill(src.module) + src.module.rebuild() updateicon() else user << "You fail to hack [src]'s interface." @@ -897,7 +784,6 @@ return 0 /mob/living/silicon/robot/updateicon() - overlays.Cut() if(stat == 0) overlays += "eyes-[module_sprites[icontype]]" @@ -1136,6 +1022,8 @@ if (custom_sprite == 1) icontype = "Custom" triesleft = 0 + else if(module_sprites.len == 1) + icontype = module_sprites[1] else icontype = input("Select an icon! [triesleft ? "You have [triesleft] more chances." : "This is your last try."]", "Robot", null, null) in module_sprites @@ -1146,7 +1034,6 @@ icon_state = module_sprites[1] return - overlays -= "eyes" updateicon() if (triesleft >= 1) diff --git a/code/modules/mob/living/silicon/robot/robot_modules.dm b/code/modules/mob/living/silicon/robot/robot_modules.dm index a48adddeb8..fd837cc7ca 100644 --- a/code/modules/mob/living/silicon/robot/robot_modules.dm +++ b/code/modules/mob/living/silicon/robot/robot_modules.dm @@ -1,3 +1,18 @@ +var/global/list/robot_modules = list( + "Standard" = /obj/item/weapon/robot_module/standard, + "Service" = /obj/item/weapon/robot_module/butler, + "Clerical" = /obj/item/weapon/robot_module/clerical, + "Research" = /obj/item/weapon/robot_module/research, + "Miner" = /obj/item/weapon/robot_module/miner, + "Crisis" = /obj/item/weapon/robot_module/crisis, + "Surgeon" = /obj/item/weapon/robot_module/surgeon, + "Security" = /obj/item/weapon/robot_module/security/general, + "Engineering" = /obj/item/weapon/robot_module/engineering/general, + "Construction" = /obj/item/weapon/robot_module/engineering/construction, + "Janitor" = /obj/item/weapon/robot_module/janitor, + "Combat" = /obj/item/weapon/robot_module/security/combat + ) + /obj/item/weapon/robot_module name = "robot module" icon = 'icons/obj/module.dmi' @@ -6,11 +21,39 @@ item_state = "electronic" flags = CONDUCT var/channels = list() + var/networks = list() + var/languages = list(LANGUAGE_SOL_COMMON = 1, LANGUAGE_TRADEBAND = 1, LANGUAGE_UNATHI = 0, LANGUAGE_SIIK_TAJR = 0, LANGUAGE_SKRELLIAN = 0, LANGUAGE_GUTTER = 0) + var/sprites = list() + var/can_be_pushed = 1 + var/no_slip = 0 var/list/modules = list() var/list/datum/matter_synth/synths = list() var/obj/item/emag = null var/obj/item/borg/upgrade/jetpack = null + var/list/obj/item/borg/upgrade/supported_upgrades = list() + + // Bookkeeping + var/list/added_languages = list() + var/list/added_networks = list() + var/obj/item/device/radio/borg/modified_radio = null + var/list/modified_key = null + var/list/original_radio_channels = list() + +/obj/item/weapon/robot_module/New(var/mob/living/silicon/robot/R) + ..() + add_camera_networks(R) + add_languages(R) + add_radio_channels(R) + apply_status_flags(R) + +/obj/item/weapon/robot_module/proc/Reset(var/mob/living/silicon/robot/R) + ..() + remove_camera_networks(R) + remove_languages(R) + remove_radio_channels(R) + remove_status_flags(R) + /obj/item/weapon/robot_module/emp_act(severity) if(modules) for(var/obj/O in modules) @@ -24,7 +67,6 @@ return /obj/item/weapon/robot_module/proc/respawn_consumable(var/mob/living/silicon/robot/R, var/rate) - if(!synths || !synths.len) return @@ -39,16 +81,59 @@ modules += O /obj/item/weapon/robot_module/proc/add_languages(var/mob/living/silicon/robot/R) - //full set of languages - R.add_language("Sol Common", 1) - R.add_language("Tradeband", 1) - R.add_language("Sinta'unathi", 0) - R.add_language("Siik'tajr", 0) - R.add_language("Skrellian", 0) - R.add_language("Gutter", 0) + for(var/language in languages) + if(R.add_language(language, languages[language])) + added_languages |= language + +/obj/item/weapon/robot_module/proc/remove_languages(var/mob/living/silicon/robot/R) + for(var/language in added_languages) + R.remove_language(language) + added_languages.Cut() + +/obj/item/weapon/robot_module/proc/add_camera_networks(var/mob/living/silicon/robot/R) + if(R.camera && "Robots" in R.camera.network) + for(var/network in networks) + if(!(network in R.camera.network)) + R.camera.add_network(network) + added_networks |= network + +/obj/item/weapon/robot_module/proc/remove_camera_networks(var/mob/living/silicon/robot/R) + if(R.camera) + R.camera.remove_networks(added_networks) + added_networks.Cut() + +/obj/item/weapon/robot_module/proc/add_radio_channels(var/mob/living/silicon/robot/R) + if(!R.radio) + return + + modified_radio = R.radio + modified_key = R.radio.keyslot + original_radio_channels = modified_radio.channels.Copy() + modified_radio.config(channels) + +/obj/item/weapon/robot_module/proc/remove_radio_channels(var/mob/living/silicon/robot/R) + // Only reset if the original radio component hasn't been altered/replaced + if(!(R.radio && R.radio == modified_radio && R.radio.keyslot == modified_key)) + return + + modified_radio.config(original_radio_channels) + original_radio_channels.Cut() + +/obj/item/weapon/robot_module/proc/apply_status_flags(var/mob/living/silicon/robot/R) + if(!can_be_pushed) + R.status_flags &= ~CANPUSH + +/obj/item/weapon/robot_module/proc/remove_status_flags(var/mob/living/silicon/robot/R) + if(!can_be_pushed) + R.status_flags |= CANPUSH /obj/item/weapon/robot_module/standard name = "standard robot module" + sprites = list( "Basic" = "robot_old", + "Android" = "droid", + "Default" = "robot", + "Drone" = "drone-standard" + ) /obj/item/weapon/robot_module/standard/New() ..() @@ -63,6 +148,16 @@ /obj/item/weapon/robot_module/surgeon name = "surgeon robot module" + channels = list("Medical" = 1) + networks = list(NETWORK_MEDICAL) + can_be_pushed = 0 + sprites = list( + "Basic" = "Medbot", + "Standard" = "surgeon", + "Advanced Droid" = "droid-medical", + "Needles" = "medicalrobot", + "Drone" = "drone-surgery" + ) /obj/item/weapon/robot_module/surgeon/New() ..() @@ -107,6 +202,17 @@ /obj/item/weapon/robot_module/crisis name = "crisis robot module" + channels = list("Medical" = 1) + networks = list(NETWORK_MEDICAL) + can_be_pushed = 0 + sprites = list( + "Basic" = "Medbot", + "Standard" = "surgeon", + "Advanced Droid" = "droid-medical", + "Needles" = "medicalrobot", + "Drone - Medical" = "drone-medical", + "Drone - Chemistry" = "drone-chemistry" + ) /obj/item/weapon/robot_module/crisis/New() ..() @@ -160,10 +266,24 @@ ..() -/obj/item/weapon/robot_module/construction - name = "construction robot module" -/obj/item/weapon/robot_module/construction/New() +/obj/item/weapon/robot_module/engineering + name = "engineering robot module" + channels = list("Engineering" = 1) + networks = list(NETWORK_ENGINEERING) + sprites = list( + "Basic" = "Engineering", + "Antique" = "engineerrobot", + "Landmate" = "landmate", + "Landmate - Treaded" = "engiborg+tread", + "Drone" = "drone-engineer" + ) + +/obj/item/weapon/robot_module/engineering/construction + name = "construction robot module" + no_slip = 1 + +/obj/item/weapon/robot_module/engineering/construction/New() ..() src.modules += new /obj/item/device/flash(src) src.modules += new /obj/item/borg/sight/meson(src) @@ -198,10 +318,7 @@ RG.synths = list(metal, glass) src.modules += RG -/obj/item/weapon/robot_module/engineering - name = "engineering robot module" - -/obj/item/weapon/robot_module/engineering/New() +/obj/item/weapon/robot_module/engineering/general/New() ..() src.modules += new /obj/item/device/flash(src) src.modules += new /obj/item/borg/sight/meson(src) @@ -259,8 +376,22 @@ /obj/item/weapon/robot_module/security name = "security robot module" + channels = list("Security" = 1) + networks = list(NETWORK_SECURITY) + can_be_pushed = 0 + supported_upgrades = list(/obj/item/borg/upgrade/tasercooler) -/obj/item/weapon/robot_module/security/New() +/obj/item/weapon/robot_module/security/general + sprites = list( + "Basic" = "secborg", + "Red Knight" = "Security", + "Black Knight" = "securityrobot", + "Bloodhound" = "bloodhound", + "Bloodhound - Treaded" = "secborg+tread", + "Drone" = "drone-sec" + ) + +/obj/item/weapon/robot_module/security/general/New() ..() src.modules += new /obj/item/device/flash(src) src.modules += new /obj/item/borg/sight/hud/sec(src) @@ -288,6 +419,13 @@ /obj/item/weapon/robot_module/janitor name = "janitorial robot module" + channels = list("Service" = 1) + sprites = list( + "Basic" = "JanBot2", + "Mopbot" = "janitorrobot", + "Mop Gear Rex" = "mopgearrex", + "Drone" = "drone-janitor" + ) /obj/item/weapon/robot_module/janitor/New() ..() @@ -310,6 +448,25 @@ /obj/item/weapon/robot_module/butler name = "service robot module" + channels = list("Service" = 1) + languages = list( + LANGUAGE_SOL_COMMON = 1, + LANGUAGE_UNATHI = 1, + LANGUAGE_SIIK_MAAS = 1, + LANGUAGE_SIIK_TAJR = 0, + LANGUAGE_SKRELLIAN = 1, + LANGUAGE_ROOTSPEAK = 1, + LANGUAGE_TRADEBAND = 1, + LANGUAGE_GUTTER = 1 + ) + sprites = list( "Waitress" = "Service", + "Kent" = "toiletbot", + "Bro" = "Brobot", + "Rich" = "maximillion", + "Default" = "Service2", + "Drone - Service" = "drone-service", + "Drone - Hydro" = "drone-hydro" + ) /obj/item/weapon/robot_module/butler/New() ..() @@ -343,19 +500,27 @@ src.emag.name = "Mickey Finn's Special Brew" return -/obj/item/weapon/robot_module/butler/add_languages(var/mob/living/silicon/robot/R) - //full set of languages - R.add_language("Sol Common", 1) - R.add_language("Sinta'unathi", 1) - R.add_language("Siik'maas", 1) - R.add_language("Siik'tajr", 0) - R.add_language("Skrellian", 1) - R.add_language("Rootspeak", 1) - R.add_language("Tradeband", 1) - R.add_language("Gutter", 1) - /obj/item/weapon/robot_module/clerical name = "clerical robot module" + channels = list("Service" = 1) + languages = list( + LANGUAGE_SOL_COMMON = 1, + LANGUAGE_UNATHI = 1, + LANGUAGE_SIIK_MAAS = 1, + LANGUAGE_SIIK_TAJR = 0, + LANGUAGE_SKRELLIAN = 1, + LANGUAGE_ROOTSPEAK = 1, + LANGUAGE_TRADEBAND = 1, + LANGUAGE_GUTTER = 1 + ) + sprites = list( + "Waitress" = "Service", + "Kent" = "toiletbot", + "Bro" = "Brobot", + "Rich" = "maximillion", + "Default" = "Service2", + "Drone" = "drone-service" + ) /obj/item/weapon/robot_module/clerical/New() ..() @@ -366,16 +531,6 @@ src.modules += new /obj/item/weapon/hand_labeler(src) src.emag = new /obj/item/weapon/stamp/denied(src) -/obj/item/weapon/robot_module/clerical/add_languages(var/mob/living/silicon/robot/R) - R.add_language("Sol Common", 1) - R.add_language("Sinta'unathi", 1) - R.add_language("Siik'maas", 1) - R.add_language("Siik'tajr", 0) - R.add_language("Skrellian", 1) - R.add_language("Rootspeak", 1) - R.add_language("Tradeband", 1) - R.add_language("Gutter", 1) - /obj/item/weapon/robot_module/butler/respawn_consumable(var/mob/living/silicon/robot/R, var/amount) var/obj/item/weapon/reagent_containers/food/condiment/enzyme/E = locate() in src.modules E.reagents.add_reagent("enzyme", 2 * amount) @@ -385,6 +540,15 @@ /obj/item/weapon/robot_module/miner name = "miner robot module" + channels = list("Supply" = 1) + networks = list(NETWORK_MINE) + sprites = list( + "Basic" = "Miner_old", + "Advanced Droid" = "droid-miner", + "Treadhead" = "Miner", + "Drone" = "drone-miner" + ) + supported_upgrades = list(/obj/item/borg/upgrade/jetpack) /obj/item/weapon/robot_module/miner/New() ..() @@ -403,6 +567,11 @@ /obj/item/weapon/robot_module/research name = "research module" + channels = list("Science" = 1) + sprites = list( + "Droid" = "droid-science", + "Drone" = "drone-science" + ) /obj/item/weapon/robot_module/research/New() ..() @@ -435,6 +604,14 @@ /obj/item/weapon/robot_module/syndicate name = "illegal robot module" + languages = list( + LANGUAGE_SOL_COMMON = 1, + LANGUAGE_TRADEBAND = 1, + LANGUAGE_UNATHI = 0, + LANGUAGE_SIIK_TAJR = 0, + LANGUAGE_SKRELLIAN = 0, + LANGUAGE_GUTTER = 1 + ) /obj/item/weapon/robot_module/syndicate/New(var/mob/living/silicon/robot/R) ..() @@ -448,17 +625,9 @@ R.internals = jetpack return -/obj/item/weapon/robot_module/syndicate/add_languages(var/mob/living/silicon/robot/R) - //full set of languages - R.add_language("Sol Common", 1) - R.add_language("Tradeband", 1) - R.add_language("Sinta'unathi", 0) - R.add_language("Siik'tajr", 0) - R.add_language("Skrellian", 0) - R.add_language("Gutter", 1) - -/obj/item/weapon/robot_module/combat +/obj/item/weapon/robot_module/security/combat name = "combat robot module" + sprites = list("Combat Android" = "droid-combat") /obj/item/weapon/robot_module/combat/New() ..() @@ -473,6 +642,7 @@ /obj/item/weapon/robot_module/drone name = "drone module" + no_slip = 1 /obj/item/weapon/robot_module/drone/New() ..() @@ -544,14 +714,13 @@ /obj/item/weapon/robot_module/drone/construction name = "construction drone module" + channels = list("Engineering" = 1) + languages = list() /obj/item/weapon/robot_module/drone/construction/New() ..() src.modules += new /obj/item/weapon/rcd/borg(src) -/obj/item/weapon/robot_module/drone/add_languages(var/mob/living/silicon/robot/R) - return //not much ROM to spare in that tiny microprocessor! - /obj/item/weapon/robot_module/drone/respawn_consumable(var/mob/living/silicon/robot/R, var/amount) var/obj/item/device/lightreplacer/LR = locate() in src.modules LR.Charge(R, amount) diff --git a/code/modules/mob/living/silicon/robot/robot_movement.dm b/code/modules/mob/living/silicon/robot/robot_movement.dm index f9265a383f..5ea383aaa6 100644 --- a/code/modules/mob/living/silicon/robot/robot_movement.dm +++ b/code/modules/mob/living/silicon/robot/robot_movement.dm @@ -1,5 +1,5 @@ /mob/living/silicon/robot/Process_Spaceslipping(var/prob_slip) - if(module && (istype(module,/obj/item/weapon/robot_module/construction) || istype(module,/obj/item/weapon/robot_module/drone))) + if(module && module.no_slip) return 0 ..(prob_slip) diff --git a/code/modules/mob/living/silicon/robot/robot_upgrades.dm b/code/modules/mob/living/silicon/robot/robot_upgrades.dm deleted file mode 100644 index a6d08bd534..0000000000 --- a/code/modules/mob/living/silicon/robot/robot_upgrades.dm +++ /dev/null @@ -1,147 +0,0 @@ -// robot_upgrades.dm -// Contains various borg upgrades. - -/obj/item/borg/upgrade/ - name = "A borg upgrade module." - desc = "Protected by FRM." - icon = 'icons/obj/module.dmi' - icon_state = "cyborg_upgrade" - 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." - icon_state = "cyborg_upgrade1" - require_module = 1 - -/obj/item/borg/upgrade/reset/action(var/mob/living/silicon/robot/R) - R.uneq_all() - del(R.module) - R.module = null - R.modtype = "robot" - R.real_name = "Cyborg [R.ident]" - R.name = R.real_name - R.nopush = 0 - R.hands.icon_state = "nomod" - R.base_icon = "robot" - R.icon_state = "robot" - R.updateicon() - R.languages = list() - R.speech_synthesizer_langs = list() - - 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) - icon_state = "cyborg_upgrade4" - 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) - icon_state = "cyborg_upgrade1" - - -/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) - icon_state = "cyborg_upgrade2" - 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) - icon_state = "cyborg_upgrade3" - require_module = 1 - - -/obj/item/borg/upgrade/tasercooler/action(var/mob/living/silicon/robot/R) - if(!istype(R.module, /obj/item/weapon/robot_module/security)) - R << "Upgrade mounting error! No suitable hardpoint detected!" - usr << "There's no mounting point for the module!" - return 0 - - var/obj/item/weapon/gun/energy/taser/mounted/cyborg/T = locate() in R.module - if(!T) - T = locate() in R.module.contents - if(!T) - T = locate() in R.module.modules - if(!T) - usr << "This cyborg has had its taser removed!" - return 0 - - if(T.recharge_time <= 2) - R << "Maximum cooling achieved for this hardpoint!" - usr << "There's no room for another cooling unit!" - return 0 - - else - T.recharge_time = max(2 , T.recharge_time - 4) - - return 1 - -/obj/item/borg/upgrade/jetpack/ - name = "Mining Borg Jetpack" - desc = "A carbon dioxide jetpack suitable for low-gravity mining operations" - construction_cost = list("metal"=10000,"phoron"=15000,"uranium" = 20000) - icon_state = "cyborg_upgrade3" - require_module = 1 - -/obj/item/borg/upgrade/jetpack/action(var/mob/living/silicon/robot/R) - if(!istype(R.module, /obj/item/weapon/robot_module/miner)) - R << "Upgrade mounting error! No suitable hardpoint detected!" - usr << "There's no mounting point for the module!" - return 0 - else - R.module.modules += new/obj/item/weapon/tank/jetpack/carbondioxide - for(var/obj/item/weapon/tank/jetpack/carbondioxide in R.module.modules) - R.internals = src - R.icon_state="Miner+j" - return 1 diff --git a/code/setup.dm b/code/setup.dm index 38836d54d5..15faf36ec1 100644 --- a/code/setup.dm +++ b/code/setup.dm @@ -917,3 +917,32 @@ var/list/be_special_flags = list( #define STAGE_FOUR 7 #define STAGE_FIVE 9 #define STAGE_SUPER 11 + +// Camera networks +#define NETWORK_CRESCENT "Crescent" +#define NETWORK_CIVILIAN_EAST "Civilian East" +#define NETWORK_CIVILIAN_WEST "Civilian West" +#define NETWORK_COMMAND "Command" +#define NETWORK_ENGINE "Engine" +#define NETWORK_ENGINEERING "Engineering" +#define NETWORK_ENGINEERING_OUTPOST "Engineering Outpost" +#define NETWORK_ERT "ERT" +#define NETWORK_EXODUS "Exodus" +#define NETWORK_MEDICAL "Medical" +#define NETWORK_MINE "MINE" +#define NETWORK_RESEARCH "Research" +#define NETWORK_RESEARCH_OUTPOST "Research Outpost" +#define NETWORK_PRISON "Prison" +#define NETWORK_SECURITY "Security" +#define NETWORK_TELECOM "Tcomsat" +#define NETWORK_THUNDER "thunder" + +// Languages +#define LANGUAGE_SOL_COMMON "Sol Common" +#define LANGUAGE_UNATHI "Sinta'unathi" +#define LANGUAGE_SIIK_MAAS "Siik'maas" +#define LANGUAGE_SIIK_TAJR "Siik'tajr" +#define LANGUAGE_SKRELLIAN "Skrellian" +#define LANGUAGE_ROOTSPEAK "Rootspeak" +#define LANGUAGE_TRADEBAND "Tradeband" +#define LANGUAGE_GUTTER "Gutter"