Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin =========================================================================
- Dekita's v1.0
- ★ Equipment Screen™ ★
- ================================================================================
- Script Information:
- ====================
- An Alternative (much better) Equipment screen with tons of information.
- REQUIRES Dekita__CORE !
- ================================================================================
- FEATURES:
- ==========
- - Big Numbers ^_^
- ================================================================================
- ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
- ================================================================================
- 1. You must give credit to "Dekita"
- 2. You are NOT allowed to repost this script.(or modified versions)
- 3. You are NOT allowed to convert this script.(into other game engines e.g RGSS2)
- 4. You are NOT allowed to use this script for Commercial games.
- 5. ENJOY!
- "FINE PRINT"
- By using this script you hereby agree to the above terms and conditions,
- if any violation of the above terms occurs "legal action" may be taken.
- Not understanding the above terms and conditions does NOT mean that
- they do not apply to you.
- If you wish to discuss the terms and conditions in further detail you can
- contact me at http://dekitarpg.wordpress.com/ or DekitaRPG@gmail.com
- ================================================================================
- History:
- =========
- D /M /Y
- 19/10/2o12 - Finished,
- 10/10/2o12 - Started,
- ================================================================================
- INSTRUCTIONS:
- ==============
- Place this script UNDER "▼ Materials" and ABOVE "▼ Main" in your script editor.
- ================================================================================
- Script Calls:
- ==============
- =end
- module Dekita__Equip
- Commands_list =[ # Do Not Remove !
- #Command , Vocab , Icon_id
- [:equip , "Equip" , 101],
- [:optimize , "Optimize" , 102],
- [:clear , "Clear" , 103],
- ] #
- Use_Command_Icons = true
- Extra_Command_Width = 0
- Toggle_Info_Button = :SHIFT
- # ACTOR info shown on page one.
- Actor_Info =[
- [:name],
- [:nickname],
- [:class],
- [:level],
- [:exp_total],
- [:exp_to_next],
- [:death_counter],# <- Requires Dekita - Actor Death Counter
- [:atl],
- [:dfl],
- ]#
- # EQUIPMENT Info shown on page one.
- Page_One_Info =[
- [:name],
- # [:req_lvl],# <- Requires - Dekita_Equip_Requirements, v1.2+
- # [:req_vit],# <- Requires - Dekita_Equip_Requirements, v1.2+
- # [:req_str],# <- Requires - Dekita_Equip_Requirements, v1.2+
- # [:req_mag],# <- Requires - Dekita_Equip_Requirements, v1.2+
- # [:req_dex],# <- Requires - Dekita_Equip_Requirements, v1.2+
- # [:req_atl],# <- Requires - Dekita_Equip_Requirements, v1.2+
- # [:req_dfl],# <- Requires - Dekita_Equip_Requirements, v1.2+
- # [:req_adc],# <- Requires - Dekita_Equip_Requirements, v1.2+ and Actor Death Counter
- [:vit],
- [:str],
- [:dex],
- [:mag],
- [:atl],
- [:dfl],
- ]#
- Page_Two_Info =[
- [:mhp],
- [:mmp],
- [:mtp],# <- Requires - Dekita__TP_Limits
- [:atk],
- [:def],
- [:mat],
- [:mdf],
- [:agi],
- [:luk],
- ] #
- Page_Three_Info =[
- [:hit],
- [:eva],
- [:cri],
- [:cev],
- [:mev],
- [:mrf],
- [:cnt],
- [:hrg],
- [:mrg],
- ] #
- Page_Four_Info =[
- [:tgr],
- [:grd],
- [:rec],
- [:mcr],
- [:tcr],
- [:pdr],
- [:mdr],
- [:exr],
- [:fdr],
- ] #
- # Do Not Remove this.
- p 'Loaded : DPBz - Equip'
- end # Dekita__Equip
- #===============================================================================#
- # http://dekitarpg.wordpress.com/
- #===============================================================================#
- # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
- # YES?\.\. #
- # OMG, REALLY? #
- # WELL SLAP MY FACE AND CALL ME A DRAGON.\..\.. #
- # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
- #===============================================================================#
- $imported = {} if $imported.nil?
- $imported[:Dekita__Equip] = true
- unless $imported[:Dekita__CORE]
- msgbox("'Dekita__Equip'
- The Above Script Requires 'Dekita__CORE, v1.0' in order to function properly,
- It must also be placed below it!
- You can get the latest version of all my scripts @
- http://dekitarpg.wordpress.com/")
- exit
- end
- #==============================================================================
- class Window_EquipItemStatus < Window_Base
- #==============================================================================
- #--------------------------------------------------------------------------
- # initialize
- #--------------------------------------------------------------------------
- def initialize(dx, dy, item_window)
- super(dx, dy, Graphics.width - dx, Graphics.height)
- @item_window = item_window
- @item = nil
- @equip_info_page = 0
- refresh
- self.opacity = 0
- end
- #--------------------------------------------------------------------------
- # update
- #--------------------------------------------------------------------------
- def update
- super
- update_item(@item_window.item)
- change_equip_page if Input.trigger?(Dekita__Equip::Toggle_Info_Button)
- end
- def change_equip_page
- case @equip_info_page
- when 0
- @equip_info_page = 1
- when 1
- @equip_info_page = 2
- when 2
- @equip_info_page = 3
- when 3
- @equip_info_page = 0
- else
- end
- refresh
- end
- #--------------------------------------------------------------------------
- # update_item
- #--------------------------------------------------------------------------
- def update_item(item)
- return if @item == item
- @item = item
- refresh
- end
- #--------------------------------------------------------------------------
- # refresh
- #--------------------------------------------------------------------------
- def refresh
- contents.clear
- reset_font_settings
- return change_empty_info if @item.nil?
- change_page_info if !@item.nil?
- end
- def change_page_info
- case @equip_info_page# = 0
- when 0
- draw_page_one_equip_info
- when 1
- draw_page_two_equip_info
- when 2
- draw_page_three_equip_info
- when 3
- draw_page_four_equip_info
- else
- end
- end
- def change_empty_info
- case @equip_info_page# = 0
- when 0
- draw_empty_info_column
- when 1
- draw_empty_info_column_two
- when 2
- draw_empty_info_column_three
- when 3
- draw_empty_info_column_four
- else
- end
- end
- def draw_page_one_equip_info
- dx = Graphics.width / 3 * 0
- dw = ((Graphics.width) / 3) - 12
- dy = line_height * 4.7
- for property in Dekita__Equip::Page_One_Info
- dy = draw_stat_info_DPBz(property, @item, dx, dy, dw)
- end
- end
- def draw_page_two_equip_info
- dx = Graphics.width / 3 * 0
- dw = ((Graphics.width) / 3) - 12
- dy = line_height * 4.7
- for property in Dekita__Equip::Page_Two_Info
- dy = draw_stat_info_DPBz(property, @item, dx, dy, dw)
- end
- end
- def draw_page_three_equip_info
- dx = Graphics.width / 3 * 0
- dw = ((Graphics.width) / 3) - 12
- dy = line_height * 4.7
- for property in Dekita__Equip::Page_Three_Info
- dy = draw_stat_info_DPBz(property, @item, dx, dy, dw)
- end
- end
- def draw_page_four_equip_info
- dx = Graphics.width / 3 * 0
- dw = ((Graphics.width) / 3) - 12
- dy = line_height * 4.7
- for property in Dekita__Equip::Page_Four_Info
- dy = draw_stat_info_DPBz(property, @item, dx, dy, dw)
- end
- end
- def draw_empty_info_column
- dx = Graphics.width / 3 * 0
- dw = ((Graphics.width) / 3) - 12
- dy = line_height * 4.7
- for property in Dekita__Equip::Page_One_Info
- dy = draw_stat_info_DPBz(property, false, dx, dy, dw)
- end
- end
- def draw_empty_info_column_two
- dx = Graphics.width / 3 * 0
- dw = ((Graphics.width) / 3) - 12
- dy = line_height * 4.7
- for property in Dekita__Equip::Page_Two_Info
- dy = draw_stat_info_DPBz(property, false, dx, dy, dw)
- end
- end
- def draw_empty_info_column_three
- dx = Graphics.width / 3 * 0
- dw = ((Graphics.width) / 3) - 12
- dy = line_height * 4.7
- for property in Dekita__Equip::Page_Three_Info
- dy = draw_stat_info_DPBz(property, false, dx, dy, dw)
- end
- end
- def draw_empty_info_column_four
- dx = Graphics.width / 3 * 0
- dw = ((Graphics.width) / 3) - 12
- dy = line_height * 4.7
- for property in Dekita__Equip::Page_Four_Info
- dy = draw_stat_info_DPBz(property, false, dx, dy, dw)
- end
- end
- end # Window_ItemStatus
- #==============================================================================
- class Window_EquipStatus < Window_Base
- #==============================================================================
- def window_width
- return Graphics.width
- end
- def window_height
- Graphics.height
- end
- def visible_line_number
- return 9
- end
- def refresh
- contents.clear
- draw_actor_face(@actor, (Graphics.width/2.5), 0) if @actor
- draw_horz_line(line_height * 4)
- draw_horz_line(Graphics.height - line_height * 4)
- contents.font.size = Dekita__CORE::Info_Font_Size
- draw_commands_infoo
- end
- def draw_commands_infoo
- dx = 0
- dw = (Graphics.width - 24) / 5
- dy = 0
- for info in Dekita__Equip::Commands_list
- dy = draw_command_column_info(info, dx, dy, dw)
- end
- end
- def draw_command_column_info(info, dx, dy, dw)
- case info[0]
- when :equip
- when :optimize
- when :clear
- else ; return dy
- end
- colour = Color.new(0, 0, 0, translucent_alpha/2)
- rect = Rect.new(dx+1, dy+1, dw-2, line_height-2)
- contents.fill_rect(rect, colour)
- if Dekita__Equip::Use_Command_Icons
- draw_icon(info[2], dx, dy, enable_DPBz_icons?)
- draw_text(dx+25, dy, dw-8, line_height, info[1], 0)
- else
- draw_text(dx+4, dy, dw-8, line_height, info[1], 0)
- end
- return dy + line_height
- end
- def draw_horz_line(y)
- line_y = y + line_height / 2 - 1
- contents.fill_rect(0, line_y, contents_width, 2, line_color)
- end
- def line_color
- color = normal_color
- color.alpha = 48
- color
- end
- end # Window_EquipStatus
- #==============================================================================
- class Window_Equip_ActorStatus < Window_EquipStatus
- #==============================================================================
- def initialize(x, y)
- super(x, y)
- @actor = nil
- @temp_actor = nil
- @equip_info_page = 0
- self.opacity = 0
- refresh
- end
- def window_width
- return Graphics.width
- end
- def window_height
- Graphics.height
- end
- def visible_line_number
- return 9
- end
- def refresh
- contents.clear
- end
- def draw_page_one_actor_info
- dx = Graphics.width / 3 * 0
- dw = ((Graphics.width) / 3) - 12
- dy = line_height * 4.7
- for property in Dekita__Equip::Actor_Info
- dy = draw_stat_info_DPBz(property, @actor, dx, dy, dw)
- end
- end
- def update
- super
- change_equip_page if Input.trigger?(Dekita__Equip::Toggle_Info_Button)
- end
- def change_equip_page
- case @equip_info_page# =
- when 0
- @equip_info_page = 1
- when 1
- @equip_info_page = 2
- when 2
- @equip_info_page = 3
- when 3
- @equip_info_page = 0
- else
- end
- refresh
- end
- def update_item(item)
- return if @item == item
- @item = item
- refresh
- end
- def refresh
- contents.clear
- change_page_info if @actor
- end
- def change_page_info
- case @equip_info_page
- when 0
- draw_page_one_equip_info
- when 1
- draw_page_two_equip_info
- when 2
- draw_page_three_equip_info
- when 3
- draw_page_four_equip_info
- else
- end
- end
- def draw_page_one_equip_info
- dx = Graphics.width / 3 * 0
- dw = ((Graphics.width) / 3) - 12
- dy = line_height * 4.7
- for property in Dekita__Equip::Actor_Info
- dy = draw_stat_info_DPBz(property, @actor, dx, dy, dw)
- end
- end
- def draw_page_two_equip_info
- dx = Graphics.width / 3 * 0
- dw = ((Graphics.width) / 3) - 12
- dy = line_height * 4.7
- for property in Dekita__Equip::Page_Two_Info
- dy = draw_stat_info_DPBz(property, @actor, dx, dy, dw)
- end
- end
- def draw_page_three_equip_info
- dx = Graphics.width / 3 * 0
- dw = ((Graphics.width) / 3) - 12
- dy = line_height * 4.7
- for property in Dekita__Equip::Page_Three_Info
- dy = draw_stat_info_DPBz(property, @actor, dx, dy, dw)
- end
- end
- def draw_page_four_equip_info
- dx = Graphics.width / 3 * 0
- dw = ((Graphics.width) / 3) - 12
- dy = line_height * 4.7
- for property in Dekita__Equip::Page_Four_Info
- dy = draw_stat_info_DPBz(property, @actor, dx, dy, dw)
- end
- end
- end # Window_Equip_ActorStatus < Window_EquipStatus
- #==============================================================================
- class Window_EquipCommand_DPBz < Window_Command
- #==============================================================================
- def initialize(x, y, width)
- super(x, y)
- end
- def window_width
- return (Graphics.width - 24) / 4.15 + (Dekita__Equip::Extra_Command_Width)
- end
- def make_command_list
- for command in Dekita__Equip::Commands_list
- case command[0]
- when :equip ; add_command("", :equip)
- when :optimize ; add_command("", :optimize)
- when :clear ; add_command("", :clear)
- when :upgrade ; add_command("", :upgrade)
- else
- end
- end
- end
- end # Window_EquipCommand_DPBz < Window_Command
- #==============================================================================
- class Window_EquipSlot < Window_Selectable
- #==============================================================================
- def initialize(x, y, width)
- super(((Graphics.width / 3) - 4), line_height * 4.7, width, window_height)
- @actor = nil
- refresh
- end
- def window_height
- Graphics.height
- end
- def draw_item(index)
- return unless @actor
- dx = (Graphics.width - 24) / 2 * 1
- dy = 0
- rect = item_rect_for_text(index)
- contents.font.size = Dekita__CORE::Info_Font_Size
- draw_equipments(92, 0)
- end
- def draw_equipments(x, y)
- @actor.equips.each_with_index do |item, i|
- draw_item_name(item, x, y + (line_height * 1) * i)
- end
- change_color(Dekita__CORE::Value_Color_Settings(""))
- draw_actors_slots(y)
- end
- def draw_actors_slots(y)
- my_x = 4
- slots_id = 0
- amount = @actor.equip_slots.size
- amount.times {|i|
- change_color(enabled_color?(slots_id))
- draw_text(my_x, y + line_height * i, Graphics.width / 3, line_height, slot_name(slots_id))
- slots_id += 1
- }
- end
- def enabled_color?(index)
- return Color.new(111, 111, 111) unless @actor
- return Color.new(222, 222, 222) if @actor.equip_change_ok?(index)
- return Color.new(111, 111, 111)
- end
- end # Window_EquipSlot < Window_Selectable
- #==============================================================================
- class Window_EquipItem < Window_ItemList
- #==============================================================================
- def col_max
- return 1
- end
- def draw_item(index)
- contents.font.size = Dekita__CORE::Info_Font_Size
- super
- end
- end # Window_EquipItem < Window_ItemList
- #==============================================================================
- class Scene_Equip < Scene_MenuBase
- #==============================================================================
- def start
- super
- create_status_window
- create_help_window
- create_command_window
- create_slot_window
- create_item_window
- create_actor_status_window
- create_equip_status_window
- create_equip_slot_status_window
- @help_window.y = (Graphics.height - @help_window.height)
- @help_window.opacity = 0
- end
- def create_status_window
- @status_window = Window_EquipStatus.new(0, 0)
- @status_window.viewport = @viewport
- @status_window.actor = @actor
- end
- def create_actor_status_window
- @actor_status_window = Window_Equip_ActorStatus.new(0, 0)
- @actor_status_window.viewport = @viewport
- @actor_status_window.actor = @actor
- end
- def create_equip_status_window
- @equip_status_window = Window_EquipItemStatus.new(0, 0, @item_window)
- @equip_status_window.viewport = @viewport
- @equip_status_window.hide
- end
- def create_equip_slot_status_window
- wx = 0
- wy = 0
- @equip_slot_status_window = Window_EquipItemStatus.new(wx, wy, @slot_window)
- @equip_slot_status_window.viewport = @viewport
- @equip_slot_status_window.hide
- end
- def create_command_window
- wx = 0
- wy = 0
- ww = Graphics.width / 2
- @command_window = Window_EquipCommand_DPBz.new(wx, wy, ww)
- @command_window.viewport = @viewport
- @command_window.help_window = @help_window
- @command_window.set_handler(:equip, method(:command_equip))
- @command_window.set_handler(:optimize, method(:command_optimize))
- @command_window.set_handler(:clear, method(:command_clear))
- @command_window.set_handler(:cancel, method(:return_scene))
- @command_window.set_handler(:pagedown, method(:next_actor))
- @command_window.set_handler(:pageup, method(:prev_actor))
- @command_window.opacity =0
- end
- def create_slot_window
- wx = 0
- wy = @command_window.y + @command_window.height
- ww = Graphics.width / 3 * 2
- @slot_window = Window_EquipSlot.new(wx, wy, ww)
- @slot_window.viewport = @viewport
- @slot_window.help_window = @help_window
- @slot_window.status_window = @status_window
- @slot_window.actor = @actor
- @slot_window.opacity = 0
- @slot_window.set_handler(:ok, method(:on_slot_ok))
- @slot_window.set_handler(:cancel, method(:on_slot_cancel))
- end
- def create_item_window
- wx = (Graphics.width - (Graphics.width / 5 * 2))
- wy = 0
- ww = Graphics.width / 5 * 2
- wh = (24 * 5)
- @item_window = Window_EquipItem.new(wx, wy, ww, wh)
- @item_window.viewport = @viewport
- @item_window.help_window = @help_window
- @item_window.status_window = @status_window
- @item_window.actor = @actor
- @item_window.set_handler(:ok, method(:on_item_ok))
- @item_window.set_handler(:cancel, method(:on_item_cancel))
- @slot_window.item_window = @item_window
- @item_window.opacity = 0
- end
- alias command_equip_WHATTTT command_equip
- def command_equip
- command_equip_WHATTTT
- @actor_status_window.hide
- @equip_slot_status_window.show
- end
- alias on_slot_ok_DPBz_Equip on_slot_ok
- def on_slot_ok
- on_slot_ok_DPBz_Equip
- @equip_slot_status_window.hide
- @equip_status_window.show
- end
- alias on_slot_cancel_DPBz_Equip on_slot_cancel
- def on_slot_cancel
- on_slot_cancel_DPBz_Equip
- @equip_status_window.hide
- @equip_slot_status_window.hide
- @actor_status_window.show
- end
- alias on_item_ok_DPBz_Equip on_item_ok
- def on_item_ok
- on_item_ok_DPBz_Equip
- @actor_status_window.refresh
- @equip_status_window.hide
- @equip_slot_status_window.show
- end
- alias on_item_cancel_DPBz_Equip on_item_cancel
- def on_item_cancel
- on_item_cancel_DPBz_Equip
- @equip_status_window.hide
- @equip_slot_status_window.show
- end
- alias on_actor_change_DPBZ_equip on_actor_change
- def on_actor_change
- on_actor_change_DPBZ_equip
- @actor_status_window.actor = @actor
- @command_window.activate
- end
- end # Scene_Equip
- #===============================================================================#
- # http://dekitarpg.wordpress.com/
- #===============================================================================#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement