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


C# World.DiscoverTerrainAroundPlayer方法代码示例

本文整理汇总了C#中World.DiscoverTerrainAroundPlayer方法的典型用法代码示例。如果您正苦于以下问题:C# World.DiscoverTerrainAroundPlayer方法的具体用法?C# World.DiscoverTerrainAroundPlayer怎么用?C# World.DiscoverTerrainAroundPlayer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在World的用法示例。


在下文中一共展示了World.DiscoverTerrainAroundPlayer方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CastSpell

        public bool CastSpell(ICreature caster, Vector2 targetWorldIndex, AreaOfEffect affectedArea, World world)
        {
            ITerrain targetTile = world.Tiles[(int)targetWorldIndex.X, (int)targetWorldIndex.Y];

            if (targetTile.IsExploredByPlayer && targetTile.CanCreatureEnter(caster) && world.IsWorldIndexFreeOfObstacles(targetWorldIndex))
            {
                caster.WorldIndex = targetWorldIndex;
                world.CenterCameraOnPlayer();
                world.DiscoverTerrainAroundPlayer();
            }
            else
            {
                Announcer.Instance.Announce(caster.Name + " tried to teleport, but could not.", MessageTypes.SpellFailure);
            }

            return true;
        }
开发者ID:faintpixel,项目名称:Roguelike,代码行数:17,代码来源:TeleportStrategy.cs

示例2: EffectCompleted

        public void EffectCompleted(ICreature creature, World world)
        {
            if (creature.ViewDistance.Current + _amountToReduceVisionBy >= creature.ViewDistance.Maximum)
            {
                creature.ViewDistance.Current = creature.ViewDistance.Maximum;
                Announcer.Instance.Announce(creature.Name + "'s vision returned to normal!", MessageTypes.Other);
            }
            else
            {
                creature.ViewDistance.Current += _amountToReduceVisionBy;
                Announcer.Instance.Announce(creature.Name + "'s vision improved.", MessageTypes.Other);
            }

            world.DiscoverTerrainAroundPlayer();

            if (Completed != null)
                Completed(this);
        }
开发者ID:faintpixel,项目名称:Roguelike,代码行数:18,代码来源:ReducedVisionTemporaryEffect.cs

示例3: ApplyEffect

 public void ApplyEffect(ICreature creature, World world)
 {
     creature.ViewDistance.Current -= _amountToReduceVisionBy;
     if (creature.IsPlayer() == true)
         world.DiscoverTerrainAroundPlayer();
 }
开发者ID:faintpixel,项目名称:Roguelike,代码行数:6,代码来源:ReducedVisionTemporaryEffect.cs


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