设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1627|回复: 1
打印 上一主题 下一主题

[已经过期] 用sideview时报错说 undefined method "*" for nil:NilClass

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
86 小时
注册时间
2012-8-26
帖子
15
跳转到指定楼层
1
发表于 2012-9-19 15:32:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
使用的是最新的sideview版本,已经装了SideViewアクション設定和SideViewバトラー設定

其余还加了这个站子http://www4.plala.or.jp/findias/ ... ce_rgss3/index.html
Claimh的【和风纵向排列菜单脚本】和【战斗脚本フロントビュー改2】

然后加sideview时报错说:
3451行NoMthodError occurred undefined method "*" for nil:NilClass
  1. NoMthodError occurred
  2.                  undefined method "*" for nil:NilClass  
复制代码
附上sideview代码,请各位大神帮我看看好吗
  1. #==============================================================================
  2. # ■ Sideview Ver100
  3. #------------------------------------------------------------------------------
  4. #  サイドビューバトラーを管理するクラスです。
  5. #==============================================================================
  6. class SideView
  7.   #--------------------------------------------------------------------------
  8.   # ● 公開インスタンス変数 
  9.   #--------------------------------------------------------------------------
  10.   attr_accessor   :x                    # 画面X座標
  11.   attr_accessor   :y                    # 画面Y座標
  12.   attr_accessor   :z                    # 画面Z座標
  13.   attr_accessor   :h                    # 高さ座標
  14.   attr_accessor   :j                    # ジャンプ座標
  15.   attr_accessor   :c                    # カーブ座標
  16.   attr_accessor   :ox                   # 横原点
  17.   attr_accessor   :oy                   # 縦原点
  18.   attr_accessor   :oy_adjust            # 縦原点補正
  19.   attr_accessor   :angle                # 回転角度
  20.   attr_accessor   :zoom_x               # 横の拡大率
  21.   attr_accessor   :zoom_y               # 縦の拡大率
  22.   attr_accessor   :pattern_w            # セル横位置(矩形内)
  23.   attr_accessor   :pattern_h            # セル縦位置(矩形内)
  24.   attr_accessor   :sx                   # セル横位置(画像全体)
  25.   attr_accessor   :sy                   # セル縦位置(画像全体)
  26.   attr_accessor   :pattern_type         # セル更新タイプ
  27.   attr_accessor   :pattern_time         # セル更新間隔
  28.   attr_accessor   :graphic_name         # バトラー画像ファイル名
  29.   attr_accessor   :graphic_file_index   # バトラー画像ファイル名インデックス
  30.   attr_accessor   :graphic_index        # バトラー画像インデックス
  31.   attr_accessor   :cw                   # セル横矩形
  32.   attr_accessor   :ch                   # セル縦矩形
  33.   attr_accessor   :shadow_visible       # 影表示
  34.   attr_accessor   :weapon_visible       # 武器表示
  35.   
  36.   attr_accessor   :wait                 # 次の動作待ち時間
  37.   attr_accessor   :weapon_index         # 表示中の武器画像インデックス配列
  38.   attr_accessor   :weapon_end           # 武器アニメ終了フラグ
  39.   attr_accessor   :force_action         # 強制アクション
  40.   attr_accessor   :target_battler       # ターゲットバトラー情報
  41.   attr_accessor   :second_targets       # セカンドターゲット情報
  42.   attr_accessor   :m_a_targets          # アニメ飛ばしターゲット情報
  43.   attr_accessor   :individual_targets   # 個別処理ターゲットバトラー情報
  44.   attr_accessor   :effect_data          # エフェクトデータ
  45.   attr_accessor   :anime_id             # アニメID配列
  46.   attr_accessor   :anime_move_id        # 飛ばしアニメID配列
  47.   attr_accessor   :mirror               # 反転フラグ
  48.   attr_accessor   :opacity              # 透明度
  49.   attr_accessor   :opacity_data         # 透明度操作情報
  50.   attr_accessor   :set_damage           # バトルシーンでのダメージ処理
  51.   attr_accessor   :m_a_data             # アニメ飛ばし情報
  52.   attr_accessor   :m_a_starter          # アニメ飛ばし開始ターゲット情報
  53.   attr_accessor   :action_end           # バトルシーンでの行動終了
  54.   attr_accessor   :damage_anime_data    # ダメージ戦闘アニメのデータ
  55.   attr_accessor   :anime_no_mirror      # 戦闘アニメの反転禁止フラグ
  56.   attr_accessor   :anime_horming        # 戦闘アニメのホーミングフラグ
  57.   attr_accessor   :anime_camera_zoom    # 戦闘アニメがカメラに合わせて拡大縮小するか
  58.   attr_accessor   :anime_plus_z         # 戦闘アニメZ座標補正
  59.   attr_accessor   :derivation_skill_id  # スキル派生ID
  60.   attr_accessor   :immortal             # 不死身フラグ
  61.   attr_accessor   :mirage               # 残像データ
  62.   attr_accessor   :balloon_data         # ふきだしデータ
  63.   attr_accessor   :timing               # 別バトラーからのタイミングデータ
  64.   attr_accessor   :timing_targets       # タイミングデータを渡す別バトラー
  65.   attr_accessor   :color_set            # 色調変更データ
  66.   attr_accessor   :color                # 色調データ
  67.   attr_accessor   :change_up            # 画像変更フラグ
  68.   attr_accessor   :hit                  # 被攻撃回数
  69.   attr_accessor   :add_state            # 何度も付加ステートの表示を防ぐフラグ
  70.   attr_accessor   :counter_id           # カウンター時のスキルID
  71.   attr_accessor   :reflection_id        # 魔法反射時のアニメID
  72.   attr_accessor   :result_damage        # ターン終了時のHP変動データ
  73.   attr_accessor   :active               # 行動権
  74.   attr_accessor   :anime_off            # 戦闘アニメ消去
  75.   attr_accessor   :command_action       # コマンドアクションフラグ
  76.    
  77.   attr_accessor   :base_x               # 初期位置 X座標
  78.   attr_accessor   :base_y               # 初期位置 Y座標
  79.   attr_accessor   :base_h               # 初期位置 高さ座標
  80.   attr_accessor   :max_pattern_w        # セルの横分割数
  81.   attr_accessor   :max_pattern_h        # セルの縦分割数
  82.   
  83.   attr_reader     :collapse             # コラプスフラグ
  84.   attr_reader     :picture              # ピクチャ表示フラグ
  85.   #--------------------------------------------------------------------------
  86.   # ● オブジェクト初期化
  87.   #--------------------------------------------------------------------------
  88.   def initialize(battler)
  89.     @battler = battler
  90.     reset
  91.   end
  92.   #--------------------------------------------------------------------------
  93.   # ● 初期化
  94.   #--------------------------------------------------------------------------
  95.   def reset
  96.     @x = 0
  97.     @y = 0
  98.     @z = 0
  99.     @h = 0
  100.     @j = 0
  101.     @c = 0
  102.     @jump = []
  103.     @curve = []
  104.     @ox = 0
  105.     @oy = 0
  106.     @oy_adjust = 0
  107.     @z_plus = 0
  108.     @move_time = 0
  109.     @angle = 0
  110.     @angle_time = 0
  111.     @zoom_x = 1
  112.     @zoom_y = 1
  113.     @zoom_time = 0
  114.     @pattern_w = 0
  115.     @pattern_h = 0
  116.     @sx = 0
  117.     @sy = 0
  118.     @pattern_type = 0
  119.     @pattern_time = 0
  120.     @pattern_rest_time = 0
  121.     @graphic_name = ""
  122.     @graphic_file_index = ""
  123.     @graphic_index = 0
  124.     @cw = 0
  125.     @ch = 0
  126.     @shadow_visible = false
  127.     @weapon_visible = true
  128.    
  129.     @wait = 0
  130.     @weapon_index = []
  131.     @weapon_end = true
  132.     @full_action = []
  133.     @action = []
  134.     @force_action = ""
  135.     @target_battler = []
  136.     @second_targets = []
  137.     @individual_targets = []
  138.     @m_a_targets = []
  139.     @effect_data = []
  140.     @anime_id = []
  141.     @anime_move_id = []
  142.     @opacity = 255
  143.     @opacity_data = []
  144.     @set_damage = false
  145.     @m_a_data = []
  146.     @m_a_starter = []
  147.     @action_end = false
  148.     @damage_anime_data = []
  149.     @anime_no_mirror = false
  150.     @anime_horming = false
  151.     @anime_camera_zoom = false
  152.     @anime_plus_z = true
  153.     @derivation_skill_id = 0
  154.     @immortal = false
  155.     @mirage = []
  156.     @play_data = []
  157.     @balloon_data = []
  158.     @picture = false
  159.     @timing = []
  160.     @timing_targets = []
  161.     @color_set = []
  162.     @color = []
  163.     @change_up = false
  164.     @non_motion = false
  165.     @graphics_change = false
  166.     @hit = []
  167.     @add_state = []
  168.     @collapse = false
  169.     @counter_id = 0
  170.     @reflection_id = 0
  171.     @result_damage = [0,0]
  172.     @active = false
  173.     @anime_off = false
  174.     @command_action = false
  175.    
  176.     @base_x = 0
  177.     @base_y = 0
  178.     @base_z = 0
  179.     @base_h = 0
  180.     @max_pattern_w = 0
  181.     @max_pattern_h = 0
  182.     @pattern_kind = 0
  183.     @pattern_count = 0
  184.     @move_time = 0
  185.     @mirror = false
  186.     @battler.set_graphic(@pre_change_data[0], @pre_change_data[1], @pre_change_data[2], @pre_change_data[3]) if @pre_change_data != nil
  187.     @pre_change_data = nil
  188.   end  
  189.   #--------------------------------------------------------------------------
  190.   # ● セットアップ
  191.   #--------------------------------------------------------------------------
  192.   def setup(bitmap_width, bitmap_height, first_action_flag)
  193.     reset if first_action_flag
  194.     set_data
  195.     set_base_position if !@graphics_change
  196.     set_graphics(bitmap_width, bitmap_height)
  197.     set_target
  198.     setup_graphics_change if @graphics_change
  199.     first_battler_anime_set if first_action_flag
  200.   end  
  201.   #--------------------------------------------------------------------------
  202.   # ● バトラーデータ取得
  203.   #--------------------------------------------------------------------------
  204.   def set_data
  205.     return if @battler == nil
  206.     if @battler.actor?
  207.       @graphic_name = @battler.character_name
  208.       @graphic_index = @battler.character_index
  209.     else
  210.       @graphic_name = @battler.battler_name
  211.       @graphic_index = 0
  212.     end
  213.     @max_pattern_w = max_pattern[0]
  214.     @max_pattern_h = max_pattern[1]
  215.   end
  216.   #--------------------------------------------------------------------------
  217.   # ● ベース座標をセット data = [X軸, Y軸, H軸]  moment_set…瞬間配置
  218.   #--------------------------------------------------------------------------
  219.   def set_base_position(moment_set = true)
  220.     mirroring_reset
  221.     if @battler.actor?
  222.       data = N03::ACTOR_POSITION[@battler.index].dup
  223.       @base_x = data[0] * 100 if !@mirror
  224.       @base_x = (Graphics.width - data[0]) * 100 if @mirror
  225.     else
  226.       data = [@battler.screen_x, @battler.screen_y, 0].dup
  227.       @base_x = data[0] * 100 if !$sv_camera.mirror
  228.       @base_x = (Graphics.width - data[0]) * 100 if $sv_camera.mirror
  229.     end
  230.     @base_y = data[1] * 100
  231.     @base_h = data[2] * 100
  232.     @base_z = @y
  233.     return if !moment_set
  234.     @x = @base_x
  235.     @y = @base_y
  236.     @z = @base_z
  237.   end
  238.   #--------------------------------------------------------------------------
  239.   # ● グラフィックデータ取得
  240.   #--------------------------------------------------------------------------
  241.   def set_graphics(bitmap_width, bitmap_height)
  242.     sign = @graphic_name[/^[\!\$]./]
  243.     if sign && sign.include?(')
  244.       @cw = bitmap_width / @max_pattern_w
  245.       @ch = bitmap_height / @max_pattern_h
  246.     elsif @max_pattern_w == 1 && @max_pattern_h == 1
  247.       @cw = bitmap_width
  248.       @ch = bitmap_height
  249.     else
  250.       @cw = bitmap_width / (@max_pattern_w * 4)
  251.       @ch = bitmap_height / (@max_pattern_h * 2)
  252.     end
  253.     @ox = @cw / 2
  254.     @oy = @ch
  255.     @sx = (@graphic_index % 4 * @max_pattern_w + @pattern_w) * @cw
  256.     @sy = (@graphic_index / 4 * @max_pattern_h + @pattern_h) * @ch
  257.   end
  258.   #--------------------------------------------------------------------------
  259.   # ● ターゲットをセット
  260.   #--------------------------------------------------------------------------
  261.   def set_target(target = nil)
  262.     @target_battler = target
  263.     @target_battler = [@battler] if target == nil
  264.     @second_targets = @target_battler
  265.   end
  266.   #--------------------------------------------------------------------------
  267.   # ● 画像変更用のセットアップ
  268.   #--------------------------------------------------------------------------
  269.   def setup_graphics_change
  270.     @graphics_change = false
  271.     @sx = (@graphic_index % 4 * @max_pattern_w + @pattern_w) * @cw
  272.     @sy = (@graphic_index / 4 * @max_pattern_h + @pattern_h) * @ch
  273.   end  
  274.   #--------------------------------------------------------------------------
  275.   # ● 戦闘開始時の待機アニメ画像データ取得
  276.   #--------------------------------------------------------------------------
  277.   def first_battler_anime_set
  278.     loop do
  279.       update
  280.       break if @action_data == nil
  281.       break if @action_data[0] == "motion"
  282.       break if @action_data[0] == "move" && @action_data[8] != ""
  283.       break if @full_action == []
  284.     end
  285.     start_action(first_action) if @battler.movable?
  286.   end
  287.   #--------------------------------------------------------------------------
  288.   # ● アクション開始
  289.   #--------------------------------------------------------------------------
  290.   def start_action(kind = nil)
  291.     return if @event_fix && $game_troop.interpreter.running?
  292.     # ウェイト中の場合キャンセル
  293.     return @wait -= 1 if @wait > 0 && kind == nil
  294.     action_setup(false) if kind != nil
  295.     set_action(kind)
  296.     @action = kind if @action == nil
  297.     # 行動配列が無い場合は行動終了処理へ移行
  298.     action_terminate if @action == nil
  299.     # 次のアクション決定
  300.     @action_data = N03::ACTION[@action]
  301.     next_action
  302.   end
  303.   #--------------------------------------------------------------------------
  304.   # ● 行動パラメータの初期化
  305.   #--------------------------------------------------------------------------
  306.   def action_setup(reset = true)
  307.     @event_fix = false
  308.     @set_damage = false
  309.     @action_end = false
  310.     @balloon_data = []
  311.     @loop_act = []
  312.     angle_reset if reset
  313.     zoom_reset if reset
  314.     opacity_reset if reset
  315.     @curve = []
  316.     @c = 0
  317.     convert_jump
  318.   end  
  319.   #--------------------------------------------------------------------------
  320.   # ● 行動終了処理
  321.   #--------------------------------------------------------------------------
  322.   def action_terminate
  323.     @mirage = [] if @mirage_end
  324.     mirroring_reset
  325.     @picture = false
  326.     @individual_targets = []
  327.     action_setup if @active
  328.     action_setup(false) if !@active
  329.     # 待機アクションへ移行
  330.     stand_by_action if !@non_motion
  331.     # 戦闘行動のアクティブ権を終了
  332.     next_battler
  333.   end  
  334.   #--------------------------------------------------------------------------
  335.   # ● 新しいアクション内容の決定
  336.   #--------------------------------------------------------------------------
  337.   def set_action(kind = nil)
  338.     full_act = N03::FULLACTION[kind]
  339.     @full_action = full_act.dup if full_act != nil
  340.     @action = @full_action.shift
  341.     # 参照したアクションがフルアクションであれば全体のアクションを統合
  342.     full_act2 = N03::FULLACTION[@action]
  343.     @full_action = full_act2.dup + @full_action if full_act2 != nil
  344.   end
  345.   #--------------------------------------------------------------------------
  346.   # ● 次のアクションへ
  347.   #--------------------------------------------------------------------------
  348.   def next_action
  349.     @wait = 0
  350.     # ショートカット確認
  351.     eval(@action) if @action != nil && @action_data == nil && N03::FULLACTION[@action] == nil
  352.     # ウエイト設定
  353.     @wait = @action.to_i if @wait == 0 && @action_data == nil
  354.     @wait = rand(@wait.abs + 1) if @wait < 0
  355.     # アクション開始
  356.     action_play
  357.   end
  358.   #--------------------------------------------------------------------------
  359.   # ● 待機アクションへ移行
  360.   #--------------------------------------------------------------------------
  361.   def stand_by_action
  362.     # 通常待機に
  363.     stand_by_act = normal
  364.     # HPが1/4でピンチアクションに
  365.     stand_by_act = pinch if @battler.hp <= @battler.mhp / 4
  366.     # ステートチェック
  367.     stand_by_act = state(@battler.states[0].id) if @battler.states[0] != nil && state(@battler.states[0].id) != nil
  368.     # コマンドチェック
  369.     stand_by_act = command if @command_action && command != nil
  370.     set_action(stand_by_act)
  371.     @action = stand_by_act if @action == nil
  372.   end
  373.   #--------------------------------------------------------------------------
  374.   # ● 強制アクション開始
  375.   #--------------------------------------------------------------------------
  376.   def start_force_action
  377.     return if @active
  378.     start_action(@force_action)
  379.     @force_action = ""
  380.   end  
  381.   #--------------------------------------------------------------------------
  382.   # ● アクション追加
  383.   #--------------------------------------------------------------------------
  384.   def add_action(kind)
  385.     @full_action.push(kind)
  386.   end  
  387.   #--------------------------------------------------------------------------
  388.   # ● アクションの挿入
  389.   #--------------------------------------------------------------------------
  390.   def unshift_action(kind)
  391.     @full_action.unshift(kind)
  392.   end  
  393.   #--------------------------------------------------------------------------
  394.   # ● フレーム更新
  395.   #--------------------------------------------------------------------------
  396.   def update
  397.     # アクション開始
  398.     start_action
  399.     # 強制アクション開始
  400.     start_force_action if @force_action != ""
  401.     # アニメパターン更新
  402.     update_pattern
  403.     # 移動更新
  404.     update_move
  405.     # 回転更新
  406.     update_angle if @angle_time != 0
  407.     # 拡大縮小更新
  408.     update_zoom if @zoom_time != 0
  409.     # 透明度更新
  410.     update_opacity if @opacity_data != []
  411.   end
  412.   #--------------------------------------------------------------------------
  413.   # ● アニメパターン更新
  414.   #--------------------------------------------------------------------------
  415.   def update_pattern
  416.     return @pattern_rest_time -= 1 if @pattern_rest_time != 0
  417.     return if @max_pattern_w == 1 && @max_pattern_h == 1
  418.     @pattern_rest_time = @pattern_time
  419.     # 再生開始・終了セル位置を取得
  420.     if @pattern_kind > 0 # 通常再生中
  421.       @pattern_start = 0
  422.       @pattern_end = @max_pattern_w - 1
  423.     elsif @pattern_kind < 0 # 逆転再生中
  424.       @pattern_start = @max_pattern_w - 1
  425.       @pattern_end = 0
  426.     end
  427.     # 片道の再生が終了
  428.     @pattern_count += 1 if @pattern_w == @pattern_end && @pattern_kind != 0
  429.     # ループ処理
  430.     case @pattern_type.abs
  431.     when  1,3 # 片道
  432.       @pattern_kind =  0 if @pattern_count != 0 && @pattern_type ==  1
  433.       @pattern_kind =  0 if @pattern_count != 0 && @pattern_type == -1
  434.       @pattern_kind =  1 if @pattern_count != 0 && @pattern_type ==  3
  435.       @pattern_kind = -1 if @pattern_count != 0 && @pattern_type == -3
  436.       @pattern_w = @pattern_start - @pattern_kind if @pattern_count != 0 && @pattern_type.abs == 3
  437.       @pattern_count = 0
  438.     when  2,4 # 往復
  439.       @pattern_kind = -1 if @pattern_count == 1 && @pattern_type ==  2
  440.       @pattern_kind =  1 if @pattern_count == 1 && @pattern_type == -2
  441.       @pattern_kind =  0 if @pattern_count == 2 && @pattern_type ==  2
  442.       @pattern_kind =  0 if @pattern_count == 2 && @pattern_type == -2
  443.       @pattern_kind = -1 if @pattern_count == 1 && @pattern_type ==  4
  444.       @pattern_kind =  1 if @pattern_count == 1 && @pattern_type == -4
  445.       @pattern_kind =  1 if @pattern_count == 2 && @pattern_type ==  4
  446.       @pattern_kind = -1 if @pattern_count == 2 && @pattern_type == -4
  447.       @pattern_count = 0 if @pattern_count == 2
  448.     end
  449.     # セル更新
  450.     @pattern_w += 1 * @pattern_kind
  451.     @sx = (@graphic_index % 4 * @max_pattern_w + @pattern_w) * @cw
  452.   end
  453.   #--------------------------------------------------------------------------
  454.   # ● 移動の更新
  455.   #--------------------------------------------------------------------------
  456.   def update_move
  457.     @z = @y / 100 + @z_plus
  458.     return if @move_time == 0
  459.     target_position_set if @horming_move
  460.     @x = (@x * (@move_time - 1) + @target_x) / @move_time
  461.     @y = (@y * (@move_time - 1) + @target_y) / @move_time
  462.     @h = (@h * (@move_time - 1) + @target_h) / @move_time if @move_h != nil
  463.     @c += @curve[@move_time - 1] if @curve[@move_time - 1] != nil
  464.     @j += @jump[@move_time - 1] if @jump[@move_time - 1] != nil
  465.     @move_time -= 1
  466.     convert_jump if @move_time == 0
  467.   end
  468.   #--------------------------------------------------------------------------
  469.   # ● 移動目標の更新
  470.   #--------------------------------------------------------------------------
  471.   def target_position_set
  472.     target_position = N03.get_targets_position(@move_targets, @horming_move)
  473.     @target_x = target_position[0] + @move_x
  474.     @target_y = target_position[1] + @move_y
  475.     @target_h = target_position[2] + @move_h if @move_h != nil
  476.   end  
  477.   #--------------------------------------------------------------------------
  478.   # ● 回転更新
  479.   #--------------------------------------------------------------------------
  480.   def update_angle
  481.     @angle += @angling
  482.     @angle_time -= 1
  483.     return if @angle_time != 0
  484.     return angle_reset if @angle_data[4] == 0
  485.     angling(@angle_data) if @angle_data[4] == 2
  486.   end  
  487.   #--------------------------------------------------------------------------
  488.   # ● 拡大縮小更新
  489.   #--------------------------------------------------------------------------
  490.   def update_zoom
  491.     @zoom_x += @zooming_x
  492.     @zoom_y += @zooming_y
  493.     @zoom_time -= 1
  494.     return if @zoom_time != 0
  495.     return zoom_reset if @zoom_data[4] == 0
  496.     zooming(@zoom_data) if @zoom_data[4] == 2
  497.   end
  498.   #--------------------------------------------------------------------------
  499.   # ● 透明度更新
  500.   #--------------------------------------------------------------------------
  501.   def update_opacity
  502.     @opacity += @opacity_data[2]
  503.     @opacity_data[0] -= 1
  504.     return if @opacity_data[0] != 0
  505.     return if !@opacity_data[5]
  506.     @opacity_data[2] *= -1
  507.     @opacity_data[0] = @opacity_data[1]
  508.   end
  509.   #--------------------------------------------------------------------------
  510.   # ● アクション実行
  511.   #--------------------------------------------------------------------------
  512.   def action_play
  513.     return if @action_data == nil
  514.     action = @action_data[0]
  515.     # バトラー反転の場合
  516.     return mirroring                    if action == "mirror"
  517.     # 残像の場合
  518.     return mirage_set                   if action == "mirage"
  519.     # 回転の場合  
  520.     return angling                      if action == "angle"
  521.     # 拡大縮小の場合  
  522.     return zooming                      if action == "zoom"
  523.     # 透明度操作の場合  
  524.     return set_opacity                  if action == "opacity"
  525.     # バトラーアニメの場合
  526.     return battler_anime                if action == "motion"
  527.     # 移動の場合
  528.     return move                         if action == "move"
  529.     # 武器アニメの場合
  530.     return weapon_anime([@action_data]) if action == "wp"
  531.     # アニメ飛ばしの場合
  532.     return move_anime                   if action == "m_a"
  533.     # 戦闘シーン通信の場合(コラプス)
  534.     return set_play_data                if action == "collapse" or action == "no_collapse"
  535.     # データベース戦闘アニメ表示の場合  
  536.     return battle_anime                 if action == "anime"
  537.     # カメラワークの場合
  538.     return camera                       if action == "camera"
  539.     # 画面のシェイクの場合
  540.     return shake                        if action == "shake"
  541.     # 画面色調変更の場合
  542.     return color_effect                 if action == "color"
  543.     # トランジションの場合
  544.     return transition                   if action == "ts"
  545.     # ふきだしアニメ表示の場合  
  546.     return balloon_anime                if action == "balloon"
  547.     # ピクチャ表示の場合
  548.     return picture_set                  if action == "pic"
  549.     # ステート操作の場合
  550.     return state_set                    if action == "sta"
  551.     # FPS変更の場合
  552.     return fps                          if action == "fps"
  553.     # バトラー画像変更の場合  
  554.     return graphics_change              if action == "change"
  555.     # スキル派生の場合  
  556.     return derivating_skill             if action == "der"
  557.     # BGM/BGS/SE演奏の場合  
  558.     return sound                        if action == "sound"
  559.     # ムービー再生の場合  
  560.     return movie                        if action == "movie"
  561.     # ゲームスイッチ操作の場合  
  562.     return switches                     if action == "switch"
  563.     # ゲーム変数操作の場合  
  564.     return variable                     if action == "variable"
  565.     # 条件分岐(ゲームスイッチ)の場合
  566.     return nece_1                       if action == "n_1"
  567.     # 条件分岐(ゲーム変数)の場合
  568.     return nece_2                       if action == "n_2"
  569.     # 条件分岐(ステート)の場合
  570.     return nece_3                       if action == "n_3"
  571.     # 条件分岐(スキル)の場合
  572.     return nece_4                       if action == "n_4"
  573.     # 条件分岐(パラメータ)の場合
  574.     return nece_5                       if action == "n_5"
  575.     # 条件分岐(装備)の場合
  576.     return nece_6                       if action == "n_6"
  577.     # 条件分岐(スクリプト)の場合
  578.     return nece_7                       if action == "n_7"
  579.     # セカンドターゲット操作の場合  
  580.     return second_targets_set           if action == "s_t"
  581.     # コモンイベント呼び出しの場合  
  582.     return call_common_event            if action == "common"
  583.     # 戦闘アニメ消去の場合  
  584.     return @anime_off = true            if action == "anime_off"
  585.     # 強制戦闘終了の場合  
  586.     return BattleManager.process_abort  if action == "battle_end"
  587.     # 画面固定の場合  
  588.     return Graphics.freeze              if action == "graphics_freeze"
  589.     # ダメージアニメの場合  
  590.     return damage_anime                 if action == "damage_anime"
  591.     # 武器消去の場合  
  592.     return @weapon_visible = false      if action == "weapon_off"
  593.     # 武器消去解除の場合  
  594.     return @weapon_visible = true       if action == "weapon_on"
  595.     # 待機キャンセルの場合
  596.     return @non_motion = true           if action == "non_motion"
  597.     # 待機キャンセル解除の場合
  598.     return @non_motion = false          if action == "non_motion_cancel"
  599.     # 初期位置変更の場合
  600.     return change_base_position         if action == "change_base_position"
  601.     # 初期位置変更解除の場合
  602.     return set_base_position(false)     if action == "set_base_position"
  603.     # 強制アクションの場合  
  604.     return force_act                    if action == "force_action"
  605.     # 強制アクションの場合 (セカンドターゲット)
  606.     return force_act2                   if action == "force_action2"
  607.     # 個別開始の場合
  608.     return individual_start             if action == "individual_start"
  609.     # 個別終了の場合
  610.     return individual_end               if action == "individual_end"
  611.     # ループ開始の場合
  612.     return loop_start                   if action == "loop_start"
  613.     # ループ終了の場合
  614.     return loop_end                     if action == "loop_end"
  615.     # 自分のみ更新の場合
  616.     return only_action_on               if action == "only_action_on"
  617.     # 自分のみ更新解除の場合
  618.     return only_action_off              if action == "only_action_off"
  619.     # 次の行動者へ移行の場合
  620.     return next_battler                 if action == "next_battler"
  621.     # 画像変更フラグの場合
  622.     return set_change                   if action == "set_change"
  623.     # スクリプト操作の場合   
  624.     return eval(@action_data[0])
  625.   end
  626.   #--------------------------------------------------------------------------
  627.   # ● バトラー反転実行
  628.   #--------------------------------------------------------------------------
  629.   def mirroring
  630.     @mirror = !@mirror
  631.   end  
  632.   #--------------------------------------------------------------------------
  633.   # ● 反転初期化
  634.   #--------------------------------------------------------------------------
  635.   def mirroring_reset
  636.     @mirror = false
  637.     mirroring if [email protected]? && N03::ENEMY_MIRROR
  638.     mirroring if $sv_camera.mirror
  639.   end  
  640.   #--------------------------------------------------------------------------
  641.   # ● 残像実行
  642.   #--------------------------------------------------------------------------
  643.   def mirage_set
  644.     @mirage = @action_data.dup
  645.     @mirage_end = @mirage[3]
  646.     @mirage = [] if @mirage[1] == 0
  647.   end  
  648.   #--------------------------------------------------------------------------
  649.   # ● 回転実行
  650.   #--------------------------------------------------------------------------
  651.   def angling(data = @action_data)
  652.     @angle_data = data.dup
  653.     @oy = @ch / 2
  654.     @oy_adjust = @ch * 50
  655.     @angle_time = data[1]
  656.     start_angle = data[2] * N03.mirror_num(@mirror)
  657.     end_angle = data[3] * N03.mirror_num(@mirror)
  658.     # 時間が0以下なら即座に最終角度へ
  659.     @angle_time = 1 if @angle_time <= 0
  660.     # 回転時間から1フレームあたりの角度を出す
  661.     @angling = (end_angle - start_angle) / @angle_time
  662.     # 割り切れない余りを初期角度に
  663.     @angle = (end_angle - start_angle) % @angle_time + start_angle
  664.   end
  665.   #--------------------------------------------------------------------------
  666.   # ● 回転初期化
  667.   #--------------------------------------------------------------------------
  668.   def angle_reset
  669.     @oy = @ch
  670.     @angle = @angle_time = @oy_adjust = 0
  671.   end  
  672.   #--------------------------------------------------------------------------
  673.   # ● 拡大縮小実行
  674.   #--------------------------------------------------------------------------
  675.   def zooming(data = @action_data)
  676.     @zoom_data = data.dup
  677.     @zoom_time = data[1]
  678.     start_zoom_x = data[2][0]
  679.     start_zoom_y = data[2][1]
  680.     end_zoom_x = data[3][0]
  681.     end_zoom_y = data[3][1]
  682.     # 時間が0以下なら即座に最終サイズへ
  683.     @zoom_time = 1 if @zoom_time <= 0
  684.     # 拡大縮小時間から1フレームあたりの拡大縮小率を出す
  685.     @zooming_x = (end_zoom_x - start_zoom_x) / @zoom_time
  686.     @zooming_y = (end_zoom_y - start_zoom_y) / @zoom_time
  687.     # 開始サイズに
  688.     @zoom_x = start_zoom_x
  689.     @zoom_y = start_zoom_y
  690.   end  
  691.   #--------------------------------------------------------------------------
  692.   # ● 拡大縮小初期化
  693.   #--------------------------------------------------------------------------
  694.   def zoom_reset
  695.     @zoom_x = @zoom_y = 1
  696.     @zoom_time = 0
  697.   end  
  698.   #--------------------------------------------------------------------------
  699.   # ● バトラー透明度操作
  700.   #--------------------------------------------------------------------------
  701.   def set_opacity
  702.     data = @action_data.dup
  703.     @opacity = data[2]
  704.     opacity_move = (data[3] - data[2])/ data[1]
  705.     @opacity_data = [data[1], data[1], opacity_move, data[4], data[5], data[6]]
  706.     @wait = data[1] if data[7]
  707.     @wait *= 2 if data[6] && data[7]
  708.   end
  709.   #--------------------------------------------------------------------------
  710.   # ● 透明度操作初期化
  711.   #--------------------------------------------------------------------------
  712.   def opacity_reset
  713.     @opacity = 255
  714.     @opacity = 0 if @battler.hidden?
  715.     @opacity_data = []
  716.   end
  717.   #--------------------------------------------------------------------------
  718.   # ● バトラーアニメ実行
  719.   #--------------------------------------------------------------------------
  720.   def battler_anime(anime_data = nil)
  721.     anime_data = @action_data.dup if anime_data == nil
  722.     @graphic_file_index = anime_data[1] if !graphic_fix
  723.     @pattern_h = anime_data[2]
  724.     @pattern_w = anime_data[3]
  725.     @pattern_h = 0 if @max_pattern_w == 1
  726.     @pattern_w = 0 if @max_pattern_h == 1
  727.     @pattern_type = anime_data[4]
  728.     @pattern_time = anime_data[5]
  729.     @pattern_rest_time = anime_data[5]
  730.     @pattern_count = 0
  731.     @pattern_kind = 1
  732.     @pattern_kind = -1 if @pattern_type < 0
  733.     @pattern_kind = 0 if @pattern_type == 0
  734.     @sx = (@graphic_index % 4 * @max_pattern_w + @pattern_w) * @cw
  735.     @sy = (@graphic_index / 4 * @max_pattern_h + @pattern_h) * @ch
  736.     @z_plus = anime_data[6]
  737.     @wait = set_anime_wait if anime_data[7]
  738.     @shadow_visible = anime_data[8]
  739.     weapon_anime(anime_data)
  740.   end
  741.   #--------------------------------------------------------------------------
  742.   # ● アニメウエイト計算
  743.   #--------------------------------------------------------------------------
  744.   def set_anime_wait
  745.     if @pattern_type > 0
  746.       pattern_time_a = @max_pattern_w - @pattern_w.abs
  747.     elsif @pattern_type < 0
  748.       pattern_time_a = @pattern_w.abs + 1
  749.     else
  750.       return @pattern_time if @pattern_type == 0
  751.     end
  752.     case @pattern_type
  753.     when 1,-1, 3,-3
  754.       return pattern_time_a * @pattern_time
  755.     when 2,-2, 4,-4
  756.       return pattern_time_a * @pattern_time + (@max_pattern_w - 2) * @pattern_time
  757.     end
  758.   end  
  759.   #--------------------------------------------------------------------------
  760.   # ● 移動実行
  761.   #--------------------------------------------------------------------------
  762.   def move
  763.     @move_targets = N03.get_targets(@action_data[1].abs, @battler)
  764.     return if @move_targets == []
  765.     @move_targets = [@battler] if @action_data[1].abs == 7
  766.     @move_x = @action_data[2] * 100 * N03.mirror_num(@mirror)
  767.     @move_y = @action_data[3] * 100
  768.     @move_h = @action_data[4] * 100 if @action_data[4] != nil
  769.     @move_h = nil if @action_data[4] == nil
  770.     battler_anime(N03::ACTION[@action_data[8]].dup) if N03::ACTION[@action_data[8]] != nil
  771.     @horming_move = true
  772.     @horming_move = false if @action_data[1] < 0 or @action_data[1].abs == 7
  773.     target_position_set
  774.     target_position = [@target_x, @target_y, @target_z]
  775.     distanse_move = @action_data[5] > 0
  776.     @move_time = N03.distanse_calculation(@action_data[5].abs, target_position, [@x, @y, @z], distanse_move)
  777.     @wait = @move_time
  778.     curve
  779.     jump
  780.     @move_time = 1 if @move_time == 0
  781.     @horming_move = false if !@move_targets or @move_targets.include?(@battler)
  782.     update_move if @move_time == 1
  783.   end  
  784.   #--------------------------------------------------------------------------
  785.   # ● カーブ実行
  786.   #--------------------------------------------------------------------------
  787.   def curve
  788.     @c = 0
  789.     return if @action_data[6] == 0
  790.     @curve = N03.parabola([@action_data[6], -@action_data[6]], @move_time, 100, 4)
  791.   end  
  792.   #--------------------------------------------------------------------------
  793.   # ● ジャンプ実行
  794.   #--------------------------------------------------------------------------
  795.   def jump
  796.     convert_jump
  797.     return if @action_data[7] == [0,0]
  798.     @jump = N03.parabola(@action_data[7].dup, @move_time, 100)
  799.   end  
  800.   #--------------------------------------------------------------------------
  801.   # ● J座標(ジャンプ高度)をH座標に変換
  802.   #--------------------------------------------------------------------------
  803.   def convert_jump
  804.     @h += @j
  805.     @j = 0
  806.     @jump = []
  807.   end  
  808.   #--------------------------------------------------------------------------
  809.   # ● データベース戦闘アニメ実行
  810.   #--------------------------------------------------------------------------
  811.   def battle_anime
  812.     data = @action_data.dup
  813.     targets = N03.get_targets(data[2], @battler)
  814.     return if targets == []
  815.     data[8] = !data[8] if @mirror
  816.     @set_damage           = data[5]
  817.     @damage_anime_data[0] = N03.get_attack_anime_id(data[1], @battler)
  818.     @damage_anime_data[1] = data[8]
  819.     @damage_anime_data[2] = data[7]
  820.     @damage_anime_data[3] = data[6]
  821.     @damage_anime_data[4] = data[9]
  822.     @wait = N03.get_anime_time(@damage_anime_data[0]) - 2 if data[4]
  823.     return if @set_damage
  824.     for target in targets do display_anime(targets, target, data) end
  825.   end
  826.   #--------------------------------------------------------------------------
  827.   # ● 武器アニメ開始
  828.   #--------------------------------------------------------------------------
  829.   def weapon_anime(anime_data)
  830.     @weapon_end = true
  831.     for i in 9...anime_data.size
  832.       set_effect_data(anime_data[i]) if anime_data[i] != ""
  833.     end
  834.   end
  835.   #--------------------------------------------------------------------------
  836.   # ● アニメ飛ばし開始
  837.   #--------------------------------------------------------------------------
  838.   def move_anime
  839.     @m_a_starter = []
  840.     @m_a_targets = []
  841.     starters = N03.get_targets(@action_data[2], @battler)
  842.     targets = N03.get_targets(@action_data[3], @battler)
  843.     return if starters == [] or targets == []
  844.     single_start = true if starters != nil && @action_data[2] < 0
  845.     single_start = true if @action_data[1][0] != 0 && $data_animations[N03.get_attack_anime_id(@action_data[1][0], @battler)].position == 3
  846.     starters = [starters[0]] if single_start
  847.     single_end = true if targets != nil && @action_data[3] < 0
  848.     single_end = true if @action_data[1][1] != 0 && $data_animations[N03.get_attack_anime_id(@action_data[1][1], @battler)].position == 3
  849.     targets = [targets[0]] if single_end
  850.     se_flag = true
  851.     for starter in starters
  852.       for target in targets
  853.         data = @action_data.dup
  854.         data[17] = se_flag
  855.         @effect_data.push(data)
  856.         @m_a_targets.push(target)
  857.         @m_a_starter.push(starter)
  858.         se_flag = false
  859.       end
  860.     end  
  861.   end
  862.   #--------------------------------------------------------------------------
  863.   # ● スプライトセット通信
  864.   #--------------------------------------------------------------------------
  865.   def set_effect_data(data = @action)
  866.     action_data = N03::ACTION[data]
  867.     return if action_data == nil
  868.     @effect_data.push(action_data.dup)
  869.   end
  870.   #--------------------------------------------------------------------------
  871.   # ● 戦闘シーン通信のデータを格納
  872.   #--------------------------------------------------------------------------
  873.   def set_play_data(data = @action_data)
  874.     @play_data = data.dup
  875.   end
  876.   #--------------------------------------------------------------------------
  877.   # ● 戦闘アニメの表示
  878.   #--------------------------------------------------------------------------
  879.   def display_anime(targets, target, data)
  880.     return if !N03.first_of_all_screen_anime(data[1], target, targets)
  881.     target.animation_id         = N03.get_attack_anime_id(data[1], @battler)
  882.     target.animation_mirror     = data[8]
  883.     target.sv.anime_horming     = data[3]
  884.     target.sv.anime_camera_zoom = data[6]
  885.     target.sv.anime_no_mirror   = data[7]
  886.     target.sv.anime_plus_z      = data[9]
  887.   end
  888.   #--------------------------------------------------------------------------
  889.   # ● 戦闘アニメ拡張データの初期化
  890.   #--------------------------------------------------------------------------
  891.   def reset_anime_data
  892.     @anime_no_mirror = false
  893.     @anime_horming = false
  894.     @anime_camera_zoom = false
  895.     @timing_targets = []
  896.     @anime_plus_z = true
  897.   end  
  898.   #--------------------------------------------------------------------------
  899.   # ● カメラワーク
  900.   #--------------------------------------------------------------------------
  901.   def camera
  902.     data = @action_data.dup
  903.     N03.camera(@battler, data)
  904.     @wait = data[4] if data[5]
  905.   end  
  906.   #--------------------------------------------------------------------------
  907.   # ● 画面のシェイク
  908.   #--------------------------------------------------------------------------
  909.   def shake
  910.     data = @action_data.dup
  911.     $sv_camera.shake(data[1], data[2], data[3])
  912.     @wait = data[3] if data[4]
  913.   end
  914.   #--------------------------------------------------------------------------
  915.   # ● 画面色調変更
  916.   #--------------------------------------------------------------------------
  917.   def color_effect
  918.     case @action_data[1]
  919.     when 0,1,2,3,4,5
  920.       targets = N03.get_targets(@action_data[1], @battler)
  921.     when 6
  922.       screen = true
  923.     when 7
  924.       targets = [@battler] + @target_battler
  925.     when 8
  926.       screen = true
  927.       targets = $game_troop.members + $game_party.battle_members - [@battler]
  928.     when 9
  929.       screen = true
  930.       targets = $game_troop.members + $game_party.battle_members - [@battler] - @target_battler
  931.     when 10
  932.       screen = true
  933.       targets = $game_troop.members + $game_party.battle_members
  934.     end
  935.     return if screen == nil && targets == []
  936.     for target in targets do target.sv.color_set = @action_data[2] end if targets
  937.     @wait = @action_data[2][4] if @action_data[3]
  938.     return if !screen
  939.     $sv_camera.color_set[1] = @action_data[2]
  940.     $sv_camera.color_set[2] = @action_data[2]
  941.   end  
  942.   #--------------------------------------------------------------------------
  943.   # ● トランジション
  944.   #--------------------------------------------------------------------------
  945.   def transition
  946.     $sv_camera.perform_transition(@action_data)
  947.   end  
  948.   #--------------------------------------------------------------------------
  949.   # ● ふきだしアニメ表示
  950.   #--------------------------------------------------------------------------
  951.   def balloon_anime
  952.     @balloon_data = @action_data.dup
  953.   end  
  954.   #--------------------------------------------------------------------------
  955.   # ● ピクチャ表示
  956.   #--------------------------------------------------------------------------
  957.   def picture_set
  958.     @picture = true
  959.     set_effect_data
  960.   end
  961.   #--------------------------------------------------------------------------
  962.   # ● ステート操作
  963.   #--------------------------------------------------------------------------
  964.   def state_set
  965.     targets = N03.get_targets(@action_data[1], @battler)
  966.     return if targets == []
  967.     case @action_data[2]
  968.     when 1 ; targets = [targets[rand(targets.size)]]
  969.     when 2 ; targets -= @battler if targets.include?(@battler)
  970.     end
  971.     for target in targets
  972.       for id in @action_data[4]
  973.         target.add_state(id) if @action_data[3] == "+"
  974.         target.remove_state(id) if @action_data[3] == "-"
  975.       end
  976.     end
  977.   end
  978.   #--------------------------------------------------------------------------
  979.   # ● FPS変更
  980.   #--------------------------------------------------------------------------
  981.   def fps
  982.     Graphics.frame_rate = @action_data[1]
  983.     start_action
  984.   end
  985.   #--------------------------------------------------------------------------
  986.   # ● バトラー画像変更の場合
  987.   #--------------------------------------------------------------------------
  988.   def graphics_change
  989.     @graphics_change = true
  990.     return @battler.graphics_change(@action_data[3]) if [email protected]?
  991.     @pre_change_data = [@battler.character_name, @battler.character_index, @battler.face_name, @battler.face_index] if @pre_change_data == nil && !@action_data[1]
  992.     if @action_data[4] == []
  993.       face_name = @battler.face_name
  994.       face_index = @battler.face_index
  995.     else
  996.       face_name = @action_data[4][1]
  997.       face_index = @action_data[4][0]
  998.     end
  999.     @battler.set_graphic(@action_data[3], @action_data[2], face_name, face_index)
  1000.   end
  1001.   #--------------------------------------------------------------------------
  1002.   # ● スキル派生
  1003.   #--------------------------------------------------------------------------
  1004.   def derivating_skill
  1005.     # 未修得スキルは派生不可なら
  1006.     return if !@action_data[1] && [email protected]_learn?($data_skills[@action_data[3]])
  1007.     # コスト不足は派生不可なら
  1008.     return if !@action_data[2] && [email protected]_cost_payable?($data_skills[@action_data[3]])
  1009.     # 派生
  1010.     @derivation_skill_id = @action_data[3]
  1011.     # 以降のアクションをキャンセル
  1012.     @full_action = []
  1013.   end
  1014.   #--------------------------------------------------------------------------
  1015.   # ● BGM/BGS/SE演奏
  1016.   #--------------------------------------------------------------------------
  1017.   def sound
  1018.     pitch = @action_data[2]
  1019.     vol   = @action_data[3]
  1020.     name  = @action_data[4]
  1021.     case @action_data[1]
  1022.     when "se"
  1023.       Audio.se_play("Audio/SE/" + name, vol, pitch)
  1024.     when "bgm"
  1025.       # 名前指定のない場合、現在のBGMを変えないように
  1026.       name = RPG::BGM.last.name if @action_data[4] == ""
  1027.       Audio.bgm_play("Audio/BGM/" + name, vol, pitch)
  1028.     when "bgs"
  1029.       name = RPG::BGS.last.name if @action_data[4] == ""
  1030.       Audio.bgs_play("Audio/BGS/" + name, vol, pitch)
  1031.     end
  1032.   end
  1033.   #--------------------------------------------------------------------------
  1034.   # ● ムービーの再生
  1035.   #--------------------------------------------------------------------------
  1036.   def movie
  1037.     Graphics.play_movie('Movies/' + @action_data[1])
  1038.   end
  1039.   #--------------------------------------------------------------------------
  1040.   # ● ゲームスイッチ操作
  1041.   #--------------------------------------------------------------------------
  1042.   def switches
  1043.     for id in @action_data[1]
  1044.       $game_switches[id] = true if id > 0
  1045.       $sv_camera.switches[id.abs] = true  if id < 0
  1046.     end
  1047.     for id in @action_data[2]
  1048.       $game_switches[id] = false if id > 0
  1049.       $sv_camera.switches[id.abs] = false  if id < 0
  1050.     end
  1051.     $sv_camera.program_check
  1052.   end
  1053.   #--------------------------------------------------------------------------
  1054.   # ● ゲーム変数操作
  1055.   #--------------------------------------------------------------------------
  1056.   def variable
  1057.     # オペランドチェック
  1058.     operand = @action_data[3]
  1059.     operand = $game_variables[@action_data[3].abs] if @action_data[3] < 0
  1060.     # 変数操作で分岐
  1061.     case @action_data[2]
  1062.     when 0 ; $game_variables[@action_data[1]] = operand  # 代入
  1063.     when 1 ; $game_variables[@action_data[1]] += operand # 加算
  1064.     when 2 ; $game_variables[@action_data[1]] -= operand # 減算
  1065.     when 3 ; $game_variables[@action_data[1]] *= operand # 乗算
  1066.     when 4 ; $game_variables[@action_data[1]] /= operand # 除算
  1067.     when 5 ; $game_variables[@action_data[1]] %= operand # 剰余
  1068.     end
  1069.   end  
  1070.   #--------------------------------------------------------------------------
  1071.   # ● 条件分岐 (ゲームスイッチ)
  1072.   #--------------------------------------------------------------------------
  1073.   def nece_1
  1074.     judgment = $game_switches[@action_data[1]] == @action_data[2] if @action_data[1] > 0
  1075.     judgment = $sv_camera.switches[@action_data[1].abs] == @action_data[2] if @action_data[1] < 0
  1076.     action_diverging(judgment, @action_data[3])
  1077.   end  
  1078.   #--------------------------------------------------------------------------
  1079.   # ● 条件分岐 (ゲーム変数)
  1080.   #--------------------------------------------------------------------------
  1081.   def nece_2
  1082.     variable = $game_variables[@action_data[1]]
  1083.     num = @action_data[2]
  1084.     num = $game_variables[@action_data[2].abs] if num < 0
  1085.     case @action_data[3]
  1086.     when 0 ; judgment = variable == num
  1087.     when 1 ; judgment = variable < num
  1088.     when 2 ; judgment = variable > num
  1089.     end  
  1090.     action_diverging(judgment, @action_data[4])
  1091.   end  
  1092.   #--------------------------------------------------------------------------
  1093.   # ● 条件分岐 (ステート)
  1094.   #--------------------------------------------------------------------------
  1095.   def nece_3
  1096.     targets = N03.get_targets(@action_data[1], @battler)
  1097.     return if targets == []
  1098.     member_num = @action_data[4]
  1099.     member_num = targets.size if @action_data[4] == 0 && targets.size > 1
  1100.     hit_count = 0
  1101.     miss_count = 0
  1102.     for target in targets
  1103.       hit_count += 1 if target.state?(@action_data[2])
  1104.       miss_count += 1 if !target.state?(@action_data[2])
  1105.     end
  1106.     case @action_data[3]
  1107.     when 0 ; judgment = hit_count >= member_num
  1108.     when 1 ; judgment = miss_count >= member_num
  1109.     end
  1110.     action_diverging(judgment, @action_data[5])
  1111.   end  
  1112.   #--------------------------------------------------------------------------
  1113.   # ● 条件分岐 (スキル)
  1114.   #--------------------------------------------------------------------------
  1115.   def nece_4
  1116.     targets = N03.get_targets(@action_data[1], @battler)
  1117.     return if targets == []
  1118.     member_num = @action_data[4]
  1119.     member_num = targets.size if @action_data[4] == 0 && targets.size > 1
  1120.     hit_count = 0
  1121.     miss_count = 0
  1122.     for target in targets
  1123.       hit_count += 1 if target.skill_learn?($data_skills[@action_data[2]]) && target.skill_conditions_met?($data_skills[@action_data[2]])
  1124.       miss_count += 1 if !target.skill_learn?($data_skills[@action_data[2]]) or !target.skill_conditions_met?($data_skills[@action_data[2]])
  1125.     end
  1126.     case @action_data[3]
  1127.     when 0 ; judgment = hit_count >= member_num
  1128.     when 1 ; judgment = miss_count >= member_num
  1129.     end
  1130.     action_diverging(judgment, @action_data[5])
  1131.   end  
  1132.   #--------------------------------------------------------------------------
  1133.   # ● 条件分岐 (パラメータ)
  1134.   #--------------------------------------------------------------------------
  1135.   def nece_5
  1136.     targets = N03.get_targets(@action_data[1], @battler)
  1137.     return if targets == []
  1138.     member_num = @action_data[5]
  1139.     member_num = targets.size if @action_data[5] == 0 && targets.size > 1
  1140.     hit_count = 0
  1141.     for target in targets
  1142.       hit_count += 1 if target.comparison_parameter([@action_data[2],@action_data[3],@action_data[4]])
  1143.     end
  1144.     judgment = hit_count >= member_num
  1145.     action_diverging(judgment, @action_data[6])
  1146.   end  
  1147.   #--------------------------------------------------------------------------
  1148.   # ● 条件分岐 (装備)
  1149.   #--------------------------------------------------------------------------
  1150.   def nece_6
  1151.     targets = N03.get_targets(@action_data[1], @battler)
  1152.     return if targets == []
  1153.     member_num = @action_data[5]
  1154.     member_num = targets.size if @action_data[5] == 0 && targets.size > 1
  1155.     hit_count = 0
  1156.     miss_count = 0
  1157.     for target in targets
  1158.       hit_count += 1 if target.comparison_equip([@action_data[2],@action_data[3]])
  1159.       miss_count += 1 if !target.comparison_equip([@action_data[2],@action_data[3]])
  1160.     end
  1161.     case @action_data[4]
  1162.     when 0 ; judgment = hit_count >= member_num
  1163.     when 1 ; judgment = miss_count >= member_num
  1164.     end
  1165.     action_diverging(judgment, @action_data[6])
  1166.   end  
  1167.   #--------------------------------------------------------------------------
  1168.   # ● 条件分岐 (スクリプト)
  1169.   #--------------------------------------------------------------------------
  1170.   def nece_7
  1171.     judgment = eval(@action_data[2])
  1172.     action_diverging(judgment, @action_data[1])
  1173.   end  
  1174.   #--------------------------------------------------------------------------
  1175.   # ● アクション分岐  
  1176.   #--------------------------------------------------------------------------
  1177.   def action_diverging(judgment, kind)
  1178.     result = 0
  1179.     if judgment
  1180.       result = 1 if kind == 1
  1181.       result = 2 if kind == 2
  1182.     else
  1183.       result = 1 if kind == 0
  1184.     end
  1185.     # フルアクション終了
  1186.     return @full_action = []  if result == 2
  1187.     # 次のアクションを除去
  1188.     @full_action.shift if result == 1
  1189.     set_action
  1190.     # 次のアクションを実行
  1191.     @action_data = N03::ACTION[@action]
  1192.     next_action
  1193.   end
  1194.   #--------------------------------------------------------------------------
  1195.   # ● セカンドターゲット操作
  1196.   #--------------------------------------------------------------------------
  1197.   def second_targets_set
  1198.     targets = N03.get_targets(@action_data[1], @battler)
  1199.     for target in targets
  1200.       targets.delete(target) if @action_data[2][1] == 1 && target.index != @action_data[2][0]
  1201.       targets.delete(target) if @action_data[2][1] == 2 && target.index == @action_data[2][0].abs
  1202.       targets.delete(target) if @action_data[3] > 0 && target.id != @action_data[3]
  1203.       targets.delete(target) if @action_data[3] < 0 && target.id == @action_data[3].abs
  1204.       targets.delete(target) if @action_data[4] > 0 && !target.state?(@action_data[4])
  1205.       targets.delete(target) if @action_data[4] < 0 && target.state?(@action_data[4].abs)
  1206.       targets.delete(target) if @action_data[5] > 0 && !target.skill_conditions_met?($data_skills[@action_data[5]])
  1207.       targets.delete(target) if @action_data[5] < 0 && target.skill_conditions_met?($data_skills[@action_data[5].abs])
  1208.       targets.delete(target) if !target.comparison_parameter(@action_data[6])
  1209.       targets.delete(target) if !@action_data[7][1].include?(0) && !target.comparison_equip(@action_data[7])
  1210.     end
  1211.     return @second_targets = [] if targets.size == 0
  1212.     case @action_data[8]
  1213.     when 1 ; targets = [targets[rand(targets.size)]]
  1214.     when 2 ; targets.delete(@battler)
  1215.     end
  1216.     return @second_targets = [] if targets.size == 0
  1217.     @second_targets = targets
  1218.     case @action_data[9]
  1219.     when 0 ; return
  1220.     when 1 ; set_play_data(["second_targets_set"])
  1221.     when 2 ; set_play_data(["targets_set"])
  1222.     end
  1223.     @wait += 1
  1224.   end
  1225.   #--------------------------------------------------------------------------
  1226.   # ● コモンイベント呼び出し
  1227.   #--------------------------------------------------------------------------
  1228.   def call_common_event
  1229.     $game_temp.reserve_common_event(@action_data[1])
  1230.     $sv_camera.event = true
  1231.     @event_fix = @action_data[2]
  1232.   end
  1233.   #--------------------------------------------------------------------------
  1234.   # ● ダメージアニメ
  1235.   #--------------------------------------------------------------------------
  1236.   def damage_anime(delay_time = 12)
  1237.     anime(N03.get_attack_anime_id(-3, @battler), wait = true)
  1238.     action_play
  1239.     @wait -= delay_time
  1240.     @full_action.unshift("eval('@damage_anime_data = []
  1241.     @set_damage = true')")
  1242.   end
  1243.   #--------------------------------------------------------------------------
  1244.   # ● 通常コラプス
  1245.   #--------------------------------------------------------------------------
  1246.   def normal_collapse
  1247.     @collapse = true
  1248.     return
  1249.   end
  1250.   #--------------------------------------------------------------------------
  1251.   # ● 初期位置変更
  1252.   #--------------------------------------------------------------------------
  1253.   def change_base_position
  1254.     @base_x = @x
  1255.     @base_y = @y
  1256.     @base_h = @h
  1257.   end  
  1258.   #--------------------------------------------------------------------------
  1259.   # ● 強制アクション実行
  1260.   #--------------------------------------------------------------------------
  1261.   def force_act
  1262.     target(@full_action.shift)
  1263.   end
  1264.   #--------------------------------------------------------------------------
  1265.   # ● 強制アクション実行 (セカンドターゲット)
  1266.   #--------------------------------------------------------------------------
  1267.   def force_act2
  1268.     target2(@full_action.shift)
  1269.   end
  1270.   #--------------------------------------------------------------------------
  1271.   # ● 個別処理開始
  1272.   #--------------------------------------------------------------------------
  1273.   def individual_start
  1274.     @individual_targets = @target_battler.dup
  1275.     @remain_targets = @target_battler.dup
  1276.     @target_battler = [@individual_targets[0]]
  1277.     # リピート部分のアクションを保持
  1278.     @individual_act = @full_action.dup
  1279.   end
  1280.   #--------------------------------------------------------------------------
  1281.   # ● 個別処理終了
  1282.   #--------------------------------------------------------------------------
  1283.   def individual_end
  1284.     @individual_targets.shift
  1285.     for target in @individual_targets
  1286.       @individual_targets.shift if target.dead?
  1287.     end
  1288.     # ターゲットが残っているなら行動リピート
  1289.     return @target_battler = @remain_targets if @individual_targets.size == 0
  1290.     @full_action = @individual_act.dup
  1291.     @target_battler = [@individual_targets[0]]
  1292.   end
  1293.   #--------------------------------------------------------------------------
  1294.   # ● ループ開始
  1295.   #--------------------------------------------------------------------------
  1296.   def loop_start
  1297.     # ループ部分のアクションを保持
  1298.     @loop_act = @full_action.dup
  1299.   end
  1300.   #--------------------------------------------------------------------------
  1301.   # ● ループ終了
  1302.   #--------------------------------------------------------------------------
  1303.   def loop_end
  1304.     # 行動リピート
  1305.     @full_action = @loop_act.dup if @loop_act != []
  1306.   end
  1307.   #--------------------------------------------------------------------------
  1308.   # ● 次の行動者へ移行
  1309.   #--------------------------------------------------------------------------
  1310.   def next_battler
  1311.     @action_end = true
  1312.     @active = false
  1313.   end
  1314.   #--------------------------------------------------------------------------
  1315.   # ● 画像変更フラグ
  1316.   #--------------------------------------------------------------------------
  1317.   def set_change
  1318.     @change_up = true
  1319.   end
  1320.   #--------------------------------------------------------------------------
  1321.   # ● 戦闘シーン通信
  1322.   #--------------------------------------------------------------------------
  1323.   def play_data
  1324.     data = @play_data
  1325.     @play_data = []
  1326.     return data
  1327.   end
  1328.   #--------------------------------------------------------------------------
  1329.   # ● ショートカットコマンド
  1330.   #--------------------------------------------------------------------------
  1331.   def anime(anime_id, wait = true)
  1332.     @action_data = ["anime",anime_id,1,false,wait,false,true,false]
  1333.   end
  1334.   def anime_me(anime_id, wait = true)
  1335.     @action_data = ["anime",anime_id,0,false,wait,false,true,false]
  1336.   end
  1337.   def se(file, pitch = 100)
  1338.     @action_data = ["sound",  "se", pitch, 100, file]
  1339.   end
  1340.   def target(act)
  1341.     for target in @target_battler do target.sv.force_action = act end
  1342.   end
  1343.   def target2(act)
  1344.     for target in @second_targets do target.sv.force_action = act end
  1345.   end
  1346.   def delay(time)
  1347.     @wait = @battler.index * time
  1348.   end
  1349.   #--------------------------------------------------------------------------
  1350.   # ● バトラーのIDを取得
  1351.   #--------------------------------------------------------------------------
  1352.   def id
  1353.     return @battler.id if @battler.actor?
  1354.     return [email protected]
  1355.   end
  1356.   #--------------------------------------------------------------------------
  1357.   # ● 被クリティカルフラグを取得
  1358.   #--------------------------------------------------------------------------
  1359.   def critical?
  1360.     return @battler.result.critical
  1361.   end
  1362.   #--------------------------------------------------------------------------
  1363.   # ● 被回復フラグを取得
  1364.   #--------------------------------------------------------------------------
  1365.   def recovery?
  1366.     recovery = false
  1367.     recovery = true if @battler.result.hp_damage < 0
  1368.     recovery = true if @battler.result.mp_damage < 0
  1369.     recovery = true if @battler.result.tp_damage < 0
  1370.     return recovery
  1371.   end
  1372.   #--------------------------------------------------------------------------
  1373.   # ● 被スキルIDを取得
  1374.   #--------------------------------------------------------------------------
  1375.   def damage_skill_id
  1376.     return @damage_skill_id
  1377.   end
  1378.   #--------------------------------------------------------------------------
  1379.   # ● 被アイテムIDを取得
  1380.   #--------------------------------------------------------------------------
  1381.   def damage_item_id
  1382.     return @damage_item_id
  1383.   end
  1384.   #--------------------------------------------------------------------------
  1385.   # ● 装備武器を取得
  1386.   #--------------------------------------------------------------------------
  1387.   def weapon_id
  1388.     return 0 if [email protected][0]
  1389.     return @battler.weapons[0].id
  1390.   end
  1391.   #--------------------------------------------------------------------------
  1392.   # ● 装備武器のタイプを取得
  1393.   #--------------------------------------------------------------------------
  1394.   def weapon_type
  1395.     return 0 if [email protected][0]
  1396.     return @battler.weapons[0].wtype_id
  1397.   end
  1398.   #--------------------------------------------------------------------------
  1399.   # ● 盾を装備しているか
  1400.   #--------------------------------------------------------------------------
  1401.   def shield?
  1402.     for armor in @battler.armors do return true if armor != nil && armor.etype_id == 1 end
  1403.     return false
  1404.   end
  1405.   #--------------------------------------------------------------------------
  1406.   # ● ダメージがあるか
  1407.   #--------------------------------------------------------------------------
  1408.   def damage_zero?
  1409.     return @battler.result.hp_damage == 0 && @battler.result.mp_damage == 0 && @battler.result.tp_damage == 0
  1410.   end
  1411.   #--------------------------------------------------------------------------
  1412.   # ● スキルIDを取得
  1413.   #--------------------------------------------------------------------------
  1414.   def skill_id
  1415.     return @counter_id if @counter_id != 0
  1416.     return 0 if @battler.current_action == nil or @battler.current_action.item == nil
  1417.     return 0 if @battler.current_action.item.is_a?(RPG::Item)
  1418.     return @battler.current_action.item.id
  1419.   end
  1420.   #--------------------------------------------------------------------------
  1421.   # ● スキルのタイプを取得
  1422.   #--------------------------------------------------------------------------
  1423.   def skill_type
  1424.     return 0 if skill_id == 0
  1425.     return $data_skills[skill_id].stype_id
  1426.   end
  1427.   #--------------------------------------------------------------------------
  1428.   # ● スキル名を取得
  1429.   #--------------------------------------------------------------------------
  1430.   def skill_name
  1431.     return "" if skill_id == 0
  1432.     return $data_skills[skill_id].name
  1433.   end
  1434.   #--------------------------------------------------------------------------
  1435.   # ● アイテムIDを取得
  1436.   #--------------------------------------------------------------------------
  1437.   def item_id
  1438.     return 0 if @battler.current_action == nil or @battler.current_action.item == nil
  1439.     return @battler.current_action.item.id
  1440.   end
  1441.   #--------------------------------------------------------------------------
  1442.   # ● 攻撃アクション
  1443.   #--------------------------------------------------------------------------
  1444.   def attack_action(item)
  1445.     return skill_action if item.is_a?(RPG::Skill)
  1446.     return item_action
  1447.   end
  1448.   #--------------------------------------------------------------------------
  1449.   # ● ダメージアクションベース
  1450.   #--------------------------------------------------------------------------
  1451.   def damage_action_base(item)
  1452.     @damage_skill_id = 0
  1453.     @damage_item_id = 0
  1454.     @damage_skill_id = item.id if item.is_a?(RPG::Skill)
  1455.     @damage_item_id = item.id if item.is_a?(RPG::Item)
  1456.   end  
  1457.   #--------------------------------------------------------------------------
  1458.   # ● ダメージアクション
  1459.   #--------------------------------------------------------------------------
  1460.   def damage_action(attacker, item)
  1461.     damage_action_base(item)
  1462.     act = damage(attacker)
  1463.     return if @active
  1464.     start_action(act) if act != nil
  1465.   end
  1466.   #--------------------------------------------------------------------------
  1467.   # ● 回避アクション
  1468.   #--------------------------------------------------------------------------
  1469.   def evasion_action(attacker, item)
  1470.     damage_action_base(item)
  1471.     act = evasion(attacker)
  1472.     return if @active
  1473.     start_action(act) if act != nil
  1474.   end
  1475.   #--------------------------------------------------------------------------
  1476.   # ● ミスアクション
  1477.   #--------------------------------------------------------------------------
  1478.   def miss_action(attacker, item)
  1479.     damage_action_base(item)
  1480.     act = miss(attacker)
  1481.     return if @active
  1482.     start_action(act) if act != nil
  1483.   end
  1484.   #--------------------------------------------------------------------------
  1485.   # ● 閃きスクリプト併用処理
  1486.   #--------------------------------------------------------------------------
  1487.   def flash_action
  1488.     return "閃き"
  1489.   end
  1490.   
  1491. end


  1492. #==============================================================================
  1493. # ■ module N03
  1494. #------------------------------------------------------------------------------
  1495. #  サイドビューバトルのモジュールです。
  1496. #==============================================================================
  1497. module N03
  1498.   #--------------------------------------------------------------------------
  1499.   # ● バトラーの敵グループを取得
  1500.   #--------------------------------------------------------------------------
  1501.   def self.get_enemy_unit(battler)
  1502.     return $game_troop if battler.actor?
  1503.     return $game_party
  1504.   end
  1505.   #--------------------------------------------------------------------------
  1506.   # ● バトラーの味方グループを取得
  1507.   #--------------------------------------------------------------------------
  1508.   def self.get_party_unit(battler)
  1509.     return $game_party if battler.actor?
  1510.     return $game_troop
  1511.   end
  1512.   #--------------------------------------------------------------------------
  1513.   # ● 戦闘アニメ時間の取得
  1514.   #--------------------------------------------------------------------------
  1515.   def self.get_anime_time(anime_id)
  1516.     return 0 if anime_id <= 0
  1517.     return $data_animations[anime_id].frame_max * 4
  1518.   end
  1519.   #--------------------------------------------------------------------------
  1520.   # ● 攻撃アニメの取得
  1521.   #--------------------------------------------------------------------------
  1522.   def self.get_attack_anime_id(kind, battler)
  1523.     return $data_skills[battler.sv.counter_id].animation_id if kind == -3 && battler.sv.counter_id != 0
  1524.     case kind
  1525.     when -1 ; anime_id = battler.atk_animation_id1
  1526.     when -2 ; anime_id = battler.atk_animation_id2
  1527.     when -3
  1528.       if battler.current_action != nil
  1529.         anime_id = battler.current_action.item.animation_id if battler.current_action.item != nil
  1530.       end
  1531.     else    ; anime_id = kind
  1532.     end
  1533.     case anime_id
  1534.     when -1 ; anime_id = battler.atk_animation_id1
  1535.     when -2 ; anime_id = battler.atk_animation_id2
  1536.     end
  1537.     return anime_id if anime_id
  1538.     return 0
  1539.   end  
  1540.   #--------------------------------------------------------------------------
  1541.   # ● 戦闘アニメデータをセット
  1542.   #--------------------------------------------------------------------------
  1543.   def self.set_damage_anime_data(targets, target, data)
  1544.     return if !first_of_all_screen_anime(data[0], target, targets)
  1545.     target.animation_id         = data[0]
  1546.     target.animation_mirror     = data[1]
  1547.     target.sv.anime_no_mirror   = data[2]
  1548.     target.sv.anime_camera_zoom = data[3]
  1549.     target.sv.anime_plus_z      = data[4]
  1550.   end   
  1551.   #--------------------------------------------------------------------------
  1552.   # ● ターゲットの取得
  1553.   #--------------------------------------------------------------------------
  1554.   def self.get_targets(kind, battler)
  1555.     case kind.abs
  1556.     when 0 ; return [battler].dup
  1557.     when 1 ; return battler.sv.target_battler.dup
  1558.     when 2 ; return get_enemy_unit(battler).members.dup
  1559.     when 3 ; return get_party_unit(battler).members.dup
  1560.     when 4 ; return $game_troop.members.dup + $game_party.battle_members.dup
  1561.     when 5 ; return battler.sv.second_targets.dup
  1562.     end
  1563.   end  
  1564.   #--------------------------------------------------------------------------
  1565.   # ● ターゲットの座標を取得
  1566.   #--------------------------------------------------------------------------
  1567.   def self.get_targets_position(targets, horming, m_a = nil)
  1568.     return [0,0,0] if targets == nil && !$sv_camera.mirror
  1569.     return [Graphics.width,0,0] if targets == nil && $sv_camera.mirror
  1570.     x = y = h = 0
  1571.     for i in 0...targets.size
  1572.       x += targets[i].sv.base_x if !horming
  1573.       y += targets[i].sv.base_y if !horming
  1574.       h += targets[i].sv.base_h if !horming
  1575.       x += targets[i].sv.x if horming
  1576.       y += targets[i].sv.y if horming
  1577.       h += targets[i].sv.h if horming
  1578.       y -= targets[i].sv.ch * 100 if m_a == 0
  1579.       y -= targets[i].sv.ch * 50 if m_a == 1
  1580.     end
  1581.     return [x / targets.size, y / targets.size, h / targets.size]
  1582.   end
  1583.   #--------------------------------------------------------------------------
  1584.   # ● 速度を時間に変換
  1585.   #--------------------------------------------------------------------------
  1586.   def self.distanse_calculation(time, target_position, self_position, distanse_move)
  1587.     return time if !distanse_move
  1588.     distanse_x = self_position[0] - target_position[0]
  1589.     distanse_x = target_position[0] - self_position[0] if target_position[0] > self_position[0]
  1590.     distanse_y = self_position[1] - target_position[1]
  1591.     distanse_y = target_position[1] - self_position[1] if target_position[1] > self_position[1]
  1592.     if self_position[2] != nil && target_position[2] != nil
  1593.       distanse_h = self_position[2] - target_position[2]
  1594.       distanse_h = target_position[2] - self_position[2] if target_position[2] > self_position[2]
  1595.     else
  1596.       distanse_h = 0
  1597.     end
  1598.     distanse = [distanse_x, distanse_y, distanse_h].max
  1599.     return distanse / (time * 100) + 1
  1600.   end
  1601.   #--------------------------------------------------------------------------
  1602.   # ● 放物線移動計算
  1603.   #--------------------------------------------------------------------------
  1604.   def self.parabola(data, time, size, type = 1)
  1605.     move_data = data
  1606.     move_data[0] *= size
  1607.     move_data[1] *= size
  1608.     move = []
  1609.     move_d = []
  1610.     for i in 0...time / 2
  1611.       move[i] = move_data[0]
  1612.       move_d[i] = move_data[1]
  1613.       move_data[0] = move_data[0] * type / (1 + type)
  1614.       move_data[1] = move_data[1] * type / (1 + type)
  1615.     end
  1616.     move = move + move_d.reverse!
  1617.     move.reverse!
  1618.     adjust = move.inject(0) {|result, item| result + item }
  1619.     move[move.size - 1] += adjust if data[0] == data[1] && adjust != 0
  1620.     move.unshift(0) if time % 2 != 0
  1621.     return move
  1622.   end
  1623.   #--------------------------------------------------------------------------
  1624.   # ● 反転値
  1625.   #--------------------------------------------------------------------------
  1626.   def self.mirror_num(mirror)
  1627.     return 1 if !mirror
  1628.     return -1
  1629.   end  
  1630.   #--------------------------------------------------------------------------
  1631.   # ● カメラワーク
  1632.   #--------------------------------------------------------------------------
  1633.   def self.camera(battler, data)
  1634.     battler = $game_party.battle_members[0] if !battler
  1635.     cx = data[2][0] * 100
  1636.     cy = data[2][1] * 100
  1637.     return $sv_camera.move(cx, cy, data[3], data[4], true) if data[1] == 6
  1638.     targets = self.get_targets(data[1], battler)
  1639.     return if targets == nil or targets == []
  1640.     position = self.get_targets_position(targets, true)
  1641.     $sv_camera.move(position[0], position[1] - position[2], data[3], data[4], false)
  1642.   end
  1643.   #--------------------------------------------------------------------------
  1644.   # ● コラプス禁止
  1645.   #--------------------------------------------------------------------------
  1646.   def self.immortaling
  1647.     # 全員に不死身付与
  1648.     for member in $game_party.battle_members + $game_troop.members
  1649.       # イベント操作等で不死身設定になっていたら解除を無効にするフラグを立てる
  1650.       member.sv.immortal = true if member.state?(N03::IMMORTAL_ID)
  1651.       member.add_state(N03::IMMORTAL_ID)
  1652.     end
  1653.     return true
  1654.   end  
  1655.   #--------------------------------------------------------------------------
  1656.   # ● コラプス許可
  1657.   #--------------------------------------------------------------------------
  1658.   def self.unimmortaling
  1659.     # 全員の不死身化解除(イベント等で不死身設定がされていれば除く)
  1660.     for member in $game_party.battle_members + $game_troop.members
  1661.       next if member.dead?
  1662.       # 不死身ステートが行動中に解除されていた場合、解除無効を解除
  1663.       member.sv.immortal = false if !member.state?(N03::IMMORTAL_ID) && member.sv.immortal
  1664.       next member.sv.immortal = false if member.sv.immortal
  1665.       member.remove_state(N03::IMMORTAL_ID)
  1666.       next if member.hp != 0
  1667.       member.add_state(1)
  1668.       member.perform_collapse_effect
  1669.       member.sv.action_terminate
  1670.     end
  1671.     return false
  1672.   end  
  1673.   #--------------------------------------------------------------------------
  1674.   # ● スキル派生
  1675.   #--------------------------------------------------------------------------
  1676.   def self.derived_skill(battler)
  1677.     battler.force_action(battler.sv.derivation_skill_id, -2)
  1678.     BattleManager.unshift_action_battlers(battler)
  1679.   end
  1680.   #--------------------------------------------------------------------------
  1681.   # ● ダメージの作成
  1682.   #--------------------------------------------------------------------------
  1683.   def self.set_damage(battler, hp_damage, mp_damage)
  1684.     battler.result.hp_damage = hp_damage
  1685.     battler.result.mp_damage = mp_damage
  1686.   end
  1687.   #--------------------------------------------------------------------------
  1688.   # ● ターゲット生死確認
  1689.   #--------------------------------------------------------------------------
  1690.   def self.targets_alive?(targets)
  1691.     return false if targets == []
  1692.     for target in targets do return true if !target.dead? end
  1693.     return false
  1694.   end
  1695.   #--------------------------------------------------------------------------
  1696.   # ● ターゲットをセカンドターゲットへ
  1697.   #--------------------------------------------------------------------------
  1698.   def self.s_targets(battler)
  1699.     battler.sv.target_battler = battler.sv.second_targets
  1700.     return battler.sv.second_targets
  1701.   end  
  1702.   #--------------------------------------------------------------------------
  1703.   # ● セカンドターゲットをターゲットへ
  1704.   #--------------------------------------------------------------------------
  1705.   def self.targets_set(battler)
  1706.     battler.sv.second_targets = battler.current_action.make_targets.compact
  1707.     battler.sv.target_battler = battler.sv.second_targets
  1708.   end  
  1709.   #--------------------------------------------------------------------------
  1710.   # ● 戦闘アニメ実行判定 (対象:画面時は最初のターゲットのみアニメ実行)
  1711.   #--------------------------------------------------------------------------
  1712.   def self.first_of_all_screen_anime(anime_id, target, targets)
  1713.     anime = $data_animations[anime_id]
  1714.     return false if !anime
  1715.     return true if anime.position != 3
  1716.     return false if anime.position == 3 && target != targets[0]
  1717.     targets.delete(target)
  1718.     target.sv.timing_targets = targets
  1719.     return true
  1720.   end
  1721.   #--------------------------------------------------------------------------
  1722.   # ● 戦闘不能付加攻撃か
  1723.   #--------------------------------------------------------------------------
  1724.   def self.dead_attack?(battler, item)
  1725.     for state in battler.atk_states
  1726.       return true if state == battler.death_state_id
  1727.     end
  1728.     for effect in item.effects
  1729.       return true if effect.code == 21 && effect.data_id == battler.death_state_id
  1730.     end
  1731.     return false
  1732.   end
  1733. end

  1734. #==============================================================================
  1735. # ■ Sprite_Weapon
  1736. #------------------------------------------------------------------------------
  1737. #  ウエポン表示用のスプライトです。
  1738. #==============================================================================
  1739. class Sprite_Weapon < Sprite_Base
  1740.   #--------------------------------------------------------------------------
  1741.   # ● 公開インスタンス変数 
  1742.   #--------------------------------------------------------------------------
  1743.   attr_reader   :index                       # ウエポン画像配列のインデックス
  1744.   attr_reader   :battler                     # 画像が参照しているバトラー
  1745.   attr_reader   :move_time                   # 画像が目標に到達するまでの時間
  1746.   attr_reader   :through                     # 貫通フラグ
  1747.   attr_reader   :action_end                  # 武器アクション終了フラグ
  1748.   attr_reader   :action_end_cancel                  # 武器アクション終了フラグ
  1749.   attr_reader   :hit_position                # 画像が目標に到達した時の座標
  1750.   attr_accessor :hit_anime_id                # 画像が目標に到達した時のアニメID
  1751.   #--------------------------------------------------------------------------
  1752.   # ● オブジェクト初期化
  1753.   #--------------------------------------------------------------------------
  1754.   def initialize(viewport, index, battler)
  1755.     super(viewport)
  1756.     @index = index
  1757.     @battler = battler
  1758.     @position_x = @position_y = 0
  1759.     @o = 0
  1760.     @real_x = @real_y = 0
  1761.     @mirror = @battler.sv.mirror
  1762.     reset
  1763.     set_action
  1764.   end
  1765.   #--------------------------------------------------------------------------
  1766.   # ● 初期化
  1767.   #--------------------------------------------------------------------------
  1768.   def reset
  1769.     @z_plus = 0
  1770.     @weapon_data = []
  1771.     @move_data = []
  1772.     @move_x = 0
  1773.     @move_y = 0
  1774.     @orbit = []
  1775.     @through = false
  1776.     @distanse_move = false
  1777.     @weapon_width = 0
  1778.     @weapon_height = 0
  1779.     @anime_time = 0
  1780.     @anime_position = 1
  1781.     @move_time = 0
  1782.     @hit_anime_id = 0
  1783.     @move_anime = true
  1784.     @action_end = false
  1785.     @action_end_cancel = false
  1786.     reset_position
  1787.   end  
  1788.   #--------------------------------------------------------------------------
  1789.   # ● アクションをセット
  1790.   #--------------------------------------------------------------------------
  1791.   def set_action
  1792.     return if @battler.sv.effect_data == []
  1793.     weapon_anime if @battler.sv.effect_data[0][0] == "wp"
  1794.     move_anime if @battler.sv.effect_data[0][0] == "m_a"
  1795.     @battler.sv.effect_data.shift
  1796.   end
  1797.   #--------------------------------------------------------------------------
  1798.   # ● 武器アニメ実行
  1799.   #--------------------------------------------------------------------------
  1800.   def weapon_anime
  1801.     @weapon_data = @battler.sv.effect_data[0].dup
  1802.     set_graphics
  1803.     set_ox
  1804.     set_weapon_move
  1805.   end
  1806.   #--------------------------------------------------------------------------
  1807.   # ● アニメ移動実行
  1808.   #--------------------------------------------------------------------------
  1809.   def move_anime
  1810.     @move_data = @battler.sv.effect_data[0].dup
  1811.     # ターゲットを取得
  1812.     @target_battler = [@battler.sv.m_a_targets.shift]
  1813.     @target_battler = N03.get_targets(@move_data[3], @battler) if @move_data[3] < 0
  1814.     set_move
  1815.     return if @move_data[16] == ""
  1816.     weapon_data = N03::ACTION[@move_data[16]]
  1817.     return if weapon_data == nil
  1818.     @weapon_data = weapon_data.dup
  1819.     set_graphics
  1820.     set_ox
  1821.     set_weapon_move
  1822.   end
  1823.   #--------------------------------------------------------------------------
  1824.   # ● 武器画像を取得
  1825.   #--------------------------------------------------------------------------  
  1826.   def set_graphics
  1827.     # 武器に依存しない画像設定がある場合
  1828.     if @weapon_data[13] != ""
  1829.       self.bitmap = Cache.character(@weapon_data[13]).dup
  1830.       @weapon_width = self.bitmap.width
  1831.       @weapon_height = self.bitmap.height
  1832.       return
  1833.     end
  1834.     # 武器を取得
  1835.     weapon = @battler.weapons[0]
  1836.     # 逆手装備を取得
  1837.     if @weapon_data[10]
  1838.       weapon = nil
  1839.       for armor in @battler.armors do break weapon = armor if armor.is_a?(RPG::Armor) && armor.etype_id == 1 end
  1840.       weapon = @battler.weapons[1] if !weapon
  1841.     end  
  1842.     # 武器がなければ処理をキャンセル
  1843.     return if weapon == nil
  1844.     # インデックスを取得
  1845.     file_index = @weapon_data[12]
  1846.     # アイコンを利用するなら
  1847.     if @weapon_data[1] == 0
  1848.       icon_index = weapon.icon_index
  1849.       self.bitmap = Cache.system("Iconset" + file_index).dup
  1850.       self.src_rect.set(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  1851.       @weapon_width = @weapon_height = 24
  1852.     # 独自画像指定
  1853.     else
  1854.       file_name = @battler.sv.weapon_graphic(weapon.id, weapon.wtype_id) if weapon.is_a?(RPG::Weapon)
  1855.       file_name = @battler.sv.shield_graphic(weapon.id, weapon.atype_id) if weapon.is_a?(RPG::Armor)
  1856.       self.bitmap = Cache.character(file_name + file_index).dup
  1857.       @weapon_width = self.bitmap.width
  1858.       @weapon_height = self.bitmap.height
  1859.       return if @weapon_data[1] == 1
  1860.       # 2003仕様の武器アニメ
  1861.       @weapon_width /= @battler.sv.max_pattern[0]
  1862.     end
  1863.   end
  1864.   #--------------------------------------------------------------------------
  1865.   # ● 画像の原点を取得
  1866.   #--------------------------------------------------------------------------  
  1867.   def set_ox
  1868.     # 反転時は設定を逆に
  1869.     if @mirror
  1870.       case @weapon_data[6]
  1871.       when 1 ; @weapon_data[6] = 2 # 左上→右上に
  1872.       when 2 ; @weapon_data[6] = 1 # 右上→左上に
  1873.       when 3 ; @weapon_data[6] = 4 # 左下→右下に
  1874.       when 4 ; @weapon_data[6] = 3 # 右下→左下に
  1875.       end
  1876.     end
  1877.     # 原点を設定
  1878.     case @weapon_data[6]
  1879.     when 0 # 中心
  1880.       self.ox = @weapon_width / 2
  1881.       self.oy = @weapon_height / 2
  1882.     when 1 # 左上
  1883.       self.ox = 0
  1884.       self.oy = 0
  1885.     when 2 # 右上
  1886.       self.ox = @weapon_width
  1887.       self.oy = 0
  1888.     when 3 # 左下
  1889.       self.ox = 0
  1890.       self.oy = @weapon_height
  1891.     when 4 # 右下
  1892.       self.ox = @weapon_width
  1893.       self.oy = @weapon_height
  1894.     when 5 # バトラーと同じ
  1895.       self.ox = @weapon_width / 2
  1896.       self.oy = @weapon_height
  1897.     end
  1898.   end  
  1899.   #--------------------------------------------------------------------------
  1900.   # ● バトラーの座標を取得
  1901.   #--------------------------------------------------------------------------  
  1902.   def set_battler_position
  1903.     @position_x = @battler.sv.x + @weapon_data[3][0] * N03.mirror_num(@mirror) * 100
  1904.     @position_y = (@battler.sv.y - @battler.sv.h - @battler.sv.j - @battler.sv.c - @battler.sv.oy_adjust) + @weapon_data[3][1] * 100
  1905.     reset_position
  1906.   end
  1907.   #--------------------------------------------------------------------------
  1908.   # ● 座標を初期化
  1909.   #--------------------------------------------------------------------------  
  1910.   def reset_position
  1911.     @real_x = @position_x / 100
  1912.     @real_y = @position_y / 100
  1913.     @real_zoom_x = 1
  1914.     @real_zoom_y = 1
  1915.   end
  1916.   #--------------------------------------------------------------------------
  1917.   # ● 戦闘アニメを表示
  1918.   #--------------------------------------------------------------------------  
  1919.   def set_animation(anime_id)
  1920.     return if $data_animations[anime_id] == nil
  1921.     @anime_position = $data_animations[anime_id].position
  1922.     @horming = true
  1923.     @horming = false if @anime_position == 3
  1924.     @anime_camera_zoom = true
  1925.     @anime_no_mirror = false
  1926.     start_animation($data_animations[anime_id], @mirror)
  1927.     timings = $data_animations[anime_id].timings
  1928.   end
  1929.   #--------------------------------------------------------------------------
  1930.   # ● ヒット時の戦闘アニメ実行
  1931.   #--------------------------------------------------------------------------  
  1932.   def set_hit_animation(position_data, hit_anime_id, target)
  1933.     return if $data_animations[hit_anime_id] == nil
  1934.     @real_x = position_data[0]
  1935.     @real_y = position_data[1]
  1936.     @position_x = position_data[0] * 100
  1937.     @position_y = position_data[1] * 100
  1938.     self.z = position_data[2]
  1939.     @z_plus = 1000
  1940.     @action_end = false
  1941.     @horming = true
  1942.     set_animation(hit_anime_id)
  1943.     @anime_time = $data_animations[hit_anime_id].frame_max * 4
  1944.     @timing_targets = [target]
  1945.     @move_time = @hit_anime_id = 0
  1946.     @weapon_data = []
  1947.   end
  1948.   #--------------------------------------------------------------------------
  1949.   # ● タイミングバトラー追加
  1950.   #--------------------------------------------------------------------------  
  1951.   def timing_battler_set(target)
  1952.     @timing_targets.push(target)
  1953.   end
  1954.   #--------------------------------------------------------------------------
  1955.   # ● 武器の動きを取得
  1956.   #--------------------------------------------------------------------------  
  1957.   def set_weapon_move
  1958.     # 開始位置を取得
  1959.     set_battler_position if @move_time == 0
  1960.     @z_plus = 50 if @z_plus == 0 && @weapon_data[9]
  1961.     self.z = @battler.sv.z + @z_plus
  1962.     # 反転処理
  1963.     @mirror = !@mirror if @weapon_data[7]
  1964.     self.mirror = @mirror
  1965.     # 更新パターンをセット
  1966.     set_pattern
  1967.     @max_pattern = 2 if @max_pattern == 1
  1968.     # 動きを計算
  1969.     @weapon_move_data = []
  1970.     @weapon_angle_data = []
  1971.     @weapon_zoom_data = []
  1972.     num = N03.mirror_num(@mirror)
  1973.     for i in 0...@max_pattern
  1974.       move_data_x = @weapon_data[2][0] * num * 100 * i / (@max_pattern - 1)
  1975.       move_data_y = @weapon_data[2][1] * 100 * i / (@max_pattern - 1)
  1976.       move_angle = @weapon_data[4] * num + (@weapon_data[5] * num - @weapon_data[4] * num) * i / (@max_pattern - 1)
  1977.       move_zoom_x = 1 + (@weapon_data[8][0] - 1) * i / (@max_pattern - 1)
  1978.       move_zoom_y = 1 + (@weapon_data[8][1] - 1) * i / (@max_pattern - 1)
  1979.       @weapon_move_data.push([move_data_x, move_data_y])
  1980.       @weapon_angle_data.push(move_angle)
  1981.       @weapon_zoom_data.push([move_zoom_x, move_zoom_y])
  1982.     end
  1983.   end  
  1984.   #--------------------------------------------------------------------------
  1985.   # ● 更新パターン
  1986.   #--------------------------------------------------------------------------
  1987.   def set_pattern
  1988.     if @weapon_data[11] == -1
  1989.       return @max_pattern = @battler.sv.max_pattern[0] if @battler.sv.pattern_type != 0
  1990.       @count = @battler.sv.pattern_time
  1991.       @max_count = @battler.sv.pattern_time
  1992.       @max_pattern = @battler.sv.max_pattern[0]
  1993.       @repeat = false
  1994.     else
  1995.       @count = @weapon_data[11][0]
  1996.       @max_count = @weapon_data[11][0]
  1997.       @max_pattern = @weapon_data[11][1]
  1998.       @repeat = @weapon_data[11][2]
  1999.     end
  2000.     @pattern = 0
  2001.   end
  2002.   #--------------------------------------------------------------------------
  2003.   # ● 移動実行
  2004.   #--------------------------------------------------------------------------
  2005.   def set_move
  2006.     # 戦闘アニメを取得
  2007.     set_animation(@move_data[1][0]) if $data_animations[@move_data[1][0]] != nil && $data_animations[@move_data[1][0]].position != 3
  2008.     @anime_camera_zoom = @move_data[13]
  2009.     @loop = @move_data[14]
  2010.     @loop = false if @move_data[1][0] == 0
  2011.     @anime_no_mirror = @move_data[15]
  2012.     @se_flag = @move_data[17]
  2013.     # 開始位置を取得
  2014.     start_position
  2015.     @z_plus = 1000 if @move_data[9]
  2016.     # ターゲットバトラー画像にこのアニメのSEとタイミング設定を反映させる
  2017.     @timing_targets = @target_battler
  2018.     # 座標計算
  2019.     @move_x = @move_data[5][0] * 100 * N03.mirror_num(@mirror)
  2020.     @move_y = @move_data[5][1] * 100
  2021.     # 時間計算か速度計算か
  2022.     @distanse_move = true if @move_data[6] > 0
  2023.     @move_time = @move_data[6].abs
  2024.     # 時間0の場合、アニメが設定されていればアニメ表示時間に合わせる
  2025.     if @move_time == 0
  2026.       @move_time = $data_animations[@move_data[1][0]].frame_max * 4 if $data_animations[@move_data[1][0]]
  2027.       @move_time = 1 if !$data_animations[@move_data[1][0]]
  2028.       @distanse_move = false
  2029.     end
  2030.     # 貫通タイプの場合
  2031.     @through = true if @move_data[7] == 1
  2032.     @auto_through_flag = false
  2033.     @auto_through_flag = true if @move_data[7] == 0
  2034.     # ターゲット座標計算
  2035.     if @target_battler == nil
  2036.       @target_x = @move_x * 100
  2037.       @target_x = (Graphics.width - @move_x) * 100 if @mirror
  2038.       @target_y = @move_y * 100
  2039.     else
  2040.       move_data_set
  2041.     end
  2042.     # ターゲットに到達するまでの時間を計算
  2043.     @move_time = distanse_calculation(@move_time, @target_x, @target_y)
  2044.     # 円軌道計算
  2045.     orbit
  2046.     # バトラーのウエイト設定
  2047.     @battler.sv.wait = @move_time - 1 if @move_data[10][0]
  2048.     @move_horming = @move_data[12]
  2049.   end  
  2050.   #--------------------------------------------------------------------------
  2051.   # ● 速度を時間に変換
  2052.   #--------------------------------------------------------------------------
  2053.   def distanse_calculation(time, target_x, target_y)
  2054.     return time if !@distanse_move
  2055.     distanse_x = @position_x - @target_x
  2056.     distanse_x = @target_x - @position_x if @target_x > @position_x
  2057.     distanse_y = @position_y - @target_y
  2058.     distanse_y = @target_y - @position_y if @target_y > @position_y
  2059.     distanse = [distanse_x, distanse_y].max
  2060.     return distanse / (time * 100) + 1
  2061.   end
  2062.   #--------------------------------------------------------------------------
  2063.   # ● 移動目標の更新
  2064.   #--------------------------------------------------------------------------
  2065.   def move_data_set
  2066.     return if @target_battler == nil
  2067.     position = N03.get_targets_position(@target_battler, true, @anime_position)
  2068.     @target_x = position[0] + @move_x
  2069.     @target_y = position[1] - position[2] + @move_y
  2070.   end
  2071.   #--------------------------------------------------------------------------
  2072.   # ● 開始位置を計算
  2073.   #--------------------------------------------------------------------------
  2074.   def start_position
  2075.     starter = [@battler.sv.m_a_starter.shift]
  2076.     starter = N03.get_targets(@move_data[2], @battler) if @move_data[2] < 0
  2077.     position = [0, 0]
  2078.     position = N03.get_targets_position(starter, true, @anime_position) if starter != nil
  2079.     @position_x = position[0] + @move_data[4][0] * 100
  2080.     @position_y = position[1] + position[2] + @move_data[4][1] * 100
  2081.     @position_z = @position_y
  2082.   end  
  2083.   #--------------------------------------------------------------------------
  2084.   # ● 円軌道計算
  2085.   #--------------------------------------------------------------------------
  2086.   def orbit
  2087.     orbit_data = @move_data[8].dup
  2088.     orbit_data[0] *= 100
  2089.     orbit_data[1] *= 100
  2090.     orbit_d = []
  2091.     for i in 0...@move_time / 2
  2092.       @orbit[i] = orbit_data[0]
  2093.       orbit_data[0] /= 2
  2094.       orbit_d[i] = orbit_data[1]
  2095.       orbit_data[1] /= 2
  2096.     end
  2097.     @orbit = @orbit + orbit_d.reverse!
  2098.     @orbit.reverse!
  2099.   end  
  2100.   #--------------------------------------------------------------------------
  2101.   # ● フレーム更新
  2102.   #--------------------------------------------------------------------------
  2103.   def update
  2104.     update_hit_anime if @anime_time != 0
  2105.     update_move if @move_time != 0
  2106.     update_weapon_move if @weapon_data != []
  2107.     update_position
  2108.     update_color
  2109.     self.visible = @battler.sv.weapon_visible
  2110.     super
  2111.   end
  2112.   #--------------------------------------------------------------------------
  2113.   # ● ヒット時の戦闘アニメ
  2114.   #--------------------------------------------------------------------------
  2115.   def update_hit_anime
  2116.     @anime_time -= 1
  2117.     @action_end = true if @anime_time == 0
  2118.   end
  2119.   #--------------------------------------------------------------------------
  2120.   # ● 移動の更新
  2121.   #--------------------------------------------------------------------------
  2122.   def update_move
  2123.     move_data_set if @move_horming && !@hit_position
  2124.     through_set(@move_time, @target_x, @target_y) if @move_time == 1 && !@hit_position
  2125.     @o += @orbit[@move_time - 1] if @orbit[@move_time - 1] != nil
  2126.     @position_x = (@position_x * (@move_time - 1) + @target_x) / @move_time
  2127.     @position_y = (@position_y * (@move_time - 1) + @target_y) / @move_time + @o
  2128.     reset_position
  2129.     set_animation(@move_data[1][0]) if @loop && !animation?
  2130.     @move_time -= 1
  2131.     return if @move_time != 0
  2132.     @action_end = true if !@action_end_cancel
  2133.   end
  2134.   #--------------------------------------------------------------------------
  2135.   # ● 武器の動きを更新
  2136.   #--------------------------------------------------------------------------
  2137.   def update_weapon_move
  2138.     pattern = update_pattern
  2139.     set_battler_position if @move_time == 0 && !@action_end_cancel
  2140.     @real_x = @position_x / 100 + @weapon_move_data[pattern][0] / 100
  2141.     @real_y = @position_y / 100 + @weapon_move_data[pattern][1] / 100
  2142.     @real_zoom_x = @weapon_zoom_data[pattern][0]
  2143.     @real_zoom_y = @weapon_zoom_data[pattern][1]
  2144.     self.angle = @weapon_angle_data[pattern]
  2145.     self.src_rect.set(@weapon_width * pattern, 0, @weapon_width, @weapon_height) if @weapon_data[1] == 2
  2146.   end
  2147.   #--------------------------------------------------------------------------
  2148.   # ● パターンを更新
  2149.   #--------------------------------------------------------------------------
  2150.   def update_pattern
  2151.     return @battler.sv.pattern_w if @count == nil
  2152.     @count -= 1
  2153.     return @pattern if @count != 0
  2154.     @count = @max_count
  2155.     @pattern += 1
  2156.     if !@repeat && @pattern == @max_pattern
  2157.       @pattern = @max_pattern - 1
  2158.     elsif @pattern == @max_pattern
  2159.       @pattern = 0
  2160.     end
  2161.     return @pattern
  2162.   end
  2163.   #--------------------------------------------------------------------------
  2164.   # ● 座標を更新
  2165.   #--------------------------------------------------------------------------
  2166.   def update_position
  2167.     self.x = (@real_x - $sv_camera.x) * $sv_camera.convert / 1000
  2168.     self.y = (@real_y - $sv_camera.y) * $sv_camera.convert / 1000
  2169.     self.x += $sv_camera.sx / 100 unless @battler.sv.h != 0 && @weapon_data != []
  2170.     self.y += $sv_camera.sy / 100 unless @battler.sv.h != 0 && @weapon_data != []
  2171.     self.z = @battler.sv.z + @z_plus - 10
  2172.     self.zoom_x = @real_zoom_x * $sv_camera.zoom
  2173.     self.zoom_y = @real_zoom_y * $sv_camera.zoom
  2174.     self.opacity = @battler.sv.opacity if @battler.sv.opacity_data[4]
  2175.   end
  2176.   #--------------------------------------------------------------------------
  2177.   # ● 貫通の処理
  2178.   #--------------------------------------------------------------------------
  2179.   def through_set(time, target_x, target_y)
  2180.     @hit_anime_id = N03.get_attack_anime_id(@move_data[1][1], @battler)
  2181.     @battler.sv.wait = N03.get_anime_time(@hit_anime_id) if @move_data[10][1]
  2182.     moving_x = (target_x / 100 - @position_x / 100) / time
  2183.     moving_y = (target_y / 100 - @position_y / 100) / time
  2184.     goal_x = $sv_camera.max_left - 100 if moving_x < 0
  2185.     goal_x = Graphics.width + $sv_camera.max_right + 100 if moving_x > 0
  2186.     goal_y = $sv_camera.max_top - 100 if moving_y < 0
  2187.     goal_y = Graphics.height + $sv_camera.max_bottom + 100 if moving_y > 0
  2188.     if goal_x == nil &&  goal_y == nil
  2189.       time = 0
  2190.       reset_position
  2191.     else
  2192.       time = move_calculation(moving_x, moving_y, goal_x, goal_y)
  2193.     end
  2194.     target_x = @position_x + moving_x * time * 100
  2195.     target_y = @position_y + moving_y * time * 100
  2196.     @pre_data = [time, target_x, target_y]
  2197.     @battler.sv.m_a_data.push([@move_data[11], @target_battler, @index, @auto_through_flag, []])
  2198.     @action_end_cancel = true
  2199.     @hit_position = [@real_x, @real_y, self.z]
  2200.   end  
  2201.   #--------------------------------------------------------------------------
  2202.   # ● 到達時間試算
  2203.   #--------------------------------------------------------------------------
  2204.   def move_calculation(moving_x, moving_y, goal_x, goal_y)
  2205.     move_x = @position_x / 100
  2206.     move_y = @position_y / 100
  2207.     time = 0
  2208.     loop do
  2209.       move_x += moving_x
  2210.       move_y += moving_y
  2211.       time += 1
  2212.       return time if moving_x < 0 && move_x < goal_x
  2213.       return time if moving_x > 0 && move_x > goal_x
  2214.       return time if moving_y < 0 && move_y < goal_y
  2215.       return time if moving_y > 0 && move_y > goal_y
  2216.     end
  2217.   end   
  2218.   #--------------------------------------------------------------------------
  2219.   # ● ミス時に消える処理から貫通処理に変換
  2220.   #--------------------------------------------------------------------------
  2221.   def through_change
  2222.     @action_end_cancel = false
  2223.     @through = true
  2224.     @move_time = @pre_data[0]
  2225.     @target_x = @pre_data[1]
  2226.     @target_y = @pre_data[2]
  2227.     @pre_data = nil
  2228.   end  
  2229.   #--------------------------------------------------------------------------
  2230.   # ● SE とフラッシュのタイミング処理
  2231.   #--------------------------------------------------------------------------
  2232.   def animation_process_timing(timing)
  2233.     return if !@timing_targets
  2234.     se_flag = true
  2235.     se_flag = @se_flag if @se_flag != nil
  2236.     for target in @timing_targets
  2237.       target.sv.timing.push([se_flag, timing.dup])
  2238.       se_flag = false if @animation.position == 3
  2239.     end  
  2240.   end
  2241.   #--------------------------------------------------------------------------
  2242.   # ● 色調の更新
  2243.   #--------------------------------------------------------------------------
  2244.   def update_color
  2245.     return if @battler.sv.color == []
  2246.     self.color.set(@battler.sv.color[0], @battler.sv.color[1], @battler.sv.color[2], @battler.sv.color[3])
  2247.   end
  2248.   #--------------------------------------------------------------------------
  2249.   # ● 解放
  2250.   #--------------------------------------------------------------------------
  2251.   def dispose
  2252.     super
  2253.     self.bitmap.dispose if self.bitmap != nil
  2254.   end
  2255. end

  2256. #==============================================================================
  2257. # ■ Sprite_Battle_Picture
  2258. #------------------------------------------------------------------------------
  2259. #  ピクチャ表示用のスプライトです。
  2260. #==============================================================================
  2261. class Sprite_Battle_Picture < Sprite
  2262.   #--------------------------------------------------------------------------
  2263.   # ● 公開インスタンス変数 
  2264.   #--------------------------------------------------------------------------
  2265.   attr_accessor   :action_end           # 終了フラグ
  2266.   #--------------------------------------------------------------------------
  2267.   # ● オブジェクト初期化
  2268.   #--------------------------------------------------------------------------
  2269.   def initialize(viewport = nil)
  2270.     super(viewport)
  2271.     @action_end = false
  2272.     self.ox = 0
  2273.   end
  2274.   #--------------------------------------------------------------------------
  2275.   # ● セット
  2276.   #--------------------------------------------------------------------------
  2277.   def set(battler)
  2278.     @battler = battler
  2279.     @data = @battler.sv.effect_data.shift
  2280.     @time = @data[4]
  2281.     @mirror = $sv_camera.mirror
  2282.     @mirror = false if !@data[8]
  2283.     self.opacity = @data[6][0]
  2284.     @s_x = @data[2][0] if @data[2] != []
  2285.     @s_x = Graphics.width - @data[2][0]  if @data[2] != [] && @mirror
  2286.     @s_y = @data[2][1] if @data[2] != []
  2287.     @e_x = @data[3][0] if @data[3] != []
  2288.     @e_x = Graphics.width - @data[3][0] if @data[3] != [] && @mirror
  2289.     @e_y = @data[3][1] if @data[3] != []
  2290.     @s_x = self.x if @data[2] == []
  2291.     @s_y = self.y if @data[2] == []
  2292.     @e_x = self.x if @data[3] == []
  2293.     @e_y = self.y if @data[3] == []
  2294.     self.x = @s_x
  2295.     self.y = @s_y
  2296.     return @action_end = true if @time == 0
  2297.     @move_x = (@e_x * 1.0 - @s_x) / @time
  2298.     @move_y = (@e_y * 1.0 - @s_y) / @time
  2299.     self.z = @data[5]
  2300.     return set_plane(battler) if @data[7] != []
  2301.     self.bitmap = Cache.picture(@data[9]) if !bitmap or @data[9] != ""
  2302.     return @action_end = true if !bitmap
  2303.     self.mirror = @mirror
  2304.     self.ox = self.bitmap.width if @mirror
  2305.   end
  2306.   #--------------------------------------------------------------------------
  2307.   # ● プレーン移行
  2308.   #--------------------------------------------------------------------------
  2309.   def set_plane(battler)
  2310.     @viewport = Viewport.new(@data[2][0],@data[2][1],@data[7][0],@data[7][1]) if !@viewport
  2311.     viewport = @viewport
  2312.     @plane = Plane.new(viewport) if !@plane
  2313.     @plane.bitmap = Cache.picture(@data[9]) if [email protected] or @data[9] != ""
  2314.     return @action_end = true if [email protected]
  2315.     @plane.ox = @data[7][0]
  2316.     @plane.oy = @data[7][1]
  2317.     @plane.opacity = @data[6][0]
  2318.     @move_x = @remain_move[0] if @data[2] == @data[3]
  2319.     @move_y = @remain_move[1] if @data[2] == @data[3]
  2320.     @remain_move = [@move_x, @move_y]
  2321.   end
  2322.   #--------------------------------------------------------------------------
  2323.   # ● フレーム更新
  2324.   #--------------------------------------------------------------------------
  2325.   def update
  2326.     @action_end = true if [email protected]
  2327.     return if @time == 0
  2328.     return if @action_end
  2329.     @time -= 1
  2330.     return plane_update if @plane
  2331.     super
  2332.     self.x += @move_x
  2333.     self.y += @move_y
  2334.     self.opacity += @data[6][1]
  2335.     return if @time != 1
  2336.     self.x = @e_x
  2337.     self.y = @e_y
  2338.     @time = 0
  2339.   end
  2340.   #--------------------------------------------------------------------------
  2341.   # ● フレーム更新
  2342.   #--------------------------------------------------------------------------
  2343.   def plane_update
  2344.     @plane.ox += @move_x
  2345.     @plane.oy += @move_y
  2346.     @plane.opacity += @data[6][1]
  2347.     @time = @data[4] if @time == 0
  2348.   end
  2349.   #--------------------------------------------------------------------------
  2350.   # ● 解放
  2351.   #--------------------------------------------------------------------------
  2352.   def dispose
  2353.     bitmap.dispose if bitmap
  2354.     @plane.dispose if @plane
  2355.     @viewport.dispose if @viewport
  2356.     super
  2357.   end
  2358. end

  2359. #==============================================================================
  2360. # ■ Sprite_Back_Picture
  2361. #------------------------------------------------------------------------------
  2362. #  周期ピクチャ用のスプライトです。
  2363. #==============================================================================
  2364. class Sprite_Back_Picture < Plane
  2365.   #--------------------------------------------------------------------------
  2366.   # ● 公開インスタンス変数 
  2367.   #--------------------------------------------------------------------------
  2368.   attr_accessor   :action_end           # 終了フラグ
  2369.   #--------------------------------------------------------------------------
  2370.   # ● オブジェクト初期化
  2371.   #--------------------------------------------------------------------------
  2372.   def initialize(viewport = nil, index)
  2373.     super(viewport)
  2374.     @index = index
  2375.     @real_x = 0
  2376.     @real_y = 0
  2377.     @real_opacity = 0
  2378.     @move_x = 0
  2379.     @move_y = 0
  2380.     @move_opacity = 0
  2381.     @time = 0
  2382.     @switche = 0
  2383.     @action_end = false
  2384.   end
  2385.   #--------------------------------------------------------------------------
  2386.   # ● セットアップ
  2387.   #--------------------------------------------------------------------------
  2388.   def setup(data)
  2389.     self.bitmap = Cache.picture(data[9])
  2390.     self.z = data[6]
  2391.     @switche = data[1]
  2392.     mirror = $sv_camera.mirror
  2393.     mirror = false if !data[8]
  2394.     @move_x = data[3][0]
  2395.     @move_x *= -1 if mirror
  2396.     @move_y = data[3][1]
  2397.     @time = data[4]
  2398.     @time = -1 if @time == 0
  2399.     @real_opacity = (data[5][0] + 1) * 100
  2400.     @move_opacity = data[5][1]
  2401.     @start_opacity = data[5][0]
  2402.     @shake_ok = data[7]
  2403.   end
  2404.   #--------------------------------------------------------------------------
  2405.   # ● フレーム更新
  2406.   #--------------------------------------------------------------------------
  2407.   def update
  2408.     update_picture if @time != 0
  2409.     self.ox = $sv_camera.x - @real_x
  2410.     self.oy = $sv_camera.y - @real_y
  2411.     if @shake_ok
  2412.       self.ox -= $sv_camera.sx / 100
  2413.       self.oy -= $sv_camera.sy / 100
  2414.     end
  2415.     self.ox *= $sv_camera.zoom
  2416.     self.oy *= $sv_camera.zoom
  2417.     self.zoom_x = @zoom_x * $sv_camera.zoom
  2418.     self.zoom_y = @zoom_y * $sv_camera.zoom
  2419.     self.opacity = @real_opacity / 100
  2420.     @move_opacity *= -1 if self.opacity == 255 or self.opacity <= @start_opacity
  2421.     @switche
  2422.     @action_end = true if @switche > 0 && !$game_switches[@switche]
  2423.     @action_end = true if @switche < 0 && !$sv_camera.switches[@switche.abs]
  2424.   end
  2425.   #--------------------------------------------------------------------------
  2426.   # ● ピクチャの更新
  2427.   #--------------------------------------------------------------------------
  2428.   def update_picture
  2429.     @real_x += @move_x / 100
  2430.     @real_y += @move_y / 100
  2431.     @real_x = 0 if @real_x >= self.bitmap.width or @real_x <= -self.bitmap.width
  2432.     @real_y = 0 if @real_y >= self.bitmap.height or @real_y <= -self.bitmap.height
  2433.     @zoom_x = 1
  2434.     @zoom_y = 1
  2435.     @real_opacity += @move_opacity
  2436.     @time -= 1
  2437.     @time = -1 if @time < -100
  2438.   end
  2439. end

  2440. #==============================================================================
  2441. # ■ Sprite_Back_Picture
  2442. #------------------------------------------------------------------------------
  2443. #  ダメージ表示のスプライトです。
  2444. #==============================================================================
  2445. class Sprite_Damage < Sprite
  2446.   #--------------------------------------------------------------------------
  2447.   # ● 公開インスタンス変数 
  2448.   #--------------------------------------------------------------------------
  2449.   attr_reader   :action_end                  # POP終了フラグ
  2450.   #--------------------------------------------------------------------------
  2451.   # ● オブジェクト初期化
  2452.   #--------------------------------------------------------------------------
  2453.   def initialize(viewport = nil, battler)
  2454.     super(viewport)
  2455.     @battler = battler
  2456.     @time = 0
  2457.     return @action_end = true if !@battler
  2458.     @direction = -1
  2459.     @direction *= -1 if @battler.actor?
  2460.     @direction *= -1 if $sv_camera.mirror
  2461.     set_state
  2462.     set_damage
  2463.     update
  2464.   end
  2465.   #--------------------------------------------------------------------------
  2466.   # ● ステート表示
  2467.   #--------------------------------------------------------------------------
  2468.   def set_state
  2469.     return if !N03::STATE_POP
  2470.     states = @battler.result.added_state_objects
  2471.     states.delete($data_states[@battler.death_state_id]) if @battler.result.hp_damage != 0
  2472.     return if states == []
  2473.     return if @battler.sv.add_state == @battler.result.added_state_objects
  2474.     @battler.sv.add_state = states.dup
  2475.     @st = []
  2476.     @st_base = []
  2477.     for i in 0...states.size
  2478.       @st[i] = Sprite.new
  2479.       bitmap_state(@st[i], states[i])
  2480.       @st_base[i] = []
  2481.       @st_base[i][0] = @direction * (-20 + 5 * i) + @battler.sv.x / 100
  2482.       @st_base[i][1] = -40 - @state_height * i + (@battler.sv.y - @battler.sv.h - @battler.sv.j - @battler.sv.oy_adjust)/ 100
  2483.       @st[i].z = 1000 + i
  2484.       @st[i].opacity = 0
  2485.     end
  2486.     @time = @pop_time = 80
  2487.   end   
  2488.   #--------------------------------------------------------------------------
  2489.   # ● ステート画像
  2490.   #--------------------------------------------------------------------------
  2491.   def bitmap_state(state, state_object)
  2492.     name = state_object.name
  2493.     state.bitmap = Cache.system("Iconset").dup
  2494.     state.src_rect.set(state_object.icon_index % 16 * 24, state_object.icon_index / 16 * 24, 24, 24)
  2495.     @state_height = 24
  2496.   end
  2497.   #--------------------------------------------------------------------------
  2498.   # ● ダメージ表示
  2499.   #--------------------------------------------------------------------------
  2500.   def hit_count
  2501.     for i in [email protected]
  2502.       if @battler.sv.hit[i] == nil
  2503.         @hit = i
  2504.         return @battler.sv.hit[i] = @hit
  2505.       end
  2506.     end
  2507.     @hit = @battler.sv.hit.size
  2508.     @battler.sv.hit.push(@hit)
  2509.   end  
  2510.   #--------------------------------------------------------------------------
  2511.   # ● ダメージ表示
  2512.   #--------------------------------------------------------------------------
  2513.   def set_damage
  2514.     return @action_end = true if !N03::DAMAGE_POP
  2515.     damage = @battler.result.hp_damage if @battler.result.hp_damage != 0
  2516.     damage = @battler.result.hp_drain  if @battler.result.hp_drain  != 0
  2517.     damage = @battler.result.mp_damage if @battler.result.mp_damage != 0
  2518.     damage = @battler.result.mp_drain  if @battler.result.mp_drain  != 0
  2519.     damage = @battler.result.tp_damage if @battler.result.tp_damage != 0
  2520.     if !damage or damage == 0
  2521.       @action_end = true if @st == nil
  2522.       return # ステートだけPOPする設定を考慮して@action_endは返さない
  2523.     end
  2524.     hit_count
  2525.     #@hit = @battler.sv.hit
  2526.     #@battler.sv.hit += 1 if damage != 0
  2527.     file = N03::DAMAGE_PLUS if damage > 0
  2528.     file = N03::DAMAGE_MINUS if damage < 0
  2529.     add_file = N03::DAMAGE_MP if @battler.result.mp_damage != 0
  2530.     add_file = N03::DAMAGE_TP if @battler.result.tp_damage != 0
  2531.     adjust_x = N03::DAMAGE_ADJUST
  2532.     @num = []
  2533.     @num_base = []
  2534.     damage = damage.abs
  2535.     max_num = damage.to_s.size
  2536.     max_num += 1 if add_file != nil
  2537.     for i in 0...max_num
  2538.       @num[i] = Sprite.new
  2539.       if add_file != nil && i == max_num - 1
  2540.         @num[i].bitmap = Cache.system(add_file)
  2541.         cw = (damage % (10 * 10 ** i))/(10 ** i)
  2542.         sw = 0 if sw == nil
  2543.       else
  2544.         @num[i].bitmap = Cache.system(file)
  2545.         cw = (damage % (10 * 10 ** i))/(10 ** i)
  2546.         sw = @num[i].bitmap.width / 10
  2547.         @num[i].src_rect.set(cw * sw, 0, sw, @num[i].bitmap.height)
  2548.       end
  2549.       @num_base[i] = []
  2550.       @num_base[i][0] = (sw + adjust_x) * i * -1 + (@battler.sv.x / 100)
  2551.       @num_base[i][1] =  -(@num[i].bitmap.height / 3) - i * 2 - @hit * 2 + (@battler.sv.y - @battler.sv.h - @battler.sv.j - @battler.sv.oy_adjust)/ 100
  2552.       @num_base[i][0] -= @num[i].bitmap.width / 2 - adjust_x if add_file != nil && i == max_num - 1
  2553.       @num[i].z = 1000 + i + @hit * 10
  2554.     end
  2555.     @time = @pop_time = 80
  2556.   end
  2557.   #--------------------------------------------------------------------------
  2558.   # ● フレーム更新
  2559.   #--------------------------------------------------------------------------
  2560.   def update
  2561.     return if @time == 0
  2562.     for i in [email protected] do update_state_move(@st[i], i) end if @st != nil
  2563.     for i in [email protected] do update_num_move(@num[i], i) end if @num != nil
  2564.     @time -= 1
  2565.     @action_end = true if @time == 0
  2566.   end
  2567.   #--------------------------------------------------------------------------
  2568.   # ● ステート画像の更新
  2569.   #--------------------------------------------------------------------------
  2570.   def update_state_move(state, index)
  2571.     min = @pop_time - index * 2
  2572.     case @time
  2573.     when min-15..min
  2574.       @st_base[index][0] += @direction
  2575.       state.opacity += 25
  2576.     when min-80..min-50
  2577.       @st_base[index][0] += @direction
  2578.       state.opacity -= 25
  2579.     end
  2580.     state.x = (@st_base[index][0] - $sv_camera.x) * $sv_camera.zoom
  2581.     state.y = (@st_base[index][1] - $sv_camera.y) * $sv_camera.zoom
  2582.   end
  2583.   #--------------------------------------------------------------------------
  2584.   # ● 数値の更新
  2585.   #--------------------------------------------------------------------------
  2586.   def update_num_move(num, index)
  2587.     min = @pop_time - index * 2
  2588.     case @time
  2589.     when min-1..min
  2590.       @num_base[index][0] += @direction * @hit
  2591.       @num_base[index][1] -= 5 + @hit * 2
  2592.     when min-3..min-2
  2593.       @num_base[index][0] += @direction * @hit
  2594.       @num_base[index][1] -= 4 + @hit * 2
  2595.     when min-6..min-4
  2596.       @num_base[index][0] += @direction
  2597.       @num_base[index][1] -= 3 + @hit * 2
  2598.     when min-14..min-7
  2599.       @num_base[index][0] += @direction
  2600.       @num_base[index][1] += 2
  2601.     when min-17..min-15
  2602.       @num_base[index][1] -= 2 + @hit * 2
  2603.     when min-23..min-18
  2604.       @num_base[index][1] += 1
  2605.     when min-27..min-24
  2606.       @num_base[index][1] -= 1
  2607.     when min-30..min-28
  2608.       @num_base[index][1] += 1
  2609.     when min-33..min-31
  2610.       @num_base[index][1] -= 1
  2611.     when min-36..min-34
  2612.       @num_base[index][1] += 1
  2613.     end
  2614.     num.x = (@num_base[index][0] - $sv_camera.x) * $sv_camera.zoom
  2615.     num.y = (@num_base[index][1] - $sv_camera.y) * $sv_camera.zoom
  2616.     num.opacity = 256 - (12 - @time) * 32
  2617.     num.visible = false if @time == 0
  2618.   end
  2619.   #--------------------------------------------------------------------------
  2620.   # ● 解放
  2621.   #--------------------------------------------------------------------------
  2622.   def dispose
  2623.     @battler.sv.hit[@hit] = nil if @hit
  2624.     bitmap.dispose if bitmap
  2625.     for i in [email protected] do @num[i].dispose end if @num != nil
  2626.     for i in [email protected] do @st[i].dispose end if @st != nil
  2627.     super
  2628.   end
  2629. end

  2630. #==============================================================================
  2631. # ■ Window_Skill_name
  2632. #------------------------------------------------------------------------------
  2633. #  スキル名を表示するウィンドウです。
  2634. #==============================================================================
  2635. class Window_Skill_name < Window_Base
  2636.   #--------------------------------------------------------------------------
  2637.   # ● オブジェクト初期化
  2638.   #--------------------------------------------------------------------------
  2639.   def initialize(text)
  2640.     super(0, 0, Graphics.width, line_height + standard_padding * 2)
  2641.     draw_text(4, 0, Graphics.width - 64, line_height,text, 1)
  2642.   end
  2643. end

  2644. #==============================================================================
  2645. # ■ Spriteset_Sideview
  2646. #------------------------------------------------------------------------------
  2647. #  サイドビュー独自のスプライトをまとめたクラスです。
  2648. #==============================================================================
  2649. class Spriteset_Sideview
  2650.   #--------------------------------------------------------------------------
  2651.   # ● オブジェクト初期化
  2652.   #--------------------------------------------------------------------------
  2653.   def initialize(viewport)
  2654.     @viewport = viewport
  2655.     @weapons = []
  2656.     @pictures = []
  2657.     @back_pic = []
  2658.     @damage = []
  2659.     $sv_camera.setup
  2660.     N03.camera(nil, N03::BATTLE_CAMERA["ターン開始前"].dup)
  2661.   end
  2662.   #--------------------------------------------------------------------------
  2663.   # ● フレーム更新
  2664.   #--------------------------------------------------------------------------
  2665.   def update
  2666.     update_battler_data
  2667.     update_damage
  2668.     update_pictures
  2669.     update_back_pic
  2670.     update_weapons
  2671.   end  
  2672.   #--------------------------------------------------------------------------
  2673.   # ● バトラーデータの更新
  2674.   #--------------------------------------------------------------------------
  2675.   def update_battler_data
  2676.     for battler in $game_party.battle_members + $game_troop.members
  2677.       weapon_end(battler) if battler.sv.weapon_end
  2678.       next if battler.sv.effect_data == []
  2679.       for effect_data in battler.sv.effect_data do set_effects(battler, effect_data) end
  2680.     end
  2681.   end
  2682.   #--------------------------------------------------------------------------
  2683.   # ● ダメージ画像の更新
  2684.   #--------------------------------------------------------------------------
  2685.   def update_damage
  2686.     for i in [email protected]
  2687.       next if @damage[i] == nil
  2688.       @damage[i].update if @damage[i] != nil
  2689.       next if !@damage[i].action_end
  2690.       @damage[i].dispose
  2691.       @damage[i] = nil
  2692.     end
  2693.   end
  2694.   #--------------------------------------------------------------------------
  2695.   # ● ピクチャアクションの更新
  2696.   #--------------------------------------------------------------------------
  2697.   def update_pictures
  2698.     for i in [email protected]
  2699.       next if @pictures[i] == nil
  2700.       @pictures[i].update if @pictures[i] != nil
  2701.       next if !@pictures[i].action_end
  2702.       @pictures[i].dispose
  2703.       @pictures[i] = nil
  2704.     end
  2705.   end
  2706.   #--------------------------------------------------------------------------
  2707.   # ● 周期ピクチャの更新
  2708.   #--------------------------------------------------------------------------
  2709.   def update_back_pic
  2710.     set_back_pic if $sv_camera.program_picture != []
  2711.     for i in 0...@back_pic.size
  2712.       next if @back_pic[i] == nil
  2713.       @back_pic[i].update if @back_pic[i] != nil
  2714.       next if !@back_pic[i].action_end
  2715.       @back_pic[i].dispose
  2716.       @back_pic[i] = nil
  2717.     end
  2718.   end
  2719.   #--------------------------------------------------------------------------
  2720.   # ● 武器アクションの更新
  2721.   #--------------------------------------------------------------------------
  2722.   def update_weapons
  2723.     for i in [email protected]
  2724.       next if @weapons[i] == nil
  2725.       @weapons[i].update if @weapons[i] != nil
  2726.       next if !@weapons[i].action_end
  2727.       @weapons[i].dispose
  2728.       @weapons[i] = nil
  2729.     end
  2730.   end
  2731.   #--------------------------------------------------------------------------
  2732.   # ● ダメージ実行
  2733.   #--------------------------------------------------------------------------
  2734.   def set_damage_pop(target)
  2735.     for i in [email protected]
  2736.       next if @damage[i] != nil
  2737.       return @damage[i] = Sprite_Damage.new(@viewport, target)
  2738.     end
  2739.     @damage.push(Sprite_Damage.new(@viewport, target))
  2740.   end
  2741.   #--------------------------------------------------------------------------
  2742.   # ● 周期ピクチャ実行
  2743.   #--------------------------------------------------------------------------
  2744.   def set_back_pic
  2745.     for data in $sv_camera.program_picture
  2746.       if @back_pic[data[2]] != nil
  2747.         @back_pic[data[2]].dispose
  2748.         @back_pic[data[2]] = nil
  2749.       end
  2750.       @back_pic[data[2]] = Sprite_Back_Picture.new(@viewport, data[2])
  2751.       @back_pic[data[2]].setup(data)
  2752.     end
  2753.     $sv_camera.program_picture = []
  2754.   end
  2755.   #--------------------------------------------------------------------------
  2756.   # ● エフェクト開始
  2757.   #--------------------------------------------------------------------------
  2758.   def set_effects(battler, effect_data)
  2759.     case effect_data[0]
  2760.     when "pic" ; set_pictures(battler, effect_data)
  2761.     when  "wp" ; set_weapons(battler,  true)
  2762.     when "m_a" ; set_weapons(battler, false)
  2763.     end
  2764.   end
  2765.   #--------------------------------------------------------------------------
  2766.   # ● ピクチャアクション実行
  2767.   #--------------------------------------------------------------------------
  2768.   def set_pictures(battler, effect_data)
  2769.     @pictures[effect_data[1]] = Sprite_Battle_Picture.new if @pictures[effect_data[1]] == nil
  2770.     @pictures[effect_data[1]].set(battler)
  2771.   end
  2772.   #--------------------------------------------------------------------------
  2773.   # ● 武器アクション実行
  2774.   #--------------------------------------------------------------------------
  2775.   def set_weapons(battler, weapon_flag, test = true)
  2776.     for i in [email protected]
  2777.       next if @weapons[i] != nil
  2778.       @weapons[i] = Sprite_Weapon.new(@viewport, i, battler)
  2779.       battler.sv.weapon_index.push(i) if weapon_flag
  2780.       return i
  2781.     end
  2782.     @weapons.push(Sprite_Weapon.new(@viewport, @weapons.size, battler))
  2783.     battler.sv.weapon_index.push(@weapons.size - 1) if weapon_flag
  2784.     return @weapons.size - 1
  2785.   end
  2786.   #--------------------------------------------------------------------------
  2787.   # ● バトラーの武器アクション終了
  2788.   #--------------------------------------------------------------------------
  2789.   def weapon_end(battler)
  2790.     battler.sv.weapon_end = false
  2791.     for index in battler.sv.weapon_index
  2792.       weapon_index = battler.sv.weapon_index.shift
  2793.       @weapons[weapon_index].dispose if @weapons[weapon_index] != nil
  2794.       @weapons[weapon_index] = nil
  2795.     end
  2796.     battler.sv.weapon_index.compact!
  2797.   end  
  2798.   #--------------------------------------------------------------------------
  2799.   # ● ヒット時の戦闘アニメ実行
  2800.   #--------------------------------------------------------------------------
  2801.   def set_hit_animation(battler, weapon_index, hit_targets, miss)
  2802.     weapon = @weapons[weapon_index]
  2803.     for target in hit_targets
  2804.       next @weapons[@hit_index].timing_battler_set(target) if @hit_index != nil
  2805.       @hit_index = set_weapons(battler, false, false)
  2806.       @weapons[@hit_index].set_hit_animation(weapon.hit_position, weapon.hit_anime_id, target)
  2807.     end
  2808.     @hit_index = nil
  2809.     if !weapon.through && !miss
  2810.       @weapons[weapon_index].dispose
  2811.       @weapons[weapon_index] = nil
  2812.     else
  2813.       @weapons[weapon_index].through_change
  2814.     end
  2815.   end
  2816.   #--------------------------------------------------------------------------
  2817.   # ● サイドビューデータの初期化
  2818.   #--------------------------------------------------------------------------
  2819.   def reset_sideview
  2820.     $sv_camera.reset
  2821.     for member in $game_troop.members + $game_party.battle_members do member.sv.reset end
  2822.   end  
  2823.   #--------------------------------------------------------------------------
  2824.   # ● 解放
  2825.   #--------------------------------------------------------------------------
  2826.   def dispose
  2827.     dispose_effects(@weapons)
  2828.     dispose_effects(@pictures)
  2829.     dispose_effects(@back_pic)
  2830.     dispose_effects(@damage)
  2831.     reset_sideview
  2832.   end
  2833.   #--------------------------------------------------------------------------
  2834.   # ● エフェクト画像の解放
  2835.   #--------------------------------------------------------------------------
  2836.   def dispose_effects(effects)
  2837.     for i in 0...effects.size
  2838.       effects[i].dispose if effects[i] != nil
  2839.       effects[i] = nil
  2840.     end
  2841.   end
  2842. end


  2843. #==============================================================================
  2844. # ■ Sprite_Battle_Back
  2845. #------------------------------------------------------------------------------
  2846. #  戦闘背景用のスプライトです。
  2847. #==============================================================================
  2848. class Sprite_Battle_Back < Plane
  2849.   #--------------------------------------------------------------------------
  2850.   # ● オブジェクト初期化
  2851.   #--------------------------------------------------------------------------
  2852.   def initialize(viewport = nil, index, battleback_name)
  2853.     super(viewport)
  2854.     @index = index
  2855.     if @index == 1
  2856.       data = N03::FLOOR1_DATA[battleback_name]
  2857.       data = N03::FLOOR1_DATA["全Battlebacks1"] if data == nil
  2858.     elsif @index == 2
  2859.       data = N03::FLOOR2_DATA[battleback_name]
  2860.       data = N03::FLOOR2_DATA["全Battlebacks2"] if data == nil
  2861.     end   
  2862.     data = data.dup
  2863.     @adjust_position = data[0]
  2864.     @zoom_x = data[1][0] / 100.0
  2865.     @zoom_y = data[1][1] / 100.0
  2866.     @shake_on = data[2]
  2867.     $game_switches[data[3]] = true if data[3] > 0
  2868.     $sv_camera.switches[data[3].abs] = true if data[3] < 0
  2869.     reset_scroll
  2870.     reset_back_data(battleback_name)
  2871.   end
  2872.   #--------------------------------------------------------------------------
  2873.   # ● 背景スクロールを初期化
  2874.   #--------------------------------------------------------------------------
  2875.   def reset_scroll
  2876.     @scroll_x = 0
  2877.     @scroll_y = 0
  2878.     @move_x = 0
  2879.     @move_y = 0
  2880.   end
  2881.   #--------------------------------------------------------------------------
  2882.   # ● 背景データを初期化
  2883.   #--------------------------------------------------------------------------
  2884.   def reset_back_data(battleback_name)
  2885.     @back_data = []
  2886.     @active_data = ["scroll",0, @move_x, @move_y, false, battleback_name,""]
  2887.     start_back_data(@active_data)
  2888.   end  
  2889.   #--------------------------------------------------------------------------
  2890.   # ● 背景画像のセッティング
  2891.   #--------------------------------------------------------------------------
  2892.   def set_graphics(new_bitmap)
  2893.     self.bitmap = new_bitmap
  2894.     @base_x = (self.bitmap.width * @zoom_x - Graphics.width) / 2 + @adjust_position[0]
  2895.     @base_y = (self.bitmap.height * @zoom_y - Graphics.height) / 2 + @adjust_position[1]
  2896.     # 限界座標を取得
  2897.     max_top =  0
  2898.     max_bottom = self.bitmap.height * @zoom_y - Graphics.height
  2899.     max_left = 0
  2900.     max_right = self.bitmap.width * @zoom_x - Graphics.width
  2901.     exist = true
  2902.     exist = false if self.bitmap.height == 32 && self.bitmap.width == 32
  2903.     $sv_camera.setting(@index, [max_top, max_bottom, max_left, max_right, @base_x, @base_y,exist])
  2904.   end
  2905.   #--------------------------------------------------------------------------
  2906.   # ● フレーム更新
  2907.   #--------------------------------------------------------------------------
  2908.   def update
  2909.     return if !bitmap
  2910.     update_back_data
  2911.     update_scroll unless @move_x == 0 && @move_y == 0
  2912.     update_color
  2913.     update_position
  2914.     update_back_adjust if @bt_back != nil
  2915.     create_back_adjust if @bt_back == nil && !@active_data[10] && @scroll_x == 0 && @scroll_y == 0
  2916.   end
  2917.   #--------------------------------------------------------------------------
  2918.   # ● 背景データを更新
  2919.   #--------------------------------------------------------------------------
  2920.   def update_back_data
  2921.     delete = true if @active_data[1] > 0 && !$game_switches[@active_data[1]]
  2922.     delete = true if @active_data[1] < 0 && !$sv_camera.switches[@active_data[1].abs]
  2923.     return if !delete
  2924.     for i in 0...@back_data.size
  2925.       @back_data[i] = nil if @back_data[i][1] > 0 && !$game_switches[@back_data[i][1]]
  2926.       @back_data[i] = nil if @back_data[i][1] < 0 && !$sv_camera.switches[@back_data[i][1].abs]
  2927.     end
  2928.     @back_data.compact!
  2929.     next_back_data
  2930.   end
  2931.   #--------------------------------------------------------------------------
  2932.   # ● 次の背景データをセット
  2933.   #--------------------------------------------------------------------------
  2934.   def next_back_data
  2935.     @back_data.delete(@active_data[11]) if @active_data[11] != nil
  2936.     @back_data.push(@active_data[11]) if @active_data[11] != nil
  2937.     @active_data = nil
  2938.     data = @back_data.pop
  2939.     @back_data = [@active_data] if @back_data.size == 0
  2940.     start_back_data(data)
  2941.   end  
  2942.   #--------------------------------------------------------------------------
  2943.   # ● 背景データを実行
  2944.   #--------------------------------------------------------------------------
  2945.   def start_back_data(data)
  2946.     return if back_data_remain(data)
  2947.     bt_back_dispose
  2948.     pre_active_data = @active_data
  2949.     @active_data[8] = [@back_name, @move_x, @move_y, @scroll_x, @scroll_y] if @active_data != nil
  2950.     @back_data.push(@active_data)     if @active_data != nil
  2951.     @active_data = data.dup
  2952.     @active_data[5] = @back_name      if @active_data[5] == ""
  2953.     @active_data[9] = set_back_adjust if @active_data[9] == nil
  2954.     back_data_scroll_on               if @active_data[8] == nil && @active_data[9][0] == false
  2955.     set_remain_back_data              if @active_data[8] != nil
  2956.     create_back(@active_data[5])      if @active_data[9][0] == false
  2957.     create_back_adjust                if @active_data[10]
  2958.     @active_data[11] = pre_active_data if pre_active_data && @active_data[7] == false
  2959.   end  
  2960.   #--------------------------------------------------------------------------
  2961.   # ● 背景データの保留
  2962.   #--------------------------------------------------------------------------
  2963.   def back_data_remain(data)
  2964.     remain = false
  2965.     remain = true if data[6] != "" && @active_data != nil && @active_data[9] != nil && @active_data[9][0] != false
  2966.     remain = true if @active_data != nil && @active_data[7] == false
  2967.     return remain if !remain
  2968.     @remain = true
  2969.     @back_data.push(data)
  2970.     return remain
  2971.   end  
  2972.   #--------------------------------------------------------------------------
  2973.   # ● 背景変更補正データをセット
  2974.   #--------------------------------------------------------------------------
  2975.   def set_back_adjust
  2976.     bt_adjust = []
  2977.     sign = -1
  2978.     if @active_data[6] == ""
  2979.       reset_scroll if @active_data[3][0] == 0 &&  @active_data[3][1] == 0
  2980.       bt_adjust = [false,false,0,0]
  2981.       return bt_adjust
  2982.     elsif @move_x != 0 or @active_data[3][0] != 0
  2983.       sign = 1 if @move_x < 0
  2984.       bt_adjust[0] = [self.bitmap.width * @zoom_x * sign, 0]
  2985.       bt_adjust[1] = [self.bitmap.width * @zoom_x * sign * 2, 0]
  2986.     elsif @move_y != 0 or @active_data[3][1] != 0
  2987.       sign = 1 if @move_y < 0
  2988.       bt_adjust[0] = [0, self.bitmap.height * @zoom_y * sign]
  2989.       bt_adjust[1] = [0, self.bitmap.height * @zoom_y * sign * 2]
  2990.     else
  2991.       reset_scroll if @active_data[3][0] == 0 &&  @active_data[3][1] == 0
  2992.       bt_adjust = [false,false,0,0]
  2993.       return bt_adjust
  2994.     end
  2995.     bt_adjust[2] = [bt_adjust[0][0], bt_adjust[0][1]]
  2996.     return bt_adjust
  2997.   end
  2998.   #--------------------------------------------------------------------------
  2999.   # ● 背景スクロールデータを実行
  3000.   #--------------------------------------------------------------------------
  3001.   def back_data_scroll_on
  3002.     mirror = $sv_camera.mirror
  3003.     mirror = false if !@active_data[4]
  3004.     @move_x = @active_data[3][0]
  3005.     @move_x *= -1 if mirror
  3006.     @move_y = @active_data[3][1]
  3007.   end
  3008.   #--------------------------------------------------------------------------
  3009.   # ● 保持している背景データを実行
  3010.   #--------------------------------------------------------------------------
  3011.   def set_remain_back_data
  3012.     return back_data_scroll_on if @move_x != 0 or @move_y != 0
  3013.     create_back(@active_data[8][0])
  3014.     @move_x    = @active_data[8][1]
  3015.     @move_y    = @active_data[8][2]
  3016.     @scroll_x  = @active_data[8][3]
  3017.     @scroll_y  = @active_data[8][4]
  3018.   end  
  3019.   #--------------------------------------------------------------------------
  3020.   # ● 背景画像の作成
  3021.   #--------------------------------------------------------------------------
  3022.   def create_back(back_name)
  3023.     return if back_name == @back_name or back_name == ""
  3024.     self.bitmap = Cache.battleback1(back_name) if @index == 1
  3025.     self.bitmap = Cache.battleback2(back_name) if @index == 2
  3026.     @back_name = back_name
  3027.   end  
  3028.   #--------------------------------------------------------------------------
  3029.   # ● 背景変更補正画像の作成
  3030.   #--------------------------------------------------------------------------
  3031.   def create_back_adjust
  3032.     return if @active_data[9][0] == false
  3033.     @active_data[10] = true
  3034.     mirror = $sv_camera.mirror
  3035.     mirror = false if !@active_data[4]
  3036.     @bt_back = []
  3037.     @bt_back[0] = Sprite.new(viewport)
  3038.     @bt_back[0].bitmap = Cache.battleback1(@active_data[6]) if @index == 1
  3039.     @bt_back[0].bitmap = Cache.battleback2(@active_data[6]) if @index == 2
  3040.     @bt_back[0].mirror = mirror
  3041.     @bt_back[1] = Sprite.new(viewport)
  3042.     @bt_back[1].bitmap = Cache.battleback1(@active_data[5]) if @index == 1
  3043.     @bt_back[1].bitmap = Cache.battleback2(@active_data[5]) if @index == 2
  3044.     @bt_back[1].mirror = mirror
  3045.   end
  3046.   #--------------------------------------------------------------------------
  3047.   # ● 背景スクロールの更新
  3048.   #--------------------------------------------------------------------------
  3049.   def update_scroll
  3050.     @scroll_x += @move_x
  3051.     @scroll_y += @move_y
  3052.     @scroll_x = 0 if @scroll_x / 100 >= self.bitmap.width * @zoom_x or @scroll_x / 100 <= -self.bitmap.width * @zoom_x
  3053.     @scroll_y = 0 if @scroll_y / 100 >= self.bitmap.height * @zoom_y or @scroll_y / 100 <= -self.bitmap.height * @zoom_y
  3054.   end
  3055.   #--------------------------------------------------------------------------
  3056.   # ● 色調変更の更新
  3057.   #--------------------------------------------------------------------------
  3058.   def update_color
  3059.     color_set if $sv_camera.color_set[@index] != nil
  3060.     return if @color_data == nil
  3061.     @color_data[4] -= 1
  3062.     if @color_data[4] == 0 && @color_data[5] != 0
  3063.       @color_data[4] = @color_data[5]
  3064.       @color_data[5] = 0
  3065.       @color_data[6] = [0,0,0,0]
  3066.     elsif @color_data[4] == 0
  3067.       @remain_color_data = @color_data
  3068.       return @color_data = nil
  3069.     end  
  3070.     for i in 0..3
  3071.       @color_data[i] = (@color_data[i] * (@color_data[4] - 1) + @color_data[6][i]) / @color_data[4]
  3072.     end  
  3073.     self.color.set(@color_data[0], @color_data[1], @color_data[2], @color_data[3])
  3074.   end
  3075.   #--------------------------------------------------------------------------
  3076.   # ● 座標の更新
  3077.   #--------------------------------------------------------------------------
  3078.   def update_position
  3079.     self.ox = $sv_camera.x + @base_x - @scroll_x / 100
  3080.     self.oy = $sv_camera.y + @base_y - @scroll_y / 100
  3081.     self.ox -= $sv_camera.sx / 100 if @shake_on
  3082.     self.oy -= $sv_camera.sy / 100 if @shake_on
  3083.     self.zoom_x = @zoom_x * $sv_camera.zoom
  3084.     self.zoom_y = @zoom_y * $sv_camera.zoom
  3085.     self.ox *= $sv_camera.zoom
  3086.     self.oy *= $sv_camera.zoom
  3087.     self.z = @index * 10
  3088.   end
  3089.   #--------------------------------------------------------------------------
  3090.   # ● 背景変更補正画像を更新
  3091.   #--------------------------------------------------------------------------
  3092.   def update_back_adjust
  3093.     @active_data[9][0][0] = 0 if @scroll_x == 0
  3094.     @active_data[9][0][1] = 0 if @scroll_y == 0
  3095.     @active_data[9][1][0] -= @active_data[9][2][0] if @scroll_x == 0
  3096.     @active_data[9][1][1] -= @active_data[9][2][1] if @scroll_y == 0
  3097.     for i in 0...@bt_back.size
  3098.       @bt_back[i].x = -self.ox + @active_data[9][i][0] * $sv_camera.zoom
  3099.       @bt_back[i].y = -self.oy + @active_data[9][i][1] * $sv_camera.zoom
  3100.       @bt_back[i].zoom_x = self.zoom_x
  3101.       @bt_back[i].zoom_y = self.zoom_y
  3102.       @bt_back[i].z = self.z + 1
  3103.       @bt_back[i].color.set(@color_data[0], @color_data[1], @color_data[2], @color_data[3]) if @color_data != nil
  3104.     end
  3105.     back_data_scroll_on if @active_data[9][0][0] == 0 && @active_data[9][0][1] == 0
  3106.     return unless @active_data[9][1][0] == 0 && @active_data[9][1][1] == 0
  3107.     bt_back_dispose
  3108.     create_back(@active_data[5])
  3109.     @active_data[9][0] = false
  3110.     next_back_data if @remain && @back_data.size != 1
  3111.     @remain = false
  3112.   end
  3113.   #--------------------------------------------------------------------------
  3114.   # ● 色調変更
  3115.   #--------------------------------------------------------------------------
  3116.   def color_set
  3117.     set = $sv_camera.color_set[@index]
  3118.     $sv_camera.color_set[@index] = nil
  3119.     set[4] = 1 if set[4] == 0
  3120.     @remain_color_data = [0,0,0,0] if @remain_color_data == nil
  3121.     @color_data = @remain_color_data
  3122.     @color_data[4] = set[4]
  3123.     @color_data[5] = set[5]
  3124.     @color_data[6] = set
  3125.   end
  3126.   #--------------------------------------------------------------------------
  3127.   # ● 背景変更補正画像の解放
  3128.   #--------------------------------------------------------------------------
  3129.   def bt_back_dispose
  3130.     for i in 0...@bt_back.size do @bt_back[i].dispose end if @bt_back != nil
  3131.     @bt_back = nil
  3132.   end  
  3133.   #--------------------------------------------------------------------------
  3134.   # ● 解放
  3135.   #--------------------------------------------------------------------------
  3136.   def dispose
  3137.     bitmap.dispose if bitmap
  3138.     bt_back_dispose
  3139.     super
  3140.   end
  3141. end  
  3142.   
  3143. #==============================================================================
  3144. # ■ Battle_Camera
  3145. #------------------------------------------------------------------------------
  3146. #  戦闘カメラやバトルプログラムを扱うクラスです。
  3147. #==============================================================================
  3148. class Battle_Camera
  3149.   #--------------------------------------------------------------------------
  3150.   # ● 公開インスタンス変数 
  3151.   #--------------------------------------------------------------------------
  3152.   attr_reader   :sx                 # シェイクX座標
  3153.   attr_reader   :sy                 # シェイクY座標
  3154.   attr_reader   :max_top            # 上限界座標
  3155.   attr_reader   :max_bottom         # 下限界座標
  3156.   attr_reader   :max_left           # 左限界座標
  3157.   attr_reader   :max_right          # 右限界座標
  3158.   attr_accessor :switches           # サイドビュー専用スイッチ
  3159.   attr_accessor :color_set          # 色調変更データ
  3160.   attr_accessor :wait               # 戦闘シーンの強制ウエイト
  3161.   attr_accessor :win_wait           # 戦闘勝利前のウエイト
  3162.   attr_accessor :mirror             # 画面反転フラグ
  3163.   attr_accessor :program_scroll     # バトルプログラム 背景の自動スクロール
  3164.   attr_accessor :program_picture    # バトルプログラム 周期ピクチャ
  3165.   attr_accessor :event              # コモンイベント呼び出し
  3166.   #--------------------------------------------------------------------------
  3167.   # ● オブジェクト初期化
  3168.   #--------------------------------------------------------------------------
  3169.   def initialize
  3170.     @switches = []
  3171.     @max_data = []
  3172.     @color_set = []
  3173.     @wait = 0
  3174.     @win_wait = false
  3175.     @mirror = false
  3176.     @event = false
  3177.     setup
  3178.   end
  3179.   #--------------------------------------------------------------------------
  3180.   # ● カメラX座標
  3181.   #--------------------------------------------------------------------------
  3182.   def x
  3183.     return @x / 100
  3184.   end
  3185.   #--------------------------------------------------------------------------
  3186.   # ● カメラY座標
  3187.   #--------------------------------------------------------------------------
  3188.   def y
  3189.     return @y / 100
  3190.   end
  3191.   #--------------------------------------------------------------------------
  3192.   # ● ズーム率
  3193.   #--------------------------------------------------------------------------
  3194.   def zoom
  3195.     return @zoom * 0.001
  3196.   end
  3197.   #--------------------------------------------------------------------------
  3198.   # ● ズーム率による座標変換
  3199.   #--------------------------------------------------------------------------
  3200.   def convert
  3201.     return @zoom
  3202.   end
  3203.   #--------------------------------------------------------------------------
  3204.   # ● カメラセットアップ
  3205.   #--------------------------------------------------------------------------
  3206.   def setup
  3207.     @x = 0
  3208.     @y = 0
  3209.     @sx = 0
  3210.     @sy = 0
  3211.     @zoom = 1000
  3212.     @time = 0
  3213.     @shake_time = 0
  3214.     program_setup
  3215.   end
  3216.   #--------------------------------------------------------------------------
  3217.   # ● カメラ初期化
  3218.   #--------------------------------------------------------------------------
  3219.   def reset
  3220.     @switches = []
  3221.     @max_data = []
  3222.     @color_set = []
  3223.     @wait = 0
  3224.     @win_wait = false
  3225.     @mirror = false
  3226.     program_setup(false)
  3227.   end  
  3228.   #--------------------------------------------------------------------------
  3229.   # ● バトルプログラムのセットアップ
  3230.   #--------------------------------------------------------------------------
  3231.   def program_setup(check = true)
  3232.     @played_program  = []
  3233.     @program_switch  = []
  3234.     @program_sound   = []
  3235.     @program_scroll  = []
  3236.     @program_se      = []
  3237.     @program_shake   = []
  3238.     @program_color   = []
  3239.     @program_picture = []
  3240.     @program_base = N03::BATTLE_PROGRAM.values.dup
  3241.     program_check if check
  3242.   end  
  3243.   #--------------------------------------------------------------------------
  3244.   # ● バトルプログラムのチェック
  3245.   #--------------------------------------------------------------------------
  3246.   def program_check
  3247.     for data in @program_base
  3248.       if program_start?(data) && !@played_program.include?(data)
  3249.         @played_program.push(data.dup)
  3250.         @program_scroll.push(data.dup)  if data[0] == "scroll"
  3251.         @program_picture.push(data.dup) if data[0] == "kpic"
  3252.         start_sound(data.dup)           if data[0] == "sound"
  3253.         start_program_switch(data.dup)  if data[0] == "switch"
  3254.         start_program_se(data.dup)      if data[0] == "keep_se"
  3255.         start_program_shake(data.dup)   if data[0] == "keep_sk"
  3256.         start_program_color(data.dup)   if data[0] == "keep_c"
  3257.       else
  3258.         @played_program.delete(data)  if !program_start?(data)
  3259.         @program_scroll.delete(data)  if data[0] == "scroll"
  3260.         @program_picture.delete(data) if data[0] == "kpic"
  3261.         @program_switch.delete(data)  if data[0] == "switch"
  3262.         @program_sound.delete(data)   if data[0] == "sound"
  3263.         @program_se.delete(data)      if data[0] == "keep_se"
  3264.         @program_shake.delete(data)   if data[0] == "keep_sk"
  3265.         @program_color.delete(data)   if data[0] == "keep_c"
  3266.       end
  3267.     end
  3268.   end
  3269.   #--------------------------------------------------------------------------
  3270.   # ● バトルプログラムの開始
  3271.   #--------------------------------------------------------------------------
  3272.   def program_start?(data)
  3273.     start = false
  3274.     start = true if $game_switches[data[1].abs] && data[1] > 0
  3275.     start = true if @switches[data[1].abs] && data[1] < 0
  3276.     return start
  3277.   end  
  3278.   #--------------------------------------------------------------------------
  3279.   # ● バトルプログラム スイッチ操作の開始
  3280.   #--------------------------------------------------------------------------
  3281.   def start_program_switch(data)
  3282.     data[4] = data[4] + rand(data[5] + 1)
  3283.     data[4] = 1 if data[4] <= 0
  3284.     @program_switch.push(data)
  3285.   end
  3286.   #--------------------------------------------------------------------------
  3287.   # ● スイッチ操作の更新
  3288.   #--------------------------------------------------------------------------
  3289.   def update_program_switch
  3290.     for data in @program_switch
  3291.       data[4] -= 1
  3292.       next @program_switch.delete(data) if data[1] > 0 && !$game_switches[data[1]]
  3293.       next @program_switch.delete(data) if data[1] < 0 && !@switches[data[1].abs]
  3294.       next if data[4] != 0
  3295.       for id in data[2]
  3296.         $game_switches[id] = true if id > 0
  3297.         @switches[id.abs] = true  if id < 0
  3298.       end
  3299.       for id in data[3]
  3300.         $game_switches[id] = false if id > 0
  3301.         @switches[id.abs] = false  if id < 0
  3302.       end
  3303.       @program_switch.delete(data)
  3304.       program_check
  3305.     end  
  3306.   end
  3307.   #--------------------------------------------------------------------------
  3308.   # ● バトルプログラム BGM/BGSの開始
  3309.   #--------------------------------------------------------------------------
  3310.   def start_sound(data)
  3311.     @program_sound.push(data)
  3312.     name = data[5]
  3313.     case data[2]
  3314.     when "se"
  3315.       Audio.se_play("Audio/SE/" + name, data[4], data[3])
  3316.     when "bgm"
  3317.       name = RPG::BGM.last.name if data[5] == ""
  3318.       Audio.bgm_play("Audio/BGM/" + name, data[4], data[3])
  3319.     when "bgs"
  3320.       name = RPG::BGS.last.name if data[5] == ""
  3321.       Audio.bgs_play("Audio/BGS/" + name, data[4], data[3])
  3322.     end
  3323.   end
  3324.   #--------------------------------------------------------------------------
  3325.   # ● バトルプログラム 周期SEの開始
  3326.   #--------------------------------------------------------------------------
  3327.   def start_program_se(data)
  3328.     data[3] = [data[2], data[3]]
  3329.     data[2] = data[3][0] + rand(data[3][1] + 1)
  3330.     @program_se.push(data)
  3331.     Audio.se_play("Audio/SE/" + data[7], data[5], data[4]) if data[6]
  3332.   end
  3333.   #--------------------------------------------------------------------------
  3334.   # ● 周期SEの更新
  3335.   #--------------------------------------------------------------------------
  3336.   def update_program_se
  3337.     for data in @program_se
  3338.       data[2] -= 1
  3339.       next @program_se.delete(data) if data[1] > 0 && !$game_switches[data[1]]
  3340.       next @program_se.delete(data) if data[1] < 0 && !@switches[data[1].abs]
  3341.       next if data[2] != 0
  3342.       Audio.se_play("Audio/SE/" + data[7], data[5], data[4])
  3343.       data[2] = data[3][0] + rand(data[3][1] + 1)
  3344.     end  
  3345.   end
  3346.   #--------------------------------------------------------------------------
  3347.   # ● バトルプログラム 周期シェイクの開始
  3348.   #--------------------------------------------------------------------------
  3349.   def start_program_shake(data)
  3350.     data[3] = [data[2], data[3]]
  3351.     data[2] = data[3][0] + rand(data[3][1] + 1)
  3352.     @program_shake.push(data)
  3353.     shake(data[4], data[5], data[6]) if data[7]
  3354.   end
  3355.   #--------------------------------------------------------------------------
  3356.   # ● 周期シェイクの更新
  3357.   #--------------------------------------------------------------------------
  3358.   def update_program_shake
  3359.     for data in @program_shake
  3360.       data[2] -= 1
  3361.       next @program_shake.delete(data) if data[1] > 0 && !$game_switches[data[1]]
  3362.       next @program_shake.delete(data) if data[1] < 0 && !@switches[data[1].abs]
  3363.       next if data[2] != 0
  3364.       shake(data[4], data[5], data[6])
  3365.       data[2] = data[3][0] + rand(data[3][1] + 1)
  3366.     end  
  3367.   end
  3368.   #--------------------------------------------------------------------------
  3369.   # ● バトルプログラム 周期色調変更の開始
  3370.   #--------------------------------------------------------------------------
  3371.   def start_program_color(data)
  3372.     data[3] = [data[2], data[3]]
  3373.     data[2] = data[3][0] + rand(data[3][1] + 1)
  3374.     data[7] = true if data[4] == 0 or data[4] == 4
  3375.     case data[4]
  3376.     when 1   ;data[4] = $game_troop.members
  3377.     when 2   ;data[4] = $game_party.battle_members
  3378.     when 3,4 ;data[4] = $game_troop.members + $game_party.battle_members
  3379.     else ;data[4] = []
  3380.     end
  3381.     @program_color.push(data)
  3382.     return if !data[6]
  3383.     for target in data[4] do target.sv.color_set = data[5] end if data[4] != []
  3384.     @color_set[1] = data[5] if data[7]
  3385.     @color_set[2] = data[5] if data[7]
  3386.   end
  3387.   #--------------------------------------------------------------------------
  3388.   # ● 周期色調変更の更新
  3389.   #--------------------------------------------------------------------------
  3390.   def update_program_color
  3391.     for data in @program_color
  3392.       data[2] -= 1
  3393.       next @program_color.delete(data) if data[1] > 0 && !$game_switches[data[1]]
  3394.       next @program_color.delete(data) if data[1] < 0 && !@switches[data[1].abs]
  3395.       next if data[2] != 0
  3396.       for target in data[4] do target.sv.color_set = data[5] end if data[4] != []
  3397.       @color_set[1] = data[5] if data[7]
  3398.       @color_set[2] = data[5] if data[7]
  3399.       data[2] = data[3][0] + rand(data[3][1] + 1)
  3400.     end
  3401.   end
  3402.   #--------------------------------------------------------------------------
  3403.   # ● トランジション実行
  3404.   #--------------------------------------------------------------------------
  3405.   def perform_transition(data)
  3406.     Graphics.transition(data[2], "Graphics/Pictures/" + data[3], data[1])
  3407.   end  
  3408.   #--------------------------------------------------------------------------
  3409.   # ● 背景からカメラの限界値を取得  data = [max_top, max_bottom, max_left, max_right]
  3410.   #--------------------------------------------------------------------------
  3411.   def setting(index, data)
  3412.     @max_data[index - 1] = data
  3413.     return if index != 2
  3414.     setup
  3415.     # カメラの中心座標
  3416.     @center_x     = (Graphics.width / 2 + N03::CAMERA_POSITION[0]) * 100
  3417.     @center_y     = (Graphics.height / 2 + N03::CAMERA_POSITION[1]) * 100
  3418.     # 上下左右の移動限界距離
  3419.     @max_top    = [@max_data[0][5], @max_data[1][5]].min * -1
  3420.     @max_bottom = [@max_data[0][1], @max_data[1][1]].min + @max_top
  3421.     @max_left   = [@max_data[0][4], @max_data[1][4]].min  * -1
  3422.     @max_right  = [@max_data[0][3], @max_data[1][3]].min + @max_left
  3423.     exist_data = @max_data[0] if !@max_data[1][6]
  3424.     exist_data = @max_data[1] if !@max_data[0][6]
  3425.     @max_top    = exist_data[5] * -1        if exist_data != nil
  3426.     @max_bottom = exist_data[1] + @max_top  if exist_data != nil
  3427.     @max_left   = exist_data[4] * -1        if exist_data != nil
  3428.     @max_right  = exist_data[3] + @max_left if exist_data != nil
  3429.     @max_top = @max_bottom = @max_left = @max_right = 0 if !@max_data[1][6] && !@max_data[0][6]
  3430.     @max_width    = @max_right - @max_left + Graphics.width
  3431.     @max_height   = @max_bottom - @max_top + Graphics.height
  3432.     # ズームアウト限界値
  3433.     max_zoom_x    = 100 * Graphics.width / @max_width
  3434.     max_zoom_y    = 100 * Graphics.height / @max_height
  3435.     @max_zoom_out = [max_zoom_x, max_zoom_y].max
  3436.   end
  3437.   #--------------------------------------------------------------------------
  3438.   # ● カメラ移動
  3439.   #--------------------------------------------------------------------------
  3440.   def move(target_x, target_y, zoom, time, screen = true)
  3441.     # 戦闘背景以上のサイズまでズームアウトしないよう調整
  3442.     @target_zoom = [zoom * 0.01, @max_zoom_out * 0.01].max
  3443.     target_x *= -1 if screen && @mirror
  3444.     # ズーム分の中心座標補正
  3445.     if screen && @target_zoom != 1
  3446.       target_x = target_x + @center_x
  3447.       target_y = target_y + @center_y
  3448.     end
  3449.     adjust_x = @center_x * (@target_zoom - 1) / (@target_zoom ** 2 - @target_zoom)
  3450.     adjust_y = @center_y * (@target_zoom - 1) / (@target_zoom ** 2 - @target_zoom)
  3451.     adjust_x = 0 if adjust_x.nan?
  3452.     adjust_y = 0 if adjust_y.nan?
  3453.     adjust_x = @center_x if !screen && adjust_x == 0
  3454.     adjust_y = @center_y if !screen && adjust_y == 0
  3455.     @target_x = target_x - adjust_x.to_i
  3456.     @target_y = target_y - adjust_y.to_i
  3457.     @target_zoom = (@target_zoom * 1000).to_i
  3458.     @zoom = @zoom.to_i
  3459.     limit_test
  3460.     # 時間0の場合は即実行
  3461.     return @time = time.abs if time != 0
  3462.     @time = 1
  3463.     update
  3464.   end
  3465.   #--------------------------------------------------------------------------
  3466.   # ● 限界座標の試算
  3467.   #--------------------------------------------------------------------------
  3468.   def limit_test
  3469.     new_width = @max_width * @target_zoom / 1000
  3470.     new_height = @max_height * @target_zoom / 1000
  3471.     new_max_right = @max_right - (@max_width - new_width)
  3472.     new_max_bottom = @max_bottom - (@max_height - new_height)
  3473.     # 画面の移動先が限界の場合、限界座標をセット
  3474.     if @target_x < @max_left * 100
  3475.       @target_x = @max_left * 100
  3476.     end
  3477.     if @target_x > new_max_right * 100
  3478.       @target_x = new_max_right * 100
  3479.     end
  3480.     if @target_y < @max_top * 100
  3481.       @target_y = @max_top * 100
  3482.     end
  3483.     if @target_y > new_max_bottom * 100
  3484.       @target_y = new_max_bottom * 100
  3485.     end
  3486.   end
  3487.   #--------------------------------------------------------------------------
  3488.   # ● 画面のシェイク
  3489.   #--------------------------------------------------------------------------
  3490.   def shake(power, speed, time)
  3491.     @shake_x = power[0] * 100
  3492.     @shake_y = power[1] * 100
  3493.     @power_time_base = @power_time = speed
  3494.     @shake_time = time
  3495.     update_shake
  3496.   end
  3497.   #--------------------------------------------------------------------------
  3498.   # ● シェイクの更新
  3499.   #--------------------------------------------------------------------------
  3500.   def update_shake
  3501.     @sx = (@sx * (@power_time - 1) + @shake_x) / @power_time
  3502.     @sy = (@sy * (@power_time - 1) + @shake_y) / @power_time
  3503.     @power_time -= 1
  3504.     @shake_time -= 1
  3505.     return @sx = @sy = 0 if @shake_time == 0
  3506.     return if @power_time != 0
  3507.     @power_time = @power_time_base
  3508.     @shake_x = @shake_x * -4 / 5
  3509.     @shake_y = @shake_y * -4 / 5
  3510.   end
  3511.   #--------------------------------------------------------------------------
  3512.   # ● フレーム更新
  3513.   #--------------------------------------------------------------------------
  3514.   def update
  3515.     update_shake if @shake_time != 0
  3516.     update_program
  3517.     return if @time == 0
  3518.     @x = (@x * (@time - 1) + @target_x) / @time
  3519.     @y = (@y * (@time - 1) + @target_y) / @time
  3520.     @zoom = (@zoom * (@time - 1) + @target_zoom) / @time
  3521.     @time -= 1
  3522.   end
  3523.   #--------------------------------------------------------------------------
  3524.   # ● フレーム更新
  3525.   #--------------------------------------------------------------------------
  3526.   def update_program
  3527.     update_program_switch if @program_switch != []
  3528.     update_program_se     if @program_se != []
  3529.     update_program_shake  if @program_shake != []
  3530.     update_program_color  if @program_color != []
  3531.   end
  3532. end

  3533. #==============================================================================
  3534. # ■ Scene_Battle
  3535. #------------------------------------------------------------------------------
  3536. #  バトル画面の処理を行うクラスです。
  3537. #==============================================================================
  3538. class Scene_Battle < Scene_Base
  3539.   #--------------------------------------------------------------------------
  3540.   # ● フレーム更新(基本)
  3541.   #--------------------------------------------------------------------------
  3542.   alias update_basic_scene_battle_n03 update_basic
  3543.   def update_basic
  3544.     update_basic_scene_battle_n03
  3545.     $sv_camera.update
  3546.     $sv_camera.wait = N03::TURN_END_WAIT + 1 if $sv_camera.win_wait
  3547.     camera_wait
  3548.   end
  3549.   #--------------------------------------------------------------------------
  3550.   # ● カメラウェイト
  3551.   #--------------------------------------------------------------------------
  3552.   def camera_wait
  3553.     process_event if $sv_camera.event
  3554.     $sv_camera.event = false if $sv_camera.event
  3555.     while $sv_camera.wait != 0
  3556.       Graphics.update
  3557.       Input.update
  3558.       update_all_windows
  3559.       $game_timer.update
  3560.       $game_troop.update
  3561.       $sv_camera.update
  3562.       @spriteset.update
  3563.       update_info_viewport
  3564.       update_message_open
  3565.       $sv_camera.wait -= 1 if $sv_camera.wait > 0
  3566.       $sv_camera.wait = 1 if $sv_camera.wait == 0 && @spriteset.effect?
  3567.       BattleManager.victory if $sv_camera.win_wait && $sv_camera.wait == 0
  3568.     end
  3569.   end
  3570.   #--------------------------------------------------------------------------
  3571.   # ● カメラウェイトのセット
  3572.   #--------------------------------------------------------------------------
  3573.   def set_camera_wait(time)
  3574.     $sv_camera.wait = time
  3575.     camera_wait
  3576.   end  
  3577.   #--------------------------------------------------------------------------
  3578.   # ● エフェクト実行が終わるまでウェイト ★再定義
  3579.   #--------------------------------------------------------------------------
  3580.   def wait_for_effect
  3581.   end
  3582.   #--------------------------------------------------------------------------
  3583.   # ● ターン開始
  3584.   #--------------------------------------------------------------------------
  3585.   alias turn_start_scene_battle_n03 turn_start
  3586.   def turn_start
  3587.     turn_start_scene_battle_n03
  3588.     N03.camera(nil, N03::BATTLE_CAMERA["ターン開始後"].dup)
  3589.   end
  3590.   #--------------------------------------------------------------------------
  3591.   # ● ターン終了
  3592.   #--------------------------------------------------------------------------
  3593.   alias turn_end_scene_battle_n03 turn_end
  3594.   def turn_end
  3595.     turn_end_scene_battle_n03
  3596.     for member in $game_troop.members + $game_party.members
  3597.       N03.set_damage(member, member.sv.result_damage[0],member.sv.result_damage[1])
  3598.       member.sv.result_damage = [0,0]
  3599.       @spriteset.set_damage_pop(member) if member.result.hp_damage != 0 or member.result.mp_damage != 0
  3600.     end
  3601.     set_camera_wait(N03::TURN_END_WAIT)
  3602.     N03.camera(nil, N03::BATTLE_CAMERA["ターン開始前"].dup) if $game_party.inputable?
  3603.     @log_window.clear
  3604.   end
  3605.   #--------------------------------------------------------------------------
  3606.   # ● スキル/アイテムの使用 ★再定義
  3607.   #--------------------------------------------------------------------------
  3608.   def use_item
  3609.     item = @subject.current_action.item
  3610.     display_item(item)
  3611.     @subject.use_item(item)
  3612.     refresh_status
  3613.     @targets = @subject.current_action.make_targets.compact
  3614.     @targets = [@subject] if @targets.size == 0
  3615.     set_substitute(item)
  3616.     for time in item.repeats.times do play_sideview(@targets, item) end
  3617.     end_reaction(item)
  3618.     display_end_item
  3619.   end
  3620.   #--------------------------------------------------------------------------
  3621.   # ● スキル/アイテム名の表示
  3622.   #--------------------------------------------------------------------------
  3623.   def display_item(item)
  3624.     return @log_window.display_use_item(@subject, item) if N03::BATTLE_LOG
  3625.     @log_window.off
  3626.     @skill_name_window = Window_Skill_name.new(item.name) unless N03::NO_DISPLAY_SKILL_ID.include?(item.id) && item.is_a?(RPG::Skill)
  3627.   end  
  3628.   #--------------------------------------------------------------------------
  3629.   # ● スキル/アイテム名の表示終了
  3630.   #--------------------------------------------------------------------------
  3631.   def display_end_item
  3632.     @skill_name_window.dispose if @skill_name_window != nil
  3633.     @skill_name_window = nil
  3634.     set_camera_wait(N03::ACTION_END_WAIT) if @subject.sv.derivation_skill_id == 0
  3635.     @log_window.clear if N03::BATTLE_LOG
  3636.   end  
  3637.   #--------------------------------------------------------------------------
  3638.   # ● 反撃/魔法反射/身代わり処理
  3639.   #--------------------------------------------------------------------------
  3640.   def end_reaction(item)
  3641.     end_substitute if @substitute != nil
  3642.     set_reflection(item) if @reflection_data != nil
  3643.     set_counter_attack if @counter_attacker != nil
  3644.   end  
  3645.   #--------------------------------------------------------------------------
  3646.   # ● 反撃の発動 ★再定義
  3647.   #--------------------------------------------------------------------------
  3648.   def invoke_counter_attack(target, item)
  3649.     return if @subject.sv.counter_id != 0
  3650.     @counter_attacker = [] if @counter_attacker == nil
  3651.     return apply_item_effects(apply_substitute(target, item), item) if !target.movable?
  3652.     @log_window.add_text(sprintf(Vocab::CounterAttack, target.name)) if N03::BATTLE_LOG
  3653.     target.sv.counter_id = target.sv.counter_skill_id
  3654.     @counter_attacker.push(target)
  3655.   end
  3656.   #--------------------------------------------------------------------------
  3657.   # ● 魔法反射の発動 ★再定義
  3658.   #--------------------------------------------------------------------------
  3659.   def invoke_magic_reflection(target, item)
  3660.     return if @subject.sv.reflection_id != 0
  3661.     @log_window.add_text(sprintf(Vocab::MagicReflection, target.name)) if N03::BATTLE_LOG
  3662.     target.sv.reflection_id = target.sv.reflection_anime_id
  3663.   end
  3664.   #--------------------------------------------------------------------------
  3665.   # ● 身代わりの適用 ★再定義
  3666.   #--------------------------------------------------------------------------
  3667.   def apply_substitute(target, item)
  3668.     return target if @substitute == nil
  3669.     return target if !check_substitute(target, item)
  3670.     return @substitute
  3671.   end
  3672.   #--------------------------------------------------------------------------
  3673.   # ● 身代わりセット
  3674.   #--------------------------------------------------------------------------
  3675.   def set_substitute(item)
  3676.     @substitute = N03.get_enemy_unit(@subject).substitute_battler
  3677.     return if @substitute == nil
  3678.     s_targets = []
  3679.     for i in [email protected]
  3680.       next if @targets[i] == @substitute
  3681.       next if !check_substitute(@targets[i], item)
  3682.       @log_window.add_text(sprintf(Vocab::Substitute, @substitute.name, @targets[i].name))
  3683.       @targets[i].sv.start_action(@targets[i].sv.substitute_receiver_start_action)
  3684.       s_targets.push(@targets[i])
  3685.       @targets[i] = @substitute
  3686.     end
  3687.     return @substitute = nil if s_targets == []
  3688.     @substitute.sv.set_target(s_targets)
  3689.     @substitute.sv.start_action(@substitute.sv.substitute_start_action)
  3690.   end  
  3691.   #--------------------------------------------------------------------------
  3692.   # ● 身代わり終了
  3693.   #--------------------------------------------------------------------------
  3694.   def end_substitute
  3695.     for member in @substitute.sv.target_battler
  3696.       member.sv.start_action(member.sv.substitute_receiver_end_action)
  3697.     end  
  3698.     @substitute.sv.start_action(@substitute.sv.substitute_end_action)
  3699.     @substitute = nil
  3700.   end
  3701.   #--------------------------------------------------------------------------
  3702.   # ● 反撃
  3703.   #--------------------------------------------------------------------------
  3704.   def set_counter_attack
  3705.     pre_subject = @subject
  3706.     for attacker in @counter_attacker
  3707.       @subject = attacker
  3708.       item = $data_skills[attacker.sv.counter_skill_id]
  3709.       play_sideview([pre_subject], item)
  3710.     end
  3711.     # 同一カウンター者を考慮してカウンターIDの初期化はアクション後に実行
  3712.     for attacker in @counter_attacker do attacker.sv.counter_id = 0 end
  3713.     @subject = pre_subject
  3714.     @counter_attacker = nil
  3715.   end
  3716.   #--------------------------------------------------------------------------
  3717.   # ● 魔法反射
  3718.   #--------------------------------------------------------------------------
  3719.   def set_reflection(item)
  3720.     @log_window.back_to(1)
  3721.     for data in @reflection_data
  3722.       @subject.sv.damage_action(@subject, item)
  3723.       N03.set_damage_anime_data([@subject], @subject, data)
  3724.       apply_item_effects(@subject, item)
  3725.       @spriteset.set_damage_pop(@subject)
  3726.     end
  3727.     set_camera_wait(N03.get_anime_time(@reflection_data[0][0]))
  3728.     @reflection_data = nil
  3729.   end
  3730.   #--------------------------------------------------------------------------
  3731.   # ● サイドビューアクション実行
  3732.   #--------------------------------------------------------------------------
  3733.   def play_sideview(targets, item)
  3734.     @subject.sv.set_target(targets)
  3735.     return if @subject.sv.attack_action(item) == nil
  3736.     return if [email protected]?
  3737.     return if item.scope != 9 && item.scope != 10 && !N03.targets_alive?(targets)
  3738.     @subject.sv.start_action(@subject.sv.attack_action(item))
  3739.     @subject.sv.unshift_action(@subject.sv.flash_action) if @subject.flash_flg
  3740.     @subject.sv.active = true
  3741.     @subject.sv.command_action = false
  3742.     loop do
  3743.       update_basic
  3744.       data = @subject.sv.play_data
  3745.       @targets = N03.s_targets(@subject) if data[0] == "second_targets_set"
  3746.       N03.targets_set(@subject)          if data[0] == "targets_set"
  3747.       @immortal = N03.immortaling        if data[0] == "no_collapse" && !N03.dead_attack?(@subject, item)
  3748.       @immortal = N03.unimmortaling      if data[0] == "collapse"
  3749.       next set_move_anime(item)          if @subject.sv.m_a_data != []
  3750.       set_damage(item)                   if @subject.sv.set_damage
  3751.       break N03.derived_skill(@subject)  if @subject.sv.derivation_skill_id != 0
  3752.       break                              if @subject.sv.action_end or @subject.hidden?
  3753.     end
  3754.     @immortal = N03.unimmortaling        if @immortal
  3755.   end
  3756.   #--------------------------------------------------------------------------
  3757.   # ● ダメージの実行
  3758.   #--------------------------------------------------------------------------
  3759.   def set_damage(item)
  3760.     targets = @targets
  3761.     targets = [@subject.sv.individual_targets[0]] if @subject.sv.individual_targets.size != 0
  3762.     for target in targets do damage_anime(targets.dup, target, item) end
  3763.     @subject.sv.set_damage = false
  3764.     @subject.sv.damage_anime_data = []
  3765.   end
  3766.   #--------------------------------------------------------------------------
  3767.   # ● ダメージ戦闘アニメ処理
  3768.   #--------------------------------------------------------------------------
  3769.   def damage_anime(targets, target, item)
  3770.     @log_window.back_to(1) if @log_window.line_number == 5
  3771.     return if item.scope != 9 && item.scope != 10 && target.dead?
  3772.     @miss = false
  3773.     invoke_item(target,item)
  3774.     if target.result.missed
  3775.       target.sv.miss_action(@subject, item)
  3776.       return @miss = true
  3777.     elsif target.result.evaded or target.sv.counter_id != 0
  3778.       target.sv.evasion_action(@subject, item)
  3779.       return @miss = true
  3780.     elsif target.sv.reflection_id != 0
  3781.       N03.set_damage_anime_data(targets, target, [target.sv.reflection_id, false, false, true])
  3782.       target.sv.reflection_id = 0
  3783.       @reflection_data = [] if @reflection_data == nil
  3784.       return @reflection_data.push([N03.get_attack_anime_id(-3, @subject), false, false, true])
  3785.     end
  3786.     target.sv.damage_action(@subject, item)
  3787.     N03.set_damage(@subject, -target.result.hp_drain, -target.result.mp_drain) if target != @subject
  3788.     @spriteset.set_damage_pop(target)
  3789.     @spriteset.set_damage_pop(@subject) if target != @subject && @subject.result.hp_damage != 0 or @subject.result.mp_damage != 0
  3790.     N03.set_damage_anime_data(targets, target, @subject.sv.damage_anime_data) if @subject.sv.damage_anime_data != []
  3791.   end
  3792.   #--------------------------------------------------------------------------
  3793.   # ● 飛ばしアニメ処理
  3794.   #--------------------------------------------------------------------------
  3795.   def set_move_anime(item)
  3796.     for data in @subject.sv.m_a_data
  3797.       @subject.sv.damage_anime_data = data[4]
  3798.       hit_targets = []
  3799.       for target in data[1]
  3800.         damage_anime(data[1], target, item) if data[0]
  3801.         hit_targets.push(target) if !@miss
  3802.       end
  3803.       @miss = false if !data[3]
  3804.       @spriteset.set_hit_animation(@subject, data[2], hit_targets, @miss)
  3805.     end
  3806.     @subject.sv.set_damage = false
  3807.     @subject.sv.m_a_data = []
  3808.   end
  3809. end

  3810. #==============================================================================
  3811. # ■ DataManager
  3812. #------------------------------------------------------------------------------
  3813. #  データベースとゲームオブジェクトを管理するモジュールです。
  3814. #==============================================================================
  3815. module DataManager
  3816.   #--------------------------------------------------------------------------
  3817.   # ● 各種ゲームオブジェクトの作成 ★再定義
  3818.   #--------------------------------------------------------------------------
  3819.   def self.create_game_objects
  3820.     $game_temp          = Game_Temp.new
  3821.     $game_system        = Game_System.new
  3822.     $game_timer         = Game_Timer.new
  3823.     $game_message       = Game_Message.new
  3824.     $game_switches      = Game_Switches.new
  3825.     $game_variables     = Game_Variables.new
  3826.     $game_self_switches = Game_SelfSwitches.new
  3827.     $game_actors        = Game_Actors.new
  3828.     $game_party         = Game_Party.new
  3829.     $game_troop         = Game_Troop.new
  3830.     $game_map           = Game_Map.new
  3831.     $game_player        = Game_Player.new
  3832.     $sv_camera          = Battle_Camera.new
  3833.   end
  3834. end

  3835. #==============================================================================
  3836. # ■ BattleManager
  3837. #------------------------------------------------------------------------------
  3838. #  戦闘の進行を管理するモジュールです。
  3839. #==============================================================================
  3840. module BattleManager
  3841.   #--------------------------------------------------------------------------
  3842.   # ● エンカウント時の処理 ★再定義
  3843.   #--------------------------------------------------------------------------
  3844.   def self.on_encounter
  3845.     @preemptive = (rand < rate_preemptive)
  3846.     @surprise = (rand < rate_surprise && !@preemptive)
  3847.     $sv_camera.mirror = @surprise if N03::BACK_ATTACK
  3848.   end
  3849.   #--------------------------------------------------------------------------
  3850.   # ● 勝利の処理 ★再定義
  3851.   #--------------------------------------------------------------------------
  3852.   def self.process_victory
  3853.     $sv_camera.win_wait = true
  3854.   end  
  3855.   #--------------------------------------------------------------------------
  3856.   # ● 勝利
  3857.   #--------------------------------------------------------------------------
  3858.   def self.victory
  3859.     $sv_camera.win_wait = false
  3860.     N03.camera(nil, N03::BATTLE_CAMERA["戦闘終了時"].dup)
  3861.     for member in $game_party.members do member.sv.start_action(member.sv.win) if member.movable? end
  3862.     play_battle_end_me
  3863.     replay_bgm_and_bgs
  3864.     $game_message.add(sprintf(Vocab::Victory, $game_party.name))
  3865.     display_exp
  3866.     gain_gold
  3867.     gain_drop_items
  3868.     gain_exp
  3869.     SceneManager.return
  3870.     battle_end(0)
  3871.     return true
  3872.   end
  3873.   #--------------------------------------------------------------------------
  3874.   # ● 逃走の処理 ★再定義
  3875.   #--------------------------------------------------------------------------
  3876.   def self.process_escape
  3877.     $game_message.add(sprintf(Vocab::EscapeStart, $game_party.name))
  3878.     success = @preemptive ? true : (rand < @escape_ratio)
  3879.     Sound.play_escape
  3880.     if success
  3881.       process_abort
  3882.       for member in $game_party.members do member.sv.start_action(member.sv.escape) if member.movable? end
  3883.     else
  3884.       @escape_ratio += 0.1
  3885.       $game_message.add('\.' + Vocab::EscapeFailure)
  3886.       $game_party.clear_actions
  3887.       for member in $game_party.members do member.sv.start_action(member.sv.escape_ng) if member.movable? end
  3888.     end
  3889.     wait_for_message
  3890.     return success
  3891.   end
  3892.   #--------------------------------------------------------------------------
  3893.   # ● 次のコマンド入力へ ★再定義
  3894.   #--------------------------------------------------------------------------
  3895.   def self.next_command
  3896.     begin
  3897.       if !actor || !actor.next_command
  3898.         $game_party.battle_members[@actor_index].sv.command_action = true
  3899.         @actor_index += 1
  3900.         if @actor_index >= $game_party.members.size
  3901.           for member in $game_party.battle_members.reverse
  3902.             break member.sv.start_action(member.sv.command_a) if member.inputable?
  3903.           end
  3904.           return false
  3905.         end
  3906.       end
  3907.     end until actor.inputable?
  3908.     actor.sv.start_action(actor.sv.command_b) if actor != nil && actor.inputable?
  3909.     if pre_actor
  3910.       pre_actor.sv.start_action(pre_actor.sv.command_a) if pre_actor != nil && pre_actor.inputable?
  3911.     end
  3912.     return true
  3913.   end
  3914.   #--------------------------------------------------------------------------
  3915.   # ● 前のコマンド入力へ ★再定義
  3916.   #--------------------------------------------------------------------------
  3917.   def self.prior_command
  3918.     begin
  3919.       if !actor || !actor.prior_command
  3920.         $game_party.battle_members[@actor_index].sv.command_action = false
  3921.         @actor_index -= 1
  3922.         if @actor_index < 0
  3923.           for member in $game_party.battle_members
  3924.             break member.sv.start_action(member.sv.command_a) if member.inputable?
  3925.           end
  3926.           return false
  3927.         end
  3928.       end
  3929.     end until actor.inputable?
  3930.     actor.make_actions if actor.inputable?
  3931.     actor.sv.start_action(actor.sv.command_b) if actor.inputable?
  3932.     after_actor.sv.start_action(after_actor.sv.command_a) if after_actor != nil && after_actor.inputable?
  3933.     return true
  3934.   end
  3935.   #--------------------------------------------------------------------------
  3936.   # ● コマンド入力前のアクターを取得
  3937.   #--------------------------------------------------------------------------
  3938.   def self.pre_actor
  3939.     return if @actor_index == 0
  3940.     $game_party.members[@actor_index - 1]
  3941.   end
  3942.   #--------------------------------------------------------------------------
  3943.   # ● コマンド入力後のアクターを取得
  3944.   #--------------------------------------------------------------------------
  3945.   def self.after_actor
  3946.     $game_party.members[@actor_index + 1]
  3947.   end
  3948.   #--------------------------------------------------------------------------
  3949.   # ● 戦闘行動者を前に追加
  3950.   #--------------------------------------------------------------------------
  3951.   def self.unshift_action_battlers(battler)
  3952.     @action_battlers.unshift(battler)
  3953.   end
  3954. end  

  3955. #==============================================================================
  3956. # ■ Game_Battler
  3957. #------------------------------------------------------------------------------
  3958. #  スプライトや行動に関するメソッドを追加したバトラーのクラスです。
  3959. #==============================================================================
  3960. class Game_Battler < Game_BattlerBase
  3961.   #--------------------------------------------------------------------------
  3962.   # ● 公開インスタンス変数
  3963.   #--------------------------------------------------------------------------
  3964.   attr_reader   :sv                     # サイドビューデータ
  3965.   attr_accessor :flash_flg              # 閃きフラグ
  3966.   #--------------------------------------------------------------------------
  3967.   # ● オブジェクト初期化
  3968.   #--------------------------------------------------------------------------
  3969.   alias initialize_game_battler_n03 initialize
  3970.   def initialize
  3971.     initialize_game_battler_n03
  3972.     @sv = SideView.new(self)
  3973.   end
  3974.   #--------------------------------------------------------------------------
  3975.   # ● 現在の戦闘行動を除去
  3976.   #--------------------------------------------------------------------------
  3977.   alias remove_current_action_game_battler_n03 remove_current_action
  3978.   def remove_current_action
  3979.     return @sv.derivation_skill_id = 0 if @sv.derivation_skill_id != 0
  3980.     remove_current_action_game_battler_n03
  3981.   end
  3982.   #--------------------------------------------------------------------------
  3983.   # ● ターン終了処理
  3984.   #--------------------------------------------------------------------------
  3985.   alias on_turn_end_game_battler_n03 on_turn_end
  3986.   def on_turn_end
  3987.     on_turn_end_game_battler_n03
  3988.     @sv.add_state = []
  3989.     @sv.result_damage = [@result.hp_damage, @result.mp_damage]
  3990.   end
  3991.   #--------------------------------------------------------------------------
  3992.   # ● パラメータ条件比較 data = [種別, 数値, 判別]
  3993.   #--------------------------------------------------------------------------
  3994.   def comparison_parameter(data)
  3995.     return true if data[0][0] == 0
  3996.     kind = data[0]
  3997.     num = data[1]
  3998.     select = data[2]
  3999.     case kind
  4000.     when  1 ; par = level
  4001.     when  2 ; par = mhp
  4002.     when  3 ; par = mmp
  4003.     when  4 ; par = hp
  4004.     when  5 ; par = mp
  4005.     when  6 ; par = tp
  4006.     when  7 ; par = atk
  4007.     when  8 ; par = self.def
  4008.     when  9 ; par = mat
  4009.     when 10 ; par = mdf
  4010.     when 11 ; par = agi
  4011.     when 12 ; par = luk
  4012.     end
  4013.     if num < 0
  4014.       case kind
  4015.       when  4 ; num = mhp * num / 100
  4016.       when  5 ; num = mmp * num / 100
  4017.       when  6 ; num = max_tp * num / 100
  4018.       end
  4019.       num = num.abs
  4020.     end  
  4021.     case select
  4022.     when  0 ; return par == num
  4023.     when  1 ; return par < num
  4024.     when  2 ; return par > num
  4025.     end
  4026.   end
  4027.   #--------------------------------------------------------------------------
  4028.   # ● 装備条件比較 data = [装備種別, タイプID]
  4029.   #--------------------------------------------------------------------------
  4030.   def comparison_equip(data)
  4031.     kind = data[0]
  4032.     items = weapons if kind == 0
  4033.     items = armors  if kind == 1
  4034.     for item in items
  4035.       for id in data[1]
  4036.         return true if id > 0 && item.is_a?(RPG::Weapon) && item == $data_weapons[id.abs]
  4037.         return true if id > 0 && item.is_a?(RPG::Armor) && item == $data_armors[id.abs]
  4038.         return true if id < 0 && item.is_a?(RPG::Weapon) && item.wtype_id == id.abs
  4039.         return true if id < 0 && item.is_a?(RPG::Armor) && item.stype_id == id.abs
  4040.       end
  4041.     end
  4042.     return false
  4043.   end
  4044.   
  4045. end  
  4046. #==============================================================================
  4047. # ■ Game_Actor
  4048. #------------------------------------------------------------------------------
  4049. #  アクターを扱うクラスです。
  4050. #==============================================================================
  4051. class Game_Actor < Game_Battler
  4052.   #--------------------------------------------------------------------------
  4053.   # ● 公開インスタンス変数
  4054.   #--------------------------------------------------------------------------
  4055.   attr_reader :actor_id                    # ID
  4056.   #--------------------------------------------------------------------------
  4057.   # ● ID
  4058.   #--------------------------------------------------------------------------
  4059.   def id
  4060.     return @actor_id
  4061.   end
  4062.   #--------------------------------------------------------------------------
  4063.   # ● スプライトを使うか? ★再定義
  4064.   #--------------------------------------------------------------------------
  4065.   def use_sprite?
  4066.     return true
  4067.   end
  4068.   #--------------------------------------------------------------------------
  4069.   # ● ダメージ効果の実行 ★再定義
  4070.   #--------------------------------------------------------------------------
  4071.   def perform_damage_effect
  4072.     return if !N03::ACTOR_DAMAGE
  4073.     $game_troop.screen.start_shake(5, 5, 10)
  4074.     @sprite_effect_type = :blink
  4075.     Sound.play_actor_damage
  4076.   end
  4077.   
  4078. end

  4079. #==============================================================================
  4080. # ■ Game_Enemy
  4081. #------------------------------------------------------------------------------
  4082. #  敵キャラを扱うクラスです。
  4083. #==============================================================================
  4084. class Game_Enemy < Game_Battler
  4085.   #--------------------------------------------------------------------------
  4086.   # ● 公開インスタンス変数
  4087.   #--------------------------------------------------------------------------
  4088.   attr_reader :enemy_id                    # ID
  4089.   #--------------------------------------------------------------------------
  4090.   # ● ID
  4091.   #--------------------------------------------------------------------------
  4092.   def id
  4093.     return @enemy_id
  4094.   end
  4095.   #--------------------------------------------------------------------------
  4096.   # ● レベル
  4097.   #--------------------------------------------------------------------------
  4098.   def level
  4099.     return @sv.level
  4100.   end
  4101.   #--------------------------------------------------------------------------
  4102.   # ● ダメージ効果の実行 ★再定義
  4103.   #--------------------------------------------------------------------------
  4104.   def perform_damage_effect
  4105.     return if !N03::ENEMY_DAMAGE
  4106.     @sprite_effect_type = :blink
  4107.     Sound.play_enemy_damage
  4108.   end
  4109.   #--------------------------------------------------------------------------
  4110.   # ● 武器
  4111.   #--------------------------------------------------------------------------
  4112.   def weapons
  4113.     weapon1 = $data_weapons[@sv.enemy_weapon1_id]
  4114.     weapon2 = $data_weapons[@sv.enemy_weapon2_id]
  4115.     return [weapon1, weapon2]
  4116.   end
  4117.   #--------------------------------------------------------------------------
  4118.   # ● 防具
  4119.   #--------------------------------------------------------------------------
  4120.   def armors
  4121.     return [$data_armors[@sv.enemy_shield_id]]
  4122.   end
  4123.   #--------------------------------------------------------------------------
  4124.   # ● 二刀流の判定
  4125.   #--------------------------------------------------------------------------
  4126.   def dual_wield?
  4127.     return $data_weapons[@sv.enemy_weapon2_id] != nil
  4128.   end
  4129.   #--------------------------------------------------------------------------
  4130.   # ● バトラー画像変更
  4131.   #--------------------------------------------------------------------------
  4132.   def graphics_change(battler_name)
  4133.     @battler_name = battler_name
  4134.   end
  4135.   #--------------------------------------------------------------------------
  4136.   # ● 通常攻撃 アニメーション ID の取得
  4137.   #--------------------------------------------------------------------------
  4138.   def atk_animation_id1
  4139.     return weapons[0].animation_id if weapons[0]
  4140.     return weapons[1] ? 0 : 1
  4141.   end
  4142.   #--------------------------------------------------------------------------
  4143.   # ● 通常攻撃 アニメーション ID の取得(二刀流:武器2)
  4144.   #--------------------------------------------------------------------------
  4145.   def atk_animation_id2
  4146.     return weapons[1] ? weapons[1].animation_id : 0
  4147.   end
  4148. end

  4149. #==============================================================================
  4150. # ■ Sprite_Base
  4151. #------------------------------------------------------------------------------
  4152. #  アニメーションの表示処理を追加したスプライトのクラスです。
  4153. #==============================================================================
  4154. class Sprite_Base < Sprite
  4155.   #--------------------------------------------------------------------------
  4156.   # ● アニメーションの座標更新 (ホーミングあり)
  4157.   #--------------------------------------------------------------------------
  4158.   def update_animation_position_horming
  4159.     return if @action_end_cancel
  4160.     ani_ox_set if @horming
  4161.     camera_zoom = $sv_camera.zoom
  4162.     camera_zoom = 1 if @move_anime
  4163.     kind = 1
  4164.     kind = -1 if @ani_mirror && !@anime_no_mirror
  4165.     cell_data = @animation.frames[@animation.frame_max - (@ani_duration + @ani_rate - 1) / @ani_rate].cell_data
  4166.     for i in 0..15
  4167.       @ani_sprites[i].x = (@ani_ox + cell_data[i, 1] * kind - $sv_camera.x) * camera_zoom if @ani_sprites[i] != nil && cell_data[i, 1] != nil
  4168.       @ani_sprites[i].y = (@ani_oy + cell_data[i, 2] - $sv_camera.y) * camera_zoom if @ani_sprites[i] != nil && cell_data[i, 2] != nil
  4169.     end
  4170.   end
  4171.   #--------------------------------------------------------------------------
  4172.   # ● アニメーション元の座標をセット
  4173.   #--------------------------------------------------------------------------
  4174.   def ani_ox_set
  4175.     if !SceneManager.scene_is?(Scene_Battle)
  4176.       @real_x = x
  4177.       @real_y = y
  4178.     end
  4179.     @ani_ox = @real_x - ox + width / 2
  4180.     @ani_oy = @real_y - oy + height / 2
  4181.     @ani_oy -= height / 2 if @animation.position == 0
  4182.     @ani_oy += height / 2 if @animation.position == 2
  4183.   end
  4184.   #--------------------------------------------------------------------------
  4185.   # ● アニメーションの更新
  4186.   #--------------------------------------------------------------------------
  4187.   alias update_animation_sprite_base_n03 update_animation
  4188.   def update_animation
  4189.     update_animation_position_horming if animation? && SceneManager.scene_is?(Scene_Battle) && @animation.position != 3
  4190.     update_animation_sprite_base_n03
  4191.   end
  4192.   #--------------------------------------------------------------------------
  4193.   # ● アニメーションの原点設定 ★再定義
  4194.   #--------------------------------------------------------------------------
  4195.   def set_animation_origin
  4196.     return ani_ox_set if @animation.position != 3
  4197.     if viewport == nil
  4198.       @ani_ox = Graphics.width / 2
  4199.       @ani_oy = Graphics.height / 2
  4200.     else
  4201.       @ani_ox = viewport.rect.width / 2
  4202.       @ani_oy = viewport.rect.height / 2
  4203.     end
  4204.   end
  4205.   #--------------------------------------------------------------------------
  4206.   # ● アニメーションスプライトの設定 ★再定義
  4207.   #--------------------------------------------------------------------------
  4208.   def animation_set_sprites(frame)
  4209.     camera_zoom = 1
  4210.     camera_zoom = $sv_camera.zoom if @anime_camera_zoom && @animation.position != 3 && SceneManager.scene_is?(Scene_Battle)
  4211.     camera_x = $sv_camera.x
  4212.     camera_y = $sv_camera.y
  4213.     camera_x = camera_y = 0 if @animation.position == 3 or !SceneManager.scene_is?(Scene_Battle)
  4214.     plus_z = 5
  4215.     plus_z = 1000 if @animation.position == 3
  4216.     plus_z = -17 if @plus_z != nil && @plus_z == false
  4217.     plus_z = -self.z + 10 if @plus_z != nil && @plus_z == false && @animation.position == 3
  4218.     cell_data = frame.cell_data
  4219.     @ani_sprites.each_with_index do |sprite, i|
  4220.       next unless sprite
  4221.       pattern = cell_data[i, 0]
  4222.       if !pattern || pattern < 0
  4223.         sprite.visible = false
  4224.         next
  4225.       end
  4226.       sprite.bitmap = pattern < 100 ? @ani_bitmap1 : @ani_bitmap2
  4227.       sprite.visible = true
  4228.       sprite.src_rect.set(pattern % 5 * 192,
  4229.         pattern % 100 / 5 * 192, 192, 192)
  4230.       if @ani_mirror && !@anime_no_mirror
  4231.         sprite.x = (@ani_ox - cell_data[i, 1] - camera_x) * camera_zoom
  4232.         sprite.y = (@ani_oy + cell_data[i, 2] - camera_y) * camera_zoom
  4233.         sprite.angle = (360 - cell_data[i, 4])
  4234.         sprite.mirror = (cell_data[i, 5] == 0)
  4235.       else
  4236.         sprite.x = (@ani_ox + cell_data[i, 1] - camera_x) * camera_zoom
  4237.         sprite.y = (@ani_oy + cell_data[i, 2] - camera_y) * camera_zoom
  4238.         sprite.angle = cell_data[i, 4]
  4239.         sprite.mirror = (cell_data[i, 5] == 1)
  4240.       end
  4241.       sprite.z = self.z + plus_z + i
  4242.       sprite.ox = 96
  4243.       sprite.oy = 96
  4244.       sprite.zoom_x = cell_data[i, 3] * camera_zoom / 100.0
  4245.       sprite.zoom_y = cell_data[i, 3] * camera_zoom/ 100.0
  4246.       sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
  4247.       sprite.blend_type = cell_data[i, 7]
  4248.     end
  4249.   end
  4250.   #--------------------------------------------------------------------------
  4251.   # ● 子スプライトフラグ
  4252.   #--------------------------------------------------------------------------
  4253.   def set(battler, horming, camera_zoom, no_mirror)
  4254.     @battler = battler
  4255.     @next = true
  4256.     self.bitmap = Bitmap.new(@battler.sv.cw, @battler.sv.ch)
  4257.     self.ox = bitmap.width / 2
  4258.     self.oy = bitmap.height
  4259.     @horming = horming
  4260.     @anime_camera_zoom = camera_zoom
  4261.     @anime_no_mirror = no_mirror
  4262.     @battler.sv.reset_anime_data
  4263.   end  
  4264.   #--------------------------------------------------------------------------
  4265.   # ● 子スプライト座標セット
  4266.   #--------------------------------------------------------------------------
  4267.   def set_position(z, zoom_x, zoom_y, real_x, real_y)
  4268.     self.z = z
  4269.     self.zoom_x = zoom_x
  4270.     self.zoom_y = zoom_y
  4271.     @real_x = real_x
  4272.     @real_y = real_y
  4273.   end
  4274.   #--------------------------------------------------------------------------
  4275.   # ● 他スプライトへのタイミング処理
  4276.   #--------------------------------------------------------------------------
  4277.   def other_process_timing(timing)
  4278.     se_flag = true
  4279.     se_flag = @se_flag if @se_flag != nil
  4280.     @battler.sv.timing.push([se_flag, timing.dup])
  4281.   end
  4282.   #--------------------------------------------------------------------------
  4283.   # ● 他バトラーへのタイミング処理
  4284.   #--------------------------------------------------------------------------
  4285.   def target_battler_process_timing(timing)
  4286.     for target in @timing_targets
  4287.       target.sv.timing.push([false, timing.dup])
  4288.     end  
  4289.   end
  4290.   #--------------------------------------------------------------------------
  4291.   # ● SE とフラッシュのタイミング処理
  4292.   #--------------------------------------------------------------------------
  4293.   alias animation_process_timing_sprite_base_n03 animation_process_timing
  4294.   def animation_process_timing(timing)
  4295.     target_battler_process_timing(timing) if @timing_targets && @timing_targets != []
  4296.     return other_process_timing(timing) if @next != nil
  4297.     animation_process_timing_sprite_base_n03(timing)
  4298.   end
  4299.   #--------------------------------------------------------------------------
  4300.   # ● アニメーションの解放
  4301.   #--------------------------------------------------------------------------
  4302.   alias dispose_animation_sprite_base_n03 dispose_animation
  4303.   def dispose_animation
  4304.     dispose_animation_sprite_base_n03
  4305.   end
  4306. end


  4307. #==============================================================================
  4308. # ■ Sprite_Battler
  4309. #------------------------------------------------------------------------------
  4310. #  バトラー表示用のスプライトです。
  4311. #==============================================================================
  4312. class Sprite_Battler < Sprite_Base
  4313.   #--------------------------------------------------------------------------
  4314.   # ● 公開インスタンス変数 
  4315.   #--------------------------------------------------------------------------
  4316.   attr_accessor   :removing             # パーティ離脱中
  4317.   #--------------------------------------------------------------------------
  4318.   # ● オブジェクト初期化
  4319.   #--------------------------------------------------------------------------
  4320.   alias initialize_sprite_battler_n03 initialize
  4321.   def initialize(viewport, battler = nil)
  4322.     initialize_sprite_battler_n03(viewport, battler)
  4323.     @real_x = @real_y = 0
  4324.     update_bitmap if @battler != nil
  4325.   end
  4326.   #--------------------------------------------------------------------------
  4327.   # ● アニメーションの開始 ★再定義
  4328.   #--------------------------------------------------------------------------
  4329.   def start_animation(animation, mirror = false)
  4330.     return next_animation(animation, mirror) if animation?
  4331.     @animation = animation
  4332.     if @animation
  4333.       @horming = @battler.sv.anime_horming
  4334.       @anime_camera_zoom = @battler.sv.anime_camera_zoom
  4335.       @anime_no_mirror = @battler.sv.anime_no_mirror
  4336.       @timing_targets = @battler.sv.timing_targets
  4337.       @plus_z = @battler.sv.anime_plus_z
  4338.       @battler.sv.reset_anime_data
  4339.       @ani_mirror = mirror
  4340.       set_animation_rate
  4341.       @ani_duration = @animation.frame_max * @ani_rate + 1
  4342.       load_animation_bitmap
  4343.       make_animation_sprites
  4344.       set_animation_origin
  4345.     end
  4346.   end
  4347.   #--------------------------------------------------------------------------
  4348.   # ● 次のアニメを開始
  4349.   #--------------------------------------------------------------------------
  4350.   def next_animation(animation, mirror)
  4351.     @next_anime = [] if @next_anime == nil
  4352.     @next_anime.push(Sprite_Base.new(viewport))
  4353.     @next_anime[@next_anime.size - 1].set(battler, @battler.sv.anime_horming, @battler.sv.anime_camera_zoom, @battler.sv.anime_no_mirror)
  4354.     @next_anime[@next_anime.size - 1].set_position(self.z, self.zoom_x, self.zoom_y, @real_x, @real_y)
  4355.     @next_anime[@next_anime.size - 1].start_animation(animation, mirror)
  4356.   end
  4357.   #--------------------------------------------------------------------------
  4358.   # ● 影グラフィック作成
  4359.   #--------------------------------------------------------------------------
  4360.   def create_shadow
  4361.     reset_shadow
  4362.     return if @battler.sv.shadow == false
  4363.     @shadow = Sprite.new(viewport) if @shadow == nil
  4364.     @shadow.bitmap = Cache.character(@battler.sv.shadow)
  4365.     @shadow.ox = @shadow.bitmap.width / 2
  4366.     @shadow.oy = @shadow.bitmap.height / 2
  4367.   end
  4368.   #--------------------------------------------------------------------------
  4369.   # ● 影グラフィック初期化
  4370.   #--------------------------------------------------------------------------
  4371.   def reset_shadow
  4372.     return if @shadow == nil
  4373.     @shadow.dispose
  4374.     @shadow = nil
  4375.   end  
  4376.   #--------------------------------------------------------------------------
  4377.   # ● 転送元ビットマップの更新 ★再定義
  4378.   #--------------------------------------------------------------------------
  4379.   def update_bitmap
  4380.     update_bitmap_enemy if [email protected]?
  4381.     update_bitmap_actor if @battler.actor?
  4382.     update_src_rect if @battler != nil
  4383.     update_color if @battler != nil
  4384.   end
  4385.   #--------------------------------------------------------------------------
  4386.   # ● 転送元ビットマップ:エネミー
  4387.   #--------------------------------------------------------------------------
  4388.   def update_bitmap_enemy
  4389.     if @battler.battler_name != @battler_name or @battler.battler_hue != @battler_hue
  4390.       @battler_name = @battler.battler_name
  4391.       @battler_hue = @battler.battler_hue
  4392.       @battler_graphic_file_index = @battler.sv.graphic_file_index
  4393.       @graphic_mirror_flag = @battler.sv.graphic_mirror_flag
  4394.       self.bitmap = Cache.battler(@battler_name + @battler_graphic_file_index, @battler_hue)
  4395.       @battler.sv.setup(self.bitmap.width, self.bitmap.height, @battler_id != @battler.id)
  4396.       create_shadow
  4397.       init_visibility
  4398.       @battler_id = @battler.id
  4399.     end
  4400.   end  
  4401.   #--------------------------------------------------------------------------
  4402.   # ● 転送元ビットマップ:アクター
  4403.   #--------------------------------------------------------------------------
  4404.   def update_bitmap_actor
  4405.     if @battler.character_name != @battler_name or @battler.character_index != @battler_index
  4406.       @battler_name = @battler.character_name
  4407.       @battler_index = @battler.character_index
  4408.       @battler_graphic_file_index = @battler.sv.graphic_file_index
  4409.       @graphic_mirror_flag = @battler.sv.graphic_mirror_flag
  4410.       self.bitmap = Cache.character(@battler_name + @battler_graphic_file_index)
  4411.       @battler.sv.setup(self.bitmap.width, self.bitmap.height, @battler_id != @battler.id)
  4412.       create_shadow
  4413.       init_visibility
  4414.       @battler_id = @battler.id
  4415.     end
  4416.   end
  4417.   #--------------------------------------------------------------------------
  4418.   # ● 可視状態の初期化 ★再定義
  4419.   #--------------------------------------------------------------------------
  4420.   def init_visibility
  4421.     @battler_visible = @battler.alive?
  4422.     @battler_visible = true if @battler.sv.state(1) != "敵コラプス"
  4423.     @battler_visible = false if @battler.hidden?
  4424.     @battler.sv.opacity = 0 unless @battler_visible
  4425.     self.opacity = 0 unless @battler_visible
  4426.     self.opacity = 255 if @battler_visible
  4427.     @battler.sv.weapon_visible = @battler_visible
  4428.   end
  4429.   #--------------------------------------------------------------------------
  4430.   # ● 転送元矩形の更新
  4431.   #--------------------------------------------------------------------------
  4432.   def update_src_rect
  4433.     return if @battler.sv.collapse
  4434.     if @battler_graphic_file_index != @battler.sv.graphic_file_index
  4435.       @battler_graphic_file_index = @battler.sv.graphic_file_index
  4436.       self.bitmap = Cache.character(@battler_name + @battler_graphic_file_index) if @battler.actor?
  4437.       self.bitmap = Cache.battler(@battler_name + @battler_graphic_file_index, @battler_hue) if [email protected]?
  4438.       @battler.sv.set_graphics(self.bitmap.width, self.bitmap.height)
  4439.     end
  4440.     anime_off if @battler.sv.anime_off
  4441.     self.src_rect.set(@battler.sv.sx, @battler.sv.sy, @battler.sv.cw, @battler.sv.ch)
  4442.     self.opacity = @battler.sv.opacity if @battler_visible
  4443.     set_process_timing(@battler.sv.timing) if @battler && @battler.sv.timing != []
  4444.   end
  4445.   #--------------------------------------------------------------------------
  4446.   # ● 位置の更新 ★再定義
  4447.   #--------------------------------------------------------------------------
  4448.   def update_position
  4449.     @real_x = @battler.sv.x / 100
  4450.     @real_y = (@battler.sv.y - @battler.sv.h - @battler.sv.j - @battler.sv.c - @battler.sv.oy_adjust)/ 100
  4451.     self.x = @real_x - $sv_camera.x
  4452.     self.y = @real_y - $sv_camera.y
  4453.     self.z = @battler.sv.z - @battler.sv.c / 100
  4454.     if @battler.sv.h <= 0
  4455.       self.x += $sv_camera.sx / 100
  4456.       self.y += $sv_camera.sy / 100
  4457.     end  
  4458.     self.x *= $sv_camera.zoom
  4459.     self.y *= $sv_camera.zoom
  4460.   end
  4461.   #--------------------------------------------------------------------------
  4462.   # ● 原点の更新 ★再定義
  4463.   #--------------------------------------------------------------------------
  4464.   def update_origin
  4465.     return if !bitmap or @battler.sv.collapse
  4466.     self.ox = @battler.sv.ox
  4467.     self.oy = @battler.sv.oy
  4468.     self.angle = @battler.sv.angle
  4469.     self.zoom_x = @battler.sv.zoom_x * $sv_camera.zoom
  4470.     self.zoom_y = @battler.sv.zoom_y * $sv_camera.zoom
  4471.     self.mirror = @battler.sv.mirror if !@graphic_mirror_flag
  4472.     self.mirror = [email protected] if @graphic_mirror_flag
  4473.   end
  4474.   #--------------------------------------------------------------------------
  4475.   # ● 影グラフィックの更新
  4476.   #--------------------------------------------------------------------------
  4477.   def update_shadow
  4478.     @shadow.visible = @battler.sv.shadow_visible
  4479.     @shadow.opacity = @battler.sv.opacity if @battler.sv.opacity_data[3]
  4480.     @shadow.opacity = self.opacity if [email protected]_data[3]
  4481.     @shadow.x = @real_x - $sv_camera.x
  4482.     @shadow.y = (@battler.sv.y - @battler.sv.c)/ 100 - $sv_camera.y
  4483.     @shadow.z = @battler.sv.z - 10
  4484.     @shadow.zoom_x = $sv_camera.zoom
  4485.     @shadow.zoom_y = $sv_camera.zoom
  4486.     @shadow.x += $sv_camera.sx / 100
  4487.     @shadow.y += $sv_camera.sy / 100
  4488.     @shadow.x *= $sv_camera.zoom
  4489.     @shadow.y *= $sv_camera.zoom
  4490.     @shadow.color.set(@color_data[0], @color_data[1], @color_data[2], @color_data[3]) if @color_data != nil
  4491.   end
  4492.   #--------------------------------------------------------------------------
  4493.   # ● ふきだしの更新
  4494.   #--------------------------------------------------------------------------
  4495.   def update_balloon
  4496.     if @battler.sv.balloon_data == [] && @balloon
  4497.       @balloon_data = []
  4498.       @balloon.dispose
  4499.       return @balloon = nil
  4500.     elsif @battler.sv.balloon_data != [] && @battler.sv.balloon_data != @balloon_data
  4501.       @balloon_data = @battler.sv.balloon_data
  4502.       @balloon = Sprite.new(self.viewport)
  4503.       @balloon.bitmap = Cache.system("Balloon")
  4504.       @balloon.zoom_x = @balloon_data[3]
  4505.       @balloon.zoom_y = @balloon_data[3]
  4506.       @balloon.ox = 32 if @battler.sv.mirror
  4507.       @balloon.oy = 16
  4508.       @balloon_count = 0
  4509.     end
  4510.     return if !@balloon
  4511.     @balloon.opacity = self.opacity
  4512.     @balloon.x = self.x
  4513.     @balloon.y = self.y - @battler.sv.ch * $sv_camera.zoom
  4514.     @balloon.z = self.z + 20
  4515.     @balloon.src_rect.set(32 + @balloon_count / @balloon_data[2] * 32, @balloon_data[1] * 32, 32, 32) if @balloon_count % @balloon_data[2] == 0
  4516.     @balloon.color.set(@color_data[0], @color_data[1], @color_data[2], @color_data[3]) if @color_data != nil
  4517.     @balloon_count += 1
  4518.     @balloon_count = 0 if @balloon_count == @balloon_data[2] * 7
  4519.   end
  4520.   #--------------------------------------------------------------------------
  4521.   # ● 色調変更の更新
  4522.   #--------------------------------------------------------------------------
  4523.   def update_color
  4524.     color_set if @battler.sv.color_set != []
  4525.     return if @color_data == nil
  4526.     @color_data[4] -= 1
  4527.     if @color_data[4] == 0 && @color_data[5] != 0
  4528.       @color_data[4] = @color_data[5]
  4529.       @color_data[5] = 0
  4530.       @color_data[6] = [0,0,0,0]
  4531.     elsif @color_data[4] == 0
  4532.       @remain_color_data = @color_data
  4533.       @battler.sv.color = @color_data.dup
  4534.       return @color_data = nil
  4535.     end  
  4536.     for i in 0..3
  4537.       @color_data[i] = (@color_data[i] * (@color_data[4] - 1) + @color_data[6][i]) / @color_data[4]
  4538.     end  
  4539.     @battler.sv.color = @color_data.dup
  4540.     self.color.set(@color_data[0], @color_data[1], @color_data[2], @color_data[3])
  4541.   end
  4542.   #--------------------------------------------------------------------------
  4543.   # ● 残像の更新
  4544.   #--------------------------------------------------------------------------
  4545.   def update_mirage
  4546.     if @battler.sv.mirage == [] && @mirages
  4547.       @mirage_data = []
  4548.       for mirage in @mirages do mirage.dispose end
  4549.       return @mirages = nil
  4550.     elsif @battler.sv.mirage != [] && @battler.sv.mirage != @mirage_data
  4551.       @mirage_data = @battler.sv.mirage
  4552.       @mirages = []
  4553.       for i in 0...@mirage_data[1] do @mirages[i] = Sprite.new(self.viewport) end
  4554.       @mirage_count = 0
  4555.     end
  4556.     return if !@mirages
  4557.     @mirage_count += 1
  4558.     @mirage_count = 0 if @mirage_count == @mirage_data[2] * @mirages.size
  4559.     for i in [email protected]
  4560.       mirage_body(@mirages[i], @mirage_data[4]) if @mirage_count == 1 + i * @mirage_data[2]
  4561.     end
  4562.   end
  4563.   #--------------------------------------------------------------------------
  4564.   # ● 残像本体
  4565.   #--------------------------------------------------------------------------
  4566.   def mirage_body(body, opacity)
  4567.     body.bitmap = self.bitmap.dup
  4568.     body.x = self.x
  4569.     body.y = self.y
  4570.     body.ox = self.ox
  4571.     body.oy = self.oy
  4572.     body.z = self.z - 20
  4573.     body.mirror = self.mirror
  4574.     body.angle = self.angle
  4575.     body.opacity = opacity * self.opacity / 255
  4576.     body.zoom_x = self.zoom_x
  4577.     body.zoom_y = self.zoom_y   
  4578.     body.src_rect.set(@battler.sv.sx, @battler.sv.sy, @battler.sv.cw, @battler.sv.ch)
  4579.     body.color.set(@color_data[0], @color_data[1], @color_data[2], @color_data[3]) if @color_data != nil
  4580.   end   
  4581.   #--------------------------------------------------------------------------
  4582.   # ● 次のアニメを更新
  4583.   #--------------------------------------------------------------------------
  4584.   def update_next_anime
  4585.     return if !@next_anime
  4586.     for anime in @next_anime
  4587.       anime.update
  4588.       anime.set_position(self.z, self.zoom_x, self.zoom_y, @real_x, @real_y) if @horming
  4589.       anime.dispose if !anime.animation?
  4590.       @next_anime.delete(anime) if !anime.animation?
  4591.     end  
  4592.   end
  4593.   #--------------------------------------------------------------------------
  4594.   # ● フレーム更新
  4595.   #--------------------------------------------------------------------------
  4596.   alias update_sprite_battler_n03 update
  4597.   def update
  4598.     @battler.sv.update if @battler
  4599.     update_sprite_battler_n03
  4600.     update_next_anime
  4601.     update_shadow  if @battler && @shadow
  4602.     update_mirage  if @battler
  4603.     update_balloon if @battler
  4604.     update_remove if @battler && @removing && @battler.sv.change_up
  4605.   end
  4606.   #--------------------------------------------------------------------------
  4607.   # ● 戦闘アニメ消去
  4608.   #--------------------------------------------------------------------------
  4609.   def anime_off
  4610.     @battler.sv.anime_off = false
  4611.     dispose_animation
  4612.     for anime in @next_anime do anime.dispose_animation end if @next_anime
  4613.   end
  4614.   #--------------------------------------------------------------------------
  4615.   # ● バトラー入れ替え
  4616.   #--------------------------------------------------------------------------
  4617.   def remove
  4618.     @battler.sv.start_action(@battler.sv.remove_action)
  4619.     $sv_camera.wait = 40
  4620.     @battler.sv.add_action("eval('set_change')")
  4621.     @removing = true
  4622.   end
  4623.   #--------------------------------------------------------------------------
  4624.   # ● バトラー入れ替えの更新
  4625.   #--------------------------------------------------------------------------
  4626.   def update_remove
  4627.     @battler.sv.change_up = false
  4628.     @removing = false
  4629.     @battler = nil
  4630.   end  
  4631.   #--------------------------------------------------------------------------
  4632.   # ● バトラー加入
  4633.   #--------------------------------------------------------------------------
  4634.   def join(join_battler)
  4635.     $sv_camera.wait = 30
  4636.     @battler = join_battler
  4637.     @battler_name = @battler.character_name
  4638.     @battler_index = @battler.character_index
  4639.     @battler_graphic_file_index = @battler.sv.graphic_file_index
  4640.     self.bitmap = Cache.character(@battler_name)
  4641.     @battler.sv.setup(self.bitmap.width, self.bitmap.height, true)
  4642.     create_shadow
  4643.     init_visibility
  4644.   end
  4645.   #--------------------------------------------------------------------------
  4646.   # ● 通常の設定に戻す ★再定義
  4647.   #--------------------------------------------------------------------------
  4648.   def revert_to_normal
  4649.     self.blend_type = 0
  4650.     self.opacity = 255
  4651.   end
  4652.   #--------------------------------------------------------------------------
  4653.   # ● 崩壊エフェクトの更新
  4654.   #--------------------------------------------------------------------------
  4655.   alias update_collapse_sprite_battler_n03 update_collapse
  4656.   def update_collapse
  4657.     return if @battler.sv.state(1) != "敵コラプス"
  4658.     update_collapse_sprite_battler_n03
  4659.     @battler.sv.weapon_visible = false
  4660.   end
  4661.   #--------------------------------------------------------------------------
  4662.   # ● ボス崩壊エフェクトの更新 ★再定義
  4663.   #--------------------------------------------------------------------------
  4664.   def update_boss_collapse
  4665.     @effect_duration = @battler.sv.ch if @effect_duration >= @battler.sv.ch
  4666.     alpha = @effect_duration * 120 / @battler.sv.ch
  4667.     self.ox = @battler.sv.cw / 2 + @effect_duration % 2 * 4 - 2
  4668.     self.blend_type = 1
  4669.     self.color.set(255, 255, 255, 255 - alpha)
  4670.     self.opacity = alpha
  4671.     self.src_rect.y -= 1
  4672.     Sound.play_boss_collapse2 if @effect_duration % 20 == 19
  4673.   end
  4674.   #--------------------------------------------------------------------------
  4675.   # ● 別スプライトからのタイミング処理
  4676.   #--------------------------------------------------------------------------
  4677.   def set_process_timing(timing_data)
  4678.     for data in timing_data
  4679.       set_timing(data[0],data[1])
  4680.     end
  4681.     @battler.sv.timing = []
  4682.   end
  4683.   #--------------------------------------------------------------------------
  4684.   # ● タイミング処理
  4685.   #--------------------------------------------------------------------------
  4686.   def set_timing(se_flag, data)
  4687.     @ani_rate = 4
  4688.     data.se.play if se_flag
  4689.     case data.flash_scope
  4690.     when 1 ;self.flash(data.flash_color, data.flash_duration * @ani_rate)
  4691.     when 2 ;viewport.flash(data.flash_color, data.flash_duration * @ani_rate) if viewport
  4692.     when 3 ;self.flash(nil, data.flash_duration * @ani_rate)
  4693.     end
  4694.   end
  4695.   #--------------------------------------------------------------------------
  4696.   # ● 色調変更
  4697.   #--------------------------------------------------------------------------
  4698.   def color_set
  4699.     set = @battler.sv.color_set
  4700.     @battler.sv.color_set= []
  4701.     set[4] = 1 if set[4] == 0
  4702.     @remain_color_data = [0,0,0,0] if @remain_color_data == nil
  4703.     @color_data = @remain_color_data
  4704.     @color_data[4] = set[4]
  4705.     @color_data[5] = set[5]
  4706.     @color_data[6] = set
  4707.   end
  4708.   #--------------------------------------------------------------------------
  4709.   # ● 解放
  4710.   #--------------------------------------------------------------------------
  4711.   alias dispose_sprite_battler_n03 dispose
  4712.   def dispose
  4713.     dispose_sprite_battler_n03
  4714.     @shadow.dispose if @shadow != nil
  4715.     @balloon.dispose if @balloon != nil
  4716.     for mirage in @mirages do mirage.dispose end if @mirages != nil
  4717.     for anime in @next_anime do anime.dispose end if @next_anime
  4718.   end
  4719. end


  4720. #==============================================================================
  4721. # ■ Spriteset_Battle
  4722. #------------------------------------------------------------------------------
  4723. #  バトル画面のスプライトをまとめたクラスです。
  4724. #==============================================================================
  4725. class Spriteset_Battle
  4726.   #--------------------------------------------------------------------------
  4727.   # ● 戦闘背景(床)スプライトの作成 ★再定義
  4728.   #--------------------------------------------------------------------------
  4729.   def create_battleback1
  4730.     @back1_sprite = Sprite_Battle_Back.new(@viewport1, 1, battleback1_name)
  4731.     @back1_sprite.set_graphics(battleback1_bitmap) if battleback1_name != nil
  4732.     @back1_sprite.z = 0
  4733.   end
  4734.   #--------------------------------------------------------------------------
  4735.   # ● 戦闘背景(壁)スプライトの作成 ★再定義
  4736.   #--------------------------------------------------------------------------
  4737.   def create_battleback2
  4738.     @back2_sprite = Sprite_Battle_Back.new(@viewport1, 2, battleback2_name)
  4739.     @back2_sprite.set_graphics(battleback2_bitmap) if battleback2_name != nil
  4740.     @back2_sprite.z = 1
  4741.   end
  4742.   #--------------------------------------------------------------------------
  4743.   # ● アクタースプライトの作成 ★再定義
  4744.   #--------------------------------------------------------------------------
  4745.   def create_actors
  4746.     @actor_sprites = []
  4747.     for i in 0...$game_party.max_battle_members
  4748.       @actor_sprites[i] = Sprite_Battler.new(@viewport1, $game_party.members[i])
  4749.     end
  4750.     @effect_sprites = Spriteset_Sideview.new(@viewport1)
  4751.   end
  4752.   #--------------------------------------------------------------------------
  4753.   # ● アクタースプライトの更新 ★再定義
  4754.   #--------------------------------------------------------------------------
  4755.   def update_actors
  4756.     @actor_sprites.each_with_index do |sprite, i|
  4757.       sprite_join($game_party.members[i], sprite) if sprite.battler == nil && sprite.battler != $game_party.members[i]
  4758.       sprite.remove if sprite.battler != nil && !sprite.removing && sprite.battler != $game_party.members[i]
  4759.       sprite.update
  4760.     end
  4761.     @effect_sprites.update
  4762.     update_program
  4763.   end
  4764.   #--------------------------------------------------------------------------
  4765.   # ● メンバーを加える
  4766.   #--------------------------------------------------------------------------
  4767.   def sprite_join(member, sprite)
  4768.     for sp in @actor_sprites
  4769.       sp.update_remove if member == sp.battler && !sp.battler.sv.change_up
  4770.     end
  4771.     sprite.join(member)
  4772.   end
  4773.   #--------------------------------------------------------------------------
  4774.   # ● バトルプログラムの更新
  4775.   #--------------------------------------------------------------------------
  4776.   def update_program
  4777.     return if $sv_camera.program_scroll == []
  4778.     for data in  $sv_camera.program_scroll
  4779.       @back1_sprite.start_back_data(data) if data[2] == 1
  4780.       @back2_sprite.start_back_data(data) if data[2] == 2
  4781.     end
  4782.     $sv_camera.program_scroll = []
  4783.   end
  4784.   #--------------------------------------------------------------------------
  4785.   # ● ヒット時の戦闘アニメ実行
  4786.   #--------------------------------------------------------------------------
  4787.   def set_hit_animation(battler, weapon_index, hit_targets, miss)
  4788.     @effect_sprites.set_hit_animation(battler, weapon_index, hit_targets, miss)
  4789.   end
  4790.   #--------------------------------------------------------------------------
  4791.   # ● ダメージPOP
  4792.   #--------------------------------------------------------------------------
  4793.   def set_damage_pop(target)
  4794.     @effect_sprites.set_damage_pop(target)
  4795.   end
  4796.   #--------------------------------------------------------------------------
  4797.   # ● 解放
  4798.   #--------------------------------------------------------------------------
  4799.   alias dispose_spriteset_battle_n03 dispose
  4800.   def dispose
  4801.     dispose_spriteset_battle_n03
  4802.     @effect_sprites.dispose
  4803.   end
  4804.   
  4805.   
  4806.   
  4807. end


  4808. #==============================================================================
  4809. # ■ Window_BattleLog
  4810. #------------------------------------------------------------------------------
  4811. #  戦闘の進行を実況表示するウィンドウです。
  4812. #==============================================================================
  4813. class Window_BattleLog < Window_Selectable
  4814.   #--------------------------------------------------------------------------
  4815.   # ● ウェイト ★再定義
  4816.   #--------------------------------------------------------------------------
  4817.   def wait
  4818.   end
  4819.   #--------------------------------------------------------------------------
  4820.   # ● ウェイトとクリア ★再定義
  4821.   #--------------------------------------------------------------------------
  4822.   def wait_and_clear
  4823.     $sv_camera.wait = 10
  4824.   end
  4825.   #--------------------------------------------------------------------------
  4826.   # ● 行動結果の表示 ★再定義
  4827.   #--------------------------------------------------------------------------
  4828.   def display_action_results(target, item)
  4829.     if target.result.used
  4830.       last_line_number = line_number
  4831.       display_critical(target, item)
  4832.       display_damage(target, item)
  4833.       display_affected_status(target, item)
  4834.       display_failure(target, item)
  4835.     end
  4836.     off if !N03::BATTLE_LOG
  4837.   end
  4838.   #--------------------------------------------------------------------------
  4839.   # ● ウインドウ非表示
  4840.   #--------------------------------------------------------------------------
  4841.   def off
  4842.     @back_sprite.visible = self.visible = false
  4843.   end
  4844. end
  4845. #==============================================================================
  4846. # ■ Game_Interpreter
  4847. #------------------------------------------------------------------------------
  4848. #  イベントコマンドを実行するインタプリタです。
  4849. #==============================================================================
  4850. class Game_Interpreter
  4851.   #--------------------------------------------------------------------------
  4852.   # ● スイッチの操作
  4853.   #--------------------------------------------------------------------------
  4854.   alias command_121_game_interpreter_n03 command_121
  4855.   def command_121
  4856.     command_121_game_interpreter_n03
  4857.     $sv_camera.program_check
  4858.   end
  4859. end
复制代码

点评

3451行是注释,哪来的*?  发表于 2012-9-20 19:16

Lv1.梦旅人

梦石
0
星屑
49
在线时间
128 小时
注册时间
2012-8-5
帖子
53
2
发表于 2012-9-20 17:39:05 手机端发表。 | 只看该作者
你看看哪里有*了把它去掉或改了,再试试。如果不行也别怪我我也不太懂。嘿嘿。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-10 21:31

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表