예제 #1
0
        /// <summary>
        /// 治疗
        /// </summary>
        /// <param name="singleEffect"></param>
        /// <param name="game"></param>
        /// <returns></returns>
        public static List <string> RunEffect(EffectDefine singleEffect, Client.GameManager game, List <String> PosList)
        {
            List <String> Result      = new List <string>();
            int           HealthPoint = singleEffect.ActualEffectPoint;

            //处理对象
            //ME#POS
            foreach (var PosInfo in PosList)
            {
                var PosField = PosInfo.Split(CardUtility.strSplitMark.ToCharArray());
                if (PosField[0] == CardUtility.strMe)
                {
                    if (PosField[1] == Card.Client.BattleFieldInfo.HeroPos.ToString())
                    {
                        game.MySelf.RoleInfo.HealthPoint += HealthPoint;
                        if (game.MySelf.RoleInfo.HealthPoint > PlayerBasicInfo.MaxHealthPoint)
                        {
                            game.MySelf.RoleInfo.HealthPoint = PlayerBasicInfo.MaxHealthPoint;
                        }
                        Result.Add(Card.Server.ActionCode.strHealth + Card.CardUtility.strSplitMark + PosInfo + Card.CardUtility.strSplitMark + game.MySelf.RoleInfo.HealthPoint.ToString());
                    }
                    else
                    {
                        //位置从1开始,数组从0开始
                        game.MySelf.RoleInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].实际生命值 += HealthPoint;
                        if (game.MySelf.RoleInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].实际生命值 > game.MySelf.RoleInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].实际生命值上限)
                        {
                            game.MySelf.RoleInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].实际生命值 = game.MySelf.RoleInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].实际生命值上限;
                        }
                        Result.Add(Card.Server.ActionCode.strHealth + Card.CardUtility.strSplitMark + PosInfo + Card.CardUtility.strSplitMark + game.MySelf.RoleInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].实际生命值.ToString());
                    }
                }
                else
                {
                    if (PosField[1] == Card.Client.BattleFieldInfo.HeroPos.ToString())
                    {
                        game.YourInfo.HealthPoint += HealthPoint;
                        if (game.YourInfo.HealthPoint > PlayerBasicInfo.MaxHealthPoint)
                        {
                            game.YourInfo.HealthPoint = PlayerBasicInfo.MaxHealthPoint;
                        }
                        Result.Add(Card.Server.ActionCode.strHealth + Card.CardUtility.strSplitMark + PosInfo + Card.CardUtility.strSplitMark + game.YourInfo.HealthPoint.ToString());
                    }
                    else
                    {
                        //位置从1开始,数组从0开始
                        game.YourInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].实际生命值 += HealthPoint;
                        if (game.YourInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].实际生命值 > game.YourInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].实际生命值上限)
                        {
                            game.YourInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].实际生命值 = game.YourInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].实际生命值上限;
                        }
                        Result.Add(Card.Server.ActionCode.strHealth + Card.CardUtility.strSplitMark + PosInfo + Card.CardUtility.strSplitMark + game.YourInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].实际生命值.ToString());
                    }
                }
            }
            return(Result);
        }
예제 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="singleEffect"></param>
        /// <param name="game"></param>
        /// <returns></returns>
        public static List <string> RunEffect(EffectDefine singleEffect, Client.GameManager game, List <String> PosList)
        {
            List <String> Result = new List <string>();

            //处理对象
            //ME#POS
            foreach (var PosInfo in PosList)
            {
                var PosField = PosInfo.Split(CardUtility.strSplitMark.ToCharArray());
                if (PosField[0] == CardUtility.strMe)
                {
                    if (PosField[1] == Card.Client.BattleFieldInfo.HeroPos.ToString())
                    {
                        switch (singleEffect.AddtionInfo)
                        {
                        case strFreeze:
                            game.MySelf.RoleInfo.冰冻状态 = CardUtility.EffectTurn.效果命中;
                            break;

                        default:
                            break;
                        }
                    }
                    else
                    {
                        //位置从1开始,数组从0开始
                        var myMinion = game.MySelf.RoleInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1];
                        RunStatusEffect(myMinion, singleEffect.AddtionInfo);
                    }
                }
                else
                {
                    if (PosField[1] == Card.Client.BattleFieldInfo.HeroPos.ToString())
                    {
                        switch (singleEffect.AddtionInfo)
                        {
                        case strFreeze:
                            game.YourInfo.冰冻状态 = CardUtility.EffectTurn.效果命中;
                            break;

                        default:
                            break;
                        }
                    }
                    else
                    {
                        //位置从1开始,数组从0开始
                        var yourMinion = game.YourInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1];
                        RunStatusEffect(yourMinion, singleEffect.AddtionInfo);
                    }
                }
                //STATUS#ME#1#FREEZE
                Result.Add(Card.Server.ActionCode.strStatus + Card.CardUtility.strSplitMark + PosInfo + Card.CardUtility.strSplitMark + singleEffect.AddtionInfo);
            }
            return(Result);
        }
