Add items
This commit is contained in:
parent
f57e5030c5
commit
64ef6e3c67
@ -229,7 +229,8 @@ export class SoSActor extends Actor {
|
|||||||
consequencesList: duplicate( this.getApplicableConsequences() ),
|
consequencesList: duplicate( this.getApplicableConsequences() ),
|
||||||
wounds: duplicate( this.data.data.wounds),
|
wounds: duplicate( this.data.data.wounds),
|
||||||
malusConsequence: 0,
|
malusConsequence: 0,
|
||||||
bonusConsequence: 0
|
bonusConsequence: 0,
|
||||||
|
woundMalus: 0
|
||||||
}
|
}
|
||||||
let html = await renderTemplate('systems/foundryvtt-shadows-over-sol/templates/dialog-flip.html', flipData);
|
let html = await renderTemplate('systems/foundryvtt-shadows-over-sol/templates/dialog-flip.html', flipData);
|
||||||
new SoSFlipDialog(flipData, html).render(true);
|
new SoSFlipDialog(flipData, html).render(true);
|
||||||
@ -248,7 +249,8 @@ export class SoSActor extends Actor {
|
|||||||
modifierList: SoSUtility.fillRange(-10, +10),
|
modifierList: SoSUtility.fillRange(-10, +10),
|
||||||
tnList: SoSUtility.fillRange(6, 20),
|
tnList: SoSUtility.fillRange(6, 20),
|
||||||
malusConsequence: 0,
|
malusConsequence: 0,
|
||||||
bonusConsequence: 0
|
bonusConsequence: 0,
|
||||||
|
woundMalus: 0
|
||||||
}
|
}
|
||||||
flipData.statList['nostat'] = { label: "No stat (ie defaulting skills)", value: 0, cardsuit: "none" }
|
flipData.statList['nostat'] = { label: "No stat (ie defaulting skills)", value: 0, cardsuit: "none" }
|
||||||
let html = await renderTemplate('systems/foundryvtt-shadows-over-sol/templates/dialog-flip.html', flipData);
|
let html = await renderTemplate('systems/foundryvtt-shadows-over-sol/templates/dialog-flip.html', flipData);
|
||||||
@ -282,7 +284,9 @@ export class SoSActor extends Actor {
|
|||||||
actor: this,
|
actor: this,
|
||||||
modifierList: SoSUtility.fillRange(-10, +10),
|
modifierList: SoSUtility.fillRange(-10, +10),
|
||||||
tnList: SoSUtility.fillRange(6, 20),
|
tnList: SoSUtility.fillRange(6, 20),
|
||||||
malusConsequence: 0
|
malusConsequence: 0,
|
||||||
|
bonusConsequence: 0,
|
||||||
|
woundMalus: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(flipData);
|
console.log(flipData);
|
||||||
@ -336,7 +340,7 @@ export class SoSActor extends Actor {
|
|||||||
totalWounds: this.data.data.scores.wound.value
|
totalWounds: this.data.data.scores.wound.value
|
||||||
}
|
}
|
||||||
let html = await renderTemplate('systems/foundryvtt-shadows-over-sol/templates/chat-damage-consequence.html', woundData );
|
let html = await renderTemplate('systems/foundryvtt-shadows-over-sol/templates/chat-damage-consequence.html', woundData );
|
||||||
ChatMessage.create( { content: html, whisper: [ChatMessage.getWhisperRecipients(this.name), ChatMessage.getWhisperRecipients("GM") ] } );
|
ChatMessage.create( { content: html, whisper: ChatMessage.getWhisperRecipients(this.name).concat(ChatMessage.getWhisperRecipients("GM")) } );
|
||||||
|
|
||||||
this.checkDeath();
|
this.checkDeath();
|
||||||
}
|
}
|
||||||
|
@ -97,13 +97,17 @@ export class SoSCombat extends Combat {
|
|||||||
if (game.user.isGM ) {
|
if (game.user.isGM ) {
|
||||||
for( let combatant of this.combatants) {
|
for( let combatant of this.combatants) {
|
||||||
let bleeding = combatant.actor.data.items.find( item => item.type == 'consequence' && item.name == 'Bleeding');
|
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) {
|
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 );
|
let action = this.currentActions.find( _action => _action.uniqId == uniqId );
|
||||||
if (action) {
|
if (action) {
|
||||||
action.isDone = true;
|
action.isDone = true;
|
||||||
@ -153,7 +157,12 @@ export class SoSCombat extends Combat {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async setupActorActions(actionConf) {
|
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
|
if ( !this.phaseSetup) this.phaseSetup = {}; // Opportunistic init
|
||||||
|
|
||||||
|
@ -77,12 +77,9 @@ export class SoSDialogCombatActions extends Dialog {
|
|||||||
let combat = game.combats.get( this.combatActions.combatId ); // Get the associated combat
|
let combat = game.combats.get( this.combatActions.combatId ); // Get the associated combat
|
||||||
combat.setupActorActions( msgdata );
|
combat.setupActorActions( msgdata );
|
||||||
} else {
|
} else {
|
||||||
game.socket.emit("system.foundryvtt-reve-de-dragon", {
|
game.socket.emit("system.foundryvtt-shadows-over-sol", {
|
||||||
name: "msg_declare_actions", data: msgdata } );
|
name: "msg_declare_actions", data: msgdata } );
|
||||||
}
|
}
|
||||||
// Delete message !
|
|
||||||
const toDelete = game.messages.filter(it => it.data.content.includes( this.combatActions.uniqId ));
|
|
||||||
toDelete.forEach(it => it.delete());
|
|
||||||
} else {
|
} else {
|
||||||
ui.notifications.warn("Action Points are below 0 ! Please check your phases !");
|
ui.notifications.warn("Action Points are below 0 ! Please check your phases !");
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ export class SoSUtility extends Entity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
onSocketMesssage( msg ) {
|
static onSocketMesssage( msg ) {
|
||||||
if( !game.user.isGM ) return; // Only GM
|
if( !game.user.isGM ) return; // Only GM
|
||||||
|
|
||||||
if (msg.name == 'msg_declare_actions' ) {
|
if (msg.name == 'msg_declare_actions' ) {
|
||||||
@ -120,9 +120,6 @@ export class SoSUtility extends Entity {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static closeAction(event) {
|
static closeAction(event) {
|
||||||
let uniqId = event.currentTarget.attributes['data-uniq-id'].value;
|
let uniqId = event.currentTarget.attributes['data-uniq-id'].value;
|
||||||
// Delete message !
|
|
||||||
const toDelete = game.messages.filter(it => it.data.content.includes( uniqId ));
|
|
||||||
toDelete.forEach(it => it.delete());
|
|
||||||
|
|
||||||
if ( game.user.isGM ) {
|
if ( game.user.isGM ) {
|
||||||
game.combat.closeAction( uniqId );
|
game.combat.closeAction( uniqId );
|
||||||
@ -294,7 +291,7 @@ export class SoSUtility extends Entity {
|
|||||||
flipData.uniqId = randomID(16);
|
flipData.uniqId = randomID(16);
|
||||||
this.registry[flipData.uniqId] = flipData;
|
this.registry[flipData.uniqId] = flipData;
|
||||||
let html = await renderTemplate('systems/foundryvtt-shadows-over-sol/templates/chat-damage-request-dodge.html', flipData );
|
let html = await renderTemplate('systems/foundryvtt-shadows-over-sol/templates/chat-damage-request-dodge.html', flipData );
|
||||||
ChatMessage.create( { content: html, whisper: [ChatMessage.getWhisperRecipients(flipData.target.actor.name), ChatMessage.getWhisperRecipients("GM") ] } );
|
ChatMessage.create( { content: html, whisper: ChatMessage.getWhisperRecipients(flipData.target.actor.name).concat(ChatMessage.getWhisperRecipients("GM")) } );
|
||||||
return; // Wait message response
|
return; // Wait message response
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user