mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-26 06:29:23 +01:00
Admins can add new custom blackmarket listings, and tweaks the "Launch" shipping option. (#95191)
## About The Pull Request Two main items: 1: Admins can now use the new "Create new Blackmarket Item" verb, which prompts them about the item, price, quantity, name and description of the item they'd like to list. If successful, the item will be listed to the black market, available to purchase by the crew. Prices can be set very, very high, though I've limited the available quantity to 100 per listing as a nice middle-ground value. The verb can be used any number of times, allowing for admins to use the black market to run events, as such. Of note, this verb will spawn a fresh typepath of the object listed, so it cannot be used to list var-edited objects as-is, but it's still quite useful for offering unique or rare items to the crew based on the needs of the round. 2: This PR does a few tweaks to the "launch" shipping option on the black market. The text displayed when having an object launched to the station has been adjusted to reduce some ambiguity on if the item is potentially deleted when launched. The launch behavior has not been modified in this way, as the object is still launched at the station using similar logic as before. **However**, the item is now launched to the station in a faux-energy bubble, which destroys itself and empties it's contents when it makes thrown impact or is opened by hand. In practice, this is only noticeable if you were outside when the order is launched at the station, or if the crate makes impact with you. This allows for black market objects that create spawners to arrive at the station harmlessly, which also potentially reducing some of the randomness of an object being thrown at the station, and then leaving the z-level immediately based on the extra collision involved. Additionally, I've lowered the **shipping cost to 0** of launched items. Misc: Did some code cleanup by adding defines for each of the categories of black market items, and a list-define for every category together. ## Why It's Good For The Game I've wanted to have the option for admins to be able to list things for the crew to buy for quite awhile now, without requiring them to barter by hand or through a reliable means that can't be bypassed by 3 assistants with baseball bats. This offers that option, while also having some flavor of being offered on the black market, if that's desirable. Otherwise, it's no impact on the average round as it's admin-only. Regarding the launch options, this started as a grammar tweak as I was talking with Arm on discord and the lack of clarity raised the whole shipping option to our attention. After confirming that launching things to the station was NOT, in fact a literal noob trap, just an awful choice, I started work on the shield-bubble idea in an attempt to see if I could try and reduce some of the randomness involved with that shipping option. It already sucks due to the risk of going out into space, there's no need to make it suck worse by potentially losing any of the cooler items available on the black market at the same time. So, price down and a mild consistency up. I also ran into #95183 while I was testing all of this, so this should fix #95183. Lastly, code cleanup. Made a few things look 3% nicer.
This commit is contained in:
@@ -7,7 +7,7 @@ SUBSYSTEM_DEF(market)
|
||||
|
||||
/// Descriptions for each shipping methods.
|
||||
var/shipping_method_descriptions = list(
|
||||
SHIPPING_METHOD_LAUNCH = "Launches the item at the station from space, cheap but you might not receive your item at all.",
|
||||
SHIPPING_METHOD_LAUNCH = "Launches the item at the station from space, with free shipping! However, you'll need to risk a spacewalk to receive your goods.",
|
||||
SHIPPING_METHOD_LTSRBT = "Long-To-Short-Range-Bluespace-Transceiver, a machine that receives items outside the station and then teleports them to the location of the uplink.",
|
||||
SHIPPING_METHOD_TELEPORT = "Teleports the item in a random area in the station, you get 60 seconds to get there first though.",
|
||||
SHIPPING_METHOD_SUPPLYPOD = "Ships the item inside a supply pod at your exact location. Showy, speedy and expensive.",
|
||||
@@ -19,6 +19,8 @@ SUBSYSTEM_DEF(market)
|
||||
var/list/obj/machinery/ltsrbt/telepads = list()
|
||||
/// Currently queued purchases.
|
||||
var/list/queued_purchases = list()
|
||||
/// How many admin items have been spawned this round? Used to iterate the identifier of admin-created market items.
|
||||
var/admin_items_spawned = 0
|
||||
|
||||
/datum/controller/subsystem/market/Initialize()
|
||||
for(var/market in subtypesof(/datum/market))
|
||||
@@ -29,6 +31,11 @@ SUBSYSTEM_DEF(market)
|
||||
|
||||
return SS_INIT_SUCCESS
|
||||
|
||||
/**
|
||||
* Follows the standard process for adding an item to the market from a path.
|
||||
* @param path The path of the market datum to initialize and add to the market.
|
||||
* @param market_whitelist A list of markets to which the item should be added. If null, the item is added to all markets.
|
||||
*/
|
||||
/datum/controller/subsystem/market/proc/initialize_item(datum/market_item/path, list/market_whitelist)
|
||||
if(!path::item || !prob(path::availability_prob))
|
||||
return
|
||||
@@ -40,6 +47,19 @@ SUBSYSTEM_DEF(market)
|
||||
if(isnull(market_whitelist) || (potential_market in market_whitelist))
|
||||
markets[potential_market].add_item(item_instance)
|
||||
|
||||
/**
|
||||
* Adds an admin polled item to the market, expecting a market_item object having been created.
|
||||
*/
|
||||
/datum/controller/subsystem/market/proc/initialize_admin_item(datum/market_item/item_instance, list/market_whitelist)
|
||||
if(!item_instance)
|
||||
return
|
||||
for(var/potential_market in item_instance.markets)
|
||||
if(!markets[potential_market])
|
||||
stack_trace("SSmarket: Item [item_instance] available in market that does not exist.")
|
||||
continue
|
||||
if(isnull(market_whitelist) || (potential_market in market_whitelist))
|
||||
markets[potential_market].add_item(item_instance)
|
||||
|
||||
/datum/controller/subsystem/market/fire(resumed)
|
||||
while(length(queued_purchases))
|
||||
var/datum/market_purchase/purchase = queued_purchases[1]
|
||||
@@ -72,7 +92,7 @@ SUBSYSTEM_DEF(market)
|
||||
|
||||
// Get random area, throw it somewhere there.
|
||||
if(SHIPPING_METHOD_TELEPORT)
|
||||
var/turf/targetturf = get_safe_random_station_turf_equal_weight()
|
||||
var/turf/targetturf = get_safe_random_station_turf_equal_weight() //todo: split weights
|
||||
// This shouldn't happen.
|
||||
if (!targetturf)
|
||||
continue
|
||||
@@ -88,10 +108,11 @@ SUBSYSTEM_DEF(market)
|
||||
var/startSide = pick(GLOB.cardinals)
|
||||
var/turf/T = get_turf(purchase.uplink)
|
||||
var/pickedloc = spaceDebrisStartLoc(startSide, T.z)
|
||||
var/obj/delivery_pod = new /obj/structure/closet/crate/market(pickedloc)
|
||||
|
||||
var/atom/movable/item = purchase.entry.spawn_item(pickedloc, purchase)
|
||||
var/atom/movable/item = purchase.entry.spawn_item(delivery_pod, purchase)
|
||||
purchase.post_purchase_effects(item)
|
||||
item.throw_at(purchase.uplink, 3, 3, spin = FALSE)
|
||||
delivery_pod.throw_at(purchase.uplink, 3, 3, spin = FALSE)
|
||||
|
||||
to_chat(buyer, span_notice("[purchase.uplink] flashes a message noting the order is being launched at the station from [dir2text(startSide)]."))
|
||||
qdel(purchase)
|
||||
|
||||
Reference in New Issue
Block a user