From 308097311d0d4cd37a0219d1ec9a9dfb623524dd Mon Sep 17 00:00:00 2001 From: Steve Date: Sat, 28 May 2022 18:19:02 -0400 Subject: [PATCH] more resources --- data/converters.toml | 48 ++++++++++++++++++++++++++++++++++++++++++++ data/resources.toml | 32 +++++++++++++++++++++++++++++ data/tech.toml | 27 ++++++++++++++++--------- simulator/player.go | 14 ++++++++----- 4 files changed, 107 insertions(+), 14 deletions(-) diff --git a/data/converters.toml b/data/converters.toml index 64770ca..dfffdf9 100644 --- a/data/converters.toml +++ b/data/converters.toml @@ -23,3 +23,51 @@ icon = "w" [[converter.costs]] name = "brick" value = 3 + +[[converter]] +itemid = 9 +name = "kiln" +displayName = "Brick kiln" +flavour = "Forge your own destiny" +source = "brick" +output = "metal" +rate = 10 +icon = "k" +[[converter.costs]] +name = "brick" +value = 20 +[[converter.costs]] +name = "tea" +value = 10 + +[[converter]] +itemid = 10 +name = "veggieTrap" +displayName = "Baited Trap" +flavour = "If I like the smell of soup, who knows what else does?" +source = "soup" +output = "hide" +rate = 15 +icon = "^" +[[converter.costs]] +name = "wood" +value = 5 +[[converter.costs]] +name = "soup" +value = 1 + +[[converter]] +itemid = 11 +name = "cutter" +displayName = "Cutting station" +flavour = "Good metal lets you take down the tallest tree" +source = "" +output = "wood" +rate = 0 +icon = "C" +[[converter.costs]] +name = "metal" +value = 10 +[[converter.costs]] +name = "brick" +value = 20 diff --git a/data/resources.toml b/data/resources.toml index 15ac822..0f5f1c9 100644 --- a/data/resources.toml +++ b/data/resources.toml @@ -15,3 +15,35 @@ flavour = "Tea compressed into a brick shape" icon = "b" buildable = false + +[[resource]] +itemid = 5 +name = "metal" +displayName = "Metal" +flavour = "Bricks transmuted into metal. Wait how did that happen?" +icon = "m" +buildable = false + +[[resource]] +itemid = 6 +name = "wood" +displayName = "Wood" +flavour = "A sturdy piece of wood" +icon = "T" +buildable = false + +[[resource]] +itemid = 7 +name = "soup" +displayName = "Vegetable Soup" +flavour = "Smells delicious" +icon = "u" +buildable = true + +[[resource]] +itemid = 8 +name = "hide" +displayName = "Leather Hide" +flavour = "Tanned hide, good for many uses" +icon = "_" +buildable = false diff --git a/data/tech.toml b/data/tech.toml index adf2471..a7f0b0c 100644 --- a/data/tech.toml +++ b/data/tech.toml @@ -1,20 +1,29 @@ [[tech]] techid = 1 -name = "teaConverter" -displayName = "Tea Pulper" -unlocks = ["teaConverter"] +name = "teaTech" +displayName = "Tea Manipulation" +unlocks = ["teaConverter","teaPlanter"] [[tech.requires]] name = "tea" value = 10 [[tech]] techid = 2 -name = "teaPlanting" -displayName = "Tea Planters" -unlocks = ["teaPlanter"] +name = "basicHarvest" +displayName = "Harvesting" +unlocks = ["cutter","kiln"] +[[tech.requires]] +name = "brick" +value = 15 [[tech.requires]] name = "tea" -value = 20 +value = 30 + +[[tech]] +techid = 3 +name = "basicHunt" +displayName = "Trapping" +unlocks = ["veggieTrap"] [[tech.requires]] -name = "teaConverter" -value = 1 +name = "metal" +value = 30 diff --git a/simulator/player.go b/simulator/player.go index 9217959..7b27106 100644 --- a/simulator/player.go +++ b/simulator/player.go @@ -104,17 +104,21 @@ func (p *Player) research() { func (p *Player) Announce(msg string) { p.logIndex++ p.log = append(p.log, strconv.Itoa(p.logIndex)+" "+msg) - if len(p.log) > 4 { - p.log = p.log[1:] - } } //Log returns the player log func (p *Player) Log() string { res := "Log:\n" - for i, v := range p.log { + start := p.logIndex - 4 + if start < 0 { + start = 0 + } + end := p.logIndex + for i := start; i < end; i++ { + + v := p.log[i] res += v - if i < 3 { + if i != end { res += "\n" } }