\n',
@@ -413,10 +415,11 @@ function startNewRound() {
// sort combatants by ini value and add contextual classes
function sortTable() {
- // do some clean up: remove previous classes from rows, disable act buttons, remove effective ini and damage badges
+ // do some clean up: remove previous classes from rows, remove effective ini and damage badges
$(".combatant-row").removeClass("ko-or-dead max-ini zero-ini"); //REGULAR_INI
- $(".combatant-row").find(".act-button").prop("disabled", true).attr("aria-disabled", "true");
$(".combatant-ini").empty();
+ // disable all act buttons
+ $(".combatant-row").find(".act-button").prop("disabled", true).attr("aria-disabled", "true");
// mark KO or death with class
$(".combatant-row").each(function() {
if (parseInt($(this).attr("data-damage-stun")) == 10 || parseInt($(this).attr("data-damage-physical")) == 10) {
@@ -440,16 +443,16 @@ function sortTable() {
$(this).find(".combatant-ini").append($.parseHTML(PHYSICAL_BADGE_HTML));
$(this).find(".physical-badge").append(DAMAGE_NIVEAU[DAMAGE_PENALTY[$(this).attr("data-damage-physical")]]);
}
- // K.O./dead -> don't add anything
+ // K.O./dead -> do nothing
if ($(this).hasClass("ko-or-dead")) {
return true;
}
- // ini = zero
+ // ini = zero -> set contextual class
if (parseInt($(this).find(".combatant-ini").text()) == 0) {
$(this).addClass("zero-ini");
return true;
}
- // ini = max and non-zero
+ // ini = max and non-zero -> enable act-button
if (parseInt($(this).find(".combatant-ini").text()) == iniMax && iniMax > 0) {
$(this).addClass("max-ini").find(".act-button").prop("disabled", false).removeAttr("aria-disabled");
return true;