Skip to content
This repository has been archived by the owner on Jan 18, 2022. It is now read-only.

Commit

Permalink
v.0.99.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Rughalt committed Jan 1, 2022
1 parent 8a78868 commit 3d5fd6e
Show file tree
Hide file tree
Showing 21 changed files with 218 additions and 43 deletions.
1 change: 1 addition & 0 deletions D35E.css
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,7 @@
}
.D35E.sheet.actor .level-class-image.active {
background-image: url("icons/actions/upgrade.svg");
margin-bottom: 8px;
}
.D35E.sheet.actor .level-class-image span.level {
width: 20px;
Expand Down
22 changes: 22 additions & 0 deletions changelogs/changelog.0.99.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
### Fixes
- [885](https://github.com/Rughalt/D35E/issues/885) - Token Resize not working in Buff
- [879](https://github.com/Rughalt/D35E/issues/879) - Issue: Compendium Browsers are not working in core v9 and SRD v0.98.9
- [878](https://github.com/Rughalt/D35E/issues/878) - Inspire Greatness has null Change listed
- [870](https://github.com/Rughalt/D35E/issues/870) - Issue: Special Action: Deactivate functions are not working correctly.
- [867](https://github.com/Rughalt/D35E/issues/867) - Grapple attack bonus calculation is wrong for Tiny or lower creatures
- [862](https://github.com/Rughalt/D35E/issues/862) - Animal Companion Level Issue
- [860](https://github.com/Rughalt/D35E/issues/860) - [Bug] Ranged attack penalty affecting 'Melee Attack Bonuses'
- [857](https://github.com/Rughalt/D35E/issues/857) - stock Unarmed Strike item has quantity 0
- [856](https://github.com/Rughalt/D35E/issues/856) - standard Weapon Focus feat does not have attributes locked
- [853](https://github.com/Rughalt/D35E/issues/853) - Speak Language should be a class skill for bards.
- [852](https://github.com/Rughalt/D35E/issues/852) - Spells (all of them I believe) are subjected to Concealment
- [849](https://github.com/Rughalt/D35E/issues/849) - Feature Request: Toggle Skill Synergies
- [848](https://github.com/Rughalt/D35E/issues/848) - Add action button to items in containers
- [819](https://github.com/Rughalt/D35E/issues/819) - Bug: Missing Bonus Skill Points
- [810](https://github.com/Rughalt/D35E/issues/810) - Mage's Disjunction not marked as domain spell when added as such
- [805](https://github.com/Rughalt/D35E/issues/805) - Feature request: Add @item.level variable to combat changes modification formula
- [792](https://github.com/Rughalt/D35E/issues/792) - Level tiles overlap section below when width decreased
- [785](https://github.com/Rughalt/D35E/issues/785) - Spell Focus (or anything using featSpellDCBonus) causes DC in spell description to keep incrementing
- [681](https://github.com/Rughalt/D35E/issues/681) - Monks Flurry of Blows roll wrong amount of attacks.
- [414](https://github.com/Rughalt/D35E/issues/414) - Gnomes are missing the racial +2 Craft (alchemy) bonus
- [204](https://github.com/Rughalt/D35E/issues/204) - Monsters Missing/Wrong
1 change: 1 addition & 0 deletions less/actors.less
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
position: relative;
&.active {
background-image: url("icons/actions/upgrade.svg");
margin-bottom: 8px;
}


Expand Down
41 changes: 30 additions & 11 deletions module/actor/entity.js
Original file line number Diff line number Diff line change
Expand Up @@ -921,14 +921,14 @@ export class ActorPF extends Actor {
tokens.push(this.token);
for (const o of tokens) {
if (size.w !== o.data.width || size.h !== o.data.height || size.scale !== o.data.scale)
await o.update({ width: size.w, height: size.h, scale: size.scale }, { stopUpdates: true , tokenOnly: true});
await ActorPF._updateToken(o,{width: size.w, height: size.h, scale: size.scale}, {stopUpdates: true, tokenOnly: true});
}
}
if (!this.isToken) {
let tokens = this.getActiveTokens().filter(o => o.data.actorLink);
for (const o of tokens) {
if (size.w !== o.data.width || size.h !== o.data.height || size.scale !== o.data.scale) {
await o.update({width: size.w, height: size.h, scale: size.scale}, {stopUpdates: true, tokenOnly: true});
await ActorPF._updateToken(o,{width: size.w, height: size.h, scale: size.scale}, {stopUpdates: true, tokenOnly: true});
}
}
data["token.width"] = size.w;
Expand Down Expand Up @@ -3038,7 +3038,7 @@ export class ActorPF extends Actor {
}

// Add ability mods to CMB and CMD
const cmbMod = Object.keys(CONFIG.D35E.actorSizes).indexOf(getProperty(data, "data.traits.size") || "") <= Object.keys(CONFIG.D35E.actorSizes).indexOf("tiny") ? modDiffs["dex"] : modDiffs["str"];
const cmbMod = Object.keys(CONFIG.D35E.actorSizes).indexOf(getProperty(data, "data.traits.size") || "") <= Object.keys(CONFIG.D35E.actorSizes).indexOf("tiny") ? modDiffs["str"] : modDiffs["str"];
linkData(data, updateData, "data.attributes.cmb.total", updateData["data.attributes.cmb.total"] + cmbMod);
linkData(data, updateData, "data.attributes.cmd.total", updateData["data.attributes.cmd.total"] + modDiffs["str"]);
if (!flags.loseDexToAC || modDiffs["dex"] < 0) {
Expand Down Expand Up @@ -4496,7 +4496,7 @@ export class ActorPF extends Actor {
let spellsToAdd = []
for (let p of game.packs.values()) {
if (p.private && !game.user.isGM) continue;
if (p.entity !== "Item") continue;
if ((p.entity || p.documentName) !== "Item") continue;

const items = await p.getDocuments();
for (let obj of items) {
Expand Down Expand Up @@ -4787,7 +4787,7 @@ export class ActorPF extends Actor {
return DicePF.d20Roll({
event: options.event,
parts: ["@mod - @drain + @ablMod + @sizeMod + @changeGeneral + @changeAttack"],
data: { changeGeneral: this.data.data.attributes.attack.general, changeAttack: this.data.data.attributes.attack.ranged, mod: this.data.data.attributes.bab.total, ablMod: this.data.data.abilities.str.mod, drain: this.data.data.attributes.energyDrain || 0, sizeMod: CONFIG.D35E.sizeMods[this.data.data.traits.actualSize] || 0 },
data: { changeGeneral: this.data.data.attributes.attack.general, changeAttack: this.data.data.attributes.attack.melee, mod: this.data.data.attributes.bab.total, ablMod: this.data.data.abilities.str.mod, drain: this.data.data.attributes.energyDrain || 0, sizeMod: CONFIG.D35E.sizeMods[this.data.data.traits.actualSize] || 0 },
title: game.i18n.localize("D35E.Melee"),
speaker: ChatMessage.getSpeaker({ actor: this }),
takeTwenty: false
Expand Down Expand Up @@ -8263,13 +8263,13 @@ export class ActorPF extends Actor {
// Handle different roll modes
switch (chatData.rollMode) {
case "gmroll":
chatData["whisper"] = game.users.contents.filter(u => u.isGM).map(u => u.id);
chatData["whisper"] = game.users.contents.filter(u => u.isGM).map(u => u._id);
break;
case "selfroll":
chatData["whisper"] = [game.user.id];
break;
case "blindroll":
chatData["whisper"] = game.users.contents.filter(u => u.isGM).map(u => u.id);
chatData["whisper"] = game.users.contents.filter(u => u.isGM).map(u => u._id);
chatData["blind"] = true;
}

Expand Down Expand Up @@ -8492,6 +8492,7 @@ export class ActorPF extends Actor {
let itemUpdateData = []
let itemsEnding = []
let itemsOnRound = []
let itemsToDelete = []
let itemResourcesData = {}
let deletedOrChanged = false;
if (this.items !== undefined && this.items.size > 0) {
Expand All @@ -8501,25 +8502,35 @@ export class ActorPF extends Actor {
let _data = i.getElapsedTimeUpdateData(roundDelta)
if (_data && _data["data.active"] === false)
itemsEnding.push(i)
if ((i.data.data.perRoundActions || []).length)
if ((i.data.data.perRoundActions || []).length && !_data.delete)
itemsOnRound.push(i)
if (_data && !_data.delete && !_data.ignore) {
itemUpdateData.push(_data);
itemUpdateData.push({item: i, data: _data});
deletedOrChanged = true;
} else if (_data && _data.delete === true) {
await this.deleteOwnedItem(_data._id, { stopUpdates: true })
itemUpdateData.push({item: i, data: {'_id': _data._id, 'data.active': false}});
itemsToDelete.push(_data._id)
deletedOrChanged = true;
}
}

}

if (itemUpdateData.length > 0) await this.updateOwnedItem(itemUpdateData, { stopUpdates: true })
if (itemUpdateData.length > 0) {
let updatePromises = []
for (let updateData of itemUpdateData) {
updatePromises.push(updateData.item.update(updateData.data, { stopUpdates: true }));
}
await Promise.all(updatePromises)
}
if (Object.keys(itemResourcesData).length > 0 || deletedOrChanged) await this.update(itemResourcesData);
if (itemsEnding.length)
this.renderBuffEndChatCard(itemsEnding)
if (itemsOnRound.length)
this.applyOnRoundBuffActions(itemsOnRound);
if (itemsToDelete.length > 0) {
await this.deleteEmbeddedDocuments("Item", itemsToDelete, {})
}
this.renderFastHealingRegenerationChatCard();

}
Expand All @@ -8532,6 +8543,14 @@ export class ActorPF extends Actor {
}
}

static async _updateToken(token, data) {
if (token.document) {
return token.document.update(data)
} else {
return token.update(data);
}
}

}


Expand Down
18 changes: 11 additions & 7 deletions module/actor/sheets/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ export class ActorSheetPF extends ActorSheet {
spell.epic = spell.epicLevel > 9;
if (bannedSpellSpecialization.has(spell.data.school))
spell.isBanned = true;
if (availableSpellSpecialization.has(spell.data.school) || domainSpellNames.has(spell.name)) {
if (availableSpellSpecialization.has(spell.data.school) || domainSpellNames.has(createTag(spell.name))) {
spell.isSpecialized = true;
} else {
spellbook[lvl].hasNonDomainSpells = true;
Expand Down Expand Up @@ -1485,10 +1485,14 @@ export class ActorSheetPF extends ActorSheet {
for (let item of this.actor.items) {
if (item.data.data.originVersion && item.data.data.originPack && item.data.data.originId) {
let compendiumItem = await game.packs.get(item.data.data.originPack).getDocument(item.data.data.originId);
if (compendiumItem.data.data.originVersion > item.data.data.originVersion)
itemUpdates.push({_id: item.id, "data.possibleUpdate": true})
else
itemUpdates.push({_id: item.id, "data.possibleUpdate": false})
if (!compendiumItem) {
console.log('Item missing from compendium...')
} else {
if (compendiumItem.data.data.originVersion > item.data.data.originVersion)
itemUpdates.push({_id: item.id, "data.possibleUpdate": true})
else
itemUpdates.push({_id: item.id, "data.possibleUpdate": false})
}
}
}
await this.actor.updateOwnedItem(itemUpdates, {stopUpdates: true})
Expand Down Expand Up @@ -2029,7 +2033,7 @@ export class ActorSheetPF extends ActorSheet {
if (feat.data?.spellSpecialization?.isDomain) {

Object.values(feat.data?.spellSpecialization?.spells).forEach(s => {
domainSpellNames.add(s.name);
domainSpellNames.add(createTag(s.name));
})
}
})
Expand Down Expand Up @@ -2649,7 +2653,7 @@ export class ActorSheetPF extends ActorSheet {
if (!previousData) {
for (let p of game.packs.values()) {
if (p.private && !game.user.isGM) continue;
if (p.entity !== "Item") continue
if ((p.entity || p.documentName) !== "Item") continue

const items = await p.getDocuments();
for (let i of items) {
Expand Down
2 changes: 1 addition & 1 deletion module/apps/compendium-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export class CompendiumBrowser extends Application {

for (let p of game.packs.values()) {
if (p.private && !game.user.isGM) continue;
if (p.entity !== this.entityType) continue;
if ((p.entity || p.documentName) !== this.entityType) continue;

const items = await p.getDocuments();
for (let i of items) {
Expand Down
2 changes: 1 addition & 1 deletion module/apps/crafting-station.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class CompendiumBrowser extends Application {

for (let p of game.packs.values()) {
if (p.private && !game.user.isGM) continue;
if (p.entity !== this.entityType) continue;
if ((p.entity || p.documentName) !== this.entityType) continue;

const items = await p.getDocuments();
for (let i of items) {
Expand Down
8 changes: 4 additions & 4 deletions module/dice.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ export class DicePF {
// Handle different roll modes
switch (rollMode) {
case "gmroll":
chatData["whisper"] = game.users.contents.filter(u => u.isGM).map(u => u.id);
chatData["whisper"] = game.users.contents.filter(u => u.isGM).map(u => u._id);
break;
case "selfroll":
chatData["whisper"] = [game.user.id];
break;
case "blindroll":
chatData["whisper"] = game.users.contents.filter(u => u.isGM).map(u => u.id);
chatData["whisper"] = game.users.contents.filter(u => u.isGM).map(u => u._id);
chatData["blind"] = true;
break;
}
Expand Down Expand Up @@ -242,13 +242,13 @@ export class DicePF {
// Handle different roll modes
switch (chatData.rollMode) {
case "gmroll":
chatData["whisper"] = game.users.contents.filter(u => u.isGM).map(u => u.id);
chatData["whisper"] = game.users.contents.filter(u => u.isGM).map(u => u._id);
break;
case "selfroll":
chatData["whisper"] = [game.user.id];
break;
case "blindroll":
chatData["whisper"] = game.users.contents.filter(u => u.isGM).map(u => u.id);
chatData["whisper"] = game.users.contents.filter(u => u.isGM).map(u => u._id);
chatData["blind"] = true;
}

Expand Down
Loading

0 comments on commit 3d5fd6e

Please sign in to comment.