Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ╔══════════════════════════════════════════════════════╤═══════╤════════════╗
- # ║ Menu Battle Members Restriction │ v1.01 │ (03/11/15) ║
- # ╠══════════════════════════════════════════════════════╧═══════╧════════════╣
- # ║ Author : William Couillard ║
- # ║ Thanks : Traverse ║
- # ║ E-Mail : cooliebk18@yahoo.com ║
- # ║ Website : http://ffdiscovery.wikia.com ║
- # ╠═══════════════════════════════════════════════════════════════════════════╣
- # ║ ABOUT ║
- # ╠═══════════════════════════════════════════════════════════════════════════╣
- # ║ This script forces the default menus to only allow the player access to ║
- # ║ party members who are in the current battle party. By default, all party ║
- # ║ members are accessible, so even party members who aren't in battle can ║
- # ║ use their skills or change their equipment. This script is intended to be ║
- # ║ used alongside a Party Change script, such as Yanfly's Party System. ║
- # ╠═══════════════════════════════════════════════════════════════════════════╣
- # ║ TERMS OF USE ║
- # ╠═══════════════════════════════════════════════════════════════════════════╣
- # ║ ► Do not edit the script's header or comments. ║
- # ║ ► Free to use in commercial projects as long as proper credit is given to ║
- # ║ ALL the names in the above header. ║
- # ╠═══════════════════════════════════════════════════════════════════════════╣
- # ║ FEATURES ║
- # ╠═══════════════════════════════════════════════════════════════════════════╣
- # ║ ► Restricts default menus to only allow access to party members who are ║
- # ║ in the active battle party. Custom menus for other scenes are not ║
- # ║ affected. ║
- # ╠═══════════════════════════════════════════════════════════════════════════╣
- # ║ KNOWN ISSUES ║
- # ╠═══════════════════════════════════════════════════════════════════════════╣
- # ║ ► None. ║
- # ╠═══════════════════════════════════════════════════════════════════════════╣
- # ║ CHANGE LOG ║
- # ╠═════════════════════════════════════════════════════════════════╤═════════╣
- # ║ ■ March 11, 2015 : Bugfixes. │ (v1.01) ║
- # ╟─────────────────────────────────────────────────────────────────┼─────────╢
- # ║ ■ December 04, 2014 : Initial release. │ (v1.00) ║
- # ╠═════════════════════════════════════════════════════════════════╧═════════╣
- # ║ OVERWRITTEN METHODS ║
- # ╠═══════════════════════════════════════════════════════════════════════════╣
- # ║ This script overwrites a few methods in various default scripts. ║
- # ╟───────────────────────────────────────────────────────────────────────────╢
- # ║ ■ class Game_Party < Game_Unit ║
- # ║ ► def menu_actor_next ║
- # ║ ► def menu_actor_prev ║
- # ╟───────────────────────────────────────────────────────────────────────────╢
- # ║ ■ class Window_MenuStatus < Window_Selectable ║
- # ║ ► def item_max ║
- # ║ ► def draw_item ║
- # ║ ► def process_ok ║
- # ╠═══════════════════════════════════════════════════════════════════════════╣
- # ║ INSTRUCTIONS ║
- # ╠═══════════════════════════════════════════════════════════════════════════╣
- # ║ Simply paste this script anywhere BELOW Window_MenuStatus. If you are ║
- # ║ using this script alongside Yanfly's Party System, place this script ║
- # ║ below it. ║
- # ╠═══════════════════════════════════════════════════════════════════════════╣
- # ║ IMPORT SETTING ║
- # ╚═══════════════════════════════════════════════════════════════════════════╝
- $imported = {} if $imported.nil? # Do not edit
- $imported["WC-BattleMemberRestriction_1.00"] = true # Do not edit
- # ╔═══════════════════════════════════════════════════════════════════════════╗
- # ║ ** Game_Party ║
- # ╟───────────────────────────────────────────────────────────────────────────╢
- # ║ This class handles parties. Information such as gold and items is ║
- # ║ included. Instances of this class are referenced by $game_party. ║
- # ╚═══════════════════════════════════════════════════════════════════════════╝
- class Game_Party < Game_Unit
- # ╔═══════════════════════════════════════════════════════════════════════════╗
- # ║ SELECT NEXT ACTOR ON MENU SCREEN ║
- # ╚═══════════════════════════════════════════════════════════════════════════╝
- def menu_actor_next
- index = battle_members.index(menu_actor) || -1
- index = (index + 1) % battle_members.size
- self.menu_actor = battle_members[index]
- end
- # ╔═══════════════════════════════════════════════════════════════════════════╗
- # ║ SELECT PREVIOUS ACTOR ON MENU SCREEN ║
- # ╚═══════════════════════════════════════════════════════════════════════════╝
- def menu_actor_prev
- index = battle_members.index(menu_actor) || 1
- index = (index + battle_members.size - 1) % battle_members.size
- self.menu_actor = battle_members[index]
- end
- end
- # ╔═══════════════════════════════════════════════════════════════════════════╗
- # ║ ** Window_MenuStatus ║
- # ╟───────────────────────────────────────────────────────────────────────────╢
- # ║ This window displays party member status on the menu screen. ║
- # ╚═══════════════════════════════════════════════════════════════════════════╝
- class Window_MenuStatus < Window_Selectable
- # ╔═══════════════════════════════════════════════════════════════════════════╗
- # ║ GET NUMBER OF ITEMS ║
- # ╚═══════════════════════════════════════════════════════════════════════════╝
- def item_max
- $game_party.battle_members.size
- end
- # ╔═══════════════════════════════════════════════════════════════════════════╗
- # ║ DRAW ITEM ║
- # ╚═══════════════════════════════════════════════════════════════════════════╝
- def draw_item(index)
- actor = $game_party.battle_members[index]
- enabled = $game_party.battle_members.include?(actor)
- rect = item_rect(index)
- draw_item_background(index)
- draw_actor_face(actor, rect.x + 1, rect.y + 1, enabled)
- draw_actor_simple_status(actor, rect.x + 108, rect.y + line_height / 2)
- end
- # ╔═══════════════════════════════════════════════════════════════════════════╗
- # ║ PROCESSING WHEN OK BUTTON IS PRESSED ║
- # ╚═══════════════════════════════════════════════════════════════════════════╝
- def process_ok
- super
- $game_party.menu_actor = $game_party.battle_members[index]
- end
- end
- # ╔═══════════════════════════════════════════════════════════════════════════╗
- # ║ END OF SCRIPT ║
- # ╚═══════════════════════════════════════════════════════════════════════════╝
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement