/// <summary> /// Initializes the spell. This MUST be called before the spell can be casted. /// </summary> public void Initialize(ISpellController mgr) { this.spellManager = mgr; this.LoadHandlers(); this.state = this.isProc ? SpellStates.WaitingForProc : SpellStates.Idle; this.IsReady = true; }
public void DestroySpell(ISpellController spellController, bool isLocal) { spellsDictionary.Remove(spellController.GetGuid()); if (isLocal) { localSpells.Remove(spellController); } else { onlineSpells.Remove(spellController); } }
/// <summary> /// A response from the server stating a player is casting a spell has been recieved /// This message states that a spell is being casted. /// </summary> /// <param name="spell">Spell being casted</param> /// <param name="playerXPos">Casting X position of the spell</param> /// <param name="playerZPos">Casting Z position of the spell</param> public void CastSpell(ISpellController spell, float playerXPos, float playerZPos) { var playerPos = new Vector3(playerXPos, UnityStaticValues.StaticYPos, playerZPos); this.spellBeingCasted = spell; playerController.SetCurrentPos(playerPos); playerController.SetTargetPos(playerPos); playerController.playerAnimator.CastSpell(); if (InGameWrapper.instance.playersWrapper.GetOnlyLocalPlayer() == playerController) { spellSpawnRequestIssuedLocally = false; } }