Commit Graph
29 Commits
Author SHA1 Message Date
kistaro b2099586fc reimplement clamp as mid
removes an opportunity to write a bug by swapping low and high
2024-09-29 12:09:11 -07:00
kistaro 219ff33d66 Rewrite Warborn military creche option 2024-09-29 10:32:57 -07:00
kistaro 5b860135e9 EnactionDesc for enaction event 2024-09-29 10:32:01 -07:00
kistaro d2a00d2044 fix compilation errors and warnings 2024-09-29 10:27:15 -07:00
kistaro ba5171fd67 Prototype for TablePolicy 2024-09-29 10:19:19 -07:00
kistaro 350fd0f777 Use Mean to calculate StatChaos. 2023-05-13 20:15:57 -07:00
kistaro 816b5e8e7a Mathematical mean helper. 2023-05-13 20:13:05 -07:00
kistaro 0a39cc76d6 Two Kobolds In A Trenchcoat: grammar fix 2023-04-08 18:38:51 -07:00
kistaro de7092cf4b SwitchingCard.IsValid: control drawability.
Cards can now specify conditions that must be met for them to be drawn into the hand.

Additionally, this improves the documentation of SwitchingCard.
2023-04-08 18:33:58 -07:00
kistaro d434e50897 Shuffle cards back by default.
If no After function is provided for a SwitchingCard, it uses ShuffleIntoBottomHalf.

This also modifies Then to be callable with a nil `o`, which it recognizes as "nothing happened but we need cleanup anyway", in preparation for the incoming "make cards sometimes not drawable" feature.
2023-04-08 18:18:00 -07:00
kistaro 301d8ae161 Hide unavailable options on SwitchingCard. 2023-04-04 20:21:12 -07:00
kistaro f7bed6c4b9 Can't assume CanDo is always there.
BasicPolicy doesn't know how to do fallback, that's driven by the VerbosePolicy. But the VerbosePolicy isn't there if BasicPolicy is trying to use CanDo itself. Just remove the check.
2023-04-03 21:15:43 -07:00
kistaro 1eedfb50e8 Fix enablement 2023-04-03 20:33:35 -07:00
kistaro c2d637b109 Fix out-of-range check. 2023-04-03 20:25:29 -07:00
kistaro 7313ac0d73 Fully implement Festival of Bureaucracy. 2023-04-03 20:24:01 -07:00
kistaro 140d7b6cbb DisabledPolicy: a policy that doesn't 2023-04-03 20:12:06 -07:00
kistaro 5af762474c OverrideDefaultMsg and support in VerbosePolicy
For when you need a partially-functional message but don't want to repeatedly write the same Enact func.
2023-04-03 19:57:09 -07:00
kistaro 2c1fc73ef5 FuncPolicy: function pointer policy
For when you don't want to go to the trouble of writing a type, but do need actual functions.
2023-04-03 19:52:47 -07:00
kistaro a1f55c865d Refactor VerbosePolicy.
This allows it to switch between other complete policies, with fallbacks to a default if parts aren't impelemented. Complementing it is the change to BasicPolicy, which throws ErrUnimplemented if fields are missing, which VerbosePolicy uses as a "go ask the default" sign.
2023-04-03 19:41:32 -07:00
kistaro 4e983bd0f0 Fix nil deref and identity failure.
Also updates deps to pick up a message display fix.
2023-04-03 01:59:23 -07:00
kistaro c798ba31e1 Fix nil dereference. 2023-04-03 01:40:47 -07:00
kistaro 47fa7c3d6b tidy go.mod 2023-04-03 01:38:30 -07:00
kistaro 175a2323f4 Remove duplicate initDeck. 2023-04-03 01:37:26 -07:00
kistaro 5728dd95f0 Oops, forgot to shuffle the card back in. 2023-04-03 01:36:47 -07:00
kistaro fb5aaeccfc Implement first issue.
This seems like the least complicated way to get the desired reusable behaviors.
2023-04-03 01:32:02 -07:00
kistaro 0e1f5ff246 Reversible policies 2023-04-03 00:17:01 -07:00
kistaro 825ee8d053 Initial stats, etc. 2023-04-02 23:24:47 -07:00
kistaro bdc095e2b2 go.mod, gitignore 2023-04-02 22:30:52 -07:00
kistaro dbee1416c8 Initial commit 2023-04-03 05:17:39 +00:00