-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmoves.yml
253 lines (230 loc) · 8.28 KB
/
moves.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
Directions:
O: 0,0
# Clockwise from forward
FF: -1,-1
FR: 0,-1
BR: 1,0
BB: 1,1
BL: 0,1
FL: -1,0
A: [FF,FR,BR,BB,BL,FL]
# Diagonals
DF: [FL,FR]
DB: [BR,BL]
Symbols:
Faction:
$: Friendly
%: Enemy
!: Neutral
'': Anything
Piece:
0: Empty
*: '[0FIKHBGCT]'
@: '[FIKHBGCT]'
# Normal pieces
F: Footsoldier
I: Infantry
K: Cavalry
H: Chariot
B: Trebuchet
N: '[FIKHB]'
T: Tower
# Counterattacking pieces
G: Garrison
C: Castle
A: '[GC]'
# Unused in default rules
Color:
'g': Green
'p': Purple
'o': Orange
'Use Types':
'': No change (not highlighted)
+: No change (highlighted)
.: Landing spot, convert to the subject piece
.?: Landing spot, convert to named piece (on this faction)
-: Piece damaged
x: Piece removed/destroyed
# Move and attack descriptions:
# Each move is a "vector" with an optional format string (if none is provided, one is pattern-matched from the below table).
# Vectors are comprised of directed 'segments' strung together with '>', where each segment's direction is relative to the direction of the preceeding segment.
# A segment may have any number of cells, including zero, which form a straight line, and each cell specifies the requirements that must be met for the move to be valid, including faction and piece type, as well as what happens to that cell, which can be nothing, being overwritten with a piece, or being damaged or destroyed.
# Absolute coordinates may be specified for moves as well.
# Additionally, specific moves can be specified to only apply under specific alternative rulesets, by prefixing a list of names.
# Note: O() must be the first segment, must have exactly one cell, and cannot
# have faction/piece restrictions, only a use type (because by definition, it
# contains the subject piece, so specification is redundant).
# The default origin segment, if none is provided, is to remove the piece, equivalent to 'O(.0)', also equivalent to 'O(x)' except for highlighting. 'O(.)' instead means that the piece is unchanged by the move. 'O()' and 'O(+)' would also be equivalent except for highlighting.
# Empty tiles are counted as both friendly and enemy. Towers are neither.
# Faction tags may be combined, as in 'A($!*)' (friendly or tower).
# Piece tags may be combined, but must be enclosed in [], as in 'O(.)A(*)([TG]x)'.
# Formally, a vector looks like:
# vector :=
# [ rule-code ] [ origin-use '>' ] segment-list
# segment-list:
# segment [ '>' segment-list ]
# segment :=
# direction [ cell* ]
# cell :=
# [ absolute-coords ] '(' faction-restrictions piece-restrictions use-type ')' [ '*' ]
# origin-use :=
# 'O' '(' use-type ')'
# direction :=
# 'A' | 'DF' | 'DB' |
# 'FF' | 'FR' | 'BR' | 'BB' | 'BL' | 'FL'
# /* see above for direction coordinates */
# absolute-coords :=
# '[x=' number ']' | '[y=' number ']' | '[' number ',' number ']'
# faction-restrictions :=
# /* see above */
# piece-restrictions :=
# /* see above */
# use-type :=
# /* see above */
# rule-code :=
# '"' rule-name [ rule-joiner rule-name ]* '":'
# rule-joiner :=
# '&' /* and */ | ',' /* or */
'Default Formats':
Moves:
[Cx]: "{Win} with {P O}"
['C(H=1)-']: "{Win} with {P O}"
[-,'[^O].']: "{Attack} {P -} with {P O} landing at {L .}"
[-]: "{Attack} {P -} with {P O}"
[.G]: "{Garrison} {P .} with {P O}"
['[^O].']: "{Move} {T O} from {L O} to {L .}"
P: "{T} at {L}"
using-rules:
standard: ["no-obstructed", "short", "no-buff-infantry"]
simulator: ["obstructed", "cavalry-towers", "short", "no-buff-infantry"]
balancing-test: ["buff-footsoldiers", "friendly-footsoldiers", "obstructed",
"cavalry-towers", "short", "no-buff-infantry"]
rule-descriptions:
friendly-footsoldiers: "Footsoldiers can pass through friendlies (p2)"
buff-footsoldiers: "Footsoldiers can move directly backwards"
upgrade-footsoldiers: "Footsoldiers become infantry when reaching end of board"
stranded: "Footsoldiers can attack castle directly backwards"
obstructed: "When attacking a counterattacking piece, no landing site is needed"
short: "Garrisons attack adjacent tiles"
long: "Garrisons attack ranged tiles"
buff-infantry: "Trebuchets deal normal damage to infantry"
buff-trebuchet: "Trebuchets can move during phase 1"
cavalry-towers: "Cavalry can pass through towers"
cavalry-garrisons: "Cavalry can garrison an adjacent tower"
cavalry-sprint-garrisons: "Cavalry can attack and garrison in same turn"
Pieces:
Footsoldier:
M:
- v: 'DF(0.)'
- v: '"buff-footsoldiers":DB(0.)'
A:
- v: 'DF(%N-)(0.)'
# Attack tower to upgrade to infantry
- v: 'DF(Tx)(0.I)'
f: "{Destroy} {P -} with {P O} landing at {L .} as {I}"
# Non-standard, in simulator:
- v: '"obstructed":DF(%A-)'
# Standard, not in simulator:
- v: '"no-obstructed":DF(%A-)(0+)'
# Non-standard: move backwards
- v: '"buff-footsoldiers":BB(0.)'
- v: '"buff-footsoldiers":BB(%N-)(0.)'
- v: '"buff-footsoldiers":BB(T-)(0.I)'
- v: '"buff-footsoldiers&no-obstructed":BB(C-)(0+)'
- v: '"buff-footsoldiers&obstructed":BB(C-)'
# Non-standard: Pass through friendlies
- v: '"friendly-footsoldiers":DF($*)(0.)'
# - v: '"friendly-footsoldiers&buff-footsoldiers":BB($*)(0.)'
# Non-standard: Become infantry on reaching back of board
- v: '"upgrade-footsoldiers":DF[x=-5](0.I)'
- v: '"upgrade-footsoldiers":DF[y=-5](0.I)'
- v: '"upgrade-footsoldiers&friendly-footsoldiers":DF($*)[x=-5](0.I)'
- v: '"upgrade-footsoldiers&friendly-footsoldiers":DF($*)[y=-5](0.I)'
# Non-standard: Attack castle backwards
# (redundant with buff-footsoldiers, irrelevant with upgrade-footsoldiers)
- v: '"stranded&obstructed":DB(%C-)'
- v: '"stranded&no-obstructed":DB(%C-)(0+)'
Infantry:
M:
- v: A(0.)
- v: DF(0)(0.)
A:
- v: A(%N)(0.)
- v: DF(0)(%N-)(0.)
# Can garrison a tower
- v: A(T.G)
- v: DF(0)(T.G)
# Survives a garrison counterattack as a footsoldier
- v: A(%G)(0.F)
- v: DF(0)(%G-)(0.F)
# Does not survive a castle's counterattack
# Non-standard, in simulator:
- v: '"obstructed":A(%C-)'
- v: '"obstructed":DF(0)(%C-)'
# Standard, not in simulator:
- v: '"no-obstructed":A(%C-)(0+)'
- v: '"no-obstructed":DF(0)(%C-)(0+)'
# When damaged, an infantry turns into a footsoldier
D: F
Cavalry:
M:
- v: A($*)>DF(0.)
- v: '"cavalry-towers":A(T)>DF(0.)'
A:
- v: A($*)>DF(0.)
- v: A($*)>DF(T.G)
- v: A($*)>DF(%N-)>A($*)>DF(0.)
- v: O(.)>A($*)>DF(%N-)
f: "{Attack} {P -} with {P O} and retreat"
# Note that cavalry do not need the obstructed rule because they can retreat
- v: A($*)>DF(%A-)
- v: '"cavalry-towers":A(T)>DF(0.)'
- v: '"cavalry-towers":A(T)>DF(T.G)'
- v: '"cavalry-towers":A(T)>DF(%N-)>A(T)>DF(0.)'
- v: '"cavalry-towers":O(.)>A(T)>DF(%N-)'
f: "{Attack} {P -} with {P O} and retreat"
- v: '"cavalry-towers":A(T)>DF(%A-)'
# Non-standard: Garrison adjacent tower
- v: '"cavalry-garrisons":A(T.G)'
# "capturing the tower with a cavalry unit that would be able to move to that
# position as a type II action" could be interpreted as allowing this move
- v: '"cavalry-sprint-garrisons":A($*)>DF(%N-)>A($*)>DF(T.G)'
f: "{Attack} {P -} with {P O} and {Garrison} {P .}"
Chariot:
M:
- v: A(0.)
# * means repeated
- v: A(0)*(0.)
A:
- v: A(0)*(0.)
- v: A(0)*(%N-)(0.)
# Non-standard, in simulator:
- v: '"obstructed":A(0)*(%A-)'
# Standard, not in simulator:
- v: '"no-obstructed":A(0)*(%A-)(0+)'
Trebuchet:
M:
- v: '"buff-trebuchet":A(0.)'
A:
- v: A(0.)
- v: '"no-buff-infantry":O(.)>A(*)(%*x)'
# Trebuchets can attack towers
- v: O(.)>A(*)(Tx)
# Non-standard: Deal only standard damage to infantry
- v: '"buff-infantry":O(.)>A(*)(%N-)'
- v: '"buff-infantry":O(.)>A(*)(%[GC]x)'
Tower:
M: []
A: []
Garrison:
M: []
A:
- v: '"short":O(.)>A(%*-)'
# Non-standard: Garrisons have a long-range attack
- v: '"long":O(.)A(*)(%*-)'
D: T
Castle:
M: []
A: []
# Castles have two hit points instead of one.
H: 2