diff --git a/Cargo.lock b/Cargo.lock
index 85a62e5..05bf84b 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -36,7 +36,7 @@ checksum = "00d174d5400e5e8fd687ad1049e2f578285fa914201b1af7e8b112a4546bd826"
[[package]]
name = "funrounds-core"
-version = "0.3.0-alpha.test.2"
+version = "0.4.0-alpha.test.3"
dependencies = [
"rand",
"serde",
@@ -45,7 +45,7 @@ dependencies = [
[[package]]
name = "funrounds-plugin"
-version = "0.3.0-alpha.test.2"
+version = "0.4.0-alpha.test.3"
dependencies = [
"funrounds-core",
"plugify",
@@ -166,9 +166,9 @@ dependencies = [
[[package]]
name = "serde_spanned"
-version = "1.1.2"
+version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4e7523beb55eece201a2356bee0bbca0d1ab466c14c07703b2e0ee6d42cb0c2c"
+checksum = "9c187e0a369471c550af028cba56d4f4fa2a489ad28151ae95a4d340a2a8b782"
dependencies = [
"serde_core",
]
@@ -186,9 +186,9 @@ dependencies = [
[[package]]
name = "toml"
-version = "1.1.8+spec-1.1.0"
+version = "1.2.1+spec-1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "20489e00e4d8741d6be680764cc12e270655e375a20d1011e844a9c3379e678d"
+checksum = "d5755c51863cdac711f1956baf8eb9588e060755f7d3c4c979e70ea1e1f32cd7"
dependencies = [
"indexmap",
"serde_core",
@@ -201,9 +201,9 @@ dependencies = [
[[package]]
name = "toml_datetime"
-version = "1.1.2+spec-1.1.0"
+version = "1.1.3+spec-1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2b86d767906c6c42421dcba507eb9d203e779497710a47782a224bb871653053"
+checksum = "173f25c883cd2176a2d8212155638c0a60d484a9d84546d270866f40f56b6e49"
dependencies = [
"serde_core",
]
@@ -219,9 +219,9 @@ dependencies = [
[[package]]
name = "toml_writer"
-version = "1.1.3+spec-1.1.0"
+version = "1.2.0+spec-1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "06bdbd8cfc056b8d2e2e85f29b56a3bdbecb527cef81eb39e3e7b98af4652770"
+checksum = "009dbb7700f11c55ef83aebbe4c0e9cf1f1ac0844bd8d6f00dc38f302026e13a"
[[package]]
name = "unicode-ident"
@@ -231,6 +231,6 @@ checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"
[[package]]
name = "winnow"
-version = "1.0.4"
+version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "23b97319f7b8343df12cc98938e5c3eb436064524c8d2b4e30a1d3a36eecdf81"
+checksum = "8c3b93199df0ab874cdf0c6a94f0a0dc3423fe41f1cafb62b8bd7b1deb277aef"
diff --git a/Cargo.toml b/Cargo.toml
index b662030..3ffd354 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -3,7 +3,7 @@ members = ["crates/funrounds-core", "crates/funrounds-plugin"]
resolver = "3"
[workspace.package]
-version = "0.3.0-alpha.test.2"
+version = "0.4.0-alpha.test.3"
edition = "2024"
rust-version = "1.99"
authors = ["Mai Ooizumi"]
diff --git a/README.md b/README.md
index 17cf693..3b47bcf 100644
--- a/README.md
+++ b/README.md
@@ -3,10 +3,10 @@
# FunRounds-CS2
[](LICENSE)
-[](Cargo.toml)
+[](Cargo.toml)
[](rust-toolchain.toml)
[]()
-[](https://github.com/untrustedmodders/plugify)
+[](https://github.com/untrustedmodders/plugify)
**高性能、高安全性的 Counter-Strike 2 专用服务端特殊娱乐回合插件**
A high-performance, safe, and modular special rounds plugin for Counter-Strike 2 dedicated servers.
@@ -19,11 +19,11 @@
### 项目简介 / Overview
-**FunRounds-CS2** 是基于 Rust 与 C++20 原生扩展开发、面向 Counter-Strike 2 专用服务端的特殊娱乐回合(Fun Rounds)插件,运行于 [Plugify](https://github.com/untrustedmodders/plugify) 插件框架和 [S2SDK](https://github.com/untrustedmodders/plugify-plugin-s2sdk) 之上。
-**FunRounds-CS2** is a modern special rounds plugin for Counter-Strike 2 dedicated servers developed in Rust and native C++20, running atop [Plugify](https://github.com/untrustedmodders/plugify) and [S2SDK](https://github.com/untrustedmodders/plugify-plugin-s2sdk).
+**FunRounds-CS2** 是基于 Rust 与 C++20 原生扩展开发、面向 Counter-Strike 2 专用服务端的特殊娱乐回合(Fun Rounds)插件,运行于 [Plugify](https://github.com/untrustedmodders/plugify) 插件框架和 [S2SDK](https://github.com/Mai-Ooizumi/plugify-plugin-s2sdk/tree/funrounds) 之上。
+**FunRounds-CS2** is a modern special rounds plugin for Counter-Strike 2 dedicated servers developed in Rust and native C++20, running atop [Plugify](https://github.com/untrustedmodders/plugify) and [S2SDK](https://github.com/Mai-Ooizumi/plugify-plugin-s2sdk/tree/funrounds).
-在每个回合开始时(或由管理员实时指定),插件无缝应用多维度的玩法突变:修改玩家属性、物理参数、动态配装、后坐与视角机制、特殊战斗判定、小鸡生态及 C4 玩法,同时保证严格的崩溃隔离与无残留状态恢复。
-At the start of each round (or on administrative demand), it seamlessly applies multi-dimensional gameplay mutators: altering player attributes, physics, dynamic loadouts, recoil/camera mechanics, combat rules, chicken ecology, and bomb systems—with zero-leak state restoration and crash isolation.
+在每个回合开始时(或由管理员实时指定),插件无缝应用多维度的玩法突变:修改玩家属性、机动物理、动态配装、后坐与视角机制、特殊战斗判定、小鸡生态及 C4 玩法,同时保证严格的崩溃隔离与无残留状态恢复。
+At the start of each round (or on administrative demand), it seamlessly applies multi-dimensional gameplay mutators: altering player attributes, mobility physics, dynamic loadouts, recoil/camera mechanics, combat rules, chicken ecology, and bomb systems—with zero-leak state restoration and crash isolation.
---
@@ -31,14 +31,51 @@
| 维度 / Category | 玩法与机制说明 / Description |
| :--- | :--- |
-| **基础属性与物理**
Attributes & Physics | 生命值(1~10000 或随机区间)、护甲头盔、重力倍率、移速倍率、地面摩擦力、自动连跳(Bunnyhop)、地面加速度与反向倒车行走(`ground_reverse`)、全局时间流速(`time_scale`)及周期性变重力/变移速。
Health (fixed or random range), armor, gravity, speed multiplier, friction, auto-bunnyhopping, ground acceleration, ground reverse walking, time scale, and periodic oscillation. |
-| **视觉与相机视角**
Visuals & Camera | 第三人称视角(`third_person`)、幽灵按行动隐身(`ghost`,支持呼吸心跳音效与距离感知)、夜视仪(`fr_nvg`)、准星/雷达隐藏(`hide_hud`)、模型 RGB 着色、半透明外观与开镜限制。
Third person camera, stealth ghost mode with breathing audio cues, night vision, HUD hiding, model RGB tint, translucency, and scope restrictions. |
-| **射击与自推反冲**
Recoil & Knockback | 开火自身反冲自推(`fr_knock` 支持地面与空中切换)、后坐力与散布消除、开枪镜头震动冲击与衰减(`recoil_view` / `view_punch_decay`)、快速切枪(`fast_switch`)及射击引爆掉落手雷。
Shooting self-push knockback (ground/air modes), recoil & spread suppression, view-punch intensity/decay, fast switch, and shooting dropped grenades. |
-| **动态配装与弹药**
Loadouts & Ammo | 阵营武器清理与定向配发、4 种弹药模式(原生 / 无限备弹 / 无限弹匣 / 单发换填)、电击枪充能、手雷自动补充(HE/闪光/烟雾/诱饵/燃烧弹)、击杀升级换枪(`kill_loadout`)与随机抽枪。
Team-specific weapon clearing/giving, 4 ammo modes (inherit/reserve/clip/single-shot), taser recharge, grenade refills, kill-progression, and random loadouts. |
-| **特殊战斗判定**
Combat Modifiers | 造成伤害吸血、反弹伤害(`reflect_damage`)、按当前生命动态缩放伤害/移速/衰减、能量吸收护盾、开枪自伤(未命中扣血)、诱饵弹躲避球碰撞杀伤(`dodgeball`)、右键飞刀投掷弹射与命中持续燃烧(`afterburn`)。
Vampiric lifesteal, reflect damage, HP-scaled damage/speed/decay, energy shield, miss penalty self-damage, decoy dodgeball, throwing knives, and afterburn. |
-| **C4 炸弹与自爆**
C4 Objectives & Suicide | 3 种炸弹模式(原生 C4 / 鸡背 C4 / 便携可携带 C4)、自定义安放/拆除/爆炸耗时、炸弹弹跳、4 色引线拆包剪线小游戏(`fr_wire`)、现金购买 C4(`fr_c4`)及引爆炸弹自爆(`fr_suicide`)。
3 bomb types (native, chicken, carry), custom timers, bomb bouncing, 4-color wire cutting minigame, C4 purchasing, and suicide detonation. |
-| **小鸡生态与回血**
Chicken & Healthshots | 普通小鸡比例刷新生态、互动吃鸡回血与未消化自爆风险机制、小鸡连锁爆炸;自定义医疗针回血比例与上限控制(`healthshot`,支持 `fr_healthshot` 购买)。
Chicken population scaling, eating chickens with digestion risk & chain explosions; custom healthshot healing ratios with cash purchase. |
-| **经济与多语言**
Economy & i18n | 任意位置购买、阵营购买权限、回合保底现金与被动收入;内置完整中英多语言本地化(`zh-CN` / `en`),优先跟随客户端语言。
Buy anywhere, team purchase access, round money floor, passive income, and built-in bilingual i18n matching client preferences. |
+| **基础属性与物理**
Attributes & Physics | 生命值(1~10000 或随机区间)、护甲头盔(护甲最高 1000)、重力倍率、移速倍率、地面摩擦力、自动连跳(Bunnyhop)、地面加速度与反向行走(`ground_reverse`)、全局时间流速(`time_scale`)及周期性变重力/变移速。
Health (up to 10,000 or random range), armor/helmets (armor up to 1,000), gravity/speed multipliers, friction, auto-bunnyhopping, ground acceleration/reverse walking, time scale, and periodic gravity/speed oscillation. |
+| **动作与机动能力**
Movement & Mobility | 空中辅助转向加速(`autostrafe`)、空中贴墙挂墙(`wall_hang`)、准星瞄准点抓钩牵引(`grapple`)及地图特定区域蹦床弹射(`trampoline`)。
Air-strafe directional acceleration assist, wall hang upon contact, grapple hook pulling to target, and map-specific trampoline launch zones. |
+| **视觉与相机视角**
Visuals & Camera | 第三人称视角(`third_person`)、幽灵按行动隐身(`ghost`,支持呼吸心跳音效与距离感知)、大头模式(`big_head`,依据 KD 动态缩放头部)、夜视仪(`fr_nvg`)、准星/雷达隐藏(`hide_hud`)、模型 RGB 着色、半透明外观与开镜限制。
Third-person camera, stealth ghost mode with breathing cues, KD-scaled big head mode, night vision, HUD hiding, model RGB tint, translucency, and scope restrictions. |
+| **射击与自推反冲**
Recoil & Knockback | 开火自身反冲自推(`fr_knock` 支持地面与空中切换)、后坐力与散布消除、开火概率换枪/掉枪(`weapon_on_fire`)、子弹命中爆炸(`explosive_bullets`)、开枪镜头震动冲击与衰减及快速切枪(`fast_switch`)。
Shooting self-push knockback (ground/air modes), recoil & spread suppression, fire-triggered weapon drop/switch, explosive bullets, view-punch intensity/decay, and fast switch. |
+| **动态配装与武器**
Loadouts & Weapons | 规范化物品 ID、命名武器组(`[weapon_groups]` 支持 `@group` 引用)、阵营清理与定向配发、4 种弹药模式(原生 / 无限备弹 / 无限弹匣 / 单发换填)、电击枪充能、击杀升级换枪(`kill_loadout`)与独立随机配装。
Canonical weapon IDs, named weapon groups (`@group`), team filtering, 4 ammo modes (inherit/reserve/clip/single-shot), taser recharge, kill-progression, and random loadouts. |
+| **投掷物与特殊战术**
Grenades & Tactical | 投掷手雷自动补充、接近敌人近炸引信(`proximity_fuse`)、HE 手雷寻的追踪飞行(`he_guidance`)、HE 爆风推力、烟雾区域治疗(`medical_smoke`)、诱饵弹躲避球碰撞杀伤(`dodgeball`)、右键飞刀及长效闪光(`long_flash`)。
Grenade replenishment, proximity fuse, guided HE tracking, HE blast impulse, medical smoke healing, decoy dodgeball, throwing knives, and extended flash duration. |
+| **特殊战斗与生存惩罚**
Combat & Hazards | 造成伤害吸血、伤害反弹(`reflect_damage`)、动态生命曲线、友军射击转治疗(`friendly_fire_heal`)、脱战自愈(`regeneration`)、低速扣血惩罚(`dont_stop`)、熔岩地面(`hot_floor`)、死亡殉爆(`death_explosion`)与队杀限制。
Vampiric lifesteal, reflect damage, dynamic HP scaling, friendly fire healing, passive regeneration, low-speed penalty, hot floor lava damage, death explosion, and teamkill limits. |
+| **C4 目标与小鸡生态**
C4 Objectives & Chickens | 3 种炸弹模式(原生 C4 / 鸡背 C4 / 便携可携带 C4)、自定义耗时与弹跳、4 色引线拆包剪线小游戏(`fr_wire`)、现金购买 C4(`fr_c4`)与自爆(`fr_suicide`);普通小鸡生态刷新、吃鸡回血与自爆、小鸡回血光环(`chicken_aura`)及医疗针。
3 bomb types (native, chicken, carry), custom timers, bomb bouncing, 4-color wire cutting minigame, C4 purchasing & suicide detonation; chicken population scaling, chicken digestion risk, chicken healing aura, and healthshots. |
+
+
+点击展开查看全部详细玩法特性与机制列表 / Click to expand full gameplay feature details
+
+- **规范化装备系统 / Canonical Equipment & Weapon Groups**
+ - **规范物品 ID**:全面采用无 `weapon_` 前缀的标准物品标识符(如 `famas`, `p250`, `hegrenade`, `flashbang`, `smokegrenade`, `decoy`, `molotov`, `incgrenade` 等)。
Canonical weapon IDs omitting the legacy `weapon_` prefix across all loadouts and abilities.
+ - **命名武器组**:支持在配置顶层定义 `[weapon_groups]`,模式中通过 `@group_name` 语法引用与组合复用。
Defines top-level `[weapon_groups]` referenced concisely via `@group_name` in mode loadouts.
+ - **扩展护甲上限**:初始护甲支持设定至最高 `1000` 点。
Initial armor configurable up to 1,000 points.
+
+- **动作与机动能力 / Movement & Mobility**
+ - **空中辅助加速 (`autostrafe`)**:空中自动对齐偏航速度并施加辅助加速,带来顺滑的空速增益体验。
Assists aerial strafe alignment and acceleration for enhanced air control.
+ - **空中挂墙 (`wall_hang`)**:在空中贴靠墙面且按住跳跃键时进入挂壁悬停状态。
Suspends players on vertical surfaces when touching walls while holding the jump key.
+ - **抓钩绳索 (`grapple`)**:瞄准任意场景表面并按下使用键,以配置的最大速度与拉力牵引玩家快速位移。
Fires a grappling hook towards crosshair contact points, pulling the player at configured speeds.
+ - **区域蹦床 (`trampoline`)**:在指定竞技地图(如 Dust2、Mirage)内置点位踩入即触发高空垂直弹射。
Designated map trigger zones launching players into the air with vertical impulse.
+
+- **射击与战斗突变 / Weaponry & Combat Mutators**
+ - **爆炸子弹 (`explosive_bullets`)**:开火命中产生范围爆炸、伤害与击退效果,支持独立冷却、伤害与半径区间。
Bullet impacts detonate with configurable cooldowns, radius, and damage ranges.
+ - **开火失控 (`weapon_on_fire`)**:射击时有几率触发强制切换下一武器或直接脱手掉落当前武器。
Firing carries a randomized chance to forcefully switch or drop the active weapon.
+ - **动态大头 (`big_head`)**:根据玩家当场击杀/死亡比率(KD)动态缩放头部模型大小与爆头判定框。
Scales head hitboxes dynamically based on individual kill-to-death ratios.
+ - **友伤转治疗 (`friendly_fire_heal`)**:命中友军不仅免除误伤,还可按固定数值或伤害比例为队友恢复生命。
Converts friendly fire into healing via fixed values or proportional damage ratios.
+ - **脱战自愈 (`regeneration`)**:脱离交火经过指定冷却延迟后,按固定周期自动恢复生命值。
Passively regenerates health after a period of staying out of combat.
+
+- **高阶投掷物机制 / Advanced Grenades**
+ - **近炸引信 (`proximity_fuse`)**:手雷飞行至敌方玩家感知半径内时触发近炸,直接缩短延时提前起爆。
Grenades trigger early proximity detonation upon detecting nearby enemies.
+ - **寻的追踪手雷 (`he_guidance`)**:高爆手雷出膛后自动以配置转向角速度寻的并追踪飞行轨迹中的敌人。
HE grenades automatically track and steer toward nearby enemies in range.
+ - **爆风推力 (`hegrenade_impulse`)**:高爆手雷爆炸产生额外物理冲量,推开爆心周围的目标。
Applies customizable directional impulse and knockback to players caught in HE explosions.
+ - **医疗烟雾 (`medical_smoke`)**:友方烟雾弹扩散范围内为处于其中的队友持续恢复生命。
Smoke clouds grant periodic healing to allied players inside the active smoke radius.
+ - **长效致盲 (`long_flash`)**:按倍率延长闪光弹全白致盲时间,并受最大保护上限时间限制。
Multiplies flashbang blind durations up to a configured ceiling cap.
+
+- **环境惩罚与规则机制 / Environmental Hazards & Rules**
+ - **止步惩罚 (`dont_stop`)**:玩家水平移速低于安全阈值并超过宽限时间后,将持续受到失速扣血惩罚。
Inflicts periodic health loss if a player's horizontal speed stays below a minimum threshold.
+ - **熔岩地面 (`hot_floor`)**:持续接触地面超过安全秒数后持续扣血,久留不离开则直接被火焰点燃。
Standing continuously on the ground burns the player and eventually sets them on fire.
+ - **死亡殉爆 (`death_explosion`)**:每回合随机从双方阵营赋予特定玩家死亡自爆装药,阵亡瞬间引发致命爆炸。
Designates a quota of players per team to trigger a massive explosion upon dying.
+ - **队杀限制 (`teamkill_limit`)**:严格限制单回合队杀次数,超额直接触发惩罚。
Enforces a threshold on teamkills before triggering punishments.
+ - **周期性参数波动 (`periodic_speed` / `periodic_gravity`)**:支持配置随机时间间隔,按自定义离散数值或连续区间周期刷新重力与移速。
Periodically mutates speed and gravity multipliers using custom value sets or intervals.
+
+
点击展开架构与可靠性设计 / Click to expand Architecture & Reliability
@@ -58,7 +95,7 @@
### 项目目录结构 / Project Layout
```text
-├── bindings/ # Plugify S2SDK 接口清单 (123 项接口定义) / Provider manifest
+├── bindings/ # Plugify S2SDK 接口清单 (164 项接口定义) / Provider manifest (164 methods)
├── config/ # 示例配置文件及多语言包 / Configurations & i18n files
│ ├── funrounds.example.toml # 示例配置 / Reference configuration
│ └── i18n/ # 本地化翻译文件 (zh-CN.toml, en.toml) / Localization catalogs
@@ -80,7 +117,7 @@
- Counter-Strike 2 专用服务端(Windows x64 或 Linux x64)
Counter-Strike 2 Dedicated Server (Windows x64 or Linux x64)
- 已安装并运行 [Plugify](https://github.com/untrustedmodders/plugify) 插件框架
[Plugify](https://github.com/untrustedmodders/plugify) framework installed and active
-- 已配置并加载 [S2SDK](https://github.com/untrustedmodders/plugify-plugin-s2sdk) 插件(版本 `3.0.6`)
[S2SDK](https://github.com/untrustedmodders/plugify-plugin-s2sdk) plugin (version `3.0.6`) active in Plugify
+- 已配置并加载 [S2SDK](https://github.com/Mai-Ooizumi/plugify-plugin-s2sdk/tree/funrounds) 插件(版本 `=3.3.1`)
[S2SDK](https://github.com/Mai-Ooizumi/plugify-plugin-s2sdk/tree/funrounds) plugin (version `=3.3.1`) active in Plugify
#### 目录部署 / Deployment Structure
@@ -118,7 +155,7 @@ game/csgo/addons/plugify/
| :--- | :--- | :--- |
| `fr_status` | 无
None | 查看当前回合状态、运行阶段、底层能力就绪状态及故障排查信息。
Displays current mode, phase, capability readiness, and fault diagnoses. |
| `fr_list` | 无
None | 列出配置池中所有已启用的特殊模式列表。
Lists all loaded and enabled round modes in the pool. |
-| `fr_next` | `` | 指定下一回合的模式 ID,或恢复随机抽取 (`random`)。
Queues a specific mode ID or random selection for the next round. |
+| `fr_next` | `>` | 指定下一回合的模式 ID(支持直接传 ID 或 `id `),或恢复随机抽取 (`random`)。
Queues a specific mode ID (`fr_next ` or `fr_next id `) or random selection (`random`) for the next round. |
| `fr_reload` | 无
None | 校验并重载配置文件与多语言文本,重载成功于下一回合生效。
Validates and schedules configuration and i18n reload for the next round. |
| `fr_enable` | `<0 \| 1>` | 插件总启停开关:`1` 为启用,`0` 为停用。
Master switch: disables (`0`) or enables (`1`) the plugin. |
@@ -151,6 +188,10 @@ diagnostics = false # 诊断日志开关 / Diagnostic logging
[i18n]
default_language = "zh-CN" # 服务端缺省语言("zh-CN" 或 "en")/ Default language
+# 可选命名武器组 / Optional named weapon groups
+# [weapon_groups]
+# basic = ["famas", "p250"]
+
# 全局默认模板(模式内未设置的字段将继承此处) / Global defaults
[defaults]
gravity = 1.0
@@ -161,7 +202,7 @@ id = "example" # 模式唯一标识 / Unique mode identifier
enabled = true # 是否启用该模式 / Whether mode enters the pool
name_key = "mode.example.name" # 多语言名称键 / Localized name key
description_key = "mode.example.description" # 多语言说明键 / Localized description key
-weapons = ["weapon_famas", "weapon_p250"]
+weapons = ["famas", "p250"] # 规范物品 ID / Canonical weapon IDs
# 阵营装备配发与清理 / Team equipment distribution
clear_weapons = "all" # 配发前清理武器的队伍 (none / all / terrorists / counter_terrorists)
@@ -170,7 +211,7 @@ give_knife = "all" # 配发刀具的队伍
# 基础属性与移动 / Attributes & movement
health = 120 # 初始生命值 (1~10000 或随机范围 { min = 100, max = 150 })
-armor = 50 # 初始护甲值 (0~255 或随机范围 { min = 0, max = 100 })
+armor = 50 # 初始护甲值 (0~1000 或随机范围 { min = 0, max = 100 })
gravity = 1.0 # 重力倍率 ((0, 10],1.0 为正常重力)
speed = 1.0 # 移速倍率 ((0, 10])
self_push = true # 开启开火自推反冲 / Recoil self-push
@@ -180,11 +221,13 @@ ammo = "reserve" # 弹药规则 (inherit / reserve / clip / single_sh
headshots = "normal" # 爆头规则 (normal / only / disabled)
fast_switch = true # 快速切枪开关 / Fast switch
-# 特殊玩法机制选开 / Optional mutators
+# 可选玩法突变示例 / Optional mutator examples
+# autostrafe = true # 空中辅助转向加速 / Air-strafe assist
+# explosive_bullets = { cooldown_seconds = 1.5, damage = 30, radius = 120 } # 爆炸子弹 / Explosive bullets
+# wall_hang = true # 空中贴墙挂墙 / Wall hang
+# grapple = { max_distance = 1000.0, max_speed = 600.0, pull_gain = 4.0 } # 抓钩绳索 / Grapple hook
# lifesteal = true # 吸血恢复 / Vampiric lifesteal
-# suicide = true # 允许自爆玩法 / Suicide blast
-# third_person = { distance = 64.0, follow_eyes = true, return_strength = 2.0 } # 第三人称
-# bomb = { kind = "native", plant_time = 3.0, explode_time = 45.0, bounce = false } # 特殊炸弹
+# third_person = { distance = 64.0, follow_eyes = true, return_strength = 2.0 } # 第三人称 / Third-person
```
diff --git a/README_EN.md b/README_EN.md
index 434a143..b2e98b7 100644
--- a/README_EN.md
+++ b/README_EN.md
@@ -3,10 +3,10 @@
# FunRounds-CS2
[](LICENSE)
-[](Cargo.toml)
+[](Cargo.toml)
[](rust-toolchain.toml)
[]()
-[](https://github.com/untrustedmodders/plugify)
+[](https://github.com/untrustedmodders/plugify)
**A high-performance, safe, and modular special rounds plugin for Counter-Strike 2 dedicated servers.**
@@ -18,9 +18,9 @@
### Overview
-**FunRounds-CS2** is a modern Counter-Strike 2 server plugin developed in Rust and native C++20, built atop the [Plugify](https://github.com/untrustedmodders/plugify) framework and [S2SDK](https://github.com/untrustedmodders/plugify-plugin-s2sdk).
+**FunRounds-CS2** is a modern Counter-Strike 2 server plugin developed in Rust and native C++20, built atop the [Plugify](https://github.com/untrustedmodders/plugify) framework and [S2SDK](https://github.com/Mai-Ooizumi/plugify-plugin-s2sdk/tree/funrounds).
-At the start of each round (or on administrative demand), it seamlessly applies multi-dimensional gameplay mutators—altering player attributes, physics, dynamic loadouts, recoil/camera mechanics, combat rules, chicken ecology, and bomb systems—with zero-leak state restoration and crash isolation.
+At the start of each round (or on administrative demand), it seamlessly applies multi-dimensional gameplay mutators—altering player attributes, mobility physics, dynamic loadouts, recoil/camera mechanics, combat rules, chicken ecology, and bomb systems—with zero-leak state restoration and crash isolation.
---
@@ -28,14 +28,51 @@ At the start of each round (or on administrative demand), it seamlessly applies
| Category | Description |
| :--- | :--- |
-| **Attributes & Physics** | Health (1–10,000 or random range), armor/helmets, gravity scaling, speed multiplier, friction, auto-bunnyhopping, ground acceleration, ground reverse walking (`ground_reverse`), time scale (`time_scale`), and periodic speed/gravity oscillation. |
-| **Visuals & Camera** | Third person camera (`third_person`), stealth ghost mode with breathing audio cues and distance awareness (`ghost`), night vision (`fr_nvg`), crosshair/radar hiding (`hide_hud`), model RGB tinting, translucency, and scope restrictions. |
-| **Recoil & Knockback** | Weapon recoil self-push knockback (`fr_knock` supports ground and air modes), recoil & spread suppression, view-punch intensity/decay (`recoil_view` / `view_punch_decay`), fast switch (`fast_switch`), and shooting dropped grenades. |
-| **Loadouts & Ammunition** | Team-specific weapon clearing and granting, 4 ammo modes (inherit / reserve / clip / single-shot), taser recharge intervals, automatic grenade replenishment (HE/flash/smoke/decoy/molotov), kill progression (`kill_loadout`), and random draws. |
-| **Combat Modifiers** | Vampiric lifesteal, reflect damage (`reflect_damage`), HP-scaled damage/speed/decay, energy absorption shield, miss penalty self-damage, decoy dodgeball collisions (`dodgeball`), throwing knives with bouncing, and afterburn damage. |
-| **C4 Objectives & Suicide** | 3 bomb types (native, chicken, carry), custom timers, bomb bouncing, 4-color wire cutting minigame (`fr_wire`), C4 cash purchasing (`fr_c4`), and C4 suicide explosions (`fr_suicide`). |
-| **Chicken & Healthshots** | Chicken population scaling, eating chickens with digestion risk & chain explosions; custom healthshot healing ratios with cash purchase (`fr_healthshot`). |
-| **Economy & i18n** | Buy anywhere, team purchase access, round money floor, passive income; built-in bilingual i18n (`zh-CN` / `en`) automatically matching client language. |
+| **Attributes & Physics** | Health (up to 10,000 or random range), armor/helmets (armor up to 1,000), gravity scaling, speed multiplier, friction, auto-bunnyhopping, ground acceleration, ground reverse walking (`ground_reverse`), time scale (`time_scale`), and periodic speed/gravity oscillation. |
+| **Movement & Mobility** | Air-strafe directional acceleration assist (`autostrafe`), wall hang upon contact (`wall_hang`), grapple hook pulling to target (`grapple`), and map-specific trampoline launch zones (`trampoline`). |
+| **Visuals & Camera** | Third person camera (`third_person`), stealth ghost mode with breathing audio cues and distance awareness (`ghost`), dynamic KD-scaled big head mode (`big_head`), night vision (`fr_nvg`), crosshair/radar hiding (`hide_hud`), model RGB tinting, translucency, and scope restrictions. |
+| **Recoil & Knockback** | Weapon recoil self-push knockback (`fr_knock` supports ground and air modes), recoil & spread suppression, weapon drop/switch on fire (`weapon_on_fire`), explosive bullets (`explosive_bullets`), view-punch intensity/decay, and fast switch (`fast_switch`). |
+| **Loadouts & Weapons** | Canonical weapon IDs, named weapon groups (`[weapon_groups]` referenced via `@group`), team-specific weapon clearing and granting, 4 ammo modes (inherit / reserve / clip / single-shot), taser recharge intervals, kill progression (`kill_loadout`), and random draws. |
+| **Grenades & Tactical** | Automatic grenade replenishment, proximity fuse detonation (`proximity_fuse`), guided HE tracking (`he_guidance`), HE blast impulse (`hegrenade_impulse`), medical smoke healing (`medical_smoke`), decoy dodgeball collisions (`dodgeball`), throwing knives, and extended flash duration (`long_flash`). |
+| **Combat & Hazards** | Vampiric lifesteal, reflect damage (`reflect_damage`), dynamic HP curves, friendly fire healing (`friendly_fire_heal`), passive regeneration (`regeneration`), low-speed penalty (`dont_stop`), hot floor lava damage (`hot_floor`), death explosion (`death_explosion`), and teamkill limits. |
+| **C4 Objectives & Chickens** | 3 bomb types (native, chicken, carry), custom timers, bomb bouncing, 4-color wire cutting minigame (`fr_wire`), C4 cash purchasing (`fr_c4`), and C4 suicide explosions (`fr_suicide`); chicken population scaling, eating chickens with digestion risk, chicken healing aura (`chicken_aura`), and healthshots. |
+
+
+Click to expand full gameplay feature details
+
+- **Canonical Equipment & Weapon Groups**
+ - **Canonical Weapon IDs**: Fully transitions to standard IDs without the legacy `weapon_` prefix (e.g. `famas`, `p250`, `hegrenade`, `flashbang`, `smokegrenade`, `decoy`, `molotov`, `incgrenade`).
+ - **Named Weapon Groups**: Supports top-level `[weapon_groups]` definitions referenced succinctly as `@group_name` across modes.
+ - **Expanded Armor Cap**: Initial armor can be configured up to `1000` points.
+
+- **Movement & Mobility**
+ - **Air-Strafe Assist (`autostrafe`)**: Automatically aligns horizontal velocity with viewing angles to provide smooth aerial acceleration.
+ - **Wall Hang (`wall_hang`)**: Suspends players on vertical surfaces while touching walls and holding the jump key.
+ - **Grapple Hook (`grapple`)**: Shoots a grappling tether towards surfaces upon pressing the use key, pulling the player at configured speeds.
+ - **Map Trampolines (`trampoline`)**: Designated geographic trigger areas (e.g. Dust2, Mirage) launching players upwards with high vertical velocity.
+
+- **Weaponry & Combat Mutators**
+ - **Explosive Bullets (`explosive_bullets`)**: Bullet impacts detonate with configurable cooldowns, radius, and damage ranges.
+ - **Weapon Fire Mishap (`weapon_on_fire`)**: Firing carries a randomized chance to forcefully switch to the next weapon or drop the active weapon.
+ - **Big Head (`big_head`)**: Scales head hitbox dimensions dynamically according to the player's live kill-to-death ratio (KD).
+ - **Friendly Fire Healing (`friendly_fire_heal`)**: Converts friendly fire into healing via fixed values or proportional damage ratios.
+ - **Passive Regeneration (`regeneration`)**: Passively regenerates health after a period of staying out of combat.
+
+- **Advanced Grenades**
+ - **Proximity Fuse (`proximity_fuse`)**: Grenades detonate early upon detecting nearby enemy players within a specified trigger radius.
+ - **Guided HE Tracking (`he_guidance`)**: High explosive grenades steer toward nearby enemies in flight at a configured turn rate.
+ - **HE Blast Impulse (`hegrenade_impulse`)**: High explosive grenades apply customizable directional physical impulse and knockback.
+ - **Medical Smoke (`medical_smoke`)**: Smoke clouds grant periodic healing to allied players inside the active cloud.
+ - **Extended Flash (`long_flash`)**: Multiplies flashbang blind durations up to a configured ceiling cap.
+
+- **Environmental Hazards & Rules**
+ - **Low-Speed Hazard (`dont_stop`)**: Inflicts periodic health penalties if a player's horizontal speed stays below a minimum threshold past the grace period.
+ - **Hot Floor Lava (`hot_floor`)**: Standing continuously on the ground burns the player with damage, eventually igniting them.
+ - **Death Explosion (`death_explosion`)**: Designates a quota of players per team to trigger a massive explosion upon dying.
+ - **Teamkill Limit (`teamkill_limit`)**: Enforces a strict threshold on teamkills per round before punishing the offender.
+ - **Periodic Parameter Waves (`periodic_speed` / `periodic_gravity`)**: Randomly mutates gravity and speed multipliers at periodic intervals using discrete values or continuous ranges.
+
+
Click to expand Architecture & Reliability
@@ -55,7 +92,7 @@ At the start of each round (or on administrative demand), it seamlessly applies
### Project Layout
```text
-├── bindings/ # Plugify S2SDK provider bindings (123 methods)
+├── bindings/ # Plugify S2SDK provider bindings (164 methods)
├── config/ # Reference configurations and i18n catalogs
│ ├── funrounds.example.toml # Reference configuration
│ └── i18n/ # Localization files (zh-CN.toml, en.toml)
@@ -77,7 +114,7 @@ At the start of each round (or on administrative demand), it seamlessly applies
- Counter-Strike 2 Dedicated Server (Windows x64 or Linux x64)
- [Plugify](https://github.com/untrustedmodders/plugify) installed and active on your CS2 server
-- [S2SDK](https://github.com/untrustedmodders/plugify-plugin-s2sdk) plugin (version `3.0.6`) active in Plugify
+- [S2SDK](https://github.com/Mai-Ooizumi/plugify-plugin-s2sdk/tree/funrounds) plugin (version `=3.3.1`) active in Plugify
#### Deployment
@@ -112,74 +149,80 @@ game/csgo/addons/plugify/
| Command | Arguments | Description |
| :--- | :--- | :--- |
-| `fr_status` | None | Displays current mode, phase, engine capabilities, and fault diagnoses. |
+| `fr_status` | None | Displays current mode, phase, capability readiness, and fault diagnoses. |
| `fr_list` | None | Lists all loaded and enabled round modes in the pool. |
-| `fr_next` | `` | Queues a specific mode ID or random mode for the next round. |
+| `fr_next` | `>` | Queues a specific mode ID (`fr_next ` or `fr_next id `) or random selection (`random`) for the next round. |
| `fr_reload` | None | Validates and schedules configuration and i18n reload for the next round. |
| `fr_enable` | `<0 \| 1>` | Master switch: disables (`0`) or enables (`1`) the plugin. |
#### Player Commands (Console & Chat)
-| Console Command | Chat Alias | Arguments | Description |
+| Console | Chat Alias | Arguments | Description |
| :--- | :--- | :--- | :--- |
-| `fr_info` | `!info` / `!frinfo` | None | Displays the current round mode, ID, and description in chat. |
+| `fr_info` | `!info` / `!frinfo` | None | Displays current round mode name, ID, and description in chat. |
| `fr_help` | `!help` / `!frhelp` | None | Displays available player commands and usage instructions. |
-| `fr_knock` | `!knock` | `[0\|1\|2]` | Sets or cycles shooting self-push (`0`: off, `1`: ground & air, `2`: airborne only [default]; cycle without args). |
-| `fr_c4` | `!c4` | None | Purchases an extra C4 at the configured price when allowed. |
-| `fr_suicide` | `!suicide` | None | Triggers a suicide explosion with held or purchased C4 when allowed. |
-| `fr_chicken` | `!chicken` | None | Buys an ordinary chicken at the configured price. |
-| `fr_healthshot` | `!healthshot` | None | Buys a healthshot at the configured price. |
+| `fr_knock` | `!knock` | `[0\|1\|2]` | Configures recoil self-push (`0`: off, `1`: ground & air, `2`: airborne only [default]; cycle without args). |
+| `fr_c4` | `!c4` | None | T players purchase extra C4 at the configured price when allowed. |
+| `fr_suicide` | `!suicide` | None | Triggers suicide explosion with held or purchased C4 when allowed. |
+| `fr_chicken` | `!chicken` | None | Purchases an ordinary chicken at the configured price. |
+| `fr_healthshot` | `!healthshot` | None | Purchases a healthshot at the configured price. |
| `fr_nvg` | `!nvg` | None | Toggles night vision. |
-| `fr_wire` | `!wire` | `` | Selects planting or quick-defusing wire color (`blue`, `yellow`, `red`, `green`). |
+| `fr_wire` | `!wire` | `` | Selects planting or quick-defusing wire color (blue, yellow, red, green). |
---
### Configuration
-The configuration uses strict TOML format with support for global `[defaults]` template inheritance:
+Configuration uses strict TOML syntax with a global `[defaults]` template for field inheritance:
```toml
-# Top-level settings
-diagnostics = false # Diagnostic logging (default: false)
+# Global settings
+diagnostics = false # Diagnostic logging
-# Internationalization
+# i18n
[i18n]
-default_language = "en" # Server default language ("zh-CN" or "en")
+default_language = "zh-CN" # Default language ("zh-CN" or "en")
+
+# Optional named weapon groups
+# [weapon_groups]
+# basic = ["famas", "p250"]
-# Global default template (mode-level fields take precedence)
+# Global defaults
[defaults]
gravity = 1.0
bunnyhop = false
[[modes]]
-id = "example" # Unique mode identifier (ASCII, alphanumeric, '_' or '-')
-enabled = true # Whether this mode enters the round pool
+id = "example" # Unique mode identifier
+enabled = true # Whether mode enters the pool
name_key = "mode.example.name" # Localized name key
description_key = "mode.example.description" # Localized description key
-weapons = ["weapon_famas", "weapon_p250"]
+weapons = ["famas", "p250"] # Canonical weapon IDs
-# Team loadout control
-clear_weapons = "all" # Team to clear weapons before granting (none / all / terrorists / counter_terrorists)
-give_weapons = "all" # Team to receive candidates
-give_knife = "all" # Team to receive knife
+# Team equipment distribution
+clear_weapons = "all" # Teams to strip (none / all / terrorists / counter_terrorists)
+give_weapons = "all" # Teams to give candidates
+give_knife = "all" # Teams to give knives
# Attributes & movement
-health = 120 # Initial health (1-10000, or random range { min = 100, max = 150 })
-armor = 50 # Initial armor (0-255, or random range { min = 0, max = 100 })
-gravity = 1.0 # Gravity multiplier ((0, 10], 1.0 is normal gravity)
+health = 120 # Initial health (1–10000 or range { min = 100, max = 150 })
+armor = 50 # Initial armor (0–1000 or range { min = 0, max = 100 })
+gravity = 1.0 # Gravity multiplier ((0, 10], 1.0 is normal)
speed = 1.0 # Speed multiplier ((0, 10])
-self_push = true # Weapon recoil self-push
+self_push = true # Recoil self-push
-# Recoil & view
-ammo = "reserve" # Ammo mode (inherit / reserve / clip / single_shot)
+# Shooting & view dynamics
+ammo = "reserve" # Ammo rule (inherit / reserve / clip / single_shot)
headshots = "normal" # Headshot rule (normal / only / disabled)
-fast_switch = true # Fast weapon switch
+fast_switch = true # Fast switch
-# Optional mutators
+# Optional mutator examples
+# autostrafe = true # Air-strafe assist
+# explosive_bullets = { cooldown_seconds = 1.5, damage = 30, radius = 120 } # Explosive bullets
+# wall_hang = true # Wall hang
+# grapple = { max_distance = 1000.0, max_speed = 600.0, pull_gain = 4.0 } # Grapple hook
# lifesteal = true # Vampiric lifesteal
-# suicide = true # Suicide blast gameplay
-# third_person = { distance = 64.0, follow_eyes = true, return_strength = 2.0 }
-# bomb = { kind = "native", plant_time = 3.0, explode_time = 45.0, bounce = false }
+# third_person = { distance = 64.0, follow_eyes = true, return_strength = 2.0 } # Third-person
```
@@ -194,17 +237,17 @@ Refer to [config/funrounds.example.toml](config/funrounds.example.toml) for full
#### 1. Build Rust Plugin
-Requires Rust `1.99.1` (automatically managed by `rust-toolchain.toml`):
+Requires Rust `1.99.1` (automatically handled by `rust-toolchain.toml`):
```bash
-# Code formatting check and Clippy analysis
+# Formatting & Clippy lint checks
cargo fmt --all -- --check
cargo clippy --workspace --all-targets --locked -- -D warnings
-# Execute test suite
+# Execute full test suite
cargo test --workspace --locked
-# Build optimized release binaries
+# Build Release binaries
cargo build --release --workspace --locked
```
@@ -213,7 +256,7 @@ cargo build --release --workspace --locked
Requires Python 3.10+, CMake 3.25+, and a C++20 compiler (MSVC 2022+ or GCC 11+):
```bash
-# Build native module to output directory
+# Build native companion into dist/native
python scripts/build-native.py --output-dir dist/native
```
diff --git a/README_ZH.md b/README_ZH.md
index de7bce0..f90f6c6 100644
--- a/README_ZH.md
+++ b/README_ZH.md
@@ -3,10 +3,10 @@
# FunRounds-CS2
[](LICENSE)
-[](Cargo.toml)
+[](Cargo.toml)
[](rust-toolchain.toml)
[]()
-[](https://github.com/untrustedmodders/plugify)
+[](https://github.com/untrustedmodders/plugify)
**高性能、高安全性的 Counter-Strike 2 专用服务端特殊娱乐回合插件**
@@ -18,9 +18,9 @@
### 项目简介
-**FunRounds-CS2** 是基于 Rust 与 C++20 原生扩展开发、面向 Counter-Strike 2 专用服务端的特殊娱乐回合(Fun Rounds)插件。本项目构建于 [Plugify](https://github.com/untrustedmodders/plugify) 插件框架和 [S2SDK](https://github.com/untrustedmodders/plugify-plugin-s2sdk) 扩展之上。
+**FunRounds-CS2** 是基于 Rust 与 C++20 原生扩展开发、面向 Counter-Strike 2 专用服务端的特殊娱乐回合(Fun Rounds)插件。本项目构建于 [Plugify](https://github.com/untrustedmodders/plugify) 插件框架和 [S2SDK](https://github.com/Mai-Ooizumi/plugify-plugin-s2sdk/tree/funrounds) 扩展之上。
-插件在每个回合开始时(或由管理员实时指定)无缝应用多维度的玩法突变:修改玩家属性、物理参数、动态配装、后坐与视角机制、特殊战斗规则、小鸡生态及 C4 玩法,同时保证严格的崩溃隔离与无残留状态恢复。
+插件在每个回合开始时(或由管理员实时指定)无缝应用多维度的玩法突变:修改玩家属性、机动物理、动态配装、后坐与视角机制、特殊战斗规则、小鸡生态及 C4 玩法,同时保证严格的崩溃隔离与无残留状态恢复。
---
@@ -28,14 +28,51 @@
| 玩法维度 | 特性机制概要 |
| :--- | :--- |
-| **基础属性与物理** | 生命值(1~10000 或区间随机)、护甲头盔、重力倍率、移速倍率、地面摩擦力、自动连跳(Bunnyhop)、地面加速度与反向倒车行走(`ground_reverse`)、全局时间流速(`time_scale`)及周期性变重力/变移速。 |
-| **视觉与相机视角** | 第三人称视角(`third_person`)、幽灵按行动隐身(`ghost`,支持呼吸心跳音效与距离感知)、夜视仪(`fr_nvg`)、准星/雷达隐藏(`hide_hud`)、模型 RGB 着色、半透明外观与开镜限制。 |
-| **射击与自推反冲** | 开火自身反冲自推(`fr_knock` 支持地面与空中切换)、后坐力与散布消除、开枪镜头震动冲击与衰减(`recoil_view` / `view_punch_decay`)、快速切枪(`fast_switch`)及射击引爆掉落手雷。 |
-| **动态配装与弹药** | 阵营武器清理与定向配发、4 种弹药模式(原生 / 无限备弹 / 无限弹匣 / 单发换装)、电击枪充能、手雷自动补充(HE/闪光/烟雾/诱饵/燃烧弹)、击杀升级换枪(`kill_loadout`)与随机抽枪。 |
-| **特殊战斗判定** | 造成伤害吸血、反弹伤害(`reflect_damage`)、按当前生命动态缩放伤害/移速/衰减、能量吸收护盾、开枪自伤(未命中扣血)、诱饵弹躲避球碰撞杀伤(`dodgeball`)、右键飞刀投掷弹射与命中持续燃烧(`afterburn`)。 |
-| **C4 炸弹与自爆** | 3 种炸弹模式(原生 C4 / 鸡背 C4 / 便携可携带 C4)、自定义安放/拆除/爆炸耗时、炸弹弹跳、4 色引线拆包剪线小游戏(`fr_wire`)、现金购买 C4(`fr_c4`)及引爆炸弹自爆(`fr_suicide`)。 |
-| **小鸡生态与回血** | 普通小鸡比例刷新生态、互动吃鸡回血与未消化自爆风险机制、小鸡连锁爆炸;自定义医疗针回血比例与上限控制(`healthshot`,支持 `fr_healthshot` 购买)。 |
-| **经济与多语言** | 任意位置购买、阵营购买权限、回合保底现金与被动收入;内置完整中英多语言本地化(`zh-CN` / `en`),优先跟随客户端语言。 |
+| **基础属性与物理** | 生命值(1~10000 或区间随机)、护甲头盔(护甲最高 1000)、重力倍率、移速倍率、地面摩擦力、自动连跳(Bunnyhop)、地面加速度与反向行走(`ground_reverse`)、全局时间流速(`time_scale`)及周期性变重力/变移速。 |
+| **动作与机动能力** | 空中辅助转向加速(`autostrafe`)、空中贴墙挂墙(`wall_hang`)、准星瞄准点抓钩牵引(`grapple`)及地图特定区域蹦床弹射(`trampoline`)。 |
+| **视觉与相机视角** | 第三人称视角(`third_person`)、幽灵按行动隐身(`ghost`,支持呼吸心跳音效与距离感知)、大头模式(`big_head`,依据 KD 动态缩放头部)、夜视仪(`fr_nvg`)、准星/雷达隐藏(`hide_hud`)、模型 RGB 着色、半透明外观与开镜限制。 |
+| **射击与自推反冲** | 开火自身反冲自推(`fr_knock` 支持地面与空中切换)、后坐力与散布消除、开火概率换枪/掉枪(`weapon_on_fire`)、子弹命中爆炸(`explosive_bullets`)、开枪镜头震动冲击与衰减及快速切枪(`fast_switch`)。 |
+| **动态配装与武器** | 规范化物品 ID、命名武器组(`[weapon_groups]` 支持 `@group` 引用)、阵营清理与定向配发、4 种弹药模式(原生 / 无限备弹 / 无限弹匣 / 单发换装)、电击枪充能、击杀升级换枪(`kill_loadout`)与独立随机配装。 |
+| **投掷物与特殊战术** | 投掷手雷自动补充、接近敌人近炸引信(`proximity_fuse`)、HE 手雷寻的追踪飞行(`he_guidance`)、HE 爆风推力、烟雾区域治疗(`medical_smoke`)、诱饵弹躲避球碰撞杀伤(`dodgeball`)、右键飞刀及长效闪光(`long_flash`)。 |
+| **特殊战斗与生存惩罚** | 造成伤害吸血、伤害反弹(`reflect_damage`)、动态生命曲线、友军射击转治疗(`friendly_fire_heal`)、脱战自愈(`regeneration`)、低速扣血惩罚(`dont_stop`)、熔岩地面(`hot_floor`)、死亡殉爆(`death_explosion`)与队杀限制。 |
+| **C4 目标与小鸡生态** | 3 种炸弹模式(原生 C4 / 鸡背 C4 / 便携可携带 C4)、自定义耗时与弹跳、4 色引线拆包剪线小游戏(`fr_wire`)、现金购买 C4(`fr_c4`)与自爆(`fr_suicide`);普通小鸡生态刷新、吃鸡回血与自爆、小鸡回血光环(`chicken_aura`)及医疗针。 |
+
+
+点击展开查看全部详细玩法特性与机制列表
+
+- **规范化装备系统**
+ - **规范物品 ID**:全面采用无 `weapon_` 前缀的标准物品标识符(如 `famas`, `p250`, `hegrenade`, `flashbang`, `smokegrenade`, `decoy`, `molotov`, `incgrenade` 等)。
+ - **命名武器组**:支持在配置顶层定义 `[weapon_groups]`,模式中通过 `@group_name` 语法引用与组合复用。
+ - **扩展护甲上限**:初始护甲支持设定至最高 `1000` 点。
+
+- **动作与机动能力**
+ - **空中辅助加速 (`autostrafe`)**:空中自动对齐偏航速度并施加辅助加速,带来顺滑的空速增益体验。
+ - **空中挂墙 (`wall_hang`)**:在空中贴靠墙面且按住跳跃键时进入挂壁悬停状态。
+ - **抓钩绳索 (`grapple`)**:瞄准任意场景表面并按下使用键,以配置的最大速度与拉力牵引玩家快速位移。
+ - **区域蹦床 (`trampoline`)**:在指定竞技地图(如 Dust2、Mirage)内置点位踩入即触发高空垂直弹射。
+
+- **射击与战斗突变**
+ - **爆炸子弹 (`explosive_bullets`)**:开火命中产生范围爆炸、伤害与击退效果,支持独立冷却、伤害与半径区间。
+ - **开火失控 (`weapon_on_fire`)**:射击时有几率触发强制切换下一武器或直接脱手掉落当前武器。
+ - **动态大头 (`big_head`)**:根据玩家当场击杀/死亡比率(KD)动态缩放头部模型大小与爆头判定框。
+ - **友伤转治疗 (`friendly_fire_heal`)**:命中友军不仅免除误伤,还可按固定数值或伤害比例为队友恢复生命。
+ - **脱战自愈 (`regeneration`)**:脱离交火经过指定冷却延迟后,按固定周期自动恢复生命值。
+
+- **高阶投掷物机制**
+ - **近炸引信 (`proximity_fuse`)**:手雷飞行至敌方玩家感知半径内时触发近炸,直接缩短延时提前起爆。
+ - **寻的追踪手雷 (`he_guidance`)**:高爆手雷出膛后自动以配置转向角速度寻的并追踪飞行轨迹中的敌人。
+ - **爆风推力 (`hegrenade_impulse`)**:高爆手雷爆炸产生额外物理冲量,推开爆心周围的目标。
+ - **医疗烟雾 (`medical_smoke`)**:友方烟雾弹扩散范围内为处于其中的队友持续恢复生命。
+ - **长效致盲 (`long_flash`)**:按倍率延长闪光弹全白致盲时间,并受最大保护上限时间限制。
+
+- **环境惩罚与规则机制**
+ - **止步惩罚 (`dont_stop`)**:玩家水平移速低于安全阈值并超过宽限时间后,将持续受到失速扣血惩罚。
+ - **熔岩地面 (`hot_floor`)**:持续接触地面超过安全秒数后持续扣血,久留不离开则直接被火焰点燃。
+ - **死亡殉爆 (`death_explosion`)**:每回合随机从双方阵营赋予特定玩家死亡自爆装药,阵亡瞬间引发致命爆炸。
+ - **队杀限制 (`teamkill_limit`)**:严格限制单回合队杀次数,超额直接触发惩罚。
+ - **周期性参数波动 (`periodic_speed` / `periodic_gravity`)**:支持配置随机时间间隔,按自定义离散数值或连续区间周期刷新重力与移速。
+
+
点击展开架构与可靠性设计
@@ -55,7 +92,7 @@
### 项目目录结构
```text
-├── bindings/ # Plugify S2SDK 接口清单 (123 项接口定义)
+├── bindings/ # Plugify S2SDK 接口清单 (164 项接口定义)
├── config/ # 示例配置文件及多语言包
│ ├── funrounds.example.toml # 示例配置
│ └── i18n/ # 本地化翻译文件 (zh-CN.toml, en.toml)
@@ -77,7 +114,7 @@
- Counter-Strike 2 专用服务端(Windows x64 或 Linux x64)
- 服务端已安装配置 [Plugify](https://github.com/untrustedmodders/plugify) 插件框架
-- 服务端已加载并运行 [S2SDK](https://github.com/untrustedmodders/plugify-plugin-s2sdk) 插件(版本 `3.0.6`)
+- 服务端已加载并运行 [S2SDK](https://github.com/Mai-Ooizumi/plugify-plugin-s2sdk/tree/funrounds) 插件(版本 `=3.3.1`)
#### 部署步骤
@@ -101,29 +138,29 @@ game/csgo/addons/plugify/
│ └── funrounds-native.dll (或 lib*.so) # 原生动态库
├── funrounds-native.pplugin # 原生插件清单
└── gamedata/
- └── funrounds-native.jsonc # Gamedata 特征与偏移文件
+ └── funrounds-native.jsonc # Gamedata 特征与偏移
```
---
### 指令列表
-#### 管理员与服务端控制台指令(Console / RCON)
+#### 管理员与控制台指令(Console / RCON)
| 控制台指令 | 参数 | 说明 |
| :--- | :--- | :--- |
| `fr_status` | 无 | 查看当前回合状态、运行阶段、底层能力就绪状态及故障排查信息。 |
-| `fr_list` | 无 | 列出当前配置池中所有已启用的特殊模式列表。 |
-| `fr_next` | `` | 指定下一回合的模式 ID,或恢复随机抽取 (`random`)。 |
+| `fr_list` | 无 | 列出配置池中所有已启用的特殊模式列表。 |
+| `fr_next` | `>` | 指定下一回合的模式 ID(支持直接传 ID 或 `id `),或恢复随机抽取 (`random`)。 |
| `fr_reload` | 无 | 校验并重载配置文件与多语言文本,重载成功于下一回合生效。 |
| `fr_enable` | `<0 \| 1>` | 插件总启停开关:`1` 为启用,`0` 为停用。 |
-#### 玩家控制台与聊天指令
+#### 玩家控制台与聊天快捷指令
-| 控制台指令 | 聊天快捷指令 | 参数 | 说明 |
+| 控制台指令 | 聊天指令 | 参数 | 说明 |
| :--- | :--- | :--- | :--- |
| `fr_info` | `!info` / `!frinfo` | 无 | 在聊天栏中查看当前回合模式名称、编号与玩法说明。 |
-| `fr_help` | `!help` / `!frhelp` | 无 | 查看插件帮助信息及玩家可用指令。 |
+| `fr_help` | `!help` / `!frhelp` | 无 | 查看插件帮助信息及玩家可用指令列表。 |
| `fr_knock` | `!knock` | `[0\|1\|2]` | 设置或切换开火自推反冲(`0` 关闭,`1` 地空全开,`2` 仅空中 [默认],无参依次切换)。 |
| `fr_c4` | `!c4` | 无 | 进攻方在模式允许时按配置价格购买额外 C4。 |
| `fr_suicide` | `!suicide` | 无 | 允许自爆时使用所持或购买的 C4 启动自爆。 |
@@ -136,50 +173,56 @@ game/csgo/addons/plugify/
### 配置说明
-配置文件采用严格 TOML 语法解析。支持 `[defaults]` 全局继承模板为所有模式提供默认参数:
+配置文件采用严格 TOML 语法解析。支持 `[defaults]` 模板为所有模式提供基础属性继承:
```toml
-# 顶层全局设置
-diagnostics = false # 是否开启诊断日志(默认 false)
+# 全局设置
+diagnostics = false # 诊断日志开关
# 多语言配置
[i18n]
default_language = "zh-CN" # 服务端缺省语言("zh-CN" 或 "en")
-# 全局默认模板(模式内未单独设置的字段将继承此处)
+# 可选命名武器组
+# [weapon_groups]
+# basic = ["famas", "p250"]
+
+# 全局默认模板(模式内未设置的字段将继承此处)
[defaults]
gravity = 1.0
bunnyhop = false
[[modes]]
-id = "example" # 模式唯一标识(仅允许字母、数字、'_' 或 '-')
-enabled = true # 是否启用该模式并加入随机池
-name_key = "mode.example.name" # 引用 i18n/*.toml 中的多语言文本键
-description_key = "mode.example.description"
-weapons = ["weapon_famas", "weapon_p250"]
+id = "example" # 模式唯一标识
+enabled = true # 是否启用该模式
+name_key = "mode.example.name" # 多语言名称键
+description_key = "mode.example.description" # 多语言说明键
+weapons = ["famas", "p250"] # 规范物品 ID
-# 阵营发放与清理
-clear_weapons = "all" # 发放前清理武器队伍 (none / all / terrorists / counter_terrorists)
-give_weapons = "all" # 发放候选武器队伍
-give_knife = "all" # 发放刀具队伍
+# 阵营装备配发与清理
+clear_weapons = "all" # 配发前清理武器的队伍 (none / all / terrorists / counter_terrorists)
+give_weapons = "all" # 配发候选武器的队伍
+give_knife = "all" # 配发刀具的队伍
# 基础属性与移动
-health = 120 # 初始生命值 (1~10000,或区间随机 { min = 100, max = 150 })
-armor = 50 # 初始护甲值 (0~255,或区间随机 { min = 0, max = 100 })
-gravity = 1.0 # 重力倍率 (0.0 < g <= 10.0,1.0 为正常重力)
-speed = 1.0 # 移速倍率
+health = 120 # 初始生命值 (1~10000 或随机范围 { min = 100, max = 150 })
+armor = 50 # 初始护甲值 (0~1000 或随机范围 { min = 0, max = 100 })
+gravity = 1.0 # 重力倍率 ((0, 10],1.0 为正常重力)
+speed = 1.0 # 移速倍率 ((0, 10])
self_push = true # 开启开火自推反冲
# 射击与视角控制
-ammo = "reserve" # 弹药模式 (inherit / reserve / clip / single_shot)
+ammo = "reserve" # 弹药规则 (inherit / reserve / clip / single_shot)
headshots = "normal" # 爆头规则 (normal / only / disabled)
fast_switch = true # 快速切枪开关
-# 特殊玩法机制选开
+# 可选玩法突变示例
+# autostrafe = true # 空中辅助转向加速
+# explosive_bullets = { cooldown_seconds = 1.5, damage = 30, radius = 120 } # 爆炸子弹
+# wall_hang = true # 空中贴墙挂墙
+# grapple = { max_distance = 1000.0, max_speed = 600.0, pull_gain = 4.0 } # 抓钩绳索
# lifesteal = true # 吸血恢复
-# suicide = true # 允许自爆玩法
-# third_person = { distance = 64.0, follow_eyes = true, return_strength = 2.0 } # 第三人称视角
-# bomb = { kind = "native", plant_time = 3.0, explode_time = 45.0, bounce = false } # 特殊炸弹
+# third_person = { distance = 64.0, follow_eyes = true, return_strength = 2.0 } # 第三人称
```
@@ -194,23 +237,23 @@ fast_switch = true # 快速切枪开关
#### 1. 编译 Rust 插件
-编译前请确保安装了 Rust `1.99.1`(可通过仓库内的 `rust-toolchain.toml` 自动匹配)。
+工具链要求:Rust `1.99.1`(由 `rust-toolchain.toml` 自动匹配):
```bash
-# 代码格式化检查与 Clippy 静态检查
+# 代码格式化与 Clippy 严格静态检查
cargo fmt --all -- --check
cargo clippy --workspace --all-targets --locked -- -D warnings
-# 运行全量自动化单元测试
+# 执行全量自动化单元测试
cargo test --workspace --locked
-# 编译 Release 发布版本
+# 编译 Release 发布产物
cargo build --release --workspace --locked
```
-#### 2. 编译原生 C++ 扩展
+#### 2. 编译原生 C++ 伴侣扩展
-需要 Python 3.10+、CMake 3.25+ 以及对应平台的 C++20 编译器(MSVC 2022+ 或 GCC 11+):
+要求 Python 3.10+、CMake 3.25+ 以及对应平台的 C++20 编译器(MSVC 2022+ 或 GCC 11+):
```bash
# 构建原生扩展并输出至 dist/native
diff --git a/bindings/s2sdk.pplugin b/bindings/s2sdk.pplugin
index a4d2650..cd4894d 100644
--- a/bindings/s2sdk.pplugin
+++ b/bindings/s2sdk.pplugin
@@ -1,6 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/untrustedmodders/plugify/refs/heads/main/schemas/plugin.schema.json",
- "version": "3.0.6",
+ "version": "3.3.1",
"name": "s2sdk",
"description": "Provides functionality for other plugins from Source 2 engine",
"author": "untrustedmodders",
@@ -3494,6 +3494,382 @@
"retType": {
"type": "void"
}
+ },
+ {
+ "name": "GetClientKills",
+ "group": "Clients",
+ "description": "Retrieves the number of kills for a client.",
+ "funcName": "GetClientKills",
+ "paramTypes": [
+ {
+ "name": "playerSlot",
+ "type": "int32",
+ "ref": false,
+ "description": "The index of the player's slot."
+ }
+ ],
+ "retType": {
+ "type": "int32",
+ "description": "The number of kills the client has, or 0 if the player slot is invalid."
+ }
+ },
+ {
+ "name": "GetClientDeaths",
+ "group": "Clients",
+ "description": "Retrieves the number of deaths for a client.",
+ "funcName": "GetClientDeaths",
+ "paramTypes": [
+ {
+ "name": "playerSlot",
+ "type": "int32",
+ "ref": false,
+ "description": "The index of the player's slot."
+ }
+ ],
+ "retType": {
+ "type": "int32",
+ "description": "The number of deaths the client has, or 0 if the player slot is invalid."
+ }
+ },
+ {
+ "name": "GetEventFloat",
+ "group": "Events",
+ "description": "Retrieves the float value of a game event's key.",
+ "funcName": "GetEventFloat",
+ "paramTypes": [
+ {
+ "name": "event",
+ "type": "ptr64",
+ "ref": false,
+ "description": "A pointer to the IGameEvent object containing event data."
+ },
+ {
+ "name": "key",
+ "type": "string",
+ "ref": false,
+ "description": "The key for which to retrieve the float value."
+ }
+ ],
+ "retType": {
+ "type": "float",
+ "description": "The float value associated with the key."
+ }
+ },
+ {
+ "name": "CreateConVarBool",
+ "group": "Cvars",
+ "description": "Creates a new boolean console variable.",
+ "funcName": "CreateConVarBool",
+ "paramTypes": [
+ {
+ "name": "name",
+ "type": "string",
+ "ref": false,
+ "description": "The name of the console variable."
+ },
+ {
+ "name": "defaultValue",
+ "type": "bool",
+ "ref": false,
+ "description": "The default value for the console variable."
+ },
+ {
+ "name": "description",
+ "type": "string",
+ "ref": false,
+ "description": "A brief description of the console variable."
+ },
+ {
+ "name": "flags",
+ "type": "int64",
+ "ref": false,
+ "description": "Flags that define the behavior of the console variable.",
+ "enum": "ConVarFlag"
+ },
+ {
+ "name": "hasMin",
+ "type": "bool",
+ "ref": false,
+ "description": "Indicates if a minimum value is provided."
+ },
+ {
+ "name": "min",
+ "type": "bool",
+ "ref": false,
+ "description": "The minimum value if hasMin is true."
+ },
+ {
+ "name": "hasMax",
+ "type": "bool",
+ "ref": false,
+ "description": "Indicates if a maximum value is provided."
+ },
+ {
+ "name": "max",
+ "type": "bool",
+ "ref": false,
+ "description": "The maximum value if hasMax is true."
+ }
+ ],
+ "retType": {
+ "type": "uint64",
+ "description": "A handle to the created console variable data."
+ }
+ },
+ {
+ "name": "ChangeClientTeam",
+ "group": "Clients",
+ "description": "Changes the player's team.",
+ "funcName": "ChangeClientTeam",
+ "paramTypes": [
+ {
+ "name": "playerSlot",
+ "type": "int32",
+ "ref": false,
+ "description": "The index of the player's slot."
+ },
+ {
+ "name": "team",
+ "type": "int32",
+ "ref": false,
+ "description": "The team index to change the client to.",
+ "enum": "CSTeam"
+ }
+ ],
+ "retType": {
+ "type": "void"
+ }
+ },
+ {
+ "name": "FakeClientCommand",
+ "group": "Commands",
+ "description": "Executes a client command on the server without network communication.",
+ "funcName": "FakeClientCommand",
+ "paramTypes": [
+ {
+ "name": "playerSlot",
+ "type": "int32",
+ "ref": false,
+ "description": "The index of the client."
+ },
+ {
+ "name": "command",
+ "type": "string",
+ "ref": false,
+ "description": "The command to be executed by the client."
+ }
+ ],
+ "retType": {
+ "type": "void"
+ }
+ },
+ {
+ "name": "GetCurrentMap",
+ "group": "Engine",
+ "description": "Returns the current map name.",
+ "funcName": "GetCurrentMap",
+ "paramTypes": [],
+ "retType": {
+ "type": "string",
+ "description": "A reference to a string where the current map name will be stored."
+ }
+ },
+ {
+ "name": "GetGameDirectory",
+ "group": "Engine",
+ "description": "Returns the path of the game's directory.",
+ "funcName": "GetGameDirectory",
+ "paramTypes": [],
+ "retType": {
+ "type": "string",
+ "description": "A reference to a string where the game directory path will be stored."
+ }
+ },
+ {
+ "name": "TraceLine",
+ "group": "Trace",
+ "description": "Performs a line trace between two points.",
+ "funcName": "TraceLine",
+ "paramTypes": [
+ {
+ "name": "startPos",
+ "type": "vec3",
+ "ref": false,
+ "description": "Trace start position"
+ },
+ {
+ "name": "endPos",
+ "type": "vec3",
+ "ref": false,
+ "description": "Trace end position"
+ },
+ {
+ "name": "mask",
+ "type": "int32",
+ "ref": false,
+ "description": "Trace mask"
+ },
+ {
+ "name": "ignoreHandle",
+ "type": "int32",
+ "ref": false,
+ "description": "Entity handle to ignore during trace"
+ },
+ {
+ "name": "outPos",
+ "type": "vec3",
+ "ref": true,
+ "description": "Output: position of impact"
+ },
+ {
+ "name": "outFraction",
+ "type": "double",
+ "ref": true,
+ "description": "Output: fraction of trace completed"
+ },
+ {
+ "name": "outHit",
+ "type": "bool",
+ "ref": true,
+ "description": "Output: whether a hit occurred"
+ },
+ {
+ "name": "outEntHit",
+ "type": "int32",
+ "ref": true,
+ "description": "Output: handle of entity hit"
+ },
+ {
+ "name": "outStartSolid",
+ "type": "bool",
+ "ref": true,
+ "description": "Output: whether trace started inside solid"
+ }
+ ],
+ "retType": {
+ "type": "bool",
+ "description": "True if trace hit something, false otherwise"
+ }
+ },
+ {
+ "name": "OnEntitySpawned_Register",
+ "group": "Listeners",
+ "description": "Register callback to event.",
+ "funcName": "OnEntitySpawned_Register",
+ "paramTypes": [
+ {
+ "name": "callback",
+ "type": "function",
+ "ref": false,
+ "description": "Function callback.",
+ "prototype": "OnEntitySpawnedCallback"
+ }
+ ],
+ "retType": {
+ "type": "void"
+ }
+ },
+ {
+ "name": "OnEntitySpawned_Unregister",
+ "group": "Listeners",
+ "description": "Unregister callback to event.",
+ "funcName": "OnEntitySpawned_Unregister",
+ "paramTypes": [
+ {
+ "name": "callback",
+ "type": "function",
+ "ref": false,
+ "description": "Function callback.",
+ "prototype": "OnEntitySpawnedCallback"
+ }
+ ],
+ "retType": {
+ "type": "void"
+ }
+ },
+ {
+ "name": "GetEntSchemaColor",
+ "group": "Schema",
+ "description": "Retrieves a color value from an entity's schema.",
+ "funcName": "GetEntSchemaColor",
+ "paramTypes": [
+ {
+ "name": "entityHandle",
+ "type": "int32",
+ "ref": false,
+ "description": "The handle of the entity from which the value is to be retrieved."
+ },
+ {
+ "name": "className",
+ "type": "string",
+ "ref": false,
+ "description": "The name of the class."
+ },
+ {
+ "name": "memberName",
+ "type": "string",
+ "ref": false,
+ "description": "The name of the schema member."
+ },
+ {
+ "name": "element",
+ "type": "int32",
+ "ref": false,
+ "description": "Element # (starting from 0) if schema is an array."
+ }
+ ],
+ "retType": {
+ "type": "vec4",
+ "description": "A color value at the given schema offset."
+ }
+ },
+ {
+ "name": "SetEntSchemaColor",
+ "group": "Schema",
+ "description": "Sets a color value in an entity's schema.",
+ "funcName": "SetEntSchemaColor",
+ "paramTypes": [
+ {
+ "name": "entityHandle",
+ "type": "int32",
+ "ref": false,
+ "description": "The handle of the entity from which the value is to be retrieved."
+ },
+ {
+ "name": "className",
+ "type": "string",
+ "ref": false,
+ "description": "The name of the class."
+ },
+ {
+ "name": "memberName",
+ "type": "string",
+ "ref": false,
+ "description": "The name of the schema member."
+ },
+ {
+ "name": "value",
+ "type": "vec4",
+ "ref": false,
+ "description": "The color value to set."
+ },
+ {
+ "name": "changeState",
+ "type": "bool",
+ "ref": false,
+ "description": "If true, change will be sent over the network."
+ },
+ {
+ "name": "element",
+ "type": "int32",
+ "ref": false,
+ "description": "Element # (starting from 0) if schema is an array."
+ }
+ ],
+ "retType": {
+ "type": "void",
+ "description": "A color value at the given schema offset."
+ }
}
],
"classes": [],
@@ -3612,6 +3988,22 @@
"type": "void",
"description": ""
}
+ },
+ {
+ "name": "OnEntitySpawnedCallback",
+ "funcName": "OnEntitySpawnedCallback",
+ "description": "Called when an entity is spawned.",
+ "paramTypes": [
+ {
+ "name": "entityHandle",
+ "type": "int32",
+ "description": "The spawned entity handle"
+ }
+ ],
+ "retType": {
+ "type": "void",
+ "description": ""
+ }
}
],
"enums": [
diff --git a/config/funrounds.example.toml b/config/funrounds.example.toml
index b1ec3de..db4fca0 100644
--- a/config/funrounds.example.toml
+++ b/config/funrounds.example.toml
@@ -63,6 +63,10 @@ diagnostics = false
[i18n]
default_language = "zh-CN"
+# [weapon_groups]:可选命名武器组,模式用 weapons = "@basic" 引用。
+# [weapon_groups]
+# basic = ["famas", "p250"]
+
# [defaults]:全局默认模板(仅接受玩法字段;模式内单独设置优先)
# 可用 false 显式重置可选继承项(如 color, bomb, respawn 等)
# 示例:
@@ -80,11 +84,11 @@ enabled = true
name_key = "mode.example.name"
description_key = "mode.example.description"
-# weapons:受支持的 CS2 装备候选列表(按主武器、副武器和额外装备抽取;不含刀具,刀具由 give_knife 配置)
-weapons = ["weapon_famas", "weapon_p250"]
+# weapons:按主武器、副武器和额外装备抽取。使用不带 weapon_ 前缀的物品 ID;刀具由 give_knife 配发。
+weapons = ["famas", "p250"]
# health:初始生命(整数 1~10000,或随机范围 { min = 100, max = 150 },默认 100)
health = 120
-# armor:初始护甲(整数 0~255,或随机范围 { min = 0, max = 100 },默认 0)
+# armor:初始护甲(整数 0~1000,或随机范围 { min = 0, max = 100 },默认 0)
armor = 50
# gravity:重力倍率((0, 10],1.0 为正常重力,<1.0 降低重力)
gravity = 1.0
@@ -108,13 +112,15 @@ give_weapons = "all"
# ammo = "inherit"
# self_damage:开火自伤设置(kind = "miss_penalty" 未命中扣血 / kind = "native", amount = 0.1 每次自扣伤害)
# self_damage = { kind = "miss_penalty" }
-# weapon_damage:特定武器伤害倍率(电击枪与刀具可分别设置,默认 1.0)
+# weapon_damage:按物品 ID 设置伤害倍率(有限非负数,未指定的物品用 1.0)
# weapon_damage = { taser = 1.0, knife = 1.0 }
-# taser_charge:电击枪充能冷却时间(秒,需 weapons 包含 weapon_taser)
+# taser_charge:电击枪充能冷却时间(秒,需 weapons 包含 taser)
# taser_charge = 12.0
# bunnyhop:开启自动连跳及移动参数优化(省略时不覆盖服务端设置)
# bunnyhop = true
+# autostrafe:在空中辅助转向加速(默认 false)
+# autostrafe = true
# friction:地面摩擦力参数(有限非负数,省略时不覆盖服务端设置)
# friction = 2.0
# no_spread:移除武器散布(省略时不覆盖服务端设置)
@@ -125,8 +131,9 @@ give_weapons = "all"
# recoil_view = 1.0
# fast_switch:快速切枪开关(默认 false)
# fast_switch = true
-# replenish:投掷后自动补充的手雷类型列表(可选 he / flash / smoke / decoy / molotov / incendiary)
-# replenish = ["he"]
+# replenish:投掷后自动补充,所列物品也需加入 weapons。
+# 可选 hegrenade / flashbang / smokegrenade / decoy / molotov / incgrenade。
+# replenish = ["hegrenade"]
# random_loadout:从候选池独立随机抽取配装(与 kill_loadout 互斥)
# random_loadout = true
@@ -134,7 +141,7 @@ give_weapons = "all"
# suicide = true
# random_damage:是否开启浮动随机战斗伤害(默认 false)
# random_damage = true
-# kill_loadout:击杀敌人后自动升级换枪(kill_loadout_start 可设 "glock" 或 "random")
+# kill_loadout:击杀敌人后自动换枪;初始配装可选 "random" 或 "glock"(需在候选中加入 glock)。
# kill_loadout = true
# kill_loadout_start = "random"
# lifesteal:击中敌人吸血恢复生命与护甲(默认 false)
@@ -156,7 +163,7 @@ give_weapons = "all"
# 可用内联表设置:
# bomb = { kind = "native", plant_time = 3.0, explode_time = 45.0, defuse_kit_time = 5.0, defuse_time = 10.0, bounce = false }
-# dodgeball:诱饵弹命中触发躲避球直接伤害(需 weapons 包含 weapon_decoy)
+# dodgeball:诱饵弹命中触发躲避球直接伤害(需 weapons 包含 decoy)
# dodgeball = true
# throwing_knives:右键投掷飞刀及弹射判定(需配发刀具)
# throwing_knives = true
@@ -166,7 +173,7 @@ give_weapons = "all"
# no_scope = true
# fov:设定玩家视野角度(整数 1~179)
# fov = 90
-# hide_hud:隐藏指定 HUD 元素列表(可选 "radar", "crosshair")
+# hide_hud:隐藏指定 HUD 元素(可选 "all"、"radar"、"crosshair";勿与旧键 hide_radar 同时填写)
# hide_hud = ["radar", "crosshair"]
# hide_crosshair_after:延迟隐藏准星时间(秒,需搭配 hide_hud 中的 crosshair 使用)
# hide_crosshair_after = 1.0
@@ -179,10 +186,10 @@ give_weapons = "all"
# health_decay = true
# self_push:开火产生自身反冲推力(可通过指令 fr_knock 切换模式)
# self_push = true
-# periodic_speed:移速周期性波浪起伏变化(默认 false)
-# periodic_speed = true
-# periodic_gravity:重力周期性高低起伏变化(默认 false)
-# periodic_gravity = true
+# periodic_speed / periodic_gravity:每隔指定秒数随机更新倍率。
+# true 使用内置分布,false 关闭;自定义时用正数列表 values 或正数闭区间 min/max。
+# periodic_speed = { interval_seconds = 8.0, values = [0.9, 1.1] }
+# periodic_gravity = { interval_seconds = 8.0, min = 0.8, max = 1.2 }
# c4_count:进攻方(T)普通 C4 数量上限(整数 0~255;设为 0 完全禁用普通 C4)
# c4_count = 1
@@ -204,13 +211,13 @@ give_weapons = "all"
# fall_damage_scale = 1.0 # 坠落伤害倍率
# time_scale = 1.0 # 游戏全局时间流速倍率
# ground_acceleration = 5.0 # 地面加速度
-# ground_reverse = 5.0 # 地面输入反向加速度(倒车行走)
+# ground_reverse = 5.0 # 地面输入反向加速度;需省略 ground_acceleration 或将其设为 0
# round_money_floor = 1000 # 每回合保底现金
# money_income = { interval = 10.0, amount = 100 } # 定期发放被动收入
# buy_access = "all" # 允许购买物品的队伍
# buy_anywhere = "all" # 允许在地图任意位置购买的队伍
# shoot_dropped_grenades = true # 允许射击引爆掉落的手雷
-# hide_player_identification = true# 隐藏玩家瞄准识别信息
+# hide_player_identification = true # 隐藏玩家瞄准识别信息
# third_person:第三人称视角
# third_person = { distance = 64.0, follow_eyes = true, clip_camera_offset = true, return_strength = 2.0 }
@@ -225,3 +232,26 @@ give_weapons = "all"
# health_curve:自定义生命缩放曲线(覆盖内置 health_damage / health_speed 曲线)
# health_decay_settings:自定义额外生命衰减速率与保底百分比
+
+# 下列能力各自可选;每一行都是独立示例,不需要一起启用。
+# damage_multiplier = 1.1 # 通用伤害倍率(有限非负数)
+# inferno_damage = 12.0 # 地面燃烧伤害(有限非负数)
+# teamkill_limit = 2 # 触发队杀惩罚的次数阈值(正整数)
+# death_explosion = { t = 1, ct = 0 } # 每回合从各队选出死亡时爆炸的玩家人数上限;整数 0~255,0 关闭
+# explosive_bullets = { cooldown_seconds = 1.5, damage = 30, radius = 120 } # 子弹命中爆炸;伤害和半径支持正整数或区间
+# hegrenade_impulse = { impulse = 220.0 } # HE 爆炸施加推力(有限非负数)
+# proximity_fuse = { radius = 128.0, delay_seconds = 0.5, grenades = ["hegrenade"] } # 接近敌人时触发引信;不支持诱饵弹
+# he_guidance = { range = 1000.0, turn_rate_degrees_per_second = 90.0, max_speed = 700.0, max_guidance_seconds = 2.0 } # HE 追踪,参数均为正数
+# wall_hang = true # 空中贴墙并按住跳跃时挂墙
+# grapple = { max_distance = 1000.0, max_speed = 600.0, pull_gain = 4.0 } # 使用键拉向瞄准点,参数均为正数
+# friendly_fire_heal = { kind = "fixed", amount = 8 } # 友军命中转治疗;或用 kind = "damage_ratio" 和 ratio
+# regeneration = { delay_seconds = 4.0, interval_seconds = 2.0, heal = 3 } # 脱离战斗后延迟并定时回血
+# chicken_aura = { radius = 100.0, interval_seconds = 2.0, heal_percent = 2.0 } # 普通鸡附近定时回血,需配置普通鸡生态
+# healing_cap_base_multiple = 1.2 # 上述治疗能力使用的初始生命上限倍率(有限正数)
+# medical_smoke = true # 烟雾区域内治疗友军
+# trampoline = true # 在受支持地图的固定区域内弹起玩家
+# dont_stop = { minimum_horizontal_speed = 60.0, grace_seconds = 3.0, damage_interval_seconds = 1.0, damage = 2 } # 移速过低时扣血
+# hot_floor = { grounded_seconds = 3.0, damage_interval_seconds = 1.0, damage = 2, ignite_after_seconds = 6.0 } # 持续站地扣血,久留则点燃
+# weapon_on_fire = { chance = 0.15, switch_weight = 2, drop_weight = 1, cooldown_seconds = 1.0 } # 开火后按概率切枪或掉枪;权重至少一个为正
+# long_flash = { duration_multiplier = 1.5, duration_cap_seconds = 8.0 } # 延长闪光效果,不缩短原生时长
+# big_head = { min_scale = 0.9, max_scale = 1.3 } # 头部缩放区间,倍率为正且 min_scale <= max_scale
diff --git a/config/i18n/en.toml b/config/i18n/en.toml
index 3439122..9991760 100644
--- a/config/i18n/en.toml
+++ b/config/i18n/en.toml
@@ -18,9 +18,10 @@
"command.next" = "[FunRounds] Next mode: {mode}"
"command.no_config" = "[FunRounds] No valid configuration found."
"command.reload" = "[FunRounds] Configuration and texts queued for the next round."
-"command.usage" = "Usage: fr_status | fr_list | fr_next | fr_reload | fr_enable <0|1> | fr_info | fr_help | fr_knock [0|1|2] | fr_chicken | fr_healthshot | fr_nvg | fr_wire "
+"command.usage" = "Usage: fr_status | fr_list | fr_next | fr_next id | fr_reload | fr_enable <0|1> | fr_info | fr_help | fr_knock [0|1|2] | fr_chicken | fr_healthshot | fr_nvg | fr_wire "
"command.wire_usage" = "Usage: fr_wire "
"config.unavailable" = "Configuration unavailable."
+"death_explosion.armed" = "[FunRounds] You are rigged to explode when you die this life!"
"feedback.error" = "[FunRounds] Error: {error}"
"healthshot.already_owned" = "You already have a healthshot."
"healthshot.pending" = "Healthshot transaction in progress."
@@ -66,6 +67,7 @@
"team.finished" = "[FunRounds] Team deathmatch finished: T {t} : {ct} CT"
"team.info" = "\nScore: T {t} : {ct} CT\nTime remaining: {seconds}s"
"team.waiting" = "\nScore: T 0 : 0 CT\nTime: starts after freeze time"
+"trampoline.launched" = "Trampoline launched!"
"warmup.description" = "Warmup round"
"warmup.name" = "Warmup"
"welcome" = "[FunRounds] Plugin version {version} loaded."
diff --git a/config/i18n/zh-CN.toml b/config/i18n/zh-CN.toml
index 96280d2..3bccc5d 100644
--- a/config/i18n/zh-CN.toml
+++ b/config/i18n/zh-CN.toml
@@ -18,9 +18,10 @@
"command.next" = "[FunRounds] 下一模式:{mode}"
"command.no_config" = "[FunRounds] 未找到有效配置"
"command.reload" = "[FunRounds] 配置与多语言文本已排队,将于下一回合生效"
-"command.usage" = "用法:fr_status | fr_list | fr_next | fr_reload | fr_enable <0|1> | fr_info | fr_help | fr_knock [0|1|2] | fr_chicken | fr_healthshot | fr_nvg | fr_wire "
+"command.usage" = "用法:fr_status | fr_list | fr_next | fr_next id | fr_reload | fr_enable <0|1> | fr_info | fr_help | fr_knock [0|1|2] | fr_chicken | fr_healthshot | fr_nvg | fr_wire "
"command.wire_usage" = "用法:fr_wire "
"config.unavailable" = "配置暂不可用"
+"death_explosion.armed" = "[FunRounds] 你被绑上了炸药:本条命死亡时会引爆!"
"feedback.error" = "[FunRounds] 错误:{error}"
"healthshot.already_owned" = "已持有医疗针,无需重复购买"
"healthshot.pending" = "医疗针事务处理中"
@@ -66,6 +67,7 @@
"team.finished" = "[FunRounds] 团队死斗结束 T {t} : {ct} CT"
"team.info" = "\n比分:T {t} : {ct} CT\n剩余时间:{seconds}s"
"team.waiting" = "\n比分:T 0 : 0 CT\n剩余时间:计时未开始(冻结结束后开始)"
+"trampoline.launched" = "蹦床触发!"
"warmup.description" = "热身回合"
"warmup.name" = "热身"
"welcome" = "[FunRounds] 插件版本 {version} 已加载"
diff --git a/crates/funrounds-core/assets/i18n/en.toml b/crates/funrounds-core/assets/i18n/en.toml
new file mode 100644
index 0000000..61f2266
--- /dev/null
+++ b/crates/funrounds-core/assets/i18n/en.toml
@@ -0,0 +1,84 @@
+[messages]
+"c4.owned" = "[FunRounds] You already have C4."
+"c4.owned_suicide" = "[FunRounds] You already have C4; inspect it to start suicide."
+"c4.pending" = "A C4 transaction is in progress."
+"c4.purchased" = "[FunRounds] C4 purchased."
+"c4.purchased_inspect" = "[FunRounds] C4 purchased; inspect it to start suicide."
+"c4.purchased_start" = "[FunRounds] C4 purchased; suicide requested."
+"c4.request" = "[FunRounds] Buying C4 for {price} cash."
+"c4.t_required" = "Only Ts can buy C4."
+"c4.unavailable" = "C4 purchase or suicide is unavailable now."
+"chicken.pending" = "A chicken transaction is in progress."
+"chicken.position_invalid" = "Cannot place a chicken at your current position."
+"chicken.purchased" = "[FunRounds] Chicken purchased."
+"chicken.request" = "[FunRounds] Buying a chicken for {price} cash."
+"chicken.team_required" = "Join a playing team to buy a chicken."
+"chicken.unavailable" = "Chicken purchases are unavailable."
+"command.enabled" = "[FunRounds] enabled={enabled}; activation begins at the next round"
+"command.next" = "[FunRounds] Next mode={mode}"
+"command.no_config" = "[FunRounds] No valid active configuration."
+"command.reload" = "[FunRounds] Valid configuration and texts queued for the next round."
+"command.usage" = "Usage: fr_status | fr_list | fr_next | fr_next id | fr_reload | fr_enable <0|1> | fr_info | fr_help | fr_knock [0|1|2] | fr_chicken | fr_healthshot | fr_nvg | fr_wire "
+"command.wire_usage" = "Usage: fr_wire "
+"config.unavailable" = "Configuration is unavailable."
+"death_explosion.armed" = "[FunRounds] You are rigged to explode when you die this life!"
+"feedback.error" = "[FunRounds] Error: {error}"
+"healthshot.already_owned" = "You already have a healthshot."
+"healthshot.pending" = "A healthshot transaction is in progress."
+"healthshot.purchased" = "[FunRounds] Healthshot purchased."
+"healthshot.request" = "[FunRounds] Buying a healthshot for {price} cash."
+"healthshot.team_required" = "Join a playing team to buy a healthshot."
+"healthshot.unavailable" = "Healthshot purchases are unavailable."
+"help.body" = "fr_info / !info / !frinfo — Show the current mode\nfr_help / !help / !frhelp — Show help\nfr_knock [0|1|2] / !knock [0|1|2] — Self-push: 0 off, 1 ground and air, 2 airborne only (default); omit the value to cycle\nfr_c4 / !c4 — T players can buy C4 at the configured cash price when ordinary purchases are allowed\nfr_suicide / !suicide — Start a suicide blast with owned or newly purchased C4 when enabled\nfr_chicken / !chicken — Buy one ordinary chicken at the configured cash price\nfr_healthshot / !healthshot — Buy one healthshot at the configured cash price\nfr_nvg / !nvg — Toggle night vision\nfr_wire / !wire — Choose a plant or defuse wire; otherwise keep the mode's normal timer"
+"info.mode" = "State: {phase}\nMode: {id} {name}\nDescription: {description}"
+"info.ordinary" = "Current mode: ordinary gameplay"
+"info.shield" = "\nActual shield: {shield}"
+"knock.airborne" = "Airborne only"
+"knock.always" = "Ground and air"
+"knock.off" = "Off"
+"mode.chat.id" = "Round ID: {id}"
+"mode.console" = "[FunRounds] Mode name: {name}\n[FunRounds] Mode ID: {id}"
+"mode.example.description" = "Demonstrates basic equipment and player attributes"
+"mode.example.name" = "Generic example"
+"nvg.alive_required" = "Night vision requires an alive in-game player."
+"nvg.disabled" = "[FunRounds] Night vision disabled."
+"nvg.enabled" = "[FunRounds] Night vision enabled."
+"phase.ordinary" = "Ordinary gameplay"
+"phase.preparing" = "Preparing"
+"phase.running" = "Running"
+"phase.warmup" = "Warmup"
+"player.alive_required" = "An alive in-game player is required."
+"player.life_pending" = "Your current life is not ready yet."
+"preference.failed" = "Self-push: {value} (save failed: {error})"
+"preference.queued" = "Self-push: {value} (saved)."
+"preference.save_failed" = "Failed to save self-push preference: {error}"
+"preference.session" = "Self-push: {value} (this session only)."
+"preference.unchanged" = "Self-push: {value} (unchanged)."
+"public.unavailable" = "FunRounds public actions are unavailable."
+"purchase.c4_t_only" = "Only Ts can buy C4."
+"purchase.cancelled" = "Purchase cancelled."
+"purchase.debit" = "Cash charge failed: {error}"
+"purchase.insufficient" = "Buying {item} requires {price} cash."
+"purchase.item.c4" = "C4"
+"purchase.item.chicken" = "chicken"
+"purchase.item.healthshot" = "healthshot"
+"purchase.ownership_changed" = "Delivery failed; cash ownership changed, refund not completed: {error}"
+"purchase.refund_failed" = "Delivery failed; refund failed: {error}"
+"purchase.refunded" = "Delivery failed; cash refunded: {error}"
+"suicide.ct_broadcast" = "[FunRounds] A CT is destroying C4!"
+"suicide.start_broadcast" = "[FunRounds] Suicide started; explosion in five seconds!"
+"suicide.started" = "Suicide has already started."
+"team.finished" = "[FunRounds] Team match finished T {t} : {ct} CT"
+"team.info" = "\nScore: T {t} : {ct} CT\nTime remaining: {seconds}s"
+"team.waiting" = "\nScore: T 0 : 0 CT\nTime: starts after freeze time"
+"trampoline.launched" = "Trampoline launched!"
+"warmup.description" = "Warmup round"
+"warmup.name" = "Warmup"
+"welcome" = "[FunRounds] Plugin version {version} loaded."
+"wire.ct_required" = "Only the current CT defuser can cut a wire."
+"wire.defuse_help" = "[FunRounds] Cut Blue / Yellow / Red / Green using !wire or fr_wire ; otherwise keep the normal timer."
+"wire.defused" = "[FunRounds] Correct {wire} wire; native quick defuse requested."
+"wire.exploded" = "[FunRounds] Wrong {wire} wire; native explosion requested."
+"wire.no_defuse" = "You have not started defusing this supported native C4."
+"wire.plant_help" = "[FunRounds] Choose Blue / Yellow / Red / Green with !wire or fr_wire ; otherwise random."
+"wire.plant_selected" = "[FunRounds] Planting wire selected: {wire}."
diff --git a/crates/funrounds-core/assets/i18n/zh-CN.toml b/crates/funrounds-core/assets/i18n/zh-CN.toml
new file mode 100644
index 0000000..5d43a9a
--- /dev/null
+++ b/crates/funrounds-core/assets/i18n/zh-CN.toml
@@ -0,0 +1,84 @@
+[messages]
+"c4.owned" = "[FunRounds] 已有C4,无需重复购买"
+"c4.owned_suicide" = "[FunRounds] 已有C4,无需重复购买;使用C4按F可启动自爆"
+"c4.pending" = "C4事务正在处理"
+"c4.purchased" = "[FunRounds] C4购买成功"
+"c4.purchased_inspect" = "[FunRounds] C4购买成功;按F启动自爆"
+"c4.purchased_start" = "[FunRounds] C4购买成功并开启自爆"
+"c4.request" = "[FunRounds] 正在购买C4,价格{price}现金"
+"c4.t_required" = "只有T可以购买C4"
+"c4.unavailable" = "现在不能购买C4或自爆"
+"chicken.pending" = "正在处理鸡"
+"chicken.position_invalid" = "当前位置无法买鸡"
+"chicken.purchased" = "[FunRounds] 鸡购买成功"
+"chicken.request" = "[FunRounds] 正在购买鸡,价格{price}现金"
+"chicken.team_required" = "现在不能购买鸡"
+"chicken.unavailable" = "鸡购买当前不可用"
+"command.enabled" = "[FunRounds] enabled={enabled};下一回合开始应用"
+"command.next" = "[FunRounds] 下一模式={mode}"
+"command.no_config" = "[FunRounds] 没有有效的配置"
+"command.reload" = "[FunRounds] 有效配置和文本已排队,将于下一回合应用"
+"command.usage" = "用法:fr_status | fr_list | fr_next | fr_next id | fr_reload | fr_enable <0|1> | fr_info | fr_help | fr_knock [0|1|2] | fr_chicken | fr_healthshot | fr_nvg | fr_wire "
+"command.wire_usage" = "用法:fr_wire "
+"config.unavailable" = "配置不可用"
+"death_explosion.armed" = "[FunRounds] 你被绑上了炸药:本条命死亡时会引爆!"
+"feedback.error" = "[FunRounds] 错误:{error}"
+"healthshot.already_owned" = "已有医疗针,无需重复购买"
+"healthshot.pending" = "医疗针事务正在处理"
+"healthshot.purchased" = "[FunRounds] 医疗针购买成功"
+"healthshot.request" = "[FunRounds] 正在购买医疗针,价格{price}现金"
+"healthshot.team_required" = "现在不能购买医疗针"
+"healthshot.unavailable" = "医疗针购买当前不可用"
+"help.body" = "fr_info / !info / !frinfo — 查看当前模式\nfr_help / !help / !frhelp — 查看帮助\nfr_knock [0|1|2] / !knock [0|1|2] — 开枪击退:0关闭/1地面及空中/2仅空中(默认);无参数依次切换\nfr_c4 / !c4 — T队在允许普通购买时,按配置现金价格购买C4\nfr_suicide / !suicide — 允许自爆时,使用已有C4或购买后自爆\nfr_chicken / !chicken — 购买一只普通鸡,使用配置现金价格\nfr_healthshot / !healthshot — 购买一支医疗针,使用配置现金价格\nfr_nvg / !nvg — 切换夜视仪\nfr_wire / !wire — 选安包剪线或当前拆弹剪线;不选则不使用此机制"
+"info.mode" = "状态:{phase}\n模式:{id} {name}\n说明:{description}"
+"info.ordinary" = "当前模式:普通游戏"
+"info.shield" = "\n实际护盾:{shield}"
+"knock.airborne" = "仅空中"
+"knock.always" = "地面及空中"
+"knock.off" = "关闭"
+"mode.chat.id" = "回合编号 : {id}"
+"mode.console" = "[FunRounds] 回合名称 : {name}\n[FunRounds] 回合编号 : {id}"
+"mode.example.description" = "演示基础配装与玩家属性"
+"mode.example.name" = "通用示例"
+"nvg.alive_required" = "你死了,无法使用夜视仪"
+"nvg.disabled" = "[FunRounds] 夜视仪已关闭"
+"nvg.enabled" = "[FunRounds] 夜视仪已开启"
+"phase.ordinary" = "普通游戏"
+"phase.preparing" = "准备"
+"phase.running" = "进行"
+"phase.warmup" = "热身"
+"player.alive_required" = "你死了,无法使用"
+"player.life_pending" = "角色未就绪,暂无法使用"
+"preference.failed" = "开枪击退:{value}(保存失败:{error})"
+"preference.queued" = "开枪击退:{value}"
+"preference.save_failed" = "开枪击退偏好保存失败:{error}"
+"preference.session" = "开枪击退:{value}(仅本次会话)"
+"preference.unchanged" = "开枪击退:{value}(设置未更改)"
+"public.unavailable" = "FunRounds公共行为当前不可用"
+"purchase.c4_t_only" = "只有T可以购买C4"
+"purchase.cancelled" = "购买已取消"
+"purchase.debit" = "现金扣款失败:{error}"
+"purchase.insufficient" = "购买{item}需要{price}现金"
+"purchase.item.c4" = "C4"
+"purchase.item.chicken" = "鸡"
+"purchase.item.healthshot" = "医疗针"
+"purchase.ownership_changed" = "发放失败,现金所有权已改变,退款未完成:{error}"
+"purchase.refund_failed" = "发放失败,退款失败:{error}"
+"purchase.refunded" = "发放失败,已退还现金:{error}"
+"suicide.ct_broadcast" = "[FunRounds] CT正在销毁C4!"
+"suicide.start_broadcast" = "[FunRounds] 自爆已启动,五秒后爆炸!"
+"suicide.started" = "已启动自爆"
+"team.finished" = "[FunRounds] 团队竞技结束 T {t} : {ct} CT"
+"team.info" = "\n比分:T {t} : {ct} CT\n剩余时间:{seconds}s"
+"team.waiting" = "\n比分:T 0 : 0 CT\n剩余时间:计时未开始(冻结结束后开始)"
+"trampoline.launched" = "蹦床触发!"
+"warmup.description" = "热身回合"
+"warmup.name" = "热身"
+"welcome" = "[FunRounds] FunRounds!插件版本 {version} 已加载"
+"wire.ct_required" = "剪线需要是CT才可以"
+"wire.defuse_help" = "[FunRounds] 选择正确的线可以快速拆包:蓝Blue/黄Yellow/红Red/绿Green;输入 !wire 或 fr_wire "
+"wire.defused" = "[FunRounds] {wire} 剪线中"
+"wire.exploded" = "[FunRounds] {wire} 线错了"
+"wire.no_defuse" = "还没有开始拆包"
+"wire.plant_help" = "[FunRounds] 安包时可选剪线颜色:蓝Blue/黄Yellow/红Red/绿Green;输入 !wire 或 fr_wire ;不选则随机。"
+"wire.plant_selected" = "[FunRounds] 已选择安包剪线颜色 {wire}。"
diff --git a/crates/funrounds-core/src/abilities.rs b/crates/funrounds-core/src/abilities.rs
new file mode 100644
index 0000000..565ce53
--- /dev/null
+++ b/crates/funrounds-core/src/abilities.rs
@@ -0,0 +1,830 @@
+// Copyright (C) 2026 Mai Ooizumi
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+use crate::AttributeValue;
+use crate::GrenadeKind;
+use serde::Deserialize;
+
+#[derive(Clone, Copy, Debug, PartialEq)]
+pub enum HealingAmount {
+ Fixed(i32),
+ Percent(f32),
+}
+
+impl HealingAmount {
+ /// Converts configured healing to whole HP using the current life's spawn health.
+ /// Percentage values use human-readable percentage points (e.g. 5.0 means 5%).
+ pub fn amount(self, base_health: i32) -> Option {
+ match self {
+ Self::Fixed(amount) => (amount > 0).then_some(amount),
+ Self::Percent(percent) if base_health > 0 && finite_positive(percent) => {
+ let amount = (f64::from(base_health) * f64::from(percent) / 100.0).floor();
+ (amount >= 1.0).then_some(amount.min(f64::from(i32::MAX)) as i32)
+ }
+ Self::Percent(_) => None,
+ }
+ }
+
+ fn validate(self) -> Result<(), &'static str> {
+ match self {
+ Self::Fixed(amount) if amount > 0 => Ok(()),
+ Self::Percent(percent) if finite_positive(percent) => Ok(()),
+ Self::Fixed(_) => Err("heal must be a positive integer"),
+ Self::Percent(_) => Err("heal_percent must be a positive finite percentage"),
+ }
+ }
+}
+
+#[derive(Clone, Copy, Debug, PartialEq)]
+pub struct ExplosiveBulletsSettings {
+ pub cooldown_seconds: f32,
+ pub damage: AttributeValue,
+ pub radius: AttributeValue,
+}
+
+impl Default for ExplosiveBulletsSettings {
+ fn default() -> Self {
+ Self {
+ cooldown_seconds: 1.0,
+ damage: AttributeValue::Range(crate::AttributeRange { min: 75, max: 180 }),
+ radius: AttributeValue::Range(crate::AttributeRange { min: 225, max: 450 }),
+ }
+ }
+}
+
+impl ExplosiveBulletsSettings {
+ pub fn validate(self) -> Result<(), &'static str> {
+ if !self.cooldown_seconds.is_finite() || self.cooldown_seconds < 0.0 {
+ return Err("explosive_bullets needs a finite nonnegative cooldown_seconds");
+ }
+ if !self.damage.validate(1, u16::MAX) || !self.radius.validate(1, u16::MAX) {
+ return Err("explosive_bullets damage and radius must be positive fixed values or ordered ranges");
+ }
+ Ok(())
+ }
+}
+
+#[derive(Clone, Copy, Debug, PartialEq)]
+pub struct HeGrenadeImpulseSettings {
+ pub impulse: f32,
+}
+
+impl Default for HeGrenadeImpulseSettings {
+ fn default() -> Self {
+ Self { impulse: 300.0 }
+ }
+}
+
+impl HeGrenadeImpulseSettings {
+ pub fn validate(self) -> Result<(), &'static str> {
+ if !self.impulse.is_finite() || self.impulse < 0.0 {
+ return Err("hegrenade_impulse impulse must be finite and nonnegative");
+ }
+ Ok(())
+ }
+}
+
+#[derive(Clone, Debug, PartialEq)]
+pub struct ProximityFuseSettings {
+ pub radius: f32,
+ pub delay_seconds: f32,
+ pub grenades: Vec,
+}
+
+impl Default for ProximityFuseSettings {
+ fn default() -> Self {
+ Self {
+ radius: 200.0,
+ delay_seconds: 0.0,
+ grenades: vec![
+ GrenadeKind::He,
+ GrenadeKind::Flash,
+ GrenadeKind::Smoke,
+ GrenadeKind::Molotov,
+ GrenadeKind::Incendiary,
+ ],
+ }
+ }
+}
+
+impl ProximityFuseSettings {
+ pub fn validate(&self) -> Result<(), &'static str> {
+ if !finite_positive(self.radius) {
+ return Err("proximity_fuse radius must be positive and finite");
+ }
+ if !self.delay_seconds.is_finite() || self.delay_seconds < 0.0 {
+ return Err("proximity_fuse delay_seconds must be finite and non-negative");
+ }
+ if self.grenades.is_empty() {
+ return Err("proximity_fuse grenades must contain at least one supported grenade type");
+ }
+ if self.grenades.contains(&GrenadeKind::Decoy) {
+ return Err("proximity_fuse does not support decoy grenades");
+ }
+ Ok(())
+ }
+}
+
+#[derive(Clone, Copy, Debug, PartialEq)]
+pub struct GrappleSettings {
+ pub max_distance: f32,
+ pub max_speed: f32,
+ pub pull_gain: f32,
+}
+
+impl Default for GrappleSettings {
+ fn default() -> Self {
+ Self {
+ max_distance: 32768.0,
+ max_speed: 800.0,
+ pull_gain: 6.0,
+ }
+ }
+}
+
+impl GrappleSettings {
+ pub fn validate(self) -> Result<(), &'static str> {
+ if !finite_positive(self.max_distance) || !finite_positive(self.max_speed) || !finite_positive(self.pull_gain) {
+ return Err("grapple max_distance, max_speed and pull_gain must be positive and finite");
+ }
+ Ok(())
+ }
+}
+
+#[derive(Clone, Copy, Debug, PartialEq)]
+pub struct HeGuidanceSettings {
+ pub range: f32,
+ pub turn_rate_degrees_per_second: f32,
+ pub max_speed: f32,
+ pub max_guidance_seconds: f32,
+}
+
+impl Default for HeGuidanceSettings {
+ fn default() -> Self {
+ Self {
+ range: 2400.0,
+ turn_rate_degrees_per_second: 120.0,
+ max_speed: 1200.0,
+ max_guidance_seconds: 8.0,
+ }
+ }
+}
+
+impl HeGuidanceSettings {
+ pub fn validate(self) -> Result<(), &'static str> {
+ if !finite_positive(self.range)
+ || !finite_positive(self.turn_rate_degrees_per_second)
+ || !finite_positive(self.max_speed)
+ || !finite_positive(self.max_guidance_seconds)
+ {
+ return Err("he_guidance range, turn_rate_degrees_per_second, max_speed and max_guidance_seconds must be positive and finite");
+ }
+ Ok(())
+ }
+}
+
+/// Whether a trace result qualifies as an airborne wall contact for wall hang.
+/// Trace reach, entity identity and the movement hull are checked by the adapter.
+pub fn wall_hang_contact_eligible(
+ is_walk: bool,
+ airborne: bool,
+ jump_held: bool,
+ hit_world: bool,
+ start_solid: bool,
+ gap: f32,
+ normal_z: f32,
+) -> bool {
+ is_walk
+ && airborne
+ && jump_held
+ && hit_world
+ && !start_solid
+ && gap.is_finite()
+ && (0.0..=0.75).contains(&gap)
+ && normal_z.is_finite()
+ && normal_z.abs() <= 0.25
+}
+
+/// Turns an existing projectile velocity toward a target direction without adding speed.
+/// The adapter supplies game-time delta; a nonpositive delta permits speed capping but no turn.
+pub fn turn_projectile_velocity(
+ current_velocity: [f32; 3],
+ target_direction: [f32; 3],
+ delta_seconds: f32,
+ settings: HeGuidanceSettings,
+) -> Option<[f32; 3]> {
+ settings.validate().ok()?;
+ if current_velocity.iter().chain(target_direction.iter()).any(|value| !value.is_finite()) || !delta_seconds.is_finite() {
+ return None;
+ }
+ let current_speed = length(current_velocity);
+ let target_length = length(target_direction);
+ if !current_speed.is_finite() || !target_length.is_finite() || target_length <= f32::EPSILON {
+ return None;
+ }
+ let speed = current_speed.min(settings.max_speed);
+ if speed <= f32::EPSILON {
+ return Some([0.0; 3]);
+ }
+ let direction = scale(current_velocity, 1.0 / current_speed);
+ let target = scale(target_direction, 1.0 / target_length);
+ let angle = dot(direction, target).clamp(-1.0, 1.0).acos();
+ let max_turn = if delta_seconds > 0.0 {
+ (degrees_to_radians(settings.turn_rate_degrees_per_second) * delta_seconds).min(std::f32::consts::PI)
+ } else {
+ 0.0
+ };
+ let turned = if angle <= max_turn || angle <= f32::EPSILON {
+ target
+ } else if max_turn <= 0.0 {
+ direction
+ } else {
+ let axis = cross(direction, target);
+ let axis_length = length(axis);
+ let axis = if axis_length > f32::EPSILON {
+ scale(axis, 1.0 / axis_length)
+ } else {
+ // Antiparallel vectors have no unique turn axis; choose a stable perpendicular.
+ let reference = if direction[0].abs() < 0.9 { [1.0, 0.0, 0.0] } else { [0.0, 1.0, 0.0] };
+ let perpendicular = cross(direction, reference);
+ scale(perpendicular, 1.0 / length(perpendicular))
+ };
+ let radians = max_turn.min(angle);
+ let (sin, cos) = radians.sin_cos();
+ let axis_cross_direction = cross(axis, direction);
+ let projection = dot(axis, direction);
+ [
+ direction[0] * cos + axis_cross_direction[0] * sin + axis[0] * projection * (1.0 - cos),
+ direction[1] * cos + axis_cross_direction[1] * sin + axis[1] * projection * (1.0 - cos),
+ direction[2] * cos + axis_cross_direction[2] * sin + axis[2] * projection * (1.0 - cos),
+ ]
+ };
+ Some(scale(turned, speed))
+}
+
+fn dot(a: [f32; 3], b: [f32; 3]) -> f32 {
+ a[0] * b[0] + a[1] * b[1] + a[2] * b[2]
+}
+
+fn cross(a: [f32; 3], b: [f32; 3]) -> [f32; 3] {
+ [a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]]
+}
+
+fn length(value: [f32; 3]) -> f32 {
+ dot(value, value).sqrt()
+}
+
+fn scale(value: [f32; 3], scalar: f32) -> [f32; 3] {
+ [value[0] * scalar, value[1] * scalar, value[2] * scalar]
+}
+
+fn degrees_to_radians(degrees: f32) -> f32 {
+ degrees * std::f32::consts::PI / 180.0
+}
+
+#[derive(Clone, Copy, Debug, PartialEq)]
+pub struct FriendlyFireHealSettings {
+ pub kind: FriendlyFireHealKind,
+}
+
+#[derive(Clone, Copy, Debug, PartialEq)]
+pub enum FriendlyFireHealKind {
+ Fixed { amount: u16 },
+ DamageRatio { ratio: f32 },
+}
+
+impl Default for FriendlyFireHealSettings {
+ fn default() -> Self {
+ Self {
+ kind: FriendlyFireHealKind::Fixed { amount: 10 },
+ }
+ }
+}
+
+impl FriendlyFireHealSettings {
+ pub fn validate(self) -> Result<(), &'static str> {
+ match self.kind {
+ FriendlyFireHealKind::Fixed { amount: 0 } => Err("friendly_fire_heal fixed amount must be positive"),
+ FriendlyFireHealKind::Fixed { .. } => Ok(()),
+ FriendlyFireHealKind::DamageRatio { ratio } if finite_positive(ratio) => Ok(()),
+ FriendlyFireHealKind::DamageRatio { .. } => Err("friendly_fire_heal ratio must be positive and finite"),
+ }
+ }
+
+ /// Returns whole HP: fixed amount or floor(ratio × accumulated direct damage).
+ pub fn healing(self, damage_sum: f64) -> i32 {
+ match self.kind {
+ FriendlyFireHealKind::Fixed { amount } => i32::from(amount),
+ FriendlyFireHealKind::DamageRatio { ratio } if damage_sum.is_finite() && damage_sum > 0.0 && finite_positive(ratio) => {
+ (damage_sum * f64::from(ratio)).floor().clamp(0.0, f64::from(i32::MAX)) as i32
+ }
+ FriendlyFireHealKind::DamageRatio { .. } => 0,
+ }
+ }
+}
+
+#[derive(Clone, Copy, Debug, PartialEq)]
+pub struct RegenerationSettings {
+ pub delay_seconds: f32,
+ pub interval_seconds: f32,
+ pub heal: HealingAmount,
+}
+
+impl Default for RegenerationSettings {
+ fn default() -> Self {
+ Self {
+ delay_seconds: 5.0,
+ interval_seconds: 1.0,
+ heal: HealingAmount::Fixed(2),
+ }
+ }
+}
+
+impl RegenerationSettings {
+ pub fn validate(self) -> Result<(), &'static str> {
+ if !finite_positive(self.delay_seconds) || !finite_positive(self.interval_seconds) {
+ return Err("regeneration needs positive finite delays");
+ }
+ self.heal.validate()
+ }
+}
+
+#[derive(Clone, Copy, Debug, PartialEq)]
+pub struct ChickenAuraSettings {
+ pub radius: f32,
+ pub interval_seconds: f32,
+ pub heal: HealingAmount,
+}
+
+impl Default for ChickenAuraSettings {
+ fn default() -> Self {
+ Self {
+ radius: 200.0,
+ interval_seconds: 1.0,
+ heal: HealingAmount::Fixed(3),
+ }
+ }
+}
+
+impl ChickenAuraSettings {
+ pub fn validate(self) -> Result<(), &'static str> {
+ if !finite_positive(self.radius) || !finite_positive(self.interval_seconds) {
+ return Err("chicken_aura needs positive finite radius and interval");
+ }
+ self.heal.validate()
+ }
+}
+
+#[derive(Clone, Copy, Debug, PartialEq)]
+pub struct DontStopSettings {
+ pub minimum_horizontal_speed: f32,
+ pub grace_seconds: f32,
+ pub damage_interval_seconds: f32,
+ pub damage: i32,
+}
+
+impl Default for DontStopSettings {
+ fn default() -> Self {
+ Self {
+ minimum_horizontal_speed: 20.0,
+ grace_seconds: 1.5,
+ damage_interval_seconds: 1.0,
+ damage: 5,
+ }
+ }
+}
+
+impl DontStopSettings {
+ pub fn validate(self) -> Result<(), &'static str> {
+ if !finite_nonnegative(self.minimum_horizontal_speed)
+ || !finite_nonnegative(self.grace_seconds)
+ || !finite_positive(self.damage_interval_seconds)
+ || self.damage <= 0
+ {
+ return Err("dont_stop needs finite nonnegative speed/grace, a positive interval and positive damage");
+ }
+ Ok(())
+ }
+}
+
+#[derive(Clone, Copy, Debug, PartialEq)]
+pub struct HotFloorSettings {
+ pub grounded_seconds: f32,
+ pub damage_interval_seconds: f32,
+ pub damage: i32,
+ pub ignite_after_seconds: f32,
+ pub burn_duration_seconds: f32,
+ pub burn_damage_fraction: f32,
+ pub burn_minimum_damage: f32,
+}
+
+impl Default for HotFloorSettings {
+ fn default() -> Self {
+ Self {
+ grounded_seconds: 2.0,
+ damage_interval_seconds: 0.5,
+ damage: 3,
+ ignite_after_seconds: 4.0,
+ burn_duration_seconds: 5.0,
+ burn_damage_fraction: 0.01,
+ burn_minimum_damage: 1.0,
+ }
+ }
+}
+
+impl HotFloorSettings {
+ pub fn validate(self) -> Result<(), &'static str> {
+ if !finite_positive(self.grounded_seconds)
+ || !finite_positive(self.damage_interval_seconds)
+ || self.damage <= 0
+ || !finite_positive(self.ignite_after_seconds)
+ || !finite_positive(self.burn_duration_seconds)
+ || !finite_nonnegative(self.burn_damage_fraction)
+ || !finite_nonnegative(self.burn_minimum_damage)
+ {
+ return Err("hot_floor needs positive finite ground/damage/ignite/burn times, positive damage, and finite nonnegative burn damage");
+ }
+ Ok(())
+ }
+}
+
+#[derive(Clone, Copy, Debug, PartialEq)]
+pub struct WeaponOnFireSettings {
+ pub chance: f32,
+ pub switch_weight: u32,
+ pub drop_weight: u32,
+ pub cooldown_seconds: f32,
+}
+
+impl Default for WeaponOnFireSettings {
+ fn default() -> Self {
+ Self {
+ chance: 0.1,
+ switch_weight: 3,
+ drop_weight: 1,
+ cooldown_seconds: 1.0,
+ }
+ }
+}
+
+impl WeaponOnFireSettings {
+ pub fn validate(self) -> Result<(), &'static str> {
+ if !self.chance.is_finite()
+ || !(0.0..=1.0).contains(&self.chance)
+ || (self.switch_weight == 0 && self.drop_weight == 0)
+ || !finite_nonnegative(self.cooldown_seconds)
+ {
+ return Err("weapon_on_fire needs chance between 0 and 1, at least one positive action weight, and a finite nonnegative cooldown");
+ }
+ Ok(())
+ }
+}
+
+#[derive(Clone, Copy, Debug, PartialEq)]
+pub struct LongFlashSettings {
+ pub duration_multiplier: f32,
+ pub duration_cap_seconds: f32,
+}
+
+impl Default for LongFlashSettings {
+ fn default() -> Self {
+ Self {
+ duration_multiplier: 3.0,
+ duration_cap_seconds: 12.0,
+ }
+ }
+}
+
+impl LongFlashSettings {
+ pub fn validate(self) -> Result<(), &'static str> {
+ if !self.duration_multiplier.is_finite() || self.duration_multiplier < 1.0 || !finite_nonnegative(self.duration_cap_seconds) {
+ return Err("long_flash needs a finite duration_multiplier >= 1 and finite nonnegative extension cap");
+ }
+ Ok(())
+ }
+}
+
+#[derive(Clone, Copy, Debug, PartialEq)]
+pub struct BigHeadSettings {
+ pub min_scale: f32,
+ pub max_scale: f32,
+}
+
+impl Default for BigHeadSettings {
+ fn default() -> Self {
+ Self {
+ min_scale: 0.5,
+ max_scale: 2.0,
+ }
+ }
+}
+
+impl BigHeadSettings {
+ pub fn validate(self) -> Result<(), &'static str> {
+ if !finite_positive(self.min_scale) || !finite_positive(self.max_scale) || self.min_scale > self.max_scale {
+ return Err("big_head needs positive finite scales with min_scale <= max_scale");
+ }
+ Ok(())
+ }
+}
+
+fn finite_positive(value: f32) -> bool {
+ value.is_finite() && value > 0.0
+}
+
+fn finite_nonnegative(value: f32) -> bool {
+ value.is_finite() && value >= 0.0
+}
+
+/// Returns the next health value, or None when the player should not be healed.
+/// Existing health above the configured ceiling is never reduced.
+pub fn healing_target(base_health: i32, current_health: i32, amount: i32, cap_base_multiple: f32) -> Option {
+ if base_health <= 0 || !finite_positive(cap_base_multiple) || amount <= 0 || current_health <= 0 {
+ return None;
+ }
+ let cap = (f64::from(base_health) * f64::from(cap_base_multiple)).floor();
+ if !cap.is_finite() {
+ return None;
+ }
+ let cap = cap.min(f64::from(i32::MAX)) as i32;
+ let healed = current_health.saturating_add(amount).min(cap);
+ (healed > current_health).then_some(healed)
+}
+
+/// Uses the player's real match kills/deaths. Clamp bounds are validated in configuration.
+pub fn big_head_scale(kills: u32, deaths: u32, min_scale: f32, max_scale: f32) -> f32 {
+ let ratio = (f64::from(kills) + 1.0) / (f64::from(deaths) + 1.0);
+ (ratio as f32).clamp(min_scale, max_scale)
+}
+
+/// Multiplies the native duration up to `duration_cap_seconds`; an already later
+/// native or plugin deadline is preserved.
+pub fn extended_flash_deadline(
+ now: f64,
+ native_deadline: f64,
+ current_deadline: f64,
+ duration_multiplier: f32,
+ duration_cap_seconds: f32,
+) -> Option {
+ if !now.is_finite()
+ || !native_deadline.is_finite()
+ || !current_deadline.is_finite()
+ || !duration_multiplier.is_finite()
+ || duration_multiplier < 1.0
+ || !duration_cap_seconds.is_finite()
+ || duration_cap_seconds < 0.0
+ || native_deadline <= now
+ {
+ return None;
+ }
+ let duration = ((native_deadline - now) * f64::from(duration_multiplier)).min(f64::from(duration_cap_seconds));
+ let target = now + duration;
+ target.is_finite().then_some(current_deadline.max(native_deadline).max(target))
+}
+
+macro_rules! settings_input {
+ ($name:ident, $settings:ident, { $($field:ident : $kind:ty),+ $(,)? }) => {
+ #[derive(Clone, Debug, Default, Deserialize)]
+ #[serde(default, deny_unknown_fields)]
+ pub(super) struct $name { $(pub(super) $field: Option<$kind>,)+ }
+
+ impl $name {
+ pub(super) fn resolve(self, base: Option<$settings>) -> $settings {
+ let base = base.unwrap_or_default();
+ $settings { $($field: self.$field.unwrap_or(base.$field),)+ }
+ }
+ }
+ };
+}
+
+#[derive(Clone, Debug, Default, Deserialize)]
+#[serde(default, deny_unknown_fields)]
+pub(super) struct RegenerationInput {
+ pub(super) delay_seconds: Option,
+ pub(super) interval_seconds: Option,
+ pub(super) heal: Option,
+ pub(super) heal_percent: Option,
+}
+
+impl RegenerationInput {
+ pub(super) fn resolve(self, base: Option) -> Result {
+ let base = base.unwrap_or_default();
+ let heal = resolve_healing_amount(self.heal, self.heal_percent, base.heal, "regeneration")?;
+ Ok(RegenerationSettings {
+ delay_seconds: self.delay_seconds.unwrap_or(base.delay_seconds),
+ interval_seconds: self.interval_seconds.unwrap_or(base.interval_seconds),
+ heal,
+ })
+ }
+}
+
+#[derive(Clone, Debug, Default, Deserialize)]
+#[serde(default, deny_unknown_fields)]
+pub(super) struct ChickenAuraInput {
+ pub(super) radius: Option,
+ pub(super) interval_seconds: Option,
+ pub(super) heal: Option,
+ pub(super) heal_percent: Option,
+}
+
+impl ChickenAuraInput {
+ pub(super) fn resolve(self, base: Option) -> Result {
+ let base = base.unwrap_or_default();
+ let heal = resolve_healing_amount(self.heal, self.heal_percent, base.heal, "chicken_aura")?;
+ Ok(ChickenAuraSettings {
+ radius: self.radius.unwrap_or(base.radius),
+ interval_seconds: self.interval_seconds.unwrap_or(base.interval_seconds),
+ heal,
+ })
+ }
+}
+
+fn resolve_healing_amount(heal: Option, heal_percent: Option, inherited: HealingAmount, ability: &str) -> Result {
+ match (heal, heal_percent) {
+ (Some(_), Some(_)) => Err(format!("{ability}: configure either heal or heal_percent, not both")),
+ (Some(amount), None) => Ok(HealingAmount::Fixed(amount)),
+ (None, Some(percent)) => Ok(HealingAmount::Percent(percent)),
+ (None, None) => Ok(inherited),
+ }
+}
+
+#[derive(Clone, Copy, Debug, Deserialize, PartialEq, Eq)]
+#[serde(rename_all = "snake_case")]
+pub(super) enum FriendlyFireHealKindInput {
+ Fixed,
+ DamageRatio,
+}
+
+#[derive(Clone, Debug, Default, Deserialize)]
+#[serde(default, deny_unknown_fields)]
+pub(super) struct FriendlyFireHealInput {
+ pub(super) kind: Option,
+ pub(super) amount: Option,
+ pub(super) ratio: Option,
+}
+
+impl FriendlyFireHealInput {
+ pub(super) fn resolve(self, base: Option) -> Result {
+ if self.amount.is_some() && self.ratio.is_some() {
+ return Err("configure either amount or ratio, not both".into());
+ }
+ let base = base.unwrap_or_default();
+ let inherited_kind = match base.kind {
+ FriendlyFireHealKind::Fixed { .. } => FriendlyFireHealKindInput::Fixed,
+ FriendlyFireHealKind::DamageRatio { .. } => FriendlyFireHealKindInput::DamageRatio,
+ };
+ let kind = self.kind.unwrap_or(inherited_kind);
+ let changed_kind = self.kind.is_some_and(|kind| kind != inherited_kind);
+ let settings = match kind {
+ FriendlyFireHealKindInput::Fixed => {
+ if self.ratio.is_some() {
+ return Err("kind = 'fixed' does not accept ratio".into());
+ }
+ let inherited = match base.kind {
+ FriendlyFireHealKind::Fixed { amount } if !changed_kind => Some(amount),
+ _ => None,
+ };
+ FriendlyFireHealSettings {
+ kind: FriendlyFireHealKind::Fixed {
+ amount: self.amount.or(inherited).unwrap_or(10),
+ },
+ }
+ }
+ FriendlyFireHealKindInput::DamageRatio => {
+ if self.amount.is_some() {
+ return Err("kind = 'damage_ratio' does not accept amount".into());
+ }
+ let inherited = match base.kind {
+ FriendlyFireHealKind::DamageRatio { ratio } if !changed_kind => Some(ratio),
+ _ => None,
+ };
+ FriendlyFireHealSettings {
+ kind: FriendlyFireHealKind::DamageRatio {
+ ratio: self.ratio.or(inherited).ok_or("kind = 'damage_ratio' requires ratio")?,
+ },
+ }
+ }
+ };
+ settings.validate()?;
+ Ok(settings)
+ }
+}
+
+settings_input!(ExplosiveBulletsInput, ExplosiveBulletsSettings, {
+ cooldown_seconds: f32,
+ damage: AttributeValue,
+ radius: AttributeValue,
+});
+
+#[derive(Clone, Debug, Default, Deserialize)]
+#[serde(default, deny_unknown_fields)]
+pub(super) struct HeGrenadeImpulseInput {
+ pub(super) impulse: Option,
+}
+
+impl HeGrenadeImpulseInput {
+ pub(super) fn resolve(self, base: Option) -> HeGrenadeImpulseSettings {
+ let base = base.unwrap_or_default();
+ HeGrenadeImpulseSettings {
+ impulse: self.impulse.unwrap_or(base.impulse),
+ }
+ }
+}
+
+#[derive(Clone, Debug, Default, Deserialize)]
+#[serde(default, deny_unknown_fields)]
+pub(super) struct ProximityFuseInput {
+ pub(super) radius: Option,
+ pub(super) delay_seconds: Option,
+ pub(super) grenades: Option>,
+}
+
+impl ProximityFuseInput {
+ pub(super) fn resolve(self, base: Option) -> Result {
+ let base = base.unwrap_or_default();
+ let grenades = match self.grenades {
+ Some(items) => items
+ .into_iter()
+ .map(|item| GrenadeKind::from_config_id(&item).map_err(|error| format!("grenades: {error}")))
+ .collect::, _>>()?,
+ None => base.grenades,
+ };
+ let settings = ProximityFuseSettings {
+ radius: self.radius.unwrap_or(base.radius),
+ delay_seconds: self.delay_seconds.unwrap_or(base.delay_seconds),
+ grenades,
+ };
+ settings.validate().map_err(str::to_owned)?;
+ Ok(settings)
+ }
+}
+
+#[derive(Clone, Debug, Default, Deserialize)]
+#[serde(default, deny_unknown_fields)]
+pub(super) struct GrappleInput {
+ pub(super) max_distance: Option,
+ pub(super) max_speed: Option,
+ pub(super) pull_gain: Option,
+}
+
+impl GrappleInput {
+ pub(super) fn resolve(self, base: Option) -> GrappleSettings {
+ let base = base.unwrap_or_default();
+ GrappleSettings {
+ max_distance: self.max_distance.unwrap_or(base.max_distance),
+ max_speed: self.max_speed.unwrap_or(base.max_speed),
+ pull_gain: self.pull_gain.unwrap_or(base.pull_gain),
+ }
+ }
+}
+
+#[derive(Clone, Debug, Default, Deserialize)]
+#[serde(default, deny_unknown_fields)]
+pub(super) struct HeGuidanceInput {
+ pub(super) range: Option,
+ pub(super) turn_rate_degrees_per_second: Option,
+ pub(super) max_speed: Option,
+ pub(super) max_guidance_seconds: Option,
+}
+
+impl HeGuidanceInput {
+ pub(super) fn resolve(self, base: Option) -> HeGuidanceSettings {
+ let base = base.unwrap_or_default();
+ HeGuidanceSettings {
+ range: self.range.unwrap_or(base.range),
+ turn_rate_degrees_per_second: self.turn_rate_degrees_per_second.unwrap_or(base.turn_rate_degrees_per_second),
+ max_speed: self.max_speed.unwrap_or(base.max_speed),
+ max_guidance_seconds: self.max_guidance_seconds.unwrap_or(base.max_guidance_seconds),
+ }
+ }
+}
+
+settings_input!(DontStopInput, DontStopSettings, {
+ minimum_horizontal_speed: f32,
+ grace_seconds: f32,
+ damage_interval_seconds: f32,
+ damage: i32,
+});
+settings_input!(HotFloorInput, HotFloorSettings, {
+ grounded_seconds: f32,
+ damage_interval_seconds: f32,
+ damage: i32,
+ ignite_after_seconds: f32,
+ burn_duration_seconds: f32,
+ burn_damage_fraction: f32,
+ burn_minimum_damage: f32,
+});
+settings_input!(WeaponOnFireInput, WeaponOnFireSettings, {
+ chance: f32,
+ switch_weight: u32,
+ drop_weight: u32,
+ cooldown_seconds: f32,
+});
+settings_input!(LongFlashInput, LongFlashSettings, {
+ duration_multiplier: f32,
+ duration_cap_seconds: f32,
+});
+settings_input!(BigHeadInput, BigHeadSettings, {
+ min_scale: f32,
+ max_scale: f32,
+});
diff --git a/crates/funrounds-core/src/autostrafe.rs b/crates/funrounds-core/src/autostrafe.rs
new file mode 100644
index 0000000..db4241f
--- /dev/null
+++ b/crates/funrounds-core/src/autostrafe.rs
@@ -0,0 +1,25 @@
+// Copyright (C) 2026 Mai Ooizumi
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+use std::f32::consts::{PI, TAU};
+
+/// The native AirMove step consumes forward and left input relative to aim.
+pub fn air_strafe_input(yaw: f32, vx: f32, vy: f32) -> Option<(f32, f32)> {
+ let aim = yaw.to_radians();
+ let speed = vx.hypot(vy);
+ if !aim.is_finite() || !speed.is_finite() {
+ return None;
+ }
+ let heading = vy.atan2(vx);
+ let turn = (aim - heading + PI).rem_euclid(TAU) - PI;
+ if speed >= 30.0 && turn.abs() < 2.0_f32.to_radians() {
+ return None;
+ }
+ let wish = if speed < 30.0 {
+ aim
+ } else {
+ heading + (20.0 / speed).acos().copysign(turn)
+ };
+ let (left, forward) = (wish - aim).sin_cos();
+ Some((200.0 * forward, 200.0 * left))
+}
diff --git a/crates/funrounds-core/src/bin/validate-config.rs b/crates/funrounds-core/src/bin/validate-config.rs
index 6ade75b..7883381 100644
--- a/crates/funrounds-core/src/bin/validate-config.rs
+++ b/crates/funrounds-core/src/bin/validate-config.rs
@@ -10,39 +10,35 @@ fn validate_file(path: &Path) -> Result<(), String> {
}
fn validate_bundle(config: &Config, directory: &Path, allow_fallback: bool) -> Result<(), String> {
- let zh_path = directory.join("zh-CN.toml");
- let en_path = directory.join("en.toml");
- let catalogs = if allow_fallback {
- let mut catalogs = Vec::new();
- for (language, path) in [("zh-CN", &zh_path), ("en", &en_path)] {
- if let Some(catalog) = read_catalog_if_present(path)? {
- catalogs.push((language.to_owned(), catalog));
+ let mut catalogs = Vec::new();
+ match fs::read_dir(directory) {
+ Ok(entries) => {
+ for entry in entries {
+ let path = entry.map_err(|error| format!("{}: {error}", directory.display()))?.path();
+ if path
+ .extension()
+ .and_then(|ext| ext.to_str())
+ .is_some_and(|ext| ext.eq_ignore_ascii_case("toml"))
+ && fs::metadata(&path).map_err(|error| format!("{}: {error}", path.display()))?.is_file()
+ {
+ let language = path.file_stem().unwrap_or_default().to_string_lossy().into_owned();
+ let source = fs::read_to_string(&path).map_err(|error| format!("{}: {error}", path.display()))?;
+ let catalog = TextCatalog::parse_for_language(&source, &language).map_err(|error| format!("{}: {error}", path.display()))?;
+ catalogs.push((language, catalog));
+ }
}
}
- catalogs
- } else {
- let zh = read_catalog(&zh_path)?;
- let en = read_catalog(&en_path)?;
- TextBundle::validate_complete_catalogs(&zh, &en).map_err(|error| format!("{}: {error}", directory.display()))?;
- vec![("zh-CN".into(), zh), ("en".into(), en)]
- };
+ Err(error) if allow_fallback && error.kind() == std::io::ErrorKind::NotFound => {}
+ Err(error) => return Err(format!("{}: {error}", directory.display())),
+ }
+ catalogs.sort_by(|(a, _), (b, _)| a.cmp(b));
let bundle = TextBundle::load(config.default_language.as_str(), catalogs)?;
- bundle.validate_config(config)
-}
-
-fn read_catalog(path: &Path) -> Result {
- let source = fs::read_to_string(path).map_err(|error| format!("{}: {error}", path.display()))?;
- TextCatalog::parse(&source).map_err(|error| format!("{}: {error}", path.display()))
-}
-
-fn read_catalog_if_present(path: &Path) -> Result