public override void ProcessTriggers(TriggersSet triggersSet)
        {
            //if: player has eaten Love Love Fruit and...
            //if: Empty hand, eaten fruit, not in water, and (using mouse -> can use mouse)
            if (player.GetModPlayer <DevilFruitUser>().eatenDevilFruit == 2 && player.HeldItem.type == ItemID.None && !(player.wet && !(player.honeyWet || player.lavaWet)) && (!Equals(DevilFruitMod.UsePowers1Hotkey.GetAssignedKeys(InputMode.Keyboard)[0], "Mouse1") || (Main.hasFocus && !Main.LocalPlayer.mouseInterface && !Main.drawingPlayerChat && !Main.editSign && !Main.editChest && !Main.blockInput && !Main.mapFullscreen && !Main.HoveringOverAnNPC && Main.LocalPlayer.talkNPC == -1)))
            {
                //Getting the shooting trajectory
                Vector2 dir = TMath.CalculateTrajectory();

                if (DevilFruitMod.MiscHotkey.JustPressed)
                {
                    LoveLoveMisc();
                }

                if (DevilFruitMod.UsePowers1Hotkey.JustPressed)
                {
                    LoveLovePowers(dir.X, dir.Y, 0);
                }

                if (DevilFruitMod.UsePowers2Hotkey.JustPressed)
                {
                    LoveLovePowers(dir.X, dir.Y, 1);
                }

                if (DevilFruitMod.UsePowers3Hotkey.JustPressed)
                {
                    LoveLovePowers(dir.X, dir.Y, 2);
                }
            }
        }
