#============================================================================== # RGSS2_属性修正値改造 # 2011/09/02公開 # C Winter (http://ccwinter.blog.fc2.com/) #============================================================================== #============================================================================== # ■ Game_Battler #============================================================================== class Game_Battler #-------------------------------------------------------------------------- # ● 属性の修正値の取得 #-------------------------------------------------------------------------- def elements_max_rate(element_set) return 100 if element_set.empty? # 無属性の場合 rate_list = [] n = 100 for i in element_set n += element_rate(i) n -= 100 #それぞれの属性の補正値を取得します。200%なら+100、50%なら-50、-100%なら-200です rate_list.push(element_rate(i)) end return [n,400].min if rate_list.min >= 100 #↑200〜100 軽減属性なし 弱点のみ の場合 if n >= 50 nx = n elsif n >= 0 nx = 25 elsif n >= -50 nx = 12.5 else nx = 6.25 end return nx if rate_list.min >= 50 and rate_list.max <= 100 return 0 if rate_list.min >= 0 and rate_list.max <= 100 #↑100〜0 弱点属性なし 半減、無効のみ if n >= 350 nx = 400 elsif n >= 300 nx = 300 elsif n >= 250 nx = 200 elsif n >= 200 nx = 150 elsif n >= 0 nx = n + 50 nx /= 2 elsif n >= -50 nx = 12.5 else nx = 6.25 end return nx if rate_list.min >= 50 " 350 300 250 200 150 100 50 0 -50 -100" " 400 300 200 150 100 75 50 25 1/8 1/16" #↑200〜50 半減属性あり、無効、吸収属性なし #""内は参考用の計算結果です。上段が補正値の合計、下段が結果の属性修正値です。 #↑は半減が3つなら1/8、2倍が1つ半減が1つなら100%になっています。 if n >= 400 nx = 400 else nx = n - 50 end return [nx,0].max if rate_list.min >= 0 " 400 350 300 250 200 150 100 50 0" " 400 300 250 200 150 100 50 0 0" #↑200〜0 無効属性あり、吸収属性なし if n >= 100 nx = n - 100 elsif n >= 0 nx = -50 elsif n >= -100 nx = -100 else nx = -200 end return [nx,100].min " 250 200 150 100 50 0 -50 -100 -150 -200" " 100 100 50 0 -50 -50 -100 -100 -200 -200" #↑吸収属性あり end end