Advertisement
Mr-A

OPAE's Special EXE

Aug 30th, 2013
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 91.93 KB | None | 0 0
  1. import pygame
  2. from pygame.locals import*
  3. import os, sys, time
  4. import webbrowser
  5.  
  6. ###################################
  7. #By A-MAN/Team-A                  #                        
  8. #All rights reserved (c)2013-2014 #
  9. #One Piece A-Edition              #
  10. #I AM HUNGRY!                     #
  11. ###################################
  12.  
  13.  
  14.  
  15. class ExtraMenu:
  16.     def Opening_Video(self):
  17.         self.warp()
  18.        
  19.  
  20.  
  21.  
  22.  
  23.     def getunlockedlist(self):
  24.         datatxt = open(self.datxtdir)
  25.         a = datatxt.read()
  26.         unlockedlist= []
  27.         characters = ["Luffyn", "Zoron", "Sanjin", "Lucci", "Ussop", "Jinbe", "Ace", "Enel", "Aokiji", "Kuma", "Mihawk", "Whitebeard", "Shanks", "Pacifista", "SetA", "SetB", "SetC", "SetE", "Arlong", "Crocodile", "Marco", "Kizaru"]
  28.         chardict = {"Luffyn": "data\\OP\\LUFFY.dat",
  29.                     "Zoron": "data\\OP\\zoro.dat",
  30.                     "Sanjin": "data\\OP\\sanji.dat",
  31.                     "Lucci": "data\\OP\\lucci.dat",
  32.                     "Ussop": "data\\OP\\USSP.dat",
  33.                     "Jinbe": "data\\OP\\jinbei.dat",
  34.                     "Ace": "data\\OP\\Ace.dat",
  35.                     "Enel": "data\\OP\\enel.dat",
  36.                     "Aokiji": "file: data\\OP\\Aokiji.dat",
  37.                     "Kuma": "data\\OP\\KUM.dat",
  38.                     "Mihawk": "data\\OP\\dracule_mihawk.dat",
  39.                     "Whitebeard": "file: data\\OP\\whitebeard.dat",
  40.                     "Shanks": "file: data\\OP\\shks.dat",
  41.                     "Arlong": "file: data\\OP\\Arlong.dat",
  42.                     "Crocodile": "file: data\\OP\\sirc.dat",
  43.                     "Marco": "data\\OP\\MRKPHX.dat",
  44.                     "Kizaru": "file: data\\OP\\Kizaru.dat",
  45.                     "Pacifista": "data\\OP\\enemi4.dat",
  46.                     "SetA": "data\\OP\\enemi1.dat",
  47.                     "SetB": "data\\OP\\enemi2.dat",
  48.                     "SetC": "data\\OP\\enemi3.dat",
  49.                     "SetE": "data\\OP\\enemi5.dat"}
  50.         for b in characters:
  51.             if chardict[b] in a:
  52.                 unlockedlist.append(b)
  53.         return unlockedlist
  54.  
  55.  
  56.  
  57.        
  58.  
  59.     def __init__(self):
  60.         pygame.init()
  61.         pygame.display.set_caption("One Piece A-Edition Demo 1.8")
  62.         pygame.mixer.init()
  63.         pygame.mouse.set_visible(True)
  64.         self.MainSurf = pygame.display.set_mode((794, 550), pygame.DOUBLEBUF, 32)
  65.         self.passcodesset = {'%1' : 'berry',
  66.                              '%2' : 'champion',
  67.                              '%3' : 'face',
  68.                              '%4' : 'shirt',
  69.                              '%5' : 'grill',
  70.                              '%6' : 'bottle',
  71.                              '%7' : 'fujitora',
  72.                              '%33' : 'face2',
  73.                              '%77' : 'fujitora2',
  74.                              '%110' : 'mountain2',
  75.                              '%130' : 'xkdpxtqxq2',
  76.                              '%14' : 'xkdpxtqxq3',
  77.                              '%8' : 'apple',
  78.                              '%9' : 'panda',
  79.                              '%10' : 'mountain',
  80.                              '%11' : 'kirby',
  81.                              '%12' : 'moshimoshi',
  82.                              '%13' : 'xkdpxtqxq'}
  83.        
  84.         self.unlines = {'shirt' : "id:  8  type: 0  file: data\\OP\\lucci.dat",
  85.                         'champion': "id:  13  type: 0  file: data\\OP\\USSP.dat",
  86.                         'bottle' : "id:  7  type: 0  file: data\\OP\\jinbei.dat",
  87.                         'grill'  : "id:  11  type: 0  file: data\\OP\\Ace.dat",
  88.                         'face' : "id:  5  type: 0  file: data\\OP\\enel.dat",
  89.                         'fujitora'  : "id:  14  type: 0  file: data\\OP\\Aokiji.dat",
  90.                         'panda'   : "id:  4 type: 0  file: data\\OP\\KUM.dat",
  91.                         'face2'   : "id:  450 type: 0  file: data\\OP\\enemi2.dat",
  92.                         'fujitora2'   : "id:  450 type: 0  file: data\\OP\\enemi3.dat",
  93.                         'mountain2'   : "id:  450 type: 0  file: data\\OP\\enemi4.dat",
  94.                         'xkdpxtqxq3'   :  "id:  1  type: 0  file: data\\OP\\dracule_mihawk.dat",
  95.                         'mountain'   : "id:  12  type: 0  file: data\\OP\\whitebeard.dat",
  96.                         'xkdpxtqxq'   : "id:  15  type: 0  file: data\\OP\\shks.dat",
  97.                         'xkdpxtqxq2'   : "id:  450 type: 0  file: data\\OP\\enemi5.dat",
  98.                          "berry": "id:  19 type: 0  file: data\\OP\\Arlong.dat",
  99.                     "apple": "id:  17 type: 0  file: data\\OP\\sirc.dat",
  100.                     "kirby": "id:  16 type: 0  file: data\\OP\\MRKPHX.dat",
  101.                     "moshimoshi": "id:  18 type: 0  file: data\\OP\\Kizaru.dat"}
  102.         self.passcodes = ['berry', 'champion', 'face', 'shirt', 'grill', 'bottle', 'fujitora', 'apple', 'panda', 'mountain', 'kirby', 'moshimoshi', 'xkdpxtqxq']
  103.  
  104.  
  105.                        
  106.                        
  107.         self.AlphaSurf = self.MainSurf.convert_alpha()
  108.         self.AlphaSurfrect = self.AlphaSurf.get_rect()
  109.         self.AlphaSurfrect.center =  self.MainSurf.get_rect().center
  110.         self.bgcolor  = (0, 0, 0, 255)
  111.         self.datxtdir = os.path.join(os.getcwd(), "data", "data.txt")
  112.         self.imgdir   = os.path.join(os.getcwd(),"nsys\\")
  113.         self.bgpic    = pygame.image.load(self.imgdir + "bg.PNG")
  114.         self.shopkeeper1= pygame.image.load(self.imgdir + "shopkeeper1.PNG")
  115.         self.table= pygame.image.load(self.imgdir + "table.PNG")
  116.         self.tablebdy= self.table.get_rect()
  117.         self.writbox= pygame.image.load(self.imgdir + "a.PNG")
  118.         self.inst= pygame.image.load(self.imgdir + "inst2.PNG")
  119.         self.writboxbdy= self.writbox.get_rect()
  120.         self.colorkey = self.writbox.get_at((abs(self.writboxbdy.height/2),abs(self.writboxbdy.width/20)))
  121.         self.writboxbdy.center = self.MainSurf.get_rect().center
  122.         self.tablebdy.centerx = self.MainSurf.get_rect().centerx
  123.         self.tablebdy.bottom = self.MainSurf.get_rect().bottom
  124.         self.shopkeeper1bdy= self.shopkeeper1.get_rect()
  125.         self.shopkeeper1bdy.centerx = self.MainSurf.get_rect().centerx + 210
  126.         self.shopkeeper1bdy.centery = self.MainSurf.get_rect().centery + 105
  127.         self.shopkeeper1.set_colorkey((0, 0, 255))
  128.         self.inst.set_colorkey((0, 0, 255))
  129.         self.bgpicbdy = self.bgpic.get_rect()
  130.         self.instbdy = self.inst.get_rect()
  131.         self.instbdy.center =(self.MainSurf.get_rect().centerx, self.MainSurf.get_rect().centery-220)
  132.         self.bgpicbdy.center = self.MainSurf.get_rect().center
  133.         self.MainSurf.fill(self.bgcolor)
  134.         self.Clock = pygame.time.Clock()
  135.         self.FPS = 25
  136.        
  137.         self.PassFont = pygame.font.SysFont(None, 33)
  138.         self.PassCode = ''
  139.         self.ChkPass = False
  140.  
  141.  
  142.     def end(self):
  143.         pygame.display.update()
  144.         self.Clock.tick(self.FPS)
  145.  
  146.        
  147.                
  148.     def Close(self):
  149.         pygame.quit()
  150.         sys.exit()
  151.  
  152.  
  153.  
  154.  
  155.     def start(self):
  156.         intro= pygame.image.load(self.imgdir + "intro1.PNG")
  157.         introbdy = intro.get_rect()
  158.         introbdy.center = self.MainSurf.get_rect().center
  159.         intro2= pygame.image.load(self.imgdir + "intro2.PNG")
  160.         setintro1 = True
  161.         setintro2 = False
  162.         dofade = True
  163.         timeh1 = None
  164.         INTRO = False
  165.         while INTRO == False:
  166.            
  167.             if dofade == True:
  168.                 for a in range(11):
  169.                     self.MainSurf.blit(intro, introbdy)
  170.                     self.MainSurf.blit(self.AlphaSurf, self.AlphaSurfrect)
  171.                    
  172.                     pygame.draw.rect(self.AlphaSurf, (255, 255, 255, 255 - (a*25+5)), (0, 0, 800, 600))
  173.  
  174.                     dofade= False
  175.                     pygame.display.update()
  176.                     self.Clock.tick(self.FPS)
  177.                     self.MainSurf.fill((0, 0, 0, 0))
  178.                     timeh1 = time.time()
  179.                     for event in pygame.event.get():
  180.                         if event.type == QUIT:
  181.                             self.Close()
  182.             for event in pygame.event.get():
  183.                 if event.type == QUIT:
  184.                     self.Close()
  185.             self.MainSurf.blit(intro, introbdy)
  186.             pygame.display.update()
  187.             self.Clock.tick(self.FPS)
  188.             self.MainSurf.fill((0, 0, 0, 0))
  189.             timeh2 = time.time()
  190.             if timeh2 - timeh1 > 1.5:
  191.                 for a in range(11):
  192.                     self.MainSurf.blit(intro, introbdy)
  193.                     self.MainSurf.blit(self.AlphaSurf, self.AlphaSurfrect)
  194.                    
  195.                     pygame.draw.rect(self.AlphaSurf, (255, 255, 255, a*25+5), (0, 0, 800, 600))
  196.  
  197.                     dofade= False
  198.                     pygame.display.update()
  199.                     self.Clock.tick(self.FPS)
  200.                     self.MainSurf.fill((0, 0, 0, 0))
  201.                     timeh1 = time.time()
  202.                     for event in pygame.event.get():
  203.                         if event.type == QUIT:
  204.                             self.Close()
  205.                 for a in range(11):
  206.                     self.MainSurf.blit(intro2, introbdy)
  207.                     self.MainSurf.blit(self.AlphaSurf, self.AlphaSurfrect)
  208.                    
  209.                     pygame.draw.rect(self.AlphaSurf, (255, 255, 255, 255-(a*25+5)), (0, 0, 800, 600))
  210.  
  211.                     dofade= False
  212.                     pygame.display.update()
  213.                     self.Clock.tick(self.FPS)
  214.                     self.MainSurf.fill((0, 0, 0, 0))
  215.                     timeh1 = time.time()
  216.                     for event in pygame.event.get():
  217.                         if event.type == QUIT:
  218.                             self.Close()
  219.                
  220.                 while INTRO == False:
  221.                     dofade = True
  222.                     for event in pygame.event.get():
  223.                         if event.type == QUIT:
  224.                             self.Close()
  225.                     self.MainSurf.blit(intro2, introbdy)
  226.                     pygame.display.update()
  227.                     self.Clock.tick(self.FPS)
  228.                     self.MainSurf.fill((0, 0, 0, 0))
  229.                     timeh2 = time.time()
  230.                     if timeh2 - timeh1 > 1.5:
  231.                         for a in range(11):
  232.                             self.MainSurf.blit(intro2, introbdy)
  233.                             self.MainSurf.blit(self.AlphaSurf, self.AlphaSurfrect)
  234.                            
  235.                             pygame.draw.rect(self.AlphaSurf, (255, 255, 255, a*25+5), (0, 0, 800, 600))
  236.  
  237.                             dofade= False
  238.                             pygame.display.update()
  239.                             self.Clock.tick(self.FPS)
  240.                             self.MainSurf.fill((0, 0, 0, 0))
  241.                             timeh1 = time.time()
  242.                             for event in pygame.event.get():
  243.                                 if event.type == QUIT:
  244.                                     self.Close()
  245.                         INTRO = True
  246.         return
  247.     def warp(self):
  248.         for a in range(11):
  249.            
  250.             self.MainSurf.blit(self.AlphaSurf, self.AlphaSurfrect)
  251.            
  252.             pygame.draw.rect(self.AlphaSurf, (255, 255, 255, a*25+5), (0, 0, 800, 600))
  253.  
  254.             dofade= False
  255.             pygame.display.update()
  256.             self.Clock.tick(self.FPS*3)
  257.             self.MainSurf.fill((0, 0, 0, 0))
  258.             for event in pygame.event.get():
  259.                 if event.type == QUIT:
  260.                     self.Close()
  261.         for a in range(11):
  262.             self.MainSurf.blit(self.AlphaSurf, self.AlphaSurfrect)
  263.            
  264.             pygame.draw.rect(self.AlphaSurf, (255, 255, 255, 255-(a*25+5)), (0, 0, 800, 600))
  265.  
  266.             dofade= False
  267.             pygame.display.update()
  268.             self.Clock.tick(self.FPS*3)
  269.             self.MainSurf.fill((0, 0, 0, 0))
  270.             for event in pygame.event.get():
  271.                 if event.type == QUIT:
  272.                     self.Close()
  273.         return
  274.  
  275.     def credit_slide(self):
  276.         slide_speed = 5
  277.         CREDIT = pygame.image.load(self.imgdir + "CREDIT.PNG").convert()
  278.         CREDIT.set_colorkey((0, 0, 0))
  279.         menuitemsnorml= pygame.image.load(self.imgdir + "MENUITEMS_NONCHOSEN.PNG").convert()
  280.         menuitemsnorml.set_colorkey((0, 0, 0))
  281.         menuitemsbdy  = menuitemsnorml.get_rect()
  282.         menuitemsbdy.centerx = self.MainSurf.get_rect().centerx
  283.         menuitemsbdy.centery = self.MainSurf.get_rect().centery + 80
  284.         CREDIT.set_colorkey((0, 0, 0, 255))
  285.         CREDITbdy = CREDIT.get_rect()
  286.         CREDITbdy.centerx = self.MainSurf.get_rect().centerx
  287.         CREDITbdy.top = self.MainSurf.get_rect().top + self.MainSurf.get_rect().height + 30
  288.         CREDIT_H = CREDITbdy.height
  289.         MenuBG        = pygame.image.load(self.imgdir + "MENU_BG.PNG").convert()
  290.         MenuBG.set_colorkey((0, 0, 0))
  291.         MenuBGbdy  = MenuBG.get_rect()
  292.         MenuBGbdy.center = self.MainSurf.get_rect().center
  293.         self.MainSurf.fill((0, 0, 0))
  294.         pygame.display.flip()
  295.        
  296.  
  297.         while "hungry":
  298.             self.warp()
  299.             for a in range((CREDIT_H/slide_speed)+150):
  300.                 self.MainSurf.blit(CREDIT, CREDITbdy)
  301.                 CREDITbdy.bottom -= slide_speed
  302.                 for event in pygame.event.get():
  303.                     if event.type == QUIT:
  304.                         self.Close()
  305.                     if event.type == KEYDOWN:
  306.                         if event.key == K_ESCAPE:
  307.                             self.warp()
  308.                             return
  309.                 pygame.display.flip()
  310.                 self.Clock.tick(20)
  311.                 self.MainSurf.fill((0, 0, 0))
  312.             self.warp()
  313.             return
  314.        
  315.     def options(self):
  316.         OPTIONS_BG = pygame.image.load(self.imgdir + "OPTIONS_BG.PNG").convert()
  317.         OPTIONS_NONHIGHLIGHTED = pygame.image.load(self.imgdir + "OPTIONITEMS_NONCHOSEN.PNG").convert()
  318.         OPTIONS_NONHIGHLIGHTED.set_colorkey((0, 0, 0))
  319.         OPTIONS_HIGHLIGHTED =  pygame.image.load(self.imgdir + "OPTIONITEMS_CHOSEN.PNG")
  320.         OPTIONS_HIGHLIGHTED.set_colorkey((0, 0, 0))
  321.         opbgb = OPTIONS_BG.get_rect()
  322.         opbgb.center = self.MainSurf.get_rect().center
  323.         opb = OPTIONS_NONHIGHLIGHTED.get_rect()
  324.         opb.center = self.MainSurf.get_rect().center
  325.         opb.centery += 65
  326.         optionitemsindex= [None, (0, 0, 472, 130), (0, 130, 472, 130), (0, 260, 472, 130)]
  327.         menupos = 1
  328.         self.warp()        
  329.         while "retard":
  330.             for event in pygame.event.get():
  331.                 if event.type == QUIT:
  332.                     pygame.quit()
  333.                     sys.exit()
  334.                 if menupos == 1:
  335.                     if event.type == KEYDOWN:
  336.                         if event.key == K_ESCAPE:
  337.                             self.warp()
  338.                             return
  339.                         if event.key == K_DOWN:
  340.                             menupos += 1
  341.                         if event.key == K_RETURN or event.key == K_SPACE:
  342.                             self.controls()
  343.                 elif menupos == 2 and len(self.getunlockedlist()) == 17:
  344.                     if event.type == KEYDOWN:
  345.                         if event.key == K_ESCAPE:
  346.                             self.warp()
  347.                             return
  348.                         if event.key == K_UP:
  349.                             menupos -= 1
  350.                         if event.key == K_RETURN or event.key == K_SPACE:
  351.                             self.recording_toggle()
  352.                 elif menupos == 2 and len(self.getunlockedlist()) != 17:
  353.                     if event.type == KEYDOWN:
  354.                         if event.key == K_ESCAPE:
  355.                             self.warp()
  356.                             return
  357.                         if event.key == K_UP:
  358.                             menupos -= 1
  359.                         if event.key == K_RETURN or event.key == K_SPACE:
  360.                             self.wrongsound()
  361.                 #        if event.key == K_DOWN:
  362.                 #            menupos += 1
  363.                 #elif menupos == 3:
  364.                 #    if event.type == KEYDOWN:
  365.                 #        if event.key == K_ESCAPE:
  366.                 #            self.warp()
  367.                 #            return
  368.                 #        if event.key == K_UP:
  369.                 #            menupos -= 1
  370.             self.MainSurf.blit(OPTIONS_BG, opbgb)
  371.             if menupos == 1:
  372.                 self.MainSurf.blit(OPTIONS_HIGHLIGHTED, opb, area = optionitemsindex[1])
  373.             else:
  374.                 self.MainSurf.blit(OPTIONS_NONHIGHLIGHTED, opb, area = optionitemsindex[1])
  375.  
  376.             if menupos == 2 and len(self.getunlockedlist()) == 22:
  377.                 self.MainSurf.blit(OPTIONS_HIGHLIGHTED, (opb[0], opb[1]+130, opb[2], opb[3]), area = optionitemsindex[2])
  378.             elif menupos == 2 and len(self.getunlockedlist()) != 22:
  379.                 self.MainSurf.blit(OPTIONS_HIGHLIGHTED, (opb[0], opb[1]+130, opb[2], opb[3]), area = optionitemsindex[3])
  380.             elif len(self.getunlockedlist()) != 22:
  381.                 self.MainSurf.blit(OPTIONS_NONHIGHLIGHTED, (opb[0], opb[1]+130, opb[2], opb[3]), area = optionitemsindex[3])
  382.             else:
  383.                 self.MainSurf.blit(OPTIONS_NONHIGHLIGHTED, (opb[0], opb[1]+130, opb[2], opb[3]), area = optionitemsindex[2])
  384.  
  385.            # if menupos == 3:
  386.            #     self.MainSurf.blit(OPTIONS_HIGHLIGHTED, (opb[0], opb[1]+260, opb[2], opb[3]), area = optionitemsindex[3])
  387.            # else:
  388.            #     self.MainSurf.blit(OPTIONS_NONHIGHLIGHTED, (opb[0], opb[1]+260, opb[2], opb[3]), area = optionitemsindex[3])
  389.             pygame.display.update()
  390.             self.MainSurf.fill((0, 0, 0))
  391.  
  392.  
  393.     def how_play(self):
  394.         pygame.mixer.music.load(self.imgdir + 'menu.mp3')
  395.         pygame.mixer.music.play(-1, 0)
  396.         def scrolla(scroll, bdy1, bdy2, pic1, pic2):
  397.             for a in range(10):
  398.                 for event in pygame.event.get():
  399.                     if event.type == QUIT:
  400.                         pygame.quit()
  401.                         sys.exit()
  402.                 if scroll == "Left":
  403.                     bdy1.centerx += self.MainSurf.get_rect().width/10
  404.                     bdy2.centerx += self.MainSurf.get_rect().width/10
  405.                 if scroll == "Right":
  406.                     bdy1.centerx -= self.MainSurf.get_rect().width/10
  407.                     bdy2.centerx -= self.MainSurf.get_rect().width/10
  408.                 if scroll == "Up":
  409.                     bdy1.centery += self.MainSurf.get_rect().height/10
  410.                     bdy2.centery += self.MainSurf.get_rect().height/10
  411.                 if scroll == "Down":
  412.                     bdy1.centery -= self.MainSurf.get_rect().height/10
  413.                     bdy2.centery -= self.MainSurf.get_rect().height/10
  414.                 self.MainSurf.blit(pic1, bdy1)
  415.                 self.MainSurf.blit(pic2, bdy2)
  416.                 pygame.display.update(self.MainSurf.get_rect())
  417.                 self.Clock.tick(self.FPS*2)
  418.                 self.MainSurf.fill((0, 0, 0))
  419.             scroll = None
  420.             return scroll, bdy1, bdy2
  421.        
  422.        
  423.         HOWPLAY_INTRO = pygame.image.load(self.imgdir + "HOWTOPLAY.PNG").convert()
  424.         HOWPLAY_INTRObdy = HOWPLAY_INTRO.get_rect()
  425.         HOWPLAY_INTRObdy.center = self.MainSurf.get_rect().center
  426.         HOWPLAY_FI = pygame.image.load(self.imgdir + "HOWTOPLAY_FI.PNG").convert()
  427.         HOWPLAY_FIbdy = HOWPLAY_FI.get_rect()
  428.         HOWPLAY_FIbdy.centerx = self.MainSurf.get_rect().centerx - self.MainSurf.get_rect().width
  429.         HOWPLAY_FIbdy.centery = self.MainSurf.get_rect().centery
  430.  
  431.         QMiddle = pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "999.PNG").convert()
  432.         QLast = pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "9999.PNG").convert()
  433.  
  434.  
  435.         MVLIST1 = pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "1.PNG").convert()
  436.         MVLIST2 = pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "2.PNG").convert()
  437.         MVLIST3 = pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "3.PNG").convert()
  438.         MVLIST4 = pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "4.PNG").convert()
  439.         MVLIST5 = pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "5.PNG").convert()
  440.         MVLIST6 = pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "6.PNG").convert()
  441.         MVLIST7 = pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "7.PNG").convert()
  442.         MVLIST8 = pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "8.PNG").convert()
  443.         MVLIST9 = pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "9.PNG").convert()
  444.         MVLIST10= pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "10.PNG").convert()
  445.         MVLIST11= pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "11.PNG").convert()
  446.         MVLIST12= pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "12.PNG").convert()
  447.         MVLIST13= pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "13.PNG").convert()
  448.         MVLIST14= pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "14.PNG").convert()
  449.         MVLIST15= pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "15.PNG").convert()
  450.         MVLIST16= pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "16.PNG").convert()
  451.         MVLIST17= pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "17.PNG").convert()
  452.         MVLIST18= pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "18.PNG").convert()
  453.         MVLIST19= pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "19.PNG").convert()
  454.         MVLIST20= pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "20.PNG").convert()
  455.  
  456.         MVLISTS = [MVLIST1, MVLIST2, MVLIST3, MVLIST4, MVLIST5, MVLIST6, MVLIST7, MVLIST8, MVLIST9, MVLIST10,
  457.                    MVLIST11, MVLIST12, MVLIST13, MVLIST14, MVLIST15, MVLIST16, MVLIST17, MVLIST18, MVLIST19, MVLIST20]  
  458.         Charsun = self.getunlockedlist()
  459.         if "Ussop" not in Charsun:
  460.             MVLIST4 = QMiddle
  461.         if "Arlong" not in Charsun:
  462.             MVLIST5 = QMiddle
  463.         if "Crocodile" not in Charsun:
  464.             MVLIST6 = QMiddle
  465.         if "Enel" not in Charsun:
  466.             MVLIST7 = QMiddle
  467.         if "Lucci" not in Charsun:
  468.             MVLIST8 = QMiddle
  469.         if "Jinbe" not in Charsun:
  470.             MVLIST9 = QMiddle
  471.         if "Ace" not in Charsun:
  472.             MVLIST10 = QMiddle
  473.         if "Marco" not in Charsun:
  474.             MVLIST11 = QMiddle
  475.         if "Whitebeard" not in Charsun:
  476.             MVLIST12 = QMiddle
  477.         if "Aokiji" not in Charsun:
  478.             MVLIST13 = QMiddle
  479.         if "Kizaru" not in Charsun:
  480.             MVLIST14 = QMiddle
  481.         if "Kuma" not in Charsun:
  482.             MVLIST15 = QMiddle
  483.         if "Shanks" not in Charsun:
  484.             MVLIST16 = QMiddle
  485.         if "Mihawk" not in Charsun:
  486.             MVLIST17 = QMiddle
  487.         if "Luffyn" not in Charsun:
  488.             MVLIST18 = QMiddle
  489.         if "Sanjin" not in Charsun:
  490.             MVLIST19 = QMiddle
  491.         if "Pacifista" not in Charsun:
  492.             MVLIST20 = QLast
  493.  
  494.         MVLISTBDYS = [None,]
  495.         tempostuff = None
  496.         for a in MVLISTS:
  497.             tempostuff = a.get_rect()
  498.             tempostuff.centery += self.MainSurf.get_rect().height
  499.             MVLISTBDYS.append(tempostuff)
  500.         tempostuff = None
  501.         MVLISTBDYS[1].centery -= self.MainSurf.get_rect().height
  502.         MVLISTBDYS[1].centerx += self.MainSurf.get_rect().width
  503.            
  504.            
  505.         pos = 1
  506.         self.warp()
  507.         scroll = None
  508.         while "bored":
  509.             if pos == 1:
  510.                 while scroll == 'Left':
  511.                     scroll, MVLISTBDYS[1], HOWPLAY_INTRObdy = scrolla(scroll, MVLISTBDYS[1], HOWPLAY_INTRObdy, MVLIST1, HOWPLAY_INTRO)
  512.                    
  513.                 while scroll == 'Right':
  514.                     scroll, HOWPLAY_FIbdy, HOWPLAY_INTRObdy = scrolla(scroll, HOWPLAY_FIbdy, HOWPLAY_INTRObdy, HOWPLAY_FI, HOWPLAY_INTRO)
  515.                    
  516.                 for event in pygame.event.get():
  517.                     if event.type == QUIT:
  518.                         pygame.quit()
  519.                         sys.exit()
  520.                     if event.type == KEYDOWN:
  521.                         if event.key == K_ESCAPE:
  522.                             pygame.mixer.music.stop()
  523.                             self.warp()
  524.                             return
  525.                         if event.key == K_RIGHT:
  526.                             pos += 1
  527.                             scroll = 'Right'
  528.                         if event.key == K_LEFT:
  529.                             pos -= 1
  530.                             scroll = 'Left'
  531.  
  532.  
  533.                 self.MainSurf.fill((0, 0, 0))
  534.                 self.MainSurf.blit(HOWPLAY_INTRO, HOWPLAY_INTRObdy)
  535.                 pygame.display.update()
  536.                 self.Clock.tick(self.FPS+5)
  537.             if pos == 2:
  538.                 while scroll == 'Right':
  539.                     scroll, MVLISTBDYS[1], HOWPLAY_INTRObdy = scrolla(scroll, MVLISTBDYS[1], HOWPLAY_INTRObdy, MVLIST1, HOWPLAY_INTRO)
  540.  
  541.                 while scroll == 'Up':
  542.                     scroll, MVLISTBDYS[1], MVLISTBDYS[2] = scrolla(scroll, MVLISTBDYS[1], MVLISTBDYS[2], MVLIST1, MVLIST2)
  543.                            
  544.                 for event in pygame.event.get():
  545.                     if event.type == QUIT:
  546.                         pygame.quit()
  547.                         sys.exit()
  548.                     if event.type == KEYDOWN:
  549.                         if event.key == K_ESCAPE:
  550.                             self.warp()
  551.                             return
  552.                         if event.key == K_LEFT:
  553.                             pos -= 1
  554.                             scroll = 'Left'
  555.                         if event.key == K_DOWN:
  556.                             pos += 1
  557.                             scroll = 'Down'
  558.                 self.MainSurf.fill((0, 0, 0))
  559.                 self.MainSurf.blit(MVLIST1, MVLISTBDYS[1])
  560.                 pygame.display.update()
  561.                 self.Clock.tick(self.FPS+5)
  562.             if pos == 3:
  563.                 while scroll == 'Down':
  564.                     scroll, MVLISTBDYS[2], MVLISTBDYS[1] = scrolla(scroll, MVLISTBDYS[2], MVLISTBDYS[1], MVLIST2, MVLIST1)
  565.  
  566.                 while scroll == 'Up':
  567.                     scroll, MVLISTBDYS[2], MVLISTBDYS[3] = scrolla(scroll, MVLISTBDYS[2], MVLISTBDYS[3], MVLIST2, MVLIST3)
  568.                            
  569.                 for event in pygame.event.get():
  570.                     if event.type == QUIT:
  571.                         pygame.quit()
  572.                         sys.exit()
  573.                     if event.type == KEYDOWN:
  574.                         if event.key == K_ESCAPE:
  575.                             self.warp()
  576.                             return
  577.                         if event.key == K_DOWN:
  578.                             pos += 1
  579.                             scroll = 'Down'
  580.                         if event.key == K_UP:
  581.                             pos -= 1
  582.                             scroll = 'Up'
  583.                 self.MainSurf.fill((0, 0, 0))
  584.                 self.MainSurf.blit(MVLIST2, MVLISTBDYS[2])
  585.                 pygame.display.update()
  586.                 self.Clock.tick(self.FPS+5)
  587.  
  588.             if pos == 4:
  589.                 while scroll == 'Down':
  590.                     scroll, MVLISTBDYS[3], MVLISTBDYS[2] = scrolla(scroll, MVLISTBDYS[3], MVLISTBDYS[2], MVLIST3, MVLIST2)
  591.  
  592.                 while scroll == 'Up':
  593.                     scroll, MVLISTBDYS[3], MVLISTBDYS[4] = scrolla(scroll, MVLISTBDYS[3], MVLISTBDYS[4], MVLIST3, MVLIST4)
  594.                            
  595.                 for event in pygame.event.get():
  596.                     if event.type == QUIT:
  597.                         pygame.quit()
  598.                         sys.exit()
  599.                     if event.type == KEYDOWN:
  600.                         if event.key == K_ESCAPE:
  601.                             self.warp()
  602.                             return
  603.                         if event.key == K_DOWN:
  604.                             pos += 1
  605.                             scroll = 'Down'
  606.                         if event.key == K_UP:
  607.                             pos -= 1
  608.                             scroll = 'Up'
  609.                 self.MainSurf.fill((0, 0, 0))
  610.                 self.MainSurf.blit(MVLIST3, MVLISTBDYS[3])
  611.                 pygame.display.update()
  612.                 self.Clock.tick(self.FPS+5)
  613.  
  614.             if pos == 5:
  615.                 while scroll == 'Down':
  616.                     scroll, MVLISTBDYS[4], MVLISTBDYS[3] = scrolla(scroll, MVLISTBDYS[4], MVLISTBDYS[3], MVLIST4, MVLIST3)
  617.  
  618.                 while scroll == 'Up':
  619.                     scroll, MVLISTBDYS[4], MVLISTBDYS[5] = scrolla(scroll, MVLISTBDYS[4], MVLISTBDYS[5], MVLIST4, MVLIST5)
  620.                            
  621.                 for event in pygame.event.get():
  622.                     if event.type == QUIT:
  623.                         pygame.quit()
  624.                         sys.exit()
  625.                     if event.type == KEYDOWN:
  626.                         if event.key == K_ESCAPE:
  627.                             self.warp()
  628.                             return
  629.                         if event.key == K_DOWN:
  630.                             pos += 1
  631.                             scroll = 'Down'
  632.                         if event.key == K_UP:
  633.                             pos -= 1
  634.                             scroll = 'Up'
  635.                 self.MainSurf.fill((0, 0, 0))
  636.                 self.MainSurf.blit(MVLIST4, MVLISTBDYS[4])
  637.                 pygame.display.update()
  638.                 self.Clock.tick(self.FPS+5)
  639.  
  640.  
  641.             if pos == 6:
  642.                 while scroll == 'Down':
  643.                     scroll, MVLISTBDYS[5], MVLISTBDYS[4] = scrolla(scroll, MVLISTBDYS[5], MVLISTBDYS[4], MVLIST5, MVLIST4)
  644.  
  645.                 while scroll == 'Up':
  646.                     scroll, MVLISTBDYS[5], MVLISTBDYS[6] = scrolla(scroll, MVLISTBDYS[5], MVLISTBDYS[6], MVLIST5, MVLIST6)
  647.                            
  648.                 for event in pygame.event.get():
  649.                     if event.type == QUIT:
  650.                         pygame.quit()
  651.                         sys.exit()
  652.                     if event.type == KEYDOWN:
  653.                         if event.key == K_ESCAPE:
  654.                             self.warp()
  655.                             return
  656.                         if event.key == K_DOWN:
  657.                            pos += 1
  658.                            scroll = 'Down'
  659.                         if event.key == K_UP:
  660.                             pos -= 1
  661.                             scroll = 'Up'
  662.                 self.MainSurf.fill((0, 0, 0))
  663.                 self.MainSurf.blit(MVLIST5, MVLISTBDYS[5])
  664.                 pygame.display.update()
  665.                 self.Clock.tick(self.FPS+5)
  666.  
  667.  
  668.  
  669.             if pos == 7:
  670.                 while scroll == 'Down':
  671.                     scroll, MVLISTBDYS[6], MVLISTBDYS[5] = scrolla(scroll, MVLISTBDYS[6], MVLISTBDYS[5], MVLIST6, MVLIST5)
  672.  
  673.                 while scroll == 'Up':
  674.                     scroll, MVLISTBDYS[6], MVLISTBDYS[7] = scrolla(scroll, MVLISTBDYS[6], MVLISTBDYS[7], MVLIST6, MVLIST7)
  675.                            
  676.                 for event in pygame.event.get():
  677.                     if event.type == QUIT:
  678.                         pygame.quit()
  679.                         sys.exit()
  680.                     if event.type == KEYDOWN:
  681.                         if event.key == K_ESCAPE:
  682.                             self.warp()
  683.                             return
  684.                         if event.key == K_DOWN:
  685.                             pos += 1
  686.                             scroll = 'Down'
  687.                         if event.key == K_UP:
  688.                             pos -= 1
  689.                             scroll = 'Up'
  690.                 self.MainSurf.fill((0, 0, 0))
  691.                 self.MainSurf.blit(MVLIST6, MVLISTBDYS[6])
  692.                 pygame.display.update()
  693.                 self.Clock.tick(self.FPS+5)
  694.             if pos == 8:
  695.                 while scroll == 'Down':
  696.                     scroll, MVLISTBDYS[7], MVLISTBDYS[6] = scrolla(scroll, MVLISTBDYS[7], MVLISTBDYS[6], MVLIST7, MVLIST6)
  697.  
  698.                 while scroll == 'Up':
  699.                     scroll, MVLISTBDYS[7], MVLISTBDYS[8] = scrolla(scroll, MVLISTBDYS[7], MVLISTBDYS[8], MVLIST7, MVLIST8)
  700.                            
  701.                 for event in pygame.event.get():
  702.                     if event.type == QUIT:
  703.                         pygame.quit()
  704.                         sys.exit()
  705.                     if event.type == KEYDOWN:
  706.                         if event.key == K_ESCAPE:
  707.                             self.warp()
  708.                             return
  709.                         if event.key == K_DOWN:
  710.                             pos += 1
  711.                             scroll = 'Down'
  712.                         if event.key == K_UP:
  713.                             pos -= 1
  714.                             scroll = 'Up'
  715.                 self.MainSurf.fill((0, 0, 0))
  716.                 self.MainSurf.blit(MVLIST7, MVLISTBDYS[7])
  717.                 pygame.display.update()
  718.                 self.Clock.tick(self.FPS+5)
  719.  
  720.                
  721.             if pos == 9:
  722.                 while scroll == 'Down':
  723.                     scroll, MVLISTBDYS[8], MVLISTBDYS[7] = scrolla(scroll, MVLISTBDYS[8], MVLISTBDYS[7], MVLIST8, MVLIST7)
  724.  
  725.                 while scroll == 'Up':
  726.                     scroll, MVLISTBDYS[8], MVLISTBDYS[9] = scrolla(scroll, MVLISTBDYS[8], MVLISTBDYS[9], MVLIST8, MVLIST9)
  727.                            
  728.                 for event in pygame.event.get():
  729.                     if event.type == QUIT:
  730.                         pygame.quit()
  731.                         sys.exit()
  732.                     if event.type == KEYDOWN:
  733.                         if event.key == K_ESCAPE:
  734.                             self.warp()
  735.                             return
  736.                         if event.key == K_DOWN:
  737.                             pos += 1
  738.                             scroll = 'Down'
  739.                         if event.key == K_UP:
  740.                             pos -= 1
  741.                             scroll = 'Up'
  742.                 self.MainSurf.fill((0, 0, 0))
  743.                 self.MainSurf.blit(MVLIST8, MVLISTBDYS[8])
  744.                 pygame.display.update()
  745.                 self.Clock.tick(self.FPS+5)
  746.  
  747.             if pos == 10:
  748.                 while scroll == 'Down':
  749.                     scroll, MVLISTBDYS[9], MVLISTBDYS[8] = scrolla(scroll, MVLISTBDYS[9], MVLISTBDYS[8], MVLIST9, MVLIST8)
  750.  
  751.                 while scroll == 'Up':
  752.                     scroll, MVLISTBDYS[9], MVLISTBDYS[10] = scrolla(scroll, MVLISTBDYS[9], MVLISTBDYS[10], MVLIST9, MVLIST10)
  753.                            
  754.                 for event in pygame.event.get():
  755.                     if event.type == QUIT:
  756.                         pygame.quit()
  757.                         sys.exit()
  758.                     if event.type == KEYDOWN:
  759.                         if event.key == K_ESCAPE:
  760.                             self.warp()
  761.                             return
  762.                         if event.key == K_DOWN:
  763.                             pos += 1
  764.                             scroll = 'Down'
  765.                         if event.key == K_UP:
  766.                             pos -= 1
  767.                             scroll = 'Up'
  768.                 self.MainSurf.fill((0, 0, 0))
  769.                 self.MainSurf.blit(MVLIST9, MVLISTBDYS[9])
  770.                 pygame.display.update()
  771.                 self.Clock.tick(self.FPS+5)
  772.  
  773.  
  774.             if pos == 11:
  775.                 while scroll == 'Down':
  776.                     scroll, MVLISTBDYS[10], MVLISTBDYS[9] = scrolla(scroll, MVLISTBDYS[10], MVLISTBDYS[9], MVLIST10, MVLIST9)
  777.  
  778.                 while scroll == 'Up':
  779.                     scroll, MVLISTBDYS[10], MVLISTBDYS[11] = scrolla(scroll, MVLISTBDYS[10], MVLISTBDYS[11], MVLIST10, MVLIST11)
  780.                            
  781.                 for event in pygame.event.get():
  782.                     if event.type == QUIT:
  783.                         pygame.quit()
  784.                         sys.exit()
  785.                     if event.type == KEYDOWN:
  786.                         if event.key == K_ESCAPE:
  787.                             self.warp()
  788.                             return
  789.                         if event.key == K_DOWN:
  790.                             pos += 1
  791.                             scroll = 'Down'
  792.                         if event.key == K_UP:
  793.                             pos -= 1
  794.                             scroll = 'Up'
  795.                 self.MainSurf.fill((0, 0, 0))
  796.                 self.MainSurf.blit(MVLIST10, MVLISTBDYS[10])
  797.                 pygame.display.update()
  798.                 self.Clock.tick(self.FPS+5)
  799.  
  800.             if pos == 12:
  801.                 while scroll == 'Down':
  802.                     scroll, MVLISTBDYS[11], MVLISTBDYS[10] = scrolla(scroll, MVLISTBDYS[11], MVLISTBDYS[10], MVLIST11, MVLIST10)
  803.  
  804.                 while scroll == 'Up':
  805.                     scroll, MVLISTBDYS[11], MVLISTBDYS[12] = scrolla(scroll, MVLISTBDYS[11], MVLISTBDYS[12], MVLIST11, MVLIST12)
  806.                            
  807.                 for event in pygame.event.get():
  808.                     if event.type == QUIT:
  809.                         pygame.quit()
  810.                         sys.exit()
  811.                     if event.type == KEYDOWN:
  812.                         if event.key == K_ESCAPE:
  813.                             self.warp()
  814.                             return
  815.                         if event.key == K_DOWN:
  816.                             pos += 1
  817.                             scroll = 'Down'
  818.                         if event.key == K_UP:
  819.                             pos -= 1
  820.                             scroll = 'Up'
  821.                 self.MainSurf.fill((0, 0, 0))
  822.                 self.MainSurf.blit(MVLIST11, MVLISTBDYS[11])
  823.                 pygame.display.update()
  824.                 self.Clock.tick(self.FPS+5)
  825.  
  826.             if pos == 13:
  827.                 while scroll == 'Down':
  828.                     scroll, MVLISTBDYS[12], MVLISTBDYS[11] = scrolla(scroll, MVLISTBDYS[12], MVLISTBDYS[11], MVLIST12, MVLIST11)
  829.  
  830.                 while scroll == 'Up':
  831.                     scroll, MVLISTBDYS[12], MVLISTBDYS[13] = scrolla(scroll, MVLISTBDYS[12], MVLISTBDYS[13], MVLIST12, MVLIST13)
  832.                            
  833.                 for event in pygame.event.get():
  834.                     if event.type == QUIT:
  835.                         pygame.quit()
  836.                         sys.exit()
  837.                     if event.type == KEYDOWN:
  838.                         if event.key == K_ESCAPE:
  839.                             self.warp()
  840.                             return
  841.                         if event.key == K_DOWN:
  842.                             pos += 1
  843.                             scroll = 'Down'
  844.                         if event.key == K_UP:
  845.                             pos -= 1
  846.                             scroll = 'Up'
  847.                 self.MainSurf.fill((0, 0, 0))
  848.                 self.MainSurf.blit(MVLIST12, MVLISTBDYS[12])
  849.                 pygame.display.update()
  850.                 self.Clock.tick(self.FPS+5)
  851.  
  852.             if pos == 14:
  853.                 while scroll == 'Down':
  854.                     scroll, MVLISTBDYS[13], MVLISTBDYS[12] = scrolla(scroll, MVLISTBDYS[13], MVLISTBDYS[12], MVLIST13, MVLIST12)
  855.  
  856.                 while scroll == 'Up':
  857.                     scroll, MVLISTBDYS[13], MVLISTBDYS[14] = scrolla(scroll, MVLISTBDYS[13], MVLISTBDYS[14], MVLIST13, MVLIST14)
  858.                            
  859.                 for event in pygame.event.get():
  860.                     if event.type == QUIT:
  861.                         pygame.quit()
  862.                         sys.exit()
  863.                     if event.type == KEYDOWN:
  864.                         if event.key == K_ESCAPE:
  865.                             self.warp()
  866.                             return
  867.                         if event.key == K_DOWN:
  868.                             pos += 1
  869.                             scroll = 'Down'
  870.                         if event.key == K_UP:
  871.                             pos -= 1
  872.                             scroll = 'Up'
  873.                 self.MainSurf.fill((0, 0, 0))
  874.                 self.MainSurf.blit(MVLIST13, MVLISTBDYS[13])
  875.                 pygame.display.update()
  876.                 self.Clock.tick(self.FPS+5)
  877.  
  878.             if pos == 15:
  879.                 while scroll == 'Down':
  880.                     scroll, MVLISTBDYS[14], MVLISTBDYS[13] = scrolla(scroll, MVLISTBDYS[14], MVLISTBDYS[13], MVLIST14, MVLIST13)
  881.  
  882.                 while scroll == 'Up':
  883.                     scroll, MVLISTBDYS[14], MVLISTBDYS[15] = scrolla(scroll, MVLISTBDYS[14], MVLISTBDYS[15], MVLIST14, MVLIST15)
  884.                            
  885.                 for event in pygame.event.get():
  886.                     if event.type == QUIT:
  887.                         pygame.quit()
  888.                         sys.exit()
  889.                     if event.type == KEYDOWN:
  890.                         if event.key == K_ESCAPE:
  891.                             self.warp()
  892.                             return
  893.                         if event.key == K_DOWN:
  894.                             pos += 1
  895.                             scroll = 'Down'
  896.                         if event.key == K_UP:
  897.                             pos -= 1
  898.                             scroll = 'Up'
  899.                 self.MainSurf.fill((0, 0, 0))
  900.                 self.MainSurf.blit(MVLIST14, MVLISTBDYS[14])
  901.                 pygame.display.update()
  902.                 self.Clock.tick(self.FPS+5)
  903.  
  904.             if pos == 16:
  905.                 while scroll == 'Down':
  906.                     scroll, MVLISTBDYS[15], MVLISTBDYS[14] = scrolla(scroll, MVLISTBDYS[15], MVLISTBDYS[14], MVLIST15, MVLIST14)
  907.                 while scroll == 'Up':
  908.                     scroll, MVLISTBDYS[15], MVLISTBDYS[16] = scrolla(scroll, MVLISTBDYS[15], MVLISTBDYS[16], MVLIST15, MVLIST16)  
  909.                 for event in pygame.event.get():
  910.                     if event.type == QUIT:
  911.                         pygame.quit()
  912.                         sys.exit()
  913.                     if event.type == KEYDOWN:
  914.                         if event.key == K_ESCAPE:
  915.                             self.warp()
  916.                             return
  917.  
  918.                         if event.key == K_UP:
  919.                             pos -= 1
  920.                             scroll = 'Up'
  921.                         if event.key == K_DOWN:
  922.                             pos += 1
  923.                             scroll = 'Down'
  924.                 self.MainSurf.fill((0, 0, 0))
  925.                 self.MainSurf.blit(MVLIST15, MVLISTBDYS[15])
  926.                 pygame.display.update()
  927.                 self.Clock.tick(self.FPS+5)
  928.             if pos == 17:
  929.                 while scroll == 'Down':
  930.                     scroll, MVLISTBDYS[16], MVLISTBDYS[15] = scrolla(scroll, MVLISTBDYS[16], MVLISTBDYS[15], MVLIST16, MVLIST15)
  931.                 while scroll == 'Up':
  932.                     scroll, MVLISTBDYS[16], MVLISTBDYS[17] = scrolla(scroll, MVLISTBDYS[16], MVLISTBDYS[17], MVLIST16, MVLIST17)  
  933.                 for event in pygame.event.get():
  934.                     if event.type == QUIT:
  935.                         pygame.quit()
  936.                         sys.exit()
  937.                     if event.type == KEYDOWN:
  938.                         if event.key == K_ESCAPE:
  939.                             self.warp()
  940.                             return
  941.  
  942.                         if event.key == K_UP:
  943.                             pos -= 1
  944.                             scroll = 'Up'
  945.                         if event.key == K_DOWN:
  946.                             pos += 1
  947.                             scroll = 'Down'
  948.                 self.MainSurf.fill((0, 0, 0))
  949.                 self.MainSurf.blit(MVLIST16, MVLISTBDYS[16])
  950.                 pygame.display.update()
  951.                 self.Clock.tick(self.FPS+5)
  952.             if pos == 18:
  953.                 while scroll == 'Down':
  954.                     scroll, MVLISTBDYS[17], MVLISTBDYS[16] = scrolla(scroll, MVLISTBDYS[17], MVLISTBDYS[16], MVLIST17, MVLIST16)
  955.                 while scroll == 'Up':
  956.                     scroll, MVLISTBDYS[17], MVLISTBDYS[18] = scrolla(scroll, MVLISTBDYS[17], MVLISTBDYS[18], MVLIST17, MVLIST18)  
  957.                 for event in pygame.event.get():
  958.                     if event.type == QUIT:
  959.                         pygame.quit()
  960.                         sys.exit()
  961.                     if event.type == KEYDOWN:
  962.                         if event.key == K_ESCAPE:
  963.                             self.warp()
  964.                             return
  965.  
  966.                         if event.key == K_UP:
  967.                             pos -= 1
  968.                             scroll = 'Up'
  969.                         if event.key == K_DOWN:
  970.                             pos += 1
  971.                             scroll = 'Down'
  972.                 self.MainSurf.fill((0, 0, 0))
  973.                 self.MainSurf.blit(MVLIST17, MVLISTBDYS[17])
  974.                 pygame.display.update()
  975.                 self.Clock.tick(self.FPS+5)
  976.             if pos == 19:
  977.                 while scroll == 'Down':
  978.                     scroll, MVLISTBDYS[18], MVLISTBDYS[17] = scrolla(scroll, MVLISTBDYS[18], MVLISTBDYS[17], MVLIST18, MVLIST17)
  979.                 while scroll == 'Up':
  980.                     scroll, MVLISTBDYS[18], MVLISTBDYS[19] = scrolla(scroll, MVLISTBDYS[18], MVLISTBDYS[19], MVLIST18, MVLIST19)  
  981.                 for event in pygame.event.get():
  982.                     if event.type == QUIT:
  983.                         pygame.quit()
  984.                         sys.exit()
  985.                     if event.type == KEYDOWN:
  986.                         if event.key == K_ESCAPE:
  987.                             self.warp()
  988.                             return
  989.  
  990.                         if event.key == K_UP:
  991.                             pos -= 1
  992.                             scroll = 'Up'
  993.                         if event.key == K_DOWN:
  994.                             pos += 1
  995.                             scroll = 'Down'
  996.                 self.MainSurf.fill((0, 0, 0))
  997.                 self.MainSurf.blit(MVLIST18, MVLISTBDYS[18])
  998.                 pygame.display.update()
  999.                 self.Clock.tick(self.FPS+5)
  1000.             if pos == 20:
  1001.                 while scroll == 'Down':
  1002.                     scroll, MVLISTBDYS[19], MVLISTBDYS[18] = scrolla(scroll, MVLISTBDYS[19], MVLISTBDYS[18], MVLIST19, MVLIST18)
  1003.                 while scroll == 'Up':
  1004.                     scroll, MVLISTBDYS[19], MVLISTBDYS[20] = scrolla(scroll, MVLISTBDYS[19], MVLISTBDYS[20], MVLIST19, MVLIST20)  
  1005.                 for event in pygame.event.get():
  1006.                     if event.type == QUIT:
  1007.                         pygame.quit()
  1008.                         sys.exit()
  1009.                     if event.type == KEYDOWN:
  1010.                         if event.key == K_ESCAPE:
  1011.                             self.warp()
  1012.                             return
  1013.  
  1014.                         if event.key == K_UP:
  1015.                             pos -= 1
  1016.                             scroll = 'Up'
  1017.                         if event.key == K_DOWN:
  1018.                             pos += 1
  1019.                             scroll = 'Down'
  1020.                 self.MainSurf.fill((0, 0, 0))
  1021.                 self.MainSurf.blit(MVLIST19, MVLISTBDYS[19])
  1022.                 pygame.display.update()
  1023.                 self.Clock.tick(self.FPS+5)
  1024.  
  1025.             if pos == 21:
  1026.                 while scroll == 'Down':
  1027.                     scroll, MVLISTBDYS[20], MVLISTBDYS[19] = scrolla(scroll, MVLISTBDYS[20], MVLISTBDYS[19], MVLIST20, MVLIST19)
  1028.                            
  1029.                 for event in pygame.event.get():
  1030.                     if event.type == QUIT:
  1031.                         pygame.quit()
  1032.                         sys.exit()
  1033.                     if event.type == KEYDOWN:
  1034.                         if event.key == K_ESCAPE:
  1035.                             self.warp()
  1036.                             return
  1037.  
  1038.                         if event.key == K_UP:
  1039.                             pos -= 1
  1040.                             scroll = 'Up'
  1041.                 self.MainSurf.fill((0, 0, 0))
  1042.                 self.MainSurf.blit(MVLIST20, MVLISTBDYS[20])
  1043.                 pygame.display.update()
  1044.                 self.Clock.tick(self.FPS+5)
  1045.  
  1046.  
  1047.  
  1048.            
  1049.        
  1050.             if pos == 99:
  1051.                 while scroll == 'Down':
  1052.                     scroll, HOWPLAY_MVLISTQbdy, HOWPLAY_MVLISTbdy = scrolla(scroll, HOWPLAY_MVLISTQbdy, HOWPLAY_MVLISTbdy, HOWPLAY_MVLISTQ, HOWPLAY_MVLIST)
  1053.                            
  1054.                 for event in pygame.event.get():
  1055.                     if event.type == QUIT:
  1056.                         pygame.quit()
  1057.                         sys.exit()
  1058.                     if event.type == KEYDOWN:
  1059.                         if event.key == K_ESCAPE:
  1060.                             self.warp()
  1061.                             return
  1062.                         if event.key == K_UP:
  1063.                             pos -= 1
  1064.                             scroll = 'Up'
  1065.                 self.MainSurf.fill((0, 0, 0))
  1066.                 self.MainSurf.blit(HOWPLAY_MVLISTQ, HOWPLAY_MVLISTQbdy)
  1067.                 pygame.display.update()
  1068.                 self.Clock.tick(self.FPS+5)
  1069.  
  1070.  
  1071.            
  1072.  
  1073.             if pos == 0:
  1074.                 while scroll == 'Left':
  1075.                     scroll, HOWPLAY_FIbdy, HOWPLAY_INTRObdy = scrolla(scroll, HOWPLAY_FIbdy, HOWPLAY_INTRObdy, HOWPLAY_FI, HOWPLAY_INTRO)
  1076.                            
  1077.                 for event in pygame.event.get():
  1078.                     if event.type == QUIT:
  1079.                         pygame.quit()
  1080.                         sys.exit()
  1081.                     if event.type == KEYDOWN:
  1082.                         if event.key == K_ESCAPE:
  1083.                             self.warp()
  1084.                             return
  1085.                         if event.key == K_RIGHT:
  1086.                             pos += 1
  1087.                             scroll = 'Right'
  1088.                     elif event.type == MOUSEBUTTONUP:
  1089.                         mousex, mousey = event.pos
  1090.                         if pygame.Rect(67, 181, 350, 25).collidepoint(mousex, mousey):
  1091.                             webbrowser.open("http://onepiecea-edition.yoo7.com/forum")
  1092.                         if pygame.Rect(67, 293, 270, 25).collidepoint(mousex, mousey):
  1093.                             webbrowser.open("http://allstarbof.userboard.net/")
  1094.                            
  1095.  
  1096.                 self.MainSurf.fill((0, 0, 0))
  1097.                 self.MainSurf.blit(HOWPLAY_FI, HOWPLAY_FIbdy)
  1098.                 pygame.display.update()
  1099.    
  1100.     def recording_toggle(self):
  1101.         self.warp()
  1102.         Font = pygame.font.SysFont(None, 48)
  1103.         control= open(os.getcwd() + '\\data\\control.txt', 'r')
  1104.         controltxt = control.read().split('\n')
  1105.         control.close()
  1106.         recording= ["Off", "On"][int(controltxt[6])]
  1107.         self.Recrd = pygame.image.load(self.imgdir + "CHANGE_INREC.PNG")
  1108.         self.Recrdbdy = self.Recrd.get_rect()
  1109.         self.Recrdbdy.center = self.MainSurf.get_rect().center
  1110.         self.Recrd.set_colorkey((0, 0, 0))
  1111.        
  1112.         while "hakuna matata":
  1113.             text = Font.render(recording, True, (255, 255, 255))
  1114.             textbdy = text.get_rect()
  1115.             textbdy.center = self.MainSurf.get_rect().center
  1116.             self.MainSurf.fill((0, 0, 0))
  1117.             self.MainSurf.blit(self.Recrd, self.Recrdbdy)
  1118.             self.MainSurf.blit(text, textbdy)
  1119.             pygame.display.update()
  1120.             for event in pygame.event.get():
  1121.                 if event.type == QUIT:
  1122.                     pygame.quit()
  1123.                     sys.exit()
  1124.                 if event.type == KEYDOWN:
  1125.                     if event.key == K_ESCAPE:
  1126.                         self.warp()
  1127.                         return
  1128.                     if event.key == K_RIGHT or event.key == K_LEFT:
  1129.                         if recording == "On":
  1130.                             recording="Off"
  1131.                         elif recording == "Off":
  1132.                             recording="On"
  1133.  
  1134.  
  1135.  
  1136.                     if event.key == K_RETURN or event.key == K_SPACE:
  1137.                         controltxta = controltxt[:]
  1138.                         controltxta[6]= {"On": "1", "Off": "0"}[recording]
  1139.                         controltxta = "\n".join(controltxta)
  1140.                         f=open(os.getcwd() + "\\data\\control.txt", "w")
  1141.                         f.write(controltxta)
  1142.                         f.close()
  1143.                         self.warp()
  1144.                         return
  1145.            
  1146.     def controls(self):
  1147.         self.KeysValues = {"8": "Backspace", "9": "Tab", "13": "Enter",
  1148.                       "16": "Shift", "17": "Control", "20": "Caps Lock",
  1149.                       "27": "Escape", "32": "Spacebar", "33": "Page up",
  1150.                       "34": "Page down", "35": "End", "36": "Home",
  1151.                       "37": "Left A-rrow", "38": "Up A-rrow", "39": "Right A-rrow",
  1152.                       "40": "Down A-rrow", "45": "Insert", "46": "Delete",
  1153.                       "19": "Pause", "186": ";", "187": "=",
  1154.                       "188": "-", "191": "/", "192": "`",
  1155.                       "219": "[", "220": "\\", "221": "]",
  1156.                       "222": "\'", "188": ",", "190": ".",
  1157.                       "96": "Numpad 0", "97": "Numpad 1", "98": "Numpad 2",
  1158.                       "99": "Numpad 3", "100": "Numpad 4", "101": "Numpad 5",
  1159.                       "102": "Numpad 6", "103": "Numpad 7", "104": "Numpad 8",
  1160.                       "105": "Numpad 9", "106": "Num_*", "107": "Num_+",
  1161.                       "109": "Num_-", "110": "Num_.", "111": "Num_/"}
  1162.        
  1163.  
  1164.         self.KeysValuesreal = {"8": "Backspace", "9": "Tab", "13": "Enter",
  1165.                       "303": "Shift", "306": "Control", "301": "Caps Lock",
  1166.                       "27": "Escape", "32": "Spacebar", "280": "Page up",
  1167.                       "281": "Page down", "279": "End", "278": "Home",
  1168.                       "276": "Left A-rrow", "273": "Up A-rrow", "275": "Right A-rrow",
  1169.                       "274": "Down A-rrow", "277": "Insert", "127": "Delete",
  1170.                       "19": "Pause", "59": ";", "61": "=",
  1171.                       "45": "-", "47": "/", "96": "`",
  1172.                       "91": "[", "60": "\\", "93": "]",
  1173.                       "39": "\'", "44": ",", "46": ".",
  1174.                       "256": "Numpad 0", "257": "Numpad 1", "258": "Numpad 2",
  1175.                       "259": "Numpad 3", "260": "Numpad 4", "261": "Numpad 5",
  1176.                       "262": "Numpad 6", "263": "Numpad 7", "264": "Numpad 8",
  1177.                       "265": "Numpad 9", "268": "Num_*", "270": "Num_+",
  1178.                       "269": "Num_-", "266": "Num_.", "267": "Num_/"}
  1179.         def preparecont(ControlsFont, controlnames, controlsp1):
  1180.             P=[ControlsFont.render(controlnames, True, (255, 255, 255)), ControlsFont.render(controlsp1[0], True, (255, 255, 255)),
  1181.                 ControlsFont.render(controlsp1[1], True, (255, 255, 255)), ControlsFont.render(controlsp1[2], True, (255, 255, 255)),
  1182.                 ControlsFont.render(controlsp1[3], True, (255, 255, 255)), ControlsFont.render(controlsp1[4], True, (255, 255, 255)),
  1183.                 ControlsFont.render(controlsp1[5], True, (255, 255, 255)), ControlsFont.render(controlsp1[6], True, (255, 255, 255)),
  1184.                 ControlsFont.render(controlsp1[7], True, (255, 255, 255))]
  1185.             Pbdy = []
  1186.             for a in P:
  1187.                 Pbdy.append(a.get_rect())
  1188.             return P, Pbdy
  1189.         def idontwannagostudy():
  1190.             control= open(os.getcwd() + '\\data\\control.txt', 'r')
  1191.             self.controltxt = control.read().split('\n')
  1192.             control.close()
  1193.             self.controlsp1= self.controltxt[0].split(' ')
  1194.             self.controlsp2= self.controltxt[1].split(' ')
  1195.             self.controlsp3= self.controltxt[2].split(' ')
  1196.             self.controlsp4= self.controltxt[3].split(' ')
  1197.             self.controlnames= self.controltxt[4].split(' ')
  1198.             self.controlsall = [self.controlsp1, self.controlsp2, self.controlsp3, self.controlsp4]
  1199.  
  1200.             for a in self.controlsall:
  1201.                 if a[0] == "0":
  1202.                     a[0] = "Keyboard"
  1203.                 elif a[0] == "1":
  1204.                     a[0] = "Joystick 1"
  1205.                 elif a[0] == "2":
  1206.                     a[0] = "Joystick 2"
  1207.  
  1208.                 for b in range(len(a)):
  1209.                     if len(a[b]) > 1 and len(a[b]) < 4 and not a[b].isalpha():
  1210.                         if a[b] in self.KeysValues:
  1211.                             for value in self.KeysValues:
  1212.                                 if a[b] == value:
  1213.                                     a[b] = self.KeysValues[value]
  1214.                        
  1215.                        
  1216.                         else:
  1217.                             a[b] = "Key_" + chr(int(a[b])).upper()
  1218.             pos = 0
  1219.             self.ControlNORM = pygame.image.load(self.imgdir + "OPTIONS_CONTROLS.PNG")
  1220.             self.ControlNORM.set_colorkey((0, 0, 0))
  1221.             self.ControlHLBOX = pygame.image.load(self.imgdir + "CONTROLS_CHOSEN.PNG")
  1222.             self.ControlHLBOX.set_colorkey((0, 0, 0))
  1223.             self.ControlHLBOXbdy = self.ControlNORM.get_rect()
  1224.             self.ControlHLBOXbdy.left, self.ControlHLBOXbdy.top = 32, 108
  1225.             self.ControlNORMbdy = self.ControlNORM.get_rect()
  1226.             self.ControlNORMbdy.center = self.MainSurf.get_rect().center
  1227.             ControlsFont = pygame.font.SysFont(None, 27)
  1228.            
  1229.            
  1230.  
  1231.            
  1232.  
  1233.             P1, P1bdy = preparecont(ControlsFont, self.controlnames[0], self.controlsp1)
  1234.             P2, P2bdy = preparecont(ControlsFont, self.controlnames[1], self.controlsp2)
  1235.             P3, P3bdy = preparecont(ControlsFont, self.controlnames[2], self.controlsp3)
  1236.             P4, P4bdy = preparecont(ControlsFont, self.controlnames[3], self.controlsp4)
  1237.             self.BDYS = [P1bdy, P2bdy, P3bdy, P4bdy]
  1238.             self.Ps = [P1, P2, P3, P4]
  1239.             for a in self.BDYS:
  1240.                 if a == P1bdy:
  1241.                     side=0
  1242.                     top=0
  1243.                 elif a == P2bdy:
  1244.                     side=0
  1245.                     top=215
  1246.                 elif a == P3bdy:
  1247.                     side=370
  1248.                     top=0
  1249.                 elif a == P4bdy:
  1250.                     side=370
  1251.                     top=215
  1252.                    
  1253.                 for b in a:
  1254.                     b.left = 188 + side
  1255.                     b.top = 110 + top
  1256.                     top += 21
  1257.        
  1258.         def ChangeConts(controlnameindex):
  1259.             jj=[]
  1260.             for a in range(pygame.joystick.get_count()):
  1261.                 jj.append(pygame.joystick.Joystick(a))
  1262.             for n in jj:
  1263.                 n.init()
  1264.            
  1265.             def blitstufffunc(Font, Name, ControlNAME, ControlALLbdy, a):
  1266.                 text = Font.render(Name, True, (255, 255, 255))
  1267.                 textbdy = text.get_rect()
  1268.                 textbdy.center = self.MainSurf.get_rect().center
  1269.                 textbdy.centerx = self.MainSurf.get_rect().centerx - a
  1270.                 self.MainSurf.blit(ControlNAME, ControlALLbdy)
  1271.                 self.MainSurf.blit(text, textbdy)
  1272.                 pygame.display.update()
  1273.                 self.MainSurf.fill((0, 0, 0))
  1274.                 self.MainSurf.blit(self.ControlNORM, self.ControlNORMbdy)
  1275.                 return
  1276.             def assignbuttons(eventkey, Change, controlnameindex, buttonno):
  1277.                 ABCD = "abcdefghijklmnopqrstuvwxyz1234567890"
  1278.                 abcd =[]
  1279.                 for a in ABCD:
  1280.                     abcd.append(ord(a))
  1281.                 if "joy" in str(eventkey):
  1282.                    
  1283.                     controltxta = self.controltxt[:]
  1284.                     controltxta[controlnameindex]= controltxta[controlnameindex].split(" ")
  1285.                    
  1286.                     controltxta[controlnameindex][buttonno] = eventkey[eventkey.find("y")+1:]
  1287.  
  1288.                     controltxta[controlnameindex] = " ".join(controltxta[controlnameindex])
  1289.                     self.controltxt = controltxta
  1290.                     controltxta = "\n".join(controltxta)
  1291.                     f=open(os.getcwd() + '\\data\\control.txt', "w")
  1292.                     f.write(controltxta)
  1293.                     f.close()
  1294.                     Change +=1
  1295.                     return Change
  1296.                 elif str(int(eventkey)) in self.KeysValuesreal or int(eventkey) in abcd:
  1297.                     controltxta = self.controltxt[:]
  1298.                     controltxta[controlnameindex]= controltxta[controlnameindex].split(" ")
  1299.                     if int(eventkey) in abcd:
  1300.                         for c in abcd:
  1301.                             if c == int(eventkey):
  1302.                                 if chr(c).isalpha():
  1303.                                     controltxta[controlnameindex][buttonno] = str(ord(chr(c).upper()))
  1304.                                 else:
  1305.                                     controltxta[controlnameindex][buttonno] = str(c)
  1306.                     else:
  1307.                         for a in self.KeysValuesreal:
  1308.                             if int(a) == int(eventkey):
  1309.                                 for b in self.KeysValues:
  1310.                                     if self.KeysValuesreal[a] == self.KeysValues[b]:
  1311.                                         controltxta[controlnameindex][buttonno] = b
  1312.                     controltxta[controlnameindex] = " ".join(controltxta[controlnameindex])
  1313.                     self.controltxt = controltxta
  1314.                     controltxta = "\n".join(controltxta)
  1315.                     f=open(os.getcwd() + '\\data\\control.txt', "w")
  1316.                     f.write(controltxta)
  1317.                     f.close()
  1318.                     Change +=1
  1319.                     return Change
  1320.                 return Change
  1321.            
  1322.             Font = pygame.font.SysFont(None, 48)
  1323.             ControlNAME = pygame.image.load(self.imgdir + "CHANGE_NAME.PNG")
  1324.             ControlINPUTDEVICE = pygame.image.load(self.imgdir + "CHANGE_INPUTDEVICE.PNG")
  1325.             ControlKEY = pygame.image.load(self.imgdir + "CHANGE_KEY.PNG")
  1326.             ControlALLbdy = ControlNAME.get_rect()
  1327.             ControlALLbdy.center =  self.MainSurf.get_rect().center
  1328.             Change = 1
  1329.             deletion = ''
  1330.             Name = self.controlnames[controlnameindex]
  1331.             InputDev = ["Keyboard", "Joystick 1", "Joystick 2"][int(self.controltxt[controlnameindex][0])]
  1332.            
  1333.        
  1334.  
  1335.        
  1336.            
  1337.             while Change <= 9:
  1338.                 if Change == 1:
  1339.                     blitstufffunc(Font, Name, ControlNAME, ControlALLbdy, 0)
  1340.                 if Change == 2:
  1341.                     blitstufffunc(Font, InputDev, ControlINPUTDEVICE, ControlALLbdy, 0)
  1342.                 if Change == 3:
  1343.                     if "J" in InputDev:
  1344.                         Change=7
  1345.                     blitstufffunc(Font, "Up: ", ControlKEY, ControlALLbdy, 150)
  1346.                 if Change == 4:
  1347.                     blitstufffunc(Font, "Down: ", ControlKEY, ControlALLbdy, 150)
  1348.                 if Change == 5:
  1349.                     blitstufffunc(Font, "Left: ", ControlKEY, ControlALLbdy, 150)
  1350.                 if Change == 6:
  1351.                     blitstufffunc(Font, "Right: ", ControlKEY, ControlALLbdy, 150)
  1352.                 if Change == 7:
  1353.                     blitstufffunc(Font, "Attack: ", ControlKEY, ControlALLbdy, 150)
  1354.                 if Change == 8:
  1355.                     blitstufffunc(Font, "Jump: ", ControlKEY, ControlALLbdy, 150)
  1356.                 if Change == 9:
  1357.                     blitstufffunc(Font, "Defend: ", ControlKEY, ControlALLbdy, 150)
  1358.                        
  1359.                 for event in pygame.event.get():
  1360.                     if event.type == QUIT:
  1361.                         pygame.quit()
  1362.                         sys.exit()
  1363.                     if Change == 9:
  1364.                         if event.type == JOYBUTTONDOWN:
  1365.                            
  1366.                             Change = assignbuttons("joy"+str(event.button), Change, controlnameindex, 10)
  1367.                         if event.type == KEYDOWN:
  1368.                             Change = assignbuttons(event.key, Change, controlnameindex, 7)
  1369.                     if Change == 8:
  1370.                         if event.type == JOYBUTTONDOWN:
  1371.                             Change = assignbuttons("joy"+str(event.button), Change, controlnameindex, 9)
  1372.                         if event.type == KEYDOWN:
  1373.                             Change = assignbuttons(event.key, Change, controlnameindex, 6)
  1374.                     if Change == 7:
  1375.                         if event.type == JOYBUTTONDOWN:
  1376.                             print (event.button)
  1377.                             Change = assignbuttons("joy"+str(event.button), Change, controlnameindex, 8)
  1378.                         if event.type == KEYDOWN:
  1379.                             Change = assignbuttons(event.key, Change, controlnameindex, 5)
  1380.                     if Change == 6:
  1381.                         if event.type == KEYDOWN:
  1382.                             Change = assignbuttons(event.key, Change, controlnameindex, 4)
  1383.                     if Change == 5:
  1384.                         if event.type == KEYDOWN:
  1385.                             Change = assignbuttons(event.key, Change, controlnameindex, 3)
  1386.                     if Change == 4:
  1387.                         if event.type == KEYDOWN:
  1388.                             Change = assignbuttons(event.key, Change, controlnameindex, 2)
  1389.                     if Change == 3:
  1390.                         if event.type == KEYDOWN:
  1391.                             Change = assignbuttons(event.key, Change, controlnameindex, 1)
  1392.                     if Change == 2:
  1393.                         if event.type == KEYDOWN:
  1394.                             if event.key == K_RIGHT:
  1395.                                 if InputDev == "Keyboard":
  1396.                                     InputDev="Joystick 1"
  1397.                                 elif InputDev == "Joystick 1":
  1398.                                     InputDev="Joystick 2"
  1399.                                 elif InputDev == "Joystick 2":
  1400.                                     InputDev="Keyboard"
  1401.                             if event.key == K_LEFT:
  1402.                                 if InputDev == "Keyboard":
  1403.                                     InputDev="Joystick 2"
  1404.                                 elif InputDev == "Joystick 2":
  1405.                                     InputDev="Joystick 1"
  1406.                                 elif InputDev == "Joystick 1":
  1407.                                     InputDev="Keyboard"
  1408.                             if event.key == K_RETURN or event.key == K_SPACE:
  1409.                                 controltxta = self.controltxt[:]
  1410.                                 controltxta[controlnameindex]= controltxta[controlnameindex].split(" ")
  1411.                                 controltxta[controlnameindex][0] = {"Keyboard": "0", "Joystick 1": "1", "Joystick 2": "2"}[InputDev]
  1412.                                 controltxta[controlnameindex] = " ".join(controltxta[controlnameindex])
  1413.                                 self.controltxt = controltxta
  1414.                                 controltxta = "\n".join(controltxta)
  1415.                                 f=open(os.getcwd() + '\\data\\control.txt', "w")
  1416.                                 f.write(controltxta)
  1417.                                 f.close()
  1418.                                 Change = 3
  1419.                     if Change ==1:
  1420.                         if event.type == KEYDOWN:
  1421.                             if len(Name) <= 10:
  1422.                                 if len(Name) < 10:
  1423.                                     if (int(event.key) > 64 and int(event.key) < 91) or (int(event.key) > 96 and int(event.key) < 123) or (int(event.key) == 35) or (int(event.key) == 42):
  1424.                                         Name += chr(int(event.key)).upper()
  1425.                                 if int(event.key) == 13:
  1426.                                     controltxta = self.controltxt[:]
  1427.                                     controltxta[4]= controltxta[4].split(" ")
  1428.                                     controltxta[4][controlnameindex] = Name
  1429.                                     controltxta[4] = " ".join(controltxta[4])
  1430.                                     self.controltxt = controltxta
  1431.                                     controltxta = "\n".join(controltxta)
  1432.                                     f=open(os.getcwd() + '\\data\\control.txt', "w")
  1433.                                     f.write(controltxta)
  1434.                                     f.close()
  1435.                                     Change = 2
  1436.                             if int(event.key) == 8:
  1437.                                 if len(Name) > 0:
  1438.                                     deletion = len(Name)
  1439.                                     Name = Name[:(deletion - 1)] + Name[(deletion):]
  1440.             return
  1441.  
  1442.  
  1443.  
  1444.                    
  1445.                
  1446.  
  1447.  
  1448.         idontwannagostudy()
  1449.         self.warp()
  1450.         side, top = 0, 0
  1451.         while "cola":
  1452.             for event in pygame.event.get():
  1453.                 if event.type == QUIT:
  1454.                     pygame.quit()
  1455.                     sys.exit()
  1456.                 if event.type == KEYDOWN:
  1457.        
  1458.                     if event.key == K_ESCAPE:
  1459.                         self.warp()
  1460.                         return
  1461.                     if top != 215:
  1462.                         if event.key == K_DOWN:
  1463.                             top = 215
  1464.                     if top != 0:
  1465.                         if event.key == K_UP:
  1466.                             top = 0
  1467.                     if side != 370:
  1468.                         if event.key == K_RIGHT:
  1469.                             side = 370
  1470.                     if side != 0:
  1471.                         if event.key == K_LEFT:
  1472.                             side = 0
  1473.                     if event.key == K_RETURN or event.key == K_SPACE:
  1474.                         if side == 0 and top == 0:
  1475.                             ChangeConts(0)
  1476.                             idontwannagostudy()
  1477.                         if side == 370 and top == 0:
  1478.                             ChangeConts(2)
  1479.                             idontwannagostudy()
  1480.                         if side == 0 and top == 215:
  1481.                             ChangeConts(1)
  1482.                             idontwannagostudy()
  1483.                         if side == 370 and top == 215:
  1484.                             ChangeConts(3)
  1485.                             idontwannagostudy()
  1486.                        
  1487.            
  1488.             self.ControlHLBOXbdy.left, self.ControlHLBOXbdy.top = 30+side, 108+top
  1489.            
  1490.             self.MainSurf.fill((0, 0, 0))
  1491.             self.MainSurf.blit(self.ControlNORM, self.ControlNORMbdy)
  1492.             self.MainSurf.blit(self.ControlHLBOX, self.ControlHLBOXbdy)
  1493.             for a in range(len(self.BDYS)):
  1494.                 for b in range(len(self.Ps[a])):
  1495.                     self.MainSurf.blit(self.Ps[a][b], self.BDYS[a][b])
  1496.             pygame.display.update()
  1497.         return
  1498.  
  1499.  
  1500.    
  1501.     def menu(self):
  1502.         menupos= 1
  1503.         play = False
  1504.         MenuBG        = pygame.image.load(self.imgdir + "MENU_BG.PNG")
  1505.         MenuBG.set_colorkey((0, 0, 0))
  1506.         menuitemsswap=pygame.image.load(self.imgdir + "menucho.PNG").convert()
  1507.         menuitemsswap.set_colorkey((0, 0, 0,0))
  1508.         if len(self.getunlockedlist()) == 22:
  1509.             menuitemshilit= pygame.image.load(self.imgdir + "MENUITEMS_CHOSEN.PNG")
  1510.             unlock=True
  1511.         else:
  1512.             unlock = False
  1513.  
  1514.        
  1515.  
  1516.         menuitemsbdy  = menuitemsswap.get_rect()
  1517.         menuitemsbdy.centerx = self.MainSurf.get_rect().centerx
  1518.         menuitemsbdy.top = self.MainSurf.get_rect().centery +25
  1519.         MenuBGbdy  = MenuBG.get_rect()
  1520.         MenuBGbdy.center = self.MainSurf.get_rect().center
  1521.         menuitemsindex= [(0, 50, 480, 49), (0, 150, 480, 49), (0, 250, 480, 49), (0, 350, 480, 49),
  1522.                     (0, 450, 480, 49), (0, 550, 480, 49), (0, 650, 480, 49), (0, 750, 480, 49)]
  1523.         while True:
  1524.             self.MainSurf.blit(MenuBG, MenuBGbdy)
  1525.             for event in pygame.event.get():
  1526.                 if event.type == QUIT:
  1527.                     pygame.quit()
  1528.                     sys.exit()
  1529.  
  1530.  
  1531.                 if menupos == 1:
  1532.                     if event.type == KEYDOWN:
  1533.                         if event.key == K_RIGHT:
  1534.                             menupos += 1
  1535.                         if event.key == K_LEFT:
  1536.                             menupos = 7
  1537.                         if event.key == K_RETURN or event.key == K_SPACE:
  1538.                             self.rungame(1)
  1539.                 elif menupos == 2:
  1540.                     if event.type == KEYDOWN:
  1541.                         if event.key == K_LEFT:
  1542.                             menupos -= 1
  1543.                         if event.key == K_RETURN or event.key == K_SPACE:
  1544.                             self.options()
  1545.                         if event.key == K_RIGHT:
  1546.                             menupos += 1
  1547.                 elif menupos == 3:
  1548.                     if event.type == KEYDOWN:
  1549.                         if event.key == K_LEFT:
  1550.                             menupos -= 1
  1551.                         if event.key == K_RETURN or event.key == K_SPACE:
  1552.                             pygame.display.update()
  1553.                             self.MainSurf.fill((0, 0, 0))
  1554.                             self.warp()
  1555.                             self.Shop()
  1556.                            
  1557.                         if event.key == K_RIGHT:
  1558.                             menupos += 1
  1559.                 elif menupos == 4:
  1560.                     if event.type == KEYDOWN:
  1561.                         if event.key == K_LEFT:
  1562.                             menupos -= 1
  1563.                         if event.key == K_RIGHT:
  1564.                             if unlock:
  1565.                                 menupos += 1
  1566.                             else:
  1567.                                 menupos += 2
  1568.                            
  1569.                         if event.key == K_RETURN or event.key == K_SPACE:
  1570.                            
  1571.                             self.how_play()
  1572.                 elif menupos == 5:
  1573.                     if event.type == KEYDOWN:
  1574.                         if event.key == K_LEFT:
  1575.                             menupos -= 1
  1576.                         if event.key == K_RETURN or event.key == K_SPACE:
  1577.                             self.rungame(0)
  1578.  
  1579.                         if event.key == K_RIGHT:
  1580.                             menupos += 1
  1581.                 elif menupos == 6:
  1582.                     if event.type == KEYDOWN:
  1583.                         if event.key == K_LEFT:
  1584.                             if unlock:
  1585.                                 menupos -= 1
  1586.                             else:
  1587.                                 menupos -= 2
  1588.                         if event.key == K_RETURN or event.key == K_SPACE:
  1589.  
  1590.                             self.credit_slide()
  1591.                         if event.key == K_RIGHT:
  1592.                             menupos += 1
  1593.                 elif menupos == 7:
  1594.                     if event.type == KEYDOWN:
  1595.                         if event.key == K_LEFT:
  1596.                             menupos -= 1
  1597.                         if event.key == K_RIGHT:
  1598.                             menupos = 1
  1599.                         if event.key == K_RETURN or event.key == K_SPACE:
  1600.                             pygame.quit()
  1601.                             sys.exit()
  1602.             self.MainSurf.blit(menuitemsswap, menuitemsbdy, area = menuitemsindex[0])
  1603.             if menupos == 1:
  1604.                 self.MainSurf.blit(menuitemsswap, menuitemsbdy, area = menuitemsindex[1])
  1605.  
  1606.  
  1607.             if menupos == 2:
  1608.                 self.MainSurf.blit(menuitemsswap, menuitemsbdy, area = menuitemsindex[2])
  1609.  
  1610.  
  1611.             if menupos == 3:
  1612.                 self.MainSurf.blit(menuitemsswap, menuitemsbdy, area = menuitemsindex[3])
  1613.  
  1614.             if menupos == 4:
  1615.                 self.MainSurf.blit(menuitemsswap, menuitemsbdy, area = menuitemsindex[4])
  1616.  
  1617.  
  1618.             if menupos == 5:
  1619.                 self.MainSurf.blit(menuitemsswap, menuitemsbdy, area = menuitemsindex[5])
  1620.  
  1621.  
  1622.             if menupos == 6:
  1623.                 self.MainSurf.blit(menuitemsswap, menuitemsbdy, area = menuitemsindex[6])
  1624.          
  1625.  
  1626.             if menupos == 7:
  1627.                 self.MainSurf.blit(menuitemsswap, menuitemsbdy, area = menuitemsindex[7])
  1628.  
  1629.  
  1630.  
  1631.  
  1632.             pygame.display.update()
  1633.             self.MainSurf.fill((0, 0, 0))
  1634.             if play == True:
  1635.                 break
  1636.     def Shop(self): #was originally a class
  1637.         pygame.mixer.music.stop()
  1638.         pygame.mixer.music.load(self.imgdir + 'bgmusic.mp3')
  1639.         pygame.mixer.music.play(-1, 0)
  1640.         self.process = 1
  1641.         self.ChkPass = False
  1642.         self.outo = False
  1643.         self.PassCode = ""
  1644.         def passmenu():
  1645.             deletion = ''
  1646.            
  1647.             for event in pygame.event.get():
  1648.                 if event.type == QUIT:
  1649.                     self.Close()
  1650.                
  1651.                 if event.type == KEYDOWN:
  1652.                     if event.key == K_ESCAPE:
  1653.                         self.outo = True
  1654.                     if len(self.PassCode) < 10:
  1655.                         if (int(event.key) > 64 and int(event.key) < 91) or (int(event.key) > 96 and int(event.key) < 123) or (int(event.key) == 35) or (int(event.key) == 42):
  1656.                             self.PassCode += chr(int(event.key))
  1657.                     if int(event.key) == 13:
  1658.                         self.ChkPass = True
  1659.                     if int(event.key) == 8:
  1660.                         if len(self.PassCode) > 0:
  1661.                             deletion = len(self.PassCode)
  1662.                             self.PassCode = self.PassCode[:(deletion - 1)] + self.PassCode[(deletion):]
  1663.  
  1664.             if self.ChkPass == True:
  1665.                
  1666.                 if self.PassCode in self.passcodes:
  1667.                     datatxt = open(self.datxtdir, 'r')
  1668.                     datalines = datatxt.readlines()
  1669.                     datatxt.close()
  1670.                    
  1671.                    
  1672.                     for line in range(len(datalines)-1):
  1673.                         newline = ''
  1674.                         if "data\\OP\\d1.dat" in datalines[line] and self.PassCode == self.passcodes[0]:
  1675.                             datalines[line] = ''
  1676.                         if "data\\OP\\d2.dat" in datalines[line] and self.PassCode == self.passcodes[1]:
  1677.                             datalines[line] = ''
  1678.                         if "data\\OP\\d3.dat" in datalines[line] and self.PassCode == self.passcodes[2]:
  1679.                             datalines[line] = ''
  1680.                         if "data\\OP\\d4.dat" in datalines[line] and self.PassCode == self.passcodes[3]:
  1681.                             datalines[line] = ''
  1682.                         if "data\\OP\\d5.dat" in datalines[line] and self.PassCode == self.passcodes[4]:
  1683.                             datalines[line] = ''
  1684.                         if "data\\OP\\d6.dat" in datalines[line] and self.PassCode == self.passcodes[5]:
  1685.                             datalines[line] = ''
  1686.                         if "data\\OP\\d7.dat" in datalines[line] and self.PassCode == self.passcodes[6]:
  1687.                             datalines[line] = ''
  1688.                         if "data\\OP\\d8.dat" in datalines[line] and self.PassCode == self.passcodes[7]:
  1689.                             datalines[line] = ''
  1690.                         if "data\\OP\\d9.dat" in datalines[line] and self.PassCode == self.passcodes[8]:
  1691.                             datalines[line] = ''
  1692.                         if "data\\OP\\d10.dat" in datalines[line] and self.PassCode == self.passcodes[9]:
  1693.                             datalines[line] = ''
  1694.                         if "data\\OP\\d11.dat" in datalines[line] and self.PassCode == self.passcodes[10]:
  1695.                             datalines[line] = ''
  1696.                         if "data\\OP\\d12.dat" in datalines[line] and self.PassCode == self.passcodes[11]:
  1697.                             datalines[line] = ''
  1698.                         if "data\\OP\\d13.dat" in datalines[line] and self.PassCode == self.passcodes[12]:
  1699.                             datalines[line] = ''
  1700.                         if "data\\OP\\d14.dat" in datalines[line] and self.PassCode == self.passcodes[12]:
  1701.                             datalines[line] = ''
  1702.  
  1703.                         if "data\\OP\\7.dat" in datalines[line] and self.PassCode == self.passcodes[0]:
  1704.                             datalines[line] = ''
  1705.                         if "data\\OP\\16.dat" in datalines[line] and self.PassCode == self.passcodes[1]:
  1706.                             datalines[line] = ''
  1707.                         if "data\\OP\\25.dat" in datalines[line] and self.PassCode == self.passcodes[2]:
  1708.                             datalines[line] = ''
  1709.                         if "data\\OP\\32.dat" in datalines[line] and self.PassCode == self.passcodes[3]:
  1710.                             datalines[line] = ''
  1711.                         if "data\\OP\\40.dat" in datalines[line] and self.PassCode == self.passcodes[4]:
  1712.                             datalines[line] = ''
  1713.                         if "data\\OP\\47.dat" in datalines[line] and self.PassCode == self.passcodes[5]:
  1714.                             datalines[line] = ''
  1715.                         if "data\\OP\\53.dat" in datalines[line] and self.PassCode == self.passcodes[6]:
  1716.                             datalines[line] = ''
  1717.                         if "data\\OP\\61.dat" in datalines[line] and self.PassCode == self.passcodes[7]:
  1718.                             datalines[line] = ''
  1719.                         if "data\\OP\\68.dat" in datalines[line] and self.PassCode == self.passcodes[8]:
  1720.                             datalines[line] = ''
  1721.                         if "data\\OP\\77.dat" in datalines[line] and self.PassCode == self.passcodes[9]:
  1722.                             datalines[line] = ''
  1723.                         if "data\\OP\\86.dat" in datalines[line] and self.PassCode == self.passcodes[10]:
  1724.                             datalines[line] = ''
  1725.                         if "data\\OP\\94.dat" in datalines[line] and self.PassCode == self.passcodes[11]:
  1726.                             datalines[line] = ''
  1727.                         if "data\\OP\\100.dat" in datalines[line] and self.PassCode == self.passcodes[12]:
  1728.                             datalines[line] = ''
  1729.  
  1730.  
  1731.                         for word in list(datalines[line].split()):
  1732.                            
  1733.                             if self.PassCode == self.passcodes[0] and  '%1%' in word:
  1734.                                 datalines[line] = self.unlines[str(self.passcodesset['%1'])]+ '\n'
  1735.                                 self.rightsound()
  1736.                                
  1737.                             elif self.PassCode == self.passcodes[1] and '%2%' in word:
  1738.                                 datalines[line] = self.unlines[str(self.passcodesset['%2'])]+ '\n'
  1739.                                 self.rightsound()
  1740.                             elif self.PassCode == self.passcodes[2] and  '%3%' in word:
  1741.                                 datalines[line] = self.unlines[str(self.passcodesset['%3'])]+ '\n'
  1742.                                 self.rightsound()
  1743.                             elif self.PassCode == self.passcodes[3] and '%4%' in word:
  1744.                                 datalines[line] = self.unlines[str(self.passcodesset['%4'])]+ '\n'
  1745.                                 self.rightsound()
  1746.                             elif self.PassCode == self.passcodes[4] and  '%5%' in word:
  1747.                                 datalines[line] = self.unlines[str(self.passcodesset['%5'])]+ '\n'
  1748.                                 self.rightsound()
  1749.                             elif self.PassCode == self.passcodes[5] and  '%6%' in word:
  1750.                                 datalines[line] = self.unlines[str(self.passcodesset['%6'])]+ '\n'
  1751.                                 self.rightsound()
  1752.                             elif self.PassCode == self.passcodes[6] and '%7%' in word:
  1753.                                 datalines[line] = self.unlines[str(self.passcodesset['%7'])]+ '\n'
  1754.                                 self.rightsound()
  1755.                             elif self.PassCode == self.passcodes[7] and '%8%' in word:
  1756.                                 datalines[line] = self.unlines[str(self.passcodesset['%8'])]+ '\n'
  1757.                                 self.rightsound()
  1758.                             elif self.PassCode == self.passcodes[8] and '%9%' in word:
  1759.                                 datalines[line] = self.unlines[str(self.passcodesset['%9'])]+ '\n'
  1760.                                 self.rightsound()
  1761.                             elif self.PassCode == self.passcodes[9] and '%10%' in word:
  1762.                                 datalines[line] = self.unlines[str(self.passcodesset['%10'])]+ '\n'
  1763.                                 self.rightsound()
  1764.                             elif self.PassCode == self.passcodes[10] and '%11%' in word:
  1765.                                 datalines[line] = self.unlines[str(self.passcodesset['%11'])]+ '\n'
  1766.                                 self.rightsound()
  1767.                             elif self.PassCode == self.passcodes[11] and '%12%' in word:
  1768.                                 datalines[line] = self.unlines[str(self.passcodesset['%12'])]+ '\n'
  1769.                                 self.rightsound()
  1770.                             elif self.PassCode == self.passcodes[12] and '%13%' in word:
  1771.                                 datalines[line] = self.unlines[str(self.passcodesset['%13'])]+ '\n'
  1772.                                 self.rightsound()
  1773.                                
  1774.                             if self.PassCode == self.passcodes[2] and '%33%' in word:
  1775.                                 datalines[line] = self.unlines[str(self.passcodesset['%33'])]+ '\n'
  1776.                             if self.PassCode == self.passcodes[6] and '%77%' in word:
  1777.                                 datalines[line] = self.unlines[str(self.passcodesset['%77'])]+ '\n'
  1778.                                
  1779.                             if self.PassCode == self.passcodes[9] and '%110%' in word:
  1780.                                 datalines[line] = self.unlines[str(self.passcodesset['%110'])]+ '\n'
  1781.  
  1782.                             if self.PassCode == self.passcodes[12] and '%130%' in word:
  1783.                                 datalines[line] = self.unlines[str(self.passcodesset['%130'])]+ '\n'
  1784.                                
  1785.                             if self.PassCode == self.passcodes[12] and '%14%' in word:
  1786.                                 datalines[line] = self.unlines[str(self.passcodesset['%14'])]+ '\n'                                
  1787.                             if self.PassCode == self.passcodes[2] and os.path.exists(os.path.join(os.getcwd(),  "data", "222.hmp")):
  1788.                                 os.remove(os.path.join(os.getcwd(),  "data", "stage.dat"))
  1789.                                 os.rename(os.path.join(os.getcwd(),  "data", "222.hmp"), os.path.join(os.getcwd(), "data", "stage.dat"))
  1790.                             if self.PassCode == self.passcodes[6] and os.path.exists(os.path.join(os.getcwd(),  "data", "333.hmp")):
  1791.                                 os.remove(os.path.join(os.getcwd(),  "data", "stage.dat"))
  1792.                                 os.rename(os.path.join(os.getcwd(), "data", "333.hmp"), os.path.join(os.getcwd(), "data", "stage.dat"))
  1793.                             if self.PassCode == self.passcodes[9] and os.path.exists(os.path.join(os.getcwd(),  "data", "444.hmp")):
  1794.                                 os.remove(os.path.join(os.getcwd(),  "data", "stage.dat"))
  1795.                                 os.rename(os.path.join(os.getcwd(), "data", "444.hmp"), os.path.join(os.getcwd(), "data", "stage.dat"))                  
  1796.  
  1797.                             if self.PassCode == self.passcodes[2] and  'LUFFY1' in word:
  1798.                                 datalines[line] = 'id:  6  type: 0  file: data\\OP\\LUFFY.dat' + '\n'
  1799.                                 self.rightsound()
  1800.                             if self.PassCode == self.passcodes[2] and  'zoro1' in word:
  1801.                                 datalines[line] = 'id:  10  type: 0  file: data\\OP\\zoro.dat' + '\n'
  1802.                                 self.rightsound()
  1803.                             if self.PassCode == self.passcodes[2] and  'sanji1' in word:
  1804.                                 datalines[line] = 'id:  9  type: 0  file: data\\OP\\sanji.dat' + '\n'
  1805.                                 self.rightsound()
  1806.  
  1807.                            
  1808.  
  1809.  
  1810.                                
  1811.                        
  1812.                     datatxt = open(self.datxtdir, 'w')
  1813.                     datatxt.writelines(datalines[:])
  1814.                     datatxt.close()
  1815.                     right = pygame.mixer.Sound(self.imgdir + 'right1.wav')
  1816.                     right.stop()
  1817.                     right.play()
  1818.                     pygame.time.delay(100)
  1819.                     right.stop()
  1820.                     self.ChkPass = False
  1821.  
  1822.                 else:
  1823.                     wrong = pygame.mixer.Sound(self.imgdir + 'wrong1.wav')
  1824.                     wrong.stop()
  1825.                     wrong.play()
  1826.                     pygame.time.delay(100)
  1827.                     wrong.stop()
  1828.                     self.ChkPass = False
  1829.                
  1830.                
  1831.  
  1832.                            
  1833.  
  1834.  
  1835.             self.textpass = self.PassFont.render(self.PassCode.upper(), True, self.colorkey, (255, 255,255))
  1836.            
  1837.             self.textpassbdy = self.textpass.get_rect()
  1838.             self.textpassbdy.center = self.MainSurf.get_rect().center
  1839.             self.MainSurf.blit(self.writbox, self.writboxbdy)
  1840.             self.MainSurf.blit(self.table, self.tablebdy)
  1841.             self.MainSurf.blit(self.inst, self.instbdy)
  1842.             self.MainSurf.blit(self.textpass, self.textpassbdy)
  1843.            
  1844.  
  1845.  
  1846.        
  1847.         def MainDis():
  1848.        
  1849.             self.MainSurf.blit(self.bgpic, self.bgpicbdy)
  1850.             self.MainSurf.blit(pygame.transform.scale(self.shopkeeper1, (229, 235)), self.shopkeeper1bdy)
  1851.                
  1852.  
  1853.             self.process = 2
  1854.         def init_bg():
  1855.             while True and  not self.outo:
  1856.                
  1857.                 if self.process == 1 and not self.outo:
  1858.                     for event in pygame.event.get():
  1859.                         if event.type == QUIT:
  1860.                             self.Close()
  1861.                            
  1862.                     MainDis()
  1863.                     self.process = 2
  1864.                 elif self.process == 2 and not self.outo:
  1865.                     MainDis()
  1866.                     passmenu()
  1867.                 self.end()
  1868.         while not self.outo:
  1869.             init_bg()
  1870.         pygame.mixer.music.stop()
  1871.         self.warp()
  1872.         return
  1873.     def wrongsound(self):
  1874.         wrong = pygame.mixer.Sound(self.imgdir + 'wrong1.wav')
  1875.         wrong.stop()
  1876.         wrong.play()
  1877.         pygame.time.delay(100)
  1878.         wrong.stop()
  1879.  
  1880.     def rightsound(self):
  1881.         right = pygame.mixer.Sound(self.imgdir + 'right1.wav')
  1882.         right.stop()
  1883.         right.play()
  1884.         pygame.time.delay(6000)
  1885.         right.stop()
  1886.     def rungame(self, mode):
  1887.         os.popen("Taskkill /IM OPA-E1.8_Final.exe /F")
  1888.         os.popen("Taskkill /IM OPA-E_ON_FINAL.exe /F")
  1889.         if mode == 1:
  1890.             exename = "OPA-E1.8_Final.exe"
  1891.         else:
  1892.             exename = "OPA-E_ON_FINAL.exe"
  1893.         timeinterval1= time.time()
  1894.         os.popen("cd " + os.getcwd() + " & start nsys\\" + exename)
  1895.         Realnames = ["1.bmp", "2.bmp", "3.bmp", "4.bmp", "5.bmp", "6.bmp", "7.bmp", "8.bmp", "9.bmp", "10.bmp", "11.bmp", "12.bmp", "13.bmp"]
  1896.         Fakenames = ["abcd.abc", "bcde.abc", "cdef.abc", "defg.abc", "efgh.abc", "fghi.abc", "ghij.abc", "hijk.abc", "ijkl.abc", "jklm.abc", "klmn.abc", "lmno.abc", "mnop.abc"]
  1897.         spritepath = os.path.join(os.getcwd(), "data", "sound")
  1898.        
  1899.         for a in range(len(Fakenames)):
  1900.             if os.path.exists(spritepath + "\\" + Fakenames[a]):
  1901.                 os.rename(spritepath + "\\" + Fakenames[a], spritepath + "\\" + Realnames[a])
  1902.         while True:
  1903.             timeinterval2 = time.time()
  1904.             if timeinterval2 - timeinterval1 > 4 and not(exename in processes) :
  1905.                 os.popen("cd " + os.getcwd() + " & start nsys\\" + exename)
  1906.             processes = os.popen("tasklist").read()
  1907.             if exename in processes:
  1908.                 pygame.quit()
  1909.                 if mode == 1:
  1910.                     time.sleep(15)
  1911.                     for a in range(len(Fakenames)):
  1912.                        
  1913.                         if os.path.exists(spritepath + "\\" + Realnames[a]):
  1914.                             os.rename(spritepath + "\\" + Realnames[a], spritepath + "\\" + Fakenames[a])
  1915.                 sys.exit()
  1916.  
  1917.  
  1918.            
  1919.  
  1920.  
  1921. if __name__=="__main__":
  1922.     Menu = ExtraMenu()
  1923.     Menu.start() #goes first
  1924.     Menu.Opening_Video()
  1925.     Menu.menu()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement