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

Project1

 找回密码
 注册会员
搜索
楼主: Tabris_Air
打印 上一主题 下一主题

【5vip】两个重量级脚本整合,高手请进

 关闭 [复制链接]

Lv1.梦旅人

剑圣

梦石
0
星屑
50
在线时间
122 小时
注册时间
2008-8-31
帖子
778
11
 楼主| 发表于 2009-3-21 23:37:13 | 只看该作者
就是也给技能连击加上下面这样的效果,
只是弄个静态的提示窗口倒是没啥问题,
要实现这样的效果我觉得应该把第二个脚本再写一遍,可是看着看着脚本就觉得没思路= =




以下引用dbshy于2009-3-21 15:20:47的发言:


以下引用Tabris_Air于2009-3-21 14:24:02的发言:

我想要第一个脚本那样的依次按键提示效果……




那您是卡在那里呢?或者是没有思路?
让我来教您好了(其实是我懒,不想动手)


PC/IOS/Android共享的RM RPG:未名大学
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2009-3-21
帖子
17
12
发表于 2009-3-22 00:02:04 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2009-3-21
帖子
17
13
发表于 2009-3-22 00:07:48 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

剑圣

梦石
0
星屑
50
在线时间
122 小时
注册时间
2008-8-31
帖子
778
14
 楼主| 发表于 2009-3-22 00:58:00 | 只看该作者
VIP已经挂上

楼上的高手不愿意给的话,我也只好指望其他人了

PC/IOS/Android共享的RM RPG:未名大学
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2009-3-17
帖子
132
15
发表于 2009-3-22 02:22:13 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

剑圣

梦石
0
星屑
50
在线时间
122 小时
注册时间
2008-8-31
帖子
778
16
 楼主| 发表于 2009-3-22 02:28:35 | 只看该作者

要注意的有好几个地方:
1.第一个脚本的判断时间是在技能动画之前,现在接连续技是在技能动画播放的那段时间
2.成功之后如何设置角色马上施放下一技能



以下引用蓝の星辰于2009-3-21 18:22:13的发言:


以下引用Tabris_Air于2009-3-21 15:37:13的发言:

要实现这样的效果我觉得应该把第二个脚本再写一遍,可是看着看着脚本就觉得没思路= =




您可以看一下这段
  for i in 0...time

    if Input.trigger?(tact_skill[key_count])
      key_count += 1
      window_keycount.key_in
    elsif Input.n_trigger?(tact_skill[key_count])   

      break
    end
    # 如果成功
    if key_count >= tact_skill.size
      window_keycount.text_in("成功")
      # 成功提示音
      Audio.se_play("Audio/SE/056-Right02")
      @active_battler.tact_flag = false            
      # 成功与失败后的处理
      for i in 0...10
        Graphics.update
        @spriteset.update
      end
      window_keycount.dispose
      window_counter.dispose
      return true
    end
    # 刷新
    window_counter.refresh((i*100/time).truncate)
    Graphics.update
    Input.update
  end

上面的是显示窗口的核心算法,再想一下吧


PC/IOS/Android共享的RM RPG:未名大学
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2009-3-17
帖子
132
17
发表于 2009-3-22 02:35:20 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

剑圣

梦石
0
星屑
50
在线时间
122 小时
注册时间
2008-8-31
帖子
778
18
 楼主| 发表于 2009-3-22 02:38:20 | 只看该作者

哎搞不清楚= =||
一般的脚本还能自己弄一下,
这种涉及到alias和各种battle phase的只能伸手了……

以下引用蓝の星辰于2009-3-21 18:35:20的发言:

这就需要您将第二个脚本的原理看懂了 - -bbb
因为您刚才说不会弄动态的窗口


PC/IOS/Android共享的RM RPG:未名大学
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2009-3-17
帖子
132
19
发表于 2009-3-22 02:49:29 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
60
在线时间
41 小时
注册时间
2008-3-5
帖子
2072
20
发表于 2009-3-22 03:19:29 | 只看该作者
V还在吗?

{/cy}

  1. #====================================================
  2. #  按键威力加成 Ver.1.3.0          by Claimh   sphinger汉化修改
  3. #  本脚本来自www.66rpg.com,转载和使用请保留注释,方便来者
  4. #--------------------------------------------------------------------
  5. #  功能添加:柳柳
  6. #
  7. #  添加修改说明:1、在T_SKILL设置技能的加成按键和威力的加成比例。
  8. #                   威力加成可以使用随机数
  9. #                2、窗口目前是可以输入很多内容,并且会自动滚动
  10. #                3、添加困难指令个数的数量限制
  11. #                4、添加随机生成指令的功能,指令处直接给定一个数字就是随机出来的指令个数
  12. #                   如果给定一个字符串的数字,比如 "15" 这样,则是只有上下左右构成的随机指令15个。
  13. #
  14. #  范例研究方法:用默认工程,给希露达(魔法师)学会7、8、9号技能(也就是火系的三招)
  15. #                然后使用这三招就知道了。
  16. #
  17. #  可能会用到的窗口修改:class Window_KeyCounter,描绘血槽的窗口
  18. #                        class Window_KeyCount,描绘按键的窗口。你可以恶搞地把它弄成跳舞机
  19. #====================================================
  20. #==============================================================================
  21. #  按键威力加成 Ver.1.3.0          by Claimh   sphinger汉化修改
  22. #  本脚本来自www.66rpg.com,转载和使用请保留注释,方便来者
  23. #------------------------------------------------------------------------------
  24. #  功能添加:柳柳
  25. #
  26. #  添加修改说明:1、在T_SKILL设置技能的加成按键和威力的加成比例。
  27. #                   威力加成可以使用随机数
  28. #                2、窗口目前是可以输入很多内容,并且会自动滚动
  29. #                3、添加困难指令个数的数量限制
  30. #                4、添加随机生成指令的功能,指令处直接给定一个数字就是随机出来的指令个数
  31. #                   如果给定一个字符串的数字,比如 "15" 这样,则是只有上下左右构成的随机指令15个。
  32. #
  33. #  范例研究方法:用默认工程,给希露达(魔法师)学会7、8、9号技能(也就是火系的三招)
  34. #                然后使用这三招就知道了。
  35. #
  36. #  可能会用到的窗口修改:class Window_KeyCounter,描绘血槽的窗口
  37. #                        class Window_KeyCount,描绘按键的窗口。你可以恶搞地把它弄成跳舞机
  38. #==============================================================================

  39. module TacticalSkill
  40. #==============================================================================
  41. #  START
  42. #==============================================================================
  43. # 按键设定
  44. A = Input::A            # 对应按键:Z
  45. B = Input::B            # 对应按键:X
  46. C = Input::C            # 对应按键:C
  47. X = Input::X            # 对应按键:A
  48. Y = Input::Y            # 对应按键:S
  49. Z = Input::Z            # 对应按键:D
  50. L = Input::L            # 对应按键:Q
  51. R = Input::R            # 对应按键:W
  52. UP = Input::UP
  53. DOWN = Input::DOWN
  54. LEFT = Input::LEFT
  55. RIGHT = Input::RIGHT

  56. # 时间的快慢调整,越大越慢
  57. KEY_SEC = 0.5

  58. # 时间条显示自己放个150*10的就可以了,放在(Graphics/Windowskins/)下就可以拉
  59. T_BAR_NAME = "bar"

  60. T_HARD_NUMBER = 10 # 确定输入多少个的时候开始算做困难指令
  61.                     # 困难指令给的时间不会按照按键数量增多而增长


  62. # 技能设定
  63. T_SKILL = {
  64.    #技能ID => [[按键1,按键2,……?,按键N],技能攻击力加成]
  65.        57 => [[align=left,RIGHT], rand(150)+100],
  66.        8 => [12, 200],
  67.        9 => ["15", 250],
  68.        85 => [[align=left,UP], 50],
  69.        86 => [[L,X,R], 50],
  70.        12 => [[X,C,RIGHT,R], 50],
  71.        13 => [[UP,RIGHT], 50],
  72.        14 => [[L,Z,A], 50],
  73.        15 => [[R,X,X,DOWN], 50],
  74.        16 => [[DOWN, RIGHT], 50],
  75.        17 => [[A,B,C], 50],
  76.        18 => [[Y,X,DOWN,B], 50],
  77.        19 => [[align=left,DOWN], 50],
  78.        20 => [[Z,Y,A], 50],
  79.        21 => [[B,C,X,L], 50],
  80.        22 => [[align=right,DOWN], 50],
  81.        23 => [[A,B,R], 50],
  82.        24 => [[X,Y,LEFT,R], 50],
  83.        25 => [[align=left,RIGHT], 50],
  84.        26 => [[X,L,B], 50],
  85.        27 => [[align=left,X,C,Z], 50],
  86.        28 => [[align=left,DOWN], 50],
  87.        29 => [[C,X,A], 50],
  88.        30 => [[X,Z,C,UP], 50],
  89.        31 => [[UP,DOWN,X], 0],
  90.        32 => [[align=left,RIGHT,L,R], 50],
  91.        7 => [[A, C], 50],
  92.        58 => [[C, X, UP], 50],
  93.        59 => [[A, UP, RIGHT, A], 50],
  94.        60 => [[Z, C, A, B], 50],
  95.        61 => [[X, C], 50],
  96.        62 => [[UP, X, DOWN], 50],
  97.        63 => [[align=left, C, Y, A], 50],
  98.        64 => [[X, C, Y, A], 50],
  99.        65 => [[Y, A], 50],
  100.        66 => [[align=right, B, A], 50],
  101.        67 => [[align=left, UP, Z, A], 50],
  102.        68 => [[Y, B, Y, A], 50],
  103.        69 => [[align=left, A], 50],
  104.        70 => [[A, C, A], 50],
  105.        71 => [[B, B, A, A], 50],
  106.        72 => [[A, B, X, Y], 50],
  107.        73 => [[X, A], 50],
  108.        74 => [[Y, A, B], 50],
  109.        75 => [[align=left, RIGHT, Y, A], 50],
  110.        76 => [[A, C, L, A], 50],
  111.        77 => [[R, X], 50],
  112.        78 => [[L, C, R], 50],
  113.        79 => [[align=left, L, RIGHT, R], 50],
  114.        80 => [[C, C, Z, RIGHT], 50]
  115. }


  116. L_SKILL = {
  117.        57 => [[UP,DOWN], rand(150)+100,57]


  118. }
  119. #  
  120. #==============================================================================
  121. # END
  122. #==============================================================================
  123. end

  124. #==============================================================================
  125. #   Input
  126. #==============================================================================
  127. module Input
  128. module_function
  129. #--------------------------------------------------------------------------
  130. #--------------------------------------------------------------------------
  131. def n_trigger?(num)
  132.    if trigger?(num)
  133.      return false
  134.    elsif trigger?(A) or trigger?(B) or trigger?(C) or
  135.          trigger?(X) or trigger?(Y) or trigger?(Z) or
  136.          trigger?(L) or trigger?(R) or
  137.          trigger?(UP) or trigger?(DOWN) or trigger?(RIGHT) or trigger?(LEFT)
  138.        return true
  139.    end
  140.    return false
  141. end
  142. #--------------------------------------------------------------------------
  143. #--------------------------------------------------------------------------
  144. def key_converter(key)
  145.    # 按键对应的字母或文字

  146.      case key
  147.      when A
  148.        return "Z"
  149.      when B
  150.        return "X"
  151.      when C
  152.        return "C"
  153.      when X
  154.        return "A"
  155.      when Y
  156.        return "S"
  157.      when Z
  158.        return "D"
  159.      when L
  160.        return "Q"
  161.      when R
  162.        return "W"
  163.     when UP
  164.      return "上"
  165.     when DOWN
  166.      return "下"
  167.     when LEFT
  168.      return "左"
  169.     when RIGHT
  170.      return "右"
  171.     end
  172. end
  173. end

  174. #==============================================================================
  175. #   Game_Battler
  176. #==============================================================================
  177. class Game_Battler
  178. attr_accessor   :tact_flag
  179. #--------------------------------------------------------------------------
  180. #--------------------------------------------------------------------------
  181. alias initialize_tactical initialize
  182. def initialize
  183.    initialize_tactical     #  
  184.    @tact_flag = false
  185. end
  186. #--------------------------------------------------------------------------
  187. #     user  :  
  188. #     skill :  
  189. #--------------------------------------------------------------------------
  190. alias skill_effect_tactical skill_effect
  191. def skill_effect2(user, skill)
  192.    skill_copy = $data_skills[skill.id].dup
  193.    skill.power = skill.power * TacticalSkill::T_SKILL[skill.id][1] / 100
  194.    skill.hit = 0 if skill.power == 0
  195.    ret = skill_effect_tactical(user, skill)
  196.    user.tact_flag = false
  197.    $data_skills[skill.id] = skill_copy.dup
  198.    return ret
  199. end
  200. end

  201. #==============================================================================
  202. #  Scene_Battle
  203. #==============================================================================
  204. class Scene_Battle
  205. #--------------------------------------------------------------------------
  206. #--------------------------------------------------------------------------
  207.   alias update_phase4_step2_tactical update_phase4_step2
  208.   def update_phase4_step2
  209.     update_phase4_step2_tactical
  210.     @active_battler.tact_flag = false
  211.   end


  212.   alias update_e :update
  213.   def update
  214.     @l_skill = false if @l_skill == nil
  215.     if @phase4_step == 5 && @active_battler.current_action.kind == 1
  216.       @use = @active_battler.current_action.kind == 1 && TacticalSkill::L_SKILL[@active_battler.current_action.skill_id] != nil
  217.       if @use == true
  218.          @use = $data_skills[TacticalSkill::L_SKILL[@active_battler.current_action.skill_id][2]].sp_cost <= @active_battler.sp
  219.       end
  220.       if @l_skill == false and @use == true and @phase == 4 and @phase4_step == 5 and @active_battler.current_action.kind == 1
  221.         if make_tactical_skill_result(1)
  222.           @active_battler.current_action.kind = 1
  223.           a = TacticalSkill::L_SKILL[@active_battler.current_action.skill_id][2]
  224.           @active_battler.current_action.skill_id = a
  225.           @l_skill = [@active_battler,a]
  226.         else
  227.           @l_skill = true
  228.         end
  229.       end
  230.     end
  231.     if @phase == 4 and @phase4_step > 5 and @l_skill != false and @l_skill != true
  232.       @active_battler.current_action.kind = 1
  233.       @active_battler.current_action.skill_id = @l_skill[1]
  234.       @action_battlers.unshift(@l_skill[0])
  235.       update_phase4_step1
  236.     end
  237.     update_e
  238.   end


  239. #--------------------------------------------------------------------------
  240.   #--------------------------------------------------------------------------
  241.   # ● 刷新画面 (主回合步骤 1 : 准备行动)
  242.   #--------------------------------------------------------------------------
  243.   def update_phase4_step1
  244.     # 隐藏帮助窗口
  245.     @help_window.visible = false
  246.     # 判定胜败
  247.     if judge
  248.       # 胜利或者失败的情况下 : 过程结束
  249.       return
  250.     end
  251.     # 强制行动的战斗者不存在的情况下
  252.     if $game_temp.forcing_battler == nil
  253.       # 设置战斗事件
  254.       setup_battle_event
  255.       # 执行战斗事件中的情况下
  256.       if $game_system.battle_interpreter.running?
  257.         return
  258.       end
  259.     end
  260.     # 强制行动的战斗者存在的情况下
  261.     if $game_temp.forcing_battler != nil
  262.       # 在头部添加后移动
  263.       @action_battlers.delete($game_temp.forcing_battler)
  264.       @action_battlers.unshift($game_temp.forcing_battler)
  265.     end
  266.     # 未行动的战斗者不存在的情况下 (全员已经行动)
  267.     if @action_battlers.size == 0
  268.       # 开始同伴命令回合
  269.       @l_skill = false
  270.       start_phase2
  271.       return
  272.     end
  273.     # 初始化动画 ID 和公共事件 ID
  274.     @animation1_id = 0
  275.     @animation2_id = 0
  276.     @common_event_id = 0
  277.     # 未行动的战斗者移动到序列的头部
  278.     @active_battler = @action_battlers.shift
  279.     # 如果已经在战斗之外的情况下
  280.     if @active_battler.index == nil
  281.       return
  282.     end
  283.     # 连续伤害
  284.     if @active_battler.hp > 0 and @active_battler.slip_damage?
  285.       @active_battler.slip_damage_effect
  286.       @active_battler.damage_pop = true
  287.     end
  288.     # 自然解除状态
  289.     @active_battler.remove_states_auto
  290.     # 刷新状态窗口
  291.     @status_window.refresh
  292.     # 移至步骤 2
  293.     @phase4_step = 2
  294.   end
  295. #--------------------------------------------------------------------------
  296. def make_skill_action_result
  297.    unless @active_battler.current_action.forcing || @l_skill != false
  298.      # SP  
  299.      unless @active_battler.skill_can_use?(@active_battler.current_action.skill_id)
  300.        $game_temp.forcing_battler = nil
  301.        # 移至步奏1
  302.        @phase4_step = 1
  303.        return
  304.      end
  305.    end
  306.    
  307.    if @active_battler.is_a?(Game_Actor)
  308.      if !TacticalSkill::T_SKILL[@active_battler.current_action.skill_id].nil?
  309.        if make_tactical_skill_result
  310.          # 获取特技
  311.          @skill = $data_skills[@active_battler.current_action.skill_id]
  312.          # 如果不是强制行动
  313.          unless @active_battler.current_action.forcing
  314.            # 因为 SP 耗尽而无法使用的情况下
  315.            unless @active_battler.skill_can_use?(@skill.id)
  316.              # 清除强制行动对像的战斗者
  317.              $game_temp.forcing_battler = nil
  318.              # 移至步骤 1
  319.              @phase4_step = 1
  320.              return
  321.            end
  322.          end
  323.          @l_skill = false
  324.          # 消耗 SP
  325.          @active_battler.sp -= @skill.sp_cost
  326.          # 刷新状态窗口
  327.          @status_window.refresh
  328.          # 在帮助窗口显示特技名
  329.          @help_window.set_text(@skill.name, 1)
  330.          # 设置动画 ID
  331.          @animation1_id = @skill.animation1_id
  332.          @animation2_id = @skill.animation2_id
  333.          # 设置公共事件 ID
  334.          @common_event_id = @skill.common_event_id
  335.          # 设置对像侧战斗者
  336.          set_target_battlers(@skill.scope)
  337.          # 应用特技效果
  338.          for target in @target_battlers
  339.            target.skill_effect2(@active_battler, @skill)
  340.          end
  341.        else
  342.          # 获取特技
  343.          @skill = $data_skills[@active_battler.current_action.skill_id]
  344.          # 如果不是强制行动
  345.          unless @active_battler.current_action.forcing
  346.            # 因为 SP 耗尽而无法使用的情况下
  347.            unless @active_battler.skill_can_use?(@skill.id)
  348.              # 清除强制行动对像的战斗者
  349.              $game_temp.forcing_battler = nil
  350.              # 移至步骤 1
  351.              @phase4_step = 1
  352.              return
  353.            end
  354.          end
  355.          @l_skill = false
  356.          # 消耗 SP
  357.          @active_battler.sp -= @skill.sp_cost
  358.          # 刷新状态窗口
  359.          @status_window.refresh
  360.          # 在帮助窗口显示特技名
  361.          @help_window.set_text(@skill.name, 1)
  362.          # 设置动画 ID
  363.          @animation1_id = @skill.animation1_id
  364.          @animation2_id = @skill.animation2_id
  365.          # 设置公共事件 ID
  366.          @common_event_id = @skill.common_event_id
  367.          # 设置对像侧战斗者
  368.          set_target_battlers(@skill.scope)
  369.          # 应用特技效果
  370.          for target in @target_battlers
  371.            target.skill_effect(@active_battler, @skill)
  372.          end
  373.        end
  374.      else
  375.        # 获取特技
  376.        @skill = $data_skills[@active_battler.current_action.skill_id]
  377.        # 如果不是强制行动
  378.        unless @active_battler.current_action.forcing || @l_skill != false
  379.          # 因为 SP 耗尽而无法使用的情况下
  380.          unless @active_battler.skill_can_use?(@skill.id)
  381.            # 清除强制行动对像的战斗者
  382.            $game_temp.forcing_battler = nil
  383.            # 移至步骤 1
  384.            @phase4_step = 1
  385.            return
  386.          end
  387.        end
  388.        @l_skill = false
  389.        #@l_skill = false
  390.        # 消耗 SP
  391.        @active_battler.sp -= @skill.sp_cost
  392.        # 刷新状态窗口
  393.        @status_window.refresh
  394.        # 在帮助窗口显示特技名
  395.        @help_window.set_text(@skill.name, 1)
  396.        # 设置动画 ID
  397.        @animation1_id = @skill.animation1_id
  398.        @animation2_id = @skill.animation2_id
  399.        # 设置公共事件 ID
  400.        @common_event_id = @skill.common_event_id
  401.        # 设置对像侧战斗者
  402.        set_target_battlers(@skill.scope)
  403.        # 应用特技效果
  404.        for target in @target_battlers
  405.          target.skill_effect(@active_battler, @skill)
  406.        end
  407.      end
  408.    else      
  409.      # 获取特技
  410.      @skill = $data_skills[@active_battler.current_action.skill_id]
  411.      # 如果不是强制行动
  412.      unless @active_battler.current_action.forcing
  413.        # 因为 SP 耗尽而无法使用的情况下
  414.        unless @active_battler.skill_can_use?(@skill.id)
  415.          # 清除强制行动对像的战斗者
  416.          $game_temp.forcing_battler = nil
  417.          # 移至步骤 1
  418.          @phase4_step = 1
  419.          return
  420.        end
  421.      end
  422.      # 消耗 SP
  423.      @active_battler.sp -= @skill.sp_cost
  424.      # 刷新状态窗口
  425.      @status_window.refresh
  426.      # 在帮助窗口显示特技名
  427.      @help_window.set_text(@skill.name, 1)
  428.      # 设置动画 ID
  429.      @animation1_id = @skill.animation1_id
  430.      @animation2_id = @skill.animation2_id
  431.      # 设置公共事件 ID
  432.      @common_event_id = @skill.common_event_id
  433.      # 设置对像侧战斗者
  434.      set_target_battlers(@skill.scope)
  435.      # 应用特技效果
  436.      for target in @target_battlers
  437.        target.skill_effect(@active_battler, @skill)
  438.      end
  439.    end
  440. end
  441. def make_rand_tact(ini)
  442.    b = []
  443.    for i in 0...ini
  444.      case rand(12).to_i
  445.      when 0
  446.        b.push(Input::A)
  447.      when 1
  448.        b.push(Input::B)
  449.      when 2
  450.        b.push(Input::C)
  451.      when 3
  452.        b.push(Input::X)
  453.      when 4
  454.        b.push(Input::Y)
  455.      when 5
  456.        b.push(Input::Z)
  457.      when 6
  458.        b.push(Input::L)
  459.      when 7
  460.        b.push(Input::R)
  461.      when 8
  462.        b.push(Input::RIGHT)
  463.      when 9
  464.        b.push(Input::UP)
  465.      when 10
  466.        b.push(Input::LEFT)
  467.      when 11
  468.        b.push(Input::DOWN)
  469.      end
  470.    end
  471.    return b
  472. end
  473. def make_rand_tact4(ini)
  474.    b = []
  475.    for i in 0...ini
  476.      case rand(4).to_i
  477.      when 0
  478.        b.push(Input::RIGHT)
  479.      when 1
  480.        b.push(Input::UP)
  481.      when 2
  482.        b.push(Input::LEFT)
  483.      when 3
  484.        b.push(Input::DOWN)
  485.      end
  486.    end
  487.    return b
  488. end

  489. #--------------------------------------------------------------------------
  490. #--------------------------------------------------------------------------
  491. def make_tactical_skill_result(t=0)
  492.    
  493.    tact_skill = TacticalSkill::T_SKILL[@active_battler.current_action.skill_id][0]
  494.    tact_skill = TacticalSkill::L_SKILL[@active_battler.current_action.skill_id][0] if t == 1
  495.    if tact_skill.is_a?(Numeric)
  496.      a = tact_skill
  497.      tact_skill = make_rand_tact(a)
  498.    elsif tact_skill.is_a?(String)
  499.      a = tact_skill.to_i
  500.      tact_skill = make_rand_tact4(a)
  501.    end   
  502.    
  503.    time = TacticalSkill::KEY_SEC * [tact_skill.size,TacticalSkill::T_HARD_NUMBER].min * Graphics.frame_rate
  504.    key_count = 0
  505.    @active_battler.tact_flag = true

  506.    window_keycount = Window_KeyCount.new(tact_skill)
  507.    window_counter = Window_KeyCounter.new

  508.      actor_x = @active_battler.index * 160

  509.    window_keycount.x = window_counter.x = actor_x

  510.    for i in 0...time

  511.      if Input.trigger?(tact_skill[key_count])
  512.        key_count += 1
  513.        window_keycount.key_in
  514.      elsif Input.n_trigger?(tact_skill[key_count])   

  515.        break
  516.      end
  517.      # 如果成功
  518.      if key_count >= tact_skill.size
  519.        window_keycount.text_in("成功")
  520.        # 成功提示音
  521.        Audio.se_play("Audio/SE/056-Right02")
  522.        @active_battler.tact_flag = false            
  523.        # 成功与失败后的处理
  524.        for i in 0...10
  525.          Graphics.update
  526.          @spriteset.update
  527.        end
  528.        window_keycount.dispose
  529.        window_counter.dispose
  530.        return true
  531.      end
  532.      # 刷新
  533.      window_counter.refresh((i*100/time).truncate)
  534.      Graphics.update
  535.      Input.update
  536.    end
  537.    # 如果失败
  538.    if @active_battler.tact_flag
  539.      #失败提示音
  540.      Audio.se_play("Audio/SE/057-Wrong01")
  541.      window_keycount.text_in("失败")
  542.    end
  543.    # 成功与失败后的处理
  544.    for i in 0...10
  545.      Graphics.update
  546.      @spriteset.update
  547.    end
  548.    window_keycount.dispose
  549.    window_counter.dispose
  550.    return false
  551. end
  552. end

  553. #==============================================================================
  554. #  Window_Base
  555. #==============================================================================
  556. class Window_Base < Window
  557. #--------------------------------------------------------------------------
  558. #--------------------------------------------------------------------------
  559. def draw_counter_bar(x, y, current)
  560.    bitmap = RPG::Cache.windowskin(TacticalSkill::T_BAR_NAME)
  561.    cw = bitmap.width * current / 100
  562.    ch = bitmap.height
  563.    src_rect = Rect.new(0, 0, cw, ch)
  564.    self.contents.blt(x, y, bitmap, src_rect)
  565. end
  566. end


  567. #==============================================================================
  568. #  Window_KeyCounter
  569. #==============================================================================
  570. class Window_KeyCounter < Window_Base
  571. #--------------------------------------------------------------------------
  572. #    输入窗口的描绘
  573. #--------------------------------------------------------------------------
  574. def initialize
  575.    super(0, 256, 180, 80)
  576.    self.contents = Bitmap.new(width - 32, height - 32)
  577.    self.opacity = 0
  578.    self.z = 1            
  579.    refresh(0)
  580. end
  581. #--------------------------------------------------------------------------
  582. #--------------------------------------------------------------------------
  583. def refresh(current)
  584.    self.contents.clear
  585.    draw_counter_bar(0, 0, current)
  586. end
  587. end
  588. #==============================================================================
  589. #   Window_KeyCount
  590. #------------------------------------------------------------------------------
  591. #  
  592. #==============================================================================
  593. class Window_KeyCount < Window_Base
  594. #--------------------------------------------------------------------------
  595. #--------------------------------------------------------------------------
  596. def initialize(key)
  597.    super(0, 230, 180, 80)
  598.    self.contents = Bitmap.new(width - 32, height - 32)
  599.    self.opacity = 160     
  600.    self.z = 0
  601.    @key = key
  602.    @key_count = 0
  603.    refresh
  604. end
  605. #--------------------------------------------------------------------------
  606. #--------------------------------------------------------------------------
  607. def refresh
  608.    self.contents.clear
  609.    for i in [email protected]
  610.      if @key.size > 4
  611.        if @key_count >= 3
  612.          x = (i-@key_count+2)*32
  613.        else
  614.          x = i *32
  615.        end
  616.      else        
  617.        x = i * 32
  618.      end
  619.      if i < @key_count
  620.        self.contents.font.color = knockout_color
  621.        self.contents.font.size = 16
  622.      elsif i== @key_count        
  623.        self.contents.font.color = normal_color
  624.        self.contents.font.size = 25
  625.      else
  626.        self.contents.font.color = disabled_color
  627.        self.contents.font.size = 18
  628.      end
  629.      self.contents.draw_text(x, 0, 100, 32, Input.key_converter(@key[i]))
  630.    end
  631. end
  632. #--------------------------------------------------------------------------
  633. #--------------------------------------------------------------------------
  634. def key_in
  635.    @key_count += 1
  636.    refresh
  637. end
  638. #--------------------------------------------------------------------------
  639. #--------------------------------------------------------------------------
  640. def text_in(text)
  641.    self.contents.clear
  642.    self.contents.font.size = 20
  643.    self.contents.draw_text(0, 0, 130, 32, text, 1)
  644. end
  645. end
复制代码
你它囧一字母君谁记得……
当时那把剑离我的喉咙只有0.01工分。可是一柱香之后,这个女主人会深深的爱上我,虽然本人平生说了无数的谎话,可是这句最有效:“你应该这么做,我也应该死。
曾经有一取ID的机会放在我面前,我没有珍惜,等我失去的时候我才后悔莫及,人世间最痛苦的事莫过于此。你的剑在我的咽喉上割下去吧!不用再犹豫了!如果上天能够给我一个再来一次的机会,我绝对会取个汉字君。如果非要给这ID加点修饰的话,我希望是……红色加粗……

回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-28 06:21

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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