Sync with gitlab

This commit is contained in:
LeRatierBretonnien 2020-06-17 20:31:43 +02:00
parent 3962f33e84
commit 259a7577e8
8 changed files with 135 additions and 54 deletions

View File

@ -27,18 +27,18 @@ long_line_behaviour=1
long_line_column=72 long_line_column=72
[files] [files]
current_page=2 current_page=7
FILE_NAME_0=4448;JSON;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Ftemplate.json;0;2 FILE_NAME_0=3953;JSON;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Ftemplate.json;0;2
FILE_NAME_1=5464;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Factor-sheet.js;0;2 FILE_NAME_1=2644;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Factor-sheet.js;0;2
FILE_NAME_2=1630;HTML;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Ftemplates%2Factor-sheet.html;0;2 FILE_NAME_2=17522;HTML;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Ftemplates%2Factor-sheet.html;0;2
FILE_NAME_3=2579;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Frdd-roll-dialog.js;0;2 FILE_NAME_3=1360;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Frdd-roll-dialog.js;0;2
FILE_NAME_4=10119;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Factor.js;0;2 FILE_NAME_4=13867;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Factor.js;0;2
FILE_NAME_5=0;HTML;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Ftemplates%2Fdialog-competence.html;0;2 FILE_NAME_5=416;HTML;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Ftemplates%2Fdialog-roll-carac.html;0;2
FILE_NAME_6=14208;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Frdd-utility.js;0;2 FILE_NAME_6=20632;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Frdd-utility.js;0;2
FILE_NAME_7=543;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Frdd-main.js;0;2 FILE_NAME_7=975;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Frdd-main.js;0;2
FILE_NAME_8=1639;HTML;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Ftemplates%2Fitem-competence-sheet.html;0;2 FILE_NAME_8=1639;HTML;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Ftemplates%2Fitem-competence-sheet.html;0;2
FILE_NAME_9=1796;HTML;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Ftemplates%2Fitem-arme-sheet.html;0;2 FILE_NAME_9=2486;HTML;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Ftemplates%2Fitem-arme-sheet.html;0;2
FILE_NAME_10=10349;CSS;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fstyles%2Fsimple.css;0;2 FILE_NAME_10=0;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Ftoto_init_hook.js;0;2
[VTE] [VTE]
last_dir=/home/sigmar last_dir=/home/sigmar

View File

@ -133,11 +133,19 @@ export class RdDActor extends Actor {
specialStr = "<br><strong>Esquive/Parade échouée, encaissement !</strong>"; specialStr = "<br><strong>Esquive/Parade échouée, encaissement !</strong>";
encaisser = true; encaisser = true;
} }
} else { } else { // This is the attack roll!
if ( rollData.pointsDeTache > 0 ) { if ( rollData.pointsDeTache > 0 ) {
let myroll = new Roll("2d10"); let myroll = new Roll("2d10");
myroll.roll(); myroll.roll();
rollData.degats = parseInt(myroll.result) + parseInt(rollData.arme.data.dommages) + parseInt(this.data.data.attributs.plusdom.value); rollData.degats = parseInt(myroll.result) + parseInt(rollData.arme.data.dommages);
if ( rollData.selectedCarac.label == "Mêlée" ) // +dom only for Melee
rollData.degats += parseInt(this.data.data.attributs.plusdom.value);
if ( rollData.selectedCarac.label == "Lancer" ) { // +dom only for Melee/Lancer
let bdom = parseInt(this.data.data.attributs.plusdom.value);
if ( bdom > parseInt(rollData.arme.data.dommages)*2 )
bdom = parseInt(rollData.arme.data.dommages)*2;
rollData.degats += bdom
}
rollData.loc = RdDUtility.getLocalisation(); rollData.loc = RdDUtility.getLocalisation();
for (let target of game.user.targets) { for (let target of game.user.targets) {
defenseMsg = RdDUtility.buildDefenseChatCard(this, target, rollData ); defenseMsg = RdDUtility.buildDefenseChatCard(this, target, rollData );
@ -156,7 +164,7 @@ export class RdDActor extends Actor {
let lvl = (rollData.competence) ? rollData.competence.name : rollData.bmValue; let lvl = (rollData.competence) ? rollData.competence.name : rollData.bmValue;
let chatOptions = { content: "<strong>Test : " + rollData.selectedCarac.label + " / " + lvl + "</strong><br>Jet : " + let chatOptions = { content: "<strong>Test : " + rollData.selectedCarac.label + " / " + lvl + "</strong><br>Jet : " +
rollData.selectedCarac.value + " / " + rollData.finalLevelStr + " - " + rollData.rollTarget.score + "%<br><strong>Résutat : </strong>" + myroll.total + "<br>" + rollData.selectedCarac.value + " / " + rollData.finalLevelStr + " -> " + rollData.rollTarget.score + "%<br><strong>Résutat : </strong>" + myroll.total + "<br>" +
"<strong>" + quality + "</strong>" + specialStr + xpmsg, "<strong>" + quality + "</strong>" + specialStr + xpmsg,
user: game.user._id, user: game.user._id,
title: "Résultat du test" title: "Résultat du test"

View File

@ -32,6 +32,10 @@ Hooks.once("init", async function() {
decimals: 2 decimals: 2
}; };
game.socket.on("system.foundryvtt-reve-de-dragon", data => {
RdDUtility.performSocketMesssage( data );
});
// Define custom Entity classes // Define custom Entity classes
CONFIG.Actor.entityClass = RdDActor; CONFIG.Actor.entityClass = RdDActor;
CONFIG.RDD = {} CONFIG.RDD = {}

View File

@ -435,12 +435,35 @@ export class RdDUtility {
defenseMsg.content += "<br><a class='chat-card-button' id='parer-button' data-attackerid='"+attacker.data._id + "' data-defenderid='" + target.actor.data._id + "' data-armeid='"+arme._id+"'>Parer avec " + arme.name + "</a></span>"; defenseMsg.content += "<br><a class='chat-card-button' id='parer-button' data-attackerid='"+attacker.data._id + "' data-defenderid='" + target.actor.data._id + "' data-armeid='"+arme._id+"'>Parer avec " + arme.name + "</a></span>";
} }
} }
defenseMsg.content += "<br><a class='chat-card-button' id='esquiver-button' data-attackerid='"+attacker.data._id + "' data-defenderid='" + target.actor.data._id + "'>Esquiver</a></span>";
}
if ( rollData.competence.data.categorie == "tir" ) {
for (const arme of target.actor.data.items) { // Bouclier for parry
if ( arme.type == "arme" && arme.name.toLowerCase.match("bouclier") ) {
defenderArmes.push( arme );
defenseMsg.content += "<br><a class='chat-card-button' id='parer-button' data-attackerid='"+attacker.data._id + "' data-defenderid='" + target.actor.data._id + "' data-armeid='"+arme._id+"'>Parer avec " + arme.name + "</a></span>";
}
}
}
if ( rollData.competence.data.categorie == "lancer" ) {
for (const arme of target.actor.data.items) { // Bouclier for parry Dodge/Esquive
if ( arme.type == "arme" && arme.name.toLowerCase.match("bouclier") ) {
defenderArmes.push( arme );
defenseMsg.content += "<br><a class='chat-card-button' id='parer-button' data-attackerid='"+attacker.data._id + "' data-defenderid='" + target.actor.data._id + "' data-armeid='"+arme._id+"'>Parer avec " + arme.name + "</a></span>";
}
}
defenseMsg.content += "<br><a class='chat-card-button' id='esquiver-button' data-attackerid='"+attacker.data._id + "' data-defenderid='" + target.actor.data._id + "'>Esquiver</a></span>";
} }
// TODO - Tir + Lancer
return defenseMsg; return defenseMsg;
} }
/* -------------------------------------------- */
static performSocketMesssage( data )
{
console.log(">>>>> MSG RECV", data);
}
/* -------------------------------------------- */ /* -------------------------------------------- */
static async chatListeners( html ) static async chatListeners( html )
{ {
@ -448,9 +471,16 @@ export class RdDUtility {
event.preventDefault(); event.preventDefault();
console.log("Encaisser button", event); console.log("Encaisser button", event);
let attackerActor = game.actors.get( event.currentTarget.attributes['data-attackerid'].value ); let attackerActor = game.actors.get( 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 = attackerActor.getFlag("foundryvtt-reve-de-dragon", "rollData"); let rollData = attackerActor.getFlag("foundryvtt-reve-de-dragon", "rollData");
defenderActor.encaisserDommages( rollData ); rollData.attackerid = event.currentTarget.attributes['data-attackerid'].value;
rollData.defenderid = event.currentTarget.attributes['data-defenderid'].value;
game.socket.emit("system.foundryvtt-reve-de-dragon", {
msg: "msg_encaisser",
data: rollData
} );
console.log("-> MSG SENT");
//defenderActor.encaisserDommages( rollData );
}); });
html.on("click", '#parer-button', event => { html.on("click", '#parer-button', event => {

View File

@ -2,10 +2,10 @@
"name": "foundryvtt-reve-de-dragon", "name": "foundryvtt-reve-de-dragon",
"title": "Rêve de Dragon", "title": "Rêve de Dragon",
"description": "L'implémentation de Rêve de Dragon pour FoundryVTT", "description": "L'implémentation de Rêve de Dragon pour FoundryVTT",
"version": "0.7.2", "version": "0.7.4",
"minimumCoreVersion": "0.6.0", "minimumCoreVersion": "0.6.0",
"compatibleCoreVersion": "0.6.0", "compatibleCoreVersion": "0.6.2",
"templateVersion": 12, "templateVersion": 13,
"author": "LeRatierBretonnien", "author": "LeRatierBretonnien",
"esmodules": [ "module/rdd-main.js", "module/hook-renderChatLog.js" ], "esmodules": [ "module/rdd-main.js", "module/hook-renderChatLog.js" ],
"styles": ["styles/simple.css"], "styles": ["styles/simple.css"],
@ -13,8 +13,9 @@
"languages": [], "languages": [],
"gridDistance": 5, "gridDistance": 5,
"gridUnits": "ft", "gridUnits": "ft",
"primaryTokenAttribute": "data.sante.vie", "primaryTokenAttribute": "sante.vie",
"secondaryTokenAttribute": "data.sante.fatigue", "secondaryTokenAttribute": "sante.endurance",
"socket": true,
"url": "https://gitlab.com/LeRatierBretonnien/foundryvtt-reve-de-dragon/", "url": "https://gitlab.com/LeRatierBretonnien/foundryvtt-reve-de-dragon/",
"manifest": "https://gitlab.com/LeRatierBretonnien/foundryvtt-reve-de-dragon/raw/master/system.json", "manifest": "https://gitlab.com/LeRatierBretonnien/foundryvtt-reve-de-dragon/raw/master/system.json",
"download": "https://gitlab.com/LeRatierBretonnien/foundryvtt-reve-de-dragon/-/archive/master/foundryvtt-reve-de-dragon-master.zip", "download": "https://gitlab.com/LeRatierBretonnien/foundryvtt-reve-de-dragon/-/archive/master/foundryvtt-reve-de-dragon-master.zip",

View File

@ -315,7 +315,7 @@
"cout": 0, "cout": 0,
"portee_courte": 0, "portee_courte": 0,
"portee_moyenne": 0, "portee_moyenne": 0,
"portee_longue": 0, "portee_extreme": 0,
"rapide": false "rapide": false
}, },
"munition": { "munition": {

View File

@ -137,6 +137,60 @@
</div> </div>
<div class="flex-group-left flexcol"> <div class="flex-group-left flexcol">
<header class="competences-header flexrow">
<span class="competence-title">Compétences De Mêlée</span>
</header>
<ol class="item-list">
{{#each data.competenceByCategory.melee as |comp key|}}
<li class="item flexrow" data-item-id="{{comp._id}}">
<img class="sheet-competence-img" src="{{comp.img}}"/>
<span class="competence-label" name="data.competenceByCategory.melee[{{key}}].name"><a>{{comp.name}}</a></span>
<input class="competence-value" type="text" name="data.competenceByCategory.melee[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number"/>
<input class="competence-xp" type="text" name="data.competenceByCategory.melee[{{key}}].data.xp" compname="{{comp.name}}" value="{{comp.data.xp}}" data-dtype="number"/>
<div class="item-controls">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ol>
<header class="competences-header flexrow">
<span class="competence-title">Compétences De Tir</span>
</header>
<ol class="item-list">
{{#each data.competenceByCategory.tir as |comp key|}}
<li class="item flexrow" data-item-id="{{comp._id}}">
<img class="sheet-competence-img" src="{{comp.img}}"/>
<span class="competence-label" name="data.competenceByCategory.tir[{{key}}].name"><a>{{comp.name}}</a></span>
<input class="competence-value" type="text" name="data.competenceByCategory.tir[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number"/>
<input class="competence-xp" type="text" name="data.competenceByCategory.tir[{{key}}].data.xp" compname="{{comp.name}}" value="{{comp.data.xp}}" data-dtype="number"/>
<div class="item-controls">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ol>
<header class="competences-header flexrow">
<span class="competence-title">Compétences De Lancer</span>
</header>
<ol class="item-list">
{{#each data.competenceByCategory.lancer as |comp key|}}
<li class="item flexrow" data-item-id="{{comp._id}}">
<img class="sheet-competence-img" src="{{comp.img}}"/>
<span class="competence-label" name="data.competenceByCategory.lancer[{{key}}].name"><a>{{comp.name}}</a></span>
<input class="competence-value" type="text" name="data.competenceByCategory.lancer[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number"/>
<input class="competence-xp" type="text" name="data.competenceByCategory.lancer[{{key}}].data.xp" compname="{{comp.name}}" value="{{comp.data.xp}}" data-dtype="number"/>
<div class="item-controls">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ol>
<header class="competences-header flexrow"> <header class="competences-header flexrow">
<span class="competence-title">Compétences Spécialisées</span> <span class="competence-title">Compétences Spécialisées</span>
</header> </header>
@ -197,7 +251,7 @@
{{!-- Combat Tab --}} {{!-- Combat Tab --}}
<div class="tab combat" data-group="primary" data-tab="combat"> <div class="tab combat" data-group="primary" data-tab="combat">
<header class="competence-header flexrow"> <header class="competence-header flexrow">
<span class="competence-title">Compétences de Mêlée</span> <span class="competence-title">Armes</span>
<span class="competence-title">Niveau</span> <span class="competence-title">Niveau</span>
<span class="competence-title">XP</span> <span class="competence-title">XP</span>
</header> </header>
@ -211,34 +265,6 @@
</li> </li>
{{/each}} {{/each}}
</ol> </ol>
<header class="competence-header flexrow">
<span class="competence-title">Compétences de Tir</span>
<span class="competence-title">Niveau</span>
<span class="competence-title">XP</span>
</header>
<ol class="item-list">
{{#each data.competenceByCategory.tir as |comp key|}}
<li class="item flexrow" data-item-id="{{arme._id}}">
<span class="competence-label" name="data.competenceByCategory.tir[{{key}}].name"><a>{{comp.name}}</a></span>
<input class="competence-value" type="text" name="data.competenceByCategory.tir[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number"/>
<input class="competence-xp" type="text" name="data.competenceByCategory.tir[{{key}}].data.xp" compname="{{comp.name}}" value="{{comp.data.xp}}" data-dtype="number"/>
</li>
{{/each}}
</ol>
<header class="competence-header flexrow">
<span class="competence-title">Compétences de Lancer</span>
<span class="competence-title">Niveau</span>
<span class="competence-title">XP</span>
</header>
<ol class="item-list">
{{#each data.competenceByCategory.lancer as |comp key|}}
<li class="item flexrow" data-item-id="{{arme._id}}">
<span class="competence-label" name="data.competenceByCategory.lancer[{{key}}].name"><a>{{comp.name}}</a></span>
<input class="competence-value" type="text" name="data.competenceByCategory.lancer[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number"/>
<input class="competence-xp" type="text" name="data.competenceByCategory.lancer[{{key}}].data.xp" compname="{{comp.name}}" value="{{comp.data.xp}}" data-dtype="number"/>
</li>
{{/each}}
</ol>
</div> </div>
{{!-- blessures Tab --}} {{!-- blessures Tab --}}

View File

@ -36,6 +36,18 @@
<label for="xp">Arme rapide ? </label> <label for="xp">Arme rapide ? </label>
<input class="attribute-value" type="checkbox" name="data.rapide" {{#if data.rapide}}checked{{/if}}/> <input class="attribute-value" type="checkbox" name="data.rapide" {{#if data.rapide}}checked{{/if}}/>
</div> </div>
<div class="form-group">
<label for="xp">Portée courte </label>
<input class="attribute-value" type="text" name="data.portee_courte" value="{{data.portee_courte}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label for="xp">Portée moyenne </label>
<input class="attribute-value" type="text" name="data.portee_moyenne" value="{{data.portee_moyenne}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label for="xp">Portée extrême </label>
<input class="attribute-value" type="text" name="data.portee_extreme" value="{{data.portee_extreme}}" data-dtype="Number"/>
</div>
<div class="form-group"> <div class="form-group">
<label for="xp">Prix (sols) </label> <label for="xp">Prix (sols) </label>
<input class="attribute-value" type="text" name="data.cout" value="{{data.cout}}" data-dtype="Number"/> <input class="attribute-value" type="text" name="data.cout" value="{{data.cout}}" data-dtype="Number"/>