ProfessionSkill
An abstract class in Root.Township, the global namespace.
Base for a skill in a progression tree: a hashed asset that players unlock and practise. Subclasses ProfessionSkill<T> keep a static Instance for checks like PlayerUnlocked.
- Listed in Global namespace: P
- Inherits or implements
HashedGeneralValue<ProfessionSkill> - Derived types
MiningEchoIntensity,PickupBasedSkill,PickupBasedSkillModifier,ProfessionSkill,ProfessionSkill<T>,StatBonusSkill - Nested types
ActiveEffect - Documented in Skills and unlocks
Constructors
| Member | What it is |
|---|---|
protected ProfessionSkill() | Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets. |
Fields
| Member | What it is |
|---|---|
protected static Logger logger | NLog logger shared by profession skills. |
6 private and internal fields
| Member | What it is |
|---|---|
private static Dictionary<uint, ProfessionSkill.ActiveEffect> activeEffects | Shared map of entity identifier to its pooled tool effect, so several skills can share one effect on a tool. |
private List<PositionedNetworkPrefab> dynamicContentPrefabs | Backing field for DynamicContentPrefabs. |
private Sprite[] practiceGlyphSprites | Backing field for PracticeGlyphSprites. |
private uint skillPracticeTrigger | Hash of the skill whose practice counts for this one. 0 means this skill's own hash. |
private List<PositionedStaticPrefab> staticContentPrefabs | Backing field for StaticContentPrefabs. |
private GameAchievement targetAchievement | Achievement completed for the player by CompleteTargetAchievement (server only). |
Properties
| Member | What it is |
|---|---|
List<PositionedNetworkPrefab> DynamicContentPrefabs { get; } | Network prefabs a skill shrine testing area spawns when this skill's orb is opened. |
Sprite[] PracticeGlyphSprites { get; } | Glyph images shown to show the player how to practise the skill. |
uint SkillPracticeTrigger { get; } | Hash of the skill whose execution counts as practice for this one. Defaults to this skill's own hash. |
List<PositionedStaticPrefab> StaticContentPrefabs { get; } | Static prefabs a skill shrine testing area places when this skill's orb is opened. |
Events
| Member | What it is |
|---|---|
static event ProfessionSkillDelegate OnSkillExecuted | Static event raised whenever any skill fires; skill shrines use it to count practice. |
Methods
| Member | What it is |
|---|---|
void CompleteTargetAchievement(PlayerProgressionManager player) | Server: completes this skill's linked achievement for the player. |
virtual void Lock(PlayerProgressionManager player) | Called when a player loses the skill. Empty in the base class. |
static void ReleaseEffect(NetworkEntity entity, ProfessionSkill skill) | Static: drops one skill's request for the shared tool effect on an entity. The effect goes when no skill still wants it. |
static void ReleaseEffect(uint identifier, ProfessionSkill skill, bool isForced = false) | Static: drops one skill's request for the shared tool effect on an entity. The effect goes when no skill still wants it. |
static void RequestEffect(NetworkEntity entity, ProfessionSkill skill, out ToolBasedEffectBase effect) | Static: gets the shared tool glow effect for an entity, creating it if needed. Extra skills get a dissipate effect instead. |
virtual void SendSerializedMessage(IPlayer player, Stream stream) | Reads or writes extra skill data in a progression skill message to one player. Empty in the base class. |
virtual void Unlock(PlayerProgressionManager player) | Called when a player gains the skill. In ProfessionSkill<T> this also sets the static Instance. |
protected void ExecuteSkill(IPlayer player) | Raises OnSkillExecuted for the player. Subclasses call it when the skill fires. |
protected virtual void ReleaseToolEffect(NetworkEntity entity) | Releases this skill's tool effect on an entity. |
protected virtual void RequestToolEffect(NetworkEntity entity) | Requests the tool effect for an entity and starts it. |
Used in
Members of other types that take, return or hold a ProfessionSkill:
ActionGlyphsPlacer.ActiveSkill, BowStringPullbackInputMethod.ReceiveHit, BowStringPullbackInputMethod.RegisterHandler, DownwardSwingInput.ReceiveHit, DownwardSwingInput.RegisterHandler, HandPositionInput.ReceiveHit, HandPositionInput.RegisterHandler, IInputBasedSkill.Skill, IProfessionSkillTester.InitializeForPlayer, ISkillInputMethod.ReceiveHit, ISkillInputMethod.RegisterHandler, PickupBasedSkill.IInputBasedSkill.Skill, PickupBasedSkillModifier.IInputBasedSkill.Skill, PickupGrabInputMethod.ReceiveHit, PickupGrabInputMethod.RegisterHandler, PlayerProgressionManager.GetLevel, PlayerProgressionManager.sendingSkill, PlayerProgressionManager.SendMessage, PlayerProgressionManager.SendMessageToPlayer, PlayerProgressionManager.SkillUnlocked, PowerStrikeTester.InitializeForPlayer, PowerStrikeTester.skill, PowerStrikeTester.UpdateCount, ProfessionSkill.ActiveEffect.Release, ProfessionSkill.ActiveEffect.Request, ProfessionSkill.ActiveEffect.requestedSkills, ProfessionSkillDelegate.BeginInvoke, ProfessionSkillDelegate.Invoke, ProgressionSlot.ProgressionSlot, ProgressionSlot.skill, ProgressionSlot.Skill, ShakeInput.ReceiveHit, ShakeInput.RegisterHandler, SkillOrb.InitializeSkill, SkillOrb.Skill, SkillShrine.SkillPracticed, StrikeSuccessionInput.ReceiveHit, StrikeSuccessionInput.RegisterHandler, StrikeSuccessionInputStructure.GetStrikeCount, SuccessionStrikeDelegate.BeginInvoke, SuccessionStrikeDelegate.Invoke, TemperatureCheckInput.ReceiveHit, TemperatureCheckInput.RegisterHandler.