Exemplo n.º 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;
        }
Exemplo n.º 2
0
        public ImStuffHat(float x, float y) : base(x, y)
        {
            PlayingBinding = new StateBinding("Playing");

            _sprite = new SpriteMap(DuckUtils.GetAsset("hats/imstuff.png"), 129, 153);
            sound   = SFX.Get(DuckUtils.GetAsset("sounds/imstuff.wav"), 1f, 0f, 0f, false);
        }
Exemplo n.º 3
0
        public TimeFreezeParticle(float x, float y) : base(x, y)
        {
            RadiusBinding = new StateBinding("radius");

            this.depth = -1f;
            //this.material = new MaterialGlitch(this);
        }
Exemplo n.º 4
0
        public BrekotkinHat(float x, float y) : base(x, y)
        {
            PlayingBinding = new StateBinding("Playing");

            graphic     = _pickupSprite = _sprite = new SpriteMap(DuckUtils.GetAsset("hats/brekotkin.png"), 32, 32);
            _editorName = "Brekotkin Hat";

            sound = SFX.Get(DuckUtils.GetAsset("sounds/disco_ebalo.wav"), 1f, 0f, 0f, true);
        }
Exemplo n.º 5
0
        public SatanicBrekotkinHat(float x, float y) : base(x, y)
        {
            PlayingBinding = new StateBinding("Playing");

            graphic     = _pickupSprite = _sprite = new SpriteMap(DuckUtils.GetAsset("hats/brekotkin_satanic.png"), 32, 32);
            _editorName = "Satanic Brekotkin Hat";

            sound = SFX.Get(DuckUtils.GetAsset("sounds/umri.wav"), 1f, 0f, 0f, false);
        }
Exemplo n.º 6
0
        public GrenadeBase(float xval, float yval)
            : base(xval, yval)
        {
            TimerBinding = new StateBinding("Timer");
            PinBinding   = new StateBinding("HasPin");

            ammo                  = 1;
            _type                 = "gun";
            _ammoType             = new ATShrapnel();
            _ammoType.penetration = 0.2f;
        }
Exemplo n.º 7
0
        public FututreSphere(float xval, float yval, Thing owner, Vec2 velocity)
            : base(xval, yval)
        {
            PositionBinding = new CompressedVec2Binding("position", 2147483647, isvelocity: false, doLerp: true);
            VelocityBinding = new CompressedVec2Binding("travel", 1);

            sprite = new Sprite(DuckUtils.GetAsset("part/fututre_beam.png"));
            radius = 10f;
            depth  = 0.5f;

            travel     = velocity;
            this.owner = owner;
        }
Exemplo n.º 8
0
 public GrenadeBase(float xval, float yval)
     : base(xval, yval)
 {
     TimerBinding  = new StateBinding("Timer", -1, rot: false);
     HasPinBinding = new StateBinding("HasPin", -1, rot: false);
     HasPin        = true;
     Timer         = 1.2f;
     _editorName   = "Grenade base";
     _bio          = "You should not see this item ingame.";
     _type         = "gun";
     base.bouncy   = 0.4f;       // i f**k around with this value (high value makes it not bounce.
     friction      = 0.05f;
     ammo          = 1;
 }
Exemplo n.º 9
0
        /// Performs the state transition
        ///
        /// @param nextStateID
        ///     The ID of the next state
        ///
        protected virtual void ChangeState(int nextStateID)
        {
            StateBinding nextState = m_stateBindings.TryGetValue(nextStateID);

            Debug.Assert(nextState != null, string.Format("Cannot find the desired state with id {0}", nextStateID));

            if (m_currentState != null)
            {
                m_currentState.m_exitStateFunc.SafeInvoke();
            }

            m_currentState = nextState;
            OnStateChanged.SafeInvoke();
            m_currentState.m_enterStateFunc.SafeInvoke();
        }
Exemplo n.º 10
0
        public static void AddReplace(Thing thing)
        {
            if (Level.core.currentLevel == null)
            {
                return;
            }
            Level.core.currentLevel.AddThing(thing);
            if (thing.GetType() == typeof(Duck))
            {
                StateBinding _profileIndexBinding = new StateBinding("netProfileIndex", 3, false);

                FieldInfo _profilesField = typeof(Duck).GetField("_profileIndexBinding", BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public);
                _profilesField.SetValue(thing, _profileIndexBinding);
            }
        }
Exemplo n.º 11
0
        public FututreGan(float xval, float yval)
            : base(xval, yval)
        {
            CooldownBinding = new StateBinding("cooldown");

            _editorName = "Fututre Gan";
            _bio        = "For Fututre Use";

            ammo            = MaxAmmo;
            _type           = "gun";
            graphic         = sprite = new SpriteMap(DuckUtils.GetAsset("weapons/fututre_gan.png"), 16, 16);
            center          = new Vec2(7f, 9f);
            collisionOffset = new Vec2(-7f, -4f);
            collisionSize   = new Vec2(13f, 9f);
            _barrelOffsetTL = new Vec2(14f, 6f);
            _fullAuto       = false;
            _fireWait       = 0f;
            _kickForce      = 0.5f;
            _holdOffset     = new Vec2(0f, 0f);

            UpdateSprite();
        }
Exemplo n.º 12
0
        public ClashShield(float xval, float yval)
            : base(xval, yval)
        {
            ActiveBinding    = new StateBinding("Active");
            LowChargeBinding = new StateBinding("LowCharge");

            _editorName = "Clash Shield";

            graphic    = spriteMap = new SpriteMap(DuckUtils.GetAsset("weapons/clash_shield.png"), 32, 32);
            lightning1 = new SpriteMap(DuckUtils.GetAsset("weapons/clash_shield_lightnings.png"), 12, 6);
            lightning2 = new SpriteMap(DuckUtils.GetAsset("weapons/clash_shield_lightnings.png"), 12, 6);

            depth = depth - 2;

            spriteMap.AddAnimation("idle", 0.4f, false, 0);
            spriteMap.AddAnimation("active", 0.2f, true, 1, 2, 3, 4, 5, 6, 7, 6, 5, 4, 3, 2);
            spriteMap.AddAnimation("low", 0.2f, true, 1, 0, 2, 0, 0, 3, 4, 0, 5, 0, 6, 0, 7, 0, 5, 0, 4, 0, 3, 0, 2);

            lightning1.AddAnimation("idle", 0.4f, false, 0);
            lightning1.AddAnimation("active", 0.2f, true, LightningPattern1);
            lightning1.AddAnimation("low", 0.2f, true, 15, 0, 12, 0, 0, 3, 7, 0, 1, 0, 9, 0, 5, 0, 10, 0, 9, 0, 4);

            lightning2.AddAnimation("idle", 0.4f, false, 0);
            lightning2.AddAnimation("active", 0.2f, true, LightningPattern2);
            lightning2.AddAnimation("low", 0.2f, true, 5, 0, 7, 0, 0, 1, 8, 0, 12, 0, 11, 0, 8, 0, 3, 0, 2, 0, 4);

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

            ammo            = 99;
            thickness       = 8.9f;
            weight          = 9f;
            center          = new Vec2(16f, 18f);
            collisionOffset = new Vec2(-3f, -18f);
            collisionSize   = new Vec2(16f, 27f);
            handOffset      = new Vec2(0f, 1000000f);
            _holdOffset     = new Vec2(-3f, 4f);
            _barrelOffsetTL = new Vec2(23f, 12f);
        }
Exemplo n.º 13
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();
        }
Exemplo n.º 14
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;
        }
Exemplo n.º 15
0
 /// Stops the FSM
 ///
 public void Stop()
 {
     m_currentState = null;
 }