Exemplo n.º 1
0
    public void OnIntake(ref List <Intake> intake)
    {
        //apply our onintake buffs
        int originalIntakeCount = intake.Count; //so we dont infinitley proc additional effects

        for (int i = 0; i < originalIntakeCount; i++)
        {
            int start = 0;
            int len   = 0;
            if (intake[i].intakeType == Intake.IntakeType.DAMAGE)
            {
                start = buffManager.GetActivatorFirstElementIndex(BuffManager.Buff.Activator.ON_DMG_INTAKE);
                len   = buffManager.GetActivatorLength(BuffManager.Buff.Activator.ON_DMG_INTAKE);
            }
            else if (intake[i].intakeType == Intake.IntakeType.HEAL)
            {
                start = buffManager.GetActivatorFirstElementIndex(BuffManager.Buff.Activator.ON_HEAL_INTAKE);
                len   = buffManager.GetActivatorLength(BuffManager.Buff.Activator.ON_HEAL_INTAKE);
            }

            for (int j = start; j < start + len; j++)
            {
                buffManager.buffs[j].Trigger(intake, originalIntakeCount);
            }
        }
        health.ApplyIntake(ref intake);
    }
Exemplo n.º 2
0
    public List <Intake> GetBuffedIntakeList()
    {
        Intake intake = new Intake();

        intake.ammount     = ammount;
        intake.intakeType  = itype;
        intake.intakeClass = iclass;
        intake.origin      = buffManager.gameObject;

        List <Intake> ilist = new List <Intake>();

        ilist.Add(intake);

        int start = 0;
        int len   = 0;

        if (itype == Intake.IntakeType.DAMAGE)
        {
            start = buffManager.GetActivatorFirstElementIndex(BuffManager.Buff.Activator.ON_DMG_DEAL);
            len   = buffManager.GetActivatorLength(BuffManager.Buff.Activator.ON_DMG_DEAL);
        }
        else if (itype == Intake.IntakeType.HEAL)
        {
            start = buffManager.GetActivatorFirstElementIndex(BuffManager.Buff.Activator.ON_HEAL_DEAL);
            len   = buffManager.GetActivatorLength(BuffManager.Buff.Activator.ON_HEAL_DEAL);
        }

        for (int i = start; i < start + len; i++)
        {
            buffManager.buffs[i].Trigger(ilist);
        }

        return(ilist);
    }