示例#1
0
 public override void AfterTurnEnd(ChiefBase aChief, GlobalData aData)
 {
     TotalCount      = 0;
     HasRegainHealth = false;
 }
示例#2
0
 public override bool ActiveSkill(string aSkillName, Card[] aCards, ChiefBase aChief, ChiefBase[] aTargets, MessageCore.AskForEnum aAskFor, ref Card.Effect aEffect, GlobalData aData)
 {
     if (aSkillName == SkillName)
     {
         if (SkillStatus != SkillEnabled.Enable)
         {
             return(false);
         }
         if (!aData.Game.GamePlayers[aChief].HasHand)
         {
             return(false);
         }
         if (aCards.Count() != 0)
         {
             return(false);
         }
         if (aTargets.Count() == 0 || aData.Game.GamePlayers[aTargets[0]].Dead || aTargets[0] == aChief)
         {
             return(false);
         }
     }
     return(true);
 }
示例#3
0
 public override bool EffectFeasible(Card[] aCards, Card.Effect aEffect, ChiefBase aTarget, bool aFeasible, GlobalData aData)
 {
     switch (aEffect)
     {
     case Card.Effect.ShunShouQianYang:
     case Card.Effect.LeBuSiShu:
         return(false);
     }
     return(aFeasible);
 }
示例#4
0
 public override void AfterTurnEnd(ChiefBase aChief, GlobalData aData)
 {
     aChief.SlotsBuffer[Top].Cards.Clear();
     aChief.SlotsBuffer[Bottom].Cards.Clear();
     aChief.SlotsBuffer[Total].Cards.Clear();
 }
示例#5
0
        public override void BeforeTurnStart(ChiefBase aChief, GlobalData aData)
        {
            aChief.SlotsBuffer[Top].Cards.Clear();
            aChief.SlotsBuffer[Bottom].Cards.Clear();
            aChief.SlotsBuffer[Total].Cards.Clear();
            aData.Game.AsynchronousCore.SendMessage(MessageCore.MakeAskForSkillMessage(aChief, this));
            MessageCore.AskForResult res = aData.Game.AsynchronousCore.AskForYN(aChief);
            if (res.YN)
            {
                int alive = aData.Game.GamePlayers.PeoplealiveCount;
                alive = alive > 5 ? 5 : alive;
                Card[] cards = aData.Game.CardsHeap.Pop(alive);
                aChief.SlotsBuffer[Total].Cards.AddRange(cards);
                aData.Game.AsynchronousCore.SendMessage(MessageCore.MakeTriggerSkillMesssage(aChief, this, new ChiefBase[] { }, new Card[] { }));
                aData.Game.AsynchronousCore.SendPrivateMessageWithOpenMessage(aChief,
                                                                              new Beaver("askfor.guanxing.cards", aChief.ChiefName, Card.Cards2Beaver("cards", cards)).ToString().ToString(),
                                                                              new Beaver("askfor.guanxing.cards", aChief.ChiefName).ToString(),
                                                                              aData.Game.GamePlayers);
                //new XElement("askfor.guanxing.cards", new XElement("target", aChief.ChiefName), Card.Cards2XML("cards", cards)),
                //new XElement("askfor.guanxing.cards", new XElement("target", aChief.ChiefName)),
                //aData.Game.GamePlayers
                //);
                res = aData.Game.AsynchronousCore.AskForCards(aChief, MessageCore.AskForEnum.SlotCards, aChief);
                List <Card> target = aChief.SlotsBuffer[Top].Cards;
                foreach (Card c in  res.Cards)
                {
                    if (!cards.Contains(c))
                    {
                        if (c.ID == 0)
                        {
                            target = aChief.SlotsBuffer[Bottom].Cards;
                        }
                        else
                        {
                            aChief.SlotsBuffer[Top].Cards.Clear();
                            aChief.SlotsBuffer[Bottom].Cards.AddRange(cards);
                            break;
                        }
                    }
                    else
                    {
                        target.Add(c);
                    }
                }
                if ((aChief.SlotsBuffer[Top].Cards.Count + aChief.SlotsBuffer[Bottom].Cards.Count) != cards.Count())
                {
                    aChief.SlotsBuffer[Top].Cards.Clear();
                    aChief.SlotsBuffer[Bottom].Cards.AddRange(cards);
                }

                aData.Game.AsynchronousCore.SendMessage(
                    new Beaver("guanxing.info", aChief.SlotsBuffer[Top].Cards.Count.ToString(), aChief.SlotsBuffer[Bottom].Cards.Count.ToString()).ToString());
                //new XElement("guanxing.info",
                //    new XElement("up", aChief.SlotsBuffer[Top].Cards.Count),
                //    new XElement("down", aChief.SlotsBuffer[Bottom].Cards.Count)
                //    )
                //    );
                aData.Game.CardsHeap.PutOnTop(aChief.SlotsBuffer[Top].Cards.ToArray());
                aData.Game.CardsHeap.PutOnBottom(aChief.SlotsBuffer[Bottom].Cards.ToArray());
                aChief.SlotsBuffer[Top].Cards.Clear();
                aChief.SlotsBuffer[Bottom].Cards.Clear();
                aChief.SlotsBuffer[Total].Cards.Clear();
            }
        }
