Exemple #1
0
        public ChangePartnerSubMenu(BattleEntity user) : base(user)
        {
            Name     = "Change Partner";
            Position = new Vector2(230, 150);

            HeaderSize.X = 200f;

            BattlePartner[] partners = Inventory.Instance.partnerInventory.GetAllPartners();

            for (int i = 0; i < partners.Length; i++)
            {
                ChangePartnerAction partnerChange = new ChangePartnerAction(User, partners[i]);

                //If this Partner is the current one out in battle or is dead, disable the option to select it
                if (partners[i] == User.BManager.Partner || partners[i].IsDead == true)
                {
                    partnerChange.Disabled = true;
                    if (partners[i].IsDead == false)
                    {
                        partnerChange.DisabledString = $"{partners[i].Name} is already out!";
                    }
                    else
                    {
                        partnerChange.DisabledString = $"{partners[i].Name} is unable to battle!";
                    }
                }

                BattleActions.Add(partnerChange);
            }
        }
        public ItemDipSubMenu(BattleEntity user) : base(user)
        {
            Name     = "Items";
            Position = new Vector2(230, 150);

            int doubleDipCount = User.GetEquippedNPBadgeCount(BadgeGlobals.BadgeTypes.DoubleDip);
            int tripleDipCount = User.GetEquippedNPBadgeCount(BadgeGlobals.BadgeTypes.TripleDip);

            Texture2D battleTex = AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.BattleGFX}.png");

            BattleActions.Add(new MenuAction(User, "Items", new CroppedTexture2D(battleTex, new Rectangle(216, 845, 22, 22)),
                                             "Select items to use in Battle.", new ItemSubMenu(User, 1, 0)));

            //Add Double Dip
            if (doubleDipCount > 0)
            {
                BattleActions.Add(new MenuAction(User, "Double Dip", new CroppedTexture2D(battleTex, new Rectangle(872, 107, 24, 21)),
                                                 "Lets you use 2 items in one turn.", 4, new ItemSubMenu(User, 2, 4)));
            }

            //Add Triple Dip
            if (doubleDipCount > 1 || tripleDipCount > 0)
            {
                BattleActions.Add(new MenuAction(User, "Triple Dip", new CroppedTexture2D(battleTex, new Rectangle(872, 137, 24, 21)),
                                                 "Lets you use 3 items in one turn.", 8, new ItemSubMenu(User, 3, 8)));
            }
        }
        public TacticsSubMenu()
        {
            Name     = "Tactics";
            Position = new Vector2(230, 150);

            BattleEntity entity = BattleManager.Instance.EntityTurn;

            //int quickChangeCount = entity.GetEquippedBadgeCount(BadgeGlobals.BadgeTypes.QuickChange);
            //Enumerations.CostDisplayTypes costDisplayType = Enumerations.CostDisplayTypes.Shown;
            //if (quickChangeCount > 0) costDisplayType = Enumerations.CostDisplayTypes.Special;

            Texture2D battleTex = AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.BattleGFX}.png");

            //If no Partner is available (removed from battle or don't have one) then don't add the change partner action
            //Additionally, if only one partner is avaiable then don't add it either
            //This mimics TTYD behavior if you either have no Partner or if it's removed from battle via Gale Force or Fright
            bool addChangePartner = (BattleManager.Instance.GetPartner() != null && Inventory.Instance.partnerInventory.GetPartnerCount() > 1);

            if (addChangePartner == true)
            {
                Rectangle sourceRect = new Rectangle(30 + (((int)BattleManager.Instance.GetPartner().PartnerType - 1) * 32), 886, 32, 32);

                BattleActions.Add(new MenuAction("Change Partner", new CroppedTexture2D(battleTex, sourceRect),
                                                 "Change your current partner.", //costDisplayType,
                                                 new ChangePartnerSubMenu()));
            }

            #region Charge Menu

            //Charge action if the Charge or Charge P Badge is equipped
            int chargeCount = entity.GetEquippedNPBadgeCount(BadgeGlobals.BadgeTypes.Charge);
            if (chargeCount > 0)
            {
                //Charge starts out at 2 then increases by 1 for each additional Badge
                int chargeAmount = 2 + (chargeCount - 1);

                BattleActions.Add(new MoveAction("Charge", new MoveActionData(new CroppedTexture2D(battleTex, new Rectangle(623, 807, 40, 40)),
                                                                              "Save up strength to power up\nyour next attack",
                                                                              Enumerations.MoveResourceTypes.FP, chargeCount, Enumerations.CostDisplayTypes.Shown, Enumerations.MoveAffectionTypes.None,
                                                                              TargetSelectionMenu.EntitySelectionType.Single, false, null), new ChargeSequence(null, chargeAmount)));
            }

            #endregion

            //Defend action
            BattleActions.Add(new Defend());

            //Do nothing action
            BattleActions.Add(new NoAction());

            //Run away action
            BattleActions.Add(new RunAwayAction());
        }
        public HammerSubMenu()
        {
            Position         = new Vector2(230, 150);
            AutoSelectSingle = true;

            BattleActions.Add(new Hammer());
            if (BattleManager.Instance.EntityTurn.GetEquippedBadgeCount(BadgeGlobals.BadgeTypes.IceSmash) > 0)
            {
                BattleActions.Add(new IceSmash());
            }
            if (BattleManager.Instance.EntityTurn.GetEquippedBadgeCount(BadgeGlobals.BadgeTypes.HeadRattle) > 0)
            {
                BattleActions.Add(new HeadRattle());
            }
        }
        public TacticsSubMenu()
        {
            Position = new Vector2(230, 150);

            BattleEntity entity = BattleManager.Instance.EntityTurn;

            //int quickChangeCount = entity.GetEquippedBadgeCount(BadgeGlobals.BadgeTypes.QuickChange);
            //Enumerations.CostDisplayTypes costDisplayType = Enumerations.CostDisplayTypes.Shown;
            //if (quickChangeCount > 0) costDisplayType = Enumerations.CostDisplayTypes.Special;

            BattleActions.Add(new MenuAction("Change Partner", null, "Change your current partner.", //costDisplayType,
                                             new ChangePartnerSubMenu()));


            #region Charge Menu

            BadgeGlobals.BadgeTypes chargeBadgeType = BadgeGlobals.BadgeTypes.Charge;

            //Check for a Player; if the Player is a Partner, check the number of Charge P's instead
            if (entity.EntityType == Enumerations.EntityTypes.Player)
            {
                BattlePlayer player = (BattlePlayer)entity;
                if (player.PlayerType == Enumerations.PlayerTypes.Partner)
                {
                    chargeBadgeType = BadgeGlobals.BadgeTypes.ChargeP;
                }
            }

            //Charge action if the Charge or Charge P Badge is equipped
            int chargeCount = entity.GetEquippedBadgeCount(chargeBadgeType);
            if (chargeCount > 0)
            {
                //Charge starts out at 2 then increases by 1 for each additional Badge
                int chargeAmount = 2 + (chargeCount - 1);

                BattleActions.Add(new MoveAction("Charge", new MoveActionData(null, "Save up strength to power up your next attack",
                                                                              Enumerations.MoveResourceTypes.FP, chargeCount, Enumerations.CostDisplayTypes.Shown, Enumerations.MoveAffectionTypes.None,
                                                                              TargetSelectionMenu.EntitySelectionType.Single, false, null), new ChargeSequence(null, chargeAmount)));
            }

            #endregion

            //Defend action
            BattleActions.Add(new Defend());

            //Do nothing action
            BattleActions.Add(new NoAction());
        }
        /// <summary>
        /// Creates an ItemSubMenu.
        /// </summary>
        /// <param name="dipTurnCount">The number of item turns. This is used for Double/Triple Dip.</param>
        /// <param name="fpCost">The amount of FP it costs to use an item. This is used for Double/Triple Dip.</param>
        /// <param name="isRootMenu">Tells if the ItemSubMenu is the root menu. This is only true if Double/Triple Dip is used.</param>
        public ItemSubMenu(int dipTurnCount, int fpCost, bool isRootMenu = false)
        {
            Name     = "Items";
            Position = new Vector2(230, 150);

            DipTurnCount = dipTurnCount;
            FPCost       = fpCost;
            IsRootMenu   = isRootMenu;

            Item[] usableItems = Inventory.Instance.FindItems(Item.ItemCategories.Standard,
                                                              Item.ItemTypes.Healing | Item.ItemTypes.Damage | Item.ItemTypes.Status | Item.ItemTypes.Revival);
            for (int i = 0; i < usableItems.Length; i++)
            {
                //This cast fails if the Item doesn't derive from BattleItem
                //This can also happen if an Item that can't be used in battle had its ItemType set to the wrong value
                BattleItem item = (BattleItem)usableItems[i];

                //Set item properties
                ItemAction newItemAction = item.ActionAssociated;
                newItemAction.SetDipFPCost(FPCost);
                //Set the item turn count
                if (dipTurnCount > 1)
                {
                    newItemAction.SetOnItemUsed(SetEntityDipTurnCount);
                }

                BattleActions.Add(newItemAction);
            }

            if (BattleActions.Count == 0)
            {
                //Add the No Items action, which, when selected, brings up a battle message saying "You can't select that!"
                //and brings you back to the menu. This happens even with Double Dip and Triple Dip, essentially forcing you
                //to stop using items.

                MessageAction noItems = new MessageAction("No Items", null, "You have no items.",
                                                          (int)BattleGlobals.BattleEventPriorities.Message, "You can't select that!");
                BattleActions.Add(noItems);
            }

            //Initialize here if this is the root menu, as it won't be initialized like it normally is
            if (IsRootMenu == true)
            {
                MoveCategory = Enumerations.MoveCategories.Item;
                Initialize();
            }
        }
Exemple #7
0
        public SpecialSubMenu()
        {
            Position = new Vector2(230, 150);

            BattleActions.Add(new Focus());
            BattleActions.Add(new Refresh());
            BattleActions.Add(new Lullaby());
            BattleActions.Add(new PowerLift());
            BattleActions.Add(new ArtAttack());

            if (BattleActions.Count == 0)
            {
                MessageAction noSpecials = new MessageAction("No Specials", null, "No Special Moves are available.",
                                                             (int)BattleGlobals.StartEventPriorities.Message, "You can't select that!");

                BattleActions.Add(noSpecials);
            }
        }
        public JumpSubMenu()
        {
            Position         = new Vector2(230, 150);
            AutoSelectSingle = true;

            BattleActions.Add(new Jump());
            if (BattleManager.Instance.EntityTurn.GetEquippedBadgeCount(BadgeGlobals.BadgeTypes.PowerBounce) > 0)
            {
                BattleActions.Add(new PowerBounce());
            }
            if (BattleManager.Instance.EntityTurn.GetEquippedBadgeCount(BadgeGlobals.BadgeTypes.Multibounce) > 0)
            {
                BattleActions.Add(new Multibounce());
            }
            if (BattleManager.Instance.EntityTurn.GetEquippedBadgeCount(BadgeGlobals.BadgeTypes.TornadoJump) > 0)
            {
                BattleActions.Add(new TornadoJump());
            }
        }
