Exemple #1
0
 public bool Rollback(PlayerBusiness player)
 {
     //退回石币
     if (m_score > 0)
     {
         player.AddScore(m_score, FinanceType.IntoScene);
     }
     return true;
 }
Exemple #2
0
        /// <summary>
        /// 进入扣除
        /// </summary>
        /// <param name="player"></param>
        public override bool IntoPart(PlayerBusiness player)
        {
            if (BurdenManager.GoodsCount(player.B0, m_elements[0]) > 0)
            {
                //请先处理包袱中的【守护凭证】后再进入
                player.Call(ClientCommand.IntoSceneR, false, null,TipManager.GetMessage(ClientReturn.ProBusiness1));
                return false;
            }

            Dictionary<string, Variant> dic = new Dictionary<string, Variant>();
            Variant v = new Variant();
            v.Add("Number1", 1);
            v.Add("EndTime", this.EndTime.AddHours(1));//活动结束后一个小时道具过期

            dic.Add(m_elements[0], v);

            if (BurdenManager.IsFullBurden(player.B0, dic))
            {
                //包袱满,请整理你的包袱再进行该操作
                player.Call(ClientCommand.IntoSceneR, false, null, TipManager.GetMessage(ClientReturn.ProBusiness2));
                return false;
            }

            bool pass = (m_part.Coin == 0 && m_part.Score == 0);
            if ((!pass) && m_part.Score > 0)
            {
                pass = player.AddScore(-m_part.Score, FinanceType.Part);
            }
            if ((!pass) && m_part.Coin > 0)
            {
                pass = player.AddCoin(-m_part.Coin, FinanceType.Part);
            }
            if (!pass)
            {
                player.Call(ClientCommand.IntoSceneR, false, null, m_part.CoinMsg);
                return false;
            }

            if (m_part.MaxInto > 0)
            {
                m_playerInto.SetOrInc(player.PID, 1);
            }

            //进入场景成功,发送道具
            player.AddGoods(dic, GoodsSource.Pro);
            player.MoreFight = 0;
            player.NoFight = 0;
            player.Call(ActivityCommand.GetDefendCardR, MainScene.Players.Count);
            //进入守护战争,记录活跃度
            player.AddAcivity(ActivityType.Pro, 1);
            return true;
        }
Exemple #3
0
 public bool Execute(PlayerBusiness player, out string msg)
 {
     //消耗石币
     if (m_score > 0)
     {
         if (!player.AddScore(-m_score, FinanceType.IntoScene))
         {
             msg = m_msg;
             return false;
         }
     }
     msg = null;
     return true;
 }
Exemple #4
0
        /// <summary>
        /// 进入扣除
        /// </summary>
        /// <param name="player"></param>
        public virtual bool IntoPart(PlayerBusiness player)
        {
            bool pass = (m_part.Score == 0 && m_part.Coin == 0);

            if ((!pass) && m_part.Score > 0)
            {
                pass = player.AddScore(-m_part.Score, FinanceType.Part);
            }
            if ((!pass) && m_part.Coin > 0)
            {
                pass = player.AddCoin(-m_part.Coin, FinanceType.Part);
            }

            if (pass)
            {
                if (m_part.MaxInto > 0)
                {
                    m_playerInto.SetOrInc(player.PID, 1);
                }
            }
            else
            {
                player.Call(ClientCommand.IntoSceneR, false, null, m_part.CoinMsg);
            }
            return pass;
        }
Exemple #5
0
 protected void GetAward(PlayerBusiness player)
 {
     player.WriteDaily(PlayerBusiness.DailyBox, m_box.ID);
     AwardBox award = m_box.GetAward();
     if (award.Score > 0)
     {
         player.AddScore(award.Score, FinanceType.OpenBox);
     }
     if (award.Bond > 0)
     {
         player.AddBond(award.Bond, FinanceType.OpenBox);
     }
     Dictionary<string, Variant> dic = new Dictionary<string, Variant>();
     foreach (var k in award.Goods)
     {
         Variant v = new Variant(1);
         v.Add("Number0", k.Value);
         dic.Add(k.Key, v);
     }
     player.AddGoods(dic, GoodsSource.OpenBox);
     //发送结果
     player.Call(ClientCommand.OpenBoxR, true, award);
 }