Плохо! Плохо!:  0
Показано с 1 по 2 из 2

Тема: Skill Categorizations

  1. #1

    [VX] Skill Categorizations

    Этот скрипт открывает Категории скиллов:
    "Восстановление",
    "Магические",
    "Физические",
    "Резисторы",
    "Специальные",
    "Все скиллы",
    Код:
    #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
    #_/ ◆ Skill Categorizations - KGC_CategorizeSkill ◆ VX ◆
    #_/ ◇  Last Update: 03/08/2008
    #_/ ◆ Written by TOMY     
    #_/ ◆ Translation by Mr. Anonymous                  
    #_/ ◆ KGC Site:                                                   
    #_/ ◆  http://ytomy.sakura.ne.jp/                                   
    #_/ ◆ Translator's Blog:                                             
    #_/ ◆  http://mraprojects.wordpress.com     
    #_/-----------------------------------------------------------------------------
    #_/  Adds a function to the Skills screen which allows the player to display 
    #_/  skillss by catagory.
    #_/  To assign a category to an skill, you must add <category IDENTIFIER> to the
    #_/  notes on the specified item.
    #_/  EX. Fire would be listed as <category Offensive Magic> and Dual Strike 
    #_/  listed as <category Offensive Skills>, provided you use the default 
    #_/  terminology. Parts of this script are untested, however it should work as
    #_/  it is just fine. Areas untested will be highlighted by comments.
    #_/=============================================================================
    #_/ Install: Insert above other skill-related scripts.
    #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
    
    $data_system = load_data("Data/System.rvdata") if $data_system == nil
    
    #==============================================================================#
    #                             ★ Customization ★                                #
    #==============================================================================#
    
    module KGC
     module CategorizeSkill
      #              ◆ Enable Skill Categorization (Non-Combat) ◆
      #   If this is set to true, the Skill Categories menu will be in effect in
      #   the main skills menu.
      #   If set to false, it will not. If that's the case, you must set 
      #   USE_SAME_MENU to false.
      ENABLE_NOT_IN_BATTLE = true
      #                ◆ Enable Skill Categorization (Combat) ◆
      #   If this is set to true, the Skill Categories menu will be in effect in
      #   the skills menu during battle sequences.
      #   If set to false, it will not. If that's the case, you must set 
      #   USE_SAME_MENU to false.
      ENABLE_IN_BATTLE     = true
    
      #             ◆ Combat and Non-Combat Categorization Syncronize ◆
      #   If ENABLE_NOT_IN_BATTLE & ENABLE_IN_BATTLE are set to true, set this to
      #   true. Otherwise, set it to false.
      #   Essentially, under the true condition, the Skill Categories menu will be
      #   the same in and out of battle. Under the false condition, you may use 
      #   different categories or text for battle and non-battle menus.
      USE_SAME_CATEGORY = true
    
      #                    ◆ Automatically Catagorize Skills ◆
      #   If you intend to actually utilize this script, this must be set to true.
      ENABLE_AUTO_CATEGORIZE = true
    
      #                   ◆ Duplicate Category Entries. ◆
      #  Set to false, items can have multiple categories.
      #  Set to true, items will be classified under the last tag (In the item
      #   database "Notes")
      NOT_ALLOW_DUPLICATE = false
      
      #                  ◆ Recall Skill Category (Combat) ◆
      #   true = Automatically highlight the category of skills last used.
      #   false = Reset to the value in SKILL_DEFAULT_CATEGORY_BATTLE.
      REMEMBER_INDEX_IN_BATTLE = true
    
      #                    ◆ Vocabulary Modifications ◆
    
      #                      ◆ Category Identifier ◆ 
      #  Arrange names in order to syncronize a category with the category 
      #  identifier. 
      #  The comments to the right of each identifier are supposed to be how the
      #  RESERVED_CATEGORY_IDENTIFIER sorts extra categories into these fields.
      #  However, this is untested.
      #  These are the default skill catagories translated for future reference.
      #  "Recovery", "Offensive Magic", "Offensive Skills", 
      #  "Assist", "Special Skills", "All Skills" 
      CATEGORY_IDENTIFIER = [
        "Recovery",         # Recovery / Recovery Magic / Recovery Skills
        "Magical",  # Offensive Magic
        "Physical", # Offensive Skills
        "Assist",    # Assist / Assist Magic / Assist Skills
        "Special",   # Special Skills
        "All Skills", # All Skills
      ]
      
      #                     ◆ Default Catagory Display ◆
      #  Affects which category is highlighted by default.
      SKILL_DEFAULT_CATEGORY = "All Skills"
    
      #                    ◆ Skill Screen Category Name ◆
      #  Allows you to change the names of the skill categories that are displayed
      #  in-game. These must be arranged in the same order as CATAGORY_IDENTIFIER.
      CATEGORY_NAME = [
        "Восстановление",
        "Магические",
        "Физические",
        "Резисторы",
        "Специальные",
        "Все скиллы",
      ]
    
      #                       ◆ Descriptive Text ◆
      #  This affects the text displayed in the skill description ("help") window.
      #  These must be arranged in the same order as CATAGORY_IDENTIFIER.
      CATEGORY_DESCRIPTION = [
        "Viewing Recovery #{Vocab.skill}.",
        "Viewing Offensive Magic.",
        "Viewing Physical Skills.",
        "Viewing Assist #{Vocab.skill}.",
        "Viewing Special #{Vocab.skill}.",
        "Viewing All #{Vocab.skill}.",
      ]
    
    
      #-------------------------- Battle Categories ------------------------------#
      #    You ONLY a need to modify these if USE_SAME_CATEGORY is set to false.  #   
      #---------------------------------------------------------------------------#
    
      #                 ◆ Battle Category Identifier ◆
      #  Arrange names in order to syncronize a category with the category 
      #  identifier. 
      CATEGORY_IDENTIFIER_BATTLE = [
        "Recovery",
        "Magical",
        "Physical",
        "Assist",
        "Special",
        "All Skills",
      ]
      #                ◆ Default Battle Catagory Display ◆
      #  See DEFAULT_CATEGORY_BATTLE
      SKILL_DEFAULT_CATEGORY_BATTLE = "All Skills"
    
      #               ◆ Battle Skill Screen Category Name ◆
      #  Allows you to change the names of the skill categories (for battle).
      #  Must be arranged in the same order as CATAGORY_IDENTIFIER.
      CATEGORY_NAME_BATTLE = [
        "Recovery",
        "Magical",
        "Physical",
        "Assist",
        "Special",
        "All Skills",
      ]
    
      #                 ◆ Battle Skill Descriptive Text ◆
      #  This affects the text displayed in the skill description "help" window.
      #  Must be arranged in the same order as CATAGORY_IDENTIFIER
      CATEGORY_DESCRIPTION_BATTLE = [
        "Viewing Recovery #{Vocab.skill}.",
        "Viewing Offensive Magic.",
        "Viewing Physical Skills.",
        "Viewing Assist #{Vocab.skill}.",
        "Viewing Special #{Vocab.skill}.",
        "Viewing All #{Vocab.skill}.",
      ]
    
      if USE_SAME_CATEGORY
        # When USE_SAME_CATEGORY = true
        CATEGORY_IDENTIFIER_BATTLE    = CATEGORY_IDENTIFIER
        SKILL_DEFAULT_CATEGORY_BATTLE = SKILL_DEFAULT_CATEGORY
        CATEGORY_NAME_BATTLE          = CATEGORY_NAME
        CATEGORY_DESCRIPTION_BATTLE   = CATEGORY_DESCRIPTION
      end
    
    
      # Catagory Window Position Properties
    
      # ◆ Coordinates of skill description window. [ x, y ]
      CATEGORY_WINDOW_POSITION  = [1, 48]
      # ◆ Number of rows in the skill description window.
      CATEGORY_WINDOW_COLUMNS   = 6
      # ◆ Skill description window column line width.
      CATEGORY_WINDOW_COL_WIDTH = 84
      # ◆ Skill description window column spacer width.
      CATEGORY_WINDOW_COL_SPACE = 1
    
    
      # Battle Catagory Window Position Properties
    
      # ◆ Coordinates of skill description window. [ x, y ]
      CATEGORY_WINDOW_POSITION_BATTLE  = [1, 48]
      # ◆ Number of rows in the skill description window.
      CATEGORY_WINDOW_COLUMNS_BATTLE   = 6
      # ◆ Skill description window column line width.
      CATEGORY_WINDOW_COL_WIDTH_BATTLE = 84
      # ◆ Skill description window column spacer width.
      CATEGORY_WINDOW_COL_SPACE_BATTLE = 1
      end
    end
    
    #---------------------- Reserved Categories and Indexes -----------------------#
    
    $imported = {} if $imported == nil
    $imported["CategorizeSkill"] = true
    
    module KGC::CategorizeSkill
      # CATEGORY_IDENTIFIER index
      SKILL_DEFAULT_CATEGORY_INDEX =
        CATEGORY_IDENTIFIER.index(SKILL_DEFAULT_CATEGORY)
      # CATEGORY_IDENTIFIER_BATTLE index (Battle)
      SKILL_DEFAULT_CATEGORY_INDEX_BATTLE =
        CATEGORY_IDENTIFIER_BATTLE.index(SKILL_DEFAULT_CATEGORY_BATTLE)
    
      #                     ◆ Reserved Category Index ◆
      #  To be honest I'm not entirely sure what this affects.
      #  According to the original scripter(s), you can assign these categories to
      #  skills and they'll be sorted automatically into the approperiate category.
      #  However, I haven't tested this. If anyone does, please let me know.
      #  These are the default reserved skill catagories for future reference.
      #  "All Skills", "Recovery", "Recovery Magic", "Recovery Skills", "Attack", 
      #  "Attack Magic", "Attack Skills", "Assist", "Assist Magic", 
      #  "Assist Skills"
      RESERVED_CATEGORIES = [
        "All Skills", "Recovery", "Recovery Magic", "Recovery Skills", "Attack", 
        "Magical", "Physical", "Assist", "Assist Magic", 
        "Assist Skills"
      ]
      # RESERVED_CATEGORY index
      RESERVED_CATEGORY_INDEX = {}
      # RESERVED_CATEGORY_INDEX_BATTLE index (Battle)
      RESERVED_CATEGORY_INDEX_BATTLE = {}
    
      # 予約カテゴリ index 作成
      RESERVED_CATEGORIES.each { |c|
        RESERVED_CATEGORY_INDEX[c] = CATEGORY_IDENTIFIER.index(c)
        RESERVED_CATEGORY_INDEX_BATTLE[c] = CATEGORY_IDENTIFIER_BATTLE.index(c)
      }
      
    # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * #
    #  Unless you know what you're doing, it's best not to alter anything beyond  #
    #  this point, as this only affects the tags used for "Notes" in database.    #
    # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * #
    #  Whatever word(s) are after the separator ( | ) in the following lines are 
    #   what are used to determine what is searched for in the "Notes" section.
    
      # Regular Expression Defined
      module Regexp
        # Base Skill Module
        module Skill
          # Catagory Tag String
          CATEGORY = /<(?:CATEGORY|classification|category?)[ ]*(.*)>/i
        end
      end
    end
    
    #==============================================================================
    # ■ RPG::Skill
    #==============================================================================
    
    class RPG::Skill < RPG::UsableItem
      #--------------------------------------------------------------------------
      # ○ スキル分類のキャッシュ生成 (非戦闘時)
      #--------------------------------------------------------------------------
      def create_categorize_skill_cache
        @__skill_category = []
    
        # 自動振り分け
        if KGC::CategorizeSkill::ENABLE_AUTO_CATEGORIZE
          prefix = auto_categorize_prefix
          if prefix != nil
            suffix = auto_categorize_suffix
            @__skill_category <<
              KGC::CategorizeSkill::RESERVED_CATEGORY_INDEX[prefix]
            @__skill_category <<
              KGC::CategorizeSkill::RESERVED_CATEGORY_INDEX[prefix + suffix]
          end
          @__skill_category.compact!
        end
    
        # メモ欄
        self.note.split(/[\r\n]+/).each { |line|
          if line =~ KGC::CategorizeSkill::Regexp::Skill::CATEGORY
            # カテゴリ
            c = KGC::CategorizeSkill::CATEGORY_IDENTIFIER.index($1)
            @__skill_category << c if c != nil
          end
        }
    
        if @__skill_category.empty?
          @__skill_category << KGC::CategorizeSkill::SKILL_DEFAULT_CATEGORY_INDEX
        elsif KGC::CategorizeSkill::NOT_ALLOW_DUPLICATE
          # 最後に指定したカテゴリに配置
          @__skill_category = [@__skill_category.pop]
        end
      end
      #--------------------------------------------------------------------------
      # ○ スキル分類のキャッシュ生成 (戦闘時)
      #--------------------------------------------------------------------------
      def create_categorize_skill_battle_cache
        @__skill_category_battle = []
    
        # 自動振り分け
        if KGC::CategorizeSkill::ENABLE_AUTO_CATEGORIZE
          prefix = auto_categorize_prefix
          if prefix != nil
            suffix = auto_categorize_suffix
            @__skill_category_battle <<
              KGC::CategorizeSkill::RESERVED_CATEGORY_INDEX_BATTLE[prefix]
            @__skill_category_battle <<
              KGC::CategorizeSkill::RESERVED_CATEGORY_INDEX_BATTLE[prefix + suffix]
          end
          @__skill_category_battle.compact!
        end
    
        # メモ欄
        self.note.split(/[\r\n]+/).each { |line|
          if line =~ KGC::CategorizeSkill::Regexp::Skill::CATEGORY
            # カテゴリ
            c = KGC::CategorizeSkill::CATEGORY_IDENTIFIER_BATTLE.index($1)
            @__skill_category_battle << c if c != nil
          end
        }
    
        if @__skill_category_battle.empty?
          @__skill_category_battle <<
            KGC::CategorizeSkill::SKILL_DEFAULT_CATEGORY_INDEX_BATTLE
        elsif KGC::CategorizeSkill::NOT_ALLOW_DUPLICATE
          # 最後に指定したカテゴリに配置
          @__skill_category_battle = [@__skill_category_battle.pop]
        end
      end
      #--------------------------------------------------------------------------
      # ○ 自動振り分け先の接頭辞
      #--------------------------------------------------------------------------
      def auto_categorize_prefix
        if is_recover?
          return "Recovery"
        elsif is_attack?
          return "Attack"
        elsif is_assist?
          return "Assist"
        else
          return nil
        end
      end
      #--------------------------------------------------------------------------
      # ○ 自動振り分け先の接尾辞
      #--------------------------------------------------------------------------
      def auto_categorize_suffix
        return (physical_attack ? "Skill" : "Magic")
      end
      #--------------------------------------------------------------------------
      # ○ 回復スキル判定
      #--------------------------------------------------------------------------
      def is_recover?
        result = for_friend?            # 対象が味方
        result &= (occasion != 3)       # 使用不可でない
        result &= (base_damage < 0) ||  # ダメージ量が負、または
          (plus_state_set.empty? &&     # ステートを付加せずに解除する
           !minus_state_set.empty?)
        return result
      end
      #--------------------------------------------------------------------------
      # ○ 攻撃スキル判定
      #--------------------------------------------------------------------------
      def is_attack?
        result = for_opponent?       # 対象が敵
        result &= battle_ok?         # 戦闘中に使用可能
        result &= (base_damage > 0)  # ダメージ量が正
        return result
      end
      #--------------------------------------------------------------------------
      # ○ 補助スキル判定
      #--------------------------------------------------------------------------
      def is_assist?
        result = (scope != 0)                 # 対象が [なし] 以外
        result &= battle_ok?                  # 戦闘中に使用可能
        result &= !(plus_state_set.empty? &&
          minus_state_set.empty?)             # ステートが変化する
        return result
      end
      #--------------------------------------------------------------------------
      # ○ スキルのカテゴリ (非戦闘時)
      #--------------------------------------------------------------------------
      def skill_category
        create_categorize_skill_cache if @__skill_category == nil
        return @__skill_category
      end
      #--------------------------------------------------------------------------
      # ○ スキルのカテゴリ (戦闘時)
      #--------------------------------------------------------------------------
      def skill_category_battle
        create_categorize_skill_battle_cache if @__skill_category_battle == nil
        return @__skill_category_battle
      end
    end
    
    #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
    
    #==============================================================================
    # ■ Game_Actor
    #==============================================================================
    
    class Game_Actor < Game_Battler
      #--------------------------------------------------------------------------
      # ● 公開インスタンス変数
      #--------------------------------------------------------------------------
      attr_writer   :last_skill_category      # カーソル記憶用 : スキルカテゴリ
      #--------------------------------------------------------------------------
      # ● オブジェクト初期化
      #     actor_id : アクター ID
      #--------------------------------------------------------------------------
      alias initialize_KGC_CategorizeSkill initialize
      def initialize(actor_id)
        initialize_KGC_CategorizeSkill(actor_id)
    
        @last_skill_category = 0
      end
      #--------------------------------------------------------------------------
      # ○ カーソル記憶用のカテゴリ取得
      #--------------------------------------------------------------------------
      def last_skill_category
        @last_skill_category = 0 if @last_skill_category == nil
        return @last_skill_category
      end
    end
    
    #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
    
    #==============================================================================
    # ■ Window_Skill
    #==============================================================================
    
    class Window_Skill < Window_Selectable
      #--------------------------------------------------------------------------
      # ● 公開インスタンス変数
      #--------------------------------------------------------------------------
      attr_reader   :category                 # カテゴリ
      #--------------------------------------------------------------------------
      # ● オブジェクト初期化
      #     x      : ウィンドウの X 座標
      #     y      : ウィンドウの Y 座標
      #     width  : ウィンドウの幅
      #     height : ウィンドウの高さ
      #     actor  : アクター
      #--------------------------------------------------------------------------
      alias initialize_KGC_CategorizeSkill initialize
      def initialize(x, y, width, height, actor)
        @category = 0
    
        initialize_KGC_CategorizeSkill(x, y, width, height, actor)
      end
      #--------------------------------------------------------------------------
      # ○ カテゴリ設定
      #--------------------------------------------------------------------------
      def category=(value)
        @category = value
        refresh
      end
      #--------------------------------------------------------------------------
      # ○ スキルをリストに含めるかどうか
      #     skill : スキル
      #--------------------------------------------------------------------------
      unless $@
        alias include_KGC_CategorizeSkill? include? if method_defined?(:include?)
      end
      def include?(skill)
        return false if skill == nil
    
        if defined?(include_KGC_CategorizeSkill?)
          return false unless include_KGC_CategorizeSkill?(skill)
        end
    
        # 分類しない場合は含める
        if $game_temp.in_battle
          return true unless KGC::CategorizeSkill::ENABLE_IN_BATTLE
          reserved_index = KGC::CategorizeSkill::RESERVED_CATEGORY_INDEX_BATTLE
          skill_category = skill.skill_category_battle
        else
          return true unless KGC::CategorizeSkill::ENABLE_NOT_IN_BATTLE
          reserved_index = KGC::CategorizeSkill::RESERVED_CATEGORY_INDEX
          skill_category = skill.skill_category
        end
        # 「全種」なら含める
        return true if @category == reserved_index["All Skills"]
        # カテゴリ一致判定
        return (skill_category.include?(@category))
      end
      #--------------------------------------------------------------------------
      # ● リフレッシュ
      #--------------------------------------------------------------------------
      def refresh
        @data = []
        for skill in @actor.skills
          next unless include?(skill)
          @data.push(skill)
          if skill.id == @actor.last_skill_id
            self.index = @data.size - 1
          end
        end
        @item_max = @data.size
        create_contents
        for i in 0...@item_max
          draw_item(i)
        end
      end
    end
    
    #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
    
    #==============================================================================
    # □ Window_SkillCategory
    #------------------------------------------------------------------------------
    #  スキル画面でカテゴリ選択を行うウィンドウです。
    #==============================================================================
    
    class Window_SkillCategory < Window_Command
      #--------------------------------------------------------------------------
      # ● オブジェクト初期化
      #--------------------------------------------------------------------------
      def initialize
        if $game_temp.in_battle
          cols = KGC::CategorizeSkill::CATEGORY_WINDOW_COLUMNS_BATTLE
          width = KGC::CategorizeSkill::CATEGORY_WINDOW_COL_WIDTH_BATTLE
          space = KGC::CategorizeSkill::CATEGORY_WINDOW_COL_SPACE_BATTLE
          commands = KGC::CategorizeSkill::CATEGORY_NAME_BATTLE
          position = KGC::CategorizeSkill::CATEGORY_WINDOW_POSITION_BATTLE
        else
          cols = KGC::CategorizeSkill::CATEGORY_WINDOW_COLUMNS
          width = KGC::CategorizeSkill::CATEGORY_WINDOW_COL_WIDTH
          space = KGC::CategorizeSkill::CATEGORY_WINDOW_COL_SPACE
          commands = KGC::CategorizeSkill::CATEGORY_NAME
          position = KGC::CategorizeSkill::CATEGORY_WINDOW_POSITION
        end
        width = width * cols + 32
        width += (cols - 1) * space
        super(width, commands, cols, 0, space)
        self.x = position[0]
        self.y = position[1]
        self.z = 1000
        self.index = 0
      end
      #--------------------------------------------------------------------------
      # ● ヘルプテキスト更新
      #--------------------------------------------------------------------------
      def update_help
        if $game_temp.in_battle
          text = KGC::CategorizeSkill::CATEGORY_DESCRIPTION[self.index]
        else
          text = KGC::CategorizeSkill::CATEGORY_DESCRIPTION_BATTLE[self.index]
        end
        @help_window.set_text(text)
      end
    end
    
    #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
    
    #==============================================================================
    # ■ Scene_Skill
    #==============================================================================
    
    if KGC::CategorizeSkill::ENABLE_NOT_IN_BATTLE
    class Scene_Skill < Scene_Base
      #--------------------------------------------------------------------------
      # ● 開始処理
      #--------------------------------------------------------------------------
      alias start_KGC_CategorizeSkill start
      def start
        start_KGC_CategorizeSkill
    
        @category_window = Window_SkillCategory.new
        @category_window.help_window = @help_window
        show_category_window
      end
      #--------------------------------------------------------------------------
      # ● 終了処理
      #--------------------------------------------------------------------------
      alias terminate_KGC_CategorizeSkill terminate
      def terminate
        terminate_KGC_CategorizeSkill
    
        @category_window.dispose
      end
      #--------------------------------------------------------------------------
      # ● フレーム更新
      #--------------------------------------------------------------------------
      alias update_KGC_CategorizeSkill update
      def update
        @category_window.update
    
        update_KGC_CategorizeSkill
    
        if @category_window.active
          update_category_selection
        end
      end
      #--------------------------------------------------------------------------
      # ○ カテゴリ選択の更新
      #--------------------------------------------------------------------------
      def update_category_selection
        unless @category_activated
          @category_activated = true
          return
        end
    
        # 選択カテゴリー変更
        if @last_category_index != @category_window.index
          @skill_window.category = @category_window.index
          @skill_window.refresh
          @last_category_index = @category_window.index
        end
    
        if Input.trigger?(Input::B)
          Sound.play_cancel
          return_scene
        elsif Input.trigger?(Input::C)
          Sound.play_decision
          hide_category_window
        elsif Input.trigger?(Input::R)
          Sound.play_cursor
          next_actor
        elsif Input.trigger?(Input::L)
          Sound.play_cursor
          prev_actor
        end
      end
      #--------------------------------------------------------------------------
      # ● スキル選択の更新
      #--------------------------------------------------------------------------
      alias update_skill_selection_KGC_CategorizeSkill update_skill_selection
      def update_skill_selection
        if Input.trigger?(Input::B)
          Sound.play_cancel
          show_category_window
          return
        elsif Input.trigger?(Input::R) || Input.trigger?(Input::L)
          # 何もしない
          return
        end
    
        update_skill_selection_KGC_CategorizeSkill
      end
      #--------------------------------------------------------------------------
      # ○ カテゴリウィンドウの表示
      #--------------------------------------------------------------------------
      def show_category_window
        @category_window.open
        @category_window.active = true
        @skill_window.active = false
      end
      #--------------------------------------------------------------------------
      # ○ カテゴリウィンドウの非表示
      #--------------------------------------------------------------------------
      def hide_category_window
        @category_activated = false
        @category_window.close
        @category_window.active = false
        @skill_window.active = true
        # スキルウィンドウのインデックスを調整
        if @skill_window.index >= @skill_window.item_max
          @skill_window.index = [@skill_window.item_max - 1, 0].max
        end
      end
    end
    end
    
    #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
    
    #==============================================================================
    # ■ Scene_Battle
    #==============================================================================
    
    if KGC::CategorizeSkill::ENABLE_IN_BATTLE
    class Scene_Battle < Scene_Base
      #--------------------------------------------------------------------------
      # ● スキル選択の開始
      #--------------------------------------------------------------------------
      alias start_skill_selection_KGC_CategorizeSkill start_skill_selection
      def start_skill_selection
        start_skill_selection_KGC_CategorizeSkill
    
        # カテゴリウィンドウを作成
        @category_window = Window_SkillCategory.new
        @category_window.help_window = @help_window
        @category_window.z = @help_window.z + 10
        @skill_window.active = false
    
        # 記憶していたカテゴリを復元
        if KGC::CategorizeSkill::REMEMBER_INDEX_IN_BATTLE
          @category_window.index = @active_battler.last_skill_category
          @skill_window.category = @category_window.index
          @skill_window.refresh
        end
      end
      #--------------------------------------------------------------------------
      # ● スキル選択の終了
      #--------------------------------------------------------------------------
      alias end_skill_selection_KGC_CategorizeSkill end_skill_selection
      def end_skill_selection
        if @category_window != nil
          @category_window.dispose
          @category_window = nil
        end
    
        end_skill_selection_KGC_CategorizeSkill
      end
      #--------------------------------------------------------------------------
      # ● スキル選択の更新
      #--------------------------------------------------------------------------
      alias update_skill_selection_KGC_CategorizeSkill update_skill_selection
      def update_skill_selection
        @category_window.update
        if @category_window.active
          update_skill_category_selection
          return
        elsif Input.trigger?(Input::B)
          Sound.play_cancel
          show_category_window
          return
        end
    
        update_skill_selection_KGC_CategorizeSkill
      end
      #--------------------------------------------------------------------------
      # ● スキルの決定
      #--------------------------------------------------------------------------
      alias determine_skill_KGC_CategorizeSkill determine_skill
      def determine_skill
        # 選択したカテゴリを記憶
        if KGC::CategorizeSkill::REMEMBER_INDEX_IN_BATTLE && @category_window != nil
          @active_battler.last_skill_category = @category_window.index
        end
    
        determine_skill_KGC_CategorizeSkill
      end
      #--------------------------------------------------------------------------
      # ○ スキルのカテゴリ選択の更新
      #--------------------------------------------------------------------------
      def update_skill_category_selection
        @help_window.update
    
        # 選択カテゴリー変更
        if @last_category_index != @category_window.index
          @skill_window.category = @category_window.index
          @skill_window.refresh
          @last_category_index = @category_window.index
        end
    
        if Input.trigger?(Input::B)
          Sound.play_cancel
          end_skill_selection
        elsif Input.trigger?(Input::C)
          Sound.play_decision
          hide_category_window
        end
      end
      #--------------------------------------------------------------------------
      # ○ カテゴリウィンドウの表示
      #--------------------------------------------------------------------------
      def show_category_window
        @category_window.open
        @category_window.active = true
        @skill_window.active = false
      end
      #--------------------------------------------------------------------------
      # ○ カテゴリウィンドウの非表示
      #--------------------------------------------------------------------------
      def hide_category_window
        @category_activated = false
        @category_window.close
        @category_window.active = false
        @skill_window.active = true
        # スキルウィンドウのインデックスを調整
        if @skill_window.index >= @skill_window.item_max
          @skill_window.index = [@skill_window.item_max - 1, 0].max
        end
      end
    end
    end
    
    #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
    #_/  The original untranslated version of this script can be found here:
    # http://f44.aaa.livedoor.jp/~ytomy/tk...ategorize_item
    #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
    Изображения Изображения
    Последний раз редактировалось vancar; 13.01.2012 в 13:38.
    Я очень злой дядя.....Так что думайте перед тем когда говорить!
    Спрайты тут http://rpgmaker.su/album.php?u=2719

  2. #2

    По умолчанию

    Курить до просветления. И чем быстрее исправишь, тем лучше - модераторы уже вышли на охоту.

Информация о теме

Пользователи, просматривающие эту тему

Эту тему просматривают: 1 (пользователей: 0 , гостей: 1)

Социальные закладки

Социальные закладки

Ваши права

  • Вы не можете создавать новые темы
  • Вы не можете отвечать в темах
  • Вы не можете прикреплять вложения
  • Вы не можете редактировать свои сообщения
  •  
Skill Categorizations