diff --git a/wicked-waifus-game-server/scripts/watermask-edit.js b/wicked-waifus-game-server/scripts/watermask-edit.js index d255330..980d175 100644 --- a/wicked-waifus-game-server/scripts/watermask-edit.js +++ b/wicked-waifus-game-server/scripts/watermask-edit.js @@ -8,7 +8,7 @@ const UE = require("ue"), UiLayer_1 = require("../../Ui/UiLayer"); var _a = require('../Module/WaterMask/WaterMaskController').WaterMaskView; -_a.LOo = 0.18; +_a.LOo = 0.12; _a.yOo = 700; _a.IOo = 700; _a.vOo = function () { @@ -24,7 +24,7 @@ _a.vOo = function () { _ = e.widget.height / 2, s = Math.ceil(e.widget.width / _a.yOo), o = Math.ceil(e.widget.height / _a.IOo), - v = " "; // EDIT ME! + v = "{PLAYER_USERNAME} - Subject to change!"; // EDIT ME! for (let a = 0; a < s; a++) for (let e = 0; e < o; e++) { var E = UE.KuroActorManager.SpawnActor(Info_1.Info.World, UE.UITextActor.StaticClass(), MathUtils_1 diff --git a/wicked-waifus-game-server/src/logic/ecs/buf.rs b/wicked-waifus-game-server/src/logic/ecs/buf.rs index 98bd1df..0df80b3 100644 --- a/wicked-waifus-game-server/src/logic/ecs/buf.rs +++ b/wicked-waifus-game-server/src/logic/ecs/buf.rs @@ -26,6 +26,14 @@ const ROLE_OVERRIDES: &[(i32, &[i64])] = &[ ]), ]; +const ROLE_BUFF_BLACKLIST: &[(i32, &[i64])] = &[ + (1407, &[ + // ciaconna's forte buffs are completely fucked to get from an algorithm and i hate kuro! + 1407900003, + 1407500040, + ]), +]; + fn get_role_buff_overrides(role_id: i32) -> Option<&'static [i64]> { for &(role, buff) in ROLE_OVERRIDES { if role == role_id { @@ -78,19 +86,18 @@ impl BufManager { pub fn create_permanent_buffs(&mut self, origin_id: i64, role_id: i32) -> Vec { let mut buffs = wicked_waifus_data::buff_data::iter().filter(|(id, buf)| { - id.to_string().starts_with(&role_id.to_string()) // must be part of char kit :) - && - ( - !id.to_string().contains("666")// KURO IS EVIL - && - buf.duration_policy == 1 - ) - // && - // !buf.ge_desc.contains("【废弃】") // remove "deprecated" buffs + let id_str = id.to_string(); + let role_str = role_id.to_string(); + + id_str.starts_with(&role_str) + && + id_str[role_str.len()..].chars().all(|c| c == '0') // ensure remaining chars are all '0' }) .map(|x| *x.0) .collect::>(); + tracing::debug!("adding roleid {:#?}", buffs); + buffs.extend(OVERRIDE_BUFFS.iter().copied()); if let Some(role_buff_overrides) = get_role_buff_overrides(role_id) { buffs.extend(role_buff_overrides.iter().copied()); diff --git a/wicked-waifus-game-server/src/logic/handler/attribute.rs b/wicked-waifus-game-server/src/logic/handler/attribute.rs new file mode 100644 index 0000000..6f61400 --- /dev/null +++ b/wicked-waifus-game-server/src/logic/handler/attribute.rs @@ -0,0 +1,60 @@ +use wicked_waifus_protocol::{AttributeChangedRequest, AttributeChangedResponse, EAttributeType, ErrorCode, FormationAttrRequest, FormationAttrResponse}; + +use crate::{logic::{ecs::component::ComponentContainer, player::Player}, query_components}; + +pub fn on_attribute_changed_request( + player: &mut Player, + request: AttributeChangedRequest, + response: &mut AttributeChangedResponse, +) { + let mut world_ref = player.world.borrow_mut(); + let world = world_ref.get_mut_world_entity(); + + let id = request.id; + + if let (Some(mut component),) = query_components!(world, id, Attribute) { + for needs_editing in request.attributes { + if let Ok(attr_type) = EAttributeType::try_from(needs_editing.attribute_type) { + component.attr_map.get_mut(&attr_type).unwrap().0 = needs_editing.current_value; + component.attr_map.get_mut(&attr_type).unwrap().1 = needs_editing.value_increment; + } else { + tracing::warn!("Attribute skipped!"); + continue; + } + } + + response.error_code = ErrorCode::Success.into() + } else { + response.error_code = ErrorCode::ErrEntityNotFound.into() + }; +} + +pub fn on_formation_attr_request( + player: &mut Player, + request: FormationAttrRequest, + response: &mut FormationAttrResponse, +) { + let mut world_ref = player.world.borrow_mut(); + let world = world_ref.get_mut_world_entity(); + + let formation = &player.formation_list[&player.cur_formation_id]; + + for role_id in formation.role_ids.clone() { + if let (Some(mut component),) = query_components!(world, role_id as i64, Attribute) { + for needs_editing in &request.formation_attrs { + if let Ok(attr_type) = EAttributeType::try_from(needs_editing.attr_id) { + component.attr_map.get_mut(&attr_type).unwrap().0 = needs_editing.current_value; + component.attr_map.get_mut(&attr_type).unwrap().1 = needs_editing.max_value; + } else { + tracing::warn!("Attribute skipped!"); + continue; + } + } + response.error_code = ErrorCode::Success.into() + } else { + response.error_code = ErrorCode::ErrEntityNotFound.into() + }; + } + + +} \ No newline at end of file diff --git a/wicked-waifus-game-server/src/logic/handler/mod.rs b/wicked-waifus-game-server/src/logic/handler/mod.rs index da75c57..bc83c0c 100644 --- a/wicked-waifus-game-server/src/logic/handler/mod.rs +++ b/wicked-waifus-game-server/src/logic/handler/mod.rs @@ -1,3 +1,4 @@ +pub use attribute::*; pub use advice::*; pub use animal::*; pub use chat::*; @@ -20,6 +21,7 @@ pub use skill::*; pub use teleport::*; pub use tutorial::*; +mod attribute; mod advice; mod animal; mod chat; @@ -110,6 +112,34 @@ macro_rules! handle_push { }; } +macro_rules! handle_action { + ($($variant:ident);* $(,)?) => { + use wicked_waifus_data::pb_components::action::Action; + use crate::logic::player::Player; + + fn perform_action( + player: &mut Player, + entity_id: i64, + level_entity_data: &wicked_waifus_data::LevelEntityConfigData, + template_config: &wicked_waifus_data::TemplateConfigData, + element: Action + ) { + ::paste::paste! { + match element { + $( + Action::$variant(inner) => { + paste::paste! { + [<$variant:snake _action>](player, entity_id, level_entity_data, template_config, inner) + } + }, + _ => tracing::debug!("hi") + )* + } + } + } + }; +} + handle_request! { // Advice Advice; @@ -120,6 +150,10 @@ handle_request! { AnimalDrop; AnimalDestroy; + // Attribute + AttributeChanged; + FormationAttr; + // Chat (TODO: Review TODOs) PrivateChat; PrivateChatData; @@ -198,7 +232,6 @@ handle_request! { RoleShowListUpdate; ClientCurrentRoleReport; RoleFavorList; - FormationAttr; UpdateFormation; // Scene (TODO: Review this on_..., port some from go) @@ -284,6 +317,193 @@ handle_push! { VersionInfo; } +handle_action! { + ExecBattleAction(_); + WaitBattleCondition(_); + SetBattleState(_); + Action::PlayFlow(action) => unimplemented_action! { action }, + Action::Collect(_) => collect_action(player, level_entity_data, template_config), + Action::LeisureInteract(action) => unimplemented_action! { action }, + Action::UnlockTeleportTrigger(action) => unlock_teleport_trigger(player, action.params), + Action::EnableTemporaryTeleport(action) => unimplemented_action! { action }, + Action::OpenSystemBoard(action) => unimplemented_action! { action }, + Action::OpenSystemFunction(action) => unimplemented_action! { action }, + Action::ChangeSelfEntityState(action) => change_self_entity_state(player, entity_id, level_entity_data, template_config, action.params), + Action::SetPlayerOperationRestriction(action) => unimplemented_action! { action }, + Action::Wait(action) => unimplemented_action! { action }, + Action::ChangeEntityState(action) => unimplemented_action! { action }, + Action::Log(action) => unimplemented_action! { action }, + Action::EnableNearbyTracking(action) => unimplemented_action! { action }, + Action::TeleportDungeon(action) => unimplemented_action! { action }, + Action::DestroySelf(action) => unimplemented_action! { action }, + Action::CameraLookAt(action) => unimplemented_action! { action }, + Action::StopCameraLookAt(action) => unimplemented_action! { action }, + Action::EnterOrbitalCamera(action) => unimplemented_action! { action }, + Action::ExitOrbitalCamera(action) => unimplemented_action! { action }, + Action::SendAiEvent(action) => unimplemented_action! { action }, + Action::SetInteractionLockState(action) => unimplemented_action! { action }, + Action::AwakeEntity(action) => unimplemented_action! { action }, + Action::ChangeLiftTarget(action) => unimplemented_action! { action }, + Action::CalculateVar(action) => unimplemented_action! { action }, + Action::AddBuffToPlayer(action) => unimplemented_action! { action }, + Action::RemoveBuffFromPlayer(action) => unimplemented_action! { action }, + Action::AddBuffToEntity(action) => unimplemented_action! { action }, + Action::RemoveBuffFromEntity(action) => unimplemented_action! { action }, + Action::Prompt(action) => unimplemented_action! { action }, + Action::SetEntityVisible(action) => unimplemented_action! { action }, + Action::DestroyEntity(action) => unimplemented_action! { action }, + Action::GuideTrigger(action) => unimplemented_action! { action }, + Action::TriggerCameraShake(action) => unimplemented_action! { action }, + Action::SetVar(action) => unimplemented_action! { action }, + Action::VehicleEnter(action) => unimplemented_action! { action }, + Action::VehicleExitPlayer(action) => unimplemented_action! { action }, + Action::LockEntity(action) => unimplemented_action! { action }, + Action::UnlockEntity(action) => unimplemented_action! { action }, + Action::CommonTip(action) => unimplemented_action! { action }, + Action::CommonTip2(action) => unimplemented_action! { action }, + Action::PostAkEvent(action) => unimplemented_action! { action }, + Action::VehicleEnterNpc(action) => unimplemented_action! { action }, + Action::VehicleExitNpc(action) => unimplemented_action! { action }, + Action::PlayerLookAt(action) => unimplemented_action! { action }, + Action::PlayBubble(action) => unimplemented_action! { action }, + Action::AddPlayBubble(action) => unimplemented_action! { action }, + Action::ClearPlayBubble(action) => unimplemented_action! { action }, + Action::ExecRiskHarvestEffect(action) => unimplemented_action! { action }, + Action::EnableLevelPlay(action) => unimplemented_action! { action }, + Action::ClaimLevelPlayReward(action) => unimplemented_action! { action }, + Action::SettlementDungeon(action) => unimplemented_action! { action }, + Action::ExitDungeon(action) => unimplemented_action! { action }, + Action::FinishDungeon(action) => unimplemented_action! { action }, + Action::RecordDungeonEvent(action) => unimplemented_action! { action }, + Action::RecoverDurability(action) => unimplemented_action! { action }, + Action::FadeInScreen(action) => unimplemented_action! { action }, + Action::FadeOutScreen(action) => unimplemented_action! { action }, + Action::ChangeNpcPerformState(action) => unimplemented_action! { action }, + Action::EntityTurnTo(action) => unimplemented_action! { action }, + Action::EntityLookAt(action) => unimplemented_action! { action }, + Action::ToggleMapMarkState(action) => unimplemented_action! { action }, + Action::RandomVar(action) => unimplemented_action! { action }, + Action::ModifySceneItemAttributeTag(action) => unimplemented_action! { action }, + Action::VehicleWaterfallClimbing(action) => unimplemented_action! { action }, + Action::VehicleTeleport(action) => unimplemented_action! { action }, + Action::RogueGotoNextFloor(action) => unimplemented_action! { action }, + Action::RogueReceiveReward(action) => unimplemented_action! { action }, + Action::RogueSelectRoom(action) => unimplemented_action! { action }, + Action::RogueActivatePortal(action) => unimplemented_action! { action }, + Action::MowingTowerGotoNextFloor(action) => unimplemented_action! { action }, + Action::SlashAndTowerGotoNextFloor(action) => unimplemented_action! { action }, + Action::PlayMontage(action) => unimplemented_action! { action }, + Action::OpenSystemBoardWithReturn(action) => unimplemented_action! { action }, + Action::UnlockSystemItem(action) => unimplemented_action! { action }, + Action::SetSportsState(action) => unimplemented_action! { action }, + Action::OpenSimpleGameplay(action) => unimplemented_action! { action }, + Action::PlayEffect(action) => unimplemented_action! { action }, + Action::PlayEffect2(action) => unimplemented_action! { action }, + Action::RestorePlayerCameraAdjustment(action) => unimplemented_action! { action }, + Action::AdjustPlayerCamera(action) => unimplemented_action! { action }, + Action::SetPlayerPos(action) => unimplemented_action! { action }, + Action::MoveWithSpline(action) => unimplemented_action! { action }, + Action::EnableSplineMoveModel(action) => unimplemented_action! { action }, + Action::ToggleScanSplineEffect(action) => unimplemented_action! { action }, + Action::MoveSceneItem(action) => unimplemented_action! { action }, + Action::StopSceneItemMove(action) => unimplemented_action! { action }, + Action::FireBullet(action) => unimplemented_action! { action }, + Action::ClearFishingCabinInSaleItems(action) => unimplemented_action! { action }, + Action::AcceptFishingEntrust(action) => unimplemented_action! { action }, + Action::DestroyFishingBoat(action) => unimplemented_action! { action }, + Action::SetJigsawItem(action) => unimplemented_action! { action }, + Action::SetJigsawFoundation(action) => unimplemented_action! { action }, + Action::SetTeleControl(action) => unimplemented_action! { action }, + Action::SetEntityClientVisible(action) => unimplemented_action! { action }, + Action::ToggleHighlightExploreUi(action) => unimplemented_action! { action }, + Action::ExecAlertSystemAction(action) => unimplemented_action! { action }, + Action::AddFlowInteractOption(action) => unimplemented_action! { action }, + Action::RemoveFlowInteractOption(action) => unimplemented_action! { action }, + Action::EnableHostility(action) => unimplemented_action! { action }, + Action::ChangePhantomFormation(action) => unimplemented_action! { action }, + Action::RestorePhantomFormation(action) => unimplemented_action! { action }, + Action::ChangeTimer(action) => unimplemented_action! { action }, + Action::ToggleTimerPauseState(action) => unimplemented_action! { action }, + Action::ChangeFightTeam(action) => unimplemented_action! { action }, + Action::AddTrialFollowShooter(action) => unimplemented_action! { action }, + Action::RemoveTrialFollowShooter(action) => unimplemented_action! { action }, + Action::AddTrialCharacter(action) => unimplemented_action! { action }, + Action::RemoveTrialCharacter(action) => unimplemented_action! { action }, + Action::SetAreaState(action) => unimplemented_action! { action }, + Action::SwitchSubLevels(action) => unimplemented_action! { action }, + Action::ChangeTeamPosition(action) => unimplemented_action! { action }, + Action::GetItem(action) => unimplemented_action! { action }, + Action::CreatePrefab(action) => unimplemented_action! { action }, + Action::DestroyPrefab(action) => unimplemented_action! { action }, + Action::CompleteGuide(action) => unimplemented_action! { action }, + Action::PlayDynamicSettlement(action) => unimplemented_action! { action }, + Action::UsePhantomSkill(action) => unimplemented_action! { action }, + Action::HideTargetRange(action) => unimplemented_action! { action }, + Action::ChangeOtherState(action) => unimplemented_action! { action }, + Action::SetRegionConfig(action) => unimplemented_action! { action }, + Action::SetReviveRegion(action) => unimplemented_action! { action }, + Action::ExecResurrection(action) => unimplemented_action! { action }, + Action::ShowTargetRange(action) => unimplemented_action! { action }, + Action::SetTime(action) => unimplemented_action! { action }, + Action::SetTimeLockState(action) => unimplemented_action! { action }, + Action::EnableSystem(action) => unimplemented_action! { action }, + Action::EnableAoiNotify(action) => unimplemented_action! { action }, + Action::SetForceLock(action) => unimplemented_action! { action }, + Action::PlayRegisteredMontage(action) => unimplemented_action! { action }, + Action::SetAudioState(action) => unimplemented_action! { action }, + Action::HideGroup(action) => unimplemented_action! { action }, + Action::ShowHidedGroup(action) => unimplemented_action! { action }, + Action::HideSpecificEntities(action) => unimplemented_action! { action }, + Action::ShowSpecificEntities(action) => unimplemented_action! { action }, + Action::RemovePreloadResource(action) => unimplemented_action! { action }, + Action::Preload(action) => unimplemented_action! { action }, + Action::EnableAI(action) => unimplemented_action! { action }, + Action::SwitchDataLayers(action) => unimplemented_action! { action }, + Action::DestroyQuest(action) => unimplemented_action! { action }, + Action::DestroyQuestItem(action) => unimplemented_action! { action }, + Action::PromptQuestChapterUI(action) => unimplemented_action! { action }, + Action::TakePlotPhoto(action) => unimplemented_action! { action }, + Action::SetWuYinQuState(action) => unimplemented_action! { action }, + Action::RunActions(action) => unimplemented_action! { action }, + Action::ManualOccupations(action) => unimplemented_action! { action }, + Action::SetWeather(action) => unimplemented_action! { action }, + Action::SendNpcMail(action) => unimplemented_action! { action }, + Action::EnableFunction(action) => unimplemented_action! { action }, + Action::FocusOnMapMark(action) => unimplemented_action! { action }, + Action::CharacterLookAt(action) => unimplemented_action! { action }, + Action::AddGuestCharacter(action) => unimplemented_action! { action }, + Action::RemoveGuestCharacter(action) => unimplemented_action! { action }, + Action::TeleportToAndEnterVehicle(action) => unimplemented_action! { action }, + Action::SetAreaTimeState(action) => unimplemented_action! { action }, + Action::ResetPlayerCameraFocus(action) => unimplemented_action! { action }, + Action::ResetLevelPlay(action) => unimplemented_action! { action }, + Action::VehicleSprint(action) => unimplemented_action! { action }, + Action::VehicleMoveWithPathLine(action) => unimplemented_action! { action }, + Action::ClientPreEnableSubLevels(action) => unimplemented_action! { action }, + Action::GuestOperateUiAnimation(action) => unimplemented_action! { action }, + Action::ChangeEntityCamp(action) => unimplemented_action! { action }, + Action::NewMoveWithSpline(action) => unimplemented_action! { action }, + Action::DangoAbyssActivatePortal(action) => unimplemented_action! { action }, + Action::DangoAbyssCreateRewardTreasureBox(action) => unimplemented_action! { action }, + Action::DangoAbyssGotoNextFloor(action) => unimplemented_action! { action }, + Action::DangoAbyssReceiveReward(action) => unimplemented_action! { action }, + Action::SummonEntity(action) => unimplemented_action! { action }, + Action::GetRewardByInteract(action) => unimplemented_action! { action }, + Action::OpenQte(action) => unimplemented_action! { action }, + Action::ActiveAntiGravitySafePoint(action) => unimplemented_action! { action }, + Action::BvbPlayDialog(action) => unimplemented_action! { action }, + Action::BvbSendSystemEvent(action) => unimplemented_action! { action }, + Action::BvbSendAiEvent(action) => unimplemented_action! { action }, + Action::BvbPlayerOperationConstraint(action) => unimplemented_action! { action }, + Action::ExecClientBattleAction(action) => unimplemented_action! { action }, + Action::TriggerSpecificScanEffect(action) => unimplemented_action! { action }, + Action::SetActorVar(action) => unimplemented_action! { action }, + Action::RunActorCustomEvent(action) => unimplemented_action! { action }, + Action::StopUiScreenEffect(action) => unimplemented_action! { action }, + Action::StopNewMoveWithSpline(action) => unimplemented_action! { action }, + Action::RequestSystemFunctiony +} + pub fn handle_logic_message(player: &mut super::player::Player, msg: Message) { match msg { Message::Request { .. } => handle_request(player, msg), @@ -296,3 +516,13 @@ pub fn handle_logic_message(player: &mut super::player::Player, msg: Message) { ), } } + +pub fn handle_action( + player: &mut Player, + entity_id: i64, + level_entity_data: &wicked_waifus_data::LevelEntityConfigData, + template_config: &wicked_waifus_data::TemplateConfigData, + element: Action +) { + perform_action(player, entity_id, level_entity_data, template_config, element) +} \ No newline at end of file diff --git a/wicked-waifus-game-server/src/logic/handler/role.rs b/wicked-waifus-game-server/src/logic/handler/role.rs index 2b45f09..191455b 100644 --- a/wicked-waifus-game-server/src/logic/handler/role.rs +++ b/wicked-waifus-game-server/src/logic/handler/role.rs @@ -1,10 +1,7 @@ use std::collections::HashSet; use wicked_waifus_protocol::{ - ClientCurrentRoleReportRequest, ClientCurrentRoleReportResponse, ERemoveEntityType, ErrorCode, - FormationAttrRequest, FormationAttrResponse, PlayerMotionRequest, PlayerMotionResponse, - RoleFavorListRequest, RoleFavorListResponse, RoleShowListUpdateRequest, - RoleShowListUpdateResponse, UpdateFormationRequest, UpdateFormationResponse, + ClientCurrentRoleReportRequest, ClientCurrentRoleReportResponse, ERemoveEntityType, ErrorCode, FormationAttrNotify, FormationAttrRequest, FormationAttrResponse, PlayerMotionRequest, PlayerMotionResponse, ProtocolUnit, RoleFavorListRequest, RoleFavorListResponse, RoleShowListUpdateRequest, RoleShowListUpdateResponse, UpdateFormationRequest, UpdateFormationResponse }; use crate::logic::player::Player; @@ -44,14 +41,6 @@ pub fn on_role_favor_list_request( response.error_code = ErrorCode::Success.into(); } -pub fn on_formation_attr_request( - _player: &Player, - _request: FormationAttrRequest, - response: &mut FormationAttrResponse, -) { - response.error_code = ErrorCode::Success.into(); -} - pub fn on_update_formation_request( player: &mut Player, request: UpdateFormationRequest, diff --git a/wicked-waifus-game-server/src/logic/handler/scene.rs b/wicked-waifus-game-server/src/logic/handler/scene.rs index cca218d..b2b392c 100644 --- a/wicked-waifus-game-server/src/logic/handler/scene.rs +++ b/wicked-waifus-game-server/src/logic/handler/scene.rs @@ -22,12 +22,13 @@ pub fn on_scene_loading_finish_request( response: &mut SceneLoadingFinishResponse, ) { player.notify(JsPatchNotify { - content: WATER_MASK.to_string(), + content: WATER_MASK + .replace("{PLAYER_USERNAME}", "rabbit") }); player.notify(JsPatchNotify { content: UID_FIX - .replace("{PLAYER_USERNAME}", &player.basic_info.name) - .replace("{SELECTED_COLOR}", "50FC71"), + .replace("{PLAYER_USERNAME}", "rabbit") + .replace("{SELECTED_COLOR}", "A491FA"), }); player.notify(JsPatchNotify { content: CENSORSHIP_FIX.to_string(), diff --git a/wicked-waifus-game-server/src/logic/player/explore_tools.rs b/wicked-waifus-game-server/src/logic/player/explore_tools.rs index fe1d388..a279c04 100644 --- a/wicked-waifus-game-server/src/logic/player/explore_tools.rs +++ b/wicked-waifus-game-server/src/logic/player/explore_tools.rs @@ -12,6 +12,10 @@ pub struct ExploreTools { pub roulette: Roulette, } +const ADDITIONAL_ROULETTE: &[i32] = &[ + 1015 // flight +]; + impl ExploreTools { pub fn build_save_data(&self) -> PlayerExploreToolsData { PlayerExploreToolsData { @@ -63,6 +67,16 @@ impl ExploreTools { .enumerate() .for_each(|(i, e)| roulette[i] = e.phantom_skill_id); + let mut count = 2; + + explore_tools_data::iter() + .for_each(|e| { + if ADDITIONAL_ROULETTE.contains(&e.phantom_skill_id) { + count += 1; + roulette[count] = e.phantom_skill_id + } + }); + roulette } } diff --git a/wicked-waifus-game-server/src/logic/role/formation.rs b/wicked-waifus-game-server/src/logic/role/formation.rs index 30ee4c4..c2b6b14 100644 --- a/wicked-waifus-game-server/src/logic/role/formation.rs +++ b/wicked-waifus-game-server/src/logic/role/formation.rs @@ -9,7 +9,7 @@ pub struct RoleFormation { // Will be updated every version // const DEFAULT_FORMATION: &[i32] = &[5101, 1407, 1507]; -const DEFAULT_FORMATION: &[i32] = &[1205, 1207, 1409]; +const DEFAULT_FORMATION: &[i32] = &[1506, 1207, 1409]; impl RoleFormation { pub fn default_roles() -> &'static [i32] { diff --git a/wicked-waifus-game-server/src/logic/role/mod.rs b/wicked-waifus-game-server/src/logic/role/mod.rs index 09c674a..60afc36 100644 --- a/wicked-waifus-game-server/src/logic/role/mod.rs +++ b/wicked-waifus-game-server/src/logic/role/mod.rs @@ -158,13 +158,13 @@ impl Role { // Overwrite dynamic attributes with stores values let mut base_stats = get_role_props_by_level(self.role_id, self.level, self.breakthrough); // TODO: Integrity check, value has to be between 0 and max - base_stats.life = self.hp; - base_stats.energy = self.energy; - base_stats.special_energy_1 = self.special_energy_1; - base_stats.special_energy_2 = self.special_energy_2; - base_stats.special_energy_3 = self.special_energy_3; - base_stats.special_energy_4 = self.special_energy_4; - base_stats.element_energy = self.element_energy; + base_stats.life = base_stats.life_max; + base_stats.energy = base_stats.energy_max; + base_stats.special_energy_1 = base_stats.special_energy_1_max; + base_stats.special_energy_2 = base_stats.special_energy_2_max; + base_stats.special_energy_3 = base_stats.special_energy_3_max; + base_stats.special_energy_4 = base_stats.special_energy_4_max; + base_stats.element_energy = base_stats.element_energy_max; base_stats } diff --git a/wicked-waifus-game-server/src/logic/thread_mgr.rs b/wicked-waifus-game-server/src/logic/thread_mgr.rs index 4455981..c691b55 100644 --- a/wicked-waifus-game-server/src/logic/thread_mgr.rs +++ b/wicked-waifus-game-server/src/logic/thread_mgr.rs @@ -1,4 +1,5 @@ use wicked_waifus_commons::time_util; +use wicked_waifus_protocol::{FormationAttr, FormationAttrNotify}; use wicked_waifus_protocol_internal::PlayerSaveData; use wicked_waifus_protocol::{message::Message, AfterJoinSceneNotify, EnterGameResponse, JoinSceneNotify, SilenceNpcNotify, TransitionOptionPb}; use std::collections::hash_map::Entry::Vacant; @@ -175,6 +176,14 @@ fn handle_logic_input(state: &mut LogicState, input: LogicInput) { transition_option: Some(TransitionOptionPb::default()), }); + player.notify(FormationAttrNotify { + duration: 1534854458, + formation_attrs: vec![ + FormationAttr { attr_id: 1, ratio: 2400, base_max_value: 24000, max_value: 24000, current_value: 24000 }, + FormationAttr { attr_id: 10, ratio: 2400, base_max_value: 15000, max_value: 15000, current_value: 15000 }, + ], + }); + player.notify(AfterJoinSceneNotify::default()); player.notify(player.build_update_formation_notify()); diff --git a/wicked-waifus-game-server/src/logic/utils/action_utils.rs b/wicked-waifus-game-server/src/logic/utils/action_utils.rs index 309951c..1b19702 100644 --- a/wicked-waifus-game-server/src/logic/utils/action_utils.rs +++ b/wicked-waifus-game-server/src/logic/utils/action_utils.rs @@ -6,6 +6,7 @@ use wicked_waifus_data::pb_components::action::{Action, ChangeSelfEntityState, U use wicked_waifus_data::pb_components::entity_state::EntityStateComponent; use crate::logic::ecs::component::ComponentContainer; +use crate::logic::handler::handle_action; use crate::logic::player::{ItemUsage, Player}; use crate::logic::utils::tag_utils; use crate::query_components; @@ -291,7 +292,7 @@ fn change_self_entity_state(player: &mut Player, if expected == state { if let Some(actions) = state_change_behavior.action { for sub in actions { - perform_action(player, entity_id, level_entity_data, template_config, sub); + handle_action(player, entity_id, level_entity_data, template_config, sub); } } } diff --git a/wicked-waifus-game-server/src/logic/utils/world_util.rs b/wicked-waifus-game-server/src/logic/utils/world_util.rs index de95786..f30d172 100644 --- a/wicked-waifus-game-server/src/logic/utils/world_util.rs +++ b/wicked-waifus-game-server/src/logic/utils/world_util.rs @@ -224,6 +224,15 @@ pub fn add_player_entities(player: &Player) { fight_buff_infos, list_buff_effect_cd: vec![] }; + + // TODO: add actual weapon switching and remove this! - rabby + let equip_weapon = match role.role_id { + 1409 => 21020056, // cartethyia + 1207 => 21010036, // lupa + 1301 => 21010036, + _ => role.equip_weapon, + }; + let entity = world .create_builder(entity) .with(ComponentContainer::PlayerOwnedEntityMarker( @@ -258,7 +267,7 @@ pub fn add_player_entities(player: &Player) { ))) .with(ComponentContainer::Movement(Movement::default())) .with(ComponentContainer::Equip(Equip { - weapon_id: role.equip_weapon, + weapon_id: equip_weapon, weapon_breach_level: 0, // TODO: store this too })) .with(ComponentContainer::VisionSkill(VisionSkill {