本文整理汇总了C#中ActorController.IsHostileTo方法的典型用法代码示例。如果您正苦于以下问题:C# ActorController.IsHostileTo方法的具体用法?C# ActorController.IsHostileTo怎么用?C# ActorController.IsHostileTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActorController
的用法示例。
在下文中一共展示了ActorController.IsHostileTo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: FindMinDistEnemy
public static ActorController FindMinDistEnemy(ActorController actor, float findDist)
{
if (actor == null)
{
return null;
}
float num = 3.40282347E+38f;
ActorController result = null;
List<ActorController> actors = Globals.Instance.ActorMgr.Actors;
for (int i = 0; i < actors.Count; i++)
{
ActorController actorController = actors[i];
if (actorController && !actorController.IsDead && (!actorController.IsImmunity || actorController.ActorType != ActorController.EActorType.EMonster) && actor.IsHostileTo(actorController))
{
float num2 = actor.GetDistance2D(actorController);
if (num2 <= findDist)
{
if (actorController.ActorType == ActorController.EActorType.EPlayer)
{
num2 *= 1.5f;
if (num2 < 1.5f)
{
num2 = 1.5f;
}
}
if (num2 < num)
{
num = num2;
result = actorController;
}
}
}
}
return result;
}