本文整理汇总了C#中Combatant.AddAction方法的典型用法代码示例。如果您正苦于以下问题:C# Combatant.AddAction方法的具体用法?C# Combatant.AddAction怎么用?C# Combatant.AddAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Combatant
的用法示例。
在下文中一共展示了Combatant.AddAction方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BattleAttack
private bool BattleAttack(Combatant c)
{
bool ok = false;
if(this.combatant is Enemy)
{
c.AddAction(new BattleAction(
AttackSelection.ATTACK, c, this.combatant.battleID, -1, 0));
ok = true;
}
return ok;
}
示例2: BattleItem
// battle
private bool BattleItem(int id, Combatant c)
{
bool ok = false;
Item item = DataHolder.Item(id);
if(item.useable && item.useInBattle)
{
if(item.TargetAlly() && this.combatant is Character)
{
if(item.TargetSingle())
{
c.AddAction(new BattleAction(
AttackSelection.ITEM, c, this.combatant.battleID, id, 0));
}
else if(item.TargetGroup())
{
c.AddAction(new BattleAction(
AttackSelection.ITEM, c, BattleAction.ALL_CHARACTERS, id, 0));
}
ok = true;
}
else if(item.TargetEnemy() && this.combatant is Enemy)
{
if(item.TargetSingle())
{
c.AddAction(new BattleAction(
AttackSelection.ITEM, c, this.combatant.battleID, id, 0));
}
else if(item.TargetGroup())
{
c.AddAction(new BattleAction(
AttackSelection.ITEM, c, BattleAction.ALL_ENEMIES, id, 0));
}
ok = true;
}
else if(item.TargetSelf() && this.combatant == c)
{
c.AddAction(new BattleAction(
AttackSelection.ITEM, c, c.battleID, id, 0));
ok = true;
}
}
return ok;
}
示例3: BattleSkill
private bool BattleSkill(int id, Combatant c, int ul)
{
bool ok = false;
Skill skill = DataHolder.Skill(id);
if(skill.useInBattle)
{
if(skill.TargetAlly() && this.combatant is Character)
{
if(skill.TargetSingle())
{
c.AddAction(new BattleAction(
AttackSelection.SKILL, c, this.combatant.battleID, id, ul));
}
else if(skill.TargetGroup())
{
c.AddAction(new BattleAction(
AttackSelection.SKILL, c, BattleAction.ALL_CHARACTERS, id, ul));
}
ok = true;
}
else if(skill.TargetEnemy() && this.combatant is Enemy)
{
if(skill.TargetSingle())
{
c.AddAction(new BattleAction(
AttackSelection.SKILL, c, this.combatant.battleID, id, ul));
}
else if(skill.TargetGroup())
{
c.AddAction(new BattleAction(
AttackSelection.SKILL, c, BattleAction.ALL_ENEMIES, id, ul));
}
ok = true;
}
else if(skill.TargetSelf() && this.combatant == c)
{
c.AddAction(new BattleAction(
AttackSelection.SKILL, c, c.battleID, id, ul));
ok = true;
}
}
return ok;
}