Many assets smoothly working
This commit is contained in:
parent
95c6bde677
commit
d28e1b855f
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -14,3 +14,5 @@ Python-Fu
|
|||
Makefile.deps
|
||||
generated/**
|
||||
!images/**
|
||||
|
||||
.ninja_log
|
||||
|
|
2347
.ninja_log
2347
.ninja_log
File diff suppressed because it is too large
Load diff
|
@ -9,10 +9,13 @@ package iditacards
|
|||
// e.g. -set option:distort:viewport 825x1125-37-37 -virtual-pixel Edge -distort SRT 0 +repage
|
||||
print?: string
|
||||
|
||||
// temporarily removed, hoping that scantex.sh can handle it
|
||||
if false {
|
||||
depends: {
|
||||
assets: [...string]
|
||||
files: [...string]
|
||||
}
|
||||
}
|
||||
|
||||
kind: #AssetKind
|
||||
|
||||
|
|
15
assets.yaml
15
assets.yaml
|
@ -1,8 +1,15 @@
|
|||
# The "other" assets
|
||||
# TODO: with e.g. the iditaboard, check the differences with master branch, make
|
||||
# sure "simplified" and "master" versions can both use assets without much issue
|
||||
assets:
|
||||
logo:
|
||||
kind: image
|
||||
source: iditacards.png
|
||||
|
||||
# images:
|
||||
cardback:
|
||||
kind: image
|
||||
source: cardback.png
|
||||
|
||||
iditaboard:
|
||||
kind: tex
|
||||
source: iditaboard.tex
|
||||
size: 4875x3075
|
||||
|
||||
# documents:
|
||||
|
|
24
build.ninja
24
build.ninja
|
@ -8,12 +8,14 @@ rule configure
|
|||
generator = 1
|
||||
restat = 1
|
||||
|
||||
build build.ninja: configure | configure.jq configure.sh assets.cue cards.cue others.cue types.cue assets.yaml cards.yaml
|
||||
build build.ninja: configure | configure.jq configure.sh assets.cue cards.cue legs.cue others.cue types.cue assets.yaml cards.yaml legs.yaml
|
||||
include rules.ninja
|
||||
|
||||
build output/everything.json: cuegen assets.cue cards.cue others.cue types.cue assets.yaml cards.yaml
|
||||
build output/everything.json: cuegen assets.cue cards.cue legs.cue others.cue types.cue assets.yaml cards.yaml legs.yaml
|
||||
filter = .
|
||||
|
||||
build output/logo.png: copy iditacards.png
|
||||
build output/cardback.png: copy cardback.png
|
||||
build output/starter1-a_hat[1].json: extract output/everything.json
|
||||
filter = --arg asset 'starter1-a_hat[1]' '.assets[$$asset].data'
|
||||
build output/starter1-a_hat[1].tex: template2tex output/starter1-a_hat[1].json | templates/card.tex
|
||||
|
@ -998,3 +1000,21 @@ build output/survival-venison[2].raw.png: pdf2png output/survival-venison[2].pdf
|
|||
h = 1050
|
||||
build output/survival-venison[2].png: convert output/survival-venison[2].raw.png
|
||||
args = -set option:distort:viewport 825x1125-37-37 -virtual-pixel Edge -distort SRT 0 +repage
|
||||
build output/iditaboard.pdf: tex2pdf iditaboard.tex || output/iditaboard.pdf.dd
|
||||
dyndep = output/iditaboard.pdf.dd
|
||||
build output/iditaboard.pdf.dd: scantex iditaboard.tex
|
||||
build output/iditaboard.png: pdf2png output/iditaboard.pdf
|
||||
w = 4875
|
||||
h = 3075
|
||||
build output/farm[1].json: extract output/everything.json
|
||||
filter = --arg asset 'farm[1]' '.assets[$$asset].data'
|
||||
build output/farm[1].tex: template2tex output/farm[1].json | templates/leg.tex
|
||||
template = templates/leg.tex
|
||||
build output/farm[1].pdf: tex2pdf output/farm[1].tex || output/farm[1].pdf.dd
|
||||
dyndep = output/farm[1].pdf.dd
|
||||
build output/farm[1].pdf.dd: scantex output/farm[1].tex
|
||||
build output/farm[1].raw.png: pdf2png output/farm[1].pdf
|
||||
w = 750
|
||||
h = 1050
|
||||
build output/farm[1].png: convert output/farm[1].raw.png
|
||||
args = -set option:distort:viewport 825x1125-37-37 -virtual-pixel Edge -distort SRT 0 +repage
|
||||
|
|
11
cards.cue
11
cards.cue
|
@ -43,15 +43,6 @@ assets: {
|
|||
"\(deckname)-\(cardname)[\(freq.count)]": {
|
||||
size: "750x1050"
|
||||
print: "-set option:distort:viewport 825x1125-37-37 -virtual-pixel Edge -distort SRT 0 +repage"
|
||||
depends: {
|
||||
assets: [
|
||||
"deck/\(deckname)",
|
||||
"card/\(card.image)",
|
||||
]
|
||||
files: [
|
||||
"iditacard.cls",
|
||||
]
|
||||
}
|
||||
|
||||
kind: "template"
|
||||
template: "card.tex"
|
||||
|
@ -62,6 +53,7 @@ assets: {
|
|||
}
|
||||
}
|
||||
|
||||
if false {
|
||||
for deckname, deck in decks
|
||||
for cardname, freq in deck
|
||||
let card = cards[cardname] {
|
||||
|
@ -70,6 +62,7 @@ assets: {
|
|||
source: "images/card/\(cardname).png"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pseudoassets: {
|
||||
|
|
320
cards.sql
320
cards.sql
|
@ -1,320 +0,0 @@
|
|||
PRAGMA foreign_keys=OFF;
|
||||
BEGIN TRANSACTION;
|
||||
CREATE TABLE Types (id INTEGER PRIMARY KEY, Name TEXT);
|
||||
INSERT INTO Types VALUES(1,'attachment');
|
||||
INSERT INTO Types VALUES(2,'dog');
|
||||
INSERT INTO Types VALUES(3,'food');
|
||||
INSERT INTO Types VALUES(4,'movement');
|
||||
INSERT INTO Types VALUES(5,'personal');
|
||||
INSERT INTO Types VALUES(6,'sled');
|
||||
INSERT INTO Types VALUES(7,'utility');
|
||||
INSERT INTO Types VALUES(8,'damage');
|
||||
|
||||
CREATE TABLE Decks (id INTEGER PRIMARY KEY, Name TEXT);
|
||||
INSERT INTO Decks VALUES(1,'starter1');
|
||||
INSERT INTO Decks VALUES(2,'starter2');
|
||||
INSERT INTO Decks VALUES(3,'starter3');
|
||||
INSERT INTO Decks VALUES(4,'starter4');
|
||||
INSERT INTO Decks VALUES(10,'survival');
|
||||
INSERT INTO Decks VALUES(11,'race');
|
||||
INSERT INTO Decks VALUES(20,'legendary');
|
||||
INSERT INTO Decks VALUES(21,'damage');
|
||||
|
||||
CREATE TABLE Rarities (id INTEGER PRIMARY KEY, Name TEXT);
|
||||
INSERT INTO Rarities VALUES(1,'starting');
|
||||
INSERT INTO Rarities VALUES(2,'common');
|
||||
INSERT INTO Rarities VALUES(3,'rare');
|
||||
INSERT INTO Rarities VALUES(4,'epic');
|
||||
INSERT INTO Rarities VALUES(5,'legendary');
|
||||
|
||||
CREATE TABLE Effects (id INTEGER PRIMARY KEY, Name TEXT, Command TEXT);
|
||||
INSERT INTO Effects VALUES(1,'Day Draw','\daydraw{#}');
|
||||
INSERT INTO Effects VALUES(2,'Draw','\draw{#}');
|
||||
INSERT INTO Effects VALUES(3,'Supply','\supply{#}');
|
||||
INSERT INTO Effects VALUES(4,'Take','\take{#}');
|
||||
INSERT INTO Effects VALUES(5,'See','\see{#}');
|
||||
INSERT INTO Effects VALUES(6,'Destroy','\destroy{#}');
|
||||
INSERT INTO Effects VALUES(7,'Speed','\speed{#}');
|
||||
INSERT INTO Effects VALUES(8,'Move','\move{#}');
|
||||
INSERT INTO Effects VALUES(10,'Discarded when killed','\discardonkill');
|
||||
INSERT INTO Effects VALUES(11,'Play when the game starts','\inplayatstart');
|
||||
INSERT INTO Effects VALUES(12,'Cannot Die','\immortal');
|
||||
INSERT INTO Effects VALUES(13,'Passing does not incur damage','\safepass');
|
||||
INSERT INTO Effects VALUES(14,'Dies when passing','\passdie');
|
||||
INSERT INTO Effects VALUES(15,'Speed Times','\speed{$\times #$}');
|
||||
INSERT INTO Effects VALUES(16,'Cannot hold attachments','\nohold');
|
||||
INSERT INTO Effects VALUES(17,'Remove your starvation','\nostarvation');
|
||||
INSERT INTO Effects VALUES(18,'Remove your hypothermia','\nohypothermia');
|
||||
INSERT INTO Effects VALUES(19,'Take damage','\damage{#}');
|
||||
INSERT INTO Effects VALUES(20,'Double the final distance','\doubledistance');
|
||||
INSERT INTO Effects VALUES(21,'Damage Effect','\damagetext');
|
||||
INSERT INTO Effects VALUES(22,'Counts as 2 dogs.','\istwodogs');
|
||||
INSERT INTO Effects VALUES(23,'Your other dogs have +1 speed','\otherdogshave{\speed{1}}');
|
||||
|
||||
CREATE TABLE Cards (id INTEGER PRIMARY KEY, Name TEXT, Energy TEXT, Health TEXT, Risk TEXT, Flavour TEXT, Image TEXT, Typename INTEGER REFERENCES Types (id));
|
||||
INSERT INTO Cards VALUES(1,'A Hat',2,2,0,'I bet its a valve hat.','hat',1);
|
||||
INSERT INTO Cards VALUES(2,'Dog Chow',1,3,0,'A hungry dog is a slow dog.','dog_chow',1);
|
||||
INSERT INTO Cards VALUES(3,'Good Dog',3,3,0,'Good boy.','good_dog',2);
|
||||
INSERT INTO Cards VALUES(4,'Husky',2,2,2,'Standard mushing fare.','husky',2);
|
||||
INSERT INTO Cards VALUES(5,'Wheel Dog',3,3,0,'The dog right in front of the sled. Strong and steady.','wheel_dog',2);
|
||||
INSERT INTO Cards VALUES(6,'Breakfast',0,3,0,'The most important meal of the day.','breakfast',3);
|
||||
INSERT INTO Cards VALUES(7,'Lunch',2,0,0,'What about second breakfast?','lunch',3);
|
||||
INSERT INTO Cards VALUES(8,'Dinner',2,2,0,'I hope you like salted fish.','dinner',3);
|
||||
INSERT INTO Cards VALUES(9,'Move',0,0,0,'Just another day.','move',4);
|
||||
INSERT INTO Cards VALUES(10,'Mush',2,2,1,'Comes from the french word `Marche''.','mush',4);
|
||||
INSERT INTO Cards VALUES(11,'First Aid',2,2,0,'Reduces swelling.','first_aid',5);
|
||||
INSERT INTO Cards VALUES(12,'Grandma Soup',1,2,1,'Cures what ails you.','grandma_soup',5);
|
||||
INSERT INTO Cards VALUES(13,'Repair Sled',1,3,0,'It doesn''t need to be pretty. It just has to work.','repair_sled',6);
|
||||
INSERT INTO Cards VALUES(14,'Upgrade Sled',2,2,0,'You have to keep your ride in top shape.','upgrade_sled',6);
|
||||
INSERT INTO Cards VALUES(20,'Buffer Pannel',2,2,0,'Did the primary buffer panel just fall off my gorram ship for no apparent reason?','buffer_panel',1);
|
||||
INSERT INTO Cards VALUES(21,'Nuclear Reactor',2,2,0,'What could go wrong?','nuclear_reactor',1);
|
||||
INSERT INTO Cards VALUES(22,'Engineer Dog',3,5,1,'Nails and Gears.','engineer_dog',2);
|
||||
INSERT INTO Cards VALUES(23,'Moose',5,0,3,'Majestic creatures. Hard to tame.','moose',2);
|
||||
INSERT INTO Cards VALUES(24,'Waffle',0,0,0,'Waffles are \textbf{delicious}.','waffles',3);
|
||||
INSERT INTO Cards VALUES(25,'Whale Meat',1,1,0,'It''s like rubber.','whale_meat',3);
|
||||
INSERT INTO Cards VALUES(26,'Hitch a Ride',1,0,0,'Probably not in the spirit of the race.','hitch_a_ride',4);
|
||||
INSERT INTO Cards VALUES(27,'Tactical Play',1,0,1,'Make the most of it.','tactical_play',4);
|
||||
INSERT INTO Cards VALUES(28,'Meditate',1,1,0,'It \textit{is} just sitting.','meditate',5);
|
||||
INSERT INTO Cards VALUES(29,'Diamorphine',1,1,1,'Highly addicting.','diamorphine',5);
|
||||
INSERT INTO Cards VALUES(30,'Desperate Times',99,0,0,'Desperate Measures hotline, how may I help you?','desperate_times',6);
|
||||
INSERT INTO Cards VALUES(31,'Lead Sled',1,1,1,'At least its not a Zeppelin.','lead_sled',6);
|
||||
INSERT INTO Cards VALUES(40,'Damaged',1,1,0,'You have been hurt.','damaged',8);
|
||||
INSERT INTO Cards VALUES(100,'Dog Shoes',2,3,0,'Dogs look cute in shoes.','dog_shoes',1);
|
||||
INSERT INTO Cards VALUES(101,'Squirrel',2,2,1,'Dogs \emph{hate} squirrels.','squirrel',1);
|
||||
INSERT INTO Cards VALUES(102,'Tiara',2,2,1,'Makes the dog feel special.','tiara',1);
|
||||
INSERT INTO Cards VALUES(103,'Bear',2,2,2,'In hindsight, not the best idea.','bear',2);
|
||||
INSERT INTO Cards VALUES(104,'Big Dog',2,2,0,'He''s not red though.','big_dog',2);
|
||||
INSERT INTO Cards VALUES(105,'Greyhound',0,0,2,'What happens when you mix the colours on a husky? You get a grey hound.','greyhound',2);
|
||||
INSERT INTO Cards VALUES(106,'Malamute',2,2,1,'A common sled hauling breed.','malamute',2);
|
||||
INSERT INTO Cards VALUES(107,'Problem Dog',1,1,1,'I swear, if you weren''t so fast.','problem_dog',2);
|
||||
INSERT INTO Cards VALUES(108,'Bison',2,0,1,'It''s very lean.','bison',3);
|
||||
INSERT INTO Cards VALUES(109,'Poutine',0,2,0,'The great Canadian carb!','poutine',3);
|
||||
INSERT INTO Cards VALUES(110,'Venison',0,2,0,'Better than breakfast.','venison',3);
|
||||
INSERT INTO Cards VALUES(111,'Steak',0,0,0,'Well aren''t you fancy.','steak',3);
|
||||
INSERT INTO Cards VALUES(112,'Jerky',1,1,0,'Watch your sodium!','jerky',3);
|
||||
INSERT INTO Cards VALUES(113,'Midnight Sun',1,1,1,'Strange things are done in the midnight sun.','midnight_sun',4);
|
||||
INSERT INTO Cards VALUES(114,'Push',1,0,0,'Not a full mush, but still putting in some effort.','push',4);
|
||||
INSERT INTO Cards VALUES(115,'Slow and Steady',0,0,0,'Maybe a bit too slow.','slow_and_steady',4);
|
||||
INSERT INTO Cards VALUES(116,'Band Aid',0,0,0,'Not much.','band_aid',5);
|
||||
INSERT INTO Cards VALUES(117,'Bandage',1,0,0,'Make sure you wrap it tight.','bandage',5);
|
||||
INSERT INTO Cards VALUES(118,'Brandy',0,0,1,'Brought by a St. Bernard.','brandy',5);
|
||||
INSERT INTO Cards VALUES(119,'Caffeine',0,2,0,'The greatest addiction ever.','caffeine',5);
|
||||
INSERT INTO Cards VALUES(120,'Improvise',0,0,0,'MacGyver of the north.','improvise',6);
|
||||
INSERT INTO Cards VALUES(121,'Makeshift Sled',1,1,0,'Rickety, but it''ll hold.','makeshift_sled',6);
|
||||
INSERT INTO Cards VALUES(122,'Salvage',1,1,0,'Take the good with the bad.','salvage',6);
|
||||
INSERT INTO Cards VALUES(123,'Antique Sled',0,5,0,'Withstood the test of time.','antique_sled',6);
|
||||
INSERT INTO Cards VALUES(124,'Rush',0,3,1,'Hurry up!','rush',6);
|
||||
INSERT INTO Cards VALUES(125,'Supply Run',0,0,0,'Not as easy as dropping by the grocery store.','supply_run',4);
|
||||
|
||||
CREATE TABLE Card_Effects (Card INTEGER REFERENCES Cards (id), Effect INTEGER REFERENCES Effects (id), Amount INTEGER);
|
||||
INSERT INTO Card_Effects VALUES(1,1,1);
|
||||
INSERT INTO Card_Effects VALUES(2,7,1);
|
||||
INSERT INTO Card_Effects VALUES(3,1,1);
|
||||
INSERT INTO Card_Effects VALUES(4,1,1);
|
||||
INSERT INTO Card_Effects VALUES(4,7,1);
|
||||
INSERT INTO Card_Effects VALUES(5,7,1);
|
||||
INSERT INTO Card_Effects VALUES(5,10,1);
|
||||
INSERT INTO Card_Effects VALUES(5,11,1);
|
||||
INSERT INTO Card_Effects VALUES(6,2,3);
|
||||
INSERT INTO Card_Effects VALUES(7,2,3);
|
||||
INSERT INTO Card_Effects VALUES(8,2,7);
|
||||
INSERT INTO Card_Effects VALUES(9,8,1);
|
||||
INSERT INTO Card_Effects VALUES(10,8,10);
|
||||
INSERT INTO Card_Effects VALUES(11,5,3);
|
||||
INSERT INTO Card_Effects VALUES(11,6,1);
|
||||
INSERT INTO Card_Effects VALUES(12,5,10);
|
||||
INSERT INTO Card_Effects VALUES(12,6,2);
|
||||
INSERT INTO Card_Effects VALUES(13,3,1);
|
||||
INSERT INTO Card_Effects VALUES(13,4,2);
|
||||
INSERT INTO Card_Effects VALUES(14,3,3);
|
||||
INSERT INTO Card_Effects VALUES(14,4,1);
|
||||
INSERT INTO Card_Effects VALUES(20,12,1);
|
||||
INSERT INTO Card_Effects VALUES(20,13,1);
|
||||
INSERT INTO Card_Effects VALUES(21,7,5);
|
||||
INSERT INTO Card_Effects VALUES(21,14,1);
|
||||
INSERT INTO Card_Effects VALUES(22,15,2);
|
||||
INSERT INTO Card_Effects VALUES(22,16,1);
|
||||
INSERT INTO Card_Effects VALUES(23,7,5);
|
||||
INSERT INTO Card_Effects VALUES(23,12,1);
|
||||
INSERT INTO Card_Effects VALUES(24,2,2);
|
||||
INSERT INTO Card_Effects VALUES(25,2,5);
|
||||
INSERT INTO Card_Effects VALUES(25,18,1);
|
||||
INSERT INTO Card_Effects VALUES(26,8,6);
|
||||
INSERT INTO Card_Effects VALUES(26,19,1);
|
||||
INSERT INTO Card_Effects VALUES(27,8,0);
|
||||
INSERT INTO Card_Effects VALUES(27,20,1);
|
||||
INSERT INTO Card_Effects VALUES(28,5,99);
|
||||
INSERT INTO Card_Effects VALUES(28,6,0);
|
||||
INSERT INTO Card_Effects VALUES(29,5,99);
|
||||
INSERT INTO Card_Effects VALUES(29,6,99);
|
||||
INSERT INTO Card_Effects VALUES(30,3,10);
|
||||
INSERT INTO Card_Effects VALUES(30,4,5);
|
||||
INSERT INTO Card_Effects VALUES(31,3,10);
|
||||
INSERT INTO Card_Effects VALUES(31,4,10);
|
||||
INSERT INTO Card_Effects VALUES(40,21,1);
|
||||
INSERT INTO Card_Effects VALUES(100,7,2);
|
||||
INSERT INTO Card_Effects VALUES(101,7,3);
|
||||
INSERT INTO Card_Effects VALUES(102,7,1);
|
||||
INSERT INTO Card_Effects VALUES(102,1,1);
|
||||
INSERT INTO Card_Effects VALUES(103,7,5);
|
||||
INSERT INTO Card_Effects VALUES(104,7,3);
|
||||
INSERT INTO Card_Effects VALUES(105,7,3);
|
||||
INSERT INTO Card_Effects VALUES(105,16,1);
|
||||
INSERT INTO Card_Effects VALUES(106,1,2);
|
||||
INSERT INTO Card_Effects VALUES(107,7,3);
|
||||
INSERT INTO Card_Effects VALUES(107,1,-1);
|
||||
INSERT INTO Card_Effects VALUES(108,2,5);
|
||||
INSERT INTO Card_Effects VALUES(109,2,1);
|
||||
INSERT INTO Card_Effects VALUES(109,18,1);
|
||||
INSERT INTO Card_Effects VALUES(110,2,3);
|
||||
INSERT INTO Card_Effects VALUES(111,2,1);
|
||||
INSERT INTO Card_Effects VALUES(112,2,3);
|
||||
INSERT INTO Card_Effects VALUES(113,8,10);
|
||||
INSERT INTO Card_Effects VALUES(114,8,5);
|
||||
INSERT INTO Card_Effects VALUES(115,8,0);
|
||||
INSERT INTO Card_Effects VALUES(115,2,1);
|
||||
INSERT INTO Card_Effects VALUES(116,5,1);
|
||||
INSERT INTO Card_Effects VALUES(116,6,1);
|
||||
INSERT INTO Card_Effects VALUES(117,5,5);
|
||||
INSERT INTO Card_Effects VALUES(117,6,1);
|
||||
INSERT INTO Card_Effects VALUES(118,5,5);
|
||||
INSERT INTO Card_Effects VALUES(118,6,1);
|
||||
INSERT INTO Card_Effects VALUES(119,5,2);
|
||||
INSERT INTO Card_Effects VALUES(119,6,1);
|
||||
INSERT INTO Card_Effects VALUES(119,2,1);
|
||||
INSERT INTO Card_Effects VALUES(120,4,1);
|
||||
INSERT INTO Card_Effects VALUES(121,3,2);
|
||||
INSERT INTO Card_Effects VALUES(121,4,6);
|
||||
INSERT INTO Card_Effects VALUES(122,3,3);
|
||||
INSERT INTO Card_Effects VALUES(122,4,2);
|
||||
INSERT INTO Card_Effects VALUES(123,3,2);
|
||||
INSERT INTO Card_Effects VALUES(123,4,8);
|
||||
INSERT INTO Card_Effects VALUES(124,8,8);
|
||||
INSERT INTO Card_Effects VALUES(125,8,3);
|
||||
|
||||
CREATE TABLE Deck_Cards (Deck INTEGER REFERENCES Decks (id), Card INTEGER REFERENCES Cards (id), Amount INTEGER, Rarity INTEGER REFERENCES Rarities (id));
|
||||
INSERT INTO Deck_Cards VALUES(1,1,1,1);
|
||||
INSERT INTO Deck_Cards VALUES(2,1,1,1);
|
||||
INSERT INTO Deck_Cards VALUES(3,1,1,1);
|
||||
INSERT INTO Deck_Cards VALUES(4,1,1,1);
|
||||
INSERT INTO Deck_Cards VALUES(1,2,1,1);
|
||||
INSERT INTO Deck_Cards VALUES(2,2,1,1);
|
||||
INSERT INTO Deck_Cards VALUES(3,2,1,1);
|
||||
INSERT INTO Deck_Cards VALUES(4,2,1,1);
|
||||
INSERT INTO Deck_Cards VALUES(1,3,1,1);
|
||||
INSERT INTO Deck_Cards VALUES(2,3,1,1);
|
||||
INSERT INTO Deck_Cards VALUES(3,3,1,1);
|
||||
INSERT INTO Deck_Cards VALUES(4,3,1,1);
|
||||
INSERT INTO Deck_Cards VALUES(1,4,1,1);
|
||||
INSERT INTO Deck_Cards VALUES(2,4,1,1);
|
||||
INSERT INTO Deck_Cards VALUES(3,4,1,1);
|
||||
INSERT INTO Deck_Cards VALUES(4,4,1,1);
|
||||
INSERT INTO Deck_Cards VALUES(1,5,1,1);
|
||||
INSERT INTO Deck_Cards VALUES(2,5,1,1);
|
||||
INSERT INTO Deck_Cards VALUES(3,5,1,1);
|
||||
INSERT INTO Deck_Cards VALUES(4,5,1,1);
|
||||
INSERT INTO Deck_Cards VALUES(1,6,2,1);
|
||||
INSERT INTO Deck_Cards VALUES(2,6,2,1);
|
||||
INSERT INTO Deck_Cards VALUES(3,6,2,1);
|
||||
INSERT INTO Deck_Cards VALUES(4,6,2,1);
|
||||
INSERT INTO Deck_Cards VALUES(1,7,2,1);
|
||||
INSERT INTO Deck_Cards VALUES(2,7,2,1);
|
||||
INSERT INTO Deck_Cards VALUES(3,7,2,1);
|
||||
INSERT INTO Deck_Cards VALUES(4,7,2,1);
|
||||
INSERT INTO Deck_Cards VALUES(1,8,1,1);
|
||||
INSERT INTO Deck_Cards VALUES(2,8,1,1);
|
||||
INSERT INTO Deck_Cards VALUES(3,8,1,1);
|
||||
INSERT INTO Deck_Cards VALUES(4,8,1,1);
|
||||
INSERT INTO Deck_Cards VALUES(1,9,4,1);
|
||||
INSERT INTO Deck_Cards VALUES(2,9,4,1);
|
||||
INSERT INTO Deck_Cards VALUES(3,9,4,1);
|
||||
INSERT INTO Deck_Cards VALUES(4,9,4,1);
|
||||
INSERT INTO Deck_Cards VALUES(1,10,1,1);
|
||||
INSERT INTO Deck_Cards VALUES(2,10,1,1);
|
||||
INSERT INTO Deck_Cards VALUES(3,10,1,1);
|
||||
INSERT INTO Deck_Cards VALUES(4,10,1,1);
|
||||
INSERT INTO Deck_Cards VALUES(1,11,2,1);
|
||||
INSERT INTO Deck_Cards VALUES(2,11,2,1);
|
||||
INSERT INTO Deck_Cards VALUES(3,11,2,1);
|
||||
INSERT INTO Deck_Cards VALUES(4,11,2,1);
|
||||
INSERT INTO Deck_Cards VALUES(1,12,1,1);
|
||||
INSERT INTO Deck_Cards VALUES(2,12,1,1);
|
||||
INSERT INTO Deck_Cards VALUES(3,12,1,1);
|
||||
INSERT INTO Deck_Cards VALUES(4,12,1,1);
|
||||
INSERT INTO Deck_Cards VALUES(1,13,2,1);
|
||||
INSERT INTO Deck_Cards VALUES(2,13,2,1);
|
||||
INSERT INTO Deck_Cards VALUES(3,13,2,1);
|
||||
INSERT INTO Deck_Cards VALUES(4,13,2,1);
|
||||
INSERT INTO Deck_Cards VALUES(1,14,2,1);
|
||||
INSERT INTO Deck_Cards VALUES(2,14,2,1);
|
||||
INSERT INTO Deck_Cards VALUES(3,14,2,1);
|
||||
INSERT INTO Deck_Cards VALUES(4,14,2,1);
|
||||
|
||||
INSERT INTO Deck_Cards VALUES(20,20,1,5);
|
||||
INSERT INTO Deck_Cards VALUES(20,21,1,5);
|
||||
INSERT INTO Deck_Cards VALUES(20,22,1,5);
|
||||
INSERT INTO Deck_Cards VALUES(20,23,1,5);
|
||||
INSERT INTO Deck_Cards VALUES(20,24,1,5);
|
||||
INSERT INTO Deck_Cards VALUES(20,25,1,5);
|
||||
INSERT INTO Deck_Cards VALUES(20,26,1,5);
|
||||
INSERT INTO Deck_Cards VALUES(20,27,1,5);
|
||||
INSERT INTO Deck_Cards VALUES(20,28,1,5);
|
||||
INSERT INTO Deck_Cards VALUES(20,29,1,5);
|
||||
INSERT INTO Deck_Cards VALUES(20,30,1,5);
|
||||
INSERT INTO Deck_Cards VALUES(20,31,1,5);
|
||||
|
||||
INSERT INTO Deck_Cards VALUES(21,40,10,1);
|
||||
|
||||
INSERT INTO Deck_Cards VALUES(10,106,2,2);
|
||||
INSERT INTO Deck_Cards VALUES(10,108,2,2);
|
||||
INSERT INTO Deck_Cards VALUES(10,109,2,2);
|
||||
INSERT INTO Deck_Cards VALUES(10,110,2,2);
|
||||
INSERT INTO Deck_Cards VALUES(10,111,2,2);
|
||||
INSERT INTO Deck_Cards VALUES(10,112,2,2);
|
||||
INSERT INTO Deck_Cards VALUES(10,116,2,2);
|
||||
INSERT INTO Deck_Cards VALUES(10,117,2,2);
|
||||
INSERT INTO Deck_Cards VALUES(10,118,2,2);
|
||||
INSERT INTO Deck_Cards VALUES(10,119,2,2);
|
||||
INSERT INTO Deck_Cards VALUES(11,120,2,2);
|
||||
INSERT INTO Deck_Cards VALUES(10,121,2,2);
|
||||
INSERT INTO Deck_Cards VALUES(10,122,2,2);
|
||||
INSERT INTO Deck_Cards VALUES(10,123,2,2);
|
||||
|
||||
INSERT INTO Deck_Cards VALUES(11,100,2,3);
|
||||
INSERT INTO Deck_Cards VALUES(11,101,2,3);
|
||||
INSERT INTO Deck_Cards VALUES(11,102,2,3);
|
||||
INSERT INTO Deck_Cards VALUES(11,103,2,3);
|
||||
INSERT INTO Deck_Cards VALUES(11,104,2,3);
|
||||
INSERT INTO Deck_Cards VALUES(11,105,2,3);
|
||||
INSERT INTO Deck_Cards VALUES(11,107,2,3);
|
||||
INSERT INTO Deck_Cards VALUES(11,113,2,3);
|
||||
INSERT INTO Deck_Cards VALUES(11,114,2,3);
|
||||
INSERT INTO Deck_Cards VALUES(11,115,2,3);
|
||||
INSERT INTO Deck_Cards VALUES(11,124,2,3);
|
||||
INSERT INTO Deck_Cards VALUES(11,125,2,3);
|
||||
|
||||
CREATE VIEW Card_List AS
|
||||
SELECT
|
||||
Cards.Name AS 'Card Name',
|
||||
Cards.Energy AS 'Energy Cost',
|
||||
Cards.Health AS 'Health Cost',
|
||||
Cards.Risk AS 'Risk',
|
||||
Cards.Flavour AS 'Flavour',
|
||||
Cards.Image AS 'Image',
|
||||
Types.Name AS 'Type',
|
||||
group_concat(replace(Effects.Command,'#',Card_Effects.Amount), '\quad ') AS 'Effect(s)',
|
||||
Decks.Name AS 'In Deck',
|
||||
Deck_Cards.Amount AS 'Count',
|
||||
Rarities.Name AS 'Rarity'
|
||||
FROM Cards
|
||||
JOIN Types ON Types.id = Cards.Typename
|
||||
CROSS JOIN Card_Effects ON Card_Effects.Card = Cards.id
|
||||
JOIN Effects ON Effects.id = Card_Effects.Effect
|
||||
CROSS JOIN Deck_Cards ON Deck_Cards.Card = Cards.id
|
||||
JOIN Decks ON Deck_Cards.Deck = Decks.id
|
||||
JOIN Rarities ON Deck_Cards.Rarity = Rarities.id
|
||||
GROUP BY
|
||||
Cards.id,
|
||||
Decks.id
|
||||
ORDER BY Cards.Name;
|
||||
COMMIT;
|
|
@ -593,7 +593,6 @@ cards:
|
|||
type: movement
|
||||
flavour: 'Not as easy as dropping by the grocery store.'
|
||||
|
||||
|
||||
decks:
|
||||
starter1: &starter
|
||||
a_hat:
|
||||
|
|
45
configure.jq
45
configure.jq
|
@ -1,7 +1,13 @@
|
|||
# Takes iditacards output json and produces the dynamic ninja build
|
||||
|
||||
def expandout:
|
||||
to_entries[] | .value + { name: .key };
|
||||
|
||||
def everything:
|
||||
(.assets,.pseudoassets) | to_entries[] | .value + { name: .key };
|
||||
(
|
||||
(.assets | map_values(. + { pseudo: false })),
|
||||
(.pseudoassets | map_values(. + { pseudo: true }))
|
||||
) | expandout;
|
||||
|
||||
def cuesources:
|
||||
$ARGS.positional | join(" ");
|
||||
|
@ -22,8 +28,11 @@ def cuesources:
|
|||
"build output/everything.json: cuegen \(cuesources)",
|
||||
" filter = .",
|
||||
"", (
|
||||
everything | (
|
||||
select(.kind == "template") | .w = (.size | split("x")[0]) | .h = (.size | split("x")[1]) |
|
||||
everything | (
|
||||
select(.kind == "template") |
|
||||
.w = (.size | split("x")[0]) |
|
||||
.h = (.size | split("x")[1]) |
|
||||
.rawsuffix = (if .print then "raw." else "" end) |
|
||||
"build output/\(.name).json: extract output/everything.json",
|
||||
" filter = --arg asset '\(.name)' '.assets[$$asset].data'",
|
||||
"build output/\(.name).tex: template2tex output/\(.name).json | templates/\(.template)",
|
||||
|
@ -31,13 +40,29 @@ everything | (
|
|||
"build output/\(.name).pdf: tex2pdf output/\(.name).tex || output/\(.name).pdf.dd",
|
||||
" dyndep = output/\(.name).pdf.dd",
|
||||
"build output/\(.name).pdf.dd: scantex output/\(.name).tex",
|
||||
"build output/\(.name).raw.png: pdf2png output/\(.name).pdf",
|
||||
"build output/\(.name).\(.rawsuffix)png: pdf2png output/\(.name).pdf",
|
||||
" w = \(.w)",
|
||||
" h = \(.h)",
|
||||
"build output/\(.name).png: convert output/\(.name).raw.png",
|
||||
" args = \(.print)" # TODO: check that this doesn't break if print is missing
|
||||
)
|
||||
#,(
|
||||
# select(.kind == "tex") |
|
||||
#)
|
||||
(select(.print) | "build output/\(.name).png: convert output/\(.name).raw.png"),
|
||||
(select(.print) | " args = \(.print)")
|
||||
),(
|
||||
select(.kind == "image") |
|
||||
.rawsuffix = (if .print then "raw." else "" end) |
|
||||
"build output/\(.name).\(.rawsuffix)png: copy \(.source)",
|
||||
(select(.print) | "build output/\(.name).png: convert output/\(.name).raw.png"),
|
||||
(select(.print) | " args = \(.print)")
|
||||
),(
|
||||
select(.kind == "tex") |
|
||||
.w = (.size | split("x")[0]) |
|
||||
.h = (.size | split("x")[1]) |
|
||||
.rawsuffix = (if .print then "raw." else "" end) |
|
||||
"build output/\(.name).pdf: tex2pdf \(.source) || output/\(.name).pdf.dd",
|
||||
" dyndep = output/\(.name).pdf.dd",
|
||||
"build output/\(.name).pdf.dd: scantex \(.source)",
|
||||
"build output/\(.name).\(.rawsuffix)png: pdf2png output/\(.name).pdf",
|
||||
" w = \(.w)",
|
||||
" h = \(.h)",
|
||||
(select(.print) | "build output/\(.name).png: convert output/\(.name).raw.png"),
|
||||
(select(.print) | " args = \(.print)")
|
||||
)
|
||||
)
|
||||
|
|
|
@ -149,6 +149,8 @@
|
|||
\end{tikzpicture}
|
||||
}
|
||||
|
||||
% TODO: for better colourblindness accessibility, use 0/0/0 costs and the name
|
||||
% of the card type instead?
|
||||
\newcommand{\freecardtype}[1]{\cardtypetext{#1}{Free}}
|
||||
|
||||
\newcommand{\notallowed}[1]{%
|
||||
|
|
47
legs.cue
Normal file
47
legs.cue
Normal file
|
@ -0,0 +1,47 @@
|
|||
// Iditacards leg asset specification
|
||||
|
||||
package iditacards
|
||||
|
||||
#LegLevel: "firstleg" | "secondleg" | "thirdleg"
|
||||
#LegEffect: string
|
||||
#PassEffect: "hypo" | "damage" | "starve"
|
||||
#LegIndex: "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11"
|
||||
|
||||
// the template for a leg gets this
|
||||
#Leg: {
|
||||
name: string
|
||||
level: #LegLevel
|
||||
effect: #LegEffect
|
||||
spaces: [#LegIndex]: #PassEffect
|
||||
}
|
||||
|
||||
legs: [string]: #Leg
|
||||
|
||||
assets: {
|
||||
for legname, leg in legs {
|
||||
"\(legname)[1]": {
|
||||
size: "750x1050"
|
||||
print: "-set option:distort:viewport 825x1125-37-37 -virtual-pixel Edge -distort SRT 0 +repage"
|
||||
|
||||
kind: "template"
|
||||
template: "leg.tex"
|
||||
data: leg
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_legdecks: {
|
||||
for legname, leg in legs
|
||||
let legdeck = leg.level {"\(legdeck)": {"\(legname)": 1}}
|
||||
}
|
||||
|
||||
pseudoassets: {
|
||||
for deckname, legs in _legdecks {
|
||||
"\(deckname)": {
|
||||
kind: "cat"
|
||||
contents: [
|
||||
for legname, one in legs {"\(legname)[1]"},
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
11
legs.yaml
Normal file
11
legs.yaml
Normal file
|
@ -0,0 +1,11 @@
|
|||
# The legs (TODO: export shorthands for each leg effect in iditacard.cls so that
|
||||
# the cue generation/gomplate instantiation can be simplified)
|
||||
legs:
|
||||
farm:
|
||||
name: 'Farm'
|
||||
level: firstleg
|
||||
effect: '\allowednot{\includegraphics[width=1cm]{icons/starve.png}}'
|
||||
spaces:
|
||||
3: hypo
|
||||
5: damage
|
||||
7: hypo
|
16
others.cue
16
others.cue
|
@ -1,14 +1,24 @@
|
|||
// Iditacards other asset specification
|
||||
|
||||
images: [...string]
|
||||
images: [string]: string
|
||||
|
||||
documents: [string]: #Dimensions
|
||||
documents: [string]: [string]: #Dimensions
|
||||
|
||||
pseudoassets: {
|
||||
assets: {
|
||||
for image, path in images {
|
||||
"\(image)": {
|
||||
kind: "image"
|
||||
source: path
|
||||
}
|
||||
}
|
||||
|
||||
for document, source in documents {
|
||||
for srcfile, dims in source {
|
||||
"\(document)": {
|
||||
kind: "tex"
|
||||
source: srcfile
|
||||
size: dims
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
17
rules.ninja
17
rules.ninja
|
@ -13,11 +13,18 @@ rule extract
|
|||
|
||||
rule tex2pdf
|
||||
description = render tex from $in to $out
|
||||
command = xelatex -interaction=batchmode -halt-on-error --shell-escape --output-directory=$$(dirname $in) $in
|
||||
command = $
|
||||
xelatex $
|
||||
-interaction=batchmode $
|
||||
-halt-on-error $
|
||||
--shell-escape $
|
||||
--output-directory=$$(dirname $out) $in >/dev/null $
|
||||
&& [ $$(basename -s .tex $in) = $$(basename -s .pdf $out) ] $
|
||||
|| mv $$(dirname $out)/$$(basename -s .tex $in).pdf $out
|
||||
|
||||
rule scantex
|
||||
description = scan tex $in for dependencies
|
||||
command = bash scantex.sh $in > $out
|
||||
command = bash scantex.sh $in $out > $out
|
||||
|
||||
rule pdf2png
|
||||
description = convert pdf $in to png $out with size $w by $h
|
||||
|
@ -25,4 +32,8 @@ rule pdf2png
|
|||
|
||||
rule convert
|
||||
description = run ImageMagick convert on $in with args $args to $out
|
||||
command = convert $in $args $out
|
||||
command = magick $in $args $out
|
||||
|
||||
rule copy
|
||||
description = copy $in to $out
|
||||
command = cp $in $out
|
||||
|
|
50
scantex.old.sh
Normal file
50
scantex.old.sh
Normal file
|
@ -0,0 +1,50 @@
|
|||
#!/bin/bash
|
||||
|
||||
|
||||
# TODO: there should be some way to use -recorder to get list of dependencies
|
||||
# somehow, though I'd hate to regenerate the whole PDF just to make dependencies
|
||||
# note that the snapshot package is even better
|
||||
|
||||
# NOTE: next thing to try is the create temporary document with
|
||||
# \RequirePackage{snapshot} appended to the top, then run xelatex normally and
|
||||
# process the output *.dep (or *.log) file to extract the necessary
|
||||
# requirements. It may be possible to use additional xelatex flags to reduce
|
||||
# unnecessary work
|
||||
|
||||
echo 'ninja_dyndep_version = 1'
|
||||
|
||||
src="$1"
|
||||
dst="$2"
|
||||
tgt="${dst%%.*}.pdf"
|
||||
aux="${dst%%.*}.aux"
|
||||
log="${dst%%.*}.log"
|
||||
|
||||
# get_tex command
|
||||
# returns the argument of \command{...} in the src document
|
||||
get_tex() {
|
||||
grep "[\]$1" "$src" | sed 's/.*{\(.*\)}.*/\1/'
|
||||
}
|
||||
|
||||
deps=( )
|
||||
|
||||
if grep -q '\\documentclass{iditacard}' "$src"; then
|
||||
deps+=(
|
||||
# The class file
|
||||
'iditacard.cls'
|
||||
|
||||
# The artwork
|
||||
"images/card/$(get_tex art).png"
|
||||
|
||||
# The deckmark
|
||||
"images/deck/$(get_tex deck).png"
|
||||
)
|
||||
fi
|
||||
|
||||
read -r -a rawimages <<<"$(grep -o '\\includegraphics[^}]*}' "$src" | sed 's/.*{\(.*\)}.*/images\/\1/')"
|
||||
deps+=( "${rawimages[@]}" )
|
||||
|
||||
if [ "${#deps[@]}" -gt 0 ]; then
|
||||
echo "build $tgt | $aux $log : dyndep | ${deps[*]}"
|
||||
else
|
||||
echo "build $tgt | $aux $log : dyndep"
|
||||
fi
|
42
scantex.sh
42
scantex.sh
|
@ -3,36 +3,20 @@
|
|||
echo 'ninja_dyndep_version = 1'
|
||||
|
||||
src="$1"
|
||||
tgt="${src%%.*}.pdf"
|
||||
aux="${src%%.*}.aux"
|
||||
log="${src%%.*}.log"
|
||||
dst="$2"
|
||||
tgt="${dst%%.*}.pdf"
|
||||
|
||||
# get_tex command
|
||||
# returns the argument of \command{...} in the src document
|
||||
get_tex() {
|
||||
grep "[\]$1" "$src" | sed 's/.*{\(.*\)}.*/\1/'
|
||||
}
|
||||
temp="$(mktemp -p .)"
|
||||
trap 'rm -rf ${temp} ${temp}.*' EXIT INT
|
||||
|
||||
deps=( )
|
||||
cp "$src" "$temp.tex"
|
||||
xelatex -recorder "$temp.tex" >/dev/null
|
||||
|
||||
if grep -q '\\documentclass{iditacard}' "$src"; then
|
||||
deps+=(
|
||||
# The class file
|
||||
'iditacard.cls'
|
||||
deps="$(awk -v ORS=' ' -v "temp=$temp" -v "repl=${src%%.*}" '/INPUT \./ {gsub(temp,repl,$2); print $2}' < "$temp.fls")"
|
||||
outs="$(awk -v ORS=' ' -v "temp=${temp#*/}" -v "repl=${dst%%.*}" '/OUTPUT / {gsub(temp,repl,$2); print $2}' < "$temp.fls")"
|
||||
|
||||
# The artwork
|
||||
"images/cards/$(get_tex art).png"
|
||||
|
||||
# The deckmark
|
||||
"images/deck/$(get_tex deck).png"
|
||||
)
|
||||
fi
|
||||
|
||||
read -r -a rawimages <<<"$(grep -o '\\includegraphics[^}]*}' "$src" | sed 's/.*{\(.*\)}.*/images\/\1/')"
|
||||
deps+=( "${rawimages[@]}" )
|
||||
|
||||
if [ "${#deps[@]}" -gt 0 ]; then
|
||||
echo "build $tgt | $aux $log : dyndep | ${deps[*]}"
|
||||
else
|
||||
echo "build $tgt | $aux $log : dyndep"
|
||||
fi
|
||||
echo -n "build $tgt"
|
||||
[ -z "$outs" ] || echo -n " | $outs"
|
||||
echo -n " : dyndep"
|
||||
[ -z "$deps" ] || echo -n " | $deps"
|
||||
echo
|
||||
|
|
14
templates/leg.tex
Normal file
14
templates/leg.tex
Normal file
|
@ -0,0 +1,14 @@
|
|||
\documentclass{iditacard}
|
||||
|
||||
\leglevel{«.level»}
|
||||
|
||||
\begin{document}
|
||||
\begin{leg}
|
||||
\legname{«.name»}
|
||||
«- range $space, $effect := .spaces»
|
||||
\onlegspace{«$space»}{\includegraphics[width=1cm]{icons/«$effect».png}}
|
||||
«- end»
|
||||
\legeffect{«.effect»}
|
||||
\end{leg}
|
||||
\end{document}
|
||||
|
31
test.json
31
test.json
|
@ -1,31 +0,0 @@
|
|||
{
|
||||
"data": {
|
||||
"a_hat.tex": {
|
||||
"name": "A Hat",
|
||||
"costs": {
|
||||
"energy": 2,
|
||||
"health": 2
|
||||
},
|
||||
"effects": {
|
||||
"daydraw": "+1"
|
||||
},
|
||||
"image": "hat",
|
||||
"type": "attachment",
|
||||
"flavour": "I bet its a valve hat."
|
||||
},
|
||||
"dog_chow.tex": {
|
||||
"name": "Dog Chow",
|
||||
"costs": {
|
||||
"energy": 3
|
||||
},
|
||||
"cards": {
|
||||
"health": 3
|
||||
},
|
||||
"effects": {
|
||||
"speed": "+1"
|
||||
},
|
||||
"image": "dog_chow",
|
||||
"type": "attachment",
|
||||
"flavour": "A hungry dog is a slow dog."
|
||||
}
|
||||
}}
|
|
@ -1,2 +0,0 @@
|
|||
# ninja log v6
|
||||
0 1 1727044871155308194 a a7305d4d77a970a4
|
|
@ -1,3 +0,0 @@
|
|||
include ../rules.ninja
|
||||
|
||||
build a: foo test.txt
|
Loading…
Reference in a new issue