赞 | 0 |
VIP | 0 |
好人卡 | 1 |
积分 | 7 |
经验 | 15263 |
最后登录 | 2017-5-29 |
在线时间 | 194 小时 |
Lv2.观梦者
- 梦石
- 0
- 星屑
- 665
- 在线时间
- 194 小时
- 注册时间
- 2012-6-1
- 帖子
- 720
|
首先下载一个人物脚本
然后下载一个ACE菜单脚本
在ACE菜单中更改即可
ACE菜单脚本- #==============================================================================
- #
- # ▼ Yanfly Engine Ace - Ace Menu Engine v1.07
- # -- Last Updated: 2012.01.03
- # -- Level: Normal, Hard
- # -- Requires: n/a
- #
- #==============================================================================
- $imported = {} if $imported.nil?
- $imported["YEA-AceMenuEngine"] = true
- #==============================================================================
- # ▼ Updates
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # 2012.01.03 - Compatibility Update: Ace Item Menu
- # 2012.01.01 - Compatibility Update: Kread-EX's Synthesis
- # - Compatibility Update: Kread-EX's Grathnode Install
- # - Compatibility Update: Yami's Slot Battle
- # 2011.12.23 - Script efficiency optimized.
- # 2011.12.19 - Compatibility Update: Class System
- # 2011.12.15 - Updated for better menu MP/TP gauge management.
- # 2011.12.13 - Compatibility Update: Ace Equip Engine
- # 2011.12.07 - Update to allow for switches to also hide custom commands.
- # 2011.12.06 - Started Script and Finished.
- #
- #==============================================================================
- # ▼介绍
- # = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - =
- #菜单系统在游戏制作一起王牌是伟大的。然而,它缺乏用户
- #定制,游戏制作2003允许。与此脚本,您可以添加,
- #删除,并重新排列菜单命令为您认为合适的。此外,你
- #可以添加菜单命令,导致共同的事件或自定义命令
- #
- #这个脚本也提供窗口外观等的管理,设置几乎
- #所有命令为中心对齐或改变立场的
- #帮助窗口。你也可以选择显示总磷计在主菜单等
- #在技能菜单。
- #
- # ==============================================================================
- #▼指令
- # = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - =
- #安装此脚本,打开你的脚本编辑和复制/粘贴此脚本
- #开口槽低于▼材料/素材但▼主。记得保存。
- #
- #编辑设置在模块下面为您认为合适的。
- #
- #==============================================================================
- # ▼ Compatibility
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
- # it will run with RPG Maker VX without adjusting.
- #
- #==============================================================================
- module YEA
- module MENU
-
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- # -通用菜单设置—
- # = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - =—
- #这改变了菜单出现在你的游戏。你可以改变自己
- #对齐,和位置的帮助窗口,请注意,任何non-yanfly
- #ACE脚本引擎可能不符合这些菜单样式。
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- HELP_WINDOW_LOCATION = 0 # 0-Top, 1-Middle, 2-Bottom.
- COMMAND_WINDOW_ALIGN = 1 # 0-Left, 1-Middle, 2-Right.
-
- #这些设置调整的视觉外观的主菜单。
- #更改设置为您认为合适的。
- MAIN_MENU_ALIGN = 0 # 0-Left, 1-Middle, 2-Right.
- MAIN_MENU_RIGHT = false # false-Left, true-Right.
- MAIN_MENU_ROWS = 14 # Maximum number of rows for main menu.
- DRAW_TP_GAUGE = true # If true, draws TP in the main menu.
-
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- # 主菜单设置—
- # = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - = - =—
- #这些设置调整主菜单,命令,命令出现,
- #什么文本显示,而命令与。在这里
- #名单,命令做:
- #
- # -------------------------------------------------------------------------
- # :command 描述
- # -------------------------------------------------------------------------
- # :item 打开项目菜单。默认的菜单项.
- # :skill 打开技能菜单。默认的菜单项.
- # :equip 打开了装备菜单。默认的菜单项.
- # :status 打开状态菜单。默认的菜单项.
- # :formation 让玩家管理方。默认的菜单项.
- # :save 打开保存菜单。默认的菜单项.
- # :game_end 打开了关机菜单。默认的菜单项.
- #
- # :class Requires YEA - Class System
- #
- # :gogototori 需要kread-ex走totori!合成
- # :grathnode 需要kread-ex的grathnote安装
- # :sslots 需要雅美的经理槽战斗
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- COMMANDS =[
- :item, # 打开项目菜单。默认的菜单项目m.
- :skill, # 打开技能菜单。默认的菜单项.
- :equip, # 打开了装备菜单。默认的菜单项.
- :class, # Requires YEA - Class System. # Requires YEA - Class System.
-
- :formation,
- :status, # 打开状态菜单。默认的菜单项.
- #:formation, # 让玩家管理方。默认的菜单项.
- :event_101, # 发射普通事件 101。常见的事件命令.
- :event_102, # 发射普通事件 102. 常见的事件命令.
- :event_103, # 发射普通事件 103. 常见的事件命令.
- :event_104, # 发射普通事件 104. 常见的事件命令.
- :event_105, # 发射普通事件 105. 常见的事件命令.
- :event_106, # 发射普通事件 106. 常见的事件命令.
- :event_107, # 发射普通事件 107. 常见的事件命令.
- :event_108, # 发射普通事件 108. 常见的事件命令.
- :event_109, # 发射普通事件 109. 常见的事件命令.
- :event_110, # 发射普通事件 110. 常见的事件命令.
- :event_111, # 发射普通事件 111. 常见的事件命令.
- :event_112,
-
- # :debug, # 打开调试菜单。自定义命令。
- :shop, # Opens up a shop to pawn items. Custom Command.
- :save,
- :game_end, # 打开了关机菜单。默认的菜单项.
- ] # Do not remove this.
-
- #--------------------------------------------------------------------------
- # - 常见的事件命令s -
- # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- # 如果您插入一个下面的命令到命令阵列,该
- #玩家可以触发一个共同的事件展开。您可以禁用某些
- #命令在菜单绑定到一个开关。如果你不想
- #禁用它们,开关设置,0,它将始终启用。本
- # showswitch将防止命令从如果开关是假的。
- #设定为0,它没有影响。
- #--------------------------------------------------------------------------
- COMMON_EVENT_COMMANDS ={
- # :command => ["Display Name", EnableSwitch, ShowSwitch, Event ID],
- :event_101 => [ "物品图鉴", 0, 0, 101],
- :event_102 => [ "任务", 0, 0, 102],
- } # Do not remove this.
-
- #--------------------------------------------------------------------------
- # - 自定义命令—
- #—————————————————————————————————————
- #为那些谁使用脚本可能导致其他菜单的场景,使用此
- #散列管理自定义命令运行特定的脚本调用。你可以
- #禁用某些命令在菜单绑定到一个开关。如果你
- #不想禁用,开关设置,0。该showswitch会
- #防止命令从如果开关是假的。它集0
- #它有没有影响。
- #--------------------------------------------------------------------------
- CUSTOM_COMMANDS ={
- # :command => ["Display Name", EnableSwitch, ShowSwitch, Handler Method],
- :debug => [ "Debug", 0, 0, :command_debug],
- :formation => ["整队", 0, 0, :command_formation],
- :gogototori => ["合成", 106, 0, :command_totori],
- :grathnode => [ "Grathnode", 0, 0, :command_install],
- } # Do not remove this.
-
- end # MENU
- end # YEA
- #==============================================================================
- # ▼ Editting anything past this point may potentially result in causing
- # computer damage, incontinence, explosion of user's head, coma, death, and/or
- # halitosis so edit at your own risk.
- #==============================================================================
- #==============================================================================
- # ■ Window_MenuCommand
- #------------------------------------------------------------------------------
- # 这个类是保持对榜首的脚本提供更容易获得。
- #==============================================================================
- class Window_MenuCommand < Window_Command
-
- #--------------------------------------------------------------------------
- # overwrite method: make_command_list
- #--------------------------------------------------------------------------
- def make_command_list
- for command in YEA::MENU::COMMANDS
- case command
- #--- Default Commands ---
- when :item
- add_command(Vocab::item, :item, main_commands_enabled)
- when :skill
- add_command(Vocab::skill, :skill, main_commands_enabled)
- when :equip
- add_command(Vocab::equip, :equip, main_commands_enabled)
- when :status
- add_command(Vocab::status, :status, main_commands_enabled)
- when :formation
- add_formation_command
- when :save
- add_original_commands
- add_save_command
- when :game_end
- add_game_end_command
- #--- Yanfly Engine Ace Commands ---
- when :class
- next unless $imported["YEA-ClassSystem"]
- add_class_command
- #--- Imported Commands ---
- when :sslots
- next unless $imported["YSA-SlotBattle"]
- add_sslots_command
- when :grathnode
- next unless $imported["KRX-GrathnodeInstall"]
- process_custom_command(command)
- when :gogototori
- next unless $imported["KRX-AlchemicSynthesis"]
- process_custom_command(command)
- #--- Imported Commands ---
- else
- process_common_event_command(command)
- process_custom_command(command)
- end
- end
- end
-
- #--------------------------------------------------------------------------
- # new method: process_common_event_command
- #--------------------------------------------------------------------------
- def process_common_event_command(command)
- return unless YEA::MENU::COMMON_EVENT_COMMANDS.include?(command)
- show = YEA::MENU::COMMON_EVENT_COMMANDS[command][2]
- continue = show <= 0 ? true : $game_switches[show]
- return unless continue
- text = YEA::MENU::COMMON_EVENT_COMMANDS[command][0]
- switch = YEA::MENU::COMMON_EVENT_COMMANDS[command][1]
- ext = YEA::MENU::COMMON_EVENT_COMMANDS[command][3]
- enabled = switch <= 0 ? true : $game_switches[switch]
- add_command(text, command, enabled, ext)
- end
-
- #--------------------------------------------------------------------------
- # new method: process_custom_command
- #--------------------------------------------------------------------------
- def process_custom_command(command)
- return unless YEA::MENU::CUSTOM_COMMANDS.include?(command)
- show = YEA::MENU::CUSTOM_COMMANDS[command][2]
- continue = show <= 0 ? true : $game_switches[show]
- return unless continue
- text = YEA::MENU::CUSTOM_COMMANDS[command][0]
- switch = YEA::MENU::CUSTOM_COMMANDS[command][1]
- enabled = switch <= 0 ? true : $game_switches[switch]
- add_command(text, command, enabled)
- end
-
- end # Window_MenuCommand
- #==============================================================================
- # ■ Menu
- #==============================================================================
- module Menu
-
- #--------------------------------------------------------------------------
- # self.help_window_location
- #--------------------------------------------------------------------------
- def self.help_window_location
- return YEA::MENU::HELP_WINDOW_LOCATION
- end
-
- #--------------------------------------------------------------------------
- # self.command_window_align
- #--------------------------------------------------------------------------
- def self.command_window_align
- return YEA::MENU::COMMAND_WINDOW_ALIGN
- end
-
- #--------------------------------------------------------------------------
- # self.main_menu_align
- #--------------------------------------------------------------------------
- def self.main_menu_align
- return YEA::MENU::MAIN_MENU_ALIGN
- end
-
- #--------------------------------------------------------------------------
- # self.main_menu_right
- #--------------------------------------------------------------------------
- def self.main_menu_right
- return YEA::MENU::MAIN_MENU_RIGHT
- end
-
- end # Menu
- #==============================================================================
- # ■ Game_Actor
- #==============================================================================
- class Game_Actor < Game_Battler
-
- #--------------------------------------------------------------------------
- # new method: draw_mp?
- #--------------------------------------------------------------------------
- def draw_mp?
- return true unless draw_tp?
- for skill in skills
- next unless added_skill_types.include?(skill.stype_id)
- return true if skill.mp_cost > 0
- end
- return false
- end
-
- #--------------------------------------------------------------------------
- # new method: draw_tp?
- #--------------------------------------------------------------------------
- def draw_tp?
- return false unless $data_system.opt_display_tp
- for skill in skills
- next unless added_skill_types.include?(skill.stype_id)
- return true if skill.tp_cost > 0
- end
- return false
- end
-
- end # Game_Actor
- #==============================================================================
- # ■ Window_Base
- #==============================================================================
- class Window_Base < Window
-
- #--------------------------------------------------------------------------
- # overwrite method: draw_actor_simple_status
- #--------------------------------------------------------------------------
- def draw_actor_simple_status(actor, dx, dy)
- dy -= line_height / 2
- draw_actor_name(actor, dx, dy)
- draw_actor_level(actor, dx, dy + line_height * 1)
- draw_actor_icons(actor, dx, dy + line_height * 2)
- dw = contents.width - dx - 124
- draw_actor_class(actor, dx + 120, dy, dw)
- draw_actor_hp(actor, dx + 120, dy + line_height * 1, dw)
- if YEA::MENU::DRAW_TP_GAUGE && actor.draw_tp? && !actor.draw_mp?
- draw_actor_tp(actor, dx + 120, dy + line_height * 2, dw)
- elsif YEA::MENU::DRAW_TP_GAUGE && actor.draw_tp? && actor.draw_mp?
- if $imported["YEA-BattleEngine"]
- draw_actor_tp(actor, dx + 120, dy + line_height * 2, dw/2 + 1)
- draw_actor_mp(actor, dx + 120 + dw/2, dy + line_height * 2, dw/2)
- else
- draw_actor_mp(actor, dx + 120, dy + line_height * 2, dw/2 + 1)
- draw_actor_tp(actor, dx + 120 + dw/2, dy + line_height * 2, dw/2)
- end
- else
- draw_actor_mp(actor, dx + 120, dy + line_height * 2, dw)
- end
- end
-
- end # Window_Base
- #==============================================================================
- # ■ Window_Command
- #==============================================================================
- class Window_Command < Window_Selectable
-
- #--------------------------------------------------------------------------
- # overwrite method: alignment
- #--------------------------------------------------------------------------
- def alignment
- return Menu.command_window_align
- end
-
- end # Window_Command
- #==============================================================================
- # ■ Window_MenuCommand
- #==============================================================================
- class Window_MenuCommand < Window_Command
-
- #--------------------------------------------------------------------------
- # alias method: init_command_position
- #--------------------------------------------------------------------------
- class <<self; alias init_command_position_ame init_command_position; end
- def self.init_command_position
- init_command_position_ame
- @@last_command_oy = nil
- end
-
- #--------------------------------------------------------------------------
- # overwrite method: visible_line_number
- #--------------------------------------------------------------------------
- def visible_line_number
- return [[item_max, YEA::MENU::MAIN_MENU_ROWS].min, 1].max
- end
-
- #--------------------------------------------------------------------------
- # overwrite method: alignment
- #--------------------------------------------------------------------------
- def alignment
- return Menu.main_menu_align
- end
-
- #--------------------------------------------------------------------------
- # alias method: process_ok
- #--------------------------------------------------------------------------
- alias window_menucommand_process_ok_ame process_ok
- def process_ok
- @@last_command_oy = self.oy
- window_menucommand_process_ok_ame
- end
-
- #--------------------------------------------------------------------------
- # alias method: select_last
- #--------------------------------------------------------------------------
- alias window_menucommand_select_last_ame select_last
- def select_last
- window_menucommand_select_last_ame
- self.oy = @@last_command_oy unless @@last_command_oy.nil?
- @@last_command_oy = nil
- end
-
- end # Window_MenuCommand
- #==============================================================================
- # ■ Scene_Menu
- #==============================================================================
- class Scene_Menu < Scene_MenuBase
-
- #--------------------------------------------------------------------------
- # alias method: start
- #--------------------------------------------------------------------------
- alias scene_menu_start_ame start
- def start
- scene_menu_start_ame
- relocate_windows
- end
-
- #--------------------------------------------------------------------------
- # new method: relocate_windows
- #--------------------------------------------------------------------------
- def relocate_windows
- return unless Menu.main_menu_right
- @command_window.x = Graphics.width - @command_window.width
- @gold_window.x = Graphics.width - @gold_window.width
- @status_window.x = 0
- end
-
- def return_scene
- $game_map.autoplay
- SceneManager.return
- end
-
- end # Scene_Menu
- #==============================================================================
- # ■ Scene_Item
- #==============================================================================
- class Scene_Item < Scene_ItemBase
-
- #--------------------------------------------------------------------------
- # alias method: start
- #--------------------------------------------------------------------------
- alias scene_item_start_ame start
- def start
- scene_item_start_ame
- return if $imported["YEA-ItemMenu"]
- relocate_windows
- end
-
- #--------------------------------------------------------------------------
- # new method: relocate_windows
- #--------------------------------------------------------------------------
- def relocate_windows
- case Menu.help_window_location
- when 0 # Top
- @help_window.y = 0
- @category_window.y = @help_window.height
- @item_window.y = @category_window.y + @category_window.height
- when 1 # Middle
- @category_window.y = 0
- @help_window.y = @category_window.height
- @item_window.y = @help_window.y + @help_window.height
- else # Bottom
- @category_window.y = 0
- @item_window.y = @category_window.height
- @help_window.y = @item_window.y + @item_window.height
- end
- if $imported["YEA-ItemMenu"]
- @types_window.y = @category_window.y
- @status_window.y = @category_window.y
- end
- end
-
- end # Scene_Item
- #==============================================================================
- # ■ Scene_Skill
- #==============================================================================
- class Scene_Skill < Scene_ItemBase
-
- #--------------------------------------------------------------------------
- # alias method: start
- #--------------------------------------------------------------------------
- alias scene_skill_start_ame start
- def start
- scene_skill_start_ame
- relocate_windows
- end
-
- #--------------------------------------------------------------------------
- # new method: relocate_windows
- #--------------------------------------------------------------------------
- def relocate_windows
- case Menu.help_window_location
- when 0 # Top
- @help_window.y = 0
- @command_window.y = @help_window.height
- @status_window.y = @help_window.height
- @item_window.y = @status_window.y + @status_window.height
- when 1 # Middle
- @command_window.y = 0
- @status_window.y = 0
- @help_window.y = @status_window.y + @status_window.height
- @item_window.y = @help_window.y + @help_window.height
- else # Bottom
- @command_window.y = 0
- @status_window.y = 0
- @item_window.y = @status_window.y + @status_window.height
- @help_window.y = @item_window.y + @item_window.height
- end
- end
-
- end # Scene_Skill
- #==============================================================================
- # ■ Scene_Equip
- #==============================================================================
- class Scene_Equip < Scene_MenuBase
-
- #--------------------------------------------------------------------------
- # alias method: start
- #--------------------------------------------------------------------------
- alias scene_equip_start_ame start
- def start
- scene_equip_start_ame
- relocate_windows
- relocate_aee_windows
- end
-
- #--------------------------------------------------------------------------
- # new method: relocate_windows
- #--------------------------------------------------------------------------
- def relocate_windows
- return if $imported["YEA-AceEquipEngine"]
- case Menu.help_window_location
- when 0 # Top
- @help_window.y = 0
- @status_window.y = @help_window.height
- @command_window.y = @help_window.height
- @slot_window.y = @command_window.y + @command_window.height
- @item_window.y = @slot_window.y + @slot_window.height
- when 1 # Middle
- @status_window.y = 0
- @command_window.y = 0
- @slot_window.y = @command_window.y + @command_window.height
- @help_window.y = @slot_window.y + @slot_window.height
- @item_window.y = @help_window.y + @help_window.height
- else # Bottom
- @status_window.y = 0
- @command_window.y = 0
- @slot_window.y = @command_window.y + @command_window.height
- @item_window.y = @slot_window.y + @slot_window.height
- @help_window.y = @item_window.y + @item_window.height
- end
- end
-
- #--------------------------------------------------------------------------
- # new method: relocate_aee_windows
- #--------------------------------------------------------------------------
- def relocate_aee_windows
- return unless $imported["YEA-AceEquipEngine"]
- case Menu.help_window_location
- when 0 # Top
- @help_window.y = 0
- @command_window.y = @help_window.height
- @slot_window.y = @command_window.y + @command_window.height
- when 1 # Middle
- @command_window.y = 0
- @help_window.y = @command_window.height
- @slot_window.y = @help_window.y + @help_window.height
- else # Bottom
- @command_window.y = 0
- @slot_window.y = @command_window.height
- @help_window.y = @slot_window.y + @slot_window.height
- end
- @actor_window.y = @command_window.y
- @item_window.y = @slot_window.y
- @status_window.y = @slot_window.y
- end
-
- end # Scene_Equip
- #==============================================================================
- # ■ Scene_Menu
- #==============================================================================
- class Scene_Menu < Scene_MenuBase
-
- #--------------------------------------------------------------------------
- # alias method: create_command_window
- #--------------------------------------------------------------------------
- alias scene_menu_create_command_window_ame create_command_window
- def create_command_window
- scene_menu_create_command_window_ame
- process_common_event_commands
- process_custom_commands
- end
-
- #--------------------------------------------------------------------------
- # new method: process_common_event_commands
- #--------------------------------------------------------------------------
- def process_common_event_commands
- for command in YEA::MENU::COMMANDS
- next unless YEA::MENU::COMMON_EVENT_COMMANDS.include?(command)
- @command_window.set_handler(command, method(:command_common_event))
- end
- end
-
- #--------------------------------------------------------------------------
- # new method: command_common_event
- #--------------------------------------------------------------------------
- def command_common_event
- event_id = @command_window.current_ext
- return return_scene if event_id.nil?
- return return_scene if $data_common_events[event_id].nil?
- $game_temp.reserve_common_event(event_id)
- return_scene
- end
-
- #--------------------------------------------------------------------------
- # new method: process_custom_commands
- #--------------------------------------------------------------------------
- def process_custom_commands
- for command in YEA::MENU::COMMANDS
- next unless YEA::MENU::CUSTOM_COMMANDS.include?(command)
- called_method = YEA::MENU::CUSTOM_COMMANDS[command][3]
- @command_window.set_handler(command, method(called_method))
- end
- end
-
- #--------------------------------------------------------------------------
- # new method: command_debug
- #--------------------------------------------------------------------------
- def command_debug
- SceneManager.call(Scene_Debug)
- end
-
- #--------------------------------------------------------------------------
- # new method: command_shop
- #--------------------------------------------------------------------------
- def command_shop
- goods = []
- SceneManager.call(Scene_Shop)
- SceneManager.scene.prepare(goods, false)
- end
-
- #--------------------------------------------------------------------------
- # new method: command_totori
- #--------------------------------------------------------------------------
- def command_totori
- return unless $imported['KRX-AlchemicSynthesis']
- SceneManager.call(Scene_Alchemy)
- end
-
- end # Scene_Menu
- #==============================================================================
- #
- # ▼ End of File
- #
- #==============================================================================
复制代码 下面放上任务脚- =begin
- 领取任务:$game_party.get_task(任意数字,任务名称,任务描述)
- 完成任务:$game_party.finish_task(领取任务时设定的数字)
- 对已有任务追加说明:$game_party.add_task(任务编号,任务追加描述)
- 如:
- 前面有事件$game_party.get_task(1,"测试","只是测试")
- 此时任务1的说明为
- >只是测试
- 后面完成任务的脚本就是$game_party.finish_task(1)
- 追加说明$game_party.add_task(1,"真的只是测试哦")
- 此时任务1的说明为:
- >只是测试
- >真的只是测试哦
- 召唤任务界面:SceneManager.call(Scene_Task)
- 该脚本来自66rpg,发布者:韩云溪
- 改进:工藤由纪(论坛ID:zyyczp)
- =end
- #===========================================================
- #●任务系统
- #===========================================================
- class Task
- attr_reader :desc
- attr_reader :finished
- def initialize(origin_name,desc)
- @origin_name = origin_name
- @desc = desc
- @finished = false
- end
- def name
- if @finished
- return @origin_name + "(完成)"
- else
- return @origin_name
- end
- end
- def desc=(desc)
- @desc = desc
- end
-
- def finish
- @finished = true
- end
-
- end
- class Game_Party < Game_Unit
- alias old_init initialize
- def initialize
- old_init
- @tasks = {}
- end
- def add_task(i,desc)
- @tasks[i].desc = @tasks[i].desc + "\n" + desc
- end
- def get_task(i,name,desc)
- @tasks[i]=Task.new(name,desc)
- end
- def have_task?(i)
- @tasks[i] != nil
- end
- def finish_task(i)
- @tasks[i].finish if have_task?(i)
- end
- def unfinished_tasks
- n = []
- for i in @tasks.values
- next if i.finished
- n.push(i)
- end
- return n
- end
- def finished_tasks
- n = []
- for i in @tasks.values
- next unless i.finished
- n.push(i)
- end
- return n
- end
- end
- class Window_Task_Type < Window_HorzCommand
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0)
- activate
- end
- def window_width
- return Graphics.width
- end
- def col_max
- return 3
- end
- #--------------------------------------------------------------------------
- # ● コマンドリストの作成
- #--------------------------------------------------------------------------
- def make_command_list
- add_command("未完成任务", :unfinished_task)
- add_command("已完成任务", :finished_task)
- add_command("取消", :cancel)
- end
- end
- class Window_TaskLeft < Window_Selectable
- attr_reader :finished
- def initialize
- super(0,48,160,Graphics.height - 48)
- create_contents
- @finished = false
- @index = 0
- refresh
- deactivate
- end
- def set_finish(finish)
- @finished = finish
- set_item_max
- end
- def item_max
- return @item_max != nil ? @item_max : 0
- end
- def set_item_max
- if @finished
- @item_max = $game_party.finished_tasks.size
- else
- @item_max = $game_party.unfinished_tasks.size
- end
- end
- def refresh
- set_item_max
- super
- end
- #--------------------------------------------------------------------------
- # ● 項目の描画
- #--------------------------------------------------------------------------
- def draw_item(index)
- text = ""
- unless @finished
- if $game_party.unfinished_tasks[index] != nil
- text = $game_party.unfinished_tasks[index].name
- end
- else
- if $game_party.finished_tasks[index] != nil
- text = $game_party.finished_tasks[index].name
- end
- end
- draw_text(item_rect_for_text(index), text)
- end
- end
- class Window_TaskRight < Window_Base
- attr_reader :left_index
- def initialize
- super(160,48,Graphics.width - 160,Graphics.height - 48)
- create_contents
- @left_index = 0
- @finished = false
- refresh
- end
- def set_index(i)
- @left_index = i
- refresh
- end
- def set_finish(i)
- @finished = i
- end
-
- def refresh
- contents.clear
- draw_desc
- end
- def draw_desc
- if @finished
- if $game_party.finished_tasks[@left_index] != nil
- draw_text_ex(0,0,$game_party.finished_tasks[@left_index].desc)
- end
- else
- if $game_party.unfinished_tasks[@left_index] != nil
- draw_text_ex(0,0,$game_party.unfinished_tasks[@left_index].desc)
- end
- end
- end
-
- end
- class Scene_Task < Scene_Base
- def start
- super
- create_task_type_window
- create_left_window
- create_right_window
- end
- def update
- super
- if @left_window.active
- if Input.trigger?(:B)
- @left_window.deactivate
- @task_type_window.activate
- end
- if Input.trigger?(:UP) || Input.trigger?(:DOWN)
- @right_window.set_finish(@left_window.finished)
- @right_window.set_index(@left_window.index)
- end
- end
- end
-
- def terminate
- super
- end
- def create_task_type_window
- @task_type_window = Window_Task_Type.new
- @task_type_window.set_handler(:unfinished_task,method(:view_unfinished_task))
- @task_type_window.set_handler(:finished_task,method(:view_finished_task))
- @task_type_window.set_handler(:cancel,method(:return_scene))
- end
- def create_left_window
- @left_window = Window_TaskLeft.new
- @left_window.set_finish(false)
- @left_window.refresh
- end
- def create_right_window
- @right_window = Window_TaskRight.new
- @right_window.refresh
- end
- def view_unfinished_task
- @left_window.set_finish(false)
- @left_window.refresh
- @left_window.activate
- @task_type_window.deactivate
- @right_window.set_finish(false)
- @right_window.set_index(@left_window.index)
- end
- def view_finished_task
- @left_window.set_finish(true)
- @left_window.refresh
- @left_window.activate
- @task_type_window.deactivate
- @right_window.set_finish(true)
- @right_window.set_index(@left_window.index)
- end
-
- end
复制代码 |
|