-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
expose all functions for other modules
- Loading branch information
1 parent
2ac25a8
commit fe32908
Showing
13 changed files
with
250 additions
and
246 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
var fs = require('fs'); | ||
console.log(JSON.parse(fs.readFileSync('src/module.json', 'utf8')).includes.join(" ")); | ||
console.log(JSON.parse(fs.readFileSync('src/build.json', 'utf8')).includes.join(" ")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/src/node_modules/ | ||
/.idea/ | ||
/src/package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"trailingComma": "none", | ||
"tabWidth": 4, | ||
"useTabs": false, | ||
"semi": true, | ||
"singleQuote": true, | ||
"quoteProps": "consistent", | ||
"bracketSpacing": true, | ||
"arrowParens": "avoid", | ||
"printWidth": 120, | ||
"endOfLine": "crlf", | ||
|
||
"bracketSameLine": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"includes": [ | ||
"./assets/**", | ||
"./packs/**", | ||
"./languages/**", | ||
"./scripts/**", | ||
"./styles/**", | ||
"./templates/**", | ||
"./module.json", | ||
"./README.md" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"devDependencies": { | ||
"prettier": "^3.3.3" | ||
}, | ||
"scripts": { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,44 @@ | ||
export default class SalvageUnionCombatAutomationHeat{ | ||
export default class SalvageUnionCombatAutomationHeat { | ||
static async handleHeat(hot, actor) { | ||
|
||
if(hot == undefined || actor.type !== "mech") { | ||
if (hot == undefined || actor.type !== 'mech') { | ||
return true; | ||
} | ||
|
||
let heat = parseInt(actor.system.heat.value) | ||
let max_heat = parseInt(actor.system.heat.max) | ||
|
||
let heat = parseInt(actor.system.heat.value); | ||
let max_heat = parseInt(actor.system.heat.max); | ||
|
||
let heatValue = hot.match(/\d+|X/).pop() | ||
let heatValue = hot.match(/\d+|X/).pop(); | ||
|
||
if(heatValue == 'X') { | ||
if (heatValue == 'X') { | ||
heatValue = await Dialog.prompt({ | ||
title: game.i18n.format("salvage-union-combat-automation.heat-dialog.title"), | ||
content: game.i18n.format("salvage-union-combat-automation.heat-dialog.heat-produced") + '<input type="number">', | ||
callback: (html) => html.find('input').val() | ||
title: game.i18n.format('salvage-union-combat-automation.heat-dialog.title'), | ||
content: | ||
game.i18n.format('salvage-union-combat-automation.heat-dialog.heat-produced') + | ||
'<input type="number">', | ||
callback: html => html.find('input').val() | ||
}); | ||
|
||
} | ||
|
||
heatValue = parseInt(heatValue); | ||
|
||
if((heat + heatValue) > max_heat) { | ||
ui.notifications.error(game.i18n.format("salvage-union-combat-automation.too-much-heat")) | ||
if (heat + heatValue > max_heat) { | ||
ui.notifications.error(game.i18n.format('salvage-union-combat-automation.too-much-heat')); | ||
return false; | ||
} | ||
|
||
if((heat + heatValue) == max_heat) { | ||
this.handleHeatspike(actor) | ||
if (heat + heatValue == max_heat) { | ||
this.handleHeatspike(actor); | ||
} | ||
|
||
actor.update({ 'system.heat.value': heat + heatValue }); | ||
|
||
return true; | ||
} | ||
|
||
static async handleHeatspike(actor) { | ||
if(actor.system.heat?.value) { | ||
game.salvage.heatRoll(actor.system.heat.value) | ||
if (actor.system.heat?.value) { | ||
game.salvage.heatRoll(actor.system.heat.value); | ||
} | ||
return true; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,46 @@ | ||
import SalvageUnionCombatAutomationWeapons from "./weapons.js" | ||
import SalvageUnionCombatAutomationDamage from "./applyDamage.js" | ||
import SalvageUnionCombatAutomationResources from "./resources.js" | ||
import Settings from "./settings.js"; | ||
import SalvageUnionCombatAutomationWeapons from './weapons.js'; | ||
import SalvageUnionCombatAutomationDamage from './applyDamage.js'; | ||
import SalvageUnionCombatAutomationResources from './resources.js'; | ||
import Settings from './settings.js'; | ||
|
||
Hooks.on("ready", () => { | ||
Hooks.on('ready', () => { | ||
Settings.addAllSettings(); | ||
}); | ||
}); | ||
|
||
Hooks.on('renderSalvageUnionActorSheet', async function(actor, html) { | ||
Hooks.once('init', function () { | ||
game.salvage = { | ||
...game.salvage, | ||
salvageUnionCombatAutomationWeapons: SalvageUnionCombatAutomationWeapons | ||
}; | ||
}); | ||
|
||
SalvageUnionCombatAutomationWeapons.addAutomationToWeapons(actor, html) | ||
SalvageUnionCombatAutomationResources.addAutomationToEnergyItems(actor, html) | ||
Hooks.on('renderSalvageUnionActorSheet', async function (actor, html) { | ||
SalvageUnionCombatAutomationWeapons.addAutomationToWeapons(actor, html); | ||
SalvageUnionCombatAutomationResources.addAutomationToEnergyItems(actor, html); | ||
|
||
html.find('.su-combatautomation-combatdicebutton').on('click', ev => { | ||
SalvageUnionCombatAutomationWeapons.handleAttackRollButton(ev); | ||
}) | ||
}); | ||
|
||
html.find('.su-combatautomation-resourcedicebutton').on('click', ev => { | ||
SalvageUnionCombatAutomationResources.handleResource(ev); | ||
}) | ||
}); | ||
}); | ||
|
||
Hooks.on('renderChatMessage', async function(message, html){ | ||
Hooks.on('renderChatMessage', async function (message, html) { | ||
html.find('.su-combatautomation-damagebutton').on('click', _ => { | ||
SalvageUnionCombatAutomationDamage.clickDamageButton(message); | ||
}) | ||
}); | ||
html.find('.su-combatautomation-customdamagebutton').on('click', event => { | ||
SalvageUnionCombatAutomationDamage.clickCustomDamageButton(message, event.currentTarget); | ||
}) | ||
}); | ||
}); | ||
|
||
Hooks.on('renderChatMessage', async function(message, html){ | ||
Hooks.on('renderChatMessage', async function (message, html) { | ||
html.find('.su-combatautomation-heatcheckbutton').on('click', _ => { | ||
ChatMessage.create({ | ||
content: 'Work in Progress -> Use the actor sheet', | ||
speaker: { alias: game.user.name } | ||
ChatMessage.create({ | ||
content: 'Work in Progress -> Use the actor sheet', | ||
speaker: { alias: game.user.name } | ||
}); | ||
}) | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.