Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # * Scene_Map
- #------------------------------------------------------------------------------
- # It is the class which processes the map picture.
- #==============================================================================
- class Scene_Map
- #--------------------------------------------------------------------------
- # - Main processing
- #--------------------------------------------------------------------------
- def main
- # Drawing up sprite set
- @spriteset = Spriteset_Map.new
- # Drawing up the message window
- @message_window = Window_Message.new
- # Draw HP Window
- draw_hp
- hide_hud
- # Transition execution
- Graphics.transition
- # Main loop
- loop do
- # Renewing the game picture
- Graphics.update
- # Updating the information of input
- Input.update
- @hp_slide.ox += 1
- # Frame renewal
- update
- # When the picture changes, discontinuing the loop
- if $scene != self
- break
- end
- end
- # Transition preparation
- Graphics.freeze
- # Releasing sprite set
- @spriteset.dispose
- # Releasing the message window
- @message_window.dispose
- dispose_hp
- # When it changes to the title picture and it is in
- if $scene.is_a?(Scene_Title)
- # Fading out picture
- Graphics.transition
- Graphics.freeze
- end
- end
- #--------------------------------------------------------------------------
- # - Frame renewal
- #--------------------------------------------------------------------------
- def update
- # oop
- loop do
- # The map, it renews to the order of the interpreter and the prayer
- # (As for this renewal order, when the condition for executing the event is satisfied
- # In the reason such that the opportunity which instant is moved in the prayer is not given the importance)
- $game_map.update
- $game_system.map_interpreter.update
- $game_player.update
- # e system (the timer), renewing the picture
- $game_system.update
- $game_screen.update
- # If it is not the place on the move of the prayer, discontinuing the loop
- unless $game_temp.player_transferring
- break
- end
- # Executing place movement
- transfer_player
- # When it is in the midst of transition processing, discontinuing the loop
- if $game_temp.transition_processing
- break
- end
- end
- hide_hud
- # Renewing sprite set
- @spriteset.update
- # Renewing the message window
- @message_window.update
- @hp_window.update
- @viewport_bor.update
- @hp_bor.update
- # When it is the game over
- if $game_temp.gameover
- # Change to game over picture
- $scene = Scene_Gameover.new
- return
- end
- # When you reset to the title picture
- if $game_temp.to_title
- # Change to title picture
- $scene = Scene_Title.new
- return
- end
- # When it is in the midst of transition processing
- if $game_temp.transition_processing
- # During transition processing clearing the flag
- $game_temp.transition_processing = false
- # Transition execution
- if $game_temp.transition_name == ""
- Graphics.transition(20)
- else
- Graphics.transition(40, "Graphics/Transitions/" +
- $game_temp.transition_name)
- end
- end
- # When it is in the midst of message window indicating
- if $game_temp.message_window_showing
- return
- end
- # When encounter count with 0, Encounter is not the sky
- if $game_player.encounter_count == 0 and $game_map.encounter_list != []
- # If it is not in the midst of event executing or in the midst of encounter prohibiting
- unless $game_system.map_interpreter.running? or
- $game_system.encounter_disabled
- # Deciding the troop
- n = rand($game_map.encounter_list.size)
- troop_id = $game_map.encounter_list[n]
- # If troop validity
- if $data_troops[troop_id] != nil
- # Setting the battle call flag
- $game_temp.battle_calling = true
- $game_temp.battle_troop_id = troop_id
- $game_temp.battle_can_escape = true
- $game_temp.battle_can_lose = false
- $game_temp.battle_proc = nil
- end
- end
- end
- # The B when button is pushed
- if Input.trigger?(Input::B)
- # If it is not in the midst of event executing or in the midst of menu prohibiting
- unless $game_system.map_interpreter.running? or
- $game_system.menu_disabled
- # Setting the menu call flag and the SE performance flag
- $game_temp.menu_calling = true
- $game_temp.menu_beep = true
- end
- end
- # When debugging mode ON and the F8 key are pushed
- if $DEBUG and Input.press?(Input::F8)
- # Performing decision SE
- $game_system.se_play($data_system.decision_se)
- # Reforming the attitude of the prayer
- $game_player.straighten
- # Change to saving picture
- $scene = Scene_Save.new
- end
- # When debugging mode ON and the F9 key are pushed
- if $DEBUG and Input.press?(Input::F9)
- # Setting the debugging call flag
- $game_temp.debug_calling = true
- end
- # When it is not on the move of the prayer
- unless $game_player.moving?
- # Executing the call of various pictures
- if $game_temp.battle_calling
- call_battle
- elsif $game_temp.shop_calling
- call_shop
- elsif $game_temp.name_calling
- call_name
- elsif $game_temp.menu_calling
- call_menu
- elsif $game_temp.save_calling
- call_save
- elsif $game_temp.debug_calling
- call_debug
- elsif $game_temp.shoot
- @spriteset.shoot
- $game_temp.shoot = false
- elsif $game_temp.hit
- $game_temp.hit = false
- end
- end
- end
- #--------------------------------------------------------------------------
- # - Place movement of prayer
- #--------------------------------------------------------------------------
- def transfer_player
- # Clearing the prayer place portable flag
- $game_temp.die_point = true
- $game_temp.player_transferring = false
- # When the tip of moving differs from the present map
- if $game_map.map_id != $game_temp.player_new_map_id
- #Setting up the new map
- $game_map.setup($game_temp.player_new_map_id)
- end
- $game_temp.die_point = false
- # Setting the position of the prayer
- $game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)
- case $game_temp.player_new_direction
- when 2 # Down
- $game_player.turn_down
- when 4 # Left
- $game_player.turn_left
- when 6 # Right
- $game_player.turn_right
- when 8 # Up
- $game_player.turn_up
- end
- # Map renewal (parallel event execution)
- $game_map.update
- # Rewriting sprite set
- @spriteset.dispose
- @spriteset = Spriteset_Map.new
- # When it is in the midst of transition processing
- if $game_temp.transition_processing
- # During transition processing clearing the flag
- $game_temp.transition_processing = false
- # Transition execution
- Graphics.transition(20)
- end
- # Executing the automatic operation change of BGM and BGS which are set to the map
- $game_map.autoplay
- # Frame reset
- Graphics.frame_reset
- # Updating the information of input
- Input.update
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement