Exemple #1
0
        public bool AddCurrency(Item currency)
        {
            if (!Daat99MasterLootersUtils.IsCurrencyType(currency.GetType()))
            {
                return(false);
            }

            if (currency is Gold && GoldLedger)
            {
                return(AddGoldPile(currency as Gold));
            }

            if (currency is BankCheck && GoldLedger)
            {
                return(AddGoldCheck(currency as BankCheck));
            }

#if USE_TOKENS
            if (currency is Daat99Tokens && TokenLedger)
            {
                return(AddTokensPile(currency as Daat99Tokens));
            }

            if (currency is TokenCheck && TokenLedger)
            {
                return(AddTokenCheck(currency as TokenCheck));
            }
#endif
            return(false);
        }
Exemple #2
0
        internal bool isTypeLootable(Type itemType)
        {
            if (itemType == null)
            {
                return(false);
            }

            if (lootSettings == LootSettingsEnum.Everything)
            {
                return(true);
            }

            if (Daat99MasterLootersUtils.IsCurrencyType(itemType))
            {
                return(true);
            }

            if (lootSettings == LootSettingsEnum.Currency_Only)
            {
                return(false);
            }

            if (activeLootTypes != null && activeLootTypes.Contains(itemType))
            {
                return(true);
            }

            if (activeBaseTypes != null)
            {
                foreach (Type type in activeBaseTypes)
                {
                    if (itemType.IsSubclassOf(type))
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }