本文整理汇总了C#中Stats.Shielded方法的典型用法代码示例。如果您正苦于以下问题:C# Stats.Shielded方法的具体用法?C# Stats.Shielded怎么用?C# Stats.Shielded使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stats
的用法示例。
在下文中一共展示了Stats.Shielded方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Orders
//
public IEnumerator Orders()
{
Stats target = new Stats();
Stats[] targets;
Stats user;
for(int i = 0; i < _amountOfContracts; i++)
{
switch(_userActions[i]._type)
{
case "attack":
target = getEnemyStats(_userActions[i]._target);
user = getPlayerStats(_userActions[i]._user);
_battleGUI.setBattleText(user._name+" attacked "+target._name+" for "+target.TakeDamage(user)+" damage");
yield return new WaitForSeconds(2f);
if(target._currentHealth <= 0)
{
target.Feint();
_battleGUI.setBattleText(target._name+" has fallen.");
}
break;
case "defend":
target = getPlayerStats(_userActions[i]._target);
user = getPlayerStats(_userActions[i]._user);
target.Shielded(user);
_battleGUI.setBattleText(user._name+" defended "+target._name);
break;
case "special":
user = getPlayerStats(_userActions[i]._user);
if(!user._spAttack._name.Contains("group"))
{
targets = new Stats[1];
if(!user._spAttack._name.Contains("heal"))
{
targets[0] = getEnemyStats(_userActions[i]._target);
}
else
{
targets[0] = getPlayerStats(_userActions[i]._target);
}
}
else
{
targets = new Stats[_amountOfEnemys];
if(!user._spAttack._name.Contains("heal"))
{
for(int x = 0; x < _amountOfEnemys; x++)
{
targets[x] = _enemyStats[x];
}
}
else
{
for(int x = 0; x < _amountOfEnemys; x++)
{
targets[x] = _partyStats[x];
}
}
}
_battleGUI.setBattleText(user.UseSpecial(targets));
yield return new WaitForSeconds(2f);
for(int x = 0; x < targets.Length; x++)
{
if(targets[x]._currentHealth <= 0)
{
targets[x].Feint();
_battleGUI.setBattleText(". "+targets[x]._name+" has fallen.");
yield return new WaitForSeconds(2f);
}
}
break;
default:
break;
}
if(EnemysAllDead())
{
break;
}
}
if (!EnemysAllDead ())
{
_battleGUI.setBattleText ("Enemy turn.");
yield return new WaitForSeconds (2f);
for (int i = 0; i < _amountOfEnemys; i++)
{
if(_enemyStats[i]._alive)
{
_battleGUI.setBattleText (_enemyAI [i].State ());
yield return new WaitForSeconds (2f);
if(ContractsAllDead())
{
break;
}
}
else{}
}
_attacking = false;
_battleGUI.setBattleText ("Your turn.");
yield return null;
}
//.........这里部分代码省略.........