mirror of
https://github.com/Nighthawk42/roll20-character-sheets.git
synced 2026-09-01 12:42:32 +00:00
* Set theme jekyll-theme-time-machine * Add initial refactor scaffolding * Scaffolding and adding loops for skills * Save pug file * Delete translation file * Add back in box styles, begin left side of character sheet * Update grid to line up better, add more styling for columns * Remove more unused files * save outbreak * upload new header * save progress * save progress * saving progress * upload progress * saving progress * saving progress * small updates * start die roller * vitality finished * finished to Psyche * remove log * rename images * rename kits * fix swiming icon * rename swimming icon" * rename swimming icon for real * saving progress. finished kits * repeating skills working * rename images and save changes" * upload background * upload virus * save final draft * upate roll template * upade files * save translations * saving Outbreak changes * add preview * Delete _config.yml Co-authored-by: Kal Keckler <katealice.martin@gmail.com>
33 lines
1.1 KiB
JavaScript
33 lines
1.1 KiB
JavaScript
['Strength', 'Perception', 'Empathy', 'Willpower'].forEach((attribute) => {
|
|
on(`change:${attribute}_base change:${attribute}_bonus`, (eventInfo) => {
|
|
getAttrs([`${attribute}_base`, `${attribute}_bonus`], (v) => {
|
|
const base = parseInt(v[`${attribute}_base`]) || 0;
|
|
const bonus = parseInt(v[`${attribute}_bonus`]) || 0;
|
|
const total = Math.floor((bonus*10)+base);
|
|
|
|
console.log([`${attribute} : ${total}`]);
|
|
|
|
setAttrs({
|
|
[`${attribute}`]: total
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|
|
|
|
on("change:repeating_skills", (eventInfo) => {
|
|
getAttrs(['repeating_skills_attribute_base', 'repeating_skills_attribute_bonus'], (v) => {
|
|
const baseAttr = v.repeating_skills_attribute_base.slice(2, -1);
|
|
const bonusAttr = v.repeating_skills_attribute_bonus.slice(2, -1);
|
|
|
|
getAttrs([`${baseAttr}`, `${bonusAttr}`, 'repeating_skills_advancement'], (v) => {
|
|
let base = parseInt(v[`${baseAttr}`]) || 0;
|
|
let bonus = parseInt(v[`${bonusAttr}`]) || 0;
|
|
const adv = parseInt(v.repeating_skills_advancement) || 0;
|
|
|
|
setAttrs({
|
|
"repeating_skills_skill": Math.floor((base+bonus)+adv)
|
|
}, {silent:true});
|
|
});
|
|
});
|
|
}); |