本文整理汇总了C#中Combatant.GetElementDefence方法的典型用法代码示例。如果您正苦于以下问题:C# Combatant.GetElementDefence方法的具体用法?C# Combatant.GetElementDefence怎么用?C# Combatant.GetElementDefence使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Combatant
的用法示例。
在下文中一共展示了Combatant.GetElementDefence方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CheckRequirement
/*
============================================================================
Check functions
============================================================================
*/
public bool CheckRequirement(Combatant c)
{
bool check = false;
if(StatusNeeded.STATUS_VALUE.Equals(this.statusNeeded) &&
c.status[this.statID].CompareTo(this.value, this.comparison, this.setter, c))
{
check = true;
}
else if(StatusNeeded.ELEMENT.Equals(this.statusNeeded))
{
int element = c.GetElementDefence(this.statID);
if((ValueCheck.EQUALS.Equals(this.comparison) && element == this.value) ||
(ValueCheck.LESS.Equals(this.comparison) && element < this.value) ||
(ValueCheck.GREATER.Equals(this.comparison) && element > this.value))
{
check = true;
}
}
else if(StatusNeeded.SKILL.Equals(this.statusNeeded) && c.HasSkill(this.statID, 0))
{
check = true;
}
else if(StatusNeeded.RACE.Equals(this.statusNeeded) && c.raceID == this.statID)
{
check = true;
}
else if(StatusNeeded.SIZE.Equals(this.statusNeeded) && c.sizeID == this.statID)
{
check = true;
}
else if(StatusNeeded.LEVEL.Equals(this.statusNeeded))
{
int lvl = c.currentLevel;
if(this.classLevel) lvl = c.currentClassLevel;
if((ValueCheck.EQUALS.Equals(this.comparison) && lvl == this.value) ||
(ValueCheck.LESS.Equals(this.comparison) && lvl < this.value) ||
(ValueCheck.GREATER.Equals(this.comparison) && lvl > this.value))
{
check = true;
}
}
return check;
}
示例2: GetDefendedChange
private int GetDefendedChange(int change, int elementID, Combatant user, Combatant target)
{
// race damage
if(!this.ignoreRace)
{
change *= user.GetRaceDamageFactor(target.raceID);
change /= 100;
}
// size damage
if(!this.ignoreSize)
{
change *= user.GetSizeDamageFactor(target.sizeID);
change /= 100;
}
// element defence
if(!this.ignoreRace && elementID >= 0)
{
change *= target.GetElementDefence(elementID);
change /= 100;
}
// defend command
if(!this.ignoreDefend && target.isDefending)
{
change = (int)(change * DataHolder.Formula(DataHolder.BattleSystem().defendFormula).Calculate(user, target));
change /= 100;
}
return change;
}