Browse Source

Retitle ACKS to LoP on page headers, spoil shares calculator page

master
Brandon Cornejo 4 years ago
parent
commit
7ffbce83c1
  1. 2
      acks/npc/templates/generate_npc_party.html
  2. 2
      acks/npc/templates/generate_single_npc.html
  3. 2
      acks/npc/templates/spell_list.html
  4. 2
      acks/quest/templates/quest_detail.html
  5. 2
      acks/quest/templates/quest_list.html
  6. 4
      acks/templates/base.html
  7. 4
      acks/templates/index.html
  8. 6
      acks/templates/lair_gallery.html
  9. 2
      acks/templates/player_tokens.html
  10. 91
      acks/templates/shares_calc.html
  11. 2
      acks/templates/treasure.html
  12. 2
      acks/templates/wandering_monster.html
  13. 2
      acks/templates/wiki.html
  14. 2
      acks/templates/worldmap.html

2
acks/npc/templates/generate_npc_party.html

@ -4,7 +4,7 @@
{% block title %}NPC Party Generation{% endblock %} {% block title %}NPC Party Generation{% endblock %}
{% block content %} {% block content %}
<div class="uk-flex uk-flex-center uk-margin-bottom uk-margin-top"> <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>
<div class="uk-flex uk-flex-bottom uk-flex-center uk-margin-large-bottom"> <div class="uk-flex uk-flex-bottom uk-flex-center uk-margin-large-bottom">
<div> <div>

2
acks/npc/templates/generate_single_npc.html

@ -4,7 +4,7 @@
{% block title %}Single NPC Generation{% endblock %} {% block title %}Single NPC Generation{% endblock %}
{% block content %} {% block content %}
<div class="uk-flex uk-flex-center uk-margin-bottom uk-margin-top"> <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>
<div class="uk-flex uk-flex-bottom uk-flex-center uk-margin-large-bottom"> <div class="uk-flex uk-flex-bottom uk-flex-center uk-margin-large-bottom">
<div> <div>

2
acks/npc/templates/spell_list.html

@ -4,7 +4,7 @@
{% block title %}Spell List{% endblock %} {% block title %}Spell List{% endblock %}
{% block content %} {% block content %}
<div class="uk-flex uk-flex-center uk-margin-bottom uk-margin-top"> <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>
<div class="uk-flex uk-flex-bottom uk-flex-center uk-margin-small-bottom"> <div class="uk-flex uk-flex-bottom uk-flex-center uk-margin-small-bottom">
<div> <div>

2
acks/quest/templates/quest_detail.html

@ -5,7 +5,7 @@
{% block title %}ACKS Quest Detail{% endblock %} {% block title %}ACKS Quest Detail{% endblock %}
{% block content %} {% block content %}
<div class="uk-flex uk-flex-center uk-margin-bottom uk-margin-top"> <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> </div>
{% if quest %} {% if quest %}
<div class="uk-container uk-container-small"> <div class="uk-container uk-container-small">

2
acks/quest/templates/quest_list.html

@ -5,7 +5,7 @@
{% block title %}ACKS Quest List{% endblock %} {% block title %}ACKS Quest List{% endblock %}
{% block content %} {% block content %}
<div class="uk-flex uk-flex-center uk-margin-bottom uk-margin-top"> <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> </div>
{% if quest_map %} {% if quest_map %}
<div class="uk-flex uk-flex-bottom uk-flex-center uk-margin-large-bottom"> <div class="uk-flex uk-flex-bottom uk-flex-center uk-margin-large-bottom">

4
acks/templates/base.html

@ -28,7 +28,7 @@
<!doctype html> <!doctype html>
<html> <html>
<head> <head>
<title>{% block title %}{% endblock %} - Palisma ACKS</title>
<title>{% block title %}{% endblock %} - Legends of Palisma</title>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" contents="width=device-width, initial-scale=1"> <meta name="viewport" contents="width=device-width, initial-scale=1">
@ -61,7 +61,7 @@
<nav class="uk-navbar-container" uk-navbar> <nav class="uk-navbar-container" uk-navbar>
<div class="uk-navbar-left"> <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-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>
<div class="uk-navbar-center uk-visible@m"> <div class="uk-navbar-center uk-visible@m">
<ul class="uk-navbar-nav"> <ul class="uk-navbar-nav">

4
acks/templates/index.html

@ -1,10 +1,10 @@
{% extends "base.html" %} {% extends "base.html" %}
{% set active_page = "index" %} {% set active_page = "index" %}
{% block title %}ACKS Toolset Home{% endblock %}
{% block title %}Legends of Palisma Home{% endblock %}
{% block content %} {% block content %}
<div class="uk-flex uk-flex-center uk-margin-bottom uk-margin-top"> <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>
<div class="uk-flex uk-flex-bottom uk-flex-center uk-margin-medium uk-margin-large-bottom"> <div class="uk-flex uk-flex-bottom uk-flex-center uk-margin-medium uk-margin-large-bottom">
<div class="uk-container uk-container-small"> <div class="uk-container uk-container-small">

6
acks/templates/lair_gallery.html

@ -4,7 +4,7 @@
{% block title %}Dynamic Lairs{% endblock %} {% block title %}Dynamic Lairs{% endblock %}
{% block content %} {% block content %}
<div class="uk-flex uk-flex-center uk-margin-bottom uk-margin-top"> <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> </div>
<br/> <br/>
<div class="uk-container uk-container-small"> <div class="uk-container uk-container-small">
@ -37,8 +37,8 @@
{% endfor %} {% endfor %}
</ul> </ul>
</div> </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> </div>
</div> </div>

2
acks/templates/player_tokens.html

@ -4,7 +4,7 @@
{% block title %}Player Tokens{% endblock %} {% block title %}Player Tokens{% endblock %}
{% block content %} {% block content %}
<div class="uk-flex uk-flex-center uk-margin-bottom uk-margin-top"> <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> </div>
<br/> <br/>
<div class="uk-container uk-container-small"> <div class="uk-container uk-container-small">

91
acks/templates/shares_calc.html

@ -4,13 +4,13 @@
{% block title %}Spoil Shares Calculator{% endblock %} {% block title %}Spoil Shares Calculator{% endblock %}
{% block content %} {% block content %}
<div class="uk-flex uk-flex-center uk-margin-bottom uk-margin-top"> <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>
<div class="uk-grid-divider" uk-grid> <div class="uk-grid-divider" uk-grid>
<div class="uk-width-1-3"> <div class="uk-width-1-3">
<h3>Session Info</h3> <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"> <div class="uk-margin">
<label class="uk-form-label" for="player_count">Number of players</label> <label class="uk-form-label" for="player_count">Number of players</label>
<div class="uk-form-controls"> <div class="uk-form-controls">
@ -76,8 +76,14 @@
<h4>Player GP Share</h4> <h4>Player GP Share</h4>
<span id="pc_gp_share"></span> <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>
</div> </div>
<textarea id="export-data" class="uk-textarea uk-hidden"></textarea>
{% endblock %} {% endblock %}
{% block head %} {% block head %}
@ -87,17 +93,29 @@
{% block scripts %} {% block scripts %}
<script type="text/javascript"> <script type="text/javascript">
var lastCalculatedShares = null;
window.addEventListener('DOMContentLoaded', () => { window.addEventListener('DOMContentLoaded', () => {
var calc = document.querySelector('button#share_calc_button'); var calc = document.querySelector('button#share_calc_button');
calc.addEventListener("click", calculateShares); 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() { function calculateShares() {
document.querySelector('div#share_button_container').classList.remove('uk-hidden');
var player_shares = document.querySelector('table#player_shares > tbody'); var player_shares = document.querySelector('table#player_shares > tbody');
var hench_shares = document.querySelector('table#hench_shares > tbody'); var hench_shares = document.querySelector('table#hench_shares > tbody');
var pc_gp_share = document.querySelector('span#pc_gp_share');
player_shares.innerHTML = ''; player_shares.innerHTML = '';
hench_shares.innerHTML = ''; hench_shares.innerHTML = '';
pc_gp_share.innerText = '';
var player_count = parseInt(document.querySelector('select#player_count').value); var player_count = parseInt(document.querySelector('select#player_count').value);
var hench_count = parseInt(document.querySelector('input#hench_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 gp = parseInt(document.querySelector('input#gp_recovered').value);
var xp = parseInt(document.querySelector('input#xp_earned').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 total_xp = gp + xp;
let pc_base_xp_share = total_xp / (player_count + hench_count / 2.0); let pc_base_xp_share = total_xp / (player_count + hench_count / 2.0);
let response = '';
for(let i = 0; i < 5; i ++) { for(let i = 0; i < 5; i ++) {
// Build player rows // Build player rows
const row = document.createElement("tr"); const row = document.createElement("tr");
@ -141,5 +160,71 @@
let gpshare = Math.floor(gp / (player_count + hench_count / 6.0)) let gpshare = Math.floor(gp / (player_count + hench_count / 6.0))
pc_gp_share.appendChild(document.createTextNode(`${gpshare} gold per player.`)); 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> </script>
{% endblock %} {% endblock %}

2
acks/templates/treasure.html

@ -25,7 +25,7 @@
{% block title %}ACKS Treasure Generator{% endblock %} {% block title %}ACKS Treasure Generator{% endblock %}
{% block content %} {% block content %}
<div class="uk-flex uk-flex-center uk-margin-bottom uk-margin-top"> <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>
<div id="frame-container"> <div id="frame-container">
<iframe id="treasure-frame" src="http://autarch.co/treasure"/> <iframe id="treasure-frame" src="http://autarch.co/treasure"/>

2
acks/templates/wandering_monster.html

@ -4,7 +4,7 @@
{% block title %}Wandering Monsters{% endblock %} {% block title %}Wandering Monsters{% endblock %}
{% block content %} {% block content %}
<div class="uk-flex uk-flex-center uk-margin-bottom uk-margin-top"> <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> </div>
<form id="wandering_form" autocomplete="off"> <form id="wandering_form" autocomplete="off">

2
acks/templates/wiki.html

@ -4,7 +4,7 @@
{% block title %}ACKS Judge Wiki{% endblock %} {% block title %}ACKS Judge Wiki{% endblock %}
{% block content %} {% block content %}
<div class="uk-flex uk-flex-center uk-margin-bottom uk-margin-top"> <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>
<div id="frame-container"> <div id="frame-container">
<iframe id="wiki-frame" src="https://atr0phy.net/acks/wiki"></iframe> <iframe id="wiki-frame" src="https://atr0phy.net/acks/wiki"></iframe>

2
acks/templates/worldmap.html

@ -4,7 +4,7 @@
{% block title %}Maps{% endblock %} {% block title %}Maps{% endblock %}
{% block content %} {% block content %}
<div class="uk-flex uk-flex-center uk-margin-bottom uk-margin-top"> <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> </div>
<br/> <br/>
<div class="uk-container uk-container-small"> <div class="uk-container uk-container-small">

Loading…
Cancel
Save