From aabcff08b89df2cc02870251db40964ea624050a Mon Sep 17 00:00:00 2001 From: James Date: Tue, 15 Feb 2022 00:34:25 +0000 Subject: [PATCH 01/10] Fixes Box Station lawyer power cable --- _maps/map_files/BoxStation/BoxStation.dmm | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/_maps/map_files/BoxStation/BoxStation.dmm b/_maps/map_files/BoxStation/BoxStation.dmm index 490ff924a2..12ca7e9039 100644 --- a/_maps/map_files/BoxStation/BoxStation.dmm +++ b/_maps/map_files/BoxStation/BoxStation.dmm @@ -10260,9 +10260,6 @@ /obj/structure/disposalpipe/segment{ dir = 4 }, -/obj/structure/cable{ - icon_state = "1-8" - }, /obj/machinery/atmospherics/pipe/simple/supply/hidden{ dir = 4 }, @@ -63072,6 +63069,19 @@ /obj/structure/closet/crate, /turf/open/floor/plasteel, /area/engineering/atmos) +"snb" = ( +/obj/structure/cable{ + icon_state = "4-8" + }, +/obj/structure/disposalpipe/segment{ + dir = 4 + }, +/obj/machinery/atmospherics/pipe/manifold/supply/hidden, +/obj/structure/cable{ + icon_state = "1-8" + }, +/turf/open/floor/plating, +/area/maintenance/fore) "spR" = ( /obj/machinery/atmospherics/pipe/heat_exchanging/simple{ dir = 4 @@ -94326,7 +94336,7 @@ arW aso auf avi -auo +snb axy ayS azS From aad0fca07f22ed8d9e96f2e3c125007cf5ba6e01 Mon Sep 17 00:00:00 2001 From: James Date: Tue, 15 Feb 2022 00:53:58 +0000 Subject: [PATCH 02/10] Automatic slave pricing and other stuff --- .../code/game/machinery/computer/slavery.dm | 34 +++--- .../object/items/devices/radio/electropack.dm | 17 ++- .../code/modules/antagonists/slaver/slaver.dm | 52 ++++++++- .../tgui/interfaces/CommunicationsConsole.js | 38 ++++--- tgui/packages/tgui/interfaces/SlaveConsole.js | 106 ++++++++++++++---- 5 files changed, 189 insertions(+), 58 deletions(-) diff --git a/modular_splurt/code/game/machinery/computer/slavery.dm b/modular_splurt/code/game/machinery/computer/slavery.dm index 0aa441999e..fe7e14aa4b 100644 --- a/modular_splurt/code/game/machinery/computer/slavery.dm +++ b/modular_splurt/code/game/machinery/computer/slavery.dm @@ -1,3 +1,5 @@ +#define ANNOUNCEMENT_COOLDOWN 6 MINUTES + /obj/machinery/computer/slavery name = "\improper slave management console" desc = "Used to track and manage collared slaves. The limited range reaches only as far as the hideout perimeter." @@ -8,6 +10,7 @@ req_access = list(ACCESS_SLAVER) light_color = LIGHT_COLOR_RED var/obj/item/radio/headset/radio + var/last_announcement var/selected_cat /// Dictates if the compact mode of the interface is on or off var/compact_mode = FALSE @@ -42,6 +45,10 @@ /obj/machinery/computer/slavery/ui_static_data(mob/user) var/list/data = list() + + var/turf/curr = get_turf(src) + data["currentCoords"] = "[curr.x], [curr.y], [curr.z]" + data["value_table"] = GLOB.slavers_ransom_values data["categories"] = list() for(var/category in possible_gear) var/list/cat = list( @@ -56,22 +63,18 @@ )) data["categories"] += list(cat) - var/turf/curr = get_turf(src) - data["currentCoords"] = "[curr.x], [curr.y], [curr.z]" - return data - /obj/machinery/computer/slavery/ui_data(mob/user) var/list/data = list() - if (world.time < GLOB.slavers_last_announcement + 300) + if (world.time < last_announcement + ANNOUNCEMENT_COOLDOWN) data["intercomrecharging"] = TRUE else data["intercomrecharging"] = FALSE var/datum/bank_account/bank = SSeconomy.get_dep_account(ACCOUNT_CAR) - data["cargocredits"] = bank.account_balance + data["cargo_credits"] = bank.account_balance data["credits"] = GLOB.slavers_credits_balance data["compactMode"] = compact_mode var/list/slaves = list() @@ -90,11 +93,12 @@ var/list/slave = list() slave["id"] = REF(C) slave["name"] = L.real_name + slave["station_rank"] = C.station_rank slave["price"] = C.price - slave["pricechangecooldown"] = round((C.nextPriceChange - world.time) / 10) + slave["price_change_cooldown"] = round((C.nextPriceChange - world.time) / 10) slave["bought"] = C.bought - slave["shockcooldown"] = C.shock_cooldown; - slave["inexportbay"] = FALSE + slave["shock_cooldown"] = C.shock_cooldown; + slave["in_export_bay"] = FALSE var/turf/curr = get_turf(src) if(pos.z == curr.z) //Distance/Direction calculations for same z-level only @@ -145,7 +149,7 @@ switch(action) if ("makePriorityAnnouncement") - if (world.time < GLOB.slavers_last_announcement + 300) + if (world.time < last_announcement + ANNOUNCEMENT_COOLDOWN) say("Intercomms recharging. Please stand by.") return @@ -160,8 +164,8 @@ return input = user.treat_message(input) //Adds slurs and so on. Someone should make this use languages too. - priority_announce(input, sender_override = "[GLOB.slavers_team_name] Transmission") - GLOB.slavers_last_announcement = world.time + priority_announce(input, sender_override = GLOB.slavers_team_name) + last_announcement = world.time if("setPrice") var/newPrice = input(usr, "The station will need to pay this to get the slave back.", "Set slave price", collar.price) as num @@ -198,7 +202,7 @@ var/area/pod_storage_area = locate(/area/centcom/supplypod/podStorage) in GLOB.sortedAreas var/mob/living/M = collar.loc - priority_announce("[M.real_name] has been returned to the station for [collar.price] credits.", sender_override = "[GLOB.slavers_team_name] Transmission") + priority_announce("[M.real_name] has been returned to the station for [collar.price] credits.", sender_override = GLOB.slavers_team_name) var/obj/structure/closet/supplypod/centcompod/exportPod = new(pick(get_area_turfs(pod_storage_area))) var/obj/effect/landmark/observer_start/dropzone = locate(/obj/effect/landmark/observer_start) in GLOB.landmarks_list M.forceMove(exportPod) @@ -241,7 +245,7 @@ editBalance(-SG.cost) radioAnnounce("Supplies inbound: [SG.name]") - addtimer(CALLBACK(src, .proc/dropSupplies, SG.build_path), rand(4,8) * 10) + addtimer(CALLBACK(src, .proc/dropSupplies, SG.build_path), rand(3,6) * 10) return TRUE @@ -268,3 +272,5 @@ /obj/machinery/computer/slavery/proc/editBalance(ammount) GLOB.slavers_credits_balance += ammount + +#undef ANNOUNCEMENT_COOLDOWN diff --git a/modular_splurt/code/game/object/items/devices/radio/electropack.dm b/modular_splurt/code/game/object/items/devices/radio/electropack.dm index 8f5e24e0cb..e98e74c18b 100644 --- a/modular_splurt/code/game/object/items/devices/radio/electropack.dm +++ b/modular_splurt/code/game/object/items/devices/radio/electropack.dm @@ -4,6 +4,7 @@ var/price = 0 // The ransom amount var/bought = FALSE // Has the station paid the ransom + var/station_rank var/nextPriceChange = 0 // Last time the price was changed var/nextRansomChange = 0 // Last time the ransom was paid / cancelled shockStrength = 400 @@ -38,19 +39,29 @@ playsound(get_turf(M), 'sound/machines/triple_beep.ogg', 50, 1) ADD_TRAIT(src, TRAIT_NODROP, CLOTHING_TRAIT) + var/automatic_ransom_value = GLOB.slavers_ransom_values[M.job] + if (automatic_ransom_value) + station_rank = M.job + setPrice(automatic_ransom_value) + + /obj/item/electropack/shockcollar/slave/proc/setPrice(newPrice) var/mob/living/M = loc - var/announceMessage = "[M.real_name] has been captured. Send us [newPrice] credits with your communications console to get them back!" + + var/slaveJobText = "" + if (station_rank) + slaveJobText = " ([station_rank])" + + var/announceMessage = "[M.real_name][slaveJobText] has been captured. Send us [newPrice] credits with your communications console to get them back!" if (price) // If price has already been set once, we are just changing it if (newPrice > price) // Price has increased announceMessage = "[M.real_name]'s ransom has increased to [newPrice] credits." else // Price has decreased announceMessage = "[M.real_name]'s ransom has decreased to [newPrice] credits." - price = newPrice nextPriceChange = world.time + 3000 // Cannot be changed again for 5 minutes - priority_announce(announceMessage, sender_override = "[GLOB.slavers_team_name] Transmission") + priority_announce(announceMessage, sender_override = GLOB.slavers_team_name) /obj/item/electropack/shockcollar/slave/proc/setBought(isBought) diff --git a/modular_splurt/code/modules/antagonists/slaver/slaver.dm b/modular_splurt/code/modules/antagonists/slaver/slaver.dm index b34977dbf3..9ae0fc3e40 100644 --- a/modular_splurt/code/modules/antagonists/slaver/slaver.dm +++ b/modular_splurt/code/modules/antagonists/slaver/slaver.dm @@ -1,9 +1,55 @@ GLOBAL_VAR_INIT(slavers_team_name, "Slave Traders") GLOBAL_VAR_INIT(slavers_spawned, FALSE) -GLOBAL_VAR_INIT(slavers_credits_balance, 4000) +GLOBAL_VAR_INIT(slavers_credits_balance, 5000) GLOBAL_VAR_INIT(slavers_credits_total, 0) GLOBAL_VAR_INIT(slavers_slaves_sold, 0) -GLOBAL_VAR_INIT(slavers_last_announcement, 0) + +#define SLAVER_STANDARD_RANSOM 7500 + +/// Price table for when trying to set slave prices automatically +GLOBAL_LIST_INIT(slavers_ransom_values, list( + "Captain" = 175000, + "Head of Personnel" = 125000, + "Head of Security" = 100000, + "Chief Engineer" = 80000, + "Research Director" = 80000, + "Chief Medical Officer" = 80000, + "Blueshield" = 30000, + "Quartermaster" = 10000, + + "Warden" = 30000, + "Brig Physician" = 20000, + "Security Officer" = 20000, + "Detective" = 20000, + + "Cargo Technician" = SLAVER_STANDARD_RANSOM, + "Shaft Miner" = SLAVER_STANDARD_RANSOM, + "Assistant" = SLAVER_STANDARD_RANSOM, + "Bartender" = SLAVER_STANDARD_RANSOM, + "Cook" = SLAVER_STANDARD_RANSOM, + "Botanist" = SLAVER_STANDARD_RANSOM, + "Janitor" = SLAVER_STANDARD_RANSOM, + "Clown" = SLAVER_STANDARD_RANSOM, + "Mime" = SLAVER_STANDARD_RANSOM, + "Curator" = SLAVER_STANDARD_RANSOM, + "Lawyer" = SLAVER_STANDARD_RANSOM, + "Chaplain" = SLAVER_STANDARD_RANSOM, + "Station Engineer" = SLAVER_STANDARD_RANSOM, + "Atmospheric Technician" = SLAVER_STANDARD_RANSOM, + "Medical Doctor" = SLAVER_STANDARD_RANSOM, + "Paramedic" = SLAVER_STANDARD_RANSOM, + "Chemist" = SLAVER_STANDARD_RANSOM, + "Virologist" = SLAVER_STANDARD_RANSOM, + "Geneticist" = SLAVER_STANDARD_RANSOM, + "Scientist" = SLAVER_STANDARD_RANSOM, + "Roboticist" = SLAVER_STANDARD_RANSOM, + "Prisoner" = SLAVER_STANDARD_RANSOM, + "Curator" = SLAVER_STANDARD_RANSOM, + "Lawyer" = SLAVER_STANDARD_RANSOM, + "Chaplain" = SLAVER_STANDARD_RANSOM, +)) + +#undef SLAVER_STANDARD_RANSOM /datum/antagonist/slaver name = "Slave Trader" @@ -13,7 +59,7 @@ GLOBAL_VAR_INIT(slavers_last_announcement, 0) antag_moodlet = /datum/mood_event/focused threat = 7 show_to_ghosts = TRUE - var/datum/team/slavers/slaver_team = new /datum/team/slavers + var/static/datum/team/slavers/slaver_team = new /datum/team/slavers var/slaver_outfit = /datum/outfit/slaver var/send_to_spawnpoint = TRUE //Should the user be moved to default spawnpoint. diff --git a/tgui/packages/tgui/interfaces/CommunicationsConsole.js b/tgui/packages/tgui/interfaces/CommunicationsConsole.js index 090b0a8bc3..25fdacfa72 100644 --- a/tgui/packages/tgui/interfaces/CommunicationsConsole.js +++ b/tgui/packages/tgui/interfaces/CommunicationsConsole.js @@ -1,7 +1,7 @@ import { sortBy } from "common/collections"; import { capitalize } from "common/string"; import { useBackend, useLocalState } from "../backend"; -import { Blink, Box, Button, Dimmer, Flex, Icon, Input, Modal, Section, TextArea, Table, LabeledList } from "../components"; +import { Blink, Box, Button, Dimmer, Flex, Icon, Input, Modal, Section, TextArea, LabeledList } from "../components"; import { Window } from "../layouts"; import { sanitizeText } from "../sanitize"; import { formatMoney } from '../format'; @@ -494,26 +494,32 @@ const PageMain = (props, context) => { - + {slaves.map(slave => ( - + className="candystripe" + align="center" + p=".5rem"> - + {slave.name} - + - + {slave.toggleransomfeedback} - + - + align="right" + pl=".5rem" + >
+ )} diff --git a/tgui/packages/tgui/interfaces/SlaveConsole.js b/tgui/packages/tgui/interfaces/SlaveConsole.js index f6f212dda2..e2769d384f 100644 --- a/tgui/packages/tgui/interfaces/SlaveConsole.js +++ b/tgui/packages/tgui/interfaces/SlaveConsole.js @@ -2,7 +2,7 @@ import { map, sortBy } from 'common/collections'; import { flow } from 'common/fp'; import { vecLength, vecSubtract } from 'common/vector'; import { useBackend, useSharedState } from '../backend'; -import { Box, Button, Icon, LabeledList, Section, Tabs, NoticeBox, Fragment } from '../components'; +import { Box, Button, Icon, LabeledList, Section, Tabs, Flex, NoticeBox, Fragment } from '../components'; import { Window } from '../layouts'; import { GenericUplink } from './Uplink'; import { formatMoney } from '../format'; @@ -14,10 +14,12 @@ export const SlaveConsole = (props, context) => { const [tab, setTab] = useSharedState(context, 'tab', 1); const { intercomrecharging, - cargocredits, + cargo_credits, credits, currentCoords, + value_table, } = data; + const slaves = flow([ map((slave, index) => { // Calculate distance to the target. BYOND distance is capped to 127, @@ -58,7 +60,7 @@ export const SlaveConsole = (props, context) => { - {formatMoney(cargocredits, null, true)}cr + {formatMoney(cargo_credits, null, true)}cr @@ -78,6 +80,13 @@ export const SlaveConsole = (props, context) => { onClick={() => setTab(2)}> Supplies + setTab(3)}> + Ransom Table + {tab === 1 && ( { )} + {tab === 3 && ( + + )} @@ -98,7 +111,7 @@ const SlavePanel = (props, context) => { const { act, data } = useBackend(context); if (!slaves.length) { return ( - + No slaves detected in hideout ); @@ -114,7 +127,7 @@ const SlavePanel = (props, context) => { icon="dolly" content="Export" color="good" - disabled={!slave.bought || !slave.inexportbay} + disabled={!slave.bought || !slave.in_export_bay} tooltip="Send the slave back to the station. First the ransom must be paid by the station, and the slave must be in the export bay." onClick={() => act('export', { id: slave.id, @@ -123,7 +136,7 @@ const SlavePanel = (props, context) => { icon="bolt" color="average" content="Shock" - disabled={slave.dist === undefined || slave.shockcooldown} + disabled={slave.dist === undefined || slave.shock_cooldown} onClick={() => act('shock', { id: slave.id, })} /> @@ -132,7 +145,8 @@ const SlavePanel = (props, context) => { content="Release" color="bad" disabled={slave.dist === undefined} - tooltip="Remove the slave's collar. " + tooltip="Remove the slave's collar." + tooltipPosition="bottom-end" onClick={() => act('release', { id: slave.id, })} /> @@ -163,21 +177,26 @@ const SlavePanel = (props, context) => { )} - -