From 81d2298992ec6b503b1e4a4379a74671d7c99358 Mon Sep 17 00:00:00 2001 From: Remie Richards Date: Wed, 10 Aug 2016 01:18:15 +0100 Subject: [PATCH] Drone Phone! (#19722) * Drone Phone! A PDA application that allows certain people (Janitors, Engineers, Atmos Techs, Roboticists, HoPs, RDs and Captains) to ping drones to alert drones (low, med, high, crit priority) about their area. * Removes arg from previous implementation woops --- code/game/objects/items/devices/PDA/PDA.dm | 12 ++++++++++- code/game/objects/items/devices/PDA/cart.dm | 9 +++++++++ code/modules/client/asset_cache.dm | 3 ++- .../simple_animal/friendly/drone/say.dm | 19 +++++++++++++++--- icons/pda_icons/pda_dronephone.png | Bin 0 -> 244 bytes 5 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 icons/pda_icons/pda_dronephone.png diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index 22733e18296..a1ded3061aa 100644 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -187,6 +187,8 @@ var/global/list/obj/item/device/pda/PDAs = list() dat += "
  • [scanmode == 5 ? "Disable" : "Enable"] Gas Scanner
  • " if (cartridge.access_remote_door) dat += "
  • Toggle Remote Door
  • " + if (cartridge.access_dronephone) + dat += "
  • Drone Phone
  • " dat += "
  • Atmospheric Scan
  • " dat += "
  • [fon ? "Disable" : "Enable"] Flashlight
  • " if (pai) @@ -274,7 +276,6 @@ var/global/list/obj/item/device/pda/PDAs = list() dat += "Temperature: [round(environment.temperature-T0C)]°C
    " dat += "
    " - else//Else it links to the cart menu proc. Although, it really uses menu hub 4--menu 4 doesn't really exist as it simply redirects to hub. dat += cart @@ -381,6 +382,14 @@ var/global/list/obj/item/device/pda/PDAs = list() scanmode = 0 else if((!isnull(cartridge)) && (cartridge.access_atmos)) scanmode = 5 + if("Drone Phone") + var/area/A = get_area(U) + var/alert_s = input(U,"Alert severity level","Ping Drones",null) as null|anything in list("Low","Medium","High","Critical") + if(A && alert_s) + var/msg = "NON-DRONE PING: [U.name]: [alert_s] priority alert in [A.name]!" + _alert_drones(msg, 1) + U << msg + //NOTEKEEPER FUNCTIONS=================================== @@ -464,6 +473,7 @@ var/global/list/obj/item/device/pda/PDAs = list() else M.close() + if("Detonate")//Detonate PDA if(istype(cartridge, /obj/item/weapon/cartridge/syndicate)) var/obj/item/device/pda/P = locate(href_list["target"]) diff --git a/code/game/objects/items/devices/PDA/cart.dm b/code/game/objects/items/devices/PDA/cart.dm index 575cb81c0b2..056ebd897c1 100644 --- a/code/game/objects/items/devices/PDA/cart.dm +++ b/code/game/objects/items/devices/PDA/cart.dm @@ -23,6 +23,7 @@ var/access_status_display = 0 var/access_quartermaster = 0 var/access_hydroponics = 0 + var/access_dronephone = 0 var/bot_access_flags = 0 //Bit flags. Selection: SEC_BOT|MULE_BOT|FLOOR_BOT|CLEAN_BOT|MED_BOT var/spam_enabled = 0 //Enables "Send to All" Option @@ -45,12 +46,14 @@ name = "\improper Power-ON cartridge" icon_state = "cart-e" access_engine = 1 + access_dronephone = 1 bot_access_flags = FLOOR_BOT /obj/item/weapon/cartridge/atmos name = "\improper BreatheDeep cartridge" icon_state = "cart-a" access_atmos = 1 + access_dronephone = 1 bot_access_flags = FLOOR_BOT /obj/item/weapon/cartridge/medical @@ -84,6 +87,7 @@ desc = "The ultimate in clean-room design." icon_state = "cart-j" access_janitor = 1 + access_dronephone = 1 bot_access_flags = CLEAN_BOT /obj/item/weapon/cartridge/lawyer @@ -120,6 +124,7 @@ name = "\improper B.O.O.P. Remote Control cartridge" desc = "Packed with heavy duty triple-bot interlink!" bot_access_flags = FLOOR_BOT|CLEAN_BOT|MED_BOT + access_dronephone = 1 /obj/item/weapon/cartridge/signal name = "generic signaler cartridge" @@ -161,6 +166,7 @@ access_security = 1 access_newscaster = 1 access_quartermaster = 1 + access_dronephone = 1 /obj/item/weapon/cartridge/hos name = "\improper R.O.B.U.S.T. DELUXE cartridge" @@ -178,6 +184,7 @@ access_status_display = 1 access_engine = 1 access_atmos = 1 + access_dronephone = 1 bot_access_flags = FLOOR_BOT /obj/item/weapon/cartridge/cmo @@ -196,6 +203,7 @@ access_status_display = 1 access_reagent_scanner = 1 access_atmos = 1 + access_dronephone = 1 bot_access_flags = FLOOR_BOT|CLEAN_BOT|MED_BOT /obj/item/weapon/cartridge/rd/New() @@ -216,6 +224,7 @@ access_newscaster = 1 access_quartermaster = 1 access_janitor = 1 + access_dronephone = 1 bot_access_flags = SEC_BOT|MULE_BOT|FLOOR_BOT|CLEAN_BOT|MED_BOT spam_enabled = 1 diff --git a/code/modules/client/asset_cache.dm b/code/modules/client/asset_cache.dm index ca83278c923..fd54eaefc8d 100644 --- a/code/modules/client/asset_cache.dm +++ b/code/modules/client/asset_cache.dm @@ -206,7 +206,8 @@ You can set verify to TRUE if you want send() to sleep until the client has the "pda_refresh.png" = 'icons/pda_icons/pda_refresh.png', "pda_scanner.png" = 'icons/pda_icons/pda_scanner.png', "pda_signaler.png" = 'icons/pda_icons/pda_signaler.png', - "pda_status.png" = 'icons/pda_icons/pda_status.png' + "pda_status.png" = 'icons/pda_icons/pda_status.png', + "pda_dronephone.png" = 'icons/pda_icons/pda_dronephone.png' ) /datum/asset/simple/paper diff --git a/code/modules/mob/living/simple_animal/friendly/drone/say.dm b/code/modules/mob/living/simple_animal/friendly/drone/say.dm index 49551de240f..2d082fc4645 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone/say.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone/say.dm @@ -14,16 +14,29 @@ /mob/living/simple_animal/drone/get_spans() return ..() | SPAN_ROBOT -/mob/living/simple_animal/drone/proc/alert_drones(msg, dead_can_hear = 0) + + +//Base proc for anything to call +/proc/_alert_drones(msg, dead_can_hear = 0, list/factions) for(var/W in mob_list) var/mob/living/simple_animal/drone/M = W - if(istype(M) && M.stat != DEAD && faction_check(M)) //if it's a living drone with matching factions, it gets a message - M << msg + if(istype(M) && M.stat != DEAD) + if(factions && factions.len) + var/list/friendly = factions&M.faction + if(friendly.len) + M << msg + else + M << msg if(dead_can_hear && (M in dead_mob_list)) var/link = FOLLOW_LINK(M, src) M << "[link] [msg]" +//Wrapper for drones to handle factions +/mob/living/simple_animal/drone/proc/alert_drones(msg, dead_can_hear = 0) + _alert_drones(msg, dead_can_hear, faction) + + /mob/living/simple_animal/drone/proc/drone_chat(msg) var/rendered = "Drone Chat: \ [name]: \ diff --git a/icons/pda_icons/pda_dronephone.png b/icons/pda_icons/pda_dronephone.png new file mode 100644 index 0000000000000000000000000000000000000000..7cf392eb9778a19a70675d9b410f08ca996da4db GIT binary patch literal 244 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|Ea{HEjtmSN`?>!lvI6;>1s;*b z3=DjSL74G){)!Z!AbW|YuPgg44jDcPHGVg?g+L*R64!{5;QX|b^2DN4hJwV*yb`^< z)Di^~Jp(~XNjn5*3xBBHb|x@*4Vz9}Z^wo?2bQI7+kVMmiIPw4VUBi#&^sLS-uyJ;5-b1Y j