示例#6
0
 public override bool ActiveSkill(string aSkillName, Card[] aCards, ChiefBase aChief, ChiefBase[] aTargets, MessageCore.AskForEnum aAskFor, ref Card.Effect aEffect, GlobalData aData)
 {
     if (SkillName == aSkillName)
     {
         if (SkillStatus != SkillEnabled.Enable)
         {
             return(false);
         }
         if (aAskFor != MessageCore.AskForEnum.Aggressive)
         {
             return(false);
         }
         if (aCards.Count() != 0)
         {
             return(false);
         }
     }
     return(true);
 }
示例#7
0
 public override void AfterTurnEnd(ChiefBase aChief, GlobalData aData)
 {
     Active = false;
 }
示例#8
0
 public override void BeforeTurnStart(ChiefBase aChief, GlobalData aData)
 {
     aData.ShaNoLimit = true;
 }
示例#9
0
 public override void AfterTurnEnd(ChiefBase aChief, GlobalData aData)
 {
     aData.ShaNoLimit = false;
 }
示例#10
0
        public override MessageCore.AskForResult AskFor(ChiefBase aChief, MessageCore.AskForEnum aAskFor, GlobalData aData)
        {
            if (aData.Game.Response.SkillName == SkillName && aChief.ChiefStatus == ChiefBase.Status.Majesty && (aAskFor == MessageCore.AskForEnum.Sha || aAskFor == MessageCore.AskForEnum.Aggressive) && SkillStatus == SkillEnabled.Enable)
            {
                SwitchSkillStatus(aChief, SkillEnabled.Disable, aData);
                ChiefBase[] targets = Player.Players2Chiefs(aData.Game.Response.Targets);
                aData.Game.AsynchronousCore.SendMessage(MessageCore.MakeTriggerSkillMesssage(aChief, this, targets, new Card[] { }));
                ChiefBase t = aChief.Next;

                while (!t.IsMe(aChief))
                {
                    if (t.ChiefCamp == ChiefBase.Camp.Shu)
                    {
                        string msg = new Beaver("askfor.jijiang.sha", t.ChiefName).ToString();
                        new XElement("askfor.jijiang.sha",
                                     new XElement("target", t.ChiefName)
                                     );
                        MessageCore.AskForResult res2 = aData.Game.AsynchronousCore.AskForCards(t, MessageCore.AskForEnum.Sha, new AskForWrapper(msg, aData.Game), aData);
                        if (res2.Effect == Card.Effect.Sha)
                        {
                            aData.Game.AsynchronousCore.SendMessage(
                                new Beaver("jijiang.sha", t.ChiefName, Card.Cards2Beaver("cards", res2.Cards), res2.SkillName).ToString());
                            //new XElement("jijiang.sha",
                            //    new XElement("target", t.ChiefName),
                            //    Card.Cards2XML("cards", res2.Cards),
                            //    new XElement("skill" , res2.SkillName)
                            //    )
                            //);
                            if (res2.PlayerLead)
                            {
                                aData.Game.DropCards(true, GlobalEvent.CardFrom.Hand, string.Empty, res2.Cards, Card.Effect.Sha, t, null, null);
                            }
                            return(new MessageCore.AskForResult(false, aChief, targets, res2.Cards, Card.Effect.Sha, false, false, SkillName));
                        }
                    }
                    t = t.Next;
                }
            }
            return(null);
        }
示例#11
0
 public override void WeaponUpdated(ChiefBase aChief, Card aWeapon, GlobalData aData)
 {
     aData.ShaNoLimit = true;
 }
示例#12
0
 public override bool ActiveSkill(string aSkillName, Card[] aCards, ChiefBase aChief, ChiefBase[] aTargets, MessageCore.AskForEnum aAskFor, ref Card.Effect aEffect, GlobalData aData)
 {
     if (aSkillName == SkillName)
     {
         if (SkillStatus == SkillEnabled.Enable && (aAskFor == MessageCore.AskForEnum.Sha || aAskFor == MessageCore.AskForEnum.Aggressive) && aCards.Count() == 0)
         {
             if (aAskFor == MessageCore.AskForEnum.Aggressive)
             {
                 //若出杀有限制且已经没有机会杀了不能执行
                 if (!aData.ShaNoLimit && aData.KillRemain < 1)
                 {
                     return(false);                                           //false
                 }
                 //杀的目标数量高于最大值不能执行
                 if (aData.Game.CalcMaxShaTargets(aChief, aCards) < aTargets.Count())
                 {
                     return(false);                                                                  //false
                 }
                 //没有目标不能执行
                 if (aTargets.Count() == 0)
                 {
                     return(false);                       //false
                 }
                 //遍历目标集合,如果目标有自己或者目标已死亡或者 够不到对方不能执行
                 foreach (ChiefBase c in aTargets)
                 {
                     if (c.IsMe(aChief) || aData.Game.GamePlayers[c].Dead || !aData.Game.WithinShaRange(aChief, c))
                     {
                         return(false); //false
                     }
                     bool Enable = true;
                     foreach (ASkill s in c.Skills)
                     {
                         Enable = s.EffectFeasible(aCards, aEffect, c, Enable, aData);
                     }
                     if (!Enable)
                     {
                         return(false);
                     }
                 }
             }
             return(true);
         }
         else
         {
             return(false); //false
         }
     }
     else
     {
         return(true);
     }
 }
示例#13
0
 public override MessageCore.AskForResult AskFor(ChiefBase aChief, MessageCore.AskForEnum aAskFor, GlobalData aData)
 {
     if (aData.Game.Response.SkillName == SkillName && SkillStatus == SkillEnabled.Enable && aAskFor == MessageCore.AskForEnum.Aggressive)
     {
         SwitchSkillStatus(aChief, SkillEnabled.Disable, aData);
         ChiefBase target = aData.Game.Response.Targets[0].Chief;
         Card[]    cards  = aData.Game.Response.Cards;
         aData.Game.AsynchronousCore.SendMessage(MessageCore.MakeTriggerSkillMesssage(aChief, this, new ChiefBase[] { target }, new Card[] { }));
         TotalCount += aData.Game.Response.Cards.Count();
         aData.Game.AsynchronousCore.SendGiveMessage(aChief, target, cards, aData.Game.GamePlayers);
         aData.Game.Move(aChief, target, cards);
         if (TotalCount > 1 && !HasRegainHealth)
         {
             aData.Game.RegainHealth(aChief, 1);
             HasRegainHealth = true;
         }
     }
     return(null);
 }
示例#14
0
 public override bool ActiveSkill(string aSkillName, Card[] aCards, ChiefBase aChief, ChiefBase[] aTargets, MessageCore.AskForEnum aAskFor, ref Card.Effect aEffect, GlobalData aData)
 {
     if (SkillName == aSkillName)
     {
         if (aCards.Count() != 0 && aTargets.Count() == 1 && aTargets[0] != aChief && !aData.Game.GamePlayers[aTargets[0]].Dead)
         {
             if (!aData.Game.GamePlayers[aChief].HasCardsInHand(aCards))
             {
                 return(false);
             }
             return(true);
         }
     }
     return(true);
 }
示例#15
0
 public override byte CalcKitDistance(ChiefBase aChief, byte aOldRange, GlobalData aData)
 {
     return(100); //是的,这就是距离无限 :)
 }
示例#16
0
 public override bool ActiveSkill(string aSkillName, Card[] aCards, ChiefBase aChief, ChiefBase[] aTargets, MessageCore.AskForEnum aAskFor, ref Card.Effect aEffect, GlobalData aData)
 {
     if (aSkillName == SkillName)
     {
         if (SkillStatus == SkillEnabled.Disable)
         {
             return(false);
         }
         if (aAskFor != MessageCore.AskForEnum.AskForTao && aAskFor != MessageCore.AskForEnum.AskForTaoOrJiu)
         {
             return(false);
         }
         if (aCards.Count() != 1)
         {
             return(false);
         }
         if (!aData.Game.GamePlayers[aChief].HasCardsInHandOrEquipage(aCards))
         {
             return(false);
         }
         if (aCards[0].CardHuaSe != Card.Suit.HongTao && aCards[0].CardHuaSe != Card.Suit.FangPian)
         {
             return(false);
         }
     }
     return(true);
 }
示例#17
0
 public override void FinishAskfor(ChiefBase aChief, MessageCore.AskForEnum aEffect, GlobalData aData)
 {
     if (aEffect == MessageCore.AskForEnum.Aggressive && SkillStatus == SkillEnabled.Disable)
     {
         SwitchSkillStatus(aChief, SkillEnabled.Disable, aData);
     }
 }
示例#18
0
 public override MessageCore.AskForResult AskFor(ChiefBase aChief, MessageCore.AskForEnum aAskFor, GlobalData aData)
 {
     if (aData.Game.Response.SkillName == SkillName)
     {
         if (SkillStatus == SkillEnabled.Enable)
         {
             SwitchSkillStatus(aChief, SkillEnabled.Disable, aData);
             aData.Game.AsynchronousCore.SendMessage(MessageCore.MakeTriggerSkillMesssage(aChief, this, new ChiefBase[] { }, aData.Game.Response.Cards));
             aData.Game.DropCards(true, GlobalEvent.CardFrom.HandAndEquipage, SkillName, aData.Game.Response.Cards, Card.Effect.Tao, aChief, null, null);
             return(new MessageCore.AskForResult(false, aChief, new ChiefBase[] { }, aData.Game.Response.Cards, Card.Effect.Tao, false, false, SkillName));
         }
     }
     return(null);
 }
示例#19
0
 public override MessageCore.AskForResult AskFor(ChiefBase aChief, MessageCore.AskForEnum aAskFor, GlobalData aData)
 {
     if (aAskFor == MessageCore.AskForEnum.Aggressive && SkillStatus == SkillEnabled.Enable)
     {
         SwitchSkillStatus(aChief, SkillEnabled.Disable, aData);
         aData.Game.AsynchronousCore.SendMessage(MessageCore.MakeTriggerSkillMesssage(aChief, this, new ChiefBase[] { }, new Card[] { }));
         aData.Game.DamageHealth(aChief, 1, null, new GlobalEvent.EventRecoard(aChief, aChief, new Card[] { }, Card.Effect.Skill, SkillName));
         aData.Game.TakeingCards(aChief, 2);
         return(new MessageCore.AskForResult(false, aChief, new ChiefBase[] { }, new Card[] { }, Card.Effect.Skill, false, false, SkillName));
     }
     return(null);
 }
示例#20
0
 public override void Leading(ChiefBase aChief, GlobalData aData)
 {
     SwitchSkillStatus(aChief, SkillEnabled.Enable, aData);
 }
示例#21
0
 public override sbyte CalcDamage(ChiefBase aChief, Card.Effect aEffect, sbyte aDamage, GlobalData aData)
 {
     if (Active)
     {
         switch (aEffect)
         {
         case Card.Effect.Sha:
         case Card.Effect.JueDou:
             return(++aDamage);
         }
     }
     return(aDamage);
 }
