本文整理汇总了C#中Student.retStuStat方法的典型用法代码示例。如果您正苦于以下问题:C# Student.retStuStat方法的具体用法?C# Student.retStuStat怎么用?C# Student.retStuStat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Student
的用法示例。
在下文中一共展示了Student.retStuStat方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BattleDamageCalculate
//If player attack, calculate damage
public int BattleDamageCalculate(SkillInfo usedSkill, Student attacker, Student defenser, int[] _battleTempStat)
{
if (usedSkill.retGiveStatus() != status.none)
defenser.giveAStatus(usedSkill.retGiveStatus());
usedSkill.decChance();
int attributeRelation1 = (int)attacker.getStuIndex() / 10;
int attributeRelation2 = (int)defenser.getStuIndex() / 10;
double AttackRate = 1; //find attack is special attack or normal attack
double damage = 0; //return total damage that defenser have to take
float AttributeCal = 1; //Calculate damage Changed by AttributeCal
float[] battleTempStat = new float[12];
if(usedSkill.retType() == attributeRelation1) //if Attacker type and used Skill type is same, get bonus damage
{AttributeCal *= 1.5f;}
int RandomRate = (int)Random.Range(217,255)*100/255; //make random damage;
for (int i = 0; i < 12; i++)
{
if (_battleTempStat[i] > 0)
battleTempStat[i] = (2 + _battleTempStat[i]) / (float)(_battleTempStat[i]);
else if (_battleTempStat[i] < 0)
battleTempStat[i] = (float)(2) / (2 + _battleTempStat[i]);
else
battleTempStat[i] = 1;
}
if (usedSkill.retAtkType() == 0)
{ //calculate the damage of
AttackRate = (usedSkill.retDamage())*(attacker.retStuStat(0))*battleTempStat[0]/(defenser.retStuStat(2)/battleTempStat[8]);
}else {
AttackRate = (usedSkill.retDamage())*(attacker.retStuStat(1))*battleTempStat[1]/(defenser.retStuStat(3)/battleTempStat[9]);
}
damage =(((
(
(attacker.retStuStat(6)*2/5)+2 //attackers level
)
*AttackRate/50 //used skill damage * attacker,defensers ability
)+2)
*RandomRate/100 //random damage
*AttributeCal*Attribute.attribute[attributeRelation1,attributeRelation2] //attribute;
);
return (int)damage;
}
示例2: checkBattleTurnEndEvent
public void checkBattleTurnEndEvent(Student stu)
{
if (stu.retStuStatus() == status.poison)
stu.getDamage((int)(stu.retStuStat(5)*5.0/8));
}