🧐 Render melee cards
This commit is contained in:
parent
c0fc97a578
commit
8c7e842d2e
78 changed files with 243 additions and 1 deletions
|
@ -8,3 +8,4 @@ class Melee(db.Entity):
|
|||
description = Optional(str)
|
||||
mechanism = Optional(str)
|
||||
icon = Required(bytes)
|
||||
stats = Required(int)
|
||||
|
|
|
@ -51,9 +51,16 @@ with db_session:
|
|||
region_arr = io.BytesIO()
|
||||
region.save(region_arr, format="PNG")
|
||||
|
||||
stats_map = {"Brutality": 1, "Survival": 2, "Tactic": 4}
|
||||
stats = 0
|
||||
for t in ["tier1", "tier2"]:
|
||||
if t in i:
|
||||
stats += stats_map[i[t]]
|
||||
|
||||
Melee(
|
||||
name=i["name"],
|
||||
description=i["ambiantDesc"],
|
||||
mechanism=i["gameplayDesc"],
|
||||
icon=region_arr.getbuffer().tobytes()
|
||||
icon=region_arr.getbuffer().tobytes(),
|
||||
stats=stats,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue