adventure: tell Pete when a story-grade treasure is found

A treasure that earns a public room announce now also files a treasure_found
fact, so Pete can count it on the finder's trophy case. The emit rides inside
announceTreasureToRoom, reusing the RoomAnnounce != "" gate as the newsworthiness
filter — a copper-piece pickup never becomes news, and a reversed auto-swap never
emits, because the announce it shares is cancelled on undo.

The realm's first finder of a given treasure is a priority hoard; a later finder
of the same item is a bulletin, keyed on the treasure across the realm via
claimRealmFirst, the same first/repeat split zone_first uses. The item name rides
in stakes and the tier-derived rarity in outcome.

treasure_found is a new event_type, so Pete's ingest must deploy first or the
first finds park on the retry ladder forever.
This commit is contained in:
prosolis
2026-07-17 09:09:23 -07:00
parent 7960838b3f
commit fbed45fc96
3 changed files with 131 additions and 0 deletions

View File

@@ -1383,6 +1383,10 @@ func (p *AdventurePlugin) announceTreasureToRoom(char *AdventureCharacter, def *
if def == nil || def.RoomAnnounce == "" {
return
}
// The same story-grade gate feeds Pete's trophy case. Emit before the
// games-room check so a find is still recorded as news even when no room is
// configured to announce it in.
emitTreasureFound(char.UserID, def, loc)
gr := gamesRoom()
if gr == "" {
return