Exemplo n.º 1
0
        protected override double ScoreDebuff(AIProcessor AI, Spells.EffectInfos Effect, List <Fighter> Targets, bool Reverse = false)
        {
            if (Reverse)//On evite la boucle infinie
            {
                return(0);
            }
            var Score     = 0;
            var BaseScore = 11;

            //BaseScore *= Effect.RandomJet;

            foreach (var Target in Targets)
            {
                int            currScore = BaseScore;
                List <Fighter> target    = new List <Fighter>()
                {
                    Target
                };
                foreach (BuffEffect buff in Target.Buffs.getBuffs())
                {
                    if (buff.IsDebuffable)
                    {
                        currScore += (int)this.GetEffectScore(AI, -1, -1, new EffectInfos(buff.CastInfos), target, true);
                    }
                }
                Score += currScore;
            }

            return(Score);
        }
Exemplo n.º 2
0
        protected override double ScoreDamage_III(AIProcessor AI, Spells.EffectInfos Effect, List <Fighter> Targets, bool Reverse = false)
        {
            var Score     = 0;
            var BaseScore = 20;

            BaseScore *= Math.Abs(Effect.Value1);
            foreach (var Target in Targets)
            {
                int currScore   = BaseScore;
                var PercentLife = Math.Ceiling((double)(Target.Life / Target.MaxLife) * 100);
                if (PercentLife < 5)
                {
                    currScore *= 8;
                }
                else if (PercentLife < 10)
                {
                    currScore *= 5;
                }
                else if (PercentLife < 25)
                {
                    currScore *= 3;
                }
                else if (PercentLife < 50)
                {
                    currScore *= 2;
                }

                if (Effect.Duration > 0)
                {
                    currScore *= Effect.Duration;
                }

                if (Reverse)
                {
                    if (Target.Team != AI.myFighter.Team)
                    {
                        Score -= currScore * 3;
                    }
                    else
                    {
                        Score += currScore;
                    }
                }
                else
                {
                    if (Target.Team == AI.myFighter.Team)
                    {
                        Score -= currScore * 3;
                    }
                    else
                    {
                        Score += currScore;
                    }
                }
            }

            return(Score);
        }
Exemplo n.º 3
0
        protected override double ScoreHeal(AIProcessor AI, Spells.EffectInfos Effect, List<Fighter> Targets, bool Reverse = false)
        {
            var Score = 0;
            var BaseScore = 13;
            BaseScore *= Effect.RandomJet;

            foreach (var Target in Targets)
            {
                int currScore = BaseScore;
                if (Target.States.HasState(FighterStateEnum.STATE_INVISIBLE) && Effect.EffectType == EffectEnum.Invisible)
                {
                    Score -= currScore;
                    continue;
                }
                var PercentLife = Math.Ceiling((double)(Target.Life / Target.MaxLife) * 100);
                if (PercentLife < 10)
                    currScore *= 12;
                if (PercentLife < 20)
                    currScore *= 8;
                else if (PercentLife < 30)
                    currScore *= 5;
                else if (PercentLife < 50)
                    currScore *= 3;
                else if (PercentLife < 75)
                    currScore *= 2;
                else if (PercentLife >= 95)
                {
                    continue;
                }

                if (Effect.Duration > 0)
                    currScore *= Effect.Duration;
                if (Reverse)
                {
                    if (Target.Team == AI.myFighter.Team)
                        Score -= currScore * 2;
                    else
                        Score += currScore;
                }
                else
                {
                    if (Target.Team != AI.myFighter.Team)
                        Score -= currScore * 2;
                    else
                        Score += currScore;
                }
            }

            return Score;
        }
Exemplo n.º 4
0
        protected override double ScoreDamagesPerPA(AIProcessor AI, Spells.EffectInfos Effect, List<Fighter> Targets, bool Reverse = false)
        {
            var Score = 0;

            var BaseScore = 11;

            BaseScore *= Effect.RandomJet;

            foreach (var Target in Targets)
            {
                int currScore = BaseScore;
                var PercentLife = Math.Ceiling((double)(Target.Life / Target.MaxLife) * 100);
                currScore *= Target.MaxAP;
                if (PercentLife < 20)
                    currScore *= 2;
                else if (PercentLife < 30)
                    currScore *= 3;
                else if (PercentLife < 50)
                    currScore *= 5;
                else if (PercentLife < 75)
                    currScore *= 8;

                if (Effect.Duration > 0)
                    currScore *= Effect.Duration;

                if (Reverse)
                {
                    if (Target.Team != AI.myFighter.Team)
                        Score -= currScore * 2;
                    else
                        Score += currScore;
                }
                else
                {
                    if (Target.Team == AI.myFighter.Team)
                        Score -= currScore * 2;
                    else
                        Score += currScore;
                }
            }

            return Score;
        }
