From af5a9717d44977bb62e6e26ae8d45b2c249ab96f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9?= Date: Tue, 27 Oct 2026 08:38:08 +0500 Subject: [PATCH] feat(config): expose profession and defense skill gains (#153) --- changelog.d/20261027-skill-gain-controls.md | 7 +++ crates/coa-core/src/config/mod.rs | 25 +++++++++ schemas/server.json | 61 +++++++++++++++++++++ src/i18n/schema/de.json | 5 ++ src/i18n/schema/es.json | 5 ++ src/i18n/schema/fr.json | 5 ++ src/i18n/schema/ru.json | 5 ++ src/i18n/schema/zh.json | 5 ++ 8 files changed, 118 insertions(+) create mode 100644 changelog.d/20261027-skill-gain-controls.md diff --git a/changelog.d/20261027-skill-gain-controls.md b/changelog.d/20261027-skill-gain-controls.md new file mode 100644 index 0000000..5d22f4e --- /dev/null +++ b/changelog.d/20261027-skill-gain-controls.md @@ -0,0 +1,7 @@ +--- +area: manager +type: added +audience: admins +title: Configure profession and defense skill gains in server settings +--- +Advanced rate settings now include prospecting and milling skill gains, plus the points gained from crafting, defense and gathering. diff --git a/crates/coa-core/src/config/mod.rs b/crates/coa-core/src/config/mod.rs index 820af87..650462a 100644 --- a/crates/coa-core/src/config/mod.rs +++ b/crates/coa-core/src/config/mod.rs @@ -1034,6 +1034,31 @@ Spellbook.New = 5 assert!(v.drift_keys.is_empty()); } + #[test] + fn skill_controls_persist_and_reject_invalid_gains() { + let (_d, root, meta) = fixture(); + let changes = BTreeMap::from([ + ("SkillChance.Prospecting".into(), json!(true)), + ("SkillChance.Milling".into(), json!(true)), + ("SkillGain.Crafting".into(), json!(3)), + ("SkillGain.Defense".into(), json!(4)), + ("SkillGain.Gathering".into(), json!(5)), + ]); + let report = save(&root, &meta, Scope::Server, &changes).unwrap(); + assert_eq!(report.changed.len(), 5); + assert_eq!(report.restart, Some(Restart::World)); + for path in ["Settings/worldserver.conf.template", "Core/configs/worldserver.conf"] { + let conf = load_conf(&root.join(path)).unwrap(); + for (key, expected) in [("SkillChance.Prospecting", "1"), ("SkillChance.Milling", "1"), ("SkillGain.Crafting", "3"), ("SkillGain.Defense", "4"), ("SkillGain.Gathering", "5")] { + assert_eq!(conf.get(key), Some(expected)); + } + assert_eq!(conf.get("Unknown.Custom"), Some("\"keep me\"")); + } + for value in [json!(-1), json!(1.5), json!(451)] { + assert!(save(&root, &meta, Scope::Server, &BTreeMap::from([("SkillGain.Crafting".into(), value)])).is_err()); + } + } + #[test] fn creature_rates_save_independently_in_template_and_active_config() { let (_d, root, meta) = fixture(); diff --git a/schemas/server.json b/schemas/server.json index 80992ef..55765e9 100644 --- a/schemas/server.json +++ b/schemas/server.json @@ -1025,6 +1025,67 @@ "advanced": false, "restartRequired": "world", "dangerous": false + }, + { + "key": "SkillChance.Prospecting", + "type": "bool", + "category": "rates", + "title": "Prospecting skill gains", + "description": "Allow prospecting to increase the profession skill.", + "default": false, + "advanced": true, + "restartRequired": "world", + "dangerous": false + }, + { + "key": "SkillChance.Milling", + "type": "bool", + "category": "rates", + "title": "Milling skill gains", + "description": "Allow milling to increase the profession skill.", + "default": false, + "advanced": true, + "restartRequired": "world", + "dangerous": false + }, + { + "key": "SkillGain.Crafting", + "type": "int", + "category": "rates", + "title": "Crafting skill gain", + "description": "Skill points awarded by a successful crafting skill increase.", + "default": 1, + "advanced": true, + "restartRequired": "world", + "dangerous": false, + "min": 0, + "max": 450 + }, + { + "key": "SkillGain.Defense", + "type": "int", + "category": "rates", + "title": "Defense skill gain", + "description": "Skill points awarded by a successful defense skill increase.", + "default": 1, + "advanced": true, + "restartRequired": "world", + "dangerous": false, + "min": 0, + "max": 450 + }, + { + "key": "SkillGain.Gathering", + "type": "int", + "category": "rates", + "title": "Gathering skill gain", + "description": "Skill points awarded by a successful gathering skill increase.", + "default": 1, + "advanced": true, + "restartRequired": "world", + "dangerous": false, + "min": 0, + "max": 450 } ] } diff --git a/src/i18n/schema/de.json b/src/i18n/schema/de.json index 6ae5eae..d1033ad 100644 --- a/src/i18n/schema/de.json +++ b/src/i18n/schema/de.json @@ -31,6 +31,11 @@ "copper": "Kupfer" }, "settings": { + "SkillChance.Prospecting": {"t": "Fertigkeitszuwachs beim Sondieren", "d": "Sondieren darf die Berufsfertigkeit erhöhen."}, + "SkillChance.Milling": {"t": "Fertigkeitszuwachs beim Mahlen", "d": "Mahlen darf die Berufsfertigkeit erhöhen."}, + "SkillGain.Crafting": {"t": "Fertigkeitszuwachs beim Herstellen", "d": "Fertigkeitspunkte pro erfolgreicher Steigerung beim Herstellen."}, + "SkillGain.Defense": {"t": "Zuwachs der Verteidigungsfertigkeit", "d": "Fertigkeitspunkte pro erfolgreicher Steigerung der Verteidigung."}, + "SkillGain.Gathering": {"t": "Fertigkeitszuwachs beim Sammeln", "d": "Fertigkeitspunkte pro erfolgreicher Steigerung beim Sammeln."}, "CoaBots.RandomSpawn.DefaultCount": { "t": "Bots pro Erstellungsbefehl", "d": "Wie viele Bots der Erstellungsbefehl anlegt, wenn du keine Zahl angibst." diff --git a/src/i18n/schema/es.json b/src/i18n/schema/es.json index aa99698..b009977 100644 --- a/src/i18n/schema/es.json +++ b/src/i18n/schema/es.json @@ -31,6 +31,11 @@ "copper": "cobre" }, "settings": { + "SkillChance.Prospecting": {"t": "Mejora de habilidad al prospectar", "d": "Permitir que prospectar aumente la habilidad de profesión."}, + "SkillChance.Milling": {"t": "Mejora de habilidad al moler", "d": "Permitir que moler aumente la habilidad de profesión."}, + "SkillGain.Crafting": {"t": "Puntos de habilidad al fabricar", "d": "Puntos otorgados por una mejora de habilidad al fabricar."}, + "SkillGain.Defense": {"t": "Puntos de habilidad de defensa", "d": "Puntos otorgados por una mejora de habilidad de defensa."}, + "SkillGain.Gathering": {"t": "Puntos de habilidad al recolectar", "d": "Puntos otorgados por una mejora de habilidad al recolectar."}, "CoaBots.RandomSpawn.DefaultCount": { "t": "Bots creados por comando", "d": "Cuántos bots crea el comando de creación cuando no indicas un número." diff --git a/src/i18n/schema/fr.json b/src/i18n/schema/fr.json index a4a82bd..aa784a4 100644 --- a/src/i18n/schema/fr.json +++ b/src/i18n/schema/fr.json @@ -31,6 +31,11 @@ "copper": "cuivre" }, "settings": { + "SkillChance.Prospecting": {"t": "Progression avec la prospection", "d": "Permettre à la prospection d’améliorer la compétence de métier."}, + "SkillChance.Milling": {"t": "Progression avec la mouture", "d": "Permettre à la mouture d’améliorer la compétence de métier."}, + "SkillGain.Crafting": {"t": "Gain de compétence en fabrication", "d": "Points accordés lors d’une progression réussie en fabrication."}, + "SkillGain.Defense": {"t": "Gain de compétence en défense", "d": "Points accordés lors d’une progression réussie en défense."}, + "SkillGain.Gathering": {"t": "Gain de compétence en récolte", "d": "Points accordés lors d’une progression réussie en récolte."}, "CoaBots.RandomSpawn.DefaultCount": { "t": "Bots créés par commande", "d": "Nombre de bots que la commande de création crée quand vous n’indiquez pas de nombre." diff --git a/src/i18n/schema/ru.json b/src/i18n/schema/ru.json index 428895a..c135af0 100644 --- a/src/i18n/schema/ru.json +++ b/src/i18n/schema/ru.json @@ -31,6 +31,11 @@ "copper": "меди" }, "settings": { + "SkillChance.Prospecting": {"t": "Рост навыка при просеивании", "d": "Разрешить повышение навыка профессии при просеивании."}, + "SkillChance.Milling": {"t": "Рост навыка при измельчении", "d": "Разрешить повышение навыка профессии при измельчении."}, + "SkillGain.Crafting": {"t": "Прирост ремесленного навыка", "d": "Число очков за успешное повышение ремесленного навыка."}, + "SkillGain.Defense": {"t": "Прирост навыка защиты", "d": "Число очков за успешное повышение навыка защиты."}, + "SkillGain.Gathering": {"t": "Прирост навыка сбора", "d": "Число очков за успешное повышение навыка сбора."}, "CoaBots.RandomSpawn.DefaultCount": { "t": "Ботов за одну команду создания", "d": "Сколько ботов создаёт команда создания, если вы не указали число." diff --git a/src/i18n/schema/zh.json b/src/i18n/schema/zh.json index ff7b07b..f3de8b3 100644 --- a/src/i18n/schema/zh.json +++ b/src/i18n/schema/zh.json @@ -31,6 +31,11 @@ "copper": "铜币" }, "settings": { + "SkillChance.Prospecting": {"t": "选矿技能提升", "d": "允许通过选矿提升专业技能。"}, + "SkillChance.Milling": {"t": "研磨技能提升", "d": "允许通过研磨提升专业技能。"}, + "SkillGain.Crafting": {"t": "制造技能提升点数", "d": "制造成功触发技能提升时获得的点数。"}, + "SkillGain.Defense": {"t": "防御技能提升点数", "d": "防御成功触发技能提升时获得的点数。"}, + "SkillGain.Gathering": {"t": "采集技能提升点数", "d": "采集成功触发技能提升时获得的点数。"}, "CoaBots.RandomSpawn.DefaultCount": { "t": "单次生成命令创建数量", "d": "当生成命令未指定数量时,默认创建的机器人数量。"