本文整理汇总了C#中Conquest.Units.Unit.hasStatEffect方法的典型用法代码示例。如果您正苦于以下问题:C# Unit.hasStatEffect方法的具体用法?C# Unit.hasStatEffect怎么用?C# Unit.hasStatEffect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Conquest.Units.Unit
的用法示例。
在下文中一共展示了Unit.hasStatEffect方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: updateAI
// Updates the ai, broad spectrum
public virtual void updateAI(Unit unit, BattleMap map)
{
if(updatingAI)
return;
if(unit.hasStatEffect("Enrage"))
updateAIEnrage(unit, map);
else
updateAINormal(unit, map);
/*
// Variables
int[] target;
int[] spotToMoveTo;
AttackInfo info;
int heuristic;
bool isUncontrollable= unit.hasStatEffect("Enrage");
updatingAI= true;
ai_getTarget(unit, map, isUncontrollable, out target, out spotToMoveTo, out info);
map.destroyPaths();
if(target== null || target[0]== -1)
{
map.endUnitTurn(map.getFullUnitID(unit.mapPos));
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, isUncontrollable);
map.destroyPaths();
map.endUnitAttacking(map.getFullUnitID(unit.mapPos));
if(unit.isTurnEnded)
{
return;
}
}
if(!unit.isWalkingDone)
{
if(!movesByProximity() || map.isEnemyWithinProximity(unit.mapPos[0], unit.mapPos[1], unit.move, map.getTeamID(unit.mapPos), target))
ai_moveUnit(unit, map, spotToMoveTo, isUncontrollable);
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, isUncontrollable);
map.destroyPaths();
map.endUnitAttacking(map.getFullUnitID(unit.mapPos));
if(unit.isTurnEnded)
{
return;
}
}
map.destroyPaths();
map.endUnitTurn(map.getFullUnitID(unit.mapPos));*/
}
示例2: onMissedAttack
// Called when the unit's attack has missed
public override void onMissedAttack(Profession prof, ref Unit unit, int amount, ref Unit victim, ref BattleMap map)
{
if(!unit.hasStatEffect("Enraged"))
return;
if(Start.rng.Next(0, 10)< 3)
victim.addStatEffect(StatEffect.create(StatusEffect.Enraged, 3), ref map);
}
示例3: onTakeDamage
// --- Inherited Methods ---
// Called when the unit has taken damage
public override int onTakeDamage(Profession prof, ref Unit unit, int oldHealth, int newHealth, int amount, ref Unit instigator, ref BattleMap map)
{
if(!unit.hasStatEffect("Enraged"))
return amount;
if(Start.rng.Next(0, 10)< 3)
instigator.addStatEffect(StatEffect.create(StatusEffect.Enraged, 3), ref map);
return amount;
}
示例4: onDealtDamage
// Called when the unit is about to deal damage
public override int onDealtDamage(Profession prof, ref Unit unit, int victimHP, int amount, ref Unit victim, ref BattleMap map)
{
if(!unit.hasStatEffect("Enraged"))
return amount;
if(Start.rng.Next(0, 10)< 3)
victim.addStatEffect(StatEffect.create(StatusEffect.Enraged, 3), ref map);
return amount;
}