aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2020-09-16 12:22:44 +0200
committerFlorian Fischer <florian.fl.fischer@fau.de>2020-10-18 14:28:12 +0200
commitd66f10f393b5057fb73352d08a24425f0a6e0347 (patch)
tree5a739ecc3e31c42ffadcc8ce3ab341cda79ec072
parent716db14842fa39159a2e96eaabbe60061967ec2a (diff)
downloadmuhqs-game-d66f10f393b5057fb73352d08a24425f0a6e0347.tar.gz
muhqs-game-d66f10f393b5057fb73352d08a24425f0a6e0347.zip
introduce new splitcontent commands for single and two lines
-rw-r--r--latex/cards/armor.tex3
-rw-r--r--latex/cards/banner.tex1
-rw-r--r--latex/cards/cloak.tex3
-rw-r--r--latex/cards/gear.tex3
-rw-r--r--latex/cards/great_sword.tex3
-rw-r--r--latex/cards/mace.tex3
-rw-r--r--latex/cards/magic.tex57
-rw-r--r--latex/cards/missionary.tex2
-rw-r--r--latex/cards/pioneer.tex2
-rw-r--r--latex/cards/plate_armor.tex3
-rw-r--r--latex/cards/poisoned_dagger.tex3
-rw-r--r--latex/cards/shield.tex3
-rw-r--r--latex/cards/smith.tex2
-rw-r--r--latex/cards/spear.tex3
-rw-r--r--latex/cards/sword.tex3
-rw-r--r--latex/cards/tax_collector.tex2
-rw-r--r--latex/cards/tower_shield.tex3
-rw-r--r--latex/tikzcards.tex37
-rwxr-xr-xscripts/generate_latex.py20
19 files changed, 131 insertions, 25 deletions
diff --git a/latex/cards/armor.tex b/latex/cards/armor.tex
index 4ba2d0fb..6959e2dd 100644
--- a/latex/cards/armor.tex
+++ b/latex/cards/armor.tex
@@ -12,7 +12,8 @@
\cardtypeEquipment
\cardtitle{Armor}
\cardbuycost{7}
-\cardsplitcontent{Durability: 3}{Equipped unit gains + 1 Armor}\cardplaycost{2}
+\cardsplitcontentsingleline{Durability: 3}{Equipped unit gains + 1 Armor}
+\cardplaycost{2}
\cardborder
\end{tikzpicture}
diff --git a/latex/cards/banner.tex b/latex/cards/banner.tex
index a37115ed..e0d42cc8 100644
--- a/latex/cards/banner.tex
+++ b/latex/cards/banner.tex
@@ -14,7 +14,6 @@
\cardbuycost{2}
\cardcontent{Units you control in range 1 gain +1 attack damage and +1 movement}
\cardplaycost{7}
-
\cardborder
\end{tikzpicture}
\end{document}
diff --git a/latex/cards/cloak.tex b/latex/cards/cloak.tex
index 1facbcf1..1ccd3973 100644
--- a/latex/cards/cloak.tex
+++ b/latex/cards/cloak.tex
@@ -12,7 +12,8 @@
\cardtypeEquipment
\cardtitle{Cloak}
\cardbuycost{3}
-\cardsplitcontent{Durability: 2}{equiped unit gains shroud (can't be targeted)}\cardplaycost{7}
+\cardsplitcontentsingleline{Durability: 2}{equiped unit gains shroud (can't be targeted)}
+\cardplaycost{7}
\cardborder
\end{tikzpicture}
diff --git a/latex/cards/gear.tex b/latex/cards/gear.tex
index 5bfdcfc6..0caff14a 100644
--- a/latex/cards/gear.tex
+++ b/latex/cards/gear.tex
@@ -12,7 +12,8 @@
\cardtypeEquipment
\cardtitle{Gear}
\cardbuycost{2}
-\cardsplitcontent{Durability: 3}{equipped unit gain +1 movement}\cardplaycost{3}
+\cardsplitcontentsingleline{Durability: 3}{equipped unit gain +1 movement}
+\cardplaycost{3}
\cardborder
\end{tikzpicture}
diff --git a/latex/cards/great_sword.tex b/latex/cards/great_sword.tex
index 4ad236bd..c50b1780 100644
--- a/latex/cards/great_sword.tex
+++ b/latex/cards/great_sword.tex
@@ -12,7 +12,8 @@
\cardtypeEquipment
\cardtitle{Great Sword}
\cardbuycost{10}
-\cardsplitcontent{Durability: 3}{equipped unit gains +2 Melee Damage}\cardplaycost{4}
+\cardsplitcontentsingleline{Durability: 3}{equipped unit gains +2 Melee Damage}
+\cardplaycost{4}
\cardborder
\end{tikzpicture}
diff --git a/latex/cards/mace.tex b/latex/cards/mace.tex
index 400e62b8..1bcb0ab0 100644
--- a/latex/cards/mace.tex
+++ b/latex/cards/mace.tex
@@ -12,7 +12,8 @@
\cardtypeEquipment
\cardtitle{Mace}
\cardbuycost{2}
-\cardsplitcontent{Durability: 3}{equipped unit afflicts Paralysis when dealing damage in melee combat}\cardplaycost{6}
+\cardsplitcontentsingleline{Durability: 3}{equipped unit afflicts Paralysis when dealing damage in melee combat}
+\cardplaycost{6}
\cardborder
\end{tikzpicture}
diff --git a/latex/cards/magic.tex b/latex/cards/magic.tex
new file mode 100644
index 00000000..f139d962
--- /dev/null
+++ b/latex/cards/magic.tex
@@ -0,0 +1,57 @@
+\documentclass[a4paper,landscape]{article}
+
+% Ränder des Dokuments anpassen
+\usepackage[margin=6mm,top=5mm]{geometry}
+
+% Pakete dazuladen
+\input{libs.tex}
+% Farbdefinitionen laden
+\input{colors.tex}
+% \card-Commands laden
+\input{tikzcards.tex}
+
+\usepackage{standalone}
+
+\begin{document}
+\begin{center}
+\pagestyle{empty}
+\input{cards/defense!.tex}
+\hspace{5mm}
+\input{cards/heal!.tex}
+\hspace{5mm}
+\input{cards/charge.tex}
+\hspace{5mm}
+\input{cards/rush.tex}
+\vspace{5mm}
+
+\input{cards/attack!.tex}
+\hspace{5mm}
+\input{cards/move!.tex}
+\hspace{5mm}
+\input{cards/stumble!.tex}
+\hspace{5mm}
+\input{cards/more!.tex}
+\vspace{5mm}
+
+\input{cards/select!.tex}
+\hspace{5mm}
+\input{cards/die!.tex}
+\hspace{5mm}
+\input{cards/clone!.tex}
+\hspace{5mm}
+\input{cards/no!.tex}
+\vspace{5mm}
+
+\input{cards/mine!.tex}
+\hspace{5mm}
+\input{cards/isolate!.tex}
+\hspace{5mm}
+\input{cards/shroud!.tex}
+\hspace{5mm}
+\input{cards/ritual!.tex}
+\vspace{5mm}
+
+
+\end{center}
+\end{document}
+
diff --git a/latex/cards/missionary.tex b/latex/cards/missionary.tex
index b961c5d8..2f2ae456 100644
--- a/latex/cards/missionary.tex
+++ b/latex/cards/missionary.tex
@@ -12,7 +12,7 @@
\cardtypeUnit
\cardtitle{Missionary}
\cardbuycost{10}
-\cardsplitcontent{Health: 1\\ Movement: 2}{\faRotateRight: put two faith counters on target Unit. If there are more faith counters than the units buying cost you control target unit.}
+\cardsplitcontenttwolines{Health: 1\\ Movement: 2}{\faRedo: put two faith counters on target Unit. If there are more faith counters than the units buying cost you control target unit.}
\cardplaycost{2}
\cardborder
\end{tikzpicture}
diff --git a/latex/cards/pioneer.tex b/latex/cards/pioneer.tex
index e6b30a98..3e20ddaf 100644
--- a/latex/cards/pioneer.tex
+++ b/latex/cards/pioneer.tex
@@ -12,7 +12,7 @@
\cardtypeUnit
\cardtitle{Pioneer}
\cardbuycost{7}
-\cardsplitcontent{Health: 5\\ Movement: 1}{\faRotateRight: Neutralize adjacent tile}
+\cardsplitcontenttwolines{Health: 5\\ Movement: 1}{\faRedo: Neutralize adjacent tile}
\cardplaycost{1}
\cardborder
\end{tikzpicture}
diff --git a/latex/cards/plate_armor.tex b/latex/cards/plate_armor.tex
index 9431b7bc..fcea7e39 100644
--- a/latex/cards/plate_armor.tex
+++ b/latex/cards/plate_armor.tex
@@ -12,7 +12,8 @@
\cardtypeEquipment
\cardtitle{Plate Armor}
\cardbuycost{8}
-\cardsplitcontent{Durability: 1}{equiped unit has +2 Armor and can't move}\cardplaycost{3}
+\cardsplitcontentsingleline{Durability: 1}{equiped unit has +2 Armor and can't move}
+\cardplaycost{3}
\cardborder
\end{tikzpicture}
diff --git a/latex/cards/poisoned_dagger.tex b/latex/cards/poisoned_dagger.tex
index 2edcdeea..d4939924 100644
--- a/latex/cards/poisoned_dagger.tex
+++ b/latex/cards/poisoned_dagger.tex
@@ -12,7 +12,8 @@
\cardtypeEquipment
\cardtitle{Poisoned Dagger}
\cardbuycost{3}
-\cardsplitcontent{Durability: 2}{equipped unit deals damage as poison counters in melee combat}\cardplaycost{7}
+\cardsplitcontentsingleline{Durability: 2}{equipped unit deals damage as poison counters in melee combat}
+\cardplaycost{7}
\cardborder
\end{tikzpicture}
diff --git a/latex/cards/shield.tex b/latex/cards/shield.tex
index 1d0206a7..b5843f3b 100644
--- a/latex/cards/shield.tex
+++ b/latex/cards/shield.tex
@@ -12,7 +12,8 @@
\cardtypeEquipment
\cardtitle{Shield}
\cardbuycost{5}
-\cardsplitcontent{Durability: 3}{equipped unit gains +1 Health}\cardplaycost{1}
+\cardsplitcontentsingleline{Durability: 3}{equipped unit gains +1 Health}
+\cardplaycost{1}
\cardborder
\end{tikzpicture}
diff --git a/latex/cards/smith.tex b/latex/cards/smith.tex
index 251fd710..103503b0 100644
--- a/latex/cards/smith.tex
+++ b/latex/cards/smith.tex
@@ -12,7 +12,7 @@
\cardtypeUnit
\cardtitle{Smith}
\cardbuycost{10}
-\cardsplitcontent{Health: 1\\ Movement: 1}{\faRotateRight: Pay X: Create Copy of artifact with buy cost = X in range 1 on empty tile in range 1}
+\cardsplitcontenttwolines{Health: 1\\ Movement: 1}{\faRedo: Pay X: Create Copy of artifact with buy cost = X in range 1 on empty tile in range 1}
\cardplaycost{2}
\cardborder
\end{tikzpicture}
diff --git a/latex/cards/spear.tex b/latex/cards/spear.tex
index 60244936..f450af87 100644
--- a/latex/cards/spear.tex
+++ b/latex/cards/spear.tex
@@ -12,7 +12,8 @@
\cardtypeEquipment
\cardtitle{Spear}
\cardbuycost{2}
-\cardsplitcontent{Durability: 3}{Equipped unit gains +1 Attack and Range 2 against unit with M >= 3}\cardplaycost{7}
+\cardsplitcontentsingleline{Durability: 3}{Equipped unit gains +1 Attack and Range 2 against unit with M >= 3}
+\cardplaycost{7}
\cardborder
\end{tikzpicture}
diff --git a/latex/cards/sword.tex b/latex/cards/sword.tex
index 24687043..5e61e8f5 100644
--- a/latex/cards/sword.tex
+++ b/latex/cards/sword.tex
@@ -12,7 +12,8 @@
\cardtypeEquipment
\cardtitle{Sword}
\cardbuycost{5}
-\cardsplitcontent{Durability: 3}{equipped unit gains +1 Melee Damage}\cardplaycost{2}
+\cardsplitcontentsingleline{Durability: 3}{equipped unit gains +1 Melee Damage}
+\cardplaycost{2}
\cardborder
\end{tikzpicture}
diff --git a/latex/cards/tax_collector.tex b/latex/cards/tax_collector.tex
index 9b5d9319..48e96290 100644
--- a/latex/cards/tax_collector.tex
+++ b/latex/cards/tax_collector.tex
@@ -12,7 +12,7 @@
\cardtypeUnit
\cardtitle{Tax Collector}
\cardbuycost{5}
-\cardsplitcontent{Health: 1\\ Movement: 2}{\faRotateRight: get 2 additional ressource}
+\cardsplitcontenttwolines{Health: 1\\ Movement: 2}{\faRedo: get 2 additional ressource}
\cardplaycost{1}
\cardborder
\end{tikzpicture}
diff --git a/latex/cards/tower_shield.tex b/latex/cards/tower_shield.tex
index cc566a9b..25c6ba79 100644
--- a/latex/cards/tower_shield.tex
+++ b/latex/cards/tower_shield.tex
@@ -12,7 +12,8 @@
\cardtypeEquipment
\cardtitle{Tower Shield}
\cardbuycost{7}
-\cardsplitcontent{Durability: 3}{Equipped unit has +2 Health}\cardplaycost{2}
+\cardsplitcontentsingleline{Durability: 3}{Equipped unit has +2 Health}
+\cardplaycost{2}
\cardborder
\end{tikzpicture}
diff --git a/latex/tikzcards.tex b/latex/tikzcards.tex
index 70037fb2..7f1fccc2 100644
--- a/latex/tikzcards.tex
+++ b/latex/tikzcards.tex
@@ -100,10 +100,43 @@
\clip[cardcorners] \shapeCard;
\fill[elementcorners,contentbg] \shapeContentArea;
\end{scope}
- \node[below right, text width=(\cardwidth-2*\strippadding-\stripwidth-2*\textpadding-0.3)*1cm] at (2*\strippadding+\stripwidth+\textpadding, 0.5*\cardheight-\textpadding + 1) {
+ % \node[draw, below right, text width=(\cardwidth-2*\strippadding-\stripwidth-2*\textpadding-0.3)*1cm] at (2*\strippadding+\stripwidth+\textpadding, 0.5*\cardheight-\textpadding + \heightof{)#1}) {
+ \node[draw, below right, text width=(\cardwidth-2*\strippadding-\stripwidth-2*\textpadding-0.3)*1cm] at (2*\strippadding+\stripwidth+\textpadding, 0.5*\cardheight-\textpadding + 0.8) {
\textit{\normalsize #1}
};
- \node[below right, text width=(\cardwidth-2*\strippadding-\stripwidth-2*\textpadding-0.3)*1cm] at (2*\strippadding+\stripwidth+\textpadding, 3.6) {
+ \node[draw, below right, text width=(\cardwidth-2*\strippadding-\stripwidth-2*\textpadding-0.3)*1cm] at (2*\strippadding+\stripwidth+\textpadding, 0.5*\cardheight - 0.8) {
+ \vrule width \textwidth height 2pt \\[-2pt]
+ \vspace{0.2cm}
+ {\normalsize #2}
+ };
+}
+
+\newcommand{\cardsplitcontentsingleline}[2]{
+ \begin{scope}[even odd rule]
+ \clip[cardcorners] \shapeCard;
+ \fill[elementcorners,contentbg] \shapeContentArea;
+ \end{scope}
+ % \node[draw, below right, text width=(\cardwidth-2*\strippadding-\stripwidth-2*\textpadding-0.3)*1cm] at (2*\strippadding+\stripwidth+\textpadding, 0.5*\cardheight-\textpadding + \heightof{)#1}) {
+ \node[draw, below right, text width=(\cardwidth-2*\strippadding-\stripwidth-2*\textpadding-0.3)*1cm] at (2*\strippadding+\stripwidth+\textpadding, 0.5*\cardheight-\textpadding) {
+ \textit{\normalsize #1}
+ };
+ \node[draw, below right, text width=(\cardwidth-2*\strippadding-\stripwidth-2*\textpadding-0.3)*1cm] at (2*\strippadding+\stripwidth+\textpadding, 0.5*\cardheight - 0.8) {
+ \vrule width \textwidth height 2pt \\[-2pt]
+ \vspace{0.2cm}
+ {\normalsize #2}
+ };
+}
+
+\newcommand{\cardsplitcontenttwolines}[2]{
+ \begin{scope}[even odd rule]
+ \clip[cardcorners] \shapeCard;
+ \fill[elementcorners,contentbg] \shapeContentArea;
+ \end{scope}
+ % \node[draw, below right, text width=(\cardwidth-2*\strippadding-\stripwidth-2*\textpadding-0.3)*1cm] at (2*\strippadding+\stripwidth+\textpadding, 0.5*\cardheight-\textpadding + \heightof{)#1}) {
+ \node[draw, below right, text width=(\cardwidth-2*\strippadding-\stripwidth-2*\textpadding-0.3)*1cm] at (2*\strippadding+\stripwidth+\textpadding, 0.5*\cardheight-\textpadding + 0.4) {
+ \textit{\normalsize #1}
+ };
+ \node[draw, below right, text width=(\cardwidth-2*\strippadding-\stripwidth-2*\textpadding-0.3)*1cm] at (2*\strippadding+\stripwidth+\textpadding, 0.5*\cardheight - 0.8) {
\vrule width \textwidth height 2pt \\[-2pt]
\vspace{0.2cm}
{\normalsize #2}
diff --git a/scripts/generate_latex.py b/scripts/generate_latex.py
index 76c1bf58..6b35d8fc 100755
--- a/scripts/generate_latex.py
+++ b/scripts/generate_latex.py
@@ -75,8 +75,8 @@ def generate_card(card_name: str, card: MutableMapping):
health = card['health']
movement = card['movement']
- # stats = f'\\faHeart: {health}\\\\ Movement: {movement}'
- stats = f'Health: {health}\\\\ Movement: {movement}'
+ # stats = f'\\faHeart: {health}\\\\ \\faShoePrints: {movement}'
+ stats = [f'Health: {health}', f'Movement: {movement}']
attack = card.get('attack', None)
if attack:
@@ -84,8 +84,9 @@ def generate_card(card_name: str, card: MutableMapping):
if "Range" in attack:
attack_sym = '\\ding{246}'
# stats += f'\\\\ {attack_sym}: {attack}'
- stats += f'\\\\ Attack: {attack}'
+ stats.append(f'Attack: {attack}')
+ stats_str = '\\\\ '.join(stats)
if 'effect' in card or 'full_action' in card:
ability_block = ""
@@ -99,9 +100,12 @@ def generate_card(card_name: str, card: MutableMapping):
ability_block += '\\\\ '
ability_block += f'\\faRotateRight: {full_action}'
- card_content += f'\cardsplitcontent{{{stats}}}{{{ability_block}}}'
+ if len(stats) == 2:
+ card_content += f'\cardsplitcontenttwolines{{{stats_str}}}{{{ability_block}}}'
+ else:
+ card_content += f'\cardsplitcontent{{{stats_str}}}{{{ability_block}}}'
else:
- card_content += f'\cardcontent{{{stats}}}'
+ card_content += f'\cardcontent{{{stats_str}}}'
card_content += '\n'
@@ -110,12 +114,14 @@ def generate_card(card_name: str, card: MutableMapping):
elif card['type'] == 'spell':
card_content += f'\cardcontent{{{card["effect"]}}}\n'
card_content += f'\cardplaycost{{{card["play"]}}}'
+
elif card['type'] == 'artifact':
card_content += f'\cardcontent{{{card["effect"]}}}\n'
- card_content += f'\cardplaycost{{{card["play"]}}}\n'
+ card_content += f'\cardplaycost{{{card["play"]}}}'
+
elif card['type'] == 'equipment':
# card_content += f'\cardsplitcontent{{\\faRecycle: {card["durability"]}}}{{{card["effect"]}}}'
- card_content += f'\cardsplitcontent{{Durability: {card["durability"]}}}{{{card["effect"]}}}'
+ card_content += f'\cardsplitcontentsingleline{{Durability: {card["durability"]}}}{{{card["effect"]}}}\n'
card_content += f'\cardplaycost{{{card["play"]}}}\n'
else:
print('WARNING: unknown card type {card["type"]}!')