Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # XaiL's Character Scene
- # Author: XaiL
- # 04/02/2011
- #==============================================================================
- $imported = {} if $imported == nil
- $imported["Xail-CharacterScene"] = true
- #==============================================================================#
- # Xail
- #==============================================================================#
- module Xail
- #--------------------------------------------------------------------------#
- # * Settings
- #--------------------------------------------------------------------------#
- FADE_IN_TIME = 30 # Fade in time when Scene is loaded.
- CLASSES = ["Magician", "Ranger", "Guardian"]
- CHARACTER_Y = 178 # Y position for window.
- SELECTION_X = 10 # X position for select character image.
- SELECTION_Y = 30 # Y position for select character image.
- end
- #Don't edit below!
- #==============================================================================
- =begin
- Edited by IceDragon (cause I can)
- As a kinda standard
- initialize
- start
- terminate
- return_scene (or change scenes)
- commands
- create
- dispose
- update
- =end
- #==============================================================================#
- # Scene_CharacterSelection
- #==============================================================================#
- class Scene_CharacterSelection < Scene_Base
- @@available_classes = Xail::CLASSES
- @@fade_in_time = Xail::FADE_IN_TIME
- def start
- super
- create_menu_background
- create_command_window
- create_graphic
- end
- def terminate
- super
- dispose_command_window
- dispose_graphic
- end
- def call_difficulty_screen
- $scene = Scene_Difficult.new
- end
- def return_scene
- $scene = Scene_Title.new
- end
- def command_class( index )
- $game_party.remove_actor(1)
- $game_party.remove_actor(2)
- $game_party.remove_actor(3)
- # // This
- case index
- when 0 ; $game_party.add_actor(1)
- when 1 ; $game_party.add_actor(2)
- when 2 ; $game_party.add_actor(3)
- end
- # // Or this...
- # $game_party.add_actor( index+1 )
- $game_player.refresh
- call_difficulty_screen
- end
- def create_graphic
- @selection = Sprite_Base.new
- @selection.bitmap = Cache.system("select_character")
- @selection.x = Xail::SELECTION_X
- @selection.y = Xail::SELECTION_Y
- #@back_sprite = Sprite_Base.new
- #@back_sprite.bitmap = $game_temp.background_bitmap
- end
- def create_command_window
- a = @@available_classes.clone
- a << "Back"
- @command_window = Window_Command.new(272, a)
- @command_window.x = (Graphics.width - @command_window.width) / 2
- @command_window.y = Xail::CHARACTER_Y
- @command_window.open
- end
- def dispose_command_window
- @command_window.dispose
- end
- def dispose_graphic
- @back_sprite.dispose
- @selection.dispose
- end
- def update
- super
- @command_window.update
- if Input.trigger?(Input::C)
- case @command_window.index
- when 0..2 # Class1
- Sound.play_decision
- command_class( @command_window.index )
- when 3 # Cancel
- Sound.play_decision
- return_scene
- end
- elsif Input.trigger?(Input::B)
- Sound.play_cancel
- return_scene
- end
- end
- def perform_transition
- Graphics.transition(@@fade_in_time)
- end
- end # END OF FILE
- #==============================================================================#
- # Scene_Character
- #==============================================================================#
- Scene_Character = Scene_CharacterSelection
- #=*==========================================================================*=#
- # ** END OF FILE
- #=*==========================================================================*=#
Advertisement
Add Comment
Please, Sign In to add comment