Exemplo n.º 5
0
        protected override double ScoreSubBuff_IV(AIProcessor AI, Spells.EffectInfos Effect, List <Fighter> Targets, bool Reverse = false, bool notUseJet = false)
        {
            var Score     = 0;
            var BaseScore = 18;

            if (!notUseJet)
            {
                BaseScore *= Effect.RandomJet;
            }

            foreach (var Target in Targets)
            {
                int currScore   = BaseScore;
                var PercentLife = Math.Ceiling((double)(Target.Life / Target.MaxLife) * 100);
                if (PercentLife < 20)
                {
                    currScore *= 2;
                }
                else if (PercentLife < 30)
                {
                    currScore *= 3;
                }
                else if (PercentLife < 50)
                {
                    currScore *= 5;
                }
                else if (PercentLife < 75)
                {
                    currScore *= 8;
                }

                if (Effect.Duration > 0)
                {
                    currScore *= Effect.Duration;
                }
                if (Reverse)
                {
                    if (Target.Team != AI.myFighter.Team)
                    {
                        Score -= currScore * 2;
                    }
                    else
                    {
                        Score += currScore;
                    }
                }
                else
                {
                    if (Target.Team == AI.myFighter.Team)
                    {
                        Score -= currScore * 2;
                    }
                    else
                    {
                        Score += currScore;
                    }
                }
            }

            return(Score);
        }
Exemplo n.º 6
0
        protected override double ScoreInvocation(AIProcessor AI, Spells.EffectInfos Effect, List <Fighter> Targets, bool Reverse = false, bool InvokPreview = false)
        {
            if (Reverse)//On evite la boucle infinie
            {
                return(0);
            }
            var BaseScore = 11;
            var Score     = BaseScore;

            var InvocationId    = Effect.Value1;
            var InvocationLevel = Effect.Value2;

            if (InvokPreview)
            {
                return(BaseScore * InvocationLevel);
            }
            if (!AI.myNeuron.myScoreInvocations.ContainsKey(InvocationId))
            {
                var Monster = MonsterTable.GetMonster(InvocationId);
                // Template de monstre existante
                if (Monster != null)
                {
                    Monster.Initialize();
                    var MonsterLevel = Monster.GetLevelOrNear(InvocationLevel);
                    // Level de monstre existant
                    if (MonsterLevel != null)
                    {
                        List <Fighter> possibleTargets = AI.myFight.GetAllyTeam(AI.myFighter.Team).GetFighters().FindAll(x => !x.Dead && !x.Left);
                        foreach (var Spell in MonsterLevel.Spells.GetSpells())
                        {
                            foreach (var spellEffect in Spell.Effects)
                            {
                                int currScore = (int)this.GetEffectScore(AI, -1, -1, spellEffect, possibleTargets, InvokPreview: true);
                                if (currScore > 0)
                                {
                                    Score += currScore;
                                }
                            }
                        }
                        possibleTargets = AI.myFight.GetEnnemyTeam(AI.myFighter.Team).GetFighters().FindAll(x => !x.Dead && !x.Left);
                        foreach (var Spell in MonsterLevel.Spells.GetSpells())
                        {
                            foreach (var spellEffect in Spell.Effects)
                            {
                                int currScore = (int)this.GetEffectScore(AI, -1, -1, spellEffect, possibleTargets, InvokPreview: true);
                                if (currScore > 0)
                                {
                                    Score += currScore;
                                }
                            }
                        }
                        foreach (var State in MonsterLevel.Stats.GetEffects().Values)
                        {
                            var total = State.Total;
                            if (total > 0)
                            {
                                Score += total;
                            }
                        }
                        Score *= MonsterLevel.Level;
                        AI.myNeuron.myScoreInvocations.Add(InvocationId, Score);
                        return(Score);
                    }
                }
            }
            else
            {
                return(AI.myNeuron.myScoreInvocations[InvocationId]);
            }
            return(0);
        }