本文整理匯總了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;
}