public override bool CanActivateOnTarget(ManualSkill ActiveSkill) { if (Context.EffectOwnerSquad.CurrentLeader == null || Context.EffectOwnerSquad.CurrentLeader.Pilot == null || Context.EffectOwnerSquad.IsDead) { return(false); } for (int U = Context.EffectOwnerSquad.UnitsAliveInSquad - 1; U >= 0; --U) { if (Context.EffectOwnerSquad[U] == null || Context.EffectOwnerSquad[U].Pilot == null) { continue; } Context.SetContext(Context.EffectOwnerSquad, Context.EffectOwnerUnit, Context.EffectOwnerCharacter, Context.EffectOwnerSquad, Context.EffectOwnerUnit, Context.EffectOwnerSquad[U].Pilot, Context.Map.ActiveParser); if (ActiveSkill.CanActivateEffectsOnTarget(Context.EffectOwnerSquad[U].Pilot.Effects)) { return(true); } } return(false); }
public override void ActivateSkillFromMenu(ManualSkill ActiveSkill) { Context.SetContext(Context.EffectOwnerSquad, Context.EffectOwnerUnit, Context.EffectOwnerCharacter, Context.EffectOwnerSquad, Context.EffectOwnerUnit, Context.EffectOwnerCharacter); AddAndExecuteEffect(ActiveSkill, Context.EffectOwnerCharacter.Effects); Context.EffectOwnerCharacter.SP -= ActiveSkill.SPCost; }
public override bool CanActivateOnTarget(ManualSkill ActiveSkill) { for (int P = Context.Map.ListPlayer.Count - 1; P >= 0; --P) { for (int Squad = Context.Map.ListPlayer[P].ListSquad.Count - 1; Squad >= 0; --Squad) { if (Context.Map.ListPlayer[P].ListSquad[Squad].CurrentLeader == null || Context.Map.ListPlayer[P].ListSquad[Squad].CurrentLeader.Pilot == null || Context.Map.ListPlayer[P].ListSquad[Squad].IsDead) { continue; } for (int U = Context.Map.ListPlayer[P].ListSquad[Squad].UnitsAliveInSquad - 1; U >= 0; --U) { if (Context.Map.ListPlayer[P].ListSquad[Squad][U] == null || Context.Map.ListPlayer[P].ListSquad[Squad][U].Pilot == null) { continue; } Context.SetContext(Context.EffectOwnerSquad, Context.EffectOwnerUnit, Context.EffectOwnerCharacter, Context.Map.ListPlayer[P].ListSquad[Squad], Context.Map.ListPlayer[P].ListSquad[Squad][U], Context.Map.ListPlayer[P].ListSquad[Squad][U].Pilot); if (ActiveSkill.CanActivateEffectsOnTarget(Context.Map.ListPlayer[P].ListSquad[Squad][U].Pilot.Effects)) { return(true); } } } } return(false); }
public void AddAndExecuteEffect(ManualSkill ActiveSkill, EffectHolder Effects) { for (int E = ActiveSkill.ListEffect.Count - 1; E >= 0; --E) { //Init Skill. Effects.AddAndExecuteEffect(ActiveSkill.ListEffect[E], ActiveSkill.Name); } }
public SelectSkillTargetScreen(DeathmatchMap Map, ManualSkill ActiveSkill, Character SkillPilot, Unit SkillUnit, Squad SkillSquad, DeathmatchContext Context, ManualSkillTarget Owner) { this.Map = Map; this.ActiveSkill = ActiveSkill; this.SkillPilot = SkillPilot; this.SkillUnit = SkillUnit; this.SkillSquad = SkillSquad; this.Context = Context; this.Owner = Owner; }
public override void ActivateSkillFromMenu(ManualSkill ActiveSkill) { for (int U = Context.EffectOwnerSquad.UnitsAliveInSquad - 1; U >= 0; --U) { Context.SetContext(Context.EffectOwnerSquad, Context.EffectOwnerUnit, Context.EffectOwnerCharacter, Context.EffectOwnerSquad, Context.EffectOwnerUnit, Context.EffectOwnerSquad[U].Pilot); AddAndExecuteEffect(ActiveSkill, Context.EffectOwnerSquad[U].Pilot.Effects); Context.EffectOwnerCharacter.SP -= ActiveSkill.SPCost; } }
public override bool CanActivateOnTarget(ManualSkill ActiveSkill) { if (Context.EffectOwnerSquad.CurrentLeader == null || Context.EffectOwnerSquad.CurrentLeader.Pilot == null || Context.EffectOwnerSquad.IsDead) { return(false); } Context.SetContext(Context.EffectOwnerSquad, Context.EffectOwnerUnit, Context.EffectOwnerCharacter, Context.EffectOwnerSquad, Context.EffectOwnerUnit, Context.EffectOwnerCharacter); return(ActiveSkill.CanActivateEffectsOnTarget(Context.EffectOwnerCharacter.Effects)); }
public override void ActivateSkillFromMenu(ManualSkill ActiveSkill) { for (int P = Context.Map.ListPlayer.Count - 1; P >= 0; --P) { for (int S = Context.Map.ListPlayer[P].ListSquad.Count - 1; S >= 0; --S) { for (int U = Context.Map.ListPlayer[P].ListSquad[S].UnitsAliveInSquad - 1; U >= 0; --U) { Context.SetContext(Context.EffectOwnerSquad, Context.EffectOwnerUnit, Context.EffectOwnerCharacter, Context.Map.ListPlayer[P].ListSquad[S], Context.Map.ListPlayer[P].ListSquad[S][U], Context.Map.ListPlayer[P].ListSquad[S][U].Pilot); AddAndExecuteEffect(ActiveSkill, Context.Map.ListPlayer[P].ListSquad[S][U].Pilot.Effects); } } } }
public abstract bool CanActivateOnTarget(ManualSkill ActiveSkill);
public abstract void ActivateSkillFromMenu(ManualSkill ActiveSkill);
public override void ActivateSkillFromMenu(ManualSkill ActiveSkill) { Context.Map.PushScreen(new SelectSkillTargetScreen(Context.Map, ActiveSkill, Context.EffectOwnerCharacter, Context.EffectOwnerUnit, Context.EffectOwnerSquad, Context, this)); }