|
@ -4,8 +4,8 @@ use serde::{Serialize, Deserialize}; |
|
|
use rand::{Rng, SeedableRng};
|
|
|
use rand::{Rng, SeedableRng};
|
|
|
use rand::distributions::{WeightedIndex, Distribution};
|
|
|
use rand::distributions::{WeightedIndex, Distribution};
|
|
|
|
|
|
|
|
|
use crate::entity::item::{ItemDetail, Tool as ToolDetail};
|
|
|
|
|
|
use crate::entity::item::tool::{StackedTool, ToolType};
|
|
|
|
|
|
|
|
|
use crate::entity::item::ItemDetail;
|
|
|
|
|
|
use crate::entity::item::tech::{Technique, TechniqueDisk};
|
|
|
use crate::ship::room::{Difficulty, Episode};
|
|
|
use crate::ship::room::{Difficulty, Episode};
|
|
|
use crate::ship::map::MapVariantType;
|
|
|
use crate::ship::map::MapVariantType;
|
|
|
use crate::entity::character::SectionID;
|
|
|
use crate::entity::character::SectionID;
|
|
@ -13,23 +13,81 @@ use crate::ship::drops::load_data_file; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
|
|
|
|
struct TechniqueRateStat {
|
|
|
|
|
|
rate: u32,
|
|
|
|
|
|
min: i32,
|
|
|
|
|
|
max: i32,
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
|
|
|
|
struct TechniqueRate {
|
|
|
|
|
|
#[serde(rename = "Foie")]
|
|
|
|
|
|
foie: TechniqueRateStat,
|
|
|
|
|
|
#[serde(rename = "Gifoie")]
|
|
|
|
|
|
gifoie: TechniqueRateStat,
|
|
|
|
|
|
#[serde(rename = "Rafoie")]
|
|
|
|
|
|
rafoie: TechniqueRateStat,
|
|
|
|
|
|
#[serde(rename = "Zonde")]
|
|
|
|
|
|
zonde: TechniqueRateStat,
|
|
|
|
|
|
#[serde(rename = "Gizonde")]
|
|
|
|
|
|
gizonde: TechniqueRateStat,
|
|
|
|
|
|
#[serde(rename = "Razonde")]
|
|
|
|
|
|
razonde: TechniqueRateStat,
|
|
|
|
|
|
#[serde(rename = "Barta")]
|
|
|
|
|
|
barta: TechniqueRateStat,
|
|
|
|
|
|
#[serde(rename = "Gibarta")]
|
|
|
|
|
|
gibarta: TechniqueRateStat,
|
|
|
|
|
|
#[serde(rename = "Rabarta")]
|
|
|
|
|
|
rabarta: TechniqueRateStat,
|
|
|
|
|
|
#[serde(rename = "Grants")]
|
|
|
|
|
|
grants: TechniqueRateStat,
|
|
|
|
|
|
#[serde(rename = "Deband")]
|
|
|
|
|
|
deband: TechniqueRateStat,
|
|
|
|
|
|
#[serde(rename = "Jellen")]
|
|
|
|
|
|
jellen: TechniqueRateStat,
|
|
|
|
|
|
#[serde(rename = "Zalure")]
|
|
|
|
|
|
zalure: TechniqueRateStat,
|
|
|
|
|
|
#[serde(rename = "Shifta")]
|
|
|
|
|
|
shifta: TechniqueRateStat,
|
|
|
|
|
|
#[serde(rename = "Ryuker")]
|
|
|
|
|
|
ryuker: TechniqueRateStat,
|
|
|
|
|
|
#[serde(rename = "Resta")]
|
|
|
|
|
|
resta: TechniqueRateStat,
|
|
|
|
|
|
#[serde(rename = "Anti")]
|
|
|
|
|
|
anti: TechniqueRateStat,
|
|
|
|
|
|
#[serde(rename = "Reverser")]
|
|
|
|
|
|
reverser: TechniqueRateStat,
|
|
|
|
|
|
#[serde(rename = "Megid")]
|
|
|
|
|
|
megid: TechniqueRateStat,
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
|
|
|
|
struct TechniqueRates {
|
|
|
|
|
|
area1: TechniqueRate,
|
|
|
|
|
|
area2: TechniqueRate,
|
|
|
|
|
|
area3: TechniqueRate,
|
|
|
|
|
|
area4: TechniqueRate,
|
|
|
|
|
|
area5: TechniqueRate,
|
|
|
|
|
|
area6: TechniqueRate,
|
|
|
|
|
|
area7: TechniqueRate,
|
|
|
|
|
|
area8: TechniqueRate,
|
|
|
|
|
|
area9: TechniqueRate,
|
|
|
|
|
|
area10: TechniqueRate,
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub struct TechniqueTable {
|
|
|
pub struct TechniqueTable {
|
|
|
|
|
|
|
|
|
|
|
|
rates: TechniqueRates
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
impl TechniqueTable {
|
|
|
impl TechniqueTable {
|
|
|
pub fn new(episode: Episode, difficulty: Difficulty, section_id: SectionID) -> TechniqueTable {
|
|
|
pub fn new(episode: Episode, difficulty: Difficulty, section_id: SectionID) -> TechniqueTable {
|
|
|
TechniqueTable {
|
|
|
TechniqueTable {
|
|
|
|
|
|
rates: load_data_file(episode, difficulty, section_id, "tech_rate.toml")
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|