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("Shock")) { noInteruption = false; characterBattleController.DestroyEffect(effects[i], effects); StunnedEffect stunnedEffect = new StunnedEffect(characterBattleController); characterBattleController.TryAddEffect(stunnedEffect, effects); i--; } } catch (Exception e) { Console.WriteLine(e); } } //effects.Add(this); characterBattleController.AddEffect(this, effects); Debug.Log(characterBattleController.gameObject.name + " is wet"); yield return(null); }
public override IEnumerator ApplyEffect(List <Effect> effects) { // Here I can check other effects in list... bool noInteruption = true; int limit = effects.Count; for (int i = 0; i < limit; i++) { try { if (effects[i].name.Equals("Frozen")) { noInteruption = false; } if (effects[i].name.Equals("Wet") || effects[i].name.Equals("Shocked")) { noInteruption = false; characterBattleController.DestroyEffect(effects[i], effects); StunnedEffect stunnedEffect = new StunnedEffect(characterBattleController); characterBattleController.TryAddEffect(stunnedEffect, effects); i--; } } catch (Exception e) { Console.WriteLine(e); } } if (noInteruption) { //effects.Add(this); characterBattleController.AddEffect(this, effects); characterBattleController.characterDataComponent.apRecoveryModifier -= 1; Debug.Log(characterBattleController.gameObject.name + " is zapped for " + duration + " turns."); yield return(null); } }