Beispiel #1
0
        public virtual NulliResult OnNullification(TrustedAI ai, Player from, Player to, WrappedCard trick, bool positive, bool keep)
        {
            NulliResult result = new NulliResult
            {
                Null = false,
                Heg  = false
            };

            return(result);
        }
Beispiel #2
0
        public virtual NulliResult OnNullification(TrustedAI ai, CardEffectStruct effect, bool positive, bool keep)
        {
            NulliResult result = new NulliResult
            {
                Null = false,
                Heg  = false
            };

            return(result);
        }
        public override NulliResult OnNullification(TrustedAI ai, Player from, Player to, WrappedCard trick, bool positive, bool keep)
        {
            NulliResult result = new NulliResult();
            Room        room   = ai.Room;

            if (positive && !keep)
            {
                if (ai.IsFriend(to) && ai.HasSkill("gangzhi", to) && !to.Chained)
                {
                    result.Null = true;
                }
            }

            return(result);
        }
        public override NulliResult OnNullification(TrustedAI ai, CardEffectStruct effect, bool positive, bool keep)
        {
            NulliResult   result = new NulliResult();
            Room          room = ai.Room;
            Player        player = ai.Self;
            Player        from = effect.From, to = effect.To;
            WrappedCard   trick   = effect.Card;
            List <Player> delete  = new List <Player>(effect.StackPlayers);
            List <Player> targets = new List <Player>(delete);

            foreach (Player p in delete)
            {
                if (delete.IndexOf(p) < delete.IndexOf(to))
                {
                    targets.Remove(p);
                }
            }

            double good = 0;

            if (positive)
            {
                if (ai.IsEnemy(to))
                {
                    good += 4;
                    if (ai.HasSkill(TrustedAI.MasochismSkill, to))
                    {
                        good += 3;
                    }
                    if (ai.IsWeak(to) && to.Hp <= 1)
                    {
                        good += 5;
                    }

                    if (good > 8)
                    {
                        result.Null = true;
                    }
                }
            }
            else
            {
                if (ai.IsFriend(to))
                {
                    good += 4;
                    if (ai.HasSkill(TrustedAI.MasochismSkill, to))
                    {
                        good += 3;
                    }
                    if (ai.IsWeak(to) && to.Hp <= 1)
                    {
                        good += 5;
                    }

                    if (good > 8)
                    {
                        result.Null = true;
                    }
                }
            }
            return(result);
        }
        public override NulliResult OnNullification(TrustedAI ai, Player from, Player to, WrappedCard trick, bool positive, bool keep)
        {
            NulliResult result = new NulliResult();
            Room        room   = ai.Room;
            Player      player = ai.Self;

            List <Player> delete  = (List <Player>)room.GetTag("targets" + RoomLogic.CardToString(room, trick));
            List <Player> targets = new List <Player>(delete);

            foreach (Player p in delete)
            {
                if (delete.IndexOf(p) < delete.IndexOf(to))
                {
                    targets.Remove(p);
                }
            }

            double good = 0;

            if (positive)
            {
                if (ai.IsEnemy(to))
                {
                    good += 4;
                    if (ai.HasSkill(TrustedAI.MasochismSkill, to))
                    {
                        good += 3;
                    }
                    if (ai.IsWeak(to) && to.Hp <= 1)
                    {
                        good += 5;
                    }

                    if (good > 8)
                    {
                        result.Null = true;
                    }
                }
            }
            else
            {
                if (ai.IsFriend(to))
                {
                    good += 4;
                    if (ai.HasSkill(TrustedAI.MasochismSkill, to))
                    {
                        good += 3;
                    }
                    if (ai.IsWeak(to) && to.Hp <= 1)
                    {
                        good += 5;
                    }

                    if (good > 8)
                    {
                        result.Null = true;
                    }
                }
            }
            return(result);
        }
        public override NulliResult OnNullification(TrustedAI ai, CardEffectStruct effect, bool positive, bool keep)
        {
            NulliResult result = new NulliResult();
            Room        room = ai.Room;
            Player      from = effect.From, to = effect.To;
            WrappedCard trick  = effect.Card;
            Player      player = ai.Self;

            List <Player> players = new List <Player>();

            foreach (Player p in room.GetAlivePlayers())
            {
                if (p.IsFemale())
                {
                    players.Add(p);
                }
            }

            int count = Math.Min(players.Count, to.HandcardNum);

            if (positive)
            {
                if (ai.IsFriend(to))
                {
                    double value = -count;
                    if (from.HandcardNum + count < to.HandcardNum)
                    {
                        DamageStruct damage = new DamageStruct(trick, from, to);
                        value += ai.GetDamageScore(damage).Score;
                    }

                    if (count <= -2)
                    {
                        result.Null = true;
                    }
                }
            }
            else
            {
                if (ai.IsFriend(from))
                {
                    double value = count;
                    if (count > 0)
                    {
                        room.SortByActionOrder(ref players);
                        for (int i = 0; i < count; i++)
                        {
                            if (ai.IsFriend(players[i]) && players[i].HandcardNum > 0)
                            {
                                value += players[i].HandcardNum / 5;
                            }
                        }
                    }
                    if (from.HandcardNum + count < to.HandcardNum)
                    {
                        DamageStruct damage = new DamageStruct(trick, from, to);
                        value += ai.GetDamageScore(damage).Score;
                    }

                    if (count > 3)
                    {
                        result.Null = true;
                    }
                }
            }

            return(result);
        }
        public override NulliResult OnNullification(TrustedAI ai, CardEffectStruct effect, bool positive, bool keep)
        {
            NulliResult result = new NulliResult();
            Room        room = ai.Room;
            Player      from = effect.From, to = effect.To;
            WrappedCard trick  = effect.Card;
            Player      player = ai.Self;

            if (positive)
            {
                ScoreStruct score = new ScoreStruct
                {
                    Score = 0
                };
                if (from.Alive)
                {
                    DamageStruct damage = new DamageStruct(trick, from, to);
                    score = ai.GetDamageScore(damage);
                }

                if (to.IsWounded())
                {
                    if (ai.IsFriend(to))
                    {
                        score.Score += 1 * to.GetLostHp();
                    }
                    else if (ai.IsEnemy(to))
                    {
                        score.Score -= 1 * to.GetLostHp();
                    }
                }

                if (score.Score <= -4)
                {
                    result.Null = true;
                }
            }
            else
            {
                ScoreStruct score = new ScoreStruct
                {
                    Score = 0
                };
                if (from.Alive)
                {
                    DamageStruct damage = new DamageStruct(trick, from, to);
                    score = ai.GetDamageScore(damage);
                }

                if (to.IsWounded())
                {
                    if (ai.IsFriend(to))
                    {
                        score.Score += 1 * to.GetLostHp();
                    }
                    else if (ai.IsEnemy(to))
                    {
                        score.Score -= 1 * to.GetLostHp();
                    }
                }

                if (score.Score > 4)
                {
                    result.Null = true;
                }
            }

            return(result);
        }