设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1394|回复: 4
打印 上一主题 下一主题

[已经解决] 求66技能分类脚本

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
438 小时
注册时间
2009-1-6
帖子
230
跳转到指定楼层
1
发表于 2009-7-2 12:57:03 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
本帖最后由 赤月 于 2009-7-3 00:14 编辑

RT- - 我那个我不小心册了,现在去主站怎么找都找不到....谁能发给我?

Lv4.逐梦者

梦石
0
星屑
6795
在线时间
1666 小时
注册时间
2008-10-29
帖子
6710

贵宾

2
发表于 2009-7-2 16:53:01 | 只看该作者
本帖最后由 后知后觉 于 2009-7-2 16:59 编辑
  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================


  4. #==============================================================================
  5. # ■ Liuliu_Window_SkillCommand
  6. #==============================================================================

  7. class Liuliu_Window_SkillCommand < Window_Selectable
  8. attr_accessor :commands
  9. #--------------------------------------------------------------------------
  10. # ● 初始化,生成commands窗口
  11. #--------------------------------------------------------------------------
  12.   def initialize(actor)
  13.   super(0, 0, 160, 288)
  14.   @commands = []
  15.   #————————生成commands窗口
  16.   for i in 0...actor.skills.size
  17.     skill = $data_skills[actor.skills[i]]
  18.     if skill != nil
  19.       push = true
  20.       for com in @commands
  21.         if com == skill.desc
  22.           push = false
  23.         end
  24.       end
  25.       if push == true
  26.         @commands.push(skill.desc)
  27.       end
  28.     end
  29.   end
  30.   if @commands == []
  31.     @commands.push("普通技能")
  32.   end      
  33.   @item_max = @commands.size
  34.   self.contents = Bitmap.new(width - 32, @item_max*32)
  35.   refresh
  36.   self.index = 0
  37. end
  38. #--------------------------------------------------------------------------
  39. #--------------------------------------------------------------------------
  40. def refresh
  41.    self.contents.clear
  42.    for i in 0...@item_max
  43.      draw_item(i, normal_color)
  44.    end
  45. end
  46. #--------------------------------------------------------------------------
  47. #--------------------------------------------------------------------------
  48. def draw_item(index, color)
  49.    self.contents.font.color = color
  50.    y = index * 32
  51.    self.contents.draw_text(4, y, 128, 32, @commands[index])
  52. end
  53. #--------------------------------------------------------------------------
  54. # 只描绘原文字
  55. #--------------------------------------------------------------------------
  56. def update_help
  57.    @help_window.set_text(@commands[self.index])
  58. end
  59. end

  60. #==============================================================================
  61. # ■ Window_Skill
  62. #==============================================================================

  63. class Liuliu_Window_SkillList < Window_Selectable
  64. #--------------------------------------------------------------------------
  65. #--------------------------------------------------------------------------
  66. def initialize(actor)
  67.    super(160, 0, 480, 416)
  68.    @actor = actor
  69.    refresh
  70.    self.index = 0
  71.    # 战斗中的情况下将窗口移至中央并将其半透明化
  72.    if $game_temp.in_battle
  73.      self.y = 64
  74.      self.height = 256
  75.      self.back_opacity = 160
  76.    end
  77. end
  78. #--------------------------------------------------------------------------
  79. #--------------------------------------------------------------------------
  80. def skill
  81.    return @data[self.index]
  82. end
  83. #--------------------------------------------------------------------------
  84. #--------------------------------------------------------------------------
  85. def refresh
  86.    if self.contents != nil
  87.      self.contents.dispose
  88.      self.contents = nil
  89.    end
  90.    @data = []
  91. end
  92. #--------------------------------------------------------------------------
  93. #--------------------------------------------------------------------------
  94. def set_item(command)
  95.    refresh
  96.    for i in [email protected]
  97.      skill = $data_skills[@actor.skills[i]]
  98.      if skill != nil and skill.desc == command
  99.        @data.push(skill)
  100.      end
  101.    end
  102.    @item_max = @data.size
  103.    if @item_max > 0
  104.      self.contents = Bitmap.new(width - 32, row_max * 32)
  105.      self.contents.clear
  106.      for i in 0...@item_max
  107.        draw_item(i)
  108.      end
  109.    end
  110. end
  111. #-----------------------------------------------------------------------
  112. #--------------------------------------------------------------------------
  113. def draw_item(index)
  114.    skill = @data[index]
  115.    if @actor.skill_can_use?(skill.id)
  116.      self.contents.font.color = normal_color
  117.    else
  118.      self.contents.font.color = disabled_color
  119.    end
  120.    x = 4
  121.    y = index * 32
  122.    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
  123.    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  124.    bitmap = RPG::Cache.icon(skill.icon_name)
  125.    opacity = self.contents.font.color == normal_color ? 255 : 128
  126.    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  127.    self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
  128.    self.contents.draw_text(x + 390, y, 16, 32, ":", 1)
  129.    self.contents.draw_text(x + 400, y, 40, 32, skill.sp_cost.to_s, 2)
  130. end
  131. #--------------------------------------------------------------------------
  132. #--------------------------------------------------------------------------
  133. def update_help
  134.    @help_window.set_text(self.skill == nil ? "" : self.skill.description)
  135. end
  136. end

  137. #==============================================================================
  138. # ■ Liuliu_Scene_Skill
  139. #==============================================================================

  140. class Scene_Skill
  141. #--------------------------------------------------------------------------
  142. # ● 初始化对像
  143. #     actor_index : 角色索引
  144. #--------------------------------------------------------------------------
  145. def initialize(actor_index = 0)
  146.    @actor_index = actor_index
  147.    @actor = $game_party.actors[@actor_index]
  148. end
  149. #--------------------------------------------------------------------------
  150. #--------------------------------------------------------------------------
  151. def main
  152.    @status_window = Window_SkillStatus.new(@actor)
  153.    @itemcommand_window = Liuliu_Window_SkillCommand.new($game_party.actors[@actor_index])
  154.    @command_index = @itemcommand_window.index
  155.    @skill_window = Liuliu_Window_SkillList.new($game_party.actors[@actor_index])
  156.    @skill_window.active = false
  157.    @help_window = Window_Help.new
  158.    @help_window.x = 0
  159.    @help_window.y = 416
  160.    @itemcommand_window.help_window = @help_window
  161.    @skill_window.help_window = @help_window
  162.    @target_window = Window_Target.new
  163.    @target_window.visible = false
  164.    @target_window.active = false
  165.    @skill_window.set_item(@itemcommand_window.commands[@command_index])
  166.    Graphics.transition
  167.    loop do
  168.      Graphics.update
  169.      Input.update
  170.      update
  171.      if $scene != self
  172.        break
  173.      end
  174.    end
  175.    Graphics.freeze
  176.    @itemcommand_window.dispose
  177.    @skill_window.dispose
  178.    @status_window.dispose
  179.    @help_window.dispose
  180.    @target_window.dispose
  181. end
  182. #--------------------------------------------------------------------------
  183. #--------------------------------------------------------------------------
  184. def update
  185.    @itemcommand_window.update
  186.    @skill_window.update
  187.    @help_window.update
  188.    @target_window.update
  189.    if @command_index != @itemcommand_window.index
  190.      @command_index = @itemcommand_window.index
  191.      @skill_window.set_item(@itemcommand_window.commands[@command_index])
  192.    end
  193.    if @itemcommand_window.active
  194.      update_itemcommand
  195.      return
  196.    end
  197.    if @skill_window.active
  198.      update_itemlist
  199.      return
  200.    end
  201.    if @target_window.active
  202.      update_target
  203.      return
  204.    end
  205. end
  206. #--------------------------------------------------------------------------
  207. #--------------------------------------------------------------------------
  208. def update_itemcommand
  209.    if Input.trigger?(Input::B)
  210.      $game_system.se_play($data_system.cancel_se)
  211.      $scene = Scene_Menu.new(0)
  212.      return
  213.    end
  214.    if Input.trigger?(Input::C)
  215.      $game_system.se_play($data_system.decision_se)
  216.      @itemcommand_window.active = false
  217.      @skill_window.active = true
  218.      @skill_window.index = 0
  219.      return
  220.    end
  221. end
  222. #--------------------------------------------------------------------------
  223. #--------------------------------------------------------------------------
  224. def update_itemlist
  225.    if Input.trigger?(Input::B)
  226.      $game_system.se_play($data_system.cancel_se)
  227.      @itemcommand_window.active = true
  228.      @skill_window.active = false
  229.      @skill_window.index = 0
  230.      @itemcommand_window.index = @command_index
  231.      return
  232.    end
  233.    if Input.trigger?(Input::C)
  234.      # 获取特技窗口现在选择的特技的数据
  235.      @skill = @skill_window.skill
  236.      # 不能使用的情况下
  237.      if @skill == nil or not @actor.skill_can_use?(@skill.id)
  238.        # 演奏冻结 SE
  239.        $game_system.se_play($data_system.buzzer_se)
  240.        return
  241.      end
  242.      # 演奏确定 SE
  243.      $game_system.se_play($data_system.decision_se)
  244.      # 效果范围是我方的情况下
  245.      if @skill.scope >= 3
  246.        # 激活目标窗口
  247.        @skill_window.active = false
  248.        @target_window.x = (@skill_window.index + 1) % 2 * 304
  249.        @target_window.visible = true
  250.        @target_window.active = true
  251.        # 设置效果范围 (单体/全体) 的对应光标位置
  252.        if @skill.scope == 4 || @skill.scope == 6
  253.          @target_window.index = -1
  254.        elsif @skill.scope == 7
  255.          @target_window.index = @actor_index - 10
  256.        else
  257.          @target_window.index = 0
  258.        end
  259.      # 效果在我方以外的情况下
  260.      else
  261.        # 公共事件 ID 有效的情况下
  262.        if @skill.common_event_id > 0
  263.          # 预约调用公共事件
  264.          $game_temp.common_event_id = @skill.common_event_id
  265.          # 演奏特技使用时的 SE
  266.          $game_system.se_play(@skill.menu_se)
  267.          # 消耗 SP
  268.          @actor.sp -= @skill.sp_cost
  269.          # 再生成各窗口的内容
  270.          @status_window.refresh
  271.          @skill_window.refresh
  272.          @target_window.refresh
  273.          # 切换到地图画面
  274.          $scene = Scene_Map.new
  275.          return
  276.        end
  277.      end
  278.      return
  279.    end
  280. end
  281. #--------------------------------------------------------------------------
  282. #--------------------------------------------------------------------------
  283. def update_target
  284.    if Input.trigger?(Input::B)
  285.      $game_system.se_play($data_system.cancel_se)
  286.      @skill_window.refresh
  287.      @skill_window.active = true
  288.      @target_window.visible = false
  289.      @target_window.active = false
  290.      @skill_window.set_item(@itemcommand_window.commands[@command_index])
  291.      return
  292.    end
  293.    
  294.    # 按下 C 键的情况下
  295.    if Input.trigger?(Input::C)
  296.      # 因为 SP 不足而无法使用的情况下
  297.      unless @actor.skill_can_use?(@skill.id)
  298.        # 演奏冻结 SE
  299.        $game_system.se_play($data_system.buzzer_se)
  300.        return
  301.      end
  302.      # 目标是全体的情况下
  303.      if @target_window.index == -1
  304.        # 对同伴全体应用特技使用效果
  305.        used = false
  306.        for i in $game_party.actors
  307.          used |= i.skill_effect(@actor, @skill)
  308.        end
  309.      end
  310.      # 目标是使用者的情况下
  311.      if @target_window.index <= -2
  312.        # 对目标角色应用特技的使用效果
  313.        target = $game_party.actors[@target_window.index + 10]
  314.        used = target.skill_effect(@actor, @skill)
  315.      end
  316.      # 目标是单体的情况下
  317.      if @target_window.index >= 0
  318.        # 对目标角色应用特技的使用效果
  319.        target = $game_party.actors[@target_window.index]
  320.        used = target.skill_effect(@actor, @skill)
  321.      end
  322.      # 使用特技的情况下
  323.      if used
  324.        # 演奏特技使用时的 SE
  325.        $game_system.se_play(@skill.menu_se)
  326.        # 消耗 SP
  327.        @actor.sp -= @skill.sp_cost
  328.        # 再生成各窗口内容
  329.        @status_window.refresh
  330.        #@skill_window.refresh
  331.        @target_window.refresh
  332.        # 全灭的情况下
  333.        if $game_party.all_dead?
  334.          # 切换到游戏结束画面
  335.          $scene = Scene_Gameover.new
  336.          return
  337.        end
  338.        # 公共事件 ID 有效的情况下
  339.        if @skill.common_event_id > 0
  340.          # 预约调用公共事件
  341.          $game_temp.common_event_id = @skill.common_event_id
  342.          # 切换到地图画面
  343.          $scene = Scene_Map.new
  344.          return
  345.        end
  346.      end
  347.      # 无法使用特技的情况下
  348.      unless used
  349.        # 演奏冻结 SE
  350.        $game_system.se_play($data_system.buzzer_se)
  351.      end
  352.      return
  353.    end
  354. end
  355. end
  356. #==============================================================================
  357. # ■ Window_SkillStatus
  358. #------------------------------------------------------------------------------
  359. #  显示特技画面、特技使用者的窗口。
  360. #==============================================================================

  361. class Window_SkillStatus < Window_Base
  362. #--------------------------------------------------------------------------
  363. # ● 初始化对像
  364. #     actor : 角色
  365. #--------------------------------------------------------------------------
  366. def initialize(actor)
  367.    super(0, 288, 160, 128)
  368.    self.contents = Bitmap.new(width - 32, height - 32)
  369.    @actor = actor
  370.    refresh
  371. end
  372. #--------------------------------------------------------------------------
  373. # ● 刷新
  374. #--------------------------------------------------------------------------
  375. def refresh
  376.    self.contents.clear
  377.    draw_actor_name(@actor, 4, 0)
  378.    draw_actor_hp(@actor, 4, 32, 120)
  379.    draw_actor_sp(@actor, 4, 64, 120)
  380. end
  381. end

  382. #==============================================================================
  383. # ■ RPG追加定义,使用@符号分类
  384. #==============================================================================

  385. module RPG
  386. class Skill
  387.    def description
  388.      description = @description.split(/@/)[0]
  389.      return description != nil ? description : ''
  390.    end
  391.    def desc
  392.      desc = @description.split(/@/)[1]
  393.      return desc != nil ? desc : "普通技能"
  394.    end
  395. end
  396. end

  397. #==============================================================================
  398. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  399. #==============================================================================
复制代码
战斗部分
  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================

  4. class Scene_Battle
  5. #--------------------------------------------------------------------------
  6. # ● 刷新画面 (角色命令回合 : 选择特技) ★★★★★★★★★★★★★★★★★
  7. #--------------------------------------------------------------------------
  8. def update_phase3_skill_select
  9.   # 设置特技窗口为可视状态
  10.   @skill_window.visible = true
  11.   @itemcommand_window.visible = true
  12.   @itemcommand_window.update
  13.   if @command_index != @itemcommand_window.index
  14.     @command_index = @itemcommand_window.index
  15.     @skill_window.set_item(@itemcommand_window.commands[@command_index])
  16.     @skill_window.index = 0
  17.   end
  18.   @skill_window.update
  19.   # 按下 B 键的情况下
  20.   if Input.trigger?(Input::B)
  21.     # 演奏取消 SE
  22.     $game_system.se_play($data_system.cancel_se)
  23.     if @itemcommand_window.active==false
  24.       @itemcommand_window.active = true
  25.       @skill_window.active = false
  26.       return
  27.     end
  28.     # 结束特技选择
  29.     end_skill_select
  30.     return
  31.   end
  32.   # 按下 C 键的情况下
  33.   if Input.trigger?(Input::C)
  34.     if @itemcommand_window.active
  35.       @itemcommand_window.active = false
  36.       @skill_window.active = true
  37.       # 演奏确定 SE
  38.       $game_system.se_play($data_system.decision_se)
  39.       return
  40.     end
  41.     # 获取特技选择窗口现在选择的特技的数据
  42.     @skill = @skill_window.skill
  43.     # 无法使用的情况下
  44.     if @skill == nil or not @active_battler.skill_can_use?(@skill.id)
  45.       # 演奏冻结 SE
  46.       $game_system.se_play($data_system.buzzer_se)
  47.       return
  48.     end
  49.     # 演奏确定 SE
  50.     $game_system.se_play($data_system.decision_se)
  51.     # 设置行动
  52.     @active_battler.current_action.skill_id = @skill.id
  53.     # 设置特技窗口为不可见状态
  54.     @skill_window.visible = false
  55.     @itemcommand_window.visible = false
  56.     # 效果范围是敌单体的情况下
  57.     if @skill.scope == 1
  58.       # 开始选择敌人
  59.       start_enemy_select
  60.     # 效果范围是我方单体的情况下
  61.     elsif @skill.scope == 3 or @skill.scope == 5
  62.       # 开始选择角色
  63.       start_actor_select
  64.     # 效果范围不是单体的情况下
  65.     else
  66.       # 选择特技结束
  67.       end_skill_select
  68.       # 转到下一位角色的指令输入
  69.       phase3_next_actor
  70.     end
  71.     return
  72.   end
  73. end

  74. #--------------------------------------------------------------------------
  75. # ● 开始选择特技 ★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  76. #--------------------------------------------------------------------------
  77. def start_skill_select
  78.   @skill_window = Liuliu_Window_SkillList.new(@active_battler)
  79.   @skill_window.help_window = @help_window
  80.   @itemcommand_window = Liuliu_Window_SkillCommand.new(@active_battler)
  81.   @itemcommand_window.opacity = 160
  82.   @itemcommand_window.y = 64
  83.   @itemcommand_window.height -= 32
  84.   @itemcommand_window.active = true
  85.   @itemcommand_window.help_window = @help_window
  86.   @skill_window.active = false
  87.   @command_index = @itemcommand_window.index
  88.   @skill_window.set_item(@itemcommand_window.commands[@command_index])
  89.   @actor_command_window.active = false
  90.   @actor_command_window.visible = false
  91. end
  92. #--------------------------------------------------------------------------
  93. # ● 选择特技结束 ★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  94. #--------------------------------------------------------------------------
  95. def end_skill_select
  96.   # 释放特技窗口
  97.   @itemcommand_window.dispose
  98.   @itemcommand_window = nil
  99.   @skill_window.dispose
  100.   @skill_window = nil
  101.   # 隐藏帮助窗口
  102.   @help_window.visible = false
  103.   # 有效化角色指令窗口
  104.   @actor_command_window.active = true
  105.   @actor_command_window.visible = true
  106. end
  107. end


  108. #==============================================================================
  109. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  110. #==============================================================================
复制代码











你知道得太多了

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
438 小时
注册时间
2009-1-6
帖子
230
3
 楼主| 发表于 2009-7-2 23:59:06 | 只看该作者
谢了,现在怎么认可答案?
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
245
在线时间
24 小时
注册时间
2008-8-2
帖子
128
4
发表于 2009-7-3 00:00:56 | 只看该作者
编辑你的第一的对话,把“[有事请教]”改为“[已经解决]”
GRESK
回复 支持 反对

使用道具 举报

Lv1.梦旅人

B

梦石
0
星屑
50
在线时间
26 小时
注册时间
2007-8-26
帖子
3693
5
发表于 2009-7-3 00:11:41 | 只看该作者
谢了,现在怎么认可答案?
赤月 发表于 2009-7-2 23:59


http://rpg.blue/viewthread.php?tid=127367&extra=page%3D1
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-9-20 17:43

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表