mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-07 06:26:13 +01:00
Compare commits
2 commits
1ba08e2f51
...
7943477faa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7943477faa | ||
|
|
eea1b6e6b8 |
8 changed files with 219 additions and 61 deletions
|
|
@ -192,6 +192,10 @@ export default class DhActiveEffectConfig extends foundry.applications.sheets.Ac
|
||||||
...conditional,
|
...conditional,
|
||||||
...game.system.api.data.activeEffects.EffectConditional.getConditionalFieldUseage(conditional.type)
|
...game.system.api.data.activeEffects.EffectConditional.getConditionalFieldUseage(conditional.type)
|
||||||
}));
|
}));
|
||||||
|
partContext.statusChoices = Object.values(CONFIG.statusEffects).map(x => ({
|
||||||
|
id: x.id,
|
||||||
|
label: x.name
|
||||||
|
}));
|
||||||
break;
|
break;
|
||||||
case 'changes':
|
case 'changes':
|
||||||
const fields = this.document.system.schema.fields.changes.element.fields;
|
const fields = this.document.system.schema.fields.changes.element.fields;
|
||||||
|
|
@ -267,6 +271,19 @@ export default class DhActiveEffectConfig extends foundry.applications.sheets.Ac
|
||||||
event.target.name.endsWith('type')
|
event.target.name.endsWith('type')
|
||||||
) {
|
) {
|
||||||
const container = event.target.closest('.conditional-container');
|
const container = event.target.closest('.conditional-container');
|
||||||
|
|
||||||
|
const statusSelect = container.querySelector('.form-group.status-select');
|
||||||
|
const attributeAuto = container.querySelector('.form-group.attribute-auto');
|
||||||
|
if (event.target.value === CONFIG.DH.GENERAL.activeEffectConditionalType.status.id) {
|
||||||
|
statusSelect.classList.remove('not-visible');
|
||||||
|
attributeAuto.classList.add('not-visible');
|
||||||
|
} else {
|
||||||
|
statusSelect.classList.add('not-visible');
|
||||||
|
attributeAuto.classList.remove('not-visible');
|
||||||
|
}
|
||||||
|
statusSelect.querySelector('select').selectedIndex = '-1';
|
||||||
|
attributeAuto.querySelector('input').value = '';
|
||||||
|
|
||||||
const { usesValue, usesComparator } =
|
const { usesValue, usesComparator } =
|
||||||
game.system.api.data.activeEffects.EffectConditional.getConditionalFieldUseage(event.target.value);
|
game.system.api.data.activeEffects.EffectConditional.getConditionalFieldUseage(event.target.value);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,12 +21,14 @@ export class EffectConditionals extends foundry.data.fields.ArrayField {
|
||||||
x => !x.disabled && x.statuses.has(conditional.key)
|
x => !x.disabled && x.statuses.has(conditional.key)
|
||||||
);
|
);
|
||||||
if (!hasStatus) return true;
|
if (!hasStatus) return true;
|
||||||
|
break;
|
||||||
case CONFIG.DH.GENERAL.activeEffectConditionalType.attribute.id:
|
case CONFIG.DH.GENERAL.activeEffectConditionalType.attribute.id:
|
||||||
const actorValue = foundry.utils.getProperty(actor, conditional.key);
|
const actorValue = foundry.utils.getProperty(actor, conditional.key);
|
||||||
const conditionalValue = game.system.api.documents.DhActiveEffect.effectSafeEval(
|
const conditionalValue = game.system.api.documents.DhActiveEffect.effectSafeEval(
|
||||||
itemAbleRollParse(conditional.value, actor)
|
itemAbleRollParse(conditional.value, actor)
|
||||||
);
|
);
|
||||||
if (!compareValues(actorValue, conditionalValue, conditional.comparator)) return true;
|
if (!compareValues(actorValue, conditionalValue, conditional.comparator)) return true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,9 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect {
|
||||||
|
|
||||||
/**@override */
|
/**@override */
|
||||||
get isSuppressed() {
|
get isSuppressed() {
|
||||||
|
const conditionalSuspended = game.system.api.data.activeEffects.EffectConditionals.isConditionalSuspended(this);
|
||||||
|
if (conditionalSuspended) return true;
|
||||||
|
|
||||||
// If this is a copied effect from an attachment, never suppress it
|
// If this is a copied effect from an attachment, never suppress it
|
||||||
// (These effects have attachmentSource metadata)
|
// (These effects have attachmentSource metadata)
|
||||||
if (this.flags?.daggerheart?.attachmentSource) {
|
if (this.flags?.daggerheart?.attachmentSource) {
|
||||||
|
|
@ -26,9 +29,6 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect {
|
||||||
return isVaultSupressed || domainTouchedSupressed;
|
return isVaultSupressed || domainTouchedSupressed;
|
||||||
}
|
}
|
||||||
|
|
||||||
const conditionalSuspended = game.system.api.data.activeEffects.EffectConditionals.isConditionalSuspended(this);
|
|
||||||
if (conditionalSuspended) return true;
|
|
||||||
|
|
||||||
return super.isSuppressed;
|
return super.isSuppressed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,27 +28,36 @@
|
||||||
"type": "withinRange",
|
"type": "withinRange",
|
||||||
"target": "hostile",
|
"target": "hostile",
|
||||||
"range": "melee"
|
"range": "melee"
|
||||||
}
|
},
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"key": "system.rules.damageReduction.thresholdImmunities.minor",
|
||||||
|
"value": 1,
|
||||||
|
"priority": null,
|
||||||
|
"type": "override"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"duration": {
|
||||||
|
"type": ""
|
||||||
|
},
|
||||||
|
"conditionals": [
|
||||||
|
{
|
||||||
|
"type": "attribute",
|
||||||
|
"key": "system.resources.hitPoints.value",
|
||||||
|
"value": "@system.resources.hitPoints.max - 2",
|
||||||
|
"comparator": "gte",
|
||||||
|
"target": "self"
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"_id": "UJTsJlnhi5Zi0XQ2",
|
"_id": "UJTsJlnhi5Zi0XQ2",
|
||||||
"img": "systems/daggerheart/assets/icons/domains/domain-card/bone.png",
|
"img": "systems/daggerheart/assets/icons/domains/domain-card/bone.png",
|
||||||
"changes": [
|
"disabled": false,
|
||||||
{
|
|
||||||
"key": "system.rules.damageReduction.thresholdImmunities.minor",
|
|
||||||
"mode": 5,
|
|
||||||
"value": "1",
|
|
||||||
"priority": null
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"disabled": true,
|
|
||||||
"duration": {
|
"duration": {
|
||||||
"startTime": null,
|
"value": null,
|
||||||
"combat": null,
|
"units": "seconds",
|
||||||
"seconds": null,
|
"expiry": null,
|
||||||
"rounds": null,
|
"expired": false
|
||||||
"turns": null,
|
|
||||||
"startRound": null,
|
|
||||||
"startTurn": null
|
|
||||||
},
|
},
|
||||||
"description": "<p class=\"Body\">When you have 2 or fewer Hit Points unmarked, you don’t take Minor damage.</p>",
|
"description": "<p class=\"Body\">When you have 2 or fewer Hit Points unmarked, you don’t take Minor damage.</p>",
|
||||||
"origin": null,
|
"origin": null,
|
||||||
|
|
@ -60,6 +69,16 @@
|
||||||
"_stats": {
|
"_stats": {
|
||||||
"compendiumSource": null
|
"compendiumSource": null
|
||||||
},
|
},
|
||||||
|
"start": {
|
||||||
|
"time": 0,
|
||||||
|
"combat": null,
|
||||||
|
"combatant": null,
|
||||||
|
"initiative": null,
|
||||||
|
"round": null,
|
||||||
|
"turn": null
|
||||||
|
},
|
||||||
|
"showIcon": 1,
|
||||||
|
"folder": null,
|
||||||
"_key": "!items.effects!zbxPl81kbWEegKQN.UJTsJlnhi5Zi0XQ2"
|
"_key": "!items.effects!zbxPl81kbWEegKQN.UJTsJlnhi5Zi0XQ2"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -30,31 +30,40 @@
|
||||||
"type": "withinRange",
|
"type": "withinRange",
|
||||||
"target": "hostile",
|
"target": "hostile",
|
||||||
"range": "melee"
|
"range": "melee"
|
||||||
}
|
|
||||||
},
|
|
||||||
"changes": [
|
|
||||||
{
|
|
||||||
"key": "system.bonuses.damage.physical.bonus",
|
|
||||||
"mode": 2,
|
|
||||||
"value": "@system.levelData.level.current",
|
|
||||||
"priority": null
|
|
||||||
},
|
},
|
||||||
{
|
"changes": [
|
||||||
"key": "system.bonuses.damage.magical.bonus",
|
{
|
||||||
"mode": 2,
|
"key": "system.bonuses.damage.physical.bonus",
|
||||||
"value": "@system.levelData.level.current",
|
"value": "@system.levelData.level.current",
|
||||||
"priority": null
|
"priority": null,
|
||||||
}
|
"type": "add"
|
||||||
],
|
},
|
||||||
"disabled": true,
|
{
|
||||||
|
"key": "system.bonuses.damage.magical.bonus",
|
||||||
|
"value": "@system.levelData.level.current",
|
||||||
|
"priority": null,
|
||||||
|
"type": "add"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"duration": {
|
||||||
|
"type": ""
|
||||||
|
},
|
||||||
|
"conditionals": [
|
||||||
|
{
|
||||||
|
"type": "status",
|
||||||
|
"key": "vulnerable",
|
||||||
|
"value": "",
|
||||||
|
"comparator": "eq",
|
||||||
|
"target": "self"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"disabled": false,
|
||||||
"duration": {
|
"duration": {
|
||||||
"startTime": null,
|
"value": null,
|
||||||
"combat": null,
|
"units": "seconds",
|
||||||
"seconds": null,
|
"expiry": null,
|
||||||
"rounds": null,
|
"expired": false
|
||||||
"turns": null,
|
|
||||||
"startRound": null,
|
|
||||||
"startTurn": null
|
|
||||||
},
|
},
|
||||||
"description": "<p>While you're Vulnerable, add your level to your damage rolls.</p>",
|
"description": "<p>While you're Vulnerable, add your level to your damage rolls.</p>",
|
||||||
"tint": "#ffffff",
|
"tint": "#ffffff",
|
||||||
|
|
@ -64,6 +73,16 @@
|
||||||
"_stats": {
|
"_stats": {
|
||||||
"compendiumSource": null
|
"compendiumSource": null
|
||||||
},
|
},
|
||||||
|
"start": {
|
||||||
|
"time": 0,
|
||||||
|
"combat": null,
|
||||||
|
"combatant": null,
|
||||||
|
"initiative": null,
|
||||||
|
"round": null,
|
||||||
|
"turn": null
|
||||||
|
},
|
||||||
|
"showIcon": 1,
|
||||||
|
"folder": null,
|
||||||
"_key": "!items.effects!uByM34yQlw38yf1V.HMx9uZ54mvMiH95x"
|
"_key": "!items.effects!uByM34yQlw38yf1V.HMx9uZ54mvMiH95x"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -26,27 +26,36 @@
|
||||||
"type": "withinRange",
|
"type": "withinRange",
|
||||||
"target": "hostile",
|
"target": "hostile",
|
||||||
"range": "melee"
|
"range": "melee"
|
||||||
}
|
},
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"key": "system.evasion",
|
||||||
|
"value": "@system.proficiency",
|
||||||
|
"priority": 21,
|
||||||
|
"type": "add"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"duration": {
|
||||||
|
"type": ""
|
||||||
|
},
|
||||||
|
"conditionals": [
|
||||||
|
{
|
||||||
|
"type": "attribute",
|
||||||
|
"key": "system.resources.hope.value",
|
||||||
|
"value": "2",
|
||||||
|
"comparator": "gte",
|
||||||
|
"target": "self"
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"_id": "0i7GVOvjH6bK5AUM",
|
"_id": "0i7GVOvjH6bK5AUM",
|
||||||
"img": "icons/magic/defensive/barrier-shield-dome-blue-purple.webp",
|
"img": "icons/magic/defensive/barrier-shield-dome-blue-purple.webp",
|
||||||
"changes": [
|
|
||||||
{
|
|
||||||
"key": "system.evasion",
|
|
||||||
"mode": 2,
|
|
||||||
"value": "@system.proficiency",
|
|
||||||
"priority": 21
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"disabled": false,
|
"disabled": false,
|
||||||
"duration": {
|
"duration": {
|
||||||
"startTime": null,
|
"value": null,
|
||||||
"combat": null,
|
"units": "seconds",
|
||||||
"seconds": null,
|
"expiry": null,
|
||||||
"rounds": null,
|
"expired": false
|
||||||
"turns": null,
|
|
||||||
"startRound": null,
|
|
||||||
"startTurn": null
|
|
||||||
},
|
},
|
||||||
"description": "<p>While you have at least 2 Hope, you add your Proficiency to your Evasion.</p>",
|
"description": "<p>While you have at least 2 Hope, you add your Proficiency to your Evasion.</p>",
|
||||||
"origin": null,
|
"origin": null,
|
||||||
|
|
@ -58,6 +67,16 @@
|
||||||
"_stats": {
|
"_stats": {
|
||||||
"compendiumSource": null
|
"compendiumSource": null
|
||||||
},
|
},
|
||||||
|
"start": {
|
||||||
|
"time": 0,
|
||||||
|
"combat": null,
|
||||||
|
"combatant": null,
|
||||||
|
"initiative": null,
|
||||||
|
"round": null,
|
||||||
|
"turn": null
|
||||||
|
},
|
||||||
|
"showIcon": 1,
|
||||||
|
"folder": null,
|
||||||
"_key": "!items.effects!oirsCnN66GOlK3Fa.0i7GVOvjH6bK5AUM"
|
"_key": "!items.effects!oirsCnN66GOlK3Fa.0i7GVOvjH6bK5AUM"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,72 @@
|
||||||
"artist": ""
|
"artist": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"effects": [],
|
"effects": [
|
||||||
|
{
|
||||||
|
"name": "Rise To The Challenge",
|
||||||
|
"type": "base",
|
||||||
|
"system": {
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"key": "system.rules.dualityRoll.defaultHopeDice",
|
||||||
|
"type": "upgrade",
|
||||||
|
"value": 20,
|
||||||
|
"priority": null,
|
||||||
|
"phase": "initial"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"conditionals": [
|
||||||
|
{
|
||||||
|
"type": "attribute",
|
||||||
|
"key": "system.resources.hitPoints.value",
|
||||||
|
"value": "@system.resources.hitPoints.max - 2",
|
||||||
|
"comparator": "gte",
|
||||||
|
"target": "self"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"duration": {
|
||||||
|
"description": "",
|
||||||
|
"type": ""
|
||||||
|
},
|
||||||
|
"rangeDependence": {
|
||||||
|
"enabled": false,
|
||||||
|
"type": "withinRange",
|
||||||
|
"target": "hostile",
|
||||||
|
"range": "melee"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"_id": "MA744uJrGMQCDywg",
|
||||||
|
"img": "icons/magic/control/debuff-energy-hold-levitate-yellow.webp",
|
||||||
|
"disabled": false,
|
||||||
|
"start": {
|
||||||
|
"time": 0,
|
||||||
|
"combat": null,
|
||||||
|
"combatant": null,
|
||||||
|
"initiative": null,
|
||||||
|
"round": null,
|
||||||
|
"turn": null
|
||||||
|
},
|
||||||
|
"duration": {
|
||||||
|
"value": null,
|
||||||
|
"units": "seconds",
|
||||||
|
"expiry": null,
|
||||||
|
"expired": false
|
||||||
|
},
|
||||||
|
"description": "<p>While you have 2 or fewer Hit Points unmarked, you can roll a d20 as your Hope Die.</p>",
|
||||||
|
"origin": null,
|
||||||
|
"tint": "#ffffff",
|
||||||
|
"transfer": true,
|
||||||
|
"statuses": [],
|
||||||
|
"showIcon": 1,
|
||||||
|
"folder": null,
|
||||||
|
"sort": 0,
|
||||||
|
"flags": {},
|
||||||
|
"_stats": {
|
||||||
|
"compendiumSource": null
|
||||||
|
},
|
||||||
|
"_key": "!items.effects!dcutk8RVOJ2sEkO1.MA744uJrGMQCDywg"
|
||||||
|
}
|
||||||
|
],
|
||||||
"sort": 0,
|
"sort": 0,
|
||||||
"ownership": {
|
"ownership": {
|
||||||
"default": 0,
|
"default": 0,
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,24 @@
|
||||||
<div class="conditional-container">
|
<div class="conditional-container">
|
||||||
{{!-- {{formGroup ../systemFields.conditionals.element.fields.target value=conditional.target name=(concat "system.conditionals." index ".target") localize=true }} --}}
|
{{!-- {{formGroup ../systemFields.conditionals.element.fields.target value=conditional.target name=(concat "system.conditionals." index ".target") localize=true }} --}}
|
||||||
{{formGroup ../systemFields.conditionals.element.fields.type value=conditional.type name=(concat "system.conditionals." index ".type") localize=true }}
|
{{formGroup ../systemFields.conditionals.element.fields.type value=conditional.type name=(concat "system.conditionals." index ".type") localize=true }}
|
||||||
{{formGroup ../systemFields.conditionals.element.fields.key value=conditional.key name=(concat "system.conditionals." index ".key") localize=true }}
|
|
||||||
|
<div class="form-group status-select {{#unless (eq conditional.type 'status')}}not-visible{{/unless}}">
|
||||||
|
<label>{{localize "EFFECT.FIELDS.changes.element.key.label"}}</label>
|
||||||
|
|
||||||
|
<div class="form-fields">
|
||||||
|
<select name="{{concat "system.conditionals." index ".key"}}">
|
||||||
|
{{selectOptions ../statusChoices selected=conditional.key labelAttr="label" valueAttr="id" blank="" localize=true}}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group attribute-auto {{#unless (eq conditional.type 'attribute')}}not-visible{{/unless}}">
|
||||||
|
<label>{{localize "EFFECT.FIELDS.changes.element.key.label"}}</label>
|
||||||
|
|
||||||
|
<div class="form-fields">
|
||||||
|
<input type="text" class="effect-change-input" name="{{concat "system.conditionals." index ".key"}}" value="{{conditional.key}}" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group value {{#unless conditional.usesValue}}not-visible{{/unless}}">
|
<div class="form-group value {{#unless conditional.usesValue}}not-visible{{/unless}}">
|
||||||
<label>{{localize "EFFECT.FIELDS.changes.element.value.label"}}</label>
|
<label>{{localize "EFFECT.FIELDS.changes.element.value.label"}}</label>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue