diff --git a/Empire_des_cerisiers/EdC.css b/Empire_des_cerisiers/EdC.css index 6c6b30b020..08bda85f8d 100644 --- a/Empire_des_cerisiers/EdC.css +++ b/Empire_des_cerisiers/EdC.css @@ -53,6 +53,7 @@ .sheet-info, .sheet-field, .sheet-stuff, +.sheet-magie, .sheet-advantage{ display: none; padding: 1.5em; @@ -92,7 +93,7 @@ } -.sheet-modal label span, .sheet-path [name='act_modaltrue'] { +.sheet-modal label span, .sheet-path [name='act_modaltrue'], .sheet-magie [name='act_modaltrue'] { background-color: transparent; color: black; transition : all 0.3s ease; @@ -111,7 +112,7 @@ display: none; } -.sheet-modal label input:checked ~ span, .sheet-path [name='act_modaltrue']:hover { +.sheet-modal label input:checked ~ span, .sheet-path [name='act_modaltrue']:hover, .sheet-magie [name='act_modaltrue']:hover { color: #db569b; border-color: #db569b; } @@ -151,6 +152,7 @@ .sheet-tabstoggle[value="path"] ~ div.sheet-path, .sheet-tabstoggle[value="info"] ~ div.sheet-info, .sheet-tabstoggle[value="field"] ~ div.sheet-field, +.sheet-tabstoggle[value="magie"] ~ div.sheet-magie, .sheet-tabstoggle[value="stuff"] ~ div.sheet-stuff, .sheet-tabstoggle[value="advantage"] ~ div.sheet-advantage { display: block; @@ -161,6 +163,7 @@ .sheet-tabstoggle[value="path"] ~ div [name=act_path], .sheet-tabstoggle[value="info"] ~ div [name=act_info], .sheet-tabstoggle[value="field"] ~ div [name=act_field], +.sheet-tabstoggle[value="magie"] ~ div [name=act_magie], .sheet-tabstoggle[value="stuff"] ~ div [name=act_stuff], .sheet-tabstoggle[value="advantage"] ~ div [name=act_advantage] { color: #db569b; @@ -172,6 +175,7 @@ .sheet-tabstoggle[value="path"] ~ div [name=act_path] span, .sheet-tabstoggle[value="info"] ~ div [name=act_info] span, .sheet-tabstoggle[value="field"] ~ div [name=act_field] span, +.sheet-tabstoggle[value="magie"] ~ div [name=act_magie] span, .sheet-tabstoggle[value="stuff"] ~ div [name=act_stuff] span, .sheet-tabstoggle[value="advantage"] ~ div [name=act_advantage] span { position: absolute; @@ -188,6 +192,7 @@ .sheet-tabstoggle[value="path"] ~ div [name=act_path] span:nth-child(1), .sheet-tabstoggle[value="info"] ~ div [name=act_info] span:nth-child(1), .sheet-tabstoggle[value="field"] ~ div [name=act_field] span:nth-child(1), +.sheet-tabstoggle[value="magie"] ~ div [name=act_magie] span:nth-child(1), .sheet-tabstoggle[value="stuff"] ~ div [name=act_stuff] span:nth-child(1), .sheet-tabstoggle[value="advantage"] ~ div [name=act_advantage] span:nth-child(1) { background-image: url('https://lh3.googleusercontent.com/pw/ACtC-3csmQHTvBiBqDJne8K2hlMKNFv-CLGVrqfwzvYbJBI47hVM5XVK_m1SZG-j2VT-xaAKQJefSsGgpwhNgUJ9DfFlUP9hdCyBRg00lRoPFdYu7Giva9lI2w7HBQbj1MvEhFIbFTGagxcYdtxlLfRKGg8t4Q=w48-h37-no?authuser=0'); @@ -200,6 +205,7 @@ .sheet-tabstoggle[value="path"] ~ div [name=act_path] span:nth-child(2), .sheet-tabstoggle[value="info"] ~ div [name=act_info] span:nth-child(2), .sheet-tabstoggle[value="field"] ~ div [name=act_field] span:nth-child(2), +.sheet-tabstoggle[value="magie"] ~ div [name=act_magie] span:nth-child(2), .sheet-tabstoggle[value="stuff"] ~ div [name=act_stuff] span:nth-child(2), .sheet-tabstoggle[value="advantage"] ~ div [name=act_advantage] span:nth-child(2) { background-image: url('https://lh3.googleusercontent.com/pw/ACtC-3dig12iVccXHjyBvw9EHpkd3LnUK53KDY8Nlvcl5L0a3GwuGyKiGHpTE6uOOfukKWPdZ_mW7fJ4VSX3QCDh8mVn8g1JwJTEH7Hw5i3P5Gjc1DfLQItGNkpCZFziCbFKK4Ed5tsPO8PapXsVgbUImpeRmQ=w58-h54-no?authuser=0'); @@ -212,6 +218,7 @@ .sheet-tabstoggle[value="path"] ~ div [name=act_path] span:nth-child(3), .sheet-tabstoggle[value="info"] ~ div [name=act_info] span:nth-child(3), .sheet-tabstoggle[value="field"] ~ div [name=act_field] span:nth-child(3), +.sheet-tabstoggle[value="magie"] ~ div [name=act_magie] span:nth-child(3), .sheet-tabstoggle[value="stuff"] ~ div [name=act_stuff] span:nth-child(3), .sheet-tabstoggle[value="advantage"] ~ div [name=act_advantage] span:nth-child(3) { background-image: url('https://lh3.googleusercontent.com/pw/ACtC-3ckNowHdOSTaSsBvuKhb55WlaUBETtUCjRNA8BKNGIdAU0eY0C66t2vozlTStWcVC4BFtnxanKF2fQM5WrhHT0E1pTcT83U12wZY1itkwe7A20yjVhNij02J4knXY2FXsbT_3W7mwligrK0puB4JoIFsg=w61-h43-no?authuser=0'); @@ -519,12 +526,12 @@ input { border-radius: 0; font-family: 'Architects Daughter', cursive; font-weight: 900; - font-size: 20px ; + font-size: 18px ; margin: 10px; margin-top: 1em; box-shadow : none; border : 1px solid black; - padding : 10px 20px; + padding : 10px 18px; cursor: pointer; } @@ -575,7 +582,7 @@ input { /*************************************************/ -.sheet-field, .sheet-path{ +.sheet-field, .sheet-path, .sheet-magie{ background-image: url('https://lh3.googleusercontent.com/pw/ACtC-3fTzjmZRH7haOXA72Cii5euWoOjmwJlg0VCo-uaRRpMBQ-UrMaP3Q2ed9bvMjUWThw9S4AFAEdlR0lhFbPN7BEV0ZAu4bZ_MgWSpjh8QjFer8YGxSRE7cdnF652mBz7HgQSN7j5pGj1RRVT-41KMrN9=w599-h937-no?authuser=0'); background-repeat: no-repeat; background-position: bottom left; @@ -718,11 +725,11 @@ input { margin: 1em auto; } -.sheet-techniques{ +.sheet-techniques, .sheet-magies{ text-align: center; } -.sheet-techniques .repitem{ +.sheet-techniques .repitem, .sheet-magies .repitem{ width: 49%; display: inline-block; max-width: 450px; @@ -772,7 +779,7 @@ input { background-color: white; background-image: url(https://imgsrv.roll20.net/?src=https%3A//lh3.googleusercontent.com/pw/ACtC-3cWAcftXDquAPtdF3BEzJaTgNCSRX5QWPPLLm52UHkA5UN527Wc7saEdL99mh0XFBLkoiruQvfih5z2qrj5LxdOhHv-4kx5riKEubxJ_s2kFvfSrZVnDRAITuuk5RA983UgRVQifIcvHLDP-tj4Sj_R%3Dw1153-h825-no%3Fauthuser%3D0); background-size: 150px; - background-position: 93% 5%; + background-position: 93% 9px; background-repeat: no-repeat; color: black; padding: 0 10px; diff --git a/Empire_des_cerisiers/EdC.html b/Empire_des_cerisiers/EdC.html index e41948e818..66afb91bd3 100644 --- a/Empire_des_cerisiers/EdC.html +++ b/Empire_des_cerisiers/EdC.html @@ -10,12 +10,17 @@

Nom :

-

Origines :

+

Origines :

-
-

Concept :

+
+

Concept :

+
+
+ XP : +
+
+
-
XP :
@@ -171,8 +176,9 @@ + - + @@ -366,9 +372,7 @@

Technique :

-
-
-
+

Aspect:

@@ -399,6 +403,76 @@
+
+
+
+

Magie

+
+ +
+ +
+
+ +
+
+
+

Nom :

+
+
+

Champ:

+
+
+ +
+
+ + + + +
+
+ +
+
+

Spécialisation:

+
+
+ +
+
+ + + + +
+
+ +
+
+

Bonus:

+
+ +

Majoration:

+
+ +
+ +
+
+
+
+
+
@@ -535,7 +609,7 @@
-

INFORMATIONS

+

Divers

@@ -596,6 +670,7 @@

{{note}}

{{/note}} +
{{content}} @@ -616,13 +691,13 @@
-
-

Calcul de Technique

-
+
+

Calcul de Technique ou Magie

+
-
+
@@ -773,7 +848,7 @@
- +
@@ -892,7 +967,7 @@ // TABS - const buttonlist = ["field","advantage","path", "info", "stuff"]; + const buttonlist = ["field","advantage","path", "info", "stuff", "magie"]; buttonlist.forEach(button => { on(`clicked:${button}`, function() { setAttrs({ @@ -988,77 +1063,76 @@ }); } - // TODO refacto - on("clicked:repeating_weapon:nextspeweapon", function(e){ - getAttrs(["repeating_weapon_fooindexspe","repeating_weapon_fooindexfield"], function(values){ - let speIndex = values["repeating_weapon_fooindexspe"]; - let fieldIndex = values["repeating_weapon_fooindexfield"]; - getSectionIDs("spec", function(idarray){ + function getPrevRepeatingCorrelatedValue(containingSectionName,changingIndexName,fixedIndexName,browsedSectionName) + { + getAttrs(["repeating_"+containingSectionName+"_"+changingIndexName,"repeating_"+containingSectionName+"_"+fixedIndexName], function(values){ + let speIndex = values["repeating_"+containingSectionName+"_"+changingIndexName]; + let fieldIndex = values["repeating_"+containingSectionName+"_"+fixedIndexName]; + getSectionIDs(browsedSectionName, function(idarray){ if(idarray.length==0)return; if(idarray.length>1){ var val = parseInt(speIndex,10); let correlation = fieldIndex; - getAttrs(idarray.map(elt=>"repeating_spec_"+elt+"_fooindexfield"),function(x){ + getAttrs(idarray.map(elt=>"repeating_"+browsedSectionName+"_"+elt+"_"+fixedIndexName),function(x){ + let length = idarray.length; + negX = negArray(idarray); + for(let i=length-1;i>=0;i--){ + var nIndex = speIndex-length+i; + if(x["repeating_"+browsedSectionName+"_"+negX[nIndex]+"_"+fixedIndexName]==correlation) + { + val = parseInt(nIndex,10); + break; + } + } + var setObj = {}; + setObj["repeating_"+containingSectionName+"_"+changingIndexName] = val<0?val+length:val; + setAttrs(setObj); + }); + } + else + { + var setObj = {}; + setObj["repeating_"+containingSectionName+"_"+changingIndexName] = 0; + setAttrs(setObj); + } + }); + }); + } + function getNextRepeatingCorrelatedValue(containingSectionName,changingIndexName,fixedIndexName,browsedSectionName){ + getAttrs(["repeating_"+containingSectionName+"_"+changingIndexName,"repeating_"+containingSectionName+"_"+fixedIndexName], function(values){ + let speIndex = values["repeating_"+containingSectionName+"_"+changingIndexName]; + let fieldIndex = values["repeating_"+containingSectionName+"_"+fixedIndexName]; + getSectionIDs(browsedSectionName, function(idarray){ + if(idarray.length==0)return; + if(idarray.length>1){ + var val = parseInt(speIndex,10); + let correlation = fieldIndex; + getAttrs(idarray.map(elt=>"repeating_"+browsedSectionName+"_"+elt+"_"+fixedIndexName),function(x){ let length = idarray.length; //negX = idarray;// negArray(idarray); for(let i=0;i=length) nIndex = speIndex-length+i+1; - if(x["repeating_spec_"+idarray[nIndex]+"_fooindexfield"]==correlation) + if(x["repeating_"+browsedSectionName+"_"+idarray[nIndex]+"_"+fixedIndexName]==correlation) { val = parseInt(nIndex,10); break; } } var setObj = {}; - setObj["repeating_weapon_fooindexspe"] = val; + setObj["repeating_"+containingSectionName+"_"+changingIndexName] = val; setAttrs(setObj); }); } else { var setObj = {}; - setObj["repeating_weapon_fooindexspe"] = 0; + setObj["repeating_"+containingSectionName+"_"+changingIndexName] = 0; setAttrs(setObj); } }); }); - }); - on("clicked:repeating_weapon:prevspeweapon", function(e){ - getAttrs(["repeating_weapon_fooindexspe","repeating_weapon_fooindexfield"], function(values){ - let speIndex = values["repeating_weapon_fooindexspe"]; - let fieldIndex = values["repeating_weapon_fooindexfield"]; - getSectionIDs("spec", function(idarray){ - if(idarray.length==0)return; - if(idarray.length>1){ - var val = parseInt(speIndex,10); - let correlation = fieldIndex; - getAttrs(idarray.map(elt=>"repeating_spec_"+elt+"_fooindexfield"),function(x){ - let length = idarray.length; - negX = negArray(idarray); - for(let i=length-1;i>=0;i--){ - var nIndex = speIndex-length+i; - if(x["repeating_spec_"+negX[nIndex]+"_fooindexfield"]==correlation) - { - val = parseInt(nIndex,10); - break; - } - } - var setObj = {}; - setObj["repeating_weapon_fooindexspe"] = val<0?val+length:val; - setAttrs(setObj); - }); - } - else - { - var setObj = {}; - setObj["repeating_weapon_fooindexspe"] = 0; - setAttrs(setObj); - } - }); - }); - }); - // END TODO refacto + } function getPrevRepeatingValue(targetRepeatingIndexName, sourceRepeatingName) { @@ -1097,16 +1171,32 @@ }); } + + on("clicked:repeating_weapon:nextspeweapon", function(e){ + getNextRepeatingCorrelatedValue("weapon","fooindexspe","fooindexfield","spec"); + }); + on("clicked:repeating_weapon:prevspeweapon", function(e){ + getPrevRepeatingCorrelatedValue("weapon","fooindexspe","fooindexfield","spec"); + }); + on("clicked:repeating_magic:nextspemagic", function(e){ + getNextRepeatingCorrelatedValue("magic","fooindexspe","fooindexfield","spec"); + }); + on("clicked:repeating_magic:prevspemagic", function(e){ + getPrevRepeatingCorrelatedValue("magic","fooindexspe","fooindexfield","spec"); + }); + on("change:repeating_field:fieldname", function(e){ let changedID = e.sourceAttribute.split('_')[2]; updateRepeatingRelatedAttrFromRepeating("field", "spec", "fooindexfield", changedID, "foospecassociatedfield", e.newValue); updateRepeatingRelatedAttrFromRepeating("field", "weapon", "fooindexfield", changedID, "fooweaponassociatedfield", e.newValue); + updateRepeatingRelatedAttrFromRepeating("field", "magic", "fooindexfield", changedID, "foomagicassociatedfield", e.newValue); }); on("change:repeating_field:fieldlvl", function(e){ let changedID = e.sourceAttribute.split('_')[2]; updateRepeatingRelatedAttrFromRepeating("field", "spec", "fooindexfield", changedID, "foospecassociatedfieldlvl", e.newValue); updateRepeatingRelatedAttrFromRepeating("field", "weapon", "fooindexfield", changedID, "fooweaponassociatedfieldlvl", e.newValue); + updateRepeatingRelatedAttrFromRepeating("field", "magic", "fooindexfield", changedID, "foomagicassociatedfieldlvl", e.newValue); }); on("change:repeating_field:fieldlvl", function() { @@ -1135,11 +1225,13 @@ on("change:repeating_spec:specname", function(e){ let changedID = e.sourceAttribute.split('_')[2]; updateRepeatingRelatedAttrFromRepeating("spec", "weapon", "fooindexspe", changedID, "fooweaponassociatedspe", e.newValue); + updateRepeatingRelatedAttrFromRepeating("spec", "magic", "fooindexspe", changedID, "foomagicassociatedspe", e.newValue); }); on("change:repeating_spec:speclvl", function(e){ let changedID = e.sourceAttribute.split('_')[2]; updateRepeatingRelatedAttrFromRepeating("spec", "weapon", "fooindexspe", changedID, "fooweaponassociatedspelvl", e.newValue); + updateRepeatingRelatedAttrFromRepeating("spec", "magic", "fooindexspe", changedID, "foomagicassociatedspelvl", e.newValue); }); on("change:repeating_spec:specmodif", function(e){ @@ -1168,6 +1260,11 @@ updateRepeatingRelatedAttrFromRepeating("aspect", "skill", "fooindexaspect", changedID, "fooskillassociatedaspectlvl", e.newValue); }); + on("change:repeating_aspect:aspectname", function(e){ + let changedID = e.sourceAttribute.split('_')[2]; + updateRepeatingRelatedAttrFromRepeating("aspect", "skill", "fooindexaspect", changedID, "fooskillassociatedaspect", e.newValue); + }); + on("change:repeating_spec:fooindexfield", function(e){ fooRepeatingRelatedIndexChangeCallback("repeating_spec_fooindexfield", "field", ["fieldname", "fieldlvl"], ["repeating_spec_foospecassociatedfield", "repeating_spec_foospecassociatedfieldlvl"]); }); @@ -1255,16 +1352,31 @@ }); on("change:injury_contusions change:injury_meurtrissures change:injury_legeres change:injury_moderes change:injury_graves change:injury_mort change:injury_inconscient", function(e){ - getAttrs(["injury_meurtrissures","injury_legeres","injury_moderes","injury_graves","injury_mort","injury_inconscient"],function(x){ - let value = ""; - if(x.injury_meurtrissures>0) value="-1"; - if(x.injury_legeres>0) value="-3"; - if(x.injury_moderes>0) value="-5"; - if(x.injury_graves>0) value="-7"; - if(x.injury_mort>0) value="+3/-9"; - if(x.injury_inconscient>0) value="Inconscient"; - setAttrs({foocurrentinjurylevel: value}); - }); + if(e.sourceType=="player"){ + let injuryArray = ["injury_contusions","injury_meurtrissures","injury_legeres","injury_moderes","injury_graves","injury_mort","injury_inconscient"]; + let injuryLevel = ["","-1","-3","-5","-7","+3/-9","Inconscient"]; + let changedLevel = injuryArray.indexOf(e.sourceAttribute); + let maxed = injuryArray.slice(0, changedLevel); + if(maxed.length>0) + { + setMaxed = {}; + for(var m in maxed) + { + setMaxed[maxed[m]]=5; + } + setAttrs(setMaxed); + } + if(changedLevel+1<=injuryArray.length){ + let minied = injuryArray.slice(changedLevel+1,injuryArray.length); + setMinied = {}; + for(var m in minied) + { + setMinied[minied[m]]=0; + } + setAttrs(setMinied); + } + setAttrs({foocurrentinjurylevel: injuryLevel[changedLevel]}); + } }); on("clicked:repeating_weapon:nextfieldweapon", function(eventInfo) { @@ -1275,6 +1387,14 @@ getPrevRepeatingValue("repeating_weapon_fooindexfield", "field"); }); + on("clicked:repeating_magic:nextfieldmagic", function(eventInfo) { + getNextRepeatingValue("repeating_magic_fooindexfield", "field"); + }); + + on("clicked:repeating_magic:prevfieldmagic", function(eventInfo) { + getPrevRepeatingValue("repeating_magic_fooindexfield", "field"); + }); + on("change:repeating_weapon:fooindexfield", function(e){ fooRepeatingRelatedIndexChangeCallback("repeating_weapon_fooindexfield", "field", ["fieldname", "fieldlvl"], ["repeating_weapon_fooweaponassociatedfield", "repeating_weapon_fooweaponassociatedfieldlvl"]); }); @@ -1283,6 +1403,13 @@ fooRepeatingRelatedIndexChangeCallback("repeating_weapon_fooindexspe", "spec", ["specname", "speclvl", "specmodif"], ["repeating_weapon_fooweaponassociatedspe", "repeating_weapon_fooweaponassociatedspelvl", "repeating_weapon_fooweaponassociatedspelvlbonus"]); }); + on("change:repeating_magic:fooindexfield", function(e){ + fooRepeatingRelatedIndexChangeCallback("repeating_magic_fooindexfield", "field", ["fieldname", "fieldlvl"], ["repeating_magic_foomagicassociatedfield", "repeating_magic_foomagicassociatedfieldlvl"]); + }); + + on("change:repeating_magic:fooindexspe", function(e){ + fooRepeatingRelatedIndexChangeCallback("repeating_magic_fooindexspe", "spec", ["specname", "speclvl", "specmodif"], ["repeating_magic_foomagicassociatedspe", "repeating_magic_foomagicassociatedspelvl", "repeating_magic_foomagicassociatedspelvlbonus"]); + }); on("change:modalrange change:modaltime change:modalvalue change:modaltarget change:modaldiff change:modalench change:modalbonus change:modalinvoc change:modalpurif change:modaltransformationm change:modaltransformationt", function(e){ getAttrs(["modalrange","modaltime","modalvalue","modalench","modaldiff", "modaltarget","modalbonus","modalinvoc", "modalpurif", "modaltransformationt", "modaltransformationm"],function(x){ diff --git a/Empire_des_cerisiers/ReadMe.md b/Empire_des_cerisiers/ReadMe.md index f4d9660442..045cde721e 100644 --- a/Empire_des_cerisiers/ReadMe.md +++ b/Empire_des_cerisiers/ReadMe.md @@ -2,10 +2,16 @@ Player sheet for L'Empire des cerisiers by Olivier Sanfilippo published by Arkhane Asylum in 2020. Sheet is based on 2020 Arkhane Asylum's designed player sheet. ## Current Version -1.0 +1.1 ### Change log +#### 1.1 +* Added : magic tab +* Added : simple roll at the top of the sheet +* Updated : changing an injury level now update the others accordingly +* Fixed : skill aspect name not updating when source aspect is changed + #### 1.0 * Sheet creation for Roll20 diff --git a/Empire_des_cerisiers/sheet.json b/Empire_des_cerisiers/sheet.json index 6619b89bcd..0914ae78b6 100644 --- a/Empire_des_cerisiers/sheet.json +++ b/Empire_des_cerisiers/sheet.json @@ -4,6 +4,6 @@ "authors": "Marc-J and Talina", "roll20userid": "3631783,3632466", "preview": "EdC.png", - "instructions": "# L'Empire des cerisiers Character Sheet\n\n\nPlayer sheet for L'Empire des cerisiers by Olivier Sanfilippo published by Arkhane Asylum in 2020.\nThis sheet was created for the use of L'Empire des Cerisiers players and community. ##Player sheet\n\nSheet is based on 2020 Arkhane Asylum's designed player sheet.\n\n\n## Current Version 1.0" + "instructions": "# L'Empire des cerisiers Character Sheet\n\n\nPlayer sheet for L'Empire des cerisiers by Olivier Sanfilippo published by Arkhane Asylum in 2020.\nThis sheet was created for the use of L'Empire des Cerisiers players and community. ##Player sheet\n\nSheet is based on 2020 Arkhane Asylum's designed player sheet.\n\n\n## Current Version 1.1" } \ No newline at end of file