예제 #3
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="singleEffect"></param>
 /// <param name="game"></param>
 /// <returns></returns>
 public static List<string> RunEffect(EffectDefine singleEffect, Client.GameManager game, List<String> PosList)
 {
     List<String> Result = new List<string>();
     //处理对象
     //ME#POS
     foreach (var PosInfo in PosList)
     {
         var PosField = PosInfo.Split(CardUtility.strSplitMark.ToCharArray());
         if (PosField[0] == CardUtility.strMe)
         {
             if (PosField[1] == Card.Client.BattleFieldInfo.HeroPos.ToString())
             {
                 switch (singleEffect.AddtionInfo)
                 {
                     case strFreeze:
                         game.MySelf.RoleInfo.冰冻状态 = CardUtility.EffectTurn.效果命中;
                         break;
                     default:
                         break;
                 }
             }
             else
             {
                 //位置从1开始,数组从0开始
                 var myMinion = game.MySelf.RoleInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1];
                 RunStatusEffect(myMinion, singleEffect.AddtionInfo);
             }
         }
         else
         {
             if (PosField[1] == Card.Client.BattleFieldInfo.HeroPos.ToString())
             {
                 switch (singleEffect.AddtionInfo)
                 {
                     case strFreeze:
                         game.YourInfo.冰冻状态 = CardUtility.EffectTurn.效果命中;
                         break;
                     default:
                         break;
                 }
             }
             else
             {
                 //位置从1开始,数组从0开始
                 var yourMinion = game.YourInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1];
                 RunStatusEffect(yourMinion, singleEffect.AddtionInfo);
             }
         }
         //STATUS#ME#1#FREEZE
         Result.Add(Card.Server.ActionCode.strStatus + Card.CardUtility.strSplitMark + PosInfo + Card.CardUtility.strSplitMark + singleEffect.AddtionInfo);
     }
     return Result;
 }
예제 #4
0
 public static List<string> RunEffect(EffectDefine singleEffect, Client.GameManager game, List<String> PosList)
 {
     List<String> Result = new List<string>();
     var PosField = PosList[0].Split(CardUtility.strSplitMark.ToCharArray());
     if (game.MySelf.RoleInfo.BattleField.MinionCount != Card.Client.BattleFieldInfo.MaxMinionCount)
     {
         game.MySelf.RoleInfo.BattleField.AppendToBattle(game.YourInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].深拷贝());
         game.YourInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1] = null;
         //CONTROL#1
         Result.Add(Card.Server.ActionCode.strControl + Card.CardUtility.strSplitMark + PosField[1]);
     }
     return Result;
 }
예제 #5
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="singleEffect"></param>
 /// <param name="game"></param>
 /// <param name="Pos"></param>
 /// <param name="Seed">随机数种子</param>
 /// <returns></returns>
 public static List<string> RunEffect(EffectDefine singleEffect, Client.GameManager game, CardUtility.TargetPosition Pos, int Seed)
 {
     List<String> PosList = Card.Effect.EffectDefine.GetTargetList(singleEffect, game, Pos, Seed);
     List<String> Result = new List<string>();
     int HealthPoint = singleEffect.ActualEffectPoint;
     //处理对象
     //ME#POS
     foreach (var PosInfo in PosList)
     {
         var PosField = PosInfo.Split(CardUtility.strSplitMark.ToCharArray());
         if (PosField[0] == CardUtility.strMe)
         {
             if (PosField[1] == "0")
             {
                 game.MySelf.RoleInfo.HealthPoint += HealthPoint;
                 if (game.MySelf.RoleInfo.HealthPoint > 30) game.MySelf.RoleInfo.HealthPoint = 30;
                 Result.Add(Card.Server.ActionCode.strHealth + Card.CardUtility.strSplitMark + PosInfo + Card.CardUtility.strSplitMark + game.MySelf.RoleInfo.HealthPoint.ToString());
             }
             else
             {
                 //位置从1开始,数组从0开始
                 game.MySelf.RoleInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].ActualHealthPoint += HealthPoint;
                 if (game.MySelf.RoleInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].ActualHealthPoint > game.MySelf.RoleInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].StandardHealthPoint)
                     game.MySelf.RoleInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].ActualHealthPoint = game.MySelf.RoleInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].StandardHealthPoint;
                 Result.Add(Card.Server.ActionCode.strHealth + Card.CardUtility.strSplitMark + PosInfo + Card.CardUtility.strSplitMark + game.MySelf.RoleInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].ActualHealthPoint.ToString());
             }
         }
         else
         {
             if (PosField[1] == "0")
             {
                 game.YourInfo.HealthPoint += HealthPoint;
                 if (game.YourInfo.HealthPoint > 30) game.YourInfo.HealthPoint = 30;
                 Result.Add(Card.Server.ActionCode.strHealth + Card.CardUtility.strSplitMark + PosInfo + Card.CardUtility.strSplitMark + game.YourInfo.HealthPoint.ToString());
             }
             else
             {
                 //位置从1开始,数组从0开始
                 game.YourInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].ActualHealthPoint += HealthPoint;
                 if (game.YourInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].ActualHealthPoint > game.YourInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].StandardHealthPoint)
                     game.YourInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].ActualHealthPoint = game.YourInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].StandardHealthPoint;
                 Result.Add(Card.Server.ActionCode.strHealth + Card.CardUtility.strSplitMark + PosInfo + Card.CardUtility.strSplitMark + game.YourInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].ActualHealthPoint.ToString());
             }
         }
     }
     return Result;
 }
예제 #6
0
 /// <summary>
 /// 治疗
 /// </summary>
 /// <param name="singleEffect"></param>
 /// <param name="game"></param>
 /// <returns></returns>
 public static List<string> RunEffect(EffectDefine singleEffect, Client.GameManager game, List<String> PosList)
 {
     List<String> Result = new List<string>();
     int HealthPoint = singleEffect.ActualEffectPoint;
     //处理对象
     //ME#POS
     foreach (var PosInfo in PosList)
     {
         var PosField = PosInfo.Split(CardUtility.strSplitMark.ToCharArray());
         if (PosField[0] == CardUtility.strMe)
         {
             if (PosField[1] == Card.Client.BattleFieldInfo.HeroPos.ToString())
             {
                 game.MySelf.RoleInfo.HealthPoint += HealthPoint;
                 if (game.MySelf.RoleInfo.HealthPoint > PlayerBasicInfo.MaxHealthPoint) game.MySelf.RoleInfo.HealthPoint = PlayerBasicInfo.MaxHealthPoint;
                 Result.Add(Card.Server.ActionCode.strHealth + Card.CardUtility.strSplitMark + PosInfo + Card.CardUtility.strSplitMark + game.MySelf.RoleInfo.HealthPoint.ToString());
             }
             else
             {
                 //位置从1开始,数组从0开始
                 game.MySelf.RoleInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].实际生命值 += HealthPoint;
                 if (game.MySelf.RoleInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].实际生命值 > game.MySelf.RoleInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].实际生命值上限)
                     game.MySelf.RoleInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].实际生命值 = game.MySelf.RoleInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].实际生命值上限;
                 Result.Add(Card.Server.ActionCode.strHealth + Card.CardUtility.strSplitMark + PosInfo + Card.CardUtility.strSplitMark + game.MySelf.RoleInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].实际生命值.ToString());
             }
         }
         else
         {
             if (PosField[1] == Card.Client.BattleFieldInfo.HeroPos.ToString())
             {
                 game.YourInfo.HealthPoint += HealthPoint;
                 if (game.YourInfo.HealthPoint > PlayerBasicInfo.MaxHealthPoint) game.YourInfo.HealthPoint = PlayerBasicInfo.MaxHealthPoint;
                 Result.Add(Card.Server.ActionCode.strHealth + Card.CardUtility.strSplitMark + PosInfo + Card.CardUtility.strSplitMark + game.YourInfo.HealthPoint.ToString());
             }
             else
             {
                 //位置从1开始,数组从0开始
                 game.YourInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].实际生命值 += HealthPoint;
                 if (game.YourInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].实际生命值 > game.YourInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].实际生命值上限)
                     game.YourInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].实际生命值 = game.YourInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].实际生命值上限;
                 Result.Add(Card.Server.ActionCode.strHealth + Card.CardUtility.strSplitMark + PosInfo + Card.CardUtility.strSplitMark + game.YourInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].实际生命值.ToString());
             }
         }
     }
     return Result;
 }
예제 #7
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="singleEffect"></param>
 /// <param name="game"></param>
 /// <param name="Seed"></param>
 /// <returns></returns>
 public static List<string> RunEffect(EffectDefine singleEffect, Client.GameManager game,int Seed)
 {
     List<String> Result = new List<string>();
     var MinionLst = singleEffect.AddtionInfo.Split(Card.CardUtility.strSplitMark.ToCharArray());
     Random random = new Random(DateTime.Now.Millisecond + Seed);
     var CardSN = MinionLst[random.Next(0,MinionLst.Length)];
     var Minion = Card.CardUtility.GetCardInfoBySN(CardSN);
     switch (singleEffect.SelectOpt.EffectTargetSelectDirect)
     {
         case CardUtility.TargetSelectDirectEnum.本方:
             if (game.MySelf.RoleInfo.BattleField.MinionCount < Card.Client.BattleFieldInfo.MaxMinionCount)
             {
                 game.MySelf.RoleInfo.BattleField.AppendToBattle(CardSN);
                 //SUMMON#YOU#M000001#POS
                 Result.Add(Card.Server.ActionCode.strSummon + Card.CardUtility.strSplitMark + Card.CardUtility.strMe +
                            Card.CardUtility.strSplitMark + CardSN + Card.CardUtility.strSplitMark + game.MySelf.RoleInfo.BattleField.MinionCount);
             }
             break;
         case CardUtility.TargetSelectDirectEnum.对方:
             if (game.YourInfo.BattleField.MinionCount < Card.Client.BattleFieldInfo.MaxMinionCount)
             {
                 game.YourInfo.BattleField.AppendToBattle(CardSN);
                 Result.Add(Card.Server.ActionCode.strSummon + Card.CardUtility.strSplitMark + Card.CardUtility.strYou +
                     Card.CardUtility.strSplitMark + CardSN + Card.CardUtility.strSplitMark + game.YourInfo.BattleField.MinionCount);
             }
             break;
         case CardUtility.TargetSelectDirectEnum.双方:
             if (game.MySelf.RoleInfo.BattleField.MinionCount < Card.Client.BattleFieldInfo.MaxMinionCount)
             {
                 game.MySelf.RoleInfo.BattleField.AppendToBattle(CardSN);
                 //SUMMON#YOU#M000001#POS
                 Result.Add(Card.Server.ActionCode.strSummon + Card.CardUtility.strSplitMark + Card.CardUtility.strMe +
                            Card.CardUtility.strSplitMark + CardSN + Card.CardUtility.strSplitMark + game.MySelf.RoleInfo.BattleField.MinionCount);
             }
             if (game.YourInfo.BattleField.MinionCount < Card.Client.BattleFieldInfo.MaxMinionCount)
             {
                 game.YourInfo.BattleField.AppendToBattle(CardSN);
                 Result.Add(Card.Server.ActionCode.strSummon + Card.CardUtility.strSplitMark + Card.CardUtility.strYou +
                     Card.CardUtility.strSplitMark + CardSN + Card.CardUtility.strSplitMark + game.YourInfo.BattleField.MinionCount);
             }
             break;
         default:
             break;
     }
     return Result;
 }
예제 #8
0
 public static List<string> RunEffect(EffectDefine singleEffect, GameManager game)
 {
     List<string> Result = new List<string>();
     switch (singleEffect.SelectOpt.EffectTargetSelectDirect)
     {
         case CardUtility.TargetSelectDirectEnum.本方:
             //#CARD#ME#M000001
             var drawCards = Card.Client.ClientRequest.DrawCard(game.GameId.ToString(GameServer.GameIdFormat), game.IsFirst, 1);
             if (drawCards.Count == 1)
             {
                 game.MySelf.handCards.Add(Card.CardUtility.GetCardInfoBySN(drawCards[0]));
                 game.MySelf.RoleInfo.HandCardCount++;
                 game.MySelf.RoleInfo.RemainCardDeckCount--;
                 Result.Add(ActionCode.strCard + CardUtility.strSplitMark + CardUtility.strMe);
             }
             break;
         case CardUtility.TargetSelectDirectEnum.对方:
             if (game.YourInfo.RemainCardDeckCount > 0)
             {
                 game.YourInfo.HandCardCount++;
                 game.YourInfo.RemainCardDeckCount--;
                 Result.Add(ActionCode.strCard + CardUtility.strSplitMark + CardUtility.strYou);
             }
             break;
         case CardUtility.TargetSelectDirectEnum.双方:
             var drawCardsT = Card.Client.ClientRequest.DrawCard(game.GameId.ToString(GameServer.GameIdFormat), game.IsFirst, 1);
             if (drawCardsT.Count == 1)
             {
                 game.MySelf.handCards.Add(Card.CardUtility.GetCardInfoBySN(drawCardsT[0]));
                 game.MySelf.RoleInfo.HandCardCount++;
                 game.MySelf.RoleInfo.RemainCardDeckCount--;
                 Result.Add(ActionCode.strCard + CardUtility.strSplitMark + CardUtility.strMe);
             }
             if (game.YourInfo.RemainCardDeckCount > 0)
             {
                 game.YourInfo.HandCardCount++;
                 game.YourInfo.RemainCardDeckCount--;
                 Result.Add(ActionCode.strCard + CardUtility.strSplitMark + CardUtility.strYou);
             }
             break;
         default:
             break;
     }
     return Result;
 }
예제 #9
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="singleEffect"></param>
 /// <param name="game"></param>
 /// <returns></returns>
 public static List<string> RunEffect(EffectDefine singleEffect, Client.GameManager game, CardUtility.TargetPosition Pos)
 {
     List<string> Result = new List<string>();
     var Summon = (Card.MinionCard)CardUtility.GetCardInfoBySN(singleEffect.AddtionInfo);
     //一定要初始化,不然的话,生命值是-1;
     Summon.Init();
     if (Pos.MeOrYou)
     {
         game.MySelf.RoleInfo.BattleField.BattleMinions[Pos.Postion - 1] = Summon;
         //TRANSFORM#ME#1#M9000001
         Result.Add(ActionCode.strTransform + Card.CardUtility.strSplitMark + CardUtility.strMe +
             Card.CardUtility.strSplitMark + Pos.Postion + Card.CardUtility.strSplitMark + singleEffect.AddtionInfo);
     }
     else
     {
         game.YourInfo.BattleField.BattleMinions[Pos.Postion - 1] = Summon;
         Result.Add(ActionCode.strTransform + Card.CardUtility.strSplitMark + CardUtility.strYou +
             Card.CardUtility.strSplitMark + Pos.Postion + Card.CardUtility.strSplitMark + singleEffect.AddtionInfo);
     }
     return Result;
 }
예제 #10
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="singleEffect"></param>
 /// <param name="game"></param>
 /// <returns></returns>
 public static List<string> RunEffect(EffectDefine singleEffect, Client.GameManager game, List<String> PosList)
 {
     List<String> Result = new List<string>();
     int AttackPoint = singleEffect.ActualEffectPoint;
     //处理对象
     foreach (var PosInfo in PosList)
     {
         var PosField = PosInfo.Split(CardUtility.strSplitMark.ToCharArray());
         if (PosField[0] == CardUtility.strMe)
         {
             //位置从1开始,数组从0开始
             RunPointEffect(game.MySelf.RoleInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1], singleEffect.AddtionInfo);
         }
         else
         {
             //位置从1开始,数组从0开始
             RunPointEffect(game.YourInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1], singleEffect.AddtionInfo);
         }
         Result.Add(Card.Server.ActionCode.strPoint + Card.CardUtility.strSplitMark + PosInfo + Card.CardUtility.strSplitMark + singleEffect.AddtionInfo);
     }
     return Result;
 }
예제 #11
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="singleEffect"></param>
        /// <param name="game"></param>
        /// <returns></returns>
        public static List <string> RunEffect(EffectDefine singleEffect, Client.GameManager game, CardUtility.TargetPosition Pos)
        {
            List <string> Result = new List <string>();
            var           Summon = (Card.MinionCard)CardUtility.GetCardInfoBySN(singleEffect.AddtionInfo);

            //一定要初始化,不然的话,生命值是-1;
            Summon.Init();
            if (Pos.MeOrYou)
            {
                game.MySelf.RoleInfo.BattleField.BattleMinions[Pos.Postion - 1] = Summon;
                //TRANSFORM#ME#1#M9000001
                Result.Add(ActionCode.strTransform + Card.CardUtility.strSplitMark + CardUtility.strMe +
                           Card.CardUtility.strSplitMark + Pos.Postion + Card.CardUtility.strSplitMark + singleEffect.AddtionInfo);
            }
            else
            {
                game.YourInfo.BattleField.BattleMinions[Pos.Postion - 1] = Summon;
                Result.Add(ActionCode.strTransform + Card.CardUtility.strSplitMark + CardUtility.strYou +
                           Card.CardUtility.strSplitMark + Pos.Postion + Card.CardUtility.strSplitMark + singleEffect.AddtionInfo);
            }
            return(Result);
        }
예제 #12
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="singleEffect"></param>
        /// <param name="game"></param>
        /// <returns></returns>
        public static List <string> RunEffect(EffectDefine singleEffect, Client.GameManager game, List <String> PosList)
        {
            List <String> Result      = new List <string>();
            int           AttackPoint = singleEffect.ActualEffectPoint;

            //处理对象
            foreach (var PosInfo in PosList)
            {
                var PosField = PosInfo.Split(CardUtility.strSplitMark.ToCharArray());
                if (PosField[0] == CardUtility.strMe)
                {
                    //位置从1开始,数组从0开始
                    RunPointEffect(game.MySelf.RoleInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1], singleEffect.AddtionInfo);
                }
                else
                {
                    //位置从1开始,数组从0开始
                    RunPointEffect(game.YourInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1], singleEffect.AddtionInfo);
                }
                Result.Add(Card.Server.ActionCode.strPoint + Card.CardUtility.strSplitMark + PosInfo + Card.CardUtility.strSplitMark + singleEffect.AddtionInfo);
            }
            return(Result);
        }
