#============================================================================== # ○クリティカル率増減 Ver1.02 # for RGSS2 # 西瓜 / Space not far # http://muspell.raindrop.jp/ # クリティカル率が増減する装備やステートを設定します。 #============================================================================== # ■更新履歴 # Ver1.02 # ・ステートの効果がエネミーのクリティカル率にも影響するように仕様を変更。 # Ver1.01 # ・クリティカル指定の機能を追加、これによってエネミーのクリティカル率の #  設定が可能になりました。 #============================================================================== # ステートや装備のメモ欄に<クリティカル率増減:n>という形式で # 記述してください。通常攻撃のクリティカル率がn%上昇します。 # また、<クリティカル指定:n>と書くとクリティカル率がn%に固定されます。 # この設定に限りエネミーのメモ欄でも設定できます。 =begin ●設定例 <クリティカル率増減:10> → デフォルトが4%なら14%に増加 <クリティカル指定:10> → デフォルトが何%でも10%に変更 =end class Game_Actor < Game_Battler CRITICALSTATE_WORD = "クリティカル率増減" CRITICALFIX_WORD = "クリティカル率指定" #-------------------------------------------------------------------------- # ● クリティカル率の取得 #-------------------------------------------------------------------------- # 再定義 def cri n = 4 n += 4 if actor.critical_bonus for weapon in weapons.compact n += 4 if weapon.critical_bonus end # クリティカル率増減 # ステートによる変動 for state in states memo = state.note.scan(/<#{CRITICALSTATE_WORD}:(\S+)>/) memo = memo.flatten if memo != nil and not memo.empty? n += memo[0].to_i end end # 装備による変動 for equip in equips.compact memo = equip.note.scan(/<#{CRITICALSTATE_WORD}:(\S+)>/) memo = memo.flatten if memo != nil and not memo.empty? n += memo[0].to_i end end # クリティカル率指定 # ステートによる固定 for state in states memo = state.note.scan(/<#{CRITICALFIX_WORD}:(\S+)>/) memo = memo.flatten if memo != nil and not memo.empty? n = memo[0].to_i end end # 装備による固定 for equip in equips.compact memo = equip.note.scan(/<#{CRITICALFIX_WORD}:(\S+)>/) memo = memo.flatten if memo != nil and not memo.empty? n = memo[0].to_i end end return n end end class Game_Enemy < Game_Battler CRITICALSTATE_WORD = "クリティカル率増減" CRITICALFIX_WORD = "クリティカル率指定" #-------------------------------------------------------------------------- # ● クリティカル率の取得 #-------------------------------------------------------------------------- # 再定義 def cri n = enemy.has_critical ? 10 : 0 # ステートによる変動 # クリティカル率増減 for state in states memo = state.note.scan(/<#{CRITICALSTATE_WORD}:(\S+)>/) memo = memo.flatten if memo != nil and not memo.empty? n += memo[0].to_i end end # ステートによる変動 # ステートによる固定 for state in states memo = state.note.scan(/<#{CRITICALFIX_WORD}:(\S+)>/) memo = memo.flatten if memo != nil and not memo.empty? n = memo[0].to_i end end # エネミーメモ欄による変動 # クリティカル率指定 memo = enemy.note.scan(/<#{CRITICALFIX_WORD}:(\S+)>/) memo = memo.flatten if memo != nil and not memo.empty? n = memo[0].to_i end return n end end