コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: Player.cs プロジェクト: rossmas/zomination
 /// <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>();
 }
コード例 #3
0
ファイル: ShopArea.cs プロジェクト: rossmas/zomination
 public ShopArea(Vector2 position, Vector2 size, string name, Texture2D shopTexture, World world)
 {
     this.name = name;
     this.position = position;
     this.size = size;
     this.shopTexture = shopTexture;
 }
コード例 #4
0
ファイル: PowerUp.cs プロジェクト: rossmas/zomination
 public PowerUp(Vector2 position, float collisionRadius, Texture2D powerUpTexture, World world)
 {
     this.position = position;
     this.collisionRadius = collisionRadius;
     this.powerUpTexture = powerUpTexture;
     this.world = world;
 }
コード例 #5
0
ファイル: GeneralPed.cs プロジェクト: rossmas/zomination
 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;
 }
コード例 #6
0
ファイル: Cowboy.cs プロジェクト: rossmas/zomination
        /// <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;
        }
コード例 #7
0
ファイル: Shotgun.cs プロジェクト: rossmas/zomination
        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;
        }
コード例 #8
0
ファイル: EvilCowboy.cs プロジェクト: rossmas/zomination
 /// <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);
 }
コード例 #9
0
 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;
 }
コード例 #10
0
ファイル: WeaponModScreen.cs プロジェクト: rossmas/zomination
        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);
        }
コード例 #11
0
ファイル: RevivePowerUp.cs プロジェクト: rossmas/zomination
 public RevivePowerUp(Vector2 position, World world)
     : base(position, 50, world.powerUpTextures[3], world)
 {
 }
コード例 #12
0
ファイル: Enemy.cs プロジェクト: rossmas/zomination
 /// <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)
 {
 }
コード例 #13
0
ファイル: Zombie.cs プロジェクト: rossmas/zomination
 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;
 }
コード例 #14
0
ファイル: R870MCS.cs プロジェクト: rossmas/zomination
 public R870MCS(IGunner owner, World world)
     : base(owner, world, "R870MCS")
 {
     // because it's pump action
     this.recoilPerShot = 3600 * owner.GunRecoilControl / fireRate;
 }
コード例 #15
0
ファイル: MoneyPowerUp.cs プロジェクト: rossmas/zomination
 public MoneyPowerUp(Vector2 position, World world, int fixedAmount)
     : this(position, world)
 {
     this.fixedAmount = fixedAmount;
 }
コード例 #16
0
ファイル: MoneyPowerUp.cs プロジェクト: rossmas/zomination
 public MoneyPowerUp(Vector2 position, World world)
     : base(position, 50, world.powerUpTextures[2], world)
 {
 }
コード例 #17
0
ファイル: ShieldPowerUp.cs プロジェクト: rossmas/zomination
 public ShieldPowerUp(Vector2 position, World world)
     : base(position, 50, world.powerUpTextures[4], world)
 {
 }
コード例 #18
0
ファイル: AK74u.cs プロジェクト: rossmas/zomination
 public AK74u(IGunner owner, World world)
     : base(owner, world, "AK74u")
 {
 }
コード例 #19
0
ファイル: Bobcat.cs プロジェクト: rossmas/zomination
 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)
 {
 }
コード例 #20
0
ファイル: M1911.cs プロジェクト: rossmas/zomination
 public M1911(IGunner owner, World world)
     : base(owner, world, "M1911")
 {
 }
コード例 #21
0
ファイル: HealthPowerUp.cs プロジェクト: rossmas/zomination
 public HealthPowerUp(Vector2 position, World world)
     : base(position, 50, world.powerUpTextures[0], world)
 {
 }
コード例 #22
0
ファイル: M4A1.cs プロジェクト: rossmas/zomination
 public M4A1(IGunner owner, World world)
     : base(owner, world, "M4A1")
 {
 }
コード例 #23
0
ファイル: AmmoPowerUp.cs プロジェクト: rossmas/zomination
 public AmmoPowerUp(Vector2 position, World world)
     : base(position, 50, world.powerUpTextures[1], world)
 {
 }
コード例 #24
0
        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;
        }
コード例 #25
0
ファイル: M60.cs プロジェクト: rossmas/zomination
 public M60(IGunner owner, World world)
     : base(owner, world, "M60")
 {
 }