private bool Filter(StorageDataItemBase item) { bool flag = false; bool flag2 = false; switch (this.slot) { case 1: flag = item.GetType() == typeof(WeaponDataItem); flag2 = item.GetBaseType() == this.avatarData.WeaponBaseTypeList[0]; break; case 2: flag = item.GetType() == typeof(StigmataDataItem); flag2 = item.GetBaseType() == 1; break; case 3: flag = item.GetType() == typeof(StigmataDataItem); flag2 = item.GetBaseType() == 2; break; case 4: flag = item.GetType() == typeof(StigmataDataItem); flag2 = item.GetBaseType() == 3; break; } return(flag && flag2); }
public static void CalCulateExpFromItems(out float scoinNeed, out float expGet, List <StorageDataItemBase> dogFoodList, StorageDataItemBase equipToPowerUp) { float f = 0f; foreach (StorageDataItemBase base2 in dogFoodList) { float gearExp = base2.GetGearExp(); MaterialExpBonusMetaData data = MaterialExpBonusMetaDataReader.TryGetMaterialExpBonusMetaDataByKey(base2.ID); if (data != null) { if (equipToPowerUp is WeaponDataItem) { gearExp *= data.weaponExpBonus / 100f; } else if (equipToPowerUp is StigmataDataItem) { gearExp *= data.stigmataExpBonus / 100f; } } if (base2.GetType() == equipToPowerUp.GetType()) { gearExp *= ((float)Singleton <PlayerModule> .Instance.playerData.sameTypePowerUpRataInt) / 100f; } f += gearExp; } expGet = Mathf.FloorToInt(f); scoinNeed = (expGet * Singleton <PlayerModule> .Instance.playerData.powerUpScoinCostRate) / 100f; }
private KeyValuePair <System.Type, int> GetKeyByItem(StorageDataItemBase item) { return(new KeyValuePair <System.Type, int>(item.GetType(), item.GetIdForKey())); }