Skip to main content

ProgressionSettings

A class in Root.Township, the global namespace.

Global settings for XP, levels and skill points. Get it with GlobalSettings<ProgressionSettings>.Instance.

Constructors​

MemberWhat it is
ProgressionSettings()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

30 private and internal fields
MemberWhat it is
private float bellowsPumpToExperienceForging experience gained per bellows pump.
private TransformEvent bodyLevelUpEffectEvent fired on the player's body target on a normal level up.
private TransformEvent bodyLevelUpEffectToPointCapEvent fired on the player's body target on a level up that reaches the point cap.
private PooledObjectDefinition destroyEffectDefinitionPooled effect spawned when a skill orb is destroyed (see OrbDestroyEffect).
private PooledObjectDefinition dissipateToolBasedEffectPooled effect for a tool-based experience effect fading out.
private StatDefinition experienceBoostStatStat that boosts experience gain; read by PlayerProgressionManager.
private ProgressionSettings.PathExperiencePerDamage[] experiencePerDamagePer-path experience gained for each point of damage dealt.
private Dictionary<ProgressionPath, float> experiencePerDamageMapLookup built from experiencePerDamage, keyed by path.
private AnimationCurve experiencePerLevelBasedOnLevelCurve giving the experience needed for a level, by current level.
private ProgressionSettings.PathExperienceShare[] experienceSharePer-path multipliers for experience when holding an object yourself or supporting someone else's.
private Dictionary<ProgressionPath, ProgressionSettings.PathExperienceShare> experienceShareMapLookup built from experienceShare, keyed by path.
private float garnishExperienceBoostCooking experience multiplier when a stew has a garnish.
private GameAchievement get8SkillsAchievementAchievement for owning eight skills.
private BaseImpactChannelProgressionFilter[] impactChannelFilters that map an impact channel to the progression path it gives experience in.
private bool isClearingPracticeObjectsOnFirstPracticeWhether practice objects are cleared the first time a player practises.
private GameAction levelUpActionGame action recorded on level up.
private PooledObjectDefinition levelUpEffectPooled effect spawned at the player's feet on a normal level up.
private PooledObjectDefinition levelUpEffectToPointCapPooled effect spawned at the player's feet on a level up that reaches the point cap.
private uint maxBoughtSkillsMost skills a player can buy. UncapSkillPoints sets it to 0.
private uint maxFreePointsMost unspent skill points a player can hold; 0 disables the cap.
private Dictionary<ImpactChannel, BaseImpactChannelProgressionFilter> pathImpactChannelMapLookup built from impactChannel, keyed by impact channel.
private int perIngredientExperienceCooking experience per stew ingredient.
private float[] playerCountExperienceShareCooking experience multiplier by how many players cooked together (index 0 is one player); the total is split between them.
private Color[] popColorsColour of the experience popup for each progression path.
private ProgressionSettings.InputSystemSound powerStrikeInputSounds for the power strike input turning on and off. Not read anywhere else in this build.
private ProgressionSettings.InputSystemSound raiseHandInputSounds for the raise hand input turning on and off. Not read anywhere else in this build.
private float recipeExperienceBonusCooking experience multiplier when the stew matches a real recipe.
private float sellingSkillPointsRefundPercentageShare (0 to 1) of a level's experience refunded when selling a skill.
private PooledObjectDefinition skillOrbInteractionEffectDefinitionPooled effect played when interacting with a skill orb (formerly the skill buy effect).
private PooledObjectDefinition toolBasedEffectPooled effect shown when a tool hit gives experience.

Properties​

MemberWhat it is
float BellowsPumpToExperience { get; }Forging XP per unit of bellows pumping (0 in the shipped asset).
PooledObjectDefinition DissipateToolBasedEffect { get; }Pooled effect played when a profession skill's tool effect fades.
StatDefinition ExperienceBoostStat { get; }The stat that multiplies all XP a player gains.
GameAchievement Get8SkillsAchievement { get; }Achievement completed on the server when a player owns MaxBoughtSkills skills.
bool IsClearingPracticeObjectsOnFirstPractice { get; }Whether a skill shrine clears practice objects once a slot is first practised.
GameAction LevelUpAction { get; }Game action counted for the player each time they level up.
uint MaxBoughtSkills { get; }How many skills a player may own. Below 1 means no limit.
uint MaxFreePoints { get; }Most unspent points per path. XP stops at the cap. 0 means no cap.
float SellingSkillPointsRefundPercentage { get; }Fraction of the levels' XP given back when a skill is sold.
PooledObjectDefinition SkillOrbInteractionEffectDefinition { get; }Pooled effect for interacting with a skill orb.
PooledObjectDefinition ToolBasedEffect { get; }Pooled effect shown while a profession skill's tool effect is active.

Methods​

MemberWhat it is
uint ExperiencePerLevel(uint currentLevel)XP needed to go from the given level to the next, from a step curve.
void GainStewingExperience(List<Player> cookingPlayers, int ingredientCount, bool isRealRecipe, bool hasGarnish)Gives cooking XP to the cooking players based on ingredients, recipe and garnish, shared by player count. Not called in this build.
float GetDamageExperience(float damage, ProgressionPath path)XP for a hit on a path: the damage times that path's XP per damage (0 if not set).
float GetExperienceSharedMultiplier(bool isSupport, ProgressionPath path)The self or support share multiplier for a path, used when forging with a holder. 1 if the path has none.
Color GetPathPopupColor(ProgressionPath path)Colour of the XP popup text for a path. White if none is set.
void LevelUpEffect(PlayerCharacter character, bool isLevelCap)Plays the level up effect (or the point cap version) on a character's body and feet.
void OrbDestroyEffect(ISkillOrb orb)Spawns the skill orb destroy effect at an orb's position.
void UncapSkillPoints(out int maxXp)Sets MaxFreePoints and MaxBoughtSkills to 0 (no limits) on the shared asset and outputs the curve's last XP value.
bool ValidatePathHit(ImpactHitWithTool hit, bool isGettingExperience, out ProgressionPath path)Maps a tool hit to a progression path by its impact channel and applies that channel's filter. False if the channel is not mapped.
4 private and internal methods
MemberWhat it is
private void FillAndValidateMaps()Rebuilds the per-path lookup maps (experience per damage, experience share, impact channel filters) from the serialized arrays.
private void OnEnable()Builds the lookup maps when the asset loads.
private void OnValidate()Editor: rebuilds the maps and resizes playerCountExperienceShare when its length is off.
private void PopulateMap<T>(Dictionary<ProgressionPath, T> map, T[] array)Fills a path-keyed map from an array of per-path entries and names each entry after its path.