赞 | 0 |
VIP | 6 |
好人卡 | 0 |
积分 | 1 |
经验 | 63789 |
最后登录 | 2017-9-7 |
在线时间 | 12 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 12 小时
- 注册时间
- 2006-5-21
- 帖子
- 773
|
基本完成了...
描绘图标的那个窗口的一个细节卡了我好久,= =
脚本直接插入,我用你的版本修改的,应该没有问题.
- #==============================================================================
- # ■ Scene_Menu
- #------------------------------------------------------------------------------
- # 处理菜单画面的类。
- #==============================================================================
- class Scene_Menu < Scene_Base
- #--------------------------------------------------------------------------
- # ● 初始化对象
- # menu_index : 指令光标初期位置
- #--------------------------------------------------------------------------
- def initialize(menu_index = 0)
- @menu_index = menu_index
- end
- #--------------------------------------------------------------------------
- # ● 开始处理
- #--------------------------------------------------------------------------
- def start
- super
- create_menu_background
- @sprite = Sprite.new
- @sprite.bitmap = Cache.system("title")
- create_command_window
- end
- #--------------------------------------------------------------------------
- # ● 结束处理
- #--------------------------------------------------------------------------
- def terminate
- super
- dispose_menu_background
- @sprite.dispose
- @command_window.dispose
- end
- #--------------------------------------------------------------------------
- # ● 更新画面
- #--------------------------------------------------------------------------
- def update
- super
- update_menu_background
- @sprite.update
- @command_window.update
- update_command_selection
- end
- #--------------------------------------------------------------------------
- # ● 生成指令窗口
- #--------------------------------------------------------------------------
- def create_command_window
- s1 = Vocab::status
- s2 = Vocab::item
- s3 = Vocab::equip
- s4 = Vocab::skill
- s5 = "读日记"
- s6 = Vocab::save
- s7 = Vocab::game_end
- @command_window = Window_Command.new(460, [s1, s2, s3, s4, s5, s6, s7],7,1,7)
- @command_window.x = 42
- @command_window.y = 176
- @command_window.index = @menu_index
- if $game_party.members.size == 0 # 同伴人数为 0 的情况下
- @command_window.draw_item(0, false) # 物品无效化
- @command_window.draw_item(1, false) # 特技无效化
- @command_window.draw_item(2, false) # 装备无效化
- @command_window.draw_item(3, false) # 状态无效化
- end
- if $game_system.save_disabled # 禁止存档的情况下
- @command_window.draw_item(5, false) # 存档无效化
- end
- end
- #--------------------------------------------------------------------------
- # ● 更新指令选择
- #--------------------------------------------------------------------------
- def update_command_selection
- if Input.trigger?(Input::B)
- Sound.play_cancel
- $scene = Scene_Map.new
- elsif Input.trigger?(Input::C)
- if $game_party.members.size == 0 and @command_window.index < 4
- Sound.play_buzzer
- return
- elsif $game_system.save_disabled and @command_window.index == 4
- Sound.play_buzzer
- return
- end
- Sound.play_decision
- case @command_window.index
- when 0
- $scene = Scene_Status.new(0)
- when 1
- $scene = Scene_Item.new
- when 2
- $scene = Scene_Equip.new(0)
- when 3
- $scene = Scene_Skill.new(0)
- when 4
- $scene = Scene_File.new(false, false, false)
- when 5
- $scene = Scene_File.new(true, false, false)
- when 6
- $scene = Scene_End.new
- end
- end
- end
- end
- class Window_Base
- def draw_actor_hp(actor, x, y, width = 120)
- draw_actor_hp_gauge(actor, x, y, width)
- self.contents.font.color = system_color
- self.contents.draw_text(x, y, 64, WLH, Vocab::hp_a)
- self.contents.font.color = hp_color(actor)
- xr = x + width
- if width < 120
- self.contents.draw_text(xr - 40, y, 40, WLH, actor.hp, 2)
- else
- self.contents.draw_text(xr - 90, y, 40, WLH, actor.hp, 2)
- self.contents.font.color = normal_color
- self.contents.draw_text(xr - 50, y, 10, WLH, "/", 2)
- self.contents.draw_text(xr - 40, y, 40, WLH, actor.maxhp, 2)
- end
- end
- def draw_actor_mp(actor, x, y, width = 120)
- draw_actor_mp_gauge(actor, x, y, width)
- self.contents.font.color = system_color
- self.contents.draw_text(x, y, 64, WLH, Vocab::mp_a)
- self.contents.font.color = mp_color(actor)
- xr = x + width
- if width < 120
- self.contents.draw_text(xr - 40, y, 40, WLH, actor.mp, 2)
- else
- self.contents.draw_text(xr - 90, y, 40, WLH, actor.mp, 2)
- self.contents.font.color = normal_color
- self.contents.draw_text(xr - 50, y, 10, WLH, "/", 2)
- self.contents.draw_text(xr - 40, y, 40, WLH, actor.maxmp, 2)
- end
- end
- def draw_actor_level(actor, x, y)
- self.contents.font.color = system_color
- self.contents.draw_text(x, y, 64, WLH, Vocab::level_a)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 64, y, 24, WLH, actor.level, 2)
- end
- def draw_item_name_noicon(item, x, y, enabled = true)
- if item != nil
- self.contents.font.color = normal_color
- self.contents.font.color.alpha = enabled ? 255 : 128
- self.contents.draw_text(x, y, 172, WLH, item.name)
- end
- end
- end
- #==============================================================================
- # ■ Window_Status
- #------------------------------------------------------------------------------
- # 显示状态画面、完全规格的状态窗口。
- #==============================================================================
- class Window_Status < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对象
- # actor : 角色
- #--------------------------------------------------------------------------
- def initialize(actor)
- super(0, 0, 544, 416)
- @actor = actor
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- draw_actor_name(@actor, 128, 32)
- draw_actor_face(@actor, 8, 8)
- draw_basic_info(128, 64)
- draw_parameters(128, 160)
- draw_equipments(8, 260)
- end
- #--------------------------------------------------------------------------
- # ● 描绘基本信息
- # x : 描绘目标 X 坐标
- # y : 描绘目标 Y 坐标
- #--------------------------------------------------------------------------
- def draw_basic_info(x, y)
- draw_actor_level(@actor, x, y + WLH * 0)
- draw_actor_hp(@actor, x, y + WLH * 2, 160)
- draw_actor_mp(@actor, x, y + WLH * 3, 160)
- end
- #--------------------------------------------------------------------------
- # ● 描绘能力值
- # x : 描绘目标 X 坐标
- # y : 描绘目标 Y 坐标
- #--------------------------------------------------------------------------
- def draw_parameters(x, y)
- draw_actor_parameter(@actor, x, y + WLH * 0, 0)
- draw_actor_parameter(@actor, x, y + WLH * 1, 1)
- draw_actor_parameter(@actor, x, y + WLH * 2, 2)
- draw_actor_parameter(@actor, x, y + WLH * 3, 3)
- end
- #--------------------------------------------------------------------------
- # ● 描绘装备品
- # x : 描绘目标 X 坐标
- # y : 描绘目标 Y 坐标
- #--------------------------------------------------------------------------
- def draw_equipments(x, y)
- self.contents.font.color = system_color
- self.contents.draw_text(x, y, 120, WLH, Vocab::armor2)
- self.contents.draw_text(x + 160, y, 120, WLH, Vocab::armor3)
- self.contents.draw_text(x + 160*2, y, 120, WLH, Vocab::armor4)
- for i in 2..4
- draw_item_name(@actor.equips[i], x + 16 + (i-2)*160, y + WLH)
- end
- self.contents.font.color = system_color
- self.contents.draw_text(x, y + WLH * 2, 120, WLH, Vocab::weapon)
- self.contents.draw_text(x + 160, y + WLH * 2, 120, WLH, Vocab::armor1)
- for i in 0..1
- draw_item_name(@actor.equips[i], x + 16 + i*160, y + WLH * 3)
- end
- end
- end
- #==============================================================================
- # ■ Scene_Equip
- #------------------------------------------------------------------------------
- # 处理装备画面
- #==============================================================================
- class Scene_Equip < Scene_Base
- #--------------------------------------------------------------------------
- # ● 常量
- #--------------------------------------------------------------------------
- EQUIP_TYPE_MAX = 5 # 装备部位数
- #--------------------------------------------------------------------------
- # ● 初始化对象
- # actor_index : 角色索引
- # equip_index : 装备索引
- #--------------------------------------------------------------------------
- def initialize(actor_index = 0, equip_index = 0)
- @actor_index = actor_index
- @equip_index = equip_index
- end
- #--------------------------------------------------------------------------
- # ● 开始处理
- #--------------------------------------------------------------------------
- def start
- super
- create_menu_background
- @actor = $game_party.members[@actor_index]
- @help_window = Window_Help.new(0,360)
- create_item_windows
- @equipicon_window = Window_Base.new(0,0,132,152)
- @equipicon_window.contents = Bitmap.new(@equipicon_window.width - 32,
- @equipicon_window.height - 32)
- @equip_window = Window_Equip.new(312, 0, @actor)
- @equip_window.help_window = @help_window
- @equip_window.index = @equip_index
- @status_window = Window_EquipStatus.new(132, 0, @actor)
- end
- #--------------------------------------------------------------------------
- # ● 结束处理
- #--------------------------------------------------------------------------
- def terminate
- super
- dispose_menu_background
- @equipicon_window.dispose
- @help_window.dispose
- @equip_window.dispose
- @status_window.dispose
- dispose_item_windows
- end
- #--------------------------------------------------------------------------
- # ● 返回原来的画面
- #--------------------------------------------------------------------------
- def return_scene
- $scene = Scene_Menu.new(2)
- end
- #--------------------------------------------------------------------------
- # ● 切换至下一名角色的画面
- #--------------------------------------------------------------------------
- def next_actor
- @actor_index += 1
- @actor_index %= $game_party.members.size
- $scene = Scene_Equip.new(@actor_index, @equip_window.index)
- end
- #--------------------------------------------------------------------------
- # ● 切换至上一名角色的画面
- #--------------------------------------------------------------------------
- def prev_actor
- @actor_index += $game_party.members.size - 1
- @actor_index %= $game_party.members.size
- $scene = Scene_Equip.new(@actor_index, @equip_window.index)
- end
- #--------------------------------------------------------------------------
- # ● 更新画面
- #--------------------------------------------------------------------------
- def update
- super
-
- def item
- return @data[@equip_window.index]
- end
- @data = []
- for item in @actor.equips do @data.push(item) end
-
- update_menu_background
- @help_window.update
- update_equip_window
- update_status_window
- update_item_windows
- if @equip_window.active
- case @equip_window.index
- when 0
- @equipicon_window.contents.clear
- @equipicon_window.draw_icon(@data[0].icon_index,
- (@equipicon_window.width-56)/2, (@equipicon_window.height-56)/2)
- when 1
- @equipicon_window.contents.clear
- @equipicon_window.draw_icon(@data[1].icon_index,
- (@equipicon_window.width-56)/2, (@equipicon_window.height-56)/2)
- when 2
- @equipicon_window.contents.clear
- @equipicon_window.draw_icon(@data[2].icon_index,
- (@equipicon_window.width-56)/2, (@equipicon_window.height-56)/2)
- when 3
- @equipicon_window.contents.clear
- @equipicon_window.draw_icon(@data[3].icon_index,
- (@equipicon_window.width-56)/2, (@equipicon_window.height-56)/2)
- when 4
- @equipicon_window.contents.clear
- @equipicon_window.draw_icon(@data[4].icon_index,
- (@equipicon_window.width-56)/2, (@equipicon_window.height-56)/2)
- end
- update_equip_selection
- elsif @item_window.active
- @equipicon_window.contents.clear
- if @item_window.item != nil
- @equipicon_window.draw_icon(@item_window.item.icon_index,
- (@equipicon_window.width-56)/2, (@equipicon_window.height-56)/2)
- end
- update_item_selection
- end
- end
- #--------------------------------------------------------------------------
- # ● 生成物品窗口
- #--------------------------------------------------------------------------
- def create_item_windows
- @item_windows = []
- for i in 0...EQUIP_TYPE_MAX
- @item_windows[i] = Window_EquipItem.new(0, 152, 544, 208, @actor, i)
- @item_windows[i].help_window = @help_window
- @item_windows[i].visible = (@equip_index == i)
- @item_windows[i].height = 208
- @item_windows[i].active = false
- @item_windows[i].index = -1
- end
- end
- #--------------------------------------------------------------------------
- # ● 释放物品窗口
- #--------------------------------------------------------------------------
- def dispose_item_windows
- for window in @item_windows
- window.dispose
- end
- end
- #--------------------------------------------------------------------------
- # ● 更新物品窗口
- #--------------------------------------------------------------------------
- def update_item_windows
- for i in 0...EQUIP_TYPE_MAX
- @item_windows[i].visible = (@equip_window.index == i)
- @item_windows[i].update
- end
- @item_window = @item_windows[@equip_window.index]
- end
- #--------------------------------------------------------------------------
- # ● 更新装备窗口
- #--------------------------------------------------------------------------
- def update_equip_window
- @equip_window.update
- end
- #--------------------------------------------------------------------------
- # ● 更新状态窗口
- #--------------------------------------------------------------------------
- def update_status_window
- if @equip_window.active
- @status_window.set_new_parameters(nil, nil, nil, nil)
- elsif @item_window.active
- temp_actor = @actor.clone
- temp_actor.change_equip(@equip_window.index, @item_window.item, true)
- new_atk = temp_actor.atk
- new_def = temp_actor.def
- new_spi = temp_actor.spi
- new_agi = temp_actor.agi
- @status_window.set_new_parameters(new_atk, new_def, new_spi, new_agi)
- end
- @status_window.update
- end
- #--------------------------------------------------------------------------
- # ● 更新选择装备部位
- #--------------------------------------------------------------------------
- def update_equip_selection
- if Input.trigger?(Input::B)
- Sound.play_cancel
- return_scene
- elsif Input.trigger?(Input::R)
- Sound.play_cursor
- next_actor
- elsif Input.trigger?(Input::L)
- Sound.play_cursor
- prev_actor
- elsif Input.trigger?(Input::C)
- if @actor.fix_equipment
- Sound.play_buzzer
- else
- Sound.play_decision
- @equip_window.active = false
- @item_window.active = true
- @item_window.index = 0
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 更新选择物品
- #--------------------------------------------------------------------------
- def update_item_selection
- if Input.trigger?(Input::B)
- Sound.play_cancel
- @equip_window.active = true
- @item_window.active = false
- @item_window.index = -1
- elsif Input.trigger?(Input::C)
- Sound.play_equip
- @actor.change_equip(@equip_window.index, @item_window.item)
- @equip_window.active = true
- @item_window.active = false
- @item_window.index = -1
- @equip_window.refresh
- for item_window in @item_windows
- item_window.refresh
- end
- end
- end
- end
- #==============================================================================
- # ■ Window_Equip
- #------------------------------------------------------------------------------
- # 装备画面、显示角色现在装备的物品的窗口。
- #==============================================================================
- class Window_Equip < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 初始化对象
- # x : 窗口的 X 坐标
- # y : 窗口的 Y 坐标
- # actor : 角色
- #--------------------------------------------------------------------------
- def initialize(x, y, actor)
- super(x, y, 232, WLH * 5 + 32)
- @actor = actor
- refresh
- self.index = 0
- end
- #--------------------------------------------------------------------------
- # ● 获取物品
- #--------------------------------------------------------------------------
- def item
- return @data[self.index]
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- @data = []
- for item in @actor.equips do @data.push(item) end
- @item_max = @data.size
- self.contents.font.color = system_color
- if @actor.two_swords_style
- self.contents.draw_text(4, WLH * 0, 92, WLH, Vocab::weapon1)
- self.contents.draw_text(4, WLH * 1, 92, WLH, Vocab::weapon2)
- else
- self.contents.draw_text(4, WLH * 0, 92, WLH, Vocab::weapon)
- self.contents.draw_text(4, WLH * 1, 92, WLH, Vocab::armor1)
- end
- self.contents.draw_text(4, WLH * 2, 92, WLH, Vocab::armor2)
- self.contents.draw_text(4, WLH * 3, 92, WLH, Vocab::armor3)
- self.contents.draw_text(4, WLH * 4, 92, WLH, Vocab::armor4)
- draw_item_name_noicon(@data[0], 72, WLH * 0)
- draw_item_name_noicon(@data[1], 72, WLH * 1)
- draw_item_name_noicon(@data[2], 72, WLH * 2)
- draw_item_name_noicon(@data[3], 72, WLH * 3)
- draw_item_name_noicon(@data[4], 72, WLH * 4)
- end
- #--------------------------------------------------------------------------
- # ● 更新帮助文本
- #--------------------------------------------------------------------------
- def update_help
- @help_window.set_text(item == nil ? "" : item.description)
- end
- end
- #==============================================================================
- # ■ Window_EquipStatus
- #------------------------------------------------------------------------------
- # 装备画面、显示角色能力值变化的窗口。
- #==============================================================================
- class Window_EquipStatus < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对象
- # x : 窗口的 X 坐标
- # y : 窗口的 Y 坐标
- # actor : 角色
- #--------------------------------------------------------------------------
- def initialize(x, y, actor)
- super(x, y, 180, WLH * 5 + 32)
- @actor = actor
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- draw_actor_name(@actor, 4, 0)
- draw_parameter(0, WLH * 1, 0)
- draw_parameter(0, WLH * 2, 1)
- draw_parameter(0, WLH * 3, 2)
- draw_parameter(0, WLH * 4, 3)
- end
- #--------------------------------------------------------------------------
- # ● 设置装备变更后的能力值
- # new_atk : 装备变更后的攻击力
- # new_def : 装备变更后的防御力
- # new_spi : 装备变更后的精神力
- # new_agi : 装备变更后的敏捷性
- #--------------------------------------------------------------------------
- def set_new_parameters(new_atk, new_def, new_spi, new_agi)
- if @new_atk != new_atk or @new_def != new_def or
- @new_spi != new_spi or @new_agi != new_agi
- @new_atk = new_atk
- @new_def = new_def
- @new_spi = new_spi
- @new_agi = new_agi
- refresh
- end
- end
- #--------------------------------------------------------------------------
- # ● 获取装备变更后的能力值描绘色
- # old_value : 装備変更前の能力値
- # new_value : 装備変更後の能力値
- #--------------------------------------------------------------------------
- def new_parameter_color(old_value, new_value)
- if new_value > old_value # 变强
- return power_up_color
- elsif new_value == old_value # 没有变化
- return normal_color
- else # 变弱
- return power_down_color
- end
- end
- #--------------------------------------------------------------------------
- # ● 描绘能力值
- # x : 描绘目标 X 坐标
- # y : 描绘目标 Y 坐标
- # type : 能力值种类 (0~3)
- #--------------------------------------------------------------------------
- def draw_parameter(x, y, type)
- case type
- when 0
- name = Vocab::atk
- value = @actor.atk
- new_value = @new_atk
- when 1
- name = Vocab::def
- value = @actor.def
- new_value = @new_def
- when 2
- name = Vocab::spi
- value = @actor.spi
- new_value = @new_spi
- when 3
- name = Vocab::agi
- value = @actor.agi
- new_value = @new_agi
- end
- self.contents.font.color = system_color
- self.contents.draw_text(x + 4, y, 80, WLH, name)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 56, y, 30, WLH, value, 2)
- self.contents.font.color = system_color
- self.contents.draw_text(x + 88, y, 20, WLH, "→", 1)
- if new_value != nil
- self.contents.font.color = new_parameter_color(value, new_value)
- self.contents.draw_text(x + 112, y, 30, WLH, new_value, 2)
- end
- end
- end
- #==============================================================================
- # ■ Window_Help
- #------------------------------------------------------------------------------
- # 特技及物品的说明、角色的状态显示的窗口。
- #==============================================================================
- class Window_Help < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对象
- #--------------------------------------------------------------------------
- def initialize(x=0,y=0)
- super(x, y, 544, WLH + 32)
- end
- #--------------------------------------------------------------------------
- # ● テキスト設定
- # text : 窗口显示的字符串
- # align : 对齐方式 (0..左对齐、1..中间对齐、2..右对齐)
- #--------------------------------------------------------------------------
- def set_text(text, align = 0)
- if text != @text or align != @align
- self.contents.clear
- self.contents.font.color = normal_color
- self.contents.draw_text(4, 0, self.width - 40, WLH, text, align)
- @text = text
- @align = align
- end
- end
- end
- class Scene_Item < Scene_Base
- def return_scene
- $scene = Scene_Menu.new(1)
- end
- end
- class Scene_Status < Scene_Base
- def return_scene
- $scene = Scene_Menu.new(0)
- end
- end
- #==============================================================================
- # ■ Scene_Skill
- #------------------------------------------------------------------------------
- # 处理特技画面的类。
- #==============================================================================
- class Scene_Skill < Scene_Base
- #--------------------------------------------------------------------------
- # ● 初始化对象
- # actor_index : 角色索引
- #--------------------------------------------------------------------------
- def initialize(actor_index = 0, equip_index = 0)
- @actor_index = actor_index
- end
- #--------------------------------------------------------------------------
- # ● 开始处理
- #--------------------------------------------------------------------------
- def start
- super
- create_menu_background
- @actor = $game_party.members[@actor_index]
- @viewport = Viewport.new(0, 0, 544, 416)
- @skillicon_window = Window_Base.new(0,0,132,152)
- @skillicon_window.contents = Bitmap.new(@skillicon_window.width - 32,
- @skillicon_window.height - 32)
- @help_window = Window_Help.new(132,0)
- @help_window.width = 412
- @skill_window = Window_Skill.new(0, 152, 544, 264, @actor)
- @skill_window.viewport = @viewport
- @skill_window.help_window = @help_window
- @target_window = Window_MenuStatus.new(0, 0)
- hide_target_window
- end
- #--------------------------------------------------------------------------
- # ● 结束处理
- #--------------------------------------------------------------------------
- def terminate
- super
- dispose_menu_background
- @skillicon_window.dispose
- @help_window.dispose
- @skill_window.dispose
- @target_window.dispose
- end
- #--------------------------------------------------------------------------
- # ● 还原至原来的画面
- #--------------------------------------------------------------------------
- def return_scene
- $scene = Scene_Menu.new(3)
- end
- #--------------------------------------------------------------------------
- # ● 切换至下一名角色的画面
- #--------------------------------------------------------------------------
- def next_actor
- @actor_index += 1
- @actor_index %= $game_party.members.size
- $scene = Scene_Skill.new(@actor_index)
- end
- #--------------------------------------------------------------------------
- # ● 切换至上一名角色的画面
- #--------------------------------------------------------------------------
- def prev_actor
- @actor_index += $game_party.members.size - 1
- @actor_index %= $game_party.members.size
- $scene = Scene_Skill.new(@actor_index)
- end
- #--------------------------------------------------------------------------
- # ● 更新画面
- #--------------------------------------------------------------------------
- def update
- super
- update_menu_background
- @skillicon_window.update
- @help_window.update
- @skill_window.update
- @target_window.update
- if @skill_window.active
- @skillicon_window.contents.clear
- @skillicon_window.draw_icon(@skill_window.skill.icon_index,
- (@skillicon_window.width-56)/2, (@skillicon_window.height-56)/2)
- update_skill_selection
- elsif @target_window.active
- update_target_selection
- end
- end
- #--------------------------------------------------------------------------
- # ● 更新选择特技
- #--------------------------------------------------------------------------
- def update_skill_selection
- if Input.trigger?(Input::B)
- Sound.play_cancel
- return_scene
- elsif Input.trigger?(Input::R)
- Sound.play_cursor
- next_actor
- elsif Input.trigger?(Input::L)
- Sound.play_cursor
- prev_actor
- elsif Input.trigger?(Input::C)
- @skill = @skill_window.skill
- if @skill != nil
- @actor.last_skill_id = @skill.id
- end
- if @actor.skill_can_use?(@skill)
- Sound.play_decision
- determine_skill
- else
- Sound.play_buzzer
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 确定特技
- #--------------------------------------------------------------------------
- def determine_skill
- if @skill.for_friend?
- show_target_window(@skill_window.index % 2 == 0)
- if @skill.for_all?
- @target_window.index = 99
- elsif @skill.for_user?
- @target_window.index = @actor_index + 100
- else
- if $game_party.last_target_index < @target_window.item_max
- @target_window.index = $game_party.last_target_index
- else
- @target_window.index = 0
- end
- end
- else
- use_skill_nontarget
- end
- end
- #--------------------------------------------------------------------------
- # ● 更新选择目标
- #--------------------------------------------------------------------------
- def update_target_selection
- if Input.trigger?(Input::B)
- Sound.play_cancel
- hide_target_window
- elsif Input.trigger?(Input::C)
- if not @actor.skill_can_use?(@skill)
- Sound.play_buzzer
- else
- determine_target
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 确定目标
- # 无效的情况下 (在不能战斗的情况下使用恢复剂) 播放 buzzer 的 SE。
- #--------------------------------------------------------------------------
- def determine_target
- used = false
- if @skill.for_all?
- for target in $game_party.members
- target.skill_effect(@actor, @skill)
- used = true unless target.skipped
- end
- elsif @skill.for_user?
- target = $game_party.members[@target_window.index - 100]
- target.skill_effect(@actor, @skill)
- used = true unless target.skipped
- else
- $game_party.last_target_index = @target_window.index
- target = $game_party.members[@target_window.index]
- target.skill_effect(@actor, @skill)
- used = true unless target.skipped
- end
- if used
- use_skill_nontarget
- else
- Sound.play_buzzer
- end
- end
- #--------------------------------------------------------------------------
- # ● 显示目标窗口
- # right : 靠右标志 (false 为靠左)
- #--------------------------------------------------------------------------
- def show_target_window(right)
- @skill_window.active = false
- width_remain = 544 - @target_window.width
- @target_window.x = right ? width_remain : 0
- @target_window.visible = true
- @target_window.active = true
- if right
- @viewport.rect.set(0, 0, width_remain, 416)
- @viewport.ox = 0
- else
- @viewport.rect.set(@target_window.width, 0, width_remain, 416)
- @viewport.ox = @target_window.width
- end
- end
- #--------------------------------------------------------------------------
- # ● 不显示目标窗口
- #--------------------------------------------------------------------------
- def hide_target_window
- @skill_window.active = true
- @target_window.visible = false
- @target_window.active = false
- @viewport.rect.set(0, 0, 544, 416)
- @viewport.ox = 0
- end
- #--------------------------------------------------------------------------
- # ● 使用特技 (也适用于我方对象以外的效果)
- #--------------------------------------------------------------------------
- def use_skill_nontarget
- Sound.play_use_skill
- @actor.mp -= @actor.calc_mp_cost(@skill)
- @skill_window.refresh
- @target_window.refresh
- if $game_party.all_dead?
- $scene = Scene_Gameover.new
- elsif @skill.common_event_id > 0
- $game_temp.common_event_id = @skill.common_event_id
- $scene = Scene_Map.new
- end
- end
- end
复制代码
需要自己全局搜索一下return_scene这个 在不同的Scene里对应不同的返回光标 重新定义一下
范例在此...
不想复制上面大段脚本就看范例里面的脚本 一样的东西
http://rpg.blue/upload_program/f ... 岁版_91530614.rar
发几个图...
主菜单界面
背景图我用的标题的背景 找到Scene_Menu里面的Cache.system("title") 把title改成你的图片的文件名 图片放到Pictures/System下.
装备菜单
技能菜单
状态菜单
有其他要求或者修改请PM我! |
|