🗃️ Rendered 31-2 data, added shields
This commit is contained in:
parent
00e5928284
commit
ac2a8e4d28
20 changed files with 98 additions and 8 deletions
|
@ -18,10 +18,17 @@ db.generate_mapping()
|
|||
def melee(name):
|
||||
with db_session:
|
||||
query = select(w for w in Melee if w.name == name)
|
||||
weapon = query.first()
|
||||
mechanism, _ = re.subn(
|
||||
r"{(.*?)@(.*?)}", r"<span class='\2'>\1</span>", weapon.mechanism
|
||||
)
|
||||
if query.count() > 0:
|
||||
weapon = query.first()
|
||||
else:
|
||||
query = select(w for w in Shield if w.name == name)
|
||||
weapon = query.first()
|
||||
if weapon.mechanism:
|
||||
mechanism, _ = re.subn(
|
||||
r"{(.*?)@(.*?)}", r"<span class='\2'>\1</span>", weapon.mechanism
|
||||
)
|
||||
else:
|
||||
mechanism = ""
|
||||
stats_map = {
|
||||
1: "brutality",
|
||||
2: "survival",
|
||||
|
@ -35,7 +42,7 @@ def melee(name):
|
|||
"icon": base64.b64encode(weapon.icon),
|
||||
"mechanism": mechanism,
|
||||
"description": weapon.description,
|
||||
"stats": stats_map[weapon.stats]
|
||||
"stats": stats_map[weapon.stats],
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue