Card 10, first PIP implementation
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
// KoboldMine is the state of a kobold mine.
|
||||
type KoboldMine struct {
|
||||
BasePopulation float64 `cardsim:"stathidden"`
|
||||
DragonCount float64 `cardsim:"stat" cardsim_name:"Dragon Population"`
|
||||
|
||||
Mining float64 `cardsim:"stathidden" cardsim_name:"Mining"`
|
||||
Scavenging float64 `cardsim:"stathidden" cardsim_name:"Scavenging"`
|
||||
@@ -32,7 +33,6 @@ type KoboldMine struct {
|
||||
Education float64 `cardsim:"stathidden" cardsim_name:"Education"`
|
||||
Healthcare float64 `cardsim:"stathidden" cardsim_name:"Healthcare"`
|
||||
ForeignRelExpense float64 `cardsim:"stathidden" cardsim_name:"Diplomatic Investment"`
|
||||
Police float64 `cardsim:"stathidden" cardsim_name:"Law Enforcement"`
|
||||
ParksExpense float64 `cardsim:"stathidden" cardsim_name:"City Beautification"`
|
||||
Faith float64 `cardsim:"stathidden" cardsim_name:"Faith"`
|
||||
|
||||
@@ -43,7 +43,7 @@ type KoboldMine struct {
|
||||
Rebellion float64 `cardsim:"stathidden"`
|
||||
Madness float64 `cardsim:"stathidden"`
|
||||
Cruelty float64 `cardsim:"stat"`
|
||||
Greed float64 `cardsim:"stat"`
|
||||
Greed float64 `cardsim:"stathidden"`
|
||||
Gullibility float64 `cardsim:"stathidden"`
|
||||
Authoritarianism float64 `cardsim:"stat"`
|
||||
|
||||
@@ -55,12 +55,14 @@ type KoboldMine struct {
|
||||
}
|
||||
|
||||
func (k *KoboldMine) Kobolds() int64 {
|
||||
return int64((k.BasePopulation * (k.Healthcare + 1)) * (k.FoodSupply) * (100 + k.TrueForeignRelations()/100))
|
||||
return int64((k.BasePopulation * (k.Healthcare + 1)) * (k.FoodSupply / 10) * (1 + k.TrueForeignRelations()/100))
|
||||
}
|
||||
|
||||
const (
|
||||
MinFoodSupply = 18
|
||||
MaxFoodSupply = 37
|
||||
MinFoodSupply = 18
|
||||
MaxFoodSupply = 37
|
||||
MinForeignRelations = -11
|
||||
MaxForeignRelations = 9
|
||||
)
|
||||
|
||||
func (k *KoboldMine) DisplayedFoodSupply() float64 {
|
||||
@@ -77,21 +79,14 @@ func (k *KoboldMine) TrueForeignRelations() float64 {
|
||||
return openness / 100 * effectiveRel
|
||||
}
|
||||
|
||||
const (
|
||||
MinForeignRelations = -11
|
||||
MaxForeignRelations = 9
|
||||
)
|
||||
|
||||
func (k *KoboldMine) DisplayedForeignRelations() float64 {
|
||||
return 100 * (k.ForeignRelations - MinForeignRelations) / (MaxForeignRelations - MinForeignRelations)
|
||||
}
|
||||
|
||||
func (k *KoboldMine) DisplayedSecrecy() float64 {
|
||||
return k.Secrecy * 100
|
||||
return k.Secrecy
|
||||
}
|
||||
|
||||
// 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) StatChaos() float64 {
|
||||
return Mean(k.Rebellion, k.Madness, k.Cruelty)
|
||||
}
|
||||
@@ -102,7 +97,7 @@ func (k *KoboldMine) StatCorruption() float64 {
|
||||
return Mean(k.Greed, k.Gullibility, k.Authoritarianism)
|
||||
}
|
||||
|
||||
// This is the "crimes of cunning" stat for my crime calculations. It will also be displayed to the player as just Corruption. The player can also see Greed and Authoritarianism, so they should have a good idea what goes into Corruption, but they'll have to infer the importance of Gullibility.
|
||||
// This is the "crimes of cunning" stat for my crime calculations. It will also be displayed to the player as just Corruption. The player can see Authoritarianism, but they'll have to infer the importance of Greed and Gullibility.
|
||||
|
||||
func (k *KoboldMine) Stats() []cardsim.Stat {
|
||||
stats := cardsim.ExtractStats(k)
|
||||
@@ -155,7 +150,6 @@ func NewKoboldMine() *KoboldMine {
|
||||
Education: 0,
|
||||
Healthcare: 0,
|
||||
ForeignRelExpense: 0,
|
||||
Police: 0,
|
||||
ParksExpense: 0,
|
||||
Faith: 0,
|
||||
FoodSupply: 20,
|
||||
|
Reference in New Issue
Block a user