private void UpdateRewardPropertiesPremiumModifiers(bool character) { foreach (RewardPropertyPremiumModifierEntry modifierEntry in AssetManager.Instance.GetRewardPropertiesForTier(session.AccountTier)) { RewardPropertyEntry entry = GameTableManager.Instance.RewardProperty.GetEntry(modifierEntry.RewardPropertyId); if (entry == null) { throw new ArgumentException(); } float value = 0f; // some reward property premium modifier entries use an existing entitlement values rather than static values if (modifierEntry.EntitlementIdModifierCount != 0u) { // TODO: If the RewardProperty value is higher on Load that the Entitlement. // Should we set the Entitlement to match? This is only necessary for things like Bank Slots (4 for Signature, 2 for Basic), Auction Slots, and Commodity Slots. // Do we know if you subscribed, then unsubscribed, that you would keep those Bank Slots? Did they get greyed out and unusable? value += GetAccountEntitlement((EntitlementType)modifierEntry.EntitlementIdModifierCount)?.Amount ?? 0u; if (character) { value += GetCharacterEntitlement((EntitlementType)modifierEntry.EntitlementIdModifierCount)?.Amount ?? 0u; } } else { switch ((RewardPropertyModifierValueType)entry.RewardModifierValueTypeEnum) { case RewardPropertyModifierValueType.AdditiveScalar: value += modifierEntry.ModifierValueFloat; break; case RewardPropertyModifierValueType.Discrete: value += modifierEntry.ModifierValueInt; break; case RewardPropertyModifierValueType.MultiplicativeScalar: value += modifierEntry.ModifierValueFloat; break; } } UpdateRewardPropertyInternal((RewardPropertyType)entry.Id, value, modifierEntry.RewardPropertyData); } }
private RewardProperty UpdateRewardPropertyInternal(RewardPropertyType type, float value, uint data) { RewardPropertyEntry entry = GameTableManager.Instance.RewardProperty.GetEntry((ulong)type); if (entry == null) { throw new ArgumentException(); } if (!rewardProperties.TryGetValue(type, out RewardProperty rewardProperty)) { rewardProperty = new RewardProperty(entry); rewardProperties.Add(type, rewardProperty); } rewardProperty.UpdateValue(data, value); return(rewardProperty); }
/// <summary> /// Create a new <see cref="RewardProperty"/> with the supplied <see cref="RewardPropertyEntry"/>. /// </summary> public RewardProperty(RewardPropertyEntry entry) { Entry = entry; }