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-
+
+
+
+
+
+
+
+
+
+
|
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
|
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
|
@@ -4414,7 +4592,7 @@
title="@{traitnom}"
/>
-
+ |
|
-
Seuil Avarie :
@@ -7066,10 +7248,8 @@
src="https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/ChroniquesGalactiques/cog_hr.png"
/>
-
- Importer un statblock
-
-
+
+ Importer un statblock
-
+
@@ -7659,10 +7839,8 @@
src="https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/ChroniquesGalactiques/cog_hr.png"
/>
-
- Importer un statblock
-
-
+
+ Importer un statblock
-
+
@@ -8183,17 +8361,17 @@
|
Attaques
|
- Toucher |
- Crit. |
- DM |
- Portée |
- Spécial |
+ Toucher |
+ Crit. |
+ DM |
+ Portée |
+ Spécial |
@@ -8493,10 +8671,8 @@
src="https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/ChroniquesGalactiques/cog_hr.png"
/>
-
- Importer un statblock
-
-
+
+ Importer un statblock
-
+
@@ -9077,6 +9253,14 @@ function parseNameValue(data, delim) {
return parsed;
}
+
+function onChanged(list) {
+ return list
+ .split(",")
+ .map(a => `changed:${ a.toLowerCase() }`)
+ .join(" ");
+}
+
/**
* Remove all rows for a repeating section
* @param {string} sectionName Repeating section to clear
@@ -9314,7 +9498,7 @@ function importShipSB(text, shipName) {
options = false;
return;
}
- if (row.toLowerCase().indexOf("quipage") >= 0) {
+ if (row.toLowerCase().indexOf("quipage") === 1) {
attribs = false;
crew = true;
options = false;
@@ -9405,9 +9589,13 @@ function importMechaSB(text, mechName) {
rows.forEach(function (row, rowNum) {
let dataRow = row.trim();
clog(dataRow, "statblock import -> parse row");
- if (rowNum == 0) {
- if (mechName !== "") mecha.character_name = mechName;
- else mecha.character_name = dataRow;
+ if (rowNum === 0) {
+ if (mechName !== "") {
+ mecha.PROFIL = dataRow;
+ mecha.character_name = mechName;
+ } else {
+ mecha.character_name = dataRow;
+ }
return;
}
@@ -9827,8 +10015,9 @@ function processShipAttributes(shipObj) {
const armedmnbde = int(atko[1].split("d")[0]);
const armedmde = int(atko[1].split("d")[1]);
clog(armenom);
- const weapon = shipWeapons.find((w) => w.name == armenom.substring(3));
+ const weapon = shipWeapons.find((w) => w.name.toLowerCase() == armenom.substring(3).toLowerCase());
clog(weapon);
+ if (!weapon) return;
let newRowID = "repeating_armesv_" + generateRowID();
shipAttrs[`${newRowID}_armenom`] = armenom;
shipAttrs[`${newRowID}_armeatt`] = "attaque=";
@@ -9857,7 +10046,7 @@ function processShipAttributes(shipObj) {
clog(shipAttrs);
setAttrs(shipAttrs);
- return result;
+ return shipAttrs.sbresult;
}
/**
@@ -10124,7 +10313,7 @@ function processMechaAttributes(mechObj) {
clog(mechAttrs);
setAttrs(mechAttrs);
- return result;
+ return mechAttrs.sbresult;
}
/**
@@ -10156,21 +10345,21 @@ function buildCaracs() {
],
function (values) {
let caracs = {};
- for (let car in values) {
- let vcar = values[car];
- if (vcar && !isNaN(vcar)) vcar = int(vcar);
- if (car.startsWith("RANG_")) {
+ for (const attr in values) {
+ let value = values[attr];
+ if (value && !isNaN(value)) value = int(value);
+ if (attr.startsWith("RANG_")) {
if (!caracs.hasOwnProperty("rangs"))
caracs.rangs = [0, 0, 0, 0, 0, 0, 0, 0, 0];
- let voie = int(car.substring(car.length - 1));
- if (voie > 0) caracs.rangs[voie - 1] = vcar;
- } else if (car.startsWith("voie") && car.endsWith("nom")) {
+ let voie = int(attr.substring(attr.length - 1));
+ if (voie > 0) caracs.rangs[voie - 1] = value;
+ } else if (attr.startsWith("voie") && attr.endsWith("nom")) {
if (!caracs.hasOwnProperty("voies"))
caracs.voies = ["", "", "", "", "", "", "", "", ""];
- let voie = int(car.substring(4, 5));
- if (voie > 0 && vcar) caracs.voies[voie - 1] = vcar.toUpperCase();
+ let voie = int(attr.substring(4, 5));
+ if (voie > 0 && value) caracs.voies[voie - 1] = value.toUpperCase();
} else {
- caracs[car] = vcar;
+ caracs[attr] = value;
}
}
setAttrs({
@@ -13138,7 +13327,7 @@ on(
attrs[`${atkId}_armeatt`] = "attaque=";
attrs[`${atkId}_armeatk`] = atkInfo.type;
attrs[`${atkId}_armeportee`] = stringOrDefault(atkInfo.portee);
- if (atkInfo.dm.length) {
+ if (atkInfo.dm) {
attrs[`${atkId}_armedmg`] = "degats=";
attrs[`${atkId}_armedmnbde`] = atkInfo.dm[0];
attrs[`${atkId}_armedmde`] = atkInfo.dm[1].replace("+", "!");
@@ -13609,7 +13798,7 @@ function loadSkills() {
* Adjust starship total hit points
*/
function starshipHP() {
- getAttrs(["type_fiche", "NIVEAU", "DV", "CON"], function (values) {
+ getAttrs(["type_fiche", "NIVEAU", "DV", "CON", "PV_BUFF"], function (values) {
if (values.type_fiche !== SHEET_STARSHIP) return;
const niveau = int(values.NIVEAU);
@@ -13618,7 +13807,10 @@ function starshipHP() {
const valCON = int(values.CON);
let pv_max = (dv + valCON) * niveau;
+
+ const pv_buff = int(values.PV_BUFF);
pv_max += pv_buff;
+
setAttrs({ PV_max: pv_max });
});
}
@@ -14049,8 +14241,3 @@ on("change:custom", function() {
-
-
-
-
-
|