Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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>();
            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);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 实施效果
        /// </summary>
        /// <param name="singleEffect"></param>
        /// <param name="game"></param>
        /// <param name="RandomSeed"></param>
        /// <returns></returns>
        public static List <string> RunSingleEffect(EffectDefine singleEffect, ActionStatus game, int RandomSeed)
        {
            List <string> Result  = new List <string>();
            List <string> PosList = SelectUtility.GetTargetList(singleEffect.AbliltyPosPicker, game, RandomSeed);

            foreach (string PosInfo in PosList)
            {
                var PosField  = PosInfo.Split(CardUtility.strSplitMark.ToCharArray());
                var strResult = string.Empty;
                if (PosField[0] == CardUtility.strMe)
                {
                    switch (int.Parse(PosField[1]))
                    {
                    case BattleFieldInfo.HeroPos:
                        Result.Add(GetEffectHandler(singleEffect, game, CardUtility.strMe + CardUtility.strSplitMark + BattleFieldInfo.HeroPos.ToString("D1")).DealHero(game, game.AllRole.MyPublicInfo));
                        break;

                    case BattleFieldInfo.AllMinionPos:
                        for (int i = 0; i < game.AllRole.MyPublicInfo.BattleField.MinionCount; i++)
                        {
                            Result.Add(GetEffectHandler(singleEffect, game, CardUtility.strMe + CardUtility.strSplitMark + (i + 1).ToString("D1")).DealMinion(game, game.AllRole.MyPublicInfo.BattleField.BattleMinions[i]));
                        }
                        break;

                    case BattleFieldInfo.AllRolePos:
                        Result.Add(GetEffectHandler(singleEffect, game, CardUtility.strMe + CardUtility.strSplitMark + BattleFieldInfo.HeroPos.ToString("D1")).DealHero(game, game.AllRole.MyPublicInfo));
                        for (int i = 0; i < game.AllRole.MyPublicInfo.BattleField.MinionCount; i++)
                        {
                            Result.Add(GetEffectHandler(singleEffect, game, CardUtility.strMe + CardUtility.strSplitMark + (i + 1).ToString("D1")).DealMinion(game, game.AllRole.MyPublicInfo.BattleField.BattleMinions[i]));
                        }
                        break;

                    default:
                        Result.Add(GetEffectHandler(singleEffect, game, PosInfo).DealMinion(game, game.AllRole.MyPublicInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1]));
                        break;
                    }
                }
                else
                {
                    switch (int.Parse(PosField[1]))
                    {
                    case BattleFieldInfo.HeroPos:
                        Result.Add(GetEffectHandler(singleEffect, game, CardUtility.strYou + CardUtility.strSplitMark + BattleFieldInfo.HeroPos.ToString("D1")).DealHero(game, game.AllRole.YourPublicInfo));
                        break;

                    case BattleFieldInfo.AllMinionPos:
                        for (int i = 0; i < game.AllRole.YourPublicInfo.BattleField.MinionCount; i++)
                        {
                            Result.Add(GetEffectHandler(singleEffect, game, CardUtility.strYou + CardUtility.strSplitMark + (i + 1).ToString("D1")).DealMinion(game, game.AllRole.YourPublicInfo.BattleField.BattleMinions[i]));
                        }
                        break;

                    case BattleFieldInfo.AllRolePos:
                        Result.Add(GetEffectHandler(singleEffect, game, CardUtility.strYou + CardUtility.strSplitMark + BattleFieldInfo.HeroPos.ToString("D1")).DealHero(game, game.AllRole.YourPublicInfo));
                        for (int i = 0; i < game.AllRole.YourPublicInfo.BattleField.MinionCount; i++)
                        {
                            Result.Add(GetEffectHandler(singleEffect, game, CardUtility.strYou + CardUtility.strSplitMark + (i + 1).ToString("D1")).DealMinion(game, game.AllRole.YourPublicInfo.BattleField.BattleMinions[i]));
                        }
                        break;

                    default:
                        Result.Add(GetEffectHandler(singleEffect, game, PosInfo).DealMinion(game, game.AllRole.YourPublicInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1]));
                        break;
                    }
                }
            }
            return(Result);
        }
Exemplo n.º 5
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);
        }