TownyAdvanced / TownyResources

Adds value to towns, by giving each one a unique set of automatically-generated resources.
Other
33 stars 17 forks source link

Less RNG methods for controlling town resources #131

Open ADM8 opened 1 year ago

ADM8 commented 1 year ago

Unsure if this would be new features for this plugin or an entirely new plugin due to how radically different it is to the current system.

Goals:

How to achieve said goals: Highly customizable systems to allow many options for server admins (None required to work but all optional) regions: Percent of a region controlled can have resources assigned to it in a yml file. the percentage of the region a town controls affects the percentage of resources (as defined in the gui) said town can get. Perhaps options to generate custom items via tokens representing commands? Ex: The town of Hindenburg controls 2 chunks of a 4 chunk region, said region has the following yml config. region1273: wheat: 5 diamond: 2 custom-item: 4 (custom item defined in another yml) Since Hindenburg controls 2 chunks, that means it has 50% of the region and thus gets 50% of the resources (rounded up or down depending on your (towny developer) choice, if it is rounded at all) Thus the town of hindenburg gets in its gui (explained later) 5 wheat, 1 diamond, and 2 custom items per resource generation period (some amount of time set in a config).

towns: An alternative to using regions would be to simply have towns themselves have their own resource generation, controlled by commands or rng. These settings will either add resources or multiply resources from the regions said town is sat upon. Ex: Hindenburg without the region Hindenburg: wheat: 5 diamond: 2 custom-item: 4 Alternatively, you could create "tiers", admin defined placeholders based on factors such as location and town development, then assign said tiers to towns. Ex: Hindenburg: tier: plains2 plains2: wheat: 5 diamond: 2 custom-item: 4 Furthermore, town members of a certain rank (for example them mayor) can run a command to access the gui said resources go. They can simply pull the resources out like it is a chest.

Buildings: Custom plot types set by moderators that further modify resource generation by either adding new resources to the resource generation period or by modifying the town/region resources. An admitted problem could be, assuming it modifies region resource generation, which specific region is modified assuming the town said building is in occupies multiple regions. Ex: Hindenburg builds a bakery bakery.yml bread: 10 wheat: X2 Hindenburg's bakery now causes 10 bread to be generated per resource generation period and multiplies region/town wheat output by 2 for every resource generation period (twice as much wheat is made per resource generation period, region 1273 used to make only 5 wheat per generation, now makes 10 wheat thanks to the bakery) Assuming TownyProvinces wasn't used, instead the town of Hindenburg itself would be generating resources (5 wheat) and the bakery makes 10 bread and multiplies wheat production by 2, creating 10 wheat total.

Nations: the nations owned by a town can optionally access the resources generated by the town. They could perhaps also further alter the resources generated, Either by having a nation resource gui or adding/multiplying the resources in a town (order of operation from lowest to highest, region, town, building, nation or region, town, nation, building) Nation members of a certain rank (for example, the king) can either access a nation gui or access the guis for the towns in the nation. This can be especially useful by restricting gui access for towns, meaning only nation members can access the resources their towns produce. This would act as a good method to allow nations to collect war spoils and encourage more nation cohesion. An example would essentially be the town section but on a nation level.

An example of a simplified version of this system working (only town/nation tier system) can be seen in a plugin such as Mortispayday (credit to None030 for its creation) https://github.com/None030/Mortis-Payday/releases/tag/MortisPayday1.0

I've also included a diagram somewhat explaining the relationships of the system, lines representing how they would connect while arrows representing a potential flow of resources.

diagram

Nation members can open the gui with a command such as the following:

Nationcommand

If enabled, town members can open the gui with the same command or a command such as this:

Towncommand

(no need to specify the town name since town members only can access their own town)

The actual gui is simply a chest inventory with the name of the town you are accessing instead of "Large Chest". If the gui is full no more resources are generated for it and every resource generation period a message is sent to those with access to the gui that their gui is full. 2023-05-19_14 56 56 Clicking the placeholder simply runs a command as op, such as a give command. Would be stored in a custom item config Ex: Machine_Part: material: NETHERITE Custom-model-id: 32 amount: 1 name: "&aMachine Part" lore:

Resources for a town can either be set in a .yml directly: Hindenburg: resources: wheat: 5 diamond: 2 Machine_part: 4

Or alternatively set as tiers tier2townx: resources: IRON_ORE: 12 GOLD_ORE: 4 DIAMOND: 1 In a config a default tier is set and admins can manually change the tier for a town with commands:

townset

A similar method could perhaps be used for nations and/or regions. Buildings would be defined in a config such as buildings.yml: Bakery: resources: Bread: 10 Wheat: X2

A command in game used by a moderator can change a plot to the building, adding its benefits to the town:

plotset