Change "Productivity" to "Income" and "Expense
Also fixes a typo and an incorrectly assigned variable.
This commit is contained in:
parent
4e983bd0f0
commit
0e77206868
@ -13,14 +13,14 @@ var cards = []Card{
|
||||
EnactedDesc: cardsim.MsgStr("[current policy] Your war chief is presntly monitoring the situation, building up your military, and securing your creches."),
|
||||
Do: func(p *Player) (cardsim.Message, error) {
|
||||
p.Stats.Kobolds.Value += 100
|
||||
p.Stats.SectorScavengingProductivity.Value += 0.01
|
||||
p.Stats.GovWarProductivity.Value += 0.02
|
||||
p.Stats.SectorScavengingIncome.Value += 0.01
|
||||
p.Stats.GovWarExpense.Value += 0.02
|
||||
return cardsim.MsgStr("Kobolds are known to be born warriors."), nil
|
||||
},
|
||||
Undo: func(p *Player) error {
|
||||
p.Stats.Kobolds.Value -= 100
|
||||
p.Stats.SectorScavengingProductivity.Value -= 0.01
|
||||
p.Stats.GovWarProductivity.Value -= 0.02
|
||||
p.Stats.SectorScavengingIncome.Value -= 0.01
|
||||
p.Stats.GovWarExpense.Value -= 0.02
|
||||
return nil
|
||||
},
|
||||
},
|
||||
@ -29,14 +29,14 @@ var cards = []Card{
|
||||
EnactedDesc: cardsim.MsgStr("[current policy] Your head miner is presently leading a project to dig as far away from the surface as possible."),
|
||||
Do: func(p *Player) (cardsim.Message, error) {
|
||||
p.Stats.Kobolds.Value += 40
|
||||
p.Stats.SectorMiningProductivity.Value += 0.02
|
||||
p.Stats.GovBureaucracyProductivity.Value += 0.01
|
||||
p.Stats.SectorMiningIncome.Value += 0.02
|
||||
p.Stats.GovBureaucracyExpense.Value += 0.01
|
||||
return cardsim.MsgStr("Kobolds are known to be cowards hiding in the dark."), nil
|
||||
},
|
||||
Undo: func(p *Player) error {
|
||||
p.Stats.Kobolds.Value -= 40
|
||||
p.Stats.SectorMiningProductivity.Value -= 0.02
|
||||
p.Stats.GovBureaucracyProductivity.Value -= 0.01
|
||||
p.Stats.SectorMiningIncome.Value -= 0.02
|
||||
p.Stats.GovBureaucracyExpense.Value -= 0.01
|
||||
return nil
|
||||
},
|
||||
},
|
||||
@ -45,14 +45,14 @@ var cards = []Card{
|
||||
EnactedDesc: cardsim.MsgStr("[current policy] Military funding has been diverted into early childhood education."),
|
||||
Do: func(p *Player) (cardsim.Message, error) {
|
||||
p.Stats.Kobolds.Value -= 40
|
||||
p.Stats.SectorScavengingProductivity.Value -= 0.01
|
||||
p.Stats.GovWarProductivity.Value -= 0.02
|
||||
p.Stats.SectorScavengingIncome.Value -= 0.01
|
||||
p.Stats.GovWarExpense.Value -= 0.02
|
||||
return cardsim.MsgStr("An undefended hunting outpost near the surface was recently wiped out by a raid."), nil
|
||||
},
|
||||
Undo: func(p *Player) error {
|
||||
p.Stats.Kobolds.Value += 40
|
||||
p.Stats.SectorScavengingProductivity.Value += 0.01
|
||||
p.Stats.GovWarProductivity.Value += 0.02
|
||||
p.Stats.SectorScavengingIncome.Value += 0.01
|
||||
p.Stats.GovWarExpense.Value += 0.02
|
||||
return nil
|
||||
},
|
||||
},
|
||||
|
@ -8,11 +8,11 @@ import (
|
||||
type KoboldMine struct {
|
||||
Kobolds cardsim.Stored[int64]
|
||||
|
||||
SectorMiningProductivity cardsim.Stored[float64]
|
||||
SectorScavengingProductivity cardsim.Stored[float64]
|
||||
SectorMiningIncome cardsim.Stored[float64]
|
||||
SectorScavengingIncome cardsim.Stored[float64]
|
||||
|
||||
GovBureaucracyProductivity cardsim.Stored[float64]
|
||||
GovWarProductivity cardsim.Stored[float64]
|
||||
GovBureaucracyExpense cardsim.Stored[float64]
|
||||
GovWarExpense cardsim.Stored[float64]
|
||||
}
|
||||
|
||||
func (k *KoboldMine) ProductivityFunc(s *cardsim.Stored[float64]) func() float64 {
|
||||
@ -22,38 +22,38 @@ func (k *KoboldMine) ProductivityFunc(s *cardsim.Stored[float64]) func() float64
|
||||
}
|
||||
|
||||
func (k *KoboldMine) TotalSectorProductivity() float64 {
|
||||
return float64(k.Kobolds.Value) * (k.SectorMiningProductivity.Value + k.SectorScavengingProductivity.Value)
|
||||
return float64(k.Kobolds.Value) * (k.SectorMiningIncome.Value + k.SectorScavengingIncome.Value)
|
||||
}
|
||||
|
||||
func (k *KoboldMine) TotalGovProductivity() float64 {
|
||||
return float64(k.Kobolds.Value) * (k.GovBureaucracyProductivity.Value + k.GovWarProductivity.Value)
|
||||
return float64(k.Kobolds.Value) * (k.GovBureaucracyExpense.Value + k.GovWarExpense.Value)
|
||||
}
|
||||
|
||||
func (k *KoboldMine) Stats() []cardsim.Stat {
|
||||
stats := cardsim.ExtractStats(k)
|
||||
funcs := []cardsim.Stat{
|
||||
cardsim.StatFunc(
|
||||
"Total Sector Mining Productivity",
|
||||
k.ProductivityFunc(&k.SectorMiningProductivity),
|
||||
"Total Sector Mining Income",
|
||||
k.ProductivityFunc(&k.SectorMiningIncome),
|
||||
),
|
||||
cardsim.StatFunc(
|
||||
"Total Sector Scavenging Productivity",
|
||||
k.ProductivityFunc(&k.SectorScavengingProductivity),
|
||||
"Total Sector Scavenging Income",
|
||||
k.ProductivityFunc(&k.SectorScavengingIncome),
|
||||
),
|
||||
cardsim.StatFunc(
|
||||
"Total Government Bureaucracy Productivity",
|
||||
k.ProductivityFunc(&k.GovBureaucracyProductivity),
|
||||
"Total Government Bureaucracy Expense",
|
||||
k.ProductivityFunc(&k.GovBureaucracyExpense),
|
||||
),
|
||||
cardsim.StatFunc(
|
||||
"Total Government War Productivity",
|
||||
k.ProductivityFunc(&k.GovBureaucracyProductivity),
|
||||
"Total Government War Expense",
|
||||
k.ProductivityFunc(&k.GovWarExpense),
|
||||
),
|
||||
cardsim.StatFunc(
|
||||
"Total Sector Productivity",
|
||||
"Total Sector Income",
|
||||
k.TotalSectorProductivity,
|
||||
),
|
||||
cardsim.StatFunc(
|
||||
"Total Government Productivity",
|
||||
"Total Government Expense",
|
||||
k.TotalGovProductivity,
|
||||
),
|
||||
}
|
||||
@ -68,20 +68,20 @@ func NewKoboldMine() *KoboldMine {
|
||||
Name: "Kobolds",
|
||||
Value: 1000,
|
||||
},
|
||||
SectorMiningProductivity: cardsim.Stored[float64]{
|
||||
Name: "Sector Mining Productivity",
|
||||
SectorMiningIncome: cardsim.Stored[float64]{
|
||||
Name: "Sector Mining Income",
|
||||
Value: 0.15,
|
||||
},
|
||||
SectorScavengingProductivity: cardsim.Stored[float64]{
|
||||
Name: "Sector Scavening Productivity",
|
||||
SectorScavengingIncome: cardsim.Stored[float64]{
|
||||
Name: "Sector Scavening Income",
|
||||
Value: 0.1,
|
||||
},
|
||||
GovBureaucracyProductivity: cardsim.Stored[float64]{
|
||||
Name: "Government Bureaucracy Productivity",
|
||||
GovBureaucracyExpense: cardsim.Stored[float64]{
|
||||
Name: "Government Bureaucracy Expense",
|
||||
Value: 0.05,
|
||||
},
|
||||
GovWarProductivity: cardsim.Stored[float64]{
|
||||
Name: "Government War Productivity",
|
||||
GovWarExpense: cardsim.Stored[float64]{
|
||||
Name: "Government War Expense",
|
||||
Value: 0.1,
|
||||
},
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user