Skip to content

Commit

Permalink
more character names, examine styling, layout
Browse files Browse the repository at this point in the history
  • Loading branch information
silverbucket committed Jan 13, 2025
1 parent 561874a commit 31b0e00
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 33 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,13 @@ You currently cannot interaction with the towns or ships.
* Buy/sell goods
* Found your own town? (Pirate hideaway?)

#### World Map
#### Travel
* Engage with NPCs
* Improved NPC AI
* Hire/Dig channels pathways?
* Land defenses/fortifications
* Dont allow overlap of ships (collision detection)
* Don't allow overlap of ships (collision detection)
* Wind direction determines ease of travel (consume more food when going against wind)

### Ships
* Fire from boat
Expand Down
45 changes: 35 additions & 10 deletions cmd/common/character.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,42 +17,67 @@ func grab(s []string) string {
}

func GenerateCaptainName() string {
var title = []string{"Captian", "Admiral", "Apprentice", "Pirate", "Skipper", "Commander", "Boatswain", "Officer",
"Traitor", "Ghostly", "Commodore", "Agent"}
var title = []string{"Captain", "Admiral", "Apprentice", "Pirate", "Skipper", "Commander", "Boatswain", "Officer",
"Traitor", "Ghostly", "Commodore", "Agent", "Seaman", "Rebel", "Privateer", "First Mate", "Buccaneer", "Sir"}
var name = []string{"Gleeson", "Orvin", "Ripley", "Preston", "Eldon", "Dorset", "Falk", "Jorge", "Frederick",
"Hunter", "Jasper", "Salvodor", "Hailey", "Rackham", "Crowther", "Lucifer", "Woolworth", "Dunstan", "Clare",
"Kaiser", "Kerwin", "Morris", "Ulrik", "Asema", "Storm", "Gladwin", "Morse", "Zell", "Penny"}
"Kaiser", "Kerwin", "Morris", "Ulrik", "Asema", "Storm", "Gladwin", "Morse", "Zell", "Penny", "Janice",
"Barbara", "Ironia", "Shauntelle", "Elvira", "Esmeralda", "Bob", "Trixie", "Wendy", "Franz", "Peggy", "Anous",
"Dick", "Gaylord", "Angus", "Pud", "Bruce", "Marty", "Wolfgang", "Hyacinth", "Zimoslav", "Rufulus", "Nolif",
"Lollie", "Malvina", "Claire", "Stella", "Xensor", "Bentley", "Cordelia", "Johnson", "Muff", "Titus", "Anthony"}
var flair = []string{"Dishonest", "Soft Heart", "Balding", "Rum Lover", "Two Toes", "Hair", "Gloomy",
"Cutthroat", "Dastardly", "Vile", "Ripe", "Pungent", "Piggy", "Pleasant", "Crazy", "Weasel", "Squealer", "Feral",
"Snake", "Slayer", "Ghostly", "Traitor", "Coxswain", "One-tooth"}
"Snake", "Slayer", "Ghostly", "Traitor", "Coxswain", "One-tooth", "Windy", "Butter", "Betrayer", "Foxy"}
var flairWithThe = []string{"Dishonest", "Soft Heart", "Balding", "Rum Lover", "Hair", "Gloomy",
"Cutthroat", "Dastardly", "Vile", "Ripe", "Pungent", "Piggy", "Pleasant", "Crazy", "Weasel", "Squealer",
"Snake", "Slayer", "Traitor", "Coxswain", "One-tooth"}
"Snake", "Slayer", "Traitor", "Coxswain", "One-tooth", "Windy", "Butter", "Cozy", "Tide Turner", "Bear", "Savage"}
var placePrefix = []string{"Port", "Isle of", "Saint", "South", "North", "East", "West", "Mt"}
var place = []string{"Coxswain", "Rackham", "Seezley", "Salty", "Briller", "Dunstan", "Cordith", "Firth", "Barbady",
"Yorben", "Nillith", "Salvador", "Lactipon", "Derzley", "Jitterham", "Milktown", "Appleton", "Greently", "Asstin",
"Hoplonton", "Welgadin"}
"Yorben", "Nillith", "Sanctitly", "Laction", "Derzley", "Jitterham", "Milktown", "Appleton", "Greently", "Asstin",
"Hoplonton", "Welgadin", "Klappertown", "Windville", "Folkenwald", "Dids", "Munkton", "Shallows", "Plaqard", "Oiltown", "Willows", "Quellton"}
var placeSuffix = []string{"Bay", "Island", "Falls", "Harbour", "Lake", "River", "Way", "Rock", "Springs", "Bend", "Beach", "Point"}

fullName := []string{}
last := "none"
if roll() {
fullName = append(fullName, grab(title))
last = "title"
}
if roll() {
fullName = append(fullName, grab(name))
last = "firstName"
}
if roll() {
if roll() && roll() && roll() && last != "title" {
fullName = append(fullName, "von")
fullName = append(fullName, grab(name))
} else if roll() {
last = "von"
} else if roll() && last != "title" {
fullName = append(fullName, "the")
fullName = append(fullName, grab(flairWithThe))
last = "theflair"
} else if roll() {
fullName = append(fullName, "\""+grab(flair)+"\"")
last = "flair"
} else {
fullName = append(fullName, grab(name))
last = "lastName"
}

if roll() {
if last == "none" || last == "title" || last == "flair" {
fullName = append(fullName, grab(name))
}

if roll() && roll() {
fullName = append(fullName, "of")
if roll() && roll() {
fullName = append(fullName, grab(placePrefix))
}
fullName = append(fullName, grab(place))
if roll() && roll() {
fullName = append(fullName, grab(placeSuffix))
}
} else if roll() && roll() {
fullName = append(fullName, "yon")
fullName = append(fullName, grab(place))
}
return cases.Title(language.English).String(strings.Join(fullName, " "))
Expand Down
55 changes: 34 additions & 21 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,51 +40,63 @@ var borderStyle = lipgloss.Border{
BottomRight: "┘",
}

var screenStyle lipgloss.Style

func SetScreenStyle(width int, height int) lipgloss.Style {
return lipgloss.NewStyle().
Foreground(lipgloss.Color("15")).
Background(lipgloss.Color("0")).
Width(width).
Height(height)
}

func getSidebarStyle() lipgloss.Style {
var sidebarWidth = (common.InfoPaneSize * 3)
if sidebarWidth > 25 {
sidebarWidth += 1
} else if sidebarWidth > 18 {
sidebarWidth += 2
var SidebarWidth = (common.InfoPaneSize * 3)
if SidebarWidth > 25 {
SidebarWidth += 1
} else if SidebarWidth > 18 {
SidebarWidth += 2
} else {
sidebarWidth += 3
SidebarWidth += 3
}
return lipgloss.NewStyle().
Align(lipgloss.Left).
Border(borderStyle).
Foreground(lipgloss.Color("#FAFAFA")).
BorderForeground(lipgloss.Color("33")).
BorderBackground(lipgloss.Color("0")).
Background(lipgloss.Color("0")).
//Margin(1, 1, 0, 0).
Padding(1).
Height(19).
Width(sidebarWidth)
Height(20).
Width(SidebarWidth)
}

var subtle = lipgloss.AdaptiveColor{Light: "#D9DCCF", Dark: "#383838"}
var base = lipgloss.NewStyle().Foreground(lipgloss.Color("15"))
var base = lipgloss.NewStyle().Foreground(lipgloss.Color("15")).Background(lipgloss.Color("0"))

var bullet = lipgloss.NewStyle().SetString("·").
Foreground(lipgloss.AdaptiveColor{Light: "#43BF6D", Dark: "#73F59F"}).
Foreground(lipgloss.Color("#43BF6D")).
Background(lipgloss.Color("0")).
PaddingRight(1).
String()

var listItem = func(s string) string {
return bullet + lipgloss.NewStyle().
Strikethrough(true).
Foreground(lipgloss.AdaptiveColor{Light: "#969B86", Dark: "#696969"}).
Foreground(lipgloss.Color("#969B86")).
Background(lipgloss.Color("0")).
Render(s)
}

var listHeader = base.
BorderStyle(lipgloss.NormalBorder()).
BorderBottom(true).
BorderForeground(subtle).
MarginRight(2).
//BorderStyle(lipgloss.NormalBorder()).
//BorderBottom(true).
Background(lipgloss.Color("0")).
BorderBackground(lipgloss.Color("0")).
PaddingBottom(1).
Width(100).
Render

//var listItem = base.PaddingLeft(2).Render

func (m model) Init() tea.Cmd {
// Just return `nil`, which means "no I/O right now, please."
return nil
Expand All @@ -96,6 +108,7 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
m.logger.Info(fmt.Sprintf("Window size: %v", msg))
common.SetWindowSize(msg.Width, msg.Height)
m.logger.Info(fmt.Sprintf("Info pane size %v", common.InfoPaneSize))
screenStyle = SetScreenStyle(msg.Width, msg.Height)
ScreenInitialized = true
if !WorldInitialized {
m.terrain.GenerateWorld()
Expand Down Expand Up @@ -153,7 +166,7 @@ func (m model) View() string {
if m.action == common.UserActionIdExamine {
bottomText += fmt.Sprintf("examining %v", highlight.GetID())
sidePanel = lipgloss.JoinVertical(lipgloss.Left,
listHeader(highlight.GetName()),
listHeader(fmt.Sprintf("%v", highlight.GetName())),
listItem(fmt.Sprintf("Flag: %v", highlight.GetFlag())),
listItem(fmt.Sprintf("ID: %v", highlight.GetID())),
listItem(fmt.Sprintf("Type: %v", highlight.GetType())),
Expand All @@ -165,11 +178,11 @@ func (m model) View() string {
content := lipgloss.JoinHorizontal(
lipgloss.Top,
paint,
s.MarginRight(0).Render(sidePanel),
s.Background(lipgloss.Color("0")).Render(sidePanel),
)
content += "\n" + lipgloss.JoinHorizontal(lipgloss.Top,
bottomText)
return content
return screenStyle.Render(content)
}
}

Expand Down

0 comments on commit 31b0e00

Please sign in to comment.