/** * Author: Josiah Yoder et al. * Class: SE1011-011 * Date: 10/30/13 8:44 AM * Lesson: Week 7, Day 1 * * This program relies on the Die class, which you wrote for Lab7. * See http://msoe.us/taylor/se1011/Lab7 for the UML diagram and specification. */ import javax.swing.JOptionPane; public class Lab7State011_8_2 { int enemy=15; int health=15; int enemyRoll; int playerRoll; String input; Die enemyHit=new Die(100); Die hitChance=new Die(100); Die enemyAI=new Die(2); public void playerAttacksEnemyAttacks() { JOptionPane.showMessageDialog(null, "The enemy attacks!"); enemyRoll=enemyHit.roll(); playerRoll=hitChance.roll(); JOptionPane.showMessageDialog(null, "The enemy rolls " + enemyRoll + " and you roll a " + playerRoll + "."); if(enemyRoll>playerRoll){ //enemy wins roll health-=5; JOptionPane.showMessageDialog(null, "The enemy hits you for 5 damage!"); } else if (enemyRollplayerRoll){ //enemy wins roll health-=2; JOptionPane.showMessageDialog(null, "The enemy hits you for 2 damage!"); } else if(enemyRollplayerRoll){ //enemy wins roll health-=1; JOptionPane.showMessageDialog(null, "The enemy hits you for 1 damage!"); } else if (enemyRollplayerRoll){ //enemy wins roll health-=1; JOptionPane.showMessageDialog(null, "The enemy hits you for 1 damage!"); } else if(enemyRoll