Mood Swings
Mood Swings 是 Wathe: Murder Mystery 的非官方 Fabric 插件,添加了数据驱动的“情绪”任务、可复用的任务区域、专用的封锁区域、独立的 OST(原声带)区域、环境击杀判定以及可配置的封锁能力,同时保留了 Wathe 原有的 HUD 语言和行为。
依赖项
- Minecraft 1.21.1
- Fabric Loader 0.18.4+
- Fabric API 0.116.14+1.21.1+
- Wathe 1.3.2-1.21.1
- Cloth Config API 15.0.140+
- Java 21
- Mod Menu 为可选安装
请同时在服务器和所有客户端上安装。
包含的任务
内置的八个任务均为普通的 JSON 定义:
mood_swings:take_a_shower
mood_swings:socialize
mood_swings:gym
mood_swings:strange_noise
mood_swings:walk
mood_swings:rooftop
mood_swings:toilet
mood_swings:murder(仅限杀手,稀有事件,阻断被动收入,加剧震动/心跳/暗角效果,随后禁用本能和疾跑功能,并在两分钟后随机切换选中的快捷栏槽位;感官效果在完成消退)
它们位于 src/main/resources/data/mood_swings/mood_swings/tasks/ 目录下,可以通过数据包进行覆盖或补充。请参阅 docs/TASK_DEFINITIONS.md,复制 docs/TASK_TEMPLATE.json,并使用内置的 JSON Schema 进行编辑器验证。
命名区域
/moodswings area pos1
/moodswings area pos2
/moodswings area save gym
区域边框现在变为持久的客户端线框,而非一次性角落粒子:
/moodswings area show gym
/moodswings area show all
/moodswings area hide gym
/moodswings area hide all
边框包裹完整的包含性方块立方体,在隐藏之前或客户端断开连接之前保持可见,并且仅对执行命令的用户显示。每个客户端可以在五分类的 Cloth Config 界面中自定义自己的边框颜色和透明度。
其他区域命令:
/moodswings area list
/moodswings area info gym
/moodswings area remove gym
OST 区域
OST 区域是一个完全独立的循环地图环境音区域系统。它们从不算作任务区域,也不能被情绪任务选中。
它们的播放使用 Minecraft 的主音量(Master)声音类别,而每个区域仍保留其各自的可配置音量。
/moodswings ostarea pos1
/moodswings ostarea pos2
/moodswings ostarea save main_gallery mood_swings:museum_gallery
每个区域存储其自身的音效事件 ID、音量、重叠优先级、淡入淡出持续时间、风感相机晃动以及可选的世界变暗效果:
/moodswings ostarea sound main_gallery mood_swings:museum_gallery_night
/moodswings ostarea volume main_gallery 0.65
/moodswings ostarea priority main_gallery 10
/moodswings ostarea fade main_gallery 3.5
/moodswings ostarea shake main_gallery 0.20
/moodswings ostarea darkness main_gallery 0.35
/moodswings ostarea info main_gallery
/moodswings ostarea list
相机晃动和世界变暗均使用归一化的 0.0 到 1.0 设置。晃动是平滑且阵风式的,而非抖动。变暗效果在 Minecraft 渲染 HUD 之前绘制在 3D 世界之上,因此快捷栏、聊天、背包和其他 GUI 屏幕保持清晰。这两种效果都使用该区域的音频淡入淡出持续时间进行消退。
当区域重叠时,优先级最高的生效。优先级相同时,优先选择较小的立方体,这使得在广阔地图环境音区域内放置特定房间曲目变得容易。当前维度中使用过的每个唯一 OST 曲目初始状态下都属于同步播放池的一部分,并在超出其选定区域静音时继续推进。因此,区域变化会在已运行的流之间交叉淡入淡出音量,而不是重新启动任一曲目。区域检查由服务器权威控制,并在死亡、旁观、维度变更、断开连接、删除或禁用该功能时清理播放池。
OST 区域拥有自己的本地边框命令和按保存启用的设置:
/moodswings ostarea show main_gallery
/moodswings ostarea show all
/moodswings ostarea hide main_gallery
/moodswings ostarea hide all
/moodswings ostarea enable
/moodswings ostarea disable
有关音频文件注册,请参阅 docs/OST_AREAS.md 和 docs/OST_SOUNDS_TEMPLATE.json。
捆绑了两个流式环境音事件,随时可以分配:
mood_swings:hotel.outside
mood_swings:hotel.inside
捆绑的酒店配对使用了匹配的 159.05 秒无缝循环,因此这两首曲目在同步 OST 池中保持相位对齐,同时保持模组下载体积紧凑。
封锁商店系统
封锁区域选择器使用 Wathe 自己的工具商店槽位精灵、硬币符号、棕/金牌匾以及商店悬停处理,以实现原生视觉契合。
杀手可以从 Wathe 现有的商店以 $200 的价格购买封锁(Lockdown)。商店物品包含简明的能力描述,选择它会打开一个专用的区域控制屏幕,其中包含玩家当前维度中保存的所有封锁区域。选择一个区域会关闭并卡住保存的立方体内所有的 Wathe 门变体,持续 30 秒,包括通常使用 Minecraft 原版 DoorBlock 实现的金属板和驾驶舱门。成功激活后,该玩家必须等待两分钟才能再次购买封锁;在此期间不可用时,商店提示图标下方会显示 Wathe 原生的红色实时冷却倒计时。
购买过程完全由服务器权威控制:选择后会重新验证角色、运行游戏、余额、冷却时间、维度、区域、功能设置以及匹配的门。只有当至少有一扇门成功锁定后,才会扣除金钱。被炸毁的 Wathe 实体门会被忽略,且预先存在的较长开锁计时器永远不会缩短。使用蹲姿开锁也会将 Wathe 风格的临时卡死效果应用于金属板和驾驶舱门。购买失败时使用 Wathe 原始商店消息和声音。
可以为每个存档独立启用或禁用 Lockdown(锁定)功能,该设置位于 Lockdown 配置类别中。它使用专用的区域存储,且从不读取 Mood 任务区域或 OST 区域。使用以下命令创建区域:
/moodswings lockdown area pos1
/moodswings lockdown area pos2
/moodswings lockdown area save lobby
相同的命令分支还提供 list、info、remove、show、show all、hide 和 hide all 命令。Lockdown 配置标签页会列出这些区域,支持在本地勾勒其轮廓并删除它们。完整的制作参考请参阅 docs/LOCKDOWN_AREAS.md。禁用 Lockdown 会移除该存档的商店条目,但会保留已保存的 Lockdown 区域。
配置菜单
从 Mod Menu 打开 Mood Swings 即可访问五个类别:
- Tasks(任务):启用或禁用所有原生/自定义任务,并为当前存档覆盖 JSON 任务的 editable fields(可编辑字段)。
- Areas(区域):检查、重命名、删除当前存档中的每个任务区域,并可单独显示或隐藏它们。
- OST Areas(OST 区域):为存档启用或禁用环境音效,编辑每个区域的音频、音量、优先级、淡入时间以及细微屏幕震动效果,删除区域并切换其边框显示。
- Lockdown(锁定):为当前存档启用或禁用商店能力,并查看其价格、持续时间、冷却时间和区域要求。
- Appearance & Tools(外观与工具):显示或隐藏区域边框,更改其颜色/透明度,刷新存档数据,并重新加载 JSON 任务定义。
活动任务状态按玩家和维度分别存储。任务编辑内容作为每个存档的覆盖值存储。原始的数据包 JSON 保持不变,可通过任务的重置开关恢复。任务受众、小数点滚动权重、被动收入阻止、击杀计数以及方块上方检测等功能也可编辑。
按维度的活动任务
每位玩家在每個维度都有独立的活動任務狀態。当玩家切换维度时,任务本身、进度以及下一个任务的冷却时间会被交换;返回原维度时则恢复。现有的全局任务 NBT 会被迁移到玩家首次加载该任务的维度中。
任务的启用/禁用控制和 JSON 覆盖设置仍由存档共享。
按存档的任务控制
/moodswings task list
/moodswings task disable outside
/moodswings task disable mood_swings:gym
/moodswings task enable mood_swings:gym
特定于存档的任务区域、OST 区域、已禁用的任务、任务覆盖和功能启用设置存储在:
<save>/mood_swings/settings.json
测试与重载
/moodswings task force mood_swings:take_a_shower
/moodswings task force mood_swings:strange_noise
/moodswings task clear
/moodswings task clear <player>
/moodswings reload
原版 /reload 也会重新加载任务数据包。活动任务会保留其定义的序列化快照,因此在任务进行期间,HUD 文本和完成规则保持稳定。
构建
安装 Java 21,解压项目,然后运行 BUILD.bat。生成的 JAR 文件出现在 dist/ 目录中。
公共 API 接口
- 模组 ID / 注册表命名空间:
mood_swings
- Java 包:
net.ceziak.mood_swings
- 任务资源目录:
data/<namespace>/mood_swings/tasks/
- 许可证:MIT
升级
将新版本发布中的所有文件复制到旧项目中,并替换现有文件。该项目保留了用于过时 1.0.x 硬编码任务源的兼容性占位符,防止过时的 Java 文件破坏已升级的仓库。
扩展的环境击杀奖励
Mood Swings 会保留最后一名成功的玩家攻击者 30 秒。如果受害者在窗口期内被 Wathe 消灭且未提供明确的击杀者(例如在被击中后掉出游戏区域),Wathe 会将最近的攻击者视为击杀者。这保留了 Wathe 正常的击杀奖励,并完成活动的 kill_player 任务。最新的成功攻击者拥有此奖励,而明确的 Wathe 攻击者和投毒者始终优先。
基础游戏的全部功劳归于 @RAT
Mood Swings
Mood Swings is an unofficial Fabric addon for Wathe: Murder Mystery that adds data-driven mood tasks, reusable task areas, dedicated Lockdown Areas, independent OST regions, environmental kill credit, and a configurable Lockdown ability while keeping Wathe's original HUD language and behavior.
Requirements
- Minecraft 1.21.1
- Fabric Loader 0.18.4+
- Fabric API 0.116.14+1.21.1+
- Wathe 1.3.2-1.21.1
- Cloth Config API 15.0.140+
- Java 21
- Mod Menu is optional
Install it on both the server and every client.
Included tasks
The eight bundled tasks are ordinary JSON definitions:
mood_swings:take_a_shower
mood_swings:socialize
mood_swings:gym
mood_swings:strange_noise
mood_swings:walk
mood_swings:rooftop
mood_swings:toilet
mood_swings:murder (killer-only, rare, blocks passive income, escalates shake/heartbeat/vignette, then disables instinct and sprinting while randomly changing the selected hotbar slot after two minutes; sensory effects fade after completion)
They live under src/main/resources/data/mood_swings/mood_swings/tasks/ and can be overridden or supplemented by datapacks. See docs/TASK_DEFINITIONS.md, copy docs/TASK_TEMPLATE.json, and use the included JSON Schema for editor validation.
Named areas
/moodswings area pos1
/moodswings area pos2
/moodswings area save gym
Area borders are now persistent client-side wireframes rather than one-shot corner particles:
/moodswings area show gym
/moodswings area show all
/moodswings area hide gym
/moodswings area hide all
The borders wrap the complete inclusive block cuboid, remain visible until hidden or until the client disconnects, and are shown only to the command user. Each client can choose their own border color and opacity in the five-category Cloth Config screen.
Other area commands:
/moodswings area list
/moodswings area info gym
/moodswings area remove gym
OST Areas
OST Areas are a completely separate region system for looping map ambience. They never count as task areas and cannot be selected by a mood task.
Their playback uses Minecraft's Master sound category, while each region still keeps its own configurable volume.
/moodswings ostarea pos1
/moodswings ostarea pos2
/moodswings ostarea save main_gallery mood_swings:museum_gallery
Each region stores its own sound event ID, volume, overlap priority, fade duration, wind-like camera sway, and optional world darkening:
/moodswings ostarea sound main_gallery mood_swings:museum_gallery_night
/moodswings ostarea volume main_gallery 0.65
/moodswings ostarea priority main_gallery 10
/moodswings ostarea fade main_gallery 3.5
/moodswings ostarea shake main_gallery 0.20
/moodswings ostarea darkness main_gallery 0.35
/moodswings ostarea info main_gallery
/moodswings ostarea list
Camera sway and world darkening both use normalized 0.0 to 1.0 settings. The sway is smooth and gust-like rather than jittery. Darkening is drawn over the 3D world before Minecraft renders the HUD, so the hotbar, chat, inventories and other GUI screens remain clear. Both effects fade using the area's audio fade duration.
When regions overlap, the highest priority wins. Equal priorities prefer the smaller cuboid, making it easy to place a room-specific track inside a broad map ambience region. Every unique OST track used in the current dimension starts as part of a synchronized playback pool and keeps advancing while muted outside its selected region. Region changes therefore crossfade volume between already-running streams instead of restarting either track. Region checks remain server-authoritative, and the pool is cleaned up on death, spectating, dimension changes, disconnects, deletion, or disabling the feature.
OST Areas have their own local border commands and per-save enable setting:
/moodswings ostarea show main_gallery
/moodswings ostarea show all
/moodswings ostarea hide main_gallery
/moodswings ostarea hide all
/moodswings ostarea enable
/moodswings ostarea disable
See docs/OST_AREAS.md and docs/OST_SOUNDS_TEMPLATE.json for audio-file registration.
Two streamed ambience events are bundled and ready to assign:
mood_swings:hotel.outside
mood_swings:hotel.inside
The bundled hotel pair uses matching 159.05-second seamless loops, so both tracks stay phase-aligned in the synchronized OST pool while keeping the mod download compact.
Lockdown shop system
The Lockdown area picker uses Wathe's own tool-shop slot sprite, coin glyph, brown/gold plaques, and shop hover treatment for a native visual fit.
Killers can buy Lockdown from Wathe's existing shop for $200. The shop item includes a concise ability description, and selecting it opens a dedicated area-control screen containing every saved Lockdown Area in the player's current dimension. Choosing an area closes and jams every Wathe door variant inside the saved cuboid for 30 seconds, including the metal sheet and cockpit doors that normally use Minecraft's vanilla DoorBlock implementation. After a successful activation, that player must wait two minutes before purchasing Lockdown again; while it is unavailable, the shop tooltip shows Wathe's native red live cooldown countdown beneath the icon.
The purchase is fully server-authoritative: the role, running game, balance, cooldown, dimension, area, feature setting, and matching doors are revalidated after selection. Money is removed only when at least one door is successfully locked. Blasted Wathe block-entity doors are ignored and a pre-existing longer lockpick timer is never shortened. Crouch-using a lockpick also applies Wathe-style temporary jamming to the metal sheet and cockpit doors. Purchase failures use Wathe's original shop message and sound.
Lockdown can be enabled or disabled independently for each save from the Lockdown config category. It uses a dedicated region store and never reads Mood task areas or OST Areas. Create regions with:
/moodswings lockdown area pos1
/moodswings lockdown area pos2
/moodswings lockdown area save lobby
The same command branch also provides list, info, remove, show, show all, hide, and hide all. The Lockdown config tab lists these regions, can outline them locally, and can delete them. See docs/LOCKDOWN_AREAS.md for the full authoring reference. Disabling Lockdown removes the shop entry for that save while preserving the saved Lockdown Areas.
Config menu
Open Mood Swings from Mod Menu to access five categories:
- Tasks: enable or disable every native/custom task and override the editable fields of JSON tasks for the current save.
- Areas: inspect, rename, delete, and individually show or hide every task area in the current save.
- OST Areas: enable or disable ambience for the save, edit each region's sound, volume, priority, fade time, and subtle screen shake, delete regions, and toggle their borders.
- Lockdown: enable or disable the shop ability for the current save and review its price, duration, cooldown, and area requirements.
- Appearance & Tools: show or hide area borders, change their color/opacity, refresh save data, and reload JSON task definitions.
Active task state is stored per player and per dimension. Task edits are stored as per-save overrides. The original datapack JSON remains untouched and can be restored with the task's reset toggle. Task audience, decimal roll weight, passive-income blocking, kill counts, and above-block detection are editable too.
Per-dimension active tasks
Each player has a separate active task state for every dimension. The task itself, its progress, and the next-task cooldown are swapped when the player changes dimension and restored when they return. Existing global task NBT is migrated into the dimension where the player first loads it.
Task enable/disable controls and JSON overrides remain shared by the save.
Per-save task controls
/moodswings task list
/moodswings task disable outside
/moodswings task disable mood_swings:gym
/moodswings task enable mood_swings:gym
Save-specific task areas, OST Areas, disabled tasks, task overrides, and feature enable settings are stored at:
<save>/mood_swings/settings.json
Testing and reloads
/moodswings task force mood_swings:take_a_shower
/moodswings task force mood_swings:strange_noise
/moodswings task clear
/moodswings task clear <player>
/moodswings reload
Vanilla /reload also reloads task datapacks. Active tasks retain a serialized snapshot of their definition, so their HUD text and completion rules remain stable while they are in progress.
Building
Install Java 21, extract the project, then run BUILD.bat. The built JAR appears in dist/.
Public API surface
- Mod ID / registry namespace:
mood_swings
- Java package:
net.ceziak.mood_swings
- Task resource directory:
data/<namespace>/mood_swings/tasks/
- License: MIT
Upgrading
Copy every file from the new release over the old project and replace existing files. The project retains compatibility placeholders for obsolete 1.0.x hard-coded task sources, preventing stale Java files from breaking upgraded repositories.
Extended environmental kill credit
Mood Swings keeps the last successful player attacker for 30 seconds. If the victim is eliminated by Wathe during that window without a supplied killer, such as falling below the play area after being hit, Wathe receives the recent attacker as the killer. This preserves Wathe's normal killer rewards and completes active kill_player tasks. The newest successful attacker owns the credit, while explicit Wathe attackers and poisoners always take priority.
ALL CREDIT FOR THE BASE GAME GOES TO @RAT
评论 0
登录后参与评分
还没有评论,来抢沙发吧