mirror of
https://github.com/Corfirean/coa-server-manager.git
synced 2026-11-11 03:51:01 +00:00
feat(config): expose profession and defense skill gains (#153)
This commit is contained in:
1 parent
4a99dd3a6a
commit
af5a9717d4
8 files changed
+118
No files matched your search
@@ -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.
|
||||
@@ -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();
|
||||
|
||||
@@ -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
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -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."
|
||||
|
||||
@@ -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."
|
||||
|
||||
@@ -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."
|
||||
|
||||
@@ -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": "Сколько ботов создаёт команда создания, если вы не указали число."
|
||||
|
||||
@@ -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": "当生成命令未指定数量时,默认创建的机器人数量。"
|
||||
|
||||
Reference in new issue
Block a user