Squalor mechanic introduction

I haven't connected it to crime yet.
This commit is contained in:
Rakeela Windrider 2023-04-19 22:33:24 -07:00
parent 3ca17d8881
commit 6d6d0f5c8b

View File

@ -206,10 +206,6 @@ func (k *KoboldMine) TotalGovExpense() float64 {
return float64(k.Kobolds()) * (math.Max(k.TruePropagandaExpense(), 0) + math.Max(k.TrueBureaucracyExpense(), 0) + math.Max(k.TrueWarExpense(), 0) + math.Max(k.TrueQoLExpense(), 0) + math.Max(k.TrueLogisticsExpense(), 0) + math.Max(k.TrueDragonSubsExpense(), 0) + math.Max(k.TrueResearchSubsExpense(), 0) + math.Max(k.TrueEducationExpense(), 0) + math.Max(k.TrueHealthcareExpense(), 0) + math.Max(k.TrueForeignRelExpense(), 0) + math.Max(k.TruePoliceExpense(), 0) + math.Max(k.TrueEconPlanExpense(), 0) + math.Max(k.TrueParksExpense(), 0) + math.Max(k.TrueFaithExpense(), 0)) return float64(k.Kobolds()) * (math.Max(k.TruePropagandaExpense(), 0) + math.Max(k.TrueBureaucracyExpense(), 0) + math.Max(k.TrueWarExpense(), 0) + math.Max(k.TrueQoLExpense(), 0) + math.Max(k.TrueLogisticsExpense(), 0) + math.Max(k.TrueDragonSubsExpense(), 0) + math.Max(k.TrueResearchSubsExpense(), 0) + math.Max(k.TrueEducationExpense(), 0) + math.Max(k.TrueHealthcareExpense(), 0) + math.Max(k.TrueForeignRelExpense(), 0) + math.Max(k.TruePoliceExpense(), 0) + math.Max(k.TrueEconPlanExpense(), 0) + math.Max(k.TrueParksExpense(), 0) + math.Max(k.TrueFaithExpense(), 0))
} }
//func (k *KoboldMine) TotalEconomicPotential() float64 {
// return (math.Max(k.MiningIncome, 0.01) + math.Max(k.ScavengingIncome, 0) + math.Max(k.AlchemyIncome, 0) + math.Max(k.HospitalityIncome, 0) + math.Max(k.AgricultureIncome, 0) + math.Max(k.ManufacturingIncome, 0) + math.Max(k.PlanarIncome, 0) + math.Max(k.PublishingIncome, 0) + math.Max(k.FinanceIncome, 0) + math.Max(k.GadgetryIncome, 0) + math.Max(k.FishingIncome, 0) + math.Max(k.ConstructionIncome, 0.02) + math.Max(k.PropagandaExpense, 0) + math.Max(k.BureaucracyExpense, 0) + math.Max(k.WarExpense, 0) + math.Max(k.QoLExpense, 0) + math.Max(k.LogisticsExpense, 0) + math.Max(k.DragonSubsExpense, 0) + math.Max(k.ResearchSubsExpense, 0) + math.Max(k.EducationExpense, 0) + math.Max(k.HealthcareExpense, 0) + math.Max(k.ForeignRelExpense, 0) + math.Max(k.PoliceExpense, 0) + math.Max(k.EconPlanExpense, 0) + math.Max(k.ParksExpense, 0) + math.Max(k.FaithExpense, 0)) * 0.8
//} // This function is intended to enable "crowding out" effects at a later point. Each +1 increase in overall productivity increases TEP by 0.8, losing 1/5th of the gain to crowding, which should manifest as everything else declining. Now, uh... How do I scale investments by the TEP stat? With a simple multiplication, a 0.01 increase to mining would be a 0.08 increase to everything else. Damn it, I thought I had something.
func (k *KoboldMine) Taxation() float64 { func (k *KoboldMine) Taxation() float64 {
return (k.TotalGovExpense() / (k.TotalSectorIncome() + k.TotalGovExpense())) * 100 return (k.TotalGovExpense() / (k.TotalSectorIncome() + k.TotalGovExpense())) * 100
} }
@ -246,6 +242,45 @@ func (k *KoboldMine) DisplayedSecrecy() float64 {
return k.Secrecy * 100 return k.Secrecy * 100
} }
// func (k *KoboldMine) StatSqualor() float64 {
// return ???
//}
// I want squalor to start out high and new "nations" to be plagued by crimes of poverty. As the economy comes online, squalor should be suppressed. Different categories of investment are differently effective in achieving this, with QoL spending being the most effective and Scavenging Income... maybe even aggravating squalor. How do I stat this? Game design is hard.
// Okay, so I'm thinking that I want to generate a Squalor Resistance stat based on all the categories of input.
func (k *KoboldMine) SqualorReduction() float64 {
total := math.Max(k.MiningIncome, 0.01)
total -= math.Max(k.ScavengingIncome, 0)
total += math.Max(k.AlchemyIncome, 0)
total += math.Max(k.HospitalityIncome, 0) * 2
total += math.Max(k.ManufacturingIncome, 0)
total += math.Max(k.PlanarIncome, 0)
total += math.Max(k.PublishingIncome, 0) * 2
total += math.Max(k.FinanceIncome, 0) * 3
total += math.Max(k.GadgetryIncome, 0) * 2
total += math.Max(k.ConstructionIncome, 0.02) * 2
total += math.Max(k.PropagandaExpense, 0)
total += math.Max(k.BureaucracyExpense, 0) * 2
total += math.Max(k.QoLExpense, 0) * 20
total += math.Max(k.LogisticsExpense, 0)
total += math.Max(k.ResearchSubsExpense, 0) * 2
total += math.Max(k.EducationExpense, 0) * 4
total += math.Max(k.HealthcareExpense, 0) * 6
total += math.Max(k.ForeignRelExpense, 0)
total += math.Max(k.PoliceExpense, 0)
total += math.Max(k.EconPlanExpense, 0)
total += math.Max(k.ParksExpense, 0) * 3
total += math.Max(k.FaithExpense, 0) * 10
return total
}
func (k *KoboldMine) StatSqualor() float64 {
return 100 * math.Pow(1.204, 1.2-(2*k.SqualorReduction()))
}
// So I want squalor to be a value between 100 and 0 that reduces readily at the start and then becomes increasingly difficult to further reduce. This initial squalor stat starts at about 80%, but may not change rapidly enough. Note that the 1.2-(2* sequence is meant to balance it at 80% starting point. If I change the velocity on the 2* side, I have to change the 1.2 offset as well. I really hope this math works, because I don't quite understand it.
func (k *KoboldMine) Stats() []cardsim.Stat { func (k *KoboldMine) Stats() []cardsim.Stat {
stats := cardsim.ExtractStats(k) stats := cardsim.ExtractStats(k)
funcs := []cardsim.Stat{ funcs := []cardsim.Stat{
@ -381,6 +416,14 @@ func (k *KoboldMine) Stats() []cardsim.Stat {
"Kobolds", "Kobolds",
k.Kobolds, k.Kobolds,
), ),
cardsim.InvisibleStatFunc(
"Squalor Reduction",
k.SqualorReduction,
),
cardsim.StatFunc(
"Squalor",
k.StatSqualor,
),
} }
stats = append(stats, funcs...) stats = append(stats, funcs...)
// cardsim.SortStats(stats) // cardsim.SortStats(stats)