Beispiel #1
0
 public static void FireTwoInV(Ship shooter, Weapon weapon, int tilesMatched, Level level, bool initialize)
 {
     if (!initialize)
     {
         level.ToAdd.Add(new Shot(shooter.Position, shooter.Direction + 0.2f, weapon.ShotDamage(tilesMatched, shooter), Shot.HitBasic, shooter.Targets, weapon.ShieldPiercing, weapon.WeaponChance(shooter)));
         level.ToAdd.Add(new Shot(shooter.Position, shooter.Direction - 0.2f, weapon.ShotDamage(tilesMatched, shooter), Shot.HitBasic, shooter.Targets, weapon.ShieldPiercing, weapon.WeaponChance(shooter)));
     }
 }
Beispiel #2
0
 public static void FireExtraDamageCollideShot(Ship shooter, Weapon weapon, int tilesMatched, Level level, bool initialize)
 {
     if (!initialize)
     {
         level.ToAdd.Add(new Shot(shooter.Position, shooter.Direction, weapon.ShotDamage(tilesMatched, shooter), Shot.UpdateExtraDamageCollideShot, shooter.Targets, weapon.ShieldPiercing, weapon.WeaponChance(shooter)));
     }
 }
Beispiel #3
0
 public static void FireDamageOverTime(Ship shooter, Weapon weapon, int tilesMatched, Level level, bool initialize)
 {
     if (!initialize)
     {
         level.ToAdd.Add(new Shot(shooter.Position, shooter.Direction, weapon.ShotDamage(tilesMatched, shooter), Shot.HitDamageOverTime, shooter.Targets, weapon.ShieldPiercing, weapon.WeaponChance(shooter)));
     }
     else
     {
         weapon.Damage -= 2;
     }
 }
Beispiel #4
0
 public static void FireThreeShots(Ship shooter, Weapon weapon, int tilesMatched, Level level, bool initialize)
 {
     if (!initialize)
     {
         level.ToAdd.Add(new Shot(shooter.Position, shooter.Direction, weapon.ShotDamage(tilesMatched, shooter) / 3, Shot.HitBasic, shooter.Targets, weapon.ShieldPiercing, weapon.WeaponChance(shooter)));
         for (int i = 0; i < 2; i++)
         {
             weapon.ShotsToShoot.Add(new Shot(shooter.Position, shooter.Direction, weapon.ShotDamage(tilesMatched, shooter) / 3, Shot.HitBasic, shooter.Targets, weapon.ShieldPiercing, weapon.WeaponChance(shooter)));
         }
     }
 }
Beispiel #5
0
 public static void FireMatchFourExtraShot(Ship shooter, Weapon weapon, int tilesMatched, Level level, bool initialize)
 {
     if (!initialize)
     {
         level.ToAdd.Add(new Shot(shooter.Position, shooter.Direction, weapon.ShotDamage(tilesMatched, shooter), Shot.HitBasic, shooter.Targets, weapon.ShieldPiercing, weapon.WeaponChance(shooter)));
         if (tilesMatched > 3)
         {
             weapon.ShotsToShoot.Add(new Shot(shooter.Position, shooter.Direction, weapon.ShotDamage(tilesMatched, shooter), Shot.HitBasic, shooter.Targets, weapon.ShieldPiercing, weapon.WeaponChance(shooter)));
         }
     }
 }
Beispiel #6
0
 public static void FireBoomerang(Ship shooter, Weapon weapon, int tilesMatched, Level level, bool initialize)
 {
     if (!initialize)
     {
         level.ToAdd.Add(new Shot(shooter.Position, shooter.Direction, weapon.ShotDamage(tilesMatched, shooter), Shot.UpdateBoomerang, shooter.Targets, weapon.ShieldPiercing, weapon.WeaponChance(shooter)));
     }
     else
     {
         weapon.Damage += Globals.Randomizer.Next(5, 10);
     }
 }
Beispiel #7
0
 public static void FireBonusDamageLowerHealth(Ship shooter, Weapon weapon, int tilesMatched, Level level, bool initialize)
 {
     if (!initialize)
     {
         level.ToAdd.Add(new Shot(shooter.Position, shooter.Direction, weapon.ShotDamage(tilesMatched, shooter) * (2 - shooter.Health.Value / shooter.Health.MaxValue), Shot.HitBasic, shooter.Targets, weapon.ShieldPiercing, weapon.WeaponChance(shooter)));
     }
     else
     {
         weapon.Damage -= 2;
     }
 }
Beispiel #8
0
 public static void FireRandom(Ship shooter, Weapon weapon, int tilesMatched, Level level, bool initialize)
 {
     if (!initialize)
     {
         level.ToAdd.Add(new Shot(shooter.Position, shooter.Direction, weapon.ShotDamage(tilesMatched, shooter), Shot.UpdateRandom, shooter.Targets, weapon.ShieldPiercing, weapon.WeaponChance(shooter)));
     }
     else
     {
         weapon.Damage = (int)(weapon.Damage * 1.5f);
     }
 }
Beispiel #9
0
 public static void FireIncreasingChanceOfTwo(Ship shooter, Weapon weapon, int tilesMatched, Level level, bool initialize)
 {
     if (!initialize)
     {
         if (Globals.Randomizer.Next(0, 101) < weapon.WeaponChance(shooter))
         {
             weapon.ShotsToShoot.Add(new Shot(shooter.Position, shooter.Direction, weapon.ShotDamage(tilesMatched, shooter), Shot.HitBasic, shooter.Targets, weapon.ShieldPiercing, weapon.WeaponChance(shooter)));
             weapon.Chance = 0;
         }
         level.ToAdd.Add(new Shot(shooter.Position, shooter.Direction, weapon.ShotDamage(tilesMatched, shooter), Shot.HitBasic, shooter.Targets, weapon.ShieldPiercing, weapon.WeaponChance(shooter)));
         weapon.Chance += 15;
     }
 }
Beispiel #10
0
 public static void FireChanceToBreak(Ship shooter, Weapon weapon, int tilesMatched, Level level, bool initialize)
 {
     if (!initialize)
     {
         if (Globals.Randomizer.Next(0, 101) < 100 - weapon.WeaponChance(shooter))
         {
             weapon.Disabled = 180;
             shooter.TakeDamage(weapon.Damage / 2, weapon.ShieldPiercing, DamageType.laser, false);
         }
         level.ToAdd.Add(new Shot(shooter.Position, shooter.Direction, weapon.ShotDamage(tilesMatched, shooter), Shot.HitBasic, shooter.Targets, weapon.ShieldPiercing, weapon.WeaponChance(shooter)));
     }
     else
     {
         weapon.Chance += Globals.Randomizer.Next(30, 50);
         weapon.Damage += Globals.Randomizer.Next(5, 7);
     }
 }
Beispiel #11
0
 public static void FireChanceToMiss(Ship shooter, Weapon weapon, int tilesMatched, Level level, bool initialize)
 {
     if (!initialize)
     {
         float miss = 0;
         if (Globals.Randomizer.Next(0, 101) > weapon.WeaponChance(shooter))
         {
             miss = MathHelper.Lerp(-0.5f + shooter.ShipHull.WeaponAccuracy, 0.5f - shooter.ShipHull.WeaponAccuracy, (float)Globals.Randomizer.NextDouble());
         }
         level.ToAdd.Add(new Shot(shooter.Position, shooter.Direction + miss, weapon.ShotDamage(tilesMatched, shooter), Shot.HitBasic, shooter.Targets, weapon.ShieldPiercing, weapon.WeaponChance(shooter)));
     }
     else
     {
         weapon.Damage += 7;
         weapon.Chance  = 60;
     }
 }
Beispiel #12
0
 public static void FireEveryOther(Ship shooter, Weapon weapon, int tilesMatched, Level level, bool initialize)
 {
     if (!initialize)
     {
         if (weapon.WeaponChance(shooter) == 100)
         {
             weapon.Chance = 0;
             level.ToAdd.Add(new Shot(shooter.Position, shooter.Direction, weapon.ShotDamage(tilesMatched, shooter), Shot.HitBasic, shooter.Targets, weapon.ShieldPiercing, weapon.Chance));
         }
         else
         {
             shooter.KnockBack = 0;
             weapon.Chance     = 100;
         }
     }
     else
     {
         weapon.Chance = 0;
         weapon.Damage = weapon.Damage * 2 + weapon.Damage / 4;
     }
 }
