Skip to content

Add lottery and [station] tollbooth to charge players who enter a claimed region #22

@jpcsupplies

Description

@jpcsupplies

This may need major tweaks or simplification depending on time and what things modAPI allows us to do. It may also need to be split off to another companion mod if it gets too complex to maintain, so these features might be best added to a second cs file in the mod folder to allow splitting into two mods later easier?

[station] tollbooth
When a player enters a claimed region with a tollbooth setting, they are prompted to pay a toll (use a popup which can tell what button you click)
If:
A: they click ok, the payment is deducted and player is added to the allowed list for an interval and permitted into the zone.
B: they click no/close or lack the required funds etc they are promptly moved/teleported back outside the region again with a warning

Possible abuse issues:
Could be used instead of safezones to excude non faction members.
Solution: place an upper limit to how much the toll can be, so that it is always a feasable figure, even for potential invaders with hostile intent.
Suggested maximum toll about 2000 Frontier Credits (or after exchange rates and fees about 200000 keen Space Credits) with a default around 5 FC (Frontier Credits) (500 SC (Keen Space Credits)) if no figure specified.

If a player not in the faction or in the faction but not assigned a senior rank places a toll LCD they potentially steal money from faction (LOL) Solution:
If a faction or player type tollbooth LCD is created in someone elses claimed territory - it will fail, and revert to [void] without the prompt
If a faction or player type tollbooth LCD is created in their own faction claimed territory and they are not founder or high rank they can only create faction type tollbooths.

More than one tollbooth:
If it is a senior rank faction member placing it, warn that one already exists and ask if they wish to cancel/void the old one.
If it is a normal rank faction member, warn that one already exists then reject and VOID it. (they can after all edit or destroy the old one if necessary)

Who pays for the tollbooth?
Normal faction member: The player, if they are in a faction they can always ask to be reimbursted.
Senior rank faction member: The faction bank balance or fall back to the players own balance if not enough.

Where does the money go:
Depending on the settings for tollbooth, either the faction bank, a particular player inventory/offline balance, or spawned as an item in a crate (oooh potential for bank heists..) limitations could apply to WHERE you can send the funds.
Eg
Faction bank balance only allowed if 3 or more members, and at least one trade or contract block on the grid. Very Expensive to setup.?
Player inventory allowed if they are IN the zone too, without restriction. (allows mugging! ha!) Fall back to crate or player balance if offline?
Item in crate only if the grid attached to the LCD has at least 50 blocks? Cheapest to setup.

Where does the creation fee go:
Probably configurable by server admin but in general:
A:
If frontier economy is enabled, to the NPC trade zone entity balance. (default_NPC_merchant) or a particular player. Or we just record it locally in the config file (allows admins to increase lottery?)
If keen economy is running on its own, then record the amounts collected in a config file.
If a player is specified, then they will be prompted to /lcollect next time they join the server.
Failing that the /lcollect prompt will come up the next time someone of a certain server admin rank or above connects next.
Will require additional logic to handle setting such options. May just limit it to keen economy as that allows physical currency items.
B:
Server-wide-lottery:
If the collected balance exceeds 5000 SC (or 50 FC) or an amount specified in config, randomly (random time between 10 minutes and 2 hours) spawn a sweepstakes prompt in the chat. If no players are online, wait until players online before throwing the sweepstates prompt.
Players can buy a lottery ticket (1FC or 10SC - added to prize pool) and they are drawn roughly once a day to allow additional funds time to add to the prize pool.

What we should not allow:
Minimise funds going directly to player balance where possible; to allow expanded gamplay (such as a reason for PvP or raids to get the funds!)

tollbooth options/behaviour -
The toll region is first designated by a faction/player claim regions (see #21 for example)
To place a tollbooth LCD costs money (on place, bill player a yet to be decided fee, based on tollbooth type, probably a popup prompt again, cancel renames the tollbooth block [station] to [void] or something. Tollbooth will not work until toll type is detected to avoid interuption while they are keying in their options. If the designated destination is missing or destroyed only revert to fallback for a day, then disable the tollbooth with [void] (so 12-24 hour fallback or such, maybe make it an admin configurable option, need to be mindful that remote tollbooth LCDs may accidentally disable because instancing didnt load their station - so need some way to avoid that)

Options:
toll price: (1-2000 FC or 100-200000 SC) (Exchange rate is usually 94:1 sc vs fc but rounding to 100:1 for simplicity and capitalism)
interval: 15 minutes to 2 hours. limit maximum toll (1:10th) if interval is below 30 mins.
toll type / destination:

  • inventory (with offline fallback to balance stored on a server config file and prompts the player when they connect next to collect the funds with /lcollect or similar. Only available when not in a faction, to avoid offlining raids on their vault, should probably require an economy block on grid)
  • vault (require a [vault] tag check on a container, and a fallback to faction balance / on connect prompt, no restriction on faction size or economy blocks in use)
  • faction (tolls go to faction bank balance if more than 3 members but has higher creation fee, and conditions (like active economy blocks))

Example: tollbooth
[station] tollbooth bank 10 15 faction

To use default options )(15 minute pass, 500SC (5fc)) :
[station] tollbooth faction (default toll, if no [vault] tag detected, at least one economy block (store/contract) detected and more than 3 members goes to faction bank balance)
[station] tollbooth inventory (default toll, goes to owning players inventory as space credit chips, fallback to on connect collect prompt, only works if not in faction)
[station] tollbooth vault (default toll, goes to owner/faction controlled cargo block named [vault])

Other features:
Damage to the [vault] block (triple demerits) Territorial Claim LCD (4x demerits) or any faction/owned grids (normal rep decay simialr to player vs NPC faction) should alter player/faction reputation to the faction claiming the territory.
Repairs to any faction/owned grids improves reputation (1/3 normal decay rate if poor rep, 1/2 normal decay if ok or good rep)
If no hostile acts are detected when the toll pass time runs out increase rep by 1 or appropriate amount.
Can we make Financial transactions on economy blocks in the toll region also be detected and increase faction rep?
If a player/faction's reputation is too low towards the faction claiming the region, multiply cost of toll (triple the cost)
If a player/faction reputation toward claiming faction drops too far, spawn in a "police drone" to attack them?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions