#============================================================================== # □ クリティカル倍率変更ステート (for VX Ace) #------------------------------------------------------------------------------ # Version : 1_20120712 # by サリサ・タイクーン # http://www.tycoon812.com/rgss/ #============================================================================== #============================================================================== # □ 素材スイッチ #============================================================================== $rgsslab = {} if $rgsslab == nil $rgsslab["クリティカル倍率変更ステート"] = true if $rgsslab["クリティカル倍率変更ステート"] #============================================================================== # □ カスタマイズポイント #============================================================================== module RGSSLAB end module RGSSLAB::Critical_Rate_Change_State #-------------------------------------------------------------------------- # ○ クリティカル時の倍率修正の設定 # クリティカルの時の倍率修正を設定します。 # # ステートID => [倍率(少数点設定可), "計算タイプ"], と記述します。 # (最後のステートのみ、最後のカンマを省略できます) # # 計算タイプは、以下の5つあります。 # "+":加算、"-":減算、"*":乗算、"/":除算、"=":代入 # # 倍率修正がマイナスになると、自動的に0へ修正されます。 # (回復防止処置) #-------------------------------------------------------------------------- RATE = { 26 => [3.0, "="], } end # カスタマイズポイントは、ここまで #============================================================================== # □ RGSSLAB::Critical_Rate_Change_State [module] #============================================================================== module RGSSLAB::Critical_Rate_Change_State #-------------------------------------------------------------------------- # ○ 素材設定用の定数定義 #-------------------------------------------------------------------------- MATERIAL_NAME = "クリティカル倍率変更ステート" VERSION = 1 RELEASE = 20120712 #-------------------------------------------------------------------------- # ○ 設定エラー # error_number : エラー番号 # string : 情報 #-------------------------------------------------------------------------- def self.setting_error(error_number, string) text = "【RGSS研究所:#{MATERIAL_NAME}】" case error_number when 1 msgbox_p text, "倍率設定の計算タイプの値が不正です。", "#{string}" end exit end end #============================================================================== # ■ Game_Battler [class] #============================================================================== class Game_Battler < Game_BattlerBase #-------------------------------------------------------------------------- # ○ モジュールの設定 #-------------------------------------------------------------------------- RGSSLAB_017 = RGSSLAB::Critical_Rate_Change_State #-------------------------------------------------------------------------- # ● ダメージ計算 [再定義] # user : 攻撃者 # item : スキル/アイテム #-------------------------------------------------------------------------- def make_damage_value(user, item) value = item.damage.eval(user, self, $game_variables) value *= item_element_rate(user, item) value *= pdr if item.physical? value *= mdr if item.magical? value *= rec if item.damage.recover? if $rgsslab["クリティカル倍率変更ステート"] value *= critical_rate(value, user) if @result.critical value = Integer(value) elsif $rgsslab["クリティカル個別設定"] ; value = apply_critical(value, user) if @result.critical else ; value = apply_critical(value) if @result.critical end value = apply_variance(value, item.damage.variance) if $rgsslab["ダメージ計算拡張"] ; value = apply_guard(value) unless damage_disregard_judge(item) else ; value = apply_guard(value) end value = damage_limit_process(value, item) if $rgsslab["ダメージ計算拡張"] @result.make_damage(value.to_i, item) end #-------------------------------------------------------------------------- # ○ ステート [クリティカル - 倍率] 設定 # damage : ダメージ # attacker : 攻撃者 #-------------------------------------------------------------------------- def critical_rate(damage, attacker) rate = 3.0 if $rgsslab["クリティカル個別設定"] if attacker.is_a?(Game_Actor) if $game_system.rgsslab075.mode == "職業" rate = RGSSLAB_075::CLASS[attacker.class_id] ? RGSSLAB_075::CLASS[attacker.class_id] : RGSSLAB_075::CLASS_DEFAULT else rate = RGSSLAB_075::ACTOR[attacker.id] ? RGSSLAB_075::ACTOR[attacker.id] : RGSSLAB_075::ACTOR_DEFAULT end else rate = RGSSLAB_075::ENEMY[attacker.enemy_id] ? RGSSLAB_075::ENEMY[attacker.enemy_id] : RGSSLAB_075::ENEMY_DEFAULT end end for i in attacker.states if RGSSLAB_017::RATE[i.id] case RGSSLAB_017::RATE[i.id][1] when "+" ; rate += RGSSLAB_017::RATE[i.id][0] when "-" ; rate -= RGSSLAB_017::RATE[i.id][0] when "*" ; rate *= RGSSLAB_017::RATE[i.id][0] when "/" ; rate /= RGSSLAB_017::RATE[i.id][0] when "=" ; rate = RGSSLAB_017::RATE[i.id][0] else ; RGSSLAB_017.setting_error(1, "RATE:#{RGSSLAB_017::RATE[i.id][1]}") end end end return [rate, 0].max end end end