コード例 #1
0
def note(storage, obj, m):
    storage._go()
    if storage._playerInDistance(m.getPlayer().position, obj.rect):
        _lastitem[0] = "note"
        _lastitem[1] += 1
        storage._toggleCutscene(True)
        ad = GlobalServices.getAudioDevice()
        # Overlays
        note = OverlayFactory.create("note_big.png")
        text = OverlayFactory.create("lastnote.png")
        m.addOverlay(note)
        m.addOverlay(text)
        
        # Play sound
        ad.play(SOUND, 'journal_page', VOLUME_SOUND)
        
        # Wait for user input
        storage._pauseUntilClick()
        
        # Delete note overlay
        m.removeOverlay(note)
        m.removeOverlay(text)
        # Play sound
        ad.play(SOUND, 'journal_page', VOLUME_SOUND) 
        storage._toggleCutscene(False)
        set_property(SAVE_ENABLED, False)
        storage._setData('attic_noteseen', True)
    storage._halt()
    checkEnding(storage, m)
コード例 #2
0
def init(storage, m):
    storage._go()
    storage._toggleCutscene(True)
    ad = GlobalServices.getAudioDevice()
    tr = GlobalServices.getTextRenderer()
    ad.stop(MUSIC, 5000)
    ad.stop(SOUND, 5000, 'amb_guardian')
    # Make the overlay
    darktrans = OverlayFactory.create_animated_color((20,0,0),\
                5000, 0, True, 0, 220)
    dark = OverlayFactory.create_by_color((20,0,0), 0, 220)
    fog = OverlayFactory.create("fog.png", pygame.BLEND_MULT)
    white = OverlayFactory.create("noise.png", pygame.BLEND_MULT)
    m.clearOverlays()
    m.addOverlay(darktrans)
    m.addOverlay(fog)
    
    player = m.getPlayer()
    shadow = m.getShadow()
    shadow.setPosition(conv_tile_pixel((8,10),m))
    
    player.setDirection([0,-1])
    player.halfSpeed()
    
    
    # Here be dragons
    storage._wait(5000)
    m.rendering_enabled = True
    m.addOverlay(dark)
    m.removeOverlay(darktrans)
    ad.play(MUSIC, 'bgm_4', VOLUME_MUSIC, -1)
    ad.play(SOUND, 'flashlight_toggle', VOLUME_SOUND)
    
    storage._wait(2000)
    tr.write("What is this place?", 3)
    storage._wait(3000)
    tr.write("It feels... strangely familiar.", 3)
    storage._wait(2000)
    ad.play(SOUND, 'noise', VOLUME_SOUND_AMBIENT + 0.3, -1)
    m.addOverlay(white)
    shadow.setVisible(True)
    storage._wait(300)
    m.removeOverlay(white)
    ad.stop(SOUND, 0, 'noise')
    shadow.setVisible(False)
    shadow.setPosition(conv_tile_pixel((8,12),m))
    storage._wait(1500)
    m.addOverlay(white)
    ad.play(SOUND, 'noise', VOLUME_SOUND_AMBIENT + 0.3, -1)
    shadow.setVisible(True)
    shadow.moveBy((0, 15), 500)
    storage._wait(450)
    m.removeOverlay(white)
    ad.stop(SOUND, 0, 'noise')
    shadow.setVisible(False)
    
    storage._toggleCutscene(False)
    set_property(SAVE_ENABLED, False)
    storage._halt()
コード例 #3
0
def note(storage, obj, m):
    storage._go()
    if storage._playerInDistance(m.getPlayer().position, obj.rect):
        # Cutscene toggle: Disable user input
        storage._toggleCutscene(True)
        tr = GlobalServices.getTextRenderer()
        ad = GlobalServices.getAudioDevice()
        
        tr.deleteAll()
        
        # Overlays
        note = OverlayFactory.create("note_big.png")
        togray = OverlayFactory.create_animated_color((0,0,0), 1000, 0, True, 0, 200)
        m.addOverlay(note)
        m.addOverlay(togray)
        
        # Play sound
        ad.play(SOUND, 'journal_page', VOLUME_SOUND)
        
        # Text of the note
        y = 140
        ofs = 18
        tr.write("Who would have done something like this?!",\
                 0, COLOR_TEXT, (100, y + (ofs*0)))
        tr.write("My little girl... you shouldn't have had to suffer through this.",\
                 0, COLOR_TEXT, (100, y + (ofs*1)))
        tr.write("After I found your lifeless body, I took it to your most favourite place.",\
                 0, COLOR_TEXT, (100, y + (ofs*2)))
        tr.write("Surely you will find peace among there.",\
                 0, COLOR_TEXT, (100, y + (ofs*3)))
        tr.write("I looked at your picture today.",\
                 0, COLOR_TEXT, (100, y + (ofs*5)))
        tr.write("I do not know if it is just me, but your mother's expression changed.",\
                 0, COLOR_TEXT, (100, y + (ofs*6)))
        tr.write("There she sits, to your right, and what appears to be a sole tear runs down her cheek.",\
                 0, COLOR_TEXT, (100, y + (ofs*7)))
        tr.write("Can a painting feel emotions?",\
                 0, COLOR_TEXT, (100, y + (ofs*9)))
        tr.write("Now I am surely being silly.",\
                 0, COLOR_TEXT, (100, y + (ofs*10)))
        tr.write("I will miss you, big sister.",\
                 0, COLOR_TEXT, (100, y + (ofs*11)))
        tr.write("- J",\
                 0, COLOR_TEXT, (100, y + (ofs*13)))
        
        # Wait for user input
        storage._pauseUntilClick()
        
        GlobalServices.getEventManager().post(ObjectHighlightedEvent(None))
        
        # Delete note overlay
        m.removeOverlay(note)
        m.removeOverlay(togray)
        # Play sound
        ad.play(SOUND, 'journal_page', VOLUME_SOUND)        
        # Delete texts
        tr.deleteAll()
        
        storage._toggleCutscene(False)
    storage._halt()
コード例 #4
0
def checkEnding(storage, m):
    storage._go()
    ad = GlobalServices.getAudioDevice()
    ad.stop(SOUND, 0, 'insanity_ear_ring')
    ad.play(SOUND, 'insanity_ear_ring', (0.02*_lastitem[1]), -1, 0)
    # Check if the ending has been reached
    if  storage._getData('attic_photoseen')\
    and storage._getData('attic_handseen')\
    and storage._getData('attic_noteseen')\
    and storage._getData('attic_gunseen')\
    and storage._getData('attic_pencilseen'):
        storage._halt()
        ending(storage, m)
    else:
        # Add a random scare if necessary
        if _lastitem[1] % 2 == 0:
            white = OverlayFactory.create("noise.png", pygame.BLEND_MULT)
            storage._wait(1000)
            shadow = m.getShadow()
            shadow.setPosition(conv_tile_pixel((random.randrange(3,12),\
                                                random.randrange(7,11)),m))
            m.addOverlay(white)
            shadow.setVisible(True)
            ad.play(SOUND, 'noise', VOLUME_SOUND + 0.1, -1)
            storage._wait(300)
            m.removeOverlay(white)
            ad.stop(SOUND, 0, 'noise')
            shadow.setVisible(False)
        storage._halt()
コード例 #5
0
def officenote(storage, obj, m):
    storage._go()
    if storage._playerInDistance(m.getPlayer().position, obj.rect):
        # Cutscene toggle: Disable user input
        storage._toggleCutscene(True)
        tr = GlobalServices.getTextRenderer()
        ad = GlobalServices.getAudioDevice()
        
        tr.deleteAll()
        
        # Overlays
        note = OverlayFactory.create("note_big.png")
        togray = OverlayFactory.create_animated_color((0,0,0), 1000, 0, True, 0, 200)
        m.addOverlay(note)
        m.addOverlay(togray)
        
        # Play sound
        ad.play(SOUND, 'journal_page', VOLUME_SOUND)
        
        # Text of the note
        y = 150
        ofs = 18
        tr.write("The doctor's said that everything is going to be fine.",\
                 0, COLOR_TEXT, (100, y + (ofs*0)))
        tr.write("I won't give my offspring away only because your senile self",\
                 0, COLOR_TEXT, (100, y + (ofs*1)))
        tr.write("blames everything on him! How dare you speak those insults!",\
                 0, COLOR_TEXT, (100, y + (ofs*2)))
        tr.write("Cly has NOTHING to do with any of the disappearances of our family.",\
                 0, COLOR_TEXT, (100, y + (ofs*3)))
        tr.write("I mean, God, why do you keep saying that?! Haven't you heard",\
                 0, COLOR_TEXT, (100, y + (ofs*4)))
        tr.write("the inspector's words? He's innocent!",\
                 0, COLOR_TEXT, (100, y + (ofs*5)))
        tr.write("I took your key to where you wrongfully locked my son, you monster.",\
                 0, COLOR_TEXT, (100, y + (ofs*7)))
        tr.write("This will be hard to forgive, father.",\
                 0, COLOR_TEXT, (100, y + (ofs*8)))
        tr.write("- M",\
                 0, COLOR_TEXT, (100, y + (ofs*10)))
        
        # Wait for user input
        storage._pauseUntilClick()
        
        GlobalServices.getEventManager().post(ObjectHighlightedEvent(None))
        
        # Delete note overlay
        m.removeOverlay(note)
        m.removeOverlay(togray)
        # Play sound
        ad.play(SOUND, 'journal_page', VOLUME_SOUND)        
        # Delete texts
        tr.deleteAll()
        storage._toggleCutscene(False)
    storage._halt()
