diff --git a/CounterAttack_Solo/Asset/Blueprint/PlaceItems/BP_ClientPreviewItemBase.uasset b/CounterAttack_Solo/Asset/Blueprint/PlaceItems/BP_ClientPreviewItemBase.uasset new file mode 100644 index 00000000..b90f3abe Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/PlaceItems/BP_ClientPreviewItemBase.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/PlaceItems/BP_PlaceItemBase.uasset b/CounterAttack_Solo/Asset/Blueprint/PlaceItems/BP_PlaceItemBase.uasset new file mode 100644 index 00000000..59384101 Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/PlaceItems/BP_PlaceItemBase.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/PlaceItems/BP_PlaceModeManager.uasset b/CounterAttack_Solo/Asset/Blueprint/PlaceItems/BP_PlaceModeManager.uasset new file mode 100644 index 00000000..a5be9f55 Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/PlaceItems/BP_PlaceModeManager.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/PlaceItems/EPlaceItemType.uasset b/CounterAttack_Solo/Asset/Blueprint/PlaceItems/EPlaceItemType.uasset new file mode 100644 index 00000000..d78c3e9d Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/PlaceItems/EPlaceItemType.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/Airblower/BP_Airblower.uasset b/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/Airblower/BP_Airblower.uasset new file mode 100644 index 00000000..93dbcfe0 Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/Airblower/BP_Airblower.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/Airblower/BP_Preview_Airblower.uasset b/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/Airblower/BP_Preview_Airblower.uasset new file mode 100644 index 00000000..d55365f1 Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/Airblower/BP_Preview_Airblower.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/BigBanker/BP_BigBunker.uasset b/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/BigBanker/BP_BigBunker.uasset new file mode 100644 index 00000000..acf09542 Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/BigBanker/BP_BigBunker.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/BigBanker/BP_Preview_BigBunker.uasset b/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/BigBanker/BP_Preview_BigBunker.uasset new file mode 100644 index 00000000..d81eca35 Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/BigBanker/BP_Preview_BigBunker.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/Flamethrower/BP_Flamethrower.uasset b/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/Flamethrower/BP_Flamethrower.uasset new file mode 100644 index 00000000..97b99de5 Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/Flamethrower/BP_Flamethrower.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/Flamethrower/BP_Preview_Flamethrower.uasset b/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/Flamethrower/BP_Preview_Flamethrower.uasset new file mode 100644 index 00000000..2c3d9a6e Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/Flamethrower/BP_Preview_Flamethrower.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/LandMine/BP_LandMine.uasset b/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/LandMine/BP_LandMine.uasset new file mode 100644 index 00000000..5f2b2179 Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/LandMine/BP_LandMine.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/LandMine/BP_Preview_LandMine.uasset b/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/LandMine/BP_Preview_LandMine.uasset new file mode 100644 index 00000000..829c239a Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/LandMine/BP_Preview_LandMine.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/Launch/BP_Launch.uasset b/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/Launch/BP_Launch.uasset new file mode 100644 index 00000000..acc88792 Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/Launch/BP_Launch.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/Launch/BP_Preview_Launch.uasset b/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/Launch/BP_Preview_Launch.uasset new file mode 100644 index 00000000..c259498c Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/Launch/BP_Preview_Launch.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/Slope/BP_Preview_Slope.uasset b/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/Slope/BP_Preview_Slope.uasset new file mode 100644 index 00000000..9c75a1fa Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/Slope/BP_Preview_Slope.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/Slope/BP_Slope.uasset b/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/Slope/BP_Slope.uasset new file mode 100644 index 00000000..2095f96a Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/Slope/BP_Slope.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/SmallBunker/BP_Preview_SmallBunker.uasset b/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/SmallBunker/BP_Preview_SmallBunker.uasset new file mode 100644 index 00000000..a51a6f0b Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/SmallBunker/BP_Preview_SmallBunker.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/SmallBunker/BP_SmallBunker.uasset b/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/SmallBunker/BP_SmallBunker.uasset new file mode 100644 index 00000000..8547f682 Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/PlaceItems/Items/SmallBunker/BP_SmallBunker.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/PlaceItems/WB_PlacePonitTo.uasset b/CounterAttack_Solo/Asset/Blueprint/PlaceItems/WB_PlacePonitTo.uasset new file mode 100644 index 00000000..24069549 Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/PlaceItems/WB_PlacePonitTo.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/PlayerStart/BP_CustomPlayerStart.uasset b/CounterAttack_Solo/Asset/Blueprint/PlayerStart/BP_CustomPlayerStart.uasset new file mode 100644 index 00000000..67ca1480 Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/PlayerStart/BP_CustomPlayerStart.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/PlayerStart/BP_HDPlayerStart.uasset b/CounterAttack_Solo/Asset/Blueprint/PlayerStart/BP_HDPlayerStart.uasset new file mode 100644 index 00000000..56c62a4f Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/PlayerStart/BP_HDPlayerStart.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/PlayerStart/EPlayerStartType.uasset b/CounterAttack_Solo/Asset/Blueprint/PlayerStart/EPlayerStartType.uasset new file mode 100644 index 00000000..593c3987 Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/PlayerStart/EPlayerStartType.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/Post/HD_PostProcessMgr.uasset b/CounterAttack_Solo/Asset/Blueprint/Post/HD_PostProcessMgr.uasset new file mode 100644 index 00000000..d7139200 Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/Post/HD_PostProcessMgr.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/Prefabs/Items/TestItem.uasset b/CounterAttack_Solo/Asset/Blueprint/Prefabs/Items/TestItem.uasset new file mode 100644 index 00000000..ecc8d260 Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/Prefabs/Items/TestItem.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/SceneActor/BP_KillBox.uasset b/CounterAttack_Solo/Asset/Blueprint/SceneActor/BP_KillBox.uasset new file mode 100644 index 00000000..2bc61dbf Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/SceneActor/BP_KillBox.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/SceneActor/BP_Launch.uasset b/CounterAttack_Solo/Asset/Blueprint/SceneActor/BP_Launch.uasset new file mode 100644 index 00000000..8ad6dc99 Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/SceneActor/BP_Launch.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/SceneActor/BP_PlayerDeadParticle.uasset b/CounterAttack_Solo/Asset/Blueprint/SceneActor/BP_PlayerDeadParticle.uasset new file mode 100644 index 00000000..2b415771 Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/SceneActor/BP_PlayerDeadParticle.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/SceneActor/BP_ResetHeight.uasset b/CounterAttack_Solo/Asset/Blueprint/SceneActor/BP_ResetHeight.uasset new file mode 100644 index 00000000..f49287db Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/SceneActor/BP_ResetHeight.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/SceneActor/BP_SpawnPickupWrapper.uasset b/CounterAttack_Solo/Asset/Blueprint/SceneActor/BP_SpawnPickupWrapper.uasset new file mode 100644 index 00000000..7af50e51 Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/SceneActor/BP_SpawnPickupWrapper.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/SceneActor/BP_TrackKillerCamera.uasset b/CounterAttack_Solo/Asset/Blueprint/SceneActor/BP_TrackKillerCamera.uasset new file mode 100644 index 00000000..9bc9a2c8 Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/SceneActor/BP_TrackKillerCamera.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/SceneActor/BP_VehicleSpawnPoint.uasset b/CounterAttack_Solo/Asset/Blueprint/SceneActor/BP_VehicleSpawnPoint.uasset new file mode 100644 index 00000000..260cb640 Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/SceneActor/BP_VehicleSpawnPoint.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/SceneActor/Capture/BP_CaptureCamera.uasset b/CounterAttack_Solo/Asset/Blueprint/SceneActor/Capture/BP_CaptureCamera.uasset new file mode 100644 index 00000000..235b8c0a Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/SceneActor/Capture/BP_CaptureCamera.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/SceneActor/Capture/MAT_Capture.uasset b/CounterAttack_Solo/Asset/Blueprint/SceneActor/Capture/MAT_Capture.uasset new file mode 100644 index 00000000..6061f0eb Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/SceneActor/Capture/MAT_Capture.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/SceneActor/Capture/RT_Capture.uasset b/CounterAttack_Solo/Asset/Blueprint/SceneActor/Capture/RT_Capture.uasset new file mode 100644 index 00000000..7d1209f0 Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/SceneActor/Capture/RT_Capture.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/SceneActor/PlaceMode/BP_LineOfDefense.uasset b/CounterAttack_Solo/Asset/Blueprint/SceneActor/PlaceMode/BP_LineOfDefense.uasset new file mode 100644 index 00000000..773a6a10 Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/SceneActor/PlaceMode/BP_LineOfDefense.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/SceneActor/PlaceMode/BP_PassagewayBlock.uasset b/CounterAttack_Solo/Asset/Blueprint/SceneActor/PlaceMode/BP_PassagewayBlock.uasset new file mode 100644 index 00000000..a0cdb047 Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/SceneActor/PlaceMode/BP_PassagewayBlock.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/SceneActor/PlaceMode/BP_PlaceableArea.uasset b/CounterAttack_Solo/Asset/Blueprint/SceneActor/PlaceMode/BP_PlaceableArea.uasset new file mode 100644 index 00000000..f99c0b96 Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/SceneActor/PlaceMode/BP_PlaceableArea.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/SceneActor/PlaceMode/WB_TipLineOfDefense.uasset b/CounterAttack_Solo/Asset/Blueprint/SceneActor/PlaceMode/WB_TipLineOfDefense.uasset new file mode 100644 index 00000000..953a760e Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/SceneActor/PlaceMode/WB_TipLineOfDefense.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/SceneActor/PlaceMode/WB_TipPassageway.uasset b/CounterAttack_Solo/Asset/Blueprint/SceneActor/PlaceMode/WB_TipPassageway.uasset new file mode 100644 index 00000000..49c6244e Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/SceneActor/PlaceMode/WB_TipPassageway.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/SceneActor/SelectMap/BP_PlayerSelectMapOverlap.uasset b/CounterAttack_Solo/Asset/Blueprint/SceneActor/SelectMap/BP_PlayerSelectMapOverlap.uasset new file mode 100644 index 00000000..83b3dc74 Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/SceneActor/SelectMap/BP_PlayerSelectMapOverlap.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/SceneActor/SelectMap/WB_MechanismInfo_Select.uasset b/CounterAttack_Solo/Asset/Blueprint/SceneActor/SelectMap/WB_MechanismInfo_Select.uasset new file mode 100644 index 00000000..07d8166a Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/SceneActor/SelectMap/WB_MechanismInfo_Select.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/SceneActor/SelectMap/WB_ShowMapBG.uasset b/CounterAttack_Solo/Asset/Blueprint/SceneActor/SelectMap/WB_ShowMapBG.uasset new file mode 100644 index 00000000..ab60f87a Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/SceneActor/SelectMap/WB_ShowMapBG.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/SceneActor/SelectMap/WB_ShowMapInfo.uasset b/CounterAttack_Solo/Asset/Blueprint/SceneActor/SelectMap/WB_ShowMapInfo.uasset new file mode 100644 index 00000000..c04000e6 Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/SceneActor/SelectMap/WB_ShowMapInfo.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/SceneActor/SelectMap/WB_ShowMapName.uasset b/CounterAttack_Solo/Asset/Blueprint/SceneActor/SelectMap/WB_ShowMapName.uasset new file mode 100644 index 00000000..226f29c2 Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/SceneActor/SelectMap/WB_ShowMapName.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/SceneActor/SelectMap/WB_ShowMiniMap.uasset b/CounterAttack_Solo/Asset/Blueprint/SceneActor/SelectMap/WB_ShowMiniMap.uasset new file mode 100644 index 00000000..44452065 Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/SceneActor/SelectMap/WB_ShowMiniMap.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/SceneActor/Team/BP_TeamCTTip.uasset b/CounterAttack_Solo/Asset/Blueprint/SceneActor/Team/BP_TeamCTTip.uasset new file mode 100644 index 00000000..77714122 Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/SceneActor/Team/BP_TeamCTTip.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/SceneActor/Team/BP_TeamTTip.uasset b/CounterAttack_Solo/Asset/Blueprint/SceneActor/Team/BP_TeamTTip.uasset new file mode 100644 index 00000000..fab475a9 Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/SceneActor/Team/BP_TeamTTip.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/SceneActor/Team/WB_CTTip.uasset b/CounterAttack_Solo/Asset/Blueprint/SceneActor/Team/WB_CTTip.uasset new file mode 100644 index 00000000..9ca47331 Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/SceneActor/Team/WB_CTTip.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/SceneActor/Team/WB_TTip.uasset b/CounterAttack_Solo/Asset/Blueprint/SceneActor/Team/WB_TTip.uasset new file mode 100644 index 00000000..66a2751c Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/SceneActor/Team/WB_TTip.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/Skill/DetectActor/BPC_DetectPlayerNew.uasset b/CounterAttack_Solo/Asset/Blueprint/Skill/DetectActor/BPC_DetectPlayerNew.uasset new file mode 100644 index 00000000..ae637947 Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/Skill/DetectActor/BPC_DetectPlayerNew.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/Skill/DetectActor/BP_DetectPlayerNew.uasset b/CounterAttack_Solo/Asset/Blueprint/Skill/DetectActor/BP_DetectPlayerNew.uasset new file mode 100644 index 00000000..3c276472 Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/Skill/DetectActor/BP_DetectPlayerNew.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/Skill/Skill_DetectPlayer.uasset b/CounterAttack_Solo/Asset/Blueprint/Skill/Skill_DetectPlayer.uasset new file mode 100644 index 00000000..c6bb5fb8 Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/Skill/Skill_DetectPlayer.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/Skill/Skill_Fly.uasset b/CounterAttack_Solo/Asset/Blueprint/Skill/Skill_Fly.uasset new file mode 100644 index 00000000..b91568ae Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/Skill/Skill_Fly.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/Skill/Skill_My_MultiJump.uasset b/CounterAttack_Solo/Asset/Blueprint/Skill/Skill_My_MultiJump.uasset new file mode 100644 index 00000000..661ac738 Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/Skill/Skill_My_MultiJump.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/UGCGameMode.uasset b/CounterAttack_Solo/Asset/Blueprint/UGCGameMode.uasset new file mode 100644 index 00000000..a034e88f Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/UGCGameMode.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/UGCGameState.uasset b/CounterAttack_Solo/Asset/Blueprint/UGCGameState.uasset new file mode 100644 index 00000000..abbde8bf Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/UGCGameState.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/UGCLevelDirector.uasset b/CounterAttack_Solo/Asset/Blueprint/UGCLevelDirector.uasset new file mode 100644 index 00000000..471ed3a6 Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/UGCLevelDirector.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/UGCPlayerController.uasset b/CounterAttack_Solo/Asset/Blueprint/UGCPlayerController.uasset new file mode 100644 index 00000000..7cd40eec Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/UGCPlayerController.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/UGCPlayerPawn.uasset b/CounterAttack_Solo/Asset/Blueprint/UGCPlayerPawn.uasset new file mode 100644 index 00000000..34ee3b48 Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/UGCPlayerPawn.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/UGCPlayerStartManager.uasset b/CounterAttack_Solo/Asset/Blueprint/UGCPlayerStartManager.uasset new file mode 100644 index 00000000..f9619cda Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/UGCPlayerStartManager.uasset differ diff --git a/CounterAttack_Solo/Asset/Blueprint/UGCPlayerState.uasset b/CounterAttack_Solo/Asset/Blueprint/UGCPlayerState.uasset new file mode 100644 index 00000000..e60d8c65 Binary files /dev/null and b/CounterAttack_Solo/Asset/Blueprint/UGCPlayerState.uasset differ diff --git a/CounterAttack_Solo/Asset/Data/Table/UGCBattleItem.uasset b/CounterAttack_Solo/Asset/Data/Table/UGCBattleItem.uasset new file mode 100644 index 00000000..645fb1e6 Binary files /dev/null and b/CounterAttack_Solo/Asset/Data/Table/UGCBattleItem.uasset differ diff --git a/CounterAttack_Solo/Asset/FX/BuffFx/P_AddBuff2.uasset b/CounterAttack_Solo/Asset/FX/BuffFx/P_AddBuff2.uasset new file mode 100644 index 00000000..0febef7c Binary files /dev/null and b/CounterAttack_Solo/Asset/FX/BuffFx/P_AddBuff2.uasset differ diff --git a/CounterAttack_Solo/Asset/FX/BuffFx/P_AddBuffBase.uasset b/CounterAttack_Solo/Asset/FX/BuffFx/P_AddBuffBase.uasset new file mode 100644 index 00000000..4b98e2f4 Binary files /dev/null and b/CounterAttack_Solo/Asset/FX/BuffFx/P_AddBuffBase.uasset differ diff --git a/CounterAttack_Solo/Asset/FX/BuffFx/P_Explosion.uasset b/CounterAttack_Solo/Asset/FX/BuffFx/P_Explosion.uasset new file mode 100644 index 00000000..0309f920 Binary files /dev/null and b/CounterAttack_Solo/Asset/FX/BuffFx/P_Explosion.uasset differ diff --git a/CounterAttack_Solo/Asset/FX/GodOfWar/P_DuYaoDamage.uasset b/CounterAttack_Solo/Asset/FX/GodOfWar/P_DuYaoDamage.uasset new file mode 100644 index 00000000..0e240044 Binary files /dev/null and b/CounterAttack_Solo/Asset/FX/GodOfWar/P_DuYaoDamage.uasset differ diff --git a/CounterAttack_Solo/Asset/FX/GodOfWar/P_GodOfWar.uasset b/CounterAttack_Solo/Asset/FX/GodOfWar/P_GodOfWar.uasset new file mode 100644 index 00000000..0e1e736f Binary files /dev/null and b/CounterAttack_Solo/Asset/FX/GodOfWar/P_GodOfWar.uasset differ diff --git a/CounterAttack_Solo/Asset/FX/GodOfWar/P_GodOfWar_2.uasset b/CounterAttack_Solo/Asset/FX/GodOfWar/P_GodOfWar_2.uasset new file mode 100644 index 00000000..8bb368eb Binary files /dev/null and b/CounterAttack_Solo/Asset/FX/GodOfWar/P_GodOfWar_2.uasset differ diff --git a/CounterAttack_Solo/Asset/FX/GodOfWar/P_GodOfWar_Self.uasset b/CounterAttack_Solo/Asset/FX/GodOfWar/P_GodOfWar_Self.uasset new file mode 100644 index 00000000..72af754e Binary files /dev/null and b/CounterAttack_Solo/Asset/FX/GodOfWar/P_GodOfWar_Self.uasset differ diff --git a/CounterAttack_Solo/Asset/FX/GodOfWar/P_Ice.uasset b/CounterAttack_Solo/Asset/FX/GodOfWar/P_Ice.uasset new file mode 100644 index 00000000..55b4fe90 Binary files /dev/null and b/CounterAttack_Solo/Asset/FX/GodOfWar/P_Ice.uasset differ diff --git a/CounterAttack_Solo/Asset/FX/GodOfWar/P_M79_explode_02.uasset b/CounterAttack_Solo/Asset/FX/GodOfWar/P_M79_explode_02.uasset new file mode 100644 index 00000000..3e1e7f5f Binary files /dev/null and b/CounterAttack_Solo/Asset/FX/GodOfWar/P_M79_explode_02.uasset differ diff --git a/CounterAttack_Solo/Asset/FX/GodOfWar/P_Team_Season.uasset b/CounterAttack_Solo/Asset/FX/GodOfWar/P_Team_Season.uasset new file mode 100644 index 00000000..684b5039 Binary files /dev/null and b/CounterAttack_Solo/Asset/FX/GodOfWar/P_Team_Season.uasset differ diff --git a/CounterAttack_Solo/Asset/FX/GodOfWar/P_Tips_02_2.uasset b/CounterAttack_Solo/Asset/FX/GodOfWar/P_Tips_02_2.uasset new file mode 100644 index 00000000..e8bda31a Binary files /dev/null and b/CounterAttack_Solo/Asset/FX/GodOfWar/P_Tips_02_2.uasset differ diff --git a/CounterAttack_Solo/Asset/FX/Mechanisms/P_Boot.uasset b/CounterAttack_Solo/Asset/FX/Mechanisms/P_Boot.uasset new file mode 100644 index 00000000..3d8b565e Binary files /dev/null and b/CounterAttack_Solo/Asset/FX/Mechanisms/P_Boot.uasset differ diff --git a/CounterAttack_Solo/Asset/FX/Mechanisms/P_BootDisable.uasset b/CounterAttack_Solo/Asset/FX/Mechanisms/P_BootDisable.uasset new file mode 100644 index 00000000..28e08cd8 Binary files /dev/null and b/CounterAttack_Solo/Asset/FX/Mechanisms/P_BootDisable.uasset differ diff --git a/CounterAttack_Solo/Asset/FX/Mechanisms/P_Contact.uasset b/CounterAttack_Solo/Asset/FX/Mechanisms/P_Contact.uasset new file mode 100644 index 00000000..b4ae9abb Binary files /dev/null and b/CounterAttack_Solo/Asset/FX/Mechanisms/P_Contact.uasset differ diff --git a/CounterAttack_Solo/Asset/FX/Mechanisms/P_Contact2.uasset b/CounterAttack_Solo/Asset/FX/Mechanisms/P_Contact2.uasset new file mode 100644 index 00000000..6eeadc49 Binary files /dev/null and b/CounterAttack_Solo/Asset/FX/Mechanisms/P_Contact2.uasset differ diff --git a/CounterAttack_Solo/Asset/FX/Mechanisms/P_DMM_Detect_01.uasset b/CounterAttack_Solo/Asset/FX/Mechanisms/P_DMM_Detect_01.uasset new file mode 100644 index 00000000..ef715d90 Binary files /dev/null and b/CounterAttack_Solo/Asset/FX/Mechanisms/P_DMM_Detect_01.uasset differ diff --git a/CounterAttack_Solo/Asset/FX/Mechanisms/P_Dead_Smoke_Box15.uasset b/CounterAttack_Solo/Asset/FX/Mechanisms/P_Dead_Smoke_Box15.uasset new file mode 100644 index 00000000..1488760b Binary files /dev/null and b/CounterAttack_Solo/Asset/FX/Mechanisms/P_Dead_Smoke_Box15.uasset differ diff --git a/CounterAttack_Solo/Asset/FX/Mechanisms/P_Dead_Smoke_Dragon.uasset b/CounterAttack_Solo/Asset/FX/Mechanisms/P_Dead_Smoke_Dragon.uasset new file mode 100644 index 00000000..fb125989 Binary files /dev/null and b/CounterAttack_Solo/Asset/FX/Mechanisms/P_Dead_Smoke_Dragon.uasset differ diff --git a/CounterAttack_Solo/Asset/FX/Mechanisms/P_Dead_Smoke_Dragon_2.uasset b/CounterAttack_Solo/Asset/FX/Mechanisms/P_Dead_Smoke_Dragon_2.uasset new file mode 100644 index 00000000..6250998f Binary files /dev/null and b/CounterAttack_Solo/Asset/FX/Mechanisms/P_Dead_Smoke_Dragon_2.uasset differ diff --git a/CounterAttack_Solo/Asset/FX/Mechanisms/P_Dead_Smoke_Space.uasset b/CounterAttack_Solo/Asset/FX/Mechanisms/P_Dead_Smoke_Space.uasset new file mode 100644 index 00000000..e08517f5 Binary files /dev/null and b/CounterAttack_Solo/Asset/FX/Mechanisms/P_Dead_Smoke_Space.uasset differ diff --git a/CounterAttack_Solo/Asset/FX/Mechanisms/P_Earthquake.uasset b/CounterAttack_Solo/Asset/FX/Mechanisms/P_Earthquake.uasset new file mode 100644 index 00000000..1655d0e5 Binary files /dev/null and b/CounterAttack_Solo/Asset/FX/Mechanisms/P_Earthquake.uasset differ diff --git a/CounterAttack_Solo/Asset/FX/Mechanisms/P_Earthquake2.uasset b/CounterAttack_Solo/Asset/FX/Mechanisms/P_Earthquake2.uasset new file mode 100644 index 00000000..9b121826 Binary files /dev/null and b/CounterAttack_Solo/Asset/FX/Mechanisms/P_Earthquake2.uasset differ diff --git a/CounterAttack_Solo/Asset/FX/Mechanisms/P_EarthquakeDefault.uasset b/CounterAttack_Solo/Asset/FX/Mechanisms/P_EarthquakeDefault.uasset new file mode 100644 index 00000000..525f646c Binary files /dev/null and b/CounterAttack_Solo/Asset/FX/Mechanisms/P_EarthquakeDefault.uasset differ diff --git a/CounterAttack_Solo/Asset/FX/Mechanisms/P_Fire.uasset b/CounterAttack_Solo/Asset/FX/Mechanisms/P_Fire.uasset new file mode 100644 index 00000000..2715f4f7 Binary files /dev/null and b/CounterAttack_Solo/Asset/FX/Mechanisms/P_Fire.uasset differ diff --git a/CounterAttack_Solo/Asset/FX/Mechanisms/P_Mark.uasset b/CounterAttack_Solo/Asset/FX/Mechanisms/P_Mark.uasset new file mode 100644 index 00000000..2d2facd7 Binary files /dev/null and b/CounterAttack_Solo/Asset/FX/Mechanisms/P_Mark.uasset differ diff --git a/CounterAttack_Solo/Asset/FX/Mechanisms/P_MechanismSmoke.uasset b/CounterAttack_Solo/Asset/FX/Mechanisms/P_MechanismSmoke.uasset new file mode 100644 index 00000000..dd1abba7 Binary files /dev/null and b/CounterAttack_Solo/Asset/FX/Mechanisms/P_MechanismSmoke.uasset differ diff --git a/CounterAttack_Solo/Asset/FX/Mechanisms/P_RecoveryPool.uasset b/CounterAttack_Solo/Asset/FX/Mechanisms/P_RecoveryPool.uasset new file mode 100644 index 00000000..8b714ee5 Binary files /dev/null and b/CounterAttack_Solo/Asset/FX/Mechanisms/P_RecoveryPool.uasset differ diff --git a/CounterAttack_Solo/Asset/FX/Mechanisms/P_ShowRadius.uasset b/CounterAttack_Solo/Asset/FX/Mechanisms/P_ShowRadius.uasset new file mode 100644 index 00000000..dde172b3 Binary files /dev/null and b/CounterAttack_Solo/Asset/FX/Mechanisms/P_ShowRadius.uasset differ diff --git a/CounterAttack_Solo/Asset/FX/Mechanisms/P_TrackPlayer.uasset b/CounterAttack_Solo/Asset/FX/Mechanisms/P_TrackPlayer.uasset new file mode 100644 index 00000000..673c4130 Binary files /dev/null and b/CounterAttack_Solo/Asset/FX/Mechanisms/P_TrackPlayer.uasset differ diff --git a/CounterAttack_Solo/Asset/FX/Mechanisms/P_TriggerDevicce.uasset b/CounterAttack_Solo/Asset/FX/Mechanisms/P_TriggerDevicce.uasset new file mode 100644 index 00000000..9b4ee8b4 Binary files /dev/null and b/CounterAttack_Solo/Asset/FX/Mechanisms/P_TriggerDevicce.uasset differ diff --git a/CounterAttack_Solo/Asset/FX/Mechanisms/P_TriggerDevicce_2.uasset b/CounterAttack_Solo/Asset/FX/Mechanisms/P_TriggerDevicce_2.uasset new file mode 100644 index 00000000..fbada21d Binary files /dev/null and b/CounterAttack_Solo/Asset/FX/Mechanisms/P_TriggerDevicce_2.uasset differ diff --git a/CounterAttack_Solo/Asset/FX/P_AddDamage.uasset b/CounterAttack_Solo/Asset/FX/P_AddDamage.uasset new file mode 100644 index 00000000..c2a6af65 Binary files /dev/null and b/CounterAttack_Solo/Asset/FX/P_AddDamage.uasset differ diff --git a/CounterAttack_Solo/Asset/FX/PlaceItem/P_LineOfDefense.uasset b/CounterAttack_Solo/Asset/FX/PlaceItem/P_LineOfDefense.uasset new file mode 100644 index 00000000..89b9dc5e Binary files /dev/null and b/CounterAttack_Solo/Asset/FX/PlaceItem/P_LineOfDefense.uasset differ diff --git a/CounterAttack_Solo/Asset/FX/PlaceItem/P_bounce_01.uasset b/CounterAttack_Solo/Asset/FX/PlaceItem/P_bounce_01.uasset new file mode 100644 index 00000000..083af008 Binary files /dev/null and b/CounterAttack_Solo/Asset/FX/PlaceItem/P_bounce_01.uasset differ diff --git a/CounterAttack_Solo/Asset/FX/PlaceItem/P_bounce_Loop.uasset b/CounterAttack_Solo/Asset/FX/PlaceItem/P_bounce_Loop.uasset new file mode 100644 index 00000000..914d1d6d Binary files /dev/null and b/CounterAttack_Solo/Asset/FX/PlaceItem/P_bounce_Loop.uasset differ diff --git a/CounterAttack_Solo/Asset/FX/SelectMapOverlap/P_SelectOverlap.uasset b/CounterAttack_Solo/Asset/FX/SelectMapOverlap/P_SelectOverlap.uasset new file mode 100644 index 00000000..cf9c890e Binary files /dev/null and b/CounterAttack_Solo/Asset/FX/SelectMapOverlap/P_SelectOverlap.uasset differ diff --git a/CounterAttack_Solo/Asset/Level/HD_PS.umap b/CounterAttack_Solo/Asset/Level/HD_PS.umap new file mode 100644 index 00000000..8e24f9d0 Binary files /dev/null and b/CounterAttack_Solo/Asset/Level/HD_PS.umap differ diff --git a/CounterAttack_Solo/Asset/Level/MiniMap/MiniMap_GG.uasset b/CounterAttack_Solo/Asset/Level/MiniMap/MiniMap_GG.uasset new file mode 100644 index 00000000..fa03edc4 Binary files /dev/null and b/CounterAttack_Solo/Asset/Level/MiniMap/MiniMap_GG.uasset differ diff --git a/CounterAttack_Solo/Asset/Level/MiniMap/MiniMap_GTC.uasset b/CounterAttack_Solo/Asset/Level/MiniMap/MiniMap_GTC.uasset new file mode 100644 index 00000000..979c53f6 Binary files /dev/null and b/CounterAttack_Solo/Asset/Level/MiniMap/MiniMap_GTC.uasset differ diff --git a/CounterAttack_Solo/Asset/Level/MiniMap/MiniMap_JSJD.uasset b/CounterAttack_Solo/Asset/Level/MiniMap/MiniMap_JSJD.uasset new file mode 100644 index 00000000..381aea6c Binary files /dev/null and b/CounterAttack_Solo/Asset/Level/MiniMap/MiniMap_JSJD.uasset differ diff --git a/CounterAttack_Solo/Asset/Level/MiniMap/MiniMap_JY.uasset b/CounterAttack_Solo/Asset/Level/MiniMap/MiniMap_JY.uasset new file mode 100644 index 00000000..360ceaf9 Binary files /dev/null and b/CounterAttack_Solo/Asset/Level/MiniMap/MiniMap_JY.uasset differ diff --git a/CounterAttack_Solo/Asset/Level/MiniMap/MiniMap_SCMP.uasset b/CounterAttack_Solo/Asset/Level/MiniMap/MiniMap_SCMP.uasset new file mode 100644 index 00000000..0eaecc7f Binary files /dev/null and b/CounterAttack_Solo/Asset/Level/MiniMap/MiniMap_SCMP.uasset differ diff --git a/CounterAttack_Solo/Asset/Material/FXMaterial/Buff/MAT_AddSpeed.uasset b/CounterAttack_Solo/Asset/Material/FXMaterial/Buff/MAT_AddSpeed.uasset new file mode 100644 index 00000000..4ba95381 Binary files /dev/null and b/CounterAttack_Solo/Asset/Material/FXMaterial/Buff/MAT_AddSpeed.uasset differ diff --git a/CounterAttack_Solo/Asset/Material/FXMaterial/FXMaterialPic/MAT_AddLife.uasset b/CounterAttack_Solo/Asset/Material/FXMaterial/FXMaterialPic/MAT_AddLife.uasset new file mode 100644 index 00000000..449ad3fd Binary files /dev/null and b/CounterAttack_Solo/Asset/Material/FXMaterial/FXMaterialPic/MAT_AddLife.uasset differ diff --git a/CounterAttack_Solo/Asset/Material/FXMaterial/FXMaterialPic/MAT_Round.uasset b/CounterAttack_Solo/Asset/Material/FXMaterial/FXMaterialPic/MAT_Round.uasset new file mode 100644 index 00000000..013dc05d Binary files /dev/null and b/CounterAttack_Solo/Asset/Material/FXMaterial/FXMaterialPic/MAT_Round.uasset differ diff --git a/CounterAttack_Solo/Asset/Material/FXMaterial/FXMaterialPic/MAT_TeamCT.uasset b/CounterAttack_Solo/Asset/Material/FXMaterial/FXMaterialPic/MAT_TeamCT.uasset new file mode 100644 index 00000000..51063a06 Binary files /dev/null and b/CounterAttack_Solo/Asset/Material/FXMaterial/FXMaterialPic/MAT_TeamCT.uasset differ diff --git a/CounterAttack_Solo/Asset/Material/FXMaterial/FXMaterialPic/MAT_TeamT.uasset b/CounterAttack_Solo/Asset/Material/FXMaterial/FXMaterialPic/MAT_TeamT.uasset new file mode 100644 index 00000000..429518a8 Binary files /dev/null and b/CounterAttack_Solo/Asset/Material/FXMaterial/FXMaterialPic/MAT_TeamT.uasset differ diff --git a/CounterAttack_Solo/Asset/Material/FXMaterial/MAT_Contact.uasset b/CounterAttack_Solo/Asset/Material/FXMaterial/MAT_Contact.uasset new file mode 100644 index 00000000..06845f26 Binary files /dev/null and b/CounterAttack_Solo/Asset/Material/FXMaterial/MAT_Contact.uasset differ diff --git a/CounterAttack_Solo/Asset/Material/FXMaterial/MAT_PicBase.uasset b/CounterAttack_Solo/Asset/Material/FXMaterial/MAT_PicBase.uasset new file mode 100644 index 00000000..069488a6 Binary files /dev/null and b/CounterAttack_Solo/Asset/Material/FXMaterial/MAT_PicBase.uasset differ diff --git a/CounterAttack_Solo/Asset/Material/FXMaterial/MAT_TeamCT.uasset b/CounterAttack_Solo/Asset/Material/FXMaterial/MAT_TeamCT.uasset new file mode 100644 index 00000000..bbab04b1 Binary files /dev/null and b/CounterAttack_Solo/Asset/Material/FXMaterial/MAT_TeamCT.uasset differ diff --git a/CounterAttack_Solo/Asset/Material/FXMaterial/MAT_TeamT.uasset b/CounterAttack_Solo/Asset/Material/FXMaterial/MAT_TeamT.uasset new file mode 100644 index 00000000..323c5bb8 Binary files /dev/null and b/CounterAttack_Solo/Asset/Material/FXMaterial/MAT_TeamT.uasset differ diff --git a/CounterAttack_Solo/Asset/Material/FXMaterial/MAT_Test.uasset b/CounterAttack_Solo/Asset/Material/FXMaterial/MAT_Test.uasset new file mode 100644 index 00000000..458ed5a7 Binary files /dev/null and b/CounterAttack_Solo/Asset/Material/FXMaterial/MAT_Test.uasset differ diff --git a/CounterAttack_Solo/Asset/Material/FXMaterial/M_bounce_01.uasset b/CounterAttack_Solo/Asset/Material/FXMaterial/M_bounce_01.uasset new file mode 100644 index 00000000..0c1dd4d9 Binary files /dev/null and b/CounterAttack_Solo/Asset/Material/FXMaterial/M_bounce_01.uasset differ diff --git a/CounterAttack_Solo/Asset/Material/FXMaterial/P_Point.uasset b/CounterAttack_Solo/Asset/Material/FXMaterial/P_Point.uasset new file mode 100644 index 00000000..6b8e0de4 Binary files /dev/null and b/CounterAttack_Solo/Asset/Material/FXMaterial/P_Point.uasset differ diff --git a/CounterAttack_Solo/Asset/Material/Floor/MAT_Floor2.uasset b/CounterAttack_Solo/Asset/Material/Floor/MAT_Floor2.uasset new file mode 100644 index 00000000..7cdeb650 Binary files /dev/null and b/CounterAttack_Solo/Asset/Material/Floor/MAT_Floor2.uasset differ diff --git a/CounterAttack_Solo/Asset/Material/Floor/MAT_Floor3.uasset b/CounterAttack_Solo/Asset/Material/Floor/MAT_Floor3.uasset new file mode 100644 index 00000000..74f3630b Binary files /dev/null and b/CounterAttack_Solo/Asset/Material/Floor/MAT_Floor3.uasset differ diff --git a/CounterAttack_Solo/Asset/Material/Floor/MAT_Floor3_2.uasset b/CounterAttack_Solo/Asset/Material/Floor/MAT_Floor3_2.uasset new file mode 100644 index 00000000..0663b823 Binary files /dev/null and b/CounterAttack_Solo/Asset/Material/Floor/MAT_Floor3_2.uasset differ diff --git a/CounterAttack_Solo/Asset/Material/Floor/M_Floor4.uasset b/CounterAttack_Solo/Asset/Material/Floor/M_Floor4.uasset new file mode 100644 index 00000000..d7692b92 Binary files /dev/null and b/CounterAttack_Solo/Asset/Material/Floor/M_Floor4.uasset differ diff --git a/CounterAttack_Solo/Asset/Material/Floor/M_Floor5.uasset b/CounterAttack_Solo/Asset/Material/Floor/M_Floor5.uasset new file mode 100644 index 00000000..a58a6084 Binary files /dev/null and b/CounterAttack_Solo/Asset/Material/Floor/M_Floor5.uasset differ diff --git a/CounterAttack_Solo/Asset/Material/Floor/M_Floor5_2.uasset b/CounterAttack_Solo/Asset/Material/Floor/M_Floor5_2.uasset new file mode 100644 index 00000000..80cf86ae Binary files /dev/null and b/CounterAttack_Solo/Asset/Material/Floor/M_Floor5_2.uasset differ diff --git a/CounterAttack_Solo/Asset/Material/MAT_Floor2_3.uasset b/CounterAttack_Solo/Asset/Material/MAT_Floor2_3.uasset new file mode 100644 index 00000000..f0a00c2b Binary files /dev/null and b/CounterAttack_Solo/Asset/Material/MAT_Floor2_3.uasset differ diff --git a/CounterAttack_Solo/Asset/Material/MAT_Test.uasset b/CounterAttack_Solo/Asset/Material/MAT_Test.uasset new file mode 100644 index 00000000..2430f1b1 Binary files /dev/null and b/CounterAttack_Solo/Asset/Material/MAT_Test.uasset differ diff --git a/CounterAttack_Solo/Asset/Material/PlaceMat/MAT_ClientPreview.uasset b/CounterAttack_Solo/Asset/Material/PlaceMat/MAT_ClientPreview.uasset new file mode 100644 index 00000000..3654460e Binary files /dev/null and b/CounterAttack_Solo/Asset/Material/PlaceMat/MAT_ClientPreview.uasset differ diff --git a/CounterAttack_Solo/Asset/Material/UIMaterial/DX_Loop.uasset b/CounterAttack_Solo/Asset/Material/UIMaterial/DX_Loop.uasset new file mode 100644 index 00000000..493d1dad Binary files /dev/null and b/CounterAttack_Solo/Asset/Material/UIMaterial/DX_Loop.uasset differ diff --git a/CounterAttack_Solo/Asset/Material/UIMaterial/Font/MAT_Font1.uasset b/CounterAttack_Solo/Asset/Material/UIMaterial/Font/MAT_Font1.uasset new file mode 100644 index 00000000..c9a667eb Binary files /dev/null and b/CounterAttack_Solo/Asset/Material/UIMaterial/Font/MAT_Font1.uasset differ diff --git a/CounterAttack_Solo/Asset/Material/UIMaterial/Font/MAT_Font1_2.uasset b/CounterAttack_Solo/Asset/Material/UIMaterial/Font/MAT_Font1_2.uasset new file mode 100644 index 00000000..b438af28 Binary files /dev/null and b/CounterAttack_Solo/Asset/Material/UIMaterial/Font/MAT_Font1_2.uasset differ diff --git a/CounterAttack_Solo/Asset/Material/UIMaterial/Font/MAT_Font_Blue.uasset b/CounterAttack_Solo/Asset/Material/UIMaterial/Font/MAT_Font_Blue.uasset new file mode 100644 index 00000000..689dd629 Binary files /dev/null and b/CounterAttack_Solo/Asset/Material/UIMaterial/Font/MAT_Font_Blue.uasset differ diff --git a/CounterAttack_Solo/Asset/Material/UIMaterial/Font/MAT_Font_Golden.uasset b/CounterAttack_Solo/Asset/Material/UIMaterial/Font/MAT_Font_Golden.uasset new file mode 100644 index 00000000..f41b885e Binary files /dev/null and b/CounterAttack_Solo/Asset/Material/UIMaterial/Font/MAT_Font_Golden.uasset differ diff --git a/CounterAttack_Solo/Asset/Material/UIMaterial/Font/MAT_Font_Orange.uasset b/CounterAttack_Solo/Asset/Material/UIMaterial/Font/MAT_Font_Orange.uasset new file mode 100644 index 00000000..d8b2df33 Binary files /dev/null and b/CounterAttack_Solo/Asset/Material/UIMaterial/Font/MAT_Font_Orange.uasset differ diff --git a/CounterAttack_Solo/Asset/Material/UIMaterial/Font/MAT_Font_Orange_2.uasset b/CounterAttack_Solo/Asset/Material/UIMaterial/Font/MAT_Font_Orange_2.uasset new file mode 100644 index 00000000..a7e5fab1 Binary files /dev/null and b/CounterAttack_Solo/Asset/Material/UIMaterial/Font/MAT_Font_Orange_2.uasset differ diff --git a/CounterAttack_Solo/Asset/Material/UIMaterial/Font/MAT_Font_Red.uasset b/CounterAttack_Solo/Asset/Material/UIMaterial/Font/MAT_Font_Red.uasset new file mode 100644 index 00000000..6961ccc8 Binary files /dev/null and b/CounterAttack_Solo/Asset/Material/UIMaterial/Font/MAT_Font_Red.uasset differ diff --git a/CounterAttack_Solo/Asset/Material/UIMaterial/MAT_CDRing.uasset b/CounterAttack_Solo/Asset/Material/UIMaterial/MAT_CDRing.uasset new file mode 100644 index 00000000..46d59e6f Binary files /dev/null and b/CounterAttack_Solo/Asset/Material/UIMaterial/MAT_CDRing.uasset differ diff --git a/CounterAttack_Solo/Asset/Material/UIMaterial/MAT_CDRing_2.uasset b/CounterAttack_Solo/Asset/Material/UIMaterial/MAT_CDRing_2.uasset new file mode 100644 index 00000000..aaddcea4 Binary files /dev/null and b/CounterAttack_Solo/Asset/Material/UIMaterial/MAT_CDRing_2.uasset differ diff --git a/CounterAttack_Solo/Asset/Material/UIMaterial/MAT_Loop.uasset b/CounterAttack_Solo/Asset/Material/UIMaterial/MAT_Loop.uasset new file mode 100644 index 00000000..ec477c32 Binary files /dev/null and b/CounterAttack_Solo/Asset/Material/UIMaterial/MAT_Loop.uasset differ diff --git a/CounterAttack_Solo/Asset/Material/UIMaterial/MAT_LoopMove_Arrow.uasset b/CounterAttack_Solo/Asset/Material/UIMaterial/MAT_LoopMove_Arrow.uasset new file mode 100644 index 00000000..049ab935 Binary files /dev/null and b/CounterAttack_Solo/Asset/Material/UIMaterial/MAT_LoopMove_Arrow.uasset differ diff --git a/CounterAttack_Solo/Asset/Material/UIMaterial/MAT_Loop_2.uasset b/CounterAttack_Solo/Asset/Material/UIMaterial/MAT_Loop_2.uasset new file mode 100644 index 00000000..a7065529 Binary files /dev/null and b/CounterAttack_Solo/Asset/Material/UIMaterial/MAT_Loop_2.uasset differ diff --git a/CounterAttack_Solo/Asset/Material/UIMaterial/MAT_Loop_Arrow.uasset b/CounterAttack_Solo/Asset/Material/UIMaterial/MAT_Loop_Arrow.uasset new file mode 100644 index 00000000..3f1a4b5c Binary files /dev/null and b/CounterAttack_Solo/Asset/Material/UIMaterial/MAT_Loop_Arrow.uasset differ diff --git a/CounterAttack_Solo/Asset/Material/UIMaterial/MAT_PicSilhouette.uasset b/CounterAttack_Solo/Asset/Material/UIMaterial/MAT_PicSilhouette.uasset new file mode 100644 index 00000000..efd0c3e4 Binary files /dev/null and b/CounterAttack_Solo/Asset/Material/UIMaterial/MAT_PicSilhouette.uasset differ diff --git a/CounterAttack_Solo/Asset/Material/UIMaterial/MAT_Sphere.uasset b/CounterAttack_Solo/Asset/Material/UIMaterial/MAT_Sphere.uasset new file mode 100644 index 00000000..8fbfff65 Binary files /dev/null and b/CounterAttack_Solo/Asset/Material/UIMaterial/MAT_Sphere.uasset differ diff --git a/CounterAttack_Solo/Asset/Material/UIMaterial/MAT_SweepAwayThoroughly.uasset b/CounterAttack_Solo/Asset/Material/UIMaterial/MAT_SweepAwayThoroughly.uasset new file mode 100644 index 00000000..fa11664a Binary files /dev/null and b/CounterAttack_Solo/Asset/Material/UIMaterial/MAT_SweepAwayThoroughly.uasset differ diff --git a/CounterAttack_Solo/Asset/Mesh/SM_Sphere.uasset b/CounterAttack_Solo/Asset/Mesh/SM_Sphere.uasset new file mode 100644 index 00000000..17f440db Binary files /dev/null and b/CounterAttack_Solo/Asset/Mesh/SM_Sphere.uasset differ diff --git a/CounterAttack_Solo/Asset/Mesh/SM_Sphere_Default.uasset b/CounterAttack_Solo/Asset/Mesh/SM_Sphere_Default.uasset new file mode 100644 index 00000000..07b2c5b4 Binary files /dev/null and b/CounterAttack_Solo/Asset/Mesh/SM_Sphere_Default.uasset differ diff --git a/CounterAttack_Solo/Asset/Mesh/SM_bounce_01.uasset b/CounterAttack_Solo/Asset/Mesh/SM_bounce_01.uasset new file mode 100644 index 00000000..cf35c2ab Binary files /dev/null and b/CounterAttack_Solo/Asset/Mesh/SM_bounce_01.uasset differ diff --git a/CounterAttack_Solo/Asset/Temp/BP_HDTest.uasset b/CounterAttack_Solo/Asset/Temp/BP_HDTest.uasset new file mode 100644 index 00000000..fb119747 Binary files /dev/null and b/CounterAttack_Solo/Asset/Temp/BP_HDTest.uasset differ diff --git a/CounterAttack_Solo/Asset/Temp/MAT_FloorYJ.uasset b/CounterAttack_Solo/Asset/Temp/MAT_FloorYJ.uasset new file mode 100644 index 00000000..d8f79877 Binary files /dev/null and b/CounterAttack_Solo/Asset/Temp/MAT_FloorYJ.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Bar/T_Bar.uasset b/CounterAttack_Solo/Asset/Texture/Bar/T_Bar.uasset new file mode 100644 index 00000000..b16559d6 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Bar/T_Bar.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Bar/T_Bar1.uasset b/CounterAttack_Solo/Asset/Texture/Bar/T_Bar1.uasset new file mode 100644 index 00000000..b638de9e Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Bar/T_Bar1.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Bar/T_Bar2.uasset b/CounterAttack_Solo/Asset/Texture/Bar/T_Bar2.uasset new file mode 100644 index 00000000..f04292bb Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Bar/T_Bar2.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Bar/T_Bar3.uasset b/CounterAttack_Solo/Asset/Texture/Bar/T_Bar3.uasset new file mode 100644 index 00000000..dc4580a5 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Bar/T_Bar3.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Bar/T_BarBG.uasset b/CounterAttack_Solo/Asset/Texture/Bar/T_BarBG.uasset new file mode 100644 index 00000000..ef293a29 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Bar/T_BarBG.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Bar/T_BarBG1.uasset b/CounterAttack_Solo/Asset/Texture/Bar/T_BarBG1.uasset new file mode 100644 index 00000000..2b021623 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Bar/T_BarBG1.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Bar/T_BarBG2.uasset b/CounterAttack_Solo/Asset/Texture/Bar/T_BarBG2.uasset new file mode 100644 index 00000000..ae347de9 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Bar/T_BarBG2.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Buff/T_AddDamage.uasset b/CounterAttack_Solo/Asset/Texture/Buff/T_AddDamage.uasset new file mode 100644 index 00000000..1dbfbae6 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Buff/T_AddDamage.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Buff/T_AddJump.uasset b/CounterAttack_Solo/Asset/Texture/Buff/T_AddJump.uasset new file mode 100644 index 00000000..261241d8 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Buff/T_AddJump.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Buff/T_AddJumpCount.uasset b/CounterAttack_Solo/Asset/Texture/Buff/T_AddJumpCount.uasset new file mode 100644 index 00000000..da8b36ae Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Buff/T_AddJumpCount.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Buff/T_Counterattack.uasset b/CounterAttack_Solo/Asset/Texture/Buff/T_Counterattack.uasset new file mode 100644 index 00000000..f696ec8f Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Buff/T_Counterattack.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Buff/T_Defense.uasset b/CounterAttack_Solo/Asset/Texture/Buff/T_Defense.uasset new file mode 100644 index 00000000..6caf4840 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Buff/T_Defense.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Buff/T_Explosion.uasset b/CounterAttack_Solo/Asset/Texture/Buff/T_Explosion.uasset new file mode 100644 index 00000000..3deecd8a Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Buff/T_Explosion.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Buff/T_Ice.uasset b/CounterAttack_Solo/Asset/Texture/Buff/T_Ice.uasset new file mode 100644 index 00000000..d4f8cd76 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Buff/T_Ice.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Buff/T_InfiniteBullets_128.uasset b/CounterAttack_Solo/Asset/Texture/Buff/T_InfiniteBullets_128.uasset new file mode 100644 index 00000000..b509cae4 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Buff/T_InfiniteBullets_128.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Buff/T_Jump_128.uasset b/CounterAttack_Solo/Asset/Texture/Buff/T_Jump_128.uasset new file mode 100644 index 00000000..1c0cd63f Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Buff/T_Jump_128.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Buff/T_Mark.uasset b/CounterAttack_Solo/Asset/Texture/Buff/T_Mark.uasset new file mode 100644 index 00000000..00143e68 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Buff/T_Mark.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Buff/T_MaxHealth.uasset b/CounterAttack_Solo/Asset/Texture/Buff/T_MaxHealth.uasset new file mode 100644 index 00000000..55b63987 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Buff/T_MaxHealth.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Buff/T_RateOfFire.uasset b/CounterAttack_Solo/Asset/Texture/Buff/T_RateOfFire.uasset new file mode 100644 index 00000000..dcdb5718 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Buff/T_RateOfFire.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Buff/T_RespiratoryRecovery.uasset b/CounterAttack_Solo/Asset/Texture/Buff/T_RespiratoryRecovery.uasset new file mode 100644 index 00000000..882f32bf Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Buff/T_RespiratoryRecovery.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Buff/T_Sensing.uasset b/CounterAttack_Solo/Asset/Texture/Buff/T_Sensing.uasset new file mode 100644 index 00000000..69b24fb9 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Buff/T_Sensing.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Buff/T_Speed_128.uasset b/CounterAttack_Solo/Asset/Texture/Buff/T_Speed_128.uasset new file mode 100644 index 00000000..08398ab1 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Buff/T_Speed_128.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Buff/T_Tenacious.uasset b/CounterAttack_Solo/Asset/Texture/Buff/T_Tenacious.uasset new file mode 100644 index 00000000..f2b03467 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Buff/T_Tenacious.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Buff/T_Vampirism.uasset b/CounterAttack_Solo/Asset/Texture/Buff/T_Vampirism.uasset new file mode 100644 index 00000000..f8e9fde6 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Buff/T_Vampirism.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/FXTexture/T_bounce_01.uasset b/CounterAttack_Solo/Asset/Texture/FXTexture/T_bounce_01.uasset new file mode 100644 index 00000000..a884f209 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/FXTexture/T_bounce_01.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Frame/T_Bar.uasset b/CounterAttack_Solo/Asset/Texture/Frame/T_Bar.uasset new file mode 100644 index 00000000..634a47bf Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Frame/T_Bar.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Frame/T_Frame20.uasset b/CounterAttack_Solo/Asset/Texture/Frame/T_Frame20.uasset new file mode 100644 index 00000000..fa9a113a Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Frame/T_Frame20.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Frame/T_Frame21.uasset b/CounterAttack_Solo/Asset/Texture/Frame/T_Frame21.uasset new file mode 100644 index 00000000..4aaa51e6 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Frame/T_Frame21.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Frame/T_Frame26.uasset b/CounterAttack_Solo/Asset/Texture/Frame/T_Frame26.uasset new file mode 100644 index 00000000..146b7da2 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Frame/T_Frame26.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Frame/T_Frame27.uasset b/CounterAttack_Solo/Asset/Texture/Frame/T_Frame27.uasset new file mode 100644 index 00000000..3f3d4610 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Frame/T_Frame27.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Frame/T_Frame6.uasset b/CounterAttack_Solo/Asset/Texture/Frame/T_Frame6.uasset new file mode 100644 index 00000000..1f96298c Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Frame/T_Frame6.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Frame/T_Frame8.uasset b/CounterAttack_Solo/Asset/Texture/Frame/T_Frame8.uasset new file mode 100644 index 00000000..d1ef03f9 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Frame/T_Frame8.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Frame/T_Frame9.uasset b/CounterAttack_Solo/Asset/Texture/Frame/T_Frame9.uasset new file mode 100644 index 00000000..a301e7d6 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Frame/T_Frame9.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Frame/T_FrameHD_11.uasset b/CounterAttack_Solo/Asset/Texture/Frame/T_FrameHD_11.uasset new file mode 100644 index 00000000..e300aa7d Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Frame/T_FrameHD_11.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Frame/T_Frame_1.uasset b/CounterAttack_Solo/Asset/Texture/Frame/T_Frame_1.uasset new file mode 100644 index 00000000..7194897c Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Frame/T_Frame_1.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Frame/T_Frame_2.uasset b/CounterAttack_Solo/Asset/Texture/Frame/T_Frame_2.uasset new file mode 100644 index 00000000..9ff1c165 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Frame/T_Frame_2.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Frame/T_Frame_22.uasset b/CounterAttack_Solo/Asset/Texture/Frame/T_Frame_22.uasset new file mode 100644 index 00000000..5bf1d43d Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Frame/T_Frame_22.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Frame/T_Frame_23.uasset b/CounterAttack_Solo/Asset/Texture/Frame/T_Frame_23.uasset new file mode 100644 index 00000000..1415468c Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Frame/T_Frame_23.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Frame/T_Frame_24.uasset b/CounterAttack_Solo/Asset/Texture/Frame/T_Frame_24.uasset new file mode 100644 index 00000000..5722e014 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Frame/T_Frame_24.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Frame/T_Frame_25.uasset b/CounterAttack_Solo/Asset/Texture/Frame/T_Frame_25.uasset new file mode 100644 index 00000000..302810c0 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Frame/T_Frame_25.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Frame/T_Frame_3.uasset b/CounterAttack_Solo/Asset/Texture/Frame/T_Frame_3.uasset new file mode 100644 index 00000000..e2ca16c6 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Frame/T_Frame_3.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Frame/UI_CRB_AbilityStates_TEMP_260_0_tex.uasset b/CounterAttack_Solo/Asset/Texture/Frame/UI_CRB_AbilityStates_TEMP_260_0_tex.uasset new file mode 100644 index 00000000..c43782a8 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Frame/UI_CRB_AbilityStates_TEMP_260_0_tex.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Frame/UI_CRB_Basekit_1_236_1104_tex.uasset b/CounterAttack_Solo/Asset/Texture/Frame/UI_CRB_Basekit_1_236_1104_tex.uasset new file mode 100644 index 00000000..e0a6c9ad Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Frame/UI_CRB_Basekit_1_236_1104_tex.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Frame/UI_CharacterWindow_207_893_tex.uasset b/CounterAttack_Solo/Asset/Texture/Frame/UI_CharacterWindow_207_893_tex.uasset new file mode 100644 index 00000000..b7f11e21 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Frame/UI_CharacterWindow_207_893_tex.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Gradient/T_JB.uasset b/CounterAttack_Solo/Asset/Texture/Gradient/T_JB.uasset new file mode 100644 index 00000000..52979fac Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Gradient/T_JB.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Gradient/T_JB2.uasset b/CounterAttack_Solo/Asset/Texture/Gradient/T_JB2.uasset new file mode 100644 index 00000000..6421cb20 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Gradient/T_JB2.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/Guide/T_Guide1.uasset b/CounterAttack_Solo/Asset/Texture/Guide/T_Guide1.uasset new file mode 100644 index 00000000..d1c5cfcb Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/Guide/T_Guide1.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/SpiritFrames/Icon_KnockedDown.uasset b/CounterAttack_Solo/Asset/Texture/SpiritFrames/Icon_KnockedDown.uasset new file mode 100644 index 00000000..926dd90b Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/SpiritFrames/Icon_KnockedDown.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/T_AddLife.uasset b/CounterAttack_Solo/Asset/Texture/T_AddLife.uasset new file mode 100644 index 00000000..83b0a1fd Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/T_AddLife.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/T_Aim.uasset b/CounterAttack_Solo/Asset/Texture/T_Aim.uasset new file mode 100644 index 00000000..36d8fb76 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/T_Aim.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/T_Arrow.uasset b/CounterAttack_Solo/Asset/Texture/T_Arrow.uasset new file mode 100644 index 00000000..a70bd143 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/T_Arrow.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/T_Bullet.uasset b/CounterAttack_Solo/Asset/Texture/T_Bullet.uasset new file mode 100644 index 00000000..81739467 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/T_Bullet.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/T_CTTeamTip.uasset b/CounterAttack_Solo/Asset/Texture/T_CTTeamTip.uasset new file mode 100644 index 00000000..6028f714 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/T_CTTeamTip.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/T_Fist3.uasset b/CounterAttack_Solo/Asset/Texture/T_Fist3.uasset new file mode 100644 index 00000000..d0d92690 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/T_Fist3.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/T_Frame2.uasset b/CounterAttack_Solo/Asset/Texture/T_Frame2.uasset new file mode 100644 index 00000000..c612aa07 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/T_Frame2.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/T_Frame32.uasset b/CounterAttack_Solo/Asset/Texture/T_Frame32.uasset new file mode 100644 index 00000000..3d1a8c1d Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/T_Frame32.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/T_Idioctonia2.uasset b/CounterAttack_Solo/Asset/Texture/T_Idioctonia2.uasset new file mode 100644 index 00000000..c62ff58c Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/T_Idioctonia2.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/T_KillInKinfe.uasset b/CounterAttack_Solo/Asset/Texture/T_KillInKinfe.uasset new file mode 100644 index 00000000..58b6a7fe Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/T_KillInKinfe.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/T_Level.uasset b/CounterAttack_Solo/Asset/Texture/T_Level.uasset new file mode 100644 index 00000000..2be61996 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/T_Level.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/T_Line.uasset b/CounterAttack_Solo/Asset/Texture/T_Line.uasset new file mode 100644 index 00000000..ab835693 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/T_Line.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/T_Machinery.uasset b/CounterAttack_Solo/Asset/Texture/T_Machinery.uasset new file mode 100644 index 00000000..1004823d Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/T_Machinery.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/T_PointTo.uasset b/CounterAttack_Solo/Asset/Texture/T_PointTo.uasset new file mode 100644 index 00000000..f238b2d8 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/T_PointTo.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/T_Positioning.uasset b/CounterAttack_Solo/Asset/Texture/T_Positioning.uasset new file mode 100644 index 00000000..efe1e509 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/T_Positioning.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/T_Round.uasset b/CounterAttack_Solo/Asset/Texture/T_Round.uasset new file mode 100644 index 00000000..b1274400 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/T_Round.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/T_Round128.uasset b/CounterAttack_Solo/Asset/Texture/T_Round128.uasset new file mode 100644 index 00000000..434b7515 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/T_Round128.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/T_Round16.uasset b/CounterAttack_Solo/Asset/Texture/T_Round16.uasset new file mode 100644 index 00000000..6d3a11bd Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/T_Round16.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/T_Sphere16.uasset b/CounterAttack_Solo/Asset/Texture/T_Sphere16.uasset new file mode 100644 index 00000000..e68084a2 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/T_Sphere16.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/T_Star.uasset b/CounterAttack_Solo/Asset/Texture/T_Star.uasset new file mode 100644 index 00000000..41e95031 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/T_Star.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/T_TTeamTip.uasset b/CounterAttack_Solo/Asset/Texture/T_TTeamTip.uasset new file mode 100644 index 00000000..1f828110 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/T_TTeamTip.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/T_TeamCT.uasset b/CounterAttack_Solo/Asset/Texture/T_TeamCT.uasset new file mode 100644 index 00000000..432d79ac Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/T_TeamCT.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/T_TeamScore.uasset b/CounterAttack_Solo/Asset/Texture/T_TeamScore.uasset new file mode 100644 index 00000000..ba5dd2c4 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/T_TeamScore.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/T_TeamT.uasset b/CounterAttack_Solo/Asset/Texture/T_TeamT.uasset new file mode 100644 index 00000000..e76efbe7 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/T_TeamT.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/T_TipFrame.uasset b/CounterAttack_Solo/Asset/Texture/T_TipFrame.uasset new file mode 100644 index 00000000..9d5d1811 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/T_TipFrame.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/T_WaterDroplet.uasset b/CounterAttack_Solo/Asset/Texture/T_WaterDroplet.uasset new file mode 100644 index 00000000..063dcddc Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/T_WaterDroplet.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/T_WenHao.uasset b/CounterAttack_Solo/Asset/Texture/T_WenHao.uasset new file mode 100644 index 00000000..6892c604 Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/T_WenHao.uasset differ diff --git a/CounterAttack_Solo/Asset/Texture/T_Write.uasset b/CounterAttack_Solo/Asset/Texture/T_Write.uasset new file mode 100644 index 00000000..b63605ef Binary files /dev/null and b/CounterAttack_Solo/Asset/Texture/T_Write.uasset differ diff --git a/CounterAttack_Solo/Asset/UGCGameAttributeCache.uasset b/CounterAttack_Solo/Asset/UGCGameAttributeCache.uasset new file mode 100644 index 00000000..38d3418a Binary files /dev/null and b/CounterAttack_Solo/Asset/UGCGameAttributeCache.uasset differ diff --git a/CounterAttack_Solo/Asset/UGCLayout_BP.uasset b/CounterAttack_Solo/Asset/UGCLayout_BP.uasset new file mode 100644 index 00000000..8b17579a Binary files /dev/null and b/CounterAttack_Solo/Asset/UGCLayout_BP.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/Broadcast/WB_Broadcast.uasset b/CounterAttack_Solo/Asset/UI/Broadcast/WB_Broadcast.uasset new file mode 100644 index 00000000..80ad69fd Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/Broadcast/WB_Broadcast.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/Broadcast/WB_BroadcastItem.uasset b/CounterAttack_Solo/Asset/UI/Broadcast/WB_BroadcastItem.uasset new file mode 100644 index 00000000..f14c8763 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/Broadcast/WB_BroadcastItem.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/Debug/WB_Debug.uasset b/CounterAttack_Solo/Asset/UI/Debug/WB_Debug.uasset new file mode 100644 index 00000000..d6db481b Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/Debug/WB_Debug.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/Guide/BuffDesc/WB_BuffDesc.uasset b/CounterAttack_Solo/Asset/UI/Guide/BuffDesc/WB_BuffDesc.uasset new file mode 100644 index 00000000..f1d32e5c Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/Guide/BuffDesc/WB_BuffDesc.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/Guide/BuffDesc/WB_BuffDescItem.uasset b/CounterAttack_Solo/Asset/UI/Guide/BuffDesc/WB_BuffDescItem.uasset new file mode 100644 index 00000000..b4544085 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/Guide/BuffDesc/WB_BuffDescItem.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/Guide/WB_Guide.uasset b/CounterAttack_Solo/Asset/UI/Guide/WB_Guide.uasset new file mode 100644 index 00000000..047434ba Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/Guide/WB_Guide.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/KillInfo/WB_KillInfo.uasset b/CounterAttack_Solo/Asset/UI/KillInfo/WB_KillInfo.uasset new file mode 100644 index 00000000..62c7b1bf Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/KillInfo/WB_KillInfo.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/PlayerHead/WB_PlayerHead.uasset b/CounterAttack_Solo/Asset/UI/PlayerHead/WB_PlayerHead.uasset new file mode 100644 index 00000000..ee9f71ac Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/PlayerHead/WB_PlayerHead.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/PlayerHead/WB_PlayerHead_48.uasset b/CounterAttack_Solo/Asset/UI/PlayerHead/WB_PlayerHead_48.uasset new file mode 100644 index 00000000..7b85c97b Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/PlayerHead/WB_PlayerHead_48.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/PlayerHead/WB_PlayerInfo_L.uasset b/CounterAttack_Solo/Asset/UI/PlayerHead/WB_PlayerInfo_L.uasset new file mode 100644 index 00000000..535e8393 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/PlayerHead/WB_PlayerInfo_L.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/PlayerHead/WB_PlayerInfo_R.uasset b/CounterAttack_Solo/Asset/UI/PlayerHead/WB_PlayerInfo_R.uasset new file mode 100644 index 00000000..908e3c2e Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/PlayerHead/WB_PlayerInfo_R.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/Rank/WB_TeamRank.uasset b/CounterAttack_Solo/Asset/UI/Rank/WB_TeamRank.uasset new file mode 100644 index 00000000..0a304880 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/Rank/WB_TeamRank.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/Rank/WB_TeamRankItem.uasset b/CounterAttack_Solo/Asset/UI/Rank/WB_TeamRankItem.uasset new file mode 100644 index 00000000..693b3e7f Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/Rank/WB_TeamRankItem.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/ScreenEffect/WB_Vague.uasset b/CounterAttack_Solo/Asset/UI/ScreenEffect/WB_Vague.uasset new file mode 100644 index 00000000..f5e20163 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/ScreenEffect/WB_Vague.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/SecondaryConfirmation/WB_SecondaryConfirmation.uasset b/CounterAttack_Solo/Asset/UI/SecondaryConfirmation/WB_SecondaryConfirmation.uasset new file mode 100644 index 00000000..ae83a591 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/SecondaryConfirmation/WB_SecondaryConfirmation.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/SecondaryConfirmation/WB_SecondaryConfirmation_EditableText.uasset b/CounterAttack_Solo/Asset/UI/SecondaryConfirmation/WB_SecondaryConfirmation_EditableText.uasset new file mode 100644 index 00000000..619c5bd8 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/SecondaryConfirmation/WB_SecondaryConfirmation_EditableText.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/SecondaryConfirmation/WB_SecondaryConfirmation_Strip.uasset b/CounterAttack_Solo/Asset/UI/SecondaryConfirmation/WB_SecondaryConfirmation_Strip.uasset new file mode 100644 index 00000000..532aee9e Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/SecondaryConfirmation/WB_SecondaryConfirmation_Strip.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/SelectBuff/WB_BaseBuffSelectItem.uasset b/CounterAttack_Solo/Asset/UI/SelectBuff/WB_BaseBuffSelectItem.uasset new file mode 100644 index 00000000..99f9e72e Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/SelectBuff/WB_BaseBuffSelectItem.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/SelectBuff/WB_BuffSelectItem.uasset b/CounterAttack_Solo/Asset/UI/SelectBuff/WB_BuffSelectItem.uasset new file mode 100644 index 00000000..844b3451 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/SelectBuff/WB_BuffSelectItem.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/SelectBuff/WB_SelectBaseBuff.uasset b/CounterAttack_Solo/Asset/UI/SelectBuff/WB_SelectBaseBuff.uasset new file mode 100644 index 00000000..e9db4062 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/SelectBuff/WB_SelectBaseBuff.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/SelectBuff/WB_SelectIncrease.uasset b/CounterAttack_Solo/Asset/UI/SelectBuff/WB_SelectIncrease.uasset new file mode 100644 index 00000000..86a6929c Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/SelectBuff/WB_SelectIncrease.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/SelectWeapon/Item/WB_OtherPartItem.uasset b/CounterAttack_Solo/Asset/UI/SelectWeapon/Item/WB_OtherPartItem.uasset new file mode 100644 index 00000000..fa3222fa Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/SelectWeapon/Item/WB_OtherPartItem.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/SelectWeapon/Item/WB_WeaponItem.uasset b/CounterAttack_Solo/Asset/UI/SelectWeapon/Item/WB_WeaponItem.uasset new file mode 100644 index 00000000..d7b2397a Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/SelectWeapon/Item/WB_WeaponItem.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/SelectWeapon/Item/WB_WeaponPartItem.uasset b/CounterAttack_Solo/Asset/UI/SelectWeapon/Item/WB_WeaponPartItem.uasset new file mode 100644 index 00000000..b466c0fe Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/SelectWeapon/Item/WB_WeaponPartItem.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/SelectWeapon/Item/WB_WeaponSelectItem.uasset b/CounterAttack_Solo/Asset/UI/SelectWeapon/Item/WB_WeaponSelectItem.uasset new file mode 100644 index 00000000..6193a0f5 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/SelectWeapon/Item/WB_WeaponSelectItem.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/SelectWeapon/SaveCustomWeaponItem/WB_SaveWeaponItem.uasset b/CounterAttack_Solo/Asset/UI/SelectWeapon/SaveCustomWeaponItem/WB_SaveWeaponItem.uasset new file mode 100644 index 00000000..69c6f883 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/SelectWeapon/SaveCustomWeaponItem/WB_SaveWeaponItem.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/SelectWeapon/SaveCustomWeaponItem/WB_SelectSaveWeapon.uasset b/CounterAttack_Solo/Asset/UI/SelectWeapon/SaveCustomWeaponItem/WB_SelectSaveWeapon.uasset new file mode 100644 index 00000000..5705ab07 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/SelectWeapon/SaveCustomWeaponItem/WB_SelectSaveWeapon.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/SelectWeapon/SaveCustomWeaponItem/WB_WeaponType.uasset b/CounterAttack_Solo/Asset/UI/SelectWeapon/SaveCustomWeaponItem/WB_WeaponType.uasset new file mode 100644 index 00000000..96719039 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/SelectWeapon/SaveCustomWeaponItem/WB_WeaponType.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/SelectWeapon/WB_CustomWeapon.uasset b/CounterAttack_Solo/Asset/UI/SelectWeapon/WB_CustomWeapon.uasset new file mode 100644 index 00000000..25db7b26 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/SelectWeapon/WB_CustomWeapon.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/SelectWeapon/WB_ReselectWeaponBtn.uasset b/CounterAttack_Solo/Asset/UI/SelectWeapon/WB_ReselectWeaponBtn.uasset new file mode 100644 index 00000000..09c6293d Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/SelectWeapon/WB_ReselectWeaponBtn.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/SelectWeapon/WB_WeaponSelect.uasset b/CounterAttack_Solo/Asset/UI/SelectWeapon/WB_WeaponSelect.uasset new file mode 100644 index 00000000..e1b32e15 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/SelectWeapon/WB_WeaponSelect.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/Settlement/WB_Settlement.uasset b/CounterAttack_Solo/Asset/UI/Settlement/WB_Settlement.uasset new file mode 100644 index 00000000..3c9b221a Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/Settlement/WB_Settlement.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/Settlement/WB_SettlementItem.uasset b/CounterAttack_Solo/Asset/UI/Settlement/WB_SettlementItem.uasset new file mode 100644 index 00000000..830e37ec Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/Settlement/WB_SettlementItem.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/Settlement/WB_TeamSettlement.uasset b/CounterAttack_Solo/Asset/UI/Settlement/WB_TeamSettlement.uasset new file mode 100644 index 00000000..466e48a9 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/Settlement/WB_TeamSettlement.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/Settlement/WB_TeamSettlementItem.uasset b/CounterAttack_Solo/Asset/UI/Settlement/WB_TeamSettlementItem.uasset new file mode 100644 index 00000000..a8228567 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/Settlement/WB_TeamSettlementItem.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/Currency/WB_Currency.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/Currency/WB_Currency.uasset new file mode 100644 index 00000000..9e03aae4 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/Currency/WB_Currency.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/Currency/WB_GoldAccess.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/Currency/WB_GoldAccess.uasset new file mode 100644 index 00000000..154999ca Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/Currency/WB_GoldAccess.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/NextWeapon/WB_NextWeapon.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/NextWeapon/WB_NextWeapon.uasset new file mode 100644 index 00000000..74e458ef Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/NextWeapon/WB_NextWeapon.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/NextWeapon/WB_NextWeaponItem.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/NextWeapon/WB_NextWeaponItem.uasset new file mode 100644 index 00000000..be6d535b Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/NextWeapon/WB_NextWeaponItem.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/ShowBuff/WB_ShowBuff.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/ShowBuff/WB_ShowBuff.uasset new file mode 100644 index 00000000..b083c4e6 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/ShowBuff/WB_ShowBuff.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/ShowBuff/WB_ShowBuffItem.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/ShowBuff/WB_ShowBuffItem.uasset new file mode 100644 index 00000000..be3cd342 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/ShowBuff/WB_ShowBuffItem.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/ShowBuff/WB_ShowBuffSmallItem.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/ShowBuff/WB_ShowBuffSmallItem.uasset new file mode 100644 index 00000000..decdc64d Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/ShowBuff/WB_ShowBuffSmallItem.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/TeamScore/W_TeamScore.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/TeamScore/W_TeamScore.uasset new file mode 100644 index 00000000..c7afc1e8 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/TeamScore/W_TeamScore.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/TeamScore/W_TeamScore_Line.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/TeamScore/W_TeamScore_Line.uasset new file mode 100644 index 00000000..82858fdf Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/TeamScore/W_TeamScore_Line.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/TeamScore/W_TeamScore_RoundMode.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/TeamScore/W_TeamScore_RoundMode.uasset new file mode 100644 index 00000000..38b38f85 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/TeamScore/W_TeamScore_RoundMode.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/TeamScore/W_TeamScore_RoundMode_2.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/TeamScore/W_TeamScore_RoundMode_2.uasset new file mode 100644 index 00000000..bb25c9f6 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/TeamScore/W_TeamScore_RoundMode_2.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/TeamScore/W_TeamScore_TargetScore.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/TeamScore/W_TeamScore_TargetScore.uasset new file mode 100644 index 00000000..e64edc7a Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/TeamScore/W_TeamScore_TargetScore.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/WB_DistanceDefenseLine.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/WB_DistanceDefenseLine.uasset new file mode 100644 index 00000000..4a42e84b Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/WB_DistanceDefenseLine.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/WB_FightPanel.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/WB_FightPanel.uasset new file mode 100644 index 00000000..00f21b20 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/WB_FightPanel.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/WB_HP.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/WB_HP.uasset new file mode 100644 index 00000000..cc11c88b Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/WB_HP.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/WB_HeadingInfo.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/WB_HeadingInfo.uasset new file mode 100644 index 00000000..a7b3400f Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/WB_HeadingInfo.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/WB_ShowMechanismEnergy.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/WB_ShowMechanismEnergy.uasset new file mode 100644 index 00000000..693bb4a3 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/WB_ShowMechanismEnergy.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/WB_ToGod.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/WB_ToGod.uasset new file mode 100644 index 00000000..77afaf64 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/FightPanel/WB_ToGod.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/GamePreparation/WB_RandomSelectPlayerVoteMap.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/GamePreparation/WB_RandomSelectPlayerVoteMap.uasset new file mode 100644 index 00000000..5de8c09c Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/GamePreparation/WB_RandomSelectPlayerVoteMap.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/GamePreparation/WB_SelectDefaultWeapon.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/GamePreparation/WB_SelectDefaultWeapon.uasset new file mode 100644 index 00000000..bf29281c Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/GamePreparation/WB_SelectDefaultWeapon.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/GamePreparation/W_GamePreparation.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/GamePreparation/W_GamePreparation.uasset new file mode 100644 index 00000000..6f2d524e Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/GamePreparation/W_GamePreparation.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/GamePreparation/W_GamePreparation_2.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/GamePreparation/W_GamePreparation_2.uasset new file mode 100644 index 00000000..e7ead462 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/GamePreparation/W_GamePreparation_2.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/GamePreparation/W_RandomSelectMapItem.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/GamePreparation/W_RandomSelectMapItem.uasset new file mode 100644 index 00000000..687ff023 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/GamePreparation/W_RandomSelectMapItem.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/GamePreparation/W_SelectMapItem.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/GamePreparation/W_SelectMapItem.uasset new file mode 100644 index 00000000..5bc2fcf5 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/GamePreparation/W_SelectMapItem.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/GamePreparation/W_WaitPlayJoin.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/GamePreparation/W_WaitPlayJoin.uasset new file mode 100644 index 00000000..7fe6b2a8 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/GamePreparation/W_WaitPlayJoin.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/MarkPlayerUI/WB_InductionPlayer.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/MarkPlayerUI/WB_InductionPlayer.uasset new file mode 100644 index 00000000..f8615c6f Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/MarkPlayerUI/WB_InductionPlayer.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/MarkPlayerUI/WB_MarkEnemy.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/MarkPlayerUI/WB_MarkEnemy.uasset new file mode 100644 index 00000000..82a6e2e1 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/MarkPlayerUI/WB_MarkEnemy.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/MarkPlayerUI/WB_MarkGodOfWar.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/MarkPlayerUI/WB_MarkGodOfWar.uasset new file mode 100644 index 00000000..b7aedda7 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/MarkPlayerUI/WB_MarkGodOfWar.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/PlaceGameMenu/WB_MapOperate.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/PlaceGameMenu/WB_MapOperate.uasset new file mode 100644 index 00000000..206535dd Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/PlaceGameMenu/WB_MapOperate.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/PlaceGameMenu/WB_PlaceGameMenu.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/PlaceGameMenu/WB_PlaceGameMenu.uasset new file mode 100644 index 00000000..1c28d01a Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/PlaceGameMenu/WB_PlaceGameMenu.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/PlaceGameMenu/WB_PreviewMap.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/PlaceGameMenu/WB_PreviewMap.uasset new file mode 100644 index 00000000..998d5a58 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/PlaceGameMenu/WB_PreviewMap.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/PlaceGameMenu/WB_SavedMap.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/PlaceGameMenu/WB_SavedMap.uasset new file mode 100644 index 00000000..982b76b0 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/PlaceGameMenu/WB_SavedMap.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/PlacePanel/WB_ImportPlaceCode.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/PlacePanel/WB_ImportPlaceCode.uasset new file mode 100644 index 00000000..a8607a56 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/PlacePanel/WB_ImportPlaceCode.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/PlacePanel/WB_PlaceItem.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/PlacePanel/WB_PlaceItem.uasset new file mode 100644 index 00000000..025cd4f8 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/PlacePanel/WB_PlaceItem.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/PlacePanel/WB_PlacePanel.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/PlacePanel/WB_PlacePanel.uasset new file mode 100644 index 00000000..9cbdd9db Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/PlacePanel/WB_PlacePanel.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/PlacePanel/WB_SetRot.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/PlacePanel/WB_SetRot.uasset new file mode 100644 index 00000000..c3561590 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/PlacePanel/WB_SetRot.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/PlacePanel/WB_ShowPlaceCode.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/PlacePanel/WB_ShowPlaceCode.uasset new file mode 100644 index 00000000..aac0507a Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/PlacePanel/WB_ShowPlaceCode.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/PlacePanel/Widget_NewEditableText.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/PlacePanel/Widget_NewEditableText.uasset new file mode 100644 index 00000000..1dcf96df Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/PlacePanel/Widget_NewEditableText.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/ReplaceSavedMap/WB_ReplaceSavedMap.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/ReplaceSavedMap/WB_ReplaceSavedMap.uasset new file mode 100644 index 00000000..2eb27686 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/ReplaceSavedMap/WB_ReplaceSavedMap.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/ReplaceSavedMap/WB_ReplaceSavedMapItem.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/ReplaceSavedMap/WB_ReplaceSavedMapItem.uasset new file mode 100644 index 00000000..0f82471d Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/ReplaceSavedMap/WB_ReplaceSavedMapItem.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/Round/WB_PlaceItemCountInfo.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/Round/WB_PlaceItemCountInfo.uasset new file mode 100644 index 00000000..16d0e892 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/Round/WB_PlaceItemCountInfo.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/Round/WB_RoundFinish.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/Round/WB_RoundFinish.uasset new file mode 100644 index 00000000..794033e5 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/Round/WB_RoundFinish.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/Round/WB_RoundReadyState.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/Round/WB_RoundReadyState.uasset new file mode 100644 index 00000000..db73adee Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/Round/WB_RoundReadyState.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/Round/WB_RoundStartTip.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/Round/WB_RoundStartTip.uasset new file mode 100644 index 00000000..bb7970ec Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/Round/WB_RoundStartTip.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/RunMapPanel/WB_RerunPanel.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/RunMapPanel/WB_RerunPanel.uasset new file mode 100644 index 00000000..0669e2e7 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/RunMapPanel/WB_RerunPanel.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/RunMapPanel/WB_RunMapPanel.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/RunMapPanel/WB_RunMapPanel.uasset new file mode 100644 index 00000000..140c35d3 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/RunMapPanel/WB_RunMapPanel.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/RunMapPanel/WB_SaveMap.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/RunMapPanel/WB_SaveMap.uasset new file mode 100644 index 00000000..6d900073 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/RunMapPanel/WB_SaveMap.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/Task/WB_PlayerLevel.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/Task/WB_PlayerLevel.uasset new file mode 100644 index 00000000..e17166df Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/Task/WB_PlayerLevel.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/Task/WB_Task.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/Task/WB_Task.uasset new file mode 100644 index 00000000..36f74481 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/Task/WB_Task.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/Task/WB_TaskReward_N.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/Task/WB_TaskReward_N.uasset new file mode 100644 index 00000000..834c9940 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/Task/WB_TaskReward_N.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/Task/WB_Task_Item.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/Task/WB_Task_Item.uasset new file mode 100644 index 00000000..b97e9125 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/Task/WB_Task_Item.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/WB_GameEnd.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/WB_GameEnd.uasset new file mode 100644 index 00000000..49343849 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/WB_GameEnd.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/WB_GameUnableToStart.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/WB_GameUnableToStart.uasset new file mode 100644 index 00000000..c8711e5d Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/WB_GameUnableToStart.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/StatusUI/W_GamePlay.uasset b/CounterAttack_Solo/Asset/UI/StatusUI/W_GamePlay.uasset new file mode 100644 index 00000000..916d655f Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/StatusUI/W_GamePlay.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/Tip/WB_FrontSightTip.uasset b/CounterAttack_Solo/Asset/UI/Tip/WB_FrontSightTip.uasset new file mode 100644 index 00000000..202f9ce0 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/Tip/WB_FrontSightTip.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/Tip/WB_GodOfWarCome.uasset b/CounterAttack_Solo/Asset/UI/Tip/WB_GodOfWarCome.uasset new file mode 100644 index 00000000..079376e7 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/Tip/WB_GodOfWarCome.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/Tip/WB_GodOfWarDescend.uasset b/CounterAttack_Solo/Asset/UI/Tip/WB_GodOfWarDescend.uasset new file mode 100644 index 00000000..543a6c32 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/Tip/WB_GodOfWarDescend.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/Tip/WB_KillingGod.uasset b/CounterAttack_Solo/Asset/UI/Tip/WB_KillingGod.uasset new file mode 100644 index 00000000..c06b0272 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/Tip/WB_KillingGod.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/Tip/WB_Tip.uasset b/CounterAttack_Solo/Asset/UI/Tip/WB_Tip.uasset new file mode 100644 index 00000000..61e3e55e Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/Tip/WB_Tip.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/Tip/WB_Tip_2.uasset b/CounterAttack_Solo/Asset/UI/Tip/WB_Tip_2.uasset new file mode 100644 index 00000000..1ee13072 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/Tip/WB_Tip_2.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/Tip/WB_Tip_3.uasset b/CounterAttack_Solo/Asset/UI/Tip/WB_Tip_3.uasset new file mode 100644 index 00000000..52dd7bff Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/Tip/WB_Tip_3.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/Tip/WB_Tip_4.uasset b/CounterAttack_Solo/Asset/UI/Tip/WB_Tip_4.uasset new file mode 100644 index 00000000..3fc15b8d Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/Tip/WB_Tip_4.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/Tip/WB_Tip_5.uasset b/CounterAttack_Solo/Asset/UI/Tip/WB_Tip_5.uasset new file mode 100644 index 00000000..8362fff7 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/Tip/WB_Tip_5.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/Tip/WB_Tip_6.uasset b/CounterAttack_Solo/Asset/UI/Tip/WB_Tip_6.uasset new file mode 100644 index 00000000..1e0bf3b2 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/Tip/WB_Tip_6.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/Tip/WB_Tip_Like.uasset b/CounterAttack_Solo/Asset/UI/Tip/WB_Tip_Like.uasset new file mode 100644 index 00000000..b3b49dbf Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/Tip/WB_Tip_Like.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/Tip/W_TeamTip.uasset b/CounterAttack_Solo/Asset/UI/Tip/W_TeamTip.uasset new file mode 100644 index 00000000..0e041078 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/Tip/W_TeamTip.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/WB_Countdown.uasset b/CounterAttack_Solo/Asset/UI/WB_Countdown.uasset new file mode 100644 index 00000000..723d404f Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/WB_Countdown.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/W_DamageAnim.uasset b/CounterAttack_Solo/Asset/UI/W_DamageAnim.uasset new file mode 100644 index 00000000..ac22921a Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/W_DamageAnim.uasset differ diff --git a/CounterAttack_Solo/Asset/UI/W_InvincibleTime.uasset b/CounterAttack_Solo/Asset/UI/W_InvincibleTime.uasset new file mode 100644 index 00000000..079aa1c6 Binary files /dev/null and b/CounterAttack_Solo/Asset/UI/W_InvincibleTime.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/General_AvatarFrame_UIBP.uasset b/CounterAttack_Solo/Asset/UMGTemplate/General_AvatarFrame_UIBP.uasset new file mode 100644 index 00000000..b9084c80 Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/General_AvatarFrame_UIBP.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/General_CheckBoxButton.uasset b/CounterAttack_Solo/Asset/UMGTemplate/General_CheckBoxButton.uasset new file mode 100644 index 00000000..cfb392aa Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/General_CheckBoxButton.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/General_GameFailure_UIBP.uasset b/CounterAttack_Solo/Asset/UMGTemplate/General_GameFailure_UIBP.uasset new file mode 100644 index 00000000..11e21b46 Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/General_GameFailure_UIBP.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/General_GameTopBlueTips_UIBP.uasset b/CounterAttack_Solo/Asset/UMGTemplate/General_GameTopBlueTips_UIBP.uasset new file mode 100644 index 00000000..8425eec9 Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/General_GameTopBlueTips_UIBP.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/General_GameTopRedTips_UIBP.uasset b/CounterAttack_Solo/Asset/UMGTemplate/General_GameTopRedTips_UIBP.uasset new file mode 100644 index 00000000..0dc70b36 Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/General_GameTopRedTips_UIBP.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/General_GameVictory_UIBP.uasset b/CounterAttack_Solo/Asset/UMGTemplate/General_GameVictory_UIBP.uasset new file mode 100644 index 00000000..76b8666b Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/General_GameVictory_UIBP.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/General_Ingame_BloodVolButton.uasset b/CounterAttack_Solo/Asset/UMGTemplate/General_Ingame_BloodVolButton.uasset new file mode 100644 index 00000000..f97fc067 Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/General_Ingame_BloodVolButton.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/General_Ingame_RingButton.uasset b/CounterAttack_Solo/Asset/UMGTemplate/General_Ingame_RingButton.uasset new file mode 100644 index 00000000..73af3f45 Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/General_Ingame_RingButton.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/General_Ingame_SquareButton.uasset b/CounterAttack_Solo/Asset/UMGTemplate/General_Ingame_SquareButton.uasset new file mode 100644 index 00000000..c3c90a38 Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/General_Ingame_SquareButton.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/General_NoticeLeftKillTips_UIBP.uasset b/CounterAttack_Solo/Asset/UMGTemplate/General_NoticeLeftKillTips_UIBP.uasset new file mode 100644 index 00000000..b251982c Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/General_NoticeLeftKillTips_UIBP.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/General_NoticeTopTips_UIBP.uasset b/CounterAttack_Solo/Asset/UMGTemplate/General_NoticeTopTips_UIBP.uasset new file mode 100644 index 00000000..2902d71e Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/General_NoticeTopTips_UIBP.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/General_Player_infoBar_UIBP.uasset b/CounterAttack_Solo/Asset/UMGTemplate/General_Player_infoBar_UIBP.uasset new file mode 100644 index 00000000..ca7e192c Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/General_Player_infoBar_UIBP.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/General_SecondLevelButton_1.uasset b/CounterAttack_Solo/Asset/UMGTemplate/General_SecondLevelButton_1.uasset new file mode 100644 index 00000000..d58b3f66 Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/General_SecondLevelButton_1.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/General_SecondLevelButton_2.uasset b/CounterAttack_Solo/Asset/UMGTemplate/General_SecondLevelButton_2.uasset new file mode 100644 index 00000000..5f64cbde Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/General_SecondLevelButton_2.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/General_SecondLevelButton_3.uasset b/CounterAttack_Solo/Asset/UMGTemplate/General_SecondLevelButton_3.uasset new file mode 100644 index 00000000..1a5b3b88 Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/General_SecondLevelButton_3.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/General_Shop/General_Currency_UIBP.uasset b/CounterAttack_Solo/Asset/UMGTemplate/General_Shop/General_Currency_UIBP.uasset new file mode 100644 index 00000000..fde9e1b7 Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/General_Shop/General_Currency_UIBP.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/General_Shop/General_ShopItem_UIBP.uasset b/CounterAttack_Solo/Asset/UMGTemplate/General_Shop/General_ShopItem_UIBP.uasset new file mode 100644 index 00000000..ea9b1a19 Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/General_Shop/General_ShopItem_UIBP.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/General_Shop/General_ShopMain_UIBP.uasset b/CounterAttack_Solo/Asset/UMGTemplate/General_Shop/General_ShopMain_UIBP.uasset new file mode 100644 index 00000000..b71c872c Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/General_Shop/General_ShopMain_UIBP.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/General_Shop/General_ShopPlay_UIBP.uasset b/CounterAttack_Solo/Asset/UMGTemplate/General_Shop/General_ShopPlay_UIBP.uasset new file mode 100644 index 00000000..cdc1c6e0 Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/General_Shop/General_ShopPlay_UIBP.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/General_Shop/General_ShopPreviewItem_UIBP.uasset b/CounterAttack_Solo/Asset/UMGTemplate/General_Shop/General_ShopPreviewItem_UIBP.uasset new file mode 100644 index 00000000..a7ed8089 Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/General_Shop/General_ShopPreviewItem_UIBP.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/General_SlideModeButton.uasset b/CounterAttack_Solo/Asset/UMGTemplate/General_SlideModeButton.uasset new file mode 100644 index 00000000..74c6b694 Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/General_SlideModeButton.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/General_SwitchButton.uasset b/CounterAttack_Solo/Asset/UMGTemplate/General_SwitchButton.uasset new file mode 100644 index 00000000..32972add Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/General_SwitchButton.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/General_TMode_Discard_UIBP.uasset b/CounterAttack_Solo/Asset/UMGTemplate/General_TMode_Discard_UIBP.uasset new file mode 100644 index 00000000..b8ccabb3 Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/General_TMode_Discard_UIBP.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/General_Team_ScoreBoard_UIBP.uasset b/CounterAttack_Solo/Asset/UMGTemplate/General_Team_ScoreBoard_UIBP.uasset new file mode 100644 index 00000000..72d67c40 Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/General_Team_ScoreBoard_UIBP.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/Peekaboo/Peekaboo_EditLocation.uasset b/CounterAttack_Solo/Asset/UMGTemplate/Peekaboo/Peekaboo_EditLocation.uasset new file mode 100644 index 00000000..a518dd14 Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/Peekaboo/Peekaboo_EditLocation.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/Peekaboo/Peekaboo_ItemSelect.uasset b/CounterAttack_Solo/Asset/UMGTemplate/Peekaboo/Peekaboo_ItemSelect.uasset new file mode 100644 index 00000000..b45c508a Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/Peekaboo/Peekaboo_ItemSelect.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/Peekaboo/Peekaboo_ItemSelect_UIBP.uasset b/CounterAttack_Solo/Asset/UMGTemplate/Peekaboo/Peekaboo_ItemSelect_UIBP.uasset new file mode 100644 index 00000000..5c64a050 Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/Peekaboo/Peekaboo_ItemSelect_UIBP.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/Peekaboo/Peekaboo_Main_UIBP.uasset b/CounterAttack_Solo/Asset/UMGTemplate/Peekaboo/Peekaboo_Main_UIBP.uasset new file mode 100644 index 00000000..d94b6956 Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/Peekaboo/Peekaboo_Main_UIBP.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/Peekaboo/Peekaboo_Playerlist_UIBP.uasset b/CounterAttack_Solo/Asset/UMGTemplate/Peekaboo/Peekaboo_Playerlist_UIBP.uasset new file mode 100644 index 00000000..468443e3 Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/Peekaboo/Peekaboo_Playerlist_UIBP.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/Peekaboo/Peekaboo_PropsItem.uasset b/CounterAttack_Solo/Asset/UMGTemplate/Peekaboo/Peekaboo_PropsItem.uasset new file mode 100644 index 00000000..c0c64920 Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/Peekaboo/Peekaboo_PropsItem.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/Peekaboo/Peekaboo_Props_UIBP.uasset b/CounterAttack_Solo/Asset/UMGTemplate/Peekaboo/Peekaboo_Props_UIBP.uasset new file mode 100644 index 00000000..1747d6c6 Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/Peekaboo/Peekaboo_Props_UIBP.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/Peekaboo/Peekaboo_Settlement_UIBP.uasset b/CounterAttack_Solo/Asset/UMGTemplate/Peekaboo/Peekaboo_Settlement_UIBP.uasset new file mode 100644 index 00000000..d8581ccf Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/Peekaboo/Peekaboo_Settlement_UIBP.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/ReuseList2.uasset b/CounterAttack_Solo/Asset/UMGTemplate/ReuseList2.uasset new file mode 100644 index 00000000..c36db5a6 Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/ReuseList2.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/Settlement/Common_RankTitleInfo_UIBP.uasset b/CounterAttack_Solo/Asset/UMGTemplate/Settlement/Common_RankTitleInfo_UIBP.uasset new file mode 100644 index 00000000..0bb8aa9c Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/Settlement/Common_RankTitleInfo_UIBP.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/Settlement/General_BattleDataList_UIBP.uasset b/CounterAttack_Solo/Asset/UMGTemplate/Settlement/General_BattleDataList_UIBP.uasset new file mode 100644 index 00000000..7c7f1fea Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/Settlement/General_BattleDataList_UIBP.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/Settlement/General_BattleDetail_UIBP.uasset b/CounterAttack_Solo/Asset/UMGTemplate/Settlement/General_BattleDetail_UIBP.uasset new file mode 100644 index 00000000..9e434861 Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/Settlement/General_BattleDetail_UIBP.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/Settlement/General_ListDataBG_UIBP.uasset b/CounterAttack_Solo/Asset/UMGTemplate/Settlement/General_ListDataBG_UIBP.uasset new file mode 100644 index 00000000..c11e092d Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/Settlement/General_ListDataBG_UIBP.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/Settlement/General_Team_ModeList_UIBP.uasset b/CounterAttack_Solo/Asset/UMGTemplate/Settlement/General_Team_ModeList_UIBP.uasset new file mode 100644 index 00000000..e151d1f9 Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/Settlement/General_Team_ModeList_UIBP.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/Settlement/General_Team_ModeMain_UIBP.uasset b/CounterAttack_Solo/Asset/UMGTemplate/Settlement/General_Team_ModeMain_UIBP.uasset new file mode 100644 index 00000000..85f0aac2 Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/Settlement/General_Team_ModeMain_UIBP.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/Settlement/General_TitleBattleDetail_UIBP.uasset b/CounterAttack_Solo/Asset/UMGTemplate/Settlement/General_TitleBattleDetail_UIBP.uasset new file mode 100644 index 00000000..3caa56f5 Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/Settlement/General_TitleBattleDetail_UIBP.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/Settlement/General_TopBG_UIBP.uasset b/CounterAttack_Solo/Asset/UMGTemplate/Settlement/General_TopBG_UIBP.uasset new file mode 100644 index 00000000..0c00fdb0 Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/Settlement/General_TopBG_UIBP.uasset differ diff --git a/CounterAttack_Solo/Asset/UMGTemplate/UGC_DragDropTextBox.uasset b/CounterAttack_Solo/Asset/UMGTemplate/UGC_DragDropTextBox.uasset new file mode 100644 index 00000000..d27a8a72 Binary files /dev/null and b/CounterAttack_Solo/Asset/UMGTemplate/UGC_DragDropTextBox.uasset differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/1043622604.wem b/CounterAttack_Solo/Asset/WwiseAudio/Android/1043622604.wem new file mode 100644 index 00000000..6cb65ff8 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/1043622604.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/1059175069.wem b/CounterAttack_Solo/Asset/WwiseAudio/Android/1059175069.wem new file mode 100644 index 00000000..1fc3e541 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/1059175069.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/1083967019.wem b/CounterAttack_Solo/Asset/WwiseAudio/Android/1083967019.wem new file mode 100644 index 00000000..69d394ad Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/1083967019.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/1135185130.wem b/CounterAttack_Solo/Asset/WwiseAudio/Android/1135185130.wem new file mode 100644 index 00000000..f15f2a3d Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/1135185130.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/1197549547.wem b/CounterAttack_Solo/Asset/WwiseAudio/Android/1197549547.wem new file mode 100644 index 00000000..c00b88c8 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/1197549547.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/123644934.wem b/CounterAttack_Solo/Asset/WwiseAudio/Android/123644934.wem new file mode 100644 index 00000000..4cdd7275 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/123644934.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/1249032671.wem b/CounterAttack_Solo/Asset/WwiseAudio/Android/1249032671.wem new file mode 100644 index 00000000..607ea5a3 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/1249032671.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/1309698560.wem b/CounterAttack_Solo/Asset/WwiseAudio/Android/1309698560.wem new file mode 100644 index 00000000..e9eabde0 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/1309698560.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/1338909056.wem b/CounterAttack_Solo/Asset/WwiseAudio/Android/1338909056.wem new file mode 100644 index 00000000..7fb0209f Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/1338909056.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/14916143.wem b/CounterAttack_Solo/Asset/WwiseAudio/Android/14916143.wem new file mode 100644 index 00000000..50c1d55d Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/14916143.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/1511312261.wem b/CounterAttack_Solo/Asset/WwiseAudio/Android/1511312261.wem new file mode 100644 index 00000000..0ee2ac62 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/1511312261.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/1596251344.wem b/CounterAttack_Solo/Asset/WwiseAudio/Android/1596251344.wem new file mode 100644 index 00000000..4c386262 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/1596251344.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/1610960512.wem b/CounterAttack_Solo/Asset/WwiseAudio/Android/1610960512.wem new file mode 100644 index 00000000..6ccddceb Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/1610960512.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/1618221938.wem b/CounterAttack_Solo/Asset/WwiseAudio/Android/1618221938.wem new file mode 100644 index 00000000..51f1b198 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/1618221938.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/1775607217.wem b/CounterAttack_Solo/Asset/WwiseAudio/Android/1775607217.wem new file mode 100644 index 00000000..70e34a3a Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/1775607217.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/1821890432.wem b/CounterAttack_Solo/Asset/WwiseAudio/Android/1821890432.wem new file mode 100644 index 00000000..2ecd2110 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/1821890432.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/1855839025.wem b/CounterAttack_Solo/Asset/WwiseAudio/Android/1855839025.wem new file mode 100644 index 00000000..822f274d Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/1855839025.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/2122052456.wem b/CounterAttack_Solo/Asset/WwiseAudio/Android/2122052456.wem new file mode 100644 index 00000000..71d695fa Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/2122052456.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/305580894.wem b/CounterAttack_Solo/Asset/WwiseAudio/Android/305580894.wem new file mode 100644 index 00000000..41f9abfc Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/305580894.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/60081012.wem b/CounterAttack_Solo/Asset/WwiseAudio/Android/60081012.wem new file mode 100644 index 00000000..b01f05d8 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/60081012.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/618530496.wem b/CounterAttack_Solo/Asset/WwiseAudio/Android/618530496.wem new file mode 100644 index 00000000..9054f0c4 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/618530496.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/662016016.wem b/CounterAttack_Solo/Asset/WwiseAudio/Android/662016016.wem new file mode 100644 index 00000000..c2b941df Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/662016016.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/704584030.wem b/CounterAttack_Solo/Asset/WwiseAudio/Android/704584030.wem new file mode 100644 index 00000000..bdbb3416 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/704584030.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/779352500.wem b/CounterAttack_Solo/Asset/WwiseAudio/Android/779352500.wem new file mode 100644 index 00000000..83865207 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/779352500.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/791945165.wem b/CounterAttack_Solo/Asset/WwiseAudio/Android/791945165.wem new file mode 100644 index 00000000..cafe2987 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/791945165.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/888850463.wem b/CounterAttack_Solo/Asset/WwiseAudio/Android/888850463.wem new file mode 100644 index 00000000..25e54277 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/888850463.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/897535424.wem b/CounterAttack_Solo/Asset/WwiseAudio/Android/897535424.wem new file mode 100644 index 00000000..6323d6c7 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/897535424.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/986701760.wem b/CounterAttack_Solo/Asset/WwiseAudio/Android/986701760.wem new file mode 100644 index 00000000..185c2a8f Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/986701760.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/989188288.wem b/CounterAttack_Solo/Asset/WwiseAudio/Android/989188288.wem new file mode 100644 index 00000000..f283a822 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/989188288.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_ActiveMechanism_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_ActiveMechanism_1.bnk new file mode 100644 index 00000000..2eb22324 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_ActiveMechanism_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_AddScore_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_AddScore_1.bnk new file mode 100644 index 00000000..861ed986 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_AddScore_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Boom2_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Boom2_1.bnk new file mode 100644 index 00000000..7d974de1 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Boom2_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_BreakWind_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_BreakWind_1.bnk new file mode 100644 index 00000000..52bd3647 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_BreakWind_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Btn_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Btn_1.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Btn_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Btn_2.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Btn_2.bnk new file mode 100644 index 00000000..b773583e Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Btn_2.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Button_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Button_1.bnk new file mode 100644 index 00000000..4251845d Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Button_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Buy_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Buy_1.bnk new file mode 100644 index 00000000..7108e1e6 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Buy_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Click_2_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Click_2_1.bnk new file mode 100644 index 00000000..a36cc4df Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Click_2_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Click_2_2.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Click_2_2.bnk new file mode 100644 index 00000000..eddc6e1f Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Click_2_2.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Dissipate_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Dissipate_1.bnk new file mode 100644 index 00000000..dda39f6b Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Dissipate_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Error_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Error_1.bnk new file mode 100644 index 00000000..5f81a354 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Error_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_GameStart_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_GameStart_1.bnk new file mode 100644 index 00000000..58f9584d Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_GameStart_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Impact_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Impact_1.bnk new file mode 100644 index 00000000..dcd435a8 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Impact_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_IsReady_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_IsReady_1.bnk new file mode 100644 index 00000000..5db12f4e Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_IsReady_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Kill2_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Kill2_1.bnk new file mode 100644 index 00000000..efa5f565 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Kill2_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Kill3_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Kill3_1.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Kill3_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Launch_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Launch_1.bnk new file mode 100644 index 00000000..1c4a26df Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Launch_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_MechanismKill_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_MechanismKill_1.bnk new file mode 100644 index 00000000..bc7487a8 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_MechanismKill_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_OkLetsGo_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_OkLetsGo_1.bnk new file mode 100644 index 00000000..540a3d17 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_OkLetsGo_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_OpenDoor_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_OpenDoor_1.bnk new file mode 100644 index 00000000..9d559116 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_OpenDoor_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_PU_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_PU_1.bnk new file mode 100644 index 00000000..95173f90 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_PU_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Piano_2ddd_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Piano_2ddd_1.bnk new file mode 100644 index 00000000..8dc6a4ae Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Piano_2ddd_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Piano_3dd_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Piano_3dd_1.bnk new file mode 100644 index 00000000..09b04e83 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Piano_3dd_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Piano_6dd_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Piano_6dd_1.bnk new file mode 100644 index 00000000..0f62e5f7 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Piano_6dd_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_PickUpBuff_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_PickUpBuff_1.bnk new file mode 100644 index 00000000..6df34dbe Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_PickUpBuff_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Point_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Point_1.bnk new file mode 100644 index 00000000..c02f8bc9 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Point_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Right_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Right_1.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Right_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Star_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Star_1.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Star_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Tip_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Tip_1.bnk new file mode 100644 index 00000000..25f6f4bf Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/AK_Tip_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/Ak_HookFire_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Android/Ak_HookFire_1.bnk new file mode 100644 index 00000000..f34d649a Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/Ak_HookFire_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/Ak_HookImpulse_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Android/Ak_HookImpulse_1.bnk new file mode 100644 index 00000000..065e31b1 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/Ak_HookImpulse_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/Ak_Impulse_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Android/Ak_Impulse_1.bnk new file mode 100644 index 00000000..82ba802f Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/Ak_Impulse_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/Audio_Guitar_So.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Android/Audio_Guitar_So.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/Audio_Guitar_So.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/Audio_Guitar_So_1_5_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Android/Audio_Guitar_So_1_5_1.bnk new file mode 100644 index 00000000..7bf440c6 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/Audio_Guitar_So_1_5_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/Audio_Guitar_So_1_5_2.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Android/Audio_Guitar_So_1_5_2.bnk new file mode 100644 index 00000000..e9dadb9c Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/Audio_Guitar_So_1_5_2.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/Audio_Kill_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Android/Audio_Kill_1.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/Audio_Kill_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/Audio_Kill_2.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Android/Audio_Kill_2.bnk new file mode 100644 index 00000000..c4e0c1be Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/Audio_Kill_2.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/T_Clock_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Android/T_Clock_1.bnk new file mode 100644 index 00000000..38f52cf4 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/T_Clock_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Android/UGC_Ambience_3D_Template_edit.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Android/UGC_Ambience_3D_Template_edit.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Android/UGC_Ambience_3D_Template_edit.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1043622604.wem b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1043622604.wem new file mode 100644 index 00000000..6cb65ff8 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1043622604.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1059175069.wem b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1059175069.wem new file mode 100644 index 00000000..1fc3e541 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1059175069.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1083967019.wem b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1083967019.wem new file mode 100644 index 00000000..69d394ad Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1083967019.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1135185130.wem b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1135185130.wem new file mode 100644 index 00000000..f15f2a3d Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1135185130.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1197549547.wem b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1197549547.wem new file mode 100644 index 00000000..c00b88c8 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1197549547.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/123644934.wem b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/123644934.wem new file mode 100644 index 00000000..4cdd7275 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/123644934.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1249032671.wem b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1249032671.wem new file mode 100644 index 00000000..607ea5a3 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1249032671.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1309698560.wem b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1309698560.wem new file mode 100644 index 00000000..e9eabde0 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1309698560.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1338909056.wem b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1338909056.wem new file mode 100644 index 00000000..7fb0209f Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1338909056.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/14916143.wem b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/14916143.wem new file mode 100644 index 00000000..50c1d55d Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/14916143.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1511312261.wem b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1511312261.wem new file mode 100644 index 00000000..0ee2ac62 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1511312261.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1596251344.wem b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1596251344.wem new file mode 100644 index 00000000..4c386262 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1596251344.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1610960512.wem b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1610960512.wem new file mode 100644 index 00000000..6ccddceb Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1610960512.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1618221938.wem b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1618221938.wem new file mode 100644 index 00000000..51f1b198 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1618221938.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1775607217.wem b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1775607217.wem new file mode 100644 index 00000000..70e34a3a Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1775607217.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1821890432.wem b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1821890432.wem new file mode 100644 index 00000000..2ecd2110 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1821890432.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1855839025.wem b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1855839025.wem new file mode 100644 index 00000000..822f274d Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/1855839025.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/2122052456.wem b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/2122052456.wem new file mode 100644 index 00000000..71d695fa Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/2122052456.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/305580894.wem b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/305580894.wem new file mode 100644 index 00000000..41f9abfc Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/305580894.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/60081012.wem b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/60081012.wem new file mode 100644 index 00000000..b01f05d8 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/60081012.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/618530496.wem b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/618530496.wem new file mode 100644 index 00000000..9054f0c4 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/618530496.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/662016016.wem b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/662016016.wem new file mode 100644 index 00000000..c2b941df Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/662016016.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/704584030.wem b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/704584030.wem new file mode 100644 index 00000000..bdbb3416 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/704584030.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/779352500.wem b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/779352500.wem new file mode 100644 index 00000000..83865207 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/779352500.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/791945165.wem b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/791945165.wem new file mode 100644 index 00000000..cafe2987 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/791945165.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/888850463.wem b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/888850463.wem new file mode 100644 index 00000000..25e54277 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/888850463.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/897535424.wem b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/897535424.wem new file mode 100644 index 00000000..6323d6c7 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/897535424.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/986701760.wem b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/986701760.wem new file mode 100644 index 00000000..185c2a8f Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/986701760.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/989188288.wem b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/989188288.wem new file mode 100644 index 00000000..f283a822 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/989188288.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_ActiveMechanism_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_ActiveMechanism_1.bnk new file mode 100644 index 00000000..2eb22324 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_ActiveMechanism_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_AddScore_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_AddScore_1.bnk new file mode 100644 index 00000000..861ed986 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_AddScore_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Boom2_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Boom2_1.bnk new file mode 100644 index 00000000..7d974de1 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Boom2_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_BreakWind_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_BreakWind_1.bnk new file mode 100644 index 00000000..52bd3647 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_BreakWind_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Btn_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Btn_1.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Btn_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Btn_2.bnk b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Btn_2.bnk new file mode 100644 index 00000000..b773583e Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Btn_2.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Button_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Button_1.bnk new file mode 100644 index 00000000..4251845d Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Button_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Buy_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Buy_1.bnk new file mode 100644 index 00000000..7108e1e6 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Buy_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Click_2_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Click_2_1.bnk new file mode 100644 index 00000000..a36cc4df Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Click_2_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Click_2_2.bnk b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Click_2_2.bnk new file mode 100644 index 00000000..eddc6e1f Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Click_2_2.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Dissipate_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Dissipate_1.bnk new file mode 100644 index 00000000..dda39f6b Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Dissipate_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Error_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Error_1.bnk new file mode 100644 index 00000000..5f81a354 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Error_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_GameStart_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_GameStart_1.bnk new file mode 100644 index 00000000..58f9584d Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_GameStart_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Impact_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Impact_1.bnk new file mode 100644 index 00000000..dcd435a8 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Impact_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_IsReady_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_IsReady_1.bnk new file mode 100644 index 00000000..5db12f4e Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_IsReady_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Kill2_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Kill2_1.bnk new file mode 100644 index 00000000..efa5f565 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Kill2_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Kill3_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Kill3_1.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Kill3_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Launch_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Launch_1.bnk new file mode 100644 index 00000000..1c4a26df Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Launch_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_MechanismKill_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_MechanismKill_1.bnk new file mode 100644 index 00000000..bc7487a8 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_MechanismKill_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_OkLetsGo_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_OkLetsGo_1.bnk new file mode 100644 index 00000000..540a3d17 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_OkLetsGo_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_OpenDoor_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_OpenDoor_1.bnk new file mode 100644 index 00000000..9d559116 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_OpenDoor_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_PU_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_PU_1.bnk new file mode 100644 index 00000000..95173f90 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_PU_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Piano_2ddd_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Piano_2ddd_1.bnk new file mode 100644 index 00000000..8dc6a4ae Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Piano_2ddd_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Piano_3dd_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Piano_3dd_1.bnk new file mode 100644 index 00000000..09b04e83 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Piano_3dd_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Piano_6dd_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Piano_6dd_1.bnk new file mode 100644 index 00000000..0f62e5f7 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Piano_6dd_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_PickUpBuff_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_PickUpBuff_1.bnk new file mode 100644 index 00000000..6df34dbe Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_PickUpBuff_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Point_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Point_1.bnk new file mode 100644 index 00000000..c02f8bc9 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Point_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Right_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Right_1.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Right_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Star_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Star_1.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Star_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Tip_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Tip_1.bnk new file mode 100644 index 00000000..25f6f4bf Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/AK_Tip_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/Ak_HookFire_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/Ak_HookFire_1.bnk new file mode 100644 index 00000000..f34d649a Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/Ak_HookFire_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/Ak_HookImpulse_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/Ak_HookImpulse_1.bnk new file mode 100644 index 00000000..065e31b1 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/Ak_HookImpulse_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/Ak_Impulse_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/Ak_Impulse_1.bnk new file mode 100644 index 00000000..82ba802f Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/Ak_Impulse_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/Audio_Guitar_So.bnk b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/Audio_Guitar_So.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/Audio_Guitar_So.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/Audio_Guitar_So_1_5_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/Audio_Guitar_So_1_5_1.bnk new file mode 100644 index 00000000..7bf440c6 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/Audio_Guitar_So_1_5_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/Audio_Guitar_So_1_5_2.bnk b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/Audio_Guitar_So_1_5_2.bnk new file mode 100644 index 00000000..e9dadb9c Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/Audio_Guitar_So_1_5_2.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/Audio_Kill_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/Audio_Kill_1.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/Audio_Kill_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/Audio_Kill_2.bnk b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/Audio_Kill_2.bnk new file mode 100644 index 00000000..c4e0c1be Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/Audio_Kill_2.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/T_Clock_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/T_Clock_1.bnk new file mode 100644 index 00000000..38f52cf4 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/T_Clock_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/UGC_Ambience_3D_Template_edit.bnk b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/UGC_Ambience_3D_Template_edit.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/OpenHarmony/UGC_Ambience_3D_Template_edit.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/1043622604.wem b/CounterAttack_Solo/Asset/WwiseAudio/Windows/1043622604.wem new file mode 100644 index 00000000..6cb65ff8 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/1043622604.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/1059175069.wem b/CounterAttack_Solo/Asset/WwiseAudio/Windows/1059175069.wem new file mode 100644 index 00000000..1fc3e541 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/1059175069.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/1083967019.wem b/CounterAttack_Solo/Asset/WwiseAudio/Windows/1083967019.wem new file mode 100644 index 00000000..69d394ad Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/1083967019.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/1135185130.wem b/CounterAttack_Solo/Asset/WwiseAudio/Windows/1135185130.wem new file mode 100644 index 00000000..f15f2a3d Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/1135185130.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/1197549547.wem b/CounterAttack_Solo/Asset/WwiseAudio/Windows/1197549547.wem new file mode 100644 index 00000000..c00b88c8 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/1197549547.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/123644934.wem b/CounterAttack_Solo/Asset/WwiseAudio/Windows/123644934.wem new file mode 100644 index 00000000..4cdd7275 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/123644934.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/1249032671.wem b/CounterAttack_Solo/Asset/WwiseAudio/Windows/1249032671.wem new file mode 100644 index 00000000..607ea5a3 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/1249032671.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/1309698560.wem b/CounterAttack_Solo/Asset/WwiseAudio/Windows/1309698560.wem new file mode 100644 index 00000000..e9eabde0 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/1309698560.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/1338909056.wem b/CounterAttack_Solo/Asset/WwiseAudio/Windows/1338909056.wem new file mode 100644 index 00000000..7fb0209f Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/1338909056.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/14916143.wem b/CounterAttack_Solo/Asset/WwiseAudio/Windows/14916143.wem new file mode 100644 index 00000000..50c1d55d Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/14916143.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/1511312261.wem b/CounterAttack_Solo/Asset/WwiseAudio/Windows/1511312261.wem new file mode 100644 index 00000000..0ee2ac62 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/1511312261.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/1596251344.wem b/CounterAttack_Solo/Asset/WwiseAudio/Windows/1596251344.wem new file mode 100644 index 00000000..4c386262 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/1596251344.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/1610960512.wem b/CounterAttack_Solo/Asset/WwiseAudio/Windows/1610960512.wem new file mode 100644 index 00000000..6ccddceb Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/1610960512.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/1618221938.wem b/CounterAttack_Solo/Asset/WwiseAudio/Windows/1618221938.wem new file mode 100644 index 00000000..51f1b198 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/1618221938.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/1775607217.wem b/CounterAttack_Solo/Asset/WwiseAudio/Windows/1775607217.wem new file mode 100644 index 00000000..70e34a3a Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/1775607217.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/1821890432.wem b/CounterAttack_Solo/Asset/WwiseAudio/Windows/1821890432.wem new file mode 100644 index 00000000..2ecd2110 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/1821890432.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/1855839025.wem b/CounterAttack_Solo/Asset/WwiseAudio/Windows/1855839025.wem new file mode 100644 index 00000000..822f274d Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/1855839025.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/2122052456.wem b/CounterAttack_Solo/Asset/WwiseAudio/Windows/2122052456.wem new file mode 100644 index 00000000..71d695fa Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/2122052456.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/305580894.wem b/CounterAttack_Solo/Asset/WwiseAudio/Windows/305580894.wem new file mode 100644 index 00000000..41f9abfc Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/305580894.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/60081012.wem b/CounterAttack_Solo/Asset/WwiseAudio/Windows/60081012.wem new file mode 100644 index 00000000..b01f05d8 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/60081012.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/618530496.wem b/CounterAttack_Solo/Asset/WwiseAudio/Windows/618530496.wem new file mode 100644 index 00000000..9054f0c4 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/618530496.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/662016016.wem b/CounterAttack_Solo/Asset/WwiseAudio/Windows/662016016.wem new file mode 100644 index 00000000..c2b941df Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/662016016.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/704584030.wem b/CounterAttack_Solo/Asset/WwiseAudio/Windows/704584030.wem new file mode 100644 index 00000000..bdbb3416 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/704584030.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/779352500.wem b/CounterAttack_Solo/Asset/WwiseAudio/Windows/779352500.wem new file mode 100644 index 00000000..83865207 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/779352500.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/791945165.wem b/CounterAttack_Solo/Asset/WwiseAudio/Windows/791945165.wem new file mode 100644 index 00000000..cafe2987 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/791945165.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/888850463.wem b/CounterAttack_Solo/Asset/WwiseAudio/Windows/888850463.wem new file mode 100644 index 00000000..25e54277 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/888850463.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/897535424.wem b/CounterAttack_Solo/Asset/WwiseAudio/Windows/897535424.wem new file mode 100644 index 00000000..6323d6c7 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/897535424.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/986701760.wem b/CounterAttack_Solo/Asset/WwiseAudio/Windows/986701760.wem new file mode 100644 index 00000000..185c2a8f Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/986701760.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/989188288.wem b/CounterAttack_Solo/Asset/WwiseAudio/Windows/989188288.wem new file mode 100644 index 00000000..f283a822 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/989188288.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_ActiveMechanism_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_ActiveMechanism_1.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_ActiveMechanism_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_AddScore_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_AddScore_1.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_AddScore_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Boom2_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Boom2_1.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Boom2_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_BreakWind_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_BreakWind_1.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_BreakWind_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Btn_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Btn_1.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Btn_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Btn_2.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Btn_2.bnk new file mode 100644 index 00000000..c237eddf Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Btn_2.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Button_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Button_1.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Button_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Buy_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Buy_1.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Buy_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Click_2_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Click_2_1.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Click_2_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Click_2_2.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Click_2_2.bnk new file mode 100644 index 00000000..bba90c61 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Click_2_2.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Dissipate_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Dissipate_1.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Dissipate_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Error_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Error_1.bnk new file mode 100644 index 00000000..5f81a354 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Error_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_GameStart_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_GameStart_1.bnk new file mode 100644 index 00000000..58f9584d Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_GameStart_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Impact_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Impact_1.bnk new file mode 100644 index 00000000..dcd435a8 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Impact_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_IsReady_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_IsReady_1.bnk new file mode 100644 index 00000000..5db12f4e Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_IsReady_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Kill2_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Kill2_1.bnk new file mode 100644 index 00000000..efa5f565 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Kill2_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Kill3_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Kill3_1.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Kill3_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Launch_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Launch_1.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Launch_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_MechanismKill_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_MechanismKill_1.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_MechanismKill_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_OkLetsGo_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_OkLetsGo_1.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_OkLetsGo_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_OpenDoor_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_OpenDoor_1.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_OpenDoor_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_PU_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_PU_1.bnk new file mode 100644 index 00000000..95173f90 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_PU_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Piano_2ddd_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Piano_2ddd_1.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Piano_2ddd_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Piano_3dd_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Piano_3dd_1.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Piano_3dd_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Piano_6dd_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Piano_6dd_1.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Piano_6dd_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_PickUpBuff_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_PickUpBuff_1.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_PickUpBuff_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Point_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Point_1.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Point_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Right_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Right_1.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Right_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Star_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Star_1.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Star_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Tip_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Tip_1.bnk new file mode 100644 index 00000000..cf2cea22 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/AK_Tip_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/Ak_HookFire_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Windows/Ak_HookFire_1.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/Ak_HookFire_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/Ak_HookImpulse_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Windows/Ak_HookImpulse_1.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/Ak_HookImpulse_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/Ak_Impulse_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Windows/Ak_Impulse_1.bnk new file mode 100644 index 00000000..82ba802f Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/Ak_Impulse_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/Audio_Guitar_So.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Windows/Audio_Guitar_So.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/Audio_Guitar_So.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/Audio_Guitar_So_1_5_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Windows/Audio_Guitar_So_1_5_1.bnk new file mode 100644 index 00000000..7bf440c6 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/Audio_Guitar_So_1_5_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/Audio_Guitar_So_1_5_2.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Windows/Audio_Guitar_So_1_5_2.bnk new file mode 100644 index 00000000..e9dadb9c Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/Audio_Guitar_So_1_5_2.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/Audio_Kill_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Windows/Audio_Kill_1.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/Audio_Kill_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/Audio_Kill_2.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Windows/Audio_Kill_2.bnk new file mode 100644 index 00000000..ebbc719a Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/Audio_Kill_2.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/T_Clock_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Windows/T_Clock_1.bnk new file mode 100644 index 00000000..38f52cf4 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/T_Clock_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/Windows/UGC_Ambience_3D_Template_edit.bnk b/CounterAttack_Solo/Asset/WwiseAudio/Windows/UGC_Ambience_3D_Template_edit.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/Windows/UGC_Ambience_3D_Template_edit.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/1043622604.wem b/CounterAttack_Solo/Asset/WwiseAudio/iOS/1043622604.wem new file mode 100644 index 00000000..6cb65ff8 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/1043622604.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/1059175069.wem b/CounterAttack_Solo/Asset/WwiseAudio/iOS/1059175069.wem new file mode 100644 index 00000000..1fc3e541 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/1059175069.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/1083967019.wem b/CounterAttack_Solo/Asset/WwiseAudio/iOS/1083967019.wem new file mode 100644 index 00000000..69d394ad Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/1083967019.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/1135185130.wem b/CounterAttack_Solo/Asset/WwiseAudio/iOS/1135185130.wem new file mode 100644 index 00000000..f15f2a3d Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/1135185130.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/1197549547.wem b/CounterAttack_Solo/Asset/WwiseAudio/iOS/1197549547.wem new file mode 100644 index 00000000..c00b88c8 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/1197549547.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/123644934.wem b/CounterAttack_Solo/Asset/WwiseAudio/iOS/123644934.wem new file mode 100644 index 00000000..4cdd7275 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/123644934.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/1249032671.wem b/CounterAttack_Solo/Asset/WwiseAudio/iOS/1249032671.wem new file mode 100644 index 00000000..607ea5a3 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/1249032671.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/1309698560.wem b/CounterAttack_Solo/Asset/WwiseAudio/iOS/1309698560.wem new file mode 100644 index 00000000..e9eabde0 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/1309698560.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/1338909056.wem b/CounterAttack_Solo/Asset/WwiseAudio/iOS/1338909056.wem new file mode 100644 index 00000000..7fb0209f Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/1338909056.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/14916143.wem b/CounterAttack_Solo/Asset/WwiseAudio/iOS/14916143.wem new file mode 100644 index 00000000..50c1d55d Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/14916143.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/1511312261.wem b/CounterAttack_Solo/Asset/WwiseAudio/iOS/1511312261.wem new file mode 100644 index 00000000..0ee2ac62 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/1511312261.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/1596251344.wem b/CounterAttack_Solo/Asset/WwiseAudio/iOS/1596251344.wem new file mode 100644 index 00000000..4c386262 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/1596251344.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/1610960512.wem b/CounterAttack_Solo/Asset/WwiseAudio/iOS/1610960512.wem new file mode 100644 index 00000000..6ccddceb Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/1610960512.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/1618221938.wem b/CounterAttack_Solo/Asset/WwiseAudio/iOS/1618221938.wem new file mode 100644 index 00000000..51f1b198 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/1618221938.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/1775607217.wem b/CounterAttack_Solo/Asset/WwiseAudio/iOS/1775607217.wem new file mode 100644 index 00000000..70e34a3a Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/1775607217.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/1821890432.wem b/CounterAttack_Solo/Asset/WwiseAudio/iOS/1821890432.wem new file mode 100644 index 00000000..2ecd2110 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/1821890432.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/1855839025.wem b/CounterAttack_Solo/Asset/WwiseAudio/iOS/1855839025.wem new file mode 100644 index 00000000..822f274d Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/1855839025.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/2122052456.wem b/CounterAttack_Solo/Asset/WwiseAudio/iOS/2122052456.wem new file mode 100644 index 00000000..71d695fa Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/2122052456.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/305580894.wem b/CounterAttack_Solo/Asset/WwiseAudio/iOS/305580894.wem new file mode 100644 index 00000000..41f9abfc Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/305580894.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/60081012.wem b/CounterAttack_Solo/Asset/WwiseAudio/iOS/60081012.wem new file mode 100644 index 00000000..b01f05d8 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/60081012.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/618530496.wem b/CounterAttack_Solo/Asset/WwiseAudio/iOS/618530496.wem new file mode 100644 index 00000000..9054f0c4 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/618530496.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/662016016.wem b/CounterAttack_Solo/Asset/WwiseAudio/iOS/662016016.wem new file mode 100644 index 00000000..c2b941df Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/662016016.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/704584030.wem b/CounterAttack_Solo/Asset/WwiseAudio/iOS/704584030.wem new file mode 100644 index 00000000..bdbb3416 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/704584030.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/779352500.wem b/CounterAttack_Solo/Asset/WwiseAudio/iOS/779352500.wem new file mode 100644 index 00000000..83865207 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/779352500.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/791945165.wem b/CounterAttack_Solo/Asset/WwiseAudio/iOS/791945165.wem new file mode 100644 index 00000000..cafe2987 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/791945165.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/888850463.wem b/CounterAttack_Solo/Asset/WwiseAudio/iOS/888850463.wem new file mode 100644 index 00000000..25e54277 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/888850463.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/897535424.wem b/CounterAttack_Solo/Asset/WwiseAudio/iOS/897535424.wem new file mode 100644 index 00000000..6323d6c7 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/897535424.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/986701760.wem b/CounterAttack_Solo/Asset/WwiseAudio/iOS/986701760.wem new file mode 100644 index 00000000..185c2a8f Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/986701760.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/989188288.wem b/CounterAttack_Solo/Asset/WwiseAudio/iOS/989188288.wem new file mode 100644 index 00000000..f283a822 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/989188288.wem differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_ActiveMechanism_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_ActiveMechanism_1.bnk new file mode 100644 index 00000000..2eb22324 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_ActiveMechanism_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_AddScore_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_AddScore_1.bnk new file mode 100644 index 00000000..861ed986 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_AddScore_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Boom2_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Boom2_1.bnk new file mode 100644 index 00000000..7d974de1 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Boom2_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_BreakWind_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_BreakWind_1.bnk new file mode 100644 index 00000000..52bd3647 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_BreakWind_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Btn_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Btn_1.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Btn_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Btn_2.bnk b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Btn_2.bnk new file mode 100644 index 00000000..b773583e Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Btn_2.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Button_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Button_1.bnk new file mode 100644 index 00000000..4251845d Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Button_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Buy_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Buy_1.bnk new file mode 100644 index 00000000..7108e1e6 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Buy_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Click_2_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Click_2_1.bnk new file mode 100644 index 00000000..a36cc4df Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Click_2_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Click_2_2.bnk b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Click_2_2.bnk new file mode 100644 index 00000000..eddc6e1f Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Click_2_2.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Dissipate_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Dissipate_1.bnk new file mode 100644 index 00000000..dda39f6b Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Dissipate_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Error_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Error_1.bnk new file mode 100644 index 00000000..5f81a354 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Error_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_GameStart_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_GameStart_1.bnk new file mode 100644 index 00000000..58f9584d Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_GameStart_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Impact_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Impact_1.bnk new file mode 100644 index 00000000..dcd435a8 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Impact_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_IsReady_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_IsReady_1.bnk new file mode 100644 index 00000000..5db12f4e Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_IsReady_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Kill2_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Kill2_1.bnk new file mode 100644 index 00000000..efa5f565 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Kill2_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Kill3_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Kill3_1.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Kill3_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Launch_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Launch_1.bnk new file mode 100644 index 00000000..1c4a26df Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Launch_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_MechanismKill_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_MechanismKill_1.bnk new file mode 100644 index 00000000..bc7487a8 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_MechanismKill_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_OkLetsGo_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_OkLetsGo_1.bnk new file mode 100644 index 00000000..540a3d17 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_OkLetsGo_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_OpenDoor_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_OpenDoor_1.bnk new file mode 100644 index 00000000..9d559116 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_OpenDoor_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_PU_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_PU_1.bnk new file mode 100644 index 00000000..95173f90 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_PU_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Piano_2ddd_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Piano_2ddd_1.bnk new file mode 100644 index 00000000..8dc6a4ae Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Piano_2ddd_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Piano_3dd_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Piano_3dd_1.bnk new file mode 100644 index 00000000..09b04e83 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Piano_3dd_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Piano_6dd_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Piano_6dd_1.bnk new file mode 100644 index 00000000..0f62e5f7 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Piano_6dd_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_PickUpBuff_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_PickUpBuff_1.bnk new file mode 100644 index 00000000..6df34dbe Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_PickUpBuff_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Point_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Point_1.bnk new file mode 100644 index 00000000..c02f8bc9 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Point_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Right_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Right_1.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Right_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Star_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Star_1.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Star_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Tip_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Tip_1.bnk new file mode 100644 index 00000000..25f6f4bf Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/AK_Tip_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/Ak_HookFire_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/iOS/Ak_HookFire_1.bnk new file mode 100644 index 00000000..f34d649a Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/Ak_HookFire_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/Ak_HookImpulse_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/iOS/Ak_HookImpulse_1.bnk new file mode 100644 index 00000000..065e31b1 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/Ak_HookImpulse_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/Ak_Impulse_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/iOS/Ak_Impulse_1.bnk new file mode 100644 index 00000000..82ba802f Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/Ak_Impulse_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/Audio_Guitar_So.bnk b/CounterAttack_Solo/Asset/WwiseAudio/iOS/Audio_Guitar_So.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/Audio_Guitar_So.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/Audio_Guitar_So_1_5_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/iOS/Audio_Guitar_So_1_5_1.bnk new file mode 100644 index 00000000..7bf440c6 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/Audio_Guitar_So_1_5_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/Audio_Guitar_So_1_5_2.bnk b/CounterAttack_Solo/Asset/WwiseAudio/iOS/Audio_Guitar_So_1_5_2.bnk new file mode 100644 index 00000000..e9dadb9c Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/Audio_Guitar_So_1_5_2.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/Audio_Kill_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/iOS/Audio_Kill_1.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/Audio_Kill_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/Audio_Kill_2.bnk b/CounterAttack_Solo/Asset/WwiseAudio/iOS/Audio_Kill_2.bnk new file mode 100644 index 00000000..c4e0c1be Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/Audio_Kill_2.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/T_Clock_1.bnk b/CounterAttack_Solo/Asset/WwiseAudio/iOS/T_Clock_1.bnk new file mode 100644 index 00000000..38f52cf4 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/T_Clock_1.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseAudio/iOS/UGC_Ambience_3D_Template_edit.bnk b/CounterAttack_Solo/Asset/WwiseAudio/iOS/UGC_Ambience_3D_Template_edit.bnk new file mode 100644 index 00000000..ae2c0962 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseAudio/iOS/UGC_Ambience_3D_Template_edit.bnk differ diff --git a/CounterAttack_Solo/Asset/WwiseEvent/AK_Tip_1.uasset b/CounterAttack_Solo/Asset/WwiseEvent/AK_Tip_1.uasset new file mode 100644 index 00000000..5ef37ea3 Binary files /dev/null and b/CounterAttack_Solo/Asset/WwiseEvent/AK_Tip_1.uasset differ diff --git a/CounterAttack_Solo/CounterAttack_Solo.ugcproj b/CounterAttack_Solo/CounterAttack_Solo.ugcproj new file mode 100644 index 00000000..ef5831be --- /dev/null +++ b/CounterAttack_Solo/CounterAttack_Solo.ugcproj @@ -0,0 +1,73 @@ +[Root] +ProjectDisplayName=CounterAttack_Solo +ProjectDescription=CounterAttack_Solo +ProjectName=CounterAttack_Solo +ProjectTrueName=6F5D7A9118F1336D66509C6609261E4E5399E1F5E1B2B5A8939A7514B7ED1ADFB79DB4835AA16ABA6646C771DBD0B77D +ProjectShortPath=/CounterAttack_Solo/ +StartMapName=/Game/Maps/PUBG_Baltic/Baltic_Main +MapMode=1 +bIsBigWorld=0 +Version=1.30.21.13232 +UpdateVersion=5 +GameModePath=/CounterAttack_Solo/Asset/Blueprint/UGCGameMode.UGCGameMode_C +DefaultLevelDirectorPath=/Asset/Blueprint/UGCLevelDirector.UGCLevelDirector_C + +[MatchSetting] +NumberOfTeams=2 +TeamPlayers=4 +bIsAllowStageMatching=0 +TeamSettings="{\"TeamSettings\": []}" +bEnableChat=1 +bEnableRoomChat=1 +ChannelName=全部 +RoomName=全部 +bEnablePrivateChat=1 +bEnableTeamChat=1 +bShowMessage=0 +bMessageDisappear=0 +MessageLifetime=0.0 +MaxMessageLines=6 +bEnableSystemChannel=1 +bEnableChatBubble=0 +BubbleLifetime=10 +MatchMethod=0 +InitialScore=2000 +MinScore=0 +MaxScore=4000 +RankDensity=100 +BeyondRankTime=10 +BeyondRankNum=10 +TeamScoreCalculation=0 +bUseMultiModeMatchSetting=0 +MultiModeSettingNum=0 + +[MiniMap] +ZoomRatios=100 +SliderExpandRatios=100 +UserDefineMapPath=0 + +[SwitchesInMaps] +SwitchesInMaps=((Key="r.Mobile.EnableIBL",Value=0),(Key="s.StreamableDelegateLimitCount",Value=0),(Key="s.StreamableDelegateLimitTime",Value=0.001),(Key="r.mobile.HZBOcclusion",Value=0),(Key="r.mobile.allowsoftwareocclusion",Value=1),(Key="AnimDynamicStateFlipSmoothFrame",Value=5)) + +[PlayBinding] +PlayBindingArray=[] + +[JobOption] +LastJobId=-1 +LastWindowsJobId=-1 +LastAndroidJobId=-1 +LastIOSJobId=-1 +PakOnly=0 +LastSkipBake=False +LastTargetPlatform=LinuxServer + +[UGCUploadOption] +PlatformIndex=0 +SkipBake=False +TargetPlatform=LinuxServer+WindowsNoEditor+Android_ETC2+IOS+OpenHarmony_ETC2 + +[DebugSettings] +bRoomOB=0 +TeamPlayers=1,0; + + diff --git a/CounterAttack_Solo/DeleteFiles.txt b/CounterAttack_Solo/DeleteFiles.txt new file mode 100644 index 00000000..e69de29b diff --git a/CounterAttack_Solo/ItemDBFile.uasset b/CounterAttack_Solo/ItemDBFile.uasset new file mode 100644 index 00000000..e5409058 Binary files /dev/null and b/CounterAttack_Solo/ItemDBFile.uasset differ diff --git a/CounterAttack_Solo/MiniMapSettingAssetList.ini b/CounterAttack_Solo/MiniMapSettingAssetList.ini new file mode 100644 index 00000000..7d94e8fc --- /dev/null +++ b/CounterAttack_Solo/MiniMapSettingAssetList.ini @@ -0,0 +1,4 @@ +[Root] +ReplaceMeshPaths=/Game/Arts_Scenes/_Baltic/Baltic_Objects/SM_Baltic_Container_Box_A.SM_Baltic_Container_Box_A + + diff --git a/CounterAttack_Solo/Navmesh/Baltic_Main.navmesh b/CounterAttack_Solo/Navmesh/Baltic_Main.navmesh new file mode 100644 index 00000000..29882c24 Binary files /dev/null and b/CounterAttack_Solo/Navmesh/Baltic_Main.navmesh differ diff --git a/CounterAttack_Solo/ReferenceAssetList.txt b/CounterAttack_Solo/ReferenceAssetList.txt new file mode 100644 index 00000000..749b153e --- /dev/null +++ b/CounterAttack_Solo/ReferenceAssetList.txt @@ -0,0 +1,8 @@ +/Game/Arts_PlayerBluePrints/Weapon/MainWeapon/Other/CompoundBow/BP_Other_CompoundBow +/Game/Arts_PlayerBluePrints/Weapon/MainWeapon/Other/CompoundBow/BP_Other_CompoundBow_BattleItemHandle +/Game/Arts_PlayerBluePrints/Weapon/MainWeapon/Other/CompoundBow/BP_Other_CompoundBow_Wrapper +/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_CompoundBow +/Game/Arts_Player/Weapon/MainWeapon/Others/CompoundBow/Mesh/SK_WEP_CompoundBow_LOD +/Game/Arts_Player/Weapon/MainWeapon/Others/CompoundBow/Mesh/ST_CompoundBowArrow +/Game/Arts_PlayerBluePrints/Vehicle/Horse/CH_ChildAnimBPs/AnimBP_Horse_Aim_CompoudBow +/Game/Arts_PlayerBluePrints/Vehicle/Horse/CH_ChildAnimBPs/AnimBP_Horse_Scope_CompoundBow diff --git a/CounterAttack_Solo/Script/Blueprint/PlaceItems/BP_ClientPreviewItemBase.lua b/CounterAttack_Solo/Script/Blueprint/PlaceItems/BP_ClientPreviewItemBase.lua new file mode 100644 index 00000000..8f13f923 --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/PlaceItems/BP_ClientPreviewItemBase.lua @@ -0,0 +1,172 @@ +---@class BP_ClientPreviewItemBase_C:AActor +---@field Sphere7 USphereComponent +---@field Sphere6 USphereComponent +---@field Sphere4 USphereComponent +---@field Sphere5 USphereComponent +---@field Sphere3 USphereComponent +---@field Sphere USphereComponent +---@field Sphere2 USphereComponent +---@field Sphere1 USphereComponent +---@field PointRoot USceneComponent +---@field ItemRoot USceneComponent +---@field DefaultSceneRoot USceneComponent +---@field bIsPlacing bool +---@field bRotateAlignment bool +--Edit Below-- +local BP_ClientPreviewItemBase = { + bCanPlace = true; + CmpList = {}; + bSetMatSucceed = false; +}; + +--[[ +function BP_ClientPreviewItemBase:ReceiveBeginPlay() + self.SuperClass.ReceiveBeginPlay(self); +end +--]] + +--[[ +function BP_ClientPreviewItemBase:ReceiveTick(DeltaTime) + self.SuperClass.ReceiveTick(self, DeltaTime); +end +--]] + +--[[ +function BP_ClientPreviewItemBase:ReceiveEndPlay() + self.SuperClass.ReceiveEndPlay(self); +end +--]] + +--[[ +function BP_ClientPreviewItemBase:GetReplicatedProperties() + return +end +--]] + +--[[ +function BP_ClientPreviewItemBase:GetAvailableServerRPCs() + return +end +--]] + + + +function BP_ClientPreviewItemBase:GetAllVertexPos() + local TempAllVertexCmp = self:GetAllVertexCmp() + local Res = {} + for i, v in pairs(TempAllVertexCmp) do + Res[#Res + 1] = v:K2_GetComponentLocation() + end + return Res +end + +function BP_ClientPreviewItemBase:GetAllVertexRelativePos() + if self.AllVertexCmpRelativePos == nil then + local TempAllVertexCmp = self:GetAllVertexCmp() + self.AllVertexCmpRelativePos = {} + for i, v in pairs(TempAllVertexCmp) do + self.AllVertexCmpRelativePos[#self.AllVertexCmpRelativePos + 1] = VectorHelper.ToLuaTable(v:GetRelativeTransform().Translation) + end + UGCLogSystem.LogTree("[BP_ClientPreviewItemBase_GetAllVertexRelativePos] AllVertexCmpRelativePos", self.AllVertexCmpRelativePos) + end + return self.AllVertexCmpRelativePos +end + +-- 这里获取一下顶点的预览位置 +function BP_ClientPreviewItemBase:GetAllVertexPreviewPos(PreviewPos, PreviewRot) + local AllVertexRelativePos = self:GetAllVertexRelativePos() + local Res = {} + for i, v in pairs(AllVertexRelativePos) do + Res[#Res + 1] = VectorHelper.ToLuaTable(VectorHelper.Add(KismetMathLibrary.GreaterGreater_VectorRotator(v, PreviewRot), PreviewPos)) + end + return Res +end + +-- 这里获取一下顶点的预览位置 +function BP_ClientPreviewItemBase:GetAllVertexPreviewRelativePos(PreviewRot) + local AllVertexRelativePos = self:GetAllVertexRelativePos() + local Res = {} + PreviewRot = {Roll = PreviewRot.Roll % 360, Pitch = PreviewRot.Pitch % 360, Yaw = PreviewRot.Yaw % 360} + UGCLogSystem.Log("[BP_ClientPreviewItemBase_GetAllVertexPreviewRelativePos] PreviewRot:%s", VectorHelper.RotToString(PreviewRot)) + for i, v in pairs(AllVertexRelativePos) do + Res[#Res + 1] = VectorHelper.ToLuaTable(KismetMathLibrary.GreaterGreater_VectorRotator(v, PreviewRot)) + end + return Res +end + +function BP_ClientPreviewItemBase:SetAllVertexCmp(InAllCmp) + self.AllVertexCmp = InAllCmp +end + +function BP_ClientPreviewItemBase:GetAllVertexCmp() + if self.AllVertexCmp == nil then + self.AllVertexCmp = {self.Sphere, self.Sphere1, self.Sphere2, self.Sphere3, self.Sphere4, self.Sphere5, self.Sphere6, self.Sphere7, } + end + return self.AllVertexCmp +end + +function BP_ClientPreviewItemBase:GetIsRotateAlignment() + return self.bRotateAlignment +end + +function BP_ClientPreviewItemBase:PlaceItem(UnitPos, UnitRot) + --UGCLogSystem.Log("[BP_ClientPreviewItemBase_PlaceItem] Pos:%s, Rot:%s", VectorHelper.ToString(Pos), VectorHelper.RotToString(Rot)) + local TargetPos = PlacementModeConfig.UnitVectorToVector(UnitPos) + local TargetRot = PlacementModeConfig.UnitRotatorToRotator(UnitRot) + self:K2_SetActorLocation(TargetPos) + self:K2_SetActorRotation(TargetRot) +end + +function BP_ClientPreviewItemBase:AddSMCmp(InCmp) + if type(InCmp) == "table" then + for i, v in pairs(InCmp) do + self.CmpList[#self.CmpList + 1] = v + v:SetMaterial(0, PlacementModeConfig.GetPreviewDynamicMat()) + end + else + self.CmpList[#self.CmpList + 1] = InCmp + InCmp:SetMaterial(0, PlacementModeConfig.GetPreviewDynamicMat()) + end +end + +function BP_ClientPreviewItemBase:IsOverlappingPlayer() + local AllPawn = UGCGameSystem.GetAllPlayerPawn() + -- 正常来说只有一个玩家需要判断 + for i, PlayerPawn in pairs(AllPawn) do + -- 正常来说只有一个Mesh需要判断 + for _, SM in pairs(self.CmpList) do + if SM:IsOverlappingActor(PlayerPawn) then + return true + end + end + end + return false +end + +function BP_ClientPreviewItemBase:SetMat() + if self.CmpList[1] then + -- self.DynamicMaterial = KismetMaterialLibrary.CreateDynamicMaterialInstance(self, self.CmpList[1]:GetMaterial(0)); + for i, v in pairs(self.CmpList) do + v:SetMaterial(0, PlacementModeConfig.GetPreviewDynamicMat()) + end + self.bSetMatSucceed = true + end +end + +function BP_ClientPreviewItemBase:SetCanPlace(InCanPlace) + if InCanPlace ~= self.bCanPlace then + UGCLogSystem.Log("[BP_ClientPreviewItemBase_SetCanPlace] InCanPlace:%s", tostring(InCanPlace)) + if not self.bSetMatSucceed then + self:SetMat() + end + self.bCanPlace = InCanPlace + if self.bCanPlace then + PlacementModeConfig.GetPreviewDynamicMat():SetVectorParameterValue("DiffLight", PlacementModeConfig.PlacingAttr.CanPlaceColor) + else + PlacementModeConfig.GetPreviewDynamicMat():SetVectorParameterValue("DiffLight", PlacementModeConfig.PlacingAttr.CanNotPlaceColor) + end + UGCLogSystem.Log("[BP_ClientPreviewItemBase_SetCanPlace] Finish") + end +end + +return BP_ClientPreviewItemBase; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/PlaceItems/BP_PlaceItemBase.lua b/CounterAttack_Solo/Script/Blueprint/PlaceItems/BP_PlaceItemBase.lua new file mode 100644 index 00000000..6aad6774 --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/PlaceItems/BP_PlaceItemBase.lua @@ -0,0 +1,196 @@ +---@class BP_PlaceItemBase_C:AActor +---@field ItemRoot USceneComponent +---@field DefaultSceneRoot USceneComponent +---@field PlaceItemType TEnumAsByte +---@field PlaceSound UAkAudioEvent +---@field RemoveSound UAkAudioEvent + + + +-- 继承拷贝 ------------------------------------------------------------------------------------- +--[[ +local PlaceItemBase = require("Script.Blueprint.PlaceItems.BP_PlaceItemBase") +local BP_LandMine = setmetatable( + { + }, + { + __index = PlaceItemBase, + __metatable = PlaceItemBase + } +) + +function BP_LandMine:ReceiveBeginPlay() + self.SuperClass.ReceiveBeginPlay(self); + PlaceItemBase.ParentBeginPlay(self) + if self:HasAuthority() then + UGCSystemLibrary.BindBeginOverlapFunc(self.Sphere, self.OnBeginOverlap, self) + end +end + +function BP_LandMine:ReceiveEndPlay() + PlaceItemBase.ParentEndPlay(self) + self.SuperClass.ReceiveEndPlay(self); +end + +function BP_LandMine:SetActive(InActive) + PlaceItemBase.SetActive(self, InActive) +end +]] + +-- 继承拷贝 End --------------------------------------------------------------------------------- + + +--Edit Below-- +local BP_PlaceItemBase = { + ItemTFInfo = { + Pos = { X = 0, Y = 0, Z = -300 }; + Rot = { Roll = 0, Pitch = 0, Yaw = 0 }; + }, + CmpList = {}; + bIsPlaced = false; + bEnableActive = false; + bCanClimb = true; + ID = 0; +}; + +-- 这个先关闭 +function BP_PlaceItemBase:GetReplicatedProperties() + return "bEnableActive" + --"ItemTFInfo", + --"ID" +end + + + + +function BP_PlaceItemBase:ParentBeginPlay() + self:AddSetMobilityComponent({self.DefaultSceneRoot, self.ItemRoot}) + if UGCGameSystem.IsServer() then + if PlacementModeConfig.IsPlaceMode() then + else + self:SetActive(true) + end + else + self:OnRep_ItemTFInfo() + if PlacementModeConfig.IsPlaceMode() then + if UE.IsValid(self.PlaceSound) then + UGCLogSystem.Log("[BP_PlaceItemBase_ParentBeginPlay]") + UGCSoundManagerSystem.PlaySoundAtLocation(self.PlaceSound, self:K2_GetActorLocation(), self:K2_GetActorRotation()) + end + else + end + end +end + +function BP_PlaceItemBase:ParentEndPlay() + if UGCGameSystem.IsServer() then + else + if PlacementModeConfig.IsPlaceMode() then + if UE.IsValid(self.RemoveSound) then + UGCSoundManagerSystem.PlaySoundAtLocation(self.RemoveSound, self:K2_GetActorLocation(), self.K2_GetActorRotation()) + end + end + end +end + +function BP_PlaceItemBase:SetActive(InActive) + self.bEnableActive = InActive +end + + +function BP_PlaceItemBase:GetPlaceItemType() + return self.PlaceItemType +end + + +function BP_PlaceItemBase:AddSetMobilityComponent(InCmp) + if type(InCmp) == "table" then + for i, v in pairs(InCmp) do + self.CmpList[#self.CmpList + 1] = v + end + else + self.CmpList[#self.CmpList + 1] = InCmp + end +end + +function BP_PlaceItemBase:SetID(InID) + self.ID = InID +end + +function BP_PlaceItemBase:GetID() + return self.ID +end + +function BP_PlaceItemBase:GetIsPlaced() + return self.bIsPlaced or not PlacementModeConfig.PlacingAttr.IsObjectPoolPlace +end + +function BP_PlaceItemBase:PlaceItem(Pos, Rot) + self.bIsPlaced = true + self.ItemTFInfo.Pos = Pos + self.ItemTFInfo.Rot = Rot + if PlacementModeConfig.PlacingAttr.IsObjectPoolPlace then + self:SetCmpListMobility(EComponentMobility.Movable) + local TargetPos = PlacementModeConfig.UnitVectorToVector(self.ItemTFInfo.Pos) + local TargetRot = PlacementModeConfig.UnitRotatorToRotator(self.ItemTFInfo.Rot) + self:K2_SetActorLocation(TargetPos) + self:K2_SetActorRotation(TargetRot) + UGCEventSystem.SetTimer(self, function() + self:SetCmpListMobility(EComponentMobility.Static) + UGCLogSystem.Log("[BP_PlaceItemBase_PlaceItem]") + end, 1) + if UGCGameSystem.IsServer() then + UGCSendRPCSystem.ActorRPCNotify(nil, self, "PlaceItem", self.ItemTFInfo.Pos, self.ItemTFInfo.Rot) + end + end +end + +--function BP_PlaceItemBase:GetPlacePosAndRot() +-- return self.ItemTFInfo.Pos, self.ItemTFInfo.Rot +--end + +function BP_PlaceItemBase:GetPlacePosAndRot() + return PlacementModeConfig.VectorToUnitVector(self:K2_GetActorLocation()), PlacementModeConfig.RotatorToUnitRotator(self:K2_GetActorRotation()) +end + +--- @param InMobilityType:EComponentMobility +function BP_PlaceItemBase:SetCmpListMobility(InMobilityType) + if not self.bCanClimb then + InMobilityType = EComponentMobility.Movable + end + UGCLogSystem.Log("[BP_PlaceItemBase_SetCmpListMobility] InMobilityType:%s", tostring(InMobilityType)) + for i, v in pairs(self.CmpList) do + v:K2_SetMobility(InMobilityType) + UGCLogSystem.Log("[BP_PlaceItemBase_SetCmpListMobility] CmpName:%s", KismetSystemLibrary.GetObjectName(v)) + end +end + +function BP_PlaceItemBase:OnRep_ItemTFInfo() + if self then + self:PlaceItem(self.ItemTFInfo.Pos, self.ItemTFInfo.Rot) + end +end + +function BP_PlaceItemBase:RecoveryItem() + self.bIsPlaced = false + if PlacementModeConfig.PlacingAttr.IsObjectPoolPlace then + self:SetCmpListMobility(EComponentMobility.Movable) + self:K2_SetActorLocation(PlacementModeConfig.PlacingAttr.SpawnPos) + if UGCGameSystem.IsServer() then + UGCSendRPCSystem.ActorRPCNotify(nil, self, "RecoveryItem") + end + else + UGCLogSystem.Log("[BP_PlaceItemBase_RecoveryItem]") + self:K2_DestroyActor() + UGCLogSystem.Log("[BP_PlaceItemBase_RecoveryItem] Finish") + end +end + + +--[[ +function BP_PlaceItemBase:GetAvailableServerRPCs() + return +end +--]] + +return BP_PlaceItemBase; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/PlaceItems/BP_PlaceModeManager.lua b/CounterAttack_Solo/Script/Blueprint/PlaceItems/BP_PlaceModeManager.lua new file mode 100644 index 00000000..97378151 --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/PlaceItems/BP_PlaceModeManager.lua @@ -0,0 +1,763 @@ +---@class BP_PlaceModeManager_C:AActor +---@field PointToWidget UWidgetComponent +---@field DefaultSceneRoot USceneComponent + + +require("Script.Blueprint.PlaceItems.PlacementModeConfig") +--Edit Below-- +local BP_PlaceModeManager = { + + -- 放置值 + PlaceValue = 0; + + -- 当前已放置的物体 {{Type = uint, ID = uint, Pos = {XYZ}, Rot = {RPY}}, ...} + PlacedItemCount = {}; + -- 是否已开启放置模式 + PlaceMode = PlacementModeConfig.EPlaceMode.None; + -- 当前是否为使用场景摄像机进行放置物体 + bIsSceneCamera = false; + + + -- 所有放置物 {Type = {Actor*, ...}, ...} + AllPlaceItems = {}; + -- 客户端预览放置的Actor + AllPreviewActor = {}; + + AddPreviewQuat = {X=0,Y=0,Z=0,W=1}; + + -- 所有可放置区间Actor + AllPlaceableAreaActors = {}; + -- 预导入的地图 [PlayerKey] = Code + PreUsePlayerPlaceItemCode = {}; + + +}; + +function BP_PlaceModeManager:GetReplicatedProperties() + return + "PlaceValue", + "PlacedItemCount" +end + +-- OnRep -------------------------------------------------------------------------------------------- + +function BP_PlaceModeManager:OnRep_PlaceValue() + if self == nil then return end + UGCEventSystem.SendEvent(EventEnum.UpdatePlaceValue) +end + +function BP_PlaceModeManager:OnRep_PlacedItemCount() + if self == nil then return end + UGCEventSystem.SendEvent(EventEnum.UpdatePlacedItemCount, self.PlacedItemCount) +end + + + +-- OnRep End ---------------------------------------------------------------------------------------- + + +function BP_PlaceModeManager:ReceiveBeginPlay() + self.SuperClass.ReceiveBeginPlay(self); + UGCLogSystem.Log("[BP_PlaceModeManager_ReceiveBeginPlay]") + self:UpdatePlaceableArea() + if UGCGameSystem.IsServer() then + self:InitAllPlaceItemsList() + if PlacementModeConfig.PlacingAttr.IsObjectPoolPlace then + self:SpawnPlaceItem() + end + else + self:SetPointToWidgetVis(false) + if PlacementModeConfig.IsPlaceMode() then + self:SpawnPreviewItem() + end + end + UGCLogSystem.Log("[BP_PlaceModeManager_ReceiveBeginPlay] Finish") +end + +BP_PlaceModeManager.LastTraceTime = 0; +BP_PlaceModeManager.LastRemoveTraceTime = 0; +function BP_PlaceModeManager:ReceiveTick(DeltaTime) + self.SuperClass.ReceiveTick(self, DeltaTime); + if UGCGameSystem.IsServer() then + if self.PlaceMode ~= PlacementModeConfig.EPlaceMode.None then + self:TickUpdatePlaceValue() + end + else + if self:IsPlaceMode() then + self.LastTraceTime = self.LastTraceTime + DeltaTime + if self.LastTraceTime > PlacementModeConfig.PlacingAttr.CheckPosTimeInterval then + self.LastTraceTime = 0 + -- 获取检测点位并预览 + UGCLogSystem.Log("[BP_PlaceModeManager_ReceiveTick] CheckPlacePos") + self:CheckPlacePos() + end + elseif self:IsRemoveMode() then + self.LastRemoveTraceTime = self.LastRemoveTraceTime + DeltaTime + if self.LastRemoveTraceTime > PlacementModeConfig.PlacingAttr.CheckRemoveItemTimeInterval then + self.LastRemoveTraceTime = 0 + -- 获取检测点位并预览 + self:CheckRemoveItem() + end + end + end +end + +function BP_PlaceModeManager:ReceiveEndPlay() + -- 销毁生成物 + for i, v in pairs(self.AllPlaceItems) do + if UE.IsValid(v) then + v:K2_DestroyActor() + end + end + for i, v in pairs(self.AllPreviewActor) do + if UE.IsValid(v) then + v:K2_DestroyActor() + end + end + self.SuperClass.ReceiveEndPlay(self); +end + +-- 生成函数 -------------------------------------------------------------------------------------------- + +--- 对象池生成放置物 +function BP_PlaceModeManager:SpawnPlaceItem() + for Type, v in pairs(PlacementModeConfig.ItemInfo) do + self.AllPlaceItems[Type] = {} + local ItemClass = UE.LoadClass(v.ItemPath) + for i = 1, v.MaxCount do + local PlaceItemInst = UGCGameSystem.SpawnActor(self, ItemClass, PlacementModeConfig.PlacingAttr.SpawnPos, VectorHelper.RotZero(), VectorHelper.ScaleOne()) + PlaceItemInst:SetPlaceItemType(Type) + self.AllPlaceItems[Type][i] = PlaceItemInst + end + end +end + +--- 客户端生成预览物 +function BP_PlaceModeManager:SpawnPreviewItem() + for Type, v in pairs(PlacementModeConfig.ItemInfo) do + self.AllPlaceItems[Type] = {} + local ItemClass = UE.LoadClass(v.PreviewItemPath) + self.AllPreviewActor[Type] = UGCGameSystem.SpawnActor(self, ItemClass, PlacementModeConfig.PlacingAttr.SpawnPos, VectorHelper.RotZero(), VectorHelper.ScaleOne()) + end +end + + +--- 获取未使用的放置物 仅对象池生成模式有效 +function BP_PlaceModeManager:GetUnPlaceItemFromItemType(PlaceItemType) + if self.AllPlaceItems[PlaceItemType] then + for i, v in pairs(self.AllPlaceItems[PlaceItemType]) do + if not v:GetIsPlaced() then + return v + end + end + end + return nil +end + +-- 生成函数 End ---------------------------------------------------------------------------------------- + + +--- 开启放置模式类型 +---@param InPlaceMode EPlaceMode +function BP_PlaceModeManager:SetPlaceMode(InPlaceMode) + if self.PlaceMode ~= InPlaceMode then + self.PlaceMode = InPlaceMode + UGCEventSystem.SendEvent(EventEnum.PlaceModeChange, self.PlaceMode) + if self.PlaceMode == PlacementModeConfig.EPlaceMode.None then + self:SetPlaceItemType(-1) + self:SetPointToWidgetVis(false) + elseif self.PlaceMode == PlacementModeConfig.EPlaceMode.PlaceMode then + self:SetPlaceItemType(0) + self:SetPointToWidgetVis(false) + elseif self.PlaceMode == PlacementModeConfig.EPlaceMode.RemoveMode then + self:SetPlaceItemType(-1) + end + end +end + +function BP_PlaceModeManager:IsPlaceMode() + return self.PlaceMode == PlacementModeConfig.EPlaceMode.PlaceMode +end + +function BP_PlaceModeManager:IsRemoveMode() + return self.PlaceMode == PlacementModeConfig.EPlaceMode.RemoveMode +end + +function BP_PlaceModeManager:GetPlacementModeType() + return self.PlaceMode +end + +-- 客户端预览 放置和移除 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +--- 检测放置位置 +function BP_PlaceModeManager:CheckPlacePos() + local PreviewActor = self:GetPreviewPlaceActor() + if UE.IsValid(PreviewActor) then + UGCLogSystem.Log("[BP_PlaceModeManager_CheckPlacePos]") + self.TargetUnitPos, self.TargetUnitRot = self:GetPlacingPos() + + PreviewActor:PlaceItem(self.TargetUnitPos, self.TargetUnitRot) + UGCLogSystem.Log("[BP_PlaceModeManager_CheckPlacePos] TargetUnitPos:%s, TargetUnitRot:%s", VectorHelper.ToString(self.TargetUnitPos), VectorHelper.RotToString(self.TargetUnitRot)) + if self:ClientPlaceCondition() then + PlacementModeConfig.SetCanPlace(true) + else + PlacementModeConfig.SetCanPlace(false) + end + else + UGCLogSystem.LogError("[BP_PlaceModeManager_CheckPlacePos] PreviewActor:%s is nil.", tostring(self.PlaceItemType)) + end +end + +--- 获取本地摄像机控制器Actor +function BP_PlaceModeManager:GetLocalCameraManager() + if not UE.IsValid(self.CameraManager) then + self.CameraManager = UGCSystemLibrary.GetLocalPlayerController().PlayerCameraManager + end + return self.CameraManager +end + +--- Client +--- 获取预放置的点位 +function BP_PlaceModeManager:GetPlacingPos() + if not UE.IsValid(self:GetLocalCameraManager()) then + return + end + local StartPos = self.CameraManager:K2_GetActorLocation() + local Dir = self.CameraManager:GetActorForwardVector() + local EndPos = VectorHelper.Add(StartPos, VectorHelper.MulNumber(Dir, PlacementModeConfig.PlacingAttr.TraceDis)) + --- HitResult:FHitResult + local bSucceed, HitResult = TraceManager.LineTraceSingleForObjects(self, StartPos, EndPos, PlacementModeConfig.PlacingAttr.TraceObjType, {self:GetPreviewPlaceActor(), UGCSystemLibrary.GetLocalPlayerPawn()}, PlacementModeConfig.PlacingAttr.EnableDrawDebug) + --local bSucceed, HitResult = TraceManager.SphereTraceSingleForObjects(self, StartPos, EndPos, 20, PlacementModeConfig.PlacingAttr.TraceObjType, {self:GetPreviewPlaceActor(), UGCSystemLibrary.GetLocalPlayerPawn()}, PlacementModeConfig.PlacingAttr.EnableDrawDebug) + local ImpactPoint, ImpactNormal = HitResult.ImpactPoint, HitResult.ImpactNormal + if not bSucceed then + ImpactPoint = EndPos + end + + local TargetRot + local TargetPos = ImpactPoint + local ImpactRot = KismetMathLibrary.MakeRotFromZ(ImpactNormal) + local PreviewPlaceActor = self:GetPreviewPlaceActor() + if not PreviewPlaceActor:GetIsRotateAlignment() then + TargetRot = QuatHelper.QuatToRot(self.AddPreviewQuat) + ImpactRot = VectorHelper.RotZero() + local AllVertexPreviewRelativePos = PreviewPlaceActor:GetAllVertexPreviewRelativePos(TargetRot) + -- UGCLogSystem.LogTree("[BP_PlaceModeManager_GetPlacingPos] AllVertexPreviewPos", AllVertexPreviewPos) + --if math.abs(ImpactNormal.Z - 1) > 0.01 and VectorHelper.Length2D(ImpactNormal) > 0.01 then + -- -- 只计算平面的距离 + -- ImpactNormal.Z = 0 + -- + -- local MaxDis = 0; + -- for i, v in pairs(AllVertexPreviewRelativePos) do + -- local Dir2D = VectorHelper.MulNumber2D(v, -1) + -- local Dis2D = VectorHelper.Length2D(Dir2D) + -- --UGCLogSystem.Log("[BP_PlaceModeManager_GetPlacingPos] Dis2D:%s", tostring(Dis2D)) + -- local CosVal = VectorHelper.CosineValue(Dir2D, ImpactNormal) + -- if CosVal > 0.1 then + -- MaxDis = math.max(MaxDis, CosVal * Dis2D) + -- end + -- end + -- --UGCLogSystem.Log("[BP_PlaceModeManager_GetPlacingPos] MaxDis:%s", tostring(MaxDis)) + -- local UnitVectorImpactPoint = VectorHelper.MulNumber(ImpactNormal, 1. / VectorHelper.Length2D(ImpactNormal)) + -- TargetPos = VectorHelper.Add(ImpactPoint, VectorHelper.MulNumber(UnitVectorImpactPoint, MaxDis)) + --end + if math.abs(ImpactNormal.Z - 1) > 0.01 and VectorHelper.Length2D(ImpactNormal) > 0.01 then + + local MaxDis = 0; + for i, v in pairs(AllVertexPreviewRelativePos) do + local PreDir = VectorHelper.MulNumber(v, -1) + local PreDis = VectorHelper.Length(PreDir) + local CosVal = VectorHelper.CosineValue(PreDir, ImpactNormal) + if CosVal > 0.1 then + MaxDis = math.max(MaxDis, CosVal * PreDis) + end + end + local UnitVectorImpactPoint = VectorHelper.MulNumber(ImpactNormal, 1. / VectorHelper.Length2D(ImpactNormal)) + TargetPos = VectorHelper.Add(ImpactPoint, VectorHelper.MulNumber(UnitVectorImpactPoint, MaxDis)) + end + else + TargetRot = QuatHelper.QuatToRot(QuatHelper.mul(QuatHelper.RotToQuat(ImpactRot), self.AddPreviewQuat)) + end + + + return PlacementModeConfig.VectorToUnitVector(TargetPos), PlacementModeConfig.RotatorToUnitRotator(TargetRot) +end + +--- Client +--- 获取指向的放置Actor +function BP_PlaceModeManager:CheckRemoveItem() + if not UE.IsValid(self:GetLocalCameraManager()) then + return + end + local StartPos = self.CameraManager:K2_GetActorLocation() + local Dir = self.CameraManager:GetActorForwardVector() + local EndPos = VectorHelper.Add(StartPos, VectorHelper.MulNumber(Dir, PlacementModeConfig.PlacingAttr.TraceRemoveDis)) + local bSucceed, HitResult = TraceManager.LineTraceSingleForObjects(self, StartPos, EndPos, PlacementModeConfig.PlacingAttr.RemoveTraceObjType, {UGCSystemLibrary.GetLocalPlayerPawn()}, PlacementModeConfig.PlacingAttr.EnableDrawDebug) + if bSucceed then + local HitActor = HitResult.Actor:Get() + -- 判断标签或者类型 + if HitActor:ActorHasTag(PlacementModeConfig.PlaceItemTag) or UE.IsA(HitActor, PlacementModeConfig.GetPlaceItemBaseClass()) then + self:SetPointToWidgetVis(true) + local PointPos + if PlacementModeConfig.ItemInfo[HitActor:GetPlaceItemType()].RemovePointToActor then + PointPos = HitActor:K2_GetActorLocation() + else + local Origin,BoxExtent = HitActor:GetActorBounds() + PointPos = Origin + end + self:SetPointToWidgetPos(PointPos) + self.TargetRemoveItem = HitActor + return HitActor + end + end + + self:SetPointToWidgetVis(false) + self.TargetRemoveItem = nil + return nil +end + +--- Client +--- 设置指向UI的显示 +function BP_PlaceModeManager:SetPointToWidgetVis(IsShow) + if IsShow then + self.PointToWidget:GetUserWidgetObject():SetVisibility(ESlateVisibility.SelfHitTestInvisible) + else + self.PointToWidget:GetUserWidgetObject():SetVisibility(ESlateVisibility.Collapsed) + end +end + +function BP_PlaceModeManager:SetPointToWidgetPos(InPos) + self.PointToWidget:K2_SetWorldLocation(InPos) +end + +--- 获取当前预览放置物的Actor +function BP_PlaceModeManager:GetPreviewPlaceActor() + return self.AllPreviewActor[self.PlaceItemType] +end + +--- 重置预览Actor的位置 +function BP_PlaceModeManager:ResetPreviewActorPos() + local PreviewActor = self:GetPreviewPlaceActor() + if UE.IsValid(PreviewActor) then + PreviewActor:K2_SetActorLocation(PlacementModeConfig.PlacingAttr.SpawnPos) + end +end + +--- 客户端设置当前预览放置物的类型 +function BP_PlaceModeManager:SetPlaceItemType(InPlaceItemType) + self:ResetPreviewActorPos() + self.PlaceItemType = InPlaceItemType + UGCEventSystem.SendEvent(EventEnum.PlaceItemTypeIsChange, self.PlaceItemType) +end + +function BP_PlaceModeManager:GetPlaceItemType() + return self.PlaceItemType +end + +--- 设置旋转值 +function BP_PlaceModeManager:SetAddPreviewQuat(InYaw) + self.AddPreviewQuat = QuatHelper.RotToQuat({Roll = 0, Pitch = 0, Yaw = InYaw}) +end + +--- 重置旋转 +function BP_PlaceModeManager:ResetAddPreviewQuat() + self.AddPreviewQuat = QuatHelper.RotToQuat({Roll = 0, Pitch = 0, Yaw = 0}) +end + +-- 客户端预览 放置和移除 End ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + + +-- 放置 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--- 客户端判断放置条件 +---@return bool +function BP_PlaceModeManager:ClientPlaceCondition() + if self:GetPreviewPlaceActor():IsOverlappingPlayer() then + return false + end + local Pos = PlacementModeConfig.UnitVectorToVector(self.TargetUnitPos) + local LineOfDefense = PlacementModeConfig.GetSimpleLineOfDefense() + if UE.IsValid(LineOfDefense) then + local LineOfDefensePos = LineOfDefense:K2_GetActorLocation() + if math.abs(LineOfDefensePos.Z - Pos.Z) < PlacementModeConfig.PlacingAttr.LineOfDefenseHeight and VectorHelper.Length2D(VectorHelper.Sub2D(LineOfDefensePos, Pos)) < PlacementModeConfig.PlacingAttr.LineOfDefenseRadius then + return false + end + end + + for i, v in pairs(self.AllPlaceableAreaActors) do + if v:InPlaceableArea(Pos) then + return true + end + end + return false +end + +--- 获取玩家可放置某物体的数量 +--function BP_PlaceModeManager:GetPlayerPlaceItemCount(PlayerKey, InItemType) +-- local ItemIncrement = ArchiveDataConfig.GetPlayerArchiveDataFromType(PlayerKey, ArchiveDataConfig.EArchiveType.ItemIncrement) +-- local ItemInfo = PlacementModeConfig.ItemInfo[InItemType] +-- if ItemIncrement and ItemIncrement[InItemType] then +-- return math.clamp(ItemIncrement[InItemType] + ItemInfo.InitialCount, 0, ItemInfo.MaxCount) +-- end +-- return ItemInfo.InitialCount +--end + +--- 获取单人放置模式时的玩家PC +function BP_PlaceModeManager:GetSimplePlayerPC() + return UGCGameSystem.GetAllPlayerController()[1] +end + +--- 服务器判断放置条件 +---@return bool +function BP_PlaceModeManager:ServerPlaceCondition(InPlayerKey, InPlaceItemType, UnitPos, IgnoreQuantityLimit) + -- 舒服进行数量限制判断 + if IgnoreQuantityLimit ~= true then + -- 放置量满足 + if PlacementModeConfig.ItemInfo[InPlaceItemType].Cost + self:GetPlaceValue() > PlacementModeConfig.GetPlaceMaxValue(InPlayerKey) then + if PlacementModeConfig.IsPlaceMode() then + UGCSendRPCSystem.RPCEvent(InPlayerKey, EventEnum.AddTip, TipConfig.TipType.PlaceFailure, PlacementModeConfig.EPlaceCallback.InsufficientPlaceValue) + end + UGCLogSystem.LogError("[BP_PlaceModeManager_ServerPlaceCondition] 放置量不满足 目标放置量:%s, 玩家的可放置量:%s", tostring(PlacementModeConfig.ItemInfo[InPlaceItemType].Cost + self:GetPlaceValue()), tostring(PlacementModeConfig.GetPlaceMaxValue(InPlayerKey))) + return false + end + -- 满足放置数量 + if #self.AllPlaceItems[InPlaceItemType] >= PlacementModeConfig.GetPlayerPlaceItemCount(InPlayerKey, InPlaceItemType) then + if PlacementModeConfig.IsPlaceMode() then + UGCSendRPCSystem.RPCEvent(InPlayerKey, EventEnum.AddTip, TipConfig.TipType.PlaceFailure, PlacementModeConfig.EPlaceCallback.InsufficientNumberOfItem) + end + UGCLogSystem.LogError("[BP_PlaceModeManager_ServerPlaceCondition] 物体可放置数量不满足 当前该问题数量:%s, 玩家的物体最大放置量:%s", tostring(#self.AllPlaceItems[InPlaceItemType]), tostring(#self.AllPlaceItems[InPlaceItemType])) + return false + end + end + + + if not PlacementModeConfig.IsPlaceMode() then + return true + end + +-- 下方仅为放置模式才做的判断 ----------------------------------------------------------------------------------------------------- + + local IsInArea = false + local Pos = PlacementModeConfig.UnitVectorToVector(UnitPos) + -- 判断是否在防线范围内 + local LineOfDefense = PlacementModeConfig.GetSimpleLineOfDefense() + if UE.IsValid(LineOfDefense) then + local LineOfDefensePos = LineOfDefense:K2_GetActorLocation() + if math.abs(LineOfDefensePos.Z - Pos.Z) < PlacementModeConfig.PlacingAttr.LineOfDefenseHeight and VectorHelper.Length2D(VectorHelper.Sub2D(LineOfDefensePos, Pos)) < PlacementModeConfig.PlacingAttr.LineOfDefenseRadius then + UGCSendRPCSystem.RPCEvent(InPlayerKey, EventEnum.AddTip, TipConfig.TipType.PlaceFailure, PlacementModeConfig.EPlaceCallback.LocationNotWithinRange) + return false + end + end + -- 判断是否在可放置范围内 + for i, v in pairs(self.AllPlaceableAreaActors) do + if v:InPlaceableArea(Pos) then + IsInArea = true + break + end + end + if not IsInArea then + UGCSendRPCSystem.RPCEvent(InPlayerKey, EventEnum.AddTip, TipConfig.TipType.PlaceFailure, PlacementModeConfig.EPlaceCallback.LocationNotWithinRange) + return false + end + return true +end + +--- 客户端调用放置操作 +function BP_PlaceModeManager:ClientPlace() + if self:ClientPlaceCondition() then + UGCSendRPCSystem.ActorRPCNotify(nil, self, "ServerPlace", UGCSystemLibrary.GetLocalPlayerKey(), self.PlaceItemType, self.TargetUnitPos, self.TargetUnitRot) + else + -- Tip放置失败的提示 + UGCEventSystem.SendEvent(EventEnum.AddTip, TipConfig.TipType.PlaceFailure, PlacementModeConfig.EPlaceCallback.LocationNotWithinRange) + end +end + +--- 服务器调用放置操作 +---@param IgnoreQuantityLimit 忽略数量限制 +function BP_PlaceModeManager:ServerPlace(InPlayerKey, InPlaceItemType, InTargetUnitPos, InTargetUnitRot, IgnoreQuantityLimit) + UGCLogSystem.Log("[BP_PlaceModeManager_ServerPlace] InPlayerKey:%s, InPlaceItemType:%s", tostring(InPlayerKey), tostring(InPlaceItemType)) + self.PlaceItemType, self.TargetUnitPos, self.TargetUnitRot = InPlaceItemType, InTargetUnitPos, InTargetUnitRot + if self:ServerPlaceCondition(InPlayerKey, self.PlaceItemType, self.TargetUnitPos, IgnoreQuantityLimit) then + if PlacementModeConfig.PlacingAttr.IsObjectPoolPlace then + local UnPlaceItem = self:GetUnPlaceItemFromItemType(self.PlaceItemType) + if UE.IsValid(UnPlaceItem) then + UnPlaceItem:PlaceItem(self.TargetUnitPos, self.TargetUnitRot) + UGCLogSystem.Log("[BP_PlaceModeManager_ServerPlace] Succeed 1111") + end + else + if self.AllPlaceItems[self.PlaceItemType] == nil then + self.AllPlaceItems[self.PlaceItemType] = {} + end + local ItemPath = PlacementModeConfig.ItemInfo[self.PlaceItemType].ItemPath + local ItemClass = UE.LoadClass(ItemPath) + local PlaceItemInst = UGCGameSystem.SpawnActor(self, ItemClass, PlacementModeConfig.UnitVectorToVector(self.TargetUnitPos), PlacementModeConfig.UnitRotatorToRotator(self.TargetUnitRot), VectorHelper.ScaleOne()) + PlaceItemInst:PlaceItem(self.TargetUnitPos, self.TargetUnitRot) + self.AllPlaceItems[self.PlaceItemType][#self.AllPlaceItems[self.PlaceItemType] + 1] = PlaceItemInst + UGCLogSystem.Log("[BP_PlaceModeManager_ServerPlace] Succeed 2222") + end + self:AddPlacedItem(self.PlaceItemType) + end +end + +-- 放置End ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + + + + + +-- 移除 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +--- 客户端判断移除的条件 +---@return bool +function BP_PlaceModeManager:ClientRemoveItemCondition() + return UE.IsValid(self.TargetRemoveItem) +end + +--- 服务器判断移除条件 +---@return bool +function BP_PlaceModeManager:ServerRemoveItemCondition(InRemoveItem) + -- 如果是对象池生成模式还需要判断该物体上方是否有玩家 不然服务器会崩溃 + -- Warning: [LuaException] OnLogLuaStack: Assertion failed:!bCurrentBaseHadBeenStatic + -- LogLinux: Error: [GIsGuarded:1]appError called: Assertion failed: !bCurrentBaseHadBeenStatic [File:D:\CG026\Survive\Source\ShadowTrackerExtra\Character\STCharacterMovementComponent.cpp] [Line: 4383] + -- !!!!!!!!!!!!!!!!!!!!!!!!! + + return UE.IsA(InRemoveItem, PlacementModeConfig.GetPlaceItemBaseClass()) +end + +function BP_PlaceModeManager:ClientRemoveItem() + if self:ClientRemoveItemCondition() then + UGCSendRPCSystem.ActorRPCNotify(nil, self, "ServerRemoveItem", self.TargetRemoveItem) + else + UGCLogSystem.LogError("[BP_PlaceModeManager_ClientRemoveItem]") + end +end + +function BP_PlaceModeManager:ServerRemoveItem(InRemoveItem) + if self:ServerRemoveItemCondition(InRemoveItem) then + local ItemType = InRemoveItem:GetPlaceItemType() + self:RemovePlacedItem(ItemType) + + if PlacementModeConfig.PlacingAttr.IsObjectPoolPlace == false then + table.removeValue(self.AllPlaceItems[ItemType], InRemoveItem, true) + end + + InRemoveItem:RecoveryItem() + else + UGCLogSystem.LogError("[BP_PlaceModeManager_ServerRemoveItem]") + end +end + +function BP_PlaceModeManager:RemoveItemFromType(InItemType) + if self.AllPlaceItems[InItemType] then + for i = #self.AllPlaceItems[InItemType], 1, -1 do + self:ServerRemoveItem(self.AllPlaceItems[InItemType][i]) + end + end +end + + +function BP_PlaceModeManager:ClearItem() + UGCLogSystem.Log("[BP_PlaceModeManager_ClearItem]") + for i, v in pairs(self.AllPlaceItems) do + for _, ItemInst in pairs(v) do + ItemInst:RecoveryItem() + end + end + if PlacementModeConfig.PlacingAttr.IsObjectPoolPlace == false then + self:InitAllPlaceItemsList() + end + self.PlacedItemCount = {} + self:UpdatePlaceValue() +end + +function BP_PlaceModeManager:InitAllPlaceItemsList() + for i, v in pairs(EPlaceItemType) do + self.AllPlaceItems[v] = {} + end +end +-- 移除End ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +-- 放置量参数设置 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--- 增加放置量 +function BP_PlaceModeManager:AddPlacedItem(PlaceItemType) + if self.PlacedItemCount[PlaceItemType] == nil then + self.PlacedItemCount[PlaceItemType] = 0 + end + self.PlacedItemCount[PlaceItemType] = self.PlacedItemCount[PlaceItemType] + 1 + self:UpdatePlaceValue() +end + +--- 减少放置量 +function BP_PlaceModeManager:RemovePlacedItem(PlaceItemType) + self.PlacedItemCount[PlaceItemType] = self.PlacedItemCount[PlaceItemType] - 1 + if self.PlacedItemCount[PlaceItemType] < 0 then + UGCLogSystem.LogError("[BP_PlaceModeManager_RemovePlacedItem] PlaceItemType:%s 数量小于0!!!!!!!!!!", tostring(PlaceItemType)) + self.PlacedItemCount[PlaceItemType] = 0 + end + self:UpdatePlaceValue() +end + +function BP_PlaceModeManager:GetPlacedItemNum(PlaceItemType) + if self.PlacedItemCount[PlaceItemType] then + return self.PlacedItemCount[PlaceItemType] + end + return 0 +end + +function BP_PlaceModeManager:UpdatePlaceValue() + self.PlaceValue = 0 + for i, v in pairs(self.PlacedItemCount) do + self.PlaceValue = self.PlaceValue + PlacementModeConfig.ItemInfo[i].Cost * v + end + self.bPlaceValueIsChange = true +end + +function BP_PlaceModeManager:ClientUpdatePlaceValue(InPlaceValue, InPlacedItemCount) + self.PlaceValue = InPlaceValue + self.PlacedItemCount = InPlacedItemCount + UGCEventSystem.SendEvent(EventEnum.UpdatePlaceValue) + UGCEventSystem.SendEvent(EventEnum.UpdatePlacedItemCount, self.PlacedItemCount) +end + +function BP_PlaceModeManager:GetPlaceValue() + return self.PlaceValue +end + +BP_PlaceModeManager.LastNotifyPlaceValueTime = 0 +BP_PlaceModeManager.NotifyTimeInterval = 1 +function BP_PlaceModeManager:TickUpdatePlaceValue(DeltaTime) + self.LastNotifyPlaceValueTime = self.LastNotifyPlaceValueTime + DeltaTime + if self.bPlaceValueIsChange and self.LastNotifyPlaceValueTime > self.NotifyTimeInterval then + self.LastNotifyPlaceValueTime = 0; + self.bPlaceValueIsChange = false + UGCSendRPCSystem.ActorRPCNotify(nil, self, "ClientUpdatePlaceValue", self.PlaceValue, self.PlacedItemCount) + end +end + + + +-- 放置量参数设置 End ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + + + + +-- 导出/导入放置代码 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +-- 导出 +function BP_PlaceModeManager:ExportPlacementCode() + return PlacementModeConfig.PlaceCodeEncode(self:GetNowMap()) +end + +-- 导入 +---@param IgnoreQuantityLimit 忽略数量限制 为true则忽略 +function BP_PlaceModeManager:ImportPlacementCode(InPlayerKey, InCode, IgnoreQuantityLimit) + if not UGCGameSystem.IsServer() then return end + + if PlacementModeConfig.IsPlaceMode() then + UGCGameSystem.SendModeCustomEvent("ResetAllPlayers") + end + + local DecodeResType, MapType, PlaceItemInfo = PlacementModeConfig.PlaceCodeDecode(InCode) + if PlacementModeConfig.IsPlaceMode() then + UGCSendRPCSystem.RPCEvent(nil, EventEnum.ImportPlacementCallBack, DecodeResType) + end + if DecodeResType == PlacementModeConfig.EPlaceDecodeCallback.Succeed then + UGCLogSystem.LogTree("[BP_PlaceModeManager_ImportPlacementCode] PlaceItemInfo:", PlaceItemInfo) + self:ClearItem() + self:LoadMap(MapType) + -- PlaceItemInfo:PlaceItemType, UnitPos, UnitRot + for i, v in pairs(PlaceItemInfo) do + self:ServerPlace(InPlayerKey, v.PlaceItemType, v.UnitPos, v.UnitRot, IgnoreQuantityLimit) + end + end +end + +--- 强行加载玩家预放置的信息 +function BP_PlaceModeManager:ForcefullyImportMap(InPlayerKey) + if self.PreUsePlayerPlaceItemCode[InPlayerKey] then + -- 强行导入 + self:ImportPlacementCode(InPlayerKey, self.PreUsePlayerPlaceItemCode[InPlayerKey], true) + -- 重置 + self.PreUsePlayerPlaceItemCode[InPlayerKey] = nil + end +end + +--- 预导入地图 +function BP_PlaceModeManager:PreImportPlacementCode(InPlayerKey, InCode) + local bCanUse, PlaceCount, DecodeResType, PlaceItemInfo = PlacementModeConfig.CheckPlayerCanUsePlaceCode(InCode, InPlayerKey) + if DecodeResType == PlacementModeConfig.EPlaceDecodeCallback.Succeed then + if bCanUse then + self:ImportPlacementCode(InPlayerKey, InCode) + else + self.PreUsePlayerPlaceItemCode[InPlayerKey] = InCode + UGCSendRPCSystem.ActorRPCNotify(InPlayerKey, self, "ShowForcefullyImportSecondaryConfirmation") + end + else + if PlacementModeConfig.IsPlaceMode() then + UGCSendRPCSystem.RPCEvent(nil, EventEnum.ImportPlacementCallBack, DecodeResType) + end + end +end + + +--- 给玩家二次确认是否要强行导入不可用的地图,只能在放置模式下使用 +function BP_PlaceModeManager:ShowForcefullyImportSecondaryConfirmation() + local SecondaryConfirmationWidget = WidgetManager:GetPanel(WidgetConfig.EUIType.SecondaryConfirmation) + SecondaryConfirmationWidget:SetTextInfo("该地图已超出您的使用限制,即使保存也无法正常使用。是否强行导入该地图?", "取消", "强行导入") + SecondaryConfirmationWidget:BindConfirmCallBack(function() + UGCSendRPCSystem.ActorRPCNotify(nil, self, "ForcefullyImportMap", UGCSystemLibrary.GetLocalPlayerKey()) + end) + WidgetManager:ShowPanel(WidgetConfig.EUIType.SecondaryConfirmation, false) +end + +function BP_PlaceModeManager:ImportPlacementCodeCallBack(InDecodeResType) + UGCEventSystem.SendEvent(EventEnum.AddTip, InDecodeResType) +end + +--- 加载已保存的放置地图 +function BP_PlaceModeManager:LoadSavedPlaceMap(LoadType, Index) + UGCLogSystem.Log("[BP_PlaceModeManager_LoadSavedPlaceMap] LoadType:%s, Index:%s", tostring(LoadType), tostring(Index)) + if UGCGameSystem.IsServer() then + if LoadType == PlacementModeConfig.LoadPlaceItemsType.SavedMap then + local SavedMapList = ArchiveDataConfig.GetPlayerArchiveDataFromType(UGCSystemLibrary.GetLocalPlayerKey(), ArchiveDataConfig.EArchiveType.SavedMap) + if SavedMapList and SavedMapList[Index] then + self:ImportPlacementCode(self:GetSimplePlayerPC().PlayerKey, SavedMapList[Index].MapCode) + end + elseif LoadType == PlacementModeConfig.LoadPlaceItemsType.None then + self:ClearItem() + elseif LoadType == PlacementModeConfig.LoadPlaceItemsType.Default then + self:ImportPlacementCode(self:GetSimplePlayerPC().PlayerKey, PlacementModeConfig.MapInfo[self:GetNowMap()].DefaultPlaceCode) + end + else + UGCSendRPCSystem.ActorRPCNotify(nil, self, "LoadSavedPlaceMap", LoadType, Index) + end +end + +-- 导出/导入放置代码 End ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + + + +-- 地图 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +function BP_PlaceModeManager:GetNowMap() + return PlacementModeConfig.PlaceMapType.RelicDefenseLine +end + +function BP_PlaceModeManager:LoadMap(InMapType) + +end + +--- 更新可放置位置Actor +function BP_PlaceModeManager:UpdatePlaceableArea() + if self.PlaceableAreaClass == nil then + self.PlaceableAreaClass = UE.LoadClass(PlacementModeConfig.PlaceableAreaPath) + end + if self.PlaceableAreaClass then + self.AllPlaceableAreaActors = GameplayStatics.GetAllActorsOfClass(UGCGameSystem.GameState, self.PlaceableAreaClass) + end +end + +-- 地图 End ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + + + + + +return BP_PlaceModeManager; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/Airblower/BP_Airblower.lua b/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/Airblower/BP_Airblower.lua new file mode 100644 index 00000000..25958f5c --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/Airblower/BP_Airblower.lua @@ -0,0 +1,58 @@ +---@class BP_Airblower_C:BP_airblower_C +---@field PlaceItemType TEnumAsByte +--Edit Below-- + + +local PlaceItemBase = require("Script.Blueprint.PlaceItems.BP_PlaceItemBase") +local BP_Airblower = setmetatable( + { + }, + { + __index = PlaceItemBase, + __metatable = PlaceItemBase + } +) + +function BP_Airblower:ReceiveBeginPlay() + UGCLogSystem.Log("[BP_Airblower_ReceiveBeginPlay]") + self.SuperClass.ReceiveBeginPlay(self); + PlaceItemBase.ParentBeginPlay(self) + UGCLogSystem.Log("[BP_Airblower_ReceiveBeginPlay] Finish") +end + +function BP_Airblower:ReceiveEndPlay() + PlaceItemBase.ParentEndPlay(self) + self.SuperClass.ReceiveEndPlay(self); +end + +--[[ +function BP_Airblower:ReceiveBeginPlay() + self.SuperClass.ReceiveBeginPlay(self); +end +--]] + +--[[ +function BP_Airblower:ReceiveTick(DeltaTime) + self.SuperClass.ReceiveTick(self, DeltaTime); +end +--]] + +--[[ +function BP_Airblower:ReceiveEndPlay() + self.SuperClass.ReceiveEndPlay(self); +end +--]] + +--[[ +function BP_Airblower:GetReplicatedProperties() + return +end +--]] + +--[[ +function BP_Airblower:GetAvailableServerRPCs() + return +end +--]] + +return BP_Airblower; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/Airblower/BP_Preview_Airblower.lua b/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/Airblower/BP_Preview_Airblower.lua new file mode 100644 index 00000000..3c7a0514 --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/Airblower/BP_Preview_Airblower.lua @@ -0,0 +1,46 @@ +---@class BP_Preview_Airblower_C:BP_ClientPreviewItemBase_C +---@field StaticMesh UStaticMeshComponent +--Edit Below-- + +local ClientPreviewItemBase = require("Script.Blueprint.PlaceItems.BP_ClientPreviewItemBase") +local BP_Preview_Airblower = setmetatable( + { + }, + { + __index = ClientPreviewItemBase, + __metatable = ClientPreviewItemBase + } +) + + +function BP_Preview_Airblower:ReceiveBeginPlay() + self.SuperClass.ReceiveBeginPlay(self); + self:AddSMCmp(self.StaticMesh) +end + + +--[[ +function BP_Preview_Airblower:ReceiveTick(DeltaTime) + self.SuperClass.ReceiveTick(self, DeltaTime); +end +--]] + +--[[ +function BP_Preview_Airblower:ReceiveEndPlay() + self.SuperClass.ReceiveEndPlay(self); +end +--]] + +--[[ +function BP_Preview_Airblower:GetReplicatedProperties() + return +end +--]] + +--[[ +function BP_Preview_Airblower:GetAvailableServerRPCs() + return +end +--]] + +return BP_Preview_Airblower; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/BigBanker/BP_BigBunker.lua b/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/BigBanker/BP_BigBunker.lua new file mode 100644 index 00000000..e776c8ae --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/BigBanker/BP_BigBunker.lua @@ -0,0 +1,58 @@ +---@class BP_BigBunker_C:BP_PlaceItemBase_C +---@field Box5 UBoxComponent +---@field Box7 UBoxComponent +---@field Box6 UBoxComponent +---@field Box4 UBoxComponent +---@field Box3 UBoxComponent +---@field Box2 UBoxComponent +---@field Box1 UBoxComponent +---@field Box UBoxComponent +---@field AssistPlacement USceneComponent +---@field StaticMesh UStaticMeshComponent +--Edit Below-- +local PlaceItemBase = require("Script.Blueprint.PlaceItems.BP_PlaceItemBase") +local BP_BigBunker = setmetatable( + { + }, + { + __index = PlaceItemBase, + __metatable = PlaceItemBase + } +) + +function BP_BigBunker:ReceiveBeginPlay() + self.SuperClass.ReceiveBeginPlay(self); + PlaceItemBase.ParentBeginPlay(self) + self:AddSetMobilityComponent({self.StaticMesh}) +end + +function BP_BigBunker:ReceiveEndPlay() + PlaceItemBase.ParentEndPlay(self) + self.SuperClass.ReceiveEndPlay(self); +end + +--[[ +function BP_BigBunker:ReceiveTick(DeltaTime) + self.SuperClass.ReceiveTick(self, DeltaTime); +end +--]] + +--[[ +function BP_BigBunker:ReceiveEndPlay() + self.SuperClass.ReceiveEndPlay(self); +end +--]] + +--[[ +function BP_BigBunker:GetReplicatedProperties() + return +end +--]] + +--[[ +function BP_BigBunker:GetAvailableServerRPCs() + return +end +--]] + +return BP_BigBunker; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/BigBanker/BP_Preview_BigBunker.lua b/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/BigBanker/BP_Preview_BigBunker.lua new file mode 100644 index 00000000..992f5764 --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/BigBanker/BP_Preview_BigBunker.lua @@ -0,0 +1,46 @@ +---@class BP_Preview_BigBunker_C:BP_ClientPreviewItemBase_C +---@field StaticMesh UStaticMeshComponent +--Edit Below-- + +local ClientPreviewItemBase = require("Script.Blueprint.PlaceItems.BP_ClientPreviewItemBase") +local BP_Preview_BigBunker = setmetatable( + { + }, + { + __index = ClientPreviewItemBase, + __metatable = ClientPreviewItemBase + } +) + + +function BP_Preview_BigBunker:ReceiveBeginPlay() + self.SuperClass.ReceiveBeginPlay(self); + self:AddSMCmp(self.StaticMesh) +end + + +--[[ +function BP_Preview_BigBunker:ReceiveTick(DeltaTime) + self.SuperClass.ReceiveTick(self, DeltaTime); +end +--]] + +--[[ +function BP_Preview_BigBunker:ReceiveEndPlay() + self.SuperClass.ReceiveEndPlay(self); +end +--]] + +--[[ +function BP_Preview_BigBunker:GetReplicatedProperties() + return +end +--]] + +--[[ +function BP_Preview_BigBunker:GetAvailableServerRPCs() + return +end +--]] + +return BP_Preview_BigBunker; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/Flamethrower/BP_Flamethrower.lua b/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/Flamethrower/BP_Flamethrower.lua new file mode 100644 index 00000000..01e2b80b --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/Flamethrower/BP_Flamethrower.lua @@ -0,0 +1,168 @@ +---@class BP_Flamethrower_C:BP_PlaceItemBase_C +---@field UGC_TerracottaWarriors_Defense UStaticMeshComponent +---@field Sphere USphereComponent +---@field Cone UStaticMeshComponent +---@field Scene USceneComponent +---@field P_Fire UParticleSystemComponent +---@field Flamethrower UStaticMeshComponent +---@field DamageValue float +---@field ChargingDuration float +---@field InterpSpeed float +--Edit Below-- +---@type BP_Flamethrower_C + + +local PlaceItemBase = require("Script.Blueprint.PlaceItems.BP_PlaceItemBase") +local BP_Flamethrower = setmetatable( + { + DamageFrequency = 10.; + TrackedPlayer = nil; + TrackFrequency = 5.; + }, + { + __index = PlaceItemBase, + __metatable = PlaceItemBase + } +) + + +function BP_Flamethrower:GetReplicatedProperties() + return + "TrackedPlayer", PlaceItemBase.GetReplicatedProperties(self) +end + + +function BP_Flamethrower:ReceiveBeginPlay() + self.SuperClass.ReceiveBeginPlay(self); + PlaceItemBase.ParentBeginPlay(self) +end + +function BP_Flamethrower:ReceiveEndPlay() + PlaceItemBase.ParentEndPlay(self) + self.SuperClass.ReceiveEndPlay(self); +end + + +function BP_Flamethrower:ReceiveTick(DeltaTime) + self.SuperClass.ReceiveTick(self, DeltaTime); + if self.bEnableActive and UE.IsValid(self.TrackedPlayer) and self.TrackedPlayer:IsAlive() then + local FlamethrowerRot = self.Flamethrower:K2_GetComponentRotation() + local TargetPos = self.TrackedPlayer:K2_GetActorLocation() + local TargetDir = VectorHelper.Sub(TargetPos, self:K2_GetActorLocation()) + local TargetRot = KismetMathLibrary.MakeRotFromX(TargetDir) + local NewRot = KismetMathLibrary.RInterpTo(FlamethrowerRot, TargetRot, DeltaTime, InterpSpeed) + self.Flamethrower:K2_SetWorldRotation(NewRot) + UGCLogSystem.Log("[BP_Flamethrower_ReceiveTick]") + end +end + + +function BP_Flamethrower:SetActive(InActive) + -- UGCLogSystem.Log("[BP_LandMine_SetActive]") + PlaceItemBase.SetActive(self, InActive) + if InActive then + if self.TrackHandle == nil then + self.TrackHandle = UGCEventSystem.SetTimerLoop(self, self.DoTrack, 1./ self.TrackFrequency) + end + -- UGCSendRPCSystem.ActorRPCNotify(nil, self, "EnableClientTriggerEffects") + else + if self.TrackHandle then + UGCEventSystem.StopTimer(self.TrackHandle) + self.TrackHandle = nil + end + self.TrackedPlayer = nil + DOREPONCE(self, "TrackedPlayer") + -- UGCSendRPCSystem.ActorRPCNotify(nil, self, "DisableClientTriggerEffects") + end + self.bIsCooling = false +end + +function BP_Flamethrower:OnRep_bEnableActive() + if self.bEnableActive then + self:EnableClientTriggerEffects() + else + self:DisableClientTriggerEffects() + end +end + +function BP_Flamethrower:EnableClientTriggerEffects() + if self then + self.P_Fire:SetActive(true, true) + end +end + +function BP_Flamethrower:DisableClientTriggerEffects() + if self then + self.P_Fire:SetActive(false, true) + end +end + +function BP_Flamethrower:DoTrack() + self:DetectTrackedPlayer() + self:GiveOverlappingPlayerDamage() +end + +function BP_Flamethrower:DetectTrackedPlayer() + local EnableDamagePlayerKeys = UGCSystemLibrary.GetAllPlayerKeys() + local TargetPlayer = nil + local Dir = -1 + local FlamethrowerPos = self.Flamethrower:K2_GetComponentLocation() + local Defender = UGCGameSystem.GameState:GetNowDefender() + for i, PlayerKey in pairs(EnableDamagePlayerKeys) do + if PlayerKey ~= Defender then + local TempPawn = UGCGameSystem.GetPlayerPawnByPlayerKey(PlayerKey) + if TempPawn and TempPawn:IsAlive() and UGCSystemLibrary.CanSeePlayer(self, self.Scene:K2_GetComponentLocation(), TempPawn) then + local TempDir = VectorHelper.Length(VectorHelper.Sub(TempPawn:K2_GetActorLocation(), FlamethrowerPos)) + if TargetPlayer == nil or TempDir < Dir then + TargetPlayer = TempPawn + Dir = TempDir + end + end + end + end + if Dir <= self.Sphere:GetScaledSphereRadius() * 1.5 then + self.TrackedPlayer = TargetPlayer + else + self.TrackedPlayer = nil + end + DOREPONCE(self, "TrackedPlayer") +end + +function BP_Flamethrower:GiveOverlappingPlayerDamage() + local EnableDamagePlayerKeys = UGCSystemLibrary.GetAllPlayerKeys() + local Defender = UGCGameSystem.GameState:GetNowDefender() + local DefenderPC = UGCGameSystem.GetPlayerControllerByPlayerKey(Defender) + for i, PlayerKey in pairs(EnableDamagePlayerKeys) do + if PlayerKey ~= Defender then + local TempPawn = UGCGameSystem.GetPlayerPawnByPlayerKey(PlayerKey) + if TempPawn and TempPawn:IsAlive() and self.Cone:IsOverlappingActor(TempPawn) and UGCSystemLibrary.CanSeePlayer(self, self.Scene:K2_GetComponentLocation(), TempPawn) then + if PlacementModeConfig.IsPlaceMode() then + UGCGameSystem.ApplyDamage(TempPawn, self.DamageValue / self.TrackFrequency, TempPawn:GetController(), self, EDamageType.PoisonDamage) + UGCLogSystem.Log("[BP_Flamethrower_GiveOverlappingPlayerDamage]1 Damage:%s", tostring(self.DamageValue / self.TrackFrequency)) + else + UGCGameSystem.ApplyDamage(TempPawn, self.DamageValue / self.TrackFrequency, DefenderPC, self,EDamageType.PoisonDamage) + UGCLogSystem.Log("[BP_Flamethrower_GiveOverlappingPlayerDamage]2 Damage:%s", tostring(self.DamageValue / self.TrackFrequency)) + end + end + end + end +end + + +function BP_Flamethrower:CheckPlayerInRange(PlayerPawn) + local FlamethrowerPos = self.Flamethrower:K2_GetComponentLocation() + local TempDir = VectorHelper.Length(VectorHelper.Sub(PlayerPawn:K2_GetActorLocation(), FlamethrowerPos)) + return self.Sphere:GetScaledSphereRadius() > TempDir and UGCSystemLibrary.CanSeePlayer(self, self.Scene:K2_GetComponentLocation(), PlayerPawn) +end + + + + + +--[[ +function BP_Flamethrower:GetAvailableServerRPCs() + return +end +--]] + +return BP_Flamethrower; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/Flamethrower/BP_Preview_Flamethrower.lua b/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/Flamethrower/BP_Preview_Flamethrower.lua new file mode 100644 index 00000000..b764c61d --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/Flamethrower/BP_Preview_Flamethrower.lua @@ -0,0 +1,51 @@ +---@class BP_Preview_Flamethrower_C:BP_ClientPreviewItemBase_C +---@field Sphere9 USphereComponent +---@field StaticMesh UStaticMeshComponent +--Edit Below-- + +local ClientPreviewItemBase = require("Script.Blueprint.PlaceItems.BP_ClientPreviewItemBase") +local BP_Preview_Flamethrower = setmetatable( + { + }, + { + __index = ClientPreviewItemBase, + __metatable = ClientPreviewItemBase + } +) + + +function BP_Preview_Flamethrower:ReceiveBeginPlay() + self.SuperClass.ReceiveBeginPlay(self); + self:AddSMCmp(self.StaticMesh) +end +--[[ +function BP_Preview_Flamethrower:ReceiveBeginPlay() + self.SuperClass.ReceiveBeginPlay(self); +end +--]] + +--[[ +function BP_Preview_Flamethrower:ReceiveTick(DeltaTime) + self.SuperClass.ReceiveTick(self, DeltaTime); +end +--]] + +--[[ +function BP_Preview_Flamethrower:ReceiveEndPlay() + self.SuperClass.ReceiveEndPlay(self); +end +--]] + +--[[ +function BP_Preview_Flamethrower:GetReplicatedProperties() + return +end +--]] + +--[[ +function BP_Preview_Flamethrower:GetAvailableServerRPCs() + return +end +--]] + +return BP_Preview_Flamethrower; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/LandMine/BP_LandMine.lua b/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/LandMine/BP_LandMine.lua new file mode 100644 index 00000000..7da920fa --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/LandMine/BP_LandMine.lua @@ -0,0 +1,112 @@ +---@class BP_LandMine_C:BP_PlaceItemBase_C +---@field P_MiniGames_Boom_01 UParticleSystemComponent +---@field SphereDamage USphereComponent +---@field Sphere USphereComponent +---@field StaticMesh UStaticMeshComponent +---@field ExplosionSound UAkAudioEvent +--Edit Below-- + + +local PlaceItemBase = require("Script.Blueprint.PlaceItems.BP_PlaceItemBase") +local BP_LandMine = setmetatable( + { + bIsCooling = false; + Damage = 0; + CoolingTime = 0; + }, + { + __index = PlaceItemBase, + __metatable = PlaceItemBase + } +) + +function BP_LandMine:ReceiveBeginPlay() + self.SuperClass.ReceiveBeginPlay(self); + PlaceItemBase.ParentBeginPlay(self) + if self:HasAuthority() then + UGCSystemLibrary.BindBeginOverlapFunc(self.Sphere, self.OnBeginOverlap, self) + end + self.Damage = PlacementModeConfig.ItemInfo[EPlaceItemType.LandMine].Param.Damage + self.CoolingTime = PlacementModeConfig.ItemInfo[EPlaceItemType.LandMine].Param.CoolingTime +end + +function BP_LandMine:ReceiveEndPlay() + PlaceItemBase.ParentEndPlay(self) + self.SuperClass.ReceiveEndPlay(self); +end + +function BP_LandMine:SetActive(InActive) + -- UGCLogSystem.Log("[BP_LandMine_SetActive]") + PlaceItemBase.SetActive(self, InActive) + if self.CoolingTimeHandle then + UGCEventSystem.StopTimer(self.CoolingTimeHandle) + self.CoolingTimeHandle = nil + end + self.bIsCooling = false +end + +function BP_LandMine:OnBeginOverlap(OverlappedComp, Other, OtherComp, OtherBodyIndex, bFromSweep, SweepResult) + -- UGCLogSystem.Log("[BP_LandMine_OnBeginOverlap] bIsCooling:%s, bEnableActive:%s", tostring(self.bIsCooling), tostring(self.bEnableActive)) + if self.bEnableActive and not self.bIsCooling and Other.PlayerKey ~= UGCGameSystem.GameState:GetNowDefender() then + UGCLogSystem.Log("[BP_LandMine_OnBeginOverlap]2") + self:Explosion() + self.bIsCooling = true + UGCEventSystem.SetTimer(self, function() self.bIsCooling = false end, self.CoolingTime) + end +end + +function BP_LandMine:Explosion() + local AllPawn = UGCGameSystem.GetAllPlayerPawn() + local Defender = UGCGameSystem.GameState:GetNowDefender() + local DefenderPC = UGCGameSystem.GetPlayerControllerByPlayerKey(Defender) + for i, v in pairs(AllPawn) do + if v.PlayerKey ~= Defender and self.SphereDamage:IsOverlappingActor(v) then + if PlacementModeConfig.IsPlaceMode() then + UGCGameSystem.ApplyDamage(v, self.Damage, v:GetController(), self, EDamageType.UGCCustomDamageType + 1) + UGCLogSystem.Log("[BP_LandMine_Explosion]1 Damage:%s", tostring(self.Damage)) + else + UGCGameSystem.ApplyDamage(v, self.Damage, DefenderPC, self, EDamageType.UGCCustomDamageType + 1) + UGCLogSystem.Log("[BP_LandMine_Explosion]2 Damage:%s", tostring(self.Damage)) + end + UGCLogSystem.Log("[BP_LandMine_Explosion]3") + end + end + UGCSendRPCSystem.ActorRPCNotify(nil, self, "ClientExplosionEffect") +end + +function BP_LandMine:ClientExplosionEffect() + self.P_MiniGames_Boom_01:SetActive(true, true) + UGCSoundManagerSystem.PlaySoundAtLocation(self.ExplosionSound, self:K2_GetActorLocation(), self:K2_GetActorRotation()) +end + +--[[ +function BP_LandMine:ReceiveBeginPlay() + self.SuperClass.ReceiveBeginPlay(self); +end +--]] + +--[[ +function BP_LandMine:ReceiveTick(DeltaTime) + self.SuperClass.ReceiveTick(self, DeltaTime); +end +--]] + +--[[ +function BP_LandMine:ReceiveEndPlay() + self.SuperClass.ReceiveEndPlay(self); +end +--]] + +--[[ +function BP_LandMine:GetReplicatedProperties() + return +end +--]] + +--[[ +function BP_LandMine:GetAvailableServerRPCs() + return +end +--]] + +return BP_LandMine; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/LandMine/BP_Preview_LandMine.lua b/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/LandMine/BP_Preview_LandMine.lua new file mode 100644 index 00000000..2f9c7216 --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/LandMine/BP_Preview_LandMine.lua @@ -0,0 +1,52 @@ +---@class BP_Preview_LandMine_C:BP_ClientPreviewItemBase_C +---@field Sphere9 USphereComponent +---@field StaticMesh UStaticMeshComponent +---@field Sphere8 USphereComponent +--Edit Below-- + +local ClientPreviewItemBase = require("Script.Blueprint.PlaceItems.BP_ClientPreviewItemBase") +local BP_Preview_LandMine = setmetatable( + { + }, + { + __index = ClientPreviewItemBase, + __metatable = ClientPreviewItemBase + } +) + + +function BP_Preview_LandMine:ReceiveBeginPlay() + self.SuperClass.ReceiveBeginPlay(self); + self:AddSMCmp(self.StaticMesh) +end +--[[ +function BP_Preview_LandMine:ReceiveBeginPlay() + self.SuperClass.ReceiveBeginPlay(self); +end +--]] + +--[[ +function BP_Preview_LandMine:ReceiveTick(DeltaTime) + self.SuperClass.ReceiveTick(self, DeltaTime); +end +--]] + +--[[ +function BP_Preview_LandMine:ReceiveEndPlay() + self.SuperClass.ReceiveEndPlay(self); +end +--]] + +--[[ +function BP_Preview_LandMine:GetReplicatedProperties() + return +end +--]] + +--[[ +function BP_Preview_LandMine:GetAvailableServerRPCs() + return +end +--]] + +return BP_Preview_LandMine; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/Launch/BP_Launch.lua b/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/Launch/BP_Launch.lua new file mode 100644 index 00000000..0c02622c --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/Launch/BP_Launch.lua @@ -0,0 +1,90 @@ +---@class BP_Launch_C:BP_PlaceItemBase_C +---@field TriggerBox UStaticMeshComponent +---@field P_bounce UParticleSystemComponent +---@field TriggerBoxOld UBoxComponent +---@field Cube UStaticMeshComponent +---@field Scene USceneComponent +---@field ZSpeed FVector +---@field CDTime float +---@field IsAddBuff bool +---@field IsActivate bool +---@field DisableFaillingTime int32 +---@field BouncingSound UAkEventObject +--Edit Below-- +---@type Launch_C +local PlaceItemBase = require("Script.Blueprint.PlaceItems.BP_PlaceItemBase") +local BP_Launch = setmetatable( + { + }, + { + __index = PlaceItemBase, + __metatable = PlaceItemBase + } +) + +function BP_Launch:ReceiveBeginPlay() + self.SuperClass.ReceiveBeginPlay(self); + PlaceItemBase.ParentBeginPlay(self) + self.Jumpers = {} + self.SaveTime = 0 + if self:HasAuthority() then + self.TriggerBox.OnComponentBeginOverlap:Add(self.OnBeginOverlap, self) + self.TriggerBox.OnComponentEndOverlap:Add(self.OnEndOverlap, self) + end +end + +function BP_Launch:ReceiveEndPlay() + PlaceItemBase.ParentEndPlay(self) + self.SuperClass.ReceiveEndPlay(self); +end + + + +function BP_Launch:OnBeginOverlap(OverlappedComp, Other, OtherComp, OtherBodyIndex, bFromSweep, SweepResult) + sandbox.LogNormalDev(StringFormat_Dev("[BP_Launch:OnBeginOverlap] self=%s", GetObjectFullName_Dev(self))) + + local GameState = GameplayStatics.GetGameState(self) + local CurrentServerWorldTimeSeconds = GameState:GetServerWorldTimeSeconds() + local AddSpeed = 0 + local Character = Other.PlayerState:GetPlayerCharacter() + if(self.IsActivate) then + if(Character.CanJump) then + table.insert(self.Jumpers, Other) + end + + if(CurrentServerWorldTimeSeconds - self.SaveTime >= self.CDTime) then + self.SaveTime = CurrentServerWorldTimeSeconds + for i = 1, #self.Jumpers, 1 do + local PlayerCharacter = self.Jumpers[i].PlayerState:GetPlayerCharacter() + if(self.IsAddBuff) then + PlayerCharacter:DisableFallingDamageForPerioud(self.DisableFaillingTime) + end + --考虑角色跳起来的情况 + if PlayerCharacter.CharacterMovement.Velocity.Z < 0 then + AddSpeed = Vector.New(0, 0, self.ZSpeed.Z - PlayerCharacter.CharacterMovement.Velocity.Z) + self.Jumpers[i].CharacterMovement:AddImpulse(AddSpeed, true) + elseif PlayerCharacter.CharacterMovement.Velocity.Z == 0 then + self.Jumpers[i].CharacterMovement:AddImpulse(self.ZSpeed, true) + end + UnrealNetwork.CallUnrealRPC_Multicast(self, "PlayDisappear") + end + end + table.remove(self.Jumpers) + end +end + +function BP_Launch:PlayDisappear() + sandbox.LogNormalDev("[BP_Launch:PlayDisappear]") + local MyLocation = self.TriggerBox:K2_GetComponentLocation() + self.P_bounce:SetActive(true, true) + UGCSoundManagerSystem.PlaySoundAtLocation(self.BouncingSound, MyLocation) +end + +function BP_Launch:ReceiveEndPlay() + sandbox.LogNormalDev("[BP_Launch:ReceiveEndPlay]") + if self:HasAuthority() then + self.TriggerBox.OnComponentBeginOverlap:Remove(self.OnBeginOverlap, self) + self.TriggerBox.OnComponentEndOverlap:Remove(self.OnEndOverlap, self) + end +end +return BP_Launch; diff --git a/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/Launch/BP_Preview_Launch.lua b/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/Launch/BP_Preview_Launch.lua new file mode 100644 index 00000000..29fdcac4 --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/Launch/BP_Preview_Launch.lua @@ -0,0 +1,46 @@ +---@class BP_Preview_Launch_C:BP_ClientPreviewItemBase_C +---@field StaticMesh UStaticMeshComponent +--Edit Below-- + +local ClientPreviewItemBase = require("Script.Blueprint.PlaceItems.BP_ClientPreviewItemBase") +local BP_Preview_Launch = setmetatable( + { + }, + { + __index = ClientPreviewItemBase, + __metatable = ClientPreviewItemBase + } +) + + +function BP_Preview_Launch:ReceiveBeginPlay() + self.SuperClass.ReceiveBeginPlay(self); + self:AddSMCmp(self.StaticMesh) +end + + +--[[ +function BP_Preview_Launch:ReceiveTick(DeltaTime) + self.SuperClass.ReceiveTick(self, DeltaTime); +end +--]] + +--[[ +function BP_Preview_Launch:ReceiveEndPlay() + self.SuperClass.ReceiveEndPlay(self); +end +--]] + +--[[ +function BP_Preview_Launch:GetReplicatedProperties() + return +end +--]] + +--[[ +function BP_Preview_Launch:GetAvailableServerRPCs() + return +end +--]] + +return BP_Preview_Launch; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/Slope/BP_Preview_Slope.lua b/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/Slope/BP_Preview_Slope.lua new file mode 100644 index 00000000..79ce2c61 --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/Slope/BP_Preview_Slope.lua @@ -0,0 +1,47 @@ +---@class BP_Preview_Slope_C:BP_ClientPreviewItemBase_C +---@field Scene USceneComponent +---@field StaticMesh UStaticMeshComponent +--Edit Below-- + +local ClientPreviewItemBase = require("Script.Blueprint.PlaceItems.BP_ClientPreviewItemBase") +local BP_Preview_Slope = setmetatable( + { + }, + { + __index = ClientPreviewItemBase, + __metatable = ClientPreviewItemBase + } +) + + +function BP_Preview_Slope:ReceiveBeginPlay() + self.SuperClass.ReceiveBeginPlay(self); + self:AddSMCmp(self.StaticMesh) +end + + +--[[ +function BP_Preview_Slope:ReceiveTick(DeltaTime) + self.SuperClass.ReceiveTick(self, DeltaTime); +end +--]] + +--[[ +function BP_Preview_Slope:ReceiveEndPlay() + self.SuperClass.ReceiveEndPlay(self); +end +--]] + +--[[ +function BP_Preview_Slope:GetReplicatedProperties() + return +end +--]] + +--[[ +function BP_Preview_Slope:GetAvailableServerRPCs() + return +end +--]] + +return BP_Preview_Slope; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/Slope/BP_Slope.lua b/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/Slope/BP_Slope.lua new file mode 100644 index 00000000..e985f955 --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/Slope/BP_Slope.lua @@ -0,0 +1,54 @@ +---@class BP_Slope_C:BP_PlaceItemBase_C +---@field Box2 UBoxComponent +---@field Box1 UBoxComponent +---@field Box UBoxComponent +---@field AssistPlacement USceneComponent +---@field StaticMesh UStaticMeshComponent +---@field Scene USceneComponent +--Edit Below-- +local PlaceItemBase = require("Script.Blueprint.PlaceItems.BP_PlaceItemBase") +local BP_Slope = setmetatable( + { + }, + { + __index = PlaceItemBase, + __metatable = PlaceItemBase + } +) + +function BP_Slope:ReceiveBeginPlay() + self.SuperClass.ReceiveBeginPlay(self); + PlaceItemBase.ParentBeginPlay(self) + self:AddSetMobilityComponent({self.StaticMesh}) +end + +function BP_Slope:ReceiveEndPlay() + PlaceItemBase.ParentEndPlay(self) + self.SuperClass.ReceiveEndPlay(self); +end + +--[[ +function BP_Slope:ReceiveTick(DeltaTime) + self.SuperClass.ReceiveTick(self, DeltaTime); +end +--]] + +--[[ +function BP_Slope:ReceiveEndPlay() + self.SuperClass.ReceiveEndPlay(self); +end +--]] + +--[[ +function BP_Slope:GetReplicatedProperties() + return +end +--]] + +--[[ +function BP_Slope:GetAvailableServerRPCs() + return +end +--]] + +return BP_Slope; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/SmallBunker/BP_Preview_SmallBunker.lua b/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/SmallBunker/BP_Preview_SmallBunker.lua new file mode 100644 index 00000000..0b0eced6 --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/SmallBunker/BP_Preview_SmallBunker.lua @@ -0,0 +1,46 @@ +---@class BP_Preview_SmallBunker_C:BP_ClientPreviewItemBase_C +---@field StaticMesh UStaticMeshComponent +--Edit Below-- + +local ClientPreviewItemBase = require("Script.Blueprint.PlaceItems.BP_ClientPreviewItemBase") +local BP_Preview_SmallBunker = setmetatable( + { + }, + { + __index = ClientPreviewItemBase, + __metatable = ClientPreviewItemBase + } +) + + +function BP_Preview_SmallBunker:ReceiveBeginPlay() + self.SuperClass.ReceiveBeginPlay(self); + self:AddSMCmp(self.StaticMesh) +end + + +--[[ +function BP_Preview_SmallBunker:ReceiveTick(DeltaTime) + self.SuperClass.ReceiveTick(self, DeltaTime); +end +--]] + +--[[ +function BP_Preview_SmallBunker:ReceiveEndPlay() + self.SuperClass.ReceiveEndPlay(self); +end +--]] + +--[[ +function BP_Preview_SmallBunker:GetReplicatedProperties() + return +end +--]] + +--[[ +function BP_Preview_SmallBunker:GetAvailableServerRPCs() + return +end +--]] + +return BP_Preview_SmallBunker; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/SmallBunker/BP_SmallBunker.lua b/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/SmallBunker/BP_SmallBunker.lua new file mode 100644 index 00000000..478c0cbf --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/PlaceItems/Items/SmallBunker/BP_SmallBunker.lua @@ -0,0 +1,52 @@ +---@class BP_SmallBunker_C:BP_PlaceItemBase_C +---@field Box5 UBoxComponent +---@field Box7 UBoxComponent +---@field Box6 UBoxComponent +---@field Box4 UBoxComponent +---@field Box3 UBoxComponent +---@field Box2 UBoxComponent +---@field Box1 UBoxComponent +---@field Box UBoxComponent +---@field AssistPlacement USceneComponent +---@field StaticMesh UStaticMeshComponent +--Edit Below-- +local PlaceItemBase = require("Script.Blueprint.PlaceItems.BP_PlaceItemBase") +local BP_SmallBunker = setmetatable( + { + }, + { + __index = PlaceItemBase, + __metatable = PlaceItemBase + } +) + +function BP_SmallBunker:ReceiveBeginPlay() + self.SuperClass.ReceiveBeginPlay(self); + PlaceItemBase.ParentBeginPlay(self) + self:AddSetMobilityComponent(self.StaticMesh) +end + +function BP_SmallBunker:ReceiveEndPlay() + PlaceItemBase.ParentEndPlay(self) + self.SuperClass.ReceiveEndPlay(self); +end + +--[[ +function BP_SmallBunker:ReceiveTick(DeltaTime) + self.SuperClass.ReceiveTick(self, DeltaTime); +end +--]] + +--[[ +function BP_SmallBunker:GetReplicatedProperties() + return +end +--]] + +--[[ +function BP_SmallBunker:GetAvailableServerRPCs() + return +end +--]] + +return BP_SmallBunker; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/PlaceItems/PlacementModeConfig.lua b/CounterAttack_Solo/Script/Blueprint/PlaceItems/PlacementModeConfig.lua new file mode 100644 index 00000000..0864164b --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/PlaceItems/PlacementModeConfig.lua @@ -0,0 +1,717 @@ +PlacementModeConfig = PlacementModeConfig or {} +require('Script.Common.ue_enum_custom') + +-- 放置模式ModeID +PlacementModeConfig.PlaceModeID = 1002; +-- 游玩模式ModeID +PlacementModeConfig.PlayModeID = 1001; +-- 当前编解码使用的版本 +PlacementModeConfig.PlaceCodeVersion = 1; +-- 当玩家没有保存地图的情况下使用默认地图 +PlacementModeConfig.GlobalDefaultPlaceCode = "1141E0P0000021J0M0000021I0M0100021H0M0200021G0M0300021F0M0400021E0M0500021D0M0600021C0M0700021B0M0800021B0N0800021D0N0600021A0M0900021A0L0900000@0W0100001E0Q0100001D0L0100001E0M0100000@0E0100001E0L0100001E0O0100000@0F0100000@0G0100000@0H0100000@0Z0100000@0Y0100001E0N0100000@0X0100000@0V0100000@0I0100001E0R0100001E0S0100001D0S010001180N000001180Q0000011B0T0000011B0K00000"; +-- 放置物带有的ActorTag +PlacementModeConfig.PlaceItemTag = "PlaceItem" + + + + + +-- Path -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +-- Manager +PlacementModeConfig.PlaceManagerPath = UGCGameSystem.GetUGCResourcesFullPath('Asset/Blueprint/PlaceItems/BP_PlaceModeManager.BP_PlaceModeManager_C') +-- ItemBase +PlacementModeConfig.PlaceItemBasePath = UGCGameSystem.GetUGCResourcesFullPath('Asset/Blueprint/PlaceItems/BP_PlaceItemBase.BP_PlaceItemBase_C') +-- 跑图的阻挡体Actor +PlacementModeConfig.PassagewayBlockPath = UGCGameSystem.GetUGCResourcesFullPath('Asset/Blueprint/SceneActor/PlaceMode/BP_PassagewayBlock.BP_PassagewayBlock_C') +-- 可放置范围Actor +PlacementModeConfig.PlaceableAreaPath = UGCGameSystem.GetUGCResourcesFullPath('Asset/Blueprint/SceneActor/PlaceMode/BP_PlaceableArea.BP_PlaceableArea_C') +-- 预览材质 +PlacementModeConfig.PreviewMatPath = UGCGameSystem.GetUGCResourcesFullPath('Asset/Material/PlaceMat/MAT_ClientPreview.MAT_ClientPreview') +-- 防线路径 +PlacementModeConfig.LineOfDefensePath = UGCGameSystem.GetUGCResourcesFullPath('Asset/Blueprint/SceneActor/PlaceMode/BP_LineOfDefense.BP_LineOfDefense_C') + +-- Path End ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + + + +PlacementModeConfig.PlacingAttr = { + -- 采用对象池放置时可以减少性能开销,但不能设置为不可移动因此不能攀爬 + IsObjectPoolPlace = false; + -- 放置时单位点之间的距离 + PositionSpacing = 100; + -- 设置旋转时的单位旋转间隔 + RotationSpacing = 90; + -- 初始位置(即未放置时的单位位置) + SpawnPos = {X = 0, Y = 0, Z = -3000}; + -- 保存的地图上限 + MaxSavedMapNum = 6; + -- 保存的放置物命名utf-8字符串长度限制 + PlaceMapNameLengthLimit = 6; + -- 代码长度上限 + MaxPlaceCodeLen = 800; + ----------------------------TraceParam + -- 启用检测时的绘制 + EnableDrawDebug = false; + -- 检测位置的时间间隔 + CheckPosTimeInterval = 0.0; + -- 检测位置的距离 + TraceDis = 2000; + -- 检测移除Item的距离 + TraceRemoveDis = 5000; + -- 移除时检测位置的时间间隔 + CheckRemoveItemTimeInterval = 0.2; + -- 检测放置的碰撞类型 + TraceObjType = {ECollisionChannel.ECC_WorldStatic, ECollisionChannel.ECC_WorldDynamic}; + -- 检测移除的碰撞类型 + RemoveTraceObjType = {ECollisionChannel.ECC_WorldStatic, ECollisionChannel.ECC_WorldDynamic,}; + -- 可放置的颜色 + CanPlaceColor = {R=0.000000,G=1.000000,B=0.838520,A=1.000000}; + -- 不可放置的颜色 + CanNotPlaceColor = {R=1.000000,G=0.000000,B=0.000000,A=1.000000}; + ----------------------------TraceParam End + + ----------------------------PlaceValue + -- 基础放置量 + BasePlaceValue = 100; + -- 最大放置量 + MaxPlaceValue = 300; + -- 每级增加放置量 + LevelUpPlaceValue = 2; + ----------------------------PlaceValue End + + ---------------------------- LineOfDefense + -- 每名玩家需要通过防线的次数 + NumOfPlayerBreakingThroughDefenseLine = 3; + -- 击杀得分 + KillAddScore = 2; + -- 助攻得分 + AssistAddScore = 1; + -- 防守成功得分 + DefendSucceedAddScore = 30; + -- 进入防线得分 + EnterDefenseLineAddScore = 10; + -- 距离防线2D半径内不可放置物体 + LineOfDefenseRadius = 300; + -- 高度不能在防线范围内 + LineOfDefenseHeight = 500; + ---------------------------- LineOfDefense End + + -- Shop --------------------------------------------------------- + ---------------------------- subscription ratio + -- 金币兑换Exp的比例 + RatioGoldToExp = 1; + -- 金砖兑换金币的比例 + RatioGoldBrickToGold = 10; + -- 绿洲币兑换金砖比例 + RatioOasisCoinToGoldBrick = 1; + ---------------------------- subscription ratio End + -- 金砖购买名 + GoldBrickName = "GoldBrick"; + -- 单次购买数量 + BuyGoldBrickCount = 100; + -- Shop --------------------------------------------------------- +} + +-- Enum ---------------------------------------------------------------------------------------------- +-- 放置模式类型 +PlacementModeConfig.EPlaceMode = { + None = 1; + PlaceMode = 2; + RemoveMode = 3; +} + + +-- 放置是否成功的回调类型 +PlacementModeConfig.EPlaceCallback = { + Succeed = 1; + InsufficientPlaceValue = 2; + InsufficientNumberOfItem = 3; + LocationNotWithinRange = 4; +} + +-- 加载已保存放置物的类型 +PlacementModeConfig.LoadPlaceItemsType = { + None = 0, + Default = 1, + SavedMap = 2, +} + +-- 放置地图类型 +PlacementModeConfig.PlaceMapType = { + RelicDefenseLine = 1; +} + +-- 得分类型 +PlacementModeConfig.AddScoreType = { + KillAddScore = 1; -- 击杀得分 + AssistAddScore = 2; -- 助攻得分 + DefendSucceedAddScore = 3; -- 防守成功得分 + EnterDefenseLineAddScore = 4; -- 进入防线得分 + Dead = 5; -- 玩家死亡 +} + +-- 放置代码导入反馈类型 +PlacementModeConfig.EPlaceDecodeCallback = { + Succeed = 1; -- 导入成功 + VersionError = 2; -- 版本代码出错 + CodeLengthError = 3; -- 代码长度异常 + MapCodeError = 4; -- 地图类型错误 + PlacePosRangeError = 5; -- 放置点位不在范围内 + CharRangeError = 5; -- 代码字符存在异常字符 + PlaceItemTypeError = 6; -- 放置物类型异常 +} + +-- 解锁物体类型 +PlacementModeConfig.EUnlockType = { + None = 1; + Level = 2; + Gold = 3; + GoldBrick = 4; +} + +-- Enum End ------------------------------------------------------------------------------------------ + + +-- 放置失败的回调名 +PlacementModeConfig.PlaceCallbackName = { + [PlacementModeConfig.EPlaceCallback.Succeed] = "放置成功"; + [PlacementModeConfig.EPlaceCallback.InsufficientPlaceValue] = "放置空间不足"; + [PlacementModeConfig.EPlaceCallback.InsufficientNumberOfItem] = "物品数量不足"; + [PlacementModeConfig.EPlaceCallback.LocationNotWithinRange] = "该位置不在可放置范围内"; +} + +-- 地图信息 +PlacementModeConfig.MapInfo = { + [PlacementModeConfig.PlaceMapType.RelicDefenseLine] = { + MapName = "遗迹防线"; + -- 跑图测试的时间上限 + BreakThroughTestTime = 20; + MapPlacingRange = {X = 2000, Y = 2000, Z = 2000}; + DefaultPlaceCode = "1141E0P0000021J0M0000021I0M0100021H0M0200021G0M0300021F0M0400021E0M0500021D0M0600021C0M0700021B0M0800021B0N0800021D0N0600021A0M0900021A0L0900000@0W0100001E0Q0100001D0L0100001E0M0100000@0E0100001E0L0100001E0O0100000@0F0100000@0G0100000@0H0100000@0Z0100000@0Y0100001E0N0100000@0X0100000@0V0100000@0I0100001E0R0100001E0S0100001D0S010001180N000001180Q0000011B0T0000011B0K00000"; + } +} + + + +-- Item +PlacementModeConfig.ItemInfo = { + [EPlaceItemType.SmallBunker] = { + Name = "小型掩体"; + Desc = "可以挡子弹或作为踏板。"; + ItemPath = UGCGameSystem.GetUGCResourcesFullPath('Asset/Blueprint/PlaceItems/Items/SmallBunker/BP_SmallBunker.BP_SmallBunker_C'); + PreviewItemPath = UGCGameSystem.GetUGCResourcesFullPath('Asset/Blueprint/PlaceItems/Items/SmallBunker/BP_Preview_SmallBunker.BP_Preview_SmallBunker_C'); + SelectTex = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/PlaceItem/T_SmallBunker.T_SmallBunker'); + MaxCount = 50; + InitialCount = 20; + Cost = 2; + RemovePointToActor = false; -- 若为true则移除指针指向Actor根位置,反之则指向边框的中心点 + IncrementInfo = { + UnlockType = PlacementModeConfig.EUnlockType.Gold; + Cost = 500; + }; + UnlockInfo = { + UnlockType = PlacementModeConfig.EUnlockType.None; + } + }, + [EPlaceItemType.BigBunker] = { + Name = "大型掩体"; + Desc = "比小型掩体大很多,可以阻挡敌人前进,在无协助攀爬的情况下无法直接爬上去。"; + ItemPath = UGCGameSystem.GetUGCResourcesFullPath('Asset/Blueprint/PlaceItems/Items/BigBanker/BP_BigBunker.BP_BigBunker_C'); + PreviewItemPath = UGCGameSystem.GetUGCResourcesFullPath('Asset/Blueprint/PlaceItems/Items/BigBanker/BP_Preview_BigBunker.BP_Preview_BigBunker_C'); + SelectTex = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/PlaceItem/T_BigBunker.T_BigBunker'); + MaxCount = 10; + InitialCount = 4; + Cost = 5; + RemovePointToActor = false; -- 若为true则移除指针指向Actor根位置,反之则指向边框的中心点 + IncrementInfo = { + UnlockType = PlacementModeConfig.EUnlockType.Gold; + Cost = 1000; + }; + UnlockInfo = { + UnlockType = PlacementModeConfig.EUnlockType.None; + } + }, + [EPlaceItemType.Slope] = { + Name = "斜坡木板"; + Desc = "可快速走到一定的高度。"; + ItemPath = UGCGameSystem.GetUGCResourcesFullPath('Asset/Blueprint/PlaceItems/Items/Slope/BP_Slope.BP_Slope_C'); + PreviewItemPath = UGCGameSystem.GetUGCResourcesFullPath('Asset/Blueprint/PlaceItems/Items/Slope/BP_Preview_Slope.BP_Preview_Slope_C'); + SelectTex = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/PlaceItem/T_Slope.T_Slope'); + MaxCount = 40; + InitialCount = 15; + Cost = 2; + RemovePointToActor = false; -- 若为true则移除指针指向Actor根位置,反之则指向边框的中心点 + IncrementInfo = { + UnlockType = PlacementModeConfig.EUnlockType.Gold; + Cost = 500; + }; + UnlockInfo = { + UnlockType = PlacementModeConfig.EUnlockType.None; + } + }, + [EPlaceItemType.Launch] = { + Name = "蹦床"; + Desc = "弹射玩家到一定的高度。"; + ItemPath = UGCGameSystem.GetUGCResourcesFullPath('Asset/Blueprint/PlaceItems/Items/Launch/BP_Launch.BP_Launch_C'); + PreviewItemPath = UGCGameSystem.GetUGCResourcesFullPath('Asset/Blueprint/PlaceItems/Items/Launch/BP_Preview_Launch.BP_Preview_Launch_C'); + SelectTex = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/PlaceItem/T_Launch.T_Launch'); + MaxCount = 4; + InitialCount = 0; + Cost = 10; + RemovePointToActor = true; -- 若为true则移除指针指向Actor根位置,反之则指向边框的中心点 + IncrementInfo = { + UnlockType = PlacementModeConfig.EUnlockType.Gold; + Cost = 1500; + }; + UnlockInfo = { + UnlockType = PlacementModeConfig.EUnlockType.Level; + Cost = 3; + } + }, + + [EPlaceItemType.LandMine] = { + Name = "地雷"; + Desc = "进攻玩家走入范围内会发生爆炸,造成80点伤害,10s冷却。"; + ItemPath = UGCGameSystem.GetUGCResourcesFullPath('Asset/Blueprint/PlaceItems/Items/LandMine/BP_LandMine.BP_LandMine_C'); + PreviewItemPath = UGCGameSystem.GetUGCResourcesFullPath('Asset/Blueprint/PlaceItems/Items/LandMine/BP_Preview_LandMine.BP_Preview_LandMine_C'); + SelectTex = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/PlaceItem/T_LandMine.T_LandMine'); + MaxCount = 6; + InitialCount = 1; + Cost = 15; + RemovePointToActor = true; -- 若为true则移除指针指向Actor根位置,反之则指向边框的中心点 + IncrementInfo = { + UnlockType = PlacementModeConfig.EUnlockType.Gold; + Cost = 3000; + }; + UnlockInfo = { + UnlockType = PlacementModeConfig.EUnlockType.None; + }; + -- 其他参数 + Param = { Damage = 80; CoolingTime = 10;} + }, + [EPlaceItemType.Flamethrower] = { + Name = "喷火装置"; + Desc = "对范围8m内最近的敌人造成范围伤害。"; + ItemPath = UGCGameSystem.GetUGCResourcesFullPath('Asset/Blueprint/PlaceItems/Items/Flamethrower/BP_Flamethrower.BP_Flamethrower_C'); + PreviewItemPath = UGCGameSystem.GetUGCResourcesFullPath('Asset/Blueprint/PlaceItems/Items/Flamethrower/BP_Preview_Flamethrower.BP_Preview_Flamethrower_C'); + SelectTex = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/PlaceItem/T_Framethrower.T_Framethrower'); + MaxCount = 2; + InitialCount = 0; + Cost = 20; + RemovePointToActor = true; -- 若为true则移除指针指向Actor根位置,反之则指向边框的中心点 + IncrementInfo = { + UnlockType = PlacementModeConfig.EUnlockType.Gold; + Cost = 5000; + }; + UnlockInfo = { + UnlockType = PlacementModeConfig.EUnlockType.Level; + Cost = 8; + }; + -- 其他参数 + Param = { Damage = 10; } + }, +} + +-- 得分数值 +PlacementModeConfig.ScoreVal = { + [PlacementModeConfig.AddScoreType.KillAddScore] = 2; -- 击杀得分 + [PlacementModeConfig.AddScoreType.AssistAddScore] = 1; -- 助攻得分 + [PlacementModeConfig.AddScoreType.DefendSucceedAddScore] = 30; -- 防守成功得分 + [PlacementModeConfig.AddScoreType.EnterDefenseLineAddScore] = 10; -- 进入防线得分 + [PlacementModeConfig.AddScoreType.Dead] = 0; -- 玩家死亡 +} + +-- 得分名称 +PlacementModeConfig.AddScoreName = { + [PlacementModeConfig.AddScoreType.KillAddScore] = "淘汰得分"; + [PlacementModeConfig.AddScoreType.AssistAddScore] = "助攻得分"; + [PlacementModeConfig.AddScoreType.DefendSucceedAddScore] = "防守成功"; + [PlacementModeConfig.AddScoreType.EnterDefenseLineAddScore] = "突破得分"; +} + +PlacementModeConfig.UnlockName = { + [PlacementModeConfig.EUnlockType.None] = ""; + [PlacementModeConfig.EUnlockType.Level] = "等级"; + [PlacementModeConfig.EUnlockType.Gold] = "金币"; + [PlacementModeConfig.EUnlockType.GoldBrick] = "金砖"; +} + +-- Function ============================================================================================================================================================================================ +--- 获取放置控制器Manager +PlacementModeConfig.GetPlaceManager = function() + if not UE.IsValid(PlacementModeConfig.PlaceManager) then + PlacementModeConfig.PlaceManager = UGCSystemLibrary.GetUniqueInstanceFromPath(PlacementModeConfig.PlaceManagerPath) + end + return PlacementModeConfig.PlaceManager +end + +--- 获取放置模式的父类Class +PlacementModeConfig.GetPlaceItemBaseClass = function() + if PlacementModeConfig.PlaceItemBaseClass == nil then + PlacementModeConfig.PlaceItemBaseClass = UE.LoadClass(PlacementModeConfig.PlaceItemBasePath) + end + return PlacementModeConfig.PlaceItemBaseClass +end + +--- 是否为放置模式 +PlacementModeConfig.IsPlaceMode = function() + return PlacementModeConfig.PlaceModeID == UGCMultiMode.GetModeID() +end + +--- 通过当前在线的进攻玩家数,进行判断应该突破防线的次数 +function PlacementModeConfig.GetNumOfBreakingThroughDefenseLine() + local PCNum = #UGCGameSystem.GetAllPlayerController() + return (PCNum - 1) * PlacementModeConfig.PlacingAttr.NumOfPlayerBreakingThroughDefenseLine +end + +--- 获取放置物解锁条件信息 +function PlacementModeConfig.GetPlaceItemUnlockInfo(PlaceItemType) + local PlaceItemInfo = PlacementModeConfig.ItemInfo[PlaceItemType] + if PlaceItemInfo then + return PlaceItemInfo.UnlockInfo.UnlockType, PlaceItemInfo.UnlockInfo.Cost + end +end + +--- 获取放置物增量条件信息 +function PlacementModeConfig.GetPlaceItemIncrementInfo(PlaceItemType) + local PlaceItemInfo = PlacementModeConfig.ItemInfo[PlaceItemType] + if PlaceItemInfo then + return PlaceItemInfo.IncrementInfo.UnlockType, PlaceItemInfo.IncrementInfo.Cost + end +end + +--- 获取最大放置量 +function PlacementModeConfig.GetPlaceMaxValue(InPlayerKey) + local Exp = ArchiveDataConfig.GetPlayerArchiveDataFromType(InPlayerKey, ArchiveDataConfig.EArchiveType.Exp) + Exp = Exp and Exp or 0 + local Level = LevelConfig.GetLevel(Exp) + return PlacementModeConfig.PlacingAttr.BasePlaceValue + (Level - 1) * PlacementModeConfig.PlacingAttr.LevelUpPlaceValue +end + +--- 设置所有放置机关的激活 +function PlacementModeConfig.ActiveAllPlaceItem(IsActive) + local SceneAllPlaceItems = GameplayStatics.GetAllActorsOfClass(UGCGameSystem.GameState, PlacementModeConfig.GetPlaceItemBaseClass(), {}) + for i, v in pairs(SceneAllPlaceItems) do + v:SetActive(IsActive) + end +end + +--- 获取玩家可放置某物体的数量 +function PlacementModeConfig.GetPlayerPlaceItemCount(PlayerKey, InItemType) + local ItemIncrement = ArchiveDataConfig.GetPlayerArchiveDataFromType(PlayerKey, ArchiveDataConfig.EArchiveType.ItemIncrement) + local ItemInfo = PlacementModeConfig.ItemInfo[InItemType] + if ItemIncrement and ItemIncrement[InItemType] then + return math.clamp(ItemIncrement[InItemType] + ItemInfo.InitialCount, 0, ItemInfo.MaxCount) + end + return ItemInfo.InitialCount +end + +--- 获取放置代码中含有的物体数量 +function PlacementModeConfig.GetPlaceCodeHaveItemCont(InCode) + local PlaceItemCount = {} + local DecodeResType, MapType, PlaceItemInfo = PlacementModeConfig.PlaceCodeDecode(InCode) + if DecodeResType == PlacementModeConfig.EPlaceDecodeCallback.Succeed then + for i, v in pairs(PlaceItemInfo) do + if PlaceItemCount[v.PlaceItemType] then + PlaceItemCount[v.PlaceItemType] = PlaceItemCount[v.PlaceItemType] + 1 + else + PlaceItemCount[v.PlaceItemType] = 1 + end + end + end + return DecodeResType, PlaceItemCount, PlaceItemInfo +end + +--- 判断该代码是否满足该玩家可用的需求 +---@return CanUse, PlaceCount, DecodeResType +function PlacementModeConfig.CheckPlayerCanUsePlaceCode(InCode, InPlayerKey) + local DecodeResType, PlaceItemCount, PlaceItemInfo = PlacementModeConfig.GetPlaceCodeHaveItemCont(InCode) + if DecodeResType == PlacementModeConfig.EPlaceDecodeCallback.Succeed then + local PlaceCount = 0 + local CanPlace = true + for PlaceItemType, Count in pairs(PlaceItemCount) do + if CanPlace and PlacementModeConfig.GetPlayerPlaceItemCount(InPlayerKey, PlaceItemType) < Count then + CanPlace = false + end + PlaceCount = PlaceCount + PlacementModeConfig.ItemInfo[PlaceItemType].Cost * Count + end + if not CanPlace then + return false, PlaceCount, DecodeResType, PlaceItemInfo + end + if PlaceCount > PlacementModeConfig.GetPlaceMaxValue(InPlayerKey) then + return false, PlaceCount + end + return true, PlaceCount, DecodeResType, PlaceItemInfo + end + return false, 0, DecodeResType, PlaceItemInfo +end + +function PlacementModeConfig.GetSimpleLineOfDefense() + if not UE.IsValid(PlacementModeConfig.SimpleLineOfDefense) then + PlacementModeConfig.SimpleLineOfDefense = UGCSystemLibrary.GetUniqueInstanceFromPath(PlacementModeConfig.LineOfDefensePath) + end + return PlacementModeConfig.SimpleLineOfDefense +end + +-- 格式化坐标和旋转 ---------------------------------------------------------------------------------------------------------------------------------------------- +---@param Vec FVector +PlacementModeConfig.VectorToUnitVector = function(Vec) + return { + X = KismetMathLibrary.Round(Vec.X / PlacementModeConfig.PlacingAttr.PositionSpacing), + Y = KismetMathLibrary.Round(Vec.Y / PlacementModeConfig.PlacingAttr.PositionSpacing), + Z = KismetMathLibrary.Round(Vec.Z / PlacementModeConfig.PlacingAttr.PositionSpacing), + } +end + +---@param Vec FVector +PlacementModeConfig.UnitVectorToVector = function(Vec) + return { + X = Vec.X * PlacementModeConfig.PlacingAttr.PositionSpacing, + Y = Vec.Y * PlacementModeConfig.PlacingAttr.PositionSpacing, + Z = Vec.Z * PlacementModeConfig.PlacingAttr.PositionSpacing, + } +end + +---@param Rot FRotator +PlacementModeConfig.RotatorToUnitRotator = function(Rot) + return { + Roll = KismetMathLibrary.Round((Rot.Roll % 360) / PlacementModeConfig.PlacingAttr.RotationSpacing), + Pitch = KismetMathLibrary.Round((Rot.Pitch % 360) / PlacementModeConfig.PlacingAttr.RotationSpacing), + Yaw = KismetMathLibrary.Round((Rot.Yaw % 360) / PlacementModeConfig.PlacingAttr.RotationSpacing), + } +end + +---@param Rot FRotator +PlacementModeConfig.UnitRotatorToRotator = function(Rot) + return { + Roll = Rot.Roll * PlacementModeConfig.PlacingAttr.RotationSpacing, + Pitch = Rot.Pitch * PlacementModeConfig.PlacingAttr.RotationSpacing, + Yaw = Rot.Yaw * PlacementModeConfig.PlacingAttr.RotationSpacing, + } +end + +-- 格式化坐标和旋转 End ------------------------------------------------------------------------------------------------------------------------------------------ + +-- 单例预览材质 ------------------------------------------------------------------------------------------------------------------------------------------------- +--- 获取放置时的动态材质 +function PlacementModeConfig.GetPreviewDynamicMat() + if PlacementModeConfig.DynamicMaterial == nil then + local PreviewMat = UE.LoadObject(PlacementModeConfig.PreviewMatPath) + PlacementModeConfig.DynamicMaterial = KismetMaterialLibrary.CreateDynamicMaterialInstance(UGCGameSystem.GameState, PreviewMat); + end + return PlacementModeConfig.DynamicMaterial +end + +--- 设置是否可放置 +PlacementModeConfig.bCanPlace = true +function PlacementModeConfig.SetCanPlace(InCanPlace) + if InCanPlace ~= PlacementModeConfig.bCanPlace then + PlacementModeConfig.bCanPlace = InCanPlace + --- 设置预览放置物动态材质的颜色 + if PlacementModeConfig.bCanPlace then + PlacementModeConfig.GetPreviewDynamicMat():SetVectorParameterValue("Diff_Light", PlacementModeConfig.PlacingAttr.CanPlaceColor) + else + PlacementModeConfig.GetPreviewDynamicMat():SetVectorParameterValue("Diff_Light", PlacementModeConfig.PlacingAttr.CanNotPlaceColor) + end + end +end + +-- 单例预览材质 End --------------------------------------------------------------------------------------------------------------------------------------------- + + + + + +-- 导出/导入放置代码 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +--- 采用72进制作为编码 +PlacementModeConfig.base72_chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!@#$%^&*()" +PlacementModeConfig.StrToBase72 = {["0"] = 0, ["1"] = 1, ["2"] = 2, ["3"] = 3, ["4"] = 4, ["5"] = 5, ["6"] = 6, ["7"] = 7, ["8"] = 8, ["9"] = 9, ["A"] = 10, ["B"] = 11, ["C"] = 12, ["D"] = 13, ["E"] = 14, ["F"] = 15, ["G"] = 16, ["H"] = 17, ["I"] = 18, ["J"] = 19, ["K"] = 20, ["L"] = 21, ["M"] = 22, ["N"] = 23, ["O"] = 24, ["P"] = 25, ["Q"] = 26, ["R"] = 27, ["S"] = 28, ["T"] = 29, ["U"] = 30, ["V"] = 31, ["W"] = 32, ["X"] = 33, ["Y"] = 34, ["Z"] = 35, ["a"] = 36, ["b"] = 37, ["c"] = 38, ["d"] = 39, ["e"] = 40, ["f"] = 41, ["g"] = 42, ["h"] = 43, ["i"] = 44, ["j"] = 45, ["k"] = 46, ["l"] = 47, ["m"] = 48, ["n"] = 49, ["o"] = 50, ["p"] = 51, ["q"] = 52, ["r"] = 53, ["s"] = 54, ["t"] = 55, ["u"] = 56, ["v"] = 57, ["w"] = 58, ["x"] = 59, ["y"] = 60, ["z"] = 61, ["!"] = 62, ["@"] = 63, ["#"] = 64, ["$"] = 65, ["%"] = 66, ["^"] = 67, ["&"] = 68, ["*"] = 69, ["("] = 70, [")"] = 71, } +PlacementModeConfig.Base72ToStr = { [0] = "0", [1] = "1", [2] = "2", [3] = "3", [4] = "4", [5] = "5", [6] = "6", [7] = "7", [8] = "8", [9] = "9", [10] = "A", [11] = "B", [12] = "C", [13] = "D", [14] = "E", [15] = "F", [16] = "G", [17] = "H", [18] = "I", [19] = "J", [20] = "K", [21] = "L", [22] = "M", [23] = "N", [24] = "O", [25] = "P", [26] = "Q", [27] = "R", [28] = "S", [29] = "T", [30] = "U", [31] = "V", [32] = "W", [33] = "X", [34] = "Y", [35] = "Z", [36] = "a", [37] = "b", [38] = "c", [39] = "d", [40] = "e", [41] = "f", [42] = "g", [43] = "h", [44] = "i", [45] = "j", [46] = "k", [47] = "l", [48] = "m", [49] = "n", [50] = "o", [51] = "p", [52] = "q", [53] = "r", [54] = "s", [55] = "t", [56] = "u", [57] = "v", [58] = "w", [59] = "x", [60] = "y", [61] = "z", [62] = "!", [63] = "@", [64] = "#", [65] = "$", [66] = "%", [67] = "^", [68] = "&", [69] = "*", [70] = "(", [71] = ")", } + +-- 十进制转换为72进制的函数 +---@param n 十进制数 +---@param CompletingDigits 需要补全的数字,为nil则不补全 +function PlacementModeConfig.DToBase72(n, CompletingDigits) + local result = "" + if n == 0 then + result = "0" + else + local base = 72 + -- UGCLogSystem.Log("[PlacementModeConfig_DToBase72] n:%s", tostring(n)) + while n > 0 do + local remainder = n % base + -- UGCLogSystem.Log("[PlacementModeConfig_DToBase72]---- n:%s", tostring(n)) + result = PlacementModeConfig.Base72ToStr[remainder] .. result + n = math.floor(n / base) + end + end + + if CompletingDigits then + while string.len(result) < CompletingDigits do + result = "0" .. result + end + end + + return result +end + +-- 72进制转换为十进制的函数 +function PlacementModeConfig.base72ToD(base72Str) + local Res = 0 + local LenStr = string.len(base72Str) + for i = 1, LenStr, 1 do + local chr = string.sub(base72Str, LenStr - i + 1, LenStr - i + 1) + Res = Res + PlacementModeConfig.StrToBase72[chr] * 72 ^ (i - 1) + end + -- 四舍五入 + return math.floor(Res + 0.5) +end + + + + + + +function PlacementModeConfig.PlaceCodeEncode(InMapType) + return PlacementModeConfig.PlaceCodeVersionFuncList[PlacementModeConfig.PlaceCodeVersion].Encode(InMapType) +end + +--- 对放置代码进行验证并解码 +---@return " EPlaceDecodeCallback, MapType, PlaceItemInfo = {PlaceItemType = PlaceItemType, UnitPos = UnitPos, UnitRot = UnitRot}" +function PlacementModeConfig.PlaceCodeDecode(PlaceCode) + local CodeLen = string.len(PlaceCode) + -- 检验字符范围是否在72个字符内 + for i = 1, CodeLen do + local CodeStr = string.sub(PlaceCode, i, i) + if PlacementModeConfig.StrToBase72[CodeStr] == nil then + return PlacementModeConfig.EPlaceDecodeCallback.CharRangeError + end + end + + -- 检验版本和地图的字符长度 + if CodeLen < 2 or CodeLen > PlacementModeConfig.PlacingAttr.MaxPlaceCodeLen then + return PlacementModeConfig.EPlaceDecodeCallback.CodeLengthError + end + + local Version = PlacementModeConfig.StrToBase72[string.sub(PlaceCode, 1, 1)] + local CodeFuncList = PlacementModeConfig.PlaceCodeVersionFuncList[Version] + + -- 检验版本是否出错 + if CodeFuncList == nil then + return PlacementModeConfig.EPlaceDecodeCallback.VersionError + end + + return CodeFuncList.Decode(PlaceCode) +end + +-- V1版本编码 +--[[ + 地图编号1位72进制 -- 占位1位 + 放置物(类型1位,位置信息6位(XYZ各2位),旋转信息3位(RPY各1位)) -- 占位10位 +]] + +function PlacementModeConfig.PlaceCodeEncode_V01(MapType) + + -- 编码版本 此函数版本为1 + local ResString = PlacementModeConfig.Base72ToStr[1] + + -- 地图占1位 + ResString = ResString .. PlacementModeConfig.Base72ToStr[MapType] + + -- 对场景中所有已激活的放置物进行编码 + local SceneAllPlaceItems = GameplayStatics.GetAllActorsOfClass(UGCGameSystem.GameState, PlacementModeConfig.GetPlaceItemBaseClass(), {}) + for i, v in pairs(SceneAllPlaceItems) do + -- 判断该物体是否激活 + if v:GetIsPlaced() then + local AddStr = "" + -- 编码物体类型 + local ItemType = v:GetPlaceItemType() + AddStr = AddStr .. PlacementModeConfig.DToBase72(ItemType) + --UGCLogSystem.Log("[PlacementModeConfig_PlaceCodeEncode_V01]_1 ResString:%s", ResString) + -- 编码物体位置和旋转 + local Pos, Rot = v:GetPlacePosAndRot() + --UGCLogSystem.LogTree("[PlacementModeConfig_PlaceCodeEncode_V01] Pos", Pos) + --UGCLogSystem.LogTree("[PlacementModeConfig_PlaceCodeEncode_V01] Rot", Rot); + AddStr = AddStr .. PlacementModeConfig.DToBase72(Pos.X, 2) + AddStr = AddStr .. PlacementModeConfig.DToBase72(Pos.Y, 2) + AddStr = AddStr .. PlacementModeConfig.DToBase72(Pos.Z, 2) + --UGCLogSystem.Log("[PlacementModeConfig_PlaceCodeEncode_V01]_2 ResString:%s", ResString) + AddStr = AddStr .. PlacementModeConfig.DToBase72(Rot.Roll) + AddStr = AddStr .. PlacementModeConfig.DToBase72(Rot.Pitch) + AddStr = AddStr .. PlacementModeConfig.DToBase72(Rot.Yaw) + --UGCLogSystem.Log("[PlacementModeConfig_PlaceCodeEncode_V01]_3 ResString:%s", ResString) + ResString = ResString .. AddStr + UGCLogSystem.Log("[PlacementModeConfig_PlaceCodeEncode_V01]_4 Len:%d, AddStr:%s",string.len(AddStr), AddStr) + UGCLogSystem.Log("[PlacementModeConfig_PlaceCodeEncode_V01]_5 Len:%d, ResString:%s",string.len(ResString), ResString) + end + end + + return ResString +end + + +-- V1版本解码 +--[[ + 地图编号1位72进制 -- 占位1位 + 放置物(类型1位,位置信息6位(XYZ各2位),旋转信息3位(RPY各1位)) -- 占位10位 +]] +function PlacementModeConfig.PlaceCodeDecode_V01(PlaceCode) + local LenPlaceCode = string.len(PlaceCode) + UGCLogSystem.Log("[PlacementModeConfig_PlaceCodeDecode_V01] LenPlaceCode:%s", tostring(LenPlaceCode)) + + -- 验证长度 + if ((LenPlaceCode - 2) % 10) ~= 0 then + return PlacementModeConfig.EPlaceDecodeCallback.CodeLengthError + end + + local Index = 2 + local ReadCodeStr = function(InNum) + local Res = string.sub(PlaceCode, Index, Index + (InNum - 1)) + Index = Index + InNum + return Res + end + + local MapType = PlacementModeConfig.StrToBase72[ReadCodeStr(1)] + -- 验证Map类型是否符合 + if PlacementModeConfig.MapInfo[MapType] == nil then + return PlacementModeConfig.EPlaceDecodeCallback.MapCodeError + end + + -- 可放置范围 + local MapPlacingRange = PlacementModeConfig.MapInfo[MapType].MapPlacingRange + + local ResPlaceItemInfo = {} + for i = 1, math.floor((LenPlaceCode - 2) / 10 + 0.5) do + local PlaceItemType = PlacementModeConfig.base72ToD(ReadCodeStr(1)) + if PlacementModeConfig.ItemInfo[PlaceItemType] == nil then + return PlacementModeConfig.EPlaceDecodeCallback.PlaceItemTypeError + end + local UnitX = PlacementModeConfig.base72ToD(ReadCodeStr(2)) + local UnitY = PlacementModeConfig.base72ToD(ReadCodeStr(2)) + local UnitZ = PlacementModeConfig.base72ToD(ReadCodeStr(2)) + + -- 检验放置范围是否异常 + if UnitX > MapPlacingRange.X or UnitY > MapPlacingRange.Y or UnitZ > MapPlacingRange.Z then + return PlacementModeConfig.EPlaceDecodeCallback.PlacePosRangeError + end + + local UnitPos = {X = UnitX, Y = UnitY, Z = UnitZ} + local UnitRot = { + Roll = PlacementModeConfig.StrToBase72[ReadCodeStr(1)], + Pitch = PlacementModeConfig.StrToBase72[ReadCodeStr(1)], + Yaw = PlacementModeConfig.StrToBase72[ReadCodeStr(1)] + } + ResPlaceItemInfo[#ResPlaceItemInfo + 1] = {PlaceItemType = PlaceItemType, UnitPos = UnitPos, UnitRot = UnitRot} + end + + return PlacementModeConfig.EPlaceDecodeCallback.Succeed, MapType, ResPlaceItemInfo +end + +-- 开头为编码的版号 -- 占位1位 +PlacementModeConfig.PlaceCodeVersionFuncList = { + [1] = {Encode = PlacementModeConfig.PlaceCodeEncode_V01, Decode = PlacementModeConfig.PlaceCodeDecode_V01}, +} + +-- 导出/导入放置代码 End ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/CounterAttack_Solo/Script/Blueprint/PlaceItems/WB_PlacePonitTo.lua b/CounterAttack_Solo/Script/Blueprint/PlaceItems/WB_PlacePonitTo.lua new file mode 100644 index 00000000..1eb141ff --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/PlaceItems/WB_PlacePonitTo.lua @@ -0,0 +1,21 @@ +---@class WB_PlacePonitTo_C:UUserWidget +---@field Image_0 UImage +---@field Image_1 UImage +--Edit Below-- +local WB_PlacePonitTo = { bInitDoOnce = false; }; + +--[==[ Construct +function WB_PlacePonitTo:Construct() + +end +-- Construct ]==] + +-- function WB_PlacePonitTo:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_PlacePonitTo:Destruct() + +-- end + +return WB_PlacePonitTo; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/PlayerStart/BP_CustomPlayerStart.lua b/CounterAttack_Solo/Script/Blueprint/PlayerStart/BP_CustomPlayerStart.lua new file mode 100644 index 00000000..7b5d8bfb --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/PlayerStart/BP_CustomPlayerStart.lua @@ -0,0 +1,36 @@ +---@class BP_CustomPlayerStart_C:STExtraPlayerStart +---@field PlayerStartType TEnumAsByte +--Edit Below-- +local BP_CustomPlayerStart = {}; + +--[[ +function BP_CustomPlayerStart:ReceiveBeginPlay() + self.SuperClass.ReceiveBeginPlay(self); +end +--]] + +--[[ +function BP_CustomPlayerStart:ReceiveTick(DeltaTime) + self.SuperClass.ReceiveTick(self, DeltaTime); +end +--]] + +--[[ +function BP_CustomPlayerStart:ReceiveEndPlay() + self.SuperClass.ReceiveEndPlay(self); +end +--]] + +--[[ +function BP_CustomPlayerStart:GetReplicatedProperties() + return +end +--]] + +--[[ +function BP_CustomPlayerStart:GetAvailableServerRPCs() + return +end +--]] + +return BP_CustomPlayerStart; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/PlayerStart/BP_HDPlayerStart.lua b/CounterAttack_Solo/Script/Blueprint/PlayerStart/BP_HDPlayerStart.lua new file mode 100644 index 00000000..dba312b5 --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/PlayerStart/BP_HDPlayerStart.lua @@ -0,0 +1,36 @@ +---@class BP_HDPlayerStart_C:STExtraPlayerStart +---@field PlayerStartType TEnumAsByte +--Edit Below-- +local BP_HDPlayerStart = {}; + +--[[ +function BP_HDPlayerStart:ReceiveBeginPlay() + self.SuperClass.ReceiveBeginPlay(self); +end +--]] + +--[[ +function BP_HDPlayerStart:ReceiveTick(DeltaTime) + self.SuperClass.ReceiveTick(self, DeltaTime); +end +--]] + +--[[ +function BP_HDPlayerStart:ReceiveEndPlay() + self.SuperClass.ReceiveEndPlay(self); +end +--]] + +--[[ +function BP_HDPlayerStart:GetReplicatedProperties() + return +end +--]] + +--[[ +function BP_HDPlayerStart:GetAvailableServerRPCs() + return +end +--]] + +return BP_HDPlayerStart; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/Post/HD_PostProcessMgr.lua b/CounterAttack_Solo/Script/Blueprint/Post/HD_PostProcessMgr.lua new file mode 100644 index 00000000..5537b61d --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/Post/HD_PostProcessMgr.lua @@ -0,0 +1,35 @@ +---@class HD_PostProcessMgr_C:PostProcessMgr_C +--Edit Below-- +local HD_PostProcessMgr = {} + +--[[ +function HD_PostProcessMgr:ReceiveBeginPlay() + HD_PostProcessMgr.SuperClass.ReceiveBeginPlay(self) +end +--]] + +--[[ +function HD_PostProcessMgr:ReceiveTick(DeltaTime) + HD_PostProcessMgr.SuperClass.ReceiveTick(self, DeltaTime) +end +--]] + +--[[ +function HD_PostProcessMgr:ReceiveEndPlay() + HD_PostProcessMgr.SuperClass.ReceiveEndPlay(self) +end +--]] + +--[[ +function HD_PostProcessMgr:GetReplicatedProperties() + return +end +--]] + +--[[ +function HD_PostProcessMgr:GetAvailableServerRPCs() + return +end +--]] + +return HD_PostProcessMgr \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/Prefabs/Items/TestItem.lua b/CounterAttack_Solo/Script/Blueprint/Prefabs/Items/TestItem.lua new file mode 100644 index 00000000..06145ecf --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/Prefabs/Items/TestItem.lua @@ -0,0 +1,33 @@ +local TestItem = {} + +--[[ +function TestItem:ReceiveBeginPlay() + TestItem.SuperClass.ReceiveBeginPlay(self) +end +--]] + +--[[ +function TestItem:ReceiveTick(DeltaTime) + TestItem.SuperClass.ReceiveTick(self, DeltaTime) +end +--]] + +--[[ +function TestItem:ReceiveEndPlay() + TestItem.SuperClass.ReceiveEndPlay(self) +end +--]] + +--[[ +function TestItem:GetReplicatedProperties() + return +end +--]] + +--[[ +function TestItem:GetAvailableServerRPCs() + return +end +--]] + +return TestItem \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/SceneActor/BP_KillBox.lua b/CounterAttack_Solo/Script/Blueprint/SceneActor/BP_KillBox.lua new file mode 100644 index 00000000..721a7641 --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/SceneActor/BP_KillBox.lua @@ -0,0 +1,26 @@ +---@class BP_KillBox_C:AActor +---@field Box UBoxComponent +---@field DefaultSceneRoot USceneComponent +--Edit Below-- +---@type BP_KillBox_C +local BP_KillBox = {}; + +function BP_KillBox:ReceiveBeginPlay() + self.SuperClass.ReceiveBeginPlay(self); + if UGCGameSystem.IsServer() then + self.Box.OnComponentBeginOverlap:Add(self.Box_OnComponentBeginOverlap, self); + end +end + +function BP_KillBox:Box_OnComponentBeginOverlap(OverlappedComponent, OtherActor, OtherComp, OtherBodyIndex, bFromSweep, SweepResult) + local PlayerKey = OtherActor.PlayerKey + if PlayerKey then + OtherActor:K2_DestroyActor() + UGCGameSystem.GameMode:Server_RespawnPlayer(PlayerKey) + end + return nil; +end + +-- [Editor Generated Lua] function define End; + +return BP_KillBox; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/SceneActor/BP_Launch.lua b/CounterAttack_Solo/Script/Blueprint/SceneActor/BP_Launch.lua new file mode 100644 index 00000000..c4571fd0 --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/SceneActor/BP_Launch.lua @@ -0,0 +1,77 @@ +---@class BP_Launch_C:BP_PlaceItemBase_C +---@field TriggerBox UStaticMeshComponent +---@field P_bounce UParticleSystemComponent +---@field TriggerBoxOld UBoxComponent +---@field Cube UStaticMeshComponent +---@field Scene USceneComponent +---@field ZSpeed FVector +---@field CDTime float +---@field IsAddBuff bool +---@field IsActivate bool +---@field DisableFaillingTime int32 +---@field BouncingSound UAkEventObject +--Edit Below-- +---@type Launch_C +local BP_Launch = {} + +function BP_Launch:ReceiveBeginPlay() + self.SuperClass.ReceiveBeginPlay(self); + self.Jumpers = {} + self.SaveTime = 0 + if self:HasAuthority() then + self.TriggerBox.OnComponentBeginOverlap:Add(self.OnBeginOverlap, self) + self.TriggerBox.OnComponentEndOverlap:Add(self.OnEndOverlap, self) + end +end + + + + +function BP_Launch:OnBeginOverlap(OverlappedComp, Other, OtherComp, OtherBodyIndex, bFromSweep, SweepResult) + sandbox.LogNormalDev(StringFormat_Dev("[BP_Launch:OnBeginOverlap] self=%s", GetObjectFullName_Dev(self))) + + local GameState = GameplayStatics.GetGameState(self) + local CurrentServerWorldTimeSeconds = GameState:GetServerWorldTimeSeconds() + local AddSpeed = 0 + local Character = Other.PlayerState:GetPlayerCharacter() + if(self.IsActivate) then + if(Character.CanJump) then + table.insert(self.Jumpers, Other) + end + + if(CurrentServerWorldTimeSeconds - self.SaveTime >= self.CDTime) then + self.SaveTime = CurrentServerWorldTimeSeconds + for i = 1, #self.Jumpers, 1 do + local PlayerCharacter = self.Jumpers[i].PlayerState:GetPlayerCharacter() + if(self.IsAddBuff) then + PlayerCharacter:DisableFallingDamageForPerioud(self.DisableFaillingTime) + end + --考虑角色跳起来的情况 + if PlayerCharacter.CharacterMovement.Velocity.Z < 0 then + AddSpeed = Vector.New(0, 0, self.ZSpeed.Z - PlayerCharacter.CharacterMovement.Velocity.Z) + self.Jumpers[i].CharacterMovement:AddImpulse(AddSpeed, true) + elseif PlayerCharacter.CharacterMovement.Velocity.Z == 0 then + self.Jumpers[i].CharacterMovement:AddImpulse(self.ZSpeed, true) + end + UnrealNetwork.CallUnrealRPC_Multicast(self, "PlayDisappear") + end + end + table.remove(self.Jumpers) + end +end + +function BP_Launch:PlayDisappear() + sandbox.LogNormalDev("[BP_Launch:PlayDisappear]") + local MyLocation = self.TriggerBox:K2_GetComponentLocation() + self.P_bounce:SetActive(true, true) + UGCSoundManagerSystem.PlaySoundAtLocation(self.BouncingSound, MyLocation) +end + +function BP_Launch:ReceiveEndPlay() + sandbox.LogNormalDev("[BP_Launch:ReceiveEndPlay]") + if self:HasAuthority() then + self.TriggerBox.OnComponentBeginOverlap:Remove(self.OnBeginOverlap, self) + self.TriggerBox.OnComponentEndOverlap:Remove(self.OnEndOverlap, self) + end +end +return BP_Launch; diff --git a/CounterAttack_Solo/Script/Blueprint/SceneActor/BP_PlayerDeadParticle.lua b/CounterAttack_Solo/Script/Blueprint/SceneActor/BP_PlayerDeadParticle.lua new file mode 100644 index 00000000..d6929ddd --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/SceneActor/BP_PlayerDeadParticle.lua @@ -0,0 +1,43 @@ +---@class BP_PlayerDeadParticle_C:AActor +---@field ParticleSystem UParticleSystemComponent +---@field DefaultSceneRoot USceneComponent +--Edit Below-- +---@type BP_PlayerDeadParticle_C +local BP_PlayerDeadParticle = {}; + +--[[ +function BP_PlayerDeadParticle:ReceiveBeginPlay() + self.SuperClass.ReceiveBeginPlay(self); +end +--]] + +--[[ +function BP_PlayerDeadParticle:ReceiveTick(DeltaTime) + self.SuperClass.ReceiveTick(self, DeltaTime); +end +--]] + +--[[ +function BP_PlayerDeadParticle:ReceiveEndPlay() + self.SuperClass.ReceiveEndPlay(self); +end +--]] + +--[[ +function BP_PlayerDeadParticle:GetReplicatedProperties() + return +end +--]] + +--[[ +function BP_PlayerDeadParticle:GetAvailableServerRPCs() + return +end +--]] + +function BP_PlayerDeadParticle:UpdateDeadInfo(Pos) + self:K2_SetActorLocation(Pos) + self.ParticleSystem:SetActive(true, true) +end + +return BP_PlayerDeadParticle; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/SceneActor/BP_ResetHeight.lua b/CounterAttack_Solo/Script/Blueprint/SceneActor/BP_ResetHeight.lua new file mode 100644 index 00000000..b7a1d052 --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/SceneActor/BP_ResetHeight.lua @@ -0,0 +1,57 @@ +---@class BP_ResetHeight_C:AActor +---@field Box UBoxComponent +---@field DefaultSceneRoot USceneComponent +--Edit Below-- +local BP_ResetHeight = { + CheckTime = 1; + ActorHeightZ = -2000; +}; + + +function BP_ResetHeight:ReceiveBeginPlay() + self.SuperClass.ReceiveBeginPlay(self); + if UGCGameSystem.IsServer() then + self.ActorHeightZ = self:K2_GetActorLocation().Z + self.CheckPlayerHeightHandle = UGCEventSystem.SetTimerLoop(self, self.CheckPlayerHeight, self.CheckTime) + end +end + +function BP_ResetHeight:CheckPlayerHeight() + local AllPawn = UGCGameSystem.GetAllPlayerPawn() + for i, v in pairs(AllPawn) do + if v:K2_GetActorLocation().Z < self.ActorHeightZ then + --local PlayerStart = UGCSystemLibrary.GetUniqueInstanceFromPath('/Game/BluePrints/Player/PlayerStart/BP_STPlayerStart.BP_STPlayerStart_C') + --if UE.IsValid(PlayerStart) then + -- v:SetPawnTF(PlayerStart:K2_GetActorLocation(), PlayerStart:K2_GetActorRotation()) + --end + UGCPawnAttrSystem.SetHealth(v, -1) + end + end +end + + + + + + +function BP_ResetHeight:ReceiveEndPlay() + if self.CheckPlayerHeightHandle then + UGCEventSystem.StopTimer(self.CheckPlayerHeightHandle) + end + self.SuperClass.ReceiveEndPlay(self); +end + + +--[[ +function BP_ResetHeight:GetReplicatedProperties() + return +end +--]] + +--[[ +function BP_ResetHeight:GetAvailableServerRPCs() + return +end +--]] + +return BP_ResetHeight; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/SceneActor/BP_SpawnPickupWrapper.lua b/CounterAttack_Solo/Script/Blueprint/SceneActor/BP_SpawnPickupWrapper.lua new file mode 100644 index 00000000..ce7a661d --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/SceneActor/BP_SpawnPickupWrapper.lua @@ -0,0 +1,49 @@ +---@class BP_SpawnPickupWrapper_C:AActor +---@field Box UBoxComponent +---@field DefaultSceneRoot USceneComponent +---@field ItemID int32 +---@field DelayTime float +--Edit Below-- +---@type BP_SpawnPickupWrapper_C +local BP_SpawnPickupWrapper = { + WrapperClass = nil; + PickupWrapper = nil; +}; + + +function BP_SpawnPickupWrapper:ReceiveBeginPlay() + self.SuperClass.ReceiveBeginPlay(self); + if not self:HasAuthority() then return end + self.WrapperClass = UE.LoadClass(UGCBackPackSystem.GetPickupWrapperClassPath(self.ItemID)) + self:SpawnItem() +end + +function BP_SpawnPickupWrapper:SpawnItem() + if UE.IsValid(self.WrapperClass) then + self.PickupWrapper = ScriptGameplayStatics.SpawnActor(UGCGameSystem.GameState, self.WrapperClass, self:K2_GetActorLocation(), self:K2_GetActorRotation(), VectorHelper.ScaleOne()); + if self.PickupWrapper.UGC_PickUpWrapperDestroyDelegate then + self.PickupWrapper.UGC_PickUpWrapperDestroyDelegate:Add(self.DelaySpawnItem, self) + UGCLogSystem.Log("[BP_SpawnPickupWrapper_SpawnItem] SpawnSucceed") + else + UGCLogSystem.Log("[BP_SpawnPickupWrapper_SpawnItem] UGC_PickUpWrapperDestroyDelegate is nil") + end + else + UGCLogSystem.LogError("[BP_SpawnPickupWrapper_SpawnItem] WrapperClass is not Valid") + end +end + + +function BP_SpawnPickupWrapper:DelaySpawnItem() + if self.PickupWrapper.UGC_PickUpWrapperDestroyDelegate then + self.PickupWrapper.UGC_PickUpWrapperDestroyDelegate:Remove(self.DelaySpawnItem, self) + end + UGCEventSystem.SetTimer(self, + function() + self:SpawnItem() + end, + self.DelayTime + ) +end + + +return BP_SpawnPickupWrapper; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/SceneActor/BP_TrackKillerCamera.lua b/CounterAttack_Solo/Script/Blueprint/SceneActor/BP_TrackKillerCamera.lua new file mode 100644 index 00000000..b2e2a040 --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/SceneActor/BP_TrackKillerCamera.lua @@ -0,0 +1,73 @@ +---@class BP_TrackKillerCamera_C:AActor +---@field Camera UCameraComponent +---@field CustomSpringArm UCustomSpringArmComponent +---@field DefaultSceneRoot USceneComponent +---@field EnableTime float +---@field InterpSpeed float +--Edit Below-- +---@type BP_TrackKillerCamera_C +local BP_TrackKillerCamera = { + bEnableMove = false; + KillerPawn = nil; + DelayDisableHandle = nil; +}; + + +function BP_TrackKillerCamera:ReceiveBeginPlay() + --if self.IsExeBeginPlay then return end + --self.IsExeBeginPlay = true + + self.SuperClass.ReceiveBeginPlay(self); + + UGCLogSystem.Log("[BP_TrackKillerCamera_ReceiveBeginPlay] 1") + if not UGCGameSystem.IsServer() then + UGCEventSystem.AddListener(EventEnum.PlayerDeathInfo, self.PlayerDeath, self) + UGCLogSystem.Log("[BP_TrackKillerCamera_ReceiveBeginPlay] 2") + end +end + +function BP_TrackKillerCamera:PlayerDeath(VictimKey, CauserKey) + if GlobalConfigs.GameSetting.EnableLerpCamera then + UGCLogSystem.Log("[BP_TrackKillerCamera_PlayerDeath]") + if UGCSystemLibrary.GetLocalPlayerKey() == VictimKey then + UGCLogSystem.Log("[BP_TrackKillerCamera_PlayerDeath] VictimKey:%d, CauserKey:%d ", VictimKey, CauserKey) + self.KillerPawn = UGCGameSystem.GetPlayerPawnByPlayerKey(CauserKey) + if UE.IsValid(self.KillerPawn) then + local TargetPos_ = self.KillerPawn:K2_GetActorLocation() + local TargetRot_ = self.KillerPawn:K2_GetActorRotation() + self:K2_SetActorLocation(TargetPos_) + self:K2_SetActorRotation(TargetRot_) + self.bEnableMove = true + if self.DelayDisableHandle ~= nil then UGCEventSystem.StopTimer(self.DelayDisableHandle) self.DelayDisableHandle = nil end + self.DelayDisableHandle = UGCEventSystem.SetTimer(self, function() self.bEnableMove = false end, self.EnableTime) + else + UGCLogSystem.LogError("[BP_TrackKillerCamera_PlayerDeath] KillerPawn is nil. CauserKey:%s", tostring(CauserKey)) + end + end + + end +end + +function BP_TrackKillerCamera:GetTargetPosAndRot() + return self.KillerPawn:K2_GetActorLocation(), self.KillerPawn:K2_GetActorRotation() + -- return self.KillerPawn.ScopingCamera:K2_GetComponentLocation(), self.KillerPawn.ScopingCamera:K2_GetComponentRotation() +end + +function BP_TrackKillerCamera:ReceiveTick(DeltaTime) + self.SuperClass.ReceiveTick(self, DeltaTime); + -- self:ReceiveBeginPlay() + if self.bEnableMove then + if UE.IsValid(self.KillerPawn) then + local TargetPos_, TargetRot_ = self:GetTargetPosAndRot() + local Pos = KismetMathLibrary.VInterpTo(self:K2_GetActorLocation(), TargetPos_, DeltaTime, self.InterpSpeed) + local Rot = KismetMathLibrary.RInterpTo(self:K2_GetActorRotation(), TargetRot_, DeltaTime, self.InterpSpeed) + self:K2_SetActorLocation(Pos) + self:K2_SetActorRotation(Rot) + else + UGCLogSystem.Log("[BP_TrackKillerCamera_ReceiveTick] KillerPawn is nil") + self.bEnableMove = false + end + end +end + +return BP_TrackKillerCamera; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/SceneActor/BP_VehicleSpawnPoint.lua b/CounterAttack_Solo/Script/Blueprint/SceneActor/BP_VehicleSpawnPoint.lua new file mode 100644 index 00000000..9a0058dc --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/SceneActor/BP_VehicleSpawnPoint.lua @@ -0,0 +1,40 @@ +---@class BP_VehicleSpawnPoint_C:AActor +---@field Arrow UArrowComponent +---@field Box UBoxComponent +---@field DefaultSceneRoot USceneComponent +---@field VehiclePath FString +---@field MapIndex int32 +--Edit Below-- +local BP_VehicleSpawnPoint = {}; + +--[[ +function BP_VehicleSpawnPoint:ReceiveBeginPlay() + self.SuperClass.ReceiveBeginPlay(self); +end +--]] + +--[[ +function BP_VehicleSpawnPoint:ReceiveTick(DeltaTime) + self.SuperClass.ReceiveTick(self, DeltaTime); +end +--]] + +--[[ +function BP_VehicleSpawnPoint:ReceiveEndPlay() + self.SuperClass.ReceiveEndPlay(self); +end +--]] + +--[[ +function BP_VehicleSpawnPoint:GetReplicatedProperties() + return +end +--]] + +--[[ +function BP_VehicleSpawnPoint:GetAvailableServerRPCs() + return +end +--]] + +return BP_VehicleSpawnPoint; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/SceneActor/Capture/BP_CaptureCamera.lua b/CounterAttack_Solo/Script/Blueprint/SceneActor/Capture/BP_CaptureCamera.lua new file mode 100644 index 00000000..5ee9b6e3 --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/SceneActor/Capture/BP_CaptureCamera.lua @@ -0,0 +1,13 @@ +---@class BP_CaptureCamera_C:AActor +---@field Box UBoxComponent +---@field SceneCaptureComponent2D USceneCaptureComponent2D +---@field DefaultSceneRoot USceneComponent +--Edit Below-- +local BP_CaptureCamera = {}; + + +function BP_CaptureCamera:UpdateScenePic() + self.SceneCaptureComponent2D:CaptureScene() +end + +return BP_CaptureCamera; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/SceneActor/PlaceMode/BP_LineOfDefense.lua b/CounterAttack_Solo/Script/Blueprint/SceneActor/PlaceMode/BP_LineOfDefense.lua new file mode 100644 index 00000000..25d01e4c --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/SceneActor/PlaceMode/BP_LineOfDefense.lua @@ -0,0 +1,79 @@ +---@class BP_LineOfDefense_C:AActor +---@field Widget UWidgetComponent +---@field Capsule UCapsuleComponent +---@field P_LineOfDefense UParticleSystemComponent +---@field CG014_Motorbooth UStaticMeshComponent +---@field DefaultSceneRoot USceneComponent +--Edit Below-- +local BP_LineOfDefense = { + -- 同一个玩家进入的时间间隔 + EnterTimeInterval = 5; + -- 玩家上一次进入的时间 + PlayerEnterLineOfDefenseTime = {}; +}; + + +function BP_LineOfDefense:ReceiveBeginPlay() + self.SuperClass.ReceiveBeginPlay(self); + if UGCGameSystem.IsServer() then + self.CheckPlayerOverlapHandle = UGCEventSystem.SetTimerLoop(self, self.CheckPlayerOverlap, 0.5) + UGCSystemLibrary.BindBeginOverlapFunc(self.Capsule, self.PlayerOverlap, self) + end +end + + +function BP_LineOfDefense:CheckPlayerOverlap() + local AllPawn = UGCGameSystem.GetAllPlayerPawn() + for i, v in pairs(AllPawn) do + if self.Capsule:IsOverlappingActor(v) then + self:CheckEnterLineDefenseMeetCondition(v.PlayerKey) + end + end + +end + +--[[ +function BP_LineOfDefense:ReceiveTick(DeltaTime) + self.SuperClass.ReceiveTick(self, DeltaTime); +end +--]] + +function BP_LineOfDefense:PlayerOverlap(OverlappedComponent, OtherActor, OtherComp, OtherBodyIndex, bFromSweep, SweepResult) + if OtherActor and OtherActor.PlayerKey then + self:CheckEnterLineDefenseMeetCondition(OtherActor.PlayerKey) + end +end + +function BP_LineOfDefense:CheckEnterLineDefenseMeetCondition(PlayerKey) + if PlayerKey == nil then return end + local LastEnterTime = self.PlayerEnterLineOfDefenseTime[PlayerKey] + local NowTime = UGCSystemLibrary.GetGameTime() + if LastEnterTime == nil or NowTime - LastEnterTime > self.EnterTimeInterval then + self.PlayerEnterLineOfDefenseTime[PlayerKey] = NowTime + UGCEventSystem.SendEvent(EventEnum.PlayerEnterLineOfDefense, PlayerKey) + end +end + + +function BP_LineOfDefense:ReceiveEndPlay() + if self.CheckPlayerOverlapHandle then + UGCEventSystem.StopTimer(self.CheckPlayerOverlapHandle) + self.CheckPlayerOverlapHandle = nil + end + self.SuperClass.ReceiveEndPlay(self); +end + + +--[[ +function BP_LineOfDefense:GetReplicatedProperties() + return +end +--]] + +--[[ +function BP_LineOfDefense:GetAvailableServerRPCs() + return +end +--]] + +return BP_LineOfDefense; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/SceneActor/PlaceMode/BP_PassagewayBlock.lua b/CounterAttack_Solo/Script/Blueprint/SceneActor/PlaceMode/BP_PassagewayBlock.lua new file mode 100644 index 00000000..5726f6ed --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/SceneActor/PlaceMode/BP_PassagewayBlock.lua @@ -0,0 +1,104 @@ +---@class BP_PassagewayBlock_C:AActor +---@field Box UBoxComponent +---@field TipWidget UWidgetComponent +---@field DefaultSceneRoot USceneComponent +---@field Walls TArray +---@field Index int32 +--Edit Below-- + + + +local BP_PassagewayBlock = { + ShowType = 1 +}; + +function BP_PassagewayBlock:GetReplicatedProperties() + return + "ShowType" +end + + + +function BP_PassagewayBlock:ReceiveBeginPlay() + self.SuperClass.ReceiveBeginPlay(self); + if UGCGameSystem.IsServer() then + self:SetShowType(CustomEnum.EPassagewayShowType.Hide) + -- 若非放置模式玩法则销毁Actor + if not PlacementModeConfig.IsPlaceMode() then + --self:K2_DestroyActor() + return + else + self.LoopCheckIsShowHandle = UGCEventSystem.SetTimerLoop(self, self.CheckClientIsShow, 2) + end + else + + self:SetShowType(self.ShowType) + --UGCEventSystem.SetTimer(self, self.SetShowType, 2) + end +end + +function BP_PassagewayBlock:CheckClientIsShow() + UGCSendRPCSystem.ActorRPCNotify(nil, self, "SetShowType", self.ShowType) +end + +function BP_PassagewayBlock:OnRep_ShowType() + if self then + self:SetShowType(self.ShowType) + end +end + + +function BP_PassagewayBlock:SetShowType(InShowType) + if InShowType then + self.ShowType = InShowType + end + UGCLogSystem.Log("[BP_PassagewayBlock_SetShowType] ShowType:%s", tostring(self.ShowType)) + for i, WallActor in pairs(self.Walls) do + if UE.IsValid(WallActor) then + if InShowType == CustomEnum.EPassagewayShowType.Close then + WallActor.StaticMeshComponent:SetCollisionEnabled(ECollisionEnabled.QueryAndPhysics) + else + WallActor.StaticMeshComponent:SetCollisionEnabled(ECollisionEnabled.NoCollision) + end + end + end + + if UGCGameSystem.IsServer() then + UGCSendRPCSystem.ActorRPCNotify(nil, self, "SetShowType", self.ShowType) + else + self.TipWidget:GetUserWidgetObject():SetVis(InShowType == CustomEnum.EPassagewayShowType.Open, self.Index) + for i, WallActor in pairs(self.Walls) do + if UE.IsValid(WallActor) then + WallActor.StaticMeshComponent:SetVisibility(InShowType == CustomEnum.EPassagewayShowType.Close) + end + end + end +end + +--[[ +function BP_PassagewayBlock:ReceiveTick(DeltaTime) + self.SuperClass.ReceiveTick(self, DeltaTime); +end +--]] + + +function BP_PassagewayBlock:ReceiveEndPlay() + if self.LoopCheckIsShowHandle then + UGCEventSystem.StopTimer(self.LoopCheckIsShowHandle) + self.LoopCheckIsShowHandle = nil + end + self.SuperClass.ReceiveEndPlay(self); +end + + + + + + +--[[ +function BP_PassagewayBlock:GetAvailableServerRPCs() + return +end +--]] + +return BP_PassagewayBlock; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/SceneActor/PlaceMode/BP_PlaceableArea.lua b/CounterAttack_Solo/Script/Blueprint/SceneActor/PlaceMode/BP_PlaceableArea.lua new file mode 100644 index 00000000..7d05ad5e --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/SceneActor/PlaceMode/BP_PlaceableArea.lua @@ -0,0 +1,54 @@ +---@class BP_PlaceableArea_C:AActor +---@field Box UBoxComponent +---@field DefaultSceneRoot USceneComponent +--Edit Below-- +local BP_PlaceableArea = {}; + +--[[ +function BP_PlaceableArea:ReceiveBeginPlay() + self.SuperClass.ReceiveBeginPlay(self); +end +--]] + +--[[ +function BP_PlaceableArea:ReceiveTick(DeltaTime) + self.SuperClass.ReceiveTick(self, DeltaTime); +end +--]] + +--[[ +function BP_PlaceableArea:ReceiveEndPlay() + self.SuperClass.ReceiveEndPlay(self); +end +--]] + +--[[ +function BP_PlaceableArea:GetReplicatedProperties() + return +end +--]] + +--[[ +function BP_PlaceableArea:GetAvailableServerRPCs() + return +end +--]] + +function BP_PlaceableArea:InitOnce() + if self.bInitOnce then return end + self.bInitOnce = true + self.Origin, self.BoxExtent = self:GetActorBounds() + UGCLogSystem.Log("[BP_PlaceableArea_InitOnce] Origin:%s, BoxExtent:%s", VectorHelper.ToString(self.Origin), VectorHelper.ToString(self.BoxExtent)) +end + +function BP_PlaceableArea:InPlaceableArea(Pos) + self:InitOnce() + if Pos.X >= self.Origin.X - self.BoxExtent.X and Pos.X <= self.Origin.X + self.BoxExtent.X + and Pos.Y >= self.Origin.Y - self.BoxExtent.Y and Pos.Y <= self.Origin.Y + self.BoxExtent.Y + and Pos.Z >= self.Origin.Z - self.BoxExtent.Z and Pos.Z <= self.Origin.Z + self.BoxExtent.Z then + return true + end + return false +end + +return BP_PlaceableArea; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/SceneActor/PlaceMode/WB_TipLineOfDefense.lua b/CounterAttack_Solo/Script/Blueprint/SceneActor/PlaceMode/WB_TipLineOfDefense.lua new file mode 100644 index 00000000..b363264b --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/SceneActor/PlaceMode/WB_TipLineOfDefense.lua @@ -0,0 +1,21 @@ +---@class WB_TipLineOfDefense_C:UUserWidget +---@field CanvasPanel_Main UCanvasPanel +--Edit Below-- +local WB_TipPassageway = { bInitDoOnce = false; }; + +--[==[ Construct +function WB_TipPassageway:Construct() + +end +-- Construct ]==] + +-- function WB_TipPassageway:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_TipPassageway:Destruct() + +-- end + + +return WB_TipPassageway; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/SceneActor/PlaceMode/WB_TipPassageway.lua b/CounterAttack_Solo/Script/Blueprint/SceneActor/PlaceMode/WB_TipPassageway.lua new file mode 100644 index 00000000..e5a140dd --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/SceneActor/PlaceMode/WB_TipPassageway.lua @@ -0,0 +1,34 @@ +---@class WB_TipPassageway_C:UUserWidget +---@field CanvasPanel_Main UCanvasPanel +---@field TextBlock_Name UTextBlock +--Edit Below-- +local WB_TipPassageway = { bInitDoOnce = false; }; + +--[==[ Construct +function WB_TipPassageway:Construct() + +end +-- Construct ]==] + +-- function WB_TipPassageway:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_TipPassageway:Destruct() + +-- end +function WB_TipPassageway:SetVis(IsShow, Index) + self:SetShowName(Index) + UGCLogSystem.Log("[WB_TipPassageway_SetVis] IsShow:%s", tostring(IsShow)) + if IsShow then + self:SetVisibility(ESlateVisibility.HitTestInvisible) + else + self:SetVisibility(ESlateVisibility.Collapsed) + end +end + +function WB_TipPassageway:SetShowName(Index) + string.format("通过%s通道", string.char(65 + Index)) +end + +return WB_TipPassageway; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/SceneActor/SelectMap/BP_PlayerSelectMapOverlap.lua b/CounterAttack_Solo/Script/Blueprint/SceneActor/SelectMap/BP_PlayerSelectMapOverlap.lua new file mode 100644 index 00000000..3d89bf0f --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/SceneActor/SelectMap/BP_PlayerSelectMapOverlap.lua @@ -0,0 +1,89 @@ +---@class BP_PlayerSelectMapOverlap_C:AActor +---@field ShowNameWidget UWidgetComponent +---@field MapInfoWidget UWidgetComponent +---@field MiniMapWidget UWidgetComponent +---@field ShowMapWidget UWidgetComponent +---@field RotatorCenter USceneComponent +---@field Box UBoxComponent +---@field P_SelectOverlap UParticleSystemComponent +---@field DefaultSceneRoot USceneComponent +---@field MapType int32 +---@field SelectColor FLinearColor +---@field DefaultColor FLinearColor +---@field bEnableOverlapSelect bool +--Edit Below-- +local BP_PlayerSelectMapOverlap = {}; + + +function BP_PlayerSelectMapOverlap:ReceiveBeginPlay() + self.SuperClass.ReceiveBeginPlay(self); + if UGCGameSystem.IsServer() then + if self.bEnableOverlapSelect then + UGCSystemLibrary.BindBeginOverlapFunc(self.Box, self.OverlapPlayer, self) + end + else + UGCEventSystem.AddListener(EventEnum.SelectMapCallBack, self.SelectMapCallBack, self) + self:InitClientShow() + end +end + +function BP_PlayerSelectMapOverlap:InitClientShow() + self.ShowNameWidget:GetUserWidgetObject():InitName(self.MapType) + self.ShowNameWidget:RequestRedraw() + local MapInfo = MapConfig.MapInfo[self.MapType] + if MapInfo and MapConfig.MapType.Random ~= self.MapType then + self.ShowMapWidget:GetUserWidgetObject():SetImage(MapInfo.Icon) + self.MiniMapWidget:GetUserWidgetObject():SetImage(MapInfo.MiniMapInfo.MapPath) + self.MapInfoWidget:GetUserWidgetObject():UpdateMapInfo(MapInfo) + self.ShowMapWidget:RequestRedraw() + self.MiniMapWidget:RequestRedraw() + self.MapInfoWidget:RequestRedraw() + end +end + + +function BP_PlayerSelectMapOverlap:ReceiveTick(DeltaTime) + self.SuperClass.ReceiveTick(self, DeltaTime); + if UGCGameSystem.IsServer() then + else + local CameraManager = UGCSystemLibrary.GetLocalPlayerController().PlayerCameraManager + local Dir = VectorHelper.Sub(CameraManager:K2_GetActorLocation(), self:K2_GetActorLocation()) + Dir.Z = 0. + local TargetRot = KismetMathLibrary.MakeRotFromX(Dir) + self.RotatorCenter:K2_SetWorldRotation(TargetRot) + end +end + +function BP_PlayerSelectMapOverlap:OverlapPlayer(OverlappedComponent, OtherActor, OtherComp, OtherBodyIndex, bFromSweep, SweepResult) + if OtherActor.PlayerKey then + UGCGameSystem.GameState:PlayerOverlapSelectMap(OtherActor.PlayerKey, self.MapType) + end +end + +function BP_PlayerSelectMapOverlap:SelectMapCallBack(bSucceed, InMapType) + if InMapType == self.MapType then + self.P_SelectOverlap:SetVectorParameter("PColor", KismetMathLibrary.Conv_LinearColorToVector(self.SelectColor)) + else + self.P_SelectOverlap:SetVectorParameter("PColor", KismetMathLibrary.Conv_LinearColorToVector(self.DefaultColor)) + end +end + +--[[ +function BP_PlayerSelectMapOverlap:ReceiveEndPlay() + self.SuperClass.ReceiveEndPlay(self); +end +--]] + +--[[ +function BP_PlayerSelectMapOverlap:GetReplicatedProperties() + return +end +--]] + +--[[ +function BP_PlayerSelectMapOverlap:GetAvailableServerRPCs() + return +end +--]] + +return BP_PlayerSelectMapOverlap; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/SceneActor/SelectMap/WB_MechanismInfo_Select.lua b/CounterAttack_Solo/Script/Blueprint/SceneActor/SelectMap/WB_MechanismInfo_Select.lua new file mode 100644 index 00000000..c52d2601 --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/SceneActor/SelectMap/WB_MechanismInfo_Select.lua @@ -0,0 +1,42 @@ +---@class WB_MechanismInfo_Select_C:UUserWidget +---@field Image_1 UImage +---@field Image_Icon UImage +---@field TextBlock_Name UTextBlock +--Edit Below-- +---@type WB_MechanismInfo_C +local WB_MechanismInfo_Select = { bInitDoOnce = false; }; + +--[==[ Construct +function WB_MechanismInfo_Select:Construct() + +end +-- Construct ]==] + +-- function WB_MechanismInfo_Select:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_MechanismInfo_Select:Destruct() + +-- end + +function WB_MechanismInfo_Select:UpdateInfo(MechanismType) + local IconInfo = MechanismConfig.MechanismIconInfo[MechanismType] + if IconInfo then + self.Image_Icon:SetVisibility(ESlateVisibility.SelfHitTestInvisible) + self.TextBlock_Name:SetVisibility(ESlateVisibility.SelfHitTestInvisible); + local IconTex = UGCSystemLibrary.LoadAsset(IconInfo.Icon, true) + if UE.IsValid(IconTex) then + self.Image_Icon:SetBrushFromTexture(IconTex) + self.Image_Icon:SetColorAndOpacity(IconInfo.Color) + end + local Name = MechanismConfig.MechanismTypeName[MechanismType] + self.TextBlock_Name:SetText(Name) + else + self.Image_Icon:SetVisibility(ESlateVisibility.Hidden) + self.TextBlock_Name:SetVisibility(ESlateVisibility.Hidden); + end + +end + +return WB_MechanismInfo_Select; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/SceneActor/SelectMap/WB_ShowMapBG.lua b/CounterAttack_Solo/Script/Blueprint/SceneActor/SelectMap/WB_ShowMapBG.lua new file mode 100644 index 00000000..2ff0ea15 --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/SceneActor/SelectMap/WB_ShowMapBG.lua @@ -0,0 +1,27 @@ +---@class WB_ShowMapBG_C:UUserWidget +---@field Image_ShowMap UImage +--Edit Below-- +local WB_ShowMapBG = { bInitDoOnce = false; }; + +--[==[ Construct +function WB_ShowMapBG:Construct() + +end +-- Construct ]==] + +-- function WB_ShowMapBG:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_ShowMapBG:Destruct() + +-- end + +function WB_ShowMapBG:SetImage(Path) + local Tex = UGCSystemLibrary.LoadAsset(Path, true) + if Tex then + self.Image_ShowMap:SetBrushFromTexture(Tex, true) + end +end + +return WB_ShowMapBG; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/SceneActor/SelectMap/WB_ShowMapInfo.lua b/CounterAttack_Solo/Script/Blueprint/SceneActor/SelectMap/WB_ShowMapInfo.lua new file mode 100644 index 00000000..ce761f17 --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/SceneActor/SelectMap/WB_ShowMapInfo.lua @@ -0,0 +1,44 @@ +---@class WB_ShowMapInfo_C:UUserWidget +---@field HorizontalBox_Recommend UHorizontalBox +---@field VerticalBox_MechanismInfo UVerticalBox +--Edit Below-- +local WB_ShowMapInfo = { bInitDoOnce = false; }; + +--[==[ Construct +function WB_ShowMapInfo:Construct() + +end +-- Construct ]==] + +-- function WB_ShowMapInfo:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_ShowMapInfo:Destruct() + +-- end + +function WB_ShowMapInfo:UpdateMapInfo(MapInfo) + local Index = 0; + for i = 1, self.HorizontalBox_Recommend:GetChildrenCount() do + local Item = self.HorizontalBox_Recommend:GetChildAt(i - 1) + if i <= MapInfo.Recommend then + Item:SetVisibility(ESlateVisibility.Visible) + else + Item:SetVisibility(ESlateVisibility.Hidden) + end + end + for i, MechanismType in pairs(MapInfo.MapMechanisms) do + if table.hasValue(MechanismConfig.TriggerMechanismType, MechanismType) then + local Item = self.VerticalBox_MechanismInfo:GetChildAt(Index) + if Item then + Item:UpdateInfo(MechanismType) + else + break + end + Index = Index + 1 + end + end +end + +return WB_ShowMapInfo; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/SceneActor/SelectMap/WB_ShowMapName.lua b/CounterAttack_Solo/Script/Blueprint/SceneActor/SelectMap/WB_ShowMapName.lua new file mode 100644 index 00000000..2b8c8611 --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/SceneActor/SelectMap/WB_ShowMapName.lua @@ -0,0 +1,42 @@ +---@class WB_ShowMapName_C:UUserWidget +---@field Overlay_IsNew UOverlay +---@field Overlay_SelectMapName UOverlay +---@field TextBlock_MapSpecialMode UTextBlock +---@field TextBlock_SelectMapName UTextBlock +---@field TextBlock_SelectNum UTextBlock +--Edit Below-- +local WB_ShowMapName = { bInitDoOnce = false; }; + +--[==[ Construct +function WB_ShowMapName:Construct() + +end +-- Construct ]==] + +-- function WB_ShowMapName:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_ShowMapName:Destruct() + +-- end + +function WB_ShowMapName:InitName(InMapInfo) + self.MapType = InMapInfo + local MapInfo = MapConfig.MapInfo[self.MapType] + self.TextBlock_SelectMapName:SetText(MapInfo.ShowName) + if MapInfo.SpecialModeType ~= MapConfig.ESpecialModeType.Default then + self.TextBlock_MapSpecialMode:SetText(string.format(" (%s)", MapConfig.SpecialModeName[MapInfo.SpecialModeType])) + else + self.TextBlock_MapSpecialMode:SetText("") + end + + WidgetLibrary.TextBlockBindingPropertyText(self.TextBlock_SelectNum, self.UpdateSelectMapNum, self) +end + +function WB_ShowMapName:UpdateSelectMapNum() + local Res = UGCGameSystem.GameState:GetSelectMapNumFromMapType(self.MapType) + return "×" .. tostring(Res) +end + +return WB_ShowMapName; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/SceneActor/SelectMap/WB_ShowMiniMap.lua b/CounterAttack_Solo/Script/Blueprint/SceneActor/SelectMap/WB_ShowMiniMap.lua new file mode 100644 index 00000000..5708b6c5 --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/SceneActor/SelectMap/WB_ShowMiniMap.lua @@ -0,0 +1,29 @@ +---@class WB_ShowMiniMap_C:UUserWidget +---@field Image_MiniMap UImage +---@field WidgetSwitcher_IsRandom UWidgetSwitcher +--Edit Below-- +local WB_ShowMiniMap = { bInitDoOnce = false; }; + +--[==[ Construct +function WB_ShowMiniMap:Construct() + +end +-- Construct ]==] + +-- function WB_ShowMiniMap:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_ShowMiniMap:Destruct() + +-- end + +function WB_ShowMiniMap:SetImage(Path) + local Tex = UGCSystemLibrary.LoadAsset(Path, true) + if Tex then + self.WidgetSwitcher_IsRandom:SetActiveWidgetIndex(1) + self.Image_MiniMap:SetBrushFromTexture(Tex, true) + end +end + +return WB_ShowMiniMap; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/SceneActor/Team/BP_TeamCTTip.lua b/CounterAttack_Solo/Script/Blueprint/SceneActor/Team/BP_TeamCTTip.lua new file mode 100644 index 00000000..483b10b2 --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/SceneActor/Team/BP_TeamCTTip.lua @@ -0,0 +1,37 @@ +---@class BP_TeamCTTip_C:AActor +---@field Widget UWidgetComponent +---@field DefaultSceneRoot USceneComponent +--Edit Below-- +local BP_TeamCTTip = {}; + +--[[ +function BP_TeamCTTip:ReceiveBeginPlay() + self.SuperClass.ReceiveBeginPlay(self); +end +--]] + +--[[ +function BP_TeamCTTip:ReceiveTick(DeltaTime) + self.SuperClass.ReceiveTick(self, DeltaTime); +end +--]] + +--[[ +function BP_TeamCTTip:ReceiveEndPlay() + self.SuperClass.ReceiveEndPlay(self); +end +--]] + +--[[ +function BP_TeamCTTip:GetReplicatedProperties() + return +end +--]] + +--[[ +function BP_TeamCTTip:GetAvailableServerRPCs() + return +end +--]] + +return BP_TeamCTTip; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/SceneActor/Team/BP_TeamTTip.lua b/CounterAttack_Solo/Script/Blueprint/SceneActor/Team/BP_TeamTTip.lua new file mode 100644 index 00000000..69db7275 --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/SceneActor/Team/BP_TeamTTip.lua @@ -0,0 +1,37 @@ +---@class BP_TeamTTip_C:AActor +---@field Widget UWidgetComponent +---@field DefaultSceneRoot USceneComponent +--Edit Below-- +local BP_TeamCTTip = {}; + +--[[ +function BP_TeamCTTip:ReceiveBeginPlay() + self.SuperClass.ReceiveBeginPlay(self); +end +--]] + +--[[ +function BP_TeamCTTip:ReceiveTick(DeltaTime) + self.SuperClass.ReceiveTick(self, DeltaTime); +end +--]] + +--[[ +function BP_TeamCTTip:ReceiveEndPlay() + self.SuperClass.ReceiveEndPlay(self); +end +--]] + +--[[ +function BP_TeamCTTip:GetReplicatedProperties() + return +end +--]] + +--[[ +function BP_TeamCTTip:GetAvailableServerRPCs() + return +end +--]] + +return BP_TeamCTTip; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/SceneActor/Team/WB_CTTip.lua b/CounterAttack_Solo/Script/Blueprint/SceneActor/Team/WB_CTTip.lua new file mode 100644 index 00000000..561f04da --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/SceneActor/Team/WB_CTTip.lua @@ -0,0 +1,19 @@ +---@class WB_CTTip_C:UUserWidget +--Edit Below-- +local WB_CTTip = { bInitDoOnce = false; }; + +--[==[ Construct +function WB_CTTip:Construct() + +end +-- Construct ]==] + +-- function WB_CTTip:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_CTTip:Destruct() + +-- end + +return WB_CTTip; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/SceneActor/Team/WB_TTip.lua b/CounterAttack_Solo/Script/Blueprint/SceneActor/Team/WB_TTip.lua new file mode 100644 index 00000000..12a87b01 --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/SceneActor/Team/WB_TTip.lua @@ -0,0 +1,19 @@ +---@class WB_TTip_C:UUserWidget +--Edit Below-- +local WB_CTTip = { bInitDoOnce = false; }; + +--[==[ Construct +function WB_CTTip:Construct() + +end +-- Construct ]==] + +-- function WB_CTTip:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_CTTip:Destruct() + +-- end + +return WB_CTTip; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/Skill/DetectActor/BPC_DetectPlayerNew.lua b/CounterAttack_Solo/Script/Blueprint/Skill/DetectActor/BPC_DetectPlayerNew.lua new file mode 100644 index 00000000..5a799cc6 --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/Skill/DetectActor/BPC_DetectPlayerNew.lua @@ -0,0 +1,35 @@ +---@class BPC_DetectPlayerNew_C:BP_OutlineDetectComp_C +--Edit Below-- +local BPC_DetectPlayerNew = {} + +--[[ +function BPC_DetectPlayerNew:ReceiveBeginPlay() + BPC_DetectPlayerNew.SuperClass.ReceiveBeginPlay(self) +end +--]] + +--[[ +function BPC_DetectPlayerNew:ReceiveTick(DeltaTime) + BPC_DetectPlayerNew.SuperClass.ReceiveTick(self, DeltaTime) +end +--]] + +--[[ +function BPC_DetectPlayerNew:ReceiveEndPlay() + BPC_DetectPlayerNew.SuperClass.ReceiveEndPlay(self) +end +--]] + +--[[ +function BPC_DetectPlayerNew:GetReplicatedProperties() + return +end +--]] + +--[[ +function BPC_DetectPlayerNew:GetAvailableServerRPCs() + return +end +--]] + +return BPC_DetectPlayerNew \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/Skill/DetectActor/BP_DetectPlayerNew.lua b/CounterAttack_Solo/Script/Blueprint/Skill/DetectActor/BP_DetectPlayerNew.lua new file mode 100644 index 00000000..48388da4 --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/Skill/DetectActor/BP_DetectPlayerNew.lua @@ -0,0 +1,35 @@ +---@class BP_DetectPlayerNew_C:BP_DetectPlayerActor_C +--Edit Below-- +local BP_DetectPlayerNew = {} + +--[[ +function BP_DetectPlayerNew:ReceiveBeginPlay() + BP_DetectPlayerNew.SuperClass.ReceiveBeginPlay(self) +end +--]] + +--[[ +function BP_DetectPlayerNew:ReceiveTick(DeltaTime) + BP_DetectPlayerNew.SuperClass.ReceiveTick(self, DeltaTime) +end +--]] + +--[[ +function BP_DetectPlayerNew:ReceiveEndPlay() + BP_DetectPlayerNew.SuperClass.ReceiveEndPlay(self) +end +--]] + +--[[ +function BP_DetectPlayerNew:GetReplicatedProperties() + return +end +--]] + +--[[ +function BP_DetectPlayerNew:GetAvailableServerRPCs() + return +end +--]] + +return BP_DetectPlayerNew \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/UGCGameMode.lua b/CounterAttack_Solo/Script/Blueprint/UGCGameMode.lua new file mode 100644 index 00000000..305e2bcb --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/UGCGameMode.lua @@ -0,0 +1,40 @@ +---@class UGCGameMode_C:BP_UGCGameBase_C +--Edit Below-- +---@type UGCGameMode_C +UGCGameSystem.UGCRequire('Script.Global.Global') + +local UGCGameMode = { +}; +function UGCGameMode:ReceiveBeginPlay() + self.SuperClass.ReceiveBeginPlay(self); + --- 启用滑铲 + self.bIsOpenShovelingAbility = true + + UGCBlueprintFunctionLibrary.InitGameModeStates() + UGCBlueprintFunctionLibrary.ChangeGameModeState("FightingState"); +end + +function UGCGameMode:ReceiveTick(DeltaTime) + self.SuperClass.ReceiveTick(self, DeltaTime); +end + +function UGCGameMode:ReceiveEndPlay() + self.SuperClass.ReceiveEndPlay(self); +end + + +function UGCGameMode:Server_RespawnPlayer(RespawnPlayerKey) + UGCGameSystem.GetRespawnComponent():AddRespawnPlayer(RespawnPlayerKey, GlobalConfigs.GameSetting.RespawnTime) +end + +function UGCGameMode:LuaModifyDamage(Damage, DamageType, InstigatorPlayerState, VictimPlayerState) + --UGCLogSystem.Log("[UGCGameMode_LuaModifyDamage] MeleeDamage Number:%s", tostring(EDamageType.MeleeDamage)) + UGCLogSystem.Log("[UGCGameMode_LuaModifyDamage] Damage:%s, DamageType:%s", tostring(Damage), tostring(DamageType)) + if DamageType == EDamageType.MeleeDamage and UGCPlayerStateSystem.GetTeamID(InstigatorPlayerState.PlayerKey) == UGCPlayerStateSystem.GetTeamID(VictimPlayerState.PlayerKey) then + UGCLogSystem.Log("[UGCGameMode_LuaModifyDamage] MeleeDamage") + return 0 + end + return Damage +end + +return UGCGameMode; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/UGCGameState.lua b/CounterAttack_Solo/Script/Blueprint/UGCGameState.lua new file mode 100644 index 00000000..3f563c78 --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/UGCGameState.lua @@ -0,0 +1,1107 @@ +---@class UGCGameState_C:BP_UGCGameState_C +--Edit Below-- +---@type UGCGameState_C +UGCGameSystem.UGCRequire('Script.Global.Global') +UGCGameSystem.UGCRequire('Script.Common.ue_enum_custom') + + + +local UGCGameState = { + WaitPlayerJoinTime = 0; + GameStateType = CustomEnum.EGameState.Waiting; + GameTime = 0; -- 游戏倒计时时间 + + PlayerPersonalInfos = {}; -- 玩家信息{PlayerKey = {UID, PlayerKey, TeamID, IsOffline, PlayerName, Gender, IconURL, AchievementScore, IsSelectTeam}, ...} + PlayerScoreDatas = {}; -- 玩家得分信息{[PlayerKey] = {Kills = int32, Assists = int32, Score = int32}...} + TeamScore = {}; -- 队伍得分{[TeamID] = Score} + + + PlayerJoinNum = 0; -- 玩家加入的数量作为个人TeamID + AllAlivePlayers = {}; -- 存活的玩家 PlayerKeys + MapKey = -1; -- 选择出的地图的索引 + + SyncPlayModeUIInfo = {}; -- 同步游玩模式显示的UI + + -- Round + RoundCount = 0; -- 当前回合 + WiningTeam = -1; -- 当前获胜队伍 + + -- 武器配置选择 + PlayerWeaponCombination = {}; -- 玩家可选的武器组合索引 + PlayerSelectedWeaponIndex = {}; -- 玩家选择的武器配置索引 + PlayerAutoSelectWeaponHandle = {}; -- 自动选择武器索引 + + -- 呼吸回血的玩家 + RespiratoryRegurgitationPlayers = {}; +}; + +function UGCGameState:GetReplicatedProperties() + return + "GameTime", + "PlayerPersonalInfos", + "WaitPlayerJoinTime", + "GameStateType", + "PlayerScoreDatas", + "TeamScore", + + + "AllAlivePlayers", + "MapKey", + "SyncPlayModeUIInfo", + + "RoundCount", + "WiningTeam", + + + "PlayerWeaponCombination", + "PlayerSelectedWeaponIndex", + + BuffManager.GetReplicatedProperties(), + ArchiveDataConfig.GetAllReplicatedPropertiesName() + + + +end +-------------------------------------------------------- OnRep -------------------------------------------------------- +function UGCGameState:OnRep_PlayerScoreDatas() + PlayerScoreSystem.SetPlayerScoreDatas(self.PlayerScoreDatas) + UGCEventSystem.SendEvent(EventEnum.UpdatePlayerScoreData) +end + +function UGCGameState:OnRep_PlayerPersonalInfos() + UGCEventSystem.SendEvent(EventEnum.UpdatePlayerScoreData) + UGCEventSystem.SendEvent(EventEnum.UpdatePlayerInfo) + + -- 更新加入队伍聊天房间 + local PC = UGCSystemLibrary.GetLocalPlayerController() + if PC then + PC:UpdateTeamVoiceRoom() + end +end + +function UGCGameState:OnRep_GameStateType() + if self:HasAuthority() then return end + UGCEventSystem.SendEvent(EventEnum.GameStateChange, self.GameStateType) +end + + + +function UGCGameState:OnRep_AllAlivePlayers() + UGCEventSystem.SendEvent(EventEnum.PlayerIsAliveIsChange) +end + +function UGCGameState:OnRep_RoundCount() + UGCEventSystem.SendEvent(EventEnum.NewRound, self.RoundCount) +end + +function UGCGameState:OnRep_SyncPlayModeUIInfo() + for _, UIType in pairs(WidgetConfig.SyncShowPlayModeWidget) do + local Params = self.SyncPlayModeUIInfo[UIType] + if Params == nil then + WidgetManager:ClosePanel(UIType) + end + end + + for UIType, Params in pairs(self.SyncPlayModeUIInfo) do + WidgetManager:ShowPanel(UIType, false, table.unpack(Params)) + end +end + +function UGCGameState:OnRep_PlayerWeaponCombination() + UGCEventSystem.SendEvent(EventEnum.PlayerWeaponCombinationUpdate, self.PlayerWeaponCombination) +end + +function UGCGameState:OnRep_PlayerSelectedWeaponIndex() + UGCEventSystem.SendEvent(EventEnum.PlayerSelectedWeaponIndexUpdate, self.PlayerSelectedWeaponIndex) +end + +function UGCGameState:OnRep_TeamScore() + UGCEventSystem.SendEvent(EventEnum.UpdateTeamScore, self.TeamScore) +end + +function UGCGameState:OnRep_MapKey() + UGCEventSystem.SendEvent(EventEnum.UpdateMapKey, self.MapKey) + self:LoadNowMiniMap() +end +------------------------------------------------------ OnRep End ------------------------------------------------------ + + +function UGCGameState:ReceiveBeginPlay() + UGCLogSystem.Log("[UGCGameState_ReceiveBeginPlay]") + + --屏蔽死亡盒子 + -- self.IsShowDeadBox = false; + -- 显示飘字 + self.bIsShowHitValue = true; + + -- 注册存档API + ArchiveDataConfig.Register(self) + -- 注册BuffSystem + BuffManager.InitRegister(self) + -- 注册粒子特效 + ParticleConfig.Init(self) + -- 初始化全局逻辑 + GlobalInit.Init() + + + self:AddBind() + + -- 开启滑铲State部分 + self.bIsOpenShovelingAbility = false + -- 注册排行信息 + PlayerScoreSystem.RegisterInfo(PlayerScoreSystem.Config.ScoreList) + -- 初始化RPC系统 + UGCSendRPCSystem.InitUGCSendRPCSystem(self, "UGCSendRPCSystemFunc") + + if UGCGameSystem.IsServer() then + -- 绑定更新积分的函数 + PlayerScoreSystem.BindChangeScoreDataCallBack(self.UpdateAllPlayerScoreDatas, self) + + else + self:OnRep_SyncPlayModeUIInfo() + end + UGCLogSystem.Log("[UGCGameState_ReceiveBeginPlay] Finish") +end + +--function UGCGameState:ReceiveTick(DeltaTime) +--end + + +function UGCGameState:ReceiveEndPlay() + self:RemoveBind() +end + + +function UGCGameState:AddBind() + UGCCommoditySystem.BuyUGCCommodityResultDelegate:Add(self.OnBuyUGCCommodityResult, self) + if self:HasAuthority() then + UGCEventSystem.AddListener(EventEnum.PlayerLogin, self.PlayerLogin, self) + UGCEventSystem.AddListener(EventEnum.PlayerExit, self.PlayerExit, self) + else + end +end + +function UGCGameState:RemoveBind() + UGCCommoditySystem.BuyUGCCommodityResultDelegate:Remove(self.OnBuyUGCCommodityResult, self) + if self:HasAuthority() then + UGCEventSystem.RemoveListener(EventEnum.PlayerLogin, self.PlayerLogin, self) + UGCEventSystem.RemoveListener(EventEnum.PlayerExit, self.PlayerExit, self) + else + end +end + + +function UGCGameState:PlayerLogin(PlayerPawn, PlayerKey) + UGCLogSystem.Log("[UGCGameState_PlayerLogin] PlayerKey:%s", tostring(PlayerKey)) + -- 第一次进入则处理 + if self:PlayerIsFirstLogin(PlayerKey) then + -- 更新玩家队伍设置 + self:UpdatePlayerTeam(PlayerKey) + -- 获取玩家信息 + self:GetUserInfo(PlayerKey) + -- 注册玩家得分信息 + PlayerScoreSystem.InitPlayerScoreData(PlayerKey) + -- 增加玩家游玩次数 + self:AddPlayerNumberOfPlays(PlayerKey) + end + + --UGCEventSystem.SetTimer(self, function() + -- UGCLogSystem.Log("[UGCGameState_PlayerLogin] --PlayerKey:%s", tostring(PlayerKey)) + -- self:AddPlayerNumberOfPlays(PlayerKey) end, 15) + + UGCLogSystem.Log("[UGCGameState_PlayerLogin] Finish") +end + +function UGCGameState:PlayerExit(PlayerPawn, PlayerKey) + if GlobalConfigs.GameSetting.EnablePlayerJoin then + PlayerScoreSystem.RemovePlayerScoreInfo(PlayerKey) + end +end + +function UGCGameState:PlayerIsFirstLogin(PlayerKey) + return (self.PlayerPersonalInfos[PlayerKey] == nil) +end + + +--- 玩家登录获取玩家数据 +---@param PlayerKey uint +function UGCGameState:GetUserInfo(PlayerKey) + if self.PlayerPersonalInfos[PlayerKey] then return self.PlayerPersonalInfos[PlayerKey] end + + local UserInfo = UGCPlayerStateSystem.GetPlayerAccountInfo(PlayerKey) + local PS = UGCGameSystem.GetPlayerStateByPlayerKey(PlayerKey); + if UserInfo then + --- UID,PlayerName,TeamID,Gender,PlatformGender,PlayerLevel,SegmentLevel,IconURL + local UserInfoCpy = UserInfo:Copy() + UGCLogSystem.Log("[UGCGameState_GetUserInfo] PlayerName:%s", UserInfoCpy.PlayerName) + self.PlayerPersonalInfos[PlayerKey] = table.DeepCopy(UE.ToTable(UserInfo)) + UGCLogSystem.LogTree("[UGCGameState_GetUserInfo] UserInfo:", self.PlayerPersonalInfos[PlayerKey]) + + if PS and UE.IsValid(PS) then + self.PlayerPersonalInfos[PlayerKey].AvatarBoxId = PS.AvatarBoxId + else + self.PlayerPersonalInfos[PlayerKey].AvatarBoxId = 0 + end + + UGCLogSystem.LogTree("[UGCGameState_GetUserInfo] UserInfo:", self.PlayerPersonalInfos[PlayerKey]) + return self.PlayerPersonalInfos[PlayerKey] + else + UGCLogSystem.LogError("[UGCGameState_GetUserInfo] UserInfo Error PlayerKey:%s", tostring(PlayerKey)) + end + +end + + + + +-------------------------------------------------- ArchiveData -------------------------------------------------- + +function UGCGameState:GetArchiveDataByType(PlayerKey, ArchiveType) + local UID = self:GetPlayerUIDByPlayerKey(PlayerKey) + if UID then + local ArchiveData = UGCPlayerStateSystem.GetPlayerArchiveData(UID) + if ArchiveData then + UGCLogSystem.Log("[UGCGameState_GetArchiveDataByType] Succeed") + return ArchiveData[ArchiveType] + end + end + return nil +end + +function UGCGameState:SavePlayerArchiveData(PlayerKey, ArchiveType, Data) + local UID = self:GetPlayerUIDByPlayerKey(PlayerKey) + if UID then + local ArchiveData = UGCPlayerStateSystem.GetPlayerArchiveData(UID) + if ArchiveData == nil then + ArchiveData = {} + end + ArchiveData[ArchiveType] = Data + UGCPlayerStateSystem.SavePlayerArchiveData(UID, ArchiveData) + return true + end + return false +end + +------------------------------------------------ ArchiveData End ------------------------------------------------ +-- 存档 --------------------------------------------------------------------------------------------------------------------------------------------------- + +------------------------------------------------- NumberOfPlays ------------------------------------------------- + +--- 增加玩家游玩次数 +function UGCGameState:AddPlayerNumberOfPlays(PlayerKey) + local NumberOfPlays = self:GetArchiveDataByType(PlayerKey, ArchiveDataConfig.EArchiveType.NumberOfPlays) + if NumberOfPlays then + self:SavePlayerArchiveData(PlayerKey, ArchiveDataConfig.EArchiveType.NumberOfPlays, NumberOfPlays + 1) + else + self:SavePlayerArchiveData(PlayerKey, ArchiveDataConfig.EArchiveType.NumberOfPlays, 1) + end +end + + +--- 获取玩家游玩次数 +function UGCGameState:GetPlayerNumberOfPlays(PlayerKey) + return ArchiveDataConfig.GetPlayerArchiveDataFromType(PlayerKey, ArchiveDataConfig.EArchiveType.NumberOfPlay) +end + +----------------------------------------------- NumberOfPlays End ----------------------------------------------- + + + +-- 存档 End ----------------------------------------------------------------------------------------------------------------------------------------------- + + + + + + + + + +-- Team Score Data ---------------------------------------------------------------------------------------- +--- 更新返回所有玩家得分 +function UGCGameState:UpdateAllPlayerScoreDatas() + self.PlayerScoreDatas = PlayerScoreSystem.GetPlayerScoreDatas() + UGCLogSystem.LogTree("[UGCGameState_UpdateAllPlayerScoreDatas]", self.PlayerScoreDatas) +end + +--- 获取队伍得分 +function UGCGameState:GetTeamScore(TeamID) + return (self.TeamScore[TeamID] and self.TeamScore[TeamID] or 0) +end + +--- 获取最高的队伍得分 +function UGCGameState:GetMaxTeamScore() + local Res = 0 + for i, v in pairs(self.TeamScore) do + Res = math.max(Res, v) + end + return Res +end + +--- 重置队伍得分 +function UGCGameState:ResetTeamScore() + self.TeamScore = {} +end + +--- 增加队伍得分 +function UGCGameState:AddTeamScore(TeamID, Score) + self.TeamScore[TeamID] = self:GetTeamScore(TeamID) + Score + UGCEventSystem.SendEvent(EventEnum.UpdateTeamScore) +end + + +--- 新回合 +function UGCGameState:AddNewRound() + self:ResetRoundInfo() + self.RoundCount = self.RoundCount + 1 +end + +function UGCGameState:IsFinishRound() + return self.RoundCount >= GlobalConfigs.GameSetting.MaxRound +end + +--- 重置回合信息 +function UGCGameState:ResetRoundInfo() + self.WinningTeam = -1 +end + +--- 获取当前回合数 +function UGCGameState:GetRoundCount() + return self.RoundCount +end + +--- 设置获胜方 +function UGCGameState:SetWinningTeam(TeamID) + if self.WinningTeam > 0 then + return + end + self.WinningTeam = TeamID + self:AddTeamScore(TeamID, 1) +end + +--- 获取当前获胜方 +function UGCGameState:GetWinningTeam() + return self.WinningTeam +end + +--- 获取队伍中的玩家 +function UGCGameState:GetTeamPlayer(TeamID) + local Res = {} + for PlayerKey, PlayerInfo in pairs(self.PlayerPersonalInfos) do + if PlayerInfo.TeamID == TeamID then + Res[#Res + 1] = PlayerKey + end + end + return Res +end + + +-- Team Score Data End ------------------------------------------------------------------------------------ + + +--- 获取当前游戏状态 +function UGCGameState:GetGameStateType() + return self.GameStateType +end + +--- 设置当前游戏状态 +function UGCGameState:SetGameStateType(NewGameStateType) + if not self:HasAuthority() then return end + if self.GameStateType ~= NewGameStateType then + self.GameStateType = NewGameStateType + UGCEventSystem.SendEvent(EventEnum.GameStateChange, self.GameStateType) + end +end + +--- 设置游戏结束 +function UGCGameState:GameFinish() + self:SetGameStateType(CustomEnum.EGameState.End) +end + +--- 获取一个新的队伍ID 个人战使用 +function UGCGameState:GetNewTeamID() + -- body + self.PlayerJoinNum = self.PlayerJoinNum + 1 + return self.PlayerJoinNum +end + +UGCGameState.IsPreparationTime = false +function UGCGameState:SetIsPreparationTime(InIsPreparationTime) + self.IsPreparationTime = InIsPreparationTime +end + +function UGCGameState:GetIsPreparationTime() + return self.IsPreparationTime +end + +------------------------------------------------------------------ 获取玩家信息 ------------------------------------------------------------------ + +function UGCGameState:GetPlayerNameByPlayerKey(PlayerKey) + if self.PlayerPersonalInfos[PlayerKey] then + return self.PlayerPersonalInfos[PlayerKey].PlayerName + else + return "" + end +end + +function UGCGameState:GetPlayerTeamIDByPlayerKey(PlayerKey) + if self.PlayerPersonalInfos[PlayerKey] then + return self.PlayerPersonalInfos[PlayerKey].TeamID + else + return -1 + end +end + +function UGCGameState:GetHeadIconByPlayerKey(PlayerKey) + if self.PlayerPersonalInfos[PlayerKey] then + return self.PlayerPersonalInfos[PlayerKey].IconURL + else + return "" + end +end + +function UGCGameState:GetPlayerUIDByPlayerKey(PlayerKey) + return self.PlayerPersonalInfos[PlayerKey].UID +end + + +function UGCGameState:GetPlayerHeadInfo(PlayerKey) + local PlayerInfo = self.PlayerPersonalInfos[PlayerKey] + --- return {UID:string, IconURL:string, Gender:int, AvatarBoxId:int, PlayerLevel:int, PlayerName:string} 其中AvatarBoxId可以从PlayerState中获取 + + local Res = { + UIDString = "", + IconURL = "", + Gender = 1, + AvatarBoxId = 0, + PlayerLevel = 1, + PlayerName = "Null", + } + if PlayerInfo then + Res.UIDString = tostring(PlayerInfo.UID) + Res.IconURL = PlayerInfo.IconURL + Res.Gender = PlayerInfo.Gender + Res.AvatarBoxId = PlayerInfo.AvatarBoxId + Res.PlayerLevel = PlayerInfo.PlayerLevel + Res.PlayerName = PlayerInfo.PlayerName + end + return Res +end +---------------------------------------------------------------- 获取玩家信息 End ---------------------------------------------------------------- + + + +function UGCGameState:GetGameTime() + return self.GameTime +end + +function UGCGameState:SetGameTime(NewTime) + if UGCGameSystem.IsServer() then + self.GameTime = NewTime + else + UGCLogSystem.LogError("[UGCGameState_SetGameTime] 客户端无法设置游戏时间") + end +end + +function UGCGameState:SetPlayerIsAlive(PlayerKey, Pawn) + if Pawn then + self.AllAlivePlayers[PlayerKey] = 1 + else + self.AllAlivePlayers[PlayerKey] = nil + end +end + + + +function UGCGameState:GetPlayerIsAlive(PlayerKey) + if self.AllAlivePlayers[PlayerKey] then + return true + end + return false +end + + +--- 获取队伍存活的玩家数 +function UGCGameState:GetTeamAlivePlayerCount(TeamID) + + local Count = 0 + local Players = self:GetTeamPlayer(TeamID) + UGCLogSystem.LogTree("[UGCGameState_GetTeamAlivePlayerCount] Players", Players) + UGCLogSystem.LogTree("[UGCGameState_GetTeamAlivePlayerCount] AllAlivePlayers:", self.AllAlivePlayers) + for i, v in pairs(Players) do + if self:GetPlayerIsAlive(v) then + Count = Count + 1 + end + end + UGCLogSystem.Log("[UGCGameState_GetTeamAlivePlayerCount] Count:%s", tostring(Count)) + return Count +end + +--------------------------------------------- SyncUIInfo --------------------------------------------- + + +-- PlayMode ------------------------------------------------------------------------------------------- +function UGCGameState:ShowSimplePlayModeUI(UIType, Params) + if Params == nil then Params = {} end + self.SyncPlayModeUIInfo = {} + self.SyncPlayModeUIInfo[UIType] = Params +end + +function UGCGameState:AddPlayModeUI(UIType, Params) + if table.hasValue(WidgetConfig.SyncShowPlayModeWidget, UIType) then + if Params == nil then Params = {} end + self.SyncPlayModeUIInfo[UIType] = Params + end +end + +function UGCGameState:RemovePlayModeUI(UIType) + self.SyncPlayModeUIInfo[UIType] = nil +end +-- PlayMode End --------------------------------------------------------------------------------------- + + +--------------------------------------------- SyncUIInfo End --------------------------------------------- + + + + + +-- PlayerWeaponCombination --------------------------------------------------------------------------------------------------------------- + +function UGCGameState:SetPlayerWeaponCombination(PlayerKey, WeaponCombinationType) + self.PlayerWeaponCombination[PlayerKey] = WeaponCombinationType + self:ResetPlayerSelectWeaponIndex(PlayerKey) +end + +function UGCGameState:GetPlayerWeaponCombination(PlayerKey) + if self.PlayerWeaponCombination[PlayerKey] then + return self.PlayerWeaponCombination[PlayerKey] + else + return 1 + end +end + +--- 重置玩家选择的武器配置索引 +function UGCGameState:ResetPlayerSelectWeaponIndex(PlayerKey) + self.PlayerSelectedWeaponIndex[PlayerKey] = 1 +end + +--- 重置所有玩家的武器配置索引 +function UGCGameState:ResetAllPlayerSelectWeaponIndex() + self.PlayerSelectedWeaponIndex = {} +end + +--- 设置玩家选择的武器配置索引 +function UGCGameState:PlayerSelectWeaponIndex(PlayerKey, WeaponCombinationIndex) + self.PlayerSelectedWeaponIndex[PlayerKey] = WeaponCombinationIndex + self:UpdatePlayerWeapon(PlayerKey) + if self.PlayerAutoSelectWeaponHandle[PlayerKey] then + UGCEventSystem.StopTimer(self.PlayerAutoSelectWeaponHandle[PlayerKey]) + self.PlayerAutoSelectWeaponHandle[PlayerKey] = nil + end +end + +--- 校验玩家选择的武器配置索引 +function UGCGameState:CheckPlayerSelectWeaponIndex(PlayerKey) + local SelectedWeaponIndex = self:GetPlayerSelectedWeaponIndex(PlayerKey) + if SelectedWeaponIndex then + local WeaponCombination = WeaponSelectionCombinationConfig.WeaponCombinationList[self:GetPlayerWeaponCombination(PlayerKey)] + if WeaponCombination then + if WeaponCombination.Weapon[SelectedWeaponIndex] then + return true + end + end + end + return false +end + +--- 获取玩家选择的武器配置索引 +function UGCGameState:GetPlayerSelectedWeaponIndex(PlayerKey) + return self.PlayerSelectedWeaponIndex[PlayerKey] +end + +--- 获取玩家选择的武器索引对应的武器及配件 +function UGCGameState:GetPlayerSelectedWeaponAndParts(PlayerKey) + local Res = {} + if not self:CheckPlayerSelectWeaponIndex(PlayerKey) then + self.PlayerSelectedWeaponIndex[PlayerKey] = 1 + end + local PlayerWeaponCombination = self:GetPlayerWeaponCombination(PlayerKey) + local PlayerSelectedWeaponIndex = self:GetPlayerSelectedWeaponIndex(PlayerKey) + local WeaponCombination = WeaponSelectionCombinationConfig.WeaponCombinationList[PlayerWeaponCombination] + local SavedWeaponComb = ArchiveDataConfig.GetPlayerArchiveDataFromType(PlayerKey, ArchiveDataConfig.EArchiveType.WeaponCombs) + + local PlayerCustomWeaponParts = ArchiveDataConfig.GetPlayerArchiveDataFromType(PlayerKey, ArchiveDataConfig.EArchiveType.CustomWeaponParts) + + + + local Weapons + -- 判断是否有保存的武器组合 + if SavedWeaponComb and SavedWeaponComb[PlayerWeaponCombination] and SavedWeaponComb[PlayerWeaponCombination][PlayerSelectedWeaponIndex] then + Weapons = SavedWeaponComb[PlayerWeaponCombination][PlayerSelectedWeaponIndex] + elseif WeaponCombination then + Weapons = WeaponCombination.Weapon[PlayerSelectedWeaponIndex] + end + if Weapons then + UGCLogSystem.LogTree("[UGCGameState_GetPlayerSelectedWeaponAndParts] Weapons:", Weapons) + for i, WeaponID in pairs(Weapons) do + if Res[WeaponID] == nil then + Res[WeaponID] = 1 + else + Res[WeaponID] = Res[WeaponID] + 1 + end + local Parts = MyWeaponSystem.GetWeaponBastParts(WeaponID) + if PlayerCustomWeaponParts and PlayerCustomWeaponParts[WeaponID] then + Parts = PlayerCustomWeaponParts[WeaponID] + end + for _, PartID in pairs(Parts) do + if Res[PartID] then + Res[PartID] = 1 + Res[PartID] + else + Res[PartID] = 1 + end + end + end + end + return Res +end + +--- 获取玩家选择的武器Item表 +function UGCGameState:GetPlayerSelectedWeaponItemInfo(PlayerKey) + local Res = {} + if not self:CheckPlayerSelectWeaponIndex(PlayerKey) then + self.PlayerSelectedWeaponIndex[PlayerKey] = 1 + end + local PlayerWeaponCombination = self:GetPlayerWeaponCombination(PlayerKey) + local PlayerSelectedWeaponIndex = self:GetPlayerSelectedWeaponIndex(PlayerKey) + local WeaponCombination = WeaponSelectionCombinationConfig.WeaponCombinationList[PlayerWeaponCombination] + local SavedWeaponComb = ArchiveDataConfig.GetPlayerArchiveDataFromType(PlayerKey, ArchiveDataConfig.EArchiveType.WeaponCombs) + + local Weapons + -- 判断是否有保存的武器组合 + if SavedWeaponComb and SavedWeaponComb[PlayerWeaponCombination] and SavedWeaponComb[PlayerWeaponCombination][PlayerSelectedWeaponIndex] then + Weapons = SavedWeaponComb[PlayerWeaponCombination][PlayerSelectedWeaponIndex] + elseif WeaponCombination then + Weapons = WeaponCombination.Weapon[PlayerSelectedWeaponIndex] + end + if Weapons then + local PlayerCustomWeaponParts = ArchiveDataConfig.GetPlayerArchiveDataFromType(PlayerKey, ArchiveDataConfig.EArchiveType.WeaponCombs) + for i, WeaponID in pairs(Weapons) do + local WeaponItemInfo = {} + WeaponItemInfo.ItemID = WeaponID + WeaponItemInfo.Count = 1 + WeaponItemInfo.SubItemList = {} + + + local Parts = MyWeaponSystem.GetWeaponBastParts(WeaponID) + if PlayerCustomWeaponParts and PlayerCustomWeaponParts[WeaponID] then + Parts = PlayerCustomWeaponParts[WeaponID] + end + for PartIndex, PartID in pairs(Parts) do + WeaponItemInfo.SubItemList[PartIndex] = {ItemID = PartID, Count = 1} + end + Res[#Res + 1] = WeaponItemInfo + end + end + return Res +end + +--- 检测并给予玩家武器和配件 +function UGCGameState:CheckWeaponAndParts(InPlayerKey, IgnoreMagnifyingGlass) + if IgnoreMagnifyingGlass == nil then IgnoreMagnifyingGlass = true end + local TargetPawn = UGCGameSystem.GetPlayerPawnByPlayerKey(InPlayerKey) + if TargetPawn == nil then return end + + local WeaponAndParts = self:GetPlayerSelectedWeaponAndParts(InPlayerKey) + UGCLogSystem.LogTree("[UGCGameState_CheckWeaponAndParts]", WeaponAndParts) + ---@return ItemDataList LuaTable @LuaTable, ItemData结构:ItemID,InstanceID,Count,Type,SubType,IsAvatar + local AllItems = UGCBackPackSystem.GetAllItemData(TargetPawn) + + local BackPackWeaponAndParts = {} + -- 验证玩家当前背包武器及配件是否需要销毁 + for i, ItemInfo in pairs(AllItems) do + local ItemID = ItemInfo.ItemID + if (ItemID < 108000 and ItemID > 100000) + or (ItemID >= 200000 and ItemID < 300000) then + if BackPackWeaponAndParts[ItemInfo.ItemID] == nil then + BackPackWeaponAndParts[ItemInfo.ItemID] = 1 + else + BackPackWeaponAndParts[ItemInfo.ItemID] = BackPackWeaponAndParts[ItemInfo.ItemID] + 1 + end + end + end + + -- 验证玩家当前背包武器及配件是否需要销毁 + for _, ItemInfo in pairs(AllItems) do + local TypeID = UGCSystemLibrary.GetItemTypeID(ItemInfo.ItemID) + if not IgnoreMagnifyingGlass or TypeID ~= 203 then + if (ItemInfo.ItemID < 108000 and ItemInfo.ItemID > 100000) + or (TypeID >= 200 and TypeID < 300) + then + local TargetItemCount = WeaponAndParts[ItemInfo.ItemID] + if TargetItemCount == nil then TargetItemCount = 0 end + if BackPackWeaponAndParts[ItemInfo.ItemID] > TargetItemCount then + --- 销毁背包中的物品 + --UGCBackPackSystem.DropItem(TargetPawn, ItemInfo.ItemID, ItemInfo.Count - TargetItemCount, true) + for i = 1, BackPackWeaponAndParts[ItemInfo.ItemID] - TargetItemCount do + UGCBackPackSystem.DropItem(TargetPawn, ItemInfo.ItemID, 1, true) + end + end + end + end + end + + local bGiveWeapon = false + -- 添加武器及配件 + for ItemID, TargetCount in pairs(WeaponAndParts) do + local Count = UGCBackPackSystem.GetItemCount(TargetPawn, ItemID) + UGCLogSystem.Log("[UGCGameState_CheckWeaponAndParts] ItemID:%s, Count:%s", tostring(ItemID), tostring(Count)) + if TargetCount > Count then + --UGCBackPackSystem.AddItem(TargetPawn, ItemID, TargetCount - Count) + for i = 1, TargetCount - Count do + UGCBackPackSystem.AddItem(TargetPawn, ItemID, 1) + end + local ItemTypeID = UGCSystemLibrary.GetItemTypeID(ItemID) + if ItemTypeID > 100 and ItemTypeID < 200 then + bGiveWeapon = true + end + end + end + -- 补满弹夹 + if bGiveWeapon then + UGCEventSystem.SetTimer(TargetPawn, function() + for i, v in pairs(ShootWeaponEnums) do + local Weapon = UGCWeaponManagerSystem.GetWeaponBySlot(TargetPawn, v) + if UE.IsValid(Weapon) then + UGCGunSystem.EnableClipInfiniteBullets(Weapon, true) + local MaxBulletNumInOneClip = UGCGunSystem.GetMaxBulletNumInOneClip(Weapon) + Weapon:SetCurrentBulletNumInClipOnServer(MaxBulletNumInOneClip, true) + -- 玩家离开换弹状态 + if UE.IsValid(TargetPawn) then + UGCPawnSystem.LeavePawnState(TargetPawn, EPawnState.Roload) + end + end + end + end, + 1. + ) + end +end +--- 更新玩家的武器装备 +function UGCGameState:UpdatePlayerWeapon(InPlayerKey) + local TargetPawn = UGCGameSystem.GetPlayerPawnByPlayerKey(InPlayerKey) + if TargetPawn == nil then return end + local AllItems = UGCBackPackSystem.GetAllItemData(TargetPawn) + -- 清除玩家武器 + --for _, ItemInfo in pairs(AllItems) do + -- local TypeID = UGCSystemLibrary.GetItemTypeID(ItemInfo.ItemID) + -- if (ItemInfo.ItemID < 108000 and ItemInfo.ItemID > 100000) + -- or (TypeID >= 200 and TypeID < 300) + -- then + -- UGCBackPackSystem.DropItem(TargetPawn, ItemInfo.ItemID, ItemInfo.Count, true) + -- end + --end + local WeaponIDs = {} + for _, ItemInfo in pairs(AllItems) do + if (ItemInfo.ItemID < 108000 and ItemInfo.ItemID > 100000) then + WeaponIDs[#WeaponIDs + 1] = ItemInfo.ItemID + end + end + + + local PlayerCustomWeaponParts = ArchiveDataConfig.GetPlayerArchiveDataFromType(InPlayerKey, ArchiveDataConfig.EArchiveType.CustomWeaponParts) + for i, WeaponID in pairs(WeaponIDs) do + local Parts = MyWeaponSystem.GetWeaponBastParts(WeaponID) + if PlayerCustomWeaponParts and PlayerCustomWeaponParts[WeaponID] then + Parts = PlayerCustomWeaponParts[WeaponID] + end + for _, PartID in pairs(Parts) do + UGCBackPackSystem.DropItem(TargetPawn, PartID, 1, true) + end + UGCBackPackSystem.DropItem(TargetPawn, WeaponID, 1, true) + end + + + local WeaponItemInfo = self:GetPlayerSelectedWeaponItemInfo(InPlayerKey) + UGCLogSystem.LogTree("[UGCGameState_UpdatePlayerWeapon] WeaponItemInfo:", WeaponItemInfo) + self:PlayerAddItemInfo(InPlayerKey, WeaponItemInfo) +end + +---@param InItems {ItemID, Count, SubItemList:配件{{ItemID, Count}, ...}} +function UGCGameState:PlayerAddItemInfo(InPlayerKey, InItems) + self:AddItem(InPlayerKey, InItems) + UGCEventSystem.SetTimer(self, function() UGCSystemLibrary.PlayerFullBullet(InPlayerKey) end, 1.) +end + +function UGCGameState:AddItem(InPlayerKey, InItems) + local PC = UGCGameSystem.GetPlayerControllerByPlayerKey(InPlayerKey) + local BackpackComponent = PC:GetBackpackComponent() + for _, Item in pairs(InItems) do + if ItemUtils.IsUGCItem(Item.ItemID) == true then + local ItemDefineID = BackpackUtils.GenerateItemDefineIDByItemTableIDWithRandomInstanceID(Item.ItemID) + local ItemInfo = CreateStruct("BattleItemPickupInfo") + UGCLogSystem.Log("[UGCGameState_PlayerAddItemInfo] ItemID:%s, InstID:%s", tostring(Item.ItemID), tostring(ItemDefineID.InstanceID)) + ItemInfo.Count = Item.Count + ItemInfo.bAutoEquip = (2 == ItemDefineID.Type) or (8 == ItemDefineID.Type) + + BackpackComponent:RegisterItemGenerated(ItemDefineID.TypeSpecificID, ItemInfo.Count, ItemDefineID.InstanceID) + BackpackComponent:PickupItem(ItemDefineID, ItemInfo, EBattleItemPickupReason.Initial) + -- BackpackComponent:PickupInitialItem(ItemDefineID, ItemInfo, true) + + local BattleItemUseTarget = + { + TargetDefineID = ItemDefineID, + -- TargetAssociationName = "", + FilterTargetWhenPickup = true, + } + + for _, SubItem in ipairs(Item.SubItemList or {}) do + if ItemUtils.IsUGCItem(SubItem.ItemID) == true then + local SubItemDefineID = BackpackUtils.GenerateItemDefineIDByItemTableIDWithRandomInstanceID(SubItem.ItemID) + local EquipPickupInfo = CreateStruct("BattleItemPickupInfo") + EquipPickupInfo.Count = SubItem.Count + EquipPickupInfo.bAutoEquip = (2 == SubItemDefineID.Type) or (8 == SubItemDefineID.Type) + EquipPickupInfo.AutoEquipTarget = BattleItemUseTarget + + UGCLogSystem.Log("[UGCGameState_UpdatePlayerWeapon], SubItem.ItemID="..SubItem.ItemID.." SubItem.Count="..SubItem.Count) + BackpackComponent:PickupInitialItem(SubItemDefineID, EquipPickupInfo, true) + end + end + end + end +end + + + +--- 显示玩家选择武器UI,并延迟默认选择第一个 +function UGCGameState:ShowPlayerSelectWeaponWidget(PlayerKey) + UGCSendRPCSystem.ClientShowUI(PlayerKey, WidgetConfig.EUIType.WeaponSelect) + if self.PlayerAutoSelectWeaponHandle[PlayerKey] then + UGCEventSystem.StopTimer(self.PlayerAutoSelectWeaponHandle[PlayerKey]) + end + self.PlayerAutoSelectWeaponHandle[PlayerKey] = UGCEventSystem.SetTimer(self, function() + self.PlayerAutoSelectWeaponHandle[PlayerKey] = nil + self:PlayerSelectWeaponIndex(PlayerKey, 1) + end, GlobalConfigs.GameSetting.WeaponSelectTime) +end + +--- 获取当前默认配置项的其他配件(头甲等出生给予的配置) +function UGCGameState:GetPlayerBeBornParts(InPlayerKey) + local WeaponCombinationList = WeaponSelectionCombinationConfig.WeaponCombinationList[self:GetPlayerWeaponCombination(InPlayerKey)] + if WeaponCombinationList then + return WeaponCombinationList.OtherParts + end + return {} +end + +-- 玩家自定义武器组合 +function UGCGameState:PlayerCustomWeapon(PlayerKey, ProgrammeIndex, WeaponComb, PartsComb) + UGCLogSystem.Log("[UGCGameState_PlayerCustomWeapon] PlayerKey:%s, ProgrammeIndex:%s", tostring(PlayerKey), tostring(ProgrammeIndex)) + UGCLogSystem.LogTree("[UGCGameState_PlayerCustomWeapon] WeaponComb:", WeaponComb) + UGCLogSystem.LogTree("[UGCGameState_PlayerCustomWeapon] PartsComb:", PartsComb) + if ProgrammeIndex == nil or WeaponComb == nil then return end + local CustomWeaponList = {} + local PlayerWeaponCombination = self:GetPlayerWeaponCombination(PlayerKey) + for i, v in pairs(WeaponSelectionCombinationConfig.PlayerCustomWeapon[PlayerWeaponCombination]) do + for _, WeaponID in pairs(v.WeaponIDs) do + CustomWeaponList[#CustomWeaponList + 1] = WeaponID + end + end + for i, v in pairs(WeaponComb) do + if not table.hasValue(CustomWeaponList, v) then + UGCLogSystem.LogError("[UGCGameState_PlayerCustomWeapon] 有错误的武器ID:%s", tostring(v)) + return + end + end + local PlayerWeaponCombs = ArchiveDataConfig.GetPlayerArchiveDataFromType(PlayerKey, ArchiveDataConfig.EArchiveType.WeaponCombs) + if PlayerWeaponCombs == nil then PlayerWeaponCombs = {} end + if PlayerWeaponCombs[PlayerWeaponCombination] == nil then PlayerWeaponCombs[PlayerWeaponCombination] = {} end + + PlayerWeaponCombs[PlayerWeaponCombination][ProgrammeIndex] = WeaponComb + ArchiveDataConfig.SavePlayerArchiveData(PlayerKey, ArchiveDataConfig.EArchiveType.WeaponCombs, PlayerWeaponCombs) + + local PlayerCustomWeaponParts = ArchiveDataConfig.GetPlayerArchiveDataFromType(PlayerKey, ArchiveDataConfig.EArchiveType.WeaponCombs) + if PlayerCustomWeaponParts == nil then PlayerCustomWeaponParts = {} end + for i, WeaponID in pairs(WeaponComb) do + local CanSave = true + for _, PartID in pairs(PartsComb[i]) do + if not MyWeaponSystem.PartIsWeaponCanBeUsed(WeaponID, PartID) then + CanSave = false + break + end + end + if CanSave then + PlayerCustomWeaponParts[WeaponID] = PartsComb[i] + UGCLogSystem.Log("[UGCGameState_PlayerCustomWeapon] Save CustomParts Succeed") + else + UGCLogSystem.LogError("[UGCGameState_PlayerCustomWeapon] Save CustomParts Failure") + end + + end + ArchiveDataConfig.SavePlayerArchiveData(PlayerKey, ArchiveDataConfig.EArchiveType.CustomWeaponParts, PlayerWeaponCombs) + + self:PlayerSelectWeaponIndex(PlayerKey, ProgrammeIndex) + UGCLogSystem.Log("[UGCGameState_PlayerCustomWeapon] Finish") +end +-- PlayerWeaponCombination End ----------------------------------------------------------------------------------------------------------- + + + + +-- 内购 ------------------------------------------------------------------------------------------------------------------------------------------------- + + +--可以通过参数得知玩家物品的变化已经是否购买成功 +function UGCGameState:OnBuyUGCCommodityResult(bSucceeded, PlayerKey, CommodityID, Count, UID, ProductID) + local Result = string.format( + "([UGCGameState_OnBuyUGCCommodityResult bSucceeded=%s PlayerKey=%s CommodityID=%s Count=%s)", + tostring(bSucceeded), + tostring(PlayerKey), + tostring(CommodityID), + tostring(Count), + tostring(ProductID) + ) + ugcprint(Result) + + local cond = UGCGameSystem.IsServer() + if cond then + if bSucceeded then + self:AddGoldBrick(PlayerKey, Count) + UGCLogSystem.Log("[UGCGameState_OnBuyUGCCommodityResult] AddSucceed") + end + local CommodityList = UGCCommoditySystem.GetAllPlayerUGCCommodityList() + local PlayerController = UGCGameSystem.GetPlayerControllerByPlayerKey(PlayerKey) + ugcprint(ToTreeString(CommodityList[PlayerController:GetInt64UID()])) + else + local CommodityList = UGCCommoditySystem.GetUGCCommodityList() + ugcprint(ToTreeString(CommodityList)) + end +end + +-- 内购 End --------------------------------------------------------------------------------------------------------------------------------------------- + + +-- Map --------------------------------------------------------------------------------------------------------------------------------------------- + +function UGCGameState:SetMapKey(InMapKey) + self.MapKey = InMapKey +end + +function UGCGameState:GetMapKey() + return self.MapKey +end + +function UGCGameState:LoadNowMiniMap() + UGCLogSystem.Log("[UGCGameState_LoadNowMiniMap]") + if self:HasAuthority() or self.MapKey == nil then + UGCLogSystem.LogError("[UGCGameState_LoadNowMiniMap] self.MapSelectionFinalResult is nil") + return + end + local MiniMapInfo = MapConfig.MapInfo[self.MapKey].MiniMapInfo + if MiniMapInfo.MapPath then + UGCLogSystem.LogTree("[UGCGameState_LoadNowMiniMap]", MiniMapInfo) + UGCWidgetManagerSystem.ChangeMap(MiniMapInfo.MapPath, MiniMapInfo.MapCentre, MiniMapInfo.MapSize, MiniMapInfo.MapScale) + UGCLogSystem.Log("[UGCGameState_LoadNowMiniMap] Finish") + end +end + +-- Map End ----------------------------------------------------------------------------------------------------------------------------------------- + + + + + +-- 呼吸回血 ----------------------------------------------------------------------------------------------------------------------------------------- +--- 设置可呼吸回血的玩家 +function UGCGameState:SetRespiratoryRegurgitationPlayers(InPlayers) + self.RespiratoryRegurgitationPlayers = InPlayers +end + +--- 获取可呼吸回血的玩家 +function UGCGameState:GetRespiratoryRegurgitationPlayers() + return self.RespiratoryRegurgitationPlayers +end + +-- 呼吸回血 End ------------------------------------------------------------------------------------------------------------------------------------- + +-- 准备阶段 ----------------------------------------------------------------------------------------------------------------------------------------- +function UGCGameState:IsReadyState() + return self:GetGameTime() >= GlobalConfigs.GameSetting.RoundTime +end +-- 准备阶段 End ------------------------------------------------------------------------------------------------------------------------------------- + + +-- Skill ------------------------------------------------------------------------------------------------------------------------------------- + +function UGCGameState:PlayerUseSkill(SkillType, InPlayerKey) + UGCLogSystem.Log("[UGCGameState_PlayerUseSkill]") + SkillConfig.ExeSkill(SkillType, UGCGameSystem.GetPlayerPawnByPlayerKey(InPlayerKey)) + UGCLogSystem.Log("[UGCGameState_PlayerUseSkill] Finish") +end + +-- Skill End ------------------------------------------------------------------------------------------------------------------------------------- + +-- Debug ------------------------------------------------------------------------------------------------------------------------------------- + +function UGCGameState:DebugLogic(InPlayerKey) + local DetectPlayerActor = UGCSystemLibrary.GetUniqueInstanceFromPath(UGCGameSystem.GetUGCResourcesFullPath('Asset/Blueprint/Skill/DetectActor/BP_DetectPlayerNew.BP_DetectPlayerNew_C')) + if DetectPlayerActor then + local Res1 = DetectPlayerActor:CanSeeOutlineSpeicalConditionServer(UGCGameSystem.GetPlayerPawnByPlayerKey(InPlayerKey)) + local Res2 = DetectPlayerActor:CanPlayerBeDetected(UGCGameSystem.GetPlayerPawnByPlayerKey(InPlayerKey)) + UGCLogSystem.Log("[UGCGameState_DebugLogic] Res1:%s, Res2:%s", tostring(Res1), tostring(Res2)) + else + UGCLogSystem.LogError("[UGCGameState_DebugLogic]") + end +end + +-- Debug End ------------------------------------------------------------------------------------------------------------------------------------- + + +------------------------------------------------ GameState Abstract RPC ------------------------------------------------ +function UGCGameState:UGCSendRPCSystemFunc(...) + UGCSendRPCSystem.RPCFunc(...) +end +---------------------------------------------- GameState Abstract RPC End ---------------------------------------------- + + + +-- 工程函数设置 根据工程而修改调整的函数 ------------------------------------------------------------------------------------- +--- 根据游戏队伍模式更新玩家队伍 +---@param PlayerKey uint +function UGCGameState:UpdatePlayerTeam(PlayerKey) + --if GlobalConfigs.GameModeSetting.TeamModeType == CustomEnum.ETeamMode.PersonalWarfare then + -- local NewTeamID = self:GetNewTeamID() + -- UGCTeamSystem.ChangePlayerTeamID(PlayerKey, NewTeamID) + -- UGCLogSystem.Log("[UGCGameState_UpdatePlayerTeam] NewTeamID:%s", tostring(NewTeamID)) + --end + --local PlayerTeamID = UGCPlayerStateSystem.GetTeamID(PlayerKey) + --UGCLogSystem.Log("[UGCGameState_UpdatePlayerTeam]PlayerTeamID:%s", tostring(PlayerTeamID)) + --if PlayerTeamID > 2 then + -- if self.LastChangeTeamIsTeam1 then + -- self.LastChangeTeamIsTeam1 = false + -- UGCTeamSystem.ChangePlayerTeamID(PlayerKey, 2) + -- else + -- self.LastChangeTeamIsTeam1 = true + -- UGCTeamSystem.ChangePlayerTeamID(PlayerKey, 1) + -- end + -- PlayerTeamID = UGCPlayerStateSystem.GetTeamID(PlayerKey) + -- UGCLogSystem.Log("[UGCGameState_UpdatePlayerTeam] NewTeamID:%s", tostring(PlayerTeamID)) + --end + -- + --local PC = UGCGameSystem.GetPlayerControllerByPlayerKey(PlayerKey) + --if PC then + -- PC:UpdatePlayerStartType() + -- UGCLogSystem.Log("[UGCGameState_UpdatePlayerTeam] Finish") + --else + -- UGCLogSystem.LogError("[UGCGameState_UpdatePlayerTeam] PC is nil") + --end +end + +-- 工程设置------------------------------------------------------------------------------------------------------------- + + +function UGCGameState:GetAvailableServerRPCs() + return + "UGCSendRPCSystemFunc" +end +return UGCGameState; diff --git a/CounterAttack_Solo/Script/Blueprint/UGCPlayerController.lua b/CounterAttack_Solo/Script/Blueprint/UGCPlayerController.lua new file mode 100644 index 00000000..c28a6203 --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/UGCPlayerController.lua @@ -0,0 +1,478 @@ +---@class UGCPlayerController_C:BP_UGCPlayerController_C +--Edit Below-- +---@type UGCPlayerController_C +local UGCPlayerController = { + NeedExePlayerIsFirstTimePlaying = false; + bAutoShowGuide = false; + + + -- 可获得的增益次数 + CanObtainIncreaseCount = 0; + -- 当前可选择的增益 + NowCanSelectIncrease = {}; + -- 拥有的增益 + OwnedIncrease = {}; -- [IncreaseType] = Level + -- 增益已满 + IncreaseIsFull = false; +}; + +-- Replicated ------------------------------------------------------------------------------------------------------- + +function UGCPlayerController:GetReplicatedProperties() + return + "CanObtainIncreaseCount", + "NowCanSelectIncrease", + "OwnedIncrease" +end + +function UGCPlayerController:OnRep_CanObtainIncreaseCount() + if UGCEventSystem then + UGCEventSystem.SendEvent(EventEnum.UpdateCanObtainIncreaseCount, self, self.CanObtainIncreaseCount) + end +end + +function UGCPlayerController:OnRep_NowCanSelectIncrease() + if UGCEventSystem then + UGCEventSystem.SendEvent(EventEnum.UpdateNowCanSelectIncrease, self, self.NowCanSelectIncrease) + end +end + +function UGCPlayerController:OnRep_OwnedIncrease() + if UGCEventSystem then + UGCEventSystem.SendEvent(EventEnum.UpdateOwnedIncrease, self, self.OwnedIncrease) + end +end + +-- Replicated End --------------------------------------------------------------------------------------------------- + +function UGCPlayerController:ReceiveBeginPlay() + self.SuperClass.ReceiveBeginPlay(self); + require("Script.Global.WidgetManager.WidgetManager") + + -- 不要自动切换相机 + self.bAutoManageActiveCameraTarget = false + + self.OnPlayerTeamIDChanged:Add(self.PlayerTeamIDChanged, self) + if self:HasAuthority() then + -- 更新出生点位置 + self:UpdatePlayerStartType() + self.PlayerControllerRespawnedDelegate:AddInstance(self.ServerRespawnPlayer, self) + else + TipConfig.Init(self) + WidgetManager:Init(WidgetConfig.PlayModeUI) + self:ShowDefaultUI() + UGCEventSystem.AddListener(EventEnum.GameStateChange, self.GameStateChange, self) + UGCEventSystem.AddListener(EventEnum.PlayerDeathInfo, self.CameraMoveToKiller, self) + UGCEventSystem.AddListener(ArchiveDataConfig.GetParamNotifyEvent(ArchiveDataConfig.EArchiveType.NumberOfPlays), self.ShowGuide, self) + self:ShowGuide() + UGCLogSystem.Log("[UGCPlayerController_ReceiveBeginPlay] Finish") + self.PlayerControllerRespawnedDelegate:AddInstance(self.ShowRespawnWidget, self) + + -- 更新加入队伍聊天房间 + --UGCEventSystem.AddListener(EventEnum.Player, self.CameraMoveToKiller, self) + self:UpdateTeamVoiceRoom() + + -- self:ShowNowGameStateTypeUI() + + end + + UGCLogSystem.Log("[UGCPlayerController_ReceiveBeginPlay] PC Name:%s", tostring(KismetSystemLibrary.GetObjectName(self))) + + +end + +function UGCPlayerController:ServerRespawnPlayer() + UGCLogSystem.Log("[UGCPlayerController_ServerRespawnPlayer]") + + -- 更新背包 + --if self.AddMagnifyingGlassHandle then + -- UGCEventSystem.StopTimer(self.AddMagnifyingGlassHandle) + --end + -- self.AddMagnifyingGlassHandle = UGCEventSystem.SetTimer(self, self.AddMagnifyingGlass, 3) + -- self:UpdatePlayerBackPack() + -- self:UpdatePlayerBackPack_V2() + -- 更新增益到Pawn + self.bCanAddBuff = false + if self.UpdateAlreadyOwnedBuffsHandle then UGCEventSystem.StopTimer(self.UpdateAlreadyOwnedBuffsHandle) end + self.UpdateAlreadyOwnedBuffsHandle = UGCEventSystem.SetTimer(self, function() + self.UpdateAlreadyOwnedBuffsHandle = nil + self:UpdateAlreadyOwnedBuffs() + end, 2.) + +end + +function UGCPlayerController:AddMagnifyingGlass() + self.AddMagnifyingGlassHandle = nil + if UE.IsValid(self.Pawn) then + for i, ItemInfo in pairs(WeaponSelectionCombinationConfig.MagnifyingGlass) do + UGCLogSystem.Log("[UGCPlayerController_AddMagnifyingGlass] ItemID:%s, ItemCount:%s", tostring(ItemInfo.ItemID), tostring(ItemInfo.Count)) + UGCBackPackSystem.AddItem(self.Pawn, ItemInfo.ItemID, ItemInfo.Count) + end + end +end + +function UGCPlayerController:UpdatePlayerBackPack() + + self.DefaultBackPack = TableHelper.DeepCopy(UGCGameSystem.GameState:GetPlayerBeBornParts(self.PlayerKey)) + -- 默认装备 + UGCGameSystem.GameState:PlayerAddItemInfo(self.PlayerKey, self.DefaultBackPack) + -- 默认武器 + UGCGameSystem.GameState:UpdatePlayerWeapon(self.PlayerKey) + + UGCLogSystem.LogTree("[UGCPlayerController_UpdatePlayerBackPack] DefaultBackPack:", self.DefaultBackPack) + + UGCEventSystem.SetTimer(self, function() + local TargetPawn = UGCGameSystem.GetPlayerPawnByPlayerKey(self.PlayerKey) + if UE.IsValid(TargetPawn) then + TargetPawn:SetAllWeaponBulletNumToMaxOnServer(true, false) + for i, v in pairs(ShootWeaponEnums) do + local Weapon = UGCWeaponManagerSystem.GetWeaponBySlot(TargetPawn, v) + if UE.IsValid(Weapon) then + UGCGunSystem.EnableClipInfiniteBullets(Weapon, true) + local MaxBulletNumInOneClip = UGCGunSystem.GetMaxBulletNumInOneClip(Weapon) + Weapon:SetCurrentBulletNumInClipOnServer(MaxBulletNumInOneClip, true) + -- 玩家离开换弹状态 + UGCPawnSystem.LeavePawnState(TargetPawn, EPawnState.Roload) + end + end + end + end, 3) +end + +function UGCPlayerController:UpdatePlayerBackPack_V2() + + + -- 默认武器 + if self.BackPackHandle2 then UGCEventSystem.StopTimer(self.BackPackHandle2) end + self.BackPackHandle2 = UGCEventSystem.SetTimer(self, function() + self.BackPackHandle2 = nil + UGCGameSystem.GameState:UpdatePlayerWeapon(self.PlayerKey) + end, 1.) + + -- 默认装备 + if self.BackPackHandle1 then UGCEventSystem.StopTimer(self.BackPackHandle1) end + self.BackPackHandle1 = UGCEventSystem.SetTimer(self, function() + self.BackPackHandle1 = nil + self.DefaultBackPack = TableHelper.DeepCopy(UGCGameSystem.GameState:GetPlayerBeBornParts(self.PlayerKey)) + UGCGameSystem.GameState:PlayerAddItemInfo(self.PlayerKey, self.DefaultBackPack) + end, 2.) + + -- 校验玩家的武器和配件1次 + if self.BackPackHandle3 then UGCEventSystem.StopTimer(self.BackPackHandle3) end + self.BackPackHandle3 = UGCEventSystem.SetTimer(self, function() + self.BackPackHandle3 = nil + UGCGameSystem.GameState:CheckWeaponAndParts(self.PlayerKey) + end, 6.) + -- 校验玩家的武器和配件2次 + if self.BackPackHandle4 then UGCEventSystem.StopTimer(self.BackPackHandle4) end + self.BackPackHandle4 = UGCEventSystem.SetTimer(self, function() + self.BackPackHandle4 = nil + UGCGameSystem.GameState:CheckWeaponAndParts(self.PlayerKey) + end, 8.) + + -- 补满武器弹夹 + UGCEventSystem.SetTimer(self, function() + UGCSystemLibrary.PlayerFullBullet(self.PlayerKey) + end, 3.) + +end + +function UGCPlayerController:PlayerTeamIDChanged(Controller) + local TeamID = UGCPlayerControllerSystem.GetTeamID(Controller) + UGCLogSystem.Log("[UGCPlayerController_PlayerTeamIDChanged] TeamID:%s", tostring(TeamID)) + UGCEventSystem.SendEvent(EventEnum.PlayerTeamChange, Controller, TeamID) +end + +function UGCPlayerController:UpdatePlayerStartType() + if self.UpdatePlayerStartCount == nil then + self.UpdatePlayerStartCount = 1 + else + self.UpdatePlayerStartCount = 1 + self.UpdatePlayerStartCount + end + local TeamID = UGCPlayerControllerSystem.GetTeamID(self) + UGCLogSystem.Log("[UGCPlayerController_UpdatePlayerStartType] TeamID:%s, UpdatePlayerStartCount:%s", tostring(TeamID), tostring(self.UpdatePlayerStartCount)) + if TeamID > 0 then + if TeamID == 1 then + self:SetStartPointType(EPlayerStartType.Team1) + UGCLogSystem.Log("[UGCPlayerController_UpdatePlayerStartType] 1") + else + self:SetStartPointType(EPlayerStartType.Team2) + UGCLogSystem.Log("[UGCPlayerController_UpdatePlayerStartType] 2") + end + -- UGCSystemLibrary.RespawnPlayer(self.PlayerKey) + -- 重置位置 + UGCEventSystem.SendEvent(EventEnum.ResetPlayerTransformToPlayerStart, self, UGCGameSystem.GetPlayerPawnByPlayerKey(self.PlayerKey)) + + else + self:SetStartPointType(EPlayerStartType.Team1) + UGCEventSystem.SetTimer(self, self.UpdatePlayerStartType, 0.1) + end +end + +-- 判断显示拍脸图 +function UGCPlayerController:ShowGuide() + UGCLogSystem.Log("[UGCPlayerController_ShowGuide] PlayerKey:%s", tostring(self.PlayerKey)) + local PlayNumber = ArchiveDataConfig.GetPlayerArchiveDataFromType(self.PlayerKey, ArchiveDataConfig.EArchiveType.NumberOfPlays) + if PlayNumber and PlayNumber <= 1 and self.ShowOnce == nil then + self.ShowOnce = true + UGCLogSystem.Log("[UGCPlayerController_ShowGuide] PlayNumber:%s", tostring(PlayNumber)) + WidgetManager:ShowPanel(WidgetConfig.EUIType.Guide, false) + end +end + +function UGCPlayerController:ShowRespawnWidget() + UGCLogSystem.Log("[UGCPlayerController_ShowRespawnWidget]") + -- 客户端显示重选武器按键 + WidgetManager:ShowPanel(WidgetConfig.EUIType.ReselectWeaponBtn, false) + -- 海岛工程会重生小地图会显示错误 这里刷新一下 + UGCGameSystem.GameState:LoadNowMiniMap() +end + +-- 显示默认UI +function UGCPlayerController:ShowDefaultUI() + for i, UIType in pairs(WidgetConfig.DefaultShowWidget) do + WidgetManager:ShowPanel(UIType, false) + end +end + +-- 游戏模式改变 +function UGCPlayerController:GameStateChange(NewGameStateType) + if NewGameStateType == CustomEnum.EGameState.End or NewGameStateType == CustomEnum.EGameState.InsufficientNumberOfPeople then + -- 移除不可显示UI + UGCLogSystem.Log("[UGCPlayerController_GameStateChange]") + WidgetManager:DestroyPanel(WidgetConfig.EUIType.InvincibleTime) + WidgetManager:DestroyPanel(WidgetConfig.EUIType.WaitingTime) + end + -- self:ShowNowGameStateTypeUI() +end + +function UGCPlayerController:Client_PlayerIsFirstTimePlaying() + if self:HasAuthority() then return end + UGCLogSystem.Log("[UGCGameState_Client_PlayerIsFirstTimePlaying]") + if WidgetManager.Initialized == false then + self.NeedExePlayerIsFirstTimePlaying = true + else + self:PlayerIsFirstTimePlaying() + end +end + + +--- 根据是否为第一次进入该游戏进行判断 +function UGCPlayerController:AutoShowGuide() + if self.bAutoShowGuide then + WidgetManager:ShowPanel(WidgetConfig.EUIType.Guide, false) + end +end + +function UGCPlayerController:CameraMoveToKiller(VictimKey, CauserKey) + if GlobalConfigs.GameSetting.EnableLerpCamera and VictimKey == self.PlayerKey then + local TrackCamera = UGCSystemLibrary.GetUniqueInstanceFromPath(UGCGameSystem.GetUGCResourcesFullPath('Asset/Blueprint/SceneActor/BP_TrackKillerCamera.BP_TrackKillerCamera_C')) + if UE.IsValid(TrackCamera) then + self:SetViewTargetWithBlend(TrackCamera, 0.,EViewTargetBlendFunction.VTBlend_Linear, 0., false); + UGCLogSystem.Log("[UGCPlayerController_CameraMoveToKiller] Succeed") + else + UGCLogSystem.LogError("[UGCPlayerController_CameraMoveToKiller] TrackCamera is nil") + end + end +end + + + +--- 设置玩家的出生点类型 +function UGCPlayerController:SetStartPointType(InStartPointType) + self.StartPointType = InStartPointType +end + +--- 获取玩家的出生点类型 +function UGCPlayerController:GetStartPointType() + if self.StartPointType == nil then + self.StartPointType = EPlayerStartType.Default + end + return self.StartPointType +end + +--- 商城注册 +function UGCPlayerController:Server_OnUGCCommodityPlayerDataReady() + UGCLogSystem.Log("[UGCPlayerController_Server_OnUGCCommodityPlayerDataReady]") + --注册了名为PlacementModeConfig.PlacingAttr.GoldBrickName的协议,用于购买9000001号商品(商品表已配置该商品),单次购买数量为1 + --UGCCommoditySystem.RegBuyCMD(PlacementModeConfig.PlacingAttr.GoldBrickName, 9000000, 100) + UGCLogSystem.Log("[UGCPlayerController_Server_OnUGCCommodityPlayerDataReady] Finish") +end + +--- 更新加入队伍聊天房间 +function UGCPlayerController:UpdateTeamVoiceRoom() + local TeamID = UGCGameSystem.GameState:GetPlayerTeamIDByPlayerKey(self.PlayerKey) + if TeamID then + local RoomName = "TeamVoiceRoom"..tostring(TeamID) + UGCVoiceManagerSystem.JoinVoiceRoom(RoomName) + UGCLogSystem.Log("[UGCPlayerController_UpdateTeamVoiceRoom] JoinTeamRoom:%s", tostring(TeamID)) + end +end + + + +-- 临时存储玩家的增幅 和 战神进度------------------------------------------------- +function UGCPlayerController:SetOwnedIncrease(InOwnedIncrease) + self.OwnedIncrease = InOwnedIncrease +end + +function UGCPlayerController:GetOwnedIncrease() + if self.OwnedIncrease then + return self.OwnedIncrease + else + return {} + end +end + +-- ----------------------------------------------------------------------------- + +UGCPlayerController.bCanAddBuff = false +function UGCPlayerController:UpdateAlreadyOwnedBuffs() + local TargetPawn = UGCGameSystem.GetPlayerPawnByPlayerKey(self.PlayerKey) + if UE.IsValid(TargetPawn) then + for IncreaseType, Level in pairs(self.OwnedIncrease) do + BuffSystemAPI.PlayerAddBuff(TargetPawn, GodOfWarConfig.BuffList[IncreaseType][Level]) + end + end + self.bCanAddBuff = true +end + +--- 获取可获得增量次数的数值 +function UGCPlayerController:GetCanObtainIncreaseCount() + if self.CanObtainIncreaseCount then + return self.CanObtainIncreaseCount + else + return 0 + end +end +--- 设置可获得增量次数的数值 +function UGCPlayerController:SetCanObtainIncreaseCount(InCanObtainIncreaseCount) + self.CanObtainIncreaseCount = InCanObtainIncreaseCount +end +--- 获取当前可选择增量类型的列表 +function UGCPlayerController:GetNowCanSelectIncrease() + if self.NowCanSelectIncrease then + return self.NowCanSelectIncrease + else + return {} + end +end +--- 设置当前可选择增量类型的列表 +function UGCPlayerController:SetNowCanSelectIncrease(InNowCanSelectIncrease) + self.NowCanSelectIncrease = InNowCanSelectIncrease +end + +--- 增加可选增益层数 +function UGCPlayerController:AddCanObtainIncreaseCount() + -- 判断增益是否满了 + if self.IncreaseIsFull then return end + if self.CanObtainIncreaseCount > 0 then + self.CanObtainIncreaseCount = self.CanObtainIncreaseCount + 1 + else + self.CanObtainIncreaseCount = 1 + self:UpdateNowCanSelectIncrease() + end +end + + +--- 玩家选择增益 +function UGCPlayerController:PlayerSelectIncrease(SelectIndex) + UGCLogSystem.Log("[UGCPlayerController_PlayerSelectIncrease] PlayerKey:%s, SelectIndex:%s", tostring(self.PlayerKey), tostring(SelectIndex)) + if self.CanObtainIncreaseCount > 0 and SelectIndex > 0 and SelectIndex <= GodOfWarConfig.CanSelectIncreaseCount then + -- 给予玩家增幅 + if self:PlayerAddIncrease(self.NowCanSelectIncrease[SelectIndex]) then + self.CanObtainIncreaseCount = self.CanObtainIncreaseCount - 1 + if self.CanObtainIncreaseCount > 0 then + self:UpdateNowCanSelectIncrease() + else + self.NowCanSelectIncrease = {} + end + end + end +end + + + +--- 玩家获得增益 +function UGCPlayerController:PlayerAddIncrease(InIncreaseType) + UGCLogSystem.Log("[UGCPlayerController_PlayerAddIncrease] PlayerKey:%s, InIncreaseType:%s", tostring(self.PlayerKey), tostring(InIncreaseType)) + if self.OwnedIncrease[InIncreaseType] == nil then + self.OwnedIncrease[InIncreaseType] = 0 + end + if #GodOfWarConfig.BuffList[InIncreaseType] > self.OwnedIncrease[InIncreaseType] then + self.OwnedIncrease[InIncreaseType] = self.OwnedIncrease[InIncreaseType] + 1 + local TargetPawn = UGCGameSystem.GetPlayerPawnByPlayerKey(self.PlayerKey) + if UE.IsValid(TargetPawn) then + if self.OwnedIncrease[InIncreaseType] > 1 then + -- 移除上一级增幅 + BuffSystemAPI.PlayerRemoveBuffFromBuffAssetType(TargetPawn, GodOfWarConfig.BuffList[InIncreaseType][self.OwnedIncrease[InIncreaseType] - 1], 1) + end + if self.bCanAddBuff then + local UseBuffRes = BuffSystemAPI.PlayerAddBuff(TargetPawn, GodOfWarConfig.BuffList[InIncreaseType][self.OwnedIncrease[InIncreaseType]]) + UGCLogSystem.Log("[UGCPlayerController_PlayerAddIncrease] UseBuffRes:%s", tostring(UseBuffRes)) + end + -- 播放特效 + ParticleConfig.ClientAddParticleAttachPlayer(self.PlayerKey, TargetPawn, ParticleConfig.EParticleType.AddBuff) + end + return true + end + return false +end + +--- 更新当前可选增益 +function UGCPlayerController:UpdateNowCanSelectIncrease() + UGCLogSystem.Log("[UGCPlayerController_UpdateNowCanSelectIncrease]") + local PlayerCanAddIncrease = {} + for i, IncreaseType in pairs(GodOfWarConfig.EIncreaseType) do + if self.OwnedIncrease[IncreaseType] == nil or #GodOfWarConfig.BuffList[IncreaseType] > self.OwnedIncrease[IncreaseType] then + PlayerCanAddIncrease[#PlayerCanAddIncrease + 1] = IncreaseType + end + end + if #PlayerCanAddIncrease > 0 then + table.Shuffle(PlayerCanAddIncrease) + if self.BaseIncreaseType and table.hasValue(PlayerCanAddIncrease, self.BaseIncreaseType) then + table.Swap(PlayerCanAddIncrease, table.getIndex(PlayerCanAddIncrease, self.BaseIncreaseType), 1) + end + + UGCLogSystem.LogTree("[UGCPlayerController_UpdateNowCanSelectIncrease] PlayerCanAddIncrease:", PlayerCanAddIncrease) + for i = 0, GodOfWarConfig.CanSelectIncreaseCount - 1 do + self.NowCanSelectIncrease[i + 1] = PlayerCanAddIncrease[(i % #PlayerCanAddIncrease) + 1] + end + UGCLogSystem.LogTree("[UGCPlayerController_UpdateNowCanSelectIncrease] NowCanSelectIncrease:", self.NowCanSelectIncrease) + else + -- 已满 + self.NowCanSelectIncrease = {} + self.CanObtainIncreaseCount = 0 + self.IncreaseIsFull = true + end + -- Test Buff + --local TestBuffType = GodOfWarConfig.EIncreaseType.Sensing + --if self.OwnedIncrease[TestBuffType] == nil or #GodOfWarConfig.BuffList[TestBuffType] > self.OwnedIncrease[TestBuffType] then + -- self.NowCanSelectIncrease[1] = TestBuffType + --end +end + +function UGCPlayerController:SetBaseIncrease(IncreaseType) + if table.hasValue(GodOfWarConfig.EIncreaseType, IncreaseType) then + self.BaseIncreaseType = IncreaseType + self:UpdateNowCanSelectIncrease() + end +end + +--- 获取玩家拥有增效的等级 +function UGCPlayerController:GetOwnedIncreaseLevel(InIncreaseType) + return self.OwnedIncrease[InIncreaseType] and self.OwnedIncrease[InIncreaseType] or 0 +end + +function UGCPlayerController:GetAllOwnedIncreaseLevel() + return self.OwnedIncrease +end + +-- 临时存储玩家的增幅 End --------------------------------------------- + +function UGCPlayerController:GetAvailableServerRPCs() + return + "Client_PlayerIsFirstTimePlaying" +end + +return UGCPlayerController; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/UGCPlayerPawn.lua b/CounterAttack_Solo/Script/Blueprint/UGCPlayerPawn.lua new file mode 100644 index 00000000..2bf271c3 --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/UGCPlayerPawn.lua @@ -0,0 +1,533 @@ +---@class UGCPlayerPawn_C:BP_UGCPlayerPawn_C +--Edit Below-- +---@type UGCPlayerPawn_C +local UGCPlayerPawn = { + -- 一次背包刷新 + DoOnceUpdateBackPack = false; + -- Attr ------------------------- + -- 伤害缩放 + Attr_DamageScale = 1; + -- 防御缩放 + Attr_DefenseScale = 1; + -- 闪避概率 + Attr_Dodge = 0; + -- 跳跃计数 + Attr_JumpCount = 0; + -- + -- Attr End --------------------- +}; + +-- Replicated ------------------------------------------------------------------------------------------------------- +function UGCPlayerPawn:GetReplicatedProperties() + return + "Attr_JumpCount" +end + + + +-- Replicated End --------------------------------------------------------------------------------------------------- + +-- Attr ------------------------------------------------------------------------------------------------------------- + +function UGCPlayerPawn:SetDamageScale(InDamageScale) + self.Attr_DamageScale = InDamageScale +end + +function UGCPlayerPawn:GetDamageScale() + return self.Attr_DamageScale +end + +function UGCPlayerPawn:SetDefenseScale(InDefenseScale) + -- 防御值不能小于0 + if InDefenseScale <= 0 then return false end + self.Attr_DefenseScale = InDefenseScale + return true +end + +function UGCPlayerPawn:GetDefenseScale() + return self.Attr_DefenseScale +end + +function UGCPlayerPawn:SetDodge(InDodge) + self.Attr_Dodge = InDodge + return true +end + +function UGCPlayerPawn:GetDodge() + return self.Attr_DefenseScale +end + + +--- Jump API Test + +function UGCPlayerPawn:OnJumped() + UGCLogSystem.Log("[UGCPlayerPawn_OnJumped]") + if UGCGameSystem.IsServer() then + self:AddJumpCount() + end +end + +function UGCPlayerPawn:AddJumpCount() + self.Attr_JumpCount = self.Attr_JumpCount + 1 +end + +function UGCPlayerPawn:GetJumpCount() + return self.Attr_JumpCount +end + +function UGCPlayerPawn:ResetJumpCount() + self.Attr_JumpCount = 0; +end + + +-- Attr End --------------------------------------------------------------------------------------------------------- + + +-- 关闭盒子掉落 +--function UGCPlayerPawn:IsSkipSpawnDeadTombBox(EventInstigater) +-- return true +--end + +function UGCPlayerPawn:ReceiveBeginPlay() + self.SuperClass.ReceiveBeginPlay(self); + --- 设置翻墙功能 + self.bVaultIsOpen = true + --- 设置滑铲功能 + self.IsOpenShovelAbility = false + + UGCEventSystem.SendEvent(EventEnum.PlayerBeginPlay, self) + + if self:HasAuthority() then + self:AddEvent() + if UE.IsValid(self:GetController()) then + self:ReceivePossessed(self:GetController()) + UGCLogSystem.Log("[UGCPlayerPawn_ReceiveBeginPlay] Controller Is Valid") + end + else + + end +end + +--- 客户端必定执行的BeginPlay +function UGCPlayerPawn:ClientMustBeExeBeginPlay() + if self.DoOnceMustBeExeBeginPlay then return end + self.DoOnceMustBeExeBeginPlay = true + self.ClientUpdatedPlayerKey = false +end + + +function UGCPlayerPawn:ReceivePossessed(NewController) + self.SuperClass.ReceivePossessed(self, NewController); + UGCLogSystem.Log("[UGCPlayerPawn_ReceivePossessed] PlayerKey:%s", tostring(NewController.PlayerKey)) + UGCEventSystem.SendEvent(EventEnum.PlayerPossessed, NewController.PlayerKey) + UGCGameSystem.GameState:SetPlayerIsAlive(NewController.PlayerKey, self) + + if UGCSystemLibrary.GetIsPreparationState() then + UGCSystemLibrary.SetPlayerPawnMovable(self, false) + end + + if not self.DoOnceUpdateBackPack then + self.DoOnceUpdateBackPack = true + MyWeaponSystem.UpdatePlayerBackPack(NewController.PlayerKey) + end + + ---- 设置上条命保存的Buff + --self.OwnedIncrease = NewController:GetOwnedIncrease() + --for IncreaseType, Level in pairs(self.OwnedIncrease) do + -- BuffSystemAPI.PlayerAddBuff(self, GodOfWarConfig.BuffList[IncreaseType][Level]) + --end + ---- 初始化上条命的进度 + --self:AddToGodSchedule(NewController:GetToGodSchedule()) + ---- 初始化上条命可选择的增益 + --self:SetNowCanSelectIncrease(NewController:GetNowCanSelectIncrease()) + ---- 初始化上条命可选择的增益数 + --self:SetCanObtainIncreaseCount(NewController:GetCanObtainIncreaseCount()) + -- + ---- 增加一个增益 + --self:AddCanObtainIncreaseCount() + + + +end + + + +function UGCPlayerPawn:ReceiveTick(DeltaTime) + self.SuperClass.ReceiveTick(self, DeltaTime); + if UGCGameSystem.IsServer() and not self:GetCharacterMovementComponent():IsFalling() then + self:ResetJumpCount() + end + + if not UGCGameSystem.IsServer() then + self:ClientMustBeExeBeginPlay() + self:UpdatePlayerKey() + --local HeadPos = self.Mesh:GetSocketLocation("head") + --UGCLogSystem.Log("[UGCPlayerPawn_ReceiveTick]HeadPos:%s, ActorPos:%s", VectorHelper.ToString(HeadPos), VectorHelper.ToString(self:K2_GetActorLocation())) + end +end + +function UGCPlayerPawn:ReceiveEndPlay() + self:RemoveEvent() + self.SuperClass.ReceiveEndPlay(self); +end + + +function UGCPlayerPawn:AddEvent() + if self:HasAuthority() then + -- 这个回调无法拿到倒地死亡的玩家 + -- self.DeadNotifyDelegate:Add(self.PlayerDead, self) + self.DamageNotifyDelegate:Add(self.PlayerInjury, self) + self.OnDeath:Add(self.OnDeathCallBack, self) + else + end +end + + + +function UGCPlayerPawn:RemoveEvent() + if self:HasAuthority() then + -- self.DeadNotifyDelegate:Remove(self.PlayerDead, self) + self.DamageNotifyDelegate:Remove(self.PlayerInjury, self) + self.OnDeath:Remove(self.OnDeathCallBack, self) + + if self.CheckBornItemsHandle then + UGCEventSystem.StopTimer(self.CheckBornItemsHandle) + self.CheckBornItemsHandle = nil + end + if self.CheckWeaponAndPartsHandle then + UGCEventSystem.StopTimer(self.CheckWeaponAndPartsHandle) + self.CheckWeaponAndPartsHandle = nil + end + else + end +end + + +function UGCPlayerPawn:CheckWeaponAndParts() + UGCGameSystem.GameState:CheckWeaponAndParts(self.PlayerKey) +end + + + +function UGCPlayerPawn:CheckBornItems() + UGCLogSystem.Log("[UGCPlayerPawn_CheckBornItems] PlayerKey:%s", tostring(self.PlayerKey)) + UGCLogSystem.LogTree("[UGCPlayerPawn_CheckBornItems]", self.DefaultBackPack) + for i = #self.DefaultBackPack, 1, -1 do + local ItemID = self.DefaultBackPack[i].ItemID + local Count = self.DefaultBackPack[i].Count + local InstCount = UGCBackPackSystem.GetItemCount(self, ItemID) + if InstCount >= Count then + UGCLogSystem.Log("[UGCPlayerPawn_CheckBornItems] i:%s", tostring(i)) + table.remove(self.DefaultBackPack, i) + UGCLogSystem.LogTree("[UGCPlayerPawn_CheckBornItems]", self.DefaultBackPack) + else + UGCBackPackSystem.AddItem(self, ItemID, Count - InstCount) + end + end + if #self.DefaultBackPack == 0 then + UGCEventSystem.StopTimer(self.CheckBornItemsHandle) + self.CheckBornItemsHandle = nil + UGCLogSystem.Log("[UGCPlayerPawn_CheckBornItems] Succeed PlayerKey:%s", tostring(self.PlayerKey)); + end +end + + + + + + + +-------------------------------------------------- Delegate -------------------------------------------------- + +---@param DamageInfo FDamageInfoCollection +---@return VictimKey, CauserKey, WeaponID, DamageType, IsHeadShotDamage, Distance, DamageValue uint, uint, int, EDamageType, bool, float, float +function UGCPlayerPawn:GetDamageInfoCollectionInfo(DamageInfo) + local CauserController = DamageInfo.Instigator + local WeaponID = -1 + local CauserKey = CauserController and CauserController.PlayerKey or -1 + local VictimKey = self.PlayerKey + local CauserItemID = DamageInfo.CauserItemID + --- 近战投掷、投掷手雷 + if CauserItemID then + WeaponID = CauserItemID + end + UGCLogSystem.Log("[UGCPlayerPawn_GetDamageInfoCollectionInfo] WeaponID:%d", WeaponID) + local Distance = 0. + if CauserController and CauserController.Pawn then + Distance = VectorHelper.GetDistance(self:K2_GetActorLocation(), CauserController.Pawn:K2_GetActorLocation()) + end + + local IsHeadShotDamage = (DamageInfo.Hit.BoneName == "head") + return VictimKey, CauserKey, WeaponID, DamageInfo.DamageType, IsHeadShotDamage, Distance, DamageInfo.Damage +end + +---@param DamageInfo FDamageInfoCollection +function UGCPlayerPawn:PlayerDead(DamageInfo) + UGCLogSystem.LogTree("[UGCPlayerPawn_PlayerDead] DamageInfo:", UE.ToTable(DamageInfo)) + local VictimKey, CauserKey, WeaponID, DamageType, IsHeadShotDamage, Distance, DamageValue = self:GetDamageInfoCollectionInfo(DamageInfo) + --UGCSendRPCSystem.RPCEvent(nil, EventEnum.PlayerDeathInfo, VictimKey, CauserKey, WeaponID, DamageType, IsHeadShotDamage, Distance, DamageValue) + --UGCEventSystem.SendEvent(EventEnum.PlayerDeathInfo, VictimKey, CauserKey, WeaponID, DamageType, IsHeadShotDamage, Distance, DamageValue) + UGCGameSystem.GameState:SetPlayerIsAlive(VictimKey, nil) +end + +---@param DamageInfo FDamageInfoCollection +---@param ReturnValue float +function UGCPlayerPawn:PlayerInjury(DamageInfo) + local VictimKey, CauserKey, WeaponID, DamageType, IsHeadShotDamage, Distance, DamageValue = self:GetDamageInfoCollectionInfo(DamageInfo) + UGCEventSystem.SendEvent(EventEnum.PlayerInjuryInfo, VictimKey, CauserKey, WeaponID, DamageType, IsHeadShotDamage, Distance, DamageValue) + UGCSendRPCSystem.RPCEvent(CauserKey, EventEnum.PlayerInjuryInfo, VictimKey, CauserKey, WeaponID, DamageType, IsHeadShotDamage, Distance, DamageValue) +end + +function UGCPlayerPawn:OnDeathCallBack(DeadCharacter,Killer,DamageCauser,KillingHitInfo,KillingHitImpulseDir,KillingHitDamageTypeID,DamageTypeClass,IsHeadShotDamage) + local CauserKey = Killer and Killer.PlayerKey + local WeaponID = -1 + local DamageType = EDamageType.UGCCustomDamageType + 1 + UGCLogSystem.Log("[UGCPlayerPawn_TestOnDeath] PlayerKey:%s, CauserKey:%s", tostring(self.PlayerKey), tostring(CauserKey)) + UGCSendRPCSystem.RPCEvent(nil, EventEnum.PlayerDeathInfo, self.PlayerKey, CauserKey, WeaponID, DamageType, IsHeadShotDamage, 0, 0) + UGCEventSystem.SendEvent(EventEnum.PlayerDeathInfo, self.PlayerKey, CauserKey, WeaponID, DamageType, IsHeadShotDamage, 0, 0) + UGCGameSystem.GameState:SetPlayerIsAlive(self.PlayerKey, nil) +end + +------------------------------------------------ Delegate End ------------------------------------------------ + + + + +------------------------------------------------ ModifyDamage ------------------------------------------------ +---@field UGC_TakeDamageOverrideEvent:fun(Damage:float,DamageType:EDamageType,EventInstigator:AController,DamageCauser:AActor,Hit:FHitResult):float +function UGCPlayerPawn:UGC_TakeDamageOverrideEvent(Damage, DamageType, EventInstigator, DamageCauser, Hit) + -- 判断游戏状态伤害 + if GlobalConfigs.GameSetting.JustPlayingEnableDamage and UGCGameSystem.GameState:GetGameStateType() ~= CustomEnum.EGameState.Playing then + return 0 + end + -- 判断准备阶段伤害开启 + if not GlobalConfigs.GameSetting.ReadyStateEnableDamage and UGCGameSystem.GameState:IsReadyState() then + return 0 + end + + -- 拷贝临时伤害值 + local DamageAmount = Damage + -- 输出修改前的伤害数值 + UGCLogSystem.Log("[UGCPlayerPawn_UGC_TakeDamageOverrideEvent] InDamageAmount:%s, DamageType:%s", tostring(DamageAmount), tostring(DamageType)) + + -- 玩家参数信息对伤害数值的修改 + DamageAmount = self:ModifyDamageByPlayerParameters(DamageAmount, EventInstigator) + -- 伤害类型对伤害数值的修改 + DamageAmount = self:ModifyDamageByDamageType(DamageAmount, DamageType) + -- 绑定的委托的伤害修改 + DamageAmount = self:ModifyDamageByAttachDamageFunc(DamageAmount, DamageType, EventInstigator, DamageCauser, Hit) + + -- 统计玩家分数 + if EventInstigator + and EventInstigator.PlayerKey + and self.PlayerKey + and UGCPlayerStateSystem.GetTeamID(EventInstigator.PlayerKey) ~= UGCPlayerStateSystem.GetTeamID(self.PlayerKey) then + PlayerScoreSystem.AddPlayerScoreData(EventInstigator.PlayerKey, PlayerScoreSystem.Config.EScoreType.Damage, math.clamp(Damage, 0, UGCPawnAttrSystem.GetHealth(self))) + end + + UGCLogSystem.Log("[UGCPlayerPawn_UGC_TakeDamageOverrideEvent] ModifyDamageAmount:%s", tostring(DamageAmount)) + return DamageAmount +end + +--- 玩家信息对伤害数值的修改 +function UGCPlayerPawn:ModifyDamageByPlayerParameters(DamageAmount, CauserPC) + if UE.IsValid(CauserPC) then + local CauserPlayerKey = CauserPC.PlayerKey + if CauserPlayerKey then + -- 获取敌方队伍ID + local CauserTeamID = UGCPlayerStateSystem.GetTeamID(CauserPlayerKey) + -- 获取己方队伍ID + local SelfTeamID = UGCPlayerStateSystem.GetTeamID(self.PlayerKey) + -- 获取施加者的玩家Pawn + local CauserPawn = UGCGameSystem.GetPlayerPawnByPlayerKey(CauserPlayerKey) + + if CauserPlayerKey == self.PlayerKey and GlobalConfigs.GameSetting.bEnableSelfHarm then + --- 对自己的伤害 + DamageAmount = GlobalConfigs.GameSetting.SelfHarmInjuryRatio * DamageAmount + else + --- 他人对自己的伤害 + -- 判断友伤 + if CauserTeamID == SelfTeamID then + -- 友伤数值修改 + DamageAmount = GlobalConfigs.GameSetting.FriendlyInjuryRatio * DamageAmount + end + end + + -- 获取攻击者伤害缩放 + local DamageScale = CauserPawn and CauserPawn:GetDamageScale() or 1 + -- 施加者攻击力对伤害的修改 + DamageAmount = DamageAmount / self:GetDefenseScale() * DamageScale + end + + -- 防御力对伤害的修改 + DamageAmount = DamageAmount / self:GetDefenseScale() + end + return DamageAmount +end + +--- 伤害类型对伤害数值的修改 +function UGCPlayerPawn:ModifyDamageByDamageType(DamageAmount, DamageType) + -- 掉落伤害 + if DamageType == EDamageType.FallingDamage then + DamageAmount = GlobalConfigs.GameSetting.bEnableDropDamage and DamageAmount or 0. + end + -- 设置近战伤害缩放 + if DamageType == EDamageType.MeleeDamage then + DamageAmount = DamageAmount * GlobalConfigs.GameSetting.MeleeDamageScale + end + -- 判断忽略的伤害 + if table.hasValue(GlobalConfigs.GameSetting.IgnoreDamageType, DamageType) then + DamageAmount = 0. + end + return DamageAmount +end + +-- 伤害修改列表 +UGCPlayerPawn.DamageModifyFunctions = {} + +--- 绑定是伤害修改函数对伤害的修改 +function UGCPlayerPawn:ModifyDamageByAttachDamageFunc(DamageAmount, DamageType, EventInstigator, DamageCauser, Hit) + for i, v in pairs(self.DamageModifyFunctions) do + if v.Obj then + DamageAmount = v.Func(v.Obj, self, DamageAmount, DamageType, EventInstigator, DamageCauser, Hit) + else + DamageAmount = v.Func(self, DamageAmount, DamageType, EventInstigator, DamageCauser, Hit) + end + UGCLogSystem.Log("[UGCPlayerPawn_ModifyDamageByAttachDamageFunc] ChangeDamage:%s", tostring(DamageAmount)) + end + + return DamageAmount +end + +--- 添加伤害修改函数 +---@param ModifyFunc function 修改伤害的静态函数 fun(Pawn, Damage, DamageType, EventInstigator, DamageCauser, Hit):float +---@param Layer 修改的层级 层级越高越往后对伤害进行修改 +function UGCPlayerPawn:AddDamageModifyFunc(ModifyFunc, Obj, Layer) + -- 设置层级默认值 + if Layer == nil then Layer = 1 end + -- 插入修改函数 + local IsInsert = false + for i, v in pairs(self.DamageModifyFunctions) do + if v.Layer > Layer then + table.insert(self.DamageModifyFunctions, i, {Func = ModifyFunc, Obj = Obj, Layer = Layer}) + IsInsert = true + break + end + end + if not IsInsert then + table.insert(self.DamageModifyFunctions, #self.DamageModifyFunctions + 1, {Func = ModifyFunc, Obj = Obj, Layer = Layer}) + end + UGCLogSystem.LogTree("[UGCPlayerPawn_AddDamageModifyFunc]", self.DamageModifyFunctions) +end + +--- 移除伤害修改函数 +function UGCPlayerPawn:RemoveDamageModifyFunc(ModifyFunc, Obj) + for i, v in pairs(self.DamageModifyFunctions) do + if v.Func == ModifyFunc and v.Obj == Obj then + table.remove(self.DamageModifyFunctions, i) + UGCLogSystem.LogTree("[UGCPlayerPawn_RemoveDamageModifyFunc]", self.DamageModifyFunctions) + break + end + end +end + +---------------------------------------------- ModifyDamage End ---------------------------------------------- + + +-- UGC Event ------------------------------------------------------------------------------------------------------- +-- 这些事件都是官方的回调或者可重写的事件 + +---@field UGC_PlayerDeadEvent:fun(Killer:AController,DamageType:EDamageType) +---@field UGC_PlayerPickUpEvent:fun() +---@field UGC_LeavePawnStateEvent:fun(PawnState:EPawnState) +---@field UGC_EnterPawnStateEvent:fun(PawnState:EPawnState) +---@field UGC_CloseScopeEvent:fun() +---@field UGC_OpenScopeEvent:fun() +---@field UGC_ReloadEndEvent:fun() +---@field UGC_ReloadStartEvent:fun() +---@field UGC_WeaponSwitchEvent:fun() +---@field UGC_WeaponStopFireEvent:fun() +---@field UGC_WeaponStartFireEvent:fun(isAuto:ESTEWeaponShootType) +---@field UGC_EquipWeaponEvent:fun(Slot:ESurviveWeaponPropSlot) +---@field UGC_ChangeCurrentUsingWeaponEvent:fun(UsingWeaponSlot:ESurviveWeaponPropSlot,LastSlot:ESurviveWeaponPropSlot) + +--- 子弹命中 +---@field UGC_WeaponBulletHitEvent:fun(ShootWeapon:ASTExtraShootWeapon,Bullet:ASTExtraShootWeaponBulletBase,HitInfo:FHitResult) +function UGCPlayerPawn:UGC_WeaponBulletHitEvent(ShootWeapon, Bullet, HitInfo) + UGCEventSystem.SendEvent(EventEnum.BulletHitCallBack, self, ShootWeapon, Bullet, HitInfo) +end + + +---@field UGC_WeaponShootBulletEvent:fun(ShootWeapon:ASTExtraShootWeapon,Bullet:ASTExtraShootWeaponBulletBase) + +-- UGC Event End ----------------------------------------------------------------------------------------------------- + + +--- 处理飘字 +function UGCPlayerPawn:UGC_GetDamageNumberConfigIndex(Damage, IsHeadShot, InstigatorController, DamageCauser, DamageType) + UGCLogSystem.Log("[UGCPlayerPawn_UGC_GetDamageNumberConfigIndex]") + if InstigatorController == UGCSystemLibrary.GetLocalPlayerController() then + return 0 + else + return -1 + end + +end + + +--- 播放粒子 +function UGCPlayerPawn:PlayParticle(InParticleType) + ParticleConfig.AddParticleAttachPlayer(self, InParticleType) +end + + +----------------------------------------------------------------------------------------------------------------------- + +--- 客户端玩家Key更新 +function UGCPlayerPawn:UpdatePlayerKey() + if self.ClientUpdatedPlayerKey == false then + if self.PlayerKey and self.PlayerKey > 0 then + self.ClientUpdatedPlayerKey = true + self:Stroke() + end + end +end + +--- Client +--- 描边 +function UGCPlayerPawn:Stroke() + if GlobalConfigs.GameSetting.EnableStroke then + UGCLogSystem.Log("[UGCPlayerPawn_Stroke]PlayerKey:%s", tostring(self.PlayerKey)) + + UGCEventSystem.SetTimer(self, function() + if UGCGameSystem.GameState:GetPlayerTeamIDByPlayerKey(self.PlayerKey) ~= UGCGameSystem.GameState:GetPlayerTeamIDByPlayerKey(UGCSystemLibrary.GetLocalPlayerKey()) then + if GlobalConfigs.IsHaiDao then + self.Mesh:SetDrawIdeaOutline(true) + for EAvatarSlotTypeNum = 0, EAvatarSlotType.EAvatarSlotType_Max -1 do + UGCLogSystem.Log("[UGCPlayerPawn_Stroke]" .. EAvatarSlotTypeNum) + local MeshComponent = self.CharacterAvatarComp_BP:GetMeshCompBySlot(EAvatarSlotTypeNum) + if MeshComponent ~= nil then + UGCLogSystem.Log("[UGCPlayerPawn_Stroke] Succeed" .. EAvatarSlotTypeNum) + MeshComponent:SetDrawIdeaOutline(true) + end + end + else + -- UGCGameSystem.GameState:RegisterPostProcessMgr(self) + STExtraBlueprintFunctionLibrary.EnablePlayerAvatarOutline(self, true) + UGCLogSystem.Log("[UGCPlayerPawn_Stroke] EnablePlayerAvatarOutline") + end + end + + end, 2) + end +end + + + + +--function UGCPlayerPawn:GetAvailableServerRPCs() +-- return +--end + + +return UGCPlayerPawn; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/UGCPlayerStartManager.lua b/CounterAttack_Solo/Script/Blueprint/UGCPlayerStartManager.lua new file mode 100644 index 00000000..39578cdf --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/UGCPlayerStartManager.lua @@ -0,0 +1,124 @@ +---@class UGCPlayerStartManager_C:BP_PlayerStartManager_C +---@field PlayerStartClass UClass +--Edit Below-- +---@type UGCPlayerStartManager_C +local UGCPlayerStartManager = { + AllPlayerStart = {}; + ResStartPointIndex = 0; + + Team1PlayerStarts = {}; + PlayerStartIndexT1 = 0; + PlayerStartDict = {}; + StartPointTypesIndex = {}; + TempGameState = -1; + +}; + + + +function UGCPlayerStartManager:ReceiveBeginPlay() + self.SuperClass.ReceiveBeginPlay(self) + UGCEventSystem.AddListener(EventEnum.UpdatePlayerStartList, self.UpdatePlayerStartList, self) + UGCEventSystem.AddListener(EventEnum.ResetPlayerTransformToPlayerStart, self.ResetPlayerTransformToPlayerStart, self) + + self:UpdatePlayerStartList() +end + +function UGCPlayerStartManager:UpdatePlayerStartList() + UGCLogSystem.Log("[UGCPlayerStartManager_UpdatePlayerStartList] Start") + self.PlayerStartDict = {} + self.AllPlayerStart = {} + self.StartPointTypesIndex = {} + local TempAllPlayerStart = GameplayStatics.GetAllActorsOfClass(self, self.PlayerStartClass, {}) + for k, TempPlayerStart in pairs(TempAllPlayerStart) do + local PlayerBornPointID = TempPlayerStart.PlayerBornPointID + local PlayerStartType = TempPlayerStart.PlayerStartType + if PlayerStartType ~= nil then + if self.PlayerStartDict[PlayerStartType] == nil then + self.PlayerStartDict[PlayerStartType] = {} + end + if self.PlayerStartDict[PlayerStartType][PlayerBornPointID] == nil then + self.PlayerStartDict[PlayerStartType][PlayerBornPointID] = {} + end + + self.PlayerStartDict[PlayerStartType][PlayerBornPointID][#self.PlayerStartDict[PlayerStartType][PlayerBornPointID] + 1] = TempPlayerStart + self.StartPointTypesIndex[PlayerStartType] = 0 + end + self.AllPlayerStart[#self.AllPlayerStart + 1] = TempPlayerStart + end + + for TeamType, v in pairs(self.PlayerStartDict) do + for PlayerBornPointID, _ in pairs(v) do + table.Shuffle(self.PlayerStartDict[TeamType][PlayerBornPointID]) + end + end + table.Shuffle(self.AllPlayerStart) + UGCLogSystem.LogTree("[UGCPlayerStartManager_UpdatePlayerStartList] PlayerStartDict", self.PlayerStartDict) + UGCLogSystem.LogTree("[UGCPlayerStartManager_UpdatePlayerStartList] AllPlayerStart", self.AllPlayerStart) +end + +function UGCPlayerStartManager:GetUGCModePlayerStart(Controller) + -- 获取重写的出生点函数返回的出生点,若没有则执行常规流程 + local OverridePlayerStart = self:GetOverridePlayerStart(Controller) + if UE.IsValid(OverridePlayerStart) then + return OverridePlayerStart + end + + local PlayerStartType = Controller:GetStartPointType() + local ResPlayerStart = self:GetPlayerStartFromPlayerStartType(PlayerStartType) + if ResPlayerStart == nil then + ResPlayerStart = self:GetPlayerStartFromAllPlayerStart() + UGCLogSystem.LogError("[UGCPlayerStartManager_GetUGCModePlayerStart] 没有此类型的出生点 PlayerStartType:%s ", tostring(PlayerStartType)) + end + return ResPlayerStart +end + +function UGCPlayerStartManager:GetPlayerStartFromPlayerStartType(InPlayerStartType) + if self.PlayerStartDict[InPlayerStartType] == nil then return nil end + local StartPointList = self.PlayerStartDict[InPlayerStartType][UGCGameSystem.GameState:GetMapKey()] + local StartPointIndex = self.StartPointTypesIndex[InPlayerStartType] + if StartPointList == nil or StartPointIndex == nil then return nil end + local ResPlayerStart = StartPointList[StartPointIndex + 1] + self.StartPointTypesIndex[InPlayerStartType] = (StartPointIndex + 1) % #StartPointList + return ResPlayerStart +end + +function UGCPlayerStartManager:GetPlayerStartFromAllPlayerStart() + local ResPlayerStart = self.AllPlayerStart[self.ResStartPointIndex + 1] + self.ResStartPointIndex = (self.ResStartPointIndex + 1) % #self.AllPlayerStart + return ResPlayerStart +end + +function UGCPlayerStartManager:PlayerStartOverride(Func, Obj) + self.OverrideFunc = Func + self.OverrideObj = Obj +end + +function UGCPlayerStartManager:GetOverridePlayerStart(PC) + if self.OverrideFunc then + if self.OverrideObj then + return self.OverrideFunc(self.OverrideObj, PC) + else + return self.OverrideFunc(PC) + end + end + return nil +end + +--- 用于将玩家刷新到出生点的事件 +function UGCPlayerStartManager:ResetPlayerTransformToPlayerStart(InPC, InPawn) + UGCLogSystem.Log("[UGCPlayerStartManager_ResetPlayerTransformToPlayerStart]") + if UE.IsValid(InPC) and UE.IsValid(InPawn) then + local TargetPlayerStart = self:GetUGCModePlayerStart(InPC) + if UE.IsValid(TargetPlayerStart) then + local Pos = TargetPlayerStart:K2_GetActorLocation() + local Rot = TargetPlayerStart:K2_GetActorRotation() + InPawn:K2_SetActorLocation(Pos) + InPC:ClientSetControlRotation(Rot) + else + UGCLogSystem.LogError("[UGCPlayerStartManager_ResetPlayerTransformToPlayerStart] 没有对应出生点") + end + end +end + +return UGCPlayerStartManager; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Blueprint/UGCPlayerState.lua b/CounterAttack_Solo/Script/Blueprint/UGCPlayerState.lua new file mode 100644 index 00000000..68827054 --- /dev/null +++ b/CounterAttack_Solo/Script/Blueprint/UGCPlayerState.lua @@ -0,0 +1,15 @@ +local UGCPlayerState = { +}; + +function UGCPlayerState:ReceiveBeginPlay() + self.SuperClass.ReceiveBeginPlay(self); + self.OnPlayerKillsChangeDelegate:Add(self.UpdateKills, self) + +end + +function UGCPlayerState:UpdateKills() + PlayerScoreSystem.SetPlayerScoreDataFromType(self.PlayerKey, PlayerScoreSystem.Config.EScoreType.Kills, self.Kills) +end + +return UGCPlayerState; + diff --git a/CounterAttack_Solo/Script/Common/ue_enum_custom.lua b/CounterAttack_Solo/Script/Common/ue_enum_custom.lua new file mode 100644 index 00000000..a4919beb --- /dev/null +++ b/CounterAttack_Solo/Script/Common/ue_enum_custom.lua @@ -0,0 +1,23 @@ +-- auto exported UENUM while compiling + +-- sorted by enum name asc + +---@enum EPlayerStartType +EPlayerStartType = { + Default = 0, + Team1 = 1, + Team2 = 2, +}; + + +---@enum EPlaceItemType +EPlaceItemType = { + SmallBunker = 0, + BigBunker = 1, + Slope = 2, + Launch = 3, + LandMine = 4, + Flamethrower = 5, +}; + + diff --git a/CounterAttack_Solo/Script/GameAttribute/game_attribute_type.lua b/CounterAttack_Solo/Script/GameAttribute/game_attribute_type.lua new file mode 100644 index 00000000..095f0d90 --- /dev/null +++ b/CounterAttack_Solo/Script/GameAttribute/game_attribute_type.lua @@ -0,0 +1,91 @@ + +-- auto exported game_attributes +-- including native attributes and custom attributes + + +---@enum UGCNativeGameAttributeType +UGCNativeGameAttributeType = { + --Character [血量-Health], + Character_Health = 'Health', + --Character [最大血量-HealthMax], + Character_HealthMax = 'HealthMax', + --Character [技能急速-SkillCDRecoverRate], + Character_SkillCDRecoverRate = 'SkillCDRecoverRate', + --Character [无描述-SignalHP], + Character_SignalHP = 'SignalHP', + --Character [当前能量值-EnergyCurrent], + Character_EnergyCurrent = 'Energy|EnergyCurrent', + --Character [UGC移动速度倍率-UGCGeneralMoveSpeedScale], + Character_UGCGeneralMoveSpeedScale = 'UGCGeneralMoveSpeedScale', + +--------------------------------------------------------- + + --Weapon [换弹时间影响因子-ReloadTimeFactorWrapper], + Weapon_ReloadTimeFactorWrapper = 'ReloadTimeFactorWrapper', + --Weapon [切枪时间影响因子-SwitchTimeFactorWrapper], + Weapon_SwitchTimeFactorWrapper = 'SwitchTimeFactorWrapper', + --Weapon [攻击间隔影响因子-ShootIntervalFactorWrapper], + Weapon_ShootIntervalFactorWrapper = 'ShootIntervalFactorWrapper', + --Weapon [后坐力影响因子-RecoilFactorWrapper], + Weapon_RecoilFactorWrapper = 'RecoilFactorWrapper', + --Weapon [散布影响因子-DeviationFactorWrapper], + Weapon_DeviationFactorWrapper = 'DeviationFactorWrapper', + --Weapon [子弹基础伤害-BaseImpactDamageWrapper], + Weapon_BaseImpactDamageWrapper = 'BaseImpactDamageWrapper', + --Weapon [子弹基础伤害-MinimumImpactDamageWrapper], + Weapon_MinimumImpactDamageWrapper = 'MinimumImpactDamageWrapper', + --Weapon [子弹飞行速度-BulletFireSpeedWrapper], + Weapon_BulletFireSpeedWrapper = 'BulletFireSpeedWrapper', + --Weapon [最大射程-BulletRangeWrapper], + Weapon_BulletRangeWrapper = 'BulletRangeWrapper', + --Weapon [一次拉栓子弹装填数量-MaxBulletNumInBarrelWrapper], + Weapon_MaxBulletNumInBarrelWrapper = 'MaxBulletNumInBarrelWrapper', + --Weapon [弹匣容量-MaxBulletNumInOneClipWrapper], + Weapon_MaxBulletNumInOneClipWrapper = 'MaxBulletNumInOneClipWrapper', + --Weapon [全自动射击间隔-AutoShootIntervalWrapper], + Weapon_AutoShootIntervalWrapper = 'AutoShootIntervalWrapper', + --Weapon [连发射击间隔-BurstShootCDWrapper], + Weapon_BurstShootCDWrapper = 'BurstShootCDWrapper', + --Weapon [连发数量-BurstShootBulletsNumWrapper], + Weapon_BurstShootBulletsNumWrapper = 'BurstShootBulletsNumWrapper', + --Weapon [连发子弹间隔-BurstShootIntervalWrapper], + Weapon_BurstShootIntervalWrapper = 'BurstShootIntervalWrapper', +}; + +UGCNativeGameAttributeTypeCommentMap = { + +--------------------------------------------------------- + + ['Health'] = 'Character [血量-Health]', + ['HealthMax'] = 'Character [最大血量-HealthMax]', + ['SkillCDRecoverRate'] = 'Character [技能急速-SkillCDRecoverRate]', + ['SignalHP'] = 'Character [无描述-SignalHP]', + ['Energy|EnergyCurrent'] = 'Character [当前能量值-EnergyCurrent]', + ['UGCGeneralMoveSpeedScale'] = 'Character [UGC移动速度倍率-UGCGeneralMoveSpeedScale]', + +--------------------------------------------------------- + + ['ReloadTimeFactorWrapper'] = 'Weapon [换弹时间影响因子-ReloadTimeFactorWrapper]', + ['SwitchTimeFactorWrapper'] = 'Weapon [切枪时间影响因子-SwitchTimeFactorWrapper]', + ['ShootIntervalFactorWrapper'] = 'Weapon [攻击间隔影响因子-ShootIntervalFactorWrapper]', + ['RecoilFactorWrapper'] = 'Weapon [后坐力影响因子-RecoilFactorWrapper]', + ['DeviationFactorWrapper'] = 'Weapon [散布影响因子-DeviationFactorWrapper]', + ['BaseImpactDamageWrapper'] = 'Weapon [子弹基础伤害-BaseImpactDamageWrapper]', + ['MinimumImpactDamageWrapper'] = 'Weapon [子弹基础伤害-MinimumImpactDamageWrapper]', + ['BulletFireSpeedWrapper'] = 'Weapon [子弹飞行速度-BulletFireSpeedWrapper]', + ['BulletRangeWrapper'] = 'Weapon [最大射程-BulletRangeWrapper]', + ['MaxBulletNumInBarrelWrapper'] = 'Weapon [一次拉栓子弹装填数量-MaxBulletNumInBarrelWrapper]', + ['MaxBulletNumInOneClipWrapper'] = 'Weapon [弹匣容量-MaxBulletNumInOneClipWrapper]', + ['AutoShootIntervalWrapper'] = 'Weapon [全自动射击间隔-AutoShootIntervalWrapper]', + ['BurstShootCDWrapper'] = 'Weapon [连发射击间隔-BurstShootCDWrapper]', + ['BurstShootBulletsNumWrapper'] = 'Weapon [连发数量-BurstShootBulletsNumWrapper]', + ['BurstShootIntervalWrapper'] = 'Weapon [连发子弹间隔-BurstShootIntervalWrapper]', +}; + +---@enum UGCCustomGameAttributeType +UGCCustomGameAttributeType = { +}; + +UGCCustomGameAttributeTypeCommentMap = { +}; + diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_AddMaxHealth.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_AddMaxHealth.lua new file mode 100644 index 00000000..7e445c96 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_AddMaxHealth.lua @@ -0,0 +1,35 @@ +-- Script.Global.BuffSystem.BuffAction.BuffAction_AddMaxHealth +local BuffActionBase = require('Script.Global.BuffSystem.BuffActionBase') + +local BuffAction_AddMaxHealth = setmetatable( + { + AddVal = 0 + }, + { __index = BuffActionBase, __metatable = BuffActionBase } +); + +function BuffAction_AddMaxHealth:LuaDoAction() + BuffActionBase.LuaDoAction(self) + + if not UGCGameSystem.IsServer() then return true end + local OwnerPawn = self:GetOwnerPawn() + if UE.IsValid(OwnerPawn) then + UGCLogSystem.Log("[BuffAction_AddMaxHealth_LuaDoAction] MaxHealth:%s", tostring(UGCPawnAttrSystem.GetHealthMax(OwnerPawn))) + local Health = UGCPawnAttrSystem.GetHealth(OwnerPawn) + UGCPawnAttrSystem.SetHealthMax(OwnerPawn, UGCPawnAttrSystem.GetHealthMax(OwnerPawn) + self.AddVal) + UGCPawnAttrSystem.SetHealth(self:GetOwnerPawn(), Health + self.AddVal) + UGCLogSystem.Log("[BuffAction_AddMaxHealth_LuaDoAction] AddVal:%s, MaxHealth:%s", tostring(self.AddVal), tostring(UGCPawnAttrSystem.GetHealthMax(OwnerPawn))) + end +end + +function BuffAction_AddMaxHealth:LuaUndoAction() + BuffActionBase.LuaUndoAction(self) + if not UGCGameSystem.IsServer() then return true end + UGCLogSystem.Log("[BuffAction_AddMaxHealth_LuaUndoAction]") + local OwnerPawn = self:GetOwnerPawn() + if UE.IsValid(OwnerPawn) then + UGCPawnAttrSystem.SetHealthMax(OwnerPawn, UGCPawnAttrSystem.GetHealthMax(OwnerPawn) - self.AddVal) + end +end + +return BuffAction_AddMaxHealth; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_BeFatedNotToDie.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_BeFatedNotToDie.lua new file mode 100644 index 00000000..ac6deada --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_BeFatedNotToDie.lua @@ -0,0 +1,87 @@ +local BuffActionBase = require('Script.Global.BuffSystem.BuffActionBase') + +local BuffAction_BeFatedNotToDie = setmetatable( + { + -- Param --------------------------- + -- 命不该绝次数上限 + MaxCount = 1; + -- 伤害修改函数的层级 + ModifyDamageFuncLayer = 1e4; + -- 触发回血比例 + AddHealthPercentage = -1; + -- 触发无敌时间 + InvincibleTime = -1; + -- Param End ----------------------- + -- 已使用次数 + UsedBuffCount = 0; + }, + { __index = BuffActionBase, __metatable = BuffActionBase } +); + +function BuffAction_BeFatedNotToDie:LuaDoAction() + BuffActionBase.LuaDoAction(self) + if not UGCGameSystem.IsServer() then return true end + UGCLogSystem.Log("[BuffAction_BeFatedNotToDie_LuaDoAction]") + self:GetOwnerPawn():AddDamageModifyFunc(self.BeFatedNotToDieFunc, self, self.ModifyDamageFuncLayer) +end + +function BuffAction_BeFatedNotToDie:LuaUndoAction() + BuffActionBase.LuaUndoAction(self) + if not UGCGameSystem.IsServer() then return true end + UGCLogSystem.Log("[BuffAction_BeFatedNotToDie_LuaUndoAction]") + if UE.IsValid(self:GetOwnerPawn()) then + self:GetOwnerPawn():RemoveDamageModifyFunc(self.BeFatedNotToDieFunc, self, self.ModifyDamageFuncLayer) + end +end + +function BuffAction_BeFatedNotToDie:LuaResetAction() + BuffActionBase.LuaResetAction(self) + self.UsedBuffCount = 0 +end + +function BuffAction_BeFatedNotToDie:BeFatedNotToDieFunc(TargetPawn, DamageAmount, DamageType, EventInstigator, DamageCauser, Hit) + if self.UsedBuffCount < self.MaxCount then + local PlayerHealth = UGCPawnAttrSystem.GetHealth(TargetPawn) + if PlayerHealth - DamageAmount < 1 then + local OwnerPawn = self:GetOwnerPawn() + if self:AddPlayerHealthPercentage(OwnerPawn) then + DamageAmount = 0 + else + DamageAmount = PlayerHealth - 1 + end + self:AddInvincible(OwnerPawn) + self.UsedBuffCount = self.UsedBuffCount + 1 + UGCSendRPCSystem.RPCEvent(TargetPawn.PlayerKey, EventEnum.AddTip, TipConfig.TipType.BeFatedNotToDieOwner, self.UsedBuffCount) + if EventInstigator and EventInstigator.PlayerKey then + UGCSendRPCSystem.RPCEvent(EventInstigator.PlayerKey, EventEnum.AddTip, TipConfig.TipType.BeFatedNotToDieCauser) + end + end + end + return DamageAmount +end + +function BuffAction_BeFatedNotToDie:AddPlayerHealthPercentage(TargetPawn) + if self.AddHealthPercentage > 0 then + if UE.IsValid(TargetPawn) then + UGCPawnAttrSystem.SetHealth(TargetPawn, UGCPawnAttrSystem.GetHealthMax(TargetPawn) * self.AddHealthPercentage) + end + return true + end + return false +end + +function BuffAction_BeFatedNotToDie:AddInvincible(TargetPawn) + if self.InvincibleTime > 0 then + UGCPawnSystem.SetIsInvincible(TargetPawn, true) + UGCEventSystem.SetTimer(UGCGameSystem.GameState, function() + if UE.IsValid(TargetPawn) then + UGCPawnSystem.SetIsInvincible(TargetPawn, false) + end + end, self.InvincibleTime) + end +end + + + + +return BuffAction_BeFatedNotToDie; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_BulletHitApplyRadialDamage.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_BulletHitApplyRadialDamage.lua new file mode 100644 index 00000000..d8702223 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_BulletHitApplyRadialDamage.lua @@ -0,0 +1,124 @@ +local BuffActionBase = require('Script.Global.BuffSystem.BuffActionBase') + +local BuffAction_BulletHitApplyRadialDamage = setmetatable( + { + -- Param --------------------------- + -- 仅枪械武器触发 + IsShootWeapon = true; + -- 筛选武器,若不为空则内部对应的武器攻击才会触发,若为空则全部武器均会触发 + FilterWeaponItemID = {}; + + -- Damage -- + MaxDamage = 20; + MinDamage = 20; + + -- 内部范围,既最高伤害的范围 + InnerRadius = 50; + -- 外部范围,既伤害范围,到该范围边界则为最低伤害 + OuterRadius = 200; + -- Inner到Outer范围区间的伤害衰减指数 + FallOff = 2; + -- Damage -- + + -- 冷却时间 + CoolingTime = 2; + -- 粒子类型 + ParticleType = nil; + -- 音效类型 + SoundType = nil; + -- Param End ----------------------- + + -- 正在冷却 + bIsCooling = false; + + ShootWeaponType = { + EWeaponTypeNew.EWeaponTypeNew_Rifle, + EWeaponTypeNew.EWeaponTypeNew_SingleShotSniper, + EWeaponTypeNew.EWeaponTypeNew_BurstShotSniper, + EWeaponTypeNew.EWeaponTypeNew_Submachine, + EWeaponTypeNew.EWeaponTypeNew_ShotGun, + EWeaponTypeNew.EWeaponTypeNew_Pistol, + EWeaponTypeNew.EWeaponTypeNew_Crossbow, + } + }, + { __index = BuffActionBase, __metatable = BuffActionBase } +); + +function BuffAction_BulletHitApplyRadialDamage:LuaDoAction() + BuffActionBase.LuaDoAction(self) + if not UGCGameSystem.IsServer() then return true end + UGCLogSystem.LogTree("[BuffAction_BulletHitApplyRadialDamage_LuaUndoAction]", self.ShootWeaponType) + + -- 绑定Event传入的self可能有点问题,需要与存储OwnerPawn才能获取到正确的OwnerPawn + UGCEventSystem.AddListener(EventEnum.BulletHitCallBack, self.BulletHitCallBack, self) + -- 启用Tick + self:EnableTick() +end + +function BuffAction_BulletHitApplyRadialDamage:LuaUndoAction() + BuffActionBase.LuaUndoAction(self) + if not UGCGameSystem.IsServer() then return true end + + if self.CoolingHandle then + UGCEventSystem.StopTimer(self.CoolingHandle) + end + UGCEventSystem.RemoveListener(EventEnum.BulletHitCallBack, self.BulletHitCallBack, self) +end + +--function BuffAction_BulletHitApplyRadialDamage:LuaUpdateAction(DeltaSeconds) +-- BuffActionBase.LuaUpdateAction(self, DeltaSeconds) +--end + +function BuffAction_BulletHitApplyRadialDamage:CheckWeapon(InWeaponInst) + local WeaponItemID = InWeaponInst:GetWeaponItemID() + if #self.FilterWeaponItemID > 0 then + return table.hasValue(self.FilterWeaponItemID, WeaponItemID) + end + local WeaponTypeNew = InWeaponInst:GetWeaponTypeNew() + UGCLogSystem.Log("[BuffAction_BulletHitApplyRadialDamage_CheckWeapon] WeaponTypeNew:%s", tostring(WeaponTypeNew)) + if self.IsShootWeapon then + return table.hasValue(self.ShootWeaponType, WeaponTypeNew) + end + return true +end + +function BuffAction_BulletHitApplyRadialDamage:BulletHitCallBack(TargetPawn, WeaponInst, BulletInst, HitInfo) + if self:GetOwnerPawn() == TargetPawn and self.bIsCooling == false and self:CheckWeapon(WeaponInst) then + -- 冷却 + if self.CoolingTime > 1e-2 then + self.bIsCooling = true + self.CoolingHandle = UGCEventSystem.SetTimer(UGCGameSystem.GameState, function() + self.bIsCooling = false + self.CoolingHandle = nil + end, self.CoolingTime) + end + local Pos = HitInfo.Location + -- 施加范围伤害 + UGCGameSystem.ApplyRadialDamage( + self.MaxDamage, + self.MinDamage, + Pos, + self.InnerRadius, + self.OuterRadius, + self.FallOff, + EDamageType.RadialDamage, + {}, + WeaponInst, + TargetPawn:GetController(), + ECollisionChannel.ECC_Visibility, + WeaponInst:GetWeaponItemID() + ); + BuffSystemAPI.RPCAction(nil, self:GetInstID(), BuffActionConfig.EActionType.BulletHitApplyRadialDamage, "ClientExplosionFX", VectorHelper.ToLuaTable(Pos)) + end +end + +function BuffAction_BulletHitApplyRadialDamage:ClientExplosionFX(Pos) + if self.ParticleType then + ParticleConfig.AddParticleFromPosAndRot(self.ParticleType, Pos, nil, self.OuterRadius / 100) + end + if self.SoundType then + SoundSystem.PlaySound(self.SoundType, Pos, VectorHelper.RotZero()) + end +end + +return BuffAction_BulletHitApplyRadialDamage; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_ContinuousDamage.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_ContinuousDamage.lua new file mode 100644 index 00000000..4fed8d00 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_ContinuousDamage.lua @@ -0,0 +1,54 @@ +-- Script.Global.BuffSystem.BuffAction.BuffAction_ContinuousDamage +local BuffActionBase = require('Script.Global.BuffSystem.BuffActionBase') +local BuffAction_ContinuousDamage = setmetatable( + { + -- 每秒受到的伤害 + DamagePerSecond = 10; + + LastDamageTime = 0; + }, + { __index = BuffActionBase, __metatable = BuffActionBase } +); + +--[[ +-- 常用接口 +self:GetInstID() -- 获取BuffID +self:GetOwnerPawn() -- 获取拥有者 +BuffSystemAPI.GetBuffCauser(self:GetInstID()) -- 获取Buff给予者 + +self:EnableTick() -- 开启Tick +self:StopTick() -- 会自动关 +self:IsEnableTick() -- 是否已开启Tick +]] + +function BuffAction_ContinuousDamage:LuaDoAction() + BuffActionBase.LuaDoAction(self) + if not UGCGameSystem.IsServer() then return true end + UGCLogSystem.Log("[BuffAction_ContinuousDamage_LuaDoAction] DamagePerSecond:%s", tostring(self.DamagePerSecond)) + self:EnableTick() +end + +function BuffAction_ContinuousDamage:LuaUpdateAction(DeltaSeconds) + BuffActionBase.LuaUpdateAction(self, DeltaSeconds) + self.LastDamageTime = self.LastDamageTime + DeltaSeconds + if self.LastDamageTime < 1. then return end + self.LastDamageTime = self.LastDamageTime - 1 + --UGCLogSystem.Log("[BuffAction_ContinuousDamage_LuaUpdateAction] 1") + local OwnerPawn = self:GetOwnerPawn() + if UE.IsValid(OwnerPawn) then + -- UGCLogSystem.Log("[BuffAction_ContinuousDamage_LuaUpdateAction] BuffID:%s, PlayerHealth:%s",tostring(self:GetInstID()), tostring(UGCPawnAttrSystem.GetHealth(OwnerPawn))) + local BuffCauser = BuffSystemAPI.GetBuffCauser(self:GetInstID()) + --UGCLogSystem.Log("[BuffAction_ContinuousDamage_LuaUpdateAction] OwnerPawn:%s", tostring(OwnerPawn)) + + if BuffCauser == nil then + BuffCauser = OwnerPawn:GetController() + --UGCLogSystem.Log("[BuffAction_ContinuousDamage_LuaUpdateAction] BuffCauser:%s", tostring(BuffCauser)) + end + local Res = UGCGameSystem.ApplyDamage(self:GetOwnerPawn(), self.DamagePerSecond, nil, nil, EDamageType.UGCCustomDamageType + 1) + -- UGCLogSystem.Log("[BuffAction_ContinuousDamage_LuaUpdateAction] 4 Damage:%s, Res:%s", tostring(self.DamagePerSecond), Res) + end +end + + + +return BuffAction_ContinuousDamage; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_Counterattack.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_Counterattack.lua new file mode 100644 index 00000000..0c8b6a6d --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_Counterattack.lua @@ -0,0 +1,58 @@ +-- Script.Global.BuffSystem.BuffAction.BuffAction_Counterattack +local BuffActionBase = require('Script.Global.BuffSystem.BuffActionBase') + +local BuffAction_Counterattack = setmetatable( + { + -- 每层增加伤害的缩放 + LayerAddDamageScale = 0.1; + -- 每多少血量百分比增加一层 + LayerHPInterval = 0.1; + -- 基础层级 + BaseLayer = 1; + + + -- 上一层级 + LastLayer = 0; + }, + { __index = BuffActionBase, __metatable = BuffActionBase } +); + +function BuffAction_Counterattack:LuaDoAction() + BuffActionBase.LuaDoAction(self) + + if not UGCGameSystem.IsServer() then return true end + UGCLogSystem.Log("[BuffAction_Counterattack_LuaDoAction]") + self:GetOwnerPawn().OnCharacterHpChange:Add(self.UpdateNowDamageScale, self) + local NowHP = UGCPawnAttrSystem.GetHealth(self:GetOwnerPawn()) + local NowMaxHP = UGCPawnAttrSystem.GetHealthMax(self:GetOwnerPawn()) + self:UpdateNowDamageScale(NowHP,NowMaxHP,NowHP) +end + +function BuffAction_Counterattack:LuaUndoAction() + BuffActionBase.LuaUndoAction(self) + if not UGCGameSystem.IsServer() then return true end + UGCLogSystem.Log("[BuffAction_Counterattack_LuaUndoAction]") + local OwnerPawn = self:GetOwnerPawn() + if UE.IsValid(OwnerPawn) then + OwnerPawn:SetDamageScale(OwnerPawn:GetDamageScale() / self:GetDamageScaleFromLayer(self.LastLayer)) + self.LastLayer = 0 + end +end + +function BuffAction_Counterattack:UpdateNowDamageScale(CurrentHP,MaxHP,PrevHP) + UGCLogSystem.Log("[BuffAction_Counterattack_UpdateNowDamageScale] CurrentHP:%s,MaxHP:%s,PrevHP:%s", tostring(CurrentHP), tostring(MaxHP), tostring(PrevHP)) + local OwnerPawn = self:GetOwnerPawn() + if UE.IsValid(OwnerPawn) then + local NowLayer = (MaxHP - CurrentHP) / MaxHP // self.LayerHPInterval + self.BaseLayer + if NowLayer ~= self.LastLayer then + OwnerPawn:SetDamageScale(OwnerPawn:GetDamageScale() / self:GetDamageScaleFromLayer(self.LastLayer) * self:GetDamageScaleFromLayer(NowLayer)) + self.LastLayer = NowLayer + end + end +end + +function BuffAction_Counterattack:GetDamageScaleFromLayer(Layer) + return Layer * self.LayerAddDamageScale + 1 +end + +return BuffAction_Counterattack; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_DamageAddBuff.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_DamageAddBuff.lua new file mode 100644 index 00000000..447f43c3 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_DamageAddBuff.lua @@ -0,0 +1,45 @@ +local BuffActionBase = require('Script.Global.BuffSystem.BuffActionBase') + +local BuffAction_DamageAddBuff = setmetatable( + { + -- Param --------------------------- + -- 每秒恢复量 + BuffAssetType = nil; + -- Param End ----------------------- + + + + }, + { __index = BuffActionBase, __metatable = BuffActionBase } +); + +function BuffAction_DamageAddBuff:LuaDoAction() + BuffActionBase.LuaDoAction(self) + if not UGCGameSystem.IsServer() then return true end + UGCLogSystem.Log("[BuffAction_DamageAddBuff_LuaDoAction]Params:%s, %s", self.ReplyPerSecond, self.WaitAddHealthTime) + + -- 绑定Event传入的self可能有点问题,需要与存储OwnerPawn才能获取到正确的OwnerPawn + UGCEventSystem.AddListener(EventEnum.PlayerInjuryInfo, self.PlayerInjuryInfo, self) +end + +function BuffAction_DamageAddBuff:LuaUndoAction() + BuffActionBase.LuaUndoAction(self) + if not UGCGameSystem.IsServer() then return true end + UGCLogSystem.Log("[BuffAction_DamageAddBuff_LuaUndoAction]") + UGCEventSystem.RemoveListener(EventEnum.PlayerInjuryInfo, self.PlayerInjuryInfo, self) +end + + +function BuffAction_DamageAddBuff:PlayerInjuryInfo(VictimKey, CauserKey, WeaponID, DamageType, IsHeadShotDamage, Distance, DamageValue) + local Victim = UGCGameSystem.GetPlayerPawnByPlayerKey(VictimKey) + if UE.IsValid(self:GetOwnerPawn()) and self:GetOwnerPawn():IsAlive() and UE.IsValid(Victim) and Victim:IsAlive() then + if CauserKey == self:GetOwnerPawn().PlayerKey and self.BuffAssetType and UGCPlayerStateSystem.GetTeamID(CauserKey) ~= UGCPlayerStateSystem.GetTeamID(VictimKey) then + BuffSystemAPI.PlayerAddBuff(Victim, self.BuffAssetType, self:GetOwnerPawn():GetController(), self:GetOwnerPawn()) + UGCLogSystem.Log("[BuffAction_DamageAddBuff_PlayerInjuryInfo] Succeed") + end + end +end + + + +return BuffAction_DamageAddBuff; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_DamageScale.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_DamageScale.lua new file mode 100644 index 00000000..165b992b --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_DamageScale.lua @@ -0,0 +1,32 @@ +-- Script.Global.BuffSystem.BuffAction.BuffAction_DamageScale +local BuffActionBase = require('Script.Global.BuffSystem.BuffActionBase') + +local BuffAction_DamageScale = setmetatable( + { + DamageScale = 1. + }, + { __index = BuffActionBase, __metatable = BuffActionBase } +); + +function BuffAction_DamageScale:LuaDoAction() + BuffActionBase.LuaDoAction(self) + + if not UGCGameSystem.IsServer() then return true end + UGCLogSystem.Log("[BuffAction_DamageScale_LuaDoAction]") + local OwnerPawn = self:GetOwnerPawn() + if UE.IsValid(OwnerPawn) and self.DamageScale then + OwnerPawn:SetDamageScale(OwnerPawn:GetDamageScale() * self.DamageScale) + end +end + +function BuffAction_DamageScale:LuaUndoAction() + BuffActionBase.LuaUndoAction(self) + if not UGCGameSystem.IsServer() then return true end + UGCLogSystem.Log("[BuffAction_DamageScale_LuaUndoAction]") + local OwnerPawn = self:GetOwnerPawn() + if UE.IsValid(OwnerPawn) then + OwnerPawn:SetDamageScale(OwnerPawn:GetDamageScale() / self.DamageScale) + end +end + +return BuffAction_DamageScale; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_DefenseScale.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_DefenseScale.lua new file mode 100644 index 00000000..e0f93b69 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_DefenseScale.lua @@ -0,0 +1,31 @@ +local BuffActionBase = require('Script.Global.BuffSystem.BuffActionBase') + +local BuffAction_DefenseScale = setmetatable( + { + DefenseScale = 1; + }, + { __index = BuffActionBase, __metatable = BuffActionBase } +); + +function BuffAction_DefenseScale:LuaDoAction() + BuffActionBase.LuaDoAction(self) + if not UGCGameSystem.IsServer() then return true end + UGCLogSystem.Log("[BuffAction_DefenseScale_LuaDoAction]") + local OwnerPawn = self:GetOwnerPawn() + if UE.IsValid(OwnerPawn) then + OwnerPawn:SetDefenseScale(OwnerPawn:GetDefenseScale() * self.DefenseScale) + end +end + +function BuffAction_DefenseScale:LuaUndoAction() + BuffActionBase.LuaUndoAction(self) + if not UGCGameSystem.IsServer() then return true end + UGCLogSystem.Log("[BuffAction_DefenseScale_LuaUndoAction]") + local OwnerPawn = self:GetOwnerPawn() + if UE.IsValid(OwnerPawn) then + OwnerPawn:SetDefenseScale(OwnerPawn:GetDefenseScale() / self.DefenseScale) + end +end + + +return BuffAction_DefenseScale; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_InfiniteBullets.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_InfiniteBullets.lua new file mode 100644 index 00000000..b563f6a7 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_InfiniteBullets.lua @@ -0,0 +1,31 @@ +local BuffActionBase = require('Script.Global.BuffSystem.BuffActionBase') + +local BuffAction_InfiniteBullets = setmetatable( + {}, + { __index = BuffActionBase, __metatable = BuffActionBase } +); + + +function BuffAction_InfiniteBullets:LuaDoAction() + BuffActionBase.LuaDoAction(self) + if not UGCGameSystem.IsServer() then return true end + UGCLogSystem.Log("[BuffAction_InfiniteBullets_LuaDoAction]") + local OwnerPawn = self:GetOwnerPawn() + if UE.IsValid(OwnerPawn) then + for i, v in pairs(ShootWeaponEnums) do + local Weapon = UGCWeaponManagerSystem.GetWeaponBySlot(OwnerPawn, v) + if UE.IsValid(Weapon) then + UGCGunSystem.EnableInfiniteBullets(Weapon, true); + end + end + end +end + +--function BuffAction_InfiniteBullets:LuaUndoAction() +-- self.BuffActionBase.LuaUndoAction(self) +--end + + + + +return BuffAction_InfiniteBullets; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_JumpScale.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_JumpScale.lua new file mode 100644 index 00000000..91673394 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_JumpScale.lua @@ -0,0 +1,40 @@ + +local BuffActionBase = require('Script.Global.BuffSystem.BuffActionBase') + +local BuffAction_JumpScale = setmetatable( + { + JumpScale = 1; + GravityScale = 1; + }, + { __index = BuffActionBase, __metatable = BuffActionBase } +); + +-- Script.Blueprint.UGCBuffs.BuffAction.BuffAction_JumpScale +function BuffAction_JumpScale:LuaDoAction() + BuffActionBase.LuaDoAction(self) + if not UGCGameSystem.IsServer() then return end + UGCLogSystem.Log("[BuffAction_JumpScale_LuaDoAction]") + local OwnerPawn = self:GetOwnerPawn() + if UE.IsValid(OwnerPawn) then + local JumpZVelocity = UGCPawnAttrSystem.GetJumpZVelocity(OwnerPawn) + UGCPawnAttrSystem.SetJumpZVelocity(OwnerPawn, JumpZVelocity * self.JumpScale) + local BaseGravityScale = OwnerPawn.STCharacterMovement.GravityScale + OwnerPawn:SetGravityScale(BaseGravityScale * self.GravityScale) + end +end + +function BuffAction_JumpScale:LuaUndoAction() + BuffActionBase.LuaUndoAction(self) + if not UGCGameSystem.IsServer() then return end + UGCLogSystem.Log("[BuffAction_JumpScale_LuaDoAction]") + local OwnerPawn = self:GetOwnerPawn() + if UE.IsValid(OwnerPawn) then + local JumpZVelocity = UGCPawnAttrSystem.GetJumpZVelocity(OwnerPawn) + UGCPawnAttrSystem.SetJumpZVelocity(OwnerPawn, JumpZVelocity / self.JumpScale) + local BaseGravityScale = OwnerPawn.STCharacterMovement.GravityScale + OwnerPawn:SetGravityScale(BaseGravityScale / self.GravityScale) + end +end + + +return BuffAction_JumpScale; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_JumpStrengthen.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_JumpStrengthen.lua new file mode 100644 index 00000000..9ce72592 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_JumpStrengthen.lua @@ -0,0 +1,41 @@ + +local BuffActionBase = require('Script.Global.BuffSystem.BuffActionBase') + +local BuffAction_JumpStrengthen = setmetatable( + { + AddJumpMaxCount = 1; + }, + { __index = BuffActionBase, __metatable = BuffActionBase } +); + +-- Script.Blueprint.UGCBuffs.BuffAction.BuffAction_JumpStrengthen +function BuffAction_JumpStrengthen:LuaDoAction() + BuffActionBase.LuaDoAction(self) + UGCLogSystem.Log("[BuffAction_JumpStrengthen_LuaDoAction]") + local OwnerPawn = self:GetOwnerPawn() + if UE.IsValid(OwnerPawn) then + --OwnerPawn.JumpMaxCount = self.AddJumpMaxCount + 1 + + -- OwnerPawn:GetCharacterMovementComponent().MaxMultiJumpCount = self.AddJumpMaxCount + 1 + end +end + +function BuffAction_JumpStrengthen:LuaUndoAction() + BuffActionBase.LuaUndoAction(self) +end + +function BuffAction_JumpStrengthen:LuaUpdateAction(DeltaSeconds) + BuffActionBase.LuaUpdateAction(self, DeltaSeconds) + + local OwnerPawn = self:GetOwnerPawn() + if UE.IsValid(OwnerPawn) then + if OwnerPawn:GetJumpCount() >= self.AddJumpMaxCount + 1 then + OwnerPawn.JumpMaxCount = 1 + else + OwnerPawn.JumpMaxCount = self.AddJumpMaxCount + 1 + end + UGCLogSystem.Log("[BuffAction_JumpStrengthen_LuaUpdateAction] JumpMaxCount:%s", tostring(OwnerPawn.JumpMaxCount)) + end +end + +return BuffAction_JumpStrengthen; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_MarkPlayer.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_MarkPlayer.lua new file mode 100644 index 00000000..ba14df37 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_MarkPlayer.lua @@ -0,0 +1,111 @@ +-- Script.Global.BuffSystem.BuffAction.BuffAction_MarkPlayer +local BuffActionBase = require('Script.Global.BuffSystem.BuffActionBase') + + + +local BuffAction_MarkPlayer = setmetatable( + { + ---@param MarkWidgetPath string @控件ClassPath 控件需继承自UObjectPositionWidget + ---@param Offset FVector @偏移量 + ---@param SizeAutoContent bool @大小适配 + ---@param OutViewHide bool @控件离开镜头后是否隐藏(比如在背后) + ---@param BeOcclusionHide bool @被遮挡后是否隐藏 + MarkWidgetPath = ""; + Offset = {X = 0, Y = 0, Z = 80}; + SizeAutoContent = true; + OutViewHide = true; + BeOcclusionHide = false; + AllPlayerVis = true; -- 全部可见 + TeamVis = false, -- 仅队友可见 + + + RemoveDoOnce = false; + }, + { __index = BuffActionBase, __metatable = BuffActionBase } +); + +--[[ +-- 常用接口 +self:GetInstID() -- 获取BuffID +self:GetOwnerPawn() -- 获取拥有者 +BuffSystemAPI.GetBuffCauser(self:GetInstID()) -- 获取Buff给予者 + +self:EnableTick() -- 开启Tick +self:StopTick() -- 会自动关 +self:IsEnableTick() -- 是否已开启Tick +]] + +function BuffAction_MarkPlayer:LuaDoAction() + BuffActionBase.LuaDoAction(self) + -- 启用Tick UndoAction会自动关 + -- self:EnableTick() + if not UGCGameSystem.IsServer() then + local CanCreate = false + self.OwnerPlayerKey = self:GetOwnerPawn().PlayerKey + if self.AllPlayerVis then + CanCreate = true + elseif self.TeamVis then + local LocalPlayerTeamID = UGCGameSystem.GameState:GetPlayerTeamIDByPlayerKey(UGCSystemLibrary.GetLocalPlayerKey()) + local TargetPlayerTeamID = UGCGameSystem.GameState:GetPlayerTeamIDByPlayerKey(self.OwnerPlayerKey) + if LocalPlayerTeamID ~= TargetPlayerTeamID then + CanCreate = true + end + end + + if CanCreate then + ---@return InstanceIndex int @实例Index + ---@param Actor Actor @需要添加位置UI的Actor对象 + ---@param WidgetClassPath string @控件ClassPath 控件需继承自UObjectPositionWidget + ---@param Offset FVector @偏移量 + ---@param SizeAutoContent bool @大小适配 + ---@param OutViewHide bool @控件离开镜头后是否隐藏(比如在背后) + ---@param BeOcclusionHide bool @被遮挡后是否隐藏 + self.InstanceIndex = UGCWidgetManagerSystem.AddObjectPositionUI(self:GetOwnerPawn(), self.MarkWidgetPath, self.Offset, true, false, false) + --local WidgetClass = UE.LoadClass(self.MarkWidgetPath) + --self.TraceWidget = UserWidget.NewWidgetObjectBP(UGCSystemLibrary.GetLocalPlayerController(), WidgetClass) + --self.TraceWidget:AddToViewport(10000) + --self.TraceWidget:SetTracePlayerKey(self.OwnerPlayerKey) + self.RemoveDoOnce = false + UGCEventSystem.AddListener(EventEnum.PlayerDeathInfo, self.PlayerDeathInfo, self) + end + + end +end + + + +function BuffAction_MarkPlayer:LuaUndoAction() + BuffActionBase.LuaUndoAction(self) + if not UGCGameSystem.IsServer() then + self:RemoveObjectPositionUI() + end +end + +function BuffAction_MarkPlayer:LuaResetAction() + BuffActionBase.LuaResetAction(self) +end + +function BuffAction_MarkPlayer:LuaUpdateAction(DeltaSeconds) + BuffActionBase.LuaUpdateAction(self, DeltaSeconds) +end + +function BuffAction_MarkPlayer:RemoveObjectPositionUI() + if not UGCGameSystem.IsServer() and not self.RemoveDoOnce then + self.RemoveDoOnce = true + UGCEventSystem.RemoveListener(EventEnum.PlayerDeathInfo, self.PlayerDeathInfo, self) + UGCWidgetManagerSystem.RemoveObjectPositionUI(UGCGameSystem.GameState, self.InstanceIndex) + --if UE.IsValid(self.TraceWidget) then + -- self.TraceWidget:SetPlayerKey(-1) + -- self.TraceWidget:RemoveFromParent() + --end + end +end + +function BuffAction_MarkPlayer:PlayerDeathInfo(VictimKey, CauserKey, WeaponID, DamageType, IsHeadShotDamage, Distance, DamageValue, Assister) + if self.OwnerPlayerKey == VictimKey then + self:RemoveObjectPositionUI() + end +end + + +return BuffAction_MarkPlayer; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_MoveSpeedStrengthen.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_MoveSpeedStrengthen.lua new file mode 100644 index 00000000..4f5e0dd7 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_MoveSpeedStrengthen.lua @@ -0,0 +1,47 @@ +local BuffActionBase = require('Script.Global.BuffSystem.BuffActionBase') + +local BuffAction_MoveSpeedStrengthen = setmetatable( + { + SpeedScale = 1. + }, + { __index = BuffActionBase, __metatable = BuffActionBase } +); + +function BuffAction_MoveSpeedStrengthen:LuaDoAction() + BuffActionBase.LuaDoAction(self) + if not UGCGameSystem.IsServer() then return true end + UGCLogSystem.Log("[BuffAction_MoveSpeedStrengthen_LuaDoAction]") + local OwnerPawn = self:GetOwnerPawn() + if UE.IsValid(OwnerPawn) then + self:SetSpeedScale(OwnerPawn, self:GetSpeedScale(OwnerPawn) * self.SpeedScale) + end + return true +end + +function BuffAction_MoveSpeedStrengthen:LuaUndoAction() + BuffActionBase.LuaUndoAction(self) + + if not UGCGameSystem.IsServer() then return true end + UGCLogSystem.Log("[BuffAction_MoveSpeedStrengthen_LuaUndoAction]") + local OwnerPawn = self:GetOwnerPawn() + if UE.IsValid(OwnerPawn) then + self:SetSpeedScale(OwnerPawn, self:GetSpeedScale(OwnerPawn) / self.SpeedScale) + else + UGCLogSystem.Log("[BuffAction_MoveSpeedStrengthen_LuaUndoAction] PlayerDeath or Player is nil") + end +end + +function BuffAction_MoveSpeedStrengthen:SetSpeedScale(OwnerPawn, SpeedScale) + -- UGCPawnAttrSystem.SetSpeedScale(OwnerPawn, UGCPawnAttrSystem.GetSpeedScale(OwnerPawn) * self.SpeedScale) + -- OwnerPawn:SetMoveSpeedModifier(self:GetSpeedScale(OwnerPawn) * self.SpeedScale) + --OwnerPawn:SetSpeedScaleUGC(self:GetSpeedScale(OwnerPawn) * self.SpeedScale) + OwnerPawn:SetEnergySpeedScaleUGC(SpeedScale) -- 走路速度 + UGCPawnAttrSystem.SetSprintSpeedScale(OwnerPawn, SpeedScale) -- 冲刺速度 +end + +function BuffAction_MoveSpeedStrengthen:GetSpeedScale(OwnerPawn) + --return OwnerPawn:GetMoveSpeedModifier() + return OwnerPawn:GetEnergySpeedScaleUGC() +end + +return BuffAction_MoveSpeedStrengthen; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_RateOfFire.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_RateOfFire.lua new file mode 100644 index 00000000..615f7b61 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_RateOfFire.lua @@ -0,0 +1,82 @@ +-- Script.Global.BuffSystem.BuffAction.BuffAction_RateOfFire +local BuffActionBase = require('Script.Global.BuffSystem.BuffActionBase') + +local BuffAction_RateOfFire = setmetatable( + { + -- 射速缩放 + RateOfFireScale = 1.; + + -- + TempWeapon = {}; + NowWeapon = nil + }, + { __index = BuffActionBase, __metatable = BuffActionBase } +); + +function BuffAction_RateOfFire:LuaDoAction() + BuffActionBase.LuaDoAction(self) + + if not UGCGameSystem.IsServer() then return true end + UGCLogSystem.Log("[BuffAction_RateOfFire_LuaDoAction]") + self:AddRateOfFire() + self.AddRateOfFireHandle = UGCEventSystem.SetTimerLoop(UGCGameSystem.GameState, function() self:AddRateOfFire() end, 2) + + +end + +function BuffAction_RateOfFire:LuaUndoAction() + BuffActionBase.LuaUndoAction(self) + if not UGCGameSystem.IsServer() then return true end + if self.AddRateOfFireHandle then + UGCEventSystem.StopTimer(self.AddRateOfFireHandle) + end + self:RemoveRateOfFire() +end + + +function BuffAction_RateOfFire:AddRateOfFire() + -- UGCLogSystem.Log("[BuffAction_RateOfFire_AddRateOfFire]") + local OwnerPawn = self:GetOwnerPawn() + if UE.IsValid(OwnerPawn) then + for i, v in pairs(ShootWeaponEnums) do + local WeaponGun = UGCWeaponManagerSystem.GetWeaponBySlot(OwnerPawn, v) + --if UE.IsValid(WeaponGun) and not table.hasValue(self.TempWeapon, WeaponGun) then + -- UGCGunSystem.SetShootIntervalTime(WeaponGun, UGCGunSystem.GetShootIntervalTime(WeaponGun) / self.RateOfFireScale) + -- self.TempWeapon[#self.TempWeapon + 1] = WeaponGun + --end + if UE.IsValid(WeaponGun) then + local WeaponID = WeaponGun:GetWeaponItemID() + if WeaponID and WeaponTable.WeaponRateOfFire[WeaponID] then + UGCGunSystem.SetShootIntervalTime(WeaponGun, WeaponTable.WeaponRateOfFire[WeaponID] / self.RateOfFireScale) + --UGCLogSystem.Log("[BuffAction_RateOfFire_AddRateOfFire] Succeed WeaponID:%s", tostring(WeaponID)) + end + end + end + end +end + +function BuffAction_RateOfFire:RemoveRateOfFire() + local OwnerPawn = self:GetOwnerPawn() + if UE.IsValid(OwnerPawn) then + --for i, WeaponGun in pairs(self.TempWeapon) do + -- if UE.IsValid(WeaponGun) then + -- UGCGunSystem.SetShootIntervalTime(WeaponGun, UGCGunSystem.GetShootIntervalTime(WeaponGun) * self.RateOfFireScale) + -- end + --end + for i, v in pairs(ShootWeaponEnums) do + local WeaponGun = UGCWeaponManagerSystem.GetWeaponBySlot(OwnerPawn, v) + if UE.IsValid(WeaponGun) then + local WeaponID = WeaponGun:GetWeaponItemID() + if WeaponID and WeaponTable.WeaponRateOfFire[WeaponID] then + UGCGunSystem.SetShootIntervalTime(WeaponGun, WeaponTable.WeaponRateOfFire[WeaponID]) + UGCLogSystem.Log("[BuffAction_RateOfFire_RemoveRateOfFire] Finish") + end + end + end + end + self.TempWeapon = {} +end + + + +return BuffAction_RateOfFire; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_RespiratoryRecovery.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_RespiratoryRecovery.lua new file mode 100644 index 00000000..67cca0d4 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_RespiratoryRecovery.lua @@ -0,0 +1,66 @@ +local BuffActionBase = require('Script.Global.BuffSystem.BuffActionBase') + +local BuffAction_RespiratoryRecovery = setmetatable( + { + -- Param --------------------------- + -- 每秒恢复量 + ReplyPerSecond = 10.; + -- 受击延迟恢复 + WaitAddHealthTime = 3.; + -- Param End ----------------------- + + + -- 恢复频率 + AddHealthFrequency = 10; + UpdateAddTime = 0; + }, + { __index = BuffActionBase, __metatable = BuffActionBase } +); + +function BuffAction_RespiratoryRecovery:LuaDoAction() + BuffActionBase.LuaDoAction(self) + if not UGCGameSystem.IsServer() then return true end + UGCLogSystem.Log("[BuffAction_RespiratoryRecovery_LuaDoAction]Params:%s, %s", self.ReplyPerSecond, self.WaitAddHealthTime) + + -- 绑定Event传入的self可能有点问题,需要与存储OwnerPawn才能获取到正确的OwnerPawn + UGCEventSystem.AddListener(EventEnum.PlayerInjuryInfo, self.PlayerInjuryInfo, self) + -- 启用Tick + self:EnableTick() +end + +function BuffAction_RespiratoryRecovery:LuaUndoAction() + BuffActionBase.LuaUndoAction(self) + if not UGCGameSystem.IsServer() then return true end + UGCLogSystem.Log("[BuffAction_RespiratoryRecovery_LuaUndoAction]") + UGCEventSystem.RemoveListener(EventEnum.PlayerInjuryInfo, self.PlayerInjuryInfo, self) +end + +function BuffAction_RespiratoryRecovery:LuaUpdateAction(DeltaSeconds) + BuffActionBase.LuaUpdateAction(self, DeltaSeconds) + if not UGCGameSystem.IsServer() then return true end + self.UpdateAddTime = self.UpdateAddTime + DeltaSeconds + if self.UpdateAddTime >= (1. / self.AddHealthFrequency) then + self.UpdateAddTime = self.UpdateAddTime - 1. / self.AddHealthFrequency + self:AddPlayerHealth() + end + return true +end + +function BuffAction_RespiratoryRecovery:PlayerInjuryInfo(VictimKey) + if UE.IsValid(self:GetOwnerPawn()) and self:GetOwnerPawn():IsAlive() then + if VictimKey == self:GetOwnerPawn().PlayerKey then + self.PlayerVictimTime = UGCSystemLibrary.GetGameTime() + UGCLogSystem.Log("[BuffAction_RespiratoryRecovery_PlayerInjuryInfo] Succeed") + end + end +end + +function BuffAction_RespiratoryRecovery:AddPlayerHealth() + local NowTime = UGCSystemLibrary.GetGameTime() + if UE.IsValid(self:GetOwnerPawn()) and self:GetOwnerPawn():IsAlive() + and (self.PlayerVictimTime == nil or (NowTime - self.PlayerVictimTime >= self.WaitAddHealthTime)) then + UGCPawnAttrSystem.SetHealth(self:GetOwnerPawn(), UGCPawnAttrSystem.GetHealth(self:GetOwnerPawn()) + self.ReplyPerSecond / self.AddHealthFrequency) + end +end + +return BuffAction_RespiratoryRecovery; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_Sensing.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_Sensing.lua new file mode 100644 index 00000000..c2f0932c --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_Sensing.lua @@ -0,0 +1,46 @@ +-- Script.Global.BuffSystem.BuffAction.BuffAction_Sensing +local BuffActionBase = require('Script.Global.BuffSystem.BuffActionBase') + +local BuffAction_Sensing = setmetatable( + { + -- 检测距离 m + Range = 80.; + + NowWeapon = nil + }, + { __index = BuffActionBase, __metatable = BuffActionBase } +); + +function BuffAction_Sensing:LuaDoAction() + BuffActionBase.LuaDoAction(self) + + UGCLogSystem.Log("[BuffAction_Sensing_LuaDoAction]") + + if UGCGameSystem.IsServer() then + local OwnerPawn = self:GetOwnerPawn() + if OwnerPawn and OwnerPawn.PlayerKey then + UGCSendRPCSystem.ClientShowUI(OwnerPawn.PlayerKey, WidgetConfig.EUIType.TraceEnemy, true, false, self.Range) + end + else + if self:GetOwnerPawn() == UGCSystemLibrary.GetLocalPlayerPawn() then + WidgetManager.ShowPanel(WidgetConfig.EUIType.TraceEnemy, false, self.Range) + end + end + +end + +function BuffAction_Sensing:LuaUndoAction() + BuffActionBase.LuaUndoAction(self) + if UGCGameSystem.IsServer() then return true end + UGCLogSystem.Log("[BuffAction_Sensing_LuaUndoAction]") +end + + + +function BuffAction_Sensing:UpdateGunRateOfFire(WeaponGun) + +end + + + +return BuffAction_Sensing; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_ShowParticle.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_ShowParticle.lua new file mode 100644 index 00000000..a5882e6d --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_ShowParticle.lua @@ -0,0 +1,34 @@ +local BuffActionBase = require('Script.Global.BuffSystem.BuffActionBase') + +local BuffAction_ShowParticle = setmetatable( + { + -- Param --------------------------- + ParticleType = nil; + -- Param End ----------------------- + + + + }, + { __index = BuffActionBase, __metatable = BuffActionBase } +); + +function BuffAction_ShowParticle:LuaDoAction() + BuffActionBase.LuaDoAction(self) + if UGCGameSystem.IsServer() then return true end + UGCLogSystem.Log("[BuffAction_ShowParticle_LuaDoAction]Params:%s, %s", self.ReplyPerSecond, self.WaitAddHealthTime) + if self.ParticleType then + self.Particle = ParticleConfig.AddParticleAttachPlayer(self:GetOwnerPawn(), self.ParticleType) + end +end + +function BuffAction_ShowParticle:LuaUndoAction() + BuffActionBase.LuaUndoAction(self) + if UGCGameSystem.IsServer() then return true end + ParticleConfig.DestroyParticle(self.Particle) +end + + + + + +return BuffAction_ShowParticle; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_Vampirism.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_Vampirism.lua new file mode 100644 index 00000000..b51ec04f --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAction/BuffAction_Vampirism.lua @@ -0,0 +1,52 @@ +local BuffActionBase = require('Script.Global.BuffSystem.BuffActionBase') + +local BuffAction_Vampirism = setmetatable( + { + -- Param --------------------------- + -- 每秒恢复量 + Vampirism = 0.2; + IsHPLimit = false; + -- Param End ----------------------- + + + + }, + { __index = BuffActionBase, __metatable = BuffActionBase } +); + +function BuffAction_Vampirism:LuaDoAction() + BuffActionBase.LuaDoAction(self) + if not UGCGameSystem.IsServer() then return true end + UGCLogSystem.Log("[BuffAction_Vampirism_LuaDoAction]Params:%s, %s", self.ReplyPerSecond, self.WaitAddHealthTime) + + -- 绑定Event传入的self可能有点问题,需要与存储OwnerPawn才能获取到正确的OwnerPawn + UGCEventSystem.AddListener(EventEnum.PlayerInjuryInfo, self.PlayerInjuryInfo, self) +end + +function BuffAction_Vampirism:LuaUndoAction() + BuffActionBase.LuaUndoAction(self) + if not UGCGameSystem.IsServer() then return true end + UGCLogSystem.Log("[BuffAction_Vampirism_LuaUndoAction]") + UGCEventSystem.RemoveListener(EventEnum.PlayerInjuryInfo, self.PlayerInjuryInfo, self) +end + + +function BuffAction_Vampirism:PlayerInjuryInfo(VictimKey, CauserKey, WeaponID, DamageType, IsHeadShotDamage, Distance, DamageValue) + if UE.IsValid(self:GetOwnerPawn()) and self:GetOwnerPawn():IsAlive() then + if CauserKey == self:GetOwnerPawn().PlayerKey then + local AddHealth = DamageValue * self.Vampirism + if self.IsHPLimit then + local Health = UGCPawnAttrSystem.GetHealth(self:GetOwnerPawn()) + UGCPawnAttrSystem.SetHealthMax(self:GetOwnerPawn(), UGCPawnAttrSystem.GetHealthMax(self:GetOwnerPawn()) + AddHealth) + UGCPawnAttrSystem.SetHealth(self:GetOwnerPawn(), Health + AddHealth) + else + UGCPawnAttrSystem.SetHealth(self:GetOwnerPawn(), UGCPawnAttrSystem.GetHealth(self:GetOwnerPawn()) + AddHealth) + end + UGCLogSystem.Log("[BuffAction_Vampirism_PlayerInjuryInfo] Succeed") + end + end +end + + + +return BuffAction_Vampirism; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffActionBase.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffActionBase.lua new file mode 100644 index 00000000..72ae0979 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffActionBase.lua @@ -0,0 +1,81 @@ +local BuffActionBase = { + -- 实例的ID + InstID = -1; + -- 拥有者 + OwnerPawn = nil; + -- Controller* @施加Buff的玩家或AI。 + BuffCauser = nil; + -- Actor* @施加Buff的Actor,比如说PlayerPawn、燃烧瓶Actor等等 + CauserActor = nil; + -- 启用Tick函数 + bIsEnableTick = false; + +} + +-- 常用接口 -------------------------------------------------------------- + +--[[ +self:GetInstID() +self:GetOwnerPawn() +BuffSystemAPI.GetBuffCauser(self:GetInstID()) + +self:EnableTick() +self:StopTick() -- 会自动关 +self:IsEnableTick() +]] + +function BuffActionBase:GetInstID() + return self.InstID +end + +function BuffActionBase:GetOwnerPawn() + return self.OwnerPawn +end + +function BuffActionBase:EnableTick() + self.bIsEnableTick = true +end + +function BuffActionBase:StopTick() + self.bIsEnableTick = false +end + +function BuffActionBase:IsEnableTick() + return self.bIsEnableTick +end + +-- 常用接口 End ---------------------------------------------------------- + +--- 初始化函数 +---@param InstID int 实例的ID +---@param OwnerPawn APawn* +---@param BuffCauser AController* 玩家控制器或者AI +---@param CauserActor Actor* @施加Buff的Actor,比如说PlayerPawn、燃烧瓶Actor等等 +---@param ParamList table 传入Action的参数{ParamName = Val} +function BuffActionBase:InitBuffAction(InstID, OwnerPawn, ParamList) + self.InstID, self.OwnerPawn = InstID, OwnerPawn + -- 初始化传入的参数 + for i, v in pairs(ParamList) do + self[i] = v + end +end + +--- 激活函数 +function BuffActionBase:LuaDoAction() +end + +--- 移除函数 +function BuffActionBase:LuaUndoAction() + self:StopTick() +end + +--- 刷新时间函数,只有刷新时间的Buff重复获得才会触发才能 +function BuffActionBase:LuaResetAction() +end + +--- Tick +function BuffActionBase:LuaUpdateAction(DeltaSeconds) + if self.bIsEnableTick == false then return end +end + +return BuffActionBase \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/AddMaxHealthLv1.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/AddMaxHealthLv1.lua new file mode 100644 index 00000000..1aab3c5c --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/AddMaxHealthLv1.lua @@ -0,0 +1,22 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 5.; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 10; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.AddMaxHealth; + Params = { + AddVal = 50 + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/AddMaxHealthLv2.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/AddMaxHealthLv2.lua new file mode 100644 index 00000000..0989f44e --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/AddMaxHealthLv2.lua @@ -0,0 +1,22 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 5.; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 10; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.AddMaxHealth; + Params = { + AddVal = 80 + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/AddMaxHealthLv3.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/AddMaxHealthLv3.lua new file mode 100644 index 00000000..a2f04fcf --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/AddMaxHealthLv3.lua @@ -0,0 +1,22 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 5.; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 10; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.AddMaxHealth; + Params = { + AddVal = 70 + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/BulletExplosionLv1.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/BulletExplosionLv1.lua new file mode 100644 index 00000000..75525579 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/BulletExplosionLv1.lua @@ -0,0 +1,44 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 5.; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 10; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.BulletHitApplyRadialDamage; + Params = { + -- 仅枪械武器触发 + IsShootWeapon = true; + -- 筛选武器,若不为空则内部对应的武器攻击才会触发,若为空则全部武器均会触发 + FilterWeaponItemID = {}; + + -- Damage -- + MaxDamage = 20; + MinDamage = 15; + + -- 内部范围,既最高伤害的范围 + InnerRadius = 60; + -- 外部范围,既伤害范围,到该范围边界则为最低伤害 + OuterRadius = 200; + -- Inner到Outer范围区间的伤害衰减指数 + FallOff = 1; + -- Damage -- + + -- 冷却时间 + CoolingTime = 1.5; + -- 粒子类型 + ParticleType = ParticleConfig.EParticleType.Explosion; + -- 音效类型 + SoundType = SoundSystem.ESound.Explosion; + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/BulletExplosionLv2.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/BulletExplosionLv2.lua new file mode 100644 index 00000000..c313c9f4 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/BulletExplosionLv2.lua @@ -0,0 +1,44 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 5.; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 10; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.BulletHitApplyRadialDamage; + Params = { + -- 仅枪械武器触发 + IsShootWeapon = true; + -- 筛选武器,若不为空则内部对应的武器攻击才会触发,若为空则全部武器均会触发 + FilterWeaponItemID = {}; + + -- Damage -- + MaxDamage = 30; + MinDamage = 18; + + -- 内部范围,既最高伤害的范围 + InnerRadius = 100; + -- 外部范围,既伤害范围,到该范围边界则为最低伤害 + OuterRadius = 300; + -- Inner到Outer范围区间的伤害衰减指数 + FallOff = 1; + -- Damage -- + + -- 冷却时间 + CoolingTime = 1.; + -- 粒子类型 + ParticleType = ParticleConfig.EParticleType.Explosion; + -- 音效类型 + SoundType = SoundSystem.ESound.Explosion; + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/BulletExplosionLv3.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/BulletExplosionLv3.lua new file mode 100644 index 00000000..f651f66e --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/BulletExplosionLv3.lua @@ -0,0 +1,44 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 5.; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 10; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.BulletHitApplyRadialDamage; + Params = { + -- 仅枪械武器触发 + IsShootWeapon = true; + -- 筛选武器,若不为空则内部对应的武器攻击才会触发,若为空则全部武器均会触发 + FilterWeaponItemID = {}; + + -- Damage -- + MaxDamage = 30; + MinDamage = 10; + + -- 内部范围,既最高伤害的范围 + InnerRadius = 100; + -- 外部范围,既伤害范围,到该范围边界则为最低伤害 + OuterRadius = 300; + -- Inner到Outer范围区间的伤害衰减指数 + FallOff = 1; + -- Damage -- + + -- 冷却时间 + CoolingTime = 1; + -- 粒子类型 + ParticleType = ParticleConfig.EParticleType.Explosion; + -- 音效类型 + SoundType = SoundSystem.ESound.Explosion; + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/BulletIceLv1.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/BulletIceLv1.lua new file mode 100644 index 00000000..a972d47f --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/BulletIceLv1.lua @@ -0,0 +1,22 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 5.; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 10; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.DamageAddBuff; + Params = { + BuffAssetType = BuffAssetConfig.EBuffAssetType.IceLv1 + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/BulletIceLv2.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/BulletIceLv2.lua new file mode 100644 index 00000000..0c1d3146 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/BulletIceLv2.lua @@ -0,0 +1,22 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 5.; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 10; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.DamageAddBuff; + Params = { + BuffAssetType = BuffAssetConfig.EBuffAssetType.IceLv2 + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/BulletIceLv3.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/BulletIceLv3.lua new file mode 100644 index 00000000..833548b7 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/BulletIceLv3.lua @@ -0,0 +1,22 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 5.; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 10; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.DamageAddBuff; + Params = { + BuffAssetType = BuffAssetConfig.EBuffAssetType.IceLv3 + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/CounterattackLv1.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/CounterattackLv1.lua new file mode 100644 index 00000000..4d7a2634 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/CounterattackLv1.lua @@ -0,0 +1,27 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 1; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 4; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.Counterattack; + Params = { + -- 每层增加伤害的缩放 + LayerAddDamageScale = 0.15; + -- 每多少血量百分比增加一层 + LayerHPInterval = 0.1; + -- 基础层级 + BaseLayer = 0; + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/CounterattackLv2.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/CounterattackLv2.lua new file mode 100644 index 00000000..485e0b8a --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/CounterattackLv2.lua @@ -0,0 +1,27 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 1; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 4; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.Counterattack; + Params = { + -- 每层增加伤害的缩放 + LayerAddDamageScale = 0.22; + -- 每多少血量百分比增加一层 + LayerHPInterval = 0.1; + -- 基础层级 + BaseLayer = 1; + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/GodOfWar.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/GodOfWar.lua new file mode 100644 index 00000000..44a53ac5 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/GodOfWar.lua @@ -0,0 +1,38 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 5.; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 10; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.InfiniteBullets; + Params = {} + }, + { + ActionType = BuffActionConfig.EActionType.AddMaxHealth; + Params = { + AddVal = 50; + } + }, + { + ActionType = BuffActionConfig.EActionType.MarkPlayer; + Params = { + MarkWidgetPath = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/StatusUI/MarkPlayerUI/WB_MarkGodOfWar.WB_MarkGodOfWar_C'); + Offset = {X = 0, Y = 0, Z = 100}; + SizeAutoContent = true; + OutViewHide = true; + BeOcclusionHide = true; + AllPlayerVis = false; -- 全部可见 + TeamVis = true; -- 仅队友可见 + } + }, + }; +} \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/IceLv1.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/IceLv1.lua new file mode 100644 index 00000000..f2d515bc --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/IceLv1.lua @@ -0,0 +1,28 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = false; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 1; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 4; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.MoveSpeedStrengthen; + Params = { + SpeedScale = 0.5 + } + }, + { + ActionType = BuffActionConfig.EActionType.ShowParticle; + Params = { + ParticleType = ParticleConfig.EParticleType.Ice + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/IceLv2.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/IceLv2.lua new file mode 100644 index 00000000..48718a39 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/IceLv2.lua @@ -0,0 +1,28 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = false; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 1; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 6; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.MoveSpeedStrengthen; + Params = { + SpeedScale = 0.5 + } + }, + { + ActionType = BuffActionConfig.EActionType.ShowParticle; + Params = { + ParticleType = ParticleConfig.EParticleType.Ice + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/IceLv3.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/IceLv3.lua new file mode 100644 index 00000000..c5a0456e --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/IceLv3.lua @@ -0,0 +1,28 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = false; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 1; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 6; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.MoveSpeedStrengthen; + Params = { + SpeedScale = 0.3 + } + }, + { + ActionType = BuffActionConfig.EActionType.ShowParticle; + Params = { + ParticleType = ParticleConfig.EParticleType.Ice + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/IncreasedDamageLv1.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/IncreasedDamageLv1.lua new file mode 100644 index 00000000..c3c63d7b --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/IncreasedDamageLv1.lua @@ -0,0 +1,22 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 5.; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 10; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.DamageScale; + Params = { + DamageScale = 1.4 + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/IncreasedDamageLv2.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/IncreasedDamageLv2.lua new file mode 100644 index 00000000..62cc90b5 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/IncreasedDamageLv2.lua @@ -0,0 +1,22 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 5.; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 10; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.DamageScale; + Params = { + DamageScale = 1.7 + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/IncreasedDamageLv3.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/IncreasedDamageLv3.lua new file mode 100644 index 00000000..c40296dc --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/IncreasedDamageLv3.lua @@ -0,0 +1,22 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 5.; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 10; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.DamageScale; + Params = { + DamageScale = 1.8 + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/IncreasedDefenseLv1.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/IncreasedDefenseLv1.lua new file mode 100644 index 00000000..a405f473 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/IncreasedDefenseLv1.lua @@ -0,0 +1,22 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 5.; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 10; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.DefenseScale; + Params = { + DefenseScale = 1.4 + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/IncreasedDefenseLv2.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/IncreasedDefenseLv2.lua new file mode 100644 index 00000000..e29098ad --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/IncreasedDefenseLv2.lua @@ -0,0 +1,22 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 5.; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 10; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.DefenseScale; + Params = { + DefenseScale = 1.7 + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/IncreasedDefenseLv3.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/IncreasedDefenseLv3.lua new file mode 100644 index 00000000..c4debf6b --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/IncreasedDefenseLv3.lua @@ -0,0 +1,22 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 5.; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 10; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.DefenseScale; + Params = { + DefenseScale = 2 + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/JumpScaleLv1.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/JumpScaleLv1.lua new file mode 100644 index 00000000..e8779e42 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/JumpScaleLv1.lua @@ -0,0 +1,23 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 5.; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 10; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.JumpScale; + Params = { + JumpScale = 2; + GravityScale = 1; + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/JumpScaleLv2.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/JumpScaleLv2.lua new file mode 100644 index 00000000..589d5c1c --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/JumpScaleLv2.lua @@ -0,0 +1,23 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 5.; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 10; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.JumpScale; + Params = { + JumpScale = 2.8; + GravityScale = 1.; + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/JumpScaleLv3.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/JumpScaleLv3.lua new file mode 100644 index 00000000..cd616244 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/JumpScaleLv3.lua @@ -0,0 +1,23 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 5.; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 10; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.JumpScale; + Params = { + JumpScale = 3.2; + GravityScale = 1.5; + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/JumpStrengthenLv1.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/JumpStrengthenLv1.lua new file mode 100644 index 00000000..8ee81776 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/JumpStrengthenLv1.lua @@ -0,0 +1,22 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 5.; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 10; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.JumpStrengthen; + Params = { + AddJumpMaxCount = 1 + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/JumpStrengthenLv2.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/JumpStrengthenLv2.lua new file mode 100644 index 00000000..8af28df7 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/JumpStrengthenLv2.lua @@ -0,0 +1,22 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 5.; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 10; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.JumpStrengthen; + Params = { + AddJumpMaxCount = 2 + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/JumpStrengthenLv3.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/JumpStrengthenLv3.lua new file mode 100644 index 00000000..1ba4de39 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/JumpStrengthenLv3.lua @@ -0,0 +1,22 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 5.; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 10; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.JumpStrengthen; + Params = { + AddJumpMaxCount = 3 + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/MarkLv1.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/MarkLv1.lua new file mode 100644 index 00000000..6c8cffd2 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/MarkLv1.lua @@ -0,0 +1,22 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 5.; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 10; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.DamageAddBuff; + Params = { + BuffAssetType = BuffAssetConfig.EBuffAssetType.MarkedLv1 + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/MarkLv2.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/MarkLv2.lua new file mode 100644 index 00000000..6ea35d03 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/MarkLv2.lua @@ -0,0 +1,22 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 5.; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 10; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.DamageAddBuff; + Params = { + BuffAssetType = BuffAssetConfig.EBuffAssetType.MarkedLv2 + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/MarkLv3.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/MarkLv3.lua new file mode 100644 index 00000000..51839005 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/MarkLv3.lua @@ -0,0 +1,22 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 5.; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 10; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.DamageAddBuff; + Params = { + BuffAssetType = BuffAssetConfig.EBuffAssetType.MarkedLv3 + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/MarkedLv1.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/MarkedLv1.lua new file mode 100644 index 00000000..6a302cdf --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/MarkedLv1.lua @@ -0,0 +1,28 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = false; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 15; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 15; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.MarkPlayer; + Params = { + MarkWidgetPath = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/StatusUI/MarkPlayerUI/WB_MarkEnemy.WB_MarkEnemy_C'); + Offset = {X = 0, Y = 0, Z = 110}; + SizeAutoContent = true; + OutViewHide = true; + BeOcclusionHide = true; + AllPlayerVis = false; -- 全部可见 + TeamVis = true; -- 仅队友可见 + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/MarkedLv2.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/MarkedLv2.lua new file mode 100644 index 00000000..94a92676 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/MarkedLv2.lua @@ -0,0 +1,28 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = false; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 24; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 24; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.MarkPlayer; + Params = { + MarkWidgetPath = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/StatusUI/MarkPlayerUI/WB_MarkEnemy.WB_MarkEnemy_C'); + Offset = {X = 0, Y = 0, Z = 110}; + SizeAutoContent = true; + OutViewHide = true; + BeOcclusionHide = true; + AllPlayerVis = false; -- 全部可见 + TeamVis = true; -- 仅队友可见 + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/MarkedLv3.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/MarkedLv3.lua new file mode 100644 index 00000000..5beb0527 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/MarkedLv3.lua @@ -0,0 +1,28 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = false; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 8; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 8; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.MarkPlayer; + Params = { + MarkWidgetPath = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/StatusUI/MarkPlayerUI/WB_MarkEnemy.WB_MarkEnemy_C'); + Offset = {X = 0, Y = 0, Z = 110}; + SizeAutoContent = true; + OutViewHide = true; + BeOcclusionHide = true; + AllPlayerVis = false; -- 全部可见 + TeamVis = true; -- 仅队友可见 + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/MoveSpeedStrengthenLv1.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/MoveSpeedStrengthenLv1.lua new file mode 100644 index 00000000..f793efb6 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/MoveSpeedStrengthenLv1.lua @@ -0,0 +1,22 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 5.; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 10; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.MoveSpeedStrengthen; + Params = { + SpeedScale = 1.45 + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/MoveSpeedStrengthenLv2.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/MoveSpeedStrengthenLv2.lua new file mode 100644 index 00000000..8cc63278 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/MoveSpeedStrengthenLv2.lua @@ -0,0 +1,22 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 5.; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 10; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.MoveSpeedStrengthen; + Params = { + SpeedScale = 1.75 + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/MoveSpeedStrengthenLv3.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/MoveSpeedStrengthenLv3.lua new file mode 100644 index 00000000..e5b6e033 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/MoveSpeedStrengthenLv3.lua @@ -0,0 +1,22 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 5.; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 10; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.MoveSpeedStrengthen; + Params = { + SpeedScale = 2. + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/RateOfFireLv1.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/RateOfFireLv1.lua new file mode 100644 index 00000000..2e5fc9f2 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/RateOfFireLv1.lua @@ -0,0 +1,22 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 5.; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 10; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.RateOfFire; + Params = { + RateOfFireScale = 1.5; + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/RateOfFireLv2.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/RateOfFireLv2.lua new file mode 100644 index 00000000..2a4c1929 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/RateOfFireLv2.lua @@ -0,0 +1,22 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 5.; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 10; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.RateOfFire; + Params = { + RateOfFireScale = 2.; + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/RateOfFireLv3.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/RateOfFireLv3.lua new file mode 100644 index 00000000..afff6cab --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/RateOfFireLv3.lua @@ -0,0 +1,22 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 5.; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 10; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.RateOfFire; + Params = { + RateOfFireScale = 2; + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/RespiratoryRecoveryLv1.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/RespiratoryRecoveryLv1.lua new file mode 100644 index 00000000..a68b7e00 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/RespiratoryRecoveryLv1.lua @@ -0,0 +1,25 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 5.; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 10; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.RespiratoryRecovery; + Params = { + -- 每秒恢复量 + ReplyPerSecond = 6.; + -- 受击延迟恢复 + WaitAddHealthTime = 4.; + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/RespiratoryRecoveryLv2.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/RespiratoryRecoveryLv2.lua new file mode 100644 index 00000000..624422ee --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/RespiratoryRecoveryLv2.lua @@ -0,0 +1,25 @@ +return{ + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 5.; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 10; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.RespiratoryRecovery; + Params = { + -- 每秒恢复量 + ReplyPerSecond = 10.; + -- 受击延迟恢复 + WaitAddHealthTime = 1.; + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/RespiratoryRecoveryLv3.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/RespiratoryRecoveryLv3.lua new file mode 100644 index 00000000..624422ee --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/RespiratoryRecoveryLv3.lua @@ -0,0 +1,25 @@ +return{ + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 5.; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 10; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.RespiratoryRecovery; + Params = { + -- 每秒恢复量 + ReplyPerSecond = 10.; + -- 受击延迟恢复 + WaitAddHealthTime = 1.; + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/SensingLv1.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/SensingLv1.lua new file mode 100644 index 00000000..3bd38c5e --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/SensingLv1.lua @@ -0,0 +1,22 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 5.; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 10; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.Sensing; + Params = { + Range = 80; + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/SensingLv2.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/SensingLv2.lua new file mode 100644 index 00000000..241754de --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/SensingLv2.lua @@ -0,0 +1,22 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 5.; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 10; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.Sensing; + Params = { + Range = 140; + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/TenaciousLv1.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/TenaciousLv1.lua new file mode 100644 index 00000000..2b5a7006 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/TenaciousLv1.lua @@ -0,0 +1,27 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 1; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 4; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.BeFatedNotToDie; + Params = { + -- 命不该绝次数上限 + MaxCount = 1; + -- 触发回血比例 + AddHealthPercentage = 0.3; + -- 触发无敌时间 + InvincibleTime = 0.8; + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/TenaciousLv2.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/TenaciousLv2.lua new file mode 100644 index 00000000..cc4dbc16 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/TenaciousLv2.lua @@ -0,0 +1,27 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 1; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 4; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.BeFatedNotToDie; + Params = { + -- 命不该绝次数上限 + MaxCount = 1; + -- 触发回血比例 + AddHealthPercentage = 0.5; + -- 触发无敌时间 + InvincibleTime = 1.2; + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/TestBuffAsset.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/TestBuffAsset.lua new file mode 100644 index 00000000..6fc13236 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/TestBuffAsset.lua @@ -0,0 +1,27 @@ +--require("Script.Global.BuffSystem.Config.BuffActionConfig") +--require("Script.Global.BuffSystem.Config.BuffAssetConfig") +--print("1111111111111111111111111111111111111111111111111111111111111111111111111") +local BuffAsset = { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = false; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 10.; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 20; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.ContinuousDamage; + Params = { + -- 每秒受到的伤害 + DamagePerSecond = 5; + } + }, + }; +} +return BuffAsset \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/VampirismLv1.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/VampirismLv1.lua new file mode 100644 index 00000000..ee5654f8 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/VampirismLv1.lua @@ -0,0 +1,22 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 5.; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 10; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.Vampirism; + Params = { + Vampirism = 0.7 + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/VampirismLv2.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/VampirismLv2.lua new file mode 100644 index 00000000..375196c9 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/VampirismLv2.lua @@ -0,0 +1,23 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 5.; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 10; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.Vampirism; + Params = { + Vampirism = 0.5; + IsHPLimit = true; + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/VampirismLv3.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/VampirismLv3.lua new file mode 100644 index 00000000..d9074ad6 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffAsset/VampirismLv3.lua @@ -0,0 +1,23 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = true; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 5.; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 10; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.Vampirism; + Params = { + Vampirism = 0.7; + IsHPLimit = true; + } + }, + }; +} diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffManager.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffManager.lua new file mode 100644 index 00000000..c31d32ab --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffManager.lua @@ -0,0 +1,584 @@ +require("Script.Global.BuffSystem.Config.BuffActionConfig") +require("Script.Global.BuffSystem.Config.BuffAssetConfig") + +-- 其中BuffCauser, CauserActor, EndTime不进行同步,仅服务器拥有 +-- BuffInst = {BuffAssetType, OwnerPawn, BuffCauser, CauserActor, EndTime, BuffActions} + +BuffManager = BuffManager or { + -- 可配置参数 ---------------------------------------------------- + -- Tick的帧数 + TickFPS = 24; + -- 可配置参数 End ------------------------------------------------ + + -- 已注册的GameState + RegisteredGameState = nil; + -- 已Require的 BuffAsset + BuffAssetList = {}; + -- 正在使用中的Buff实例 [BuffID] = BuffInst (类型为table,参考上述对BuffInst的描述) + BuffInstList = {}; + -- 玩家拥有的Buff 这里由于用于同步,因此Val里面的信息为列表而非字典 [Pawn] = {[BuffID] = BuffAssetType}, ...} + AllPlayerOwnedBuffs = {}; + -- 客户端上一次同步AllPlayerOwnedBuffs的table [Pawn] = {[BuffID] = BuffAssetType}, ...} + ClientAllPlayerOwnedBuffs = {}; + -- 这个函数用于衔接服务器和客户端的AllPlayerOwnedBuffs同步,因为Pawn作为Key值不能进行OnRep同步 {{Pawn, {[BuffID] = BuffAssetType, ...}}, ...} + OwnedBuffInfo = {}; + -- Buff起始时间和结束时间 [BuffID] = {StartTime, EndTime} 这里是列表而不是字典 + BuffTimeInfo = {}; + -- 那些自动移除的Buff,用于有时间限制的Buff + AutoRemoveBuffList = {}; + -- 已绑定死亡清除函数的玩家 {[Pawn] = 1} + BoundOnEndPlayDelegatePlayers = {}; +} + +--- 这里统一一下获取时间的函数 +function BuffManager.GetGameTime() + if BuffManager.RegisteredGameState then + return KismetSystemLibrary.GetGameTimeInSeconds(BuffManager.RegisteredGameState) + else + return 0. + end +end + + +-- ReplicatedProperties ---------------------------------------------------------------------------------------- + +-- 需要GameState同步的变量 +BuffManager.ReplicatedProperties = { + "OwnedBuffInfo" +} + +-- 需要GameState同步的函数 +BuffManager.RPCFunc = { + "DoBuffActionFunction" +} + +-- 需要在GameState中辅助同步的变量,用逗号作为间隔,将其加入UGCGameState:GetReplicatedProperties()的末尾 +function BuffManager.GetReplicatedProperties() + return table.unpack(BuffManager.ReplicatedProperties) +end + +-- AllPlayerOwnedBuffs +function BuffManager.DOREPONCE_OwnedBuffInfo() + BuffManager.OwnedBuffInfo = {} + -- 分解AllPlayerOwnedBuffs + for Pawn, BuffInfo in pairs(BuffManager.AllPlayerOwnedBuffs) do + BuffManager.OwnedBuffInfo[#BuffManager.OwnedBuffInfo + 1] = {Pawn, BuffInfo} + end + BuffManager.RegisteredGameState.OwnedBuffInfo = BuffManager.OwnedBuffInfo + UGCLogSystem.LogTree("[BuffManager_DOREPONCE_OwnedBuffInfo] Finish", BuffManager.OwnedBuffInfo) +end +function BuffManager.OnRep_OwnedBuffInfo() + BuffManager.OwnedBuffInfo = BuffManager.RegisteredGameState.OwnedBuffInfo + + UGCLogSystem.LogTree("[BuffManager_OnRep_OwnedBuffInfo] OwnedBuffInfo:", BuffManager.OwnedBuffInfo) + BuffManager.AllPlayerOwnedBuffs = {} + -- 重构AllPlayerOwnedBuffs + for i, v in pairs(BuffManager.OwnedBuffInfo) do + if v[1] and v[2] then + BuffManager.AllPlayerOwnedBuffs[v[1]] = v[2] + end + end + -- 客户端校验玩家拥有的Buff并进行创建和删除操作 + BuffManager.ClientUpdateAllPlayerOwnedBuffs() +end + + +-- ReplicatedProperties End ------------------------------------------------------------------------------------ + +-- Register ---------------------------------------------------------------------------------------------------- + +--- 初始化注册 该函数需要在GameState的服务器和客户端中同时调用 +---@param InGameState UGCGameState_C GameState作为辅助同步的Actor +function BuffManager.InitRegister(InGameState) + BuffManager.RegisteredGameState = InGameState + -- 初始化一下Tick的时间 + BuffManager.LastTickTime = BuffManager.GetGameTime() + -- 启用Tick + BuffManager.TickHandle = UGCEventSystem.SetTimerLoop(BuffManager.RegisteredGameState, BuffManager.Tick, 1./BuffManager.TickFPS) + + -- 注册一下RPC函数 + BuffManager.RegisterRPCFunc(InGameState) + if UGCGameSystem.IsServer() then + -- 注册参数 + BuffManager.RegisterParam(InGameState) + -- 校验Pawn的有效性,不为当前游玩的PlayerPawn则移除其所有Buff + -- BuffManager.CheckPawnIsValidHandle = UGCEventSystem.SetTimerLoop(BuffManager.RegisteredGameState, BuffManager.CheckPawnIsValid, 1) + + else + -- 注册OnRep函数 + BuffManager.RegisterClientOnRepFunc(InGameState) + -- 每秒校验一下同步的Buff + BuffManager.UpdateAllPlayerOwnedBuffsHandle = UGCEventSystem.SetTimerLoop(BuffManager.RegisteredGameState, BuffManager.ClientUpdateAllPlayerOwnedBuffs, 1) + end +end + +-- 注册RPC函数 +function BuffManager.RegisterRPCFunc(InGameState) + for i, FuncName in pairs(BuffManager.RPCFunc) do + InGameState[FuncName] = function(GameState, ...) + BuffManager[FuncName](...) + end + end +end + +-- 注册参数 +function BuffManager.RegisterParam(InGameState) + UGCLogSystem.Log("[BuffManager_RegisterParam]") + for i, PropertyName in pairs(BuffManager.ReplicatedProperties) do + -- 这里要保证两个同名 + if BuffManager[PropertyName] then + InGameState[PropertyName] = BuffManager[PropertyName] + UGCLogSystem.Log("[BuffManager_RegisterParam] PropertyName:%s", tostring(PropertyName)) + end + end +end + +-- 注册客户端OnRep函数 +function BuffManager.RegisterClientOnRepFunc(InGameState) + UGCLogSystem.Log("[BuffManager_RegisterClientOnRepFunc]") + for i, PropertyName in pairs(BuffManager.ReplicatedProperties) do + local OnRepFuncName = "OnRep_" .. PropertyName + if BuffManager[OnRepFuncName] then + InGameState[OnRepFuncName] = function(InGameState) + UGCLogSystem.Log("[BuffManager_RegisterClientOnRepFunc] Exe") + BuffManager[OnRepFuncName]() + end + BuffManager[OnRepFuncName]() + UGCLogSystem.Log("[BuffManager_RegisterClientOnRepFunc] OnRepFuncName:%s", tostring(OnRepFuncName)) + end + end +end + +-- Register End ------------------------------------------------------------------------------------------------ + + +--- 获取单个Action实例,该实例主要用于拷贝和实例的RPC +function BuffManager.GetSimpleAction(InActionType) + local SimpleAction = BuffManager.SimpleAction[InActionType] + if SimpleAction == nil then + local BuffFileName = BuffActionConfig.ActionFileName[InActionType] + -- UGCLogSystem.Log("[BuffManager_GetCopyAction] BuffFileName:%s", tostring(BuffFileName)) + if BuffFileName then + SimpleAction = require(BuffActionConfig.ActionRootPath .. "." .. BuffFileName) + BuffManager.SimpleAction[InActionType] = SimpleAction + else + return nil + end + end + return SimpleAction +end + +--- 作为BuffAction拷贝临时模板列表 +BuffManager.SimpleAction = {} +--- 获取拷贝的BuffAction +---@param InActionType BuffActionConfig.EActionType +---@param CopyAction table 拷贝出的Action +function BuffManager.GetCopyAction(InActionType) + -- UGCLogSystem.Log("[BuffManager_GetCopyAction] InActionType:%s", tostring(InActionType)) + local SimpleAction = BuffManager.GetSimpleAction(InActionType) + -- UGCLogSystem.Log("[BuffManager_GetCopyAction] Finish") + return table.NewLuaObj(SimpleAction) +end + +function BuffManager.GetBuffAssetInfo(InBuffAssetType) + if BuffManager.BuffAssetList[InBuffAssetType] == nil then + BuffManager.BuffAssetList[InBuffAssetType] = require(BuffAssetConfig.AssetRootPath .. "." .. BuffAssetConfig.BuffFileName[InBuffAssetType]) + end + return BuffManager.BuffAssetList[InBuffAssetType] +end + +--- 获取一个新的BuffID +function BuffManager.GetNewBuffID() + if BuffManager.NowBuffID == nil then + BuffManager.NowBuffID = 1; + else + BuffManager.NowBuffID = 1 + BuffManager.NowBuffID; + end + return BuffManager.NowBuffID +end + +--- 由于需要做同步处理,因此该变量在服务器和客户端需要采用不同的变量 +function BuffManager.GetAllPlayerOwnedBuffs() + if UGCGameSystem.IsServer() then + return BuffManager.AllPlayerOwnedBuffs + else + return BuffManager.ClientAllPlayerOwnedBuffs + end +end + +--- 获取Buff的拥有者 +---@param InBuffID uint +function BuffManager.GetBuffOwner(InBuffID) + -- 服务器和客户端需要两套进行 + local TargetAllPlayerOwnedBuffs = BuffManager.GetAllPlayerOwnedBuffs() + for Pawn, PlayerOwnedBuff in pairs(TargetAllPlayerOwnedBuffs) do + for BuffID, BuffActionType in pairs(PlayerOwnedBuff) do + if BuffID == InBuffID then + return Pawn + end + end + end + return -1 +end + +--- 获取Buff的结束时间 +---@param InBuffID uint +function BuffManager.GetBuffEndTime(InBuffID) + local BuffInst = BuffManager.BuffInstList[InBuffID] + if BuffInst then + return BuffInst.EndTime + end + return -1 +end + +--- 判断BuffAsset是否一直存在 +function BuffManager.BuffIsAlwaysExists(InBuffAssetType) + local BuffAssetInfo = BuffManager.GetBuffAssetInfo(InBuffAssetType) + if BuffAssetInfo then + return BuffAssetInfo.IsAlwaysExists + end + return false +end + +--- 判断玩家是否拥有这个Buff +function BuffManager.PlayerHasBuff(InPawn, InBuffAssetType) + local PlayerOwnedBuff = BuffManager.GetAllPlayerOwnedBuffs()[InPawn] + if PlayerOwnedBuff then + for BuffID, BuffAssetType in pairs(PlayerOwnedBuff) do + if BuffAssetType == InBuffAssetType then + return true + end + end + end + return false +end + +--- 获取玩家拥有的BuffAsset所有的BuffID +function BuffManager.GetPlayerOwnedBuffIDFromBuffAssetType(InPawn, InBuffAssetType) + local Res = {} + local PlayerOwnedBuff = BuffManager.GetAllPlayerOwnedBuffs()[InPawn] + if PlayerOwnedBuff then + for BuffID, BuffAssetType in pairs(PlayerOwnedBuff) do + if BuffAssetType == InBuffAssetType then + Res[#Res + 1] = BuffID + end + end + end + return Res +end + +--- 通过BuffID获取BuffInst信息 +function BuffManager.GetBuffInstInfoFromBuffID(InBuffID) + return BuffManager.BuffInstList[InBuffID] +end + +--- 调用BuffInst里所有BuffAction的函数 +function BuffManager.ExeBuffActionsFuncFromBuffInst(InBuffInst, FuncName, ...) + if InBuffInst then + for i, ActionInst in pairs(InBuffInst.BuffActions) do + ActionInst[FuncName](ActionInst, ...) + end + end +end + +--- Server +--- 给玩家加入一个Buff,添加有很多种情况,不一定是创建新的Buff +---@param BuffCauser AController* @施加Buff的玩家或AI。 +---@param CauserActor AActor* @施加Buff的Actor,比如说PlayerPawn、燃烧瓶Actor等等 +---@return BuffID 如果失败则返回-1 这里的BuffID可能是之前已创建的,因为有些Buff为刷新时间的Buff +function BuffManager.PlayerAddBuff(InPawn, InBuffAssetType, BuffCauser, CauserActor) + UGCLogSystem.Log("[BuffManager_PlayerAddBuff] InBuffAssetType:%s", tostring(InBuffAssetType)) + if UE.IsValid(InPawn) then + -- 获取Buff资产的信息,该参数不可修改 + local ConstBuffAsset = BuffManager.GetBuffAssetInfo(InBuffAssetType) + if ConstBuffAsset then + -- 获取Buff叠加类型 多次获得该Buff时所需要做的处理(延长时间或者叠加) + local BuffRepeatedType = ConstBuffAsset.BuffRepeatedType + -- 玩家拥有这个Buff的所有的BuffID + local OwnedThisBuffIDs = BuffManager.GetPlayerOwnedBuffIDFromBuffAssetType(InPawn, InBuffAssetType) + -- 玩家是否拥有这个Buff + local PlayerHaveThisBuff = (#OwnedThisBuffIDs > 0) + -- 获取Buff层数 + local BuffLayer = #OwnedThisBuffIDs + + -- 通过叠加模式进行Switch分别处理 + if BuffRepeatedType == BuffAssetConfig.EBuffRepeatedType.TimeExpand then + --- Buff是时间刷新类型的Buff进行的处理 + -- 判断玩家是否已有这个Buff + if PlayerHaveThisBuff then + --- 有这个Buff则调用Action刷新函数 + -- 获取唯一的BuffID + local OnceBuffID = OwnedThisBuffIDs[1] + -- 获取已创建的Buff的实例 + local BuffInst = BuffManager.GetBuffInstInfoFromBuffID(OnceBuffID) + -- 判断Buff是否为永久存在的 + if not BuffManager.BuffIsAlwaysExists(InBuffAssetType)then + --- 该Buff不是永久存在的则需要刷新Buff的持续时间 + BuffManager.AddBuffValidityTime(OnceBuffID, ConstBuffAsset.ValidityTime) + end + -- 调用一下刷新函数 + BuffManager.ExeBuffActionsFuncFromBuffInst(BuffInst, "LuaResetAction") + -- 若玩家已拥有这个永久存在的Buff且不为叠加模式的Buff则直接返回对应的ID + return OnceBuffID + else + --- 没有这个Buff则创建一个并加入进去 + -- New一个BuffID + local BuffID = BuffManager.GetNewBuffID() + -- 创建一个Buff给玩家 + BuffManager.CreateBuffToPawn(BuffID, InPawn, InBuffAssetType, BuffCauser, CauserActor) + return BuffID + end + elseif BuffRepeatedType == BuffAssetConfig.EBuffRepeatedType.Superposition then + --- Buff是可重叠类型的Buff进行的处理 + -- 判断是否超出层数 + if ConstBuffAsset.LayerMax > BuffLayer then + -- New一个BuffID + local BuffID = BuffManager.GetNewBuffID() + UGCLogSystem.Log("[BuffManager_PlayerAddBuff] BuffID:%s", tostring(BuffID)) + -- 创建一个Buff给玩家 + BuffManager.CreateBuffToPawn(BuffID, InPawn, InBuffAssetType, BuffCauser, CauserActor) + return BuffID + end + end + end + end + return -1 +end + +--- 隔帧同步OwnedBuffInfo +function BuffManager.IntervalFrameSyncOwnedBuffInfo() + -- 这里是为了防止一帧中刷新多次参数,导致复杂度变为n^2,所做出的隔帧同步的处理 + if BuffManager.SyncOwnedBuffInfoHandle == nil then + BuffManager.SyncOwnedBuffInfoHandle = UGCEventSystem.SetTimer( + UGCGameSystem.GameState, + function() + BuffManager.DOREPONCE_OwnedBuffInfo() + BuffManager.SyncOwnedBuffInfoHandle = nil + end, + 0.01 + ) + + end +end + +--- 给玩家创建一个Buff,无需校验Pawn之类传入参数,在调用前需要验证好这些参数 +---@return BuffID +function BuffManager.CreateBuffToPawn(InBuffID, InPawn, InBuffAssetType, InBuffCauser, InCauserActor) + UGCLogSystem.Log("[BuffManager_CreateBuffToPawn]") + local BuffActions = {} + local ConstInBuffAsset = BuffManager.GetBuffAssetInfo(InBuffAssetType) + for i, ActionInfo in pairs(ConstInBuffAsset.Actions) do + local ActionType = ActionInfo.ActionType + local Params = ActionInfo.Params + -- New一个BuffAction + local NewAction = BuffManager.GetCopyAction(ActionType) + -- 调用BuffAction的初始化函数 + NewAction:InitBuffAction(InBuffID, InPawn, Params) + -- getmetatable(NewAction):InitBuffAction(InBuffID, InPawn, Params) + -- 调用LuaDoAction函数 + NewAction:LuaDoAction() + -- 加入列表 + BuffActions[ActionType] = NewAction + end + -- 获取Buff结束的GameTime,Client不对该时间进行判断,仅靠服务器的同步进行关闭等操作 + local EndTime = ConstInBuffAsset.IsAlwaysExists and -1 or BuffManager.GetGameTime() + ConstInBuffAsset.ValidityTime + -- 加入InstList + BuffManager.BuffInstList[InBuffID] = {BuffAssetType = InBuffAssetType, OwnerPawn = InPawn, BuffCauser = InBuffCauser, CauserActor = InCauserActor, EndTime = EndTime, BuffActions = BuffActions} + + + -- 设置玩家拥有的Buff + if BuffManager.GetAllPlayerOwnedBuffs()[InPawn] == nil then + BuffManager.GetAllPlayerOwnedBuffs()[InPawn] = {} + end + BuffManager.GetAllPlayerOwnedBuffs()[InPawn][InBuffID] = InBuffAssetType + + if UGCGameSystem.IsServer() then + -- 隔帧同步玩家拥有的Buff + BuffManager.IntervalFrameSyncOwnedBuffInfo() + -- 玩家绑定Actor结束函数 + BuffManager.PlayerBindOnEndPlayDelegate(InPawn) + end + + -- Test + UGCLogSystem.LogTree("[BuffManager_CreateBuffToPawn] AllPlayerOwnedBuffs:", BuffManager.GetAllPlayerOwnedBuffs()) +end + +--- 增加Buff持续时间 此处无需验证BuffID +function BuffManager.AddBuffValidityTime(InBuffID, InAddTime) + UGCLogSystem.Log("[BuffManager_AddBuffValidityTime]") + ---@param BuffInst table {BuffAssetType, OwnerPawn, BuffCauser, CauserActor, EndTime, BuffActions} + local BuffInst = BuffManager.BuffInstList[InBuffID] + local BuffAssetType = BuffInst.BuffAssetType + local ConstBuffAssetInfo = BuffManager.GetBuffAssetInfo(BuffAssetType) + local BuffEndTime = BuffManager.BuffInstList[InBuffID].EndTime + -- 限制Buff增加的时间到最大时间 + local AddTime = math.clamp(BuffManager.GetGameTime() - BuffEndTime + InAddTime, 0, ConstBuffAssetInfo.MaxValidityTime) + UGCLogSystem.Log("[BuffManager_AddBuffValidityTime] InBuffID:%s, BuffEndTime:%s", tostring(InBuffID), tostring(BuffEndTime)) + BuffManager.BuffInstList[InBuffID].EndTime = BuffManager.BuffInstList[InBuffID].EndTime + AddTime + UGCLogSystem.Log("[BuffManager_AddBuffValidityTime] Finish BuffEndTime:%s", tostring(BuffManager.BuffInstList[InBuffID].EndTime)) + + -- 刷新所需同步的起始时间和结束时间 + +end + + + +--- 移除一个Buff +function BuffManager.RemoveBuffFromBuffID(InBuffID) + UGCLogSystem.Log("[BuffManager_RemoveBuffFromBuffID] InBuffID:%s", tostring(InBuffID)) + -- BuffInst = {BuffAssetType, OwnerPawn, BuffCauser, CauserActor, EndTime, BuffActions} + local BuffInst = BuffManager.BuffInstList[InBuffID] + if BuffInst then + -- 调用所有Action的移除函数 + BuffManager.ExeBuffActionsFuncFromBuffInst(BuffInst, "LuaUndoAction") + -- 清除BuffInst + BuffManager.BuffInstList[InBuffID] = nil + -- 获取该Buff的拥有者 + local OwnerPlayer = BuffManager.GetBuffOwner(InBuffID) + -- 清除该玩家对应的BuffID + BuffManager.GetAllPlayerOwnedBuffs()[OwnerPlayer][InBuffID] = nil + if UGCGameSystem.IsServer() then + -- 隔帧同步OwnedBuffInfo + BuffManager.IntervalFrameSyncOwnedBuffInfo() + end + end +end + +--- 移除玩家的某个Buff +---@param Layer 移除的层数 +function BuffManager.PlayerRemoveBuffFromBuffAssetType(InPawn, InBuffAssetType, Layer) + UGCLogSystem.Log("[BuffManager_PlayerRemoveBuffFromBuffAssetType]") + if BuffManager.GetAllPlayerOwnedBuffs()[InPawn] and Layer > 0 then + for BuffID, BuffAssetType in pairs(BuffManager.GetAllPlayerOwnedBuffs()[InPawn]) do + if InBuffAssetType == BuffAssetType then + BuffManager.RemoveBuffFromBuffID(BuffID) + Layer = Layer - 1 + if Layer <= 0 then + break + end + end + end + end +end + +-- 清除玩家所有的Buff,一般用于玩家死亡 +function BuffManager.ClearPlayerBuff(InPawn) + UGCLogSystem.Log("[BuffManager_ClearPlayerBuff]") + if BuffManager.GetAllPlayerOwnedBuffs()[InPawn] then + for BuffID, BuffAssetType in pairs(BuffManager.GetAllPlayerOwnedBuffs()[InPawn]) do + BuffManager.RemoveBuffFromBuffID(BuffID) + end + end + BuffManager.GetAllPlayerOwnedBuffs()[InPawn] = nil +end + +--- 玩家绑定死亡函数 +function BuffManager.PlayerBindOnEndPlayDelegate(InPawn) + if BuffManager.BoundOnEndPlayDelegatePlayers[InPawn] == nil then + InPawn.OnEndPlay:Add(BuffManager.PlayerEndPlay, InPawn) + InPawn.OnDeath:Add(BuffManager.PlayerDeath, InPawn) + BuffManager.BoundOnEndPlayDelegatePlayers[InPawn] = 1 + end +end + +--- 玩家死亡函数 进行清除操作 +---@param DeadCharacter:ASTExtraCharacter +function BuffManager.PlayerEndPlay(InPawn) + UGCLogSystem.Log("[BuffManager_PlayerEndPlay]") + -- 移除玩家已绑定死亡函数 + BuffManager.BoundOnEndPlayDelegatePlayers[InPawn] = nil + -- 清除玩家的Buff + BuffManager.ClearPlayerBuff(InPawn) +end + +function BuffManager.Tick() + -- 获取DeltaSeconds + local NowTime = BuffManager.GetGameTime() + local DeltaSeconds = NowTime - BuffManager.LastTickTime + + + -- 判断Buff时间是否到了该移除Buff的时候 + local AllBuffID = table.getKeys(BuffManager.BuffInstList) + -- UGCLogSystem.LogTree("[BuffManager_Tick] AllBuffID:", AllBuffID) + for _, BuffID in pairs(AllBuffID) do + local EndTime = BuffManager.GetBuffEndTime(BuffID) + -- EndTime小于0则代表无限时长的Buff + if EndTime > 0 and EndTime < NowTime then + -- 由于时间间隔不同,所以需要做最后一次Tick的判断,传入的时间差是 + local TempDeltaSeconds = EndTime - BuffManager.LastTickTime + if TempDeltaSeconds > 0 then + BuffManager.ExeBuffActionsFuncFromBuffInst(BuffManager.BuffInstList[BuffID], "LuaUpdateAction", TempDeltaSeconds) + end + BuffManager.RemoveBuffFromBuffID(BuffID) + end + end + + -- 调用BuffAction的Tick函数 + for BuffID, BuffInst in pairs(BuffManager.BuffInstList) do + BuffManager.ExeBuffActionsFuncFromBuffInst(BuffInst, "LuaUpdateAction", DeltaSeconds) + end + + BuffManager.LastTickTime = NowTime +end + +--- 客户端校验玩家拥有的Buff并进行创建和删除操作 +function BuffManager.ClientUpdateAllPlayerOwnedBuffs() + --UGCLogSystem.LogTree("[BuffManager_ClientUpdateAllPlayerOwnedBuffs]", BuffManager.AllPlayerOwnedBuffs) + -- 先进行移除操作 + for Pawn, PlayerOwnedBuff in pairs(BuffManager.ClientAllPlayerOwnedBuffs) do + for BuffID, BuffAssetType in pairs(PlayerOwnedBuff) do + if BuffManager.AllPlayerOwnedBuffs[Pawn] == nil or BuffManager.AllPlayerOwnedBuffs[Pawn][BuffID] == nil then + BuffManager.RemoveBuffFromBuffID(BuffID) + end + end + end + + -- 再进行添加操作 + for Pawn, PlayerOwnedBuff in pairs(BuffManager.AllPlayerOwnedBuffs) do + for BuffID, BuffAssetType in pairs(PlayerOwnedBuff) do + if BuffManager.ClientAllPlayerOwnedBuffs[Pawn] == nil or BuffManager.ClientAllPlayerOwnedBuffs[Pawn][BuffID] == nil then + if UE.IsValid(Pawn) then + BuffManager.CreateBuffToPawn(BuffID, Pawn, BuffAssetType) + end + end + end + end +end + +--- 校验Pawn是否有效,无效则清除对应Buff +function BuffManager.CheckPawnIsValid() + local AllPawn = UGCGameSystem.GetAllPlayerPawn() + local HaveBuffPawn = table.getKeys(BuffManager.GetAllPlayerOwnedBuffs()) + for _, Pawn in pairs(HaveBuffPawn) do + if not table.hasValue(AllPawn, Pawn) then + UGCLogSystem.Log("[BuffManager_CheckPawnIsValid] Pawn:%s", tostring(Pawn)) + BuffManager.ClearPlayerBuff(Pawn) + end + end +end + + +--- 用于Action的RPC函数, 这里不能保证客户端已同步Buff,因此采用传入BuffID是否为nil的方式判断是否使用单个实例的方法去调RPC,如果是客户端调服务器就肯定可以 +function BuffManager.RPCActionFunc(InPlayerKey, BuffID, BuffActionType, FuncName, ...) + UGCSendRPCSystem.ActorRPCNotify(InPlayerKey, UGCGameSystem.GameState, "DoBuffActionFunction", BuffID, BuffActionType, FuncName, ...) +end + +function BuffManager.DoBuffActionFunction(BuffID, BuffActionType, FuncName, ...) + local BuffInst = BuffManager.BuffInstList[BuffID] + if BuffID == nil then + --- 调单例的函数 + local SimpleAction = BuffManager.GetSimpleAction(BuffActionType) + if SimpleAction then + SimpleAction[FuncName](SimpleAction, ...) + else + return false + end + elseif BuffInst and BuffInst.BuffActions[BuffActionType] and BuffInst.BuffActions[BuffActionType][FuncName] then + --- 调BuffInst里的Action对应的函数 + local BuffAction = BuffInst.BuffActions[BuffActionType] + BuffAction[FuncName](BuffAction, ...) + else + return false + end + return true +end \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffSystemAPI.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffSystemAPI.lua new file mode 100644 index 00000000..eaddc610 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffSystemAPI.lua @@ -0,0 +1,89 @@ +--[[ +说明文档: +1、将BuffSystem文件夹加入Script.Global文件夹中 +2、require此文件 +3、GameState的BeginPlay中调用BuffManager.InitRegister(InGameState) +4、GameState的UGCGameState:GetReplicatedProperties()函数末尾加入 BuffManager.GetReplicatedProperties() + +]] + +require('Script.Global.BuffSystem.BuffManager') + +BuffSystemAPI = BuffSystemAPI or {} + +---获取给予拥有者该Buff的控制器 +---生效范围:Server +---@return AController* +---@param InBuffID uint +function BuffSystemAPI.GetBuffCauser(InBuffID) + if BuffManager.BuffInstList[InBuffID] then + return BuffManager.BuffInstList[InBuffID].BuffCauser + end +end + + +---获取给予拥有者该Buff的Actor 如燃烧子弹、燃烧瓶等 +---生效范围:Server +---@return AActor* +---@param InBuffID uint +function BuffSystemAPI.GetCauserActor(InBuffID) + if BuffManager.BuffInstList[InBuffID] then + return BuffManager.BuffInstList[InBuffID].CauserActor + end +end + +---为玩家添加Buff +---生效范围:Server +---@return BuffID int @Buff唯一ID +---@param PlayerPawn PlayerPawn* @玩家角色。所有的接口里的PlayerPawn都可以扩展成任意的Actor,只要这个Actor有一个名字叫BuffSystemComponent的Buff组件即可。 +---@param InBuffAssetType EBuffAssetType @Buff资产类型 +---@param BuffCauser AController* @施加Buff的玩家或AI。可以是nil +---@param CauserActor AActor* @施加Buff的Actor,比如说PlayerPawn、燃烧瓶Actor等等 可以是nil +function BuffSystemAPI.PlayerAddBuff(PlayerPawn, InBuffAssetType, BuffCauser, CauserActor) + return BuffManager.PlayerAddBuff(PlayerPawn, InBuffAssetType, BuffCauser, CauserActor) +end + + +---为玩家移除Buff +---生效范围:Server +---@param PlayerPawn PlayerPawn* @玩家角色 +---@param BuffName String @Buff名 +---@param LayerCount int @层数 +function BuffSystemAPI.PlayerRemoveBuffFromBuffAssetType(PlayerPawn, InBuffAssetType, LayerCount) + return BuffManager.PlayerRemoveBuffFromBuffAssetType(PlayerPawn, InBuffAssetType, LayerCount) +end + +---移除Buff +---生效范围:Server +---@param InBuffID uint +function BuffSystemAPI.RemoveBuffFromBuffID(InBuffID) + return BuffManager.RemoveBuffFromBuffID(InBuffID) +end + +---是否存在该Buff +---生效范围:Server +---@return HasBuff bool @是否存在Buff +---@param PlayerPawn PlayerPawn* @玩家角色 +---@param InBuffAssetType EBuffAssetType @Buff资产类型 +function BuffManager.PlayerHasBuff(InPawn, InBuffAssetType) + return BuffManager.PlayerHasBuff(InPawn, InBuffAssetType) +end + +---获取Buff当前层数 +---生效范围:服务器&客户端 +---@return Layer int @层数 +---@param PlayerPawn PlayerPawn* @玩家角色 +---@param InBuffAssetType EBuffAssetType @Buff资产类型 +function BuffSystemAPI.GetCurLayer(PlayerPawn, InBuffAssetType) + -- 玩家拥有这个Buff的所有的BuffID + local OwnedThisBuffIDs = BuffManager.GetPlayerOwnedBuffIDFromBuffAssetType(PlayerPawn, InBuffAssetType) + return #OwnedThisBuffIDs +end + +---@param InPlayerKey "nil则是广播或客户端发送服务器,table则发送对应客户端,int则为对应玩家" +---@param BuffID "nil则调单个实例,int则为对应Buff实例中的Action,客户端可能存在同步不及时的情况,建议使用单个实例" +---@param BuffActionType EBuffActionType +---@param FuncName string +function BuffSystemAPI.RPCAction(InPlayerKey, BuffID, BuffActionType, FuncName, ...) + BuffManager.RPCActionFunc(InPlayerKey, BuffID, BuffActionType, FuncName, ...) +end \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffTemplate/BuffAction_Template.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffTemplate/BuffAction_Template.lua new file mode 100644 index 00000000..b9b21b1f --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffTemplate/BuffAction_Template.lua @@ -0,0 +1,39 @@ +-- Script.Global.BuffSystem.BuffAction.BuffAction_Template +local BuffActionBase = require('Script.Global.BuffSystem.BuffActionBase') + +local BuffAction_Template = setmetatable( + {}, + { __index = BuffActionBase, __metatable = BuffActionBase } +); + +--[[ +-- 常用接口 +self:GetInstID() -- 获取BuffID +self:GetOwnerPawn() -- 获取拥有者 +BuffSystemAPI.GetBuffCauser(self:GetInstID()) -- 获取Buff给予者 + +self:EnableTick() -- 开启Tick +self:StopTick() -- 会自动关 +self:IsEnableTick() -- 是否已开启Tick +]] + +function BuffAction_Template:LuaDoAction() + BuffActionBase.LuaDoAction(self) + -- 启用Tick UndoAction会自动关 + -- self:EnableTick() +end + +function BuffAction_Template:LuaUndoAction() + BuffActionBase.LuaUndoAction(self) +end + +function BuffAction_Template:LuaResetAction() + BuffActionBase.LuaResetAction(self) +end + +function BuffAction_Template:LuaUpdateAction(DeltaSeconds) + BuffActionBase.LuaUpdateAction(self, DeltaSeconds) +end + + +return BuffAction_Template; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/BuffTemplate/BuffAsset_Template.lua b/CounterAttack_Solo/Script/Global/BuffSystem/BuffTemplate/BuffAsset_Template.lua new file mode 100644 index 00000000..dd63bf7c --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/BuffTemplate/BuffAsset_Template.lua @@ -0,0 +1,26 @@ +return { + Name = "Buff模板"; + -- 是否一直存在,直到手动移除或玩家死亡才自动调用关闭 + IsAlwaysExists = false; + -- 多次获得该Buff时所需要做的处理(延长时间或者叠加) + BuffRepeatedType = BuffAssetConfig.EBuffRepeatedType.TimeExpand; + -- 持续时间 + ValidityTime = 5.; + -- 最大持续时间(意思是刷新时间后可保留的最大时间) + MaxValidityTime = 10; + -- 最大叠加层数 + LayerMax = 1; + -- Buff激活到的BuffAction + Actions = { + { + ActionType = BuffActionConfig.EActionType.InfiniteBullets; + Params = {} + }, + { + ActionType = BuffActionConfig.EActionType.DamageScale; + Params = { + ["DamageScale"] = 1.3; + } + }, + }; +} \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/Config/BuffActionConfig.lua b/CounterAttack_Solo/Script/Global/BuffSystem/Config/BuffActionConfig.lua new file mode 100644 index 00000000..55793b85 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/Config/BuffActionConfig.lua @@ -0,0 +1,48 @@ +BuffActionConfig = BuffActionConfig or {} + +-- Action 文件的基础路径 +BuffActionConfig.ActionRootPath = "Script.Global.BuffSystem.BuffAction" + +BuffActionConfig.EActionType = { + DamageScale = 1; -- 玩家伤害缩放 + DefenseScale = 2; -- 玩家防御缩放 + InfiniteBullets = 3; -- 无限子弹 + JumpStrengthen = 4; -- 玩家多段跳 + MoveSpeedStrengthen = 5; -- 速度缩放 + RespiratoryRecovery = 6; -- 呼吸恢复 + ContinuousDamage = 7; -- 持续受到伤害 + MarkPlayer = 8; -- 标记玩家 + Vampirism = 9; -- 吸血 + DamageAddBuff = 10; -- 攻击方给受击者给予Buff + ShowParticle = 11; -- 客户端显示特效 + JumpScale = 12; -- 跳跃初速度缩放 + AddMaxHealth = 13; -- 增加最大血量上限 + BulletHitApplyRadialDamage = 14; -- 击中点位触发范围 + BeFatedNotToDie = 15; -- 命悬一线,受到致命伤保留1点血 + Counterattack = 16; -- 绝地反击 血量越低伤害越高 + RateOfFire = 17; -- 射速 + Sensing = 18; -- 雷达 +} + +BuffActionConfig.ActionFileName = { + [BuffActionConfig.EActionType.DamageScale ] = "BuffAction_DamageScale" ; + [BuffActionConfig.EActionType.DefenseScale ] = "BuffAction_DefenseScale" ; + [BuffActionConfig.EActionType.InfiniteBullets ] = "BuffAction_InfiniteBullets" ; + [BuffActionConfig.EActionType.JumpStrengthen ] = "BuffAction_JumpStrengthen" ; + [BuffActionConfig.EActionType.MoveSpeedStrengthen ] = "BuffAction_MoveSpeedStrengthen" ; + [BuffActionConfig.EActionType.RespiratoryRecovery ] = "BuffAction_RespiratoryRecovery" ; + [BuffActionConfig.EActionType.ContinuousDamage ] = "BuffAction_ContinuousDamage" ; + [BuffActionConfig.EActionType.MarkPlayer ] = "BuffAction_MarkPlayer" ; + [BuffActionConfig.EActionType.Vampirism ] = "BuffAction_Vampirism" ; + [BuffActionConfig.EActionType.DamageAddBuff ] = "BuffAction_DamageAddBuff" ; + [BuffActionConfig.EActionType.ShowParticle ] = "BuffAction_ShowParticle" ; + [BuffActionConfig.EActionType.JumpScale ] = "BuffAction_JumpScale" ; + [BuffActionConfig.EActionType.AddMaxHealth ] = "BuffAction_AddMaxHealth" ; + [BuffActionConfig.EActionType.BulletHitApplyRadialDamage ] = "BuffAction_BulletHitApplyRadialDamage" ; + [BuffActionConfig.EActionType.BeFatedNotToDie ] = "BuffAction_BeFatedNotToDie" ; + [BuffActionConfig.EActionType.Counterattack ] = "BuffAction_Counterattack" ; + [BuffActionConfig.EActionType.RateOfFire ] = "BuffAction_RateOfFire" ; + [BuffActionConfig.EActionType.Sensing ] = "BuffAction_Sensing" ; + +} + diff --git a/CounterAttack_Solo/Script/Global/BuffSystem/Config/BuffAssetConfig.lua b/CounterAttack_Solo/Script/Global/BuffSystem/Config/BuffAssetConfig.lua new file mode 100644 index 00000000..af051303 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/BuffSystem/Config/BuffAssetConfig.lua @@ -0,0 +1,122 @@ +BuffAssetConfig = BuffAssetConfig or {} + +--- Buff重复获得的类型 +BuffAssetConfig.EBuffRepeatedType = { + --- 叠加 + Superposition = 1; + --- 延长持续时间 + TimeExpand = 2; +} + +-- Buff资产的根目录 +BuffAssetConfig.AssetRootPath = "Script.Global.BuffSystem.BuffAsset" + +BuffAssetConfig.EBuffAssetType = { + TestBuff = -1; + + GodOfWar = 0; + + JumpStrengthenLv1 = 1; + JumpStrengthenLv2 = 2; + JumpStrengthenLv3 = 3; + MoveSpeedStrengthenLv1 = 4; + MoveSpeedStrengthenLv2 = 5; + MoveSpeedStrengthenLv3 = 6; + IncreasedDamageLv1 = 7; + IncreasedDamageLv2 = 8; + IncreasedDamageLv3 = 9; + RespiratoryRecoveryLv1 = 10; + RespiratoryRecoveryLv2 = 11; + RespiratoryRecoveryLv3 = 12; + IncreasedDefenseLv1 = 13; + IncreasedDefenseLv2 = 14; + IncreasedDefenseLv3 = 15; + VampirismLv1 = 16; + VampirismLv2 = 17; + VampirismLv3 = 18; + IceLv1 = 19; + IceLv2 = 20; + IceLv3 = 21; + BulletIceLv1 = 22; + BulletIceLv2 = 23; + BulletIceLv3 = 24; + JumpScaleLv1 = 25; + JumpScaleLv2 = 26; + JumpScaleLv3 = 27; + MarkedLv1 = 28; + MarkedLv2 = 29; + MarkedLv3 = 30; + MarkLv1 = 31; + MarkLv2 = 32; + MarkLv3 = 33; + AddMaxHealthLv1 = 34; + AddMaxHealthLv2 = 35; + AddMaxHealthLv3 = 36; + BulletExplosionLv1 = 37; + BulletExplosionLv2 = 38; + BulletExplosionLv3 = 39; + TenaciousLv1 = 40; + TenaciousLv2 = 41; + CounterattackLv1 = 42; + CounterattackLv2 = 43; + RateOfFireLv1 = 44; + RateOfFireLv2 = 45; + RateOfFireLv3 = 46; + SensingLv1 = 47; + SensingLv2 = 48; +} + +BuffAssetConfig.BuffFileName = { + [BuffAssetConfig.EBuffAssetType.TestBuff] = "TestBuffAsset"; + + [BuffAssetConfig.EBuffAssetType.GodOfWar] = "GodOfWar"; + + [BuffAssetConfig.EBuffAssetType.JumpStrengthenLv1] = "JumpStrengthenLv1"; + [BuffAssetConfig.EBuffAssetType.JumpStrengthenLv2] = "JumpStrengthenLv2"; + [BuffAssetConfig.EBuffAssetType.JumpStrengthenLv3] = "JumpStrengthenLv3"; + [BuffAssetConfig.EBuffAssetType.MoveSpeedStrengthenLv1] = "MoveSpeedStrengthenLv1"; + [BuffAssetConfig.EBuffAssetType.MoveSpeedStrengthenLv2] = "MoveSpeedStrengthenLv2"; + [BuffAssetConfig.EBuffAssetType.MoveSpeedStrengthenLv3] = "MoveSpeedStrengthenLv3"; + [BuffAssetConfig.EBuffAssetType.IncreasedDamageLv1] = "IncreasedDamageLv1"; + [BuffAssetConfig.EBuffAssetType.IncreasedDamageLv2] = "IncreasedDamageLv2"; + [BuffAssetConfig.EBuffAssetType.IncreasedDamageLv3] = "IncreasedDamageLv3"; + [BuffAssetConfig.EBuffAssetType.RespiratoryRecoveryLv1] = "RespiratoryRecoveryLv1"; + [BuffAssetConfig.EBuffAssetType.RespiratoryRecoveryLv2] = "RespiratoryRecoveryLv2"; + [BuffAssetConfig.EBuffAssetType.RespiratoryRecoveryLv3] = "RespiratoryRecoveryLv3"; + [BuffAssetConfig.EBuffAssetType.IncreasedDefenseLv1] = "IncreasedDefenseLv1"; + [BuffAssetConfig.EBuffAssetType.IncreasedDefenseLv2] = "IncreasedDefenseLv2"; + [BuffAssetConfig.EBuffAssetType.IncreasedDefenseLv3] = "IncreasedDefenseLv3"; + [BuffAssetConfig.EBuffAssetType.VampirismLv1] = "VampirismLv1"; + [BuffAssetConfig.EBuffAssetType.VampirismLv2] = "VampirismLv2"; + [BuffAssetConfig.EBuffAssetType.VampirismLv3] = "VampirismLv3"; + [BuffAssetConfig.EBuffAssetType.IceLv1] = "IceLv1"; + [BuffAssetConfig.EBuffAssetType.IceLv2] = "IceLv2"; + [BuffAssetConfig.EBuffAssetType.IceLv3] = "IceLv3"; + [BuffAssetConfig.EBuffAssetType.BulletIceLv1] = "BulletIceLv1"; + [BuffAssetConfig.EBuffAssetType.BulletIceLv2] = "BulletIceLv2"; + [BuffAssetConfig.EBuffAssetType.BulletIceLv3] = "BulletIceLv3"; + [BuffAssetConfig.EBuffAssetType.JumpScaleLv1] = "JumpScaleLv1"; + [BuffAssetConfig.EBuffAssetType.JumpScaleLv2] = "JumpScaleLv2"; + [BuffAssetConfig.EBuffAssetType.JumpScaleLv3] = "JumpScaleLv3"; + [BuffAssetConfig.EBuffAssetType.MarkedLv1] = "MarkedLv1"; + [BuffAssetConfig.EBuffAssetType.MarkedLv2] = "MarkedLv2"; + [BuffAssetConfig.EBuffAssetType.MarkedLv3] = "MarkedLv3"; + [BuffAssetConfig.EBuffAssetType.MarkLv1] = "MarkLv1"; + [BuffAssetConfig.EBuffAssetType.MarkLv2] = "MarkLv2"; + [BuffAssetConfig.EBuffAssetType.MarkLv3] = "MarkLv3"; + [BuffAssetConfig.EBuffAssetType.AddMaxHealthLv1] = "AddMaxHealthLv1"; + [BuffAssetConfig.EBuffAssetType.AddMaxHealthLv2] = "AddMaxHealthLv2"; + [BuffAssetConfig.EBuffAssetType.AddMaxHealthLv3] = "AddMaxHealthLv3"; + [BuffAssetConfig.EBuffAssetType.BulletExplosionLv1] = "BulletExplosionLv1"; + [BuffAssetConfig.EBuffAssetType.BulletExplosionLv2] = "BulletExplosionLv2"; + [BuffAssetConfig.EBuffAssetType.BulletExplosionLv3] = "BulletExplosionLv3"; + [BuffAssetConfig.EBuffAssetType.TenaciousLv1] = "TenaciousLv1"; + [BuffAssetConfig.EBuffAssetType.TenaciousLv2] = "TenaciousLv2"; + [BuffAssetConfig.EBuffAssetType.CounterattackLv1] = "CounterattackLv1"; + [BuffAssetConfig.EBuffAssetType.CounterattackLv2] = "CounterattackLv2"; + [BuffAssetConfig.EBuffAssetType.RateOfFireLv1] = "RateOfFireLv1"; + [BuffAssetConfig.EBuffAssetType.RateOfFireLv2] = "RateOfFireLv2"; + [BuffAssetConfig.EBuffAssetType.RateOfFireLv3] = "RateOfFireLv3"; + [BuffAssetConfig.EBuffAssetType.SensingLv1] = "SensingLv1"; + [BuffAssetConfig.EBuffAssetType.SensingLv2] = "SensingLv2"; +} \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/Config/A_IncludeConfig.lua b/CounterAttack_Solo/Script/Global/Config/A_IncludeConfig.lua new file mode 100644 index 00000000..06a680fd --- /dev/null +++ b/CounterAttack_Solo/Script/Global/Config/A_IncludeConfig.lua @@ -0,0 +1,16 @@ +-- 需要包含的头目录 + +local Prefix = "Script.Global.Config." + +require(Prefix .. 'SignalCircleConfig') +require(Prefix .. 'MapConfig') +require(Prefix .. 'TeamConfig') +require(Prefix .. 'TipConfig') +require(Prefix .. 'ArchiveDataConfig') +require(Prefix .. 'LevelConfig') +require(Prefix .. 'DailyTasksConfig') +require(Prefix .. 'WeaponSelectionCombinationConfig') +require(Prefix .. 'SkillConfig') +require(Prefix .. "ParticleConfig") + + diff --git a/CounterAttack_Solo/Script/Global/Config/ArchiveDataConfig.lua b/CounterAttack_Solo/Script/Global/Config/ArchiveDataConfig.lua new file mode 100644 index 00000000..910eeee8 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/Config/ArchiveDataConfig.lua @@ -0,0 +1,214 @@ +--[[ +使用说明: + 这个存档操作文件是为了将存档抽象出来。 + 注册该操作文件后,可以自动注册需要同步的存档变量到GameState. + 注册时也会注册OnRep函数,为的是当服务器修改了需要同步的存档后,同步信息到客户端发送修改的通知事件。 + +配置方法: + ArchiveDataConfig: + 设置玩家登录的绑定事件: ArchiveDataConfig.PlayerLoginEvent + 设置存档类型: EArchiveType + 存档变量名: ArchiveParamName + 需要同步的存档类型: ReplicatedProperties + GameState: + BeginPlay添加 ArchiveDataConfig.Register(self) + GetReplicatedProperties的return添加 ArchiveDataConfig.GetAllReplicatedPropertiesName() + +API使用: + -- 获取玩家存档信息,若没有该存档则返回nil + ArchiveDataConfig.GetPlayerArchiveDataFromType(PlayerKey, InArchiveType) + -- 保存玩家存档信息 + ArchiveDataConfig.SavePlayerArchiveData(PlayerKey, InArchiveType, Data) + -- 绑定存档改变的事件 + UGCEventSystem.AddListener(ArchiveDataConfig.GetParamNotifyEvent(EArchiveType), Func, Obj) +]] + +ArchiveDataConfig = ArchiveDataConfig or {} +-- 玩家登录的事件 +ArchiveDataConfig.PlayerLoginEvent = EventEnum.PlayerLogin +-- 存储的类型 +ArchiveDataConfig.EArchiveType = { + NumberOfPlays = 1; -- 游玩次数 + WeaponCombs = 4; -- 保存的武器组合 {[Index] = {WeaponID, WeaponID}} + CustomWeaponParts = 3; -- 玩家保存的武器配件组合 +} + +-- 变量命名 +ArchiveDataConfig.ArchiveParamName = { + [ArchiveDataConfig.EArchiveType.NumberOfPlays] = "NumberOfPlays"; + [ArchiveDataConfig.EArchiveType.WeaponCombs] = "WeaponCombs"; + [ArchiveDataConfig.EArchiveType.CustomWeaponParts] = "CustomWeaponParts"; + +} + +-- 需要进行客户端同步的参数 +ArchiveDataConfig.ReplicatedProperties = { + ArchiveDataConfig.EArchiveType.NumberOfPlays; + ArchiveDataConfig.EArchiveType.WeaponCombs; + ArchiveDataConfig.EArchiveType.CustomWeaponParts; +} + +-- 客户端同步参数的后缀 +ArchiveDataConfig.ReplicatedPropertiesListSuffix = "List" +-- 生成通知事件的类型区间,生成的事件为 ParamNotifyEventRange + EArchiveType +ArchiveDataConfig.ParamNotifyEventRange = -10000 +-- 设置到GameState的存储Data名字 +ArchiveDataConfig.SavePlayerArchiveDataName = "SavePlayerArchiveData" + + +ArchiveDataConfig.GameState = nil +--- GameState注册 +function ArchiveDataConfig.Register(InGameState) + UGCLogSystem.Log("[ArchiveDataConfig_Register] Start") + ArchiveDataConfig.GameState = InGameState + + if UGCGameSystem.IsServer() then + -- 注册参数 + ArchiveDataConfig.RegisterParam(InGameState) + + UGCEventSystem.AddListener(ArchiveDataConfig.PlayerLoginEvent, ArchiveDataConfig.UpdatePlayerArchiveData) + InGameState[ArchiveDataConfig.SavePlayerArchiveDataName] = function(GameState, PlayerKey, InArchiveType, Data) + ArchiveDataConfig.SavePlayerArchiveData(PlayerKey, InArchiveType, Data) + end + else + -- 注册OnRep函数 + ArchiveDataConfig.RegisterReplicatedProperties(InGameState) + end + UGCLogSystem.Log("[ArchiveDataConfig_Register] Finish") +end + +function ArchiveDataConfig.GetGameState() + if ArchiveDataConfig.GameState then + return ArchiveDataConfig.GameState + else + return UGCGameSystem.GameState + end +end + +--- 通过类型获取同步的参数名 +function ArchiveDataConfig.GetParamListName(InArchiveType) + if ArchiveDataConfig.ArchiveParamName[InArchiveType] then + local ParamName = ArchiveDataConfig.ArchiveParamName[InArchiveType] .. ArchiveDataConfig.ReplicatedPropertiesListSuffix + -- UGCLogSystem.Log("[ArchiveDataConfig_GetParamListName] ParamName:%s", tostring(ParamName)) + return ParamName + else + UGCLogSystem.LogError("[ArchiveDataConfig_GetParamListName] ArchiveParamName[%s] is nil", tostring(InArchiveType)) + return nil + end +end + +--- 获取所有同步的参数名 +function ArchiveDataConfig.GetAllReplicatedPropertiesName() + local ResName = {} + for i, v in pairs(ArchiveDataConfig.ReplicatedProperties) do + ResName[#ResName + 1] = ArchiveDataConfig.GetParamListName(v) + end + return table.unpack(ResName) +end + +--- 获取参数更新的通知事件 +function ArchiveDataConfig.GetParamNotifyEvent(InArchiveType) + return InArchiveType + ArchiveDataConfig.ParamNotifyEventRange +end + +--- 获取OnRep函数名 +function ArchiveDataConfig.GetOnRepFunctionName(InArchiveType) + return "OnRep_" .. ArchiveDataConfig.GetParamListName(InArchiveType) +end + +--- 注册参数到GameState +function ArchiveDataConfig.RegisterParam(InGameState) + for i, ArchiveType in pairs(ArchiveDataConfig.EArchiveType) do + InGameState[ArchiveDataConfig.GetParamListName(ArchiveType)] = {} + end +end + +--- Client +--- 注册OnRep函数 +function ArchiveDataConfig.RegisterReplicatedProperties(InGameState) + for i, ArchiveType in pairs(ArchiveDataConfig.ReplicatedProperties) do + InGameState[ArchiveDataConfig.GetOnRepFunctionName(ArchiveType)] = function(GameState) + UGCLogSystem.Log("[ArchiveDataConfig_RegisterReplicatedProperties] ArchiveType:%s", tostring(ArchiveType)) + UGCEventSystem.SendEvent(ArchiveDataConfig.GetParamNotifyEvent(ArchiveType)) + end + end +end + +--- 同步新加入的玩家的存档到GameState +function ArchiveDataConfig.UpdatePlayerArchiveData(PlayerPawn, InPlayerKey) + UGCLogSystem.Log("[ArchiveDataConfig_UpdatePlayerArchiveData] InPlayerKey:%s", tostring(InPlayerKey)) + local PlayerAccountInfo = UGCPlayerStateSystem.GetPlayerAccountInfo(InPlayerKey) + if PlayerAccountInfo then + local UID = PlayerAccountInfo.UID + -- Test + -- UGCPlayerStateSystem.SavePlayerArchiveData(UID, {[2] = {[1] = 3, [16] = 3}}) + local ArchiveData = UGCPlayerStateSystem.GetPlayerArchiveData(UID) + if ArchiveData then + for i, ArchiveType in pairs(ArchiveDataConfig.EArchiveType) do + if ArchiveData[ArchiveType] then + ArchiveDataConfig.SetPlayerArchiveParam(InPlayerKey, ArchiveType, ArchiveData[ArchiveType]) + end + end + end + UGCLogSystem.LogTree("[ArchiveDataConfig_UpdatePlayerArchiveData] ArchiveData:", ArchiveData) + end +end + + +--- Server or Client +--- 获取玩家存档参数 +function ArchiveDataConfig.GetPlayerArchiveDataFromType(PlayerKey, InArchiveType) + local ParamList = ArchiveDataConfig.GetGameState()[ArchiveDataConfig.GetParamListName(InArchiveType)] + if ParamList then + return ParamList[PlayerKey] + end + return nil +end + +--- Server +--- 设置玩家存档参数到GameState,但不保存 +function ArchiveDataConfig.SetPlayerArchiveParam(PlayerKey, InArchiveType, InArchiveDate) + if ArchiveDataConfig.GetGameState()[ArchiveDataConfig.GetParamListName(InArchiveType)] == nil then + ArchiveDataConfig.GetGameState()[ArchiveDataConfig.GetParamListName(InArchiveType)] = {} + end + ArchiveDataConfig.GetGameState()[ArchiveDataConfig.GetParamListName(InArchiveType)][PlayerKey] = InArchiveDate +end + +--- Server +--- 更新玩家存档信息,保存并同步 +function ArchiveDataConfig.SavePlayerArchiveData(PlayerKey, InArchiveType, Data) + local PlayerAccountInfo = UGCPlayerStateSystem.GetPlayerAccountInfo(PlayerKey) + if PlayerAccountInfo then + local UID = PlayerAccountInfo.UID + UGCLogSystem.Log("[ArchiveDataConfig_SavePlayerArchiveData] UID:%s", tostring(UID)) + local ArchiveData = UGCPlayerStateSystem.GetPlayerArchiveData(UID) + -- UGCLogSystem.LogTree("[ArchiveDataConfig_SavePlayerArchiveData]ArchiveData:", ArchiveData) + if ArchiveData == nil then + ArchiveData = {} + end + ArchiveData[InArchiveType] = Data + + -- GameState同步设置新存档信息 + ArchiveDataConfig.SetPlayerArchiveParam(PlayerKey, InArchiveType, Data) + -- 保存存档 + local SavedSucceed = UGCPlayerStateSystem.SavePlayerArchiveData(UID, ArchiveData) + -- 发送修改存档通知事件 + UGCEventSystem.SendEvent(ArchiveDataConfig.GetParamNotifyEvent(InArchiveType)) + ArchiveData = UGCPlayerStateSystem.GetPlayerArchiveData(UID) + UGCLogSystem.LogTree("[ArchiveDataConfig_SavePlayerArchiveData]SavedSucceed:" .. tostring(SavedSucceed), ArchiveData) + return true + end + return false +end + + +--- Debug Server +--- 清除玩家存档信息,保存并同步 +function ArchiveDataConfig.ClearPlayerArchiveData(PlayerKey) + if GlobalConfigs.IsDebug then + for i, v in pairs(ArchiveDataConfig.EArchiveType) do + ArchiveDataConfig.SavePlayerArchiveData(PlayerKey, v, nil) + end + end +end + diff --git a/CounterAttack_Solo/Script/Global/Config/DailyTasksConfig.lua b/CounterAttack_Solo/Script/Global/Config/DailyTasksConfig.lua new file mode 100644 index 00000000..14e23841 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/Config/DailyTasksConfig.lua @@ -0,0 +1,72 @@ +DailyTasksConfig = DailyTasksConfig or {} + + +DailyTasksConfig.ETaskType = { + DailyLogin = 1; + CompleteMatch = 2; + DefensiveMVP = 3; + AttackMVP = 4; + LikeOtherPlayerMap = 5; + KillPlayer = 6; +} + +DailyTasksConfig.TaskName = { + [DailyTasksConfig.ETaskType.DailyLogin] = "每日登录"; + [DailyTasksConfig.ETaskType.CompleteMatch] = "完成对局[每次奖励]"; + [DailyTasksConfig.ETaskType.DefensiveMVP] = "获得一次防守MVP"; + [DailyTasksConfig.ETaskType.AttackMVP] = "获得一次进攻MVP"; + [DailyTasksConfig.ETaskType.LikeOtherPlayerMap] = "每日点赞[每次奖励]"; + [DailyTasksConfig.ETaskType.KillPlayer] = "击倒玩家[每次奖励]"; +} + +DailyTasksConfig.TaskInfo = { + [DailyTasksConfig.ETaskType.DailyLogin] = { + -- 任务次数上限 + DailyLimit = 1; + -- 是否为一次性奖励, false则为每次奖励 + IsDisposable = true; + Reward = { + {Type = ArchiveDataConfig.EArchiveType.Gold, Count = 200}; + } + }; + [DailyTasksConfig.ETaskType.CompleteMatch] = { + DailyLimit = 5; + IsDisposable = false; + Reward = { + {Type = ArchiveDataConfig.EArchiveType.Exp, Count = 200}; + {Type = ArchiveDataConfig.EArchiveType.Gold, Count = 100}; + } + }; + [DailyTasksConfig.ETaskType.DefensiveMVP] = { + DailyLimit = 1; + IsDisposable = true; + Reward = { + {Type = ArchiveDataConfig.EArchiveType.Exp, Count = 400}; + {Type = ArchiveDataConfig.EArchiveType.Gold, Count = 200}; + } + }; + [DailyTasksConfig.ETaskType.AttackMVP] = { + DailyLimit = 1; + IsDisposable = true; + Reward = { + {Type = ArchiveDataConfig.EArchiveType.Exp, Count = 400}; + {Type = ArchiveDataConfig.EArchiveType.Gold, Count = 200}; + } + }; + [DailyTasksConfig.ETaskType.LikeOtherPlayerMap] = { + DailyLimit = 10; + IsDisposable = false; + Reward = { + -- {Type = ArchiveDataConfig.EArchiveType.Exp, Count = 10}; + {Type = ArchiveDataConfig.EArchiveType.Gold, Count = 10}; + } + }; + [DailyTasksConfig.ETaskType.KillPlayer] = { + DailyLimit = 20; + IsDisposable = false; + Reward = { + {Type = ArchiveDataConfig.EArchiveType.Exp, Count = 10}; + -- {Type = ArchiveDataConfig.EArchiveType.Gold, Count = 10}; + } + }; +} diff --git a/CounterAttack_Solo/Script/Global/Config/GodOfWarConfig.lua b/CounterAttack_Solo/Script/Global/Config/GodOfWarConfig.lua new file mode 100644 index 00000000..d5923253 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/Config/GodOfWarConfig.lua @@ -0,0 +1,151 @@ +GodOfWarConfig = GodOfWarConfig or {} + +-- 重生保存战神进度,成神死亡后清除 +GodOfWarConfig.RebirthSaveProgress = true + +-- 升级战神给予的Buff +GodOfWarConfig.GodOfWarBuff = BuffAssetConfig.EBuffAssetType.GodOfWar +GodOfWarConfig.GodOfWarBuffName = "无需换弹" +GodOfWarConfig.GodOfWarDesc = "战神:无需换弹;增加50体力上限;被全局标记;" + +-- 成神的击杀条件 +GodOfWarConfig.ToGodCondition = 6 +-- 可选择的增益数量 +GodOfWarConfig.CanSelectIncreaseCount = 5 +-- 增幅类型 +GodOfWarConfig.EIncreaseType = { + + MoveSpeed = 1; + AddDamage = 2; + RespiratoryRecovery = 3; + IncreasedDefense = 4; + Vampirism = 5; + IceBullet = 6; + AddJump = 7; + Mark = 8; + AddMaxHealth = 9; + BulletExplosion = 10; + Tenacious = 11; + Counterattack = 12; + RateOfFire = 13; + Sensing = 14; + + MultiSegmentJump = 15; +} +GodOfWarConfig.IncreaseName = { + [GodOfWarConfig.EIncreaseType.MultiSegmentJump] = "多段跳"; + [GodOfWarConfig.EIncreaseType.MoveSpeed] = "加速"; + [GodOfWarConfig.EIncreaseType.AddDamage] = "增伤"; + [GodOfWarConfig.EIncreaseType.RespiratoryRecovery] = "呼吸恢复"; + [GodOfWarConfig.EIncreaseType.IncreasedDefense] = "防御强化"; + [GodOfWarConfig.EIncreaseType.Vampirism] = "吸取"; + [GodOfWarConfig.EIncreaseType.IceBullet] = "冰冻伤害"; + [GodOfWarConfig.EIncreaseType.AddJump] = "跳跃强化"; + [GodOfWarConfig.EIncreaseType.Mark] = "标记敌人"; + [GodOfWarConfig.EIncreaseType.AddMaxHealth] = "体力上限"; + [GodOfWarConfig.EIncreaseType.BulletExplosion] = "爆炸伤害"; + [GodOfWarConfig.EIncreaseType.Tenacious] = "命不该绝"; + [GodOfWarConfig.EIncreaseType.Counterattack] = "绝地反击"; + [GodOfWarConfig.EIncreaseType.RateOfFire] = "射速"; + [GodOfWarConfig.EIncreaseType.Sensing] = "雷达"; +} + +GodOfWarConfig.IncreaseDesc = { + [GodOfWarConfig.EIncreaseType.MultiSegmentJump] = "多段跳:额外增加1段跳,升级可再增加1段跳。(最佳搭配:跳跃强化)"; + [GodOfWarConfig.EIncreaseType.MoveSpeed] = "加速:增加35%移动速度,升级额外增加30%"; + [GodOfWarConfig.EIncreaseType.AddDamage] = "增伤:增加40%伤害,升级额外增加30%.(最佳搭配:射速强化)"; + [GodOfWarConfig.EIncreaseType.RespiratoryRecovery] = "呼吸恢复:每秒恢复6点体力,受到攻击延迟4秒恢复;升级改为每秒恢复10点,受到攻击延迟1秒恢复"; + [GodOfWarConfig.EIncreaseType.IncreasedDefense] = "防御强化:增加40%防御,升级额外增加30%"; + [GodOfWarConfig.EIncreaseType.Vampirism] = "吸取:吸取受击玩家所受到的伤害70%的体力用来恢复自己,升级后改为提升伤害值50%体力上限(本回合有效)(2级最佳搭配:呼吸恢复 )"; + [GodOfWarConfig.EIncreaseType.IceBullet] = "冰冻伤害:攻击敌方,给予受击玩家冰冻效果(冰冻1秒,最多叠加4秒,被冰冻玩家移速减少50%)"; + [GodOfWarConfig.EIncreaseType.AddJump] = "跳跃强化:增加100%跳跃初速度,升级后额外增加80%"; + [GodOfWarConfig.EIncreaseType.Mark] = "标记敌人:击中敌方玩家时标记其15秒,被标记的敌人暴露位置,且全队可见。升级后额外增加9秒"; + [GodOfWarConfig.EIncreaseType.AddMaxHealth] = "体力上限:增加50点体力上限,升级后额外增加30点。(最佳搭配:呼吸恢复)"; + [GodOfWarConfig.EIncreaseType.BulletExplosion] = "爆炸伤害:爆炸范围2m,中心伤害20, 冷却时间1.5秒。升级后分别调整为(3m范围,30伤害,1秒冷却)"; + [GodOfWarConfig.EIncreaseType.Tenacious] = "命不该绝:受到致命伤时保留30%体力,进入0.8秒无敌时间。升级后保留50%体力,增加0.4秒无敌时间。(最佳搭配:绝地反击)"; + [GodOfWarConfig.EIncreaseType.Counterattack] = "绝地反击:体力百分比越低伤害倍率越高,每失去10%体力增加1档伤害,每档提升15%伤害,上限135%;升级改为每档提升22%,且初始为1档,上限220%"; + [GodOfWarConfig.EIncreaseType.RateOfFire] = "射速强化:增加50%射速,升级额外增加50%.(最佳搭配:增伤)"; + [GodOfWarConfig.EIncreaseType.Sensing] = "雷达感知:可探知距离80m范围内最近的敌人,升级增加60m范围"; +} + +GodOfWarConfig.IncreaseIcon = { + [GodOfWarConfig.EIncreaseType.MultiSegmentJump] = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/Buff/T_AddJumpCount.T_AddJumpCount'); + [GodOfWarConfig.EIncreaseType.MoveSpeed] = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/Buff/T_Speed_128.T_Speed_128'); + [GodOfWarConfig.EIncreaseType.AddDamage] = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/Buff/T_AddDamage.T_AddDamage'); + [GodOfWarConfig.EIncreaseType.RespiratoryRecovery] = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/Buff/T_RespiratoryRecovery.T_RespiratoryRecovery'); + [GodOfWarConfig.EIncreaseType.IncreasedDefense] = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/Buff/T_Defense.T_Defense'); + [GodOfWarConfig.EIncreaseType.Vampirism] = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/Buff/T_Vampirism.T_Vampirism'); + [GodOfWarConfig.EIncreaseType.IceBullet] = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/Buff/T_Ice.T_Ice'); + [GodOfWarConfig.EIncreaseType.AddJump] = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/Buff/T_AddJump.T_AddJump'); + [GodOfWarConfig.EIncreaseType.Mark] = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/Buff/T_Mark.T_Mark'); + [GodOfWarConfig.EIncreaseType.AddMaxHealth] = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/Buff/T_MaxHealth.T_MaxHealth'); + [GodOfWarConfig.EIncreaseType.BulletExplosion] = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/Buff/T_Explosion.T_Explosion'); + [GodOfWarConfig.EIncreaseType.Tenacious] = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/Buff/T_Tenacious.T_Tenacious'); + [GodOfWarConfig.EIncreaseType.Counterattack] = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/Buff/T_Counterattack.T_Counterattack'); + [GodOfWarConfig.EIncreaseType.RateOfFire] = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/Buff/T_RateOfFire.T_RateOfFire'); + [GodOfWarConfig.EIncreaseType.Sensing] = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/Buff/T_Sensing.T_Sensing'); + +} + + +GodOfWarConfig.BuffList = { + [GodOfWarConfig.EIncreaseType.MultiSegmentJump] = { + BuffAssetConfig.EBuffAssetType.JumpStrengthenLv1, + BuffAssetConfig.EBuffAssetType.JumpStrengthenLv2, + }, + [GodOfWarConfig.EIncreaseType.MoveSpeed] = { + BuffAssetConfig.EBuffAssetType.MoveSpeedStrengthenLv1, + BuffAssetConfig.EBuffAssetType.MoveSpeedStrengthenLv2, + }, + [GodOfWarConfig.EIncreaseType.AddDamage] = { + BuffAssetConfig.EBuffAssetType.IncreasedDamageLv1, + BuffAssetConfig.EBuffAssetType.IncreasedDamageLv2, + }, + [GodOfWarConfig.EIncreaseType.RespiratoryRecovery] = { + BuffAssetConfig.EBuffAssetType.RespiratoryRecoveryLv1, + BuffAssetConfig.EBuffAssetType.RespiratoryRecoveryLv2, + }, + [GodOfWarConfig.EIncreaseType.IncreasedDefense] = { + BuffAssetConfig.EBuffAssetType.IncreasedDefenseLv1, + BuffAssetConfig.EBuffAssetType.IncreasedDefenseLv2, + }, + [GodOfWarConfig.EIncreaseType.Vampirism] = { + BuffAssetConfig.EBuffAssetType.VampirismLv1, + BuffAssetConfig.EBuffAssetType.VampirismLv2, + }, + [GodOfWarConfig.EIncreaseType.IceBullet] = { + BuffAssetConfig.EBuffAssetType.BulletIceLv1, + }, + [GodOfWarConfig.EIncreaseType.AddJump] = { + BuffAssetConfig.EBuffAssetType.JumpScaleLv1, + BuffAssetConfig.EBuffAssetType.JumpScaleLv2, + }, + [GodOfWarConfig.EIncreaseType.Mark] = { + BuffAssetConfig.EBuffAssetType.MarkLv1, + BuffAssetConfig.EBuffAssetType.MarkLv2, + }, + [GodOfWarConfig.EIncreaseType.AddMaxHealth] = { + BuffAssetConfig.EBuffAssetType.AddMaxHealthLv1, + BuffAssetConfig.EBuffAssetType.AddMaxHealthLv2, + }, + [GodOfWarConfig.EIncreaseType.BulletExplosion] = { + BuffAssetConfig.EBuffAssetType.BulletExplosionLv1, + BuffAssetConfig.EBuffAssetType.BulletExplosionLv2, + }, + [GodOfWarConfig.EIncreaseType.Tenacious] = { + BuffAssetConfig.EBuffAssetType.TenaciousLv1, + BuffAssetConfig.EBuffAssetType.TenaciousLv2, + }, + [GodOfWarConfig.EIncreaseType.Counterattack] = { + BuffAssetConfig.EBuffAssetType.CounterattackLv1, + BuffAssetConfig.EBuffAssetType.CounterattackLv2, + }, + [GodOfWarConfig.EIncreaseType.RateOfFire] = { + BuffAssetConfig.EBuffAssetType.RateOfFireLv1, + BuffAssetConfig.EBuffAssetType.RateOfFireLv2, + }, + [GodOfWarConfig.EIncreaseType.Sensing] = { + BuffAssetConfig.EBuffAssetType.SensingLv1, + BuffAssetConfig.EBuffAssetType.SensingLv2, + }, +} \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/Config/LevelConfig.lua b/CounterAttack_Solo/Script/Global/Config/LevelConfig.lua new file mode 100644 index 00000000..32e0d37a --- /dev/null +++ b/CounterAttack_Solo/Script/Global/Config/LevelConfig.lua @@ -0,0 +1,33 @@ +LevelConfig = LevelConfig or {} +-- 初始等级为1 +LevelConfig.LevelExp = { + -- 5 + {LevelRange = 4, Exp = 500}; + -- 10 + {LevelRange = 5, Exp = 1000}; + -- 20 + {LevelRange = 10, Exp = 2000}; + -- 30 + {LevelRange = 10, Exp = 3000}; + -- 40 + {LevelRange = 10, Exp = 50000}; + -- 50 + {LevelRange = 60, Exp = 10000}; +} + +--- 获取玩家当前等级 +---@return 当前等级, 当前等级经验, 当前等级升级所需的经验 +function LevelConfig.GetLevel(Exp) + local Level = 1 + for _, LevelExpInfo in pairs(LevelConfig.LevelExp) do + for i = 1, LevelExpInfo.LevelRange do + local TempExp = Exp - LevelExpInfo.Exp + if TempExp >= 0 then + Level = Level + 1 + else + return Level, Exp, LevelExpInfo.Exp + end + Exp = TempExp + end + end +end \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/Config/MapConfig.lua b/CounterAttack_Solo/Script/Global/Config/MapConfig.lua new file mode 100644 index 00000000..db61139f --- /dev/null +++ b/CounterAttack_Solo/Script/Global/Config/MapConfig.lua @@ -0,0 +1,142 @@ +MapConfig = MapConfig or {} + +MapConfig.DefaultMaps = { + --"Map_Default" + "Map_Default2" +} + + +MapConfig.ESpecialModeType = { + Default = 1, --- 默认 + LowGravity = 2, --- 低重力 + HighMovementSpeed = 3, --- 高移速 + Reduce = 4, --- 缩小 + IndividualCompetition = 5, --- 个人竞技 +} + +MapConfig.SpecialModeName = { + [MapConfig.ESpecialModeType.Default] = "", + [MapConfig.ESpecialModeType.LowGravity] = "低重力", + [MapConfig.ESpecialModeType.HighMovementSpeed] = "加速场地", + [MapConfig.ESpecialModeType.Reduce] = "缩小世界", + [MapConfig.ESpecialModeType.IndividualCompetition] = "个人", +} + + + +MapConfig.MapInfo = { + { + ShowName = "G港", + MapName = { "HD_PS" }, + MiniMapInfo = { + MapPath = UGCGameSystem.GetUGCResourcesFullPath('Asset/Level/MiniMap/MiniMap_GG.MiniMap_GG'), + MapCentre = {X=204650.000000,Y=278950.000000,Z=1200.000000}, + MapSize = 40000.0, + MapScale = 30, + CircleIndex = 1, + }, + SpecialModeType = MapConfig.ESpecialModeType.Default, + ProbabilityOfPlaying = 5, + }, + { + ShowName = "军事基地", + MapName = { "HD_PS" }, + MiniMapInfo = { + MapPath = UGCGameSystem.GetUGCResourcesFullPath('Asset/Level/MiniMap/MiniMap_JSJD.MiniMap_JSJD'), + MapCentre = {X=445200.000000,Y=633100.000000,Z=0.000000}, + MapSize = 60000.0, + MapScale = 30., + CircleIndex = 2, + }, + SpecialModeType = MapConfig.ESpecialModeType.Default, + ProbabilityOfPlaying = 6, + }, + { + ShowName = "N港", + MapName = { "HD_PS" }, + MiniMapInfo = { + MapPath = nil, + MapCentre = {X=620900.000000,Y=607950.000000,Z=0.000000}, + MapSize = 28000.0, + MapScale = 20., + CircleIndex = 1, + }, + SpecialModeType = MapConfig.ESpecialModeType.Default, + ProbabilityOfPlaying = 0, + }, + { + ShowName = "监狱", + MapName = { "HD_PS" }, + MiniMapInfo = { + MapPath = UGCGameSystem.GetUGCResourcesFullPath('Asset/Level/MiniMap/MiniMap_JY.MiniMap_JY'), + MapCentre = {X=626700.000000,Y=376450.000000,Z=4550.000000}, + MapSize = 16000.0, + MapScale = 30., + CircleIndex = 2, + }, + SpecialModeType = MapConfig.ESpecialModeType.Default, + ProbabilityOfPlaying = 5, + }, + { + ShowName = "钢铁厂", + MapName = { "HD_PS" }, + MiniMapInfo = { + MapPath = UGCGameSystem.GetUGCResourcesFullPath('Asset/Level/MiniMap/MiniMap_GTC.MiniMap_GTC'), + MapCentre = {X=689750.000000,Y=462650.000000,Z=800.000000}, + MapSize = 16000.0, + MapScale = 30., + CircleIndex = 2, + }, + SpecialModeType = MapConfig.ESpecialModeType.Default, + ProbabilityOfPlaying = 5, + }, + { + ShowName = "水城", + MapName = { "HD_PS" }, + MiniMapInfo = { + MapPath = UGCGameSystem.GetUGCResourcesFullPath('Asset/Level/MiniMap/MiniMap_SCMP.MiniMap_SCMP'), + MapCentre = {X=349092.375000,Y=313596.968750,Z=44.235474}, + MapSize = 20000.0, + MapScale = 30., + CircleIndex = 1, + }, + SpecialModeType = MapConfig.ESpecialModeType.Default, + ProbabilityOfPlaying = 3, + } + +} + + + +MapConfig.SpecialModeFunc = { + [MapConfig.ESpecialModeType.LowGravity] = function(GravityScale) + if GravityScale == nil then GravityScale = 0.3 end + UGCEventSystem.AddListener(EventEnum.PlayerBeginPlay, + function(PlayerPawn) + PlayerPawn:SetGravityScale(GravityScale) + end + ) + end, + [MapConfig.ESpecialModeType.HighMovementSpeed] = function(SpeedScale) + UGCEventSystem.AddListener(EventEnum.PlayerBeginPlay, + function(PlayerPawn) + UGCPawnAttrSystem.SetSpeedScale(PlayerPawn, SpeedScale) + UGCLogSystem.Log("[MapConfig_ESpecialModeType_HighMovementSpeed]") + end + ) + end, + + [MapConfig.ESpecialModeType.Reduce] = function(ScaleValue) + if ScaleValue == nil then ScaleValue = 0.5 end + UGCEventSystem.AddListener(EventEnum.PlayerBeginPlay, + function(PlayerPawn) + UGCEventSystem.SetTimer(UGCGameSystem.GameState, function() + if UE.IsValid(PlayerPawn) then + PlayerPawn:ScalePlayer(ScaleValue) + end + end, 1.) + end + ) + end, + +} diff --git a/CounterAttack_Solo/Script/Global/Config/MechanismConfig.lua b/CounterAttack_Solo/Script/Global/Config/MechanismConfig.lua new file mode 100644 index 00000000..9ab2f182 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/Config/MechanismConfig.lua @@ -0,0 +1,141 @@ +--- +--- Generated by EmmyLua(https://github.com/EmmyLua) +--- Created by LT. +--- DateTime: 2023/11/29 21:37 +--- + +---@class TriggerMechanismType +---@field MechanismWeapon int32 机关武器 +---@field Flamethrower int32 火焰追踪器 +---@field Earthquake int32 地震机关 +---@field Smoke int32 烟雾生成器 +---@field TrackPlayer int32 玩家标记机关 +---@field Boot int32 护罩 + + +---@class MechanismIconInfoItem +---@field Icon string 路径 +---@field Color FLinearColor + + +MechanismConfig = MechanismConfig or {} + +MechanismConfig.bEnableFriendlyInjury = true; +MechanismConfig.MechanismFriendlyInjuryRatio = 0.3; + +MechanismConfig.TriggerMechanismType = { + MechanismWeapon = 10000000, + Flamethrower = 10000001, + Earthquake = 10000002, + Smoke = 10000003, + TrackPlayer = 10000004, + Boot = 10000005, + + +} + +MechanismConfig.GlobalMechanismType = { + RecoveryPool = 20000001, + Trampoline = 20000002, + Portal = 20000003, + MechanismWall = 20000004, +} + +---@type table +MechanismConfig.MechanismTypeName = { + [MechanismConfig.TriggerMechanismType.MechanismWeapon] = "机关武器", + [MechanismConfig.TriggerMechanismType.Flamethrower] = "火焰追踪器", + [MechanismConfig.TriggerMechanismType.Earthquake] = "地震机关", + [MechanismConfig.TriggerMechanismType.Smoke] = "烟雾生成器", + [MechanismConfig.TriggerMechanismType.TrackPlayer] = "玩家标记机关", + [MechanismConfig.TriggerMechanismType.Boot] = "护罩", + + [MechanismConfig.GlobalMechanismType.RecoveryPool] = "恢复池", + [MechanismConfig.GlobalMechanismType.Trampoline] = "蹦床", + [MechanismConfig.GlobalMechanismType.Portal] = "传送门", + [MechanismConfig.GlobalMechanismType.MechanismWall] = "机关墙体", + +} + + + + + +---@type table +MechanismConfig.MechanismIconInfo = { + [MechanismConfig.TriggerMechanismType.Flamethrower] = { + Icon = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/MechanismIcon/T_Fire.T_Fire'), + Color = {R = 1.000000, G = 0.000000, B = 0.000000, A = 1.000000} + }, + [MechanismConfig.TriggerMechanismType.Earthquake] = { + Icon = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/MechanismIcon/T_Earthquake.T_Earthquake'), + Color = {R = 1.000000, G = 0.489736, B = 0.000000, A = 1.000000} + }, + [MechanismConfig.TriggerMechanismType.Smoke] = { + Icon = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/MechanismIcon/T_Smoke.T_Smoke'), + Color = {R = 0.671875, G = 0.671875, B = 0.671875, A = 1.000000} + }, + [MechanismConfig.TriggerMechanismType.TrackPlayer] = { + Icon = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/MechanismIcon/T_Eye.T_Eye'), + Color = {R = 0.148940, G = 0.000000, B = 0.671875, A = 1.000000} + }, + [MechanismConfig.TriggerMechanismType.Boot] = { + Icon = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/MechanismIcon/T_Boot.T_Boot'), + Color = {R = 0.000000, G = 1.000000, B = 1.000000, A = 1.000000} + }, +}; + +---@type table +MechanismConfig.Descs = { + [MechanismConfig.TriggerMechanismType.MechanismWeapon] = "", + [MechanismConfig.TriggerMechanismType.Flamethrower] = "激活机关后会追踪离该机关最近的玩家并造成火焰伤害(对激活方伤害较低),尽快远离或者寻找掩体。", + [MechanismConfig.TriggerMechanismType.Earthquake] = "激活机关会再范围内产生三次地震,每次地震伴有35生命值的伤害以及导致晃动。", + [MechanismConfig.TriggerMechanismType.Smoke] = "激活机关会产生大量烟雾。", + [MechanismConfig.TriggerMechanismType.TrackPlayer] = "激活机关后会在所有敌方玩家头上显示该玩家距自己的距离。", + [MechanismConfig.TriggerMechanismType.Boot] = "激活机关会产生一个单向护罩,在护罩内部可以攻击到外部,但外部无法攻击到内部。且敌方玩家进入护罩后会持续受到伤害。", + + [MechanismConfig.GlobalMechanismType.RecoveryPool] = "玩家站在机关区域内且容器中生命值不为零时,可以快速帮助玩家回血。", + [MechanismConfig.GlobalMechanismType.Trampoline] = "玩家走到机关上时弹射玩家。", + [MechanismConfig.GlobalMechanismType.Portal] = "将玩家传送到另一个传送门附近。", + [MechanismConfig.GlobalMechanismType.MechanismWall] = "玩家走入机关墙体装置时会使墙体显现,玩家离开后延迟隐藏墙体。" +}; + +MechanismConfig.InstImage = { + [MechanismConfig.TriggerMechanismType.Flamethrower] = { + Disable = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/MechanismGuideImage/T_Flamethrower.T_Flamethrower'), + Enable = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/MechanismGuideImage/T_Flamethrower_Open.T_Flamethrower_Open'), + }, + [MechanismConfig.TriggerMechanismType.Earthquake] = { + Disable = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/MechanismGuideImage/T_Earthquake.T_Earthquake'), + Enable = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/MechanismGuideImage/T_Earthquake_Open.T_Earthquake_Open'), + }, + [MechanismConfig.TriggerMechanismType.Smoke] = { + Disable = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/MechanismGuideImage/T_Smoke.T_Smoke'), + Enable = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/MechanismGuideImage/T_Smoke_Open.T_Smoke_Open'), + }, + [MechanismConfig.TriggerMechanismType.TrackPlayer] = { + Disable = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/MechanismGuideImage/T_TrackPlayer.T_TrackPlayer'), + Enable = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/MechanismGuideImage/T_TrackPlayer_Open.T_TrackPlayer_Open'), + }, + [MechanismConfig.TriggerMechanismType.Boot] = { + Disable = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/MechanismGuideImage/T_Boot.T_Boot'), + Enable = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/MechanismGuideImage/T_Boot_Open.T_Boot_Open'), + }, + [MechanismConfig.GlobalMechanismType.RecoveryPool] = { + Enable = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/MechanismGuideImage/T_RecoveryPool.T_RecoveryPool'), + }, + [MechanismConfig.GlobalMechanismType.Trampoline] = { + Enable = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/MechanismGuideImage/T_Trampoline.T_Trampoline'), + }, + [MechanismConfig.GlobalMechanismType.Portal] = { + Enable = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/MechanismGuideImage/T_Portal.T_Portal'), + }, + [MechanismConfig.GlobalMechanismType.MechanismWall] = { + Disable = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/MechanismGuideImage/T_MW_Default.T_MW_Default'), + Enable = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/MechanismGuideImage/T_MW_Open.T_MW_Open') + } +} + +MechanismConfig.Cost = { + +}; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/Config/ParticleConfig.lua b/CounterAttack_Solo/Script/Global/Config/ParticleConfig.lua new file mode 100644 index 00000000..9170b386 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/Config/ParticleConfig.lua @@ -0,0 +1,169 @@ +ParticleConfig = ParticleConfig or {} +ParticleConfig.EParticleType = { + AddBuff = 1; + GodOfWar = 2; + GodOfWarSelf = 3; + Ice = 4; + Explosion = 5; +} +ParticleConfig.ParticleInfoList = { + [ParticleConfig.EParticleType.AddBuff] = { + Path = UGCGameSystem.GetUGCResourcesFullPath('Asset/FX/BuffFx/P_AddBuff2.P_AddBuff2'); + Position = { X = 0, Y = 0, Z = -85 }; + AttachName = ""; + }; + [ParticleConfig.EParticleType.GodOfWar] = { + Path = UGCGameSystem.GetUGCResourcesFullPath('Asset/FX/GodOfWar/P_GodOfWar.P_GodOfWar'); + Position = { X = 0, Y = 0, Z = -85 }; + AttachName = ""; + Rot = {Roll = 0., Pitch = 0., Yaw = -90}; + Scale = 2; + IsFaseToLocalPlayer = true; + IsZeroYaw = true; + }; + [ParticleConfig.EParticleType.GodOfWarSelf] = { + Path = UGCGameSystem.GetUGCResourcesFullPath('Asset/FX/GodOfWar/P_GodOfWar_Self.P_GodOfWar_Self'); + Position = { X = 0, Y = 0, Z = -85 }; + AttachName = ""; + Scale = 2; + IsZeroYaw = true; + }; + [ParticleConfig.EParticleType.Ice] = { + Path = UGCGameSystem.GetUGCResourcesFullPath('Asset/FX/GodOfWar/P_Ice.P_Ice'); + Position = { X = 0, Y = 0, Z = 110 }; + AttachName = ""; + Scale = 1.5; + IsZeroYaw = true; + AttachLocation = EAttachLocation.SnapToTarget; + }; + -- 爆炸 + [ParticleConfig.EParticleType.Explosion] = { + Path = UGCGameSystem.GetUGCResourcesFullPath('Asset/FX/BuffFx/P_Explosion.P_Explosion'); + Scale = 2; + }; + +} + + +ParticleConfig.ParticleInst = {} + +ParticleConfig.ClientPlayParticleFuncName = "ClientPlayParticle" +ParticleConfig.AddParticleAttachPlayerFuncName = "ClientFXAttachPlayer" + + +---@param InAttachActor AActor* 传入进行网络同步的Actor 最好是GameState比较快而且时序上不会出现差错 +function ParticleConfig.Init(InAttachActor) + ParticleConfig.AttachActor = InAttachActor + if UGCGameSystem.IsServer() then + else + InAttachActor[ParticleConfig.ClientPlayParticleFuncName] = function(AttachActor, InParticleType, Pos, Rot, Scale) + ParticleConfig.AddParticleFromPosAndRot(InParticleType, Pos, Rot, Scale) + end + InAttachActor[ParticleConfig.AddParticleAttachPlayerFuncName] = function(AttachActor, InPawn, ParticleType) + ParticleConfig.AddParticleAttachPlayer(InPawn, ParticleType) + end + -- 预加载 + ParticleConfig.PreLoad() + end +end + +---@param Scale float +function ParticleConfig.ClientPlayParticle(InPlayerKey, InParticleType, Pos, Rot, Scale) + if UGCGameSystem.IsServer() then + UGCSendRPCSystem.ActorRPCNotify(InPlayerKey, ParticleConfig.AttachActor, ParticleConfig.ClientPlayParticleFuncName, InParticleType, VectorHelper.ToLuaTable(Pos), VectorHelper.RotToLuaTable(Rot), Scale) + else + ParticleConfig.AddParticleFromPosAndRot(InParticleType, Pos, Rot, Scale) + end +end + +--- 用于服务器调用,发送RPC到客户端播放粒子 +function ParticleConfig.ClientAddParticleAttachPlayer(InPlayerKey, InPawn, ParticleType) + if UGCGameSystem.IsServer() then + UGCSendRPCSystem.ActorRPCNotify(InPlayerKey, ParticleConfig.AttachActor, ParticleConfig.AddParticleAttachPlayerFuncName, InPawn, ParticleType) + else + ParticleConfig.AddParticleAttachPlayer(InPawn, ParticleType) + end +end + +function ParticleConfig.PreLoad() + for ParticleType, ParticleInfo in pairs(ParticleConfig.ParticleInfoList) do + UGCSystemLibrary.AsyncLoadAsset(ParticleInfo.Path, function(Particle) + ParticleConfig.ParticleInst[ParticleType] = Particle + end, nil, true) + end +end + +function ParticleConfig.GetParticleInst(InParticleType) + if ParticleConfig.ParticleInst[InParticleType] == nil then + ParticleConfig.ParticleInst[InParticleType] = UGCSystemLibrary.LoadAsset(ParticleConfig.ParticleInfoList[InParticleType].Path) + end + return ParticleConfig.ParticleInst[InParticleType] +end + +--- 在玩家网格中心生成粒子 +function ParticleConfig.AddParticleAttachPlayer(InPawn, ParticleType) + if UE.IsValid(InPawn) then + local Position = VectorHelper.VectorZero() + local ComposeRotators = VectorHelper.RotZero() + local Rot = InPawn:K2_GetActorRotation() + local Scale = 1 + local AttachLocation = EAttachLocation.SnapToTarget + + if ParticleConfig.ParticleInfoList[ParticleType].Position then + Position = ParticleConfig.ParticleInfoList[ParticleType].Position + end + if ParticleConfig.ParticleInfoList[ParticleType].Scale then + Scale = ParticleConfig.ParticleInfoList[ParticleType].Scale + end + + if ParticleConfig.ParticleInfoList[ParticleType].Rot then + ComposeRotators = ParticleConfig.ParticleInfoList[ParticleType].Rot + end + + if ParticleConfig.ParticleInfoList[ParticleType].AttachLocation then + AttachLocation = ParticleConfig.ParticleInfoList[ParticleType].AttachLocation + end + + if ParticleConfig.ParticleInfoList[ParticleType].IsFaseToLocalPlayer then + local CameraManager = UGCSystemLibrary.GetLocalPlayerController().PlayerCameraManager + local CameraPos = CameraManager:K2_GetActorLocation() + Rot = KismetMathLibrary.MakeRotFromX(VectorHelper.Sub(CameraPos, InPawn:K2_GetActorLocation())) + if ParticleConfig.ParticleInfoList[ParticleType].IsZeroYaw then + Rot.Yaw = 0; + end + end + + + + return GameplayStatics.SpawnEmitterAttached( + ParticleConfig.GetParticleInst(ParticleType), + InPawn.Mesh, + ParticleConfig.ParticleInfoList[ParticleType].AttachName, + Position, + KismetMathLibrary.ComposeRotators(InPawn:K2_GetActorRotation(), ComposeRotators), + { X = Scale, Y = Scale, Z = Scale }, + AttachLocation, + false + ) + end + return nil +end + +function ParticleConfig.AddParticleFromPosAndRot(InParticleType, Pos, Rot, Scale) + if Rot == nil then + Rot = Rotator.New(0, 0, 0) + end + if Scale == nil then + Scale = 1 + end + if ParticleConfig.ParticleInfoList[InParticleType].Scale then + Scale = ParticleConfig.ParticleInfoList[InParticleType].Scale * Scale + end + GameplayStatics.SpawnEmitterAtLocation(UGCGameSystem.GameState, ParticleConfig.GetParticleInst(InParticleType), Pos, Rot, Vector.New(Scale, Scale, Scale), true) +end + +function ParticleConfig.DestroyParticle(InParticleInst) + if UE.IsValid(InParticleInst) then + InParticleInst:K2_DestroyComponent() + end +end diff --git a/CounterAttack_Solo/Script/Global/Config/SecondaryConfirmationConifg.lua b/CounterAttack_Solo/Script/Global/Config/SecondaryConfirmationConifg.lua new file mode 100644 index 00000000..5b20cf87 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/Config/SecondaryConfirmationConifg.lua @@ -0,0 +1,7 @@ +SecondaryConfirmationConfig = SecondaryConfirmationConfig or {} + +SecondaryConfirmationConfig.ESecondaryConfirmationType = { +} + +SecondaryConfirmationConfig.SecondaryConfirmationInfo = { +} \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/Config/SignalCircleConfig.lua b/CounterAttack_Solo/Script/Global/Config/SignalCircleConfig.lua new file mode 100644 index 00000000..52398e20 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/Config/SignalCircleConfig.lua @@ -0,0 +1,148 @@ +SignalCircleConfig = SignalCircleConfig or {} + +-- 实际开始时间为前面所有圈的 delaytime + SafeZoneAppeartime + lasttime +SignalCircleConfig.CircleList = { + [1] = { + { + delaytime = 3; -- 激活该缩圈的延迟时间 + SafeZoneAppeartime = 3; -- 提示即将缩圈的提示存在时间 + lasttime = 4; -- 缩圈的时间 + blueradius = 30000; -- 蓝圈初始的半径,若此圈非初始圈则需要保持和前面的白圈大小一致 + whiteradius = 14000; -- 白圈半径,即蓝圈缩至的大小 + pain = 2; -- 毒圈伤害,这个伤害他们是单独计算的,非血量伤害 + }, + { + delaytime = 0; -- 激活该缩圈的延迟时间 + SafeZoneAppeartime = 30; -- 提示即将缩圈的提示存在时间 + lasttime = 35; -- 缩圈的时间 + blueradius = 14000; -- 蓝圈初始的半径,若此圈非初始圈则需要保持和前面的白圈大小一致 + whiteradius = 8000; -- 白圈半径,即蓝圈缩至的大小 + pain = 2; -- 毒圈伤害,这个伤害他们是单独计算的,非血量伤害 + }, + { + delaytime = 0; -- 激活该缩圈的延迟时间 + SafeZoneAppeartime = 30; -- 提示即将缩圈的提示存在时间 + lasttime = 35; -- 缩圈的时间 + blueradius = 8000; -- 蓝圈初始的半径,若此圈非初始圈则需要保持和前面的白圈大小一致 + whiteradius = 4000; -- 白圈半径,即蓝圈缩至的大小 + pain = 2; -- 毒圈伤害,这个伤害他们是单独计算的,非血量伤害 + }, + { + delaytime = 0; -- 激活该缩圈的延迟时间 + SafeZoneAppeartime = 25; -- 提示即将缩圈的提示存在时间 + lasttime = 15; -- 缩圈的时间 + blueradius = 4000; -- 蓝圈初始的半径,若此圈非初始圈则需要保持和前面的白圈大小一致 + whiteradius = 1; -- 白圈半径,即蓝圈缩至的大小 + pain = 10; -- 毒圈伤害,这个伤害他们是单独计算的,非血量伤害 + }, + }, + [2] = { + { + delaytime = 3; -- 激活该缩圈的延迟时间 + SafeZoneAppeartime = 3; -- 提示即将缩圈的提示存在时间 + lasttime = 4; -- 缩圈的时间 + blueradius = 20000; -- 蓝圈初始的半径,若此圈非初始圈则需要保持和前面的白圈大小一致 + whiteradius = 8000; -- 白圈半径,即蓝圈缩至的大小 + pain = 2; -- 毒圈伤害,这个伤害他们是单独计算的,非血量伤害 + }, + { + delaytime = 0; -- 激活该缩圈的延迟时间 + SafeZoneAppeartime = 30; -- 提示即将缩圈的提示存在时间 + lasttime = 35; -- 缩圈的时间 + blueradius = 8000; -- 蓝圈初始的半径,若此圈非初始圈则需要保持和前面的白圈大小一致 + whiteradius = 4000; -- 白圈半径,即蓝圈缩至的大小 + pain = 2; -- 毒圈伤害,这个伤害他们是单独计算的,非血量伤害 + }, + { + delaytime = 0; -- 激活该缩圈的延迟时间 + SafeZoneAppeartime = 30; -- 提示即将缩圈的提示存在时间 + lasttime = 35; -- 缩圈的时间 + blueradius = 4000; -- 蓝圈初始的半径,若此圈非初始圈则需要保持和前面的白圈大小一致 + whiteradius = 2000; -- 白圈半径,即蓝圈缩至的大小 + pain = 2; -- 毒圈伤害,这个伤害他们是单独计算的,非血量伤害 + }, + { + delaytime = 0; -- 激活该缩圈的延迟时间 + SafeZoneAppeartime = 25; -- 提示即将缩圈的提示存在时间 + lasttime = 15; -- 缩圈的时间 + blueradius = 2000; -- 蓝圈初始的半径,若此圈非初始圈则需要保持和前面的白圈大小一致 + whiteradius = 1; -- 白圈半径,即蓝圈缩至的大小 + pain = 10; -- 毒圈伤害,这个伤害他们是单独计算的,非血量伤害 + }, + } +} + + +--- 注册缩圈信息,必须注册了才能缩圈,不然可能会出现问题 +---@param GMDataSourcePoisonCircleIndex GameMode-DataManager-GMDataManager-DataSources中配置的GMDataSourcePoisonCircle对应的索引,这里会自动+1,所以对应蓝图中的索引即可 +---@param CenterPoint FVector2D 毒圈的中心点位 +---@param RandomCircle bool 是否为随机毒圈 +---@param CircleIndex int 默认为1,使用的毒圈配置的索引,对应CircleList +function SignalCircleConfig.RegisterCircleInfo(GMDataSourcePoisonCircleIndex, CenterPoint, RandomCircle, CircleIndex) + --- 设置参数 + -- 索引 + SignalCircleConfig.SourcesIndex = GMDataSourcePoisonCircleIndex + 1 + -- 中心点 + SignalCircleConfig.CenterPoint = CenterPoint + -- 使用的毒圈配置类型 + SignalCircleConfig.UseCircleIndex = CircleIndex and CircleIndex or 1 + -- 是否为随机毒圈 + SignalCircleConfig.IsRandomCircle = RandomCircle + -- 激活毒圈的次数 + SignalCircleConfig.ActiveCircleCount = 0 +end + +--- 执行缩圈 +--- 若为随机毒圈则这里会自动获取一个新的毒圈 +function SignalCircleConfig.TogglePoisonCircle() + -- 配置一个新毒圈 + SignalCircleConfig.UpdateNewCircleData() + -- 开始缩圈 + UGCBlueprintFunctionLibrary.TogglePoisonCircle(UGCGameSystem.GameState, true); + -- 增加一次使用毒圈的次数 + SignalCircleConfig.ActiveCircleCount = SignalCircleConfig.ActiveCircleCount + 1 +end + +function SignalCircleConfig.UpdateNewCircleData() + -- 如果非随机毒圈且已配置过一次则不再进行配置 + if not SignalCircleConfig.IsRandomCircle and SignalCircleConfig.ActiveCircleCount > 0 then return end + -- 清空毒圈配置 + UGCGameSystem.GameMode.DataManager.DataSources[SignalCircleConfig.SourcesIndex].CircleConfigs:Empty() + -- 配置毒圈 + local CircleCenterPoint = SignalCircleConfig.CenterPoint + for CircleLayer, CircleInfo in pairs(SignalCircleConfig.CircleList[SignalCircleConfig.UseCircleIndex]) do + local NewCirCleCfg = SignalCircleConfig.NewCirCleCfgStruct() + -- 拷贝参数 + for ParamName, ParamVal in pairs(CircleInfo) do + NewCirCleCfg[ParamName] = ParamVal + end + -- 设置使用自定义白圈 + NewCirCleCfg.bUseCustomWhitePoint = true + -- 设置自定义蓝圈 + NewCirCleCfg.bUseCustomBluePoint = true + -- 设置蓝圈中心 + NewCirCleCfg.bluepoint = {X = CircleCenterPoint.X, Y = CircleCenterPoint.Y} + -- 判断是否要对毒圈的中心点进行随机设置 + if SignalCircleConfig.IsRandomCircle and CircleLayer > 1 then + -- 获取可进行随机的偏移 + local RandomDeviation = CircleInfo.blueradius - CircleInfo.whiteradius + + + --local AddRandomX = RandomDeviation * math.random() * 2 - RandomDeviation + --local AddRandomY = RandomDeviation * math.random() * 2 - RandomDeviation + ---- 设置中心偏移 + --CircleCenterPoint = VectorHelper.Add2D(CircleCenterPoint, {X = AddRandomX, Y = AddRandomY} ) + CircleCenterPoint = math.RandomCirclePoint(RandomDeviation, CircleCenterPoint) + + end + -- 设置目标白圈的中心 + NewCirCleCfg.whitepoint = {X = CircleCenterPoint.X, Y = CircleCenterPoint.Y} + UGCLogSystem.LogTree("[SignalCircleConfig_UpdateNewCircleData] NewCirCleCfg:", UE.ToTable(NewCirCleCfg)) + -- 加入GM的毒圈设置 + UGCGameSystem.GameMode.DataManager.DataSources[SignalCircleConfig.SourcesIndex].CircleConfigs:Add(NewCirCleCfg) + end +end + +function SignalCircleConfig.NewCirCleCfgStruct() + return UE.CreateStruct("CirCleCfg") +end \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/Config/SkillConfig.lua b/CounterAttack_Solo/Script/Global/Config/SkillConfig.lua new file mode 100644 index 00000000..f51cd64e --- /dev/null +++ b/CounterAttack_Solo/Script/Global/Config/SkillConfig.lua @@ -0,0 +1,50 @@ +SkillConfig = SkillConfig or {} + +SkillConfig.ESkillType = { + MultiJump = 1; + +} + +-- 玩家的技能冷却 +SkillConfig.PlayerCooling = {} -- {[ESkillType] = {PlayerKey = LastSkillTime}, } +SkillConfig.SkillInfo = { + [SkillConfig.ESkillType.MultiJump] = { + SkillID = 120, + CoolingTime = 0, + OtherEffect = function(PlayerPawn) + end + }, + +} + + +function SkillConfig.ExeSkill(SkillType, InPawn) + if UE.IsValid(InPawn) and InPawn.PlayerKey then + local TargetSkillInfo = SkillConfig.SkillInfo[SkillType] + if TargetSkillInfo then + if SkillConfig.PlayerCooling[SkillType] == nil then + SkillConfig.PlayerCooling[SkillType] = {} + end + local NowTime = UGCSystemLibrary.GetGameTime() + local LastSkillTime = SkillConfig.PlayerCooling[SkillType][InPawn.PlayerKey] + if LastSkillTime == nil or NowTime - LastSkillTime > TargetSkillInfo.CoolingTime then + SkillConfig.PlayerCooling[SkillType][InPawn.PlayerKey] = NowTime + local SkillManager = InPawn:GetSkillManagerComponent() + if SkillManager ~= nil then + SkillManager:TriggerEvent(TargetSkillInfo.SkillID, UTSkillEventType.SET_KEY_DOWN) + if TargetSkillInfo.OtherEffect then + TargetSkillInfo.OtherEffect(InPawn) + end + return true + else + UGCLogSystem.LogError("[SkillConfig_ExeSkill] SkillManager is nil") + end + end + else + UGCLogSystem.LogError("[SkillConfig_ExeSkil] Exe SkillType:%s is Error", tostring(SkillType)) + end + else + UGCLogSystem.LogError("[SkillConfig_ExeSkill] InPawn is nil") + end + return false +end \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/Config/TeamConfig.lua b/CounterAttack_Solo/Script/Global/Config/TeamConfig.lua new file mode 100644 index 00000000..92800dee --- /dev/null +++ b/CounterAttack_Solo/Script/Global/Config/TeamConfig.lua @@ -0,0 +1,25 @@ +--- +--- Generated by EmmyLua(https://github.com/EmmyLua) +--- Created by LT. +--- DateTime: 2023/11/30 19:34 +--- + +TeamConfig = TeamConfig or {} + +TeamConfig.TeamType = { + CT = 1, + T = 2, +} + +TeamConfig.TeamName = { + --[TeamConfig.TeamType.CT] = "CT", + --[TeamConfig.TeamType.T] = "T", + [TeamConfig.TeamType.CT] = "蓝", + [TeamConfig.TeamType.T] = "红", +} + +TeamConfig.TeamColor = { + [TeamConfig.TeamType.CT] = {R=0.000000, G=0.250000, B=1.000000, A=1.000000}, + --[TeamConfig.TeamType.T] = {R=1.000000, G=0.467784, B=0.076185, A=1.000000}, + [TeamConfig.TeamType.T] = {R=1.000000, G=0.057784, B=0.076185, A=1.000000}, +} \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/Config/TipConfig.lua b/CounterAttack_Solo/Script/Global/Config/TipConfig.lua new file mode 100644 index 00000000..d5c1a618 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/Config/TipConfig.lua @@ -0,0 +1,231 @@ +TipConfig = TipConfig or {} + +TipConfig.TipStyleType = { + Tip1 = 1; + Tip2 = 2; + Tip3 = 3; + Tip4 = 4; + Tip5 = 4; + Tip6 = 5; + + + FrontSightTip = 20; + + TipLike = 100; + TipGodOfWarCome = 101; + TipKillingGod = 102; +} + +TipConfig.TipStylePath = { + [TipConfig.TipStyleType.Tip1] = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/Tip/WB_Tip.WB_Tip_C'), + [TipConfig.TipStyleType.Tip2] = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/Tip/WB_Tip_2.WB_Tip_2_C'), + [TipConfig.TipStyleType.Tip3] = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/Tip/WB_Tip_3.WB_Tip_3_C'), + [TipConfig.TipStyleType.Tip4] = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/Tip/WB_Tip_4.WB_Tip_4_C'), + [TipConfig.TipStyleType.Tip5] = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/Tip/WB_Tip_5.WB_Tip_5_C'), + [TipConfig.TipStyleType.Tip6] = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/Tip/WB_Tip_6.WB_Tip_6_C'), + + [TipConfig.TipStyleType.FrontSightTip] = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/Tip/WB_FrontSightTip.WB_FrontSightTip_C'), + + + + + [TipConfig.TipStyleType.TipLike] = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/Tip/WB_Tip_Like.WB_Tip_Like_C'), + [TipConfig.TipStyleType.TipGodOfWarCome] = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/Tip/WB_GodOfWarCome.WB_GodOfWarCome_C'), + [TipConfig.TipStyleType.TipKillingGod] = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/Tip/WB_KillingGod.WB_KillingGod_C'), +} + +TipConfig.TipType = { + GameWillStart = 1, + ImportCodeCallBack = 2; + AddScore = 3; + OneMinuteRemaining = 4, + + IncrementSucceed = 5; -- 增量成功 + UnlockSucceed = 6; -- 解锁成功 + ConsumablesInsufficient = 7; -- 消耗品不足 + PlaceFailure = 8; -- 放置失败 + NeedUnlock = 9; + ExchangeSucceed = 10; -- 兑换成功 + CollectionSuccessful = 11; -- 收藏成功 + PlayerBreakthrough = 12; -- 玩家突破 + + + PlayerLike = 100; -- 玩家点赞 + GodOfWarCome = 101; -- 战神降临 + KillingGod = 102;-- 诛神 + + BeFatedNotToDieOwner = 200; -- 命不该绝触发者 + BeFatedNotToDieCauser = 201; -- 命不该绝伤害者 +} + +TipConfig.TipInfo = { + [TipConfig.TipType.GameWillStart] = { + Text = "游戏即将开始", + Style = TipConfig.TipStyleType.Tip1, + }, + + + + [TipConfig.TipType.ImportCodeCallBack] = { + Text = function(DecodeCallBackType) + if DecodeCallBackType == PlacementModeConfig.EPlaceDecodeCallback.Succeed then + SoundSystem.PlaySound(SoundSystem.ESound.Btn) + return "导入成功" + else + SoundSystem.PlaySound(SoundSystem.ESound.Error) + return "代码错误 code:" .. tostring(DecodeCallBackType) + end + + end, + Style = TipConfig.TipStyleType.Tip3, + }, + [TipConfig.TipType.AddScore] = { + Text = function(AddScoreType) + -- 得分音效 + PlacementModeConfig.AddScoreSound = { + [PlacementModeConfig.AddScoreType.KillAddScore] = SoundSystem.ESound.Kill3; + [PlacementModeConfig.AddScoreType.AssistAddScore] = SoundSystem.ESound.Kill; + [PlacementModeConfig.AddScoreType.DefendSucceedAddScore] = SoundSystem.ESound.PickUpBuff; + [PlacementModeConfig.AddScoreType.EnterDefenseLineAddScore] = SoundSystem.ESound.IsReady; + } + SoundSystem.PlaySound(PlacementModeConfig.AddScoreSound[AddScoreType]) + return tostring(PlacementModeConfig.AddScoreName[AddScoreType]) .. " +" .. tostring(PlacementModeConfig.ScoreVal[AddScoreType]) + end, + Style = TipConfig.TipStyleType.Tip5, + }, + [TipConfig.TipType.OneMinuteRemaining] = { + Text = "游戏剩余1分钟", + Style = TipConfig.TipStyleType.Tip1, + }, + [TipConfig.TipType.IncrementSucceed] = { + Text = "上限增加成功", + Style = TipConfig.TipStyleType.Tip5, + SoundInfo = { SoundType = SoundSystem.ESound.KillFX, DelayActive = 0.2} + }, + [TipConfig.TipType.UnlockSucceed] = { + Text = "解锁成功", + Style = TipConfig.TipStyleType.Tip5, + SoundInfo = { SoundType = SoundSystem.ESound.KillFX, DelayActive = 0.2} + }, + [TipConfig.TipType.ConsumablesInsufficient] = { + Text = function(UnlockType) + local ConsumablesName = PlacementModeConfig.UnlockName[UnlockType] + if ConsumablesName then + return ConsumablesName .. "不足" + else + return "消耗品不足" + end + end, + Style = TipConfig.TipStyleType.Tip3, + SoundInfo = { SoundType = SoundSystem.ESound.Error, DelayActive = 0.2} + }, + [TipConfig.TipType.PlaceFailure] = { + Text = function(PlaceCallbackType) + local PlaceFailureName = PlacementModeConfig.PlaceCallbackName[PlaceCallbackType] + if PlaceFailureName then + return PlaceFailureName + else + return "放置失败" + end + end, + Style = TipConfig.TipStyleType.Tip3, + SoundInfo = { SoundType = SoundSystem.ESound.Error, DelayActive = 0.2} + }, + [TipConfig.TipType.NeedUnlock] = { + Text = "请先解锁", + Style = TipConfig.TipStyleType.Tip3, + SoundInfo = { SoundType = SoundSystem.ESound.Error, DelayActive = 0.2} + }, + [TipConfig.TipType.ExchangeSucceed] = { + Text = "兑换成功", + Style = TipConfig.TipStyleType.Tip5, + SoundInfo = { SoundType = SoundSystem.ESound.KillFX, DelayActive = 0.2} + }, + [TipConfig.TipType.CollectionSuccessful] = { + Text = "收藏成功", + Style = TipConfig.TipStyleType.Tip3, + -- SoundInfo = { SoundType = SoundSystem.ESound.KillFX, DelayActive = 0.2} + }, + [TipConfig.TipType.PlayerBreakthrough] = { + Text = function(PlayerKey) + return tostring(UGCGameSystem.GameState:GetPlayerNameByPlayerKey(PlayerKey)) .. "成功突破" + end, + Style = TipConfig.TipStyleType.Tip6, + -- SoundInfo = { SoundType = SoundSystem.ESound.KillFX, DelayActive = 0.2} + }, + + [TipConfig.TipType.PlayerLike] = { + Text = "", + Style = TipConfig.TipStyleType.TipLike, + }, + [TipConfig.TipType.GodOfWarCome] = { + Text = function(InPlayerKey) + local PlayerName = UGCGameSystem.GameState:GetPlayerNameByPlayerKey(InPlayerKey); + return PlayerName + end, + Style = TipConfig.TipStyleType.TipGodOfWarCome, + }, + [TipConfig.TipType.KillingGod] = { + Text = function(InPlayerKey) + local PlayerName = UGCGameSystem.GameState:GetPlayerNameByPlayerKey(InPlayerKey); + return PlayerName + end, + Style = TipConfig.TipStyleType.TipKillingGod, + }, + + [TipConfig.TipType.BeFatedNotToDieOwner] = { + Text = function (UseCount) + return "命不该绝 × " .. UseCount + end, + Style = TipConfig.TipStyleType.Tip5, + SoundInfo = { SoundType = SoundSystem.ESound.KillFX, DelayActive = 0.2} + }, + [TipConfig.TipType.BeFatedNotToDieCauser] = { + Text = "命不该绝", + Style = TipConfig.TipStyleType.FrontSightTip, + -- SoundInfo = { SoundType = SoundSystem.ESound.KillFX, DelayActive = 0.2} + }, +} + +-- TipConfig.TipStyleType = UUserWidget +TipConfig.TipStyleInst = {} + +--- 使用前需初始化 +function TipConfig.Init(Controller) + if UE.IsValid(Controller) then + for i, v in pairs(TipConfig.TipInfo) do + if TipConfig.TipStyleInst[v.Style] == nil then + TipConfig.TipStyleInst[v.Style] = UserWidget.NewWidgetObjectBP(Controller, UE.LoadClass(TipConfig.TipStylePath[v.Style])) + TipConfig.TipStyleInst[v.Style]:AddToViewport(20000) + end + end + else + UGCLogSystem.LogError("[TipConfig_Init] Controller is not Valid") + end + UGCEventSystem.AddListener(EventEnum.AddTip, TipConfig.AddTip) +end + +---@param TipConfig.TipType +function TipConfig.AddTip(InTipType, ...) + local Info = TipConfig.TipInfo[InTipType] + if Info then + local TempWidgetInst = TipConfig.TipStyleInst[Info.Style] + if Info.SoundInfo then + UGCEventSystem.SetTimer(UGCGameSystem.GameState, function() SoundSystem.PlaySound(Info.SoundInfo.SoundType) end, Info.SoundInfo.DelayActive) + end + if TempWidgetInst then + local TextType = type(Info.Text) + if TextType == "string" then + TempWidgetInst:AddTip(Info.Text) + elseif TextType == "function" then + TempWidgetInst:AddTip(Info.Text(...)) + else + UGCLogSystem.LogError("[TipConfig_AddTip] 提示类型错误 TextType:%s", TextType) + end + else + UGCLogSystem.LogError("[TipConfig_AddTip] 没有生成提示UI") + end + else + UGCLogSystem.LogError("[TipConfig_AddTip] Info is nil. InTipType:%s", tostring(InTipType)) + end +end \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/Config/WeaponSelectionCombinationConfig.lua b/CounterAttack_Solo/Script/Global/Config/WeaponSelectionCombinationConfig.lua new file mode 100644 index 00000000..654c9828 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/Config/WeaponSelectionCombinationConfig.lua @@ -0,0 +1,72 @@ +WeaponSelectionCombinationConfig = WeaponSelectionCombinationConfig or {} +WeaponSelectionCombinationConfig.ECombinationType = { + Combination1 = 1; -- 进攻方武器 + Combination2 = 2; -- 防守方武器 +} +WeaponSelectionCombinationConfig.WeaponCombinationList = { + [WeaponSelectionCombinationConfig.ECombinationType.Combination1] = { + Weapon = {{101004, 102003}, {105010, 105010}, {107008, 102003}, {104005, 103007}, {103003, 101004}}, + OtherParts = { + -- 背包 + {ItemID = 501003, Count = 1}, + -- 各种倍镜 新加法多出的配件加不进去要额外AddItem + {ItemID = 203001, Count = 1}, {ItemID = 203002, Count = 1}, {ItemID = 203003, Count = 1}, {ItemID = 203004, Count = 1}, {ItemID = 203005, Count = 1}, {ItemID = 203014, Count = 1}, {ItemID = 203015, Count = 1}, {ItemID = 203030, Count = 1}, + -- 近战武器、投掷武器等 + {ItemID = 108004, Count = 1}, {ItemID = 602004, Count = 1}, {ItemID = 602003, Count = 1}, {ItemID = 602002, Count = 1}, {ItemID = 602001, Count = 1}, + -- 护具 + {ItemID = 502003, Count = 1}, {ItemID = 503003, Count = 1}, + -- 恢复类药物 + {ItemID = 601006, Count = 1}, {ItemID = 601003, Count = 1}, {ItemID = 601004, Count = 6}, {ItemID = 601005, Count = 1}, + + }, + }; + [WeaponSelectionCombinationConfig.ECombinationType.Combination2] = { + Weapon = {{102005, 101004}, {104004, 103006}, {102003, 103003}, {105002, 104003}}, + OtherParts = {{ItemID = 502003, Count = 1}, {ItemID = 503003, Count = 1}, {ItemID = 602004, Count = 1}, --[[背包 {ItemID = 501003, Count = 1}]]}, + } +} + +-- 各种倍镜 +WeaponSelectionCombinationConfig.MagnifyingGlass = { + {ItemID = 203001, Count = 1}, {ItemID = 203002, Count = 1}, {ItemID = 203003, Count = 1}, {ItemID = 203004, Count = 1}, {ItemID = 203005, Count = 1}, {ItemID = 203014, Count = 1}, {ItemID = 203015, Count = 1}, +} + +-- 玩家可自定义搭配的武器 +WeaponSelectionCombinationConfig.PlayerCustomWeapon = { + [WeaponSelectionCombinationConfig.ECombinationType.Combination1] = { + { + TypeName = "自动枪"; + WeaponIDs = { 101001, 101003, 101004, 101007, 101011, 101012, 101013, 102001, 102002, 102003, 102004, 102005, 102007, 102008, 105001, 105002, 105010, }; + }, + { + TypeName = "狙击"; + WeaponIDs = { 103001, 103002, 103003, 103004, 103005, 103006, 103007, 103008, 103009, 103010, 103011, 103013, 103014, 103100, }; + }, + { + TypeName = "霰弹枪"; + WeaponIDs = { 104001, 104002, 104003, 104004, 104005, 104100, }; + }, + { + TypeName = "特殊枪械"; + WeaponIDs = { 107001, 107008 }; + } + }, + [WeaponSelectionCombinationConfig.ECombinationType.Combination2] = { + { + TypeName = "自动枪"; + WeaponIDs = { 101001, 101003, 101004, 101007, 101011, 101012, 101013, 102001, 102002, 102003, 102004, 102005, 102007, 102008, 105001, 105002, 105010, }; + }, + { + TypeName = "狙击"; + WeaponIDs = { 103001, 103002, 103003, 103004, 103005, 103006, 103007, 103008, 103009, 103010, 103011, 103013, 103014, 103100, }; + }, + { + TypeName = "霰弹枪"; + WeaponIDs = { 104001, 104002, 104003, 104004, 104005, 104100, }; + }, + { + TypeName = "特殊枪械"; + WeaponIDs = { 107001, 107008 }; + } + }, +} diff --git a/CounterAttack_Solo/Script/Global/CustomEnum.lua b/CounterAttack_Solo/Script/Global/CustomEnum.lua new file mode 100644 index 00000000..7e9d15bc --- /dev/null +++ b/CounterAttack_Solo/Script/Global/CustomEnum.lua @@ -0,0 +1,59 @@ +CustomEnum = CustomEnum or {} + +--- 运算优先级 +CustomEnum.EOperationPriority = { + Exp = 1; + MultiOrDiv = 2; + AddOrSub = 3; +} + + + +CustomEnum.ETeamMode = { + PersonalWarfare = 1, -- 个人战 + TeamSports = 2, -- 团队竞技 + BurstMode = 3, -- 爆破 + PartyMode = 4, -- 派对模式 +} + +CustomEnum.EGameState = { + Waiting = 1, + Ready = 2, + Playing = 3, + End = 4, + InsufficientNumberOfPeople = 5, +} + +CustomEnum.EBroadcastType = { + JustText = 0, -- 仅文本播报 + Kill = 1, -- 击杀播报 + Affix = 2, -- 含前后缀文本播报 +} + +CustomEnum.EBroadcastPos = { + Left = 0, -- 左边 + MidUp = 1, -- 中间上方 +} + +CustomEnum.SelectWeapon = { + SelectWeaponType = 0, -- 选择武器类型 + SelectWeapon = 1, -- 选择武器类型 + SelectWeaponProp = 2, -- 选择武器配件 +} + +CustomEnum.Sound = { + ------------------------------------------- + KillPlayer = 1001, -- 击杀 +} + +CustomEnum.KillType = { + Base = 0, -- 常规击杀 + Knife = 1, -- 近战击杀 + Frag = 2, -- 手雷击杀 +} + +CustomEnum.EPassagewayShowType = { + Hide = 1; + Open = 2; + Close = 3; +} diff --git a/CounterAttack_Solo/Script/Global/EventManager/A_IncludeEvent.lua b/CounterAttack_Solo/Script/Global/EventManager/A_IncludeEvent.lua new file mode 100644 index 00000000..1db24213 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/EventManager/A_IncludeEvent.lua @@ -0,0 +1,9 @@ +-- 需要包含的头目录 + +local Prefix = "Script.Global.EventManager." + +require(Prefix .. 'EventConfig') +require(Prefix .. 'EventManager') + + + diff --git a/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_CountdownMode.lua b/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_CountdownMode.lua new file mode 100644 index 00000000..545108e7 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_CountdownMode.lua @@ -0,0 +1,82 @@ + local EventAction_CountdownMode = { + GameTime = 0; + GameEndEvent = -1; +} + +-- 触发器激活时,将执行Action的Execute +function EventAction_CountdownMode:Execute(...) + if not UGCGameSystem.IsServer() then return end + UGCLogSystem.Log("[EventAction_CountdownMode_Execute]") + self.bEnableActionTick = true + -- 设置当前游戏模式 + UGCGameSystem.GameState:SetGameStateType(CustomEnum.EGameState.Playing) + + -- 显示战斗界面UI + UGCGameSystem.GameState:ShowSimplePlayModeUI(WidgetConfig.EUIType.FightPanel) + -- 显示武器选择界面 + local AllPlayerKey = UGCSystemLibrary.GetAllPlayerKeys() + for i, PlayerKey in pairs(AllPlayerKey) do + UGCGameSystem.GameState:ShowPlayerSelectWeaponWidget(PlayerKey) + end + + -- 重置所有玩家 + UGCGameSystem.SendModeCustomEvent("ResetAllPlayers") + -- 重置玩家积分信息 + PlayerScoreSystem.ResetAllPlayerScoreData() + -- 重置和平默认的击杀数 + UGCSystemLibrary.ResetAllPlayerKillsAndAssists() + -- 重置队伍得分 + UGCGameSystem.GameState:ResetTeamScore() + + + + -- 绑定游戏结束事件 + UGCEventSystem.AddListener(EventEnum.GameStateChange, self.GameFinish, self) + + -- 初始化游戏时间 + self.GameStartTime = UGCSystemLibrary.GatRealTimeSeconds() + UGCGameSystem.GameState:SetGameTime(self.GameTime) + + + + UGCLogSystem.Log("[EventAction_CountdownMode_Execute] Finish") + return true +end + +function EventAction_CountdownMode:GameFinish(GameStateType) + UGCLogSystem.Log("[EventAction_CountdownMode_GameFinish]") + if GameStateType == CustomEnum.EGameState.End then + self.bEnableActionTick = false + if self.GameEndEvent then + -- 发送游戏结束事件 + UGCEventSystem.SendEvent(self.GameEndEvent) + else + UGCLogSystem.Log("[EventAction_CountdownMode_GameFinish] GameEndEvent is nil") + end + UGCEventSystem.RemoveListener(EventEnum.GameStateChange, self.GameFinish, self) + end +end + +function EventAction_CountdownMode:Update(DeltaSeconds) + local NowRealTime = UGCSystemLibrary.GatRealTimeSeconds() + local RemainTime = self.GameTime - (NowRealTime - self.GameStartTime); + + -- 更新游戏时间 + if self.LastRemainTime ~= RemainTime then + -- 判断游戏时间是否已结束 + if RemainTime <= 0 then + self.LastRemainTime = 0 + UGCGameSystem.GameState:GameFinish() + else + self.LastRemainTime = RemainTime + end + UGCGameSystem.GameState:SetGameTime(self.LastRemainTime) + end + +end + + + + + +return EventAction_CountdownMode \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_EnableInfBullets.lua b/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_EnableInfBullets.lua new file mode 100644 index 00000000..6f527a31 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_EnableInfBullets.lua @@ -0,0 +1,26 @@ +local EventAction_EnableInfBullets = { +} + +-- 触发器激活时,将执行Action的Execute +function EventAction_EnableInfBullets:Execute(...) + if UGCGameSystem.IsServer() then + UGCEventSystem.SetTimerLoop(UGCGameSystem.GameState, function() + local AllPlayerPawn = UGCGameSystem.GetAllPlayerPawn() + for i, PlayerPawn in pairs(AllPlayerPawn) do + for k, ShootWeaponEnum in pairs(ShootWeaponEnums) do + local Weapon = UGCWeaponManagerSystem.GetWeaponBySlot(PlayerPawn, ShootWeaponEnum) + if UE.IsValid(Weapon) then + UGCGunSystem.EnableClipInfiniteBullets(Weapon, true) + -- Weapon:ForceModifyCurrentBulletNumInClipOnServer(UGCGunSystem.GetMaxBulletNumInOneClip(Weapon)) + end + end + end + end, 0.5 + ) + end + + + return true +end + +return EventAction_EnableInfBullets \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_GameEnd.lua b/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_GameEnd.lua new file mode 100644 index 00000000..b19ea5a0 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_GameEnd.lua @@ -0,0 +1,48 @@ +local EventAction_GameEnd = { + DelayOffDS = 3.; +} + +-- 触发器激活时,将执行Action的Execute +function EventAction_GameEnd:Execute(...) + if UGCGameSystem.IsServer() then + -- 显示结束界面UI + UGCGameSystem.GameState:ShowSimplePlayModeUI(WidgetConfig.EUIType.Settlement) + -- 发送结束协议等关闭操作 + self:SendUGCModeBattleResult() + else + + end + return true +end + +-- 结算、关闭DS +function EventAction_GameEnd:SendUGCModeBattleResult() + UGCLogSystem.Log("[EventAction_GameEnd_SendUGCModeBattleResult]") + -- 保存成就数据 + UGCEventSystem.SendEvent(EventEnum.AchievementSettlement) + -- 向所有玩家发送结束协议 + local AllPC = UGCGameSystem.GetAllPlayerController() + for _, PC in pairs(AllPC) do + if PC then + UGCGameSystem.SendPlayerSettlement(PC.PlayerKey); + UGCLogSystem.Log("[EventAction_GameEnd_SendUGCModeBattleResult] SendPlayerSettlement %s", tostring(PC.PlayerKey)) + else + UGCLogSystem.LogError("[EventAction_GameEnd_SendUGCModeBattleResult] PC is nil !") + end + end + + -- 延迟关闭DS + UGCEventSystem.SetTimer( + UGCGameSystem.GameState, + function() + UGCGameSystem.SendModeCustomEvent("GameEndAgreement") + UGCLogSystem.Log("[EventAction_GameEnd_SendUGCModeBattleResult] Close DS Finsh") + end, + self.DelayOffDS + ) + + +end + + +return EventAction_GameEnd \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_Play.lua b/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_Play.lua new file mode 100644 index 00000000..fbfa3c94 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_Play.lua @@ -0,0 +1,154 @@ + local EventAction_Play = { + GameTime = 0; + GameEndEvent = -1; +} + +-- 触发器激活时,将执行Action的Execute +function EventAction_Play:Execute(...) + if not UGCGameSystem.IsServer() then return end + self.bEnableActionTick = true + -- 设置当前游戏模式 + UGCGameSystem.GameState:SetGameStateType(CustomEnum.EGameState.Playing) + + -- 重置所有玩家 位置及游戏得分信息等 + + local AllPawn = UGCGameSystem.GetAllPlayerPawn() + for _, PlayerPawn in pairs(AllPawn) do + if UE.IsValid(PlayerPawn) then + if PlayerPawn.PlayerKey then + UGCLogSystem.Log("[EventAction_Play_Execute] DestroyPlayer:%s", tostring(PlayerPawn.PlayerKey)) + else + UGCLogSystem.LogError("[EventAction_Play_Execute] PlayerKey is nil. ObjName:%s", KismetSystemLibrary.GetObjectName(PlayerPawn)) + end + PlayerPawn:K2_DestroyActor() + end + end + local TempPlayerControllers = UGCGameSystem.GetAllPlayerController() + for _,PlayerController in pairs(TempPlayerControllers) do + -- if UE.IsValid(PlayerController.Pawn) then PlayerController.Pawn:K2_DestroyActor() end + UGCGameSystem.GetRespawnComponent():AddRespawnPlayer(PlayerController.PlayerKey, 0) + -- UGCGameSystem.RespawnPlayer(PlayerController.PlayerKey) + --UGCGameSystem.RespawnPlayer(self.PlayerKey) + UGCLogSystem.Log("[EventAction_Play_Execute] ResSpawnSucceed Key: %d", PlayerController.PlayerKey) + end + -- 更新得分信息 + UGCGameSystem.GameState:UpdateAllPlayerScoreDatas() + + -- 重置梯度等级 + UGCGameSystem.GameState:ResetAllPlayerGrade() + + -- 重置队伍得分 + UGCGameSystem.GameState:ResetTeamScore() + + -- 绑定游戏结束事件 + UGCEventSystem.AddListener(EventEnum.GameStateChange, self.GameFinish, self) + + -- 初始化游戏时间 + self.GameStartTime = UGCSystemLibrary.GetGameTime(); + self.LastUpdateRemainTime = self.GameTime + self.LastCheckGameEndTime = self.GameTime + UGCGameSystem.GameState:SetGameTime(self.GameTime) + + -- 重置击杀数 + local AllPS = UGCGameSystem.GetAllPlayerState() + for i, PS in pairs(AllPS) do + PS.Kills =0; + PS.KillPlayerNum = 0, + DOREPONCE(PS,"Kills") + DOREPONCE(PS,"KillPlayerNum") + end + + UGCLogSystem.Log("[EventAction_Play_Execute] Finish") + return true +end + +function EventAction_Play:GameFinish(GameStateType) + if GameStateType == CustomEnum.EGameState.End then + self.bEnableActionTick = false + if self.GameEndEvent then + -- 发送游戏结束事件 + UGCEventSystem.SendEvent(self.GameEndEvent) + else + UGCLogSystem.Log("[EventAction_Play_GameFinish] GameEndEvent is nil") + end + UGCEventSystem.RemoveListener(EventEnum.GameStateChange, self.GameFinish, self) + end +end + +function EventAction_Play:Update(DeltaSeconds) + local CurrentRealTime = UGCSystemLibrary.GetGameTime(); + local RemainTime = self.GameTime - (CurrentRealTime - self.GameStartTime); + local CurrentUpdateRemainTime = math.ceil(RemainTime) + + -- 更新游戏时间 + if self.LastUpdateRemainTime - CurrentUpdateRemainTime >= 1 then + -- 判断游戏时间是否已结束 + if CurrentUpdateRemainTime <= 0 then + self.LastUpdateRemainTime = 0 + UGCGameSystem.GameState:GameFinish() + else + self.LastUpdateRemainTime = CurrentUpdateRemainTime + end + UGCGameSystem.GameState:SetGameTime(self.LastUpdateRemainTime) + -- UGCLogSystem.Log("[EventAction_Play_Update] WaitTime: %d", self.LastUpdateRemainTime) + end + + -- 检测游戏完整性 + if self.LastCheckGameEndTime - CurrentUpdateRemainTime >= 5 then + self.LastCheckGameEndTime = CurrentUpdateRemainTime + UGCLogSystem.Log("[EventAction_Play_Update]") + if self:CheckGameEnd() then + UGCGameSystem.GameState:GameFinish() + end + UGCLogSystem.Log("[EventAction_Play_Update] Finish") + end +end + +--- 检查玩法人数是否足够 +function EventAction_Play:CheckGameEnd() + + local PlayerNum = #UGCGameSystem.GetAllPlayerController() + if PlayerNum == 0 then + return true + end + + local TeamModeType = GlobalConfigs.GameModeSetting.TeamModeType + if TeamModeType == CustomEnum.ETeamMode.PersonalWarfare then + if PlayerNum <= 1 then + return true + end + elseif TeamModeType == CustomEnum.ETeamMode.PartyMode then + return false + elseif TeamModeType == CustomEnum.ETeamMode.TeamSports or TeamModeType == CustomEnum.ETeamMode.BurstMode then + local TeamIDs = UGCTeamSystem.GetTeamIDs() + if #TeamIDs <= 1 then + return true + end + local Team1Player = UGCTeamSystem.GetPlayerKeysByTeamID(1) + local Team2Player = UGCTeamSystem.GetPlayerKeysByTeamID(2) + local Team1HasPlayer, Team2HasPlayer = false, false + for i, v in pairs(Team1Player) do + if UGCGameSystem.GetPlayerControllerByPlayerKey(v) then + Team1HasPlayer = true + break + end + end + if not Team1HasPlayer then + return true + end + for i, v in pairs(Team2Player) do + if UGCGameSystem.GetPlayerControllerByPlayerKey(v) then + Team2HasPlayer = true + break + end + end + if not Team2HasPlayer then + return true + end + end + return false +end + + + +return EventAction_Play \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_PlayerDeadUpdateInfo.lua b/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_PlayerDeadUpdateInfo.lua new file mode 100644 index 00000000..32395182 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_PlayerDeadUpdateInfo.lua @@ -0,0 +1,44 @@ +local EventAction_PlayerDeadUpdateInfo = { + DeadPlayerKey = -1; + KillerPlayerKey = -1; + WeaponID = -1; +} +-- 触发器激活时,将执行Action的Execute +function EventAction_PlayerDeadUpdateInfo:Execute(...) + if not UGCGameSystem.IsServer() then return end + + UGCLogSystem.Log("[EventAction_PlayerDeadUpdateInfo_Execute] DeadPlayerKey:%s, KillerPlayerKey:%s", tostring(self.DeadPlayerKey), tostring(self.KillerPlayerKey)) + + -- 判断是否在游戏 + if UGCGameSystem.GameState.GameStateType ~= CustomEnum.EGameState.Playing and UGCGameSystem.GameState.GameStateType ~= CustomEnum.EGameState.Waiting then + return true + end + + -- 击杀队友不计算得分 + if UGCPlayerStateSystem.GetTeamID(self.DeadPlayerKey) == UGCPlayerStateSystem.GetTeamID(self.KillerPlayerKey) then + return true + end + + if self.DeadPlayerKey ~= self.KillerPlayerKey and self.KillerPlayerKey > 0 then + -- 增加击杀得分 + PlayerScoreSystem.AddPlayerScoreData(self.KillerPlayerKey, PlayerScoreSystem.Config.EScoreType.Kills, 1) + -- 额外得分逻辑 + self:OtherKillSucceedLogic() + end + -- 更新死亡玩家信息 + self:UpdateDeadPlayerLogic() + -- 记录死亡数 + PlayerScoreSystem.AddPlayerScoreData(self.DeadPlayerKey, PlayerScoreSystem.Config.EScoreType.Deaths, 1) + + return true +end + +function EventAction_PlayerDeadUpdateInfo:OtherKillSucceedLogic() + +end + +function EventAction_PlayerDeadUpdateInfo:UpdateDeadPlayerLogic() + +end + +return EventAction_PlayerDeadUpdateInfo \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_PlayerExit.lua b/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_PlayerExit.lua new file mode 100644 index 00000000..d75bdc5c --- /dev/null +++ b/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_PlayerExit.lua @@ -0,0 +1,94 @@ +local EventAction_PlayerExit = { + PlayerKey = 0; + EndEvent = -1; +} + +-- 触发器激活时,将执行Action的Execute +function EventAction_PlayerExit:Execute(...) + if not UGCGameSystem.IsServer() then return end + UGCLogSystem.Log("[EventAction_PlayerExit_Execute] PlayerKey:%s", tostring(self.PlayerKey)) + + if UGCGameSystem.GameState then + local PlayerName = UGCGameSystem.GameState:GetPlayerNameByPlayerKey(self.PlayerKey) + UGCGameSystem.GameState:SetPlayerIsAlive(self.PlayerKey, nil) + UGCLogSystem.Log("[EventAction_PlayerExit_Execute] PlayerName = ".. PlayerName) + end + + UGCGameSystem.SendPlayerSettlement(self.PlayerKey); + + local PlayerState = UGCGameSystem.GetPlayerStateByPlayerKey(self.PlayerKey) + local PlayerPawn = UGCGameSystem.GetPlayerPawnByPlayerKey(self.PlayerKey) + + if PlayerPawn then + PlayerPawn:K2_DestroyActor() + else + UGCLogSystem.LogError("[EventAction_PlayerExit_Execute] PlayerPawn is nil") + --local AllPawn = UGCGameSystem.GetAllPlayerPawn() + --local HasNotControlled = false + --for k, Pawn in pairs(AllPawn) do + -- if not Pawn:IsControlled() then + -- Pawn:K2_DestroyActor() + -- HasNotControlled = true + -- end + --end + --if HasNotControlled == false then UGCLogSystem.LogError("[EventAction_PlayerExit_Execute] HasNotControlled is false") end + end + + + + + --if self:CheckGameEnd() then + -- UGCGameSystem.GameState:SetGameStateType(CustomEnum.EGameState.End) + --end + --UGCEventSystem.SendEvent(EventEnum.PlayerExit, self.PlayerKey) + return true +end + +--function EventAction_PlayerExit:CheckGameEnd() +-- +-- if UGCGameSystem.GameState:GetGameStateType() == CustomEnum.EGameState.Playing then +-- local PlayerNum = #UGCGameSystem.GetAllPlayerController() +-- if PlayerNum == 0 then +-- return true +-- end +-- +-- local TeamModeType = GlobalConfigs.GameModeSetting.TeamModeType +-- if TeamModeType == CustomEnum.ETeamMode.PersonalWarfare then +-- if PlayerNum <= 1 then +-- return true +-- end +-- elseif TeamModeType == CustomEnum.ETeamMode.PartyMode then +-- return false +-- elseif TeamModeType == CustomEnum.ETeamMode.TeamSports or TeamModeType == CustomEnum.ETeamMode.BurstMode then +-- local TeamIDs = UGCTeamSystem.GetTeamIDs() +-- if #TeamIDs <= 1 then +-- return true +-- end +-- local Team1Player = UGCTeamSystem.GetPlayerKeysByTeamID(1) +-- local Team2Player = UGCTeamSystem.GetPlayerKeysByTeamID(2) +-- local Team1HasPlayer, Team2HasPlayer = false, false +-- for i, v in pairs(Team1Player) do +-- if UGCGameSystem.GetPlayerControllerByPlayerKey(v) then +-- Team1HasPlayer = true +-- break +-- end +-- end +-- if not Team1HasPlayer then +-- return true +-- end +-- for i, v in pairs(Team2Player) do +-- if UGCGameSystem.GetPlayerControllerByPlayerKey(v) then +-- Team2HasPlayer = true +-- break +-- end +-- end +-- if not Team2HasPlayer then +-- return true +-- end +-- end +-- end +-- return false +--end + + +return EventAction_PlayerExit \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_PlayerLogin.lua b/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_PlayerLogin.lua new file mode 100644 index 00000000..5f75b66d --- /dev/null +++ b/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_PlayerLogin.lua @@ -0,0 +1,11 @@ +local EventAction_PlayerLogin = { + PlayerKey = 0; +} + +-- 触发器激活时,将执行Action的Execute +function EventAction_PlayerLogin:Execute(...) + UGCLogSystem.Log("[EventAction_PlayerLogin_Execute] PlayerKey:%s", tostring(self.PlayerKey)) + return true +end + +return EventAction_PlayerLogin \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_PlayerPossessed.lua b/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_PlayerPossessed.lua new file mode 100644 index 00000000..5b0b6755 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_PlayerPossessed.lua @@ -0,0 +1,56 @@ +local EventAction_PlayerPossessed = { + -- 可配置参数定义,参数将显示在Action配置面板 + -- 例: + -- MyIntParameter = 0 + PlayerKey = -1; +} + +-- 触发器激活时,将执行Action的Execute +function EventAction_PlayerPossessed:Execute(...) + if UGCGameSystem.IsServer() then + --UGCLogSystem.Log("[EventAction_PlayerPossessed_Execute]1 PlayerKey:%s", tostring(self.PlayerKey)) + --local PlayerPawn = UGCGameSystem.GetPlayerPawnByPlayerKey(self.PlayerKey) + --UGCPawnSystem.SetIsInvincible(PlayerPawn, true) + --UGCEventSystem.SetTimer(UGCGameSystem.GameState, + -- function() + -- PlayerPawn = UGCGameSystem.GetPlayerPawnByPlayerKey(self.PlayerKey) + -- if PlayerPawn then + -- --UGCLogSystem.Log("[EventAction_PlayerPossessed_Execute]3 PlayerKey:%s", tostring(self.PlayerKey)) + -- UGCPawnSystem.SetIsInvincible(PlayerPawn, false) + -- end + -- end, + -- GlobalConfigs.GameSetting.InvincibleTime + --) + + --UGCLogSystem.Log("[EventAction_PlayerPossessed_Execute]2 PlayerKey:%s", tostring(self.PlayerKey)) + --UGCEventSystem.SetTimer(UGCGameSystem.GameState, + -- function() + -- if UGCGameSystem.GameState:GetGameStateType() == CustomEnum.EGameState.Playing then + -- --- 给予玩家出生装备 + -- PlayerPawn = UGCGameSystem.GetPlayerPawnByPlayerKey(self.PlayerKey) + -- if PlayerPawn then + -- for _, ItemData in pairs(GlobalConfigs.GameSetting.BeBornItems) do + -- UGCBackPackSystem.AddItem(PlayerPawn, ItemData.ItemID, ItemData.Count) + -- end + -- end + -- end + -- + -- end, + -- 0.1 + --) + end + + + + return true +end + +--[[ +-- 需要勾选Action的EnableTick,才会执行Update +-- 触发器激活后,将在每个tick执行Action的Update,直到self.bEnableActionTick为false +function EventAction_PlayerPossessed:Update(DeltaSeconds) + +end +]] + +return EventAction_PlayerPossessed \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_PlayerReSpawn.lua b/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_PlayerReSpawn.lua new file mode 100644 index 00000000..9811ec36 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_PlayerReSpawn.lua @@ -0,0 +1,20 @@ +local EventAction_PlayerReSpawn = { + PlayerKey = -1; + DelayTime = 3. +} + +-- 触发器激活时,将执行Action的Execute +function EventAction_PlayerReSpawn:Execute(...) + local GameStateType = UGCGameSystem.GameState:GetGameStateType() + if UGCGameSystem.IsServer() then + UGCLogSystem.Log("[EventAction_PlayerReSpawn_Execute] PlayerKey:%s", tostring(self.PlayerKey)) + UGCEventSystem.SetTimer(UGCGameSystem.GameState, function() + -- if GameStateType == UGCGameSystem.GameState:GetGameStateType() then + UGCGameSystem.GetRespawnComponent():AddRespawnPlayer(self.PlayerKey, 0) + -- end + end, self.DelayTime) + end + return true +end + +return EventAction_PlayerReSpawn \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_RespiratoryRegurgitation.lua b/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_RespiratoryRegurgitation.lua new file mode 100644 index 00000000..967df18b --- /dev/null +++ b/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_RespiratoryRegurgitation.lua @@ -0,0 +1,47 @@ +local EventAction_RespiratoryRegurgitation = { + AddHealthFrequency = 5; + ReplyPerSecond = 10.; + WaitAddHealthTime = 3.; + PlayerVictimTime = {}; + UpdateAddTime = 0; +} + +-- 触发器激活时,将执行Action的Execute +function EventAction_RespiratoryRegurgitation:Execute(...) + UGCEventSystem.AddListener(EventEnum.PlayerInjuryInfo, self.PlayerInjuryInfo, self) + + UGCLogSystem.Log("[EventAction_RespiratoryRegurgitation_Execute]") + + self.bEnableActionTick = true + return true +end + + +function EventAction_RespiratoryRegurgitation:Update(DeltaSeconds) + UGCLogSystem.Log("[EventAction_RespiratoryRegurgitation_Update]") + self.UpdateAddTime = self.UpdateAddTime + DeltaSeconds + if self.UpdateAddTime >= (1. / self.AddHealthFrequency) then + self.UpdateAddTime = self.UpdateAddTime - 1. / self.AddHealthFrequency + self:AddPlayerHealth() + end +end + +function EventAction_RespiratoryRegurgitation:PlayerInjuryInfo(VictimKey) + self.PlayerVictimTime[VictimKey] = UGCSystemLibrary.GetGameTime() + UGCLogSystem.Log("[EventAction_RespiratoryRegurgitation_PlayerInjuryInfo]") +end + +function EventAction_RespiratoryRegurgitation:AddPlayerHealth() + local AllPlayer = UGCGameSystem.GameState:GetRespiratoryRegurgitationPlayers() + local NowTime = UGCSystemLibrary.GetGameTime() + for k, PlayerKey in pairs(AllPlayer) do + local PlayerPawn = UGCGameSystem.GetPlayerPawnByPlayerKey(PlayerKey) + if UE.IsValid(PlayerPawn) and PlayerKey and PlayerPawn:IsAlive() + and (self.PlayerVictimTime[PlayerKey] == nil or (NowTime - self.PlayerVictimTime[PlayerKey] >= self.WaitAddHealthTime)) then + UGCPawnAttrSystem.SetHealth(PlayerPawn, UGCPawnAttrSystem.GetHealth(PlayerPawn) + self.ReplyPerSecond / self.AddHealthFrequency) + end + end +end + + +return EventAction_RespiratoryRegurgitation \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_RoundBegin.lua b/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_RoundBegin.lua new file mode 100644 index 00000000..0c8947e2 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_RoundBegin.lua @@ -0,0 +1,222 @@ +local EventAction_RoundBegin = { + GameTime = 0; + --- 准备阶段时间 + PreparationTime = 0; + GameEndEvent = -1; +} + +-- 触发器激活时,将执行Action的Execute +function EventAction_RoundBegin:Execute(...) + if not UGCGameSystem.IsServer() then return end + self.DoOnceEnableMove = false + -- 初始化游戏时间 + self.GameTimeInst = self.GameTime + math.max(self.PreparationTime, 0) + + -- 新回合 + UGCGameSystem.GameState:AddNewRound() + -- 显示战斗界面 + UGCGameSystem.GameState:ShowSimplePlayModeUI(WidgetConfig.EUIType.FightPanel) + -- 设置当前游戏模式 + UGCGameSystem.GameState:SetGameStateType(CustomEnum.EGameState.Playing) + + -- 清空死亡盒子、可拾取物、投掷物 + UGCSystemLibrary.RemoveActorFromClassName("PlayerTombBox") + UGCSystemLibrary.RemoveActorFromClassName("PickUpWrapperActor") + UGCSystemLibrary.RemoveActorFromClassName("EliteProjectile") + + + + -- 设置准备阶段参数 + if self.PreparationTime > 0 then + --UGCGameSystem.GameState:SetIsPreparationTime(true) + --- 存在准备阶段 + -- 设置所有玩家不可移动 + if not GlobalConfigs.GameSetting.ReadyCanMove then + UGCSystemLibrary.SetAllPlayerIsMovable(false) + end + else + --- 不存在准备阶段 + self.DoOnceEnableMove = true + end + + -- 玩法逻辑 + self:ExecuteOtherLogic() + + + -- 重置所有玩家,需要放在所有逻辑最后边 + self:RespawnAllPlayers() + + self.bEnableActionTick = true + UGCLogSystem.Log("[EventAction_RoundBegin_Execute] Finish") + return true +end + +function EventAction_RoundBegin:RespawnAllPlayers() + UGCLogSystem.Log("[EventAction_RoundBegin_RespawnAllPlayers]") + --UGCGameSystem.SendModeCustomEvent("ResetAllPlayers") + local AllPK = UGCSystemLibrary.GetAllPlayerKeys() + for i, PlayerKey in pairs(AllPK) do + UGCSystemLibrary.RespawnPlayer(PlayerKey) + end +end + +function EventAction_RoundBegin:RoundFinish() + self.bEnableActionTick = false + + self:RoundFinishOtherLogic() + if self.GameEndEvent then + -- 发送回合结束事件 + UGCEventSystem.SendEvent(self.GameEndEvent) + end + +end + +function EventAction_RoundBegin:Update(DeltaSeconds) + if not self.bEnableActionTick then + return + end + + self.GameTimeInst = self.GameTimeInst - DeltaSeconds + + -- 判断准备阶段是否结束 + if self.GameTimeInst <= self.GameTime and not self.DoOnceEnableMove then + self.DoOnceEnableMove = true + self:EndOfPreparationTime() + end + + -- 设置游戏时间 + UGCGameSystem.GameState:SetGameTime(math.clamp(math.floor(self.GameTimeInst), 0, self.GameTime + self.PreparationTime)) + + if self.GameTimeInst <= 0 then + self:RoundFinish() + end + self:UpdateOtherLogic(DeltaSeconds) +end + +function EventAction_RoundBegin:EndOfPreparationTime() + --UGCGameSystem.GameState:SetIsPreparationTime(false) + local AllPCs = UGCGameSystem.GetAllPlayerController() + --for i, v in pairs(AllPCs) do + -- v:UpdatePlayerBackPack() + --end + UGCLogSystem.Log("[EventAction_RoundBegin_EndOfPreparationTime]") + if not GlobalConfigs.GameSetting.ReadyCanMove then + UGCSystemLibrary.SetAllPlayerIsMovable(true) + end + -- 发送准备时间结束到客户端 + UGCSendRPCSystem.RPCEvent(nil, EventEnum.RoundReadyFinish) + self:OtherEndOfPreparationTimeLogic() +end + +--根据工程的修改而改变的逻辑 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + +-- 根据工程的修改而改变的开始执行逻辑 +function EventAction_RoundBegin:ExecuteOtherLogic() + + -- 判断玩家是否死亡 + local AllPC = UGCGameSystem.GetAllPlayerController() + for i, PC in pairs(AllPC) do + if not UE.IsValid(PC.Pawn) or not PC.Pawn:IsAlive() then + UGCGameSystem.RespawnPlayer(PC.PlayerKey) + end + -- 新增一个增益 + PC:AddCanObtainIncreaseCount() + local MaxScore = UGCGameSystem.GameState:GetMaxTeamScore() + if MaxScore == GlobalConfigs.GameSetting.MaxRound // 2 then + -- 赛点额外增加一个增益 + PC:AddCanObtainIncreaseCount() + end + end + + -- 绑定玩家死亡 + UGCEventSystem.AddListener(EventEnum.PlayerDeathInfo, self.PlayerDeath, self) + + -- 切换玩家出生点 + + -- 开始缩圈 + -- UGCBlueprintFunctionLibrary.TogglePoisonCircle(UGCGameSystem.GameState, true); + SignalCircleConfig.TogglePoisonCircle() + + -- 重置载具 + UGCLogSystem.Log("[EventAction_RoundBegin_ExecuteOtherLogic] ResetAllSavedVehicle") + MyVehicleSystem.ResetAllSavedVehicle() + +end + +-- 根据工程的修改而改变的准备阶段结束逻辑 +function EventAction_RoundBegin:OtherEndOfPreparationTimeLogic() + UGCLogSystem.Log("[EventAction_RoundBegin_OtherEndOfPreparationTimeLogic]") + +end + +-- 根据工程的修改而改变的Tick逻辑 +function EventAction_RoundBegin:UpdateOtherLogic(DeltaSeconds) + + -- 每2秒检测一方玩家是否已全部阵亡 + self.CheckTeamPlayerLastTime = self.CheckTeamPlayerLastTime and self.CheckTeamPlayerLastTime + DeltaSeconds or 0 + if self.CheckTeamPlayerLastTime > 2 then + self.CheckTeamPlayerLastTime = 0 + self.CheckTeamPlayerLastTime = self.CheckTeamPlayerLastTime + DeltaSeconds + self:CheckTeamPlayer() + end +end + +-- 根据工程的修改而改变的结束逻辑 +function EventAction_RoundBegin:RoundFinishOtherLogic() + -- 移除绑定玩家死亡,判断是否有胜利方 + UGCEventSystem.RemoveListener(EventEnum.PlayerDeathInfo, self.PlayerDeath, self) + + -- 销毁载具 + MyVehicleSystem.DestroyAllSavedVehicle() + -- 增加回合胜利玩家的得分 + +end + +-- 有玩家死亡 +function EventAction_RoundBegin:PlayerDeath(PlayerKey) + UGCLogSystem.Log("[EventAction_RoundBegin_PlayerDeath]") + -- 判断是否有胜利方 + self:CheckTeamPlayer() + local PC = UGCGameSystem.GetPlayerControllerByPlayerKey(PlayerKey) + if UE.IsValid(PC) then + UGCLogSystem.Log("[EventAction_RoundBegin_PlayerDeath] 观战") + -- 让观战自己的队友观战别人 + UGCGameSystem.MyObserversChangeTarget(PC) + --进入观战 + UGCGameSystem.EnterSpectating(PC) + end +end + +-- 检测一方玩家是否已全部阵亡 +function EventAction_RoundBegin:CheckTeamPlayer() + local CTTeamAlive, TTeamAlive = false, false + local CTPlayers = UGCTeamSystem.GetPlayerKeysByTeamID(TeamConfig.TeamType.CT) + local TPlayers = UGCTeamSystem.GetPlayerKeysByTeamID(TeamConfig.TeamType.T) + for i, v in pairs(CTPlayers) do + local TempPawn = UGCGameSystem.GetPlayerPawnByPlayerKey(v) + if TempPawn and TempPawn:IsAlive() then + CTTeamAlive = true + break + end + end + for i, v in pairs(TPlayers) do + local TempPawn = UGCGameSystem.GetPlayerPawnByPlayerKey(v) + if TempPawn and TempPawn:IsAlive() then + TTeamAlive = true + break + end + end + if CTTeamAlive == false then + UGCGameSystem.GameState:SetWinningTeam(TeamConfig.TeamType.T) + self:RoundFinish() + elseif TTeamAlive == false then + UGCGameSystem.GameState:SetWinningTeam(TeamConfig.TeamType.CT) + self:RoundFinish() + end +end + + + + + +return EventAction_RoundBegin \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_RoundEnd.lua b/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_RoundEnd.lua new file mode 100644 index 00000000..cc5b822a --- /dev/null +++ b/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_RoundEnd.lua @@ -0,0 +1,88 @@ +local EventAction_RoundEnd = { + GameTime = 0; + GameEndEvent = -1; + NewRoundEvent = -1 +} + +-- 触发器激活时,将执行Action的Execute +function EventAction_RoundEnd:Execute(...) + if not UGCGameSystem.IsServer() then return end + UGCLogSystem.Log("[EventAction_RoundEnd_Execute]") + self.GameTimeInst = self.GameTime + -- 设置无敌状态 + local AllPawn = UGCGameSystem.GetAllPlayerPawn() + for i, v in pairs(AllPawn) do + UGCPawnSystem.SetIsInvincible(v, true) + end + + self:ExecuteOtherLogic() + + self.bEnableActionTick = true + return true +end + +function EventAction_RoundEnd:GameFinish() + self.bEnableActionTick = false + self:OtherGameFinishLogic() + -- 判断游戏是否结束 + if self:CheckGameEnd() then + UGCGameSystem.GameState:GameFinish() + -- 发送游戏结束事件 + UGCEventSystem.SendEvent(self.GameEndEvent) + else + -- 触发新的回合事件 + UGCEventSystem.SendEvent(self.NewRoundEvent) + end +end + +function EventAction_RoundEnd:Update(DeltaSeconds) + self.GameTimeInst = self.GameTimeInst - DeltaSeconds + if self.GameTimeInst <= 0 then + self:GameFinish() + end +end + +--- 判断玩法是否结束 根据玩法进行修改 +function EventAction_RoundEnd:CheckGameEnd() + local MaxScore = UGCGameSystem.GameState:GetMaxTeamScore() + UGCLogSystem.Log("[EventAction_RoundEnd_CheckGameEnd] MaxScore:%s", tostring(MaxScore)) + return UGCGameSystem.GameState:IsFinishRound() + or MaxScore > GlobalConfigs.GameSetting.MaxRound // 2 + or #UGCTeamSystem.GetPlayerKeysByTeamID(1) < 1 or #UGCTeamSystem.GetPlayerKeysByTeamID(2) < 1 +end + +--其他逻辑可修改替换 ------------------------ +function EventAction_RoundEnd:ExecuteOtherLogic() + local AllPC = UGCGameSystem.GetAllPlayerController() + for i, PC in pairs(AllPC) do + UGCGameSystem.LeaveSpectating(PC) + end + local AllPawn = UGCGameSystem.GetAllPlayerPawn() + for i, v in pairs(AllPawn) do + UGCPawnSystem.DisabledPawnState(v, EPawnState.GunFire, true) + end + --local IsAttackSucceed = UGCGameSystem.GameState:IsBreakThroughSucceed() + -- 显示回合结束界面UI + UGCSendRPCSystem.ClientShowUI(nil, WidgetConfig.EUIType.RoundFinish, true, false, UGCGameSystem.GameState:GetWinningTeam()) + --UGCGameSystem.GameState:ShowSimplePlayModeUI(WidgetConfig.EUIType.RoundFinish, { UGCGameSystem.GameState:GetWinningTeam(),}) +end + +function EventAction_RoundEnd:OtherGameFinishLogic() + -- 调换出生点 + if GlobalConfigs.GameSetting.ActiveChangeTeam then + if UGCGameSystem.GameState:GetRoundCount() == GlobalConfigs.GameSetting.MaxRound // 2 then + local AllPC = UGCGameSystem.GetAllPlayerController() + for i, PC in pairs(AllPC) do + if PC:GetStartPointType() == EPlayerStartType.Team1 then + PC:SetStartPointType(EPlayerStartType.Team2) + else + PC:SetStartPointType(EPlayerStartType.Team1) + end + end + end + end +end + + + +return EventAction_RoundEnd \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_TargetTeamScoringMode.lua b/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_TargetTeamScoringMode.lua new file mode 100644 index 00000000..7a641025 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_TargetTeamScoringMode.lua @@ -0,0 +1,104 @@ + local EventAction_TargetTeamScoringMode = { + GameTime = 0; + GameEndEvent = -1; +} + +-- 触发器激活时,将执行Action的Execute +function EventAction_TargetTeamScoringMode:Execute(...) + if not UGCGameSystem.IsServer() then return end + UGCLogSystem.Log("[EventAction_TargetTeamScoringMode_Execute]") + self.bEnableActionTick = true + -- 设置当前游戏模式 + UGCGameSystem.GameState:SetGameStateType(CustomEnum.EGameState.Playing) + + -- 显示战斗界面UI + UGCGameSystem.GameState:ShowSimplePlayModeUI(WidgetConfig.EUIType.FightPanel) + -- 显示武器选择界面 + local AllPlayerKey = UGCSystemLibrary.GetAllPlayerKeys() + for i, PlayerKey in pairs(AllPlayerKey) do + UGCGameSystem.GameState:ShowPlayerSelectWeaponWidget(PlayerKey) + end + + -- 重置所有玩家 + UGCGameSystem.SendModeCustomEvent("ResetAllPlayers") + -- 重置玩家积分信息 + PlayerScoreSystem.ResetAllPlayerScoreData() + -- 重置和平默认的击杀数 + UGCSystemLibrary.ResetAllPlayerKillsAndAssists() + -- 重置队伍得分 + UGCGameSystem.GameState:ResetTeamScore() + + + + -- 绑定游戏结束事件 + UGCEventSystem.AddListener(EventEnum.GameStateChange, self.GameFinish, self) + -- 绑定队伍得分刷新 + UGCEventSystem.AddListener(EventEnum.UpdateTeamScore, self.UpdateTeamScore, self) + + -- 初始化游戏时间 + self.GameStartTime = UGCSystemLibrary.GatRealTimeSeconds() + UGCGameSystem.GameState:SetGameTime(self.GameTime) + + + -- 其他额外逻辑 + self:ExecuteOtherLogic() + + UGCLogSystem.Log("[EventAction_TargetTeamScoringMode_Execute] Finish") + return true +end + +function EventAction_TargetTeamScoringMode:GameFinish(GameStateType) + UGCLogSystem.Log("[EventAction_TargetTeamScoringMode_GameFinish]") + if GameStateType == CustomEnum.EGameState.End then + self.bEnableActionTick = false + if self.GameEndEvent then + -- 发送游戏结束事件 + UGCEventSystem.SendEvent(self.GameEndEvent) + else + UGCLogSystem.Log("[EventAction_TargetTeamScoringMode_GameFinish] GameEndEvent is nil") + end + UGCEventSystem.RemoveListener(EventEnum.GameStateChange, self.GameFinish, self) + UGCEventSystem.RemoveListener(EventEnum.UpdateTeamScore, self.UpdateTeamScore, self) + end +end + +function EventAction_TargetTeamScoringMode:Update(DeltaSeconds) + local NowRealTime = UGCSystemLibrary.GatRealTimeSeconds() + local RemainTime = self.GameTime - (NowRealTime - self.GameStartTime); + + -- 更新游戏时间 + if self.LastRemainTime ~= RemainTime then + -- 判断游戏时间是否已结束 + if RemainTime <= 0 then + self.LastRemainTime = 0 + UGCGameSystem.GameState:GameFinish() + else + self.LastRemainTime = RemainTime + end + UGCGameSystem.GameState:SetGameTime(self.LastRemainTime) + end + +end + +function EventAction_TargetTeamScoringMode:UpdateTeamScore() + if UGCGameSystem.GameState:GetGameStateType() == CustomEnum.EGameState.Playing then + local MaxTeamScore = UGCGameSystem.GameState:GetMaxTeamScore() + UGCLogSystem.Log("[EventAction_TargetTeamScoringMode_UpdateTeamScore]MaxTeamScore:%s", tostring(MaxTeamScore)) + if MaxTeamScore >= GlobalConfigs.GameSetting.TargetTeamScore then + UGCGameSystem.GameState:GameFinish() + end + end +end + +function EventAction_TargetTeamScoringMode:ExecuteOtherLogic() + local AllPC = UGCGameSystem.GetAllPlayerController() + for i, v in pairs(AllPC) do + v:SetOwnedIncrease({}) + v:SetToGodSchedule(0) + v:SetCanObtainIncreaseCount(0) + v:SetNowCanSelectIncrease({}) + end +end + + +return EventAction_TargetTeamScoringMode \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_WaitingPlayer.lua b/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_WaitingPlayer.lua new file mode 100644 index 00000000..36fbe060 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/EventManager/EventAction/EventAction_WaitingPlayer.lua @@ -0,0 +1,156 @@ +local EventAction_WaitingPlayer = { + -- 最大等待时间 + WaitTime = 30; + WaitFinishEvent = 0; + WaitFailureEvent = 0; + -- 至少等待的时间 + AtLeastWaitingTime = 5; + -- 即将开始的提示 + GameWillBeginWaitTime = 5; +} + +-- 触发器激活时,将执行Action的Execute +function EventAction_WaitingPlayer:Execute(...) + if not UGCGameSystem.IsServer() then return end + + UGCGameSystem.GameState:SetGameStateType(CustomEnum.EGameState.Waiting) + + -- 显示等待界面UI + UGCGameSystem.GameState:ShowSimplePlayModeUI(WidgetConfig.EUIType.WaitingTime) + -- 随机加载关卡 + self:AsyncLoadRandomMap() + + -- 其他逻辑 + self:OtherExecuteLogic() + + self.DoOnceGameWillBegin = true; + self.JoinedPlayerNum = 0 + + self.bEnableActionTick = true + return true +end + + +function EventAction_WaitingPlayer:Update(DeltaSeconds) + self.WaitTime = self.WaitTime - DeltaSeconds + -- 判断是否要发送游戏即将开始提示 + if self.WaitTime <= self.GameWillBeginWaitTime and not self.DoOnceNotifyWillBegin then + self.DoOnceNotifyWillBegin = true + UGCSendRPCSystem.RPCEvent(nil, EventEnum.GameWillBegin) + end + + -- 获取玩家数量 + self.JoinedPlayerNum = #UGCGameSystem.GetAllPlayerController() + + -- 判断玩家数是否满足 + if self.JoinedPlayerNum >= GlobalConfigs.GameModeSetting.MaxPlayerNum then + self.WaitTime = math.min(self.AtLeastWaitingTime, self.WaitTime) + end + + if self.WaitTime <= 0 then + self.WaitTime = 0 + self:WaitPlayJoinFinish(self.JoinedPlayerNum >= GlobalConfigs.GameModeSetting.MinPlayerNum) + end + + -- 更新时间 + UGCGameSystem.GameState:SetGameTime(math.floor(self.WaitTime)) +end + + +function EventAction_WaitingPlayer:WaitPlayJoinFinish(bWaitSucceed) + self.bEnableActionTick = false + self:OtherFinishLogic() + if bWaitSucceed then + UGCEventSystem.SendEvent(self.WaitFinishEvent) + else + UGCGameSystem.GameState:SetGameStateType(CustomEnum.EGameState.InsufficientNumberOfPeople) + UGCEventSystem.SendEvent(self.WaitFailureEvent) + end +end + +function EventAction_WaitingPlayer:AsyncLoadRandomMap() + + local MapIndex = 1 + local ProbabilityOfPlayingList = {} + for i, v in pairs(MapConfig.MapInfo) do + ProbabilityOfPlayingList[i] = v.ProbabilityOfPlaying + end + MapIndex = UGCSystemLibrary.RandomIndex(ProbabilityOfPlayingList) + UGCGameSystem.GameState:SetMapKey(MapIndex) + + local MapNameList = MapConfig.MapInfo[MapIndex].MapName + UGCLogSystem.Log("[EventAction_WaitingPlayer_AsyncLoadMapFromType] MapIndex:%s, LoadMapIndex:%s, MapName:%s", tostring(MapIndex), tostring(MapIndex), MapName) + + local SpecialModeType = MapConfig.MapInfo[MapIndex].SpecialModeType + if SpecialModeType and MapConfig.SpecialModeFunc[SpecialModeType] then + MapConfig.SpecialModeFunc[SpecialModeType](MapConfig.MapInfo[MapIndex].SpecialModeParam) + end + + self.MapIndex = MapIndex + + UGCSendRPCSystem.RPCEvent(nil, EventEnum.LoadMap, MapIndex) + LevelStreamUtil.LoadStreamLevels(MapNameList, {Object = self, Func = self.LoadMapFinish}, false); +end + +function EventAction_WaitingPlayer:LoadMapFinish() + UGCLogSystem.Log("[EventAction_WaitingPlayer_LoadMapFinish]") + -- 刷新出生点 + UGCEventSystem.SendEvent(EventEnum.UpdatePlayerStartList) + -- 重置所有玩家 + UGCGameSystem.SendModeCustomEvent("ResetAllPlayer") + -- 其他逻辑 + self:OtherLoadMapFinishLogic() +end + +-- 其他逻辑 -------------------------------------------------------------------------------------------- + +function EventAction_WaitingPlayer:OtherExecuteLogic() + UGCLogSystem.Log("[EventAction_WaitingPlayer_OtherExecuteLogic]") + --self.MapIndex = 1 + --local ProbabilityOfPlayingList = {} + --for i, v in pairs(MapConfig.MapInfo) do + -- ProbabilityOfPlayingList[i] = v.ProbabilityOfPlaying + --end + --self.MapIndex = UGCSystemLibrary.RandomIndex(ProbabilityOfPlayingList) + --UGCGameSystem.GameState:SetMapKey(self.MapIndex) + --local MiniMapInfo = MapConfig.MapInfo[self.MapIndex].MiniMapInfo + --local MapCentre = MiniMapInfo.MapCentre + ---- 注册毒圈信息 + --SignalCircleConfig.RegisterCircleInfo(6, {X = MapCentre.X, Y = MapCentre.Y}, true, MiniMapInfo.CircleIndex) + ---- 延迟重置玩家 + --UGCEventSystem.SetTimer(UGCGameSystem.GameState, function() + -- UGCEventSystem.SendEvent(EventEnum.UpdatePlayerStartList) + -- UGCGameSystem.SendModeCustomEvent("ResetAllPlayers") + -- UGCLogSystem.Log("[EventAction_WaitingPlayer_OtherExecuteLogic] Succeed") + -- -- 保存载具信息 + -- MyVehicleSystem.SaveAllVehicleTF(self.MapIndex) + -- -- MyVehicleSystem.DestroyAllSavedVehicle() + --end, 2) + UGCLogSystem.Log("[EventAction_WaitingPlayer_OtherExecuteLogic] Finish") +end + +function EventAction_WaitingPlayer:OtherLoadMapFinishLogic() + local MapInfo = MapConfig.MapInfo[self.MapIndex].MiniMapInfo + local MapCentre = MapInfo.MapCentre + -- 注册毒圈信息 + SignalCircleConfig.RegisterCircleInfo(6, {X = MapCentre.X, Y = MapCentre.Y}, true, MapInfo.CircleIndex) + -- 保存载具信息 + MyVehicleSystem.SaveAllVehicleTF(self.MapIndex) +end + +function EventAction_WaitingPlayer:OtherFinishLogic() + -- 刷新出生点 + UGCEventSystem.SendEvent(EventEnum.UpdatePlayerStartList) + + -- 显示武器选择界面 + --local AllPlayerKey = UGCSystemLibrary.GetAllPlayerKeys() + --for i, PlayerKey in pairs(AllPlayerKey) do + -- UGCGameSystem.GameState:ShowPlayerSelectWeaponWidget(PlayerKey) + --end + UGCSendRPCSystem.ClientShowUI(nil, WidgetConfig.EUIType.WeaponSelect) + +end + +-- 其他逻辑 -------------------------------------------------------------------------------------------- + +return EventAction_WaitingPlayer \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/EventManager/EventConfig.lua b/CounterAttack_Solo/Script/Global/EventManager/EventConfig.lua new file mode 100644 index 00000000..f9a38d01 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/EventManager/EventConfig.lua @@ -0,0 +1,312 @@ +EventConfig = EventConfig or {} + +--- Action Tick的频率 +EventConfig.TickFrequency = 24. + + + +EventEnum = { + + -- DefaultEvent + DSStartUp = 1001, -- 服务器启动 + PlayerLogin = 1003, -- 玩家加入房间 PlayerKey + PlayerExit = 1004, -- 玩家离开房间 PlayerKey + + -- GameState + GameStateChange = 2001, -- 游戏模式改变 CustomEnum.EGameState + WaitPlayerJoin = 2002, -- 等待玩家加入 + GamePlay = 2003, -- 游戏开始 + GameEnd = 2004, -- 游戏结束 + RoundBegin = 2005, -- 回合开始 + RoundEnd = 2006, -- 回合结束 + RoundReadyFinish = 2007, -- 回合准备阶段结束 + NewRound = 2008, -- 回合数改变 + + -- PlayerEvent + PlayerDeathInfo = 3001, -- 死亡信息 VictimKey, CauserKey, WeaponID, DamageType, IsHeadShotDamage, Distance, DamageValue uint, uint, int, int, bool, float, float + PlayerInjuryInfo = 3002, -- 受伤信息 VictimKey, CauserKey, WeaponID, DamageType, IsHeadShotDamage, Distance, DamageValue uint, uint, int, int, bool, float, float + PlayerPossessed = 3003, -- 玩家受控 PlayerKey + PlayerBeginPlay = 3004, -- 玩家受控 PlayerPawn + BulletHitCallBack = 3005, -- 玩家射出的子弹命中物体或玩家的回调 (PlayerPawn:UGCPlayerPawn, ShootWeapon:ASTExtraShootWeapon,Bullet:ASTExtraShootWeaponBulletBase,HitInfo:FHitResult) + PlayerTeamChange = 3006, -- 玩家的队伍改变 PC, TeamID + + -- PlayerPawn同步参数更新 更新传入Pawn及其同步变量值 + UpdateCanObtainIncreaseCount = 4001, + UpdateNowCanSelectIncrease = 4002, + UpdateOwnedIncrease = 4003, + UpdateToGodSchedule = 4004, + + -- PlayerEvent End + + + UpdatePlayerStartList = 10001, -- 通知出生点控制器进行更新出生点指针 + AchievementSettlement = 10002, -- 成就事件游戏结算 + UpdateTeamScore = 10003, -- 队伍得分信息更新 + UpdatePlayerScoreData = 10004, -- 玩家得分信息更新 通过UGCGameSystem.GameState.PlayerScoreDatas 获取玩家得分信息 + AddTip = 10005, -- 添加提提示 TipStr TipType + GameWillBegin = 10006, -- 游戏即将开始 + PlayerIsAliveIsChange = 10007, -- 玩家存活列表改变 + UpdatePlayerInfo = 10008, -- 玩家个人信息更新 + ResetPlayerTransformToPlayerStart = 10009, -- 通知出生点控制器刷新玩家位置,而非重生 InPC InPawn + + + PlayerWeaponCombinationUpdate = 11001, -- 玩家可选的武器配置列表更新 [PlayerKey] = CombinationType + PlayerSelectedWeaponIndexUpdate = 11002, -- 玩家选择的武器配置索引更新 [PlayerKey] = Index + + + --- SelectMap + LoadMap = 20001, -- 关卡加载 MapConifg.MapType + SelectMapCallBack = 20002, -- 地图选择服务器的回调 bSucceed, MapType + SelectDefaultWeaponCallBack = 20003, -- 默认武器选择回调 bSucceed, WeaponID + RandomSelectVoteMap = 20004, + UpdateMapKey = 20005, -- 随机出的地图索引 MapKey + + + +} + +--- 模式编辑器的默认事件映射 +EventConfig.GameModeEditEventMap = { + ["DSStartUp"] = EventEnum.DSStartUp, + ["PlayerLogin"] = EventEnum.PlayerLogin, + ["PlayerExit"] = EventEnum.PlayerExit, +} + + +--- 事件包含的的参数名 +EventConfig.EventParam = { + --[[ + Template + [EventEnum.] = {"PlayerKey",}, + ]] + + [EventEnum.DSStartUp] = {}, + + [EventEnum.PlayerLogin] = {"PlayerPawn", "PlayerKey"}, + [EventEnum.PlayerExit] = {"PlayerPawn", "PlayerKey"}, + + [EventEnum.GameStateChange] = {"GameState"}, + [EventEnum.WaitPlayerJoin] = {}, + [EventEnum.GamePlay] = {}, + [EventEnum.GameEnd] = {}, + [EventEnum.RoundBegin] = {}, + [EventEnum.RoundEnd] = {}, + + + [EventEnum.PlayerDeathInfo] = {"VictimKey", "CauserKey", "WeaponID", "DamageType", "IsHeadShotDamage", "Distance", "DamageValue"}, + [EventEnum.PlayerInjuryInfo] = {"VictimKey", "CauserKey", "WeaponID", "DamageType", "IsHeadShotDamage", "Distance", "DamageValue"}, + + [EventEnum.PlayerPossessed] = {"PlayerKey",}, + +} + + +EventConfig.ActionType = { + ---Player + PlayerLogin = 1001, + PlayerExit = 1002, + PlayerDeadUpdateInfo = 1003, + PlayerRespawn = 1004, + + PlayerAddEnergy = 1005, + PlayerPossessed = 1006, + + EnableInfBullets = 1007, + + ---GameState + WaitPlayerJoin = 2001, + GamePlay = 2002, + GameEnd = 2003, + RoundBegin = 2004, + RoundEnd = 2005, + + CountdownMode = 2101, -- 倒计时模式 + TargetTeamScoringMode = 2102, -- 队伍目标得分模式 + + RespiratoryRegurgitation= 3001, -- 呼吸回血 + + TestPlaceMap = 10001, + +} + + +--- Action 配置游戏模式的默认参数,该参数会被传入参数可被覆盖(传入参数有效才会覆盖),不填则使用Action中的默认参数或被传入参数覆盖 +EventConfig.ActionInfo = { + -- Player + [EventConfig.ActionType.PlayerLogin] = { + ActionPath = "Script.Global.EventManager.EventAction.EventAction_PlayerLogin", + ActionParam = { + PlayerKey = -1, + }, + }, + [EventConfig.ActionType.PlayerExit] = { + ActionPath = "Script.Global.EventManager.EventAction.EventAction_PlayerExit", + ActionParam = { + PlayerKey = -1, + -- 玩家不足以支持游戏时触发的游戏结束事件 + EndEvent = EventEnum.GameEnd, + }, + }, + [EventConfig.ActionType.PlayerRespawn] = { + ActionPath = "Script.Global.EventManager.EventAction.EventAction_PlayerRespawn", + ActionParam = { + PlayerKey = -1, + -- 复活等待的时间 + DelayTime = 3., + }, + }, + [EventConfig.ActionType.PlayerDeadUpdateInfo] = { + ActionPath = "Script.Global.EventManager.EventAction.EventAction_PlayerDeadUpdateInfo", + ActionParam = { + DeadPlayerKey = -1, + KillerPlayerKey = -1, + WeaponID = -1, + }, + }, + [EventConfig.ActionType.PlayerPossessed] = { + ActionPath = "Script.Global.EventManager.EventAction.EventAction_PlayerPossessed", + ActionParam = { + }, + }, + [EventConfig.ActionType.EnableInfBullets] = { + ActionPath = "Script.Global.EventManager.EventAction.EventAction_EnableInfBullets", + ActionParam = { + }, + }, + + + -- GameState + [EventConfig.ActionType.WaitPlayerJoin] = { + ActionPath = "Script.Global.EventManager.EventAction.EventAction_WaitingPlayer", + ActionParam = { + -- 等待玩家加入的时长 + WaitTime = GlobalConfigs.GameSetting.WaitTime, + -- 等待结束触发的事件 + WaitFinishEvent = EventEnum.GamePlay, + -- 等待结束玩家不足时触发的事件 + WaitFailureEvent = EventEnum.GameEnd, + -- 至少等待时长 + AtLeastWaitingTime = 10, + -- 游戏即将开始提示的时间 + GameWillBeginWaitTime = 10, + }, + }, + [EventConfig.ActionType.GamePlay] = { + ActionPath = "Script.Global.EventManager.EventAction.EventAction_Play", + ActionParam = { + -- 游戏游玩时长 + GameTime = GlobalConfigs.GameSetting.GameTime, + -- 游戏结束事件 + GameEndEvent = EventEnum.GameEnd, + }, + }, + [EventConfig.ActionType.GameEnd] = { + ActionPath = "Script.Global.EventManager.EventAction.EventAction_GameEnd", + ActionParam = { + -- 延迟关闭DS时间 + DelayOffDS = 30.; + }, + }, + + + [EventConfig.ActionType.RoundBegin] = { + ActionPath = "Script.Global.EventManager.EventAction.EventAction_RoundBegin", + ActionParam = { + GameTime = GlobalConfigs.GameSetting.RoundTime; + PreparationTime = GlobalConfigs.GameSetting.RoundReadyTime; + GameEndEvent = EventEnum.RoundEnd; + }, + }, + [EventConfig.ActionType.RoundEnd] = { + ActionPath = "Script.Global.EventManager.EventAction.EventAction_RoundEnd", + ActionParam = { + GameTime = 8; + GameEndEvent = EventEnum.GameEnd; + NewRoundEvent = EventEnum.RoundBegin; + }, + }, + + [EventConfig.ActionType.CountdownMode] = { + ActionPath = "Script.Global.EventManager.EventAction.EventAction_CountdownMode", + ActionParam = { + -- 游戏游玩时长 + GameTime = GlobalConfigs.GameSetting.GameTime, + GameEndEvent = EventEnum.GameEnd; + }, + }, + [EventConfig.ActionType.TargetTeamScoringMode] = { + ActionPath = "Script.Global.EventManager.EventAction.EventAction_TargetTeamScoringMode", + ActionParam = { + -- 游戏游玩时长 + GameTime = GlobalConfigs.GameSetting.GameTime, + GameEndEvent = EventEnum.GameEnd; + }, + }, + + + [EventConfig.ActionType.RespiratoryRegurgitation] = { + ActionPath = "Script.Global.EventManager.EventAction.EventAction_RespiratoryRegurgitation", + ActionParam = { + }, + }, + + +} + +--- 事件绑定Action 参数映射 [EventParamName] = "ActionParamName" +EventConfig.EventAttach = { + [EventEnum.DSStartUp] = { + [EventConfig.ActionType.WaitPlayerJoin] = {}, + [EventConfig.ActionType.EnableInfBullets] = {}, + -- [EventConfig.ActionType.RespiratoryRegurgitation] = {}, + }, + [EventEnum.GamePlay] = { + -- [EventConfig.ActionType.CountdownMode] = {}, + [EventConfig.ActionType.RoundBegin] = {}, + }, + [EventEnum.GameEnd] = { + [EventConfig.ActionType.GameEnd] = {}, + }, + [EventEnum.PlayerLogin] = { + [EventConfig.ActionType.PlayerLogin] = { + ["PlayerKey"] = "PlayerKey" + } + }, + [EventEnum.PlayerExit] = { + [EventConfig.ActionType.PlayerExit] = { + ["PlayerKey"] = "PlayerKey" + } + }, + [EventEnum.PlayerDeathInfo] = { + --[EventConfig.ActionType.PlayerRespawn] = { + -- ["VictimKey"] = "PlayerKey" + --}, + [EventConfig.ActionType.PlayerDeadUpdateInfo] = { + ["VictimKey"] = "DeadPlayerKey", + ["CauserKey"] = "KillerPlayerKey", + ["WeaponID"] = "WeaponID", + } + + }, + + [EventEnum.PlayerPossessed] = { + [EventConfig.ActionType.PlayerPossessed] = { + ["PlayerKey"] = "PlayerKey" + } + }, + + + [EventEnum.RoundBegin] = { + [EventConfig.ActionType.RoundBegin] = {}; + }, + [EventEnum.RoundEnd] = { + [EventConfig.ActionType.RoundEnd] = {}; + }, +} + +function EventConfig.CheckEventAttach(EventType) + return ( + EventConfig.EventParam[EventType] ~= nil + and table.getCount(EventConfig.EventAttach[EventType]) > 0 + ) +end diff --git a/CounterAttack_Solo/Script/Global/EventManager/EventManager.lua b/CounterAttack_Solo/Script/Global/EventManager/EventManager.lua new file mode 100644 index 00000000..179e14bb --- /dev/null +++ b/CounterAttack_Solo/Script/Global/EventManager/EventManager.lua @@ -0,0 +1,107 @@ +require("Script.Global.EventManager.EventConfig") + +EventManager = EventManager or {} + +--- 判断 bEnableActionTick +EventManager.TickArray = {} +EventManager.TickHandle = nil +EventManager.LastTickTime = 0. + +function EventManager.InitEventManager() + EventManager.BindingEvent() + EventManager.EnableTickAction() +end + +function EventManager.DestroyEventManager() + EventManager.DisableTickAction() +end + + +--------------------------------------- Tick --------------------------------------- + +function EventManager.EnableTickAction() + if EventManager.TickHandle == nil then + EventManager.TickHandle = UGCEventSystem.SetTimerLoop(UGCGameSystem.GameState, EventManager.Tick, 1. / EventConfig.TickFrequency) + end +end + +function EventManager.DisableTickAction() + if EventManager.TickHandle then + UGCEventSystem.StopTimer(EventManager.TickHandle) + end +end + +--- 执行所有Action的Tick +function EventManager.Tick() + local NowTime = UGCSystemLibrary.GetGameTime() + --UGCLogSystem.Log("[EventManager_Tick] TickArray Count:%d", #EventManager.TickArray) + if #EventManager.TickArray > 0 then + local DeltaSeconds = NowTime - EventManager.LastTickTime + for i = #EventManager.TickArray, 1, -1 do + --UGCLogSystem.Log("[EventManager_Tick] i:%d", i) + local TempAction = EventManager.TickArray[i] + if TempAction.bEnableActionTick then + TempAction:Update(DeltaSeconds) + else + UGCLogSystem.Log("[EventManager_Tick] Remove TickArray Count:%d", #EventManager.TickArray) + table.remove(EventManager.TickArray, i) + end + end + end + EventManager.LastTickTime = NowTime +end + +function EventManager.ActionJoinToTick(TargetAction) + if TargetAction and TargetAction.Update then + EventManager.TickArray[#EventManager.TickArray + 1] = TargetAction + UGCLogSystem.Log("[EventManager_ActionJoinToTick] TickArray Count:%d", #EventManager.TickArray) + end +end + +------------------------------------- Tick End ------------------------------------- + + +function EventManager.BindingEvent() + for EventType, AttachInfo in pairs(EventConfig.EventAttach) do + if EventConfig.CheckEventAttach(EventType) then + UGCEventSystem.AddListener(EventType, function(...) + EventManager.ExeAttachActions(EventType, ...) + end) + else + UGCLogSystem.LogError("[EventManager_BindingEvent] CheckEventAttach(%s) is Error", tostring(EventType)) + end + end +end + + + +function EventManager.ExeAttachActions(EventType, ...) + local Inputs = table.pack(...) + + -- 创建传递的Event参数对照表 + local TempEventParams = {} + for i = 1, #EventConfig.EventParam[EventType] do + TempEventParams[EventConfig.EventParam[EventType][i]] = Inputs[i] + end + + for ActionType, ParamMap in pairs(EventConfig.EventAttach[EventType]) do + local RequireFile = require(EventConfig.ActionInfo[ActionType].ActionPath) + local TempAction = setmetatable({}, { __index = RequireFile, __metatable = RequireFile }) + + -- 设置默认参数 + for ParamName, ParamDefaultValue in pairs(EventConfig.ActionInfo[ActionType].ActionParam) do + TempAction[ParamName] = ParamDefaultValue + end + -- 设置传递参数 + for EventParamName, ActionParamName in pairs(ParamMap) do + TempAction[ActionParamName] = TempEventParams[EventParamName] + end + -- 执行Action + TempAction:Execute(table.unpack(TempEventParams)) + -- 判断是否需要Tick + if TempAction.bEnableActionTick then + EventManager.ActionJoinToTick(TempAction) + end + end +end + diff --git a/CounterAttack_Solo/Script/Global/FunctionExtension/A_IncludeFunctionExtension.lua b/CounterAttack_Solo/Script/Global/FunctionExtension/A_IncludeFunctionExtension.lua new file mode 100644 index 00000000..7331ef84 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/FunctionExtension/A_IncludeFunctionExtension.lua @@ -0,0 +1,13 @@ +-- 需要包含的头目录 + +local Prefix = "Script.Global.FunctionExtension." + +require(Prefix .. 'MathExtension') +require(Prefix .. 'StringExtension') +require(Prefix .. 'TableExtension') +require(Prefix .. 'TableHelper') +require(Prefix .. 'VectorHelper') +require(Prefix .. 'QuatHelper') + + + diff --git a/CounterAttack_Solo/Script/Global/FunctionExtension/MathExtension.lua b/CounterAttack_Solo/Script/Global/FunctionExtension/MathExtension.lua new file mode 100644 index 00000000..50491239 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/FunctionExtension/MathExtension.lua @@ -0,0 +1,38 @@ + +---clamp +---@param v number @number +---@param Min number @min +---@param Max number @max +---@return number @clamp v between Min and Max +function math.clamp(v, Min, Max) + Min = math.min(Min, Max) + Max = math.max(Min, Max) + if v < Min then + return Min + end + if v > Max then + return Max + end + return v +end + +---clamp +---@param a number @First number to compare +---@param b number @Second number to compare +---@param Tolerance number @Maximum allowed difference for considering them as 'nearly equal' +---@return boolean @true if a and b are nearly equal +function math.isNearlyEqual(a, b, Tolerance) + if Tolerance == nil then + Tolerance = 0.01 + end + return math.abs(a - b) <= Tolerance +end + +--- 在圆中随机生成一个点 +function math.RandomCirclePoint(Radius, Center) + local angle = math.random() * 2 * math.pi; + local tr = Radius * math.sqrt(math.random()); + local x = Center.X + tr * math.cos(angle); + local y = Center.Y + tr * math.sin(angle); + return { X = x, Y = y }; +end \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/FunctionExtension/QuatHelper.lua b/CounterAttack_Solo/Script/Global/FunctionExtension/QuatHelper.lua new file mode 100644 index 00000000..a21c50cc --- /dev/null +++ b/CounterAttack_Solo/Script/Global/FunctionExtension/QuatHelper.lua @@ -0,0 +1,63 @@ +QuatHelper = {} +-- 四元数结构体 +QuatHelper = {} +QuatHelper.__index = QuatHelper + +-- 创建四元数 +function QuatHelper.new(W, X, Y, Z) + return setmetatable({W = W, X = X, Y = Y, Z = Z}, QuatHelper) +end + +function QuatHelper.RotToQuat(Rot) + return STExtraBlueprintFunctionLibrary.RotToQuat(Rot) +end + +function QuatHelper.QuatToRot(q) + return STExtraBlueprintFunctionLibrary.QuatToRot(q) +end + +-- 四元数乘法 (q1 * q2) +function QuatHelper.mul(q1, q2) + return QuatHelper.new( + q1.W * q2.W - q1.X * q2.X - q1.Y * q2.Y - q1.Z * q2.Z, + q1.W * q2.X + q1.X * q2.W + q1.Y * q2.Z - q1.Z * q2.Y, + q1.W * q2.Y - q1.X * q2.Z + q1.Y * q2.W + q1.Z * q2.X, + q1.W * q2.Z + q1.X * q2.Y - q1.Y * q2.X + q1.Z * q2.W + ) +end + +-- 四元数与向量乘法 (q * v),假设向量v是{x, y, z} +function QuatHelper.mulVec(q, v) + local qv = QuatHelper.new(0, v.x, v.y, v.z) + local q_conjugate = QuatHelper.conjugate(q) + local result = QuatHelper.mul(QuatHelper.mul(q, qv), q_conjugate) + return {x = result.X, y = result.Y, z = result.Z} +end + +-- 四元数单位化 +function QuatHelper.normalize(q) + local magnitude = math.sqrt(q.W * q.W + q.X * q.X + q.Y * q.Y + q.Z * q.Z) + return QuatHelper.new(q.W / magnitude, q.X / magnitude, q.Y / magnitude, q.Z / magnitude) +end + +-- 四元数共轭 +function QuatHelper.conjugate(q) + return QuatHelper.new(q.W, -q.X, -q.Y, -q.Z) +end + +-- 四元数逆 +function QuatHelper.inverse(q) + local conjugate = QuatHelper.conjugate(q) + local magnitude_squared = q.W * q.W + q.X * q.X + q.Y * q.Y + q.Z * q.Z + return QuatHelper.new(conjugate.W / magnitude_squared, conjugate.X / magnitude_squared, conjugate.Y / magnitude_squared, conjugate.Z / magnitude_squared) +end + +-- 生成四元数字符串表示 (用于调试) +function QuatHelper.toString(q) + return string.format("(%f, %f, %f, %f)", q.W, q.X, q.Y, q.Z) +end + + + + +return QuatHelper; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/FunctionExtension/StringExtension.lua b/CounterAttack_Solo/Script/Global/FunctionExtension/StringExtension.lua new file mode 100644 index 00000000..949bdab2 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/FunctionExtension/StringExtension.lua @@ -0,0 +1,18 @@ + +---字符串分割 +function string:split(sep) + --sep = sep or "\t" + local fields = {} + local pattern = string.format("([^%s]+)", sep) + self:gsub(pattern, function(c) fields[#fields+1] = c end) + return fields +end + +---字符串直接转Number +function string.splitToNumber(InStr, sep) + --sep = sep or "\t" + local fields = {} + local pattern = string.format("([^%s]+)", sep) + InStr:gsub(pattern, function(c) fields[#fields+1] = tonumber(c) end) + return fields +end \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/FunctionExtension/TableExtension.lua b/CounterAttack_Solo/Script/Global/FunctionExtension/TableExtension.lua new file mode 100644 index 00000000..a329866e --- /dev/null +++ b/CounterAttack_Solo/Script/Global/FunctionExtension/TableExtension.lua @@ -0,0 +1,259 @@ +-- 拷贝table +function table.DeepCopy(object) + -- 已经复制过的table,key为复制源table,value为复制后的table + -- 为了防止table中的某个属性为自身时出现死循环 + -- 避免本该是同一个table的属性,在复制时变成2个不同的table(内容同,但是地址关系和原来的不一样了) + local lookup_table = {} + local function _copy(object) + if type(object) ~= 'table' then -- 非table类型都直接返回 + return object + elseif lookup_table[object] then + return lookup_table[object] + end + local new_table = {} + lookup_table[object] = new_table + for k, v in pairs(object) do + new_table[_copy(k)] = _copy(v) + end + -- 这里直接拿mt来用是因为一般对table操作不会很粗暴的修改mt的相关内容 + return setmetatable(new_table, getmetatable(object)) + end + return _copy(object) +end + +function table.NewLuaObj(InObj) + return setmetatable({}, { + __index = InObj, + __metatable = InObj, + }) +end + +---获取表元素个数 +function table.getCount(t) + if type(t) ~= "table" then + return -1 + end + local Length = 0 + for i, v in pairs(t) do + Length = Length + 1 + end + return Length +end + +---获取表中所有的Key +function table.getKeys(t) + if type(t) ~= "table" then + return {} + end + local keys = {} + for k,v in pairs(t) do + keys[#keys + 1] = k + end + return keys +end + +---获取对应元素的Index +function table.getIndex(t, v) + if type(t) ~= "table" then + return nil + end + for index, value in pairs(t) do + if value == v then + return index + end + end + return nil +end + +---获取表中是否有对应Key +function table.hasKey(t, k) + if type(t) ~= "table" then + return false + end + for key, value in pairs(t) do + if k == key then + return true + end + end + return false +end + +---按Key删除表中元素 +function table.removeKey(t, k) + if t == nil then + return nil + end + local v = t[k] + t[k] = nil + return v +end + +---获取表中是否有对应的Value +function table.hasValue(t, value) + if t == nil then return false end + for k, v in pairs(t) do + if v == value then + return true + end + end + return false +end + +---按Value删除表中元素 +function table.removeValue(t, value, removeAll) + local deleteNum = 0 + local i = 1 + local max = table.getCount(t) + + while i <= max do + if t[i] == value then + table.remove(t,i) + deleteNum = deleteNum + 1 + i = i - 1 + max = max - 1 + if not removeAll then break end + end + i = i + 1 + end + return deleteNum +end + +---返回是否是空表 +function table.isEmpty(t) + if type(t) ~= "table" then + return true + end + return next(t) == nil +end + + + +function table.Rand(t) + if type(t) ~= "table" or #t <= 0 then return nil end + return t[math.random(1, #t)] +end + +function table.GetMaxValueResKey(t, fun) + if fun == nil then fun = function(p1, p2) return p1 < p2 end end + if type(t) ~= "table" or type(fun) ~= "function" or table.getCount(t) <= 0 then return end + local res = nil + for k, v in pairs(t) do + if not res or fun(t[res], v) then + res = k + end + end + return res +end + +function table.FindKey(t, value) + if type(t) ~= "table" then return nil end + for k, v in pairs(t) do + if v == value then return k end + end + return nil +end + +function table.GetMaxValue(t) + if type(t) ~= "table" then return nil end + local Res = nil + for k, v in pairs(t) do + if Res == nil then Res = v + elseif Res < v then Res = v + end + end + return Res +end + + + +function table.Swap(t, i, k) + if type(t) ~= "table" then + return false + end + local temp = t[i] + t[i] = t[k] + t[k] = temp +end + +--- 打乱整个table 洗牌算法 +function table.Shuffle(t) + if type(t) ~= "table" then + return false + end + for i = 1, #t - 1 do + local SwapIndex = math.random(i + 1, #t) + table.Swap(t, i, SwapIndex) + end +end + +--- 判断table相等 +function table.tablesEqual(table1, table2) + -- 检查table1和table2是否为同一个table + if table1 == table2 then + return true + end + + -- 检查table类型 + if type(table1) ~= 'table' or type(table2) ~= 'table' then + return false + end + + -- 检查table1中的键值对是否在table2中 + for key, value in pairs(table1) do + if type(value) == 'table' then + if not tablesEqual(value, table2[key]) then + return false + end + else + if table2[key] ~= value then + return false + end + end + end + + -- 检查table2中是否有table1中没有的键 + for key in pairs(table2) do + if table1[key] == nil then + return false + end + end + + return true +end + +--- 判断table集合相等 +function table.collectionsEqual(collection1, collection2) + local count1 = 0 + local count2 = 0 + + -- 计算第一个集合的大小 + for _ in pairs(collection1) do + count1 = count1 + 1 + end + + -- 计算第二个集合的大小 + for _ in pairs(collection2) do + count2 = count2 + 1 + end + + -- 如果大小不同,则集合不同 + if count1 ~= count2 then + return false + end + + -- 检查collection1中的每个元素是否也在collection2中 + for key1, value1 in pairs(collection1) do + local found = false + for key2, value2 in pairs(collection2) do + if value1 == value2 then + found = true + break + end + end + if not found then + return false + end + end + + return true +end \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/FunctionExtension/TableHelper.lua b/CounterAttack_Solo/Script/Global/FunctionExtension/TableHelper.lua new file mode 100644 index 00000000..8e5bf23d --- /dev/null +++ b/CounterAttack_Solo/Script/Global/FunctionExtension/TableHelper.lua @@ -0,0 +1,451 @@ +TableHelper = TableHelper or {} + +---@param obj table +---@return table +function TableHelper.DeepCopy(obj) + if obj == nil then + return {}; + end + + local InTable = {}; + local function Func(obj) + if type(obj) ~= "table" then --判断表中是否有表 + return obj; + end + local NewTable = {}; --定义一个新表 + InTable[obj] = NewTable; --若表中有表,则先把表给InTable,再用NewTable去接收内嵌的表 + for k,v in pairs(obj) do --把旧表的key和Value赋给新表 + NewTable[Func(k)] = Func(v); + end + return setmetatable(NewTable, getmetatable(obj))--赋值元表 + end + return Func(obj) --若表中有表,则把内嵌的表也复制了 +end + +---@param InSelf table +---@param InTable table +function TableHelper.CopyToTable(InSelf, InTable) + if InSelf == nil or InTable == nil then + return + end + + for i, v in pairs(InTable) do + if type(v) == 'table' then + TableHelper.CopyToTable(InSelf[i], v); + else + InSelf[i] = v; + end + end +end + +---@param Tab table +---@return table +function TableHelper.CopyTable(Tab) + local NewTab = {} + for k, v in pairs(Tab) do + NewTab[k] = v + end + + return NewTab +end + +---@param TableData table +---@return table +function TableHelper.DeepCopyTable(TableData) + if TableData == nil then + UGCLogSystem.LogError("表格为空,不能复制"); + return {}; + end + + local TmpTab = {}; + for k, v in pairs(TableData) do + if type(v) == "table" then + local SubTab = TableHelper.DeepCopyTable(v); + TmpTab[k] = SubTab; + -- elseif type(v) == "userdata" then + -- TmpTab[k] = v:Copy(); + else + TmpTab[k] = v; + end + end + + return TmpTab; +end + + +--- 返回值的下标,没有返回-1 +---@param tab table +---@param val any +---@return bool, int32 +function TableHelper.GetValueIndex(tab, val) + for k, v in pairs(tab) do + if v == val then + return true, k; + end + end + + return false, -1; +end + +---@param tab table +---@param val any +function TableHelper.RemoveByValue(tab, val) + for i, Val in pairs(tab) do + if Val == val then + table.remove(tab, i); + break; + end + end +end + + +function TableHelper.Contains(tab, val) + for i, Val in pairs(tab) do + if Val == val then + return true; + end + end + + return false; +end + + +function TableHelper.GetName(Actor) + if UE.IsValid(Actor) then + return UE.GetPathName(Actor); + elseif Actor ~= nil then + return type(Actor) + end + + return "[NullActor]"; +end + + +function TableHelper.Length(InTable) + if InTable == nil then + return 0; + end + + local Count = 0 + for _ in pairs(InTable) do + Count = Count + 1; + end + return Count; +end + + +function TableHelper.AppendToTable(OriginalTable, NewTable) + if OriginalTable == nil or NewTable == nil then + return; + end + + for k, v in pairs(NewTable) do + table.insert(OriginalTable, v); + end +end + + +function TableHelper.ArrayToLuaTable(Array) + local Tab = {}; + for k, v in pairs(Array) do + Tab[k] = v; + end + + return Tab; +end + +function class(classname, super) + local superType = type(super) + local cls + + if superType ~= "function" and superType ~= "table" then + superType = nil + super = nil + end + + if superType == "function" or (super and super.__ctype == 1) then + -- inherited from native C++ Object + cls = {} + + if superType == "table" then + -- copy fields from super + for k, v in pairs(super) do + cls[k] = v + end + cls.__create = super.__create + cls.super = super + else + cls.__create = super + cls.Ctor = function() + end + end + + cls.__cname = classname + cls.__ctype = 1 + + function cls.New(...) + local instance = cls.__create(...) + -- copy fields from class to native object + for k, v in pairs(cls) do + instance[k] = v + end + instance.class = cls + instance:Ctor(...) + return instance + end + + else + -- inherited from Lua Object + if super then + cls = {} + setmetatable(cls, { + __index = super + }) + cls.super = super + else + cls = { + Ctor = function() + end + } + end + + cls.__cname = classname + cls.__ctype = 2 -- lua + cls.__index = cls + + function cls.New(...) + local instance = setmetatable({}, cls) + instance.class = cls + instance:Ctor(...) + return instance + end + end + + return cls +end + + + + +-- 拷贝table +function table.DeepCopy(object) + -- 已经复制过的table,key为复制源table,value为复制后的table + -- 为了防止table中的某个属性为自身时出现死循环 + -- 避免本该是同一个table的属性,在复制时变成2个不同的table(内容同,但是地址关系和原来的不一样了) + local lookup_table = {} + local function _copy(object) + if type(object) ~= 'table' then -- 非table类型都直接返回 + return object + elseif lookup_table[object] then + return lookup_table[object] + end + local new_table = {} + lookup_table[object] = new_table + for k, v in pairs(object) do + new_table[_copy(k)] = _copy(v) + end + -- 这里直接拿mt来用是因为一般对table操作不会很粗暴的修改mt的相关内容 + return setmetatable(new_table, getmetatable(object)) + end + return _copy(object) +end + +---获取表元素个数 +function table.getCount(t) + if type(t) ~= "table" then + return -1 + end + local Length = 0 + for i, v in pairs(t) do + Length = Length + 1 + end + return Length +end + +---获取表中所有的Key +function table.getKeys(t) + if type(t) ~= "table" then + return {} + end + local keys = {} + for k,v in pairs(t) do + keys[#keys + 1] = k + end + return keys +end + +---获取对应元素的Index +function table.getIndex(t, v) + if type(t) ~= "table" then + return nil + end + for index, value in pairs(t) do + if value == v then + return index + end + end + return nil +end + +---获取表中是否有对应Key +function table.hasKey(t, k) + if type(t) ~= "table" then + return false + end + for key, value in pairs(t) do + if k == key then + return true + end + end + return false +end + +---按Key删除表中元素 +function table.removeKey(t, k) + if t == nil then + return nil + end + local v = t[k] + t[k] = nil + return v +end + +---获取表中是否有对应的Value +function table.hasValue(t, value) + if t == nil then return false end + for k, v in pairs(t) do + if v == value then + return true + end + end + return false +end + +---按Value删除表中元素 +function table.removeValue(t, value, removeAll) + local deleteNum = 0 + local i = 1 + local max = table.getCount(t) + + while i <= max do + if t[i] == value then + table.remove(t,i) + deleteNum = deleteNum + 1 + i = i - 1 + max = max - 1 + if not removeAll then break end + end + i = i + 1 + end + return deleteNum +end + +---返回是否是空表 +function table.isEmpty(t) + if type(t) ~= "table" then + return true + end + return next(t) == nil +end + + + +function table.Rand(t) + if type(t) ~= "table" or #t <= 0 then return nil end + return t[math.random(1, #t)] +end + +function table.GetMaxValueResKey(t, fun) + if fun == nil then fun = function(p1, p2) return p1 < p2 end end + if type(t) ~= "table" or type(fun) ~= "function" or table.getCount(t) <= 0 then return end + local res = nil + for k, v in pairs(t) do + if not res or fun(t[res], v) then + res = k + end + end + return res +end + +function table.FindKey(t, value) + if type(t) ~= "table" then return nil end + for k, v in pairs(t) do + if v == value then return k end + end + return nil +end + +function table.GetMaxValue(t) + if type(t) ~= "table" then return nil end + local Res = nil + for k, v in pairs(t) do + if Res == nil then Res = v + elseif Res < v then Res = v + end + end + return Res +end + + + +function table.Swap(t, i, k) + if type(t) ~= "table" then + return false + end + local temp = t[i] + t[i] = t[k] + t[k] = temp +end + +--- 打乱整个table 洗牌算法 +function table.Shuffle(t) + if type(t) ~= "table" then + return false + end + for i = 1, #t - 1 do + local SwapIndex = math.random(i + 1, #t) + table.Swap(t, i, SwapIndex) + end + return true +end + +function table.addTableNum(t, k, v) + if t[k] == nil then + t[k] = v + else + t[k] = t[k] + v + end + return t[k] +end + + + + +---------------------------------------------------------table print--------------------------------------------------------- +-- log输出格式化 +local function logPrint(str) + str = os.date("\nLog output date: %Y-%m-%d %H:%M:%S \n", os.time()) .. str + print(str) +end + +-- key值格式化 +local function formatKey(key) + local t = type(key) + if t == "number" then + return "[" .. key .. "]" + elseif t == "string" then + local n = tonumber(key) + if n then + return "[" .. key .. "]" + end + end + return key +end + + + + + + + +return TableHelper; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/FunctionExtension/VectorHelper.lua b/CounterAttack_Solo/Script/Global/FunctionExtension/VectorHelper.lua new file mode 100644 index 00000000..9f581187 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/FunctionExtension/VectorHelper.lua @@ -0,0 +1,179 @@ +VectorHelper = {} + +function VectorHelper.Dot(v1, v2) + return v1.X * v2.X + v1.Y * v2.Y + v1.Z * v2.Z +end + +function VectorHelper.Mul(v1, v2) + return Vector.New(v1.X * v2.X, v1.Y * v2.Y, v1.Z * v2.Z) +end + +function VectorHelper.MulScalar(v1, S) + return Vector.New(v1.X * S, v1.Y * S, v1.Z * S) +end + +function VectorHelper.MulScalar2D(v1, S) + return Vector.New(v1.X * S, v1.Y * S, 0) +end + +function VectorHelper.MulNumber(v1, number) + return Vector.New(v1.X * number, v1.Y * number, v1.Z * number) +end + +function VectorHelper.MulNumber2D(v1, number) + return Vector.New(v1.X * number, v1.Y * number, 0) +end + +function VectorHelper.Sub(v1, v2) + return Vector.New(v1.X - v2.X, v1.Y - v2.Y, v1.Z - v2.Z) +end + +function VectorHelper.Sub2D(v1, v2) + return Vector.New(v1.X - v2.X, v1.Y - v2.Y, 0) +end + +function VectorHelper.Add(v1, v2) + return Vector.New(v1.X + v2.X, v1.Y + v2.Y, v1.Z + v2.Z) +end + +function VectorHelper.Add2D(v1, v2) + return Vector.New(v1.X + v2.X, v1.Y + v2.Y, 0) +end + +function VectorHelper.Div2DScalar(v1, s) + return Vector.New(v1.X / s , v1.Y / s, 0); +end + + +function VectorHelper.ToString(v) + return string.format("(%.2f,%.2f,%.2f)", v.X, v.Y, v.Z) +end + +function VectorHelper.RotToString(v) + return string.format("(Roll = %.2f, Pitch = %.2f, Yaw = %.2f)", v.Roll, v.Pitch, v.Yaw) +end + +function VectorHelper.ToStringInt2D(v) + if v == nil then + return "[X=Nil,Y=Nil]"; + end + return string.format("[%d, %d]", v.X, v.Y); +end + +function VectorHelper.ToIntString(v) + return "(" .. tostring(math.floor(v.X)) .. "," .. tostring( math.floor(v.Y)) .. "," .. tostring(math.floor(v.Z)) .. ")"; +end + +function VectorHelper.Cross(v1, v2) + return Vector.New(v1.Y * v2.Z - v2.Y * v1.Z, + v1.Z * v2.X - v2.Z * v1.X, + v1.X * v2.Y - v2.X * v1.Y) +end + +function VectorHelper.GetDistance(vector1, vector2) + if vector1 == nil or vector2 == nil then return 0 end + if vector1.X == nil or vector2.X == nil then return 0 end + if vector1.Y == nil or vector2.Y == nil then return 0 end + if vector1.Z == nil or vector2.Z == nil then return 0 end + local disX = vector1.X - vector2.X + local disY = vector1.Y - vector2.Y + local disZ = vector1.Z - vector2.Z + return math.sqrt(disX ^ 2 + disY ^ 2 + disZ ^ 2) +end + +function VectorHelper.GetDistance2D(vector1, vector2) + if vector1 == nil or vector2 == nil then return 0 end + if vector1.X == nil or vector2.X == nil then return 0 end + if vector1.Y == nil or vector2.Y == nil then return 0 end + local disX = vector1.X - vector2.X + local disY = vector1.Y - vector2.Y + return math.sqrt(disX ^ 2 + disY ^ 2) +end + +function VectorHelper.LengthSquared(v) + return v.X ^ 2 + v.Y ^ 2 + v.Z ^ 2 +end + +function VectorHelper.LengthSquared2D(v) + return v.X ^ 2 + v.Y ^ 2 +end + +function VectorHelper.Length(v) + return math.sqrt(VectorHelper.LengthSquared(v)) +end + +function VectorHelper.Length2D(v) + return math.sqrt(VectorHelper.LengthSquared2D(v)) +end + +function VectorHelper.ToLuaTable(v) + return {X = v.X, Y = v.Y, Z = v.Z} +end + +function VectorHelper.ToLuaTable2D(v) + return {X = v.X, Y = v.Y, Z = 0} +end + +function VectorHelper.RotToLuaTable(v) + return {Roll=v.Roll, Pitch=v.Pitch, Yaw=v.Yaw} +end + +function VectorHelper.ColorToVector(LinearColor) + return {X = LinearColor.R, Y = LinearColor.G, Z = LinearColor.B } +end + +function VectorHelper.RotToString(v) + return string.format("Roll=%.2f, Pitch=%.2f, Yaw=%.2f", v.Roll, v.Pitch, v.Yaw); +end + + +function VectorHelper.GetMiddlePoint(vector1, vector2) + return {X = (vector1.X + vector2.X) / 2, Y = (vector1.Y + vector2.Y) / 2,Z = (vector1.Z + vector2.Z) / 2} +end + + +function VectorHelper.FromCpp(CppVector) + return {X = CppVector.X, Y = CppVector.Y, Z = CppVector.Z}; +end + + +function VectorHelper.Equal(vector1, vector2) + return (vector1.X == vector2.X and vector1.Y == vector2.Y and vector1.Z == vector2.Z); +end + + +--计算两点之间连线与Y轴的夹角 +function VectorHelper.GetAngleByPos(PosA,PosB) + local P = {}; + P.X = PosB.X - PosA.X; + P.Y = PosB.Y - PosA.Y; + local Pi = 3.1415926; + local Dis = math.sqrt( (P.X * P.X) + (P.Y * P.Y)); + local FAngle = math.acos (P.Y/ Dis); + if( P.X < 0) then + FAngle = 2 * Pi - FAngle; + end + local Angle = FAngle * 180 / Pi; + Angle = Angle > 0 and (90 - Angle) or (90 + math.abs(Angle)); + return Angle; +end + +function VectorHelper.RotZero() + return {Roll = 0, Pitch = 0, Yaw = 0} +end + +function VectorHelper.VectorZero() + return {X = 0, Y = 0, Z = 0} +end + +function VectorHelper.ScaleOne() + return {X = 1, Y = 1, Z = 1} +end + +function VectorHelper.CosineValue(v1, v2) + return VectorHelper.Dot(v1, v2) / (VectorHelper.Length(v1) * VectorHelper.Length(v2)) +end + + + +return VectorHelper; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/Global.lua b/CounterAttack_Solo/Script/Global/Global.lua new file mode 100644 index 00000000..7a850588 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/Global.lua @@ -0,0 +1,33 @@ +-- 全局的Config +require('Script.Global.CustomEnum') +require('Script.Global.GlobalConfigs') + +--- 工具类 +require('Script.Global.Tool.A_IncludeTool') + +--- 函数拓展 +require('Script.Global.FunctionExtension.A_IncludeFunctionExtension') +--- Table文件 +require('Script.Global.Tables.A_IncludeTables') +--- 事件系统及模式编辑器代码编辑版 +require('Script.Global.EventManager.A_IncludeEvent') +--- 各系统功能文件 依赖函数拓展、事件系统、函数拓展 +require('Script.Global.System.A_IncludeSystem') +--- 控件系统 依赖函数拓展 +require('Script.Global.WidgetManager.A_IncludeWidgetManager') +--- 全局逻辑 依赖系统功能文件 +require('Script.Global.GlobalLogic.A_IncludeGlobalLogic') +--- Config文件 依赖 各系统功能文件 +require('Script.Global.Config.A_IncludeConfig') +--- Manager文件 +require('Script.Global.Manager.A_IncludeManager') + +--- BuffSystem +require("Script.Global.BuffSystem.Config.BuffActionConfig") +require("Script.Global.BuffSystem.Config.BuffAssetConfig") +require('Script.Global.BuffSystem.BuffManager') +require('Script.Global.BuffSystem.BuffSystemAPI') + +--- 玩法内Config 最底 +require("Script.Global.Config.GodOfWarConfig") + diff --git a/CounterAttack_Solo/Script/Global/GlobalConfigs.lua b/CounterAttack_Solo/Script/Global/GlobalConfigs.lua new file mode 100644 index 00000000..4ccedbee --- /dev/null +++ b/CounterAttack_Solo/Script/Global/GlobalConfigs.lua @@ -0,0 +1,124 @@ +GlobalConfigs = GlobalConfigs or {} + +GlobalConfigs.DsDoOnce = true; +GlobalConfigs.IsDebug = false; +GlobalConfigs.GameName = "进阶之战"; +GlobalConfigs.IsHaiDao = true; -- 判断是否为海岛继承的工程 + + +--- 游戏模式设置 +GlobalConfigs.GameModeSetting = { + --- 队伍模式 + TeamModeType = CustomEnum.ETeamMode.TeamSports; + --- 队伍所需玩家数 + TeamNeedPlayerNum = 4; + --- 队伍数量 + TeamNum = 2; + --- 最大玩家数量 + MaxPlayerNum = 8; + --- 最小可玩人数 + MinPlayerNum = 2; +} + + +--- 游戏设置 +GlobalConfigs.GameSetting = { + -- 启用补人 + EnablePlayerJoin = false, + + -- 等待及选地图时间 + WaitTime = 50; + -- 游戏时长 + GameTime = 1200; + -- 回合时间 + RoundTime = 240; + --RoundTime = 60; + -- 最大回合数 + MaxRound = 7; + -- 回合准备时间 + RoundReadyTime = 10; + -- 准备阶段是否可移动 + ReadyCanMove = true; + -- 准备阶段开启伤害 + ReadyStateEnableDamage = false; + -- 目标比分 + TargetTeamScore = 4; + -- 激活队伍出生点切换,在回合数大于MaxRound//2时 + ActiveChangeTeam = true; + -- 仅游玩阶段有伤害 + JustPlayingEnableDamage = true; + + -- 玩家重生时间 + RespawnTime = 3.; + -- 无敌时间 + InvincibleTime = 3.; + -- 启用描边 + EnableStroke = true ; + + -- 自动返回大厅的时间 + DelayReturnToLobbyTime = 20.; + -- 地图结束投票时随机滚动选择投票地图是时间 + RollMapTime = 4.; + -- 启用死亡视角 + EnableLerpCamera = false; + -- 等待客户端地图加载时间 + ClientLoadMapTime = 2.; + -- 武器选择时间 + WeaponSelectTime = 20; + -- 可以自定义武器 + CanCustomWeapon = true; + + + -- 友伤比例 + FriendlyInjuryRatio = 0.; + -- 启用自己的伤害如手雷、火箭筒 + bEnableSelfHarm = true; + -- 对自己的伤害比例 + SelfHarmInjuryRatio = 1.; + -- 启用掉落伤害 + bEnableDropDamage = false; + -- 忽略的伤害类型 + IgnoreDamageType = { + -- 掉落伤害 + EDamageType.FallingDamage, + }; + + + -- 近战伤害比例 + MeleeDamageScale = 1; + +} + + + + + +function GlobalConfigs.GetAddScore(WeaponID) + return ((WeaponID > 0 and WeaponID < 108001) and 1 or 2) +end + + +--- 保存信息类型 +GlobalConfigs.EArchive = { + --- 游玩次数 + NumberOfVisits = 1, + --- 保存的快捷选择武器 + SaveSelectWeapon = 2, +} + + +--- 获取悬赏分对应的金币 +---@param RewardScore uint +GlobalConfigs.RewardScoreToGoldCoin = function(RewardScore) + return RewardScore * 100 +end + +--- 获取悬赏分对应的击杀得分 +---@param RewardScore uint +GlobalConfigs.GetPlayerAddScoreFromRewardScore = function(DeadPlayerRewardScore) + return 3 + DeadPlayerRewardScore +end + + + +return GlobalConfigs \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/GlobalLogic/A_IncludeGlobalLogic.lua b/CounterAttack_Solo/Script/Global/GlobalLogic/A_IncludeGlobalLogic.lua new file mode 100644 index 00000000..3faeb64f --- /dev/null +++ b/CounterAttack_Solo/Script/Global/GlobalLogic/A_IncludeGlobalLogic.lua @@ -0,0 +1,6 @@ +-- 需要包含的头目录 + +local Prefix = "Script.Global.GlobalLogic." + +require(Prefix .. 'LogicConfig') +require(Prefix .. 'GlobalInit') \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/GlobalLogic/GlobalInit.lua b/CounterAttack_Solo/Script/Global/GlobalLogic/GlobalInit.lua new file mode 100644 index 00000000..db0f4df6 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/GlobalLogic/GlobalInit.lua @@ -0,0 +1,42 @@ +require('Script.Global.GlobalLogic.LogicConfig') + +GlobalInit = GlobalInit or {} + +function GlobalInit.Init() + GlobalInit.ServerAndClientInit() + if UGCGameSystem.IsServer() then + GlobalInit.ServerInit() + else + GlobalInit.ClientInit() + end + + for i, v in pairs(LogicConfig.RequireList) do + local GlobalLogicInst = require(v) + if GlobalLogicInst.Init then + GlobalLogicInst.Init() + end + end +end + +function GlobalInit.ServerAndClientInit() + EventManager.InitEventManager() +end + +function GlobalInit.ServerInit() +end + +function GlobalInit.ClientInit() +end + +function GlobalInit.SpawnActorFromPath(AssetClass) + return UGCGameSystem.SpawnActor( + UGCGameSystem.GameState, + AssetClass, + VectorHelper.VectorZero(), + VectorHelper.RotZero(), + VectorHelper.ScaleOne(), + UGCGameSystem.GameState + ) +end + +return GlobalInit \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/GlobalLogic/Logic/GlobalLogic_PlayerDeadEffect.lua b/CounterAttack_Solo/Script/Global/GlobalLogic/Logic/GlobalLogic_PlayerDeadEffect.lua new file mode 100644 index 00000000..ab4ceb65 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/GlobalLogic/Logic/GlobalLogic_PlayerDeadEffect.lua @@ -0,0 +1,58 @@ +GlobalLogic_PlayerDeadEffect = GlobalLogic_PlayerDeadEffect or {} + +GlobalLogic_PlayerDeadEffect.AllDeadToScore = {}; +GlobalLogic_PlayerDeadEffect.SpawnNum = GlobalConfigs.GameModeSetting.MaxPlayerNum; +GlobalLogic_PlayerDeadEffect.DeadToScoreIndex = 1; + +function GlobalLogic_PlayerDeadEffect.Init() + if UGCGameSystem.IsServer() then + GlobalLogic_PlayerDeadEffect.ServerInit() + else + GlobalLogic_PlayerDeadEffect.ClientInit() + end +end + +function GlobalLogic_PlayerDeadEffect.ServerInit() + -- PlayerKey, KillerKey, WeaponID, DamageType, IsHeadShotDamage, Distance + UGCEventSystem.AddListener(EventEnum.PlayerDeathInfo, GlobalLogic_PlayerDeadEffect.PlayerDead) +end + +function GlobalLogic_PlayerDeadEffect.PlayerDead(DeadPlayerKey) + local DeadPlayer = UGCGameSystem.GetPlayerPawnByPlayerKey(DeadPlayerKey) + if UE.IsValid(DeadPlayer) then + local FloorPos = DeadPlayer:K2_GetActorLocation() + FloorPos.Z = FloorPos.Z - DeadPlayer.CapsuleComponent.CapsuleHalfHeight + UGCSendRPCSystem.ExeStaticLogic(nil, LogicConfig.ELogicType.PlayerDeadEffect, "ClientShowDeadScore", DeadPlayer, VectorHelper.ToLuaTable(FloorPos)) + end +end + +function GlobalLogic_PlayerDeadEffect.ClientInit() + for i = 1, GlobalLogic_PlayerDeadEffect.SpawnNum do + local EffectActor = GlobalInit.SpawnActorFromPath(ObjectPathTable.BP_PlayerDeadParticle_Class) + GlobalLogic_PlayerDeadEffect.AllDeadToScore[i] = EffectActor + end +end + +function GlobalLogic_PlayerDeadEffect.AllDeadToScoreIsEmpty() + return #GlobalLogic_PlayerDeadEffect.AllDeadToScore <= 0 +end + +function GlobalLogic_PlayerDeadEffect.GetNextDeadToScoreActor() + local Res = GlobalLogic_PlayerDeadEffect.AllDeadToScore[GlobalLogic_PlayerDeadEffect.DeadToScoreIndex] + GlobalLogic_PlayerDeadEffect.DeadToScoreIndex = (GlobalLogic_PlayerDeadEffect.DeadToScoreIndex % GlobalLogic_PlayerDeadEffect.SpawnNum) + 1 + return Res +end + +function GlobalLogic_PlayerDeadEffect.ClientShowDeadScore(DeadPlayer, Pos) + if UE.IsValid(DeadPlayer) then + DeadPlayer:SetActorHiddenInGame(true) + end + if GlobalLogic_PlayerDeadEffect.AllDeadToScoreIsEmpty() then + UGCLogSystem.LogError("[GlobalLogic_PlayerDeadEffect_ClientShowDeadScore] AllDeadToScore is empty") + return + end + local DeadScoreActor = GlobalLogic_PlayerDeadEffect.GetNextDeadToScoreActor() + DeadScoreActor:UpdateDeadInfo(Pos) +end + +return GlobalLogic_PlayerDeadEffect \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/GlobalLogic/LogicConfig.lua b/CounterAttack_Solo/Script/Global/GlobalLogic/LogicConfig.lua new file mode 100644 index 00000000..717e4f08 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/GlobalLogic/LogicConfig.lua @@ -0,0 +1,13 @@ +LogicConfig = LogicConfig or {} + +LogicConfig.ELogicType = { + PlayerDeadEffect = 1; + WeaponGradient = 2; + TraceManager = 3; +} + +LogicConfig.RequireList = { + -- [LogicConfig.ELogicType.PlayerDeadEffect] = 'Script.Global.GlobalLogic.Logic.GlobalLogic_PlayerDeadEffect'; + --[LogicConfig.ELogicType.WeaponGradient] = 'Script.Global.GlobalLogic.Manager.WeaponGradientManager'; + [LogicConfig.ELogicType.TraceManager] = 'Script.Global.GlobalLogic.Manager.TraceManager'; +} diff --git a/CounterAttack_Solo/Script/Global/GlobalLogic/Manager/TraceManager.lua b/CounterAttack_Solo/Script/Global/GlobalLogic/Manager/TraceManager.lua new file mode 100644 index 00000000..e7eb9144 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/GlobalLogic/Manager/TraceManager.lua @@ -0,0 +1,93 @@ +TraceManager = TraceManager or {} + +TraceManager.EColorType = { + Red = 1; + Green = 2; + Blue = 3; + Yellow = 4; +} + +TraceManager.LineColors = { + [TraceManager.EColorType.Red] = {R = 1, G = 0, B = 0, A = 1}; + [TraceManager.EColorType.Green] = {R = 0, G = 1, B = 0, A = 1}; + [TraceManager.EColorType.Blue] = {R = 0, G = 0, B = 1, A = 1}; + [TraceManager.EColorType.Yellow] = {R = 0, G = 1, B = 1, A = 1}; +} + + + +---@field LineTraceSingleForObjects fun(WorldContextObject:UObject,Start:FVector,End:FVector,ObjectTypes:ULuaArrayHelper,ActorsToIgnore:ULuaArrayHelper,bEnableClientDebug:bool,TraceHitColorType:TraceManager.EColorType):bool,FHitResult +function TraceManager.LineTraceSingleForObjects(WorldContextObject, Start, End, ObjectTypes, ActorsToIgnore, bEnableClientDebug, TraceHitColorType) + UGCLogSystem.Log("[TraceManager_LineTraceSingleForObjects]") + ---@field LineTraceSingleForObjects fun(WorldContextObject:UObject,Start:FVector,End:FVector,ObjectTypes:ULuaArrayHelper,bTraceComplex:bool,ActorsToIgnore:ULuaArrayHelper,DrawDebugType:EDrawDebugTrace,OutHit:FHitResult,bIgnoreSelf:bool,TraceColor:FLinearColor,TraceHitColor:FLinearColor,DrawTime:float):bool,FHitResult + local bHit, HitResult = KismetSystemLibrary.LineTraceSingleForObjects(WorldContextObject, Start, End, ObjectTypes, false, ActorsToIgnore, EDrawDebugTrace.None, nil, true, nil, nil, nil) + if bEnableClientDebug then + if TraceHitColorType == nil then + TraceHitColorType = TraceManager.EColorType.Red + end + if UGCGameSystem.IsServer() then + Start, End = VectorHelper.ToLuaTable(Start), VectorHelper.ToLuaTable(End) + UGCSendRPCSystem.ExeStaticLogic(nil, LogicConfig.ELogicType.TraceManager, "DrawDebugLine", Start, End, TraceHitColorType) + if bHit then + UGCSendRPCSystem.ExeStaticLogic(nil, LogicConfig.ELogicType.TraceManager, "DrawDebugSphere", VectorHelper.ToLuaTable(HitResult.ImpactPoint), 5, TraceManager.EColorType.Green) + end + else + TraceManager.DrawDebugLine(Start, End, TraceHitColorType) + if bHit then + TraceManager.DrawDebugSphere(HitResult.ImpactPoint, 5, TraceManager.EColorType.Green) + end + end + end + return bHit, HitResult +end + +---@field SphereTraceSingleForObjects fun(WorldContextObject:UObject,Start:FVector,End:FVector,Radius:float,ObjectTypes:ULuaArrayHelper,ActorsToIgnore:ULuaArrayHelper,bEnableClientDebug:bool,TraceHitColorType:TraceManager.EColorType):bool,FHitResult +function TraceManager.SphereTraceSingleForObjects(WorldContextObject, Start, End, Radius, ObjectTypes, ActorsToIgnore, bEnableClientDebug, TraceHitColorType) + UGCLogSystem.Log("[TraceManager_SphereTraceSingleForObjects]") + ---@field SphereTraceSingleForObjects fun(WorldContextObject:UObject,Start:FVector,End:FVector,Radius:float,ObjectTypes:ULuaArrayHelper,bTraceComplex:bool,ActorsToIgnore:ULuaArrayHelper,DrawDebugType:EDrawDebugTrace,OutHit:FHitResult,bIgnoreSelf:bool,TraceColor:FLinearColor,TraceHitColor:FLinearColor,DrawTime:float):bool,FHitResult + ---@field SphereTraceSingleByProfile fun(WorldContextObject:UObject,Start:FVector,End:FVector,Radius:float,ProfileName:FName,bTraceComplex:bool,ActorsToIgnore:ULuaArrayHelper,DrawDebugType:EDrawDebugTrace,OutHit:FHitResult,bIgnoreSelf:bool,TraceColor:FLinearColor,TraceHitColor:FLinearColor,DrawTime:float):bool,FHitResult + ---@field SphereTraceSingle fun(WorldContextObject:UObject,Start:FVector,End:FVector,Radius:float,TraceChannel:ETraceTypeQuery,bTraceComplex:bool,ActorsToIgnore:ULuaArrayHelper,DrawDebugType:EDrawDebugTrace,OutHit:FHitResult,bIgnoreSelf:bool,TraceColor:FLinearColor,TraceHitColor:FLinearColor,DrawTime:float):bool,FHitResult + -- {ETraceTypeQuery.TraceTypeQuery1} + -- local TarceTypes = {ETraceTypeQuery.TraceTypeQuery1, } + -- local bHit, HitResult = KismetSystemLibrary.SphereTraceSingle(WorldContextObject, Start, End, Radius, ETraceTypeQuery.TraceTypeQuery1, false, ActorsToIgnore, EDrawDebugTrace.None, nil, true, nil, nil, nil) + local bHit, HitResult = KismetSystemLibrary.SphereTraceSingleForObjects(WorldContextObject, Start, End, Radius, ObjectTypes, false, ActorsToIgnore, EDrawDebugTrace.None, nil, true, nil, nil, nil) + if bEnableClientDebug then + if TraceHitColorType == nil then + TraceHitColorType = TraceManager.EColorType.Yellow + end + if UGCGameSystem.IsServer() then + Start, End = VectorHelper.ToLuaTable(Start), VectorHelper.ToLuaTable(End) + UGCSendRPCSystem.ExeStaticLogic(nil, LogicConfig.ELogicType.TraceManager, "DrawDebugSphere", Start, Radius, TraceHitColorType) + UGCSendRPCSystem.ExeStaticLogic(nil, LogicConfig.ELogicType.TraceManager, "DrawDebugSphere", End, Radius, TraceHitColorType) + if bHit then + UGCSendRPCSystem.ExeStaticLogic(nil, LogicConfig.ELogicType.TraceManager, "DrawDebugSphere", VectorHelper.ToLuaTable(HitResult.Location), Radius, TraceManager.EColorType.Green) + end + else + TraceManager.DrawDebugSphere(Start, Radius, TraceHitColorType) + TraceManager.DrawDebugSphere(End, Radius, TraceHitColorType) + if bHit then + TraceManager.DrawDebugSphere(HitResult.Location, Radius, TraceManager.EColorType.Green) + end + end + end + return bHit, HitResult +end + +--------------------------------------------------------- Draw --------------------------------------------------------- + +function TraceManager.DrawDebugSphere(Center, Radius, ColorType) + STExtraGameplayStatics.ClientDrawDebugSphere(Center, Radius, 10, TraceManager.LineColors[ColorType], 10, 1) +end + + +function TraceManager.DrawDebugLine(Start, End, ColorType) + STExtraGameplayStatics.ClientDrawDebugLine(Start, End, TraceManager.LineColors[ColorType], 10, 1) +end + +function TraceManager.DrawDebugBox(Center, Extent, Color, Rotation) + STExtraGameplayStatics.ClientDrawDebugBox(Center, Extent, Color, Rotation, 1, 2) +end + +------------------------------------------------------- Draw End ------------------------------------------------------- + +return TraceManager \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/GlobalLogic/Manager/WeaponGradientManager.lua b/CounterAttack_Solo/Script/Global/GlobalLogic/Manager/WeaponGradientManager.lua new file mode 100644 index 00000000..8f3f31bc --- /dev/null +++ b/CounterAttack_Solo/Script/Global/GlobalLogic/Manager/WeaponGradientManager.lua @@ -0,0 +1,159 @@ +--- +--- Generated by EmmyLua(https://github.com/EmmyLua) +--- Created by LT. +--- DateTime: 2023/12/3 16:48 +--- + +WeaponGradientManager = WeaponGradientManager or {} + +--- 武器梯度 +WeaponGradientManager.WeaponGradient = {} +--- 玩家等级 PlayerKey = Grade:uint +WeaponGradientManager.PlayerGrade = {} +--- 玩家梯度索引 PlayerKey = GradientIndex:uint +WeaponGradientManager.PlayerGradientIndex = {} +--- 玩家更新武器梯度的时间句柄 PlayerKey = TimeHandle +WeaponGradientManager.UpdateWeaponMatchingHandle = {} + + +function WeaponGradientManager.Init(InGradient) + if UGCGameSystem.IsServer() then + --- 洗牌梯度列表 + if InGradient == nil then + WeaponGradientManager.WeaponGradient = table.DeepCopy(WeaponGradientTable.Gradient) + else + WeaponGradientManager.WeaponGradient = table.DeepCopy(InGradient) + end + UGCLogSystem.LogTree("[WeaponGradientManager_Init] WeaponGradient:", WeaponGradientManager.WeaponGradient) + table.Shuffle(WeaponGradientManager.WeaponGradient) + WeaponGradientManager.PlayerGradientIndex = {} + end +end + + + +--- 更新玩家武器搭配 +function WeaponGradientManager.UpdatePlayerGradientWeaponMatching(PlayerKey, NewGrade, IgnoreWeaponIDs) + if IgnoreWeaponIDs == nil then + IgnoreWeaponIDs = {} + elseif type(IgnoreWeaponIDs) ~= "table" then + IgnoreWeaponIDs = {IgnoreWeaponIDs, } + end + + local PlayerPawn = UGCGameSystem.GetPlayerPawnByPlayerKey(PlayerKey) + if PlayerPawn == nil then + UGCLogSystem.LogError("[WeaponGradientManager_UpdatePlayerGradientWeaponMatching] Player[%s] is nil or Dead 1,Grade:%s", tostring(PlayerKey), tostring(NewGrade)) + return + end + local PlayerGradient = WeaponGradientManager.GetPlayerGradient(PlayerKey) + + if PlayerGradient == nil then + UGCLogSystem.LogError("[WeaponGradientManager_UpdatePlayerGradientWeaponMatching] Player[%s], PlayerGradient[NewGrade] is nil ", tostring(PlayerKey), tostring(NewGrade)) + return + end + + --- 新的武器ID及配件ID + local NewWeaponID = PlayerGradient[NewGrade] + if NewWeaponID == nil then + UGCLogSystem.LogError("[WeaponGradientManager_UpdatePlayerGradientWeaponMatching] NewGrade 错误 Player[%s], PlayerGradient[%s] is nil ", tostring(PlayerKey), tostring(NewGrade)) + return + end + local PartIDs = WeaponTable.RecommendedWeaponParts[NewWeaponID] + + --- 验证玩家当前背包武器及配件是否需要销毁 + ---@return ItemDataList LuaTable @LuaTable, ItemData结构:ItemID,InstanceID,Count,Type,SubType,IsAvatar + local AllItems = UGCBackPackSystem.GetAllItemData(PlayerPawn) + for i, ItemInfo in pairs(AllItems) do + local TypeID = UGCSystemLibrary.GetItemTypeID(ItemInfo.ItemID) + if TypeID < 300 and TypeID > 100 then + if not table.hasValue(PartIDs, ItemInfo.ItemID) and ItemInfo.ItemID ~= NewWeaponID and not table.hasValue(IgnoreWeaponIDs, ItemInfo.ItemID) then + --- 销毁背包中的物品 + UGCBackPackSystem.DropItem(PlayerPawn, ItemInfo.ItemID, ItemInfo.Count, true) + end + end + end + + --- 隔帧给玩家赋予武器及配件 + if WeaponGradientManager.UpdateWeaponMatchingHandle[PlayerKey] then + UGCEventSystem.StopTimer(WeaponGradientManager.UpdateWeaponMatchingHandle[PlayerKey]) + WeaponGradientManager.UpdateWeaponMatchingHandle[PlayerKey] = nil + end + WeaponGradientManager.UpdateWeaponMatchingHandle[PlayerKey] = UGCEventSystem.SetTimer(UGCGameSystem.GameState, + function() + WeaponGradientManager.UpdateWeaponMatchingHandle[PlayerKey] = nil + if UE.IsValid(PlayerPawn) then + --if NewWeaponID > 0 and UGCBackPackSystem.GetItemCount(PlayerPawn, NewWeaponID) == 0 then + -- UGCBackPackSystem.AddItem(PlayerPawn, NewWeaponID, 1) + -- --UGCSystemLibrary.AddItem(PlayerPawn, NewWeaponID, 1) + --end + local bGiveWeapon = false + if NewWeaponID > 0 and UGCBackPackSystem.GetItemCount(PlayerPawn, NewWeaponID) == 0 then + UGCBackPackSystem.AddItem(PlayerPawn, NewWeaponID, 1) + -- 玩家离开换弹状态 + UGCPawnSystem.LeavePawnState(PlayerPawn, EPawnState.Roload) + bGiveWeapon = true + end + if PartIDs then + PlayerPawn = UGCGameSystem.GetPlayerPawnByPlayerKey(PlayerKey) + if PlayerPawn == nil then + UGCLogSystem.LogError("[WeaponGradientManager_UpdatePlayerGradientWeaponMatching] Player[%s] is nil or Dead 2,Grade:%s", tostring(PlayerKey), tostring(NewGrade)) + return + end + for i, PartID in pairs(PartIDs) do + if UGCBackPackSystem.GetItemCount(PlayerPawn, PartID) == 0 then + UGCBackPackSystem.AddItem(PlayerPawn, PartID, 1) + --UGCSystemLibrary.AddItem(PlayerPawn, PartID, 1) + end + end + end + if bGiveWeapon then + UGCEventSystem.SetTimer(PlayerPawn, function() + for i, v in pairs(ShootWeaponEnums) do + local Weapon = UGCWeaponManagerSystem.GetWeaponBySlot(PlayerPawn, v) + if UE.IsValid(Weapon) then + UGCGunSystem.EnableClipInfiniteBullets(Weapon, true) + local MaxBulletNumInOneClip = UGCGunSystem.GetMaxBulletNumInOneClip(Weapon) + Weapon:SetCurrentBulletNumInClipOnServer(MaxBulletNumInOneClip, true) + -- 玩家离开换弹状态 + if UE.IsValid(PlayerPawn) then + UGCPawnSystem.LeavePawnState(PlayerPawn, EPawnState.Roload) + end + end + end + end, + 1. + ) + -- local NowWeapon = UGCWeaponManagerSystem.GetCurrentWeapon(PlayerPawn) + -- UGCGunSystem.Roload(PlayerPawn) + -- UGCLogSystem.Log("[WeaponGradientManager_UpdatePlayerGradientWeaponMatching]NowWeapon:%s", KismetSystemLibrary.GetObjectName(NowWeapon)) + end + + end + end, + 0.1 + ) +end + +--- 获取玩家当前武器梯度,若玩家没有设置梯度则自动随机获取一个 +---@param PlayerKey uint +---@return PlayerGradient table WeaponIDs +function WeaponGradientManager.GetPlayerGradient(PlayerKey) + if WeaponGradientManager.PlayerGradientIndex[PlayerKey] == nil then + local GradientIndex = math.random(1, #WeaponGradientManager.WeaponGradient) + WeaponGradientManager.PlayerGradientIndex[PlayerKey] = GradientIndex + end + return WeaponGradientManager.WeaponGradient[WeaponGradientManager.PlayerGradientIndex[PlayerKey]] +end + + + +--- 更新玩家下一个武器梯度,返回玩家梯度 +---@param PlayerKey uint +---@return PlayerGradient table WeaponIDs +function WeaponGradientManager.UpdatePlayerNextGradient(PlayerKey) + WeaponGradientManager.PlayerGradientIndex[PlayerKey] = (WeaponGradientManager.PlayerGradientIndex[PlayerKey] % #WeaponGradientManager.WeaponGradient) + 1 + return WeaponGradientManager.GetPlayerGradient(PlayerKey) +end + + +return WeaponGradientManager \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/Manager/A_IncludeManager.lua b/CounterAttack_Solo/Script/Global/Manager/A_IncludeManager.lua new file mode 100644 index 00000000..42c35c17 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/Manager/A_IncludeManager.lua @@ -0,0 +1,9 @@ +-- 需要包含的头目录 + +local Prefix = "Script.Global.Manager." + +require(Prefix .. 'CheckLogicManager') +require(Prefix .. 'BondManager') + + + diff --git a/CounterAttack_Solo/Script/Global/Manager/BondManager.lua b/CounterAttack_Solo/Script/Global/Manager/BondManager.lua new file mode 100644 index 00000000..c4fc1805 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/Manager/BondManager.lua @@ -0,0 +1,81 @@ +BondManager = BondManager or {} +-- 校验频率 +BondManager.FPS = 2 +-- 是否已激活 +BondManager.Activated = false +-- 血量同步的百分比,存在大于这个百分比的队友且都未倒地时,双方同步血量 +BondManager.SynchronizedPercentageOfBloodVolume = 0.3 +-- 自动救援血量 +BondManager.AutoRescueHealth = 0.7 - 1e-2 + + +-- 激活函数 +function BondManager.ActiveBondSystem() + if BondManager.Activated then return end + BondManager.Activated = true + if BondManager.BondUpdateHandle == nil then + BondManager.BondUpdateHandle = UGCEventSystem.SetTimerLoop(UGCGameSystem.GameState, BondManager.Update, 1./BondManager.FPS) + UGCLogSystem.Log("[BondManager_ActiveBondSystem] Finish") + end +end +-- 暂停函数 +function BondManager.StopBondSystem() + if not BondManager.Activated then return end + BondManager.Activated = false + if BondManager.BondUpdateHandle then + UGCEventSystem.StopTimer(BondManager.BondUpdateHandle) + BondManager.BondUpdateHandle = nil + UGCLogSystem.Log("[BondManager_StopBondSystem] Finish") + end +end + +-- 更新函数 +function BondManager.Update() + local TeamIDs = UGCTeamSystem.GetTeamIDs() + for i, TeamID in pairs(TeamIDs) do + BondManager.BondFromTeamID(TeamID) + end +end +-- 队伍羁绊触发,仅2人队伍生效 +function BondManager.BondFromTeamID(InTeamID) + local TeamPlayers = UGCGameSystem.GameState:GetTeamPlayer(InTeamID) + -- 不为2人队伍则不处理 + if table.getCount(TeamPlayers) ~= 2 then return end + local Pawn1 = UGCGameSystem.GetPlayerPawnByPlayerKey(TeamPlayers[1]) + local Pawn2 = UGCGameSystem.GetPlayerPawnByPlayerKey(TeamPlayers[2]) + -- 判有效 + if not UE.IsValid(Pawn1) or not UE.IsValid(Pawn2) then return end + -- 判存活 + if not Pawn1:IsAlive() or not Pawn2:IsAlive() then return end + + -- 获取两个玩家的信息 + local PawnHealth1 = UGCPawnAttrSystem.GetHealth(Pawn1) + local PawnHealth2 = UGCPawnAttrSystem.GetHealth(Pawn2) + local PawnMaxHealth1 = UGCPawnAttrSystem.GetHealthMax(Pawn1) + local PawnMaxHealth2 = UGCPawnAttrSystem.GetHealthMax(Pawn2) + local PawnHasDying1 = UGCPawnSystem.HasPawnState(Pawn1, EPawnState.Dying) + local PawnHasDying2 = UGCPawnSystem.HasPawnState(Pawn2, EPawnState.Dying) + local HealthPercentage1 = PawnHealth1 / PawnMaxHealth1 + local HealthPercentage2 = PawnHealth2 / PawnMaxHealth2 + + + + if not PawnHasDying1 and not PawnHasDying2 then + -- 同步血量 + if (HealthPercentage1 > BondManager.SynchronizedPercentageOfBloodVolume or HealthPercentage2 > BondManager.SynchronizedPercentageOfBloodVolume) and math.abs(PawnHealth1 - PawnHealth2) > 1 then + local TargetHealth = (PawnHealth1 + PawnHealth2) / 2 + UGCPawnAttrSystem.SetHealth(Pawn1, TargetHealth) + UGCPawnAttrSystem.SetHealth(Pawn2, TargetHealth) + UGCLogSystem.Log("[BondManager_BondFromTeamID] 同步血量 PawnHealth1:%s, PawnHealth2:%s, TargetHealth:%s", tostring(PawnHealth1), tostring(PawnHealth2), tostring(TargetHealth)) + end + elseif PawnHasDying1 ~= PawnHasDying2 then + -- 自动救援 + if PawnHasDying1 and HealthPercentage2 >= BondManager.AutoRescueHealth then + UGCLogSystem.Log("[BondManager_BondFromTeamID] 自动救援玩家:%s", tostring(TeamPlayers[1])) + Pawn1:GetCharacterRescueOtherComponent():RescueSucImmediately(Pawn1, 1) + elseif PawnHasDying2 and HealthPercentage1 >= BondManager.AutoRescueHealth then + UGCLogSystem.Log("[BondManager_BondFromTeamID] 自动救援玩家:%s", tostring(TeamPlayers[2])) + Pawn2:GetCharacterRescueOtherComponent():RescueSucImmediately(Pawn2, 1) + end + end +end \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/Manager/CheckLogicManager.lua b/CounterAttack_Solo/Script/Global/Manager/CheckLogicManager.lua new file mode 100644 index 00000000..5820c1a8 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/Manager/CheckLogicManager.lua @@ -0,0 +1,92 @@ +CheckLogicManager = CheckLogicManager or {} + +-- Setting ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +-- 此帧数会存在微小误差,可忽略不计 +CheckLogicManager.FPS = 1 + +CheckLogicManager.ECheckLogicType = { + PlayerWeapon = 1; + FloorItemHandle = 2; +} + +-- 核心列表,此列表不包含的类型不进行检测。 表示检测对应函数的时间间隔 +CheckLogicManager.CheckLogicInfo = { + [CheckLogicManager.ECheckLogicType.FloorItemHandle] = { IntervalTime = 4., Server = true, Client = false}; + [CheckLogicManager.ECheckLogicType.PlayerWeapon] = { IntervalTime = 2., Server = true, Client = false}; +} + +-- 检测函数,此列表不包含的函数也将不执行。可后续赋值,结构为 {Func, Obj},也可以在此manager后面写 +CheckLogicManager.CheckLogicFunc = {} + +-- Setting End -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + + +-- Func --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--- 激活函数 +function CheckLogicManager.ActiveCheck() + if CheckLogicManager.CheckHandle == nil then + CheckLogicManager.CheckHandle = UGCEventSystem.SetTimerLoop(UGCGameSystem.GameState, CheckLogicManager.Check, CheckLogicManager.FPS) + end +end +--- 暂停函数 +function CheckLogicManager.StopCheck() + if CheckLogicManager.CheckHandle then + UGCEventSystem.StopTimer(CheckLogicManager.CheckHandle) + CheckLogicManager.CheckHandle = nil + end +end + + +CheckLogicManager.LastCheckTime = {} +--- Loop函数 每秒判断一次是否Check +function CheckLogicManager.Check() + local NowTime = UGCSystemLibrary.GetGameTime() + for i, CheckInfo in pairs(CheckLogicManager.CheckLogicInfo) do + -- 判断双端是否符合执行 + if (UGCGameSystem.IsServer() and CheckInfo.Server) or (not UGCGameSystem.IsServer() and CheckInfo.Client)then + local CheckIntervalTime = CheckInfo.IntervalTime + -- 检验初始化 + if CheckLogicManager.LastCheckTime[i] == nil then + CheckLogicManager.LastCheckTime[i] = NowTime + end + -- 判断时间间隔是否满足 + if CheckIntervalTime <= NowTime - CheckLogicManager.LastCheckTime[i] then + CheckLogicManager.LastCheckTime[i] = NowTime + local LogicFuncInfo = CheckLogicManager.CheckLogicFunc[i] + -- 判断函数是否已填充 + if LogicFuncInfo then + if LogicFuncInfo.Obj then + LogicFuncInfo.Func(LogicFuncInfo.Obj) + else + LogicFuncInfo.Func() + end + end + end + end + end +end + +-- Func End ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + + +-- Check Func --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +--- 清除掉落物函数 +CheckLogicManager.CheckLogicFunc[CheckLogicManager.ECheckLogicType.FloorItemHandle] = { + Func = function() + -- 清除掉落物,忽略生成物 + UGCSystemLibrary.RemoveActorFromClassName("PickUpWrapperActor") + -- UGCLogSystem.Log("[FloorItemHandle_Func] Finish") + end, Obj = nil +} + +-- 校验玩家的武器和配件 +CheckLogicManager.CheckLogicFunc[CheckLogicManager.ECheckLogicType.PlayerWeapon] = { + Func = function() + local AllPC = UGCGameSystem.GetAllPlayerController() + for i, v in pairs(AllPC) do + UGCGameSystem.GameState:CheckWeaponAndParts(v.PlayerKey) + end + end, Obj = nil +} +-- Check Func End ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/Structs.lua b/CounterAttack_Solo/Script/Global/Structs.lua new file mode 100644 index 00000000..cd942c2a --- /dev/null +++ b/CounterAttack_Solo/Script/Global/Structs.lua @@ -0,0 +1,9 @@ +--- +--- Generated by EmmyLua(https://github.com/EmmyLua) +--- Created by VSPO. +--- DateTime: 2023/9/15 13:34 +--- + +---@class UGCGameSystem +---@field GameMode UGCGameMode_C +---@field GameState UGCGameState_C diff --git a/CounterAttack_Solo/Script/Global/System/A_IncludeSystem.lua b/CounterAttack_Solo/Script/Global/System/A_IncludeSystem.lua new file mode 100644 index 00000000..307a38b8 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/System/A_IncludeSystem.lua @@ -0,0 +1,16 @@ +-- 需要包含的头目录 + +local Prefix = "Script.Global.System." + +-- 工具集 +require(Prefix .. 'UGCSystemLibrary') +require(Prefix .. 'LevelStreamUtil') +require(Prefix .. 'SoundSystem') +require(Prefix .. 'UGCDelegate') +require(Prefix .. 'UGCDelegateMulticast') +require(Prefix .. 'UGCEventSystem') +require(Prefix .. 'UGCLogSystem') +require(Prefix .. 'UGCSendRPCSystem') +require(Prefix .. 'PlayerScoreSystem') +require(Prefix .. 'MyVehicleSystem') +require(Prefix .. 'MyWeaponSystem') diff --git a/CounterAttack_Solo/Script/Global/System/LevelStreamUtil.lua b/CounterAttack_Solo/Script/Global/System/LevelStreamUtil.lua new file mode 100644 index 00000000..9072362e --- /dev/null +++ b/CounterAttack_Solo/Script/Global/System/LevelStreamUtil.lua @@ -0,0 +1,143 @@ +--require("Script.Common.UGCLog"); +--require("Script.Common.TableHelper"); + +LevelStreamUtil = LevelStreamUtil or +{ + LevelLoadCounter = 0; + LoadDelegate = nil; + LoadCompletedCallback = nil; + IsAsyncLoad = false; + + LevelUnloadCounter = 0; + UnLoadDelegate = nil; + UnloadCompletedCallback = nil; + IsAsyncUnload = false; + + LoadedLevels = {}; +}; + +---@class CallbackStruct +---@field Object Object +---@field Func fun() + + + +---@param LevelNameList string[]字符串关卡名列表 +---@param CompletedCallback CallbackStruct 加载完成时的回调函静态函数 +---@param bShouldBlockOnLoad bool 是否等待处理完成 +--- LoadStreamLevel fun(WorldContextObject:UObject,LevelName:FName,bMakeVisibleAfterLoad:bool,bShouldBlockOnLoad:bool,LatentInfo:FLatentActionInfo) +function LevelStreamUtil.LoadStreamLevels(LevelNameList, CompletedCallback, bShouldBlockOnLoad) + + --UGCLogSystem.Log("[Level] 加载关卡数量:%d CompletedCallback:%s", LevelNameList:Num(), UE.ToTable(CompletedCallback)); + + LevelStreamUtil.LevelLoadCounter = LevelStreamUtil.LevelLoadCounter + #LevelNameList; + LevelStreamUtil.LoadCompletedCallback = CompletedCallback; + LevelStreamUtil.IsAsyncLoad = not bShouldBlockOnLoad; + + --UGCLogSystem.Log("[Level] 加载关卡 LoadCompletedCallback:%s", UE.ToTable(LevelStreamUtil.LoadCompletedCallback)); + + for k, v in pairs(LevelNameList) do + UGCLogSystem.Log("[Level] 加载关卡:%s", v); + table.insert(LevelStreamUtil.LoadedLevels, v); + + LevelStreamUtil.LoadDelegate = ObjectExtend.CreateDelegate(UGCGameSystem.GameState, LevelStreamUtil.OnLoadCompleted, LevelStreamUtil); + + GameplayStatics.LoadStreamLevel(UGCGameSystem.GameState, v, true, bShouldBlockOnLoad, + ObjectExtend.CreateLatentAction(LevelStreamUtil.LoadDelegate)); + + -- 强制加载完成 + if bShouldBlockOnLoad then + GameplayStatics.FlushLevelStreaming(UGCGameSystem.GameState); + end + end + + if bShouldBlockOnLoad then + UGCLogSystem.Log("[Level] 完成同步加载关卡"); + -- LevelStreamUtil.LoadCompletedCallback(); + LevelStreamUtil.LoadCompletedCallback.Func(LevelStreamUtil.LoadCompletedCallback.Object); + end +end + + +--- 加载结束异步回调 +function LevelStreamUtil:OnLoadCompleted() + if not LevelStreamUtil.IsAsyncLoad then + return; + end + + LevelStreamUtil.LevelLoadCounter = LevelStreamUtil.LevelLoadCounter - 1; + UGCLogSystem.Log("[Level] 加载关卡完成 剩余等待计数:[%d]", LevelStreamUtil.LevelLoadCounter); + + if LevelStreamUtil.LevelLoadCounter == 0 then + ObjectExtend.DestroyDelegate(LevelStreamUtil.LoadDelegate); + LevelStreamUtil.LoadDelegate = nil; + + UGCLogSystem.Log("[Level] 加载关卡完成 LoadCompletedCallback:%s", UE.ToTable(LevelStreamUtil.LoadCompletedCallback)); + if LevelStreamUtil.LoadCompletedCallback ~= nil then + UGCLogSystem.Log("[Level] 完成异步加载关卡"); + -- LevelStreamUtil.CompletedCallback(); + + -- 必须缓存用,不然会被加载子关卡的调用冲掉 + local Callback = LevelStreamUtil.LoadCompletedCallback; + LevelStreamUtil.LoadCompletedCallback = nil; + Callback.Func(Callback.Object); + + end + end +end + +--- 根据传入的列表销毁相应的关卡 +---@param LevelNameList string[]字符串关卡名列表 +---@param UnloadCompletedCallback CallbackStruct 销毁完成时的回调函静态函数 +---@param bShouldBlockOnLoad bool 是否等待处理完成 +---UnloadStreamLevel fun(WorldContextObject:UObject,LevelName:FName,LatentInfo:FLatentActionInfo) +function LevelStreamUtil.UnLoadStreamLevels(LevelNameList, UnloadCompletedCallback, bShouldBlockOnLoad) + + LevelStreamUtil.UnloadCompletedCallback = UnloadCompletedCallback; + LevelStreamUtil.LevelUnloadCounter = LevelStreamUtil.LevelUnloadCounter + #LevelNameList; + LevelStreamUtil.IsAsyncUnload = not bShouldBlockOnLoad; + + for k, v in pairs(LevelNameList) do + UGCLogSystem.Log("[Level] 销毁关卡:%s", v); + + -- TableHelper.RemoveByValue(LevelStreamUtil.LoadedLevels, v); + table.removeValue(LevelStreamUtil.LoadedLevels, v, true) + + LevelStreamUtil.UnLoadDelegate = ObjectExtend.CreateDelegate(UGCGameSystem.GameState, LevelStreamUtil.UnLoadCompleted, LevelStreamUtil); + GameplayStatics.UnloadStreamLevel(UGCGameSystem.GameState, v, + ObjectExtend.CreateLatentAction(LevelStreamUtil.UnLoadDelegate)); + + -- 强制销毁完成 + if bShouldBlockOnLoad then + GameplayStatics.FlushLevelStreaming(UGCGameSystem.GameState); + end + end + + if bShouldBlockOnLoad then + UGCLogSystem.Log("[Level] 完成同步销毁关卡"); + LevelStreamUtil.UnloadCompletedCallback.Func(LevelStreamUtil.UnloadCompletedCallback.Object); + end +end + + +--- 销毁结束异步回调 +function LevelStreamUtil:UnLoadCompleted() + if not LevelStreamUtil.IsAsyncUnload then + return; + end + + UGCLogSystem.Log("[Level] 销毁关卡完成[%d]", LevelStreamUtil.LevelUnloadCounter); + LevelStreamUtil.LevelUnloadCounter = LevelStreamUtil.LevelUnloadCounter - 1; + + if LevelStreamUtil.LevelUnloadCounter == 0 then + ObjectExtend.DestroyDelegate(LevelStreamUtil.UnLoadDelegate); + LevelStreamUtil.UnLoadDelegate = nil; + + if LevelStreamUtil.UnloadCompletedCallback ~= nil then + UGCLogSystem.Log("[Level] 完成异步销毁关卡"); + -- LevelStreamUtil.UnloadCompletedCallback(); + LevelStreamUtil.UnloadCompletedCallback.Func(LevelStreamUtil.UnloadCompletedCallback.Object); + LevelStreamUtil.UnloadCompletedCallback = nil; + end + end +end \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/System/MyVehicleSystem.lua b/CounterAttack_Solo/Script/Global/System/MyVehicleSystem.lua new file mode 100644 index 00000000..648f4b4c --- /dev/null +++ b/CounterAttack_Solo/Script/Global/System/MyVehicleSystem.lua @@ -0,0 +1,59 @@ +--- +--- Generated by EmmyLua(https://github.com/EmmyLua) +--- Created by LT. +--- DateTime: 2024/8/23 17:10 +--- +MyVehicleSystem = MyVehicleSystem or {} +MyVehicleSystem.VehicleClassName = "STExtraWheeledVehicle" +MyVehicleSystem.SpawnVehiclePointPath = UGCGameSystem.GetUGCResourcesFullPath('Asset/Blueprint/SceneActor/BP_VehicleSpawnPoint.BP_VehicleSpawnPoint_C') + +function MyVehicleSystem.GetVehicleBaseClass() + if MyVehicleSystem.VehicleBaseClass == nil then + MyVehicleSystem.VehicleBaseClass = ScriptGameplayStatics.FindClass(MyVehicleSystem.VehicleClassName) + end + return MyVehicleSystem.VehicleBaseClass +end + +function MyVehicleSystem.GetSpawnVehiclePointClass() + if MyVehicleSystem.VehicleBaseClass == nil then + MyVehicleSystem.VehicleBaseClass = UE.LoadClass(MyVehicleSystem.SpawnVehiclePointPath) + end + return MyVehicleSystem.VehicleBaseClass +end + +--- 保存当前场景中载具的信息 +function MyVehicleSystem.SaveAllVehicleTF(MapIndex) + MyVehicleSystem.AllVehicleTF = {} + --local AllVehicles = {} + --AllVehicles = ScriptGameplayStatics.GetActorsOfClass(UGCGameSystem.GameState, MyVehicleSystem.GetVehicleBaseClass(), {}) + --for i, VehicleInst in pairs(AllVehicles) do + -- MyVehicleSystem.AllVehicleTF[#MyVehicleSystem.AllVehicleTF + 1] = {VehicleID = VehicleInst.VehicleConfigID, Pos = VehicleInst:K2_GetActorLocation(), Rot = VehicleInst:K2_GetActorRotation(), Inst = VehicleInst} + --end + --UGCLogSystem.LogTree("[MyVehicleSystem_SaveAllVehicleTF]", MyVehicleSystem.AllVehicleTF) + MyVehicleSystem.AllVehicleTF = {} + local AllVehicleSpawnPoints = ScriptGameplayStatics.GetActorsOfClass(UGCGameSystem.GameState, MyVehicleSystem.GetSpawnVehiclePointClass(), {}) + for i, v in pairs(AllVehicleSpawnPoints) do + UGCLogSystem.Log("[MyVehicleSystem_SaveAllVehicleTF] VehiclePath:%s", v.VehiclePath) + if MapIndex == nil or MapIndex == v.MapIndex then + MyVehicleSystem.AllVehicleTF[#MyVehicleSystem.AllVehicleTF + 1] = {VehiclePath = v.VehiclePath, Pos = v:K2_GetActorLocation(), Rot = v:K2_GetActorRotation(), Inst = nil} + end + end + UGCLogSystem.LogTree("[MyVehicleSystem_SaveAllVehicleTF]", MyVehicleSystem.AllVehicleTF) +end + +--- 移除场景中的载具 +function MyVehicleSystem.DestroyAllSavedVehicle() + for i, v in pairs(MyVehicleSystem.AllVehicleTF) do + if UE.IsValid(v.Inst) then + UGCVehicleSystem.DestroySelf(v.Inst) + end + end +end + +--- 重置当前场景中的载具,需要先调移除 +function MyVehicleSystem.ResetAllSavedVehicle() + for i, v in pairs(MyVehicleSystem.AllVehicleTF) do + MyVehicleSystem.AllVehicleTF[i].Inst = UGCVehicleSystem.SpawnVehicleNew(v.VehiclePath, v.Pos, v.Rot, true) + UGCLogSystem.Log("[MyVehicleSystem_ResetAllSavedVehicle] Inst:%s", tostring(MyVehicleSystem.AllVehicleTF[i].Inst)) + end +end \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/System/MyWeaponSystem.lua b/CounterAttack_Solo/Script/Global/System/MyWeaponSystem.lua new file mode 100644 index 00000000..df5069ef --- /dev/null +++ b/CounterAttack_Solo/Script/Global/System/MyWeaponSystem.lua @@ -0,0 +1,216 @@ +--[[ +---@field ItemID int32 +---@field ItemName FString +---@field ItemType int32 +---@field ItemSubType int32 +---@field BPID int32 +---@field Durability int32 +---@field Electricity int32 +---@field AIFullVaule int32 +---@field Equippable bool +---@field Consumable bool +---@field AutoEquipAndDrop bool +---@field MaxCount int32 +---@field WeightforOrder int32 +---@field WeightforOrder2 int32 +---@field UnitWeight_f float +---@field ItemBigIcon_n FName +---@field ItemSmallIcon_n FName +---@field ItemWhiteIcon_n FName +---@field ArmorySimpleDesc FString +---@field BackpackSimple FString +---@field ItemQuality int32 +---@field PickUpSound FString +---@field DropSound FString +---@field EquipSound FString +---@field UnEquipSound FString +---@field PickUpBank FString +---@field DropBank FString +---@field EquipBank FString +---@field UnEquipBank FString +---@field KillWhiteIcon FString +---@field StTime int32 +---@field ItemTypeBigWorld int32 +---@field BigWorldBackpackTab_n FName +---@field IsVirtualItem bool +---@field Droppable bool +---@field HomeBackpackTab_n FName +---@field Rarelevel int32 +---@field RarelevelEffPath FString +---@field CustomizedType FString +]] + + +MyWeaponSystem = MyWeaponSystem or {} + + +--- 异步加载Item小图标到Image画刷 +function MyWeaponSystem.AsyncLoadItemSmallIconToBrush(InItemID, ImageWidget) + MyWeaponSystem.AsyncLoadItemIconToBrush(InItemID, ImageWidget, "ItemSmallIcon_n") +end +--- 异步加载Item大图标到Image画刷 +function MyWeaponSystem.AsyncLoadItemBigIconToBrush(InItemID, ImageWidget) + MyWeaponSystem.AsyncLoadItemIconToBrush(InItemID, ImageWidget, "ItemBigIcon_n") +end +--- 异步加载Item白色剪影图标到Image画刷 +function MyWeaponSystem.AsyncLoadItemWhiteIconToBrush(InItemID, ImageWidget) + MyWeaponSystem.AsyncLoadItemIconToBrush(InItemID, ImageWidget, "ItemWhiteIcon_n") +end +--- 异步加载Item图标到Image画刷 +function MyWeaponSystem.AsyncLoadItemIconToBrush(InItemID, ImageWidget, TexKey) + local ItemInfo = UGCItemSystem.GetItemData(InItemID); + if ItemInfo then + UGCSystemLibrary.AsyncLoadAsset(ItemInfo[TexKey], + function(Tex) + if UE.IsValid(ImageWidget) then + ImageWidget:SetBrushFromTexture(Tex); + end + end , nil + ,true) + end +end +--- 判断Item是否为武器的配件 +function MyWeaponSystem.IsWeaponPartValid(InId) + if InId == nil then + return false; + end + return WeaponParts[InId] ~= nil; +end +--- 获取Item名 +function MyWeaponSystem.GetItemName(InItemID) + if InItemID == nil then return "" end + if InItemID <= 0 then + return "拳击" + else + local ItemInfo = UGCItemSystem.GetItemData(InItemID); + if ItemInfo then + return ItemInfo.ItemName + end + end + UGCLogSystem.Log("[GetWeaponName]无法找到对应 Weapon ID: " .. InItemID) + return "" +end +--- 获取配件Item是否为武器可用Item +---@param WeaponID int +---@param PartItemID int +function MyWeaponSystem.PartIsWeaponCanBeUsed(WeaponID, PartItemID) + if WeaponSuits[WeaponID] == nil then + UGCLogSystem.LogError("[MyWeaponSystem_PartIsWeaponCanBeUsed]") + return false + end + for i, v in pairs(WeaponSuits[WeaponID]) do + for _, PartItemIDTemp in pairs(v) do + if PartItemIDTemp == PartItemID then + return true + end + end + end + return false +end +--- 获取武器最佳配件 +function MyWeaponSystem.GetWeaponBastParts(InWeaponID) + if WeaponTable.RecommendedWeaponParts[InWeaponID] then + return WeaponTable.RecommendedWeaponParts[InWeaponID] + end + return {} +end +--- 获取武器可用配件 +function MyWeaponSystem.GetWeaponCanUsePartFromPartType(WeaponID, PartType) + if WeaponSuits[WeaponID] == nil then return {} end + if WeaponSuits[WeaponID][PartType] == nil then return {} end + return WeaponSuits[WeaponID][PartType] +end + +--- 将配件列表转化为配件字典 Key为PartType Value为ItemID +function MyWeaponSystem.PartListToPartMap(InPartList) + local Res = {} + for i, v in pairs(InPartList) do + if WeaponParts[v] then + Res[WeaponParts[v].Type] = v + end + end + return Res +end + +function MyWeaponSystem.GetPartType(InPartItemID) + if WeaponParts[InPartItemID] then + return WeaponParts[InPartItemID].Type + end + return nil +end + + +Weapon_LastGetWeaponIDTime = -1. +Weapon_LastGetWeaponIDRes = {} -- PlayerKey = {} + +--- 获取配件Item是否为武器可用Item +---@param PlayerKey uint +function MyWeaponSystem.GetPlayerShootWeaponIDs(PlayerKey) + local NowTime = KismetSystemLibrary.GetGameTimeInSeconds(UGCGameSystem.GameState) + if Weapon_LastGetWeaponIDTime == NowTime then + if Weapon_LastGetWeaponIDRes[PlayerKey] then + return Weapon_LastGetWeaponIDRes[PlayerKey] + end + else + Weapon_LastGetWeaponIDTime = NowTime + Weapon_LastGetWeaponIDRes = {} + end + local TargetPawn = UGCGameSystem.GetPlayerPawnByPlayerKey(PlayerKey) + local Res = {} + if UE.IsValid(TargetPawn) then + for i, v in pairs(ShootWeaponEnums) do + local Weapon = UGCWeaponManagerSystem.GetWeaponBySlot(TargetPawn, v) + if Weapon then + Res[#Res + 1] = UGCWeaponManagerSystem.GetWeaponItemID(Weapon) + end + end + end + Weapon_LastGetWeaponIDRes[PlayerKey] = Res + return Res +end + + + +function MyWeaponSystem.GetItemWeaponAmmunitionItemID(WeaponID) + return WeaponAmmunitionItem[WeaponID] +end + +MyWeaponSystem.BackPackHandle1 = {} +MyWeaponSystem.BackPackHandle2 = {} +MyWeaponSystem.BackPackHandle3 = {} +MyWeaponSystem.BackPackHandle4 = {} + +function MyWeaponSystem.UpdatePlayerBackPack(PlayerKey) + -- 默认武器 + if MyWeaponSystem.BackPackHandle1[PlayerKey] then UGCEventSystem.StopTimer(MyWeaponSystem.BackPackHandle1[PlayerKey]) end + MyWeaponSystem.BackPackHandle1[PlayerKey] = UGCEventSystem.SetTimer(UGCGameSystem.GameState, function() + MyWeaponSystem.BackPackHandle1[PlayerKey] = nil + UGCGameSystem.GameState:UpdatePlayerWeapon(PlayerKey) + end, 1.) + + -- 默认装备 + if MyWeaponSystem.BackPackHandle2[PlayerKey] then UGCEventSystem.StopTimer(MyWeaponSystem.BackPackHandle2[PlayerKey]) end + MyWeaponSystem.BackPackHandle2[PlayerKey] = UGCEventSystem.SetTimer(UGCGameSystem.GameState, function() + MyWeaponSystem.BackPackHandle2[PlayerKey] = nil + local DefaultBackPack = TableHelper.DeepCopy(UGCGameSystem.GameState:GetPlayerBeBornParts(PlayerKey)) + UGCGameSystem.GameState:PlayerAddItemInfo(PlayerKey, DefaultBackPack) + end, 2.) + + -- 校验玩家的武器和配件1次 + if MyWeaponSystem.BackPackHandle3[PlayerKey] then UGCEventSystem.StopTimer(MyWeaponSystem.BackPackHandle3[PlayerKey]) end + MyWeaponSystem.BackPackHandle3[PlayerKey] = UGCEventSystem.SetTimer(UGCGameSystem.GameState, function() + MyWeaponSystem.BackPackHandle3[PlayerKey] = nil + UGCGameSystem.GameState:CheckWeaponAndParts(PlayerKey) + end, 6.) + -- 校验玩家的武器和配件2次 + if MyWeaponSystem.BackPackHandle4[PlayerKey] then UGCEventSystem.StopTimer(MyWeaponSystem.BackPackHandle4[PlayerKey]) end + MyWeaponSystem.BackPackHandle4[PlayerKey] = UGCEventSystem.SetTimer(UGCGameSystem.GameState, function() + MyWeaponSystem.BackPackHandle4[PlayerKey] = nil + UGCGameSystem.GameState:CheckWeaponAndParts(PlayerKey) + end, 8.) + + -- 补满武器弹夹 + UGCEventSystem.SetTimer(UGCGameSystem.GameState, function() + UGCSystemLibrary.PlayerFullBullet(PlayerKey) + end, 3.) +end diff --git a/CounterAttack_Solo/Script/Global/System/PlayerScoreSystem.lua b/CounterAttack_Solo/Script/Global/System/PlayerScoreSystem.lua new file mode 100644 index 00000000..6d7ea6d9 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/System/PlayerScoreSystem.lua @@ -0,0 +1,303 @@ +--[[ +使用说明 + +1、注册积分类型列表,放在GameState的 +PlayerScoreSystem.RegisterInfo(InScoreList) 其中InScoreList 可参考PlayerScoreSystem.Config.ScoreList + +2、在玩家加入时添加 +PlayerScoreSystem.InitPlayerScoreData(PlayerKey) + +3、绑定得分表的更新函数,更新函数内可以设置同步参数,参数放置GameState内 +PlayerScoreSystem.BindChangeScoreDataCallBack(Func, Obj) +刷新绑定的案例: +(1)GameState加入同步参数PlayerScoreDatas + +(2)GameState的BeginPlay函数内加入 +if UGCGameSystem.IsServer() then + -- 绑定更新积分的函数 + PlayerScoreSystem.BindChangeScoreDataCallBack(self.UpdateAllPlayerScoreDatas, self) +end + +(3)加入UpdateAllPlayerScoreDatas函数 +function UGCGameState:UpdateAllPlayerScoreDatas() + self.PlayerScoreDatas = PlayerScoreSystem.GetPlayerScoreDatas() +end + +(4)加入UpdateAllPlayerScoreDatas函数 +function UGCGameState:UpdateAllPlayerScoreDatas() + self.PlayerScoreDatas = PlayerScoreSystem.GetPlayerScoreDatas() +end + +(5)加入OnRep_PlayerScoreDatas函数 +function UGCGameState:OnRep_PlayerScoreDatas() + PlayerScoreSystem.SetPlayerScoreDatas(self.PlayerScoreDatas) + UGCEventSystem.SendEvent(EventEnum.UpdatePlayerScoreData) +end + +------------------------------------------------------------------------------------------- + +常用函数 ----------- + +--- Server 重置所有玩家的积分信息 +PlayerScoreSystem.ResetAllPlayerScoreData() + +--- Server 增加玩家积分 +PlayerScoreSystem.AddPlayerScoreData(PlayerKey, ScoreType, AddVal) + +--- Server 设置玩家积分 +PlayerScoreSystem.SetPlayerScoreDataFromType(PlayerKey, ScoreType, Val) + +--- Server or Client 获取玩家积分信息 +---@return number +PlayerScoreSystem.GetPlayerScoreDataFromType(PlayerKey, ScoreType) + +--- Server or Client 获取玩家得分 返回: ∑得分类型×类型对应得分 +---@return number +PlayerScoreSystem.GetPlayerScore(PlayerKey) + +--- Server or Client 获取玩家排名 InPlayerKeys:所需排名的PlayerKeys,若为nil则全部一起排名 +---@return "table {PlayerKey, ...}" +PlayerScoreSystem.GetRank(InPlayerKeys) + +--- Server or Client 获取队伍的玩家排名 +---@return "table {[TeamID] = {PlayerKey, ...}, ...}" +PlayerScoreSystem.GetTeamRank() + +--- Server 刷新或重设PlayerScoreSystem内的玩家TeamID +PlayerScoreSystem.UpdatePlayerTeamID(PlayerKey, TeamID) + + + + +-- 特殊情况需要用的函数 ----------- + +--- Server 移除玩家得分信息 NeedNotify是否通知更新 这个比较少用,用于有玩家退出时再进行补人的操作,放在PlayerExit内调用 +PlayerScoreSystem.RemovePlayerScoreInfo(PlayerKey, NeedNotify) + +--- Server 清除退出的玩家得分信息 +PlayerScoreSystem.ClearExitPlayer() + +]] + +PlayerScoreSystem = PlayerScoreSystem or {} + +PlayerScoreSystem.Config = {} + + +-- Config ---------------------------------------------------------------- +PlayerScoreSystem.Config.EScoreType = { + Kills = 1, + Assists = 2, + Deaths = 3, + Damage = 4, +} + +--- Key值对应得分类型,Value值对应该类型每点所获得的积分 +PlayerScoreSystem.Config.ScoreList = { + [PlayerScoreSystem.Config.EScoreType.Kills] = 0; + [PlayerScoreSystem.Config.EScoreType.Assists] = 0; + [PlayerScoreSystem.Config.EScoreType.Deaths] = -1; + [PlayerScoreSystem.Config.EScoreType.Damage] = 10; +} +-- Config End ------------------------------------------------------------ + +-- Params ---------------------------------------------------------------- +-- 得分类型对应的分数 [ScoreType] = Score +PlayerScoreSystem.ScoreList = {}; +-- 得分类型 +PlayerScoreSystem.ScoreType = {}; +-- 玩家得分信息 [PlayerKey] = {[ScoreType] = Score, ...} 额外附加 TeamID(PlayerScoreSystem.PlayerScoreDatas[PlayerKey].TeamID) +PlayerScoreSystem.PlayerScoreDatas = {}; +-- Params End ------------------------------------------------------------ + + +--- 注册积分类型列表 +---@param InScoreList 可参考PlayerScoreSystem.Config.ScoreList +function PlayerScoreSystem.RegisterInfo(InScoreList) + if type(InScoreList) ~= "table" then + UGCLogSystem.LogError("[PlayerScoreSystem_RegisterInfo] InScoreType 类型错误") + end + + PlayerScoreSystem.ScoreType = table.getKeys(InScoreList) + PlayerScoreSystem.ScoreList = InScoreList + + UGCLogSystem.LogTree("[PlayerScoreSystem_RegisterInfo] ScoreType", PlayerScoreSystem.ScoreType) + UGCLogSystem.LogTree("[PlayerScoreSystem_RegisterInfo] ScoreList", PlayerScoreSystem.ScoreList) + +end + +--- Server or Client +--- 获取得分信息 +function PlayerScoreSystem.GetPlayerScoreDatas() + return PlayerScoreSystem.PlayerScoreDatas +end + +--- Server +--- 设置全部的得分信息 此操作不进行函数回调,因为有可能是GameState的参数传进来的所以有可能导致死循环 +function PlayerScoreSystem.SetPlayerScoreDatas(InPlayerScoreDatas) + PlayerScoreSystem.PlayerScoreDatas = InPlayerScoreDatas +end + +--- Server +--- 绑定GameState的更新函数,简化其他操作,所以只能绑一个 +function PlayerScoreSystem.BindChangeScoreDataCallBack(Func, Obj) + PlayerScoreSystem.ChangeScoreDataCallBackFunc = Func + PlayerScoreSystem.ChangeScoreDataCallBackObj = Obj +end + +--- Server +--- 通知回调 +function PlayerScoreSystem.NotifyChangeScoreDataCallBack() + if PlayerScoreSystem.ChangeScoreDataCallBackFunc then + if PlayerScoreSystem.ChangeScoreDataCallBackObj then + PlayerScoreSystem.ChangeScoreDataCallBackFunc(PlayerScoreSystem.ChangeScoreDataCallBackObj) + else + PlayerScoreSystem.ChangeScoreDataCallBackFunc() + end + end +end + +--- Server +--- 初始化玩家的积分信息,也可作为重置函数使用 +function PlayerScoreSystem.InitPlayerScoreData(PlayerKey, IsReset) + if PlayerScoreSystem.PlayerScoreDatas[PlayerKey] == nil or IsReset then + -- 初始化列表 + PlayerScoreSystem.PlayerScoreDatas[PlayerKey] = {} + -- 初始化信息 + for i, v in pairs(PlayerScoreSystem.ScoreType) do + PlayerScoreSystem.PlayerScoreDatas[PlayerKey][v] = 0 + end + -- 设置队伍ID + PlayerScoreSystem.PlayerScoreDatas[PlayerKey].TeamID = UGCPlayerStateSystem.GetTeamID(PlayerKey) + UGCLogSystem.Log("[PlayerScoreSystem_InitPlayerScoreData] TeamID:%s", tostring(PlayerScoreSystem.PlayerScoreDatas[PlayerKey].TeamID)) + -- 更新函数回调 + PlayerScoreSystem.NotifyChangeScoreDataCallBack() + end +end + +--- Server +--- 刷新玩家TeamID +function PlayerScoreSystem.UpdatePlayerTeamID(PlayerKey, TeamID) + if TeamID then + PlayerScoreSystem.PlayerScoreDatas[PlayerKey].TeamID = TeamID + else + PlayerScoreSystem.PlayerScoreDatas[PlayerKey].TeamID = UGCPlayerStateSystem.GetTeamID(PlayerKey) + end + UGCLogSystem.Log("[PlayerScoreSystem_UpdatePlayerTeamID] TeamID:%s", tostring(PlayerScoreSystem.PlayerScoreDatas[PlayerKey].TeamID)) + PlayerScoreSystem.NotifyChangeScoreDataCallBack() +end + +--- Server +--- 校验玩家积分信息是否初始化 +function PlayerScoreSystem.CheckPlayerScoreDataIsInit(PlayerKey) + if PlayerScoreSystem.PlayerScoreDatas[PlayerKey] == nil then + UGCLogSystem.LogError("[PlayerScoreSystem_CheckPlayerScoreDataIsInit] PlayerKey:%s, 玩家信息未注册", tostring(PlayerKey)) + PlayerScoreSystem.InitPlayerScoreData(PlayerKey) + end +end + +--- Server +--- 重置所有玩家的积分信息 +function PlayerScoreSystem.ResetAllPlayerScoreData() + for PlayerKey, v in pairs(PlayerScoreSystem.PlayerScoreDatas) do + PlayerScoreSystem.InitPlayerScoreData(PlayerKey, true) + end + PlayerScoreSystem.NotifyChangeScoreDataCallBack() +end + +--- Server +--- 添加玩家积分信息 +function PlayerScoreSystem.AddPlayerScoreData(PlayerKey, ScoreType, AddVal) + PlayerScoreSystem.CheckPlayerScoreDataIsInit(PlayerKey) + PlayerScoreSystem.PlayerScoreDatas[PlayerKey][ScoreType] = PlayerScoreSystem.PlayerScoreDatas[PlayerKey][ScoreType] + AddVal + PlayerScoreSystem.NotifyChangeScoreDataCallBack() +end + +--- Server +--- 移除玩家得分信息 +function PlayerScoreSystem.RemovePlayerScoreInfo(PlayerKey, NeedNotify) + PlayerScoreSystem.PlayerScoreDatas[PlayerKey] = nil + if NeedNotify == nil or NeedNotify then + PlayerScoreSystem.NotifyChangeScoreDataCallBack() + end +end + +--- Server +--- 清除退出的玩家得分信息 +function PlayerScoreSystem.ClearExitPlayer() + local AllPlayerKey = table.getKeys(PlayerScoreSystem.PlayerScoreDatas) + for i, v in pairs(AllPlayerKey) do + if UGCGameSystem.GetPlayerControllerByPlayerKey(v) == nil then + PlayerScoreSystem.RemovePlayerScoreInfo(v, false) + end + end + PlayerScoreSystem.NotifyChangeScoreDataCallBack() +end + +--- Server +--- 设置玩家积分信息 +function PlayerScoreSystem.SetPlayerScoreDataFromType(PlayerKey, ScoreType, Val) + PlayerScoreSystem.CheckPlayerScoreDataIsInit(PlayerKey) + PlayerScoreSystem.PlayerScoreDatas[PlayerKey][ScoreType] = Val + PlayerScoreSystem.NotifyChangeScoreDataCallBack() +end + +--- Server or Client +--- 获取玩家积分信息 +function PlayerScoreSystem.GetPlayerScoreDataFromType(PlayerKey, ScoreType) + PlayerScoreSystem.CheckPlayerScoreDataIsInit(PlayerKey) + return PlayerScoreSystem.PlayerScoreDatas[PlayerKey][ScoreType] +end + +--- Server or Client +--- 获取玩家得分 +---@return number +function PlayerScoreSystem.GetPlayerScore(PlayerKey) + PlayerScoreSystem.CheckPlayerScoreDataIsInit(PlayerKey) + local Res = 0 + for i, v in pairs(PlayerScoreSystem.PlayerScoreDatas[PlayerKey]) do + if PlayerScoreSystem.ScoreList[i] then + Res = Res + PlayerScoreSystem.ScoreList[i] * v + end + end + return Res +end + +--- Server or Client +--- 获取玩家排名 +---@param InPlayerKeys "所需排名的PlayerKeys,若为nil则全部一起排名" +---@return "table {PlayerKey, ...}" +function PlayerScoreSystem.GetRank(InPlayerKeys) + local AllPlayerKey = {} + if InPlayerKeys == nil or type(InPlayerKeys) ~= "table" then + AllPlayerKey = table.getKeys(PlayerScoreSystem.PlayerScoreDatas) + else + AllPlayerKey = InPlayerKeys + end + table.sort(AllPlayerKey, function(a, b) return PlayerScoreSystem.GetPlayerScore(a) > PlayerScoreSystem.GetPlayerScore(b) end) + return AllPlayerKey +end + +--- Server or Client +--- 获取队伍的玩家排名 +---@return "table {[TeamID] = {PlayerKey, ...}, ...}" +function PlayerScoreSystem.GetTeamRank() + local Res = {} + -- 获取队伍玩家PlayerKey + local TeamPlayers = {} + for PlayerKey, ScoreInfo in pairs(PlayerScoreSystem.PlayerScoreDatas) do + if TeamPlayers[ScoreInfo.TeamID] == nil then TeamPlayers[ScoreInfo.TeamID] = {} end + TeamPlayers[ScoreInfo.TeamID][#TeamPlayers[ScoreInfo.TeamID] + 1] = PlayerKey + end + -- 获取队伍内排名 + for TeamID, PlayerKeys in pairs(TeamPlayers) do + Res[TeamID] = PlayerScoreSystem.GetRank(PlayerKeys) + end + return Res +end + + + + + + diff --git a/CounterAttack_Solo/Script/Global/System/SoundSystem.lua b/CounterAttack_Solo/Script/Global/System/SoundSystem.lua new file mode 100644 index 00000000..67656c5a --- /dev/null +++ b/CounterAttack_Solo/Script/Global/System/SoundSystem.lua @@ -0,0 +1,151 @@ + +SoundSystem = SoundSystem or {} + +SoundSystem.ESound = { + Scoll = 1, + Click = 2, + Btn = 3, + Kill = 4, + Kill2 = 5, + Kill3 = 6, + Incentive = 7, + ActiveMechanism = 8, + MechanismKill = 9, + + HookFire = 101, + HookImpulse = 102, + Impulse = 103, + Dissipate = 104, + OkLetsGo = 105, + + IsReady = 201, + Clock = 202, + TrapOpen = 203, + GameStart = 204, + Impact = 205, -- 击打音效 + BreakWind = 206, -- 破风 + Star = 207, -- 获得星星 + Pu = 208, + + Shot_Boom = 209, + Boom2 = 210, + AddScore = 211, + Error = 212, + Right = 213, + Point = 214; + PickUpBuff = 215; + KillFX = 216; + Explosion = 217; + + -- Piano + Piano_3dd = 1073, + Piano_6dd = 1076, + Piano_2ddd = 1082, + +} + + +SoundSystem.EMusic = { + -- UGC Music + Music1 = 100001 , + Music2 = 100002 , + Music3 = 100003 , + Music4 = 100004 , + Music5 = 100005 , + Music6 = 100006 , + Music7 = 100007 , + Music8 = 100008 , + Music9 = 100009 , + Music10 = 100010 , + Music11 = 100011 , + Music12 = 100012 , + Music13 = 100013 , + +} + +SoundSystem.MusicName = { + [SoundSystem.EMusic.Music1 ] = "盛夏空投", -- 节奏 + [SoundSystem.EMusic.Music2 ] = "赛博纪元", -- 科技节奏 + [SoundSystem.EMusic.Music3 ] = "魔鬼纵队", -- 幽灵的感觉 + [SoundSystem.EMusic.Music4 ] = "勇气", -- 人声 + [SoundSystem.EMusic.Music5 ] = "四圣降临", -- 叶问的感觉 + [SoundSystem.EMusic.Music6 ] = "沙漠绿洲", -- 平静 + [SoundSystem.EMusic.Music7 ] = "锦绣年画", -- 过年 年年有余的感觉 + [SoundSystem.EMusic.Music8 ] = "电音嘉年华",--类似悬溺 + [SoundSystem.EMusic.Music9 ] = "空投行动", -- 射击长时间玩法 + [SoundSystem.EMusic.Music10] = "未来之城", -- 跑酷等 + [SoundSystem.EMusic.Music11] = "大战在即", + [SoundSystem.EMusic.Music12] = "激战隆冬", + [SoundSystem.EMusic.Music13] = "声动光影", +} + +SoundSystem.SoundList = { + [SoundSystem.ESound.Scoll] = '/Game/WwiseEvent/UI/Play_UI_Item_Change.Play_UI_Item_Change', + [SoundSystem.ESound.Click] = UGCGameSystem.GetUGCResourcesFullPath('Asset/WwiseEvent/AK_Click_2_1.AK_Click_2_1'), + [SoundSystem.ESound.Btn] = UGCGameSystem.GetUGCResourcesFullPath('Asset/WwiseEvent/AK_Button_1.AK_Button_1'), + [SoundSystem.ESound.Kill] = UGCGameSystem.GetUGCResourcesFullPath('Asset/WwiseEvent/Audio_Kill.Audio_Kill'), + [SoundSystem.ESound.Kill2] = UGCGameSystem.GetUGCResourcesFullPath('Asset/WwiseEvent/AK_Kill2_1.AK_Kill2_1'), + [SoundSystem.ESound.Kill3] = UGCGameSystem.GetUGCResourcesFullPath('Asset/WwiseEvent/AK_Kill3_1.AK_Kill3_1'), + [SoundSystem.ESound.Incentive] = '/Game/WwiseEvent/UI/Play_UI_Champion.Play_UI_Champion', + [SoundSystem.ESound.ActiveMechanism] = UGCGameSystem.GetUGCResourcesFullPath('Asset/WwiseEvent/AK_ActiveMechanism_1.AK_ActiveMechanism_1'), + [SoundSystem.ESound.MechanismKill] = UGCGameSystem.GetUGCResourcesFullPath('Asset/WwiseEvent/AK_MechanismKill_1.AK_MechanismKill_1'), + + [SoundSystem.ESound.HookFire] = UGCGameSystem.GetUGCResourcesFullPath('Asset/WwiseEvent/Ak_HookFire_1.Ak_HookFire_1'), + [SoundSystem.ESound.HookImpulse] = UGCGameSystem.GetUGCResourcesFullPath('Asset/WwiseEvent/Ak_HookImpulse_1.Ak_HookImpulse_1'), + [SoundSystem.ESound.Impulse] = UGCGameSystem.GetUGCResourcesFullPath('Asset/WwiseEvent/Ak_Impulse_1.Ak_Impulse_1'), + [SoundSystem.ESound.Dissipate] = UGCGameSystem.GetUGCResourcesFullPath('Asset/WwiseEvent/AK_Dissipate_1.AK_Dissipate_1'), + [SoundSystem.ESound.OkLetsGo] = UGCGameSystem.GetUGCResourcesFullPath('Asset/WwiseEvent/AK_OkLetsGo_1.AK_OkLetsGo_1'), + [SoundSystem.ESound.IsReady] = UGCGameSystem.GetUGCResourcesFullPath('Asset/WwiseEvent/AK_IsReady_1.AK_IsReady_1'), + [SoundSystem.ESound.Clock] = UGCGameSystem.GetUGCResourcesFullPath('Asset/WwiseEvent/T_Clock_1.T_Clock_1'), + [SoundSystem.ESound.TrapOpen] = UGCGameSystem.GetUGCResourcesFullPath('Asset/WwiseEvent/AK_OpenDoor_1.AK_OpenDoor_1'), + [SoundSystem.ESound.GameStart] = UGCGameSystem.GetUGCResourcesFullPath('Asset/WwiseEvent/AK_GameStart_1.AK_GameStart_1'), + [SoundSystem.ESound.Impact] = UGCGameSystem.GetUGCResourcesFullPath('Asset/WwiseEvent/AK_Impact_1.AK_Impact_1'), + [SoundSystem.ESound.BreakWind] = UGCGameSystem.GetUGCResourcesFullPath('Asset/WwiseEvent/AK_BreakWind_1.AK_BreakWind_1'), + [SoundSystem.ESound.Star] = UGCGameSystem.GetUGCResourcesFullPath('Asset/WwiseEvent/AK_Star_1.AK_Star_1'), + [SoundSystem.ESound.Pu] = UGCGameSystem.GetUGCResourcesFullPath('Asset/WwiseEvent/AK_PU_1.AK_PU_1'), + [SoundSystem.ESound.Shot_Boom] = UGCGameSystem.GetUGCResourcesFullPath('Asset/WwiseEvent/AT_Shot_Boom_1.AT_Shot_Boom_1'), + + [SoundSystem.ESound.Boom2] = UGCGameSystem.GetUGCResourcesFullPath('Asset/WwiseEvent/AK_Boom2_1.AK_Boom2_1'), + [SoundSystem.ESound.AddScore] = UGCGameSystem.GetUGCResourcesFullPath('Asset/WwiseEvent/AK_AddScore_1.AK_AddScore_1'), + [SoundSystem.ESound.Error] = UGCGameSystem.GetUGCResourcesFullPath('Asset/WwiseEvent/AK_Error_1.AK_Error_1'), + [SoundSystem.ESound.Right] = UGCGameSystem.GetUGCResourcesFullPath('Asset/WwiseEvent/AK_Right_1.AK_Right_1'), + [SoundSystem.ESound.Point] = UGCGameSystem.GetUGCResourcesFullPath('Asset/WwiseEvent/AK_Point_1.AK_Point_1'), + + [SoundSystem.ESound.PickUpBuff] = UGCGameSystem.GetUGCResourcesFullPath('Asset/WwiseEvent/AK_PickUpBuff_1.AK_PickUpBuff_1'); + [SoundSystem.ESound.KillFX] ='/Game/WwiseEvent/UI/Play_UI_KillEffect.Play_UI_KillEffect'; + [SoundSystem.ESound.Explosion] ='/Game/WwiseEvent/Weapon_Player/Weapon_UCAV/Play_Weapon_UCAV_Explosion.Play_Weapon_UCAV_Explosion'; + + [SoundSystem.ESound.Piano_3dd] = UGCGameSystem.GetUGCResourcesFullPath('Asset/WwiseEvent/AK_Piano_3dd_1.AK_Piano_3dd_1'), + [SoundSystem.ESound.Piano_6dd] = UGCGameSystem.GetUGCResourcesFullPath('Asset/WwiseEvent/AK_Piano_6dd_1.AK_Piano_6dd_1'), + [SoundSystem.ESound.Piano_2ddd] = UGCGameSystem.GetUGCResourcesFullPath('Asset/WwiseEvent/AK_Piano_2ddd_1.AK_Piano_2ddd_1'), + + [SoundSystem.EMusic.Music1 ] = '/Game/WwiseEvent/Music/Music_Main/Play_Music_Summer_Theme_CG014.Play_Music_Summer_Theme_CG014', + [SoundSystem.EMusic.Music2 ] = '/Game/WwiseEvent/Music/Music_Main/Play_Music_Cyberpunk_Theme.Play_Music_Cyberpunk_Theme', + [SoundSystem.EMusic.Music3 ] = '/Game/WwiseEvent/Music/Music_Main/Play_Music_Halloween.Play_Music_Halloween', + [SoundSystem.EMusic.Music4 ] = '/Game/WwiseEvent/Music/Music_Auto/Play_Music_Auto_Courage.Play_Music_Auto_Courage', + [SoundSystem.EMusic.Music5 ] = '/Game/WwiseEvent/Music/Music_Main/Play_Music_MythicalCreatures_CG011.Play_Music_MythicalCreatures_CG011', + [SoundSystem.EMusic.Music6 ] = '/Game/WwiseEvent/Music/Music_Main/Play_Music_SS6_Theme.Play_Music_SS6_Theme', + [SoundSystem.EMusic.Music7 ] = '/Game/WwiseEvent/Music/Music_Main/Play_CG021_Music_Gardens_SpringFestival_Theme.Play_CG021_Music_Gardens_SpringFestival_Theme', + [SoundSystem.EMusic.Music8 ] = '/Game/WwiseEvent/Music/Music_Main/Play_Music_717Summer_EDM.Play_Music_717Summer_EDM', + [SoundSystem.EMusic.Music9 ] = '/Game/WwiseEvent/Music/Music_Main/Play_CG018_Music_Celebration_Theme.Play_CG018_Music_Celebration_Theme', + [SoundSystem.EMusic.Music10] = '/Game/WwiseEvent/Music/Music_Main/Play_CG019_Music_FutureCity_Theme.Play_CG019_Music_FutureCity_Theme', + [SoundSystem.EMusic.Music11] = '/Game/WwiseEvent/Music/Music_Main/Play_Music_Snow_Theme_CG010.Play_Music_Snow_Theme_CG010', + [SoundSystem.EMusic.Music12] = '/Game/WwiseEvent/Music/Music_Main/Play_CG016_Music_Winter_Theme.Play_CG016_Music_Winter_Theme', + [SoundSystem.EMusic.Music13] = '/Game/WwiseEvent/Music/Music_Main/Play_Music_MovieStudio_Theme_CG015.Play_Music_MovieStudio_Theme_CG015', + +} + +function SoundSystem.PlaySound(SoundType, TargetLocation, TargetRotation) + if SoundSystem.SoundList[SoundType] ~= nil then + local AKSound = UGCSystemLibrary.LoadAsset(SoundSystem.SoundList[SoundType], true) + if TargetLocation then + if TargetRotation == nil then + TargetRotation = VectorHelper.RotZero() + end + return UGCSoundManagerSystem.PlaySoundAtLocation(AKSound, TargetLocation, TargetRotation) + else + return UGCSoundManagerSystem.PlaySound2D(AKSound) + end + end +end + diff --git a/CounterAttack_Solo/Script/Global/System/UGCDelegate.lua b/CounterAttack_Solo/Script/Global/System/UGCDelegate.lua new file mode 100644 index 00000000..f8fefa21 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/System/UGCDelegate.lua @@ -0,0 +1,37 @@ +--[[ +[使用方法] +====初始化==== +local UGCDelegate = require("Script.Common.UGCDelegate"); +local DelObj = UGCDelegate.New(self, self.SomeFunction); + +====在需要调用的地方==== +DelObj:Execute(Par1, Par2, Par3); +--]] + +---@class UGCDelegate +local UGCDelegate = LuaClass("UGCDelegate"); + +UGCDelegate.Object = nil; +UGCDelegate.Func = nil; + + +--- 构造函数 +---@param InObject any +---@param InFunc function @函数变量 +function UGCDelegate:ctor(InObject, InFunc) + self.Object = InObject; + self.Func = InFunc; +end + + +--- 调用回调函数 +function UGCDelegate:Execute(...) + if self.Object ~= nil then + self.Func(self.Object, ...); + elseif self.Func ~= nil then + self.Func(...); + end +end + + +return UGCDelegate; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/System/UGCDelegateMulticast.lua b/CounterAttack_Solo/Script/Global/System/UGCDelegateMulticast.lua new file mode 100644 index 00000000..e3565835 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/System/UGCDelegateMulticast.lua @@ -0,0 +1,66 @@ +--[[ +[使用方法] +====初始化==== +local UGCDelegateMulticast = require("Script.Common.UGCDelegateMulticast"); +local DelObj = UGCDelegate.New(self, self.SomeFunction); +DelObj:Add(self, self.AnotherFunction); + +====在需要调用的地方==== +DelObj:Broadcast(Par1, Par2, Par3); +--]] + +---@class UGCDelegateMulticast +local UGCDelegateMulticast = LuaClass("UGCDelegateMulticast"); + +--- 绑定回调函数列表 +UGCDelegateMulticast.EventsHandler = {}; + + +--- 构造函数 +---@param InObject any +---@param InFunc function @函数变量 +function UGCDelegateMulticast:ctor(InObject, InFunc) + UGCDelegateMulticast:Add(InObject, InFunc); +end + + +--- 添加回调函数 +---@param InObject any +---@param InFunc function @函数变量 +function UGCDelegateMulticast:Add(InObject, InFunc) + table.insert(UGCDelegateMulticast.EventsHandler, {Object=InObject, Func=InFunc}); +end + + +--- 移除回调函数 +---@param InObject any +---@param InFunc function @函数变量 +function UGCDelegateMulticast:Remove(InObject, InFunc) + for _, FuncData in pairs(UGCDelegateMulticast.EventsHandler) do + if FuncData.Object == InObject and FuncData.Func == InFunc then + FuncData.Object = nil; + FuncData.Func = nil; + end + end +end + + +--- 清除所有的回调绑定 +function UGCDelegateMulticast:Clear() + self.EventsHandler = {}; +end + + +--- 调用所有的回调函数 +function UGCDelegateMulticast:Broadcast(...) + for _, FuncData in pairs(UGCDelegateMulticast.EventsHandler) do + if FuncData.Object ~= nil then + FuncData.Func(FuncData.Object, ...); + elseif FuncData.Func ~= nil then + FuncData.Func(...); + end + end +end + + +return UGCDelegateMulticast; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/System/UGCEventSystem.lua b/CounterAttack_Solo/Script/Global/System/UGCEventSystem.lua new file mode 100644 index 00000000..d354ff6c --- /dev/null +++ b/CounterAttack_Solo/Script/Global/System/UGCEventSystem.lua @@ -0,0 +1,108 @@ +UGCEventSystem = UGCEventSystem or {} + +UGCEventSystem.Events = {} + +-- 添加监听 +function UGCEventSystem.AddListener(EventType, Func, Object) + if EventType == nil or Func == nil or type(Func) ~= "function" then + UGCLogSystem.LogError("[UGCEventSystem_AddListener] EventType or Func is nil!") + return + end + + local FuncData = {} + FuncData.Object = Object + FuncData.Func = Func + + if UGCEventSystem.Events[EventType]==nil then + local NewEventFuncs={} + table.insert(NewEventFuncs ,FuncData) + UGCEventSystem.Events[EventType] = NewEventFuncs + --UGCLogSystem.Log("[UGCEventSystem_AddListener] EventType[%s], Func[%s]", tostring(EventType), tostring(Func)) + else + table.insert(UGCEventSystem.Events[EventType], FuncData) + --UGCLogSystem.Log("[UGCEventSystem_AddListener] EventType[%s], Func[%s]", tostring(EventType), tostring(Func)) + end +end + +-- 移除监听 +function UGCEventSystem.RemoveListener(EventType, Func, Object) + if EventType == nil or Func == nil then + UGCLogSystem.LogError("[UGCEventSystem_RemoveListener] EventType or Func is nil!") + return + end + if UGCEventSystem.Events[EventType] ~= nil then + for i = #UGCEventSystem.Events[EventType], 1, -1 do + local FuncData = UGCEventSystem.Events[EventType][i] + if FuncData.Func == Func and FuncData.Object == Object then + local result = table.remove(UGCEventSystem.Events[EventType], i) + UGCLogSystem.Log("[UGCEventSystem_RemoveListener] EventType[%s], Func[%s]", tostring(EventType), tostring(result)) + break + end + end + else + UGCLogSystem.LogError("[UGCEventSystem_RemoveListener] EventFuncs[%s] is nil!", tostring(EventType)) + end +end + +-- 派发事件 +function UGCEventSystem.SendEvent(EventType, ...) + UGCLogSystem.Log("[UGCEventSystem_SendEvent] EventType: %s", tostring(EventType)) + if EventType ~= nil then + local EventFuncs = UGCEventSystem.Events[EventType]; + if EventFuncs ~= nil then + for i, FuncData in pairs(EventFuncs) do + if FuncData.Object ~= nil then + FuncData.Func(FuncData.Object, ...) + else + FuncData.Func(...) + end + end + else + UGCLogSystem.LogError("[UGCEventSystem_SendEvent] EventFuncs[%s] is nil!", tostring(EventType)) + end + end +end + +--- SetTimer +---@param Obj UObject +---@param Fun fun() +---@param IntevalSeconds float +---@return TimerHandle +function UGCEventSystem.SetTimer(Obj, Fun, IntevalSeconds) + UGCLogSystem.Log("[UGCEventSystem_SetTimer] 设置定时器 %s:%s", UE.GetPathName(Obj), tostring(Fun)) + local TimerDelegate = ObjectExtend.CreateDelegate(Obj, Fun, Obj) + local Handle = KismetSystemLibrary.K2_SetTimerDelegateForLua(TimerDelegate, Obj, IntevalSeconds, false) + local R = {} + R.Object = Obj + R.Handle = Handle + return R +end + +--- SetTimerLoop +---@param Obj UObject +---@param Fun fun() +---@param IntevalSeconds float +---@return TimerHandle +function UGCEventSystem.SetTimerLoop(Obj, Fun, IntevalSeconds) + local TimerDelegate = ObjectExtend.CreateDelegate(Obj, Fun, Obj); + local Handle = KismetSystemLibrary.K2_SetTimerDelegateForLua(TimerDelegate, Obj, IntevalSeconds, true); + local R = {}; + R.Object = Obj; + R.Handle = Handle; + + UGCLogSystem.Log("[UGCEventSystem_SetTimerLoop] 设置循环定时器 %s:%s H:%s", UE.GetPathName(Obj), tostring(Fun), tostring(R)); + return R; +end + +--- StopTimer +---@param HandlePair TimerHandle +function UGCEventSystem.StopTimer(HandlePair) + if HandlePair == nil then + UGCLogSystem.LogError("[UGCEventSystem_StopTimer] HandlePair is nil") + else + UGCLogSystem.Log("[UGCEventSystem_StopTimer] 停止定时器 Object:%s Handle:%s", UE.GetPathName(HandlePair.Object), tostring(HandlePair.Handle)); + KismetSystemLibrary.K2_ClearTimerHandle(HandlePair.Object, HandlePair.Handle); + end +end + +return UGCEventSystem \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/System/UGCLogSystem.lua b/CounterAttack_Solo/Script/Global/System/UGCLogSystem.lua new file mode 100644 index 00000000..1a1393ee --- /dev/null +++ b/CounterAttack_Solo/Script/Global/System/UGCLogSystem.lua @@ -0,0 +1,46 @@ +--- +--- Generated by EmmyLua(https://github.com/EmmyLua) +--- Created by LT. +--- DateTime: 2023/10/29 15:49 +--- +UGCLogSystem = UGCLogSystem or {} + +UGCLogSystem.EnableLog = true +function UGCLogSystem.SetEnableLog(isEnable) + UGCLogSystem.EnableLog = isEnable +end + +function UGCLogSystem.LogTag() + return "[UGCLogSystem] " .. (UGCGameSystem.IsServer() and "[Server]" or "[Client]") +end + + + +function UGCLogSystem.Print(Log) + if not UGCLogSystem.EnableLog then return end + print(Log) +end + +function UGCLogSystem.Log(Fmt, ...) + if not UGCLogSystem.EnableLog then return end + + local LogStr = UGCLogSystem.LogTag()..string.format(Fmt, ...) + UGCLogSystem.Print(LogStr) +end + +function UGCLogSystem.LogTree(Fmt, OutTable) + if not UGCLogSystem.EnableLog then return end + log_tree(Fmt, OutTable) +end + +function UGCLogSystem.UGCLog(Fmt, ...) + if not UGCLogSystem.EnableLog then return end + ugcprint(string.format(Fmt, ...)); +end + +function UGCLogSystem.LogError(Fmt, ...) + if not UGCLogSystem.EnableLog then return end + + local LogStr = UGCLogSystem.LogTag().."[LogicError]"..string.format(Fmt, ...) + UGCLogSystem.Print(LogStr) +end \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/System/UGCSendRPCSystem.lua b/CounterAttack_Solo/Script/Global/System/UGCSendRPCSystem.lua new file mode 100644 index 00000000..0d47b995 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/System/UGCSendRPCSystem.lua @@ -0,0 +1,114 @@ +--[[ +需要委托绑定初始化:InitUGCSendRPCSystem +服务器客户端处均可初始化,仅一方初始化则只能在该位置发起RPC 建议在服务器和客户端均执行InitUGCSendRPCSystem +InTargetObj内的目标RPC函数必须调用UGCSendRPCSystem.RPCFunc(...)如下 +function UGCGameState:UGCSendRPCSystemFunc(...) UGCSendRPCSystem.RPCFunc(...) end +]]-- + +UGCSendRPCSystem = UGCSendRPCSystem or {} + +UGCSendRPCSystem.DelegationObj = nil +UGCSendRPCSystem.DelegationFuncName = "" + +---@param InTargetObj AActor* +---@param InUGCSendRPCSystemFuncName string +function UGCSendRPCSystem.InitUGCSendRPCSystem(InTargetObj, InUGCSendRPCSystemFuncName) + if UE.IsValid(InTargetObj) and type(InTargetObj[InUGCSendRPCSystemFuncName]) == "function" then + UGCSendRPCSystem.DelegationObj = InTargetObj + UGCSendRPCSystem.DelegationFuncName = InUGCSendRPCSystemFuncName + end +end + + +--- RPC自动发送 TargetPlayer为nil则广播到所有客户端,为table则发送到包含的客户端,为int32则发送到目标客户端 +---@param RPCFuncName UGCSendRPCSystem的函数名称 +---@param InTargetPlayer multi nil/table/int32 +---@param ... any 事件输入的可变参数 +function UGCSendRPCSystem.AutoTriggerRPC(RPCFuncName, InTargetPlayer, ...) + if not UGCSendRPCSystem.CheckUGCSendRPCSystem() then + UGCLogSystem.LogError("[UGCSendRPCSystem_AutoTriggerRPC] not initialized") + return false + end + + if InTargetPlayer == nil then + if UGCGameSystem.IsServer() then + UnrealNetwork.CallUnrealRPC_Multicast(UGCSendRPCSystem.DelegationObj, UGCSendRPCSystem.DelegationFuncName, RPCFuncName, ...) + else + local TargetController = STExtraGameplayStatics.GetFirstPlayerController(UGCGameSystem.GameState) + if UE.IsValid(TargetController) then UnrealNetwork.CallUnrealRPC(TargetController, UGCSendRPCSystem.DelegationObj, UGCSendRPCSystem.DelegationFuncName, RPCFuncName, ...) end + end + elseif type(InTargetPlayer) == "number" then + local TargetController = nil + if UGCGameSystem.IsServer() then + TargetController = UGCGameSystem.GetPlayerControllerByPlayerKey(InTargetPlayer) + else + TargetController = STExtraGameplayStatics.GetFirstPlayerController(UGCGameSystem.GameState) + end + + if UE.IsValid(TargetController) then UnrealNetwork.CallUnrealRPC(TargetController, UGCSendRPCSystem.DelegationObj, UGCSendRPCSystem.DelegationFuncName, RPCFuncName, ...) end + elseif type(InTargetPlayer) == "table" and UGCGameSystem.IsServer() then + for _, PlayerKey in pairs(InTargetPlayer) do + local TargetController = UGCGameSystem.GetPlayerControllerByPlayerKey(PlayerKey) + if UE.IsValid(TargetController) then UnrealNetwork.CallUnrealRPC(TargetController, UGCSendRPCSystem.DelegationObj, UGCSendRPCSystem.DelegationFuncName, RPCFuncName, ...) end + end + end + +end + +function UGCSendRPCSystem.RPCFunc(FuncName, ...) UGCSendRPCSystem[FuncName](...) end + +function UGCSendRPCSystem.CheckUGCSendRPCSystem() return UE.IsValid(UGCSendRPCSystem.DelegationObj) end + + +------------------------------------------- Delegation Func ------------------------------------------- + +--- RPC委托调用事件 +function UGCSendRPCSystem.RPCEvent(TargetPlayer, EventType, ...) UGCSendRPCSystem.AutoTriggerRPC("RPC_RPCEvent", TargetPlayer, EventType, ... ) end + +function UGCSendRPCSystem.RPC_RPCEvent(EventType, ...) UGCEventSystem.SendEvent(EventType, ...) end + +--- RPC委托触发Actor的函数 +function UGCSendRPCSystem.ActorRPCNotify(TargetPlayer, TargetActor, FuncName, ...) UGCSendRPCSystem.AutoTriggerRPC("RPC_ActorRPCNotify", TargetPlayer, TargetActor, FuncName, ... ) end + +function UGCSendRPCSystem.RPC_ActorRPCNotify(TargetActor, FuncName, ...) + if UE.IsValid(TargetActor) then + TargetActor[FuncName](TargetActor, ...) + else + UGCLogSystem.LogError("[UGCSendRPCSystem_RPC_ActorRPCNotify] Actor is nil. FuncName:%s", FuncName) + end +end + +--- RPC委托触发模式编辑器的事件 +function UGCSendRPCSystem.PlayActionEvent(TargetPlayer, EventName, ...) UGCSendRPCSystem.AutoTriggerRPC("RPC_PlayActionEvent", TargetPlayer, EventName, ... ) end + +function UGCSendRPCSystem.RPC_PlayActionEvent(EventName, ...) UGCGameSystem.SendModeCustomEvent(EventName, ...) end + +--- 客户端显示隐藏UI +function UGCSendRPCSystem.ClientShowUI(TargetPlayer, UIType, bShow, NeedClosePeerPanel, ...) + if UGCGameSystem.IsServer() then + if bShow == nil then bShow = true end + if NeedClosePeerPanel == nil then NeedClosePeerPanel = false end + UGCSendRPCSystem.AutoTriggerRPC("RPC_ClientShowUI", TargetPlayer, UIType, bShow, NeedClosePeerPanel, ... ) + else + UGCLogSystem.LogError("[UGCSendRPCSystem_ClientShowUI] 仅服务器调用生效 UIType:%s", tostring(UIType)) + end +end + +function UGCSendRPCSystem.RPC_ClientShowUI(UIType, bShow, NeedClosePeerPanel, ...) + if bShow then WidgetManager:ShowPanel(UIType, NeedClosePeerPanel, ...) else WidgetManager:ClosePanel(UIType) end +end + +function UGCSendRPCSystem.ExeStaticLogic(TargetPlayer, LogicType, FuncName, ...) + UGCSendRPCSystem.AutoTriggerRPC("RPC_ExeStaticLogic", TargetPlayer, LogicType, FuncName, ... ) +end + +function UGCSendRPCSystem.RPC_ExeStaticLogic(LogicType, FuncName, ...) + if table.hasValue(LogicConfig.ELogicType, LogicType) then + UGCLogSystem.Log("[UGCSendRPCSystem_RPC_ExeStaticLogic] FuncName:%s", FuncName) + local LogicStatic = require(LogicConfig.RequireList[LogicType]) + UGCLogSystem.LogTree("[UGCSendRPCSystem_RPC_ExeStaticLogic] ", LogicStatic) + LogicStatic[FuncName](...) + else + UGCLogSystem.LogError("[UGCSendRPCSystem_RPC_ExeStaticLogic] LogicConfig.ELogicType[%s] is nil ", tostring(LogicType)) + end +end \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/System/UGCSystemLibrary.lua b/CounterAttack_Solo/Script/Global/System/UGCSystemLibrary.lua new file mode 100644 index 00000000..079f8213 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/System/UGCSystemLibrary.lua @@ -0,0 +1,760 @@ +UGCSystemLibrary = UGCSystemLibrary or {} + +UGCSystemLibrary.IsServer = nil +-- 缓存的资产 +UGCSystemLibrary.CacheAsset = {} + + + + +------------------------------------------------ 获取本地信息 ------------------------------------------------ + +function UGCSystemLibrary.GetLocalPlayerController() + if not UE.IsValid(UGCSystemLibrary.LocalController) and UGCGameSystem.GameState then + UGCSystemLibrary.LocalController = STExtraGameplayStatics.GetFirstPlayerController(UGCGameSystem.GameState) + end + return UGCSystemLibrary.LocalController +end + +function UGCSystemLibrary.GetLocalPlayerKey() return UGCSystemLibrary.GetLocalPlayerController().PlayerKey end + +function UGCSystemLibrary.GetLocalPlayerPawn() return UGCGameSystem.GetPlayerPawnByPlayerKey(UGCSystemLibrary.GetLocalPlayerKey()) end + +function UGCSystemLibrary.GetGameTime() + if UGCGameSystem.GameState then + return KismetSystemLibrary.GetGameTimeInSeconds(UGCGameSystem.GameState) + else + return 0. + end +end + +---------------------------------------------- 获取本地信息 End ---------------------------------------------- + + +--- 通过资产路径去获取场景唯一实例 +---@param AssetPath string +function UGCSystemLibrary.GetUniqueInstanceFromPath(AssetPath) + local ObjClass = UE.LoadClass(AssetPath) + if UE.IsValid(ObjClass) then + local AllActor = ScriptGameplayStatics.GetActorsOfClass(UGCGameSystem.GameState, ObjClass) + for i, v in pairs(AllActor) do return v end + end + return nil +end + + + +local RootPackagePath = UGCMapInfoLib.GetRootLongPackagePath() + +function UGCSystemLibrary.GetFullPath(InPath) + if type(InPath) ~= "string" then return "" end + + if #RootPackagePath > #InPath or string.sub(InPath, 1, #RootPackagePath) ~= RootPackagePath then + InPath = RootPackagePath..InPath + end + + return InPath +end + + +------------------------------------------ Load ------------------------------------------ +--- {URL = Asset} +UGCSystemLibrary.DownloadImageAsset = {} +--- 下载图像 +function UGCSystemLibrary.DownloadImage(URL, bSaveAsset, CallBackFunc, Obj) + if UE.IsValid(UGCSystemLibrary.DownloadImageAsset[URL]) then + if Obj then + CallBackFunc(Obj, UGCSystemLibrary.DownloadImageAsset[URL]) + else + CallBackFunc(UGCSystemLibrary.DownloadImageAsset[URL]) + end + else + + local ResHandle = AsyncTaskDownloadImage.DownloadImage(URL) + --ResHandle.OnSuccess:Add(CallBackFunc, Obj) + --ResHandle.OnFail:Add(CallBackFunc, Obj) + ResHandle.OnSuccess:Add(CallBackFunc) + ResHandle.OnFail:Add(CallBackFunc) + if bSaveAsset then + ResHandle.OnSuccess:Add( + function(Texture) + UGCSystemLibrary.DownloadImageAsset[URL] = Texture + end + ) + end + end +end + + +UGCSystemLibrary.DownloadImageCache = {} +--- 下载图像至UImage +---@param Image UImage* +---@param URL string +---@param IsSave boolean +function UGCSystemLibrary.DownloadImageToUImage(Image, URL, IsSave) + if UE.IsValid(UGCSystemLibrary.DownloadImageCache[URL]) then + Image:SetBrushFromTextureDynamic(UGCSystemLibrary.DownloadImageCache[URL]) + else + UGCSystemLibrary.DownloadImage(URL, true, + function(Texture) + if UE.IsValid(Texture) then + Image:SetBrushFromTextureDynamic(Texture) + if IsSave then + UGCSystemLibrary.DownloadImageCache[URL] = Texture + end + else + UGCLogSystem.LogError("[UGCSystemLibrary_DownloadImageToUImage] Download Texture Failure. URL: %s", URL) + end + end + ) + end +end + +---------------------------------------- Load End ---------------------------------------- + +-- OverlappedComponent, OtherActor, OtherComp, OtherBodyIndex, bFromSweep, SweepResult +function UGCSystemLibrary.BindBeginOverlapFunc(CollisionComponent, Func, Obj) CollisionComponent.OnComponentBeginOverlap:Add(Func, Obj) end + +function UGCSystemLibrary.BindEndOverlapFunc(CollisionComponent, Func, Obj) CollisionComponent.OnComponentEndOverlap:Add(Func, Obj) end + + +function UGCSystemLibrary.formatTime(seconds, ShowMinutes, ShowHours, ShowRemainingSeconds) + if ShowMinutes == nil then ShowMinutes = false end + if ShowHours == nil then ShowHours = false end + if ShowRemainingSeconds == nil then ShowRemainingSeconds = false end + local hours = math.floor(seconds / 3600) + local minutes = math.floor((seconds - hours * 3600) / 60) + local remainingSeconds = seconds - hours * 3600 - minutes * 60 + local ResTime = "" + ResTime = ResTime .. ((hours > 0 or ShowHours) and string.format("%02d:", hours) or "") + ResTime = ResTime .. ((minutes > 0 or hours > 0 or ShowHours or ShowMinutes) and string.format("%02d:", minutes) or "") + ResTime = ResTime .. (ShowRemainingSeconds and string.format("%02.3f", remainingSeconds) or string.format("%02.0f", remainingSeconds)) + return ResTime +end + +---@param AssetPath:string +---@param CallBackFunc:fun(LoadObject:UObject,resID:int32) +---@param Obj:table CallBackFunc拥有者 +---@param SaveAsset:bool 是否保存 +function UGCSystemLibrary.AsyncLoadAsset(AssetPath, CallBackFunc, Obj, SaveAsset) + if not UE.IsValid(UGCSystemLibrary.CacheAsset[AssetPath]) then + local softObjPath = KismetSystemLibrary.MakeSoftObjectPath(AssetPath); + STExtraBlueprintFunctionLibrary.GetAssetByAssetReferenceAsync(softObjPath, + ObjectExtend.CreateDelegate(UGCGameSystem.GameState, function(LoadObject, resID) + if CallBackFunc then + if Obj ~= nil then CallBackFunc(Obj, LoadObject) else CallBackFunc(LoadObject) end + end + if UE.IsValid(LoadObject) and SaveAsset then UGCSystemLibrary.CacheAsset[AssetPath] = LoadObject end + end), true); + else + if CallBackFunc then + if Obj ~= nil then CallBackFunc(Obj, UGCSystemLibrary.CacheAsset[AssetPath]) else CallBackFunc(UGCSystemLibrary.CacheAsset[AssetPath]) end + end + end +end + +---@param AssetPath:string +---@param SaveAsset:bool 是否保存 +function UGCSystemLibrary.LoadAsset(AssetPath, SaveAsset) + if SaveAsset == nil then SaveAsset = true end + if not UE.IsValid(UGCSystemLibrary.CacheAsset[AssetPath]) then + local TargetAsset = UE.LoadObject(AssetPath) + if SaveAsset and UE.IsValid(TargetAsset) then UGCSystemLibrary.CacheAsset[AssetPath] = TargetAsset end + return TargetAsset + else + return UGCSystemLibrary.CacheAsset[AssetPath] + end +end + +--- 通过ItemID获取item类型 +---@param ItemID int +---@return ItemTypeID int +function UGCSystemLibrary.GetItemTypeID(ItemID) return ItemID // 1000 end + +--- 输入PlayerKey获取活着的玩家,若玩家已死亡或者不存在PlayerKey对应的Pawn时则返回nil +---@param PlayerKey uint +---@return Pawn +function UGCSystemLibrary.GetAlivePlayerPawnByPlayerKey(PlayerKey) + local PlayerPawn = UGCGameSystem.GetPlayerPawnByPlayerKey(PlayerKey) + return (UE.IsValid(PlayerPawn) and PlayerPawn:IsAlive()) and PlayerPawn or nil +end + + + +--- 最多循环加50次 +UGCSystemLibrary.LoopAddItemCountMax = 50 +UGCSystemLibrary.LoopAddItemHandle = nil +UGCSystemLibrary.PlayerAddItemInfo = {} -- PlayerKey = {ItemID, Count, LoopNum} +---添加道具 +---生效范围:服务器 +---@return IsSucceed bool +---@param PlayerPawn PlayerPawn* @玩家角色 +---@param ItemID int @物品ID +---@param Count int @数量 +function UGCSystemLibrary.AddItem(PlayerPawn, ItemID, Count) + + if UE.IsValid(PlayerPawn) then + local bSucceed = UGCBackPackSystem.AddItem(PlayerPawn, ItemID, Count) + if not bSucceed then + UGCLogSystem.Log("[UGCSystemLibrary_AddItem]") + if UGCSystemLibrary.PlayerAddItemInfo[PlayerPawn.PlayerKey] == nil then + UGCSystemLibrary.PlayerAddItemInfo[PlayerPawn.PlayerKey] = {} + end + UGCSystemLibrary.PlayerAddItemInfo[PlayerPawn.PlayerKey][#UGCSystemLibrary.PlayerAddItemInfo[PlayerPawn.PlayerKey] + 1] = {ItemID = ItemID, Count = Count, LoopNum = 0} + if UGCSystemLibrary.LoopAddItemHandle == nil then + UGCSystemLibrary.LoopAddItemHandle = UGCEventSystem.SetTimerLoop(UGCGameSystem.GameState, + function() + local PlayerKeys = table.getKeys(UGCSystemLibrary.PlayerAddItemInfo) + for _, PlayerKey in PlayerKeys do + local ItemInfos = table.DeepCopy(UGCSystemLibrary.PlayerAddItemInfo[PlayerKey]) + local TargetPawn = UGCGameSystem.GetPlayerPawnByPlayerKey(PlayerKey) + if UE.IsValid(TargetPawn) then + for i = #ItemInfos, 1, 1 do + bSucceed = UGCBackPackSystem.AddItem(TargetPawn, ItemInfos[i].ItemID, ItemInfos[i].Count) + -- 成功加入或者超过添加次数则移除 + if bSucceed then + UGCSystemLibrary.PlayerAddItemInfo[PlayerKey][i] = nil + else + if ItemInfos[i].LoopNum >= UGCSystemLibrary.LoopAddItemCountMax then + UGCLogSystem.LogError("[UGCSystemLibrary_AddItem] PlayerKey:%s,AddItem:%s Failue", tostring(PlayerKey), tostring(ItemInfos[i].ItemID)) + else + ItemInfos[i].LoopNum = ItemInfos[i].LoopNum + 1 + end + end + end + if #UGCSystemLibrary.PlayerAddItemInfo[PlayerKey] == 0 then + UGCSystemLibrary.PlayerAddItemInfo[PlayerKey] = nil + end + else + UGCSystemLibrary.PlayerAddItemInfo[PlayerKey] = nil + end + end + if table.getCount(UGCSystemLibrary.PlayerAddItemInfo) == 0 then + UGCEventSystem.StopTimer(UGCSystemLibrary.LoopAddItemHandle) + end + UGCLogSystem.Log("[UGCSystemLibrary_AddItem] Finish") + end, + 0.1 + ) + end + end + else + UGCLogSystem.LogError("[UGCSystemLibrary_AddItem] PlayerPawn is nil") + end + +end + +--- 判断物体是否可以看到玩家 +---@param ObjectContext 目标物体 +---@param EyePos 物体开始检测的位置 +---@param TargetPlayerPawn 目标玩家 +---@param LineTraceChannels 检测的通道,默认为{ECollisionChannel.ECC_WorldStatic, ECollisionChannel.ECC_WorldDynamic, ECollisionChannel.ECC_Pawn} +function UGCSystemLibrary.CanSeePlayer(ObjectContext, EyePos, TargetPlayerPawn, LineTraceChannels) + if not (UE.IsValid(ObjectContext) and UE.IsValid(TargetPlayerPawn)) then + return + end + + if LineTraceChannels == nil then + LineTraceChannels = {ECollisionChannel.ECC_WorldStatic, ECollisionChannel.ECC_WorldDynamic, ECollisionChannel.ECC_Pawn} + end + -- UGCLogSystem.Log("[UGCSystemLibrary_CanSeePlayer] TargetPlayerPawn:%s", KismetSystemLibrary.GetObjectName(TargetPlayerPawn)) + --local SkeletonSocketNames = {"head", "spine_01", "hand_l", "hand_r", "foot_r", "foot_l"} + local PawnPos = TargetPlayerPawn:K2_GetActorLocation() + local UpPawnPos = table.DeepCopy(PawnPos) + local DownPawnPos = table.DeepCopy(PawnPos) + UpPawnPos.Z = UpPawnPos.Z + 80 + DownPawnPos.Z = DownPawnPos.Z - 80 + --for i, SocketName in pairs(SkeletonSocketNames) do + for i, EndPos in pairs({UpPawnPos, PawnPos, DownPawnPos}) do + -- local BornSocketPos = TargetPlayerPawn.Mesh:GetSocketLocation(SocketName) + --if BornSocketPos then + ---@field LineTraceSingleForObjects fun(WorldContextObject:UObject,Start:FVector,End:FVector,ObjectTypes:ULuaArrayHelper,bTraceComplex:bool,ActorsToIgnore:ULuaArrayHelper,DrawDebugType:EDrawDebugTrace,OutHit:FHitResult,bIgnoreSelf:bool,TraceColor:FLinearColor,TraceHitColor:FLinearColor,DrawTime:float):bool,FHitResult + local bSucceed, HitResult = KismetSystemLibrary.LineTraceSingleForObjects(ObjectContext, EyePos, EndPos, LineTraceChannels, false, {ObjectContext, }) + if bSucceed then + local HitActor = HitResult.Actor:Get() + if HitActor == TargetPlayerPawn then + return true + else + UGCLogSystem.Log("[UGCSystemLibrary_CanSeePlayer]HitActorName:%s", KismetSystemLibrary.GetObjectName(HitActor)) + end + end + --else + -- UGCLogSystem.LogError("[UGCSystemLibrary_CanSeePlayer] BornSocketPos is nil") + --end + end + return false +end + + +--- 通过类名销毁物体 +--- 拾取物"PickUpWrapperActor" +--- 死亡盒子"PlayerTombBox" +--- 已投出的投掷物 "EliteProjectile" +function UGCSystemLibrary.RemoveActorFromClassName(ClassName) + local PlayerTombBoxClass = ScriptGameplayStatics.FindClass(ClassName); + if UE.IsValid(PlayerTombBoxClass) then + local PlayerTombBoxs = ScriptGameplayStatics.GetActorsOfClass(UGCGameSystem.GameState, PlayerTombBoxClass, {}) + for i, PlayerTombBox in ipairs(PlayerTombBoxs) do + if PlayerTombBox ~= nil then + PlayerTombBox:K2_DestroyActor(); + end + end + else + UGCLogSystem.LogError("[UGCSystemLibrary_RemoveActorFromClassName] %sClass is not Valid", tostring(ClassName)) + end +end + +--- 清除PickUpActor 忽略传入的ItemID +function UGCSystemLibrary.ClearPickUpActor(IgnoreItemIDs) + if IgnoreItemIDs == nil then + IgnoreItemIDs = {} + end + local PickUpActorClass = ScriptGameplayStatics.FindClass("PickUpWrapperActor"); + if UE.IsValid(PickUpActorClass) then + local PickUpActors = ScriptGameplayStatics.GetActorsOfClass(UGCGameSystem.GameState, PickUpActorClass, {}) + -- + for i, PickUpActor in ipairs(PickUpActors) do + if PickUpActor ~= nil then + local ItemID = PickUpActor.DefineID.TypeSpecificID + -- UGCLogSystem.Log("[UGCSystemLibrary_ClearPickUpActor]ItemID:%s", tostring(ItemID)) + if not table.hasValue(IgnoreItemIDs, ItemID) then + PickUpActor:K2_DestroyActor(); + end + end + end + else + UGCLogSystem.LogError("[UGCSystemLibrary_ClearPickUpActor] PickUpWrapperActor Class is not Valid") + end +end + +-- [PlayerKey] = {Handle, RespawnGameTime} +UGCSystemLibrary.RespawnPlayerHandlesInfo = {} +-- 重置玩家 +function UGCSystemLibrary.RespawnPlayer(PlayerKey, Time) + -- 不进行瞬时重生,防止同一帧重复调用 + if Time == nil then Time = 0.1 end + local NowTime = UGCSystemLibrary.GetGameTime() + local RespawnHandleInfo = UGCSystemLibrary.RespawnPlayerHandlesInfo[PlayerKey] + if RespawnHandleInfo then + -- 若多次调用则仅采用长的复活时间 + if Time + NowTime <= RespawnHandleInfo.RespawnGameTime then + return + end + end + + -- 删除之前的复活Handle + if UGCSystemLibrary.RespawnPlayerHandlesInfo[PlayerKey] then + UGCEventSystem.StopTimer(UGCSystemLibrary.RespawnPlayerHandlesInfo[PlayerKey].Handle) + end + UGCSystemLibrary.RespawnPlayerHandlesInfo[PlayerKey] = {} + -- 构建新的符合Handle + UGCSystemLibrary.RespawnPlayerHandlesInfo[PlayerKey].Handle = UGCEventSystem.SetTimer(UGCGameSystem.GameState, function() + UGCSystemLibrary.RespawnPlayerHandlesInfo[PlayerKey] = nil + local PlayerPawn = UGCGameSystem.GetPlayerPawnByPlayerKey(PlayerKey) + if UE.IsValid(PlayerPawn) then + PlayerPawn:K2_DestroyActor() + end + UGCGameSystem.RespawnPlayer(PlayerKey) + end, Time) + UGCSystemLibrary.RespawnPlayerHandlesInfo[PlayerKey].RespawnGameTime = Time + NowTime + +end + +function UGCSystemLibrary.RespawnPlayer_V2(PlayerKey, Time) + + -- 不进行瞬时重生,防止同一帧重复调用 + if Time == nil then Time = 0.1 end + local NowTime = UGCSystemLibrary.GetGameTime() + local RespawnHandleInfo = UGCSystemLibrary.RespawnPlayerHandlesInfo[PlayerKey] + if RespawnHandleInfo then + -- 若多次调用则仅采用长的复活时间 + if Time + NowTime <= RespawnHandleInfo.RespawnGameTime then + return + end + end + + -- 删除之前的复活Handle + if UGCSystemLibrary.RespawnPlayerHandlesInfo[PlayerKey] then + UGCEventSystem.StopTimer(UGCSystemLibrary.RespawnPlayerHandlesInfo[PlayerKey].Handle) + end + UGCSystemLibrary.RespawnPlayerHandlesInfo[PlayerKey] = {} + -- 构建新的符合Handle + UGCSystemLibrary.RespawnPlayerHandlesInfo[PlayerKey].Handle = UGCEventSystem.SetTimer(UGCGameSystem.GameState, function() + UGCSystemLibrary.RespawnPlayerHandlesInfo[PlayerKey] = nil + local PlayerPawn = UGCGameSystem.GetPlayerPawnByPlayerKey(PlayerKey) + if UE.IsValid(PlayerPawn) then + PlayerPawn:K2_DestroyActor() + end + local PC = UGCGameSystem.GetPlayerControllerByPlayerKey(PlayerKey) + if UE.IsValid(PC) then + -- UGCGameSystem.GameMode:RestartPlayer(PC) + local DefaultPawnClass = UGCGameSystem.GameMode:GetDefaultPawnClassForController(PC) + if DefaultPawnClass then + local Pawn = UGCGameSystem.SpawnActor(UGCGameSystem.GameState, DefaultPawnClass, VectorHelper.VectorZero(), VectorHelper.RotZero(), VectorHelper.ScaleOne()) + PC:Possess(Pawn) + -- 将玩家重置到出生点 + UGCEventSystem.SendEvent(EventEnum.ResetPlayerTransformToPlayerStart, PC, Pawn) + UGCLogSystem.Log("[UGCSystemLibrary_RespawnPlayer_V2] Finish") + else + UGCLogSystem.LogError("[UGCSystemLibrary_RespawnPlayer_V2]DefaultPawnClass is nil") + end + + else + UGCLogSystem.LogError("[UGCSystemLibrary_RespawnPlayer_V2] [%s]PC is nil", tostring(PlayerKey)) + end + + + end, Time) + UGCSystemLibrary.RespawnPlayerHandlesInfo[PlayerKey].RespawnGameTime = Time + NowTime +end + +--- Server +--- 设置pawn是否可移动 +function UGCSystemLibrary.SetPlayerPawnMovable(InPawn, IsMovable) + UGCPawnSystem.DisabledPawnState(InPawn, EPawnState.Move , not IsMovable); + UGCPawnSystem.DisabledPawnState(InPawn, EPawnState.Shoveling , not IsMovable); + UGCPawnSystem.DisabledPawnState(InPawn, EPawnState.Jump , not IsMovable); + UGCPawnSystem.DisabledPawnState(InPawn, EPawnState.GunFire , not IsMovable); + UGCPawnSystem.DisabledPawnState(InPawn, EPawnState.HoldGrenade , not IsMovable); + UGCPawnSystem.DisabledPawnState(InPawn, EPawnState.MeleeAttack , not IsMovable); +end + +function UGCSystemLibrary.SetAllPawnMovable(IsMovable) + local AllPawn = UGCGameSystem.GetAllPlayerPawn() + for i, v in pairs(AllPawn) do + UGCSystemLibrary.SetPlayerPawnMovable(v, IsMovable) + end +end + + +--- Server +--- 设置玩家是否可移动 +function UGCSystemLibrary.SetPlayerIsMovable(PlayerController, IsMovable) + if UE.IsValid(PlayerController) then + UGCLogSystem.Log("[UGCSystemLibrary_SetPlayerIsMovable] PlayerController:%s", tostring(PlayerController.PlayerKey)) + if IsMovable then + -- 关闭电影模式,启用玩家移动 + PlayerController:SetCinematicMode(false, false, false, true, false) + else + -- 开启电影模式,禁止玩家移动 + PlayerController:SetCinematicMode(true, false, false, true, false) + end + else + UGCLogSystem.LogError("[UGCSystemLibrary_SetPlayerIsMovable] PlayerController Is Not Valid") + end +end + +--- Server +--- 设置所有玩家是否可移动 +function UGCSystemLibrary.SetAllPlayerIsMovable(IsMovable) + local TempPlayerControllers = UGCGameSystem.GetAllPlayerController(true) + for _, PC in pairs(TempPlayerControllers) do + UGCSystemLibrary.SetPlayerIsMovable(PC, IsMovable) + end +end + +--------------------------------------------- 准备状态 --------------------------------------------- +--[[ +需要在Pawn内的ReceivePossessed函数中加入 +function UGCPlayerPawn:ReceivePossessed(NewController) + if UGCSystemLibrary.GetIsPreparationState() then + UGCSystemLibrary.SetPlayerPawnMovable(self, false) + end +end +]] + +-- 准备时间 +UGCSystemLibrary.PreparationTime = 0; +-- 是否为准备阶段 +UGCSystemLibrary.IsPreparationState = false; +--- Server +--- 进入准备状态 +function UGCSystemLibrary.EnterPreparationState() + UGCSystemLibrary.IsPreparationState = true + if UGCEventSystem.PreparationStateHandle then + UGCEventSystem.StopTimer(UGCEventSystem.PreparationStateHandle) + end + UGCEventSystem.PreparationStateHandle = UGCEventSystem.SetTimer(UGCGameSystem.GameState, function() + UGCSystemLibrary.SetAllPawnMovable(true) + UGCSystemLibrary.IsPreparationState = false + UGCEventSystem.PreparationStateHandle = nil + end, UGCSystemLibrary.PreparationTime) +end + +function UGCSystemLibrary.GetIsPreparationState() + return UGCSystemLibrary.IsPreparationState +end + +function UGCSystemLibrary.SetPreparationTime(InPreparationTime) + if InPreparationTime >= 0 then + UGCSystemLibrary.PreparationTime = InPreparationTime + end +end + + + +------------------------------------------- 准备状态 End ------------------------------------------- + +--- 获取所有的PlayerKey +function UGCSystemLibrary.GetAllPlayerKeys() + local AllPC = UGCGameSystem.GetAllPlayerController() + local Res = {} + for i, v in pairs(AllPC) do + Res[#Res + 1] = v.PlayerKey + end + return Res +end + +--- 给玩家的所有武器补满当前弹夹子弹 +function UGCSystemLibrary.PlayerFullBullet(InPlayerKey) + local TargetPawn = UGCGameSystem.GetPlayerPawnByPlayerKey(InPlayerKey) + if UE.IsValid(TargetPawn) then + --补满子弹 + TargetPawn:SetAllWeaponBulletNumToMaxOnServer(true, false) + for i, v in pairs(ShootWeaponEnums) do + local Weapon = UGCWeaponManagerSystem.GetWeaponBySlot(TargetPawn, v) + if UE.IsValid(Weapon) then + UGCGunSystem.EnableClipInfiniteBullets(Weapon, true) + local MaxBulletNumInOneClip = UGCGunSystem.GetMaxBulletNumInOneClip(Weapon) + Weapon:SetCurrentBulletNumInClipOnServer(MaxBulletNumInOneClip, true) + -- 玩家离开换弹状态 + if UE.IsValid(TargetPawn) then + UGCPawnSystem.LeavePawnState(TargetPawn, EPawnState.Roload) + end + end + end + end +end + +--- 重置和平里的击杀和助攻数 +function UGCSystemLibrary.ResetAllPlayerKillsAndAssists() + local AllPS = UGCGameSystem.GetAllPlayerState() + for i, PS in pairs(AllPS) do + PS.Kills = 0 + PS.Assists = 0 + PS.KillPlayerNum = 0 + DOREPONCE(PS,"Kills") + DOREPONCE(PS,"Assists") + DOREPONCE(PS,"KillPlayerNum") + end +end + +--- 获取当天为一年中的第几天 +function UGCSystemLibrary.GetDayOfYear() + local now = os.time() + local year = os.date("*t", now).year + local startOfYear = os.time{year = year, month = 1, day = 1} + local days = os.difftime(now, startOfYear) / (24 * 60 * 60) + return math.floor(days) + 1 -- 加1是因为Lua里月份和天数是从1开始计数的 +end + +--- 获取现实时间秒 +function UGCSystemLibrary.GatRealTimeSeconds() + return os.time() +end + + +--- 获取UTF-8字符串的长度 +function UGCSystemLibrary.utf8len(s) + local len = 0 + local i = 1 + local c = string.byte(s, i) + while c do + if c > 0 and c <= 127 then + i = i + 1 + elseif c >= 194 and c <= 223 then + i = i + 2 + elseif c >= 224 and c <= 239 then + i = i + 3 + elseif c >= 240 and c <= 244 then + i = i + 4 + else + return nil -- invalid UTF-8 + end + len = len + 1 + c = string.byte(s, i) + end + return len +end + +--- 裁剪UTF-8字符串 +function UGCSystemLibrary.utf8sub(s, startChar, numChars) + local startIndex = 1 + while startChar > 1 do + local c = string.byte(s, startIndex) + if not c then return "" end + if c > 0 and c <= 127 then + startIndex = startIndex + 1 + elseif c >= 194 and c <= 223 then + startIndex = startIndex + 2 + elseif c >= 224 and c <= 239 then + startIndex = startIndex + 3 + elseif c >= 240 and c <= 244 then + startIndex = startIndex + 4 + else + return "" -- invalid UTF-8 + end + startChar = startChar - 1 + end + + local currentIndex = startIndex + while numChars > 0 and currentIndex <= #s do + local c = string.byte(s, currentIndex) + if not c then break end + if c > 0 and c <= 127 then + currentIndex = currentIndex + 1 + elseif c >= 194 and c <= 223 then + currentIndex = currentIndex + 2 + elseif c >= 224 and c <= 239 then + currentIndex = currentIndex + 3 + elseif c >= 240 and c <= 244 then + currentIndex = currentIndex + 4 + else + break -- invalid UTF-8 + end + numChars = numChars - 1 + end + return s:sub(startIndex, currentIndex - 1) +end + +function UGCSystemLibrary.remove_punctuation(s) + -- 定义要移除的标点符号 + local punctuation = { + ["。"] = true, [","] = true, ["!"] = true, ["?"] = true, + ["."] = true, [","] = true, ["!"] = true, ["?"] = true, + [";"] = true, [":"] = true, [";"] = true, [":"] = true, + ["、"] = true, ["("] = true, [")"] = true, ["("] = true, [")"] = true, + ["【"] = true, ["】"] = true, ["["] = true, ["]"] = true, + ["“"] = true, ["”"] = true, ["\""] = true, ["'"] = true, + ["\n"] = true, ["\r"] = true, + } + + local result = {} + local i = 1 + local c = string.byte(s, i) + while c do + local char_len = 1 + if c > 0 and c <= 127 then + char_len = 1 + elseif c >= 194 and c <= 223 then + char_len = 2 + elseif c >= 224 and c <= 239 then + char_len = 3 + elseif c >= 240 and c <= 244 then + char_len = 4 + else + return "" -- invalid UTF-8 + end + + local char = s:sub(i, i + char_len - 1) + print(char .. "--") + if not punctuation[char] then + table.insert(result, char) + end + + i = i + char_len + c = string.byte(s, i) + end + + return table.concat(result) +end + +--- 移除标点符号 +function UGCSystemLibrary.remove_character(s, char_to_remove) + local result = {} + local i = 1 + local c = string.byte(s, i) + while c do + local char_len = 1 + if c > 0 and c <= 127 then + char_len = 1 + elseif c >= 194 and c <= 223 then + char_len = 2 + elseif c >= 224 and c <= 239 then + char_len = 3 + elseif c >= 240 and c <= 244 then + char_len = 4 + else + return "" -- invalid UTF-8 + end + UGCLogSystem.Log("[UGCSystemLibrary_remove_character] c:%s", c) + + local char = s:sub(i, i + char_len - 1) + if char ~= char_to_remove then + UGCLogSystem.Log("[UGCSystemLibrary_remove_character] Add") + table.insert(result, char) + end + + i = i + char_len + c = string.byte(s, i) + end + + return table.concat(result) +end + +--- 概率函数,输入为概率列表,输出为依据概率随机出来的索引 +function UGCSystemLibrary.RandomIndex(probabilities) + local sum = 0 + local cumulative = {} + + -- 计算概率总和,并构建累积概率列表 + for i, prob in ipairs(probabilities) do + sum = sum + prob + cumulative[i] = sum + end + + -- 生成一个0到sum之间的随机数 + local randomValue = math.random() * sum + + -- 根据随机数选择对应的索引 + for i, cumProb in ipairs(cumulative) do + if randomValue <= cumProb then + return i + end + end +end + + + + +--- 获取其他队伍的ID +---@param TeamID uint 忽略的队伍ID +---@return TeamIDs table 其他队伍ID +function UGCTeamSystem.GetOtherTeamIDs(TeamID) + local TeamIDs = UGCTeamSystem.GetTeamIDs() + local Res = {} + for i, v in pairs(TeamIDs) do + if v ~= TeamID then + Res[#Res + 1] = v + end + end + return Res +end + +--- 获取其他队伍的玩家 +---@param TeamID uint 忽略的队伍ID +---@return PlayerKeys table 其他玩家PlayerKey +function UGCTeamSystem.GetOtherTeamPlayerKeys(TeamID) + local OtherTeamIDs = UGCTeamSystem.GetOtherTeamIDs(TeamID) + local Res = {} + for i, v in pairs(OtherTeamIDs) do + local OtherPlayerKeys = UGCTeamSystem.GetPlayerKeysByTeamID(v) + for _, PlayerKey in pairs(OtherPlayerKeys) do + Res[#Res + 1] = PlayerKey + end + end + return Res +end + +--- 获取队伍成员PlayerKey +---@return PlayerKeys table 队伍玩家PlayerKey +function UGCTeamSystem.GetTeammates(PlayerKey) + local Res = {} + local TeamID = UGCPlayerStateSystem.GetTeamID(PlayerKey) + UGCLogSystem.Log("[UGCTeamSystem_GetTeammates] TeamID:%s", tostring(TeamID)) + local Teammates = UGCTeamSystem.GetPlayerKeysByTeamID(TeamID) + for i, v in pairs(Teammates) do + Res[#Res + 1] = v + end + return Res +end \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/Tables/A_IncludeTables.lua b/CounterAttack_Solo/Script/Global/Tables/A_IncludeTables.lua new file mode 100644 index 00000000..716b8a7a --- /dev/null +++ b/CounterAttack_Solo/Script/Global/Tables/A_IncludeTables.lua @@ -0,0 +1,13 @@ +-- 需要包含的头目录 + +local Prefix = "Script.Global.Tables." + +local Item = require(Prefix .. 'ObjectPathTable') +Item.Init(); +require(Prefix .. 'ItemTable') +require(Prefix .. 'VehicleTable') +require(Prefix .. 'WeaponGradientTable') +require(Prefix .. 'WeaponTable') + +local GuideItem = require(Prefix .. 'GuideTable') +GuideItem.Init(); diff --git a/CounterAttack_Solo/Script/Global/Tables/GuideTable.lua b/CounterAttack_Solo/Script/Global/Tables/GuideTable.lua new file mode 100644 index 00000000..67b74769 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/Tables/GuideTable.lua @@ -0,0 +1,31 @@ + +GuideTable = GuideTable or {}; + +---@class MechanismGuideItem +---@field Icon string +---@field IconTexture UTexture2D + +---@type table +GuideTable.SceneObjectGuide = { + [1] = { + + Icon = nil; + Desc = { + + }, + --Cost = + }, +}; + +function GuideTable.Init() + for i, v in pairs(GuideTable.SceneObjectGuide) do + if v.Icon then + local Text = UE.LoadObject(v.Icon) + if Text ~= nil then + v.IconTexture = Text; + end + end + end +end + +return GuideTable; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/Tables/ItemTable.lua b/CounterAttack_Solo/Script/Global/Tables/ItemTable.lua new file mode 100644 index 00000000..a19d2e12 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/Tables/ItemTable.lua @@ -0,0 +1,212 @@ +ItemTable = ItemTable or {} +ItemTable.AllItem = { + --- 武器 + [101001] = { ID = 101001, price = 300, Name = "AKM突击步枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_AK47.Icon_WEP_AK47", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_AK47_B.Icon_WEP_AK47_B" }, + [101002] = { ID = 101002, price = 200, Name = "M16A4突击步枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_M16A4.Icon_WEP_M16A4", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_M16A4_B.Icon_WEP_M16A4_B" }, + [101003] = { ID = 101003, price = 250, Name = "SCAR-L突击步枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_SCAR.Icon_WEP_SCAR", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_SCAR_B.Icon_WEP_SCAR_B" }, + [101004] = { ID = 101004, price = 350, Name = "M416突击步枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_M416.Icon_WEP_M416", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_M416_B.Icon_WEP_M416_B" }, + [101005] = { ID = 101005, price = 500, Name = "GROZA突击步枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_GROZA.Icon_WEP_GROZA", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_GROZA_B.Icon_WEP_GROZA_B" }, + [101006] = { ID = 101006, price = 450, Name = "AUG突击步枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_AUG.Icon_WEP_AUG", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_AUG.Icon_WEP_AUG" }, + [101007] = { ID = 101007, price = 400, Name = "QBZ突击步枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_QBZ95_Small.Icon_WEP_QBZ95_Small", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_QBZ.Icon_WEP_QBZ" }, + [101008] = { ID = 101008, price = 250, Name = "M762突击步枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_M762_Small.Icon_WEP_M762_Small", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_M762.Icon_WEP_M762" }, + [101009] = { ID = 101009, price = 250, Name = "Mk47突击步枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_MK47.Icon_WEP_MK47", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_MK47_B.Icon_WEP_MK47_B" }, + [101010] = { ID = 101010, price = 250, Name = "G36C突击步枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_G36C.Icon_WEP_G36C", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_G36C_B.Icon_WEP_G36C_B" }, + [101012] = { ID = 101012, price = 350, Name = "蜜獾突击步枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_HoneyBadger.Icon_WEP_HoneyBadger", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_HoneyBadger_B.Icon_WEP_HoneyBadger_B" }, + [102001] = { ID = 102001, price = 350, Name = "UZI冲锋枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_UZIPro.Icon_WEP_UZIPro", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_UZIPro_B.Icon_WEP_UZIPro_B" }, + [102002] = { ID = 102002, price = 300, Name = "UMP45冲锋枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_UMP45.Icon_WEP_UMP45", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_UMP45_B.Icon_WEP_UMP45_B" }, + [102003] = { ID = 102003, price = 350, Name = "Vector冲锋枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_Vector.Icon_WEP_Vector", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_Vector_B.Icon_WEP_Vector_B" }, + [102004] = { ID = 102004, price = 300, Name = "汤姆逊冲锋枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_Thompson.Icon_WEP_Thompson", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_Thompson_B.Icon_WEP_Thompson_B" }, + [102005] = { ID = 102005, price = 400, Name = "野牛冲锋枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_PP19.Icon_WEP_PP19", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_PP19_B.Icon_WEP_PP19_B" }, + [102007] = { ID = 102007, price = 300, Name = "MP5K冲锋枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_MP5K.Icon_WEP_MP5K", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_MP5K_B.Icon_WEP_MP5K_B" }, + [102105] = { ID = 102105, price = 350, Name = "P90冲锋枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_P90_Set.Icon_WEP_P90_Set", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_P90_Set_B.Icon_WEP_P90_Set_B" }, + [103001] = { ID = 103001, price = 350, Name = "Kar98K狙击枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_Kar98k.Icon_WEP_Kar98k", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_Kar98k_B.Icon_WEP_Kar98k_B" }, + [103002] = { ID = 103002, price = 300, Name = "M24狙击枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_M24.Icon_WEP_M24", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_M24_B.Icon_WEP_M24_B" }, + [103003] = { ID = 103003, price = 600, Name = "AWM狙击枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_AWM.Icon_WEP_AWM", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_AWM_B.Icon_WEP_AWM_B" }, + [103004] = { ID = 103004, price = 400, Name = "SKS射手步枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_SKS.Icon_WEP_SKS", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_SKS_B.Icon_WEP_SKS_B" }, + [103005] = { ID = 103005, price = 350, Name = "VSS射手步枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_VSS.Icon_WEP_VSS", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_VSS_B.Icon_WEP_VSS_B" }, + [103006] = { ID = 103006, price = 350, Name = "Mini14射手步枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_Mini14.Icon_WEP_Mini14", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_Mini14_B.Icon_WEP_Mini14_B" }, + [103007] = { ID = 103007, price = 350, Name = "Mk14射手步枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_MK14.Icon_WEP_MK14", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_MK14_B.Icon_WEP_MK14_B" }, + [103008] = { ID = 103008, price = 350, Name = "Win94狙击枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_Win1894.Icon_WEP_Win1894", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_Win1894.Icon_WEP_Win1894" }, + [103009] = { ID = 103009, price = 350, Name = "SLR射手步枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_SLR.Icon_WEP_SLR", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_SLR.Icon_WEP_SLR" }, + [103010] = { ID = 103010, price = 350, Name = "QBU射手步枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_QBU.Icon_WEP_QBU", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_QBU_B.Icon_WEP_QBU_B" }, + [103011] = { ID = 103011, price = 400, Name = "莫辛纳甘狙击枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_mosin.Icon_WEP_mosin", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_mosin_B.Icon_WEP_mosin_B" }, + -- [103100] = { ID = 103100, AmmunitionItem = , Name = "Mk12狙击枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_MK12.Icon_WEP_MK12", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_MK12_B.Icon_WEP_MK12_B" }, + [104001] = { ID = 104001, price = 300, Name = "S686霰弹枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_S686.Icon_WEP_S686", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_S686_B.Icon_WEP_S686_B" }, + [104002] = { ID = 104002, price = 300, Name = "S1897霰弹枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_S1897.Icon_WEP_S1897", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_S1897_B.Icon_WEP_S1897_B" }, + [104003] = { ID = 104003, price = 400, Name = "S12K霰弹枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_S12K.Icon_WEP_S12K", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_S12K_B.Icon_WEP_S12K_B" }, + [104004] = { ID = 104004, price = 520, Name = "DBS霰弹枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_DP12.Icon_WEP_DP12", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_DP12_B.Icon_WEP_DP12_B" }, + [104100] = { ID = 104100, price = 500, Name = "SPAS-12霰弹枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_SPAS.Icon_WEP_SPAS", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_SPAS_B.Icon_WEP_SPAS_B" }, + [105001] = { ID = 105001, price = 600, Name = "M249轻机枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_M249.Icon_WEP_M249", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_M249_B.Icon_WEP_M249_B" }, + [105002] = { ID = 105002, price = 650, Name = "DP-28轻机枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_DP28.Icon_WEP_DP28", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_DP28.Icon_WEP_DP28" }, + [105003] = { ID = 105003, price = 700, Name = "M134重机枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_M134.Icon_WEP_M134", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_M134_B.Icon_WEP_M134_B" }, + [106001] = { ID = 106001, price = 220, Name = "P92手枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_P92.Icon_WEP_P92", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_P92_B.Icon_WEP_P92_B" }, + [106002] = { ID = 106002, price = 200, Name = "P1911手枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_P1911.Icon_WEP_P1911", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_P1911_B.Icon_WEP_P1911_B" }, + [106003] = { ID = 106003, price = 220, Name = "R1895手枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_R1895.Icon_WEP_R1895", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_R1895_B.Icon_WEP_R1895_B" }, + [106004] = { ID = 106004, price = 250, Name = "P18C手枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_P18C.Icon_WEP_P18C", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_P18C_B.Icon_WEP_P18C_B" }, + [106005] = { ID = 106005, price = 280, Name = "R45手枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_Rhino.Icon_WEP_Rhino", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_Rhino.Icon_WEP_Rhino" }, + [106006] = { ID = 106006, price = 300, Name = "短管霰弹枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_SawedOff.Icon_WEP_SawedOff", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_SawedOff.Icon_WEP_SawedOff" }, + --[106007] = { ID = 10600 AmmunitionItem = [7, Name = "信号枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_FlareGun.Icon_WEP_FlareGun", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_FlareGun.Icon_WEP_FlareGun" }, + [106008] = { ID = 106008, price = 250, Name = "蝎式手枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_Skorpion.Icon_WEP_Skorpion", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_Skorpion_B.Icon_WEP_Skorpion_B" }, + [106010] = { ID = 106010, price = 350, Name = "沙漠之鹰手枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_DesertEagle_C.Icon_WEP_DesertEagle_C", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_DesertEagleC_B.Icon_WEP_DesertEagleC_B" }, + --[106107] = { ID = 106107, AmmunitionItem = , Name = "乱斗手枪" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_FireLauncher.Icon_WEP_FireLauncher", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_FireLauncher.Icon_WEP_FireLauncher" }, + [107001] = { ID = 107001, price = 450, Name = "十字弩" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_Crossbow.Icon_WEP_Crossbow", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_Crossbow_B.Icon_WEP_Crossbow_B" }, + [107002] = { ID = 107002, price = 700, Name = "RPG-7火箭筒" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_RPG7.Icon_WEP_RPG7", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_RPG7_B.Icon_WEP_RPG7_B" }, + --[107005] = { ID = 107005, AmmunitionItem = 307002, Name = "铁拳火箭筒" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_Panzerfaust.Icon_WEP_Panzerfaust", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_Panzerfaust_B.Icon_WEP_Panzerfaust_B" }, + [107094] = { ID = 107094, price = 750, Name = "AT4-A激光导弹" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_AT4-A.Icon_WEP_AT4-A", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_AT4-A_B.Icon_WEP_AT4-A_B" }, + --[107098] = { ID = 107098, AmmunitionItem = , Name = "MGL榴弹发射器" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_MGL140.Icon_WEP_MGL140", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_MGL140_B.Icon_WEP_MGL140_B" }, + [107099] = { ID = 107099, price = 700, Name = "M3E1-A导弹" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_M3E2.Icon_WEP_M3E2", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_M3E1_B.Icon_WEP_M3E1_B" }, + [107905] = { ID = 107905, price = 780, Name = "M202四联火箭筒" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_M202.Icon_WEP_M202", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_M202_B.Icon_WEP_M202_B" }, + [108001] = { ID = 108001, price = 150, Name = "大砍刀" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_Machete.Icon_WEP_Machete", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_Machete_B.Icon_WEP_Machete_B" }, + [108002] = { ID = 108002, price = 150, Name = "撬棍" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_Cowbar.Icon_WEP_Cowbar", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_Cowbar_B.Icon_WEP_Cowbar_B" }, + [108003] = { ID = 108003, price = 150, Name = "镰刀" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_Sickle.Icon_WEP_Sickle", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_Sickle_B.Icon_WEP_Sickle_B" }, + [108004] = { ID = 108004, price = 100, Name = "平底锅" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_Pan.Icon_WEP_Pan", BigPic = "/Game/Arts/UI/TableIcons/WeaponIcons/Icon256x128/Icon_WEP_Pan_B.Icon_WEP_Pan_B" }, + + [190008] = { ID = 190008, price = 750, Name = "爆破投射器" , SmallPic = "/Game/UGC/Weapon/WeaponArt/MGL/Icon/Icon_UGC_MGL.Icon_UGC_MGL", BigPic = "/Game/UGC/Weapon/WeaponArt/MGL/Icon/Icon_UGC_MGL_B.Icon_UGC_MGL_B" }, + [190009] = { ID = 190009, price = 900, Name = "单发蓄力能量步枪" , SmallPic = "/Game/UGC/Weapon/WeaponArt/RPG/Icon/Icon_UGC_RPG.Icon_UGC_RPG", BigPic = "/Game/UGC/Weapon/WeaponArt/RPG/Icon/Icon_UGC_RPG_B.Icon_UGC_RPG_B" }, + [190010] = { ID = 190010, price = 350, Name = "电击枪" , SmallPic = "/Game/UGC/Weapon/WeaponArt/ElectricGun/Icon/Icon_UGC_ElectricGun.Icon_UGC_ElectricGun", BigPic = "/Game/UGC/Weapon/WeaponArt/ElectricGun/Icon/Icon_UGC_ElectricGun_B.Icon_UGC_ElectricGun_B" }, + [190011] = { ID = 190011, price = 900, Name = "激光步枪" , SmallPic = "/Game/UGC/Weapon/WeaponArt/LaserGun/Icon/Icon_UGC_LaserGun.Icon_UGC_LaserGun", BigPic = "/Game/UGC/Weapon/WeaponArt/LaserGun/Icon/Icon_UGC_LaserGun_B.Icon_UGC_LaserGun_B" }, + + [602001] = { ID = 602001, price = 80 , Name = "震爆弹", SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_FlashBang_UG.Icon_WEP_FlashBang_UG" }, + [602002] = { ID = 602002, price = 30 , Name = "烟雾弹", SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_SmokeBomb_UG.Icon_WEP_SmokeBomb_UG" }, + [602003] = { ID = 602003, price = 80 , Name = "燃烧瓶", SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_FireBomb_UG.Icon_WEP_FireBomb_UG" }, + [602004] = { ID = 602004, price = 100, Name = "破片手榴弹", SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Weapon/Icon_WEP_Grenade_UG.Icon_WEP_Grenade_UG" }, + + + --- 武器配件 + [201001] = { ID = 201001, price = 80 , Name = "霰弹枪收束器" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_QK_Choke.Icon_QK_Choke" , }, + [201002] = { ID = 201002, price = 80 , Name = "枪口补偿器(冲锋枪)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_QK_Mid_Compensator.Icon_QK_Mid_Compensator" , }, + [201003] = { ID = 201003, price = 80 , Name = "枪口补偿器(狙击枪)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_QK_Sniper_Compensator.Icon_QK_Sniper_Compensator" , }, + [201004] = { ID = 201004, price = 50 , Name = "消焰器(冲锋枪)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_QK_Mid_FlashHider.Icon_QK_Mid_FlashHider" , }, + [201005] = { ID = 201005, price = 50 , Name = "消焰器(狙击枪)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_QK_Sniper_FlashHider.Icon_QK_Sniper_FlashHider" , }, + [201006] = { ID = 201006, price = 100, Name = "消音器(冲锋枪,手枪)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_QK_Mid_Suppressor.Icon_QK_Mid_Suppressor" , }, + [201007] = { ID = 201007, price = 100, Name = "消音器(狙击枪)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_QK_Sniper_Suppressor.Icon_QK_Sniper_Suppressor" , }, + [201008] = { ID = 201008, price = 100, Name = "消音器(手枪)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_QK_Small_Suppressor.Icon_QK_Small_Suppressor" , }, + [201009] = { ID = 201009, price = 80 , Name = "枪口补偿器(步枪)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_QK_Large_Compensator.Icon_QK_Large_Compensator" , }, + [201010] = { ID = 201010, price = 50 , Name = "消焰器(步枪)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_QK_Large_FlashHider.Icon_QK_Large_FlashHider" , }, + [201011] = { ID = 201011, price = 100, Name = "消音器(步枪)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_QK_Large_Suppressor.Icon_QK_Large_Suppressor" , }, + [201012] = { ID = 201012, price = 80 , Name = "鸭嘴枪口(霰弹枪)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_QK_DuckBill.Icon_QK_DuckBill" , }, + [201050] = { ID = 201050, price = 80 , Name = "延长枪管(冲锋枪)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_QK_Small_ExtendedBarrel.Icon_QK_Small_ExtendedBarrel", }, + [201051] = { ID = 201051, price = 80 , Name = "延长枪管(步枪,狙击枪)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_QK_Large_ExtendedBarrel.Icon_QK_Large_ExtendedBarrel", }, + [202001] = { ID = 202001, price = 50 , Name = "直角前握把" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_WB_Angled.Icon_WB_Angled" , }, + [202002] = { ID = 202002, price = 50 , Name = "垂直握把" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_WB_Vertical.Icon_WB_Vertical" , }, + [202004] = { ID = 202004, price = 50 , Name = "轻型握把" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_WB_LightGrip.Icon_WB_LightGrip" , }, + [202005] = { ID = 202005, price = 50 , Name = "半截式握把" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_WB_HalfGrip.Icon_WB_HalfGrip" , }, + [202006] = { ID = 202006, price = 50 , Name = "拇指握把" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_WB_ThumbGrip.Icon_WB_ThumbGrip" , }, + [202007] = { ID = 202007, price = 150, Name = "激光瞄准器" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/icon_attach_Lower_LaserPointer.icon_attach_Lower_LaserPointer", }, + [203001] = { ID = 203001, price = 100, Name = "红点瞄准镜" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_MZJ_HD.Icon_MZJ_HD" , }, + [203002] = { ID = 203002, price = 100, Name = "全息瞄准镜" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_MZJ_QX.Icon_MZJ_QX" , }, + [203003] = { ID = 203003, price = 200, Name = "2倍 瞄准镜" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_MZJ_2X.Icon_MZJ_2X" , }, + [203004] = { ID = 203004, price = 250, Name = "4倍 瞄准镜" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_MZJ_4X.Icon_MZJ_4X" , }, + [203005] = { ID = 203005, price = 500, Name = "8倍 瞄准镜" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_MZJ_8X.Icon_MZJ_8X" , }, + [203014] = { ID = 203014, price = 220, Name = "3倍 瞄准镜" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_MZJ_3X.Icon_MZJ_3X" , }, + [203015] = { ID = 203015, price = 300, Name = "6倍 瞄准镜" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_MZJ_6X.Icon_MZJ_6X" , }, + [203018] = { ID = 203018, price = 100, Name = "侧面瞄准镜" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/icon_MZJ_CantedRMR.icon_MZJ_CantedRMR" , }, + [203023] = { ID = 203023, price = 300, Name = "红点UV瞄准镜" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_MZJ_HD.Icon_MZJ_HD" , }, + [203024] = { ID = 203024, price = 300, Name = "全息UV瞄准镜" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_MZJ_QX.Icon_MZJ_QX" , }, + [203104] = { ID = 203104, price = 250, Name = "4倍 瞄准镜测试皮肤" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_MZJ_4X.Icon_MZJ_4X" , }, + [204001] = { ID = 204001, price = 120, Name = "扩容弹匣(手枪)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_DJ_Small_E.Icon_DJ_Small_E" , }, + [204002] = { ID = 204002, price = 150, Name = "快速弹匣(手枪)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_DJ_Small_Q.Icon_DJ_Small_Q" , }, + [204003] = { ID = 204003, price = 180, Name = "快速扩容弹匣(手枪)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_DJ_Small_EQ.Icon_DJ_Small_EQ" , }, + [204004] = { ID = 204004, price = 120, Name = "扩容弹匣(冲锋枪,手枪)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_DJ_Mid_E.Icon_DJ_Mid_E" , }, + [204005] = { ID = 204005, price = 150, Name = "快速弹匣(冲锋枪,手枪)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_DJ_Mid_Q.Icon_DJ_Mid_Q" , }, + [204006] = { ID = 204006, price = 180, Name = "快速扩容弹匣(冲锋枪,手枪)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_DJ_Mid_EQ.Icon_DJ_Mid_EQ" , }, + [204007] = { ID = 204007, price = 120, Name = "扩容弹匣(狙击枪)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_DJ_Sniper_E.Icon_DJ_Sniper_E" , }, + [204008] = { ID = 204008, price = 150, Name = "快速弹匣(狙击枪)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_DJ_Sniper_Q.Icon_DJ_Sniper_Q" , }, + [204009] = { ID = 204009, price = 180, Name = "快速扩容弹匣(狙击枪)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_DJ_Sniper_EQ.Icon_DJ_Sniper_EQ" , }, + [204010] = { ID = 204010, price = 100, Name = "子弹袋(霰弹枪)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_ZDD_Shotgun.Icon_ZDD_Shotgun" , }, + [204011] = { ID = 204011, price = 120, Name = "扩容弹匣(步枪,机枪)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_DJ_Large_E.Icon_DJ_Large_E" , }, + [204012] = { ID = 204012, price = 150, Name = "快速弹匣(步枪,机枪)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_DJ_Large_Q.Icon_DJ_Large_Q" , }, + [204013] = { ID = 204013, price = 180, Name = "快速扩容弹匣(步枪,机枪)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_DJ_Large_EQ.Icon_DJ_Large_EQ" , }, + [204014] = { ID = 204014, price = 100, Name = "子弹袋(狙击枪,霰弹枪)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_ZDD_Sniper.Icon_ZDD_Sniper" , }, + [204015] = { ID = 204015, price = 180, Name = "扩容弹匣(机枪)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_DJ_M134_EQ_Mag.Icon_DJ_M134_EQ_Mag" , }, + [204016] = { ID = 204016, price = 180, Name = "并联弹匣(步枪)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_DJ_Large_Dou.Icon_DJ_Large_Dou" , }, + [205001] = { ID = 205001, price = 80 , Name = "枪托(Micro UZI)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_QT_UZI.Icon_QT_UZI" , }, + [205002] = { ID = 205002, price = 150, Name = "战术枪托(步枪,冲锋枪,机枪)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_QT_A.Icon_QT_A" , }, + [205003] = { ID = 205003, price = 80 , Name = "托腮板(狙击枪)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_QT_Sniper.Icon_QT_Sniper" , }, + [205004] = { ID = 205004, price = 120, Name = "箭袋(十字弩)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_DJ_Crossbow_Q.Icon_DJ_Crossbow_Q" , }, + [205099] = { ID = 205099, price = 150, Name = "战术枪托(步枪,冲锋枪)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Attach/Icon_QT_A.Icon_QT_A" , }, + + --- 武器弹药 + [301001] = { ID = 301001, price = 4 , Name = "9毫米子弹" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Ammo/Icon_Ammo_9mm_UG.Icon_Ammo_9mm_UG" }, + [301002] = { ID = 301002, price = 4 , Name = "5.7毫米子弹" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Ammo/Icon_Ammo_557mm_UG.Icon_Ammo_557mm_UG" }, + [302001] = { ID = 302001, price = 4 , Name = "7.62毫米子弹" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Ammo/Icon_Ammo_762mm_UG.Icon_Ammo_762mm_UG" }, + [303001] = { ID = 303001, price = 3 , Name = "5.56毫米子弹" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Ammo/Icon_Ammo_556mm_UG.Icon_Ammo_556mm_UG" }, + [304001] = { ID = 304001, price = 10 , Name = "12口径霰弹" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Ammo/Icon_Ammo_12Guage_UG.Icon_Ammo_12Guage_UG" }, + [305001] = { ID = 305001, price = 5 , Name = ".45口径子弹" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Ammo/Icon_Ammo_45ACP_UG.Icon_Ammo_45ACP_UG" }, + [306001] = { ID = 306001, price = 15 , Name = ".300马格南子弹" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Ammo/Icon_Ammo_300Magnum_UG.Icon_Ammo_300Magnum_UG" }, + [307001] = { ID = 307001, price = 15 , Name = "弩箭" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Ammo/Icon_Ammo_bolt_UG.Icon_Ammo_bolt_UG" }, + [307002] = { ID = 307002, price = 100, Name = "火箭弹" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Ammo/Icon_Ammo_RPGBox.Icon_Ammo_RPGBox" }, + [307100] = { ID = 307100, price = 10 , Name = "蓄力步枪能量弹药" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Ammo/Icon_Ammo_40mm.Icon_Ammo_40mm" }, + [307101] = { ID = 307101, price = 20 , Name = "激光弹药" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Ammo/Icon_Ammo_300Magnum_UG.Icon_Ammo_300Magnum_UG" }, + [307102] = { ID = 307102, price = 50 , Name = "爆破投射弹药" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Ammo/Icon_Ammo_RPGBox.Icon_Ammo_RPGBox" }, + [307103] = { ID = 307103, price = 100, Name = "充能电池" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Ammo/Icon_Ammo_50BMG_UG.Icon_Ammo_50BMG_UG" }, + + + --- 战术装备 + [403045] = { ID = 403045, price = 1000, Name = "吉利服" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Equipment/Icon_Ghillie_1.Icon_Ghillie_1", BigPic = "/Game/Arts/UI/TableIcons/ItemIcon/Equipment/Icon_Ghillie_1.Icon_Ghillie_1"}, + [501001] = { ID = 501001, price = 100, Name = "背包(1级)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Equipment/Icon_Bag_Lv1.Icon_Bag_Lv1" , }, + [501002] = { ID = 501002, price = 500, Name = "背包(2级)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Equipment/Icon_Bag_Lv2_A.Icon_Bag_Lv2_A" , }, + [501003] = { ID = 501003, price = 800, Name = "背包(3级)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Equipment/Icon_Bag_Lv3_A.Icon_Bag_Lv3_A" , }, + [502001] = { ID = 502001, price = 100, Name = "摩托车头盔(1级)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Equipment/Icon_Helmet_Lv1_A.Icon_Helmet_Lv1_A" , }, + [502002] = { ID = 502002, price = 300, Name = "军用头盔(2级)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Equipment/Icon_Helmet_Lv2_A.Icon_Helmet_Lv2_A" , }, + [502003] = { ID = 502003, price = 500, Name = "特种部队头盔(3级)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Equipment/Icon_Helmet_Lv3.Icon_Helmet_Lv3" , }, + [503001] = { ID = 503001, price = 100, Name = "警用防弹衣(1级)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Equipment/Icon_Armor_Lv1.Icon_Armor_Lv1" , }, + [503002] = { ID = 503002, price = 300, Name = "警用防弹衣(2级)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Equipment/Icon_Armor_Lv2.Icon_Armor_Lv2" , }, + [503003] = { ID = 503003, price = 500, Name = "军用防弹衣(3级)" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Equipment/Icon_Armor_Lv3.Icon_Armor_Lv3" , }, + + [601001] = { ID = 601001, price = 60 , Name = "能量饮料" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Health/Icon_Boost_Drink_UG.Icon_Boost_Drink_UG" , }, + [601002] = { ID = 601002, price = 150, Name = "肾上腺素" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Health/Icon_Boost_Injection_UG.Icon_Boost_Injection_UG" , }, + [601003] = { ID = 601003, price = 50 , Name = "止痛药" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Health/Icon_Boost_Pills_UG.Icon_Boost_Pills_UG" , }, + [601004] = { ID = 601004, price = 20 , Name = "绷带" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Health/Icon_Heal_Bandage_UG.Icon_Heal_Bandage_UG" , }, + [601005] = { ID = 601005, price = 100, Name = "急救包" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Health/Icon_Heal_FirstAid_UG.Icon_Heal_FirstAid_UG" , }, + [601006] = { ID = 601006, price = 400, Name = "全能医疗箱" , SmallPic = "/Game/Arts/UI/TableIcons/ItemIcon/Health/Icon_Heal_FirstAidbox_UG.Icon_Heal_FirstAidbox_UG" , }, + +} + +ItemTable.ItemTypeList = { + { Name = "武器配件", + Data = { + { Name = "枪口", Data = { 201002, 201001, 201003, 201004, 201005, 201006, 201007, 201008, 201009, 201010, 201011, 201012, 201050, 201051, },}, + { Name = "握把", Data = { 202002, 202001, 202004, 202005, 202006, 202007, },}, + { Name = "倍镜", Data = { 203002, 203001, 203003, 203004, 203005, 203014, 203015, 203018, 203023, 203024, 203104},}, + { Name = "弹匣", Data = { 204002, 204001, 204003, 204004, 204005, 204006, 204007, 204008, 204009, 204010, 204011, 204012, 204013, 204014, 204015, 204016 },}, + { Name = "枪托", Data = { 205002, 205001, 205003, 205004, },}, + }, + }, + { Name = "武器", + Data = { + { Name = "轻机枪", Data = { 105002, 105001, 105003, },}, + { Name = "霰弹枪", Data = { 104002, 104001, 104003, 104004, 104100, },}, + { Name = "冲锋枪", Data = { 102002, 102001, 102003, 102004, 102005, 102007, 102105, },}, + { Name = "狙击枪", Data = { 103002, 103001, 103003, 103004, 103005, 103006, 103007, 103008, 103009, 103010, 103011, --[[103100,]] },}, + { Name = "步枪" , Data = { 101002, 101001, 101003, 101004, 101005, 101006, 101007, 101008, 101009, 101010, 101012, },}, + { Name = "手枪" , Data = { 106002, 106001, 106003, 106004, 106005, 106006, 106008, 106010,--[[ 106107,]] },}, + { Name = "特殊武器", Data = { 107002, 107001--[[ ,107005]], 107094--[[, 107098]], 107099, 107905, 190008, 190009, 190010, 190011 },}, + { Name = "近战武器", Data = { 108002, 108001, 108003, 108004, },}, + { Name = "投掷武器", Data = { 602002, 602001, 602003, 602004, },}, + } + }, + { Name = "武器弹药", + Data = { + { Name = "常规子弹", Data = { 301002, 301001, 302001, 303001, 304001, 305001, 306001 },}, + { Name = "特殊弹药", Data = { 307002, 307001, 307100, 307101, 307102, 307103 },}, + }, + }, + { Name = "战术装备", + Data = { + { Name = "背包", Data = { 501001, 501002, 501003, },}, + { Name = "回复道具", Data = { 601001, 601002, 601003, 601004, 601005, 601006, },}, + { Name = "头盔", Data = { 502001, 502002, 502003, },}, + { Name = "防弹衣", Data = { 503001, 503002, 503003, },}, + { Name = "吉利服", Data = { 403045, }} + } + }, +} + + + + + +ItemTable.GetItemPrice = function (ItemID) return ItemTable.AllItem[ItemID].price and ItemTable.AllItem[ItemID].price or 1 end + +ItemTable.GetItemMainClass = function(ItemID) return math.floor(ItemID / 100000) end \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/Tables/ObjectPathTable.lua b/CounterAttack_Solo/Script/Global/Tables/ObjectPathTable.lua new file mode 100644 index 00000000..65b4d48b --- /dev/null +++ b/CounterAttack_Solo/Script/Global/Tables/ObjectPathTable.lua @@ -0,0 +1,82 @@ +-- 类的class +ObjectPathTable = ObjectPathTable or { + WB_BroadcastItem_Class = nil; + W_ShopItemLevelType1_Class = nil; + W_ShopItemLevelType2_Class = nil; + W_ShopItem_Class = nil; +} + +ObjectPathTable.ObjectEnum = { + Class = 1, + Object = 2, +}; + +-- Object 路径 +ObjectPathTable.ActorPath = { + [1] = { + Class = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/Broadcast/WB_BroadcastItem.WB_BroadcastItem_C'), + Type = ObjectPathTable.ObjectEnum.Class, + }, + [2] = { + Class = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/Shop/W_ShopItemLevelType1.W_ShopItemLevelType1_C'), + Type = ObjectPathTable.ObjectEnum.Class, + }, + [3] = { + Class = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/Shop/W_ShopItemLevelType2.W_ShopItemLevelType2_C'), + Type = ObjectPathTable.ObjectEnum.Class, + }, + [4] = { + Class = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/Shop/W_ShopItem.W_ShopItem_C'), + Type = ObjectPathTable.ObjectEnum.Class, + }, + [5] = { + Class = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/StatusUI/FightPanel/NextWeapon/WB_NextWeaponItem.WB_NextWeaponItem_C'), + Type = ObjectPathTable.ObjectEnum.Class, + }, + [6] = { + Class = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/Guide/WB_MechanismInfo.WB_MechanismInfo_C'), + Type = ObjectPathTable.ObjectEnum.Class, + }, + [7] = { + Class = UGCGameSystem.GetUGCResourcesFullPath('Asset/Blueprint/SceneActor/BP_PlayerDeadParticle.BP_PlayerDeadParticle_C'), + Type = ObjectPathTable.ObjectEnum.Class, + }, + [8] = { + Class = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/Guide/WB_SceneItemGuideItem.WB_SceneItemGuideItem_C'), + Type = ObjectPathTable.ObjectEnum.Class, + }, +} + +-- 初始化所有的类型 +function ObjectPathTable.Init() + ObjectPathTable.WB_BroadcastItem_Class = UE.LoadClass(ObjectPathTable.ActorPath[1].Class); + ObjectPathTable.W_ShopItemLevelType1_Class = UE.LoadClass(ObjectPathTable.ActorPath[2].Class); + ObjectPathTable.W_ShopItemLevelType2_Class = UE.LoadClass(ObjectPathTable.ActorPath[3].Class); + ObjectPathTable.W_ShopItem_Class = UE.LoadClass(ObjectPathTable.ActorPath[4].Class); + ObjectPathTable.WB_NextWeaponItem_Class = UE.LoadClass(ObjectPathTable.ActorPath[5].Class); + ObjectPathTable.WB_MechanismInfo_Class = UE.LoadClass(ObjectPathTable.ActorPath[6].Class); + ObjectPathTable.BP_PlayerDeadParticle_Class = UE.LoadClass(ObjectPathTable.ActorPath[7].Class); + ObjectPathTable.WB_SceneItemGuideItem_Class = UE.LoadClass(ObjectPathTable.ActorPath[8].Class); +end + +---------------------------- PersistentAssets ---------------------------- +ObjectPathTable.PersistentAssets = {} -- { Path = Obj } +function ObjectPathTable.GetPersistentAssets(Path) + if not UE.IsValid(ObjectPathTable.PersistentAssets[Path]) then + local Obj = UE.LoadObject(Path); + if UE.IsValid(Obj) then + ObjectPathTable.PersistentAssets[Path] = Obj; + return Obj; + end + end + + return ObjectPathTable.PersistentAssets[Path]; +end + +function ObjectPathTable.ClearPersistentAssets() + ObjectPathTable.PersistentAssets = {}; +end + +-------------------------- PersistentAssets End -------------------------- + +return ObjectPathTable; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/Tables/VehicleTable.lua b/CounterAttack_Solo/Script/Global/Tables/VehicleTable.lua new file mode 100644 index 00000000..7534a786 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/Tables/VehicleTable.lua @@ -0,0 +1,322 @@ +--- +--- Generated by EmmyLua(https://github.com/EmmyLua) +--- Created by HGX. +--- DateTime: 2023/9/21 21:22 +--- +VehicleTable = {}; + +VehicleTable.Car = { + + -- 沙滩车 + [1] = { + Name = "buggy沙滩车1", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/VH_Buggy/BP_VH_Buggy.BP_VH_Buggy_C', + }, + [2] = { + Name = "buggy沙滩车2", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/VH_Buggy/BP_VH_Buggy_2.BP_VH_Buggy_2_C', + }, + [3] = { + Name = "buggy沙滩车3", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/VH_Buggy/BP_VH_Buggy_3.BP_VH_Buggy_3_C', + }, + [4] = { + Name = "buggy沙滩车4", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/VH_Buggy/BP_VH_Buggy_4.BP_VH_Buggy_4_C', + }, + [5] = { + Name = "buggy沙滩车5", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/VH_Buggy/BP_VH_Buggy_5.BP_VH_Buggy_5_C', + }, + + --LadaNiva越野车 + [6] = { + Name = "LadaNiva越野车1", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/LadaNiva/LadaNiva_01.LadaNiva_01_C', + }, + [7] = { + Name = "LadaNiva越野车2", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/LadaNiva/LadaNiva_02.LadaNiva_02_C', + }, + [8] = { + Name = "LadaNiva越野车3", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/LadaNiva/LadaNiva_03.LadaNiva_03_C', + }, + [9] = { + Name = "LadaNiva越野车4", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/LadaNiva/LadaNiva_04.LadaNiva_04_C', + }, + [10] = { + Name = "LadaNiva越野车5", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/LadaNiva/LadaNiva_05.LadaNiva_05_C', + }, + [11] = { + Name = "LadaNiva越野车6", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/LadaNiva/LadaNiva_06.LadaNiva_06_C', + }, + + -- Mirado跑车 + [12] = { + Name = "Mirado跑车_铜", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/Mirado/Mirado_close_1.Mirado_close_1_C', + }, + [13] = { + Name = "Mirado跑车_黑", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/Mirado/Mirado_close_2.Mirado_close_2_C', + }, + [14] = { + Name = "Mirado跑车_蓝", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/Mirado/Mirado_close_3.Mirado_close_3_C', + }, + [15] = { + Name = "Mirado跑车_红", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/Mirado/Mirado_close_4.Mirado_close_4_C', + }, + + + -- Mirado跑车_敞篷 + [16] = { + Name = "Mirado跑车_敞篷_铜", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/Mirado/Mirado_open_1.Mirado_open_1_C', + }, + [17] = { + Name = "Mirado跑车_敞篷_黑", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/Mirado/Mirado_open_2.Mirado_open_2_C', + }, + [18] = { + Name = "Mirado跑车_敞篷_蓝", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/Mirado/Mirado_open_3.Mirado_open_3_C', + }, + [19] = { + Name = "Mirado跑车_敞篷_红", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/Mirado/Mirado_open_4.Mirado_open_4_C', + }, + [20] = { + Name = "Mirado跑车_敞篷_金", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/Mirado/Mirado_open_Golden.Mirado_open_Golden_C', + }, + + -- 皮卡车 + [21] = { + Name = "皮卡车1", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/Pickup/PickUp_01.PickUp_01_C', + }, + [22] = { + Name = "皮卡车2", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/Pickup/PickUp_02.PickUp_02_C', + }, + [23] = { + Name = "皮卡车3", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/Pickup/PickUp_03.PickUp_03_C', + }, + [24] = { + Name = "皮卡车4", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/Pickup/PickUp_04.PickUp_04_C', + }, + [25] = { + Name = "皮卡车5", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/Pickup/PickUp_05.PickUp_05_C', + }, + [26] = { + Name = "皮卡车6", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/Pickup/PickUp_06.PickUp_06_C', + }, + [27] = { + Name = "皮卡车7", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/Pickup/PickUp_07.PickUp_07_C', + }, + [28] = { + Name = "皮卡车8", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/Pickup/PickUp_08.PickUp_08_C', + }, + [29] = { + Name = "皮卡车9", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/Pickup/PickUp_09.PickUp_09_C', + }, + [30] = { + Name = "皮卡车10", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/Pickup/PickUp_10.PickUp_10_C', + }, + + -- 罗尼皮卡 + [31] = { + Name = "罗尼皮卡_蓝", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/Rony/Rony_2.Rony_2_C', + }, + [32] = { + Name = "罗尼皮卡_绿", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/Rony/Rony_3.Rony_3_C', + }, + [33] = { + Name = "罗尼皮卡_白", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/Rony/Rony_01.Rony_01_C', + }, + + --全地形车 + [34] = { + Name = "全地形车", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/ATV/VH_ATV1.VH_ATV1_C', + }, + + -- 两栖装甲车 + [35] = { + Name = "两栖装甲车", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/BRDM/VH_BRDM.VH_BRDM_C', + }, + + -- 冲浪板 + [36] = { + Name = "冲浪板", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/Surfboard/Surfboard.Surfboard_C', + }, + + -- 遥控侦察车 + [37] = { + Name = "遥控侦察车", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/Telecar/TelecarVehicle.TelecarVehicle_C', + }, + + -- 直升机 + [38] = { + Name = "直升机", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/AH6/AH6_Vehicle.AH6_Vehicle_C', + }, + + -- 摩托艇 + [39] = { + Name = "摩托艇", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/AquaRail/AquaRail_1.AquaRail_1_C', + }, + + -- 大脚车 + [40] = { + Name = "大脚车", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/2x2Bigfoot/BP_VH_Bigfoot.BP_VH_Bigfoot_C', + }, + + -- 无人机 + [41] = { + Name = "无人机", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/UAV/UAV_Vehicle.UAV_Vehicle_C', + }, + + -- 跑车 + [42] = { + Name = "跑车", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/CoupeRB/VH_CoupeRB_1.VH_CoupeRB_1_C', + }, + + -- Dacia轿车 + [43] = { + Name = "Dacia轿车_红色", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/Dacia/VH_Dacia_2_New.VH_Dacia_2_New_C', + }, + [44] = { + Name = "Dacia轿车_白色", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/Dacia/VH_Dacia_3_New.VH_Dacia_3_New_C', + }, + [45] = { + Name = "Dacia轿车_蓝色", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/Dacia/VH_Dacia_New.VH_Dacia_New_C', + }, + + --测试载具 + [46] = { + Name = "测试载具", + Path = '/Game/UGC/Vehicle/ArcadeVehicle/VH_Drift_002.VH_Drift_002_C', + }, + + -- 迷你巴士 + [47] = { + Name = "迷你巴士_青色", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/MiniBus/VH_MiniBus_01.VH_MiniBus_01_C', + }, + [48] = { + Name = "迷你巴士_绿色", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/MiniBus/VH_MiniBus_02.VH_MiniBus_02_C', + }, + [49] = { + Name = "迷你巴士_红色", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/MiniBus/VH_MiniBus_03.VH_MiniBus_03_C', + }, + + -- 双人摩托 + [49] = { + Name = "双人摩托_黑色", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/Motorcycle/VH_Motorcycle.VH_Motorcycle_C', + }, + [50] = { + Name = "双人摩托_黄色", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/Motorcycle/VH_Motorcycle_1.VH_Motorcycle_1_C', + }, + + -- 三人摩托 + [51] = { + Name = "三人摩托_黑色", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/MotorcycleCart/VH_MotorcycleCart.VH_MotorcycleCart_C', + }, + [52] = { + Name = "三人摩托_褐色", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/MotorcycleCart/VH_MotorcycleCart_1.VH_MotorcycleCart_1_C', + }, + + -- 滑翔机 + [53] = { + Name = "滑翔机", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/Motorglider/VH_Motorglider.VH_Motorglider_C', + }, + + -- PG-117快艇 + [54] = { + Name = "PG-117快艇", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/PG117/VH_PG117.VH_PG117_C', + }, + + -- 小型摩托车 + [55] = { + Name = "小型摩托车_青", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/Scooter/VH_Scooter.VH_Scooter_C', + }, + [56] = { + Name = "小型摩托车_白", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/Scooter/VH_Scooter2.VH_Scooter2_C', + }, + [57] = { + Name = "小型摩托车_粉", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/Scooter/VH_Scooter3.VH_Scooter3_C', + }, + [58] = { + Name = "小型摩托车_黑", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/Scooter/VH_Scooter4.VH_Scooter4_C', + }, + + -- 轻型雪地摩托 + [59] = { + Name = "轻型雪地摩托1", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/Snowbike/VH_Snowbike.VH_Snowbike_C', + }, + [60] = { + Name = "轻型雪地摩托2", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/Snowbike/VH_Snowbike_02.VH_Snowbike_02_C', + }, + + -- 滑雪板 + [61] = { + Name = "滑雪板", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/SnowBoard/VH_SnowBoard.VH_SnowBoard_C', + }, + + -- UAZ越野车 + [62] = { + Name = "UAZ越野车", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/UAZ01/VH_UAZ01_New.VH_UAZ01_New_C', + }, + [63] = { + Name = "布棚子UAZ越野车", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/UAZ01/VH_UAZ02_New.VH_UAZ02_New_C', + }, + [64] = { + Name = "敞篷UAZ越野车", + Path = '/Game/Arts_PlayerBluePrints/Vehicle/UAZ01/VH_UAZ03_New.VH_UAZ03_New_C', + }, +} diff --git a/CounterAttack_Solo/Script/Global/Tables/WeaponGradientTable.lua b/CounterAttack_Solo/Script/Global/Tables/WeaponGradientTable.lua new file mode 100644 index 00000000..133c7bc8 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/Tables/WeaponGradientTable.lua @@ -0,0 +1,38 @@ +--- +--- Generated by EmmyLua(https://github.com/EmmyLua) +--- Created by LT. +--- DateTime: 2023/12/1 16:29 +--- + +WeaponGradientTable = WeaponGradientTable or{} + + +WeaponGradientTable.DefaultWeapon = { 108004, 108003, 108002, 108001 } + +WeaponGradientTable.Gradient = { + + {101005, 102005, 105002, 104001, 102001, 106001, -1}, + {101006, 102003, 101007, 105001, 104003, 106002, -1}, + {101004, 102002, 103004, 104001, 105003, 106003, -1}, + {101001, 102001, 103007, 104003, 102004, 106004, -1}, + {101003, 102004, 103006, 104003, 102003, 106010, -1}, + {107002, 102003, 103005, 104002, 105003, 106002, -1}, + {107002, 102005, 105002, 104002, 103004, 106006, -1}, + +} + +WeaponGradientTable.GradientNotMelee = { + + {101005, 102005, 105002, 104001, 102001, 106001}, + {101006, 102003, 101007, 105001, 104003, 106002}, + {101004, 102002, 103004, 104001, 105003, 106003}, + {101001, 102001, 103007, 104003, 102004, 106004}, + {101003, 102004, 103006, 104003, 102003, 106010}, + {107002, 102003, 103005, 104002, 105003, 106002}, + {107002, 102005, 105002, 104002, 103004, 106006}, + +} + +WeaponGradientTable.SnipeGradient = { + {103004, 103009, 103004, 103006, 103005, 103003, 103002, 103001} +} \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/Tables/WeaponTable.lua b/CounterAttack_Solo/Script/Global/Tables/WeaponTable.lua new file mode 100644 index 00000000..2de81e88 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/Tables/WeaponTable.lua @@ -0,0 +1,728 @@ + +-- 武器表 +WeaponTable = {} + +-- 射击枪械槽类型 +ShootWeaponEnums = { + ESurviveWeaponPropSlot.SWPS_MainShootWeapon1, + ESurviveWeaponPropSlot.SWPS_MainShootWeapon2, + ESurviveWeaponPropSlot.SWPS_SubShootWeapon, +}; + +-- 配件 +EWeaponPartType = { + Muzzle = 1, + Grip = 2, + Telescope = 3, + Magazine = 4, + ButtStock = 5, + SubTelescope = 6 +}; + +-- 配件展示顺序 +PartTypeDisplayOrder = { + EWeaponPartType.Telescope, + EWeaponPartType.Muzzle, + EWeaponPartType.Magazine, + EWeaponPartType.Grip, + EWeaponPartType.ButtStock, + EWeaponPartType.SubTelescope, +} + +-- 配件类型名 +PartTypeName = { + [EWeaponPartType.Muzzle] = { Chinese = "枪口", English = "Muzzle", SubId = 201, }, + [EWeaponPartType.Grip] = { Chinese = "握把", English = "Grip", SubId = 202, }, + [EWeaponPartType.Telescope] = { Chinese = "瞄准镜", English = "Telescope", SubId = 203, }, + [EWeaponPartType.Magazine] = { Chinese = "弹匣", English = "Magazine", SubId = 204, }, + [EWeaponPartType.ButtStock] = { Chinese = "枪托", English = "ButtStock", SubId = 205, }, + [EWeaponPartType.SubTelescope] = { Chinese = "侧边瞄准镜", English = "SubTelescope", SubId = 205, }, +}; + +-- 武器配件类型表 +---@type table> +WeaponTypeParts = { + [EWeaponPartType.Muzzle] = { 201001, 201002, 201003, 201004, 201005, 201006, 201007, 201008, 201009, 201010, 201011, 201012, 201050, 201051 }, + [EWeaponPartType.Grip] = { 202001, 202002, 202004, 202005, 202006, 202007 }, + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203005, 203014, 203015, 203018, 203023, 203024, 203030, 203104 }, + [EWeaponPartType.Magazine] = { 204001, 204002, 204003, 204004, 204005, 204006, 204007, 204008, 204009, 204010, 204011, 204012, 204013, 204015, 204016, 204017 }, + [EWeaponPartType.ButtStock] = { 204014, 205001, 205002, 205003, 205004, }, + [EWeaponPartType.SubTelescope] = { 203018, }, +}; + +--武器配件 [ID] = { ID = int, Type = EWeaponPartType,}, +WeaponParts = { + -- 枪口 + [201001] = { ID = 201001, Type = EWeaponPartType.Muzzle, }, + [201002] = { ID = 201002, Type = EWeaponPartType.Muzzle, }, + [201003] = { ID = 201003, Type = EWeaponPartType.Muzzle, }, + [201004] = { ID = 201004, Type = EWeaponPartType.Muzzle, }, + [201005] = { ID = 201005, Type = EWeaponPartType.Muzzle, }, + [201006] = { ID = 201006, Type = EWeaponPartType.Muzzle, }, + [201007] = { ID = 201007, Type = EWeaponPartType.Muzzle, }, + [201008] = { ID = 201008, Type = EWeaponPartType.Muzzle, }, + [201009] = { ID = 201009, Type = EWeaponPartType.Muzzle, }, + [201010] = { ID = 201010, Type = EWeaponPartType.Muzzle, }, + [201011] = { ID = 201011, Type = EWeaponPartType.Muzzle, }, + [201012] = { ID = 201012, Type = EWeaponPartType.Muzzle, }, + [201050] = { ID = 201050, Type = EWeaponPartType.Muzzle, }, + [201051] = { ID = 201051, Type = EWeaponPartType.Muzzle, }, + + -- 握把 + [202001] = { ID = 202001, Type = EWeaponPartType.Grip, }, + [202002] = { ID = 202002, Type = EWeaponPartType.Grip, }, + [202004] = { ID = 202004, Type = EWeaponPartType.Grip, }, + [202005] = { ID = 202005, Type = EWeaponPartType.Grip, }, + [202006] = { ID = 202006, Type = EWeaponPartType.Grip, }, + [202007] = { ID = 202007, Type = EWeaponPartType.Grip, }, + + -- 瞄准镜 + [203001] = { ID = 203001, Type = EWeaponPartType.Telescope, }, + [203002] = { ID = 203002, Type = EWeaponPartType.Telescope, }, + [203003] = { ID = 203003, Type = EWeaponPartType.Telescope, }, + [203004] = { ID = 203004, Type = EWeaponPartType.Telescope, }, + [203005] = { ID = 203005, Type = EWeaponPartType.Telescope, }, + [203014] = { ID = 203014, Type = EWeaponPartType.Telescope, }, + [203015] = { ID = 203015, Type = EWeaponPartType.Telescope, }, + [203030] = { ID = 203030, Type = EWeaponPartType.Telescope, }, + + -- 侧边瞄准镜 + [203018] = { ID = 203018, Type = EWeaponPartType.SubTelescope, }, + + -- 弹匣 + [204001] = { ID = 204001, Type = EWeaponPartType.Magazine, }, + [204002] = { ID = 204002, Type = EWeaponPartType.Magazine, }, + [204003] = { ID = 204003, Type = EWeaponPartType.Magazine, }, + [204004] = { ID = 204004, Type = EWeaponPartType.Magazine, }, + [204005] = { ID = 204005, Type = EWeaponPartType.Magazine, }, + [204006] = { ID = 204006, Type = EWeaponPartType.Magazine, }, + [204007] = { ID = 204007, Type = EWeaponPartType.Magazine, }, + [204008] = { ID = 204008, Type = EWeaponPartType.Magazine, }, + [204009] = { ID = 204009, Type = EWeaponPartType.Magazine, }, + [204010] = { ID = 204010, Type = EWeaponPartType.Magazine, }, + [204011] = { ID = 204011, Type = EWeaponPartType.Magazine, }, + [204012] = { ID = 204012, Type = EWeaponPartType.Magazine, }, + [204013] = { ID = 204013, Type = EWeaponPartType.Magazine, }, + [204015] = { ID = 204015, Type = EWeaponPartType.Magazine, }, + [204016] = { ID = 204016, Type = EWeaponPartType.Magazine, }, + + -- 枪托 + [204014] = { ID = 204014, Type = EWeaponPartType.ButtStock, }, -- 特例 + [205001] = { ID = 205001, Type = EWeaponPartType.ButtStock, }, + [205002] = { ID = 205002, Type = EWeaponPartType.ButtStock, }, + [205003] = { ID = 205003, Type = EWeaponPartType.ButtStock, }, + [205004] = { ID = 205004, Type = EWeaponPartType.ButtStock, }, +}; + + + + +-- 武器套装表 +---@type table>> +WeaponSuits = { + -- AKM突击步枪 + [101001] = { + [EWeaponPartType.Muzzle] = { 201009, 201010, 201011, }, + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203014, 203015, }, + [EWeaponPartType.Magazine] = { 204013, 204011, 204012, }, + [EWeaponPartType.SubTelescope] = { 203018, }, + }, + -- M16A4突击步枪 + [101002] = { + [EWeaponPartType.Muzzle] = { 201009, 201010, 201011 }, + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203014, 203015, }, + [EWeaponPartType.Magazine] = { 204013, 204011, 204012, }, + [EWeaponPartType.ButtStock] = { 205002 }, + [EWeaponPartType.SubTelescope] = { 203018, }, + }, + -- SCAR-L突击步枪 + [101003] = { + [EWeaponPartType.Muzzle] = { 201009, 201010, 201011, }, + [EWeaponPartType.Grip] = { 202001, 202002, 202004, 202005, 202006, 202007, }, + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203014, 203015, }, + [EWeaponPartType.Magazine] = { 204013, 204011, 204012, }, + [EWeaponPartType.SubTelescope] = { 203018, }, + }, + -- M416突击步枪 + [101004] = { + [EWeaponPartType.Muzzle] = { 201009, 201010, 201011 }, + [EWeaponPartType.Grip] = { 202001, 202002, 202004, 202005, 202006, 202007, }, + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203014, 203015, }, + [EWeaponPartType.Magazine] = { 204013, 204011, 204012, }, + [EWeaponPartType.ButtStock] = { 205002, }, + [EWeaponPartType.SubTelescope] = { 203018, }, + }, + -- GROZA突击步枪 + [101005] = { + [EWeaponPartType.Muzzle] = { 201011, }, + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203014, 203015, }, + [EWeaponPartType.Magazine] = { 204013, 204011, 204012, }, + }, + -- AUG突击步枪 + [101006] = { + [EWeaponPartType.Muzzle] = { 201009, 201010, 201011, }, + [EWeaponPartType.Grip] = { 202001, 202002, 202004, 202005, 202006, 202007, }, + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203014, 203015, }, + [EWeaponPartType.Magazine] = { 204013, 204011, 204012, }, + [EWeaponPartType.SubTelescope] = { 203018, }, + }, + -- QBZ突击步枪 + [101007] = { + [EWeaponPartType.Muzzle] = { 201009, 201010, 201011, }, + [EWeaponPartType.Grip] = { 202001, 202002, 202004, 202005, 202006, 202007, }, + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203014, 203015, }, + [EWeaponPartType.Magazine] = { 204013, 204011, 204012, }, + [EWeaponPartType.SubTelescope] = { 203018, }, + }, + -- M762突击步枪 + [101008] = { + [EWeaponPartType.Muzzle] = { 201009, 201010, 201011 }, + [EWeaponPartType.Grip] = { 202001, 202002, 202004, 202005, 202006, 202007, }, + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203014, 203015, }, + [EWeaponPartType.Magazine] = { 204013, 204012, 204011 }, + [EWeaponPartType.SubTelescope] = { 203018, }, + }, + -- Mk47突击步枪 + [101009] = { + [EWeaponPartType.Muzzle] = { 201009, 201010, 201011, }, + [EWeaponPartType.Grip] = { 202001, 202002, 202004, 202005, 202006, 202007, }, + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203014, 203015, }, + [EWeaponPartType.Magazine] = { 204013, 204012, 204011 }, + [EWeaponPartType.ButtStock] = { 205002, }, + [EWeaponPartType.SubTelescope] = { 203018, }, + }, + -- G36C突击步枪 + [101010] = { + [EWeaponPartType.Muzzle] = { 201009, 201010, 201011, }, + [EWeaponPartType.Grip] = { 202001, 202002, 202004, 202005, 202006, 202007, }, + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203014, 203015, }, + [EWeaponPartType.Magazine] = { 204013, 204012, 204011 }, + [EWeaponPartType.SubTelescope] = { 203018, }, + }, + -- AC-VAL突击步枪 + [101011] = { + [EWeaponPartType.Grip] = { 202001, 202002, 202004, 202005, 202006, 202007, }, + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203014, }, + [EWeaponPartType.Magazine] = { 204013, 204012, 204011 }, + }, + -- 蜜獾突击步枪 + [101012] = { + [EWeaponPartType.Muzzle] = { 201009, 201010, 201011 }, + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203014, 203015, }, + [EWeaponPartType.Magazine] = { 204013, 204012, 204011 }, + [EWeaponPartType.SubTelescope] = { 203018, }, + }, + -- FAMAS突击步枪 + [101013] = { + [EWeaponPartType.Muzzle] = { 201009, 201010, 201011 }, + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203014, 203015, }, + [EWeaponPartType.Magazine] = { 204013, 204012, 204011 }, + }, + + -- UZI冲锋枪 + [102001] = { + [EWeaponPartType.Muzzle] = { 201002, 201004, 201006, }, + [EWeaponPartType.Telescope] = { 203001, 203002, }, + [EWeaponPartType.Magazine] = { 204006, 204004, 204005, }, + [EWeaponPartType.ButtStock] = { 205001 }, + }, + -- UMP45冲锋枪 + [102002] = { + [EWeaponPartType.Muzzle] = { 201002, 201004, 201006, }, + [EWeaponPartType.Grip] = { 202001, 202002, 202004, 202005, 202006, 202007, }, + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203014, 203015, }, + [EWeaponPartType.Magazine] = { 204006, 204004, 204005, }, + [EWeaponPartType.SubTelescope] = { 203018, }, + }, + -- Vector冲锋枪 + [102003] = { + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203014, 203015, }, + [EWeaponPartType.Muzzle] = { 201002, 201004, 201006, }, + [EWeaponPartType.Magazine] = { 204006, 204004, 204005, }, + [EWeaponPartType.Grip] = { 202002, 202004, 202005, 202007, }, + [EWeaponPartType.ButtStock] = { 205002, }, + [EWeaponPartType.SubTelescope] = { 203018, }, + }, + -- 汤姆逊冲锋枪 + [102004] = { + [EWeaponPartType.Muzzle] = { 201006, }, + [EWeaponPartType.Grip] = { 202002, }, + [EWeaponPartType.Telescope] = { 203001, 203002, }, + [EWeaponPartType.Magazine] = { 204006, 204004, 204005, }, + }, + -- 野牛冲锋枪 + [102005] = { + [EWeaponPartType.Muzzle] = { 201002, 201004, 201006, }, + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203014 }, + [EWeaponPartType.SubTelescope] = { 203018, }, + }, + -- MP5K冲锋枪 + [102007] = { + [EWeaponPartType.Muzzle] = { 201002, 201004, 201006, }, + [EWeaponPartType.Grip] = { 202001, 202002, 202004, 202005, 202006, 202007, }, + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203014, 203015, }, + [EWeaponPartType.Magazine] = { 204006, 204004, 204005, }, + [EWeaponPartType.ButtStock] = { 205002, }, + [EWeaponPartType.SubTelescope] = { 203018, }, + }, + -- AKS-74U冲锋枪 + [102008] = { + [EWeaponPartType.Muzzle] = { 201002, 201004, 201006, }, + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203014 }, + [EWeaponPartType.Magazine] = { 204006, 204004, 204005, }, + }, + -- P90冲锋枪 + [102105] = { }, + + -- Kar98K狙击枪 + [103001] = { + [EWeaponPartType.Muzzle] = { 201003, 201005, 201007 }, + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203005, 203014, 203015, 203030, }, + [EWeaponPartType.ButtStock] = { 205003, 204014, }, + [EWeaponPartType.SubTelescope] = { 203018, }, + }, + [103901] = { + [EWeaponPartType.Muzzle] = { 201003, 201005, 201007 }, + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203005, 203014, 203015, 203030, }, + [EWeaponPartType.ButtStock] = { 204014, 205003, }, + [EWeaponPartType.SubTelescope] = { 203018, }, + }, + -- M24狙击枪 + [103002] = { + [EWeaponPartType.Muzzle] = { 201003, 201005, 201007, }, + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203005, 203014, 203015, 203030, }, + [EWeaponPartType.Magazine] = { 204009, 204007, 204008, }, + [EWeaponPartType.ButtStock] = { 205003, }, + [EWeaponPartType.SubTelescope] = { 203018, }, + }, + [103902] = { + [EWeaponPartType.Muzzle] = { 201003, 201005, 201007, }, + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203005, 203014, 203015, 203030, }, + [EWeaponPartType.Magazine] = { 204009, 204007, 204008, }, + [EWeaponPartType.ButtStock] = { 205003, }, + [EWeaponPartType.SubTelescope] = { 203018, }, + }, + -- AWM狙击枪 + [103003] = { + [EWeaponPartType.Muzzle] = { 201003, 201005, 201007, }, + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203005, 203014, 203015, 203030, }, + [EWeaponPartType.Magazine] = { 204009, 204007, 204008, }, + [EWeaponPartType.ButtStock] = { 205003, }, + [EWeaponPartType.SubTelescope] = { 203018, }, + }, + [103903] = { + [EWeaponPartType.Muzzle] = { 201003, 201005, 201007, }, + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203005, 203014, 203015, 203030, }, + [EWeaponPartType.Magazine] = { 204009, 204007, 204008, }, + [EWeaponPartType.ButtStock] = { 205003, }, + [EWeaponPartType.SubTelescope] = { 203018, }, + }, + -- AMR狙击枪 + [103012] = { + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203005, 203014, 203015, 203030, }, + }, + -- M200狙击枪 + [103015] = { + [EWeaponPartType.Muzzle] = { 201003, 201005, 201007, }, + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203005, 203014, 203015, 203030, }, + [EWeaponPartType.Magazine] = { 204009, 204007, 204008, }, + [EWeaponPartType.SubTelescope] = { 203018, }, + }, + + -- SKS射手步枪 + [103004] = { + [EWeaponPartType.Muzzle] = { 201003, 201005, 201007, 201009, 201010, 201011, }, + [EWeaponPartType.Grip] = { 202001, 202002, 202004, 202005, 202006, 202007, }, + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203005, 203014, 203015, 203030, }, + [EWeaponPartType.Magazine] = { 204009, 204007, 204008, }, + [EWeaponPartType.ButtStock] = { 205003, 204014, }, + [EWeaponPartType.SubTelescope] = { 203018, }, + }, + -- VSS射手步枪 + [103005] = { + [EWeaponPartType.Magazine] = { 204009, 204007, 204008, }, + [EWeaponPartType.ButtStock] = { 205003, }, + }, + -- Mini14射手步枪 + [103006] = { + [EWeaponPartType.Muzzle] = { 201003, 201005, 201007, 201009, 201010, 201011, }, + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203005, 203014, 203015, 203030, }, + [EWeaponPartType.Magazine] = { 204009, 204007, 204008, }, + [EWeaponPartType.SubTelescope] = { 203018, }, + }, + -- Mk14射手步枪 + [103007] = { + [EWeaponPartType.Muzzle] = { 201003, 201005, 201007, 201009, 201010, 201011, }, + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203005, 203014, 203015, 203030, }, + [EWeaponPartType.Magazine] = { 204009, 204007, 204008, }, + [EWeaponPartType.ButtStock] = { 205003, }, + [EWeaponPartType.SubTelescope] = { 203018, }, + }, + -- Win94狙击枪 + [103008] = { + [EWeaponPartType.ButtStock] = { 204014 }, + }, + -- SLR射手步枪 + [103009] = { + [EWeaponPartType.Muzzle] = { 201003, 201005, 201007, 201009, 201010, 201011, }, + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203005, 203014, 203015, 203030, }, + [EWeaponPartType.Magazine] = { 204009, 204007, 204008, }, + [EWeaponPartType.ButtStock] = { 205003, }, + [EWeaponPartType.SubTelescope] = { 203018, }, + }, + -- QBU射手步枪 + [103010] = { + [EWeaponPartType.Muzzle] = { 201003, 201005, 201007, 201009, 201010, 201011, }, + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203005, 203014, 203015, 203030, }, + [EWeaponPartType.Magazine] = { 204009, 204007, 204008, }, + [EWeaponPartType.SubTelescope] = { 203018, }, + }, + -- 莫辛纳甘狙击枪 + [103011] = { + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203005, 203014, 203015, 203030, }, + [EWeaponPartType.Muzzle] = { 201003, 201005, 201007 }, + [EWeaponPartType.ButtStock] = { 205003, 204014, }, + [EWeaponPartType.SubTelescope] = { 203018, }, + }, + -- Mk12射手步枪 + [103100] = { + [EWeaponPartType.Muzzle] = { 201003, 201005, 201007, 201009, 201010, 201011, }, + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203005, 203014, 203015, 203030, }, + [EWeaponPartType.Magazine] = { 204009, 204007, 204008, }, + [EWeaponPartType.Grip] = { 202001, 202002, 202004, 202005, 202006, 202007, }, + [EWeaponPartType.SubTelescope] = { 203018, }, + }, + -- Mk417射手步枪 + [103013] = { + [EWeaponPartType.Muzzle] = { 201003, 201005, 201007, 201009, 201010, 201011, }, + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203005, 203014, 203015, 203030, }, + [EWeaponPartType.Magazine] = { 204009, 204007, 204008, }, + [EWeaponPartType.Grip] = { 202001, 202002, 202004, 202005, 202006, 202007, }, + [EWeaponPartType.SubTelescope] = { 203018, }, + }, + -- MK20-H射手步枪 + [103014] = { + [EWeaponPartType.Muzzle] = { 201003, 201005, 201007, 201009, 201010, 201011, }, + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203005, 203014, 203015, 203030, }, + [EWeaponPartType.Magazine] = { 204009, 204007, 204008, }, + [EWeaponPartType.Grip] = { 202001, 202002, 202004, 202005, 202006, 202007, }, + [EWeaponPartType.ButtStock] = { 205003, }, + [EWeaponPartType.SubTelescope] = { 203018, }, + }, + + -- S686霰弹枪 + [104001] = { + [EWeaponPartType.Muzzle] = { 201001, }, + [EWeaponPartType.ButtStock] = { 204014, }, + }, + -- S1897霰弹枪 + [104002] = { + [EWeaponPartType.Muzzle] = { 201001, 201012, }, + [EWeaponPartType.Magazine] = { 204017, }, + [EWeaponPartType.ButtStock] = { 204014, }, + }, + -- S12K霰弹枪 + [104003] = { + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203014, 203015, }, + [EWeaponPartType.Muzzle] = { 201009, 201010, 201011, 201012, }, + [EWeaponPartType.Magazine] = { 204013, 204011, 204012, }, + [EWeaponPartType.SubTelescope] = { 203018, }, + }, + -- DBS霰弹枪 + [104004] = { + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203014, 203015, }, + [EWeaponPartType.Magazine] = { 204017, }, + [EWeaponPartType.SubTelescope] = { 203018, }, + }, + -- AA12-G霰弹枪 + [104005] = { + [EWeaponPartType.Telescope] = { 203001, 203002, }, + [EWeaponPartType.Muzzle] = { 201009, 201010, 201011, }, + [EWeaponPartType.Magazine] = { 204013, 204011, 204012, }, + }, + -- SPAS-12霰弹枪 + [104100] = { + [EWeaponPartType.Magazine] = { 204017, }, + }, + -- M249轻机枪 + [105001] = { + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203014, 203015, }, + [EWeaponPartType.Magazine] = { 204013, 204011, 204012, }, + [EWeaponPartType.ButtStock] = { 205002 }, + [EWeaponPartType.SubTelescope] = { 203018, }, + }, + -- DP-28轻机枪 + [105002] = { + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203014, 203015, }, + }, + -- M134重机枪 + [105003] = {}, + -- MG3轻机枪 + [105010] = { + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203014, 203015, }, + }, + -- PKM轻机枪 + [105012] = { + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203014, 203015, }, + [EWeaponPartType.Magazine] = { 204013, 204011, 204012, }, + [EWeaponPartType.Grip] = { 202001, 202002, }, + [EWeaponPartType.SubTelescope] = { 203018, }, + }, + + -- P92手枪 + [106001] = { + [EWeaponPartType.Telescope] = { 203001, 203002, }, + [EWeaponPartType.Muzzle] = { 201006, }, + [EWeaponPartType.Grip] = { 202007, }, + [EWeaponPartType.Magazine] = { 204006, 204001, 204002, }, + }, + -- P1911手枪 + [106002] = { + [EWeaponPartType.Telescope] = { 203001, 203002, }, + [EWeaponPartType.Muzzle] = { 201006, }, + [EWeaponPartType.Grip] = { 202007, }, + [EWeaponPartType.Magazine] = { 204006, 204001, 204002, }, + }, + -- R1895手枪 + [106003] = { + [EWeaponPartType.Muzzle] = { 201006, } + }, + -- P18C手枪 + [106004] = { + [EWeaponPartType.Telescope] = { 203001, 203002, }, + [EWeaponPartType.Muzzle] = { 201006, }, + [EWeaponPartType.Grip] = { 202007, }, + [EWeaponPartType.Magazine] = { 204005, } + }, + -- R45手枪 + [106005] = { + [EWeaponPartType.Telescope] = { 203001, 203002, }, + [EWeaponPartType.Grip] = { 202007, }, + }, + -- 短管霰弹枪 + [106006] = { + [EWeaponPartType.Muzzle] = { 201001 } + }, + -- 蝎式手枪 + [106008] = { + [EWeaponPartType.Telescope] = { 203001, 203002, }, + [EWeaponPartType.Muzzle] = { 201006, }, + [EWeaponPartType.Grip] = { 202002, 202004, 202005, 202007 }, + [EWeaponPartType.Magazine] = { 204004, }, -- 只有这个 + [EWeaponPartType.ButtStock] = { 205001 } + }, + -- 沙漠之鹰手枪 + [106010] = { + [EWeaponPartType.Telescope] = { 203001, 203002, }, + [EWeaponPartType.Magazine] = { 204006, 204004, 204005, }, + [EWeaponPartType.Grip] = { 202007 } + }, + -- TMP-9手枪 + [106011] = { + [EWeaponPartType.Telescope] = { 203001, 203002, }, + [EWeaponPartType.Magazine] = { 204006, 204004, 204005, }, + [EWeaponPartType.Muzzle] = { 201002, 201004, 201006, }, + }, + -- 乱斗手枪 + [106107] = {}, + + -- 十字弩 + [107001] = { + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203014, }, + [EWeaponPartType.Grip] = { 205004, }, + }, + -- 战术弩 + [107006] = { + [EWeaponPartType.Telescope] = { 203001, 203002, 203003, 203004, 203014, }, + [EWeaponPartType.Grip] = { 205004, }, + }, + -- 燃点复合弓 + [107008] = { + [EWeaponPartType.Telescope] = { 203001, 203003, 203014, }, + }, + + -- RPG-7火箭弹 + [107002] = {}, + -- 铁拳火箭筒 + [107005] = {}, + + + -- 大砍刀 + [108001] = {}, + -- 撬棍 + [108002] = {}, + -- 镰刀 + [108003] = {}, + -- 平底锅 + [108004] = {} +}; + +WeaponNameTable = { + [EWeaponTypeNew.EWeaponTypeNew_Other] = { Chinese = "其他", English = "Other", }, [EWeaponTypeNew.EWeaponTypeNew_Rifle] = { Chinese = "步枪", English = "Rifle", }, [EWeaponTypeNew.EWeaponTypeNew_SingleShotSniper] = { Chinese = "单发狙", English = "SingleShotSniper", }, [EWeaponTypeNew.EWeaponTypeNew_BurstShotSniper] = { Chinese = "连发狙", English = "BurstShotSniper", }, [EWeaponTypeNew.EWeaponTypeNew_Submachine] = { Chinese = "冲锋枪", English = "Submachine", }, [EWeaponTypeNew.EWeaponTypeNew_ShotGun] = { Chinese = "霰弹枪", English = "ShotGun", }, [EWeaponTypeNew.EWeaponTypeNew_MachineGun] = { Chinese = "机枪", English = "MachineGun", }, [EWeaponTypeNew.EWeaponTypeNew_Pistol] = { Chinese = "手枪", English = "Pistol", }, [EWeaponTypeNew.EWeaponTypeNew_Melee] = { Chinese = "近战武器", English = "Melee", }, [EWeaponTypeNew.EWeaponTypeNew_Crossbow] = { Chinese = "弓箭", English = "Crossbow", }, [EWeaponTypeNew.EWeaponTypeNew_ThrownObj] = { Chinese = "投掷物", English = "ThrownObj", }, +}; + + +--- 武器对应的子弹ID +WeaponAmmunitionItem = { + [101001] = 302001, [101002] = 303001, [101003] = 303001, [101004] = 303001, [101005] = 302001, [101006] = 303001, [101007] = 303001, [101008] = 302001, [101009] = 302001, [101010] = 302001, [101012] = 302001, [102001] = 301001, [102002] = 305001, [102003] = 301001, [102004] = 305001, [102005] = 301001, [102007] = 301001, [102105] = 301002, [103001] = 302001, [103002] = 302001, [103003] = 306001, [103004] = 302001, [103005] = 301001, [103006] = 303001, [103007] = 302001, [103008] = 305001, [103009] = 302001, [103010] = 303001, [103011] = 302001, [104001] = 304001, [104002] = 304001, [104003] = 304001, [104004] = 304001, [104100] = 304001, [105001] = 303001, [105002] = 302001, [105003] = 302001, [106001] = 301001, [106002] = 305001, [106003] = 302001, [106004] = 301001, [106005] = 305001, [106006] = 304001, [106008] = 301001, [106010] = 305001, [107001] = 307001, [107002] = 307002, [107094] = 307002, [107099] = 307002, [107905] = 307002, + [190008] = 307102, [190009] = 307100, [190010] = 307103, [190011] = 307101, +} + + +--- 推荐武器配置 +WeaponTable.RecommendedWeaponParts = { + -- 步枪 + [101001] = { 203018, 204013, 201009, 203001, } , + [101002] = { 203018, 204013, 201009, 205002, 203001, } , + [101003] = { 203018, 204013, 201009, 202007, 203001, } , + [101004] = { 203018, 201009, 202007, 203001, 204013, 205002, } , + [101005] = { 204013, 201011, 203001, } , + [101006] = { 203018, 204013, 201009, 202007, 203001, } , + [101007] = { 203018, 204013, 201009, 202007, 203001, } , + [101008] = { 203018, 204013, 201009, 202007, 203001, } , + [101009] = { 203018, 201009, 202007, 203001, 204013, 205002, } , + [101010] = { 203018, 204013, 201009, 202007, 203001, } , + [101011] = { 202002, 203002, 204013, }, + [101012] = { 203018, 204013, 201009, 203001, } , + [101013] = { 201009, 203002, 204013,}, + -- 冲锋枪 + [102001] = { 204006, 201002, 205001, 203001, } , + [102002] = { 203018, 204006, 201002, 202007, 203001, } , + [102003] = { 203018, 201002, 202007, 203001, 204006, 205002, } , + [102004] = { 204006, 201006, 202002, 203001, } , + [102005] = { 203018, 203001, 201002, } , + [102007] = { 203018, 201002, 202007, 203001, 204006, 205002, } , + [102008] = { 201002, 203001, 204006, }, + [102105] = { } , + -- 狙击 + [103001] = { 203018, 201007, 204014, 203005, } , + [103002] = { 203018, 204009, 201007, 205003, 203005, } , + [103003] = { 203018, 204009, 201007, 205003, 203005, } , + [103004] = { 203018, 201007, 202007, 203004, 204009, 205003, } , + [103005] = { 204009, 205003, } , + [103006] = { 203018, 204009, 201007, 203004, } , + [103007] = { 203018, 204009, 201007, 205003, 203004, } , + [103008] = { 204014, } , + [103009] = { 203018, 204009, 201007, 205003, 203004, } , + [103010] = { 203018, 204009, 201007, 203004, } , + [103011] = { 203018, 201007, 204014, 203004, } , + [103012] = { 203030} , + [103013] = { 203018, 203015, 201007, 204009, 202007, }, + [103014] = { 203018, 203015, 201007, 204009, 202007, 205003, }, + [103015] = { 203018, 203015, 201007, 204009 }, + [103901] = { 203018, 201007, 204014, 203005, } , + [103902] = { 203018, 204009, 201007, 205003, 203005, } , + [103903] = { 203018, 204009, 201007, 205003, 203005, } , + [103100] = { 203018, 204009, 201007, 202007, 203004, } , + -- 霰弹枪 + [104001] = { 204014, 201001, } , + [104002] = { 204014, 201001, 204017, } , + [104003] = { 203018, 204013, 201012, 203001, } , + [104004] = { 203018, 203001, 204017, } , + [104005] = { 204013, 203001, 201009, }, + [104100] = { 204017, }, + -- 机枪 + [105001] = { 203018, 204013, 205002, 203001, } , + [105002] = { 203001, } , + [105003] = {}, + [105010] = { 203002, }, + [105012] = { 203018, 203001, 204013, 202002, }, + -- 手枪 + [106001] = { 204003, 201008, 203001, 202007, } , + [106002] = { 204003, 201008, 203001, 202007, } , + [106003] = { 201008, } , + [106004] = { 204003, 201008, 203001, 202007, } , + [106005] = { 203001, 202007, } , + [106006] = { 201008, } , + [106008] = { 201008, 202007, 203001, 204002, 205001, } , + [106010] = { 204002, 202007, 203001, } , + [106011] = { 203002, 204006, 201002 }, + [106107] = {}, + -- 特殊武器 + [107001] = { 205004, 203001, } , + [107002] = {},-- RPG-7火箭弹 + [107005] = {},-- 铁拳火箭筒 + [107006] = { 203004, 205004 }, + [107008] = { 203014, }, + -- 近战武器 + [108001] = { } , + [108002] = { } , + [108003] = { } , + [108004] = { } , +} + +-- 武器射速 +WeaponTable.WeaponRateOfFire = { + [101001] = 0.100 , + [101002] = 0.070 , + [101003] = 0.098 , + [101004] = 0.098 , + [101005] = 0.080 , + [101006] = 0.085 , + [101007] = 0.098 , + [101008] = 0.098 , + [101009] = 0.070588 , + [101010] = 0.094 , + [101011] = 0.0769 , + [101012] = 0.089 , + [101013] = 0.070 , + [102001] = 0.048 , + [102002] = 0.089552 , + [102003] = 0.0545 , + [102004] = 0.0920 , + [102005] = 0.0790 , + [102007] = 0.0666 , + [102008] = 0.0816 , + [102105] = 0.060 , + [103001] = 1.550 , + [103002] = 1.300 , + [103003] = 1.900 , + [103004] = 0.090 , + [103005] = 0.0856 , + [103006] = 0.100 , + [103007] = 0.100 , + [103008] = 0.910 , + [103009] = 0.100 , + [103010] = 0.100 , + [103011] = 1.5 , + [103012] = 1.5 , + [103013] = 0.180 , + [103014] = 0.300 , + [103015] = 1.900 , + [103100] = 0.100 , + [103901] = 1.900 , + [103902] = 1.300 , + [103903] = 1.900 , + [104001] = 0.200 , + [104002] = 0.100 , + [104003] = 0.250 , + [104004] = 0.125 , + [104005] = 0.260 , + [104100] = 0.230 , + [105001] = 0.088 , + [105002] = 0.109 , + [105003] = 0.050 , + [105010] = 0.060606 , -- MG3的模式比较特殊 加速为0.060606 非加速为0.090909 + [105012] = 0.092 , + [106001] = 0.100 , + [106002] = 0.110 , + [106003] = 0.200 , + [106004] = 0.060 , + [106005] = 0.250 , + [106006] = 0.200 , + [106008] = 0.070588 , + [106010] = 0.200 , + [106011] = 0.075 , + [106107] = 1.000 , + [107001] = 0.075 , + [107002] = 3.000 , + [107005] = 3.000 , + [107006] = 0.075 , + [107008] = 0.075 , + [108001] = nil , + [108002] = nil , + [108003] = nil , + [108004] = nil , +} + + diff --git a/CounterAttack_Solo/Script/Global/Tool/A_IncludeTool.lua b/CounterAttack_Solo/Script/Global/Tool/A_IncludeTool.lua new file mode 100644 index 00000000..6e1cdd26 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/Tool/A_IncludeTool.lua @@ -0,0 +1,10 @@ +--- +--- Generated by EmmyLua(https://github.com/EmmyLua) +--- Created by HGX. +--- DateTime: 2024/1/17 12:11 +--- + +local Prefix = "Script.Global.Tool." + +require(Prefix .. 'UITool'); +require(Prefix .. 'FileTool'); \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/Tool/FileTool.lua b/CounterAttack_Solo/Script/Global/Tool/FileTool.lua new file mode 100644 index 00000000..683283bd --- /dev/null +++ b/CounterAttack_Solo/Script/Global/Tool/FileTool.lua @@ -0,0 +1,44 @@ +--- 文件工具 +FileTool = FileTool or {} +FileTool.IsServer = nil; +-- 缓存的资产 +FileTool.CacheAsset = {}; + +---@param AssetPath string +---@param CallBackFunc fun(LoadObject:UObject,resID:int32) +---@param Obj table CallBackFunc拥有者 +---@param SaveAsset bool 是否保存 +function FileTool.AsyncLoadAsset(AssetPath, CallBackFunc, Obj, SaveAsset) + if not UE.IsValid(FileTool.CacheAsset[AssetPath]) then + local softObjPath = KismetSystemLibrary.MakeSoftObjectPath(AssetPath); + STExtraBlueprintFunctionLibrary.GetAssetByAssetReferenceAsync(softObjPath, ObjectExtend.CreateDelegate(UGCGameSystem.GameState, function(LoadObject, resID) + if Obj ~= nil then + CallBackFunc(Obj, LoadObject); + else + CallBackFunc(LoadObject); + end + if UE.IsValid(LoadObject) and SaveAsset then + FileTool.CacheAsset[AssetPath] = LoadObject; + end + end), true); + else + if Obj ~= nil then + CallBackFunc(Obj, FileTool.CacheAsset[AssetPath]); + else + CallBackFunc(FileTool.CacheAsset[AssetPath]); + end + end +end + +---@param AssetPath string +---@param SaveAsset bool 是否保存 +function FileTool.LoadAsset(AssetPath, SaveAsset) + if not UE.IsValid(FileTool.CacheAsset[AssetPath]) then + local TargetAsset = UE.LoadObject(AssetPath); + if SaveAsset and UE.IsValid(TargetAsset) then + FileTool.CacheAsset[AssetPath] = TargetAsset; + end + return TargetAsset; + end + return FileTool.CacheAsset[AssetPath]; +end diff --git a/CounterAttack_Solo/Script/Global/Tool/UITool.lua b/CounterAttack_Solo/Script/Global/Tool/UITool.lua new file mode 100644 index 00000000..0c3f1c73 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/Tool/UITool.lua @@ -0,0 +1,167 @@ +UITool = UITool or { + ---@type table 头像 + PlayerHeadPicture = {}; +} + +--- 设置 +---@param widget UUserWidget +---@param offset float +function UITool.SetWidgetToRightBorder(widget, offset) + if not widget then + return + end + local slot = WidgetLayoutLibrary.SlotAsCanvasSlot(widget) + slot:SetAnchors({ Minimum = { X = 1, Y = 0 }, Maximum = { X = 1, Y = 0 } }) + slot:SetAlignment({ X = 1, Y = 0 }) + local offsets = slot:GetOffsets() + slot:SetOffsets({ Left = offset, Right = offsets.Right, Bottom = offsets.Bottom, Top = offsets.Top }) +end + +--- 为防止被清除做出的全局处理 +function UITool.BindButtonClicked(TargetButton, Func, Obj) + TargetButton.OnClicked:Add(Func, Obj) +end + +--- 为防止被清除做出的全局处理 +function UITool.BindButtonPressed(TargetButton, Func, Obj) + TargetButton.OnPressed:Add(Func, Obj) +end + +--- 直接绑定按键点击打开WidgetManager的页面 +function UITool.ButtonOnClickShowPanel(TargetButton, UIType) + TargetButton.OnClicked:Add( + function() + WidgetManager:ShowPanel(UIType, false) + end + ) +end + +--- 绑定UI文本 +function UITool.TextBlockBindingPropertyText(TargetTextBlock, Func, Obj) + TargetTextBlock:BindingProperty("Text", Func, Obj) +end + +function UITool.TextBlockBindingProperty(TargetWidget, PropertyName, Func, Obj) + TargetWidget:BindingProperty(PropertyName, Func, Obj) +end + +function UITool.SetBrushFromTexture(InImage, InIcon) + InImage:SetBrushFromTexture(InIcon); +end + +---@field IsSucceedFun:fun(Callback:fun(Texture:UTexture2DDynamic),DelegateWrapper:UObject) +function UITool.DownloadImage(ImageURL, IsSucceedFun) + local ResHandle = AsyncTaskDownloadImage.DownloadImage(ImageURL) + if type(IsSucceedFun) == "function" then + ResHandle.OnSuccess:Add(IsSucceedFun) + ResHandle.OnFail:Add(IsSucceedFun) + end +end + +--- 异步加载图片,成功后设置到UIImageObj,若该UIImageObj重复加载,则会判断设置时间决定是否设置 +---@param UIImageObj UImage +---@param ResPath string +function UITool.AsyncLoadTextureToUIImage(UIImageObj, ResPath) + if UITool.ImageObjUpdateTime == nil then + -- {Obj = float, ...} + UITool.ImageObjUpdateTime = {} + end + + local BeginLoadTime = KismetSystemLibrary.GetGameTimeInSeconds(UGCGameSystem.GameState) + local CallBackFunc = function(TextureObj) + if UE.IsValid(TextureObj) then + if UITool.ImageObjUpdateTime[UIImageObj] == nil + or UITool.ImageObjUpdateTime[UIImageObj] < BeginLoadTime + then + UITool.ImageObjUpdateTime[UIImageObj] = BeginLoadTime + UIImageObj:SetBrushFromTexture(TextureObj); + end + end + end + + FileTool.AsyncLoadAsset(ResPath, CallBackFunc, nil, true) +end + +function UITool.ButtonOnClickShowPanel(TargetButton, UIType) + TargetButton.OnClicked:Add(function() + WidgetManager:ShowPanel(UIType, false) + end) +end + +-- 加载一个头像 +function UITool.LoadPlayerHeadPicture(InPlayerKey, InUrl) + if InUrl ~= nil and UITool.PlayerHeadPicture[InPlayerKey] == nil then + UITool.DownloadImage(InUrl, function(Texture) + if UE.IsValid(Texture) then + UITool.PlayerHeadPicture[InPlayerKey] = Texture + else + print(string.format("[UGCPlayerState:OnRep_AccountInfo] Download Texture Failure. URL: %s", Url)) + end + end) + end +end + +--- 添加一个 继承自 PanelWidget 的控件的子类 +---@param InBox UPanelWidget +---@param InClas UClass* +---@param InOwner UObject* +---@return UUserWidget* +function UITool.AddWidgetItem(InBox, InClas, InOwner) + if InOwner == nil then + InOwner = UGCGameSystem.GameState + end + local Item = UserWidget.NewWidgetObjectBP(InOwner, InClas); + InBox:AddChild(Item); + return Item; +end + +-- PanelWidget 中从后面逐个隐藏 Item 的操作 +function UITool.HideWidgetItem(InBox, InCount) + if InBox == nil then + return; + end + local Count = InBox:GetChildrenCount(); + if InCount == nil or InCount > Count then + InCount = Count; + end + -- 从后往前逐个隐藏 + for i = 1, InCount do + local Item = InBox:GetChildAt(Count - i); + Item:SetVisibility(ESlateVisibility.Collapsed); + end +end + +UITool.ClearSpectateButtonTimer = nil; + +-- 将观战页面退出按钮进行隐藏(否则点击到了直接退出就麻烦了) +function UITool.HideSpectate(InPC) + if not UE.IsValid(InPC) then + return; + end + + self.ClearSpectateButtonTimer = UGCEventSystem.SetTimerLoop(InPC, function() + InPC:CastUIMsg("UIMsg_HideQuitWatch", ""); + UGCEventSystem.SetTimer(self, function() + if UE.IsValid(self.ClearSpectateButtonTimer) then + UGCEventSystem.StopTimer(self.ClearSpectateButtonTimer); + end + end, 15) + end, 0.3) +end + +--- 在滚动视图中的按钮可以被 handle 的方法 +function UITool.EnableButtonScroll(InButton) + InButton:SetTouchMethod(EButtonTouchMethod.PreciseTap) +end + +function UITool.ButtonSetEnable(InButton, IsEnable) + InButton:SetIsEnabled(IsEnable); +end + +function UITool.GetChildrenCount(InBox) + return InBox:GetChildrenCount(); +end + +function UITool.GetChildAt(InBox, InIndex) + return InBox:GetChildAt(InIndex); +end \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Global/WidgetManager/A_IncludeWidgetManager.lua b/CounterAttack_Solo/Script/Global/WidgetManager/A_IncludeWidgetManager.lua new file mode 100644 index 00000000..6ffab0b6 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/WidgetManager/A_IncludeWidgetManager.lua @@ -0,0 +1,8 @@ +-- 需要包含的头目录 + +local Prefix = "Script.Global.WidgetManager." + +require(Prefix .. 'WidgetLibrary') +require(Prefix .. 'WidgetConfig') +require(Prefix .. 'WidgetManager') + diff --git a/CounterAttack_Solo/Script/Global/WidgetManager/WidgetConfig.lua b/CounterAttack_Solo/Script/Global/WidgetManager/WidgetConfig.lua new file mode 100644 index 00000000..ad709590 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/WidgetManager/WidgetConfig.lua @@ -0,0 +1,437 @@ +WidgetConfig = WidgetConfig or {} + +WidgetConfig.EUILayerGroup = { + Negative = -1, + Least = 0, + Bottom = 1, + Low = 2, + Low_Add1 = 3, + MainUI = 10003, + Medium = 10004, + High = 10005, + Top = 10006, + Notice = 10007, + Tip = 10008, +} + +WidgetConfig.EUIType = { + Default = 0, + WaitingTime = 1, -- 等待时间 + Ranking = 2, -- 排行榜单 + Settlement = 3, -- 结算界面 + InsufficientNumberOfPeople = 4, -- 人数不足 + InvincibleTime = 5, -- 无敌时间 + + DamageAnim = 6, -- 给予伤害后的动画 + -- KillInfo = 7, -- 击杀信息 + Guide = 8, -- 玩法说明 + + FightPanel = 9, -- 战斗界面 + + PlaceModeMainMenu = 10, -- 放置模式玩法主菜单 + PlaceMode = 11, -- 放置模式UI + ShowPlaceCode = 12, -- 显示放置代码 + ImportPlaceCode = 13, -- 导入放置代码 + RunMapTest = 14, -- 跑图测试 + RunMapFailure = 15, -- 跑图失败 + SaveMap = 16, -- 保存地图 + MapOperate = 17, -- 对以有的放置地图进行操作 + ReplaceSavedMap = 18, -- 选择替换的地图 + + + RoundFinish = 19, -- 回合结算 + + PreviewMap = 20, -- 预览地图 + Currency = 21, -- 货币栏 + + Countdown = 22, -- 通用倒计时 + Task = 23, -- 任务界面 + + WeaponSelect = 24, -- 武器配置选择 + ReselectWeaponBtn = 25, -- 重选武器界面 + TeamChangeTip = 26, -- 队伍变换提示 + + SelectBuff = 27, -- 增益选择框 + RoundReady = 28, -- 回合准备阶段 + CustomWeapon = 29, -- 自定义武器配置 + RoundStartTip = 30, -- 回合开始提示 + SelectBaseBuff = 31, -- 选择基础Buff + + SecondaryConfirmation = 100, -- 二次确认框 + SecondaryConfirmation_Strip = 101, -- 二次确认条 + SecondaryConfirmation_EditableText = 102, -- 二次确认命名文本 + + + -- BuffUI + TraceEnemy = 10001, -- 探测敌方玩家位置UI + + + + Debug = 1000, -- 测试UI +} + +WidgetConfig.DefaultShowWidget = { + WidgetConfig.EUIType.DamageAnim, + WidgetConfig.EUIType.SelectBuff, + WidgetConfig.EUIType.SelectBaseBuff + -- Test + -- WidgetConfig.EUIType.Debug, +} + +WidgetConfig.PlayModeUI = { + WidgetConfig.EUIType.Guide; + WidgetConfig.EUIType.InvincibleTime; + WidgetConfig.EUIType.DamageAnim; + WidgetConfig.EUIType.WaitingTime; + WidgetConfig.EUIType.Ranking; + WidgetConfig.EUIType.Settlement; + WidgetConfig.EUIType.InsufficientNumberOfPeople; + WidgetConfig.EUIType.DamageAnim; + WidgetConfig.EUIType.FightPanel; + WidgetConfig.EUIType.WeaponSelect; + WidgetConfig.EUIType.ReselectWeaponBtn; + WidgetConfig.EUIType.TeamChangeTip; + WidgetConfig.EUIType.SelectBuff; + WidgetConfig.EUIType.RoundFinish; + WidgetConfig.EUIType.RoundReady; + WidgetConfig.EUIType.CustomWeapon; + WidgetConfig.EUIType.RoundStartTip; + WidgetConfig.EUIType.SecondaryConfirmation; + WidgetConfig.EUIType.SelectBaseBuff; + + + -- Buff + WidgetConfig.EUIType.TraceEnemy; + + -- Test + WidgetConfig.EUIType.Debug; +} + + +WidgetConfig.SyncShowPlayModeWidget = { + WidgetConfig.EUIType.WaitingTime, + WidgetConfig.EUIType.FightPanel, + -- WidgetConfig.EUIType.RoundFinish, + WidgetConfig.EUIType.Settlement, + WidgetConfig.EUIType.InsufficientNumberOfPeople, +} + + +WidgetConfig.CustomWidget = { + WidgetConfig.EUIType.FightPanel, + WidgetConfig.EUIType.SelectBuff, +} + +WidgetConfig.Configs = { + [WidgetConfig.EUIType.Debug] = { + Widget = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/Debug/WB_Debug.WB_Debug_C'); + Layer = WidgetConfig.EUILayerGroup.High, + ShowOnce = false, + }, + + [WidgetConfig.EUIType.WaitingTime] = { + Widget = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/StatusUI/GamePreparation/W_WaitPlayJoin.W_WaitPlayJoin_C'), + Layer = WidgetConfig.EUILayerGroup.Top, + ShowOnce = false, + }, + + [WidgetConfig.EUIType.Ranking] = { + Widget = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/Rank/WB_TeamRank.WB_TeamRank_C'), + Layer = WidgetConfig.EUILayerGroup.Low_Add1, + ShowOnce = false, + }, + [WidgetConfig.EUIType.Settlement] = { + Widget = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/Settlement/WB_TeamSettlement.WB_TeamSettlement_C'), + Layer = WidgetConfig.EUILayerGroup.High, + ShowOnce = false, + }, + [WidgetConfig.EUIType.InsufficientNumberOfPeople] = { + Widget = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/StatusUI/WB_GameUnableToStart.WB_GameUnableToStart_C'), + Layer = WidgetConfig.EUILayerGroup.Top, + ShowOnce = false, + }, + + [WidgetConfig.EUIType.InvincibleTime] = { + Widget = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/W_InvincibleTime.W_InvincibleTime_C'), + Layer = WidgetConfig.EUILayerGroup.Low, + ShowOnce = false, + }, + [WidgetConfig.EUIType.DamageAnim] = { + Widget = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/W_DamageAnim.W_DamageAnim_C'), + Layer = WidgetConfig.EUILayerGroup.Low, + ShowOnce = false, + }, + + [WidgetConfig.EUIType.Guide] = { + Widget = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/Guide/WB_Guide.WB_Guide_C'), + Layer = WidgetConfig.EUILayerGroup.High, + ShowOnce = false, + }, + + [WidgetConfig.EUIType.FightPanel] = { + Widget = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/StatusUI/FightPanel/WB_FightPanel.WB_FightPanel_C'), + Layer = WidgetConfig.EUILayerGroup.Low, + ShowOnce = false, + }, + + + + [WidgetConfig.EUIType.RoundFinish] = { + Widget = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/StatusUI/Round/WB_RoundFinish.WB_RoundFinish_C'), + Layer = WidgetConfig.EUILayerGroup.High, + ShowOnce = false, + }, + [WidgetConfig.EUIType.PreviewMap] = { + Widget = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/StatusUI/PlaceGameMenu/WB_PreviewMap.WB_PreviewMap_C'), + Layer = WidgetConfig.EUILayerGroup.Low, + ShowOnce = false, + }, + + [WidgetConfig.EUIType.SecondaryConfirmation] = { + Widget = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/SecondaryConfirmation/WB_SecondaryConfirmation.WB_SecondaryConfirmation_C'), + Layer = WidgetConfig.EUILayerGroup.Notice, + ShowOnce = false, + }, + [WidgetConfig.EUIType.SecondaryConfirmation_Strip] = { + Widget = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/SecondaryConfirmation/WB_SecondaryConfirmation_Strip.WB_SecondaryConfirmation_Strip_C'), + Layer = WidgetConfig.EUILayerGroup.Notice, + ShowOnce = false, + }, + [WidgetConfig.EUIType.SecondaryConfirmation_EditableText] = { + Widget = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/SecondaryConfirmation/WB_SecondaryConfirmation_EditableText.WB_SecondaryConfirmation_EditableText_C'), + Layer = WidgetConfig.EUILayerGroup.Notice, + ShowOnce = false, + }, + [WidgetConfig.EUIType.ReselectWeaponBtn] = { + Widget = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/SelectWeapon/WB_ReselectWeaponBtn.WB_ReselectWeaponBtn_C'), + Layer = WidgetConfig.EUILayerGroup.MainUI, + ShowOnce = false, + }, + [WidgetConfig.EUIType.TeamChangeTip] = { + Widget = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/Tip/W_TeamTip.W_TeamTip_C'), + Layer = WidgetConfig.EUILayerGroup.Notice, + ShowOnce = false, + }, + + + [WidgetConfig.EUIType.Countdown] = { + Widget = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/WB_Countdown.WB_Countdown_C'), + Layer = WidgetConfig.EUILayerGroup.Notice, + ShowOnce = false, + }, + + + [WidgetConfig.EUIType.WeaponSelect] = { + Widget = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/SelectWeapon/WB_WeaponSelect.WB_WeaponSelect_C'), + Layer = WidgetConfig.EUILayerGroup.Medium, + ShowOnce = false, + }, + + [WidgetConfig.EUIType.SelectBuff] = { + Widget = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/SelectBuff/WB_SelectIncrease.WB_SelectIncrease_C'), + Layer = WidgetConfig.EUILayerGroup.MainUI, + ShowOnce = false, + }, + [WidgetConfig.EUIType.RoundReady] = { + Widget = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/StatusUI/Round/WB_RoundReadyState.WB_RoundReadyState_C'), + Layer = WidgetConfig.EUILayerGroup.Top, + ShowOnce = false, + }, + + [WidgetConfig.EUIType.CustomWeapon] = { + Widget = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/SelectWeapon/WB_CustomWeapon.WB_CustomWeapon_C'), + Layer = WidgetConfig.EUILayerGroup.High, + ShowOnce = false, + }, + + [WidgetConfig.EUIType.RoundStartTip] = { + Widget = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/StatusUI/Round/WB_RoundStartTip.WB_RoundStartTip_C'), + Layer = WidgetConfig.EUILayerGroup.Top, + ShowOnce = false, + }, + + [WidgetConfig.EUIType.TraceEnemy] = { + Widget = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/StatusUI/MarkPlayerUI/WB_InductionPlayer.WB_InductionPlayer_C'), + Layer = WidgetConfig.EUILayerGroup.MainUI, + ShowOnce = false, + }, + + [WidgetConfig.EUIType.SelectBaseBuff] = { + Widget = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/SelectBuff/WB_SelectBaseBuff.WB_SelectBaseBuff_C'), + Layer = WidgetConfig.EUILayerGroup.Medium, + ShowOnce = false, + }, + + +} + +function WidgetConfig.GetWidgetPathFromUIType(UIType) + if not WidgetConfig.CheckUIType(UIType) then return end + return WidgetConfig.Configs[UIType].Widget +end + +function WidgetConfig.GetWidgetLayer(UIType) + if not WidgetConfig.CheckUIType(UIType) then return end + return WidgetConfig.Configs[UIType].Layer +end + +function WidgetConfig.GetWidgetShowOnce(UIType) + if not WidgetConfig.CheckUIType(UIType) then return end + return WidgetConfig.Configs[UIType].ShowOnce +end + +function WidgetConfig.CheckUIType(UIType) + return (WidgetConfig.Configs[UIType] ~= nil) +end + +function WidgetConfig.GetAllWidgetTypeFromLayer(Layer) + local Res = {} + for UIType, _ in pairs(WidgetConfig.Configs) do + if WidgetConfig.GetWidgetLayer(UIType) == Layer then + Res[#Res + 1] = UIType + end + end + return Res +end + + +-- HideUI -------------------------------------------------------------------------------------------------------------------------------- + + +--- 默认UI的隐藏 +function WidgetConfig.HideDefaultUI() + --- 隐藏平底锅切换扔出模式 + --- ShootingUI.Customize_ThrowPlus:SetAdvancedCollapsed(true) + --- local MainControlPanel = UGCWidgetManagerSystem.GetMainControlUI() + -- local MainControlPanel = GameBusinessManager.GetWidgetFromName(ingame, "MainControlPanelTochButton_C") + local MainControlPanel = UGCWidgetManagerSystem.GetMainUI() + if MainControlPanel ~= nil then + local MainControlBaseUITemp = MainControlPanel.MainControlBaseUI; + MainControlBaseUITemp.Image_IngameLogo:SetVisibility(ESlateVisibility.Collapsed) --- 局内游戏Logo + MainControlBaseUITemp.Image_0:SetVisibility(ESlateVisibility.Collapsed) --- 指南针指针 + MainControlBaseUITemp.NavigatorPanel:SetVisibility(ESlateVisibility.Collapsed) --- 指南针界面 + -- MainControlBaseUITemp.SurviveInfoPanel:SetVisibility(ESlateVisibility.Collapsed) --- 存活人数 + -- MainControlBaseUITemp.CanvasPanel_HelmetArmor:SetVisibility(ESlateVisibility.Collapsed) --- 头盔、护甲按钮 + -- MainControlBaseUITemp.CanvasPanelSurviveKill:SetVisibility(ESlateVisibility.Collapsed) --- 剩余人数、淘汰数 + -- MainControlBaseUITemp.SignalReceivingAreaTIPS_UIBP:SetVisibility(ESlateVisibility.Collapsed) --- 信号区提示 + -- MainControlBaseUITemp.CircleChasingProgress:SetVisibility(ESlateVisibility.Collapsed) --- 刷圈进度 + -- MainControlBaseUITemp.IsNeedTeamPanel = false --- 不显示队友面板 + -- MainControlBaseUITemp.CanvasPanel_BackpackPanel:AddAdvancedCollapsedCount(1) --- 背包按钮 + + -- UGCWidgetManagerSystem.SubWidgetHiddenLayer(MainControlBaseUITemp.ChangeSight_UIBP.CanvasPanel_Sight)--- 倍镜切换 + + -- MainControlBaseUITemp.CanvasPanel_MiniMapAndSetting:SetAdvancedCollapsed(ESlateVisibility.Collapsed); --小地图 + local ShootingPanel = UGCWidgetManagerSystem.GetShootingUIPanel() + if ShootingPanel then + -- ShootingPanel.SwitchWeaponSlot_Mode2_C_0:SetVisibility(ESlateVisibility.Collapsed) --- 右武器栏 + -- ShootingPanel.CanvasPanel_Shin_Independence:AddAdvancedCollapsedCount(1) -- 独立攀爬跳跃模式按键 + else + UGCLogSystem.LogError("[WidgetConfig_HideDefaultUI] ShootingPanel is nil") + end + + --MainControlBaseUITemp.ShootingUIPanel.SwitchWeaponSlot_Mode2:SetVisibility(ESlateVisibility.Collapsed) --- 右武器栏 + --MultiLayer_RightWeaponSlot + + --折叠二号武器槽位 + --MainControlBaseUITemp.ShootingUIPanel.SwitchWeaponSlot_Mode2.Image_Selected:SetVisibility(ESlateVisibility.Collapsed) + --MainControlBaseUITemp.ShootingUIPanel.SwitchWeaponSlot_Mode2.GridPanel_FireMode:SetVisibility(ESlateVisibility.Collapsed) + --MainControlBaseUITemp.ShootingUIPanel.SwitchWeaponSlot_Mode2.MultiLayer_Pistol:SetVisibility(ESlateVisibility.Collapsed) + + --local ShootingUIPanel = MainControlPanel.ShootingUIPanel + --ShootingUIPanel:SetVisibility(ESlateVisibility.Collapsed) ---不显示战斗界面 + + -- MainControlPanel.SkillLayer:SetVisibility(ESlateVisibility.Collapsed); -- 技能1 + + end + -- UGCWidgetManagerSystem.LoadLobbyChatFrameUI() --- 加载大厅聊天框UI + + + + -- 关闭退出观战按键 + WidgetConfig.CloseBackToLobbyHandle = UGCEventSystem.SetTimerLoop(UGCGameSystem.GameState, function() + local LocalPC = UGCSystemLibrary.GetLocalPlayerController() + if UE.IsValid(LocalPC) then + -- LocalPC:CastUIMsg("UIMsg_HideQuitWatch", ""); + local WatchGameUI = GetUIObject(bp_battleresult, "WatchGame_UIBP_C"); + if WatchGameUI then + WatchGameUI.Button_BackToLobby:SetVisibility(ESlateVisibility.Collapsed); + WatchGameUI.GridPanel_1:SetVisibility(ESlateVisibility.Hidden); + if WidgetConfig.CloseBackToLobbyHandle then + UGCEventSystem.StopTimer(WidgetConfig.CloseBackToLobbyHandle) + WidgetConfig.CloseBackToLobbyHandle = nil + end + UGCLogSystem.Log("[WidgetConfig_HideDefaultUI] 1") + end + end + end, 1. + ) +end + + + +WidgetConfig.EDefaultUIMode = { + None = 1; + Menu = 2; + PlaceMode = 3; +} + +WidgetConfig.NowDefaultUIMode = WidgetConfig.EDefaultUIMode.None +WidgetConfig.bInitializedHideWidgetInfo = false + +function WidgetConfig.InitHideWidgetInfo() + if WidgetConfig.bInitializedHideWidgetInfo then return end + local MainControlPanel = GameBusinessManager.GetWidgetFromName(ingame, "MainControlPanelTochButton_C"); + local PlayerInfoPanel = GameBusinessManager.GetWidgetFromName(ingame, "PlayerInfoPanel_C") + WidgetConfig.HideWidgetInfo = { + [WidgetConfig.EDefaultUIMode.Menu] = { + --MainControlPanel.MainControlBaseUI, + --MainControlPanel.ShootingUIPanel + }, + [WidgetConfig.EDefaultUIMode.PlaceMode] = { + --MainControlPanel.MainControlBaseUI, + --MainControlPanel.ShootingUIPanel.CustomFireBtnR, + --MainControlPanel.ShootingUIPanel.CustomFireBtnL, + --MainControlPanel.ShootingUIPanel.SwitchWeaponSlot_Mode2, + --MainControlPanel.ShootingUIPanel.SwitchWeaponSlot_Mode2_C_0, + }, + } + WidgetConfig.bInitializedHideWidgetInfo = true +end + + + + +function WidgetConfig.SetDefaultUIMode(InDefaultUIMode) + UGCLogSystem.Log("[WidgetConfig_SetDefaultUIMode]") + if not table.hasValue(WidgetConfig.EDefaultUIMode, InDefaultUIMode) then + return + end + WidgetConfig.InitHideWidgetInfo() + if WidgetConfig.NowDefaultUIMode ~= InDefaultUIMode then + if WidgetConfig.NowDefaultUIMode ~= WidgetConfig.EDefaultUIMode.None then + + end + WidgetConfig.NowDefaultUIMode = InDefaultUIMode + if WidgetConfig.NowDefaultUIMode == WidgetConfig.EDefaultUIMode.None then + return + end + local HideWidgetList = WidgetConfig.HideWidgetInfo[WidgetConfig.NowDefaultUIMode] + for i, v in pairs(HideWidgetList) do + v:SetVisibility(ESlateVisibility.Collapsed); + end + end +end + +function WidgetConfig.RemoveDefaultUIMode(InDefaultUIMode) + if not table.hasValue(WidgetConfig.EDefaultUIMode, InDefaultUIMode) or WidgetConfig.NowDefaultUIMode ~= InDefaultUIMode then + return + end + WidgetConfig.InitHideWidgetInfo() + local HideWidgetList = WidgetConfig.HideWidgetInfo[InDefaultUIMode] + for i, v in pairs(HideWidgetList) do + v:SetVisibility(ESlateVisibility.SelfHitTestInvisible); + end + WidgetConfig.NowDefaultUIMode = WidgetConfig.EDefaultUIMode.None +end + +-- HideUI -------------------------------------------------------------------------------------------------------------------------------- diff --git a/CounterAttack_Solo/Script/Global/WidgetManager/WidgetLibrary.lua b/CounterAttack_Solo/Script/Global/WidgetManager/WidgetLibrary.lua new file mode 100644 index 00000000..f46f43bd --- /dev/null +++ b/CounterAttack_Solo/Script/Global/WidgetManager/WidgetLibrary.lua @@ -0,0 +1,52 @@ +WidgetLibrary = WidgetLibrary or {} + + +--- 设置 +---@param widget UUserWidget +---@param offset float +function WidgetLibrary.SetWidgetToRightBorder(widget, offset) + if not widget then return end + local slot = WidgetLayoutLibrary.SlotAsCanvasSlot(widget) + slot:SetAnchors({ Minimum = { X = 1, Y = 0 }, Maximum = { X = 1, Y = 0 } }) + slot:SetAlignment({ X = 1, Y = 0 }) + local offsets = slot:GetOffsets() + slot:SetOffsets({ Left = offset, Right = offsets.Right, Bottom = offsets.Bottom, Top = offsets.Top }) +end + +--- 为防止被清除做出的全局处理 +function WidgetLibrary.BindButtonClicked(TargetButton, Func, Obj) + TargetButton.OnClicked:Add(Func, Obj) +end + +--- 为防止被清除做出的全局处理 +function WidgetLibrary.BindButtonPressed(TargetButton, Func, Obj) + TargetButton.OnPressed:Add(Func, Obj) +end + +--- 为防止被清除做出的全局处理 +function WidgetLibrary.BindButtonReleased(TargetButton, Func, Obj) + TargetButton.OnReleased:Add(Func, Obj) +end + +--- 绑定UI文本 +function WidgetLibrary.TextBlockBindingPropertyText(TargetTextBlock, Func, Obj) + TargetTextBlock:BindingProperty("Text", Func, Obj) +end + +--- 直接绑定按键点击打开WidgetManager的页面 +function WidgetLibrary.ButtonOnClickShowPanel(TargetButton, UIType, IsClose) + TargetButton.OnClicked:Add( + function() + if IsClose then + WidgetManager:ClosePanel(UIType) + else + WidgetManager:ShowPanel(UIType, false) + end + end + ) +end + +function WidgetLibrary.SliderOnValueChanged(Slider, Func, Obj) + Slider.OnValueChanged:Add(Func, Obj) +end + diff --git a/CounterAttack_Solo/Script/Global/WidgetManager/WidgetManager.lua b/CounterAttack_Solo/Script/Global/WidgetManager/WidgetManager.lua new file mode 100644 index 00000000..e58bf643 --- /dev/null +++ b/CounterAttack_Solo/Script/Global/WidgetManager/WidgetManager.lua @@ -0,0 +1,218 @@ +WidgetManager = WidgetManager or { + AllPanel = {}, + Initialized = false +} + +function WidgetManager:Init(LoadList) + WidgetManager.Initialized = true + self:InitBaseUI() + if LoadList then + for _, UIType in pairs(LoadList) do + if UIType > WidgetConfig.EUIType.Default then + self:LoadUI(UIType) + end + end + else + for _, UIType in pairs(WidgetConfig.EUIType) do + if UIType > WidgetConfig.EUIType.Default then + self:LoadUI(UIType) + end + end + end +end + +function WidgetManager:UnInit() + for _, Panel in pairs(self.AllPanel) do + if UE.IsValid(Panel) then + Panel:RemoveFromParent() + end + end + self.AllPanel = nil +end + +function WidgetManager:ShowOrClosePanel(UIType, IsShow) + if UGCGameSystem.IsServer() then + return + end + if IsShow then + self:ShowPanel(UIType) + else + self:ClosePanel(UIType) + end +end + +function WidgetManager:InitBaseUI() + WidgetConfig.HideDefaultUI(true) +end + +---@param UIType int32 +---@return UUserWidget +function WidgetManager:LoadUI(UIType) + UGCLogSystem.Log("[WidgetManager_LoadUI] LoadUI:%s", tostring(UIType)) + if not WidgetConfig.CheckUIType(UIType) then + UGCLogSystem.LogError("[WidgetManager_LoadUI] UIType:%s Config is nil", tostring(UIType)) + return nil + end + if self.AllPanel[UIType] ~= nil and UE.IsValid(self.AllPanel[UIType]) then + return self.AllPanel[UIType] + end + local UIPath = WidgetConfig.GetWidgetPathFromUIType(UIType) + local UIClass = UE.LoadClass(UIPath) + local UILayer = WidgetConfig.GetWidgetLayer(UIType) + if UIClass == nil then + UGCLogSystem.LogError("[WidgetManager_LoadUI] UIClassName[%s] Load Failed!", UIPath) + return nil + end + if UILayer == nil then + UGCLogSystem.LogError("[WidgetManager_LoadUI] invalid UILayer, UIType=%d", UIType) + return nil + end + local LocalPlayerController = UGCSystemLibrary.GetLocalPlayerController() + if LocalPlayerController == nil or UE.IsValid(LocalPlayerController) == false then + UGCLogSystem.LogError("[WidgetManager_LoadUI] invalid local PlayerController") + return + end + local UIWidget = UserWidget.NewWidgetObjectBP(LocalPlayerController, UIClass) + UGCLogSystem.Log("[WidgetManager_LoadUI] NewFinish") + if UIWidget ~= nil then + UGCLogSystem.Log("[WidgetManager_LoadUI] Adding") + UIWidget:AddToViewport(UILayer) + UIWidget:SetVisibility(ESlateVisibility.Collapsed) + self.AllPanel[UIType] = UIWidget + + if table.hasValue(WidgetConfig.CustomWidget, UIType) then + UGCWidgetManagerSystem.AddChildToTochButton(UIWidget); + end + UGCLogSystem.Log("[WidgetManager_LoadUI] Succeed") + return UIWidget + end + return nil +end + +--- 显示 UI +---@param UIType int32 +---@param NeedClosePeerPanel bool 是否关闭其他相同类型的UI +---@param ... table +function WidgetManager:ShowPanel(UIType, NeedClosePeerPanel, ...) + if not WidgetConfig.CheckUIType(UIType) then + UGCLogSystem.LogError("[WidgetManager_ShowPanel] UIType:%s Config is nil", tostring(UIType)) + return nil + end + if NeedClosePeerPanel == nil then + NeedClosePeerPanel = true + end + local Panel = self:GetPanel(UIType) + if Panel ~= nil and UE.IsValid(Panel) then + if NeedClosePeerPanel then + self:ClosePeerPanel(UIType) + end + Panel:SetVisibility(ESlateVisibility.SelfHitTestInvisible) + if Panel["OnShowPanel"] ~= nil then + Panel:OnShowPanel(...) + end + else + UGCLogSystem.LogError("[WidgetManager_ShowPanel] Show UI Failed: %s", tostring(UIType)) + end +end + +---@param UIType int32 +---@param WorldPosition Vector3D @UI生成的三维世界坐标 +function WidgetManager:ShowUIWithWorldPosition(UIType, WorldPosition) + if WorldPosition == nil then + UGCLogSystem.LogError("[WidgetManager] WorldPosition is nil") + return + end + self:ShowPanel(UIType) +end + +--- 关闭同层级的所有UI +---@param InUIType int32 +function WidgetManager:ClosePeerPanel(InUIType) + local CurLayer = WidgetConfig.GetWidgetLayer(InUIType) + local AllLayerWidget = WidgetConfig.GetAllWidgetTypeFromLayer(CurLayer) + for i, UIType in pairs(AllLayerWidget) do + if UIType ~= InUIType then + self:ClosePanel(UIType) + end + end +end + + +function WidgetManager:ClosePanel(UIType) + UGCLogSystem.Log("[WidgetManager_ClosePanel] UIType:%s", tostring(UIType)) + if not self:PanelIsValid(UIType) then + return + end + local Panel = self.AllPanel[UIType] + if Panel:GetVisibility() ~= ESlateVisibility.Collapsed then + Panel:SetVisibility(ESlateVisibility.Collapsed) + if Panel["OnClosePanel"] ~= nil then + Panel:OnClosePanel() + end + if WidgetConfig.GetWidgetShowOnce(UIType) then + self:DestroyPanel(UIType); + end + end +end + +function WidgetManager:CloseAllPanel() + for UIType, _ in pairs(self.AllPanel) do + self:ClosePanel(UIType) + end +end + +function WidgetManager:DestroyPanel(UIType) + if not self:PanelIsValid(UIType) then + return + end + local Panel = self.AllPanel[UIType] + Panel:RemoveFromParent() + self.AllPanel[UIType] = nil +end + +--- 销毁所有 UI +function WidgetManager:DestroyAllPanel() + for UIType, _ in pairs(self.AllPanel) do + self:DestroyPanel(UIType) + end +end + +---@return bool 是否存在UI _ +function WidgetManager:PanelIsValid(UIType) + local Panel = self.AllPanel[UIType] + return Panel ~= nil and UE.IsValid(Panel) +end + +--- 获取UI +function WidgetManager:GetPanel(UIType) + local Panel = self.AllPanel[UIType] + if Panel ~= nil and UE.IsValid(Panel) then + return Panel + else + return self:LoadUI(UIType) + end +end + +function WidgetManager:IsVisiblePanel(UIType) + if self:PanelIsValid(UIType) then + local Panel = self.AllPanel[UIType] + return Panel:IsVisible() + end + return false +end + +function WidgetManager:VisiblePanel(UIType) + if self:PanelIsValid(UIType) then + local Panel = self.AllPanel[UIType] + Panel:SetVisibility(ESlateVisibility.SelfHitTestInvisible) + end +end + +function WidgetManager:HidePanel(UIType) + if self:PanelIsValid(UIType) then + local Panel = self.AllPanel[UIType] + Panel:SetVisibility(ESlateVisibility.Collapsed) + end +end + +return WidgetManager \ No newline at end of file diff --git a/CounterAttack_Solo/Script/Temp/BP_HDTest.lua b/CounterAttack_Solo/Script/Temp/BP_HDTest.lua new file mode 100644 index 00000000..7188978b --- /dev/null +++ b/CounterAttack_Solo/Script/Temp/BP_HDTest.lua @@ -0,0 +1,37 @@ +---@class BP_HDTest_C:AActor +---@field Cube UStaticMeshComponent +---@field DefaultSceneRoot USceneComponent +--Edit Below-- +local BP_HDTest = {} + +--[[ +function BP_HDTest:ReceiveBeginPlay() + BP_HDTest.SuperClass.ReceiveBeginPlay(self) +end +--]] + +--[[ +function BP_HDTest:ReceiveTick(DeltaTime) + BP_HDTest.SuperClass.ReceiveTick(self, DeltaTime) +end +--]] + +--[[ +function BP_HDTest:ReceiveEndPlay() + BP_HDTest.SuperClass.ReceiveEndPlay(self) +end +--]] + +--[[ +function BP_HDTest:GetReplicatedProperties() + return +end +--]] + +--[[ +function BP_HDTest:GetAvailableServerRPCs() + return +end +--]] + +return BP_HDTest \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UGCLayout_BP.lua b/CounterAttack_Solo/Script/UGCLayout_BP.lua new file mode 100644 index 00000000..2cfd6fef --- /dev/null +++ b/CounterAttack_Solo/Script/UGCLayout_BP.lua @@ -0,0 +1,46 @@ +---@class UGCLayout_BP_C:UAEUserWidget +---@field CanvasPanel_EnemyAlive UCanvasPanel +---@field CanvasPanel_SelectMenu UCanvasPanel +---@field CanvasPanel_SelfAlive UCanvasPanel +---@field HorizontalBox_Buffs UHorizontalBox +---@field HorizontalBox_EnemyTeamPlayers UHorizontalBox +---@field HorizontalBox_SelfTeamPlayers UHorizontalBox +---@field Image_12 UImage +---@field Image_CD UImage +---@field TextBlock_AddCount UTextBlock +---@field TextBlock_EnemyAlive UTextBlock +---@field TextBlock_HP UTextBlock +---@field TextBlock_LeftPlayerCount UTextBlock +---@field TextBlock_LeftTeamScore UTextBlock +---@field TextBlock_MaxHP UTextBlock +---@field TextBlock_RightPlayerCount UTextBlock +---@field TextBlock_RightTeamScore UTextBlock +---@field TextBlock_Round UTextBlock +---@field TextBlock_SelfTeamAlive UTextBlock +---@field UniformGridPanel_Buff UUniformGridPanel +---@field VerticalBox_OtherBuff UVerticalBox +---@field WidgetSwitcher_AliveState UWidgetSwitcher +---@field WidgetSwitcher_AutoSelect UWidgetSwitcher +---@field WidgetSwitcher_ChangeAutoSelect UWidgetSwitcher +---@field WidgetSwitcher_DetailedInformation UWidgetSwitcher +---@field WidgetSwitcher_DetailedInformationText UWidgetSwitcher +---@field WidgetSwitcher_EnemyTextTip UWidgetSwitcher +---@field WidgetSwitcher_SelfTextTip UWidgetSwitcher +--Edit Below-- +local UGCLayout_BP = { bInitDoOnce = false; }; + +--[==[ Construct +function UGCLayout_BP:Construct() + +end +-- Construct ]==] + +-- function UGCLayout_BP:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function UGCLayout_BP:Destruct() + +-- end + +return UGCLayout_BP; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/Broadcast/WB_Broadcast.lua b/CounterAttack_Solo/Script/UI/Broadcast/WB_Broadcast.lua new file mode 100644 index 00000000..2fa1b7f5 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/Broadcast/WB_Broadcast.lua @@ -0,0 +1,24 @@ +---@class WB_Broadcast_C:UUserWidget +---@field ScrollBox_Broadcast UScrollBox +--Edit Below-- +---@type WB_Broadcast_C +local WB_Broadcast = { bInitDoOnce = false; }; + +function WB_Broadcast:Construct() + self.SuperClass.Construct(self); + UGCEventSystem.AddListener(EventEnum.PlayerDeathInfo, self.AddItem, self); +end + + + +-- 添加 Item +function WB_Broadcast:AddItem(VictimKey, CauserKey, WeaponID, DamageType, IsHeadShotDamage, Distance, DamageValue) + local Item = UserWidget.NewWidgetObjectBP(UGCSystemLibrary.GetLocalPlayerController(), ObjectPathTable.WB_BroadcastItem_Class); + self.ScrollBox_Broadcast:AddChild(Item); + Item:InitBroadcast(VictimKey, CauserKey, WeaponID, DamageType, IsHeadShotDamage, Distance, DamageValue); +end + +function WB_Broadcast:Destruct() +end + +return WB_Broadcast; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/Broadcast/WB_BroadcastItem.lua b/CounterAttack_Solo/Script/UI/Broadcast/WB_BroadcastItem.lua new file mode 100644 index 00000000..c13fed72 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/Broadcast/WB_BroadcastItem.lua @@ -0,0 +1,112 @@ +---@class WB_BroadcastItem_C:UUserWidget +---@field Show UWidgetAnimation +---@field Image_Frame UImage +---@field Image_WeaponIcon_BroadcastData2 UImage +---@field TextBlock_BroadcastData2_1 UTextBlock +---@field TextBlock_BroadcastData2_2 UTextBlock +---@field WidgetSwitcher_IsSelf UWidgetSwitcher +---@field WidgetSwitcher_Weapon UWidgetSwitcher +---@field Tex_BGWrite UTexture2D +--Edit Below-- +---@type WB_BroadcastItem_C +local WB_BroadcastItem = { bInitDoOnce = false; }; + +WB_BroadcastItem.AnimationTime = 0.6; +WB_BroadcastItem.Constructed = false; +WB_BroadcastItem.ConstructCanInit = false; +WB_BroadcastItem.AnimPlaybackSpeed = 1.5; +WB_BroadcastItem.BroadcastTime = 3.5; + +function WB_BroadcastItem:Construct() + WB_BroadcastItem.SuperClass.Construct(self); +end + +function WB_BroadcastItem:ShowBroadcast() + self:PlayAnimation(self.Show, 0, 1, EUMGSequencePlayMode.Forward, self.AnimPlaybackSpeed); + -- 播放关闭动画 + UGCEventSystem.SetTimer(self, function() + self:PlayAnimation(self.Show, 0, 1, EUMGSequencePlayMode.Reverse, self.AnimPlaybackSpeed); + end, self.BroadcastTime - self.AnimationTime / self.AnimPlaybackSpeed); + -- 延迟销毁 + UGCEventSystem.SetTimer(self, function() + self:RemoveFromParent(); + end, self.BroadcastTime); +end + +-- 初始化 +function WB_BroadcastItem:InitBroadcast(VictimKey, CauserKey, WeaponID, DamageType, IsHeadShotDamage, Distance, DamageValue) + self:ShowBroadcast(); + + UGCLogSystem.Log("[WB_BroadcastItem_InitBroadcast] DamageType:%s", tostring(DamageType)) + -- UGCLogSystem.LogTree("[WB_BroadcastItem_InitBroadcast] EDamageType:", EDamageType) + + local KillerTeam = UGCGameSystem.GameState:GetPlayerTeamIDByPlayerKey(CauserKey) + local DeadTeam = UGCGameSystem.GameState:GetPlayerTeamIDByPlayerKey(VictimKey) + local KillerTeamColor = TeamConfig.TeamColor[KillerTeam] + local DeadTeamColor = TeamConfig.TeamColor[DeadTeam] + local KillerName = UGCGameSystem.GameState:GetPlayerNameByPlayerKey(CauserKey); + local DeadName = UGCGameSystem.GameState:GetPlayerNameByPlayerKey(VictimKey); + + if KillerTeamColor then + self.TextBlock_BroadcastData2_1:SetColorAndOpacity({SpecifiedColor = KillerTeamColor, ColorUseRule = 0}) + end + if DeadTeamColor then + self.TextBlock_BroadcastData2_2:SetColorAndOpacity({SpecifiedColor = DeadTeamColor, ColorUseRule = 0}) + end + + self.TextBlock_BroadcastData2_1:SetText(KillerName); + self.TextBlock_BroadcastData2_2:SetText(DeadName); + + if WeaponID > 0 then + self.WidgetSwitcher_Weapon:SetActiveWidgetIndex(0); + local WeaponIcon; + local IsBigIcon = ItemTable.AllItem[WeaponID].BigPic ~= nil; + + if IsBigIcon then + WeaponIcon = UGCSystemLibrary.LoadAsset(ItemTable.AllItem[WeaponID].BigPic, true); + else + WeaponIcon = UGCSystemLibrary.LoadAsset(ItemTable.AllItem[WeaponID].SmallPic, true); + end + + if UE.IsValid(WeaponIcon) then + --- 使用材质 设置武器剪影 + local Material = self.Image_WeaponIcon_BroadcastData2:GetDynamicMaterial(); + if Material ~= nil then + Material:SetTextureParameterValue("MaskTexture", WeaponIcon); + Material:SetTextureParameterValue("Texture", self.Tex_BGWrite); + Material:SetScalarParameterValue("Alpha", 1.0); + Material:SetScalarParameterValue("Rotator", 0.0); + end + + -- Small尺寸Icon单独判断 + if not IsBigIcon then + self.Image_WeaponIcon_BroadcastData2:SetRenderScale({ X = -0.5, Y = 1 }); + end + else + UGCLogSystem.LogError("[W_Broadcast_Item:InitBroadcast] WeaponIcon is nil"); + end + elseif KillerName == "" then + self.WidgetSwitcher_Weapon:SetActiveWidgetIndex(2); + -- elseif DamageType >= MechanismConfig.TriggerMechanismType.MechanismWeapon then + elseif DamageType == EDamageType.UGCPointDamage then + self.WidgetSwitcher_Weapon:SetActiveWidgetIndex(3); + else + self.WidgetSwitcher_Weapon:SetActiveWidgetIndex(1); + end + + --- 为自己所杀 + if CauserKey == UGCSystemLibrary.GetLocalPlayerKey() then + -- self.Image_Frame:SetVisibility(ESlateVisibility.Visible); + self.WidgetSwitcher_IsSelf:SetActiveWidgetIndex(1) + -- 判断近战击杀 + if UGCSystemLibrary.GetItemTypeID(WeaponID) == 108 then + SoundSystem.PlaySound(SoundSystem.ESound.Kill2); + elseif DamageType == EDamageType.UGCPointDamage then + SoundSystem.PlaySound(SoundSystem.ESound.MechanismKill); + else + SoundSystem.PlaySound(SoundSystem.ESound.Kill3); + end + end +end + +return WB_BroadcastItem; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/Debug/WB_Debug.lua b/CounterAttack_Solo/Script/UI/Debug/WB_Debug.lua new file mode 100644 index 00000000..b6bbcef1 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/Debug/WB_Debug.lua @@ -0,0 +1,73 @@ +---@class WB_Debug_C:UUserWidget +---@field Button_Close UButton +---@field Button_Debug1 UButton +---@field Button_Debug2 UButton +---@field Button_Debug3 UButton +---@field Button_Debug4 UButton +---@field Button_Debug5 UButton +---@field Button_Debug6 UButton +--Edit Below-- +local WB_Debug = { bInitDoOnce = false; }; + + +function WB_Debug:Construct() + WidgetLibrary.BindButtonClicked(self.Button_Debug1, self.Debug1, self) + WidgetLibrary.BindButtonClicked(self.Button_Debug2, self.Debug2, self) + WidgetLibrary.BindButtonClicked(self.Button_Debug3, self.Debug3, self) + WidgetLibrary.BindButtonClicked(self.Button_Debug4, self.Debug4, self) + WidgetLibrary.BindButtonClicked(self.Button_Debug5, self.Debug5, self) + WidgetLibrary.BindButtonClicked(self.Button_Debug6, self.Debug6, self) + WidgetLibrary.BindButtonClicked(self.Button_Close, self.Close, self) +end + +function WB_Debug:Debug1() + UGCSendRPCSystem.ActorRPCNotify(nil, UGCGameSystem.GameState, "PlayerUseSkill", SkillConfig.ESkillType.MultiJump, UGCSystemLibrary.GetLocalPlayerKey()) +end + +function WB_Debug:Debug2() + UGCSendRPCSystem.ActorRPCNotify(nil, UGCGameSystem.GameState, "DebugLogic", UGCSystemLibrary.GetLocalPlayerKey()) +end + +function WB_Debug:Debug3() + SoundSystem.PlaySound(SoundSystem.ESound.Click) + UGCSendRPCSystem.ActorRPCNotify(UGCSystemLibrary.GetLocalPlayerKey(), UGCGameSystem.GameState, "Debug_AddGoldBrick", UGCSystemLibrary.GetLocalPlayerKey()) +end + +function WB_Debug:Debug4() + SoundSystem.PlaySound(SoundSystem.ESound.Click) + UGCSendRPCSystem.ActorRPCNotify(UGCSystemLibrary.GetLocalPlayerKey(), UGCGameSystem.GameState, "Debug_ClearArchiveData", UGCSystemLibrary.GetLocalPlayerKey()) +end + +function WB_Debug:Debug5() + SoundSystem.PlaySound(SoundSystem.ESound.Click) + UGCSendRPCSystem.ActorRPCNotify(UGCSystemLibrary.GetLocalPlayerKey(), UGCGameSystem.GameState, "Debug_ClearArchiveDataFromType", UGCSystemLibrary.GetLocalPlayerKey(), ArchiveDataConfig.EArchiveType.Exp) +end + +function WB_Debug:Debug6() + SoundSystem.PlaySound(SoundSystem.ESound.Click) + UGCSendRPCSystem.ActorRPCNotify(UGCSystemLibrary.GetLocalPlayerKey(), UGCGameSystem.GameState, "Debug_ClearArchiveDataFromType", UGCSystemLibrary.GetLocalPlayerKey(), ArchiveDataConfig.EArchiveType.DailyTasks) +end + + + + + + + + + + + +function WB_Debug:Close() + WidgetManager:ClosePanel(WidgetConfig.EUIType.Debug) +end + +-- function WB_Debug:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_Debug:Destruct() + +-- end + +return WB_Debug; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/Guide/BuffDesc/WB_BuffDesc.lua b/CounterAttack_Solo/Script/UI/Guide/BuffDesc/WB_BuffDesc.lua new file mode 100644 index 00000000..3662b26b --- /dev/null +++ b/CounterAttack_Solo/Script/UI/Guide/BuffDesc/WB_BuffDesc.lua @@ -0,0 +1,33 @@ +---@class WB_BuffDesc_C:UUserWidget +---@field ScrollBox_Box UScrollBox +--Edit Below-- +local WB_BuffDesc = { bInitDoOnce = false; }; + +function WB_BuffDesc:GetItemClass() + if self.ItemClass == nil then + self.ItemClass = UE.LoadClass(UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/Guide/BuffDesc/WB_BuffDescItem.WB_BuffDescItem_C')); + end + return self.ItemClass; +end + +function WB_BuffDesc:Construct() + --local Item = UserWidget.NewWidgetObjectBP(UGCSystemLibrary.GetLocalPlayerController(), self:GetItemClass()); + --self.ScrollBox_Box:AddChild(Item) + --Item:Init(true) + for i, IncreaseType in pairs(GodOfWarConfig.EIncreaseType) do + local Item = UserWidget.NewWidgetObjectBP(UGCSystemLibrary.GetLocalPlayerController(), self:GetItemClass()); + self.ScrollBox_Box:AddChild(Item) + Item:Init(false, IncreaseType) + end +end + + +-- function WB_BuffDesc:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_BuffDesc:Destruct() + +-- end + +return WB_BuffDesc; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/Guide/BuffDesc/WB_BuffDescItem.lua b/CounterAttack_Solo/Script/UI/Guide/BuffDesc/WB_BuffDescItem.lua new file mode 100644 index 00000000..3518bb8b --- /dev/null +++ b/CounterAttack_Solo/Script/UI/Guide/BuffDesc/WB_BuffDescItem.lua @@ -0,0 +1,26 @@ +---@class WB_BuffDescItem_C:UUserWidget +---@field Image_God UImage +---@field Image_Icon UImage +---@field TextBlock_Desc UTextBlock +---@field WidgetSwitcher_IsGod UWidgetSwitcher +--Edit Below-- +local WB_BuffDescItem = { bInitDoOnce = false; }; + +function WB_BuffDescItem:Init(IsGod, InIncreaseType) + if IsGod then + self.WidgetSwitcher_IsGod:SetActiveWidgetIndex(1) + self.TextBlock_Desc:SetText(GodOfWarConfig.GodOfWarDesc) + else + self.WidgetSwitcher_IsGod:SetActiveWidgetIndex(0) + -- 设置图案 + UGCSystemLibrary.AsyncLoadAsset(GodOfWarConfig.IncreaseIcon[InIncreaseType], function(Tex) + if UE.IsValid(Tex) then + self.Image_Icon:SetBrushFromTexture(Tex, false) + end + end, nil, true) + + self.TextBlock_Desc:SetText(GodOfWarConfig.IncreaseDesc[InIncreaseType]) + end +end + +return WB_BuffDescItem; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/Guide/WB_Guide.lua b/CounterAttack_Solo/Script/UI/Guide/WB_Guide.lua new file mode 100644 index 00000000..d16cf2d0 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/Guide/WB_Guide.lua @@ -0,0 +1,64 @@ +---@class WB_Guide_C:UUserWidget +---@field Button_close UButton +---@field Button_left UButton +---@field Button_right UButton +---@field CanvasPanel_IPX UCanvasPanel +---@field CheckBox_select UCheckBox +---@field HorizontalBox_Paging UHorizontalBox +---@field TextBlock_GameName UTextBlock +---@field WB_BuffDesc UWB_BuffDesc_C +---@field WidgetSwitcher_page UWidgetSwitcher +--Edit Below-- +---@type WB_Guide_C +local WB_Guide = { + bInitDoOnce = false; + SelectColor = {R = 1., G = 0.51, B = 0.14, A = 1.}; + NotSelectColor = {R = 1., G = 1., B = 1., A = 1.}; + MechanismInfoWidgetPath = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/Guide/WB_MechanismInfo.WB_MechanismInfo_C'); +}; +function WB_Guide:Construct() + self.TextBlock_GameName:SetText(GlobalConfigs.GameName .. "玩法说明") + WidgetLibrary.BindButtonClicked(self.Button_close, self.CloseGuide, self) + WidgetLibrary.BindButtonClicked(self.Button_left, self.LastGuide, self) + WidgetLibrary.BindButtonClicked(self.Button_right, self.NextGuide, self) +end + +function WB_Guide:GetNowIndex() + return self.WidgetSwitcher_page:GetActiveWidgetIndex() +end + +function WB_Guide:UpdateIndex(NewIndex) + if NewIndex >= self.WidgetSwitcher_page:GetChildrenCount() then + NewIndex = 0 + elseif NewIndex < 0 then + NewIndex = self.WidgetSwitcher_page:GetChildrenCount() - 1 + end + self.WidgetSwitcher_page:SetActiveWidgetIndex(NewIndex) + for i = 1, self.WidgetSwitcher_page:GetChildrenCount(), 1 do + local TempImage = self.HorizontalBox_Paging:GetChildAt(i - 1) + if TempImage ~= nil then + if (i - 1) == NewIndex then + TempImage:SetColorAndOpacity(self.SelectColor) + else + TempImage:SetColorAndOpacity(self.NotSelectColor) + end + end + end + +end +function WB_Guide:NextGuide() + self:UpdateIndex(self:GetNowIndex() + 1) + SoundSystem.PlaySound(SoundSystem.ESound.Btn) +end +function WB_Guide:LastGuide() + self:UpdateIndex(self:GetNowIndex() - 1) + SoundSystem.PlaySound(SoundSystem.ESound.Btn) +end +function WB_Guide:CloseGuide() + WidgetManager:ClosePanel(WidgetConfig.EUIType.Guide) +end +-- function WB_Guide:Tick(MyGeometry, InDeltaTime) +-- end +-- function WB_Guide:Destruct() +-- end +return WB_Guide; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/KillInfo/WB_KillInfo.lua b/CounterAttack_Solo/Script/UI/KillInfo/WB_KillInfo.lua new file mode 100644 index 00000000..58ee9dcb --- /dev/null +++ b/CounterAttack_Solo/Script/UI/KillInfo/WB_KillInfo.lua @@ -0,0 +1,117 @@ +---@class WB_KillInfo_C:UUserWidget +---@field ShowKill UWidgetAnimation +---@field Image_Fist UImage +---@field Image_Frag UImage +---@field Image_Head UImage +---@field Image_Knife UImage +---@field Image_Mechanism UImage +---@field Image_SweepAwayThoroughly UImage +---@field Image_Weapon UImage +---@field TextBlock_AddGrade UTextBlock +---@field TextBlock_Desc UTextBlock +---@field TextBlock_Weapon UTextBlock +---@field WidgetSwitcher_Icon UWidgetSwitcher +---@field Tex_BGWrite UTexture2D +--Edit Below-- +---@type WB_KillInfo_C +local WB_KillInfo = { + bInitDoOnce = false; + + -- 扫光信息 + BeginSweepValue = 1.4; + FinishSweepValue = -1.; + SweepSpeed = 1.5; + SweepTime = 0.; +}; + + +function WB_KillInfo:Construct() + -- self:LuaInit(); + UGCEventSystem.AddListener(EventEnum.PlayerDeathInfo, self.AddKillInfo, self) +end + + + +function WB_KillInfo:AddKillInfo(VictimKey, CauserKey, WeaponID, DamageType, IsHeadShotDamage, Distance, DamageValue) + local LocalPlayerKey = UGCSystemLibrary.GetLocalPlayerKey() + if CauserKey ~= LocalPlayerKey or VictimKey == LocalPlayerKey then + return + end + + local WeaponName = (ItemTable.AllItem[WeaponID] and ItemTable.AllItem[WeaponID].Name or "") + local Desc = "弹药伤害" + local DescColor = {SpecifiedColor = {R = 1.000000, G = 1.000000, B = 1.000000, A = 1.000000}, ColorUseRule = 0} + self.WidgetSwitcher_Icon:SetActiveWidgetIndex(0) + if IsHeadShotDamage then + Desc = "精准打击" + DescColor = {SpecifiedColor = {R = 1.000000, G = 0.046875, B = 0.046875, A = 1.000000}, ColorUseRule = 0} + self.WidgetSwitcher_Icon:SetActiveWidgetIndex(4) + elseif UGCSystemLibrary.GetItemTypeID(WeaponID) == 108 then + Desc = "近战打击" + DescColor = {SpecifiedColor={R = 1.000000, G = 0.609327, B = 0.000000, A = 1.000000}, ColorUseRule = 0} + self.WidgetSwitcher_Icon:SetActiveWidgetIndex(5) + elseif UGCSystemLibrary.GetItemTypeID(WeaponID) == 602 then + Desc = "精准预判" + DescColor = {SpecifiedColor = {R = 0.056156, G = 0.334334, B = 1.000000, A = 1.000000}, ColorUseRule = 0} + self.WidgetSwitcher_Icon:SetActiveWidgetIndex(3) + elseif WeaponID < 0 and DamageType == EDamageType.UGCPointDamage then + Desc = "操控专家" + DescColor = {SpecifiedColor = {R = 0.233076, G = 0.000000, B = 1.000000, A = 1.000000}, ColorUseRule = 0} + WeaponName = "机关" + self.WidgetSwitcher_Icon:SetActiveWidgetIndex(1) + elseif WeaponID < 0 then + Desc = "无所畏惧" + DescColor = {SpecifiedColor={R = 1.000000, G = 0.609327, B = 0.000000, A = 1.000000}, ColorUseRule = 0} + WeaponName = "拳击" + self.WidgetSwitcher_Icon:SetActiveWidgetIndex(2) + end + + self.TextBlock_Weapon:SetText(WeaponName) + self.TextBlock_Desc:SetText(Desc) + self.TextBlock_Desc:SetColorAndOpacity(DescColor) + self.TextBlock_AddGrade:SetText(string.format("+%d", GlobalConfigs.GetAddScore(WeaponID))) + + + self.SweepTime = 0. + self:PlayAnimation(self.ShowKill, 0, 1, EUMGSequencePlayMode.Forward, 1); + if self.TickHandle == nil then + self.TickDeltaTime = UGCSystemLibrary.GetGameTime() + self.TickHandle = UGCEventSystem.SetTimerLoop(self, self.CustomTick, 0.02) + end + + --- 为自己所杀 + if CauserKey == UGCSystemLibrary.GetLocalPlayerKey() then + -- 判断近战击杀 + if UGCSystemLibrary.GetItemTypeID(WeaponID) == 108 then + SoundSystem.PlaySound(SoundSystem.ESound.Kill2); + elseif DamageType == EDamageType.UGCPointDamage then + SoundSystem.PlaySound(SoundSystem.ESound.MechanismKill); + else + SoundSystem.PlaySound(SoundSystem.ESound.Kill3); + end + end +end + +function WB_KillInfo:CustomTick() + --UGCLogSystem.Log("[WB_KillInfo_CustomTick]") + local DeltaTime = UGCSystemLibrary.GetGameTime() - self.TickDeltaTime + self.TickDeltaTime = UGCSystemLibrary.GetGameTime() + -- UGCLogSystem.Log("[WB_KillInfo_Tick]") + if self.SweepTime < 1 then + local Material = self.Image_SweepAwayThoroughly:GetDynamicMaterial() + ---@field SetVectorParameterValue:fun(ParameterName:FName,Value:FLinearColor) + Material:SetVectorParameterValue("Tilling", {R = 1, G = 1, B = 1, A = KismetMathLibrary.Lerp(self.BeginSweepValue, self.FinishSweepValue, self.SweepTime)}) + self.SweepTime = self.SweepTime + DeltaTime * self.SweepSpeed + --UGCLogSystem.Log("[WB_KillInfo_CustomTick] TickDeltaTime:%s", tostring(self.TickDeltaTime)) + else + UGCEventSystem.StopTimer(self.TickHandle) + self.TickHandle = nil + --UGCLogSystem.Log("[WB_KillInfo_CustomTick] Finish TickDeltaTime:%s", tostring(self.TickDeltaTime)) + end +end + +-- function WB_KillInfo:Destruct() + +-- end + +return WB_KillInfo; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/PlayerHead/WB_PlayerHead.lua b/CounterAttack_Solo/Script/UI/PlayerHead/WB_PlayerHead.lua new file mode 100644 index 00000000..9c26672c --- /dev/null +++ b/CounterAttack_Solo/Script/UI/PlayerHead/WB_PlayerHead.lua @@ -0,0 +1,31 @@ +---@class WB_PlayerHead_C:UUserWidget +---@field Common_Avatar_BP_C_0 UCommon_Avatar_BP_C +---@field Image_1 UImage +--Edit Below-- +local WB_PlayerHead = { bInitDoOnce = false } + +--[==[ Construct +function WB_PlayerHead:Construct() + +end +-- Construct ]==] + +-- function WB_PlayerHead:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_PlayerHead:Destruct() + +-- end + +function WB_PlayerHead:UpdatePlayerInfo(PlayerKey) + if self.PlayerKey ~= PlayerKey then + self.PlayerKey = PlayerKey + local PlayerInfo = UGCGameSystem.GameState:GetPlayerHeadInfo(PlayerKey) + ---@param PlayerInfo table {UID:string, IconURL:string, Gender:int, AvatarBoxId:int, PlayerLevel:int, PlayerName:string} 其中AvatarBoxId可以从PlayerState中获取 + ---@field InitView:fun(style:int32,uid:FString,iconURL:FString,gender:int32,frameLevel:int32,playerLevel:int32,ignoreFrame:bool,IsMySelf:bool) + self.Common_Avatar_BP_C_0:InitView(2, PlayerInfo.UIDString, PlayerInfo.IconURL, PlayerInfo.Gender, PlayerInfo.AvatarBoxId, PlayerInfo.PlayerLevel, false, false) + end +end + +return WB_PlayerHead \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/PlayerHead/WB_PlayerHead_48.lua b/CounterAttack_Solo/Script/UI/PlayerHead/WB_PlayerHead_48.lua new file mode 100644 index 00000000..08d3d92d --- /dev/null +++ b/CounterAttack_Solo/Script/UI/PlayerHead/WB_PlayerHead_48.lua @@ -0,0 +1,133 @@ +---@class WB_PlayerHead_48_C:UUserWidget +---@field Border_HeadMain UBorder +---@field Common_Avatar_BP_C_0 UCommon_Avatar_BP_C +---@field Overlay_IsDead UOverlay +---@field Overlay_KnockedDown UOverlay +---@field ProgressBar_Health UProgressBar +---@field WidgetSwitcher_Frame UWidgetSwitcher +--Edit Below-- +local WB_PlayerHead_48 = { + bInitDoOnce = false; + IsShowHealth = false; + UpdateFPS = 3.; + IsShowFrame = true; + PlayerKey = -1; +} + +--[==[ Construct +function WB_PlayerHead:Construct() + +end +-- Construct ]==] + +-- function WB_PlayerHead:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_PlayerHead:Destruct() + +-- end + +function WB_PlayerHead_48:LuaInit() + if self.bInitDoOnce then return end self.bInitDoOnce = true + UGCEventSystem.SetTimerLoop(self, self.UpdatePlayerStateInfo, 1. / self.UpdateFPS) +end + +function WB_PlayerHead_48:SetShowFrame(IsShowFrame) + self.IsShowFrame = IsShowFrame +end + +---@param Index 0:Nill 1:SelfTeam 2:EnemyTeam +function WB_PlayerHead_48:ShowTeamFrame(Index) + self.WidgetSwitcher_Frame:SetActiveWidgetIndex(Index) +end + +function WB_PlayerHead_48:UpdatePlayerInfo(PlayerKey) + + if self.PlayerKey ~= PlayerKey then + self.PlayerKey = PlayerKey + if self.PlayerKey and self.PlayerKey > 0 then + self:LuaInit() + self:SetVisibility(ESlateVisibility.SelfHitTestInvisible) + local PlayerInfo = UGCGameSystem.GameState:GetPlayerHeadInfo(PlayerKey) + ---@param PlayerInfo table {UID:string, IconURL:string, Gender:int, AvatarBoxId:int, PlayerLevel:int, PlayerName:string} 其中AvatarBoxId可以从PlayerState中获取 + ---@field InitView:fun(style:int32,uid:FString,iconURL:FString,gender:int32,frameLevel:int32,playerLevel:int32,ignoreFrame:bool,IsMySelf:bool) + local AvatarBoxId = self.IsShowFrame and PlayerInfo.AvatarBoxId or 0 + self.Common_Avatar_BP_C_0:InitView(2, PlayerInfo.UIDString, PlayerInfo.IconURL, PlayerInfo.Gender, AvatarBoxId, PlayerInfo.PlayerLevel, false, false) + else + self:SetVisibility(ESlateVisibility.Collapsed) + end + end +end + +function WB_PlayerHead_48:SetShowHealth(IsShow) + if IsShow ~= self.IsShowHealth then + self.IsShowHealth = IsShow + if self.IsShowHealth then + self.ProgressBar_Health:SetVisibility(ESlateVisibility.SelfHitTestInvisible) + else + self.ProgressBar_Health:SetVisibility(ESlateVisibility.Collapsed) + end + end +end + +EPlayerHeadInfoState = { + Alive = 1; + Death = 2; + KnockedDown = 3; +} + +function WB_PlayerHead_48:UpdatePlayerStateInfo() + if self.PlayerKey == nil or self.PlayerKey < 0 then return end + local PlayerHeadState = EPlayerHeadInfoState.Alive + local PlayerPawn = UGCGameSystem.GetPlayerPawnByPlayerKey(self.PlayerKey) + if UE.IsValid(PlayerPawn) then + if UGCPawnSystem.HasPawnState(PlayerPawn, EPawnState.Dead) then + PlayerHeadState = EPlayerHeadInfoState.Death + elseif UGCPawnSystem.HasPawnState(PlayerPawn, EPawnState.Dying) then + PlayerHeadState = EPlayerHeadInfoState.KnockedDown + end + else + PlayerHeadState = EPlayerHeadInfoState.Death + end + -- 更新显示状态 + self:UpdateWidgetState(PlayerHeadState) + -- 更新血量 + if self.IsShowHealth and self.PlayerHeadState == EPlayerHeadInfoState.Alive then + self.ProgressBar_Health:SetPercent(UGCPawnAttrSystem.GetHealth(PlayerPawn)/ UGCPawnAttrSystem.GetHealthMax(PlayerPawn)) + end +end + +function WB_PlayerHead_48:UpdateWidgetState(InPlayerHeadState) + if self.PlayerHeadState ~= InPlayerHeadState then + self.PlayerHeadState = InPlayerHeadState + if self.PlayerHeadState == EPlayerHeadInfoState.Alive then + -- 存活 + if self.IsShowHealth then + self.ProgressBar_Health:SetVisibility(ESlateVisibility.SelfHitTestInvisible) + end + self.Overlay_KnockedDown:SetVisibility(ESlateVisibility.Collapsed) + self.Border_HeadMain:SetContentColorAndOpacity({R=1,G=1,B=1,A=1}) + self.Overlay_IsDead:SetVisibility(ESlateVisibility.Collapsed) + + elseif self.PlayerHeadState == EPlayerHeadInfoState.Death then + -- 死亡 + self.ProgressBar_Health:SetVisibility(ESlateVisibility.Collapsed) + self.Overlay_KnockedDown:SetVisibility(ESlateVisibility.Collapsed) + self.Border_HeadMain:SetContentColorAndOpacity({R=0.1,G=0.1,B=0.1,A=1.000000}) + self.Overlay_IsDead:SetVisibility(ESlateVisibility.SelfHitTestInvisible) + + elseif self.PlayerHeadState == EPlayerHeadInfoState.KnockedDown then + -- 倒地 + if self.IsShowHealth then + self.ProgressBar_Health:SetVisibility(ESlateVisibility.SelfHitTestInvisible) + self.ProgressBar_Health:SetPercent(0) + end + self.Overlay_KnockedDown:SetVisibility(ESlateVisibility.SelfHitTestInvisible) + self.Border_HeadMain:SetContentColorAndOpacity({R=1,G=1,B=1,A=1}) + self.Overlay_IsDead:SetVisibility(ESlateVisibility.Collapsed) + end + end +end + +return WB_PlayerHead_48 \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/PlayerHead/WB_PlayerInfo_L.lua b/CounterAttack_Solo/Script/UI/PlayerHead/WB_PlayerInfo_L.lua new file mode 100644 index 00000000..daf2a990 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/PlayerHead/WB_PlayerInfo_L.lua @@ -0,0 +1,36 @@ +---@class WB_PlayerInfo_L_C:UUserWidget +---@field General_AvatarFrame_UIBP UCommon_Avatar_BP_C +---@field Image_TC_Loading_Item_Badge1 UImage +---@field Image_TC_Loading_Item_Badge2 UImage +---@field TextBlock_TC_Loading_PlayerName1 UTextBlock +---@field WidgetSwitcher_TC_Loading_Gender1 UWidgetSwitcher +---@field WidgetSwitcher_TC_Loading_Item UWidgetSwitcher +--Edit Below-- +local WB_PlayerInfo_L = { bInitDoOnce = false } + +--[==[ Construct +function WB_PlayerInfo_L:Construct() + +end +-- Construct ]==] + +-- function WB_PlayerInfo_L:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_PlayerInfo_L:Destruct() + +-- end + +function WB_PlayerInfo_L:UpdatePlayerInfo(PlayerKey) + local PlayerInfo = UGCGameSystem.GameState:GetPlayerHeadInfo(PlayerKey) + ---@param PlayerInfo table {UID:string, IconURL:string, Gender:int, AvatarBoxId:int, PlayerLevel:int, PlayerName:string} 其中AvatarBoxId可以从PlayerState中获取 + UGCLogSystem.LogTree(string.format("[WB_PlayerInfo_L_UpdatePlayerInfo] PlayerInfo ="), PlayerInfo) + UGCLogSystem.Log("[WB_ShowVSPlayerInfo:UpdatePlayerInfo] PlayerName = %s", PlayerInfo.PlayerName) + self.TextBlock_TC_Loading_PlayerName1:SetText(PlayerInfo.PlayerName) + self.WidgetSwitcher_TC_Loading_Gender1:SetActiveWidgetIndex(PlayerInfo.Gender - 1) + ---@field InitView:fun(style:int32,uid:FString,iconURL:FString,gender:int32,frameLevel:int32,playerLevel:int32,ignoreFrame:bool,IsMySelf:bool) + self.General_AvatarFrame_UIBP:InitView(2, PlayerInfo.UIDString, PlayerInfo.IconURL, PlayerInfo.Gender, PlayerInfo.AvatarBoxId, PlayerInfo.PlayerLevel, false, false) +end + +return WB_PlayerInfo_L \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/PlayerHead/WB_PlayerInfo_R.lua b/CounterAttack_Solo/Script/UI/PlayerHead/WB_PlayerInfo_R.lua new file mode 100644 index 00000000..3846c950 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/PlayerHead/WB_PlayerInfo_R.lua @@ -0,0 +1,36 @@ +---@class WB_PlayerInfo_R_C:UUserWidget +---@field General_AvatarFrame_UIBP UCommon_Avatar_BP_C +---@field Image_TC_Loading_Item_Badge1 UImage +---@field Image_TC_Loading_Item_Badge2 UImage +---@field TextBlock_TC_Loading_PlayerName1 UTextBlock +---@field WidgetSwitcher_TC_Loading_Gender1 UWidgetSwitcher +---@field WidgetSwitcher_TC_Loading_Item UWidgetSwitcher +--Edit Below-- +local WB_PlayerInfo_R = { bInitDoOnce = false } + +--[==[ Construct +function WB_PlayerInfo_R:Construct() + +end +-- Construct ]==] + +-- function WB_PlayerInfo_R:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_PlayerInfo_R:Destruct() + +-- end + +function WB_PlayerInfo_R:UpdatePlayerInfo(PlayerKey) + local PlayerInfo = UGCGameSystem.GameState:GetPlayerHeadInfo(PlayerKey) + ---@param PlayerInfo table {UID:string, IconURL:string, Gender:int, AvatarBoxId:int, PlayerLevel:int, PlayerName:string} 其中AvatarBoxId可以从PlayerState中获取 + UGCLogSystem.LogTree(string.format("[WB_PlayerInfo_R_UpdatePlayerInfo] PlayerInfo ="), PlayerInfo) + UGCLogSystem.Log("[WB_ShowVSPlayerInfo:UpdatePlayerInfo] PlayerName = %s", PlayerInfo.PlayerName) + self.TextBlock_TC_Loading_PlayerName1:SetText(PlayerInfo.PlayerName) + self.WidgetSwitcher_TC_Loading_Gender1:SetActiveWidgetIndex(PlayerInfo.Gender - 1) + ---@field InitView:fun(style:int32,uid:FString,iconURL:FString,gender:int32,frameLevel:int32,playerLevel:int32,ignoreFrame:bool,IsMySelf:bool) + self.General_AvatarFrame_UIBP:InitView(2, PlayerInfo.UIDString, PlayerInfo.IconURL, PlayerInfo.Gender, PlayerInfo.AvatarBoxId, PlayerInfo.PlayerLevel, false, false) +end + +return WB_PlayerInfo_R \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/Rank/WB_TeamRank.lua b/CounterAttack_Solo/Script/UI/Rank/WB_TeamRank.lua new file mode 100644 index 00000000..77d5ca62 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/Rank/WB_TeamRank.lua @@ -0,0 +1,69 @@ +---@class WB_TeamRank_C:UUserWidget +---@field VerticalBox_Left UVerticalBox +---@field VerticalBox_Right UVerticalBox +--Edit Below-- +---@type WB_TeamRank_C +local WB_TeamRank = { + bInitDoOnce = false; + LeftTeamType = 1; + RightTeamType = 2; +}; + +function WB_TeamRank:Construct() + UGCEventSystem.AddListener(EventEnum.UpdatePlayerScoreData, self.UpdateRank, self); + UGCEventSystem.AddListener(EventEnum.UpdatePlayerInfo, self.SetItemTeam, self); + self:SetItemTeam() + for i = 0, self.VerticalBox_Left:GetChildrenCount() - 1 do + local ItemLeftInst = self.VerticalBox_Left:GetChildAt(i) + local ItemRightInst = self.VerticalBox_Right:GetChildAt(i) + ItemLeftInst:SetIndex(i + 1) + ItemRightInst:SetIndex(i + 1) + end +end + +function WB_TeamRank:SetItemTeam() + local LocalPlayerTeamID = UGCGameSystem.GameState:GetPlayerTeamIDByPlayerKey(UGCSystemLibrary.GetLocalPlayerKey()) + if LocalPlayerTeamID == TeamConfig.TeamType.CT then + self.LeftTeamType, self.RightTeamType = TeamConfig.TeamType.CT, TeamConfig.TeamType.T + else + self.LeftTeamType, self.RightTeamType = TeamConfig.TeamType.T, TeamConfig.TeamType.CT + end + + for i = 0, self.VerticalBox_Left:GetChildrenCount() - 1 do + local ItemLeftInst = self.VerticalBox_Left:GetChildAt(i) + local ItemRightInst = self.VerticalBox_Right:GetChildAt(i) + ItemLeftInst:SetTeam(TeamConfig.TeamType.CT) + ItemRightInst:SetTeam(TeamConfig.TeamType.T) + end + self:UpdateRank() +end + +function WB_TeamRank:UpdateRank() + -- ScoreData: {[PlayerKey] = {Kill = int32, Dead = int32, Score = float}...} + local RankData = PlayerScoreSystem.GetTeamRank() + UGCLogSystem.LogTree("[WB_TeamRank_UpdateRank]", RankData) + + + + for i = 0, self.VerticalBox_Left:GetChildrenCount() - 1 do + local ItemLeftInst = self.VerticalBox_Left:GetChildAt(i) + local ItemRightInst = self.VerticalBox_Right:GetChildAt(i) + local PlayerKeyLeft = RankData[self.LeftTeamType] and RankData[self.LeftTeamType][i + 1] or nil + local PlayerKeyRight = RankData[self.RightTeamType] and RankData[self.RightTeamType][i + 1] or nil + if PlayerKeyLeft then + ItemLeftInst:SetVisibility(ESlateVisibility.SelfHitTestInvisible) + ItemLeftInst:InitRankInfo(PlayerKeyLeft) + else + ItemLeftInst:SetVisibility(ESlateVisibility.Collapsed) + end + if PlayerKeyRight then + ItemRightInst:SetVisibility(ESlateVisibility.SelfHitTestInvisible) + ItemRightInst:InitRankInfo(PlayerKeyRight) + else + ItemRightInst:SetVisibility(ESlateVisibility.Collapsed) + end + end + +end + +return WB_TeamRank; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/Rank/WB_TeamRankItem.lua b/CounterAttack_Solo/Script/UI/Rank/WB_TeamRankItem.lua new file mode 100644 index 00000000..47b7012b --- /dev/null +++ b/CounterAttack_Solo/Script/UI/Rank/WB_TeamRankItem.lua @@ -0,0 +1,56 @@ +---@class WB_TeamRankItem_C:UUserWidget +---@field Image_6 UImage +---@field Image_PlayerIcon UImage +---@field TextBlock_Deaths UTextBlock +---@field TextBlock_Kills UTextBlock +---@field TextBlock_PlayerName UTextBlock +---@field TextBlock_RankNum UTextBlock +---@field WidgetSwitcher_IsLocalPlayer UWidgetSwitcher +--Edit Below-- +---@type WB_TeamRankItem_C +local WB_TeamRankItem = { + bInitDoOnce = false; +}; + +function WB_TeamRankItem:SetTeam(TeamType) + -- UGCLogSystem.Log("[WB_TeamRankItem_SetTeam]") + local TeamColor = TeamConfig.TeamColor[TeamType] + -- 设置队伍颜色 + if TeamColor then + self.TextBlock_RankNum:SetColorAndOpacity({SpecifiedColor = TeamColor, ColorUseRule = 0}) + self.TextBlock_PlayerName:SetColorAndOpacity({SpecifiedColor = TeamColor, ColorUseRule = 0}) + else + UGCLogSystem.LogError("[WB_TeamRankItem_SetTeam] TeamType:%s, TeamColorType: %s", tostring(TeamType), type(TeamColor)) + end +end + +function WB_TeamRankItem:SetIndex(Index) + self.TextBlock_RankNum:SetText(tostring(Index)); +end + +function WB_TeamRankItem:InitRankInfo(PlayerKey) + if PlayerKey == UGCSystemLibrary.GetLocalPlayerKey() then + self.WidgetSwitcher_IsLocalPlayer:SetActiveWidgetIndex(1) + else + self.WidgetSwitcher_IsLocalPlayer:SetActiveWidgetIndex(0) + end + + local PlayerName = UGCGameSystem.GameState:GetPlayerNameByPlayerKey(PlayerKey); + -- local RankNum = UGCGameSystem.GameState:GetPlayerRankByPlayerKey(PlayerKey) + local Kills = PlayerScoreSystem.GetPlayerScoreDataFromType(PlayerKey, PlayerScoreSystem.Config.EScoreType.Kills) + local Damage = PlayerScoreSystem.GetPlayerScoreDataFromType(PlayerKey, PlayerScoreSystem.Config.EScoreType.Damage) + + local Deaths = PlayerScoreSystem.GetPlayerScoreDataFromType(PlayerKey, PlayerScoreSystem.Config.EScoreType.Deaths) + + self.TextBlock_PlayerName:SetText(PlayerName); + --self.TextBlock_RankNum:SetText(tostring(RankNum)); + + + --self.TextBlock_Kills:SetText(tostring(Kills)); + self.TextBlock_Kills:SetText(math.floor(Damage)); + self.TextBlock_Deaths:SetText(tostring(Deaths)); + + UGCSystemLibrary.DownloadImageToUImage(self.Image_PlayerIcon, UGCGameSystem.GameState:GetHeadIconByPlayerKey(PlayerKey), true); +end + +return WB_TeamRankItem; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/ScreenEffect/WB_Vague.lua b/CounterAttack_Solo/Script/UI/ScreenEffect/WB_Vague.lua new file mode 100644 index 00000000..0f9e10d0 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/ScreenEffect/WB_Vague.lua @@ -0,0 +1,21 @@ +---@class WB_Vague_C:UUserWidget +---@field VagueEffectLoop UWidgetAnimation +---@field VagueEffectStart UWidgetAnimation +--Edit Below-- +local WB_Vague = { bInitDoOnce = false } + +--[==[ Construct +function WB_Vague:Construct() + +end +-- Construct ]==] + +-- function WB_Vague:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_Vague:Destruct() + +-- end + +return WB_Vague \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/SecondaryConfirmation/WB_SecondaryConfirmation.lua b/CounterAttack_Solo/Script/UI/SecondaryConfirmation/WB_SecondaryConfirmation.lua new file mode 100644 index 00000000..47097289 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/SecondaryConfirmation/WB_SecondaryConfirmation.lua @@ -0,0 +1,89 @@ +---@class WB_SecondaryConfirmation_C:UUserWidget +---@field ShowAnim UWidgetAnimation +---@field Button_Cancellation UButton +---@field Button_Confirm UButton +---@field TextBlock_Cancellation UTextBlock +---@field TextBlock_Confirm UTextBlock +---@field TextBlock_ShowInfo UTextBlock +--Edit Below-- +local WB_SecondaryConfirmation = { + bInitDoOnce = false; + bIsShowing = false; +}; + + +function WB_SecondaryConfirmation:Construct() + WidgetLibrary.BindButtonClicked(self.Button_Cancellation, self.ClickCancellation, self) + WidgetLibrary.BindButtonClicked(self.Button_Confirm, self.ClickConfirm, self) +end + + +function WB_SecondaryConfirmation:OnShowPanel() + self.bIsShowing = true + self:PlayAnimation(self.ShowAnim, 0, 1, EUMGSequencePlayMode.Forward, 1); +end + +function WB_SecondaryConfirmation:SetTextInfo(TextInfo, CancellationText, ConfirmText) + self.TextBlock_ShowInfo:SetText(TextInfo) + if CancellationText then + self.TextBlock_Cancellation:SetText(CancellationText) + end + if ConfirmText then + self.TextBlock_Confirm:SetText(ConfirmText) + end +end + +function WB_SecondaryConfirmation:BindCancellationCallBack(InCancellationCallBackFunc, InCancellationCallBackObj) + self.CancellationCallBackFunc = InCancellationCallBackFunc + self.CancellationCallBackObj = InCancellationCallBackObj +end + +function WB_SecondaryConfirmation:BindConfirmCallBack(InConfirmCallBackFunc, InConfirmCallBackObj) + self.ConfirmCallBackFunc = InConfirmCallBackFunc + self.ConfirmCallBackObj = InConfirmCallBackObj +end + +function WB_SecondaryConfirmation:Reset() + self.bIsShowing = false + self:BindCancellationCallBack() + self:BindConfirmCallBack() + self.TextBlock_Cancellation:SetText("取消") + self.TextBlock_Confirm:SetText("确认") + WidgetManager:ClosePanel(WidgetConfig.EUIType.SecondaryConfirmation) +end + +function WB_SecondaryConfirmation:ClickCancellation() + if not self.bIsShowing then return end + SoundSystem.PlaySound(SoundSystem.ESound.Click) + if self.CancellationCallBackFunc then + if self.CancellationCallBackObj then + self.CancellationCallBackFunc(self.CancellationCallBackObj) + else + self.CancellationCallBackFunc() + end + end + self:Reset() +end + +function WB_SecondaryConfirmation:ClickConfirm() + if not self.bIsShowing then return end + SoundSystem.PlaySound(SoundSystem.ESound.Click) + if self.ConfirmCallBackFunc then + if self.ConfirmCallBackObj then + self.ConfirmCallBackFunc(self.ConfirmCallBackObj) + else + self.ConfirmCallBackFunc() + end + end + self:Reset() +end + +-- function WB_SecondaryConfirmation:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_SecondaryConfirmation:Destruct() + +-- end + +return WB_SecondaryConfirmation; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/SecondaryConfirmation/WB_SecondaryConfirmation_EditableText.lua b/CounterAttack_Solo/Script/UI/SecondaryConfirmation/WB_SecondaryConfirmation_EditableText.lua new file mode 100644 index 00000000..90ffef04 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/SecondaryConfirmation/WB_SecondaryConfirmation_EditableText.lua @@ -0,0 +1,111 @@ +---@class WB_SecondaryConfirmation_EditableText_C:UUserWidget +---@field AnimShow UWidgetAnimation +---@field Button_Cancellation UButton +---@field Button_Confirm UButton +---@field EditableText_Name UWidget_NewEditableText_C +---@field TextBlock_Cancellation UTextBlock +---@field TextBlock_Confirm UTextBlock +--Edit Below-- +local WB_SecondaryConfirmation_EditableText = { + bInitDoOnce = false; + TextCount = 6; +}; + + +function WB_SecondaryConfirmation_EditableText:Construct() + WidgetLibrary.BindButtonClicked(self.Button_Cancellation, self.ClickCancellation, self) + WidgetLibrary.BindButtonClicked(self.Button_Confirm, self.ClickConfirm, self) + self.EditableText_Name.OnTextCommitted:Add(self.TextCommit, self) +end + + +function WB_SecondaryConfirmation_EditableText:NotifyToPlaceMode() + UGCSendRPCSystem.RPCEvent(nil, EventEnum.BackToPlaceMode) +end + +function WB_SecondaryConfirmation_EditableText:NotifySaveMap() + local Text = self.EditableText_Name:GetText() + UGCSendRPCSystem.RPCEvent(nil, EventEnum.SaveRunMap, Text) +end + +function WB_SecondaryConfirmation_EditableText:TextCommit(InText) + -- UGCLogSystem.Log("[WB_SaveMap_TextCommit] InText:%s", InText) + local TargetText = UGCSystemLibrary.remove_punctuation(InText) + UGCLogSystem.Log("[WB_SaveMap_TextCommit] TargetText:%s", TargetText) + self.EditableText_Name:SetText(UGCSystemLibrary.utf8sub(TargetText, 1, self.TextCount)) +end + + +function WB_SecondaryConfirmation_EditableText:OnShowPanel() + self.bIsShowing = true + self:PlayAnimation(self.ShowAnim, 0, 1, EUMGSequencePlayMode.Forward, 1); +end + +---@param HintTextInfo 提示文本 +---@param InTextCount 限制字数 +function WB_SecondaryConfirmation_EditableText:SetTextInfo(HintTextInfo, InTextCount, CancellationText, ConfirmText) + -- self.EditableText_Name:SetHintText(HintTextInfo) + self.TextCount = InTextCount + if CancellationText then + self.TextBlock_Cancellation:SetText(CancellationText) + end + if ConfirmText then + self.TextBlock_Confirm:SetText(ConfirmText) + end +end + +function WB_SecondaryConfirmation_EditableText:BindCancellationCallBack(InCancellationCallBackFunc, InCancellationCallBackObj) + self.CancellationCallBackFunc = InCancellationCallBackFunc + self.CancellationCallBackObj = InCancellationCallBackObj +end + +function WB_SecondaryConfirmation_EditableText:BindConfirmCallBack(InConfirmCallBackFunc, InConfirmCallBackObj) + self.ConfirmCallBackFunc = InConfirmCallBackFunc + self.ConfirmCallBackObj = InConfirmCallBackObj +end + +function WB_SecondaryConfirmation_EditableText:Reset() + self.bIsShowing = false + self:BindCancellationCallBack() + self:BindConfirmCallBack() + self.TextBlock_Cancellation:SetText("取消") + self.TextBlock_Confirm:SetText("确认") + WidgetManager:ClosePanel(WidgetConfig.EUIType.SecondaryConfirmation_EditableText) +end + +function WB_SecondaryConfirmation_EditableText:ClickCancellation() + if not self.bIsShowing then return end + SoundSystem.PlaySound(SoundSystem.ESound.Click) + if self.CancellationCallBackFunc then + if self.CancellationCallBackObj then + self.CancellationCallBackFunc(self.CancellationCallBackObj) + else + self.CancellationCallBackFunc() + end + end + self:Reset() +end + +function WB_SecondaryConfirmation_EditableText:ClickConfirm() + if not self.bIsShowing then return end + SoundSystem.PlaySound(SoundSystem.ESound.Click) + if self.ConfirmCallBackFunc then + if self.ConfirmCallBackObj then + self.ConfirmCallBackFunc(self.ConfirmCallBackObj, self.EditableText_Name:GetText()) + else + self.ConfirmCallBackFunc(self.EditableText_Name:GetText()) + end + end + self:Reset() +end + + +-- function WB_SecondaryConfirmation_EditableText:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_SecondaryConfirmation_EditableText:Destruct() + +-- end + +return WB_SecondaryConfirmation_EditableText; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/SecondaryConfirmation/WB_SecondaryConfirmation_Strip.lua b/CounterAttack_Solo/Script/UI/SecondaryConfirmation/WB_SecondaryConfirmation_Strip.lua new file mode 100644 index 00000000..bc931756 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/SecondaryConfirmation/WB_SecondaryConfirmation_Strip.lua @@ -0,0 +1,131 @@ +---@class WB_SecondaryConfirmation_Strip_C:UUserWidget +---@field ShowAnim UWidgetAnimation +---@field Button_AddVal UButton +---@field Button_Cancellation UButton +---@field Button_Confirm UButton +---@field Button_SubVal UButton +---@field Slider_Val USlider +---@field TextBlock_Cancellation UTextBlock +---@field TextBlock_Confirm UTextBlock +---@field TextBlock_ShowInfo UTextBlock +---@field TextBlock_Val UTextBlock +--Edit Below-- +local WB_SecondaryConfirmation_Strip = { + bInitDoOnce = false; + bIsShowing = false; + MinVal = 0; + MaxVal = 1; + Interval = 1; + TextFunc = function(val) return "" end ; +}; + + +function WB_SecondaryConfirmation_Strip:Construct() + WidgetLibrary.BindButtonClicked(self.Button_Cancellation, self.ClickCancellation, self) + WidgetLibrary.BindButtonClicked(self.Button_Confirm, self.ClickConfirm, self) + WidgetLibrary.SliderOnValueChanged(self.Slider_Val, self.UpdateVal, self) + WidgetLibrary.BindButtonClicked(self.Button_AddVal, self.AddVal, self) + WidgetLibrary.BindButtonClicked(self.Button_SubVal, self.SubVal, self) + +end + + +function WB_SecondaryConfirmation_Strip:OnShowPanel() + self.bIsShowing = true + self:PlayAnimation(self.ShowAnim, 0, 1, EUMGSequencePlayMode.Forward, 1); +end + +---@param TextFunc "function:(val:int) return str" +function WB_SecondaryConfirmation_Strip:SetTextInfo(TextFunc, CancellationText, ConfirmText) + self.TextFunc = TextFunc + self:UpdateVal() + if CancellationText then + self.TextBlock_Cancellation:SetText(CancellationText) + end + if ConfirmText then + self.TextBlock_Confirm:SetText(ConfirmText) + end +end + +function WB_SecondaryConfirmation_Strip:GetVal() + return math.clamp(KismetMathLibrary.Round(self.Slider_Val:GetValue() * self.Interval + self.MinVal), self.MinVal, self.MaxVal) +end + +function WB_SecondaryConfirmation_Strip:SetValRange(MinVal, MaxVal) + self.MinVal = MinVal + self.MaxVal = MaxVal + self.Interval = self.MaxVal - self.MinVal +end + +function WB_SecondaryConfirmation_Strip:AddVal() + local TargetVal = math.clamp(self.Slider_Val:GetValue() + 1./self.Interval, 0, 1) + self.Slider_Val:SetValue(TargetVal) + self:UpdateVal() +end + +function WB_SecondaryConfirmation_Strip:SubVal() + local TargetVal = math.clamp(self.Slider_Val:GetValue() - 1./self.Interval, 0, 1) + self.Slider_Val:SetValue(TargetVal) + self:UpdateVal() +end + +function WB_SecondaryConfirmation_Strip:UpdateVal() + local Val = self:GetVal() + self.TextBlock_ShowInfo:SetText(self.TextFunc(Val)) + self.TextBlock_Val:SetText(tostring(Val)) +end + +function WB_SecondaryConfirmation_Strip:BindCancellationCallBack(InCancellationCallBackFunc, InCancellationCallBackObj) + self.CancellationCallBackFunc = InCancellationCallBackFunc + self.CancellationCallBackObj = InCancellationCallBackObj +end + +function WB_SecondaryConfirmation_Strip:BindConfirmCallBack(InConfirmCallBackFunc, InConfirmCallBackObj) + self.ConfirmCallBackFunc = InConfirmCallBackFunc + self.ConfirmCallBackObj = InConfirmCallBackObj +end + +function WB_SecondaryConfirmation_Strip:Reset() + self.bIsShowing = false + self:BindCancellationCallBack() + self:BindConfirmCallBack() + self.TextBlock_Cancellation:SetText("取消") + self.TextBlock_Confirm:SetText("确认") + WidgetManager:ClosePanel(WidgetConfig.EUIType.SecondaryConfirmation_Strip) +end + +function WB_SecondaryConfirmation_Strip:ClickCancellation() + if not self.bIsShowing then return end + SoundSystem.PlaySound(SoundSystem.ESound.Click) + if self.CancellationCallBackFunc then + if self.CancellationCallBackObj then + self.CancellationCallBackFunc(self.CancellationCallBackObj) + else + self.CancellationCallBackFunc() + end + end + self:Reset() +end + +function WB_SecondaryConfirmation_Strip:ClickConfirm() + if not self.bIsShowing then return end + SoundSystem.PlaySound(SoundSystem.ESound.Click) + if self.ConfirmCallBackFunc then + if self.ConfirmCallBackObj then + self.ConfirmCallBackFunc(self.ConfirmCallBackObj, self:GetVal()) + else + self.ConfirmCallBackFunc(self:GetVal()) + end + end + self:Reset() +end + +-- function WB_SecondaryConfirmation_Strip:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_SecondaryConfirmation_Strip:Destruct() + +-- end + +return WB_SecondaryConfirmation_Strip; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/SelectBuff/WB_BaseBuffSelectItem.lua b/CounterAttack_Solo/Script/UI/SelectBuff/WB_BaseBuffSelectItem.lua new file mode 100644 index 00000000..9c352177 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/SelectBuff/WB_BaseBuffSelectItem.lua @@ -0,0 +1,89 @@ +---@class WB_BaseBuffSelectItem_C:UUserWidget +---@field Image_BuffIcon UImage +---@field Image_IsSelect UImage +---@field NewButton_BuffSelect UNewButton +---@field TextBlock_Name UTextBlock +--Edit Below-- +local WB_BaseBuffSelectItem = { bInitDoOnce = false; }; + +--[==[ Construct +function WB_BaseBuffSelectItem:Construct() + +end +-- Construct ]==] + +-- function WB_BaseBuffSelectItem:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_BaseBuffSelectItem:Destruct() + +-- end + + +function WB_BaseBuffSelectItem:LuaInit() + if self.bInitDoOnce then + return; + end + self.bInitDoOnce = true; + WidgetLibrary.BindButtonClicked(self.NewButton_BuffSelect, self.ClickSelect, self) + self.NewButton_BuffSelect:SetTouchMethod(EButtonTouchMethod.PreciseTap) +end + +function WB_BaseBuffSelectItem:UpdateIncreaseType(InIncreaseType) + self:LuaInit() + self.IncreaseType = InIncreaseType + --UGCLogSystem.Log("[WB_BaseBuffSelectItem_UpdateIncreaseType]") + + -- 设置名字 + self.TextBlock_Name:SetText(tostring(GodOfWarConfig.IncreaseName[InIncreaseType])) + -- 设置图案 + UGCSystemLibrary.AsyncLoadAsset(GodOfWarConfig.IncreaseIcon[InIncreaseType], + function(InTex) + if UE.IsValid(InTex) then + self.Image_BuffIcon:SetBrushFromTexture(InTex, false) + end + end, + nil, + true + ) + +end + +function WB_BaseBuffSelectItem:GetIncreaseType() + return self.IncreaseType +end + +function WB_BaseBuffSelectItem:ClickSelect() + -- UGCLogSystem.Log("[WB_BaseBuffSelectItem_ClickSelect]") + if self.SelectCallBackFunc then + if self.SelectCallBackObj then + self.SelectCallBackFunc(self.SelectCallBackObj, self:GetIndex()) + else + self.SelectCallBackFunc(self:GetIndex()) + end + end +end + +function WB_BaseBuffSelectItem:BindClickSelect(Func, Obj) + self.SelectCallBackFunc = Func + self.SelectCallBackObj = Obj +end + +function WB_BaseBuffSelectItem:SetIndex(InIndex) + self.Index = InIndex +end + +function WB_BaseBuffSelectItem:GetIndex() + return self.Index +end + +function WB_BaseBuffSelectItem:SetSelect(IsSelect) + if IsSelect then + self.Image_IsSelect:SetVisibility(ESlateVisibility.HitTestInvisible) + else + self.Image_IsSelect:SetVisibility(ESlateVisibility.Collapsed) + end +end + +return WB_BaseBuffSelectItem; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/SelectBuff/WB_BuffSelectItem.lua b/CounterAttack_Solo/Script/UI/SelectBuff/WB_BuffSelectItem.lua new file mode 100644 index 00000000..2eae562f --- /dev/null +++ b/CounterAttack_Solo/Script/UI/SelectBuff/WB_BuffSelectItem.lua @@ -0,0 +1,82 @@ +---@class WB_BuffSelectItem_C:UUserWidget +---@field CanvasPanel_IsUpLevel UCanvasPanel +---@field Image_3 UImage +---@field Image_BuffIcon UImage +---@field NewButton_BuffSelect UNewButton +---@field TextBlock_Name UTextBlock +--Edit Below-- +local WB_BuffSelectItem = { bInitDoOnce = false; }; + +--[==[ Construct +function WB_BuffSelectItem:Construct() + +end +-- Construct ]==] + +-- function WB_BuffSelectItem:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_BuffSelectItem:Destruct() + +-- end + + +function WB_BuffSelectItem:LuaInit() + if self.bInitDoOnce then + return; + end + self.bInitDoOnce = true; + WidgetLibrary.BindButtonClicked(self.NewButton_BuffSelect, self.ClickSelect, self) +end + +function WB_BuffSelectItem:UpdateIncreaseType(InIncreaseType) + self:LuaInit() + --UGCLogSystem.Log("[WB_BuffSelectItem_UpdateIncreaseType]") + local PC = UGCSystemLibrary.GetLocalPlayerController() + -- 判断是否为升级 + if PC:GetOwnedIncreaseLevel(InIncreaseType) > 0 then + self.CanvasPanel_IsUpLevel:SetVisibility(ESlateVisibility.HitTestInvisible) + else + self.CanvasPanel_IsUpLevel:SetVisibility(ESlateVisibility.Collapsed) + end + -- 设置名字 + self.TextBlock_Name:SetText(tostring(GodOfWarConfig.IncreaseName[InIncreaseType])) + -- 设置图案 + UGCSystemLibrary.AsyncLoadAsset(GodOfWarConfig.IncreaseIcon[InIncreaseType], + function(InTex) + if UE.IsValid(InTex) then + self.Image_BuffIcon:SetBrushFromTexture(InTex, false) + end + end, + nil, + true + ) + +end + +function WB_BuffSelectItem:ClickSelect() + -- UGCLogSystem.Log("[WB_BuffSelectItem_ClickSelect]") + if self.SelectCallBackFunc then + if self.SelectCallBackObj then + self.SelectCallBackFunc(self.SelectCallBackObj, self:GetIndex()) + else + self.SelectCallBackFunc(self:GetIndex()) + end + end +end + +function WB_BuffSelectItem:BindClickSelect(Func, Obj) + self.SelectCallBackFunc = Func + self.SelectCallBackObj = Obj +end + +function WB_BuffSelectItem:SetIndex(InIndex) + self.Index = InIndex +end + +function WB_BuffSelectItem:GetIndex() + return self.Index +end + +return WB_BuffSelectItem; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/SelectBuff/WB_SelectBaseBuff.lua b/CounterAttack_Solo/Script/UI/SelectBuff/WB_SelectBaseBuff.lua new file mode 100644 index 00000000..31bcd1cb --- /dev/null +++ b/CounterAttack_Solo/Script/UI/SelectBuff/WB_SelectBaseBuff.lua @@ -0,0 +1,94 @@ +---@class WB_SelectBaseBuff_C:UUserWidget +---@field NewButton_Random UNewButton +---@field NewButton_Select UNewButton +---@field TextBlock_BuffDesc UTextBlock +---@field UniformGridPanel_Buffs UUniformGridPanel +--Edit Below-- +local WB_SelectBaseBuff = { + bInitDoOnce = false; + Col = 5; +} + + +function WB_SelectBaseBuff:Construct() + self:LuaInit() +end + + +-- function WB_SelectBaseBuff:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_SelectBaseBuff:Destruct() + +-- end + +function WB_SelectBaseBuff:LuaInit() + if self.bInitDoOnce then return end + self.bInitDoOnce = true + + WidgetLibrary.BindButtonClicked(self.NewButton_Select, self.SelectBuff, self) + WidgetLibrary.BindButtonClicked(self.NewButton_Random, self.CloseSelf, self) + + local LocalPC = UGCSystemLibrary.GetLocalPlayerController() + + local Count = 0 + + local AllIncreaseType = {} + for i, v in pairs(GodOfWarConfig.EIncreaseType) do + AllIncreaseType[#AllIncreaseType + 1] = v + end + table.sort(AllIncreaseType, function(a, b) return a > b end) + + for i, IncreaseType in pairs(AllIncreaseType) do + local Item = nil; + Count = Count + 1 + if self.UniformGridPanel_Buffs:GetChildrenCount() < Count then + Item = UserWidget.NewWidgetObjectBP(LocalPC, self:GetItemClass()); + self.UniformGridPanel_Buffs:AddChild(Item) + local TargetUniformGridSlot = WidgetLayoutLibrary.SlotAsUniformGridSlot(Item) + -- 居中 + TargetUniformGridSlot:SetVerticalAlignment(EVerticalAlignment.VAlign_Center) + TargetUniformGridSlot:SetHorizontalAlignment(EHorizontalAlignment.HAlign_Center) + -- 设置索引 + TargetUniformGridSlot:SetColumn((Count - 1) % self.Col) + TargetUniformGridSlot:SetRow((Count - 1) // self.Col) + else + Item = self.UniformGridPanel_Buffs:GetChildAt(Count - 1) + end + Item:UpdateIncreaseType(IncreaseType) + -- 这里传入类型方便回调获取 + Item:SetIndex(IncreaseType) + Item:BindClickSelect(self.ClickSelectBuff, self) + end + self:ClickSelectBuff(AllIncreaseType[1]) +end + +function WB_SelectBaseBuff:GetItemClass() + if not UE.IsValid(self.ItemClass) then + self.ItemClass = UE.LoadClass(UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/SelectBuff/WB_BaseBuffSelectItem.WB_BaseBuffSelectItem_C')) + end + return self.ItemClass +end + +function WB_SelectBaseBuff:ClickSelectBuff(IncreaseType) + for i = 1, self.UniformGridPanel_Buffs:GetChildrenCount() do + local Item = self.UniformGridPanel_Buffs:GetChildAt(i - 1) + Item:SetSelect(IncreaseType == Item:GetIndex()) + end + self.IncreaseType = IncreaseType + if GodOfWarConfig.IncreaseDesc[self.IncreaseType] then + self.TextBlock_BuffDesc:SetText(GodOfWarConfig.IncreaseDesc[self.IncreaseType]) + end +end + +function WB_SelectBaseBuff:CloseSelf() + WidgetManager:ClosePanel(WidgetConfig.EUIType.SelectBaseBuff) +end + +function WB_SelectBaseBuff:SelectBuff() + UGCSendRPCSystem.ActorRPCNotify(nil, UGCSystemLibrary.GetLocalPlayerController(), "SetBaseIncrease", self.IncreaseType) + self:CloseSelf() +end + +return WB_SelectBaseBuff \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/SelectBuff/WB_SelectIncrease.lua b/CounterAttack_Solo/Script/UI/SelectBuff/WB_SelectIncrease.lua new file mode 100644 index 00000000..ca57c88f --- /dev/null +++ b/CounterAttack_Solo/Script/UI/SelectBuff/WB_SelectIncrease.lua @@ -0,0 +1,144 @@ +---@class WB_SelectIncrease_C:UAEUserWidget +---@field CanvasPanel_SelectMenu UCanvasPanel +---@field HorizontalBox_Buffs UHorizontalBox +---@field Image_0 UImage +---@field Image_CD UImage +---@field NewButton_AutoSelect UNewButton +---@field TextBlock_AddCount UTextBlock +---@field WidgetSwitcher_AutoSelect UWidgetSwitcher +---@field WidgetSwitcher_ChangeAutoSelect UWidgetSwitcher +--Edit Below-- +local WB_SelectIncrease = { + bInitDoOnce = false; + IsAutoSelect = false; + CanObtainIncreaseCount = 0; +}; + +function WB_SelectIncrease:Construct() + UGCLogSystem.Log("[WB_SelectIncrease_Construct]") + -- 校验选择的Item数量 + self:CheckSelectItemCount() + WidgetLibrary.BindButtonClicked(self.NewButton_AutoSelect, self.ChangeAutoSelect, self) + UGCEventSystem.AddListener(EventEnum.UpdateCanObtainIncreaseCount, self.UpdateCanObtainIncreaseCount, self) + UGCEventSystem.AddListener(EventEnum.UpdateNowCanSelectIncrease, self.UpdateSelectBuffBox, self) + UGCEventSystem.SetTimerLoop(self, self.CheckUpdateIncrease, 1) +end + +function WB_SelectIncrease:UpdateCanObtainIncreaseCount(PC, Count) + UGCLogSystem.Log("[WB_SelectIncrease_UpdateCanObtainIncreaseCount]Count:%s", tostring(Count)) + + if Count > 0 then + --WidgetManager:ShowPanel(WidgetConfig.EUIType.SelectBuff, false) + self.CanvasPanel_SelectMenu:SetVisibility(ESlateVisibility.SelfHitTestInvisible) + self:AutoSelect() + else + --WidgetManager:ClosePanel(WidgetConfig.EUIType.SelectBuff) + self.CanvasPanel_SelectMenu:SetVisibility(ESlateVisibility.Collapsed) + end + if Count > 1 then + self.TextBlock_AddCount:SetVisibility(ESlateVisibility.HitTestInvisible) + self.TextBlock_AddCount:SetText("×" .. Count) + else + self.TextBlock_AddCount:SetVisibility(ESlateVisibility.Collapsed) + end + self.CanObtainIncreaseCount = Count + +end + +function WB_SelectIncrease:ChangeAutoSelect() + self.IsAutoSelect = not self.IsAutoSelect + if self.IsAutoSelect then + self.WidgetSwitcher_AutoSelect:SetActiveWidgetIndex(1) + self.WidgetSwitcher_ChangeAutoSelect:SetActiveWidgetIndex(1) + if self.CanObtainIncreaseCount > 0 then + self:AutoSelect() + end + else + self.WidgetSwitcher_AutoSelect:SetActiveWidgetIndex(0) + self.WidgetSwitcher_ChangeAutoSelect:SetActiveWidgetIndex(0) + if self.AutoSelectHandle then + UGCEventSystem.StopTimer(self.AutoSelectHandle) + self.AutoSelectHandle = nil + end + end +end + +function WB_SelectIncrease:AutoSelect() + if self.IsAutoSelect then + if self.AutoSelectHandle == nil then + self.AutoSelectHandle = UGCEventSystem.SetTimer(self, function() + if self.CanObtainIncreaseCount > 0 then + self:SelectIncrease(1) + end + self.AutoSelectHandle = nil + end, 1) + end + end +end + +--- 校验子项数量是否正确 +function WB_SelectIncrease:CheckSelectItemCount() + for i = 1, math.max(self.HorizontalBox_Buffs:GetChildrenCount(), GodOfWarConfig.CanSelectIncreaseCount) do + local Item = self.HorizontalBox_Buffs:GetChildAt(i - 1) + if Item == nil then + UGCLogSystem.Log("[WB_SelectIncrease_CheckSelectItemCount] Add") + Item = UserWidget.NewWidgetObjectBP(UGCSystemLibrary.GetLocalPlayerController(), self:GetChildClass()) + self.HorizontalBox_Buffs:AddChild(Item) + end + if i > GodOfWarConfig.CanSelectIncreaseCount then + Item:SetVisibility(ESlateVisibility.Collapsed) + else + Item:SetIndex(i) + Item:BindClickSelect(self.SelectIncrease, self) + end + end +end + +function WB_SelectIncrease:GetChildClass() + if self.ChildClass == nil then + self.ChildClass = UE.LoadClass(UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/SelectBuff/WB_BuffSelectItem.WB_BuffSelectItem_C')) + end + return self.ChildClass +end + +--- 校验增益选择 +function WB_SelectIncrease:CheckUpdateIncrease() + local PC = UGCSystemLibrary.GetLocalPlayerController() + + self:UpdateCanObtainIncreaseCount(PC, PC:GetCanObtainIncreaseCount()) + self:UpdateSelectBuffBox(PC, PC:GetNowCanSelectIncrease()) + +end + +function WB_SelectIncrease:UpdateSelectBuffBox(PC, InNowCanSelectIncrease) + + for i, v in pairs(InNowCanSelectIncrease) do + local Item = self.HorizontalBox_Buffs:GetChildAt(i - 1) + if Item then + Item:UpdateIncreaseType(v) + end + end + +end + +function WB_SelectIncrease:SelectIncrease(SelectIndex) + UGCLogSystem.Log("[WB_SelectIncrease_SelectIncrease]SelectIndex:%s", tostring(SelectIndex)) + if SelectIndex then + UGCSendRPCSystem.ActorRPCNotify(nil, UGCSystemLibrary.GetLocalPlayerController(), "PlayerSelectIncrease", SelectIndex) + UGCLogSystem.Log("[WB_SelectIncrease_SelectIncrease] Succeed") + end +end + +-- function WB_SelectIncrease:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_SelectIncrease:Destruct() + +-- end + + + + + +return WB_SelectIncrease; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/SelectWeapon/Item/WB_OtherPartItem.lua b/CounterAttack_Solo/Script/UI/SelectWeapon/Item/WB_OtherPartItem.lua new file mode 100644 index 00000000..36c5465a --- /dev/null +++ b/CounterAttack_Solo/Script/UI/SelectWeapon/Item/WB_OtherPartItem.lua @@ -0,0 +1,31 @@ +---@class WB_OtherPartItem_C:UUserWidget +---@field Image_PartIcon UImage +---@field TextBlock_Count UTextBlock +--Edit Below-- +local WB_OtherPartItem = { bInitDoOnce = false; }; + +--[==[ Construct +function WB_OtherPartItem:Construct() + +end +-- Construct ]==] + +-- function WB_OtherPartItem:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_OtherPartItem:Destruct() + +-- end + +function WB_OtherPartItem:SetItemID(InID, Count) + MyWeaponSystem.AsyncLoadItemSmallIconToBrush(InID, self.Image_PartIcon) + if Count <= 1 then + self.TextBlock_Count:SetVisibility(ESlateVisibility.Collapsed) + else + self.TextBlock_Count:SetText(tostring(Count)) + self.TextBlock_Count:SetVisibility(ESlateVisibility.HitTestInvisible) + end +end + +return WB_OtherPartItem; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/SelectWeapon/Item/WB_WeaponItem.lua b/CounterAttack_Solo/Script/UI/SelectWeapon/Item/WB_WeaponItem.lua new file mode 100644 index 00000000..48fbc0ed --- /dev/null +++ b/CounterAttack_Solo/Script/UI/SelectWeapon/Item/WB_WeaponItem.lua @@ -0,0 +1,65 @@ +---@class WB_WeaponItem_C:UUserWidget +---@field CanvasPanel_WeaponInfo UCanvasPanel +---@field HorizontalBox_Part UHorizontalBox +---@field Image_WeaponIcon UImage +---@field TextBlock_WeaponName UTextBlock +--Edit Below-- +local WB_WeaponItem = { bInitDoOnce = false; }; + +--[==[ Construct +function WB_WeaponItem:Construct() + +end +-- Construct ]==] + +-- function WB_WeaponItem:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_WeaponItem:Destruct() + +-- end + +function WB_WeaponItem:LuaInit() + if self.bInitDoOnce then return end + self.bInitDoOnce = true + UGCEventSystem.AddListener(ArchiveDataConfig.GetParamNotifyEvent(ArchiveDataConfig.EArchiveType.CustomWeaponParts), self.SetWeaponID, self) +end + + + +function WB_WeaponItem:SetWeaponID(WeaponID) + self:LuaInit() + if WeaponID ~= nil and self.WeaponID ~= WeaponID then + self.WeaponID = WeaponID + end + local Parts = MyWeaponSystem.GetWeaponBastParts(self.WeaponID) + local CustomWeaponParts = ArchiveDataConfig.GetPlayerArchiveDataFromType(UGCSystemLibrary.GetLocalPlayerKey(), ArchiveDataConfig.EArchiveType.CustomWeaponParts) + if CustomWeaponParts and CustomWeaponParts[self.WeaponID] then + Parts = CustomWeaponParts[self.WeaponID] + UGCLogSystem.LogTree("[WB_WeaponItem_SetWeaponID] Parts:", Parts) + end + if Parts then + for i = 1, self.HorizontalBox_Part:GetChildrenCount() do + local Item = self.HorizontalBox_Part:GetChildAt(i - 1) + if Parts[i] then + Item:SetVisibility(ESlateVisibility.SelfHitTestInvisible) + Item:SetItemID(Parts[i]) + else + Item:SetVisibility(ESlateVisibility.Collapsed) + end + end + end + MyWeaponSystem.AsyncLoadItemBigIconToBrush(self.WeaponID, self.Image_WeaponIcon) + self.TextBlock_WeaponName:SetText(MyWeaponSystem.GetItemName(self.WeaponID)) +end + +function WB_WeaponItem:SetVisWeaponInfo(IsVis) + if IsVis then + self.CanvasPanel_WeaponInfo:SetVisibility(ESlateVisibility.HitTestInvisible) + else + self.CanvasPanel_WeaponInfo:SetVisibility(ESlateVisibility.Hidden) + end +end + +return WB_WeaponItem; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/SelectWeapon/Item/WB_WeaponPartItem.lua b/CounterAttack_Solo/Script/UI/SelectWeapon/Item/WB_WeaponPartItem.lua new file mode 100644 index 00000000..7be14ef2 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/SelectWeapon/Item/WB_WeaponPartItem.lua @@ -0,0 +1,83 @@ +---@class WB_WeaponPartItem_C:UUserWidget +---@field Image_5 UImage +---@field Image_PartIcon UImage +---@field NewButton_ChangePart UNewButton +---@field WidgetSwitcher_IsSelect UWidgetSwitcher +---@field WidgetSwitcher_IsSelect_OLD UWidgetSwitcher +---@field WidgetSwitcher_SelectStyle UWidgetSwitcher +--Edit Below-- +local WB_WeaponPartItem = { + bInitDoOnce = false; +}; + +--[==[ Construct +function WB_WeaponPartItem:Construct() + +end +-- Construct ]==] + +-- function WB_WeaponPartItem:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_WeaponPartItem:Destruct() + +-- end + +function WB_WeaponPartItem:LuaInit() + if self.bInitDoOnce then return end + self.bInitDoOnce = true + WidgetLibrary.BindButtonClicked(self.NewButton_ChangePart, self.ClickCallBack, self) +end + +function WB_WeaponPartItem:ClickCallBack() + if self.SelectCallBackFunc then + if self.SelectCallBackObj then + self.SelectCallBackFunc(self.SelectCallBackObj, self:GetItemID()) + else + self.SelectCallBackFunc(self:GetPartType()) + end + end +end + +function WB_WeaponPartItem:BindSelectCallBack(InFunc, InObj) + self.SelectCallBackFunc = InFunc + self.SelectCallBackObj = InObj +end + + +WB_WeaponPartItem.PartID = -100 +function WB_WeaponPartItem:SetItemID(InPartID) + if self.PartID ~= InPartID then + self.PartID = InPartID + if self.PartID and self.PartID > 0 then + self:SetVisibility(ESlateVisibility.Visible) + MyWeaponSystem.AsyncLoadItemSmallIconToBrush(self.PartID, self.Image_PartIcon) + else + self:SetVisibility(ESlateVisibility.Collapsed) + end + end +end + +function WB_WeaponPartItem:GetItemID() + return self.PartID +end + +function WB_WeaponPartItem:SetPartType(InType) + self:LuaInit() + self.PartType = InType +end + +function WB_WeaponPartItem:GetPartType() + return self.PartType +end + +function WB_WeaponPartItem:SetIsSelect(InIsSelect) + self.WidgetSwitcher_IsSelect:SetActiveWidgetIndex(InIsSelect and 1 or 0) +end + +function WB_WeaponPartItem:SetSelectStyle(StyleIndex) + self.WidgetSwitcher_SelectStyle:SetActiveWidgetIndex(StyleIndex) +end + +return WB_WeaponPartItem; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/SelectWeapon/Item/WB_WeaponSelectItem.lua b/CounterAttack_Solo/Script/UI/SelectWeapon/Item/WB_WeaponSelectItem.lua new file mode 100644 index 00000000..f02ed390 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/SelectWeapon/Item/WB_WeaponSelectItem.lua @@ -0,0 +1,111 @@ +---@class WB_WeaponSelectItem_C:UUserWidget +---@field Button_Select UNewButton +---@field Image_IsSelect UImage +---@field TextBlock_TextName UTextBlock +---@field WeaponInfo1 UWB_WeaponItem_C +---@field WeaponInfo2 UWB_WeaponItem_C +--Edit Below-- +local WB_WeaponSelectItem = { + bInitDoOnce = false; + bIsSelect = false; + ItemID = 0; + Weapons = nil; +}; + + +--[==[ Construct +function WB_WeaponSelectItem:Construct() + +end +-- Construct ]==] + +-- function WB_WeaponSelectItem:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_WeaponSelectItem:Destruct() + +-- end +function WB_WeaponSelectItem:LuaInit() + if self.bInitDoOnce then + return; + end + self.bInitDoOnce = true; + WidgetLibrary.BindButtonClicked(self.Button_Select, self.SelectWeaponCombination, self) + UGCEventSystem.AddListener(ArchiveDataConfig.GetParamNotifyEvent(ArchiveDataConfig.EArchiveType.WeaponCombs), self.UpdateWeaponComb, self) + + self.Button_Select:SetTouchMethod(EButtonTouchMethod.PreciseTap) +end + +function WB_WeaponSelectItem:Init(InCombinationType, InCombinationIndex) + self:LuaInit() + + self.CombinationType = InCombinationType + self.CombinationIndex = InCombinationIndex + self.TextBlock_TextName:SetText("配置" .. self.CombinationIndex) + + local SavedWeaponComb = ArchiveDataConfig.GetPlayerArchiveDataFromType(UGCSystemLibrary.GetLocalPlayerKey(), ArchiveDataConfig.EArchiveType.WeaponCombs) + local CombinationList = WeaponSelectionCombinationConfig.WeaponCombinationList[InCombinationType].Weapon + + if SavedWeaponComb and SavedWeaponComb[InCombinationType] and SavedWeaponComb[InCombinationType][self.CombinationIndex] then + self:UpdateWeapons(SavedWeaponComb[InCombinationType][self.CombinationIndex]) + elseif CombinationList and CombinationList[self.CombinationIndex] then + self:UpdateWeapons(CombinationList[self.CombinationIndex]) + end + +end + +function WB_WeaponSelectItem:UpdateWeaponComb() + local WeaponComb = ArchiveDataConfig.GetPlayerArchiveDataFromType(UGCSystemLibrary.GetLocalPlayerKey(), ArchiveDataConfig.EArchiveType.WeaponCombs) + if WeaponComb and WeaponComb[self.CombinationType] and WeaponComb[self.CombinationType][self.CombinationIndex] then + local TargetWeaponComb = WeaponComb[self.CombinationType][self.CombinationIndex] + if self.Weapons == nil or TargetWeaponComb[1] ~= self.Weapons[1] or TargetWeaponComb[2] ~= self.Weapons[2] then + self:UpdateWeapons(TargetWeaponComb) + end + end +end + +function WB_WeaponSelectItem:UpdateWeapons(InWeapons) + self.Weapons = table.DeepCopy(InWeapons) + if self.Weapons then + self.WeaponInfo1:SetWeaponID(self.Weapons[1]) + if self.Weapons[2] then + self.WeaponInfo2:SetWeaponID(self.Weapons[2]) + self.WeaponInfo2:SetVisWeaponInfo(true) + else + self.WeaponInfo2:SetVisWeaponInfo(false) + end + self:SetVisibility(ESlateVisibility.SelfHitTestInvisible) + else + self:SetVisibility(ESlateVisibility.Collapsed) + end +end + +function WB_WeaponSelectItem:GetCombinationIndex() + return self.CombinationIndex +end + +function WB_WeaponSelectItem:SelectWeaponCombination() + if self.SelectCallBackFunc then + if self.SelectCallBackObj then + self.SelectCallBackFunc(self.SelectCallBackObj, self:GetCombinationIndex()) + else + self.SelectCallBackFunc(self:GetCombinationIndex()) + end + end +end + +function WB_WeaponSelectItem:BindSelectCallBack(InFunc, InObj) + self.SelectCallBackFunc = InFunc + self.SelectCallBackObj = InObj +end + +function WB_WeaponSelectItem:SetSelect(IsSelect) + if IsSelect then + self.Image_IsSelect:SetVisibility(ESlateVisibility.SelfHitTestInvisible) + else + self.Image_IsSelect:SetVisibility(ESlateVisibility.Collapsed) + end +end + +return WB_WeaponSelectItem; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/SelectWeapon/SaveCustomWeaponItem/WB_SaveWeaponItem.lua b/CounterAttack_Solo/Script/UI/SelectWeapon/SaveCustomWeaponItem/WB_SaveWeaponItem.lua new file mode 100644 index 00000000..a3800f67 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/SelectWeapon/SaveCustomWeaponItem/WB_SaveWeaponItem.lua @@ -0,0 +1,194 @@ +---@class WB_SaveWeaponItem_C:UUserWidget +---@field CanvasPanel_SelectPartsPanel UCanvasPanel +---@field CanvasPanel_WeaponInfo UCanvasPanel +---@field HorizontalBox_Part UHorizontalBox +---@field Image_IsSelect UImage +---@field Image_WeaponIcon UImage +---@field NewButton_Select UNewButton +---@field ScrollBox_SelectParts UScrollBox +---@field TextBlock_WeaponName UTextBlock +--Edit Below-- +local WB_SaveWeaponItem = { + bInitDoOnce = false; + PartTypeToPartItem = {}; + IsSelected = false; +}; + +--[==[ Construct +function WB_SaveWeaponItem:Construct() + +end +-- Construct ]==] + +-- function WB_SaveWeaponItem:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_SaveWeaponItem:Destruct() + +-- end + +function WB_SaveWeaponItem:LuaInit() + if self.bInitDoOnce then + return; + end + self.bInitDoOnce = true; + WidgetLibrary.BindButtonClicked(self.NewButton_Select, self.ClickSelect, self) + + -- 设置配件类型 + for i = 1, self.HorizontalBox_Part:GetChildrenCount() do + local Item = self.HorizontalBox_Part:GetChildAt(i - 1) + Item:LuaInit() + Item:SetPartType(PartTypeDisplayOrder[i]) + Item:BindSelectCallBack(self.ClickPart, self) + if PartTypeDisplayOrder[i] then + self.PartTypeToPartItem[PartTypeDisplayOrder[i]] = Item + end + end + for i = 1, self.ScrollBox_SelectParts:GetChildrenCount() do + local Item = self.ScrollBox_SelectParts:GetChildAt(i - 1) + Item:LuaInit() + Item:SetSelectStyle(1) + Item:BindSelectCallBack(self.ClickSelectPart, self) + end +end + +function WB_SaveWeaponItem:SetIndex(InIndex) + self.Index = InIndex + self:LuaInit() +end + +function WB_SaveWeaponItem:GetIndex() + return self.Index +end + +function WB_SaveWeaponItem:BindClickSelect(Func, Obj) + self.SelectCallBackFunc = Func + self.SelectCallBackObj = Obj +end + +function WB_SaveWeaponItem:ClickSelect() + -- UGCLogSystem.Log("[WB_BuffSelectItem_ClickSelect]") + if self.SelectCallBackFunc then + if self.SelectCallBackObj then + self.SelectCallBackFunc(self.SelectCallBackObj, self:GetIndex()) + else + self.SelectCallBackFunc(self:GetIndex()) + end + end +end + +function WB_SaveWeaponItem:SetSelect(IsSelect) + if self.IsSelected ~= IsSelect then + self.IsSelected = IsSelect + if IsSelect then + self.Image_IsSelect:SetVisibility(ESlateVisibility.SelfHitTestInvisible); + self.CanvasPanel_SelectPartsPanel:SetVisibility(ESlateVisibility.SelfHitTestInvisible); + else + self.Image_IsSelect:SetVisibility(ESlateVisibility.Collapsed); + self.CanvasPanel_SelectPartsPanel:SetVisibility(ESlateVisibility.Collapsed); + -- self:SetSelectPartType(nil) + end + end +end + +function WB_SaveWeaponItem:GetWeaponID() + return self.WeaponID +end + +function WB_SaveWeaponItem:SetWeaponID(WeaponID) + if self.WeaponID ~= WeaponID then + self.WeaponID = WeaponID + local WeaponParts = MyWeaponSystem.GetWeaponBastParts(self.WeaponID) + local CustomWeaponParts = ArchiveDataConfig.GetPlayerArchiveDataFromType(UGCSystemLibrary.GetLocalPlayerKey(), ArchiveDataConfig.EArchiveType.CustomWeaponParts) + if CustomWeaponParts and CustomWeaponParts[self.WeaponID] then + WeaponParts = CustomWeaponParts[self.WeaponID] + end + local WeaponPartsMap = MyWeaponSystem.PartListToPartMap(WeaponParts) + local UpdateSelectPartsOnce = false + for i = 1, self.HorizontalBox_Part:GetChildrenCount() do + local Item = self.HorizontalBox_Part:GetChildAt(i - 1) + local PartType = Item:GetPartType() + local ItemID = WeaponPartsMap[PartType] + Item:SetItemID(ItemID) + -- 设置当前默认选择的Part + if ItemID and not UpdateSelectPartsOnce then + UpdateSelectPartsOnce = true + self:SetSelectPartType(PartType) + end + end + if not UpdateSelectPartsOnce then + self:SetSelectPartType(nil) + end + + MyWeaponSystem.AsyncLoadItemBigIconToBrush(self.WeaponID, self.Image_WeaponIcon) + self.TextBlock_WeaponName:SetText(MyWeaponSystem.GetItemName(self.WeaponID)) + end +end + +function WB_SaveWeaponItem:SetVisWeaponInfo(IsVis) + if IsVis then + self.CanvasPanel_WeaponInfo:SetVisibility(ESlateVisibility.HitTestInvisible) + else + self.CanvasPanel_WeaponInfo:SetVisibility(ESlateVisibility.Hidden) + end +end + +function WB_SaveWeaponItem:ClickPart(PartID) + if self.IsSelected then + local PartType = MyWeaponSystem.GetPartType(PartID) + self:SetSelectPartType(PartType) + else + self:ClickSelect() + end +end + +--- 设置选择修改的类型 +function WB_SaveWeaponItem:SetSelectPartType(InPartType) + UGCLogSystem.Log("[WB_SaveWeaponItem_SetSelectPartType] InPartType:%s", tostring(InPartType)) + self.SelectPartType = InPartType + local ItemID = -1 + if self.PartTypeToPartItem[InPartType] then + ItemID = self.PartTypeToPartItem[InPartType]:GetItemID() + end + local Parts = MyWeaponSystem.GetWeaponCanUsePartFromPartType(self.WeaponID, InPartType) + for i = 1, self.ScrollBox_SelectParts:GetChildrenCount() do + local Item = self.ScrollBox_SelectParts:GetChildAt(i - 1) + Item:SetItemID(Parts[i]) + Item:SetIsSelect(ItemID == Parts[i]) + end + for i = 1, self.HorizontalBox_Part:GetChildrenCount() do + local Item = self.HorizontalBox_Part:GetChildAt(i - 1) + Item:SetIsSelect(InPartType == Item:GetPartType()) + end +end + +--- 修改显示的配件 +function WB_SaveWeaponItem:ClickSelectPart(PartID) + UGCLogSystem.Log("[WB_SaveWeaponItem_ClickSelectPart] PartID:%s", tostring(PartID)) + local PartType = MyWeaponSystem.GetPartType(PartID) + local PartItem = self.PartTypeToPartItem[PartType] + if PartItem then + PartItem:SetItemID(PartID) + -- 设置已选择 + for i = 1, self.ScrollBox_SelectParts:GetChildrenCount() do + local Item = self.ScrollBox_SelectParts:GetChildAt(i - 1) + Item:SetIsSelect(PartID == Item:GetItemID()) + end + end +end + +--- 获取当前修改后的配件信息 +function WB_SaveWeaponItem:GetAllParts() + local Res = {} + for i = 1, self.HorizontalBox_Part:GetChildrenCount() do + local Item = self.HorizontalBox_Part:GetChildAt(i - 1) + local ItemID = Item:GetItemID() + if ItemID and MyWeaponSystem.IsWeaponPartValid(ItemID) then + Res[#Res + 1] = ItemID + end + end + return Res +end + +return WB_SaveWeaponItem; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/SelectWeapon/SaveCustomWeaponItem/WB_SelectSaveWeapon.lua b/CounterAttack_Solo/Script/UI/SelectWeapon/SaveCustomWeaponItem/WB_SelectSaveWeapon.lua new file mode 100644 index 00000000..5cff5153 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/SelectWeapon/SaveCustomWeaponItem/WB_SelectSaveWeapon.lua @@ -0,0 +1,74 @@ +---@class WB_SelectSaveWeapon_C:UUserWidget +---@field Image_Weapon UImage +---@field NewButton_Weapon UNewButton +---@field TextBlock_WeaponName UTextBlock +---@field WidgetSwitcher_IsSelect UWidgetSwitcher +--Edit Below-- +local WB_SelectSaveWeapon = { bInitDoOnce = false } + +--[==[ Construct +function WB_SelectSaveWeapon:Construct() + +end +-- Construct ]==] + +-- function WB_SelectSaveWeapon:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_SelectSaveWeapon:Destruct() + +-- end + +function WB_SelectSaveWeapon:LuaInit() + if self.bInitDoOnce then + return; + end + self.bInitDoOnce = true; + WidgetLibrary.BindButtonClicked(self.NewButton_Weapon, self.ClickSelect, self) + self.NewButton_Weapon:SetTouchMethod(EButtonTouchMethod.PreciseTap) +end + +function WB_SelectSaveWeapon:SetIndex(InIndex) + self.Index = InIndex +end + +function WB_SelectSaveWeapon:GetIndex() + return self.Index +end + +function WB_SelectSaveWeapon:BindClickSelect(Func, Obj) + self.SelectCallBackFunc = Func + self.SelectCallBackObj = Obj +end + +function WB_SelectSaveWeapon:ClickSelect() + if self.SelectCallBackFunc then + if self.SelectCallBackObj then + self.SelectCallBackFunc(self.SelectCallBackObj, self:GetIndex()) + else + self.SelectCallBackFunc(self:GetIndex()) + end + end +end + +function WB_SelectSaveWeapon:SetSelect(IsSelect) + if IsSelect then + self.WidgetSwitcher_IsSelect:SetActiveWidgetIndex(1); + else + self.WidgetSwitcher_IsSelect:SetActiveWidgetIndex(0); + end +end + +function WB_SelectSaveWeapon:SetWeaponID(InWeaponID) + self:LuaInit() + self.WeaponID = InWeaponID + MyWeaponSystem.AsyncLoadItemWhiteIconToBrush(self.WeaponID, self.Image_Weapon) + self.TextBlock_WeaponName:SetText(MyWeaponSystem.GetItemName(self.WeaponID)) +end + +function WB_SelectSaveWeapon:GetWeaponID() + return self.WeaponID +end + +return WB_SelectSaveWeapon \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/SelectWeapon/SaveCustomWeaponItem/WB_WeaponType.lua b/CounterAttack_Solo/Script/UI/SelectWeapon/SaveCustomWeaponItem/WB_WeaponType.lua new file mode 100644 index 00000000..6eaae711 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/SelectWeapon/SaveCustomWeaponItem/WB_WeaponType.lua @@ -0,0 +1,72 @@ +---@class WB_WeaponType_C:UUserWidget +---@field NewButton_WeaponType UNewButton +---@field TextBlock_WeaponTypeName UTextBlock +---@field TextBlock_WeaponTypeName2 UTextBlock +---@field WidgetSwitcher_IsSelect UWidgetSwitcher +---@field WidgetSwitcher_Parity UWidgetSwitcher +--Edit Below-- +local WB_WeaponType = { bInitDoOnce = false } + +--[==[ Construct +function WB_WeaponType:Construct() + +end +-- Construct ]==] + +-- function WB_WeaponType:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_WeaponType:Destruct() + +-- end + +function WB_WeaponType:LuaInit() + if self.bInitDoOnce then + return; + end + self.bInitDoOnce = true; + WidgetLibrary.BindButtonClicked(self.NewButton_WeaponType, self.ClickSelect, self) +end + +function WB_WeaponType:SetIndex(InIndex) + self:LuaInit() + self.Index = InIndex + local WeaponCombType = UGCGameSystem.GameState:GetPlayerWeaponCombination(UGCSystemLibrary.GetLocalPlayerKey()) + self.WidgetSwitcher_Parity:SetActiveWidgetIndex(self.Index % 2) + local PlayerCustomWeaponInfo = WeaponSelectionCombinationConfig.PlayerCustomWeapon[WeaponCombType][InIndex] + if PlayerCustomWeaponInfo then + self.TextBlock_WeaponTypeName:SetText(PlayerCustomWeaponInfo.TypeName) + self.TextBlock_WeaponTypeName2:SetText(PlayerCustomWeaponInfo.TypeName) + end +end + +function WB_WeaponType:GetIndex() + return self.Index +end + +function WB_WeaponType:BindClickSelect(Func, Obj) + self.SelectCallBackFunc = Func + self.SelectCallBackObj = Obj +end + +function WB_WeaponType:ClickSelect() + if self.SelectCallBackFunc then + if self.SelectCallBackObj then + self.SelectCallBackFunc(self.SelectCallBackObj, self:GetIndex()) + else + self.SelectCallBackFunc(self:GetIndex()) + end + end +end + +function WB_WeaponType:SetSelect(IsSelect) + if IsSelect then + self.WidgetSwitcher_IsSelect:SetActiveWidgetIndex(1); + else + self.WidgetSwitcher_IsSelect:SetActiveWidgetIndex(0); + end +end + + +return WB_WeaponType \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/SelectWeapon/WB_CustomWeapon.lua b/CounterAttack_Solo/Script/UI/SelectWeapon/WB_CustomWeapon.lua new file mode 100644 index 00000000..196bb88c --- /dev/null +++ b/CounterAttack_Solo/Script/UI/SelectWeapon/WB_CustomWeapon.lua @@ -0,0 +1,296 @@ +---@class WB_CustomWeapon_C:UUserWidget +---@field HorizontalBox_WeaponType UHorizontalBox +---@field NewButton_Close UNewButton +---@field NewButton_Reset UNewButton +---@field NewButton_Save UNewButton +---@field UniformGridPanel_SelectWeapon UUniformGridPanel +---@field VerticalBox_WeaponSocket UVerticalBox +--Edit Below-- +local WB_CustomWeapon = { + bInitDoOnce = false; + WeaponCombType = -1; + WeaponComb = {}; -- {WeaponID1, WeaponID2 + SelectSaveWeaponItemCol = 4; + WeaponSocketItems = {}; + IsChange = false; +} + + +function WB_CustomWeapon:Construct() + if GlobalConfigs.GameSetting.CanCustomWeapon then + self:LuaInit() + end +end + +function WB_CustomWeapon:LuaInit() + if self.bInitDoOnce then + return; + end + self.bInitDoOnce = true; + + UGCLogSystem.Log("[WB_CustomWeapon_LuaInit]") + + -- 按键初始化 + WidgetLibrary.BindButtonClicked(self.NewButton_Reset, self.ResetWeaponComb, self) + WidgetLibrary.BindButtonClicked(self.NewButton_Save, self.SaveWeaponComb, self) + WidgetLibrary.BindButtonClicked(self.NewButton_Close, self.ClickClose, self) + UGCEventSystem.AddListener(EventEnum.PlayerWeaponCombinationUpdate, self.InitItem, self) + + -- 初始化Item + self:InitItem() + UGCLogSystem.Log("[WB_CustomWeapon_LuaInit] Finish") +end + +function WB_CustomWeapon:OnShowPanel(ProgrammeIndex) + UGCLogSystem.Log("[WB_CustomWeapon_OnShowPanel]") + -- 设置配置索引 + self:SetProgrammeIndex(ProgrammeIndex) + UGCLogSystem.Log("[WB_CustomWeapon_OnShowPanel] Finish") +end + +function WB_CustomWeapon:InitItem() + local LocalPC = UGCSystemLibrary.GetLocalPlayerController() + local WeaponCombType = UGCGameSystem.GameState:GetPlayerWeaponCombination(LocalPC.PlayerKey) + if WeaponCombType == self.WeaponCombType then return end + self.WeaponCombType = WeaponCombType + + -- 武器类型中最大可选择的的武器数量 + local MaxSelectItemCount = 0 + + -- 武器类型选择的Item在水平框中的对齐方式 + local WeaponTypeSlateChildSize = UE.CreateStruct("SlateChildSize"); + WeaponTypeSlateChildSize.SizeRule = ESlateSizeRule.Fill + + for i, v in pairs(WeaponSelectionCombinationConfig.PlayerCustomWeapon[WeaponCombType]) do + -- 设置一下最大的选择武器Item数量 + MaxSelectItemCount = math.max(MaxSelectItemCount, #v.WeaponIDs) + -- 加载图片 + for _, WeaponID in pairs(v.WeaponIDs) do + -- 加载剪影 + MyWeaponSystem.AsyncLoadItemWhiteIconToBrush(WeaponID) + -- 加载大图 + MyWeaponSystem.AsyncLoadItemBigIconToBrush(WeaponID) + end + -- 初始化武器类型 + local WeaponTypeItem = nil + if self.HorizontalBox_WeaponType:GetChildrenCount() < i then + WeaponTypeItem = UserWidget.NewWidgetObjectBP(LocalPC, self:GetWeaponTypeItemClass()); + self.HorizontalBox_WeaponType:AddChild(WeaponTypeItem) + -- 设置对齐方式 + local TargetHorizontalBoxSlot = WidgetLayoutLibrary.SlotAsHorizontalBoxSlot(WeaponTypeItem) + TargetHorizontalBoxSlot:SetSize(WeaponTypeSlateChildSize) + else + WeaponTypeItem = self.HorizontalBox_WeaponType:GetChildAt(i - 1) + end + WeaponTypeItem:SetIndex(i) + WeaponTypeItem:BindClickSelect(self.SelectWeaponType, self) + end + + -- 初始化武器槽UI + for i = 1, self.VerticalBox_WeaponSocket:GetChildrenCount() do + local Item = self.VerticalBox_WeaponSocket:GetChildAt(i - 1) + self.WeaponSocketItems[i] = Item + Item:SetIndex(i) + Item:BindClickSelect(self.SelectWeaponSocket, self) + end + -- 初始化武器选择Item + for i = 1, MaxSelectItemCount do + local Item = nil; + if self.UniformGridPanel_SelectWeapon:GetChildrenCount() < i then + Item = UserWidget.NewWidgetObjectBP(LocalPC, self:GetSelectSaveWeaponItemClass()); + self.UniformGridPanel_SelectWeapon:AddChild(Item) + local TargetUniformGridSlot = WidgetLayoutLibrary.SlotAsUniformGridSlot(Item) + -- 居中 + TargetUniformGridSlot:SetVerticalAlignment(EVerticalAlignment.VAlign_Center) + TargetUniformGridSlot:SetHorizontalAlignment(EHorizontalAlignment.HAlign_Center) + -- 设置索引 + TargetUniformGridSlot:SetColumn((i - 1) % self.SelectSaveWeaponItemCol) + TargetUniformGridSlot:SetRow((i - 1) // self.SelectSaveWeaponItemCol) + else + Item = self.UniformGridPanel_SelectWeapon:GetChildAt(i - 1) + Item:SetVisibility(ESlateVisibility.HitTestInvisible) + end + Item:SetIndex(i) + Item:BindClickSelect(self.ClickSelectSaveWeapon, self) + end + UGCLogSystem.Log("[WB_CustomWeapon_InitItem] Finish") +end + + +function WB_CustomWeapon:GetSelectSaveWeaponItemClass() + if self.SelectSaveWeaponClass == nil then + self.SelectSaveWeaponClass = UE.LoadClass(UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/SelectWeapon/SaveCustomWeaponItem/WB_SelectSaveWeapon.WB_SelectSaveWeapon_C')) + end + return self.SelectSaveWeaponClass +end + +function WB_CustomWeapon:GetWeaponTypeItemClass() + if self.WeaponTypeItemClass == nil then + self.WeaponTypeItemClass = UE.LoadClass(UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/SelectWeapon/SaveCustomWeaponItem/WB_WeaponType.WB_WeaponType_C')) + end + return self.WeaponTypeItemClass +end + +--- 设置配置ID +function WB_CustomWeapon:SetProgrammeIndex(InProgrammeIndex) + self.ProgrammeIndex = InProgrammeIndex + local SavedWeaponComb = ArchiveDataConfig.GetPlayerArchiveDataFromType(UGCSystemLibrary.GetLocalPlayerKey(), ArchiveDataConfig.EArchiveType.WeaponCombs) + if SavedWeaponComb and SavedWeaponComb[self.WeaponCombType] and SavedWeaponComb[self.WeaponCombType][self.ProgrammeIndex] then + self.WeaponComb = SavedWeaponComb[self.WeaponCombType][self.ProgrammeIndex] + else + local WeaponCombinationType = UGCGameSystem.GameState:GetPlayerWeaponCombination(UGCSystemLibrary.GetLocalPlayerKey()) + local CombinationList = WeaponSelectionCombinationConfig.WeaponCombinationList[WeaponCombinationType].Weapon + if CombinationList and CombinationList[self.ProgrammeIndex] then + self.WeaponComb = CombinationList[self.ProgrammeIndex] + end + end + for i = #self.WeaponComb, 1, -1 do + self:SetSelectWeapon(i, self.WeaponComb[i], (i == 1)) + end +end + +--- 点击选择插槽 +function WB_CustomWeapon:SelectWeaponSocket(Index) + if self.SelectWeaponSocketID ~= Index then + self.SelectWeaponSocketID = Index + local WeaponSocketItem = self.WeaponSocketItems[self.SelectWeaponSocketID] + if WeaponSocketItem then + self:SetSelectWeapon(self.SelectWeaponSocketID, WeaponSocketItem:GetWeaponID(), true) + end + end +end +--- 点击选择武器类型 +function WB_CustomWeapon:SelectWeaponType(Index) + if self.WeaponTypeIndex ~= Index then + self.WeaponTypeIndex = Index + for i = 1, self.HorizontalBox_WeaponType:GetChildrenCount() do + local WeaponTypeItem = self.HorizontalBox_WeaponType:GetChildAt(i - 1) + WeaponTypeItem:SetSelect(i == self.WeaponTypeIndex) + end + local CustomWeaponInfo = WeaponSelectionCombinationConfig.PlayerCustomWeapon[self.WeaponCombType][self.WeaponTypeIndex] + local SocketWeaponID = -1 + local WeaponSocketItem = self.WeaponSocketItems[self.SelectWeaponSocketID] + if WeaponSocketItem then + SocketWeaponID = WeaponSocketItem:GetWeaponID() + end + if CustomWeaponInfo then + for i = 1, self.UniformGridPanel_SelectWeapon:GetChildrenCount() do + local WeaponID = CustomWeaponInfo.WeaponIDs[i] + local WeaponItem = self.UniformGridPanel_SelectWeapon:GetChildAt(i - 1) + if WeaponID then + WeaponItem:SetWeaponID(WeaponID) + WeaponItem:SetSelect(SocketWeaponID == WeaponID) + WeaponItem:SetVisibility(ESlateVisibility.SelfHitTestInvisible) + else + WeaponItem:SetVisibility(ESlateVisibility.Collapsed) + end + end + end + end +end +--- 点击选择武器 +function WB_CustomWeapon:ClickSelectSaveWeapon(Index) + self.IsChange = true + self:SelectSaveWeapon(Index) +end +function WB_CustomWeapon:SelectSaveWeapon(Index) + local WeaponItem = self.UniformGridPanel_SelectWeapon:GetChildAt(Index - 1) + local WeaponID = WeaponItem:GetWeaponID() + for i = 1, self.UniformGridPanel_SelectWeapon:GetChildrenCount() do + local TempWeaponItem = self.UniformGridPanel_SelectWeapon:GetChildAt(i - 1) + TempWeaponItem:SetSelect(Index == i) + end + self:SetSelectWeapon(self.SelectWeaponSocketID, WeaponID, false) +end + + +--- 设置插槽内的武器 +---@param SocketID uint 插槽的索引 只有1和2 +---@param bUpdateSelectWeaponBar bool 是否更新武器选择栏 +function WB_CustomWeapon:SetSelectWeapon(SocketID, WeaponID, bUpdateSelectWeaponBar) + if bUpdateSelectWeaponBar then + self.SelectWeaponSocketID = SocketID + for i, v in pairs(self.WeaponSocketItems) do + v:SetSelect(i == SocketID) + end + -- 获取武器ID类型和索引 + local CustomWeaponTypeIndex = -1 + local CustomWeaponIndex = -1; + for WeaponTypeIndex, v in pairs(WeaponSelectionCombinationConfig.PlayerCustomWeapon[self.WeaponCombType]) do + -- 加载图片 + for WeaponIndex, TempWeaponID in pairs(v.WeaponIDs) do + if TempWeaponID == WeaponID then + CustomWeaponIndex = WeaponIndex + CustomWeaponTypeIndex = WeaponTypeIndex + end + end + if CustomWeaponTypeIndex > 0 then + break + end + end + -- 更新选择栏 + self:SelectWeaponType(CustomWeaponTypeIndex) + self:SelectSaveWeapon(CustomWeaponIndex) + else + local SocketItem = self.WeaponSocketItems[SocketID] + if SocketItem then + SocketItem:SetWeaponID(WeaponID) + end + end +end + + + +--- 重置武器配置 +function WB_CustomWeapon:ResetWeaponComb() + local WeaponCombinationType = UGCGameSystem.GameState:GetPlayerWeaponCombination(UGCSystemLibrary.GetLocalPlayerKey()) + local CombinationList = WeaponSelectionCombinationConfig.WeaponCombinationList[WeaponCombinationType].Weapon + if CombinationList and CombinationList[self.ProgrammeIndex] then + local Comb = CombinationList[self.ProgrammeIndex] + for i = #Comb, 1, -1 do + self:SetSelectWeapon(i, Comb[i], (i == 1)) + end + end +end + +function WB_CustomWeapon:SaveWeaponComb() + local WeaponComb = {} + local PartsComb = {} + for i, v in pairs(self.WeaponSocketItems) do + WeaponComb[i] = v:GetWeaponID() + PartsComb[i] = v:GetAllParts() + end + UGCLogSystem.LogTree("[WB_CustomWeapon_SaveWeaponComb]WeaponComb:", WeaponComb) + -- 保存操作 + UGCSendRPCSystem.ActorRPCNotify(nil, UGCGameSystem.GameState, "PlayerCustomWeapon", UGCSystemLibrary.GetLocalPlayerKey(), self.ProgrammeIndex, WeaponComb, PartsComb) + -- 关闭UI + self:CloseSelf() +end + +function WB_CustomWeapon:ClickClose() + if self.IsChange then + local SecondaryConfirmationWidget = WidgetManager:GetPanel(WidgetConfig.EUIType.SecondaryConfirmation) + SecondaryConfirmationWidget:SetTextInfo("该配置还未保存,是否保存后关闭页面?", "关闭", "保存") + SecondaryConfirmationWidget:BindCancellationCallBack(self.CloseSelf, self) + SecondaryConfirmationWidget:BindConfirmCallBack(self.SaveWeaponComb, self) + WidgetManager:ShowPanel(WidgetConfig.EUIType.SecondaryConfirmation, false) + else + self:CloseSelf() + end +end + +function WB_CustomWeapon:CloseSelf() + WidgetManager:ClosePanel(WidgetConfig.EUIType.CustomWeapon) + self.IsChange = false +end + + +-- function WB_CustomWeapon:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_CustomWeapon:Destruct() + +-- end + +return WB_CustomWeapon \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/SelectWeapon/WB_ReselectWeaponBtn.lua b/CounterAttack_Solo/Script/UI/SelectWeapon/WB_ReselectWeaponBtn.lua new file mode 100644 index 00000000..c5712e0a --- /dev/null +++ b/CounterAttack_Solo/Script/UI/SelectWeapon/WB_ReselectWeaponBtn.lua @@ -0,0 +1,75 @@ +---@class WB_ReselectWeaponBtn_C:UUserWidget +---@field Button_ReselectWeapon UButton +---@field Image_CD UImage +--Edit Below-- +local WB_ReselectWeaponBtn = { + bInitDoOnce = false; + StartShowTime = -10; + ShowTime = 10; + bIsShowing = false; +}; + + +function WB_ReselectWeaponBtn:Construct() + WidgetLibrary.BindButtonClicked(self.Button_ReselectWeapon, self.ClickBtn, self) + self.LoopCheckDeadShowBtnHandle = UGCEventSystem.SetTimerLoop(self, self.CheckDeadShowBtn, 1) +end + + +function WB_ReselectWeaponBtn:Tick(MyGeometry, InDeltaTime) + if self.bIsShowing then + self:UpdateCooling() + end +end + +function WB_ReselectWeaponBtn:Destruct() + if self.LoopCheckDeadShowBtnHandle then + UGCEventSystem.StopTimer(self.LoopCheckDeadShowBtnHandle) + end +end + +function WB_ReselectWeaponBtn:OnShowPanel() + UGCLogSystem.Log("[WB_ReselectWeaponBtn_OnShowPanel]") + self:ShowBtn() +end + +function WB_ReselectWeaponBtn:ShowBtn() + self.StartShowTime = UGCSystemLibrary.GetGameTime() + self.bIsShowing = true +end + +function WB_ReselectWeaponBtn:CloseBtn() + self.bIsShowing = false + WidgetManager:ClosePanel(WidgetConfig.EUIType.ReselectWeaponBtn) +end + +function WB_ReselectWeaponBtn:UpdateCooling() + local NowTime = UGCSystemLibrary.GetGameTime() + if NowTime - self.StartShowTime > self.ShowTime then + self:CloseBtn() + end + + local Material = self.Image_CD:GetDynamicMaterial(); + local Percent = 1 - (NowTime - self.StartShowTime) / self.ShowTime + Material:SetScalarParameterValue("Mask_Percent", Percent); + -- UGCLogSystem.Log("[WB_ReselectWeaponBtn_UpdateCooling] " 1 - (NowTime - self.StartShowTime) / self.ShowTime) +end + +function WB_ReselectWeaponBtn:ClickBtn() + self:CloseBtn() + WidgetManager:ShowPanel(WidgetConfig.EUIType.WeaponSelect) +end + +function WB_ReselectWeaponBtn:CheckDeadShowBtn() + local LocalPawn = UGCSystemLibrary.GetLocalPlayerPawn() + if not UE.IsValid(LocalPawn) or UGCPawnSystem.HasPawnState(LocalPawn, EPawnState.Dead) then + self:SetVisibility(ESlateVisibility.SelfHitTestInvisible) + else + local NowTime = UGCSystemLibrary.GetGameTime() + if NowTime - self.StartShowTime > self.ShowTime then + self:CloseBtn() + end + end +end + +return WB_ReselectWeaponBtn; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/SelectWeapon/WB_WeaponSelect.lua b/CounterAttack_Solo/Script/UI/SelectWeapon/WB_WeaponSelect.lua new file mode 100644 index 00000000..1df29d2e --- /dev/null +++ b/CounterAttack_Solo/Script/UI/SelectWeapon/WB_WeaponSelect.lua @@ -0,0 +1,144 @@ +---@class WB_WeaponSelect_C:UUserWidget +---@field Button_Custom UNewButton +---@field Button_Select UNewButton +---@field ScrollBox_Weapons UScrollBox +---@field TextBlock_Time UTextBlock +---@field UniformGridPanel_OtherParts UUniformGridPanel +--Edit Below-- +local WB_WeaponSelect = { + bInitDoOnce = false; + CombinationType = 1; + ShowTime = 0; + SelectWeaponIndex = 1; + OtherPartsItemColNum = 6; +}; + +function WB_WeaponSelect:Construct() + UGCEventSystem.AddListener(EventEnum.PlayerWeaponCombinationUpdate, self.UpdateWeaponCombination, self) + WidgetLibrary.BindButtonClicked(self.Button_Select, self.SelectWeapon, self) + self:UpdateWeaponCombination() + -- 判断是否可以修改配置 + if GlobalConfigs.GameSetting.CanCustomWeapon then + WidgetLibrary.BindButtonClicked(self.Button_Custom, self.CustomWeaponComb, self) + else + self.Button_Custom:SetVisibility(ESlateVisibility.Collapsed) + end +end + +function WB_WeaponSelect:OnShowPanel() + if self.SelectTimeHandle then + UGCEventSystem.StopTimer(self.SelectTimeHandle) + end + self.ShowTime = GlobalConfigs.GameSetting.WeaponSelectTime + self.TextBlock_Time:SetText(self.ShowTime) + self.SelectTimeHandle = UGCEventSystem.SetTimerLoop(self, self.SelectTimeClock, 1) +end + +function WB_WeaponSelect:SelectTimeClock() + self.ShowTime = self.ShowTime - 1 + if self.ShowTime <= 0 then + UGCEventSystem.StopTimer(self.SelectTimeHandle) + self.SelectTimeHandle = nil + WidgetManager:ClosePanel(WidgetConfig.EUIType.WeaponSelect) + else + self.TextBlock_Time:SetText(self.ShowTime) + end +end + +function WB_WeaponSelect:GetWeaponItemClass() + if self.ItemClass == nil then + self.ItemClass = UE.LoadClass(UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/SelectWeapon/Item/WB_WeaponSelectItem.WB_WeaponSelectItem_C')) + end + return self.ItemClass +end + +function WB_WeaponSelect:GetOtherPartItemClass() + if self.OtherItemClass == nil then + self.OtherItemClass = UE.LoadClass(UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/SelectWeapon/Item/WB_OtherPartItem.WB_OtherPartItem_C')) + end + return self.OtherItemClass +end + + + + +function WB_WeaponSelect:UpdateWeaponCombination() + local WeaponCombinationType = UGCGameSystem.GameState:GetPlayerWeaponCombination(UGCSystemLibrary.GetLocalPlayerKey()) + if WeaponCombinationType ~= self.WeaponCombinationType then + UGCLogSystem.Log("[WB_WeaponSelect_UpdateWeaponCombination] LastWeaponCombinationType:%s, NowWeaponCombinationType:%s", tostring(self.WeaponCombinationType), tostring(WeaponCombinationType)) + self.WeaponCombinationType = WeaponCombinationType + local WeaponCombinationInfo = WeaponSelectionCombinationConfig.WeaponCombinationList[WeaponCombinationType] + for i = 1, self.ScrollBox_Weapons:GetChildrenCount() do + local Item = self.ScrollBox_Weapons:GetChildAt(i - 1) + Item:Init(WeaponCombinationType, i) + end + for i = self.ScrollBox_Weapons:GetChildrenCount() + 1, #WeaponCombinationInfo.Weapon do + local Item = UserWidget.NewWidgetObjectBP(UGCSystemLibrary.GetLocalPlayerController(), self:GetWeaponItemClass()); + if Item then + self.ScrollBox_Weapons:AddChild(Item) + Item:Init(WeaponCombinationType, i) + Item:BindSelectCallBack(self.SelectWeaponItem, self) + end + end + + for i = #WeaponCombinationInfo.Weapon, self.ScrollBox_Weapons:GetChildrenCount() - 1 do + local Item = self.ScrollBox_Weapons:GetChildAt(i) + Item:SetVisibility(ESlateVisibility.Collapsed) + end + + for i, ItemInfo in pairs(WeaponCombinationInfo.OtherParts) do + local Item + if self.UniformGridPanel_OtherParts:GetChildrenCount() < i then + Item = UserWidget.NewWidgetObjectBP(UGCSystemLibrary.GetLocalPlayerController(), self:GetOtherPartItemClass()); + self.UniformGridPanel_OtherParts:AddChild(Item) + local TargetUniformGridSlot = WidgetLayoutLibrary.SlotAsUniformGridSlot(Item) + -- 居中 + TargetUniformGridSlot:SetVerticalAlignment(EVerticalAlignment.VAlign_Center) + TargetUniformGridSlot:SetHorizontalAlignment(EHorizontalAlignment.HAlign_Center) + -- 设置索引 + TargetUniformGridSlot:SetColumn((i - 1) % self.OtherPartsItemColNum) + TargetUniformGridSlot:SetRow((i - 1) // self.OtherPartsItemColNum) + else + Item = self.UniformGridPanel_OtherParts:GetChildAt(i - 1) + Item:SetVisibility(ESlateVisibility.HitTestInvisible) + end + Item:SetItemID(ItemInfo.ItemID, ItemInfo.Count) + end + + for i = #WeaponCombinationInfo.OtherParts, self.UniformGridPanel_OtherParts:GetChildrenCount() - 1 do + local Item = self.UniformGridPanel_OtherParts:GetChildAt(i) + Item:SetVisibility(ESlateVisibility.Collapsed) + end + + + self:SelectWeaponItem(1) + end +end + +function WB_WeaponSelect:SelectWeaponItem(InIndex) + self.SelectWeaponIndex = InIndex + for i = 1, self.ScrollBox_Weapons:GetChildrenCount() do + local Item = self.ScrollBox_Weapons:GetChildAt(i - 1) + Item:SetSelect(Item:GetCombinationIndex() == InIndex) + end +end + +function WB_WeaponSelect:SelectWeapon() + UGCSendRPCSystem.ActorRPCNotify(nil, UGCGameSystem.GameState, "PlayerSelectWeaponIndex", UGCSystemLibrary.GetLocalPlayerKey(), self.SelectWeaponIndex) + WidgetManager:ClosePanel(WidgetConfig.EUIType.WeaponSelect) +end + +function WB_WeaponSelect:CustomWeaponComb() + WidgetManager:ShowPanel(WidgetConfig.EUIType.CustomWeapon, false, self.SelectWeaponIndex) + WidgetManager:ClosePanel(WidgetConfig.EUIType.WeaponSelect) +end + +-- function WB_WeaponSelect:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_WeaponSelect:Destruct() + +-- end + +return WB_WeaponSelect; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/Settlement/WB_Settlement.lua b/CounterAttack_Solo/Script/UI/Settlement/WB_Settlement.lua new file mode 100644 index 00000000..adcba210 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/Settlement/WB_Settlement.lua @@ -0,0 +1,96 @@ +---@class WB_Settlement_C:UUserWidget +---@field ShowAnim UWidgetAnimation +---@field Button_AutoReturnToLobby UButton +---@field Button_share UButton +---@field Image_Left UImage +---@field Image_Right UImage +---@field TextBlock_AttackMVPName UTextBlock +---@field TextBlock_AutoReturnToLobby UTextBlock +---@field TextBlock_DefendMVPName UTextBlock +---@field VerticalBox_Left UVerticalBox +--Edit Below-- +---@type WB_TeamSettlement_C +local WB_Settlement = { + bInitDoOnce = false; + LeftTeamType = 1; + RightTeamType = 2; +}; + +function WB_Settlement:Construct() + --UGCEventSystem.AddListener(EventEnum.UpdatePlayerScoreData, self.UpdateRank, self); + + WidgetLibrary.BindButtonClicked(self.Button_AutoReturnToLobby, self.Button_AutoReturnToLobby_OnClicked, self) + WidgetLibrary.BindButtonClicked(self.Button_share, self.ShareSettlement, self) + + +end + +function WB_Settlement:OnShowPanel() + self:AutoReturnToLobby() + self:UpdateRank() + UGCEventSystem.AddListener(EventEnum.UpdatePlayerScoreData, self.UpdateRank, self) +end + + + +function WB_Settlement:UpdateRank() + + UGCLogSystem.LogTree("[WB_TeamSettlement_UpdateRank] PlayerScoreDatas", PlayerScoreSystem.GetPlayerScoreDatas()) + local RankData = PlayerScoreSystem.GetRank() + UGCLogSystem.LogTree("[WB_TeamSettlement_UpdateRank]", RankData) + + for i = 0, self.VerticalBox_Left:GetChildrenCount() - 1 do + local ItemLeftInst = self.VerticalBox_Left:GetChildAt(i) + local PlayerKeyLeft = RankData[i + 1] + if PlayerKeyLeft then + ItemLeftInst:SetVisibility(ESlateVisibility.SelfHitTestInvisible) + ItemLeftInst:InitRankInfo(PlayerKeyLeft, i + 1) + else + ItemLeftInst:SetVisibility(ESlateVisibility.Collapsed) + end + end + + local AttackMVPPlayerKey = UGCGameSystem.GameState:GetAttackMVP() + local DefendMVPPlayerKey = UGCGameSystem.GameState:GetDefendMVP() + + self.TextBlock_AttackMVPName:SetText(UGCGameSystem.GameState:GetPlayerNameByPlayerKey(AttackMVPPlayerKey)) + self.TextBlock_DefendMVPName:SetText(UGCGameSystem.GameState:GetPlayerNameByPlayerKey(DefendMVPPlayerKey)) + + self:PlayAnimation(self.ShowAnim, 0, 1, EUMGSequencePlayMode.Forward, 1.0) +end + +function WB_Settlement:AutoReturnToLobby() + self.DelayReturnToLobbyTime = GlobalConfigs.GameSetting.DelayReturnToLobbyTime + self.SettlementTime = KismetSystemLibrary.GetGameTimeInSeconds(self) + self.DelayReturnToLobbyTimerHandle = UGCEventSystem.SetTimerLoop( + self, + function () + local NowTime = KismetSystemLibrary.GetGameTimeInSeconds(self) + local ShowTime = math.floor(self.DelayReturnToLobbyTime - (NowTime - self.SettlementTime)) + ShowTime = ShowTime >= 0 and ShowTime or 0 + self.TextBlock_AutoReturnToLobby:SetText(string.format("返回大厅(%ds)", ShowTime)) + if ShowTime <= 0 then self:Button_AutoReturnToLobby_OnClicked() end + end, + 0.5 + ) +end + +function WB_Settlement:Button_AutoReturnToLobby_OnClicked() + if UGCGameSystem.GameState.GameStateType ~= CustomEnum.EGameState.End then return end + if self == nil or self.DoOnceReturnToLobby then return end + if self.DelayReturnToLobbyTimerHandle then + UGCEventSystem.StopTimer(self.DelayReturnToLobbyTimerHandle) + self.DelayReturnToLobbyTimerHandle = nil + end + self.DoOnceReturnToLobby = true + UGCGameSystem.ReturnToLobby() + --UGCMultiMode.ReqesetMatch(PlacementModeConfig.PlaceModeID) + UGCLogSystem.Log("[WB_TeamSettlement_Button_AutoReturnToLobby_OnClicked]") +end + +--- 分享战绩 +function WB_Settlement:ShareSettlement() + UGCWidgetManagerSystem.Share(); +end + +return WB_Settlement; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/Settlement/WB_SettlementItem.lua b/CounterAttack_Solo/Script/UI/Settlement/WB_SettlementItem.lua new file mode 100644 index 00000000..1435fa42 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/Settlement/WB_SettlementItem.lua @@ -0,0 +1,71 @@ +---@class WB_SettlementItem_C:UUserWidget +---@field ShowAnim UWidgetAnimation +---@field ShowDefensiveSuccess UWidgetAnimation +---@field Button_Result_AddFriend UButton +---@field Image_PlayerIcon UImage +---@field TextBlock_BreakThrough UTextBlock +---@field TextBlock_K UTextBlock +---@field TextBlock_PlayerName UTextBlock +---@field TextBlock_RankNum UTextBlock +---@field TextBlock_Score UTextBlock +---@field WidgetSwitcher_IsLocalPlayer UWidgetSwitcher +--Edit Below-- +---@type WB_SettlementItem_C +local WB_SettlementItem = { + bInitDoOnce = false; + PlayerKey = -1; + bDefendSucceed = false; +}; + +function WB_SettlementItem:LuaInit() + if self.bInitDoOnce then + return; + end + self.bInitDoOnce = true; + WidgetLibrary.BindButtonClicked(self.Button_Result_AddFriend, self.AddFriend, self) +end + + +function WB_SettlementItem:InitRankInfo(InPlayerKey, RankNum) + UGCLogSystem.Log("[WB_SettlementItem_InitRankInfo]") + self:LuaInit() + self.PlayerKey = InPlayerKey + if self.PlayerKey == UGCSystemLibrary.GetLocalPlayerKey() then + self.WidgetSwitcher_IsLocalPlayer:SetActiveWidgetIndex(1) + self.Button_Result_AddFriend:SetVisibility(ESlateVisibility.Collapsed) + else + self.WidgetSwitcher_IsLocalPlayer:SetActiveWidgetIndex(0) + end + + local PlayerName = UGCGameSystem.GameState:GetPlayerNameByPlayerKey(self.PlayerKey); + + self.TextBlock_RankNum:SetText(tostring(RankNum)); + self.TextBlock_PlayerName:SetText(PlayerName); + self.TextBlock_Score:SetText(tostring(PlayerScoreSystem.GetPlayerScore(InPlayerKey))) + self.TextBlock_K:SetText(tostring(PlayerScoreSystem.GetPlayerScoreDataFromType(InPlayerKey, PlacementModeConfig.AddScoreType.KillAddScore))) + self.TextBlock_BreakThrough:SetText(tostring(PlayerScoreSystem.GetPlayerScoreDataFromType(InPlayerKey, PlacementModeConfig.AddScoreType.EnterDefenseLineAddScore))) + + self.bDefendSucceed = PlayerScoreSystem.GetPlayerScoreDataFromType(InPlayerKey, PlacementModeConfig.AddScoreType.DefendSucceedAddScore) > 0 + + UGCSystemLibrary.DownloadImageToUImage(self.Image_PlayerIcon, UGCGameSystem.GameState:GetHeadIconByPlayerKey(self.PlayerKey)); + UGCEventSystem.SetTimer(self, self.ShowPanelAnim, 0.5 + RankNum * 0.3) +end + +function WB_SettlementItem:ShowPanelAnim() + UGCLogSystem.Log("[WB_SettlementItem_ShowPanelAnim]") + self:PlayAnimation(self.ShowAnim, 0, 1, EUMGSequencePlayMode.Forward, 1.0) + if self.bDefendSucceed then + UGCEventSystem.SetTimer(self, function() + self:PlayAnimation(self.ShowDefensiveSuccess, 0, 1, EUMGSequencePlayMode.Forward, 1.0) + end, 1) + end +end + +function WB_SettlementItem:AddFriend() + local TargetPlayerData = UGCGameSystem.GameState.PlayerPersonalInfos[self.PlayerKey] + if TargetPlayerData then + UGCGameSystem.AddFriend(TargetPlayerData.UID) + end +end + +return WB_SettlementItem; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/Settlement/WB_TeamSettlement.lua b/CounterAttack_Solo/Script/UI/Settlement/WB_TeamSettlement.lua new file mode 100644 index 00000000..708398f7 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/Settlement/WB_TeamSettlement.lua @@ -0,0 +1,145 @@ +---@class WB_TeamSettlement_C:UUserWidget +---@field Button_AutoReturnToLobby UButton +---@field Button_share UButton +---@field CanvasPanel_Result UCanvasPanel +---@field Image_Left UImage +---@field Image_Right UImage +---@field Image_titlebg UImage +---@field TextBlock_AutoReturnToLobby UTextBlock +---@field TextBlock_LeftName UTextBlock +---@field TextBlock_LeftScore UTextBlock +---@field TextBlock_Levels2_2 UTextBlock +---@field TextBlock_RightName UTextBlock +---@field TextBlock_RightScore UTextBlock +---@field UIParticleEmitter_95 UUIParticleEmitter +---@field VerticalBox_Left UVerticalBox +---@field VerticalBox_Right UVerticalBox +---@field WidgetSwitcher_Win UWidgetSwitcher +--Edit Below-- +local WB_TeamSettlement = { + bInitDoOnce = false; + LeftTeamType = 1; + RightTeamType = 2; +}; + +function WB_TeamSettlement:Construct() + --UGCEventSystem.AddListener(EventEnum.UpdatePlayerScoreData, self.UpdateRank, self); + --UGCEventSystem.AddListener(EventEnum.UpdatePlayerRank, self.UpdateRank, self); + + WidgetLibrary.BindButtonClicked(self.Button_AutoReturnToLobby, self.Button_AutoReturnToLobby_OnClicked, self) + WidgetLibrary.BindButtonClicked(self.Button_share, self.ShareSettlement, self) + self:SetItemTeam() + + for i = 0, self.VerticalBox_Left:GetChildrenCount() - 1 do + local ItemLeftInst = self.VerticalBox_Left:GetChildAt(i) + local ItemRightInst = self.VerticalBox_Right:GetChildAt(i) + ItemLeftInst:SetIndex(i + 1) + ItemRightInst:SetIndex(i + 1) + end + +end + +function WB_TeamSettlement:OnShowPanel() + self:SetItemTeam() + self:AutoReturnToLobby() + self:UpdateRank() +end + +function WB_TeamSettlement:SetItemTeam() + local LocalPlayerTeamID = UGCGameSystem.GameState:GetPlayerTeamIDByPlayerKey(UGCSystemLibrary.GetLocalPlayerKey()) + if LocalPlayerTeamID == TeamConfig.TeamType.CT then + self.LeftTeamType, self.RightTeamType = TeamConfig.TeamType.CT, TeamConfig.TeamType.T + else + self.LeftTeamType, self.RightTeamType = TeamConfig.TeamType.T, TeamConfig.TeamType.CT + end + + for i = 0, self.VerticalBox_Left:GetChildrenCount() - 1 do + local ItemLeftInst = self.VerticalBox_Left:GetChildAt(i) + local ItemRightInst = self.VerticalBox_Right:GetChildAt(i) + ItemLeftInst:SetTeam(TeamConfig.TeamType.CT) + ItemRightInst:SetTeam(TeamConfig.TeamType.T) + end +end + +function WB_TeamSettlement:UpdateRank() + + UGCLogSystem.Log("[WB_TeamSettlement_UpdateRank]") + local CTScore = UGCGameSystem.GameState:GetTeamScore(self.LeftTeamType) + local TScore = UGCGameSystem.GameState:GetTeamScore(self.RightTeamType) + + self.TextBlock_LeftScore:SetText(tostring(CTScore)) + self.TextBlock_RightScore:SetText(tostring(TScore)) + + -- 设置胜利图标 + local PlayerTeamID = UGCGameSystem.GameState:GetPlayerTeamIDByPlayerKey(UGCSystemLibrary.GetLocalPlayerKey()) + self.WidgetSwitcher_Win:SetActiveWidgetIndex(0) + if PlayerTeamID == self.LeftTeamType then + if CTScore < TScore then + self.WidgetSwitcher_Win:SetActiveWidgetIndex(1) + end + else + if CTScore > TScore then + self.WidgetSwitcher_Win:SetActiveWidgetIndex(1) + end + end + + local RankData = PlayerScoreSystem.GetTeamRank() + UGCLogSystem.LogTree("[WB_TeamRank_UpdateRank]", RankData) + + + + for i = 0, self.VerticalBox_Left:GetChildrenCount() - 1 do + local ItemLeftInst = self.VerticalBox_Left:GetChildAt(i) + local ItemRightInst = self.VerticalBox_Right:GetChildAt(i) + local PlayerKeyLeft = RankData[self.LeftTeamType] and RankData[self.LeftTeamType][i + 1] or nil + local PlayerKeyRight = RankData[self.RightTeamType] and RankData[self.RightTeamType][i + 1] or nil + if PlayerKeyLeft then + ItemLeftInst:SetVisibility(ESlateVisibility.SelfHitTestInvisible) + ItemLeftInst:InitRankInfo(PlayerKeyLeft) + else + ItemLeftInst:SetVisibility(ESlateVisibility.Collapsed) + end + if PlayerKeyRight then + ItemRightInst:SetVisibility(ESlateVisibility.SelfHitTestInvisible) + ItemRightInst:InitRankInfo(PlayerKeyRight) + else + ItemRightInst:SetVisibility(ESlateVisibility.Collapsed) + end + end + +end + +function WB_TeamSettlement:AutoReturnToLobby() + self.DelayReturnToLobbyTime = GlobalConfigs.GameSetting.DelayReturnToLobbyTime + self.SettlementTime = KismetSystemLibrary.GetGameTimeInSeconds(self) + self.DelayReturnToLobbyTimerHandle = UGCEventSystem.SetTimerLoop( + self, + function () + local NowTime = KismetSystemLibrary.GetGameTimeInSeconds(self) + local ShowTime = math.floor(self.DelayReturnToLobbyTime - (NowTime - self.SettlementTime)) + ShowTime = ShowTime >= 0 and ShowTime or 0 + self.TextBlock_AutoReturnToLobby:SetText(string.format("返回大厅(%ds)", ShowTime)) + if ShowTime <= 0 then self:Button_AutoReturnToLobby_OnClicked() end + end, + 0.5 + ) +end + +function WB_TeamSettlement:Button_AutoReturnToLobby_OnClicked() + -- if UGCGameSystem.GameState.GameStateType ~= CustomEnum.EGameState.End then return end + if self == nil or self.DoOnceReturnToLobby then return end + if self.DelayReturnToLobbyTimerHandle then + UGCEventSystem.StopTimer(self.DelayReturnToLobbyTimerHandle) + self.DelayReturnToLobbyTimerHandle = nil + end + self.DoOnceReturnToLobby = true + UGCGameSystem.ReturnToLobby() + UGCLogSystem.Log("[WB_TeamSettlement_Button_AutoReturnToLobby_OnClicked]") +end + +--- 分享战绩 +function WB_TeamSettlement:ShareSettlement() + UGCWidgetManagerSystem.Share(); +end + +return WB_TeamSettlement; diff --git a/CounterAttack_Solo/Script/UI/Settlement/WB_TeamSettlementItem.lua b/CounterAttack_Solo/Script/UI/Settlement/WB_TeamSettlementItem.lua new file mode 100644 index 00000000..af9bc9d9 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/Settlement/WB_TeamSettlementItem.lua @@ -0,0 +1,76 @@ +---@class WB_TeamSettlementItem_C:UUserWidget +---@field Button_Result_AddFriend UButton +---@field Image_0 UImage +---@field Image_PlayerIcon UImage +---@field TextBlock_Deaths UTextBlock +---@field TextBlock_Kills UTextBlock +---@field TextBlock_PlayerName UTextBlock +---@field TextBlock_RankNum UTextBlock +---@field WidgetSwitcher_IsLocalPlayer UWidgetSwitcher +--Edit Below-- +---@type WB_TeamSettlementItem_C +local WB_TeamSettlementItem = { + bInitDoOnce = false; + PlayerKey = -1; +}; + +function WB_TeamSettlementItem:LuaInit() + if self.bInitDoOnce then + return; + end + self.bInitDoOnce = true; + WidgetLibrary.BindButtonClicked(self.Button_Result_AddFriend, self.AddFriend, self) +end + +function WB_TeamSettlementItem:SetIndex(Index) + self.TextBlock_RankNum:SetText(tostring(Index)); +end + +function WB_TeamSettlementItem:SetTeam(TeamType) + -- UGCLogSystem.Log("[WB_TeamRankItem_SetTeam]") + local TeamColor = TeamConfig.TeamColor[TeamType] + -- 设置队伍颜色 + if TeamColor then + self.TextBlock_RankNum:SetColorAndOpacity({SpecifiedColor = TeamColor, ColorUseRule = 0}) + self.TextBlock_PlayerName:SetColorAndOpacity({SpecifiedColor = TeamColor, ColorUseRule = 0}) + else + UGCLogSystem.LogError("[WB_TeamRankItem_SetTeam] TeamType:%s, TeamColorType: %s", tostring(TeamType), type(TeamColor)) + end +end + +function WB_TeamSettlementItem:InitRankInfo(PlayerKey) + self:LuaInit() + self.PlayerKey = PlayerKey + if self.PlayerKey == UGCSystemLibrary.GetLocalPlayerKey() then + self.WidgetSwitcher_IsLocalPlayer:SetActiveWidgetIndex(1) + self.Button_Result_AddFriend:SetVisibility(ESlateVisibility.Collapsed) + else + self.WidgetSwitcher_IsLocalPlayer:SetActiveWidgetIndex(0) + end + + local PlayerName = UGCGameSystem.GameState:GetPlayerNameByPlayerKey(self.PlayerKey); + --local RankNum = UGCGameSystem.GameState:GetPlayerRankByPlayerKey(self.PlayerKey) + local Kills = PlayerScoreSystem.GetPlayerScoreDataFromType(PlayerKey, PlayerScoreSystem.Config.EScoreType.Kills) + local Damage = PlayerScoreSystem.GetPlayerScoreDataFromType(PlayerKey, PlayerScoreSystem.Config.EScoreType.Damage) + + local Deaths = PlayerScoreSystem.GetPlayerScoreDataFromType(PlayerKey, PlayerScoreSystem.Config.EScoreType.Deaths) + + self.TextBlock_PlayerName:SetText(PlayerName); + --self.TextBlock_RankNum:SetText(tostring(RankNum)); + + + --self.TextBlock_Kills:SetText(tostring(Kills)); + self.TextBlock_Kills:SetText(math.floor(Damage)); + self.TextBlock_Deaths:SetText(tostring(Deaths)); + + UGCSystemLibrary.DownloadImageToUImage(self.Image_PlayerIcon, UGCGameSystem.GameState:GetHeadIconByPlayerKey(PlayerKey), true); +end + +function WB_TeamSettlementItem:AddFriend() + local TargetPlayerData = UGCGameSystem.GameState.PlayerPersonalInfos[self.PlayerKey] + if TargetPlayerData then + UGCGameSystem.AddFriend(TargetPlayerData.UID) + end +end + +return WB_TeamSettlementItem; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/Currency/WB_Currency.lua b/CounterAttack_Solo/Script/UI/StatusUI/Currency/WB_Currency.lua new file mode 100644 index 00000000..e59ffd62 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/Currency/WB_Currency.lua @@ -0,0 +1,143 @@ +---@class WB_Currency_C:UUserWidget +---@field Button_AddGold UButton +---@field Button_AddGoldBrick UButton +---@field Button_AddLevel UButton +---@field Button_ShowGuide UButton +---@field NewButton_Setting UNewButton +---@field TextBlock_Gold UTextBlock +---@field TextBlock_GoldBrick UTextBlock +---@field TextBlock_Level UTextBlock +--Edit Below-- +local WB_Currency = { bInitDoOnce = false; }; + + +function WB_Currency:Construct() + -- self:ShowRechargeEntrance() + + WidgetLibrary.BindButtonClicked(self.Button_AddGold, self.ClickAddGold, self) + WidgetLibrary.BindButtonClicked(self.Button_AddGoldBrick, self.ClickAddGoldBrick, self) + WidgetLibrary.BindButtonClicked(self.Button_AddLevel, self.ClickAddLevel, self) + WidgetLibrary.BindButtonClicked(self.NewButton_Setting, self.ShowSettingPanel, self) + WidgetLibrary.ButtonOnClickShowPanel(self.Button_ShowGuide, WidgetConfig.EUIType.Guide) + + UGCEventSystem.AddListener(ArchiveDataConfig.GetParamNotifyEvent(ArchiveDataConfig.EArchiveType.Gold), self.UpdateGoldCount, self) + UGCEventSystem.AddListener(ArchiveDataConfig.GetParamNotifyEvent(ArchiveDataConfig.EArchiveType.Exp), self.UpdateLevelCount, self) + UGCEventSystem.AddListener(ArchiveDataConfig.GetParamNotifyEvent(ArchiveDataConfig.EArchiveType.GoldBrick), self.UpdateGoldBrickCount, self) + + self:UpdateGoldCount() + self:UpdateLevelCount() + self:UpdateGoldBrickCount() + +end + +function WB_Currency:ShowRechargeEntrance() + UGCCommoditySystem.ShowRechargeEntryUI() + --UGCCommoditySystem.ShowRechargeEntryUI():Then( + -- function (Result) + -- local UI = Result:Get() + -- UI:SetVisibility() + -- end + --) +end + + +function WB_Currency:ClickAddGold() + + --WidgetManager:ShowPanel(WidgetConfig.EUIType.Task, false) + + local LocalPK = UGCSystemLibrary.GetLocalPlayerKey() + local SecondaryConfirmationWidget = WidgetManager:GetPanel(WidgetConfig.EUIType.SecondaryConfirmation_Strip) + local GoldBrick = ArchiveDataConfig.GetPlayerArchiveDataFromType(LocalPK, ArchiveDataConfig.EArchiveType.GoldBrick) + SecondaryConfirmationWidget:SetValRange(0, GoldBrick and GoldBrick or 0) + SecondaryConfirmationWidget:SetTextInfo(function(Val) return string.format("消耗 %s 块金砖兑换 %s 个金币。", tostring(Val), tostring(Val * PlacementModeConfig.PlacingAttr.RatioGoldBrickToGold)) end) + SecondaryConfirmationWidget:BindConfirmCallBack(self.ConfirmExchangeGoldBrickToGold, self) + WidgetManager:ShowPanel(WidgetConfig.EUIType.SecondaryConfirmation_Strip, false) +end + +function WB_Currency:ConfirmExchangeGoldBrickToGold(GoldBrickVal) + UGCSendRPCSystem.ActorRPCNotify(nil, UGCGameSystem.GameState, "GoldBrickToGold", UGCSystemLibrary.GetLocalPlayerKey(), GoldBrickVal) +end + +function WB_Currency:ClickAddGoldBrick() + + UGCLogSystem.Log("[WB_Currency_ConfirmExchangeOasisCoinToGoldBrick]") + -- UGCSendRPCSystem.ActorRPCNotify(nil, UGCGameSystem.GameState, "GoldBrickToGold", UGCSystemLibrary.GetLocalPlayerKey(), GoldBrickVal) + local Result = UGCCommoditySystem.BuyUGCCommodity( + PlacementModeConfig.PlacingAttr.GoldBrickName, + "金砖", + UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/T_GoldBrick.T_GoldBrick'), + "用于兑换经验和金币", + PlacementModeConfig.PlacingAttr.BuyGoldBrickCount, + PlacementModeConfig.PlacingAttr.RatioOasisCoinToGoldBrick + ) + UGCLogSystem.Log("[WB_Currency_ConfirmExchangeOasisCoinToGoldBrick] Finish") + + --local SecondaryConfirmationWidget = WidgetManager:GetPanel(WidgetConfig.EUIType.SecondaryConfirmation_Strip) + --SecondaryConfirmationWidget:SetValRange(0, 1280) + --SecondaryConfirmationWidget:SetTextInfo(function(Val) return string.format("消耗%s个绿洲币兑换%s个金砖。", tostring(Val), tostring(Val * PlacementModeConfig.PlacingAttr.RatioOasisCoinToGoldBrick)) end) + --SecondaryConfirmationWidget:BindConfirmCallBack(self.ConfirmExchangeOasisCoinToGoldBrick, self) + --WidgetManager:ShowPanel(WidgetConfig.EUIType.SecondaryConfirmation_Strip, false) +end + +function WB_Currency:ConfirmExchangeOasisCoinToGoldBrick(Val) + UGCLogSystem.Log("[WB_Currency_ConfirmExchangeOasisCoinToGoldBrick]") + -- UGCSendRPCSystem.ActorRPCNotify(nil, UGCGameSystem.GameState, "GoldBrickToGold", UGCSystemLibrary.GetLocalPlayerKey(), GoldBrickVal) + local Result = UGCCommoditySystem.BuyUGCCommodity( + PlacementModeConfig.PlacingAttr.GoldBrickName, + "金砖", + UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/T_GoldBrick.T_GoldBrick'), + "用于兑换经验和金币", + 100, + 1 + ) + UGCLogSystem.Log("[WB_Currency_ConfirmExchangeOasisCoinToGoldBrick] Finish") +end + +function WB_Currency:ClickAddLevel() + WidgetManager:ShowPanel(WidgetConfig.EUIType.Task, false) +end + + +function WB_Currency:UpdateGoldCount() + local Gold = ArchiveDataConfig.GetPlayerArchiveDataFromType(UGCSystemLibrary.GetLocalPlayerKey(), ArchiveDataConfig.EArchiveType.Gold) + if Gold == nil then Gold = 0 end + self.TextBlock_Gold:SetText(tostring(Gold)) +end + +function WB_Currency:UpdateLevelCount() + local Exp = ArchiveDataConfig.GetPlayerArchiveDataFromType(UGCSystemLibrary.GetLocalPlayerKey(), ArchiveDataConfig.EArchiveType.Exp) + if Exp == nil then Exp = 0 end + local Level = LevelConfig.GetLevel(Exp) + self.TextBlock_Level:SetText(tostring(Level)) +end + +function WB_Currency:UpdateGoldBrickCount() + local GoldBrick = ArchiveDataConfig.GetPlayerArchiveDataFromType(UGCSystemLibrary.GetLocalPlayerKey(), ArchiveDataConfig.EArchiveType.GoldBrick) + if GoldBrick == nil then GoldBrick = 0 end + self.TextBlock_GoldBrick:SetText(tostring(GoldBrick)) +end + +-- function WB_Currency:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_Currency:Destruct() + +-- end + + +function WB_Currency:ShowSettingPanel() + UGCLogSystem.Log("[WB_Currency_ShowSettingPanel]") + local MainControlPanel = GameBusinessManager.GetWidgetFromName(ingame, "MainControlPanelTochButton_C"); + if MainControlPanel then + -- MainControlPanel.MainControlBaseUI:OpenSettingPanel(); + MainControlPanel.MainControlBaseUI:OpenSettingPanel(); + if self.DoOnceOpenSettingPanel then + MainControlPanel.MainControlBaseUI:OpenSettingPanel(); + else + self.DoOnceOpenSettingPanel = true + end + end +end + +return WB_Currency; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/NextWeapon/WB_NextWeapon.lua b/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/NextWeapon/WB_NextWeapon.lua new file mode 100644 index 00000000..fa1df3d9 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/NextWeapon/WB_NextWeapon.lua @@ -0,0 +1,127 @@ +---@class WB_NextWeapon_C:UUserWidget +---@field Button_ShowOther UButton +---@field Image_NextWeapon UImage +---@field TextBlock_Grade UTextBlock +---@field TextBlock_WeaponName UTextBlock +---@field VerticalBox_OtherWeapon UVerticalBox +---@field WidgetSwitcher_Next UWidgetSwitcher +---@field WidgetSwitcher_ShowOtherText UWidgetSwitcher +---@field WriteTex UTexture2D +--Edit Below-- +---@type WB_NextWeapon_C +local WB_NextWeapon = { + bInitDoOnce = false; + PlayerWeaponGradient = {}; +}; + + +function WB_NextWeapon:Construct() + -- self:UpdateInfo() + UGCEventSystem.AddListener(EventEnum.PlayerGradientGradeChange, self.UpdateInfo, self) + -- UGCEventSystem.AddListener(EventEnum.PlayerGradientGradeChange, self.UpdateGradeInfo, self) + + WidgetLibrary.BindButtonClicked(self.Button_ShowOther, self.ShowOtherWeaponInfo, self) +end + +-- function WB_NextWeapon:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_NextWeapon:Destruct() + +-- end + +function WB_NextWeapon:UpdateInfo() + if not UE.IsValid(UGCGameSystem.GameState) then return end + local LocalPlayerKey = UGCSystemLibrary.GetLocalPlayerKey() + local WeaponID = UGCGameSystem.GameState:GetPlayerNextWeaponID(LocalPlayerKey) + local WeaponGradient = UGCGameSystem.GameState:GetPlayerWeaponGradientByPlayerKey(LocalPlayerKey) + local Grade = UGCGameSystem.GameState:GetPlayerWeaponGrade(LocalPlayerKey) + + -- 检测梯度是否更新 + self:CheckWeaponGradient(WeaponGradient) + + -- 设置下一个武器信息 + if WeaponID then + -- 设置武器图片名字等信息 + self.TextBlock_WeaponName:SetVisibility(ESlateVisibility.SelfHitTestInvisible) + local ItemData = ItemTable.AllItem[WeaponID] + if ItemData and ItemData.BigPic then + local Tex = UGCSystemLibrary.LoadAsset(ItemData.BigPic, true) + self.Image_NextWeapon:SetBrushFromTexture(Tex, false) + self.TextBlock_WeaponName:SetText(ItemData.Name) + self.WidgetSwitcher_Next:SetActiveWidgetIndex(0) + elseif WeaponID < 0 then + self.TextBlock_WeaponName:SetText("-") + self.WidgetSwitcher_Next:SetActiveWidgetIndex(2) + else + UGCLogSystem.LogError("[WB_NextWeapon_UpdateInfo] ItemData Error %s", tostring(WeaponID)) + end + else + self.WidgetSwitcher_Next:SetActiveWidgetIndex(1) + self.TextBlock_WeaponName:SetVisibility(ESlateVisibility.Hidden) + end + + -- 设置等级 + if Grade and WeaponGradient then + self.TextBlock_Grade:SetText(Grade .. " / " .. (#WeaponGradient)) + end + + -- 更新剩余梯度武器的显示 + for i = 1, self.VerticalBox_OtherWeapon:GetChildrenCount() do + local Item = self.VerticalBox_OtherWeapon:GetChildAt(self.VerticalBox_OtherWeapon:GetChildrenCount() - i) + if i > #self.PlayerWeaponGradient - 2 or i < Grade then + Item:SetVis(false) + else + Item:SetVis(true) + end + end +end + +function WB_NextWeapon:CheckWeaponGradient(NewWeaponGradient) + if type(NewWeaponGradient) ~= "table" then + return + end + local IsNew = false + if #NewWeaponGradient == self.PlayerWeaponGradient then + for i, v in pairs(NewWeaponGradient) do + if self.PlayerWeaponGradient[i] ~= v then + IsNew = true + break + end + end + else + IsNew = true + end + if IsNew then + self.PlayerWeaponGradient = table.DeepCopy(NewWeaponGradient) + self:CheckOtherWeaponItem() + for i = 1, self.VerticalBox_OtherWeapon:GetChildrenCount() do + local Item = self.VerticalBox_OtherWeapon:GetChildAt(self.VerticalBox_OtherWeapon:GetChildrenCount() - i) + if i > #self.PlayerWeaponGradient - 2 then + Item:SetVis(false) + else + Item:UpdateWeaponID(self.PlayerWeaponGradient[i + 2]) + end + end + end +end + +function WB_NextWeapon:CheckOtherWeaponItem() + while self.VerticalBox_OtherWeapon:GetChildrenCount() < (#self.PlayerWeaponGradient - 2) do + local Item = UserWidget.NewWidgetObjectBP(UGCSystemLibrary.GetLocalPlayerController(), ObjectPathTable.WB_NextWeaponItem_Class) + self.VerticalBox_OtherWeapon:AddChild(Item) + end +end + +function WB_NextWeapon:ShowOtherWeaponInfo() + if self.VerticalBox_OtherWeapon:IsVisible() then + self.WidgetSwitcher_ShowOtherText:SetActiveWidgetIndex(0) + self.VerticalBox_OtherWeapon:SetVisibility(ESlateVisibility.Collapsed) + else + self.WidgetSwitcher_ShowOtherText:SetActiveWidgetIndex(1) + self.VerticalBox_OtherWeapon:SetVisibility(ESlateVisibility.SelfHitTestInvisible) + end +end + +return WB_NextWeapon; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/NextWeapon/WB_NextWeaponItem.lua b/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/NextWeapon/WB_NextWeaponItem.lua new file mode 100644 index 00000000..ee1c6b4d --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/NextWeapon/WB_NextWeaponItem.lua @@ -0,0 +1,60 @@ +---@class WB_NextWeaponItem_C:UUserWidget +---@field Image_NextWeapon UImage +---@field TextBlock_DefaultWeapon UTextBlock +---@field TextBlock_WeaponName UTextBlock +--Edit Below-- +---@type WB_NextWeaponItem_C +local WB_NextWeaponItem = { bInitDoOnce = false; }; + +--[==[ Construct +function WB_NextWeaponItem:Construct() + +end +-- Construct ]==] + +-- function WB_NextWeaponItem:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_NextWeaponItem:Destruct() + +-- end + +function WB_NextWeaponItem:UpdateWeaponID(NewID) + if NewID < 0 then + --NewID = UGCGameSystem.GameState:GetPlayerDefaultMeleeWeaponByPlayerKey(UGCSystemLibrary.GetLocalPlayerKey()) + self:SetVis(true) + self.TextBlock_DefaultWeapon:SetVisibility(ESlateVisibility.Visible) + self.Image_NextWeapon:SetVisibility(ESlateVisibility.Collapsed) + self.TextBlock_WeaponName:SetText("-") + else + local ItemInfo = ItemTable.AllItem[NewID] + if ItemInfo then + self.Image_NextWeapon:SetVisibility(ESlateVisibility.Visible) + self.TextBlock_DefaultWeapon:SetVisibility(ESlateVisibility.Collapsed) + + if ItemInfo.BigPic then + local Texture = UGCSystemLibrary.LoadAsset(ItemInfo.BigPic, true) + if UE.IsValid(Texture) then + self.Image_NextWeapon:SetBrushFromTexture(Texture, false) + end + self.TextBlock_WeaponName:SetText(ItemInfo.Name) + end + self:SetVis(true) + else + self:SetVis(false) + end + end + + +end + +function WB_NextWeaponItem:SetVis(IsVis) + if IsVis then + self:SetVisibility(ESlateVisibility.SelfHitTestInvisible) + else + self:SetVisibility(ESlateVisibility.Collapsed) + end +end + +return WB_NextWeaponItem; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/ShowBuff/WB_ShowBuff.lua b/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/ShowBuff/WB_ShowBuff.lua new file mode 100644 index 00000000..dec7e580 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/ShowBuff/WB_ShowBuff.lua @@ -0,0 +1,138 @@ +---@class WB_ShowBuff_C:UUserWidget +---@field NewButton_Show UNewButton +---@field UniformGridPanel_Buff UUniformGridPanel +---@field VerticalBox_OtherBuff UVerticalBox +---@field WidgetSwitcher_DetailedInformation UWidgetSwitcher +---@field WidgetSwitcher_DetailedInformationText UWidgetSwitcher +--Edit Below-- +local WB_ShowBuff = { + SmallItemRaw = 4; + bInitDoOnce = false; + bIsExpand = false; +}; + + +function WB_ShowBuff:Construct() + WidgetLibrary.BindButtonClicked(self.NewButton_Show, self.Expand, self) + UGCEventSystem.AddListener(EventEnum.UpdateOwnedIncrease, self.UpdateShowBuff, self) + UGCEventSystem.AddListener(EventEnum.UpdateToGodSchedule, self.UpdateShowBuff, self) + self:InitBuffList() + + -- 校验 + self:UpdateShowBuff() + UGCEventSystem.SetTimerLoop(self, + function() + self:UpdateShowBuff() + end, + 3 + ) + +end + +function WB_ShowBuff:GetShowBuffItemClass() + if self.ShowBuffItemClass == nil then + self.ShowBuffItemClass = UE.LoadClass(UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/StatusUI/FightPanel/ShowBuff/WB_ShowBuffItem.WB_ShowBuffItem_C')) + end + return self.ShowBuffItemClass +end + +function WB_ShowBuff:GetShowBuffSmallItemClass() + if self.ShowBuffSmallItemClass == nil then + self.ShowBuffSmallItemClass = UE.LoadClass(UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/StatusUI/FightPanel/ShowBuff/WB_ShowBuffSmallItem.WB_ShowBuffSmallItem_C')) + end + return self.ShowBuffSmallItemClass +end + +function WB_ShowBuff:InitBuffList() + local LocalPC = UGCSystemLibrary.GetLocalPlayerController() + local Count = table.getCount(GodOfWarConfig.EIncreaseType) + for i = 0, Count do + local ShowBuffItem = UserWidget.NewWidgetObjectBP(LocalPC, self:GetShowBuffItemClass()); + if ShowBuffItem then + self.VerticalBox_OtherBuff:AddChild(ShowBuffItem) + ShowBuffItem:UpdateInfo((i == 0), i, 1, false) + end + + local ShowBuffSmallItem = UserWidget.NewWidgetObjectBP(LocalPC, self:GetShowBuffSmallItemClass()); + if ShowBuffSmallItem then + self.UniformGridPanel_Buff:AddChild(ShowBuffSmallItem) + ShowBuffSmallItem:UpdateInfo((i == 0), i, 1, false) + local TargetUniformGridSlot = WidgetLayoutLibrary.SlotAsUniformGridSlot(ShowBuffSmallItem) + -- 居中 + TargetUniformGridSlot:SetVerticalAlignment(EVerticalAlignment.VAlign_Center) + TargetUniformGridSlot:SetHorizontalAlignment(EHorizontalAlignment.HAlign_Center) + -- 设置索引 + TargetUniformGridSlot:SetColumn(i % self.SmallItemRaw) + TargetUniformGridSlot:SetRow(i // self.SmallItemRaw) + end + end +end + +function WB_ShowBuff:Expand() + self.bIsExpand = not self.bIsExpand + if self.bIsExpand then + self.WidgetSwitcher_DetailedInformation:SetActiveWidgetIndex(0) + self.WidgetSwitcher_DetailedInformationText:SetActiveWidgetIndex(1) + else + self.WidgetSwitcher_DetailedInformation:SetActiveWidgetIndex(1) + self.WidgetSwitcher_DetailedInformationText:SetActiveWidgetIndex(0) + end +end + +function WB_ShowBuff:UpdateShowBuff() + local LocalPC = UGCSystemLibrary.GetLocalPlayerController() + + local OwnedIncrease = LocalPC:GetAllOwnedIncreaseLevel() + + + for i = 0, self.VerticalBox_OtherBuff:GetChildrenCount() - 1 do + local Item = self.VerticalBox_OtherBuff:GetChildAt(i) + if i == 0 then + Item:SetVisibility(ESlateVisibility.Collapsed) + else + local IncreaseType = Item:GetIncreaseType() + local Level = OwnedIncrease[IncreaseType] + if Level then + Item:SetVisibility(ESlateVisibility.HitTestInvisible) + Item:UpdateLevel(Level, Level >= #GodOfWarConfig.BuffList[IncreaseType]) + else + Item:SetVisibility(ESlateVisibility.Collapsed) + end + end + + end + local ShowIndex = 0; + for i = 0, self.UniformGridPanel_Buff:GetChildrenCount() - 1 do + local SmallItem = self.UniformGridPanel_Buff:GetChildAt(i) + if i == 0 then + SmallItem:SetVisibility(ESlateVisibility.Collapsed) + else + local IncreaseType = SmallItem:GetIncreaseType() + local Level = OwnedIncrease[IncreaseType] + --UGCLogSystem.Log("[WB_ShowBuff_UpdateShowBuff] IncreaseType2:%s", tostring(IncreaseType)) + if Level then + SmallItem:SetVisibility(ESlateVisibility.HitTestInvisible) + SmallItem:UpdateLevel(Level, Level >= #GodOfWarConfig.BuffList[IncreaseType]) + local TargetUniformGridSlot = WidgetLayoutLibrary.SlotAsUniformGridSlot(SmallItem) + -- 设置索引 + TargetUniformGridSlot:SetColumn(ShowIndex % self.SmallItemRaw) + TargetUniformGridSlot:SetRow(ShowIndex // self.SmallItemRaw) + ShowIndex = ShowIndex + 1 + else + SmallItem:SetVisibility(ESlateVisibility.Collapsed) + end + end + + end + +end + +-- function WB_ShowBuff:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_ShowBuff:Destruct() + +-- end + +return WB_ShowBuff; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/ShowBuff/WB_ShowBuffItem.lua b/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/ShowBuff/WB_ShowBuffItem.lua new file mode 100644 index 00000000..f85fd358 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/ShowBuff/WB_ShowBuffItem.lua @@ -0,0 +1,66 @@ +---@class WB_ShowBuffItem_C:UUserWidget +---@field Image_Icon UImage +---@field TextBlock_Level UTextBlock +---@field TextBlock_Name UTextBlock +---@field WidgetSwitcher_IsGod UWidgetSwitcher +--Edit Below-- +local WB_ShowBuffItem = { + bInitDoOnce = false; + IsGodOfWar = false; + IncreaseType = -1; +}; + +--[==[ Construct +function WB_ShowBuffItem:Construct() + +end +-- Construct ]==] + +-- function WB_ShowBuffItem:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_ShowBuffItem:Destruct() + +-- end + +function WB_ShowBuffItem:UpdateInfo(InIsGodOfWar, InIncreaseType, Level, IsMax) + if InIsGodOfWar ~= self.IsGodOfWar or InIncreaseType ~= self.IncreaseType then + self.IsGodOfWar = InIsGodOfWar + self.IncreaseType = InIncreaseType + if self.IsGodOfWar then + self.WidgetSwitcher_IsGod:SetActiveWidgetIndex(1) + self.TextBlock_Level:SetVisibility(ESlateVisibility.Collapsed) + self.TextBlock_Name:SetText(GodOfWarConfig.GodOfWarBuffName) + else + self.WidgetSwitcher_IsGod:SetActiveWidgetIndex(0) + self.TextBlock_Level:SetVisibility(ESlateVisibility.HitTestInvisible) + self.TextBlock_Name:SetText(GodOfWarConfig.IncreaseName[self.IncreaseType]) + -- 设置图案 + UGCSystemLibrary.AsyncLoadAsset(GodOfWarConfig.IncreaseIcon[self.IncreaseType], + function(InTex) + if UE.IsValid(InTex) then + self.Image_Icon:SetBrushFromTexture(InTex, false) + end + end, + nil, + true + ) + end + end + self:UpdateLevel(Level, IsMax) +end + +function WB_ShowBuffItem:GetIncreaseType() + return self.IncreaseType +end + +function WB_ShowBuffItem:UpdateLevel(Level, IsMax) + if IsMax then + self.TextBlock_Level:SetText("Max") + else + self.TextBlock_Level:SetText("Lv.".. Level) + end +end + +return WB_ShowBuffItem; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/ShowBuff/WB_ShowBuffSmallItem.lua b/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/ShowBuff/WB_ShowBuffSmallItem.lua new file mode 100644 index 00000000..0ecf03cf --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/ShowBuff/WB_ShowBuffSmallItem.lua @@ -0,0 +1,59 @@ +---@class WB_ShowBuffSmallItem_C:UUserWidget +---@field Image_Icon UImage +---@field TextBlock_Level UTextBlock +---@field WidgetSwitcher_IsGod UWidgetSwitcher +--Edit Below-- +local WB_ShowBuffSmallItem = { bInitDoOnce = false; }; + +--[==[ Construct +function WB_ShowBuffSmallItem:Construct() + +end +-- Construct ]==] + +-- function WB_ShowBuffSmallItem:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_ShowBuffSmallItem:Destruct() + +-- end + +function WB_ShowBuffSmallItem:UpdateInfo(InIsGodOfWar, InIncreaseType, Level, IsMax) + if InIsGodOfWar ~= self.IsGodOfWar or InIncreaseType ~= self.IncreaseType then + self.IsGodOfWar = InIsGodOfWar + self.IncreaseType = InIncreaseType + if self.IsGodOfWar then + self.WidgetSwitcher_IsGod:SetActiveWidgetIndex(1) + self.TextBlock_Level:SetVisibility(ESlateVisibility.Collapsed) + else + self.WidgetSwitcher_IsGod:SetActiveWidgetIndex(0) + self.TextBlock_Level:SetVisibility(ESlateVisibility.HitTestInvisible) + -- 设置图案 + UGCSystemLibrary.AsyncLoadAsset(GodOfWarConfig.IncreaseIcon[self.IncreaseType], + function(InTex) + if UE.IsValid(InTex) then + self.Image_Icon:SetBrushFromTexture(InTex, false) + end + end, + nil, + true + ) + end + end + self:UpdateLevel(Level, IsMax) +end + +function WB_ShowBuffSmallItem:GetIncreaseType() + return self.IncreaseType +end + +function WB_ShowBuffSmallItem:UpdateLevel(Level, IsMax) + if IsMax then + self.TextBlock_Level:SetText("Max") + else + self.TextBlock_Level:SetText(Level) + end +end + +return WB_ShowBuffSmallItem; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/TeamScore/W_TeamScore.lua b/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/TeamScore/W_TeamScore.lua new file mode 100644 index 00000000..56bfc66d --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/TeamScore/W_TeamScore.lua @@ -0,0 +1,100 @@ +---@class W_TeamScore_C:UUserWidget +---@field Image_Tip UImage +---@field NewButton_TC_ScoreBoard UNewButton +---@field TextBlock_LeftTeamScore UTextBlock +---@field TextBlock_RemainTime UTextBlock +---@field TextBlock_RightTeamScore UTextBlock +--Edit Below-- +---@type W_TeamScore_C +local W_TeamScore = { + bInitDoOnce = false; + TeamLessThanOneMinute = true; + LeftTeamType = 1; + RightTeamType = 2; +}; + +function W_TeamScore:OnShowPanel() + if self.UpdateShowTimeHandle == nil then + self.UpdateShowTimeHandle = UGCEventSystem.SetTimerLoop(self, self.UpdateShowTime, 1) + end +end + +function W_TeamScore:OnClosePanel() + if self.UpdateShowTimeHandle ~= nil then + UGCEventSystem.StopTimer(self.UpdateShowTimeHandle) + self.UpdateShowTimeHandle = nil + end + if WidgetManager:IsVisiblePanel(WidgetConfig.EUIType.Ranking) then + WidgetManager:ClosePanel(WidgetConfig.EUIType.Ranking) + end +end + +function W_TeamScore:Construct() + WidgetLibrary.TextBlockBindingPropertyText(self.TextBlock_RemainTime, self.TextBlock_RemainTime_Text, self) + WidgetLibrary.BindButtonClicked(self.NewButton_TC_ScoreBoard, self.ShowRankingWidget, self) + UGCEventSystem.AddListener(EventEnum.UpdateTeamScore, self.UpdateTeamScore, self) + UGCEventSystem.AddListener(EventEnum.UpdatePlayerInfo, self.UpdateLocalPlayerTeam, self) + self:UpdateLocalPlayerTeam() + + self:UpdateTeamScore() +end + +function W_TeamScore:UpdateLocalPlayerTeam() + -- 判断己方是team2还是team1 + local LocalPlayerTeamID = UGCGameSystem.GameState:GetPlayerTeamIDByPlayerKey(UGCSystemLibrary.GetLocalPlayerKey()) + if LocalPlayerTeamID == TeamConfig.TeamType.CT then + self.LeftTeamType, self.RightTeamType = TeamConfig.TeamType.CT, TeamConfig.TeamType.T + else + self.LeftTeamType, self.RightTeamType = TeamConfig.TeamType.T, TeamConfig.TeamType.CT + end +end + +--- 更新比分 +function W_TeamScore:UpdateTeamScore() + self.TextBlock_LeftTeamScore:SetText(UGCGameSystem.GameState:GetTeamScore(self.LeftTeamType)) + self.TextBlock_RightTeamScore:SetText(UGCGameSystem.GameState:GetTeamScore(self.RightTeamType)) +end + +--- 显示排行榜UI +function W_TeamScore:ShowRankingWidget() + self.Image_Tip:SetVisibility(ESlateVisibility.Collapsed) + if WidgetManager:IsVisiblePanel(WidgetConfig.EUIType.Ranking) then + WidgetManager:ClosePanel(WidgetConfig.EUIType.Ranking) + else + WidgetManager:ShowPanel(WidgetConfig.EUIType.Ranking, false) + end +end + +--- 更新显示时间 +function W_TeamScore:UpdateShowTime() + local Time = UGCGameSystem.GameState:GetGameTime() + self:CheckAddTip(Time) + self.TextBlock_RemainTime:SetText(UGCSystemLibrary.formatTime(Time, true)) +end + +--- 判断是否要结束时给予提示 +function W_TeamScore:CheckAddTip(Time) + if UGCGameSystem.GameState:GetGameStateType() ~= CustomEnum.EGameState.Playing then + return + end + local TeamLessThanOneMinute = false + if Time <= 60 then + TeamLessThanOneMinute = true + end + + if self.LessThanOneMinute ~= TeamLessThanOneMinute then + self.LessThanOneMinute = TeamLessThanOneMinute + if self.LessThanOneMinute then + UGCEventSystem.SendEvent(EventEnum.AddTip, TipConfig.TipType.OneMinuteRemaining) + --- 播放即将结束的音乐 + SoundSystem.PlaySound(SoundSystem.ESound.AboutToEnd) + self.DoOnceTip1min = false + self.TextBlock_RemainTime:SetColorAndOpacity({SpecifiedColor = {R = 1, G = 0, B = 0, A = 1}, ColorUseRule = 0}) + else + self.TextBlock_RemainTime:SetColorAndOpacity({SpecifiedColor = {R = 1, G = 1, B = 1, A = 1}, ColorUseRule = 0}) + end + end + +end + +return W_TeamScore; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/TeamScore/W_TeamScore_Line.lua b/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/TeamScore/W_TeamScore_Line.lua new file mode 100644 index 00000000..14af16ce --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/TeamScore/W_TeamScore_Line.lua @@ -0,0 +1,42 @@ +---@class W_TeamScore_Line_C:UUserWidget +---@field NewButton_TC_ScoreBoard UNewButton +---@field TextBlock_RemainTime UTextBlock +--Edit Below-- +---@type W_TeamScore_2_C +local W_TeamScore_2 = { + bInitDoOnce = false; + TeamLessThanOneMinute = true; + LeftTeamType = 1; + RightTeamType = 2; +}; + +function W_TeamScore_2:OnClosePanel() + --if WidgetManager:IsVisiblePanel(WidgetConfig.EUIType.Ranking) then + -- WidgetManager:ClosePanel(WidgetConfig.EUIType.Ranking) + --end +end + +function W_TeamScore_2:Construct() + WidgetLibrary.TextBlockBindingPropertyText(self.TextBlock_RemainTime, self.TextBlock_RemainTime_Text, self) + WidgetLibrary.BindButtonClicked(self.NewButton_TC_ScoreBoard, self.ShowRankingWidget, self) +end + + + +function W_TeamScore_2:ShowRankingWidget() + --self.Image_Tip:SetVisibility(ESlateVisibility.Collapsed) + --if WidgetManager:IsVisiblePanel(WidgetConfig.EUIType.Ranking) then + -- WidgetManager:ClosePanel(WidgetConfig.EUIType.Ranking) + --else + -- WidgetManager:ShowPanel(WidgetConfig.EUIType.Ranking, false) + --end +end + +function W_TeamScore_2:TextBlock_RemainTime_Text(ReturnValue) + local Time = UGCGameSystem.GameState:GetGameTime() + -- self:CheckAddTip(Time) + return UGCSystemLibrary.formatTime(Time, true) +end + + +return W_TeamScore_2; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/TeamScore/W_TeamScore_RoundMode.lua b/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/TeamScore/W_TeamScore_RoundMode.lua new file mode 100644 index 00000000..4af4bcc9 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/TeamScore/W_TeamScore_RoundMode.lua @@ -0,0 +1,122 @@ +---@class W_TeamScore_RoundMode_C:UUserWidget +---@field Image_Tip UImage +---@field NewButton_TC_ScoreBoard UNewButton +---@field Overlay_IsMatchPoint UOverlay +---@field TextBlock_LeftPlayerCount UTextBlock +---@field TextBlock_LeftTeamScore UTextBlock +---@field TextBlock_RightPlayerCount UTextBlock +---@field TextBlock_RightTeamScore UTextBlock +---@field TextBlock_Round UTextBlock +--Edit Below-- +---@type W_TeamScore_RoundMode_C +local W_TeamScore_RoundMode = { + bInitDoOnce = false; + TeamLessThanOneMinute = true; + LeftTeamType = 1; + RightTeamType = 2; +}; + +function W_TeamScore_RoundMode:OnShowPanel() + --if self.UpdateShowTimeHandle == nil then + -- self.UpdateShowTimeHandle = UGCEventSystem.SetTimerLoop(self, self.UpdateShowTime, 1) + --end +end + +function W_TeamScore_RoundMode:OnClosePanel() + --if self.UpdateShowTimeHandle ~= nil then + -- UGCEventSystem.StopTimer(self.UpdateShowTimeHandle) + -- self.UpdateShowTimeHandle = nil + --end + if WidgetManager:IsVisiblePanel(WidgetConfig.EUIType.Ranking) then + WidgetManager:ClosePanel(WidgetConfig.EUIType.Ranking) + end +end + +function W_TeamScore_RoundMode:Construct() + WidgetLibrary.BindButtonClicked(self.NewButton_TC_ScoreBoard, self.ShowRankingWidget, self) + UGCEventSystem.AddListener(EventEnum.UpdateTeamScore, self.UpdateTeamScore, self) + UGCEventSystem.AddListener(EventEnum.UpdatePlayerInfo, self.UpdateLocalPlayerTeam, self) + UGCEventSystem.AddListener(EventEnum.PlayerIsAliveIsChange, self.UpdatePlayerAliveCount, self) + UGCEventSystem.AddListener(EventEnum.NewRound, self.UpdateRoundCount, self) + self:UpdateLocalPlayerTeam() + + self:UpdateTeamScore() + self:UpdateRoundCount(UGCGameSystem.GameState:GetRoundCount()) +end + +function W_TeamScore_RoundMode:UpdateLocalPlayerTeam() + -- 判断己方是team2还是team1 + local LocalPlayerTeamID = UGCGameSystem.GameState:GetPlayerTeamIDByPlayerKey(UGCSystemLibrary.GetLocalPlayerKey()) + if LocalPlayerTeamID == TeamConfig.TeamType.CT then + self.LeftTeamType, self.RightTeamType = TeamConfig.TeamType.CT, TeamConfig.TeamType.T + else + self.LeftTeamType, self.RightTeamType = TeamConfig.TeamType.T, TeamConfig.TeamType.CT + end +end + +--- 更新比分 +function W_TeamScore_RoundMode:UpdateTeamScore() + local LeftTeamScore = UGCGameSystem.GameState:GetTeamScore(self.LeftTeamType) + local RightTeamScore = UGCGameSystem.GameState:GetTeamScore(self.RightTeamType) + self.TextBlock_LeftTeamScore:SetText(LeftTeamScore) + self.TextBlock_RightTeamScore:SetText(RightTeamScore) + if math.max(LeftTeamScore, RightTeamScore) >= GlobalConfigs.GameSetting.MaxRound // 2 then + self.Overlay_IsMatchPoint:SetVisibility(ESlateVisibility.HitTestInvisible) + end +end + +--- 显示排行榜UI +function W_TeamScore_RoundMode:ShowRankingWidget() + self.Image_Tip:SetVisibility(ESlateVisibility.Collapsed) + if WidgetManager:IsVisiblePanel(WidgetConfig.EUIType.Ranking) then + WidgetManager:ClosePanel(WidgetConfig.EUIType.Ranking) + else + WidgetManager:ShowPanel(WidgetConfig.EUIType.Ranking, false) + end +end + +--- 更新显示时间 +function W_TeamScore_RoundMode:UpdateShowTime() + local Time = UGCGameSystem.GameState:GetGameTime() + self:CheckAddTip(Time) + self.TextBlock_RemainTime:SetText(UGCSystemLibrary.formatTime(Time, true)) +end + +--- 判断是否要结束时给予提示 +function W_TeamScore_RoundMode:CheckAddTip(Time) + if UGCGameSystem.GameState:GetGameStateType() ~= CustomEnum.EGameState.Playing then + return + end + local TeamLessThanOneMinute = false + if Time <= 60 then + TeamLessThanOneMinute = true + end + + if self.LessThanOneMinute ~= TeamLessThanOneMinute then + self.LessThanOneMinute = TeamLessThanOneMinute + if self.LessThanOneMinute then + UGCEventSystem.SendEvent(EventEnum.AddTip, TipConfig.TipType.OneMinuteRemaining) + --- 播放即将结束的音乐 + SoundSystem.PlaySound(SoundSystem.ESound.AboutToEnd) + self.DoOnceTip1min = false + self.TextBlock_RemainTime:SetColorAndOpacity({SpecifiedColor = {R = 1, G = 0, B = 0, A = 1}, ColorUseRule = 0}) + else + self.TextBlock_RemainTime:SetColorAndOpacity({SpecifiedColor = {R = 1, G = 1, B = 1, A = 1}, ColorUseRule = 0}) + end + end + +end + +function W_TeamScore_RoundMode:UpdatePlayerAliveCount() + local LeftCount = UGCGameSystem.GameState:GetTeamAlivePlayerCount(self.LeftTeamType) + local RightCount = UGCGameSystem.GameState:GetTeamAlivePlayerCount(self.RightTeamType) + self.TextBlock_LeftPlayerCount:SetText(LeftCount) + self.TextBlock_RightPlayerCount:SetText(RightCount) +end + +function W_TeamScore_RoundMode:UpdateRoundCount(InRound) + --self.TextBlock_Round:SetText(InRound .. " / " .. GlobalConfigs.GameSetting.MaxRound) + self.TextBlock_Round:SetText(InRound) +end + +return W_TeamScore_RoundMode; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/TeamScore/W_TeamScore_RoundMode_2.lua b/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/TeamScore/W_TeamScore_RoundMode_2.lua new file mode 100644 index 00000000..041b77b0 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/TeamScore/W_TeamScore_RoundMode_2.lua @@ -0,0 +1,217 @@ +---@class W_TeamScore_RoundMode_2_C:UUserWidget +---@field CanvasPanel_EnemyAlive UCanvasPanel +---@field CanvasPanel_SelfAlive UCanvasPanel +---@field HorizontalBox_EnemyTeamPlayers UHorizontalBox +---@field HorizontalBox_SelfTeamPlayers UHorizontalBox +---@field NewButton_TC_ScoreBoard UNewButton +---@field TextBlock_EnemyAlive UTextBlock +---@field TextBlock_LeftPlayerCount UTextBlock +---@field TextBlock_LeftTeamScore UTextBlock +---@field TextBlock_RightPlayerCount UTextBlock +---@field TextBlock_RightTeamScore UTextBlock +---@field TextBlock_Round UTextBlock +---@field TextBlock_SelfTeamAlive UTextBlock +---@field WidgetSwitcher_AliveState UWidgetSwitcher +---@field WidgetSwitcher_EnemyTextTip UWidgetSwitcher +---@field WidgetSwitcher_SelfTextTip UWidgetSwitcher +--Edit Below-- +---@type W_TeamScore_RoundMode_2_C +local W_TeamScore_RoundMode_2 = { + bInitDoOnce = false; + TeamLessThanOneMinute = true; + LeftTeamID = 1; + RightTeamID = 2; + UpdateFPS = 1.; + LocalPlayerIsInBattle = false; +}; + +function W_TeamScore_RoundMode_2:OnShowPanel() + if self.LoopUpdateHandle == nil then + self.LoopUpdateHandle = UGCEventSystem.SetTimerLoop(self, self.LoopUpdate, 1. / self.UpdateFPS) + end +end + +function W_TeamScore_RoundMode_2:OnClosePanel() + if self.LoopUpdateHandle then + UGCEventSystem.StopTimer(self.LoopUpdateHandle) + self.LoopUpdateHandle = nil + end + + if WidgetManager:IsVisiblePanel(WidgetConfig.EUIType.Ranking) then + WidgetManager:ClosePanel(WidgetConfig.EUIType.Ranking) + end +end + +function W_TeamScore_RoundMode_2:Construct() + UGCLogSystem.Log("[W_TeamScore_RoundMode_2_Construct]") + WidgetLibrary.BindButtonClicked(self.NewButton_TC_ScoreBoard, self.ShowRankingWidget, self) + UGCEventSystem.AddListener(EventEnum.UpdateTeamScore, self.UpdateTeamScore, self) + UGCEventSystem.AddListener(EventEnum.UpdatePlayerInfo, self.UpdateLocalPlayerTeam, self) + UGCEventSystem.AddListener(EventEnum.PlayerIsAliveIsChange, self.UpdatePlayerAliveCount, self) + UGCEventSystem.AddListener(EventEnum.NewRound, self.UpdateRoundCount, self) + + + -- 显示己方队伍血量 + for i = 1, self.HorizontalBox_SelfTeamPlayers:GetChildrenCount() do + local Item = self.HorizontalBox_SelfTeamPlayers:GetChildAt(i - 1); + Item:SetShowHealth(true) + Item:SetShowFrame(false) + Item:ShowTeamFrame(1) + end + -- 显示设置敌方框 + for i = 1, self.HorizontalBox_EnemyTeamPlayers:GetChildrenCount() do + local Item = self.HorizontalBox_EnemyTeamPlayers:GetChildAt(i - 1); + Item:SetShowFrame(false) + Item:ShowTeamFrame(2) + end + + self:UpdateLocalPlayerTeam() + self:UpdateTeamScore() + self:UpdateRoundCount(UGCGameSystem.GameState:GetRoundCount()) + self:ChangeScorePanelState(false) +end + +function W_TeamScore_RoundMode_2:LoopUpdate() + --local LocalPawn = UGCSystemLibrary.GetLocalPlayerPawn() + --if UE.IsValid(LocalPawn) and not UGCPawnSystem.HasPawnState(LocalPawn, EPawnState.Dead) and not UGCGameSystem.GameState:IsReadyState() then + -- self:ChangeScorePanelState(true) + --else + -- self:ChangeScorePanelState(false) + --end + local AllPawn = UGCGameSystem.GetAllPlayerPawn() + local TeamAliveCount = {} + for i, v in pairs(AllPawn) do + if UE.IsValid(v) and not UGCPawnSystem.HasPawnState(v, EPawnState.Dead) then + local PlayerKey = v.PlayerKey + if PlayerKey then + local TeamID = UGCGameSystem.GameState:GetPlayerTeamIDByPlayerKey(PlayerKey) + if TeamAliveCount[TeamID] == nil then + TeamAliveCount[TeamID] = 0 + end + TeamAliveCount[TeamID] = TeamAliveCount[TeamID] + 1 + end + end + end + + local LeftCount = TeamAliveCount[self.LeftTeamID] + local RightCount = TeamAliveCount[self.RightTeamID] + LeftCount = (LeftCount and LeftCount or 0) + RightCount = (RightCount and RightCount or 0) + + self.TextBlock_LeftPlayerCount:SetText(LeftCount) + self.TextBlock_RightPlayerCount:SetText(RightCount) + self.TextBlock_SelfTeamAlive:SetText(LeftCount) + self.TextBlock_EnemyAlive:SetText(RightCount) + +end + +function W_TeamScore_RoundMode_2:ChangeScorePanelState(InLocalPlayerIsInBattle) + if self.LocalPlayerIsInBattle ~= InLocalPlayerIsInBattle then + -- UGCLogSystem.Log("[W_TeamScore_RoundMode_2_ChangeScorePanelState] InLocalPlayerIsInBattle:%s", tostring(InLocalPlayerIsInBattle)) + self.LocalPlayerIsInBattle = InLocalPlayerIsInBattle + if self.LocalPlayerIsInBattle then + --self.CanvasPanel_EnemyAlive:SetVisibility(ESlateVisibility.Collapsed) + --self.CanvasPanel_SelfAlive:SetVisibility(ESlateVisibility.Collapsed) + self.WidgetSwitcher_SelfTextTip:SetActiveWidgetIndex(1) + self.WidgetSwitcher_EnemyTextTip:SetActiveWidgetIndex(1) + self.WidgetSwitcher_AliveState:SetActiveWidgetIndex(1) + else + --self.CanvasPanel_EnemyAlive:SetVisibility(ESlateVisibility.SelfHitTestInvisible) + --self.CanvasPanel_SelfAlive:SetVisibility(ESlateVisibility.SelfHitTestInvisible) + self.WidgetSwitcher_SelfTextTip:SetActiveWidgetIndex(0) + self.WidgetSwitcher_EnemyTextTip:SetActiveWidgetIndex(0) + self.WidgetSwitcher_AliveState:SetActiveWidgetIndex(0) + end + end +end + +function W_TeamScore_RoundMode_2:UpdateLocalPlayerTeam() + -- 判断己方是team2还是team1 + local LocalPlayerTeamID = UGCGameSystem.GameState:GetPlayerTeamIDByPlayerKey(UGCSystemLibrary.GetLocalPlayerKey()) + if LocalPlayerTeamID == TeamConfig.TeamType.CT then + self.LeftTeamID, self.RightTeamID = 1, 2 + else + self.LeftTeamID, self.RightTeamID = 2, 1 + end + + local SelfTeamPlayers = UGCGameSystem.GameState:GetTeamPlayer(self.LeftTeamID) + local EnemyTeamPlayers = UGCGameSystem.GameState:GetTeamPlayer(self.RightTeamID) + + for i = 1, self.HorizontalBox_SelfTeamPlayers:GetChildrenCount() do + local Item = self.HorizontalBox_SelfTeamPlayers:GetChildAt(i - 1); + Item:UpdatePlayerInfo(SelfTeamPlayers[i]) + end + for i = 1, self.HorizontalBox_EnemyTeamPlayers:GetChildrenCount() do + local Item = self.HorizontalBox_EnemyTeamPlayers:GetChildAt(i - 1); + Item:UpdatePlayerInfo(EnemyTeamPlayers[i]) + end + +end + +--- 更新比分 +function W_TeamScore_RoundMode_2:UpdateTeamScore() + local LeftTeamScore = UGCGameSystem.GameState:GetTeamScore(self.LeftTeamID) + local RightTeamScore = UGCGameSystem.GameState:GetTeamScore(self.RightTeamID) + self.TextBlock_LeftTeamScore:SetText(LeftTeamScore) + self.TextBlock_RightTeamScore:SetText(RightTeamScore) + --if math.max(LeftTeamScore, RightTeamScore) >= GlobalConfigs.GameSetting.MaxRound // 2 then + -- self.Overlay_IsMatchPoint:SetVisibility(ESlateVisibility.HitTestInvisible) + --end +end + +--- 显示排行榜UI +function W_TeamScore_RoundMode_2:ShowRankingWidget() + if WidgetManager:IsVisiblePanel(WidgetConfig.EUIType.Ranking) then + WidgetManager:ClosePanel(WidgetConfig.EUIType.Ranking) + else + WidgetManager:ShowPanel(WidgetConfig.EUIType.Ranking, false) + end +end + +--- 更新显示时间 +function W_TeamScore_RoundMode_2:UpdateShowTime() + local Time = UGCGameSystem.GameState:GetGameTime() + self:CheckAddTip(Time) + self.TextBlock_RemainTime:SetText(UGCSystemLibrary.formatTime(Time, true)) +end + +--- 判断是否要结束时给予提示 +function W_TeamScore_RoundMode_2:CheckAddTip(Time) + if UGCGameSystem.GameState:GetGameStateType() ~= CustomEnum.EGameState.Playing then + return + end + local TeamLessThanOneMinute = false + if Time <= 60 then + TeamLessThanOneMinute = true + end + + if self.LessThanOneMinute ~= TeamLessThanOneMinute then + self.LessThanOneMinute = TeamLessThanOneMinute + if self.LessThanOneMinute then + UGCEventSystem.SendEvent(EventEnum.AddTip, TipConfig.TipType.OneMinuteRemaining) + --- 播放即将结束的音乐 + SoundSystem.PlaySound(SoundSystem.ESound.AboutToEnd) + self.DoOnceTip1min = false + self.TextBlock_RemainTime:SetColorAndOpacity({SpecifiedColor = {R = 1, G = 0, B = 0, A = 1}, ColorUseRule = 0}) + else + self.TextBlock_RemainTime:SetColorAndOpacity({SpecifiedColor = {R = 1, G = 1, B = 1, A = 1}, ColorUseRule = 0}) + end + end + +end + +function W_TeamScore_RoundMode_2:UpdatePlayerAliveCount() + local LeftCount = UGCGameSystem.GameState:GetTeamAlivePlayerCount(self.LeftTeamID) + local RightCount = UGCGameSystem.GameState:GetTeamAlivePlayerCount(self.RightTeamID) + self.TextBlock_LeftPlayerCount:SetText(LeftCount) + self.TextBlock_RightPlayerCount:SetText(RightCount) + self.TextBlock_SelfTeamAlive:SetText(LeftCount) + self.TextBlock_EnemyAlive:SetText(RightCount) +end + +function W_TeamScore_RoundMode_2:UpdateRoundCount(InRound) + self.TextBlock_Round:SetText(InRound .. " / " .. GlobalConfigs.GameSetting.MaxRound) + --self.TextBlock_Round:SetText(InRound) +end + +return W_TeamScore_RoundMode_2; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/TeamScore/W_TeamScore_TargetScore.lua b/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/TeamScore/W_TeamScore_TargetScore.lua new file mode 100644 index 00000000..6ac2c408 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/TeamScore/W_TeamScore_TargetScore.lua @@ -0,0 +1,98 @@ +---@class W_TeamScore_TargetScore_C:UUserWidget +---@field Image_Tip UImage +---@field NewButton_TC_ScoreBoard UNewButton +---@field TextBlock_LeftTeamScore UTextBlock +---@field TextBlock_RemainTime UTextBlock +---@field TextBlock_RightTeamScore UTextBlock +---@field TextBlock_TargetScore UTextBlock +--Edit Below-- +---@type W_TeamScore_TargetScore_C +local W_TeamScore_TargetScore = { + bInitDoOnce = false; + TeamLessThanOneMinute = true; + LeftTeamType = 1; + RightTeamType = 2; +}; + +function W_TeamScore_TargetScore:OnShowPanel() + if self.UpdateShowTimeHandle == nil then + self.UpdateShowTimeHandle = UGCEventSystem.SetTimerLoop(self, self.UpdateShowTime, 1) + end +end + +function W_TeamScore_TargetScore:OnClosePanel() + if self.UpdateShowTimeHandle ~= nil then + UGCEventSystem.StopTimer(self.UpdateShowTimeHandle) + self.UpdateShowTimeHandle = nil + end + if WidgetManager:IsVisiblePanel(WidgetConfig.EUIType.Ranking) then + WidgetManager:ClosePanel(WidgetConfig.EUIType.Ranking) + end +end + +function W_TeamScore_TargetScore:Construct() + WidgetLibrary.TextBlockBindingPropertyText(self.TextBlock_RemainTime, self.TextBlock_RemainTime_Text, self) + WidgetLibrary.BindButtonClicked(self.NewButton_TC_ScoreBoard, self.ShowRankingWidget, self) + UGCEventSystem.AddListener(EventEnum.UpdateTeamScore, self.UpdateTeamScore, self) + + -- 判断己方是team2还是team1 + local LocalPlayerTeamID = UGCPlayerControllerSystem.GetTeamID(UGCSystemLibrary.GetLocalPlayerController()) + if LocalPlayerTeamID == TeamConfig.TeamType.CT then + self.LeftTeamType, self.RightTeamType = TeamConfig.TeamType.CT, TeamConfig.TeamType.T + else + self.LeftTeamType, self.RightTeamType = TeamConfig.TeamType.T, TeamConfig.TeamType.CT + end + + self.TextBlock_TargetScore:SetText(tostring(GlobalConfigs.GameSetting.TargetTeamScore)) + self:UpdateTeamScore() +end + +--- 更新比分 +function W_TeamScore_TargetScore:UpdateTeamScore() + self.TextBlock_LeftTeamScore:SetText(UGCGameSystem.GameState:GetTeamScore(self.LeftTeamType)) + self.TextBlock_RightTeamScore:SetText(UGCGameSystem.GameState:GetTeamScore(self.RightTeamType)) +end + +--- 显示排行榜UI +function W_TeamScore_TargetScore:ShowRankingWidget() + self.Image_Tip:SetVisibility(ESlateVisibility.Collapsed) + if WidgetManager:IsVisiblePanel(WidgetConfig.EUIType.Ranking) then + WidgetManager:ClosePanel(WidgetConfig.EUIType.Ranking) + else + WidgetManager:ShowPanel(WidgetConfig.EUIType.Ranking, false) + end +end + +--- 更新显示时间 +function W_TeamScore_TargetScore:UpdateShowTime() + local Time = UGCGameSystem.GameState:GetGameTime() + self:CheckAddTip(Time) + self.TextBlock_RemainTime:SetText(UGCSystemLibrary.formatTime(Time, true)) +end + +--- 判断是否要结束时给予提示 +function W_TeamScore_TargetScore:CheckAddTip(Time) + if UGCGameSystem.GameState:GetGameStateType() ~= CustomEnum.EGameState.Playing then + return + end + local TeamLessThanOneMinute = false + if Time <= 60 then + TeamLessThanOneMinute = true + end + + if self.LessThanOneMinute ~= TeamLessThanOneMinute then + self.LessThanOneMinute = TeamLessThanOneMinute + if self.LessThanOneMinute then + UGCEventSystem.SendEvent(EventEnum.AddTip, TipConfig.TipType.OneMinuteRemaining) + --- 播放即将结束的音乐 + SoundSystem.PlaySound(SoundSystem.ESound.AboutToEnd) + self.DoOnceTip1min = false + self.TextBlock_RemainTime:SetColorAndOpacity({SpecifiedColor = {R = 1, G = 0, B = 0, A = 1}, ColorUseRule = 0}) + else + self.TextBlock_RemainTime:SetColorAndOpacity({SpecifiedColor = {R = 1, G = 1, B = 1, A = 1}, ColorUseRule = 0}) + end + end + +end + +return W_TeamScore_TargetScore; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/WB_DistanceDefenseLine.lua b/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/WB_DistanceDefenseLine.lua new file mode 100644 index 00000000..826fecca --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/WB_DistanceDefenseLine.lua @@ -0,0 +1,67 @@ +---@class WB_DistanceDefenseLine_C:UUserWidget +---@field Image_Player1 UImage +---@field Image_Player2 UImage +---@field Image_Player3 UImage +---@field TextBlock_BreakThrough UTextBlock +--Edit Below-- +local WB_DistanceDefenseLine = { + bInitDoOnce = false; + Range = 50; + WidgetRange = 400 + +}; + + +--function WB_DistanceDefenseLine:Construct() +-- +--end + +-- 这个UI大概率不会二次利用就不抽象了,耦合度挺高的!!!!!!!!!!!!!!!!!!!!!!!! + +function WB_DistanceDefenseLine:Init() + WidgetLibrary.TextBlockBindingPropertyText(self.TextBlock_BreakThrough, self.UpdateBreakThrough, self) + UGCEventSystem.SetTimerLoop(self, self.UpdatePlayerDis, 0.05) + + self.PlayerMoveWidget = {self.Image_Player1, self.Image_Player2, self.Image_Player3} +end + +function WB_DistanceDefenseLine:UpdateBreakThrough() + return UGCGameSystem.GameState.BreakThroughNum .. "/" .. UGCGameSystem.GameState.MaxBreakThroughNum +end + +function WB_DistanceDefenseLine:UpdatePlayerDis() + local DefenderIndex = UGCGameSystem.GameState.DefenderIndex + local AllDefender = UGCGameSystem.GameState.AllDefender + local Index = 0 + local LineOfDefense = PlacementModeConfig.GetSimpleLineOfDefense() + if UE.IsValid(LineOfDefense) then + local LineOfDefensePos = LineOfDefense:K2_GetActorLocation() + for i = 1, 4 do + local PlayerKey = AllDefender[i] + if i ~= DefenderIndex then + local Pawn = UGCGameSystem.GetPlayerPawnByPlayerKey(PlayerKey) + Index = Index + 1 + if Index <= #self.PlayerMoveWidget then + if UE.IsValid(Pawn) then + local Length = VectorHelper.Length2D(VectorHelper.Sub2D(Pawn:K2_GetActorLocation(), LineOfDefensePos)) / 100 + Length = math.clamp(Length, 0, self.Range) + self.PlayerMoveWidget[Index]:SetRenderTranslation({X = (1 - Length / self.Range) * self.WidgetRange, Y = 0}) + self.PlayerMoveWidget[Index]:SetVisibility(ESlateVisibility.HitTestInvisible) + else + self.PlayerMoveWidget[Index]:SetVisibility(ESlateVisibility.Collapsed) + end + end + end + end + end +end + +-- function WB_DistanceDefenseLine:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_DistanceDefenseLine:Destruct() + +-- end + +return WB_DistanceDefenseLine; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/WB_FightPanel.lua b/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/WB_FightPanel.lua new file mode 100644 index 00000000..3d611de8 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/WB_FightPanel.lua @@ -0,0 +1,35 @@ +---@class WB_FightPanel_C:UAEUserWidget +---@field Button_ShowGuide UButton +---@field NewButton_GM UNewButton +---@field W_TeamScore_RoundMode_2 UW_TeamScore_RoundMode_2_C +---@field WB_HP UWB_HP_C +---@field WB_ShowBuff UWB_ShowBuff_C +--Edit Below-- +---@type WB_FightPanel_C +local WB_FightPanel = { bInitDoOnce = false; }; + +function WB_FightPanel:Construct() + self:LuaInit(); + if GlobalConfigs.IsDebug then + self.NewButton_GM:SetVisibility(ESlateVisibility.Visible) + WidgetLibrary.ButtonOnClickShowPanel(self.NewButton_GM, WidgetConfig.EUIType.Debug) + end +end + +function WB_FightPanel:LuaInit() + if self.bInitDoOnce then return end + self.bInitDoOnce = true + + WidgetLibrary.ButtonOnClickShowPanel(self.Button_ShowGuide, WidgetConfig.EUIType.Guide); +end + +function WB_FightPanel:OnShowPanel() + self.W_TeamScore_RoundMode_2:OnShowPanel() +end + +function WB_FightPanel:OnClosePanel() + self.W_TeamScore_RoundMode_2:OnClosePanel() +end + + +return WB_FightPanel; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/WB_HP.lua b/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/WB_HP.lua new file mode 100644 index 00000000..6b8c3f2c --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/WB_HP.lua @@ -0,0 +1,53 @@ +---@class WB_HP_C:UUserWidget +---@field TextBlock_HP UTextBlock +---@field TextBlock_MaxHP UTextBlock +--Edit Below-- +local WB_HP = { + bInitDoOnce = false; + HealthColor = {R = 0, G = 1, B = 0, A = 1}; + UnHealthColor = {R = 1, G = 0, B = 0, A = 1}; + HealthProportion = 0.4 +}; + + +function WB_HP:Construct() + UGCEventSystem.SetTimerLoop(self, self.UpdateHealth, 0.1) +end + +function WB_HP:UpdateHealth() + local Pawn = UGCSystemLibrary.GetLocalPlayerPawn() + if UE.IsValid(Pawn) and not UGCPawnSystem.HasPawnState(Pawn, EPawnState.Dead) then + local HP = KismetMathLibrary.Round(UGCPawnAttrSystem.GetHealth(Pawn)) + local MaxHP = KismetMathLibrary.Round(UGCPawnAttrSystem.GetHealthMax(Pawn)) + self.TextBlock_HP:SetText(HP) + self.TextBlock_MaxHP:SetText(MaxHP) + if HP / MaxHP > self.HealthProportion then + self.TextBlock_HP:SetColorAndOpacity({SpecifiedColor = self.HealthColor, ColorUseRule = 0}) + else + self.TextBlock_HP:SetColorAndOpacity({SpecifiedColor = self.UnHealthColor, ColorUseRule = 0}) + end + self:SetVis(true) + else + self:SetVis(false) + end +end +function WB_HP:SetVis(IsVis) + if self.IsVis ~= IsVis then + self.IsVis = IsVis + if self.IsVis then + self:SetVisibility(ESlateVisibility.SelfHitTestInvisible) + else + self:SetVisibility(ESlateVisibility.Collapsed) + end + end +end + +-- function WB_HP:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_HP:Destruct() + +-- end + +return WB_HP; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/WB_HeadingInfo.lua b/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/WB_HeadingInfo.lua new file mode 100644 index 00000000..cc7d0e9c --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/WB_HeadingInfo.lua @@ -0,0 +1,21 @@ +---@class WB_HeadingInfo_C:UUserWidget +---@field TextBlock_Kill UTextBlock +---@field TextBlock_Score UTextBlock +--Edit Below-- +---@type WB_HeadingInfo_C +local WB_HeadingInfo = { bInitDoOnce = false; }; + +function WB_HeadingInfo:Construct() + UGCEventSystem.AddListener(EventEnum.UpdatePlayerScoreData, self.UpdatePlayerScoreData, self) +end + +function WB_HeadingInfo:UpdatePlayerScoreData() + UGCLogSystem.LogTree("[WB_HeadingInfo_UpdatePlayerScoreData]", PlayerScoreSystem.GetPlayerScoreDatas()) + local LocalPK = UGCSystemLibrary.GetLocalPlayerKey() + self.TextBlock_Score:SetText(tostring(PlayerScoreSystem.GetPlayerScore(LocalPK))) + self.TextBlock_Kill:SetText(tostring(PlayerScoreSystem.GetPlayerScoreDataFromType(LocalPK, PlayerScoreSystem.Config.EScoreType.Kills))) +end + + + +return WB_HeadingInfo; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/WB_ShowMechanismEnergy.lua b/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/WB_ShowMechanismEnergy.lua new file mode 100644 index 00000000..19696fdc --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/WB_ShowMechanismEnergy.lua @@ -0,0 +1,24 @@ +---@class WB_ShowMechanismEnergy_C:UUserWidget +---@field TextBlock_Energy UTextBlock +--Edit Below-- +---@type WB_ShowMechanismEnergy_C +local WB_ShowMechanismEnergy = { bInitDoOnce = false; }; + + +function WB_ShowMechanismEnergy:Construct() + WidgetLibrary.TextBlockBindingPropertyText(self.TextBlock_Energy, self.UpdateEnergyValue, self) +end + +function WB_ShowMechanismEnergy:UpdateEnergyValue() + return string.format("%0.0f", (UGCSystemLibrary.GetLocalPlayerPawn() and UGCSystemLibrary.GetLocalPlayerPawn():GetMechanismEnergy() or 0)) +end + +-- function WB_ShowMechanismEnergy:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_ShowMechanismEnergy:Destruct() + +-- end + +return WB_ShowMechanismEnergy; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/WB_ToGod.lua b/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/WB_ToGod.lua new file mode 100644 index 00000000..42d939b1 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/FightPanel/WB_ToGod.lua @@ -0,0 +1,70 @@ +---@class WB_ToGod_C:UUserWidget +---@field ToGod UWidgetAnimation +---@field AddToGod UWidgetAnimation +---@field ProgressBar_ToGod UProgressBar +---@field TextBlock_Count UTextBlock +---@field WidgetSwitcher_IsGod UWidgetSwitcher +--Edit Below-- +local WB_ToGod = { + bInitDoOnce = false; + LastCount = 0; +}; + + +function WB_ToGod:Construct() + UGCEventSystem.AddListener(EventEnum.UpdateToGodSchedule, self.UpdateToGod, self) + self:ResetInfo() + UGCEventSystem.SetTimerLoop(self, + function() + local LocalPawn = UGCGameSystem.GameState:GetAlivePawn(UGCSystemLibrary.GetLocalPlayerKey()) + if LocalPawn then + self:UpdateToGod(LocalPawn, LocalPawn:GetToGodSchedule()) + end + end + , 2) +end + +function WB_ToGod:ResetInfo() + self.WidgetSwitcher_IsGod:SetActiveWidgetIndex(0) + self.TextBlock_Count:SetText(string.format("击倒 0/%s", tostring(GodOfWarConfig.ToGodCondition))) + self.ProgressBar_ToGod:SetPercent(0) + self.LastCount = 0 +end + +function WB_ToGod:UpdateToGod(InPawn, ToGodSchedule) + -- UGCLogSystem.Log("[WB_ToGod_UpdateToGod] ToGodSchedule:%s", tostring(ToGodSchedule)) + local LocalPawn = UGCGameSystem.GameState:GetAlivePawn(UGCSystemLibrary.GetLocalPlayerKey()) + if LocalPawn and LocalPawn == InPawn then + if ToGodSchedule ~= self.LastCount then + --UGCLogSystem.Log("[WB_ToGod_UpdateToGod]LocalPawn:%s, InPawn:%s ", tostring(LocalPawn), tostring(InPawn)) + --UGCLogSystem.Log("[WB_ToGod_UpdateToGod] ToGodSchedule:%s, self.LastCount:%s", tostring(ToGodSchedule), tostring(self.LastCount)) + if ToGodSchedule >= GodOfWarConfig.ToGodCondition then + self.WidgetSwitcher_IsGod:SetActiveWidgetIndex(1) + if self.LastCount < GodOfWarConfig.ToGodCondition then + UGCLogSystem.Log("[WB_ToGod_UpdateToGod] Show Animation") + self:PlayAnimation(self.ToGod, 0, 1, EUMGSequencePlayMode.Forward, 1); + end + else + self.WidgetSwitcher_IsGod:SetActiveWidgetIndex(0) + if ToGodSchedule > 0 and ToGodSchedule ~= self.LastCount then + self:PlayAnimation(self.AddToGod, 0, 1, EUMGSequencePlayMode.Forward, 1); + end + self.TextBlock_Count:SetText(string.format("击倒 %s/%s", tostring(ToGodSchedule), tostring(GodOfWarConfig.ToGodCondition))) + self.ProgressBar_ToGod:SetPercent(ToGodSchedule / GodOfWarConfig.ToGodCondition) + end + self.LastCount = ToGodSchedule + end + end +end + + + +-- function WB_ToGod:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_ToGod:Destruct() + +-- end + +return WB_ToGod; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/GamePreparation/WB_RandomSelectPlayerVoteMap.lua b/CounterAttack_Solo/Script/UI/StatusUI/GamePreparation/WB_RandomSelectPlayerVoteMap.lua new file mode 100644 index 00000000..8deaa527 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/GamePreparation/WB_RandomSelectPlayerVoteMap.lua @@ -0,0 +1,78 @@ +---@class WB_RandomSelectPlayerVoteMap_C:UUserWidget +---@field HorizontalBox_MapInfoItems UHorizontalBox +--Edit Below-- +---@type WB_RandomSelectPlayerVoteMap_C +local WB_RandomSelectPlayerVoteMap = { + bInitDoOnce = false; + CycleNum = 0; + MaxCycleNum = 1; + SwitchWaitTime = 0.2; + -- 已选择时在其停留的闪烁次数 + SelectedLoopNum = 3; + LastSelectIndex = 0; +}; + +--[==[ Construct +function WB_RandomSelectPlayerVoteMap:Construct() + +end +-- Construct ]==] + +-- function WB_RandomSelectPlayerVoteMap:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_RandomSelectPlayerVoteMap:Destruct() + +-- end + +function WB_RandomSelectPlayerVoteMap:ShowVoteRandomMap(MapList, InTargetIndex, InLifeTime) + self.SelectMapNum = #MapList + if self.SelectMapNum <= 1 then + return + end + self.TargetIndex = InTargetIndex + self.LifeTime = InLifeTime + for i = 1, self.HorizontalBox_MapInfoItems:GetChildrenCount() do + local Item = self.HorizontalBox_MapInfoItems:GetChildAt(i - 1) + if i > #MapList then + Item:SetVisibility(ESlateVisibility.Collapsed) + else + Item:InitSelectItem(MapList[i]) + end + end + local TempMaxCycleNum = (self.LifeTime / self.SwitchWaitTime - self.TargetIndex - self.SelectedLoopNum * 2) / self.SelectMapNum + self.MaxCycleNum = math.floor(TempMaxCycleNum) + self.StartRollTime = UGCSystemLibrary.GetGameTime() + UGCLogSystem.Log("[WB_RandomSelectPlayerVoteMap_ShowVoteRandomMap] MaxCycleNum:%s, TargetIndex:%s", tostring(self.MaxCycleNum), tostring(self.TargetIndex)) + self.RollSelectItemHandle = UGCEventSystem.SetTimerLoop(self, self.RollSelectItem, self.SwitchWaitTime) +end + +function WB_RandomSelectPlayerVoteMap:RollSelectItem() + UGCLogSystem.Log("[WB_RandomSelectPlayerVoteMap_RollSelectItem]") + local LastItem = self.HorizontalBox_MapInfoItems:GetChildAt(self.LastSelectIndex) + if self.LastSelectIndex == self.TargetIndex - 1 and self.CycleNum == self.MaxCycleNum then + LastItem:SetSelect(not LastItem:GetIsSelect()) + else + LastItem:SetSelect(false) + if self.LastSelectIndex + 1 >= self.SelectMapNum then + self.CycleNum = self.CycleNum + 1 + end + self.LastSelectIndex = (self.LastSelectIndex + 1) % self.SelectMapNum + local Item = self.HorizontalBox_MapInfoItems:GetChildAt(self.LastSelectIndex) + Item:SetSelect(true) + end + + if UGCSystemLibrary.GetGameTime() - self.StartRollTime >= self.LifeTime then + self:StopLoop() + end +end + +function WB_RandomSelectPlayerVoteMap:StopLoop() + if self.RollSelectItemHandle then + UGCEventSystem.StopTimer(self.RollSelectItemHandle) + self.RollSelectItemHandle = nil + end +end + +return WB_RandomSelectPlayerVoteMap; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/GamePreparation/WB_SelectDefaultWeapon.lua b/CounterAttack_Solo/Script/UI/StatusUI/GamePreparation/WB_SelectDefaultWeapon.lua new file mode 100644 index 00000000..6f6f6dec --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/GamePreparation/WB_SelectDefaultWeapon.lua @@ -0,0 +1,87 @@ +---@class WB_SelectDefaultWeapon_C:UUserWidget +---@field Button_Select UButton +---@field Image_1 UImage +---@field Image_Weapon UImage +---@field Overlay_1 UOverlay +---@field Overlay_Defaut UOverlay +---@field Overlay_IsVote UOverlay +---@field WidgetSwitcher_VoteState UWidgetSwitcher +--Edit Below-- +---@type WB_SelectDefaultWeapon_C +local WB_SelectDefaultWeapon = { + bInitDoOnce = false; + bVote = false; +}; + +--[==[ Construct +function WB_SelectDefaultWeapon:Construct() + +end +-- Construct ]==] + +-- function WB_SelectDefaultWeapon:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_SelectDefaultWeapon:Destruct() + +-- end + +function WB_SelectDefaultWeapon:InitDefaultWeapon(InWeaponID, InParentObj, ParentObjSelectCallBack) + UGCEventSystem.AddListener(EventEnum.SelectDefaultWeaponCallBack, self.LocalPlayerSelectDefaultWeapon, self) + self.Button_Select:SetTouchMethod(EButtonTouchMethod.PreciseTap) + + self.WeaponID = InWeaponID + self.ParentObj = InParentObj + self.CallBackFunc = ParentObjSelectCallBack + + local WeaponInfo = UGCItemSystem.GetItemData(self.WeaponID) + if WeaponInfo then + local Tex = UGCSystemLibrary.LoadAsset(WeaponInfo.ItemSmallIcon_n, true) + if UE.IsValid(Tex) then + self.Image_Weapon:SetBrushFromTexture(Tex) + end + end + + WidgetLibrary.BindButtonClicked(self.Button_Select, self.SelectDefaultWeapon, self) + +end + +function WB_SelectDefaultWeapon:SelectDefaultWeapon() + SoundSystem.PlaySound(SoundSystem.ESound.Btn) + if self.CallBackFunc then + if self.ParentObj then + self.CallBackFunc(self.ParentObj, self.WeaponID) + else + self.CallBackFunc(self.WeaponID) + end + end +end + +function WB_SelectDefaultWeapon:GetWeaponID() + return self.WeaponID +end + +function WB_SelectDefaultWeapon:LocalPlayerSelectDefaultWeapon(bSucceed, InWeaponID) + if bSucceed and InWeaponID == self.WeaponID then + self.bVote = true + self.WidgetSwitcher_VoteState:SetActiveWidgetIndex(2) + else + self.bVote = false + self.WidgetSwitcher_VoteState:SetActiveWidgetIndex(0) + end +end + +function WB_SelectDefaultWeapon:SetSelect(bSelect) + if self.bVote == false then + if bSelect then + self.WidgetSwitcher_VoteState:SetActiveWidgetIndex(1) + else + self.WidgetSwitcher_VoteState:SetActiveWidgetIndex(0) + end + end +end + + + +return WB_SelectDefaultWeapon; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/GamePreparation/W_GamePreparation.lua b/CounterAttack_Solo/Script/UI/StatusUI/GamePreparation/W_GamePreparation.lua new file mode 100644 index 00000000..76010b5a --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/GamePreparation/W_GamePreparation.lua @@ -0,0 +1,232 @@ +---@class W_GamePreparation_C:UUserWidget +---@field Button_Close UButton +---@field Button_OpenSelect UButton +---@field Button_Select UButton +---@field CanvasPanel_BG UCanvasPanel +---@field CanvasPanel_Select UCanvasPanel +---@field Image_MapBG UImage +---@field Overlay_SelectMapName UOverlay +---@field Overlay_WaitTime UOverlay +---@field ScrollBox_DefaultWeapon UScrollBox +---@field ScrollBox_SelectMapBox UScrollBox +---@field TextBlock_Loading UTextBlock +---@field TextBlock_MapShowName UTextBlock +---@field TextBlock_MapSpecialMode UTextBlock +---@field TextBlock_SelectMapName UTextBlock +---@field TextBlock_WaitTime UTextBlock +---@field TextBlock_WaitTime_Mid UTextBlock +---@field VerticalBox_Loading UVerticalBox +---@field WB_RandomSelectPlayerVoteMap UWB_RandomSelectPlayerVoteMap_C +---@field WidgetSwitcher_MapBG UWidgetSwitcher +---@field WidgetSwitcher_SelectFinish UWidgetSwitcher +--Edit Below-- +---@type W_GamePreparation_C +local W_GamePreparation = { + bInitDoOnce = false; + LastSelectMapTime = -1.; + SelectMapType = -1; + bLoading = false; +}; + + +function W_GamePreparation:Construct() + + UGCEventSystem.AddListener(EventEnum.GameWillBegin, self.GameWillBegin, self) + UGCEventSystem.AddListener(EventEnum.LoadMap, self.LoadingMap, self) + UGCEventSystem.AddListener(EventEnum.GameStateChange, self.RemoveSelf, self) + UGCEventSystem.AddListener(EventEnum.RandomSelectVoteMap, self.RandomSelectVoteMap, self) + UGCEventSystem.AddListener(EventEnum.SelectMapCallBack, self.ServerSelectMapCallBack, self) + WidgetLibrary.BindButtonClicked(self.Button_Select, self.ClickSelectMap, self) + WidgetLibrary.BindButtonClicked(self.Button_Close, self.ClickCloseSelectMap, self) + WidgetLibrary.BindButtonClicked(self.Button_OpenSelect, self.ClickOpenSelectPanel, self) + WidgetLibrary.TextBlockBindingPropertyText(self.TextBlock_WaitTime, self.TextBlock_WaitTime_Text, self) + WidgetLibrary.TextBlockBindingPropertyText(self.TextBlock_WaitTime_Mid, self.TextBlock_WaitTime_Text, self) + + self:AddMapSelectItem() + self:AddWeaponSelectItem() + self:SelectMapCallBack(MapConfig.MapType.Random) + --local LoadMapType = UGCGameSystem.GameState:GetMapSelectionResult(false) + --if LoadMapType ~= nil then + -- self:LoadingMap(LoadMapType) + --end +end + +function W_GamePreparation:OnClosePanel() + UGCLogSystem.Log("[W_GamePreparation_OnClosePanel]") + self.bLoading = false + WidgetManager:DestroyPanel(WidgetConfig.EUIType.WaitingTime) +end + +function W_GamePreparation:RemoveSelf(NewGameState) + if NewGameState ~= CustomEnum.EGameState.Waiting and UE.IsValid(self) then + UGCEventSystem.SetTimer(self, self.OnClosePanel, GlobalConfigs.GameSetting.ClientLoadMapTime) + end +end + +function W_GamePreparation:TextBlock_WaitTime_Text(ReturnValue) + return tostring(UGCGameSystem.GameState.WaitPlayerJoinTime) +end + +function W_GamePreparation:GameWillBegin() + UGCLogSystem.Log("[W_GamePreparation_GameWillBegin]") + UGCEventSystem.SendEvent(EventEnum.AddTip, TipConfig.TipType.GameWillStart) +end + +function W_GamePreparation:AddWeaponSelectItem() + for i, TempWeaponID in pairs(WeaponGradientTable.DefaultWeapon) do + local WeaponSelectItem = UserWidget.NewWidgetObjectBP(UGCSystemLibrary.GetLocalPlayerController(), self:GetWeaponItemClass()) + self.ScrollBox_DefaultWeapon:AddChild(WeaponSelectItem) + WeaponSelectItem:InitDefaultWeapon(TempWeaponID, self, self.SelectWeaponCallBack) + if i == 1 then + self.WeaponID = TempWeaponID + WeaponSelectItem:SetSelect(true) + else + WeaponSelectItem:SetSelect(false) + end + end +end + +function W_GamePreparation:AddMapSelectItem() + + local MapTypeCount = table.getCount(MapConfig.MapType) + for i = 0, MapTypeCount - 1 do + local MapType = i + if i ~= 0 then + MapType = MapTypeCount - i + end + local MapInfo = MapConfig.MapInfo[MapType] + + local MapSelectItem = UserWidget.NewWidgetObjectBP(UGCSystemLibrary.GetLocalPlayerController(), self:GetMapItemClass()) + self.ScrollBox_SelectMapBox:AddChild(MapSelectItem) + MapSelectItem:InitSelectItem(MapType, self, self.SelectMapCallBack) + if MapInfo.Icon then + UGCSystemLibrary.LoadAsset(MapInfo.Icon, true) + end + if MapInfo.IconSelect then + UGCSystemLibrary.LoadAsset(MapInfo.IconSelect, true) + end + end + +end + +function W_GamePreparation:GetMapItemClass() + if self.ItemClass == nil then + self.ItemClass = UE.LoadClass(UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/StatusUI/GamePreparation/W_SelectMapItem.W_SelectMapItem_C')) + end + return self.ItemClass +end + +function W_GamePreparation:GetWeaponItemClass() + if self.WeaponItemClass == nil then + self.WeaponItemClass = UE.LoadClass(UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/StatusUI/GamePreparation/WB_SelectDefaultWeapon.WB_SelectDefaultWeapon_C')) + end + return self.WeaponItemClass +end + + +function W_GamePreparation:SelectMapCallBack(InSelectMapType) + self.SelectMapType = InSelectMapType + for i = 0, self.ScrollBox_SelectMapBox:GetChildrenCount() - 1 do + local SelectMapItem = self.ScrollBox_SelectMapBox:GetChildAt(i) + SelectMapItem:SetSelect(self.SelectMapType == SelectMapItem:GetSelectMapType()) + end + self:SetMapSelect(self.SelectMapType) +end + +function W_GamePreparation:SelectWeaponCallBack(InWeaponID) + self.WeaponID = InWeaponID + UGCLogSystem.Log("[W_GamePreparation_SelectWeaponCallBack] InWeaponID:%s", tostring(InWeaponID)) + for i = 0, self.ScrollBox_DefaultWeapon:GetChildrenCount() - 1 do + local SelectWeaponItem = self.ScrollBox_DefaultWeapon:GetChildAt(i) + SelectWeaponItem:SetSelect(self.WeaponID == SelectWeaponItem:GetWeaponID()) + end +end + +function W_GamePreparation:ClickSelectMap() + local NowTime = UGCSystemLibrary.GetGameTime() + if (NowTime - self.LastSelectMapTime > 1) and table.hasValue(MapConfig.MapType, self.SelectMapType) and MapConfig.MapEnable[self.SelectMapType] then + -- self.TextBlock_MapShowName:SetText(MapConfig.MapInfo[self.SelectMapType].ShowName) + --self.bSelected = true + self.LastSelectMapTime = NowTime + self.WidgetSwitcher_SelectFinish:SetActiveWidgetIndex(1) + UGCSendRPCSystem.ActorRPCNotify(nil, UGCGameSystem.GameState, "PlayerOverlapSelectMap", UGCSystemLibrary.GetLocalPlayerKey(), self.SelectMapType) + UGCSendRPCSystem.ActorRPCNotify(nil, UGCGameSystem.GameState, "PlayerSelectDefaultWeapon", UGCSystemLibrary.GetLocalPlayerKey(), self.WeaponID) + SoundSystem.PlaySound(SoundSystem.ESound.Btn) + UGCLogSystem.Log("[W_GamePreparation_ClickSelectMap] Finish") + -- 防止未关闭UI + self:ServerSelectMapCallBack(true, self.SelectMapType) + end +end + +function W_GamePreparation:LoadingMap(LoadMapType) + self.WB_RandomSelectPlayerVoteMap:SetVisibility(ESlateVisibility.Collapsed) + self.CanvasPanel_Select:SetVisibility(ESlateVisibility.Collapsed) + self.VerticalBox_Loading:SetVisibility(ESlateVisibility.SelfHitTestInvisible) + self.CanvasPanel_BG:SetVisibility(ESlateVisibility.SelfHitTestInvisible) + self.bLoading = true + self:SetMapSelect(LoadMapType) + UGCGameSystem.GameState:LoadNowMiniMap() +end + +function W_GamePreparation:SetMapSelect(SelectMapType) + UGCLogSystem.Log("[W_GamePreparation_SetMapSelect] SelectMapType:%s", tostring(SelectMapType)) + if SelectMapType == MapConfig.MapType.Random then + self.WidgetSwitcher_MapBG:SetActiveWidgetIndex(1) + else + self.WidgetSwitcher_MapBG:SetActiveWidgetIndex(0) + self.Image_MapBG:SetBrushFromTexture(UGCSystemLibrary.LoadAsset(MapConfig.MapInfo[SelectMapType].Icon, true)) + end + self:SetShowName(SelectMapType) +end + +function W_GamePreparation:SetShowName(SelectMapType) + local MapName = MapConfig.MapInfo[SelectMapType].ShowName + local ModeName = MapConfig.SpecialModeName[MapConfig.MapInfo[SelectMapType].SpecialModeType] + if ModeName and ModeName ~= "" then + MapName = string.format("%s - ( %s )", MapName, ModeName) + end + self.TextBlock_MapShowName:SetText(MapName) +end + + +function W_GamePreparation:RandomSelectVoteMap(MapList, InTargetIndex) + self.WB_RandomSelectPlayerVoteMap:SetVisibility(ESlateVisibility.SelfHitTestInvisible) + self.WB_RandomSelectPlayerVoteMap:ShowVoteRandomMap(MapList, InTargetIndex, GlobalConfigs.GameSetting.RollMapTime) +end + +function W_GamePreparation:SetSelectingVis(IsVis) + UGCLogSystem.Log("[W_GamePreparation_SetSelectingVis]") + local IsShow = IsVis and ESlateVisibility.SelfHitTestInvisible or ESlateVisibility.Collapsed + self.CanvasPanel_Select:SetVisibility(IsShow) + self.CanvasPanel_BG:SetVisibility(IsShow) +end + +function W_GamePreparation:ClickOpenSelectPanel() + self:SetSelectingVis(true) +end + +function W_GamePreparation:ClickCloseSelectMap() + self:SetSelectingVis(false) +end + +function W_GamePreparation:ServerSelectMapCallBack(bIsSucceed, InSelectMapType) + local MapInfo = MapConfig.MapInfo[InSelectMapType] + if MapInfo then + self.TextBlock_SelectMapName:SetText(MapInfo.ShowName) + if MapInfo.SpecialModeType ~= MapConfig.ESpecialModeType.Default then + self.TextBlock_MapSpecialMode:SetText(string.format(" (%s)", MapConfig.SpecialModeName[MapInfo.SpecialModeType])) + else + self.TextBlock_MapSpecialMode:SetText("") + end + UGCLogSystem.Log("[W_GamePreparation_ServerSelectMapCallBack]") + self:SetSelectingVis(false) + else + UGCLogSystem.LogError("[W_GamePreparation_ServerSelectMapCallBack] InSelectMapType:%s", tostring(InSelectMapType)) + end +end + +-- function W_GamePreparation:Destruct() + +-- end + +return W_GamePreparation; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/GamePreparation/W_GamePreparation_2.lua b/CounterAttack_Solo/Script/UI/StatusUI/GamePreparation/W_GamePreparation_2.lua new file mode 100644 index 00000000..2c674bc9 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/GamePreparation/W_GamePreparation_2.lua @@ -0,0 +1,118 @@ +---@class W_GamePreparation_2_C:UUserWidget +---@field CanvasPanel_Loading UCanvasPanel +---@field Image_MapBG UImage +---@field Overlay_SelectMapName UOverlay +---@field Overlay_WaitTime UOverlay +---@field TextBlock_Loading UTextBlock +---@field TextBlock_MapShowName UTextBlock +---@field TextBlock_MapSpecialMode UTextBlock +---@field TextBlock_SelectMapName UTextBlock +---@field TextBlock_WaitTime UTextBlock +---@field VerticalBox_Loading UVerticalBox +---@field WB_RandomSelectPlayerVoteMap UWB_RandomSelectPlayerVoteMap_C +---@field WidgetSwitcher_MapBG UWidgetSwitcher +--Edit Below-- +---@type W_GamePreparation_2_C +local W_GamePreparation_2 = { + bInitDoOnce = false; + bSelected = false; + SelectMapType = -1; + bLoading = false; +}; + + +function W_GamePreparation_2:Construct() + self.TextBlock_WaitTime:BindingProperty("Text", self.TextBlock_WaitTime_Text, self) + UGCEventSystem.AddListener(EventEnum.GameWillBegin, self.GameWillBegin, self) + UGCEventSystem.AddListener(EventEnum.LoadMap, self.LoadingMap, self) + UGCEventSystem.AddListener(EventEnum.GameStateChange, self.RemoveSelf, self) + UGCEventSystem.AddListener(EventEnum.RandomSelectVoteMap, self.RandomSelectVoteMap, self) + UGCEventSystem.AddListener(EventEnum.SelectMapCallBack, self.SelectMapCallBack, self) + local LoadMapType = UGCGameSystem.GameState:GetMapSelectionResult(false) + if LoadMapType ~= nil then + self:LoadingMap(LoadMapType) + end +end + +function W_GamePreparation_2:OnClosePanel() + UGCLogSystem.Log("[W_GamePreparation_2_OnClosePanel]") + self.bLoading = false + WidgetManager:DestroyPanel(WidgetConfig.EUIType.WaitingTime) +end + +function W_GamePreparation_2:RemoveSelf(NewGameState) + if NewGameState ~= CustomEnum.EGameState.Waiting and UE.IsValid(self) then + UGCEventSystem.SetTimer(self, self.OnClosePanel, GlobalConfigs.GameSetting.ClientLoadMapTime) + end +end + +function W_GamePreparation_2:TextBlock_WaitTime_Text(ReturnValue) + return tostring(UGCGameSystem.GameState.WaitPlayerJoinTime) +end + +function W_GamePreparation_2:GameWillBegin() + UGCLogSystem.Log("[W_GamePreparation_2_GameWillBegin]") + UGCEventSystem.SendEvent(EventEnum.AddTip, TipConfig.TipType.GameWillStart) +end + + + +function W_GamePreparation_2:LoadingMap(LoadMapType) + UGCGameSystem.GameState:LoadNowMiniMap() + self.WB_RandomSelectPlayerVoteMap:SetVisibility(ESlateVisibility.Collapsed) + self.Overlay_WaitTime:SetVisibility(ESlateVisibility.Collapsed) + self.Overlay_SelectMapName:SetVisibility(ESlateVisibility.Collapsed) + --self.CanvasPanel_Select:SetVisibility(ESlateVisibility.Collapsed) + self.CanvasPanel_Loading:SetVisibility(ESlateVisibility.SelfHitTestInvisible) + self.bLoading = true + self:SetMapSelect(LoadMapType) +end + +function W_GamePreparation_2:SetMapSelect(SelectMapType) + UGCLogSystem.Log("[W_GamePreparation_2_SetMapSelect] SelectMapType:%s", tostring(SelectMapType)) + if SelectMapType == MapConfig.MapType.Random then + self.WidgetSwitcher_MapBG:SetActiveWidgetIndex(1) + else + self.WidgetSwitcher_MapBG:SetActiveWidgetIndex(0) + self.Image_MapBG:SetBrushFromTexture(UGCSystemLibrary.LoadAsset(MapConfig.MapInfo[SelectMapType].Icon, true), true) + end + self:SetShowName(SelectMapType) +end + +function W_GamePreparation_2:SetShowName(SelectMapType) + local MapName = MapConfig.MapInfo[SelectMapType].ShowName + local ModeName = MapConfig.SpecialModeName[MapConfig.MapInfo[SelectMapType].SpecialModeType] + if ModeName and ModeName ~= "" then + MapName = string.format("%s - ( %s )", MapName, ModeName) + end + self.TextBlock_MapShowName:SetText(MapName) +end + +function W_GamePreparation_2:SelectMapCallBack(bSucceed, InSelectMapType) + UGCLogSystem.Log("[W_GamePreparation_2_SelectMapCallBack] InSelectMapType:%s", tostring(InSelectMapType)) + self.SelectMapType = InSelectMapType + local MapInfo = MapConfig.MapInfo[InSelectMapType] + if MapInfo then + SoundSystem.PlaySound(SoundSystem.ESound.Btn) + self.Overlay_SelectMapName:SetVisibility(ESlateVisibility.SelfHitTestInvisible) + self.TextBlock_SelectMapName:SetText(MapInfo.ShowName) + if MapInfo.SpecialModeType ~= MapConfig.ESpecialModeType.Default then + self.TextBlock_MapSpecialMode:SetText(string.format(" (%s)", MapConfig.SpecialModeName[MapInfo.SpecialModeType])) + else + self.TextBlock_MapSpecialMode:SetText("") + end + end +end + + +function W_GamePreparation_2:RandomSelectVoteMap(MapList, InTargetIndex) + self.Overlay_WaitTime:SetVisibility(ESlateVisibility.Collapsed) + self.Overlay_SelectMapName:SetVisibility(ESlateVisibility.Collapsed) + self.WB_RandomSelectPlayerVoteMap:SetVisibility(ESlateVisibility.SelfHitTestInvisible) + self.WB_RandomSelectPlayerVoteMap:ShowVoteRandomMap(MapList, InTargetIndex, GlobalConfigs.GameSetting.RollMapTime) +end +-- function W_GamePreparation_2:Destruct() + +-- end + +return W_GamePreparation_2; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/GamePreparation/W_RandomSelectMapItem.lua b/CounterAttack_Solo/Script/UI/StatusUI/GamePreparation/W_RandomSelectMapItem.lua new file mode 100644 index 00000000..b62a1130 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/GamePreparation/W_RandomSelectMapItem.lua @@ -0,0 +1,78 @@ +---@class W_RandomSelectMapItem_C:UUserWidget +---@field CanvasPanel_SpecialModeMain UCanvasPanel +---@field Image_Map UImage +---@field Overlay_Defaut UOverlay +---@field Overlay_IsSelect UOverlay +---@field Overlay_IsVote UOverlay +---@field TextBlock_MapName UTextBlock +---@field TextBlock_SpecialModeName UTextBlock +---@field WidgetSwitcher_Enable UWidgetSwitcher +---@field WidgetSwitcher_ShowSelect UWidgetSwitcher +---@field WidgetSwitcher_VoteState UWidgetSwitcher +--Edit Below-- +---@type W_RandomSelectMapItem_C +local W_RandomSelectMapItem = { + bInitDoOnce = false; + SelectMapType = -1; + bVote = false; + bIsSelect = false; +}; + + +function W_RandomSelectMapItem:Construct() + +end + + +-- function W_RandomSelectMapItem:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function W_RandomSelectMapItem:Destruct() + +-- end + +---@param SelectMapType MapConfig.MapType +function W_RandomSelectMapItem:InitSelectItem(SelectMapType) + + + if MapConfig.MapEnable[SelectMapType] then + self.WidgetSwitcher_Enable:SetActiveWidgetIndex(0) + else + self.WidgetSwitcher_Enable:SetActiveWidgetIndex(1) + end + self.SelectMapType = SelectMapType + + + self.TextBlock_MapName:SetText(MapConfig.MapInfo[self.SelectMapType].ShowName) + local SpecialModeType = MapConfig.MapInfo[self.SelectMapType].SpecialModeType + if SpecialModeType == nil or SpecialModeType == MapConfig.ESpecialModeType.Default then + self.CanvasPanel_SpecialModeMain:SetVisibility(ESlateVisibility.Collapsed) + elseif MapConfig.SpecialModeName[SpecialModeType] then + self.TextBlock_SpecialModeName:SetText(MapConfig.SpecialModeName[SpecialModeType]) + end + + if SelectMapType == MapConfig.MapType.Random then + self.WidgetSwitcher_ShowSelect:SetActiveWidgetIndex(1) + else + self.WidgetSwitcher_ShowSelect:SetActiveWidgetIndex(0) + self.Image_Map:SetBrushFromTexture(UGCSystemLibrary.LoadAsset(MapConfig.MapInfo[self.SelectMapType].IconSelect, true)) + end + +end + +function W_RandomSelectMapItem:SetSelect(InbSelect) + self.bIsSelect = InbSelect + if self.bIsSelect then + self.WidgetSwitcher_VoteState:SetActiveWidgetIndex(1) + else + self.WidgetSwitcher_VoteState:SetActiveWidgetIndex(0) + end + +end + +function W_RandomSelectMapItem:GetIsSelect() + return self.bIsSelect +end + +return W_RandomSelectMapItem; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/GamePreparation/W_SelectMapItem.lua b/CounterAttack_Solo/Script/UI/StatusUI/GamePreparation/W_SelectMapItem.lua new file mode 100644 index 00000000..73e7398a --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/GamePreparation/W_SelectMapItem.lua @@ -0,0 +1,123 @@ +---@class W_SelectMapItem_C:UUserWidget +---@field Button_Select UButton +---@field CanvasPanel_SpecialModeMain UCanvasPanel +---@field Image_Map UImage +---@field Overlay_Defaut UOverlay +---@field Overlay_IsSelect UOverlay +---@field Overlay_IsVote UOverlay +---@field TextBlock_IsNew UTextBlock +---@field TextBlock_MapName UTextBlock +---@field TextBlock_SelectNum UTextBlock +---@field TextBlock_SpecialModeName UTextBlock +---@field WidgetSwitcher_Enable UWidgetSwitcher +---@field WidgetSwitcher_ShowSelect UWidgetSwitcher +---@field WidgetSwitcher_VoteState UWidgetSwitcher +--Edit Below-- +---@type W_SelectMapItem_C +local W_SelectMapItem = { + bInitDoOnce = false; + SelectMapType = -1; + bVote = false; +}; + + +function W_SelectMapItem:Construct() + +end + + +-- function W_SelectMapItem:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function W_SelectMapItem:Destruct() + +-- end + +---@param SelectMapType MapConfig.MapType +function W_SelectMapItem:InitSelectItem(SelectMapType, ParentObj, ParentObjSelectCallBack) + UGCEventSystem.AddListener(EventEnum.SelectMapCallBack, self.LocalPlayerVote, self) + + self.Button_Select:SetTouchMethod(EButtonTouchMethod.PreciseTap) + + if MapConfig.MapEnable[SelectMapType] then + self.WidgetSwitcher_Enable:SetActiveWidgetIndex(0) + else + self.WidgetSwitcher_Enable:SetActiveWidgetIndex(1) + end + self.SelectMapType = SelectMapType + self.ParentObj = ParentObj + self.CallBackFunc = ParentObjSelectCallBack + + + if table.hasValue(MapConfig.NEWMaps, self.SelectMapType) then + self.TextBlock_IsNew:SetVisibility(ESlateVisibility.SelfHitTestInvisible) + --UGCLogSystem.Log("[W_SelectMapItem_InitSelectItem]") + end + --UGCLogSystem.LogTree("[W_SelectMapItem_InitSelectItem] " .. self.SelectMapType, MapConfig.NEWMaps) + + self.TextBlock_MapName:SetText(MapConfig.MapInfo[self.SelectMapType].ShowName) + local SpecialModeType = MapConfig.MapInfo[self.SelectMapType].SpecialModeType + if SpecialModeType == nil or SpecialModeType == MapConfig.ESpecialModeType.Default then + self.CanvasPanel_SpecialModeMain:SetVisibility(ESlateVisibility.Collapsed) + elseif MapConfig.SpecialModeName[SpecialModeType] then + self.TextBlock_SpecialModeName:SetText(MapConfig.SpecialModeName[SpecialModeType]) + end + + + if SelectMapType == MapConfig.MapType.Random then + self.WidgetSwitcher_ShowSelect:SetActiveWidgetIndex(1) + else + self.WidgetSwitcher_ShowSelect:SetActiveWidgetIndex(0) + self.Image_Map:SetBrushFromTexture(UGCSystemLibrary.LoadAsset(MapConfig.MapInfo[self.SelectMapType].IconSelect, true)) + end + + + + WidgetLibrary.BindButtonClicked(self.Button_Select, self.ClickSelect, self) + WidgetLibrary.TextBlockBindingPropertyText(self.TextBlock_SelectNum, self.TextBlock_SelectNum_Text, self) +end + +function W_SelectMapItem:GetSelectMapType() + return self.SelectMapType +end + +function W_SelectMapItem:ClickSelect() + self.CallBackFunc(self.ParentObj, self.SelectMapType) + SoundSystem.PlaySound(SoundSystem.ESound.Btn) +end + +function W_SelectMapItem:LocalPlayerVote(bSucceed, InMapType) + if bSucceed and InMapType == self.SelectMapType then + self.bVote = true + self.WidgetSwitcher_VoteState:SetActiveWidgetIndex(2) + else + self.bVote = false + self.WidgetSwitcher_VoteState:SetActiveWidgetIndex(0) + end +end + +function W_SelectMapItem:TextBlock_SelectNum_Text(ReturnValue) + local Res = UGCGameSystem.GameState:GetSelectMapNumFromMapType(self.SelectMapType) + return tostring(Res) +end + +function W_SelectMapItem:SetSelect(bSelect) + if self.bVote == false then + if bSelect then + self.WidgetSwitcher_VoteState:SetActiveWidgetIndex(1) + else + self.WidgetSwitcher_VoteState:SetActiveWidgetIndex(0) + end + end +end + +function W_SelectMapItem:SetVote() + if self.bVote == false then + self.WidgetSwitcher_VoteState:SetActiveWidgetIndex(2) + else + UGCLogSystem.LogError("[W_SelectMapItem_SetVote] 已投票") + end +end + +return W_SelectMapItem; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/GamePreparation/W_WaitPlayJoin.lua b/CounterAttack_Solo/Script/UI/StatusUI/GamePreparation/W_WaitPlayJoin.lua new file mode 100644 index 00000000..d444539c --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/GamePreparation/W_WaitPlayJoin.lua @@ -0,0 +1,49 @@ +---@class W_WaitPlayJoin_C:UUserWidget +---@field Overlay_WaitTime UOverlay +---@field TextBlock_MapName UTextBlock +---@field TextBlock_WaitTime UTextBlock +--Edit Below-- +---@type W_WaitPlayJoin_C +local W_WaitPlayJoin = { + bInitDoOnce = false; + bSelected = false; + SelectMapType = -1; + bLoading = false; +}; + + +function W_WaitPlayJoin:Construct() + self.TextBlock_WaitTime:BindingProperty("Text", self.TextBlock_WaitTime_Text, self) + UGCEventSystem.AddListener(EventEnum.GameWillBegin, self.GameWillBegin, self) + UGCEventSystem.AddListener(EventEnum.UpdateMapKey, self.UpdateMapName, self) + + self:UpdateMapName(UGCGameSystem.GameState:GetMapKey()) + +end + +function W_WaitPlayJoin:UpdateMapName(InMapKey) + local MiniMapInfo = MapConfig.MapInfo[InMapKey] + if MiniMapInfo then + local SpecialModeName = "" + if MiniMapInfo.SpecialModeType ~= MapConfig.ESpecialModeType.Default then + SpecialModeName = " - " .. MapConfig.SpecialModeName[MiniMapInfo.SpecialModeType] + end + local ShowName = MiniMapInfo.ShowName .. SpecialModeName + self.TextBlock_MapName:SetText(ShowName) + end +end + +function W_WaitPlayJoin:OnClosePanel() + self.bLoading = false + WidgetManager:DestroyPanel(WidgetConfig.EUIType.WaitingTime) +end + +function W_WaitPlayJoin:TextBlock_WaitTime_Text(ReturnValue) + return tostring(UGCGameSystem.GameState:GetGameTime()) +end + +function W_WaitPlayJoin:GameWillBegin() + UGCEventSystem.SendEvent(EventEnum.AddTip, TipConfig.TipType.GameWillStart) +end + +return W_WaitPlayJoin; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/MarkPlayerUI/WB_InductionPlayer.lua b/CounterAttack_Solo/Script/UI/StatusUI/MarkPlayerUI/WB_InductionPlayer.lua new file mode 100644 index 00000000..5dcea41f --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/MarkPlayerUI/WB_InductionPlayer.lua @@ -0,0 +1,153 @@ +---@class WB_InductionPlayer_C:UUserWidget +---@field CanvasPanel_Main UCanvasPanel +---@field CanvasPanel_Pointer UCanvasPanel +---@field TextBlock_9 UTextBlock +---@field TextBlock_Angle UTextBlock +---@field TextBlock_HorizontalDis UTextBlock +---@field TextBlock_UpDis UTextBlock +---@field WidgetSwitcher_HasEnemy UWidgetSwitcher +---@field WidgetSwitcher_UpOrDown UWidgetSwitcher +--Edit Below-- +local WB_InductionPlayer = { + bInitDoOnce = false; + UpdateFPS = 90; + FindEnemyFPS = 1; +} + +--[==[ Construct +function WB_InductionPlayer:Construct() + +end +-- Construct ]==] + +-- function WB_InductionPlayer:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_InductionPlayer:Destruct() + +-- end + +function WB_InductionPlayer:OnShowPanel(FindDis) + -- Test + if FindDis == nil then FindDis = 200000 end + -- Test End + + UGCLogSystem.Log("[WB_InductionPlayer_OnShowPanel] FindDis:%s", tostring(FindDis)) + + self.FindDis = FindDis + if self.UpdateHandle == nil then + self.UpdateHandle = UGCEventSystem.SetTimerLoop(self, self.Update, 1./ self.UpdateFPS) + self.FindEnemyHandle = UGCEventSystem.SetTimerLoop(self, self.FindEnemy, 1./ self.FindEnemyFPS) + end +end + +function WB_InductionPlayer:OnClosePanel() + if self.UpdateHandle then + UGCEventSystem.StopTimer(self.UpdateHandle) + end + if self.FindEnemyHandle then + UGCEventSystem.StopTimer(self.FindEnemyHandle) + end +end + +function WB_InductionPlayer:Update() + local LocalPawn = UGCSystemLibrary.GetLocalPlayerPawn() + + + if UE.IsValid(self.TracePawn) and UE.IsValid(LocalPawn) then + self:IsFindPawn(true) + else + self:IsFindPawn(false) + return + end + + local LocalPawnPos = LocalPawn:K2_GetActorLocation() + local TracePawnPos = self.TracePawn:K2_GetActorLocation() + + local LocalPawnPos2D = {X = LocalPawnPos.X, Y = LocalPawnPos.Y, Z = 0} + local TracePawnPos2D = {X = TracePawnPos.X, Y = TracePawnPos.Y, Z = 0} + + local LocalPawnForward = LocalPawn:GetActorForwardVector() + local LocalPawnRight = LocalPawn:GetActorRightVector() + + local Dir = VectorHelper.Sub(TracePawnPos2D, LocalPawnPos2D) + local Dis = VectorHelper.GetDistance(LocalPawnPos2D, TracePawnPos2D) + local DisUp = TracePawnPos.Z - LocalPawnPos.Z + + local CosForward = VectorHelper.CosineValue(LocalPawnForward, Dir) + local CosRight = VectorHelper.CosineValue(LocalPawnRight, Dir) + + local FAngle = math.acos(CosForward) + + local PI = 3.14159 + + if CosRight < 0 then + FAngle = 2 * PI - FAngle + end + + local Angle = FAngle * 180 / PI; + + if Angle > 180 then + Angle = Angle - 360 + end + + self.TextBlock_Angle:SetText(math.floor(Angle) .. "°") + self.TextBlock_HorizontalDis:SetText(math.floor((Dis // 100) + 0.5) .. "m") + self.TextBlock_UpDis:SetText(math.floor(DisUp // 100 + 1) .. "m") + + self.CanvasPanel_Pointer:SetRenderAngle(Angle) + +end + +function WB_InductionPlayer:IsFindPawn(IsFind) + if IsFind ~= self.IsFind then + self.IsFind = IsFind + if self.IsFind then + self.CanvasPanel_Pointer:SetVisibility(ESlateVisibility.HitTestInvisible) + self.WidgetSwitcher_HasEnemy:SetActiveWidgetIndex(0) + else + self.CanvasPanel_Pointer:SetVisibility(ESlateVisibility.Collapsed) + self.WidgetSwitcher_HasEnemy:SetActiveWidgetIndex(1) + end + end +end + +function WB_InductionPlayer:FindEnemy() + local LocalPawn = UGCSystemLibrary.GetLocalPlayerPawn() + if UE.IsValid(LocalPawn) and not UGCPawnSystem.HasPawnState(LocalPawn, EPawnState.Dead) then + self.CanvasPanel_Main:SetVisibility(ESlateVisibility.HitTestInvisible) + else + -- 本地玩家已死亡 + self.CanvasPanel_Main:SetVisibility(ESlateVisibility.Collapsed) + self.TracePawn = nil + return + end + + + local LocalPlayerTeamID = UGCGameSystem.GameState:GetPlayerTeamIDByPlayerKey(UGCSystemLibrary.GetLocalPlayerKey()) + local AllPawn = UGCGameSystem.GetAllPlayerPawn() + local TargetPawn = nil + local MinDis = 0 + + local LocalPawnPos = LocalPawn:K2_GetActorLocation() + + for i, TempPawn in pairs(AllPawn) do + if TempPawn.PlayerKey then + local TempPawnTeamID = UGCGameSystem.GameState:GetPlayerTeamIDByPlayerKey(TempPawn.PlayerKey) + if TempPawnTeamID ~= LocalPlayerTeamID then + if not UGCPawnSystem.HasPawnState(LocalPawn, EPawnState.Dead) then + local Pos = TempPawn:K2_GetActorLocation() + local Dis = VectorHelper.GetDistance(LocalPawnPos, Pos) + if Dis <= self.FindDis * 100 and (TargetPawn == nil or MinDis > Dis) then + TargetPawn = TempPawn + MinDis = Dis + end + end + end + end + end + self.TracePawn = TargetPawn +end + +return WB_InductionPlayer \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/MarkPlayerUI/WB_MarkEnemy.lua b/CounterAttack_Solo/Script/UI/StatusUI/MarkPlayerUI/WB_MarkEnemy.lua new file mode 100644 index 00000000..5a9ea3c0 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/MarkPlayerUI/WB_MarkEnemy.lua @@ -0,0 +1,71 @@ +---@class WB_MarkEnemy_C:ObjectPositionWidget +---@field CanvasPanel_Child UCanvasPanel +--Edit Below-- +local WB_MarkEnemy = { bInitDoOnce = false; }; + +--[==[ Construct +function WB_MarkGodOfWar:Construct() + +end +-- Construct ]==] + +-- function WB_MarkGodOfWar:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_MarkGodOfWar:Destruct() + +-- end + +function WB_MarkEnemy:Tick(MyGeometry, InDeltaTime) + --UGCLogSystem.Log("[WB_HuntingMarkEnemy_Tick]") + --local IsTrace = false + --if self.TracePlayerKey then + -- --UGCLogSystem.Log("[WB_HuntingMarkEnemy_Tick]22222222222222222222222222222222222222222222222222222222") + -- + -- local Pawn = UGCGameSystem.GetPlayerPawnByPlayerKey(self.TracePlayerKey) + -- --UGCLogSystem.Log("[WB_HuntingMarkEnemy_Tick] 1") + -- if Pawn and not UGCPawnSystem.HasPawnState(Pawn, EPawnState.Dead) then + -- --UGCLogSystem.Log("[WB_HuntingMarkEnemy_Tick] 2") + -- local PlayerPos + -- if UE.IsValid(Pawn.Mesh) then + -- PlayerPos = Pawn.Mesh:GetSocketLocation("spine_03") + -- else + -- PlayerPos = Pawn:K2_GetActorLocation() + -- PlayerPos.Z = PlayerPos.Z + 30 + -- end + -- + -- local Succeed, Pos2D = WidgetLayoutLibrary.ProjectWorldLocationToWidgetPosition(UGCSystemLibrary.GetLocalPlayerController(), PlayerPos) + -- if Succeed then + -- --UGCLogSystem.Log("[WB_HuntingMarkEnemy_Tick] 3 Pos2D:%s", VectorHelper.ToString2D(Pos2D)) + -- IsTrace = true + -- local CanvasSlot = WidgetLayoutLibrary.SlotAsCanvasSlot(self.CanvasPanel_Child) + -- CanvasSlot:SetPosition(Pos2D) + -- end + -- end + -- + --end + --self:SetTraceUIVis(IsTrace) +end + +-- function WB_HuntingMarkEnemy:Destruct() + +-- end + +function WB_MarkEnemy:SetTracePlayerKey(InPlayerKey) + UGCLogSystem.Log("[WB_HuntingMarkEnemy_SetTracePlayerKey] InPlayerKey:%s", tostring(InPlayerKey)) + self.TracePlayerKey = InPlayerKey +end + +function WB_MarkEnemy:SetTraceUIVis(InIsVis) + if self.IsVis ~= InIsVis then + self.IsVis = InIsVis + if self.IsVis then + self.CanvasPanel_Child:SetVisibility(ESlateVisibility.HitTestInvisible); + else + self.CanvasPanel_Child:SetVisibility(ESlateVisibility.Collapsed); + end + end +end + +return WB_MarkEnemy; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/MarkPlayerUI/WB_MarkGodOfWar.lua b/CounterAttack_Solo/Script/UI/StatusUI/MarkPlayerUI/WB_MarkGodOfWar.lua new file mode 100644 index 00000000..ee0bd3a4 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/MarkPlayerUI/WB_MarkGodOfWar.lua @@ -0,0 +1,19 @@ +---@class WB_MarkGodOfWar_C:ObjectPositionWidget +--Edit Below-- +local WB_MarkGodOfWar = { bInitDoOnce = false; }; + +--[==[ Construct +function WB_MarkGodOfWar:Construct() + +end +-- Construct ]==] + +-- function WB_MarkGodOfWar:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_MarkGodOfWar:Destruct() + +-- end + +return WB_MarkGodOfWar; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/PlaceGameMenu/WB_MapOperate.lua b/CounterAttack_Solo/Script/UI/StatusUI/PlaceGameMenu/WB_MapOperate.lua new file mode 100644 index 00000000..8f3f2d9b --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/PlaceGameMenu/WB_MapOperate.lua @@ -0,0 +1,97 @@ +---@class WB_MapOperate_C:UUserWidget +---@field AnimShow UWidgetAnimation +---@field Button_Break UNewButton +---@field Button_Load UNewButton +---@field Button_Remove UNewButton +---@field Button_ResetName UNewButton +---@field Button_SetPlayMap UNewButton +---@field TextBlock_MapName UTextBlock +--Edit Below-- +local WB_MapOperate = { + bInitDoOnce = false; + bCanUse = true +}; + + +function WB_MapOperate:Construct() + WidgetLibrary.BindButtonClicked(self.Button_Break, self.CloseSelf, self) + WidgetLibrary.BindButtonClicked(self.Button_Load, self.LoadMap, self) + WidgetLibrary.BindButtonClicked(self.Button_Remove, self.RemoveMap, self) + WidgetLibrary.BindButtonClicked(self.Button_SetPlayMap, self.ClickPlayMap, self) + WidgetLibrary.BindButtonClicked(self.Button_ResetName, self.ResetMapName, self) +end + +function WB_MapOperate:OnShowPanel(InLoadPlaceItemsType, InLoadIndex, CanUse) + self.bCanUse = true + self.LoadPlaceItemsType = InLoadPlaceItemsType + self.LoadIndex = InLoadIndex + if self.LoadPlaceItemsType ~= PlacementModeConfig.LoadPlaceItemsType.SavedMap then + self.Button_Remove:SetVisibility(ESlateVisibility.Collapsed) + if self.LoadPlaceItemsType == PlacementModeConfig.LoadPlaceItemsType.Default then + self.TextBlock_MapName:SetText("默认模板") + else + self.TextBlock_MapName:SetText("空模板") + self.Button_SetPlayMap:SetVisibility(ESlateVisibility.Collapsed) + end + else + self.Button_Remove:SetVisibility(ESlateVisibility.Visible) + self.Button_SetPlayMap:SetVisibility(ESlateVisibility.Visible) + local SavedMapList = ArchiveDataConfig.GetPlayerArchiveDataFromType(UGCSystemLibrary.GetLocalPlayerKey(), ArchiveDataConfig.EArchiveType.SavedMap) + if SavedMapList and SavedMapList[InLoadIndex] then + self.TextBlock_MapName:SetText(SavedMapList[InLoadIndex].MapName) + end + self.bCanUse = CanUse + end +end + +function WB_MapOperate:CloseSelf() + WidgetManager:ClosePanel(WidgetConfig.EUIType.MapOperate) +end + +function WB_MapOperate:LoadMap() + PlacementModeConfig.GetPlaceManager():LoadSavedPlaceMap(self.LoadPlaceItemsType, self.LoadIndex) + self:CloseSelf() +end + +function WB_MapOperate:RemoveMap() + UGCSendRPCSystem.ActorRPCNotify(nil, UGCGameSystem.GameState, "RemoveSavedMap", UGCSystemLibrary.GetLocalPlayerKey(), self.LoadIndex) + self:CloseSelf() +end + +function WB_MapOperate:ClickPlayMap() + if self.bCanUse then + self:SetPlayMap() + else + local SecondaryConfirmationWidget = WidgetManager:GetPanel(WidgetConfig.EUIType.SecondaryConfirmation) + SecondaryConfirmationWidget:SetTextInfo("该放置代码超过了可放置上限,强制游玩会缺少组件!", "取消", "游玩") + SecondaryConfirmationWidget:BindConfirmCallBack(self.SetPlayMap, self) + WidgetManager:ShowPanel(WidgetConfig.EUIType.SecondaryConfirmation, false) + end +end + +function WB_MapOperate:SetPlayMap() + UGCSendRPCSystem.ActorRPCNotify(nil, UGCGameSystem.GameState, "SetPlayMap", UGCSystemLibrary.GetLocalPlayerKey(), self.LoadIndex) + self:CloseSelf() +end + +function WB_MapOperate:ResetMapName() + local SecondaryConfirmationWidget = WidgetManager:GetPanel(WidgetConfig.EUIType.SecondaryConfirmation_EditableText) + SecondaryConfirmationWidget:SetTextInfo("请输入地图名称", PlacementModeConfig.PlacingAttr.PlaceMapNameLengthLimit, "取消", "修改") + SecondaryConfirmationWidget:BindConfirmCallBack(self.SubmitMapName, self) + WidgetManager:ShowPanel(WidgetConfig.EUIType.SecondaryConfirmation_EditableText, false) +end + +function WB_MapOperate:SubmitMapName(InText) + UGCSendRPCSystem.ActorRPCNotify(nil, UGCGameSystem.GameState, "SetSavedMapName", UGCSystemLibrary.GetLocalPlayerKey(), self.LoadIndex, InText) + self:CloseSelf() +end + +-- function WB_MapOperate:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_MapOperate:Destruct() + +-- end + +return WB_MapOperate; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/PlaceGameMenu/WB_PlaceGameMenu.lua b/CounterAttack_Solo/Script/UI/StatusUI/PlaceGameMenu/WB_PlaceGameMenu.lua new file mode 100644 index 00000000..04632a1e --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/PlaceGameMenu/WB_PlaceGameMenu.lua @@ -0,0 +1,144 @@ +---@class WB_PlaceGameMenu_C:UUserWidget +---@field Button_Play UButton +---@field Button_PreviewMap UButton +---@field Button_Tasks UButton +---@field Button_ToPlaceMode UNewButton +---@field DefaultMapItem UWB_SavedMap_C +---@field NoneMapItem UWB_SavedMap_C +---@field TextBlock_MapName UTextBlock +---@field VerticalBox_SavedMap UVerticalBox +---@field WidgetSwitcher_Play UWidgetSwitcher +--Edit Below-- +local WB_PlaceGameMenu = { + bInitDoOnce = false; + bCanReqesetMatch = true; + bIsShow = false; + DoOnceOpenSettingPanel = false; +}; + + +function WB_PlaceGameMenu:Construct() + UGCLogSystem.Log("[WB_PlaceGameMenu_Construct]") + WidgetLibrary.BindButtonClicked(self.Button_ToPlaceMode, self.ToPlaceMode, self) + WidgetLibrary.BindButtonClicked(self.Button_Play, self.ReqesetMatch, self) + WidgetLibrary.BindButtonClicked(self.Button_PreviewMap, self.PreviewMap, self) + --WidgetLibrary.BindButtonClicked(self.NewButton_Setting, self.ShowSettingPanel, self) + WidgetLibrary.ButtonOnClickShowPanel(self.Button_Tasks, WidgetConfig.EUIType.Task) + + UGCEventSystem.AddListener(ArchiveDataConfig.GetParamNotifyEvent(ArchiveDataConfig.EArchiveType.SavedMap), self.UpdateSavedMap, self) + --UGCEventSystem.AddListener(EventEnum.UpdatePlayMap, self.UpdatePlayMap, self) + UGCEventSystem.AddListener(ArchiveDataConfig.GetParamNotifyEvent(ArchiveDataConfig.EArchiveType.SelectMapIndex), self.UpdatePlayMap, self) + + --- 显示二次匹配按键 + UGCMultiMode.SetModeChooseUIVisible(true) + self.Button_Play:SetVisibility(ESlateVisibility.Collapsed) + + self:InitSavedMapBtn() + self:UpdateSavedMap() + self:UpdatePlayMap() +end + + +function WB_PlaceGameMenu:OnShowPanel() + self.bIsShow = true + UGCMultiMode.SetModeChooseButtonVisible(false) + WidgetConfig.SetDefaultUIMode(WidgetConfig.EDefaultUIMode.Menu) +end + +function WB_PlaceGameMenu:OnClosePanel() + self.bIsShow = false + WidgetConfig.RemoveDefaultUIMode(WidgetConfig.EDefaultUIMode.Menu) +end + +function WB_PlaceGameMenu:CheckModeChooseUIVisible() + UGCMultiMode.SetModeChooseUIVisible(self.bIsShow) +end + +function WB_PlaceGameMenu:Tick(MyGeometry, InDeltaTime) + UGCMultiMode.SetModeState(PlacementModeConfig.PlaceModeID, false) +end + +function WB_PlaceGameMenu:ToPlaceMode() + -- 发送信息进入放置模式 + UGCSendRPCSystem.ActorRPCNotify(nil, UGCGameSystem.GameState, "ShowSimplePlaceModeUI", WidgetConfig.EUIType.PlaceMode) +end + +-- function WB_PlaceGameMenu:Destruct() + +-- end + +function WB_PlaceGameMenu:InitSavedMapBtn() + self.NoneMapItem:Init(self.ClickNoneTemplate, self, nil, "空模板") + self.NoneMapItem:SetIsDefaultSavedMap(true) + self.DefaultMapItem:Init(self.ClickDefaultTemplate, self, nil, "默认模板") + self.DefaultMapItem:SetIsDefaultSavedMap(true) + for i = 0, self.VerticalBox_SavedMap:GetChildrenCount() - 1 do + local Item = self.VerticalBox_SavedMap:GetChildAt(i) + Item:Init(self.ClickSavedMapTemplate, self, i + 1, "Nil") + end +end + +function WB_PlaceGameMenu:ClickNoneTemplate() + WidgetManager:ShowPanel(WidgetConfig.EUIType.MapOperate, false, PlacementModeConfig.LoadPlaceItemsType.None) +end + +function WB_PlaceGameMenu:ClickDefaultTemplate() + WidgetManager:ShowPanel(WidgetConfig.EUIType.MapOperate, false, PlacementModeConfig.LoadPlaceItemsType.Default) +end + +function WB_PlaceGameMenu:ClickSavedMapTemplate(Index, CanUse) + WidgetManager:ShowPanel(WidgetConfig.EUIType.MapOperate, false, PlacementModeConfig.LoadPlaceItemsType.SavedMap, Index, CanUse) +end + +function WB_PlaceGameMenu:ReqesetMatch() + if self.bCanReqesetMatch then + + self.bCanReqesetMatch = false + self.WidgetSwitcher_Play:SetActiveWidgetIndex(1) + UGCMultiMode.ReqesetMatch(PlacementModeConfig.PlayModeID, self.ReqesetMatchCallBack, self) + end +end + +function WB_PlaceGameMenu:ReqesetMatchCallBack(...) + self.bCanReqesetMatch = true + self.WidgetSwitcher_Play:SetActiveWidgetIndex(0) + UGCLogSystem.LogTree("[WB_PlaceGameMenu_ReqesetMatchCallBack]", table.pack(...)) +end + +function WB_PlaceGameMenu:UpdateSavedMap() + local SimplePlayerSavedMapList = ArchiveDataConfig.GetPlayerArchiveDataFromType(UGCSystemLibrary.GetLocalPlayerKey(), ArchiveDataConfig.EArchiveType.SavedMap) + if SimplePlayerSavedMapList == nil then + SimplePlayerSavedMapList = {} + end + for i = 0, self.VerticalBox_SavedMap:GetChildrenCount() - 1 do + local Item = self.VerticalBox_SavedMap:GetChildAt(i) + local MapInfo = SimplePlayerSavedMapList[i + 1] + if MapInfo then + Item:ResetName(MapInfo.MapName) + Item:ResetCode(MapInfo.MapCode) + Item:SetVisibility(ESlateVisibility.SelfHitTestInvisible) + else + Item:SetVisibility(ESlateVisibility.Collapsed) + end + end +end + +function WB_PlaceGameMenu:UpdatePlayMap() + local SelectMapIndex = ArchiveDataConfig.GetPlayerArchiveDataFromType(UGCSystemLibrary.GetLocalPlayerKey(), ArchiveDataConfig.EArchiveType.SelectMapIndex) + + self.DefaultMapItem:SetIsSelected(SelectMapIndex == nil) + for i = 0, self.VerticalBox_SavedMap:GetChildrenCount() - 1 do + local Item = self.VerticalBox_SavedMap:GetChildAt(i) + Item:SetIsSelected(SelectMapIndex == i + 1) + end +end + +function WB_PlaceGameMenu:PreviewMap() + UGCSendRPCSystem.ActorRPCNotify(nil, UGCGameSystem.GameState, "ShowSimplePlaceModeUI", WidgetConfig.EUIType.PreviewMap) +end + + + + +return WB_PlaceGameMenu; + diff --git a/CounterAttack_Solo/Script/UI/StatusUI/PlaceGameMenu/WB_PreviewMap.lua b/CounterAttack_Solo/Script/UI/StatusUI/PlaceGameMenu/WB_PreviewMap.lua new file mode 100644 index 00000000..77ca6a3d --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/PlaceGameMenu/WB_PreviewMap.lua @@ -0,0 +1,23 @@ +---@class WB_PreviewMap_C:UUserWidget +---@field Button_ToMenu UNewButton +--Edit Below-- +local WB_PreviewMap = { bInitDoOnce = false; }; + + +function WB_PreviewMap:Construct() + WidgetLibrary.BindButtonClicked(self.Button_ToMenu, self.ReturnToMenu, self) +end + +function WB_PreviewMap:ReturnToMenu() + UGCSendRPCSystem.ActorRPCNotify(nil, UGCGameSystem.GameState, "ShowSimplePlaceModeUI", WidgetConfig.EUIType.PlaceModeMainMenu) +end + +-- function WB_PreviewMap:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_PreviewMap:Destruct() + +-- end + +return WB_PreviewMap; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/PlaceGameMenu/WB_SavedMap.lua b/CounterAttack_Solo/Script/UI/StatusUI/PlaceGameMenu/WB_SavedMap.lua new file mode 100644 index 00000000..95bf1ed1 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/PlaceGameMenu/WB_SavedMap.lua @@ -0,0 +1,96 @@ +---@class WB_SavedMap_C:UUserWidget +---@field Button_Select UNewButton +---@field CanvasPanel_CanNotUse UCanvasPanel +---@field TextBlock_MapName UTextBlock +---@field TextBlock_Size UTextBlock +---@field WidgetSwitcherIsSelected UWidgetSwitcher +--Edit Below-- +local WB_SavedMap = { + bInitDoOnce = false; + PlayerPlaceCount = 0; + PlaceCount = 0; +}; + +--[==[ Construct +function WB_SavedMap:Construct() + +end +-- Construct ]==] + +-- function WB_SavedMap:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_SavedMap:Destruct() + +-- end + +function WB_SavedMap:LuaInit() + if self.bInitDoOnce then + return; + end + self.bInitDoOnce = true; + UGCEventSystem.AddListener(ArchiveDataConfig.GetParamNotifyEvent(ArchiveDataConfig.EArchiveType.Exp), self.UpdatePlayerMaxPlaceCount, self) + WidgetLibrary.BindButtonClicked(self.Button_Select, self.ClickBtn, self) +end + +function WB_SavedMap:Init(InCallBackFunc, InCallBackObj, InIndex, InShowName) + self:LuaInit() + self.CallBackFunc, self.CallBackObj = InCallBackFunc, InCallBackObj + self.TextBlock_MapName:SetText(InShowName) + self.Index = InIndex +end + +function WB_SavedMap:GetIndex() + return self.Index +end + +function WB_SavedMap:SetIsSelected(IsSelect) + if IsSelect then + self.WidgetSwitcherIsSelected:SetActiveWidgetIndex(1) + else + self.WidgetSwitcherIsSelected:SetActiveWidgetIndex(0) + end +end + +function WB_SavedMap:ResetName(InShowName) + self.TextBlock_MapName:SetText(InShowName) +end + +function WB_SavedMap:ResetCode(InCode) + self.PlayerPlaceCount = PlacementModeConfig.GetPlaceMaxValue(UGCSystemLibrary.GetLocalPlayerKey()) + local CanUse, PlaceCount = PlacementModeConfig.CheckPlayerCanUsePlaceCode(InCode, UGCSystemLibrary.GetLocalPlayerKey()) + self.PlaceCount = PlaceCount + if CanUse then + self.CanvasPanel_CanNotUse:SetVisibility(ESlateVisibility.Collapsed) + else + self.CanvasPanel_CanNotUse:SetVisibility(ESlateVisibility.HitTestInvisible) + end + self.TextBlock_Size:SetText(self.PlaceCount .. "/" .. self.PlayerPlaceCount) +end + +function WB_SavedMap:UpdatePlayerMaxPlaceCount() + self.PlayerPlaceCount = PlacementModeConfig.GetPlaceMaxValue(UGCSystemLibrary.GetLocalPlayerKey()) + self.TextBlock_Size:SetText(self.PlaceCount .. "/" .. self.PlayerPlaceCount) +end + +function WB_SavedMap:SetIsDefaultSavedMap(IsDefaultMap) + if IsDefaultMap then + self.TextBlock_Size:SetVisibility(ESlateVisibility.Collapsed) + else + self.TextBlock_Size:SetVisibility(ESlateVisibility.HitTestInvisible) + end +end + +function WB_SavedMap:ClickBtn() + if self.CallBackFunc then + if self.CallBackObj then + self.CallBackFunc(self.CallBackObj, self.Index, self.PlaceCount <= self.PlayerPlaceCount) + else + self.CallBackFunc(self.Index, self.PlaceCount <= self.PlayerPlaceCount) + end + end + -- SoundSystem.PlaySound(SoundSystem.ESound.Btn) +end + +return WB_SavedMap; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/PlacePanel/WB_ImportPlaceCode.lua b/CounterAttack_Solo/Script/UI/StatusUI/PlacePanel/WB_ImportPlaceCode.lua new file mode 100644 index 00000000..07cb1e47 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/PlacePanel/WB_ImportPlaceCode.lua @@ -0,0 +1,50 @@ +---@class WB_ImportPlaceCode_C:UUserWidget +---@field Button_ClosePanel UNewButton +---@field Button_Import UNewButton +---@field EditableText_ShowPlaceCode UWidget_NewEditableText_C +--Edit Below-- +local WB_ImportPlaceCode = { bInitDoOnce = false; }; + + +function WB_ImportPlaceCode:Construct() + WidgetLibrary.BindButtonClicked(self.Button_ClosePanel, self.CloseSelf, self) + WidgetLibrary.BindButtonClicked(self.Button_Import, self.ImportCode, self) + -- UGCEventSystem.AddListener(EventEnum.ImportPlacementCallBack, self.ImportPlacementCallBack, self) +end + + +function WB_ImportPlaceCode:OnShowPanel() + --local PlaceCode = PlacementModeConfig.GetPlaceManager():ExportPlacementCode() + --self.EditableText_ShowPlaceCode:SetText(PlaceCode) + self.EditableText_ShowPlaceCode:SetText("") +end + +function WB_ImportPlaceCode:CloseSelf() + WidgetManager:ClosePanel(WidgetConfig.EUIType.ImportPlaceCode) +end + +function WB_ImportPlaceCode:ImportPlacementCallBack(InPlaceDecodeCallbackType) + UGCEventSystem.SendEvent(EventEnum.AddTip, TipConfig.TipType.ImportCodeCallBack, InPlaceDecodeCallbackType) + if InPlaceDecodeCallbackType == PlacementModeConfig.EPlaceDecodeCallback.Succeed then + WidgetManager:ClosePanel(WidgetConfig.EUIType.ImportPlaceCode) + end +end + +WB_ImportPlaceCode.LastImportCode = 0; +function WB_ImportPlaceCode:ImportCode() + local NowTime = UGCSystemLibrary.GetGameTime() + if NowTime - self.LastImportCode > 2 then + self.LastImportCode = NowTime + UGCSendRPCSystem.ActorRPCNotify(nil, PlacementModeConfig.GetPlaceManager(), "PreImportPlacementCode", UGCSystemLibrary.GetLocalPlayerKey(), self.EditableText_ShowPlaceCode:GetText()) + WidgetManager:ClosePanel(WidgetConfig.EUIType.ImportPlaceCode) + end +end +-- function WB_ImportPlaceCode:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_ImportPlaceCode:Destruct() + +-- end + +return WB_ImportPlaceCode; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/PlacePanel/WB_PlaceItem.lua b/CounterAttack_Solo/Script/UI/StatusUI/PlacePanel/WB_PlaceItem.lua new file mode 100644 index 00000000..f2ce0a57 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/PlacePanel/WB_PlaceItem.lua @@ -0,0 +1,172 @@ +---@class WB_PlaceItem_C:UUserWidget +---@field Button_Select UButton +---@field Image_BG UImage +---@field Image_ItemTex UImage +---@field Overlay_CanUnlock UOverlay +---@field Overlay_Count UOverlay +---@field Overlay_IsSelect UOverlay +---@field Overlay_Lock UOverlay +---@field TextBlock_Cost UTextBlock +---@field TextBlock_Count UTextBlock +---@field TextBlock_Name UTextBlock +---@field TextBlock_Unlock UTextBlock +---@field WidgetSwitcher_CanUnLock UWidgetSwitcher +---@field WidgetSwitcher_UnlockType UWidgetSwitcher +--Edit Below-- +local WB_PlaceItem = { + bInitDoOnce = false; + ItemType = nil; + bIsLock = false; +}; + +--[==[ Construct +function WB_PlaceItem:Construct() + +end +-- Construct ]==] + +-- function WB_PlaceItem:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_PlaceItem:Destruct() + +-- end + +function WB_PlaceItem:LuaInit() + if self.bInitDoOnce then + return; + end + self.bInitDoOnce = true; + self.Button_Select:SetTouchMethod(EButtonTouchMethod.PreciseTap) + WidgetLibrary.BindButtonPressed(self.Button_Select, self.SelectItem, self) + UGCEventSystem.AddListener(EventEnum.PlaceItemTypeIsChange, self.UpdateSelectItem, self) + UGCEventSystem.AddListener(EventEnum.UpdatePlacedItemCount, self.UpdatePlacedItemCount, self) + UGCEventSystem.AddListener(ArchiveDataConfig.GetParamNotifyEvent(ArchiveDataConfig.EArchiveType.ItemIncrement), self.UpdateIsLock, self) + UGCEventSystem.AddListener(ArchiveDataConfig.GetParamNotifyEvent(ArchiveDataConfig.EArchiveType.Exp), self.UpdateCanUnlock, self) + UGCEventSystem.AddListener(ArchiveDataConfig.GetParamNotifyEvent(ArchiveDataConfig.EArchiveType.Gold), self.UpdateCanUnlock, self) +end + + + +function WB_PlaceItem:SetItemType(InType) + self:LuaInit() + if PlacementModeConfig.ItemInfo[InType] then + self.ItemType = InType + local TexPath = PlacementModeConfig.ItemInfo[InType].SelectTex + local Cost = PlacementModeConfig.ItemInfo[InType].Cost + -- local Name = PlacementModeConfig.ItemInfo[InType].Name + local Tex = UGCSystemLibrary.LoadAsset(TexPath, false) + if Tex then + self.Image_ItemTex:SetBrushFromTexture(Tex, false) + end + self.TextBlock_Cost:SetText(tostring(Cost)) + self:UpdateIsLock() + end +end + +function WB_PlaceItem:SelectItem() + if self.ItemType then + SoundSystem.PlaySound(SoundSystem.ESound.Click) + local PlaceManager = PlacementModeConfig.GetPlaceManager() + if self.bIsLock then + -- 二次确定消耗解锁 + + local UnlockType, Cost = PlacementModeConfig.GetPlaceItemUnlockInfo(self.ItemType) + local SecondaryConfirmationWidget = WidgetManager:GetPanel(WidgetConfig.EUIType.SecondaryConfirmation) + + if PlacementModeConfig.EUnlockType.None == UnlockType then + elseif PlacementModeConfig.EUnlockType.Level == UnlockType then + SecondaryConfirmationWidget:SetTextInfo("是否进行解锁?") + else + SecondaryConfirmationWidget:SetTextInfo(string.format("是否消耗%s%s进行解锁?", tostring(Cost), PlacementModeConfig.UnlockName[UnlockType])) + end + SecondaryConfirmationWidget:BindConfirmCallBack(self.ConfirmUnLock, self) + WidgetManager:ShowPanel(WidgetConfig.EUIType.SecondaryConfirmation, false) + else + if PlaceManager then + local PlacementModeType = PlaceManager:GetPlacementModeType() + if PlacementModeType == PlacementModeConfig.EPlaceMode.RemoveMode then + local SecondaryConfirmationWidget = WidgetManager:GetPanel(WidgetConfig.EUIType.SecondaryConfirmation) + SecondaryConfirmationWidget:SetTextInfo(string.format("是否要清除所有%s?", PlacementModeConfig.ItemInfo[self.ItemType].Name)) + SecondaryConfirmationWidget:BindConfirmCallBack(self.ConfirmClearItem, self) + WidgetManager:ShowPanel(WidgetConfig.EUIType.SecondaryConfirmation, false) + end + end + end + if PlaceManager then + PlaceManager:SetPlaceItemType(self.ItemType) + end + end +end + +function WB_PlaceItem:ConfirmUnLock() + if self.ItemType then + UGCSendRPCSystem.ActorRPCNotify(nil, UGCGameSystem.GameState, "UnlockPlaceItem", UGCSystemLibrary.GetLocalPlayerKey(), self.ItemType) + end +end + +function WB_PlaceItem:ConfirmClearItem() + if self.ItemType then + UGCSendRPCSystem.ActorRPCNotify(nil, PlacementModeConfig.GetPlaceManager(), "RemoveItemFromType", self.ItemType) + end +end + +function WB_PlaceItem:UpdateSelectItem(InItemType) + if InItemType == self.ItemType then + self.Image_BG:SetVisibility(ESlateVisibility.SelfHitTestInvisible); + self.Overlay_IsSelect:SetVisibility(ESlateVisibility.SelfHitTestInvisible); + else + self.Image_BG:SetVisibility(ESlateVisibility.Collapsed); + self.Overlay_IsSelect:SetVisibility(ESlateVisibility.Collapsed); + end +end + +function WB_PlaceItem:UpdatePlacedItemCount() + local PlaceManage = PlacementModeConfig.GetPlaceManager() + UGCLogSystem.Log("[WB_PlaceItem_UpdatePlacedItemCount] PlaceManage:%s", tostring(UE.IsValid(PlaceManage))) + local Count = PlacementModeConfig.GetPlaceManager():GetPlacedItemNum(self.ItemType) + if Count <= 0 then + self.Overlay_Count:SetVisibility(ESlateVisibility.Collapsed) + else + self.TextBlock_Count:SetText(tostring(Count)) + self.Overlay_Count:SetVisibility(ESlateVisibility.SelfHitTestInvisible) + end +end + +function WB_PlaceItem:ItemIsLock(InType) + if InType == nil then return false end + local UnlockType = PlacementModeConfig.GetPlaceItemUnlockInfo(InType) + if UnlockType == PlacementModeConfig.EUnlockType.None then return false end + local ItemIncrement = ArchiveDataConfig.GetPlayerArchiveDataFromType(UGCSystemLibrary.GetLocalPlayerKey(), ArchiveDataConfig.EArchiveType.ItemIncrement) + return (ItemIncrement == nil or ItemIncrement[InType] == nil or ItemIncrement[InType] == 0) +end + +function WB_PlaceItem:UpdateIsLock() + self.bIsLock = self:ItemIsLock(self.ItemType) + if self.bIsLock then + self.Overlay_Lock:SetVisibility(ESlateVisibility.SelfHitTestInvisible) + local UnlockType, Cost = PlacementModeConfig.GetPlaceItemUnlockInfo(self.ItemType) + -- 类型索引是从2开始的 + self.WidgetSwitcher_UnlockType:SetActiveWidgetIndex(UnlockType - 2) + self.TextBlock_Unlock:SetText(tostring(Cost)) + + else + self.Overlay_Lock:SetVisibility(ESlateVisibility.Collapsed) + end +end + +function WB_PlaceItem:UpdateCanUnlock() + if self:ItemIsLock(self.bIsLock) then + local UnlockType, Cost = PlacementModeConfig.GetPlaceItemUnlockInfo(self.ItemType) + if UGCGameSystem.GameState:CheckUnlockProperty(UGCSystemLibrary.GetLocalPlayerKey(), UnlockType, Cost) then + self.WidgetSwitcher_CanUnLock:SetActiveWidgetIndex(1) + else + self.WidgetSwitcher_CanUnLock:SetActiveWidgetIndex(0) + end + end +end + + + +return WB_PlaceItem; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/PlacePanel/WB_PlacePanel.lua b/CounterAttack_Solo/Script/UI/StatusUI/PlacePanel/WB_PlacePanel.lua new file mode 100644 index 00000000..443dfa0a --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/PlacePanel/WB_PlacePanel.lua @@ -0,0 +1,308 @@ +---@class WB_PlacePanel_C:UAEUserWidget +---@field RetractItemInfo UWidgetAnimation +---@field Button_AddYaw UButton +---@field Button_ChangeMode UButton +---@field Button_Debug UButton +---@field Button_Fly UButton +---@field Button_GetPlaceCode UNewButton +---@field Button_ImportCode UNewButton +---@field Button_ItemIncrement UButton +---@field Button_PlaceOrClear UButton +---@field Button_Retract UButton +---@field Button_RunTest UNewButton +---@field Button_SubYaw UButton +---@field Button_ToMenu UNewButton +---@field CustomizeCanvasPanel_BP_Desc UCustomizeCanvasPanel_BP_C +---@field CustomizeCanvasPanel_ChangeMode UCustomizeCanvasPanel_BP_C +---@field CustomizeCanvasPanel_PlaceBtn UCustomizeCanvasPanel_BP_C +---@field CustomizeCanvasPanel_PlaceValue UCustomizeCanvasPanel_BP_C +---@field CustomizeCanvasPanel_SelectPlaceItem UCustomizeCanvasPanel_BP_C +---@field CustomizeCanvasPanel_SetYaw UCustomizeCanvasPanel_BP_C +---@field ScrollBox_Items UScrollBox +---@field Slider_Yaw USlider +---@field TextBlock_Increment UTextBlock +---@field TextBlock_ItemCountRange UTextBlock +---@field TextBlock_ItemDesc UTextBlock +---@field TextBlock_ItemName UTextBlock +---@field TextBlock_PlaceValue UTextBlock +---@field TextBlock_Yaw UTextBlock +---@field WidgetSwitcher_ChangeMode UWidgetSwitcher +---@field WidgetSwitcher_Increment UWidgetSwitcher +---@field WidgetSwitcher_IsPlace UWidgetSwitcher +---@field WidgetSwitcher_Retract UWidgetSwitcher +---@field WidgetSwitcher_UnlockType UWidgetSwitcher +--Edit Below-- +local WB_PlacePanel = { + bItemInfoPanelIsRetract = false; + bCanIncrement = false; +}; + +function WB_PlacePanel:Construct() + self:InitPlaceItem() + + WidgetLibrary.BindButtonPressed(self.Button_PlaceOrClear, self.PlaceItem, self) + WidgetLibrary.BindButtonPressed(self.Button_AddYaw, self.AddYaw, self) + WidgetLibrary.BindButtonPressed(self.Button_SubYaw, self.SubYaw, self) + WidgetLibrary.BindButtonPressed(self.Button_Retract, self.RetractItemInfoPanel, self) + WidgetLibrary.SliderOnValueChanged(self.Slider_Yaw, self.YawChange, self) + WidgetLibrary.BindButtonPressed(self.Button_ChangeMode, self.ChangePlaceMode, self) + WidgetLibrary.BindButtonClicked(self.Button_RunTest, self.EnableRunTest, self) + WidgetLibrary.BindButtonClicked(self.Button_ToMenu, self.ClickToMenu, self) + WidgetLibrary.BindButtonClicked(self.Button_ItemIncrement, self.ClickItemIncrement, self) + WidgetLibrary.ButtonOnClickShowPanel(self.Button_GetPlaceCode, WidgetConfig.EUIType.ShowPlaceCode) + WidgetLibrary.ButtonOnClickShowPanel(self.Button_ImportCode, WidgetConfig.EUIType.ImportPlaceCode) + + + UGCEventSystem.AddListener(EventEnum.PlaceModeChange, self.UpdatePlaceMode, self) + UGCEventSystem.AddListener(EventEnum.UpdatePlaceValue, self.UpdatePlaceValue, self) + UGCEventSystem.AddListener(EventEnum.PlaceItemTypeIsChange, self.PlaceItemTypeIsChange, self) + UGCEventSystem.AddListener(ArchiveDataConfig.GetParamNotifyEvent(ArchiveDataConfig.EArchiveType.ItemIncrement), self.UpdatePlaceItemInfo, self) + UGCEventSystem.AddListener(ArchiveDataConfig.GetParamNotifyEvent(ArchiveDataConfig.EArchiveType.Exp), self.UpdatePlaceValue, self) + + + if GlobalConfigs.IsDebug then + self.Button_Debug:SetVisibility(ESlateVisibility.Visible) + WidgetLibrary.ButtonOnClickShowPanel(self.Button_Debug, WidgetConfig.EUIType.Debug) + end + +end + +function WB_PlacePanel:OnShowPanel() + WidgetConfig.SetDefaultUIMode(WidgetConfig.EDefaultUIMode.PlaceMode) + + PlacementModeConfig.GetPlaceManager():SetPlaceMode(PlacementModeConfig.EPlaceMode.PlaceMode) + self:UpdatePlaceValue() + for i = 1, self.ScrollBox_Items:GetChildrenCount() do + local Item = self.ScrollBox_Items:GetChildAt(i - 1) + Item:UpdatePlacedItemCount() + end + +end + +function WB_PlacePanel:OnClosePanel() + WidgetConfig.RemoveDefaultUIMode(WidgetConfig.EDefaultUIMode.PlaceMode) + PlacementModeConfig.GetPlaceManager():SetPlaceMode(PlacementModeConfig.EPlaceMode.None) +end + +function WB_PlacePanel:PlaceItem() + SoundSystem.PlaySound(SoundSystem.ESound.Click) + if self.PlaceMode == PlacementModeConfig.EPlaceMode.PlaceMode then + PlacementModeConfig.GetPlaceManager():ClientPlace() + elseif self.PlaceMode == PlacementModeConfig.EPlaceMode.RemoveMode then + PlacementModeConfig.GetPlaceManager():ClientRemoveItem() + end +end + + +WB_PlacePanel.LastYawValue = 0 +---@param Value float +function WB_PlacePanel:YawChange(Value) + local YawValue = (Value - 0.5) * 360 + -- if YawValue < 0 then YawValue = YawValue + 360 end + YawValue = KismetMathLibrary.Round(YawValue / PlacementModeConfig.PlacingAttr.RotationSpacing) * PlacementModeConfig.PlacingAttr.RotationSpacing + self:UpdateYawValue(YawValue) +end + +function WB_PlacePanel:AddYaw() + SoundSystem.PlaySound(SoundSystem.ESound.Click) + self:UpdateYawValue(self.LastYawValue + PlacementModeConfig.PlacingAttr.RotationSpacing, true) +end + +function WB_PlacePanel:SubYaw() + SoundSystem.PlaySound(SoundSystem.ESound.Click) + self:UpdateYawValue(self.LastYawValue - PlacementModeConfig.PlacingAttr.RotationSpacing, true) +end + +function WB_PlacePanel:UpdateYawValue(YawValue, UpdateSlider) + YawValue = math.clamp(YawValue, -180, 180) + self.LastYawValue = YawValue + PlacementModeConfig.GetPlaceManager():SetAddPreviewQuat(self.LastYawValue % 360) + self.TextBlock_Yaw:SetText(tostring(YawValue) .. "°") + if UpdateSlider then + self.Slider_Yaw:SetValue(math.clamp(YawValue / 360 + 0.5), 0, 1) + end +end + +function WB_PlacePanel:InitPlaceItem() + local PlaceItemWidgetPath = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/StatusUI/PlacePanel/WB_PlaceItem.WB_PlaceItem_C'); + local PlaceItemWidgetClass = UE.LoadClass(PlaceItemWidgetPath) + local LocalPC = UGCSystemLibrary.GetLocalPlayerController() + + local PlaceManager = PlacementModeConfig.GetPlaceManager() + local ItemTypes = table.getKeys(PlacementModeConfig.ItemInfo) + table.sort(ItemTypes, function(a, b) return a < b end) + for i, v in pairs(ItemTypes) do + local Item = UserWidget.NewWidgetObjectBP(LocalPC, PlaceItemWidgetClass); + self.ScrollBox_Items:AddChild(Item) + Item:SetItemType(v) + if UE.IsValid(PlaceManager) then + Item:UpdateSelectItem(PlaceManager:GetPlaceItemType()) + end + end + +end + +function WB_PlacePanel:UpdatePlaceMode(InPlaceMode) + if InPlaceMode ~= self.PlaceMode then + self.PlaceMode = InPlaceMode + if self.PlaceMode == PlacementModeConfig.EPlaceMode.PlaceMode then + self.WidgetSwitcher_IsPlace:SetActiveWidgetIndex(0) + self.WidgetSwitcher_ChangeMode:SetActiveWidgetIndex(0) + self.CustomizeCanvasPanel_SetYaw:SetVisibility(ESlateVisibility.SelfHitTestInvisible); + -- self.CustomizeCanvasPanel_SelectPlaceItem:SetVisibility(ESlateVisibility.SelfHitTestInvisible); + elseif self.PlaceMode == PlacementModeConfig.EPlaceMode.RemoveMode then + self.WidgetSwitcher_IsPlace:SetActiveWidgetIndex(1) + self.WidgetSwitcher_ChangeMode:SetActiveWidgetIndex(1) + self.CustomizeCanvasPanel_SetYaw:SetVisibility(ESlateVisibility.Collapsed); + -- self.CustomizeCanvasPanel_SelectPlaceItem:SetVisibility(ESlateVisibility.Collapsed); + end + end +end + +function WB_PlacePanel:ChangePlaceMode() + SoundSystem.PlaySound(SoundSystem.ESound.Click) + if self.PlaceMode == PlacementModeConfig.EPlaceMode.PlaceMode then + PlacementModeConfig.GetPlaceManager():SetPlaceMode(PlacementModeConfig.EPlaceMode.RemoveMode) + elseif self.PlaceMode == PlacementModeConfig.EPlaceMode.RemoveMode then + PlacementModeConfig.GetPlaceManager():SetPlaceMode(PlacementModeConfig.EPlaceMode.PlaceMode) + end +end + +function WB_PlacePanel:UpdatePlaceValue() + local PlaceValue = PlacementModeConfig.GetPlaceManager():GetPlaceValue() + local PlaceMaxValue = PlacementModeConfig.GetPlaceMaxValue(UGCSystemLibrary.GetLocalPlayerKey()) + self.TextBlock_PlaceValue:SetText(tostring(PlaceValue) .. "/" .. tostring(PlaceMaxValue)) + -- self.TextBlock_PlaceValue:SetColorAndOpacity({SpecifiedColor = {R = PlaceValue / PlaceMaxValue, G = 1 - PlaceValue / PlaceMaxValue, B = 0, A = 1}, ColorUseRule = 0}) +end + +function WB_PlacePanel:EnableRunTest() + SoundSystem.PlaySound(SoundSystem.ESound.Click) + UGCLogSystem.Log("[WB_PlacePanel_EnableRunTest]") + UGCSendRPCSystem.RPCEvent(nil, EventEnum.RunMapTest) +end + +function WB_PlacePanel:ReturnToMenu() + SoundSystem.PlaySound(SoundSystem.ESound.Click) + UGCLogSystem.Log("[WB_PlacePanel_ReturnToMenu]") + UGCSendRPCSystem.ActorRPCNotify(nil, UGCGameSystem.GameState, "ShowSimplePlaceModeUI", WidgetConfig.EUIType.PlaceModeMainMenu) +end + +function WB_PlacePanel:ClickToMenu() + local SecondaryConfirmationWidget = WidgetManager:GetPanel(WidgetConfig.EUIType.SecondaryConfirmation) + SecondaryConfirmationWidget:SetTextInfo("该地图还未保存,是否进行跑图测试后保存?", "不保存", "跑图测试") + SecondaryConfirmationWidget:BindCancellationCallBack(self.ReturnToMenu, self) + SecondaryConfirmationWidget:BindConfirmCallBack(self.EnableRunTest, self) + WidgetManager:ShowPanel(WidgetConfig.EUIType.SecondaryConfirmation, false) +end + +function WB_PlacePanel:PlaceItemTypeIsChange(InPlaceItemType) + local ItemInfo = PlacementModeConfig.ItemInfo[InPlaceItemType] + self.PlaceItemType = InPlaceItemType + if ItemInfo then + self:UpdatePlaceItemInfo() + self.TextBlock_ItemName:SetText(ItemInfo.Name) + self.TextBlock_ItemDesc:SetText(ItemInfo.Desc) + end +end + +--- 刷新增量信息 +function WB_PlacePanel:UpdateItemIncrementInfo() + local ItemInfo = PlacementModeConfig.ItemInfo[self.PlaceItemType] + if ItemInfo then + local ItemIncrement = ArchiveDataConfig.GetPlayerArchiveDataFromType(UGCSystemLibrary.GetLocalPlayerKey(), ArchiveDataConfig.EArchiveType.ItemIncrement) + local Count = ItemInfo.InitialCount + if ItemIncrement and ItemIncrement[self.PlaceItemType] then + Count = ItemIncrement[self.PlaceItemType] + ItemInfo.InitialCount + end + self.bCanIncrement = false + if Count == 0 then + self.WidgetSwitcher_Increment:SetActiveWidgetIndex(1) + elseif Count >= ItemInfo.MaxCount then + self.WidgetSwitcher_Increment:SetActiveWidgetIndex(2) + else + self.bCanIncrement = true + self.WidgetSwitcher_Increment:SetActiveWidgetIndex(0) + end + local UnlockType, Cost = PlacementModeConfig.GetPlaceItemIncrementInfo(self.PlaceItemType) + -- 类型索引是从2开始的 + self.WidgetSwitcher_UnlockType:SetActiveWidgetIndex(UnlockType - 2) + self.TextBlock_Increment:SetText(tostring(Cost)) + end +end + + +--- 更新放置上限 +function WB_PlacePanel:UpdateItemCountRange() + local ItemInfo = PlacementModeConfig.ItemInfo[self.PlaceItemType] + local CanPlaceNum = PlacementModeConfig.GetPlayerPlaceItemCount(UGCSystemLibrary.GetLocalPlayerKey(), self.PlaceItemType) + local MaxCount = ItemInfo.MaxCount + self.TextBlock_ItemCountRange:SetText(string.format("上限:%d/%d", CanPlaceNum, MaxCount)) +end + +--- 更新放置物信息栏 +function WB_PlacePanel:UpdatePlaceItemInfo() + self:UpdateItemCountRange() + self:UpdateItemIncrementInfo() +end + +--- 增量 +function WB_PlacePanel:ClickItemIncrement() + if self.PlaceItemType and self.bCanIncrement then + SoundSystem.PlaySound(SoundSystem.ESound.Click) + local UnlockType, Cost = PlacementModeConfig.GetPlaceItemIncrementInfo(self.PlaceItemType) + -- 二次确定消耗解锁 + local SecondaryConfirmationWidget = WidgetManager:GetPanel(WidgetConfig.EUIType.SecondaryConfirmation) + + if PlacementModeConfig.EUnlockType.None == UnlockType then + elseif PlacementModeConfig.EUnlockType.Level == UnlockType then + SecondaryConfirmationWidget:SetTextInfo("是否增加放置上限?") + else + SecondaryConfirmationWidget:SetTextInfo(string.format("是否消耗%s%s增加放置上限?", tostring(Cost), PlacementModeConfig.UnlockName[UnlockType])) + end + SecondaryConfirmationWidget:BindConfirmCallBack(self.ConfirmIncrement, self) + WidgetManager:ShowPanel(WidgetConfig.EUIType.SecondaryConfirmation, false) + end +end + +function WB_PlacePanel:ConfirmIncrement() + if self.PlaceItemType then + UGCSendRPCSystem.ActorRPCNotify(nil, UGCGameSystem.GameState, "AddItemIncrement", UGCSystemLibrary.GetLocalPlayerKey(), self.PlaceItemType) + end +end + +--- 收起或展开Item信息面板 +function WB_PlacePanel:RetractItemInfoPanel() + SoundSystem.PlaySound(SoundSystem.ESound.Click) + if self.bItemInfoPanelIsRetract then + self:PlayAnimation(self.RetractItemInfo, 0, 1, EUMGSequencePlayMode.Reverse, 1) + else + self:PlayAnimation(self.RetractItemInfo, 0, 1, EUMGSequencePlayMode.Forward, 1) + end + self.bItemInfoPanelIsRetract = not self.bItemInfoPanelIsRetract +end + +--[[ +function WB_PlacePanel:ReceiveTick(DeltaTime) + self.SuperClass.ReceiveTick(self, DeltaTime); +end +--]] + +--[[ +function WB_PlacePanel:ReceiveEndPlay() + self.SuperClass.ReceiveEndPlay(self); +end +--]] + +--[[ +function WB_PlacePanel:GetReplicatedProperties() + return +end +--]] + +--[[ +function WB_PlacePanel:GetAvailableServerRPCs() + return +end +--]] + +return WB_PlacePanel; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/PlacePanel/WB_SetRot.lua b/CounterAttack_Solo/Script/UI/StatusUI/PlacePanel/WB_SetRot.lua new file mode 100644 index 00000000..1ec4c7a3 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/PlacePanel/WB_SetRot.lua @@ -0,0 +1,24 @@ +---@class WB_SetRot_C:UUserWidget +---@field Button_Reset UButton +---@field Image_0 UImage +---@field Slider_Yaw USlider +---@field TextBlock_Axle UTextBlock +---@field TextBlock_Yaw UTextBlock +--Edit Below-- +local WB_SetRot = { bInitDoOnce = false; }; + +--[==[ Construct +function WB_SetRot:Construct() + +end +-- Construct ]==] + +-- function WB_SetRot:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_SetRot:Destruct() + +-- end + +return WB_SetRot; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/PlacePanel/WB_ShowPlaceCode.lua b/CounterAttack_Solo/Script/UI/StatusUI/PlacePanel/WB_ShowPlaceCode.lua new file mode 100644 index 00000000..400d89d4 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/PlacePanel/WB_ShowPlaceCode.lua @@ -0,0 +1,29 @@ +---@class WB_ShowPlaceCode_C:UUserWidget +---@field Button_ClosePanel UNewButton +---@field EditableText_ShowPlaceCode UWidget_NewEditableText_C +--Edit Below-- +local WB_ShowPlaceCode = { bInitDoOnce = false; }; + + +function WB_ShowPlaceCode:Construct() + WidgetLibrary.BindButtonClicked(self.Button_ClosePanel, self.CloseSelf, self) +end + + +function WB_ShowPlaceCode:OnShowPanel() + local PlaceCode = PlacementModeConfig.GetPlaceManager():ExportPlacementCode() + self.EditableText_ShowPlaceCode:SetText(PlaceCode) +end + +function WB_ShowPlaceCode:CloseSelf() + WidgetManager:ClosePanel(WidgetConfig.EUIType.ShowPlaceCode) +end +-- function WB_ShowPlaceCode:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_ShowPlaceCode:Destruct() + +-- end + +return WB_ShowPlaceCode; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/ReplaceSavedMap/WB_ReplaceSavedMap.lua b/CounterAttack_Solo/Script/UI/StatusUI/ReplaceSavedMap/WB_ReplaceSavedMap.lua new file mode 100644 index 00000000..c2504f50 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/ReplaceSavedMap/WB_ReplaceSavedMap.lua @@ -0,0 +1,86 @@ +---@class WB_ReplaceSavedMap_C:UUserWidget +---@field Button_Cancellation UNewButton +---@field Button_Replace UNewButton +---@field UniformGridPanel_SavedMapPanel UUniformGridPanel +--Edit Below-- +local WB_ReplaceSavedMap = { + bInitDoOnce = false; + ItemsCol = 2; + AllSavedMapItems = {}; +}; + + +function WB_ReplaceSavedMap:Construct() + local LocalPC = UGCSystemLibrary.GetLocalPlayerController() + local ItemClass = UE.LoadClass(UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/StatusUI/ReplaceSavedMap/WB_ReplaceSavedMapItem.WB_ReplaceSavedMapItem_C')) + for i = 0, PlacementModeConfig.PlacingAttr.MaxPlaceValue - 1 do + + local Item = UserWidget.NewWidgetObjectBP(LocalPC, ItemClass) + self.UniformGridPanel_SavedMapPanel:AddChild(Item) + local Slot = WidgetLayoutLibrary.SlotAsUniformGridSlot(Item) + Slot:SetColumn(i % self.ItemsCol) + Slot:SetRow(i // self.ItemsCol) + Slot:SetVerticalAlignment(EVerticalAlignment.VAlign_Center) + Slot:SetHorizontalAlignment(EHorizontalAlignment.HAlign_Center) + Item:Init(self.ClickSavedMapItem, self, i + 1, "Nil") + self.AllSavedMapItems[i] = Item + end + + WidgetLibrary.BindButtonClicked(self.Button_Cancellation, self.ClickCancellation, self) + WidgetLibrary.BindButtonClicked(self.Button_Replace, self.ClickReplace, self) + + UGCEventSystem.AddListener(ArchiveDataConfig.GetParamNotifyEvent(ArchiveDataConfig.EArchiveType.SavedMap), self.UpdateSavedMap, self) + self:UpdateSavedMap() + +end + +function WB_ReplaceSavedMap:OnShowPanel() + self:ClickSavedMapItem(1) +end + + +function WB_ReplaceSavedMap:UpdateSavedMap() + local SimplePlayerSavedMapList = ArchiveDataConfig.GetPlayerArchiveDataFromType(UGCSystemLibrary.GetLocalPlayerKey(), ArchiveDataConfig.EArchiveType.SavedMap) + if SimplePlayerSavedMapList == nil then + SimplePlayerSavedMapList = {} + end + for i, v in pairs(self.AllSavedMapItems) do + local MapInfo = SimplePlayerSavedMapList[v:GetIndex()] + if MapInfo == nil then + v:SetVisibility(ESlateVisibility.Collapsed) + else + v:SetVisibility(ESlateVisibility.SelfHitTestInvisible) + v:ResetName(MapInfo.MapName) + end + end + +end + + + +function WB_ReplaceSavedMap:ClickSavedMapItem(InIndex) + self.SelectIndex = InIndex + for i, v in pairs(self.AllSavedMapItems) do + v:SetIsSelected(v:GetIndex() == InIndex) + end +end + +function WB_ReplaceSavedMap:ClickReplace() + UGCSendRPCSystem.ActorRPCNotify(nil, UGCGameSystem.GameState, "ReplaceMap", UGCSystemLibrary.GetLocalPlayerKey(), self.SelectIndex) + WidgetManager:ClosePanel(WidgetConfig.EUIType.ReplaceSavedMap) +end + +function WB_ReplaceSavedMap:ClickCancellation() + WidgetManager:ClosePanel(WidgetConfig.EUIType.ReplaceSavedMap) +end + + +-- function WB_ReplaceSavedMap:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_ReplaceSavedMap:Destruct() + +-- end + +return WB_ReplaceSavedMap; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/ReplaceSavedMap/WB_ReplaceSavedMapItem.lua b/CounterAttack_Solo/Script/UI/StatusUI/ReplaceSavedMap/WB_ReplaceSavedMapItem.lua new file mode 100644 index 00000000..d4f239d3 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/ReplaceSavedMap/WB_ReplaceSavedMapItem.lua @@ -0,0 +1,51 @@ +---@class WB_ReplaceSavedMapItem_C:UUserWidget +---@field Button_Select UNewButton +---@field TextBlock_MapName UTextBlock +---@field WidgetSwitcherIsSelected UWidgetSwitcher +--Edit Below-- +local WB_ReplaceSavedMapItem = { bInitDoOnce = false; }; + + +function WB_ReplaceSavedMapItem:LuaInit() + if self.bInitDoOnce then + return; + end + self.bInitDoOnce = true; + WidgetLibrary.BindButtonClicked(self.Button_Select, self.ClickBtn, self) +end + +function WB_ReplaceSavedMapItem:Init(InCallBackFunc, InCallBackObj, InIndex, InShowName) + self:LuaInit() + self.CallBackFunc, self.CallBackObj = InCallBackFunc, InCallBackObj + self.TextBlock_MapName:SetText(InShowName) + self.Index = InIndex +end + +function WB_ReplaceSavedMapItem:GetIndex() + return self.Index +end + +function WB_ReplaceSavedMapItem:SetIsSelected(IsSelect) + if IsSelect then + self.WidgetSwitcherIsSelected:SetActiveWidgetIndex(1) + else + self.WidgetSwitcherIsSelected:SetActiveWidgetIndex(0) + end +end + +function WB_ReplaceSavedMapItem:ResetName(InShowName) + self.TextBlock_MapName:SetText(InShowName) +end + +function WB_ReplaceSavedMapItem:ClickBtn() + if self.CallBackFunc then + if self.CallBackObj then + self.CallBackFunc(self.CallBackObj, self.Index) + else + self.CallBackFunc(self.Index) + end + end + -- SoundSystem.PlaySound(SoundSystem.ESound.Btn) +end + +return WB_ReplaceSavedMapItem; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/Round/WB_PlaceItemCountInfo.lua b/CounterAttack_Solo/Script/UI/StatusUI/Round/WB_PlaceItemCountInfo.lua new file mode 100644 index 00000000..ce445095 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/Round/WB_PlaceItemCountInfo.lua @@ -0,0 +1,34 @@ +---@class WB_PlaceItemCountInfo_C:UUserWidget +---@field TextBlock_Count UTextBlock +---@field TextBlock_ItemName UTextBlock +--Edit Below-- +local WB_PlaceItemCountInfo = { bInitDoOnce = false; }; + +--[==[ Construct +function WB_PlaceItemCountInfo:Construct() + +end +-- Construct ]==] + +-- function WB_PlaceItemCountInfo:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_PlaceItemCountInfo:Destruct() + +-- end + +function WB_PlaceItemCountInfo:Init(InPlaceItemType) + self.PlaceItemType = InPlaceItemType + self.TextBlock_ItemName:SetText(PlacementModeConfig.ItemInfo[self.PlaceItemType].Name) +end + +function WB_PlaceItemCountInfo:SetCount(InCount) + self.TextBlock_Count:SetText("×" .. InCount) +end + +function WB_PlaceItemCountInfo:GetPlaceItemType() + return self.PlaceItemType +end + +return WB_PlaceItemCountInfo; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/Round/WB_RoundFinish.lua b/CounterAttack_Solo/Script/UI/StatusUI/Round/WB_RoundFinish.lua new file mode 100644 index 00000000..bfacdf34 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/Round/WB_RoundFinish.lua @@ -0,0 +1,37 @@ +---@class WB_RoundFinish_C:UUserWidget +---@field WidgetSwitcher_IsWin UWidgetSwitcher +---@field WiningSound UAkAudioEvent +--Edit Below-- +local WB_RoundFinish = { + bInitDoOnce = false; + NowDefender = -1; +}; + + +function WB_RoundFinish:Construct() +end + + +function WB_RoundFinish:OnShowPanel(WiningTeam) + local LocalPlayerTeamID = UGCPlayerControllerSystem.GetTeamID(UGCSystemLibrary.GetLocalPlayerController()) + if WiningTeam == LocalPlayerTeamID then + self.WidgetSwitcher_IsWin:SetActiveWidgetIndex(0) + UGCSoundManagerSystem.PlaySound2D(self.WiningSound) + else + self.WidgetSwitcher_IsWin:SetActiveWidgetIndex(1) + end + UGCEventSystem.SetTimer(self, function() + WidgetManager:ClosePanel(WidgetConfig.EUIType.RoundFinish) + end, 5) +end + + +-- function WB_RoundFinish:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_RoundFinish:Destruct() + +-- end + +return WB_RoundFinish; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/Round/WB_RoundReadyState.lua b/CounterAttack_Solo/Script/UI/StatusUI/Round/WB_RoundReadyState.lua new file mode 100644 index 00000000..c1b3d47c --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/Round/WB_RoundReadyState.lua @@ -0,0 +1,54 @@ +---@class WB_RoundReadyState_C:UUserWidget +---@field Overlay_WaitTime UOverlay +---@field TextBlock_WaitTime UTextBlock +--Edit Below-- +local WB_RoundReadyState = { + bInitDoOnce = false; + NowRound = -1; +} + + +function WB_RoundReadyState:Construct() + UGCEventSystem.AddListener(EventEnum.NewRound, self.UpdateShowRoundTime, self) +end + + +function WB_RoundReadyState:UpdateShowRoundTime(InRound) + self.NowRound = InRound + if self.NowRound > 0 then + WidgetManager:ShowPanel(WidgetConfig.EUIType.RoundReady, false) + self:UpdateShowGameTime() + if self.ClockHandle == nil then + self.ClockHandle = UGCEventSystem.SetTimerLoop(self, function() + if not self:UpdateShowGameTime() then + UGCEventSystem.StopTimer(self.ClockHandle) + self.ClockHandle = nil + WidgetManager:ClosePanel(WidgetConfig.EUIType.RoundReady) + WidgetManager:ShowPanel(WidgetConfig.EUIType.RoundStartTip, false) + end + end, 1) + end + end +end + +function WB_RoundReadyState:UpdateShowGameTime() + local NowGameTime = UGCGameSystem.GameState:GetGameTime() + local ShowTime = NowGameTime - GlobalConfigs.GameSetting.RoundTime + UGCLogSystem.Log("[WB_RoundReadyState_UpdateShowGameTime] ShowTime:%s", tostring(ShowTime)) + if ShowTime >= 0 then + self.TextBlock_WaitTime:SetText(ShowTime) + return true + end + self.TextBlock_WaitTime:SetText(GlobalConfigs.GameSetting.RoundReadyTime) + return false +end + +-- function WB_RoundReadyState:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_RoundReadyState:Destruct() + +-- end + +return WB_RoundReadyState \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/Round/WB_RoundStartTip.lua b/CounterAttack_Solo/Script/UI/StatusUI/Round/WB_RoundStartTip.lua new file mode 100644 index 00000000..39e6c9af --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/Round/WB_RoundStartTip.lua @@ -0,0 +1,50 @@ +---@class WB_RoundStartTip_C:UUserWidget +---@field ShowRound UWidgetAnimation +---@field Image_5 UImage +---@field TextBlock_GamePoint UTextBlock +---@field TextBlock_Round UTextBlock +---@field TextBlock_Tip UTextBlock +--Edit Below-- +local WB_RoundStartTip = { bInitDoOnce = false } + + +function WB_RoundStartTip:Construct() + UGCEventSystem.AddListener(EventEnum.UpdateTeamScore, self.UpdateGamePoint, self) + UGCEventSystem.AddListener(EventEnum.NewRound, self.UpdateRoundCount, self) +end + +function WB_RoundStartTip:UpdateGamePoint() + local LeftTeamScore = UGCGameSystem.GameState:GetTeamScore(1) + local RightTeamScore = UGCGameSystem.GameState:GetTeamScore(2) + if math.max(LeftTeamScore, RightTeamScore) >= GlobalConfigs.GameSetting.MaxRound // 2 then + self.TextBlock_GamePoint:SetVisibility(ESlateVisibility.SelfHitTestInvisible) + end +end + +function WB_RoundStartTip:UpdateRoundCount(InRound) + self.TextBlock_Round:SetText(InRound) +end + +function WB_RoundStartTip:OnShowPanel() + self:PlayAnimation(self.ShowRound, 0, 1, EUMGSequencePlayMode.Forward, 1); + + --local IsAttacker = UGCGameSystem.GameState:PlayerIsAttacker(UGCSystemLibrary.GetLocalPlayerKey()) + --local MapModeType = UGCGameSystem.GameState:GetMapModeType() + -- + --if MapModeType == MapConfig.EModeType.AttackPoint and IsAttacker then + -- self.TextBlock_Tip:SetText("目标:淘汰敌方所有玩家或成功占点") + --else + -- self.TextBlock_Tip:SetText("目标:淘汰敌方所有玩家") + --end + +end + +-- function WB_RoundStartTip:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_RoundStartTip:Destruct() + +-- end + +return WB_RoundStartTip \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/RunMapPanel/WB_RerunPanel.lua b/CounterAttack_Solo/Script/UI/StatusUI/RunMapPanel/WB_RerunPanel.lua new file mode 100644 index 00000000..1bd56446 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/RunMapPanel/WB_RerunPanel.lua @@ -0,0 +1,31 @@ +---@class WB_RerunPanel_C:UUserWidget +---@field AnimShow UWidgetAnimation +---@field Button_Break UButton +---@field Button_Rerun UButton +--Edit Below-- +local WB_RerunPanel = { bInitDoOnce = false; }; + + +function WB_RerunPanel:Construct() + WidgetLibrary.BindButtonClicked(self.Button_Break, self.NotifyToPlaceMode, self) + WidgetLibrary.BindButtonClicked(self.Button_Rerun, self.NotifyToRerun, self) +end + +function WB_RerunPanel:NotifyToPlaceMode() + UGCSendRPCSystem.RPCEvent(nil, EventEnum.BackToPlaceMode) +end + +function WB_RerunPanel:NotifyToRerun() + UGCSendRPCSystem.RPCEvent(nil, EventEnum.RerunNowRound) +end + + +-- function WB_RerunPanel:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_RerunPanel:Destruct() + +-- end + +return WB_RerunPanel; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/RunMapPanel/WB_RunMapPanel.lua b/CounterAttack_Solo/Script/UI/StatusUI/RunMapPanel/WB_RunMapPanel.lua new file mode 100644 index 00000000..e20a1963 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/RunMapPanel/WB_RunMapPanel.lua @@ -0,0 +1,36 @@ +---@class WB_RunMapPanel_C:UUserWidget +---@field Button_Break UNewButton +---@field Button_Reset UNewButton +---@field TextBlock_Time UTextBlock +--Edit Below-- +local WB_RunMapPanel = { bInitDoOnce = false; }; + + +function WB_RunMapPanel:Construct() + WidgetLibrary.TextBlockBindingPropertyText(self.TextBlock_Time, self.UpdateTime, self) + WidgetLibrary.BindButtonClicked(self.Button_Break, self.NotifyToPlaceMode, self) + WidgetLibrary.BindButtonClicked(self.Button_Reset, self.NotifyToRerun, self) +end + +function WB_RunMapPanel:UpdateTime() + return tostring(UGCGameSystem.GameState:GetGameTime()) +end + + +function WB_RunMapPanel:NotifyToPlaceMode() + UGCSendRPCSystem.RPCEvent(nil, EventEnum.BackToPlaceMode) +end + +function WB_RunMapPanel:NotifyToRerun() + UGCSendRPCSystem.RPCEvent(nil, EventEnum.RerunNowRound) +end + +-- function WB_RunMapPanel:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_RunMapPanel:Destruct() + +-- end + +return WB_RunMapPanel; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/RunMapPanel/WB_SaveMap.lua b/CounterAttack_Solo/Script/UI/StatusUI/RunMapPanel/WB_SaveMap.lua new file mode 100644 index 00000000..7697f6fd --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/RunMapPanel/WB_SaveMap.lua @@ -0,0 +1,41 @@ +---@class WB_SaveMap_C:UUserWidget +---@field AnimShow UWidgetAnimation +---@field Button_PlaceMode UButton +---@field Button_Save UButton +---@field EditableText_MapName UWidget_NewEditableText_C +--Edit Below-- +local WB_SaveMap = { bInitDoOnce = false; }; + + +function WB_SaveMap:Construct() + WidgetLibrary.BindButtonClicked(self.Button_PlaceMode, self.NotifyToPlaceMode, self) + WidgetLibrary.BindButtonClicked(self.Button_Save, self.NotifySaveMap, self) + self.EditableText_MapName.OnTextCommitted:Add(self.TextCommit, self) +end + + +function WB_SaveMap:NotifyToPlaceMode() + UGCSendRPCSystem.RPCEvent(nil, EventEnum.BackToPlaceMode) +end + +function WB_SaveMap:NotifySaveMap() + local Text = self.EditableText_MapName:GetText() + UGCSendRPCSystem.RPCEvent(nil, EventEnum.SaveRunMap, Text) +end + +function WB_SaveMap:TextCommit(InText) + -- UGCLogSystem.Log("[WB_SaveMap_TextCommit] InText:%s", InText) + local TargetText = UGCSystemLibrary.remove_punctuation(InText) + UGCLogSystem.Log("[WB_SaveMap_TextCommit] TargetText:%s", TargetText) + self.EditableText_MapName:SetText(UGCSystemLibrary.utf8sub(TargetText, 1, PlacementModeConfig.PlacingAttr.PlaceMapNameLengthLimit)) +end + +-- function WB_SaveMap:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_SaveMap:Destruct() + +-- end + +return WB_SaveMap; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/Task/WB_PlayerLevel.lua b/CounterAttack_Solo/Script/UI/StatusUI/Task/WB_PlayerLevel.lua new file mode 100644 index 00000000..9a7c3be8 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/Task/WB_PlayerLevel.lua @@ -0,0 +1,52 @@ +---@class WB_PlayerLevel_C:UUserWidget +---@field NewButton_AddExp UNewButton +---@field ProgressBar_EXP UProgressBar +---@field TextBlock_Exp UTextBlock +---@field TextBlock_Level UTextBlock +--Edit Below-- +local WB_PlayerLevel = { bInitDoOnce = false; }; + +--[==[ Construct +function WB_PlayerLevel:Construct() + +end +-- Construct ]==] + +-- function WB_PlayerLevel:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_PlayerLevel:Destruct() + +-- end + +function WB_PlayerLevel:Init() + WidgetLibrary.BindButtonClicked(self.NewButton_AddExp, self.ClickAddExp, self) + UGCEventSystem.AddListener(ArchiveDataConfig.GetParamNotifyEvent(ArchiveDataConfig.EArchiveType.Exp), self.UpdateLevelInfo, self) + self:UpdateLevelInfo() +end + +function WB_PlayerLevel:UpdateLevelInfo() + local Exp = ArchiveDataConfig.GetPlayerArchiveDataFromType(UGCSystemLibrary.GetLocalPlayerKey(), ArchiveDataConfig.EArchiveType.Exp) + if Exp == nil then Exp = 0 end + local Level, NowLevelExp, ExpRange = LevelConfig.GetLevel(Exp) + self.ProgressBar_EXP:SetPercent(NowLevelExp / ExpRange) + self.TextBlock_Exp:SetText(NowLevelExp .. "/" .. ExpRange) + self.TextBlock_Level:SetText("Lv:" .. Level) +end + +function WB_PlayerLevel:ClickAddExp() + local LocalPK = UGCSystemLibrary.GetLocalPlayerKey() + local SecondaryConfirmationWidget = WidgetManager:GetPanel(WidgetConfig.EUIType.SecondaryConfirmation_Strip) + local Gold = ArchiveDataConfig.GetPlayerArchiveDataFromType(LocalPK, ArchiveDataConfig.EArchiveType.Gold) + SecondaryConfirmationWidget:SetValRange(0, Gold and Gold or 0) + SecondaryConfirmationWidget:SetTextInfo(function(Val) return string.format("消耗 %s 个金币兑换%s Exp。", tostring(Val), tostring(Val * PlacementModeConfig.PlacingAttr.RatioGoldToExp)) end) + SecondaryConfirmationWidget:BindConfirmCallBack(self.ConfirmExchangeGoldToExp, self) + WidgetManager:ShowPanel(WidgetConfig.EUIType.SecondaryConfirmation_Strip, false) +end + +function WB_PlayerLevel:ConfirmExchangeGoldToExp(GoldVal) + UGCSendRPCSystem.ActorRPCNotify(nil, UGCGameSystem.GameState, "GoldToExp", UGCSystemLibrary.GetLocalPlayerKey(), GoldVal) +end + +return WB_PlayerLevel; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/Task/WB_Task.lua b/CounterAttack_Solo/Script/UI/StatusUI/Task/WB_Task.lua new file mode 100644 index 00000000..9ee5349a --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/Task/WB_Task.lua @@ -0,0 +1,38 @@ +---@class WB_Task_C:UUserWidget +---@field Button_Close UButton +---@field ScrollBox_Tasks UScrollBox +---@field WB_PlayerLevel UWB_PlayerLevel_C +--Edit Below-- +local WB_Task = { bInitDoOnce = false; }; + +function WB_Task:GetTaskItemClass() + if self.TaskClass == nil then + self.TaskClass = UE.LoadClass(UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/StatusUI/Task/WB_Task_Item.WB_Task_Item_C')) + end + return self.TaskClass +end + +function WB_Task:Construct() + WidgetLibrary.BindButtonClicked(self.Button_Close, self.CloseSelf, self) + self.WB_PlayerLevel:Init() + for i, v in pairs(DailyTasksConfig.TaskInfo) do + local TaskItem = UserWidget.NewWidgetObjectBP(self, self:GetTaskItemClass()) + self.ScrollBox_Tasks:AddChild(TaskItem) + TaskItem:Init(i) + end +end + +function WB_Task:CloseSelf() + WidgetManager:ClosePanel(WidgetConfig.EUIType.Task) +end + + +-- function WB_Task:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_Task:Destruct() + +-- end + +return WB_Task; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/Task/WB_TaskReward_N.lua b/CounterAttack_Solo/Script/UI/StatusUI/Task/WB_TaskReward_N.lua new file mode 100644 index 00000000..24f81f09 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/Task/WB_TaskReward_N.lua @@ -0,0 +1,30 @@ +---@class WB_TaskReward_C:UUserWidget +---@field TextBlock_Count UTextBlock +---@field WidgetSwitcher_RewardType UWidgetSwitcher +--Edit Below-- +local WB_TaskReward_N = { bInitDoOnce = false; }; + +--[==[ Construct +function WB_TaskReward_N:Construct() + +end +-- Construct ]==] + +-- function WB_TaskReward_N:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_TaskReward_N:Destruct() + +-- end + +function WB_TaskReward_N:Init(RewardType, Count) + self.TextBlock_Count:SetText(tostring(Count)) + if RewardType == ArchiveDataConfig.EArchiveType.Exp then + self.WidgetSwitcher_RewardType:SetActiveWidgetIndex(1) + elseif RewardType == ArchiveDataConfig.EArchiveType.Gold then + self.WidgetSwitcher_RewardType:SetActiveWidgetIndex(0) + end +end + +return WB_TaskReward_N; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/Task/WB_Task_Item.lua b/CounterAttack_Solo/Script/UI/StatusUI/Task/WB_Task_Item.lua new file mode 100644 index 00000000..4b3802d3 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/Task/WB_Task_Item.lua @@ -0,0 +1,48 @@ +---@class WB_Task_Item_C:UUserWidget +---@field HorizontalBox_Reward UHorizontalBox +---@field TextBlock_Name UTextBlock +---@field TextBlock_TaskCount UTextBlock +--Edit Below-- +local WB_Task_Item = { bInitDoOnce = false; }; + +--[==[ Construct +function WB_Task_Item:Construct() + +end +-- Construct ]==] + +-- function WB_Task_Item:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_Task_Item:Destruct() + +-- end +function WB_Task_Item:Init(InTaskType) + self.TaskType = InTaskType + self.DailyLimit = DailyTasksConfig.TaskInfo[self.TaskType].DailyLimit + self.TextBlock_Name:SetText(tostring(DailyTasksConfig.TaskName[self.TaskType])) + for i = 1, self.HorizontalBox_Reward:GetChildrenCount() do + local Item = self.HorizontalBox_Reward:GetChildAt(i - 1) + local Reward = DailyTasksConfig.TaskInfo[self.TaskType].Reward[i] + if Reward then + Item:Init(Reward.Type, Reward.Count) + Item:SetVisibility(ESlateVisibility.SelfHitTestInvisible) + else + Item:SetVisibility(ESlateVisibility.Collapsed) + end + end + self:UpdateTaskCount() + UGCEventSystem.AddListener(ArchiveDataConfig.GetParamNotifyEvent(ArchiveDataConfig.EArchiveType.DailyTasks), self.UpdateTaskCount, self) +end + +function WB_Task_Item:UpdateTaskCount() + local DailyTasksInfo = ArchiveDataConfig.GetPlayerArchiveDataFromType(UGCSystemLibrary.GetLocalPlayerKey(), ArchiveDataConfig.EArchiveType.DailyTasks) + local CompletedCount = 0 + if DailyTasksInfo and DailyTasksInfo[self.TaskType] then + CompletedCount = DailyTasksInfo[self.TaskType] + end + self.TextBlock_TaskCount:SetText(string.format("%s/%s", tostring(CompletedCount), tostring(self.DailyLimit))) +end + +return WB_Task_Item; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/WB_GameEnd.lua b/CounterAttack_Solo/Script/UI/StatusUI/WB_GameEnd.lua new file mode 100644 index 00000000..63ea89a1 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/WB_GameEnd.lua @@ -0,0 +1,20 @@ +---@class W_GameEnd_C:UUserWidget +--Edit Below-- +---@type W_GameEnd_C +local WB_GameEnd = { bInitDoOnce = false; }; + +--[==[ Construct +function WB_GameEnd:Construct() + +end +-- Construct ]==] + +-- function WB_GameEnd:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_GameEnd:Destruct() + +-- end + +return WB_GameEnd; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/StatusUI/WB_GameUnableToStart.lua b/CounterAttack_Solo/Script/UI/StatusUI/WB_GameUnableToStart.lua new file mode 100644 index 00000000..37859c45 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/StatusUI/WB_GameUnableToStart.lua @@ -0,0 +1,51 @@ +---@class WB_GameUnableToStart_C:UUserWidget +---@field Button_ReturnToLobby UButton +---@field TextBlock_ReturnToLobby UTextBlock +--Edit Below-- +---@type WB_GameUnableToStart_C +local WB_GameUnableToStart = { + bInitDoOnce = false; + OnceReturnToLobby = false; + DelayReturnToLobbyTime = 15.0; +}; + + +function WB_GameUnableToStart:Construct() + WidgetLibrary.BindButtonClicked(self.Button_ReturnToLobby, self.Button_ReturnToLobby_OnClicked, self) +end + +function WB_GameUnableToStart:OnShowPanel() + self:DelayReturnToLobby() +end + + +function WB_GameUnableToStart:DelayReturnToLobby() + self.EndGameTime = KismetSystemLibrary.GetGameTimeInSeconds(self) + self.DelayReturnToLobbyHandle = UGCEventSystem.SetTimerLoop( + self, + function () + local NowTime = KismetSystemLibrary.GetGameTimeInSeconds(self) + local ShowTime = math.floor(self.DelayReturnToLobbyTime - (NowTime - self.EndGameTime)) + ShowTime = ShowTime >= 0 and ShowTime or 0 + self.TextBlock_ReturnToLobby:SetText(string.format("返回大厅(%ds)", ShowTime)) + if ShowTime <= 0 then + self:Button_ReturnToLobby_OnClicked() + end + end, + 0.5 + ) +end + +function WB_GameUnableToStart:Button_ReturnToLobby_OnClicked() + if self.OnceReturnToLobby then return end + if self.DelayReturnToLobbyHandle then + UGCEventSystem.StopTimer(self.DelayReturnToLobbyHandle) + self.DelayReturnToLobbyHandle = nil + end + self.OnceReturnToLobby = true + UGCGameSystem.ReturnToLobby() + UGCLogSystem.Log("[WB_GameUnableToStart_Button_ReturnToLobby_OnClicked]") + SoundSystem.PlaySound(SoundSystem.ESound.Btn) +end + +return WB_GameUnableToStart; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/Tip/WB_FrontSightTip.lua b/CounterAttack_Solo/Script/UI/Tip/WB_FrontSightTip.lua new file mode 100644 index 00000000..cf271164 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/Tip/WB_FrontSightTip.lua @@ -0,0 +1,19 @@ +---@class WB_FrontSightTip_C:UUserWidget +---@field ShowTip UWidgetAnimation +---@field TextBlock_Tip UTextBlock +--Edit Below-- +local WB_FrontSightTip = { bInitDoOnce = false } + + + +function WB_FrontSightTip:Construct() + +end + + +function WB_FrontSightTip:AddTip(TipStr) + self.TextBlock_Tip:SetText(TipStr) + self:PlayAnimation(self.ShowTip, 0, 1, EUMGSequencePlayMode.Forward, 1.0) +end + +return WB_FrontSightTip \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/Tip/WB_GodOfWarCome.lua b/CounterAttack_Solo/Script/UI/Tip/WB_GodOfWarCome.lua new file mode 100644 index 00000000..03b69598 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/Tip/WB_GodOfWarCome.lua @@ -0,0 +1,33 @@ +---@class WB_GodOfWarCome_C:UUserWidget +---@field ShowTip UWidgetAnimation +---@field Border_Tip2 UBorder +---@field TextBlock_Tip UTextBlock +--Edit Below-- +---@type WB_Tip_2_C +local WB_Tip = { bInitDoOnce = false; }; + +function WB_Tip:Construct() + +end + + +-- function WB_Tip:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_Tip:Destruct() + +-- end + +function WB_Tip:AddTip(TipStr) + self.TextBlock_Tip:SetText(TipStr) + self:PlayAnimation(self.ShowTip, 0, 1, EUMGSequencePlayMode.Forward, 1.0) +end + + + + + +-- [Editor Generated Lua] function define End; + +return WB_Tip; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/Tip/WB_GodOfWarDescend.lua b/CounterAttack_Solo/Script/UI/Tip/WB_GodOfWarDescend.lua new file mode 100644 index 00000000..ddb1edb3 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/Tip/WB_GodOfWarDescend.lua @@ -0,0 +1,19 @@ +---@class WB_GodOfWarDescend_C:UUserWidget +--Edit Below-- +local WB_GodOfWarDescend = { bInitDoOnce = false; }; + +--[==[ Construct +function WB_GodOfWarDescend:Construct() + +end +-- Construct ]==] + +-- function WB_GodOfWarDescend:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_GodOfWarDescend:Destruct() + +-- end + +return WB_GodOfWarDescend; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/Tip/WB_KillingGod.lua b/CounterAttack_Solo/Script/UI/Tip/WB_KillingGod.lua new file mode 100644 index 00000000..c1292104 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/Tip/WB_KillingGod.lua @@ -0,0 +1,33 @@ +---@class WB_KillingGod_C:UUserWidget +---@field ShowTip UWidgetAnimation +---@field Border_Tip2 UBorder +---@field TextBlock_Tip UTextBlock +--Edit Below-- +---@type WB_Tip_2_C +local WB_Tip = { bInitDoOnce = false; }; + +function WB_Tip:Construct() + +end + + +-- function WB_Tip:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_Tip:Destruct() + +-- end + +function WB_Tip:AddTip(TipStr) + self.TextBlock_Tip:SetText(TipStr) + self:PlayAnimation(self.ShowTip, 0, 1, EUMGSequencePlayMode.Forward, 1.0) +end + + + + + +-- [Editor Generated Lua] function define End; + +return WB_Tip; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/Tip/WB_Tip.lua b/CounterAttack_Solo/Script/UI/Tip/WB_Tip.lua new file mode 100644 index 00000000..60749869 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/Tip/WB_Tip.lua @@ -0,0 +1,34 @@ +---@class WB_Tip_C:UUserWidget +---@field ShowTip UWidgetAnimation +---@field Border_SetTopTipsColor UBorder +---@field Image_Icon UImage +---@field Text_Tip UTextBlock +--Edit Below-- +---@type WB_Tip_C +local WB_Tip = { bInitDoOnce = false; }; + +function WB_Tip:Construct() + +end + + +-- function WB_Tip:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_Tip:Destruct() + +-- end + +function WB_Tip:AddTip(TipStr) + self.Text_Tip:SetText(TipStr) + self:PlayAnimation(self.ShowTip, 0, 1, EUMGSequencePlayMode.Forward, 1.0) +end + + + + + +-- [Editor Generated Lua] function define End; + +return WB_Tip; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/Tip/WB_Tip_2.lua b/CounterAttack_Solo/Script/UI/Tip/WB_Tip_2.lua new file mode 100644 index 00000000..a44e35f1 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/Tip/WB_Tip_2.lua @@ -0,0 +1,34 @@ +---@class WB_Tip_2_C:UUserWidget +---@field ShowTip UWidgetAnimation +---@field Border_Tip2 UBorder +---@field Image_0 UImage +---@field TextBlock_Tip UTextBlock +--Edit Below-- +---@type WB_Tip_2_C +local WB_Tip = { bInitDoOnce = false; }; + +function WB_Tip:Construct() + +end + + +-- function WB_Tip:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_Tip:Destruct() + +-- end + +function WB_Tip:AddTip(TipStr) + self.TextBlock_Tip:SetText(TipStr) + self:PlayAnimation(self.ShowTip, 0, 1, EUMGSequencePlayMode.Forward, 1.0) +end + + + + + +-- [Editor Generated Lua] function define End; + +return WB_Tip; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/Tip/WB_Tip_3.lua b/CounterAttack_Solo/Script/UI/Tip/WB_Tip_3.lua new file mode 100644 index 00000000..5ef8a3b8 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/Tip/WB_Tip_3.lua @@ -0,0 +1,33 @@ +---@class WB_Tip_3_C:UUserWidget +---@field ShowTip UWidgetAnimation +---@field Border_SetTopTipsColor UBorder +---@field Text_Tip UTextBlock +--Edit Below-- +---@type WB_Tip_3_C +local WB_Tip = { bInitDoOnce = false; }; + +function WB_Tip:Construct() + +end + + +-- function WB_Tip:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_Tip:Destruct() + +-- end + +function WB_Tip:AddTip(TipStr) + self.Text_Tip:SetText(TipStr) + self:PlayAnimation(self.ShowTip, 0, 1, EUMGSequencePlayMode.Forward, 1.0) +end + + + + + +-- [Editor Generated Lua] function define End; + +return WB_Tip; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/Tip/WB_Tip_4.lua b/CounterAttack_Solo/Script/UI/Tip/WB_Tip_4.lua new file mode 100644 index 00000000..010f58b2 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/Tip/WB_Tip_4.lua @@ -0,0 +1,33 @@ +---@class WB_Tip_4_C:UUserWidget +---@field ShowTip UWidgetAnimation +---@field Border_SetTopTipsColor UBorder +---@field Text_Tip UTextBlock +--Edit Below-- +---@type WB_Tip_4_C +local WB_Tip = { bInitDoOnce = false; }; + +function WB_Tip:Construct() + +end + + +-- function WB_Tip:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_Tip:Destruct() + +-- end + +function WB_Tip:AddTip(TipStr) + self.Text_Tip:SetText(TipStr) + self:PlayAnimation(self.ShowTip, 0, 1, EUMGSequencePlayMode.Forward, 1.0) +end + + + + + +-- [Editor Generated Lua] function define End; + +return WB_Tip; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/Tip/WB_Tip_5.lua b/CounterAttack_Solo/Script/UI/Tip/WB_Tip_5.lua new file mode 100644 index 00000000..59842d22 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/Tip/WB_Tip_5.lua @@ -0,0 +1,33 @@ +---@class WB_Tip_5_C:UUserWidget +---@field ShowTip UWidgetAnimation +---@field Border_Tip2 UBorder +---@field TextBlock_Tip UTextBlock +--Edit Below-- +---@type WB_Tip_2_C +local WB_Tip = { bInitDoOnce = false; }; + +function WB_Tip:Construct() + +end + + +-- function WB_Tip:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_Tip:Destruct() + +-- end + +function WB_Tip:AddTip(TipStr) + self.TextBlock_Tip:SetText(TipStr) + self:PlayAnimation(self.ShowTip, 0, 1, EUMGSequencePlayMode.Forward, 1.0) +end + + + + + +-- [Editor Generated Lua] function define End; + +return WB_Tip; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/Tip/WB_Tip_6.lua b/CounterAttack_Solo/Script/UI/Tip/WB_Tip_6.lua new file mode 100644 index 00000000..1254c22a --- /dev/null +++ b/CounterAttack_Solo/Script/UI/Tip/WB_Tip_6.lua @@ -0,0 +1,33 @@ +---@class WB_Tip_6_C:UUserWidget +---@field ShowTip UWidgetAnimation +---@field Border_SetTopTipsColor UBorder +---@field Text_Tip UTextBlock +--Edit Below-- +---@type WB_Tip_3_C +local WB_Tip = { bInitDoOnce = false; }; + +function WB_Tip:Construct() + +end + + +-- function WB_Tip:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_Tip:Destruct() + +-- end + +function WB_Tip:AddTip(TipStr) + self.Text_Tip:SetText(TipStr) + self:PlayAnimation(self.ShowTip, 0, 1, EUMGSequencePlayMode.Forward, 1.0) +end + + + + + +-- [Editor Generated Lua] function define End; + +return WB_Tip; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/Tip/WB_Tip_Like.lua b/CounterAttack_Solo/Script/UI/Tip/WB_Tip_Like.lua new file mode 100644 index 00000000..31aaffaf --- /dev/null +++ b/CounterAttack_Solo/Script/UI/Tip/WB_Tip_Like.lua @@ -0,0 +1,47 @@ +---@class WB_Tip_Like_C:UUserWidget +---@field ShowTip UWidgetAnimation +---@field Border_SetTopTipsColor UBorder +---@field TextBlock_Num UTextBlock +--Edit Below-- +---@type WB_Tip_3_C +local WB_Tip = { + bInitDoOnce = false; + LikeCount = 0; + LastAddTime = 0; + WaitTime = 10; +}; + +function WB_Tip:Construct() + +end + + +-- function WB_Tip:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_Tip:Destruct() + +-- end + +function WB_Tip:AddTip() + UGCLogSystem.Log("[WB_Tip_AddTip] Like") + local NowTime = UGCSystemLibrary.GetGameTime() + if NowTime - self.LastAddTime <= self.WaitTime then + self.LikeCount = self.LikeCount + 1 + else + self.LikeCount = 1 + end + self.LastAddTime = NowTime + self.TextBlock_Num:SetText("×" .. self.LikeCount) + self:PlayAnimation(self.ShowTip, 0, 1, EUMGSequencePlayMode.Forward, 1.0) + UGCLogSystem.Log("[WB_Tip_AddTip] Like Finish") +end + + + + + +-- [Editor Generated Lua] function define End; + +return WB_Tip; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/Tip/W_TeamTip.lua b/CounterAttack_Solo/Script/UI/Tip/W_TeamTip.lua new file mode 100644 index 00000000..804f7077 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/Tip/W_TeamTip.lua @@ -0,0 +1,30 @@ +---@class W_TeamTip_C:UUserWidget +---@field ShowAnim UWidgetAnimation +---@field WidgetSwitcher_Team UWidgetSwitcher +--Edit Below-- +local W_TeamTip = { bInitDoOnce = false; }; + +--[==[ Construct +function W_TeamTip:Construct() + +end +-- Construct ]==] + +-- function W_TeamTip:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function W_TeamTip:Destruct() + +-- end + +function W_TeamTip:OnShowPanel(IsDefender) + if IsDefender then + self.WidgetSwitcher_Team:SetActiveWidgetIndex(0) + else + self.WidgetSwitcher_Team:SetActiveWidgetIndex(1) + end + self:PlayAnimation(self.ShowAnim, 0, 1, EUMGSequencePlayMode.Forward, 1.0) +end + +return W_TeamTip; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/WB_Countdown.lua b/CounterAttack_Solo/Script/UI/WB_Countdown.lua new file mode 100644 index 00000000..78c2ce86 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/WB_Countdown.lua @@ -0,0 +1,54 @@ +---@class WB_Countdown_C:UUserWidget +---@field TextBlock_ShowText UTextBlock +---@field TextBlock_Time UTextBlock +--Edit Below-- +local WB_Countdown = { bInitDoOnce = false; }; + +--[==[ Construct +function WB_Countdown:Construct() + +end +-- Construct ]==] + +function WB_Countdown:OnShowPanel(InShowTime, InText) + if InShowTime then + self.ShowTime = InShowTime + else + self.ShowTime = 3 + end + if InText then + self.TextBlock_ShowText:SetText(InText) + else + self.TextBlock_ShowText:SetText("准备时间: ") + end + if self.ClockHandle then + UGCEventSystem.StopTimer(self.ClockHandle) + end + self:UpdateShowTime() + self.ClockHandle = UGCEventSystem.SetTimerLoop(self, self.UpdateShowTime, 1) +end + +function WB_Countdown:UpdateShowTime() + self.TextBlock_Time:SetText(tostring(self.ShowTime)) + if self.ShowTime == 0 then + SoundSystem.PlaySound(SoundSystem.ESound.GameStart) + if self.ClockHandle then + UGCEventSystem.StopTimer(self.ClockHandle) + self.ClockHandle = nil + WidgetManager:ClosePanel(WidgetConfig.EUIType.Countdown) + end + elseif self.ShowTime <= 3 then + SoundSystem.PlaySound(SoundSystem.ESound.Clock) + end + self.ShowTime = self.ShowTime - 1 +end + +-- function WB_Countdown:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_Countdown:Destruct() + +-- end + +return WB_Countdown; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/W_DamageAnim.lua b/CounterAttack_Solo/Script/UI/W_DamageAnim.lua new file mode 100644 index 00000000..f58ee3ba --- /dev/null +++ b/CounterAttack_Solo/Script/UI/W_DamageAnim.lua @@ -0,0 +1,34 @@ +---@class W_DamageAnim_C:UUserWidget +---@field KillAnim UWidgetAnimation +---@field DamageAnim UWidgetAnimation +---@field Image_10 UImage +---@field Image_11 UImage +---@field Image_00 UImage +---@field Image_01 UImage +--Edit Below-- +---@type W_DamageAnim_C +local W_DamageAnim = { bInitDoOnce = false; }; + +function W_DamageAnim:Construct() + UGCEventSystem.AddListener(EventEnum.PlayerInjuryInfo, self.OnShowPanel, self) +end + +function W_DamageAnim:OnShowPanel(VictimKey, CauserKey, WeaponID, DamageType, IsHeadShotDamage, Distance, DamageValue) + if IsHeadShotDamage == true then + self:PlayAnimation(self.KillAnim, 0, 1, EUMGSequencePlayMode.Forward, 1) + else + self:PlayAnimation(self.DamageAnim, 0, 1, EUMGSequencePlayMode.Forward, 1) + end +end + + + +-- function W_DamageAnim:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function W_DamageAnim:Destruct() + +-- end + +return W_DamageAnim; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/UI/W_InvincibleTime.lua b/CounterAttack_Solo/Script/UI/W_InvincibleTime.lua new file mode 100644 index 00000000..b40353e0 --- /dev/null +++ b/CounterAttack_Solo/Script/UI/W_InvincibleTime.lua @@ -0,0 +1,32 @@ +---@class W_InvincibleTime_C:UUserWidget +---@field TextBlock_Time UTextBlock +--Edit Below-- +---@type W_InvincibleTime_C +local W_InvincibleTime = { + bInitDoOnce = false; + SpawnTime = 0.; +}; + +function W_InvincibleTime:Construct() + WidgetLibrary.TextBlockBindingPropertyText(self.TextBlock_Time, self.TextBlock_Time_Txt, self) + self.SpawnTime = UGCSystemLibrary.GetGameTime() +end + +function W_InvincibleTime:OnShowPanel() + self.SpawnTime = UGCSystemLibrary.GetGameTime() + UGCLogSystem.Log("[W_InvincibleTime_OnShowPanel] PlayerKey:%d, SpawnTime: %f", UGCSystemLibrary.GetLocalPlayerKey(), self.SpawnTime) + self:SetVisibility(ESlateVisibility.SelfHitTestInvisible) + UGCEventSystem.SetTimer(self, function () self:SetVisibility(ESlateVisibility.Collapsed) end, GlobalConfigs.GameSetting.InvincibleTime) +end + +function W_InvincibleTime:TextBlock_Time_Txt(ReturnValue) + local NowTime = UGCSystemLibrary.GetGameTime() + if (NowTime - self.SpawnTime) < GlobalConfigs.GameSetting.InvincibleTime then + return string.format("%0.2f", + math.clamp((GlobalConfigs.GameSetting.InvincibleTime - (NowTime - self.SpawnTime)), 0., GlobalConfigs.GameSetting.InvincibleTime) + ) + end + return "" +end + +return W_InvincibleTime; \ No newline at end of file diff --git a/CounterAttack_Solo/Script/gamemode/Action_DefaultEventNotify.lua b/CounterAttack_Solo/Script/gamemode/Action_DefaultEventNotify.lua new file mode 100644 index 00000000..d4e9da8a --- /dev/null +++ b/CounterAttack_Solo/Script/gamemode/Action_DefaultEventNotify.lua @@ -0,0 +1,27 @@ +local Action_DefaultEventNotify = { + EventName = "", +} + +-- 触发器激活时,将执行Action的Execute +function Action_DefaultEventNotify:Execute(...) + local TargetEvent = EventConfig.GameModeEditEventMap[self.EventName] + if TargetEvent then + if self.EventName == "DSStartUp" then + if GlobalConfigs.DsDoOnce then + GlobalConfigs.DsDoOnce = false + UGCEventSystem.SendEvent(TargetEvent, ...) + UGCLogSystem.Log("[Action_DefaultEventNotify_Execute] DSStartUp Exe") + end + else + UGCEventSystem.SendEvent(TargetEvent, ...) + end + UGCLogSystem.LogTree("[Action_DefaultEventNotify_Execute] EventName:" .. self.EventName, table.pack(...)) + else + UGCLogSystem.LogError("[Action_DefaultEventNotify_Execute] DefaultEventParam[%s] is nil", tostring(self.EventName)) + end + return true +end + + + +return Action_DefaultEventNotify \ No newline at end of file diff --git a/CounterAttack_Solo/Script/gamemode/Action_PlayerLeave.lua b/CounterAttack_Solo/Script/gamemode/Action_PlayerLeave.lua new file mode 100644 index 00000000..f8bc8180 --- /dev/null +++ b/CounterAttack_Solo/Script/gamemode/Action_PlayerLeave.lua @@ -0,0 +1,23 @@ +local Action_PlayerLeave = { + -- 可配置参数定义,参数将显示在Action配置面板 + -- 例: + -- MyIntParameter = 0 + PlayerKey = 0; +} + +-- 触发器激活时,将执行Action的Execute +function Action_PlayerLeave:Execute(...) + ugcprint(string.format("[Action_PlayerLeave] Start settlement %d", self.PlayerKey)); + UGCGameSystem.SendPlayerSettlement(self.PlayerKey); + return true +end + +--[[ +-- 需要勾选Action的EnableTick,才会执行Update +-- 触发器激活后,将在每个tick执行Action的Update,直到self.bEnableActionTick为false +function Action_PlayerLeave:Update(DeltaSeconds) + +end +]] + +return Action_PlayerLeave \ No newline at end of file diff --git a/CounterAttack_Solo/Script/gamemode/Action_SendEvent.lua b/CounterAttack_Solo/Script/gamemode/Action_SendEvent.lua new file mode 100644 index 00000000..aaff8780 --- /dev/null +++ b/CounterAttack_Solo/Script/gamemode/Action_SendEvent.lua @@ -0,0 +1,16 @@ +local Action_SendEvent = +{ + SendEventName = ""; +} + + +function Action_SendEvent:Execute() + print(string.format("Action_SendEvent:Execute SendEventName[%s]", self.SendEventName)); + + LuaQuickFireEvent(self.SendEventName, self); + + return true; +end + + +return Action_SendEvent \ No newline at end of file diff --git a/CounterAttack_Solo/Script/gamemode/readme.txt b/CounterAttack_Solo/Script/gamemode/readme.txt new file mode 100644 index 00000000..e69de29b diff --git a/CounterAttack_Solo/Script/luahelper.json b/CounterAttack_Solo/Script/luahelper.json new file mode 100644 index 00000000..33b4d055 --- /dev/null +++ b/CounterAttack_Solo/Script/luahelper.json @@ -0,0 +1,90 @@ +{ + "BaseDir":"./", + "ShowWarnFlag": 1, + "ShareSymbolsFlag": 1, + "ReferMatchPathFlag": 0, + "GvalTipFlag": 1, + "IgnoreFileNameVarFlag": 1, + "ProjectFiles":[ + ], + "IgnoreModules":["hive", "import", + "TssManager", "GameFrontendHUD", "Vector", "Rotator", "bp_lobby", "Vector2D", "bp_global", "bp_authorization", "LobbyENV", + "InGameWidgetManager", "DSHUD", "Puffer", "BP_Platform", "LobbyG", "BP_MAP_ClubLogo", "BP_ARRAY_ClubLogo", "Instance", + "LinearColor", "LuaDebugHelper", "ScriptHelperServer", "ScriptHelperServer_WorldParallelism", "VSCodeLuaDebug", + "UE", "UAEUserWidget", "LogE", "Tss", "ObjectExtend" ,"UE_BUILD_SHIPPING","ImageManipulator","ImageDownloaderV2","ImageDownloaderV3","ImageEx","SlateBrush", + "DateTime","Timespan","KeepGameLiveInterface","Dolphin","BP_STRUCT_TeamUpFriendInfo","ComplaintFeedbackSummaryNotice","EncryptPakTest","DoReloadLua","LuaMemoryUI","BP_ARRAY_DynamicLevels","BP_ARRAY_lbsranktypetable", + "pakwhitelist","ConfigDownloader","extrapaklistneedmount","BP_ARRAY_Paradise","VideoConfigDownloader","TextBlock" + ], + "IgnoreFileVars": [ + { + "File": "client_entry.lua", + "Vars": ["UE_BUILD_SHIPPING", "Tss"] + } + , + { + "File": "util.lua", + "Vars": ["newestpakslist"] + } + ], + "IgnoreReadFiles": [ + + ], + "IgnoreErrorTypes": [ + 4,6,18 + ], + "IgnoreFileOrFloder": [ + "lobby/on.*lua", + "tests/", + "robot/", + "coverage/" + ], + "IgnoreFileErr": [ + "lobby/gm1.lua", + "common/test.lua", + "Replay/Test.lua", + "test/luaunit.lua", + "improved_ingameui", + "ingame", + "Server", + "vsCodeDebugger", + "delete_lua" + ], + "IgnoreFileErrTypes": [ + { + "File": "gc_control.lua", + "Types": [3] + }, + { + "File": "sandbox.lua", + "Types": [3] + } + ], + "ProtocolVars": [ + + + ], + "AnntotateSets": [ + { + "FuncName": "GetUIObject", + "ParamIndex": 2, + "SplitFlag": 0, + "PrefixStr": "", + "SuffixStr": "" + }, + { + "FuncName": "KismetLibrary.New", + "ParamIndex": 1, + "SplitFlag": 1, + "PrefixStr": "", + "PrefixStrList": ["U", "A", ""], + "SuffixStr": "" + }, + { + "FuncName": "CreateUIWidget", + "ParamIndex": 2, + "SplitFlag": 1, + "PrefixStr": "", + "SuffixStr": "" + } + ] +} \ No newline at end of file diff --git a/CounterAttack_Solo/WhiteList.ini b/CounterAttack_Solo/WhiteList.ini new file mode 100644 index 00000000..afb4fb76 --- /dev/null +++ b/CounterAttack_Solo/WhiteList.ini @@ -0,0 +1,9 @@ +[WhiteList] +WhiteListUsrIdNum=5 +WhiteListUsrId0=410331901 +WhiteListUsrId1=410364737 +WhiteListUsrId2=410376525 +WhiteListUsrId3=410382140 +WhiteListUsrId4=410423307 + + diff --git a/CounterAttack_Solo/workspace.code-workspace b/CounterAttack_Solo/workspace.code-workspace new file mode 100644 index 00000000..2c70c2f4 --- /dev/null +++ b/CounterAttack_Solo/workspace.code-workspace @@ -0,0 +1,11 @@ +{ + "folders": [ + { + "path": "Script" + }, + { + "path": "..\\..\\Content\\LuaHelper" + } + ], + "settings": {} +} \ No newline at end of file diff --git a/SoloKing/Asset/UI/SelectWeapons/SaveCustomWeaponItem/WB_SaveOtherWeaponItem.uasset b/SoloKing/Asset/UI/SelectWeapons/SaveCustomWeaponItem/WB_SaveOtherWeaponItem.uasset new file mode 100644 index 00000000..e6aa2578 Binary files /dev/null and b/SoloKing/Asset/UI/SelectWeapons/SaveCustomWeaponItem/WB_SaveOtherWeaponItem.uasset differ diff --git a/SoloKing/Asset/UI/SelectWeapons/SaveCustomWeaponItem/WB_SaveWeaponItem.uasset b/SoloKing/Asset/UI/SelectWeapons/SaveCustomWeaponItem/WB_SaveWeaponItem.uasset index 601429ef..d05784a3 100644 Binary files a/SoloKing/Asset/UI/SelectWeapons/SaveCustomWeaponItem/WB_SaveWeaponItem.uasset and b/SoloKing/Asset/UI/SelectWeapons/SaveCustomWeaponItem/WB_SaveWeaponItem.uasset differ diff --git a/SoloKing/Asset/UI/SelectWeapons/WB_CustomWeapon_New.uasset b/SoloKing/Asset/UI/SelectWeapons/WB_CustomWeapon_New.uasset index e86cf055..6e4237ba 100644 Binary files a/SoloKing/Asset/UI/SelectWeapons/WB_CustomWeapon_New.uasset and b/SoloKing/Asset/UI/SelectWeapons/WB_CustomWeapon_New.uasset differ diff --git a/SoloKing/Script/Global/Config/WeaponSelectionCombinationConfig.lua b/SoloKing/Script/Global/Config/WeaponSelectionCombinationConfig.lua index f07f56ed..f86403f0 100644 --- a/SoloKing/Script/Global/Config/WeaponSelectionCombinationConfig.lua +++ b/SoloKing/Script/Global/Config/WeaponSelectionCombinationConfig.lua @@ -5,7 +5,13 @@ WeaponSelectionCombinationConfig.ECombinationType = { } WeaponSelectionCombinationConfig.WeaponCombinationList = { - Weapon = {{102003, 102003}, {101004, 101004}, {107008, 102003}, {104005, 103007}, {102003, 103012}}, + Weapon = { + {102003, 102003, 106011, 108004}, + {101004, 101004, 106011, 108004}, + {107008, 102003, 106011, 108004}, + {104005, 103007, 106011, 108004}, + {102003, 103012, 106011, 108004}, + }, OtherParts = { -- 背包 {ItemID = 501003, Count = 1}, @@ -49,12 +55,16 @@ WeaponSelectionCombinationConfig.PlayerCustomWeapon = { WeaponIDs = { 104001, 104002, 104003, 104004, 104005, 104100, }; }, - { - TypeName = "手枪"; - WeaponIDs = { 106001, 106002, 106003, 106004, 106005, 106006, 106008, 106010, 106011, }; - }, { TypeName = "其他"; - WeaponIDs = { 107001, 107006, 107008, 108001, 108002, 108003, 108004, 107002, }; + WeaponIDs = { 107001, 107002, 107006, 107008, }; }, } + +WeaponSelectionCombinationConfig.PlayerCustomSubWeapon = { + 106001, 106002, 106003, 106004, 106005, 106006, 106008, 106010, 106011, +} + +WeaponSelectionCombinationConfig.PlayerCustomMeleeWeapon = { + 108001, 108002, 108003, 108004, +} \ No newline at end of file diff --git a/SoloKing/Script/Global/WidgetManager/WidgetConfig.lua b/SoloKing/Script/Global/WidgetManager/WidgetConfig.lua index 0e47782a..07d398a2 100644 --- a/SoloKing/Script/Global/WidgetManager/WidgetConfig.lua +++ b/SoloKing/Script/Global/WidgetManager/WidgetConfig.lua @@ -201,7 +201,7 @@ if not UE_SERVER then Layer = WidgetConfig.EUILayerGroup.Medium, }, [WidgetConfig.EUIType.SelectWeaponNew] = { - Path = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/SelectWeapons/WB_CustomWeapon_New.WB_CustomWeapon_New_C'), + Path = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/SelectWeapons/WB_WeaponSelect_New.WB_WeaponSelect_New_C'), -- 是否仅显示一次 bShowOnce = false, Layer = WidgetConfig.EUILayerGroup.MainUI, diff --git a/SoloKing/Script/UI/SelectWeapons/SaveCustomWeaponItem/WB_SaveOtherWeaponItem.lua b/SoloKing/Script/UI/SelectWeapons/SaveCustomWeaponItem/WB_SaveOtherWeaponItem.lua new file mode 100644 index 00000000..9b75d492 --- /dev/null +++ b/SoloKing/Script/UI/SelectWeapons/SaveCustomWeaponItem/WB_SaveOtherWeaponItem.lua @@ -0,0 +1,205 @@ +---@class WB_SaveOtherWeaponItem_C:UUserWidget +---@field CanvasPanel_SelectPartsPanel UCanvasPanel +---@field CanvasPanel_WeaponInfo UCanvasPanel +---@field HorizontalBox_Part UHorizontalBox +---@field Image_IsSelect UImage +---@field Image_WeaponIcon UImage +---@field NewButton_Select UNewButton +---@field ScrollBox_SelectParts UScrollBox +---@field TextBlock_WeaponName UTextBlock +--Edit Below-- +local WB_SaveOtherWeaponItem = { + bInitDoOnce = false; + PartTypeToPartItem = {}; + IsSelected = false; +}; + +--[==[ Construct +function WB_SaveOtherWeaponItem:Construct() + +end +-- Construct ]==] + +-- function WB_SaveOtherWeaponItem:Tick(MyGeometry, InDeltaTime) + +-- end + +-- function WB_SaveOtherWeaponItem:Destruct() + +-- end + +function WB_SaveOtherWeaponItem:LuaInit() + if self.bInitDoOnce then + return; + end + self.bInitDoOnce = true; + WidgetLibrary.BindButtonClicked(self.NewButton_Select, self.ClickSelect, self) + + -- 设置配件类型 + for i = 1, self.HorizontalBox_Part:GetChildrenCount() do + local Item = self.HorizontalBox_Part:GetChildAt(i - 1) + Item:LuaInit() + Item:SetPartType(PartTypeDisplayOrder[i]) + Item:BindSelectCallBack(self.ClickPart, self) + if PartTypeDisplayOrder[i] then + self.PartTypeToPartItem[PartTypeDisplayOrder[i]] = Item + end + end + for i = 1, self.ScrollBox_SelectParts:GetChildrenCount() do + local Item = self.ScrollBox_SelectParts:GetChildAt(i - 1) + Item:LuaInit() + Item:SetSelectStyle(1) + Item:BindSelectCallBack(self.ClickSelectPart, self) + end +end + +function WB_SaveOtherWeaponItem:SetIndex(InIndex) + self.Index = InIndex + self:LuaInit() +end + +function WB_SaveOtherWeaponItem:GetIndex() + return self.Index +end + +function WB_SaveOtherWeaponItem:BindClickSelect(Func, Obj) + self.SelectCallBackFunc = Func + self.SelectCallBackObj = Obj +end + +function WB_SaveOtherWeaponItem:ClickSelect() + -- UGCLogSystem.Log("[WB_BuffSelectItem_ClickSelect]") + if self.SelectCallBackFunc then + if self.SelectCallBackObj then + self.SelectCallBackFunc(self.SelectCallBackObj, self:GetIndex()) + else + self.SelectCallBackFunc(self:GetIndex()) + end + end +end + +function WB_SaveOtherWeaponItem:SetSelect(IsSelect) + if self.IsSelected ~= IsSelect then + self.IsSelected = IsSelect + if IsSelect then + self.Image_IsSelect:SetVisibility(ESlateVisibility.SelfHitTestInvisible); + --self.CanvasPanel_SelectPartsPanel:SetVisibility(ESlateVisibility.SelfHitTestInvisible); + else + self.Image_IsSelect:SetVisibility(ESlateVisibility.Collapsed); + --self.CanvasPanel_SelectPartsPanel:SetVisibility(ESlateVisibility.Collapsed); + -- self:SetSelectPartType(nil) + end + end +end + +function WB_SaveOtherWeaponItem:GetWeaponID() + return self.WeaponID +end + +function WB_SaveOtherWeaponItem:SetWeaponID(WeaponID) + if self.WeaponID ~= WeaponID then + self.WeaponID = WeaponID + local WeaponParts = MyWeaponSystem.GetWeaponBastParts(self.WeaponID) + -- 在这里修改 获取存档中的武器配件存档 CustomWeaponParts = {[WeaponID] = {PartID, PartID, PartID, ...}, ...} + -- local CustomWeaponParts = ArchiveDataConfig.GetPlayerArchiveDataFromType(UGCSystemLibrary.GetLocalPlayerKey(), ArchiveDataConfig.EArchiveType.CustomWeaponParts) + local CustomWeaponParts = nil + + if CustomWeaponParts and CustomWeaponParts[self.WeaponID] then + WeaponParts = CustomWeaponParts[self.WeaponID] + end + local WeaponPartsMap = MyWeaponSystem.PartListToPartMap(WeaponParts) + local UpdateSelectPartsOnce = false + for i = 1, self.HorizontalBox_Part:GetChildrenCount() do + local Item = self.HorizontalBox_Part:GetChildAt(i - 1) + local PartType = Item:GetPartType() + local ItemID = WeaponPartsMap[PartType] + Item:SetItemID(ItemID) + -- 设置当前默认选择的Part + if ItemID and not UpdateSelectPartsOnce then + UpdateSelectPartsOnce = true + self:SetSelectPartType(PartType) + end + end + if not UpdateSelectPartsOnce then + self:SetSelectPartType(nil) + end + + MyWeaponSystem.AsyncLoadItemSmallIconToBrush(self.WeaponID, self.Image_WeaponIcon) + self.TextBlock_WeaponName:SetText(MyWeaponSystem.GetItemName(self.WeaponID)) + end +end + +function WB_SaveOtherWeaponItem:SetVisWeaponInfo(IsVis) + if IsVis then + self.CanvasPanel_WeaponInfo:SetVisibility(ESlateVisibility.HitTestInvisible) + else + self.CanvasPanel_WeaponInfo:SetVisibility(ESlateVisibility.Hidden) + end +end + +function WB_SaveOtherWeaponItem:ClickPart(PartID) + if self.IsSelected then + local PartType = MyWeaponSystem.GetPartType(PartID) + self:SetSelectPartType(PartType) + else + self:ClickSelect() + end +end + +--- 设置选择修改的类型 +function WB_SaveOtherWeaponItem:SetSelectPartType(InPartType) + UGCLogSystem.Log("[WB_SaveOtherWeaponItem_SetSelectPartType] InPartType:%s", tostring(InPartType)) + self.SelectPartType = InPartType + local ItemID = -1 + if self.PartTypeToPartItem[InPartType] then + ItemID = self.PartTypeToPartItem[InPartType]:GetItemID() + end + local Parts = MyWeaponSystem.GetWeaponCanUsePartFromPartType(self.WeaponID, InPartType) + for i = 1, self.ScrollBox_SelectParts:GetChildrenCount() do + local Item = self.ScrollBox_SelectParts:GetChildAt(i - 1) + Item:SetItemID(Parts[i]) + Item:SetIsSelect(ItemID == Parts[i]) + end + for i = 1, self.HorizontalBox_Part:GetChildrenCount() do + local Item = self.HorizontalBox_Part:GetChildAt(i - 1) + Item:SetIsSelect(InPartType == Item:GetPartType()) + end +end + +--- 修改显示的配件 +function WB_SaveOtherWeaponItem:ClickSelectPart(PartID) + UGCLogSystem.Log("[WB_SaveOtherWeaponItem_ClickSelectPart] PartID:%s", tostring(PartID)) + local PartType = MyWeaponSystem.GetPartType(PartID) + local PartItem = self.PartTypeToPartItem[PartType] + if PartItem then + PartItem:SetItemID(PartID) + -- 设置已选择 + for i = 1, self.ScrollBox_SelectParts:GetChildrenCount() do + local Item = self.ScrollBox_SelectParts:GetChildAt(i - 1) + Item:SetIsSelect(PartID == Item:GetItemID()) + end + end +end + +--- 获取当前修改后的配件信息 +function WB_SaveOtherWeaponItem:GetAllParts() + local Res = {} + for i = 1, self.HorizontalBox_Part:GetChildrenCount() do + local Item = self.HorizontalBox_Part:GetChildAt(i - 1) + local ItemID = Item:GetItemID() + if ItemID and MyWeaponSystem.IsWeaponPartValid(ItemID) then + Res[#Res + 1] = ItemID + end + end + return Res +end + +function WB_SaveOtherWeaponItem:SetWeaponSocketType(InSocketType) + self.WeaponSocketType = InSocketType +end + +function WB_SaveOtherWeaponItem:GetWeaponSocketType() + return self.WeaponSocketType +end + +return WB_SaveOtherWeaponItem; \ No newline at end of file diff --git a/SoloKing/Script/UI/SelectWeapons/SaveCustomWeaponItem/WB_SaveWeaponItem.lua b/SoloKing/Script/UI/SelectWeapons/SaveCustomWeaponItem/WB_SaveWeaponItem.lua index 41061c42..5d241171 100644 --- a/SoloKing/Script/UI/SelectWeapons/SaveCustomWeaponItem/WB_SaveWeaponItem.lua +++ b/SoloKing/Script/UI/SelectWeapons/SaveCustomWeaponItem/WB_SaveWeaponItem.lua @@ -194,4 +194,12 @@ function WB_SaveWeaponItem:GetAllParts() return Res end +function WB_SaveWeaponItem:SetWeaponSocketType(InSocketType) + self.WeaponSocketType = InSocketType +end + +function WB_SaveWeaponItem:GetWeaponSocketType() + return self.WeaponSocketType +end + return WB_SaveWeaponItem; \ No newline at end of file diff --git a/SoloKing/Script/UI/SelectWeapons/WB_CustomWeapon_New.lua b/SoloKing/Script/UI/SelectWeapons/WB_CustomWeapon_New.lua index 2fa90bb7..e3607e38 100644 --- a/SoloKing/Script/UI/SelectWeapons/WB_CustomWeapon_New.lua +++ b/SoloKing/Script/UI/SelectWeapons/WB_CustomWeapon_New.lua @@ -1,11 +1,16 @@ ---@class WB_CustomWeapon_New_C:UUserWidget ----@field Button_SelectParts UButton ---@field HorizontalBox_WeaponType UHorizontalBox ---@field NewButton_Close UNewButton ----@field NewButton_Reset UNewButton ---@field NewButton_Save UNewButton +---@field NewButton_SelectParts UNewButton +---@field SaveMeleeWeaponItem UWB_SaveOtherWeaponItem_C +---@field SaveSubWeaponItem UWB_SaveOtherWeaponItem_C +---@field SaveWeaponItem1 UWB_SaveWeaponItem_C +---@field SaveWeaponItem2 UWB_SaveWeaponItem_C ---@field UniformGridPanel_SelectWeapon UUniformGridPanel +---@field VerticalBox_OtherWeapons UVerticalBox ---@field VerticalBox_WeaponSocket UVerticalBox +---@field WidgetSwitcher_WeaponSocket_Type UWidgetSwitcher --Edit Below-- local WB_CustomWeapon_New = { bInitDoOnce = false; @@ -13,6 +18,7 @@ local WB_CustomWeapon_New = { SelectSaveWeaponItemCol = 4; WeaponSocketItems = {}; IsChange = false; + SelectWeaponSocketID = 1; } function WB_CustomWeapon_New:Construct() @@ -28,10 +34,10 @@ function WB_CustomWeapon_New:LuaInit() UGCLogSystem.Log("[WB_CustomWeapon_LuaInit]") -- 按键初始化 - WidgetLibrary.BindButtonClicked(self.NewButton_Reset, self.ResetWeaponComb, self) + --WidgetLibrary.BindButtonClicked(self.NewButton_Reset, self.ResetWeaponComb, self) WidgetLibrary.BindButtonClicked(self.NewButton_Save, self.SaveWeaponComb, self) WidgetLibrary.BindButtonClicked(self.NewButton_Close, self.ClickClose, self) - UITool.BindButtonClicked(self.Button_SelectParts, self.OnClickSetParts, self) + WidgetLibrary.BindButtonClicked(self.NewButton_SelectParts, self.OnClickSetParts, self) -- 初始化Item self:InitItem() @@ -82,12 +88,20 @@ function WB_CustomWeapon_New:InitItem() end -- 初始化武器槽UI - for i = 1, self.VerticalBox_WeaponSocket:GetChildrenCount() do - local Item = self.VerticalBox_WeaponSocket:GetChildAt(i - 1) - self.WeaponSocketItems[i] = Item + + self.WeaponSocketItems = { + self.SaveWeaponItem1, + self.SaveWeaponItem2, + self.SaveSubWeaponItem, + self.SaveMeleeWeaponItem, + } + for i, Item in pairs(self.WeaponSocketItems) do Item:SetIndex(i) Item:BindClickSelect(self.SelectWeaponSocket, self) end + + MaxSelectItemCount = math.max(MaxSelectItemCount, #WeaponSelectionCombinationConfig.PlayerCustomMeleeWeapon, #WeaponSelectionCombinationConfig.PlayerCustomMeleeWeapon) + -- 初始化武器选择Item for i = 1, MaxSelectItemCount do local Item = nil; @@ -157,31 +171,47 @@ function WB_CustomWeapon_New:SelectWeaponSocket(Index) end --- 点击选择武器类型 function WB_CustomWeapon_New:SelectWeaponType(Index) + UGCLogSystem.Log("[WB_CustomWeapon_New_SelectWeaponType] Index:%s", tostring(Index)) if self.WeaponTypeIndex ~= Index then - self.WeaponTypeIndex = Index - for i = 1, self.HorizontalBox_WeaponType:GetChildrenCount() do - local WeaponTypeItem = self.HorizontalBox_WeaponType:GetChildAt(i - 1) - WeaponTypeItem:SetSelect(i == self.WeaponTypeIndex) + local CustomWeaponIDs = {} + -- 判断武器插槽分类 + if self.SelectWeaponSocketID <= 2 then + -- 两个主武器 + self.WeaponTypeIndex = Index + for i = 1, self.HorizontalBox_WeaponType:GetChildrenCount() do + local WeaponTypeItem = self.HorizontalBox_WeaponType:GetChildAt(i - 1) + WeaponTypeItem:SetSelect(i == self.WeaponTypeIndex) + end + local CustomWeaponInfo = WeaponSelectionCombinationConfig.PlayerCustomWeapon[self.WeaponTypeIndex] + if CustomWeaponInfo then + CustomWeaponIDs = CustomWeaponInfo.WeaponIDs + end + elseif self.SelectWeaponSocketID == 3 then + -- 副武器 + CustomWeaponIDs = WeaponSelectionCombinationConfig.PlayerCustomSubWeapon + else + -- 近战武器 + CustomWeaponIDs = WeaponSelectionCombinationConfig.PlayerCustomMeleeWeapon end - local CustomWeaponInfo = WeaponSelectionCombinationConfig.PlayerCustomWeapon[self.WeaponTypeIndex] local SocketWeaponID = -1 - local WeaponSocketItem = self.WeaponSocketItems[self.SelectWeaponSocketID] - if WeaponSocketItem then - SocketWeaponID = WeaponSocketItem:GetWeaponID() - end - if CustomWeaponInfo then - for i = 1, self.UniformGridPanel_SelectWeapon:GetChildrenCount() do - local WeaponID = CustomWeaponInfo.WeaponIDs[i] - local WeaponItem = self.UniformGridPanel_SelectWeapon:GetChildAt(i - 1) - if WeaponID then - WeaponItem:SetWeaponID(WeaponID) - WeaponItem:SetSelect(SocketWeaponID == WeaponID) - WeaponItem:SetVisibility(ESlateVisibility.SelfHitTestInvisible) - else - WeaponItem:SetVisibility(ESlateVisibility.Collapsed) + local WeaponSocketItem = self.WeaponSocketItems[self.SelectWeaponSocketID] + if WeaponSocketItem then + SocketWeaponID = WeaponSocketItem:GetWeaponID() + end + if CustomWeaponIDs then + for i = 1, self.UniformGridPanel_SelectWeapon:GetChildrenCount() do + local WeaponID = CustomWeaponIDs[i] + local WeaponItem = self.UniformGridPanel_SelectWeapon:GetChildAt(i - 1) + if WeaponID then + WeaponItem:SetWeaponID(WeaponID) + WeaponItem:SetSelect(SocketWeaponID == WeaponID) + WeaponItem:SetVisibility(ESlateVisibility.SelfHitTestInvisible) + else + WeaponItem:SetVisibility(ESlateVisibility.Collapsed) + end end end - end + end end --- 点击选择武器 @@ -190,6 +220,7 @@ function WB_CustomWeapon_New:ClickSelectSaveWeapon(Index) self:SelectSaveWeapon(Index) end function WB_CustomWeapon_New:SelectSaveWeapon(Index) + UGCLogSystem.Log("[WB_CustomWeapon_New_SelectSaveWeapon] Index:%s", tostring(Index)) local WeaponItem = self.UniformGridPanel_SelectWeapon:GetChildAt(Index - 1) local WeaponID = WeaponItem:GetWeaponID() for i = 1, self.UniformGridPanel_SelectWeapon:GetChildrenCount() do @@ -203,35 +234,67 @@ end ---@param SocketID uint 插槽的索引 只有1和2 ---@param bUpdateSelectWeaponBar bool 是否更新武器选择栏 function WB_CustomWeapon_New:SetSelectWeapon(SocketID, WeaponID, bUpdateSelectWeaponBar) + UGCLogSystem.Log("[WB_CustomWeapon_New_SetSelectWeapon] SocketID:%s, WeaponID:%s, bUpdateSelectWeaponBar:%s", tostring(SocketID), tostring(WeaponID), tostring(bUpdateSelectWeaponBar)) if bUpdateSelectWeaponBar then self.SelectWeaponSocketID = SocketID for i, v in pairs(self.WeaponSocketItems) do v:SetSelect(i == SocketID) end - -- 获取武器ID类型和索引 local CustomWeaponTypeIndex = -1 local CustomWeaponIndex = -1; - for WeaponTypeIndex, v in pairs(WeaponSelectionCombinationConfig.PlayerCustomWeapon) do - -- 加载图片 - for WeaponIndex, TempWeaponID in pairs(v.WeaponIDs) do - if TempWeaponID == WeaponID then - CustomWeaponIndex = WeaponIndex - CustomWeaponTypeIndex = WeaponTypeIndex + if self.SelectWeaponSocketID <= 2 then + -- 获取武器ID类型和索引 + + for WeaponTypeIndex, v in pairs(WeaponSelectionCombinationConfig.PlayerCustomWeapon) do + for WeaponIndex, TempWeaponID in pairs(v.WeaponIDs) do + if TempWeaponID == WeaponID then + CustomWeaponIndex = WeaponIndex + CustomWeaponTypeIndex = WeaponTypeIndex + end + end + if CustomWeaponTypeIndex > 0 then + break end end - if CustomWeaponTypeIndex > 0 then - break + + + elseif self.SelectWeaponSocketID == 3 then + -- 设置插槽页签 + self.WidgetSwitcher_WeaponSocket_Type:SetActiveWidgetIndex(1) + CustomWeaponTypeIndex = -1 + for WeaponIndex, TempWeaponID in pairs(WeaponSelectionCombinationConfig.PlayerCustomSubWeapon) do + if TempWeaponID == WeaponID then + CustomWeaponIndex = WeaponIndex + end + end + else + -- 设置插槽页签 + self.WidgetSwitcher_WeaponSocket_Type:SetActiveWidgetIndex(2) + CustomWeaponTypeIndex = -2 + for WeaponIndex, TempWeaponID in pairs(WeaponSelectionCombinationConfig.PlayerCustomMeleeWeapon) do + if TempWeaponID == WeaponID then + CustomWeaponIndex = WeaponIndex + end end end -- 更新选择栏 self:SelectWeaponType(CustomWeaponTypeIndex) self:SelectSaveWeapon(CustomWeaponIndex) + else local SocketItem = self.WeaponSocketItems[SocketID] if SocketItem then SocketItem:SetWeaponID(WeaponID) end end + -- 设置插槽页签 + if self.SelectWeaponSocketID <= 2 then + self.WidgetSwitcher_WeaponSocket_Type:SetActiveWidgetIndex(0) + elseif self.SelectWeaponSocketID == 3 then + self.WidgetSwitcher_WeaponSocket_Type:SetActiveWidgetIndex(1) + else + self.WidgetSwitcher_WeaponSocket_Type:SetActiveWidgetIndex(2) + end end --- 重置武器配置 diff --git a/SoloKing/Script/UI/WB_Main.lua b/SoloKing/Script/UI/WB_Main.lua index 516c2cec..98e55ee8 100644 --- a/SoloKing/Script/UI/WB_Main.lua +++ b/SoloKing/Script/UI/WB_Main.lua @@ -75,9 +75,9 @@ function WB_Main:LuaInit() self.WB_PID:LuaInit(); self.WB_Title1_2:LuaInit(); self.WB_Title2_2:LuaInit(); - self.WB_SelectParts:LuaInit(); + --self.WB_SelectParts:LuaInit(); self.WB_ReselectWeaponBtn:LuaInit(); - self.WB_SelectParts:SetType({ EWeaponPartType.Telescope, EWeaponPartType.Grip, EWeaponPartType.Muzzle, }); + --self.WB_SelectParts:SetType({ EWeaponPartType.Telescope, EWeaponPartType.Grip, EWeaponPartType.Muzzle, }); self:ShowCustomSelectWeaponBtn(false); @@ -89,7 +89,7 @@ function WB_Main:LuaInit() -- 观战玩家 if LocalIsGlobalSpectator then self.WB_DamageTextButton:SetVisibility(ESlateVisibility.Collapsed); - self.WB_SelectParts:SetVisibility(ESlateVisibility.Collapsed); + --self.WB_SelectParts:SetVisibility(ESlateVisibility.Collapsed); self.WidgetSwitcher_Title:SetActiveWidgetIndex(1); else self.WidgetSwitcher_Title:SetActiveWidgetIndex(0);