예제 #1
0
        /// <summary>
        /// 获得一个动作
        /// </summary>
        /// <param name="gameStatus"></param>
        /// <returns></returns>
        public static void GetAction(ActionStatus gameStatus)
        {
            String        Action       = String.Empty;
            PublicInfo    PlayInfo     = gameStatus.AllRole.MyPublicInfo;
            PrivateInfo   PlaySelfInfo = gameStatus.AllRole.MyPrivateInfo;
            List <String> Result       = new List <string>();

            //优先使用技能
            if (PlayInfo.IsHeroSkillEnable(true))
            {
                //召唤
                if (PlayInfo.Hero.HeroSkill.FirstAbilityDefine.MainAbilityDefine.TrueAtomicEffect.AtomicEffectType ==
                    Effect.AtomicEffectDefine.AtomicEffectEnum.召唤 &&
                    PlayInfo.BattleField.MinionCount != SystemManager.MaxMinionCount)
                {
                    gameStatus.Interrupt.ActionCard = new MinimizeBattleInfo.HandCardInfo();
                    gameStatus.Interrupt.ActionCard.Init(PlayInfo.Hero.HeroSkill);
                    gameStatus.ActionName                = "USEHEROSKILL";
                    gameStatus.Interrupt.Step            = 1;
                    gameStatus.Interrupt.ActionName      = "SPELL";
                    PlayInfo.crystal.CurrentRemainPoint -= PlayInfo.Hero.HeroSkill.使用成本;
                    PlayInfo.Hero.IsUsedHeroAbility      = true;
                    RunAction.StartActionCS(gameStatus, PlayInfo.Hero.HeroSkill.序列号, new string[] { });
                    gameStatus.Interrupt.ActionName = "SPELL";
                    return;
                }
            }
            //能上场的随从都上场
            int HandCardIndex = HasBattleMinion(gameStatus);

            if (HandCardIndex != -1)
            {
                int newPos = PlayInfo.BattleField.MinionCount + 1;
                var card   = PlaySelfInfo.handCards[HandCardIndex];
                RunAction.StartActionCS(gameStatus, card.序列号, new string[] { newPos.ToString() });
                PlayInfo.crystal.CurrentRemainPoint -= card.使用成本;
                PlaySelfInfo.RemoveUsedCard(card.序列号);
                PlayInfo.HandCardCount          = PlaySelfInfo.handCards.Count;
                gameStatus.Interrupt.ActionCard = new MinimizeBattleInfo.HandCardInfo();
                gameStatus.Interrupt.ActionCard.Init(card);
                gameStatus.Interrupt.ActionName = "MINION";
                return;
            }
            //能攻击的随从都攻击,优先攻击英雄
            int AttackPos = HasAttackMinion(gameStatus);

            if (AttackPos != -1)
            {
                int BeAttackedPos = GetAttackTarget(gameStatus);
                RunAction.Fight(gameStatus, AttackPos, BeAttackedPos, true);
                gameStatus.Interrupt.ActionName   = "FIGHT";
                gameStatus.Interrupt.ExternalInfo = AttackPos.ToString() + BeAttackedPos.ToString();
                return;
            }
            gameStatus.Interrupt.ActionName = ActionCode.strEndTurn;
        }
예제 #2
0
        /// <summary>
        /// 攻击
        /// </summary>
        /// <param name="MyPos"></param>
        private void Fight(int MyPos)
        {
            var           YourPos   = SelectPanel(CardUtility.TargetSelectDirectEnum.对方, CardUtility.TargetSelectRoleEnum.所有角色, true);
            List <String> actionlst = RunAction.Fight(game, MyPos, YourPos.Postion);

            actionlst.AddRange(game.奥秘计算(actionlst));
            game.MySelf.ResetHandCardCost();
            Card.Client.ClientRequest.WriteAction(game.GameId.ToString(GameServer.GameIdFormat), actionlst);
            DisplayMyInfo();
        }
예제 #3
0
        /// <summary>
        /// 攻击
        /// </summary>
        /// <param name="MyPos"></param>
        private void Fight(int MyPos)
        {
            GameManager.MyClientManager.CurrentActiveCard = GameManager.MyClientManager.actionStatus.AllRole.MyPublicInfo.BattleField.BattleMinions[MyPos - 1];
            var           YourPos   = SelectPanel(SelectUtility.GetFightSelectOpt());
            List <string> actionlst = RunAction.Fight(GameManager.MyClientManager.actionStatus, MyPos, YourPos.位置, true);

            actionlst.AddRange(SecretCard.奥秘计算(actionlst, GameManager.MyClientManager.actionStatus, GameManager.MyClientManager.GameId));
            GameManager.MyClientManager.actionStatus.AllRole.MyPrivateInfo.ResetHandCardCost(GameManager.MyClientManager.actionStatus);
            if (SystemManager.游戏类型 != SystemManager.GameType.单机版)
            {
                ClientRequest.WriteAction(GameManager.MyClientManager.GameId.ToString(GameServer.GameIdFormat), actionlst);
            }
            DisplayMyInfo();
        }
예제 #4
0
        /// <summary>
        /// 攻击
        /// </summary>
        /// <param name="GameId"></param>
        /// <param name="IsHost"></param>
        /// <param name="MyPos"></param>
        /// <param name="YourPos"></param>
        public static void Fight(int GameId, bool IsHost, int MyPos, int YourPos)
        {
            var gamestatus = GameRunning_BS[GameId].gameStatus(IsHost);

            RunAction.Fight(gamestatus, MyPos, YourPos, true);
        }