Пример #1
0
        public override double CardValue(TrustedAI ai, Player player, bool use, WrappedCard card, Player.Place place)
        {
            double value = 0;
            Room   room  = ai.Room;

            if (ai.HasSkill("wendao", player))
            {
                if (use)
                {
                    value += 5;
                }
                else
                {
                    if (!player.HasUsed(WendaoCard.ClassName) || room.Current != player)
                    {
                        value -= 10;
                    }
                }
            }
            else
            {
                Player target = null;
                foreach (Player p in room.GetOtherPlayers(player))
                {
                    if (ai.HasSkill("wendao", p))
                    {
                        target = p;
                        break;
                    }
                }

                if (target != null)
                {
                    if (!ai.HasSkill("flamemap", player) || !use)
                    {
                        value -= 7;
                    }
                }
                else
                {
                    foreach (Player p in room.GetOtherPlayers(player))
                    {
                        if (RoomLogic.IsFriendWith(room, player, p))
                        {
                            value += 0.5;
                        }
                    }
                }

                if (!use && player.Hp == 1 && player.HandcardNum <= 1 && place == Player.Place.PlaceEquip)
                {
                    value -= 3;
                }
            }
            if (player.Chained)
            {
                value += 1;
            }

            return(value);
        }
Пример #2
0
 //在判断use value 和 keep value时的分数调整
 public virtual double CardValue(TrustedAI ai, Player player, WrappedCard card, bool isUse, Player.Place place) => 0;
Пример #3
0
        public override double CardValue(TrustedAI ai, Player player, WrappedCard card, bool isUse, Player.Place place)
        {
            if (card != null && !card.IsVirtualCard() && ai.HasSkill(Name, player) && card.Name.Contains(Slash.ClassName))
            {
                double value = 2;

                if (WrappedCard.IsRed(card.Suit))
                {
                    value += 1;
                }
                if (card.Name != Slash.ClassName)
                {
                    value += 1.5;
                }
                return(value);
            }
            return(0);
        }
Пример #4
0
        public override double CardValue(TrustedAI ai, Player player, WrappedCard card, bool isUse, Player.Place place)
        {
            if (ai.HasSkill(Name, player) && (card.Name.Contains(Slash.ClassName) && WrappedCard.IsRed(card.Suit) || card.Name == Duel.ClassName) && isUse)
            {
                return(1.5);
            }

            return(0);
        }
Пример #5
0
 public virtual WrappedCard ViewAs(TrustedAI ai, Player player, int id, bool current, Player.Place place) => null;
Пример #6
0
 public override double CardValue(TrustedAI ai, Player player, bool use, WrappedCard card, Player.Place place)
 {
     return(ai.HasSkill(TrustedAI.LoseEquipSkill, player) ? -4 : 0);
 }
Пример #7
0
        public override WrappedCard ViewAs(TrustedAI ai, Player player, int id, bool current, Player.Place place)
        {
            Room        room = ai.Room;
            WrappedCard card = room.GetCard(id);

            if (card.HasFlag("using"))
            {
                return(null);
            }
            if (WrappedCard.IsRed(card.Suit))
            {
                WrappedCard slash = new WrappedCard(Slash.ClassName)
                {
                    Skill     = Name,
                    ShowSkill = Name
                };
                slash.AddSubCard(card);
                slash = RoomLogic.ParseUseCard(room, slash);
                return(slash);
            }

            return(null);
        }
        public override double CardValue(TrustedAI ai, Player player, bool use, WrappedCard card, Player.Place place)
        {
            double value = ai.AjustWeaponRangeValue(player, card);

            foreach (Player p in ai.GetFriends(player))
            {
                if (ai.HasSkill("guidao|guicai_jx|zhenyi", p))
                {
                    value += 5;
                }
            }

            return(value);
        }
        public override double CardValue(TrustedAI ai, Player player, WrappedCard card, bool isUse, Player.Place place)
        {
            if (!isUse && place == Player.Place.PlaceEquip)
            {
                return(4);
            }

            if (isUse && card.IsVirtualCard())
            {
                foreach (int id in card.SubCards)
                {
                    if (ai.Room.GetCardPlace(id) == Player.Place.PlaceEquip)
                    {
                        return(-3);
                    }
                }
            }

            return(0);
        }
        public override double CardValue(TrustedAI ai, Player player, bool use, WrappedCard card, Player.Place place)
        {
            double value = ai.AjustWeaponRangeValue(player, card);

            if (player.IsWounded())
            {
                value += 1;
            }
            return(value);
        }
        public override double CardValue(TrustedAI ai, Player player, bool use, WrappedCard card, Player.Place place)
        {
            double value = ai.AjustWeaponRangeValue(player, card);

            foreach (Player p in ai.GetEnemies(player))
            {
                if (ai.HasSkill(TrustedAI.MasochismSkill, p))
                {
                    value += 1;
                }
            }

            return(value);
        }
        public override double CardValue(TrustedAI ai, Player player, bool use, WrappedCard card, Player.Place place)
        {
            double value = ai.AjustWeaponRangeValue(player, card);

            foreach (Player p in ai.GetEnemies(player))
            {
                if (RoomLogic.HasShownArmorEffect(ai.Room, p) && RoomLogic.DistanceTo(ai.Room, player, p, null, true) <= 2)
                {
                    value += 0.5;
                }
            }

            return(value);
        }
 public override double CardValue(TrustedAI ai, Player player, bool use, WrappedCard card, Player.Place place)
 {
     return(ai.AjustWeaponRangeValue(player, card) - (8 - ai.Room.AliveCount()) * 0.5);
 }
