AccueilAccueil  PortailPortail  RechercherRechercher  Dernières imagesDernières images  S'enregistrerS'enregistrer  ConnexionConnexion  



Le Deal du moment : -38%
Ecran PC gaming 23,8″ – ACER KG241Y P3bip ...
Voir le deal
99.99 €

Partagez
 

 Problème avec les compétences passives

Voir le sujet précédent Voir le sujet suivant Aller en bas 
AuteurMessage
Garruk
Aventurier Lv.16
Aventurier Lv.16
Garruk


Age : 40
Inscrit le : 03/09/2009
Messages : 1503

Problème avec les compétences passives Empty
MessageSujet: Problème avec les compétences passives   Problème avec les compétences passives Icon_minitimeDim 20 Sep 2009 - 19:26

Voilà j'utilise ce script et celui de final fantasy VII limite, menu etc....


Code:
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/ ◆ Passive Skills - KGC_PassiveSkill ◆ VX ◆
#_/ ◇  Last Update: 11/16/2008
#_/ ◆ Written by TOMY   
#_/ ◆ Translation by Mr. Anonymous                 
#_/ ◆ KGC Site:                                                 
#_/ ◆  http://ytomy.sakura.ne.jp/                                 
#_/ ◆ Translator's Blog:                                           
#_/ ◆  http://mraprojects.wordpress.com   
#_/-----------------------------------------------------------------------------
#_/  This script allows the designer to create "passive" skills, which may
#_/  augment a character's abilities, rather than simple attacks.
#_/=============================================================================
#_/                      ◆ Instructions For Usage ◆
#_/  To assign a skill as passive, the following must be added into the skill's
#_/    "Notes" box:
#_/
#_/ <PASSIVE_SKILL> Attribute  Modifier  Rate </PASSIVE_SKILL>
#_/ 
#_/  Example:
#_/ 
#_/ <PASSIVE_SKILL> ATK +5 </PASSIVE_SKILL>
#_/  (Increase the character's attack by 5.)
#_/ 
#_/  You can have an unlimited amount of attribute settings within the passive
#_/  skill tags. Percentiles and other mathematical expressions can also be used
#_/  as demonstrated:
#_/ 
#_/  <PASSIVE_SKILL> MAXHP +20% MAXMP -20% DEF +5 SPI -5 </PASSIVE_SKILL>
#_/  (Increase the character's maximum HP by 20 percent, decrease maximum MP by
#_/  20 percent. increase defense by 5, and decrease "spirit" by 5)
#_/ 
#_/  Also, you can assign other attributes to a character, such as adding the
#_/  fire element to their basic attack function, state changes, such as adding
#_/  stun to their basic attack, or adding resistance to states, such as making
#_/  a character immune to being blinded. Using the default terminology setup:
#_/ 
#_/  ATTACK_ELEMENT = Adds an element to the character's basic attack
#_/  PLUS_STATE = Adds a state change to an attack (State change affects target)
#_/  INVALID_STATE = Adds a resistance to specified state changes to a character
#_/  The modifiers for these are the Element ID#s and State ID#s, respectively.
#_/  You can assign multiple values to each parameter. IE: 1,2,3, etc
#_/
#_/  FAST_ATTACK = Grants the actor automatic preemptive attacks.
#_/  DUAL_ATTACK = The actor attacks twice in a row when attacking.
#_/  CRITICAL_BONUS = Increases the actor's critical hit percentile.
#_/  PREVENT_CRITICAL = Eliminate the chance of taking a critical hit from foe.
#_/  HALF_MP_COST = MP cost for skills is halved.
#_/  DOUBLE_EXP_GAIN = Doubles the experience points gained.
#_/
#_/  * The following tags require KCG_ReproduceFunctions *
#_/  WHOLE_ATTACK = Actor attacks all enemies on-screen.
#_/  IGNORE_EVA = Actor's attacks completely ignore the foe's evasion.
#_/
#_/  * The following tag requires KCG_AddEquipmentOptions *
#_/  n TIMES_ATTACK = (Where n = Number) Normal attack strikes multiple times.
#_/
#_/  * The following tag requires KGC_EquipExtension *
#_/  TWO_SWORDS_STYLE = Grants the two-weapon fighting ability.
#_/  AUTO_BATTLE = Makes the actor preform actions automatically in battle.
#_/  SUPER_GUARD = Reduces damage to 1/4 when using the defend command.
#_/  PHARMACOLOGY = Doubles the healing effect for items.
#_/
#_/  Example:
#_/ 
#_/ <PASSIVE_SKILL> ATTACK_ELEMENT 8,9 PLUS_STATE 8 INVALID_STATE 6 </PASSIVE_SKILL>
#_/  (Add Fire and Ice element to attack, add Stun state to attack, add
#_/  resistance to Sleep state to character.)
#_/
#_/  You can also combine the use of stat increases/decreases and element/state
#_/  changes into a single <PASSIVE_SKILL> statement.
#_/
#_/  One last note: When entering these values into the Skill's "Notes",
#_/  each line needs to be separated by pressing enter. So, in our final example
#_/  your setup should look something like this:
#_/ 
#_/ <PASSIVE_SKILL>
#_/  MAXHP +20%
#_/  MAXMP -20%
#_/  ATTACK_ELEMENT 8,9
#_/  PLUS_STATE 8
#_/ </PASSIVE_SKILL>
#_/=============================================================================
#_/  Install: Insert below KCG_ReproduceFunctions, KCG_AddEquipmentOptions,
#_/          and KGC_EquipExtension
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_

#=================================================#
#                    IMPORT                      #
#=================================================#

$imported = {} if $imported == nil
$imported["PassiveSkill"] = true
#=================================================#

#==============================================================================
# □ KGC::PassiveSkill
#==============================================================================
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * #
#                          Note Field Tag Strings                            #
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * #
#  Whatever word(s) are after the separator ( | ) in the following lines are
#  what are used to determine what is searched for in the "Note" section of
#  a skill.

module KGC
 module PassiveSkill
 
  #              ◆ Passive Skill State Change Parameters ◆
  # These can be changed to fit your own purposes. (For memorization.)
  # The (obvious) setup is OriginalString|PersonalAbbreviation
  # These are what you'll use to set up the actual attribute bonus
  # that the skill provides. (IE. MAXHP +10%)
  # (ATTACK_ELEMENT 1,2 ) same as (atkelem 1,2)

  PARAMS = {
    :maxhp => "MAXHP|maximum_hp",  # Maximum Hit Points
    :maxmp => "MAXMP|maximum_mp",  # Maximum Magic Points
    :atk  => "ATK|attack",        # Attack
    :def  => "DEF|defense",        # Defense
    :spi  => "SPI|spirit",        # AKA "INT|Intelligence"
    :agi  => "AGI|agility",        # Agility
    :hit  => "HIT|hit_ratio",      # AKA "ACU|Accuracy"
    :eva  => "EVA|evasion",        # Evasion Ratio
    :cri  => "CRI|critial",        # Critial Ratio
    :odds  => "LCK|luck",          # Luck (See below)
  }                                # Affects the likelyhood of being targetted

 #                      ◆ Attribute State List ◆
  ARRAYS = {
    :attack_element => "ATTACK_ELEMENT|attack_element",
    :plus_state    => "PLUS_STATE|plus_state",
    :invalid_state  => "INVALID_STATE|invalid_state",
    :auto_state    => "AUTO_STATE|auto_state",
  }

 #                          ◆ Resistance List ◆
  RESISTANCES = {
    # From KGC_AddEquipmentOptions
    :element => "ELEMENT_RESISTANCE|element_resist",
    :state  => "STATE_RESISTANCE|state_resist",
  }

  #                  ◆ Passive Skill Special Effects ◆
  EFFECTS = {
    :two_swords_style => "TWO_SWORDS_STYLE|two_swords_style",
    :auto_battle      => "AUTO_BATTLE|auto_battle",
    :super_guard      => "SUPER_GUARD|super_guard",
    :pharmacology    => "PHARMACOLOGY|pharmacology",
    :fast_attack      => "FAST_ATTACK|fast_attack",
    :dual_attack      => "DUAL_ATTACK|dual_attack",
    :critical_bonus  => "CRITICAL_BONUS|critical_bonus",
    :prevent_critical => "PREVENT_CRITICAL|prevent_critical",
    :half_mp_cost    => "HALF_MP_COST|half_mp_cost",
    :double_exp_gain  => "DOUBLE_EXP_GAIN|double_exp_gain",
    # From KGC_ReproduceFunctions
    :whole_attack    => "WHOLE_ATTACK|target_all",
    :ignore_eva      => "IGNORE_EVA|ignore_evasion",
    # From KGC_AddEquipmentOptions
    :multi_attack_count => '(\d+)\s*(?:TIMES_ATTACK|multi_attack_count)',
  }

#==============================================================================
# □ KGC::EquipExtension::Regexp
#==============================================================================
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * #
#                          Note Field Tag Strings                            #
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * #
#  Whatever word(s) are after the separator ( | ) in the following lines are
#  what are used to determine what is searched for in the "Note" section of
#  a skill.

  # Regular Expression Definition
  module Regexp
    # Base Skill Module
    module Skill
      # Passive Skill Tag begin
      BEGIN_PASSIVE = /<(?:PASSIVE_SKILL|passive_skill)>/i
      # Passive Skill Tag end
      END_PASSIVE = /<\/(?:PASSIVE_SKILL|passive_skill)>/i

      # Parameter Tag Additions
      PASSIVE_PARAMS = /^\s*([^:\+\-\d\s]+)\s*([\+\-]\d+)([%%])?\s*$/
      # Passive arrays
      #  Attack Element 1,2,3  etc
      PASSIVE_ARRAYS = /^\s*([^:\+\-\d\s]+)\s*(\d+(?:\s*,\s*\d+)*)\s*$/
      # Passive resistances
      PASSIVE_RESISTANCES = /^\s*([^:\+\-\d\s]+)\s(\d+):(\-?\d+)[%%]?\s*$/
      # Passive effects
      PASSIVE_EFFECTS = /^\s*([^:\+\-\d\s]+)/
    end
  end
end
end

#=================================================#

#==============================================================================
# □ KGC::Commands
#==============================================================================

module KGC
module Commands
  module_function
  #--------------------------------------------------------------------------
  # ○ パッシブスキルの修正値を再設定
  #--------------------------------------------------------------------------
  def restore_passive_rev
    (1...$data_actors.size).each { |i|
      actor = $game_actors[i]
      actor.restore_passive_rev
    }
  end
end
end

#=================================================#
#            INCLUDE COMMANDS                    #
#=================================================#
#    Include KGC::Commands in Game_Interpreter    #
#=================================================#

class Game_Interpreter
  include KGC::Commands
end

#=================================================#

#==============================================================================
# ■ RPG::Skill
#==============================================================================

class RPG::Skill < RPG::UsableItem
  #--------------------------------------------------------------------------
  # ○ パッシブスキルのキャッシュを生成
  #--------------------------------------------------------------------------
  def create_passive_skill_cache
    @__passive = false
    @__passive_params = {}
    @__passive_params_rate = {}
    @__passive_arrays = {}
    @__passive_resistances = {}
    @__passive_effects = { :multi_attack_count => 1 }

    passive_flag = false
    self.note.each_line { |line|
      case line
      when KGC::PassiveSkill::Regexp::Skill::BEGIN_PASSIVE
        # パッシブスキル定義開始
        passive_flag = true
        @__passive = true
      when KGC::PassiveSkill::Regexp::Skill::END_PASSIVE
        # パッシブスキル定義終了
        passive_flag = false
      when KGC::PassiveSkill::Regexp::Skill::PASSIVE_PARAMS
        # 能力値修正
        if passive_flag
          apply_passive_params($1, $2.to_i, $3 != nil)
        end
      when KGC::PassiveSkill::Regexp::Skill::PASSIVE_ARRAYS
        # 属性・ステート
        if passive_flag
          apply_passive_arrays($1, $2.scan(/\d+/))
        end
      when KGC::PassiveSkill::Regexp::Skill::PASSIVE_RESISTANCES
        # 耐性
        if passive_flag
          apply_passive_resistances($1, $2.to_i, $3.to_i)
        end
      else
        # 特殊効果
        if passive_flag
          apply_passive_effects(line)
        end
      end
    }
  end
  #--------------------------------------------------------------------------
  # ○ パッシブスキルの能力値修正を適用
  #    param : 対象パラメータ
  #    value : 修正値
  #    rate  : true なら % 指定
  #--------------------------------------------------------------------------
  def apply_passive_params(param, value, rate)
    KGC::PassiveSkill::PARAMS.each { |k, v|
      if param =~ /(?:#{v})/i
        if rate
          @__passive_params_rate[k] = 0 if @__passive_params_rate[k] == nil
          @__passive_params_rate[k] += value
        else
          @__passive_params[k] = 0 if @__passive_params[k] == nil
          @__passive_params[k] += value
        end
        break
      end
    }
  end
  #--------------------------------------------------------------------------
  # ○ パッシブスキルの追加属性・ステートを適用
  #    param : 対象パラメータ
  #    list  : 属性・ステート一覧
  #--------------------------------------------------------------------------
  def apply_passive_arrays(param, list)
    KGC::PassiveSkill::ARRAYS.each { |k, v|
      if param =~ /(?:#{v})/i
        values = []
        list.each { |num| values << num.to_i }
        @__passive_arrays[k] = [] if @__passive_arrays[k] == nil
        @__passive_arrays[k] |= values
        break
      end
    }
  end
  #--------------------------------------------------------------------------
  # ○ パッシブスキルの耐性を適用
  #    param : 対象パラメータ
  #    id    : 属性・ステート ID
  #    rate  : 変動率
  #--------------------------------------------------------------------------
  def apply_passive_resistances(param, id, rate)
    KGC::PassiveSkill::RESISTANCES.each { |k, v|
      if param =~ /(?:#{v})/i
        if @__passive_resistances[k] == nil
          @__passive_resistances[k] = []
        end
        n = @__passive_resistances[k][id]
        n = 100 if n == nil
        @__passive_resistances[k][id] = n + rate - 100
        break
      end
    }
  end
  #--------------------------------------------------------------------------
  # ○ パッシブスキルの特殊効果を適用
  #    effect : 対象効果
  #--------------------------------------------------------------------------
  def apply_passive_effects(effect)
    KGC::PassiveSkill::EFFECTS.each { |k, v|
      if effect =~ /^\s*(#{v})/i
        case k
        when :multi_attack_count
          # 攻撃回数
          $1 =~ /#{v}/i
          @__passive_effects[k] = [ $1.to_i, @__passive_effects[k] ].max
        else
          @__passive_effects[k] = true
        end
        break
      end
    }
  end
  #--------------------------------------------------------------------------
  # ○ パッシブスキルであるか
  #--------------------------------------------------------------------------
  def passive
    create_passive_skill_cache if @__passive == nil
    return @__passive
  end
  #--------------------------------------------------------------------------
  # ○ パッシブスキルの能力値修正 (即値)
  #--------------------------------------------------------------------------
  def passive_params
    create_passive_skill_cache if @__passive_params == nil
    return @__passive_params
  end
  #--------------------------------------------------------------------------
  # ○ パッシブスキルの能力値修正 (割合)
  #--------------------------------------------------------------------------
  def passive_params_rate
    create_passive_skill_cache if @__passive_params_rate == nil
    return @__passive_params_rate
  end
  #--------------------------------------------------------------------------
  # ○ パッシブスキルの属性・ステートリスト
  #--------------------------------------------------------------------------
  def passive_arrays
    create_passive_skill_cache if @__passive_arrays == nil
    return @__passive_arrays
  end
  #--------------------------------------------------------------------------
  # ○ パッシブスキルの耐性リスト
  #--------------------------------------------------------------------------
  def passive_resistances
    create_passive_skill_cache if @__passive_resistances == nil
    return @__passive_resistances
  end
  #--------------------------------------------------------------------------
  # ○ パッシブスキルの特殊効果リスト
  #--------------------------------------------------------------------------
  def passive_effects
    create_passive_skill_cache if @__passive_effects == nil
    return @__passive_effects
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Game_Actor
#==============================================================================

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # ○ クラス変数
  #--------------------------------------------------------------------------
  @@passive_equip_test = false  # パッシブスキル用装備テストフラグ
  #--------------------------------------------------------------------------
  # ● セットアップ
  #    actor_id : アクター ID
  #--------------------------------------------------------------------------
  alias setup_KGC_PassiveSkill setup
  def setup(actor_id)
    reset_passive_rev

    setup_KGC_PassiveSkill(actor_id)

    restore_passive_rev
  end
  #--------------------------------------------------------------------------
  # ○ パッシブスキルの修正値を初期化
  #--------------------------------------------------------------------------
  def reset_passive_rev
    @passive_params = {}
    @passive_params_rate = {}
    @passive_arrays = {}
    @passive_resistances = {}
    @passive_effects = {}
    KGC::PassiveSkill::PARAMS.each_key { |k|
      @passive_params[k] = 0
      @passive_params_rate[k] = 100
    }
    KGC::PassiveSkill::ARRAYS.each_key { |k| @passive_arrays[k] = [] }
    KGC::PassiveSkill::RESISTANCES.each_key { |k| @passive_resistances[k] = [] }
    KGC::PassiveSkill::EFFECTS.each_key { |k| @passive_effects[k] = false }
    @passive_effects[:multi_attack_count] = 1
  end
  #--------------------------------------------------------------------------
  # ○ パッシブスキルの修正値を再設定
  #--------------------------------------------------------------------------
  def restore_passive_rev
    return if @__passive_rev_restoring

    # 修正前の値を保持
    last_effects = @passive_effects.clone if @passive_effects != nil

    reset_passive_rev

    # ≪スキルCP制≫ の併用を考慮し、戦闘中フラグを一時的にオン
    last_in_battle = $game_temp.in_battle
    $game_temp.in_battle = true
    # 修正値を取得
    self.skills.each { |skill|
      next unless skill.passive

      skill.passive_params.each { |k, v| @passive_params[k] += v }
      skill.passive_params_rate.each { |k, v| @passive_params_rate[k] += v }
      skill.passive_arrays.each { |k, v| @passive_arrays[k] |= v }
      skill.passive_resistances.each { |k, v|
        v.each_with_index { |n, i|
          next if n == nil
          @passive_resistances[k][i] = 100 if @passive_resistances[k][i] == nil
          @passive_resistances[k][i] += n - 100
        }
      }
      skill.passive_effects.each { |k, v|
        case k
        when :multi_attack_count
          @passive_effects[k] = [ v, @passive_effects[k] ].max
        else
          @passive_effects[k] |= v
        end
      }
    }
    $game_temp.in_battle = last_in_battle

    @__passive_rev_restoring = true
    # HP/MP を修正
    self.hp = self.hp
    self.mp = self.mp

    # 二刀流違反を修正
    if !two_swords_style_KGC_PassiveSkill &&
        last_effects != nil && last_effects[:two_swords_style] != nil &&
        last_effects[:two_swords_style] != two_swords_style
      @__one_time_two_swords_style = last_effects[:two_swords_style]
      change_equip(1, nil, @@passive_equip_test)
      @__one_time_two_swords_style = nil
    end
    @__passive_rev_restoring = nil
  end
  #--------------------------------------------------------------------------
  # ○ パッシブスキルによるパラメータ修正値 (即値)
  #--------------------------------------------------------------------------
  def passive_params
    restore_passive_rev if @passive_params == nil
    return @passive_params
  end
  #--------------------------------------------------------------------------
  # ○ パッシブスキルによるパラメータ修正値 (割合)
  #--------------------------------------------------------------------------
  def passive_params_rate
    restore_passive_rev if @passive_params_rate == nil
    return @passive_params_rate
  end
  #--------------------------------------------------------------------------
  # ○ パッシブスキルによる追加属性・ステート
  #--------------------------------------------------------------------------
  def passive_arrays
    restore_passive_rev if @passive_arrays == nil
    return @passive_arrays
  end
  #--------------------------------------------------------------------------
  # ○ パッシブスキルによる耐性
  #--------------------------------------------------------------------------
  def passive_resistances
    restore_passive_rev if @passive_resistances == nil
    return @passive_resistances
  end
  #--------------------------------------------------------------------------
  # ○ パッシブスキルによる特殊効果
  #--------------------------------------------------------------------------
  def passive_effects
    restore_passive_rev if @passive_effects == nil
    return @passive_effects
  end
  #--------------------------------------------------------------------------
  # ● 装備の変更 (オブジェクトで指定)
  #    equip_type : 装備部位 (0..4)
  #    item      : 武器 or 防具 (nil なら装備解除)
  #    test      : テストフラグ (戦闘テスト、または装備画面での一時装備)
  #--------------------------------------------------------------------------
  alias change_equip_KGC_PassiveSkill change_equip
  def change_equip(equip_type, item, test = false)
    @@passive_equip_test = test

    change_equip_KGC_PassiveSkill(equip_type, item, test)

    restore_passive_rev
    @@passive_equip_test = false
  end
  #--------------------------------------------------------------------------
  # ● 装備の破棄
  #    item : 破棄する武器 or 防具
  #    武器/防具の増減で「装備品も含める」のとき使用する。
  #--------------------------------------------------------------------------
  alias discard_equip_KGC_PassiveSkill discard_equip
  def discard_equip(item)
    discard_equip_KGC_PassiveSkill(item)

    restore_passive_rev
  end

  if $imported["AddEquipmentOptions"]
  #--------------------------------------------------------------------------
  # ○ 属性耐性の取得
  #    element_id : 属性 ID
  #--------------------------------------------------------------------------
  alias element_resistance_KGC_PassiveSkill element_resistance
  def element_resistance(element_id)
    n = element_resistance_KGC_PassiveSkill(element_id)
    rate = passive_resistances[:element][element_id]
    n += (rate == nil ? 100 : rate) - 100
    return n
  end
  #--------------------------------------------------------------------------
  # ○ ステート耐性の取得
  #    state_id : ステート ID
  #--------------------------------------------------------------------------
  alias state_resistance_KGC_PassiveSkill state_resistance
  def state_resistance(state_id)
    n = state_resistance_KGC_PassiveSkill(state_id)
    rate = passive_resistances[:state][state_id]
    n += (rate == nil ? 100 : rate) - 100
    return [n, 0].max
  end
  end  # <-- if $imported["AddEquipmentOptions"]

  #--------------------------------------------------------------------------
  # ● ステート無効化判定
  #    state_id : ステート ID
  #--------------------------------------------------------------------------
  alias state_resist_KGC_PassiveSkill? state_resist?
  def state_resist?(state_id)
    return true if passive_arrays[:invalid_state].include?(state_id)

    return state_resist_KGC_PassiveSkill?(state_id)
  end
  #--------------------------------------------------------------------------
  # ● 通常攻撃の属性取得
  #--------------------------------------------------------------------------
  alias element_set_KGC_PassiveSkill element_set
  def element_set
    return (element_set_KGC_PassiveSkill | passive_arrays[:attack_element])
  end
  #--------------------------------------------------------------------------
  # ● 通常攻撃の追加効果 (ステート変化) 取得
  #--------------------------------------------------------------------------
  alias plus_state_set_KGC_PassiveSkill plus_state_set
  def plus_state_set
    return (plus_state_set_KGC_PassiveSkill | passive_arrays[:plus_state])
  end
  #--------------------------------------------------------------------------
  # ● 基本 MaxHP の取得
  #--------------------------------------------------------------------------
  alias base_maxhp_KGC_PassiveSkill base_maxhp
  def base_maxhp
    n = base_maxhp_KGC_PassiveSkill + passive_params[:maxhp]
    n = n * passive_params_rate[:maxhp] / 100
    return n
  end
  #--------------------------------------------------------------------------
  # ● 基本 MaxMP の取得
  #--------------------------------------------------------------------------
  alias base_maxmp_KGC_PassiveSkill base_maxmp
  def base_maxmp
    n = base_maxmp_KGC_PassiveSkill + passive_params[:maxmp]
    n = n * passive_params_rate[:maxmp] / 100
    return n
  end
  #--------------------------------------------------------------------------
  # ● 基本攻撃力の取得
  #--------------------------------------------------------------------------
  alias base_atk_KGC_PassiveSkill base_atk
  def base_atk
    n = base_atk_KGC_PassiveSkill + passive_params[:atk]
    n = n * passive_params_rate[:atk] / 100
    return n
  end
  #--------------------------------------------------------------------------
  # ● 基本防御力の取得
  #--------------------------------------------------------------------------
  alias base_def_KGC_PassiveSkill base_def
  def base_def
    n = base_def_KGC_PassiveSkill + passive_params[:def]
    n = n * passive_params_rate[:def] / 100
    return n
  end
  #--------------------------------------------------------------------------
  # ● 基本精神力の取得
  #--------------------------------------------------------------------------
  alias base_spi_KGC_PassiveSkill base_spi
  def base_spi
    n = base_spi_KGC_PassiveSkill + passive_params[:spi]
    n = n * passive_params_rate[:spi] / 100
    return n
  end
  #--------------------------------------------------------------------------
  # ● 基本敏捷性の取得
  #--------------------------------------------------------------------------
  alias base_agi_KGC_PassiveSkill base_agi
  def base_agi
    n = base_agi_KGC_PassiveSkill + passive_params[:agi]
    n = n * passive_params_rate[:agi] / 100
    return n
  end
  #--------------------------------------------------------------------------
  # ● 命中率の取得
  #--------------------------------------------------------------------------
  alias hit_KGC_PassiveSkill hit
  def hit
    n = hit_KGC_PassiveSkill + passive_params[:hit]
    n = n * passive_params_rate[:hit] / 100
    return n
  end
  #--------------------------------------------------------------------------
  # ● 回避率の取得
  #--------------------------------------------------------------------------
  alias eva_KGC_PassiveSkill eva
  def eva
    n = eva_KGC_PassiveSkill + passive_params[:eva]
    n = n * passive_params_rate[:eva] / 100
    return n
  end
  #--------------------------------------------------------------------------
  # ● クリティカル率の取得
  #--------------------------------------------------------------------------
  alias cri_KGC_PassiveSkill cri
  def cri
    n = cri_KGC_PassiveSkill + passive_params[:cri]
    n = n * passive_params_rate[:cri] / 100
    n += 4 if passive_effects[:critical_bonus]
    return n
  end
  #--------------------------------------------------------------------------
  # ● 狙われやすさの取得
  #--------------------------------------------------------------------------
  alias odds_KGC_PassiveSkill odds
  def odds
    n = odds_KGC_PassiveSkill + passive_params[:odds]
    n = n * passive_params_rate[:odds] / 100
    return n
  end
  #--------------------------------------------------------------------------
  # ● オプション [二刀流] の取得
  #--------------------------------------------------------------------------
  alias two_swords_style_KGC_PassiveSkill two_swords_style
  def two_swords_style
    return @__one_time_two_swords_style if @__one_time_two_swords_style != nil

    return (two_swords_style_KGC_PassiveSkill ||
      passive_effects[:two_swords_style])
  end
  #--------------------------------------------------------------------------
  # ● オプション [自動戦闘] の取得
  #--------------------------------------------------------------------------
  alias auto_battle_KGC_PassiveSkill auto_battle
  def auto_battle
    return (auto_battle_KGC_PassiveSkill || passive_effects[:auto_battle])
  end
  #--------------------------------------------------------------------------
  # ● オプション [強力防御] の取得
  #--------------------------------------------------------------------------
  alias super_guard_KGC_PassiveSkill super_guard
  def super_guard
    return (super_guard_KGC_PassiveSkill || passive_effects[:super_guard])
  end
  #--------------------------------------------------------------------------
  # ● オプション [薬の知識] の取得
  #--------------------------------------------------------------------------
  alias pharmacology_KGC_PassiveSkill pharmacology
  def pharmacology
    return (pharmacology_KGC_PassiveSkill || passive_effects[:pharmacology])
  end
  #--------------------------------------------------------------------------
  # ● 武器オプション [ターン内先制] の取得
  #--------------------------------------------------------------------------
  alias fast_attack_KGC_PassiveSkill fast_attack
  def fast_attack
    return (fast_attack_KGC_PassiveSkill || passive_effects[:fast_attack])
  end
  #--------------------------------------------------------------------------
  # ● 武器オプション [連続攻撃] の取得
  #--------------------------------------------------------------------------
  alias dual_attack_KGC_PassiveSkill dual_attack
  def dual_attack
    if $imported["AddEquipmentOptions"]
      # 2回攻撃以上なら無視
      return false if passive_effects[:multi_attack_count] >= 2
    end

    return (dual_attack_KGC_PassiveSkill || passive_effects[:dual_attack])
  end
  #--------------------------------------------------------------------------
  # ● 防具オプション [クリティカル防止] の取得
  #--------------------------------------------------------------------------
  alias prevent_critical_KGC_PassiveSkill prevent_critical
  def prevent_critical
    return (prevent_critical_KGC_PassiveSkill ||
      passive_effects[:prevent_critical])
  end
  #--------------------------------------------------------------------------
  # ● 防具オプション [消費 MP 半分] の取得
  #--------------------------------------------------------------------------
  alias half_mp_cost_KGC_KGC_PassiveSkill half_mp_cost
  def half_mp_cost
    return (half_mp_cost_KGC_KGC_PassiveSkill ||
      passive_effects[:half_mp_cost])
  end
  #--------------------------------------------------------------------------
  # ● 防具オプション [取得経験値 2 倍] の取得
  #--------------------------------------------------------------------------
  alias double_exp_gain_KGC_PassiveSkill double_exp_gain
  def double_exp_gain
    return (double_exp_gain_KGC_PassiveSkill ||
      passive_effects[:double_exp_gain])
  end
  #--------------------------------------------------------------------------
  # ● スキルを覚える
  #    skill_id : スキル ID
  #--------------------------------------------------------------------------
  alias learn_skill_KGC_PassiveSkill learn_skill
  def learn_skill(skill_id)
    learn_skill_KGC_PassiveSkill(skill_id)

    restore_passive_rev
  end
  #--------------------------------------------------------------------------
  # ● スキルを忘れる
  #    skill_id : スキル ID
  #--------------------------------------------------------------------------
  alias forget_skill_KGC_PassiveSkill forget_skill
  def forget_skill(skill_id)
    forget_skill_KGC_PassiveSkill(skill_id)

    restore_passive_rev
  end

if $imported["ReproduceFunctions"]

  #--------------------------------------------------------------------------
  # ○ オートステートの配列を取得
  #    id_only : ID のみを取得
  #--------------------------------------------------------------------------
  alias auto_states_KGC_PassiveSkill auto_states
  def auto_states(id_only = false)
    result = auto_states_KGC_PassiveSkill(id_only)

    passive_arrays[:auto_state].each { |i|
      result << (id_only ? i : $data_states[i])
    }
    result.uniq!
    return result
  end
  #--------------------------------------------------------------------------
  # ○ 装備オプション [全体攻撃] の取得
  #--------------------------------------------------------------------------
  alias whole_attack_KGC_PassiveSkill whole_attack
  def whole_attack
    return (whole_attack_KGC_PassiveSkill || passive_effects[:whole_attack])
  end
  #--------------------------------------------------------------------------
  # ○ 装備オプション [回避無視] の取得
  #--------------------------------------------------------------------------
  alias ignore_eva_KGC_PassiveSkill ignore_eva
  def ignore_eva
    return (ignore_eva_KGC_PassiveSkill || passive_effects[:ignore_eva])
  end

end  # <-- if $imported["ReproduceFunctions"]

if $imported["AddEquipmentOptions"]

  #--------------------------------------------------------------------------
  # ○ 攻撃回数の取得
  #--------------------------------------------------------------------------
  alias multi_attack_count_KGC_PassiveSkill multi_attack_count
  def multi_attack_count
    n = multi_attack_count_KGC_PassiveSkill
    return [ n, passive_effects[:multi_attack_count] ].max
  end

end  # <-- if $imported["AddEquipmentOptions"]

end  # <-- class

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Window_EquipItem
#==============================================================================

class Window_EquipItem < Window_Item
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #    x          : ウィンドウの X 座標
  #    y          : ウィンドウの Y 座標
  #    width      : ウィンドウの幅
  #    height    : ウィンドウの高さ
  #    actor      : アクター
  #    equip_type : 装備部位 (0~4)
  #--------------------------------------------------------------------------
  alias initialize_KGC_PassiveSkill initialize unless $@
  def initialize(x, y, width, height, actor, equip_type)
    @original_equip_type = equip_type

    initialize_KGC_PassiveSkill(x, y, width, height, actor, equip_type)
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  alias refresh_KGC_PassiveSkill refresh unless $@
  def refresh
    if @original_equip_type == 1
      @equip_type = (@actor.two_swords_style ? 0 : 1)
    end

    refresh_KGC_PassiveSkill
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Scene_File
#==============================================================================

class Scene_File < Scene_Base
  #--------------------------------------------------------------------------
  # ● セーブデータの読み込み
  #    file : 読み込み用ファイルオブジェクト (オープン済み)
  #--------------------------------------------------------------------------
  alias read_save_data_KGC_PassiveSkill read_save_data
  def read_save_data(file)
    read_save_data_KGC_PassiveSkill(file)

    KGC::Commands.restore_passive_rev
    Graphics.frame_reset
  end
end


Mon problème c'est que j'ai une matéria qui se nomme "Super HP" quand je l'équipe à un de mes personnages ses PV augmentent de 10% et quand on lui retire la matéria il garde le bonus passive des 10% PV hors je voudrais qu'il perd se bonus.

Merci d'avance
Revenir en haut Aller en bas
Kamachi-Kuno
Seigneur Lv.18
Seigneur Lv.18
Kamachi-Kuno


Masculin Age : 31
Inscrit le : 06/06/2008
Messages : 2005

Problème avec les compétences passives Empty
MessageSujet: Re: Problème avec les compétences passives   Problème avec les compétences passives Icon_minitimeDim 20 Sep 2009 - 20:06

Il faut traficoter dans le script, mais je ne suis pas fait pour ça.
Revenir en haut Aller en bas
Garruk
Aventurier Lv.16
Aventurier Lv.16
Garruk


Age : 40
Inscrit le : 03/09/2009
Messages : 1503

Problème avec les compétences passives Empty
MessageSujet: Re: Problème avec les compétences passives   Problème avec les compétences passives Icon_minitimeDim 20 Sep 2009 - 20:36

Et moi donc. :-(
Revenir en haut Aller en bas
Contenu sponsorisé




Problème avec les compétences passives Empty
MessageSujet: Re: Problème avec les compétences passives   Problème avec les compétences passives Icon_minitime

Revenir en haut Aller en bas
 

Problème avec les compétences passives

Voir le sujet précédent Voir le sujet suivant Revenir en haut 
Page 1 sur 1

 Sujets similaires

-
» [Problème Duo] Problème avec les combats
» RÉSOLU Probleme avec CATEGORY IDENTIFIER objet avec KGC script
» Apres le probleme d'event , encore un new probleme avec ABS combat réel !
» [Problème] Plusieur problème rencontrer avec SBS
» Problème avec les messages + avec un dll

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
RPG Maker VX :: Entraide :: Problèmes et Solutions :: Abandonné-
Créer un forum | ©phpBB | Forum gratuit d'entraide | Signaler un abus | Cookies | Forum gratuit | Informatique et Internet | Informatique et électronique