Obesity Stat Implementation
First sigmoid function!
This commit is contained in:
parent
d66e17a279
commit
de98cf8fb3
@ -1,6 +1,8 @@
|
||||
package koboldsim
|
||||
|
||||
import (
|
||||
"math"
|
||||
|
||||
"git.chromaticdragon.app/kistaro/CardSimEngine/cardsim"
|
||||
)
|
||||
|
||||
@ -65,13 +67,17 @@ func (k *KoboldMine) StatTaxRate() float64 {
|
||||
}
|
||||
|
||||
func (k *KoboldMine) Kobolds() int64 {
|
||||
return int64(k.BasePopulation * k.FoodSupply)
|
||||
return int64(k.BasePopulation * k.FoodSupply * (1 - 0.5*(k.StatObesity()/100)))
|
||||
}
|
||||
|
||||
func (k *KoboldMine) DisplayedFoodSupply() float64 {
|
||||
return (k.FoodSupply - 1) * 100
|
||||
}
|
||||
|
||||
func (k *KoboldMine) StatObesity() float64 {
|
||||
return 100 / (1 + math.Exp(-0.05*(k.DisplayedFoodSupply()-37)))
|
||||
}
|
||||
|
||||
func (k *KoboldMine) Stats() []cardsim.Stat {
|
||||
stats := cardsim.ExtractStats(k)
|
||||
funcs := []cardsim.Stat{
|
||||
|
Loading…
Reference in New Issue
Block a user