赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 29377 |
最后登录 | 2013-8-7 |
在线时间 | 1 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 1 小时
- 注册时间
- 2008-8-3
- 帖子
- 976
|
没有效果是因为你还用了 《复杂技能分类脚本》,与之冲突了
好吧。。。。连技能分类脚本都给你改兼容下。。。。。
- module RPG
- class Skill
- def description
- description = @description.split(/@/)[0]
- return description != nil ? description : ''
- end
- def desc
- desc = @description.split(/@/)[1]
- return desc != nil ? desc : "普通技能"
- end
- end
- end
- class Liuliu_Window_SkillCommand < Window_Selectable
- attr_accessor :commands
- def initialize(actor)
- super(0, 0, 160, 216)
- @commands = []
- if $game_temp.in_battle
- @actor = actor
- else
- @actor = $game_party.members[actor]
- end
- for skill in @actor.skills
- push = true
- for com in @commands
- if com == skill.desc
- push = false
- end
- end
- if push == true
- @commands.push(skill.desc)
- end
- end
- if @commands == []
- @commands.push("普通技能")
- end
- @item_max = @commands.size
- self.contents = Bitmap.new(width - 32, @item_max*32)
- refresh
- self.index = 0
- end
-
- def refresh
- self.contents.clear
- for i in 0...@item_max
- draw_item(i, normal_color)
- end
- end
- def draw_item(index, color)
- self.contents.font.color = color
- y = index * WLH
- self.contents.draw_text(4, y, 128, WLH, @commands[index])
- end
- def update_help
- @help_window.set_text(@commands[self.index])
- end
- end
- class Liuliu_Window_SkillList < Window_Selectable
- def initialize(actor)
- super(160, 0, 384, 360)
- @actor = actor
- refresh
- self.index = 0
- if $game_temp.in_battle
- self.y = 56
- self.height = 232
- self.back_opacity = 200
- end
- end
- def skill
- return @data[self.index]
- end
- def refresh
- @data = []
- end
- def set_item(command)
- refresh
- for skill in @actor.skills
- if skill != nil and skill.desc == command
- @data.push(skill)
- end
- end
- @item_max = @data.size
- if @item_max > 0
- self.contents = Bitmap.new(width - 32, row_max * 32)
- self.contents.clear
- for i in 0...@item_max
- draw_item(i)
- end
- end
- end
-
- def draw_item(index)
- rect = item_rect(index)
- self.contents.clear_rect(rect)
- skill = @data[index]
-
- if skill != nil and skill.occasion == 3 #被动技能
- rect.width -= 4
- enabled = @actor.skill_can_use?(skill)
- draw_item_name(skill, rect.x, rect.y, enabled)
- end
-
- if skill != nil and skill.occasion != 3 #非被动技能
- rect.width -= 4
- enabled = @actor.skill_can_use?(skill)
- draw_item_name(skill, rect.x, rect.y, enabled)
- if skill.consume_hp
- # HP 消費
- text = "- " + @actor.calc_hp_cost(skill).to_s + " HP"
- else
- # MP 消費
- if @actor.calc_mp_cost(skill) != 0
- text = "- " + @actor.calc_mp_cost(skill).to_s + " MP"
- else
- text = "--"
- end
- end
- self.contents.draw_text(rect, text, 2)
- end
- end
-
- def update_help
- @help_window.set_text(self.skill == nil ? "" : self.skill.description)
- end
- end
- class Temp_Window_SkillStatus < Window_Base
- def initialize(actor)
- super(0, 216, 160, 144)
- self.contents = Bitmap.new(width - 32, height - 32)
- @actor = actor
- refresh
- end
-
- def refresh
- self.contents.clear
- draw_actor_name(@actor, 4, 0)
- draw_actor_hp(@actor, 4, 32, 120)
- draw_actor_mp(@actor, 4, 64, 120)
- end
- end
- class Temp_Window_Help < Window_Base
-
- def initialize
- super(0, 360, 544, WLH + 32)
- end
- 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 Temp_Window_MenuStatus < Window_Selectable
- def initialize(x, y)
- super(x, y, 288, 416)
- refresh
- self.active = false
- self.index = -1
- end
- def refresh
- self.contents.clear
- @item_max = $game_party.members.size
- for actor in $game_party.members
- x = 8
- y = actor.index * 96 + WLH / 2
- draw_actor_name(actor, x, y)
- draw_actor_class(actor, x + 120, y)
- draw_actor_level(actor, x, y + WLH * 1)
- draw_actor_state(actor, x, y + WLH * 2)
- draw_actor_hp(actor, x + 120, y + WLH * 1)
- draw_actor_mp(actor, x + 120, y + WLH * 2)
- end
- end
- def update_cursor
- if @index < 0
- self.cursor_rect.empty
- elsif @index < @item_max
- self.cursor_rect.set(0, @index * 96, contents.width, 96)
- elsif @index >= 100
- self.cursor_rect.set(0, (@index - 100) * 96, contents.width, 96)
- else
- self.cursor_rect.set(0, 0, contents.width, @item_max * 96)
- end
- end
- end
- class Scene_Skill < Scene_Base
- 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)
- @help_window = Temp_Window_Help.new
- @status_window = Temp_Window_SkillStatus.new(@actor)
- @itemcommand_window = Liuliu_Window_SkillCommand.new(@actor_index)
- @command_index = @itemcommand_window.index
- @skill_window = Liuliu_Window_SkillList.new($game_party.members[@actor_index])
- @skill_window.help_window = @help_window
- @skill_window.set_item(@itemcommand_window.commands[@command_index])
- @target_window = Temp_Window_MenuStatus.new(96, 0)
- @skill_window.active = false
- hide_target_window
- end
- def terminate
- super
- dispose_menu_background
- @help_window.dispose
- @itemcommand_window.dispose
- @status_window.dispose
- @skill_window.dispose
- @target_window.dispose
- end
- def return_scene
- $scene = Scene_Menu.new(1)
- end
- def next_actor
- @actor_index += 1
- @actor_index %= $game_party.members.size
- $scene = Scene_Skill.new(@actor_index)
- @skill_window.active = false
- end
- def prev_actor
- @actor_index += $game_party.members.size - 1
- @actor_index %= $game_party.members.size
- $scene = Scene_Skill.new(@actor_index)
- @skill_window.active = false
- end
- def update
- super
- update_menu_background
- @itemcommand_window.update
- @help_window.update
- @status_window.update
- @skill_window.update
- @target_window.update
- if @command_index != @itemcommand_window.index
- @command_index = @itemcommand_window.index
- @skill_window.index = 0
- @skill_window.set_item(@itemcommand_window.commands[@command_index])
- end
- if @itemcommand_window.active
- update_itemcommand
- elsif @skill_window.active
- update_itemlist
- elsif @target_window.active
- update_target
- end
- end
- def update_itemcommand
- if Input.trigger?(Input::B)
- Sound.play_cancel
- return_scene
- elsif Input.trigger?(Input::C)
- Sound.play_decision
- @itemcommand_window.active = false
- @skill_window.active = true
- @skill_window.index = 0
- elsif Input.trigger?(Input::R)
- Sound.play_cursor
- next_actor
- elsif Input.trigger?(Input::L)
- Sound.play_cursor
- prev_actor
- end
- end
-
- def update_itemlist
- if Input.trigger?(Input::B)
- Sound.play_cancel
- @itemcommand_window.active = true
- @skill_window.active = false
- @skill_window.index = 0
- 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
- if Input.trigger?(Input::B)
- Sound.play_cancel
- hide_target_window
- @skill_window.active = true
- elsif Input.trigger?(Input::C)
- if not @actor.skill_can_use?(@skill)
- Sound.play_buzzer
- else
- determine_target
- end
- end
- end
- 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
- 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.refresh
- @target_window.visible = false
- @target_window.active = false
- @skill_window.set_item(@itemcommand_window.commands[@command_index])
- @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)
- @status_window.refresh
- @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
- class Scene_Battle < Scene_Base
- def start_skill_selection
- @help_window = Window_Help.new
- @skill_window = Liuliu_Window_SkillList.new(@active_battler)
- @skill_window.help_window = @help_window
- @itemcommand_window = Liuliu_Window_SkillCommand.new(@active_battler)
- @itemcommand_window.y = 56
- @itemcommand_window.height = 232
- @itemcommand_window.active = true
- @itemcommand_window.back_opacity = 200
- @itemcommand_window.help_window = @help_window
- @command_index = @itemcommand_window.index
- @skill_window.set_item(@itemcommand_window.commands[@command_index])
- @actor_command_window.active = false
- @skill_window.active = false
- end
- def end_skill_selection
- if @skill_window != nil
- @skill_window.dispose
- @skill_window = nil
- @help_window.dispose
- @help_window = nil
- @itemcommand_window.dispose
- @itemcommand_window = nil
- end
- @actor_command_window.active = true
- end
- def update_skill_selection
- @skill_window.visible = true
- @itemcommand_window.visible = true
- @itemcommand_window.update
- if @command_index != @itemcommand_window.index
- @command_index = @itemcommand_window.index
- @skill_window.set_item(@itemcommand_window.commands[@command_index])
- @skill_window.index = 0
- end
- @skill_window.update
- @help_window.update
- if Input.trigger?(Input::B)
- Sound.play_cancel
- if @skill_window.active == true then
- @itemcommand_window.active = true
- @skill_window.active = false
- else
- end_skill_selection
- end
- elsif Input.trigger?(Input::C)
- if @skill_window.active == false
- @skill_window.active = true
- @itemcommand_window.active = false
- Sound.play_decision
- return
- end
- @skill = @skill_window.skill
- if @skill != nil
- @active_battler.last_skill_id = @skill.id
- end
- if @active_battler.skill_can_use?(@skill)
- Sound.play_decision
- determine_skill
- else
- Sound.play_buzzer
- end
- end
- end
- def determine_skill
- @active_battler.action.set_skill(@skill.id)
- @skill_window.active = false
- if @skill.need_selection?
- if @skill.for_opponent?
- start_target_enemy_selection
- else
- start_target_actor_selection
- end
- else
- end_skill_selection
- next_actor
- end
- end
- end
复制代码
|
|