Exemple #1
0
 /// <summary>
 /// 安装+1马的方法
 /// </summary>
 /// <param name="aHorse">被安装的牌</param>
 /// <param name="aObj">游戏事件对象</param>
 /// <param name="aData">游戏数据</param>
 internal void LoadJia1(Card aHorse, GlobalEvent aObj, GlobalData aData)
 {
     if (Jia1Ma != null)
     {
         aObj.DropCards(true, GlobalEvent.CardFrom.Equipage, string.Empty, new Card[] { Jia1Ma }, Card.Effect.None, Chief, null, null);
     }
     Jia1Ma = aHorse;
     aObj.DropCards(false, GlobalEvent.CardFrom.None, string.Empty, new Card[] { aHorse }, aHorse.CardEffect, Chief, Chief, null);
 }
Exemple #2
0
        //internal void LoadHorse(Card aHorse, GlobalEvent aObj)
        //{
        //    switch (aHorse.CardEffect)
        //    {
        //        case Card.Effect.Jia1:
        //            if (Jia1Ma != null)
        //                aObj.EventNode(true, GlobalEvent.CardFrom.Equipage, string.Empty, new Card[] { Jia1Ma }, Card.Effect.None, null, null, null);

        //            Jia1Ma = aHorse;
        //            aObj.EventNode(false, GlobalEvent.CardFrom.None, string.Empty, new Card[] { aHorse }, aHorse.CardEffect, Chief, Chief, null);
        //            break;
        //        case Card.Effect.Jian1:
        //            if (Jian1Ma != null)
        //                aObj.EventNode(true, GlobalEvent.CardFrom.Equipage, string.Empty, new Card[] { Jian1Ma }, Card.Effect.None, null, null, null);
        //            Jian1Ma = aHorse;
        //            aObj.EventNode(false, GlobalEvent.CardFrom.None, string.Empty, new Card[] { aHorse }, aHorse.CardEffect, Chief, Chief, null);
        //            break;
        //    }

        //}


        //internal void UnloadHorse(GlobalEvent aObj)
        //{

        //}

        /// <summary>
        /// 安装防具的方法
        /// </summary>
        /// <param name="aArmor">被安装的牌</param>
        /// <param name="aObj">游戏事件对象</param>
        internal void LoadArmor(Card aArmor, GlobalEvent aObj)
        {
            if (Armor != null)
            {
                aObj.DropCards(true, GlobalEvent.CardFrom.Equipage, string.Empty, new Card[] { Armor }, Card.Effect.None, Chief, null, null);
            }
            aObj.AsynchronousCore.SendMessage(
                new Beaver("armor.load", Chief.ChiefName, aArmor.CardEffect.ToString(), Card.Cards2Beaver("cards", new Card[] { aArmor })).ToString());
            //new XElement("armor.load",
            //    new XElement("target", Chief.ChiefName),
            //    new XElement("effect", aArmor.CardEffect),
            //    Card.Cards2XML("cards", new Card[] { aArmor })
            //)
            //);
            Armor = aArmor;
            aObj.DropCards(false, GlobalEvent.CardFrom.None, string.Empty, new Card[] { aArmor }, aArmor.CardEffect, Chief, Chief, null);
        }
Exemple #3
0
 /// <summary>
 /// 安装武器的方法
 /// </summary>
 /// <param name="aWeapon">被安装的牌</param>
 /// <param name="aObj">游戏事件对象</param>
 /// <param name="aData">游戏数据</param>
 internal void LoadWeapon(Card aWeapon, GlobalEvent aObj, GlobalData aData)
 {
     if (Weapon != null)
     {
         aObj.DropCards(true, GlobalEvent.CardFrom.Equipage, string.Empty, new Card[] { Weapon }, Card.Effect.None, Chief, null, null);
     }
     Weapon = aWeapon;
     SGS.ServerCore.Contest.Equipage.Weapon.ActiveWeapon(Weapon.CardEffect, aData);
     aData.Game.AsynchronousCore.SendMessage(
         new Beaver("weapon.load", Chief.ChiefName, aWeapon.CardEffect.ToString(), Card.Cards2Beaver("cards", new Card[] { aWeapon })).ToString());
     //new XElement("weapon.load",
     //    new XElement("target", Chief.ChiefName),
     //    new XElement("effect" , aWeapon.CardEffect),
     //    Card.Cards2XML("cards", new Card[] { aWeapon })
     //)
     //);
     foreach (ASkill s in Chief.Skills)
     {
         s.WeaponUpdated(Chief, Weapon, aData);
     }
     aObj.DropCards(false, GlobalEvent.CardFrom.None, string.Empty, new Card[] { aWeapon }, aWeapon.CardEffect, Chief, Chief, null);
 }