Added spells data, names spreadsheet
This commit is contained in:
1 parent
aebe890e3e
commit
3cc5bb079d
13 files changed
+394
-52
No files matched your search
@@ -9,7 +9,7 @@
|
||||
<div class="uk-flex uk-flex-bottom uk-flex-center uk-margin-large-bottom">
|
||||
<div>
|
||||
<label for="base_level">Base level of party to generate: </label>
|
||||
<input type="number" name="base_level" id="base_level" class="uk-input" value="{{ base_level if base_level else 1 }}" >
|
||||
<input type="number" name="base_level" id="base_level" class="uk-input" value="{{ base_level if base_level else 1 }}" min="0" max="14">
|
||||
</div>
|
||||
<div class="uk-margin-left">
|
||||
<button class="uk-button uk-button-primary" onclick="generateParty();">Generate</button>
|
||||
@@ -97,7 +97,7 @@
|
||||
</div>
|
||||
<ul uk-tab>
|
||||
<li class="uk-active"><a href="">Equipment</a></li>
|
||||
<li {% if not npc.spellcaster %}class="uk-disabled"{% endif %}><a href="">Spells</a></li>
|
||||
<li {% if not npc.is_divine_spellcaster and not npc.is_arcane_spellcaster %}class="uk-disabled"{% endif %}><a href="">Spells</a></li>
|
||||
</ul>
|
||||
<ul class="uk-switcher uk-margin">
|
||||
<li>
|
||||
@@ -130,31 +130,21 @@
|
||||
</table>
|
||||
</li>
|
||||
<li>
|
||||
<table class="uk-table uk-table-hover uk-table-small item-table">
|
||||
<table class="uk-table uk-table-hover uk-table-small spell-table">
|
||||
<thead>
|
||||
<tr> <th>Name</th><th>Worth</th><th>Thr</th><th>Dmg</th> </tr>
|
||||
<tr> <th>Name</th><th>Range</th><th>Duration</th><th>Level</th> </tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{ npc.melee.name }}</td>
|
||||
<td>{{ npc.melee.gp_value }}gp</td>
|
||||
<td>{{ npc.attack_throw }}</td>
|
||||
<td>{{ npc.melee.damage_die }}</td>
|
||||
</tr>
|
||||
{% if npc.ranged %}
|
||||
<tr>
|
||||
<td>{{ npc.ranged.name }}</td>
|
||||
<td>{{ npc.ranged.gp_value }}gp</td>
|
||||
<td>{{ npc.attack_throw }}</td>
|
||||
<td>{{ npc.ranged.damage_die }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
<tr>
|
||||
<td>{{ npc.armour.name }}</td>
|
||||
<td>{{ npc.armour.gp_value }}gp</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
{% for level in npc.spell_list() %}
|
||||
{% for spell in npc.spell_list()[level] %}
|
||||
<tr>
|
||||
<td data-spell-id="{{ spell.id }}" onclick="showSpellModal();">{{ spell.name }}</td>
|
||||
<td>{{ spell.range }}</td>
|
||||
<td>{{ spell.duration }}</td>
|
||||
<td>{{ spell.level_for(npc) }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</li>
|
||||
@@ -166,6 +156,23 @@
|
||||
|
||||
{% endif %}
|
||||
|
||||
<div id="spell-modal" uk-modal>
|
||||
<div class="uk-modal-dialog uk-margin-auto-vertical">
|
||||
<button class="uk-modal-close-default" type="button" uk-close></button>
|
||||
<div class="uk-modal-header">
|
||||
<h2 class="uk-modal-title"><span id="spell-modal-title">{Spell Title}</h2>
|
||||
</div>
|
||||
<div class="uk-modal-body">
|
||||
<ul>
|
||||
<li>Range: <span id="spell-modal-range">{Spell Range}</span></li>
|
||||
<li>Duration: <span id="spell-modal-duration">{Spell Duration}</span></li>
|
||||
<li><span id="spell-modal-school">{Spell School}</span></li>
|
||||
</ul>
|
||||
<p id="spell-modal-desc">{Spell Description}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="party-export-modal" uk-modal>
|
||||
<div class="uk-modal-dialog uk-margin-auto-vertical">
|
||||
<button class="uk-modal-close-default" type="button" uk-close></button>
|
||||
@@ -202,7 +209,7 @@
|
||||
<br>
|
||||
|
||||
<style>
|
||||
table.item-table, table.item-table th {
|
||||
table.item-table, table.item-table th, table.spell-table, table.spell-table th {
|
||||
font-size: 12px;
|
||||
}
|
||||
div.stat-block > div {
|
||||
@@ -237,13 +244,58 @@ div.acks-npc-card {
|
||||
|
||||
function generateParty() {
|
||||
let bl = document.querySelector('#base_level').value;
|
||||
if(bl < 0) { bl = 0; }
|
||||
if(bl > 14) { bl = 14; }
|
||||
window.location = "/npc/party/" + bl.toString();
|
||||
}
|
||||
|
||||
function showSpellModal() {
|
||||
spells = new Set();
|
||||
{% if party %}
|
||||
{% for npc in party %}
|
||||
{% for level in npc.spell_list() %}
|
||||
{% for spell in npc.spell_list()[level] %}
|
||||
spells.add({{ spell.roll20_format | tojson }});
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
var modal_spell, spell_id = event.target.dataset.spellId;
|
||||
for(var spell of spells) {
|
||||
if(spell.id == spell_id) {
|
||||
modal_spell = spell
|
||||
}
|
||||
}
|
||||
|
||||
// Fill in spell details
|
||||
document.querySelector('#spell-modal-title').innerText = modal_spell.name;
|
||||
document.querySelector('#spell-modal-desc').innerText = modal_spell.description;
|
||||
|
||||
if(spell.range) {
|
||||
document.querySelector('#spell-modal-range').innerText = modal_spell.range;
|
||||
}
|
||||
|
||||
if(spell.duration) {
|
||||
document.querySelector('#spell-modal-duration').innerText = modal_spell.duration;
|
||||
}
|
||||
|
||||
var school = '';
|
||||
if(modal_spell.is_arcane) {
|
||||
school += 'Arcane ' + modal_spell.arcane + ' ';
|
||||
}
|
||||
if(modal_spell.is_divine) {
|
||||
school += 'Divine ' + modal_spell.divine + ' ';
|
||||
}
|
||||
document.querySelector('#spell-modal-school').innerText = school;
|
||||
|
||||
UIkit.modal(document.querySelector('#spell-modal')).show();
|
||||
}
|
||||
|
||||
function showExportModal() {
|
||||
{% if party %}
|
||||
{% for npc in party %}
|
||||
party.push(JSON.parse('{{ npc.roll20_format | tojson }}'));
|
||||
party.push(JSON.parse('{{ npc.roll20_format | tojson }}'));
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
{% extends "base.html" %}
|
||||
{% set active_page = "spells" %}
|
||||
|
||||
{% block title %}Spell List{% endblock %}
|
||||
{% block content %}
|
||||
<div class="uk-flex uk-flex-center uk-margin-bottom uk-margin-top">
|
||||
<h1>Adventurer Conqueror King Spell List</h1>
|
||||
</div>
|
||||
<div class="uk-flex uk-flex-bottom uk-flex-center uk-margin-large-bottom">
|
||||
<div>
|
||||
<label for="base_level">TURN INTO FILTER AREA</label>
|
||||
<input type="number" name="base_level" id="base_level" class="uk-input" value="{{ base_level if base_level else 1 }}" >
|
||||
</div>
|
||||
<div class="uk-margin-left">
|
||||
<button class="uk-button uk-button-primary" onclick="generateParty();">Generate</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="uk-divider-icon">
|
||||
|
||||
{% if spells %}
|
||||
<div class="uk-grid-medium uk-grid-match uk-flex-center" uk-grid>
|
||||
{% for spell in spells %}
|
||||
<div class="acks-npc-card">
|
||||
<div class="uk-card uk-card-body uk-card-default uk-box-shadow-hover-large">
|
||||
<h4 class="uk-card-title uk-margin-small-top">{{ spell.name }}</h4>
|
||||
<ul>
|
||||
<li>Arcane: {{ spell.arcane }}</li>
|
||||
<li>Divine: {{ spell.divine }}</li>
|
||||
<li>Duration: {{ spell.duration }}</li>
|
||||
<li>Range: {{ spell.range }}</li>
|
||||
</ul>
|
||||
<div>
|
||||
{{ spell.description }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<style>
|
||||
table.item-table, table.item-table th {
|
||||
font-size: 12px;
|
||||
}
|
||||
div.stat-block > div {
|
||||
text-align: center;
|
||||
padding: 3px;
|
||||
width: 26px;
|
||||
}
|
||||
div.stat-block > div > div:first-child {
|
||||
font-weight: bold;
|
||||
color: green;
|
||||
}
|
||||
div.stat-block > div > div:last-child {
|
||||
font-weight: bold;
|
||||
font-size: 12px;
|
||||
color: #888;
|
||||
}
|
||||
div.save-block > div > div:first-child {
|
||||
font-weight: bold;
|
||||
color: purple;
|
||||
}
|
||||
div.save-block > div > div:last-child {
|
||||
font-weight: bold;
|
||||
font-size: 12px;
|
||||
color: #888;
|
||||
}
|
||||
div.acks-npc-card {
|
||||
width: 400px;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
Reference in new issue
Block a user