Simplified Bonus-Output

This commit is contained in:
Oliver Rümpelein 2014-10-18 18:28:18 +02:00
parent d315d38c39
commit 8c7a8f9777

View file

@ -298,40 +298,26 @@
sel_bon: function() {
var outstr="<p>";
outstr += "Boni?<br>";
outstr += "Waffenbonus Nahkampf: <input id='wbn' type=numer step=1 min=0></input><br />";
outstr += "Waffenbonus Fernkampf: <input id='wbf' type=numer step=1 min=0></input><br>";
outstr += "Panzerungsbonus: <input id='pb' type=numer step=1 min=0></input><br>";
outstr += "Zauberbonus: <input id='zb' type=numer step=1 min=0></input><br>";
outstr += "Waffenbonus Nahkampf: <input id='wbn' class='bon' type=numer step=1 min=0></input><br />";
outstr += "Waffenbonus Fernkampf: <input id='wbf' class='bon' type=numer step=1 min=0></input><br>";
outstr += "Panzerungsbonus: <input id='pb' class='bon' type=numer step=1 min=0></input><br>";
outstr += "Zauberbonus: <input id='zb' class='bon' type=numer step=1 min=0></input><br>";
$('#uibon').html(outstr);
$('#wbn').attr("value", cur_sel.extern.weapon_near+"")
.bind("change",
function() {cur_sel.extern.weapon_near = this.value*1;
$('.bon').bind("change", function() {
cur_sel.extern.weapon_near = $('#wbn').val()*1;
cur_sel.extern.weapon_far = $('#wbf').val()*1;
cur_sel.extern.armor = $('#pb').val()*1;
cur_sel.extern.chant = $('#zb').val()*1;
cur_sel.recalc_battle();
cur_sel.sel_att();
cur_sel.printoutput();
}
);
$('#wbf').attr("value", cur_sel.extern.weapon_far)
.bind("change",
function() {cur_sel.extern.weapon_far = this.value*1;
cur_sel.recalc_battle();
cur_sel.printoutput();
}
);
$('#pb').attr("value",cur_sel.extern.armor)
.bind("change",
function() {cur_sel.extern.armor = this.value*1;
cur_sel.recalc_battle();
cur_sel.printoutput();
}
);
$('#zb').attr("value",cur_sel.extern.chant)
.bind("change",
function() {cur_sel.extern.chant = this.value*1;
cur_sel.recalc_battle();
cur_sel.printoutput();
}
);
});
$('#wbn').attr("value", cur_sel.extern.weapon_near+"");
$('#wbf').attr("value", cur_sel.extern.weapon_far);
$('#pb').attr("value",cur_sel.extern.armor);
$('#zb').attr("value",cur_sel.extern.chant);
},
printoutput: function() {
outstr = "<p>";