示例#1
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;
     }
 }
示例#2
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--;
             }
         }
     }
 }
示例#3
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);
     }
 }
示例#4
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;
     }
 }
示例#5
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;
     }
 }
示例#6
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;
     }
 }
示例#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;
     }
 }
示例#8
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);
     }
 }
示例#9
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;
     }
 }
示例#10
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--;
             }
         }
     }
 }
示例#11
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)));
     }
 }
示例#12
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;
     }
 }
示例#13
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)));
         }
     }
 }
示例#14
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)));
     }
 }
示例#15
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;
     }
 }
示例#16
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;
     }
 }
示例#17
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)));
         }
     }
 }
示例#18
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);
     }
 }
示例#19
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)));
         }
     }
 }
示例#20
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;
     }
 }
示例#21
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);
     }
 }
示例#22
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);
     }
 }
示例#23
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)));
     }
 }
示例#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;
     }
 }
示例#25
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)));
         }
     }
 }
示例#26
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)));
     }
 }
示例#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;
     }
 }
示例#28
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;
     }
 }
示例#29
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);
     }
 }
示例#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;
     }
 }