コード例 #6
0
def rollCredits(storage, m):
    storage._go()
    m.rendering_enabled = False
    m.clearOverlays()
    ad = GlobalServices.getAudioDevice()
    tr = GlobalServices.getTextRenderer()
    x = 125
    pos = SCREEN_HEIGHT/2
    ofs = 28
    ad.play(MUSIC, 'credits', VOLUME_MUSIC + 0.1)
    tl = OverlayFactory.create("title.png", 0)
    m.addOverlay(tl)
    storage._wait(5000)
    m.removeOverlay(tl)
    storage._wait(1000)
    tr.write("Created by Marcel Schnelle", 0, COLOR_TEXT, (x, pos + ofs*0), FONTSTYLE_CAPTION, False)
    tr.write("at California State University, Fullerton", 0, COLOR_TEXT, (x, pos + ofs*1), FONTSTYLE_CAPTION, False)
    tr.write("for 'Introduction to Game Design & Production'", 0, COLOR_TEXT, (x, pos + ofs*2), FONTSTYLE_CAPTION, False)
    tr.write("(Fall 2012)", 0, COLOR_TEXT, (x, pos + ofs*3), FONTSTYLE_CAPTION, False)
    storage._wait(10000)
    tr.deleteAll()
    storage._wait(1000)
    tr.write("Story by Anna Martje Geudert", 0, COLOR_TEXT, (x, pos + ofs*0), FONTSTYLE_CAPTION, False)
    storage._wait(5000)
    tr.deleteAll()
    storage._wait(1000)
    tr.write("Resources gathered from", 0, COLOR_TEXT, (x, pos + ofs*0), FONTSTYLE_CAPTION, False)
    tr.write("Celianna", 0, COLOR_TEXT, (x, pos + ofs*1), FONTSTYLE_CAPTION, False)
    tr.write("Enterbrain", 0, COLOR_TEXT, (x, pos + ofs*2), FONTSTYLE_CAPTION, False)
    tr.write("Kaz", 0, COLOR_TEXT, (x, pos + ofs*3), FONTSTYLE_CAPTION, False)
    tr.write("Lunarea", 0, COLOR_TEXT, (x, pos + ofs*4), FONTSTYLE_CAPTION, False)
    tr.write("Mack", 0, COLOR_TEXT, (x, pos + ofs*5), FONTSTYLE_CAPTION, False)
    storage._wait(10000)
    tr.deleteAll()
    storage._wait(1000)
    tr.write("And the games", 0, COLOR_TEXT, (x, pos + ofs*0), FONTSTYLE_CAPTION, False)
    tr.write("'Cry of Fear'", 0, COLOR_TEXT, (x, pos + ofs*1), FONTSTYLE_CAPTION, False)
    tr.write("'Amnesia: The Dark Descent'", 0, COLOR_TEXT, (x, pos + ofs*2), FONTSTYLE_CAPTION, False)
    storage._wait(7500)
    tr.deleteAll()
    storage._wait(1000)
    tr.write("Inspired by", 0, COLOR_TEXT, (x, pos + ofs*0), FONTSTYLE_CAPTION, False)
    tr.write("Mark Fischbach", 0, COLOR_TEXT, (x, pos + ofs*1), FONTSTYLE_CAPTION, False)
    storage._wait(7500)
    tr.deleteAll()
    storage._wait(1000)
    tr.write("Thanks for playing!", 0, COLOR_TEXT, (x, pos + ofs*0), FONTSTYLE_CAPTION, False)
    ad.stop(MUSIC, 7500)
    storage._wait(7500)
    tr.deleteAll()
    storage._wait(2000)
    storage._halt()
    GlobalServices.getEventManager().post(MainMenuSwitchRequestEvent())
コード例 #7
0
def hintnote(storage, obj, m):
    storage._go()
    
    if storage._playerInDistance(m.getPlayer().position, obj.rect):
        # Cutscene toggle: Disable user input
        storage._toggleCutscene(True)
        tr = GlobalServices.getTextRenderer()
        ad = GlobalServices.getAudioDevice()
        
        tr.deleteAll()
        
        # Overlays
        note = OverlayFactory.create("note_big.png")
        togray = OverlayFactory.create_animated_color((0,0,0), 1000, 0, True, 0, 200)
        m.addOverlay(note)
        m.addOverlay(togray)
        
        # Play sound
        ad.play(SOUND, 'journal_page', VOLUME_SOUND)
        
        # Text of the note
        y = 200
        ofs = 18
        tr.write("Claire:",\
                 0, COLOR_TEXT, (100, y + (ofs*0)))
        tr.write("You know that I had to seal the master's bedroom for a reason, right?",\
                 0, COLOR_TEXT, (100, y + (ofs*2)))
        tr.write("It is not at all because of personal disapproval or anything like that.",\
                 0, COLOR_TEXT, (100, y + (ofs*3)))
        tr.write("Please understand that it is for our own good, and safety.",\
                 0, COLOR_TEXT, (100, y + (ofs*4)))
        tr.write("Please do not try to unlock it. Trust me on this one.",\
                 0, COLOR_TEXT, (100, y + (ofs*5)))
        tr.write("- J",\
                 0, COLOR_TEXT, (100, y + (ofs*7)))
        
        # Wait for user input
        storage._pauseUntilClick()
        
        GlobalServices.getEventManager().post(ObjectHighlightedEvent(None))
        
        # Delete note overlay
        m.removeOverlay(note)
        m.removeOverlay(togray)
        # Play sound
        ad.play(SOUND, 'journal_page', VOLUME_SOUND)        
        # Delete texts
        tr.deleteAll()
        
        storage._toggleCutscene(False)
        
    storage._halt()
コード例 #8
0
def relaxnote(storage, obj, m):
    storage._go()
    if storage._playerInDistance(m.getPlayer().position, obj.rect):
        # Cutscene toggle: Disable user input
        storage._toggleCutscene(True)
        tr = GlobalServices.getTextRenderer()
        ad = GlobalServices.getAudioDevice()
        
        tr.deleteAll()
        
        # Overlays
        note = OverlayFactory.create("note_big.png")
        togray = OverlayFactory.create_animated_color((0,0,0), 1000, 0, True, 0, 200)
        m.addOverlay(note)
        m.addOverlay(togray)
        
        # Play sound
        ad.play(SOUND, 'journal_page', VOLUME_SOUND)
        
        # Text of the note
        y = 150
        ofs = 18
        tr.write("This boy is getting out of hand!",\
                 0, COLOR_TEXT, (100, y + (ofs*0)))
        tr.write("He seems to be less and less certifiably sane, to put it in fancy terms.",\
                 0, COLOR_TEXT, (100, y + (ofs*2)))
        tr.write("I have locked him in his room after what he did to aunt Sophie.",\
                 0, COLOR_TEXT, (100, y + (ofs*3)))
        tr.write("This has nothing to do with bad manners anymore, Marnie!",\
                 0, COLOR_TEXT, (100, y + (ofs*4)))
        tr.write("The child is vile and struck by evil, I tell you. Why won't you listen to me, Marnie?",\
                 0, COLOR_TEXT, (100, y + (ofs*5)))
        tr.write("This, this is not your child anymore. Please be reasonable and get help.",\
                 0, COLOR_TEXT, (100, y + (ofs*6)))
        tr.write("- Harold",\
                 0, COLOR_TEXT, (100, y + (ofs*8)))
        
        # Wait for user input
        storage._pauseUntilClick()
        
        GlobalServices.getEventManager().post(ObjectHighlightedEvent(None))
        
        # Delete note overlay
        m.removeOverlay(note)
        m.removeOverlay(togray)
        # Play sound
        ad.play(SOUND, 'journal_page', VOLUME_SOUND)        
        # Delete texts
        tr.deleteAll()
        storage._toggleCutscene(False)
    storage._halt()
コード例 #9
0
def scare(storage, obj, m):
    storage._go()
    player = m.getPlayer()
    shadow = m.getShadow()
    ad = GlobalServices.getAudioDevice()
    fl = m.getOverlay("_flashlight")
    player.stopMoving()
    storage._toggleCutscene(True)
    # Helper function for looking in a direction
    def face(direction):
        fl.point(direction)
        player.setDirection(string_to_direction(direction))
        
    face("left")
    
    fog = OverlayFactory.create("fog.png", pygame.BLEND_MULT)
    black = OverlayFactory.create_by_color((0,0,0), 0, 255)
    red = OverlayFactory.create_by_color((200,0,0), 0, 40)
    m.addOverlay(fog)
    m.addOverlay(red)
    # Show shadow
    shadow.setPosition(conv_tile_pixel((31,17), m))
    ad.play(SOUND, '27_orb_implode', VOLUME_SOUND + 0.1)
    ad.play(SOUND, 'scare_male_terrified5', VOLUME_SOUND)
    shadow.setVisible(True)
    storage._wait(1100)
    shadow.moveBy((-70,0), 3000)
    storage._wait(1900)
    ad.play(SOUND, 'insanity_whisper03', VOLUME_SOUND)
    m.addOverlay(black)
    ad.play(SOUND, '27_spark2', VOLUME_SOUND)
    storage._wait(300)
    m.removeOverlay(fog)
    m.removeOverlay(red)
    shadow.setVisible(False)
    m.removeOverlay(black)
    ad.play(SOUND, '27_spark4', VOLUME_SOUND)
    storage._wait(2000)
    
    # Delete script
    m.removeObject(obj)
    
    storage._toggleCutscene(False)
    storage._halt()
コード例 #10
0
def photo(storage, obj, m):
    storage._go()
    tr = GlobalServices.getTextRenderer()
    if storage._playerInDistance(m.getPlayer().position, obj.rect, 100):
        _lastitem[0] = "photo"
        _lastitem[1] += 1
        storage._toggleCutscene(True)
        if not storage._getData('attic_photoseen'):
            tr.write("I know this photo. It was taken two years ago.", 3)
            storage._wait(3000)
            
        photo = OverlayFactory.create("photo.png", 0)
        m.addOverlay(photo, 0)
        
        tr.write("My family... everyone has been crossed out with the same red paint I've seen everywhere.", 4)
        
        storage._pauseUntilClick()
        
        m.removeOverlay(photo)
        storage._toggleCutscene(False)
        set_property(SAVE_ENABLED, False)
        storage._setData('attic_photoseen', True)
    storage._halt()
    checkEnding(storage, m)
コード例 #11
0
def murderscene(storage, obj, m):
    storage._go()
    
    if not storage._getData('mirrorhall_murder_done'):
        GlobalServices.getEventManager().post(ObjectHighlightedEvent(None))
        player = m.getPlayer()
        player.stopMoving()
        storage._toggleCutscene(True)
        shadow = m.getShadow()
        shadow.setPosition(conv_tile_pixel((24, 17), m))
        tr = GlobalServices.getTextRenderer()
        ad = GlobalServices.getAudioDevice()
        
        fog = OverlayFactory.create("fog.png", pygame.BLEND_MULT)
        nolight = OverlayFactory.create("nolighting.png", 0)
        
        fl = m.getOverlay("_flashlight")
        # Helper function for looking in a direction
        def face(direction):
            fl.point(direction)
            player.setDirection(string_to_direction(direction))
            
        face("up")
        ad.play(MUSIC, 'event2', VOLUME_MUSIC)
        tr.write("Huh?", 0.5)
        storage._wait(500)
        ad.play(SOUND, 'insanity_whisper03', VOLUME_SOUND)
        storage._wait(250)
        m.addOverlay(fog)
        shadow.setVisible(True)
        shadow.moveBy((-60,0), 3750)
        ad.play(SOUND, 'scare_wood_creak_walk2', VOLUME_SOUND)
        storage._wait(750)
        tr.write("What the hell are you!?", 2)
        storage._wait(1500)
        tr.write("ANSWER ME!! Why did you kill this girl?!", 3)
        storage._wait(1500)
        ad.stop(MUSIC, 10)
        shadow.moveBy((0,70), 1000)
        ad.play(SOUND, 'scare_wood_creak_scuf3', VOLUME_SOUND)
        ad.play(SOUND, 'fb_sfx_19_false_dead01', VOLUME_SOUND - 0.1)
        towhite = OverlayFactory.create_animated_color((255,255,255), 1000, 0, True, 0, 255)
        m.addOverlay(towhite)
        ad.play(SOUND, 'insanity_ear_ring', VOLUME_SOUND_AMBIENT - 0.2, -1, 1000)
        storage._wait(1000)
        ad.play(SOUND, '21_scream10', VOLUME_SOUND - 0.4)
        m.removeOverlay(fog)
        shadow.setVisible(False)
        
        add_to_map(storage.s, OBJECT, 'mirrorhall', 'message',\
                   pygame.Rect(conv_tile_pixel((11,22), m), conv_tile_pixel((4,4), m)),\
                   'mirrorhall_message', 'message_2.png', True)
        
        player.setAnimation("lie_eyesclosed")
        
        storage._wait(5500)
        ad.stop(SOUND, 5000, 'insanity_ear_ring')
        m.removeOverlay(fl)
        totrans = OverlayFactory.create_animated_color((255,255,255), 5500, 0, True, 255, 0)
        m.addOverlay(totrans)
        m.addOverlay(nolight, 0)
        m.removeOverlay(towhite)
        ad.stop(SOUND, 5000, 'fb_sfx_19_false_dead01')
        ad.play(SOUND, '24_amb_noise', VOLUME_SOUND_AMBIENT, -1, 1000)
        storage._wait(6500)
        
        player.setAnimation("lie_eyesopen")
        storage._wait(1000)
        player.setAnimation("lie_eyesclosed")
        storage._wait(400)
        player.setAnimation("lie_eyesopen")
        storage._wait(500)
        player.setAnimation("lie_eyesclosed")
        storage._wait(100)
        player.setAnimation("lie_eyesopen")
        storage._wait(2000)
        player.setAnimation("kneel")
        tr.write("Did I... did I pass out?", 3)
        storage._wait(1500)
        
        player.setAnimation("walk")
        face("down")
        
        storage._wait(4000)
        
        ad.play(SOUND, 'flashlight_toggle', VOLUME_SOUND)
        m.addOverlay(fl)
        m.removeOverlay(nolight)
        m.removeOverlay(totrans)
        face("left-up")
        storage._wait(1000)
        face("up-right")
        storage._wait(500)
        face("down")
        storage._wait(250)
        face("down-left")
        storage._wait(300)
        face("left")
        storage._wait(750)
        face("left-up")
        storage._wait(300)
        face("up")
        storage._wait(400)
        tr.write("My head hurts so badly. Everything's a blur...", 3)
        storage._wait(3000)
        ad.stop(SOUND, 3000, '24_amb_noise')
        storage._wait(3000)
        ad.play(MUSIC, 'bgm_2', VOLUME_MUSIC, -1, 2000)
        storage._setData('mirrorhall_murder_done', True)
        storage._toggleCutscene(False)
    
    storage._halt()
コード例 #12
0
def init(storage, m):
    # If the scare hasn't been done yet and the player triggered
    # the abandoned room's canvas, this goes here
    storage._go()
    m.rendering_enabled = True
    if not storage._getData('lefthallway_scare_done') and\
       storage._getData('lefthallway_scare_enabled') and\
       not storage._getData('mirrorhall_murder_done'):
        
        # Scare
        storage._toggleCutscene(True)
        player = m.getPlayer()
        player.stopMoving()
        
        # Helper function for looking in a direction
        def face(direction):
            fl = m.getOverlay("_flashlight")
            fl.point(direction)
            player.setDirection(string_to_direction(direction))
            
        face("up")
        
        # Overlay creation
        ad = GlobalServices.getAudioDevice()
        fog = OverlayFactory.create("fog.png", pygame.BLEND_MULT)
        black = OverlayFactory.create_by_color((0, 0, 0), 0, 200)
        grad = OverlayFactory.create_animated_color((0,0,0),\
               3000, 0, True, 200, 0)
        
        ad.play(SOUND, '21_hole_loop', VOLUME_SOUND)
        ad.stop(MUSIC, 2000)
        ad.stop(SOUND, 2000, 'ambient_spooky')
        storage._wait(2000)
        
        # Show the figure
        ad.play(MUSIC, 'event1', VOLUME_MUSIC + 0.4)
        m.addOverlay(fog)
        shadow = m.getShadow()
        shadow.setPosition(conv_tile_pixel((41, 10), m))
        m.addOverlay(black)
        ad.play(SOUND, '27_spark1', VOLUME_SOUND)
        storage._wait(100)
        shadow.setVisible(True)
        m.removeOverlay(black)
        ad.play(SOUND, '27_spark2', VOLUME_SOUND)
        ad.play(SOUND, 'scare_wood_creak_scuf3', VOLUME_SOUND)
        shadow.moveBy((-30, 0), 2000)
        storage._wait(2000)
        shadow.moveBy((0, 1), 10)
        face("up-right")
        shadow.setVisible(False)
        storage._wait(250)
        face("up")
        storage._wait(100)
        shadow.setVisible(True)
        face("left-up")
        storage._wait(250)
        face("up")
        storage._wait(400)
        ad.play(SOUND, 'scare_wood_creak_walk2', VOLUME_SOUND)
        shadow.moveBy((0, -50), 4500)
        m.addOverlay(black)
        ad.play(SOUND, '27_spark4', VOLUME_SOUND)
        storage._wait(300)
        shadow.setVisible(False)
        m.removeOverlay(black)
        ad.play(SOUND, '27_spark3', VOLUME_SOUND)
        storage._wait(200)
        m.addOverlay(black)
        ad.play(SOUND, '27_spark4', VOLUME_SOUND)
        storage._wait(50)
        shadow.setVisible(True)
        m.removeOverlay(black)
        storage._wait(1450)
        ad.play(SOUND, 'general_chain_rattle2', VOLUME_SOUND)
        m.addOverlay(black)
        ad.play(SOUND, '27_spark1', VOLUME_SOUND)
        storage._wait(100)
        m.removeOverlay(black)
        ad.play(SOUND, '27_spark2', VOLUME_SOUND)
        storage._wait(200)
        m.addOverlay(black)
        ad.play(SOUND, '27_spark4', VOLUME_SOUND)
        storage._wait(50)
        shadow.setVisible(False)
        m.removeOverlay(black)
        ad.play(SOUND, '27_spark3', VOLUME_SOUND)
        storage._wait(390)
        m.addOverlay(black)
        ad.play(SOUND, '27_spark1', VOLUME_SOUND)
        storage._wait(200)
        shadow.setVisible(True)
        m.removeOverlay(black)
        ad.play(SOUND, '27_spark2', VOLUME_SOUND)
        storage._wait(777)
        m.removeOverlay(fog)
        m.addOverlay(black)
        ad.play(SOUND, '27_spark4', VOLUME_SOUND)
        storage._wait(500)
        shadow.setVisible(False)
        m.addOverlay(grad)
        m.removeOverlay(black)
        m.removeOverlay(fog)
        ad.play(SOUND, '27_spark3', VOLUME_SOUND)
        storage._wait(3000)
        m.removeOverlay(grad)
        ad.play(MUSIC, 'bgm_1', VOLUME_MUSIC, -1)
        ad.play(SOUND, 'ambient_spooky', VOLUME_SOUND_AMBIENT, -1, 2000)
        storage._setData('lefthallway_scare_done', True)
        storage._toggleCutscene(False)
    storage._halt()
コード例 #13
0
def ending(storage, m):
    storage._go()
    GlobalServices.getEventManager().post(ObjectHighlightedEvent(None))
    storage._toggleCutscene(True)
    storage._wait(3000)
    white = OverlayFactory.create("noise.png", pygame.BLEND_MULT)
    def static(ms):
        m.addOverlay(white)
        ad.play(SOUND, 'noise', VOLUME_SOUND + 0.1, -1)
        storage._wait(ms)
        m.removeOverlay(white)
        ad.stop(SOUND, 0, 'noise')
    tr = GlobalServices.getTextRenderer()
    ad = GlobalServices.getAudioDevice()
    tr.write("W-w-what am I supposed to do now?", 3)
    storage._wait(1400)
    static(340)
    storage._wait(1600)
    tr.write("I lose track of the sharp edges around me...", 3)
    storage._wait(2000)
    towhite = OverlayFactory.create_animated_color((255,255,255),\
              1000, 0, True, 0, 255)
    m.addOverlay(towhite)
    storage._wait(1500)
    player = m.getPlayer()
    player.setPosition(conv_tile_pixel((8,9), m))
    player.setAnimation("kneel")
    storage._wait(400)
    fadeout = OverlayFactory.create_animated_color((255,255,255),\
              1000, 0, True, 255, 0)
    m.addOverlay(fadeout)
    m.removeOverlay(towhite)
    storage._wait(3000)
    tr.write("Did I...", 3)
    player.setAnimation("walk")
    storage._wait(800)
    static(200)
    storage._wait(600)
    static(40)
    storage._wait(600)
    static(1000)
    storage._wait(2500)
    player.setDirection([0,-1])
    storage._wait(500)
    tr.write("It was... me..?", 3)
    storage._wait(1000)
    static(500)
    storage._wait(3000)
    static(100)
    storage._wait(1000)
    ad.play(SOUND, 'pick_item', VOLUME_SOUND)
    remove_from_map(get_savegame(), OBJECT, 'attic', 'gun')
    tr.write("I should...", 3)
    storage._wait(3000)
    toblack = OverlayFactory.create_animated_color((0,0,0), 2500, 0, True, 0, 255)
    m.addOverlay(toblack)
    ad.stop(SOUND, 2750, 'insanity_ear_ring')
    ad.stop(MUSIC, 2750)
    storage._wait(3500)
    ad.play(SOUND, 'gun_cock', VOLUME_SOUND)
    storage._wait(3500)
    storage._halt()
    rollCredits(storage, m)
コード例 #14
0
def entrancenote(storage, obj, m):
    storage._go()

    storage._faceObject(m.getPlayer(), obj)
    tr = GlobalServices.getTextRenderer()

    if storage._playerInDistance(m.getPlayer().position, obj.rect):
        # Cutscene toggle: Disable user input
        storage._toggleCutscene(True)
        ad = GlobalServices.getAudioDevice()

        tr.write("There is a note on the ground.", 3)
        storage._wait(3000)
        tr.write("Did someone slide this under the entrance door?", 3)
        storage._wait(4000)
        tr.deleteAll()

        # Overlays
        note = OverlayFactory.create("note_big.png")
        togray = OverlayFactory.create_animated_color((0, 0, 0), 1000, 0, True, 0, 200)
        m.addOverlay(note)
        m.addOverlay(togray)

        # Play sound
        ad.play(SOUND, "journal_page", VOLUME_SOUND)

        # Text of the note
        y = 120
        ofs = 18
        tr.write("Clyde,", 0, COLOR_TEXT, (100, y))
        tr.write("you know we like you. However, you kinda freak us out, dude.", 0, COLOR_TEXT, (100, y + (ofs * 2)))
        tr.write(
            "We have grown sick of your accusations and want to give you some time", 0, COLOR_TEXT, (100, y + (ofs * 3))
        )
        tr.write("for yourself to sort things out and get your mind straight.", 0, COLOR_TEXT, (100, y + (ofs * 4)))
        tr.write(
            "Why would you keep blaming us for shit that's obviously not real?", 0, COLOR_TEXT, (100, y + (ofs * 6))
        )
        tr.write(
            "What good would it do us if we, like you said we do, 'keep changing things in the house'?",
            0,
            COLOR_TEXT,
            (100, y + (ofs * 7)),
        )
        tr.write(
            "Never ever has any of us witnessed anything suspicious when we gave in",
            0,
            COLOR_TEXT,
            (100, y + (ofs * 8)),
        )
        tr.write(
            "to your begging us to stay overnight. What, are you frightened of your",
            0,
            COLOR_TEXT,
            (100, y + (ofs * 9)),
        )
        tr.write("grandpa's house and see spooky things that aren't even there?", 0, COLOR_TEXT, (100, y + (ofs * 10)))
        tr.write(
            "We don't want to say this, but we ain't gonna stay for tonight.", 0, COLOR_TEXT, (100, y + (ofs * 11))
        )
        tr.write("Get it together, man.", 0, COLOR_TEXT, (100, y + (ofs * 13)))

        # Wait for user input
        storage._pauseUntilClick()

        GlobalServices.getEventManager().post(ObjectHighlightedEvent(None))

        # Delete note overlay
        m.removeOverlay(note)
        m.removeOverlay(togray)
        # Play sound
        ad.play(SOUND, "journal_page", VOLUME_SOUND)
        # Delete texts
        tr.deleteAll()
        # Fadeout music
        ad.stop(MUSIC, 12000)
        ad.stop(SOUND, 12000, "vind2")
        # More text
        tr.write("Did they...?", 3)
        storage._wait(4000)
        tr.write("They have forsaken me.", 3)
        storage._wait(4000)
        tr.write("I didn't want to upset them... it's just...", 3)
        storage._wait(4000)
        tr.write("I am NOT making this up. Something is wrong here.", 3)
        storage._wait(4000)
        tr.deleteAll()
        storage._wait(1000)
        m.getPlayer().setDirection([0, -1])
        tr.write("I feel dizzy. I should get back to bed.", 3)
        storage._wait(4000)
        storage._faceObject(m.getPlayer(), obj)
        # Delete texts
        tr.deleteAll()
        # Add the note to the inventory
        m.getPlayer().inventory.add(ItemFactory.create(INVENTORY_ITEM_ENTRANCE_NOTE, 1))
        ad.play(SOUND, "pick_paper", VOLUME_SOUND)
        tr.write("Got 'Note (Forsaken Friends)'", 3, COLOR_GOT_ITEM)
        tr.write("[Press TAB to access your possessions.]", 3, COLOR_OBJECTIVE, (0, POSITION_BOTTOM_SCREEN[1] + 20))

        # Delete the note from the map
        m.removeObject(obj)
        # Set a flag that this script was executed
        storage._setData("entrancenote_obtained", True)
        # End cutscene
        storage._toggleCutscene(False)
        # Play a new BGM
        ad.play(MUSIC, "ambienceloop", VOLUME_MUSIC, -1)
    else:
        tr.write("Is that a note on the ground?", 3)
    storage._halt()
