ClassDataBuilder - rspforhp/WildfrostModdingDocumentation GitHub Wiki
ClassDataBuilder
ClassDataBuilder(this)
- The builder for creating ClassData (tribes).
- To prevent confusion with C# clases, the instances of ClassData will be referred to as "tribes".
- The naming convention for classes are 5-letter words starting with a capital letter (Basic, Magic, Clunk).
Methods
Some methods inherited from DataFileBuilder are not shown. They can be found in Builders.
Create (Inherited from DataFileBuilder)
Create(string name) OR Create<T>(string name) where T is a class that inherits from ClassData
- Used to create a tribe.
nameis the internal name for your status effect.Tis a class that inherits from ClassData (there isn't any in the base game)- This is the first method to use after creating builder.
SubscribeToAfterAllBuildEvents (Inherited from DataFileBuilder)
SubscribeToAfterAllBuildEvent(AfterBuildDelegate d)
- Assigns a delegate
dthat is executed after all builders have built and loaded their respective data into the game (soGetcan now find them). - This method allows for "orderless" building.
WithCharacterPrefab
WithCharacterPrefab(Character characterPrefab)
- Assigns the "Character" of the tribe.
- The character holds fields to be used in a run, as well as some
PlayerData. - Noteworthy variables lies in the
playerDatavariable, including hand size, redraw time, companion limit, etc. - Character is a Monobehaviour so it must be attached to a GameObject (which also has an Entity component).
- The character holds fields to be used in a run, as well as some
characterPrefabis the Character component to be used and copied by the tribe.- The
nameofcharacterPrefabis important because it is the easiest way to determine the current tribe after save/reload.
- The
WithFlag
WithFlag(string flag) OR WithFlag(Sprite flag)
- Used to set the flag of your tribe.
flagis the sprite file's relative address or the sprite itself.- Directory format for using this: referencing
.../Mods/ModName/Images/test.pngwould be WithFlag("Images/test.png"). - The sprite dimensions seem to scale depending on the context.
- Regardless, the dimensions of the in-game sprites are 1116x1426 pixels.
WithLeaders
WithLeaders(params CardData[] leaders)
- Used to specify the possible leaders of your tribe.
- Three random leaders will appear when selecting the tribe.
leadersare the CardData of all of your potential leaders.- You can assign several CardData by separating them with a comma (",").
- Unless you are only using vanilla leaders, edit the
leadersfield inSubscribeToAfterAllBuildEventinstead.
WithRequiresUnlock [Needs Testing]
WithRequiresUnlock(UnlockData requiresUnlock)
- Presumably locks the tribe away until a certain condition is met.
requiresUnlockis the UnlockData for this condition.- Due to build order, you would want to edit the
requiresUnlockfield directly throughSubscribeToAfterAllBuildEventinstead.
WithRewardPools
WithRewardPools(params RewardPool[] rewardPools)
- Used to specify the pool of card/charm/bell choices throughout a run as your tribe.
rewardPoolsare the reward pools available to the tribe.- Unless you are only using vanilla reward pools, you would want to edit the
rewardPoolsfield directly throughSubscribeToAfterAllBuildEventinstead. - A list of the vanilla reward pools can be found in the references.
WithSelectSfxEvent
WithSelectSfxEvent(EventReference selectSfxEvent)
- Used to determine the sound effect played when selecting your tribe.
selectSfxEventis the reference to the sound effect.- To make an EventReference, use
FMODUnity.RuntimeManager.PathToEventReference(string path)wherepathis one of the sfx events listed in the references.
WithStartingInventory
WithStartingInventory(Inventory startingInventory)
- Used to specify the starting inventory of the tribe.
startingInventoryis the starting inventory of the class- To make a new Inventory from scratch, use
new Inventory(). There are some key variables to edit.deckdetermines your starting deck.upgradesdetermines your starting charms/crowns.golddetermines your starting gold.
- Typically, you would want to edit the
rewardPoolsfield directly throughSubscribeToAfterAllBuildEventinstead.