From Brotato Wiki

< User:Darkly77

(attack speed notes)
Tag: Reverted
(headings)
 
(21 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Itembox ==
[[Modding Effects]] (New Version, WIP)


Testing a new template, intended for use on mod pages.
The Modding Effects page is very out of date, and the data is scattered. On this page I'll try to update it all.


---


{{Color|pastelred|PLEASE USE CTRL+F5 TO SEE THE NEW STYLES}}
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.


=== Characters ===
---


<table>
''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.''
<tr>


<!-- Isaac -->
==Global Effects==
<td style="vertical-align: top; padding: 0 20px 20px 0;">
==== effect.gd ====
<div class="ibox rarity0 rounded">
Location:  {{Color|color=cream|text=res://items/global/effect.gd}}
<div class="ibox__top">
<div class="ibox__icon rounded">
[[File:Mod-Isaac-isaac_icon.png|60x60px]]
</div>
<div class="ibox__top-right">
<div class="ibox__name colorrarity0">Isaac</div>
<div class="ibox__type">{{Color|cream|Character}}</div>
</div>
</div>
<div class="ibox__stats">
<ul>
<li>{{Color|green|+20%}} Attack Speed</li>
<li>{{Color|red|-30%}} Damage</li>
<li>Start with {{Color|cream|1 D6}}</li>
<li>Start with {{Color|cream|6 Bomb}}</li>
</ul>
</div>
</div>
</td>


<!-- Cain -->
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.
<td style="vertical-align: top; padding: 0 20px 20px 0;">
<div class="ibox rarity0 rounded">
<div class="ibox__top">
<div class="ibox__icon rounded">
[[File:Mod-Isaac-cain_icon.png|60x60px]]
</div>
<div class="ibox__top-right">
<div class="ibox__name colorrarity0">Isaac</div>
<div class="ibox__type">{{Color|cream|Character}}</div>
</div>
</div>
<div class="ibox__stats">
<ul>
<li>{{Color|green|+8%}} chance to double the value of picked up materials</li>
<li>{{Color|red|-250}} Range</li>
<li>You start with {{Color|cream|1 Lucky Foot}}</li>
<li>{{Color|green|+15% Speed}}</li>
<li>{{Color|red|-70% Range}} modifications</li>
<li>{{Color|green|+15% Ranged Damage}} modifications</li>
<li>{{Color|red|-20% Attack Speed}} modifications</li>
</ul>
</div>
</div>
</td>


<!-- Judas -->
Here's an overview of what the various properties of effect.gd do. We'll use {{Color|cream|acid_effect_1.tres}} as a reference, which grants "{{Color|green|+8}} Max HP".
<td style="vertical-align: top; padding: 0 20px 20px 0;">
<div class="ibox rarity0 rounded">
<div class="ibox__top">
<div class="ibox__icon rounded">
[[File:Mod-Isaac-judas_icon.png|60x60px]]
</div>
<div class="ibox__top-right">
<div class="ibox__name colorrarity0">Judas</div>
<div class="ibox__type">{{Color|cream|Character}}</div>
</div>
</div>
<div class="ibox__stats">
<ul>
<li>{{Color|green|+15% Damage}}</li>
<li>You start with {{Color|cream|1 The Book of Belial}}</li>
<li>{{Color|green|+10% Crit Chance}}</li>
<li>{{Color|red|-10 Armor}}</li>
<li>{{Color|green|+25% Crit Chance}} modifications</li>
<li>{{Color|red|-15% Max HP}} modifications</li>
</ul>
</div>
</div>
</td>


<!-- Magdalene (Maggy) -->
{| class="wikitable"
<td style="vertical-align: top; padding: 0 20px 20px 0;">
!Property
<div class="ibox rarity0 rounded">
!Value for Acid
<div class="ibox__top">
!Description
<div class="ibox__icon rounded">
|-
[[File:Mod-Isaac-magdalene_icon.png|60x60px]]
|Key
</div>
|stat_max_hp
<div class="ibox__top-right">
| Has two uses:
<div class="ibox__name colorrarity0">Magdalene</div>
<div class="ibox__type">{{Color|cream|Character}}</div>
</div>
</div>
<div class="ibox__stats">
<ul>
<li>{{Color|green|+5 Max HP}}</li>
<li>+2% Damage for every -1% Speed you have [{{Color|green|+24}}]</li>
<li>You start with {{Color|cream|1 Yum Heart}}</li>
<li>You start with {{Color|cream|3 Maggy's Faith}}</li>
<li>{{Color|red|-10 HP Regeneration}}</li>
</ul>
</div>
</div>
</td>


<!-- Keeper -->
* 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").
<td style="vertical-align: top; padding: 0 20px 20px 0;">
* 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".
<div class="ibox rarity0 rounded">
|-
<div class="ibox__top">
|Text Key
<div class="ibox__icon rounded">
|<small>''n/a''</small>
[[File:Mod-Isaac-keeper_icon.png|60x60px]]
|If an effect key is specified, it's retrieved from the translation file.
</div>
<div class="ibox__top-right">
<div class="ibox__name colorrarity0">Keeper</div>
<div class="ibox__type">{{Color|cream|Character}}</div>
</div>
</div>
<div class="ibox__stats">
<ul>
<li>{{Color|green|+10 Max HP}}</li>
<li>Your Max HP is capped at its current value [{{Color|green|20}}]</li>
<li>{{Color|green|+20%}} chance to heal 1 HP when picking up a material</li>
<li>{{Color|red|-100 HP Regeneration}}</li>
<li>{{Color|red|-100% Life Steal}}</li>
<li>{{Color|green|-5% Items Price}}</li>
</ul>
</div>
</div>
</td>


<!-- Eden -->
* 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.
<td style="vertical-align: top; padding: 0 20px 20px 0;">
* For example, Crown's Text Key is "effect_harvesting_growth".
<div class="ibox rarity0 rounded">
* The translation string can include placeholders for args (arguments), which replace strings like "{0}", "{1}", etc.
<div class="ibox__top">
* 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.  
<div class="ibox__icon rounded">
* To see how they're processed, view the "text" method in {{Color|cream|text=singletons/text.gd}}.
[[File:Mod-Isaac-eden_icon.png|60x60px]]
** This method basically reads the Text Key from the translations file, and works out where the arg replacements should be (ie. "{0}", "{1}", etc)
</div>
** Then replaces it them with the args provided.
<div class="ibox__top-right">
|-
<div class="ibox__name colorrarity0">Eden</div>
| Value
<div class="ibox__type">{{Color|cream|Character}}</div>
|8
</div>
|Sets the strength of the effect.
</div>
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.
<div class="ibox__stats">
Sometimes the Value is used as a boolean, where 0 means FALSE/OFF/DISABLED, and 1 means TRUE/ON/ENABLED.
<ul>
Examples:
<li>Random Perk Item</li>
<li>Random Stat Item</li>
</ul>
</div>
</div>
</td>


</tr>
* {{MiniIconbox|Alien Eyes}} = The value of 6 determines that 6 Alien Eyes should be shot.
</table>
* {{MiniIconbox|Baby Elephant}} = The value of 25 is used to determine that the chance of Baby Elephant's effect is 25%.
|-
|Custom Key
|<small>''n/a''</small>
|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:


* {{MiniIconbox|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:


=== Items ===
* '''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.


<table>
* '''Positive''' = Force a plus sign (+)
<tr>
* '''Negative''' = Force a minus sign (-)
<td style="vertical-align: top; padding: 0 20px 20px 0;">
* '''From Value''' = Get the sign from the value. If it's positive, show +, and vice versa. This is usually the best setting to use.
<!-- D6 -->
* '''Neutral''' = Ensures no sign will be added.
<div class="ibox rarity3 rounded">
* '''From Arg''' = This means that the sign or format is specified with Custom Args.
<div class="ibox__top">
|-
<div class="ibox__icon rounded">
|Custom Args
[[File:Mod-Isaac-dice6_icon.png|60x60px]]
|<small>''n/a''</small>
</div>
|Allows you to determine the formatting of any and all args that this effect uses. See below for more details.
<div class="ibox__top-right">
|}
<div class="ibox__name colorrarity3">D6</div>
<div class="ibox__type">{{Color|cream|Unique}}</div>
</div>
</div>
<div class="ibox__stats">
<ul>
<li>
{{Color|green|+2}} free reroll in the shop
</li>
<li>
{{Color|red|-5}} Luck
</li>
<li>
{{Color|red|+5%}} Items Price
</li>
</ul>
</div>
</div>
</td>


<td style="vertical-align: top; padding: 0 20px 20px 0;">
====custom_arg.gd====
<!-- Belial Book -->
Location: {{Color|color=cream|text=res://items/global/custom_arg.gd}}
<div class="ibox rarity3 rounded">
<div class="ibox__top">
<div class="ibox__icon rounded">
[[File:Mod-Isaac-belial_book_icon.png|60x60px]]
</div>
<div class="ibox__top-right">
<div class="ibox__name colorrarity3">The Book of Belial</div>
<div class="ibox__type">{{Color|cream|Unique}}</div>
</div>
</div>
<div class="ibox__stats">
<ul>
<li>
{{Color|green|+1}} temporary damage per crit kill
</li>
<li>
{{Color|red|-10}} Max HP
</li>
<li>
{{Color|red|-10%}} Damage
</li>
</ul>
</div>
</div>
</td>


<td style="vertical-align: top; padding: 0 20px 20px 0;">
Not an effect file, but it used by many effects. Applied to the `custom_args` property, this allows you to format additional args.  
<!-- Bomb -->
<div class="ibox rarity1 rounded">
<div class="ibox__top">
<div class="ibox__icon rounded">
[[File:Mod-Isaac-bomb_icon.png|60x60px]]
</div>
<div class="ibox__top-right">
<div class="ibox__name colorrarity1">Bomb</div>
<div class="ibox__type">{{Color|cream|Limited (10)}}</div>
</div>
</div>
<div class="ibox__stats">
<ul>
<li>
A landmine spawns every {{Color|green|-1}} seconds dealing {{Color|green|56}} (200% {{StatIcon|Engineering}}) damage in an area
</li>
</ul>
</div>
</div>
</td>


<td style="vertical-align: top; padding: 0 20px 20px 0;">
For example, open {{Color|cream|estys_couch_effect_1.tres}} in Godot's Inspector. We know that this effect gives "{{Color|green|+2}} HP Regeneration for every -1% Speed you have.". The ''effect_sign'' is set to positive,
<!-- Lucky Foot -->
<div class="ibox rarity2 rounded">
<div class="ibox__top">
<div class="ibox__icon rounded">
[[File:Mod-Isaac-lucky_foot_icon.png|60x60px]]
</div>
<div class="ibox__top-right">
<div class="ibox__name colorrarity2">Lucky Foot</div>
<div class="ibox__type">{{Color|cream|Limited (5)}}</div>
</div>
</div>
<div class="ibox__stats">
<ul>
<li>
{{Color|green|+1%}} chance to get {{Color|green|+1}} Luck when picking up a material
</li>
<li>
{{Color|red|-5%}} Speed
</li>
</ul>
</div>
</div>
</td>
</tr>


<tr>


<td style="vertical-align: top; padding: 0 20px 20px 0;">
<!-- Maggy's Faith -->
<div class="ibox rarity2 rounded">
<div class="ibox__top">
<div class="ibox__icon rounded">
[[File:Mod-Isaac-maggys_faith_icon.png|60x60px]]
</div>
<div class="ibox__top-right">
<div class="ibox__name colorrarity2">Maggy's Faith</div>
<div class="ibox__type">{{Color|cream|Limited (3)}}</div>
</div>
</div>
<div class="ibox__stats">
<ul>
<li>
{{Color|green|+1}} Max HP at the end of a wave
</li>
<li>
{{Color|red|-4%}} Speed
</li>
</ul>
</div>
</div>
</td>


<td style="vertical-align: top; padding: 0 20px 20px 0;">
== Item Effects ==
<!-- Yum Heart -->
Stored in {{Color|color=cream|text=res://effects/items/*.gd}}
<div class="ibox rarity2 rounded">
{| class="wikitable"
<div class="ibox__top">
!
<div class="ibox__icon rounded">
!
[[File:Mod-Isaac-yum_heart_icon.png|60x60px]]
|-
</div>
|burn_chance_effect.gd
<div class="ibox__top-right">
|
<div class="ibox__name colorrarity2">Yum Heart</div>
|-
<div class="ibox__type">{{Color|cream|Unique}}</div>
|chance_stat_damage_effect.gd
</div>
|
</div>
|-
<div class="ibox__stats">
|class_bonus_effect.gd
<ul>
|
<li>
|-
{{Color|green|+7 HP}} recovered from consumables
|convert_stat_effect.gd
</li>
|
<li>
|-
{{Color|red|-20%}} Life Steal
|gain_stat_for_every_stat_effect.gd
</li>
|
</ul>
|-
</div>
|healing_effect.gd
</div>
|
</td>
|-
|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
|
|}


<td style="vertical-align: top; padding: 0 20px 20px 0;">
== Weapon Effects ==
<!-- Bomb Bag -->
Stored in {{Color|color=cream|text=res://effects/weapons/*.gd}}  
<div class="ibox rarity3 rounded">
{| class="wikitable"
<div class="ibox__top">
!Filename
<div class="ibox__icon rounded">
!Info
[[File:Mod-Isaac-bomb_bag_icon.png|60x60px]]
|-
</div>
|burning_effect.gd
<div class="ibox__top-right">
|
<div class="ibox__name colorrarity3">Bomb Bag</div>
|-
<div class="ibox__type">{{Color|cream|Limited (3)}}</div>
|exploding_effect.gd
</div>
|
</div>
|-
<div class="ibox__stats">
|gain_stat_every_killed_enemies_effect.gd
<ul>
|
<li>
|-
Flies with you
|null_effect.gd
</li>
|
<li>
|-
A landmine spawns every {{Color|green|20}} seconds dealing {{Color|green|65}} (200% {{StatIcon|Engineering}}) damage in an area
|projectiles_on_hit_effect.gd
</li>
|
</ul>
|-
</div>
|slow_in_zone_effect.gd
</div>
|
</td>
|-
 
|weapon_stack_effect.gd
<td style="vertical-align: top; padding: 0 20px 20px 0;">
|
<!-- Bloodshot Eye -->
|}
<div class="ibox rarity1 rounded">
<div class="ibox__top">
<div class="ibox__icon rounded">
[[File:Mod-Isaac-bloodshot_eye_icon.png|60x60px]]
</div>
<div class="ibox__top-right">
<div class="ibox__name colorrarity1">Bloodshot Eye</div>
<div class="ibox__type">{{Color|cream|Limited (6)}}</div>
</div>
</div>
<div class="ibox__stats">
<ul>
<li>
Spawns a companion that flies around you and shoots enemies for 8 damage (50% {{StatIcon|Ranged Damage}} 50% {{StatIcon|Engineering}})
</li>
</ul>
</div>
</div>
</td>
 
<td style="vertical-align: top; padding: 0 20px 20px 0;">
<!-- 8 Inch Nails -->
<div class="ibox rarity3 rounded">
<div class="ibox__top">
<div class="ibox__icon rounded">
[[File:Mod-Isaac-inch_nails_icon.png|60x60px]]
</div>
<div class="ibox__top-right">
<div class="ibox__name colorrarity3">8 Inch Nails</div>
<div class="ibox__type">{{Color|cream|Unique}}</div>
</div>
</div>
<div class="ibox__stats">
<ul>
<li>
{{Color|green|Damage}} modifications are increased by {{Color|green|10%}}
</li>
</ul>
</div>
</div>
</td>
</tr>
 
</table>
 
 
=== Weapons ===
 
Works with weapons too. Might be a bit excessive to show all tiers so I'm only showing the initial one here.
 
 
<table>
<tr>
 
<!-- Isaac's Tears (Template) -->
<td style="vertical-align: top; padding: 0 20px 20px 0;">
{{ItemboxWeapon
| name      = Isaac's Tears
| class    = Tears
| image    = Mod-Isaac-isaacs_tears_icon.png
| rarity    = 1
| damage    = {{Color|tier1|7}}/{{Color|tier2|14}}/{{Color|tier3|28}}/{{Color|tier4|45}} ({{StatIcon|Ranged Damage}})
| critical  = x2 (3% chance)
| cooldown  = {{Color|tier1|0.7}}/{{Color|tier2|0.62}}/{{Color|tier3|0.53}}/{{Color|tier4|0.45}}s
| knockback = 10
| piercing  = {{Color|tier1|0}}/{{Color|tier2|0}}/{{Color|tier3|1}}/{{Color|tier4|1}}
| range    = 700 (Ranged)
}}
</td>
       
<!-- Isaac's Tears (HTML) -->
<td style="vertical-align: top; padding: 0 20px 20px 0;">
<div class="ibox rarity1 rounded">
<div class="ibox__top">
<div class="ibox__icon rounded">
[[File:Mod-Isaac-isaacs_tears_icon.png|60x60px]]
</div>
<div class="ibox__top-right">
<div class="ibox__name colorrarity1">Isaac's Tears</div>
<div class="ibox__type">{{Color|cream|Tears}}</div>
</div>
</div>
<div class="ibox__stats">
<ul>
<li>
{{Color|cream|Damage:}} 7 ({{StatIcon|Ranged Damage}})
</li>
<li>
{{Color|cream|Critical:}} x2 (3% chance)
</li>
<li>
{{Color|cream|Cooldown:}} 0.7s
</li>
<li>
{{Color|cream|Knockback:}} 10
</li>
<li>
{{Color|cream|Range:}} 700 (Ranged)
</li>
</ul>
</div>
</div>
</td>
 
<td style="vertical-align: top; padding: 0 20px 20px 0;">
<!-- Number One -->
<div class="ibox rarity1 rounded">
<div class="ibox__top">
<div class="ibox__icon rounded">
[[File:Mod-Isaac-number_one_icon.png|60x60px]]
</div>
<div class="ibox__top-right">
<div class="ibox__name colorrarity1">Number One</div>
<div class="ibox__type">{{Color|cream|Tears}}</div>
</div>
</div>
<div class="ibox__stats">
<ul>
<li>
{{Color|cream|Damage:}} 4 (50%{{StatIcon|Ranged Damage}})
</li>
<li>
{{Color|cream|Critical:}} x2 (3% chance)
</li>
<li>
{{Color|cream|Cooldown:}} 0.45s
</li>
<li>
{{Color|cream|Knockback:}} 15
</li>
<li>
{{Color|cream|Range:}} 200 (Ranged)
</li>
</ul>
</div>
</div>
</td>
 
<td style="vertical-align: top; padding: 0 20px 20px 0;">
<!-- The Inner Eye -->
<div class="ibox rarity1 rounded">
<div class="ibox__top">
<div class="ibox__icon rounded">
[[File:Mod-Isaac-inner_eye_icon.png|60x60px]]
</div>
<div class="ibox__top-right">
<div class="ibox__name colorrarity1">The Inner Eye</div>
<div class="ibox__type">{{Color|cream|Tears}}</div>
</div>
</div>
<div class="ibox__stats">
<ul>
<li>
{{Color|cream|Damage:}} 7x3 (50%{{StatIcon|Ranged Damage}})
</li>
<li>
{{Color|cream|Critical:}} x2 (3% chance)
</li>
<li>
{{Color|cream|Cooldown:}} 1.2s
</li>
<li>
{{Color|cream|Knockback:}} 10
</li>
<li>
{{Color|cream|Range:}} 300 (Ranged)
</li>
</ul>
</div>
</div>
</td>
 
<td style="vertical-align: top; padding: 0 20px 20px 0;">
<!-- Mom's Knife -->
<div class="ibox rarity2 rounded">
<div class="ibox__top">
<div class="ibox__icon rounded">
[[File:Mod-Isaac-moms_knife_icon.png|60x60px]]
</div>
<div class="ibox__top-right">
<div class="ibox__name colorrarity2">Mom's Knife II</div>
<div class="ibox__type">{{Color|cream|Precise, Demonic}}</div>
</div>
</div>
<div class="ibox__stats">
<ul>
<li>
{{Color|cream|Damage:}} 30 (60%{{StatIcon|Melee Damage}})
</li>
<li>
{{Color|cream|Critical:}} x1.5 (30% chance)
</li>
<li>
{{Color|cream|Cooldown:}} 1.3s
</li>
<li>
{{Color|cream|Knockback:}} 2
</li>
<li>
{{Color|cream|Range:}} 350 (Melee)
</li>
</ul>
</div>
</div>
</td>
</tr>
</table>
 
 
 
<table>
<tr>
 
<td style="vertical-align: top; padding: 0 20px 20px 0;">
<!-- Circular Saw -->
<div class="ibox rarity2 rounded">
<div class="ibox__top">
<div class="ibox__icon rounded">
[[File:Circular_Saw.png|60x60px]]
</div>
<div class="ibox__top-right">
<div class="ibox__name colorrarity2">Circular Saw</div>
<div class="ibox__type">{{Color|cream|Medical}}</div>
</div>
</div>
<div class="ibox__stats">
<ul>
<li>
{{Color|cream|Damage:}} 14 (50%{{StatIcon|Melee Damage}})
</li>
<li>
{{Color|cream|Critical:}} x2 (10% chance)
</li>
<li>
{{Color|cream|Cooldown:}} 0.5s
</li>
<li>
{{Color|cream|Knockback:}} 10
</li>
<li>
{{Color|cream|Range:}} 350 (Melee)
</li>
<li>
{{Color|cream|Piercing:}} 2 (-{{Color|green|20%}} damage)
</li>
<li>
{{Color|cream|Life Steal:}} {{Color|green|5%}}
</li>
</ul>
</div>
</div>
</td>
 
</tr>
</table>
 
 
<hr>
 
== Attack Speed Notes ==
 
''This info was gonna go on the [[Attack Speed]] page, but I didn't use it in the end due to the complexity of the calculation for melee.''
 
In the game's code, a weapon's displayed "attack speed" is determined by both two of its stats: cooldown and recoil_duration, via weapon_stats.gd (see get_cooldown_text in ranged_weapon_stats.gd and melee_weapon_stats.gd)
 
Recoil Duration is almost always 0.1, except for 11 ranged weapons: Crossbow (0.15), Flamethrower (0.02), Laser Gun (0.2), Minigun (0.02), Nuclear Launcher (0.142), Obliterator (0.2), Rocket Launcher (0.142), Shredder (0.15), Slingshot (0.15), SMG (0.05), and Sniper Gun (0.2).
 
For ranged weapons, the displayed attack speed is calculated as:
 
(cooldown / 60) + (recoil_duration * 2)
 
For melee weapons, the displayed attack speed is calculated as:
 
(cooldown / 60) + recoil_duration + (atk_duration / 2) + back_duration
 
Here's what those melee variables mean:
 
back_duration = 0.2 / (1 + (stat_attack_speed * 3))
At 0 attack speed, this would be: 0.2
At 10 attack speed (0.1), this would be: 0.15
At 50 attack speed (0.5), this would be: 0.08
At 100 attack speed (1), this would be: 0.05
atk_duration = max(0.01, 0.2 - (stat_attack_speed / 10.0)) + range_factor * 0.15
range_factor = max(0.0, WPN.max_range / clamp(70.0 * (1 + (stat_attack_speed / 3)), 70.0, 120.0))
max gets the highest value, so here it can't be lower than 0
clamp makes sure the value isn't higher/lower than the specified numbers, so here it can't be lower than 70 or higher than 120

Latest revision as of 08:11, 30 June 2023

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