Skip to content

Commit d27f500

Browse files
committed
v12 update
- Added a new tab under the tab list called "Conditions" - Added a new tab under the tab list called "Equipment" - Added a new tab under the tab list called "Spells" - Added a new tab under the tab list called "Weapons" - Added a new tab under the tab list called "Skills" - Added a new tab under the tab list called "Characters" - Added a new tab under the tab list called "Notes" - Added a new tab under the tab list called "Settings" - Added a new tab under the tab list called "Journal" - Added a new tab under the tab list called "Bestiary" - Added a new tab under the tab
1 parent dde3e47 commit d27f500

File tree

5 files changed

+40
-22
lines changed

5 files changed

+40
-22
lines changed

Diff for: README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@ This system provides character sheets and items for your play, if you would lik
3232
v5.0.0
3333
- Major Release! BACK UP YOUR WORLDS BEFORE UPGRADING! This release updates the system for foundry v12. It also DROPS support for foundry v10.
3434
- 🐛 Fix: Fixed the warning for data references #81
35-
35+
- 🐛 Fix: Items not linking correctly from character generation
36+
- 🐛 Fix: Dice rolls not working in v12
37+
- 🐛 Fix: CSS changes in v12 that made sheets look ugly
38+
- 🐛 Fix: Chargen throws error and dies when core module is not installed
39+
- 🐛 Fix: favorite items not working
40+
- 🐛 Fix: Add item button for HQ upgrades not working
41+
- 🐛 Fix: condition check not updating on character sheet for Vaesen
3642

3743
v4.6.4
3844
- 🐛 fix error happening on Forge: players getting a message of lacking of permission

Diff for: model/tab/vaesen-main.hbs

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<div class="selected checkbox-container">
1919
<label class="checkbox-label">
2020
<input type="checkbox" name="conditon" id="{{item._id}}"
21+
2122
{{#if item.system.active}}
2223
checked
2324
{{/if}}

Diff for: script/sheet/headquarter.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,13 @@ export class HeadquarterCharacterSheet extends VaesenActorSheet {
9999
}
100100

101101
onItemCreate(event) {
102+
console.log("Item Create");
102103
event.preventDefault();
103104
let header = event.currentTarget;
104105
let data = duplicate(header.dataset);
105106
data["name"] = `New ${data.type.capitalize()}`;
106-
data["data.category"] = data["category"];
107+
data["system.category"] = data["category"];
108+
console.log(data);
107109
this.actor.createEmbeddedDocuments("Item", [data]);
108110
}
109111

@@ -114,6 +116,7 @@ export class HeadquarterCharacterSheet extends VaesenActorSheet {
114116
}
115117

116118
onItemDelete(event) {
119+
console.log("Item Delete");
117120
const div = $(event.currentTarget).parents(".item");
118121
this.actor.deleteEmbeddedDocuments("Item", [div.data("itemId")]);
119122
div.slideUp(200, () => this.render(false));

Diff for: script/util/conditions.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,14 @@ export class conditions{
190190
}
191191

192192
static async onVaesenCondition(actor, conditionId) {
193-
let condition = Array.from(actor.items?.values()).find(x => x.type == "condition" && x.id == conditionId);
193+
let condition = Array.from(actor.items?.values()).find(x => x.type == "condition" && x._id == conditionId);
194+
194195

195196
await actor.updateEmbeddedDocuments("Item", [
196-
{ _id: condition.id, "data.active": !condition.system.active },
197+
{ _id: condition._id, "system.active": !condition.system.active },
197198
]);
199+
200+
198201

199202
const statusEffect = {
200203
label: condition.name,

Diff for: script/util/generator.js

+23-18
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ export class generator {
1111
const classKeys = Object.keys(generator_data.changeList);
1212
const classIndex = await this._getRoll(classKeys.length);
1313
const classSelected = classKeys[classIndex];
14-
console.log("Vaesen | Generator | Class", classSelected);
14+
// console.log("Vaesen | Generator | Class", classSelected);
1515

1616
let resources = generator_data.startingResources[classSelected];
17-
console.log("Vaesen | Generator | Innitial Resources", resources);
17+
// console.log("Vaesen | Generator | Innitial Resources", resources);
1818

1919
const upbringingKeys = Object.keys(generator_data.changeList[classSelected]);
2020
const upbrindingIndex = await this._getRoll(upbringingKeys.length);
2121
const upbringingSelected = upbringingKeys[upbrindingIndex];
22-
console.log("Vaesen | Generator | Upbringing", upbringingSelected);
23-
console.log("Vaesen | Generator | Changes Before mod", generator_data.changeList[classSelected][upbringingSelected]);
22+
// console.log("Vaesen | Generator | Upbringing", upbringingSelected);
23+
// console.log("Vaesen | Generator | Changes Before mod", generator_data.changeList[classSelected][upbringingSelected]);
2424

2525
let changes = generator_data.changeList[classSelected][upbringingSelected];
2626

@@ -29,16 +29,16 @@ export class generator {
2929
const professionName = generator_data.professionTable[classSelected][professionRoll];
3030
const professionSelected = generator_data.professionsList[professionName];
3131
const archetytpePageLink = game.journal.getName("Chapter 2 - Your Player Character")?.pages.getName(professionSelected.archetype)?.uuid;
32-
console.log("Vaesen | Generator | Profession", professionRoll, professionSelected);
32+
// console.log("Vaesen | Generator | Profession", professionRoll, professionSelected);
3333

3434
resources += professionSelected.resources;
3535

3636
const age = await this._getRoll(50) + 17;
3737
const ageInfo = generator_data.ageInfo.find(it => it.min <= age && it.max >= age);
38-
console.log("Vaesen | Generator | Age Info", age, ageInfo);
38+
// console.log("Vaesen | Generator | Age Info", age, ageInfo);
3939

4040
const archetypeInfo = generator_data.archetypeInfo[professionSelected.archetype];
41-
console.log("Vaesen | Generator | Archetype", archetypeInfo);
41+
// console.log("Vaesen | Generator | Archetype", archetypeInfo);
4242

4343
const motivationRoll = await this._getRoll(archetypeInfo.motivation.length);
4444
const motivation = archetypeInfo.motivation[motivationRoll];
@@ -57,12 +57,14 @@ export class generator {
5757
itemsToCreate.push(talentItem);
5858

5959
const equipmentRoll = await this._getRoll(archetypeInfo.equipment.length);
60-
const equipment = "Crowbar"; // archetypeInfo.equipment[equipmentRoll];
60+
// console.log("Vaesen | Generator | Equipment Roll", equipmentRoll);
61+
const equipment = archetypeInfo.equipment[equipmentRoll];
6162

6263
let gearItem = getItemInfo(equipment, "gear");
6364
itemsToCreate.push(toStartingObject(gearItem));
6465

65-
let equipmentsHtml = `<li>@UUID[Item.${gearItem.id}]{${equipment}}</li>`;
66+
let equipmentsHtml = `<li>@UUID[Item.${gearItem._id}]{${equipment}}</li>`;
67+
//console.log("Vaesen | Generator | Adding Equipment", equipmentsHtml);
6668

6769
let eventsHtml = "";
6870
let eventsIndex = [];
@@ -79,14 +81,14 @@ export class generator {
7981
gearItem = getItemInfo(currentEvent.item, "gear");
8082
itemsToCreate.push(toStartingObject(gearItem));
8183

82-
equipmentsHtml += `<li>@UUID[Item.${gearItem.id}]{${gearItem.name}}</li>`;
84+
equipmentsHtml += `<li>@UUID[Item.${gearItem._id}]{${gearItem.name}}</li>`;
8385

84-
console.log("Vaesen | Generator | Adding Life Event", currentEvent);
86+
//console.log("Vaesen | Generator | Adding Life Event", currentEvent);
8587

8688
for (const key in currentEvent.skills) {
8789
const element = currentEvent.skills[key];
8890
changes[key] += element;
89-
console.log("Vaesen | Generator | Upgrading skill", key);
91+
// console.log("Vaesen | Generator | Upgrading skill", key);
9092
}
9193
}
9294
if (itemsToCreate.filter(it => it.name.toLowerCase() == "crowbar").length == 1) {
@@ -100,7 +102,7 @@ export class generator {
100102
attributeReducedRoll = await this._getRoll(4);
101103
} while (attributeReducedRoll == attributeReduced)
102104

103-
console.log("Vaesen | Generator | Reducing attribute", generator_data.attributeList[attributeReducedRoll]);
105+
// console.log("Vaesen | Generator | Reducing attribute", generator_data.attributeList[attributeReducedRoll]);
104106

105107
changes[`system.attribute.${generator_data.attributeList[attributeReducedRoll]}.value`] -= 1;
106108
attributeReduced = attributeReducedRoll;
@@ -125,7 +127,7 @@ export class generator {
125127
<li><b>${game.i18n.localize("BIO.MOTIVATION")}:</b> ${motivation}</li>
126128
<li><b>${game.i18n.localize("BIO.TRAUMA")}:</b> ${trauma}</li>
127129
<li><b>${game.i18n.localize("BIO.DARK_SECRET")}:</b> ${darkSecret}</li>
128-
<li><b>${game.i18n.localize("HEADER.TALENTS").toLowerCase().replace(/\b(\w)/g, x => x.toUpperCase())}:</b> @UUID[Item.${talentItem.id}]{${talent}}</li>
130+
<li><b>${game.i18n.localize("HEADER.TALENTS").toLowerCase().replace(/\b(\w)/g, x => x.toUpperCase())}:</b> @UUID[Item.${talentItem._id}]{${talent}}</li>
129131
<li><b>${game.i18n.localize("GENERATOR.LIFE_TIME_EVENTS")}:</b>
130132
<ul>${eventsHtml}
131133
</ul>
@@ -241,7 +243,7 @@ export class generator {
241243
`);
242244
chatHTML.push("</div>");
243245

244-
console.log("Vaesen | Generator | Changes After mod", changes);
246+
//console.log("Vaesen | Generator | Changes After mod", changes);
245247

246248
$(".char-gen").hide();
247249

@@ -256,8 +258,8 @@ export class generator {
256258
label: game.i18n.localize("YES"),
257259
callback: async () => {
258260
accepted = true;
259-
console.log("Vaesen | Generate", classSelected, upbringingSelected, changes);
260-
await actor.deleteEmbeddedDocuments("Item", actor.items.map(function (item) { return item.id; }));
261+
//console.log("Vaesen | Generate", classSelected, upbringingSelected, changes);
262+
await actor.deleteEmbeddedDocuments("Item", actor.items.map(function (item) { return item._id; }));
261263
await actor.createEmbeddedDocuments("Item", itemsToCreate);
262264
await actor.update(changes);
263265

@@ -307,18 +309,21 @@ export class generator {
307309
}
308310

309311
function getItemInfo(itemName, type){
312+
310313
let item = game.items.find(it => it.name.toLowerCase() === itemName.toLowerCase());
311314
if (item == undefined) {
312315
let itemType = generator_data.weaponList.includes(itemName.toLowerCase()) ? "weapon" : type;
313316
item = { type: itemType, name: itemName };
317+
314318
}
315319
else
316320
item = item.toObject();
321+
317322
return item;
318323
}
319324

320325
function toStartingObject(item) {
321-
console.log("Vaesen | Generator | Starting Item", item);
326+
322327
foundry.utils.setProperty(item, "system.starting", true);
323328
return item;
324329
}

0 commit comments

Comments
 (0)