Skip to content

Commit

Permalink
Convert Manna Chess to Adrenaline Chess, for #17.
Browse files Browse the repository at this point in the history
Removes random element of manna drops.
  • Loading branch information
donkirkby committed Nov 16, 2023
1 parent 5d39031 commit 3f3c7a5
Show file tree
Hide file tree
Showing 12 changed files with 171 additions and 209 deletions.
9 changes: 9 additions & 0 deletions diagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ def build(self) -> SvgDiagram:
text_args = dict(text_anchor='middle',
font_family='Raleway',
font_size=round(0.55*square_size))
corner_text_args = dict(text_anchor='middle',
font_family='Raleway',
font_size=round(0.375*square_size))
margins = (0, 0)
for line in lines[8:]:
command, body = line.split(':', maxsplit=1)
Expand All @@ -45,6 +48,12 @@ def build(self) -> SvgDiagram:
extra_elements.add(extra_elements.text(fields[0],
(x, y),
**text_args))
elif command == 'corner text':
x = round(x0 + (float(fields[1]) - 0.344) * square_size, 1)
y = round(y0 - (float(fields[2]) + 0.445) * square_size, 1)
extra_elements.add(extra_elements.text(fields[0],
(x, y),
**corner_text_args))
elif command == 'rect':
x1, y1, x2, y2 = [float(field) for field in fields]
left = round(15 + (x1-1)*square_size, 1)
Expand Down
Binary file modified docs/images/new_rules/diagram1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/new_rules/diagram2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/new_rules/diagram3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/new_rules/diagram4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/images/new_rules/diagram5.png
Binary file not shown.
Binary file removed docs/images/new_rules/diagram6.png
Binary file not shown.
113 changes: 52 additions & 61 deletions docs/new_rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,93 +7,84 @@ These are new games that aren't ready yet. You can try them out and let me
know what you think.

## Table of Contents
* [Manna Chess][manna-chess] adds random power ups to chess. (2
players, chess set, checkers set, and 2 dice)
* [Adrenaline Chess][adrenaline-chess] adds power ups to chess. (2
players, chess set, and checkers set)
* [Cloak and Dagger Chess][cloak-and-dagger-chess] is a game where you
disguise your chess pieces as checkers, then try to identify your
opponent's pieces. (2 players, chess set, checkers set, pen, and tape)

[manna-chess]: #manna-chess
[adrenaline-chess]: #adrenaline-chess
[cloak-and-dagger-chess]: #cloak-and-dagger-chess

# New Games
These games are in early development or playtesting. The rules might get more
filled out or change based on feedback from players.

## Manna Chess
The god of war drops manna after every capture, and manna can make any piece a
king. This game adds a little chaos to chess, and accelerates the end game.
## Adrenaline Chess
What if taking your opponent's piece frightened the others so much that they
became more aggressive? Every time you take a piece, you have to choose one of
the remaining pieces to get an adrenaline rush, and adrenaline can make any
piece a king. This game adds a little chaos to chess, and accelerates the end
game.

### Equipment
A standard chess set, a standard set of 24 checkers, and two dice. The checkers
A standard chess set and a standard set of 24 checkers. The checkers
must be stackable, and you must be able to stack a chess piece on top of the
checkers. Coins or poker chips would also work, as long as they fit inside the
chess board squares.

### Setup
Set up the chess pieces in the standard start position, and randomly choose who
will play white. Place the 24 checkers and the dice beside the board.
will play white. Place the checkers beside the board.

### Play
All the regular chess rules apply, plus you get to drop manna after one of your
pieces is captured. If one or more of your pieces were just captured, start your
turn by pointing to one of the four corners of the board. Then roll two dice to
decide which file (column) the manna will land on. The corner you're pointing to
is 3, then count up across the board to the number you rolled. Rolls of 2, 11,
or 12 miss the board, and you get no manna. Then roll the two dice again to
decide which rank (row) the manna will land on. Again, you're pointing at 3,
and count up across the board to 10. If manna lands on the board, add a checker
to that square. The colour of the checker doesn't matter. If that square has a
chess piece or other checkers on it, add the new checker to the stack.

In the following example, white just captured a pawn with the bishop, so now
black points to the bottom-left corner and rolls a 7 and a 6. Counting from the
left, the 7 puts it on the e file. Counting from the bottom, the 6 puts it on
e4.
All the regular chess rules apply, plus you must give an adrenaline rush after
captures. If you captured one or more pieces, end your turn by placing a
checker under one of your opponent's remaining pieces. The colour of the
checker doesn't matter, and you may stack multiple checkers under a piece.

![Diagram](images/new_rules/diagram1.png)

Checkers or stacks of checkers without a chess piece on them are neutral manna
pieces that can be captured by either player. When you capture them, stack your
capturing piece on top. You cannot jump over manna, except with a knight. When
you capture an opponent's piece, you keep any manna they were carrying.
In the following example, white just captured a pawn with the bishop, and
finishes the turn by adding a checker under the pawn at h7.

Captured manna are carried with the chess piece on top when you move the chess
piece. If one of your pieces has manna after you move it, you may eat one of
those manna and make an extra king move with that piece. Eat a manna by
removing it from the stack and putting back in the supply beside the board. If
the piece still has manna, you may continue making king moves until you run out.
![Diagram](images/new_rules/diagram1.png)

