예제 #1
0
        public DubstepGun(float xval, float yval)
            : base(xval, yval)
        {
            PlayBinding = new StateBinding("Playing");

            _bio        = "Plays generic dubstep loop and destroys everything";
            _editorName = "Dubstep Gun";

            ammo      = LoopTimings.Length + Rando.Int(-5, 5);
            _ammoType = new ATGrenade();
            _type     = "gun";

            sprite = new SpriteMap(DuckUtils.GetAsset("weapons/dubstep_gun.png"), 16, 16);
            sprite.AddAnimation("anim", Maths.IncFrameTimer() * 4f, true, 0, 1, 2, 3);
            sprite.SetAnimation("anim");
            graphic = sprite;
            center  = new Vec2(8f, 10f);

            sound = SFX.Get(DuckUtils.GetAsset("sounds/dubstep_sample.wav"), 1f, 0f, 0f, false);

            collisionOffset = new Vec2(-8f, -6f);
            collisionSize   = new Vec2(16f, 11f);
            _barrelOffsetTL = new Vec2(16f, 6f);
            _fireSound      = "pistolFire";
            _kickForce      = 3f;
            _holdOffset     = new Vec2(-1f, 0f);
            loseAccuracy    = 0.1f;
            maxAccuracyLost = 1f;
            physicsMaterial = PhysicsMaterial.Metal;
        }
예제 #2
0
        public FrogLauncher(float xval, float yval)
            : base(xval, yval)
        {
            AimAngleBinding = new StateBinding("aimAngle");
            StateBinding    = new StateBinding("stateIndex");

            _editorName = "Frog Launcher";
            _bio        = "This boy can fit " + MaxAmmo + " frogs innit!";

            ammo       = MaxAmmo;
            _type      = "gun";
            graphic    = baseSprite = new SpriteMap(DuckUtils.GetAsset("weapons/frog_launcher_base.png"), 24, 12);
            ammoSprite = new SpriteMap(DuckUtils.GetAsset("weapons/frog_launcher_ammo.png"), 26, 12);

            for (int i = 1; i <= 4; i++)
            {
                int rowStartIdx = (5 - i) * 4;
                ammoSprite.AddAnimation("idle" + i, 0.4f, false, rowStartIdx + 0);
                ammoSprite.AddAnimation("load" + i, 0.4f, false, rowStartIdx + 1, rowStartIdx + 2, rowStartIdx + 3);
            }

            ammoSprite.AddAnimation("empty", 0.4f, false, 21);
            ammoSprite.AddAnimation("idleOver", 0.4f, false, 0);
            ammoSprite.AddAnimation("loadOver", 0.4f, false, 1, 2, 3, 20);
            ammoSprite.SetAnimation("empty");

            center          = new Vec2(6f, 7f);
            collisionOffset = new Vec2(-6f, -4f);
            collisionSize   = new Vec2(16f, 8f);
            _barrelOffsetTL = new Vec2(25f, 4f);
            _laserOffsetTL  = new Vec2(22f, 4f);
            _fireSound      = "pistol";
            _kickForce      = 3f;
            _holdOffset     = new Vec2(-3f, 0f);
            _ammoType       = new ATGrenade();

            UpdateSprites();
        }
예제 #3
0
        public VoteGun(float xval, float yval)
            : base(xval, yval)
        {
            PlayBinding = new StateBinding("Playing");

            _bio        = "Golosovanie!";
            _editorName = "Vote Gun";

            ammo      = LoopTimingsAmount;
            _ammoType = new ATGrenade();
            _type     = "gun";

            sprite = new SpriteMap(DuckUtils.GetAsset("weapons/dubstep_gun.png"), 16, 16);
            sprite.AddAnimation("anim", Maths.IncFrameTimer() * 4f, true, 0, 1, 2, 3);
            sprite.SetAnimation("anim");
            graphic = sprite;
            center  = new Vec2(8f, 10f);

            sound = SFX.Get(DuckUtils.GetAsset("sounds/vote_loop.wav"), 1f, 0f, 0f, false);

            collisionOffset = new Vec2(-8f, -6f);
            collisionSize   = new Vec2(16f, 11f);
            _barrelOffsetTL = new Vec2(16f, 6f);
            _kickForce      = 3f;
            _holdOffset     = new Vec2(-1f, 0f);
            loseAccuracy    = 0.1f;
            maxAccuracyLost = 2f;
            physicsMaterial = PhysicsMaterial.Metal;

            _ammoType       = new ATShotgun();
            _ammoType.range = 100f;
            _type           = "gun";

            _kickForce         = 10f;
            _numBulletsPerFire = 7;
        }