src/scripts/combat.js
//creates a list of active effects for combat display
creates a list of active effects for combat display
creates a list of active effects for combat display
printCombatEffects(char) {
  let list=[];
  if(char.isKnockedOut()) { 
    list.push('knocked out');
  } else {
    let effects = char.Effects.getAllIds();
    for(let i=0; i<effects.length; i++) {
      let effect = char.Effects.get(effects[i]);
      if(effect.onCombatEnd!==null && effect.onCombatEnd!==undefined) {
        list.push(effect.shortDesc);
      }
    }
  }
  return(list.reduce((sum, current) => sum + current +', ', ''));
}
printCombatEffects ( char ) { let list = [ ] ; if ( char . isKnockedOut ( ) ) { list . push ( 'knocked out' ) ; } else { let effects = char . Effects . getAllIds ( ) ; for ( let i = 0 ; i < effects . length ; i ++ ) { let effect = char . Effects . get ( effects [ i ] ) ; if ( effect . onCombatEnd !== null && effect . onCombatEnd !== undefined ) { list . push ( effect . shortDesc ) ; } } } return ( list . reduce ( ( sum , current ) => sum + current + ', ' , '' ) ) ; }
creates a list of active effects for combat display
creates a list of active effects for combat display
//if char is dead print this instead other effects; effects also get not updated when dead??