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

Project1

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

[已经过期] 求助大神 脚本冲突了

[复制链接]

Lv1.梦旅人

梦石
0
星屑
55
在线时间
231 小时
注册时间
2012-7-20
帖子
27
跳转到指定楼层
1
发表于 2014-11-1 03:51:20 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
我用了状态附加率改造和技能冷却脚本,但是状态附加改造脚本失效了,自带的状态几率实在不好用……特此求助
  1. #==============================================================================
  2. # ■狀態附加機率改造
  3. #==============================================================================
  4. # 除了內建的狀態有效度外,還能指定武器、技能、道具的補正值

  5. # 設定格式 : 技能名,40  (ex:十字斬,40)
  6. # 公式:狀態有效等級 * 技能補正值(單位:%)
  7. #                                         (預設補正值為50)

  8. # 隨改造內容附贈的狀態有效等級:A:100, B:80, C:60, D:40, E:20, F:0
  9. #==============================================================================


  10. module RPG
  11. #==============================================================================
  12. # ■武器的類
  13. #==============================================================================
  14. class Weapon
  15.   #--------------------------------------------------------------------------
  16.   # ● 名稱
  17.   #--------------------------------------------------------------------------
  18.     def name
  19.       name = @name.split(/,/)[0]
  20.       return name != nil ? name : ""
  21.     end
  22.   #--------------------------------------------------------------------------
  23.   # ● 附加機率
  24.   #--------------------------------------------------------------------------  
  25.     def probability
  26.       probability = @name.split(/,/)[1]
  27.       return probability != nil ? probability.to_i : 50
  28.     end   
  29.   end
  30. #==============================================================================
  31. # ■技能的類
  32. #==============================================================================
  33. class Skill
  34.   #--------------------------------------------------------------------------
  35.   # ● 名稱
  36.   #--------------------------------------------------------------------------
  37.     def name
  38.       name = @name.split(/,/)[0]
  39.       return name != nil ? name : ""
  40.     end
  41.   #--------------------------------------------------------------------------
  42.   # ● 附加機率
  43.   #--------------------------------------------------------------------------  
  44.     def probability
  45.       probability = @name.split(/,/)[1]
  46.       return probability != nil ? probability.to_i : 50
  47.     end   
  48.   end
  49. #==============================================================================
  50. # ■道具的類
  51. #==============================================================================
  52.   class Item
  53.   #--------------------------------------------------------------------------
  54.   # ● 名稱
  55.   #--------------------------------------------------------------------------
  56.     def name
  57.       name = @name.split(/,/)[0]
  58.       return name != nil ? name : ""
  59.     end
  60.   #--------------------------------------------------------------------------
  61.   # ● 附加機率
  62.   #--------------------------------------------------------------------------  
  63.     def probability
  64.       probability = @name.split(/,/)[1]
  65.       return probability != nil ? probability.to_i : 50
  66.     end   
  67.   end
  68. end


  69. #==============================================================================
  70. # ■ Game_Battler (分割定義 1)
  71. #------------------------------------------------------------------------------
  72. #  處理戰鬥者的類別。這個類別作為 Game_Actor 類別與 Game_Enemy 類別的
  73. #  超級類別來使用。
  74. #==============================================================================

  75. class Game_Battler
  76.   
  77.   
  78.    #--------------------------------------------------------------------------
  79.   # ● 套用通常攻擊效果
  80.   #     attacker : 攻擊者 (battler)
  81.   #--------------------------------------------------------------------------
  82.   def attack_effect(attacker)
  83.     # 清除會心一擊標誌
  84.     self.critical = false
  85.     # 第一命中判定
  86.     hit_result = (rand(100) < attacker.hit)
  87.     # 命中的情況下
  88.     if hit_result == true
  89.       # 計算基本傷害
  90.       atk = [attacker.atk - self.pdef / 2, 0].max
  91.       self.damage = atk * (20 + attacker.str) / 20
  92.       # 屬性修正
  93.       self.damage *= elements_correct(attacker.element_set)
  94.       self.damage /= 100
  95.       # 傷害符號正確的情況下
  96.       if self.damage > 0
  97.         # 會心一擊修正
  98.         if rand(100) < 4 * attacker.dex / self.agi
  99.           self.damage *= 2
  100.           self.critical = true
  101.         end
  102.         # 防禦修正
  103.         if self.guarding?
  104.           self.damage /= 2
  105.         end
  106.       end
  107.       # 分散
  108.       if self.damage.abs > 0
  109.         amp = [self.damage.abs * 15 / 100, 1].max
  110.         self.damage += rand(amp+1) + rand(amp+1) - amp
  111.       end
  112.       # 第二命中判定
  113.       eva = 8 * self.agi / attacker.dex + self.eva
  114.       hit = self.damage < 0 ? 100 : 100 - eva
  115.       hit = self.cant_evade? ? 100 : hit
  116.       hit_result = (rand(100) < hit)
  117.     end
  118.     # 命中的情況下
  119.     if hit_result == true
  120.       # 狀態衝擊解除
  121.       remove_states_shock
  122.       # HP 的傷害計算
  123.       self.hp -= self.damage
  124.       # 狀態變化
  125.       @state_changed = false
  126.       states_plus(attacker, attacker.plus_state_set) ###
  127.       states_minus(attacker.minus_state_set)
  128.     # Miss 的情況下
  129.     else
  130.       # 傷害設定為 "Miss"
  131.       self.damage = "Miss"
  132.       # 清除會心一擊標誌
  133.       self.critical = false
  134.     end
  135.     # 過程結束
  136.     return true
  137.   end
  138.   #--------------------------------------------------------------------------
  139.   # ● 套用技能效果
  140.   #     user  : 技能的使用者 (battler)
  141.   #     skill : 技能
  142.   #--------------------------------------------------------------------------
  143.   def skill_effect(user, skill)
  144.     # 清除會心一擊標誌
  145.     self.critical = false
  146.     # 技能的效果範圍是 HP 1 以上的己方、自己的 HP 為 0、
  147.     # 或者技能的效果範圍是 HP 0 的己方、自己的 HP 為 1 以上的情況下
  148.     if ((skill.scope == 3 or skill.scope == 4) and self.hp == 0) or
  149.        ((skill.scope == 5 or skill.scope == 6) and self.hp >= 1)
  150.       # 過程結束
  151.       return false
  152.     end
  153.     # 清除有效標誌
  154.     effective = false
  155.     # 公共事件 ID 是有效的情況下,設定為有效標誌
  156.     effective |= skill.common_event_id > 0
  157.     # 第一命中判定
  158.     hit = skill.hit
  159.     if skill.atk_f > 0
  160.       hit *= user.hit / 100
  161.     end
  162.     hit_result = (rand(100) < hit)
  163.     # 不確定技能的情況下設定為有效標誌
  164.     effective |= hit < 100
  165.     # 命中的情況下
  166.     if hit_result == true
  167.       # 計算威力
  168.       power = skill.power + user.atk * skill.atk_f / 100
  169.       if power > 0
  170.         power -= self.pdef * skill.pdef_f / 200
  171.         power -= self.mdef * skill.mdef_f / 200
  172.         power = [power, 0].max
  173.       end
  174.       # 計算倍率
  175.       rate = 20
  176.       rate += (user.str * skill.str_f / 100)
  177.       rate += (user.dex * skill.dex_f / 100)
  178.       rate += (user.agi * skill.agi_f / 100)
  179.       rate += (user.int * skill.int_f / 100)
  180.       # 計算基本傷害
  181.       self.damage = power * rate / 20
  182.       # 屬性修正
  183.       self.damage *= elements_correct(skill.element_set)
  184.       self.damage /= 100
  185.       # 傷害符號正確的情況下
  186.       if self.damage > 0
  187.         # 防禦修正
  188.         if self.guarding?
  189.           self.damage /= 2
  190.         end
  191.       end
  192.       # 分散
  193.       if skill.variance > 0 and self.damage.abs > 0
  194.         amp = [self.damage.abs * skill.variance / 100, 1].max
  195.         self.damage += rand(amp+1) + rand(amp+1) - amp
  196.       end
  197.       # 第二命中判定
  198.       eva = 8 * self.agi / user.dex + self.eva
  199.       hit = self.damage < 0 ? 100 : 100 - eva * skill.eva_f / 100
  200.       hit = self.cant_evade? ? 100 : hit
  201.       hit_result = (rand(100) < hit)
  202.       # 不確定技能的情況下設定為有效標誌
  203.       effective |= hit < 100
  204.     end
  205.     # 命中的情況下
  206.     if hit_result == true
  207.       # 威力 0 以外的物理攻擊的情況下
  208.       if skill.power != 0 and skill.atk_f > 0
  209.         # 狀態衝擊解除
  210.         remove_states_shock
  211.         # 設定有效標誌
  212.         effective = true
  213.       end
  214.       # HP 的傷害減法運算
  215.       last_hp = self.hp
  216.       self.hp -= self.damage
  217.       effective |= self.hp != last_hp
  218.       # 狀態變化
  219.       @state_changed = false
  220.       effective |= states_plus(user, skill.plus_state_set) ###
  221.       effective |= states_minus(skill.minus_state_set)
  222.       # 威力為 0 的場合
  223.       if skill.power == 0
  224.         # 傷害設定為空的字串
  225.         self.damage = ""
  226.         # 狀態沒有變化的情況下
  227.         unless @state_changed
  228.           # 傷害設定為 "Miss"
  229.           self.damage = "Miss"
  230.         end
  231.       end
  232.     # Miss 的情況下
  233.     else
  234.       # 傷害設定為 "Miss"
  235.       self.damage = "Miss"
  236.     end
  237.     # 不在戰鬥中的情況下
  238.     unless $game_temp.in_battle
  239.       # 傷害設定為 nil
  240.       self.damage = nil
  241.     end
  242.     # 過程結束
  243.     return effective
  244.   end
  245.   #--------------------------------------------------------------------------
  246.   # ● 套用物品效果
  247.   #     item : 物品
  248.   #--------------------------------------------------------------------------
  249.   def item_effect(item, user = $game_party.actors[0])
  250.     # 清除會心一擊標誌
  251.     self.critical = false
  252.     # 物品的效果範圍是 HP 1 以上的己方、自己的 HP 為 0、
  253.     # 或者物品的效果範圍是 HP 0 的己方、自己的 HP 為 1 以上的情況下
  254.     if ((item.scope == 3 or item.scope == 4) and self.hp == 0) or
  255.        ((item.scope == 5 or item.scope == 6) and self.hp >= 1)
  256.       # 過程結束
  257.       return false
  258.     end
  259.     # 清除有效標誌
  260.     effective = false
  261.     # 公共事件 ID 是有效的情況下,設定為有效標誌
  262.     effective |= item.common_event_id > 0
  263.     # 命中判定
  264.     hit_result = (rand(100) < item.hit)
  265.     # 不確定的技能的情況下設定為有效標誌
  266.     effective |= item.hit < 100
  267.     # 命中的情況
  268.     if hit_result == true
  269.       # 計算恢復量
  270.       recover_hp = maxhp * item.recover_hp_rate / 100 + item.recover_hp
  271.       recover_sp = maxsp * item.recover_sp_rate / 100 + item.recover_sp
  272.       if recover_hp < 0
  273.         recover_hp += self.pdef * item.pdef_f / 20
  274.         recover_hp += self.mdef * item.mdef_f / 20
  275.         recover_hp = [recover_hp, 0].min
  276.       end
  277.       # 屬性修正
  278.       recover_hp *= elements_correct(item.element_set)
  279.       recover_hp /= 100
  280.       recover_sp *= elements_correct(item.element_set)
  281.       recover_sp /= 100
  282.       # 分散
  283.       if item.variance > 0 and recover_hp.abs > 0
  284.         amp = [recover_hp.abs * item.variance / 100, 1].max
  285.         recover_hp += rand(amp+1) + rand(amp+1) - amp
  286.       end
  287.       if item.variance > 0 and recover_sp.abs > 0
  288.         amp = [recover_sp.abs * item.variance / 100, 1].max
  289.         recover_sp += rand(amp+1) + rand(amp+1) - amp
  290.       end
  291.       # 恢復量符號為負的情況下
  292.       if recover_hp < 0
  293.         # 防禦修正
  294.         if self.guarding?
  295.           recover_hp /= 2
  296.         end
  297.       end
  298.       # HP 恢復量符號的反轉、設定傷害值
  299.       self.damage = -recover_hp
  300.       # HP 以及 SP 的恢復
  301.       last_hp = self.hp
  302.       last_sp = self.sp
  303.       self.hp += recover_hp
  304.       self.sp += recover_sp
  305.       effective |= self.hp != last_hp
  306.       effective |= self.sp != last_sp
  307.       # 狀態變化
  308.       @state_changed = false
  309.       effective |= states_plus(user, item.plus_state_set)
  310.       effective |= states_minus(item.minus_state_set)
  311.       # 能力上升值有效的情況下
  312.       if item.parameter_type > 0 and item.parameter_points != 0
  313.         # 能力值的分歧
  314.         case item.parameter_type
  315.         when 1  # MaxHP
  316.           @maxhp_plus += item.parameter_points
  317.         when 2  # MaxSP
  318.           @maxsp_plus += item.parameter_points
  319.         when 3  # 力量
  320.           @str_plus += item.parameter_points
  321.         when 4  # 熟練
  322.           @dex_plus += item.parameter_points
  323.         when 5  # 速度
  324.           @agi_plus += item.parameter_points
  325.         when 6  # 魔力
  326.           @int_plus += item.parameter_points
  327.         end
  328.         # 設定有效標誌
  329.         effective = true
  330.       end
  331.       # HP 恢復率與恢復量為 0 的情況下
  332.       if item.recover_hp_rate == 0 and item.recover_hp == 0
  333.         # 設定傷害為空的字符串
  334.         self.damage = ""
  335.         # SP 恢復率與恢復量為 0、能力上升值無效的情況下
  336.         if item.recover_sp_rate == 0 and item.recover_sp == 0 and
  337.            (item.parameter_type == 0 or item.parameter_points == 0)
  338.           # 狀態沒有變化的情況下
  339.           unless @state_changed
  340.             # 傷害設定為 "Miss"
  341.             self.damage = "Miss"
  342.           end
  343.         end
  344.       end
  345.     # Miss 的情況下
  346.     else
  347.       # 傷害設定為 "Miss"
  348.       self.damage = "Miss"
  349.     end
  350.     # 不在戰鬥中的情況下
  351.     unless $game_temp.in_battle
  352.       # 傷害設定為 nil
  353.       self.damage = nil
  354.     end
  355.     # 過程結束
  356.     return effective
  357.   end
  358.   
  359.   
  360.   #--------------------------------------------------------------------------
  361.   # ● 狀態變化 (+) 的適用
  362.   #     plus_state_set  : 狀態變化 (+)
  363.   #--------------------------------------------------------------------------
  364.   def states_plus(battler, plus_state_set)
  365.     # 清除有效標誌
  366.     effective = false
  367.     # 循環 (附加狀態)
  368.     for i in plus_state_set
  369.       # 無法防禦本狀態的情況下
  370.       unless self.state_guard?(i)
  371.         # 這個狀態如果不是 full 的話就設定有效標誌
  372.         effective |= self.state_full?(i) == false
  373.         # 狀態為 [不能抵抗] 的情況下
  374.         if $data_states[i].nonresistance
  375.           # 設定狀態變化標誌
  376.           @state_changed = true
  377.           # 附加狀態
  378.           add_state(i)
  379.         # 這個狀態不是 full 的情況下
  380.         elsif self.state_full?(i) == false
  381.          
  382.          
  383.       #使用武器時,獲取狀態附加機率
  384.       if  battler.current_action.kind == 0 and battler.is_a?(Game_Actor)
  385.         probability = $data_weapons[battler.weapon_id].probability
  386.       #使用技能時,獲取狀態附加機率
  387.        elsif battler.current_action.kind == 1
  388.           probability = $data_skills[battler.current_action.skill_id].probability
  389.       #使用道具時,獲取狀態附加機率
  390.         elsif battler.current_action.kind == 2
  391.           probability = $data_items[battler.current_action.item_id].probability
  392.         else
  393.           #不設定附加率為50
  394.           probability = 50
  395.         end
  396.       
  397.           # 將狀態的有效度變換為概率、與隨機數比較
  398.           if rand(100) < [0,100,80,60,40,20,0][self.state_ranks[i]] * (probability / 100.0)
  399.             # 設定狀態變化標誌
  400.             @state_changed = true
  401.             # 附加狀態
  402.             add_state(i)
  403.           end
  404.         end
  405.       end
  406.     end
  407.     # 過程結束
  408.     return effective
  409.   end
  410. end


  411. #==============================================================================
  412. # ■ Game_Actor
  413. #------------------------------------------------------------------------------
  414. #  處理角色的類別。本類別在 Game_Actors 類別 ($game_actors)
  415. #  的內部使用、Game_Party 類別請參考 ($game_party) 。
  416. #==============================================================================

  417. class Game_Actor < Game_Battler
  418.   #--------------------------------------------------------------------------
  419.   # ● 定義實例變數
  420.   #--------------------------------------------------------------------------
  421.   attr_reader   :skill                   # 技能
  422. end
