Files
foundry-Slamother/_macros/hotbar_1e/panic_check.js
T
2023-10-09 13:12:55 -07:00

65 lines
2.5 KiB
JavaScript
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.
//init vars
let macroTarget = game.settings.get('mosh','macroTarget');
//warn user if character is not selected
if ((macroTarget === 'character' && !game.user.character) || (macroTarget === 'token' && !canvas.tokens.controlled.length)) {
//warn player
game.mosh.noCharSelected();
//else pop up the dialog
} else {
//pop up the panic check dialog box
new Dialog({
title: `Panic Check`,
content: `
<style>
.macro_window{
background: rgb(230,230,230);
border-radius: 9px;
}
.macro_img{
display: flex;
justify-content: center;
}
.macro_desc{
font-family: "Roboto", sans-serif;
font-size: 10.5pt;
font-weight: 400;
padding-top: 8px;
padding-right: 8px;
padding-bottom: 8px;
}
.grid-2col {
display: grid;
grid-column: span 2 / span 2;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 2px;
padding: 0;
}
</style>
<div class ="macro_window" style="margin-bottom : 7px;">
<div class="grid grid-2col" style="grid-template-columns: 150px auto">
<div class="macro_img"><img src="systems/mosh/images/icons/ui/rolltables/panic_check.png" style="border:none"/></div>
<div class="macro_desc"><h3>Panic Check</h3>Stress, Damage, and emotional wear and tear eventually bring characters to their breaking point. When that happens, there’s a chance they Panic. You determine this by making a <strong>Panic Check</strong>. Some results of the Panic Table are so severe that they leave a lasting impression on you. These are called <strong>Conditions</strong>, and they affect you until you are able to treat them.
</div>
</div>
</div>
<h4>Select your roll type:</h4>
`,
buttons: {
button1: {
label: `Advantage`,
callback: () => game.mosh.initRollTable(`panicCheck`,`[+]`,null,false,false,null,null),
icon: `<i class="fas fa-angle-double-up"></i>`
},
button2: {
label: `Normal`,
callback: () => game.mosh.initRollTable(`panicCheck`,``,null,false,false,null,null),
icon: `<i class="fas fa-minus"></i>`
},
button3: {
label: `Disadvantage`,
callback: () => game.mosh.initRollTable(`panicCheck`,`[-]`,null,false,false,null,null),
icon: `<i class="fas fa-angle-double-down"></i>`
}
}
},{width: 600,height: 265}).render(true);
}