Skip to main content

EnchantmentEffectApplication<T>

An abstract class in Root.Township, Alta.Enchantments.

Base for an enchantment effect active on one item, holding its EnchantmentEffect settings. Runs when one of its binding's triggers fires and syncs the hit effect to clients.

Constructors​

MemberWhat it is
EnchantmentEffectApplication(EnchantmentApplication enchantment, T settings)Creates an EnchantmentEffectApplication from enchantment and settings.

Fields​

3 private and internal fields
MemberWhat it is
private Quaternion hitAlignementRotation facing back along the hit direction, for hit effects.
private Vector3 hitPositionWhere the last tool hit landed.
private bool isAppliedUnused flag in this build.

Properties​

MemberWhat it is
EnchantmentApplication EnchantmentApp { get; private set; }The enchantment application this effect belongs to.
T Settings { get; private set; }The effect asset with this effect's values.
1 private and internal property
MemberWhat it is
private EnchantmentEffect Alta.Enchantments.IEnchantmentEffectApplication.Settings { get; }The settings as a plain EnchantmentEffect, for the interface.

Methods​

MemberWhat it is
virtual void Invoke(object data)Called when the enchanted tool hits: records the hit point, sends the effect to players and plays it. Overrides apply the actual change.
void RunEvent()Plays the effect's hit events at the stored hit point. Does nothing on a headless server.
virtual void SendMessage(Stream stream)Writes or reads the hit position and rotation; on a remote client it then plays the hit events.