Compare commits
11 Commits
foundryvtt
...
foundryvtt
Author | SHA1 | Date | |
---|---|---|---|
aa243a7b80 | |||
c061b67bb3 | |||
c6c8622552 | |||
f6104e533c | |||
23b6a41eac | |||
f0c5e7b95d | |||
4b9af6a383 | |||
d94c1a4dce | |||
bef1750231 | |||
1f0506f5c2 | |||
e52b62a314 |
@ -22,7 +22,7 @@ export class SoSActorSheet extends ActorSheet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
getData() {
|
async getData() {
|
||||||
const objectData = this.object
|
const objectData = this.object
|
||||||
let formData = {
|
let formData = {
|
||||||
title: this.title,
|
title: this.title,
|
||||||
@ -34,6 +34,9 @@ export class SoSActorSheet extends ActorSheet {
|
|||||||
cssClass: this.isEditable ? "editable" : "locked",
|
cssClass: this.isEditable ? "editable" : "locked",
|
||||||
data: foundry.utils.deepClone(this.object.system),
|
data: foundry.utils.deepClone(this.object.system),
|
||||||
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
|
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
|
||||||
|
history: await TextEditor.enrichHTML(this.object.system.history, {async: true}),
|
||||||
|
notes: await TextEditor.enrichHTML(this.object.system.notes, {async: true}),
|
||||||
|
gmnotes: await TextEditor.enrichHTML(this.object.system.gmnotes, {async: true}),
|
||||||
limited: this.object.limited,
|
limited: this.object.limited,
|
||||||
options: this.options,
|
options: this.options,
|
||||||
owner: this.document.isOwner
|
owner: this.document.isOwner
|
||||||
|
@ -335,7 +335,7 @@ export class SoSActor extends Actor {
|
|||||||
totalWounds: this.system.scores.wound.value
|
totalWounds: this.system.scores.wound.value
|
||||||
}
|
}
|
||||||
let html = await renderTemplate('systems/foundryvtt-shadows-over-sol/templates/chat-character-death.html', woundData );
|
let html = await renderTemplate('systems/foundryvtt-shadows-over-sol/templates/chat-character-death.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") ) } )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -369,7 +369,7 @@ export class SoSActor extends Actor {
|
|||||||
totalWounds: this.system.scores.wound.value
|
totalWounds: this.system.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).concat(ChatMessage.getWhisperRecipients("GM")) } );
|
ChatMessage.create( { content: html, whisper: ChatMessage.getWhisperRecipients(this.name).concat(ChatMessage.getWhisperRecipients("GM")) } )
|
||||||
|
|
||||||
this.checkDeath();
|
this.checkDeath();
|
||||||
}
|
}
|
||||||
@ -388,10 +388,10 @@ export class SoSActor extends Actor {
|
|||||||
if ( alreadyInside.length >= container.system.container ) {
|
if ( alreadyInside.length >= container.system.container ) {
|
||||||
ui.notifications.warn("Container is already full !");
|
ui.notifications.warn("Container is already full !");
|
||||||
} else {
|
} else {
|
||||||
await this.updateEmbeddedDocuments( "Item", [{ _id: object.id, 'system.containerid':containerId }]);
|
setTimeout(function() { this.updateEmbeddedDocuments( "Item", [{ _id: object.id, 'system.containerid':containerId }])}, 800 )
|
||||||
}
|
}
|
||||||
} else if ( object && object.system.containerid) { // remove from container
|
} else if ( object && object.system.containerid) { // remove from container
|
||||||
await this.updateEmbeddedDocuments( "Item", [{ _id: object.id, 'system.containerid':"" }]);
|
setTimeout(function() { this.updateEmbeddedDocuments( "Item", [{ _id: object.id, 'system.containerid':"" }])}, 800 )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -399,7 +399,7 @@ export class SoSActor extends Actor {
|
|||||||
async applyWounds( flipData ) {
|
async applyWounds( flipData ) {
|
||||||
if ( flipData.damageStatus == 'no_damage') {
|
if ( flipData.damageStatus == 'no_damage') {
|
||||||
let html = await renderTemplate('systems/foundryvtt-shadows-over-sol/templates/chat-nodamage-taken.html', flipData );
|
let html = await renderTemplate('systems/foundryvtt-shadows-over-sol/templates/chat-nodamage-taken.html', flipData );
|
||||||
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")) } );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -437,7 +437,7 @@ export class SoSActor extends Actor {
|
|||||||
flipData.currentWounds = sumWound;
|
flipData.currentWounds = sumWound;
|
||||||
flipData.totalWounds = this.system.scores.wound.value;
|
flipData.totalWounds = this.system.scores.wound.value;
|
||||||
let html = await renderTemplate('systems/foundryvtt-shadows-over-sol/templates/chat-damage-taken.html', flipData );
|
let html = await renderTemplate('systems/foundryvtt-shadows-over-sol/templates/chat-damage-taken.html', flipData );
|
||||||
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();
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,8 @@ export class SoSItemSheet extends ItemSheet {
|
|||||||
effects: this.object.effects.map(e => foundry.utils.deepClone(e.system)),
|
effects: this.object.effects.map(e => foundry.utils.deepClone(e.system)),
|
||||||
limited: this.object.limited,
|
limited: this.object.limited,
|
||||||
options: this.options,
|
options: this.options,
|
||||||
owner: this.document.isOwner
|
owner: this.document.isOwner,
|
||||||
|
description: await TextEditor.enrichHTML(this.object.system.description, {async: true}),
|
||||||
};
|
};
|
||||||
|
|
||||||
formData.isGM = game.user.isGM;
|
formData.isGM = game.user.isGM;
|
||||||
@ -66,6 +67,12 @@ export class SoSItemSheet extends ItemSheet {
|
|||||||
if ( objectData.type == 'skill' && this.object.options?.actor) {
|
if ( objectData.type == 'skill' && this.object.options?.actor) {
|
||||||
formData.skillExperienceList = this.object.options.actor.getSkillExperience( objectData.name )
|
formData.skillExperienceList = this.object.options.actor.getSkillExperience( objectData.name )
|
||||||
}
|
}
|
||||||
|
if ( objectData.type == 'geneline') {
|
||||||
|
formData.weakness = await TextEditor.enrichHTML(this.object.system.weakness, {async: true})
|
||||||
|
}
|
||||||
|
if ( objectData.type == 'malady') {
|
||||||
|
formData.notes = await TextEditor.enrichHTML(this.object.system.notes, {async: true})
|
||||||
|
}
|
||||||
return formData;
|
return formData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,26 +5,30 @@ import { SoSDialogCombatActions } from "./sos-dialog-combat-actions.js";
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
export class SoSCombat extends Combat {
|
export class SoSCombat extends Combat {
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
requestActions() {
|
requestActions() {
|
||||||
if ( game.user.isGM && !this.actionsRequested) {
|
if (game.user.isGM && !this.actionsRequested) {
|
||||||
console.log("REQUEST ACTIONS !!!");
|
console.log("REQUEST ACTIONS !!!")
|
||||||
this.actionsRequested = true;
|
this.actionsRequested = true;
|
||||||
this.phaseSetup = {}; // Reset each new round/update
|
this.phaseSetup = {}; // Reset each new round/update
|
||||||
for( let combatant of this.combatants) {
|
for (let combatant of this.combatants) {
|
||||||
this.setInitiative(combatant._id, -1 ); // Reset init
|
this.setInitiative(combatant.id, -1); // Reset init
|
||||||
let uniq = randomID(16);
|
let uniq = randomID(16)
|
||||||
const name = combatant.actor ? combatant.actor.name : combatant.name;
|
const name = combatant.actor ? combatant.actor.name : combatant.name;
|
||||||
if ( combatant.players[0]) {
|
if (combatant.players && combatant.players[0]) {
|
||||||
// A player controls this combatant -> message !
|
// A player controls this combatant -> message !
|
||||||
ChatMessage.create( { content: `New round ! Click on the button below to declare the actions of ${name} for round ${this.round} !<br>
|
ChatMessage.create({
|
||||||
<a class='chat-card-button' id='button-declare-actions' data-uniq-id='${uniq}' data-combatant-id='${combatant._id}' data-combat-id='${this._id}' data-round='${this.round}'>Declare actions</a>`,
|
content: `New round ! Click on the button below to declare the actions of ${name} for round ${this.round} !<br>
|
||||||
whisper: [ combatant.players[0].data._id] } );
|
<a class='chat-card-button' id='button-declare-actions' data-uniq-id='${uniq}' data-combatant-id='${combatant.id}' data-combat-id='${this.id}' data-round='${this.round}'>Declare actions</a>`,
|
||||||
|
whisper: [combatant.players[0].id]
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
ChatMessage.create( { content: `New round ! Click on the button below to declare the actions of ${name} for round ${this.round} !<br>
|
ChatMessage.create({
|
||||||
<a class='chat-card-button' id='button-declare-actions' data-uniq-id='${uniq}' data-combatant-id='${combatant._id}' data-combat-id='${this._id}' data-round='${this.round}'>Declare actions</a>`,
|
content: `New round ! Click on the button below to declare the actions of ${name} for round ${this.round} !<br>
|
||||||
whisper: [ ChatMessage.getWhisperRecipients("GM") ] } );
|
<a class='chat-card-button' id='button-declare-actions' data-uniq-id='${uniq}' data-combatant-id='${combatant.id}' data-combat-id='${this.id}' data-round='${this.round}'>Declare actions</a>`,
|
||||||
|
whisper: ChatMessage.getWhisperRecipients("GM"),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -39,56 +43,61 @@ export class SoSCombat extends Combat {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
gotoNextTurn() {
|
gotoNextTurn() {
|
||||||
this.phaseNumber -= 1;
|
this.phaseNumber -= 1;
|
||||||
if ( this.phaseNumber <= 0) {
|
if (this.phaseNumber <= 0) {
|
||||||
this.applyConsequences();
|
this.applyConsequences();
|
||||||
this.nextRound(); // Auto-switch to next round
|
this.nextRound(); // Auto-switch to next round
|
||||||
} else {
|
} else {
|
||||||
this.nextTurn();
|
this.nextTurn();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async nextTurn() {
|
async nextTurn() {
|
||||||
console.log("Going to phase !", this.phaseNumber );
|
console.log("Going to phase !", this.phaseNumber);
|
||||||
// Get all actions for this phase
|
// Get all actions for this phase
|
||||||
let phaseIndex = this.phaseNumber - 1;
|
let phaseIndex = this.phaseNumber - 1;
|
||||||
let actionList = [];
|
let actionList = [];
|
||||||
let actionMsg = `<h4>Actions for phase ${this.phaseNumber}</h4>`;
|
let actionMsg = `<h4>Actions for phase ${this.phaseNumber}</h4>`;
|
||||||
for (let combatantId in this.phaseSetup ) {
|
for (let combatantId in this.phaseSetup) {
|
||||||
let actionData = this.phaseSetup[combatantId];
|
let actionData = this.phaseSetup[combatantId];
|
||||||
if ( actionData.phaseArray[phaseIndex].name != 'No Action' ) {
|
if (actionData.phaseArray[phaseIndex].name != 'No Action') {
|
||||||
let combatant = this.combatants.find( comb => comb._id == actionData.combatantId);
|
let combatant = this.combatants.find(comb => comb._id == actionData.combatantId);
|
||||||
const name = combatant.actor ? combatant.actor.data.name : combatant.name;
|
const name = combatant.actor ? combatant.actor.name : combatant.name;
|
||||||
actionList.push( { combatant: combatant,
|
actionList.push({
|
||||||
action: actionData.phaseArray[phaseIndex],
|
combatant: combatant,
|
||||||
isDone: false
|
action: actionData.phaseArray[phaseIndex],
|
||||||
});
|
isDone: false
|
||||||
|
});
|
||||||
actionMsg += `<br>${name} is going to : ${actionData.phaseArray[phaseIndex].name}`;
|
actionMsg += `<br>${name} is going to : ${actionData.phaseArray[phaseIndex].name}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( actionList.length == 0) {
|
if (actionList.length == 0) {
|
||||||
actionMsg += "<br>No actions for the phase !";
|
actionMsg += "<br>No actions for the phase !";
|
||||||
this.gotoNextTurn();
|
this.gotoNextTurn();
|
||||||
}
|
}
|
||||||
// Display a nice message
|
// Display a nice message
|
||||||
ChatMessage.create( { content: actionMsg });
|
ChatMessage.create({ content: actionMsg });
|
||||||
|
|
||||||
// Now push specific messages
|
// Now push specific messages
|
||||||
for ( let action of actionList) {
|
for (let action of actionList) {
|
||||||
let uniq = randomID(16);
|
let uniq = randomID(16);
|
||||||
action.uniqId = uniq; // Easy tracking with chat messages
|
action.uniqId = uniq; // Easy tracking with chat messages
|
||||||
const name = action.combatant.actor ? action.combatant.actor.data.name : action.combatant.name;
|
const name = action.combatant.actor ? action.combatant.actor.name : action.combatant.name;
|
||||||
if ( action.combatant.players[0]) {
|
if (action.combatant.players[0]) {
|
||||||
// A player controls this combatant -> message !
|
// A player controls this combatant -> message !
|
||||||
ChatMessage.create( { content: `Phase ${this.phaseNumber} ! ${name} must perform a <strong>${action.action.name}</strong> action.
|
ChatMessage.create({
|
||||||
|
content: `Phase ${this.phaseNumber} ! ${name} must perform a <strong>${action.action.name}</strong> action.
|
||||||
When done, click on the button below to close the action.
|
When done, click on the button below to close the action.
|
||||||
<a class='chat-card-button' id='button-end-action' data-uniq-id='${uniq}' data-combatant-id='${action.combatant._id}' data-combat-id='${this._id}' data-round='${this.round}'>Action is done !</a>`,
|
<a class='chat-card-button' id='button-end-action' data-uniq-id='${uniq}' data-combatant-id='${action.combatant.id}' data-combat-id='${this.id}' data-round='${this.round}'>Action is done !</a>`,
|
||||||
whisper: [ action.combatant.players[0].data._id] } );
|
whisper: [action.combatant.players[0].id]
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
ChatMessage.create( { content: `Phase ${this.phaseNumber} ! ${name} must perform a <strong>${action.action.name}</strong> action.<br>
|
ChatMessage.create({
|
||||||
|
content: `Phase ${this.phaseNumber} ! ${name} must perform a <strong>${action.action.name}</strong> action.<br>
|
||||||
When done, click on the button below to close the action.
|
When done, click on the button below to close the action.
|
||||||
<a class='chat-card-button' id='button-end-action' data-uniq-id='${uniq}' data-combatant-id='${action.combatant._id}' data-combat-id='${this._id}' data-round='${this.round}'>Action is done !</a>`,
|
<a class='chat-card-button' id='button-end-action' data-uniq-id='${uniq}' data-combatant-id='${action.combatant.id}' data-combat-id='${this.id}' data-round='${this.round}'>Action is done !</a>`,
|
||||||
whisper: [ ChatMessage.getWhisperRecipients("GM") ] } );
|
whisper: ChatMessage.getWhisperRecipients("GM")
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Save for easy access
|
// Save for easy access
|
||||||
@ -96,28 +105,28 @@ export class SoSCombat extends Combat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
applyConsequences( ) {
|
applyConsequences() {
|
||||||
if (game.user.isGM ) {
|
if (game.user.isGM) {
|
||||||
for( let combatant of this.combatants) {
|
for (let combatant of this.combatants) {
|
||||||
if (!combatant.actor) continue; // Can't check tokens without assigned actors, Maybe print chat message about bleeding happening so that the GM can manually track this?
|
if (!combatant.actor) continue; // Can't check tokens without assigned actors, Maybe print chat message about bleeding happening so that the GM can manually track this?
|
||||||
let bleeding = combatant.actor.data.items.find( item => item.type == 'consequence' && item.name == 'Bleeding');
|
let bleeding = combatant.actor.items.find(item => item.type == 'consequence' && item.name == 'Bleeding');
|
||||||
combatant.actor.applyConsequenceWound( bleeding.data.severity, "bleeding" );
|
combatant.actor.applyConsequenceWound(bleeding.system.severity, "bleeding");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
closeAction( uniqId) {
|
closeAction(uniqId) {
|
||||||
// Delete message !
|
// Delete message !
|
||||||
const toDelete = game.messages.filter(it => it.data.content.includes( uniqId ));
|
const toDelete = game.messages.filter(it => it.content.includes(uniqId));
|
||||||
toDelete.forEach(it => it.delete());
|
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;
|
||||||
|
|
||||||
let filtered = this.currentActions.filter( _action => action.isDone );
|
let filtered = this.currentActions.filter(_action => action.isDone);
|
||||||
if ( filtered.length == this.currentActions.length) { // All actions closed !
|
if (filtered.length == this.currentActions.length) { // All actions closed !
|
||||||
console.log("Going next turn !!!");
|
console.log("Going next turn !!!");
|
||||||
this.gotoNextTurn();
|
this.gotoNextTurn();
|
||||||
}
|
}
|
||||||
@ -125,22 +134,22 @@ export class SoSCombat extends Combat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
getPhaseRank( actionConf) {
|
getPhaseRank(actionConf) {
|
||||||
for (let i=2; i>=0; i--) {
|
for (let i = 2; i >= 0; i--) {
|
||||||
let action = actionConf.phaseArray[i];
|
let action = actionConf.phaseArray[i];
|
||||||
if (action.name != "No Action") {
|
if (action.name != "No Action") {
|
||||||
return i+1;
|
return i + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
getAPFromActor( actorId ) {
|
getAPFromActor(actorId) {
|
||||||
for( let combatant of this.combatants) {
|
for (let combatant of this.combatants) {
|
||||||
//console.log(combatant);
|
//console.log(combatant);
|
||||||
if ( combatant.actor.data._id == actorId ) {
|
if (combatant.actor.id == actorId) {
|
||||||
let phase = this.phaseSetup[combatant._id];
|
let phase = this.phaseSetup[combatant.id];
|
||||||
return phase.remainingAP;
|
return phase.remainingAP;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -148,42 +157,43 @@ export class SoSCombat extends Combat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
decreaseAPFromActor( actorId ) {
|
decreaseAPFromActor(actorId) {
|
||||||
for( let combatant of this.combatants) {
|
for (let combatant of this.combatants) {
|
||||||
//console.log(combatant);
|
//console.log(combatant);
|
||||||
if ( combatant.actor.data._id == actorId ) {
|
if (combatant.actor.id == actorId) {
|
||||||
let phase = this.phaseSetup[combatant._id];
|
let phase = this.phaseSetup[combatant.id];
|
||||||
phase.remainingAP -= 1;
|
phase.remainingAP -= 1;
|
||||||
if ( phase.remainingAP < 0 ) phase.remainingAP = 0;
|
if (phase.remainingAP < 0) phase.remainingAP = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async setupActorActions(actionConf) {
|
async setupActorActions(actionConf) {
|
||||||
console.log("Setting combat for phase : ", actionConf, actionConf.uniqId);
|
console.log("Setting combat for phase : ", actionConf, actionConf.uniqId);
|
||||||
|
|
||||||
// Delete message !
|
// Delete message !
|
||||||
const toDelete = game.messages.filter(it => it.data.content.includes( actionConf.uniqId ));
|
const toDelete = game.messages.filter(it => it.content.includes(actionConf.uniqId));
|
||||||
console.log("MESSAGE : ", toDelete);
|
|
||||||
toDelete.forEach(it => it.delete());
|
toDelete.forEach(it => it.delete());
|
||||||
|
|
||||||
if ( !this.phaseSetup) this.phaseSetup = {}; // Opportunistic init
|
if (!this.phaseSetup) this.phaseSetup = {}; // Opportunistic init
|
||||||
|
|
||||||
// Keep track
|
// Keep track
|
||||||
this.phaseSetup[actionConf.combatantId] = actionConf;
|
this.phaseSetup[actionConf.combatantId] = actionConf;
|
||||||
console.log( this.combatants );
|
console.log(this.combatants);
|
||||||
//let combatant = this.combatants.find( comb => comb._id == actionConf.combatantId);
|
//let combatant = this.combatants.find( comb => comb._id == actionConf.combatantId);
|
||||||
await this.setInitiative( actionConf.combatantId, this.getPhaseRank( actionConf ) );
|
await this.setInitiative(actionConf.combatantId, this.getPhaseRank(actionConf));
|
||||||
|
|
||||||
let actionsDone = true
|
let actionsDone = true
|
||||||
for( let combatant of this.combatants) {
|
for (let combatant of this.combatants) {
|
||||||
if ( combatant.initiative == -1 ) actionsDone = false;
|
if (combatant.initiative == -1) actionsDone = false;
|
||||||
}
|
}
|
||||||
if ( actionsDone ) {
|
if (actionsDone) {
|
||||||
this.actionsRequested = false;
|
this.actionsRequested = false;
|
||||||
ChatMessage.create( { content: `Action declaration has been completed ! Now proceeding with actions.`,
|
ChatMessage.create({
|
||||||
whisper: [ ChatMessage.getWhisperRecipients("GM") ] } );
|
content: `Action declaration has been completed ! Now proceeding with actions.`,
|
||||||
|
whisper: ChatMessage.getWhisperRecipients("GM")
|
||||||
|
})
|
||||||
this.phaseNumber = 3;
|
this.phaseNumber = 3;
|
||||||
this.nextTurn();
|
this.nextTurn();
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ export class SoSDialogCombatActions extends Dialog {
|
|||||||
actionPoints: SoSUtility.fillRange(0, 6),
|
actionPoints: SoSUtility.fillRange(0, 6),
|
||||||
combatId: combatId,
|
combatId: combatId,
|
||||||
combatantId: combatantId,
|
combatantId: combatantId,
|
||||||
combatantsList: combat.data.combatants,
|
combatantsList: combat.combatants,
|
||||||
uniqId: uniqId,
|
uniqId: uniqId,
|
||||||
round: round
|
round: round
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,7 @@ export class SoSGMDeck extends Dialog {
|
|||||||
let cardPath = `systems/foundryvtt-shadows-over-sol/img/cards/${card.cardName}.webp`;
|
let cardPath = `systems/foundryvtt-shadows-over-sol/img/cards/${card.cardName}.webp`;
|
||||||
let cardData = { card: card, cardPath: cardPath };
|
let cardData = { card: card, cardPath: cardPath };
|
||||||
let html = await renderTemplate('systems/foundryvtt-shadows-over-sol/templates/chat-card.html', cardData );
|
let html = await renderTemplate('systems/foundryvtt-shadows-over-sol/templates/chat-card.html', cardData );
|
||||||
ChatMessage.create( { content: html, whisper: [ ChatMessage.getWhisperRecipients("GM") ] });
|
ChatMessage.create( { content: html, whisper: ChatMessage.getWhisperRecipients("GM") } );
|
||||||
//dialog.onFlipClose();
|
//dialog.onFlipClose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
67
system.json
67
system.json
@ -2,19 +2,14 @@
|
|||||||
"id": "foundryvtt-shadows-over-sol",
|
"id": "foundryvtt-shadows-over-sol",
|
||||||
"title": "Shadows over Sol",
|
"title": "Shadows over Sol",
|
||||||
"description": "Shadows over Sol for FoundryVTT",
|
"description": "Shadows over Sol for FoundryVTT",
|
||||||
"author": "LeRatierBretonnien",
|
|
||||||
"authors": [],
|
|
||||||
"url": "https://www.uberwald.me/gitea/public/foundryvtt-shadows-over-sol/",
|
"url": "https://www.uberwald.me/gitea/public/foundryvtt-shadows-over-sol/",
|
||||||
"license": "LICENSE.txt",
|
"license": "LICENSE.txt",
|
||||||
"flags": {},
|
"version": "10.0.11",
|
||||||
"version": "10.0.0",
|
|
||||||
"compatibility": {
|
"compatibility": {
|
||||||
"minimum": 10,
|
"minimum": "10",
|
||||||
"verified": 10,
|
"verified": "10",
|
||||||
"maximum": 10
|
"maximum": "10"
|
||||||
},
|
},
|
||||||
"templateVersion": 50,
|
|
||||||
"scripts": [],
|
|
||||||
"esmodules": [
|
"esmodules": [
|
||||||
"module/sos-main.js"
|
"module/sos-main.js"
|
||||||
],
|
],
|
||||||
@ -25,88 +20,96 @@
|
|||||||
{
|
{
|
||||||
"lang": "en",
|
"lang": "en",
|
||||||
"name": "English",
|
"name": "English",
|
||||||
"path": "lang/en.json"
|
"path": "lang/en.json",
|
||||||
|
"flags": {}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"packs": [
|
"packs": [
|
||||||
{
|
{
|
||||||
"name": "skills",
|
"name": "skills",
|
||||||
"label": "Skills",
|
"label": "Skills",
|
||||||
"path": "./packs/skills.db",
|
"path": "packs/skills.db",
|
||||||
"type": "Item",
|
"type": "Item",
|
||||||
"system": "foundryvtt-shadows-over-sol",
|
"system": "foundryvtt-shadows-over-sol",
|
||||||
"private": false
|
"private": false,
|
||||||
|
"flags": {}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "consequences",
|
"name": "consequences",
|
||||||
"label": "Consequences",
|
"label": "Consequences",
|
||||||
"path": "./packs/consequences.db",
|
"path": "packs/consequences.db",
|
||||||
"type": "Item",
|
"type": "Item",
|
||||||
"system": "foundryvtt-shadows-over-sol",
|
"system": "foundryvtt-shadows-over-sol",
|
||||||
"private": false
|
"private": false,
|
||||||
|
"flags": {}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "gears",
|
"name": "gears",
|
||||||
"label": "Gears",
|
"label": "Gears",
|
||||||
"path": "./packs/gears.db",
|
"path": "packs/gears.db",
|
||||||
"type": "Item",
|
"type": "Item",
|
||||||
"system": "foundryvtt-shadows-over-sol",
|
"system": "foundryvtt-shadows-over-sol",
|
||||||
"private": false
|
"private": false,
|
||||||
|
"flags": {}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "injuries",
|
"name": "injuries",
|
||||||
"label": "Injuries",
|
"label": "Injuries",
|
||||||
"path": "./packs/injuries.db",
|
"path": "packs/injuries.db",
|
||||||
"type": "Item",
|
"type": "Item",
|
||||||
"system": "foundryvtt-shadows-over-sol",
|
"system": "foundryvtt-shadows-over-sol",
|
||||||
"private": false
|
"private": false,
|
||||||
|
"flags": {}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "weaknesses",
|
"name": "weaknesses",
|
||||||
"label": "Weaknesses",
|
"label": "Weaknesses",
|
||||||
"path": "./packs/weaknesses.db",
|
"path": "packs/weaknesses.db",
|
||||||
"type": "Item",
|
"type": "Item",
|
||||||
"system": "foundryvtt-shadows-over-sol",
|
"system": "foundryvtt-shadows-over-sol",
|
||||||
"private": false
|
"private": false,
|
||||||
|
"flags": {}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "languages",
|
"name": "languages",
|
||||||
"label": "Languages",
|
"label": "Languages",
|
||||||
"path": "./packs/languages.db",
|
"path": "packs/languages.db",
|
||||||
"type": "Item",
|
"type": "Item",
|
||||||
"system": "foundryvtt-shadows-over-sol",
|
"system": "foundryvtt-shadows-over-sol",
|
||||||
"private": false
|
"private": false,
|
||||||
|
"flags": {}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "combat-actions",
|
"name": "combat-actions",
|
||||||
"label": "Combat Actions",
|
"label": "Combat Actions",
|
||||||
"path": "./packs/combat-actions.db",
|
"path": "packs/combat-actions.db",
|
||||||
"type": "Item",
|
"type": "Item",
|
||||||
"system": "foundryvtt-shadows-over-sol",
|
"system": "foundryvtt-shadows-over-sol",
|
||||||
"private": false
|
"private": false,
|
||||||
|
"flags": {}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "genelines",
|
"name": "genelines",
|
||||||
"label": "Genelines",
|
"label": "Genelines",
|
||||||
"path": "./packs/genelines.db",
|
"path": "packs/genelines.db",
|
||||||
"type": "Item",
|
"type": "Item",
|
||||||
"system": "foundryvtt-shadows-over-sol",
|
"system": "foundryvtt-shadows-over-sol",
|
||||||
"private": false
|
"private": false,
|
||||||
|
"flags": {}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "subcultures",
|
"name": "subcultures",
|
||||||
"label": "Subcultures",
|
"label": "Subcultures",
|
||||||
"path": "./packs/subcultures.db",
|
"path": "packs/subcultures.db",
|
||||||
"type": "Item",
|
"type": "Item",
|
||||||
"system": "foundryvtt-shadows-over-sol",
|
"system": "foundryvtt-shadows-over-sol",
|
||||||
"private": false
|
"private": false,
|
||||||
|
"flags": {}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"relationships": { },
|
|
||||||
"socket": true,
|
"socket": true,
|
||||||
"manifest": "https://www.uberwald.me/gitea/public/foundryvtt-shadows-over-sol/raw/branch/master/system.json",
|
"manifest": "https://www.uberwald.me/gitea/public/foundryvtt-shadows-over-sol/raw/branch/v10/system.json",
|
||||||
"download": "https://www.uberwald.me/gitea/public/foundryvtt-shadows-over-sol/archive/foundryvtt-shadows-over-sol-10.0.0.zip",
|
"download": "https://www.uberwald.me/gitea/public/foundryvtt-shadows-over-sol/archive/foundryvtt-shadows-over-sol-10.0.11.zip",
|
||||||
"protected": false,
|
|
||||||
"gridDistance": 5,
|
"gridDistance": 5,
|
||||||
"gridUnits": "ft"
|
"gridUnits": "ft"
|
||||||
}
|
}
|
@ -390,12 +390,12 @@
|
|||||||
<hr>
|
<hr>
|
||||||
<h3>Biography : </h3>
|
<h3>Biography : </h3>
|
||||||
<div class="form-group editor">
|
<div class="form-group editor">
|
||||||
{{editor data.history target="system.history" button=true owner=owner editable=editable}}
|
{{editor history target="system.history" button=true owner=owner editable=editable}}
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
<h3>Notes : </h3>
|
<h3>Notes : </h3>
|
||||||
<div class="form-group editor">
|
<div class="form-group editor">
|
||||||
{{editor data.notes target="system.notes" button=true owner=owner editable=editable}}
|
{{editor notes target="system.notes" button=true owner=owner editable=editable}}
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
{{>"systems/foundryvtt-shadows-over-sol/templates/editor-notes-gm.html"}}
|
{{>"systems/foundryvtt-shadows-over-sol/templates/editor-notes-gm.html"}}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{{#if data.isGM}}
|
{{#if data.isGM}}
|
||||||
<h3>GM Notes : </h3>
|
<h3>GM Notes : </h3>
|
||||||
<div class="form-group editor">
|
<div class="form-group editor">
|
||||||
{{editor data.gmnotes target="system.gmnotes" button=true owner=owner editable=editable}}
|
{{editor gmnotes target="system.gmnotes" button=true owner=owner editable=editable}}
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
<div class="flexcol">
|
<div class="flexcol">
|
||||||
<label class="generic-label">Description</label>
|
<label class="generic-label">Description</label>
|
||||||
<div class="form-group medium-editor">
|
<div class="form-group medium-editor">
|
||||||
{{editor data.description target="system.description" button=true owner=owner editable=editable}}
|
{{editor description target="system.description" button=true owner=owner editable=editable}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -46,6 +46,6 @@
|
|||||||
<div class="flexcol">
|
<div class="flexcol">
|
||||||
<label class="generic-label">Description</label>
|
<label class="generic-label">Description</label>
|
||||||
<div class="form-group medium-editor">
|
<div class="form-group medium-editor">
|
||||||
{{editor data.description target="system.description" button=true owner=owner editable=editable}}
|
{{editor description target="system.description" button=true owner=owner editable=editable}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
<div class="flexcol">
|
<div class="flexcol">
|
||||||
<label class="generic-label">Description</label>
|
<label class="generic-label">Description</label>
|
||||||
<div class="form-group medium-editor">
|
<div class="form-group medium-editor">
|
||||||
{{editor data.description target="system.description" button=true owner=owner editable=editable}}
|
{{editor description target="system.description" button=true owner=owner editable=editable}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
<div class="flexcol">
|
<div class="flexcol">
|
||||||
<label class="generic-label">Description</label>
|
<label class="generic-label">Description</label>
|
||||||
<div class="form-group medium-editor">
|
<div class="form-group medium-editor">
|
||||||
{{editor data.description target="system.description" button=true owner=owner editable=editable}}
|
{{editor description target="system.description" button=true owner=owner editable=editable}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flexcol">
|
<div class="flexcol">
|
||||||
@ -31,7 +31,7 @@
|
|||||||
<div class="flexcol">
|
<div class="flexcol">
|
||||||
<label class="generic-label">Weakness</label>
|
<label class="generic-label">Weakness</label>
|
||||||
<div class="form-group small-editor">
|
<div class="form-group small-editor">
|
||||||
{{editor data.weakness target="system.weakness" button=true owner=owner editable=editable}}
|
{{editor weakness target="system.weakness" button=true owner=owner editable=editable}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
<div class="flexcol">
|
<div class="flexcol">
|
||||||
<label class="generic-label">Description</label>
|
<label class="generic-label">Description</label>
|
||||||
<div class="form-group medium-editor">
|
<div class="form-group medium-editor">
|
||||||
{{editor data.description target="system.description" button=true owner=owner editable=editable}}
|
{{editor description target="system.description" button=true owner=owner editable=editable}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
<div class="flexcol">
|
<div class="flexcol">
|
||||||
<label class="generic-label">Description</label>
|
<label class="generic-label">Description</label>
|
||||||
<div class="form-group medium-editor">
|
<div class="form-group medium-editor">
|
||||||
{{editor data.description target="system.description" button=true owner=owner editable=editable}}
|
{{editor description target="system.description" button=true owner=owner editable=editable}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
<div class="flexcol">
|
<div class="flexcol">
|
||||||
<label class="generic-label">Notes</label>
|
<label class="generic-label">Notes</label>
|
||||||
<div class="form-group medium-editor">
|
<div class="form-group medium-editor">
|
||||||
{{editor data.notes target="system.notes" button=true owner=owner editable=editable}}
|
{{editor notes target="system.notes" button=true owner=owner editable=editable}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
{{/each}}
|
{{/each}}
|
||||||
</ul>
|
</ul>
|
||||||
<label class="generic-label">Description</label>
|
<label class="generic-label">Description</label>
|
||||||
{{editor data.description target="system.description" button=true owner=owner editable=editable}}
|
{{editor description target="system.description" button=true owner=owner editable=editable}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
<div class="flexcol">
|
<div class="flexcol">
|
||||||
<label class="generic-label">Description</label>
|
<label class="generic-label">Description</label>
|
||||||
<div class="form-group medium-editor">
|
<div class="form-group medium-editor">
|
||||||
{{editor data.description target="system.description" button=true owner=owner editable=editable}}
|
{{editor description target="system.description" button=true owner=owner editable=editable}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
<div class="flexcol">
|
<div class="flexcol">
|
||||||
<label class="generic-label">Description</label>
|
<label class="generic-label">Description</label>
|
||||||
<div class="form-group medium-editor">
|
<div class="form-group medium-editor">
|
||||||
{{editor data.description target="system.description" button=true owner=owner editable=editable}}
|
{{editor description target="system.description" button=true owner=owner editable=editable}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flexcol">
|
<div class="flexcol">
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
<div class="flexcol">
|
<div class="flexcol">
|
||||||
<label class="generic-label">Description</label>
|
<label class="generic-label">Description</label>
|
||||||
<div class="form-group medium-editor">
|
<div class="form-group medium-editor">
|
||||||
{{editor data.description target="system.description" button=true owner=owner editable=editable}}
|
{{editor description target="system.description" button=true owner=owner editable=editable}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user