public BattleMenuItem[] GetTargetMenuList(BattleMenuItem bmi, Character character)
{
BattleMenuItem[] list = new BattleMenuItem[0];
if(this.addBack && this.backFirst)
{
list = ArrayHelper.Add(this.GetBackItem(), list);
}
if(bmi.type == BattleMenu.ATTACK)
{
for(int i=0; i<DataHolder.BattleSystem().enemies.Length; i++)
{
Enemy e = DataHolder.BattleSystem().enemies[i];
list = ArrayHelper.Add(new BattleMenuItem(e.GetContent(), -1, BattleMenu.ATTACK, true, "",
new BattleAction(AttackSelection.ATTACK, character, e.battleID, -1, bmi.useLevel)), list);
}
}
else if(bmi.type == BattleMenu.SKILL)
{
Skill s = DataHolder.Skill(bmi.id);
if(s.TargetSingleAlly())
{
Character[] party = GameHandler.Party().GetBattleParty();
for(int i=0; i<party.Length; i++)
{
list = ArrayHelper.Add(new BattleMenuItem(party[i].GetContent(),
-1, BattleMenu.SKILL, true, "", new BattleAction(AttackSelection.SKILL, character,
party[i].battleID, bmi.id, bmi.useLevel)), list);
}
}
else if(s.TargetSingleEnemy())
{
for(int i=0; i<DataHolder.BattleSystem().enemies.Length; i++)
{
Enemy e = DataHolder.BattleSystem().enemies[i];
list = ArrayHelper.Add(new BattleMenuItem(e.GetContent(),
-1, BattleMenu.SKILL, true, "", new BattleAction(AttackSelection.SKILL, character,
e.battleID, bmi.id, bmi.useLevel)), list);
}
}
else if(s.TargetAllyGroup())
{
list = ArrayHelper.Add(new BattleMenuItem(new GUIContent(DataHolder.BattleSystemData().GetAllAlliesText()),
-1, BattleMenu.SKILL, true, "", new BattleAction(AttackSelection.SKILL, character,
BattleAction.ALL_CHARACTERS, bmi.id, bmi.useLevel)), list);
}
else if(s.TargetEnemyGroup())
{
list = ArrayHelper.Add(new BattleMenuItem(new GUIContent(DataHolder.BattleSystemData().GetAllEnemiesText()),
-1, BattleMenu.SKILL, true, "", new BattleAction(AttackSelection.SKILL, character,
BattleAction.ALL_ENEMIES, bmi.id, bmi.useLevel)), list);
}
}
else if(bmi.type == BattleMenu.ITEM)
{
Item it = DataHolder.Item(bmi.id);
if(it.TargetSingleAlly())
{
Character[] party = GameHandler.Party().GetBattleParty();
for(int i=0; i<party.Length; i++)
{
list = ArrayHelper.Add(new BattleMenuItem(party[i].GetContent(),
-1, BattleMenu.ITEM, true, "", new BattleAction(AttackSelection.ITEM, character,
party[i].battleID, bmi.id, bmi.useLevel)), list);
}
}
else if(it.TargetSingleEnemy())
{
for(int i=0; i<DataHolder.BattleSystem().enemies.Length; i++)
{
Enemy e = DataHolder.BattleSystem().enemies[i];
list = ArrayHelper.Add(new BattleMenuItem(e.GetContent(),
-1, BattleMenu.ITEM, true, "", new BattleAction(AttackSelection.ITEM, character,
e.battleID, bmi.id, bmi.useLevel)), list);
}
}
else if(it.TargetAllyGroup())
{
list = ArrayHelper.Add(new BattleMenuItem(new GUIContent("All allies"), -1, BattleMenu.ITEM, true, "",
new BattleAction(AttackSelection.ITEM, character,
BattleAction.ALL_CHARACTERS, bmi.id, bmi.useLevel)), list);
}
else if(it.TargetEnemyGroup())
{
list = ArrayHelper.Add(new BattleMenuItem(new GUIContent("All enemies"), -1, BattleMenu.ITEM, true, "",
new BattleAction(AttackSelection.ITEM, character,
BattleAction.ALL_ENEMIES, bmi.id, bmi.useLevel)), list);
}
}
if(this.addBack && !this.backFirst)
{
list = ArrayHelper.Add(this.GetBackItem(), list);
}
return list;
}