Merge branch 'combat-extract' into 'dev_1.1'

Combat extract

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!74
This commit is contained in:
Leratier Bretonnien 2020-12-15 22:36:58 +00:00
commit 96f58c65e3
8 changed files with 30 additions and 19 deletions

View File

@ -1630,7 +1630,7 @@ export class RdDActor extends Actor {
return 0; return 0;
} }
// selon l'heure de naissance... // selon l'heure de naissance...
return game.system.rdd.calendrier.getAjustementAstrologique(this.data.data.heure); return game.system.rdd.calendrier.getAjustementAstrologique(this.data.data.heure, this.data.name);
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
checkDesirLancinant( ) { checkDesirLancinant( ) {
@ -1914,6 +1914,7 @@ export class RdDActor extends Actor {
this.updateEmbeddedEntity("OwnedItem", update); this.updateEmbeddedEntity("OwnedItem", update);
} }
} }
protection = Math.max(protection - Misc.toInt(arme.data.penetration), 0);
protection += this.getProtectionNaturelle(); protection += this.getProtectionNaturelle();
console.log("Final protect", protection); console.log("Final protect", protection);
return protection; return protection;
@ -1932,7 +1933,7 @@ export class RdDActor extends Actor {
dmg: attackerRoll.dmg.total, dmg: attackerRoll.dmg.total,
armure: armure armure: armure
}).roll(); }).roll();
RdDDice.show(rollEncaissement, ) RdDDice.show(rollEncaissement);
let result = RdDUtility.computeBlessuresSante(rollEncaissement.total, attackerRoll.mortalite, attackerRoll.dmg.loc); let result = RdDUtility.computeBlessuresSante(rollEncaissement.total, attackerRoll.mortalite, attackerRoll.dmg.loc);
result.endurance = Math.max(result.endurance, -Number(this.data.data.sante.endurance.value)); result.endurance = Math.max(result.endurance, -Number(this.data.data.sante.endurance.value));
await this.santeIncDec("vie", result.vie); await this.santeIncDec("vie", result.vie);

View File

@ -264,19 +264,24 @@ export class RdDCalendrier extends Application {
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
getAjustementAstrologique(heureNaissance) getAjustementAstrologique(heureNaissance, name='inconnu')
{ {
let hn = heuresDef[heureNaissance].heure; if (heureNaissance && heuresDef[heureNaissance]) {
let chiffreAstral = this.getCurrentNombreAstral(); let hn = heuresDef[heureNaissance].heure;
let heureCourante = this.calendrier.heureRdD; let chiffreAstral = this.getCurrentNombreAstral();
let ecartChance = (hn + chiffreAstral - heureCourante)%12; let heureCourante = this.calendrier.heureRdD;
console.log("ajustementAstrologique", heureNaissance, hn, chiffreAstral, heureCourante, ecartChance); let ecartChance = (hn + chiffreAstral - heureCourante)%12;
switch (ecartChance) console.log("ajustementAstrologique", heureNaissance, hn, chiffreAstral, heureCourante, ecartChance);
{ switch (ecartChance)
case 0: return 4; {
case 4: case 8: return 2; case 0: return 4;
case 6: return -4; case 4: case 8: return 2;
case 3: case 9: return -2; case 6: return -4;
case 3: case 9: return -2;
}
}
else {
ui.notifications.warn(, this.data.name + " n'a pas d'heure de naissance, ou elle est incorrecte");
} }
return 0; return 0;
} }

View File

@ -396,7 +396,7 @@ export class RdDCombat {
console.log("RdDCombat._onParadeEchec >>>", rollData); console.log("RdDCombat._onParadeEchec >>>", rollData);
let explications = "<br><strong>Parade échouée, encaissement !</strong> "; let explications = "<br><strong>Parade échouée, encaissement !</strong> ";
explications += this.descriptionSurprise(rollData.surprise); explications += RdDCombat.descriptionSurprise(rollData.surprise);
if (rollData.needSignificative) { if (rollData.needSignificative) {
explications += " Significative nécessaire!"; explications += " Significative nécessaire!";
} }

View File

@ -155,7 +155,7 @@ Hooks.once("init", async function() {
"standard": "Standard", "standard": "Standard",
"experimental": "Expérimental" "experimental": "Expérimental"
}, },
default: "standard" default: "experimental"
}); });
/* -------------------------------------------- */ /* -------------------------------------------- */

View File

@ -136,7 +136,7 @@
{"_id":"hVgd4APvAW8sbXf0","name":"Grande hache","permission":{"default":0,"rYShh2P1DNavdoBD":3},"type":"arme","data":{"description":"","quantite":1,"encombrement":3,"equipe":false,"dommages":"4","force":"13","resistance":8,"competence":"Hache à 2 mains","cout":15,"portee_courte":0,"portee_moyenne":0,"portee_extreme":0,"rapide":false,"deuxmains":true,"unemain":false},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/armes_armures/grande_hache.webp","effects":[]} {"_id":"hVgd4APvAW8sbXf0","name":"Grande hache","permission":{"default":0,"rYShh2P1DNavdoBD":3},"type":"arme","data":{"description":"","quantite":1,"encombrement":3,"equipe":false,"dommages":"4","force":"13","resistance":8,"competence":"Hache à 2 mains","cout":15,"portee_courte":0,"portee_moyenne":0,"portee_extreme":0,"rapide":false,"deuxmains":true,"unemain":false},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/armes_armures/grande_hache.webp","effects":[]}
{"_id":"hjsIxUmanyz5otLJ","name":"Marmite de fer (3 litres)","permission":{"default":0,"rYShh2P1DNavdoBD":3},"type":"conteneur","data":{"description":"","capacite":1.5,"encombrement":0.6,"equipe":false,"qualite":0,"contenu":[],"cout":0.6},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/objets/marmite.webp","effects":[]} {"_id":"hjsIxUmanyz5otLJ","name":"Marmite de fer (3 litres)","permission":{"default":0,"rYShh2P1DNavdoBD":3},"type":"conteneur","data":{"description":"","capacite":1.5,"encombrement":0.6,"equipe":false,"qualite":0,"contenu":[],"cout":0.6},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/objets/marmite.webp","effects":[]}
{"_id":"iCvphbPdxUcfqetd","name":"Aumônière","permission":{"default":0,"jOzRscDxoXZWpGS6":3},"type":"conteneur","data":{"description":"<p>Comme une bourse, mais sous forme d'une coque en cuir rigide.</p>","capacite":0.25,"encombrement":0,"equipe":false,"qualite":0,"cout":0.2,"contenu":[]},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/objets/aumoniere.webp","effects":[]} {"_id":"iCvphbPdxUcfqetd","name":"Aumônière","permission":{"default":0,"jOzRscDxoXZWpGS6":3},"type":"conteneur","data":{"description":"<p>Comme une bourse, mais sous forme d'une coque en cuir rigide.</p>","capacite":0.25,"encombrement":0,"equipe":false,"qualite":0,"cout":0.2,"contenu":[]},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/objets/aumoniere.webp","effects":[]}
{"_id":"iGHudg5kBOfYWgwV","name":"Arc","permission":{"default":0,"rYShh2P1DNavdoBD":3},"type":"arme","data":{"description":"<p>Nie jusqu'&agrave; 2 points d'armure.</p>\n<p>Rechargement 1/2 round (s'il tire en d&eacute;but de round, il pourra recharger durant le reste du round pour tirer de nouveau au d&eacute;but du round suivant).</p>","quantite":1,"encombrement":1,"equipe":false,"dommages":2,"force":0,"resistance":0,"competence":"Arc","cout":10,"portee_courte":10,"portee_moyenne":20,"portee_extreme":50,"rapide":false,"deuxmains":false,"unemain":false},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/objets/arc.webp","effects":[]} {"_id":"iGHudg5kBOfYWgwV","name":"Arc","permission":{"default":0,"rYShh2P1DNavdoBD":3},"type":"arme","data":{"description":"<p>Nie jusqu'&agrave; 2 points d'armure.</p>\n<p>Rechargement 1/2 round (s'il tire en d&eacute;but de round, il pourra recharger durant le reste du round pour tirer de nouveau au d&eacute;but du round suivant).</p>","quantite":1,"encombrement":1,"equipe":false,"dommages":"2","force":"0","resistance":0,"competence":"Arc","cout":10,"portee_courte":10,"portee_moyenne":20,"portee_extreme":50,"penetration":2,"rapide":false,"deuxmains":false,"unemain":false},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/objets/arc.webp","effects":[]}
{"_id":"ijCebH1Pr3LmzdOj","name":"Épée cyane","permission":{"default":0,"rYShh2P1DNavdoBD":3},"type":"arme","data":{"description":"<p>Long <em>cimeterre </em>&agrave; l&rsquo;acier bleut&eacute;, exclusivement fabriqu&eacute; par les Cyans ou Hommes bleus.</p>","quantite":1,"encombrement":2,"equipe":false,"dommages":"3","force":"11","resistance":12,"competence":"Epée à 1 main","cout":25,"portee_courte":0,"portee_moyenne":0,"portee_extreme":0,"rapide":true,"deuxmains":false,"unemain":true},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/armes_armures/epee_cyane.webp","effects":[]} {"_id":"ijCebH1Pr3LmzdOj","name":"Épée cyane","permission":{"default":0,"rYShh2P1DNavdoBD":3},"type":"arme","data":{"description":"<p>Long <em>cimeterre </em>&agrave; l&rsquo;acier bleut&eacute;, exclusivement fabriqu&eacute; par les Cyans ou Hommes bleus.</p>","quantite":1,"encombrement":2,"equipe":false,"dommages":"3","force":"11","resistance":12,"competence":"Epée à 1 main","cout":25,"portee_courte":0,"portee_moyenne":0,"portee_extreme":0,"rapide":true,"deuxmains":false,"unemain":true},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/armes_armures/epee_cyane.webp","effects":[]}
{"_id":"iq8ZZgphxOUgC1bi","name":"Flûte traversière de roseau","permission":{"default":0,"rYShh2P1DNavdoBD":3},"type":"objet","data":{"description":"","quantite":1,"encombrement":0.08,"equipe":false,"resistance":0,"qualite":0,"cout":0.12},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/objets/flute_traversiere.webp","effects":[]} {"_id":"iq8ZZgphxOUgC1bi","name":"Flûte traversière de roseau","permission":{"default":0,"rYShh2P1DNavdoBD":3},"type":"objet","data":{"description":"","quantite":1,"encombrement":0.08,"equipe":false,"resistance":0,"qualite":0,"cout":0.12},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/objets/flute_traversiere.webp","effects":[]}
{"_id":"iuSOVPBsK8Zg6hoY","name":"1 m² de bâche","permission":{"default":0,"rYShh2P1DNavdoBD":3},"type":"objet","data":{"description":"","quantite":1,"encombrement":0.5,"equipe":false,"resistance":0,"qualite":0,"cout":0.2},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/objets/bache.webp","effects":[]} {"_id":"iuSOVPBsK8Zg6hoY","name":"1 m² de bâche","permission":{"default":0,"rYShh2P1DNavdoBD":3},"type":"objet","data":{"description":"","quantite":1,"encombrement":0.5,"equipe":false,"resistance":0,"qualite":0,"cout":0.2},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/objets/bache.webp","effects":[]}
@ -149,7 +149,7 @@
{"_id":"keLCmhsbxHK39UIy","name":"Mirobolant","permission":{"default":0,"rYShh2P1DNavdoBD":3},"type":"potion","data":{"description":"<p>Fluide.</p>\n<p>Liquide rouge&acirc;tre clair et sans d&eacute;pot.</p>","quantite":1,"encombrement":0.1,"rarete":"","categorie":"Alchimie","cout":2},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/objets/mirobolant.webp","effects":[]} {"_id":"keLCmhsbxHK39UIy","name":"Mirobolant","permission":{"default":0,"rYShh2P1DNavdoBD":3},"type":"potion","data":{"description":"<p>Fluide.</p>\n<p>Liquide rouge&acirc;tre clair et sans d&eacute;pot.</p>","quantite":1,"encombrement":0.1,"rarete":"","categorie":"Alchimie","cout":2},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/objets/mirobolant.webp","effects":[]}
{"_id":"lJMKVPB5zlG9UqMD","name":"Pourpoint de velours","permission":{"default":0,"rYShh2P1DNavdoBD":3},"type":"objet","data":{"description":"","quantite":1,"encombrement":0.2,"equipe":false,"resistance":0,"qualite":0,"cout":8},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/objets/pourpoint_velours.webp","effects":[]} {"_id":"lJMKVPB5zlG9UqMD","name":"Pourpoint de velours","permission":{"default":0,"rYShh2P1DNavdoBD":3},"type":"objet","data":{"description":"","quantite":1,"encombrement":0.2,"equipe":false,"resistance":0,"qualite":0,"cout":8},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/objets/pourpoint_velours.webp","effects":[]}
{"_id":"lKkYFkzWVs2TZDZP","name":"Petit pot de fard","permission":{"default":0,"rYShh2P1DNavdoBD":3},"type":"objet","data":{"description":"","quantite":1,"encombrement":0.04,"equipe":false,"resistance":0,"qualite":0,"cout":0.3},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/objets/fard.webp","effects":[]} {"_id":"lKkYFkzWVs2TZDZP","name":"Petit pot de fard","permission":{"default":0,"rYShh2P1DNavdoBD":3},"type":"objet","data":{"description":"","quantite":1,"encombrement":0.04,"equipe":false,"resistance":0,"qualite":0,"cout":0.3},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/objets/fard.webp","effects":[]}
{"_id":"lOI2HVu3B6EDY4sE","name":"Arbalète","permission":{"default":0,"rYShh2P1DNavdoBD":3},"type":"arme","data":{"description":"<p>Nie jusqu'&agrave; 2 points d'armure.</p>\n<p>Rechargement 1 round.</p>","quantite":1,"encombrement":3,"equipe":false,"dommages":3,"force":0,"resistance":0,"competence":"Arbalète","cout":30,"portee_courte":15,"portee_moyenne":30,"portee_extreme":70,"rapide":false,"deuxmains":false,"unemain":false},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/objets/arbalete.webp","effects":[]} {"_id":"lOI2HVu3B6EDY4sE","name":"Arbalète","permission":{"default":0,"rYShh2P1DNavdoBD":3},"type":"arme","data":{"description":"<p>Nie jusqu'&agrave; 2 points d'armure.</p>\n<p>Rechargement 1 round.</p>","quantite":1,"encombrement":3,"equipe":false,"dommages":"3","force":0,"resistance":0,"competence":"Arbalète","cout":30,"portee_courte":15,"portee_moyenne":30,"portee_extreme":70,"penetration":2,"rapide":false,"deuxmains":false,"unemain":false},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/objets/arbalete.webp","effects":[]}
{"_id":"lq7pjDQESNbZOQ3n","name":"1 m2 de soie ou de velours","permission":{"default":0,"rYShh2P1DNavdoBD":3},"type":"objet","data":{"description":"","quantite":1,"encombrement":0,"equipe":false,"resistance":0,"qualite":0,"cout":3},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/objets/tissu_velours.webp","effects":[]} {"_id":"lq7pjDQESNbZOQ3n","name":"1 m2 de soie ou de velours","permission":{"default":0,"rYShh2P1DNavdoBD":3},"type":"objet","data":{"description":"","quantite":1,"encombrement":0,"equipe":false,"resistance":0,"qualite":0,"cout":3},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/objets/tissu_velours.webp","effects":[]}
{"_id":"m9yuZjp9DK7pSqPK","name":"Lanterne à bougie","permission":{"default":0,"rYShh2P1DNavdoBD":3},"type":"conteneur","data":{"description":"","capacite":0.1,"encombrement":1,"equipe":false,"qualite":0,"contenu":[],"cout":3},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/objets/lanterne_bougie.webp","effects":[]} {"_id":"m9yuZjp9DK7pSqPK","name":"Lanterne à bougie","permission":{"default":0,"rYShh2P1DNavdoBD":3},"type":"conteneur","data":{"description":"","capacite":0.1,"encombrement":1,"equipe":false,"qualite":0,"contenu":[],"cout":3},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/objets/lanterne_bougie.webp","effects":[]}
{"_id":"mOZodpJYobvmZO9o","name":"Le Narcolepton","permission":{"default":0,"jOzRscDxoXZWpGS6":3},"type":"livre","data":{"description":"<p>Cet ouvrage ne peut &ecirc;tre assimil&eacute; que si l&rsquo;on poss&egrave;de un niveau minimum de z&eacute;ro en voie de Narcos. Il conf&egrave;re un bonus de synth&egrave;se de +3 aux sept &Eacute;cailles de Protection pr&eacute;sent&eacute;es dans les r&egrave;gles (Venin, Maladie, Feu, Magie, Projectiles, Lames, Griffes et crocs), mais aucun bonus de points de sorts. Sa difficult&eacute; de lecture est de -4, son assimilation requiert 24 points de t&acirc;che, p&eacute;riodicit&eacute; une heure.</p>","auteur":"anonyme","quantite":1,"difficulte":-4,"points_de_tache":24,"encombrement":0,"xp":"","cout":0},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_narcos.png","effects":[]} {"_id":"mOZodpJYobvmZO9o","name":"Le Narcolepton","permission":{"default":0,"jOzRscDxoXZWpGS6":3},"type":"livre","data":{"description":"<p>Cet ouvrage ne peut &ecirc;tre assimil&eacute; que si l&rsquo;on poss&egrave;de un niveau minimum de z&eacute;ro en voie de Narcos. Il conf&egrave;re un bonus de synth&egrave;se de +3 aux sept &Eacute;cailles de Protection pr&eacute;sent&eacute;es dans les r&egrave;gles (Venin, Maladie, Feu, Magie, Projectiles, Lames, Griffes et crocs), mais aucun bonus de points de sorts. Sa difficult&eacute; de lecture est de -4, son assimilation requiert 24 points de t&acirc;che, p&eacute;riodicit&eacute; une heure.</p>","auteur":"anonyme","quantite":1,"difficulte":-4,"points_de_tache":24,"encombrement":0,"xp":"","cout":0},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_narcos.png","effects":[]}

View File

@ -5,7 +5,7 @@
"version": "1.1.10", "version": "1.1.10",
"minimumCoreVersion": "0.7.5", "minimumCoreVersion": "0.7.5",
"compatibleCoreVersion": "0.7.8", "compatibleCoreVersion": "0.7.8",
"templateVersion": 70, "templateVersion": 71,
"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"],

View File

@ -568,6 +568,7 @@
"encombrement": 0, "encombrement": 0,
"equipe": false, "equipe": false,
"dommages": "0", "dommages": "0",
"penetration": 0,
"force": "0", "force": "0",
"resistance": 0, "resistance": 0,
"competence": "", "competence": "",

View File

@ -56,6 +56,10 @@
<label for="xp">Portée extrême </label> <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"/> <input class="attribute-value" type="text" name="data.portee_extreme" value="{{data.portee_extreme}}" data-dtype="Number"/>
</div> </div>
<div class="form-group">
<label for="penetration">Pénétration </label>
<input class="attribute-value" type="text" name="data.penetration" value="{{data.penetration}}" 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"/>