- 注册时间
- 2010-1-4
- 最后登录
- 2019-5-19
②入门
- 积分
- 36
|
这个脚本很好用,可是头、身体、饰品一旦装上咯就卸载不了咯,求高手帮忙!!!谢谢啦!!!!!!!
请注意发脚本的格式。secondsen留- #==============================================================================
- # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
- #==============================================================================
- class Special_Element
- #--------------------------------------------------------------------------
- # ● 特殊な属性を定義する定数
- #--------------------------------------------------------------------------
- TWO_WEAPONS = "二刀流"
- #--------------------------------------------------------------------------
- # ● 特殊な属性をすべて取得
- #--------------------------------------------------------------------------
- def self.special_elements
- # 特殊な属性をすべて列挙
- elements = [
- TWO_WEAPONS
- ]
- return elements
- end
- #--------------------------------------------------------------------------
- # ● 属性名からその属性のIDを得る
- #--------------------------------------------------------------------------
- def self.get_index(name)
- return $data_system.elements.index(name)
- end
-
- #--------------------------------------------------------------------------
- # ● 正規表現にマッチするすべての属性のIDとマッチ情報を得る
- # 戻り値 : 二次元配列 [n][0]にID、[n][1]にマッチ情報(MatchData)
- #--------------------------------------------------------------------------
- def self.get_indices(regexp)
- indices = []
- for i in 1...$data_system.elements.size
- indices.push([i, $~]) if regexp =~ $data_system.elements[i]
- end
- end
-
- #--------------------------------------------------------------------------
- # ● 特殊な属性を取り除く
- # element_set : 取り除く前の属性IDの配列
- # ignore_elements : 取り除きたい属性 ID・名前・正規表現で指定可能
- # 戻り値 : 取り除いた結果の属性IDの配列
- #--------------------------------------------------------------------------
- def self.delete(element_set)
- result = element_set.dup
- for ignore in Special_Element::special_elements
- case ignore
- when Integer
- result.delete(ignore)
- when String
- result.delete(Special_Element::get_index(ignore))
- when Regexp
- for i in result
- result[i] = nil if ignore =~ $data_system.elements[result[i]]
- end
- result.delete(nil)
- end
- end
- return result
- end
- end
-
-
- class Game_Battler
- #--------------------------------------------------------------------------
- # ● 属性修正の計算
- # element_set : 属性
- #--------------------------------------------------------------------------
- def elements_correct(element_set)
- # --- ここから変更部分 ---
- element_set = Special_Element::delete(element_set)
- # --- 変更部分終わり ---
- # 無属性の場合
- if element_set == []
- # 100 を返す
- return 100
- end
- # 与えられた属性の中で最も弱いものを返す
- # ※メソッド element_rate は、このクラスから継承される Game_Actor
- # および Game_Enemy クラスで定義される
- weakest = -100
- for i in element_set
- weakest = [weakest, self.element_rate(i)].max
- end
- return weakest
- end
- end
-
-
- class Game_Actor < Game_Battler
- #--------------------------------------------------------------------------
- # ● 公開インスタンス変数
- #--------------------------------------------------------------------------
- attr_reader :name # 名前
- attr_reader :character_name # キャラクター ファイル名
- attr_reader :character_hue # キャラクター 色相
- attr_reader :class_id # クラス ID
- attr_reader :weapon_id # 武器 ID
- # --- ここから追加部分 ---
- attr_reader :weapon2_id # 二刀流武器 ID
- # --- 追加部分終わり ---
- attr_reader :armor1_id # 盾 ID
- attr_reader :armor2_id # 頭防具 ID
- attr_reader :armor3_id # 体防具 ID
- attr_reader :armor4_id # 装飾品 ID
- attr_reader :level # レベル
- attr_reader :exp # EXP
- attr_reader :skills # スキル
- #--------------------------------------------------------------------------
- # ● セットアップ
- # actor_id : アクター ID
- #--------------------------------------------------------------------------
- def setup(actor_id)
- actor = $data_actors[actor_id]
- @actor_id = actor_id
- @name = actor.name
- @character_name = actor.character_name
- @character_hue = actor.character_hue
- @battler_name = actor.battler_name
- @battler_hue = actor.battler_hue
- @class_id = actor.class_id
- @weapon_id = actor.weapon_id
- # --- ここから追加部分 ---
- @weapon2_id = 0
- # --- 追加部分終わり ---
- @armor1_id = actor.armor1_id
- @armor2_id = actor.armor2_id
- @armor3_id = actor.armor3_id
- @armor4_id = actor.armor4_id
- @level = actor.initial_level
- @exp_list = Array.new(101)
- make_exp_list
- @exp = @exp_list[@level]
- @skills = []
- @hp = maxhp
- @sp = maxsp
- @states = []
- @states_turn = {}
- @maxhp_plus = 0
- @maxsp_plus = 0
- @str_plus = 0
- @dex_plus = 0
- @agi_plus = 0
- @int_plus = 0
- # スキル習得
- for i in 1..@level
- for j in $data_classes[@class_id].learnings
- if j.level == i
- learn_skill(j.skill_id)
- end
- end
- end
- # オートステートを更新
- update_auto_state(nil, $data_armors[@armor1_id])
- update_auto_state(nil, $data_armors[@armor2_id])
- update_auto_state(nil, $data_armors[@armor3_id])
- update_auto_state(nil, $data_armors[@armor4_id])
- end
- #--------------------------------------------------------------------------
- # ● 通常攻撃の属性取得
- #--------------------------------------------------------------------------
- def element_set
- weapon = $data_weapons[@weapon_id]
- # --- ここから変更部分 ---
- weapon2 = $data_weapons[@weapon2_id]
- result = []
- result.concat(weapon.element_set) if weapon != nil
- result.concat(weapon2.element_set) if weapon2 != nil
- return result
- # --- 変更部分終わり ---
- end
- #--------------------------------------------------------------------------
- # ● 通常攻撃のステート変化 (+) 取得
- #--------------------------------------------------------------------------
- def plus_state_set
- weapon = $data_weapons[@weapon_id]
- # --- ここから変更部分 ---
- weapon2 = $data_weapons[@weapon2_id]
- result = []
- result.concat(weapon.plus_state_set) if weapon != nil
- result.concat(weapon2.plus_state_set) if weapon2 != nil
- return result
- # --- 変更部分終わり ---
- end
- #--------------------------------------------------------------------------
- # ● 通常攻撃のステート変化 (-) 取得
- #--------------------------------------------------------------------------
- def minus_state_set
- weapon = $data_weapons[@weapon_id]
- # --- ここから変更部分 ---
- weapon2 = $data_weapons[@weapon2_id]
- result = []
- result.concat(weapon.minus_state_set) if weapon != nil
- result.concat(weapon2.minus_state_set) if weapon2 != nil
- return result
- # --- 変更部分終わり ---
- end
- #--------------------------------------------------------------------------
- # ● 基本腕力の取得
- #--------------------------------------------------------------------------
- def base_str
- n = $data_actors[@actor_id].parameters[2, @level]
- weapon = $data_weapons[@weapon_id]
- armor1 = $data_armors[@armor1_id]
- armor2 = $data_armors[@armor2_id]
- armor3 = $data_armors[@armor3_id]
- armor4 = $data_armors[@armor4_id]
- # --- ここから追加部分 ---
- weapon2 = $data_weapons[@weapon2_id]
- # そのまま加算すると強すぎなので半分にしてみるテスト
- n += weapon2 != nil ? weapon2.str_plus / 2 : 0
- # --- 追加部分終わり ---
- n += weapon != nil ? weapon.str_plus : 0
- n += armor1 != nil ? armor1.str_plus : 0
- n += armor2 != nil ? armor2.str_plus : 0
- n += armor3 != nil ? armor3.str_plus : 0
- n += armor4 != nil ? armor4.str_plus : 0
- return [[n, 1].max, 999].min
- end
- #--------------------------------------------------------------------------
- # ● 基本器用さの取得
- #--------------------------------------------------------------------------
- def base_dex
- n = $data_actors[@actor_id].parameters[3, @level]
- weapon = $data_weapons[@weapon_id]
- armor1 = $data_armors[@armor1_id]
- armor2 = $data_armors[@armor2_id]
- armor3 = $data_armors[@armor3_id]
- armor4 = $data_armors[@armor4_id]
- # --- ここから追加部分 ---
- weapon2 = $data_weapons[@weapon2_id]
- # そのまま加算すると強すぎなので半分にしてみるテスト
- n += weapon2 != nil ? weapon2.dex_plus / 2 : 0
- # --- 追加部分終わり ---
- n += weapon != nil ? weapon.dex_plus : 0
- n += armor1 != nil ? armor1.dex_plus : 0
- n += armor2 != nil ? armor2.dex_plus : 0
- n += armor3 != nil ? armor3.dex_plus : 0
- n += armor4 != nil ? armor4.dex_plus : 0
- return [[n, 1].max, 999].min
- end
- #--------------------------------------------------------------------------
- # ● 基本素早さの取得
- #--------------------------------------------------------------------------
- def base_agi
- n = $data_actors[@actor_id].parameters[4, @level]
- weapon = $data_weapons[@weapon_id]
- armor1 = $data_armors[@armor1_id]
- armor2 = $data_armors[@armor2_id]
- armor3 = $data_armors[@armor3_id]
- armor4 = $data_armors[@armor4_id]
- # --- ここから追加部分 ---
- weapon2 = $data_weapons[@weapon2_id]
- # そのまま加算すると強すぎなので半分にしてみるテスト
- n += weapon2 != nil ? weapon2.agi_plus / 2 : 0
- # --- 追加部分終わり ---
- n += weapon != nil ? weapon.agi_plus : 0
- n += armor1 != nil ? armor1.agi_plus : 0
- n += armor2 != nil ? armor2.agi_plus : 0
- n += armor3 != nil ? armor3.agi_plus : 0
- n += armor4 != nil ? armor4.agi_plus : 0
- return [[n, 1].max, 999].min
- end
- #--------------------------------------------------------------------------
- # ● 基本魔力の取得
- #--------------------------------------------------------------------------
- def base_int
- n = $data_actors[@actor_id].parameters[5, @level]
- weapon = $data_weapons[@weapon_id]
- armor1 = $data_armors[@armor1_id]
- armor2 = $data_armors[@armor2_id]
- armor3 = $data_armors[@armor3_id]
- armor4 = $data_armors[@armor4_id]
- # --- ここから追加部分 ---
- weapon2 = $data_weapons[@weapon2_id]
- # そのまま加算すると強すぎなので半分にしてみるテスト
- n += weapon2 != nil ? weapon2.int_plus / 2 : 0
- # --- 追加部分終わり ---
- n += weapon != nil ? weapon.int_plus : 0
- n += armor1 != nil ? armor1.int_plus : 0
- n += armor2 != nil ? armor2.int_plus : 0
- n += armor3 != nil ? armor3.int_plus : 0
- n += armor4 != nil ? armor4.int_plus : 0
- return [[n, 1].max, 999].min
- end
- #--------------------------------------------------------------------------
- # ● 基本攻撃力の取得
- #--------------------------------------------------------------------------
- def base_atk
- weapon = $data_weapons[@weapon_id]
- # --- ここから変更部分 ---
- weapon2 = $data_weapons[@weapon2_id]
- # そのまま加算すると強すぎなので半分にしてみるテスト
- n = weapon2 != nil ? weapon2.atk / 2 : 0
- return weapon != nil ? weapon.atk + n : n
- # --- 変更部分終わり ---
- end
- #--------------------------------------------------------------------------
- # ● 基本物理防御の取得
- #--------------------------------------------------------------------------
- def base_pdef
- weapon = $data_weapons[@weapon_id]
- armor1 = $data_armors[@armor1_id]
- armor2 = $data_armors[@armor2_id]
- armor3 = $data_armors[@armor3_id]
- armor4 = $data_armors[@armor4_id]
- pdef1 = weapon != nil ? weapon.pdef : 0
- pdef2 = armor1 != nil ? armor1.pdef : 0
- pdef3 = armor2 != nil ? armor2.pdef : 0
- pdef4 = armor3 != nil ? armor3.pdef : 0
- pdef5 = armor4 != nil ? armor4.pdef : 0
- # --- ここから追加部分 ---
- weapon2 = $data_weapons[@weapon2_id]
- # そのまま加算すると強すぎなので半分にしてみるテスト
- pdef1 += weapon2 != nil ? weapon2.pdef / 2 : 0
- # --- 追加部分終わり ---
- return pdef1 + pdef2 + pdef3 + pdef4 + pdef5
- end
- #--------------------------------------------------------------------------
- # ● 基本魔法防御の取得
- #--------------------------------------------------------------------------
- def base_mdef
- weapon = $data_weapons[@weapon_id]
- armor1 = $data_armors[@armor1_id]
- armor2 = $data_armors[@armor2_id]
- armor3 = $data_armors[@armor3_id]
- armor4 = $data_armors[@armor4_id]
- mdef1 = weapon != nil ? weapon.mdef : 0
- mdef2 = armor1 != nil ? armor1.mdef : 0
- mdef3 = armor2 != nil ? armor2.mdef : 0
- mdef4 = armor3 != nil ? armor3.mdef : 0
- mdef5 = armor4 != nil ? armor4.mdef : 0
- # --- ここから追加部分 ---
- weapon2 = $data_weapons[@weapon2_id]
- # そのまま加算すると強すぎなので半分にしてみるテスト
- mdef1 += weapon2 != nil ? weapon2.mdef / 2 : 0
- # --- 追加部分終わり ---
- return mdef1 + mdef2 + mdef3 + mdef4 + mdef5
- end
- #--------------------------------------------------------------------------
- # ● 通常攻撃 攻撃側アニメーション ID の取得
- #--------------------------------------------------------------------------
- def animation1_id
- weapon = $data_weapons[@weapon_id]
- # --- ここから変更部分 ---
- weapon2 = $data_weapons[@weapon2_id]
- animations = []
- animations.push(weapon.animation1_id) if weapon != nil
- animations.push(weapon2.animation1_id) if weapon2 != nil
- animations.delete(0)
- return animations.empty? ? 0 : animations
- # --- 変更部分終わり ---
- end
- #--------------------------------------------------------------------------
- # ● 通常攻撃 対象側アニメーション ID の取得
- #--------------------------------------------------------------------------
- def animation2_id
- weapon = $data_weapons[@weapon_id]
- # --- ここから変更部分 ---
- weapon2 = $data_weapons[@weapon2_id]
- animations = []
- animations.push(weapon.animation2_id) if weapon != nil
- animations.push(weapon2.animation2_id) if weapon2 != nil
- animations.delete(0)
- return animations.empty? ? 0 : animations
- # --- 変更部分終わり ---
- end
- #--------------------------------------------------------------------------
- # ● 装備の変更
- # equip_type : 装備タイプ(変更点:-1なら二刀流の盾部分の武器)
- # id : 武器 or 防具 ID (0 なら装備解除)
- #--------------------------------------------------------------------------
- def equip(equip_type, id)
- case equip_type
- when 0 # 武器
- if id == 0 or $game_party.weapon_number(id) > 0
- $game_party.gain_weapon(@weapon_id, 1)
- @weapon_id = id
- $game_party.lose_weapon(id, 1)
- # --- ここから追加部分 ---
- # 二刀武器じゃないものを装備した場合、盾の部分の二刀武器を外す
- if id != 0 and !$data_weapons[id].element_set.include?(Special_Element::get_index(Special_Element::TWO_WEAPONS))
- $game_party.gain_weapon(@weapon2_id, 1)
- @weapon2_id = 0
- end
- # --- 追加部分終わり ---
- end
- when 1 # 盾
- if id == 0 or $game_party.armor_number(id) > 0
- update_auto_state($data_armors[@armor1_id], $data_armors[id])
- $game_party.gain_armor(@armor1_id, 1)
- @armor1_id = id
- $game_party.lose_armor(id, 1)
- # --- ここから追加部分 ---
- # 二刀武器を装備していた場合は外す
- if id != 0
- $game_party.gain_weapon(@weapon2_id, 1)
- @weapon2_id = 0
- end
- # --- 追加部分終わり ---
- end
- when 2 # 頭
- if id == 0 or $game_party.armor_number(id) > 0
- update_auto_state($data_armors[@armor2_id], $data_armors[id])
- $game_party.gain_armor(@armor2_id, 1)
- @armor2_id = id
- $game_party.lose_armor(id, 1)
- end
- when 3 # 身体
- if id == 0 or $game_party.armor_number(id) > 0
- update_auto_state($data_armors[@armor3_id], $data_armors[id])
- $game_party.gain_armor(@armor3_id, 1)
- @armor3_id = id
- $game_party.lose_armor(id, 1)
- end
- when 4 # 装飾品
- if id == 0 or $game_party.armor_number(id) > 0
- update_auto_state($data_armors[@armor4_id], $data_armors[id])
- $game_party.gain_armor(@armor4_id, 1)
- @armor4_id = id
- $game_party.lose_armor(id, 1)
- end
- # --- ここから追加部分 ---
- when -1 # 二刀流の盾部分の武器
- if id == 0 or $game_party.weapon_number(id) > 0
- $game_party.gain_weapon(@weapon2_id, 1)
- @weapon2_id = id
- $game_party.lose_weapon(id, 1)
- # 盾を外す
- $game_party.gain_armor(@armor1_id, 1)
- @armor1_id = 0
- # 既に装備している武器が二刀武器じゃない場合は外す
- if id != 0 and @weapon_id != 0 and !$data_weapons[@weapon_id].element_set.include?(Special_Element::get_index(Special_Element::TWO_WEAPONS))
- $game_party.gain_weapon(@weapon_id, 1)
- @weapon_id = 0
- end
- end
- # --- 追加部分終わり ---
- end
- end
- #--------------------------------------------------------------------------
- # ● 二刀流可能なアクターかどうか
- #--------------------------------------------------------------------------
- def can_two_weapons?
- return class_element_set.include?(Special_Element::get_index(Special_Element::TWO_WEAPONS))
- end
- #--------------------------------------------------------------------------
- # ● アクターの所属クラスの属性がAのものを取得
- #--------------------------------------------------------------------------
- def class_element_set
- element_set = []
- for i in 1...$data_classes[@class_id].element_ranks.xsize
- element_set.push(i) if $data_classes[@class_id].element_ranks[i] == 1
- end
- return element_set
- end
- end
-
-
- class Window_EquipRight < Window_Selectable
- #--------------------------------------------------------------------------
- # ● リフレッシュ
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- @data = []
- @data.push($data_weapons[@actor.weapon_id])
- # --- ここから変更部分 ---
- @data.push(@actor.weapon2_id != 0 ? $data_weapons[@actor.weapon2_id] : $data_armors[@actor.armor1_id])
- # --- 変更部分終わり ---
- @data.push($data_armors[@actor.armor2_id])
- @data.push($data_armors[@actor.armor3_id])
- @data.push($data_armors[@actor.armor4_id])
- @item_max = @data.size
- self.contents.font.color = system_color
- self.contents.draw_text(4, 32 * 0, 92, 32, $data_system.words.weapon)
- self.contents.draw_text(4, 32 * 1, 92, 32, $data_system.words.armor1)
- self.contents.draw_text(4, 32 * 2, 92, 32, $data_system.words.armor2)
- self.contents.draw_text(4, 32 * 3, 92, 32, $data_system.words.armor3)
- self.contents.draw_text(5, 32 * 4, 92, 32, $data_system.words.armor4)
- draw_item_name(@data[0], 92, 32 * 0)
- draw_item_name(@data[1], 92, 32 * 1)
- draw_item_name(@data[2], 92, 32 * 2)
- draw_item_name(@data[3], 92, 32 * 3)
- draw_item_name(@data[4], 92, 32 * 4)
- end
- end
-
-
- class Window_EquipItem < Window_Selectable
- #--------------------------------------------------------------------------
- # ● リフレッシュ
- #--------------------------------------------------------------------------
- def refresh
- if self.contents != nil
- self.contents.dispose
- self.contents = nil
- end
- @data = []
- # 装備可能な武器を追加
- if @equip_type == 0
- weapon_set = $data_classes[@actor.class_id].weapon_set
- for i in 1...$data_weapons.size
- if $game_party.weapon_number(i) > 0 and weapon_set.include?(i)
- @data.push($data_weapons[i])
- end
- end
- end
- # --- ここから追加部分 ---
- # 二刀流可能なアクターの場合は、盾に二刀武器も表示
- if @equip_type == 1 and @actor.can_two_weapons?
- weapon_set = $data_classes[@actor.class_id].weapon_set
- for i in 1...$data_weapons.size
- if $game_party.weapon_number(i) > 0 and weapon_set.include?(i) and $data_weapons[i].element_set.include?(Special_Element::get_index(Special_Element::TWO_WEAPONS))
- @data.push($data_weapons[i])
- end
- end
- end
- # --- 追加部分終わり ---
- # 装備可能な防具を追加
- if @equip_type != 0
- armor_set = $data_classes[@actor.class_id].armor_set
- for i in 1...$data_armors.size
- if $game_party.armor_number(i) > 0 and armor_set.include?(i)
- if $data_armors[i].kind == @equip_type-1
- @data.push($data_armors[i])
- end
- end
- end
- end
- # 空白を追加
- @data.push(nil)
- # ビットマップを作成し、全項目を描画
- @item_max = @data.size
- self.contents = Bitmap.new(width - 32, row_max * 32)
- for i in 0...@item_max-1
- draw_item(i)
- end
- end
- end
-
-
- class Scene_Equip
- #--------------------------------------------------------------------------
- # ● リフレッシュ
- #--------------------------------------------------------------------------
- def refresh
- # アイテムウィンドウの可視状態設定
- @item_window1.visible = (@right_window.index == 0)
- @item_window2.visible = (@right_window.index == 1)
- @item_window3.visible = (@right_window.index == 2)
- @item_window4.visible = (@right_window.index == 3)
- @item_window5.visible = (@right_window.index == 4)
- # 現在装備中のアイテムを取得
- item1 = @right_window.item
- # 現在のアイテムウィンドウを @item_window に設定
- case @right_window.index
- when 0
- @item_window = @item_window1
- when 1
- @item_window = @item_window2
- when 2
- @item_window = @item_window3
- when 3
- @item_window = @item_window4
- when 4
- @item_window = @item_window5
- end
- # ライトウィンドウがアクティブの場合
- if @right_window.active
- # 装備変更後のパラメータを消去
- @left_window.set_new_parameters(nil, nil, nil)
- end
- # アイテムウィンドウがアクティブの場合
- if @item_window.active
- # 現在選択中のアイテムを取得
- item2 = @item_window.item
- # 装備を変更
- last_hp = @actor.hp
- last_sp = @actor.sp
- # --- ここから変更部分 ---
- # 現在の装備を保存(装備の種類を増やしている場合はここを変更)
- equipments = [@actor.weapon2_id, @actor.weapon_id, @actor.armor1_id, @actor.armor2_id, @actor.armor3_id, @actor.armor4_id]
- @actor.equip(equip_type(@right_window.index, item2), item2 == nil ? 0 : item2.id)
- # --- 変更部分終わり ---
- # 装備変更後のパラメータを取得
- new_atk = @actor.atk
- new_pdef = @actor.pdef
- new_mdef = @actor.mdef
- # --- ここから変更部分 ---
- # 装備を戻す
- for i in 0...equipments.size
- @actor.equip(i - 1, equipments[i])
- end
- # --- 変更部分終わり ---
- @actor.hp = last_hp
- @actor.sp = last_sp
- # レフトウィンドウに描画
- @left_window.set_new_parameters(new_atk, new_pdef, new_mdef)
- end
- end
- #--------------------------------------------------------------------------
- # ● フレーム更新 (アイテムウィンドウがアクティブの場合)
- #--------------------------------------------------------------------------
- def update_item
- # B ボタンが押された場合
- if Input.trigger?(Input::B)
- # キャンセル SE を演奏
- $game_system.se_play($data_system.cancel_se)
- # ライトウィンドウをアクティブ化
- @right_window.active = true
- @item_window.active = false
- @item_window.index = -1
- return
- end
- # C ボタンが押された場合
- if Input.trigger?(Input::C)
- # 装備 SE を演奏
- $game_system.se_play($data_system.equip_se)
- # アイテムウィンドウで現在選択されているデータを取得
- item = @item_window.item
- # --- ここから変更部分 ---
- # 装備を変更
- @actor.equip(equip_type(@right_window.index, item), item == nil ? 0 : item.id)
- # --- 変更部分終わり ---
- # ライトウィンドウをアクティブ化
- @right_window.active = true
- @item_window.active = false
- @item_window.index = -1
- # ライトウィンドウ、アイテムウィンドウの内容を再作成
- @right_window.refresh
- # --- ここから変更部分 ---
- # めんどくさいのですべてのウィンドウをリフレッシュ
- @item_window1.refresh
- @item_window2.refresh
- @item_window3.refresh
- @item_window4.refresh
- @item_window5.refresh
- # --- 変更部分終わり ---
- return
- end
- end
-
- # --- ここから追加部分 ---
- #--------------------------------------------------------------------------
- # ● 二刀流用の装備部位取得
- #--------------------------------------------------------------------------
- def equip_type(index, item)
- return index * (item.is_a?(RPG::Armor) ? 1 : -1)
- end
- # --- 追加部分終わり ---
- end
-
-
- class Scene_Battle
- #--------------------------------------------------------------------------
- # ● 基本アクション 結果作成
- #--------------------------------------------------------------------------
- def make_basic_action_result
- # 攻撃の場合
- if @active_battler.current_action.basic == 0
- # --- ここから変更部分 ---
- # アニメーション ID を設定
- @animation1_id = @active_battler.animation1_id.is_a?(Array) ? @active_battler.animation1_id.dup : @active_battler.animation1_id
- @animation2_id = @active_battler.animation2_id.is_a?(Array) ? @active_battler.animation2_id.dup : @active_battler.animation2_id
- # --- 変更部分終わり ---
- # 行動側バトラーがエネミーの場合
- if @active_battler.is_a?(Game_Enemy)
- if @active_battler.restriction == 3
- target = $game_troop.random_target_enemy
- elsif @active_battler.restriction == 2
- target = $game_party.random_target_actor
- else
- index = @active_battler.current_action.target_index
- target = $game_party.smooth_target_actor(index)
- end
- end
- # 行動側バトラーがアクターの場合
- if @active_battler.is_a?(Game_Actor)
- if @active_battler.restriction == 3
- target = $game_party.random_target_actor
- elsif @active_battler.restriction == 2
- target = $game_troop.random_target_enemy
- else
- index = @active_battler.current_action.target_index
- target = $game_troop.smooth_target_enemy(index)
- end
- end
- # 対象側バトラーの配列を設定
- @target_battlers = [target]
- # 通常攻撃の効果を適用
- for target in @target_battlers
- target.attack_effect(@active_battler)
- end
- return
- end
- # 防御の場合
- if @active_battler.current_action.basic == 1
- # ヘルプウィンドウに "防御" を表示
- @help_window.set_text($data_system.words.guard, 1)
- return
- end
- # 逃げるの場合
- if @active_battler.is_a?(Game_Enemy) and
- @active_battler.current_action.basic == 2
- # ヘルプウィンドウに "逃げる" を表示
- @help_window.set_text("逃げる", 1)
- # 逃げる
- @active_battler.escape
- return
- end
- # 何もしないの場合
- if @active_battler.current_action.basic == 3
- # アクション強制対象のバトラーをクリア
- $game_temp.forcing_battler = nil
- # ステップ 1 に移行
- @phase4_step = 1
- return
- end
- end
- #--------------------------------------------------------------------------
- # ● フレーム更新 (メインフェーズ ステップ 3 : 行動側アニメーション)
- #--------------------------------------------------------------------------
- def update_phase4_step3
- # --- ここから変更部分 ---
- # アニメーションの配列の先頭を取り出す
- if @animation1_id.is_a?(Integer)
- @animation1_id = [@animation1_id]
- end
- animation = @animation1_id.shift
- # 行動側アニメーション (ID が 0 の場合は白フラッシュ)
- if animation == 0
- @active_battler.white_flash = true
- else
- @active_battler.animation_id = animation
- @active_battler.animation_hit = true
- end
- # アニメーションがなくなったらステップ 4 に移行
- @phase4_step = 4 if @animation1_id.empty?
- # --- 変更部分終わり ---
- end
- #--------------------------------------------------------------------------
- # ● フレーム更新 (メインフェーズ ステップ 4 : 対象側アニメーション)
- #--------------------------------------------------------------------------
- def update_phase4_step4
- # --- ここから変更部分 ---
- # アニメーションの配列の先頭を取り出す
- if @animation2_id.is_a?(Integer)
- @animation2_id = [@animation2_id]
- end
- animation = @animation2_id.shift
- # 対象側アニメーション
- for target in @target_battlers
- target.animation_id = animation
- target.animation_hit = (target.damage != "Miss")
- end
- # アニメーションの長さにかかわらず、最低 8 フレーム待つ
- @wait_count = 8
- # アニメーションがなくなったらステップ 5 に移行
- @phase4_step = 5 if @animation2_id.empty?
- # --- 変更部分終わり ---
- end
- end
-
- #==============================================================================
- # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
- #==============================================================================
复制代码 |
|