Sync
This commit is contained in:
parent
87b594953b
commit
2bff1b16be
@ -126,7 +126,9 @@ export class RdDActor extends Actor {
|
|||||||
//rolled.isPart = true; // Pour tester le particulières
|
//rolled.isPart = true; // Pour tester le particulières
|
||||||
rollData.rolled = rolled; // garder le résultat
|
rollData.rolled = rolled; // garder le résultat
|
||||||
console.log("performRoll", rollData, rolled)
|
console.log("performRoll", rollData, rolled)
|
||||||
this.currentRollData = rollData;
|
if ( !rollData.attackerRoll) // Store in the registry if not a defense roll
|
||||||
|
game.system.rdd.rollDataHandler[this.data._id] = rollData;
|
||||||
|
|
||||||
if (rolled.isPart && rollData.arme && !rollData.attackerRoll) { // Réussite particulière avec attaque -> choix !
|
if (rolled.isPart && rollData.arme && !rollData.attackerRoll) { // Réussite particulière avec attaque -> choix !
|
||||||
let message = "<strong>Réussite particulière en attaque</strong>";
|
let message = "<strong>Réussite particulière en attaque</strong>";
|
||||||
message = message + "<br><a class='chat-card-button' id='particuliere-attaque' data-mode='force' data-attackerid='" + this.data._id + "'>Attaquer en Force</a>";
|
message = message + "<br><a class='chat-card-button' id='particuliere-attaque' data-mode='force' data-attackerid='" + this.data._id + "'>Attaquer en Force</a>";
|
||||||
@ -230,6 +232,9 @@ export class RdDActor extends Actor {
|
|||||||
}
|
}
|
||||||
ChatMessage.create(chatOptions);
|
ChatMessage.create(chatOptions);
|
||||||
|
|
||||||
|
if ( !rollData.attackerRoll) // Store it again the registry if not a defense roll
|
||||||
|
game.system.rdd.rollDataHandler[this.data._id] = rollData;
|
||||||
|
|
||||||
// This an attack, generate the defense message
|
// This an attack, generate the defense message
|
||||||
if (defenseMsg) {
|
if (defenseMsg) {
|
||||||
defenseMsg.rollData = duplicate(rollData);
|
defenseMsg.rollData = duplicate(rollData);
|
||||||
@ -238,6 +243,9 @@ export class RdDActor extends Actor {
|
|||||||
msg: "msg_defense",
|
msg: "msg_defense",
|
||||||
data: defenseMsg
|
data: defenseMsg
|
||||||
});
|
});
|
||||||
|
if ( game.user.isGM ) { // Always push the message to the MJ
|
||||||
|
ChatMessage.create(defenseMsg);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
defenseMsg.whisper = [game.user];
|
defenseMsg.whisper = [game.user];
|
||||||
ChatMessage.create(defenseMsg);
|
ChatMessage.create(defenseMsg);
|
||||||
|
@ -511,7 +511,7 @@ export class RdDUtility {
|
|||||||
if ( defenderActor ) {
|
if ( defenderActor ) {
|
||||||
if ( (game.user.isGM && !defenderActor.hasPlayerOwner) || (defenderActor.hasPlayerOwner && (game.user.character.id == defenderActor.id) ) ) {
|
if ( (game.user.isGM && !defenderActor.hasPlayerOwner) || (defenderActor.hasPlayerOwner && (game.user.character.id == defenderActor.id) ) ) {
|
||||||
console.log("User is pushing message...", game.user.name);
|
console.log("User is pushing message...", game.user.name);
|
||||||
defenderActor.currentRollData = duplicate(sockmsg.data.rollData);
|
game.system.rdd.rollDataHandler[sockmsg.data.attackerid] = duplicate(sockmsg.data.rollData);
|
||||||
sockmsg.data.whisper = [ game.user ];
|
sockmsg.data.whisper = [ game.user ];
|
||||||
sockmsg.data.blind = true;
|
sockmsg.data.blind = true;
|
||||||
sockmsg.data.rollMode = "blindroll";
|
sockmsg.data.rollMode = "blindroll";
|
||||||
@ -544,24 +544,27 @@ export class RdDUtility {
|
|||||||
|
|
||||||
html.on("click", '#parer-button', event => {
|
html.on("click", '#parer-button', event => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
let attackerid = event.currentTarget.attributes['data-attackerid'].value;
|
||||||
let defenderActor = game.actors.get(event.currentTarget.attributes['data-defenderid'].value );
|
let defenderActor = game.actors.get(event.currentTarget.attributes['data-defenderid'].value );
|
||||||
let armeId = event.currentTarget.attributes['data-armeid'].value;
|
let armeId = event.currentTarget.attributes['data-armeid'].value;
|
||||||
let rollData = defenderActor.currentRollData;
|
let rollData = game.system.rdd.rollDataHandler[attackerid];
|
||||||
defenderActor.parerAttaque( rollData, armeId );
|
defenderActor.parerAttaque( rollData, armeId );
|
||||||
});
|
});
|
||||||
|
|
||||||
html.on("click", '#esquiver-button', event => {
|
html.on("click", '#esquiver-button', event => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
let attackerid = event.currentTarget.attributes['data-attackerid'].value;
|
||||||
let defenderActor = game.actors.get(event.currentTarget.attributes['data-defenderid'].value );
|
let defenderActor = game.actors.get(event.currentTarget.attributes['data-defenderid'].value );
|
||||||
let rollData = defenderActor.currentRollData;
|
let rollData = game.system.rdd.rollDataHandler[attackerid];
|
||||||
//console.log("Esquive !", rollData, defenderActor);
|
//console.log("Esquive !", rollData, defenderActor);
|
||||||
defenderActor.esquiverAttaque( rollData );
|
defenderActor.esquiverAttaque( rollData );
|
||||||
});
|
});
|
||||||
|
|
||||||
html.on("click", '#particuliere-attaque', event => {
|
html.on("click", '#particuliere-attaque', event => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
let attackerid = event.currentTarget.attributes['data-attackerid'].value;
|
||||||
let attackerActor = game.actors.get(event.currentTarget.attributes['data-attackerid'].value );
|
let attackerActor = game.actors.get(event.currentTarget.attributes['data-attackerid'].value );
|
||||||
let rollData = attackerActor.currentRollData;
|
let rollData = game.system.rdd.rollDataHandler[attackerid];
|
||||||
rollData.particuliereAttaque = game.actors.get(event.currentTarget.attributes['data-mode'].value );
|
rollData.particuliereAttaque = game.actors.get(event.currentTarget.attributes['data-mode'].value );
|
||||||
//console.log("Particulère !", rollData);
|
//console.log("Particulère !", rollData);
|
||||||
attackerActor.continueRoll( rollData );
|
attackerActor.continueRoll( rollData );
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"name": "foundryvtt-reve-de-dragon",
|
"name": "foundryvtt-reve-de-dragon",
|
||||||
"title": "Rêve de Dragon",
|
"title": "Rêve de Dragon",
|
||||||
"description": "Rêve de Dragon RPG for FoundryVTT",
|
"description": "Rêve de Dragon RPG for FoundryVTT",
|
||||||
"version": "0.9.51",
|
"version": "0.9.52",
|
||||||
"minimumCoreVersion": "0.7.5",
|
"minimumCoreVersion": "0.7.5",
|
||||||
"compatibleCoreVersion": "0.7.6",
|
"compatibleCoreVersion": "0.7.6",
|
||||||
"templateVersion": 46,
|
"templateVersion": 46,
|
||||||
|
Loading…
Reference in New Issue
Block a user