Merge pull request 'Fix initiative' (#584) from VincentVk/foundryvtt-reve-de-dragon:v10 into v10
Reviewed-on: public/foundryvtt-reve-de-dragon#584
This commit is contained in:
commit
344540ea8e
@ -2266,15 +2266,21 @@ export class RdDActor extends Actor {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async appliquerAjoutExperience(rollData, hideChatMessage = 'show') {
|
async appliquerAjoutExperience(rollData, hideChatMessage = 'show') {
|
||||||
if (!this.isPersonnage()) return;
|
if (!this.isPersonnage()) return;
|
||||||
hideChatMessage = hideChatMessage == 'hide' || (game.settings.get("core", "rollMode") != 'blindroll' && !game.user.isGM)
|
hideChatMessage = hideChatMessage == 'hide' || (Misc.isRollModeHiddenToPlayer() && !game.user.isGM)
|
||||||
let xpData = await this._appliquerExperience(rollData.rolled, rollData.selectedCarac.label, rollData.competence);
|
let xpData = await this._appliquerExperience(rollData.rolled, rollData.selectedCarac.label, rollData.competence);
|
||||||
if (xpData && !hideChatMessage) {
|
if (xpData) {
|
||||||
|
const content = await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-actor-gain-xp.html`, xpData);
|
||||||
|
if (hideChatMessage) {
|
||||||
|
ChatUtility.blindMessageToGM({ content: content});
|
||||||
|
}
|
||||||
|
else{
|
||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name),
|
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name),
|
||||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-actor-gain-xp.html`, xpData)
|
content: content
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async _appliquerAppelMoral(rollData) {
|
async _appliquerAppelMoral(rollData) {
|
||||||
|
@ -120,13 +120,20 @@ export class Misc {
|
|||||||
return Misc.firstConnectedGM()?.id ?? game.user.id;
|
return Misc.firstConnectedGM()?.id ?? game.user.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static isRollModeHiddenToPlayer() {
|
||||||
|
switch (game.settings.get("core", "rollMode")) {
|
||||||
|
case CONST.DICE_ROLL_MODES.BLIND:
|
||||||
|
case CONST.DICE_ROLL_MODES.SELF: return true;
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
static getActiveUser(id) {
|
static getActiveUser(id) {
|
||||||
return game.users.find(u => u.id == id && u.active);
|
return game.users.find(u => u.id == id && u.active);
|
||||||
}
|
}
|
||||||
|
|
||||||
static firstConnectedGM() {
|
static firstConnectedGM() {
|
||||||
return game.users.filter(u => u.isGM && u.active).sort(Misc.ascending(u => u.id)).find(u => u.isGM && u.active);
|
return game.users.filter(u => u.isGM && u.active).sort(Misc.ascending(u => u.id)).find(u => u.isGM && u.active);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static isOwnerPlayer(actor, user=undefined) {
|
static isOwnerPlayer(actor, user=undefined) {
|
||||||
|
@ -84,7 +84,6 @@ export class RdDCombatManager extends Combat {
|
|||||||
console.log(`${game.system.title} | Combat.rollInitiative()`, ids, formula, messageOptions);
|
console.log(`${game.system.title} | Combat.rollInitiative()`, ids, formula, messageOptions);
|
||||||
|
|
||||||
ids = typeof ids === "string" ? [ids] : ids;
|
ids = typeof ids === "string" ? [ids] : ids;
|
||||||
const currentId = this.combatant._id;
|
|
||||||
// calculate initiative
|
// calculate initiative
|
||||||
for (let cId = 0; cId < ids.length; cId++) {
|
for (let cId = 0; cId < ids.length; cId++) {
|
||||||
const combatant = this.combatants.get(ids[cId]);
|
const combatant = this.combatants.get(ids[cId]);
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"id": "foundryvtt-reve-de-dragon",
|
"id": "foundryvtt-reve-de-dragon",
|
||||||
"title": "Rêve de Dragon",
|
"title": "Rêve de Dragon",
|
||||||
"version": "10.3.1",
|
"version": "10.3.2",
|
||||||
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-10.3.1.zip",
|
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-10.3.2.zip",
|
||||||
"manifest": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/v10/system.json",
|
"manifest": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/v10/system.json",
|
||||||
"compatibility": {
|
"compatibility": {
|
||||||
"minimum": "10",
|
"minimum": "10",
|
||||||
|
Loading…
Reference in New Issue
Block a user