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.
  • name is the internal name for your status effect.
  • T is 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 d that is executed after all builders have built and loaded their respective data into the game (so Get can 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 playerData variable, 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).
  • characterPrefab is the Character component to be used and copied by the tribe.
    • The name of characterPrefab is important because it is the easiest way to determine the current tribe after save/reload.

WithFlag

WithFlag(string flag) OR WithFlag(Sprite flag)

  • Used to set the flag of your tribe.
  • flag is the sprite file's relative address or the sprite itself.
  • Directory format for using this: referencing .../Mods/ModName/Images/test.png would 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.
  • leaders are 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 leaders field in SubscribeToAfterAllBuildEvent instead.

WithRequiresUnlock [Needs Testing]

WithRequiresUnlock(UnlockData requiresUnlock)

  • Presumably locks the tribe away until a certain condition is met.
  • requiresUnlock is the UnlockData for this condition.
  • Due to build order, you would want to edit the requiresUnlock field directly through SubscribeToAfterAllBuildEvent instead.

WithRewardPools

WithRewardPools(params RewardPool[] rewardPools)

  • Used to specify the pool of card/charm/bell choices throughout a run as your tribe.
  • rewardPools are the reward pools available to the tribe.
  • Unless you are only using vanilla reward pools, you would want to edit the rewardPools field directly through SubscribeToAfterAllBuildEvent instead.
  • 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.
  • selectSfxEvent is the reference to the sound effect.
  • To make an EventReference, use FMODUnity.RuntimeManager.PathToEventReference(string path) where path is one of the sfx events listed in the references.

WithStartingInventory

WithStartingInventory(Inventory startingInventory)

  • Used to specify the starting inventory of the tribe.
  • startingInventory is the starting inventory of the class
  • To make a new Inventory from scratch, use new Inventory(). There are some key variables to edit.
    • deck determines your starting deck.
    • upgrades determines your starting charms/crowns.
    • gold determines your starting gold.
  • Typically, you would want to edit the rewardPools field directly through SubscribeToAfterAllBuildEvent instead.