Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pygame
- from pygame.locals import*
- import os, sys, time
- import webbrowser
- ###################################
- #By A-MAN/Team-A #
- #All rights reserved (c)2013-2014 #
- #One Piece A-Edition #
- #I AM HUNGRY! #
- ###################################
- class ExtraMenu:
- def Opening_Video(self):
- self.warp()
- def getunlockedlist(self):
- datatxt = open(self.datxtdir)
- a = datatxt.read()
- unlockedlist= []
- characters = ["Luffyn", "Zoron", "Sanjin", "Lucci", "Ussop", "Jinbe", "Ace", "Enel", "Aokiji", "Kuma", "Mihawk", "Whitebeard", "Shanks", "Pacifista", "SetA", "SetB", "SetC", "SetE", "Arlong", "Crocodile", "Marco", "Kizaru"]
- chardict = {"Luffyn": "data\\OP\\LUFFY.dat",
- "Zoron": "data\\OP\\zoro.dat",
- "Sanjin": "data\\OP\\sanji.dat",
- "Lucci": "data\\OP\\lucci.dat",
- "Ussop": "data\\OP\\USSP.dat",
- "Jinbe": "data\\OP\\jinbei.dat",
- "Ace": "data\\OP\\Ace.dat",
- "Enel": "data\\OP\\enel.dat",
- "Aokiji": "file: data\\OP\\Aokiji.dat",
- "Kuma": "data\\OP\\KUM.dat",
- "Mihawk": "data\\OP\\dracule_mihawk.dat",
- "Whitebeard": "file: data\\OP\\whitebeard.dat",
- "Shanks": "file: data\\OP\\shks.dat",
- "Arlong": "file: data\\OP\\Arlong.dat",
- "Crocodile": "file: data\\OP\\sirc.dat",
- "Marco": "data\\OP\\MRKPHX.dat",
- "Kizaru": "file: data\\OP\\Kizaru.dat",
- "Pacifista": "data\\OP\\enemi4.dat",
- "SetA": "data\\OP\\enemi1.dat",
- "SetB": "data\\OP\\enemi2.dat",
- "SetC": "data\\OP\\enemi3.dat",
- "SetE": "data\\OP\\enemi5.dat"}
- for b in characters:
- if chardict[b] in a:
- unlockedlist.append(b)
- return unlockedlist
- def __init__(self):
- pygame.init()
- pygame.display.set_caption("One Piece A-Edition Demo 1.8")
- pygame.mixer.init()
- pygame.mouse.set_visible(True)
- self.MainSurf = pygame.display.set_mode((794, 550), pygame.DOUBLEBUF, 32)
- self.passcodesset = {'%1' : 'berry',
- '%2' : 'champion',
- '%3' : 'face',
- '%4' : 'shirt',
- '%5' : 'grill',
- '%6' : 'bottle',
- '%7' : 'fujitora',
- '%33' : 'face2',
- '%77' : 'fujitora2',
- '%110' : 'mountain2',
- '%130' : 'xkdpxtqxq2',
- '%14' : 'xkdpxtqxq3',
- '%8' : 'apple',
- '%9' : 'panda',
- '%10' : 'mountain',
- '%11' : 'kirby',
- '%12' : 'moshimoshi',
- '%13' : 'xkdpxtqxq'}
- self.unlines = {'shirt' : "id: 8 type: 0 file: data\\OP\\lucci.dat",
- 'champion': "id: 13 type: 0 file: data\\OP\\USSP.dat",
- 'bottle' : "id: 7 type: 0 file: data\\OP\\jinbei.dat",
- 'grill' : "id: 11 type: 0 file: data\\OP\\Ace.dat",
- 'face' : "id: 5 type: 0 file: data\\OP\\enel.dat",
- 'fujitora' : "id: 14 type: 0 file: data\\OP\\Aokiji.dat",
- 'panda' : "id: 4 type: 0 file: data\\OP\\KUM.dat",
- 'face2' : "id: 450 type: 0 file: data\\OP\\enemi2.dat",
- 'fujitora2' : "id: 450 type: 0 file: data\\OP\\enemi3.dat",
- 'mountain2' : "id: 450 type: 0 file: data\\OP\\enemi4.dat",
- 'xkdpxtqxq3' : "id: 1 type: 0 file: data\\OP\\dracule_mihawk.dat",
- 'mountain' : "id: 12 type: 0 file: data\\OP\\whitebeard.dat",
- 'xkdpxtqxq' : "id: 15 type: 0 file: data\\OP\\shks.dat",
- 'xkdpxtqxq2' : "id: 450 type: 0 file: data\\OP\\enemi5.dat",
- "berry": "id: 19 type: 0 file: data\\OP\\Arlong.dat",
- "apple": "id: 17 type: 0 file: data\\OP\\sirc.dat",
- "kirby": "id: 16 type: 0 file: data\\OP\\MRKPHX.dat",
- "moshimoshi": "id: 18 type: 0 file: data\\OP\\Kizaru.dat"}
- self.passcodes = ['berry', 'champion', 'face', 'shirt', 'grill', 'bottle', 'fujitora', 'apple', 'panda', 'mountain', 'kirby', 'moshimoshi', 'xkdpxtqxq']
- self.AlphaSurf = self.MainSurf.convert_alpha()
- self.AlphaSurfrect = self.AlphaSurf.get_rect()
- self.AlphaSurfrect.center = self.MainSurf.get_rect().center
- self.bgcolor = (0, 0, 0, 255)
- self.datxtdir = os.path.join(os.getcwd(), "data", "data.txt")
- self.imgdir = os.path.join(os.getcwd(),"nsys\\")
- self.bgpic = pygame.image.load(self.imgdir + "bg.PNG")
- self.shopkeeper1= pygame.image.load(self.imgdir + "shopkeeper1.PNG")
- self.table= pygame.image.load(self.imgdir + "table.PNG")
- self.tablebdy= self.table.get_rect()
- self.writbox= pygame.image.load(self.imgdir + "a.PNG")
- self.inst= pygame.image.load(self.imgdir + "inst2.PNG")
- self.writboxbdy= self.writbox.get_rect()
- self.colorkey = self.writbox.get_at((abs(self.writboxbdy.height/2),abs(self.writboxbdy.width/20)))
- self.writboxbdy.center = self.MainSurf.get_rect().center
- self.tablebdy.centerx = self.MainSurf.get_rect().centerx
- self.tablebdy.bottom = self.MainSurf.get_rect().bottom
- self.shopkeeper1bdy= self.shopkeeper1.get_rect()
- self.shopkeeper1bdy.centerx = self.MainSurf.get_rect().centerx + 210
- self.shopkeeper1bdy.centery = self.MainSurf.get_rect().centery + 105
- self.shopkeeper1.set_colorkey((0, 0, 255))
- self.inst.set_colorkey((0, 0, 255))
- self.bgpicbdy = self.bgpic.get_rect()
- self.instbdy = self.inst.get_rect()
- self.instbdy.center =(self.MainSurf.get_rect().centerx, self.MainSurf.get_rect().centery-220)
- self.bgpicbdy.center = self.MainSurf.get_rect().center
- self.MainSurf.fill(self.bgcolor)
- self.Clock = pygame.time.Clock()
- self.FPS = 25
- self.PassFont = pygame.font.SysFont(None, 33)
- self.PassCode = ''
- self.ChkPass = False
- def end(self):
- pygame.display.update()
- self.Clock.tick(self.FPS)
- def Close(self):
- pygame.quit()
- sys.exit()
- def start(self):
- intro= pygame.image.load(self.imgdir + "intro1.PNG")
- introbdy = intro.get_rect()
- introbdy.center = self.MainSurf.get_rect().center
- intro2= pygame.image.load(self.imgdir + "intro2.PNG")
- setintro1 = True
- setintro2 = False
- dofade = True
- timeh1 = None
- INTRO = False
- while INTRO == False:
- if dofade == True:
- for a in range(11):
- self.MainSurf.blit(intro, introbdy)
- self.MainSurf.blit(self.AlphaSurf, self.AlphaSurfrect)
- pygame.draw.rect(self.AlphaSurf, (255, 255, 255, 255 - (a*25+5)), (0, 0, 800, 600))
- dofade= False
- pygame.display.update()
- self.Clock.tick(self.FPS)
- self.MainSurf.fill((0, 0, 0, 0))
- timeh1 = time.time()
- for event in pygame.event.get():
- if event.type == QUIT:
- self.Close()
- for event in pygame.event.get():
- if event.type == QUIT:
- self.Close()
- self.MainSurf.blit(intro, introbdy)
- pygame.display.update()
- self.Clock.tick(self.FPS)
- self.MainSurf.fill((0, 0, 0, 0))
- timeh2 = time.time()
- if timeh2 - timeh1 > 1.5:
- for a in range(11):
- self.MainSurf.blit(intro, introbdy)
- self.MainSurf.blit(self.AlphaSurf, self.AlphaSurfrect)
- pygame.draw.rect(self.AlphaSurf, (255, 255, 255, a*25+5), (0, 0, 800, 600))
- dofade= False
- pygame.display.update()
- self.Clock.tick(self.FPS)
- self.MainSurf.fill((0, 0, 0, 0))
- timeh1 = time.time()
- for event in pygame.event.get():
- if event.type == QUIT:
- self.Close()
- for a in range(11):
- self.MainSurf.blit(intro2, introbdy)
- self.MainSurf.blit(self.AlphaSurf, self.AlphaSurfrect)
- pygame.draw.rect(self.AlphaSurf, (255, 255, 255, 255-(a*25+5)), (0, 0, 800, 600))
- dofade= False
- pygame.display.update()
- self.Clock.tick(self.FPS)
- self.MainSurf.fill((0, 0, 0, 0))
- timeh1 = time.time()
- for event in pygame.event.get():
- if event.type == QUIT:
- self.Close()
- while INTRO == False:
- dofade = True
- for event in pygame.event.get():
- if event.type == QUIT:
- self.Close()
- self.MainSurf.blit(intro2, introbdy)
- pygame.display.update()
- self.Clock.tick(self.FPS)
- self.MainSurf.fill((0, 0, 0, 0))
- timeh2 = time.time()
- if timeh2 - timeh1 > 1.5:
- for a in range(11):
- self.MainSurf.blit(intro2, introbdy)
- self.MainSurf.blit(self.AlphaSurf, self.AlphaSurfrect)
- pygame.draw.rect(self.AlphaSurf, (255, 255, 255, a*25+5), (0, 0, 800, 600))
- dofade= False
- pygame.display.update()
- self.Clock.tick(self.FPS)
- self.MainSurf.fill((0, 0, 0, 0))
- timeh1 = time.time()
- for event in pygame.event.get():
- if event.type == QUIT:
- self.Close()
- INTRO = True
- return
- def warp(self):
- for a in range(11):
- self.MainSurf.blit(self.AlphaSurf, self.AlphaSurfrect)
- pygame.draw.rect(self.AlphaSurf, (255, 255, 255, a*25+5), (0, 0, 800, 600))
- dofade= False
- pygame.display.update()
- self.Clock.tick(self.FPS*3)
- self.MainSurf.fill((0, 0, 0, 0))
- for event in pygame.event.get():
- if event.type == QUIT:
- self.Close()
- for a in range(11):
- self.MainSurf.blit(self.AlphaSurf, self.AlphaSurfrect)
- pygame.draw.rect(self.AlphaSurf, (255, 255, 255, 255-(a*25+5)), (0, 0, 800, 600))
- dofade= False
- pygame.display.update()
- self.Clock.tick(self.FPS*3)
- self.MainSurf.fill((0, 0, 0, 0))
- for event in pygame.event.get():
- if event.type == QUIT:
- self.Close()
- return
- def credit_slide(self):
- slide_speed = 5
- CREDIT = pygame.image.load(self.imgdir + "CREDIT.PNG").convert()
- CREDIT.set_colorkey((0, 0, 0))
- menuitemsnorml= pygame.image.load(self.imgdir + "MENUITEMS_NONCHOSEN.PNG").convert()
- menuitemsnorml.set_colorkey((0, 0, 0))
- menuitemsbdy = menuitemsnorml.get_rect()
- menuitemsbdy.centerx = self.MainSurf.get_rect().centerx
- menuitemsbdy.centery = self.MainSurf.get_rect().centery + 80
- CREDIT.set_colorkey((0, 0, 0, 255))
- CREDITbdy = CREDIT.get_rect()
- CREDITbdy.centerx = self.MainSurf.get_rect().centerx
- CREDITbdy.top = self.MainSurf.get_rect().top + self.MainSurf.get_rect().height + 30
- CREDIT_H = CREDITbdy.height
- MenuBG = pygame.image.load(self.imgdir + "MENU_BG.PNG").convert()
- MenuBG.set_colorkey((0, 0, 0))
- MenuBGbdy = MenuBG.get_rect()
- MenuBGbdy.center = self.MainSurf.get_rect().center
- self.MainSurf.fill((0, 0, 0))
- pygame.display.flip()
- while "hungry":
- self.warp()
- for a in range((CREDIT_H/slide_speed)+150):
- self.MainSurf.blit(CREDIT, CREDITbdy)
- CREDITbdy.bottom -= slide_speed
- for event in pygame.event.get():
- if event.type == QUIT:
- self.Close()
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- self.warp()
- return
- pygame.display.flip()
- self.Clock.tick(20)
- self.MainSurf.fill((0, 0, 0))
- self.warp()
- return
- def options(self):
- OPTIONS_BG = pygame.image.load(self.imgdir + "OPTIONS_BG.PNG").convert()
- OPTIONS_NONHIGHLIGHTED = pygame.image.load(self.imgdir + "OPTIONITEMS_NONCHOSEN.PNG").convert()
- OPTIONS_NONHIGHLIGHTED.set_colorkey((0, 0, 0))
- OPTIONS_HIGHLIGHTED = pygame.image.load(self.imgdir + "OPTIONITEMS_CHOSEN.PNG")
- OPTIONS_HIGHLIGHTED.set_colorkey((0, 0, 0))
- opbgb = OPTIONS_BG.get_rect()
- opbgb.center = self.MainSurf.get_rect().center
- opb = OPTIONS_NONHIGHLIGHTED.get_rect()
- opb.center = self.MainSurf.get_rect().center
- opb.centery += 65
- optionitemsindex= [None, (0, 0, 472, 130), (0, 130, 472, 130), (0, 260, 472, 130)]
- menupos = 1
- self.warp()
- while "retard":
- for event in pygame.event.get():
- if event.type == QUIT:
- pygame.quit()
- sys.exit()
- if menupos == 1:
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- self.warp()
- return
- if event.key == K_DOWN:
- menupos += 1
- if event.key == K_RETURN or event.key == K_SPACE:
- self.controls()
- elif menupos == 2 and len(self.getunlockedlist()) == 17:
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- self.warp()
- return
- if event.key == K_UP:
- menupos -= 1
- if event.key == K_RETURN or event.key == K_SPACE:
- self.recording_toggle()
- elif menupos == 2 and len(self.getunlockedlist()) != 17:
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- self.warp()
- return
- if event.key == K_UP:
- menupos -= 1
- if event.key == K_RETURN or event.key == K_SPACE:
- self.wrongsound()
- # if event.key == K_DOWN:
- # menupos += 1
- #elif menupos == 3:
- # if event.type == KEYDOWN:
- # if event.key == K_ESCAPE:
- # self.warp()
- # return
- # if event.key == K_UP:
- # menupos -= 1
- self.MainSurf.blit(OPTIONS_BG, opbgb)
- if menupos == 1:
- self.MainSurf.blit(OPTIONS_HIGHLIGHTED, opb, area = optionitemsindex[1])
- else:
- self.MainSurf.blit(OPTIONS_NONHIGHLIGHTED, opb, area = optionitemsindex[1])
- if menupos == 2 and len(self.getunlockedlist()) == 22:
- self.MainSurf.blit(OPTIONS_HIGHLIGHTED, (opb[0], opb[1]+130, opb[2], opb[3]), area = optionitemsindex[2])
- elif menupos == 2 and len(self.getunlockedlist()) != 22:
- self.MainSurf.blit(OPTIONS_HIGHLIGHTED, (opb[0], opb[1]+130, opb[2], opb[3]), area = optionitemsindex[3])
- elif len(self.getunlockedlist()) != 22:
- self.MainSurf.blit(OPTIONS_NONHIGHLIGHTED, (opb[0], opb[1]+130, opb[2], opb[3]), area = optionitemsindex[3])
- else:
- self.MainSurf.blit(OPTIONS_NONHIGHLIGHTED, (opb[0], opb[1]+130, opb[2], opb[3]), area = optionitemsindex[2])
- # if menupos == 3:
- # self.MainSurf.blit(OPTIONS_HIGHLIGHTED, (opb[0], opb[1]+260, opb[2], opb[3]), area = optionitemsindex[3])
- # else:
- # self.MainSurf.blit(OPTIONS_NONHIGHLIGHTED, (opb[0], opb[1]+260, opb[2], opb[3]), area = optionitemsindex[3])
- pygame.display.update()
- self.MainSurf.fill((0, 0, 0))
- def how_play(self):
- pygame.mixer.music.load(self.imgdir + 'menu.mp3')
- pygame.mixer.music.play(-1, 0)
- def scrolla(scroll, bdy1, bdy2, pic1, pic2):
- for a in range(10):
- for event in pygame.event.get():
- if event.type == QUIT:
- pygame.quit()
- sys.exit()
- if scroll == "Left":
- bdy1.centerx += self.MainSurf.get_rect().width/10
- bdy2.centerx += self.MainSurf.get_rect().width/10
- if scroll == "Right":
- bdy1.centerx -= self.MainSurf.get_rect().width/10
- bdy2.centerx -= self.MainSurf.get_rect().width/10
- if scroll == "Up":
- bdy1.centery += self.MainSurf.get_rect().height/10
- bdy2.centery += self.MainSurf.get_rect().height/10
- if scroll == "Down":
- bdy1.centery -= self.MainSurf.get_rect().height/10
- bdy2.centery -= self.MainSurf.get_rect().height/10
- self.MainSurf.blit(pic1, bdy1)
- self.MainSurf.blit(pic2, bdy2)
- pygame.display.update(self.MainSurf.get_rect())
- self.Clock.tick(self.FPS*2)
- self.MainSurf.fill((0, 0, 0))
- scroll = None
- return scroll, bdy1, bdy2
- HOWPLAY_INTRO = pygame.image.load(self.imgdir + "HOWTOPLAY.PNG").convert()
- HOWPLAY_INTRObdy = HOWPLAY_INTRO.get_rect()
- HOWPLAY_INTRObdy.center = self.MainSurf.get_rect().center
- HOWPLAY_FI = pygame.image.load(self.imgdir + "HOWTOPLAY_FI.PNG").convert()
- HOWPLAY_FIbdy = HOWPLAY_FI.get_rect()
- HOWPLAY_FIbdy.centerx = self.MainSurf.get_rect().centerx - self.MainSurf.get_rect().width
- HOWPLAY_FIbdy.centery = self.MainSurf.get_rect().centery
- QMiddle = pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "999.PNG").convert()
- QLast = pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "9999.PNG").convert()
- MVLIST1 = pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "1.PNG").convert()
- MVLIST2 = pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "2.PNG").convert()
- MVLIST3 = pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "3.PNG").convert()
- MVLIST4 = pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "4.PNG").convert()
- MVLIST5 = pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "5.PNG").convert()
- MVLIST6 = pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "6.PNG").convert()
- MVLIST7 = pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "7.PNG").convert()
- MVLIST8 = pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "8.PNG").convert()
- MVLIST9 = pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "9.PNG").convert()
- MVLIST10= pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "10.PNG").convert()
- MVLIST11= pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "11.PNG").convert()
- MVLIST12= pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "12.PNG").convert()
- MVLIST13= pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "13.PNG").convert()
- MVLIST14= pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "14.PNG").convert()
- MVLIST15= pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "15.PNG").convert()
- MVLIST16= pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "16.PNG").convert()
- MVLIST17= pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "17.PNG").convert()
- MVLIST18= pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "18.PNG").convert()
- MVLIST19= pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "19.PNG").convert()
- MVLIST20= pygame.image.load(os.path.join(self.imgdir,"mvlist\\") + "20.PNG").convert()
- MVLISTS = [MVLIST1, MVLIST2, MVLIST3, MVLIST4, MVLIST5, MVLIST6, MVLIST7, MVLIST8, MVLIST9, MVLIST10,
- MVLIST11, MVLIST12, MVLIST13, MVLIST14, MVLIST15, MVLIST16, MVLIST17, MVLIST18, MVLIST19, MVLIST20]
- Charsun = self.getunlockedlist()
- if "Ussop" not in Charsun:
- MVLIST4 = QMiddle
- if "Arlong" not in Charsun:
- MVLIST5 = QMiddle
- if "Crocodile" not in Charsun:
- MVLIST6 = QMiddle
- if "Enel" not in Charsun:
- MVLIST7 = QMiddle
- if "Lucci" not in Charsun:
- MVLIST8 = QMiddle
- if "Jinbe" not in Charsun:
- MVLIST9 = QMiddle
- if "Ace" not in Charsun:
- MVLIST10 = QMiddle
- if "Marco" not in Charsun:
- MVLIST11 = QMiddle
- if "Whitebeard" not in Charsun:
- MVLIST12 = QMiddle
- if "Aokiji" not in Charsun:
- MVLIST13 = QMiddle
- if "Kizaru" not in Charsun:
- MVLIST14 = QMiddle
- if "Kuma" not in Charsun:
- MVLIST15 = QMiddle
- if "Shanks" not in Charsun:
- MVLIST16 = QMiddle
- if "Mihawk" not in Charsun:
- MVLIST17 = QMiddle
- if "Luffyn" not in Charsun:
- MVLIST18 = QMiddle
- if "Sanjin" not in Charsun:
- MVLIST19 = QMiddle
- if "Pacifista" not in Charsun:
- MVLIST20 = QLast
- MVLISTBDYS = [None,]
- tempostuff = None
- for a in MVLISTS:
- tempostuff = a.get_rect()
- tempostuff.centery += self.MainSurf.get_rect().height
- MVLISTBDYS.append(tempostuff)
- tempostuff = None
- MVLISTBDYS[1].centery -= self.MainSurf.get_rect().height
- MVLISTBDYS[1].centerx += self.MainSurf.get_rect().width
- pos = 1
- self.warp()
- scroll = None
- while "bored":
- if pos == 1:
- while scroll == 'Left':
- scroll, MVLISTBDYS[1], HOWPLAY_INTRObdy = scrolla(scroll, MVLISTBDYS[1], HOWPLAY_INTRObdy, MVLIST1, HOWPLAY_INTRO)
- while scroll == 'Right':
- scroll, HOWPLAY_FIbdy, HOWPLAY_INTRObdy = scrolla(scroll, HOWPLAY_FIbdy, HOWPLAY_INTRObdy, HOWPLAY_FI, HOWPLAY_INTRO)
- for event in pygame.event.get():
- if event.type == QUIT:
- pygame.quit()
- sys.exit()
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- pygame.mixer.music.stop()
- self.warp()
- return
- if event.key == K_RIGHT:
- pos += 1
- scroll = 'Right'
- if event.key == K_LEFT:
- pos -= 1
- scroll = 'Left'
- self.MainSurf.fill((0, 0, 0))
- self.MainSurf.blit(HOWPLAY_INTRO, HOWPLAY_INTRObdy)
- pygame.display.update()
- self.Clock.tick(self.FPS+5)
- if pos == 2:
- while scroll == 'Right':
- scroll, MVLISTBDYS[1], HOWPLAY_INTRObdy = scrolla(scroll, MVLISTBDYS[1], HOWPLAY_INTRObdy, MVLIST1, HOWPLAY_INTRO)
- while scroll == 'Up':
- scroll, MVLISTBDYS[1], MVLISTBDYS[2] = scrolla(scroll, MVLISTBDYS[1], MVLISTBDYS[2], MVLIST1, MVLIST2)
- for event in pygame.event.get():
- if event.type == QUIT:
- pygame.quit()
- sys.exit()
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- self.warp()
- return
- if event.key == K_LEFT:
- pos -= 1
- scroll = 'Left'
- if event.key == K_DOWN:
- pos += 1
- scroll = 'Down'
- self.MainSurf.fill((0, 0, 0))
- self.MainSurf.blit(MVLIST1, MVLISTBDYS[1])
- pygame.display.update()
- self.Clock.tick(self.FPS+5)
- if pos == 3:
- while scroll == 'Down':
- scroll, MVLISTBDYS[2], MVLISTBDYS[1] = scrolla(scroll, MVLISTBDYS[2], MVLISTBDYS[1], MVLIST2, MVLIST1)
- while scroll == 'Up':
- scroll, MVLISTBDYS[2], MVLISTBDYS[3] = scrolla(scroll, MVLISTBDYS[2], MVLISTBDYS[3], MVLIST2, MVLIST3)
- for event in pygame.event.get():
- if event.type == QUIT:
- pygame.quit()
- sys.exit()
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- self.warp()
- return
- if event.key == K_DOWN:
- pos += 1
- scroll = 'Down'
- if event.key == K_UP:
- pos -= 1
- scroll = 'Up'
- self.MainSurf.fill((0, 0, 0))
- self.MainSurf.blit(MVLIST2, MVLISTBDYS[2])
- pygame.display.update()
- self.Clock.tick(self.FPS+5)
- if pos == 4:
- while scroll == 'Down':
- scroll, MVLISTBDYS[3], MVLISTBDYS[2] = scrolla(scroll, MVLISTBDYS[3], MVLISTBDYS[2], MVLIST3, MVLIST2)
- while scroll == 'Up':
- scroll, MVLISTBDYS[3], MVLISTBDYS[4] = scrolla(scroll, MVLISTBDYS[3], MVLISTBDYS[4], MVLIST3, MVLIST4)
- for event in pygame.event.get():
- if event.type == QUIT:
- pygame.quit()
- sys.exit()
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- self.warp()
- return
- if event.key == K_DOWN:
- pos += 1
- scroll = 'Down'
- if event.key == K_UP:
- pos -= 1
- scroll = 'Up'
- self.MainSurf.fill((0, 0, 0))
- self.MainSurf.blit(MVLIST3, MVLISTBDYS[3])
- pygame.display.update()
- self.Clock.tick(self.FPS+5)
- if pos == 5:
- while scroll == 'Down':
- scroll, MVLISTBDYS[4], MVLISTBDYS[3] = scrolla(scroll, MVLISTBDYS[4], MVLISTBDYS[3], MVLIST4, MVLIST3)
- while scroll == 'Up':
- scroll, MVLISTBDYS[4], MVLISTBDYS[5] = scrolla(scroll, MVLISTBDYS[4], MVLISTBDYS[5], MVLIST4, MVLIST5)
- for event in pygame.event.get():
- if event.type == QUIT:
- pygame.quit()
- sys.exit()
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- self.warp()
- return
- if event.key == K_DOWN:
- pos += 1
- scroll = 'Down'
- if event.key == K_UP:
- pos -= 1
- scroll = 'Up'
- self.MainSurf.fill((0, 0, 0))
- self.MainSurf.blit(MVLIST4, MVLISTBDYS[4])
- pygame.display.update()
- self.Clock.tick(self.FPS+5)
- if pos == 6:
- while scroll == 'Down':
- scroll, MVLISTBDYS[5], MVLISTBDYS[4] = scrolla(scroll, MVLISTBDYS[5], MVLISTBDYS[4], MVLIST5, MVLIST4)
- while scroll == 'Up':
- scroll, MVLISTBDYS[5], MVLISTBDYS[6] = scrolla(scroll, MVLISTBDYS[5], MVLISTBDYS[6], MVLIST5, MVLIST6)
- for event in pygame.event.get():
- if event.type == QUIT:
- pygame.quit()
- sys.exit()
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- self.warp()
- return
- if event.key == K_DOWN:
- pos += 1
- scroll = 'Down'
- if event.key == K_UP:
- pos -= 1
- scroll = 'Up'
- self.MainSurf.fill((0, 0, 0))
- self.MainSurf.blit(MVLIST5, MVLISTBDYS[5])
- pygame.display.update()
- self.Clock.tick(self.FPS+5)
- if pos == 7:
- while scroll == 'Down':
- scroll, MVLISTBDYS[6], MVLISTBDYS[5] = scrolla(scroll, MVLISTBDYS[6], MVLISTBDYS[5], MVLIST6, MVLIST5)
- while scroll == 'Up':
- scroll, MVLISTBDYS[6], MVLISTBDYS[7] = scrolla(scroll, MVLISTBDYS[6], MVLISTBDYS[7], MVLIST6, MVLIST7)
- for event in pygame.event.get():
- if event.type == QUIT:
- pygame.quit()
- sys.exit()
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- self.warp()
- return
- if event.key == K_DOWN:
- pos += 1
- scroll = 'Down'
- if event.key == K_UP:
- pos -= 1
- scroll = 'Up'
- self.MainSurf.fill((0, 0, 0))
- self.MainSurf.blit(MVLIST6, MVLISTBDYS[6])
- pygame.display.update()
- self.Clock.tick(self.FPS+5)
- if pos == 8:
- while scroll == 'Down':
- scroll, MVLISTBDYS[7], MVLISTBDYS[6] = scrolla(scroll, MVLISTBDYS[7], MVLISTBDYS[6], MVLIST7, MVLIST6)
- while scroll == 'Up':
- scroll, MVLISTBDYS[7], MVLISTBDYS[8] = scrolla(scroll, MVLISTBDYS[7], MVLISTBDYS[8], MVLIST7, MVLIST8)
- for event in pygame.event.get():
- if event.type == QUIT:
- pygame.quit()
- sys.exit()
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- self.warp()
- return
- if event.key == K_DOWN:
- pos += 1
- scroll = 'Down'
- if event.key == K_UP:
- pos -= 1
- scroll = 'Up'
- self.MainSurf.fill((0, 0, 0))
- self.MainSurf.blit(MVLIST7, MVLISTBDYS[7])
- pygame.display.update()
- self.Clock.tick(self.FPS+5)
- if pos == 9:
- while scroll == 'Down':
- scroll, MVLISTBDYS[8], MVLISTBDYS[7] = scrolla(scroll, MVLISTBDYS[8], MVLISTBDYS[7], MVLIST8, MVLIST7)
- while scroll == 'Up':
- scroll, MVLISTBDYS[8], MVLISTBDYS[9] = scrolla(scroll, MVLISTBDYS[8], MVLISTBDYS[9], MVLIST8, MVLIST9)
- for event in pygame.event.get():
- if event.type == QUIT:
- pygame.quit()
- sys.exit()
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- self.warp()
- return
- if event.key == K_DOWN:
- pos += 1
- scroll = 'Down'
- if event.key == K_UP:
- pos -= 1
- scroll = 'Up'
- self.MainSurf.fill((0, 0, 0))
- self.MainSurf.blit(MVLIST8, MVLISTBDYS[8])
- pygame.display.update()
- self.Clock.tick(self.FPS+5)
- if pos == 10:
- while scroll == 'Down':
- scroll, MVLISTBDYS[9], MVLISTBDYS[8] = scrolla(scroll, MVLISTBDYS[9], MVLISTBDYS[8], MVLIST9, MVLIST8)
- while scroll == 'Up':
- scroll, MVLISTBDYS[9], MVLISTBDYS[10] = scrolla(scroll, MVLISTBDYS[9], MVLISTBDYS[10], MVLIST9, MVLIST10)
- for event in pygame.event.get():
- if event.type == QUIT:
- pygame.quit()
- sys.exit()
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- self.warp()
- return
- if event.key == K_DOWN:
- pos += 1
- scroll = 'Down'
- if event.key == K_UP:
- pos -= 1
- scroll = 'Up'
- self.MainSurf.fill((0, 0, 0))
- self.MainSurf.blit(MVLIST9, MVLISTBDYS[9])
- pygame.display.update()
- self.Clock.tick(self.FPS+5)
- if pos == 11:
- while scroll == 'Down':
- scroll, MVLISTBDYS[10], MVLISTBDYS[9] = scrolla(scroll, MVLISTBDYS[10], MVLISTBDYS[9], MVLIST10, MVLIST9)
- while scroll == 'Up':
- scroll, MVLISTBDYS[10], MVLISTBDYS[11] = scrolla(scroll, MVLISTBDYS[10], MVLISTBDYS[11], MVLIST10, MVLIST11)
- for event in pygame.event.get():
- if event.type == QUIT:
- pygame.quit()
- sys.exit()
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- self.warp()
- return
- if event.key == K_DOWN:
- pos += 1
- scroll = 'Down'
- if event.key == K_UP:
- pos -= 1
- scroll = 'Up'
- self.MainSurf.fill((0, 0, 0))
- self.MainSurf.blit(MVLIST10, MVLISTBDYS[10])
- pygame.display.update()
- self.Clock.tick(self.FPS+5)
- if pos == 12:
- while scroll == 'Down':
- scroll, MVLISTBDYS[11], MVLISTBDYS[10] = scrolla(scroll, MVLISTBDYS[11], MVLISTBDYS[10], MVLIST11, MVLIST10)
- while scroll == 'Up':
- scroll, MVLISTBDYS[11], MVLISTBDYS[12] = scrolla(scroll, MVLISTBDYS[11], MVLISTBDYS[12], MVLIST11, MVLIST12)
- for event in pygame.event.get():
- if event.type == QUIT:
- pygame.quit()
- sys.exit()
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- self.warp()
- return
- if event.key == K_DOWN:
- pos += 1
- scroll = 'Down'
- if event.key == K_UP:
- pos -= 1
- scroll = 'Up'
- self.MainSurf.fill((0, 0, 0))
- self.MainSurf.blit(MVLIST11, MVLISTBDYS[11])
- pygame.display.update()
- self.Clock.tick(self.FPS+5)
- if pos == 13:
- while scroll == 'Down':
- scroll, MVLISTBDYS[12], MVLISTBDYS[11] = scrolla(scroll, MVLISTBDYS[12], MVLISTBDYS[11], MVLIST12, MVLIST11)
- while scroll == 'Up':
- scroll, MVLISTBDYS[12], MVLISTBDYS[13] = scrolla(scroll, MVLISTBDYS[12], MVLISTBDYS[13], MVLIST12, MVLIST13)
- for event in pygame.event.get():
- if event.type == QUIT:
- pygame.quit()
- sys.exit()
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- self.warp()
- return
- if event.key == K_DOWN:
- pos += 1
- scroll = 'Down'
- if event.key == K_UP:
- pos -= 1
- scroll = 'Up'
- self.MainSurf.fill((0, 0, 0))
- self.MainSurf.blit(MVLIST12, MVLISTBDYS[12])
- pygame.display.update()
- self.Clock.tick(self.FPS+5)
- if pos == 14:
- while scroll == 'Down':
- scroll, MVLISTBDYS[13], MVLISTBDYS[12] = scrolla(scroll, MVLISTBDYS[13], MVLISTBDYS[12], MVLIST13, MVLIST12)
- while scroll == 'Up':
- scroll, MVLISTBDYS[13], MVLISTBDYS[14] = scrolla(scroll, MVLISTBDYS[13], MVLISTBDYS[14], MVLIST13, MVLIST14)
- for event in pygame.event.get():
- if event.type == QUIT:
- pygame.quit()
- sys.exit()
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- self.warp()
- return
- if event.key == K_DOWN:
- pos += 1
- scroll = 'Down'
- if event.key == K_UP:
- pos -= 1
- scroll = 'Up'
- self.MainSurf.fill((0, 0, 0))
- self.MainSurf.blit(MVLIST13, MVLISTBDYS[13])
- pygame.display.update()
- self.Clock.tick(self.FPS+5)
- if pos == 15:
- while scroll == 'Down':
- scroll, MVLISTBDYS[14], MVLISTBDYS[13] = scrolla(scroll, MVLISTBDYS[14], MVLISTBDYS[13], MVLIST14, MVLIST13)
- while scroll == 'Up':
- scroll, MVLISTBDYS[14], MVLISTBDYS[15] = scrolla(scroll, MVLISTBDYS[14], MVLISTBDYS[15], MVLIST14, MVLIST15)
- for event in pygame.event.get():
- if event.type == QUIT:
- pygame.quit()
- sys.exit()
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- self.warp()
- return
- if event.key == K_DOWN:
- pos += 1
- scroll = 'Down'
- if event.key == K_UP:
- pos -= 1
- scroll = 'Up'
- self.MainSurf.fill((0, 0, 0))
- self.MainSurf.blit(MVLIST14, MVLISTBDYS[14])
- pygame.display.update()
- self.Clock.tick(self.FPS+5)
- if pos == 16:
- while scroll == 'Down':
- scroll, MVLISTBDYS[15], MVLISTBDYS[14] = scrolla(scroll, MVLISTBDYS[15], MVLISTBDYS[14], MVLIST15, MVLIST14)
- while scroll == 'Up':
- scroll, MVLISTBDYS[15], MVLISTBDYS[16] = scrolla(scroll, MVLISTBDYS[15], MVLISTBDYS[16], MVLIST15, MVLIST16)
- for event in pygame.event.get():
- if event.type == QUIT:
- pygame.quit()
- sys.exit()
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- self.warp()
- return
- if event.key == K_UP:
- pos -= 1
- scroll = 'Up'
- if event.key == K_DOWN:
- pos += 1
- scroll = 'Down'
- self.MainSurf.fill((0, 0, 0))
- self.MainSurf.blit(MVLIST15, MVLISTBDYS[15])
- pygame.display.update()
- self.Clock.tick(self.FPS+5)
- if pos == 17:
- while scroll == 'Down':
- scroll, MVLISTBDYS[16], MVLISTBDYS[15] = scrolla(scroll, MVLISTBDYS[16], MVLISTBDYS[15], MVLIST16, MVLIST15)
- while scroll == 'Up':
- scroll, MVLISTBDYS[16], MVLISTBDYS[17] = scrolla(scroll, MVLISTBDYS[16], MVLISTBDYS[17], MVLIST16, MVLIST17)
- for event in pygame.event.get():
- if event.type == QUIT:
- pygame.quit()
- sys.exit()
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- self.warp()
- return
- if event.key == K_UP:
- pos -= 1
- scroll = 'Up'
- if event.key == K_DOWN:
- pos += 1
- scroll = 'Down'
- self.MainSurf.fill((0, 0, 0))
- self.MainSurf.blit(MVLIST16, MVLISTBDYS[16])
- pygame.display.update()
- self.Clock.tick(self.FPS+5)
- if pos == 18:
- while scroll == 'Down':
- scroll, MVLISTBDYS[17], MVLISTBDYS[16] = scrolla(scroll, MVLISTBDYS[17], MVLISTBDYS[16], MVLIST17, MVLIST16)
- while scroll == 'Up':
- scroll, MVLISTBDYS[17], MVLISTBDYS[18] = scrolla(scroll, MVLISTBDYS[17], MVLISTBDYS[18], MVLIST17, MVLIST18)
- for event in pygame.event.get():
- if event.type == QUIT:
- pygame.quit()
- sys.exit()
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- self.warp()
- return
- if event.key == K_UP:
- pos -= 1
- scroll = 'Up'
- if event.key == K_DOWN:
- pos += 1
- scroll = 'Down'
- self.MainSurf.fill((0, 0, 0))
- self.MainSurf.blit(MVLIST17, MVLISTBDYS[17])
- pygame.display.update()
- self.Clock.tick(self.FPS+5)
- if pos == 19:
- while scroll == 'Down':
- scroll, MVLISTBDYS[18], MVLISTBDYS[17] = scrolla(scroll, MVLISTBDYS[18], MVLISTBDYS[17], MVLIST18, MVLIST17)
- while scroll == 'Up':
- scroll, MVLISTBDYS[18], MVLISTBDYS[19] = scrolla(scroll, MVLISTBDYS[18], MVLISTBDYS[19], MVLIST18, MVLIST19)
- for event in pygame.event.get():
- if event.type == QUIT:
- pygame.quit()
- sys.exit()
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- self.warp()
- return
- if event.key == K_UP:
- pos -= 1
- scroll = 'Up'
- if event.key == K_DOWN:
- pos += 1
- scroll = 'Down'
- self.MainSurf.fill((0, 0, 0))
- self.MainSurf.blit(MVLIST18, MVLISTBDYS[18])
- pygame.display.update()
- self.Clock.tick(self.FPS+5)
- if pos == 20:
- while scroll == 'Down':
- scroll, MVLISTBDYS[19], MVLISTBDYS[18] = scrolla(scroll, MVLISTBDYS[19], MVLISTBDYS[18], MVLIST19, MVLIST18)
- while scroll == 'Up':
- scroll, MVLISTBDYS[19], MVLISTBDYS[20] = scrolla(scroll, MVLISTBDYS[19], MVLISTBDYS[20], MVLIST19, MVLIST20)
- for event in pygame.event.get():
- if event.type == QUIT:
- pygame.quit()
- sys.exit()
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- self.warp()
- return
- if event.key == K_UP:
- pos -= 1
- scroll = 'Up'
- if event.key == K_DOWN:
- pos += 1
- scroll = 'Down'
- self.MainSurf.fill((0, 0, 0))
- self.MainSurf.blit(MVLIST19, MVLISTBDYS[19])
- pygame.display.update()
- self.Clock.tick(self.FPS+5)
- if pos == 21:
- while scroll == 'Down':
- scroll, MVLISTBDYS[20], MVLISTBDYS[19] = scrolla(scroll, MVLISTBDYS[20], MVLISTBDYS[19], MVLIST20, MVLIST19)
- for event in pygame.event.get():
- if event.type == QUIT:
- pygame.quit()
- sys.exit()
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- self.warp()
- return
- if event.key == K_UP:
- pos -= 1
- scroll = 'Up'
- self.MainSurf.fill((0, 0, 0))
- self.MainSurf.blit(MVLIST20, MVLISTBDYS[20])
- pygame.display.update()
- self.Clock.tick(self.FPS+5)
- if pos == 99:
- while scroll == 'Down':
- scroll, HOWPLAY_MVLISTQbdy, HOWPLAY_MVLISTbdy = scrolla(scroll, HOWPLAY_MVLISTQbdy, HOWPLAY_MVLISTbdy, HOWPLAY_MVLISTQ, HOWPLAY_MVLIST)
- for event in pygame.event.get():
- if event.type == QUIT:
- pygame.quit()
- sys.exit()
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- self.warp()
- return
- if event.key == K_UP:
- pos -= 1
- scroll = 'Up'
- self.MainSurf.fill((0, 0, 0))
- self.MainSurf.blit(HOWPLAY_MVLISTQ, HOWPLAY_MVLISTQbdy)
- pygame.display.update()
- self.Clock.tick(self.FPS+5)
- if pos == 0:
- while scroll == 'Left':
- scroll, HOWPLAY_FIbdy, HOWPLAY_INTRObdy = scrolla(scroll, HOWPLAY_FIbdy, HOWPLAY_INTRObdy, HOWPLAY_FI, HOWPLAY_INTRO)
- for event in pygame.event.get():
- if event.type == QUIT:
- pygame.quit()
- sys.exit()
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- self.warp()
- return
- if event.key == K_RIGHT:
- pos += 1
- scroll = 'Right'
- elif event.type == MOUSEBUTTONUP:
- mousex, mousey = event.pos
- if pygame.Rect(67, 181, 350, 25).collidepoint(mousex, mousey):
- webbrowser.open("http://onepiecea-edition.yoo7.com/forum")
- if pygame.Rect(67, 293, 270, 25).collidepoint(mousex, mousey):
- webbrowser.open("http://allstarbof.userboard.net/")
- self.MainSurf.fill((0, 0, 0))
- self.MainSurf.blit(HOWPLAY_FI, HOWPLAY_FIbdy)
- pygame.display.update()
- def recording_toggle(self):
- self.warp()
- Font = pygame.font.SysFont(None, 48)
- control= open(os.getcwd() + '\\data\\control.txt', 'r')
- controltxt = control.read().split('\n')
- control.close()
- recording= ["Off", "On"][int(controltxt[6])]
- self.Recrd = pygame.image.load(self.imgdir + "CHANGE_INREC.PNG")
- self.Recrdbdy = self.Recrd.get_rect()
- self.Recrdbdy.center = self.MainSurf.get_rect().center
- self.Recrd.set_colorkey((0, 0, 0))
- while "hakuna matata":
- text = Font.render(recording, True, (255, 255, 255))
- textbdy = text.get_rect()
- textbdy.center = self.MainSurf.get_rect().center
- self.MainSurf.fill((0, 0, 0))
- self.MainSurf.blit(self.Recrd, self.Recrdbdy)
- self.MainSurf.blit(text, textbdy)
- pygame.display.update()
- for event in pygame.event.get():
- if event.type == QUIT:
- pygame.quit()
- sys.exit()
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- self.warp()
- return
- if event.key == K_RIGHT or event.key == K_LEFT:
- if recording == "On":
- recording="Off"
- elif recording == "Off":
- recording="On"
- if event.key == K_RETURN or event.key == K_SPACE:
- controltxta = controltxt[:]
- controltxta[6]= {"On": "1", "Off": "0"}[recording]
- controltxta = "\n".join(controltxta)
- f=open(os.getcwd() + "\\data\\control.txt", "w")
- f.write(controltxta)
- f.close()
- self.warp()
- return
- def controls(self):
- self.KeysValues = {"8": "Backspace", "9": "Tab", "13": "Enter",
- "16": "Shift", "17": "Control", "20": "Caps Lock",
- "27": "Escape", "32": "Spacebar", "33": "Page up",
- "34": "Page down", "35": "End", "36": "Home",
- "37": "Left A-rrow", "38": "Up A-rrow", "39": "Right A-rrow",
- "40": "Down A-rrow", "45": "Insert", "46": "Delete",
- "19": "Pause", "186": ";", "187": "=",
- "188": "-", "191": "/", "192": "`",
- "219": "[", "220": "\\", "221": "]",
- "222": "\'", "188": ",", "190": ".",
- "96": "Numpad 0", "97": "Numpad 1", "98": "Numpad 2",
- "99": "Numpad 3", "100": "Numpad 4", "101": "Numpad 5",
- "102": "Numpad 6", "103": "Numpad 7", "104": "Numpad 8",
- "105": "Numpad 9", "106": "Num_*", "107": "Num_+",
- "109": "Num_-", "110": "Num_.", "111": "Num_/"}
- self.KeysValuesreal = {"8": "Backspace", "9": "Tab", "13": "Enter",
- "303": "Shift", "306": "Control", "301": "Caps Lock",
- "27": "Escape", "32": "Spacebar", "280": "Page up",
- "281": "Page down", "279": "End", "278": "Home",
- "276": "Left A-rrow", "273": "Up A-rrow", "275": "Right A-rrow",
- "274": "Down A-rrow", "277": "Insert", "127": "Delete",
- "19": "Pause", "59": ";", "61": "=",
- "45": "-", "47": "/", "96": "`",
- "91": "[", "60": "\\", "93": "]",
- "39": "\'", "44": ",", "46": ".",
- "256": "Numpad 0", "257": "Numpad 1", "258": "Numpad 2",
- "259": "Numpad 3", "260": "Numpad 4", "261": "Numpad 5",
- "262": "Numpad 6", "263": "Numpad 7", "264": "Numpad 8",
- "265": "Numpad 9", "268": "Num_*", "270": "Num_+",
- "269": "Num_-", "266": "Num_.", "267": "Num_/"}
- def preparecont(ControlsFont, controlnames, controlsp1):
- P=[ControlsFont.render(controlnames, True, (255, 255, 255)), ControlsFont.render(controlsp1[0], True, (255, 255, 255)),
- ControlsFont.render(controlsp1[1], True, (255, 255, 255)), ControlsFont.render(controlsp1[2], True, (255, 255, 255)),
- ControlsFont.render(controlsp1[3], True, (255, 255, 255)), ControlsFont.render(controlsp1[4], True, (255, 255, 255)),
- ControlsFont.render(controlsp1[5], True, (255, 255, 255)), ControlsFont.render(controlsp1[6], True, (255, 255, 255)),
- ControlsFont.render(controlsp1[7], True, (255, 255, 255))]
- Pbdy = []
- for a in P:
- Pbdy.append(a.get_rect())
- return P, Pbdy
- def idontwannagostudy():
- control= open(os.getcwd() + '\\data\\control.txt', 'r')
- self.controltxt = control.read().split('\n')
- control.close()
- self.controlsp1= self.controltxt[0].split(' ')
- self.controlsp2= self.controltxt[1].split(' ')
- self.controlsp3= self.controltxt[2].split(' ')
- self.controlsp4= self.controltxt[3].split(' ')
- self.controlnames= self.controltxt[4].split(' ')
- self.controlsall = [self.controlsp1, self.controlsp2, self.controlsp3, self.controlsp4]
- for a in self.controlsall:
- if a[0] == "0":
- a[0] = "Keyboard"
- elif a[0] == "1":
- a[0] = "Joystick 1"
- elif a[0] == "2":
- a[0] = "Joystick 2"
- for b in range(len(a)):
- if len(a[b]) > 1 and len(a[b]) < 4 and not a[b].isalpha():
- if a[b] in self.KeysValues:
- for value in self.KeysValues:
- if a[b] == value:
- a[b] = self.KeysValues[value]
- else:
- a[b] = "Key_" + chr(int(a[b])).upper()
- pos = 0
- self.ControlNORM = pygame.image.load(self.imgdir + "OPTIONS_CONTROLS.PNG")
- self.ControlNORM.set_colorkey((0, 0, 0))
- self.ControlHLBOX = pygame.image.load(self.imgdir + "CONTROLS_CHOSEN.PNG")
- self.ControlHLBOX.set_colorkey((0, 0, 0))
- self.ControlHLBOXbdy = self.ControlNORM.get_rect()
- self.ControlHLBOXbdy.left, self.ControlHLBOXbdy.top = 32, 108
- self.ControlNORMbdy = self.ControlNORM.get_rect()
- self.ControlNORMbdy.center = self.MainSurf.get_rect().center
- ControlsFont = pygame.font.SysFont(None, 27)
- P1, P1bdy = preparecont(ControlsFont, self.controlnames[0], self.controlsp1)
- P2, P2bdy = preparecont(ControlsFont, self.controlnames[1], self.controlsp2)
- P3, P3bdy = preparecont(ControlsFont, self.controlnames[2], self.controlsp3)
- P4, P4bdy = preparecont(ControlsFont, self.controlnames[3], self.controlsp4)
- self.BDYS = [P1bdy, P2bdy, P3bdy, P4bdy]
- self.Ps = [P1, P2, P3, P4]
- for a in self.BDYS:
- if a == P1bdy:
- side=0
- top=0
- elif a == P2bdy:
- side=0
- top=215
- elif a == P3bdy:
- side=370
- top=0
- elif a == P4bdy:
- side=370
- top=215
- for b in a:
- b.left = 188 + side
- b.top = 110 + top
- top += 21
- def ChangeConts(controlnameindex):
- jj=[]
- for a in range(pygame.joystick.get_count()):
- jj.append(pygame.joystick.Joystick(a))
- for n in jj:
- n.init()
- def blitstufffunc(Font, Name, ControlNAME, ControlALLbdy, a):
- text = Font.render(Name, True, (255, 255, 255))
- textbdy = text.get_rect()
- textbdy.center = self.MainSurf.get_rect().center
- textbdy.centerx = self.MainSurf.get_rect().centerx - a
- self.MainSurf.blit(ControlNAME, ControlALLbdy)
- self.MainSurf.blit(text, textbdy)
- pygame.display.update()
- self.MainSurf.fill((0, 0, 0))
- self.MainSurf.blit(self.ControlNORM, self.ControlNORMbdy)
- return
- def assignbuttons(eventkey, Change, controlnameindex, buttonno):
- ABCD = "abcdefghijklmnopqrstuvwxyz1234567890"
- abcd =[]
- for a in ABCD:
- abcd.append(ord(a))
- if "joy" in str(eventkey):
- controltxta = self.controltxt[:]
- controltxta[controlnameindex]= controltxta[controlnameindex].split(" ")
- controltxta[controlnameindex][buttonno] = eventkey[eventkey.find("y")+1:]
- controltxta[controlnameindex] = " ".join(controltxta[controlnameindex])
- self.controltxt = controltxta
- controltxta = "\n".join(controltxta)
- f=open(os.getcwd() + '\\data\\control.txt', "w")
- f.write(controltxta)
- f.close()
- Change +=1
- return Change
- elif str(int(eventkey)) in self.KeysValuesreal or int(eventkey) in abcd:
- controltxta = self.controltxt[:]
- controltxta[controlnameindex]= controltxta[controlnameindex].split(" ")
- if int(eventkey) in abcd:
- for c in abcd:
- if c == int(eventkey):
- if chr(c).isalpha():
- controltxta[controlnameindex][buttonno] = str(ord(chr(c).upper()))
- else:
- controltxta[controlnameindex][buttonno] = str(c)
- else:
- for a in self.KeysValuesreal:
- if int(a) == int(eventkey):
- for b in self.KeysValues:
- if self.KeysValuesreal[a] == self.KeysValues[b]:
- controltxta[controlnameindex][buttonno] = b
- controltxta[controlnameindex] = " ".join(controltxta[controlnameindex])
- self.controltxt = controltxta
- controltxta = "\n".join(controltxta)
- f=open(os.getcwd() + '\\data\\control.txt', "w")
- f.write(controltxta)
- f.close()
- Change +=1
- return Change
- return Change
- Font = pygame.font.SysFont(None, 48)
- ControlNAME = pygame.image.load(self.imgdir + "CHANGE_NAME.PNG")
- ControlINPUTDEVICE = pygame.image.load(self.imgdir + "CHANGE_INPUTDEVICE.PNG")
- ControlKEY = pygame.image.load(self.imgdir + "CHANGE_KEY.PNG")
- ControlALLbdy = ControlNAME.get_rect()
- ControlALLbdy.center = self.MainSurf.get_rect().center
- Change = 1
- deletion = ''
- Name = self.controlnames[controlnameindex]
- InputDev = ["Keyboard", "Joystick 1", "Joystick 2"][int(self.controltxt[controlnameindex][0])]
- while Change <= 9:
- if Change == 1:
- blitstufffunc(Font, Name, ControlNAME, ControlALLbdy, 0)
- if Change == 2:
- blitstufffunc(Font, InputDev, ControlINPUTDEVICE, ControlALLbdy, 0)
- if Change == 3:
- if "J" in InputDev:
- Change=7
- blitstufffunc(Font, "Up: ", ControlKEY, ControlALLbdy, 150)
- if Change == 4:
- blitstufffunc(Font, "Down: ", ControlKEY, ControlALLbdy, 150)
- if Change == 5:
- blitstufffunc(Font, "Left: ", ControlKEY, ControlALLbdy, 150)
- if Change == 6:
- blitstufffunc(Font, "Right: ", ControlKEY, ControlALLbdy, 150)
- if Change == 7:
- blitstufffunc(Font, "Attack: ", ControlKEY, ControlALLbdy, 150)
- if Change == 8:
- blitstufffunc(Font, "Jump: ", ControlKEY, ControlALLbdy, 150)
- if Change == 9:
- blitstufffunc(Font, "Defend: ", ControlKEY, ControlALLbdy, 150)
- for event in pygame.event.get():
- if event.type == QUIT:
- pygame.quit()
- sys.exit()
- if Change == 9:
- if event.type == JOYBUTTONDOWN:
- Change = assignbuttons("joy"+str(event.button), Change, controlnameindex, 10)
- if event.type == KEYDOWN:
- Change = assignbuttons(event.key, Change, controlnameindex, 7)
- if Change == 8:
- if event.type == JOYBUTTONDOWN:
- Change = assignbuttons("joy"+str(event.button), Change, controlnameindex, 9)
- if event.type == KEYDOWN:
- Change = assignbuttons(event.key, Change, controlnameindex, 6)
- if Change == 7:
- if event.type == JOYBUTTONDOWN:
- print (event.button)
- Change = assignbuttons("joy"+str(event.button), Change, controlnameindex, 8)
- if event.type == KEYDOWN:
- Change = assignbuttons(event.key, Change, controlnameindex, 5)
- if Change == 6:
- if event.type == KEYDOWN:
- Change = assignbuttons(event.key, Change, controlnameindex, 4)
- if Change == 5:
- if event.type == KEYDOWN:
- Change = assignbuttons(event.key, Change, controlnameindex, 3)
- if Change == 4:
- if event.type == KEYDOWN:
- Change = assignbuttons(event.key, Change, controlnameindex, 2)
- if Change == 3:
- if event.type == KEYDOWN:
- Change = assignbuttons(event.key, Change, controlnameindex, 1)
- if Change == 2:
- if event.type == KEYDOWN:
- if event.key == K_RIGHT:
- if InputDev == "Keyboard":
- InputDev="Joystick 1"
- elif InputDev == "Joystick 1":
- InputDev="Joystick 2"
- elif InputDev == "Joystick 2":
- InputDev="Keyboard"
- if event.key == K_LEFT:
- if InputDev == "Keyboard":
- InputDev="Joystick 2"
- elif InputDev == "Joystick 2":
- InputDev="Joystick 1"
- elif InputDev == "Joystick 1":
- InputDev="Keyboard"
- if event.key == K_RETURN or event.key == K_SPACE:
- controltxta = self.controltxt[:]
- controltxta[controlnameindex]= controltxta[controlnameindex].split(" ")
- controltxta[controlnameindex][0] = {"Keyboard": "0", "Joystick 1": "1", "Joystick 2": "2"}[InputDev]
- controltxta[controlnameindex] = " ".join(controltxta[controlnameindex])
- self.controltxt = controltxta
- controltxta = "\n".join(controltxta)
- f=open(os.getcwd() + '\\data\\control.txt', "w")
- f.write(controltxta)
- f.close()
- Change = 3
- if Change ==1:
- if event.type == KEYDOWN:
- if len(Name) <= 10:
- if len(Name) < 10:
- 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):
- Name += chr(int(event.key)).upper()
- if int(event.key) == 13:
- controltxta = self.controltxt[:]
- controltxta[4]= controltxta[4].split(" ")
- controltxta[4][controlnameindex] = Name
- controltxta[4] = " ".join(controltxta[4])
- self.controltxt = controltxta
- controltxta = "\n".join(controltxta)
- f=open(os.getcwd() + '\\data\\control.txt', "w")
- f.write(controltxta)
- f.close()
- Change = 2
- if int(event.key) == 8:
- if len(Name) > 0:
- deletion = len(Name)
- Name = Name[:(deletion - 1)] + Name[(deletion):]
- return
- idontwannagostudy()
- self.warp()
- side, top = 0, 0
- while "cola":
- for event in pygame.event.get():
- if event.type == QUIT:
- pygame.quit()
- sys.exit()
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- self.warp()
- return
- if top != 215:
- if event.key == K_DOWN:
- top = 215
- if top != 0:
- if event.key == K_UP:
- top = 0
- if side != 370:
- if event.key == K_RIGHT:
- side = 370
- if side != 0:
- if event.key == K_LEFT:
- side = 0
- if event.key == K_RETURN or event.key == K_SPACE:
- if side == 0 and top == 0:
- ChangeConts(0)
- idontwannagostudy()
- if side == 370 and top == 0:
- ChangeConts(2)
- idontwannagostudy()
- if side == 0 and top == 215:
- ChangeConts(1)
- idontwannagostudy()
- if side == 370 and top == 215:
- ChangeConts(3)
- idontwannagostudy()
- self.ControlHLBOXbdy.left, self.ControlHLBOXbdy.top = 30+side, 108+top
- self.MainSurf.fill((0, 0, 0))
- self.MainSurf.blit(self.ControlNORM, self.ControlNORMbdy)
- self.MainSurf.blit(self.ControlHLBOX, self.ControlHLBOXbdy)
- for a in range(len(self.BDYS)):
- for b in range(len(self.Ps[a])):
- self.MainSurf.blit(self.Ps[a][b], self.BDYS[a][b])
- pygame.display.update()
- return
- def menu(self):
- menupos= 1
- play = False
- MenuBG = pygame.image.load(self.imgdir + "MENU_BG.PNG")
- MenuBG.set_colorkey((0, 0, 0))
- menuitemsswap=pygame.image.load(self.imgdir + "menucho.PNG").convert()
- menuitemsswap.set_colorkey((0, 0, 0,0))
- if len(self.getunlockedlist()) == 22:
- menuitemshilit= pygame.image.load(self.imgdir + "MENUITEMS_CHOSEN.PNG")
- unlock=True
- else:
- unlock = False
- menuitemsbdy = menuitemsswap.get_rect()
- menuitemsbdy.centerx = self.MainSurf.get_rect().centerx
- menuitemsbdy.top = self.MainSurf.get_rect().centery +25
- MenuBGbdy = MenuBG.get_rect()
- MenuBGbdy.center = self.MainSurf.get_rect().center
- menuitemsindex= [(0, 50, 480, 49), (0, 150, 480, 49), (0, 250, 480, 49), (0, 350, 480, 49),
- (0, 450, 480, 49), (0, 550, 480, 49), (0, 650, 480, 49), (0, 750, 480, 49)]
- while True:
- self.MainSurf.blit(MenuBG, MenuBGbdy)
- for event in pygame.event.get():
- if event.type == QUIT:
- pygame.quit()
- sys.exit()
- if menupos == 1:
- if event.type == KEYDOWN:
- if event.key == K_RIGHT:
- menupos += 1
- if event.key == K_LEFT:
- menupos = 7
- if event.key == K_RETURN or event.key == K_SPACE:
- self.rungame(1)
- elif menupos == 2:
- if event.type == KEYDOWN:
- if event.key == K_LEFT:
- menupos -= 1
- if event.key == K_RETURN or event.key == K_SPACE:
- self.options()
- if event.key == K_RIGHT:
- menupos += 1
- elif menupos == 3:
- if event.type == KEYDOWN:
- if event.key == K_LEFT:
- menupos -= 1
- if event.key == K_RETURN or event.key == K_SPACE:
- pygame.display.update()
- self.MainSurf.fill((0, 0, 0))
- self.warp()
- self.Shop()
- if event.key == K_RIGHT:
- menupos += 1
- elif menupos == 4:
- if event.type == KEYDOWN:
- if event.key == K_LEFT:
- menupos -= 1
- if event.key == K_RIGHT:
- if unlock:
- menupos += 1
- else:
- menupos += 2
- if event.key == K_RETURN or event.key == K_SPACE:
- self.how_play()
- elif menupos == 5:
- if event.type == KEYDOWN:
- if event.key == K_LEFT:
- menupos -= 1
- if event.key == K_RETURN or event.key == K_SPACE:
- self.rungame(0)
- if event.key == K_RIGHT:
- menupos += 1
- elif menupos == 6:
- if event.type == KEYDOWN:
- if event.key == K_LEFT:
- if unlock:
- menupos -= 1
- else:
- menupos -= 2
- if event.key == K_RETURN or event.key == K_SPACE:
- self.credit_slide()
- if event.key == K_RIGHT:
- menupos += 1
- elif menupos == 7:
- if event.type == KEYDOWN:
- if event.key == K_LEFT:
- menupos -= 1
- if event.key == K_RIGHT:
- menupos = 1
- if event.key == K_RETURN or event.key == K_SPACE:
- pygame.quit()
- sys.exit()
- self.MainSurf.blit(menuitemsswap, menuitemsbdy, area = menuitemsindex[0])
- if menupos == 1:
- self.MainSurf.blit(menuitemsswap, menuitemsbdy, area = menuitemsindex[1])
- if menupos == 2:
- self.MainSurf.blit(menuitemsswap, menuitemsbdy, area = menuitemsindex[2])
- if menupos == 3:
- self.MainSurf.blit(menuitemsswap, menuitemsbdy, area = menuitemsindex[3])
- if menupos == 4:
- self.MainSurf.blit(menuitemsswap, menuitemsbdy, area = menuitemsindex[4])
- if menupos == 5:
- self.MainSurf.blit(menuitemsswap, menuitemsbdy, area = menuitemsindex[5])
- if menupos == 6:
- self.MainSurf.blit(menuitemsswap, menuitemsbdy, area = menuitemsindex[6])
- if menupos == 7:
- self.MainSurf.blit(menuitemsswap, menuitemsbdy, area = menuitemsindex[7])
- pygame.display.update()
- self.MainSurf.fill((0, 0, 0))
- if play == True:
- break
- def Shop(self): #was originally a class
- pygame.mixer.music.stop()
- pygame.mixer.music.load(self.imgdir + 'bgmusic.mp3')
- pygame.mixer.music.play(-1, 0)
- self.process = 1
- self.ChkPass = False
- self.outo = False
- self.PassCode = ""
- def passmenu():
- deletion = ''
- for event in pygame.event.get():
- if event.type == QUIT:
- self.Close()
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- self.outo = True
- if len(self.PassCode) < 10:
- 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):
- self.PassCode += chr(int(event.key))
- if int(event.key) == 13:
- self.ChkPass = True
- if int(event.key) == 8:
- if len(self.PassCode) > 0:
- deletion = len(self.PassCode)
- self.PassCode = self.PassCode[:(deletion - 1)] + self.PassCode[(deletion):]
- if self.ChkPass == True:
- if self.PassCode in self.passcodes:
- datatxt = open(self.datxtdir, 'r')
- datalines = datatxt.readlines()
- datatxt.close()
- for line in range(len(datalines)-1):
- newline = ''
- if "data\\OP\\d1.dat" in datalines[line] and self.PassCode == self.passcodes[0]:
- datalines[line] = ''
- if "data\\OP\\d2.dat" in datalines[line] and self.PassCode == self.passcodes[1]:
- datalines[line] = ''
- if "data\\OP\\d3.dat" in datalines[line] and self.PassCode == self.passcodes[2]:
- datalines[line] = ''
- if "data\\OP\\d4.dat" in datalines[line] and self.PassCode == self.passcodes[3]:
- datalines[line] = ''
- if "data\\OP\\d5.dat" in datalines[line] and self.PassCode == self.passcodes[4]:
- datalines[line] = ''
- if "data\\OP\\d6.dat" in datalines[line] and self.PassCode == self.passcodes[5]:
- datalines[line] = ''
- if "data\\OP\\d7.dat" in datalines[line] and self.PassCode == self.passcodes[6]:
- datalines[line] = ''
- if "data\\OP\\d8.dat" in datalines[line] and self.PassCode == self.passcodes[7]:
- datalines[line] = ''
- if "data\\OP\\d9.dat" in datalines[line] and self.PassCode == self.passcodes[8]:
- datalines[line] = ''
- if "data\\OP\\d10.dat" in datalines[line] and self.PassCode == self.passcodes[9]:
- datalines[line] = ''
- if "data\\OP\\d11.dat" in datalines[line] and self.PassCode == self.passcodes[10]:
- datalines[line] = ''
- if "data\\OP\\d12.dat" in datalines[line] and self.PassCode == self.passcodes[11]:
- datalines[line] = ''
- if "data\\OP\\d13.dat" in datalines[line] and self.PassCode == self.passcodes[12]:
- datalines[line] = ''
- if "data\\OP\\d14.dat" in datalines[line] and self.PassCode == self.passcodes[12]:
- datalines[line] = ''
- if "data\\OP\\7.dat" in datalines[line] and self.PassCode == self.passcodes[0]:
- datalines[line] = ''
- if "data\\OP\\16.dat" in datalines[line] and self.PassCode == self.passcodes[1]:
- datalines[line] = ''
- if "data\\OP\\25.dat" in datalines[line] and self.PassCode == self.passcodes[2]:
- datalines[line] = ''
- if "data\\OP\\32.dat" in datalines[line] and self.PassCode == self.passcodes[3]:
- datalines[line] = ''
- if "data\\OP\\40.dat" in datalines[line] and self.PassCode == self.passcodes[4]:
- datalines[line] = ''
- if "data\\OP\\47.dat" in datalines[line] and self.PassCode == self.passcodes[5]:
- datalines[line] = ''
- if "data\\OP\\53.dat" in datalines[line] and self.PassCode == self.passcodes[6]:
- datalines[line] = ''
- if "data\\OP\\61.dat" in datalines[line] and self.PassCode == self.passcodes[7]:
- datalines[line] = ''
- if "data\\OP\\68.dat" in datalines[line] and self.PassCode == self.passcodes[8]:
- datalines[line] = ''
- if "data\\OP\\77.dat" in datalines[line] and self.PassCode == self.passcodes[9]:
- datalines[line] = ''
- if "data\\OP\\86.dat" in datalines[line] and self.PassCode == self.passcodes[10]:
- datalines[line] = ''
- if "data\\OP\\94.dat" in datalines[line] and self.PassCode == self.passcodes[11]:
- datalines[line] = ''
- if "data\\OP\\100.dat" in datalines[line] and self.PassCode == self.passcodes[12]:
- datalines[line] = ''
- for word in list(datalines[line].split()):
- if self.PassCode == self.passcodes[0] and '%1%' in word:
- datalines[line] = self.unlines[str(self.passcodesset['%1'])]+ '\n'
- self.rightsound()
- elif self.PassCode == self.passcodes[1] and '%2%' in word:
- datalines[line] = self.unlines[str(self.passcodesset['%2'])]+ '\n'
- self.rightsound()
- elif self.PassCode == self.passcodes[2] and '%3%' in word:
- datalines[line] = self.unlines[str(self.passcodesset['%3'])]+ '\n'
- self.rightsound()
- elif self.PassCode == self.passcodes[3] and '%4%' in word:
- datalines[line] = self.unlines[str(self.passcodesset['%4'])]+ '\n'
- self.rightsound()
- elif self.PassCode == self.passcodes[4] and '%5%' in word:
- datalines[line] = self.unlines[str(self.passcodesset['%5'])]+ '\n'
- self.rightsound()
- elif self.PassCode == self.passcodes[5] and '%6%' in word:
- datalines[line] = self.unlines[str(self.passcodesset['%6'])]+ '\n'
- self.rightsound()
- elif self.PassCode == self.passcodes[6] and '%7%' in word:
- datalines[line] = self.unlines[str(self.passcodesset['%7'])]+ '\n'
- self.rightsound()
- elif self.PassCode == self.passcodes[7] and '%8%' in word:
- datalines[line] = self.unlines[str(self.passcodesset['%8'])]+ '\n'
- self.rightsound()
- elif self.PassCode == self.passcodes[8] and '%9%' in word:
- datalines[line] = self.unlines[str(self.passcodesset['%9'])]+ '\n'
- self.rightsound()
- elif self.PassCode == self.passcodes[9] and '%10%' in word:
- datalines[line] = self.unlines[str(self.passcodesset['%10'])]+ '\n'
- self.rightsound()
- elif self.PassCode == self.passcodes[10] and '%11%' in word:
- datalines[line] = self.unlines[str(self.passcodesset['%11'])]+ '\n'
- self.rightsound()
- elif self.PassCode == self.passcodes[11] and '%12%' in word:
- datalines[line] = self.unlines[str(self.passcodesset['%12'])]+ '\n'
- self.rightsound()
- elif self.PassCode == self.passcodes[12] and '%13%' in word:
- datalines[line] = self.unlines[str(self.passcodesset['%13'])]+ '\n'
- self.rightsound()
- if self.PassCode == self.passcodes[2] and '%33%' in word:
- datalines[line] = self.unlines[str(self.passcodesset['%33'])]+ '\n'
- if self.PassCode == self.passcodes[6] and '%77%' in word:
- datalines[line] = self.unlines[str(self.passcodesset['%77'])]+ '\n'
- if self.PassCode == self.passcodes[9] and '%110%' in word:
- datalines[line] = self.unlines[str(self.passcodesset['%110'])]+ '\n'
- if self.PassCode == self.passcodes[12] and '%130%' in word:
- datalines[line] = self.unlines[str(self.passcodesset['%130'])]+ '\n'
- if self.PassCode == self.passcodes[12] and '%14%' in word:
- datalines[line] = self.unlines[str(self.passcodesset['%14'])]+ '\n'
- if self.PassCode == self.passcodes[2] and os.path.exists(os.path.join(os.getcwd(), "data", "222.hmp")):
- os.remove(os.path.join(os.getcwd(), "data", "stage.dat"))
- os.rename(os.path.join(os.getcwd(), "data", "222.hmp"), os.path.join(os.getcwd(), "data", "stage.dat"))
- if self.PassCode == self.passcodes[6] and os.path.exists(os.path.join(os.getcwd(), "data", "333.hmp")):
- os.remove(os.path.join(os.getcwd(), "data", "stage.dat"))
- os.rename(os.path.join(os.getcwd(), "data", "333.hmp"), os.path.join(os.getcwd(), "data", "stage.dat"))
- if self.PassCode == self.passcodes[9] and os.path.exists(os.path.join(os.getcwd(), "data", "444.hmp")):
- os.remove(os.path.join(os.getcwd(), "data", "stage.dat"))
- os.rename(os.path.join(os.getcwd(), "data", "444.hmp"), os.path.join(os.getcwd(), "data", "stage.dat"))
- if self.PassCode == self.passcodes[2] and 'LUFFY1' in word:
- datalines[line] = 'id: 6 type: 0 file: data\\OP\\LUFFY.dat' + '\n'
- self.rightsound()
- if self.PassCode == self.passcodes[2] and 'zoro1' in word:
- datalines[line] = 'id: 10 type: 0 file: data\\OP\\zoro.dat' + '\n'
- self.rightsound()
- if self.PassCode == self.passcodes[2] and 'sanji1' in word:
- datalines[line] = 'id: 9 type: 0 file: data\\OP\\sanji.dat' + '\n'
- self.rightsound()
- datatxt = open(self.datxtdir, 'w')
- datatxt.writelines(datalines[:])
- datatxt.close()
- right = pygame.mixer.Sound(self.imgdir + 'right1.wav')
- right.stop()
- right.play()
- pygame.time.delay(100)
- right.stop()
- self.ChkPass = False
- else:
- wrong = pygame.mixer.Sound(self.imgdir + 'wrong1.wav')
- wrong.stop()
- wrong.play()
- pygame.time.delay(100)
- wrong.stop()
- self.ChkPass = False
- self.textpass = self.PassFont.render(self.PassCode.upper(), True, self.colorkey, (255, 255,255))
- self.textpassbdy = self.textpass.get_rect()
- self.textpassbdy.center = self.MainSurf.get_rect().center
- self.MainSurf.blit(self.writbox, self.writboxbdy)
- self.MainSurf.blit(self.table, self.tablebdy)
- self.MainSurf.blit(self.inst, self.instbdy)
- self.MainSurf.blit(self.textpass, self.textpassbdy)
- def MainDis():
- self.MainSurf.blit(self.bgpic, self.bgpicbdy)
- self.MainSurf.blit(pygame.transform.scale(self.shopkeeper1, (229, 235)), self.shopkeeper1bdy)
- self.process = 2
- def init_bg():
- while True and not self.outo:
- if self.process == 1 and not self.outo:
- for event in pygame.event.get():
- if event.type == QUIT:
- self.Close()
- MainDis()
- self.process = 2
- elif self.process == 2 and not self.outo:
- MainDis()
- passmenu()
- self.end()
- while not self.outo:
- init_bg()
- pygame.mixer.music.stop()
- self.warp()
- return
- def wrongsound(self):
- wrong = pygame.mixer.Sound(self.imgdir + 'wrong1.wav')
- wrong.stop()
- wrong.play()
- pygame.time.delay(100)
- wrong.stop()
- def rightsound(self):
- right = pygame.mixer.Sound(self.imgdir + 'right1.wav')
- right.stop()
- right.play()
- pygame.time.delay(6000)
- right.stop()
- def rungame(self, mode):
- os.popen("Taskkill /IM OPA-E1.8_Final.exe /F")
- os.popen("Taskkill /IM OPA-E_ON_FINAL.exe /F")
- if mode == 1:
- exename = "OPA-E1.8_Final.exe"
- else:
- exename = "OPA-E_ON_FINAL.exe"
- timeinterval1= time.time()
- os.popen("cd " + os.getcwd() + " & start nsys\\" + exename)
- 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"]
- 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"]
- spritepath = os.path.join(os.getcwd(), "data", "sound")
- for a in range(len(Fakenames)):
- if os.path.exists(spritepath + "\\" + Fakenames[a]):
- os.rename(spritepath + "\\" + Fakenames[a], spritepath + "\\" + Realnames[a])
- while True:
- timeinterval2 = time.time()
- if timeinterval2 - timeinterval1 > 4 and not(exename in processes) :
- os.popen("cd " + os.getcwd() + " & start nsys\\" + exename)
- processes = os.popen("tasklist").read()
- if exename in processes:
- pygame.quit()
- if mode == 1:
- time.sleep(15)
- for a in range(len(Fakenames)):
- if os.path.exists(spritepath + "\\" + Realnames[a]):
- os.rename(spritepath + "\\" + Realnames[a], spritepath + "\\" + Fakenames[a])
- sys.exit()
- if __name__=="__main__":
- Menu = ExtraMenu()
- Menu.start() #goes first
- Menu.Opening_Video()
- Menu.menu()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement