Skip to content

Commit

Permalink
Merge pull request #1616 from crnormand/r0155
Browse files Browse the repository at this point in the history
Various bug fixes
  • Loading branch information
crnormand authored Sep 28, 2022
2 parents b83e09c + e0f3e3f commit cfd66ce
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion module/actor/actor.js
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,8 @@ export class GurpsActor extends Actor {

for (let enckey in encs) {
let enc = encs[enckey]
let threshold = 1.0 - 0.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))
enc.currentsprint = Math.max(1, Math.floor(effectiveSprint * threshold))
Expand Down
4 changes: 2 additions & 2 deletions module/gurps.js
Original file line number Diff line number Diff line change
Expand Up @@ -2344,15 +2344,15 @@ if (!globalThis.GURPS) {
content: `<p>${srcActor.name} wants to give you ${resp.itemData.name} (${resp.count}),</p><br>Ok?`,
yes: () => {
// @ts-ignore
let destKey = destactor._findEqtkeyForId('globalid', resp.itemData.data.globalid)
let destKey = destactor._findEqtkeyForId('globalid', resp.itemData.system.globalid)
if (!!destKey) {
// already have some
// @ts-ignore
let destEqt = getProperty(destactor, destKey)
// @ts-ignore
destactor.updateEqtCount(destKey, destEqt.count + resp.count)
} else {
resp.itemData.data.equipped = true
resp.itemData.system.equipped = true
// @ts-ignore
destactor.addNewItemData(resp.itemData)
}
Expand Down
2 changes: 1 addition & 1 deletion system.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,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/releases/latest/download/system.zip",
"download": "https://github.com/crnormand/gurps/archive/0.15.4.zip",
"socket": true,
"license": "LICENSE.txt"
}

0 comments on commit cfd66ce

Please sign in to comment.