New Issue, Food Supply Feature

This commit is contained in:
2023-04-04 20:23:32 -07:00
parent 301d8ae161
commit 159508b202
2 changed files with 194 additions and 26 deletions

View File

@@ -6,7 +6,7 @@ import (
// KoboldMine is the state of a kobold mine.
type KoboldMine struct {
Kobolds int64 `cardsim:"stat"`
BasePopulation float64 `cardsim:"stathidden"`
MiningIncome float64 `cardsim:"stat" cardsim_name:"Mining Productivity"`
ScavengingIncome float64 `cardsim:"stat" cardsim_name:"Scavenging Productivity"`
@@ -21,6 +21,7 @@ type KoboldMine struct {
FishingIncome float64 `cardsim:"stat" cardsim_name:"Fishing Productivity"`
ConstructionIncome float64 `cardsim:"stat" cardsim_name:"Construction Productivity"`
PropagandaExpense float64 `cardsim:"stat" cardsim_name:"Propaganda Investment"`
BureaucracyExpense float64 `cardsim:"stat" cardsim_name:"Bureaucracy Investment"`
WarExpense float64 `cardsim:"stat" cardsim_name:"War Investment"`
QoLExpense float64 `cardsim:"stat" cardsim_name:"QoL Investment"`
@@ -35,22 +36,24 @@ type KoboldMine struct {
ParksExpense float64 `cardsim:"stat" cardsim_name:"Parks and Aesthetics Investment"`
FaithExpense float64 `cardsim:"stat" cardsim_name:"Faith Investment"`
FoodSupply float64 `cardsim:"stathidden"`
// AnotherExpense float64 `cardsim:"hiddenround5"`
// A different way of adding stats that is slightly more empowering.
}
func (k *KoboldMine) ProductivityFunc(s *float64) func() float64 {
return func() float64 {
return *s * float64(k.Kobolds)
return *s * float64(k.BasePopulation)
}
}
func (k *KoboldMine) TotalSectorIncome() float64 {
return float64(k.Kobolds) * (k.MiningIncome + k.ScavengingIncome + k.AlchemyIncome + k.HospitalityIncome + k.AgricultureIncome + k.ManufacturingIncome + k.PlanarIncome + k.PublishingIncome + k.FinanceIncome + k.GadgetryIncome + k.FishingIncome + k.ConstructionIncome)
return float64(k.Kobolds()) * (k.MiningIncome + k.ScavengingIncome + k.AlchemyIncome + k.HospitalityIncome + k.AgricultureIncome + k.ManufacturingIncome + k.PlanarIncome + k.PublishingIncome + k.FinanceIncome + k.GadgetryIncome + k.FishingIncome + k.ConstructionIncome)
}
func (k *KoboldMine) TotalGovExpense() float64 {
return float64(k.Kobolds) * (k.BureaucracyExpense + k.WarExpense + k.QoLExpense + k.LogisticsExpense + k.DragonSubsExpense + k.ResearchSubsExpense + k.EducationExpense + k.HealthcareExpense + k.ForeignRelExpense + k.PoliceExpense + k.EconPlanExpense + k.ParksExpense + k.FaithExpense)
return float64(k.Kobolds()) * (k.BureaucracyExpense + k.WarExpense + k.QoLExpense + k.LogisticsExpense + k.DragonSubsExpense + k.ResearchSubsExpense + k.EducationExpense + k.HealthcareExpense + k.ForeignRelExpense + k.PoliceExpense + k.EconPlanExpense + k.ParksExpense + k.FaithExpense)
}
func (k *KoboldMine) Taxation() float64 {
@@ -61,6 +64,14 @@ func (k *KoboldMine) StatTaxRate() float64 {
return k.Taxation()
}
func (k *KoboldMine) Kobolds() int64 {
return int64(k.BasePopulation * k.FoodSupply)
}
func (k *KoboldMine) DisplayedFoodSupply() float64 {
return (k.FoodSupply - 1) * 100
}
func (k *KoboldMine) Stats() []cardsim.Stat {
stats := cardsim.ExtractStats(k)
funcs := []cardsim.Stat{
@@ -172,6 +183,14 @@ func (k *KoboldMine) Stats() []cardsim.Stat {
"Total Government Expense",
k.TotalGovExpense,
),
cardsim.StatFunc(
"Food Supply",
k.DisplayedFoodSupply,
),
cardsim.StatFunc(
"Kobolds",
k.Kobolds,
),
}
stats = append(stats, funcs...)
// cardsim.SortStats(stats)
@@ -180,7 +199,7 @@ func (k *KoboldMine) Stats() []cardsim.Stat {
func NewKoboldMine() *KoboldMine {
return &KoboldMine{
Kobolds: 1000,
BasePopulation: 1000,
MiningIncome: 0.15,
ScavengingIncome: 0.1,
AlchemyIncome: 0.01,
@@ -206,5 +225,6 @@ func NewKoboldMine() *KoboldMine {
EconPlanExpense: 0.02,
ParksExpense: 0.0,
FaithExpense: 0.03,
FoodSupply: 0.20,
}
}