public static void CalDotDamage(long sourceUnitId, Unit destUnit, Buff_DOT dot)
    {
        DamageData damageData = new DamageData();

        damageData.damageType = dot.damageType;

        damageData.damageValue = BuffHandlerVar.cacheDatas_int[(sourceUnitId, dot.buffSignal)];
    public void ActionHandle(BuffHandlerVar buffHandlerVar)
    {
        Buff_DOT         buff             = (Buff_DOT)buffHandlerVar.data;
        NumericComponent numericComponent = buffHandlerVar.source.GetComponent <NumericComponent>();

        //这里只是计算一下DOT的伤害(快照机制),实际DOT的处理是在BuffMgr中管理的

        BuffHandlerVar.cacheDatas_int[(buffHandlerVar.source.Id, buff.buffSignal)] = Mathf.RoundToInt(numericComponent.GetAsFloat(buff.numericType) * buff.baseCoff * numericComponent.GetAsFloat(NumericType.FinalDamage_AddPct));
Beispiel #3
0
    public override void OnAttack(Unit target)
    {
        base.OnAttack(target);
        const float RANDOM_RANGE = 0.1f;
        float       attack       = owner.attack + Random.Range(-owner.attack * RANDOM_RANGE, owner.attack * RANDOM_RANGE);

        attack *= 0.1f;
        attack  = (int)attack;
        Buff buff = new Buff_DOT(meta.skill_name, 5, attack, Buff.Type.Poison);

        target.AddBuff(buff);
    }