Files
roll20-character-sheets/Quest-boardgame/Quest.html
T
2024-06-03 13:15:14 -04:00

253 lines
12 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!-- QUest HTML */ -->
<!-- Version 1.0 -->
<div class="ept">
<!-- Hidden Values -->
<input type='hidden' class='profession-select' name='attr_profession' value='Warrior' />
<!-- Title -->
<h2 class="title"><span class="underline">Quest</span>: Character Sheet</h2>
<!-- Basics Section -->
<div class="section">
<span class="flex-row"><label>Player Name</label><input class="fill" type="text" name="attr_character_name"/></span>
<span class="flex-row">
<label>Profession</label>
<select class="profession-select fill" name="attr_profession" title="@{Profession}">
<option value="Warrior" selected="selected">Warrior</option>
<option value="Priest">Priest</option>
<option value="Magic-User">Magic User</option>
</select>
</span>
<div class="grid-4">
<!-- <span class="flex-row grid-4-span-2"><label >Kaitar</label><input class="fill nospin" type="number" name="attr_kaitar" title="@{kaitar}" value="0" min="0" /></span> -->
<span class="flex-row grid-4-span-2"><label >Kaitar</label><span class="fill worker" name="attr_kaitar"></span> </span>
<span class="flex-row grid-4-span-2"><label >Level</label><span class="fill worker" name="attr_level"></span></span>
</div>
</div>
<!-- END Basics Section -->
<!-- Equipment Section -->
<div class="grid-4">
<span class="flex-row grid-4-span-2">
<div class="section">
<label class="flex-row label">Equipment</label>
<div class="checklist">
<div class="items">
<div class="skill-set">
<input class="skill-checkbox" type="checkbox" name="attr_sword" value="yes" />
<label class="skill-label">Sword +1</label>
</div>
<!-- <label class="flex-row label">Eyes</label> -->
<div class="skill-set">
<input class="skill-checkbox" type="checkbox" name="attr_unconquerable" value="yes" />
<label class="skill-label">Eye of the Unconquerable</label>
</div>
<div class="skill-set">
<input class="skill-checkbox" type="checkbox" name="attr_madness" value="yes" />
<label class="skill-label">Eye of Madness</label>
</div>
<div class="skill-set">
<input class="skill-checkbox" type="checkbox" name="attr_kramighty" value="yes" />
<label class="skill-label">Eye of Kra the Mighty</label>
</div>
<div class="skill-set">
<input class="skill-checkbox" type="checkbox" name="attr_ragingpower" value="yes" />
<label class="skill-label">Eye of Raging Power</label>
</div>
</div>
</div>
</div>
</span>
<span class="flex-row grid-4-span-2">
<div class="spells section">
<div class="prof-skill-select flex-row">
<span class="flex-row label-prof"><label class="label">Spells: </label>
<label class="label label-profession-warrior">Warrior</label>
<label class="label label-profession-priest">Priest</label>
<label class="label label-profession-magicuser">Magic&nbsp;User</label>
</span>
</div>
<div class="profession-warrior">
<div class="skill-set">
<label class="skill-label tab1">None</label>
</div>
</div>
<!-- Spells Section -->
<div class="profession-magicuser">
<span class="flex-row"><label>No. of spells</label><span class="fill worker" name="attr_spells"></span></span>
<span class="flex-row fill"><label>Control Person</label><input class="fill" type="text" name="attr_spell_controlperson" /></span>
<span class="flex-row fill"><label>Doom Kill</label><input class="fill" type="text" name="attr_spell_doomkill" /></span>
<span class="flex-row fill"><label>Energy Bolt</label><input class="fill" type="text" name="attr_spell_energybolt" /></span>
<span class="flex-row fill"><label>Walls</label><input class="fill" type="text" name="attr_spell_walls" /></span>
</div>
<div class="profession-priest">
<span class="flex-row"><label>Number of spells</label><span class="fill worker" name="attr_spells"></span></span>
<span class="flex-row tab1 fill"><label>Control Creatures</label><input class="fill" type="text" name="attr_spell_controlcreatures" /></span>
<span class="flex-row tab1 fill"><label>Creatures</label><input class="fill" type="text" name="attr_spell_creatures" /></span>
<span class="flex-row tab1 fill"><label>Fear</label><input class="fill" type="text" name="attr_spell_fear" /></span>
<span class="flex-row tab1 fill"><label>Silver Halo</label><input class="fill" type="text" name="attr_spell_silverhalo" /></span>
</div>
</div>
</span>
</div>
<!-- Treasures Section -->
<div class="treasure section">
<div class="grid-4">
<span class="flex-row grid-4-span-3 label"><label class="">Treasure Found</label></span>
<span class="flex-row grid-4-span-1"><label class="">kaitars</label></span>
</div>
<fieldset class="repeating_treasure">
<div class="grid-4">
<input class="flex-row grid-4-span-3 fill" type="text" name="attr_treasure" />
<input class="flex-row grid-4-span-1 fill right" type="text" name="attr_kaitar_treasure" />
</div>
</fieldset>
</div>
<!-- Monsters Section -->
<div class="monsters section">
<div class="grid-4">
<span class="flex-row grid-4-span-3 label"><label class="">Mosters Killed</label></span>
<span class="flex-row grid-4-span-1"><label class="">kaitars</label></span>
</div>
<fieldset class="repeating_monster">
<div class="grid-4">
<select class="flex-row grid-4-span-3 fill" name="attr_monster">
<option value="none" selected="selected">-- choose one --</option>
<option value="Ahoggya">Ahoggya</option>
<option value="Aq a a">Aqaa</option>
<option value="Birdlu">Birdlu</option>
<option value="Chne lh">Chnelh</option>
<option value="Hli ir">Hliir </option>
<option value="Hly ss">Hlyss</option>
<option value="Hra">Hra</option>
<option value="Ka yi">Kayi</option>
<option value="Mr ur">Mrur</option>
<option value="Nshe">Nshe</option>
<option value="Nga yu">Ngayu</option>
<option value="Ngo ro">Ngoro</option>
<option value="Qo l">Qol</option>
<option value="Qumqu m">Qumqum</option>
<option value="Ru u">Ruu</option>
<option value="She n">Shen</option>
<option value="Shunned Ones">Shunned Ones</option>
<option value="Sro">Sro</option>
<option value="Ssu">Ssu</option>
<option value="Tsu uru">Tsuuru</option>
<option value="Ye leth">Yeleth</option>
<option value="Priest">Priest</option>
<option value="Priest, 3rd Level">Priest, 3rd Level</option>
<option value="Warrior">Warrior</option>
<option value="Warrior, 3rd Level">Warrior, 3rd Level</option>
<option value="Magic User">Magic User</option>
<option value="Magic User, 3rd Level">Magic User, 3rd Level</option>
</select>
<input class="flex-row grid-4-span-1 fill right" type="text" name="attr_kaitar_monster" />
</div>
</fieldset>
</div>
<!-- Skip Turn Tracker Section -->
<div class="turn-tracker">
<label class="skill-label" >Skip Turn Tracker</label>
<span class="flex-row skip_turn_tracker spell-slots-row">
<input class="spell-slot" type="checkbox" name="attr_skip_turn_1"/>
<input class="spell-slot" type="checkbox" name="attr_skip_turn_2"/>
<input class="spell-slot" type="checkbox" name="attr_skip_turn_3"/>
<input class="spell-slot" type="checkbox" name="attr_skip_turn_4"/>
<input class="spell-slot" type="checkbox" name="attr_skip_turn_5"/>
<input class="spell-slot" type="checkbox" name="attr_skip_turn_6"/>
<input class="spell-slot" type="checkbox" name="attr_skip_turn_7"/>
<input class="spell-slot" type="checkbox" name="attr_skip_turn_8"/>
<input class="spell-slot" type="checkbox" name="attr_skip_turn_9"/>
<input class="spell-slot" type="checkbox" name="attr_skip_turn_10"/>
<input class="spell-slot" type="checkbox" name="attr_skip_turn_11"/>
<input class="spell-slot" type="checkbox" name="attr_skip_turn_12"/>
</span>
</div>
</div>
<!-- Sheet Workers -->
<script type="text/worker">
// Auto Leveler
on("change:kaitar sheet:opened", function() {
getAttrs(["KAITAR"], function(values) {
let kaitar = parseInt(values.KAITAR)||0;
let level = 1;
let spells = 3;
// Strength modifiers
if (kaitar >= 30000) {
level = 4;
spells = 6;
} else if (kaitar >= 20000) {
level = 3;
spells = 5;
} else if (kaitar >= 10000) {
level = 2;
spells = 4;
}
setAttrs({
level: level,
spells: spells,
});
});
});
/* ===== PARAMETERS ==========
destinations = the name of the attribute that stores the total quantity
can be a single attribute, or an array: ['total_cost', 'total_weight']
If more than one, the matching fields must be in the same order.
section = name of repeating fieldset, without the repeating_
fields = the name of the attribute field to be summed
destination and fields both can be a single attribute: 'weight'
or an array of attributes: ['weight','number','equipped']
*/
const repeatingSum = (destinations, section, fields) => {
if (!Array.isArray(destinations)) destinations = [destinations.replace(/\s/g, '').split(',')];
if (!Array.isArray(fields)) fields = [fields.replace(/\s/g, '').split(',')];
getSectionIDs(`repeating_${section}`, idArray => {
const attrArray = idArray.reduce((m, id) => [...m, ...(fields.map(field => `repeating_${section}_${id}_${field}`))], []);
getAttrs([...attrArray], v => {
const getValue = (section, id, field) => v[`repeating_${section}_${id}_${field}`] === 'on' ? 1 : parseFloat(v[`repeating_${section}_${id}_${field}`]) || 0;
const commonMultipliers = (fields.length <= destinations.length) ? [] : fields.splice(destinations.length, fields.length - destinations.length);
const output = {};
destinations.forEach((destination, index) => {
output[destination] = idArray.reduce((total, id) => total + getValue(section, id, fields[index]) * commonMultipliers.reduce((subtotal, mult) => subtotal * getValue(section, id, mult), 1), 0);
});
setAttrs(output);
});
});
};
on('change:repeating_treasure remove:repeating_treasure change:repeating_monster remove:repeating_monster sheet:opened', function() {
repeatingSum("kaitar_total_treasure","treasure","kaitar_treasure");
repeatingSum("kaitar_total_monster","monster","kaitar_monster");
});
on("change:kaitar_total_treasure change:kaitar_total_monster sheet:opened", function() {
getAttrs(["KAITAR_TOTAL_TREASURE", "KAITAR_TOTAL_MONSTER"], function(values) {
let kaitar_total_treasure = parseInt(values.KAITAR_TOTAL_TREASURE)||0;
let kaitar_total_monster = parseInt(values.KAITAR_TOTAL_MONSTER)||0;
let kaitar_total = kaitar_total_treasure + kaitar_total_monster;
setAttrs({ kaitar: kaitar_total });
});
});
</script>
<!-- END charsheet EPT -->