Ejemplo n.º 1
0
            public override float ComputeRating()
            {
                var   self             = Raider.Self;
                int   selfHits         = (int)Math.Ceiling(self.Life / DMG_PER_HIT);
                var   victim           = Raider.GetClosestEnemy();
                int   victimHits       = (int)Math.Ceiling(victim.Life / DMG_PER_HIT);
                float distanceToVictim = Raider.DistanceToNextEnemy();

                if (distanceToVictim <= 2 && selfHits < victimHits)
                {
                    return(NULL_RATING);
                }
                if (distanceToVictim > 2 && selfHits <= victimHits)
                {
                    return(NULL_RATING);
                }

                if (distanceToVictim == 1)
                {
                    return(OVERRIDE_RATING);
                }

                bool wontHeal = distanceToVictim < Raider.DistanceToTavernFrom(victim.Position);

                return(base.ComputeRating() * (wontHeal ? 1 : 0.5f) * Sigmoid(MEDIAN_DISTANCE - distanceToVictim));
            }
Ejemplo n.º 2
0
            public override float ComputeRating()
            {
                var   self             = Raider.Self;
                int   selfHits         = (int)Math.Ceiling(self.Life / DMG_PER_HIT);
                var   enemy            = Raider.GetClosestEnemy();
                int   enemyHits        = (int)Math.Ceiling(enemy.Life / DMG_PER_HIT);
                float distanceToVictim = Raider.DistanceToNextEnemy();

                if (distanceToVictim <= 2 && selfHits < enemyHits)
                {
                    return(OVERRIDE_RATING);
                }
                if (distanceToVictim > 2 && selfHits <= enemyHits)
                {
                    return(base.ComputeRating() * Sigmoid(MEDIAN_DISTANCE - distanceToVictim));
                }

                return(NULL_RATING);
            }