From 6d828c29f671ef9c3b9fbb3171c97eb7f30b4b13 Mon Sep 17 00:00:00 2001 From: Zakarik Date: Tue, 29 Nov 2022 00:13:59 +0100 Subject: [PATCH] [Knight] Fix Ranger's Vision --- Knight/knight.html | 2358 +++++++++++---------- Knight/pug/html/tab/armure.html | 525 ++--- Knight/pug/html/tab/subCombat/armure.html | 1172 +++++----- Knight/pug/js/library.js | 645 +++--- Knight/pug/js/rolls/pj/ranger.js | 16 +- 5 files changed, 2366 insertions(+), 2350 deletions(-) diff --git a/Knight/knight.html b/Knight/knight.html index 24e6eeb19e..4c9f8bf705 100644 --- a/Knight/knight.html +++ b/Knight/knight.html @@ -184,11 +184,11 @@ colorLog = function(options){ '%c '+label+': %c '+message + ' ', 'background-color: '+lBGColor+';color: '+lTxtColor+'; font-weight:bold;', 'background-color: '+mBGColor+';color: '+mTxtColor+';' - ); + ); }; return function(){ if('TAS'===key || config.logging[key]){ - dataLogger(coloredLoggerFunction,function(m){console.log(m);},_.toArray(arguments)); + dataLogger(coloredLoggerFunction,function(m){console.log(m);},_.toArray(arguments)); } }; }, @@ -253,7 +253,7 @@ logCallstackSub = function(cs){ logCSA( '===================='+(csa.label ? '> '+csa.label+' <' : '')+'===================='); logCallstackSub(csa.stack); return true; - } + } logCS(line); return false; }); @@ -284,10 +284,10 @@ wrapCallback = function (label, callback, context){ }; }(callback,context)); } - + callstack = getCallstack(); callstack.shift(); - + return (function(cb,ctx,cs,lbl){ var ctxref=registerCallstack(cs,lbl); @@ -378,7 +378,7 @@ addProp = function(obj,prop,value,fullname){ return pvalue; } }); - + // string value Object.defineProperty(obj.S, pname, { enumerable: true, @@ -449,7 +449,7 @@ repeating = function( section ) { fieldNames = [], operations = [], after = [], - + repAttrs = function TAS_Repeating_Attrs(){ attrNames = namesFromArgs(arguments,attrNames); return this; @@ -458,7 +458,7 @@ repeating = function( section ) { fieldNames = namesFromArgs(arguments,fieldNames); return this; }, - repReduce = function TAS_Repeating_Reduce(func, initial, final, context) { + repReduce = function TAS_Repeating_Reduce(func, initial, final, context) { operations.push({ type: 'reduce', func: (func && _.isFunction(func) && func) || _.noop, @@ -515,7 +515,7 @@ repeating = function( section ) { fieldIds = ids; fullFieldNames = _.reduce(fieldIds,function(memo,id){ return memo.concat(_.map(fieldNames,function(name){ - return 'repeating_'+sectionName+'_'+id+'_'+name; + return 'repeating_'+sectionName+'_'+id+'_'+name; })); },[]); getAttrs( _.uniq(attrNames.concat(fullFieldNames)), function(values){ @@ -529,7 +529,7 @@ repeating = function( section ) { var r={}; addId(r,id); _.each(fieldNames,function(name){ - var fn = 'repeating_'+sectionName+'_'+id+'_'+name; + var fn = 'repeating_'+sectionName+'_'+id+'_'+name; addProp(r,name,values[fn],fn); }); @@ -577,7 +577,7 @@ repeating = function( section ) { }); }); }; - + return { attrs: repAttrs, attr: repAttrs, @@ -698,7 +698,7 @@ const i18n_deplacement = getTranslationByKey("deplacement"), i18n_changelingActive = getTranslationByKey("mode-changeling-active"), i18n_impregnation = getTranslationByKey("shaman-impregnation"), i18n_portee = getTranslationByKey("portee"), - i18n_chocAutomatique = getTranslationByKey("choc-automatique-si-chair"), + i18n_chocAutomatique = getTranslationByKey("choc-automatique-si-chair"), i18n_tour = getTranslationByKey("tour"), i18n_tours = getTranslationByKey("tours"), i18n_affecteAnatheme = getTranslationByKey("wizard-affecte-uniquement-anatheme"), @@ -713,9 +713,9 @@ const i18n_deplacement = getTranslationByKey("deplacement"), i18n_pilonnage = getTranslationByKey("pilonnage"), i18n_puissant = getTranslationByKey("puissant"), i18n_suppression = getTranslationByKey("suppression"), - i18n_precis = getTranslationByKey("precis"), - i18n_anatheme = getTranslationByKey("anatheme"), - i18n_antiAnatheme = getTranslationByKey("anti-anatheme"), + i18n_precis = getTranslationByKey("precis"), + i18n_anatheme = getTranslationByKey("anatheme"), + i18n_antiAnatheme = getTranslationByKey("anti-anatheme"), i18n_antiAnathemeCondition = getTranslationByKey("anti-anatheme-condition"), i18n_antiVehicule = getTranslationByKey("anti-vehicule"), i18n_artillerie = getTranslationByKey("artillerie"), @@ -897,16 +897,16 @@ function totalAspect(attrs, aspect) { } function setPanneauInformation(texte, reset = false, slot = false, energie = false) -{ +{ getAttrs(["panneauInformation", "nomIA", "fichePNJ"], function(value) { const TFiche = value["fichePNJ"]; const PI = value["panneauInformation"]; var IA = value["nomIA"]; - + if(TFiche == 1) IA = "ALERTE : "; - + if(PI == "" || reset == true) { if(IA == "" && TFiche == 0) @@ -929,26 +929,26 @@ function setPanneauInformation(texte, reset = false, slot = false, energie = fal }); } }); - + if(reset == true && slot == false) PI["msgSlot"] = 0; - + if(slot == true) PI["msgSlot"] = 1; - + if(energie == true) PI["msgEnergie"] = 1; } function resetPanneauInformation() { - + setAttrs({ panneauInformation: "" }); - + PI["msgSlot"] = 0; - + PI["msgEnergie"] = 0; } @@ -956,7 +956,7 @@ function setActiveCharacterId(charId){ var oldAcid=getActiveCharacterId(); var ev = new CustomEvent("message"); ev.data={"id":"0", "type":"setActiveCharacter", "data":charId}; - self.dispatchEvent(ev); + self.dispatchEvent(ev); return oldAcid; } @@ -985,12 +985,12 @@ setTimeout=function(callback, timeout){ } function getAttrsAsync(props){ - var acid=getActiveCharacterId(); //save the current activeCharacterID in case it has changed when the promise runs + var acid=getActiveCharacterId(); //save the current activeCharacterID in case it has changed when the promise runs var prevAcid=null; //local variable defined here, because it needs to be shared across the promise callbacks defined below return new Promise((resolve,reject)=>{ prevAcid=setActiveCharacterId(acid); //in case the activeCharacterId has changed, restore it to what we were expecting and save the current value to restore later try{ - getAttrs(props,(values)=>{ resolve(values); }); + getAttrs(props,(values)=>{ resolve(values); }); } catch{ reject(); } }).finally(()=>{ @@ -1000,44 +1000,44 @@ function getAttrsAsync(props){ //use the same pattern for each of the following... function setAttrsAsync(propObj, options){ - var acid=getActiveCharacterId(); - var prevAcid=null; + var acid=getActiveCharacterId(); + var prevAcid=null; return new Promise((resolve,reject)=>{ - prevAcid=setActiveCharacterId(acid); + prevAcid=setActiveCharacterId(acid); try{ setAttrs(propObj,options,(values)=>{ resolve(values); }); } catch{ reject(); } }).finally(()=>{ - setActiveCharacterId(prevAcid); + setActiveCharacterId(prevAcid); }); } function getSectionIDsAsync(sectionName){ - var acid=getActiveCharacterId(); - var prevAcid=null; + var acid=getActiveCharacterId(); + var prevAcid=null; return new Promise((resolve,reject)=>{ - prevAcid=setActiveCharacterId(acid); + prevAcid=setActiveCharacterId(acid); try{ getSectionIDs(sectionName,(values)=>{ resolve(values); }); } catch{ reject(); } }).finally(()=>{ - setActiveCharacterId(prevAcid); + setActiveCharacterId(prevAcid); }); } -function getSingleAttrAsync(prop){ - var acid=getActiveCharacterId(); - var prevAcid=null; +function getSingleAttrAsync(prop){ + var acid=getActiveCharacterId(); + var prevAcid=null; return new Promise((resolve,reject)=>{ - prevAcid=setActiveCharacterId(acid); + prevAcid=setActiveCharacterId(acid); try{ - getAttrs([prop],(values)=>{ resolve(values[prop]); }); + getAttrs([prop],(values)=>{ resolve(values[prop]); }); } catch{ reject(); } }).finally(()=>{ - setActiveCharacterId(prevAcid); + setActiveCharacterId(prevAcid); }); } @@ -1148,7 +1148,7 @@ const dataArmure = { armureMax:100, energieMax:40, cdfMax:8 - }, + }, "wizard":{ armureMax:40, energieMax:80, @@ -1345,7 +1345,7 @@ async function getCarac(hasBonus, C1, C2, C3, C4, CO1 = false) { result["C3"] = true; result["C3Brut"] = tC3Nom; result["C3Nom"] = CaracNom[tC3Nom]; - + listCaracs.push(tC3Nom); listCaracs.push(ODValue[tC3Nom]); } else @@ -1357,7 +1357,7 @@ async function getCarac(hasBonus, C1, C2, C3, C4, CO1 = false) { result["C4"] = true; result["C4Brut"] = tC4Nom; result["C4Nom"] = CaracNom[tC4Nom]; - + listCaracs.push(tC4Nom); listCaracs.push(ODValue[tC4Nom]); } else @@ -1413,13 +1413,13 @@ async function getCarac(hasBonus, C1, C2, C3, C4, CO1 = false) { return result; } -//Versioning +//Versioning on("sheet:opened",function() { getAttrs(["version"], function(v) { const version = parseInt(v["version"], 10)||0; - + if(version < 15) { getAttrs(["MAJSheetworker", "MonkMAJ", "MAJ", "PsionMAJ", "OD_MAJ", "PNJAEMAJ", "PNJPFMAJ", "WarriorOD_MAJ", "WarriorOD_MAJ_2", "PJINSMAJ", "MAJV15LDB_1", "MAJV15LDB_2", "MAJV15LDB_3", "DruidLionBF"], function(value) @@ -1438,9 +1438,9 @@ on("sheet:opened",function() const MAJL2 = parseInt(value["MAJV15LDB_2"], 10)||0; const MAJL3 = parseInt(value["MAJV15LDB_3"], 10)||0; const MAJBF = parseInt(value["DruidLionBF"], 10)||0; - + var versioning = 0; - + if(MAJSW == 1 || version > 0) versioning += 1; else @@ -1449,7 +1449,7 @@ on("sheet:opened",function() { var nCorrection = nom; var nMin = nom.toLowerCase(); - + if(nCorrection == "Druid") { nCorrection = "Drui"; @@ -1460,23 +1460,23 @@ on("sheet:opened",function() var vArmure = parseInt(value["armure"+nCorrection], 10)||0; var vArmureMax = parseInt(armure[nMin]["armureMax"], 10)||0; var vArmureModif = parseInt(value["armure"+nCorrection+"Modif"], 10)||0; - + var vEnergie = parseInt(value["energie"+nCorrection], 10)||0; var vEnergieMax = parseInt(armure[nMin]["energieMax"], 10)||0; var vEnergieModif = parseInt(value["energie"+nCorrection+"Modif"], 10)||0; - + var vCdfModif = parseInt(value["cdf"+nCorrection+"Modif"], 10)||0; - + dataArmure[nMin]["armure"] = vArmure; dataArmure[nMin]["armureModif"] = vArmureModif; - + dataArmure[nMin]["energie"] = vEnergie; dataArmure[nMin]["energieModif"] = vEnergieModif; - + dataArmure[nMin]["cdfModif"] = vCdfModif; }); }); - + getAttrs(["armure", "barbarianGoliath", "sorcererMMCorpMetal", "sorcerer150PG", "sorcererMM250PG", "warmaster150PG", "warmaster250PG", "warmasterImpFPersonnel"], function(value) { const actuel = value["armure"]; @@ -1491,37 +1491,37 @@ on("sheet:opened",function() const armModif = dataArmure[actuel]["armureModif"]; const eneModif = dataArmure[actuel]["energieModif"]; const cdfModif = dataArmure[actuel]["cdfModif"]; - + var totalEnergie = dataArmure[actuel]["energieMax"]+eneModif; - + var bonusCDF = 0; - + if(actuel == "barbarian") bonusCDF += goliath; - + if(actuel == "sorcerer") { if(CorpMetal != 0 || CM250PG != 0) { bonusCDF += 2; - + if(CM150PG != 0) bonusCDF += 2; } } - + if(actuel == "warmaster") { if(WIPers != 0) bonusCDF += 2; - + if(W150PG != 0) totalEnergie = dataArmure[actuel]["energieMax150"]+eneModif; - + if(W250PG != 0) totalEnergie = dataArmure[actuel]["energieMax250"]+eneModif; } - + setAttrs({ armurePJ:armure[actuel]["armure"], armurePJ_max:armure[actuel]["armureMax"]+armModif, @@ -1534,10 +1534,10 @@ on("sheet:opened",function() cdfPJModif:armure[actuel]["cdfModif"] }); }); - + versioning += 1; } - + if(MAJMO == 1 || version > 1) versioning += 1; else @@ -1546,7 +1546,7 @@ on("sheet:opened",function() { var M150 = value.monk150PG; var M250 = value.monk250PG; - + if(M150 == 2) { setAttrs({ @@ -1565,7 +1565,7 @@ on("sheet:opened",function() monkRayonViolence: "2D6" }); } - + if(M250 == 1) { setAttrs({ @@ -1583,10 +1583,10 @@ on("sheet:opened",function() }); } }); - + versioning += 1; } - + if(MAJSA == 1 || version > 2) versioning += 1; else @@ -1598,10 +1598,10 @@ on("sheet:opened",function() santePNJ: value.sante }); }); - + versioning += 1; } - + if(MAJPS == 1 || version > 3) versioning += 1; else @@ -1623,52 +1623,52 @@ on("sheet:opened",function() }); } }); - + versioning += 1; } - + if(MAJOD == 1 || version > 4) versioning += 1; else { - getAttrs(["armure", "deplOD", "forOD", "endOD", "hargneOD", "combOD", "instOD", "tirOD", "savoirOD", "technOD", "auraOD", "paroleOD", "sfOD", "discrOD", "percOD", "dextOD", "warriorSoldierA", "warriorHunterA", "warriorScholarA", "warriorHeraldA", "warriorScoutA", "warrior250PG"], function(value) + getAttrs(["armure", "deplOD", "forOD", "endOD", "hargneOD", "combOD", "instOD", "tirOD", "savoirOD", "technOD", "auraOD", "paroleOD", "sfOD", "discrOD", "percOD", "dextOD", "warriorSoldierA", "warriorHunterA", "warriorScholarA", "warriorHeraldA", "warriorScoutA", "warrior250PG"], function(value) { var armure = value.armure; var ODDep = Number(value.deplOD); var ODFor = Number(value.forOD); var ODEnd = Number(value.endOD); - + var ODHar = Number(value.hargneOD); var ODCom = Number(value.combOD); var ODIns = Number(value.instOD); - + var ODTir = Number(value.tirOD); var ODSav = Number(value.savoirOD); var ODTec = Number(value.technOD); - + var ODAur = Number(value.auraOD); var ODPar = Number(value.paroleOD); var ODSFR = Number(value.sfOD); - + var ODDis = Number(value.discrOD); var ODPer = Number(value.percOD); var ODDex = Number(value.dextOD); - + var WEvol = Number(value.warrior250PG); - + var SolBonus = value.warriorSoldierA; var HunBonus = value.warriorHunterA; var SchBonus = value.warriorScholarA; var HerBonus = value.warriorHeraldA; var ScoBonus = value.warriorScoutA; - + var sumSol = 0; var sumHun = 0; var sumSch = 0; var sumHer = 0; var sumSco = 0; - + if(armure == "warrior") { if(SolBonus != 0) @@ -1682,23 +1682,23 @@ on("sheet:opened",function() if(ScoBonus != 0) sumSco = 1+WEvol; } - + var totDep = ODDep+sumSol; var totFor = ODFor+sumSol; var totEnd = ODEnd+sumSol; - + var totHar = ODHar+sumHun; var totCom = ODCom+sumHun; var totIns = ODIns+sumHun; - + var totTir = ODTir+sumSch; var totSav = ODSav+sumSch; var totTec = ODTec+sumSch; - + var totAur = ODAur+sumHer; var totPar = ODPar+sumHer; var totSFR = ODSFR+sumHer; - + var totDis = ODDis+sumSco; var totPer = ODPer+sumSco; var totDex = ODDex+sumSco; @@ -1721,10 +1721,10 @@ on("sheet:opened",function() calODDex: totDex }); }); - + versioning += 1; } - + if(MAJAE == 1 || version > 5) versioning += 1; else @@ -1732,7 +1732,7 @@ on("sheet:opened",function() getAttrs(["chairPNJAE"], function(value) { var PNJAE = value.chairPNJAE; - + if(PNJAE > 5) { setAttrs({ @@ -1740,13 +1740,13 @@ on("sheet:opened",function() chairPNJAEMaj: PNJAE }); } - + }); - + getAttrs(["betePNJAE"], function(value) { var PNJAE = value.betePNJAE; - + if(PNJAE > 5) { setAttrs({ @@ -1754,13 +1754,13 @@ on("sheet:opened",function() betePNJAEMaj: PNJAE }); } - + }); - + getAttrs(["machinePNJAE"], function(value) { var PNJAE = value.machinePNJAE; - + if(PNJAE > 5) { setAttrs({ @@ -1768,13 +1768,13 @@ on("sheet:opened",function() machinePNJAEMaj: PNJAE }); } - + }); - + getAttrs(["damePNJAE"], function(value) { var PNJAE = value.damePNJAE; - + if(PNJAE > 5) { setAttrs({ @@ -1782,13 +1782,13 @@ on("sheet:opened",function() damePNJAEMaj: PNJAE }); } - + }); - + getAttrs(["masquePNJAE"], function(value) { var PNJAE = value.masquePNJAE; - + if(PNJAE > 5) { setAttrs({ @@ -1796,12 +1796,12 @@ on("sheet:opened",function() masquePNJAEMaj: PNJAE }); } - + }); - + versioning += 1; } - + if(MAJPF == 1 || version > 6) versioning += 1; else @@ -1813,23 +1813,23 @@ on("sheet:opened",function() setAttrs({ ptsFaibles: PJMM }); - + }); - + versioning += 1; } - + if(MAJW1 == 1 || version > 7) versioning += 1; else { - getSectionIDs("repeating_armeDist", function(idarray) + getSectionIDs("repeating_armeDist", function(idarray) { //Get oldSectionID var setOrf={}; var setPre={}; - _.each(idarray, function(currentID, i) + _.each(idarray, function(currentID, i) { - getAttrs(['repeating_armeDist_' + currentID + '_orfevrerie'], function(v) + getAttrs(['repeating_armeDist_' + currentID + '_orfevrerie'], function(v) { if(v['repeating_armeDist_' + currentID + '_orfevrerie'] == "{{orfevrerie=[[@{dexterite}+@{dextOD}]]}}") { @@ -1837,8 +1837,8 @@ on("sheet:opened",function() setAttrs(setOrf); //Update } }); - - getAttrs(['repeating_armeDist_' + currentID + '_precision'], function(v) + + getAttrs(['repeating_armeDist_' + currentID + '_precision'], function(v) { if(v['repeating_armeDist_' + currentID + '_precision'] == "{{precision=[[@{tir}+@{tirOD}]]}}") { @@ -1848,15 +1848,15 @@ on("sheet:opened",function() }); }); }); - - getSectionIDs("repeating_armeCaC", function(idarray) - { + + getSectionIDs("repeating_armeCaC", function(idarray) + { //Get oldSectionID var setOrf={}; var setPre={}; - _.each(idarray, function(currentID, i) + _.each(idarray, function(currentID, i) { - getAttrs(['repeating_armeCaC_' + currentID + '_orfevrerie'], function(v) + getAttrs(['repeating_armeCaC_' + currentID + '_orfevrerie'], function(v) { if(v['repeating_armeCaC_' + currentID + '_orfevrerie'] == "{{orfevrerie=[[@{dexterite}+@{dextOD}]]}}") { @@ -1864,8 +1864,8 @@ on("sheet:opened",function() setAttrs(setOrf); //Update } }); - - getAttrs(['repeating_armeCaC_' + currentID + '_precision'], function(v) + + getAttrs(['repeating_armeCaC_' + currentID + '_precision'], function(v) { if(v['repeating_armeCaC_' + currentID + '_precision'] == "{{precision=[[@{tir}+@{tirOD}]]}}") { @@ -1873,8 +1873,8 @@ on("sheet:opened",function() setAttrs(setPre); //Update } }); - - getAttrs(['repeating_armeCaC_' + currentID + '_sournoise'], function(v) + + getAttrs(['repeating_armeCaC_' + currentID + '_sournoise'], function(v) { if(v['repeating_armeCaC_' + currentID + '_sournoise'] == "{{orfevrerie=[[@{dexterite}+@{dextOD}]]}} {{ASSournoiseL=Sournoise (Orfevrerie)}}") { @@ -1882,8 +1882,8 @@ on("sheet:opened",function() setAttrs(setPre); //Update } }); - - getAttrs(['repeating_armeCaC_' + currentID + '_surmesure'], function(v) + + getAttrs(['repeating_armeCaC_' + currentID + '_surmesure'], function(v) { if(v['repeating_armeCaC_' + currentID + '_surmesure'] == "{{ASSurMesureD=[[@{combat}+@{combOD}]]}} {{ASSurMesureWOD=[[@{combat}]]}} {{ASSurMesureL=Sur Mesure}}") { @@ -1893,10 +1893,10 @@ on("sheet:opened",function() }); }); }); - + versioning += 1; } - + if(MAJW2 == 1 || version > 8) versioning += 1; else @@ -1907,7 +1907,7 @@ on("sheet:opened",function() var mode = values.warriorScoutA; var W250PG = values.warrior250PG; var nBonus = 0; - + if(armure == "warrior") { if(mode != "0") @@ -1919,48 +1919,48 @@ on("sheet:opened",function() } } } - + setAttrs({ calODDis: Number(values.discrOD)+nBonus, calODDex: Number(values.dextOD)+nBonus, calODPer: Number(values.percOD)+nBonus }); }); - + getAttrs(["auraOD", "paroleOD", "sfOD", "armure", "warriorHeraldA", "warrior250PG"], function(values) { var armure = values.armure; var mode = values.warriorHeraldA; var W250PG = values.warrior250PG; var nBonus = 0; - + if(armure == "warrior") { if(mode != "0") { nBonus += 1; - + if(W250PG != "0") { nBonus += 1; } } } - + setAttrs({ calODAur: Number(values.auraOD)+nBonus, calODPar: Number(values.paroleOD)+nBonus, calODSFR: Number(values.sfOD)+nBonus }); }); - + getAttrs(["tirOD", "savoirOD", "technOD", "armure", "warriorScholarA", "warrior250PG"], function(values) { var armure = values.armure; var mode = values.warriorScholarA; var W250PG = values.warrior250PG; var nBonus = 0; - + if(armure == "warrior") { if(mode != "0") @@ -1972,21 +1972,21 @@ on("sheet:opened",function() } } } - + setAttrs({ calODTir: Number(values.tirOD)+nBonus, calODSav: Number(values.savoirOD)+nBonus, calODTec: Number(values.technOD)+nBonus }); }); - + getAttrs(["hargneOD", "combOD", "instOD", "armure", "warriorHunterA", "warrior250PG"], function(values) { var armure = values.armure; var mode = values.warriorHunterA; var W250PG = values.warrior250PG; var nBonus = 0; - + if(armure == "warrior") { if(mode != "0") @@ -1998,21 +1998,21 @@ on("sheet:opened",function() } } } - + setAttrs({ calODHar: Number(values.hargneOD)+nBonus, calODCom: Number(values.combOD)+nBonus, calODIns: Number(values.instOD)+nBonus }); }); - + getAttrs(["deplOD", "forOD", "endOD", "armure", "warriorSoldierA", "warrior250PG"], function(values) { var armure = values.armure; var mode = values.warriorSoldierA; var W250PG = values.warrior250PG; var nBonus = 0; - + if(armure == "warrior") { if(mode != "0") @@ -2024,17 +2024,17 @@ on("sheet:opened",function() } } } - + setAttrs({ calODDep: Number(values.deplOD)+nBonus, calODFor: Number(values.forOD)+nBonus, calODEnd: Number(values.endOD)+nBonus }); }); - + versioning += 1; } - + if(MAJNS == 1 || version > 9) versioning += 1; else @@ -2056,39 +2056,39 @@ on("sheet:opened",function() }); } }); - + versioning += 1; } - + if(MAJL1 == 1 || version > 10) versioning += 1; else { - getSectionIDs("repeating_armeAutre", function (ids) + getSectionIDs("repeating_armeAutre", function (ids) { - _.each(ids,function(id) + _.each(ids,function(id) { - getAttrs(["repeating_armeAutre_"+id+"_chambreDouble"], function (v) + getAttrs(["repeating_armeAutre_"+id+"_chambreDouble"], function (v) { var CD = v["repeating_armeAutre_"+id+"_chambreDouble"]; - + if(CD == "?{Chambre Double|Cadence, 1|Dégâts, 2|Violence, 3}") { setAttrs({["repeating_armeAutre_"+id+"_chambreDouble"]: "[[?{Plusieurs cibles ?|Oui, 3.5|Non, 0.5}]]"}); } - + }); }); }); - - getSectionIDs("repeating_armeDist", function (ids) + + getSectionIDs("repeating_armeDist", function (ids) { - _.each(ids,function(id) + _.each(ids,function(id) { - getAttrs(["repeating_armeDist_"+id+"_chambreDouble"], function (v) + getAttrs(["repeating_armeDist_"+id+"_chambreDouble"], function (v) { var CD = v["repeating_armeDist_"+id+"_chambreDouble"]; - + if(CD == "?{Chambre Double|Cadence, 1|Dégâts, 2|Violence, 3}") { setAttrs({["repeating_armeDist_"+id+"_chambreDouble"]: "[[?{Plusieurs cibles ?|Oui, 3.5|Non, 0.5}]]"}); @@ -2096,15 +2096,15 @@ on("sheet:opened",function() }); }); }); - - getSectionIDs("repeating_armeDruidLion", function (ids) + + getSectionIDs("repeating_armeDruidLion", function (ids) { - _.each(ids,function(id) + _.each(ids,function(id) { - getAttrs(["repeating_armeDruidLion_"+id+"_chambreDouble"], function (v) + getAttrs(["repeating_armeDruidLion_"+id+"_chambreDouble"], function (v) { var CD = v["repeating_armeDruidLion_"+id+"_chambreDouble"]; - + if(CD == "?{Chambre Double|Cadence, 1|Dégâts, 2|Violence, 3}") { setAttrs({["repeating_armeDruidLion_"+id+"_chambreDouble"]: "[[?{Plusieurs cibles ?|Oui, 3.5|Non, 0.5}]]"}); @@ -2112,34 +2112,34 @@ on("sheet:opened",function() }); }); }); - + versioning += 1; } - + if(MAJL2 == 1 || version > 11) versioning += 1; else { - getSectionIDs("repeating_armeAutre", function (ids) + getSectionIDs("repeating_armeAutre", function (ids) { - _.each(ids,function(id) + _.each(ids,function(id) { getAttrs([ - "repeating_armeAutre_"+id+"_interfaceGuidage", - "repeating_armeAutre_"+id+"_tirSecurite", + "repeating_armeAutre_"+id+"_interfaceGuidage", + "repeating_armeAutre_"+id+"_tirSecurite", "repeating_armeAutre_"+id+"_akimbo", - "repeating_armeAutre_"+id+"_ambidextrie"], function (v) + "repeating_armeAutre_"+id+"_ambidextrie"], function (v) { var IG = v["repeating_armeAutre_"+id+"_interfaceGuidage"]; var TS = v["repeating_armeAutre_"+id+"_tirSecurite"]; var Ak = v["repeating_armeAutre_"+id+"_akimbo"]; var Am = v["repeating_armeAutre_"+id+"_ambidextrie"]; - + if(IG == "{{Interface de guidage (Tir en Sécurité)}}") { setAttrs({["repeating_armeAutre_"+id+"_interfaceGuidage"]: "3"}); } - + if(TS == "{{tirSecurite=[[{3d6cs2cs4cs6cf1cf3cf5s%2}=0]]}}") { setAttrs({["repeating_armeAutre_"+id+"_tirSecurite"]: "3"}); @@ -2149,46 +2149,46 @@ on("sheet:opened",function() { setAttrs({["repeating_armeAutre_"+id+"_akimbo"]: "2"}); } - + if(Am == "{{effetAmbidextrie=[[{2d6cs2cs4cs6cf1cf3cf5s%2}=0]]}}") { setAttrs({["repeating_armeAutre_"+id+"_ambidextrie"]: "2"}); } }); - + }); }); - - getSectionIDs("repeating_armeDist", function (ids) + + getSectionIDs("repeating_armeDist", function (ids) { - _.each(ids,function(id) + _.each(ids,function(id) { getAttrs([ "repeating_armeDist_"+id+"_interfaceGuidage", "repeating_armeDist_"+id+"_tirSecurite", "repeating_armeDist_"+id+"_akimbo", - "repeating_armeDist_"+id+"_ambidextrie"], function (v) + "repeating_armeDist_"+id+"_ambidextrie"], function (v) { var IG = v["repeating_armeDist_"+id+"_interfaceGuidage"]; var TS = v["repeating_armeDist_"+id+"_tirSecurite"]; var Ak = v["repeating_armeDist_"+id+"_akimbo"]; var Am = v["repeating_armeDist_"+id+"_ambidextrie"]; - + if(IG == "{{Interface de guidage (Tir en Sécurité)}}") { setAttrs({["repeating_armeDist_"+id+"_interfaceGuidage"]: "3"}); } - + if(TS == "{{tirSecurite=[[{3d6cs2cs4cs6cf1cf3cf5s%2}=0]]}}") { setAttrs({["repeating_armeDist_"+id+"_tirSecurite"]: "3"}); } - + if(Ak == "{{effetAkimbo=[[{2d6cs2cs4cs6cf1cf3cf5s%2}=0]]}}") { setAttrs({["repeating_armeDist_"+id+"_akimbo"]: "2"}); } - + if(Am == "{{effetAmbidextrie=[[{2d6cs2cs4cs6cf1cf3cf5s%2}=0]]}}") { setAttrs({["repeating_armeDist_"+id+"_ambidextrie"]: "2"}); @@ -2196,18 +2196,18 @@ on("sheet:opened",function() }); }); }); - - getSectionIDs("repeating_armeCaC", function (ids) + + getSectionIDs("repeating_armeCaC", function (ids) { - _.each(ids,function(id) - { + _.each(ids,function(id) + { getAttrs([ "repeating_armeCaC_"+id+"_tirSecurite", "repeating_armeCaC_"+id+"_akimbo", "repeating_armeCaC_"+id+"_ambidextrie", "repeating_armeCaC_"+id+"_jumelle", "repeating_armeCaC_"+id+"_soeur", - "repeating_armeCaC_"+id+"_protectrice"], function (v) + "repeating_armeCaC_"+id+"_protectrice"], function (v) { var TS = v["repeating_armeCaC_"+id+"_tirSecurite"]; var Ak = v["repeating_armeCaC_"+id+"_akimbo"]; @@ -2215,7 +2215,7 @@ on("sheet:opened",function() var Ju = v["repeating_armeCaC_"+id+"_jumelle"]; var So = v["repeating_armeCaC_"+id+"_soeur"]; var Pr = v["repeating_armeCaC_"+id+"_protectrice"]; - + if(Ak == "{{effetAkimbo=[[{2d6cs2cs4cs6cf1cf3cf5s%2}=0]]}}") { setAttrs({["repeating_armeCaC_"+id+"_akimbo"]: "2"}); @@ -2225,46 +2225,46 @@ on("sheet:opened",function() { setAttrs({["repeating_armeCaC_"+id+"_ambidextrie"]: "2"}); } - + if(TS == "{{tirSecurite=[[{3d6cs2cs4cs6cf1cf3cf5s%2}=0]]}}") { setAttrs({["repeating_armeCaC_"+id+"_tirSecurite"]: "3"}); } - + if(Ju == "{{effetAkimbo=[[{2d6cs2cs4cs6cf1cf3cf5s%2}=0]]}} {{ASJumelleL=Jumelle (Jumelée - Akimbo)}}") { setAttrs({["repeating_armeCaC_"+id+"_jumelle"]: "2"}); } - + if(So == "{{effetAmbidextrie=[[{2d6cs2cs4cs6cf1cf3cf5s%2}=0]]}} {{ASSoeurL=Soeur (Jumelée - Ambidextrie)}}") { setAttrs({["repeating_armeCaC_"+id+"_soeur"]: "2"}); } - + if(Pr == "{{ASProtectrice=[[{2d6cs2cs4cs6cf1cf3cf5s%2}=0]]}} {{ASProtectriceL=Protectrice}}") { setAttrs({["repeating_armeCaC_"+id+"_protectrice"]: "2"}); } - + }); }); }); - - getSectionIDs("repeating_armeDruidLion", function (ids) + + getSectionIDs("repeating_armeDruidLion", function (ids) { - _.each(ids,function(id) + _.each(ids,function(id) { getAttrs([ "repeating_armeDruidLion_"+id+"_interfaceGuidage", "repeating_armeDruidLion_"+id+"_tirSecurite", "repeating_armeDruidLion_"+id+"_akimbo", - "repeating_armeDruidLion_"+id+"_ambidextrie"], function (v) + "repeating_armeDruidLion_"+id+"_ambidextrie"], function (v) { var IG = v["repeating_armeDruidLion_"+id+"_interfaceGuidage"]; var TS = v["repeating_armeDruidLion_"+id+"_tirSecurite"]; var Ak = v["repeating_armeDruidLion_"+id+"_akimbo"]; var Am = v["repeating_armeDruidLion_"+id+"_ambidextrie"]; - + if(IG == "{{Interface de guidage (Tir en Sécurité)}}") { setAttrs({["repeating_armeDruidLion_"+id+"_interfaceGuidage"]: "3"}); @@ -2287,10 +2287,10 @@ on("sheet:opened",function() }); }); }); - + versioning += 1; } - + if(MAJL3 == 1 || version > 12) versioning += 1; else @@ -2305,103 +2305,103 @@ on("sheet:opened",function() warmaster250PG:10 }); } - + }); - + versioning += 1; } - + if(MAJBF == 1 || version > 13) versioning += 1; else { - getSectionIDs("repeating_armeDruidLion", function (ids) + getSectionIDs("repeating_armeDruidLion", function (ids) { - _.each(ids,function(id) + _.each(ids,function(id) { - getAttrs(["repeating_armeDruidLion_"+id+"_leste"], function (v) + getAttrs(["repeating_armeDruidLion_"+id+"_leste"], function (v) { var LL = v["repeating_armeDruidLion_"+id+"_leste"]; - + if(LL == "{{leste=[[@{force}]]}}") { setAttrs({["repeating_armeDruidLion_"+id+"_leste"]: "{{leste=[[@{druidLionChairTot}]]}}"}); } }); - + }); }); - + versioning += 1; } - + var newSheet = 0; - - getSectionIDs("repeating_slotsTete", function(idarray1) + + getSectionIDs("repeating_slotsTete", function(idarray1) { if(idarray1.length == 0) newSheet += 1; - - getSectionIDs("repeating_slotsTorse", function(idarray2) + + getSectionIDs("repeating_slotsTorse", function(idarray2) { if(idarray2.length == 0) newSheet += 1; - - getSectionIDs("repeating_slotsBG", function(idarray3) + + getSectionIDs("repeating_slotsBG", function(idarray3) { if(idarray3.length == 0) newSheet += 1; - - getSectionIDs("repeating_slotsBD", function(idarray4) + + getSectionIDs("repeating_slotsBD", function(idarray4) { if(idarray4.length == 0) newSheet += 1; - - getSectionIDs("repeating_slotsJG", function(idarray5) + + getSectionIDs("repeating_slotsJG", function(idarray5) { if(idarray5.length == 0) newSheet += 1; - - getSectionIDs("repeating_slotsJD", function(idarray6) + + getSectionIDs("repeating_slotsJD", function(idarray6) { if(idarray6.length == 0) newSheet += 1; - - getSectionIDs("repeating_slotsDCLTete", function(idarray7) + + getSectionIDs("repeating_slotsDCLTete", function(idarray7) { if(idarray7.length == 0) newSheet += 1; - - getSectionIDs("repeating_slotsDCLTorse", function(idarray8) - { + + getSectionIDs("repeating_slotsDCLTorse", function(idarray8) + { if(idarray8.length == 0) newSheet += 1; - - getSectionIDs("repeating_slotsDCLBG", function(idarray9) - { + + getSectionIDs("repeating_slotsDCLBG", function(idarray9) + { if(idarray9.length == 0) newSheet += 1; - - getSectionIDs("repeating_slotsDCLBD", function(idarray10) - { + + getSectionIDs("repeating_slotsDCLBD", function(idarray10) + { if(idarray10.length == 0) newSheet += 1; - - getSectionIDs("repeating_slotsDCLJG", function(idarray11) - { + + getSectionIDs("repeating_slotsDCLJG", function(idarray11) + { if(idarray11.length == 0) newSheet += 1; - - getSectionIDs("repeating_slotsDCLJD", function(idarray12) - { + + getSectionIDs("repeating_slotsDCLJD", function(idarray12) + { if(idarray12.length == 0) newSheet += 1; - + if(newSheet == 12) { versioning += 1; } - + setAttrs({ version: versioning }); @@ -2419,7 +2419,7 @@ on("sheet:opened",function() }); }); } - + if(version < 16) { setAttrs({["pSDistPortee"]: "^{portee-moyenne}"}); @@ -2427,16 +2427,16 @@ on("sheet:opened",function() setAttrs({["pSCaCPortee"]: "^{portee-contact}"}); setAttrs({["mECaCPortee"]: "^{portee-contact}"}); setAttrs({["druidLionBasePortee"]: "^{portee-contact}"}); - + var majDistance = ["repeating_armeDruidLion", "repeating_armeCaC", "repeating_armeDist", "repeating_armeAutre", "repeating_armeDistVehicule"]; - _.each(majDistance,function(listDistance) + _.each(majDistance,function(listDistance) { - getSectionIDs(listDistance, function(idarray) + getSectionIDs(listDistance, function(idarray) { - _.each(idarray,function(id) + _.each(idarray,function(id) { - getAttrs([listDistance+"_"+id+"_armeCaCPortee", listDistance+"_"+id+"_armeDistPortee", listDistance+"_"+id+"_armeAutrePortee", listDistance+"_"+id+"_porteeDruidLion", listDistance+"_"+id+"_"+"barrage", listDistance+"_"+id+"_"+"chargeur", listDistance+"_"+id+"_"+"choc", listDistance+"_"+id+"_"+"defense", listDistance+"_"+id+"_"+"degatContinue", listDistance+"_"+id+"_"+"dispersion", listDistance+"_"+id+"_"+"lumiere", listDistance+"_"+id+"_"+"perceArmure", listDistance+"_"+id+"_"+"parasitage", listDistance+"_"+id+"_"+"penetrant", listDistance+"_"+id+"_"+"reaction", listDistance+"_"+id+"_"+"jumelage", listDistance+"_"+id+"_"+"lourd"], function (v) + getAttrs([listDistance+"_"+id+"_armeCaCPortee", listDistance+"_"+id+"_armeDistPortee", listDistance+"_"+id+"_armeAutrePortee", listDistance+"_"+id+"_porteeDruidLion", listDistance+"_"+id+"_"+"barrage", listDistance+"_"+id+"_"+"chargeur", listDistance+"_"+id+"_"+"choc", listDistance+"_"+id+"_"+"defense", listDistance+"_"+id+"_"+"degatContinue", listDistance+"_"+id+"_"+"dispersion", listDistance+"_"+id+"_"+"lumiere", listDistance+"_"+id+"_"+"perceArmure", listDistance+"_"+id+"_"+"parasitage", listDistance+"_"+id+"_"+"penetrant", listDistance+"_"+id+"_"+"reaction", listDistance+"_"+id+"_"+"jumelage", listDistance+"_"+id+"_"+"lourd"], function (v) { var barrage = v[listDistance+"_"+id+"_"+"barrage"]; var chargeur = v[listDistance+"_"+id+"_"+"chargeur"]; @@ -2451,165 +2451,165 @@ on("sheet:opened",function() var reaction = v[listDistance+"_"+id+"_"+"reaction"]; var jumelage = v[listDistance+"_"+id+"_"+"jumelage"]; var lourd = v[listDistance+"_"+id+"_"+"lourd"]; - + if(barrage == "{{barrage=Barrage @{barrageValue}}} ") setAttrs({[listDistance+"_"+id+"_"+"barrage"]: "{{barrage=^{barrage} @{barrageValue}}} "}); - + if(chargeur == "{{chargeur=Chargeur @{chargeurValue}}} ") setAttrs({[listDistance+"_"+id+"_"+"chargeur"]: "{{chargeur=^{chargeur} @{chargeurValue}}} "}); - + if(choc == "{{choc=Choc @{chocValue}}}") setAttrs({[listDistance+"_"+id+"_"+"choc"]: "{{choc=^{choc} @{chocValue}}}"}); - + if(defense == "{{defense=Défense @{defenseValue}}}") setAttrs({[listDistance+"_"+id+"_"+"defense"]: "{{defense=^{defense} @{defenseValue}}}"}); - + if(degatContinue == "{{degatContinus=Dégâts Continus @{degatContinueValue} ([[1D6]] ^{tours})}}") setAttrs({[listDistance+"_"+id+"_"+"degatContinue"]: "{{degatContinus=^{degats-continus} @{degatContinueValue} ([[1D6]] ^{tours})}}"}); - + if(dispersion == "{{dispersion=Dispersion @{dispersionValue}}} ") setAttrs({[listDistance+"_"+id+"_"+"dispersion"]: "{{dispersion=^{dispersion} @{dispersionValue}}} "}); - + if(lumiere == "{{lumiere=Lumière @{lumiereValue}}}") setAttrs({[listDistance+"_"+id+"_"+"lumiere"]: "{{lumiere=^{lumiere} @{lumiereValue}}}"}); - + if(parasitage == "{{parasitage=Parasitage @{parasitageValue}}}") setAttrs({[listDistance+"_"+id+"_"+"parasitage"]: "{{parasitage=^{parasitage} @{parasitageValue}}}"}); - + if(penetrant == "{{penetrant=Pénétrant @{penetrantValue}}}") setAttrs({[listDistance+"_"+id+"_"+"penetrant"]: "{{penetrant=^{penetrant} @{penetrantValue}}}"}); - + if(pa == "{{perceArmure=Perce Armure @{perceArmureValue}}}") setAttrs({[listDistance+"_"+id+"_"+"perceArmure"]: "{{perceArmure=^{perce-armure} @{perceArmureValue}}}"}); - + if(reaction == "{{reaction=Réaction @{reactionValue}}}") setAttrs({[listDistance+"_"+id+"_"+"reaction"]: "{{reaction=^{reaction} @{reactionValue}}}"}); - + if(jumelage == "{{jumelage=Jumelage (@{jumelageValue})}}") setAttrs({[listDistance+"_"+id+"_"+"jumelage"]: "{{jumelage=^{jumelage} (@{jumelageValue})}}"}); - + if(lourd == "{{lourd=Lourd}}") setAttrs({[listDistance+"_"+id+"_"+"lourd"]: "1"}); - + var porteeAutre = v[listDistance+"_"+id+"_armeAutrePortee"]; - + if(porteeAutre == "Contact") { setAttrs({[listDistance+"_"+id+"_armeAutrePortee"]: "^{portee-contact}"}); } - + if(porteeAutre == "Courte") { setAttrs({[listDistance+"_"+id+"_armeAutrePortee"]: "^{portee-courte}"}); } - + if(porteeAutre == "Moyenne") { setAttrs({[listDistance+"_"+id+"_armeAutrePortee"]: "^{portee-moyenne}"}); } - + if(porteeAutre == "Longue") { setAttrs({[listDistance+"_"+id+"_armeAutrePortee"]: "^{portee-longue}"}); } - + if(porteeAutre == "Lointaine") { setAttrs({[listDistance+"_"+id+"_armeAutrePortee"]: "^{portee-lointaine}"}); - } - + } + var porteeCaC = v[listDistance+"_"+id+"_armeCaCPortee"]; - + if(porteeCaC == "Contact") { setAttrs({[listDistance+"_"+id+"_armeCaCPortee"]: "^{portee-contact}"}); } - + if(porteeCaC == "Courte") { setAttrs({[listDistance+"_"+id+"_armeCaCPortee"]: "^{portee-courte}"}); } - + if(porteeCaC == "Moyenne") { setAttrs({[listDistance+"_"+id+"_armeCaCPortee"]: "^{portee-moyenne}"}); } - + if(porteeCaC == "Longue") { setAttrs({[listDistance+"_"+id+"_armeCaCPortee"]: "^{portee-longue}"}); } - + if(porteeCaC == "Lointaine") { setAttrs({[listDistance+"_"+id+"_armeCaCPortee"]: "^{portee-lointaine}"}); } - + var portee = v[listDistance+"_"+id+"_armeDistPortee"]; - + if(portee == "Contact") { setAttrs({[listDistance+"_"+id+"_armeDistPortee"]: "^{portee-contact}"}); } - + if(portee == "Courte") { setAttrs({[listDistance+"_"+id+"_armeDistPortee"]: "^{portee-courte}"}); } - + if(portee == "Moyenne") { setAttrs({[listDistance+"_"+id+"_armeDistPortee"]: "^{portee-moyenne}"}); } - + if(portee == "Longue") { setAttrs({[listDistance+"_"+id+"_armeDistPortee"]: "^{portee-longue}"}); } - + if(portee == "Lointaine") { setAttrs({[listDistance+"_"+id+"_armeDistPortee"]: "^{portee-lointaine}"}); } - + var pDruid = v[listDistance+"_"+id+"_porteeDruidLion"]; - + if(pDruid == "Contact") { setAttrs({[listDistance+"_"+id+"_porteeDruidLion"]: "^{portee-contact}"}); } - + if(pDruid == "Courte") { setAttrs({[listDistance+"_"+id+"_porteeDruidLion"]: "^{portee-courte}"}); } - + if(pDruid == "Moyenne") { setAttrs({[listDistance+"_"+id+"_porteeDruidLion"]: "^{portee-moyenne}"}); } - + if(pDruid == "Longue") { setAttrs({[listDistance+"_"+id+"_porteeDruidLion"]: "^{portee-longue}"}); } - + if(pDruid == "Lointaine") { setAttrs({[listDistance+"_"+id+"_porteeDruidLion"]: "^{portee-lointaine}"}); } }); - + }); }); }); - + var majSimple = ["pS", "pSC", "mE","mEC"]; - - _.each(majSimple,function(listDistanceSimple) + + _.each(majSimple,function(listDistanceSimple) { - getAttrs([listDistanceSimple+"barrage", listDistanceSimple+"chargeur", listDistanceSimple+"choc", listDistanceSimple+"defense", listDistanceSimple+"degatContinue", listDistanceSimple+"dispersion", listDistanceSimple+"lumiere", listDistanceSimple+"parasitage", listDistanceSimple+"penetrant", listDistanceSimple+"perceArmure", listDistanceSimple+"reaction", listDistanceSimple+"jumelage", listDistanceSimple+"lourd"], function (v) - { + getAttrs([listDistanceSimple+"barrage", listDistanceSimple+"chargeur", listDistanceSimple+"choc", listDistanceSimple+"defense", listDistanceSimple+"degatContinue", listDistanceSimple+"dispersion", listDistanceSimple+"lumiere", listDistanceSimple+"parasitage", listDistanceSimple+"penetrant", listDistanceSimple+"perceArmure", listDistanceSimple+"reaction", listDistanceSimple+"jumelage", listDistanceSimple+"lourd"], function (v) + { var barrage = v[listDistanceSimple+"barrage"]; var chargeur = v[listDistanceSimple+"chargeur"]; var choc = v[listDistanceSimple+"choc"]; @@ -2623,50 +2623,50 @@ on("sheet:opened",function() var reaction = v[listDistanceSimple+"reaction"]; var jumelage = v[listDistanceSimple+"jumelage"]; var lourd = v[listDistanceSimple+"lourd"]; - + if(barrage == "{{barrage=Barrage @{"+listDistanceSimple+"barrageValue}}} ") setAttrs({[listDistanceSimple+"barrage"]: "{{barrage=^{barrage} @{"+listDistanceSimple+"barrageValue}}} "}); - + if(chargeur == "{{chargeur=Chargeur @{"+listDistanceSimple+"chargeurValue}}} ") setAttrs({[listDistanceSimple+"chargeur"]: "{{chargeur=^{chargeur} @{"+listDistanceSimple+"chargeurValue}}} "}); - + if(choc == "{{choc=Choc @{"+listDistanceSimple+"chocValue}}}") setAttrs({[listDistanceSimple+"choc"]: "{{choc=^{choc} @{"+listDistanceSimple+"chocValue}}}"}); - + if(defense == "{{defense=Défense @{"+listDistanceSimple+"defenseValue}}}") setAttrs({[listDistanceSimple+"defense"]: "{{defense=^{defense} @{"+listDistanceSimple+"defenseValue}}}"}); - + if(degatContinue == "{{degatContinus=Dégâts Continus @{"+listDistanceSimple+"degatContinueValue} ([[1D6]] Tours)}}") setAttrs({[listDistanceSimple+"degatContinue"]: "{{degatContinus=^{degats-continus} @{"+listDistanceSimple+"degatContinueValue} ([[1D6]] ^{tours})}}"}); - + if(dispersion == "{{dispersion=Dispersion @{"+listDistanceSimple+"dispersionValue}}} ") setAttrs({[listDistanceSimple+"dispersion"]: "{{dispersion=^{dispersion} @{"+listDistanceSimple+"dispersionValue}}} "}); - + if(lumiere == "{{lumiere=Lumière @{"+listDistanceSimple+"lumiereValue}}}") setAttrs({[listDistanceSimple+"lumiere"]: "{{lumiere=^{lumiere} @{"+listDistanceSimple+"lumiereValue}}}"}); - + if(parasitage == "{{parasitage=Parasitage @{"+listDistanceSimple+"parasitageValue}}}") setAttrs({[listDistanceSimple+"parasitage"]: "{{parasitage=^{parasitage} @{"+listDistanceSimple+"parasitageValue}}}"}); - + if(penetrant == "{{penetrant=Pénétrant @{"+listDistanceSimple+"penetrantValue}}}") setAttrs({[listDistanceSimple+"penetrant"]: "{{penetrant=^{penetrant} @{"+listDistanceSimple+"penetrantValue}}}"}); - + if(pa == "{{perceArmure=Perce Armure @{"+listDistanceSimple+"perceArmureValue}}}") setAttrs({[listDistanceSimple+"perceArmure"]: "{{perceArmure=^{perce-armure} @{"+listDistanceSimple+"perceArmureValue}}}"}); - + if(reaction == "{{reaction=Réaction @{"+listDistanceSimple+"reactionValue}}}") setAttrs({[listDistanceSimple+"reaction"]: "{{reaction=^{reaction} @{"+listDistanceSimple+"reactionValue}}}"}); - + if(jumelage == "{{jumelage=Jumelage (@{"+listDistanceSimple+"jumelageValue})}}") setAttrs({[listDistanceSimple+"jumelage"]: "{{jumelage=^{jumelage} (@{"+listDistanceSimple+"jumelageValue})}}"}); - + if(lourd == "{{lourd=Lourd}}") setAttrs({[listDistanceSimple+"lourd"]: "1"}); }); }); - - getAttrs(["rangerArmePortee", "rangerChoc", "rangerDegatContinue", "rangerPerceArmure", "rangerDispersion", "rangerLumiere", "rangerPenetrant", "rangerPerceArmure60", "rangerPenetrant10", "rangerPenetrant10", "ranger50PG3"], function (v) - { + + getAttrs(["rangerArmePortee", "rangerChoc", "rangerDegatContinue", "rangerPerceArmure", "rangerDispersion", "rangerLumiere", "rangerPenetrant", "rangerPerceArmure60", "rangerPenetrant10", "rangerPenetrant10", "ranger50PG3"], function (v) + { var rangerChoc = v["rangerChoc"]; var degatsContinus = v["rangerDegatContinue"]; var pa = v["rangerPerceArmure"]; @@ -2676,52 +2676,52 @@ on("sheet:opened",function() var pa60 = v["rangerPerceArmure60"]; var penetrant10 = v["rangerPenetrant10"]; var PG = v["ranger50PG3"]; - + if(rangerChoc == "{{choc=Choc @{rangerChocValue}}}") setAttrs({["rangerChoc"]: "{{choc=^{choc} @{rangerChocValue}}}"}); - + if(degatsContinus == "{{degatContinus=Dégâts Continus @{rangerDegatContinueValue} ([[1D6]] ^{tours})}}") setAttrs({["rangerDegatContinue"]: "{{degatContinus=^{degats-continus} @{rangerDegatContinueValue} ([[1D6]] ^{tours})}}"}); - + if(pa == "{{perceArmure=Perce Armure @{rangerPerceArmureValue}}}") setAttrs({["rangerPerceArmure"]: "{{perceArmure=^{perce-armure} @{rangerPerceArmureValue}}}"}); - + if(dispersion == "{{dispersion=Dispersion @{rangerDispersionValue}}}") setAttrs({["rangerDispersion"]: "{{dispersion=^{dispersion} @{rangerDispersionValue}}}"}); - + if(lumiere == "{{lumiere=Lumière @{rangerLumiereValue}}}") setAttrs({["rangerLumiere"]: "{{lumiere=^{lumiere} @{rangerLumiereValue}}}"}); - + if(penetrant == "{{penetrant=Pénétrant @{rangerPenetrantValue}}}") setAttrs({["rangerPenetrant"]: "{{penetrant=^{penetrant} @{rangerPenetrantValue}}}"}); - + if(pa60 == "{{perceArmure=Perce Armure @{rangerPerceArmure60Value}}}") setAttrs({["rangerPerceArmure60"]: "{{perceArmure=^{perce-armure} @{rangerPerceArmure60Value}}}"}); - + if(penetrant10 == "{{penetrant=Pénétrant @{rangerPenetrant10Value}}}") setAttrs({["rangerPenetrant10"]: "{{penetrant=^{penetrant} @{rangerPenetrant10Value}}}"}); - + if(PG == "{{rangerEvol=50PG3}}") setAttrs({["ranger50PG3"]: "1"}); - + var portee = v["rangerArmePortee"]; - + if(portee == "Moyenne") { setAttrs({["rangerArmePortee"]: "^{portee-moyenne}"}); } - + if(portee == "Longue") { setAttrs({["rangerArmePortee"]: "^{portee-longue}"}); } - + if(portee == "Lointaine") { setAttrs({["rangerArmePortee"]: "^{portee-lointaine}"}); } }); - + setAttrs({["version"]: 16}); } @@ -2817,6 +2817,13 @@ on("sheet:opened",function() version:17, }); } + + if(version < 18) { + setAttrs({ + caracteristique1Ranger: "@{perception}", + version:18, + }); + } }); });/* eslint-disable no-plusplus */ /* eslint-disable prefer-destructuring */ @@ -21109,10 +21116,10 @@ on('clicked:distanceRangerLongbow', async (info) => { let attributs = [ 'pilonnageRanger', 'energiePJ', - 'caracteristique1Ranger', - 'caracteristique2Ranger', - 'caracteristique3Ranger', - 'caracteristique4Ranger', + 'caracteristique1Longbow', + 'caracteristique2Longbow', + 'caracteristique3Longbow', + 'caracteristique4Longbow', 'discretion', ODValue.discretion, ODValue.tir, @@ -21269,10 +21276,10 @@ on('clicked:distanceRangerLongbow', async (info) => { const mod = +attrs.jetModifDes; const hasBonus = +attrs.bonusCarac; - const C1 = attrs.caracteristique1Ranger; - const C2 = attrs.caracteristique2Ranger; - const C3 = attrs.caracteristique3Ranger; - const C4 = attrs.caracteristique4Ranger; + const C1 = attrs.caracteristique1Longbow; + const C2 = attrs.caracteristique2Longbow; + const C3 = attrs.caracteristique3Longbow; + const C4 = attrs.caracteristique4Longbow; const attrsCarac = await getCarac(hasBonus, C1, C2, C3, C4); @@ -28664,7 +28671,7 @@ on('clicked:rollVehicule', async (info) => {
Limite de taille à 10 mètres.
- +
Peut faire exploser son apparence ou ses faux-êtres lors de la désactivation.
- +
- +
Vague d'énergie :+2 en Parasitage / Salve d'énergie : +3 en Dispersion
Rayon d'énergie :Perce Armure devient Ignore Armure
- +
L'effet "lente et lourde" est annulé.
- +
Permet la création au choix : moto steed, stalion, maraudeur II, ou vector léger, pour 9PE et une durée de 1h (mode NanoC, au contact).
- +
Le Mode Puppet Master fonctionne contre les bandes sur un test base Aura. Flux non dépensés en cas d'échec. Le score de débordement actuel est infligé à tous les autres ennemis présents dans la scène. Un type d'ennemi par utilisation.
- +
Les effets coûtent 2PE de moins (sauf augmentation dégât / violence), minimum 1.
- +
Le mode Ghost ne se désactive pas lors des attaques du chevalier en cas de dépense de 3PE.
- +
Les totems peuvent maintenant agir de manière indépendante (toujours en suivant les ordres du chevalier) et sans limite de portée. Ils sont bien plus finement matérialisés et ressemblent trait pour trait à la méta-armure du chevalier. Ils peuvent aussi être matérialisés pour une scène entière ou une phase de conflit entière pour un coût total de 10 PE.
- +
En activant le mode Morph, le chevalier obtient les effets des 6 capacités en même temps.
- +
L’armure est mieux stabilisée en termes temporels. Dé- sormais, le personnage peut relancer son jet sur le tableau des paradoxes temporels et choisir entre les deux résultats.
- +
Le mode Falcon ne coûte que 3PE et ne nécessite aucune action. +10 PE sur le total.
- +
Les types offrent désormais 2 OD au lieu d'1.
- +
- +
@@ -33290,19 +33298,19 @@ on('clicked:rollVehicule', async (info) => {
- + - + - + - + - + @@ -33311,7 +33319,7 @@ on('clicked:rollVehicule', async (info) => {
Tête
- + / 8
@@ -33373,7 +33381,7 @@ on('clicked:rollVehicule', async (info) => {
- +
- +
- +
- +
- +
- +
- +
- +
Bête @@ -33617,7 +33625,7 @@ on('clicked:rollVehicule', async (info) => {
- +
@@ -33834,7 +33842,7 @@ on('clicked:rollVehicule', async (info) => { - +
Aspects @@ -33950,7 +33958,7 @@ on('clicked:rollVehicule', async (info) => {
- +

Labor

@@ -33971,7 +33979,7 @@ on('clicked:rollVehicule', async (info) => { Les actions du chevalier visant à porter de lourdes charges, à déplacer ou lever des poids reçoivent 3 dés par compagnon effectuant l’action de support. Chaque compagnon peut porter à lui seul 150 kg et peut donc transporter des choses pour le chevalier.
- +

Medik

@@ -33992,7 +34000,7 @@ on('clicked:rollVehicule', async (info) => { Les actions du chevalier visant à soigner, à faire des recherches biologiques ou à reconnaitre un élément médical ou biologique reçoivent 3 dés supplémentaire par compagnon effectuant un support. Si le chevalier soigne un allié, celui-ci récupère 2 PS supplémentaires par compagnon effectuant un support.
- +

Tech

@@ -34013,7 +34021,7 @@ on('clicked:rollVehicule', async (info) => { Les actions du chevalier visant à réparer un objet, un véhicule, un compagnon ou une méta-armure, à analyser un élément informatique ou électronique reçoivent 3 dés supplémentaire par compagnon effectuant un support. Le chevalier peut effectuer les réparations ou les analyses directement depuis un compagnon. Si le chevalier tente de réparer quelque chose (méta-armure, compagnon, véhicule) à l’aide de ses compagnons, les PA que la cible récupère sont augmentés de 3 par compagnon effectuant l’action de support.
- +

Fighter

@@ -34034,7 +34042,7 @@ on('clicked:rollVehicule', async (info) => { Les actions de combat du chevalier contre un ennemi désigné aux compagnons reçoivent 3 dés supplémentaire par compagnon effectuant un support. La cible du chevalier doit être à portée courte et doit pouvoir être attaquée au contact. Si ces deux conditions sont respectées, la cible reçoit automatiquement l’effet barrage 1 par compagnon (3 compagnons supportant le chevalier infligent ainsi l’effet barrage 3). De plus, les compagnons infligent à la cible 1D6 points de dégâts ou de violence chacun (sans bonus) sans devoir effectuer de jet de dés pour toucher. On considère cependant que lorsqu’ils effectuent cette action de support, leur défense tombe à 0. Une seule cible à la fois peut subir cette action de support.
- +

Recon

@@ -34070,15 +34078,15 @@ on('clicked:rollVehicule', async (info) => {
-
+
Bête
- -
+ +
Machine @@ -34108,10 +34116,10 @@ on('clicked:rollVehicule', async (info) => {

Valeurs Dérivées

- +
Défense - +
@@ -34135,7 +34143,7 @@ on('clicked:rollVehicule', async (info) => { Cohésion
- + /
@@ -34158,7 +34166,7 @@ on('clicked:rollVehicule', async (info) => {

Débordement

Tours de combat - +
@@ -34303,9 +34311,9 @@ on('clicked:rollVehicule', async (info) => {
-
+
Jet - @@ -34323,7 +34331,7 @@ on('clicked:rollVehicule', async (info) => { - @@ -34341,8 +34349,8 @@ on('clicked:rollVehicule', async (info) => { -
- +
+
- @@ -34381,7 +34389,7 @@ on('clicked:rollVehicule', async (info) => { - @@ -34411,98 +34419,98 @@ on('clicked:rollVehicule', async (info) => { - +
- +
- +
- + - + - +
- +
- + -
+ +
- +

Effets à 3PE

Effets à 1PE

- +
- + - +
- +
- +
- +
- +
- +
- +
- +
- +

Effets à 6PE

Effets à 4PE

@@ -34512,33 +34520,33 @@ on('clicked:rollVehicule', async (info) => { - + - + - + - + - +
- +
@@ -34547,7 +34555,7 @@ on('clicked:rollVehicule', async (info) => {
- +
@@ -35345,19 +35353,19 @@ on('clicked:rollVehicule', async (info) => {
- + - + - + - + - + @@ -35368,7 +35376,7 @@ on('clicked:rollVehicule', async (info) => { Tête
- + / 8
@@ -35377,7 +35385,7 @@ on('clicked:rollVehicule', async (info) => {
Torse
- + / 8
@@ -35434,12 +35442,12 @@ on('clicked:rollVehicule', async (info) => {
- + - +
@@ -35456,31 +35464,31 @@ on('clicked:rollVehicule', async (info) => { Tête - +
- +
- +
- +
- +