Skip to content

Commit

Permalink
add skill safeguards to scirpts
Browse files Browse the repository at this point in the history
close #1921
close #1929
close #1922
  • Loading branch information
moo-man committed Apr 27, 2024
1 parent 40223d1 commit 58ca210
Show file tree
Hide file tree
Showing 21 changed files with 39 additions and 17 deletions.
5 changes: 5 additions & 0 deletions docs/pages/effects/effect-refactor.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ function keepData(oldItem, newItem)
let keep = {
_id : oldItem._id,
name : oldItem.name,
img: oldItem.img,
"system.description.value" : oldItem.system.description.value,
"system.gmdescription.value" : oldItem.system.gmdescription.value
}
Expand All @@ -175,6 +176,10 @@ function keepData(oldItem, newItem)
{
keep["system.worn"] = oldItem.system.worn
}
if (oldItem.system.equipped)
{
keep["system.equipped"] = oldItem.system.equipped
}
if (oldItem.system.advances)
{
keep["system.advances"] = oldItem.system.advances
Expand Down
2 changes: 1 addition & 1 deletion scripts/0FNOq4J1AdPd2A0q.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/2hzDv8ROulOe1elK.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
return args.skill.name.includes(game.i18n.localize("NAME.Lore"));
return args.skill?.name.includes(game.i18n.localize("NAME.Lore"));
2 changes: 1 addition & 1 deletion scripts/3LLiSgj6KGtgqcmo.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
return !args.skill.name.includes(game.i18n.localize("NAME.Language"));
return !args.skill?.name.includes(game.i18n.localize("NAME.Language"));
8 changes: 8 additions & 0 deletions scripts/5lc1eHIYQNpSRWip.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
if (["death", "necromancy"].includes(args.spell?.system.lore.value))
{
args.fields.successBonus += 1
}
else if(["life", "light", "heavens"].includes(args.spell?.system.lore.value))
{
args.fields.modifier -= 10;
}
7 changes: 7 additions & 0 deletions scripts/8tyMXDfHR8AJBdDu.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
let weakpointsAP = args.AP.layers.filter(i => !i.ignored && i.weakpoints).reduce((ap, layer) => ap + layer.value, 0);

if (weakpointsAP > 0)
{
args.modifiers.ap.ignored += weakpointsAP;
args.modifiers.ap.details.push(`${this.effect.name} - Ignore Weakpoints (${weakpointsAP})`);
}
1 change: 1 addition & 0 deletions scripts/AGD7zCyV4zruvnWu.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/AV2Kj6jgmIc45zKi.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
return args.skill.name.includes(game.i18n.localize("NAME.Stealth"));
return args.skill?.name.includes(game.i18n.localize("NAME.Stealth"));
2 changes: 1 addition & 1 deletion scripts/DxQnamsb2AuW0p2e.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
return !args.skill.name.includes(game.i18n.localize("NAME.Lore"));
return !args.skill?.name.includes(game.i18n.localize("NAME.Lore"));
2 changes: 1 addition & 1 deletion scripts/EGWF3LHav3e2zFL4.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/J0IWUhxada2ONowP.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/KUx0deSF3xNzMucL.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
return args.skill.name.includes(game.i18n.localize("NAME.Art"));
return args.skill?.name.includes(game.i18n.localize("NAME.Art"));
1 change: 1 addition & 0 deletions scripts/MDLttXplnNthncGr.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/RNr9CwyvLhlnwD2h.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
return !args.skill.name.includes(game.i18n.localize("NAME.Sail"));
return !args.skill?.name.includes(game.i18n.localize("NAME.Sail"));
2 changes: 1 addition & 1 deletion scripts/VAs1nXvicdQK18Do.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
return args.skill.name.includes(game.i18n.localize("NAME.Language"));
return args.skill?.name.includes(game.i18n.localize("NAME.Language"));
2 changes: 1 addition & 1 deletion scripts/l8qFKSnMpy4P7XQR.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
return !args.skill.name.includes(game.i18n.localize("NAME.Stealth"));
return !args.skill?.name.includes(game.i18n.localize("NAME.Stealth"));
2 changes: 1 addition & 1 deletion scripts/pHyXdPnWwoFrUA5n.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
return !args.skill.name.includes(game.i18n.localize("NAME.Entertain"));
return !args.skill?.name.includes(game.i18n.localize("NAME.Entertain"));
2 changes: 1 addition & 1 deletion scripts/t56mnblo1kv3gM1M.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/yRRzSKlcN3L7rEEe.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/ziG9H5Kdb7xC3dFE.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
return !args.skill.name.includes(game.i18n.localize("NAME.Art"));
return !args.skill?.name.includes(game.i18n.localize("NAME.Art"));
4 changes: 2 additions & 2 deletions system.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "wfrp4e",
"title": "Warhammer Fantasy Roleplay 4th Edition",
"description": "A comprehensive system for running grim and perilous games of Warhammer Fantasy Roleplay in the Foundry VTT environment.",
"version": "7.1.0",
"version": "7.1.1",
"author": "Moo Man, CatoThe1stElder",
"authors" : [
{
Expand Down Expand Up @@ -62,6 +62,6 @@
"templateVersion":3,
"socket": true,
"manifest" : "https://github.com/moo-man/WFRP4e-FoundryVTT/releases/latest/download/system.json",
"download" : "https://github.com/moo-man/WFRP4e-FoundryVTT/releases/download/7.1.0/wfrp4e.zip",
"download" : "https://github.com/moo-man/WFRP4e-FoundryVTT/releases/download/7.1.1/wfrp4e.zip",
"url" : "https://github.com/moo-man/WFRP4e-FoundryVTT"
}

0 comments on commit 58ca210

Please sign in to comment.