/// <summary> /// Called when the action is first activated /// <param name="rPreviousSpellActionState">State of the action prior to this one activating</param> public override void Activate(int rPreviousSpellActionState = -1, object rData = null) { base.Activate(rPreviousSpellActionState, rData); MotionController lMotionController = _Spell.Owner.GetComponent <MotionController>(); if (lMotionController != null) { MagicMessage lMessage = MagicMessage.Allocate(); lMessage.ID = MessageID; lMotionController.SendMessage(lMessage); lMessage.Release(); } base.Deactivate(); }
/// <summary> /// Activates the action on a single target /// </summary> /// <param name="rTarget">Target to activate on</param> protected bool ActivateInstance(GameObject rTarget) { if (rTarget == null) { return(false); } IActorCore lActorCore = rTarget.GetComponent <IActorCore>(); if (lActorCore == null) { return(true); } MagicMessage lMessage = MagicMessage.Allocate(); lMessage.Data = this; bool lIsAffected = lActorCore.TestAffected(lMessage); lMessage.Release(); return(lIsAffected); }