public Main(SevenBattleState battleState, EnemySkillMateria esm, Menu.ScreenState screenState) : base(5, screenState.Height * 7 / 10 + 20, screenState.Width * 3 / 4, (screenState.Height * 5 / 20) - 25) { BattleState = battleState; int enemySkillCount = battleState.Seven.Data.EnemySkillCount; _totalRows = (enemySkillCount / COLUMNS) + ((enemySkillCount % COLUMNS == 0) ? 0 : 1); _spells = new Spell[_totalRows, COLUMNS]; for (int i = 0; i < enemySkillCount; i++) { if (((esm.AP >> i) & 1) > 0) { Spell s = battleState.Seven.Data.GetEnemySkill(esm.Abilities.ElementAt(i)); _spells[s.Order / COLUMNS, s.Order % COLUMNS] = s; } } Reset(); }
public static EnemySkillMateria Merge(EnemySkillMateria[] orbs) { if (orbs.Length == 0) { throw new ImplementationException("Cannot merge zero enemy skill materias."); } EnemySkillMateria merged = orbs[0]; for (int i = 1; i < orbs.Length; i++) { merged.AP |= orbs[i].AP; } return(merged); }
public static EnemySkillMateria Merge(EnemySkillMateria[] orbs) { if (orbs.Length == 0) { throw new ImplementationException("Cannot merge zero enemy skill materias."); } EnemySkillMateria merged = orbs[0]; for (int i = 1; i < orbs.Length; i++) { merged.AP |= orbs[i].AP; } return merged; }
public MateriaOrb GetMateria(string name, int ap) { MateriaOrb materia = null; if (name == EnemySkillMateria.NAME) { materia = new EnemySkillMateria(ap, this); } else if (name == "Master Magic") { materia = new MasterMateria(MateriaType.Magic, this); } else if (name == "Master Command") { materia = new MasterMateria(MateriaType.Command, this); } else if (name == "Master Summon") { materia = new MasterMateria(MateriaType.Summon, this); } else { XmlDocument gamedata = Resource.GetXmlFromResource("data.materia.xml", Assembly); XmlNode node = gamedata.SelectSingleNode(String.Format("//materia[name = '{0}']", name)); if (node == null) { throw new GameDataException("Could not find materia with name " + name); } materia = new MateriaOrb(node, Lua); materia.AddAP(ap); } return materia; }