Skip to content

Commit

Permalink
close moo-man#201
Browse files Browse the repository at this point in the history
  • Loading branch information
moo-man committed Nov 3, 2024
1 parent d5ce016 commit 887e6c6
Show file tree
Hide file tree
Showing 15 changed files with 40 additions and 167 deletions.
13 changes: 12 additions & 1 deletion effects/SVjHdbtdqHADo1Cv.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
if (args.testData.options.backstab && args.succeeded)
{
args.result.damage.total *= 2;
if (args.result.damage)
{
args.result.damage.total *= 2;
}
if (args.result.primary?.damage)
{
args.result.primary.damage.total *= 2;
}
if (args.result.secondary?.damage)
{
args.result.secondary.damage.total *= 2;
}
args.result.other.push({label : this.effect.name, description : "Damage Doubled, Ignores AP"})
}
7 changes: 0 additions & 7 deletions scripts/apps/active-effect-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,4 @@ export default class SoulboundActiveEffectConfig extends WarhammerActiveEffectCo
hidden.equipTransfer = !this.object.item?.system?.equippable;
return hidden;
}

activateListeners(html)
{
super.activateListeners(html);


}
}
70 changes: 0 additions & 70 deletions scripts/apps/effect-script.js

This file was deleted.

2 changes: 2 additions & 0 deletions scripts/apps/roll-dialog/combat.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ export class CombatRollDialog extends CommonRollDialog {
swarmDice: actor.type === "npc" && actor.isSwarm ? actor.system.combat.health.toughness.value : 0,
}

fields.bonusDice = data.combat.swarmDice;

fields.attack = weapon.system.isMelee ? actor.system.combat.melee.relative : actor.system.combat.accuracy.relative

data.showDualWielding = actor.items.filter(i => i.isAttack && i.equipped).length >= 2;
Expand Down
28 changes: 0 additions & 28 deletions scripts/apps/zone-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,33 +63,5 @@ Hooks.on('setup', (app, html) => {
new ZoneConfig(this.document).render(true);
}

// foundry.applications.sheets.RegionConfig.DEFAULT_OPTIONS.window.controls = [
// { icon: 'fa-solid fa-game-board-simple',
// label: "Zone",
// action: "zoneConfig",}
// ]

// app.options.actions.zoneConfig = (event, target) => {
// console.log(app.document);
// }

// app.options.window.controls.push({
// icon: 'fa-solid fa-game-board-simple',
// label: "Zone",
// action: "zoneConfig",
// })

// const button = $(
// `<div class='control-icon'><i class="fas fa-cog"></i></div>`
// );
// button.attr(
// 'title',
// 'Zone Config'
// );

// button.mousedown(event => {
// new ZoneConfig(hud.object.document).render(true)
// })
// html.find('.col.right').append(button);
})

12 changes: 1 addition & 11 deletions scripts/model/actor/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export class BaseSoulboundActorModel extends BaseWarhammerActorModel
{

static preventItemTypes = [];
static singletonItemTypes = [];
static singletonItemPaths = {};

static defineSchema()
{
Expand Down Expand Up @@ -41,16 +41,6 @@ export class BaseSoulboundActorModel extends BaseWarhammerActorModel

}


checkSingletonItems(item)
{
if (this.constructor.singletonItemTypes.includes(item.type))
{
return item.actor.update({[`system.${item.type}`] : this[item.type].updateSingleton(item)});
}
}


computeBase()
{
this.initialize();
Expand Down
2 changes: 1 addition & 1 deletion scripts/model/actor/components/combat.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export class StandardCombatModel extends foundry.abstract.DataModel
{
this.health.toughness.max += parent.attributes.body.value + parent.attributes.mind.value + parent.attributes.soul.value
}
else if(!this.isSwarm)
else if(!this.parent.isSwarm)
{
this.health.toughness.max = 1;
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/model/actor/npc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ let fields = foundry.data.fields;
export class NPCModel extends StandardActorModel
{
static preventItemTypes = [];
static singletonItemTypes = [];
static singletonItemPaths = {};

static defineSchema()
{
Expand Down
2 changes: 1 addition & 1 deletion scripts/model/actor/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ let fields = foundry.data.fields;
export class PlayerModel extends StandardActorModel
{
static preventItemTypess = [];
static singletonItemTypess = [];
static singletonItemPaths = {};

static defineSchema()
{
Expand Down
9 changes: 8 additions & 1 deletion scripts/model/actor/standard.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,14 @@ export class StandardActorModel extends BaseSoulboundActorModel
// Prevent wounds from exceeding max
if (hasProperty(data, "system.combat.health.toughness.value"))
{
data.system.combat.health.toughness.value = Math.clamp(data.system.combat.health.toughness.value, 0, this.combat.health.toughness.max)
if (this.isSwarm)
{
data.system.combat.health.toughness.value = Math.max(data.system.combat.health.toughness.value, 0)
}
else
{
data.system.combat.health.toughness.value = Math.clamp(data.system.combat.health.toughness.value, 0, this.combat.health.toughness.max)
}
options.deltaToughness = data.system.combat.health.toughness.value - this.combat.health.toughness.value;
}
if (hasProperty(data, "system.combat.mettle.value"))
Expand Down
18 changes: 4 additions & 14 deletions scripts/system/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default class SoulboundChat {
let canApplyDamage = li => {
const message = game.messages.get(li.data("messageId"));
let test = message.system.test
return message.isRoll
return test
&& message.isContentVisible //can be seen
&& (test.targets.length || game.user.targets.size > 0) //has something selected
&& test && (test.result.damage || test.result.primary?.damage || test.result.secondary?.damage); //is damage roll
Expand Down Expand Up @@ -597,24 +597,14 @@ export default class SoulboundChat {
{
for (let t of canvas.tokens.controlled)
{
if (test.itemTest.skill)
chatTest = await t.actor.setupSkillTest(test.itemTest.skill, test.itemTest.attribute, {difficulty, complexity, resist : test.item?.type})
else
chatTest = await t.actor.setupAttributeTest(test.itemTest.attribute, {difficulty, complexity, resist : test.item?.type})

await chatTest.roll()
chatTest.sendToChat()
chatTest = await t.actor.setupCommonTest(itemTest, {difficulty, complexity, resist : test.item?.type});
await chatTest.roll();
}
}
else if (game.user.character)
{
if (test.itemTest.skill)
chatTest = await game.user.character.setupSkillTest(test.itemTest.skill, test.itemTest.attribute, {difficulty, complexity, resist : test.item?.type})
else
chatTest = await game.user.character.setupAttributeTest(test.itemTest.attribute, {difficulty, complexity, resist : test.item?.type})

chatTest = await t.actor.setupCommonTest(itemTest, {difficulty, complexity, resist : test.item?.type})
await chatTest.roll()
chatTest.sendToChat()
}
else
return ui.notifications.warn(game.i18n.localize("WARN.NoActorsToTest"))
Expand Down
10 changes: 5 additions & 5 deletions scripts/system/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ AOS.systemEffects = {
{key: "system.combat.defence.bonus", mode : 2, value : -1}
],
system : {
scriptdata : [{
scriptData : [{
label : "Mind (Awareness) Tests that rely on sight",
script : "args.fields.difficulty -= 2",
options : {
Expand Down Expand Up @@ -513,7 +513,7 @@ CONFIG.statusEffects = [
{key: "system.combat.defence.bonus", mode : 2, value : -1}
],
system : {
scriptdata : [{
scriptData : [{
label : "Mind (Awareness) Tests that rely on sight",
script : "args.fields.difficulty -= 2",
options : {
Expand All @@ -534,7 +534,7 @@ CONFIG.statusEffects = [
name : "CONDITION.DEAFENED",
img : "systems/age-of-sigmar-soulbound/asset/icons/deafened.svg",
system : {
scriptdata : [{
scriptData : [{
label : "Tests that require hearing",
script : "args.fields.bonusDice -= 1",
}]
Expand All @@ -546,7 +546,7 @@ CONFIG.statusEffects = [
name : "CONDITION.FRIGHTENED",
img : "systems/age-of-sigmar-soulbound/asset/icons/frightened.svg",
system : {
scriptdata : [{
scriptData : [{
label : "Within line of sight of the source of fear",
script : "args.fields.bonusDice -= 1",
}]
Expand All @@ -564,7 +564,7 @@ CONFIG.statusEffects = [
name : "CONDITION.POISONED",
img : "systems/age-of-sigmar-soulbound/asset/icons/poisoned.svg",
system : {
scriptdata : [{
scriptData : [{
label : "Within line of sight of the source of fear",
script : "args.fields.bonusDice -= 1",
options : {
Expand Down
1 change: 0 additions & 1 deletion scripts/system/migrations.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ export default class Migration {
}
}
await actor.deleteEmbeddedDocuments("ActiveEffect", effectsToDelete);
debugger;
for(let item of actor.items)
{
await this.migrateItemEffectRefactor(item);
Expand Down
21 changes: 0 additions & 21 deletions static/template/apps/effect-script.hbs

This file was deleted.

10 changes: 5 additions & 5 deletions system.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
"id": "age-of-sigmar-soulbound",
"title": "Warhammer Age of Sigmar: Soulbound",
"description": "The first ever tabletop roleplaying game set in <b>Warhammer Age of Sigmar</b>. Take on the role of the Soulbound, explore and roleplay in the Mortal Realms, filled with gods, monsters, daemons, and demigods, and shape its future. ",
"version": "7.0.0",
"version": "7.0.1",
"relationships": {
"requires": [{
"id": "warhammer-lib",
"type": "module",
"manifest": "https://raw.githubusercontent.com/moo-man/WarhammerLibrary-FVTT/1.0.0/module.json",
"manifest": "https://raw.githubusercontent.com/moo-man/WarhammerLibrary-FVTT/1.2.2/module.json",
"compatibility": {
"minimum" : "1.0.0",
"verified": "1.0.0"
"minimum" : "1.2.2",
"verified": "1.2.2"
}
}]
},
Expand Down Expand Up @@ -67,6 +67,6 @@
"url": "https://github.com/moo-man/AoS-Soulbound-FoundryVTT",
"socket": true,
"manifest": "https://github.com/moo-man/AoS-Soulbound-FoundryVTT/releases/latest/download/system.json",
"download": "https://github.com/moo-man/AoS-Soulbound-FoundryVTT/releases/download/7.0.0/age-of-sigmar-soulbound.zip",
"download": "https://github.com/moo-man/AoS-Soulbound-FoundryVTT/releases/download/7.0.1/age-of-sigmar-soulbound.zip",
"license": "LICENSE.txt"
}

0 comments on commit 887e6c6

Please sign in to comment.