本文整理汇总了C#中Server.Items.Gold.Consume方法的典型用法代码示例。如果您正苦于以下问题:C# Gold.Consume方法的具体用法?C# Gold.Consume怎么用?C# Gold.Consume使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Items.Gold
的用法示例。
在下文中一共展示了Gold.Consume方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnGoldGiven
public virtual bool OnGoldGiven( Mobile from, Gold dropped )
{
if ( CheckTeachingMatch( from ) )
{
int goldtaken = Teach( m_Teaching, from, dropped.Amount / TeachScalar, true ) * TeachScalar;
if ( goldtaken > 0 )
{
dropped.Consume( goldtaken );
return dropped == null || dropped.Deleted || dropped.Amount <= 0;
}
}
else if ( IsHumanInTown() )
{
Direction = GetDirectionTo( from );
int oldSpeechHue = this.SpeechHue;
this.SpeechHue = 0x23F;
SayTo( from, "Thou art giving me gold?" );
if ( dropped.Amount >= 400 )
SayTo( from, "'Tis a noble gift." );
else
SayTo( from, "Money is always welcome." );
from.Karma += Math.Max( dropped.Amount / 10, 100 );
this.SpeechHue = 0x3B2;
SayTo( from, 501548 ); // I thank thee.
this.SpeechHue = oldSpeechHue;
dropped.Delete();
return true;
}
return false;
}
示例2: AddGoldPile
public bool AddGoldPile(Gold gold)
{
if ( !GoldLedger )
return false;
gold.Amount = (int)AddGoldAmount((ulong)gold.Amount);
if (gold.Amount == 0)
{
gold.Consume();
return true;
}
return false;
}