<commit_before>var index = require ('./views/index.hbs')
var Enemy = require ('./enemy.js')
var Player = require ('./player.js')

document.addEventListener('DOMContentLoaded', start)

//proof of concept below


function start(){
  var target = document.getElementById('body')
  target.innerHTML = index({story: 'This is the story.'})

  var introduction = function(){
    indexIntro ++
    var target = document.getElementById('story-text')
    target.innerHTML = introArray[indexIntro]

    if (indexIntro == 2){
      introButton.removeEventListener('click', introduction)
      introButton.addEventListener('click', beginAdventure)
    }
   };

    var beginAdventure = function(){
      if(!battling){
      var target = document.getElementById('story-text')
      var battleText = "we are battling like champions! <br> enemy's health: " + testEnemy.health + " player's health: " + player.health
      target.innerHTML = battleText
      battling = true
      }
    }


    var attackButton = document.getElementById("attackButton")
    attackButton.addEventListener("click", function() {
      if(battling){
        player.attack(testEnemy)
        if(testEnemy.health <= 0){
          enemyDead = true
        }
        var target = document.getElementById('story-text')
        var battleText = "we are battling like champions! <br> enemy's health: " + testEnemy.health + " player's health: " + player.health
        if(enemyDead){
          battleText += "<br> the enemy has been slain!"
          battling = false
        }
        target.innerHTML = battleText
     }
    })



  var enemyDead = false
  var battling = false
  var introButton = document.getElementById("introButton")
  console.log('i am a button', introButton)
  introButton.addEventListener('click', introduction);
  var player = new Player({health: 1000,  minAttackPower: 50, maxAttackPower: 75})
  var testEnemy = new Enemy({health: 650,  minAttackPower: 15, maxAttackPower: 20})


  var introArray = ['this is part one', 'this is part 2', 'this is part 3']
  var indexIntro = -1
}

// function attack() {
//   var damage = Math.floor(Math.random() * 10)
//   console.log("You did " + damage + " damage!")
// }<commit_msg>tagged all over the console<commit_after>var index = require ('./views/index.hbs')
var Enemy = require ('./enemy.js')
var Player = require ('./player.js')

document.addEventListener('DOMContentLoaded', start)

//proof of concept below


function start(){
  var target = document.getElementById('body')
  target.innerHTML = index({story: 'This is the story.'})


  var introduction = function(){
    indexIntro ++
    var target = document.getElementById('story-text')
    target.innerHTML = introArray[indexIntro]

    if (indexIntro == 2){
      introButton.removeEventListener('click', introduction)
      introButton.addEventListener('click', beginAdventure)
    }
   };

    var beginAdventure = function(){
      if(!battling){
      var target = document.getElementById('story-text')
      var battleText = "we are battling like champions! <br> enemy's health: " + testEnemy.health + " player's health: " + player.health
      target.innerHTML = battleText
      battling = true
      }
    }


    var attackButton = document.getElementById("attackButton")
    attackButton.addEventListener("click", function() {
      if(battling){
        player.attack(testEnemy)
        if(testEnemy.health <= 0){
          enemyDead = true
        }
        var target = document.getElementById('story-text')
        var battleText = "we are battling like champions! <br> enemy's health: " + testEnemy.health + " player's health: " + player.health
        if(enemyDead){
          battleText += "<br> the enemy has been slain!"
          battling = false
        }
        target.innerHTML = battleText
     }
    })



  var enemyDead = false
  var battling = false
  var introButton = document.getElementById("introButton")
  console.log('i am a button', introButton)
  introButton.addEventListener('click', introduction);
  var player = new Player({health: 1000,  minAttackPower: 50, maxAttackPower: 75})
  var testEnemy = new Enemy({health: 650,  minAttackPower: 15, maxAttackPower: 20})

  console.log("Scrundgy was here 2016");

  var introArray = ['this is part one', 'this is part 2', 'this is part 3']
  var indexIntro = -1
}
{'fraction_non_alphanumeric': 0.12514430847379357, 'fraction_numerical': 0.010621103671207574, 'mean_word_length': 3.2263414634146343, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3561668', 'n_tokens_mistral': 1292, 'n_tokens_neox': 1216, 'n_words': 340}