赞 | 6 |
VIP | 1 |
好人卡 | 14 |
积分 | 7 |
经验 | 2666 |
最后登录 | 2018-6-28 |
在线时间 | 215 小时 |
Lv2.观梦者 仙木精灵
- 梦石
- 0
- 星屑
- 651
- 在线时间
- 215 小时
- 注册时间
- 2012-4-16
- 帖子
- 502
|
喔喔
怎么修改脚本才能在技能名称后+@技能分类的名称
而不是在说明后++@技能分类的名称!- #==============================================================================
- # 本脚本来自www.66RPG.com,使用和转载请保留此信息
- #==============================================================================
- #==============================================================================
- # ■ Liuliu_Window_SkillCommand
- #==============================================================================
- class Liuliu_Window_SkillCommand < Window_Selectable
- attr_accessor :commands
- #--------------------------------------------------------------------------
- # ● 初始化,生成commands窗口
- #--------------------------------------------------------------------------
- def initialize(actor)
- super(0, 0, 160, 288)
- @commands = []
- #————————生成commands窗口
- for i in 0...actor.skills.size
- skill = $data_skills[actor.skills[i]]
- if skill != nil
- push = true
- for com in @commands
- if com == skill.desc
- push = false
- end
- end
- if push == true
- @commands.push(skill.desc)
- end
- 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 * 32
- self.contents.draw_text(4, y, 128, 32, @commands[index])
- end
- #--------------------------------------------------------------------------
- # 只描绘原文字
- #--------------------------------------------------------------------------
- def update_help
- @help_window.set_text(@commands[self.index])
- end
- end
- #==============================================================================
- # ■ Window_Skill
- #==============================================================================
- class Liuliu_Window_SkillList < Window_Selectable
- #--------------------------------------------------------------------------
- #--------------------------------------------------------------------------
- def initialize(actor)
- super(160, 0, 480, 416)
- @actor = actor
- refresh
- self.index = 0
- # 战斗中的情况下将窗口移至中央并将其半透明化
- if $game_temp.in_battle
- self.y = 64
- self.height = 256
- self.back_opacity = 160
- end
- end
- #--------------------------------------------------------------------------
- #--------------------------------------------------------------------------
- def skill
- return @data[self.index]
- end
- #--------------------------------------------------------------------------
- #--------------------------------------------------------------------------
- def refresh
- if self.contents != nil
- self.contents.dispose
- self.contents = nil
- end
- @data = []
- end
- #--------------------------------------------------------------------------
- #--------------------------------------------------------------------------
- def set_item(command)
- refresh
- for i in [email protected]
- skill = $data_skills[@actor.skills[i]]
- 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)
- skill = @data[index]
- if @actor.skill_can_use?(skill.id)
- self.contents.font.color = normal_color
- else
- self.contents.font.color = disabled_color
- end
- x = 4
- y = index * 32
- rect = Rect.new(x, y, self.width / @column_max - 32, 32)
- self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
- bitmap = RPG::Cache.icon(skill.icon_name)
- opacity = self.contents.font.color == normal_color ? 255 : 128
- self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
- self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
- self.contents.draw_text(x + 390, y, 16, 32, ":", 1)
- self.contents.draw_text(x + 400, y, 40, 32, skill.sp_cost.to_s, 2)
- end
- #--------------------------------------------------------------------------
- #--------------------------------------------------------------------------
- def update_help
- @help_window.set_text(self.skill == nil ? "" : self.skill.description)
- end
- end
- #==============================================================================
- # ■ Liuliu_Scene_Skill
- #==============================================================================
- class Scene_Skill
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # actor_index : 角色索引
- #--------------------------------------------------------------------------
- def initialize(actor_index = 0)
- @actor_index = actor_index
- @actor = $game_party.actors[@actor_index]
- end
- #--------------------------------------------------------------------------
- #--------------------------------------------------------------------------
- def main
- @status_window = Window_SkillStatus.new(@actor)
- @itemcommand_window = Liuliu_Window_SkillCommand.new($game_party.actors[@actor_index])
- @command_index = @itemcommand_window.index
- @skill_window = Liuliu_Window_SkillList.new($game_party.actors[@actor_index])
- @skill_window.active = false
- @help_window = Window_Help.new
- @help_window.x = 0
- @help_window.y = 416
- @itemcommand_window.help_window = @help_window
- @skill_window.help_window = @help_window
- @target_window = Window_Target.new
- @target_window.visible = false
- @target_window.active = false
- @skill_window.set_item(@itemcommand_window.commands[@command_index])
- Graphics.transition
- loop do
- Graphics.update
- Input.update
- update
- if $scene != self
- break
- end
- end
- Graphics.freeze
- @itemcommand_window.dispose
- @skill_window.dispose
- @status_window.dispose
- @help_window.dispose
- @target_window.dispose
- end
- #--------------------------------------------------------------------------
- #--------------------------------------------------------------------------
- def update
- @itemcommand_window.update
- @skill_window.update
- @help_window.update
- @target_window.update
- if @command_index != @itemcommand_window.index
- @command_index = @itemcommand_window.index
- @skill_window.set_item(@itemcommand_window.commands[@command_index])
- end
- if @itemcommand_window.active
- update_itemcommand
- return
- end
- if @skill_window.active
- update_itemlist
- return
- end
- if @target_window.active
- update_target
- return
- end
- end
- #--------------------------------------------------------------------------
- #--------------------------------------------------------------------------
- def update_itemcommand
- if Input.trigger?(Input::B)
- $game_system.se_play($data_system.cancel_se)
- $scene = Scene_Menu.new(0)
- return
- end
- if Input.trigger?(Input::C)
- $game_system.se_play($data_system.decision_se)
- @itemcommand_window.active = false
- @skill_window.active = true
- @skill_window.index = 0
- return
- end
- end
- #--------------------------------------------------------------------------
- #--------------------------------------------------------------------------
- def update_itemlist
- if Input.trigger?(Input::B)
- $game_system.se_play($data_system.cancel_se)
- @itemcommand_window.active = true
- @skill_window.active = false
- @skill_window.index = 0
- @itemcommand_window.index = @command_index
- return
- end
- if Input.trigger?(Input::C)
- # 获取特技窗口现在选择的特技的数据
- @skill = @skill_window.skill
- # 不能使用的情况下
- if @skill == nil or not @actor.skill_can_use?(@skill.id)
- # 演奏冻结 SE
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- # 效果范围是我方的情况下
- if @skill.scope >= 3
- # 激活目标窗口
- @skill_window.active = false
- @target_window.x = (@skill_window.index + 1) % 2 * 304
- @target_window.visible = true
- @target_window.active = true
- # 设置效果范围 (单体/全体) 的对应光标位置
- if @skill.scope == 4 || @skill.scope == 6
- @target_window.index = -1
- elsif @skill.scope == 7
- @target_window.index = @actor_index - 10
- else
- @target_window.index = 0
- end
- # 效果在我方以外的情况下
- else
- # 公共事件 ID 有效的情况下
- if @skill.common_event_id > 0
- # 预约调用公共事件
- $game_temp.common_event_id = @skill.common_event_id
- # 演奏特技使用时的 SE
- $game_system.se_play(@skill.menu_se)
- # 消耗 SP
- @actor.sp -= @skill.sp_cost
- # 再生成各窗口的内容
- @status_window.refresh
- @skill_window.refresh
- @target_window.refresh
- # 切换到地图画面
- $scene = Scene_Map.new
- return
- end
- end
- return
- end
- end
- #--------------------------------------------------------------------------
- #--------------------------------------------------------------------------
- def update_target
- if Input.trigger?(Input::B)
- $game_system.se_play($data_system.cancel_se)
- @skill_window.refresh
- @skill_window.active = true
- @target_window.visible = false
- @target_window.active = false
- @skill_window.set_item(@itemcommand_window.commands[@command_index])
- return
- end
-
- # 按下 C 键的情况下
- if Input.trigger?(Input::C)
- # 因为 SP 不足而无法使用的情况下
- unless @actor.skill_can_use?(@skill.id)
- # 演奏冻结 SE
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- # 目标是全体的情况下
- if @target_window.index == -1
- # 对同伴全体应用特技使用效果
- used = false
- for i in $game_party.actors
- used |= i.skill_effect(@actor, @skill)
- end
- end
- # 目标是使用者的情况下
- if @target_window.index <= -2
- # 对目标角色应用特技的使用效果
- target = $game_party.actors[@target_window.index + 10]
- used = target.skill_effect(@actor, @skill)
- end
- # 目标是单体的情况下
- if @target_window.index >= 0
- # 对目标角色应用特技的使用效果
- target = $game_party.actors[@target_window.index]
- used = target.skill_effect(@actor, @skill)
- end
- # 使用特技的情况下
- if used
- # 演奏特技使用时的 SE
- $game_system.se_play(@skill.menu_se)
- # 消耗 SP
- @actor.sp -= @skill.sp_cost
- # 再生成各窗口内容
- @status_window.refresh
- #@skill_window.refresh
- @target_window.refresh
- # 全灭的情况下
- if $game_party.all_dead?
- # 切换到游戏结束画面
- $scene = Scene_Gameover.new
- return
- end
- # 公共事件 ID 有效的情况下
- if @skill.common_event_id > 0
- # 预约调用公共事件
- $game_temp.common_event_id = @skill.common_event_id
- # 切换到地图画面
- $scene = Scene_Map.new
- return
- end
- end
- # 无法使用特技的情况下
- unless used
- # 演奏冻结 SE
- $game_system.se_play($data_system.buzzer_se)
- end
- return
- end
- end
- end
- #==============================================================================
- # ■ Window_SkillStatus
- #------------------------------------------------------------------------------
- # 显示特技画面、特技使用者的窗口。
- #==============================================================================
- class Window_SkillStatus < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # actor : 角色
- #--------------------------------------------------------------------------
- def initialize(actor)
- super(0, 288, 160, 128)
- 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_sp(@actor, 4, 64, 120)
- end
- end
- #==============================================================================
- # ■ RPG追加定义,使用@符号分类
- #==============================================================================
- 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
- #==============================================================================
- # 本脚本来自www.66RPG.com,使用和转载请保留此信息
- #==============================================================================
复制代码 |
|