Example #1
0
        public override void update(float diff)
        {
            _timerUpdate += diff;
            if (_timerUpdate >= UPDATE_TIME)
            {
                _timerUpdate = 0;
            }

            foreach (UnitCrowdControl cc in crowdControlList)
            {
                cc.Update(diff);
            }
            crowdControlList.RemoveAll((cc) => cc.IsDead());

            BuffGameScriptControllers.RemoveAll((b) => b.NeedsRemoved());

            var onUpdate = _scriptEngine.GetStaticMethod <Action <Unit, double> >(Model, "Passive", "OnUpdate");

            onUpdate?.Invoke(this, diff);

            UpdateAutoAttackTarget(diff);

            base.update(diff);

            _statUpdateTimer += diff;
            if (_statUpdateTimer >= 500)
            { // update stats (hpregen, manaregen) every 0.5 seconds
                stats.update(_statUpdateTimer);
                _statUpdateTimer = 0;
            }
        }
Example #2
0
 public void RemoveBuffGameScriptsWithName(string buffNamespace, string buffClass)
 {
     foreach (var b in BuffGameScriptControllers)
     {
         if (b.IsBuffSame(buffNamespace, buffClass))
         {
             b.DeactivateBuff();
         }
     }
     BuffGameScriptControllers.RemoveAll(b => b.NeedsRemoved());
 }
Example #3
0
        public override void update(float diff)
        {
            foreach (UnitCrowdControl cc in crowdControlList)
            {
                cc.Update(diff);
            }
            crowdControlList.RemoveAll((cc) => cc.IsDead());

            var onUpdate = _scriptEngine.GetStaticMethod <Action <AttackableUnit, double> >(Model, "Passive", "OnUpdate");

            onUpdate?.Invoke(this, diff);
            BuffGameScriptControllers.RemoveAll((b) => b.NeedsRemoved());
            base.update(diff);
            UpdateAutoAttackTarget(diff);
        }