Exemplo n.º 1
0
        private List<ActionResult> SkillAttack(FightObject fighter, int level, GameConfig gc, int injuryType)
        {
            List<ActionResult> results = new List<ActionResult>();
            AttackDamage attack;
            AttackParameter par = new AttackParameter(gc, level);
            if (injuryType == 0)
            {
                attack = new AttackPhysical(fighter, par);
            }
            else
            {
                attack = new AttackMagic(fighter, par);
            }

            TargetType targetType = (TargetType)gc.Value.GetIntOrDefault("TargetType");
            if (targetType == TargetType.Single)
            {
                var targets = FilterTargets(fighter);
                if (targets.Count > 0)
                {
                    ActionResult result = Attack(attack, targets[0]);
                    results.Add(result);
                }
            }
            else
            {
                var targets = EnemyTargets(fighter, targetType, par);
                foreach (var v in targets)
                {
                    ActionResult result2 = Attack(attack, v, targets);
                    results.Add(result2);
                }
            }
            return results;
        }
Exemplo n.º 2
0
 /// <summary>
 ///  普通物理攻击
 /// </summary>
 /// <param name="fighter"></param>
 /// <param name="index"></param>
 /// <returns></returns>
 private bool AttackWuLi(FightObject fighter)
 {
     //获取被攻击的对象..
     var targets = FilterTargets(fighter);
     if (targets.Count > 0)
     {
         AttackPhysical attack = new AttackPhysical(fighter, null);
         ActionResult result = Attack(attack, targets[0]);
         fighter.Action.Result = new List<ActionResult>() { result };
         fighter.Action.FightCount = FightAction.HasAction;
         m_actions.Add(fighter.Action);
         return true;
     }
     return false;
 }