Compare commits

..

No commits in common. "7313ac0d7359cbb8eec86313b36f58f17ffdf244" and "5af762474cc69bb40a05158662d66d9e1a15d1fb" have entirely different histories.

2 changed files with 15 additions and 66 deletions

View File

@ -57,7 +57,7 @@ var cards = []Card{
}, },
}, },
&VerbosePolicy{ &VerbosePolicy{
Default: &BasicPolicy{ BasicPolicy: &BasicPolicy{
UnenactedDesc: cardsim.MsgStr("This isn't about a disaster and can probably be safely dismissed."), UnenactedDesc: cardsim.MsgStr("This isn't about a disaster and can probably be safely dismissed."),
Do: func(p *Player) (cardsim.Message, error) { Do: func(p *Player) (cardsim.Message, error) {
p.Stats.Kobolds.Value += 20 p.Stats.Kobolds.Value += 20
@ -67,24 +67,23 @@ var cards = []Card{
p.Stats.Kobolds.Value -= 20 p.Stats.Kobolds.Value -= 20
return nil return nil
}, },
CanDo: YesWeCan,
}, },
Variants: []Policy{ Content: []DescResult{
&BasicPolicy{ {
UnenactedDesc: cardsim.MsgStr("Rejecting this issue will also reject the military's natalist stance."), Desc: cardsim.MsgStr("Rejecting this issue will also reject the military's natalist stance."),
Do: OverrideMsg(cardsim.MsgStr("Militant natalism has been reduced by policy.")), Result: cardsim.MsgStr("Militant natalism has been reduced by policy."),
}, },
&BasicPolicy{ {
UnenactedDesc: cardsim.MsgStr(`"Dig deeper" pressures in your nation may be excessive.`), Desc: cardsim.MsgStr(`"Dig deeper" pressures in your nation may be excessive.`),
Do: OverrideMsg(cardsim.MsgStr("Some of the lower depths are being abandoned.")), Result: cardsim.MsgStr("Some of the lower depths are being abandoned."),
}, },
&BasicPolicy{ {
UnenactedDesc: cardsim.MsgStr("Near-surface patrols may need to be increased."), Desc: cardsim.MsgStr("Near-surface patrols may need to be increased."),
Do: OverrideMsg(cardsim.MsgStr("More and better-armed hunting outposts are being established.")), Result: cardsim.MsgStr("More and better-armed hunting outposts are being established."),
}, },
&BasicPolicy{ {
EnactedDesc: cardsim.MsgStr("This isn't about a disaster and can probably continue to be safely dismissed."), Desc: cardsim.MsgStr("This isn't about a disaster and can probably continue to be safely dismissed."),
Do: OverrideMsg(cardsim.MsgStr("Creche control doesn't shift that easily.")), Result: cardsim.MsgStr("Creche control doesn't shift that easily."),
}, },
}, },
}, },
@ -156,9 +155,8 @@ var cards = []Card{
}, },
}, },
&VerbosePolicy{ &VerbosePolicy{
Default: &BasicPolicy{ BasicPolicy: &BasicPolicy{
UnenactedDesc: cardsim.MsgStr("Some kobolds will attend the festival on their own, and we may face desertions for our lack of interest."), UnenactedDesc: cardsim.MsgStr("Some kobolds will attend the festival on their own, and we may face desertions for our lack of interest."),
EnactedDesc: cardsim.MsgStr("Some kobolds will attend the festival on their own. No change is expected."),
Do: func(p *Player) (cardsim.Message, error) { Do: func(p *Player) (cardsim.Message, error) {
p.Stats.Kobolds.Value -= 20 p.Stats.Kobolds.Value -= 20
return cardsim.MsgStr("A festival of bureaucracy lured away a few kobolds to other nations."), nil return cardsim.MsgStr("A festival of bureaucracy lured away a few kobolds to other nations."), nil
@ -167,27 +165,6 @@ var cards = []Card{
p.Stats.Kobolds.Value += 20 p.Stats.Kobolds.Value += 20
return nil return nil
}, },
CanDo: YesWeCan,
},
Variants: []Policy{
nil,
&DisabledPolicy{cardsim.MsgStr("TODO(rakeela): write")},
&DisabledPolicy{cardsim.MsgStr("TODO(rakeela): write")},
&FuncPolicy{
OptionTextFunc: func(p *Player) (cardsim.Message, error) {
if p.Stats.GovBureaucracyExpense.Value >= -0.03 {
return cardsim.MsgStr("Permitting the festival will yield some immigration, but we'll be expected to rebuild our bureaucracy."), nil
}
return cardsim.MsgStr("Permitting the festival will yield some immigration."), nil
},
EnactFunc: func(p *Player) (cardsim.Message, error) {
if p.Stats.GovBureaucracyExpense.Value >= -0.03 {
return cardsim.MsgStr("A festival of bureaucracy just saw the nation's bureaucracy rebuilt."), ErrKeepMessage
}
return cardsim.MsgStr("A festival of bureaucracy brought in immigrants wondering at the nation's lack thereof."), ErrKeepMessage
},
},
nil, // remember, if using a BasicPolicy, this uses EnactedDesc
}, },
}, },
}, },

View File

@ -398,34 +398,6 @@ func (f *FuncPolicy) Is(p Policy) bool {
return ok && (f == fp) return ok && (f == fp)
} }
// A DisabledPolicy is never enabled.
type DisabledPolicy struct {
Msg cardsim.Message
}
func (d *DisabledPolicy) OptionText(p *Player) (cardsim.Message, error) {
return d.Msg, nil
}
func (d *DisabledPolicy) Enact(*Player) (cardsim.Message, error) {
return nil, ErrOptionNotEnabled
}
func (d *DisabledPolicy) Enabled(*Player) bool {
return false
}
func (d *DisabledPolicy) Unenact(*Player) error {
return ErrPolicyNotEnacted
}
func (d *DisabledPolicy) LastEnacted(int, Policy) {}
func (d *DisabledPolicy) Is(p Policy) bool {
dp, ok := p.(*DisabledPolicy)
return ok && (dp == d)
}
// ShuffleIntoBottomHalf is a common "what to do with the card after?" behavior. // ShuffleIntoBottomHalf is a common "what to do with the card after?" behavior.
func ShuffleIntoBottomHalf(c Card, p *Player, _ CardOption) error { func ShuffleIntoBottomHalf(c Card, p *Player, _ CardOption) error {
p.Deck.InsertRandomBottom(0.5, c) p.Deck.InsertRandomBottom(0.5, c)