Exemplo 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);
            }
        }
Exemplo n.º 2
0
        public int FuzzifyFavor(DeityFieldTypes field, int mod)
        {
            int fieldvalue = GetFieldValue(field);

            return(SmaugRandom.Fuzzy(fieldvalue / mod));
        }
Exemplo n.º 3
0
        public void AddFieldValue(string field, int value)
        {
            DeityFieldTypes fieldType = Realm.Library.Common.Extensions.EnumerationExtensions.GetEnumByName <DeityFieldTypes>(field);

            _values[fieldType] = value;
        }
Exemplo n.º 4
0
 public int GetFieldValue(DeityFieldTypes field)
 {
     return(_values.ContainsKey(field) ? _values[field] : 0);
 }