src/scripts/combat.js
//prints a table with all player/enemy data
prints a table with all player/enemy data
prints a table with all player / enemy data
printStats() {
  let s=window.story.state;
  let players = (s.combat.playerParty);
  let enemys = (s.combat.enemyParty);
 let elmt = '<table id=\"combatstats\"><tbody>';
  elmt += "<tr><th>Player</th><th>Health</th><th>Arousal</th><th>Energy</th><th>Will</th><th>   </th><th>Enemys</th><th>Health</th><th>Arousal</th><th>Energy</th><th>Will</th></tr>";
  for(let i=0;(i<players.length || i<enemys.length);i++) {
    elmt += "<tr>";
    if(i<players.length) {
      elmt += this.statsline(players[i],s.combat.actor && s.combat.actor.name==players[i].name);
    } else {
      elmt += "<td></td><td></td><td></td><td></td><td></td>";
    }
    if(i<enemys.length) {
      elmt += "<td></td>"+this.statsline(enemys[i],s.combat.actor==enemys[i]);
    } else {
      elmt += "<td></td><td></td><td></td><td></td><td></td><td></td>";
    }
    elmt += "</tr><tr>";
    if(i<players.length) { 
      elmt += "<td></td><td colspan='3' style=\"font-size:smaller\">"+window.gm.Encounter.printCombatEffects(players[i])+"</td>";
    } else {
      elmt += "<td></td><td></td><td></td><td></td><td></td>";
    }
    if(i<enemys.length) {
      elmt += "<td></td><td></td><td colspan='3' style=\"font-size:smaller\">"+window.gm.Encounter.printCombatEffects(enemys[i])+"</td>";
    } else {
      elmt += "<td></td><td></td><td></td><td></td><td></td><td></td>";
    }
    elmt += "</tr>";
  }
  elmt +='</tbody></table>'
  return(elmt);
}
printStats ( ) { let s = window . story . state ; let players = ( s . combat . playerParty ) ; let enemys = ( s . combat . enemyParty ) ; let elmt = '<table id=\"combatstats\"><tbody>' ; elmt += "<tr><th>Player</th><th>Health</th><th>Arousal</th><th>Energy</th><th>Will</th><th>   </th><th>Enemys</th><th>Health</th><th>Arousal</th><th>Energy</th><th>Will</th></tr>" ; for ( let i = 0 ; ( i < players . length || i < enemys . length ) ; i ++ ) { elmt += "<tr>" ; if ( i < players . length ) { elmt += this . statsline ( players [ i ] , s . combat . actor && s . combat . actor . name == players [ i ] . name ) ; } else { elmt += "<td></td><td></td><td></td><td></td><td></td>" ; } if ( i < enemys . length ) { elmt += "<td></td>" + this . statsline ( enemys [ i ] , s . combat . actor == enemys [ i ] ) ; } else { elmt += "<td></td><td></td><td></td><td></td><td></td><td></td>" ; } elmt += "</tr><tr>" ; if ( i < players . length ) { elmt += "<td></td><td colspan='3' style=\"font-size:smaller\">" + window . gm . Encounter . printCombatEffects ( players [ i ] ) + "</td>" ; } else { elmt += "<td></td><td></td><td></td><td></td><td></td>" ; } if ( i < enemys . length ) { elmt += "<td></td><td></td><td colspan='3' style=\"font-size:smaller\">" + window . gm . Encounter . printCombatEffects ( enemys [ i ] ) + "</td>" ; } else { elmt += "<td></td><td></td><td></td><td></td><td></td><td></td>" ; } elmt += "</tr>" ; } elmt += '</tbody></table>' return ( elmt ) ; }
prints a table with all player/enemy data
prints a table with all player / enemy data
/*
              Health  Arousal          Health  Arousal 
      player1 10/20   10/20      Ork1  10/10   10/10
              Stunned
      player2 50/100  10/20      Ork2  20/20   10/100
  */ //effects as additional row