Compare commits
No commits in common. "2429f5b20a4fd39ec965543c9586938bbcef9b28" and "e2c4d93413db7b8b508f1de3c9c3a4b319e2e859" have entirely different histories.
2429f5b20a
...
e2c4d93413
@ -1,7 +1,4 @@
|
||||
# 12.0
|
||||
## 12.0.16 - Le secret d'Astrobazzarh
|
||||
- Fix: les jets envoyés messages uniquement au MJ ne sont plus envoyés à tous les autres joueurs (et dupliqués)
|
||||
|
||||
## 12.0.15 - Le messager d'Astrobazzarh
|
||||
- Correction des faces de dés personalisés dice-so-nice
|
||||
- Les messages de maladies ne sont plus publics
|
||||
|
@ -1548,7 +1548,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async appliquerAjoutExperience(rollData, hideChatMessage = 'show') {
|
||||
if (!Misc.isFirstConnectedGM()){
|
||||
if (!Misc.firstConnectedGM()){
|
||||
return
|
||||
}
|
||||
hideChatMessage = hideChatMessage == 'hide' || (Misc.isRollModeHiddenToPlayer() && !game.user.isGM)
|
||||
@ -3011,7 +3011,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async onCreateOwnedDraconique(item, options, id) {
|
||||
if (Misc.isFirstConnectedGM()) {
|
||||
if (Misc.isUniqueConnectedGM()) {
|
||||
let draconique = Draconique.all().find(it => it.match(item));
|
||||
if (draconique) {
|
||||
await draconique.onActorCreateOwned(this, item)
|
||||
@ -3023,7 +3023,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async onDeleteOwnedDraconique(item, options, id) {
|
||||
if (Misc.isFirstConnectedGM()) {
|
||||
if (Misc.isUniqueConnectedGM()) {
|
||||
let draconique = Draconique.all().find(it => it.match(item));
|
||||
if (draconique) {
|
||||
await draconique.onActorDeleteOwned(this, item)
|
||||
@ -3033,7 +3033,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async onDeleteOwnedCaseTmr(item, options, id) {
|
||||
if (Misc.isFirstConnectedGM()) {
|
||||
if (Misc.isUniqueConnectedGM()) {
|
||||
let draconique = Draconique.all().find(it => it.isCase(item));
|
||||
if (draconique) {
|
||||
await draconique.onActorDeleteCaseTmr(this, item)
|
||||
|
@ -218,7 +218,7 @@ export class RdDBaseActor extends Actor {
|
||||
}
|
||||
|
||||
async creerObjetParMJ(object) {
|
||||
if (!Misc.isFirstConnectedGM()) {
|
||||
if (!Misc.isUniqueConnectedGM()) {
|
||||
RdDBaseActor.remoteActorCall({
|
||||
tokenId: this.token?.id,
|
||||
actorId: this.id,
|
||||
@ -335,7 +335,7 @@ export class RdDBaseActor extends Actor {
|
||||
ui.notifications.info("Inutile de se vendre à soi-même");
|
||||
return;
|
||||
}
|
||||
if (!Misc.isFirstConnectedGM()) {
|
||||
if (!Misc.isUniqueConnectedGM()) {
|
||||
RdDBaseActor.remoteActorCall({
|
||||
actorId: achat.vendeurId ?? achat.acheteurId,
|
||||
method: 'achatVente',
|
||||
|
@ -49,7 +49,7 @@ export class ChatUtility {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static onRemoveMessages(socketData) {
|
||||
if (Misc.isFirstConnectedGM()) {
|
||||
if (Misc.isUniqueConnectedGM()) {
|
||||
if (socketData.part) {
|
||||
const toDelete = game.messages.filter(it => it.content.includes(socketData.part));
|
||||
toDelete.forEach(it => it.delete());
|
||||
@ -63,7 +63,7 @@ export class ChatUtility {
|
||||
/* -------------------------------------------- */
|
||||
|
||||
static removeMessages(socketData) {
|
||||
if (Misc.isFirstConnectedGM()) {
|
||||
if (Misc.isUniqueConnectedGM()) {
|
||||
ChatUtility.onRemoveMessages(socketData);
|
||||
}
|
||||
else {
|
||||
@ -161,7 +161,7 @@ export class ChatUtility {
|
||||
/* -------------------------------------------- */
|
||||
static handleGMChatMessage(socketData) {
|
||||
console.log("blindMessageToGM", socketData);
|
||||
if (Misc.isFirstConnectedGM()) {
|
||||
if (Misc.firstConnectedGM()) {
|
||||
ChatMessage.create({
|
||||
user: game.user.id,
|
||||
whisper: ChatUtility.getGMs(),
|
||||
|
@ -195,7 +195,7 @@ export class Misc {
|
||||
return document
|
||||
}
|
||||
}
|
||||
else if (Misc.isFirstConnectedGM() || (Misc.connectedGMs().length == 0 && Misc.isOwnerPlayer(document))) {
|
||||
else if (Misc.isUniqueConnectedGM() || (Misc.connectedGMs().length == 0 && Misc.isOwnerPlayer(document))) {
|
||||
return document
|
||||
}
|
||||
return undefined
|
||||
@ -206,14 +206,14 @@ export class Misc {
|
||||
}
|
||||
|
||||
static isOwnerPlayerOrUniqueConnectedGM(actor) {
|
||||
return Misc.isOwnerPlayer(actor) ?? Misc.isFirstConnectedGM();
|
||||
return Misc.isOwnerPlayer(actor) ?? Misc.isUniqueConnectedGM();
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns true pour un seul utilisateur: le premier GM connecté par ordre d'id
|
||||
*/
|
||||
static isFirstConnectedGM() {
|
||||
return game.user == Misc.firstConnectedGM();
|
||||
static isUniqueConnectedGM() {
|
||||
return game.user.id == Misc.firstConnectedGMId();
|
||||
}
|
||||
|
||||
static firstConnectedGMId() {
|
||||
|
@ -53,7 +53,7 @@ export class RdDCombatManager extends Combat {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async onPreDeleteCombat() {
|
||||
if (Misc.isFirstConnectedGM()) {
|
||||
if (Misc.isUniqueConnectedGM()) {
|
||||
await this.finDeRound({ terminer: true })
|
||||
ChatUtility.removeChatMessageContaining(`<div data-combatid="${this.id}" data-combatmessage="actor-turn-summary">`)
|
||||
game.messages.filter(m => ChatUtility.getMessageData(m, 'attacker-roll') != undefined && ChatUtility.getMessageData(m, 'defender-roll') != undefined)
|
||||
@ -291,7 +291,7 @@ export class RdDCombatManager extends Combat {
|
||||
/* -------------------------------------------- */
|
||||
static processPremierRoundInit() {
|
||||
// Check if we have the whole init !
|
||||
if (Misc.isFirstConnectedGM() && game.combat.current.round == 1) {
|
||||
if (Misc.isUniqueConnectedGM() && game.combat.current.round == 1) {
|
||||
let initMissing = game.combat.combatants.find(it => !it.initiative);
|
||||
if (!initMissing) { // Premier round !
|
||||
for (let combatant of game.combat.combatants) {
|
||||
@ -454,7 +454,7 @@ export class RdDCombat {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static combatNouveauTour(combat) {
|
||||
if (Misc.isFirstConnectedGM()) {
|
||||
if (Misc.isUniqueConnectedGM()) {
|
||||
let turn = combat.turns.find(t => t.token?.id == combat.current.tokenId);
|
||||
if (turn?.actor) {
|
||||
RdDCombat.displayActorCombatStatus(combat, turn.actor, turn.token.id);
|
||||
@ -511,7 +511,7 @@ export class RdDCombat {
|
||||
/* -------------------------------------------- */
|
||||
static onMsgDefense(msg) {
|
||||
let defenderToken = canvas.tokens.get(msg.defenderTokenId);
|
||||
if (defenderToken && Misc.isFirstConnectedGM()) {
|
||||
if (defenderToken && Misc.isUniqueConnectedGM()) {
|
||||
const rddCombat = RdDCombat.rddCombatForAttackerAndDefender(msg.attackerId, msg.defenderTokenId);
|
||||
rddCombat?.removeChatMessageActionsPasseArme(msg.defenderRoll.passeArme);
|
||||
rddCombat?._chatMessageDefense(msg.paramChatDefense, msg.defenderRoll);
|
||||
@ -919,7 +919,7 @@ export class RdDCombat {
|
||||
dmg: attackerRoll.dmg,
|
||||
};
|
||||
|
||||
if (Misc.isFirstConnectedGM()) {
|
||||
if (Misc.isUniqueConnectedGM()) {
|
||||
await this._chatMessageDefense(paramChatDefense, defenderRoll);
|
||||
}
|
||||
else {
|
||||
|
@ -278,7 +278,7 @@ export class SystemReveDeDragon {
|
||||
/* Foundry VTT Initialization */
|
||||
/* -------------------------------------------- */
|
||||
game.system.rdd.calendrier = new RdDCalendrier()
|
||||
if (Misc.isFirstConnectedGM()) {
|
||||
if (Misc.isUniqueConnectedGM()) {
|
||||
new Migrations().migrate()
|
||||
this.messageDeBienvenue()
|
||||
import("https://www.uberwald.me/fvtt_appcount/count-class-ready.js").then(moduleCounter => {
|
||||
|
@ -186,7 +186,7 @@ export class AppAstrologie extends Application {
|
||||
date: this.html.find('[name="joursAstrologie"]').val(),
|
||||
userId: game.user.id
|
||||
}
|
||||
if (Misc.isFirstConnectedGM()) {
|
||||
if (Misc.isUniqueConnectedGM()) {
|
||||
game.system.rdd.calendrier.requestNombreAstral(socketData);
|
||||
} else {
|
||||
game.socket.emit(SYSTEM_SOCKET_ID, {
|
||||
|
@ -48,7 +48,7 @@ export class RdDCalendrier extends Application {
|
||||
constructor() {
|
||||
super();
|
||||
this.timestamp = RdDTimestamp.getWorldTime();
|
||||
if (Misc.isFirstConnectedGM()) { // Uniquement si GM
|
||||
if (Misc.isUniqueConnectedGM()) { // Uniquement si GM
|
||||
RdDTimestamp.setWorldTime(this.timestamp);
|
||||
this.rebuildNombresAstraux(); // Ensure always up-to-date
|
||||
}
|
||||
@ -258,7 +258,7 @@ export class RdDCalendrier extends Application {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async rebuildNombresAstraux() {
|
||||
if (Misc.isFirstConnectedGM()) {
|
||||
if (Misc.isUniqueConnectedGM()) {
|
||||
const nombresAstraux = this.getNombresAstraux()
|
||||
let newNombresAstraux = [];
|
||||
for (let i = 0; i < MAX_NOMBRE_ASTRAL; i++) {
|
||||
@ -337,7 +337,7 @@ export class RdDCalendrier extends Application {
|
||||
/* -------------------------------------------- */
|
||||
async requestNombreAstral(request) {
|
||||
const actor = game.actors.get(request.id);
|
||||
if (Misc.isFirstConnectedGM()) { // Only once
|
||||
if (Misc.isUniqueConnectedGM()) { // Only once
|
||||
console.log(request);
|
||||
let jourDiff = this.getLectureAstrologieDifficulte(request.date);
|
||||
let niveau = Number(request.astrologie.system.niveau) + Number(request.conditions) + Number(jourDiff) + Number(request.etat);
|
||||
|
@ -1,8 +1,8 @@
|
||||
{
|
||||
"id": "foundryvtt-reve-de-dragon",
|
||||
"title": "Rêve de Dragon",
|
||||
"version": "12.0.16",
|
||||
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-12.0.16.zip",
|
||||
"version": "12.0.15",
|
||||
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-12.0.15.zip",
|
||||
"manifest": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/v11/system.json",
|
||||
"changelog": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/branch/v11/changelog.md",
|
||||
"compatibility": {
|
||||
|
Loading…
Reference in New Issue
Block a user