public override IEnumerator ApplyEffect(List <Effect> effects) { bool noInteruption = true; int limit = effects.Count; for (int i = 0; i < limit; i++) { try { if (effects[i].name.Equals("Burn")) { noInteruption = false; characterBattleController.DestroyEffect(effects[i], effects); i--; WetEffect wetEffect = new WetEffect(characterBattleController); characterBattleController.TryAddEffect(wetEffect, effects); } } catch (Exception e) { Console.WriteLine(e); } } if (noInteruption) { //effects.Add(this); characterBattleController.AddEffect(this, effects); Debug.Log(characterBattleController.gameObject.name + " is frozen"); yield return(null); } }
public override IEnumerator WereOffEffect(List <Effect> effects) { try { WetEffect wetEffect = new WetEffect(characterBattleController); characterBattleController.TryAddEffect(wetEffect, effects); // characterBattleController.DestroyEffect(this, effects); // effects.Remove(this); } catch (Exception e) { Debug.Log(e); Debug.Log("Error in removal!"); } Debug.Log("Freeze effect were off"); yield return(null); }