This commit is contained in:
shenjack 2024-05-04 19:15:35 +08:00
parent 434d5c9b9b
commit 97cfc94234
Signed by: shenjack
GPG Key ID: 7B1134A979775551
2 changed files with 43 additions and 15 deletions

View File

@ -1,8 +1,28 @@
pub mod skills;
pub struct PlayerStatus {
frozen: bool,
}
impl Default for PlayerStatus {
fn default() -> Self {
PlayerStatus { frozen: false }
}
}
pub struct Player { pub struct Player {
team: String, team: String,
name: String, name: String,
weapon: String, weapon: String,
player_type: PlayerType, player_type: PlayerType,
/// skl id
skil_id: Vec<u32>,
/// skl prop
skil_prop: Vec<u32>,
/// 玩家状态
///
/// 主要是我懒得加一大堆字段
status: PlayerStatus,
} }
pub const BOSS_NAMES: [&str; 11] = [ pub const BOSS_NAMES: [&str; 11] = [
@ -45,22 +65,23 @@ pub enum PlayerType {
impl Player { impl Player {
pub fn new(team: String, name: String, weapon: String) -> Self { pub fn new(team: String, name: String, weapon: String) -> Self {
let player_type = { let player_type = {
if name.starts_with("seed:") { match team.as_str() {
// 种子 "!" => {
PlayerType::Seed if BOSS_NAMES.contains(&name.as_str()) {
} else { PlayerType::Boss
match team.as_str() { } else {
"!" => { // 高强度测号用靶子
if BOSS_NAMES.contains(&name.as_str()) { PlayerType::TestEx
PlayerType::Boss }
} else { }
// 高强度测号用靶子 "\u{0002}" => PlayerType::Test1,
PlayerType::TestEx "\u{0003}" => PlayerType::Test2,
} _ => {
if name.starts_with("seed:") {
PlayerType::Seed
} else {
PlayerType::Normal
} }
"\u{0002}" => PlayerType::Test1,
"\u{0003}" => PlayerType::Test2,
_ => PlayerType::Normal,
} }
} }
}; };
@ -69,6 +90,9 @@ impl Player {
name, name,
weapon, weapon,
player_type, player_type,
skil_id: vec![],
skil_prop: vec![],
status: PlayerStatus::default(),
} }
} }

View File

@ -0,0 +1,4 @@
pub enum Skills {
}