#============================================================================== # アイテム効果拡張スクリプト ver1.00 #------------------------------------------------------------------------------ #[特徴] # 特定のステートが付与されているときにアイテムの効果が別のアイテムの効果になる。 # 消費されるのは変化前のアイテムです。 # #[設定方法] # ステートのメモ欄に <アイテム効果拡張> と書いてください。 # アイテムのメモ欄に <アイテム変更:変更後のアイテムのID> と書いてください。 # #[導入上の注意] # アイテム関連のメソッドを再定義しているので、できるだけ上の方に導入してください。 # # 作成:ぶちょー # ホム:http://nyannyannyan.bake-neko.net # 著作:自分で作ったとか言わないで>< # 改造はご自由にどうぞ。 # リードミーとかに私の名前の載せたりするのは任意で。 #============================================================================== #============================================================================== # 設定項目 #============================================================================== module ITEM_EXTENSION # ターゲット選択を、 # 変化後のアイテムの仕様にするか(true) # アイテム欄で選択したアイテムの仕様にするか(false) SELECTION = true end #============================================================================== # ここまで #============================================================================== #============================================================================== # ■ Scene_Battle #============================================================================== class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # ● アイテムの決定 #-------------------------------------------------------------------------- alias determine_extension_item determine_item def determine_item if ITEM_EXTENSION::SELECTION @active_battler.action.set_item(@item.id) item = item_extension(false) @item_window.active = false if item.need_selection? if item.for_opponent? start_target_enemy_selection else start_target_actor_selection end else end_item_selection next_actor end else determine_extension_item end end #-------------------------------------------------------------------------- # ● 戦闘行動の実行 : アイテム ※ 再定義 #-------------------------------------------------------------------------- def execute_action_item item = @active_battler.action.item text = sprintf(Vocab::UseItem, @active_battler.name, item.name) @message_window.add_instant_text(text) $game_party.consume_item(item) item = item_extension(true) targets = @active_battler.action.make_targets display_animation(targets, item.animation_id) $game_temp.common_event_id = item.common_event_id for target in targets target.item_effect(@active_battler, item) display_action_effects(target, item) end end #-------------------------------------------------------------------------- # ● アイテム効果拡張 #-------------------------------------------------------------------------- def item_extension(set_flag) item = @active_battler.action.item states = @active_battler.states flag = false for state in states flag = true if state.note.include?("<アイテム効果拡張>") end if flag && item.note.include?("<アイテム変更:") id = item.note.scan(/^<アイテム変更:(.+)>/im).to_s.to_i @active_battler.action.set_item(id) if set_flag item = $data_items[id] end return item end end