Beispiel #13
0
 public static void FireMovingShot(Ship shooter, Weapon weapon, int tilesMatched, Level level, bool initialize)
 {
     if (!initialize)
     {
         level.ToAdd.Add(new Shot(shooter.Position, shooter.Direction, weapon.ShotDamage(tilesMatched, shooter), Shot.HitBasic, shooter.Targets, weapon.ShieldPiercing, weapon.WeaponChance(shooter)));
         int random = Globals.Randomizer.Next(0, 101);
         if (random < weapon.WeaponChance(shooter) / 2)
         {
             if ((int)shooter.ShipLocation < 2)
             {
                 shooter.ShipLocation++;
             }
         }
         else if (random < weapon.WeaponChance(shooter))
         {
             if ((int)shooter.ShipLocation > 0)
             {
                 shooter.ShipLocation--;
             }
         }
     }
 }
Beispiel #14
0
 public static void FireThreeShots(Ship shooter, Weapon weapon, int tilesMatched, Level level, bool initialize)
 {
     if (!initialize)
     {
         level.ToAdd.Add(new Shot(shooter.Position, shooter.Direction, weapon.ShotDamage(tilesMatched, shooter) / 3, Shot.HitBasic, shooter.Targets, weapon.ShieldPiercing, weapon.WeaponChance(shooter)));
         for (int i = 0; i < 2; i++)
         {
             weapon.ShotsToShoot.Add(new Shot(shooter.Position, shooter.Direction, weapon.ShotDamage(tilesMatched, shooter) / 3, Shot.HitBasic, shooter.Targets, weapon.ShieldPiercing, weapon.WeaponChance(shooter)));
         }
     }
 }
Beispiel #15
0
 public static void FireBoomerang(Ship shooter, Weapon weapon, int tilesMatched, Level level, bool initialize)
 {
     if (!initialize)
     {
         level.ToAdd.Add(new Shot(shooter.Position, shooter.Direction, weapon.ShotDamage(tilesMatched, shooter), Shot.UpdateBoomerang, shooter.Targets, weapon.ShieldPiercing, weapon.WeaponChance(shooter)));
     }
     else
     {
         weapon.Damage += Globals.Randomizer.Next(5, 10);
     }
 }
Beispiel #16
0
 public static void FireChanceToBreak(Ship shooter, Weapon weapon, int tilesMatched, Level level, bool initialize)
 {
     if (!initialize)
     {
         if (Globals.Randomizer.Next(0, 101) < 100 - weapon.WeaponChance(shooter))
         {
             weapon.Disabled = 180;
             shooter.TakeDamage(weapon.Damage / 2, weapon.ShieldPiercing, DamageType.laser, false);
         }
         level.ToAdd.Add(new Shot(shooter.Position, shooter.Direction, weapon.ShotDamage(tilesMatched, shooter), Shot.HitBasic, shooter.Targets, weapon.ShieldPiercing, weapon.WeaponChance(shooter)));
     }
     else
     {
         weapon.Chance += Globals.Randomizer.Next(30, 50);
         weapon.Damage += Globals.Randomizer.Next(5, 7);
     }
 }
Beispiel #17
0
 public static void FireChanceToMiss(Ship shooter, Weapon weapon, int tilesMatched, Level level, bool initialize)
 {
     if (!initialize)
     {
         float miss = 0;
         if (Globals.Randomizer.Next(0, 101) > weapon.WeaponChance(shooter))
         {
             miss = MathHelper.Lerp(-0.5f + shooter.ShipHull.WeaponAccuracy, 0.5f - shooter.ShipHull.WeaponAccuracy, (float)Globals.Randomizer.NextDouble());
         }
         level.ToAdd.Add(new Shot(shooter.Position, shooter.Direction + miss, weapon.ShotDamage(tilesMatched, shooter), Shot.HitBasic, shooter.Targets, weapon.ShieldPiercing, weapon.WeaponChance(shooter)));
     }
     else
     {
         weapon.Damage += 7;
         weapon.Chance = 60;
     }
 }
Beispiel #18
0
 public static void FireDamageOverTime(Ship shooter, Weapon weapon, int tilesMatched, Level level, bool initialize)
 {
     if (!initialize)
     {
         level.ToAdd.Add(new Shot(shooter.Position, shooter.Direction, weapon.ShotDamage(tilesMatched, shooter), Shot.HitDamageOverTime, shooter.Targets, weapon.ShieldPiercing, weapon.WeaponChance(shooter)));
     }
     else
     {
         weapon.Damage -= 2;
     }
 }
