Пример #1
0
 def restart_hold_display(self):
     backdrop = dmd.FrameLayer(
         opaque=True,
         frame=self.game.assets.dmd_mineEntranceBorder.frames[0])
     awardTextTop = ep.EP_TextLayer(128 / 2,
                                    5,
                                    self.game.assets.font_5px_bold_AZ,
                                    justify="center",
                                    opaque=False)
     awardTextBottom = ep.EP_TextLayer(128 / 2,
                                       11,
                                       self.game.assets.font_5px_AZ,
                                       justify="center",
                                       opaque=False)
     timeText = ep.EP_TextLayer(64,
                                17,
                                self.game.assets.font_9px_az,
                                justify="center",
                                opaque=False)
     timeText.composite_op = "blacksrc"
     awardTextTop.set_text("SHOOT THE MINE", color=ep.GREEN)
     awardTextBottom.set_text("TO RESTART MULTIBALL", color=ep.YELLOW)
     textLine = "PAUSED"
     timeText.set_text(textLine, blink_frames=4, color=ep.MAGENTA)
     combined = dmd.GroupedLayer(
         128, 32, [backdrop, awardTextTop, awardTextBottom, timeText])
     self.layer = combined
Пример #2
0
    def train_victory(self):
        start_value = self.game.increase_tracking('adventureCompleteValue',5000)
        if self.game.save_polly.won:
            self.awardString = "POLLY SAVED"
            value = start_value
            complete_color = ep.GREEN
            # play the short chug
            self.game.sound.play(self.game.assets.sfx_trainChugShort)
        else:
            self.awardString = "POLLY DIED"
            value = start_value / 10
            self.game.sound.play(self.game.assets.sfx_glumRiffShort)
            complete_color = ep.RED

        anim = self.game.assets.dmd_trainHeadOn
        trainLayer = dmd.AnimatedLayer(frames=anim.frames,hold=True,opaque=True,repeat=True,frame_time=6)
        textLine1 = ep.EP_TextLayer(37,1,self.game.assets.font_7px_az,justify="center",opaque=False).set_text("TIED TO",color=ep.YELLOW)
        textLine2 = ep.EP_TextLayer(37,9,self.game.assets.font_7px_az,justify="center",opaque=False).set_text("THE TRACKS",color=ep.YELLOW)
        textLine3 = ep.EP_TextLayer(37,20,self.game.assets.font_7px_az,justify="center",opaque=False).set_text("COMPLETED",color=complete_color)
        combined = dmd.GroupedLayer(128,32,[trainLayer,textLine1,textLine2,textLine3])
        self.layer = combined

        myWait = 1.5

        self.delay(name="Display",delay=myWait,handler=self.show_award_text)
        self.awardPoints = str(ep.format_score(value))
        self.game.score(value,bonus=True)
Пример #3
0
 def light_extra_ball(self,callback=None):
     # add the ball to the pending extra balls
     derp = self.game.increase_tracking('extraBallsPending')
     print "EXTRA BALLS PENDING: " + str(derp)
     # audit tick
     self.game.game_data['Audits']['Extra Balls Earned'] += 1
     # open the mine
     if self.game.mountain.mineTicks != 8:
         self.game.mountain.full_open()
     # setup  a bunch of text
     textLine1 = ep.EP_TextLayer(28, 4, self.game.assets.font_9px_az, "center", opaque=False).set_text("EXTRA",color=ep.ORANGE)
     textLine2 = ep.EP_TextLayer(28, 16, self.game.assets.font_9px_az, "center", opaque=False).set_text("BALL",color=ep.ORANGE)
     textLine3 = ep.pulse_text(self,96,4,"IS",color=ep.GREEN)
     textLine4 = ep.pulse_text(self,96,16,"LIT",sequence=[1,3],color=ep.GREEN)
     # and a backdrop
     backdrop = dmd.FrameLayer(opaque=True, frame=self.game.assets.dmd_ball.frames[0])
     # and the wipe animation
     anim = self.game.assets.dmd_horseWipeRight
     myWait = len(anim.frames) / 10.0 + 1
     animLayer = dmd.AnimatedLayer(frames=anim.frames,hold=True,opaque=False,repeat=False,frame_time=6)
     animLayer.composite_op = "blacksrc"
     # slap it all together
     composite = dmd.GroupedLayer(128,32,[backdrop,textLine1,textLine2,textLine3,textLine4,animLayer])
     # and turn it on
     self.layer = composite
     # with a sound effect
     self.game.sound.play(self.game.assets.sfx_leftLoopEnter)
     # play a quote
     self.play_ordered_quote(self.game.assets.quote_extraBallLit,'lit_extra_ball')
     self.lamp_update()
     # callback process for calling from skill shot
     if callback:
         self.delay(delay=myWait,handler=callback)
     self.delay("Display",delay=myWait,handler=self.clear_layer)
     print "EXTRA BALL LIT"
Пример #4
0
 def update_display(self):
     self.cancel_delayed("Display")
     # set up the display during multiball
     # whateve the current bart layer is, default is idle
     backdrop = self.bartLayer
     # title line
     titleLine = ep.EP_TextLayer(46,
                                 -1,
                                 self.game.assets.font_5px_AZ,
                                 "center",
                                 opaque=False).set_text("BIONIC BART",
                                                        color=ep.GREY)
     # score line
     p = self.game.current_player()
     scoreString = ep.format_score(p.score)
     scoreLine = ep.EP_TextLayer(46,
                                 5,
                                 self.game.assets.font_9px_az,
                                 "center",
                                 opaque=False).set_text(scoreString,
                                                        blink_frames=4,
                                                        color=ep.YELLOW)
     scoreLine.composite_op = "blacksrc"
     combined = dmd.GroupedLayer(
         128, 32,
         [backdrop, titleLine, scoreLine, self.actionLine, self.statusLine])
     self.layer = combined
     # loop back in .2 to update
     self.delay(name="Display", delay=0.2, handler=self.update_display)
Пример #5
0
 def start(self):
     # set the starting flag for the double flipper start
     self.starting = True
     self.shotValue = self.startValue
     # start the actual player
     playerNum = self.playerList[0] + 1
     textLayer1 = ep.EP_TextLayer(64,
                                  3,
                                  self.game.assets.font_9px_az,
                                  "center",
                                  opaque=False)
     textLayer1.set_text("PLAYER " + str(playerNum),
                         blink_frames=10,
                         color=ep.CYAN)
     textLayer2 = ep.EP_TextLayer(64,
                                  15,
                                  self.game.assets.font_5px_bold_AZ,
                                  "center",
                                  opaque=False)
     textLayer2.set_text("PRESS BOTH FLIPPERS", color=ep.GREEN)
     textLayer3 = ep.EP_TextLayer(64,
                                  22,
                                  self.game.assets.font_5px_bold_AZ,
                                  "center",
                                  opaque=False)
     textLayer3.set_text("TO START", color=ep.GREEN)
     combined = dmd.GroupedLayer(
         128, 32, [self.backdrop, textLayer1, textLayer2, textLayer3])
     self.layer = combined
     # set a timer to end if nobody hits the flippers
     self.delay("Start Delay", delay=20, handler=self.end)
Пример #6
0
 def polly_died(self, drain=False):
     self.game.peril = False
     self.running = False
     self.wipe_delays()
     backdrop = dmd.FrameLayer(
         opaque=True, frame=self.game.assets.dmd_poutySheriff.frames[0])
     textLine1 = ep.EP_TextLayer(25,
                                 8,
                                 self.game.assets.font_12px_az,
                                 justify="center",
                                 opaque=False)
     if drain:
         string = "OH"
     else:
         string = "TOO"
     textLine1.set_text(string, color=ep.RED)
     textLine2 = ep.EP_TextLayer(98,
                                 8,
                                 self.game.assets.font_12px_az,
                                 justify="center",
                                 opaque=False)
     if drain:
         string = "NO!"
     else:
         string = "LATE!"
     textLine2.set_text(string, color=ep.RED)
     combined = dmd.GroupedLayer(128, 32, [backdrop, textLine1, textLine2])
     self.layer = combined
     self.game.sound.play(self.game.assets.sfx_glumRiff)
     self.delay("Operational", delay=1.5, handler=self.end_river_chase)
 def mode_started(self):
     # log the hit in audits
     self.game.game_data['Feature']['Stampede Started'] += 1
     # which jackpot is active
     self.active = 2
     self.jackpots = 0
     # cancel any other displays
     for mode in self.game.ep_modes:
         if getattr(mode, "abort_display", None):
             mode.abort_display()
     # fire up the switch block if it's not already loaded
     self.game.switch_blocker('add',self.myID)
     # add the stampede value and addon to get the points for this round
     self.jackpotValue = (self.game.show_tracking('Stampede Value') * 2) + self.game.show_tracking('Stampede Addon')
     # base value
     self.baseValue = self.game.show_tracking('Stampede Value')
     # set the total to 0
     self.game.set_tracking('Stampede Total',0)
     # The first center shot is a jackpot - but it has to be able to be lowered
     self.centerValue = self.jackpotValue
     # timers for pulling the jackpot back to center
     self.longTimer = 9
     self.shortTimer = 6
     self.time = 0
     self.halted = False
     # set up some display bits
     # title line
     self.titleLine = ep.EP_TextLayer(128/2, 1, self.game.assets.font_5px_AZ, "center", opaque=False).set_text("STAMPEDE MULTIBALL",color=ep.PURPLE)
     # score line
     p = self.game.current_player()
     scoreString = ep.format_score(p.score)
     self.mainScoreLine = ep.EP_TextLayer(64, 7, self.game.assets.font_9px_az, "center", opaque=False).set_text(scoreString,color=ep.YELLOW)
     self.mainScoreLine.composite_op = "blacksrc"
     # jackpot info line
     self.jackpotLine = ep.EP_TextLayer(64,1, self.game.assets.font_5px_AZ, "center", opaque=False)
 def tld(self,
         textString1,
         textString2,
         textString3,
         color1=ep.WHITE,
         color2=ep.WHITE,
         color3=ep.WHITE):
     textLine1 = ep.EP_TextLayer(128 / 2,
                                 1,
                                 self.game.assets.font_7px_az,
                                 "center",
                                 opaque=False).set_text(textString1,
                                                        color=color1)
     textLine2 = ep.EP_TextLayer(128 / 2,
                                 11,
                                 self.game.assets.font_7px_az,
                                 "center",
                                 opaque=False).set_text(textString2,
                                                        color=color2)
     textLine3 = ep.EP_TextLayer(128 / 2,
                                 21,
                                 self.game.assets.font_7px_az,
                                 "center",
                                 opaque=False).set_text(textString3,
                                                        color=color3)
     combined = dmd.GroupedLayer(128, 32, [textLine1, textLine2, textLine3])
     self.layer = combined
 def replay_score_page(self):
     replay_text = ep.format_score(
         self.game.user_settings['Machine (Standard)']['Replay Score'])
     score_text = ep.format_score(self.game.current_player().score)
     textLine1 = ep.EP_TextLayer(64,
                                 1,
                                 self.game.assets.font_5px_bold_AZ,
                                 "center",
                                 opaque=True).set_text("REPLAY SCORE:",
                                                       color=ep.ORANGE)
     textLine2 = ep.EP_TextLayer(64,
                                 7,
                                 self.game.assets.font_7px_az,
                                 "center",
                                 opaque=False).set_text(replay_text,
                                                        color=ep.GREEN)
     textLine3 = ep.EP_TextLayer(64,
                                 17,
                                 self.game.assets.font_5px_bold_AZ,
                                 "center",
                                 opaque=False).set_text("YOUR SCORE:",
                                                        color=ep.ORANGE)
     textLine4 = ep.EP_TextLayer(64,
                                 23,
                                 self.game.assets.font_7px_az,
                                 "center",
                                 opaque=False).set_text(score_text,
                                                        blink_frames=8,
                                                        color=ep.RED)
     layer = dmd.GroupedLayer(128, 32,
                              [textLine1, textLine2, textLine3, textLine4])
     return layer
Пример #10
0
 def finish_up(self):
     # cancel the main display loop
     self.cancel_delayed("Display")
     # reset the autoplunge, just in case
     self.game.trough.balls_to_autoplunge = 0
     # turn off the local running flag
     self.running = False
     self.game.set_tracking('highNoonStatus',"FINISH")
     # drop the bad guys
     self.game.bad_guys.drop_targets()
     # turn the lights off
     self.game.set_tracking('lampStatus',"OFF")
     self.lamp_update()
     # kill the bad guy lamps?
     for lamp in range(0,4,1):
         self.game.lamp_control.badGuyLamps[lamp].disable()
     # kill the GI
     self.game.gi_control("OFF")
     # lampshow down wipe
     self.game.lampctrl.play_show(self.game.assets.lamp_topToBottom, repeat=False)
     # throw in a 'you won' display
     if self.hasWon:
         # fireworks
         anim = self.game.assets.dmd_fireworks
         myWait = len(anim.frames) / 10.0
         animLayer = ep.EP_AnimatedLayer(anim)
         animLayer.hold = True
         animLayer.frame_time = 6
         # firework sounds keyframed
         animLayer.add_frame_listener(7,self.game.sound.play,param=self.game.assets.sfx_fireworks1)
         animLayer.add_frame_listener(14,self.game.sound.play,param=self.game.assets.sfx_fireworks2)
         animLayer.add_frame_listener(20,self.game.sound.play,param=self.game.assets.sfx_fireworks3)
         animLayer.composite_op = "blacksrc"
         textLayer1 = ep.EP_TextLayer(64, 3, self.game.assets.font_9px_az, "center", opaque=False).set_text("VICTORY",color=ep.GREEN)
         textLayer2 = ep.EP_TextLayer(64, 13, self.game.assets.font_13px_score, "center", opaque=False).set_text(str(ep.format_score(self.victoryPoints + self.timeBonus)),color=ep.ORANGE)
         combined = dmd.GroupedLayer(128,32,[textLayer1,textLayer2,animLayer])
         self.layer = combined
     else:
         myWait = 3
         textLayer1 = ep.EP_TextLayer(64,4,self.game.assets.font_10px_AZ, "center", opaque=True).set_text("THEY",color=ep.RED)
         textLayer2 = ep.EP_TextLayer(64,18,self.game.assets.font_10px_AZ, "center", opaque=False).set_text("ESCAPED",color=ep.RED)
         combined = dmd.GroupedLayer(128,32,[textLayer1,textLayer2])
         self.layer = combined
     #  turn the flippers off
     self.game.enable_flippers(False)
     # clear the saloon and mine if needed
     if self.game.switches.minePopper.is_active():
         self.game.mountain.kick()
     if self.game.switches.saloonPopper.is_active():
         self.game.saloon.kick()
     # clear the shooter lane if needed
     if self.game.switches.shooterLane.is_active():
         self.game.coils.autoPlunger.pulse(self.game.base.autoplungeStrength)
     if self.hasWon:
         # if we won, the animation is playing, so it may take a while and the balls may drain first
         # so we have to bounce through a helper
         self.delay(delay=myWait+1,handler=self.final_display_pause)
     else:
         # loop through final display which checks for balls on the field
         self.final_display_pause()
Пример #11
0
 def final_display(self):
     # kill all the stuff, just in case we went from 2 balls to 0
     self.darken()
     self.ending = False
     # play the closing riff
     self.game.sound.play_music(self.game.assets.music_mmClosing, loops=1)
     titleString = "MOONLIGHT MADNESS TOTAL"
     titleLine = ep.EP_TextLayer(128 / 2,
                                 1,
                                 self.game.assets.font_5px_AZ,
                                 "center",
                                 opaque=False).set_text(titleString,
                                                        color=ep.CYAN)
     points = self.moonlightTotal
     scoreString = ep.format_score(points)
     scoreLine = ep.EP_TextLayer(64,
                                 9,
                                 self.game.assets.font_13px_thin_score,
                                 "center",
                                 opaque=False).set_text(scoreString,
                                                        color=ep.GREEN)
     infoLine = ep.EP_TextLayer(64,
                                24,
                                self.game.assets.font_5px_AZ,
                                "center",
                                opaque=False).set_text(
                                    "NOW BACK TO THE GAME", color=ep.BLUE)
     self.layer = dmd.GroupedLayer(128, 32,
                                   [titleLine, scoreLine, infoLine])
     # delay a bit before starting the real ball
     self.delay(delay=5, handler=self.finish_up)
Пример #12
0
 def party_started(self):
     # Turn the music on
     self.music_on("music_party")
     # Show the current party mode activated
     background = dmd.FrameLayer(
         opaque=True, frame=self.game.assets.dmd_starsBorder.frames[0])
     textLayer1 = ep.EP_TextLayer(64,
                                  1,
                                  self.game.assets.font_7px_bold_az,
                                  "center",
                                  opaque=False).set_text("PARTY MODE START",
                                                         color=ep.MAGENTA)
     self.ptextLayer2 = ep.EP_TextLayer(64,
                                        12,
                                        self.game.assets.font_10px_AZ,
                                        "center",
                                        opaque=False).set_text(
                                            self.game.party_setting.upper(),
                                            color=ep.YELLOW)
     instructions = dmd.TextLayer(
         64, 23, self.game.assets.font_5px_AZ,
         "center").set_text("HOLD L. FLIPPER TO CONFIRM")
     instructions2 = dmd.TextLayer(
         64, 23, self.game.assets.font_5px_AZ,
         "center").set_text("HOLD R. FLIPPER TO DISABLE")
     script = []
     script.append({'seconds': 2, 'layer': instructions})
     script.append({'seconds': 2, 'layer': instructions2})
     instruction_duo = dmd.ScriptedLayer(128, 32, script)
     instruction_duo.composite_op = "blacksrc"
     self.layer = dmd.GroupedLayer(
         128, 32,
         [background, textLayer1, self.ptextLayer2, instruction_duo])
     # start a bail delay
     self.reset_party_timeout()
Пример #13
0
    def drunk_bonus(self):
        print "DMB Disabled, Drunk bonus"
        # grab the point values
        points = self.game.show_tracking('drunkBonusValue')
        # show a screen
        mug = dmd.FrameLayer(opaque=False, frame=self.game.assets.dmd_beerMug1.frames[0])
        mug.composite_op = "blacksrc"
        words = ep.EP_TextLayer(51, 3, self.game.assets.font_9px_az, "center", opaque=False).set_text("DRUNK BONUS",color=ep.YELLOW)
        score = ep.EP_TextLayer(51, 15, self.game.assets.font_9px_az, "center", opaque=False).set_text(ep.format_score(points),blink_frames=8,color=ep.GREEN)
        combined = dmd.GroupedLayer(128,32,[words,score,mug])
        self.layer = combined
        self.game.sound.play(self.game.assets.sfx_pour)
        # unload after 2 seconds
        self.delay("Operational",delay=2,handler=self.unload)

        # score some points
        self.game.score(points)
        # increase the text award
        self.game.set_tracking('drunkBonusValue', (points + 100000))
        # reset the mug hits for next time
        self.game.set_tracking('beerMugHits',0)
        # tick up the shots needed for next time
        self.game.increase_tracking('mug_shots', self.game.user_settings['Gameplay (Feature)']['Beer Mug Hits Boost'])

        # Eject the ball
        self.game.saloon.kick()
        # reset the DMB status
        self.game.set_tracking('drunkMultiballStatus',"OPEN")
Пример #14
0
 def mode_started(self):
     # fire up the switch block if it's not already loaded
     self.game.switch_blocker('add', self.myID)
     self.index = 0
     # unload the launcher
     self.game.tribute_launcher.unload()
     # switch value to start
     self.value = 100000
     self.total = 500000
     # timer value
     self.modeTimer = 20
     self.running = True
     # set up the default text layers
     self.timerLayer = ep.EP_TextLayer(0, 0, self.game.assets.font_9px_az,
                                       "left", True)
     self.valueTitleLayer = ep.EP_TextLayer(80, 0,
                                            self.game.assets.font_5px_AZ,
                                            "center",
                                            False).set_text("TARGET VALUE")
     self.valueLayer = ep.EP_TextLayer(80, 6, self.game.assets.font_7px_az,
                                       "center", False).set_text(
                                           ep.format_score(self.value))
     self.totalTitleLayer = ep.EP_TextLayer(80, 14,
                                            self.game.assets.font_7px_az,
                                            "center",
                                            False).set_text("IT TOTAL")
     self.totalLayer = ep.EP_TextLayer(80, 22, self.game.assets.font_9px_az,
                                       "center", False).set_text(
                                           ep.format_score(self.total))
     self.intro()
Пример #15
0
 def display(self):
     ## this is the main mode display, returns a built layer
     textString1 = str(self.myTimer)
     if self.myTimer > 10:
         timeColor = ep.GREEN
     elif self.myTimer > 5:
         timeColor = ep.YELLOW
     else:
         timeColor = ep.RED
     textLayer1 = ep.EP_TextLayer(105,
                                  4,
                                  self.game.assets.font_17px_score,
                                  "center",
                                  opaque=False).set_text(textString1,
                                                         color=timeColor)
     remain = 20 - self.killed
     if remain > 10:
         remainColor = ep.RED
     elif remain > 5:
         remainColor = ep.YELLOW
     else:
         remainColor = ep.GREEN
     textString2 = str(remain)
     textLayer2 = ep.EP_TextLayer(24,
                                  4,
                                  self.game.assets.font_17px_score,
                                  "center",
                                  opaque=False).set_text(textString2,
                                                         color=remainColor)
     display = dmd.GroupedLayer(128, 32,
                                [self.backdrop, textLayer1, textLayer2])
     return display
Пример #16
0
 def build_display(self, awardTextString, awardScoreString):
     # create the two text lines
     awardTextTop = ep.EP_TextLayer(
         128 / 2,
         3,
         self.game.assets.font_5px_bold_AZ_outline,
         justify="center",
         opaque=False)
     awardTextBottom = ep.EP_TextLayer(
         128 / 2,
         11,
         self.game.assets.font_15px_az_outline,
         justify="center",
         opaque=False)
     awardTextBottom.composite_op = "blacksrc"
     awardTextTop.composite_op = "blacksrc"
     awardTextTop.set_text(awardTextString, color=ep.DARK_GREEN)
     awardTextBottom.set_text(awardScoreString, color=ep.GREEN)
     # combine them
     if self.layer == None:
         self.layer = self.no_layer()
     completeFrame = dmd.GroupedLayer(
         128, 32, [self.layer, awardTextTop, awardTextBottom])
     # swap in the new layer
     return completeFrame
Пример #17
0
    def finish_it(self):
        self.wipe_delays()
        border = dmd.FrameLayer(
            opaque=True,
            frame=self.game.assets.dmd_singlePixelBorder.frames[0])
        textLayer1 = ep.EP_TextLayer(64,
                                     2,
                                     self.game.assets.font_9px_az,
                                     "center",
                                     opaque=False).set_text("COUSIN IT TOTAL",
                                                            color=ep.BROWN)
        textLayer2 = ep.EP_TextLayer(64,
                                     14,
                                     self.game.assets.font_12px_az,
                                     "center",
                                     opaque=False).set_text(str(
                                         ep.format_score(self.total)),
                                                            color=ep.GREEN)
        combined = dmd.GroupedLayer(128, 32, [border, textLayer1, textLayer2])
        self.layer = combined
        # score the points
        self.game.score(self.total)
        self.running = False
        # turn the level 5 stack flag back off
        self.game.stack_level(5, False)
        # set the music back to the main loop
        self.music_on(self.game.assets.music_mainTheme, mySlice=5)
        # remove the switch blocker
        self.game.switch_blocker('remove', self.myID)

        # then unload
        self.delay(delay=2, handler=self.unload)
Пример #18
0
 def intro(self, step=1):
     if step == 1:
         self.stop_music()
         anim = self.game.assets.dmd_tafItIntro
         myWait = len(anim.frames) / 10.0
         animLayer = dmd.AnimatedLayer(frames=anim.frames,
                                       hold=True,
                                       opaque=True,
                                       repeat=False,
                                       frame_time=6)
         self.game.sound.play(self.game.assets.sfx_tafDitty)
         self.layer = animLayer
         self.delay(delay=myWait + 1, handler=self.intro, param=2)
     if step == 2:
         textLayer1 = ep.EP_TextLayer(64, 1, self.game.assets.font_9px_az,
                                      "center",
                                      False).set_text("HIT COUSIN IT")
         textLayer2 = ep.EP_TextLayer(
             64, 11, self.game.assets.font_7px_az, "center",
             False).set_text("ALL SHOTS = " +
                             str(ep.format_score(self.value)))
         textLayer3 = ep.EP_TextLayer(
             64, 20, self.game.assets.font_9px_az, "center",
             False).set_text("'IT' INCREASES VALUE")
         border = dmd.FrameLayer(
             opaque=True,
             frame=self.game.assets.dmd_singlePixelBorder.frames[0])
         combined = dmd.GroupedLayer(
             128, 32, [border, textLayer1, textLayer2, textLayer3])
         current = self.layer
         transition = ep.EP_Transition(self, current, combined,
                                       ep.EP_Transition.TYPE_CROSSFADE)
         self.game.sound.play(self.game.assets.quote_itsCousinIt)
         self.delay(delay=3, handler=self.get_going)
Пример #19
0
 def fanfare(self, inits):
     # celebrate a bit
     self.game.squelch_music()
     self.game.sound.play(self.fanfareSounds[0])
     self.game.sound.play(self.game.assets.sfx_cheers)
     backdrop = dmd.FrameLayer(
         opaque=False, frame=self.game.assets.dmd_starsBorder.frames[0])
     textLayer1 = ep.EP_TextLayer(
         64, 3, self.game.assets.font_5px_bold_AZ, "center",
         opaque=False).set_text(
             self.active_prompt.right[self.fanfareIndex].upper(),
             blink_frames=10)
     textLayer2 = ep.EP_TextLayer(64,
                                  10,
                                  self.game.assets.font_12px_az,
                                  "center",
                                  opaque=False).set_text(inits,
                                                         color=ep.BLUE)
     combined = dmd.GroupedLayer(128, 32,
                                 [backdrop, textLayer1, textLayer2])
     self.layer = combined
     self.fanfareIndex += 1
     self.fanfareSounds.reverse()
     if self.fanfareIndex == self.fanfareCount:
         self.delay(delay=2, handler=self.clear_layer)
         self.delay(delay=3, handler=self.game.restore_music)
         self.delay(delay=3, handler=self.next)
     else:
         self.delay(delay=2, handler=self.fanfare, param=inits)
Пример #20
0
    def pause_display(self):
        # set up the display
        p = self.game.current_player()
        scoreString = ep.format_score(p.score)
        scoreLine = ep.EP_TextLayer(34,
                                    6,
                                    self.game.assets.font_5px_bold_AZ,
                                    "center",
                                    opaque=False).set_text(scoreString,
                                                           blink_frames=8,
                                                           color=ep.BROWN)
        timeString = "TIME: PAUSED"
        timeLine = ep.EP_TextLayer(34,
                                   25,
                                   self.game.assets.font_5px_AZ,
                                   "center",
                                   opaque=False).set_text(timeString,
                                                          blink_frames=10,
                                                          color=ep.DARK_RED)
        textString2 = str((self.shotsToWin - self.shotsSoFar)) + " SHOTS FOR"
        awardLine1 = dmd.TextLayer(34,
                                   11,
                                   self.game.assets.font_7px_az,
                                   "center",
                                   opaque=False).set_text(textString2)

        # stick together the animation and static text with the dynamic text
        composite = dmd.GroupedLayer(128, 32, [
            self.cowLayer, self.pollyTitle, scoreLine, awardLine1,
            self.awardLine2, timeLine
        ])
        self.layer = composite
Пример #21
0
    def anim_bank_victory(self):
        if self.game.bank_robbery.won:
            print "BANK VICTORY"
            self.game.sound.play(self.game.assets.sfx_grinDing)
            victoryLayer = dmd.FrameLayer(
                opaque=False,
                frame=self.game.assets.dmd_pollyVictory.frames[12])
            self.layer = victoryLayer
        else:
            backdrop = dmd.FrameLayer(
                opaque=True, frame=self.game.assets.dmd_poutySheriff.frames[0])
            textLine1 = ep.EP_TextLayer(25,
                                        8,
                                        self.game.assets.font_12px_az,
                                        justify="center",
                                        opaque=False).set_text("YOU",
                                                               color=ep.RED)
            textLine2 = ep.EP_TextLayer(98,
                                        8,
                                        self.game.assets.font_12px_az,
                                        justify="center",
                                        opaque=False).set_text("LOST!",
                                                               color=ep.RED)
            combined = dmd.GroupedLayer(128, 32,
                                        [backdrop, textLine1, textLine2])
            self.layer = combined
            self.game.sound.play(self.game.assets.sfx_glumRiffShort)

        self.delay(name="Display", delay=1, handler=self.blink_award_text)
Пример #22
0
    def end_ambush(self):
        # kill the taunt timer
        self.cancel_delayed("Taunt Timer")
        # Kill the target timers
        for i in range(0, 4, 1):
            self.cancel_delayed(self.targetNames[i])
        # clear the layer
        self.clear_layer()
        # drop all the targets
        self.game.bad_guys.drop_targets()
        # kill the music - if nothing else is running
        #self.stop_music(slice=2)
        # grab the points before tracking
        totalPoints = self.game.show_tracking('ambushPoints')
        # update all the tracking
        self.update_tracking()
        # update the lamps
        self.lamp_update()
        # start up the main theme again if a higher level mode isn't running
        self.music_on(self.game.assets.music_mainTheme, mySlice=2)
        # turn off the level 1 flag
        self.game.stack_level(1, False)
        # setup a display frame
        backdrop = dmd.FrameLayer(
            opaque=False,
            frame=self.game.assets.dmd_singleCowboySidewaysBorder.frames[0])
        textLine1 = ep.EP_TextLayer(74,
                                    2,
                                    self.game.assets.font_7px_bold_az,
                                    "center",
                                    opaque=False)
        textString = "AMBUSH: " + str(self.deathTally) + " KILLS"
        textLine1.set_text(textString, color=ep.RED)
        textLine1.composite_op = "blacksrc"
        textLine2 = ep.EP_TextLayer(74,
                                    11,
                                    self.game.assets.font_12px_az,
                                    "center",
                                    opaque=False)
        print "TOTAL AMBUSH: " + str(ep.format_score(totalPoints))
        textLine2.set_text(ep.format_score(totalPoints), color=ep.GREEN)
        combined = dmd.GroupedLayer(128, 32, [backdrop, textLine1, textLine2])
        self.layer = combined
        # play a quote
        if self.deathTally == 0:
            self.game.base.play_quote(self.game.assets.quote_gunFail)
        else:
            self.game.base.play_quote(self.game.assets.quote_mobEnd)
        self.delay("Display", delay=2, handler=self.clear_layer)

        self.update_badge()
        # unset the base busy flag
        self.game.base.busy = False
        self.game.base.queued -= 1
        # unload the mode
        self.delay("Ambush", delay=2.1, handler=self.unload)
Пример #23
0
 def show_marksman_award(self):
     anim = self.game.assets.dmd_smokingCard
     animLayer = dmd.AnimatedLayer(frames=anim.frames,hold=False,opaque=True,repeat=True,frame_time=7)
     awardTextTop = ep.EP_TextLayer(128/3,3,self.game.assets.font_5px_bold_AZ,justify="center",opaque=False)
     awardTextBottom = ep.EP_TextLayer(128/3,11,self.game.assets.font_15px_az,justify="center",opaque=False)
     awardTextTop.set_text(self.awardString,color=ep.BROWN)
     awardTextBottom.set_text(self.awardPoints,color=ep.RED)
     completeFrame = dmd.GroupedLayer(128, 32, [animLayer,awardTextTop,awardTextBottom])
     self.layer = completeFrame
     self.delay(name="Display",delay=2,handler=self.clear_layer)
Пример #24
0
    def activate(self):
        # set up all the strings & quotes
        self.setup()
        # show the 'challenges you' display
        # clear the banner layer
        textLayer1 = ep.EP_TextLayer(40,
                                     2,
                                     self.game.assets.font_7px_bold_az,
                                     justify="center",
                                     opaque=False)
        textLayer1.set_text(self.nameLine, color=ep.BROWN)
        textLayer2 = ep.EP_TextLayer(40,
                                     15,
                                     self.game.assets.font_7px_bold_az,
                                     justify="center",
                                     opaque=False)
        textLayer2.set_text("CHALLENGES", color=ep.RED)
        textLayer3 = ep.EP_TextLayer(40,
                                     23,
                                     self.game.assets.font_7px_bold_az,
                                     justify="center",
                                     opaque=False)
        textLayer3.set_text("YOU", color=ep.RED)

        textLayer = dmd.GroupedLayer(
            128, 32, [self.faceFrame, textLayer1, textLayer2, textLayer3])

        # play the intro
        duration = self.game.base.play_quote(self.introQuote, squelch=True)
        # wiggle the figure
        self.animate(2)

        # show the transition
        transition = ep.EP_Transition(self, self.game.score_display.layer,
                                      textLayer, ep.EP_Transition.TYPE_PUSH,
                                      ep.EP_Transition.PARAM_NORTH)
        # divert here if we're on boss bart
        if self.brother == 'BOSS':
            self.bossFight = True
            # bump up the points
            self.hitValue *= 2
            self.defeatValue *= 2
            self.deathTally = 0
            # activate the drop targets
            self.delay(delay=duration,
                       handler=self.game.bad_guys.setup_targets)
            # set them all to true
            self.activeBossPosse = [0, 1, 2, 3]
        else:

            # if there's only 1 hit to defeat this bart, set the status to last
            if self.hitsThisBart == 1:
                self.game.set_tracking('bartStatus', "LAST")
        self.delay("Display", delay=duration, handler=self.clear_layer)
        self.delay(delay=duration, handler=self.game.saloon.unbusy)
