feat: make gacha student pool excplicit
This commit is contained in:
parent
06591c0df2
commit
0cbcac06af
|
@ -152,6 +152,15 @@
|
||||||
},
|
},
|
||||||
"rarity": 3
|
"rarity": 3
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": {
|
||||||
|
"translations": {
|
||||||
|
"eng": "Mashiro",
|
||||||
|
"jpn": "マシロ"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"rarity": 3
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": {
|
"name": {
|
||||||
"translations": {
|
"translations": {
|
||||||
|
@ -403,14 +412,5 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"rarity": 1
|
"rarity": 1
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": {
|
|
||||||
"translations": {
|
|
||||||
"eng": "Mashiro",
|
|
||||||
"jpn": "マシロ"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"rarity": 3
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
@ -182,15 +182,19 @@ pub async fn banner(ctx: &Context, msg: &Message) -> CommandResult {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn create_2021_02_04_hoshino_shiroko_banner() -> Banner {
|
fn _create_2021_02_04_hoshino_shiroko_banner() -> Banner {
|
||||||
// TODO: Make who's in the gacha pool explicit
|
// TODO: Make who's in the gacha pool explicit
|
||||||
// e.g. state who we're adding to the banner, rather than who we're
|
// e.g. state who we're adding to the banner, rather than who we're
|
||||||
// removing
|
// removing
|
||||||
let pool: Vec<Student> = STUDENTS
|
let three_star_students = "ヒナ, イオリ, ハルナ, イズミ, アル, スミレ, エイミ, カリン, ネル, マキ, ヒビキ, サヤ, シュン, シロコ, ホシノ, ヒフミ, ツルギ";
|
||||||
.iter()
|
let two_star_students = "アカリ, ジュンコ, ムツキ, カヨコ, フウカ, ユウカ, アカネ, ハレ, ウタハ, チセ, ツバキ, セリカ, アヤネ, ハスミ, ハナエ, アイリ";
|
||||||
.filter(|student| student.name != "ノゾミ" || student.name == "マシロ")
|
let one_star_students =
|
||||||
.cloned()
|
"チナツ, ハルカ, ジュリ, コタマ, アスナ, コトリ, フィーナ, スズミ, シミコ, セリナ, ヨシミ";
|
||||||
.collect();
|
|
||||||
|
let mut pool = Vec::new();
|
||||||
|
pool.extend(get_students(three_star_students));
|
||||||
|
pool.extend(get_students(two_star_students));
|
||||||
|
pool.extend(get_students(one_star_students));
|
||||||
|
|
||||||
let sparkable: Vec<Student> = pool
|
let sparkable: Vec<Student> = pool
|
||||||
.iter()
|
.iter()
|
||||||
|
@ -212,12 +216,16 @@ pub fn create_2021_02_04_hoshino_shiroko_banner() -> Banner {
|
||||||
.unwrap()
|
.unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn create_2021_02_11_mashiro_banner() -> Banner {
|
fn create_2021_02_11_mashiro_banner() -> Banner {
|
||||||
let pool: Vec<Student> = STUDENTS
|
let three_star_students = "ヒナ, イオリ, ハルナ, イズミ, アル, スミレ, エイミ, カリン, ネル, マキ, ヒビキ, サヤ, シュン, シロコ, ホシノ, ヒフミ, ツルギ, マシロ";
|
||||||
.iter()
|
let two_star_students = "アカリ, ジュンコ, ムツキ, カヨコ, フウカ, ユウカ, アカネ, ハレ, ウタハ, チセ, ツバキ, セリカ, アヤネ, ハスミ, ハナエ, アイリ";
|
||||||
.filter(|student| student.name != "ノゾミ")
|
let one_star_students =
|
||||||
.cloned()
|
"チナツ, ハルカ, ジュリ, コタマ, アスナ, コトリ, フィーナ, スズミ, シミコ, セリナ, ヨシミ";
|
||||||
.collect();
|
|
||||||
|
let mut pool = Vec::new();
|
||||||
|
pool.extend(get_students(three_star_students));
|
||||||
|
pool.extend(get_students(two_star_students));
|
||||||
|
pool.extend(get_students(one_star_students));
|
||||||
|
|
||||||
let sparkable: Vec<Student> = pool
|
let sparkable: Vec<Student> = pool
|
||||||
.iter()
|
.iter()
|
||||||
|
@ -239,6 +247,27 @@ pub fn create_2021_02_11_mashiro_banner() -> Banner {
|
||||||
.unwrap()
|
.unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn get_students(student_list: &str) -> Vec<Student> {
|
||||||
|
let names = student_list.split(", ");
|
||||||
|
let mut students = match names.size_hint().1 {
|
||||||
|
Some(size) => Vec::with_capacity(size),
|
||||||
|
None => Vec::new(),
|
||||||
|
};
|
||||||
|
|
||||||
|
for name in names {
|
||||||
|
let maybe_student = STUDENTS.iter().find(|student| student.name == name);
|
||||||
|
|
||||||
|
match maybe_student {
|
||||||
|
Some(student) => {
|
||||||
|
students.push(student.clone());
|
||||||
|
}
|
||||||
|
None => error!("Could not find {} in students.json", name),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
students
|
||||||
|
}
|
||||||
|
|
||||||
fn get_rarity_colour(rarity: Rarity) -> Colour {
|
fn get_rarity_colour(rarity: Rarity) -> Colour {
|
||||||
match rarity {
|
match rarity {
|
||||||
Rarity::One => Colour::from_rgb(227, 234, 240),
|
Rarity::One => Colour::from_rgb(227, 234, 240),
|
||||||
|
|
Loading…
Reference in New Issue