示例#22
0
 public override void Leading(ChiefBase aChief, GlobalData aData)
 {
     OnLeading    = true;
     UseShaEffect = false;
 }
示例#23
0
 public override bool EffectFeasible(Card[] aCards, Card.Effect aEffect, ChiefBase aTarget, bool aFeasible, GlobalData aData)
 {
     switch (aEffect)
     {
     case Card.Effect.Sha:
     case  Card.Effect.JueDou:
         if (aData.Game.GamePlayers[aTarget].Hands.Count == 0)
         {
             return(false);
         }
         break;
     }
     return(aFeasible);
 }
示例#24
0
 public override void BeforeAskfor(ChiefBase aChief, MessageCore.AskForEnum aEffect, GlobalData aData)
 {
     if (aEffect == MessageCore.AskForEnum.Aggressive && aData.Game.GamePlayers[aChief].HasHand)
     {
         SwitchSkillStatus(aChief, SkillEnabled.Enable, aData);
     }
 }
示例#25
0
 public override void TakingCards(ChiefBase aChief, GlobalData aData)
 {
     aData.Game.AsynchronousCore.SendMessage(MessageCore.MakeTriggerSkillMesssage(aChief, this, new ChiefBase[] { }, new Card[] { }));
     aData.TakeCardsCount++;
 }
示例#26
0
 public override MessageCore.AskForResult AskFor(ChiefBase aChief, MessageCore.AskForEnum aAskFor, GlobalData aData)
 {
     if (aAskFor == MessageCore.AskForEnum.Aggressive && SkillStatus == SkillEnabled.Enable)
     {
         SwitchSkillStatus(aChief, SkillEnabled.Disable, aData);
         aData.Game.AsynchronousCore.SendMessage(MessageCore.MakeTriggerSkillMesssage(aChief, this, Player.Players2Chiefs(aData.Game.Response.Targets), aData.Game.Response.Cards));
         return(new MessageCore.AskForResult(false, aChief, Player.Players2Chiefs(aData.Game.Response.Targets), aData.Game.Response.Cards, Card.Effect.GuoHeChaiQiao, false, true, SkillName));
     }
     return(null);
 }
示例#27
0
 public override MessageCore.AskForResult AskFor(ChiefBase aChief, MessageCore.AskForEnum aAskFor, GlobalData aData)
 {
     if (aData.Game.Response.SkillName == SkillName)
     {
         if (SkillStatus == SkillEnabled.Enable && aData.Game.GamePlayers[aChief].HasHand)
         {
             SwitchSkillStatus(aChief, SkillEnabled.Disable, aData);
             aData.Game.AsynchronousCore.SendMessage(MessageCore.MakeTriggerSkillMesssage(aChief, this, Player.Players2Chiefs(aData.Game.Response.Targets), new Card[] { }));
             ChiefBase target = aData.Game.Response.Targets[0].Chief;
             aData.Game.AsynchronousCore.SendMessage(new Beaver("askfor.fanjian.suit", target.ChiefName).ToString()); // new XElement("askfor.fanjian.suit", new XElement("target", target.ChiefName)));
             MessageCore.AskForResult res = aData.Game.AsynchronousCore.AskForCards(target, MessageCore.AskForEnum.Suit, target);
             if (res.Cards.Count() == 0)
             {
                 aData.Game.AsynchronousCore.SendMessage(new Beaver("fanjian.suit", target.ChiefName, Card.Cards2Beaver("cards", new Card[] { CardHeap.HeiTao })).ToString()); // new XElement("fanjian.suit", new XElement("target", target.ChiefName), Card.Cards2XML("cards", new Card[] { CardHeap.HeiTao })));
             }
             else
             {
                 aData.Game.AsynchronousCore.SendMessage(new Beaver("fanjian.suit", target.ChiefName, Card.Cards2Beaver("cards", res.Cards)).ToString());   // new XElement("fanjian.suit", new XElement("target", target.ChiefName), Card.Cards2XML("cards", res.Cards)));
             }
             System.Threading.Thread.Sleep(10);
             aData.Game.AsynchronousCore.SendMessage(new Beaver("askfor.fanjian.card", target.ChiefName, aChief.ChiefName).ToString()); //  new XElement("askfor.fanjian.card", new XElement("target", target.ChiefName), new XElement("target2", aChief)));
             MessageCore.AskForResult res2 = aData.Game.AsynchronousCore.AskForCards(target, MessageCore.AskForEnum.TargetCard, aChief);
             Card c = aData.Game.AutoSelect(aChief);
             aData.Game.AsynchronousCore.SendMessage(new Beaver("fanjian.card", target.ChiefName, aChief.ChiefName, Card.Cards2Beaver("cards", new Card[] { c })).ToString()); // new XElement("fanjian.card", new XElement("target", target.ChiefName), new XElement("target2", aChief.ChiefName), Card.Cards2XML("cards", new Card[] { c })));
             if (c.CardHuaSe != res.Cards[0].CardHuaSe)
             {
                 aData.Game.DamageHealth(target, 1, aChief, new GlobalEvent.EventRecoard(aChief, target, new Card[] { }, Card.Effect.Skill, SkillName));
             }
             if (!aData.Game.GamePlayers[target].Dead)
             {
                 if (aData.Game.GamePlayers[aChief].HasCardsInHand(new Card[] { c }))
                 {
                     aData.Game.AsynchronousCore.SendGiveMessage(aChief, target, new Card[] { c }, aData.Game.GamePlayers);
                     aData.Game.Move(aChief, target, new Card[] { c });
                 }
                 else if (aData.Game.HasCardsInBin(new Card[] { c }))
                 {
                     if (aData.Game.PickRubbish(new Card[] { c }))
                     {
                         aData.Game.AsynchronousCore.SendPickMessage(target, new Card[] { c });
                         aData.Game.GamePlayers[aChief].Hands.Add(c.GetOriginalCard());
                     }
                 }
             }
             return(new MessageCore.AskForResult(false, aChief, new ChiefBase[] { }, new Card[] { }, Card.Effect.Skill, false, false, SkillName));
         }
     }
     return(null);
 }
示例#28
0
 public override bool ActiveSkill(string aSkillName, Card[] aCards, ChiefBase aChief, ChiefBase[] aTargets, MessageCore.AskForEnum aAskFor, ref Card.Effect aEffect, GlobalData aData)
 {
     if (SkillName == aSkillName)
     {
         if (SkillStatus != SkillEnabled.Enable)
         {
             return(false);
         }
         if (aAskFor != MessageCore.AskForEnum.Aggressive)
         {
             return(false);
         }
         if (aCards.Count() != 1)
         {
             return(false);
         }
         if (aCards[0].CardHuaSe != Card.Suit.CaoHua && aCards[0].CardHuaSe != Card.Suit.HeiTao)
         {
             return(false);
         }
         if (aTargets.Count() != 1)
         {
             return(false);
         }
         if (aTargets[0] == aChief)
         {
             return(false);
         }
         if (!aData.Game.GamePlayers[aTargets[0]].HasCardWithJudgementArea)
         {
             return(false);
         }
         if (aData.Game.GamePlayers[aTargets[0]].Dead)
         {
             return(false);
         }
         aEffect = Card.Effect.GuoHeChaiQiao;
     }
     return(true);
 }
示例#29
0
        public override int CalcAskforTimes(ChiefBase aChief, ChiefBase aTarget, Card.Effect aEffect, int aOldTimes, GlobalData aData)
        {
            switch (aEffect)
            {
            case Card.Effect.Sha:
            case Card.Effect.JueDou:
                aData.Game.AsynchronousCore.SendMessage(MessageCore.MakeTriggerSkillMesssage(aChief, this, new ChiefBase[] { aTarget }, new Card[] { }));
                return(2);

            default:
                return(aOldTimes);
            }
        }
示例#30
0
 public override void BeforeTurnStart(ChiefBase aChief, GlobalData aData)
 {
     TotalCount      = 0;
     HasRegainHealth = false;
 }