Use masterdata for card exp cap

This commit is contained in:
Ethan O'Brien
2026-07-04 10:48:06 -05:00
parent cdcc3811c2
commit 7a8859b990
2 changed files with 80 additions and 9 deletions

View File

@@ -246,4 +246,28 @@ lazy_static! {
}
info
};
pub static ref CARD_RARITY: JsonValue = index_by(&t("card_rarity"), "rarity");
pub static ref CARD_EVOLVE: JsonValue = index_by(&t("card_evolve"), "rarity");
pub static ref CARD_LEVEL: JsonValue = {
let mut info = object! {};
for data in t("card_level").members() {
info[format!("{}_{}", data["id"], data["level"])] = data["exp"].clone();
}
info
};
pub static ref CARD_SKILL_MAX: JsonValue = {
let mut info = object! {};
for data in t("card_skill_level").members() {
let id = data["id"].to_string();
let exp = data["exp"].as_i64().unwrap_or(0);
if exp > info[&id].as_i64().unwrap_or(0) {
info[id] = exp.into();
}
}
info
};
}