Exemple #1
0
        void tauntApply(Unit taunter)
        {
            HostileReference refe = threatContainer.getReferenceByTarget(taunter);

            if (getCurrentVictim() != null && refe != null && (refe.getThreat() < getCurrentVictim().getThreat()))
            {
                if (refe.getTempThreatModifier() == 0.0f) // Ok, temp threat is unused
                {
                    refe.setTempThreat(getCurrentVictim().getThreat());
                }
            }
        }
Exemple #2
0
        public void addTempThreat(float threat, bool apply)
        {
            HostileReference refe = getFirst();

            while (refe != null)
            {
                if (apply)
                {
                    if (refe.getTempThreatModifier() == 0.0f)
                    {
                        refe.addTempThreat(threat);
                    }
                }
                else
                {
                    refe.resetTempThreat();
                }

                refe = refe.next();
            }
        }