예제 #1
0
 public override void Cast(ICaster caster)
 {
     if (!inited)
     {
         if (TargetSelector.Selectable)
         {
             BattleMaid.Summon.SetSelector(TargetSelector, caster);
         }
         else
         {
             TargetSelector.Eval(caster);
             List <ITargetable> res = TargetSelector.Result;
             if (res.Count > 0)
             {
                 Apply(res[0]);
             }
             finished = true;
         }
         inited = true;
     }
     else
     {
         if (TargetSelector.IsSelected)
         {
             Apply(TargetSelector.SelectedTarget);
             finished = true;
         }
     }
 }
예제 #2
0
    public void SetSelector(TargetSelector selector, IBattler battler)
    {
        currentSelector = selector;
        List <ITargetable> targets = currentSelector.Eval(battler);

        for (int i = 0; i < targets.Count; i++)
        {
            targets[i].SetTargetable();
        }
    }