Add items

This commit is contained in:
2021-02-17 22:38:12 +01:00
parent f57e5030c5
commit 64ef6e3c67
4 changed files with 23 additions and 16 deletions

View File

@ -97,13 +97,17 @@ export class SoSCombat extends Combat {
if (game.user.isGM ) {
for( let combatant of this.combatants) {
let bleeding = combatant.actor.data.items.find( item => item.type == 'consequence' && item.name == 'Bleeding');
combatant.actor.applyConsequenceWound( bleeding.severity, "bleeding" );
combatant.actor.applyConsequenceWound( bleeding.data.severity, "bleeding" );
}
}
}
/* -------------------------------------------- */
closeAction( uniqId) {
// Delete message !
const toDelete = game.messages.filter(it => it.data.content.includes( uniqId ));
toDelete.forEach(it => it.delete());
let action = this.currentActions.find( _action => _action.uniqId == uniqId );
if (action) {
action.isDone = true;
@ -153,7 +157,12 @@ export class SoSCombat extends Combat {
/* -------------------------------------------- */
async setupActorActions(actionConf) {
console.log("Setting combat for phase : ", actionConf);
console.log("Setting combat for phase : ", actionConf, actionConf.uniqId);
// Delete message !
const toDelete = game.messages.filter(it => it.data.content.includes( actionConf.uniqId ));
console.log("MESSAGE : ", toDelete);
toDelete.forEach(it => it.delete());
if ( !this.phaseSetup) this.phaseSetup = {}; // Opportunistic init