Exemple #9
0
        public HammerSubMenu(BattleEntity user) : base(user)
        {
            Name             = "Hammer";
            Position         = new Vector2(230, 150);
            AutoSelectSingle = true;

            BattleActions.Add(new HammerAction(User));

            int powerSmashCount = User.GetEquippedBadgeCount(BadgeGlobals.BadgeTypes.PowerSmash);

            if (powerSmashCount > 0)
            {
                BattleActions.Add(new PowerSmashAction(User, powerSmashCount));
            }
            if (User.GetEquippedBadgeCount(BadgeGlobals.BadgeTypes.MegaSmash) > 0)
            {
                BattleActions.Add(new MegaSmashAction(User));
            }
            if (User.GetEquippedBadgeCount(BadgeGlobals.BadgeTypes.PiercingBlow) > 0)
            {
                BattleActions.Add(new PiercingBlowAction(User));
            }
            if (User.GetEquippedBadgeCount(BadgeGlobals.BadgeTypes.HeadRattle) > 0)
            {
                BattleActions.Add(new HeadRattleAction(User));
            }
            if (User.GetEquippedBadgeCount(BadgeGlobals.BadgeTypes.IceSmash) > 0)
            {
                BattleActions.Add(new IceSmashAction(User));
            }
            if (User.GetEquippedBadgeCount(BadgeGlobals.BadgeTypes.DDownPound) > 0)
            {
                BattleActions.Add(new DDownPoundAction(User));
            }

            int quakeCount = User.GetEquippedBadgeCount(BadgeGlobals.BadgeTypes.QuakeHammer);

            if (quakeCount > 0)
            {
                BattleActions.Add(new QuakeHammerAction(User, quakeCount));
            }
        }
        public HammerSubMenu()
        {
            Name             = "Hammer";
            Position         = new Vector2(230, 150);
            AutoSelectSingle = true;

            BattleActions.Add(new Hammer());

            int powerSmashCount = BattleManager.Instance.EntityTurn.GetEquippedBadgeCount(BadgeGlobals.BadgeTypes.PowerSmash);

            if (powerSmashCount > 0)
            {
                BattleActions.Add(new PowerSmashAction(powerSmashCount));
            }
            if (BattleManager.Instance.EntityTurn.GetEquippedBadgeCount(BadgeGlobals.BadgeTypes.MegaSmash) > 0)
            {
                BattleActions.Add(new MegaSmashAction());
            }
            if (BattleManager.Instance.EntityTurn.GetEquippedBadgeCount(BadgeGlobals.BadgeTypes.PiercingBlow) > 0)
            {
                BattleActions.Add(new PiercingBlowAction());
            }
            if (BattleManager.Instance.EntityTurn.GetEquippedBadgeCount(BadgeGlobals.BadgeTypes.HeadRattle) > 0)
            {
                BattleActions.Add(new HeadRattle());
            }
            if (BattleManager.Instance.EntityTurn.GetEquippedBadgeCount(BadgeGlobals.BadgeTypes.IceSmash) > 0)
            {
                BattleActions.Add(new IceSmash());
            }
            if (BattleManager.Instance.EntityTurn.GetEquippedBadgeCount(BadgeGlobals.BadgeTypes.DDownPound) > 0)
            {
                BattleActions.Add(new DDownPoundAction());
            }

            int quakeCount = BattleManager.Instance.EntityTurn.GetEquippedBadgeCount(BadgeGlobals.BadgeTypes.QuakeHammer);

            if (quakeCount > 0)
            {
                BattleActions.Add(new QuakeHammerAction(quakeCount));
            }
        }
