game: npc 색상 분리

This commit is contained in:
2022-02-05 07:43:27 +00:00
committed by Gitea
parent d2f6c34e85
commit b5fa2aef91
11 changed files with 67 additions and 97 deletions
+26 -5
View File
@@ -215,14 +215,35 @@ function formatLeadershipBonus(int $value): string
return "<font color=cyan>+{$value}</font>";
}
function getNPCColor(int $npc): ?string{
if ($npc == 1) {
return 'skyblue';
}
if ($npc == 4){
return 'deepskyblue';
}
if ($npc == 5){
return 'darkcyan';
}
if ($npc == 6){
return 'mediumaquamarine';
}
if ($npc > 1) {
return 'cyan';
}
return null;
}
function formatName(string $name, int $npc): string
{
if ($npc == 1) {
$name = "<font color='skyblue'>$name</font>";
} else if ($npc > 1) {
$name = "<font color='cyan'>$name</font>";
$color = getNPCColor($npc);
if($color === null){
return $name;
}
return $name;
return "<span style='color:{$color}'>$name</span>";
}
function getMapTheme(): string