1
Fork 0
mirror of https://github.com/Steffo99/patched-porobot.git synced 2024-12-22 09:34:21 +00:00

Lazily update to game version 5.9.0

This commit is contained in:
Steffo 2024-10-01 14:56:39 +02:00
parent 8ae11125ed
commit cf4adc4024
Signed by: steffo
GPG key ID: 5ADA3868646C3FC0
6 changed files with 79 additions and 32 deletions

View file

@ -118,8 +118,8 @@ mod tests {
};
}
test_fetch!(test_fetch_4_9_0_en_us, "4_9_0", "en_us");
test_fetch!(test_fetch_4_9_0_it_it, "4_9_0", "it_it");
test_fetch!(test_fetch_5_9_0_en_us, "5_9_0", "en_us");
test_fetch!(test_fetch_5_9_0_it_it, "5_9_0", "it_it");
test_fetch!(test_fetch_latest_en_us, "latest", "en_us");
macro_rules! test_supported {
@ -140,7 +140,7 @@ mod tests {
};
}
test_supported!(test_supported_4_9_0_en_us, "4_9_0", "en_us");
test_supported!(test_supported_4_9_0_it_it, "4_9_0", "it_it");
test_supported!(test_supported_5_9_0_en_us, "5_9_0", "en_us");
test_supported!(test_supported_5_9_0_it_it, "5_9_0", "it_it");
test_supported!(test_supported_latest_en_us, "latest", "en_us");
}

View file

@ -33,6 +33,7 @@ impl CardArt {
fn imgproxy_convert_to_jpg(url: &str) -> String {
use base64::Engine;
let url = url.replace("http:", "https:");
let url = base64::prelude::BASE64_URL_SAFE.encode(url);
let url = format!("/{url}.jpg");

View file

@ -220,10 +220,11 @@ pub enum CardKeyword {
Fated,
#[serde(alias = "BlocksElusive")]
/// ???
#[serde(alias = "BlockElusive")]
/// Sharpsight.
///
/// > Can block Elusive units.
BlockElusive,
Sharpsight,
/// Fury.
///
@ -332,6 +333,11 @@ pub enum CardKeyword {
/// > Can only be blocked by enemies with 3 or more Power.
Fearsome,
/// Deathless.
///
/// > The next time this unit dies, remove Deathless and revive it Stunned with 1 Health.
Deathless,
/// Can't Block.
CantBlock,
@ -372,6 +378,23 @@ pub enum CardKeyword {
/// ???
Freljord,
/// > Activatable once per round. When activated, play the skill of the current Act at Focus speed, then transform me to the next Act.
#[serde(rename = "Story:Focus")]
StoryFocus,
/// > Activatable once per round. When activated, play the skill of the current Act at Slow speed, then transform me to the next Act.
#[serde(rename = "Story:Slow")]
StorySlow,
/// > Applies a negative effect as long as it's in hand. Multiples of the same curse on a unit combine, increasing their cost and effect. Cannot be targeted in hand.
Curse,
/// This unit has +1|+1. This keyword can stack.
Spirit,
/// > This unit has -1|-1. This keyword can stack.
Gloom,
/// Unsupported card keyword.
#[serde(other)]
Unsupported,
@ -464,12 +487,18 @@ impl CardKeyword {
CardKeyword::Nightfall => "",
CardKeyword::Daybreak => "",
CardKeyword::Plunder => "",
CardKeyword::BlockElusive => "",
CardKeyword::Sharpsight => "",
CardKeyword::Flow => "",
CardKeyword::Capture => "<:capture:1056024295190577153>",
CardKeyword::Attack => "",
CardKeyword::ElementalSkill => "<:elementalskill:1165762476974026814>",
CardKeyword::LevelUp => "",
CardKeyword::StoryFocus => "", // TODO
CardKeyword::StorySlow => "", // TODO
CardKeyword::Spirit => "", // TODO
CardKeyword::Gloom => "", // TODO
CardKeyword::Curse => "", // TODO
CardKeyword::Deathless => "", // TODO
CardKeyword::Freljord => "<:freljord:1056024331437735936>",
CardKeyword::Unsupported => "<:invaliddeck:1056022952396730438>",
}
@ -538,8 +567,9 @@ mod tests {
test_deserialization!(deserialize_elusive, r#""Elusive""#, CardKeyword::Elusive);
test_deserialization!(deserialize_stun, r#""Stun""#, CardKeyword::Stun);
test_deserialization!(deserialize_fated, r#""Fated""#, CardKeyword::Fated);
test_deserialization!(deserialize_blockelusive, r#""BlockElusive""#, CardKeyword::BlockElusive);
test_deserialization!(deserialize_blockelusive2, r#""BlocksElusive""#, CardKeyword::BlockElusive);
test_deserialization!(deserialize_blockelusive, r#""BlockElusive""#, CardKeyword::Sharpsight);
test_deserialization!(deserialize_blockelusive2, r#""BlocksElusive""#, CardKeyword::Sharpsight);
test_deserialization!(deserialize_sharpsight, r#""Sharpsight""#, CardKeyword::Sharpsight);
test_deserialization!(deserialize_fury, r#""Fury""#, CardKeyword::Fury);
test_deserialization!(deserialize_barrier, r#""Barrier""#, CardKeyword::Barrier);
test_deserialization!(deserialize_immobile, r#""Immobile""#, CardKeyword::Immobile);
@ -570,5 +600,11 @@ mod tests {
test_deserialization!(deserialize_elementalskill, r#""ElementalSkill""#, CardKeyword::ElementalSkill);
test_deserialization!(deserialize_levelup, r#""LevelUp""#, CardKeyword::LevelUp);
test_deserialization!(deserialize_freljord, r#""Freljord""#, CardKeyword::Freljord);
test_deserialization!(deserialize_curse, r#""Curse""#, CardKeyword::Curse);
test_deserialization!(deserialize_spirit, r#""Spirit""#, CardKeyword::Spirit);
test_deserialization!(deserialize_gloom, r#""Gloom""#, CardKeyword::Gloom);
test_deserialization!(deserialize_deathless, r#""Deathless""#, CardKeyword::Deathless);
test_deserialization!(deserialize_storyslow, r#""Story:Slow""#, CardKeyword::StorySlow);
test_deserialization!(deserialize_storyfocus, r#""Story:Focus""#, CardKeyword::StoryFocus);
test_deserialization!(deserialize_unsupported, r#""Xyzzy""#, CardKeyword::Unsupported);
}

View file

@ -96,27 +96,29 @@ mod tests {
};
}
test_fetch!(test_fetch_4_9_0_en_us_set1, "4_9_0", "en_us", "set1");
test_fetch!(test_fetch_4_9_0_en_us_set2, "4_9_0", "en_us", "set2");
test_fetch!(test_fetch_4_9_0_en_us_set3, "4_9_0", "en_us", "set3");
test_fetch!(test_fetch_4_9_0_en_us_set4, "4_9_0", "en_us", "set4");
test_fetch!(test_fetch_4_9_0_en_us_set5, "4_9_0", "en_us", "set5");
test_fetch!(test_fetch_4_9_0_en_us_set6, "4_9_0", "en_us", "set6");
test_fetch!(test_fetch_4_9_0_en_us_set6cde, "4_9_0", "en_us", "set6cde");
test_fetch!(test_fetch_4_9_0_en_us_set7, "4_9_0", "en_us", "set7");
test_fetch!(test_fetch_4_9_0_en_us_set7b, "4_9_0", "en_us", "set7b");
test_fetch!(test_fetch_4_9_0_en_us_set8, "4_9_0", "en_us", "set8");
test_fetch!(test_fetch_5_9_0_en_us_set1, "5_9_0", "en_us", "set1");
test_fetch!(test_fetch_5_9_0_en_us_set2, "5_9_0", "en_us", "set2");
test_fetch!(test_fetch_5_9_0_en_us_set3, "5_9_0", "en_us", "set3");
test_fetch!(test_fetch_5_9_0_en_us_set4, "5_9_0", "en_us", "set4");
test_fetch!(test_fetch_5_9_0_en_us_set5, "5_9_0", "en_us", "set5");
test_fetch!(test_fetch_5_9_0_en_us_set6, "5_9_0", "en_us", "set6");
test_fetch!(test_fetch_5_9_0_en_us_set6cde, "5_9_0", "en_us", "set6cde");
test_fetch!(test_fetch_5_9_0_en_us_set7, "5_9_0", "en_us", "set7");
test_fetch!(test_fetch_5_9_0_en_us_set7b, "5_9_0", "en_us", "set7b");
test_fetch!(test_fetch_5_9_0_en_us_set8, "5_9_0", "en_us", "set8");
test_fetch!(test_fetch_5_9_0_en_us_set9, "5_9_0", "en_us", "set9");
test_fetch!(test_fetch_4_9_0_it_it_set1, "4_9_0", "it_it", "set1");
test_fetch!(test_fetch_4_9_0_it_it_set2, "4_9_0", "it_it", "set2");
test_fetch!(test_fetch_4_9_0_it_it_set3, "4_9_0", "it_it", "set3");
test_fetch!(test_fetch_4_9_0_it_it_set4, "4_9_0", "it_it", "set4");
test_fetch!(test_fetch_4_9_0_it_it_set5, "4_9_0", "it_it", "set5");
test_fetch!(test_fetch_4_9_0_it_it_set6, "4_9_0", "it_it", "set6");
test_fetch!(test_fetch_4_9_0_it_it_set6cde, "4_9_0", "it_it", "set6cde");
test_fetch!(test_fetch_4_9_0_it_it_set7, "4_9_0", "it_it", "set7");
test_fetch!(test_fetch_4_9_0_it_it_set7b, "4_9_0", "it_it", "set7b");
test_fetch!(test_fetch_4_9_0_it_it_set8, "4_9_0", "it_it", "set8");
test_fetch!(test_fetch_5_9_0_it_it_set1, "5_9_0", "it_it", "set1");
test_fetch!(test_fetch_5_9_0_it_it_set2, "5_9_0", "it_it", "set2");
test_fetch!(test_fetch_5_9_0_it_it_set3, "5_9_0", "it_it", "set3");
test_fetch!(test_fetch_5_9_0_it_it_set4, "5_9_0", "it_it", "set4");
test_fetch!(test_fetch_5_9_0_it_it_set5, "5_9_0", "it_it", "set5");
test_fetch!(test_fetch_5_9_0_it_it_set6, "5_9_0", "it_it", "set6");
test_fetch!(test_fetch_5_9_0_it_it_set6cde, "5_9_0", "it_it", "set6cde");
test_fetch!(test_fetch_5_9_0_it_it_set7, "5_9_0", "it_it", "set7");
test_fetch!(test_fetch_5_9_0_it_it_set7b, "5_9_0", "it_it", "set7b");
test_fetch!(test_fetch_5_9_0_it_it_set8, "5_9_0", "it_it", "set8");
test_fetch!(test_fetch_5_9_0_it_it_set9, "5_9_0", "it_it", "set9");
test_fetch!(test_fetch_latest_en_us_set1, "latest", "en_us", "set1");
test_fetch!(test_fetch_latest_en_us_set2, "latest", "en_us", "set2");
@ -128,6 +130,7 @@ mod tests {
test_fetch!(test_fetch_latest_en_us_set7, "latest", "en_us", "set7");
test_fetch!(test_fetch_latest_en_us_set7b, "latest", "en_us", "set7b");
test_fetch!(test_fetch_latest_en_us_set8, "latest", "en_us", "set8");
test_fetch!(test_fetch_latest_en_us_set9, "latest", "en_us", "set9");
}

View file

@ -52,7 +52,8 @@ pub enum CardRegion {
Evelynn,
/// Runeterra: Bard.
Bard,
/// Runeterra: Elder Dragon.
ElderDragon,
/// Unsupported region.
#[serde(other)]
@ -160,6 +161,7 @@ impl CardRegion {
CardRegion::PoroKing => "",
CardRegion::Evelynn => "",
CardRegion::Bard => "",
CardRegion::ElderDragon => "",
CardRegion::Unsupported => "<:invaliddeck:1056022952396730438>",
}
}

View file

@ -48,6 +48,10 @@ pub enum CardSet {
#[serde(rename = "Set8")]
FatesVoyage,
/// Dreamlit Paths.
#[serde(rename = "Set9")]
DreamlitPaths,
/// Events, cards released "outside" a set.
#[serde(rename = "SetEvent")]
Events,
@ -116,7 +120,8 @@ impl CardSet {
CardSet::GloryInNavori => "<:glory_in_navori:1095363395890458756>",
CardSet::HeartOfTheHuntress => "<:heart_of_the_huntress:1165769749922320494>",
CardSet::FatesVoyage => "<:fates_voyage:1165769932995317851>",
CardSet::Events => "",
CardSet::DreamlitPaths => "", // TODO
CardSet::Events => "", // TODO
CardSet::Unsupported => "<:invaliddeck:1056022952396730438>",
}
}