Exemple #11
0
        public ChangePartnerSubMenu()
        {
            Position = new Vector2(230, 150);

            BattlePartner[] partners = Inventory.Instance.partnerInventory.GetAllPartners();

            for (int i = 0; i < partners.Length; i++)
            {
                ChangePartner partnerChange = new ChangePartner(partners[i]);

                //If this partner is the current one out in battle, disable the option
                if (partners[i] == BattleManager.Instance.GetPartner())
                {
                    partnerChange.Disabled       = true;
                    partnerChange.DisabledString = $"{partners[i].Name} is already out!";
                }

                BattleActions.Add(partnerChange);
            }
        }
Exemple #12
0
        public SpecialSubMenu(BattleEntity user) : base(user)
        {
            Name     = "Special";
            Position = new Vector2(230, 150);

            BattleActions.Add(new FocusAction(User));
            BattleActions.Add(new SweetTreatAction(User));
            BattleActions.Add(new RefreshAction(User));
            BattleActions.Add(new LullabyAction(User));
            BattleActions.Add(new PowerLiftAction(User));
            BattleActions.Add(new ArtAttackAction(User));

            if (BattleActions.Count == 0)
            {
                MessageAction noSpecials = new MessageAction(User, "No Specials", null, "No Special Moves are available.",
                                                             (int)BattleGlobals.BattleEventPriorities.Message, "You can't select that!");

                BattleActions.Add(noSpecials);
            }
        }
Exemple #13
0
        public ItemDipSubMenu()
        {
            Position = new Vector2(230, 150);

            int doubleDipCount = BattleManager.Instance.EntityTurn.GetEquippedBadgeCount(BadgeGlobals.BadgeTypes.DoubleDip);
            int tripleDipCount = BattleManager.Instance.EntityTurn.GetEquippedBadgeCount(BadgeGlobals.BadgeTypes.TripleDip);

            BattleActions.Add(new MenuAction("Items", null, "Select items to use in Battle.", new ItemSubMenu(1, 0)));

            //Add Double Dip
            if (doubleDipCount > 0)
            {
                BattleActions.Add(new MenuAction("Double Dip", null, "Lets you use 2 items in one turn.", 4, new ItemSubMenu(2, 4)));
            }

            //Add Triple Dip
            if (doubleDipCount > 1 || tripleDipCount > 0)
            {
                BattleActions.Add(new MenuAction("Triple Dip", null, "Lets you use 3 items in one turn.", 8, new ItemSubMenu(3, 8)));
            }
        }
Exemple #14
0
        public JumpSubMenu(BattleEntity user) : base(user)
        {
            Name             = "Jump";
            Position         = new Vector2(230, 150);
            AutoSelectSingle = true;

            BattleActions.Add(new JumpAction(User));
            if (User.GetEquippedBadgeCount(BadgeGlobals.BadgeTypes.PowerBounce) > 0)
            {
                BattleActions.Add(new PowerBounceAction(User));
            }
            if (User.GetEquippedBadgeCount(BadgeGlobals.BadgeTypes.Multibounce) > 0)
            {
                BattleActions.Add(new MultibounceAction(User));
            }
            if (User.GetEquippedBadgeCount(BadgeGlobals.BadgeTypes.TornadoJump) > 0)
            {
                BattleActions.Add(new TornadoJumpAction(User));
            }
            if (User.GetEquippedBadgeCount(BadgeGlobals.BadgeTypes.DDownJump) > 0)
            {
                BattleActions.Add(new DDownJumpAction(User));
            }
        }