本文整理汇总了C#中FOnline.Critter.GetMap方法的典型用法代码示例。如果您正苦于以下问题:C# Critter.GetMap方法的具体用法?C# Critter.GetMap怎么用?C# Critter.GetMap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FOnline.Critter
的用法示例。
在下文中一共展示了Critter.GetMap方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ChooseAttackPosition
public UInt16Array ChooseAttackPosition(Critter npc, Critter target, AttackChoice attackChoice)
{
var weapon = npc.GetItemById (attackChoice.WeaponId);
if (weapon == null)
return null;
var weaponDistance = weapon.Proto.WeaponMaxDist (attackChoice.WeaponUse);
var distance = Global.GetDistance (npc, target);
if (weaponDistance < distance) {
var direction = Global.GetDirection (npc, target);
var hexX = npc.HexX;
var hexY = npc.HexY;
do {
npc.GetMap ().MoveHexByDir (ref hexX, ref hexY, direction, 1);
} while(!npc.GetMap ().IsHexPassed (hexX, hexY));
var result = new UInt16Array ();
result.Add (hexX);
result.Add (hexY);
result.Add ((ushort)direction);
return result;
}
return null;
}
示例2: ChooseNextTarget
public Critter ChooseNextTarget(Critter npc, Critter currentTarget)
{
var enemyStack = new UIntArray ();
npc.GetEnemyStack (enemyStack);
for (int i = 0; i < enemyStack.Length; i++) {
if (enemyStack [i] != 0) {
var target = npc.GetMap ().GetCritter (enemyStack [i]);
if (target != null)
return target;
}
}
return null;
}