Skip to content

Config File Format

atenfyr edited this page Jan 31, 2023 · 14 revisions

The config file is written in JSON and has 6 fields, which are elaborated on below. Make sure you always backup your custom configs.

TaxRates

  • This field maps statements composed of "keys" to the amount of money given per paycheck represented in copper coins.
  • A statement can either be just a single key, or can be separated by logic gates, which work together to combine the results of each key to determine the value of the statement itself. Each key evaluates to "true" or "false" based on what said key is looking for; for example, Base.crimson would return true if the world generated with crimson and false if it didn't.
  • The statement with the highest coin value that evaluates to true is the one whose corresponding coin value is put into effect.
  • Each key consists of a list and a condition, separated by a period. For example, given the key Base.crimson, Base is the list, and crimson is the condition.
  • There are four built-in lists: Base, Invasion, Calamity, and Thorium. The Calamity and Thorium lists will always return false regardless of the condition if the corresponding mod is not enabled.
  • Here is a list of every single key with the list Base:
    • Base.always: Always set to true. Use this for a "default value."
    • Base.never: Always set to false.
    • Base.mechAny: Any mechanical boss has been defeated.
    • Base.mechAll: All mechanical bosses have been defeated.
    • Base.plantera: Plantera has been defeated.
    • Base.golem: Golem has been defeated.
    • Base.cultist: The Lunatic Cultist has been defeated.
    • Base.moonlord: The Moon Lord has been defeated.
    • Base.expert: The world is in expert mode.
    • Base.crimson: The world generated with crimson.
  • Here is a list of every single key with the list Invasion:
    • Invasion.goblins: The Goblin Army has been defeated.
    • Invasion.frost: The Frost Legion has been defeated.
    • Invasion.pirates: The Pirate Invasion has been defeated.
    • Invasion.martians: Martian Madness has been defeated.
  • Here is a list of every single key with the list Calamity:
    • Calamity.cryogen: Cryogen has been defeated.
    • Calamity.leviathan: The Leviathan has been defeated.
    • Calamity.astrumDeus: Astrum Deus has been defeated.
    • Calamity.plaguebringer: The Plaguebringer Goliath has been defeated.
    • Calamity.ravager: The Ravager has been defeated.
    • Calamity.dragonfolly: Dragonfolly has been defeated.
    • Calamity.providence: Providence, the Profaned Goddess has been defeated.
    • Calamity.dog: The Devourer of Gods has been defeated.
    • Calamity.yharon: Yharon has been defeated.
    • Calamity.scal: Supreme Calamitas has been defeated.
    • Calamity.revenge: The world is in Revengeance mode.
    • Calamity.death: The world is in Death mode.
  • Here is a list of every single key with the list Thorium:
    • Thorium.patchwerk: Patch Werk has been defeated.
    • Thorium.bloom: Corpse Bloom has been defeated.
    • Thorium.strider: The Borean Strider has been defeated.
    • Thorium.coznix: Coznix, the Fallen Beholder has been defeated.
    • Thorium.lich: The Lich has been defeated.
    • Thorium.abyssion: Abyssion, The Forgotten One has been defeated.
    • Thorium.primordials: The Primordials have been defeated.
  • Note that most conditions that existed before BetterTaxes 2.0.0 will still work with current versions of BetterTaxes.

Logic Gates

  • Multiple keys can be separated by a logic gate inside the same statement with "and," "or", and "not."
  • Not gates are always parsed before and gates and or gates, and and and or gates are parsed in the order they are written. You can use parentheses inside of your statement to circumvent this.
  • Here are some examples of logic gates in action:
    • Base.crimson and Base.expert
    • Base.mechAny or Base.crimson
    • not Base.expert
    • Base.expert and not Base.crimson
    • Base.expert and Base.mechAll and Base.crimson
    • not (Base.expert and Thorium.coznix)
    • not (Base.crimson and not (Thorium.coznix or Base.moonlord))

Adding Support in Your Mod

  • If you are a mod author, you may also employ the usage of Mod.Call in order to add built-in support for your mod. See the BetterTaxesAPI.cs file.

EnableAutoCollect

  • This field corresponds to whether or not the Tax Collector will automatically placed stored money into any personal storage item in his room at midnight.

TimeBetweenPaychecks

  • This field corresponds to the amount of time in seconds that is separated between paychecks, or when money is contributed to the Tax Collector's "storage." In vanilla Terraria, this is 60 seconds. Note that when the Enchanted Sundial is active, one second corresponds to what would otherwise be a minute.

MoneyCap

  • This field corresponds to the maximum amount of money in copper coins that the Tax Collector can hold at one period of time. In vanilla Terraria, this is 10 gold, or 100,000 copper. Any money earned that would put the user over the cap is discarded.

HappinessBoost

  • This field corresponds to the amount to multiply the happiness tax rate and cap multiplier by. By default, this is 0.0 (disabled).

ExpertModeBoost

  • This field corresponds to the number to multiply the rent values by in expert mode worlds. By default, this is 1.5.

MasterModeBoost

  • This field corresponds to the number to multiply the rent values by in master mode worlds. By default, this is 2.0.