Fix tower and price listing
This commit is contained in:
parent
19d80030c9
commit
30767e8e0e
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -1093,7 +1093,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "fren"
|
name = "fren"
|
||||||
version = "2.5.0"
|
version = "2.5.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"axum 0.8.1",
|
"axum 0.8.1",
|
||||||
"base64 0.22.1",
|
"base64 0.22.1",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "fren"
|
name = "fren"
|
||||||
version = "2.5.0"
|
version = "2.5.1"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|||||||
@ -20,7 +20,11 @@ pub async fn improvements(ctx: Context<'_>) -> Result<(), Error> {
|
|||||||
if let Some(improvement) = Improvements::get_improvement(&ctx.data().db, improvement_type)?
|
if let Some(improvement) = Improvements::get_improvement(&ctx.data().db, improvement_type)?
|
||||||
{
|
{
|
||||||
if improvement_type.has_levels() {
|
if improvement_type.has_levels() {
|
||||||
msg_builder.push(format!(" (✅ Level={}) ", improvement.level));
|
msg_builder.push(format!(
|
||||||
|
"({} FC Level={}) ",
|
||||||
|
improvement_type.price().separate_with_commas(),
|
||||||
|
improvement.level
|
||||||
|
));
|
||||||
} else {
|
} else {
|
||||||
msg_builder.push(" (✅) ");
|
msg_builder.push(" (✅) ");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -62,6 +62,7 @@ impl ImprovementType {
|
|||||||
#[allow(clippy::match_like_matches_macro)]
|
#[allow(clippy::match_like_matches_macro)]
|
||||||
match self {
|
match self {
|
||||||
ImprovementType::FriendshipTower => true,
|
ImprovementType::FriendshipTower => true,
|
||||||
|
ImprovementType::JotchuaCollegeFund => true,
|
||||||
_ => false,
|
_ => false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -138,12 +139,15 @@ impl Improvements {
|
|||||||
let entry = improvements
|
let entry = improvements
|
||||||
.improvements
|
.improvements
|
||||||
.entry(improvement_type)
|
.entry(improvement_type)
|
||||||
.or_insert(Improvement { level: 1 })
|
.or_insert(Improvement { level: 0 });
|
||||||
.clone();
|
|
||||||
|
entry.level += 1;
|
||||||
|
|
||||||
|
let level = entry.level;
|
||||||
|
|
||||||
db.insert(improvements)?;
|
db.insert(improvements)?;
|
||||||
|
|
||||||
Ok(entry.level)
|
Ok(level)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn has_improvement(
|
pub fn has_improvement(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user