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


C# Fighter.Teleport方法代码示例

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


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

示例1: SymetryMove

 public static void SymetryMove(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castcellid)
 {
     var direction = ShapesProvider.GetDirectionFromTwoCells(fighter.CellId, castcellid);
     var line = ShapesProvider.GetLineFromDirection(fighter.CellId, 2, direction);
     short destinationCell = line.Last();
     if (fighter.Fight.IsObstacle(destinationCell))
     {
         var target = fighter.Fight.GetFighter(destinationCell);
         if (target != null)
         {
             SwitchPosition(fighter, null, null, new List<Fighter>() { target }, destinationCell);
         }
     }
     else
     {
         fighter.Teleport(destinationCell);
     }
 }
开发者ID:thomasvinot,项目名称:Symbioz,代码行数:18,代码来源:MovementEffects.cs

示例2: SymetryToTargetMove

 public static void SymetryToTargetMove(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castcellid)
 {
     var symetrySource = fighter.Fight.GetFighter(castcellid);
     if (symetrySource == null)
         return;
     var target = fighter.Fight.GetFighter(castcellid);
     var direction = ShapesProvider.GetDirectionFromTwoCells(target.CellId, fighter.CellId);
     short destinationCell = (short)((target.CellId * 2) - fighter.CellId);
     if (ShapesProvider.IsDiagonalDirection(direction))
     {
         if (PathHelper.GetDistanceBetween(fighter.CellId, target.CellId) % 2 != 0) {
             destinationCell = (short)((target.CellId * 2) - fighter.CellId - 1);
         }
         else
             destinationCell = (short)((target.CellId * 2) - fighter.CellId);
     }
     else if (PathHelper.GetDistanceBetween(fighter.CellId, castcellid) % 2 != 0)
     {
         destinationCell = (short)((target.CellId * 2) - fighter.CellId -1);
     }
     if (fighter.Fight.IsObstacle(destinationCell) && fighter.Fight.GetFighter(destinationCell) == null)
         return;
     if (fighter.Fight.GetFighter(destinationCell) != null)
     {
         SwitchPosition(fighter, null, null, new List<Fighter>() { fighter.Fight.GetFighter(destinationCell) }, destinationCell);
     }
     else
     {
         fighter.Teleport(destinationCell);
     }
 }
开发者ID:thomasvinot,项目名称:Symbioz,代码行数:31,代码来源:MovementEffects.cs

示例3: SwitchPosition

 public static void SwitchPosition(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castcellid)
 {
     bool save = true;
     if(effect != null && effect.BaseEffect.EffectType == EffectsEnum.Eff_1100)
     {
         save = false;
     }
     var target = affecteds.Find(x => x.CellId == castcellid);
     if (target != null)
     {
         target.Teleport(fighter.CellId,save);
         fighter.Teleport(castcellid,save);
     }
 }
开发者ID:thomasvinot,项目名称:Symbioz,代码行数:14,代码来源:MovementEffects.cs


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