From 513ee408f7624b3b98898674376d0672bcaf312d Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 20 May 2021 01:39:43 +0000 Subject: [PATCH] more tech testing qol changes --- src/bin/main.rs | 2 ++ src/ship/map/area.rs | 10 ++++++++++ src/ship/packet/handler/message.rs | 6 ++++-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/bin/main.rs b/src/bin/main.rs index accc86d..dc3ae77 100644 --- a/src/bin/main.rs +++ b/src/bin/main.rs @@ -73,6 +73,8 @@ fn main() { character.name = "ItemRefactor".into(); character.exp = 80000000; character.meseta = 999999; + character.techs.set_tech(elseware::entity::item::tech::Technique::Shifta, elseware::entity::character::TechLevel(3)); + character.techs.set_tech(elseware::entity::item::tech::Technique::Deband, elseware::entity::character::TechLevel(3)); let character = entity_gateway.create_character(character).await.unwrap(); for _ in 0..3 { diff --git a/src/ship/map/area.rs b/src/ship/map/area.rs index 9621109..af3f6f4 100644 --- a/src/ship/map/area.rs +++ b/src/ship/map/area.rs @@ -284,6 +284,16 @@ impl MapAreaLookup { Episode::Four => MapAreaLookup::default_ep4_maps(), } } + + pub fn from_changed_floor(&self, floor: u8) -> Option { + match floor { + 20 => Some(MapArea::Forest1), + 30 => Some(MapArea::Caves1), + 40 => Some(MapArea::Mines1), + 48 => Some(MapArea::Ruins1), + _ => None, + } + } } diff --git a/src/ship/packet/handler/message.rs b/src/ship/packet/handler/message.rs index 0ce969a..0c9bf96 100644 --- a/src/ship/packet/handler/message.rs +++ b/src/ship/packet/handler/message.rs @@ -228,12 +228,14 @@ pub fn update_player_position(id: ClientId, client.x = p.x; client.y = p.y; }, - // GameMessage::PlayerChangedFloor(p) => {client.area = MapArea::from_value(&room.mode.episode(), p.map).ok();}, + GameMessage::PlayerChangedFloor(p) => { + client.area = room.map_areas.from_changed_floor(p.data[0]); + }, GameMessage::InitializeSpeechNpc(p) => { client.x = p.x; client.z = p.z; } - _ => {}, + _ => {unreachable!()}, } } else {} let m = message.clone();