Пример #14
0
        public override double CardValue(TrustedAI ai, Player player, WrappedCard card, bool isUse, Player.Place place)
        {
            if (ai.HasSkill(Name, player) && card != null && Engine.GetFunctionCard(card.Name) is TrickCard)
            {
                return(-3);
            }

            return(0);
        }
Пример #15
0
        public override double CardValue(TrustedAI ai, Player player, bool use, WrappedCard card, Player.Place place)
        {
            double value  = 0;
            Room   room   = ai.Room;
            Player target = null;

            foreach (Player p in room.GetOtherPlayers(player))
            {
                if (ai.HasSkill("jubao", p))
                {
                    target = p;
                    break;
                }
            }

            bool self_use = true;

            if (target != null)
            {
                if (ai.IsFriend(target, player))
                {
                    value += 5;
                }
                else
                {
                    self_use = false;
                    value   -= 10;
                }
            }

            if (self_use && ai.HasSkill(TrustedAI.LoseEquipSkill, player))
            {
                value += 6;
            }

            return(value);
        }
        public override double CardValue(TrustedAI ai, Player player, WrappedCard card, bool isUse, Player.Place place)
        {
            if (ai.HasSkill(Name, player) && card.Id >= 0 && place == Player.Place.PlaceHand && !isUse && card.Suit == WrappedCard.CardSuit.Spade)
            {
                return(1);
            }

            return(0);
        }
Пример #17
0
        public override double CardValue(TrustedAI ai, Player player, bool use, WrappedCard card, Player.Place place)
        {
            Room   room  = ai.Room;
            double value = 0;

            if (!use && ai.HasSkill("zhangwu", player))
            {
                value -= 2;
            }
            else
            {
                Player target = null;
                foreach (Player p in room.GetOtherPlayers(player))
                {
                    if (ai.HasSkill("zhangwu", p))
                    {
                        target = p;
                        break;
                    }
                }

                if (target != null)
                {
                    if (ai.IsFriend(target, player))
                    {
                        if (use && room.GetCardOwner(card.GetEffectiveId()) == player && !player.GetWeapon())
                        {
                            value += 2;
                        }
                        else
                        {
                            value -= 7;
                        }
                    }
                    else
                    {
                        if (!ai.HasSkill(TrustedAI.LoseEquipSkill, player) || !use)
                        {
                            value -= 6;
                        }
                    }
                }
            }

            return(value);
        }
        public override double CardValue(TrustedAI ai, Player player, bool use, WrappedCard card, Player.Place place)
        {
            double value = 0;

            value += player.GetPile("wooden_ox").Count * 0.3;
            foreach (Player p in ai.FriendNoSelf)
            {
                if (p.Treasure.Key == -1)
                {
                    value += 0.5;
                }
            }

            return(value);
        }
Пример #19
0
 public override double CardValue(TrustedAI ai, Player player, bool use, WrappedCard card, Player.Place place)
 {
     return(ai.AjustWeaponRangeValue(player, card));
 }
Пример #20
0
        public override double CardValue(TrustedAI ai, Player player, WrappedCard card, bool isUse, Player.Place place)
        {
            if (ai.HasSkill(Name) && ai.IsSituationClear())
            {
                FunctionCard fcard = Engine.GetFunctionCard(card.Name);
                if (fcard is DefensiveHorse || fcard is SpecialEquip)
                {
                    return(-2);
                }
            }

            if (!isUse && ai.IsCard(card.GetEffectiveId(), Slash.ClassName, player))
            {
                Player jiangwei = ai.FindPlayerBySkill(Name);
                if (jiangwei != null && !ai.IsFriend(jiangwei, player) && RoomLogic.CanSlash(ai.Room, player, jiangwei))
                {
                    return(2);
                }
            }

            return(0);
        }