Пример #25
0
    def pause_train(self, advanced=False):
        if self.running:
            print "PAUSE TRAIN"
            self.paused = True
            # kill the in progress timer
            self.cancel_delayed("Mode Timer")
            # stop the train from moving
            self.game.train.stop()
            # if the thing that sent us here advanced save polly, we pause for 3 seconds
            time = 0
            if advanced:
                time = 3
            # if we're not advancing, there's more to do
            if not advanced:
                time = 5
                # play the pause display
                self.delay("Operational",
                           delay=1.5,
                           handler=self.game.sound.play,
                           param=self.cows[0])
                # swap for the next shot
                self.cows.reverse()
                # setup the display
                border = dmd.FrameLayer(
                    opaque=False,
                    frame=self.game.assets.dmd_tracksBorder.frames[0])
                awardTextTop = ep.EP_TextLayer(
                    128 / 2,
                    5,
                    self.game.assets.font_5px_bold_AZ,
                    justify="center",
                    opaque=False)
                awardTextBottom = ep.EP_TextLayer(
                    128 / 2,
                    11,
                    self.game.assets.font_15px_az,
                    justify="center",
                    opaque=False)
                awardTextTop.set_text("TRAIN", color=ep.BROWN)
                awardTextBottom.set_text("PAUSED",
                                         blink_frames=12,
                                         color=ep.GREEN)
                completeFrame = dmd.GroupedLayer(
                    128, 32, [border, awardTextTop, awardTextBottom])
                transition = ep.EP_Transition(self, self.layer, completeFrame,
                                              ep.EP_Transition.TYPE_PUSH,
                                              ep.EP_Transition.PARAM_NORTH)

            # set a delay to start the train again
            self.delay("Pause Timer",
                       delay=1.5,
                       handler=self.pause_timer,
                       param=time)
Пример #26
0
 def attract_display(self):
     # Banner for attract mode to alert that party mode is on
     script = []
     # set up the text layer
     textString = "< PARTY MODE ENABLED >"
     textLayer = ep.EP_TextLayer(64,
                                 0,
                                 self.game.assets.font_6px_az_inverse,
                                 "center",
                                 opaque=False).set_text(textString,
                                                        color=ep.MAGENTA)
     script.append({'seconds': 1.0, 'layer': textLayer})
     # set up the alternating blank layer
     blank = dmd.FrameLayer(opaque=False,
                            frame=self.game.assets.dmd_blank.frames[0])
     blank.composite_op = "blacksrc"
     script.append({'seconds': 0.5, 'layer': blank})
     # set up the type of mode text
     if self.game.party_setting == 'Flip Ct':
         textString1 = "< LIMITED FLIPS - " + self.game.user_settings[
             'Gameplay (Feature)']['Party - Flip Count'] + " >"
     elif self.game.party_setting == 'Drunk':
         textString1 = "< DRUNK - FLIPS REVERSED >"
     # newbie mode - both flippers all the time
     elif self.game.party_setting == 'Newbie':
         textString1 = "< NEWBIE - BOTH FLIP >"
     # lights out mode
     elif self.game.party_setting == 'Lights Out':
         textString1 = "< LIGHTS OUT >"
     # spiked beer
     elif self.game.party_setting == 'Spiked':
         textString1 = "< SPIKED - BEER TILTS >"
     # rectify
     elif self.game.party_setting == 'Rectify':
         textString1 = "< RECTIFY - NO DUB FLIP >"
     # last case is release to flip
     else:
         textString1 = "< RELEASE TO FLIP >"
     textLayer1 = ep.EP_TextLayer(64,
                                  0,
                                  self.game.assets.font_6px_az_inverse,
                                  "center",
                                  opaque=False).set_text(textString1,
                                                         color=ep.MAGENTA)
     script.append({'seconds': 1.0, 'layer': textLayer1})
     # and another blank
     script.append({'seconds': 0.5, 'layer': blank})
     # make a script layer with the two
     infoLine = dmd.ScriptedLayer(128, 32, script)
     infoLine.composite_op = "blacksrc"
     self.layer = infoLine
Пример #27
0
 def display(self):
     self.cancel_delayed("Display")
     backdrop = dmd.FrameLayer(
         opaque=True, frame=self.game.assets.dmd_cactusBorder.frames[0])
     # build and show the display of combos made & left
     combos = self.game.show_tracking('combos')
     # if we've got a chain going, that affects display
     print "CHAIN VALUE: " + str(self.chain)
     if self.chain > 1:
         if ep.last_shot == "center":
             textString = str(self.chain) + "-WAY SUPER COMBO"
             points = 25000 * self.chain
         else:
             textString = str(self.chain) + "-WAY COMBO"
             points = 50000
         textString2 = str(ep.format_score(points)) + " POINTS"
     else:
         textString = "COMBO AWARDED"
         textString2 = str(combos) + " COMBOS"
     textLine1 = ep.EP_TextLayer(64,
                                 3,
                                 self.game.assets.font_5px_bold_AZ,
                                 justify="center",
                                 opaque=False).set_text(textString,
                                                        color=ep.BROWN)
     textLine2 = ep.EP_TextLayer(64,
                                 11,
                                 self.game.assets.font_9px_az,
                                 justify="center",
                                 opaque=False)
     textLine3 = ep.EP_TextLayer(64,
                                 25,
                                 self.game.assets.font_5px_bold_AZ,
                                 justify="center",
                                 opaque=False)
     textLine2.set_text(textString2, blink_frames=10, color=ep.GREEN)
     combosForStar = self.game.user_settings['Gameplay (Feature)'][
         'Combos for Star']
     diff = combosForStar - combos
     if combos > combosForStar:
         comboString = "BADGE COMPLETE!"
     elif combos == combosForStar:
         comboString = "BADGE AWARDED"
     else:
         comboString = str(diff) + " MORE FOR BADGE!"
     textLine3.set_text(comboString, color=ep.BROWN)
     combined = dmd.GroupedLayer(
         128, 32, [backdrop, textLine1, textLine2, textLine3])
     self.layer = combined
     print "I MADE IT THROUGH COMBO DISPLAY"
     self.delay(name="Display", delay=2, handler=self.clear_layer)
