/// <summary> /// 初始化奥术飞弹 /// </summary> /// <returns></returns> public static Card.AbilityCard Get奥术飞弹() { Card.AbilityCard 奥术飞弹 = new Card.AbilityCard(); 奥术飞弹.SN = "M000001"; 奥术飞弹.Name = "奥术飞弹"; 奥术飞弹.Description = "造成3点伤害,随机分配给敌方角色。"; 奥术飞弹.Rare = Card.CardBasicInfo.稀有程度.绿色; //使用成本 奥术飞弹.StandardCostPoint = 1; //3回1点攻击 //奥术飞弹.FirstAbilityDefine.StandardEffectPoint = 1; //奥术飞弹.FirstAbilityDefine.ActualEffectPoint = 1; //奥术飞弹.FirstAbilityDefine.EffectCount = 3; //奥术飞弹.FirstAbilityDefine.EffictTargetSelectMode = Card.CardUtility.TargetSelectModeEnum.随机; return(奥术飞弹); }
/// <summary> /// 初始化变羊术 /// </summary> /// <returns></returns> public static Card.AbilityCard Get变羊术() { Card.AbilityCard 变羊术 = new Card.AbilityCard(); 变羊术.SN = "M000003"; 变羊术.Name = "变羊术"; 变羊术.Description = "指定一个单位变成 1/1 的羊。"; 变羊术.Rare = Card.CardBasicInfo.稀有程度.绿色; //使用成本 变羊术.StandardCostPoint = 4; 变羊术.CardAbility.JoinType = Card.CardUtility.EffectJoinType.None; //变成 1/1 的羊 //Card.Effect.TransformEffect transformEffect = new Card.Effect.TransformEffect(); //transformEffect.EffectCount = 1; //transformEffect.EffectTargetSelectDirect = Card.CardUtility.TargetSelectDirectEnum.无限制; //transformEffect.EffectTargetSelectRole = Card.CardUtility.TargetSelectRoleEnum.随从; //transformEffect.AddtionInfo = "F000004"; //变羊术.CardAbility.FirstAbilityDefine = transformEffect; return 变羊术; }
/// <summary> /// 初始化变羊术 /// </summary> /// <returns></returns> public static Card.AbilityCard Get变羊术() { Card.AbilityCard 变羊术 = new Card.AbilityCard(); 变羊术.SN = "M000003"; 变羊术.Name = "变羊术"; 变羊术.Description = "指定一个单位变成 1/1 的羊。"; 变羊术.Rare = Card.CardBasicInfo.稀有程度.绿色; //使用成本 变羊术.StandardCostPoint = 4; 变羊术.CardAbility.JoinType = Card.CardUtility.EffectJoinType.None; //变成 1/1 的羊 //Card.Effect.TransformEffect transformEffect = new Card.Effect.TransformEffect(); //transformEffect.EffectCount = 1; //transformEffect.EffectTargetSelectDirect = Card.CardUtility.TargetSelectDirectEnum.无限制; //transformEffect.EffectTargetSelectRole = Card.CardUtility.TargetSelectRoleEnum.随从; //transformEffect.AddtionInfo = "F000004"; //变羊术.CardAbility.FirstAbilityDefine = transformEffect; return(变羊术); }
/// <summary> /// 初始化奥术智慧 /// </summary> /// <returns></returns> public static Card.AbilityCard Get奥术智慧() { Card.AbilityCard 奥术智慧 = new Card.AbilityCard(); 奥术智慧.SN = "M000002"; 奥术智慧.Name = "奥术智慧"; 奥术智慧.Description = "随机抽两张牌。"; 奥术智慧.Rare = Card.CardBasicInfo.稀有程度.绿色; //使用成本 奥术智慧.StandardCostPoint = 1; 奥术智慧.CardAbility.JoinType = Card.CardUtility.EffectJoinType.None; //随机抽两张牌 Card.Effect.CardEffect CardDeckEffect = new Card.Effect.CardEffect(); CardDeckEffect.StandardEffectPoint = 2; CardDeckEffect.StandardEffectCount = 1; CardDeckEffect.EffectTargetSelectDirect = Card.CardUtility.TargetSelectDirectEnum.本方; 奥术智慧.CardAbility.FirstAbilityDefine = CardDeckEffect; return(奥术智慧); }
/// <summary> /// 初始化奥术智慧 /// </summary> /// <returns></returns> public static Card.AbilityCard Get奥术智慧() { Card.AbilityCard 奥术智慧 = new Card.AbilityCard(); 奥术智慧.SN = "M000002"; 奥术智慧.Name = "奥术智慧"; 奥术智慧.Description = "随机抽两张牌。"; 奥术智慧.Rare = Card.CardBasicInfo.稀有程度.绿色; //使用成本 奥术智慧.ActualCostPoint = 1; 奥术智慧.StandardCostPoint = 1; 奥术智慧.CardAbility.JoinType = Card.CardUtility.EffectJoinType.None; //随机抽两张牌 Card.Effect.CardEffect CardDeckEffect = new Card.Effect.CardEffect(); CardDeckEffect.StandardEffectPoint = 2; CardDeckEffect.EffectCount = 1; CardDeckEffect.EffectTargetSelectDirect = Card.CardUtility.TargetSelectDirectEnum.本方; 奥术智慧.CardAbility.FirstAbilityDefine = CardDeckEffect; return 奥术智慧; }
/// <summary> /// 从XML文件读取 /// </summary> public static void GetCardInfoFromXml() { //调用侧的NET版本3.5会引发错误。。。 CardCollections.Clear(); //法术 foreach (var AbilityXml in Directory.GetFiles(CardXmlFolder + "\\Ability\\")) { XmlSerializer xml = new XmlSerializer(typeof(Card.AbilityCard)); Card.AbilityCard ability = (AbilityCard)xml.Deserialize(new StreamReader(AbilityXml)); CardCollections.Add(ability.SN, ability); } //随从 foreach (var MinionXml in Directory.GetFiles(CardXmlFolder + "\\Minion\\")) { XmlSerializer xml = new XmlSerializer(typeof(Card.MinionCard)); Card.MinionCard Minio = (MinionCard)xml.Deserialize(new StreamReader(MinionXml)); Minio.ActualCostPoint = Minio.StandardCostPoint; CardCollections.Add(Minio.SN, Minio); } //武器 foreach (var WeaponXml in Directory.GetFiles(CardXmlFolder + "\\Weapon\\")) { XmlSerializer xml = new XmlSerializer(typeof(Card.WeaponCard)); Card.WeaponCard Weapon = (WeaponCard)xml.Deserialize(new StreamReader(WeaponXml)); Weapon.ActualCostPoint = Weapon.StandardCostPoint; CardCollections.Add(Weapon.SN, Weapon); } //奥秘 foreach (var SecretXml in Directory.GetFiles(CardXmlFolder + "\\Secret\\")) { XmlSerializer xml = new XmlSerializer(typeof(Card.SecretCard)); Card.SecretCard Secret = (SecretCard)xml.Deserialize(new StreamReader(SecretXml)); Secret.ActualCostPoint = Secret.StandardCostPoint; CardCollections.Add(Secret.SN, Secret); } }
/// <summary> /// 开始一个动作 /// </summary> /// <param name="game"></param> /// <param name="CardSn"></param> /// <param name="ConvertPosDirect">亡语的时候,需要倒置方向</param> /// <returns></returns> public static List <String> StartAction(GameManager game, String CardSn, Boolean ConvertPosDirect = false) { Card.CardBasicInfo card = Card.CardUtility.GetCardInfoBySN(CardSn); List <String> ActionCodeLst = new List <string>(); switch (card.CardType) { case CardBasicInfo.CardTypeEnum.法术: ActionCodeLst.Add(UseAbility(CardSn)); //初始化 Buff效果等等 Card.AbilityCard ablity = (Card.AbilityCard)CardUtility.GetCardInfoBySN(CardSn); ablity.CardAbility.Init(); var ResultArg = game.UseAbility(ablity, ConvertPosDirect); if (ResultArg.Count != 0) { ActionCodeLst.AddRange(ResultArg); //英雄技能的时候,不算[本方施法] A900001 幸运币 if (CardSn.Substring(1, 1) != "2") { ActionCodeLst.AddRange(game.MySelf.RoleInfo.BattleField.触发事件(MinionCard.事件类型列表.本方施法, game)); } } else { ActionCodeLst.Clear(); } break; case CardBasicInfo.CardTypeEnum.随从: int MinionPos = GetPutPos(game); if (MinionPos != -1) { ActionCodeLst.Add(UseMinion(CardSn, MinionPos)); var minion = (Card.MinionCard)card; //初始化 minion.Init(); game.MySelf.RoleInfo.BattleField.PutToBattle(MinionPos, minion); ActionCodeLst.AddRange(minion.发动战吼(game)); game.MySelf.RoleInfo.BattleField.ResetBuff(); } else { ActionCodeLst.Clear(); } break; case CardBasicInfo.CardTypeEnum.武器: ActionCodeLst.Add(UseWeapon(CardSn)); game.MySelf.RoleInfo.Weapon = (Card.WeaponCard)card; break; case CardBasicInfo.CardTypeEnum.奥秘: ActionCodeLst.Add(UseSecret(CardSn)); game.MySelf.奥秘列表.Add((Card.SecretCard)card); break; default: break; } return(ActionCodeLst); }
private void btnCreate奥术飞弹_Click(object sender, EventArgs e) { 奥术飞弹 = HelperUtility.Get奥术飞弹(); }
/// <summary> /// 初始化奥术飞弹 /// </summary> /// <returns></returns> public static Card.AbilityCard Get奥术飞弹() { Card.AbilityCard 奥术飞弹 = new Card.AbilityCard(); 奥术飞弹.SN = "M000001"; 奥术飞弹.Name = "奥术飞弹"; 奥术飞弹.Description = "造成3点伤害,随机分配给敌方角色。"; 奥术飞弹.Rare = Card.CardBasicInfo.稀有程度.绿色; //使用成本 奥术飞弹.ActualCostPoint = 1; 奥术飞弹.StandardCostPoint = 1; //3回1点攻击 //奥术飞弹.FirstAbilityDefine.StandardEffectPoint = 1; //奥术飞弹.FirstAbilityDefine.ActualEffectPoint = 1; //奥术飞弹.FirstAbilityDefine.EffectCount = 3; //奥术飞弹.FirstAbilityDefine.EffictTargetSelectMode = Card.CardUtility.TargetSelectModeEnum.随机; return 奥术飞弹; }
/// <summary> /// 开始一个动作 /// </summary> /// <param name="game"></param> /// <param name="CardSn"></param> /// <param name="ConvertPosDirect">亡语的时候,需要倒置方向</param> /// <returns></returns> public static List <String> StartAction(GameManager game, String CardSn, Boolean ConvertPosDirect = false) { //清除事件池,注意,事件将在动作结束后整体结算 game.事件池.Clear(); Card.CardBasicInfo card = Card.CardUtility.GetCardInfoBySN(CardSn); List <String> ActionCodeLst = new List <string>(); switch (card.CardType) { case CardBasicInfo.CardTypeEnum.法术: ActionCodeLst.Add(ActionCode.strAbility + CardUtility.strSplitMark + CardSn); //初始化 Buff效果等等 Card.AbilityCard ablity = (Card.AbilityCard)CardUtility.GetCardInfoBySN(CardSn); //连击效果的法术修改 if (game.MyInfo.连击状态 && (!String.IsNullOrEmpty(card.连击效果))) { ablity = (Card.AbilityCard)CardUtility.GetCardInfoBySN(card.连击效果); } ablity.CardAbility.Init(); var ResultArg = game.UseAbility(ablity, ConvertPosDirect); if (ResultArg.Count != 0) { ActionCodeLst.AddRange(ResultArg); //英雄技能等的时候,不算[本方施法] if (CardSn.Substring(1, 1) == Card.AbilityCard.原生法术) { game.事件池.Add(new Card.CardUtility.全局事件() { 事件类型 = CardUtility.事件类型列表.施法, 触发方向 = CardUtility.TargetSelectDirectEnum.本方, 触发位置 = Card.Client.BattleFieldInfo.HeroPos }); } } else { ActionCodeLst.Clear(); } break; case CardBasicInfo.CardTypeEnum.随从: int MinionPos = 1; if (game.MyInfo.BattleField.MinionCount != 0) { MinionPos = GetPutPos(game); } if (MinionPos != -1) { ActionCodeLst.Add(ActionCode.strMinion + CardUtility.strSplitMark + CardSn + CardUtility.strSplitMark + MinionPos.ToString("D1")); var minion = (Card.MinionCard)card; //初始化 minion.Init(); //必须在放入之前做得原因是,被放入的随从不能被触发这个事件 game.事件池.Add(new Card.CardUtility.全局事件() { 事件类型 = CardUtility.事件类型列表.召唤, 附加信息 = minion.种族.ToString(), 触发位置 = MinionPos }); switch (minion.战吼类型) { case MinionCard.战吼类型列表.默认: game.MyInfo.BattleField.PutToBattle(MinionPos, minion); ActionCodeLst.AddRange(minion.发动战吼(game)); break; case MinionCard.战吼类型列表.抢先: //战吼中,其他 系列的法术效果 foreach (var result in minion.发动战吼(game)) { var resultArray = result.Split(CardUtility.strSplitMark.ToCharArray()); if (int.Parse(resultArray[2]) < MinionPos) { ActionCodeLst.Add(result); } else { ActionCodeLst.Add(resultArray[0] + CardUtility.strSplitMark + resultArray[1] + CardUtility.strSplitMark + (int.Parse(resultArray[2]) + 1).ToString() + CardUtility.strSplitMark + resultArray[3]); } } game.MyInfo.BattleField.PutToBattle(MinionPos, minion); break; case MinionCard.战吼类型列表.相邻: case MinionCard.战吼类型列表.自身: game.MyInfo.BattleField.PutToBattle(MinionPos, minion); game.MyInfo.BattleField.发动战吼(MinionPos); break; default: break; } game.MyInfo.BattleField.ResetBuff(); } else { ActionCodeLst.Clear(); } break; case CardBasicInfo.CardTypeEnum.武器: ActionCodeLst.Add(ActionCode.strWeapon + CardUtility.strSplitMark + CardSn); game.MyInfo.Weapon = (Card.WeaponCard)card; break; case CardBasicInfo.CardTypeEnum.奥秘: ActionCodeLst.Add(ActionCode.strSecret + CardUtility.strSplitMark + CardSn); game.MySelfInfo.奥秘列表.Add((Card.SecretCard)card); game.MyInfo.SecretCount = game.MySelfInfo.奥秘列表.Count; break; default: break; } //随从卡牌的连击效果启动 if (card.CardType != CardBasicInfo.CardTypeEnum.法术 && game.MyInfo.连击状态) { if (!String.IsNullOrEmpty(card.连击效果)) { //初始化 Buff效果等等 Card.AbilityCard ablity = (Card.AbilityCard)CardUtility.GetCardInfoBySN(card.连击效果); ablity.CardAbility.Init(); var ResultArg = game.UseAbility(ablity, ConvertPosDirect); if (ResultArg.Count != 0) { ActionCodeLst.AddRange(ResultArg); //英雄技能等的时候,不算[本方施法] if (CardSn.Substring(1, 1) == Card.AbilityCard.原生法术) { game.事件池.Add(new Card.CardUtility.全局事件() { 事件类型 = CardUtility.事件类型列表.施法, 触发方向 = CardUtility.TargetSelectDirectEnum.本方, 触发位置 = Card.Client.BattleFieldInfo.HeroPos }); } } } } if (ActionCodeLst.Count != 0) { game.MyInfo.连击状态 = true; ActionCodeLst.AddRange(game.事件处理()); } return(ActionCodeLst); }
/// <summary> /// 开始一个动作 /// </summary> /// <param name="game"></param> /// <param name="CardSn"></param> /// <param name="ConvertPosDirect">亡语的时候,需要倒置方向</param> /// <returns></returns> public static List <String> StartAction(GameManager game, String CardSn, Boolean ConvertPosDirect = false) { Card.CardBasicInfo card = Card.CardUtility.GetCardInfoBySN(CardSn); List <String> ActionCodeLst = new List <string>(); switch (card.CardType) { case CardBasicInfo.CardTypeEnum.法术: ActionCodeLst.Add(UseAbility(CardSn)); //初始化 Buff效果等等 Card.AbilityCard ablity = (Card.AbilityCard)CardUtility.GetCardInfoBySN(CardSn); ablity.CardAbility.Init(); var ResultArg = game.UseAbility(ablity, ConvertPosDirect); if (ResultArg.Count != 0) { ActionCodeLst.AddRange(ResultArg); //英雄技能的时候,不算[本方施法] A900001 幸运币 if (CardSn.Substring(1, 1) != "2") { ActionCodeLst.AddRange(game.MySelf.RoleInfo.BattleField.触发事件(MinionCard.事件类型列表.本方施法, game)); } } else { ActionCodeLst.Clear(); } break; case CardBasicInfo.CardTypeEnum.随从: int MinionPos = GetPutPos(game); if (MinionPos != -1) { ActionCodeLst.Add(UseMinion(CardSn, MinionPos)); var minion = (Card.MinionCard)card; //初始化 minion.Init(); switch (minion.战吼类型) { case MinionCard.战吼类型列表.默认: game.MySelf.RoleInfo.BattleField.PutToBattle(MinionPos, minion); ActionCodeLst.AddRange(minion.发动战吼(game)); break; case MinionCard.战吼类型列表.抢先: //战吼中,其他 系列的法术效果 foreach (var result in minion.发动战吼(game)) { var resultArray = result.Split(CardUtility.strSplitMark.ToCharArray()); if (int.Parse(resultArray[2]) < MinionPos) { ActionCodeLst.Add(result); } else { ActionCodeLst.Add(resultArray[0] + CardUtility.strSplitMark + resultArray[1] + CardUtility.strSplitMark + (int.Parse(resultArray[2]) + 1).ToString() + CardUtility.strSplitMark + resultArray[3]); } } game.MySelf.RoleInfo.BattleField.PutToBattle(MinionPos, minion); break; case MinionCard.战吼类型列表.相邻: case MinionCard.战吼类型列表.自身: game.MySelf.RoleInfo.BattleField.PutToBattle(MinionPos, minion); game.MySelf.RoleInfo.BattleField.发动战吼(MinionPos); break; default: break; } game.MySelf.RoleInfo.BattleField.ResetBuff(); } else { ActionCodeLst.Clear(); } break; case CardBasicInfo.CardTypeEnum.武器: ActionCodeLst.Add(UseWeapon(CardSn)); game.MySelf.RoleInfo.Weapon = (Card.WeaponCard)card; break; case CardBasicInfo.CardTypeEnum.奥秘: ActionCodeLst.Add(UseSecret(CardSn)); game.MySelf.奥秘列表.Add((Card.SecretCard)card); break; default: break; } return(ActionCodeLst); }
/// <summary> /// 开始一个动作 /// </summary> /// <param name="game"></param> /// <param name="CardSn"></param> /// <param name="ConvertPosDirect">亡语的时候,需要倒置方向</param> /// <returns></returns> public static List <String> StartAction(GameManager game, String CardSn, Boolean ConvertPosDirect = false) { Card.CardBasicInfo card = Card.CardUtility.GetCardInfoBySN(CardSn); List <String> ActionCodeLst = new List <string>(); switch (card.CardType) { case CardBasicInfo.CardTypeEnum.法术: ActionCodeLst.Add(UseAbility(CardSn)); //初始化 Buff效果等等 Card.AbilityCard ablity = (Card.AbilityCard)CardUtility.GetCardInfoBySN(CardSn); //连击效果的法术修改 if (game.MySelf.RoleInfo.IsCombit && (!String.IsNullOrEmpty(card.连击效果))) { ablity = (Card.AbilityCard)CardUtility.GetCardInfoBySN(card.连击效果); } ablity.CardAbility.Init(); var ResultArg = game.UseAbility(ablity, ConvertPosDirect); if (ResultArg.Count != 0) { ActionCodeLst.AddRange(ResultArg); //英雄技能等的时候,不算[本方施法] if (CardSn.Substring(1, 1) == "0") { ActionCodeLst.AddRange(game.MySelf.RoleInfo.BattleField.触发事件(new Card.CardUtility.全局事件() { 事件类型 = CardUtility.事件类型列表.施法 }, game)); } } else { ActionCodeLst.Clear(); } break; case CardBasicInfo.CardTypeEnum.随从: int MinionPos = 1; if (game.MySelf.RoleInfo.BattleField.MinionCount != 0) { MinionPos = GetPutPos(game); } if (MinionPos != -1) { ActionCodeLst.Add(UseMinion(CardSn, MinionPos)); var minion = (Card.MinionCard)card; //初始化 minion.Init(); //必须在放入之前做得原因是,被放入的随从不能被触发这个事件 ActionCodeLst.AddRange(game.MySelf.RoleInfo.BattleField.触发事件( new Card.CardUtility.全局事件() { 事件类型 = CardUtility.事件类型列表.召唤, 附加信息 = minion.种族.ToString() }, game)); switch (minion.战吼类型) { case MinionCard.战吼类型列表.默认: game.MySelf.RoleInfo.BattleField.PutToBattle(MinionPos, minion); ActionCodeLst.AddRange(minion.发动战吼(game)); break; case MinionCard.战吼类型列表.抢先: //战吼中,其他 系列的法术效果 foreach (var result in minion.发动战吼(game)) { var resultArray = result.Split(CardUtility.strSplitMark.ToCharArray()); if (int.Parse(resultArray[2]) < MinionPos) { ActionCodeLst.Add(result); } else { ActionCodeLst.Add(resultArray[0] + CardUtility.strSplitMark + resultArray[1] + CardUtility.strSplitMark + (int.Parse(resultArray[2]) + 1).ToString() + CardUtility.strSplitMark + resultArray[3]); } } game.MySelf.RoleInfo.BattleField.PutToBattle(MinionPos, minion); break; case MinionCard.战吼类型列表.相邻: case MinionCard.战吼类型列表.自身: game.MySelf.RoleInfo.BattleField.PutToBattle(MinionPos, minion); game.MySelf.RoleInfo.BattleField.发动战吼(MinionPos); break; default: break; } game.MySelf.RoleInfo.BattleField.ResetBuff(); } else { ActionCodeLst.Clear(); } break; case CardBasicInfo.CardTypeEnum.武器: ActionCodeLst.Add(UseWeapon(CardSn)); game.MySelf.RoleInfo.Weapon = (Card.WeaponCard)card; break; case CardBasicInfo.CardTypeEnum.奥秘: ActionCodeLst.Add(UseSecret(CardSn)); game.MySelf.奥秘列表.Add((Card.SecretCard)card); game.MySelf.RoleInfo.SecretCount = game.MySelf.奥秘列表.Count; break; default: break; } //连击启动(法术的时候是修改法术内容) if (card.CardType != CardBasicInfo.CardTypeEnum.法术 && game.MySelf.RoleInfo.IsCombit) { if (!String.IsNullOrEmpty(card.连击效果)) { //初始化 Buff效果等等 Card.AbilityCard ablity = (Card.AbilityCard)CardUtility.GetCardInfoBySN(card.连击效果); ablity.CardAbility.Init(); var ResultArg = game.UseAbility(ablity, ConvertPosDirect); if (ResultArg.Count != 0) { ActionCodeLst.AddRange(ResultArg); //英雄技能等的时候,不算[本方施法] if (CardSn.Substring(1, 1) == "0") { ActionCodeLst.AddRange(game.MySelf.RoleInfo.BattleField.触发事件(new Card.CardUtility.全局事件() { 事件类型 = CardUtility.事件类型列表.施法 }, game)); } } } } if (ActionCodeLst.Count != 0) { game.MySelf.RoleInfo.IsCombit = true; } return(ActionCodeLst); }