Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FD Cultures: VOX #8

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions baystation12.dme
Original file line number Diff line number Diff line change
Expand Up @@ -2640,6 +2640,7 @@
#include "code\modules\overmap\overmap_shuttle.dm"
#include "code\modules\overmap\sectors.dm"
#include "code\modules\overmap\spacetravel.dm"
#include "code\modules\overmap\trading_locations.dm"
#include "code\modules\overmap\contacts\_contacts.dm"
#include "code\modules\overmap\contacts\contact_sensors.dm"
#include "code\modules\overmap\contacts\tracker.dm"
Expand Down
33 changes: 18 additions & 15 deletions code/controllers/subsystems/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -56,53 +56,56 @@ SUBSYSTEM_DEF(misc)

GLOBAL_LIST_EMPTY(traders)
GLOBAL_LIST_EMPTY(trader_types)
GLOBAL_VAR_INIT(trader_max, 10)
GLOBAL_VAR_INIT(trader_station_count, 3)
GLOBAL_VAR_INIT(trader_max, 5)
GLOBAL_VAR_INIT(trader_station_count, 2)
GLOBAL_VAR_INIT(trader_unique_chance, 5)
GLOBAL_LIST_INIT(trader_stations, subtypesof(/datum/trader) - typesof(/datum/trader/ship))
GLOBAL_LIST_INIT(trader_ships, subtypesof(/datum/trader/ship) - typesof(/datum/trader/ship/unique))
GLOBAL_LIST_INIT(trader_uniques, subtypesof(/datum/trader/ship/unique))


/datum/controller/subsystem/misc/proc/UpdateTraders(resumed, no_mc_tick, generate_stations = 0)
if (!resumed)
if(!resumed)
queue = GLOB.trader_types.Copy()
var/count = length(queue)
var/max = GLOB.trader_max
var/trader_type
var/datum/trader/trader
if (count < max && prob(100 - 50 * count / max))
if(count < max && prob(100 - 50 * count / max))
var/list/candidates
if (generate_stations)
if(generate_stations)
candidates = GLOB.trader_stations.Copy() - GLOB.trader_types
else if (prob(GLOB.trader_unique_chance))
else if(prob(GLOB.trader_unique_chance))
candidates = GLOB.trader_uniques.Copy() - GLOB.trader_types
else
candidates = GLOB.trader_ships.Copy() - GLOB.trader_types
if (length(candidates))
for (var/i = (generate_stations || 1) to 1 step -1)
if(length(candidates))
for(var/i = (generate_stations || 1) to 1 step -1)
if(!GLOB.using_map || length(GLOB.trader_types) >= GLOB.using_map.num_traders)
break
trader_type = pick(candidates)
candidates -= trader_type
GLOB.trader_types += trader_type
GLOB.traders[trader_type] = new trader_type
if (generate_stations)
if(generate_stations)
CHECK_TICK
else if (MC_TICK_CHECK)
else if(MC_TICK_CHECK)
return
for (var/i = count to 1 step -1)
for(var/i = count to 1 step -1)
trader_type = queue[i]
trader = GLOB.traders[trader_type]
if (QDELETED(trader))
if(QDELETED(trader))
GLOB.trader_types -= trader_type
GLOB.traders[trader_type] = null
continue
if (!trader.tick())
if(!trader.tick())
GLOB.trader_types -= trader_type
GLOB.traders[trader_type] = null
trader.leave_map()
qdel(trader)
if (no_mc_tick)
if(no_mc_tick)
CHECK_TICK
else if (MC_TICK_CHECK)
else if(MC_TICK_CHECK)
queue.Cut(i)
return

Expand Down
91 changes: 45 additions & 46 deletions code/datums/trading/ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,39 @@ They sell generic supplies and ask for generic supplies.
*/

