public WeaponShopScreen(int playerIndex, Player player, World world) : base("Player " + (playerIndex + 1) + ": Weapon Shop") { this.player = player; this.world = world; guns = new BasicGun[5]; shopEntries = new MenuEntry[5]; // create menu entries for (int i = 0; i < shopEntries.Length; i++) shopEntries[i] = new MenuEntry(string.Empty); SetMenuEntryText(); MenuEntry back = new MenuEntry("Exit Shop"); // hook up event handlers back.Selected += OnCancel; for (int i = 0; i < shopEntries.Length; i++) { shopEntries[i].Selected += ShopMenuEntrySelected; } // add menu entries to screen for (int i = 0; i < shopEntries.Length; i++) MenuEntries.Add(shopEntries[i]); MenuEntries.Add(back); }
/// <summary> /// Constructor. /// </summary> public Player(Vector2 position, Vector2 speed, Vector2 direction, Texture2D sheetTexture, Point sheetSize, Point frameSize, int millisecondsPerFrame, int maxHealth, World world, float collisionRadius) : base(position, speed, direction, sheetTexture, sheetSize, frameSize, millisecondsPerFrame, maxHealth, world, collisionRadius) { GunsOwned = new List<BasicGun>(); GunEquipped = 0; Targets = new List<GeneralPed>(); }
public ShopArea(Vector2 position, Vector2 size, string name, Texture2D shopTexture, World world) { this.name = name; this.position = position; this.size = size; this.shopTexture = shopTexture; }
public PowerUp(Vector2 position, float collisionRadius, Texture2D powerUpTexture, World world) { this.position = position; this.collisionRadius = collisionRadius; this.powerUpTexture = powerUpTexture; this.world = world; }
public GeneralPed(Vector2 position, Vector2 speed, Vector2 direction, Texture2D sheetTexture, Point sheetSize, Point frameSize, int millisecondsPerFrame, int maxHealth, World world, float collisionRadius) : base(position, speed, direction, sheetTexture, sheetSize, frameSize, millisecondsPerFrame) { this.maxHealth = maxHealth; this.health = maxHealth; this.world = world; this.collisionRadius = collisionRadius; }
/// <summary> /// Constructor. /// </summary> public Cowboy(Vector2 position, Vector2 direction, Texture2D sheetTexture, World world) : base(position, Vector2.Zero, direction, sheetTexture, new Point(6, 5), new Point(80, 104), 180, 1000, world, 37) { GunRecoilControl = 0.005f; RegenIdleTime = 6000; PerRegenTime = 50; PerRegenHealth = 1; }
public Shotgun(IGunner owner, int damage, float range, int fireRate, float bulletSpeed, FireMode fireMode, float recoilPerShot, float maxRecoil, int clipSize, int reserveSize, int reloadTime, int subShells, float shellSpread, bool clipReload, World world, string weaponName) : base(owner, damage, range, fireRate, bulletSpeed, fireMode, recoilPerShot, maxRecoil, clipSize, reserveSize, reloadTime, world, weaponName, GunType.Shotgun) { this.subShells = subShells; this.shellSpread = shellSpread; this.clipReload = clipReload; singleReloadTime = reloadTime; }
/// <summary> /// Constructor. /// </summary> public EvilCowboy(Vector2 position, Texture2D sheetTexture, World world) : base(position, Vector2.Zero, Vector2.Zero, sheetTexture, new Point(6, 5), new Point(80, 104), 180, 100, world, 37) { GunRecoilControl = 0.004f; // bad cowboy could either carry an AK74u or R870MCS BasicGun cowboyGun; if (random.Next(0, 2) == 0) { cowboyGun = new AK74u(this, world); this.ChangeCurrentRow(2); } else { cowboyGun = new R870MCS(this, world); this.ChangeCurrentRow(1); } cowboyGun.FireRate = (int)(cowboyGun.FireRate * 0.7); this.GetGun(cowboyGun); }
public ShotgunsFromFile(IGunner owner, World world, string weaponName) : base(owner, 0, 0, 0, 0, FireMode.Single, 0, 0, 0, 0, 0, 0, 0, true, world, weaponName) { #if WINDOWS IniFile data = new IniFile(@"main\specs\gunspecs.txt"); this.damage = int.Parse(data.IniReadValue(weaponName, "damage")); this.range = float.Parse(data.IniReadValue(weaponName, "range")); this.fireRate = int.Parse(data.IniReadValue(weaponName, "fireRate")); this.bulletSpeed = float.Parse(data.IniReadValue(weaponName, "bulletSpeed")); this.fireMode = (FAZEngine.Weapons.FireMode)int.Parse(data.IniReadValue(weaponName, "fireMode")); this.recoilPerShot = float.Parse(data.IniReadValue(weaponName, "recoilPerShot")); this.maxRecoil = float.Parse(data.IniReadValue(weaponName, "maxRecoil")); this.clipSize = int.Parse(data.IniReadValue(weaponName, "clipSize")); this.reserveSize = int.Parse(data.IniReadValue(weaponName, "reserveSize")); this.reloadTime = int.Parse(data.IniReadValue(weaponName, "reloadTime")); this.subShells = int.Parse(data.IniReadValue(weaponName, "subShells")); this.shellSpread = float.Parse(data.IniReadValue(weaponName, "shellSpread")); this.clipReload = bool.Parse(data.IniReadValue(weaponName, "clipReload")); #else if (weaponName == "R870MCS") { this.damage = 83; this.range = 800; this.fireRate = 80; this.bulletSpeed = 50; this.fireMode = FAZEngine.Weapons.FireMode.Single; this.recoilPerShot = 0; this.maxRecoil = 10; this.clipSize = 8; this.reserveSize = 64; this.reloadTime = 400; this.subShells = 8; this.shellSpread = 0.26f; this.clipReload = false; } #endif clipAmmo = clipSize; reserveAmmo = reserveSize; singleReloadTime = reloadTime; }
public WeaponModScreen(int playerIndex, Player player, BasicGun gun, World world) : base("Player " + (playerIndex + 1) + ": Modding " + gun.GunType.ToString()) { this.player = player; this.gun = gun; this.world = world; // create menu entries lazerMenuEntry = new MenuEntry(string.Empty); extendedClipMenuEntry = new MenuEntry(string.Empty); fullAutoMenuEntry = new MenuEntry(string.Empty); fastReloadMenuEntry = new MenuEntry(string.Empty); moreAmmoMenuEntry = new MenuEntry(string.Empty); fmjMenuEntry = new MenuEntry(string.Empty); SetMenuEntryText(); MenuEntry back = new MenuEntry("Exit Shop"); // hook up event handlers lazerMenuEntry.Selected += LazerMenuEntrySelected; extendedClipMenuEntry.Selected += ExtendedClipMenuEntrySelected; fullAutoMenuEntry.Selected += FullAutoMenuEntrySelected; fastReloadMenuEntry.Selected += FastReloadMenuEntrySelected; moreAmmoMenuEntry.Selected += MoreAmmoMenuEntrySelected; fmjMenuEntry.Selected += FmjMenuEntrySelected; back.Selected += OnCancel; // add menu entries to screen MenuEntries.Add(lazerMenuEntry); MenuEntries.Add(extendedClipMenuEntry); MenuEntries.Add(fullAutoMenuEntry); MenuEntries.Add(fastReloadMenuEntry); MenuEntries.Add(moreAmmoMenuEntry); MenuEntries.Add(fmjMenuEntry); MenuEntries.Add(back); }
public RevivePowerUp(Vector2 position, World world) : base(position, 50, world.powerUpTextures[3], world) { }
/// <summary> /// Constructor. /// </summary> public Enemy(Vector2 position, Vector2 speed, Vector2 direction, Texture2D sheetTexture, Point sheetSize, Point frameSize, int millisecondsPerFrame, int maxHealth, World world, float collisionRadius) : base(position, speed, direction, sheetTexture, sheetSize, frameSize, millisecondsPerFrame, maxHealth, world, collisionRadius) { }
public Zombie(Vector2 position, float maxSpeed, Texture2D sheetTexture, World world) : base(position, Vector2.Zero, Vector2.Zero, sheetTexture, new Point(6, 1), new Point(80, 104), 200, 300, world, 37) { this.maxSpeed = maxSpeed; this.timeSinceLastAttack = this.millisecondsPerAttack; }
public R870MCS(IGunner owner, World world) : base(owner, world, "R870MCS") { // because it's pump action this.recoilPerShot = 3600 * owner.GunRecoilControl / fireRate; }
public MoneyPowerUp(Vector2 position, World world, int fixedAmount) : this(position, world) { this.fixedAmount = fixedAmount; }
public MoneyPowerUp(Vector2 position, World world) : base(position, 50, world.powerUpTextures[2], world) { }
public ShieldPowerUp(Vector2 position, World world) : base(position, 50, world.powerUpTextures[4], world) { }
public AK74u(IGunner owner, World world) : base(owner, world, "AK74u") { }
public Bobcat(Vector2 pos, float rotation, Texture2D carTexture, Texture2D wheelsTexture, World world) : base(pos, new Vector2(95, 204.5f), rotation, 80, 100, 0.2f, 0.025f, carTexture, wheelsTexture, new Vector2(16,76), 6000, world) { }
public M1911(IGunner owner, World world) : base(owner, world, "M1911") { }
public HealthPowerUp(Vector2 position, World world) : base(position, 50, world.powerUpTextures[0], world) { }
public M4A1(IGunner owner, World world) : base(owner, world, "M4A1") { }
public AmmoPowerUp(Vector2 position, World world) : base(position, 50, world.powerUpTextures[1], world) { }
public BasicGunsFromFile(IGunner owner, World world, string weaponName) : base(owner, 0, 0, 0, 0, FireMode.Single, 0, 0, 0, 0, 0, world, weaponName, GunType.Pistol) { #if WINDOWS IniFile data = new IniFile(@"main\specs\gunspecs.txt"); this.damage = int.Parse(data.IniReadValue(weaponName, "damage")); this.range = float.Parse(data.IniReadValue(weaponName, "range")); this.fireRate = int.Parse(data.IniReadValue(weaponName, "fireRate")); this.bulletSpeed = float.Parse(data.IniReadValue(weaponName, "bulletSpeed")); this.fireMode = (FAZEngine.Weapons.FireMode)int.Parse(data.IniReadValue(weaponName, "fireMode")); this.recoilPerShot = float.Parse(data.IniReadValue(weaponName, "recoilPerShot")); this.maxRecoil = float.Parse(data.IniReadValue(weaponName, "maxRecoil")); this.clipSize = int.Parse(data.IniReadValue(weaponName, "clipSize")); this.reserveSize = int.Parse(data.IniReadValue(weaponName, "reserveSize")); this.reloadTime = int.Parse(data.IniReadValue(weaponName, "reloadTime")); this.gunType = (FAZEngine.Weapons.GunType)int.Parse(data.IniReadValue(weaponName, "gunType")); #else if (weaponName == "M1911") { this.damage = 40; this.range = 850; this.fireRate = 500; this.bulletSpeed = 50; this.fireMode = FAZEngine.Weapons.FireMode.Single; this.recoilPerShot = 0.038f; this.maxRecoil = 0.25f; this.clipSize = 8; this.reserveSize = 120; this.reloadTime = 1600; this.gunType = FAZEngine.Weapons.GunType.Pistol; } else if (weaponName == "AK74u") { this.damage = 45; this.range = 1100; this.fireRate = 750; this.bulletSpeed = 50; this.fireMode = FAZEngine.Weapons.FireMode.Auto; this.recoilPerShot = 0.040f; this.maxRecoil = 0.12f; this.clipSize = 30; this.reserveSize = 240; this.reloadTime = 2500; this.gunType = FAZEngine.Weapons.GunType.SMG; } else if (weaponName == "M4A1") { this.damage = 55; this.range = 1300; this.fireRate = 700; this.bulletSpeed = 50; this.fireMode = FAZEngine.Weapons.FireMode.Auto; this.recoilPerShot = 0.035f; this.maxRecoil = 0.16f; this.clipSize = 30; this.reserveSize = 240; this.reloadTime = 3000; this.gunType = FAZEngine.Weapons.GunType.AssultRifle; } else if (weaponName == "M60") { this.damage = 63; this.range = 1300; this.fireRate = 535; this.bulletSpeed = 50; this.fireMode = FAZEngine.Weapons.FireMode.Auto; this.recoilPerShot = 0.055f; this.maxRecoil = 0.16f; this.clipSize = 100; this.reserveSize = 300; this.reloadTime = 9100; this.gunType = FAZEngine.Weapons.GunType.LMG; } #endif clipAmmo = clipSize; reserveAmmo = reserveSize; }
public M60(IGunner owner, World world) : base(owner, world, "M60") { }