namerena-rs/namerena-runner/src/player.rs

101 lines
2.2 KiB
Rust
Raw Normal View History

2024-05-04 19:15:35 +08:00
pub mod skills;
pub struct PlayerStatus {
frozen: bool,
}
impl Default for PlayerStatus {
fn default() -> Self {
PlayerStatus { frozen: false }
}
}
2024-05-04 17:28:19 +08:00
pub struct Player {
2024-05-04 17:56:33 +08:00
team: String,
name: String,
weapon: String,
player_type: PlayerType,
2024-05-04 19:15:35 +08:00
/// skl id
skil_id: Vec<u32>,
/// skl prop
skil_prop: Vec<u32>,
/// 玩家状态
///
/// 主要是我懒得加一大堆字段
status: PlayerStatus,
2024-05-04 17:28:19 +08:00
}
2024-05-04 17:56:33 +08:00
pub const BOSS_NAMES: [&str; 11] = [
"mario", "sonic", "mosquito", "yuri", "slime", "ikaruga", "conan", "aokiji", "lazy", "covid", "saitama",
];
2024-05-04 17:28:19 +08:00
#[derive(Default)]
pub enum PlayerType {
#[default]
Normal,
2024-05-04 17:41:59 +08:00
/// 种子玩家
2024-05-04 17:56:33 +08:00
///
2024-05-04 17:41:59 +08:00
/// # marker: `seed:`
Seed,
/// 被克隆的玩家
2024-05-04 17:56:33 +08:00
///
/// 似乎有个三种?
2024-05-04 17:41:59 +08:00
Clone,
/// Boss 玩家
/// 其实应该是一大堆
Boss,
/// 被特殊增强的玩家
2024-05-04 17:56:33 +08:00
///
2024-05-04 17:41:59 +08:00
/// 有一堆
Boost,
/// 标准测号用靶子
2024-05-04 17:56:33 +08:00
///
2024-05-04 17:41:59 +08:00
/// # marker: `\u0002`
Test1,
/// 没用到的测号用玩家
2024-05-04 17:56:33 +08:00
///
2024-05-04 17:41:59 +08:00
/// # marker: `\u0003`
Test2,
/// 比标准测号再强一点的测号用靶子
2024-05-04 17:56:33 +08:00
///
2024-05-04 17:41:59 +08:00
/// # marker: `!`
TestEx,
2024-05-04 17:28:19 +08:00
}
impl Player {
2024-05-04 17:56:33 +08:00
pub fn new(team: String, name: String, weapon: String) -> Self {
let player_type = {
2024-05-04 19:15:35 +08:00
match team.as_str() {
"!" => {
if BOSS_NAMES.contains(&name.as_str()) {
PlayerType::Boss
} else {
// 高强度测号用靶子
PlayerType::TestEx
}
}
"\u{0002}" => PlayerType::Test1,
"\u{0003}" => PlayerType::Test2,
_ => {
if name.starts_with("seed:") {
PlayerType::Seed
} else {
PlayerType::Normal
2024-05-04 17:56:33 +08:00
}
}
}
};
2024-05-04 17:28:19 +08:00
Player {
team,
name,
weapon,
2024-05-04 17:56:33 +08:00
player_type,
2024-05-04 19:15:35 +08:00
skil_id: vec![],
skil_prop: vec![],
status: PlayerStatus::default(),
2024-05-04 17:28:19 +08:00
}
}
2024-05-04 17:56:33 +08:00
pub fn update_player(&mut self) {}
2024-05-04 17:28:19 +08:00
}