diff --git a/crates/game-server/src/logic/player/role.rs b/crates/game-server/src/logic/player/role.rs index 443d29a..9643faa 100644 --- a/crates/game-server/src/logic/player/role.rs +++ b/crates/game-server/src/logic/player/role.rs @@ -2,6 +2,7 @@ use std::collections::{HashMap, HashSet}; use trigger_database::entity::avatar; use trigger_database::prelude::*; +use trigger_logic::skill::EAvatarSkillType; use trigger_protocol::{Avatar, AvatarSkillLevel, DressedEquip}; use trigger_sv::time_util; @@ -314,7 +315,14 @@ impl RoleModel { exp: 0, rank: 6, passive_skill_level: 6, - skill_type_level: (0..=6).map(|_| 12).collect(), + skill_type_level: (0..(EAvatarSkillType::EnumCount as i32)) + .map(EAvatarSkillType::try_from) + .map(|ty| { + (ty.unwrap() == EAvatarSkillType::CoreSkill) + .then_some(7) + .unwrap_or(12) + }) + .collect(), unlocked_talent_num: 6, talent_switch: 0b111000, cur_weapon_uid: 0, diff --git a/crates/trigger-logic/src/lib.rs b/crates/trigger-logic/src/lib.rs index 2fc856c..ce07c15 100644 --- a/crates/trigger-logic/src/lib.rs +++ b/crates/trigger-logic/src/lib.rs @@ -2,3 +2,4 @@ pub mod action_pb; pub mod item; pub mod quest; pub mod scene; +pub mod skill; diff --git a/crates/trigger-logic/src/skill.rs b/crates/trigger-logic/src/skill.rs new file mode 100644 index 0000000..7326eb3 --- /dev/null +++ b/crates/trigger-logic/src/skill.rs @@ -0,0 +1,14 @@ +use num_enum::{IntoPrimitive, TryFromPrimitive}; + +#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy, IntoPrimitive, TryFromPrimitive)] +#[repr(i32)] +pub enum EAvatarSkillType { + SpecialAttack = 1, + UniqueSkill = 4, + CommonAttack = 0, + CooperateSkill = 3, + AssistSkill = 6, + Evade = 2, + CoreSkill = 5, + EnumCount = 7, +}