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 {
team: String,
name: String,
weapon: String,
player_type: PlayerType,
/// skl id
skil_id: Vec<u32>,
/// skl prop
skil_prop: Vec<u32>,
/// 玩家状态
///
/// 主要是我懒得加一大堆字段
status: PlayerStatus,
}
pub const BOSS_NAMES: [&str; 11] = [
@ -45,10 +65,6 @@ pub enum PlayerType {
impl Player {
pub fn new(team: String, name: String, weapon: String) -> Self {
let player_type = {
if name.starts_with("seed:") {
// 种子
PlayerType::Seed
} else {
match team.as_str() {
"!" => {
if BOSS_NAMES.contains(&name.as_str()) {
@ -60,7 +76,12 @@ impl Player {
}
"\u{0002}" => PlayerType::Test1,
"\u{0003}" => PlayerType::Test2,
_ => PlayerType::Normal,
_ => {
if name.starts_with("seed:") {
PlayerType::Seed
} else {
PlayerType::Normal
}
}
}
};
@ -69,6 +90,9 @@ impl Player {
name,
weapon,
player_type,
skil_id: vec![],
skil_prop: vec![],
status: PlayerStatus::default(),
}
}

View File

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