本文整理汇总了C#中Server.Engines.Harvest.HarvestDefinition.SendAsciiMessageTo方法的典型用法代码示例。如果您正苦于以下问题:C# HarvestDefinition.SendAsciiMessageTo方法的具体用法?C# HarvestDefinition.SendAsciiMessageTo怎么用?C# HarvestDefinition.SendAsciiMessageTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Engines.Harvest.HarvestDefinition
的用法示例。
在下文中一共展示了HarvestDefinition.SendAsciiMessageTo方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CheckRange
public virtual bool CheckRange( Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, bool timed )
{
bool inRange = ( from.Map == map && from.InRange( loc, def.MaxRange ) );
if ( !inRange )
def.SendAsciiMessageTo( from, timed ? def.TimedOutOfRangeMessage : def.OutOfRangeMessage );
return inRange;
}
示例2: FinishHarvesting
//.........这里部分代码省略.........
{
OnBadHarvestTarget( from, tool, toHarvest );
return;
}
else if ( !def.Validate( tileID ) )
{
OnBadHarvestTarget( from, tool, toHarvest );
return;
}
if ( !CheckRange( from, tool, def, map, loc, true ) )
return;
else if ( !CheckResources( from, tool, def, map, loc, true ) )
return;
else if ( !CheckHarvest( from, tool, def, toHarvest ) )
return;
HarvestBank bank = def.GetBank( map, loc.X, loc.Y );
if ( bank == null )
return;
HarvestVein vein = bank.Vein;
if ( vein != null )
vein = MutateVein( from, tool, def, bank, toHarvest, vein );
if ( vein == null )
return;
HarvestResource primary = vein.PrimaryResource;
HarvestResource fallback = vein.FallbackResource;
HarvestResource resource = MutateResource( from, tool, def, map, loc, vein, primary, fallback );
double skillBase = from.Skills[def.Skill].Base;
double skillValue = from.Skills[def.Skill].Value;
Type type = null;
if ( skillBase >= resource.ReqSkill && from.CheckSkill( def.Skill, resource.MinSkill, resource.MaxSkill ) )
{
type = GetResourceType( from, tool, def, map, loc, resource );
if ( type != null )
type = MutateType( type, from, tool, def, map, loc, resource );
if ( type != null )
{
Item item = Construct( type, from );
if ( item == null )
{
type = null;
}
else
{
if ( item.Stackable )
{
if ( map == Map.Felucca && bank.GetCurrentFor( from ) >= def.ConsumedPerFeluccaHarvest )
item.Amount = def.ConsumedPerFeluccaHarvest;
else
item.Amount = def.ConsumedPerHarvest;
}
bank.Consume( def, item.Amount );
if ( Give( from, item, def.PlaceAtFeetIfFull ) )
{
SendSuccessTo( from, item, resource );
}
else
{
SendPackFullTo( from, item, def, resource );
item.Delete();
}
if ( tool is IUsesRemaining )
{
IUsesRemaining toolWithUses = (IUsesRemaining)tool;
toolWithUses.ShowUsesRemaining = true;
if ( toolWithUses.UsesRemaining > 0 )
--toolWithUses.UsesRemaining;
if ( toolWithUses.UsesRemaining < 1 )
{
tool.Delete();
def.SendAsciiMessageTo( from, def.ToolBrokeMessage );
}
}
}
}
}
if ( type == null )
def.SendAsciiMessageTo( from, def.FailMessage );
OnHarvestFinished( from, tool, def, vein, bank, resource, toHarvest );
}
示例3: SendPackFullTo
public virtual void SendPackFullTo( Mobile from, Item item, HarvestDefinition def, HarvestResource resource )
{
def.SendAsciiMessageTo( from, def.PackFullMessage );
}
示例4: CheckResources
public virtual bool CheckResources( Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, bool timed )
{
HarvestBank bank = def.GetBank( map, loc.X, loc.Y );
bool available = ( bank != null && bank.GetCurrentFor( from ) >= def.ConsumedPerHarvest );
if ( !available )
def.SendAsciiMessageTo( from, timed ? def.DoubleHarvestMessage : def.NoResourcesMessage );
return available;
}