Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- # N.A.S.T.Y. EZ Select Summon
- # Nelderson's Awesome Scripts To You
- #
- # By: Nelderson
- # Last Updated: 1/13/2012
- # Version 1.0 - 1/13/2012
- #===============================================================================
- # Update History:
- # - Version 1.0 - Initial release, made for EZaxess
- #===============================================================================
- # *Notes:
- # - You need to fill Out the different sections for this to work.
- #
- # - At first there will be no summons availible, make sure to add some!
- #
- # Script Calls:
- #
- # - add_summon_id(id)
- #
- # Where id is the Summon ID in the SUMMONS Hash. (Left Side Number)
- #
- # - change_xy_summon_hud(x, y)
- #
- # Change the location of where the icons show up on the screen.
- # This also changes the Picture starting points.
- #===============================================================================
- # Credits:
- # -Nelderson
- #===============================================================================
- module NEL
- #Summon ID => ["Name", Icon_ID, Common Event ID, "Picture_Name"]
- #Pictures should be in Graphics > System Folder
- SUMMONS = {
- 0 => ["Bahamut", 20, 10,"Summ_Hud0" ],
- 1 => ["Bahl", 21, 11,"Summ_Hud1"],
- 2 => ["Bahwtwe", 22, 12, "Summ_Hud2"],
- 3 => ["Rryqahl", 23, 13, "Summ_Hud3"],
- 4 => ["BTWe", 24, 14, "Summ_Hud4"],
- 5 => ["HFfqw", 25, 15, "Summ_Hud5"],
- 6 => ["Bahl", 26, 16, "Summ_Hud6"],
- 7 => ["Bahl", 27, 17, "Summ_Hud7"],
- 8 => ["GOFUCKYOURSELF", 28, 18, "Summ_Hud8"],
- }
- #Icon_ID of the Icon that is used when actors don't have summons.
- NO_SUMMON_ICON = 54
- #Left is 0, Right is 7 - This is where the selection starts.
- STARTING_INDEX = 4
- #SUMMON_VAR is the variable that stores the currently active Summon ID
- SUMMON_VAR = 13
- end
- #==============================================================================
- # ** Window_Selectable_Summon
- #------------------------------------------------------------------------------
- # This window contains cursor movement and scroll functions.
- #==============================================================================
- class Window_Selectable_Summon < Window_Selectable
- #--------------------------------------------------------------------------
- # * Update cursor
- #--------------------------------------------------------------------------
- def update_cursor
- if @index < 0 # If the cursor position is less than 0
- self.cursor_rect.empty # Empty cursor
- else # If the cursor position is 0 or more
- row = @index / @column_max # Get current row
- if row < top_row # If before the currently displayed
- self.top_row = row # Scroll up
- end
- if row > bottom_row # If after the currently displayed
- self.bottom_row = row # Scroll down
- end
- rect = item_rect(@index) # Get rectangle of selected item
- rect.y -= self.oy # Match rectangle to scroll position
- self.x = item_rect(@item_max - (@index + 1)).x
- self.cursor_rect = rect # Refresh cursor rectangle
- end
- end
- end
- #==============================================================================
- # ** Window_Summon
- #------------------------------------------------------------------------------
- # This window displays a list of usable skills on the skill screen, etc.
- #==============================================================================
- class Window_Summon < Window_Selectable_Summon
- #--------------------------------------------------------------------------
- # * Object Initialization
- # x : window x-coordinate
- # y : window y-coordinate
- # width : window width
- # height : window height
- #--------------------------------------------------------------------------
- def initialize(x, y, width, height)
- super(x, y, width, height)
- @column_max = 9
- @spacing -= 24
- self.opacity = 0
- self.index = NEL::STARTING_INDEX
- refresh
- end
- #--------------------------------------------------------------------------
- # * Get Summons
- #--------------------------------------------------------------------------
- def summons
- return NEL::SUMMONS
- end
- #--------------------------------------------------------------------------
- # * Refresh
- #--------------------------------------------------------------------------
- def refresh
- @data = []
- for summon in summons
- @data.push(summon)
- end
- @item_max = @data.size
- create_contents
- for i in 0...@item_max
- draw_item(i)
- end
- end
- #--------------------------------------------------------------------------
- # * Draw Item
- # index : item number
- #--------------------------------------------------------------------------
- def draw_item(index)
- rect = item_rect(index)
- self.contents.clear_rect(rect)
- summ = summons[index]
- if summ != nil
- enabled = $game_system.summons_learned.include?(index)
- if enabled
- draw_icon(summ[1], rect.x, rect.y, true)
- else
- draw_icon(NEL::NO_SUMMON_ICON, rect.x, rect.y, true)
- end
- end
- end
- end
- class Game_System
- attr_accessor :summons_learned
- attr_accessor :sumhud_x
- attr_accessor :sumhud_y
- alias nel_summo_initi initialize
- def initialize
- nel_summo_initi
- @summons_learned = []
- @sumhud_x = 110
- @sumhud_y = 16
- end
- end
- class Game_Interpreter
- def add_summon_id(id)
- $game_system.summons_learned.push(id)
- end
- def change_xy_summon_hud(x = 110, y = 16)
- $game_system.sumhud_x = x
- $game_system.sumhud_y = y
- end
- end
- class Scene_Battle < Scene_Base
- #--------------------------------------------------------------------------
- # * Start processing
- #--------------------------------------------------------------------------
- alias nel_battl_summo_startil start
- def start
- make_and_hide_summon_pics
- nel_battl_summo_startil
- end
- def make_and_hide_summon_pics
- @summon_pic = {}
- for i in 0...NEL::SUMMONS.keys.size
- bitmap = Cache.system(NEL::SUMMONS[i][3])
- @summon_pic[i] = Sprite_Base.new
- @summon_pic[i].bitmap = bitmap
- @summon_pic[i].x = $game_system.sumhud_x
- @summon_pic[i].y = $game_system.sumhud_y
- @summon_pic[i].z = 1000
- @summon_pic[i].visible = false
- end
- return
- end
- #--------------------------------------------------------------------------
- # * Post-Start processing
- #--------------------------------------------------------------------------
- alias nel_battl_summo_starting post_start
- def post_start
- nel_battl_summo_starting
- @summon_trig = false
- process_summon_scene
- end
- def process_summon_scene
- x, y = $game_system.sumhud_x, $game_system.sumhud_y
- @nel_summ_win = Window_Summon.new(x, y, 324, 56)#(x, y, 288, 56)
- loop do
- Graphics.update
- Input.update
- update_summ_scene
- for pic in @summon_pic.keys.each{ |x|
- if @nel_summ_win.index == x
- @summon_pic[x].visible = true unless @summon_pic[x].disposed?
- else
- @summon_pic[x].visible = false unless @summon_pic[x].disposed?
- end
- }
- end
- break if @summon_trig == true
- end
- $game_temp.common_event_id = @summ_evid
- end
- def update_summ_scene
- @nel_summ_win.update
- if Input.trigger?(Input::C)
- $game_variables[NEL::SUMMON_VAR] = @nel_summ_win.index
- for pic in @summon_pic.keys.each{ |x|; @summon_pic[x].dispose}; end
- @summ_evid = NEL::SUMMONS[@nel_summ_win.index][2]
- @nel_summ_win.dispose
- @summon_trig = true
- elsif Input.trigger?(Input::B)
- Sound.play_buzzer
- end
- end
- end
Add Comment
Please, Sign In to add comment