当前位置: 首页>>代码示例>>C#>>正文


C# HarvestDefinition.SendAsciiMessageTo方法代码示例

本文整理汇总了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;
        }
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:9,代码来源:HarvestSystem.cs

示例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 );
        }
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:101,代码来源:HarvestSystem.cs

示例3: SendPackFullTo

 public virtual void SendPackFullTo( Mobile from, Item item, HarvestDefinition def, HarvestResource resource )
 {
     def.SendAsciiMessageTo( from, def.PackFullMessage );
 }
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:4,代码来源:HarvestSystem.cs

示例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;
        }
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:11,代码来源:HarvestSystem.cs


注:本文中的Server.Engines.Harvest.HarvestDefinition.SendAsciiMessageTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。