本文整理汇总了C#中Enemy.damage方法的典型用法代码示例。如果您正苦于以下问题:C# Enemy.damage方法的具体用法?C# Enemy.damage怎么用?C# Enemy.damage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Enemy
的用法示例。
在下文中一共展示了Enemy.damage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: onEnemyClicked
private void onEnemyClicked(Enemy enemy)
{
if(_waitingForTargetToBeSelected)
{
_waitingForTargetToBeSelected = false;
if(_chosenAction == "Attack")
{
enemy.damage(attackDamage);
onActionUsed("Knight uses attack!");
}
else
{
enemy.damage(magicDamage);
onActionUsed("Knight casts fire!");
}
}
}
示例2: enemyHit
private float enemyHit(Enemy enemy)
{
float time = enemy.damage(currentWeapon.getCharacteristics()[(int)IWeapon.Stats.DAMAGE], dir);
foreach (IWeapon w in weapons)
if (w != null && w.isEvolving)
w.changeEvolution(currentWeapon == w);
return time;
}
示例3: onEnemyClicked
private void onEnemyClicked(Enemy enemy)
{
if(_waitingForTargetToBeSelected)
{
_waitingForTargetToBeSelected = false;
if(_chosenAction == "Attack")
{
enemy.damage(attackDamage);
onActionUsed("Knight uses attack!");
}
else
{
enemy.damage(magicDamage);
onActionUsed("Knight casts fire!");
Instantiate(fireParticles,enemy.transform.position,Quaternion.identity);
}
}
}
示例4: Confusion
public static SpellAttack Confusion(Unit attacker, Enemy enemy) {
float damage = 10 +
attacker.Attrs ["str"] - enemy.Attrs ["pdef"] +
attacker.Attrs ["int"] - enemy.Attrs ["mdef"];
Buff stun = new Buff (0, 5, (t) => {
enemy.SetLastTime ();
enemy.SetRandomSlowpoke ();
int victim = UnityEngine.Random.Range (0, 100);
Debug.Log (victim);
if (victim > 50) {
enemy.damage (5);
} else {
attacker.damage (5);
}
return 1;
}, enemy);
return new SpellAttack (35, damage, enemy, stun);
}