/// <summary>
        /// 运行奥秘
        /// </summary>
        /// <param name="SecretCardSN"></param>
        /// <param name="ActionCode"></param>
        /// <param name="HitMySelf"></param>
        /// <returns></returns>
        public static List <string> RunSecretHit(string SecretCardSN, string ActionCode, bool HitMySelf, ActionStatus game)
        {
            List <string> ActionLst   = new List <string>();
            SecretCard    card        = (SecretCard)CardUtility.GetCardInfoBySN(SecretCardSN);
            var           actiontype  = Server.ActionCode.GetActionType(ActionCode);
            var           actionField = ActionCode.Split(CardUtility.strSplitMark.ToCharArray());

            ActionLst.Add(Server.ActionCode.strHitSecret + CardUtility.strSplitMark + (HitMySelf ? CardUtility.strMe : CardUtility.strYou) +
                          CardUtility.strSplitMark + SecretCardSN);
            //HitMySelf 在自己的回合运行自己的奥秘
            switch (card.Condition)
            {
            case SecretCondition.对方召唤随从:
                //如果是召唤系的
                if (HitMySelf)
                {
                    //在自己的回合运行自己的奥秘
                    //SUMMON#YOU#M000001#POS
                    //例如:亡语的时候可能召唤一个新的随从
                    //PointEffect.RunPointEffect(game.AllRole.YourBattleInfo.BattleMinions[int.Parse(actionField[3]) - 1],card.AdditionInfo);
                    ActionLst.Add(Server.ActionCode.strPoint + CardUtility.strSplitMark + CardUtility.strYou + CardUtility.strSplitMark +
                                  actionField[3] + CardUtility.strSplitMark + card.AdditionInfo);
                }
                else
                {
                    //在自己的回合运行别人的奥秘
                    if (actiontype == Server.ActionCode.ActionType.Summon)
                    {
                        //SUMMON#YOU#M000001#POS
                        //PointEffect.RunPointEffect(game.MyInfo.BattleField.BattleMinions[int.Parse(actionField[3]) - 1], card.AdditionInfo);
                        ActionLst.Add(Server.ActionCode.strPoint + CardUtility.strSplitMark + CardUtility.strMe + CardUtility.strSplitMark +
                                      actionField[3] + CardUtility.strSplitMark + card.AdditionInfo);
                    }
                    else
                    {
                        //MINION#M000001#1
                        //PointEffect.RunPointEffect(game.MyInfo.BattleField.BattleMinions[int.Parse(actionField[2]) - 1], card.AdditionInfo);
                        ActionLst.Add(Server.ActionCode.strPoint + CardUtility.strSplitMark + CardUtility.strMe + CardUtility.strSplitMark +
                                      actionField[2] + CardUtility.strSplitMark + card.AdditionInfo);
                    }
                }
                break;

            default:
                break;
            }
            return(ActionLst);
        }
 /// <summary>
 ///
 /// </summary>
 /// <param name="game"></param>
 /// <param name="actField"></param>
 public static void ReRunSecret(ActionStatus game, string[] actField)
 {
     if (actField[1] == CardUtility.strYou)
     {
         SecretCard Hit = new SecretCard();
         foreach (var secret in game.AllRole.MyPrivateInfo.奥秘列表)
         {
             if (secret.序列号 == actField[2])
             {
                 Hit = secret;
                 break;
             }
         }
         game.AllRole.MyPrivateInfo.奥秘列表.Remove(Hit);
     }
     else
     {
         game.AllRole.YourPublicInfo.Hero.SecretCount--;
     }
 }
        /// <summary>
        /// 奥秘是否命中
        /// </summary>
        /// <param name="SecretCardSN"></param>
        /// <param name="ActionCode"></param>
        /// <param name="HitMySelf">是否检查自己是否触发自己的奥秘</param>
        /// <returns></returns>
        public static bool IsSecretHit(string SecretCardSN, string ActionCode, bool HitMySelf)
        {
            //HitMySelf
            //这里需要关注方向性问题
            SecretCard card        = (SecretCard)CardUtility.GetCardInfoBySN(SecretCardSN);
            var        actiontype  = Server.ActionCode.GetActionType(ActionCode);
            var        actionField = ActionCode.Split(CardUtility.strSplitMark.ToCharArray());
            bool       IsHit       = false;

            switch (card.Condition)
            {
            case SecretCondition.对方召唤随从:
                if (HitMySelf)
                {
                    //在自己的回合检查否触发自己的奥秘,如果是召唤系的
                    //SUMMON#YOU#M000001
                    //HitMySelf的时候,是YOU
                    if (actiontype == Server.ActionCode.ActionType.Summon && actionField[1] == CardUtility.strYou)
                    {
                        IsHit = true;
                    }
                }
                else
                {
                    //在别人的回合检查否触发自己的奥秘,是ME
                    if (actiontype == Server.ActionCode.ActionType.Summon && actionField[1] == CardUtility.strMe)
                    {
                        IsHit = true;
                    }
                    if (actiontype == Server.ActionCode.ActionType.UseMinion)
                    {
                        IsHit = true;
                    }
                }
                break;

            default:
                break;
            }
            return(IsHit);
        }
Beispiel #4
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="game"></param>
 /// <param name="actField"></param>
 public static void ReRunSecret(GameManager game, String[] actField)
 {
     if (actField[1] == CardUtility.strYou)
     {
         Engine.Card.SecretCard Hit = new SecretCard();
         foreach (var secret in game.MySelfInfo.奥秘列表)
         {
             if (secret.序列号 == actField[2])
             {
                 Hit = secret;
                 break;
             }
         }
         game.MySelfInfo.奥秘列表.Remove(Hit);
     }
     else
     {
         game.YourInfo.SecretCount--;
     }
 }
