public static Delta[] GetHealDeltas(Unit target, Unit source, int amt, GameManager gm)
        {
            List <Delta> deltas = new List <Delta>();
            UnitDelta    ud     = new UnitHealthDelta(target, source, amt, Damage.Type.HEAL);

            deltas.Add(ud);
            gm.UseAddHealDeltas(deltas, ud);
            return(deltas.ToArray());
        }
 public void SphereSkeletalReshaperInner(List <Delta> deltas, GMWithLocation gmLoc)
 {
     if (gmLoc.IsFortifying("Carthan"))
     {
         deltas.AddRange(
             UnitHealthDelta.GetHealDeltas(
                 gmLoc.FrontUnit,
                 gmLoc.SubjectUnit,
                 2,
                 gmLoc.GameManager
                 )
             );
     }
 }
Example #3
0
        public void ArchonEtherealClassInner(List <Delta> deltas, GMWithLocation gmLoc)
        {
            Unit front = gmLoc.FrontUnit;

            if (front != null)
            {
                deltas.AddRange(
                    UnitHealthDelta.GetHealDeltas(
                        front,
                        gmLoc.SubjectUnit,
                        2,
                        gmLoc.GameManager
                        )
                    );

                int side = gmLoc.Side;

                Unit left = gmLoc.LeftLane?.Units?[side, 0];
                if (left != null)
                {
                    deltas.AddRange(
                        UnitHealthDelta.GetHealDeltas(
                            left,
                            gmLoc.SubjectUnit,
                            1,
                            gmLoc.GameManager
                            )
                        );
                }

                Unit right = gmLoc.RightLane?.Units?[side, 0];
                if (right != null)
                {
                    deltas.AddRange(
                        UnitHealthDelta.GetHealDeltas(
                            right,
                            gmLoc.SubjectUnit,
                            1,
                            gmLoc.GameManager
                            )
                        );
                }
            }
        }
Example #4
0
        public Delta[] GetDamagingDeltas(Lane l, int oppSide, Damage.Type dmgType, GameManager gm)
        {
            int dmgLeft = (dmgType == Damage.Type.RANGED ? RangedAttack : MeleeAttack);

            List <Delta> deltas = new List <Delta>();

            Unit[] targets = { l.Units[oppSide, 0], l.Units[oppSide, 1] };
            FilterTargets?.Invoke(targets);

            for (int pos = 0; dmgLeft > 0 && pos < 2; pos++)
            {
                if (targets[pos] != null)
                {
                    //System.Console.WriteLine($"    Found Target at Pos{pos}");
                    Unit target     = targets[pos];
                    int  resistance = target.GetResistance(dmgType);
                    int  deal       = System.Math.Min(target.HealthPoints + resistance, dmgLeft);
                    //System.Console.WriteLine($"    Dealing{deal} to {target.Card.Name} with resist{resistance}");

                    deltas.AddRange(
                        UnitHealthDelta.GetDamageDeltas(
                            target,
                            this,
                            deal,
                            dmgType,
                            gm
                            )
                        );
                    dmgLeft -= deal;
                    target.ModifyDamageLeft?.Invoke(ref dmgLeft);
                    //System.Console.WriteLine($"    Damage Left{dmgLeft}");
                }
            }

            if (dmgLeft > 0)
            {
                int towerDamage = 1;
                ModifyTowerDamage?.Invoke(ref towerDamage);
                //System.Console.WriteLine($"    Hit Tower{towerDamage}");
                deltas.AddRange(l.Towers[oppSide].GetDamageDeltas(towerDamage, dmgType));
            }

            return(deltas.ToArray());
        }
 public void ArchonBrynhildeClassInner(List <Delta> deltas, GMWithLocation gmLoc)
 {
     if (gmLoc.IsFortifying("Carthan"))
     {
         // heal front line 2
         deltas.AddRange(
             UnitHealthDelta.GetHealDeltas(
                 gmLoc.FrontUnit,
                 gmLoc.SubjectUnit,
                 2,
                 gmLoc.GameManager
                 )
             );
         // gain 3 mana
         deltas.AddRange(
             gmLoc.SubjectPlayer.ManaPool.GetAddDeltas(3)
             );
     }
 }
Example #6
0
        public void EXAvengerCustomDrone1Inner(List <Delta> deltas, GMWithLocation gmLoc)
        {
            if (turn == 0)
            {
                if (gmLoc.IsFortifying("Carthan", "Infantry"))
                {
                    foreach (Card c in gmLoc.SubjectPlayer.Hand)
                    {
                        deltas.AddRange(gmLoc.SubjectPlayer.Hand.GetRemoveDelta(c));
                    }

                    buffAmount = gmLoc.SubjectPlayer.Hand.Count;

                    deltas.Add(new UnitDamageAmountDelta(gmLoc.FrontUnit, buffAmount,
                                                         Damage.Type.RANGED, gmLoc.SubjectUnit));
                    buffed = gmLoc.FrontUnit;

                    deltas.AddRange(
                        UnitHealthDelta.GetHealDeltas(
                            gmLoc.FrontUnit,
                            gmLoc.SubjectUnit,
                            buffAmount,
                            gmLoc.GameManager
                            )
                        );
                }
            }
            else if (turn == 1)
            {
                if (buffed != null)
                {
                    deltas.Add(new UnitDamageAmountDelta(buffed, -buffAmount,
                                                         Damage.Type.RANGED, gmLoc.SubjectUnit));
                    buffed = null;
                }
            }
            turn++;
        }
        public void SphereMedicalVanguardInner(List <Delta> deltas, GMWithLocation gmLoc)
        {
            Console.WriteLine($"Sphere Medical Vanguard L{gmLoc.Lane} S{gmLoc.Side} P{gmLoc.Pos}");
            if (gmLoc.Pos == 0 && gmLoc.BackUnit == null)
            {
                Console.WriteLine("  In");
                int lane = gmLoc.Lane;
                int side = gmLoc.Side;

                Unit leftLaneFront = gmLoc.LeftLane?.Units?[side, 0];
                if (leftLaneFront != null)
                {
                    Console.WriteLine("  L");
                    deltas.AddRange(
                        UnitHealthDelta.GetHealDeltas(
                            leftLaneFront,
                            gmLoc.SubjectUnit,
                            1,
                            gmLoc.GameManager
                            )
                        );
                }

                Unit rightLaneFront = gmLoc.RightLane?.Units?[side, 0];
                if (rightLaneFront != null)
                {
                    Console.WriteLine("  R");
                    deltas.AddRange(
                        UnitHealthDelta.GetHealDeltas(
                            rightLaneFront,
                            gmLoc.SubjectUnit,
                            1,
                            gmLoc.GameManager
                            )
                        );
                }
            }
        }