1
0
Fork
You've already forked CardCreationForTheKeeper
0
Card Creation helper for the game https://github.com/kotc-game/kotc
  • Python 100%
2022年01月08日 00:48:05 +01:00
ccftk define __str__ for Component, Effect, Ability 2022年01月04日 03:00:02 +01:00
data component : 0 + typo 2022年01月08日 00:48:05 +01:00
sets delete bugs.txt (cf kotc issue#9) 2022年01月04日 02:53:32 +01:00
.gitignore structure 2021年12月26日 13:16:31 +01:00
example.py sets 2021年12月28日 21:44:05 +01:00
LICENSE Initial commit 2021年09月30日 23:48:30 +02:00
README.md update readme : example 2021年12月31日 00:56:33 +01:00
unit_test.py fix target 1 and effect 0 2022年01月04日 02:12:45 +01:00

CardCreationForTheKeeper

Card Creation helper for the game https://github.com/kotc-game/kotc. It consists in a card referencing system and the python package ccftk that uses it to generate cards' cost and text.

Referencing system

The components' (i.e. caveats, activation conditions and costs, target selections and effects) references are listed in the file data/componentHistory.md. An ability's reference is

(activation condition)-(activation cost)-(target selection)-(effect 1)-(effect 2)-...

A spell card's reference is

S/(ability)

A creature's reference is

C.(offense).(defense)-(caveat)/(ability 1)/(ability 2)/...

ccftk package

First thing to do after importing the package is creating a database object from data files, for example the ones in the data/ folder

import ccftk
dbEN=ccftk.DataBase("data/DataMapEN.json")

This database object has a refBareCard method that allows to generate the text and cost of a card from its reference, as well as a refAbility method that does that for a single ability. For example, characteristics of the (10th edition version of the) "Anubis" card are printed via

print(dbEN.refBareCard('C.5.25-6.3/18.1-0-5.2-32.2/0-0-3.1.2-10'))

Combination with appropriate decoding packages can be used to generate the card texts for sets, as illustrated in the example.py file.

Future directions

  • add documentation
  • finish French translation
  • replace eval with an arithmetic parser
  • convert to command line tool
  • make version checker who replaces components with their revisions
  • make svg card templates and convert to "bare card" creator