Exemplo n.º 1
0
 public override void Run(Unit Attacker, Unit Target, TargettingData TD, ref int Cost)
 {
     if (!Attacker.HasStatus("Placed this turn"))
     {
         Cost += Attacker.GetAttackCost();
     }
 }
Exemplo n.º 2
0
 public override void Run(Unit Attacker, Unit Target, TargettingData TD, ref int Cost)
 {
     if (TD.AttackType.Short == true && Parent.GetCurrentRange() == Range.Short)
     {
         TD.CanBlock.ShortOnLong = true;
     }
 }
Exemplo n.º 3
0
 public void CheckTargetStatus(Unit Attacker, TargettingData TD, ref int Cost)
 {
     foreach (BeingTargetedModule BTM in BeingTargetedModules)
     {
         BTM.Run(Attacker, this, TD, ref Cost);
     }
 }
Exemplo n.º 4
0
 public override void Run(Unit Spare, Unit Target, TargettingData TD, ref int Cost)
 {
     TD.CanBypass.ShortOnShort |= mCanBypass.ShortOnShort;
     TD.CanBypass.ShortOnLong  |= mCanBypass.ShortOnLong;
     TD.CanBypass.LongOnShort  |= mCanBypass.LongOnShort;
     TD.CanBypass.LongOnLong   |= mCanBypass.LongOnLong;
 }
Exemplo n.º 5
0
 public override void Run(Unit Unit1, Unit Unit2, TargettingData TD, ref int Cost)
 {
     if (Parent.HasStatus("Attacked"))
     {
         TD.CanTarget.Short = false;
         TD.CanTarget.Long  = false;
     }
 }
Exemplo n.º 6
0
 public override void Run(Unit Attacker, Unit Target, TargettingData TD, ref int Cost)
 {
     if (Attacker.GetCurrentRange() == Range.Short & !Target.HasStatus("Defending") & Parent.HasStatus("Defending"))
     {
         TD.CanBlock.ShortOnLong  = true;
         TD.CanBlock.ShortOnShort = true;
     }
 }
Exemplo n.º 7
0
 public override void Run(Unit Spare, Unit Target, TargettingData TD, ref int Cost)
 {
     if (Parent.HasStatus("Needs reloading") || Parent.HasStatus("Reloading"))
     {
         TD.CanTarget.Short = false;
         TD.CanTarget.Long  = false;
     }
 }
Exemplo n.º 8
0
        public void CheckBlockStatus(Unit Attacker, Unit Target, TargettingData TD)
        {
            int dummy = 0;

            //target parameter in TM is 'this' so blocking must only depend on attacker and blocker, not actual target unit
            foreach (BlockingModule TM in BlockingModules)
            {
                TM.Run(Attacker, Target, TD, ref dummy);
            }
        }
Exemplo n.º 9
0
        /// <summary>
        /// Returns the CP cost for Runner to attack Target if possible
        /// or -1 if this attack is not possible.
        /// </summary>
        public int Run(Entities.Unit Runner, Entities.Unit Target)
        {
            int            Cost = 0;
            TargettingData TD   = new TargettingData();

            foreach (TargettingModule TM in TargetModules)
            {
                TM.Run(Runner, Target, TD, ref Cost);
            }
            Target.CheckTargetStatus(Runner, TD, ref Cost);
            if (Cost < 0)
            {
                Cost = 0;
            }
            if (!TD.Result())
            {
                return(-1);
            }
            else
            {
                return(Cost);
            }
        }
Exemplo n.º 10
0
 public override void Run(Unit Unused, Unit Target, TargettingData TD, ref int Cost)
 {
     if (Parent.HasStatus("Was Deployed") || Parent.HasStatus("Deployed"))
     {
         TD.CanTarget.Short = false;
         TD.CanTarget.Long  = false;
     }
     if (Parent.GetCurrentRange() == Range.Long)
     {
         TD.AttackType.Long = true;
     }
     else if (Parent.GetCurrentRange() == Range.Short)
     {
         TD.AttackType.Short = true;
     }
     if (Target.GetCurrentRange() == Range.Long)
     {
         TD.TargetType.Long = true;
     }
     else if (Target.GetCurrentRange() == Range.Short)
     {
         TD.TargetType.Short = true;
     }
 }
Exemplo n.º 11
0
 public override void Run(Unit Unit1, Unit Unit2, TargettingData TD, ref int Cost)
 {
     TD.CanBeTargeted.Long  = false;
     TD.CanBeTargeted.Short = false;
 }
Exemplo n.º 12
0
 public override void Run(Unit Attacker, Unit Target, TargettingData TD, ref int Cost)
 {
     Parent.Owner.CheckBlocks(Attacker, Parent, TD);
 }
Exemplo n.º 13
0
 public abstract void Run(Entities.Unit Unit1, Entities.Unit Unit2, TargettingData TD, ref int Cost);