Пример #2
0
        public override void ProcessTriggers(TriggersSet triggersSet)
        {
            /* UPON ADDING A NEW FRUIT:
             * 1. Change DFTemplateDFTemplate to the name of the Devil Fruit being added in this and other files in the folder
             * 2. Add moves
             * 3. If needed, update sounds in the sounds file by following the template named DFTemplateDFTemplateSound.cs
             * 4. Update merchant information (DFGlobalNPC.cs)
             * 5. Update Silvers Rayleigh information (Silvers.cs)
             * 6. Upon finishing and testing the fruit, update build.txt and description.txt before publishing
             *
             * RESOURCES:
             * Example Mod: https://github.com/tModLoader/tModLoader/tree/master/ExampleMod
             * AI Types: https://tconfig.fandom.com/wiki/List_of_Projectile_AI_Styles
             * Audio: https://terraria.fandom.com/wiki/Category:Sound_effects?filefrom=Dd2+sky+dragons+fury+swing+0.wav#mw-category-media (Refer to the audio files labeled "Item #.wav")
             */

            //if: player has eaten DFTemplate-DFTemplate Fruit and...
            //if: Empty hand, eaten fruit, not in water, and (using mouse -> can use mouse)
            //UPDATE eatenDevilFruit VALUE!!
            if (player.GetModPlayer <DevilFruitUser>().eatenDevilFruit == 99 && player.HeldItem.type == ItemID.None && !(player.wet && !(player.honeyWet || player.lavaWet)) && (!Equals(DevilFruitMod.UsePowers1Hotkey.GetAssignedKeys(InputMode.Keyboard)[0], "Mouse1") || (Main.hasFocus && !Main.LocalPlayer.mouseInterface && !Main.drawingPlayerChat && !Main.editSign && !Main.editChest && !Main.blockInput && !Main.mapFullscreen && !Main.HoveringOverAnNPC && Main.LocalPlayer.talkNPC == -1)))
            {
                //Getting the shooting trajectory
                Vector2 dir = TMath.CalculateTrajectory();

                if (DevilFruitMod.MiscHotkey.JustPressed)
                {
                    DFTemplateDFTemplateMisc();
                }

                if (DevilFruitMod.UsePowers1Hotkey.JustPressed)
                {
                    DFTemplateDFTemplatePowers(dir.X, dir.Y, 0);
                }

                if (DevilFruitMod.UsePowers2Hotkey.JustPressed)
                {
                    DFTemplateDFTemplatePowers(dir.X, dir.Y, 1);
                }

                if (DevilFruitMod.UsePowers3Hotkey.JustPressed)
                {
                    DFTemplateDFTemplatePowers(dir.X, dir.Y, 2);
                }

                /*
                 * if (DevilFruitMod.UsePowers3Hotkey.JustReleased)
                 * {
                 *
                 * }
                 */
            }
        }
        public override void PreUpdate()
        {
            //GumGumGatling loop, see ProcessTriggers
            if (gatlingPressed)
            {
                if (timer == 0)
                {
                    if (player.HeldItem.type == 0 && !(player.wet && !(player.honeyWet || player.lavaWet)) && (!Equals(DevilFruitMod.UsePowers1Hotkey.GetAssignedKeys(InputMode.Keyboard)[0], "Mouse1") || (Main.hasFocus && !Main.LocalPlayer.mouseInterface && !Main.drawingPlayerChat && !Main.editSign && !Main.editChest && !Main.blockInput && !Main.mapFullscreen && !Main.HoveringOverAnNPC && Main.LocalPlayer.talkNPC == -1)))
                    {
                        //Getting the shooting trajectory
                        Vector2 dir = TMath.CalculateTrajectory();

                        GumGumPowers(dir.X, dir.Y, 2);
                    }
                }
                timer++;
                if (timer > 10)
                {
                    timer = 0;
                }
            }

            if (player.GetModPlayer <DevilFruitUser>().eatenDevilFruit > 0 && player.wet && !(player.honeyWet || player.lavaWet))
            {
                player.AddBuff(ModContent.BuffType <Buffs.waterStun>(), 60, true);
            }
            //No fall damage if eaten Gum Gum Fruit
            if (player.GetModPlayer <DevilFruitUser>().eatenDevilFruit == 1)
            {
                player.noFallDmg = true;

                //"Boing" if fallen instead of damage
                if (!falling && ((player.gravDir == 1 && player.velocity.Y > 10) || (player.gravDir == -1 && player.velocity.Y < 10)))
                {
                    falling = true;
                }
                if (falling && ((player.gravDir == 1 && player.velocity.Y <= 0) || (player.gravDir == -1 && player.velocity.Y >= 0)))
                {
                    falling = false;
                    if ((player.gravDir == 1 && ((int)((player.position.Y) / 16) - player.fallStart) > (25 + player.extraFall)) || (player.gravDir == -1 && player.fallStart < -(25 + player.extraFall)))
                    {
                        CombatText.NewText(player.getRect(), Color.White, "Boing");
                    }
                }
            }
        }
        public override void ProcessTriggers(TriggersSet triggersSet)
        {
            //if: player has eaten Gum Gum Fruit and...
            //if: Empty hand, eaten fruit, not in water, and (using mouse -> can use mouse)
            if (player.GetModPlayer <DevilFruitUser>().eatenDevilFruit == 1 && player.HeldItem.type == ItemID.None && !(player.wet && !(player.honeyWet || player.lavaWet)) && (!Equals(DevilFruitMod.UsePowers1Hotkey.GetAssignedKeys(InputMode.Keyboard)[0], "Mouse1") || (Main.hasFocus && !Main.LocalPlayer.mouseInterface && !Main.drawingPlayerChat && !Main.editSign && !Main.editChest && !Main.blockInput && !Main.mapFullscreen && !Main.HoveringOverAnNPC && Main.LocalPlayer.talkNPC == -1)))
            {
                //Getting the shooting trajectory
                Vector2 dir = TMath.CalculateTrajectory();

                if (DevilFruitMod.MiscHotkey.JustPressed)
                {
                    GumGumMisc(dir.X, dir.Y);
                }

                if (DevilFruitMod.UsePowers1Hotkey.JustPressed)
                {
                    GumGumPowers(dir.X, dir.Y, 0);
                }

                if (DevilFruitMod.UsePowers2Hotkey.JustPressed)
                {
                    GumGumPowers(dir.X, dir.Y, 1);
                }

                if (DevilFruitMod.UsePowers3Hotkey.JustPressed)
                {
                    //if: No hands in use, Empty hand, eaten fruit, not in water, and (using mouse -> can use mouse)
                    if (DevilFruitMod.hands == 0)
                    {
                        gatlingPressed       = true; //refer to PreUpdate()
                        timer                = 0;
                        DevilFruitMod.hands += 2;
                    }
                }

                if (DevilFruitMod.UsePowers3Hotkey.JustReleased)
                {
                    if (gatlingPressed == true)
                    {
                        gatlingPressed       = false;
                        DevilFruitMod.hands -= 2;
                    }
                }
            }
        }