2025-03-08 17:16:02 -05:00
|
|
|
use polariton::{operation::{Dict, Typed}, serdes::TypePrefix};
|
2025-02-12 18:46:27 -05:00
|
|
|
|
|
|
|
|
pub struct PremiumEffects {
|
|
|
|
|
pub factor: PremiumFactor,
|
|
|
|
|
pub multiplayer: PremiumMultiplayer,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl PremiumEffects {
|
|
|
|
|
pub fn as_transmissible(&self) -> Typed {
|
|
|
|
|
Typed::Dict(Dict {
|
2025-03-08 17:16:02 -05:00
|
|
|
key_ty: TypePrefix::Str, // str
|
|
|
|
|
val_ty: TypePrefix::HashMap, // hashtable
|
2025-02-12 18:46:27 -05:00
|
|
|
items: vec![
|
|
|
|
|
(Typed::Str("PremiumFactor".into()), self.factor.as_transmissible()),
|
|
|
|
|
(Typed::Str("TieredMultiplayer".into()), self.multiplayer.as_transmissible()),
|
|
|
|
|
]
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub struct PremiumFactor {
|
|
|
|
|
pub factor: i32, // percent
|
|
|
|
|
pub party_bonus: i32, // percent
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl PremiumFactor {
|
|
|
|
|
fn as_transmissible(&self) -> Typed {
|
|
|
|
|
Typed::HashMap(vec![
|
|
|
|
|
(Typed::Str("Factor".into()), Typed::Int(self.factor)),
|
|
|
|
|
(Typed::Str("PartyBonusPercentagePerPlayer".into()), Typed::Int(self.party_bonus)),
|
|
|
|
|
].into())
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub struct PremiumMultiplayer {
|
|
|
|
|
pub tier_multiplier: f64,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl PremiumMultiplayer {
|
|
|
|
|
fn as_transmissible(&self) -> Typed {
|
|
|
|
|
Typed::HashMap(vec![
|
|
|
|
|
(Typed::Str("BonusPerTierMultiplier".into()), Typed::Double(self.tier_multiplier)),
|
|
|
|
|
].into())
|
|
|
|
|
}
|
|
|
|
|
}
|