Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- # N.A.S.T.Y. Extra Equip Slots
- # Nelderson's Awesome Scripts To You
- # By: Nelderson
- # Made On: 5/15/2012
- #===============================================================================
- # Update History:
- # - Version 1.0 - Initial release
- #===============================================================================
- # *Notes:
- # - This script let's you add custom equip slots, and also changes
- # the equip screen a little when you move around.
- #===============================================================================
- # *Usage:
- # - To add an extra slot, use the CUSTOM_SLOTS section in the NEL module.
- #
- # - Put this notetag in an armor's note section for the armor to
- # be a specific equip type:
- #
- # <EQUIP_TYPE: X> - Where X is the EQUIP_TYPE_ID
- #
- # - DUAL_ORDER and NON_DUAL_ORDER are the way in which the equip screen will
- # show your equip slots. Put this in any order you feel like. You can also
- # use multiple slots of the same slot id for multiple things of the same type.
- #===============================================================================
- # Credits:
- # -Nelderson
- #===============================================================================
- module NEL
- #EQUIP_TYPE_ID => "Name"
- CUSTOM_SLOTS = {
- 5 => "Boots",
- 6 => "Neck",
- 7 => "Ring",
- 8 => "Tatoo",
- }
- #EQUIP_TYPE_IDs already in place
- #0 = Weapon
- #1 = Shield
- #2 = Head
- #3 = Body
- #4 = Accessory
- #Used for the order of equip types with Dual Weapon actors
- DUAL_ORDER = [0,0,2,3,4,4,5,6,7,8]
- #Used for the order of equip types with Sword/Shield actors
- NON_DUAL_ORDER = [0,1,2,3,4,4,5,8,7,6]
- end
- #==============================================================================#
- # End Of Customization Section #
- #==============================================================================#
- class Game_Actor < Game_Battler
- def equip_slots
- return NEL::DUAL_ORDER if dual_wield?
- return NEL::NON_DUAL_ORDER
- end
- end
- module Vocab
- class << Vocab
- alias nel_etype etype
- def etype(etype_id)
- if etype_id >= 5
- return NEL::CUSTOM_SLOTS[etype_id]
- else
- $data_system.terms.etypes[etype_id]
- end
- end
- end
- end
- module DataManager
- class << DataManager
- alias nel_item_slot_inita_loadf load_database
- def load_database
- nel_item_slot_inita_loadf
- for a in 0..$data_armors.size
- next if $data_armors[a] == nil
- if /<(?:EQUIP_TYPE:|equip_type:)[ ](\d+)>/i =~ $data_armors[a].note
- $data_armors[a].etype_id = $1.to_i
- end
- end
- end
- end
- end
- class Window_EquipSlot < Window_Selectable
- def col_max
- return 2
- end
- def update
- super
- if index % 2 == 0
- SceneManager.scene.steady_infoview if SceneManager.scene_is?(Scene_Equip)
- @item_window.slot_id = index if @item_window
- else
- SceneManager.scene.reverse_infoview if SceneManager.scene_is?(Scene_Equip)
- @item_window.slot_id = index if @item_window
- end
- end
- end
- #==============================================================================
- # ■ Scene_Equip
- #------------------------------------------------------------------------------
- #==============================================================================
- class Scene_Equip < Scene_MenuBase
- def start
- super
- create_help_window
- create_status_window
- create_info_viewport
- create_command_window
- create_slot_window
- create_item_window
- end
- def create_info_viewport
- @info_viewport = Viewport.new
- @info_viewport.rect.y = @help_window.height
- @info_viewport.rect.height = @status_window.height + 416
- @info_viewport.z = 100
- @info_viewport.ox = 0
- @status_window.viewport = @info_viewport
- end
- alias nel_updt update
- def update
- nel_updt
- update_info_viewport
- end
- def reverse_infoview
- return if !@slot_window.active
- @status_window.x = @slot_window.width
- move_info_viewport(208)
- end
- def steady_infoview
- return if !@slot_window.active
- @status_window.x = -208
- move_info_viewport(-208)
- end
- def create_status_window
- @status_window = Window_EquipStatus.new(-208, 0)
- @status_window.actor = @actor
- end
- def update_info_viewport
- if @info_viewport.ox != 0
- move_info_viewport(0) if !@slot_window.active && !@item_window.active
- end
- end
- def move_info_viewport(ox)
- current_ox = @info_viewport.ox
- @info_viewport.ox = [ox, current_ox + 48].min if current_ox < ox
- @info_viewport.ox = [ox, current_ox - 48].max if current_ox > ox
- end
- def create_command_window
- wx = @status_window.width/2
- wy = @help_window.height
- ww = Graphics.width - @status_window.width
- @command_window = Window_EquipCommand.new(wx, 0, ww)
- @command_window.viewport = @info_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))
- end
- def create_slot_window
- wx = @status_window.width
- wy = @command_window.height
- ww = Graphics.width
- @slot_window = Window_EquipSlot.new(0, wy, ww)
- @slot_window.viewport = @info_viewport
- @slot_window.help_window = @help_window
- @slot_window.status_window = @status_window
- @slot_window.actor = @actor
- @slot_window.set_handler(:ok, method(:on_slot_ok))
- @slot_window.set_handler(:cancel, method(:on_slot_cancel))
- end
- def create_item_window
- wx = 0
- wy = @slot_window.y + @help_window.height + @slot_window.height
- ww = Graphics.width
- wh = Graphics.height - wy
- @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
- end
- end
Add Comment
Please, Sign In to add comment