Exemplo n.º 1
0
        public override void Update(Player player, ref int buffIndex)
        {
            WarioPlayer wp = player.GetModPlayer <WarioPlayer>();

            wp.Wario = true;

            player.accFlipper = true;
            player.noFallDmg  = true;

            if (!player.wet)
            {
                player.maxFallSpeed += 3f;

//------------- ExampleDashAccessory code, modified to work with WarioBuff and WarioPlayer

                //If the dash is not active, immediately return so we don't do any of the logic for it
                if (!wp.DashActive)
                {
                    return;
                }

                player.eocDash = wp.DashTimer;
                player.armorEffectDrawShadowEOCShield = true;

                //If the dash has just started, apply the dash velocity in whatever direction we wanted to dash towards
                if (wp.DashTimer == WarioPlayer.MAX_DASH_TIMER)
                {
                    Vector2 newVelocity = player.velocity;

                    if (player.velocity.Y == 0 && ((wp.DashDir == WarioPlayer.DashLeft && player.velocity.X > -wp.DashVelocity) || (wp.DashDir == WarioPlayer.DashRight && player.velocity.X < wp.DashVelocity)))
                    {
                        //X-velocity is set here
                        int dashDirection = wp.DashDir == WarioPlayer.DashRight ? 1 : -1;
                        newVelocity.X = dashDirection * wp.DashVelocity;

                        Main.PlaySound(SoundLoader.customSoundType, (int)player.Center.X, (int)player.Center.Y,
                                       mod.GetSoundSlot(SoundType.Custom, "Sounds/Wario/WarioDash"));
                    }

                    player.velocity = newVelocity;
                }

                //Decrement the timers
                wp.DashTimer--;
                wp.DashDelay--;

                if (wp.DashDelay == 0)
                {
                    //The dash has ended.  Reset the fields
                    wp.DashDelay  = WarioPlayer.MAX_DASH_DELAY;
                    wp.DashTimer  = WarioPlayer.MAX_DASH_TIMER;
                    wp.DashActive = false;
                }
            }
        }
Exemplo n.º 2
0
        public override void HorizontalWingSpeeds(Player player, ref float speed, ref float acceleration)
        {
            WarioPlayer wp = player.GetModPlayer <WarioPlayer>();

            if (wp.Wario)
            {
                speed         = 6f;
                acceleration *= 4f;

                if (!player.wet)
                {
                    //If the dash is not active, immediately return so we don't do any of the logic for it
                    if (!wp.DashActive)
                    {
                        return;
                    }

                    //If the dash has just started, apply the dash velocity in whatever direction we wanted to dash towards
                    if (wp.DashTimer == WarioPlayer.MAX_DASH_TIMER)
                    {
                        Vector2 newVelocity = player.velocity;

                        if ((wp.DashDir == WarioPlayer.DashLeft && player.velocity.X > -wp.DashVelocity) || (wp.DashDir == WarioPlayer.DashRight && player.velocity.X < wp.DashVelocity))
                        {
                            //X-velocity is set here
                            int dashDirection = wp.DashDir == WarioPlayer.DashRight ? 1 : -1;
                            newVelocity.X = dashDirection * wp.DashVelocity;

                            Main.PlaySound(SoundLoader.customSoundType, (int)player.Center.X, (int)player.Center.Y,
                                           mod.GetSoundSlot(SoundType.Custom, "Sounds/Wario/WarioDash"));
                        }

                        player.velocity = newVelocity;
                    }

                    //Decrement the timers
                    wp.DashTimer--;
                    wp.DashDelay--;

                    if (wp.DashDelay == 0)
                    {
                        //The dash has ended.  Reset the fields
                        wp.DashDelay  = WarioPlayer.MAX_DASH_DELAY;
                        wp.DashTimer  = WarioPlayer.MAX_DASH_TIMER;
                        wp.DashActive = false;
                    }
                }
            }

            if (!wp.Wario)
            {
                player.wingsLogic = 0;
            }
        }
Exemplo n.º 3
0
        public override void UpdateArmorSet(Player player)
        {
            WarioPlayer wp = player.GetModPlayer <WarioPlayer>();

            wp.PowerUp1 = true;

            player.setBonus = "HP, Melee damage \nand Defense up\n" +
                              "Powered up!";

            player.AddBuff(mod.BuffType("WarioBuff"), 1);

            player.statLifeMax2 += 15;
            player.meleeDamage  += 0.15f;
            player.statDefense  += 8;
        }
Exemplo n.º 4
0
        public override bool PreHurt(bool pvp, bool quiet, ref int damage, ref int hitDirection,
                                     ref bool crit, ref bool customDamage, ref bool playSound, ref bool genGore, ref PlayerDeathReason damageSource)
        {
            MarioPlayer mp = player.GetModPlayer <MarioPlayer>();
            WarioPlayer wp = player.GetModPlayer <WarioPlayer>();

            int currentSound    = 0;
            int customSoundType = 0;

            if (mp.Mario)
            {
                playSound = false;

                if (!mp.Invincible)
                {
                    currentSound    = mod.GetSoundSlot(SoundType.Custom, "Sounds/mario_hurt");
                    customSoundType = SoundLoader.customSoundType;
                    Main.PlaySound(customSoundType, (int)player.Center.X, (int)player.Center.Y, currentSound, 1f, 0f);
                }
            }

            else if (mp.Luigi)
            {
                playSound = false;

                if (!mp.Invincible)
                {
                    currentSound    = mod.GetSoundSlot(SoundType.Custom, "Sounds/luigi_hurt");
                    customSoundType = SoundLoader.customSoundType;
                    Main.PlaySound(customSoundType, (int)player.Center.X, (int)player.Center.Y, currentSound, 1f, 0f);
                }
            }

            else if (wp.Wario)
            {
                playSound = false;

                currentSound    = mod.GetSoundSlot(SoundType.Custom, "Sounds/Wario/wario_hurt");
                customSoundType = SoundLoader.customSoundType;
                Main.PlaySound(customSoundType, (int)player.Center.X, (int)player.Center.Y, currentSound, 1f, 0f);
            }


            return(base.PreHurt(pvp, quiet, ref damage, ref hitDirection, ref crit, ref customDamage, ref playSound, ref genGore, ref damageSource));
        }
Exemplo n.º 5
0
        public override void UpdateAccessory(Player player, bool hideVisual)
        {
            WarioPlayer wp = player.GetModPlayer <WarioPlayer>();

            if (wp.Wario)
            {
                wp.Jet = true;

                if (!player.wet)
                {
                    player.maxRunSpeed += 1f;
                    Player.jumpHeight  += 6;
                    Player.jumpSpeed   += 2;

                    player.wingTimeMax = 150;
                }
            }
        }
Exemplo n.º 6
0
        public override bool OnPickup(Item item, Player player)
        {
            MarioPlayer mp = player.GetModPlayer <MarioPlayer>();
            WarioPlayer wp = player.GetModPlayer <WarioPlayer>();

            if (new int[] { ItemID.CopperCoin, ItemID.SilverCoin, ItemID.GoldCoin, ItemID.PlatinumCoin }.Contains(item.type))
            {
                if (mp != null && mp.MarioChar)
                {
                    Main.PlaySound(SoundLoader.customSoundType, (int)player.Center.X, (int)player.Center.Y, mod.GetSoundSlot(SoundType.Custom, "Sounds/smw_coin"));
                }
                if (wp != null && wp.Wario)
                {
                    Main.PlaySound(SoundLoader.customSoundType, (int)player.Center.X, (int)player.Center.Y, mod.GetSoundSlot(SoundType.Custom, "Sounds/Wario/wario_coin"));
                }
            }
            return(base.OnPickup(item, player));
        }