Retitle ACKS to LoP on page headers, spoil shares calculator page
This commit is contained in:
parent
2e6b6c4f8a
commit
7ffbce83c1
@ -4,7 +4,7 @@
|
||||
{% block title %}NPC Party Generation{% endblock %}
|
||||
{% block content %}
|
||||
<div class="uk-flex uk-flex-center uk-margin-bottom uk-margin-top">
|
||||
<h1 class="uk-text-center"><strong>Adventurer Conqueror King</strong>NPC Party Generator</h1>
|
||||
<h1 class="uk-text-center"><strong>Legends of Palisma</strong>NPC Party Generator</h1>
|
||||
</div>
|
||||
<div class="uk-flex uk-flex-bottom uk-flex-center uk-margin-large-bottom">
|
||||
<div>
|
||||
|
@ -4,7 +4,7 @@
|
||||
{% block title %}Single NPC Generation{% endblock %}
|
||||
{% block content %}
|
||||
<div class="uk-flex uk-flex-center uk-margin-bottom uk-margin-top">
|
||||
<h1 class="uk-text-center"><strong>Adventurer Conqueror King</strong>NPC Generator</h1>
|
||||
<h1 class="uk-text-center"><strong>Legends of Palisma</strong>NPC Generator</h1>
|
||||
</div>
|
||||
<div class="uk-flex uk-flex-bottom uk-flex-center uk-margin-large-bottom">
|
||||
<div>
|
||||
|
@ -4,7 +4,7 @@
|
||||
{% block title %}Spell List{% endblock %}
|
||||
{% block content %}
|
||||
<div class="uk-flex uk-flex-center uk-margin-bottom uk-margin-top">
|
||||
<h1 class="uk-text-center"><strong>Adventurer Conqueror King</strong>Spell Reference</h1>
|
||||
<h1 class="uk-text-center"><strong>Legends of Palisma</strong>Spell Reference</h1>
|
||||
</div>
|
||||
<div class="uk-flex uk-flex-bottom uk-flex-center uk-margin-small-bottom">
|
||||
<div>
|
||||
|
@ -5,7 +5,7 @@
|
||||
{% block title %}ACKS Quest Detail{% endblock %}
|
||||
{% block content %}
|
||||
<div class="uk-flex uk-flex-center uk-margin-bottom uk-margin-top">
|
||||
<h1 class="uk-text-center"><strong>Adventurer Conqueror King</strong>Quest Detail</h1>
|
||||
<h1 class="uk-text-center"><strong>Legends of Palisma</strong>Quest Detail</h1>
|
||||
</div>
|
||||
{% if quest %}
|
||||
<div class="uk-container uk-container-small">
|
||||
|
@ -5,7 +5,7 @@
|
||||
{% block title %}ACKS Quest List{% endblock %}
|
||||
{% block content %}
|
||||
<div class="uk-flex uk-flex-center uk-margin-bottom uk-margin-top">
|
||||
<h1 class="uk-text-center"><strong>Adventurer Conqueror King</strong>Quest Board (Internal)</h1>
|
||||
<h1 class="uk-text-center"><strong>Legends of Palisma</strong>Quest Board (Internal)</h1>
|
||||
</div>
|
||||
{% if quest_map %}
|
||||
<div class="uk-flex uk-flex-bottom uk-flex-center uk-margin-large-bottom">
|
||||
|
@ -28,7 +28,7 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{% block title %}{% endblock %} - Palisma ACKS</title>
|
||||
<title>{% block title %}{% endblock %} - Legends of Palisma</title>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" contents="width=device-width, initial-scale=1">
|
||||
@ -61,7 +61,7 @@
|
||||
<nav class="uk-navbar-container" uk-navbar>
|
||||
<div class="uk-navbar-left">
|
||||
<a href="" class="uk-hidden@m uk-button-default uk-margin-small-left uk-margin-small-right" uk-toggle="target: #offcanvas-nav" uk-icon="menu"></a>
|
||||
<a href="" class="uk-navbar-item uk-logo">Palisma ACKS</a>
|
||||
<a href="{{ url_for('default_views.index') }}" class="uk-navbar-item uk-logo">Palisma ACKS</a>
|
||||
</div>
|
||||
<div class="uk-navbar-center uk-visible@m">
|
||||
<ul class="uk-navbar-nav">
|
||||
|
@ -1,10 +1,10 @@
|
||||
{% extends "base.html" %}
|
||||
{% set active_page = "index" %}
|
||||
|
||||
{% block title %}ACKS Toolset Home{% endblock %}
|
||||
{% block title %}Legends of Palisma Home{% endblock %}
|
||||
{% block content %}
|
||||
<div class="uk-flex uk-flex-center uk-margin-bottom uk-margin-top">
|
||||
<h1 class="uk-text-center"><strong>Adventurer Conqueror King</strong>Home</h1>
|
||||
<h1 class="uk-text-center"><strong>Legends of Palisma</strong>Home</h1>
|
||||
</div>
|
||||
<div class="uk-flex uk-flex-bottom uk-flex-center uk-margin-medium uk-margin-large-bottom">
|
||||
<div class="uk-container uk-container-small">
|
||||
|
@ -4,7 +4,7 @@
|
||||
{% block title %}Dynamic Lairs{% endblock %}
|
||||
{% block content %}
|
||||
<div class="uk-flex uk-flex-center uk-margin-bottom uk-margin-top">
|
||||
<h1 class="uk-text-center"><strong>Adventurer Conqueror King</strong>Dynamic Lairs</h1>
|
||||
<h1 class="uk-text-center"><strong>Legends of Palisma</strong>Dynamic Lairs</h1>
|
||||
</div>
|
||||
<br/>
|
||||
<div class="uk-container uk-container-small">
|
||||
@ -37,8 +37,8 @@
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
<a class="uk-position-center-left uk-position-small uk-hidden-hover" href="#" uk-slidenav-previous uk-slider-item="previous"></a>
|
||||
<a class="uk-position-center-right uk-position-small uk-hidden-hover" href="#" uk-slidenav-next uk-slider-item="next"></a>
|
||||
<a class="uk-position-center-left-out" href="#" uk-slidenav-previous uk-slider-item="previous"></a>
|
||||
<a class="uk-position-center-right-out" href="#" uk-slidenav-next uk-slider-item="next"></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -4,7 +4,7 @@
|
||||
{% block title %}Player Tokens{% endblock %}
|
||||
{% block content %}
|
||||
<div class="uk-flex uk-flex-center uk-margin-bottom uk-margin-top">
|
||||
<h1 class="uk-text-center"><strong>Adventurer Conqueror King</strong>Player Tokens</h1>
|
||||
<h1 class="uk-text-center"><strong>Legends of Palisma</strong>Player Tokens</h1>
|
||||
</div>
|
||||
<br/>
|
||||
<div class="uk-container uk-container-small">
|
||||
|
@ -4,13 +4,13 @@
|
||||
{% block title %}Spoil Shares Calculator{% endblock %}
|
||||
{% block content %}
|
||||
<div class="uk-flex uk-flex-center uk-margin-bottom uk-margin-top">
|
||||
<h1 class="uk-text-center"><strong>Adventurer Conqueror King</strong>Spoil Shares Calculator</h1>
|
||||
<h1 class="uk-text-center"><strong>Legends of Palisma</strong>Spoil Shares Calculator</h1>
|
||||
</div>
|
||||
|
||||
<div class="uk-grid-divider" uk-grid>
|
||||
<div class="uk-width-1-3">
|
||||
<h3>Session Info</h3>
|
||||
<form class="uk-form-horizontal uk-margin-large">
|
||||
<form class="uk-form-horizontal uk-margin-large" autocomplete=off>
|
||||
<div class="uk-margin">
|
||||
<label class="uk-form-label" for="player_count">Number of players</label>
|
||||
<div class="uk-form-controls">
|
||||
@ -76,8 +76,14 @@
|
||||
|
||||
<h4>Player GP Share</h4>
|
||||
<span id="pc_gp_share"></span>
|
||||
|
||||
<div id="share_button_container" class="uk-margin-large-top uk-hidden">
|
||||
<button type="button" class="uk-button uk-button-secondary uk-button-small" id="export_button" title="Will copy a chat message to be pasted into Roll20.">Share</button>
|
||||
<button type="button" class="uk-button uk-button-default uk-button-small" id="clear_button">Reset</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<textarea id="export-data" class="uk-textarea uk-hidden"></textarea>
|
||||
{% endblock %}
|
||||
|
||||
{% block head %}
|
||||
@ -87,17 +93,29 @@
|
||||
|
||||
{% block scripts %}
|
||||
<script type="text/javascript">
|
||||
var lastCalculatedShares = null;
|
||||
|
||||
window.addEventListener('DOMContentLoaded', () => {
|
||||
var calc = document.querySelector('button#share_calc_button');
|
||||
calc.addEventListener("click", calculateShares);
|
||||
|
||||
var share = document.querySelector('button#export_button');
|
||||
share.addEventListener("click", clipboardShare);
|
||||
|
||||
var clear = document.querySelector('button#clear_button');
|
||||
clear.addEventListener("click", resetPage);
|
||||
});
|
||||
|
||||
function calculateShares() {
|
||||
document.querySelector('div#share_button_container').classList.remove('uk-hidden');
|
||||
|
||||
var player_shares = document.querySelector('table#player_shares > tbody');
|
||||
var hench_shares = document.querySelector('table#hench_shares > tbody');
|
||||
var pc_gp_share = document.querySelector('span#pc_gp_share');
|
||||
|
||||
player_shares.innerHTML = '';
|
||||
hench_shares.innerHTML = '';
|
||||
pc_gp_share.innerText = '';
|
||||
|
||||
var player_count = parseInt(document.querySelector('select#player_count').value);
|
||||
var hench_count = parseInt(document.querySelector('input#hench_count').value);
|
||||
@ -105,10 +123,11 @@
|
||||
var gp = parseInt(document.querySelector('input#gp_recovered').value);
|
||||
var xp = parseInt(document.querySelector('input#xp_earned').value);
|
||||
|
||||
lastCalculatedShares = {pc: player_count, hc: hench_count, gp: gp, xp: xp};
|
||||
|
||||
let total_xp = gp + xp;
|
||||
let pc_base_xp_share = total_xp / (player_count + hench_count / 2.0);
|
||||
|
||||
let response = '';
|
||||
for(let i = 0; i < 5; i ++) {
|
||||
// Build player rows
|
||||
const row = document.createElement("tr");
|
||||
@ -141,5 +160,71 @@
|
||||
let gpshare = Math.floor(gp / (player_count + hench_count / 6.0))
|
||||
pc_gp_share.appendChild(document.createTextNode(`${gpshare} gold per player.`));
|
||||
}
|
||||
|
||||
function clipboardShare() {
|
||||
if(!lastCalculatedShares) {
|
||||
return;
|
||||
}
|
||||
|
||||
var btn = document.querySelector('button#export_button');
|
||||
btn.classList.remove('uk-animation-shake');
|
||||
|
||||
var lcs = lastCalculatedShares;
|
||||
var [player_count, hench_count, gp, xp] = [lcs.pc, lcs.hc, lcs.gp, lcs.xp];
|
||||
|
||||
let total_xp = gp + xp;
|
||||
let pc_base_xp_share = total_xp / (player_count + hench_count / 2.0);
|
||||
|
||||
var [ps, hs] = [{}, {}];
|
||||
for(let i = 0; i < 5; i ++) {
|
||||
// Build player rows
|
||||
ps[`@ ${5 * i}%`] = `${Math.floor(pc_base_xp_share * (1 + 0.05 * i))} xp`;
|
||||
|
||||
// Build hench rows
|
||||
hs[`@ ${5 * i}%`] = `${Math.floor(pc_base_xp_share * (1 + 0.05 * i) / 2.0)} xp`;
|
||||
}
|
||||
|
||||
let gpshare = Math.floor(gp / (player_count + hench_count / 6.0))
|
||||
|
||||
{% raw %}
|
||||
let response = '&{template:acks}{{name=Spoil Shares}}';
|
||||
response += `{{**Player Gold Share** = [[${gpshare}]]}}`;
|
||||
response += '{{**Player XP Share**=\n'
|
||||
for(const [k, v] of Object.entries(ps)) {
|
||||
response += `${k} bonus: *${v}*\n`;
|
||||
}
|
||||
response += '}}';
|
||||
|
||||
response += '{{**Henchmen XP Share**=\n'
|
||||
for(const [k, v] of Object.entries(hs)) {
|
||||
response += `${k} bonus: *${v}*\n`;
|
||||
}
|
||||
response += `}}{{desc=${player_count} players, ${hench_count} henchmen sharing ${gp} gold XP and ${xp} monster XP.}}`;
|
||||
{% endraw %}
|
||||
|
||||
let export_data = document.querySelector('#export-data');
|
||||
export_data.value = response;
|
||||
export_data.classList.remove('uk-hidden');
|
||||
|
||||
export_data.select();
|
||||
document.execCommand("copy");
|
||||
|
||||
export_data.classList.add('uk-hidden');
|
||||
|
||||
btn.classList.add('uk-animation-shake');
|
||||
}
|
||||
|
||||
function resetPage() {
|
||||
document.querySelector('div#share_button_container').classList.add('uk-hidden');
|
||||
document.querySelector('table#player_shares > tbody').innerHTML = '';
|
||||
document.querySelector('table#hench_shares > tbody').innerHTML = '';
|
||||
document.querySelector('span#pc_gp_share').innerText = '';
|
||||
|
||||
document.querySelector('select#player_count').value = 1;
|
||||
document.querySelector('input#hench_count').value = 0;
|
||||
|
||||
document.querySelector('input#gp_recovered').value = 0;
|
||||
document.querySelector('input#xp_earned').value = 0;
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
@ -25,7 +25,7 @@
|
||||
{% block title %}ACKS Treasure Generator{% endblock %}
|
||||
{% block content %}
|
||||
<div class="uk-flex uk-flex-center uk-margin-bottom uk-margin-top">
|
||||
<h1 class="uk-text-center"><strong>Adventurer Conqueror King</strong>Treasure Generator</h1>
|
||||
<h1 class="uk-text-center"><strong>Legends of Palisma</strong>Treasure Generator</h1>
|
||||
</div>
|
||||
<div id="frame-container">
|
||||
<iframe id="treasure-frame" src="http://autarch.co/treasure"/>
|
||||
|
@ -4,7 +4,7 @@
|
||||
{% block title %}Wandering Monsters{% endblock %}
|
||||
{% block content %}
|
||||
<div class="uk-flex uk-flex-center uk-margin-bottom uk-margin-top">
|
||||
<h1 class="uk-text-center"><strong>Adventurer Conqueror King</strong>Wandering Monsters</h1>
|
||||
<h1 class="uk-text-center"><strong>Legends of Palisma</strong>Wandering Monsters</h1>
|
||||
</div>
|
||||
|
||||
<form id="wandering_form" autocomplete="off">
|
||||
|
@ -4,7 +4,7 @@
|
||||
{% block title %}ACKS Judge Wiki{% endblock %}
|
||||
{% block content %}
|
||||
<div class="uk-flex uk-flex-center uk-margin-bottom uk-margin-top">
|
||||
<h1 class="uk-text-center"><strong>Adventurer Conqueror King</strong>Wiki</h1>
|
||||
<h1 class="uk-text-center"><strong>Legends of Palisma</strong>Wiki</h1>
|
||||
</div>
|
||||
<div id="frame-container">
|
||||
<iframe id="wiki-frame" src="https://atr0phy.net/acks/wiki"></iframe>
|
||||
|
@ -4,7 +4,7 @@
|
||||
{% block title %}Maps{% endblock %}
|
||||
{% block content %}
|
||||
<div class="uk-flex uk-flex-center uk-margin-bottom uk-margin-top">
|
||||
<h1 class="uk-text-center"><strong>Adventurer Conqueror King</strong>Maps</h1>
|
||||
<h1 class="uk-text-center"><strong>Legends of Palisma</strong>Maps</h1>
|
||||
</div>
|
||||
<br/>
|
||||
<div class="uk-container uk-container-small">
|
||||
|
Loading…
x
Reference in New Issue
Block a user