Reue socket pour combat avec 0.7.5

This commit is contained in:
sladecraven 2020-11-12 18:13:25 +01:00
parent 41df6257d5
commit 3c6a5e0c4d
2 changed files with 11 additions and 8 deletions

View File

@ -526,7 +526,7 @@ export class RdDUtility {
defenseMsg.content += "<br><a class='chat-card-button' id='esquiver-button' data-attackerid='"+attacker.data._id + "' data-defenderid='" + myTarget.data._id + "'>Esquiver</a></span>";
}
defenseMsg.toSocket = (!game.user.isGM) ? true : false;
defenseMsg.toSocket = myTarget.hasPlayerOwner;
return defenseMsg;
}
@ -543,12 +543,15 @@ export class RdDUtility {
}
} else if (sockmsg.msg == "msg_defense" ) {
let defenderActor = game.actors.get( sockmsg.data.defenderid );
if ( (game.user.isGM && !defenderActor.isPC) || (defenderActor.isPC && game.user.character.id == defenderActor.id ) ) {
console.log("User is pushing message...", game.user.name);
sockmsg.data.whisper = [ game.user ];
sockmsg.data.blind = true;
sockmsg.data.rollMode = "blindroll";
ChatMessage.create( sockmsg.data );
console.log("Defense message reçu : ", defenderActor.hasPlayerOwner, game.user.character.id, defenderActor.id);
if ( defenderActor ) {
if ( (game.user.isGM && !defenderActor.hasPlayerOwner) || (defenderActor.hasPlayerOwner && (game.user.character.id == defenderActor.id) ) ) {
console.log("User is pushing message...", game.user.name);
sockmsg.data.whisper = [ game.user ];
sockmsg.data.blind = true;
sockmsg.data.rollMode = "blindroll";
ChatMessage.create( sockmsg.data );
}
}
}
}

View File

@ -2,7 +2,7 @@
"name": "foundryvtt-reve-de-dragon",
"title": "Rêve de Dragon",
"description": "Rêve de Dragon RPG for FoundryVTT",
"version": "0.9.33",
"version": "0.9.34",
"minimumCoreVersion": "0.7.5",
"compatibleCoreVersion": "0.7.6",
"templateVersion": 44,