本文整理汇总了C#中ActorController.CalculateDamage方法的典型用法代码示例。如果您正苦于以下问题:C# ActorController.CalculateDamage方法的具体用法?C# ActorController.CalculateDamage怎么用?C# ActorController.CalculateDamage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActorController
的用法示例。
在下文中一共展示了ActorController.CalculateDamage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoEffect
private int DoEffect(SkillInfo info, ActorController caster, ActorController target)
{
long num = 0L;
for (int i = 0; i < info.EffectType.Count; i++)
{
if (info.EffectType[i] != 0)
{
if (info.Rate[i] >= 10000 || UtilFunc.RangeRandom(0, 10000) <= info.Rate[i])
{
switch (info.EffectType[i])
{
case 2:
target.AddBuff(info.Value3[i], caster);
goto IL_143;
case 4:
num += (long)caster.CalculateDamage(info.Value1[i], info.Value2[i], target);
goto IL_143;
case 5:
num += (long)caster.CalculateDamage(info.Value1[i], info.Value2[i], target);
goto IL_143;
}
global::Debug.LogError(new object[]
{
string.Concat(new object[]
{
"SkillID = [",
info.ID,
"] invalid EffectType = [",
info.EffectType[i],
"]"
})
});
}
}
IL_143:;
}
Singleton<ActionMgr>.Instance.PlayHitAction(caster, info, target);
int num2 = 0;
float num3 = info.ThreatBase;
if (num > 0L)
{
bool flag = caster.CanCrit(target);
if (flag)
{
num = num * 150L / 100L;
}
num = num * (long)(10000 + caster.DamageMod) / 10000L;
num2 = target.DoDamage(num, caster, ActorController.CanHitBack(info));
if (target.UIText != null && num2 > 0)
{
if (target.FactionType == ActorController.EFactionType.ERed)
{
if (flag)
{
GameUIManager.mInstance.HUDTextMgr.RequestShow(target, EShowType.EST_CriticalDamage, num2, null, 0);
}
else
{
GameUIManager.mInstance.HUDTextMgr.RequestShow(target, EShowType.EST_Damage, num2, null, 0);
}
}
else
{
GameUIManager.mInstance.HUDTextMgr.RequestShow(target, EShowType.EST_Damage, -num2, null, 2);
}
}
num3 += (float)num2 * info.ThreatCoef;
}
if (num3 > 0f && caster.IsHostileTo(target))
{
target.AiCtrler.ThreatMgr.AddThreat(caster, num3);
}
return num2;
}