- module Sword 
-   ON = true ; OFF = false ; Sword15_Cooling = Array.new 
- #======================================= 
- #★ 魔劍工舖 - 技能冷卻1.02 
- # 轉貼腳本請著名出處:[url]http://blog.yam.com/a870053jjkj/[/url] 
- # 如果採用在遊戲中,看你高興是否顯示腳本出處,但嚴禁說是自己寫的腳本!! 
- #======================================= 
- #● 使用者自定設置 
- Sword15_XPVX = 0 # 此腳本用於XP時設為0;此腳本用在VX時設為1 
- Sword15_Battle = 0  # 戰鬥結束時的冷卻狀態,0為不需冷卻;1為記憶;2為需冷卻 
- Sword15_Menu1 = OFF # 選單中的技能畫面,是否要顯示剩餘的冷卻時間 
- Sword15_Menu2 = 0 # 選單中的使用標準,0為一律可用;1為沒冷卻中時可用; 
-                                   # 2為沒冷卻中時可用(使用後變更為冷卻中);3為一律不可用 
- Sword15_Enemy = OFF # 敵人使用冷卻技能時,是否需要冷卻 
- Sword15_Text = ' 剩\V回合' # 技能冷卻的顯示內容,\V表示剩餘冷卻回合數 
- #-------------------------------------------------------------- 
- #○ 技能冷卻回合(Sword15_Cooling[技能編號] = 冷卻回合數) 
- Sword15_Cooling[54] = 4 
- Sword15_Cooling[55] = 4 
- Sword15_Cooling[56] = 4 
- Sword15_Cooling[57] = 4 
- =begin 
- ======================================== 
- =end 
-   $Sword ? $Sword[15] = 101 : $Sword = {15=>101} # 腳本使用標誌 
- end 
- # 詳細設置說明請參考:[url]http://blog.yam.com/a870053jjkj/article/25549943[/url] 
- #======================================= 
- #■ 處理臨時資料的類別 
- class Game_Temp 
-   attr_accessor :skill_id # 技能編號(選單用) 
-   alias sword15_initialize initialize 
-   def initialize 
-     @skill_id = 0 ; sword15_initialize 
-   end 
- end 
- #======================================= 
- #■ 處理戰鬥者的類別 
- class Game_Battler 
-   include Sword # 連接自定設置 
-   attr_accessor :cooling  # 冷卻技能表 
-   #------------------------------------------------------------- 
-   #● 初始化物件 
-   alias sword15_initialize initialize 
-   def initialize 
-     sword15_initialize 
-     [url=home.php?mod=space&uid=10570]@cooling[/url] = {} 
-     Sword15_Cooling.each_index do |index| 
-       next if Sword15_Cooling[index] == nil # 沒設置冷卻時間的技能跳過 
-       if Sword15_Battle == 2 ; @cooling[index] = Sword15_Cooling[index] 
-       else ; @cooling[index] = 0 ; end 
-     end 
-   end 
-   #------------------------------------------------------------- 
-   #● 可以使用技能的判定 
-   alias sword15_skill_can_use? skill_can_use? 
-   def skill_can_use?(skill_id) 
-     if Sword15_Enemy or self.is_a?(Game_Actor) 
-       skill_id = skill_id.id if Sword15_XPVX == 1 # 將數據轉成編號(VX) 
-       if (not $game_temp.in_battle) # 不是戰鬥中時 
-         return sword15_skill_can_use?(skill_id) if Sword15_Menu2 == 0 # 一律可用 
-         return false if Sword15_Cooling.has_key?(skill_id) if Sword15_Menu2 == 3 
-       end 
-       return false if self.cooling[skill_id] > 0 if self.cooling[skill_id] # 冷卻技能不可使用 
-       skill_id = $data_skills[skill_id] if Sword15_XPVX == 1 # 將編號轉成數據(VX) 
-     end 
-     sword15_skill_can_use?(skill_id) 
-   end 
- end 
- #======================================= 
- #■ 處理角色的類別 
- class Game_Actor < Game_Battler 
-   include Sword # 連接自定設置 
-   attr_reader   :actor_id # 角色編號 
-   attr_accessor :cooling  # 冷卻技能表 
-   #------------------------------------------------------------- 
-   #● 初始化物件 
-   alias sword15_setup setup 
-   def setup(actor_id) 
-     sword15_setup(actor_id) 
-     @cooling = {} 
-     Sword15_Cooling.each_index do |index| 
-       next if Sword15_Cooling[index] == nil # 沒設置冷卻時間的技能跳過 
-       if Sword15_Battle == 2 ; @cooling[index] = Sword15_Cooling[index] 
-       else ; @cooling[index] = 0 ; end 
-     end 
-   end 
-   #------------------------------------------------------------- 
-   #● 變更 SP(XP) 
-   if Sword15_Menu2 == 2 and Sword15_Battle != 0 
-     if Sword15_XPVX == 0 ; alias sword15_sp= sp= 
-     else ; alias sword15_mp= mp= ; end 
-     def sp=(a) 
-       @cooling[$game_temp.skill_id] = Sword15_Cooling[$game_temp.skill_id] if  
-       Sword15_Cooling[$game_temp.skill_id] != nil # 自定設置有設定就設置冷卻回合 
-       self.sword15_sp = a 
-     end 
-     #----------------------------------------------------------- 
-     #●  變更 MP(VX) 
-     def mp=(a) 
-       @cooling[$game_temp.skill_id] = Sword15_Cooling[$game_temp.skill_id] if  
-       Sword15_Cooling[$game_temp.skill_id] != nil # 自定設置有設定就設置冷卻回合 
-       self.sword15_mp = a 
-     end 
-   end 
- end 
- #======================================= 
- #■ 技能畫面、戰鬥畫面、顯示可以使用的技能的瀏覽視窗 
- class Window_Skill < Window_Selectable 
-   include Sword # 連接自定設置 
-   #------------------------------------------------------------- 
-   #● 描繪項目 
-   alias sword15_draw_item draw_item 
-   def draw_item(index) 
-     if Sword15_Menu1 or $game_temp.in_battle # 允許顯示或戰鬥時的場合 
-       text = '' # 負責存入冷卻內容的變量 
-       if @actor.cooling[@data[index].id] ; if @actor.cooling[@data[index].id] > 0  
-         text = Sword15_Text ; text = text.gsub(/\\[Vv]/) { @actor.cooling[@data[index].id] } 
-         @data[index].name += text 
-       end ; end 
-     end 
-     sword15_draw_item(index) 
-     @data[index].name = @data[index].name.gsub(/#{text}/) { '' } 
-   end 
- end 
- #======================================= 
- #■ 處理戰鬥畫面的類別 
- class Scene_Battle 
-   include Sword # 連接自定設置 
-   #------------------------------------------------------------- 
-   #● 戰鬥結束 
-   alias sword15_battle_end battle_end 
-   def battle_end(result) 
-     sword15_battle_end(result) 
-     actor = Sword15_XPVX == 0 ? $game_party.actors : $game_party.members 
-     xpvx = Sword15_XPVX == 0 ? 1 : 0 
-     if Sword15_Battle == 0 # 當指定為「不需冷卻」的場合 
-       (0...actor.size).each {|i| $game_actors[actor[i].id].cooling = Hash.new} 
-     elsif Sword15_Battle == 2 # 當指定為「需冷卻」的場合 
-       (0...actor.size).each do |i| ; (1..Sword15_Cooling.size).each do |ii| 
-         $game_actors[actor[i].id].cooling[ii] = Sword15_Cooling[ii] + xpvx if 
-         Sword15_Cooling[ii] != nil # 當有設置冷卻時代入冷卻回合 
-       end ; end 
-     end 
-   end 
-   #------------------------------------------------------------- 
-   #● 產生技能行動結果(XP) 
-   if Sword15_XPVX == 0 ; alias sword15_make_skill_action_result make_skill_action_result 
-   else ; alias sword15_make_skill_action_result execute_action_skill ; end 
-   def make_skill_action_result 
-     #○ 確認敵人是否可使用該技能 
-     skill_id = Sword15_XPVX == 0 ? @active_battler.current_action.skill_id : 
-     @active_battler.action.skill_id # 縮短腳本長度 
-     skill = Sword15_XPVX == 0 ? 
-     $data_skills[@active_battler.current_action.skill_id] : 
-     $data_skills[@active_battler.action.skill_id] 
-     no = false 
-     a = Sword15_XPVX == 0 ? 
-     @active_battler.current_action.forcing : @active_battler.action.forcing 
-     b = Sword15_XPVX == 0 ? skill.id : skill 
-     unless a ; unless @active_battler.skill_can_use?(b) 
-       @phase4_step = 1 if no # 跳轉到階段1 
-       no = true 
-     end ; end 
-     sword15_make_skill_action_result unless no 
-     #○ 設置冷卻回合 
-     return if @active_battler.cooling[skill_id] > 0 if @active_battler.cooling[skill_id] != nil 
-     xpvx = Sword15_XPVX == 0 ? 1 : 0 # XP和VX的回合數值修正 
-     @active_battler.cooling[skill_id] = Sword15_Cooling[skill_id] + xpvx if  
-     Sword15_Cooling[skill_id] != nil # 如果自定設置有設定就設置冷卻回合 
-     $game_temp.forcing_battler = nil if no # 清除強制行動對象 
-   end 
-   #------------------------------------------------------------- 
-   #● 執行戰鬥行動:使用技能(VX) 
-   def execute_action_skill 
-     make_skill_action_result 
-   end 
-   #------------------------------------------------------------- 
-   #● 更新畫面 (主回合步驟 6 : 更新)(XP) 
-   if Sword15_XPVX == 0 ; alias sword15_update_phase4_step6 update_phase4_step6 
-   else ; alias sword15_update_phase4_step6 set_next_active_battler ; end 
-   def update_phase4_step6 
-     sword15_update_phase4_step6 
-     return if @active_battler == nil # 如果行動方是空的就中斷 
-     @active_battler.cooling.each_key do |i|  
-       @active_battler.cooling[i] -= 1 if @active_battler.cooling[i] > 0  
-     end 
-   end 
-   #------------------------------------------------------------- 
-   #● 設置下一戰鬥者行動(VX) 
-   def set_next_active_battler 
-     update_phase4_step6 
-   end 
- end 
- #======================================= 
- #■ 處理技能畫面的類別 
- class Scene_Skill 
-   include Sword # 連接自定設置 
-   #------------------------------------------------------------- 
-   #● 更新畫面 (技能視窗被活化的情況下) (XP) 
-   if Sword15_XPVX == 0 ; alias sword15_update_skill update_skill 
-   else ; alias sword15_update_skill update_skill_selection ; end 
-   def update_skill 
-     $game_temp.skill_id = @skill_window.skill.id 
-     sword15_update_skill 
-     $game_temp.skill_id = nil if $scene.is_a?(Scene_Skill) 
-   end 
-   #------------------------------------------------------------- 
-   #● 更新技能選擇(VX) 
-   def update_skill_selection 
-     update_skill 
-   end 
- end