ProgressionSettings
A class in Root.Township, the global namespace.
Global settings for XP, levels and skill points. Get it with GlobalSettings<ProgressionSettings>.Instance.
- Listed in Global namespace: P
- Inherits or implements
GlobalSettings<ProgressionSettings> - Derived types
ProgressionSettings,ProgressionSettings.Create - Nested types
Create,InputSystemSound,PathData,PathExperiencePerDamage,PathExperienceShare,PathImpactChannel - Attributes
GlobalSettings - Documented in Progression
Constructors
| Member | What it is |
|---|---|
ProgressionSettings() | Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets. |
Fields
30 private and internal fields
| Member | What it is |
|---|---|
private float bellowsPumpToExperience | Forging experience gained per bellows pump. |
private TransformEvent bodyLevelUpEffect | Event fired on the player's body target on a normal level up. |
private TransformEvent bodyLevelUpEffectToPointCap | Event fired on the player's body target on a level up that reaches the point cap. |
private PooledObjectDefinition destroyEffectDefinition | Pooled effect spawned when a skill orb is destroyed (see OrbDestroyEffect). |
private PooledObjectDefinition dissipateToolBasedEffect | Pooled effect for a tool-based experience effect fading out. |
private StatDefinition experienceBoostStat | Stat that boosts experience gain; read by PlayerProgressionManager. |
private ProgressionSettings.PathExperiencePerDamage[] experiencePerDamage | Per-path experience gained for each point of damage dealt. |
private Dictionary<ProgressionPath, float> experiencePerDamageMap | Lookup built from experiencePerDamage, keyed by path. |
private AnimationCurve experiencePerLevelBasedOnLevel | Curve giving the experience needed for a level, by current level. |
private ProgressionSettings.PathExperienceShare[] experienceShare | Per-path multipliers for experience when holding an object yourself or supporting someone else's. |
private Dictionary<ProgressionPath, ProgressionSettings.PathExperienceShare> experienceShareMap | Lookup built from experienceShare, keyed by path. |
private float garnishExperienceBoost | Cooking experience multiplier when a stew has a garnish. |
private GameAchievement get8SkillsAchievement | Achievement for owning eight skills. |
private BaseImpactChannelProgressionFilter[] impactChannel | Filters that map an impact channel to the progression path it gives experience in. |
private bool isClearingPracticeObjectsOnFirstPractice | Whether practice objects are cleared the first time a player practises. |
private GameAction levelUpAction | Game action recorded on level up. |
private PooledObjectDefinition levelUpEffect | Pooled effect spawned at the player's feet on a normal level up. |
private PooledObjectDefinition levelUpEffectToPointCap | Pooled effect spawned at the player's feet on a level up that reaches the point cap. |
private uint maxBoughtSkills | Most skills a player can buy. UncapSkillPoints sets it to 0. |
private uint maxFreePoints | Most unspent skill points a player can hold; 0 disables the cap. |
private Dictionary<ImpactChannel, BaseImpactChannelProgressionFilter> pathImpactChannelMap | Lookup built from impactChannel, keyed by impact channel. |
private int perIngredientExperience | Cooking experience per stew ingredient. |
private float[] playerCountExperienceShare | Cooking experience multiplier by how many players cooked together (index 0 is one player); the total is split between them. |
private Color[] popColors | Colour of the experience popup for each progression path. |
private ProgressionSettings.InputSystemSound powerStrikeInput | Sounds for the power strike input turning on and off. Not read anywhere else in this build. |
private ProgressionSettings.InputSystemSound raiseHandInput | Sounds for the raise hand input turning on and off. Not read anywhere else in this build. |
private float recipeExperienceBonus | Cooking experience multiplier when the stew matches a real recipe. |
private float sellingSkillPointsRefundPercentage | Share (0 to 1) of a level's experience refunded when selling a skill. |
private PooledObjectDefinition skillOrbInteractionEffectDefinition | Pooled effect played when interacting with a skill orb (formerly the skill buy effect). |
private PooledObjectDefinition toolBasedEffect | Pooled effect shown when a tool hit gives experience. |
Properties
| Member | What 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
| Member | What 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
| Member | What 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. |