Exemple #1
0
        void FixedUpdate()
        {
            _stopwatch--;
            if (_stopwatch < 0f)
            {
                _stopwatch = UPDATE_INTERVAL;
                var targets = MiscUtil.GatherEnemies(TeamComponent.GetObjectTeam(this.gameObject));
                lastEnemyScoreTracked = 0;
                foreach (var target in targets)
                {
                    if (Vector3.Distance(target.transform.position, this.transform.position) < Moustache.instance.maxRange)
                    {
                        if (!target.body || (target.body.outOfCombat && target.body.outOfDanger))
                        {
                            continue;
                        }
                        lastEnemyScoreTracked += 1f;
                        if (target.body.isElite)
                        {
                            lastEnemyScoreTracked += Moustache.instance.eliteBonus;
                        }
                        if (target.body.isBoss || target.body.isChampion)
                        {
                            lastEnemyScoreTracked += Moustache.instance.champBonus;
                        }
                    }
                }

                body.MarkAllStatsDirty();
            }
        }
 public void SetWranglerCount(int count)
 {
     if (cachedWranglerCount != count)
     {
         body.MarkAllStatsDirty();
     }
     cachedWranglerCount = count;
     isWrangled          = count > 0;
     lasWidth            = isWrangled ? 0.05f : 0f;
 }
Exemple #3
0
        void UpdateGGBuff(CharacterBody cb)
        {
            var cpt           = cb.GetComponent <GoldenGunComponent>();
            int tgtBuffStacks = (cpt.cachedIcnt < 1) ? 0 : Mathf.Clamp(Mathf.FloorToInt(cpt.cachedMoney / (Run.instance.GetDifficultyScaledCost(goldAmt) * Mathf.Pow(goldReduc, cpt.cachedIcnt - 1)) * 100f), 0, 100);

            int currBuffStacks = cb.GetBuffCount(goldenGunBuff);

            if (tgtBuffStacks != currBuffStacks)
            {
                cb.SetBuffCount(goldenGunBuff.buffIndex, tgtBuffStacks);
                cb.MarkAllStatsDirty();
            }
        }