当前位置: 首页>>代码示例>>C#>>正文


C# Combatant.AddAction方法代码示例

本文整理汇总了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;
 }
开发者ID:hughrogers,项目名称:RPGQuest,代码行数:11,代码来源:CombatantClick.cs

示例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;
 }
开发者ID:hughrogers,项目名称:RPGQuest,代码行数:44,代码来源:CombatantClick.cs

示例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;
 }
开发者ID:hughrogers,项目名称:RPGQuest,代码行数:43,代码来源:CombatantClick.cs


注:本文中的Combatant.AddAction方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。