Skip to content

Adding new perks

hepfnepf edited this page Jun 7, 2023 · 1 revision

Adding new perks requires two basic steps:

  1. Creating the perk
  2. Adding it to the game

Creating the perk

To create a perk, inherit from res://Scenes/Perks/Perk.tscn. This perk node will be added to the player, when they receive the perk. Extend the script and override the add_effect() and remove_effect() methods. If you want to display a formatted string as text, also override the according functions. Add the required translations to the translation file, if you can. Take a look at the provided perks if you have questions.

Adding the perk to the game

Add the perk to the PerkManager of the player scene by adding it to the perk array. Also add a new entry to the likelihood array and put in the likelihood. These likelihoods are relative to each other, which means a perk with a likelihood of 20 will be spawned twice as likely as one with 10.

Clone this wiki locally