Documentation - kleiner-sentry/PupBase GitHub Wiki
PupManager
This is a class that manages all of its currently registered PupTypes. Inside, it contains a lot of generic functions that allow you to access specific information within. Do note that if an adult name is given, it'll search for that too and return a PupType.name
.
Lists
GetPupTypeList
- Returns a list of all registeredPupType
.GetPupTypeListName
- Returns a list of all registeredPupType
inSlugcatStats.Name
form.GetPupTypeListString
- Returns a list of all registeredPupType
inString
form.
Getters
GetPupType
- Returns the appropriatePupType
based on the name given.TryGetPupType
- Returnsfalse
if it can't find thePupType
. Otherwise, It'll returntrue
and outputs thePupType
found.GetPupTypeFromString
- Returns the appropriatePupType
based on the string given.TryGetPupTypeFromString
- If the given string contains a name from aPupType
, it will returntrue
and output sthePupType
found.
Misc
isAdultName
- If the givenSlugcatStats.Name
has an adult module, It'll return true.
PupStateEx
This class is what you'll be using to access the pups individually assigned PupType
, located in PlayerState
. There are a few other variables, but those aren't as important. There are a few functions that you can use to access this.
Variables
pupType
- The variable that stores what type this pup is. NOTE:pupType
can be null! Build your code accordingly.prioritize
- If set to false, allows pups+ and any other type of custom pup to spawn over this puptype. If set to true, it'll manually override pups+ to not set a variant. This is used to allow compatibility.age
- Used for the aging mechanic. It's used as a counter to show how many cycles this pup has gone with a full tummy.
Methods
PupState
- there are two of these, one inPlayer
and one inPlayerState
. This will grant you access to the pups assignedPupType
.PupType
- Not to confuse this for the class, or the variable, this function will skip ahead and return you the pups assignedPupType
. Used to make code look short and clean.
PupType
This class holds a lot of the important information that this mod will use. It also has a few modules, which you can assign and use to augment how your pup functions.
Modules
These are optional things that you can add that will augment its stats.
RegionModifier
& CampaignModifier
They both modify the pups spawn weight based on where they are / what story mode campaign they're in.
str
- Represents the region ID or the campaign name.spawnMultiplier
- How much this modifier will multiply its spawn weight.adultMultiplier
- How much this modifier will multiply its adult chance.exclusive
- A tag used to make this specific region only allow your kind of pup. If another PupType has this exclusive tag in the same region/campaign as this is used in, they'll both spawn.unique
- Make this kind of pup only spawn in this region/campaign.
AdultModule
This allows pups to become an adult. You must input your own SlugcatStats.Name
that's unique from your PupType
. This is where you can input your own adultChance
, which is a 0-100 percent chance that a pup will be an adult.
name
- the name of the adult puptype. if set to null upon registering, you'll be heckled in the logs and the pup will be assigned "TestpupAdult". Can only be set upon registering.foodToHibernate
&maxFood
- these both set the food of your pups when they're an adult.disableAging
- Disable the aging mechanic. For pups who are immortal. (or take an insanely long time to mature)agingMultiplier
- Multiplies the user-adjusted age in which pups will spawn. It will round to the nearest whole number, with a floor of 1 and a ceiling of 100000.customAdultChance
- Allow users to modify the adult chance. Enabled by default.defaultAdultChance
- The normal adultChance with no modifiers. Can only be set by defining a adultChance parameter when registering.adultChance
- The adultChance, when taking into account user adjustments.
PupType Variables
modName
- Your modname. If set null upon registering, will be set to "???". Can only be set upon registering.name
- The name of your puptype. if set to null upon registering, you'll be heckled in the logs and the pup will be assigned "Testpup". Can only be set upon registering.adultModule
- This is where you'll define an AdultModule.hasAdultModule
- Allows you to quickly check if this puptype has an adult module defined.adultChance
- Used to quickly grab the modules adult chance. Returns 0 if there's no module.regionModifiers
&campaignModifiers
- Allows you to define your own region modifier and campaign. These are both lists.foodToHibernate
&maxFood
- These allow you to customize the food of your pups when they're a pup.hideInMenu
- should Pupbase prevent this registered name from showing up in the story select screen and in arena mode? (possibly useful if you want to make the main character of your campaign into a puptype. I haven't tested this so I'm unsure If it'll work at all.)customSpawnWeight
- This allows you to block the user from customizing its spawnweight.defaultSpawnWeight
- The normal spawnweight with no modifiers. Can only be set by defining a spawnweight parameter when registering.spawnWeight
- The spawnweight, when taking into account user adjustments.
PupType Methods
CalculateWeight
- Used to calculate the final spawn weight based on region and campaign. Outputs the final spawn weight and the final adult chance.ModifiersToString
- combines RegionToString and CampaignToString together into one string.RegionsToString
- Compiles all the region modifiers into a list.CampiagnsToString
- Compiles all the campaign modifiers into a list.