20 Commits

Author SHA1 Message Date
ArcaneMusic
5624a33c26 Adds a unit test for Cargo Crates to prevent infinite credit oversights. (#89023)
## About The Pull Request

I was kinda shocked that we didn't have something for this considering
that it's an unspoken rule of cargo to check that a crate does not sell
back for more than it's price and that the one comment saying to do so
has been doing some heavy lifting for the last 12 years.

I'm a novice when it comes to unit testing specifically so hopefully the
smoothing out that needs to be done should be fairly quick.

*Edit (2/22/25):*
The following changes were also made in order to allow for this unit
test to work smoothly:

Exports now have a market define added to them, as the purpose of this
unit test is to test exports that occur on the station, bought from
supply and then sold back to supply. As such, these market defines
exclude exports specific to pirates (since the cargo shuttle cannot sell
living mobs back, preventing you from making 10k per parrot crate.).

I've also added the `abstract` variable to some export datums, to
signify that a given export is either variable, or not meant to be
compared against the value of it's own container, such as with gas
canister's base export value as their export datums are generated
dynamically. (The subtypes are not abstract, however.)

The verb, `/mob/living/verb/tally_physical_credits()` has been changed
to `/mob/living/proc/tally_physical_credits()`, because that's my B and
does effect some economy back end but it's a one line fix so I just
absent-mindedly fixed it here instead of atomizing it out. I can
one-line it otherwise.

Mulebots now no longer runtime on spawn as they set their own to their
own `get_turf` as opposed to pulling their `loc`.

A few supply packs have had their prices bumped up slightly to actually
pass the test itself:

* `/datum/supply_pack/misc/candles_bulk`
* `/datum/supply_pack/security/armor`
* `/datum/supply_pack/security/helmets`
* `/datum/supply_pack/security/baton`

## Why It's Good For The Game

Prevents future infinite credit bugs that could have been missed by
simply checking the sale value in game.

## Changelog

🆑
fix: To prevent infinite sales issues, security helmets, armors, and
batons packs now all cost 600 credits, up from 400.
fix: Candle packs now cost 400 credits, up from 300, and candles now
sell for 12.25 cr each.
/🆑

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
2025-03-13 23:26:53 +01:00
Profakos
20d0d8827e Department orders credit reward and cooldown time now use a logarithmic scale (#88797)
## About The Pull Request

This PR makes the reward and cooldown for departmental orders scale with
crate cost using a logarithmic scaling, instead of comparing the price
to preset thresholds for time, or awarding the same amount as the
crate's cost.

Previously, to calculate the cooldown time, the code was calculated via
the following manner:

```
credits = clamp(credits, min, max)
time_y = 10 MINUTES * ((credits - min)/(max - min) + 1) 
```
Minimum was 320 credits, max was 3000, thus, all crates slid around
between 10 minutes to 20 minutes.

The reward for delivering the crates was the same as the crate's value.
This meant ordering egregiously expensive crates, far beyond 3000 was
way too desirable.

This PR changes both to use logarithmic scaling.

Cooldown time uses `60* log(price)^2.2`, and reward uses `140 *
log(price)^1.4`.

**Cooldown analysis**
At 320 it's 7.54 minutes, at 1400 it's 12.44 minutes, at 3000 (around
gun crates) it's 15.5 minutes, at 8000 (hat crate) 20 minutes, at 9000
(expensive atmos cans) it's 20.58 minutes, and at the 20k crate it's
24.76 minutes.

**Crate rewards analysis**
At 320 it's 475 credits, at 1400 it's 669 credits, at 3000 (around gun
crates) its 778, at 8000 (hat crate) it's 925 credits, at 9000
(expensive atmos cans) it's 943 credits, and at the 20k crate it's 1070
credits.

Up to 540 credits, you are actually getting a higher reward than what
the crate costs, but this is okay, as its a reward for delivering
simpler orders. A little surplus for you.

For the console UI, I have made items costing 3000 or more display
Moderate, and items costing 8000 or more, Long cooldowns.

## Why It's Good For The Game

Ordering really expensive crates should be a luxury, not a way to
generate money. The money is supposed to be a bonus, in addition to the
free crate to sell. Using a logarithmic scale, the credit bonus is
reigned in more evenly, making it more predictable for economy tweaking,
and avoids players double dipping credits in their free purchase.

Decreasing the rewards also give space for other new ways to generate
rewards in relation to departmental orders, such as stamping the
manifest with the correct head's stamp being worth more money and such.

<details>
  <summary>Old PR Text, which was using a price cap instead</summary>

## About The Pull Request

Departmental orders are a neat feature, but some of the available packs
had problems economywise. The cooldown of range from 10 to 20 minutes,
with 10 minutes being the base for anything costing less than 320
credits, and 20 minutes at 3000 credits. I have no problem with the
lower cap, but the upper cap has issues, as recently, a 20k crate was
added to cargo, which means it is possible to dump quite a large amount
of funds into cargo every 20 minutes.

Departmental orders probably need a bigger overhaul, and this solution
is imperfect, but I have talked with @ArcaneMusic about this as an
interim stop gap measure.

This PR also autodocs a proc, and moves some values to global defines,
for ease of balancing.

This PR affects the following crates, with the uncapped crate values in
brackets.

Armoury

- Combat Shotguns (3500 credits)
- Energy Guns (3600 credits)
- NT BR-38 Crate (20,000 credits)

Engineering

- BSA parts (6000 credits)
- DNA Vault Parts (4800 credits)

Engine Construction
- HFR Crate (4800)
- Supermatter Shard Crate (4000)

Materials

- BZ Crate (9000 credits)
- Nitrous Oxide (9000 credits)
- Water Vapor Crate (3010 credits)

Toys
- Collectible Hats Crate (8000 credits)

## Why It's Good For The Game

Instantly awarding 20k to cargo every 20 minute, in addition to 27k from
the other consoles (if both engineering and science orders BZ, service
orders collectible hats, and medical orders something around 1000), is a
bit too much. The money gained should be along a much more predictable
and expected value. With this chance, the most they can get is 13k every
20 minutes across all departments.
</details>

## Changelog

🆑
balance: Rewards from departmental orders use a logarithmic scale,
resulting in less rewards for high tier crates. The cooldown time is
also logarithmic now, which has slightly decreased cooldown values on
cheaper crates.
/🆑
2025-01-15 14:21:24 +01:00
SmArtKar
2c0f5d181a Datumizes pod types (#85033)
## About The Pull Request

Changes supply pods to use datums instead of a massive nested list to
store data and index defines as styles. Complete feature parity.

## Why It's Good For The Game
this is nightmare fuel to work with

![image](https://github.com/user-attachments/assets/851ea009-508b-4958-996e-d46a758b2f62)

and this is a sin against nature and god

![image](https://github.com/user-attachments/assets/6b0cd374-1305-4fe6-9ab6-4912c9cb4461)

![image](https://github.com/user-attachments/assets/88c83f60-af9d-4ea9-af5f-c0810a6d9c66)
ends up as

![image](https://github.com/user-attachments/assets/2cb9e264-895d-49b9-b228-e04ac1353ba1)
which is ???

Using a nested list to store pod data is a very bad idea, it has
horrible formatting, is unreadable without having index defines open in
a second tab and is not extendable. And as you can see above, if someone
added another pod type before 14th everything would break because other
pod type lists **__only have 8 elements__** instead of 10 like the
seethrough one does.

## Changelog
🆑
refactor: Pod code now uses datums instead of being a huge nested list
/🆑
2024-07-21 13:52:21 -07:00
Ghom
737822398a Blackmarket refactor and balance, fixing spy bounties, plus a new category for people captured by pirates/tots/contractors. (#81818)
## About The Pull Request
This PR aims to take care of a few potential hard dels and fix the
fenced goods category first and foremost.

The PR also adds a new one that enables you to buy mobs captured by
antags in advance, before they're sent back to the station. Unlike other
categories, it doesn't have "Launch" and "Teleport" as delivery methods,
instead it uses a special "Supply Pod" delivery method that ships the
chattel directly to your location. This method costs 400 credits,
however, if you've built the LTSRBT, shipment will be free.

Another thing, I always felt LTSRBT to be pretty fucking dumb as is. Way
too overpriced for the benefits it offers: a slighty cheaper delivery
method that, while definitely better than the other two, doesn't really
pay off or honestly even remotely compensate the 4000 credits you just
spent to get it, especially if you're only buying a couple items at
most. So I decided to remove it from cargo and add it to the blackmarket
as a 500 to 750 creds item, available every round.

Human mobs sold by the pirate bounty pad are no longer deleted, instead
they're properly ransomed and sent to the holding facility, much like
for contractors and tots. This means they're also added to the black
market.

## Why It's Good For The Game
The blackmarket system has some issues to it that need to be fixed
(otherwise the "Fenced Goods" and "Hostages" categories wouldn't work).
The Pirate Pad deleting "ransomed" mobs instead of actually ransoming
them is lame. The LTSRBT shouldn't suck as much. Also more market stuff.

This will fix #81809.

## Changelog

🆑
fix: Fixed the "Fenced Goods" black market category.
balance: Removed the LTSRBT from cargo and added it to the blackmarket,
reduced the price from 4000 to 625 on average.
balance: The time it takes for captured mobs to be automatically sent
back to the station from the holding facility has been increased from
3-4 minutes to 6.
add: You can buy mobs captured by contractors, traitors and pirates from
the black market and have them sent back to the station in advance. For
safety, they'll also be handcuffed (not always) upon delivery.
add: Human mobs sold by pirates are not deleted anymore. Instead,
they're now captured and sent to the holding facility.
/🆑
2024-03-13 15:22:01 -04:00
Ghom
fec7ccc6fd The Coupon Master PDA app (#80240)
## About The Pull Request
This PR adds a new PDA program to the supply category, which allows
users to redeems coupons for various cargo packs (mostly goodies), like
the ones also found at the bottom of cig packs.

How it works is fairly simple: 

- Once installed, the modular computer subsystem will periodically, at a
3-5 minutes interval, generate a coupon code datum associated to a plain
text code, which is sent out to everyone with the program installed.
- The user can then open the program and insert the text into an input
box to redeem the coupon code, which is then associated with their bank
account.
- He will then have to find a photocopier, and tap it with the PDA to
print the coupon. Only one coupon can be printed. Photocopier fees
apply, so it'd cost 5 creds to the average assistant to print the
coupon.
- He can then insert the coupon in a cargo console and order/reuest the
associated pack (same deal as cig coupons).
- Some coupon codes however, especially those with juicer discounts,
will expire after a while if not printed.

Albeit mostly innocuous, the program provides negative Detomatix
resistance, slowly fills the computer file storage with trash files with
each redeemed coupon, and halves the download speed of new apps. Not
really the cleanest ware out there.

This PR also extends coupons to several non-goody packs, since they have
been privately buyable for over the last couple years now. Some packs
get discounts less frequently however, with those in the uncommon
category being roughly 1 in a 12 chance and the rare being 1 in 50.

Here's a screenshot of the UI (outdated, I've reduced the height from
500 to 400 and the notice box tip to specify the right click):
![Coupon
Master](https://github.com/tgstation/tgstation/assets/42542238/1d242d09-0f62-4e2e-8a6e-014daa3f6a55)

Fun fact: Right now, the odds of a 75% discount coming from the Coupon
Master for the 1.000.000 credits bycycle pack are roughly 0.0012%, while
that of a 50% for the same pack, from a cig pack coupon are 0.0042%.

## Why It's Good For The Game
These last couple days I've been wanting to test myself at making simple
UIs, as well as contributing to the modular computers feature, which has
started to become pretty neat ever since PDAs were reworked into a
subtype of it.

Beside, coupons are a very small feature limited to the bottom of
cigarette packs (also possibly cursed) in the current state of affairs.
Cargo is filled with packs that are niche or fluff. Modular computers
also has those little things that, while interesting, do not contribute
a whole lot. Maybe this is one of them, but I guess free* coupons are
always a big W.

## Changelog

🆑
add: Added the 'Coupon Master' program for the PDA. Install it to
receive periodical, redeemable coupons for several cargo packs. Requires
NTnet connection and the messenger enabled to work.
add: Coupons are no longer only limited to goodies, but may also apply
discount to some other packs as well.
/🆑

<sup>*minus the photocopier fee</sup>

---------

Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com>
2023-12-25 11:19:56 -08:00
LemonInTheDark
0b29e77985 Adds user feedback for going over order limits in cargo console (#76344)
## About The Pull Request
This'll prevent weird "above the max by accident" cases, and also uses
defines instead of hardcoded stuff. This code is often duped, wish we
had a better way of handling it.

Oh also removes a few safety copies before for loops that aren't
actually needed (for x in list copies the list)

## Why It's Good For The Game

Better UX, slightly saner code
2023-07-05 18:26:56 -06:00
ArcaneMusic
f3ca3424c9 Merges the Export Scanner, Sales Tagger, and Price Tagger into one item. (#70314)
About The Pull Request

The Export Scanner, Sales Tagger, and Price Tagger are all niche, cargo adjacent items that each perform a different minor task and if using one, requires usually one of the three extremely rarely. Each one requires printing a new item at the lathe, all for maybe one or two uses before it needs to be replaced.

This PR merges the three into a singular, modular item. Existing export scanners have been reflavored the "universal scanner". When used in-hand, it produces a radial to swap between the three modes, Each mode has identical function to their previous scanner, with the only functional difference being that the sales tagger now prints new tags on secondary attack as opposed to primary.

The other two items lathe recipes have been removed, as their functionality has been fully moved to the universal scanner.

Also flips the export scanner icon state to match the other 2 scanner items that have been lumped together.

Why It's Good For The Game

Cargo now only needs to swap between 1 of three nearly identical barcode scanner looking items at a time, as opposed to having to print an item that sees functional use once every thousand rounds. By increasing the ease of use, it will also make it easier to use custom vendors, as well as print sales tags on regular rounds, as the universal scanner can still be found in shipping boxes located around the station and in tool storages.

Arguably not a balance change, as the three tools are extremely cheap to print, and don't have a formal impact on cargo balance except for tedium.
2022-10-27 19:46:29 -07:00
Tim
aaef545968 Revert "Add stamped requisition forms now give bonus credits (#66230)" (#66851)
This reverts commit f021767645.

This reverts commit f021767 from:

    Add stamped requisition forms now give bonus credits #66230

This bug was encountered when we were testing this PR but I thought it got fixed.
Why It's Good For The Game

Cargo crates will now reappear.
2022-05-10 15:28:10 +12:00
Tim
f021767645 Add stamped requisition forms now give bonus credits (#66230)
Requisition forms now grant bonus credits when they are stamped by the appropriate stamp listed under "Authorization Required:" on the form. Initially I was just going to have the req forms give the same amount of credits as the manifest but I was convinced to lower both of them so it doesn't unbalance crate returns too much.
2022-05-08 11:28:26 -07:00
Mothblocks
0f435d5dff Remove hideous inline tab indentation, and bans it in contributing guidelines (#56912)
Done using this command sed -Ei 's/(\s*\S+)\s*\t+/\1 /g' code/**/*.dm

We have countless examples in the codebase with this style gone wrong, and defines and such being on hideously different levels of indentation. Fixing this to keep the alignment involves tainting the blames of code your PR doesn't need to be touching at all. And ultimately, it's hideous.

There are some files that this sed makes uglier. I can fix these when they are pointed out, but I believe this is ultimately for the greater good of readability. I'm more concerned with if any strings relied on this.

Hi codeowners!

Co-authored-by: Jared-Fogle <35135081+Jared-Fogle@users.noreply.github.com>
2021-02-14 16:53:29 -08:00
ArcaneMusic
e09a9032da Crates and bountes are now defined by crate's value and paygrades. Civilian bounty payout is higher and uncheesable. (#55413)
Does a value-wise refactor of crates and bounties in order to scale the value of these imports and exports to the value of crate exports (500 credits each). Then, I have adjusted the value of crate exports to 200 credits down from 500 to place the most standard unit of profit within cargo to a scale within that of roundstart paygrades currently on station. (350-1400 credits).

This effectively balances one of the biggest disparities left within the in-game economy, which is that cargo's price scales have really never been re-balanced with the considerations of on station prices, and have been still to the same scale as when they were based on cargo points 3 years ago. While admittedly some prices in vendors were scale to those original cargo values, so many of them weren't that it warranted a massive rebalance PR in order to places the scale of these items within an appropriate range of their intended user's cost values.
2020-12-10 23:43:46 +00:00
TiviPlus
0eaab0bc54 Grep for space indentation (#54850)
#54604 atomizing
Since a lot of the space indents are in lists ill atomize those later
2020-11-30 12:48:40 -05:00
Emmanuel S
ec712a2017 [SPR part 6] Admins can now edit reverse pod delay times (#53833)
* convert delay vars to a list, UI changes


tgui bundle


Bugfix

* Rebuild tgui

Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
2020-09-26 06:56:24 +03:00
Emmanuel S
953e337eb3 Pod launcher renaissance squash (#52611)
Refactoring of Flex, Fix Section scrollable

Getting presets working


wip


Upgrade dependencies

preset notice, tooltip fixes, pod spawnlocation fixes


finishes UI, final polish


quells one travismoment


Apply suggestions from code review

Co-authored-by: Rohesie <rohesie@gmail.com>
better var names


better vars


sound for loop


Further review addressing


runtime fixes


Update code/modules/asset_cache/asset_list_items.dm

Co-authored-by: Rohesie <rohesie@gmail.com>
More review addressing


tgui merge


why was that there


Small improvements


Small Improvements Part 2


dropoff / wall moving improvements


compile!


more fixes
2020-09-10 20:22:47 +03:00
MrDoomBringer
719d3a1f45 first pass
WIP overlays


icon upd8


more


need to figure out whats going on with extractionpods


compile


the icon update


more!!


why are skillcapes broken


boat lmao


seethrough fix


Second drive-by


Code cleanup and improvements

Specifically surrounding contractor pods and reverse mode working properly
accidently left in an extra dmi whups


do the impossible see the invisible


new effect booster pack


MFW MRW Linter fail
2020-07-06 23:44:02 -04:00
spessman-007
ab84042f94 [READY] Improve spelling (#51134)
* Improve spelling

* Spell isn't, ain't, shouldn't, hasn't, wasn't correctly

Co-authored-by: NewSta <spessman-007@users.noreply.github.com>
2020-05-25 02:13:37 +08:00
ShizCalev
4316f79d32 Fixes some inconsistencies with CentCom & Nanotrasen capitalization, and a couple typos (#49469)
typo fixes, inconsistencies with Nanotrasen capitalization, ect
2020-02-22 22:35:53 +13:00
spookydonut
2591ce17a6 Travis EOF newline detection v3 (#47539)
* scream

* aaa

* aaa

* new one
2019-11-04 19:16:50 -08:00
MrDoomBringer
027b4f2bdd [RED LABEL] Allows badmins to launch shit in from orbit without it looking like its in a pod [activates standing tall for tatorfall] (#42773)
## About The Pull Request

Allows admins to make shit enter the station without pussy supplypods, instead they can just fucking flying in from the heavans
## Why It's Good For The Game

Cus it looks badass as fuck watching mechs just yeet in, also admins can spawn themselves in by literally falling from the sky which is funny
## Changelog

cl MrDoomBringer
admin: Admins can now use the Centcom Podlauncher to launch things without the things looking like they're being sent inside a pod.
/cl
2019-02-25 14:57:18 +13:00
MrDoomBringer
c7ef142616 [DOCUMENTED AND READY TO MINGLE](EPIC MEME VIDEO INSIDE!) NEW COOL ADMIN TOOL: ADVANCED HIGH DEFINITION SUPPLYPOD SUMMONING (also supplypod refactor) (PLEASE UPTHUMB) (#39936)
MrDoomBringer

admin: Admins can now spawn things in ICly (as well as do a bunch of other cool new stuff) using the Config/Launch Supplypod verb!

code: also supplypods have been refactored
2018-09-21 08:59:52 +12:00