本文整理汇总了C#中SpellData.IsAutoAttack方法的典型用法代码示例。如果您正苦于以下问题:C# SpellData.IsAutoAttack方法的具体用法?C# SpellData.IsAutoAttack怎么用?C# SpellData.IsAutoAttack使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SpellData
的用法示例。
在下文中一共展示了SpellData.IsAutoAttack方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DamageMaker
public DamageMaker(Obj_AI_Base sourceIn, Obj_AI_Base targetIn, GameObject missleIn, SpellData dataIn, bool meleeIn = false)
{
source = sourceIn;
target = targetIn;
missle = missleIn;
sData = dataIn;
melee = !meleeIn;
createdTick = now;
isAutoAtack = sData.IsAutoAttack();
if (isAutoAtack)
{
dealDamage = (float) source.GetAutoAttackDamage(target, true);
if (source.IsMelee)
cycle = (int) (source.AttackDelay*1000);
else
{
//var dist = source.Distance(target);
cycle = (int)((source.AttackDelay * 1000)) /*+ (dist*1000)/sData.MissileSpeed)*/;
//Console.WriteLine("cycle: " + cycle);
}
//Console.WriteLine("cycle: " + source.AttackSpeedMod);
}
else
{
cycle = 0;
if (source is Obj_AI_Hero)
{
var tSpell = TargetSpellDatabase.GetByName(sData.Name);
if (tSpell == null)
{
//Console.WriteLine("Unknown targeted spell: " + sData.Name);
dealDamage = 0;
}
else
{
try
{
dealDamage = (float)((Obj_AI_Hero)source).GetSpellDamage(target, tSpell.Spellslot);
}
catch (Exception)
{
dealDamage = 0;
}
}
}
else
{
dealDamage = 0;
}
}
}