本文整理汇总了C#中Conquest.Maps.BattleMap.endUnitWalking方法的典型用法代码示例。如果您正苦于以下问题:C# BattleMap.endUnitWalking方法的具体用法?C# BattleMap.endUnitWalking怎么用?C# BattleMap.endUnitWalking使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Conquest.Maps.BattleMap
的用法示例。
在下文中一共展示了BattleMap.endUnitWalking方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: updateAINormal
// Updates the ai normally
public virtual void updateAINormal(Unit unit, BattleMap map)
{
// Variables
int[] spot;
int[] target= map.getClosestEnemy(unit.mapPos[0], unit.mapPos[1], map.getTeamID(unit.mapPos));
AttackInfo info= AttackInfo.createBasicAttack(map.getFullUnitID(unit.mapPos), target, ref map);
int heuristic;
// Get Target
info.range= new int[] {1, 1};
map.aiSearch(unit.mapPos[0], unit.mapPos[1], unit.move, info.range[1], false, map.getTeamID(unit.mapPos), info, target);
spot= map.findAISpot(unit.mapPos[0], unit.mapPos[1], info.range, map.aggressiveAI);
if(!unit.isWalkingDone)
{
ai_moveUnit(unit, map, spot, false);
map.destroyPaths();
map.endUnitWalking(map.getFullUnitID(unit.mapPos));
if(unit.isTurnEnded)
return;
}
heuristic= map.getHeuristic(unit.mapPos, map.getUnitXY(target));
if(!unit.isAttackingDone && heuristic>= info.range[0] && heuristic<= info.range[1])
{
ai_attackUnit(unit, map, info, false);
map.destroyPaths();
map.endUnitAttacking(map.getFullUnitID(unit.mapPos));
if(unit.isTurnEnded)
return;
}
}
示例2: attackUnit
//.........这里部分代码省略.........
for(int i= 0; i< allies.size; i++)
{
map.teams.items[allies.items[i][0]].units.items[allies.items[i][1]].heal(
map.teams.items[allies.items[i][0]].units.items[allies.items[i][1]].originalHealth,
ref unit,
ref map
);
}
unit.addStatEffect(
new StatEffect(
EffectType.Debuff,
"Humility",
"-75% to all stats",
healingPrayerSE,
2
),
ref map
);
if(unit.isAlive && !unit.isAI)
unit.gainExp(256*allies.size, ref map);
};break;
case "mend": {
if(victim== null)
return false;
victim.heal(-1*info.damage, ref unit, ref map);
if(unit.isAlive && !unit.isAI)
unit.gainExp(ref victim, ref map);
};break;
case "prophetic_reap": {
if(activatedPropheticReap)
return false;
activatedPropheticReap= true;
unit.addStatEffect(
new StatEffect(
EffectType.Buff,
"Prophetic Prayer",
"Deal "+((float)(unit.magic)/7f)+" damage to all enemies once dissipated",
propheticReapSE,
3
),
ref map
);
};break;
case "banish_spirits": {
if(victim== null)
return false;
victim.addStatEffect(
new StatEffect(
EffectType.Buff,
"Banish Spirits",
"+10% Atk",
positiveBanishSpiritsSE,
3
),
ref map
);
victim.addStatEffect(
new StatEffect(
EffectType.Debuff,
"Banish Spirits",
"-15% Def and Res",
negativeBanishSpiritsSE,
3
),
ref map
);
victim.addStatEffect(
StatEffect.create(StatusEffect.Enraged, 3),
ref map
);
};break;
case "rest_in_god": {
if(victim== null)
return false;
victim.addStatEffect(
new StatEffect(
EffectType.Buff,
"God\'s Blessing",
"+20 to all stats",
restInGodSE,
1
),
ref map
);
map.endUnitWalking(map.getFullUnitID(unit.mapPos));
};break;
}
return true;
}