Le donjon de naheulbeuk 2.9.2 (#5370)

* [Fix] rolltemplate css Whitespace

* add howTo modal for Traits particuliers

* Delete old input for Traits Particuliers

* [Fix] allows space in regExp Trait Particulier

* add buff / debuff temporary stats for Movement speed

* [Fix] allows more digits and % in regExp Trait Particulier

* add movement buff in Traits particuliers

* CS
This commit is contained in:
Kaias26
2019-08-06 08:27:28 -04:00
committed by Cassie Levett
parent 6a2068918e
commit d90e6ed576
2 changed files with 61 additions and 68 deletions
+3 -1
View File
@@ -150,7 +150,8 @@ div.sheet-reglages {
input.sheet-display-reglages:checked ~ div.sheet-pj {
display:none;
}
div.sheet-reglages h2 .sheet-modal {
div.sheet-reglages h2 .sheet-modal,
div.sheet-traits h2 .sheet-modal {
margin:0 !important;
}
div.sheet-reglages h2 .sheet-cog {
@@ -871,6 +872,7 @@ div.sheet-reparation-impossible {
text-align:left!important;
font-weight:normal!important;
background: white!important;
white-space:normal!important;
}
/* night mode */
+58 -67
View File
@@ -374,6 +374,13 @@
</div>
</div>
</div>
<div class="sheet-row">
<div class="sheet-col-4 sheet-bold">Mod. Temp.</div>
<div class="sheet-col-4" title="Modificateur de déplacement">
<input class="sheet-autoCalc" type="text" name="attr_stats_mvt_buff" value="0" readonly="readonly" />
</div>
<div class="sheet-col-4">%</div>
</div>
<div class="sheet-row">
<div class="sheet-col-4 sheet-bold">Rapide</div>
<div class="sheet-col-4" title="Calculée en fonction de la PR Phy.">
@@ -572,8 +579,28 @@
</fieldset>
</div>
<br />
<div class="sheet-ape">
<h2>Traits particuliers (Débilibeuks / Mankdebols / Mutations / Maladies / Malédictions...)</h2>
<div class="sheet-traits">
<h2>Traits particuliers (Débilibeuks / Mankdebols / Mutations / Maladies / Malédictions...) <input type="checkbox" name="attr_modal_traits" class="sheet-modal" value="1" title="Comment ca marche ?"><span class="sheet-cog" title="Comment ca marche ?">?</span></h2>
<input type="checkbox" class="sheet-hidden sheet-modal" name="attr_modal_traits" value="1">
<div class="sheet-modal-wrapper">
<div class="sheet-modal">
<div class="sheet-modal_header">
<h2>Traits particuliers <span class="sheet-close">*</span><input type="checkbox" class="sheet-modal" name="attr_modal_traits" value="1"></h2>
</div>
<div class="sheet-modal_body">
Dans le champ Effets, listez les bonus (+) et malus (-) séparés par des virgules, en minuscules ou majuscules, avec ou sans espaces.<br /><br />
Activez le trait en fonction des circonstances (blessure, bonus temporaire, arme dégainée...)<br /><br />
<b>Statistiques disponibles :</b><br />
<ul>
<li>cou, int, cha, ad, fo</li>
<li>at, prd, jet, esq, fouille</li>
<li>inge, mphy, mpsy, rm</li>
<li>pr, mvt (en %)</li>
</ul>
Ex: COU+2, int-3,cha +4, pr-2
</div>
</div>
</div>
<div class="sheet-tableth sheet-row">
<div class="sheet-col-2">Provenance</div>
<div class="sheet-col-2">Nom</div>
@@ -596,45 +623,6 @@
<input type="checkbox" name="attr_condition_actif" value="1" />
</div>
</div>
<input type="checkbox" name="attr_condition_config" class="sheet-config-flag" value="1" /><span class="sheet-cog">y</span>
<div class="sheet-config">
<table>
<thead>
<tr>
<th>COU</th>
<th>INT</th>
<th>CHA</th>
<th>AD</th>
<th>FO</th>
<th>AT</th>
<th>PRD</th>
<th>JET</th>
<th>ESQ</th>
<th>MPhy</th>
<th>MPsy</th>
<th>RM</th>
<th>PR</th>
</tr>
</thead>
<tbody>
<tr>
<td><input type="number" name="attr_condition_courage" value="0" disabled="disabled" readonly="readonly"></td>
<td><input type="number" name="attr_condition_intelligence" value="0" disabled="disabled" readonly="readonly"></td>
<td><input type="number" name="attr_condition_charisme" value="0" disabled="disabled" readonly="readonly"></td>
<td><input type="number" name="attr_condition_adresse" value="0" disabled="disabled" readonly="readonly"></td>
<td><input type="number" name="attr_condition_force" value="0" disabled="disabled" readonly="readonly"></td>
<td><input type="number" name="attr_condition_attaque" value="0" disabled="disabled" readonly="readonly"></td>
<td><input type="number" name="attr_condition_parade" value="0" disabled="disabled" readonly="readonly"></td>
<td><input type="number" name="attr_condition_jet" value="0" disabled="disabled" readonly="readonly"></td>
<td><input type="number" name="attr_condition_esquive" value="0" disabled="disabled" readonly="readonly"></td>
<td><input type="number" name="attr_condition_magiephy" value="0" disabled="disabled" readonly="readonly"></td>
<td><input type="number" name="attr_condition_magiepsy" value="0" disabled="disabled" readonly="readonly"></td>
<td><input type="number" name="attr_condition_resimagie" value="0" disabled="disabled" readonly="readonly"></td>
<td><input type="number" name="attr_condition_pr" value="0" disabled="disabled" readonly="readonly"></td>
</tr>
</tbody>
</table>
</div>
</div>
</fieldset>
</div>
@@ -669,7 +657,7 @@
</div>
<!-- TAB Equipement -->
<div class="sheet-tab_equipement">
<div class="sheet-tab_equipement">
<div class="sheet-row sheet-hint sheet-center">
<div class="sheet-col-4">Bonus de Force aux dégats :</div>
<div class="sheet-col-1"><input class="sheet-autoCalc" name="attr_BonusDegatsForce" value="0" readonly type="text"></div>
@@ -2324,7 +2312,7 @@
</div>
</div>
</fieldset>
</div>
</div>
</div>
<!-- TAB Reglages -->
@@ -2414,7 +2402,7 @@
<input type="checkbox" class="sheet-tab" name="attr_import_start" value="1"><span class="sheet-tab">Démarrer</span>
</div>
</div>
</div>
</div>
</div>
<!--- SHEET PNJ --->
@@ -2647,11 +2635,11 @@
// Temp Stats
var tempStats = [ "stats_courage", "stats_intelligence", "stats_charisme", "stats_adresse", "stats_force",
"stats_attaque", "stats_parade", "stats_jet", "stats_esquive", "stats_fouille",
"stats_inge", "stats_magiephy", "stats_magiepsy", "stats_resimagie", "stats_pr" ];
"stats_inge", "stats_magiephy", "stats_magiepsy", "stats_resimagie", "stats_pr", "stats_mvt" ];
// Buff Stats
var buffStats = [ "cou", "int", "cha", "ad", "fo",
"at", "prd", "jet", "esq", "fouille",
"inge", "mphy", "mpsy", "rm", "pr" ];
"inge", "mphy", "mpsy", "rm", "pr", "mvt" ];
var prStats = {
change: [ "repeating_armures:armure_prphy", "repeating_armures:armure_prmag", "prnat", "stats_pr_buff" ],
remove: [ "repeating_armures" ]
@@ -2692,7 +2680,7 @@
updatePR();
});
// Déplacement
on("change:prphy change:deplacement_mod change:stats_force_total", function() {
on("change:prphy change:deplacement_mod change:stats_force_total change:stats_mvt_buff", function() {
updateDeplacement();
});
// Equive
@@ -2896,7 +2884,7 @@
var sBuffs = {};
var statName ='';
var keyName ='';
// reset buffs
_.each( tempStats, function(_stat) {
sBuffs[ _stat + "_buff" ] = 0;
@@ -2909,7 +2897,7 @@
aBuffs.push("repeating_conditions_" + idArray[i] + "_condition_effet" );
}
}
if ( aBuffs.length > 0 ) {
// apply buffs
getAttrs(aBuffs, function(v) {
@@ -2917,35 +2905,35 @@
// cut all the effects by group
_mods = v[ _effets ].split(',');
_.each(_mods, function(_mod) {
var _aMod = _mod.match(/([a-zA-Z ]*)([\+\-])([0-9])/);
if( !!_aMod ) {
var _aMod = _mod.match(/([a-zA-Z]*) *([\+\-]) *([0-9]+)\%?/);
if( !!_aMod ) {
// get value of effect
var _tempValue = safeInt( _aMod[3] );
// get index of effect in buffStats array
var _tempIndex = buffStats.indexOf( _aMod[1].toLowerCase().trim() );
if( _tempIndex > -1 ) {
if( _tempIndex > -1 ) {
// change short notation (cou,fo,int) in attribute (courage, intelligence...)
var keyName = tempStats[ _tempIndex ] + "_buff";
if( _aMod[2] === "-" ) {
var keyName = tempStats[ _tempIndex ] + "_buff";
if( _aMod[2] === "-" ) {
_tempValue = _tempValue * -1;
}
}
if( sBuffs[ keyName ] != undefined ) {
sBuffs[ keyName ] += _tempValue;
} else {
sBuffs[ keyName ] = _tempValue;
}
}
}
}
});
}
setAttrs( sBuffs );
});
} else {
} else {
setAttrs( sBuffs );
}
});
@@ -2954,7 +2942,7 @@
// update walk speed when force, deplacement_mod or PR is updated
function updateDeplacement() {
getAttrs( [ "stats_force_total", "deplacement_mod", "deplacementrapide", "deplacementrapide_duree", "deplacementsprint", "deplacementsprint_duree", "prphy" ], function( sValues ) {
getAttrs( [ "stats_force_total", "deplacement_mod", "deplacementrapide", "deplacementrapide_duree", "deplacementsprint", "deplacementsprint_duree", "prphy", "stats_mvt_buff" ], function( sValues ) {
var v = structSafeInt( sValues );
var prPhy = v[ "prphy" ];
var deplacementRapide = v[ "deplacementrapide" ];
@@ -2962,6 +2950,7 @@
var deplacementSprint = v[ "deplacementsprint" ];
var deplacementSprintDuree = v[ "deplacementsprint_duree" ];
var deplacement_mod = v[ "deplacement_mod" ] / 100;
var deplacement_temp = v[ "stats_mvt_buff" ] / 100;
// PR vs Déplacement
if( prPhy === 0 || prPhy === 1 ) {
@@ -3001,6 +2990,8 @@
deplacementSprintDuree = v[ "stats_force_total" ] * 2;
}
deplacement_mod += deplacement_temp;
// apply mod
deplacementRapide = Math.ceil( deplacementRapide * deplacement_mod * 100 ) / 100;
deplacementRapideDuree = Math.ceil( deplacementRapideDuree * deplacement_mod * 100 ) / 100;
@@ -3025,7 +3016,7 @@
var esquive = v[ "stats_adresse_total" ];
var prPhy = v[ "prphy" ];
var surcharge = v[ "personnage_surcharge" ];
// PR vs Esquive
if( prPhy === 0 || prPhy === 1 ) {
esquive += 1;
@@ -3040,14 +3031,14 @@
} else if( prPhy > 7 ) {
esquive = 0;
}
// surcharge vs Esquive
if( surcharge === 4 ) {
esquive += -2;
} else if( surcharge === 5 ) {
esquive = 0;
}
setAttrs({
"stats_esquive": esquive,
"stats_esquive_total": esquive + v[ "stats_esquive_mod" ] + v[ "stats_esquive_temp_total" ]
@@ -3430,7 +3421,7 @@
var dataBase = {
"simple": [ "personnage_nom", "personnage_origine", "personnage_metiers", "personnage_sex", "personnage_age", "personnage_poids", "personnage_taille", "personnage_notes", "personnage_butins",
"ev", "ev_max", "ea", "ea_max", "personnage_niveau", "personnage_xp", "personnage_pointdestin", "bonusdegatssorts",
"personnage_langue", "personnage_vision", "personnage_nyctalopie", "personnage_ouie", "personnage_odorat", "personnage_charge_max", "deplacement_mod",
"personnage_langue", "personnage_vision", "personnage_nyctalopie", "personnage_ouie", "personnage_odorat", "personnage_charge_max", "deplacement_mod", "stats_mvt_buff",
"pr_tete", "pr_bras", "pr_torse", "pr_bouclier", "pr_jambes", "pr_pieds", "pr_mains", "prnat", "prphy", "prmag", "pr", "pr_max", "stats_pr_buff",
"bivouac_couverture", "bivouac_couverture_recup", "bivouac_matelas", "bivouac_matelas_recup", "bivouac_tente", "bivouac_tente_recup",
"stats_courage", "stats_courage_mod", "stats_courage_temp", "stats_intelligence", "stats_intelligence_mod", "stats_intelligence_temp", "stats_charisme", "stats_charisme_mod", "stats_charisme_temp", "stats_adresse", "stats_adresse_mod", "stats_adresse_temp", "stats_force", "stats_force_mod", "stats_force_temp",