From ff9452ec3dd9d61ed706a55c11ac4f8e240c353a Mon Sep 17 00:00:00 2001 From: tmont Date: Tue, 16 Feb 2021 09:03:42 -0800 Subject: [PATCH] items, weapons, armor, accessories --- data/items.js | 2 +- web/server.js | 28 +++++++++++++++++++++++++ web/views/accessories.pug | 44 +++++++++++++++++++++++++++++++++++++++ web/views/armor.pug | 42 +++++++++++++++++++++++++++++++++++++ web/views/items.pug | 22 ++++++++++++++++++++ web/views/master.pug | 13 +++++++++++- web/views/weapons.pug | 27 ++++++++++++++++++++++++ 7 files changed, 176 insertions(+), 2 deletions(-) create mode 100644 web/views/accessories.pug create mode 100644 web/views/armor.pug create mode 100644 web/views/items.pug create mode 100644 web/views/weapons.pug diff --git a/data/items.js b/data/items.js index 5114f12..4e88470 100644 --- a/data/items.js +++ b/data/items.js @@ -222,7 +222,7 @@ exports.items = [ item('S Dstry', 100, 'Defense2', [ polasu ]), item('B Aglty', 100, 'Agility', [ pang, padal, pasanda, palsu, airship ]), item('Mirror', 200, 'Reflect Petrify', [ zellis, pang, pandam, guanta, ligena, palsu, airship ]), - item('Harp', 500, 'Prevents Vacuum1/2', [ polasu, bilthem, ligena, airship ]), + item('Harp', 500, 'Prevents Vacuum', [ polasu, bilthem, ligena, airship ]), item('B Fire', 20, 'Fire1', [ bone, guanta ]), item('B Ice', 20, 'Ice1', [ dowaine, belaine, bugask ]), item('B Fossl', 100, 'Petrify', [ bonro, pang, bugask ]), diff --git a/web/server.js b/web/server.js index 7038ba3..6b6beb8 100644 --- a/web/server.js +++ b/web/server.js @@ -36,6 +36,34 @@ app.get('/exp', (req, res) => { }); }); +app.get('/weapons', (req, res) => { + res.render('weapons', { + context: 'weapons', + weapons: items.weapons, + }); +}); + +app.get('/armor', (req, res) => { + res.render('armor', { + context: 'armor', + armor: items.armor, + }); +}); + +app.get('/accessories', (req, res) => { + res.render('accessories', { + context: 'accessories', + accessories: items.accessories, + }); +}); + +app.get('/items', (req, res) => { + res.render('items', { + context: 'items', + items: items.items, + }); +}); + const port = process.env.PORT || 18000; const server = app.listen(port, () => { diff --git a/web/views/accessories.pug b/web/views/accessories.pug new file mode 100644 index 0000000..1dbc1b7 --- /dev/null +++ b/web/views/accessories.pug @@ -0,0 +1,44 @@ +extends master.pug + +block tab-content + +apprenticeFilterForm() + + div.table-responsive + table.table.table-sm.table-borderless.table-hover.table-striped + thead: tr + +sortHeader('Name') + +sortHeader('Defense') + +sortHeader('Cost') + +sortHeader('Fire') + +sortHeader('Ice') + +sortHeader('Thunder') + +sortHeader('Vacuum') + +sortHeader('Debuff') + th.align-middle Users + th.align-middle Locations + tbody: each item in accessories + tr( + data-name=item.name + data-defense=item.defense + data-cost=item.cost + data-res-fire=item.resistance.fire + data-res-ice=item.resistance.ice + data-res-thunder=item.resistance.thunder + data-res-vacuum=item.resistance.vacuum + data-res-debuff=item.resistance.debuff + ) + td: strong= item.name + td.text-right: code= item.defense + td.text-right: code= item.cost.toLocaleString() + td.text-right: code= item.resistance.fire + td.text-right: code= item.resistance.ice + td.text-right: code= item.resistance.thunder + td.text-right: code= item.resistance.vacuum + td.text-right: code= item.resistance.debuff + td: ul.list-horizontal + each char in item.users + li= char + td: ul.list-horizontal + each location in item.locations + li= location + diff --git a/web/views/armor.pug b/web/views/armor.pug new file mode 100644 index 0000000..dc97807 --- /dev/null +++ b/web/views/armor.pug @@ -0,0 +1,42 @@ +extends master.pug + +block tab-content + div.table-responsive + table.table.table-sm.table-borderless.table-hover.table-striped + thead: tr + +sortHeader('Name') + +sortHeader('Defense') + +sortHeader('Cost') + +sortHeader('Fire') + +sortHeader('Ice') + +sortHeader('Thunder') + +sortHeader('Vacuum') + +sortHeader('Debuff') + th.align-middle Users + th.align-middle Locations + tbody: each item in armor + tr( + data-name=item.name + data-defense=item.defense + data-cost=item.cost + data-res-fire=item.resistance.fire + data-res-ice=item.resistance.ice + data-res-thunder=item.resistance.thunder + data-res-vacuum=item.resistance.vacuum + data-res-debuff=item.resistance.debuff + ) + td: strong= item.name + td.text-right: code= item.defense + td.text-right: code= item.cost.toLocaleString() + td.text-right: code= item.resistance.fire + td.text-right: code= item.resistance.ice + td.text-right: code= item.resistance.thunder + td.text-right: code= item.resistance.vacuum + td.text-right: code= item.resistance.debuff + td: ul.list-horizontal + each char in item.users + li= char + td: ul.list-horizontal + each location in item.locations + li= location + diff --git a/web/views/items.pug b/web/views/items.pug new file mode 100644 index 0000000..3d6639a --- /dev/null +++ b/web/views/items.pug @@ -0,0 +1,22 @@ +extends master.pug + +block tab-content + div.row: div.col-12: div.table-responsive + table.table.table-sm.table-borderless.table-hover.table-striped + thead: tr + +sortHeader('Name') + +sortHeader('Cost') + th.align-middle Effect + th.align-middle Locations + tbody: each item in items + tr( + data-name=item.name + data-cost=item.cost + ) + td: strong= item.name + td.text-right: code= item.cost.toLocaleString() + td: em= item.effect + td: ul.list-horizontal + each location in item.locations + li= location + diff --git a/web/views/master.pug b/web/views/master.pug index c40fe98..8edda2b 100644 --- a/web/views/master.pug +++ b/web/views/master.pug @@ -20,11 +20,22 @@ html else small: em.text-muted= text || 'n/a' + mixin apprenticeFilterForm() + form.apprentice-filter-form: div.d-flex.justify-content-center + each apprentice in [ 'Esuna', 'Kamil', 'Olvan', 'Lejes', 'Lux', 'Valsu', 'Wilme' ] + div.form-check-inline + - const id = 'apprentice-' + apprentice; + input.form-check-input(type="checkbox" name=apprentice id=id) + label.form-check-label(for=id)= apprentice + div.container-fluid - ul.nav.nav-tabs.mt-4.px-4 + ul.nav.nav-tabs.mt-4.px-4.position-sticky(style="top: 0; background-color: white;") li.nav-item: a.nav-link(href="/enemies" class=(context === 'enemies' ? 'active' : '')) Enemies li.nav-item: a.nav-link(href="/spells" class=(context === 'spells' ? 'active' : '')) Spells li.nav-item: a.nav-link(href="/items" class=(context === 'items' ? 'active' : '')) Items + li.nav-item: a.nav-link(href="/weapons" class=(context === 'weapons' ? 'active' : '')) Weapons + li.nav-item: a.nav-link(href="/armor" class=(context === 'armor' ? 'active' : '')) Armor + li.nav-item: a.nav-link(href="/accessories" class=(context === 'accessories' ? 'active' : '')) Accessories li.nav-item: a.nav-link(href="/exp" class=(context === 'exp' ? 'active' : '')) Experience li.nav-item: a.nav-link(href="/calc" class=(context === 'calc' ? 'active' : '')) Calculations div.tab-content diff --git a/web/views/weapons.pug b/web/views/weapons.pug new file mode 100644 index 0000000..da8a937 --- /dev/null +++ b/web/views/weapons.pug @@ -0,0 +1,27 @@ +extends master.pug + +block tab-content + div.row: div.col-12.col-md-6: div.table-responsive + table.table.table-sm.table-borderless.table-hover.table-striped + thead: tr + +sortHeader('Name') + +sortHeader('Power') + +sortHeader('Cost') + th.align-middle Users + th.align-middle Locations + tbody: each weapon in weapons + tr( + data-name=weapon.name + data-power=weapon.attack + data-cost=weapon.cost + ) + td: strong= weapon.name + td.text-right: code= weapon.attack + td.text-right: code= weapon.cost.toLocaleString() + td: ul.list-horizontal + each char in weapon.users + li= char + td: ul.list-horizontal + each location in weapon.locations + li= location +