public new async Task Execute(CharacterControl s) { foreach (var c in CombatManager.Instance.teams[(int)s.team]) { await StatusEffect.ApplyBuff(c, BuffType.Protection, -2); } }
public async Task Execute(CharacterControl s) { _randAlly = RandomTargetInTeam(s.team); _randEnemy = RandomTargetInTeam(s.team + 1); foreach (SkillAction action in actions) { List <CharacterControl> targets = new List <CharacterControl>(); switch (action.targetMode) { case SkillTargetMode.OneAlly: targets.Add(_randAlly); break; case SkillTargetMode.OneEnemy: targets.Add(_randEnemy); break; case SkillTargetMode.Self: targets.Add(s); break; case SkillTargetMode.EveryAlly: targets = new List <CharacterControl>(CombatManager.Instance.teams[(int)s.team]); break; case SkillTargetMode.EveryEnemy: targets = new List <CharacterControl>(CombatManager.Instance.teams[(int)s.team + 1]); break; default: Debug.LogError("Tried to execute melody with unknown targetMode [" + action.targetMode + "]"); break; } switch (action.actionType) { case SkillActionType.Attack: targets.ForEach(async t => await t.TakeDamage(action.value / 100f * s.currentStats.atq)); break; case SkillActionType.Heal: targets.ForEach(async t => await t.Heal(action.value)); break; case SkillActionType.ApplyEffect: targets.ForEach(async t => await StatusEffect.ApplyEffect(t, action.effectType, (int)action.value)); break; case SkillActionType.ApplyBuff: targets.ForEach(async t => await StatusEffect.ApplyBuff(t, action.buffType, (int)action.value)); break; default: Debug.LogError("Tried to execute melody with unknown actionType [" + action.actionType + "]"); break; } } }
public new async Task Execute(CharacterControl s) { CharacterControl target = RandomTargetInTeam(s.team); if (hasForcedTarget) { target = forcedTarget; } await StatusEffect.ApplyBuff(s, BuffType.Protection, -3); await StatusEffect.ApplyEffect(target, EffectType.Marked, 2); }
protected override async Task ExecuteOnTarget(CharacterControl t) { await StatusEffect.ApplyBuff(t, BuffType.Attack, -1); }
public async Task Execute(CharacterControl s) { randAlly = RandomTargetInTeam(s.team); randEnemy = RandomTargetInTeam(s.team + 1); foreach (SkillAction action in actions) { List <CharacterControl> targets = new List <CharacterControl>(); switch (action.targetMode) { case SkillTargetMode.OneAlly: targets.Add(randAlly); break; case SkillTargetMode.OneEnemy: targets.Add(randEnemy); break; case SkillTargetMode.OneOtherAlly: targets.Add(RandomOtherAlly(s)); break; case SkillTargetMode.EveryOtherAlly: targets = new List <CharacterControl>(CombatManager.Instance.teams[(int)s.team]); targets.Remove(s); break; case SkillTargetMode.Self: targets.Add(s); break; case SkillTargetMode.EveryAlly: targets = new List <CharacterControl>(CombatManager.Instance.teams[(int)s.team]); break; case SkillTargetMode.EveryEnemy: targets = new List <CharacterControl>(CombatManager.Instance.teams[(int)(s.team + 1) % 2]); break; case SkillTargetMode.Everyone: targets = new List <CharacterControl>( new List <CharacterControl>(CombatManager.Instance.teams[(int)s.team]) .Union(new List <CharacterControl>(CombatManager.Instance.teams[(int)(s.team + 1) % 2]))); break; default: Debug.LogError("Tried to execute melody with unknown targetMode [" + action.targetMode + "]"); break; } if (hasForcedTarget) { targets.Clear(); targets.Add(forcedTarget); } switch (action.actionType) { case SkillActionType.Attack: foreach (var t in targets) { await t.TakeDamage(action.value / 100f *s.currentStats.atq); await CombatManager.Instance.dialogManager.ShowDialog(DialogFilter.Damage, Dialog.GetCharacterTypeFromCharacterControl(s), CharacterType.None, s.characterData.clientImage, s.characterName); await CombatManager.Instance.dialogManager.ShowDialog(DialogFilter.Damage, CharacterType.None, Dialog.GetCharacterTypeFromCharacterControl(t), t.characterData.clientImage, t.characterName); if (t.currentStats.hp.Value <= 0) { await CombatManager.Instance.dialogManager.ShowDialog(DialogFilter.Kill, Dialog.GetCharacterTypeFromCharacterControl(s), CharacterType.None, s.characterData.clientImage, s.characterName); await CombatManager.Instance.dialogManager.ShowDialog(DialogFilter.Kill, CharacterType.None, Dialog.GetCharacterTypeFromCharacterControl(t), t.characterData.clientImage, t.characterName); } } break; case SkillActionType.Heal: foreach (var t in targets) { await CombatManager.Instance.dialogManager.ShowDialog(DialogFilter.Heal, Dialog.GetCharacterTypeFromCharacterControl(s), CharacterType.None, s.characterData.clientImage, s.characterName); await t.Heal(action.value); await CombatManager.Instance.dialogManager.ShowDialog(DialogFilter.Heal, CharacterType.None, Dialog.GetCharacterTypeFromCharacterControl(t), t.characterData.clientImage, t.characterName); } break; case SkillActionType.StealHealth: targets.ForEach(async t => { await t.TakeDamage(action.value / 100f * s.currentStats.atq); await s.Heal(action.value / 100f * s.currentStats.atq); }); break; case SkillActionType.ApplyEffect: targets.ForEach(async t => await StatusEffect.ApplyEffect(t, action.effectType, (int)action.value)); break; case SkillActionType.ApplyBuff: targets.ForEach(async t => await StatusEffect.ApplyBuff(t, action.buffType, (int)action.value)); break; case SkillActionType.RemoveEveryEffect: targets.ForEach(t => t.statusEffects.ToList().ForEach(async e => await e.RemoveEffect())); break; case SkillActionType.RemoveEffect: targets.ForEach(async t => await t.statusEffects.First(e => e.type == action.effectType).RemoveEffect()); break; case SkillActionType.ShuffleSkillWheel: targets.ForEach(async t => await t.ShuffleSkillsSlot()); break; default: Debug.LogError("Tried to execute melody with unknown actionType [" + action.actionType + "]"); break; } } hasForcedTarget = false; forcedTarget = null; }
public async Task Execute(CharacterControl s) { _randAlly = RandomTargetInTeam(s.team); _randEnemy = RandomTargetInTeam(s.team + 1); foreach (SkillAction action in actions) { List <CharacterControl> targets = new List <CharacterControl>(); switch (action.targetMode) { case SkillTargetMode.OneAlly: targets.Add(_randAlly); break; case SkillTargetMode.OneEnemy: targets.Add(_randEnemy); break; case SkillTargetMode.OneOtherAlly: targets.Add(RandomOtherAlly(s)); break; case SkillTargetMode.EveryOtherAlly: targets = new List <CharacterControl>(CombatManager.Instance.teams[(int)s.team]); targets.Remove(s); break; case SkillTargetMode.Self: targets.Add(s); break; case SkillTargetMode.EveryAlly: targets = new List <CharacterControl>(CombatManager.Instance.teams[(int)s.team]); break; case SkillTargetMode.EveryEnemy: targets = new List <CharacterControl>(CombatManager.Instance.teams[(int)(s.team + 1) % 2]); break; case SkillTargetMode.Everyone: targets = new List <CharacterControl>( new List <CharacterControl>(CombatManager.Instance.teams[(int)s.team]) .Union(new List <CharacterControl>(CombatManager.Instance.teams[(int)(s.team + 1) % 2]))); break; default: Debug.LogError("Tried to execute melody with unknown targetMode [" + action.targetMode + "]"); break; } switch (action.actionType) { case SkillActionType.Attack: targets.ForEach(async t => await t.TakeDamage(action.value / 100f * s.currentStats.atq)); break; case SkillActionType.Heal: targets.ForEach(async t => await t.Heal(action.value)); break; case SkillActionType.StealHealth: targets.ForEach(async t => { await t.TakeDamage(action.value / 100f * s.currentStats.atq); await s.Heal(action.value / 100f * s.currentStats.atq); }); break; case SkillActionType.ApplyEffect: targets.ForEach(async t => await StatusEffect.ApplyEffect(t, action.effectType, (int)action.value)); break; case SkillActionType.ApplyBuff: targets.ForEach(async t => await StatusEffect.ApplyBuff(t, action.buffType, (int)action.value)); break; case SkillActionType.RemoveEveryEffect: targets.ForEach(t => t.statusEffects.ToList().ForEach(async e => await e.RemoveEffect())); break; case SkillActionType.RemoveEffect: targets.ForEach(async t => await t.statusEffects.First(e => e.type == action.effectType).RemoveEffect()); break; case SkillActionType.ShuffleSkillWheel: targets.ForEach(async t => await t.ShuffleSkillWheel()); break; default: Debug.LogError("Tried to execute melody with unknown actionType [" + action.actionType + "]"); break; } } }