Update rules

This commit is contained in:
LeRatierBretonnien 2020-05-31 23:06:25 +02:00
parent 4b465920f0
commit 91c0a6c7a3
5 changed files with 84 additions and 27 deletions

View File

@ -27,18 +27,16 @@ long_line_behaviour=1
long_line_column=72 long_line_column=72
[files] [files]
current_page=4 current_page=1
FILE_NAME_0=6135;JSON;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Ftemplate.json;0;2 FILE_NAME_0=6873;JSON;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Ftemplate.json;0;2
FILE_NAME_1=1602;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Factor-sheet.js;0;2 FILE_NAME_1=4562;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Factor-sheet.js;0;2
FILE_NAME_2=1792;HTML;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Ftemplates%2Fdialog-competence.html;0;2 FILE_NAME_2=314;HTML;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Ftemplates%2Factor-sheet.html;0;2
FILE_NAME_3=4217;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Factor.js;0;2 FILE_NAME_3=13323;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Frdd-utility.js;0;2
FILE_NAME_4=405;HTML;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Ftemplates%2Factor-sheet.html;0;2 FILE_NAME_4=985;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Fsimple.js;0;2
FILE_NAME_5=12392;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Frdd-utility.js;0;2 FILE_NAME_5=6984;CSS;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fstyles%2Fsimple.css;0;2
FILE_NAME_6=335;HTML;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Ftemplates%2Fitem-competence-sheet.html;0;2 FILE_NAME_6=3632;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Factor.js;0;2
FILE_NAME_7=985;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Fsimple.js;0;2 FILE_NAME_7=1134;HTML;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2FWFRP-4th-Edition-FoundryVTT_SLADECRAVEN%2Ftemplates%2Factors%2Factor-skills.html;0;2
FILE_NAME_8=28185;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2FWFRP-4th-Edition-FoundryVTT_SLADECRAVEN%2Fscripts%2Fdice-wfrp4e.js;0;2 FILE_NAME_8=7542;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2FWFRP-4th-Edition-FoundryVTT_SLADECRAVEN%2Fscripts%2Factor%2Fsheet%2Fcharacter-sheet.js;0;2
FILE_NAME_9=674;HTML;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2FWFRP-4th-Edition-FoundryVTT_SLADECRAVEN%2Ftemplates%2Fchat%2Fskill-dialog.html;0;2
FILE_NAME_10=6826;CSS;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fstyles%2Fsimple.css;0;2
[VTE] [VTE]
last_dir=/home/sigmar last_dir=/home/sigmar

View File

@ -102,12 +102,54 @@ export class RdDActor extends Actor {
data.compteurs.etat.value = state; data.compteurs.etat.value = state;
} }
/* -------------------------------------------- */
testSiSonne( endurance )
{
let myroll = new Roll("d20");
myroll.roll();
let result = myroll.total;
if ( result <= endurance.value)
this.data.data.sante.sonne.value = false;
if ( result > endurance.value || result == 20) // 20 is always a failure
this.data.data.sante.sonne.value = true;
if (result == 1) {
this.data.data.sante.sonne.value = false;
this.data.data.carac.constitution.xp++; // 1 XP on 1 !
}
}
/* -------------------------------------------- */ /* -------------------------------------------- */
santeIncDec(name, inc ) { santeIncDec(name, inc ) {
let data = this.data.data.sante[name]; let data = this.data.data.sante[name];
let lastValue = data.value; // Useful for Endurance and Sonné
data.value = data.value + inc; data.value = data.value + inc;
if ( data.value > data.max ) data.value = data.max; if ( data.value > data.max ) data.value = data.max;
if ( data.value < 0 ) data.value = 0; if ( data.value < 0 ) data.value = 0;
if (name == "endurance") {
if ( inc < 0 ) // Each endurance lost -> fatigue lost
this.data.data.sante.fatigue = this.data.data.sante.fatigue + inc
let diffEndurance = data.max - data.value;
if ( this.data.data.sante.fatigue < diffEndurance) // If endurance lost, then the same amount of fatigue cannot be recovered
this.data.data.sante.fatigue = diffEndurance;
// If endurance is 0 -> -1 vie
if ( data.value == 0 ) {
this.data.data.sante.vie.value = this.data.data.sante.vie.value - 1;
}
let diffVie = this.data.data.sante.vie.max - this.data.data.sante.vie.value;
if ( data.value > data.max - (diffvie*2) ) {
data.value = data.max - (diffvie*2);
}
let blessures = this.data.data.blessures;
let maxEnd = Math.floor( data.max / blessures.graves.nombre);
if (data.value > maxEnd ) data.value = maxEnd;
if ( blessures.critiques.nombre > 0 && data.value > 1) data.value = 1;
if (lastValue - data.value > 1) this.testSiSonne(data); // Peut-être sonné si 2 points d'endurance perdus d'un coup
}
console.log(">>>> NEW VI", name, data.value); console.log(">>>> NEW VI", name, data.value);
this.computeEtatGeneral(); this.computeEtatGeneral();
} }

View File

@ -60,17 +60,11 @@ const fatigueMatrix = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, //
const fatigueMalus = [ 0, 0, 0, -1, -1, -1, -2, -3, -4, -5, -6, -7 ]; // Provides the malus for each segment of fatigue const fatigueMalus = [ 0, 0, 0, -1, -1, -1, -2, -3, -4, -5, -6, -7 ]; // Provides the malus for each segment of fatigue
const fatigueLineSize = [ 3, 6, 7, 8, 9, 10, 11, 12]; const fatigueLineSize = [ 3, 6, 7, 8, 9, 10, 11, 12];
const fatigueLineMalus = [ 0, -1, -2, -3, -4, -5, -6, -7 ]; const fatigueLineMalus = [ 0, -1, -2, -3, -4, -5, -6, -7 ];
const fatigueTemplate = "<table>\ const fatigueMarche = { "aise": { "4":1, "6":2, "8":3, "10":4, "12":6 },
<th><tdid=1><td/><td/><td/><td/> <td/> <td/><td/><td/><td/><td/> <td/> <td/><td/><td/><td/><td/></tr>\ "malaise": { "4":2, "6":3, "8":4, "10":6 },
<th><td/><td/><td/><td/><td/> <td/> <td/><td/><td/><td/><td/> <td/> <td/><td/><td/><td/><td/></tr>\ "difficile": { "4":3, "6":4, "8":6 },
<th><td/><td/><td/><td/><td/></tr>\ "tresdifficile": { "4":4, "6":6 } }
<th><td/><td/><td/><td/><td/></tr>\
<th><td/><td/><td/><td/><td/></tr>\
<th><td/><td/><td/><td/><td/></tr>\
<th><td/><td/><td/><td/><td/></tr>\
<th><td/><td/><td/><td/><td/></tr>\
</table>"
export class RdDUtility { export class RdDUtility {
/* -------------------------------------------- */ /* -------------------------------------------- */
@ -289,6 +283,22 @@ export class RdDUtility {
return table; return table;
} }
/* -------------------------------------------- */
static getLocalisation( )
{
let myroll = new Roll("d20");
myroll.roll();
let result = myroll.total;
if ( result <= 3 ) return "Jambe, genou, pied, jarret";
if ( result <= 7 ) return "Hanche, cuisse, fesse";
if ( result <= 9 ) return "Ventre, reins";
if ( result <= 12 ) return "Poitrine, dos";
if ( result <= 14 ) return "Avant-bras, main, coude";
if ( result <= 18 ) return "Epaule, bras, omoplate";
if ( result == 19) return "Tête autre";
if ( result == 20) return "Tête visage";
}
/* -------------------------------------------- */ /* -------------------------------------------- */
static currentFatigueMalus( value, max) static currentFatigueMalus( value, max)
{ {

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.5, "version": 0.6,
"minimumCoreVersion": "0.5.7", "minimumCoreVersion": "0.6.0",
"compatibleCoreVersion": "0.5.7", "compatibleCoreVersion": "0.6.0",
"templateVersion": 8, "templateVersion": 9,
"author": "LeRatierBretonnien", "author": "LeRatierBretonnien",
"esmodules": ["module/simple.js"], "esmodules": ["module/simple.js"],
"styles": ["styles/simple.css"], "styles": ["styles/simple.css"],

View File

@ -163,6 +163,10 @@
"value": 0, "value": 0,
"label": "Fatigue", "label": "Fatigue",
"derivee": true "derivee": true
},
"sonne": {
"value": false,
"label": "Sonné"
} }
}, },
"blessures": { "blessures": {
@ -297,6 +301,8 @@
"encombrement": 0, "encombrement": 0,
"equipe": false, "equipe": false,
"dommages": 0, "dommages": 0,
"force": 0,
"resistance": 0,
"cout": 0 "cout": 0
}, },
"munition": { "munition": {
@ -312,6 +318,7 @@
"encombrement": 0, "encombrement": 0,
"equipe": false, "equipe": false,
"pa": 0, "pa": 0,
"malus": 0,
"cout": 0 "cout": 0
}, },
"competence": { "competence": {