Beispiel #19
0
 public static void FireEveryOther(Ship shooter, Weapon weapon, int tilesMatched, Level level, bool initialize)
 {
     if (!initialize)
     {
         if (weapon.WeaponChance(shooter) == 100)
         {
             weapon.Chance = 0;
             level.ToAdd.Add(new Shot(shooter.Position, shooter.Direction, weapon.ShotDamage(tilesMatched, shooter), Shot.HitBasic, shooter.Targets, weapon.ShieldPiercing, weapon.Chance));
         }
         else
         {
             shooter.KnockBack = 0;
             weapon.Chance = 100;
         }
     }
     else
     {
         weapon.Chance = 0;
         weapon.Damage = weapon.Damage * 2 + weapon.Damage / 4;
     }
 }
Beispiel #20
0
 public static void FireExtraDamageCollideShot(Ship shooter, Weapon weapon, int tilesMatched, Level level, bool initialize)
 {
     if (!initialize)
     {
         level.ToAdd.Add(new Shot(shooter.Position, shooter.Direction, weapon.ShotDamage(tilesMatched, shooter), Shot.UpdateExtraDamageCollideShot, shooter.Targets, weapon.ShieldPiercing, weapon.WeaponChance(shooter)));
     }
 }
Beispiel #21
0
 public static void FireIncreasingChanceOfTwo(Ship shooter, Weapon weapon, int tilesMatched, Level level, bool initialize)
 {
     if (!initialize)
     {
         if (Globals.Randomizer.Next(0, 101) < weapon.WeaponChance(shooter))
         {
             weapon.ShotsToShoot.Add(new Shot(shooter.Position, shooter.Direction, weapon.ShotDamage(tilesMatched, shooter), Shot.HitBasic, shooter.Targets, weapon.ShieldPiercing, weapon.WeaponChance(shooter)));
             weapon.Chance = 0;
         }
         level.ToAdd.Add(new Shot(shooter.Position, shooter.Direction, weapon.ShotDamage(tilesMatched, shooter), Shot.HitBasic, shooter.Targets, weapon.ShieldPiercing, weapon.WeaponChance(shooter)));
         weapon.Chance += 15;
     }
 }
Beispiel #22
0
 public static void FireBonusDamageLowerHealth(Ship shooter, Weapon weapon, int tilesMatched, Level level, bool initialize)
 {
     if (!initialize)
     {
         level.ToAdd.Add(new Shot(shooter.Position, shooter.Direction, weapon.ShotDamage(tilesMatched, shooter) * (2 - shooter.Health.Value / shooter.Health.MaxValue), Shot.HitBasic, shooter.Targets, weapon.ShieldPiercing, weapon.WeaponChance(shooter)));
     }
     else
     {
         weapon.Damage -= 2;
     }
 }
Beispiel #23
0
 public static void FireMatchFourExtraShot(Ship shooter, Weapon weapon, int tilesMatched, Level level, bool initialize)
 {
     if (!initialize)
     {
         level.ToAdd.Add(new Shot(shooter.Position, shooter.Direction, weapon.ShotDamage(tilesMatched, shooter), Shot.HitBasic, shooter.Targets, weapon.ShieldPiercing, weapon.WeaponChance(shooter)));
         if (tilesMatched > 3)
         {
             weapon.ShotsToShoot.Add(new Shot(shooter.Position, shooter.Direction, weapon.ShotDamage(tilesMatched, shooter), Shot.HitBasic, shooter.Targets, weapon.ShieldPiercing, weapon.WeaponChance(shooter)));
         }
     }
 }
Beispiel #24
0
 public static void FireScattered(Ship shooter, Weapon weapon, int tilesMatched, Level level, bool initialize)
 {
     if (!initialize)
     {
         for (int i = 0; i < Globals.Randomizer.Next(3, 6); i++)
         {
             weapon.ShotsToShoot.Add(new Shot(shooter.Position, shooter.Direction + MathHelper.Lerp(-0.5f + shooter.ShipHull.WeaponAccuracy, 0.5f - shooter.ShipHull.WeaponAccuracy, (float)Globals.Randomizer.NextDouble()), weapon.ShotDamage(tilesMatched, shooter), Shot.HitBasic, shooter.Targets, weapon.ShieldPiercing, weapon.WeaponChance(shooter)));
         }
     }
     else
     {
         weapon.Damage /= 3;
     }
 }
Beispiel #25
0
 public static void FireRandom(Ship shooter, Weapon weapon, int tilesMatched, Level level, bool initialize)
 {
     if (!initialize)
     {
         level.ToAdd.Add(new Shot(shooter.Position, shooter.Direction, weapon.ShotDamage(tilesMatched, shooter), Shot.UpdateRandom, shooter.Targets, weapon.ShieldPiercing, weapon.WeaponChance(shooter)));
     }
     else
     {
         weapon.Damage = (int)(weapon.Damage * 1.5f);
     }
 }