/datum/trader/trading_beacon
name = "AI"
origin = "Trading Beacon"
name = "Омега"
origin = "Торговый Маяк"
name_language = LANGUAGE_EAL
trade_flags = TRADER_MONEY|TRADER_GOODS
speech = list(TRADER_HAIL_GENERIC = "Greetings, I am MERCHANT, Artifical Intelligence onboard ORIGIN, tasked with trading goods in return for CURRENCY and supplies.",
TRADER_HAIL_DENY = "We are sorry, your connection has been blacklisted. Have a nice day.",
trade_flags = TRADER_MONEY|TRADER_GOODS|TRADER_WANTED_ONLY
speech = list(TRADER_HAIL_GENERIC = "Приветствую, Я MERCHANT, ИскИн на борту ORIGIN, основной задачей которого является покупка и продажа вещей за CURRENCY и другие припасы.",
TRADER_HAIL_DENY = "Приношу свои извинения, ваша линия была добавлена в чёрный список. Хорошего дня.",

TRADER_TRADE_COMPLETE = "Thank you for your patronage.",
TRADER_NOT_ENOUGH = "I'm sorry, your offer is not worth what you are asking for.",
TRADER_NO_BLACKLISTED = "You have offered a blacklisted item. My laws do not allow me to trade for that.",
TRADER_HOW_MUCH = "ITEM will cost you roughly VALUE CURRENCY, or something of equal worth.",
TRADER_WHAT_WANT = "I have logged need for",
TRADER_TRADE_COMPLETE = "Благодарю за покупку.",
TRADER_NOT_ENOUGH = "Прошу прощения, но ваше предложение не удовлетворяет реальную стоимость этого товара.",
TRADER_NO_BLACKLISTED = "Предлагаемый вами товар запрещён на территории большинства известных государств. Мои законы не позволяют принять его в качестве оплаты.",
TRADER_HOW_MUCH = "ITEM будет стоить для вас VALUE CURRENCY, или объекта аналогичной ценности.",
TRADER_WHAT_WANT = "Я регистрирую потребность в",

TRADER_COMPLEMENT_FAILURE = "I'm sorry, I am not allowed to let compliments affect the trade.",
TRADER_COMPLEMENT_SUCCESS = "Thank you, but that will not not change our business interactions.",
TRADER_INSULT_GOOD = "I do not understand, are we not on good terms?",
TRADER_INSULT_BAD = "I do not understand, are you insulting me?",
TRADER_COMPLEMENT_FAILURE = "Прошу прощения, но я не могу позволить своим вне-рабочим отношениям как-то повлиять на торги.",
TRADER_COMPLEMENT_SUCCESS = "Благодарю, но я не могу позволить своим вне-рабочим отношениям как-то повлиять на торги.",
TRADER_INSULT_GOOD = "Я не понимаю, разве эти условия недостаточно удовлетворяют спрос?",
TRADER_INSULT_BAD = "Я не понимаю, это было оскорблением?",

TRADER_BRIBE_FAILURE = "You have given me money to stay, however, I am a station. I do not leave.",
TRADER_BRIBE_FAILURE = "Мы благодарим вас за ваше вложение - но ORIGIN является станцией. Он в любом случае никуда не улетит.",
)
possible_wanted_items = list(/obj/item/device = TRADER_SUBTYPES_ONLY,
possible_wanted_items = list(/obj/item/device/ = TRADER_SUBTYPES_ONLY,
/obj/item/device/assembly = TRADER_BLACKLIST_ALL,
/obj/item/device/assembly_holder = TRADER_BLACKLIST_ALL,
/obj/item/device/encryptionkey/syndicate = TRADER_BLACKLIST,
/obj/item/tank/phoron/onetankbomb = TRADER_BLACKLIST,
/obj/item/tank/phoron/onetankbomb = TRADER_BLACKLIST,
/obj/item/device/radio = TRADER_BLACKLIST_ALL,
/obj/item/modular_computer/pda = TRADER_BLACKLIST_SUB,
/obj/item/modular_computer/pda = TRADER_BLACKLIST_SUB,
/obj/item/device/uplink = TRADER_BLACKLIST)
possible_trading_items = list(/obj/item/storage/bag = TRADER_SUBTYPES_ONLY,
/obj/item/storage/bag/cash/infinite = TRADER_BLACKLIST,
/obj/item/storage/backpack = TRADER_ALL,
/obj/item/storage/backpack/cultpack = TRADER_BLACKLIST,
/obj/item/storage/backpack/holding = TRADER_BLACKLIST,
/obj/item/storage/backpack/holding = TRADER_BLACKLIST_ALL,
/obj/item/storage/backpack/satchel/grey/withwallet = TRADER_BLACKLIST,
/obj/item/storage/backpack/satchel/syndie_kit = TRADER_BLACKLIST_ALL,
/obj/item/storage/backpack/chameleon = TRADER_BLACKLIST,
Expand All @@ -55,9 +55,10 @@ They sell generic supplies and ask for generic supplies.
/obj/item/storage/toolbox = TRADER_ALL,
/obj/item/storage/wallet = TRADER_THIS_TYPE,
/obj/item/storage/photo_album = TRADER_THIS_TYPE,
/obj/item/mag_table_plate = TRADER_THIS_TYPE,
/obj/item/clothing/glasses = TRADER_SUBTYPES_ONLY,
/obj/item/clothing/glasses/hud = TRADER_BLACKLIST_ALL,
/obj/item/clothing/glasses/blindfold/tape = TRADER_BLACKLIST,
/obj/item/clothing/glasses/blindfold/tape = TRADER_BLACKLIST,
/obj/item/clothing/glasses/chameleon = TRADER_BLACKLIST
)

Expand All @@ -69,35 +70,32 @@ They sell generic supplies and ask for generic supplies.
origin = "[origin] #[rand(100,999)]"

/datum/trader/trading_beacon/mine
origin = "Mining Beacon"
origin = "Добывающий Маяк"

possible_trading_items = list(/obj/item/ore = TRADER_SUBTYPES_ONLY,
/obj/item/stack/material/glass = TRADER_ALL,
/obj/item/stack/material/glass/fifty = TRADER_BLACKLIST,
/obj/item/stack/material/iron = TRADER_THIS_TYPE,
/obj/item/stack/material/sandstone = TRADER_THIS_TYPE,
/obj/item/stack/material/marble = TRADER_THIS_TYPE,
/obj/item/stack/material/diamond = TRADER_THIS_TYPE,
/obj/item/stack/material/uranium = TRADER_THIS_TYPE,
/obj/item/stack/material/phoron = TRADER_THIS_TYPE,
/obj/item/stack/material/plastic = TRADER_THIS_TYPE,
/obj/item/stack/material/gold = TRADER_THIS_TYPE,
/obj/item/stack/material/silver = TRADER_THIS_TYPE,
/obj/item/stack/material/platinum = TRADER_THIS_TYPE,
/obj/item/stack/material/mhydrogen = TRADER_THIS_TYPE,
/obj/item/stack/material/tritium = TRADER_THIS_TYPE,
/obj/item/stack/material/osmium = TRADER_THIS_TYPE,
/obj/item/stack/material/steel = TRADER_THIS_TYPE,
/obj/item/stack/material/plasteel = TRADER_THIS_TYPE,
possible_trading_items = list(/obj/item/stack/material/glass = TRADER_SUBTYPES_ONLY,
/obj/item/stack/material/iron = TRADER_SUBTYPES_ONLY,
/obj/item/stack/material/sandstone = TRADER_SUBTYPES_ONLY,
/obj/item/stack/material/marble = TRADER_SUBTYPES_ONLY,
/obj/item/stack/material/diamond = TRADER_SUBTYPES_ONLY,
/obj/item/stack/material/uranium = TRADER_SUBTYPES_ONLY,
/obj/item/stack/material/phoron = TRADER_SUBTYPES_ONLY,
/obj/item/stack/material/plastic = TRADER_SUBTYPES_ONLY,
/obj/item/stack/material/gold = TRADER_SUBTYPES_ONLY,
/obj/item/stack/material/silver = TRADER_SUBTYPES_ONLY,
/obj/item/stack/material/platinum = TRADER_SUBTYPES_ONLY,
/obj/item/stack/material/mhydrogen = TRADER_SUBTYPES_ONLY,
/obj/item/stack/material/tritium = TRADER_SUBTYPES_ONLY,
/obj/item/stack/material/osmium = TRADER_SUBTYPES_ONLY,
/obj/item/stack/material/steel = TRADER_SUBTYPES_ONLY,
/obj/item/stack/material/plasteel = TRADER_SUBTYPES_ONLY,
/obj/machinery/mining = TRADER_SUBTYPES_ONLY
)

/datum/trader/trading_beacon/manufacturing
origin = "Manifacturing Beacon"
origin = "Производственный Маяк"

possible_trading_items = list(/obj/structure/AIcore = TRADER_THIS_TYPE,
/obj/structure/girder = TRADER_THIS_TYPE,
/obj/structure/grille = TRADER_THIS_TYPE,
/obj/structure/girder/displaced = TRADER_THIS_TYPE,
/obj/structure/mopbucket = TRADER_THIS_TYPE,
/obj/structure/ore_box = TRADER_THIS_TYPE,
/obj/structure/coatrack = TRADER_THIS_TYPE,
Expand All @@ -111,8 +109,9 @@ They sell generic supplies and ask for generic supplies.
/obj/structure/filingcabinet = TRADER_THIS_TYPE,
/obj/structure/safe = TRADER_THIS_TYPE,
/obj/structure/plushie = TRADER_SUBTYPES_ONLY,
/obj/structure/sign = TRADER_SUBTYPES_ONLY,
/obj/structure/sign/double = TRADER_BLACKLIST_ALL,
/obj/structure/sign/goldenplaque = TRADER_BLACKLIST_ALL,
/obj/structure/sign/poster = TRADER_BLACKLIST
/obj/item/contraband/poster = TRADER_THIS_TYPE,
/obj/structure/holoplant = TRADER_THIS_TYPE,
/obj/structure/flora/pottedplant = TRADER_THIS_TYPE,
/obj/structure/reagent_dispensers/water_cooler = TRADER_THIS_TYPE

)
10 changes: 6 additions & 4 deletions code/datums/trading/ship.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@
//They are ALSO the only ones that can appear after round start
/datum/trader/ship
var/duration_of_stay = 0
var/typical_duration = 20 //minutes (since trader processes only tick once a minute)
var/typical_duration = 30 //minutes (since trader processes only tick once a minute)

overmap_object_type = /obj/overmap/trading/ship

/datum/trader/ship/New()
..()
duration_of_stay = rand(typical_duration,typical_duration * 2)

/datum/trader/ship/tick()
..()
if(prob(-disposition) || refuse_comms)
if(prob(-min(list_values(disposition))))
duration_of_stay -= 5
return --duration_of_stay > 0

/datum/trader/ship/bribe_to_stay_longer(amt)
if(prob(-disposition))
/datum/trader/ship/bribe_to_stay_longer(amt, ship_z)
if(prob(-disposition[map_sectors["[ship_z]"]]))
return ..()

var/length = round(amt/100)
Expand Down
Loading
Loading