/// <summary> /// 实施效果 /// </summary> /// <param name="singleEffect">效果</param> /// <param name="Field"></param> /// <param name="Pos">指定对象</param> /// <returns></returns> public static List <String> RunSingleEffect(EffectDefine singleEffect, Card.Client.GameManager game, Card.CardUtility.TargetPosition Pos, int Seed) { List <String> Result = new List <string>(); List <String> PosList = Card.Effect.EffectDefine.GetTargetList(singleEffect, game, Pos, Seed); //切记,这里的EffectCount都是1 switch (singleEffect.AbilityEffectType) { case AbilityEffectEnum.攻击: Result.AddRange(AttackEffect.RunEffect(singleEffect, game, PosList)); break; case AbilityEffectEnum.回复: Result.AddRange(HealthEffect.RunEffect(singleEffect, game, PosList)); break; case AbilityEffectEnum.状态: Result.AddRange(StatusEffect.RunEffect(singleEffect, game, PosList)); break; case AbilityEffectEnum.召唤: Result.AddRange(SummonEffect.RunEffect(singleEffect, game, Seed)); break; case AbilityEffectEnum.点数: Result.AddRange(PointEffect.RunEffect(singleEffect, game, PosList)); break; case AbilityEffectEnum.卡牌: Result.AddRange(CardEffect.RunEffect(singleEffect, game)); break; case AbilityEffectEnum.变形: Result.AddRange(TransformEffect.RunEffect(singleEffect, game, Pos)); break; case AbilityEffectEnum.水晶: Result.AddRange(CrystalEffect.RunEffect(singleEffect, game)); break; case AbilityEffectEnum.控制: Result.AddRange(ControlEffect.RunEffect(singleEffect, game, PosList)); break; case AbilityEffectEnum.奥秘: break; default: break; } return(Result); }
/// <summary> /// /// </summary> /// <param name="singleEffect"></param> /// <param name="game"></param> /// <param name="PosList"></param> /// <returns></returns> public static List <String> RunNormalSingleEffect(EffectDefine singleEffect, Client.GameManager game, List <String> PosList) { List <String> Result = new List <string>(); String strResult = String.Empty; String strEffect = String.Empty; IEffectHandler handler = new AttackEffect(); switch (singleEffect.AbilityEffectType) { case Card.Effect.EffectDefine.AbilityEffectEnum.攻击: handler = new AttackEffect(); strResult = Card.Server.ActionCode.strAttack; strEffect = singleEffect.ActualEffectPoint.ToString(); break; case Card.Effect.EffectDefine.AbilityEffectEnum.回复: handler = new HealthEffect(); strResult = Card.Server.ActionCode.strHealth; strEffect = singleEffect.ActualEffectPoint.ToString() + CardUtility.strSplitMark + singleEffect.AdditionInfo; break; case Card.Effect.EffectDefine.AbilityEffectEnum.状态: handler = new StatusEffect(); strResult = Card.Server.ActionCode.strStatus; strEffect = singleEffect.AdditionInfo; break; case Card.Effect.EffectDefine.AbilityEffectEnum.点数: handler = new PointEffect(); strResult = Card.Server.ActionCode.strPoint; strEffect = singleEffect.AdditionInfo + CardUtility.strSplitMark + singleEffect.StandardEffectPoint; break; case Card.Effect.EffectDefine.AbilityEffectEnum.变形: handler = new TransformEffect(); strResult = Card.Server.ActionCode.strTransform; strEffect = singleEffect.AdditionInfo; break; } strResult += Card.CardUtility.strSplitMark; foreach (var PosInfo in PosList) { var PosField = PosInfo.Split(CardUtility.strSplitMark.ToCharArray()); if (PosField[0] == CardUtility.strMe) { strResult += CardUtility.strMe + Card.CardUtility.strSplitMark; switch (int.Parse(PosField[1])) { case Card.Client.BattleFieldInfo.HeroPos: handler.DealHero(game, singleEffect, true); strResult += Card.Client.BattleFieldInfo.HeroPos.ToString(); break; case Card.Client.BattleFieldInfo.AllPos: for (int i = 0; i < game.MyInfo.BattleField.MinionCount; i++) { handler.DealMinion(game, singleEffect, true, i); } strResult += Card.Client.BattleFieldInfo.AllPos.ToString(); break; default: handler.DealMinion(game, singleEffect, true, int.Parse(PosField[1]) - 1); strResult += PosField[1]; break; } } else { strResult += CardUtility.strYou + Card.CardUtility.strSplitMark; switch (int.Parse(PosField[1])) { case Card.Client.BattleFieldInfo.HeroPos: handler.DealHero(game, singleEffect, false); strResult += Card.Client.BattleFieldInfo.HeroPos.ToString(); break; case Card.Client.BattleFieldInfo.AllPos: for (int i = 0; i < game.YourInfo.BattleField.MinionCount; i++) { handler.DealMinion(game, singleEffect, false, i); } strResult += Card.Client.BattleFieldInfo.AllPos.ToString(); break; default: handler.DealMinion(game, singleEffect, false, int.Parse(PosField[1]) - 1); strResult += PosField[1]; break; } } strResult += Card.CardUtility.strSplitMark + strEffect; Result.Add(strResult); } return(Result); }