From Brotato Wiki

< User:Darkly77

Revision as of 07:53, 30 June 2023 by Darkly77 (talk | contribs) (WIP)

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.

---

Effect Files

Despite the folder names, most of these effects can used by characters, weapons or items.

Global Effects

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

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 (not applicable) 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 . This method basically reads the Text Key from the translations file, works out where the arg replacements should be (ie. "{0}", "{1}", etc), then replaces 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 boolen, where 0 means FALSE/OFF/DISABLED, and 1 means TRUE/ON/ENABLED. For Alien Eyes.png Alien Eyes the value of 6 determines that 6 Alien Eyes should be shot. For 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 (not applicable) 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. For 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" means that 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, with the result being the sum of Acid's effect (+8), plus whatever other effect values apply in the run.
Effect Sign From Value Determines how to get the sign ("+" or "-") of the value. This should usually be set to "From Value", which automatically adds + or - to the value. You can also force a "+" with "Positive", or a "-" with "Negative". Using "Neutral" ensures that no sign will be added. Finally, "From Arg" means that the sign or format is specified with Custom Args.
Custom Args (not applicable) Allows you to determine the formatting of any and all args that this effect uses. See below for more details.

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