Dungeon World French v3.5

* Spells repeating section: prepared count bug fix
* Repeating section buttons styling
This commit is contained in:
Natha
2019-01-29 23:33:59 +01:00
parent 157bd48238
commit ab8fbe4555
4 changed files with 368 additions and 295 deletions
+6 -1
View File
@@ -4,10 +4,15 @@ Feuille de Personnage en français pour [Dungeon World V1 et V2](http://dungeonw
Basée sur la feuille VO de Willem den Besten (Morenim) et Devindra Payment (@Ardnived) ... et considérablement modifiée.
# Version courante
3.4 [Capture d'écran](dwfr.png)
3.5 [Capture d'écran](dwfr.png)
# Notes de version
## v3.5 (2019-01-29)
* Correction d'un bug dans le comptage des sorts préparés
* Amélioration esthétique des boutons de sections répétables
## v3.4 (2017-09-17)
* Optimisation technique
+61
View File
@@ -676,3 +676,64 @@ input[type="radio"].sheet-voleur:checked ~ div.sheet-voleur {
border-left-style: none;
border-bottom-style: none;
}
/* ===== REPEATING SECTIONS CTRL ===== */
.repcontrol {
margin-top: 4px;
min-height: 25px;
}
.repcontrol .btn {
border: none;
color: white !important;
background: none;
box-shadow: none;
font-size: 0;
padding: 0px 0px 0px 0px;
}
.repcontrol .btn:focus {outline: 0;}
.repcontrol .repcontrol_add:before,
.repcontrol .repcontrol_edit:after {
font-family: pictos;
color: #700200;
display: inline-block;
border: 1px solid #700200;
border-radius: 50%;
font-size: 14px;
padding: 2px;
height: 14px;
width: 14px;
line-height: 14px;
}
.repcontrol .repcontrol_add:before {
content: '&';
}
.repcontrol .repcontrol_edit:after {
content: '(';
}
.editmode ~ .repcontrol .repcontrol_edit:after {
content: ')';
vertical-align: bottom;
}
.repcontrol .repcontrol_edit:hover:after,
.repcontrol .repcontrol_add:hover:before {
color: #DE6928;
border-color: #DE6928;
}
.repcontainer .repitem .itemcontrol {z-index: 10;}
.repcontainer .repitem .itemcontrol .repcontrol_del {
float: right;
font-size: 10px;
padding: 0px;
height: 18px;
width: 18px;
}
.repcontainer .repitem .itemcontrol .repcontrol_move {
cursor: move;
float: left;
font-size: 10px;
padding: 0px;
height: 18px;
width: 18px;
}
+299 -292
View File
@@ -1,297 +1,6 @@
<!-- **** SCRIPTS / SHEET WORKERS -->
<script type="text/worker">
/* ---- DWVF ---------------------- */
var DWVF = DWVF || (function(){
'use strict';
var version = '1.1',
calcMod = function (carac) {
var car = parseInt(carac) || 0;
var mod = 0;
if (car<4) {mod=-3;}
else if (car>3 && car<6) {mod=-2;}
else if (car>5 && car<9) {mod=-1;}
else if (car>12 && car<16) {mod=1;}
else if (car>15 && car<18) {mod=2;}
else if (car>17) {mod=3;}
else {mod=0;}
return mod;
};
return {
calcMod: calcMod
};
}());
// Inventaire
on("change:repeating_items:itemweight remove:repeating_items", function() {
getSectionIDs("repeating_items", function(idws) {
var totwght = 0;
idws.forEach(function(idw,index,arr){
var uwght = "repeating_items_" + idw + "_itemweight";
var lng = parseInt(arr.length) || 0;
getAttrs(['' + uwght], function(val) {
totwght = totwght + parseInt(val[uwght]) || 0;
if ( (index+1) == lng ){
setAttrs({
load: totwght
});
}
});
});
});
});
// ACTIONS
// Actions Base
on("change:repeating_actionsbase:actionbasejet", function(eventinfo) {
var chkjet = parseInt(eventinfo.newValue) || 0;
var jet="0";
if (chkjet == 1) {
jet= "[[2d6 + (@{actionbasemod})[Mod.Carac.] + (@{actionbasebonus})[Bonus] + (@{jetpjbonus})[Bonus circonstanciel] ]]";
} else {
jet="0";
}
setAttrs({
repeating_actionsbase_actionbaseroll: jet
});
});
// Actions Spéciales
on("change:repeating_actionsspe:actionspejet", function(eventinfo) {
var chkjet = parseInt(eventinfo.newValue) || 0;
var jet="0";
if( chkjet == 1) {
jet="[[2d6 + (@{actionspemod})[Mod.Carac.] + (@{actionspebonus})[Bonus] + (@{jetpjbonus})[Bonus circonstanciel] ]]";
} else {
jet="0";
}
setAttrs({
repeating_actionsspe_actionsperoll: jet
});
});
// Départ
on("change:repeating_actionsdepart:actiondepjet", function(eventinfo) {
var chkjet = parseInt(eventinfo.newValue) || 0;
var jet="0";
if( chkjet == 1) {
jet="[[2d6 + (@{actiondepmod})[Mod.Carac.] + (@{actiondepbonus})[Bonus] + (@{jetpjbonus})[Bonus circonstanciel] ]]";
} else {
jet="0";
}
setAttrs({
repeating_actionsdepart_actiondeproll: jet
});
});
// Avancées
on("change:repeating_moves:movejet", function(eventinfo) {
var chkjet = parseInt(eventinfo.newValue) || 0;
var jet="0";
if( chkjet == 1) {
jet="[[2d6 + (@{movemod})[Mod.Carac.] + (@{movebonus})[Bonus] + (@{jetpjbonus})[Bonus circonstanciel] ]]";
} else {
jet="0";
}
setAttrs({
repeating_moves_moveroll: jet
});
});
// Sorts
on("change:repeating_spells:spelljet change:repeating_spells:spelldice", function() {
getAttrs(["repeating_spells_spelljet","repeating_spells_spelldice"], function(values){
var chkjet = parseInt(values.repeating_spells_spelljet) || 0;
var strdice = "" + values.repeating_spells_spelldice;
var jet="0";
if( chkjet == 1) {
if (strdice.length > 0) {
jet="[[@{spelldice}]]";
} else {
jet="0";
}
} else {
jet="0";
}
setAttrs({
repeating_spells_spellroll: jet
});
});
});
on("change:repeating_spells:spellprep change:repeating_spells:spellniveau", function() {
getAttrs(["repeating_spells_spellprep","repeating_spells_spellniveau"], function(values) {
var chk = parseInt(values.repeating_spells_spellprep) || 0;
var niv = parseInt(values.repeating_spells_spellniveau) || 0;
tot = niv*chk;
setAttrs({
repeating_spells_spellvalue: tot
});
TAS.repeatingSimpleSum('spells','spellvalue','spellsnum');
});
});
// Caractéristiques et modificateurs
on("change:strength change:weak", function() {
getAttrs(["strength","weak"], function(values) {
var mod=parseInt(DWVF.calcMod(values.strength)) || 0;
var mal=parseInt(values.weak) || 0;
setAttrs({
strmod:mod-mal
});
});
});
on("change:dexterity change:shaky", function() {
getAttrs(["dexterity","shaky"], function(values) {
var mod=parseInt(DWVF.calcMod(values.dexterity)) || 0;
var mal=parseInt(values.shaky) || 0;
setAttrs({
dexmod:mod-mal
});
});
});
on("change:constitution change:sick", function() {
getAttrs(["constitution","sick"], function(values) {
var mod=parseInt(DWVF.calcMod(values.constitution)) || 0;
var mal=parseInt(values.sick) || 0;
setAttrs({
conmod:mod-mal
});
});
});
on("change:intelligence change:stunned", function() {
getAttrs(["intelligence","stunned"], function(values) {
var mod=parseInt(DWVF.calcMod(values.intelligence)) || 0;
var mal=parseInt(values.stunned) || 0;
setAttrs({
intmod:mod-mal
});
});
});
on("change:wisdom change:confused", function() {
getAttrs(["wisdom","confused"], function(values) {
var mod=parseInt(DWVF.calcMod(values.wisdom)) || 0;
var mal=parseInt(values.confused) || 0;
setAttrs({
wismod:mod-mal
});
});
});
on("change:charisma change:scarred", function() {
getAttrs(["charisma","scarred"], function(values) {
var mod=parseInt(DWVF.calcMod(values.charisma)) || 0;
var mal=parseInt(values.scarred) || 0;
setAttrs({
chamod:mod-mal
});
});
});
// CLASSES
on("change:laclasse", function(eventinfo) {
var classe = eventinfo.newValue;
var nom = "";
var pv = 0;
var charge = 0;
var sorts = 0;
var degats = "";
switch(classe) {
case "barbare":
nom = "Le Barbare";
pv = 8;
charge = 9;
sorts = 0;
degats = "d10";
break;
case "barde":
nom = "Le Barde";
pv = 6;
charge = 9;
sorts = 0;
degats = "d6";
break;
case "cambrioleur":
nom = "Le Cambrioleur";
pv = 6;
charge = 9;
sorts = 0;
degats = "d8";
break;
case "chaman":
nom = "Le Chaman";
pv = 6;
charge = 8;
sorts = 0;
degats = "d6";
break;
case "clerc":
nom = "Le Clerc";
pv = 8;
charge = 10;
sorts = 1;
degats = "d6";
break;
case "druide":
nom = "Le Druide";
pv = 6;
charge = 6;
sorts = 0;
degats = "d6";
break;
case "ranger":
nom = "L'Éclaireur";
pv = 8;
charge = 11;
sorts = 0;
degats = "d8";
break;
case "guerrier":
nom = "Le Guerrier";
pv = 10;
charge = 12;
sorts = 0;
degats = "d10";
break;
case "immolateur":
nom = "L'Immolateur";
pv = 4;
charge = 9;
sorts = 0;
degats = "d8";
break;
case "magicien":
nom = "Le Magicien";
pv = 4;
charge = 7;
sorts = 1;
degats = "d4";
break;
case "paladin":
nom = "Le Paladin";
pv = 10;
charge = 12;
sorts = 0;
degats = "d10";
break;
case "voleur":
nom = "Le Voleur";
pv = 6;
charge = 9;
sorts = 0;
degats = "d8";
break;
default:
nom = "";
pv = 0;
charge = 0;
sorts = 0;
degats = "";
break;
}
setAttrs({
class: nom,
basehp: pv,
baseload : charge,
spellsmax : sorts,
dtype: degats
});
});
</script>
<!-- ==== IDENTITÉ ==== -->
<div class="sheet-topbar">
<img style="width: 200px;" src="https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/DungeonWorldFrench/dwlogo.png" alt="Dungeon World VF, feuille version 3.3 (18/02/2017)" title="Dungeon World VF, feuille version 3.2 (18/12/2016)" />
<img style="width: 200px;" src="https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/DungeonWorldFrench/dwlogo.png" alt="Dungeon World VF, feuille version 3.5 (29/01/2019)" title="Dungeon World VF, feuille version 3.5 (29/01/2019)" />
<div><input class="sheet-field-name" type="text" placeholder="Nom" name="attr_character_name" /></div>
<div>
<SELECT name="attr_laclasse" class="sheet-field-class" title="Sélectionner une classe existante pour pré-remplir certains champs et faire apparaître les Actions de Départ de la classe choisie">
@@ -3509,3 +3218,301 @@ on("change:repeating_items:itemweight remove:repeating_items", function() {
{{/jetsort}}
</table>
</rolltemplate>
<!-- **** SCRIPTS / SHEET WORKERS -->
<script type="text/worker">
/* ---- DWVF ---------------------- */
var DWVF = DWVF || (function(){
'use strict';
var version = '1.1',
calcMod = function (carac) {
var car = parseInt(carac) || 0;
var mod = 0;
if (car<4) {mod=-3;}
else if (car>3 && car<6) {mod=-2;}
else if (car>5 && car<9) {mod=-1;}
else if (car>12 && car<16) {mod=1;}
else if (car>15 && car<18) {mod=2;}
else if (car>17) {mod=3;}
else {mod=0;}
return mod;
};
return {
calcMod: calcMod
};
}());
// Inventaire
on("change:repeating_items:itemweight remove:repeating_items", function() {
getSectionIDs("repeating_items", function(idws) {
var totwght = 0;
idws.forEach(function(idw,index,arr){
var uwght = "repeating_items_" + idw + "_itemweight";
var lng = parseInt(arr.length) || 0;
getAttrs(['' + uwght], function(val) {
totwght = totwght + parseInt(val[uwght]) || 0;
if ( (index+1) == lng ){
setAttrs({
load: totwght
});
}
});
});
});
});
// ACTIONS
// Actions Base
on("change:repeating_actionsbase:actionbasejet", function(eventinfo) {
var chkjet = parseInt(eventinfo.newValue) || 0;
var jet="0";
if (chkjet == 1) {
jet= "[[2d6 + (@{actionbasemod})[Mod.Carac.] + (@{actionbasebonus})[Bonus] + (@{jetpjbonus})[Bonus circonstanciel] ]]";
} else {
jet="0";
}
setAttrs({
repeating_actionsbase_actionbaseroll: jet
});
});
// Actions Spéciales
on("change:repeating_actionsspe:actionspejet", function(eventinfo) {
var chkjet = parseInt(eventinfo.newValue) || 0;
var jet="0";
if( chkjet == 1) {
jet="[[2d6 + (@{actionspemod})[Mod.Carac.] + (@{actionspebonus})[Bonus] + (@{jetpjbonus})[Bonus circonstanciel] ]]";
} else {
jet="0";
}
setAttrs({
repeating_actionsspe_actionsperoll: jet
});
});
// Départ
on("change:repeating_actionsdepart:actiondepjet", function(eventinfo) {
var chkjet = parseInt(eventinfo.newValue) || 0;
var jet="0";
if( chkjet == 1) {
jet="[[2d6 + (@{actiondepmod})[Mod.Carac.] + (@{actiondepbonus})[Bonus] + (@{jetpjbonus})[Bonus circonstanciel] ]]";
} else {
jet="0";
}
setAttrs({
repeating_actionsdepart_actiondeproll: jet
});
});
// Avancées
on("change:repeating_moves:movejet", function(eventinfo) {
var chkjet = parseInt(eventinfo.newValue) || 0;
var jet="0";
if( chkjet == 1) {
jet="[[2d6 + (@{movemod})[Mod.Carac.] + (@{movebonus})[Bonus] + (@{jetpjbonus})[Bonus circonstanciel] ]]";
} else {
jet="0";
}
setAttrs({
repeating_moves_moveroll: jet
});
});
// Sorts
on("change:repeating_spells:spelljet change:repeating_spells:spelldice", function() {
getAttrs(["repeating_spells_spelljet","repeating_spells_spelldice"], function(values){
var chkjet = parseInt(values.repeating_spells_spelljet) || 0;
var strdice = "" + values.repeating_spells_spelldice;
var jet="0";
if( chkjet == 1) {
if (strdice.length > 0) {
jet="[[@{spelldice}]]";
} else {
jet="0";
}
} else {
jet="0";
}
setAttrs({
repeating_spells_spellroll: jet
});
});
});
on("change:repeating_spells:spellprep change:repeating_spells:spellniveau", function() {
getSectionIDs("spells", (ids) => {
let fields = [], tot = 0, update = {}, val = 0;
_.each(ids, (id) => {
fields.push(`repeating_spells_${id}_spellprep`);
fields.push(`repeating_spells_${id}_spellniveau`);
});
getAttrs(fields, (v) => {
_.each(ids, (id) => {
val = (parseInt(v[`repeating_spells_${id}_spellprep`]) || 0) * (parseInt(v[`repeating_spells_${id}_spellniveau`]) || 0);
update[`repeating_spells_${id}_spellprep`] = val;
tot += val;
});
update["spellsnum"] = tot;
setAttrs(update);
});
});
});
// Caractéristiques et modificateurs
on("change:strength change:weak", function() {
getAttrs(["strength","weak"], function(values) {
var mod=parseInt(DWVF.calcMod(values.strength)) || 0;
var mal=parseInt(values.weak) || 0;
setAttrs({
strmod:mod-mal
});
});
});
on("change:dexterity change:shaky", function() {
getAttrs(["dexterity","shaky"], function(values) {
var mod=parseInt(DWVF.calcMod(values.dexterity)) || 0;
var mal=parseInt(values.shaky) || 0;
setAttrs({
dexmod:mod-mal
});
});
});
on("change:constitution change:sick", function() {
getAttrs(["constitution","sick"], function(values) {
var mod=parseInt(DWVF.calcMod(values.constitution)) || 0;
var mal=parseInt(values.sick) || 0;
setAttrs({
conmod:mod-mal
});
});
});
on("change:intelligence change:stunned", function() {
getAttrs(["intelligence","stunned"], function(values) {
var mod=parseInt(DWVF.calcMod(values.intelligence)) || 0;
var mal=parseInt(values.stunned) || 0;
setAttrs({
intmod:mod-mal
});
});
});
on("change:wisdom change:confused", function() {
getAttrs(["wisdom","confused"], function(values) {
var mod=parseInt(DWVF.calcMod(values.wisdom)) || 0;
var mal=parseInt(values.confused) || 0;
setAttrs({
wismod:mod-mal
});
});
});
on("change:charisma change:scarred", function() {
getAttrs(["charisma","scarred"], function(values) {
var mod=parseInt(DWVF.calcMod(values.charisma)) || 0;
var mal=parseInt(values.scarred) || 0;
setAttrs({
chamod:mod-mal
});
});
});
// CLASSES
on("change:laclasse", function(eventinfo) {
var classe = eventinfo.newValue;
var nom = "";
var pv = 0;
var charge = 0;
var sorts = 0;
var degats = "";
switch(classe) {
case "barbare":
nom = "Le Barbare";
pv = 8;
charge = 9;
sorts = 0;
degats = "d10";
break;
case "barde":
nom = "Le Barde";
pv = 6;
charge = 9;
sorts = 0;
degats = "d6";
break;
case "cambrioleur":
nom = "Le Cambrioleur";
pv = 6;
charge = 9;
sorts = 0;
degats = "d8";
break;
case "chaman":
nom = "Le Chaman";
pv = 6;
charge = 8;
sorts = 0;
degats = "d6";
break;
case "clerc":
nom = "Le Clerc";
pv = 8;
charge = 10;
sorts = 1;
degats = "d6";
break;
case "druide":
nom = "Le Druide";
pv = 6;
charge = 6;
sorts = 0;
degats = "d6";
break;
case "ranger":
nom = "L'Éclaireur";
pv = 8;
charge = 11;
sorts = 0;
degats = "d8";
break;
case "guerrier":
nom = "Le Guerrier";
pv = 10;
charge = 12;
sorts = 0;
degats = "d10";
break;
case "immolateur":
nom = "L'Immolateur";
pv = 4;
charge = 9;
sorts = 0;
degats = "d8";
break;
case "magicien":
nom = "Le Magicien";
pv = 4;
charge = 7;
sorts = 1;
degats = "d4";
break;
case "paladin":
nom = "Le Paladin";
pv = 10;
charge = 12;
sorts = 0;
degats = "d10";
break;
case "voleur":
nom = "Le Voleur";
pv = 6;
charge = 9;
sorts = 0;
degats = "d8";
break;
default:
nom = "";
pv = 0;
charge = 0;
sorts = 0;
degats = "";
break;
}
setAttrs({
class: nom,
basehp: pv,
baseload : charge,
spellsmax : sorts,
dtype: degats
});
});
</script>
+2 -2
View File
@@ -4,6 +4,6 @@
"authors": "Natha",
"roll20userid": "75857",
"preview": "dwfr.png",
"instructions": "Feuille de personnage pour [Dungeon World V1 et V2](http://dungeonworld.pbta.fr/). Consultez le [readme](https://github.com/Roll20/roll20-character-sheets/blob/master/DungeonWorldFrench/ReadMe.md). v3.4 (2017-09-17)."
"instructions": "Feuille de personnage pour [Dungeon World V1 et V2](http://dungeonworld.pbta.fr/). Consultez le [readme](https://github.com/Roll20/roll20-character-sheets/blob/master/DungeonWorldFrench/ReadMe.md). v3.5 (2019-01-29)."
,"tipeee":"https://www.tipeee.com/natharoll20"
}
}