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; } }
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--; } } } }
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); } }
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; } }
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; } }
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; } }
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; } }
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); } }
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))); } }
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))); } } }
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))); } }
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))); } } }
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); } }
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; } }
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; } }