feature(rally-point): bold the "?" for incoming stacks below rally point level [#249] (#251)

On the rally point incoming tab, the number of an incoming unit type is never
revealed: it is always shown as a "?". When that stack is smaller than the
defender's rally point (gid 16) level, the "?" is rendered in solid black
bold, matching original Travian behaviour (e.g. rally point level 20 and an
incoming 19 praetorians shows a bold "?"). The eyesight artifact still reveals
which troop types are present (0 for the absent ones). Scope: village
attacks/raids only.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Ferywir
2026-06-22 12:40:59 +02:00
committed by GitHub
parent 66c966cb5e
commit 228397d011
+12 -2
View File
@@ -6,6 +6,10 @@ include_once 'GameEngine/Data/unitdata.php';
$units = $database->getMovement(34, $village->wid, 1);
$artifactsSum = $database->getArtifactsSumByKind($session->uid, $village->wid, 3);
// Rally-point indicator (issue #249): the incoming count is never revealed; an
// incoming unit type whose stack is smaller than this village's rally point
// (gid 16) level is flagged with a bold "?" instead of a plain one.
$rpLevel = (int) $database->getFieldLevelInVillage($village->wid, 16);
?>
<style>
@@ -94,8 +98,14 @@ function cycleMarker(moveid, el){
if (!$isMine) echo '<td class="none">?</td>';
else echo '<td class="'.($val==0?'none':'').'">'.($val==0?'0':$val).'</td>';
} else {
if ($artifactsSum['totals']==0) echo '<td class="none">?</td>';
else echo '<td class="'.($val==0?'none':'').'">'.($val==0?'0':'?').'</td>';
// Issue #249: the incoming count is never revealed, it is
// always a "?". That "?" is shown in bold when the stack of
// this unit type is smaller than the defender's rally point
// level. The eyesight artifact still reveals which troop
// types are present (0 for the absent ones).
if ($val == 0) echo '<td class="none">'.($artifactsSum['totals']==0?'?':'0').'</td>';
elseif ($rpLevel > 0 && $val < $rpLevel) echo '<td><b style="color:#000">?</b></td>';
else echo '<td class="none">?</td>';
}
endfor;?>
</tr>