diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..affe967 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,8 @@ +{ + "chat.tools.terminal.autoApprove": { + "/^\\.\\\\gradlew\\.bat build --no-daemon 2>&1 \\| Select-Object -Last 40$/": { + "approve": true, + "matchCommandLine": true + } + } +} \ No newline at end of file diff --git a/COMMANDS_GUIDE.md b/COMMANDS_GUIDE.md index c857b8a..b1e35de 100644 --- a/COMMANDS_GUIDE.md +++ b/COMMANDS_GUIDE.md @@ -337,22 +337,6 @@ ENDGAME (2 минуты) --- -### /dbdsetup save \<название\> - -Сохранить блоки между pos1 и pos2 как шаблон карты. - -``` -/dbdsetup save main_map -``` - -**Tab complete для load/save:** показывает существующие шаблоны. - -``` -→ Шаблон 'main_map' сохранен! -``` - ---- - ### /dbdsetup load \<название\> Загрузить шаблон на текущую позицию игрока. @@ -511,7 +495,6 @@ ENDGAME (2 минуты) | `/dbdadmin world ` | admin | Телепорт в мир | | `/dbdsetup wand` | admin | Палочка выделения | | `/dbdsetup pos1` / `pos2` | admin | Точки выделения | -| `/dbdsetup save ` | admin | Сохранить шаблон карты | | `/dbdsetup load ` | admin | Загрузить шаблон | | `/dbdsetup list` | admin | Список шаблонов | | `/dbdsetup set <тип>` | admin | Сохранить позицию объекта | diff --git a/bin/main/config.yml b/bin/main/config.yml new file mode 100644 index 0000000..ec91e1e --- /dev/null +++ b/bin/main/config.yml @@ -0,0 +1,49 @@ +# ============================================ +# Mdbd Plugin - Главный конфиг +# Версия: ${version} +# ============================================ + +# Основные настройки плагина +settings: + # Язык сообщений (пока только встроенный) + language: "ru" + + # Отладочный режим + debug: false + + # Автосохранение каждые X минут + auto-save-minutes: 5 + +# Настройки игры +game: + # Минимум игроков для старта + min-players: 5 + + # Максимум игроков + max-players: 5 + + # Обратный отсчёт в лобби (секунды) + lobby-countdown: 60 + + # Задержка перед назначением ролей (секунды) + role-assign-delay: 5 + +# Визуальные настройки +display: + # Использовать титры при старте игры + use-title-on-start: true + + # Показывать ActionBar с прогрессом + use-action-bar: true + + # Показывать Scoreboard (боковую панель) + use-sidebar: true + + # Формат прогресс-бара + progress-bar: + length: 20 + filled: "█" + empty: "░" + # Цвета в формате &#rrggbb + color-filled: "�FF00" + color-empty: "&#FF0000" diff --git a/bin/main/dev/loki/chest/Chest.class b/bin/main/dev/loki/chest/Chest.class new file mode 100644 index 0000000..04e6073 Binary files /dev/null and b/bin/main/dev/loki/chest/Chest.class differ diff --git a/bin/main/dev/loki/chest/ChestManager.class b/bin/main/dev/loki/chest/ChestManager.class new file mode 100644 index 0000000..48370be Binary files /dev/null and b/bin/main/dev/loki/chest/ChestManager.class differ diff --git a/bin/main/dev/loki/chest/ChestOpening$1.class b/bin/main/dev/loki/chest/ChestOpening$1.class new file mode 100644 index 0000000..94f37c9 Binary files /dev/null and b/bin/main/dev/loki/chest/ChestOpening$1.class differ diff --git a/bin/main/dev/loki/chest/ChestOpening.class b/bin/main/dev/loki/chest/ChestOpening.class new file mode 100644 index 0000000..008706e Binary files /dev/null and b/bin/main/dev/loki/chest/ChestOpening.class differ diff --git a/bin/main/dev/loki/command/DBDAdminCommand.class b/bin/main/dev/loki/command/DBDAdminCommand.class new file mode 100644 index 0000000..b2c7ff3 Binary files /dev/null and b/bin/main/dev/loki/command/DBDAdminCommand.class differ diff --git a/bin/main/dev/loki/command/DBDCommand.class b/bin/main/dev/loki/command/DBDCommand.class new file mode 100644 index 0000000..c6311a6 Binary files /dev/null and b/bin/main/dev/loki/command/DBDCommand.class differ diff --git a/bin/main/dev/loki/command/SetupCommand.class b/bin/main/dev/loki/command/SetupCommand.class new file mode 100644 index 0000000..eb33a83 Binary files /dev/null and b/bin/main/dev/loki/command/SetupCommand.class differ diff --git a/bin/main/dev/loki/config/ConfigManager.class b/bin/main/dev/loki/config/ConfigManager.class new file mode 100644 index 0000000..1f8049e Binary files /dev/null and b/bin/main/dev/loki/config/ConfigManager.class differ diff --git a/bin/main/dev/loki/config/GameConfig.class b/bin/main/dev/loki/config/GameConfig.class new file mode 100644 index 0000000..f15ca26 Binary files /dev/null and b/bin/main/dev/loki/config/GameConfig.class differ diff --git a/bin/main/dev/loki/config/LocationsConfig.class b/bin/main/dev/loki/config/LocationsConfig.class new file mode 100644 index 0000000..ed43ae9 Binary files /dev/null and b/bin/main/dev/loki/config/LocationsConfig.class differ diff --git a/bin/main/dev/loki/config/MessagesConfig.class b/bin/main/dev/loki/config/MessagesConfig.class new file mode 100644 index 0000000..ad30f7d Binary files /dev/null and b/bin/main/dev/loki/config/MessagesConfig.class differ diff --git a/bin/main/dev/loki/config/SkillCheckConfig.class b/bin/main/dev/loki/config/SkillCheckConfig.class new file mode 100644 index 0000000..d162c85 Binary files /dev/null and b/bin/main/dev/loki/config/SkillCheckConfig.class differ diff --git a/bin/main/dev/loki/core/GameEventBus.class b/bin/main/dev/loki/core/GameEventBus.class new file mode 100644 index 0000000..0190e0a Binary files /dev/null and b/bin/main/dev/loki/core/GameEventBus.class differ diff --git a/bin/main/dev/loki/core/GameManager.class b/bin/main/dev/loki/core/GameManager.class new file mode 100644 index 0000000..f5f5d65 Binary files /dev/null and b/bin/main/dev/loki/core/GameManager.class differ diff --git a/bin/main/dev/loki/core/GameSession$PlayerJoinEvent.class b/bin/main/dev/loki/core/GameSession$PlayerJoinEvent.class new file mode 100644 index 0000000..992a445 Binary files /dev/null and b/bin/main/dev/loki/core/GameSession$PlayerJoinEvent.class differ diff --git a/bin/main/dev/loki/core/GameSession$PlayerLeaveEvent.class b/bin/main/dev/loki/core/GameSession$PlayerLeaveEvent.class new file mode 100644 index 0000000..932a970 Binary files /dev/null and b/bin/main/dev/loki/core/GameSession$PlayerLeaveEvent.class differ diff --git a/bin/main/dev/loki/core/GameSession.class b/bin/main/dev/loki/core/GameSession.class new file mode 100644 index 0000000..f572dbb Binary files /dev/null and b/bin/main/dev/loki/core/GameSession.class differ diff --git a/bin/main/dev/loki/core/GameState.class b/bin/main/dev/loki/core/GameState.class new file mode 100644 index 0000000..2ef79f4 Binary files /dev/null and b/bin/main/dev/loki/core/GameState.class differ diff --git a/bin/main/dev/loki/damage/AttackListener.class b/bin/main/dev/loki/damage/AttackListener.class new file mode 100644 index 0000000..242906a Binary files /dev/null and b/bin/main/dev/loki/damage/AttackListener.class differ diff --git a/bin/main/dev/loki/damage/DamageHandler.class b/bin/main/dev/loki/damage/DamageHandler.class new file mode 100644 index 0000000..59d78c3 Binary files /dev/null and b/bin/main/dev/loki/damage/DamageHandler.class differ diff --git a/bin/main/dev/loki/data/DataStorage.class b/bin/main/dev/loki/data/DataStorage.class new file mode 100644 index 0000000..8f9df8e Binary files /dev/null and b/bin/main/dev/loki/data/DataStorage.class differ diff --git a/bin/main/dev/loki/data/GeneratorDataManager.class b/bin/main/dev/loki/data/GeneratorDataManager.class new file mode 100644 index 0000000..64dae9e Binary files /dev/null and b/bin/main/dev/loki/data/GeneratorDataManager.class differ diff --git a/bin/main/dev/loki/data/MatchResult$Role.class b/bin/main/dev/loki/data/MatchResult$Role.class new file mode 100644 index 0000000..29e2424 Binary files /dev/null and b/bin/main/dev/loki/data/MatchResult$Role.class differ diff --git a/bin/main/dev/loki/data/MatchResult.class b/bin/main/dev/loki/data/MatchResult.class new file mode 100644 index 0000000..0469a61 Binary files /dev/null and b/bin/main/dev/loki/data/MatchResult.class differ diff --git a/bin/main/dev/loki/data/PlayerStats.class b/bin/main/dev/loki/data/PlayerStats.class new file mode 100644 index 0000000..106db56 Binary files /dev/null and b/bin/main/dev/loki/data/PlayerStats.class differ diff --git a/bin/main/dev/loki/data/SQLiteStorage.class b/bin/main/dev/loki/data/SQLiteStorage.class new file mode 100644 index 0000000..e360f2c Binary files /dev/null and b/bin/main/dev/loki/data/SQLiteStorage.class differ diff --git a/bin/main/dev/loki/data/YamlStorage.class b/bin/main/dev/loki/data/YamlStorage.class new file mode 100644 index 0000000..8a6b0ba Binary files /dev/null and b/bin/main/dev/loki/data/YamlStorage.class differ diff --git a/bin/main/dev/loki/gate/ExitGate$GateState.class b/bin/main/dev/loki/gate/ExitGate$GateState.class new file mode 100644 index 0000000..c9a1e1f Binary files /dev/null and b/bin/main/dev/loki/gate/ExitGate$GateState.class differ diff --git a/bin/main/dev/loki/gate/ExitGate.class b/bin/main/dev/loki/gate/ExitGate.class new file mode 100644 index 0000000..0ff450d Binary files /dev/null and b/bin/main/dev/loki/gate/ExitGate.class differ diff --git a/bin/main/dev/loki/gate/GateManager.class b/bin/main/dev/loki/gate/GateManager.class new file mode 100644 index 0000000..4e5d554 Binary files /dev/null and b/bin/main/dev/loki/gate/GateManager.class differ diff --git a/bin/main/dev/loki/gate/GateOpening$OpeningProgress.class b/bin/main/dev/loki/gate/GateOpening$OpeningProgress.class new file mode 100644 index 0000000..cfa3d52 Binary files /dev/null and b/bin/main/dev/loki/gate/GateOpening$OpeningProgress.class differ diff --git a/bin/main/dev/loki/gate/GateOpening$OpeningTask.class b/bin/main/dev/loki/gate/GateOpening$OpeningTask.class new file mode 100644 index 0000000..e62ee19 Binary files /dev/null and b/bin/main/dev/loki/gate/GateOpening$OpeningTask.class differ diff --git a/bin/main/dev/loki/gate/GateOpening.class b/bin/main/dev/loki/gate/GateOpening.class new file mode 100644 index 0000000..e11f561 Binary files /dev/null and b/bin/main/dev/loki/gate/GateOpening.class differ diff --git a/bin/main/dev/loki/hatch/Hatch$HatchState.class b/bin/main/dev/loki/hatch/Hatch$HatchState.class new file mode 100644 index 0000000..a83bd1a Binary files /dev/null and b/bin/main/dev/loki/hatch/Hatch$HatchState.class differ diff --git a/bin/main/dev/loki/hatch/Hatch.class b/bin/main/dev/loki/hatch/Hatch.class new file mode 100644 index 0000000..5813dd0 Binary files /dev/null and b/bin/main/dev/loki/hatch/Hatch.class differ diff --git a/bin/main/dev/loki/hatch/HatchCondition.class b/bin/main/dev/loki/hatch/HatchCondition.class new file mode 100644 index 0000000..30223bd Binary files /dev/null and b/bin/main/dev/loki/hatch/HatchCondition.class differ diff --git a/bin/main/dev/loki/hatch/HatchEscape.class b/bin/main/dev/loki/hatch/HatchEscape.class new file mode 100644 index 0000000..ef5738b Binary files /dev/null and b/bin/main/dev/loki/hatch/HatchEscape.class differ diff --git a/bin/main/dev/loki/hook/Hook.class b/bin/main/dev/loki/hook/Hook.class new file mode 100644 index 0000000..42db737 Binary files /dev/null and b/bin/main/dev/loki/hook/Hook.class differ diff --git a/bin/main/dev/loki/hook/HookManager.class b/bin/main/dev/loki/hook/HookManager.class new file mode 100644 index 0000000..14b0857 Binary files /dev/null and b/bin/main/dev/loki/hook/HookManager.class differ diff --git a/bin/main/dev/loki/hook/HookRescue$RescueSession.class b/bin/main/dev/loki/hook/HookRescue$RescueSession.class new file mode 100644 index 0000000..fc1d5aa Binary files /dev/null and b/bin/main/dev/loki/hook/HookRescue$RescueSession.class differ diff --git a/bin/main/dev/loki/hook/HookRescue.class b/bin/main/dev/loki/hook/HookRescue.class new file mode 100644 index 0000000..c119423 Binary files /dev/null and b/bin/main/dev/loki/hook/HookRescue.class differ diff --git a/bin/main/dev/loki/hook/HookSacrifice.class b/bin/main/dev/loki/hook/HookSacrifice.class new file mode 100644 index 0000000..730a908 Binary files /dev/null and b/bin/main/dev/loki/hook/HookSacrifice.class differ diff --git a/bin/main/dev/loki/hook/HookStage.class b/bin/main/dev/loki/hook/HookStage.class new file mode 100644 index 0000000..b8af002 Binary files /dev/null and b/bin/main/dev/loki/hook/HookStage.class differ diff --git a/bin/main/dev/loki/hook/HookStruggle.class b/bin/main/dev/loki/hook/HookStruggle.class new file mode 100644 index 0000000..f30fe78 Binary files /dev/null and b/bin/main/dev/loki/hook/HookStruggle.class differ diff --git a/bin/main/dev/loki/item/BaseItem.class b/bin/main/dev/loki/item/BaseItem.class new file mode 100644 index 0000000..420dba2 Binary files /dev/null and b/bin/main/dev/loki/item/BaseItem.class differ diff --git a/bin/main/dev/loki/item/ChestLoot.class b/bin/main/dev/loki/item/ChestLoot.class new file mode 100644 index 0000000..94829ee Binary files /dev/null and b/bin/main/dev/loki/item/ChestLoot.class differ diff --git a/bin/main/dev/loki/item/DBDItems.class b/bin/main/dev/loki/item/DBDItems.class new file mode 100644 index 0000000..28f8c11 Binary files /dev/null and b/bin/main/dev/loki/item/DBDItems.class differ diff --git a/bin/main/dev/loki/item/ItemFlashlight.class b/bin/main/dev/loki/item/ItemFlashlight.class new file mode 100644 index 0000000..7ad4ef2 Binary files /dev/null and b/bin/main/dev/loki/item/ItemFlashlight.class differ diff --git a/bin/main/dev/loki/item/ItemMedkit.class b/bin/main/dev/loki/item/ItemMedkit.class new file mode 100644 index 0000000..2d06dfb Binary files /dev/null and b/bin/main/dev/loki/item/ItemMedkit.class differ diff --git a/bin/main/dev/loki/item/ItemType.class b/bin/main/dev/loki/item/ItemType.class new file mode 100644 index 0000000..d0d11c4 Binary files /dev/null and b/bin/main/dev/loki/item/ItemType.class differ diff --git a/bin/main/dev/loki/item/ItemUseListener$1.class b/bin/main/dev/loki/item/ItemUseListener$1.class new file mode 100644 index 0000000..de8869d Binary files /dev/null and b/bin/main/dev/loki/item/ItemUseListener$1.class differ diff --git a/bin/main/dev/loki/item/ItemUseListener.class b/bin/main/dev/loki/item/ItemUseListener.class new file mode 100644 index 0000000..fed4b91 Binary files /dev/null and b/bin/main/dev/loki/item/ItemUseListener.class differ diff --git a/bin/main/dev/loki/killer/HitValidator.class b/bin/main/dev/loki/killer/HitValidator.class new file mode 100644 index 0000000..ad3e3c5 Binary files /dev/null and b/bin/main/dev/loki/killer/HitValidator.class differ diff --git a/bin/main/dev/loki/killer/KillerAttack.class b/bin/main/dev/loki/killer/KillerAttack.class new file mode 100644 index 0000000..cb6f5f2 Binary files /dev/null and b/bin/main/dev/loki/killer/KillerAttack.class differ diff --git a/bin/main/dev/loki/killer/KillerCarry$CarryData.class b/bin/main/dev/loki/killer/KillerCarry$CarryData.class new file mode 100644 index 0000000..7b8ff94 Binary files /dev/null and b/bin/main/dev/loki/killer/KillerCarry$CarryData.class differ diff --git a/bin/main/dev/loki/killer/KillerCarry.class b/bin/main/dev/loki/killer/KillerCarry.class new file mode 100644 index 0000000..62ae901 Binary files /dev/null and b/bin/main/dev/loki/killer/KillerCarry.class differ diff --git a/bin/main/dev/loki/killer/KillerController.class b/bin/main/dev/loki/killer/KillerController.class new file mode 100644 index 0000000..9ab4c7f Binary files /dev/null and b/bin/main/dev/loki/killer/KillerController.class differ diff --git a/bin/main/dev/loki/killer/KillerMovement.class b/bin/main/dev/loki/killer/KillerMovement.class new file mode 100644 index 0000000..38f2088 Binary files /dev/null and b/bin/main/dev/loki/killer/KillerMovement.class differ diff --git a/bin/main/dev/loki/killer/KillerVision.class b/bin/main/dev/loki/killer/KillerVision.class new file mode 100644 index 0000000..7f7393d Binary files /dev/null and b/bin/main/dev/loki/killer/KillerVision.class differ diff --git a/bin/main/dev/loki/listener/DamageListener.class b/bin/main/dev/loki/listener/DamageListener.class new file mode 100644 index 0000000..c1ded1a Binary files /dev/null and b/bin/main/dev/loki/listener/DamageListener.class differ diff --git a/bin/main/dev/loki/listener/GeneratorSelectListener.class b/bin/main/dev/loki/listener/GeneratorSelectListener.class new file mode 100644 index 0000000..b600772 Binary files /dev/null and b/bin/main/dev/loki/listener/GeneratorSelectListener.class differ diff --git a/bin/main/dev/loki/listener/PlayerInteractListener.class b/bin/main/dev/loki/listener/PlayerInteractListener.class new file mode 100644 index 0000000..0144bc2 Binary files /dev/null and b/bin/main/dev/loki/listener/PlayerInteractListener.class differ diff --git a/bin/main/dev/loki/listener/PlayerMoveListener.class b/bin/main/dev/loki/listener/PlayerMoveListener.class new file mode 100644 index 0000000..296e980 Binary files /dev/null and b/bin/main/dev/loki/listener/PlayerMoveListener.class differ diff --git a/bin/main/dev/loki/listener/PlayerQuitListener.class b/bin/main/dev/loki/listener/PlayerQuitListener.class new file mode 100644 index 0000000..205b765 Binary files /dev/null and b/bin/main/dev/loki/listener/PlayerQuitListener.class differ diff --git a/bin/main/dev/loki/listener/SetupBlockBreakListener.class b/bin/main/dev/loki/listener/SetupBlockBreakListener.class new file mode 100644 index 0000000..66bb398 Binary files /dev/null and b/bin/main/dev/loki/listener/SetupBlockBreakListener.class differ diff --git a/bin/main/dev/loki/map/MapBuilder.class b/bin/main/dev/loki/map/MapBuilder.class new file mode 100644 index 0000000..d1bd805 Binary files /dev/null and b/bin/main/dev/loki/map/MapBuilder.class differ diff --git a/bin/main/dev/loki/map/MapTemplate.class b/bin/main/dev/loki/map/MapTemplate.class new file mode 100644 index 0000000..797cde6 Binary files /dev/null and b/bin/main/dev/loki/map/MapTemplate.class differ diff --git a/bin/main/dev/loki/map/TemplateManager$PresetMap.class b/bin/main/dev/loki/map/TemplateManager$PresetMap.class new file mode 100644 index 0000000..f91a487 Binary files /dev/null and b/bin/main/dev/loki/map/TemplateManager$PresetMap.class differ diff --git a/bin/main/dev/loki/map/TemplateManager.class b/bin/main/dev/loki/map/TemplateManager.class new file mode 100644 index 0000000..c134187 Binary files /dev/null and b/bin/main/dev/loki/map/TemplateManager.class differ diff --git a/bin/main/dev/loki/mdbd.class b/bin/main/dev/loki/mdbd.class new file mode 100644 index 0000000..0d08e13 Binary files /dev/null and b/bin/main/dev/loki/mdbd.class differ diff --git a/bin/main/dev/loki/mdbdBootstrap.class b/bin/main/dev/loki/mdbdBootstrap.class new file mode 100644 index 0000000..04e844c Binary files /dev/null and b/bin/main/dev/loki/mdbdBootstrap.class differ diff --git a/bin/main/dev/loki/mdbdLoader.class b/bin/main/dev/loki/mdbdLoader.class new file mode 100644 index 0000000..cd5429f Binary files /dev/null and b/bin/main/dev/loki/mdbdLoader.class differ diff --git a/bin/main/dev/loki/objective/Generator.class b/bin/main/dev/loki/objective/Generator.class new file mode 100644 index 0000000..e9bc4df Binary files /dev/null and b/bin/main/dev/loki/objective/Generator.class differ diff --git a/bin/main/dev/loki/objective/GeneratorManager.class b/bin/main/dev/loki/objective/GeneratorManager.class new file mode 100644 index 0000000..1022585 Binary files /dev/null and b/bin/main/dev/loki/objective/GeneratorManager.class differ diff --git a/bin/main/dev/loki/objective/GeneratorRegression.class b/bin/main/dev/loki/objective/GeneratorRegression.class new file mode 100644 index 0000000..5675bb5 Binary files /dev/null and b/bin/main/dev/loki/objective/GeneratorRegression.class differ diff --git a/bin/main/dev/loki/objective/GeneratorRepair$RepairSession.class b/bin/main/dev/loki/objective/GeneratorRepair$RepairSession.class new file mode 100644 index 0000000..71881c8 Binary files /dev/null and b/bin/main/dev/loki/objective/GeneratorRepair$RepairSession.class differ diff --git a/bin/main/dev/loki/objective/GeneratorRepair.class b/bin/main/dev/loki/objective/GeneratorRepair.class new file mode 100644 index 0000000..a376b34 Binary files /dev/null and b/bin/main/dev/loki/objective/GeneratorRepair.class differ diff --git a/bin/main/dev/loki/objective/SkillCheck$CheckState.class b/bin/main/dev/loki/objective/SkillCheck$CheckState.class new file mode 100644 index 0000000..e49e9e4 Binary files /dev/null and b/bin/main/dev/loki/objective/SkillCheck$CheckState.class differ diff --git a/bin/main/dev/loki/objective/SkillCheck.class b/bin/main/dev/loki/objective/SkillCheck.class new file mode 100644 index 0000000..f7981b6 Binary files /dev/null and b/bin/main/dev/loki/objective/SkillCheck.class differ diff --git a/bin/main/dev/loki/objective/SkillCheckUI.class b/bin/main/dev/loki/objective/SkillCheckUI.class new file mode 100644 index 0000000..ee59db9 Binary files /dev/null and b/bin/main/dev/loki/objective/SkillCheckUI.class differ diff --git a/bin/main/dev/loki/pallet/Pallet$PalletState.class b/bin/main/dev/loki/pallet/Pallet$PalletState.class new file mode 100644 index 0000000..a08f42c Binary files /dev/null and b/bin/main/dev/loki/pallet/Pallet$PalletState.class differ diff --git a/bin/main/dev/loki/pallet/Pallet.class b/bin/main/dev/loki/pallet/Pallet.class new file mode 100644 index 0000000..13f222b Binary files /dev/null and b/bin/main/dev/loki/pallet/Pallet.class differ diff --git a/bin/main/dev/loki/pallet/PalletBreak$BreakTask.class b/bin/main/dev/loki/pallet/PalletBreak$BreakTask.class new file mode 100644 index 0000000..61e03f4 Binary files /dev/null and b/bin/main/dev/loki/pallet/PalletBreak$BreakTask.class differ diff --git a/bin/main/dev/loki/pallet/PalletBreak$BreakingProgress.class b/bin/main/dev/loki/pallet/PalletBreak$BreakingProgress.class new file mode 100644 index 0000000..0de3310 Binary files /dev/null and b/bin/main/dev/loki/pallet/PalletBreak$BreakingProgress.class differ diff --git a/bin/main/dev/loki/pallet/PalletBreak.class b/bin/main/dev/loki/pallet/PalletBreak.class new file mode 100644 index 0000000..c43d128 Binary files /dev/null and b/bin/main/dev/loki/pallet/PalletBreak.class differ diff --git a/bin/main/dev/loki/pallet/PalletDrop.class b/bin/main/dev/loki/pallet/PalletDrop.class new file mode 100644 index 0000000..2ae340f Binary files /dev/null and b/bin/main/dev/loki/pallet/PalletDrop.class differ diff --git a/bin/main/dev/loki/pallet/PalletManager.class b/bin/main/dev/loki/pallet/PalletManager.class new file mode 100644 index 0000000..bca417a Binary files /dev/null and b/bin/main/dev/loki/pallet/PalletManager.class differ diff --git a/bin/main/dev/loki/pallet/PalletStun$1.class b/bin/main/dev/loki/pallet/PalletStun$1.class new file mode 100644 index 0000000..57b7823 Binary files /dev/null and b/bin/main/dev/loki/pallet/PalletStun$1.class differ diff --git a/bin/main/dev/loki/pallet/PalletStun.class b/bin/main/dev/loki/pallet/PalletStun.class new file mode 100644 index 0000000..31e8b18 Binary files /dev/null and b/bin/main/dev/loki/pallet/PalletStun.class differ diff --git a/bin/main/dev/loki/phase/EndgamePhase$1.class b/bin/main/dev/loki/phase/EndgamePhase$1.class new file mode 100644 index 0000000..75e9380 Binary files /dev/null and b/bin/main/dev/loki/phase/EndgamePhase$1.class differ diff --git a/bin/main/dev/loki/phase/EndgamePhase.class b/bin/main/dev/loki/phase/EndgamePhase.class new file mode 100644 index 0000000..fe9c66e Binary files /dev/null and b/bin/main/dev/loki/phase/EndgamePhase.class differ diff --git a/bin/main/dev/loki/phase/GameplayPhase$VanillaDamageBlocker.class b/bin/main/dev/loki/phase/GameplayPhase$VanillaDamageBlocker.class new file mode 100644 index 0000000..07b8284 Binary files /dev/null and b/bin/main/dev/loki/phase/GameplayPhase$VanillaDamageBlocker.class differ diff --git a/bin/main/dev/loki/phase/GameplayPhase.class b/bin/main/dev/loki/phase/GameplayPhase.class new file mode 100644 index 0000000..319e538 Binary files /dev/null and b/bin/main/dev/loki/phase/GameplayPhase.class differ diff --git a/bin/main/dev/loki/phase/LobbyPhase.class b/bin/main/dev/loki/phase/LobbyPhase.class new file mode 100644 index 0000000..2f40852 Binary files /dev/null and b/bin/main/dev/loki/phase/LobbyPhase.class differ diff --git a/bin/main/dev/loki/phase/Phase.class b/bin/main/dev/loki/phase/Phase.class new file mode 100644 index 0000000..1dec935 Binary files /dev/null and b/bin/main/dev/loki/phase/Phase.class differ diff --git a/bin/main/dev/loki/phase/RoleAssignPhase.class b/bin/main/dev/loki/phase/RoleAssignPhase.class new file mode 100644 index 0000000..19b62ee Binary files /dev/null and b/bin/main/dev/loki/phase/RoleAssignPhase.class differ diff --git a/bin/main/dev/loki/player/BasePlayer.class b/bin/main/dev/loki/player/BasePlayer.class new file mode 100644 index 0000000..03e7710 Binary files /dev/null and b/bin/main/dev/loki/player/BasePlayer.class differ diff --git a/bin/main/dev/loki/player/Killer.class b/bin/main/dev/loki/player/Killer.class new file mode 100644 index 0000000..6af8a1a Binary files /dev/null and b/bin/main/dev/loki/player/Killer.class differ diff --git a/bin/main/dev/loki/player/PlayerManager.class b/bin/main/dev/loki/player/PlayerManager.class new file mode 100644 index 0000000..566c872 Binary files /dev/null and b/bin/main/dev/loki/player/PlayerManager.class differ diff --git a/bin/main/dev/loki/player/PlayerState.class b/bin/main/dev/loki/player/PlayerState.class new file mode 100644 index 0000000..75eb765 Binary files /dev/null and b/bin/main/dev/loki/player/PlayerState.class differ diff --git a/bin/main/dev/loki/player/Survivor.class b/bin/main/dev/loki/player/Survivor.class new file mode 100644 index 0000000..13d7815 Binary files /dev/null and b/bin/main/dev/loki/player/Survivor.class differ diff --git a/bin/main/dev/loki/role/RoleAssigner$RoleAssignedEvent.class b/bin/main/dev/loki/role/RoleAssigner$RoleAssignedEvent.class new file mode 100644 index 0000000..a77863a Binary files /dev/null and b/bin/main/dev/loki/role/RoleAssigner$RoleAssignedEvent.class differ diff --git a/bin/main/dev/loki/role/RoleAssigner.class b/bin/main/dev/loki/role/RoleAssigner.class new file mode 100644 index 0000000..914d852 Binary files /dev/null and b/bin/main/dev/loki/role/RoleAssigner.class differ diff --git a/bin/main/dev/loki/role/RoleQueue.class b/bin/main/dev/loki/role/RoleQueue.class new file mode 100644 index 0000000..0acb0b5 Binary files /dev/null and b/bin/main/dev/loki/role/RoleQueue.class differ diff --git a/bin/main/dev/loki/role/SpawnPosition.class b/bin/main/dev/loki/role/SpawnPosition.class new file mode 100644 index 0000000..9414eae Binary files /dev/null and b/bin/main/dev/loki/role/SpawnPosition.class differ diff --git a/bin/main/dev/loki/sound/GeneratorSound.class b/bin/main/dev/loki/sound/GeneratorSound.class new file mode 100644 index 0000000..3b278e0 Binary files /dev/null and b/bin/main/dev/loki/sound/GeneratorSound.class differ diff --git a/bin/main/dev/loki/sound/SoundLevels.class b/bin/main/dev/loki/sound/SoundLevels.class new file mode 100644 index 0000000..2e35833 Binary files /dev/null and b/bin/main/dev/loki/sound/SoundLevels.class differ diff --git a/bin/main/dev/loki/sound/SoundManager.class b/bin/main/dev/loki/sound/SoundManager.class new file mode 100644 index 0000000..ca6579e Binary files /dev/null and b/bin/main/dev/loki/sound/SoundManager.class differ diff --git a/bin/main/dev/loki/sound/TerrorRadiusSound.class b/bin/main/dev/loki/sound/TerrorRadiusSound.class new file mode 100644 index 0000000..cdddeb4 Binary files /dev/null and b/bin/main/dev/loki/sound/TerrorRadiusSound.class differ diff --git a/bin/main/dev/loki/state/StateHandler.class b/bin/main/dev/loki/state/StateHandler.class new file mode 100644 index 0000000..91cad30 Binary files /dev/null and b/bin/main/dev/loki/state/StateHandler.class differ diff --git a/bin/main/dev/loki/state/StateMachine.class b/bin/main/dev/loki/state/StateMachine.class new file mode 100644 index 0000000..38bf158 Binary files /dev/null and b/bin/main/dev/loki/state/StateMachine.class differ diff --git a/bin/main/dev/loki/state/StateTransition.class b/bin/main/dev/loki/state/StateTransition.class new file mode 100644 index 0000000..cfcfadb Binary files /dev/null and b/bin/main/dev/loki/state/StateTransition.class differ diff --git a/bin/main/dev/loki/survivor/SurvivorController.class b/bin/main/dev/loki/survivor/SurvivorController.class new file mode 100644 index 0000000..ca4925b Binary files /dev/null and b/bin/main/dev/loki/survivor/SurvivorController.class differ diff --git a/bin/main/dev/loki/survivor/SurvivorHealing.class b/bin/main/dev/loki/survivor/SurvivorHealing.class new file mode 100644 index 0000000..d4e33e6 Binary files /dev/null and b/bin/main/dev/loki/survivor/SurvivorHealing.class differ diff --git a/bin/main/dev/loki/survivor/SurvivorMovement.class b/bin/main/dev/loki/survivor/SurvivorMovement.class new file mode 100644 index 0000000..f1429e9 Binary files /dev/null and b/bin/main/dev/loki/survivor/SurvivorMovement.class differ diff --git a/bin/main/dev/loki/totem/DullTotem.class b/bin/main/dev/loki/totem/DullTotem.class new file mode 100644 index 0000000..598632f Binary files /dev/null and b/bin/main/dev/loki/totem/DullTotem.class differ diff --git a/bin/main/dev/loki/totem/HexTotem.class b/bin/main/dev/loki/totem/HexTotem.class new file mode 100644 index 0000000..ce66c85 Binary files /dev/null and b/bin/main/dev/loki/totem/HexTotem.class differ diff --git a/bin/main/dev/loki/totem/Totem.class b/bin/main/dev/loki/totem/Totem.class new file mode 100644 index 0000000..744f580 Binary files /dev/null and b/bin/main/dev/loki/totem/Totem.class differ diff --git a/bin/main/dev/loki/totem/TotemManager.class b/bin/main/dev/loki/totem/TotemManager.class new file mode 100644 index 0000000..62dacdc Binary files /dev/null and b/bin/main/dev/loki/totem/TotemManager.class differ diff --git a/bin/main/dev/loki/totem/TotemState.class b/bin/main/dev/loki/totem/TotemState.class new file mode 100644 index 0000000..3bbc392 Binary files /dev/null and b/bin/main/dev/loki/totem/TotemState.class differ diff --git a/bin/main/dev/loki/ui/ActionBar.class b/bin/main/dev/loki/ui/ActionBar.class new file mode 100644 index 0000000..fba075c Binary files /dev/null and b/bin/main/dev/loki/ui/ActionBar.class differ diff --git a/bin/main/dev/loki/ui/ProgressBar.class b/bin/main/dev/loki/ui/ProgressBar.class new file mode 100644 index 0000000..85ab360 Binary files /dev/null and b/bin/main/dev/loki/ui/ProgressBar.class differ diff --git a/bin/main/dev/loki/ui/Sidebar.class b/bin/main/dev/loki/ui/Sidebar.class new file mode 100644 index 0000000..17bd6ed Binary files /dev/null and b/bin/main/dev/loki/ui/Sidebar.class differ diff --git a/bin/main/dev/loki/ui/StatusIcons.class b/bin/main/dev/loki/ui/StatusIcons.class new file mode 100644 index 0000000..f373cb7 Binary files /dev/null and b/bin/main/dev/loki/ui/StatusIcons.class differ diff --git a/bin/main/dev/loki/ui/TitleUI$SkillCheckState.class b/bin/main/dev/loki/ui/TitleUI$SkillCheckState.class new file mode 100644 index 0000000..d2a81ff Binary files /dev/null and b/bin/main/dev/loki/ui/TitleUI$SkillCheckState.class differ diff --git a/bin/main/dev/loki/ui/TitleUI.class b/bin/main/dev/loki/ui/TitleUI.class new file mode 100644 index 0000000..76becf2 Binary files /dev/null and b/bin/main/dev/loki/ui/TitleUI.class differ diff --git a/bin/main/dev/loki/util/LocationUtil.class b/bin/main/dev/loki/util/LocationUtil.class new file mode 100644 index 0000000..681f3ef Binary files /dev/null and b/bin/main/dev/loki/util/LocationUtil.class differ diff --git a/bin/main/dev/loki/util/MathUtil.class b/bin/main/dev/loki/util/MathUtil.class new file mode 100644 index 0000000..511e2d2 Binary files /dev/null and b/bin/main/dev/loki/util/MathUtil.class differ diff --git a/bin/main/dev/loki/util/ParticleUtil.class b/bin/main/dev/loki/util/ParticleUtil.class new file mode 100644 index 0000000..2a909a3 Binary files /dev/null and b/bin/main/dev/loki/util/ParticleUtil.class differ diff --git a/bin/main/dev/loki/util/PlayerUtil.class b/bin/main/dev/loki/util/PlayerUtil.class new file mode 100644 index 0000000..86472fd Binary files /dev/null and b/bin/main/dev/loki/util/PlayerUtil.class differ diff --git a/bin/main/dev/loki/util/TextUtil.class b/bin/main/dev/loki/util/TextUtil.class new file mode 100644 index 0000000..1bedf31 Binary files /dev/null and b/bin/main/dev/loki/util/TextUtil.class differ diff --git a/bin/main/dev/loki/util/TimeUtil.class b/bin/main/dev/loki/util/TimeUtil.class new file mode 100644 index 0000000..07f1a31 Binary files /dev/null and b/bin/main/dev/loki/util/TimeUtil.class differ diff --git a/bin/main/dev/loki/window/Window$PlayerContext.class b/bin/main/dev/loki/window/Window$PlayerContext.class new file mode 100644 index 0000000..44f0b33 Binary files /dev/null and b/bin/main/dev/loki/window/Window$PlayerContext.class differ diff --git a/bin/main/dev/loki/window/Window.class b/bin/main/dev/loki/window/Window.class new file mode 100644 index 0000000..745850c Binary files /dev/null and b/bin/main/dev/loki/window/Window.class differ diff --git a/bin/main/dev/loki/window/WindowFastVault$FastVaultTask.class b/bin/main/dev/loki/window/WindowFastVault$FastVaultTask.class new file mode 100644 index 0000000..9f79374 Binary files /dev/null and b/bin/main/dev/loki/window/WindowFastVault$FastVaultTask.class differ diff --git a/bin/main/dev/loki/window/WindowFastVault.class b/bin/main/dev/loki/window/WindowFastVault.class new file mode 100644 index 0000000..9eed959 Binary files /dev/null and b/bin/main/dev/loki/window/WindowFastVault.class differ diff --git a/bin/main/dev/loki/window/WindowManager.class b/bin/main/dev/loki/window/WindowManager.class new file mode 100644 index 0000000..8e5daf5 Binary files /dev/null and b/bin/main/dev/loki/window/WindowManager.class differ diff --git a/bin/main/dev/loki/window/WindowVault$VaultTask.class b/bin/main/dev/loki/window/WindowVault$VaultTask.class new file mode 100644 index 0000000..68491dc Binary files /dev/null and b/bin/main/dev/loki/window/WindowVault$VaultTask.class differ diff --git a/bin/main/dev/loki/window/WindowVault.class b/bin/main/dev/loki/window/WindowVault.class new file mode 100644 index 0000000..8d7d31c Binary files /dev/null and b/bin/main/dev/loki/window/WindowVault.class differ diff --git a/bin/main/dev/loki/world/LobbyManager.class b/bin/main/dev/loki/world/LobbyManager.class new file mode 100644 index 0000000..ec76529 Binary files /dev/null and b/bin/main/dev/loki/world/LobbyManager.class differ diff --git a/bin/main/dev/loki/world/VoidWorldGenerator.class b/bin/main/dev/loki/world/VoidWorldGenerator.class new file mode 100644 index 0000000..6a9e20d Binary files /dev/null and b/bin/main/dev/loki/world/VoidWorldGenerator.class differ diff --git a/bin/main/game.yml b/bin/main/game.yml new file mode 100644 index 0000000..34f4812 --- /dev/null +++ b/bin/main/game.yml @@ -0,0 +1,138 @@ +# ============================================ +# Mdbd Plugin - Игровой баланс +# ============================================ + +# Лобби +lobby: + # Минимум игроков для старта + min-players: 5 + + # Максимум игроков + max-players: 5 + + # Обратный отсчёт (секунд) + countdown-seconds: 60 + + # Задержка перед назначением ролей (секунд) + role-assign-delay: 5 + +# Генераторы +generators: + # Всего генераторов на карте + total-count: 7 + + # Сколько нужно починить для ворот + required-count: 5 + + # Время починки одного генератора (секунд) + repair-seconds: 80 + + # Скорость отката без чинильщика (%/сек) + regression-rate: 0.25 + + # Скорость отката после пинка (%/сек) + kick-regression-rate: 2.5 + + # Длительность отката после пинка (секунд) + kick-duration-seconds: 30 + +# Крюки +hooks: + # Длительность Фазы 1 (секунд) + stage1-seconds: 60 + + # Длительность Фазы 2 (секунд) + stage2-seconds: 60 + + # Интервал борьбы на Фазе 2 (секунд) + struggle-interval: 2 + + # Максимум крюков на одного выжившего + max-hooks: 3 + +# Скорости (% от нормальной) +movement: + # Киллер + killer: 115 + + # Киллер с выжившим + killer-carry: 92 + + # Выживший шагом + survivor-walk: 100 + + # Выживший спринт + survivor-sprint: 150 + + # Выживший в нокдауне (ползком) + survivor-crawl: 30 + + # Длительность истощения (секунд) + exhaustion-duration: 3 + + # Кулдаун истощения (секунд) + exhaustion-cooldown: 5 + +# Лечение +healing: + # Самолечение (секунд) + self-heal-seconds: 30 + + # Лечение другого (секунд) + other-heal-seconds: 16 + + # Бонус аптечки (0.5 = в 2 раза быстрее) + medkit-bonus: 0.5 + + # Прерывание при движении + interrupt-on-move: true + +# Киллер +killer: + # Кулдаун атаки (секунд) + attack-cooldown: 2.5 + + # Дальность атаки (блоков) + attack-range: 3.0 + + # Длительность оглушения паллетом (секунд) + pallet-stun-seconds: 2.5 + + # Время ломания паллета (секунд) + pallet-break-seconds: 3.0 + + # Радиус ужаса (блоков) + terror-radius: 32 + +# Окна +window: + # Быстрый волт выжившего (секунд) + vault-survivor-fast: 1.0 + + # Медленный волт выжившего (секунд) + vault-survivor-slow: 1.5 + + # Волт киллера (секунд) + vault-killer: 1.5 + + # Блокировка после 3 волтов подряд (секунд) + vault-block-seconds: 15 + +# Эндгейм +endgame: + # Время открытия ворот (секунд) + gate-open-seconds: 20 + + # Время до коллапса (секунд) + collapse-seconds: 120 + + # Открытие сундуков (секунд) + chest-open-seconds: 3 + +# Люк +hatch: + # Минимум живых для открытия люка + min-survivors-for-open: 1 + + # Условие: живых < починенных генераторов + require-more-gens-than-survivors: true diff --git a/bin/main/locations.yml b/bin/main/locations.yml new file mode 100644 index 0000000..d52f930 --- /dev/null +++ b/bin/main/locations.yml @@ -0,0 +1,58 @@ +# ============================================ +# Mdbd Plugin - Координаты объектов +# Устанавливайте через /dbdsetup set <тип> +# ============================================ + +# Лобби (спавн перед игрой) +lobby: + world: "world" + x: 0.0 + y: 100.0 + z: 0.0 + yaw: 0.0 + pitch: 0.0 + +# Генераторы — настраиваются через /dbdadmin create generator +# и сохраняются в data/generators.yml + +# Крюки (обычно 4-6) +hooks: [] +# Пример: +# - "world,120.5,65.0,180.5,0.0,0.0" + +# Паллеты (много) +pallets: [] +# Пример: +# - "world,110.5,64.0,190.5,0.0,0.0" + +# Окна (много) +windows: [] + +# Сундуки с лутом (3-4) +chests: [] + +# Тотемы (5) +totems: [] + +# Ворота выхода (2) +exitgates: [] + +# Спавн киллера (1 точка) +killer-spawn: [] + +# Спавны выживших (4 точки) +survivor-spawns: [] + +# ============================================ +# Команды для настройки: +# /dbdadmin create generator - Войти в режим выбора генератора (сломайте блок) +# /dbdadmin list - Список всех генераторов +# /dbdadmin remove - Удалить генератор по ID +# /dbdadmin clear - Очистить все генераторы +# /dbdsetup set hook - Установить крюк +# /dbdsetup set pallet - Установить паллет +# /dbdsetup set chest - Установить сундук +# /dbdsetup set totem - Установить тотем +# /dbdsetup set gate - Установить ворота +# /dbdsetup set lobby - Установить лобби +# ============================================ diff --git a/bin/main/messages.yml b/bin/main/messages.yml new file mode 100644 index 0000000..d866caf --- /dev/null +++ b/bin/main/messages.yml @@ -0,0 +1,119 @@ +# ============================================ +# Mdbd Plugin - Сообщения +# Поддерживаются цвета в формате &#rrggbb +# ============================================ + +# Префикс всех сообщений плагина +prefix: "&#FF6B00&l[DBD]&r " + +# Сообщения игры +game: + # Старт/конец + start: "�FF00Игра началась! Бегите от Киллера!" + end-victory-escape: "&#FFD700Выжившие сбежали! Победа!" + end-victory-killer: "&#DC143CКиллер победил!" + + # Ожидание + waiting: "&#FFFF00Ожидание игроков... (%s/%s)" + countdown: "&#FFA500До начала: %s секунд" + countdown-short: "&#FF0000%s..." + + # Роли + role-killer: "&#DC143CВы Киллер! Поймайте всех выживших." + role-survivor: "�CED1Вы Выживший! Почините генераторы и сбегите." + +# Генераторы +generator: + repair-start: "�CED1Вы начали чинить генератор..." + repair-stop: "WCEEBВы остановились." + repair-complete: "�FF00✓ Генератор активирован! (%s/%s)" + repair-progress: "&#FFD700Прогресс: %s%%" + + skillcheck-success: "�FF00Отлично! +%s%%" + skillcheck-super: "&#FFD700Великолепно! +%s%%" + skillcheck-fail: "&#FF0000✗ Провал! -%s%%" + + explosion: "&#FF4500⚠ Взрыв генератора!" + regression: "&#FF6347Генератор откатывается..." + kicked: "&#FF4500Киллер пнул генератор!" + +# Киллер +killer: + terror-near: "B0000Сердце колотится..." + terror-medium: "&#FF4500Опасно рядом..." + terror-far: "&#FFA500Киллер где-то рядом" + + chase-start: "&#FF0000⚠ Киллер преследует вас!" + chase-stop: "�FF00Вы ушли от погони." + + hit: "&#DC143CВы ранены! Ищите укрытие!" + down: "B0000Вы в нокдауне! Ползите!" + pickup: "󃕐Киллер поднял вас..." + hook: "B0082Вас повесили на крюк!" + +# Выжившие +survivor: + heal-self-start: "�FA9AЛечите себя..." + heal-self-complete: "�FF00Вылечены!" + heal-other-start: "�FA9AЛечите союзника..." + heal-other-complete: "�FF00Союзник вылечен!" + heal-interrupt: "&#FFD700Лечение прервано!" + + sprint-exhausted: "&#FF8C00Вы устали... (Истощение)" + sprint-ready: "�FF00Можно бежать!" + + pallet-drop: "&#DEB887Вы бросили паллет!" + pallet-stun: "&#FFD700Киллер оглушён! Уходите!" + + vault-fast: "�CED1Быстрый прыжок!" + vault-slow: "WCEEBМедленный прыжок..." + + rescue-start: "�CED1Спасаете с крюка..." + rescue-complete: "�FF00Союзник спасён!" + +# Крюки +hook: + stage1: "&#FFFF00Крюк: Фаза 1 — Не двигайтесь" + stage2: "&#FFA500Крюк: Фаза 2 — БОРИТЕСЬ!" + struggle-success: "�FF00Успех! Держитесь!" + struggle-fail: "&#FF0000Провал! Этап ускорен!" + sacrifice: "B0000☠ Вы жертвованы..." + +# Предметы +item: + found: "&#FFD700Найдено: %s" + + medkit-use: "�FA9AИспользуете аптечку..." + medkit-depleted: "&#FF6347Аптечка закончилась" + + flashlight-blind: "&#FFFF00Ослепили киллера! Уходите!" + flashlight-depleted: "&#FF6347Батарейка села" + + key-hatch: "�CED1Ключ открывает люк!" + map-reveal: "WCEEBОбъекты показаны на карте" + + chest-opening: "&#FFD700Открываете сундук..." + chest-found: "�FF00Нашли: %s" + +# Эндгейм +endgame: + gates-powered: "�FF00Ворота запитаны! Бегите!" + gates-opening: "&#FFD700Открываете ворота..." + + hatch-open: "B0082Люк открыт! Сбегите!" + hatch-escape: "�FF00✓ Вы сбежали через люк!" + + collapse-warning: "&#FF0000⚠ КОЛЛАПС ЧЕРЕЗ %s СЕК!" + collapse-start: "B0000КОЛЛАПС НАЧАЛСЯ! БЕГИТЕ!" + + escape: "�FF00✓ ПОБЕГ!" + +# Ошибки +error: + no-permission: "&#FF0000У вас нет прав!" + not-in-game: "&#FF6347Вы не в игре!" + already-in-game: "&#FF6347Вы уже в игре!" + game-full: "&#FF6347Игра заполнена!" + no-game: "&#FF6347Нет активной игры!" + not-survivor: "&#FF6347Только для выживших!" + not-killer: "&#FF6347Только для киллера!" diff --git a/bin/main/plugin.yml b/bin/main/plugin.yml new file mode 100644 index 0000000..2e11e04 --- /dev/null +++ b/bin/main/plugin.yml @@ -0,0 +1,26 @@ +name: Mdbd +version: '${version}' +main: dev.loki.mdbd +api-version: '1.21' + +commands: + dbd: + description: "Main DBD command" + usage: "/dbd " + permission: mdbd.player + dbdsetup: + description: "Map setup commands" + usage: "/dbdsetup " + permission: mdbd.admin + dbdadmin: + description: "Admin commands for generators and objects" + usage: "/dbdadmin " + permission: mdbd.admin + +permissions: + mdbd.admin: + description: "Full access to admin commands" + default: op + mdbd.player: + description: "Basic player commands" + default: true diff --git a/bin/main/skillcheck.yml b/bin/main/skillcheck.yml new file mode 100644 index 0000000..74cde8e --- /dev/null +++ b/bin/main/skillcheck.yml @@ -0,0 +1,120 @@ +# ============================================ +# Mdbd Plugin - Настройки Skill Check (QTE) +# ============================================ + +# Цвета в формате &#rrggbb +colors: + # Зона успеха (зелёная) + zone-success: "�FF00" + + # Зона супер-успеха (золотая, бонус) + zone-super: "&#FFD700" + + # Стрелка (белая) + arrow: "&#FFFFFF" + + # Фон трека (тёмно-серый) + background: "񑘕" + + # Текст титра (жёлтый) + text-title: "&#FFFF00" + + # Подзаголовок (белый) + text-subtitle: "&#FFFFFF" + + # Цвет провала (красный) + fail: "&#FF0000" + +# Размеры зон (в градусах) +zones: + # Зона обычного успеха (±градусов от цели) + success-size: 15 + + # Зона супер-успеха (меньше = сложнее) + super-size: 5 + +# Вращение +rotation: + # Скорость вращения (оборотов в секунду) + speed: 3.0 + + # Направление: CLOCKWISE или COUNTER_CLOCKWISE + direction: "CLOCKWISE" + + # Случайное направление для каждого скиллчека + variation: true + + # Случайная начальная позиция + random-start: true + +# Тайминги +timing: + # Минимальный интервал между скиллчеками (в тиках, 20 = 1 сек) + min-interval: 80 + + # Максимальный интервал (в тиках) + max-interval: 200 + + # Время на реакцию (тиков после входа в зону) + reaction-window: 20 + + # Задержка перед показом скиллчека (тиков) + pre-delay: 5 + +# Награды и штрафы (в процентах от прогресса) +rewards: + # Обычный успех: +% к прогрессу + success-bonus: 5.0 + + # Супер-успех: +% к прогрессу + super-bonus: 10.0 + +penalties: + # Провал: -% от прогресса + fail-penalty: 10.0 + + # Радиус алерта киллера при провале (блоков) + fail-alert-range: 16 + + # Визуальный взрыв при провале + fail-explosion: true + + # Громкость звука взрыва (0.0 - 1.0) + explosion-volume: 0.8 + +# Визуальные эффекты +visual: + # Показывать трек движения + show-track: true + + # Показывать стрелку + show-arrow: true + + # Анимация при успехе + flash-on-success: true + + # Тряска экрана при провале + screenshake-on-fail: true + + # Альтернативный режим через BossBar (вместо Title) + use-boss-bar: false + +# Звуки +sounds: + # Звук при появлении скиллчека + appear: "BLOCK_NOTE_BLOCK_PLING" + appear-volume: 0.5 + + # Звук успеха + success: "ENTITY_PLAYER_LEVELUP" + success-volume: 0.6 + + # Звук супер-успеха + super: "ENTITY_PLAYER_LEVELUP" + super-volume: 1.0 + super-pitch: 1.5 + + # Звук провала + fail: "BLOCK_ANVIL_LAND" + fail-volume: 0.8 + fail-pitch: 0.8 diff --git a/src/main/java/dev/loki/item/ChestLoot.java b/src/main/java/dev/loki/item/ChestLoot.java index 7219825..0d15efb 100644 --- a/src/main/java/dev/loki/item/ChestLoot.java +++ b/src/main/java/dev/loki/item/ChestLoot.java @@ -13,14 +13,12 @@ public class ChestLoot { this.random = ThreadLocalRandom.current(); } - /** Roll a random item with weighted probabilities. */ + /** 55% медкит, 45% фонарик. Заряды чуть рандомные. */ public ItemStack rollLoot() { - int roll = random.nextInt(100); - - if (roll < 30) return DBDItems.medkit(12 + random.nextInt(5)); // 30% - if (roll < 55) return DBDItems.flashlight(6 + random.nextInt(4)); // 25% - if (roll < 80) return DBDItems.toolbox(10 + random.nextInt(7)); // 25% - if (roll < 92) return DBDItems.key(24 + random.nextInt(9)); // 12% - return DBDItems.map(8 + random.nextInt(9)); // 8% + if (random.nextInt(100) < 55) { + return DBDItems.medkit(12 + random.nextInt(5)); + } else { + return DBDItems.flashlight(6 + random.nextInt(3)); + } } } diff --git a/src/main/java/dev/loki/item/DBDItems.java b/src/main/java/dev/loki/item/DBDItems.java index 171f002..eb68449 100644 --- a/src/main/java/dev/loki/item/DBDItems.java +++ b/src/main/java/dev/loki/item/DBDItems.java @@ -10,8 +10,8 @@ import org.bukkit.persistence.PersistentDataType; import java.util.List; /** - * Central factory for all DBD custom items. - * Items are identified by a PersistentDataContainer tag "mdbd:item_type". + * Central factory for DBD custom items: Medkit and Flashlight. + * Items are identified by PersistentDataContainer tag "mdbd:item_type". * Charges are stored as "mdbd:charges". */ public final class DBDItems { @@ -31,7 +31,7 @@ public final class DBDItems { charges, ItemType.MEDKIT.getDefaultCharges(), List.of( "Лечит одно состояние здоровья.", - "ПКМ — начать лечение" + "ПКМ — начать самолечение" ), "MEDKIT" ); @@ -55,54 +55,6 @@ public final class DBDItems { public static ItemStack flashlight() { return flashlight(ItemType.FLASHLIGHT.getDefaultCharges()); } - /** Ящик с инструментами — ускоряет ремонт генератора. */ - public static ItemStack toolbox(int charges) { - return build( - Material.CHEST, - "<#00CED1>Ящик с инструментами", - charges, ItemType.TOOLBOX.getDefaultCharges(), - List.of( - "Ускоряет ремонт генераторов.", - "Держите в руке во время ремонта" - ), - "TOOLBOX" - ); - } - - public static ItemStack toolbox() { return toolbox(ItemType.TOOLBOX.getDefaultCharges()); } - - /** Ключ — открывает люк (hatch). */ - public static ItemStack key(int charges) { - return build( - Material.TRIPWIRE_HOOK, - "<#FFA500>Ключ", - charges, ItemType.KEY.getDefaultCharges(), - List.of( - "Открывает люк немедленно.", - "ПКМ у люка — открыть" - ), - "KEY" - ); - } - - public static ItemStack key() { return key(ItemType.KEY.getDefaultCharges()); } - - /** Карта — показывает объекты на карте. */ - public static ItemStack map(int charges) { - return build( - Material.MAP, - "<#87CEEB>Карта", - charges, ItemType.MAP.getDefaultCharges(), - List.of( - "Раскрывает объекты поблизости.", - "ПКМ — активировать" - ), - "MAP" - ); - } - - public static ItemStack map() { return map(ItemType.MAP.getDefaultCharges()); } - // ── Helpers ─────────────────────────────────────────────────────────────── private static ItemStack build(Material mat, String name, int charges, int maxCharges, @@ -111,7 +63,6 @@ public final class DBDItems { item.editMeta(meta -> { meta.displayName(TextUtil.color(name)); - // Build lore: description lines + charges bar var lore = new java.util.ArrayList(); for (String line : loreLines) { lore.add(TextUtil.color(line)); @@ -148,51 +99,18 @@ public final class DBDItems { return c != null ? c : 0; } - /** Обновить заряды на существующем предмете и вернуть обновлённый стак. */ public static ItemStack setCharges(ItemStack item, int newCharges) { if (item == null || !item.hasItemMeta()) return item; String type = getType(item); if (type == null) return item; - int max = getMaxCharges(type); - return build(item.getType(), - getDisplayNameRaw(type), newCharges, max, - getLoreRaw(type), type); + return switch (type) { + case "MEDKIT" -> medkit(newCharges); + case "FLASHLIGHT" -> flashlight(newCharges); + default -> item; + }; } public static boolean isMedkit(ItemStack item) { return "MEDKIT".equals(getType(item)); } public static boolean isFlashlight(ItemStack item) { return "FLASHLIGHT".equals(getType(item)); } - public static boolean isToolbox(ItemStack item) { return "TOOLBOX".equals(getType(item)); } - public static boolean isKey(ItemStack item) { return "KEY".equals(getType(item)); } - public static boolean isMap(ItemStack item) { return "MAP".equals(getType(item)); } public static boolean isDBDItem(ItemStack item) { return getType(item) != null; } - - private static int getMaxCharges(String type) { - return switch (type) { - case "MEDKIT" -> ItemType.MEDKIT.getDefaultCharges(); - case "FLASHLIGHT" -> ItemType.FLASHLIGHT.getDefaultCharges(); - case "TOOLBOX" -> ItemType.TOOLBOX.getDefaultCharges(); - case "KEY" -> ItemType.KEY.getDefaultCharges(); - default -> ItemType.MAP.getDefaultCharges(); - }; - } - - private static String getDisplayNameRaw(String type) { - return switch (type) { - case "MEDKIT" -> "<#00FF7F>Медкит"; - case "FLASHLIGHT" -> "<#FFD700>Фонарик"; - case "TOOLBOX" -> "<#00CED1>Ящик с инструментами"; - case "KEY" -> "<#FFA500>Ключ"; - default -> "<#87CEEB>Карта"; - }; - } - - private static List getLoreRaw(String type) { - return switch (type) { - case "MEDKIT" -> List.of("Лечит одно состояние здоровья.", "ПКМ — начать лечение"); - case "FLASHLIGHT" -> List.of("Ослепляет киллера при попадании.", "ПКМ — направить луч на киллера"); - case "TOOLBOX" -> List.of("Ускоряет ремонт генераторов.", "Держите в руке во время ремонта"); - case "KEY" -> List.of("Открывает люк немедленно.", "ПКМ у люка — открыть"); - default -> List.of("Раскрывает объекты поблизости.", "ПКМ — активировать"); - }; - } } diff --git a/src/main/java/dev/loki/item/ItemKey.java b/src/main/java/dev/loki/item/ItemKey.java deleted file mode 100644 index 1737c3e..0000000 --- a/src/main/java/dev/loki/item/ItemKey.java +++ /dev/null @@ -1,96 +0,0 @@ -package dev.loki.item; - -import org.bukkit.Material; -import org.bukkit.NamespacedKey; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.ItemMeta; -import org.bukkit.persistence.PersistentDataContainer; -import org.bukkit.persistence.PersistentDataType; - -import java.util.Arrays; - -public class ItemKey implements BaseItem { - - private static final NamespacedKey ITEM_KEY = new NamespacedKey("mdbd", "item_type"); - private static final NamespacedKey CHARGES_KEY = new NamespacedKey("mdbd", "charges"); - - private final int charges; - - public ItemKey() { - this(ItemType.KEY.getDefaultCharges()); - } - - public ItemKey(int charges) { - this.charges = charges; - } - - @Override - public ItemType getType() { - return ItemType.KEY; - } - - @Override - public ItemStack createItemStack() { - ItemStack item = new ItemStack(Material.TRIPWIRE_HOOK); - ItemMeta meta = item.getItemMeta(); - if (meta != null) { - meta.setDisplayName("§6" + getType().getDisplayName()); - meta.setLore(Arrays.asList( - "§7" + getType().getDescription(), - "§eCharges: §f" + charges + "/" + getType().getDefaultCharges(), - "§7Opens the Hatch instantly" - )); - - PersistentDataContainer pdc = meta.getPersistentDataContainer(); - pdc.set(ITEM_KEY, PersistentDataType.STRING, getItemId()); - pdc.set(CHARGES_KEY, PersistentDataType.INTEGER, charges); - - item.setItemMeta(meta); - } - return item; - } - - @Override - public boolean canUse(Player player) { - return charges > 0; - } - - @Override - public void onUse(Player player) { - if (charges > 0) { - player.sendMessage("§6You use the Key on the Hatch..."); - } - } - - @Override - public void onDeplete(Player player) { - player.getInventory().setItemInMainHand(null); - player.sendMessage("§cYour key breaks!"); - } - - @Override - public int getCharges() { - return charges; - } - - @Override - public void setCharges(int charges) { - } - - @Override - public boolean isDepleted() { - return charges <= 0; - } - - @Override - public String getItemId() { - return "KEY"; - } - - public static boolean isKey(ItemStack item) { - if (item == null || !item.hasItemMeta()) return false; - PersistentDataContainer pdc = item.getItemMeta().getPersistentDataContainer(); - return "KEY".equals(pdc.get(ITEM_KEY, PersistentDataType.STRING)); - } -} diff --git a/src/main/java/dev/loki/item/ItemMap.java b/src/main/java/dev/loki/item/ItemMap.java deleted file mode 100644 index f099f5d..0000000 --- a/src/main/java/dev/loki/item/ItemMap.java +++ /dev/null @@ -1,96 +0,0 @@ -package dev.loki.item; - -import org.bukkit.Material; -import org.bukkit.NamespacedKey; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.ItemMeta; -import org.bukkit.persistence.PersistentDataContainer; -import org.bukkit.persistence.PersistentDataType; - -import java.util.Arrays; - -public class ItemMap implements BaseItem { - - private static final NamespacedKey ITEM_KEY = new NamespacedKey("mdbd", "item_type"); - private static final NamespacedKey CHARGES_KEY = new NamespacedKey("mdbd", "charges"); - - private final int charges; - - public ItemMap() { - this(ItemType.MAP.getDefaultCharges()); - } - - public ItemMap(int charges) { - this.charges = charges; - } - - @Override - public ItemType getType() { - return ItemType.MAP; - } - - @Override - public ItemStack createItemStack() { - ItemStack item = new ItemStack(Material.MAP); - ItemMeta meta = item.getItemMeta(); - if (meta != null) { - meta.setDisplayName("§d" + getType().getDisplayName()); - meta.setLore(Arrays.asList( - "§7" + getType().getDescription(), - "§eCharges: §f" + charges + "/" + getType().getDefaultCharges(), - "§7Right-click to reveal generators" - )); - - PersistentDataContainer pdc = meta.getPersistentDataContainer(); - pdc.set(ITEM_KEY, PersistentDataType.STRING, getItemId()); - pdc.set(CHARGES_KEY, PersistentDataType.INTEGER, charges); - - item.setItemMeta(meta); - } - return item; - } - - @Override - public boolean canUse(Player player) { - return charges > 0; - } - - @Override - public void onUse(Player player) { - if (charges > 0) { - player.sendMessage("§dThe Map reveals nearby generators!"); - } - } - - @Override - public void onDeplete(Player player) { - player.getInventory().setItemInMainHand(null); - player.sendMessage("§cYour map has faded!"); - } - - @Override - public int getCharges() { - return charges; - } - - @Override - public void setCharges(int charges) { - } - - @Override - public boolean isDepleted() { - return charges <= 0; - } - - @Override - public String getItemId() { - return "MAP"; - } - - public static boolean isMap(ItemStack item) { - if (item == null || !item.hasItemMeta()) return false; - PersistentDataContainer pdc = item.getItemMeta().getPersistentDataContainer(); - return "MAP".equals(pdc.get(ITEM_KEY, PersistentDataType.STRING)); - } -} diff --git a/src/main/java/dev/loki/item/ItemToolbox.java b/src/main/java/dev/loki/item/ItemToolbox.java deleted file mode 100644 index 8d86a2e..0000000 --- a/src/main/java/dev/loki/item/ItemToolbox.java +++ /dev/null @@ -1,98 +0,0 @@ -package dev.loki.item; - -import org.bukkit.Material; -import org.bukkit.NamespacedKey; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.ItemMeta; -import org.bukkit.persistence.PersistentDataContainer; -import org.bukkit.persistence.PersistentDataType; - -import java.util.Arrays; - -public class ItemToolbox implements BaseItem { - - private static final NamespacedKey ITEM_KEY = new NamespacedKey("mdbd", "item_type"); - private static final NamespacedKey CHARGES_KEY = new NamespacedKey("mdbd", "charges"); - - private final int charges; - - public ItemToolbox() { - this(ItemType.TOOLBOX.getDefaultCharges()); - } - - public ItemToolbox(int charges) { - this.charges = charges; - } - - @Override - public ItemType getType() { - return ItemType.TOOLBOX; - } - - @Override - public ItemStack createItemStack() { - ItemStack item = new ItemStack(Material.CHEST); - ItemMeta meta = item.getItemMeta(); - if (meta != null) { - meta.setDisplayName("§b" + getType().getDisplayName()); - meta.setLore(Arrays.asList( - "§7" + getType().getDescription(), - "§eCharges: §f" + charges + "/" + getType().getDefaultCharges(), - "§7Hold while repairing for bonus speed" - )); - - PersistentDataContainer pdc = meta.getPersistentDataContainer(); - pdc.set(ITEM_KEY, PersistentDataType.STRING, getItemId()); - pdc.set(CHARGES_KEY, PersistentDataType.INTEGER, charges); - - item.setItemMeta(meta); - } - return item; - } - - @Override - public boolean canUse(Player player) { - return charges > 0; - } - - @Override - public void onUse(Player player) { - player.sendMessage("§bYour toolbox speeds up the repair!"); - } - - @Override - public void onDeplete(Player player) { - player.getInventory().setItemInMainHand(null); - player.sendMessage("§cYour toolbox is empty!"); - } - - @Override - public int getCharges() { - return charges; - } - - @Override - public void setCharges(int charges) { - } - - @Override - public boolean isDepleted() { - return charges <= 0; - } - - @Override - public String getItemId() { - return "TOOLBOX"; - } - - public static boolean isToolbox(ItemStack item) { - if (item == null || !item.hasItemMeta()) return false; - PersistentDataContainer pdc = item.getItemMeta().getPersistentDataContainer(); - return "TOOLBOX".equals(pdc.get(ITEM_KEY, PersistentDataType.STRING)); - } - - public static double getRepairBonus() { - return 0.15; - } -} diff --git a/src/main/java/dev/loki/item/ItemType.java b/src/main/java/dev/loki/item/ItemType.java index c18e593..e3a7986 100644 --- a/src/main/java/dev/loki/item/ItemType.java +++ b/src/main/java/dev/loki/item/ItemType.java @@ -2,10 +2,7 @@ package dev.loki.item; public enum ItemType { MEDKIT("Medkit", "Heals one health state", 16), - FLASHLIGHT("Flashlight", "Blinds the Killer", 8), - TOOLBOX("Toolbox", "Speeds up repairs", 16), - KEY("Key", "Opens the Hatch", 32), - MAP("Map", "Reveals objectives", 16); + FLASHLIGHT("Flashlight", "Blinds the Killer", 8); private final String displayName; private final String description; @@ -17,15 +14,7 @@ public enum ItemType { this.defaultCharges = defaultCharges; } - public String getDisplayName() { - return displayName; - } - - public String getDescription() { - return description; - } - - public int getDefaultCharges() { - return defaultCharges; - } + public String getDisplayName() { return displayName; } + public String getDescription() { return description; } + public int getDefaultCharges() { return defaultCharges; } } diff --git a/src/main/java/dev/loki/item/ItemUseListener.java b/src/main/java/dev/loki/item/ItemUseListener.java index fb9f891..e78dc82 100644 --- a/src/main/java/dev/loki/item/ItemUseListener.java +++ b/src/main/java/dev/loki/item/ItemUseListener.java @@ -27,14 +27,13 @@ import java.util.Map; import java.util.UUID; /** - * Handles right-click usage of DBD custom items during gameplay. + * Handles right-click usage of DBD custom items (Medkit, Flashlight) during gameplay. */ public class ItemUseListener implements Listener { private final Plugin plugin; private final GameSession session; - // Medkit heal: survivor UUID → task private final Map activeHeals = new HashMap<>(); private static final int MEDKIT_TICKS = 160; // 8 seconds @@ -68,33 +67,28 @@ public class ItemUseListener implements Listener { ItemStack hand = player.getInventory().getItemInMainHand(); if (!DBDItems.isDBDItem(hand)) return; + event.setCancelled(true); + String type = DBDItems.getType(hand); - if (type == null) return; - - event.setCancelled(true); // prevent block interaction - - switch (type) { - case "MEDKIT" -> useMedkit(player, (Survivor) bp, hand); - case "FLASHLIGHT" -> useFlashlight(player, hand); - case "TOOLBOX" -> { /* passive — handled in repair */ } - case "KEY" -> useKey(player, (Survivor) bp, hand); - case "MAP" -> useMap(player, hand); + if ("MEDKIT".equals(type)) { + useMedkit(player, (Survivor) bp, hand); + } else if ("FLASHLIGHT".equals(type)) { + useFlashlight(player, hand); } } - // ── Medkit ─────────────────────────────────────────────────────────────── + // ── Медкит ──────────────────────────────────────────────────────────────── private void useMedkit(Player player, Survivor survivor, ItemStack item) { UUID uuid = player.getUniqueId(); - // Toggle: if already healing, cancel + // Повторный ПКМ — отмена лечения if (activeHeals.containsKey(uuid)) { cancelHeal(player); return; } - PlayerState state = survivor.getState(); - if (state != PlayerState.INJURED) { + if (survivor.getState() != PlayerState.INJURED) { player.sendMessage(Component.text("Вы не ранены!", NamedTextColor.RED)); return; } @@ -106,11 +100,10 @@ public class ItemUseListener implements Listener { } player.sendMessage(Component.text("Начинаете самолечение...", NamedTextColor.GREEN)); - player.sendActionBar(Component.text("⚕ Самолечение...", NamedTextColor.GREEN)); BukkitTask task = new BukkitRunnable() { int ticks = 0; - int chargesLeft = charges; + final int startCharges = charges; @Override public void run() { @@ -121,29 +114,40 @@ public class ItemUseListener implements Listener { } ticks++; - chargesLeft = Math.max(0, charges - ticks); - // Update action bar progress - int filled = (int)(8.0 * ticks / MEDKIT_TICKS); + // Прогресс в action bar + int filled = (int) (8.0 * ticks / MEDKIT_TICKS); int empty = 8 - filled; + int pct = (int) (100.0 * ticks / MEDKIT_TICKS); player.sendActionBar(Component.text( - "⚕ " + "█".repeat(filled) + "░".repeat(empty) + - " " + (int)(100.0 * ticks / MEDKIT_TICKS) + "%", + "⚕ " + "█".repeat(filled) + "░".repeat(empty) + " " + pct + "%", NamedTextColor.GREEN)); - // Use 1 charge per 10 ticks - if (ticks % 10 == 0) { - updateItemCharges(player, chargesLeft); - player.playSound(player.getLocation(), Sound.ENTITY_PLAYER_HURT, 0.2f, 1.5f); + // Звук каждые 20 тиков + if (ticks % 20 == 0) { + player.playSound(player.getLocation(), Sound.ENTITY_PLAYER_HURT, 0.15f, 1.8f); + // Обновляем заряды на предмете + int usedCharges = (int)(1.0 * ticks / MEDKIT_TICKS * startCharges); + int remaining = Math.max(1, startCharges - usedCharges); + player.getInventory().setItemInMainHand(DBDItems.setCharges( + player.getInventory().getItemInMainHand(), remaining)); } if (ticks >= MEDKIT_TICKS) { - // Heal done survivor.setState(PlayerState.HEALTHY); player.sendMessage(Component.text("✔ Вы вылечились!", NamedTextColor.GREEN)); player.sendActionBar(Component.empty()); - player.playSound(player.getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 0.5f, 1.5f); - updateItemCharges(player, Math.max(0, charges - MEDKIT_TICKS / 10)); + player.playSound(player.getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 0.6f, 1.5f); + + // Тратим заряды + int remaining = startCharges - 8; + if (remaining <= 0) { + player.getInventory().setItemInMainHand(null); + player.sendMessage(Component.text("Медкит израсходован.", NamedTextColor.RED)); + } else { + player.getInventory().setItemInMainHand(DBDItems.medkit(remaining)); + } + activeHeals.remove(uuid); cancel(); } @@ -162,7 +166,7 @@ public class ItemUseListener implements Listener { } } - // ── Flashlight ──────────────────────────────────────────────────────────── + // ── Фонарик ─────────────────────────────────────────────────────────────── private void useFlashlight(Player player, ItemStack item) { int charges = DBDItems.getCharges(item); @@ -171,7 +175,7 @@ public class ItemUseListener implements Listener { return; } - // Ray-trace to find killer within 15 blocks + // Луч 15 блоков var result = player.getWorld().rayTraceEntities( player.getEyeLocation(), player.getEyeLocation().getDirection(), @@ -184,10 +188,10 @@ public class ItemUseListener implements Listener { BasePlayer bp = session.getPlayer(target.getUniqueId()); if (bp != null && bp.isKiller()) { target.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 60, 1, false, false)); - target.addPotionEffect(new PotionEffect(PotionEffectType.SLOWNESS, 60, 3, false, false)); + target.addPotionEffect(new PotionEffect(PotionEffectType.SLOWNESS, 50, 2, false, false)); target.playSound(target.getLocation(), Sound.ENTITY_BLAZE_HURT, 1.0f, 0.5f); - player.sendMessage(Component.text("✔ Ослепили киллера!", NamedTextColor.YELLOW)); target.sendMessage(Component.text("☀ Вас ослепили фонариком!", NamedTextColor.YELLOW)); + player.sendMessage(Component.text("✔ Ослепили киллера!", NamedTextColor.YELLOW)); hitKiller = true; } } @@ -196,69 +200,15 @@ public class ItemUseListener implements Listener { player.sendMessage(Component.text("Мимо...", NamedTextColor.GRAY)); } - // Spend 1 charge per use - updateItemCharges(player, charges - 1); + // 1 заряд за использование + int remaining = charges - 1; + if (remaining <= 0) { + player.getInventory().setItemInMainHand(null); + player.sendMessage(Component.text("Фонарик разрядился.", NamedTextColor.RED)); + } else { + player.getInventory().setItemInMainHand(DBDItems.flashlight(remaining)); + } + player.playSound(player.getLocation(), Sound.BLOCK_REDSTONE_TORCH_BURNOUT, 0.3f, 1.5f); } - - // ── Key ─────────────────────────────────────────────────────────────────── - - private void useKey(Player player, Survivor survivor, ItemStack item) { - int charges = DBDItems.getCharges(item); - if (charges <= 0) { - player.sendMessage(Component.text("Ключ сломан!", NamedTextColor.RED)); - return; - } - // Actual hatch opening logic is handled by hatch system - // This just plays the animation and spends a charge - player.sendMessage(Component.text("Вы используете ключ...", NamedTextColor.GOLD)); - player.playSound(player.getLocation(), Sound.BLOCK_IRON_DOOR_OPEN, 1.0f, 0.8f); - updateItemCharges(player, charges - 1); - } - - // ── Map ─────────────────────────────────────────────────────────────────── - - private void useMap(Player player, ItemStack item) { - int charges = DBDItems.getCharges(item); - if (charges <= 0) { - player.sendMessage(Component.text("Карта использована!", NamedTextColor.RED)); - return; - } - - // Show nearby generators / hooks in chat - player.sendMessage(Component.text("═══ Карта (ближайшие объекты) ═══", NamedTextColor.AQUA)); - - var genManager = session.getGeneratorManager(); - if (genManager != null) { - genManager.getIncompleteGenerators().stream() - .filter(g -> g.getLocation().getWorld().equals(player.getWorld())) - .sorted((a, b) -> Double.compare( - a.getLocation().distance(player.getLocation()), - b.getLocation().distance(player.getLocation()))) - .limit(3) - .forEach(g -> { - int dist = (int) g.getLocation().distance(player.getLocation()); - player.sendMessage(Component.text( - " ⚙ Генератор [" + (int)g.getProgress() + "%] — " + dist + " блоков", - NamedTextColor.YELLOW)); - }); - } - - updateItemCharges(player, charges - 1); - player.playSound(player.getLocation(), Sound.ITEM_ARMOR_EQUIP_LEATHER, 0.5f, 1.0f); - } - - // ── Utils ───────────────────────────────────────────────────────────────── - - private void updateItemCharges(Player player, int newCharges) { - ItemStack item = player.getInventory().getItemInMainHand(); - if (!DBDItems.isDBDItem(item)) return; - - if (newCharges <= 0) { - player.getInventory().setItemInMainHand(null); - player.sendMessage(Component.text("Предмет израсходован.", NamedTextColor.RED)); - } else { - player.getInventory().setItemInMainHand(DBDItems.setCharges(item, newCharges)); - } - } }