Exemple #1
0
 public static void HitCrit(Ship ship, Level level, Shot shot)
 {
     if (Globals.Randomizer.Next(0, 101) < shot.Chance)
     {
         ship.TakeDamage(shot.Damage * 2, shot.ShieldPiercing, DamageType.laser);
         level.CombatText("CRIT!");
     }
     else
     {
         ship.TakeDamage(shot.Damage, shot.ShieldPiercing, DamageType.laser);
     }
 }
Exemple #2
0
 public static void HitEnemyShotDelay(Ship ship, Level level, Shot shot)
 {
     ship.TakeDamage(shot.Damage, shot.ShieldPiercing, DamageType.laser);
     if (Globals.Randomizer.Next(0, 101) < shot.Chance)
     {
         ship.Weapons[Globals.Randomizer.Next(0, ship.Weapons.Count)].Disabled = 120;
         level.CombatText(ship.GetType().Name + " Weapon Jammed!");
     }
 }
Exemple #3
0
 public static void HitDamageOverTime(Ship ship, Level level, Shot shot)
 {
     ship.TakeDamage(shot.Damage, shot.ShieldPiercing, DamageType.laser);
     ship.SetDamageOverTime(shot.Damage / 6, 6, shot.ShieldPiercing);
 }
Exemple #4
0
 public static void HitBasic(Ship ship, Level level, Shot shot)
 {
     ship.TakeDamage(shot.Damage, shot.ShieldPiercing, DamageType.laser);
 }
Exemple #5
0
 public static Ship CollisionTarget(Level level, Shot shot)
 {
     if (level.GameObjects.Any(item => shot.Targets.Any(target => target == item.GetType().Name) && item.Box.Intersects(shot.Box)))
     {
         return (Ship)level.GameObjects.First(item => shot.Targets.Any(target => target == item.GetType().Name) && item.Box.Intersects(shot.Box));
     }
     return null;
 }
Exemple #6
0
 public static void HitBasic(Level level, Shot shot)
 {
     if (CollisionTarget(level, shot) != null)
     {
         Ship ship = CollisionTarget(level, shot);
         ship.TakeDamage(shot.Damage, shot.ShieldPiercing, DamageType.laser, false);
         shot.Dead = true;
     }
 }
Exemple #7
0
 public static void UpdateExtraDamageCollideShot(Level level, Shot shot)
 {
     if (level.GameObjects.Any(item => item != shot && item.GetType().Name == "Shot" && item.Box.Intersects(shot.Box)))
     {
         Shot hitShot =  (Shot)level.GameObjects.First(item => item != shot && item.GetType().Name == "Shot" && item.Box.Intersects(shot.Box));
         shot.Damage += hitShot.Damage * 0.25f;
         shot.Colour = new Color(0, 255, 255);
         hitShot.Damage *= 0.75f;
         hitShot.Colour = hitShot.Colour * 0.75f;
     }
     HitBasic(level, shot);
 }
Exemple #8
0
 public static void UpdateRandom(Level level, Shot shot)
 {
     shot.Position += new Vector2(Globals.Randomizer.Next(-20, 21), 0);
     HitBasic(level, shot);
 }
Exemple #9
0
 public static void UpdateChanceToExplode(Level level, Shot shot)
 {
     if (Globals.Randomizer.Next(0, 101) < 1 && shot.timer < 0)
     {
         for (int i = 0; i < 6; i++)
         {
             level.ToAdd.Add(new Shot(shot.Position, (float)(Math.PI * 2 / 6f) * i, shot.Damage, HitBasic, shot.Targets, shot.ShieldPiercing, shot.Chance));
         }
         shot.Dead = true;
     }
     HitBasic(level, shot);
 }
Exemple #10
0
 public static void UpdateBoomerang(Level level, Shot shot)
 {
     if (Globals.Randomizer.Next(0, 101) < 3 && shot.timer < 0)
     {
         shot.changeSpeed = -shot.changeSpeed;
         shot.HitTarget = Shot.HitBasic;
         if (shot.Targets.Any(item => item == "Player"))
         {
             shot.Targets = new List<string>();
             shot.Targets.Add("Enemy");
             shot.Targets.Add("Boss");
         }
         else
         {
             shot.Targets = new List<string>();
             shot.Targets.Add("Player");
         }
     }
     HitBasic(level, shot);
 }
Exemple #11
0
 public static void HitEnemyShotDelay(Level level, Shot shot)
 {
     if (CollisionTarget(level, shot) != null)
     {
         Ship ship = CollisionTarget(level, shot);
         ship.TakeDamage(shot.Damage, shot.ShieldPiercing, DamageType.laser, false);
         if (Globals.Randomizer.Next(0, 101) < shot.Chance)
         {
             ship.Weapons[Globals.Randomizer.Next(0, ship.Weapons.Count)].Disabled = 120;
             level.CombatText(ship.GetType().Name + " Weapon Jammed!");
         }
         shot.Dead = true;
     }
 }
Exemple #12
0
 public static void HitCrit(Level level, Shot shot)
 {
     if (CollisionTarget(level, shot) != null)
     {
         Ship ship = CollisionTarget(level, shot);
         if (Globals.Randomizer.Next(0, 101) < shot.Chance)
         {
             ship.TakeDamage(shot.Damage * 1.5f, shot.ShieldPiercing, DamageType.laser, false);
             level.CombatText("CRIT!");
         }
         else
         {
             ship.TakeDamage(shot.Damage, shot.ShieldPiercing, DamageType.laser, false);
         }
         shot.Dead = true;
     }
 }
Exemple #13
0
 public static void UpdateRandom(Level level, Shot shot)
 {
     shot.Position += new Vector2(Globals.Randomizer.Next(-20, 21), 0);
     HitBasic(level, shot);
 }