Prettify and implement of attack
Now the tabs are pretty and the attack button is kinda working, still stuff to add
This commit is contained in:
parent
3d75acb507
commit
7a889db436
|
|
@ -1,66 +1,67 @@
|
|||
//Variables a initialiser par parse
|
||||
/*var nb_dices=0;
|
||||
var all_dices d*
|
||||
var nb_2add=0; //+
|
||||
var nb_2sub=0; //-
|
||||
/*var nb_dices=0;
|
||||
var all_dices d*
|
||||
var nb_2add=0; //+
|
||||
var nb_2sub=0; //-
|
||||
|
||||
var relances=0; //r
|
||||
Perfection P
|
||||
var relances=0; //r
|
||||
Perfection P
|
||||
|
||||
Defense
|
||||
Défense_impénétrable I_1
|
||||
Défense_impénétrable I_2 - Rappel
|
||||
Défense_impénétrable I_4
|
||||
Rempart_parfait R
|
||||
Defense
|
||||
Défense_impénétrable I_1
|
||||
Défense_impénétrable I_2 - Rappel
|
||||
Défense_impénétrable I_4
|
||||
Rempart_parfait R
|
||||
|
||||
Offense
|
||||
Technique_martiale M_1
|
||||
Technique_martiale M_2
|
||||
Coup_déchirant D
|
||||
Fauchage F
|
||||
Exploiter_les_points_faibles E_1
|
||||
Exploiter_les_points_faibles E_2 - Rappel
|
||||
Exploiter_les_points_faibles E_4
|
||||
Offense
|
||||
Technique_martiale M_1
|
||||
Technique_martiale M_2
|
||||
Coup_déchirant D
|
||||
Fauchage F
|
||||
Exploiter_les_points_faibles E_1
|
||||
Exploiter_les_points_faibles E_2 - Rappel
|
||||
Exploiter_les_points_faibles E_4
|
||||
|
||||
Spécial
|
||||
Tir_précis T_1
|
||||
Tir_précis T_2
|
||||
Tir_implacable i
|
||||
Charge C
|
||||
Charge_indomptable N - (Sur la feuille de perso)
|
||||
Seuil s
|
||||
*/
|
||||
Spécial
|
||||
Tir_précis T_1
|
||||
Tir_précis T_2
|
||||
Tir_implacable i
|
||||
Charge C
|
||||
Charge_indomptable N - (Sur la feuille de perso)
|
||||
Seuil s
|
||||
*/
|
||||
|
||||
on("change:skill_SKILLNAME_activation change:general_skilllevel_SKILLNAME", function() {
|
||||
getAttrs(["skill_SKILLNAME_activation", "general_skilllevel_Perfection"], function(values) {
|
||||
setAttrs({"general_effective_SKILLNAME":values.skill_SKILLNAME_activation*values.general_skilllevel_SKILLNAME});
|
||||
});
|
||||
// SKILLNAME
|
||||
on("change:skill_SKILLNAME_activation change:general_skilllevel_SKILLNAME", function() {
|
||||
getAttrs(["skill_SKILLNAME_activation", "general_skilllevel_SKILLNAME"], function(values) {
|
||||
setAttrs({"general_effective_SKILLNAME":values.skill_SKILLNAME_activation*values.general_skilllevel_SKILLNAME});
|
||||
});
|
||||
});
|
||||
|
||||
<!--SKILLNAME -->
|
||||
<input class="sheet-skill_name" style="margin-right: 4px;" type="text" name="attr_general_skill_SKILLNAME" disabled="true" value="SKILLNAME" />
|
||||
<input type="number" min="0" name="attr_skillcost_SKILLNAME" />
|
||||
<input class="sheet-skill_name" style="margin-right: 4px;" type="number" min="0" max="10" name="attr_general_skilllevel_SKILLNAME" />
|
||||
<select class="sheet-skill_select" style="margin-right:4px" name="attr_Skill_general_attribute_select_SKILLNAME"><option value="@{base-Force} + @{exal-Force}">For</option><option value="@{base-Agilite} + @{exal-Agilite}">Agi</option><option value="@{base-Perception} + @{exal-Perception}">Per</option><option value="@{base-Charisme} + @{exal-Charisme}">Cha</option><option value="@{base-Intelligence} + @{exal-Intelligence}">Int</option><option value="@{base-Perception} + @{exal-Perception}">Per</option><option value="@{base-Volonte} + @{exal-Volonte}">Vol</option><option value="@{base-Psyche} + @{exal-Psyche}">Psy</option><option value="@{base-Chance} + @{exal-Chance}">Chn</option></select>
|
||||
<button type='roll' class="sheet-skillbutton" value="/e rolls @{general_skill_SKILLNAME} [[(@{general_skilllevel_SKILLNAME}+(@{Skill_general_attribute_select_SKILLNAME}) - d@{dice})]] "></button>
|
||||
<input type="checkbox" class="sheet-skill_activation" style="margin-right: 4px;" value="1" name="attr_skill_SKILLNAME_activation" />
|
||||
<input class="sheet-hidden" type="number" disabled="true" name="attr_general_effective_SKILLNAME" value="@{general_skilllevel_SKILLNAME}"/>
|
||||
<!--SKILLNAME -->
|
||||
<input class="sheet-skill_name" style="margin-right: 4px;" type="text" name="attr_general_skill_SKILLNAME" disabled="true" value="SKILLNAME" />
|
||||
<input type="number" min="0" name="attr_skillcost_SKILLNAME" />
|
||||
<input class="sheet-skill_name" style="margin-right: 4px;" type="number" min="0" max="10" name="attr_general_skilllevel_SKILLNAME" />
|
||||
<select class="sheet-skill_select" style="margin-right:4px" name="attr_Skill_general_attribute_select_SKILLNAME"><option value="@{base-Force} + @{exal-Force}">For</option><option value="@{base-Agilite} + @{exal-Agilite}">Agi</option><option value="@{base-Perception} + @{exal-Perception}">Per</option><option value="@{base-Charisme} + @{exal-Charisme}">Cha</option><option value="@{base-Intelligence} + @{exal-Intelligence}">Int</option><option value="@{base-Perception} + @{exal-Perception}">Per</option><option value="@{base-Volonte} + @{exal-Volonte}">Vol</option><option value="@{base-Psyche} + @{exal-Psyche}">Psy</option><option value="@{base-Chance} + @{exal-Chance}">Chn</option></select>
|
||||
<button type='roll' class="sheet-skillbutton" value="/e rolls @{general_skill_SKILLNAME} [[(@{general_skilllevel_SKILLNAME}+(@{Skill_general_attribute_select_SKILLNAME}) - d@{dice})]] "></button>
|
||||
<input type="checkbox" class="sheet-skill_activation" style="margin-right: 4px;" value="1" name="attr_skill_SKILLNAME_activation" />
|
||||
<input class="sheet-skill_hidden" type="number" name="attr_general_effective_SKILLNAME"/>
|
||||
|
||||
<!--FIELD_TYPE -->
|
||||
<fieldset class="repeating_FIELD_TYPE-skills">
|
||||
<input class="sheet-skill_name" type="text" name="attr_FIELD_TYPE_skillname" />
|
||||
<input type="number" name="attr_FIELD_TYPE_skillcost" />
|
||||
<input type="number" min="-10" max="10" name="attr_FIELD_TYPE_skilllevel" />
|
||||
<select class="sheet-skill_select" name="attr_FIELD_TYPE_attribute_select">
|
||||
<option value="@{base-Force} + @{exal-Force}">For</option>
|
||||
<option value="@{base-Agilite} + @{exal-Agilite}">Agi</option>
|
||||
<option value="@{base-Perception} + @{exal-Perception}">Per</option>
|
||||
<option value="@{base-Charisme} + @{exal-Charisme}">Cha</option>
|
||||
<option value="@{base-Intelligence} + @{exal-Intelligence}">Int</option>
|
||||
<option value="@{base-Perception} + @{exal-Perception}">Per</option>
|
||||
<option value="@{base-Volonte} + @{exal-Volonte}">Vol</option>
|
||||
<option value="@{base-Psyche} + @{exal-Psyche}">Psy</option>
|
||||
<option value="@{base-Chance} + @{exal-Chance}">Chn</option>
|
||||
</select>
|
||||
<button type='roll' class="sheet-skillbutton" value="/e rolls @{FIELD_TYPE_skillname} [[@{FIELD_TYPE_skilllevel}+(@{Skill_FIELD_TYPE_attribute_select}) - d@{dice}]]"></button>
|
||||
</fieldset>
|
||||
<!--FIELD_TYPE -->
|
||||
<fieldset class="repeating_FIELD_TYPE-skills">
|
||||
<input class="sheet-skill_name" type="text" name="attr_FIELD_TYPE_skillname" />
|
||||
<input type="number" name="attr_FIELD_TYPE_skillcost" />
|
||||
<input type="number" min="-10" max="10" name="attr_FIELD_TYPE_skilllevel" />
|
||||
<select class="sheet-skill_select" name="attr_FIELD_TYPE_attribute_select">
|
||||
<option value="@{base-Force} + @{exal-Force}">For</option>
|
||||
<option value="@{base-Agilite} + @{exal-Agilite}">Agi</option>
|
||||
<option value="@{base-Perception} + @{exal-Perception}">Per</option>
|
||||
<option value="@{base-Charisme} + @{exal-Charisme}">Cha</option>
|
||||
<option value="@{base-Intelligence} + @{exal-Intelligence}">Int</option>
|
||||
<option value="@{base-Perception} + @{exal-Perception}">Per</option>
|
||||
<option value="@{base-Volonte} + @{exal-Volonte}">Vol</option>
|
||||
<option value="@{base-Psyche} + @{exal-Psyche}">Psy</option>
|
||||
<option value="@{base-Chance} + @{exal-Chance}">Chn</option>
|
||||
</select>
|
||||
<button type='roll' class="sheet-skillbutton" value="/e rolls @{FIELD_TYPE_skillname} [[@{FIELD_TYPE_skilllevel}+(@{Skill_FIELD_TYPE_attribute_select}) - d@{dice}]]"></button>
|
||||
</fieldset>
|
||||
|
|
|
|||
28
crit.js
28
crit.js
|
|
@ -59,7 +59,7 @@ if(msg.type == "api" && msg.content.indexOf("!crit ") !== -1) {
|
|||
|
||||
function reroll(who,d_vars){
|
||||
//Upgrade the results with a reroll
|
||||
if (d_vars.relances==0) return show_rolls(who,d_vars);
|
||||
if (d_vars.relances==0) return cleaveit(who,d_vars);
|
||||
var msg_roll="/roll "+d_vars.relances+"d"+(10-d_vars.perfection);
|
||||
var rerolls=[];
|
||||
sendChat(who,msg_roll,function(ops) {
|
||||
|
|
@ -69,20 +69,29 @@ function reroll(who,d_vars){
|
|||
};
|
||||
|
||||
//Merge the rerolls to the results, then drop the d_vars.rerolls lower ones (this method is equivalent to n consecutives rerolls)
|
||||
for(var i=0;i<d_vars.relances ; i++){
|
||||
for(i=0;i<d_vars.relances ; i++){
|
||||
// Find the smallest element and Place the reroll in it's place
|
||||
d_vars.results[indexOfSmallest(d_vars.results)]=rerolls[i];
|
||||
}
|
||||
};
|
||||
|
||||
// Now we can split the cleave from the rolls
|
||||
if (d_vars.fauchage!=0){
|
||||
d_vars.cleave=d_vars.results.splice(d_vars.results.length-d_vars.fauchage).sort(function(a, b){return a-b});
|
||||
}
|
||||
d_vars.results.sort(function(a, b){return a-b});
|
||||
//logit(d_vars.results);
|
||||
show_rolls(who,d_vars);
|
||||
cleaveit(who,d_vars);
|
||||
});
|
||||
}
|
||||
|
||||
function cleaveit(who,d_vars){
|
||||
//Now all we have to do is cleave and show the results
|
||||
if (d_vars.fauchage!=0){
|
||||
d_vars.cleave=d_vars.results.splice(d_vars.results.length-d_vars.fauchage);
|
||||
d_vars.cleave.sort(function(a, b){return a-b});
|
||||
}
|
||||
d_vars.results.sort(function(a, b){return a-b});
|
||||
//logit(d_vars.results);
|
||||
//logit(d_vars.cleave);
|
||||
|
||||
//Finally we can show the results
|
||||
show_rolls(who,d_vars);
|
||||
}
|
||||
function indexOfSmallest(a) {
|
||||
var lowest = 0;
|
||||
for (var i = 1; i < a.length; i++) {
|
||||
|
|
@ -211,6 +220,7 @@ function show_rolls(who,d_vars){
|
|||
}
|
||||
|
||||
function add_thoose_dices(d_vars,results,name,m_esq,m_crit){
|
||||
logit(results);
|
||||
var dices="<tr><td> "+name;
|
||||
var is_below=0,is_acrit=0;
|
||||
var sum=0;
|
||||
|
|
|
|||
1058
feuille_sysd10.html
1058
feuille_sysd10.html
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue