Exemplo n.º 1
0
        public Buff Find(BuffTemplate template)
        {
            for (int i = buffs.Count - 1; i >= 0; i--)
            {
                var buff = buffs[i];

                if (buff.buffTemplate == template)
                {
                    return(buff);
                }
            }

            return(null);
        }
Exemplo n.º 2
0
        public Buff(BuffGrantNode buffNode, IBehaviourContext context)
        {
            buffTemplate = buffNode.BuffToApply;
            buffTemplate.SetupGraph(this);

            buffInput = buffTemplate.GetNode <BuffInputNode>();
            buffInput.Target[this].Value = buffNode.Target[context].Value;

            BaseStackSize.onChanged += RecalculateStackSize;

            OnRemove += () =>
            {
                buffTemplate.RemoveGraph(this);
            };
            buffInput.SetTarget(this, this);
        }
Exemplo n.º 3
0
        public Buff(BuffTemplate _buffTemplate, RPGCharacter _target, BuffClock baseClock)
        {
            buffTemplate = _buffTemplate;
            buffTemplate.SetupGraph(this);

            buffInput = buffTemplate.GetNode <BuffInputNode>();
            buffInput.Target.GetEntry(this).Value = _target;

            AddClock(baseClock);

            BaseStackSize.onChanged += RecalculateStackSize;

            OnRemove += () =>
            {
                buffTemplate.RemoveGraph(this);
            };
            buffInput.SetTarget(this, this);
        }