Browse files

Added a win message.

  • Loading branch information...
1 parent d0ef046 commit 5fe7d9da3308d7b48a309881ff310c8bc8c2c40c @grnt426 committed Apr 28, 2012
Showing with 14 additions and 2 deletions.
  1. +3 −1 src/Model.java
  2. +11 −1 src/View.java
View
4 src/Model.java
@@ -103,8 +103,10 @@ public void start() {
}
public void nextMission(){
- if(current_mission.getMissionNumber() == mission_count)
+ if(current_mission.getMissionNumber() == mission_count){
+ current_mission = null;
return;
+ }
current_mission = missions.get(current_mission.getMissionNumber());
reset();
}
View
12 src/View.java
@@ -34,6 +34,8 @@
JTextArea messageBox = new JTextArea(8, 80);
JButton nextControl = new JButton("Next");
+ private boolean won = false;
+
public View(Model m) {
this.model = m;
@@ -158,11 +160,19 @@ public void actionPerformed(ActionEvent e) {
});
nextControl.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
- if(model.getVictory()){
+ if(model.getVictory() && !won){
runControl.setText("Run!");
model.clearMoveList();
moveTextList.setText("");
model.nextMission();
+ if(model.getCurrentMission() == null && !won){
+ appendMessage("You WIN! Unfortunately, Arford Clex is"
+ + " an incompetent evil mastermind bent on world"
+ + " major projectification. You have turned all"
+ + " peoples on this planet into\nfailed major projects."
+ + " Congrats, you fucker.");
+ won = true;
+ }
}
}
});

0 comments on commit 5fe7d9d

Please sign in to comment.