wicked-waifus-rs/game-server/src/logic/handler/skill.rs
xavo95 c6b66eacb4
[PATCH] feat: implement formation and switch roles functionality
- Add support for multi-character formations and role switching
- Refactor entity management system to handle multiple entities per map
- Update attribute component to use a map-based approach for properties
- Implement formation-related handlers and notifications
- Add world entity management per map instance
- Update player save/load logic to handle formations
- Add visibility controls for active character display
2024-10-24 13:15:50 +02:00

35 lines
1.1 KiB
Rust

use crate::logic::ecs::component::ComponentContainer;
use shorekeeper_protocol::{
VisionExploreSkillSetRequest, VisionExploreSkillSetResponse, VisionSkillChangeNotify,
VisionSkillInformation,
};
use crate::{logic::player::Player, query_with};
pub fn on_vision_explore_skill_set_request(
player: &mut Player,
request: VisionExploreSkillSetRequest,
response: &mut VisionExploreSkillSetResponse,
) {
player.explore_tools.active_explore_skill = request.skill_id;
for (entity, owner, mut vision_skill) in query_with!(
player.world.borrow().get_world_entity(),
OwnerPlayer,
VisionSkill
) {
if owner.0 == player.basic_info.id {
vision_skill.skill_id = request.skill_id;
player.notify(VisionSkillChangeNotify {
entity_id: entity.into(),
vision_skill_infos: vec![VisionSkillInformation {
skill_id: request.skill_id,
..Default::default()
}],
..Default::default()
})
}
}
response.skill_id = request.skill_id;
}