예제 #1
0
        private void Squish()
        {
            int a, b, r;

            List <int> rowsToUse = new List <int>();

            for (b = 0; b < _totalRows; b++)
            {
                for (a = 0; a < COLUMNS; a++)
                {
                    if (!String.IsNullOrEmpty(_spells[b, a].ID))
                    {
                        rowsToUse.Add(b); break;
                    }
                }
            }

            MagicSpell[,] newSpells = new MagicSpell[rowsToUse.Count, COLUMNS];

            r = 0;
            foreach (int i in rowsToUse)
            {
                for (int j = 0; j < COLUMNS; j++)
                {
                    newSpells[r, j] = _spells[i, j];
                }
                r++;
            }

            _spells = newSpells;

            _totalRows = rowsToUse.Count;
        }
예제 #2
0
        protected override void DrawContents(Gdk.Drawable d)
        {
            Cairo.Context g = Gdk.CairoHelper.Create(d);

            g.SelectFontFace("Lucida Console", FontSlant.Normal, FontWeight.Bold);
            g.SetFontSize(24);

            TextExtents te;

            MagicSpell s = Game.Battle.Commanding.MagicMenu.Selected;

            int row = 0;

            if (!String.IsNullOrEmpty(s.ID))
            {
                string cost = s.Spell.Cost.ToString();
                Graphics.ShadowedText(g, "MP Req", X + x1, Y + y0);

                row++;

                cost = cost + "/";
                te   = g.TextExtents(cost);
                Graphics.ShadowedText(g, cost, X + x2 - te.Width, Y + y0 + (row * ys));

                string tot = Game.Battle.Commanding.MP.ToString();
                te = g.TextExtents(tot);
                Graphics.ShadowedText(g, tot, X + x3 - te.Width, Y + y0 + (row * ys));

                row++;

                if (s.AddedAbility.Contains(AddedAbility.All))
                {
                    string msg = "All x";
                    msg += s.AllCount.ToString();
                    Graphics.ShadowedText(g, msg, X + x0, Y + y0 + (row * ys));
                    row++;
                }

                if (s.AddedAbility.Contains(AddedAbility.QuadraMagic))
                {
                    string msg = "Q-Magic x";
                    msg += s.QMagicCount.ToString();
                    Graphics.ShadowedText(g, msg, X + x0, Y + y0 + (row * ys));
                    row++;
                }
            }

            ((IDisposable)g.Target).Dispose();
            ((IDisposable)g).Dispose();
        }
예제 #3
0
        private void Squish()
        {
            int a, b, r;

            List<int> rowsToUse = new List<int>();

            for (b = 0; b < _totalRows; b++)
                for (a = 0; a < COLUMNS; a++)
                    if (!String.IsNullOrEmpty(_spells[b, a].ID)) { rowsToUse.Add(b); break; }

            MagicSpell[,] newSpells = new MagicSpell[rowsToUse.Count, COLUMNS];

            r = 0;
            foreach (int i in rowsToUse)
            {
                for (int j = 0; j < COLUMNS; j++)
                    newSpells[r, j] = _spells[i, j];
                r++;
            }

            _spells = newSpells;

            _totalRows = rowsToUse.Count;
        }
예제 #4
0
 public static int Compare(MagicSpell left, MagicSpell right)
 {
     return Spell.Compare(left.Spell, right.Spell);
 }
예제 #5
0
        private void GetMagicSpells(ISlotHolder sh, List <MagicSpell> list)
        {
            for (int i = 0; i < sh.Links; i++)
            {
                Materia left  = sh.Slots[i * 2];
                Materia right = sh.Slots[(i * 2) + 1];

                if (left is MagicMateria && right is SupportMateria)
                {
                    Materia temp = left;
                    left  = right;
                    right = temp;
                }
                if (right is MagicMateria && left is SupportMateria)
                {
                    foreach (Spell s in ((MagicMateria)right).GetSpells)
                    {
                        bool replace = false;
                        for (int j = 0; j < list.Count; j++)
                        {
                            if (list[j].ID == s.ID)
                            {
                                replace = true;
                                MagicSpell ms = list[j];
                                ms.AddAbility((SupportMateria)left);
                                list[j] = ms;
                            }
                        }
                        if (!replace)
                        {
                            MagicSpell t = new MagicSpell(s);
                            t.AddAbility((SupportMateria)left);
                            list.Add(t);
                        }
                    }
                }
                else
                {
                    if (right is MagicMateria)
                    {
                        foreach (Spell s in ((MagicMateria)right).GetSpells)
                        {
                            list.Add(new MagicSpell(s));
                        }
                    }
                    if (left is MagicMateria)
                    {
                        foreach (Spell s in ((MagicMateria)left).GetSpells)
                        {
                            list.Add(new MagicSpell(s));
                        }
                    }
                }
            }
            for (int j = sh.Links * 2; j < sh.Slots.Length; j++)
            {
                Materia m = sh.Slots[j];
                if (m is MagicMateria)
                {
                    foreach (Spell s in ((MagicMateria)m).GetSpells)
                    {
                        list.Add(new MagicSpell(s));
                    }
                }
            }
        }
예제 #6
0
 public static int Compare(MagicSpell left, MagicSpell right)
 {
     return(Spell.Compare(left.Spell, right.Spell));
 }