-
Notifications
You must be signed in to change notification settings - Fork 3
ClassDataBuilder
Michael edited this page Aug 16, 2024
·
2 revisions
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).
Some methods inherited from DataFileBuilder are not shown. They can be found in Builders.
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.
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(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(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(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(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(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(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(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.
If you want to contribute or need support, join the Wildfrost Discord