Player Cities Should Receive Revenue from Junk Sales
Player Cities should get a cut of the junk loot sales.
For example, when you have a junk vendor as part of the city, when players sell their junk to that specific vendor, then the cities should get a cut of those sales as maintenance into the city's treasurey.
City Junk Dealer Tax Implementation Walkthrough
I have completed the implementation for the City Junk Dealer revenue generation system! Here is a summary of the changes made:
Configuration Driven
We added the configuration parsing into secura_server_config.java to fetch playerCityJunkRevenuePercentage from securaServer.cfg, defaulting to 0.25 (25%) if it's not set. This allows server admins to easily tweak the tax rate.
UI Updates
We updated the smuggler.showSellJunkSui SUI rendering logic. When a player talks to a city junk dealer terminal, the SUI listbox will now display the post-tax payout instead of the full price. This prevents player confusion regarding their final payouts.
Core Sale Logic
We intercepted the transaction inside the core smuggler.sellJunkItem function. If the transaction originates from a terminal_city_junk_dealer:
It calculates the cityTax based on the configured percentage.
It subtracts the tax to find the final playerPayout.
It performs a standard money.systemPayout to the player for the reduced amount.
It performs a secondary money.systemPayout directly into the city hall's bank account for the cityTax amount. This natively hooks into the city treasury system without requiring messy custom ledger updates!
Player Notification
We updated base_player.handleSoldJunk to check the transaction parameters for any applied cityTax. If a tax was collected, the player will receive a system message immediately after the sale confirming the tax amount.
Compiled new STF string: We created and compiled a new string to serverdata/string/en/city/city.stf which reads: "A city tax of [X] credits was collected from the junk sale and deposited into the city treasury."