/// <summary> /// 回合结束效果 /// </summary> /// <param name="game"></param> /// <returns></returns> public List <String> 回合结束(GameManager game) { List <String> ActionCodeLst = new List <string>(); //回合结束效果 if (回合结束效果 != String.Empty && !Is沉默Status) { var 战吼Result = RunAction.StartAction(game, 回合结束效果); //第一条是使用了亡语卡牌的消息,如果不除去,对方客户端会认为使用了一张卡牌 战吼Result.RemoveAt(0); ActionCodeLst.AddRange(战吼Result); } return(ActionCodeLst); }
/// <summary> /// 发动亡语 /// </summary> /// <param name="game"></param> /// <returns></returns> public List <String> 发动亡语(GameManager game, Boolean IsNeedConvertPosDirect) { List <String> ActionCodeLst = new List <string>(); //亡语效果 if (亡语效果 != String.Empty && !Is沉默Status) { var 战吼Result = RunAction.StartAction(game, 亡语效果, IsNeedConvertPosDirect); //第一条是使用了亡语卡牌的消息,如果不除去,对方客户端会认为使用了一张卡牌 战吼Result.RemoveAt(0); ActionCodeLst.AddRange(战吼Result); } return(ActionCodeLst); }
/// <summary> /// 使用手牌 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnUseHandCard_Click(object sender, EventArgs e) { CardBasicInfo UseHandCard; if ((sender.GetType()) == typeof(Button)) { UseHandCard = (CardBasicInfo)((ctlHandCard)(((Button)sender).Parent)).Tag; } else { UseHandCard = (CardBasicInfo)(((ctlHeroAbility)sender).Tag); } GameManager.MyClientManager.CurrentActiveCard = UseHandCard; var msg = CardBasicInfo.CheckCondition(UseHandCard, GameManager.MyClientManager.actionStatus.AllRole.MyPublicInfo); if (!string.IsNullOrEmpty(msg)) { MessageBox.Show(msg); return; } var actionlst = RunAction.StartAction(GameManager.MyClientManager.actionStatus, UseHandCard.序列号); if (actionlst.Count != 0) { if ((sender.GetType()) == typeof(Button)) { actionlst.Insert(0, ActionCode.strCard + CardUtility.strSplitMark + CardUtility.strMe); GameManager.MyClientManager.actionStatus.AllRole.MyPublicInfo.crystal.CurrentRemainPoint -= UseHandCard.使用成本; GameManager.MyClientManager.actionStatus.AllRole.MyPublicInfo.HandCardCount--; GameManager.MyClientManager.actionStatus.AllRole.MyPrivateInfo.RemoveUsedCard(UseHandCard.序列号); } else { GameManager.MyClientManager.actionStatus.AllRole.MyPublicInfo.crystal.CurrentRemainPoint -= UseHandCard.使用成本; GameManager.MyClientManager.actionStatus.AllRole.MyPublicInfo.Hero.IsUsedHeroAbility = true; } actionlst.Add(ActionCode.strCrystal + CardUtility.strSplitMark + CardUtility.strMe + CardUtility.strSplitMark + GameManager.MyClientManager.actionStatus.AllRole.MyPublicInfo.crystal.CurrentRemainPoint + CardUtility.strSplitMark + GameManager.MyClientManager.actionStatus.AllRole.MyPublicInfo.crystal.CurrentFullPoint); //奥秘计算 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(); } }
/// <summary> /// 使用手牌 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnUseHandCard_Click(object sender, EventArgs e) { if (((Button)sender).Tag == null) { return; } CardBasicInfo card; if (((Button)sender).Name == "btnMyHeroAblity") { card = CardUtility.GetCardInfoBySN(((Button)sender).Tag.ToString()); } else { card = (CardBasicInfo)((Button)sender).Tag; } var msg = game.CheckCondition(card); if (!String.IsNullOrEmpty(msg)) { MessageBox.Show(msg); return; } var actionlst = RunAction.StartAction(game, card.SN); if (actionlst.Count != 0) { game.MySelf.RoleInfo.crystal.CurrentRemainPoint -= card.ActualCostPoint; if (((Button)sender).Name != "btnMyHeroAblity") { game.RemoveUsedCard(card.SN); } else { game.MySelf.RoleInfo.IsUsedHeroAbility = true; } actionlst.Add(ActionCode.strCrystal + CardUtility.strSplitMark + CardUtility.strMe + CardUtility.strSplitMark + game.MySelf.RoleInfo.crystal.CurrentRemainPoint + CardUtility.strSplitMark + game.MySelf.RoleInfo.crystal.CurrentFullPoint); //奥秘计算 actionlst.AddRange(game.奥秘计算(actionlst)); game.MySelf.ResetHandCardCost(); Card.Client.ClientRequest.WriteAction(game.GameId.ToString(GameServer.GameIdFormat), actionlst); DisplayMyInfo(); } }
/// <summary> /// 发动战吼(默认) /// </summary> /// <param name="game"></param> /// <param name="SelfPosition"></param> /// <returns></returns> public List <String> 发动战吼(GameManager game) { List <String> ActionCodeLst = new List <string>(); //战吼效果 if (战吼效果 != String.Empty && !Is沉默Status) { var 战吼Result = RunAction.StartAction(game, 战吼效果); //第一条是使用了战吼卡牌的消息,如果不除去,对方客户端会认为使用了一张卡牌 //如果战吼在召唤的时候无法成功,法术机能会误认为是取消 if (战吼Result.Count > 0) { 战吼Result.RemoveAt(0); } ActionCodeLst.AddRange(战吼Result); } return(ActionCodeLst); }
/// <summary> /// 回合开始效果 /// </summary> /// <param name="game"></param> /// <returns></returns> public List <string> 回合开始(ActionStatus game) { List <string> ActionCodeLst = new List <string>(); //回合开始效果 if (回合开始效果 != string.Empty && !沉默状态) { var 回合开始Result = RunAction.StartAction(game, 回合开始效果); //第一条是使用了亡语卡牌的消息,如果不除去,对方客户端会认为使用了一张卡牌 if (回合开始Result.Count > 0) { 回合开始Result.RemoveAt(0); } ActionCodeLst.AddRange(回合开始Result); 潜行特性 = false; } return(ActionCodeLst); }
/// <summary> /// 使用手牌 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnUseHandCard_Click(object sender, EventArgs e) { CardBasicInfo card; if ((sender.GetType()) == typeof(Button)) { card = (CardBasicInfo)((ctlHandCard)(((Button)sender).Parent)).Tag; } else { card = (CardBasicInfo)(((ctlHeroAbility)sender).Tag); } var msg = game.CheckCondition(card); if (!String.IsNullOrEmpty(msg)) { MessageBox.Show(msg); return; } var actionlst = RunAction.StartAction(game, card.SN); if (actionlst.Count != 0) { if ((sender.GetType()) == typeof(Button)) { actionlst.Insert(0, ActionCode.strCard + CardUtility.strSplitMark + CardUtility.strMe); game.MyInfo.crystal.CurrentRemainPoint -= card.ActualCostPoint; game.RemoveUsedCard(card.SN); } else { game.MyInfo.crystal.CurrentRemainPoint -= card.StandardCostPoint; game.MyInfo.IsUsedHeroAbility = true; } actionlst.Add(ActionCode.strCrystal + CardUtility.strSplitMark + CardUtility.strMe + CardUtility.strSplitMark + game.MyInfo.crystal.CurrentRemainPoint + CardUtility.strSplitMark + game.MyInfo.crystal.CurrentFullPoint); //奥秘计算 actionlst.AddRange(game.奥秘计算(actionlst)); game.MySelfInfo.ResetHandCardCost(game); Card.Client.ClientRequest.WriteAction(game.GameId.ToString(GameServer.GameIdFormat), actionlst); DisplayMyInfo(); } }
/// <summary> /// 发动亡语(CS/BS) /// </summary> /// <param name="game"></param> /// <param name="IsMyAction"></param> /// <returns></returns> public List <string> 发动亡语(ActionStatus game) { List <string> ActionCodeLst = new List <string>(); //亡语效果 if (亡语效果 != string.Empty && !沉默状态) { //BS模式下面,必须设置Step game.Interrupt.Step = 1; var 亡语Result = RunAction.StartAction(game, 亡语效果); //第一条是使用了亡语卡牌的消息,如果不除去,对方客户端会认为使用了一张卡牌 if (亡语Result.Count > 0) { 亡语Result.RemoveAt(0); } ActionCodeLst.AddRange(亡语Result); } return(ActionCodeLst); }
/// <summary> /// 发动战吼(暂时没有使用的方法) /// </summary> /// <param name="game"></param> /// <returns></returns> public List <string> 发动战吼(ActionStatus game) { List <string> ActionCodeLst = new List <string>(); //战吼效果 if (战吼效果 != string.Empty && !沉默状态) { game.Interrupt.Step = 1; var 战吼Result = RunAction.StartAction(game, 战吼效果); //第一条是使用了战吼卡牌的消息,如果不除去,对方客户端会认为使用了一张卡牌 //如果战吼在召唤的时候无法成功,法术机能会误认为是取消 if (战吼Result.Count > 0) { 战吼Result.RemoveAt(0); } ActionCodeLst.AddRange(战吼Result); } return(ActionCodeLst); }
/// <summary> /// 使用手牌 /// </summary> /// <param name="GameId"></param> /// <param name="IsHost"></param> /// <param name="CardSn"></param> /// <returns></returns> public static FullServerManager.Interrupt UseHandCard(int GameId, bool IsHost, string CardSn, int Step, string SessionData) { var gamestatus = GameRunning_BS[GameId].gameStatus(IsHost); gamestatus.Interrupt.IsHost = IsHost; gamestatus.Interrupt.GameId = GameId.ToString(GameIdFormat); gamestatus.GameId = GameId; gamestatus.Interrupt.Step = Step; gamestatus.Interrupt.SessionData = SessionData; RunAction.StartAction(gamestatus, CardSn); if (gamestatus.Interrupt.ActionName == CardUtility.strOK) { gamestatus.AllRole.MyPublicInfo.crystal.CurrentRemainPoint -= CardUtility.GetCardInfoBySN(CardSn).使用成本; gamestatus.AllRole.MyPublicInfo.HandCardCount--; gamestatus.AllRole.MyPrivateInfo.RemoveUsedCard(CardSn); } gamestatus.Interrupt.ActionCard = new MinimizeBattleInfo.HandCardInfo(); gamestatus.Interrupt.ActionCard.Init(CardUtility.GetCardInfoBySN(CardSn)); return(gamestatus.Interrupt); }