From 8ce6539c8aea42f39da2fb91cf7d32b69b773d49 Mon Sep 17 00:00:00 2001 From: Rakeela Date: Mon, 3 Apr 2023 16:18:26 -0700 Subject: [PATCH] IncompleteImplementationofSecondIssue --- koboldsim/cards.go | 82 +++++++++++++++++++++++++++++++++++++++++++++- koboldsim/setup.go | 4 +-- koboldsim/stats.go | 10 +++--- 3 files changed, 88 insertions(+), 8 deletions(-) diff --git a/koboldsim/cards.go b/koboldsim/cards.go index ee34f4d..c67ac1d 100644 --- a/koboldsim/cards.go +++ b/koboldsim/cards.go @@ -79,7 +79,7 @@ var cards = []Card{ }, { Desc: cardsim.MsgStr("Near-surface patrols may need to be increased."), - Result: cardsim.MsgStr("More and better-armed hunting outpsts are being established."), + Result: cardsim.MsgStr("More and better-armed hunting outposts are being established."), }, { Desc: cardsim.MsgStr("This isn't about a disaster and can probably continue to be safely dismissed."), @@ -89,6 +89,86 @@ var cards = []Card{ }, }, // end of "Warborn" policies }, // end of "Warborn" card + &SwitchingCard{ + Name: cardsim.MsgStr("International Festival of Bureaucracy"), + Desc: cardsim.MsgStr(" Good times are upon us! A great festival has been declared between many kobold nations, celebrating the orderly nature of the kobold soul! That's right, it's the International Festival of Bureaucracy!"), + After: ShuffleIntoBottomHalf, + Policies: []Policy{ + &BasicPolicy{ + UnenactedDesc: cardsim.MsgStr(`Your Minister of Administration is practically jumping for joy. "This is our opportunity to prove that we're a prosperous society and attract some fresh blood! We need to raise salaries in the bureaucracy, grant some time off to our bureaucrats to make sure they can attend, and try to hire talent away from other nations. We'll forge productive trade relations by this, you'll see!`), + EnactedDesc: cardsim.MsgStr("[current policy] Your bureaucrats are really looking forward to attending, where they can boast about how the festival boosted their salaries."), + Do: func(p *Player) (cardsim.Message, error) { + p.Stats.Kobolds.Value += 80 + p.Stats.SectorScavengingIncome.Value += 0.01 + p.Stats.GovBureaucracyExpense.Value += 0.03 + return cardsim.MsgStr("Bureaucrats are considered pillars of society."), nil + }, + Undo: func(p *Player) error { + p.Stats.Kobolds.Value -= 80 + p.Stats.SectorScavengingIncome.Value -= 0.01 + p.Stats.GovBureaucracyExpense.Value -= 0.03 + return nil + }, + }, + &BasicPolicy{ + UnenactedDesc: cardsim.MsgStr(`Your Minister of Education pulls you aside. "This is a good opportunity to head-hunt. Bureaucrats from many nations will be attending. There's got to be some who'll work for less than the ones we've got. There are some terribly threatened or impoverished communities among kobolds.`), + EnactedDesc: cardsim.MsgStr("Your nation's policy is clear: the festival of bureaucracy is a chance to trade workers with other kobold nations in your attempts to build a more efficient government."), + Do: func(p *Player) (cardsim.Message, error) { + p.Stats.Kobolds.Value += 20 + p.Stats.GovBureaucracyExpense.Value -= 0.01 + return cardsim.MsgStr("Immigrant bureaucrats complain about being under-appreciated."), nil + }, + Undo: func(p *Player) error { + p.Stats.Kobolds.Value -= 20 + p.Stats.GovBureaucracyExpense.Value += 0.01 + return nil + }, + // This option should only be available if the fourth option isn't the status quo and bureaucratic expense is at least 0.02. + }, + &BasicPolicy{ + UnenactedDesc: cardsim.MsgStr(`Your Minister of Education greets you exuberantly. "We've trimmed the wages of the bureaucracy beautifully, but maybe we can scout some outright volunteers. Some nations are absolute disasters, after all.`), + EnactedDesc: cardsim.MsgStr(`It's hard to find volunteer workers at the festival, but your nation is doing its best to equip the bureaucracy with exactly that.`), + Do: func(p *Player) (cardsim.Message, error) { + p.Stats.Kobolds.Value += 10 + p.Stats.GovBureaucracyExpense.Value -= 0.02 + return cardsim.MsgStr("The local bureaucracy is staffed by volunteer labor."), nil + }, + Undo: func(p *Player) error { + p.Stats.Kobolds.Value -= 10 + p.Stats.GovBureaucracyExpense.Value += 0.02 + return nil + }, + // This option should only be available if the fourth option isn't the status quo and bureaucratic expense is less than 0.02. + }, + &BasicPolicy{ + UnenactedDesc: cardsim.MsgStr(`One of your non-bureaucrat friends has been in a foul temper. "This festival is everything that's wrong with our society. Life isn't about filling out forms. We ought to snub this festival and outright fire some bureaucrats."`), + EnactedDesc: cardsim.MsgStr("Your nation currently bans the International Festival of Bureaucracy. There will be no local celebration without a policy change."), + Do: func(p *Player) (cardsim.Message, error) { + p.Stats.Kobolds.Value -= 80 + p.Stats.GovBureaucracyExpense.Value -= 0.04 + return cardsim.MsgStr("A wave of bureaucrats just emigrated along with kobolds incensed by the nation's lack of respect for administration."), nil + }, + Undo: func(p *Player) error { + p.Stats.Kobolds.Value += 80 + p.Stats.GovBureaucracyExpense.Value += 0.04 + return nil + }, + }, + &VerbosePolicy{ + BasicPolicy: &BasicPolicy{ + UnenactedDesc: cardsim.MsgStr("Some kobolds will attend the festival on their own, and we may face desertions for our lack of interest."), + Do: func(p *Player) (cardsim.Message, error) { + p.Stats.Kobolds.Value -= 20 + return cardsim.MsgStr("A festival of bureaucracy lured away a few kobolds to other nations."), nil + }, + Undo: func(p *Player) error { + p.Stats.Kobolds.Value += 20 + return nil + }, + }, + }, + }, + }, } // end of card list func initDeck(d *cardsim.Deck[*KoboldMine]) { diff --git a/koboldsim/setup.go b/koboldsim/setup.go index aecb312..38a1274 100644 --- a/koboldsim/setup.go +++ b/koboldsim/setup.go @@ -19,8 +19,8 @@ func InitPlayer() *Player { Intro: cardsim.MsgStr("We await your command, Overlord."), Filter: cardsim.VisibleOrDebugStatsNamed[*KoboldMine]( "Kobolds", - "Total Sector Productivity", - "Total Government Productivity", + "Total Sector Income", + "Total Government Expense", ), } p.State = cardsim.GameActive diff --git a/koboldsim/stats.go b/koboldsim/stats.go index 8511514..79eb219 100644 --- a/koboldsim/stats.go +++ b/koboldsim/stats.go @@ -21,11 +21,11 @@ func (k *KoboldMine) ProductivityFunc(s *cardsim.Stored[float64]) func() float64 } } -func (k *KoboldMine) TotalSectorProductivity() float64 { +func (k *KoboldMine) TotalSectorIncome() float64 { return float64(k.Kobolds.Value) * (k.SectorMiningIncome.Value + k.SectorScavengingIncome.Value) } -func (k *KoboldMine) TotalGovProductivity() float64 { +func (k *KoboldMine) TotalGovExpense() float64 { return float64(k.Kobolds.Value) * (k.GovBureaucracyExpense.Value + k.GovWarExpense.Value) } @@ -50,11 +50,11 @@ func (k *KoboldMine) Stats() []cardsim.Stat { ), cardsim.StatFunc( "Total Sector Income", - k.TotalSectorProductivity, + k.TotalSectorIncome, ), cardsim.StatFunc( "Total Government Expense", - k.TotalGovProductivity, + k.TotalGovExpense, ), } stats = append(stats, funcs...) @@ -73,7 +73,7 @@ func NewKoboldMine() *KoboldMine { Value: 0.15, }, SectorScavengingIncome: cardsim.Stored[float64]{ - Name: "Sector Scavening Income", + Name: "Sector Scavenging Income", Value: 0.1, }, GovBureaucracyExpense: cardsim.Stored[float64]{