Ejemplo n.º 1
0
 public void Swap(SlotHolder @from, SlotHolder to, Character c)
 {
     for (int i = 0; i < @from.Slots.Length; i++)
     {
         MateriaOrb m = @from.Slots[i];
         
         if (m != null)
         {
             if (i >= to.Slots.Length)
             {
                 m.Detach(c);
                 Put(m);
             }
             else
             {
                 to.Slots[i] = m;
             }
         }
         
         @from.Slots[i] = null;
     }
 }
Ejemplo n.º 2
0
        public override void ControlHandle(Key k)
        {
            switch (k)
            {
            case Key.Up:
                if (option > 0)
                {
                    option--;
                }
                break;

            case Key.Down:
                if (option < 3)
                {
                    option++;
                }
                break;

            case Key.Circle:
                switch (option)
                {
                case 0:
                    MenuState.Party.Materiatory.Sort();
                    break;

                case 1:
                    break;

                case 2:
                    for (int i = 0; i < MenuState.Party.Selected.Weapon.Slots.Length; i++)
                    {
                        MateriaOrb orb = MenuState.Party.Selected.Weapon.Slots[i];
                        if (orb != null)
                        {
                            MenuState.Party.Selected.Weapon.Slots[i] = null;
                            orb.Detach(MenuState.Party.Selected);
                            MenuState.Party.Materiatory.Put(orb);
                        }
                    }
                    for (int j = 0; j < MenuState.Party.Selected.Armor.Slots.Length; j++)
                    {
                        MateriaOrb orb = MenuState.Party.Selected.Armor.Slots[j];
                        if (orb != null)
                        {
                            MenuState.Party.Selected.Armor.Slots[j] = null;
                            orb.Detach(MenuState.Party.Selected);
                            MenuState.Party.Materiatory.Put(orb);
                        }
                    }
                    break;

                case 3:
                    MenuState.MateriaScreen.ChangeControl(MenuState.MateriaList);
                    MenuState.MateriaList.Trashing = true;
                    break;

                default: break;
                }
                break;

            case Key.X:
                Visible = false;
                MenuState.MateriaScreen.ChangeToDefaultControl();
                break;

            default: break;
            }
        }