예제 #13
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="singleEffect"></param>
 /// <param name="game"></param>
 /// <param name="Pos"></param>
 /// <param name="Seed">随机数种子</param>
 /// <returns></returns>
 public static List<string> RunEffect(EffectDefine singleEffect, Client.GameManager game, CardUtility.TargetPosition Pos, int Seed)
 {
     List<String> PosList = Card.Effect.EffectDefine.GetTargetList(singleEffect, game, Pos, Seed);
     List<String> Result = new List<string>();
     int AttackPoint = singleEffect.ActualEffectPoint;
     //处理对象
     //ME#POS
     foreach (var PosInfo in PosList)
     {
         var PosField = PosInfo.Split(CardUtility.strSplitMark.ToCharArray());
         if (PosField[0] == CardUtility.strMe)
         {
             if (PosField[1] == "0")
             {
                 switch (singleEffect.AddtionInfo)
                 {
                     case strFreeze:
                         game.MySelf.RoleInfo.冰冻状态 = CardUtility.EffectTurn.效果命中;
                         break;
                     default:
                         break;
                 }
             }
             else
             {
                 //位置从1开始,数组从0开始
                 switch (singleEffect.AddtionInfo)
                 {
                     case strFreeze:
                         game.MySelf.RoleInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].冰冻状态 = CardUtility.EffectTurn.效果命中;
                         break;
                     default:
                         break;
                 }
             }
         }
         else
         {
             if (PosField[1] == "0")
             {
                 switch (singleEffect.AddtionInfo)
                 {
                     case strFreeze:
                         game.YourInfo.冰冻状态 = CardUtility.EffectTurn.效果命中;
                         break;
                     default:
                         break;
                 }
             }
             else
             {
                 //位置从1开始,数组从0开始
                 switch (singleEffect.AddtionInfo)
                 {
                     case strFreeze:
                         game.YourInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].冰冻状态 = CardUtility.EffectTurn.效果命中;
                         break;
                     default:
                         break;
                 }
             }
         }
         //STATUS#ME#1#FREEZE
         Result.Add(Card.Server.ActionCode.strStatus + Card.CardUtility.strSplitMark + PosInfo + Card.CardUtility.strSplitMark + strFreeze);
     }
     return Result;
 }
예제 #14
0
 /// <summary>
 /// 对法力水晶的法术实施
 /// </summary>
 /// <param name="role"></param>
 /// <param name="Ability"></param>
 public static List<string> RunEffect(EffectDefine singleEffect, GameManager game)
 {
     List<string> Result = new List<string>();
     string[] Op = singleEffect.AddtionInfo.Split("/".ToCharArray());
     int point = 0;
     //±N/±N	增加减少 可用水晶 / 增加减少 空水晶
     //可用水晶
     if (Op[0].Substring(1, 1) != "0")
     {
         point = int.Parse(Op[0].Substring(1, 1));
         if (Op[0].Substring(0, 1) == "+")
         {
             for (int i = 0; i < point; i++)
             {
                 if (singleEffect.EffectTargetSelectDirect == CardUtility.TargetSelectDirectEnum.本方)
                 {
                     game.MySelf.RoleInfo.crystal.AddCurrentPoint();
                 }
                 else
                 {
                     game.YourInfo.crystal.AddCurrentPoint();
                 }
             }
         }
         else
         {
             for (int i = 0; i < point; i++)
             {
                 if (singleEffect.EffectTargetSelectDirect == CardUtility.TargetSelectDirectEnum.本方)
                 {
                     game.MySelf.RoleInfo.crystal.ReduceCurrentPoint();
                 }
                 else
                 {
                     game.YourInfo.crystal.ReduceCurrentPoint();
                 }
             }
         }
     }
     //空水晶
     if (Op[1].Substring(1, 1) != "0")
     {
         point = int.Parse(Op[1].Substring(1, 1));
         if (Op[1].Substring(0, 1) == "+")
         {
             for (int i = 0; i < point; i++)
             {
                 if (singleEffect.EffectTargetSelectDirect == CardUtility.TargetSelectDirectEnum.本方)
                 {
                     game.MySelf.RoleInfo.crystal.AddFullPoint();
                 }
                 else
                 {
                     game.YourInfo.crystal.AddFullPoint();
                 }
             }
         }
         else
         {
             for (int i = 0; i < point; i++)
             {
                 if (singleEffect.EffectTargetSelectDirect == CardUtility.TargetSelectDirectEnum.本方)
                 {
                     game.MySelf.RoleInfo.crystal.ReduceFullPoint();
                 }
                 else
                 {
                     game.YourInfo.crystal.ReduceFullPoint();
                 }
             }
         }
     }
     //Crystal#ME#4#4
     if (singleEffect.EffectTargetSelectDirect == CardUtility.TargetSelectDirectEnum.本方)
     {
         Result.Add(ActionCode.strCrystal + CardUtility.strSplitMark + CardUtility.strMe + CardUtility.strSplitMark + game.MySelf.RoleInfo.crystal.CurrentRemainPoint + CardUtility.strSplitMark + game.MySelf.RoleInfo.crystal.CurrentFullPoint);
     }
     else
     {
         Result.Add(ActionCode.strCrystal + CardUtility.strSplitMark + CardUtility.strYou + CardUtility.strSplitMark + game.YourInfo.crystal.CurrentRemainPoint + CardUtility.strSplitMark + game.YourInfo.crystal.CurrentFullPoint);
     }
     return Result;
 }
