diff --git a/ChroniquesOublieesContemporain/README.md b/ChroniquesOublieesContemporain/README.md index bbcf9077fa..cb32e23da5 100644 --- a/ChroniquesOublieesContemporain/README.md +++ b/ChroniquesOublieesContemporain/README.md @@ -10,10 +10,20 @@ Le jeu complet est disponible sur le site de l'éditeur [Black Book Editions](ht # Version courante -3.4 [Screenshot](coc_v2.png) +3.5 [Screenshot](coc_v2.png) # Notes de version +## v3.5 (2020-08-22) + +- Gestion des dés d'usure en mode CO Bitume. Pour chaque pièce d'équipement concernée, indiquer dans la liste des propriétés une propriété nommée Ud et donner en valeur le chiffre du dé d'usure (8 pour d8, 10 pour d10, etc...). Un bouton sous la liste des équipements permet de lancer un test d'usure en sélectionnant d'abord l'équipement concerné. En cas d'échec (le chiffre du jet dans le chat apparait en rouge), le dé d'usure de cette équipement doit être baissé d'un cran (ex : de 'Ud : 8' à 'Ud : 6', cf livre de règles). +- Gestion de la fiche de véhicule spécifique à Bitume avec : + - Une liste des modifications du véhicule pour laquelle on peut indiquer : + - le nombre d'emplacements pris par la modification, en cas de dépassement du nombre maximum (valeur de la caractéristique EMP) le nombre d'emplacement est remis à 0. + - une liste éventuelle des caractéristiques que la modification booste (RAP, MAN, IMP). + - une case permettant d'activer ou non la modification (et donc d'appliquer le buff correspondant) + - Une gestion des dés d'usure du véhicule, avec possibilité d'indiquer le Ud maximum et le Ud courant et de faire les jets d'usure correspondant. Le Ud courant est automatiquement mis à jour d'une part en fonction du Ud maximum, et d'autre part en fonction des points d'avaries accumulés. + ## v3.4 (2020-08-15) - Amélioration de la logique d'import d'un statblock de PNJ ou de créature diff --git a/ChroniquesOublieesContemporain/coc.css b/ChroniquesOublieesContemporain/coc.css index 6cc5cf01f9..9244628542 100644 --- a/ChroniquesOublieesContemporain/coc.css +++ b/ChroniquesOublieesContemporain/coc.css @@ -217,6 +217,31 @@ button[type='roll'].sheet-nod20:before { content: ''; } +button[type='roll'].sheet-roll-d12::before { + font-family: 'dicefontd12'; + content: 'l'; +} + +button[type='roll'].sheet-roll-d10::before { + font-family: 'dicefontd10'; + content: 'k'; +} + +button[type='roll'].sheet-roll-d8::before { + font-family: 'dicefontd8'; + content: 'h'; +} + +button[type='roll'].sheet-roll-d6::before { + font-family: 'dicefontd6'; + content: 'f'; +} + +button[type='roll'].sheet-roll-d4::before { + font-family: 'dicefontd4'; + content: 'd'; +} + button.sheet-flatbtn { border: 0px; background-color: transparent; diff --git a/ChroniquesOublieesContemporain/coc.html b/ChroniquesOublieesContemporain/coc.html index 95801df9a6..dee6d186aa 100644 --- a/ChroniquesOublieesContemporain/coc.html +++ b/ChroniquesOublieesContemporain/coc.html @@ -1,10 +1,11 @@
- - + + + @@ -61,13 +62,24 @@ + +
-
- +
+
+ +
+
+
+ +
+
@@ -1734,6 +1746,14 @@ +
+ +
+
+ +
+
+
Autres ressources
@@ -1881,133 +1901,468 @@
- -
- - - - - - - - - - - - - - - - - - - - - - -
Type : - - Description : - -
Pilote : - -  
FORAGIPVDEFBlindage (RD)
- - - - -  /  - -  Base :  - + DEX : - = - - - -
-
- Jets du véhicule + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
Type : + + Description : + +
Pilote : + +  
FORAGIPVDEFBlindage (RD)
+ + + + +  /  + +  Base :  + + DEX : + = + + + +
+
+ Jets du véhicule +
+
+ + + + + + + +
+ + + + + + ( + + ) + + + + + + + + + + + +
+
+ +
-
- - - - - - - -
- - - - - - ( - - ) + - - + - - + - - - - -
-
- +
+
+ +
+
+ + + + + + + + + + + +
Type : + +
Description :
+ +
Pilote : + +  
+
+

Modifications

+ +
+
+ + Emp. + + Coût + +
+ +
+ + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BaseDiversTotal
RAP + + + + + +
MAN + + + + + +
IMP + + + + + +
EMP + + + + + +
+ + + + + + + + + +
DEF10+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Dés d'Usure + +
+ + + + + + | + + + + | + + + + + + +
+ + + + + + | + + + + | + + + + +
+ + + + + + | + + + + + + +
+ + + + + + | + + + + +
+ + + + + + + + +
Ud0 + +
+
+
+ +
+ Jets du véhicule +
+
+ + + + + + + +
+ + + + + + ( + + ) + + + + + + + + + + + +
+
+
+ +
+
PARAMETRES
+
    +
  • Jets : + +
  • +
  • Bitume : + +
  • +
@@ -3428,6 +3783,7 @@ function updateBuffs(e) { 'ATKTIR', 'ATKMAG', 'ATKMEN', + 'ATKPIL', 'INIT', 'DEF', 'PV', @@ -3634,6 +3990,7 @@ function rebuildBuffs() { men: 'atkmen', mental: 'atkmen', mentale: 'atkmen', + pil: 'atkpil', pilotage: 'atkpil', tir: 'atktir', initiative: 'init', @@ -4417,6 +4774,48 @@ function encumbrance() { }); } +/** + * Rebuild the list of equipments with Udie + */ +function rebuildUD() { + getAttrs(['coc_setting'], function (v) { + if (v.coc_setting !== 'bitume') return; + getSectionIDs('repeating_equipement', function (ids) { + var uds = []; + ids.forEach((id, ix) => { + const rowId = `repeating_equipement_${id}_`; + getAttrs([`${rowId}equip-desc`, `${rowId}equip-props`], function ( + values + ) { + const desc = values[Object.keys(values)[0]]; + const props = (values[Object.keys(values)[1]] || '').split(','); + const uD = props.find((prop) => { + return ( + prop !== '' && parseNameValue(prop)['name'].toUpperCase() === 'UD' + ); + }); + let dU = 0; + if (uD !== undefined) { + dU = parseInt(parseNameValue(uD)['value'].replace(/d/g, '')) || 0; + } + if (dU !== 0) { + uds.push(`${desc},d${dU}`); + } + if (ix == ids.length - 1) { + let qryud = ''; + if (uds.length == 1) { + qryud = uds[0].split(',')[1]; + } else if (uds.length > 1) { + qryud = `?{Dé d'usure ?|${uds.join('|')}}`; + } + setAttrs({ QRYUD: qryud }); + } + }); + }); + }); + }); +} + /** * On changing character equipment * - Recompute character encumbrance @@ -4425,6 +4824,7 @@ on( ['change:repeating_equipement', 'remove:repeating_equipement'].join(' '), function () { encumbrance(); + rebuildUD(); } ); @@ -4595,6 +4995,7 @@ function rebuildAll() { rebuildBuffs(); rebuildModAtkDM('repeating_modatk', 'armebuff'); rebuildModAtkDM('repeating_moddm', 'armebuffdm'); + rebuildUD(); } /** @@ -5018,6 +5419,183 @@ on('change:pc_desc', function () { }); }); +/** + * On changing Bitume vehicle RAP components + * - Recompute total RAP + */ +on('change:vbrap_base change:vbrap_div', function () { + getAttrs(['vbrap_base', 'vbrap_div'], function (values) { + let vbrap = parseInt(values.vbrap_base) || 0; + vbrap += parseInt(values.vbrap_div) || 0; + setAttrs({ + vbrap: vbrap, + }); + }); +}); + +/** + * On changing Bitume vehicle MAN components + * - Recompute total MAN + * - Recompute vehicle DEF + */ +on('change:vbman_base change:vbman_div', function () { + getAttrs(['vbman_base', 'vbman_div', 'vbimp'], function (values) { + let vbman = parseInt(values.vbman_base) || 0; + vbman += parseInt(values.vbman_div) || 0; + let vbimp = parseInt(values.vbimp) || 0; + setAttrs({ + vbman: vbman, + vbdef: 10 + vbimp + vbman, + }); + }); +}); + +/** + * On changing Bitume vehicle IMP components + * - Recompute total IMP + * - Recompute vehicle DEF + */ +on('change:vbimp_base change:vbimp_div', function () { + getAttrs(['vbimp_base', 'vbimp_div', 'vbman'], function (values) { + let vbimp = parseInt(values.vbimp_base) || 0; + vbimp += parseInt(values.vbimp_div) || 0; + let vbman = parseInt(values.vbman) || 0; + setAttrs({ + vbimp: vbimp, + vbdef: 10 + vbimp + vbman, + }); + }); +}); + +/** + * On changing Bitume vehicle EMP components + * - Recompute total EMP + */ +on('change:vbemp_base change:vbemp_div', function () { + getAttrs(['vbemp_base', 'vbemp_div'], function (values) { + let vbemp = parseInt(values.vbemp_base) || 0; + vbemp += parseInt(values.vbemp_div) || 0; + setAttrs({ + vbemp: vbemp, + }); + }); +}); + +/** + * Rebuild Bitume vehicle used EMP + */ +function rebuildUsedSlots() { + getAttrs(['coc_setting'], function (value) { + if (value.coc_setting !== 'bitume') return; + getSectionIDs('vbmods', function (ids) { + setAttrs({ vbemp_total: 0 }); + let used = 0; + ids.forEach((id) => { + getAttrs([`repeating_vbmods_${id}_vbmod-emp`], function (value) { + used += parseInt(value[Object.keys(value)[0]]) || 0; + setAttrs({ vbemp_total: used }); + }); + }); + }); + }); +} + +/** + * On changing Bitume vehicle mods + * - Rebuild vehicle buffs if any + * - Rebuild used slots + * - Check if installed mods do not use more slots than the max + */ +on('change:repeating_vbmods remove:repeating_vbmods', function (eventInfo) { + const attrs = { + vbrap_div: 0, + vbman_div: 0, + vbimp_div: 0, + vbemp_div: 0, + vbdef_div: 0, + }; + const eventRowId = eventInfo.sourceAttribute.split('_')[2]; + getSectionIDs('vbmods', function (ids) { + setAttrs({ vbemp_total: 0 }); + let used = 0; + ids.forEach((id, ix) => { + const rowId = `repeating_vbmods_${id}_`; + getAttrs( + [ + `${rowId}vbmod-on`, + `${rowId}vbmod-buffs`, + `${rowId}vbmod-emp`, + 'vbemp', + ], + function (values) { + const enabled = parseInt(values[Object.keys(values)[0]]) || 0; + const buffs = values[Object.keys(values)[1]] || ''; + if (enabled === 1 && buffs !== '') { + buffs.split(';').forEach((b) => { + const buff = parseNameValue(b); + const div = `vb${buff.name.toLowerCase()}_div`; + if (Object.keys(attrs).indexOf(div) !== -1) { + attrs[div] += parseInt(buff.value) || 0; + } + }); + } + used += parseInt(values[Object.keys(values)[2]]) || 0; + if ((ix = ids.length - 1)) { + empmax = parseInt(values.vbemp) || 0; + if (used > empmax) { + attrs[`repeating_vbmods_${eventRowId}_vbmod-emp`] = 0; + } else { + attrs['vbemp_total'] = used; + } + } + setAttrs(attrs); + } + ); + }); + }); +}); + +/** + * On changing Ud max for vehicle + * - Reset current Ud + */ +on('change:vbudmax', function () { + getAttrs(['vbudmax'], function (value) { + setAttrs({ vbud: value.vbudmax }); + }); +}); + +/** + * On checking Ud boxes + * - Adjust the current Ud value + */ +[12, 10, 8, 6, 4].forEach((udie) => { + const udboxes = []; + for (let cb = 1; cb <= udie; cb++) { + udboxes.push(`change:vbud${udie}_${cb}`); + } + on(udboxes.join(' '), function (eventInfo) { + const box = eventInfo.sourceAttribute.split('_')[0]; + let maxcb = parseInt(box.slice(4)); + const boxes = []; + for (let cb = 1; cb <= maxcb; cb++) { + boxes.push(`${box}_${cb}`); + } + getAttrs(['vbudmax', ...boxes], function (v) { + const vbudmax = parseInt(v.vbudmax) || 0; + delete v.vbudmax; + values = []; + for (const k of Object.keys(v)) { + values.push(v[k]); + } + if (values.findIndex((cb) => cb === '1') === -1) { + if (maxcb < vbudmax) maxcb += 2; + } + setAttrs({ vbud: maxcb }); + }); + }); +}); + /** * On changing COC setting * - Set character sheet options to default values for setting @@ -5038,6 +5616,7 @@ on(['change:coc_setting', 'change:coc_surh'].join(' '), function () { use_encombrement: '0', PC_DESC: 'Points de Choc,Point de Choc,PC', PC_BONUS: '+10', + coc_setting_bitume: '0', }, pulp: { INIT_JET: '@{INIT}', @@ -5052,6 +5631,7 @@ on(['change:coc_setting', 'change:coc_surh'].join(' '), function () { use_encombrement: '0', PC_DESC: 'Points de Chance,Point de Chance,PC', PC_BONUS: '+10', + coc_setting_bitume: '0', }, postapo: { INIT_JET: '@{INIT}', @@ -5066,6 +5646,7 @@ on(['change:coc_setting', 'change:coc_surh'].join(' '), function () { use_encombrement: '0', PC_DESC: 'Points de Chance,Point de Chance,PC', PC_BONUS: '+10', + coc_setting_bitume: '0', }, surhumain: { INIT_JET: '@{INIT}', @@ -5080,6 +5661,7 @@ on(['change:coc_setting', 'change:coc_surh'].join(' '), function () { use_encombrement: '0', PC_DESC: 'Points de Chance,Point de Chance,PC', PC_BONUS: '+10', + coc_setting_bitume: '0', }, cyberpunk: { INIT_JET: '{[[@{INIT}]]+1d6!, ([[@{INIT}]]*2)+0d6}kl1', @@ -5094,6 +5676,7 @@ on(['change:coc_setting', 'change:coc_surh'].join(' '), function () { use_encombrement: '0', PC_DESC: 'Points de Cash,Point de Cash,PC', PC_BONUS: '+[[1d6]]', + coc_setting_bitume: '0', }, shadowrun: { INIT_JET: '{[[@{INIT}]]+1d6!, ([[@{INIT}]]*2)+0d6}kl1', @@ -5108,6 +5691,7 @@ on(['change:coc_setting', 'change:coc_surh'].join(' '), function () { use_encombrement: '0', PC_DESC: 'Points de Cash,Point de Cash,PC', PC_BONUS: '+[[1d6]]', + coc_setting_bitume: '0', }, menacex: { INIT_JET: '@{INIT}', @@ -5122,6 +5706,7 @@ on(['change:coc_setting', 'change:coc_surh'].join(' '), function () { use_encombrement: '0', PC_DESC: 'Points de Chance,Point de Chance,PC', PC_BONUS: '+10', + coc_setting_bitume: '0', }, bitume: { INIT_JET: '{[[@{INIT}]]+1d6!, ([[@{INIT}]]*2)+0d6}kl1', @@ -5136,6 +5721,7 @@ on(['change:coc_setting', 'change:coc_surh'].join(' '), function () { use_encombrement: '0', PC_DESC: 'Points de Style,Point de Style,PS', PC_BONUS: 'effet Waouh, réussite héroïque, juste une égratignure', + coc_setting_bitume: '1', }, }; @@ -5159,80 +5745,89 @@ on(['change:coc_setting', 'change:coc_surh'].join(' '), function () { const rowId = 'repeating_ressources_' + generateRowID(); switch (values.coc_surh) { case 'ange': - (attrs['PROFIL'] = 'Ange'), (attrs['ATKMAG_CARAC'] = '@{CHA}'); + attrs['PROFIL'] = 'Ange'; + attrs['ATKMAG_CARAC'] = '@{CHA}'; break; case 'demon': - (attrs['PROFIL'] = 'Démon'), (attrs['ATKMAG_CARAC'] = '@{CHA}'); + attrs['PROFIL'] = 'Démon'; + attrs['ATKMAG_CARAC'] = '@{CHA}'; attrs['option_pr'] = '0'; attrs[`${rowId}_res-desc`] = "Points d'Âme"; attrs[`${rowId}_res-val`] = '1'; break; case 'fee-dragon': - (attrs['PROFIL'] = 'Dragon (être féérique)'), (attrs['DV'] = '10'); + attrs['PROFIL'] = 'Dragon (être féérique)'; + attrs['DV'] = '10'; attrs['ATKCAC_BASE'] = '2'; attrs['ATKTIR_BASE'] = '0'; attrs['ATKMAG_CARAC'] = '@{CHA}'; attrs['ATKMAG_BASE'] = '0'; break; case 'fee-dryade': - (attrs['PROFIL'] = 'Dryade (être féérique)'), (attrs['DV'] = '6'); + attrs['PROFIL'] = 'Dryade (être féérique)'; + attrs['DV'] = '6'; attrs['ATKCAC_BASE'] = '0'; attrs['ATKTIR_BASE'] = '0'; attrs['ATKMAG_CARAC'] = '@{CHA}'; attrs['ATKMAG_BASE'] = '2'; break; case 'fee-dwergar': - (attrs['PROFIL'] = 'Dwergar (être féérique)'), (attrs['DV'] = '8'); + attrs['PROFIL'] = 'Dwergar (être féérique)'; + attrs['DV'] = '8'; attrs['ATKCAC_BASE'] = '1'; attrs['ATKTIR_BASE'] = '1'; attrs['ATKMAG_CARAC'] = '@{CHA}'; attrs['ATKMAG_BASE'] = '0'; break; case 'fee-gobelin': - (attrs['PROFIL'] = 'Gobelin (être féérique)'), (attrs['DV'] = '8'); + attrs['PROFIL'] = 'Gobelin (être féérique)'; + attrs['DV'] = '8'; attrs['ATKCAC_BASE'] = '1'; attrs['ATKTIR_BASE'] = '1'; attrs['ATKMAG_CARAC'] = '@{CHA}'; attrs['ATKMAG_BASE'] = '0'; break; case 'fee-lutin': - (attrs['PROFIL'] = 'Lutin (être féérique)'), (attrs['DV'] = '6'); + attrs['PROFIL'] = 'Lutin (être féérique)'; + attrs['DV'] = '6'; attrs['ATKCAC_BASE'] = '0'; attrs['ATKTIR_BASE'] = '1'; attrs['ATKMAG_CARAC'] = '@{CHA}'; attrs['ATKMAG_BASE'] = '1'; break; case 'fee-ogre': - (attrs['PROFIL'] = 'Ogre (être féérique)'), (attrs['DV'] = '10'); + attrs['PROFIL'] = 'Ogre (être féérique)'; + attrs['DV'] = '10'; attrs['ATKCAC_BASE'] = '2'; attrs['ATKTIR_BASE'] = '0'; attrs['ATKMAG_CARAC'] = '@{CHA}'; attrs['ATKMAG_BASE'] = '0'; break; case 'garou': - (attrs['PROFIL'] = 'Loup-garou'), - (attrs['ATKMAG_CARAC'] = '@{PER}'); + attrs['PROFIL'] = 'Loup-garou'; + attrs['ATKMAG_CARAC'] = '@{PER}'; attrs['option_pr'] = '0'; attrs[`${rowId}_res-desc`] = 'Points de Rage'; attrs[`${rowId}_res-val`] = '0'; break; case 'vampire': - (attrs['PROFIL'] = 'Vampire'), (attrs['ATKMAG_CARAC'] = '@{INT}'); + attrs['PROFIL'] = 'Vampire'; + attrs['ATKMAG_CARAC'] = '@{INT}'; attrs['option_pr'] = '0'; attrs[`${rowId}_res-desc`] = 'Points de Sang'; attrs[`${rowId}_res-val`] = '0'; break; case 'mutant-endo': - (attrs['PROFIL'] = 'Mutant endogène'), - (attrs['ATKMAG_CARAC'] = '@{CHA}'); + attrs['PROFIL'] = 'Mutant endogène'; + attrs['ATKMAG_CARAC'] = '@{CHA}'; break; case 'mutant-exo': - (attrs['PROFIL'] = 'Mutant exogène'), - (attrs['ATKMAG_CARAC'] = '@{PER}'); + attrs['PROFIL'] = 'Mutant exogène'; + attrs['ATKMAG_CARAC'] = '@{PER}'; break; case 'mutant-psycho': - (attrs['PROFIL'] = 'Mutant psychogène'), - (attrs['ATKMAG_CARAC'] = '@{INT}'); + attrs['PROFIL'] = 'Mutant psychogène'; + attrs['ATKMAG_CARAC'] = '@{INT}'; break; } } diff --git a/ChroniquesOublieesContemporain/coc_bitume.jpg b/ChroniquesOublieesContemporain/coc_bitume.jpg new file mode 100644 index 0000000000..e4aefc60e2 Binary files /dev/null and b/ChroniquesOublieesContemporain/coc_bitume.jpg differ