Ejemplo n.º 1
0
 /// <summary>
 /// 经验宝珠
 /// </summary>
 /// <param name="player"></param>
 /// <param name="c"></param>
 /// <param name="number"></param>
 /// <returns></returns>
 private static bool UseAddExp(PlayerBusiness player, GameConfig c, int number = 1)
 {
     //检查使用限制..
     //if (!SupplyLimit(note, c)) return;
     int p1exp = c.Value.GetIntOrDefault("P1exp") * number;
     if (p1exp > 0)
     {
         player.AddExperience(p1exp, FinanceType.UseGoods);
         return true;
     }
     int p2exp = c.Value.GetIntOrDefault("P2exp") * number;
     if (p2exp > 0)
     {
         if (player.Pet == null)
         {
             //没有出战的宠物不能使用
             player.Call(GoodsCommand.UseGoodsR, false, TipManager.GetMessage(GoodsReturn.UseAddExp));
             return false;
         }
         return player.AddPetExp(player.Pet, p2exp, true,(int)FinanceType.UseGoods);
     }
     int m1exp = c.Value.GetIntOrDefault("M1exp") * number;
     if (m1exp > 0)
     {
         if (player.Mounts == null)
         {
             player.Call(GoodsCommand.UseGoodsR, false, TipManager.GetMessage(GoodsReturn.NoMounts));
             return false;
         }
         return player.AddMounts(m1exp, GoodsSource.DoubleUse);
     }
     return false;
 }