Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
- # DRG - Picture Index Modifier
- # Version: 1.00
- # Author : LiTTleDRAgo
- #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
- #
- # How to use :
- #
- # @>Script: $game_temp.index_picture = 182 # (any integer above 0)
- # @>Show_Picture: .......... # Command show picture,
- # picture index will be overwritten by
- # $game_temp.index_picture value)
- #
- #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
- ($imported ||= {})[:drg_picture_index_modifier] = 1.00
- defined?(Window_ActorCommand) && raise("This script only for RMXP")
- #==============================================================================
- # ** Game_Pictures
- #------------------------------------------------------------------------------
- # This is a wrapper for a picture array. This class is used within the
- # Game_Screen class. Map screen pictures and battle screen pictures are
- # handled separately.
- #==============================================================================
- class Game_Pictures
- #--------------------------------------------------------------------------
- # * Get Data
- #--------------------------------------------------------------------------
- def [](num)(@data||=[])[num] ||= Game_Picture.new(num) end
- def size() (@data||=[]).compact.size end
- def each() (@data||=[]).compact.each {|pic| yield pic } if block_given? end
- end
- #==============================================================================
- # ** Game_Screen
- #------------------------------------------------------------------------------
- # This class handles screen maintenance data, such as changes in color tone,
- # flashes, etc. It's used within the Game_Map and Game_Troop classes.
- #==============================================================================
- class Game_Screen
- #--------------------------------------------------------------------------
- # * Pictures
- #--------------------------------------------------------------------------
- def pictures
- @pictures.is_a?(Game_Pictures) || @pictures = Game_Pictures.new
- $scene.is_a?(Scene_Battle) ? (@battle_pictures ||= Game_Pictures.new) :
- (@pictures ||= Game_Pictures.new)
- end
- end
- #==============================================================================
- # ** Spriteset_Map
- #------------------------------------------------------------------------------
- # This class brings together map screen sprites, tilemaps, etc.
- # It's used within the Scene_Map class.
- #==============================================================================
- ['Spriteset_Map','Spriteset_Battle'].each_with_index do |klass,index| eval "
- class #{klass}
- #--------------------------------------------------------------------------
- # * Alias Listing
- #--------------------------------------------------------------------------
- alias_method :update_inf_picture, :update
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def update(*args)
- adjust_picture_sprites(#{index})
- update_inf_picture(*args)
- end
- #--------------------------------------------------------------------------
- # * adjust_picture_sprites
- #--------------------------------------------------------------------------
- def adjust_picture_sprites(type = 0)
- size = @picture_sprites.size
- number = $game_screen.pictures.size
- if number != size
- @picture_sprites.each {|s| s.dispose }
- @picture_sprites.clear
- $game_screen.pictures.each do |num|
- @picture_sprites.push(Sprite_Picture.new(type == 0 ? @viewport2 :
- @viewport3,$game_screen.pictures[num.number]))
- end
- end
- end
- end#"
- end
- #==============================================================================
- # ** Game_Temp
- #------------------------------------------------------------------------------
- # This class handles temporary data that is not included with save data.
- # Refer to "$game_temp" for the instance of this class.
- #==============================================================================
- class Game_Temp
- #--------------------------------------------------------------------------
- # * Public Instance Variable
- #--------------------------------------------------------------------------
- attr_writer(:index_picture)
- define_method(:index_picture) { @index_picture ||= 0 }
- end
- #==============================================================================
- # ** Interpreter
- #------------------------------------------------------------------------------
- # This interpreter runs event commands. This class is used within the
- # Game_System class and the Game_Event class.
- #==============================================================================
- class Interpreter
- #--------------------------------------------------------------------------
- # * Show Picture
- #--------------------------------------------------------------------------
- (231..235).each do |meth|
- alias_method(:"command_#{meth}_inf_pic", :"command_#{meth}")
- define_method(:"command_#{meth}") do
- (index = $game_temp.index_picture).is_a?(Integer) &&
- index > 0 && @parameters[0] = index
- send(:"command_#{meth}_inf_pic")
- return true
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement