import NormalDoor from 'entities/Door';
import state from 'state';
import finish from 'finish';
import action from 'action';
import { changeScene } from 'currentScene';
import entrance from 'scenes/circleBurger/entrance';

export default class Door extends NormalDoor {
  actions() {
    return [
      action(this.actionName, () => {
        changeScene(this.destination);
        state.currentTime.add(Math.floor((Math.random() * 5) + 1), 'minutes');
      }),

      action("Lock the door. (This ends the game. You can't go back.)", () => {
        state.doorLocked = true;

        if (this.destination === entrance) {
          state.lockedIn = true;
        }

        if (state.currentTime.isBefore(state.closingTime.clone().subtract(5, 'minutes'))) {
          state.closedEarly = true;
        }

        if (state.currentTime.isAfter(
              state.closingTime.clone().add(1, 'hour')
            )) {
          state.closedLate = true;
        }

        finish();
      })
    ];
  }
};

@@ -529,32 +529,152 @@
 ack.)%22, () =%3E %7B%0A
+        if(confirm(%22Closing the Circle Burger ends the day.%5Cn%5CnAre you sure you've done enough to keep your job?%22)) %7B%0A  
         state.do
@@ -691,16 +691,18 @@
  true;%0A%0A
+  
         
@@ -744,24 +744,26 @@
 %7B%0A          
+  
 state.locked
@@ -765,32 +765,34 @@
 ockedIn = true;%0A
+  
         %7D%0A%0A     
@@ -786,32 +786,34 @@
      %7D%0A%0A        
+  
 if (state.curren
@@ -882,32 +882,34 @@
 ))) %7B%0A          
+  
 state.closedEarl
@@ -910,32 +910,34 @@
 edEarly = true;%0A
+  
         %7D%0A%0A     
@@ -931,32 +931,34 @@
      %7D%0A%0A        
+  
 if (state.curren
@@ -978,32 +978,34 @@
 (%0A              
+ 
+ 
 state.closingTim
@@ -1041,21 +1041,25 @@
         
+  
 )) %7B%0A
+  
         
@@ -1085,35 +1085,39 @@
 = true;%0A        
+  
 %7D%0A%0A
+  
         finish()
@@ -1118,16 +1118,26 @@
 nish();%0A
+        %7D%0A
       %7D)

Add confirm on end game door