public void SelectTargetWindows(Kernel_bin.Magic_Data c) { Kernel_bin.Target t = c.Target; SelectTargetWindows(t); Command = Kernel_bin.BattleCommands[2]; Magic = c; }
public void SelectTargetWindows(Kernel_bin.Battle_Commands c) { Kernel_bin.Target t = c.Target; SelectTargetWindows(t); Command = c; Magic = null; BlueMagic = null; }
protected Dictionary <T, byte> getTotal <T>(out Enum[] availableFlagsarray, byte max, Kernel_bin.Stat stat, params byte[] spells) where T : Enum { const int maxspellcount = 100; Dictionary <T, byte> total = new Dictionary <T, byte>(8); IEnumerable <Enum> availableFlags = Enum.GetValues(typeof(T)).Cast <Enum>(); foreach (Enum flag in availableFlags.Where(d => !total.ContainsKey((T)d))) { total.Add((T)flag, 0); } for (int i = 0; i < spells.Length; i++) { Enum flags = null; byte spell = spells[i]; Kernel_bin.Magic_Data magic_Data = Kernel_bin.MagicData[spell]; switch (stat) { case Kernel_bin.Stat.EL_Atk: flags = magic_Data.EL_Atk; break; case Kernel_bin.Stat.EL_Def_1: case Kernel_bin.Stat.EL_Def_2: case Kernel_bin.Stat.EL_Def_3: case Kernel_bin.Stat.EL_Def_4: flags = magic_Data.EL_Def; break; case Kernel_bin.Stat.ST_Atk: flags = magic_Data.ST_Atk; break; case Kernel_bin.Stat.ST_Def_1: case Kernel_bin.Stat.ST_Def_2: case Kernel_bin.Stat.ST_Def_3: case Kernel_bin.Stat.ST_Def_4: flags = magic_Data.ST_Def; break; } if (flags != null && Damageable.GetCharacterData(out Saves.CharacterData c)) { foreach (Enum flag in availableFlags.Where(flags.HasFlag)) { if (c.Magics.TryGetByKey(spell, out byte count) && magic_Data.J_Val.TryGetValue(stat, out byte value)) { int t = total[(T)flag] + (value * count / maxspellcount); total[(T)flag] = (byte)MathHelper.Clamp(t, 0, max); } } } else { throw new Exception($"Unknown stat, {stat}"); } } availableFlagsarray = availableFlags.ToArray(); return(total); }
private void addMagic(ref int pos, Kernel_bin.Magic_Data spell, Font.ColorID color = Font.ColorID.White) { if (color == Font.ColorID.White && Source.Stat_J.ContainsValue(spell.ID)) { //spell is junctioned color = Font.ColorID.Grey; } ITEM[pos, 0] = new IGMDataItem_String(spell.Name, SIZE[pos], color); ITEM[pos, 1] = color != Font.ColorID.White ? new IGMDataItem_Icon(Icons.ID.JunctionSYM, new Rectangle(SIZE[pos].X + SIZE[pos].Width - 75, SIZE[pos].Y, 0, 0)) : null; ITEM[pos, 2] = new IGMDataItem_Int(Source.Magics[spell.ID], new Rectangle(SIZE[pos].X + SIZE[pos].Width - 50, SIZE[pos].Y, 0, 0), spaces: 3); BLANKS[pos] = color == Font.ColorID.Dark_Gray ? true : false; Contents[pos] = spell.ID; pos++; }
private void addMagic(ref int pos, Kernel_bin.Magic_Data spell, Font.ColorID color = @default) { bool j = false; if (color == @default && Source.Stat_J.ContainsValue(spell.ID)) { //spell is junctioned if (!Battle) { color = junctioned; } j = true; } ITEM[pos, 0] = new IGMDataItem_String(spell.Name, SIZE[pos], color); ITEM[pos, 1] = j ? new IGMDataItem_Icon(Icons.ID.JunctionSYM, new Rectangle(SIZE[pos].X + SIZE[pos].Width - 75, SIZE[pos].Y, 0, 0)) : null; ITEM[pos, 2] = new IGMDataItem_Int(Source.Magics[spell.ID], new Rectangle(SIZE[pos].X + SIZE[pos].Width - 50, SIZE[pos].Y, 0, 0), spaces: 3); //makes it so you cannot junction a magic to a stat that does nothing. BLANKS[pos] = color == nostat ? true : false; Contents[pos] = spell.ID; pos++; }