예제 #15
0
 /// <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>();
     //切记,这里的EffectCount都是1
     switch (singleEffect.AbilityEffectType)
     {
         case AbilityEffectEnum.攻击:
             Result.AddRange(AttackEffect.RunEffect(singleEffect, game, Pos, Seed));
             break;
         case AbilityEffectEnum.回复:
             Result.AddRange(HealthEffect.RunEffect(singleEffect, game, Pos, Seed));
             break;
         case AbilityEffectEnum.状态:
             Result.AddRange(StatusEffect.RunEffect(singleEffect, game, Pos, Seed));
             break;
         case AbilityEffectEnum.召唤:
             Result.AddRange(SummonEffect.RunEffect(singleEffect, game, Seed));
             break;
         case AbilityEffectEnum.增益:
             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.奥秘:
             break;
         default:
             break;
     }
     return Result;
 }
예제 #16
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="singleEffect"></param>
        /// <param name="game"></param>
        /// <param name="Pos"></param>
        /// <param name="Seed"></param>
        /// <returns></returns>
        public static List<string> GetTargetList(EffectDefine singleEffect, Client.GameManager game, CardUtility.TargetPosition Pos, int Seed)
        {
            //切记,这里的EffectCount都是1
            List<string> Result = new List<string>();
            switch (singleEffect.EffictTargetSelectMode)
            {
                case CardUtility.TargetSelectModeEnum.随机:
                    Random t = new Random(DateTime.Now.Millisecond + Seed);
                    switch (singleEffect.EffectTargetSelectDirect)
                    {
                        case CardUtility.TargetSelectDirectEnum.本方:
                            switch (singleEffect.EffectTargetSelectRole)
                            {
                                case CardUtility.TargetSelectRoleEnum.随从:
                                    Pos.Postion = t.Next(1, game.MySelf.RoleInfo.BattleField.MinionCount + 1);
                                    Pos.MeOrYou = true;
                                    break;
                                case CardUtility.TargetSelectRoleEnum.所有角色:
                                    Pos.Postion = t.Next(0, game.MySelf.RoleInfo.BattleField.MinionCount + 1);
                                    Pos.MeOrYou = true;
                                    break;
                            }
                            //ME#POS
                            Result.Add(CardUtility.strMe + CardUtility.strSplitMark + Pos.Postion.ToString("D1"));
                            break;
                        case CardUtility.TargetSelectDirectEnum.对方:
                            switch (singleEffect.EffectTargetSelectRole)
                            {
                                case CardUtility.TargetSelectRoleEnum.随从:
                                    Pos.Postion = t.Next(1, game.YourInfo.BattleField.MinionCount + 1);
                                    Pos.MeOrYou = false;
                                    break;
                                case CardUtility.TargetSelectRoleEnum.所有角色:
                                    Pos.Postion = t.Next(0, game.YourInfo.BattleField.MinionCount + 1);
                                    Pos.MeOrYou = false;
                                    break;
                            }
                            //ME#POS
                            Result.Add(CardUtility.strYou + CardUtility.strSplitMark + Pos.Postion.ToString("D1"));
                            break;
                        case CardUtility.TargetSelectDirectEnum.双方:
                            //本方对方
                            int MinionCount;
                            if (t.Next(1, 3) == 1)
                            {
                                Pos.MeOrYou = true;
                                MinionCount = game.MySelf.RoleInfo.BattleField.MinionCount;
                            }
                            else
                            {
                                Pos.MeOrYou = false;
                                MinionCount = game.YourInfo.BattleField.MinionCount;
                            }
                            switch (singleEffect.EffectTargetSelectRole)
                            {
                                case CardUtility.TargetSelectRoleEnum.随从:
                                    Pos.Postion = t.Next(1, MinionCount + 1);
                                    break;
                                case CardUtility.TargetSelectRoleEnum.所有角色:
                                    Pos.Postion = t.Next(0, MinionCount + 1);
                                    break;
                            }
                            //ME#POS
                            Result.Add((Pos.MeOrYou ? CardUtility.strMe : CardUtility.strYou) + CardUtility.strSplitMark + Pos.Postion.ToString("D1"));
                            break;
                        default:
                            break;
                    }
                    break;
                case CardUtility.TargetSelectModeEnum.全体:
                    switch (singleEffect.EffectTargetSelectDirect)
                    {
                        case CardUtility.TargetSelectDirectEnum.本方:
                            switch (singleEffect.EffectTargetSelectRole)
                            {
                                case CardUtility.TargetSelectRoleEnum.随从:
                                    for (int i = 0; i < game.MySelf.RoleInfo.BattleField.MinionCount; i++)
                                    {
                                        Result.Add(CardUtility.strMe + CardUtility.strSplitMark + (i + 1).ToString("D1"));
                                    }
                                    break;
                                case CardUtility.TargetSelectRoleEnum.英雄:
                                    Result.Add(CardUtility.strMe + CardUtility.strSplitMark + 0.ToString("D1"));
                                    break;
                                case CardUtility.TargetSelectRoleEnum.所有角色:
                                    Result.Add(CardUtility.strMe + CardUtility.strSplitMark + 0.ToString("D1"));
                                    for (int i = 0; i < game.MySelf.RoleInfo.BattleField.MinionCount; i++)
                                    {
                                        Result.Add(CardUtility.strMe + CardUtility.strSplitMark + (i + 1).ToString("D1"));
                                    }
                                    break;
                            }
                            break;
                        case CardUtility.TargetSelectDirectEnum.对方:
                            switch (singleEffect.EffectTargetSelectRole)
                            {
                                case CardUtility.TargetSelectRoleEnum.随从:
                                    for (int i = 0; i < game.YourInfo.BattleField.MinionCount; i++)
                                    {
                                        Result.Add(CardUtility.strYou + CardUtility.strSplitMark + (i + 1).ToString("D1"));
                                    }
                                    break;
                                case CardUtility.TargetSelectRoleEnum.英雄:
                                    Result.Add(CardUtility.strYou + CardUtility.strSplitMark + 0.ToString("D1"));
                                    break;
                                case CardUtility.TargetSelectRoleEnum.所有角色:
                                    Result.Add(CardUtility.strYou + CardUtility.strSplitMark + 0.ToString("D1"));
                                    for (int i = 0; i < game.YourInfo.BattleField.MinionCount; i++)
                                    {
                                        Result.Add(CardUtility.strYou + CardUtility.strSplitMark + (i + 1).ToString("D1"));
                                    }
                                    break;
                            }
                            break;
                        case CardUtility.TargetSelectDirectEnum.双方:
                            switch (singleEffect.EffectTargetSelectRole)
                            {
                                case CardUtility.TargetSelectRoleEnum.随从:
                                    for (int i = 0; i < game.MySelf.RoleInfo.BattleField.MinionCount; i++)
                                    {
                                        Result.Add(CardUtility.strMe + CardUtility.strSplitMark + (i + 1).ToString("D1"));
                                    }
                                    for (int i = 0; i < game.YourInfo.BattleField.MinionCount; i++)
                                    {
                                        Result.Add(CardUtility.strYou + CardUtility.strSplitMark + (i + 1).ToString("D1"));
                                    }
                                    break;
                                case CardUtility.TargetSelectRoleEnum.英雄:
                                    Result.Add(CardUtility.strMe + CardUtility.strSplitMark + 0.ToString("D1"));
                                    Result.Add(CardUtility.strYou + CardUtility.strSplitMark + 0.ToString("D1"));
                                    break;
                                case CardUtility.TargetSelectRoleEnum.所有角色:
                                    Result.Add(CardUtility.strMe + CardUtility.strSplitMark + 0.ToString("D1"));
                                    Result.Add(CardUtility.strYou + CardUtility.strSplitMark + 0.ToString("D1"));
                                    for (int i = 0; i < game.MySelf.RoleInfo.BattleField.MinionCount; i++)
                                    {
                                        Result.Add(CardUtility.strMe + CardUtility.strSplitMark + (i + 1).ToString("D1"));
                                    }
                                    for (int i = 0; i < game.YourInfo.BattleField.MinionCount; i++)
                                    {
                                        Result.Add(CardUtility.strYou + CardUtility.strSplitMark + (i + 1).ToString("D1"));
                                    }
                                    break;
                            }
                            break;
                    }
                    break;
                case CardUtility.TargetSelectModeEnum.指定:
                    Result.Add((Pos.MeOrYou ? CardUtility.strMe : CardUtility.strYou) + CardUtility.strSplitMark + Pos.Postion.ToString("D1"));
                    break;
                case CardUtility.TargetSelectModeEnum.不用选择:
                    if (singleEffect.EffectTargetSelectRole == CardUtility.TargetSelectRoleEnum.英雄){
                        switch (singleEffect.EffectTargetSelectDirect)
                        {
                            case CardUtility.TargetSelectDirectEnum.本方:
                                Result.Add(CardUtility.strMe + CardUtility.strSplitMark + 0.ToString("D1"));
                                break;
                            case CardUtility.TargetSelectDirectEnum.对方:
                                Result.Add(CardUtility.strYou + CardUtility.strSplitMark + 0.ToString("D1"));
                                break;
                            case CardUtility.TargetSelectDirectEnum.双方:
                                Result.Add(CardUtility.strMe + CardUtility.strSplitMark + 0.ToString("D1"));
                                Result.Add(CardUtility.strYou + CardUtility.strSplitMark + 0.ToString("D1"));
                                break;
                            default:
                                break;
                        }

                    }
                    break;
            }
            return Result;
        }
예제 #17
0
        /// <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);
        }