本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}