/// <summary> /// 符合种族条件 /// </summary> /// <param name="minion"></param> /// <param name="SelectOpt"></param> /// <returns></returns> public static Boolean 符合选择条件(Card.MinionCard minion, SelectOption SelectOpt) { String strCondition = SelectOpt.EffectTargetSelectCondition; if (String.IsNullOrEmpty(strCondition)) { return(true); } foreach (var 种族名称 in Enum.GetNames(typeof(种族Enum))) { if (种族名称 == strCondition) { return(strCondition == minion.种族.ToString()); } if (("非" + 种族名称) == strCondition) { return(strCondition != minion.种族.ToString()); } } switch (strCondition.Substring(1, 1)) { case "+": return(minion.实际攻击力 >= int.Parse(strCondition.Substring(0, 1))); case "-": return(minion.实际攻击力 <= int.Parse(strCondition.Substring(0, 1))); } return(true); }
/// <summary> /// 初始化鲜血小鬼 /// </summary> /// <returns></returns> public static Card.MinionCard Get鲜血小鬼() { //鲜血小鬼 Card.MinionCard 鲜血小鬼 = new Card.MinionCard(); 鲜血小鬼.SN = "F000003"; 鲜血小鬼.Name = "鲜血小鬼"; 鲜血小鬼.Description = "战吼: 召唤一个1/1的鱼人斥候。"; 鲜血小鬼.Rare = Card.CardBasicInfo.稀有程度.绿色; //属性 鲜血小鬼.实际攻击力 = 1; 鲜血小鬼.ActualCostPoint = 3; 鲜血小鬼.实际生命值 = 1; 鲜血小鬼.Actual冲锋 = true; 鲜血小鬼.Actual嘲讽 = false; 鲜血小鬼.StandardAttackPoint = 1; 鲜血小鬼.StandardCostPoint = 3; 鲜血小鬼.标准生命值上限 = 1; 鲜血小鬼.Standard冲锋 = false; 鲜血小鬼.Standard嘲讽 = false; 鲜血小鬼.潜行特性 = true; 鲜血小鬼.Is潜行Status = true; //战吼 //鲜血小鬼.战吼效果 = new Card.Effect.Ability(); return(鲜血小鬼); }
/// <summary> /// 对随从动作 /// </summary> /// <param name="game"></param> /// <param name="Minion"></param> /// <returns></returns> String IAtomicEffect.DealMinion(ActionStatus game, Card.MinionCard Minion) { var Summon = (Engine.Card.MinionCard)CardUtility.GetCardInfoBySN(变形目标卡牌编号); //一定要初始化,不然的话,生命值是0; Summon.初始化(); Summon.战场位置 = Minion.战场位置; //战场位置的继承 Minion = Summon; return(Server.ActionCode.strStatus + CardUtility.strSplitMark + Minion.战场位置.ToString() + CardUtility.strSplitMark + 变形目标卡牌编号); }
/// <summary> /// 初始化羊 /// </summary> /// <returns></returns> public static Card.MinionCard Get羊() { //羊 Card.MinionCard 羊 = new Card.MinionCard(); 羊.SN = "F000004"; 羊.Name = "羊"; 羊.Description = "1/1的小绵羊。"; 羊.Rare = Card.CardBasicInfo.稀有程度.白色; //属性 羊.StandardAttackPoint = 1; 羊.StandardCostPoint = 1; 羊.标准生命值上限 = 1; return(羊); }
/// <summary> /// 符合种族条件 /// </summary> /// <param name="minion"></param> /// <param name="SelectOpt"></param> /// <returns></returns> public static Boolean 符合种族条件(Card.MinionCard minion, SelectOption SelectOpt) { if (SelectOpt.EffectTargetSelect种族条件 == 种族Enum.无) { return(true); } if (SelectOpt.EffectTargetSelect种族条件取反) { return(SelectOpt.EffectTargetSelect种族条件 != minion.种族); } else { return(SelectOpt.EffectTargetSelect种族条件 == minion.种族); } }
/// <summary> /// 对随从动作 /// </summary> /// <param name="game"></param> /// <param name="Minion"></param> /// <returns></returns> String IAtomicEffect.DealMinion(ActionStatus game, Card.MinionCard Minion) { int AttackPoint = ExpressHandler.GetEffectPoint(game, 伤害效果表达式); //调整伤害值 if (伤害加成) { AttackPoint += game.AllRole.MyPublicInfo.BattleField.AbilityDamagePlus; } if (Minion.设置被攻击后状态(AttackPoint)) { game.battleEvenetHandler.事件池.Add(new Engine.Card.EventCard.全局事件() { 触发事件类型 = EventCard.事件类型枚举.受伤, 触发位置 = Minion.战场位置 }); } return(Server.ActionCode.strAttack + CardUtility.strSplitMark + Minion.战场位置.ToString() + CardUtility.strSplitMark + AttackPoint.ToString()); }
/// <summary> /// 初始化狼骑兵 /// </summary> /// <returns></returns> public static Card.MinionCard Get狼骑兵() { Card.MinionCard 狼骑兵 = new Card.MinionCard(); 狼骑兵.SN = "F000001"; 狼骑兵.Name = "狼骑兵"; 狼骑兵.Description = "冲锋"; 狼骑兵.Rare = Card.CardBasicInfo.稀有程度.绿色; //属性 狼骑兵.实际攻击力 = 1; 狼骑兵.ActualCostPoint = 3; 狼骑兵.实际生命值 = 1; 狼骑兵.Actual冲锋 = true; 狼骑兵.Actual嘲讽 = false; 狼骑兵.StandardAttackPoint = 1; 狼骑兵.StandardCostPoint = 3; 狼骑兵.标准生命值上限 = 1; 狼骑兵.Standard冲锋 = true; 狼骑兵.Standard嘲讽 = false; return(狼骑兵); }
/// <summary> /// 对随从动作 /// </summary> /// <param name="game"></param> /// <param name="Minion"></param> /// <returns></returns> String IAtomicEffect.DealMinion(ActionStatus game, Card.MinionCard Minion) { int TurnCount = int.Parse(持续回合); if (TurnCount == CardUtility.Max) { Minion.攻击力 = ExpressHandler.PointProcess(Minion.攻击力, 攻击力); Minion.生命值 = ExpressHandler.PointProcess(Minion.生命值, 生命值); Minion.生命值上限 = ExpressHandler.PointProcess(Minion.生命值上限, 生命值); return(Server.ActionCode.strPoint + CardUtility.strSplitMark + Minion.战场位置.ToString() + CardUtility.strSplitMark + Minion.攻击力.ToString() + CardUtility.strSplitMark + Minion.生命值.ToString() + CardUtility.strSplitMark + Minion.生命值上限.ToString()); } else { //本回合攻击力翻倍的对应 Minion.本回合攻击力加成 = ExpressHandler.PointProcess(Minion.攻击力, 攻击力) - Minion.攻击力; Minion.本回合生命力加成 = ExpressHandler.PointProcess(Minion.生命值上限, 生命值) - Minion.生命值上限; return(Server.ActionCode.strPoint + CardUtility.strSplitMark + Minion.战场位置.ToString() + CardUtility.strSplitMark + Minion.本回合攻击力加成.ToString() + CardUtility.strSplitMark + Minion.本回合生命力加成.ToString()); } }
/// <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> /// <returns></returns> public static Card.MinionCard Get鱼人猎潮者() { //鱼人猎潮者 Card.MinionCard 鱼人猎潮者 = new Card.MinionCard(); 鱼人猎潮者.SN = "F000002"; 鱼人猎潮者.Name = "鱼人猎潮者"; 鱼人猎潮者.Description = "战吼: 召唤一个1/1的鱼人斥候。"; 鱼人猎潮者.Rare = Card.CardBasicInfo.稀有程度.绿色; //属性 鱼人猎潮者.实际攻击力 = 1; 鱼人猎潮者.ActualCostPoint = 3; 鱼人猎潮者.实际生命值 = 1; 鱼人猎潮者.Actual冲锋 = true; 鱼人猎潮者.Actual嘲讽 = false; 鱼人猎潮者.StandardAttackPoint = 1; 鱼人猎潮者.StandardCostPoint = 3; 鱼人猎潮者.标准生命值上限 = 1; 鱼人猎潮者.Standard冲锋 = false; 鱼人猎潮者.Standard嘲讽 = false; //战吼 //鱼人猎潮者.战吼效果 = new Card.Effect.Ability(); return(鱼人猎潮者); }
/// <summary> /// 改变状态 /// </summary> /// <param name="Minion"></param> /// <param name="状态"></param> private void ChangeStatus(Card.MinionCard Minion, String 状态) { switch (状态) { case strFreeze: Minion.冰冻状态 = CardUtility.效果回合枚举.效果命中; break; case strSlience: Minion.沉默状态 = true; break; case strAngry: Minion.风怒特性 = true; break; case strCharge: Minion.冲锋特性 = true; if (Minion.攻击状态 == MinionCard.攻击状态枚举.准备中) { Minion.攻击状态 = MinionCard.攻击状态枚举.可攻击; } break; case strTaunt: Minion.嘲讽特性 = true; break; case strTurnEndDead: Minion.特殊效果 = MinionCard.特殊效果枚举.回合结束死亡; break; default: break; } }
/// <summary> /// 初始化鲜血小鬼 /// </summary> /// <returns></returns> public static Card.MinionCard Get鲜血小鬼() { //鲜血小鬼 Card.MinionCard 鲜血小鬼 = new Card.MinionCard(); 鲜血小鬼.SN = "F000003"; 鲜血小鬼.Name = "鲜血小鬼"; 鲜血小鬼.Description = "战吼: 召唤一个1/1的鱼人斥候。"; 鲜血小鬼.Rare = Card.CardBasicInfo.稀有程度.绿色; //属性 鲜血小鬼.ActualAttackPoint = 1; 鲜血小鬼.ActualCostPoint = 3; 鲜血小鬼.ActualHealthPoint = 1; 鲜血小鬼.Actual冲锋 = true; 鲜血小鬼.Actual嘲讽 = false; 鲜血小鬼.StandardAttackPoint = 1; 鲜血小鬼.StandardCostPoint = 3; 鲜血小鬼.StandardHealthPoint = 1; 鲜血小鬼.Standard冲锋 = false; 鲜血小鬼.Standard嘲讽 = false; 鲜血小鬼.潜行特性 = true; 鲜血小鬼.Is潜行Status = true; //战吼 鲜血小鬼.战吼效果 = new Card.Effect.Ability(); return 鲜血小鬼; }
/// <summary> /// 初始化鱼人猎潮者 /// </summary> /// <returns></returns> public static Card.MinionCard Get鱼人猎潮者() { //鱼人猎潮者 Card.MinionCard 鱼人猎潮者 = new Card.MinionCard(); 鱼人猎潮者.SN = "F000002"; 鱼人猎潮者.Name = "鱼人猎潮者"; 鱼人猎潮者.Description = "战吼: 召唤一个1/1的鱼人斥候。"; 鱼人猎潮者.Rare = Card.CardBasicInfo.稀有程度.绿色; //属性 鱼人猎潮者.ActualAttackPoint = 1; 鱼人猎潮者.ActualCostPoint = 3; 鱼人猎潮者.ActualHealthPoint = 1; 鱼人猎潮者.Actual冲锋 = true; 鱼人猎潮者.Actual嘲讽 = false; 鱼人猎潮者.StandardAttackPoint = 1; 鱼人猎潮者.StandardCostPoint = 3; 鱼人猎潮者.StandardHealthPoint = 1; 鱼人猎潮者.Standard冲锋 = false; 鱼人猎潮者.Standard嘲讽 = false; //战吼 鱼人猎潮者.战吼效果 = new Card.Effect.Ability(); return 鱼人猎潮者; }
/// <summary> /// 初始化羊 /// </summary> /// <returns></returns> public static Card.MinionCard Get羊() { //羊 Card.MinionCard 羊 = new Card.MinionCard(); 羊.SN = "F000004"; 羊.Name = "羊"; 羊.Description = "1/1的小绵羊。"; 羊.Rare = Card.CardBasicInfo.稀有程度.白色; //属性 羊.StandardAttackPoint = 1; 羊.StandardCostPoint = 1; 羊.StandardHealthPoint = 1; return 羊; }
/// <summary> /// 初始化狼骑兵 /// </summary> /// <returns></returns> public static Card.MinionCard Get狼骑兵() { Card.MinionCard 狼骑兵 = new Card.MinionCard(); 狼骑兵.SN = "F000001"; 狼骑兵.Name = "狼骑兵"; 狼骑兵.Description = "冲锋"; 狼骑兵.Rare = Card.CardBasicInfo.稀有程度.绿色; //属性 狼骑兵.ActualAttackPoint = 1; 狼骑兵.ActualCostPoint = 3; 狼骑兵.ActualHealthPoint = 1; 狼骑兵.Actual冲锋 = true; 狼骑兵.Actual嘲讽 = false; 狼骑兵.StandardAttackPoint = 1; 狼骑兵.StandardCostPoint = 3; 狼骑兵.StandardHealthPoint = 1; 狼骑兵.Standard冲锋 = true; 狼骑兵.Standard嘲讽 = false; return 狼骑兵; }
/// <summary> /// 对随从动作 /// </summary> /// <param name="game"></param> /// <param name="Minion"></param> /// <returns></returns> String IAtomicEffect.DealMinion(ActionStatus game, Card.MinionCard Minion) { ChangeStatus(Minion, 施加状态); return(Server.ActionCode.strStatus + CardUtility.strSplitMark + Minion.战场位置.ToString() + CardUtility.strSplitMark + 施加状态); }