You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
2.6 KiB
Go
62 lines
2.6 KiB
Go
package model
|
|
|
|
// AdventureLogEvent is a machine-readable log line; the client maps Code + Args to localized text.
|
|
type AdventureLogEvent struct {
|
|
Code string `json:"code"`
|
|
Args map[string]any `json:"args,omitempty"`
|
|
}
|
|
|
|
// AdventureLogLine is written to the DB and sent over WebSocket.
|
|
// Legacy rows have only Message; new rows set Event and optional Message (English fallback).
|
|
type AdventureLogLine struct {
|
|
Message string `json:"message,omitempty"`
|
|
Event *AdventureLogEvent `json:"event,omitempty"`
|
|
}
|
|
|
|
// Adventure log event codes (keep in sync with frontend adventureLogFormat.ts).
|
|
//
|
|
// For events with arg "enemyType" (enemies.type slug), also send "enemyName" when known:
|
|
// English display name from DB for client fallback and SQL message column.
|
|
const (
|
|
LogDefeatedEnemy = "defeated_enemy"
|
|
LogLeveledUp = "leveled_up"
|
|
LogEquippedNew = "equipped_new"
|
|
LogInventoryFullDropped = "inventory_full_dropped"
|
|
LogBuffActivated = "buff_activated"
|
|
LogHeroRevived = "hero_revived"
|
|
LogWanderingMerchant = "wandering_merchant_encounter"
|
|
LogEncounteredEnemy = "encountered_enemy"
|
|
LogDiedFighting = "died_fighting"
|
|
LogAutoReviveHours = "auto_revive_hours"
|
|
LogAutoReviveAfterSec = "auto_revive_after_sec"
|
|
LogPurchasedBuffRefill = "purchased_buff_refill"
|
|
LogPurchasedBuffRefillRub = "purchased_buff_refill_rub"
|
|
LogSubscribed = "subscribed"
|
|
LogUsedHealingPotion = "used_healing_potion"
|
|
LogAchievementUnlocked = "achievement_unlocked"
|
|
LogMetNPC = "met_npc"
|
|
LogWanderingAlmsEquipped = "wandering_alms_equipped"
|
|
LogWanderingAlmsDropped = "wandering_alms_dropped"
|
|
LogWanderingAlmsStashed = "wandering_alms_stashed"
|
|
LogHealedFullTown = "healed_full_town"
|
|
LogBoughtPotionTown = "bought_potion_town"
|
|
LogSoldItemsMerchant = "sold_items_merchant"
|
|
LogNPCSkippedVisit = "npc_skipped_visit"
|
|
LogThoughtRoadside = "thought_roadside"
|
|
LogPurchasedPotionFromNPC = "purchased_potion_from_npc"
|
|
LogPaidHealerFull = "paid_healer_full"
|
|
LogQuestGiverChecked = "quest_giver_checked"
|
|
LogQuestAccepted = "quest_accepted"
|
|
LogTownNPCVisitLine = "town_npc_visit_line"
|
|
LogCombatSwing = "combat_swing"
|
|
)
|
|
|
|
// RoadsideThoughtCount must match len(roadsideThoughtsEn) on the frontend.
|
|
const RoadsideThoughtCount = 52
|
|
|
|
// Wandering merchant (road encounter) — stable keys for client i18n.
|
|
const (
|
|
WanderingMerchantNPCKey = "npc.wandering_merchant.v1"
|
|
WanderingMerchantDialogueKey = "npc.wandering_merchant.dialogue.v1"
|
|
)
|