Beispiel #1
0
 public bool Rollback(PlayerBusiness player)
 {
     //退回绑金
     if (m_bond > 0)
     {
         player.AddBond(m_bond, FinanceType.IntoScene);
     }
     return true;
 }
Beispiel #2
0
 public bool Execute(PlayerBusiness player, out string msg)
 {
     //消耗绑金
     if (m_bond > 0)
     {
         if (!player.AddBond(-m_bond, FinanceType.IntoScene))
         {
             msg = m_msg;
             return false;
         }
     }
     msg = null;
     return true;
 }
Beispiel #3
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);
 }