diff options
| author | Florian Fischer <florian.fl.fischer@fau.de> | 2021-03-01 11:19:34 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fl.fischer@fau.de> | 2021-03-01 11:19:34 +0100 |
| commit | 898ccaaf393ccd20f4b105ac59af74c35ea93bb2 (patch) | |
| tree | a849ac451075b4ef93d1dfc2cab1720988366cfc | |
| parent | 130c80b40454015e988de29f92eb020aa25fa91b (diff) | |
| download | muhqs-game-898ccaaf393ccd20f4b105ac59af74c35ea93bb2.tar.gz muhqs-game-898ccaaf393ccd20f4b105ac59af74c35ea93bb2.zip | |
[html] generate cards listing
| -rw-r--r-- | html/Makefile | 65 | ||||
| -rw-r--r-- | html/cards.md | 725 | ||||
| -rwxr-xr-x | scripts/generate_card.py | 27 |
3 files changed, 798 insertions, 19 deletions
diff --git a/html/Makefile b/html/Makefile index b11d692d..6afc7ead 100644 --- a/html/Makefile +++ b/html/Makefile @@ -1,20 +1,42 @@ -VERBOSE = @ +VERBOSE ?= @ PANDOC_FLAGS = -f markdown -s --template=./template.html -BUILDDIR = build +# The full path to the Makefile +MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) +# The path to the directory of the Makefile +MAKEFILE_DIR := $(dir $(MAKEFILE_PATH)) -RULES_DIR = rules -RULE_FILES = rules.md tiles.md ai.md -DE_RULES = $(addprefix $(RULES_DIR)/de/,$(RULE_FILES)) -EN_RULES = $(addprefix $(RULES_DIR)/en/,$(RULE_FILES)) -RULES = $(DE_RULES) $(EN_RULES) -RULES_HTML = $(addprefix $(BUILDDIR)/,$(RULES:.md=.html)) +HTML_ROOT := $(MAKEFILE_DIR) +GAME_ROOT := $(MAKEFILE_DIR)/../ +RULES_ROOT := $(GAME_ROOT)/rules +MAPS_ROOT := $(GAME_ROOT)/maps +DATA_ROOT := $(GAME_ROOT)/data +CARDS_YML_DIR := $(DATA_ROOT)/cards +LATEX_ROOT := $(GAME_ROOT)/latex +CARDS_PDF_DIR := $(LATEX_ROOT)/build -MAPS_DIR = ../maps +GENERATE_CARD := $(GAME_ROOT)scripts/generate_card.py +GENERATE_CARD_ARGS := --format markdown -SITES = index.md rules.md cards.md maps.md -HTML = $(addprefix $(BUILDDIR)/,$(SITES:.md=.html)) +SETS := $(shell find $(CARDS_YML_DIR) -mindepth 1 -type d -printf "%f\n") +SETS_SOURCEDIRS := $(foreach set, $(SETS), $(addprefix $(CARDS_YML_DIR)/, $(set))) + +BUILDDIR := $(MAKEFILE_DIR)/build + +RULE_FILES := rules.md tiles.md ai.md +DE_RULES := $(addprefix $(RULES_ROOT)/de/,$(RULE_FILES)) +EN_RULES := $(addprefix $(RULES_ROOT)/en/,$(RULE_FILES)) +RULES := $(DE_RULES) $(EN_RULES) +RULES_HTML := $(addprefix $(BUILDDIR)/,$(RULES:.md=.html)) + +SITES := index.md rules.md cards.md maps.md +HTML := $(addprefix $(BUILDDIR)/,$(SITES:.md=.html)) + +# Create a list of yaml card definitions +CARDS_YAML := $(foreach dir,$(SETS_SOURCEDIRS),$(wildcard $(dir)/*.yml)) + +MAKEFILE_LIST := Makefile .PHONY: all clean maps all: $(HTML) $(RULES_HTML) maps @@ -23,12 +45,27 @@ clean: rm -rf $(BUILDDIR) maps: - ln -sf ../$(MAPS_DIR) $(BUILDDIR)/maps - make -C $(MAPS_DIR) + @echo "building $@" + $(VERBOSE) ln -sf $(MAPS_ROOT) $(BUILDDIR)/maps + $(VERBOSE) make -C $(MAPS_ROOT) -$(BUILDDIR)/%.html: %.md +$(BUILDDIR)/%.html: %.md $(MAKEFILE_LIST) @echo "building $@" @if test \( ! \( -d $(@D) \) \) ;then mkdir -p $(@D);fi $(VERBOSE) if [[ $$(cat $< | wc -l) -gt 80 ]]; \ then pandoc --toc $(PANDOC_FLAGS) $< -o $@; \ else pandoc $(PANDOC_FLAGS) $< -o $@; fi + +cards.md: $(CARDS_YAML) $(GENERATE_CARD) $(MAKEFILE_LIST) + @echo "render cards $@" + $(VERBOSE) ln -sf $(CARDS_PDF_DIR) $(BUILDDIR)/cards + $(VERBOSE) make -C $(LATEX_ROOT) + @echo "building $@" + $(VERBOSE) echo -e "% Cards" > $@ + $(VERBOSE) for set in $(SETS); \ + do echo -e "\n##" $$set >> $@; \ + for card in $(CARDS_YML_DIR)/$$set/*.yml; \ + do echo "" >> $@; \ + $(GENERATE_CARD) $(GENERATE_CARD_ARGS) $$card >> $@; \ + done; \ + done diff --git a/html/cards.md b/html/cards.md index ac292b48..1c6c90ab 100644 --- a/html/cards.md +++ b/html/cards.md @@ -1,3 +1,726 @@ % Cards -There are cards somewhere I promise +## misc + +### Farmer + +[pdf](cards/misc/farmer.pdf) [png](cards/misc/farmer.png) + +* **Type**: unit +* **Upkeep**: 1 +* **Health**: 1 +* **Movement**: 1 +* **Attack**: 1 + +### King + +[pdf](cards/misc/king.pdf) [png](cards/misc/king.png) + +* **Type**: unit +* **Token**: True +* **Upkeep**: 0 +* **Health**: 5 +* **Movement**: 1 +* **Attack**: 1 +* **Effect**: 5 Resource: +shroud until end of turn. \ Protection from Die! + +### Stick of Victory + +[pdf](cards/misc/stick_of_victory.pdf) [png](cards/misc/stick_of_victory.png) + +* **Type**: equipment +* **Token**: True +* **Effect**: The controller of the equipped unit increases its victory count by 1 in their upkeep + +## equipments + +### Armor + +[pdf](cards/equipments/armor.pdf) [png](cards/equipments/armor.png) + +* **Type**: equipment +* **Buy**: 7 +* **Play**: 2 +* **Effect**: Equipped unit gains + 1 Armor + +### Banner + +[pdf](cards/equipments/banner.pdf) [png](cards/equipments/banner.png) + +* **Type**: artifact +* **Buy**: 2 +* **Play**: 7 +* **Effect**: Units you control in range 1 gain +1 attack damage and +1 movement + +### Cloak + +[pdf](cards/equipments/cloak.pdf) [png](cards/equipments/cloak.png) + +* **Type**: equipment +* **Buy**: 3 +* **Play**: 7 +* **Effect**: Equipped unit gains shroud (can't be targeted) + +### Gear + +[pdf](cards/equipments/gear.pdf) [png](cards/equipments/gear.png) + +* **Type**: equipment +* **Buy**: 2 +* **Play**: 3 +* **Effect**: Equipped unit gain +1 movement + +### Mace + +[pdf](cards/equipments/mace.pdf) [png](cards/equipments/mace.png) + +* **Type**: equipment +* **Buy**: 2 +* **Play**: 6 +* **Effect**: Equipped unit afflicts Paralysis when dealing damage in melee combat + +### Plate Armor + +[pdf](cards/equipments/plate_armor.pdf) [png](cards/equipments/plate_armor.png) + +* **Type**: equipment +* **Buy**: 8 +* **Play**: 3 +* **Effect**: Equipped unit has +2 Armor and -2 Movement + +### Poisoned Dagger + +[pdf](cards/equipments/poisoned_dagger.pdf) [png](cards/equipments/poisoned_dagger.png) + +* **Type**: equipment +* **Buy**: 3 +* **Play**: 7 +* **Effect**: Equipped unit deals damage as poison counters in melee combat + +### Reclaim! + +[pdf](cards/equipments/reclaim!.pdf) [png](cards/equipments/reclaim!.png) + +* **Type**: spell +* **Buy**: 5 +* **Play**: X +* **Effect**: Teleport target Artifact you own with Playcost X to a free spawn tile of yours. + +### Relic + +[pdf](cards/equipments/relic.pdf) [png](cards/equipments/relic.png) + +* **Type**: artifact +* **Buy**: 3 +* **Play**: 7 +* **Effect**: In your upkeep the player controlling the most units in range 1 gains 1 resource. On ties all tied players gain 1 resource. + +### Shatter! + +[pdf](cards/equipments/shatter!.pdf) [png](cards/equipments/shatter!.png) + +* **Type**: spell +* **Buy**: 5 +* **Play**: X +* **Effect**: Destroy target artifact with buy = X + +### Smith + +[pdf](cards/equipments/smith.pdf) [png](cards/equipments/smith.png) + +* **Type**: unit +* **Buy**: 10 +* **Upkeep**: 2 +* **Health**: 1 +* **Movement**: 2 +* **Full Action**: Pay X: Create Copy of artifact with buy cost X in Range 1 on empty tile in Range 1 + +### Spear + +[pdf](cards/equipments/spear.pdf) [png](cards/equipments/spear.png) + +* **Type**: equipment +* **Buy**: 2 +* **Play**: 7 +* **Effect**: Equipped unit gains +1 Attack and Range 2 against unit with Movement >= 3 + +## nautics + +### Barge + +[pdf](cards/nautics/barge.pdf) [png](cards/nautics/barge.png) + +* **Type**: unit +* **Buy**: 5 +* **Upkeep**: 1 +* **Health**: 3 +* **Movement**: 3 swimming +* **Effect**: Crew 6 + +### Captain + +[pdf](cards/nautics/captain.pdf) [png](cards/nautics/captain.png) + +* **Type**: unit +* **Buy**: 7 +* **Upkeep**: 2 +* **Health**: 1 +* **Movement**: 1 +* **Attack**: 1 +* **Effect**: Other units in the same pile have no upkeep cost + +### Fisher + +[pdf](cards/nautics/fisher.pdf) [png](cards/nautics/fisher.png) + +* **Type**: unit +* **Buy**: 5 +* **Upkeep**: 1 +* **Health**: 2 +* **Movement**: 2 swimming +* **Full Action**: Create fish trap token on adjacent water tile +* **Effect**: Crew 2 + +### Fish Trap + +[pdf](cards/nautics/fish_trap.pdf) [png](cards/nautics/fish_trap.png) + +* **Type**: artifact +* **Token**: True +* **Effect**: Adjacent Fisher have "full action: Gain 2 Resource" + +### Galley + +[pdf](cards/nautics/galley.pdf) [png](cards/nautics/galley.png) + +* **Type**: unit +* **Buy**: 7 +* **Upkeep**: 1 +* **Health**: 4 +* **Movement**: 3 swimming +* **Attack**: 1 range 2 +* **Effect**: Crew 3 + +### Sailor + +[pdf](cards/nautics/sailor.pdf) [png](cards/nautics/sailor.png) + +* **Type**: unit +* **Upkeep**: 1 +* **Health**: 1 +* **Movement**: 1 +* **Attack**: 1 +* **Effect**: A crewed unit gets +1 movement while swimming + +## kraken + +### Angry Squid + +[pdf](cards/kraken/angry_squid.pdf) [png](cards/kraken/angry_squid.png) + +* **Type**: unit +* **Buy**: 7 +* **Upkeep**: 2 +* **AI**: Aggressive +* **Health**: 1 +* **Movement**: 2 swimming +* **Attack**: 1 Range 2 + +### Chachalot + +[pdf](cards/kraken/chachalot.pdf) [png](cards/kraken/chachalot.png) + +* **Type**: unit +* **Buy**: 10 +* **Upkeep**: 2 +* **AI**: Wandering +* **Health**: 2 +* **Movement**: 2 swimming +* **Attack**: 2 +* **Effect**: + 1 Armor + +### Clownfish + +[pdf](cards/kraken/clownfish.pdf) [png](cards/kraken/clownfish.png) + +* **Type**: unit +* **Buy**: 10 +* **Upkeep**: 2 +* **AI**: Shy +* **Health**: 1 +* **Movement**: 2 swimming +* **Full Action**: Get 4 additional Ressource + +### Dolphin + +[pdf](cards/kraken/dolphin.pdf) [png](cards/kraken/dolphin.png) + +* **Type**: unit +* **Buy**: 7 +* **Upkeep**: 1 +* **AI**: Supportive +* **Health**: 2 +* **Movement**: 2 +* **Full Action**: Give random Unit in range 1 random buff + +### Frost Pylon + +[pdf](cards/kraken/frost_pylon.pdf) [png](cards/kraken/frost_pylon.png) + +* **Type**: artifact +* **Buy**: 5 +* **Effect**: Enemy units in range 1 can't activate abilities except "full action: put a crack counter on Frost Pylon". If there are three or more crack counter on Frost Pylon destroy it. Frost Pylon can be played next to a random enemy unit + +### Gigantic Hail + +[pdf](cards/kraken/gigantic_hail.pdf) [png](cards/kraken/gigantic_hail.png) + +* **Type**: spell +* **Play**: 3 +* **Effect**: Place an Ice Berg token on a random empty tile + +### Ice Berg + +[pdf](cards/kraken/ice_berg.pdf) [png](cards/kraken/ice_berg.png) + +* **Type**: artifact +* **Token**: True +* **Effect**: Solid 3 + +### Sailfish + +[pdf](cards/kraken/sailfish.pdf) [png](cards/kraken/sailfish.png) + +* **Type**: unit +* **Buy**: 7 +* **Upkeep**: 1 +* **AI**: Aggressive +* **Health**: 1 +* **Movement**: 3 +* **Attack**: 1 + +### Suprise + +[pdf](cards/kraken/suprise.pdf) [png](cards/kraken/suprise.png) + +* **Type**: spell +* **Play**: 1 +* **Effect**: Place the next Unit played this turn next to a random enemy Unit + +### Tentacle Slap + +[pdf](cards/kraken/tentacle_slap.pdf) [png](cards/kraken/tentacle_slap.png) + +* **Type**: spell +* **Play**: 3 +* **Effect**: Each player discards their hand + +### The Kraken + +[pdf](cards/kraken/the_kraken.pdf) [png](cards/kraken/the_kraken.png) + +* **Type**: unit +* **Health**: 5 +* **Attack**: 1 + +### Tides Change + +[pdf](cards/kraken/tides_change.pdf) [png](cards/kraken/tides_change.png) + +* **Type**: spell +* **Play**: 5 +* **Effect**: Redistribute all store cards + +### Unholy Cannonball + +[pdf](cards/kraken/unholy_cannonball.pdf) [png](cards/kraken/unholy_cannonball.png) + +* **Type**: spell +* **Play**: 5 +* **Effect**: If no enemy Units are in range 2 of The Kraken gain 5 ressource and draw a card. Otherwise put a fear counter on all enemy Units in range 2 of The Kraken + +## base + +### Advisor + +[pdf](cards/base/advisor.pdf) [png](cards/base/advisor.png) + +* **Type**: unit +* **Buy**: 10 +* **Upkeep**: 2 +* **Health**: 1 +* **Movement**: 2 +* **Full Action**: Draw 1 card. You may exile 1 card from your hand + +### Archer + +[pdf](cards/base/archer.pdf) [png](cards/base/archer.png) + +* **Type**: unit +* **Buy**: 5 +* **Upkeep**: 1 +* **Health**: 2 +* **Movement**: 2 +* **Attack**: 1 Range 2 + +### Cavalry Archer + +[pdf](cards/base/cavalry_archer.pdf) [png](cards/base/cavalry_archer.png) + +* **Type**: unit +* **Buy**: 10 +* **Upkeep**: 2 +* **Health**: 1 +* **Movement**: 3 +* **Attack**: 1 Range 2 + +### Cavalry + +[pdf](cards/base/cavalry.pdf) [png](cards/base/cavalry.png) + +* **Type**: unit +* **Buy**: 5 +* **Upkeep**: 2 +* **Health**: 1 +* **Movement**: 3 +* **Attack**: 2 + +### Fighter + +[pdf](cards/base/fighter.pdf) [png](cards/base/fighter.png) + +* **Type**: unit +* **Buy**: 7 +* **Upkeep**: 1 +* **Health**: 2 +* **Movement**: 2 +* **Attack**: 1 +* **Effect**: One additional attack action + +### Great Sword + +[pdf](cards/base/great_sword.pdf) [png](cards/base/great_sword.png) + +* **Type**: equipment +* **Buy**: 10 +* **Play**: 4 +* **Effect**: Equipped unit gains +2 Melee Damage + +### Knight + +[pdf](cards/base/knight.pdf) [png](cards/base/knight.png) + +* **Type**: unit +* **Buy**: 7 +* **Upkeep**: 2 +* **Health**: 2 +* **Movement**: 2 +* **Attack**: 2 +* **Effect**: + 1 Armor + +### Misinformation + +[pdf](cards/base/misinformation.pdf) [png](cards/base/misinformation.png) + +* **Type**: spell +* **Token**: True +* **Play**: 5 +* **Effect**: Exile this card + +### Missionary + +[pdf](cards/base/missionary.pdf) [png](cards/base/missionary.png) + +* **Type**: unit +* **Buy**: 10 +* **Upkeep**: 2 +* **Health**: 1 +* **Movement**: 2 +* **Full Action**: Put two faith counters on target Unit. If there are more faith counters than the units buying cost you control target unit + +### Palisade + +[pdf](cards/base/palisade.pdf) [png](cards/base/palisade.png) + +* **Type**: artifact +* **Buy**: 7 +* **Play**: 3 +* **Effect**: Solid 6 + +### Pikeman + +[pdf](cards/base/pikeman.pdf) [png](cards/base/pikeman.png) + +* **Type**: unit +* **Buy**: 5 +* **Upkeep**: 1 +* **Health**: 2 +* **Movement**: 1 +* **Attack**: 1 +* **Effect**: Range 2 against Units with Movement >= 3 + +### Pioneer + +[pdf](cards/base/pioneer.pdf) [png](cards/base/pioneer.png) + +* **Type**: unit +* **Buy**: 7 +* **Upkeep**: 1 +* **Health**: 5 +* **Movement**: 2 +* **Full Action**: Neutralize adjacent tile or Artifact + +### Recruiter + +[pdf](cards/base/recruiter.pdf) [png](cards/base/recruiter.png) + +* **Type**: unit +* **Buy**: 10 +* **Upkeep**: 1 +* **Health**: 2 +* **Movement**: 2 +* **Attack**: 1 +* **Full Action**: Create Recruit token on adjacent tile +* **Effect**: Allow Units to be played in Range 1 + +### Recruit + +[pdf](cards/base/recruit.pdf) [png](cards/base/recruit.png) + +* **Type**: unit +* **Token**: True +* **Upkeep**: 0 +* **Health**: 1 +* **Movement**: 1 +* **Attack**: 1 + +### Shield + +[pdf](cards/base/shield.pdf) [png](cards/base/shield.png) + +* **Type**: equipment +* **Buy**: 5 +* **Play**: 1 +* **Effect**: Equipped unit gains +1 Health + +### Sword + +[pdf](cards/base/sword.pdf) [png](cards/base/sword.png) + +* **Type**: equipment +* **Buy**: 5 +* **Play**: 2 +* **Effect**: Equipped unit gains +1 Melee Damage + +### Tax Collector + +[pdf](cards/base/tax_collector.pdf) [png](cards/base/tax_collector.png) + +* **Type**: unit +* **Buy**: 5 +* **Upkeep**: 1 +* **Health**: 1 +* **Movement**: 2 +* **Full Action**: Get 2 additional Ressource + +### Tower Shield + +[pdf](cards/base/tower_shield.pdf) [png](cards/base/tower_shield.png) + +* **Type**: equipment +* **Buy**: 7 +* **Play**: 2 +* **Effect**: Equipped unit has +2 Health + +### Wormtongue + +[pdf](cards/base/wormtongue.pdf) [png](cards/base/wormtongue.png) + +* **Type**: unit +* **Buy**: 10 +* **Upkeep**: 2 +* **Health**: 1 +* **Movement**: 2 +* **Full Action**: Pay 3: Add a Misinformation token to an opponents pile + +## magic + +### Action! + +[pdf](cards/magic/action!.pdf) [png](cards/magic/action!.png) + +* **Type**: spell +* **Buy**: 5 +* **Play**: 2 +* **Effect**: Move or attack with one unit + +### Appear! + +[pdf](cards/magic/appear!.pdf) [png](cards/magic/appear!.png) + +* **Type**: spell +* **Buy**: 7 +* **Play**: 3X +* **Effect**: Play one unit costing X on any free tile + +### Attack! + +[pdf](cards/magic/attack!.pdf) [png](cards/magic/attack!.png) + +* **Type**: spell +* **Buy**: 5 +* **Play**: 2 +* **Effect**: Distribute 2 times "+1 Attack this turn" on up to two units + +### catalyst + +[pdf](cards/magic/catalyst.pdf) [png](cards/magic/catalyst.png) + +* **Type**: artifact +* **Buy**: 3 +* **Play**: 5 +* **Effect**: Spells any player controlling the most units in range 1 playes cost one less resource + +### Clone! + +[pdf](cards/magic/clone!.pdf) [png](cards/magic/clone!.png) + +* **Type**: spell +* **Buy**: 7 +* **Play**: 3 +* **Effect**: Copy the next card you play. You may choose new targets. If you copy a permanent place a token copy of the parmanent in range 1 of the original + +### Defense! + +[pdf](cards/magic/defense!.pdf) [png](cards/magic/defense!.png) + +* **Type**: spell +* **Buy**: 5 +* **Play**: 3 +* **Effect**: Two units gain +1 Armor until end of turn + +### Die! + +[pdf](cards/magic/die!.pdf) [png](cards/magic/die!.png) + +* **Type**: spell +* **Buy**: 10 +* **Play**: 6 +* **Effect**: Destroy target Unit + +### Heal! + +[pdf](cards/magic/heal!.pdf) [png](cards/magic/heal!.png) + +* **Type**: spell +* **Buy**: 5 +* **Play**: 2 +* **Effect**: Target unit gains 1 Health or remove all Poison counters from it + +### Isolate! + +[pdf](cards/magic/isolate!.pdf) [png](cards/magic/isolate!.png) + +* **Type**: spell +* **Buy**: 5 +* **Play**: 2 +* **Effect**: Target unit can not receive or deal damage this turn + +### Mine! + +[pdf](cards/magic/mine!.pdf) [png](cards/magic/mine!.png) + +* **Type**: spell +* **Buy**: 5 +* **Play**: 2 +* **Effect**: Steal 2 resource from opponent + +### More! + +[pdf](cards/magic/more!.pdf) [png](cards/magic/more!.png) + +* **Type**: spell +* **Buy**: 5 +* **Play**: 2 +* **Effect**: Draw two cards + +### No! + +[pdf](cards/magic/no!.pdf) [png](cards/magic/no!.png) + +* **Type**: spell +* **Buy**: 5 +* **Play**: 2 +* **Effect**: Counter target spell + +### Pierce! + +[pdf](cards/magic/pierce!.pdf) [png](cards/magic/pierce!.png) + +* **Type**: spell +* **Buy**: 5 +* **Play**: 1X +* **Effect**: Ignore X Armor of target unit this turn + +### Ritual! + +[pdf](cards/magic/ritual!.pdf) [png](cards/magic/ritual!.png) + +* **Type**: spell +* **Buy**: 7 +* **Play**: 1 +* **Effect**: Gain 3 Ressource + +### Rush! + +[pdf](cards/magic/rush!.pdf) [png](cards/magic/rush!.png) + +* **Type**: spell +* **Buy**: 5 +* **Play**: 2 +* **Effect**: Distribute 2 times "+ 2 Movement this turn" on up to two units + +### Select! + +[pdf](cards/magic/select!.pdf) [png](cards/magic/select!.png) + +* **Type**: spell +* **Buy**: 7 +* **Play**: 1 +* **Effect**: Draw 1. You may exile a card from your hand + +### Shroud! + +[pdf](cards/magic/shroud!.pdf) [png](cards/magic/shroud!.png) + +* **Type**: spell +* **Buy**: 5 +* **Play**: 2 +* **Effect**: Target unit can not be targeted this turn + +### Stumble! + +[pdf](cards/magic/stumble!.pdf) [png](cards/magic/stumble!.png) + +* **Type**: spell +* **Buy**: 5 +* **Play**: 2 +* **Effect**: Target unit can not move or attack this turn + +### Switch! + +[pdf](cards/magic/switch!.pdf) [png](cards/magic/switch!.png) + +* **Type**: spell +* **Buy**: 5 +* **Play**: 2 +* **Effect**: Switch the positions of two permanents you control + +### Transmute! + +[pdf](cards/magic/transmute!.pdf) [png](cards/magic/transmute!.png) + +* **Type**: spell +* **Buy**: 5 +* **Play**: 5 +* **Effect**: Put one card from your store into your hand. Exile this card diff --git a/scripts/generate_card.py b/scripts/generate_card.py index c11c039b..9d5ac7c7 100755 --- a/scripts/generate_card.py +++ b/scripts/generate_card.py @@ -29,9 +29,9 @@ LATEX_ROOT = pathlib.Path(os.getcwd()) ASSETS_DIR = LATEX_ROOT / '../assets' CARDS_DIR = LATEX_ROOT / 'cards' -def file_for_card(card_name: str) -> pathlib.Path: +def file_for_card(card_name: str, suffix = '.tex') -> pathlib.Path: """Return the corresponding latex file name for a card""" - return pathlib.Path(f'{card_name.lower().replace(" ", "_")}.tex') + return pathlib.Path(f'{card_name.lower().replace(" ", "_")}{suffix}') def get_latex_field(card: MutableMapping, field: str) -> str: """Return the latex_ prefixed field from card or the field itself""" @@ -41,7 +41,22 @@ def get_latex_field(card: MutableMapping, field: str) -> str: else: return card[field] -def generate_card(card: MutableMapping): +def generate_markdown(card: MutableMapping, indentation=3): + """Output a markdown enumeration""" + + formatted_keys = {'ai': 'AI', 'full_action': 'Full Action'} + + print(f'{"#" * indentation} {card["name"]}') + + built_card_path = f'cards/{card["set"]}/{file_for_card(card["name"], "")}' + print(f'\n[pdf]({built_card_path}.pdf) [png]({built_card_path}.png)\n') + + for key in ['type', 'token', 'buy', 'upkeep', 'play', 'ai', 'health', 'movement', 'attack', 'full_action', 'effect']: + if key in card: + formatted_key = formatted_keys.get(key, key.capitalize()) + print(f'* **{formatted_key}**: {card[key]}') + +def generate_latex(card: MutableMapping): """Generate a standalone tikz picture with the card data""" card_content = "" @@ -133,6 +148,7 @@ def main(): parser = argparse.ArgumentParser(description='generate latex standalone cards') parser.add_argument('data', help='yaml file or directory containing yaml files defining the cards to generate') parser.add_argument('--latex-root', help='path to the latex root directory') + parser.add_argument('--format', choices=['latex', 'markdown'], default='latex', help='output format') args = parser.parse_args() @@ -158,7 +174,10 @@ def main(): card = yaml.full_load(yaml_file) card['set'] = card_set - generate_card(card) + if args.format == 'latex': + generate_latex(card) + elif args.format == 'markdown': + generate_markdown(card) if __name__ == '__main__': |
