Esempio n. 1
0
        public static void AdjustFavor(this PlayerInstance ch, DeityFieldTypes field, int mod)
        {
            if (ch.IsNpc() || ch.PlayerData.CurrentDeity == null)
            {
                return;
            }

            var oldfavor = ch.PlayerData.Favor;
            var deity    = ch.PlayerData.CurrentDeity;

            if ((ch.CurrentAlignment - deity.Alignment > 650) ||
                (ch.CurrentAlignment - deity.Alignment < -650) &&
                (deity.Alignment != 0))
            {
                ch.PlayerData.Favor -= 2;
                ch.PlayerData.Favor  = ch.PlayerData.Favor.GetNumberThatIsBetween(-2500, 2500);

                deity.UpdateCharacterBits(ch);
                ch.CheckForExtremeFavor(oldfavor);
            }
            else
            {
                ch.PlayerData.Favor += deity.FuzzifyFavor(field, mod < 1 ? 1 : mod);
                ch.PlayerData.Favor  = ch.PlayerData.Favor.GetNumberThatIsBetween(-2500, 2500);
            }
        }