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.
57 lines
1.4 KiB
Go
57 lines
1.4 KiB
Go
package model
|
|
|
|
import "math/rand"
|
|
|
|
// HeroMeetAutoLineSlugs are stable ids for auto-dialogue (client localizes hero_meet.auto.<slug>).
|
|
var HeroMeetAutoLineSlugs = []string{
|
|
"nod_traveler",
|
|
"quiet_road_today",
|
|
"heard_rumors_beasts",
|
|
"gear_clinks_soft",
|
|
"stay_safe_out_there",
|
|
"short_rest_then_go",
|
|
"sun_in_eyes",
|
|
"paths_cross_again",
|
|
"trade_news_smile",
|
|
"wind_picks_up",
|
|
"good_luck_hunt",
|
|
"watch_the_brush",
|
|
"same_road_twice",
|
|
"water_skin_low",
|
|
"campfire_smoke_ahead",
|
|
"no_coin_no_story",
|
|
"armor_pinch_reminder",
|
|
"storm_smell_air",
|
|
"map_wrong_fold",
|
|
"heard_city_bells",
|
|
"strap_mended_maybe",
|
|
"monster_or_mud",
|
|
"share_rations_nod",
|
|
"night_cold_early",
|
|
"footprints_cross_yours",
|
|
"quiet_not_safe",
|
|
"merchant_lied_once",
|
|
"birds_flew_strange",
|
|
}
|
|
|
|
// HeroMeetAutoPhraseKey returns phrase key by index (legacy tests); prefer RandomHeroMeetAutoPhraseKey for emits.
|
|
func HeroMeetAutoPhraseKey(lineIdx int) string {
|
|
if len(HeroMeetAutoLineSlugs) == 0 {
|
|
return "hero_meet.auto.fallback"
|
|
}
|
|
if lineIdx < 0 {
|
|
lineIdx = 0
|
|
}
|
|
slug := HeroMeetAutoLineSlugs[lineIdx%len(HeroMeetAutoLineSlugs)]
|
|
return "hero_meet.auto." + slug
|
|
}
|
|
|
|
// RandomHeroMeetAutoPhraseKey picks a random auto line (offline / scripted hero-meet dialogue).
|
|
func RandomHeroMeetAutoPhraseKey() string {
|
|
if len(HeroMeetAutoLineSlugs) == 0 {
|
|
return "hero_meet.auto.fallback"
|
|
}
|
|
slug := HeroMeetAutoLineSlugs[rand.Intn(len(HeroMeetAutoLineSlugs))]
|
|
return "hero_meet.auto." + slug
|
|
}
|