mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-07 22:46:12 +01:00
Temp
This commit is contained in:
parent
eb647f1e31
commit
97f8da69cd
5 changed files with 57 additions and 18 deletions
|
|
@ -1620,6 +1620,9 @@
|
||||||
},
|
},
|
||||||
"macro": {
|
"macro": {
|
||||||
"name": "Macro"
|
"name": "Macro"
|
||||||
|
},
|
||||||
|
"beastform": {
|
||||||
|
"name": "Beastform"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Settings": {
|
"Settings": {
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,11 @@ export const actionTypes = {
|
||||||
id: 'macro',
|
id: 'macro',
|
||||||
name: 'DAGGERHEART.Actions.Types.macro.name',
|
name: 'DAGGERHEART.Actions.Types.macro.name',
|
||||||
icon: 'fa-scroll'
|
icon: 'fa-scroll'
|
||||||
|
},
|
||||||
|
beastform: {
|
||||||
|
id: 'beastform',
|
||||||
|
name: 'DAGGERHEART.Actions.Types.beastform.name',
|
||||||
|
icon: 'fa-paw'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import {
|
import {
|
||||||
DHAttackAction,
|
DHAttackAction,
|
||||||
DHBaseAction,
|
DHBaseAction,
|
||||||
|
DhBeastformAction,
|
||||||
DHDamageAction,
|
DHDamageAction,
|
||||||
DHEffectAction,
|
DHEffectAction,
|
||||||
DHHealingAction,
|
DHHealingAction,
|
||||||
|
|
@ -19,5 +20,6 @@ export const actionsTypes = {
|
||||||
healing: DHHealingAction,
|
healing: DHHealingAction,
|
||||||
summon: DHSummonAction,
|
summon: DHSummonAction,
|
||||||
effect: DHEffectAction,
|
effect: DHEffectAction,
|
||||||
macro: DHMacroAction
|
macro: DHMacroAction,
|
||||||
|
beastform: DhBeastformAction
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -270,6 +270,10 @@ export class DHBaseAction extends foundry.abstract.DataModel {
|
||||||
}) */
|
}) */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this instanceof DhBeastformAction) {
|
||||||
|
console.log('Test');
|
||||||
|
}
|
||||||
|
|
||||||
if (this.doFollowUp()) {
|
if (this.doFollowUp()) {
|
||||||
if (this.rollDamage) await this.rollDamage(event, config);
|
if (this.rollDamage) await this.rollDamage(event, config);
|
||||||
if (this.rollHealing) await this.rollHealing(event, config);
|
if (this.rollHealing) await this.rollHealing(event, config);
|
||||||
|
|
@ -402,11 +406,18 @@ export class DHBaseAction extends foundry.abstract.DataModel {
|
||||||
hasCost(costs) {
|
hasCost(costs) {
|
||||||
const realCosts = this.getRealCosts(costs),
|
const realCosts = this.getRealCosts(costs),
|
||||||
hasFearCost = realCosts.findIndex(c => c.type === 'fear');
|
hasFearCost = realCosts.findIndex(c => c.type === 'fear');
|
||||||
if(hasFearCost > -1) {
|
if (hasFearCost > -1) {
|
||||||
const fearCost = realCosts.splice(hasFearCost, 1);
|
const fearCost = realCosts.splice(hasFearCost, 1);
|
||||||
if(!game.user.isGM || fearCost[0].total > game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Resources.Fear)) return false;
|
if (
|
||||||
|
!game.user.isGM ||
|
||||||
|
fearCost[0].total > game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Resources.Fear)
|
||||||
|
)
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
return realCosts.reduce((a, c) => a && this.actor.system.resources[c.type]?.value >= (c.total ?? c.value), true);
|
return realCosts.reduce(
|
||||||
|
(a, c) => a && this.actor.system.resources[c.type]?.value >= (c.total ?? c.value),
|
||||||
|
true
|
||||||
|
);
|
||||||
}
|
}
|
||||||
/* COST */
|
/* COST */
|
||||||
|
|
||||||
|
|
@ -498,19 +509,25 @@ export class DHBaseAction extends foundry.abstract.DataModel {
|
||||||
|
|
||||||
/* SAVE */
|
/* SAVE */
|
||||||
async rollSave(target, event, message) {
|
async rollSave(target, event, message) {
|
||||||
if(!target?.actor) return;
|
if (!target?.actor) return;
|
||||||
return target.actor.diceRoll({
|
return target.actor
|
||||||
event,
|
.diceRoll({
|
||||||
title: 'Roll Save',
|
event,
|
||||||
roll: {
|
title: 'Roll Save',
|
||||||
trait: this.save.trait,
|
roll: {
|
||||||
difficulty: this.save.difficulty,
|
trait: this.save.trait,
|
||||||
type: "reaction"
|
difficulty: this.save.difficulty,
|
||||||
},
|
type: 'reaction'
|
||||||
data: target.actor.getRollData()
|
},
|
||||||
}).then(async (result) => {
|
data: target.actor.getRollData()
|
||||||
if(result) this.updateChatMessage(message, target.id, {result: result.roll.total, success: result.roll.success});
|
})
|
||||||
})
|
.then(async result => {
|
||||||
|
if (result)
|
||||||
|
this.updateChatMessage(message, target.id, {
|
||||||
|
result: result.roll.total,
|
||||||
|
success: result.roll.success
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async updateChatMessage(message, targetId, changes, chain = true) {
|
async updateChatMessage(message, targetId, changes, chain = true) {
|
||||||
|
|
@ -743,3 +760,15 @@ export class DHMacroAction extends DHBaseAction {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class DhBeastformAction extends DHBaseAction {
|
||||||
|
static defineSchema() {
|
||||||
|
return {
|
||||||
|
...super.defineSchema(),
|
||||||
|
tierAccess: new fields.SchemaField({
|
||||||
|
exact: new fields.NumberField({ integer: true, nullable: true, initial: null }),
|
||||||
|
characterBased: new fields.BooleanField({ initial: true })
|
||||||
|
})
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"compatibility": {
|
"compatibility": {
|
||||||
"minimum": "13",
|
"minimum": "13",
|
||||||
"verified": "13.345",
|
"verified": "13.346",
|
||||||
"maximum": "13"
|
"maximum": "13"
|
||||||
},
|
},
|
||||||
"authors": [
|
"authors": [
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue