feat: reports for settling - new village founded & valley occupied (#178) (#190)

This commit is contained in:
Ferywir
2026-06-09 15:47:29 +02:00
committed by GitHub
parent 20804d9182
commit dad574be1a
9 changed files with 101 additions and 1 deletions
+8
View File
@@ -2990,6 +2990,10 @@ class Automation {
}
$database->setVillageField($data['from'], $exp, $value);
// Report: new village founded (issue #178)
$ncoor = $database->getCoor($data['to']);
$database->addNotice($to['owner'], $data['to'], 0, 24, 'New village founded', ($ncoor['x'] ?? 0) . ',' . ($ncoor['y'] ?? 0), time());
}else{
// here must come movement from returning settlers
$types[] = 4;
@@ -2998,6 +3002,10 @@ class Automation {
$refs[] = $data['ref'];
$times[] = $time;
$endtimes[] = $time + ($time - $data['starttime']);
// Report: valley already occupied, settlers returning (issue #178)
$fcoor = $database->getCoor($data['to']);
$database->addNotice($to['owner'], $data['to'], 0, 25, 'Settlers returned - valley occupied', ($fcoor['x'] ?? 0) . ',' . ($fcoor['y'] ?? 0), time());
}
}
+8
View File
@@ -2333,6 +2333,12 @@ tz_def('TZ_RT_REINF_IN', "Reinforcement in");
tz_def('TZ_RT_ELDERS_REINF', "village of the elders reinforcement");
tz_def('TZ_RT_UNOCC_OASIS', "Unoccupied Oasis");
// ===== settler reports (issue #178) =====
tz_def('TZ_RT_NEW_VILLAGE', "New village founded");
tz_def('TZ_RT_VALLEY_OCCUPIED', "Settling failed (valley occupied)");
tz_def('TZ_NEW_VILLAGE_MSG', "You have founded a new village:");
tz_def('TZ_VALLEY_OCCUPIED_MSG', "Your settlers could not settle here - the valley is already occupied by another player. They are on their way back.");
// ===== display-time localization of stored report topics =====
// Reports are generated server-side at battle resolution and stored in the DB
// (column `topic`) with English connectors. This rewrites them to the viewing
@@ -2350,6 +2356,8 @@ if (!function_exists('tz_loc_topic')) {
' attacks ' => ' '.TZ_RT_ATTACKS.' ',
' reinforcement ' => ' '.TZ_RT_REINFORCEMENT.' ',
'Unoccupied Oasis' => TZ_RT_UNOCC_OASIS,
'New village founded' => TZ_RT_NEW_VILLAGE,
'Settlers returned - valley occupied' => TZ_RT_VALLEY_OCCUPIED,
);
return strtr($s, $map);
}
+4
View File
@@ -2337,5 +2337,9 @@ define('TZ_RT_WAS_ATTACKED', "a été attaqué");
define('TZ_RT_REINF_IN', "Renfort dans");
define('TZ_RT_ELDERS_REINF', "renfort du village des anciens");
define('TZ_RT_UNOCC_OASIS', "Oasis inoccupée");
define('TZ_RT_NEW_VILLAGE', "Nouveau village fondé");
define('TZ_RT_VALLEY_OCCUPIED', "Colonisation échouée (vallée occupée)");
define('TZ_NEW_VILLAGE_MSG', "Vous avez fondé un nouveau village :");
define('TZ_VALLEY_OCCUPIED_MSG', "Vos colons n'ont pas pu s'installer ici — la vallée est déjà occupée par un autre joueur. Ils sont sur le chemin du retour.");
?>
+4
View File
@@ -2223,5 +2223,9 @@ define('TZ_RT_WAS_ATTACKED', "è stato attaccato");
define('TZ_RT_REINF_IN', "Rinforzo in");
define('TZ_RT_ELDERS_REINF', "rinforzo del villaggio degli anziani");
define('TZ_RT_UNOCC_OASIS', "Oasi non occupata");
define('TZ_RT_NEW_VILLAGE', "Nuovo villaggio fondato");
define('TZ_RT_VALLEY_OCCUPIED', "Colonizzazione fallita (valle occupata)");
define('TZ_NEW_VILLAGE_MSG', "Hai fondato un nuovo villaggio:");
define('TZ_VALLEY_OCCUPIED_MSG', "I tuoi coloni non hanno potuto insediarsi qui — la valle è già occupata da un altro giocatore. Stanno tornando indietro.");
?>
+4
View File
@@ -2326,3 +2326,7 @@ define('TZ_RT_WAS_ATTACKED', "a fost atacat");
define('TZ_RT_REINF_IN', "Întărire în");
define('TZ_RT_ELDERS_REINF', "întărire a satului bătrânilor");
define('TZ_RT_UNOCC_OASIS', "Oază neocupată");
define('TZ_RT_NEW_VILLAGE', "Sat nou întemeiat");
define('TZ_RT_VALLEY_OCCUPIED', "Colonizare eșuată (vale ocupată)");
define('TZ_NEW_VILLAGE_MSG', "Ai întemeiat un sat nou:");
define('TZ_VALLEY_OCCUPIED_MSG', "Coloniștii tăi nu s-au putut stabili aici — valea este deja ocupată de alt jucător. Se întorc acasă.");
+4
View File
@@ -2319,3 +2319,7 @@ define('TZ_RT_WAS_ATTACKED', "遭到攻击");
define('TZ_RT_REINF_IN', "增援于");
define('TZ_RT_ELDERS_REINF', "长老村增援");
define('TZ_RT_UNOCC_OASIS', "无人占领的绿洲");
define('TZ_RT_NEW_VILLAGE', "已建立新村庄");
define('TZ_RT_VALLEY_OCCUPIED', "拓殖失败(山谷已被占领)");
define('TZ_NEW_VILLAGE_MSG', "你已建立一个新村庄:");
define('TZ_VALLEY_OCCUPIED_MSG', "你的拓荒者无法在此定居——该山谷已被其他玩家占领。他们正在返回途中。");
+6 -1
View File
@@ -130,7 +130,7 @@ class Message
$type = [1, 2, 3, 4, 5, 6, 7];
break;
case 4:
$type = [0, 18, 19, 20, 21];
$type = [0, 18, 19, 20, 21, 24, 25];
break;
case 5:
if (!$session->plus) {
@@ -442,6 +442,11 @@ class Message
// Festive reports
case 23:
return 22;
// Settler reports: new village founded / valley occupied (issue #178)
case 24:
case 25:
return 24;
}
return $type;
}