Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================#
- # // ICY - Temp Item Selection //
- #==============================================================================#
- # // Created by : IceDragon
- # // Date Created : 11/16/2011
- # // Date Modified : 11/16/2011
- # // Version : 1.0
- # // Created for : Archeia
- #==============================================================================#
- # // In a script call use :
- # // start_temp_item_select()
- # //
- # // To change the variable for the item ids
- # // Go to Scene_Item (below) and change the constant:
- # // SEL_ITEM_ID_VAR
- # //
- #==============================================================================#
- ($imported ||= {})["ICY-TempItemSelection"] = true
- #==============================================================================#
- # ** Game_Temp
- #==============================================================================#
- class Game_Temp
- #--------------------------------------------------------------------------#
- # * Public Instance Variable(s)
- #--------------------------------------------------------------------------#
- attr_accessor :temp_item_selection
- attr_accessor :return_scene
- end
- #==============================================================================#
- # ** Game_Interpreter
- #==============================================================================#
- class Game_Interpreter
- #--------------------------------------------------------------------------#
- # * new-method :start_temp_item_select
- #--------------------------------------------------------------------------#
- def start_temp_item_select()
- $game_temp.temp_item_selection = true
- $game_temp.return_scene = "map"
- $scene = Scene_Item.new()
- $game_temp.return_scene = "null"
- end
- end
- #==============================================================================#
- # ** Scene_Item
- #==============================================================================#
- class Scene_Item
- #--------------------------------------------------------------------------#
- # * Constant(s)
- #--------------------------------------------------------------------------#
- SEL_ITEM_ID_VAR = 101 # // Variable used for storing item ID
- #--------------------------------------------------------------------------#
- # * alias-method :initialize
- #--------------------------------------------------------------------------#
- alias :icy_temp_initialize :initialize unless $@
- def initialize( *args, &block )
- icy_temp_initialize( *args, &block )
- @return_obj = case $game_temp.return_scene
- when "map" ; "map"
- else ; "menu"
- end
- $game_variables[SEL_ITEM_ID_VAR] = 0
- end
- #--------------------------------------------------------------------------#
- # * alias-method :update_item_selection
- #--------------------------------------------------------------------------#
- alias :icy_temp_item_selection :update_item_selection unless $@
- def update_item_selection( *args, &block )
- if Input.trigger?(Input::C)
- $game_variables[SEL_ITEM_ID_VAR] = 0
- @item = @item_window.item
- $game_party.last_item_id = @item.id unless @item.nil?()
- if $game_party.item_can_use?( @item )
- Sound.play_decision()
- $game_variables[SEL_ITEM_ID_VAR] = @item.id
- return_scene()
- else
- Sound.play_buzzer()
- end
- return
- end if $game_temp.temp_item_selection
- icy_temp_item_selection( *args, &block )
- end
- #--------------------------------------------------------------------------#
- # * overwrite-method :return_scene
- #--------------------------------------------------------------------------#
- def return_scene()
- case @return_obj
- when "map"
- $scene = Scene_Map.new()
- when "menu"
- $scene = Scene_Menu.new( 0 )
- end
- end
- end
- #=*==========================================================================*=#
- # ** END OF FILE
- #=*==========================================================================*=#
Advertisement
Add Comment
Please, Sign In to add comment