Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function cast(level, actions) {
- if(actions==="one"){
- _roll(level.toString() + "d10", "Heal Level " + level.toString() + ", " + actions + " Action.")
- }else if(actions==="two"){
- let n = level*8
- _roll(level.toString() + "d10+" + n.toString(), "Heal Level " + level.toString() + ", " + actions + " Actions.")
- }else if(actions==="three"){
- _roll(level.toString() + "d10", "Heal Level " + level.toString() + ", " + actions + " Actions.")
- }
- }
- function _roll(formula, flavor){
- const rollMode = game.settings.get('core', 'rollMode');
- let chatData = {
- user: game.user._id,
- speaker: ChatMessage.getSpeaker({actor}),
- content: formula,
- flavor: flavor,
- type: CONST.CHAT_MESSAGE_TYPES.ROLL
- };
- let r = new Roll(formula).toMessage(chatData, rollMode, true)
- }
- function actions(html){
- let level = html.find('[name="spellLevel"]').val()
- let d_actions = new Dialog({
- title: "Cast Heal",
- content: "<p>Actions:",
- buttons: {
- one: {
- icon: '<img src="systems/pf2e/icons/actions/OneAction.png" height="30"> </img>',
- callback: () => cast(level, "one")
- },
- two: {
- icon: '<img src="systems/pf2e/icons/actions/TwoActions.png" height="30"> </img>',
- callback: () => cast(level, "two")
- },
- three: {
- icon: '<img src="systems/pf2e/icons/actions/ThreeActions.png" height="30"> </img>',
- callback: () => cast(level, "three")
- }
- },
- default: "one",
- });
- d_actions.render(true);
- }
- function spell_level(){
- const html = '<form><div class="form-group"><label>Spell Level:</label><select name="spellLevel"><option value="1">Level 1</option><option value="2">Level 2</option><option value="3">Level 3</option><option value="4">Level 4</option><option value="5">Level 5</option><option value="6">Level 6</option><option value="7">Level 7</option></select></div></form>'
- let d_level = new Dialog({
- title: "Cast Heal",
- content: html,
- buttons: {
- next: {
- label: "Next",
- callback: (html) => actions(html)
- }
- },
- default: "next",
- });
- d_level.render(true);
- }
- spell_level()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement