Пример #1
0
        def start_game(self,force_moonlight=False):
		super(Game, self).start_game()

                #update game start audits
                self.start_time = time.time()
                audits.record_value(self,'gameStarted')
                if self.user_settings['Machine (Standard)']['Free Play'].startswith('N'):
                    credits =  audits.display(self,'general','creditsCounter')
                    audits.update_counter(self,'credits',credits-1)
                    
                #moonlight check - from Eric P of CCC fame
                #-----------------------------------------
                # Check the time
                now = datetime.datetime.now()
                self.log.info("Hour:%s Minutes:%s",now.hour,now.minute)
                # subtract the window minutes from 60
                window = 60 - self.moonlight_minutes
                self.log.info("Moonlight window time:%s",window)
                # check for moonlight - always works at straight up midnight
                if now.hour == 0 and now.minute == 0:
                    self.moonlight_flag = True
                # If not exactly midnight - check to see if we're within the time window
                elif now.hour == 23 and now.minute >= window:
                    self.moonlight_flag = True
                # if force was passed - start it no matter what
                elif force_moonlight:
                    self.moonlight_flag = True
                else:
                    self.moonlight_flag = False

                self.log.info("Moonlight Flag:%s",self.moonlight_flag)
Пример #2
0
        def ball_locked(self):

            self.display(top='Quick Multiball',bottom='Ready',seconds=3)

            #set multiball ready flag
            self.multiball_ready = True
            self.game.set_player_stats('quick_multiball_ready',self.multiball_ready)
            self.log.info('Quick Multiball Ready')

            #update lock lit flag
            self.lock_lit=False
            self.game.set_player_stats('qm_lock_lit',self.lock_lit)

            self.game.sound.play_voice('whirlwind_speech')
            
            #flasher effect
            self.lock_flashers()

            #cancel lock lamp
            self.game.effects.drive_lamp('lock','off')

            #set release lamp
            self.game.effects.drive_lamp('release','fast')
            #set million lamp
            self.game.effects.drive_lamp('million','fast')

            #queue million flasher
            #self.delay(delay=1,handler=self.million_flasher)

            #queue the next ball launch
            self.delay(name='launch_next_ball',delay=0.5,handler=self.launch_next_ball)


            audits.record_value(self.game,'ballLocked')
Пример #3
0
        def map_progress(self,num):
            if not self.map_flags[num]:
                self.map_flags[num]=True

                #test for a completed set of targets
                complete=True
                for i in range(len(self.map_lamps)):
                    if self.map_flags[i]==False:
                        complete=False

                if complete:
                    #update banks
                    self.map_banks_completed+=1
                    self.map_completed()
                    audits.record_value(self.game,'mapBankCompleted')
                else:
                    self.set_map_lamps(num)
                    self.inc_jackpot(self.map_target_score*10)
                    self.game.score(self.map_target_score)
                    self.game.sound.play('map_target')
                    self.game.effects.drive_flasher("flasherBackpanel", "fade", time=0.3)

                    #reset the timer
                    self.cancel_delayed('reset_map')
                    self.delay(name='reset_map', delay=self.map_bank_timer, handler=self.reset_map)
Пример #4
0
        def update_count(self,set):
            if set==0:
                if self.super_pops_enabled:
                    if self.lower_super_pops_required>0:
                        self.lower_super_pops_required -=1
                        self.play_animation(self.lower_super_pops_required,set)
                    else:
                        self.lower_super_pops_collected+=1
                        self.play_super_animation(self.lower_super_pops_collected,set)

                        #update audits
                        audits.record_value(self.game,'lowerSuperPopCollected')

                self.game.switched_coils.drive("rampLMFlasher",style='fast',time=0.5)

                

            elif set==1:
                if self.super_pops_enabled:
                    if self.upper_super_pops_required>0:
                        self.upper_super_pops_required -=1
                        self.play_animation(self.upper_super_pops_required,set)
                    else:
                        self.upper_super_pops_collected+=1
                        self.play_super_animation(self.upper_super_pops_collected,set)

                        #update audits
                        audits.record_value(self.game,'upperSuperPopCollected')

                self.game.switched_coils.drive("rampTopFlasher",style='fast',time=0.5)
Пример #5
0
        def jackpot(self,status=None):

                self.jackpot_status = status
         
                if status=='lit':
                    #lift ramp for timed period to allow easier jackpot shot
                    self.skyway_entrance('up')
                    self.delay(name='ramp_down_timer',delay=self.ramp_lift_timer,handler=self.game.coils['rampDown'].pulse)
                    
                    #set lamps
                    self.game.effects.drive_lamp('millionPlus','fast')
                    self.light_jackpot_strobe_lamps(False)
                    
                    #set flasher for timed period
                    self.game.switched_coils.drive(name='compassFlasher',style='fast',time=1)
                    #update display
                    self.display(top='jackpot lit',bottom='',seconds=2)
                    #update score
                    self.game.score(50000)
                    #play speech
                    #self.game.sound.play('hit_jackpot')

                    audits.record_value(self.game,'jackpotLit')

                elif status=='unlit':
                    #put ramp down so jackpot can be relit
                    self.game.coils['rampDown'].pulse()
                    #tell player what to do
                    self.jackpot_helper_display()
                    #set lamps
                    self.light_jackpot_strobe_lamps()
                   

                elif status=='made':
                    self.game.effects.drive_lamp('millionPlus','off')
                    #self.game.switched_coils.disable('compassFlasher')

                    self.game.lampctrl.play_show('jackpot', repeat=False,callback=self.game.update_lamps)
                    self.strobe_flashers(0.4)
                    self.game.sound.play_voice('jackpot_speech')
                    self.game.score(self.jackpot_value*self.jackpot_x)
                    self.jackpot_collected+=1
                    #self.game.effects.drive_lamp(self.jackpot_lamps[self.jackpot_collected-1],'smarton')

                    if self.jackpot_collected>10:
                        self.super_jackpot_collected()
                    else:
                        #update display
                        self.jackpot_collected_display()
                        #speech
                        self.game.sound.play('jackpot_speech')

                    audits.record_value(self.game,'jackpotCollected')

                    
                elif status=='cancelled':
                    self.game.effects.drive_lamp('millionPlus','off')
Пример #6
0
        def mode_bonus(self):
            timer=2
            self.game.screens.mode_bonus(timer,self.mode_bonus_value)
            self.delay(name='eject_delay', event_type=None, delay=timer-1, handler=self.eject_ball)
            
            #pause any active modes for bonus
            self.mode_paused()

            audits.record_value(self,'modeBonus')
Пример #7
0
        def process(self):
            self.skillshot_in_progress = True
            self.game.set_player_stats('skillshot_in_progress',self.skillshot_in_progress)

            self.display_repeats = (self.value/self.divider)-1
            self.display_text()
            self.award_score()

            #update audits
            audits.record_value(self.game,'skillshotMade')
Пример #8
0
    def update_count(self):

        if self.super_pops_required <= 1:
            self.super_pops_enabled = True
            self.super_pops_collected += 1
            self.super_text_layer.set_text(str(self.super_pops_collected) + "M", color=dmd.CYAN)
            # update audits
            audits.record_value(self.game, "superPopCollected")
        else:
            self.super_pops_required -= 1
            self.text_layer.set_text(str(self.super_pops_required), color=dmd.CYAN)
Пример #9
0
        def lock_progress(self):
            if not self.lock_lit:
                self.hits +=1

                if self.hits==self.hits_needed:
                    self.lock_lit = True     
                    audits.record_value(self.game,'lockLit')
                    self.lock_enabled()
                else:
                    self.lock_progress_display()

            else:
                pass
Пример #10
0
        def award_million(self):
            self.cancel_delayed('million_timer')
            self.cancel_delayed('million_speech')
            
            self.display_million_text()
            self.game.score(self.million_value)
            self.game.sound.play_voice('whirlwind_speech')
            self.game.switched_coils.drive(name='rampUMFlasher',style='fast',time=1)

            #reset
            self.lite_million(False)

            #update audits
            audits.record_value(self.game,'millionCollected')
Пример #11
0
        def award_million(self):
            self.cancel_delayed('million_timer')
            self.cancel_delayed('million_speech')
            
            self.display_million_text()
            self.game.score(self.million_value)
            #self.game.sound.play_voice('whirlwind_speech')
            self.delay(name='award_speech_delay',delay=1,handler=lambda:self.game.sound.play_voice('whirlwind_speech'))
            self.game.switched_coils.drive(name='rampUMFlasher',style='fast',time=1)

            #queue the reset to setup next jackpot
            self.delay(name='multiball_award_reset',delay=2, handler=self.award_reset)

            self.jackpots_collected+=1
            #update audits
            audits.record_value(self.game,'chaserJackpotCollected')
Пример #12
0
        def made(self):
            self.check_combo()
            self.update_count()
            self.update_tolls
            self.game.effects.strobe_flasher_set(flasher_list=self.lightning_flashers, time=0.2, repeats=3)

            self.game.sound.play('made_left_ramp')

            if not self.game.get_player_stats('multiball_started') and not self.game.get_player_stats('quick_multiball_started'):
                if self.shots_made%5==0: #new feature :) every 5 ramps light the cellar hurryup shot!
                    self.cellar.hurryup()
                else:
                    self.cellar.lite_cellar(20)


            #update audits
            audits.record_value(self.game,'thunderRampMade')
Пример #13
0
        def progress(self,num):
            if self.flags[num]==False:
                self.flags[num]=True

                if not self.game.get_player_stats('skillshot_in_progress'):
                    #test for a completed set of drop targets
                    complete=True
                    for i in range(len(self.flags)):
                        if self.flags[i]==False:
                            complete=False

                    if complete:
                        timer=1
                        self.check_sweeping()
                        if self.sweeping:
                            timer=1.5
                            self.display_sweeping_text()
                            self.game.sound.play('drop_target_sweep')
                            self.sweeping=False

                        else:
                            timer=0.5
                            self.display_completed_text()
                            self.game.sound.play('drop_target_completed')

                        self.banks_completed+=1
                        self.game.switched_coils.drive('dropTargetFlasher',style='fast',time=timer)
                        self.delay(name='reset',delay=timer+0.5,handler=self.reset)

                        audits.record_value(self.game,'dropTarget3BankCompleted')
                    

                    else:
                        self.update_count()
                        self.game.sound.play('drop_target_hit')

                if self.value<self.max_value:
                    self.value = self.base_value+(self.hits*self.inc_value)
                else:
                    self.value=self.max_value

                self.score(self.value)
Пример #14
0
        def multiball_start(self):
            self.log.debug('multiball start reached')

            #update the flag
            self.multiball_started = True
            self.game.set_player_stats('quick_multiball_started',self.multiball_started)

            #display help info
            self.display_multiball_info(3)

            #play speech
            start_speech_length = self.game.sound.play_voice('multiball_eject_speech')

            #change music
            self.game.sound.stop_music()
            self.game.sound.play_music('multiball_play',-1)

            self.delay(name='multiball_eject_delay',delay=start_speech_length+0.5, handler=self.multiball_eject)

            audits.record_value(self.game,'quickMultiballStarted')
Пример #15
0
        def multiball_start(self):
            self.log.debug('multiball start reached')

            #update the flag
            self.multiball_started = True
            self.game.set_player_stats('multiball_started',self.multiball_started)


            #update display
            self.display(top='feel the power',bottom='of the wind',seconds=3)

            #play speech
            start_speech_length = self.game.sound.play_voice('multiball_start_speech')
            
            #change music
            self.game.sound.stop_music()
            self.game.sound.play_music('multiball_play',-1)

            
            self.delay(name='multiball_eject_delay',delay=start_speech_length+0.5, handler=self.multiball_eject)

            audits.record_value(self.game,'multiballStarted')
        def multiball_start(self):
            self.log.debug('multiball start reached')

            #update the flag
            self.multiball_started = True
            self.game.set_player_stats('multiball_started',self.multiball_started)
            
            self.game.set_player_stats('final_adventure_started',True)

            #display mode info
            self.display_start(3)

            #play speech
            start_speech_length = self.game.sound.play_voice('multiball_start_speech')

            #change music
            self.game.sound.stop_music()
            self.game.sound.play_music('multiball_play',loops=-1)
            self.log.info('multiball music started')

            self.delay(name='multiball_eject_delay',delay=start_speech_length+1, handler=self.multiball_eject)

            audits.record_value(self.game,'finalAdventureStarted')
Пример #17
0
	def game_ended(self):
		super(Game, self).game_ended()

                self.modes.remove(self.base_game_mode)

                self.modes.add(self.match)

                #record audits
                #-------------
                self.game_time = time.time()-self.start_time
                p = self.current_player()
                audits.record_value(self,'gameTime',self.game_time)
                audits.record_value(self,'gamePlayed')
                audits.record_value(self,'gameScore',p.score)
                #-------------

                #update diagnostics
                #--------------------
                self.update_diagnostics()
Пример #18
0
    def game_ended(self):
        super(Game, self).game_ended()

        self.modes.remove(self.base_game_mode)

        # self.modes.add(self.match)
        # run the high score sequencer. Will run match automatically if no high scores to enter
        self.start_highscore_sequence()

        # record audits
        # -------------
        self.game_time = time.time() - self.start_time
        audits.record_value(self, "gameTime", self.game_time)

        # p = self.current_player()
        for p in self.players:
            audits.record_value(self, "gamePlayed")
            audits.record_value(self, "gameScore", p.score)
        # -------------

        # update diagnostics
        # --------------------
        self.update_diagnostics()
Пример #19
0
        def cellar_award_part2(self):
            if self.award_id==0:
                self.upper_pops()
            elif self.award_id==1:
                if self.secret_mode:
                    self.chaser_multiball()
                    self.secret_mode_unlocked = True
                else:
                    self.score(self.big_points)
            elif self.award_id==2:
                self.game.extra_ball.lit()
                audits.record_value(self.game,'cellarExtraBall')
            elif self.award_id==3:
                self.drops()
            elif self.award_id==4:
                if self.secret_mode:
                    self.war_multiball()
                    self.secret_mode_unlocked = True
                else:
                    self.quick_multiball()
                    audits.record_value(self.game,'cellarQuickMultiball')
            elif self.award_id==5:
                self.lite_million() # populated by 'callback' linkup in base.py
            elif self.award_id==6:
                 self.lower_pops()

            self.game.score_display.set_text(self.awards_text_top[self.award_id].upper(),0,'center',seconds=2)
            self.game.score_display.set_text(self.awards_text_bottom[self.award_id].upper(),1,'center',seconds=2)

            self.delay(name='eject_delay',delay=2, handler=self.eject)

            self.cellar_lit = False
            self.update_lamps()

            #update audits
            audits.record_value(self.game,'cellarAward')
Пример #20
0
        def start_scene(self):
            if self.mode_enabled and self.game.get_player_stats('multiball_running')==False and self.game.get_player_stats('quick_multiball_running')==False:

                #play sound
                self.game.sound.play("scene_started")

                if self.current_mode_num==0:
                    self.timer = self.game.user_settings['Gameplay (Feature)']['Get The Idol Timer']
                    self.name_text = 'GET THE IDOL'
                    self.info_text = 'HIT CENTER'
                    self.info2_text = 'DROP TARGETS'

                elif self.current_mode_num==1:
                    self.timer = self.game.user_settings['Gameplay (Feature)']['Streets Of Cairo Timer']
                    self.name_text = 'STREETS OF CAIRO'
                    self.info_text = 'SHOOT RAMPS'
                    self.info2_text = 'TO FIND MARION'

                elif self.current_mode_num==2:
                    #timer = self.game.user_settings['Gameplay (Feature)']['Well Of Souls Timer']
                    self.name_text = 'WELL OF SOULS'
                    self.info_text = 'SHOOT CENTER HOLE'

                elif self.current_mode_num==3:
                    #timer = self.game.user_settings['Gameplay (Feature)']['Raven Bar Timer']
                    if self.secret_mode:
                        self.name_text = 'Werewolf Attack!'.upper()
                        self.info_text = 'Secret Video Mode'.upper()
                    else:
                        self.name_text = 'RAVEN BAR'
                        self.info_text = 'VIDEO MODE'

                elif self.current_mode_num==4:
                    self.timer = self.game.user_settings['Gameplay (Feature)']['Monkey Brains Timer']
                    self.name_text = 'MONKEY BRAINS'
                    self.info_text = 'SHOOT LIT SHOTS'

                elif self.current_mode_num==5:
                    self.timer = self.game.user_settings['Gameplay (Feature)']['Steal The Stones Timer']
                    self.name_text = 'STEAL THE STONES'
                    self.info_text = 'GET ALL LIT LANES'

                elif self.current_mode_num==6:
                    #timer = self.game.user_settings['Gameplay (Feature)']['Mine Cart Timer']
                    self.name_text = 'MINE CART'
                    self.info_text = 'VIDEO MODE'

                elif self.current_mode_num==7:
                    self.timer = self.game.user_settings['Gameplay (Feature)']['Rope Bridge Timer']
                    self.name_text = 'ROPE BRIDGE'
                    self.info_text = 'SHOOT RAMPS'
                    self.info2_text = 'TO CROSS ROPE BRIDGE'

                elif self.current_mode_num==8:
                    self.timer = self.game.user_settings['Gameplay (Feature)']['Castle Grunwald Timer']
                    self.name_text = 'CASTLE GRUNWALD'
                    self.info_text = 'HIT CAPTIVE BALL'
                    self.info2_text = 'TO ESCAPE CASTLE'

                elif self.current_mode_num==9:
                    self.timer = self.game.user_settings['Gameplay (Feature)']['Tank Chase Timer']
                    self.name_text = 'TANK CHASE'
                    self.info_text = 'SHOOT LOOPS'
                    self.info2_text = 'TO DESTROY TANK'

                elif self.current_mode_num==10:
                    self.timer = self.game.user_settings['Gameplay (Feature)']['The 3 Challenges Timer']
                    self.name_text = '3 CHALLENGES'
                    self.info_text = 'GET LIT LANES ON'
                    self.info2_text = 'PATH OF ADVENTURE'

                elif self.current_mode_num==11:
                    #timer = self.game.user_settings['Gameplay (Feature)']['Choose Wisely Timer']
                    self.name_text = 'CHOOSE WISELY'
                    self.info_text = 'VIDEO MODE'

                anim = dmd.Animation().load(game_path+"dmd/start_scene.dmd")
                self.animation_layer = dmd.AnimatedLayer(frames=anim.frames,hold=True,frame_time=4)
                
                self.animation_layer.add_frame_listener(-1,self.mode_text)

                self.ssd_count=0#temp fix for frame_listener multi call with held
                self.animation_layer.add_frame_listener(-1,self.scene_start_delay)


                self.layer = dmd.GroupedLayer(128, 32, [self.animation_layer,self.name_layer,self.info_layer,self.info2_layer])

                #update mode flags and player stats
                self.mode_enabled=False
                self.game.set_player_stats('mode_enabled',self.mode_enabled)
                self.mode_running = True
                self.game.set_player_stats('mode_running',self.mode_running)
                self.game.set_player_stats('mode_running_id',self.current_mode_num)

                #update lamp for mode start
                self.mode_start_lamp(self.mode_enabled)

                #record audits
                audits.record_value(self,'modeStarted')
                
            elif self.mode_running:
                self.mode_bonus()
            else:
                self.delay(name='eject_delay', event_type=None, delay=0.5, handler=self.eject_ball)
Пример #21
0
	def sw_startButton_active(self, sw):
		if self.game.ball == 1 and len(self.game.players)<self.game.max_players:
			p = self.game.add_player()
			self.log.info(p.name + " added!")
                        audits.record_value(self,'gameStarted')
Пример #22
0
	def setup(self):
		"""docstring for setup"""
		self.load_config(self.yamlpath)

                self.load_settings(settings_template_path, settings_path)
		self.sound.music_volume_offset = self.user_settings['Sound']['Music volume offset']
		self.sound.set_volume(self.user_settings['Sound']['Initial volume'])
		self.load_game_data(game_data_template_path, game_data_path)

                #define system status var
                self.system_status='power_up'
                self.system_version='0.5.8'
                self.system_name='Indiana Jones 2'.upper()
                
                # Setup fonts
		self.fonts = {}
		#self.fonts['jazz18'] = font_jazz18
        	self.fonts['18x12'] = font_18x12
                self.fonts['num_14x10'] = font_14x10
		self.fonts['num_07x4'] = dmd.font_named("font_7x4.dmd")

                self.fonts['tiny7'] = font_tiny7
                self.fonts['7x4'] = dmd.font_named("font_7x4.dmd")
                self.fonts['7x4'].tracking = -1
                self.fonts['7x4'].composite_op ="blacksrc"
                
                self.fonts['07x5'] = dmd.font_named("font_7x5.dmd")
                self.fonts['07x5'].tracking = -1
                self.fonts['07x5'].composite_op ="blacksrc"
                
                self.fonts['6x6_bold'] = dmd.font_named("font_8x7_bold.dmd")
                self.fonts['6x6_bold'].tracking = -1
                self.fonts['6x6_bold'].composite_op ="blacksrc"
                
                self.fonts['8x6'] = dmd.font_named("font_9x6_bold.dmd")
                self.fonts['8x6'].tracking = -1
                self.fonts['8x6'].composite_op ="blacksrc"
                
                self.fonts['num_09Bx7'] = dmd.font_named("font_10x7_bold.dmd")
                self.fonts['num_09Bx7'].tracking = -1
                self.fonts['num_09Bx7'].composite_op ="blacksrc"
                
                self.fonts['9x7_bold'] = dmd.font_named("font_10x7_bold.dmd")
                self.fonts['9x7_bold'].tracking = -1
                self.fonts['9x7_bold'].composite_op ="blacksrc"
                
                self.fonts['10x7_bold'] = dmd.font_named("font_12x8_bold.dmd")
                self.fonts['10x7_bold'].tracking = -1
                self.fonts['10x7_bold'].composite_op ="blacksrc"
                
                self.fonts['23x12'] = dmd.font_named("font_23x12_bold.dmd")
                self.fonts['23x12'].tracking = -1
                self.fonts['23x12'].composite_op ="blacksrc"
                
                self.fonts['4px_az'] = dmd.font_named("font_7x4.dmd")
                self.fonts['5px_az'] = dmd.font_named("font_7x5.dmd")
                self.fonts['5px_inv_az'] = dmd.font_named("font_7x5_inverted.dmd")
                self.fonts['6px_az'] = dmd.font_named("Font_19_CactusCanyon.dmd")
                self.fonts['7px_az'] = dmd.font_named("Font_2_CactusCanyon.dmd")
                self.fonts['7px_bold_az'] = dmd.font_named("Font_14_CactusCanyon.dmd")
                self.fonts['9px_az'] = dmd.font_named("Font_15_CactusCanyon.dmd")
                self.fonts['10px_az'] = dmd.font_named("Font_Custom_10px_AZ.dmd")
                
                #setup paths
                self.paths = {}
                self.paths['game'] = game_path
                self.paths['sound'] = sound_path
                self.paths['speech'] = voice_path
                self.paths['music'] = music_path
                self.log.info(self.paths)

                #update audit data on boot up time
                audits.record_value(self,'bootUp')

                #set start time game var
                self.start_time = time.time()

#		print "Stats:"
#		print self.game_data
#		print "Settings:"
#		print self.settings

		self.log.info("Initial switch states:")
		for sw in self.switches:
			self.log.info("  %s:\t%s" % (sw.name, sw.state_str()))
                
                #balls per game setup
                self.balls_per_game = self.user_settings['Machine (Standard)']['Balls Per Game']
                
                #moonlight setup
                self.moonlight_minutes = self.user_settings['Gameplay (Feature)']['Moonlight Mins to Midnight']
                self.moonlight_flag = False
                
		self.setup_ball_search()
                self.score_display.set_left_players_justify(self.user_settings['Display']['Left side score justify'])

		# Note - Game specific item:
		# The last parameter should be the name of the game's ball save lamp
		self.ball_save = procgame.modes.BallSave(self, self.coils.flasherEternalLife, 'shooterLane')

		trough_switchnames = []
		# Note - Game specific item:
		# This range should include the number of trough switches for
		# the specific game being run.  In range(1,x), x = last number + 1.
		for i in range(1,7):
			trough_switchnames.append('trough' + str(i))
		early_save_switchnames = ['rightOutlaneBottom', 'leftOutlane']

		# Note - Game specific item:
		# Here, trough6 is used for the 'eject_switchname'.  This must
		# be the switch of the next ball to be ejected.  Some games
		# number the trough switches in the opposite order; so trough1
		# might be the proper switchname to user here.

                #setup trough
                self.trough = Trough(game=self,drain_callback=self.drain_callback)
		# Link ball_save to trough
		self.trough.ball_save_callback = self.ball_save.launch_callback
		self.trough.num_balls_to_save = self.ball_save.get_num_balls_to_save
		self.ball_save.trough_enable_ball_save = self.trough.enable_ball_save

                #setup & init service modes
                self.service_mode = ServiceMode(self,100,font_07x5,font_8x6_bold,[])
                self.coin_door = CoinDoor(self)

                # Register lampshow files for attact
		self.lampshow_keys = []
		key_ctr = 0
		for file in lampshow_files:
                    if file.find('flasher',0)>0:
                        key = 'attract_flashers_' + str(key_ctr)
                    else:
                        key = 'attract_lamps_' + str(key_ctr)
                    self.lampshow_keys.append(key)
                    self.lampctrl.register_show(key, file)
                    key_ctr += 1

                #register game play lamp show
                self.lampctrl.register_show('success', game_path +"lamps/game/success.lampshow")
                self.lampctrl.register_show('ball_lock', game_path +"lamps/game/ball_lock.lampshow")
                self.lampctrl.register_show('hit', game_path +"lamps/game/success.lampshow")
                self.lampctrl.register_show('jackpot', game_path +"lamps/game/success.lampshow")

                # Setup High Scores
		self.setup_highscores()
                        
                


                #Setup Date & Time Display
                self.show_date_time = self.user_settings['Machine (Standard)']['Show Date and Time']

                #Maximum Players
                self.max_players = 4;
                
                #setup paused flag
                self.paused = False

                #add basic modes
                #------------------
                #attract mode
		self.attract_mode = Attract(self)
                #basic game control mode
		self.base_game_mode = BaseGameMode(self)
                #moonlight mode - special
                self.moonlight = Moonlight(self,2)
                #effects mode
                self.effects = Effects(self,4)
                #utility mode
                self.utility = Utility(self)
                #tilt mode
                self.tilt = Tilt(self,5)
                #extra ball mode
                self.extra_ball = Extra_Ball(self)
                #screens mode
                self.screens = Screens(self)
                #match mode
                self.match = Match(self,10)
                #add idol mode for idol logic and control
                self.idol = Idol(self,15)
                #setup mini_playfield
                self.mini_playfield = Mini_Playfield(self,16)
                #------------------


                # set up the color desktop if we're using that
                if self.color_desktop:
                    self.desktop.draw_window(self.user_settings['Machine (Standard)']['Color Display Pixel Size'],self.user_settings['Machine (Standard)']['Color Display X Offset'],self.user_settings['Machine (Standard)']['Color Display Y Offset'])
                    # load the images for the colorized display
                    self.desktop.load_images(dots_path)


		# Instead of resetting everything here as well as when a user
		# initiated reset occurs, do everything in self.reset() and call it
		# now and during a user initiated reset.
		self.reset()
Пример #23
0
        def start_scene(self):
            if self.mode_enabled and self.game.get_player_stats('multiball_started')==False and self.game.get_player_stats('quick_multiball_running')==False and self.game.get_player_stats('lock_in_progress')==False and self.game.get_player_stats('dog_fight_running')==False:
                
                self.name_text =''
                self.info_text =''
                self.info2_text =''
            
                #play sound
                self.game.sound.play("scene_started")

                if self.current_mode_num==0:
                    self.timer = self.game.user_settings['Gameplay (Feature)']['Get The Idol Timer']
                    self.name_text = 'GET THE IDOL'
                    self.info_text = 'HIT TEMPLE'
                    self.info2_text = 'CAPTIVE BALL'

                elif self.current_mode_num==1:
                    self.timer = self.game.user_settings['Gameplay (Feature)']['Streets Of Cairo Timer']
                    self.name_text = 'STREETS OF CAIRO'
                    self.info_text = 'SHOOT LIT SHOTS'
                    self.info2_text = 'TO FIND MARION'

                elif self.current_mode_num==2:
                    #timer = self.game.user_settings['Gameplay (Feature)']['Well Of Souls Timer']
                    self.name_text = 'WELL OF SOULS'
                    self.info_text = 'SHOOT CENTER HOLE'

                elif self.current_mode_num==3:
                    #timer = self.game.user_settings['Gameplay (Feature)']['Raven Bar Timer']
                    if self.secret_mode:
                        self.name_text = 'Werewolf Attack!'.upper()
                        self.info_text = 'Secret Video Mode'.upper()
                    else:
                        self.name_text = 'RAVEN BAR'
                        self.info_text = 'VIDEO MODE'

                elif self.current_mode_num==4:
                    self.timer = self.game.user_settings['Gameplay (Feature)']['Monkey Brains Timer']
                    self.name_text = 'MONKEY BRAINS'
                    self.info_text = 'SHOOT LIT SHOTS'

                elif self.current_mode_num==5:
                    self.timer = self.game.user_settings['Gameplay (Feature)']['Steal The Stones Timer']
                    self.name_text = 'STEAL THE STONES'
                    self.info_text = 'SHOOT RAMP THEN'
                    self.info2_text = 'JONES TARGETS'
                    
                elif self.current_mode_num==6:
                    #timer = self.game.user_settings['Gameplay (Feature)']['Mine Cart Timer']
                    self.name_text = 'MINE CART'
                    self.info_text = 'VIDEO MODE'

                elif self.current_mode_num==7:
                    self.timer = self.game.user_settings['Gameplay (Feature)']['Rope Bridge Timer']
                    self.name_text = 'ROPE BRIDGE'
                    self.info_text = 'SHOOT RAMPS'
                    self.info2_text = 'TO CROSS ROPE BRIDGE'

                elif self.current_mode_num==8:
                    self.timer = self.game.user_settings['Gameplay (Feature)']['Castle Brunwald Timer']
                    self.name_text = 'CASTLE BRUNWALD'
                    self.info_text = 'HIT UPPER CAPTIVE BALL'
                    self.info2_text = 'TO ESCAPE CASTLE'

                elif self.current_mode_num==9:
                    self.timer = self.game.user_settings['Gameplay (Feature)']['Tank Chase Timer']
                    self.name_text = 'TANK CHASE'
                    self.info_text = 'SHOOT LOOPS'
                    self.info2_text = 'TO DESTROY TANK'

                elif self.current_mode_num==10:
                    self.timer = self.game.user_settings['Gameplay (Feature)']['The 3 Challenges Timer']
                    self.name_text = '3 CHALLENGES'
                    self.info_text = 'SHOOT MOVING SHOTS'
                    self.info2_text = 'TO PASS'

                elif self.current_mode_num==11:
                    #timer = self.game.user_settings['Gameplay (Feature)']['Choose Wisely Timer']
                    self.name_text = 'CHOOSE WISELY'
                    self.info_text = 'VIDEO MODE'
                
                elif self.current_mode_num==12:
                    self.name_text = 'WAREHOUSE RAID'
                    self.info_text = 'LOCK BALLS ON RAMP'
                    self.info2_text = 'TO FIND ITEMS'
                
                elif self.current_mode_num==13:
                    self.timer = self.game.user_settings['Gameplay (Feature)']['Jones Vs Aliens Timer']
                    self.name_text = 'JONES VS ALIENS'
                    self.info_text = 'DESTROY SHIPS'
                    self.info2_text = 'TO SAVE EARTH'

                anim = dmd.Animation().load(game_path+"dmd/start_scene.dmd")
                self.animation_layer = dmd.AnimatedLayer(frames=anim.frames,hold=True,frame_time=4)
                
                self.animation_layer.add_frame_listener(-1,self.mode_text)

                self.ssd_count=0#temp fix for frame_listener multi call with held
                self.animation_layer.add_frame_listener(-1,self.scene_start_delay)


                self.layer = dmd.GroupedLayer(128, 32, [self.animation_layer,self.name_layer,self.info_layer,self.info2_layer])

                #update mode flags and player stats
                self.mode_enabled=False
                self.game.set_player_stats('mode_enabled',self.mode_enabled)
                self.mode_running = True
                self.game.set_player_stats('mode_running',self.mode_running)
                self.game.set_player_stats('mode_running_id',self.current_mode_num)

                #update lamp for mode start
                self.mode_start_lamp(self.mode_enabled)

                #record audits
                audits.record_value(self,'modeStarted')
                
                #score
                self.game.score(self.mode_start_value)
                
            elif self.mode_running and self.game.get_player_stats('multiball_started')==False and self.game.get_player_stats('quick_multiball_running')==False and self.game.get_player_stats('lock_in_progress')==False and self.game.get_player_stats('dog_fight_running')==False  and self.game.get_player_stats('multiball_mode_started')== False:
                self.mode_bonus()
            else:
                timer = 0
                #lengthen the timer if these events are running
                if self.game.get_player_stats('multiball_started')  or self.game.get_player_stats('quick_multiball_running') or self.game.get_player_stats('lock_in_progress') or self.game.get_player_stats('dog_fight_running'):
                    timer =2
                    
                if self.game.get_player_stats('multiball_mode_started'):
                    timer =1
                    
                #hold a ball for while multiball running for multiple jackpots use
                if self.game.get_player_stats('multiball_running'): 
                    timer = 10
                    if self.game.temple.balls==self.game.trough.num_balls_in_play: #dont hold if all balls are in temple subway
                        timer=0
                        
                #check for scene completetion and therefore start final adventure
                if self.all_scenes_complete and not self.game.get_player_stats('final_adventure_started'):
                    self.start_final_adventure()
                    
                self.delay(name='eject_delay', event_type=None, delay=timer, handler=self.eject_ball)
Пример #24
0
        def mode_bonus(self):
            timer=2
            self.game.screens.mode_bonus(timer,self.mode_bonus_value)
            self.delay(name='eject_delay', event_type=None, delay=timer, handler=self.eject_ball)

            audits.record_value(self,'modeBonus')
Пример #25
0
 def collect_finish(self):
     self.game.update_lamps()
     self.game.effects.drive_lamp('topDropEB','off')
     self.game.effects.drive_lamp('shootAgain','smarton')
     audits.record_value(self.game,'extraBallAwarded')
Пример #26
0
 def lit_finish(self):
     self.game.update_lamps()
     self.game.effects.drive_lamp('topDropEB','smarton')
     audits.record_value(self.game,'extraBallLit')
Пример #27
0
        def update_count(self):
            
            self.cellar_visits+=1

            #update audit tracking
            audits.record_value(self.game,'cellarVisit')
Пример #28
0
    def setup(self):
        """docstring for setup"""
        self.load_config(self.yamlpath)

        self.load_settings(settings_template_path, settings_path)
        # self.sound.music_volume_offset = self.user_settings['Sound']['Music volume offset']
        # volume_level = self.user_settings['Sound']['Initial Volume']
        # self.sound.set_volume(volume_level/30) #make part of volume mode
        self.load_game_data(game_data_template_path, game_data_path)

        # define system status var
        self.system_status = "power_up"
        self.system_version = "0.5.0"
        self.system_name = "Indiana Jones 2".upper()

        # Setup fonts
        self.fonts = {}
        # self.fonts['jazz18'] = font_jazz18
        self.fonts["18x12"] = font_18x12
        self.fonts["num_14x10"] = font_14x10
        self.fonts["num_07x4"] = dmd.font_named("font_7x4.dmd")

        self.fonts["tiny7"] = font_tiny7
        self.fonts["7x4"] = dmd.font_named("font_7x4.dmd")
        self.fonts["7x4"].tracking = -1
        self.fonts["7x4"].composite_op = "blacksrc"

        self.fonts["07x5"] = dmd.font_named("font_7x5.dmd")
        self.fonts["07x5"].tracking = -1
        self.fonts["07x5"].composite_op = "blacksrc"

        self.fonts["6x6_bold"] = dmd.font_named("font_8x7_bold.dmd")
        self.fonts["6x6_bold"].tracking = -1
        self.fonts["6x6_bold"].composite_op = "blacksrc"

        self.fonts["8x6"] = dmd.font_named("font_9x6_bold.dmd")
        self.fonts["8x6"].tracking = -1
        self.fonts["8x6"].composite_op = "blacksrc"

        self.fonts["num_09Bx7"] = dmd.font_named("font_10x7_bold.dmd")
        self.fonts["num_09Bx7"].tracking = -1
        self.fonts["num_09Bx7"].composite_op = "blacksrc"

        self.fonts["9x7_bold"] = dmd.font_named("font_10x7_bold.dmd")
        self.fonts["9x7_bold"].tracking = -1
        self.fonts["9x7_bold"].composite_op = "blacksrc"

        self.fonts["10x7_bold"] = dmd.font_named("font_12x8_bold.dmd")
        self.fonts["10x7_bold"].tracking = -1
        self.fonts["10x7_bold"].composite_op = "blacksrc"

        self.fonts["14x9_bold"] = dmd.font_named("font_14x9.dmd")
        self.fonts["14x9_bold"].tracking = -1
        self.fonts["14x9_bold"].composite_op = "blacksrc"

        self.fonts["23x12"] = dmd.font_named("font_23x12_bold.dmd")
        self.fonts["23x12"].tracking = -1
        self.fonts["23x12"].composite_op = "blacksrc"

        self.fonts["30x13"] = dmd.font_named("font_30x13_bold.dmd")
        self.fonts["30x13"].tracking = -1
        self.fonts["30x13"].composite_op = "blacksrc"

        self.fonts["4px_az"] = dmd.font_named("font_7x4.dmd")
        self.fonts["5px_az"] = dmd.font_named("font_7x5.dmd")
        self.fonts["5px_inv_az"] = dmd.font_named("font_7x5_inverted.dmd")
        self.fonts["6px_az"] = dmd.font_named("Font_19_CactusCanyon.dmd")
        self.fonts["7px_narrow_az"] = dmd.font_named("Font_1_CactusCanyon.dmd")
        self.fonts["7px_az"] = dmd.font_named("Font_2_CactusCanyon.dmd")
        self.fonts["7px_bold_az"] = dmd.font_named("Font_14_CactusCanyon.dmd")
        self.fonts["9px_az"] = dmd.font_named("Font_15_CactusCanyon.dmd")
        self.fonts["10px_az"] = dmd.font_named("Font_Custom_10px_AZ.dmd")

        # setup paths
        self.paths = {}
        self.paths["game"] = game_path
        self.paths["sound"] = sound_path
        self.paths["speech"] = voice_path
        self.paths["music"] = music_path
        self.log.info(self.paths)

        # update audit data on boot up time
        audits.record_value(self, "bootUp")

        # set start time game var
        self.start_time = time.time()

        # 		print "Stats:"
        # 		print self.game_data
        # 		print "Settings:"
        # 		print self.settings

        self.log.info("Initial switch states:")
        for sw in self.switches:
            self.log.info("  %s:\t%s" % (sw.name, sw.state_str()))

            # balls per game setup
        self.balls_per_game = self.user_settings["Machine (Standard)"]["Balls Per Game"]

        # moonlight setup
        self.moonlight_minutes = self.user_settings["Gameplay (Feature)"]["Moonlight Mins to Midnight"]
        self.moonlight_flag = False

        self.setup_ball_search()
        self.score_display.set_left_players_justify(self.user_settings["Display"]["Left side score justify"])

        # speech setup
        self.extended_speech = self.boolean_format(self.user_settings["Sound"]["Extended Speech"])
        self.log.info("Extended Speech Enabled:%s", self.extended_speech)

        # Note - Game specific item:
        # The last parameter should be the name of the game's ball save lamp
        self.ball_save = procgame.modes.BallSave(self, self.lamps.shootAgain, "shooterLane")

        trough_switchnames = []
        # Note - Game specific item:
        # This range should include the number of trough switches for
        # the specific game being run.  In range(1,x), x = last number + 1.
        for i in range(1, 7):
            trough_switchnames.append("trough" + str(i))
        early_save_switchnames = ["rightOutlaneBottom", "leftOutlane"]

        # Note - Game specific item:
        # Here, trough6 is used for the 'eject_switchname'.  This must
        # be the switch of the next ball to be ejected.  Some games
        # number the trough switches in the opposite order; so trough1
        # might be the proper switchname to user here.

        # setup trough
        self.trough = Trough(game=self, drain_callback=self.drain_callback)
        # Link ball_save to trough
        self.trough.ball_save_callback = self.ball_save.launch_callback
        self.trough.num_balls_to_save = self.ball_save.get_num_balls_to_save
        self.ball_save.trough_enable_ball_save = self.trough.enable_ball_save

        # setup & init service modes
        self.service_mode = ServiceMode(self, 100, font_07x5, font_8x6_bold, [])
        self.coin_door = CoinDoor(self)

        # Register lampshow files for attact
        self.lampshow_keys = []
        key_ctr = 0
        for file in lampshow_files:
            if file.find("flasher", 0) > 0:
                key = "attract_flashers_" + str(key_ctr)
            else:
                key = "attract_lamps_" + str(key_ctr)
            self.lampshow_keys.append(key)
            self.lampctrl.register_show(key, file)
            key_ctr += 1

        # register game play lamp show
        self.lampctrl.register_show("success", game_path + "lamps/game/success.lampshow")
        self.lampctrl.register_show("ball_lock", game_path + "lamps/game/success.lampshow")
        self.lampctrl.register_show("hit", game_path + "lamps/game/success.lampshow")
        self.lampctrl.register_show("jackpot", game_path + "lamps/game/success.lampshow")
        self.lampctrl.register_show("start_ball", game_path + "lamps/game/start_ball_32.lampshow")
        self.lampctrl.register_show("end_ball", game_path + "lamps/game/end_ball_32.lampshow")
        self.lampctrl.register_show("mode_start_shot", game_path + "lamps/game/mode_start_shot_32.lampshow")
        self.lampctrl.register_show("mode_start_eject", game_path + "lamps/game/mode_start_eject_32.lampshow")

        # Setup High Scores
        self.setup_highscores()
        # allow access of hs initials from other modes
        self.last_entered_inits = None

        # Setup Date & Time Display
        self.show_date_time = self.user_settings["Machine (Standard)"]["Show Date and Time"]

        # Maximum Players
        self.max_players = 4

        # setup paused flag
        self.paused = False

        # add basic modes
        # ------------------
        # attract mode
        self.attract_mode = Attract(self)
        # moonlight mode - special
        self.moonlight = Moonlight(self, 2)
        # effects mode
        self.effects = Effects(self, 4)
        # basic game control mode
        self.base_game_mode = BaseGameMode(self)
        # rgb lamps mode
        # self.rgb_lamps = RGBLamps(self,4)
        # utility mode
        self.utility = Utility(self)
        # tilt mode
        self.tilt = Tilt(self, 5)
        # extra ball mode
        self.extra_ball = Extra_Ball(self)
        # screens mode
        self.screens = Screens(self)
        # volume mode
        self.volume = Volume(self)
        # match mode
        self.match = Match(self, 10)
        # add ark mode for ark logic and control
        self.ark = Ark(self, 15)
        # add temple mode for temple logic and control
        self.temple = Temple(self, 15)
        # add temple mode for temple logic and control
        self.swordsman = Swordsman(self, 15)
        # add idol mode for idol logic and control
        # self.idol = Idol(self,15)
        # setup mini_playfield
        # self.mini_playfield = Mini_Playfield(self,16)
        # ------------------

        # set up the color desktop if we're using that
        if self.color_desktop:
            self.desktop.draw_window(
                self.user_settings["Display"]["Color Display Pixel Size"],
                self.user_settings["Display"]["Color Display X Offset"],
                self.user_settings["Display"]["Color Display Y Offset"],
            )
            # load the images for the colorized display
            self.desktop.load_images(dots_path)

        # Instead of resetting everything here as well as when a user
        # initiated reset occurs, do everything in self.reset() and call it
        # now and during a user initiated reset.
        self.reset()