Пример #28
0
 def mode_started(self):
     # index for available shots
     self.liveShots = []
     self.availableShots = [0, 1, 2, 3, 4, 5, 6, 7, 8]
     self.moonlightTotal = 0
     self.running = True
     self.starting = True
     self.hd_flair = self.game.user_settings['Gameplay (Feature)'][
         'High Def Flair'] == 'Enabled'
     self.hd_banners = []
     self.shuffle_hd_banners()
     self.tilted = False
     # kill the GI - and all the lights
     self.game.gi_control("OFF")
     self.game.lamp_control.disable_all_lamps()
     # pick a random shot to light to start with
     self.enable = 0
     self.enable += self.shotsAtStart
     self.enable_shots()
     duration = self.game.sound.play(self.game.assets.sfx_churchBell)
     self.delay(delay=1,
                handler=self.game.sound.play,
                param=self.game.assets.sfx_mbHowl)
     # start the intro music
     self.delay(delay=duration - 1, handler=self.launch)
     # throw up an intro display
     anim = self.game.assets.dmd_moonIntro
     backdrop = dmd.AnimatedLayer(frames=anim.frames,
                                  hold=True,
                                  opaque=True,
                                  repeat=False,
                                  frame_time=12)
     topLine = ep.EP_TextLayer(74,
                               5,
                               self.game.assets.font_10px_AZ,
                               "center",
                               opaque=False).set_text("MOONLIGHT",
                                                      color=ep.CYAN)
     topLine.composite_op = "blacksrc"
     bottomLine = ep.EP_TextLayer(74,
                                  18,
                                  self.game.assets.font_10px_AZ,
                                  "center",
                                  opaque=False).set_text("MADNESS",
                                                         color=ep.CYAN)
     bottomLine.composite_op = "blacksrc"
     combined = dmd.GroupedLayer(128, 32, [backdrop, topLine, bottomLine])
     self.layer = combined
     self.delay("Display", delay=duration + 2, handler=self.update_display)
Пример #29
0
 def main_display(self):
     # this is the main score display for stampede - it's got score on it, so we'll have to loop
     # title line
     titleLine = ep.EP_TextLayer(128/2, 1, self.game.assets.font_5px_AZ, "center", opaque=False).set_text("STAMPEDE MULTIBALL",color=ep.PURPLE)
     # score line
     p = self.game.current_player()
     scoreString = ep.format_score(p.score)
     scoreLine = ep.EP_TextLayer(64, 7, self.game.assets.font_9px_az, "center", opaque=False).set_text(scoreString,color=ep.YELLOW)
     scoreLine.composite_op = "blacksrc"
     # group with cow layer
     combined = dmd.GroupedLayer(128,32,[self.cowLayer,titleLine,scoreLine])
     # set the layer active
     self.layer = combined
     # loop back again in .2 for score update
     self.delay(name="Display",delay=0.2,handler=self.main_display)
Пример #30
0
 def shoot_again(self, step=1):
     # shown when starting an extra ball
     if step == 1:
         imageLayer = dmd.FrameLayer(
             opaque=True, frame=self.game.assets.dmd_shootAgain.frames[0])
         self.game.base.play_quote(self.game.assets.quote_deepLaugh)
         self.game.sound.play(self.game.assets.sfx_incoming)
         self.layer = imageLayer
         self.delay(delay=2, handler=self.shoot_again, param=2)
     if step == 2:
         anim = self.game.assets.dmd_shootAgain
         # math out the wait
         myWait = len(anim.frames) / 10.0
         # set the animation
         animLayer = ep.EP_AnimatedLayer(anim)
         animLayer.hold = True
         animLayer.frame_time = 6
         animLayer.opaque = True
         animLayer.add_frame_listener(2,
                                      self.game.sound.play,
                                      param=self.game.assets.sfx_lowBoom)
         #animLayer.add_frame_listener(4,self.game.trough.launch_balls,param=1)
         # this flag tells the player intro quote to not play
         self.hush = True
         animLayer.add_frame_listener(4, self.game.ball_starting)
         self.layer = animLayer
         self.delay(delay=myWait, handler=self.shoot_again, param=3)
     if step == 3:
         imageLayer = dmd.FrameLayer(
             opaque=False, frame=self.game.assets.dmd_shootAgain.frames[7])
         self.play_ordered_quote(self.game.assets.quote_shootAgain,
                                 'shoot_again')
         textLine1 = ep.EP_TextLayer(80,
                                     5,
                                     self.game.assets.font_9px_az,
                                     "center",
                                     opaque=False).set_text("SHOOT",
                                                            color=ep.GREEN)
         textLine2 = ep.EP_TextLayer(80,
                                     15,
                                     self.game.assets.font_9px_az,
                                     "center",
                                     opaque=False).set_text("AGAIN",
                                                            color=ep.GREEN)
         combined = dmd.GroupedLayer(128, 32,
                                     [imageLayer, textLine1, textLine2])
         self.layer = combined
         self.delay(delay=1.5, handler=self.clear_layer)