Beispiel #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;
        }
Beispiel #2
0
 public PermafrostExplosion(float xpos, float ypos, bool doWait = true) : base(xpos, ypos)
 {
     _sprite = this.ReadyToRunWithFrames(tex_Effect_PermafrostExplosion, 15, 15);
     _sprite.AddAnimation("loop", 0.7f, false, new int[]
     {
         0,
         1,
         2,
         3,
         4,
         5,
         6,
         7
     });
     _sprite.SetAnimation("loop");
     graphic = _sprite;
     xscale  = 2f;
     yscale  = xscale;
     center  = new Vec2(7.5f, 7.5f);
     depth   = 1;
     if (!doWait)
     {
         _wait = 0f;
     }
 }
        public ChallengeConfetti(float xpos, float ypos)
            : base(xpos, ypos)
        {
            SpriteMap spriteMap = new SpriteMap("arcade/confetti", 8, 8);

            spriteMap.AddAnimation("idle", 0.1f, true, 0, 1);
            spriteMap.SetAnimation("idle");
            this.graphic    = (Sprite)spriteMap;
            this._fallSpeed = Rando.Float(0.5f, 1.2f);
            this.layer      = Layer.HUD;
            int num = Rando.ChooseInt(0, 1, 2, 3);

            if (num == 0)
            {
                spriteMap.color = Color.Violet;
            }
            if (num == 1)
            {
                spriteMap.color = Color.SkyBlue;
            }
            if (num == 2)
            {
                spriteMap.color = Color.Wheat;
            }
            if (num == 4)
            {
                spriteMap.color = Color.GreenYellow;
            }
            this.depth = new Depth(1f);
        }
        public override void Initialize()
        {
            base.Initialize();
            _sprite.SetAnimation("animation");

            _visibleInGame = true;
            visible        = true;
        }
Beispiel #5
0
 private void UpdateSprites()
 {
     if (state == State.Empty)
     {
         baseSprite.frame = 0;
         ammoSprite.SetAnimation("empty");
     }
     else
     {
         string id = state == State.Idle ? "idle" : "load";
         if (ammo <= LeftOverThreshold)
         {
             baseSprite.frame = 0;
             ammoSprite.SetAnimation(id + ammo);
         }
         else
         {
             float fill = (ammo - LeftOverThreshold) / (float)(MaxAmmo - LeftOverThreshold);
             baseSprite.frame = Maths.Clamp((int)Math.Floor(1 + 4 * fill), 0, 5);
             ammoSprite.SetAnimation(id + "Over");
         }
     }
 }
 public AT_BigFB()
 {
     accuracy       = 0.8f;
     range          = 300f;
     penetration    = 1f;
     rangeVariation = 10f;
     combustable    = true;
     bulletSpeed    = 0.5f;
     //sprite.CenterOrigin();
     bulletType      = typeof(Bullet_BigFB);
     sprite          = _spriteMap;
     bulletThickness = 4f;
     bulletLength    = 5f;
     bulletColor     = Color.Orange;
     _spriteMap.AddAnimation("loop", 0.4f, true, 0, 1, 2);
     _spriteMap.SetAnimation("loop");
 }
 public override void Initialize()
 {
     base.Initialize();
     if (ammo >= 3)
     {
         sprite.SetAnimation("3");
     }
     else
     {
         sprite.SetAnimation(ammo.ToString());
     }
 }
Beispiel #8
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();
        }
Beispiel #9
0
 public NovaExp(float xpos, float ypos, bool doWait = true) : base(xpos, ypos)
 {
     _sprite = this.ReadyToRunWithFrames(tex_Effect_CrystalExplosionPurple, 36, 36);
     _sprite.AddAnimation("loop", 1f, false, new int[]
     {
         0,
         1,
         2,
         3,
         4,
         5,
         6,
         7,
         8,
         9,
         10,
         11,
         12,
         13,
         14,
         15,
         16,
         17,
         18,
     });
     _sprite.SetAnimation("loop");
     graphic       = _sprite;
     _sprite.speed = 0.6f;
     xscale        = 0.5f;
     yscale        = xscale;
     center        = new Vec2(18f, 18f);
     depth         = 1f;
     if (!doWait)
     {
         _wait = 0f;
     }
 }
Beispiel #10
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;
        }
Beispiel #11
0
 public override void Initialize()
 {
     this.gr = TunnelGrenade.grenade;
     TunnelGrenade.grenade++;
     _sprite.SetAnimation("animation");
 }