Beispiel #26
0
 public static void FireMovingShot(Ship shooter, Weapon weapon, int tilesMatched, Level level, bool initialize)
 {
     if (!initialize)
     {
         level.ToAdd.Add(new Shot(shooter.Position, shooter.Direction, weapon.ShotDamage(tilesMatched, shooter), Shot.HitBasic, shooter.Targets, weapon.ShieldPiercing, weapon.WeaponChance(shooter)));
         int random = Globals.Randomizer.Next(0, 101);
         if (random < weapon.WeaponChance(shooter) / 2)
         {
             if ((int)shooter.ShipLocation < 2)
             {
                 shooter.ShipLocation++;
             }
         }
         else if (random < weapon.WeaponChance(shooter))
         {
             if ((int)shooter.ShipLocation > 0)
             {
                 shooter.ShipLocation--;
             }
         }
     }
 }
Beispiel #27
0
 public static void FireScattered(Ship shooter, Weapon weapon, int tilesMatched, Level level, bool initialize)
 {
     if (!initialize)
     {
         for (int i = 0; i < Globals.Randomizer.Next(3, 6); i++)
         {
             weapon.ShotsToShoot.Add(new Shot(shooter.Position, shooter.Direction + MathHelper.Lerp(-0.5f + shooter.ShipHull.WeaponAccuracy, 0.5f - shooter.ShipHull.WeaponAccuracy, (float)Globals.Randomizer.NextDouble()), weapon.ShotDamage(tilesMatched, shooter), Shot.HitBasic, shooter.Targets, weapon.ShieldPiercing, weapon.WeaponChance(shooter)));
         }
     }
     else
     {
         weapon.Damage /= 3;
     }
 }
Beispiel #28
0
 public static void FireTwoInV(Ship shooter, Weapon weapon, int tilesMatched, Level level, bool initialize)
 {
     if (!initialize)
     {
         level.ToAdd.Add(new Shot(shooter.Position, shooter.Direction + 0.2f, weapon.ShotDamage(tilesMatched, shooter), Shot.HitBasic, shooter.Targets, weapon.ShieldPiercing, weapon.WeaponChance(shooter)));
         level.ToAdd.Add(new Shot(shooter.Position, shooter.Direction - 0.2f, weapon.ShotDamage(tilesMatched, shooter), Shot.HitBasic, shooter.Targets, weapon.ShieldPiercing, weapon.WeaponChance(shooter)));
     }
 }
Beispiel #29
0
 public static void FireAiming(Ship shooter, Weapon weapon, int tilesMatched, Level level, bool initialize)
 {
     if (!initialize)
     {
         if (level.GameObjects.Any(item => shooter.Targets.Any(target => target == item.GetType().Name)))
         {
             level.ToAdd.Add(new Shot(shooter.Position, (float)(Math.Atan2((level.GameObjects.First(item => shooter.Targets.Any(target => target == item.GetType().Name)).Position - shooter.Position).Y, (level.GameObjects.First(item => shooter.Targets.Any(target => target == item.GetType().Name)).Position - shooter.Position).X)), weapon.ShotDamage(tilesMatched, shooter), Shot.HitBasic, shooter.Targets, weapon.ShieldPiercing, weapon.WeaponChance(shooter)));
         }
         else
         {
             FireStandard(shooter, weapon, tilesMatched, level, false);
         }
     }
     else
     {
         weapon.Damage -= 6;
     }
 }
Beispiel #30
0
 public static void FireAiming(Ship shooter, Weapon weapon, int tilesMatched, Level level, bool initialize)
 {
     if (!initialize)
     {
         if (level.GameObjects.Any(item => shooter.Targets.Any(target => target == item.GetType().Name)))
         {
             level.ToAdd.Add(new Shot(shooter.Position, (float)(Math.Atan2((level.GameObjects.First(item => shooter.Targets.Any(target => target == item.GetType().Name)).Position - shooter.Position).Y, (level.GameObjects.First(item => shooter.Targets.Any(target => target == item.GetType().Name)).Position - shooter.Position).X)), weapon.ShotDamage(tilesMatched, shooter), Shot.HitBasic, shooter.Targets, weapon.ShieldPiercing, weapon.WeaponChance(shooter)));
         }
         else
         {
             FireStandard(shooter, weapon, tilesMatched, level, false);
         }
     }
     else
     {
         weapon.Damage -= 6;
     }
 }