✨ Outfits
17224
data/clean/31-2/main.en.mo.json
Normal file
|
@ -30,6 +30,15 @@ class Ranged(db.Entity):
|
|||
stats = Required(int)
|
||||
|
||||
|
||||
class Outfit(db.Entity):
|
||||
name = Required(str)
|
||||
name_en = Required(str)
|
||||
description = Optional(str)
|
||||
icon = Required(bytes)
|
||||
preview = Optional(bytes)
|
||||
cell_cost = Required(int)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
db.bind(provider="sqlite", filename="../../clean/31-2/data.sqlite3")
|
||||
db.generate_mapping(create_tables=True)
|
||||
|
|
49
data/convert/31-2/outfits.py
Executable file
|
@ -0,0 +1,49 @@
|
|||
#!/usr/bin/env python3
|
||||
# # -*- coding: utf-8 -*-
|
||||
|
||||
import json
|
||||
import re
|
||||
import io
|
||||
from db import *
|
||||
from PIL import Image
|
||||
|
||||
with open("../../extraction/raw-31-2/data.cdb.json") as f:
|
||||
raw = json.load(f)
|
||||
with open("../../clean/31-2/main.zh.mo.json") as f:
|
||||
trans = json.load(f)
|
||||
with open("../../clean/31-2/main.en.mo.json") as f:
|
||||
trans_en = json.load(f)
|
||||
img = Image.open("../../extraction/raw-31-2/cardIcons.png")
|
||||
|
||||
db.bind(provider="sqlite", filename="../../clean/31-2/data.sqlite3")
|
||||
db.generate_mapping()
|
||||
|
||||
lines = raw["sheets"][1]["lines"]
|
||||
|
||||
with db_session:
|
||||
for i in lines:
|
||||
if i["group"] == 13:
|
||||
if not i["name"]:
|
||||
continue
|
||||
if i["id"] == "KingsHandBoss":
|
||||
continue
|
||||
raw_name = i["name"].strip()
|
||||
i["name"] = trans[raw_name]["msgstr"][0]
|
||||
i["name"] = re.sub(r"。", r"", i["name"])
|
||||
i["name_en"] = trans_en[raw_name]["msgstr"][0]
|
||||
i["name_en"] = re.sub(r"outfit", r"Outfit", i["name_en"])
|
||||
i["gameplayDesc"] = trans[i["gameplayDesc"].strip()]["msgstr"][0]
|
||||
x = i["icon"]["x"] * 24
|
||||
y = i["icon"]["y"] * 24
|
||||
box = (x, y, x + 24, y + 24)
|
||||
region = img.crop(box)
|
||||
region_arr = io.BytesIO()
|
||||
region.save(region_arr, format="PNG")
|
||||
|
||||
Outfit(
|
||||
name=i["name"],
|
||||
name_en=i["name_en"],
|
||||
description=i["gameplayDesc"],
|
||||
icon=region_arr.getbuffer().tobytes(),
|
||||
cell_cost=i["cellCost"],
|
||||
)
|
BIN
data/extraction/raw-31-2/main.en.mo
Normal file
28
data/patch/31-2/outfits.py
Normal file
|
@ -0,0 +1,28 @@
|
|||
import scrapy
|
||||
import sys
|
||||
import requests
|
||||
import io
|
||||
|
||||
sys.path.append("../../convert/31-2")
|
||||
from db import *
|
||||
|
||||
db.bind(provider="sqlite", filename="../../clean/31-2/data.sqlite3")
|
||||
db.generate_mapping()
|
||||
|
||||
|
||||
class OutfitSpider(scrapy.Spider):
|
||||
name = "outfits"
|
||||
start_urls = [
|
||||
"https://deadcells.fandom.com/wiki/Outfits",
|
||||
]
|
||||
|
||||
def parse(self, response):
|
||||
for quote in response.css(".wikitable tbody tr"):
|
||||
name_en = quote.css("td:nth-child(2) > span:last-child::text").get()
|
||||
preview = quote.css("td:nth-child(6) a::attr('href')").get()
|
||||
if not name_en:
|
||||
continue
|
||||
r = requests.get(preview)
|
||||
with db_session:
|
||||
w = Outfit.select(name_en=name_en).first()
|
||||
w.preview = io.BytesIO(r.content).getbuffer().tobytes()
|
BIN
data/render/31-2/output/Galaxy套装.png
Normal file
After Width: | Height: | Size: 151 KiB |
BIN
data/render/31-2/output/HEV装束.png
Normal file
After Width: | Height: | Size: 143 KiB |
BIN
data/render/31-2/output/一千零一夜装束.png
Normal file
After Width: | Height: | Size: 133 KiB |
BIN
data/render/31-2/output/仆从装束.png
Normal file
After Width: | Height: | Size: 204 KiB |
BIN
data/render/31-2/output/传说中的战士.png
Normal file
After Width: | Height: | Size: 135 KiB |
BIN
data/render/31-2/output/传说中的肿胀眼魔装束.png
Normal file
After Width: | Height: | Size: 141 KiB |
BIN
data/render/31-2/output/克劳德装束.png
Normal file
After Width: | Height: | Size: 141 KiB |
BIN
data/render/31-2/output/冰雪王后装束.png
Normal file
After Width: | Height: | Size: 130 KiB |
BIN
data/render/31-2/output/几乎是你自己装束.png
Normal file
After Width: | Height: | Size: 135 KiB |
BIN
data/render/31-2/output/剑刃大师装束.png
Normal file
After Width: | Height: | Size: 137 KiB |
BIN
data/render/31-2/output/反向小偷装束.png
Normal file
After Width: | Height: | Size: 164 KiB |
BIN
data/render/31-2/output/叛教者装束.png
Normal file
After Width: | Height: | Size: 134 KiB |
BIN
data/render/31-2/output/吹箭师装束.png
Normal file
After Width: | Height: | Size: 140 KiB |
BIN
data/render/31-2/output/园艺师装束.png
Normal file
After Width: | Height: | Size: 132 KiB |
BIN
data/render/31-2/output/国王之手装束.png
Normal file
After Width: | Height: | Size: 138 KiB |
BIN
data/render/31-2/output/国王之手装束:信任.png
Normal file
After Width: | Height: | Size: 140 KiB |
BIN
data/render/31-2/output/国王之手装束:刚直.png
Normal file
After Width: | Height: | Size: 142 KiB |
BIN
data/render/31-2/output/国王之手装束:忠诚.png
Normal file
After Width: | Height: | Size: 141 KiB |
BIN
data/render/31-2/output/国王之手装束:无瑕.png
Normal file
After Width: | Height: | Size: 141 KiB |
BIN
data/render/31-2/output/国王之手装束:献身.png
Normal file
After Width: | Height: | Size: 141 KiB |
BIN
data/render/31-2/output/国王仆从装束.png
Normal file
After Width: | Height: | Size: 122 KiB |
BIN
data/render/31-2/output/国王装束.png
Normal file
After Width: | Height: | Size: 141 KiB |
BIN
data/render/31-2/output/国王装束:白色.png
Normal file
After Width: | Height: | Size: 141 KiB |
BIN
data/render/31-2/output/堕落收藏家装束.png
Normal file
After Width: | Height: | Size: 149 KiB |
BIN
data/render/31-2/output/复古装束.png
Normal file
After Width: | Height: | Size: 127 KiB |
BIN
data/render/31-2/output/多纳泰罗装束.png
Normal file
After Width: | Height: | Size: 140 KiB |
BIN
data/render/31-2/output/容器装束.png
Normal file
After Width: | Height: | Size: 149 KiB |
BIN
data/render/31-2/output/寒冬装束.png
Normal file
After Width: | Height: | Size: 133 KiB |
BIN
data/render/31-2/output/小骨装束.png
Normal file
After Width: | Height: | Size: 136 KiB |
BIN
data/render/31-2/output/巨人装束:失望.png
Normal file
After Width: | Height: | Size: 154 KiB |
BIN
data/render/31-2/output/巨人装束:无瑕.png
Normal file
After Width: | Height: | Size: 152 KiB |
BIN
data/render/31-2/output/巨人装束:沮丧.png
Normal file
After Width: | Height: | Size: 150 KiB |
BIN
data/render/31-2/output/巨人装束:经典.png
Normal file
After Width: | Height: | Size: 150 KiB |
BIN
data/render/31-2/output/巨人装束:诅咒.png
Normal file
After Width: | Height: | Size: 150 KiB |
BIN
data/render/31-2/output/巨人装束:误会.png
Normal file
After Width: | Height: | Size: 151 KiB |
BIN
data/render/31-2/output/巨大蜱虫装束.png
Normal file
After Width: | Height: | Size: 155 KiB |
BIN
data/render/31-2/output/幽灵装束.png
Normal file
After Width: | Height: | Size: 136 KiB |
BIN
data/render/31-2/output/弩手装束.png
Normal file
After Width: | Height: | Size: 141 KiB |
BIN
data/render/31-2/output/强盗装束.png
Normal file
After Width: | Height: | Size: 121 KiB |
BIN
data/render/31-2/output/忍者装束.png
Normal file
After Width: | Height: | Size: 134 KiB |
BIN
data/render/31-2/output/忏悔者装束.png
Normal file
After Width: | Height: | Size: 148 KiB |
BIN
data/render/31-2/output/恶魔装束.png
Normal file
After Width: | Height: | Size: 144 KiB |
BIN
data/render/31-2/output/愤怒的肿胀眼魔装束.png
Normal file
After Width: | Height: | Size: 148 KiB |
BIN
data/render/31-2/output/战士装束.png
Normal file
After Width: | Height: | Size: 142 KiB |
BIN
data/render/31-2/output/探险家装束.png
Normal file
After Width: | Height: | Size: 134 KiB |
BIN
data/render/31-2/output/摔跤手装束.png
Normal file
After Width: | Height: | Size: 124 KiB |
BIN
data/render/31-2/output/旅者装束.png
Normal file
After Width: | Height: | Size: 133 KiB |
BIN
data/render/31-2/output/无瑕仆从装束.png
Normal file
After Width: | Height: | Size: 130 KiB |
BIN
data/render/31-2/output/无瑕王后装束.png
Normal file
After Width: | Height: | Size: 145 KiB |
BIN
data/render/31-2/output/时间装束:收藏家.png
Normal file
After Width: | Height: | Size: 150 KiB |
BIN
data/render/31-2/output/时间装束:无瑕.png
Normal file
After Width: | Height: | Size: 141 KiB |
BIN
data/render/31-2/output/时间装束:沙漠.png
Normal file
After Width: | Height: | Size: 144 KiB |
BIN
data/render/31-2/output/时间装束:火山.png
Normal file
After Width: | Height: | Size: 145 KiB |
BIN
data/render/31-2/output/时间装束:猎手.png
Normal file
After Width: | Height: | Size: 136 KiB |
BIN
data/render/31-2/output/时间装束:经典.png
Normal file
After Width: | Height: | Size: 149 KiB |
BIN
data/render/31-2/output/曙光仆从装束.png
Normal file
After Width: | Height: | Size: 138 KiB |
BIN
data/render/31-2/output/有毒仆从装束.png
Normal file
After Width: | Height: | Size: 121 KiB |
BIN
data/render/31-2/output/樱花王后装束.png
Normal file
After Width: | Height: | Size: 160 KiB |
BIN
data/render/31-2/output/沙漠之民装束.png
Normal file
After Width: | Height: | Size: 143 KiB |
BIN
data/render/31-2/output/法师装束.png
Normal file
After Width: | Height: | Size: 132 KiB |
BIN
data/render/31-2/output/法棍套装.png
Normal file
After Width: | Height: | Size: 133 KiB |
BIN
data/render/31-2/output/波比装束.png
Normal file
After Width: | Height: | Size: 131 KiB |
BIN
data/render/31-2/output/洛基装束.png
Normal file
After Width: | Height: | Size: 144 KiB |
BIN
data/render/31-2/output/渔夫装束.png
Normal file
After Width: | Height: | Size: 130 KiB |
BIN
data/render/31-2/output/独裁者装束.png
Normal file
After Width: | Height: | Size: 146 KiB |
BIN
data/render/31-2/output/王后装束.png
Normal file
After Width: | Height: | Size: 127 KiB |
BIN
data/render/31-2/output/王室园艺师装束.png
Normal file
After Width: | Height: | Size: 151 KiB |
BIN
data/render/31-2/output/白金王后装束.png
Normal file
After Width: | Height: | Size: 141 KiB |
BIN
data/render/31-2/output/白银仆从装束.png
Normal file
After Width: | Height: | Size: 129 KiB |
BIN
data/render/31-2/output/看守者装束:无瑕.png
Normal file
After Width: | Height: | Size: 154 KiB |
BIN
data/render/31-2/output/看守者装束:比克.png
Normal file
After Width: | Height: | Size: 141 KiB |
BIN
data/render/31-2/output/看守者装束:经典.png
Normal file
After Width: | Height: | Size: 141 KiB |
BIN
data/render/31-2/output/看守者装束:超凡.png
Normal file
After Width: | Height: | Size: 147 KiB |
BIN
data/render/31-2/output/神风装束.png
Normal file
After Width: | Height: | Size: 132 KiB |
BIN
data/render/31-2/output/祭品蜱虫装束.png
Normal file
After Width: | Height: | Size: 180 KiB |
BIN
data/render/31-2/output/稻草人装束:可爱.png
Normal file
After Width: | Height: | Size: 145 KiB |
BIN
data/render/31-2/output/稻草人装束:哥特.png
Normal file
After Width: | Height: | Size: 131 KiB |
BIN
data/render/31-2/output/稻草人装束:园艺.png
Normal file
After Width: | Height: | Size: 132 KiB |
BIN
data/render/31-2/output/稻草人装束:无瑕.png
Normal file
After Width: | Height: | Size: 130 KiB |
BIN
data/render/31-2/output/稻草人装束:经典.png
Normal file
After Width: | Height: | Size: 139 KiB |
BIN
data/render/31-2/output/稻草人装束:西国魔巫.png
Normal file
After Width: | Height: | Size: 137 KiB |
BIN
data/render/31-2/output/绅士装束.png
Normal file
After Width: | Height: | Size: 144 KiB |
BIN
data/render/31-2/output/终极的看守者装束.png
Normal file
After Width: | Height: | Size: 150 KiB |
BIN
data/render/31-2/output/经典装束.png
Normal file
After Width: | Height: | Size: 155 KiB |
BIN
data/render/31-2/output/罗宾汉装束.png
Normal file
After Width: | Height: | Size: 136 KiB |
BIN
data/render/31-2/output/肿胀眼魔装束:反叛.png
Normal file
After Width: | Height: | Size: 141 KiB |
BIN
data/render/31-2/output/肿胀眼魔装束:无瑕.png
Normal file
After Width: | Height: | Size: 146 KiB |
BIN
data/render/31-2/output/肿胀眼魔装束:经典.png
Normal file
After Width: | Height: | Size: 143 KiB |
BIN
data/render/31-2/output/肿胀眼魔装束:饥饿.png
Normal file
After Width: | Height: | Size: 143 KiB |
BIN
data/render/31-2/output/节日装束.png
Normal file
After Width: | Height: | Size: 147 KiB |
BIN
data/render/31-2/output/萨满装束.png
Normal file
After Width: | Height: | Size: 148 KiB |
BIN
data/render/31-2/output/蘑菇君装束.png
Normal file
After Width: | Height: | Size: 145 KiB |
BIN
data/render/31-2/output/蘑菇王装束.png
Normal file
After Width: | Height: | Size: 132 KiB |
BIN
data/render/31-2/output/蜥蜴装束.png
Normal file
After Width: | Height: | Size: 139 KiB |