For example, in this position, the pawns at e3 and e5 cannot capture the manna
at e4. However, the white pawn at d3 can. Once it captures the manna, it could
immediately eat it and capture the pawn at e5 with a king's move. That would be
a poor choice, though, because the pawn at d6 could capture it back.
To move a piece with checkers under it, you must make a regular move for that
piece, and bring the checkers along. Then you may use up one of the checkers
under that piece to make an extra move like a king. Remove a checker from the
stack, and move the rest one space in any direction. If that piece still has
checkers under it, you may continue making extra king moves until the piece
runs out of checkers.

The extra moves may capture pieces, but you only ever add one checker per turn.
When you capture an opponent's piece, your capturing piece keeps any adrenaline
the captured piece had, and may immediately use the adrenaline.

For example, here is a strange checkmate that uses white's adrenaline to
threaten the white king. Black has just captured a pawn, and has spent the last
few turns pumping a trapped bishop full of adrenaline. Adding a third checker
to the stack at c1 would seem to make the bishop a threat to the black queen,
but it must make a regular move before it can start using the adrenaline. White
has been forced to keep the king retreating, and hasn't been able to move the
pawns that would free the bishop. The black queen on the other hand, will be
able to capture the bishop on the next turn, and then use those three checkers
to capture the king at f2, possibly capturing the pawn at d2 along the way.
Moving the king to e1 or e3 would still be in range for the queen. e2 would be
a direct capture by the queen, f1 and f3 could be captured by the queen or the
black bishop. g3 might give a glimmer of hope, until you notice that the black
pawn at h5 has a checker. It is checkmate.

![Diagram](images/new_rules/diagram2.png)

White decides to capture the manna, but not eat it.

![Diagram](images/new_rules/diagram3.png)
After castling, you may use both the king and the rook for extra moves, if they
both have checkers. You may capture a pawn en passant on the second rank at the
usual square after a regular move of two squares. You may not capture en passant
at a square that the pawn left using an extra move, and you may not use an extra
move to capture en passant. A pawn that moves to the back rank immediately
promotes, and may continue making king moves if it still has checkers.

### Winning
Win by capturing the king, either with a regular move or with a manna move. You
must call check or check mate if you can, but it's possible for a lucky manna
drop to allow a capture when you couldn't call check mate on the previous turn.

### Manna Strategy
Because 7 is the most common roll with two dice, you have some control over
where the manna will drop when you choose which corner to count from. For
example, if you chose the bottom-left corner 1000 times, here are how many times
you would expect the manna to land in each square:

![Diagram](images/new_rules/diagram4.png)

You would also expect to miss the board 210 times, so you will add a piece of
manna roughly 8 out of 10 times you roll.

You can see that the most likely square is the centre square opposite the corner
you start counting in, so check which squares you occupy or can attack before
you roll for manna.
Win by checkmate, as in regular chess, but you may use extra moves to threaten
the king.

# Broken Games
These ideas seemed promising, but didn't work at the table. Maybe I'll come back
Expand All @@ -111,7 +102,7 @@ write the numbers 1 to 8 on checkers for each player. Put the black checkers on
black's back row and the light checkers on white's back row. Finally, write two
grids like this to secretly record your pieces and deduce your opponent's:

![Diagram](images/new_rules/diagram5.png)
![Diagram](images/new_rules/diagram3.png)

Obviously, you don't have to put the pieces in their standard starting
positions, but you do have to have a standard set of pieces. (You can't give
Expand All @@ -127,7 +118,7 @@ opponent learns which of your combinations are impossible.

Here's one possible way to fill in your grid at the start of the game:

![Diagram](images/new_rules/diagram6.png)
![Diagram](images/new_rules/diagram4.png)

At the start of your turn, you may guess the identity of one of your opponent's
checkers. If you guess correctly, you may make a bonus move after your regular
Expand Down
7 changes: 7 additions & 0 deletions publish_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def __init__(self,
self.diagram_differ = DiagramDiffer()
self.diagram_differ.tolerance = 10
self.is_disabled = is_disabled
self.unused_images = set(images_folder.glob('diagram*.png'))

def add_diagram(self, diagram: Diagram) -> Path:
if self.is_disabled:
Expand All @@ -77,6 +78,7 @@ def add_diagram(self, diagram: Diagram) -> Path:
file_name = f'diagram{self.diagram_count}.png'
target_path = self.images_folder / file_name
relative_path = target_path.relative_to(self.target_folder)
self.unused_images.remove(target_path)
try:
old_image = LivePillowImage(Image.open(target_path))
self.diagram_differ.compare(old_image, image)
Expand All @@ -87,6 +89,10 @@ def add_diagram(self, diagram: Diagram) -> Path:
image.write_png(target_path)
return relative_path

def remove_unused_images(self) -> None:
for image_path in self.unused_images:
image_path.unlink()


class RulesDocTemplate(SimpleDocTemplate):
def __init__(self,
Expand Down Expand Up @@ -347,6 +353,7 @@ def main():
first_bullet,
bulleted_list_style,
numbered_list_style)
diagram_writer.remove_unused_images()
if not args.booklet:
story.append(cc_drawing)
story.append(Paragraph(
Expand Down
Loading

0 comments on commit 3f3c7a5

Please sign in to comment.