本文整理汇总了C#中Entities.getMp方法的典型用法代码示例。如果您正苦于以下问题:C# Entities.getMp方法的具体用法?C# Entities.getMp怎么用?C# Entities.getMp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Entities
的用法示例。
在下文中一共展示了Entities.getMp方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: skillAction
public void skillAction(Entities user, Entities[] tar, bool hit){
if (MpCost > 0 && HpCost > 0) {
if (user.getHp() >= HpCost) {
user.setHp(-HpCost);
} else {
Debug.Log ("Not enough HP!");
return;
}
if (user.getMp() >= MpCost) {
user.setMp(-MpCost);
} else {
Debug.Log ("Not enough MP!");
return;
}
} else if (HpCost > 0) {
if (user.getHp() >= HpCost) {
user.setHp(-HpCost);
} else {
Debug.Log ("Not enough HP!");
return;
}
} else if (MpCost > 0) {
if (user.getMp() >= MpCost) {
user.setMp(-MpCost);
} else {
Debug.Log ("Not enough MP!");
return;
}
}
// If it hit, do damage.
if (hit) {
if (DamageType == damage_type.single) {
if (DamageEffect == damage_effect.hp) {
tar [0].setHp(-(Damage - (tar [0].End / 3)));
} else if (DamageEffect == damage_effect.mp) {
tar [0].setMp( -(Damage - (tar [0].End / 3)));
} else {
Debug.Log ("TURN DAMAGER NOT IMPLEMENTED YET");
}
} else if (DamageType == damage_type.aoe) {
foreach (Entities e in tar) {
if (DamageEffect == damage_effect.hp) {
e.setHp(-(Damage - (e.End / 3)));
} else if (DamageEffect == damage_effect.mp) {
e.setMp( -(Damage - (e.End / 3)));
} else {
Debug.Log ("TURN DAMAGER NOT IMPLEMENTED YET");
}
}
} else if (DamageType == damage_type.dot) {
Debug.Log ("Turn based effects not implemented yet");
}
user.Damage = Damage;
}
}
示例2: checkSkillAction
public void checkSkillAction(Entities user, Entities[] tar){
if (MpCost > 0 && HpCost > 0) {
if (user.getHp() < HpCost) {
//user.Hp -= HpCost;
Debug.Log ("Not enough HP!");
return;
}
if (user.getMp() < MpCost) {
Debug.Log ("Not enough MP!");
return;
}
} else if (HpCost > 0) {
if (user.getHp() < HpCost) {
Debug.Log ("Not enough HP!");
return;
}
} else if (MpCost > 0) {
if (user.getMp() < MpCost) {
Debug.Log ("Not enough MP!");
return;
}
}
//After all the checks to see if the user can use the skill...
user.setSkill (tar);
user.handleSelectedSkill = SkillDatabase.GetSkillByUniqueName(UniqueName);
//skillAction (user, tar);
}