Beispiel #5
0
 /// <summary>
 /// 奥秘
 /// </summary>
 /// <param name="target"></param>
 /// <param name="workbook"></param>
 private void Secret(dynamic workbook)
 {
     if (Directory.Exists(XmlFolderPicker.SelectedPathOrFileName + "\\Secret\\"))
     {
         Directory.Delete(XmlFolderPicker.SelectedPathOrFileName + "\\Secret\\", true);
     }
     Directory.CreateDirectory(XmlFolderPicker.SelectedPathOrFileName + "\\Secret\\");
     //奥秘的导入
     dynamic worksheet = workbook.Sheets(4);
     int rowCount = 4;
     while (!String.IsNullOrEmpty(worksheet.Cells(rowCount, 2).Text))
     {
         Engine.Card.SecretCard Secret = new Engine.Card.SecretCard();
         Secret.序列号 = worksheet.Cells(rowCount, 2).Text;
         Secret.名称 = worksheet.Cells(rowCount, 3).Text;
         Secret.描述 = worksheet.Cells(rowCount, 4).Text;
         Secret.职业 = CardUtility.GetEnum<Engine.Utility.CardUtility.ClassEnum>(worksheet.Cells(rowCount, 5).Text, Engine.Utility.CardUtility.ClassEnum.中立);
         Secret.使用成本 = CardUtility.GetInt(worksheet.Cells(rowCount, 7).Text);
         Secret.使用成本 = Secret.使用成本;
         Secret.Rare = CardUtility.GetEnum<Engine.Card.CardBasicInfo.稀有程度>(worksheet.Cells(rowCount, 12).Text, CardBasicInfo.稀有程度.白色);
         Secret.是否启用 = !String.IsNullOrEmpty(worksheet.Cells(rowCount, 13).Text);
         Secret.Condition = CardUtility.GetEnum<Engine.Card.SecretCard.SecretCondition>(worksheet.Cells(rowCount, 14).Text, SecretCard.SecretCondition.对方召唤随从);
         Secret.AdditionInfo = worksheet.Cells(rowCount, 15).Text;
         XmlSerializer xml = new XmlSerializer(typeof(Engine.Card.SecretCard));
         String XmlFilename = XmlFolderPicker.SelectedPathOrFileName + "\\Secret\\" + Secret.序列号 + ".xml";
         xml.Serialize(new StreamWriter(XmlFilename), Secret);
         rowCount++;
     }
 }
Beispiel #6
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="game"></param>
 /// <param name="actField"></param>
 public static void ReRunSecret(ActionStatus game, string[] actField)
 {
     if (actField[1] == CardUtility.strYou)
     {
         SecretCard Hit = new SecretCard();
         foreach (var secret in game.AllRole.MyPrivateInfo.奥秘列表)
         {
             if (secret.序列号 == actField[2])
             {
                 Hit = secret;
                 break;
             }
         }
         game.AllRole.MyPrivateInfo.奥秘列表.Remove(Hit);
     }
     else
     {
         game.AllRole.YourPublicInfo.Hero.SecretCount--;
     }
 }
Beispiel #7
0
 /// <summary>
 /// 奥秘
 /// </summary>
 /// <param name="target"></param>
 /// <param name="workbook"></param>
 private void Secret(dynamic workbook)
 {
     if (Directory.Exists(ExportFolderPicker.SelectedPathOrFileName + "\\Secret\\"))
     {
         Directory.Delete(ExportFolderPicker.SelectedPathOrFileName + "\\Secret\\", true);
     }
     Directory.CreateDirectory(ExportFolderPicker.SelectedPathOrFileName + "\\Secret\\");
     //奥秘的导入
     dynamic worksheet = workbook.Sheets(4);
     int rowCount = 4;
     while (!string.IsNullOrEmpty(worksheet.Cells(rowCount, 2).Text))
     {
         SecretCard Secret = new SecretCard();
         Secret.序列号 = worksheet.Cells(rowCount, 2).Text;
         Secret.名称 = worksheet.Cells(rowCount, 3).Text;
         Secret.描述 = worksheet.Cells(rowCount, 4).Text;
         Secret.职业 = CSharpUtility.GetEnum<CardUtility.职业枚举>(worksheet.Cells(rowCount, 5).Text, CardUtility.职业枚举.中立);
         Secret.使用成本 = CSharpUtility.GetInt(worksheet.Cells(rowCount, 7).Text);
         Secret.稀有程度 = CSharpUtility.GetEnum<CardBasicInfo.稀有程度枚举>(worksheet.Cells(rowCount, 12).Text, CardBasicInfo.稀有程度枚举.白色);
         Secret.是否启用 = !string.IsNullOrEmpty(worksheet.Cells(rowCount, 13).Text);
         Secret.Condition = CSharpUtility.GetEnum<SecretCard.SecretCondition>(worksheet.Cells(rowCount, 14).Text, SecretCard.SecretCondition.对方召唤随从);
         Secret.AdditionInfo = worksheet.Cells(rowCount, 15).Text;
         switch (exportType)
         {
             case SystemManager.ExportType.XML:
                 XmlSerializer xml = new XmlSerializer(typeof(SecretCard));
                 string XmlFilename = ExportFolderPicker.SelectedPathOrFileName + "\\Secret\\" + Secret.序列号 + ".xml";
                 xml.Serialize(new StreamWriter(XmlFilename), Secret);
                 break;
             case SystemManager.ExportType.JSON:
                 string JSonFilename = ExportFolderPicker.SelectedPathOrFileName + "\\Secret\\" + Secret.序列号 + ".json";
                 StreamWriter json = new StreamWriter(JSonFilename);
                 json.Write(Secret.ToJson());
                 json.Close();
                 break;
             default:
                 break;
         }
         rowCount++;
     }
 }