From Brotato Wiki

< User:Darkly77

Revision as of 08:11, 30 June 2023 by Darkly77 (talk | contribs) (headings)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Modding Effects (New Version, WIP)

The Modding Effects page is very out of date, and the data is scattered. On this page I'll try to update it all.

---

This page documents the various effects in the vanilla game. Modders can apply these effects to their custom content.

For more info on specific effects, please search the code for their keys, and view the code and .tres files for the listed items/characters/weapons.

---

Note: Despite the folder names, most of these effects can used by characters, weapons or items. They're only split into Global/Items/Weapons here to make it easier to find the associated files.

Global Effects

effect.gd

Location: res://items/global/effect.gd

The file that is used the most for applying effects. If you want to apply an effect, there's a very strong chance you'll do it with this file.

Here's an overview of what the various properties of effect.gd do. We'll use acid_effect_1.tres as a reference, which grants "+8 Max HP".

Property Value for Acid Description
Key stat_max_hp Has two uses:
  • Most commonly, it specifies the target of the effect's behaviour: For example, if you're modifying a stat, the key is the stat (eg "stat_max_hp").
  • The second use is to specify a custom effet key, with the effect ID being the key: For example, Crown uses the key "harvesting_growth".
Text Key n/a If an effect key is specified, it's retrieved from the translation file.
  • For simple stat changes, you don't need to provide a Text Key. But for anything more complex than basic stat changes, you'll probably need one.
  • For example, Crown's Text Key is "effect_harvesting_growth".
  • The translation string can include placeholders for args (arguments), which replace strings like "{0}", "{1}", etc.
  • If you're making your own custom effect, you can specify what value these args should use with the method get_args in your effect file.
  • To see how they're processed, view the "text" method in singletons/text.gd.
    • This method basically reads the Text Key from the translations file, and works out where the arg replacements should be (ie. "{0}", "{1}", etc)
    • Then replaces it them with the args provided.
Value 8 Sets the strength of the effect.

For stats, this determines how much of a stat should be increased. The number can also be negative, which means a stat should be decreased. Sometimes the Value is used as a boolean, where 0 means FALSE/OFF/DISABLED, and 1 means TRUE/ON/ENABLED. Examples:

  • Alien Eyes.png Alien Eyes = The value of 6 determines that 6 Alien Eyes should be shot.
  • Baby Elephant.png Baby Elephant = The value of 25 is used to determine that the chance of Baby Elephant's effect is 25%.
Custom Key n/a Custom Key can be used instead of Key, to determine a special effect.

This allows you to use the Key to specify, in most cases, the stat that the effect should act upon, while also using a custom effect. Example:

  • Anvil.png Anvil's effect is set with its Custom Key, "upgrade_random_weapon".
  • The effect upgrades a random weapon, and if it can't, then it increases a stat.
  • Anvil's effect sets the key to "stat_armor", which means that the increased stat is Armor
  • (And its value of "2" means that the Armor stat should be increased by 2.)
Storage Method Sum Determines how the value should be saved/applied:
  • Sum = The value will be added (or deducted) from whatever the current run's effect value is.
    • Acid uses this to add +8 to the current Max HP value.
    • Your final Max HP value is the sum of whatever your current Max HP is, plus Acid's value of +8.
  • Key Value = ???
    • Used by: apprentice / farmer_effect_2b / glutton_effect_1 / peacock_effect_2 / peacock_effect_3
  • Replace = This effect's value should replace (ie. override) the current run's stat.
    • Eg. Arms Dealer uses "minimum_weapons_in_shop", with a value of 1, which replaces any other values in the run.
Effect Sign From Value Determines how to get the sign ("+" or "-") of the value.
  • Positive = Force a plus sign (+)
  • Negative = Force a minus sign (-)
  • From Value = Get the sign from the value. If it's positive, show +, and vice versa. This is usually the best setting to use.
  • Neutral = Ensures no sign will be added.
  • From Arg = This means that the sign or format is specified with Custom Args.
Custom Args n/a Allows you to determine the formatting of any and all args that this effect uses. See below for more details.

custom_arg.gd

Location: res://items/global/custom_arg.gd

Not an effect file, but it used by many effects. Applied to the `custom_args` property, this allows you to format additional args.

For example, open estys_couch_effect_1.tres in Godot's Inspector. We know that this effect gives "+2 HP Regeneration for every -1% Speed you have.". The effect_sign is set to positive,


Item Effects

Stored in res://effects/items/*.gd

burn_chance_effect.gd
chance_stat_damage_effect.gd
class_bonus_effect.gd
convert_stat_effect.gd
gain_stat_for_every_stat_effect.gd
healing_effect.gd
item_exploding_effect.gd
projectile_effect.gd
stat_cap_effect.gd
stat_gains_modification_effect.gd
stat_with_max_effect.gd
structure_effect.gd
turret_effect.gd
weapon_bonus_effect.gd

Weapon Effects

Stored in res://effects/weapons/*.gd

Filename Info
burning_effect.gd
exploding_effect.gd
gain_stat_every_killed_enemies_effect.gd
null_effect.gd
projectiles_on_hit_effect.gd
slow_in_zone_effect.gd
weapon_stack_effect.gd