}//end input

        private void equipItem()
        {
            if (itemType == Globals.ITEM_TYPE_EQUIP)
            {
                if (itemID == ItemHandler.equipList.Count)
                {
                    unnequipItem();
                    parent = new SubStateListMenuEquip(parent.Parent, PCid, slot);
                    return;
                }
                if (StateHandler.GetPC(PCid).equipped[slot] != null)
                {
                    ItemHandler.equipList.Add(StateHandler.GetPC(PCid).equipped[slot]);
                }
                StateHandler.GetPC(PCid).equipped[slot] = ItemHandler.equipList[itemID];
                ItemHandler.equipList.RemoveAt(itemID);
                parent.Parent = new SubStateSlotMenuEquip((SubStateAbstract)parent.Parent.Parent, PCid);
            }
            else if (itemType == Globals.ITEM_TYPE_RUNE)
            {
                if (itemID == ItemHandler.runeList.Count)
                {
                    unnequipRune();
                    parent = new SubStateListMenuRune(parent.Parent, PCid, slot);
                    return;
                }
                if (StateHandler.GetPC(PCid).runes[slot] != null)
                {
                    ItemHandler.runeList.Add(StateHandler.GetPC(PCid).runes[slot]);
                }
                StateHandler.GetPC(PCid).runes[slot] = ItemHandler.runeList[itemID];
                ItemHandler.runeList.RemoveAt(itemID);
                parent.Parent = new SubStateSlotMenuRune((SubStateAbstract)parent.Parent.Parent, PCid);
            }
        }//end equipItem
        public SubStateCharSelectSpell(SubStateAbstract theparent, SpellAbstract theSpell, PC thePC)
            : base(theparent)
        {
            spell = theSpell;
            curr  = thePC;
            int i = 0, alive = 0;

            for (i = 0; i < StateCombat.MonsterList.Length; i++)
            {
                if (StateCombat.MonsterList[i].Health > 0)
                {
                    alive++;
                }
            }

            StateHandler.AddDelay();
            messageBoxes = new MessageBox[1];
            colors       = new Color[3 + alive];
            menu         = new string[colors.Length];
            targets      = new Character[colors.Length];

            int unavailable = 0;

            for (i = 0; i < StateCombat.MonsterList.Length; i++)
            {
                if (StateCombat.MonsterList[i].Health < 1)
                {
                    unavailable++;
                }
                else
                {
                    targets[i - unavailable] = StateCombat.MonsterList[i];
                }
            }

            int index = 0;

            for (i = i - unavailable; i < targets.Length; i++, index++)
            {
                targets[i] = StateHandler.GetPC(index);
            }

            for (i = 0; i < menu.Length; i++)
            {
                menu[i] = targets[i].Name;
            }

            for (i = 1; i < colors.Length; i++)
            {
                colors[i] = Color.DarkGray;
            }
            colors[0] = Color.White;

            mX     = 250;
            mY     = 100;
            width  = 690;
            height = 510;

            messageBoxes[0] = new MessageBox(mX, mY, width, height, menu, colors, true, true);
        }//end EVC
        public SubStateSlotMenuEquip(SubStateAbstract theparent, int thePC)
            : base(theparent)
        {
            PCid = thePC;
            StateHandler.AddDelay();
            messageBoxes = new MessageBox[1];
            colors       = new Color[4];
            menu         = new string[4];

            for (int i = 0; i < 4; i++)
            {
                if (StateHandler.GetPC(thePC).GetEquipment(i) == null)
                {
                    menu[i] = "Open";
                }
                else
                {
                    menu[i] = StateHandler.GetPC(thePC).GetEquipment(i).Name;
                }
                colors[i] = Color.DarkGray;
            }

            colors[0] = Color.White;

            mX     = 170;
            mY     = 60;
            width  = 760;
            height = 490;

            messageBoxes[0] = new MessageBox(mX, mY, width, height, menu, colors, true, true);
        }//end EVC
예제 #4
0
        public SubStateCharSelectMenuRune(SubStateAbstract theparent)
            : base(theparent)
        {
            parent = theparent;

            StateHandler.AddDelay();
            messageBoxes = new MessageBox[1];
            colors       = new Color[3];
            menu         = new string[3];

            menu[0] = StateHandler.GetPC(0).Name;
            menu[1] = StateHandler.GetPC(1).Name;
            menu[2] = StateHandler.GetPC(2).Name;

            colors[0] = Color.White;
            colors[1] = Color.DarkGray;
            colors[2] = Color.DarkGray;

            mX     = 100;
            mY     = 45;
            width  = 860;
            height = 590;

            messageBoxes[0] = new MessageBox(mX, mY, width, height, menu, colors, true, true);
        }//end EVC
 private void unnequipRune()
 {
     if (StateHandler.GetPC(PCid).runes[slot] == null)
     {
         return;
     }
     ItemHandler.runeList.Add(StateHandler.GetPC(PCid).runes[slot]);
     StateHandler.GetPC(PCid).runes[slot] = null;
     parent.Parent = new SubStateSlotMenuRune((SubStateAbstract)parent.Parent.Parent, PCid);
     parent        = new SubStateListMenuRune(parent.Parent, PCid, slot);
 }
        }//end equipItem

        private void unnequipItem()
        {
            if (StateHandler.GetPC(PCid).equipped[slot] == null)
            {
                return;
            }
            ItemHandler.equipList.Add(StateHandler.GetPC(PCid).equipped[slot]);
            StateHandler.GetPC(PCid).equipped[slot] = null;
            parent.Parent = new SubStateSlotMenuEquip((SubStateAbstract)parent.Parent.Parent, PCid);
            parent        = new SubStateListMenuEquip(parent.Parent, PCid, slot);
        }
        public SubStateCharSelectMenuUseCombat(SubStateAbstract theparent, int itemSlot)
            : base(theparent)
        {
            int i = 0, alive = 0;

            for (i = 0; i < StateCombat.MonsterList.Length; i++)
            {
                if (StateCombat.MonsterList[i].Health > 0)
                {
                    alive++;
                }
            }
            itemID = itemSlot;
            StateHandler.AddDelay();
            messageBoxes = new MessageBox[1];
            colors       = new Color[3 + alive];
            menu         = new string[colors.Length];

            menu[0] = StateHandler.GetPC(0).Name;
            menu[1] = StateHandler.GetPC(1).Name;
            menu[2] = StateHandler.GetPC(2).Name;

            int unavailable = 0;

            for (i = 0; i < StateCombat.MonsterList.Length; i++)
            {
                if (StateCombat.MonsterList[i].Health < 1)
                {
                    unavailable++;
                }
                else
                {
                    menu[3 + i - unavailable] = StateCombat.MonsterList[i].Name;
                }
            }

            colors[0] = Color.White;
            for (i = 1; i < colors.Length; i++)
            {
                colors[i] = Color.DarkGray;
            }

            mX     = 170;
            mY     = 60;
            width  = 760;
            height = 490;

            messageBoxes[0] = new MessageBox(mX, mY, width, height, menu, colors, true, true);
        }//end EVC
예제 #8
0
        }//end EVC

        public override void Input(int input)
        {
            if (input == Globals.KEY_ACCEPT)
            {
                StateHandler.AddDelay();
                base.Input(input);
                if (count == 0)
                {
                    Character user = (Character)StateHandler.CameraTarget;
                    if (person < 3)//targetting player
                    {
                        ItemHandler.itemList[itemSlot].use(user, StateHandler.GetPC(person));
                    }
                    else//targetting monster
                    {
                        person -= 3;

                        for (int i = 0; i < person + 1 && i < StateCombat.MonsterList.Length; i++)
                        {
                            if (StateCombat.MonsterList[i].Health < 1)
                            {
                                person++;
                            }
                        }

                        ItemHandler.itemList[itemSlot].use(user, StateCombat.MonsterList[person]);
                    }
                    ItemHandler.itemList.RemoveAt(itemSlot);
                }
                else if (count == 1)
                {
                    StateHandler.AddDelay();
                    StateHandler.State = Parent;
                }
            }
            else if (input == Globals.KEY_CANCEL)
            {
                StateHandler.AddDelay();
                StateHandler.State = Parent;
            }
            else
            {
                base.Input(input);
            }
        }//end input
예제 #9
0
        }//end EVC

        public override void Input(int input)
        {
            base.Input(input);
            StateHandler.AddDelay();

            if (input == Globals.KEY_ACCEPT)
            {
                StateHandler.AddDelay();
                if (count == 0)
                {
                    ItemHandler.itemList[itemSlot].use(StateHandler.GetPC(person));
                    ItemHandler.itemList.RemoveAt(itemSlot);
                }
            }
            else if (input == Globals.KEY_CANCEL)
            {
                StateHandler.AddDelay();
                StateHandler.State = Parent.Parent;
            }
        }//end input
        public SubStateCharacterSelectMenu(SubStateAbstract theparent, int xCoord, int yCoord)
            : base(theparent)
        {
            StateHandler.AddDelay();
            messageBoxes = new MessageBox[1];
            colors       = new Color[3];
            menu         = new string[3];

            menu[0] = StateHandler.GetPC(0).Name;
            menu[1] = StateHandler.GetPC(1).Name;
            menu[2] = StateHandler.GetPC(2).Name;

            colors[0] = Color.White;
            colors[1] = Color.DarkGray;
            colors[2] = Color.DarkGray;

            mX     = xCoord;
            mY     = yCoord;
            width  = 960;
            height = 680;

            messageBoxes[0] = new MessageBox(mX, mY, width, height, menu, colors, true, true);
        }//end EVC