feat: feed asker stats to the IA + comic death messages
Two features requested after the IA grounding deploy.
IA player-stats grounding: the IA could not answer "quantos blocos eu
minerei?" because its context carried only generic server facts, never the
asker's own numbers. OfflineStats now reads one player's headline stats
(blocks mined, time played, distance, deaths, mob kills) from their vanilla
stats JSON and Ai.compose() injects them as a system turn, gated by
ia.estatisticas-jogador (default true). ~30 tokens per question; always on
so it never misses a stat question. Pure formatSummary extracted for tests.
Comic deaths (mortes module): replaces the vanilla death message with a
cause-based pt-BR comic line plus a death counter ("Fulano foi achatado
como panqueca (47ª morte)") and sends the death coordinates privately to
the dead player (Java click-to-copy, Bedrock plain text) so they can run
back to their dropped items. No storage, no command — a PlayerDeathEvent
side effect gated by modulos.mortes. DeathFlavor is a pure cause->phrase
map, unit-tested. Coexists with the luto [F] handler.
DEATHS stat timing: assumes Paper fires PlayerDeathEvent before awarding
minecraft:deaths, so the counter shows +1 to include the current death; a
log line confirms the raw stat on the first real death so the +1 can be
dropped if the server increments first.
117 tests green (101 + 13 DeathFlavor + 3 OfflineStatsSummary).
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -14,6 +14,9 @@ modulos:
|
||||
enquete: true # /enquete com votação clicável
|
||||
ranking: true # /ranking com placares do servidor
|
||||
marcos: true # avisos automáticos ao passar de 100 km, 24 horas, etc.
|
||||
# Mensagem de morte engraçada + coordenadas da morte mandadas em privado
|
||||
# só para quem morreu (para correr buscar os itens).
|
||||
mortes: true
|
||||
ia: true # /ia <pergunta> — só para quem tem canalhandia.ia
|
||||
|
||||
# --- Curiosidades ------------------------------------------------------------
|
||||
@@ -181,6 +184,10 @@ ia:
|
||||
memoria-perguntas: 3
|
||||
memoria-minutos: 10
|
||||
|
||||
# true: injeta as estatísticas do jogador que perguntou no contexto da IA,
|
||||
# para responder "quantos blocos eu minerei?" com números reais.
|
||||
estatisticas-jogador: true
|
||||
|
||||
# Fatos do servidor que a IA nunca teria como saber. Uma linha por fato.
|
||||
contexto:
|
||||
- "O servidor se chama Canalhandia e roda Minecraft 26.2 (Paper)."
|
||||
|
||||
Reference in New Issue
Block a user