public static void Render(Cairo.Context g, SlotHolder equipment, int x, int y, bool renderOrbs, bool renderBackground = true) { if (renderBackground) { g.Color = Colors.GRAY_1; g.Rectangle(x, y, 8 * SLOT_SPACING, SLOT_RADIUS * 2); g.Fill(); } for (int j = 0; j < equipment.Links; j++) { Shapes.RenderLine(g, gray2, 3, x + (SLOT_SPACING / 2) + (j * 2 * SLOT_SPACING), y + ys - zs, x + (SLOT_SPACING / 2) + ((j * 2 + 1) * SLOT_SPACING), y + ys - zs); Shapes.RenderLine(g, gray2, 3, x + (SLOT_SPACING / 2) + (j * 2 * SLOT_SPACING), y + ys, x + (SLOT_SPACING / 2) + ((j * 2 + 1) * SLOT_SPACING), y + ys); Shapes.RenderLine(g, gray2, 3, x + (SLOT_SPACING / 2) + (j * 2 * SLOT_SPACING), y + ys + zs, x + (SLOT_SPACING / 2) + ((j * 2 + 1) * SLOT_SPACING), y + ys + zs); } for (int i = 0; i < equipment.Slots.Length; i++) { Shapes.RenderCircle(g, gray2, SLOT_RADIUS, x + (i * SLOT_SPACING) + (SLOT_SPACING / 2), y + ys); if (equipment.Slots[i] == null || !renderOrbs) { Shapes.RenderCircle(g, gray1, MATERIA_RADIUS, x + (i * SLOT_SPACING) + (SLOT_SPACING / 2), y + ys); } else { Shapes.RenderCircle(g, equipment.Slots[i].Color, MATERIA_RADIUS, x + (i * SLOT_SPACING) + (SLOT_SPACING / 2), y + ys); } } }
public static void Render(Cairo.Context g, SlotHolder equipment, int x, int y) { Render(g, equipment, x, y, true); }
private void GetMagicSpells(SlotHolder sh, List<MagicMenuEntry> list) { // First, add all the new magic spells. foreach (MateriaOrb m in sh.Slots) { if (m != null && m.Type == MateriaType.Magic) { foreach (string ability in m.Abilities) { Spell magicSpell = CurrentBattle.Seven.Data.GetMagicSpell(ability); if (!list.Any(x => x.Name == magicSpell.Name)) { list.Add(new MagicMenuEntry(magicSpell)); } } } } for (int i = 0; i < sh.Links; i++) { MateriaOrb left = sh.Slots[i * 2]; MateriaOrb right = sh.Slots[(i * 2) + 1]; if (left != null && right != null) { if (left.Type == MateriaType.Magic && right.Type == MateriaType.Support) { MateriaOrb temp = left; left = right; right = temp; } if (right.Type == MateriaType.Magic && left.Type == MateriaType.Support) { foreach (string ability in right.Abilities) { Spell magicSpell = CurrentBattle.Seven.Data.GetMagicSpell(ability); foreach (MagicMenuEntry entry in list.Where(x => x.Name == magicSpell.Name)) { entry.AddAbility(left); } } } } } }
private void GetSummons(SlotHolder sh, List<SummonMenuEntry> list) { // First, add all the new summons. foreach (MateriaOrb m in sh.Slots) { if (m != null && m.Type == MateriaType.Summon) { foreach (string ability in m.Abilities) { Spell summon = CurrentBattle.Seven.Data.GetSummonSpell(ability); if (!list.Any(x => x.Name == summon.Name)) { list.Add(new SummonMenuEntry(m.Name, summon)); } } } } // Then, go through and attach any support abilities for (int i = 0; i < sh.Links; i++) { MateriaOrb left = sh.Slots[i * 2]; MateriaOrb right = sh.Slots[(i * 2) + 1]; if (left != null && right != null) { if (left.Type == MateriaType.Summon && right.Type == MateriaType.Support) { MateriaOrb temp = left; left = right; right = temp; } if (right.Type == MateriaType.Summon && left.Type == MateriaType.Support) { foreach (string ability in right.Abilities) { Spell summon = CurrentBattle.Seven.Data.GetSummonSpell(ability); foreach (SummonMenuEntry entry in list.Where(x => x.Name == summon.Name)) { entry.AddAbility(left); } } } } } }
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; } }