This repository has been archived by the owner on Jul 25, 2024. It is now read-only.
generated from QuiltMC/quilt-template-mod
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cardgen.py
217 lines (205 loc) · 12.9 KB
/
cardgen.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
import json
zone_colors = {
"campgrounds": "aqua",
"starfall": "dark_gray",
"lakeside": "light_purple",
"overlook": "yellow",
"springtide": "dark_purple",
"industries": "dark_aqua",
"deepwoods": "green",
"midway": "gold",
"todo": "red"
}
booth_cards = {
"additional_banners": ("Additional Banners", "Darkhax", "campgrounds", "decoration", "LemmaEOF"),
"allium": ("Allium", "hugeblank, Patbox, BasiqueEvangelist", "deepwoods", "tech", "Arathain"),
"arcanus_2": ("Arcanus 2", "Cammie, Will BL, MrSterner, ArathainFarqoe", "campgrounds", "magic", "Arathain"),
"architecture_extensions": ("Architecture Extensions", "woodiertexas", "starfall", "decoration", "LemmaEOF"),
"archon": ("Archon", "Safro", "campgrounds", "magic", "Arathain"),
"armor_stand_editor": ("Armor Stand Editor", "Patbox", "midway", "tech", "Arathain"),
"aura": ("Aura", "maximum, DrRubisco, Cart3r", "lakeside", "magic", "Arathain"),
"aurora_decor": ("Aurora's Decorations", "LambdAurora", "starfall", "decoration", "Arathain"),
"automobility": ("Automobility", "FoundationGames", "springtide", "mech", "Arathain"),
"bagels_baking": ("Bagel's Baking", "hugeblank, Aye, Solcat, Koritsi, ChocolateFrog18", "deepwoods", "nature", "Arathain"),
"bewitchment": ("Bewitchment", "Bewitchment Team", "todo", "magic", "Arathain"),
"bewitchment_plus": ("Bewitchment Plus", "MrSterner", "todo", "magic", "Arathain"),
"bing_bing_wahoo": ("Bing Bing Wahoo", "Tropheus Jay, Soggy Cereal", "deepwoods", "mech", "Arathain"),
"bits_and_chisels": ("Bits and Chisels", "ThatTrollzer", "starfall", "decoration", "Arathain"),
"botania": ("Botania", "Vazkii, Williewillus, Hubry, Alwinfy", "industries", "tech", "Arathain"),
"build_battle": ("Build Battle", "NucleoidMC", "deepwoods", "tech", "Arathain"),
"campanion": ("Campanion", "Terraformers", "campgrounds", "nature", "LemmaEOF"),
"cardstock": ("CardStock", "Repulica, LemmaEOF", "campgrounds", "tech", "Arathain"),
"cc_prometheus": ("ComputerCraft: Prometheus", "SquidDev", "overlook", "tech", "Arathain"),
"cc_restitched": ("ComputerCraft: Restitched", "Merith, Patbox, SquidDev", "overlook", "tech", "Arathain"),
"chocolate_bar": ("Chocolate Bar", "woodiertexas", "industries", "creature", "Arathain"),
"chromatic_currents": ("Chromatic Currents", "Fusion Flux", "starfall", "mech", "Arathain"),
"consistency_plus": ("Consistency Plus", "Cart3r, Tropheus Jay, Siuol", "deepwoods", "decoration", "Arathain"),
"create": ("Create", "Create Fabric Team", "deepwoods", "mech", "Arathain"),
"culinaire": ("Culinaire", "Dawn Team", "industries", "creature", "Arathain"),
"dark_paintings": ("Dark Paintings", "Darkhax", "campgrounds", "decoration", "Darkhax"),
"dark_utilities": ("Dark Utilities", "Darkhax", "campgrounds", "mech", "Darkhax"),
"decorative": ("Decorative", "Motschen", "lakeside", "decoration", "Arathain"),
"destroy_the_monument": ("Destroy The Monument", "NucleoidMC", "midway", "creature", "Arathain"),
"double_jump_attribute": ("Double Jump Attribute", "Amy", "deepwoods", "mech", "Arathain"),
"dyeable_fishing_lines": ("Dyeable Fishing Lines", "Fusion Flux", "deepwoods", "decoration", "Arathain"),
"ears": ("Ears", "unascribed", "campgrounds", "decoration", "Arathain"),
"ecotones": ("Ecotones", "supercoder79", "starfall", "nature", "Arathain"),
"emi": ("EMI", "Emi", "campgrounds", "tech", "Arathain"),
"enchancement": ("Enchancement", "MoriyaShiine", "starfall", "magic", "Arathain"),
"endermantic_overhaul": ("Endermantic Overhaul", "anonym123", "campgrounds", "mech", "Arathain"),
"extended_drawers": ("Extended Drawers", "MattiDragon", "lakeside", "mech", "Arathain"),
"fabulously_optimized": ("Fabulously Optimized", "robotkoer", "starfall", "tech", "Arathain"),
"flamingo": ("Flamingo", "copygirl, Vexatos", "campgrounds", "tater", "Arathain"),
"flowery_structures": ("Flowery Structures", "JustAnUmbreon", "deepwoods", "nature", "Arathain"),
"flying_fluxery": ("Flying Fluxery", "Fusion Flux", "springtide", "mech", "Arathain"),
"fortress": ("Fortress", "NucleoidMC", "midway", "tech", "Arathain"),
"fusions_grappling_hook": ("Fusion's Grappling Hook", "Fusion Flux", "springtide", "mech", "Arathain"),
"goml_reserved": ("Get Off My Lawn ReServed", "Patbox, Draylar", "midway", "tech", "Arathain"),
"guard_villagers": ("Guard Villagers", "MrSterner", "todo", "mech", "Arathain"),
"haema": ("Haema", "Will BL", "campgrounds", "magic", "Arathain"),
"half_doors": ("Half Doors", "Amy", "deepwoods", "decoration", "Arathain"),
"hex_casting": ("Hex Casting", "Petrak@, Alwinfy, Wiresegal", "starfall", "magic", "Arathain"),
"hip_hoppers": ("Hip Hoppers", "Fusion Flux", "springtide", "mech", "Arathain"),
"icy_incitement": ("Icy Incitement", "Amy", "deepwoods", "mech", "Arathain"),
"incorporeal": ("Incorporeal 3", "quat, Artemis System", "industries", "tech", "Arathain"),
"inspecio": ("Inspecio", "LambdAurora, Emi", "starfall", "tech", "Arathain"),
"iris": ("Iris", "IMS", "todo", "tech", "Arathain"),
"jamtastic": ("Jamtastic", "jamalam", "springtide", "creature", "Arathain"),
"kiln": ("Kiln", "LemmaEOF, ZestyBlaze, BluKat", "campgrounds", "mech", "Arathain"),
"lovely_snails": ("Lovely Snails", "LambdAurora", "starfall", "creature", "Arathain"),
"matchbox": ("Matchbox", "Sunroses", "campgrounds", "mech", "Arathain"),
"mbembe": ("Mbembe", "ArathainFarqoe, Mango, Coolrex, Ninni, Zae", "springtide", "creature", "Arathain"),
"milk_plus": ("Milk+", "Tropheus Jay", "springtide", "nature", "Arathain"),
"now_playing": ("Now Playing", "AppleTheGolden", "deepwoods", "tech", "Arathain"),
"overweight_farming": ("Overweight Farming", "MrSterner", "campgrounds", "nature", "Arathain"),
"oxidized": ("Oxidized", "Safro", "springtide", "decoration", "Arathain"),
"packages": ("Packages", "quat", "industries", "mech", "Arathain"),
"pehkui": ("Pehkui", "Virtuoel", "starfall", "tech", "Arathain"),
"pettable_bees": ("Pettable Bees", "Fusion Flux", "springtide", "nature", "Arathain"),
"phonos": ("Phonos", "FoundationGames", "overlook", "mech", "Arathain"),
"peculiar_pieces": ("Peculiar Pieces", "Amy", "deepwoods", "tech", "LemmaEOF"),
"picture_sign": ("Picture Sign", "Motschen", "lakeside", "decoration", "LemmaEOF"),
"pigpen": ("Pig Pen Cipher", "Darkhax", "campgrounds", "tech", "Darkhax"),
"player_pronouns": ("Player Pronouns", "Ash", "campgrounds", "tech", "Arathain"),
"polaroid_camera": ("Polaroid Camera", "Pigeon", "springtide", "mech", "Arathain"),
"polymc": ("PolyMc", "TheEpicBlock", "midway", "tech", "Arathain"),
"portal_cubed": ("Portal Cubed", "Portal Cubed team", "campgrounds", "tech", "Arathain"),
"promenade": ("Promenade", "Dawn Team", "starfall", "nature", "Arathain"),
"pswg": ("Galaxies: Parzi's Star Wars Mod", "PSWG Team", "springtide", "tech", "Arathain"),
"purpeille": ("Purpeille", "acikek, VirtuaLilith, Trudle, Jeb_Kerm", "springtide", "purpeille", "VirtuaLilith"),
"qcraft": ("qCraft: Reimagined", "acikek, VirtuaLilith", "todo", "mech", "Arathain"),
"quakecraft": ("QuakeCraft", "NucleoidMC", "midway", "creature", "Arathain"),
"quark": ("Quark", "wiresegal, Vazkii", "industries", "tater", "Arathain"),
"reaping": ("Reaping", "Jamalam", "overlook", "creature", "Arathain"),
"recordable": ("Recordable", "burger", "lakeside", "mech", "Arathain"),
"resounding": ("Resounding", "DrRubisco, iceGiant", "springtide", "tech", "Arathain"),
"riptide_rush": ("Riptide Rush", "Amy", "deepwoods", "tech", "Arathain"),
"runelic": ("Runelic", "Darkhax", "campgrounds", "tech", "Darkhax"),
"sandwichable": ("Sandwichable", "FoundationGames", "deepwoods", "nature", "Arathain"),
"simple_crates": ("Simple Crates", "Sunroses", "campgrounds", "mech", "Arathain"),
"simplevillagers": ("Simple Villagers", "samo_lego", "springtide", "mech", "Arathain"),
"skywars": ("Skywars", "NucleoidMC", "midway", "tech", "Arathain"),
"soul_ice": ("Soul Ice", "Siuol", "lakeside", "decoration", "Arathain"),
"spacefactory": ("SpaceFactory", "reoseah", "overlook", "tech", "Arathain"),
"tatercart": ("TaterCart", "Patbox", "midway", "mech", "LemmaEOF"),
"taterzens": ("Taterzens", "samo_lego", "midway", "tech", "Arathain"),
"terracraft": ("TerraCraft", "SimplyCmd, RiverOaken", "campgrounds", "nature", "Arathain"),
"terrariamod": ("TerrariaMod", "Ryorama, Realz, Kelvin, Cepheus", "springtide", "nature", "Arathain"),
"this_rocks": ("This Rocks!", "Motschen", "lakeside", "decoration", "Arathain"),
"ultimatehud": ("UltimateHUD", "XanderStuff", "midway", "tech", "Arathain"),
"visible_barriers": ("Visible Barriers", "Amy", "deepwoods", "tech", "Arathain"),
"visual_overhaul": ("Visual Overhaul", "Motschen", "lakeside", "decoration", "LemmaEOF"),
"wired_redstone": ("Wired Redstone", "Kneelawk", "starfall", "mech", "Kneelawk"),
"xp_share": ("XP Share", "Sunroses", "campgrounds", "tech", "Arathain"),
"yungs_better_dtemples": ("YUNG's Better Desert Temples", "YUNGNICKYOUNG", "todo", "mech", "Arathain")
}
langs = {
"location.blanketcon.campgrounds": "The Campgrounds",
"location.blanketcon.starfall": "Starfall Ruins",
"location.blanketcon.lakeside": "Lakeside Resort",
"location.blanketcon.overlook": "Overlook Point",
"location.blanketcon.springtide": "Springtide Fields",
"location.blanketcon.industries": "CL Industries",
"location.blanketcon.deepwoods": "Extant Deepwoods",
"location.blanketcon.midway": "Midway Park",
"location.blanketcon.none": "No booth created",
"text.blanketcon.buildoff.congrats": "Congratulations!",
"text.blanketcon.buildoff.runner": "Given to the runner-up of the BlanketCon Build-Off",
"text.blanketcon.buildoff.winner": "Given to the winner of the BlanketCon Build-Off",
"text.blanketcon.located": "Located in",
"text.blanketcon.by": "By",
"card.blanketcon.blanketcon.buildoff_winner": "BlanketCon Build-Off: Runner-Up",
"card.blanketcon.blanketcon.buildoff_winner_rhf": "BlanketCon Build-Off: Winner"
}
generated_cards = 0
# TODO: Build-Off Winner card, custom RHF texture for C+
def write_booth_card(kdl, key, info, rhf):
name, authors, location, frame, artist = info
path = key + '_rhf' if rhf else key
# lang entry
langs['card.blanketcon.blanketcon.' + path] = name
# kdl entry
kdl.write('card "' + path + '" {\n')
kdl.write('\trarity ' + ('3' if rhf else '2') + '\n')
if location != "todo":
kdl.write('\tinfo {\n')
kdl.write('\t\t- translate="text.blanketcon.located" color="gray"\n')
kdl.write('\t\t- text=" " color="gray"\n')
kdl.write('\t\t- translate="location.blanketcon.' + location + '" color="' + zone_colors[location] + '"\n')
kdl.write('\t}\n')
else:
kdl.write('\tinfo translate="location.blanketcon.none" color="gray"\n')
kdl.write('\t lore {\n')
kdl.write('\t\t- {\n')
kdl.write('\t\t\t- translate="text.blanketcon.by" color="gray"\n')
kdl.write('\t\t\t- text=" " color="gray"\n')
kdl.write('\t\t\t- text="' + authors + '" color="green"\n')
kdl.write('\t\t}\n')
kdl.write('\t}\n')
kdl.write('\tartist "' + artist + '"\n')
kdl.write('\tdate "2022"\n')
kdl.write('}\n')
# asset jsons
with open('src/main/resources/assets/blanketcon/models/item/card/blanketcon/' + path + '.json', 'w') as model:
mjson = {
"parent": "cardstock:builtin/card",
"textures": {
"art": "blanketcon:item/card/art/" + key,
"frame": "blanketcon:item/card/frame/" + frame
}
}
if rhf:
mjson["textures"]["holo_left"] = "blanketcon:item/card/frame/" + frame + "_rhf_left"
mjson["textures"]["holo_center"] = "blanketcon:item/card/frame/" + frame + "_rhf_center"
mjson["textures"]["holo_right"] = "blanketcon:item/card/frame/" + frame + "_rhf_right"
model.write(json.dumps(mjson, indent=4))
print("Generated card " + path)
with open('src/main/resources/data/blanketcon/cardstock/sets/blanketcon.kdl', 'w') as kdl:
kdl.write('emblem "blanketcon:textures/gui/blanketcon.png"\n')
for key, info in booth_cards.items():
write_booth_card(kdl, key, info, False)
write_booth_card(kdl, key, info, True)
generated_cards += 2
kdl.write("""//build-off cards
card "buildoff_winner" {
\trarity 4
\tinfo translate="text.blanketcon.buildoff.congrats" color="magenta"
\tlore {
\t\t- translate="text.blanketcon.buildoff.runner" color="gray"
\t}
\tartist "Cart3r"
\tyear "2022"
}
card "buildoff_winner_rhf" {
\trarity 5
\tinfo translate="text.blanketcon.buildoff.congrats" color="yellow"
\tlore {
\t\t- translate="text.blanketcon.buildoff.winner" color="gray"
\t}
\tartist "Cart3r"
\tyear "2022"
}
""")
print("Generated " + str(generated_cards) + " cards")
with open('src/main/resources/assets/blanketcon/lang/en_us.json', 'w') as lang:
lang.write(json.dumps(langs, indent=4))