本文整理汇总了C#中Game.Server.GameObjects.GamePlayer.RemoveGold方法的典型用法代码示例。如果您正苦于以下问题:C# GamePlayer.RemoveGold方法的具体用法?C# GamePlayer.RemoveGold怎么用?C# GamePlayer.RemoveGold使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Game.Server.GameObjects.GamePlayer
的用法示例。
在下文中一共展示了GamePlayer.RemoveGold方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleCommand
public bool HandleCommand(TankMarryLogicProcessor process, GamePlayer player, GSPacketIn packet)
{
if (player.CurrentMarryRoom != null/* && player.CurrentMarryRoom.RoomState == eRoomState.FREE*/)
{
int userID = packet.ReadInt();
int templateID = packet.ReadInt();
//ItemTemplateInfo template = ItemMgr.FindItemTemplate(templateID);
ShopItemInfo temp = ShopMgr.FindShopbyTemplatID(templateID).FirstOrDefault();
if (temp != null)
{
if(temp.APrice1 == -2)
{
if(player.PlayerCharacter.Gold >= temp.AValue1)
{
player.RemoveGold(temp.AValue1);
//0 player.CurrentMarryRoom.ReturnPacket(player, packet);
player.CurrentMarryRoom.ReturnPacketForScene(player, packet);
player.Out.SendMessage(eMessageType.ChatNormal, LanguageMgr.GetTranslation("UserFirecrackersCommand.Successed1", temp.AValue1));
return true;
}
else
{
player.Out.SendMessage(eMessageType.ERROR, LanguageMgr.GetTranslation("UserFirecrackersCommand.GoldNotEnough"));
}
}
if (temp.APrice1 == -1)
{
if (player.PlayerCharacter.Money >= temp.AValue1)
{
player.RemoveMoney(temp.AValue1);
LogMgr.LogMoneyAdd(LogMoneyType.Marry, LogMoneyType.Marry_Flower, player.PlayerCharacter.ID, temp.AValue1, player.PlayerCharacter.Money, 0, 0, 0,0, "", "", "");
player.CurrentMarryRoom.ReturnPacketForScene(player, packet);
player.Out.SendMessage(eMessageType.ChatNormal, LanguageMgr.GetTranslation("UserFirecrackersCommand.Successed2", temp.AValue1));
return true;
}
else
{
player.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation("UserFirecrackersCommand.MoneyNotEnough"));
}
}
}
}
return false;
}