Skip to content

Commit

Permalink
Merge pull request #1627 from crnormand/gcs5-items
Browse files Browse the repository at this point in the history
Updated Item Import for GCS 5
  • Loading branch information
rinickolous authored Oct 2, 2022
2 parents e930f66 + 39063cf commit b4c0015
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion module/actor/actor.js
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ export class GurpsActor extends Actor {

for (let enckey in encs) {
let enc = encs[enckey]
let threshold = 10 - (2 * parseInt(enc.level)) // each encumbrance level reduces move by 20%
let threshold = 10 - 2 * parseInt(enc.level) // each encumbrance level reduces move by 20%
threshold /= 10 // JS likes to calculate 0.2*3 = 3.99999, but handles 2*3/10 fine.
enc.currentmove = this._getCurrentMove(effectiveMove, threshold) //Math.max(1, Math.floor(m * t))
enc.currentdodge = isNaN(effectiveDodge) ? '–' : Math.max(1, effectiveDodge - parseInt(enc.level))
Expand Down
9 changes: 5 additions & 4 deletions module/damage/damagechat.js
Original file line number Diff line number Diff line change
Expand Up @@ -487,10 +487,11 @@ export default class DamageChat {
} else {
messageData.sound = CONFIG.sounds.dice
}
ChatMessage.create(messageData).then(arg => {
let messageId = arg.id // 'qHz1QQuzpJiavH3V'
$(`[data-message-id='${messageId}']`).on('click', handleOnPdf)
})
ChatMessage.create(messageData)
// ChatMessage.create(messageData).then(arg => {
// let messageId = arg.id // 'qHz1QQuzpJiavH3V'
// $(`[data-message-id='${messageId}']`).on('click', handleOnPdf)
// })
}
}

Expand Down
2 changes: 1 addition & 1 deletion module/item-import.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class ItemImporter {
if (j.type !== 'equipment_list') {
return ui.notifications.error('The file you uploaded is not a GCS Equipment Library!')
}
if (j.version !== 2) {
if (![2, 4].includes(j.version)) {
return ui.notifications.error('The file you uploaded is not of the right version!')
}
let pack = game.packs.find(p => p.metadata.name === filename)
Expand Down
4 changes: 2 additions & 2 deletions system.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "gurps",
"title": "GURPS 4e Game Aid (Unofficial)",
"description": "A game aid to help play GURPS 4e for Foundry VTT",
"version": "0.15.5",
"version": "0.15.6",
"authors": [
{
"name": "Chris Normand",
Expand Down Expand Up @@ -76,7 +76,7 @@
"secondaryTokenAttribute": "FP",
"url": "https://github.com/crnormand/gurps",
"manifest": "https://github.com/crnormand/gurps/releases/latest/download/system.json",
"download": "https://github.com/crnormand/gurps/archive/0.15.5.zip",
"download": "https://github.com/crnormand/gurps/archive/0.15.6.zip",
"socket": true,
"license": "LICENSE.txt"
}

0 comments on commit b4c0015

Please sign in to comment.