Brynzananas-Skill_Upgrades_Tree icon

Skill Upgrades Tree

Library mod for adding skill upgrades to skills that can be selected in lobby. Comes with own skill upgrades if there are no other skill upgrades

Last updated a day ago
Total downloads 130
Total rating 0 
Categories Libraries Skills
Dependency string Brynzananas-Skill_Upgrades_Tree-1.0.0
Dependants 0 other packages depend on this package

This mod requires the following mods to function

RiskofThunder-HookGenPatcher-1.2.9 icon
RiskofThunder-HookGenPatcher

MMHOOK generation at runtime.

Preferred version: 1.2.9
RiskofThunder-R2API_Addressables-1.1.3 icon
RiskofThunder-R2API_Addressables

R2API Submodule for implementing Addressables functionality

Preferred version: 1.1.3

README

How to use (For modders)

Adding Skill Upgrades

SkillUpgradesTreeDef

  • Create SkillUpgradesTreeDef ScriptableObject

  • Fill SkillUpgradesTreeDef List<R2API.AddressReferencedAssets.AddressReferencedAsset<SkillDef>> skillsToApply list with R2API.AddressReferencedAssets.AddressReferencedAsset<SkillDef> to which skills add skill upgrades to. Please keep skills within the same SkillFamily

  • Fill SkillUpgradesTreeDef List<SkillUpgrade> skills with SkillUpgrade

  • Run Register method to register this skill upgrades tree

SkillUpgrade

  • Create SkillUpgrade class

  • Fill SkillUpgrade string id with your string identificator. MUST BE UNIQUE!!!

  • Fill SkillUpgrade string nameToken with your name language token

  • Fill SkillUpgrade string descriptionToken with your description language token

  • Fill SkillUpgrade string loreToken with your lore language token

  • Fill Sprite icon with your icon Sprite

  • Fill List<string> mutuallyExclusiveWith with SkillUpgrade.id that cannot be selected together. SkillUpgrade you included here will also have your SkillUpgrade as mutually exclusive

  • Fill int selectiveUpgradesRequired with how much Selective RequiredUpgrade required to select this skill

  • Fill List<RequiredUpgrade> requiredUpgrades with required skill upgrades needed to be selected first

RequiredUpgrade

  • Create RequiredUpgrade struct

  • Fill string requiredSkillId with SkillUpgrade.id that is needed to be selected

  • Fill RequiredUpgradeCondition condition either with Required if required skill needs to be selected or Selective if you want to make either of Selective required upgrades needed to be selected to satisfy selection condition

How it looks

skillupgradestreedefpreview

Getting Skill Upgrades

  • To get if the player has selected the skill upgrade run SkillUpgradesTreeApi.GetSkillUpgradeSelected(this SkillLocator skillLocator, string upgradeId) or SkillUpgradesTreeApi.GetSkillUpgradeSelected(this SkillLocator skillLocator, SkillUpgradeIndex skillUpgradeIndex)

Examples

  • Mod has SkillUpgradesTreeDef TestDef in SkillUpgradesTreeApi that gets registered if there are zero SkillUpgradesTreeDef registered

  • Functionality of the upgrades in the SkillUpgradesTreeDef TestDef are located in TestClass

How to use (For players)

  • Select the skill that has skill upgrades and there will be a new menu to select skill upgrades. You cannot miss it

  • Move skill upgrades screen with WASD on keyboard or right thumbstick on controller

  • Close skill upgrades menu by selecting skill that doesn't have skill upgrades

  • On controllers navigate through the menu using DPAD or left thumbstick. To navigate back to skill selection menu press left until you navigate back

TODO:

  • Improve skill upgrades selection menu

  • Add UnlockableDef unlock requirement to SkillUpgrade

  • Add ability for director to spawn monsters with selected upgrades if possible