コード例 #15
0
def bed(storage, obj, m):
    storage._go()
        
    tr = GlobalServices.getTextRenderer()
    ad = GlobalServices.getAudioDevice()
    player = m.getPlayer()
    storage._faceObject(player, obj)
    
    if storage._playerInDistance(player.position, obj.rect):
        if storage._getData('bedroom_bedscare_done'):
            tr.write("There is no way I'll be able to sleep with this going on.", 3)
            
        elif storage._getData('entrancenote_obtained'):
            storage._toggleCutscene(True)
            GlobalServices.getEventManager().post(ObjectHighlightedEvent(None))
            tr.write("I am not imagining these things.", 3)
            storage._wait(3000)
            tr.write("...am I?", 3)
            storage._wait(3000)
            if storage._getData('leftwing_debrisfound'):
                tr.write("The blocked path in the Left Wing...", 3)
                storage._wait(3000)
                tr.write("I didn't put that stuff there.", 3)
                storage._wait(3000)
            storage._wait(1000)
            player.setDirection([1,0])
            tr.write("I need some sleep.", 3)
            storage._wait(3000)
            togray = OverlayFactory.create_animated_color((0,0,0), 4500, 0, True, 0, 255)
            m.addOverlay(togray)
            ad.stop(MUSIC, 4500)
            ad.stop(SOUND, 4500, 'vind2')
            ad.play(SOUND, 'ambient_spooky', VOLUME_SOUND_AMBIENT, -1, 4500)
            storage._wait(6000)
            
            starty = 200
            ofs = 18
            tr.write("When I think about it, I guess it's no wonder my friends turned on me.",\
                     0, COLOR_TEXT, (200, starty))
            storage._wait(4000)
            tr.write("After all, whenever one of them stayed overnight,",\
                     0, COLOR_TEXT, (200, starty + ofs))
            storage._wait(2000)
            tr.write("nothing weird ever happened the next morning.",\
                     0, COLOR_TEXT, (200, starty + (ofs * 2)))
            storage._wait(3000)
            tr.deleteAll()
            storage._wait(1000)
            starty = 214
            tr.write("I'm afraid.",\
                     0, COLOR_TEXT, (200, starty))
            storage._wait(4000)
            tr.write("Let's hope that I can settle this tomorrow.",\
                     0, COLOR_TEXT, (200, starty + ofs))
            storage._wait(1500)
            
            bed1 = os.path.join(PATH_GRAPHICS_TILES,'bed_clyde_eyesclosed.png')
            obj.changeImage(bed1)
            player.setVisible(False)
                        
            ad.play(SOUND, 'drone', VOLUME_SOUND)
            ad.play(SOUND, 'elec', VOLUME_SOUND)
            red = OverlayFactory.create_by_color((178, 10, 5), 0, 60)
            black = OverlayFactory.create_by_color((0, 0, 0), 0, 255)
            fog = OverlayFactory.create('fog.png', pygame.BLEND_MULT)
            add_global_overlay(fog)
            m.addOverlay(fog)
            tr.deleteAll()
            storage._wait(1500)
            ad.play(SOUND, 'insanity_bug3', VOLUME_SOUND_AMBIENT - 0.1, -1, 1500)
            m.removeOverlay(togray)
            storage._wait(400)
            ad.play(SOUND, 'general_thunder2', VOLUME_SOUND)
            ad.play(SOUND, 'insanity_monster_roar02', VOLUME_SOUND)
            storage._wait(400)
            ad.play(SOUND, '27_spark2', VOLUME_SOUND)
            m.addOverlay(red)
            m.addOverlay(black)
            storage._wait(300)
            
            
            ad.play(SOUND, '27_spark4', VOLUME_SOUND)
            m.removeOverlay(black)
            storage._wait(1000)
            m.removeOverlay(red)
            
            ad.play(SOUND, '27_spark2', VOLUME_SOUND)
            m.addOverlay(black)
            storage._wait(500)
            
            # Anderes Ich hier einfügen
            shadow = m.getShadow()
            shadow.setPosition(conv_tile_pixel((13, 15), m))
            shadow.setVisible(True)
            
            ad.play(SOUND, '27_spark4', VOLUME_SOUND)
            m.removeOverlay(black)
            storage._wait(300)
            
            bed2 = os.path.join(PATH_GRAPHICS_TILES,'bed_clyde_eyesopen.png')
            obj.changeImage(bed2)
            
            m.addOverlay(red)
            shadow.setVisible(False)
            for _ in range(3):
                ad.play(SOUND, '27_spark1', VOLUME_SOUND)
                m.addOverlay(black)
                storage._wait(750)
                m.removeOverlay(black)
                ad.play(SOUND, '27_spark3', VOLUME_SOUND)
                storage._wait(100)
            ad.play(MUSIC, 'bgm_1', VOLUME_MUSIC, -1)
            m.removeOverlay(red)
            grey = OverlayFactory.create_by_color((0, 0, 0), 0, 180)
            m.addOverlay(grey)
            ad.play(SOUND, '27_spark2', VOLUME_SOUND)
            storage._wait(100)
            ad.play(SOUND, '27_spark3', VOLUME_SOUND)
            ad.play(SOUND, 'insanity_monster_roar01', VOLUME_SOUND)
            
            obj.changeImage(None, True)
            
            player.setDirection([-1,1])
            player.setVisible(True)
            
            m.removeOverlay(black)
            storage._wait(2000)
            tr.write("What was that?!", 3)
            storage._wait(3000)
            ad.play(SOUND, 'scare_breath', VOLUME_SOUND)
            tr.write("Did it... happen again?", 3)
            storage._wait(3000)
            tr.write("The power's out completely now.", 3)
            storage._wait(4500)
            player.setDirection([-1,-1])
            tr.write("I better grab my flashlight from the table if I decide to go out.", 3)
            storage._wait(4000)
            tr.deleteAll()
            storage._wait(500)
            player.setDirection([-1,0])
            
            ad.play(SOUND, 'general_thunder2', VOLUME_SOUND)
            tr.write("Grab the flashlight and head out.", 5, COLOR_OBJECTIVE)
            tr.write("[Press F5 to save your progress.]", 3, COLOR_OBJECTIVE,\
                 (0, POSITION_BOTTOM_SCREEN[1]+20))
            # 'Toggled this cutscene' switch
            storage._setData('bedroom_bedscare_done', True)
            
            storage._toggleCutscene(False)
        else:
            tr.write("My bed used to be so comfortable. I don't sleep very well at the moment.", 5)
    else:
        tr.write("My bed. I can't reach it from here.", 3)
        
    storage._halt()
コード例 #16
0
def note(storage, obj, m):
    storage._go()
    if storage._playerInDistance(m.getPlayer().position, obj.rect):
        # Cutscene toggle: Disable user input
        storage._toggleCutscene(True)
        tr = GlobalServices.getTextRenderer()
        ad = GlobalServices.getAudioDevice()
        
        tr.deleteAll()
        
        # Overlays
        note = OverlayFactory.create("note_big.png")
        togray = OverlayFactory.create_animated_color((0,0,0), 1000, 0, True, 0, 200)
        m.addOverlay(note)
        m.addOverlay(togray)
        
        # Play sound
        ad.play(SOUND, 'journal_page', VOLUME_SOUND)
        
        # Text of the note
        y = 150
        ofs = 18
        tr.write("Marnie:",\
                 0, COLOR_TEXT, (100, y + (ofs*0)))
        tr.write("Last night, I caught Cly wandering around the house again.",\
                 0, COLOR_TEXT, (100, y + (ofs*2)))
        tr.write("He did not respond at all when I addressed him and asked what he was doing.",\
                 0, COLOR_TEXT, (100, y + (ofs*3)))
        tr.write("His eyed were wide open but he did not react at all. I put him back to bed.",\
                 0, COLOR_TEXT, (100, y + (ofs*4)))
        tr.write("The next morning, I asked him about the incident. He did not remember any of it,",\
                 0, COLOR_TEXT, (100, y + (ofs*6)))
        tr.write("although he claimed to be very tired that day.",\
                 0, COLOR_TEXT, (100, y + (ofs*7)))
        tr.write("This is the third time it happened when he slept over at our house.",\
                 0, COLOR_TEXT, (100, y + (ofs*8)))
        tr.write("I'm telling you, something is troubling this poor child.",\
                 0, COLOR_TEXT, (100, y + (ofs*9)))
        tr.write("Please, my dear, get this kid to the doctor.",\
                 0, COLOR_TEXT, (100, y + (ofs*10)))
        tr.write("- Harold",\
                 0, COLOR_TEXT, (100, y + (ofs*12)))
        
        # Wait for user input
        storage._pauseUntilClick()
        
        GlobalServices.getEventManager().post(ObjectHighlightedEvent(None))
        
        # Delete note overlay
        m.removeOverlay(note)
        m.removeOverlay(togray)
        # Play sound
        ad.play(SOUND, 'journal_page', VOLUME_SOUND)        
        # Delete texts
        tr.deleteAll()
        
        if not storage._getData('library_notefound'):
            tr.write("Marnie...? My mother's name was Marnie.", 3)
            storage._wait(3000)
            tr.write("And Harold is my grandfather...", 3)
            storage._wait(3000)
            tr.write("They both vanished not too long ago.", 3)
            storage._wait(4500)
            tr.write("I feel strange.", 3)
            storage._setData('library_notefound', True)
        storage._toggleCutscene(False)
    storage._halt()