1use essences::currency::CurrencyUnit;
2use essences::pets::PetRarityId;
3use schema_loader::{pet_rarity_link_id_array_schema, pet_rarity_link_id_schema};
4use schemars::JsonSchema;
5
6use serde::{Deserialize, Serialize};
7use tsify_next::Tsify;
8
9use crate::validated_types::PositiveF64;
10
11#[derive(Clone, Debug, Deserialize, Serialize, JsonSchema, Tsify)]
12pub struct PetLevel {
13 #[schemars(title = "Уровень пета")]
14 pub level: i64,
15 #[schemars(title = "Id редкости", schema_with = "pet_rarity_link_id_schema")]
16 pub rarity_id: PetRarityId,
17 #[schemars(
18 title = "Количество осколков для улучшения",
19 description = "Количество осколков, необходимое для улучшения уровня пета"
20 )]
21 pub required_shards: i64,
22}
23
24#[derive(Clone, Debug, Deserialize, Serialize, JsonSchema, Tsify)]
25pub struct PetCaseRarityWeight {
26 #[schemars(title = "Id редкости", schema_with = "pet_rarity_link_id_schema")]
27 pub rarity_id: PetRarityId,
28
29 #[schemars(title = "Вес редкости")]
30 pub weight: PositiveF64,
31}
32
33#[derive(Clone, Debug, Deserialize, Serialize, JsonSchema, Tsify, Default)]
34pub struct PetCaseCheckpointPetReward {
35 #[schemars(title = "Количество роллов пета")]
37 pub amount: i64,
38
39 #[schemars(
41 title = "Минимальная редкость",
42 schema_with = "pet_rarity_link_id_schema"
43 )]
44 pub min_rarity_id: PetRarityId,
45}
46
47#[derive(Clone, Debug, Deserialize, Serialize, JsonSchema, Tsify, Default)]
48pub struct PetCaseCheckpointReward {
49 #[schemars(title = "Порог чекпоинта (крутки в уровне)")]
51 pub required_opens: i64,
52
53 #[schemars(title = "Валютные награды чекпоинта")]
55 pub currency_rewards: Vec<CurrencyUnit>,
56
57 #[schemars(title = "Награды петами чекпоинта")]
59 pub pet_rewards: Vec<PetCaseCheckpointPetReward>,
60}
61
62#[derive(Clone, Debug, Deserialize, Serialize, JsonSchema, Tsify, Default)]
65pub struct PetBigRollShard {
66 #[schemars(
68 title = "Минимальная редкость шарда",
69 schema_with = "pet_rarity_link_id_schema"
70 )]
71 pub min_rarity_id: PetRarityId,
72
73 #[schemars(title = "Количество шардов")]
75 pub count: u8,
76}
77
78#[derive(Clone, Debug, Deserialize, Serialize, JsonSchema, Tsify)]
79pub struct PetCasesSettingsByLevel {
80 #[schemars(title = "Уровень сундука")]
81 pub level: i64,
82
83 #[schemars(
84 title = "Стоимость уровня",
85 description = "Кумулятивное количество круток для достижения уровня"
86 )]
87 pub opens_to_upgrade: i64,
88
89 #[schemars(title = "Граничный уровень")]
92 pub is_boundary_level: bool,
93
94 #[schemars(title = "Веса редкостей")]
95 pub rarity_weights: Vec<PetCaseRarityWeight>,
96
97 #[schemars(title = "Чекпоинты уровня")]
99 pub checkpoints: Vec<PetCaseCheckpointReward>,
100
101 #[schemars(
103 title = "Допустимые редкости вишлиста",
104 schema_with = "pet_rarity_link_id_array_schema"
105 )]
106 pub allowed_wishlist_rarity_ids: Vec<PetRarityId>,
107
108 #[schemars(title = "Дополнительные валюты за большую крутку")]
110 pub big_roll_currency_rewards: Vec<CurrencyUnit>,
111
112 #[schemars(title = "Шарды большой крутки")]
115 pub big_roll_shards: Vec<PetBigRollShard>,
116}