复制代码
  1. module Sword
  2.   ON = true ; OFF = false ; Sword15_Cooling = Array.new
  3. #=======================================
  4. #★ 魔劍工舖 - 技能冷卻1.02
  5. # 轉貼腳本請著名出處:http://blog.yam.com/a870053jjkj/
  6. # 如果採用在遊戲中,看你高興是否顯示腳本出處,但嚴禁說是自己寫的腳本!!
  7. #=======================================
  8. #● 使用者自定設置
  9. Sword15_XPVX = 0 # 此腳本用於XP時設為0;此腳本用在VX時設為1
  10. Sword15_Battle = 0  # 戰鬥結束時的冷卻狀態,0為不需冷卻;1為記憶;2為需冷卻
  11. Sword15_Menu1 = OFF # 選單中的技能畫面,是否要顯示剩餘的冷卻時間
  12. Sword15_Menu2 = 0 # 選單中的使用標準,0為一律可用;1為沒冷卻中時可用;
  13.                                   # 2為沒冷卻中時可用(使用後變更為冷卻中);3為一律不可用
  14. Sword15_Enemy = OFF # 敵人使用冷卻技能時,是否需要冷卻
  15. Sword15_Text = ' 剩\V回合' # 技能冷卻的顯示內容,\V表示剩餘冷卻回合數
  16. #--------------------------------------------------------------
  17. #○ 技能冷卻回合(Sword15_Cooling[技能編號] = 冷卻回合數)
  18. Sword15_Cooling[57] = 3
  19. Sword15_Cooling[58] = 3
  20. Sword15_Cooling[59] = 4
  21. Sword15_Cooling[60] = 5
  22. =begin
  23. ========================================
  24. =end
  25.   $Sword ? $Sword[15] = 101 : $Sword = {15=>101} # 腳本使用標誌
  26. end
  27. # 詳細設置說明請參考:http://blog.yam.com/a870053jjkj/article/25549943
  28. #=======================================
  29. #■ 處理臨時資料的類別
  30. class Game_Temp
  31.   attr_accessor :skill_id # 技能編號(選單用)
  32.   alias sword15_initialize initialize
  33.   def initialize
  34.     @skill_id = 0 ; sword15_initialize
  35.   end
  36. end
  37. #=======================================
  38. #■ 處理戰鬥者的類別
  39. class Game_Battler
  40.   include Sword # 連接自定設置
  41.   attr_accessor :cooling  # 冷卻技能表
  42.   #-------------------------------------------------------------
  43.   #● 初始化物件
  44.   alias sword15_initialize initialize
  45.   def initialize
  46.     sword15_initialize
  47.     [url=home.php?mod=space&uid=10570]@cooling[/url] = {}
  48.     Sword15_Cooling.each_index do |index|
  49.       next if Sword15_Cooling[index] == nil # 沒設置冷卻時間的技能跳過
  50.       if Sword15_Battle == 2 ; @cooling[index] = Sword15_Cooling[index]
  51.       else ; @cooling[index] = 0 ; end
  52.     end
  53.   end
  54.   #-------------------------------------------------------------
  55.   #● 可以使用技能的判定
  56.   alias sword15_skill_can_use? skill_can_use?
  57.   def skill_can_use?(skill_id)
  58.     if Sword15_Enemy or self.is_a?(Game_Actor)
  59.       skill_id = skill_id.id if Sword15_XPVX == 1 # 將數據轉成編號(VX)
  60.       if (not $game_temp.in_battle) # 不是戰鬥中時
  61.         return sword15_skill_can_use?(skill_id) if Sword15_Menu2 == 0 # 一律可用
  62.         return false if Sword15_Cooling.has_key?(skill_id) if Sword15_Menu2 == 3
  63.       end
  64.       return false if self.cooling[skill_id] > 0 if self.cooling[skill_id] # 冷卻技能不可使用
  65.       skill_id = $data_skills[skill_id] if Sword15_XPVX == 1 # 將編號轉成數據(VX)
  66.     end
  67.     sword15_skill_can_use?(skill_id)
  68.   end
  69. end
  70. #=======================================
  71. #■ 處理角色的類別
  72. class Game_Actor < Game_Battler
  73.   include Sword # 連接自定設置
  74.   attr_reader   :actor_id # 角色編號
  75.   attr_accessor :cooling  # 冷卻技能表
  76.   #-------------------------------------------------------------
  77.   #● 初始化物件
  78.   alias sword15_setup setup
  79.   def setup(actor_id)
  80.     sword15_setup(actor_id)
  81.     @cooling = {}
  82.     Sword15_Cooling.each_index do |index|
  83.       next if Sword15_Cooling[index] == nil # 沒設置冷卻時間的技能跳過
  84.       if Sword15_Battle == 2 ; @cooling[index] = Sword15_Cooling[index]
  85.       else ; @cooling[index] = 0 ; end
  86.     end
  87.   end
  88.   #-------------------------------------------------------------
  89.   #● 變更 SP(XP)
  90.   if Sword15_Menu2 == 2 and Sword15_Battle != 0
  91.     if Sword15_XPVX == 0 ; alias sword15_sp= sp=
  92.     else ; alias sword15_mp= mp= ; end
  93.     def sp=(a)
  94.       @cooling[$game_temp.skill_id] = Sword15_Cooling[$game_temp.skill_id] if
  95.       Sword15_Cooling[$game_temp.skill_id] != nil # 自定設置有設定就設置冷卻回合
  96.       self.sword15_sp = a
  97.     end
  98.     #-----------------------------------------------------------
  99.     #●  變更 MP(VX)
  100.     def mp=(a)
  101.       @cooling[$game_temp.skill_id] = Sword15_Cooling[$game_temp.skill_id] if
  102.       Sword15_Cooling[$game_temp.skill_id] != nil # 自定設置有設定就設置冷卻回合
  103.       self.sword15_mp = a
  104.     end
  105.   end
  106. end
  107. #=======================================
  108. #■ 技能畫面、戰鬥畫面、顯示可以使用的技能的瀏覽視窗
  109. class Window_Skill < Window_Selectable
  110.   include Sword # 連接自定設置
  111.   #-------------------------------------------------------------
  112.   #● 描繪項目
  113.   alias sword15_draw_item draw_item
  114.   def draw_item(index)
  115.     if Sword15_Menu1 or $game_temp.in_battle # 允許顯示或戰鬥時的場合
  116.       text = '' # 負責存入冷卻內容的變量
  117.       if @actor.cooling[@data[index].id] ; if @actor.cooling[@data[index].id] > 0
  118.         text = Sword15_Text ; text = text.gsub(/\\[Vv]/) { @actor.cooling[@data[index].id] }
  119.         @data[index].name += text
  120.       end ; end
  121.     end
  122.     sword15_draw_item(index)
  123.     @data[index].name = @data[index].name.gsub(/#{text}/) { '' }
  124.   end
  125. end
  126. #=======================================
  127. #■ 處理戰鬥畫面的類別
  128. class Scene_Battle
  129.   include Sword # 連接自定設置
  130.   #-------------------------------------------------------------
  131.   #● 戰鬥結束
  132.   alias sword15_battle_end battle_end
  133.   def battle_end(result)
  134.     sword15_battle_end(result)
  135.     actor = Sword15_XPVX == 0 ? $game_party.actors : $game_party.members
  136.     xpvx = Sword15_XPVX == 0 ? 1 : 0
  137.     if Sword15_Battle == 0 # 當指定為「不需冷卻」的場合
  138.       (0...actor.size).each {|i| $game_actors[actor[i].id].cooling = Hash.new}
  139.     elsif Sword15_Battle == 2 # 當指定為「需冷卻」的場合
  140.       (0...actor.size).each do |i| ; (1..Sword15_Cooling.size).each do |ii|
  141.         $game_actors[actor[i].id].cooling[ii] = Sword15_Cooling[ii] + xpvx if
  142.         Sword15_Cooling[ii] != nil # 當有設置冷卻時代入冷卻回合
  143.       end ; end
  144.     end
  145.   end
  146.   #-------------------------------------------------------------
  147.   #● 產生技能行動結果(XP)
  148.   if Sword15_XPVX == 0 ; alias sword15_make_skill_action_result make_skill_action_result
  149.   else ; alias sword15_make_skill_action_result execute_action_skill ; end
  150.   def make_skill_action_result
  151.     #○ 確認敵人是否可使用該技能
  152.     skill_id = Sword15_XPVX == 0 ? @active_battler.current_action.skill_id :
  153.     @active_battler.action.skill_id # 縮短腳本長度
  154.     skill = Sword15_XPVX == 0 ?
  155.     $data_skills[@active_battler.current_action.skill_id] :
  156.     $data_skills[@active_battler.action.skill_id]
  157.     no = false
  158.     a = Sword15_XPVX == 0 ?
  159.     @active_battler.current_action.forcing : @active_battler.action.forcing
  160.     b = Sword15_XPVX == 0 ? skill.id : skill
  161.     unless a ; unless @active_battler.skill_can_use?(b)
  162.       @phase4_step = 1 if no # 跳轉到階段1
  163.       no = true
  164.     end ; end
  165.     sword15_make_skill_action_result unless no
  166.     #○ 設置冷卻回合
  167.     return if @active_battler.cooling[skill_id] > 0 if @active_battler.cooling[skill_id] != nil
  168.     xpvx = Sword15_XPVX == 0 ? 1 : 0 # XP和VX的回合數值修正
  169.     @active_battler.cooling[skill_id] = Sword15_Cooling[skill_id] + xpvx if
  170.     Sword15_Cooling[skill_id] != nil # 如果自定設置有設定就設置冷卻回合
  171.     $game_temp.forcing_battler = nil if no # 清除強制行動對象
  172.   end
  173.   #-------------------------------------------------------------
  174.   #● 執行戰鬥行動:使用技能(VX)
  175.   def execute_action_skill
  176.     make_skill_action_result
  177.   end
  178.   #-------------------------------------------------------------
  179.   #● 更新畫面 (主回合步驟 6 : 更新)(XP)
  180.   if Sword15_XPVX == 0 ; alias sword15_update_phase4_step6 update_phase4_step6
  181.   else ; alias sword15_update_phase4_step6 set_next_active_battler ; end
  182.   def update_phase4_step6
  183.     sword15_update_phase4_step6
  184.     return if @active_battler == nil # 如果行動方是空的就中斷
  185.     @active_battler.cooling.each_key do |i|
  186.       @active_battler.cooling[i] -= 1 if @active_battler.cooling[i] > 0
  187.     end
  188.   end
  189.   #-------------------------------------------------------------
  190.   #● 設置下一戰鬥者行動(VX)
  191.   def set_next_active_battler
  192.     update_phase4_step6
  193.   end
  194. end
  195. #=======================================
  196. #■ 處理技能畫面的類別
  197. class Scene_Skill
  198.   include Sword # 連接自定設置
  199.   #-------------------------------------------------------------
  200.   #● 更新畫面 (技能視窗被活化的情況下) (XP)
  201.   if Sword15_XPVX == 0 ; alias sword15_update_skill update_skill
  202.   else ; alias sword15_update_skill update_skill_selection ; end
  203.   def update_skill
  204.     $game_temp.skill_id = @skill_window.skill.id
  205.     sword15_update_skill
  206.     $game_temp.skill_id = nil if $scene.is_a?(Scene_Skill)
  207.   end
  208.   #-------------------------------------------------------------
  209.   #● 更新技能選擇(VX)
  210.   def update_skill_selection
  211.     update_skill
  212.   end
  213. end
复制代码

Lv4.逐梦者

梦石
0
星屑
9280
在线时间
2504 小时
注册时间
2011-5-20
帖子
15389

开拓者

2
发表于 2014-11-1 08:14:15 | 只看该作者
  1. #● 更新技能選擇(VX)
  2.   def update_skill_selection
  3.     update_skill
  4.   end
复制代码
这是VX的脚本吧···你为什么发到XP提问区呢···

点评

很明显这是VX/XP通用脚本,发帖前请仔细看看  发表于 2014-11-1 09:19
[img]http://service.t.sina.com.cn/widget/qmd/5339802982/c02e16bd/7.png
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-6-12 09:42

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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