| 
 
| 赞 | 0 |  
| VIP | 0 |  
| 好人卡 | 1 |  
| 积分 | 0 |  
| 经验 | 7054 |  
| 最后登录 | 2014-2-23 |  
| 在线时间 | 177 小时 |  
 Lv1.梦旅人 
	梦石0 星屑49 在线时间177 小时注册时间2011-7-3帖子235 | 
| 复制代码#==============================================================================
# ■ 設定項目
#==============================================================================
module TSHOOT
  RESULT_SCORE_ID = 1           # 結果のスコアを代入する変数のID
  HI_SCORE_ID     = 2           # ハイスコアとして参照する変数のID
  RESULT_CLEAR_ID = 1           # クリアしたかどうかを代入するスイッチのID
  SW_MOUSE_INPUT  = 2           # マウス入力切替に使うゲームスイッチID
  EBULLET_BLEND   = 0           # 敵機弾のブレンドモード(0=通常,1=加算,2=減算)
  ITEM_OPACITY    = 160         # アイテムの透明度
  ITEM_BLEND      = 0           # アイテムのブレンドモード(0=通常,1=加算,2=減算)
  BG_SCROLL_SPEED = 8           # スクロール速度(ドット/フレーム)
  USE_GRAZE_SE     = false      # 重くてもグレイズ効果音を鳴らすか
  GC_COUNT = 120                # GCを実行する間隔(フレーム数)
  INFO_FONT = ["Arial Black", "UmePlus Gothic", "MS Pゴシック"] # フォント
  SE_NAME = []
  SE_NAME[1] = ["Ice9.ogg", 80, 150]       # 敵ダメージ効果音
  SE_NAME[2] = ["Explosion1.ogg", 80, 100] # 敵撃破効果音
  SE_NAME[3] = ["Thunder6.ogg", 80, 100]   # 自機爆発効果音
  SE_NAME[4] = ["Flash2.ogg", 80, 100]     # ボム効果音
  SE_NAME[5] = ["Ice4.ogg", 80, 150]       # スコアアイテム効果音
  SE_NAME[6] = ["Up.ogg", 80, 100]         # パワーアイテム効果音
  SE_NAME[7] = ["Up.ogg", 80, 100]         # ライフアイテム効果音
  SE_NAME[8] = ["Up.ogg", 80, 100]         # ボムアイテム効果音
  SE_NAME[9] = ["Evasion.ogg", 60, 150]    # グレイズ効果音
  # 自機ショット関連の設定
  PBULLET_OPACITY = 128         # 自機弾の透明度
  PBULLET_BLEND   = 1           # 自機弾のブレンドモード(0=通常,1=加算,2=減算)
  ITEM_NEED       = 5           # パワーアップに必要なパワーアイテム数
  POWER_MAX       = 25          # パワーアイテムの最大蓄積量
  ITEM_LOST       = -5          # 被弾時に失うパワーアイテム数
  USE_SHOT_PATTERN = true       # ショットパターンを使うか
  # 自機のショットパターン
  # [way数, way間隔, 発射方向, 速度, 画像インデックス, タイプ, 発射間隔]
  # タイプを 1 にすると誘導弾になります……が、挙動が怪しいです。
  # USE_SHOT_PATTERN が true のときのみ有効となります。
  ANGLE_UP = Math::PI * 3 / 2
  SHOT_PATTERN = [
    [[1, 0.0,   ANGLE_UP, 4096, 0, 0, 8]], # レベル0
    [[2, 0.1,   ANGLE_UP, 4096, 0, 0, 8]],  # レベル1
    [[3, 0.1,   ANGLE_UP, 4096, 0, 0, 8]], # レベル2
    [[4, 0.1,   ANGLE_UP, 4096, 0, 0, 8]],  # レベル3
    [[5, 0.175, ANGLE_UP, 4096, 0, 0, 8]],  # レベル4
    [[5, 0.15,  ANGLE_UP, 4096, 0, 0, 8],   # レベル5
     [5, 0.6,   ANGLE_UP, 4096, 2, 1, 8]]
  ]
end
class TShoot_Scene < Scene_Base
  #--------------------------------------------------------------------------
  # ● 敵機追加メソッド
  #--------------------------------------------------------------------------
  ADD_ENEMY_TYPE = {
    1 => :add_enemy1, 2 => :add_enemy2, 3 => :add_enemy3, 4 => :add_enemy4,
    5 => :add_enemy5, 6 => :add_enemy6, 7 => :add_enemy7, 8 => :add_enemy8,
    9 => :add_enemy9, 10 => :add_enemy10, 11 => :add_enemy11, 12 => :add_enemy12,
    13 => :add_enemy13, 14 => :add_enemy14, 15 => :add_enemy15, 16 => :add_enemy16
  }
  def add_enemy1(x, y, shot, move) TShoot_Enemy1.new(x, y, shot, move) end
  def add_enemy2(x, y, shot, move) TShoot_Enemy2.new(x, y, shot, move) end
  def add_enemy3(x, y, shot, move) TShoot_Enemy3.new(x, y, shot, move) end
  def add_enemy4(x, y, shot, move) TShoot_Enemy4.new(x, y, shot, move) end
  def add_enemy5(x, y, shot, move) TShoot_Enemy5.new(x, y, shot, move) end
  def add_enemy6(x, y, shot, move) TShoot_Enemy6.new(x, y, shot, move) end
  def add_enemy7(x, y, shot, move) TShoot_Enemy7.new(x, y, shot, move) end
  def add_enemy8(x, y, shot, move) TShoot_Enemy8.new(x, y, shot, move) end
  def add_enemy9(x, y, shot, move) TShoot_Enemy9.new(x, y, shot, move) end
  def add_enemy10(x, y, shot, move) TShoot_Enemy10.new(x, y, shot, move) end
  def add_enemy11(x, y, shot, move) TShoot_Enemy11.new(x, y, shot, move) end
  def add_enemy12(x, y, shot, move) TShoot_Enemy12.new(x, y, shot, move) end
  def add_enemy13(x, y, shot, move) TShoot_Enemy13.new(x, y, shot, move) end
  def add_enemy14(x, y, shot, move) TShoot_Enemy14.new(x, y, shot, move) end
  def add_enemy15(x, y, shot, move) TShoot_Enemy15.new(x, y, shot, move) end
  def add_enemy16(x, y, shot, move) TShoot_Enemy16.new(x, y, shot, move) end
  #--------------------------------------------------------------------------
  # ● 敵弾追加メソッド
  #--------------------------------------------------------------------------
  ADD_EBULLET_TYPE = {
    1 => :add_ebullet1, 2 => :add_ebullet2, 3 => :add_ebullet3,
    4 => :add_ebullet4, 5 => :add_ebullet5, 6 => :add_ebullet6,
    7 => :add_ebullet7, 8 => :add_ebullet8, 9 => :add_ebullet9,
    10 => :add_ebullet10
  }
  def add_ebullet1(x, y, vx, vy, index, i) TShoot_EBullet1.new(x, y, vx, vy, index, i) end
  def add_ebullet2(x, y, vx, vy, index, i) TShoot_EBullet2.new(x, y, vx, vy, index, i) end
  def add_ebullet3(x, y, vx, vy, index, i) TShoot_EBullet3.new(x, y, vx, vy, index, i) end
  def add_ebullet4(x, y, vx, vy, index, i) TShoot_EBullet4.new(x, y, vx, vy, index, i) end
  def add_ebullet5(x, y, vx, vy, index, i) TShoot_EBullet5.new(x, y, vx, vy, index, i) end
  def add_ebullet6(x, y, vx, vy, index, i) TShoot_EBullet6.new(x, y, vx, vy, index, i) end
  def add_ebullet7(x, y, vx, vy, index, i) TShoot_EBullet7.new(x, y, vx, vy, index, i) end
  def add_ebullet8(x, y, vx, vy, index, i) TShoot_EBullet8.new(x, y, vx, vy, index, i) end
  def add_ebullet9(x, y, vx, vy, index, i) TShoot_EBullet9.new(x, y, vx, vy, index, i) end
  def add_ebullet10(x, y, vx, vy, index, i) TShoot_EBullet10.new(x, y, vx, vy, index, i) end
end
  
#==============================================================================
# 設定項目はここまで
#==============================================================================
#==============================================================================
# ■コマンド(これは設定項目ではありません)
#==============================================================================
module TSHOOT
  module Commands
    module_function
    #--------------------------------------------------------------------------
    # ● ステージデータの初期化
    #--------------------------------------------------------------------------
    def reset_stage
      $game_temp.tshoot_stage.reset
    end
    #--------------------------------------------------------------------------
    # ● 背景画像の指定
    #--------------------------------------------------------------------------
    def set_ground(file)
      $game_temp.tshoot_ground = file
    end
    #--------------------------------------------------------------------------
    # ● BGMの指定
    #--------------------------------------------------------------------------
    def set_bgm(file)
      $game_temp.tshoot_bgm = file
    end
    #--------------------------------------------------------------------------
    # ● ステージデータの追加(敵機)
    #--------------------------------------------------------------------------
    def set_enemy(time, type, x, y, shot, move)
      $game_temp.tshoot_stage.add(time, type, [x, y, shot, move])
    end
    #--------------------------------------------------------------------------
    # ● ステージデータの追加(ストッパー)
    #--------------------------------------------------------------------------
    def set_stop(time, num = 0)
      $game_temp.tshoot_stage.add(time, 204, [num])
    end
    #--------------------------------------------------------------------------
    # ● ステージデータの追加(ステージ終了)
    #--------------------------------------------------------------------------
    def set_end(time)
      $game_temp.tshoot_stage.add(time, 205, [0])
    end
    #--------------------------------------------------------------------------
    # ● ステージデータの追加(メッセージ)
    #--------------------------------------------------------------------------
    def set_message(time, message)
      $game_temp.tshoot_stage.add(time, 200, ["", 0, 1, 2, message])
    end
    #--------------------------------------------------------------------------
    # ● ステージデータの追加(ピクチャの表示)
    #--------------------------------------------------------------------------
    def set_picture(time, number, name, origin, x, y, zoom_x, zoom_y, opacity, blend_type)
      $game_temp.tshoot_stage.add(time, 201, [number, name, origin, x, y, zoom_x, zoom_y, opacity, blend_type])
    end
    #--------------------------------------------------------------------------
    # ● ステージデータの追加(会話用ピクチャの表示)
    #--------------------------------------------------------------------------
    def set_face(time, name1, name2, flag = false)
      if name1 != ""
        x = flag ? -96 : -64
        opacity = flag ? 128 : 255
        $game_temp.tshoot_stage.add(time, 201, [1, name1, 0, x, 96, 100, 100, opacity, 0])
      else
        $game_temp.tshoot_stage.add(time, 202, [1])
      end
      if name2 != ""
        x = flag ? 144 : 176
        opacity = flag ? 255 : 128
        $game_temp.tshoot_stage.add(time, 201, [2, name2, 0, x, 96, 100, 100, opacity, 0])
      else
        $game_temp.tshoot_stage.add(time, 202, [2])
      end
    end
    #--------------------------------------------------------------------------
    # ● ステージデータの追加(ピクチャの消去)
    #--------------------------------------------------------------------------
    def erase_picture(time, number)
      $game_temp.tshoot_stage.add(time, 202, [number])
    end
    #--------------------------------------------------------------------------
    # ● ステージデータの追加(全削除)
    #--------------------------------------------------------------------------
    def erase_all(time)
      $game_temp.tshoot_stage.add(time, 203, [0])
    end
  end
end
  
class Game_Interpreter
  include TSHOOT::Commands
end
复制代码#==============================================================================
# ■ 敵の作成について
#------------------------------------------------------------------------------
#  まずはデフォルトの敵をいろいろいじって試してみてください
#   "敵弾設定と雛形" に基本的な弾幕と移動パターンを用意しました
#   デフォルトのタイプ4のように laser_shot(0) と書くだけで
#   折れ曲がるレーザーが撃てます。
#
#   nway_shot(n, space, angle, speed, aim, index, type, blend)
#     n : 発射する弾数
#     space : 弾同士の間隔
#     angle : 弾を発射する方向(0.0~6.28)
#     speed : 弾の移動速度
#     aim : 自機狙いフラグ、trueで自機狙い、falseで無効
#     index : 弾の色
#     type : 弾のタイプ(1~7)、省略可
#
#   nall_shot(n, angle, speed, aim, index, type, blend)
#     nway_shotと同じです、弾の間隔は自動的に算出されます
#
#   turn_up / turn_down / turn_left / turn_right
#     向きを変えます、変わるのは画像の向きだけで
#     ショットや移動方向にはまったく影響しません
#
#   その他初期状態で使えるメソッド
#   使用例はデフォルトの敵機タイプ1~12を参照してください
#     basic_move1
#     basic_move2(stop_time = 300)
#     chain_shot(n, way, speed, index, type = 1)
#     wide_shot(n, way, speed, index, type = 1)
#     winder_shot(way, index, type = 1)
#     whirl_shot(way, index, type = 1)
#     whirl_shot2(way, index, type = 1)
#     laser_shot(index)
#     whip_shot(way, index, type = 1)
#     machine_shot(way, speed, index, type = 1)
#
#   初期状態で設定されている弾のタイプ(type の値として使用)
#   ただし、レーザー弾は特殊な使い方となります。
#     1 … 通常弾
#     2 … 大きい通常弾
#     3 … レーザー弾(親)
#     4 … レーザー弾(子)
#     5 … 壁で一度跳ね返る弾
#     6 … 自機狙いに変化する弾
#     7 … 自機狙いに変化する大きい弾
#==============================================================================
#==============================================================================
# ■ 敵機タイプ1
#------------------------------------------------------------------------------
#  画面上部でうろうろしながら後退、自機狙いのnWAY3連ショット
#   @shot = ショットのway数
#   @move = 未使用
#==============================================================================
class TShoot_Enemy1 < TShoot_Enemy
  # 出現時の処理
  def set_type
    @hp = 6                       # 敵の耐久力(省略時5)
    @score = 2                    # 持っているスコアアイテムの数(省略時1)
    @power = 5                    # 持っているパワーアイテムの数(省略時0)
    @life = 0                     # 持っているライフアイテムの数(省略時0)
    @bomb = 0                     # 持っているボムアイテムの数(省略時0)
    @file_name = "Monster"        # 敵機の画像ファイル
    @file_index = 2               # 敵機の画像インデックス
    @vx = 0                       # x方向の初期速度(省略時0)
    @vy = 2 << 10                 # y方向の初期速度(省略時0)
    @cnt_shot = 150               # 出現から攻撃開始までの時間(省略時0)
    @cnt_shot_reset = 180         # 攻撃間隔(省略時180)
  end
  # 毎フレーム実行される処理
  def action
    basic_move1                   # 移動の処理
    chain_shot(3, @shot, 1500, 1) # ショットの処理(連射数, way数, 弾速, 弾色)
  end
end
#==============================================================================
# ■ 敵機タイプ2
#------------------------------------------------------------------------------
#  ワインダー(@cnt_chotは使えません)
#   @shot = way数
#   @move = 攻撃時間
#==============================================================================
class TShoot_Enemy2 < TShoot_Enemy
  def set_type
    @hp = 25
    @file_name = "Monster"
    @file_index = 0
    @vy = 2 << 10
  end
  def action
    basic_move2(@move)
    winder_shot(@shot, 2) if @vy == 0   # (way数, 弾色)
  end
end
#==============================================================================
# ■ 敵機タイプ3
#------------------------------------------------------------------------------
#  回転砲台
#   @shot = way数
#   @move = 攻撃時間
#==============================================================================
class TShoot_Enemy3 < TShoot_Enemy
  def set_type
    @hp = 25
    @file_name = "Monster"
    @file_index = 0
    @vy = 2 << 10
    @angle_shot = Math::PI if self.x < 144     # 左右対称にするしかけ
  end
  def action
    basic_move2(@move)
    whirl_shot(@shot, 3) if @vy == 0      # (way数, 弾色)
  end
end
#==============================================================================
# ■ 敵機タイプ4
#------------------------------------------------------------------------------
#  画面上部でうろうろしながら後退、折れ曲がるレーザー発射
#   @shot = ショットのway数
#   @move = 未使用
#==============================================================================
class TShoot_Enemy4 < TShoot_Enemy
  def set_type
    @hp = 10
    @file_name = "Monster"
    @file_index = 2
    @vy = 2 << 10
    @cnt_shot_reset = 180
  end
  def action
    basic_move1
    laser_shot(0)       # (弾色)
  end
end
#==============================================================================
# ■ 敵機タイプ5
#------------------------------------------------------------------------------
#  画面上部でうろうろしながら後退、鞭ショットを発射
#   @shot = ショットのway数
#   @move = 未使用
#==============================================================================
class TShoot_Enemy5 < TShoot_Enemy
  def set_type
    @hp = 10
    @file_name = "Monster"
    @file_index = 2
    @vy = 2 << 10
    @cnt_shot_reset = 180
  end
  def action
    basic_move1
    whip_shot(@shot, 4)   # (way数, 弾色)
  end
end
#==============================================================================
# ■ 敵機タイプ6
#------------------------------------------------------------------------------
#  画面上部でうろうろしながら後退、自機狙いの全方位4連ショット壁反射
#   @shot = ショットのway数
#   @move = 未使用
#==============================================================================
class TShoot_Enemy6 < TShoot_Enemy
  def set_type
    @hp = 25
    @file_name = "Monster"
    @file_index = 2
    @vy = 2 << 10
    @cnt_shot_reset = 180
  end
  def action
    basic_move1
    wide_shot(4, @shot, 1500, 1, 5) # (連射数, way数, 弾速, 弾色, 弾種)
  end
end
#==============================================================================
# ■ 敵機タイプ7
#------------------------------------------------------------------------------
#  画面上部でうろうろしながら後退、撃破時爆発
#   @shot = ショットのway数
#   @move = 未使用
#==============================================================================
class TShoot_Enemy7 < TShoot_Enemy
  def set_type
    @hp = 1
    @file_name = "Monster"
    @file_index = 2
    @vy = 3 << 10
  end
  def action
    basic_move1
  end
  # ダメージを受けたときの処理
  def damage
    super       # 親クラス(TShoot_Enemy)の同メソッドを呼ぶ
    nall_shot(@shot, 0.0, 2048, false, 3) if @hp == 0
  end
end
#==============================================================================
# ■ 敵機タイプ8
#------------------------------------------------------------------------------
#  ばらまきショット
#   @shot = way数
#   @move = 攻撃時間
#==============================================================================
class TShoot_Enemy8 < TShoot_Enemy
  def set_type
    @hp = 25
    @file_name = "Monster"
    @file_index = 0
    @vy = 2 << 10
    @cnt_shot_reset = 180
  end
  def action
    basic_move2(@move)
    machine_shot(@shot, 1500, 2)  # (way数, 弾速, 弾色)
  end
end
#==============================================================================
# ■ 敵機タイプ9
#------------------------------------------------------------------------------
#  くねくね移動、自機狙いのnWAY3連ショット
#   @shot = ショットのway数
#   @move = 移動方向(0 = 下、1 = 右、2 = 左)
#==============================================================================
class TShoot_Enemy9 < TShoot_Enemy
  def set_type
    @hp = 8
    @file_name = "Monster"
    @file_index = 3
    @angle_move = 0.0
    if @move == 0
      @base_pos = @sx
      @vy = 1024
    else
      @base_pos = @sy
      @vx = (@move == 1 ? 1024 : -1024)
    end
    @cnt_shot_reset = 180
  end
  def action
    @angle_move += Math::PI / 120
    if @move == 0
      @sx = (Math.sin(@angle_move) * (32 << 10)).to_i + @base_pos
    else
      @sy = (Math.sin(@angle_move) * (32 << 10)).to_i + @base_pos
    end
    chain_shot(3, @shot, 1500, 1) # ショットの処理(連射数, way数, 弾速, 弾色)
  end
end
#==============================================================================
# ■ 敵機タイプ10
#------------------------------------------------------------------------------
#  回転砲台(弾が自機狙いに変化する)
#   @shot = way数
#   @move = 攻撃時間
#==============================================================================
class TShoot_Enemy10 < TShoot_Enemy
  def set_type
    @hp = 25
    @file_name = "Monster"
    @file_index = 0
    @vy = 2 << 10
    @angle_shot = Math::PI if self.x < 144     # 左右対称にするしかけ
  end
  def action
    basic_move2(@move)
    whirl_shot2(@shot, 3, 6) if @vy == 0      # (way数, 弾色, 弾種)
  end
end
#==============================================================================
# ■ 敵機タイプ11
#------------------------------------------------------------------------------
#   ただまっすぐに移動するだけ
#   @shot = 未使用
#   @move = 移動方向(0.0 ~ 6.283184)
#==============================================================================
class TShoot_Enemy11 < TShoot_Enemy
  def set_type
    @hp = 1
    @file_name = "Monster"
    @file_index = 2
    @vx = (Math.cos(@move) * 1536).to_i    # x方向の初期速度
    @vy = (Math.sin(@move) * 1536).to_i    # y方向の初期速度
  end
end
#==============================================================================
# ■ 敵機タイプ12
#------------------------------------------------------------------------------
#  ボス、直進→停止→ひたすら攻撃+撃破でゲーム終了
#   @shot = 未使用
#   @move = 未使用
#==============================================================================
class TShoot_Enemy12 < TShoot_Enemy
  def set_type
    @hp = 100
    @score = 0
    @file_name = "Spiritual"
    @file_index = 4
    @angle_shot = 0.0
    Audio.bgm_play("Audio/BGM/Battle1.mid", 100, 100)   # 登場時にBGM変更
  end
  def action
    @cnt_shot += 1
    if @angle_shot < Math::PI / 2
      @angle_shot += 0.01
      @sy = (Math.sin(@angle_shot) * (128 << 10)).to_i - (32 << 10)
      @cnt_shot = 0
    elsif @cnt_shot % 4 == 0
      @cnt_shot = 0 if @cnt_shot == 192
      if @cnt_shot < 32
        nall_shot(32, 0.0, 4096, false, 5)
        nall_shot(16, 0.0, 2048, false, 2, 7) if @cnt_shot % 8 == 0
      elsif @cnt_shot >= 64 and @cnt_shot < 96
        nall_shot(32, Math::PI / 32, 4096, false, 5)
      elsif @cnt_shot >= 128 and @cnt_shot < 160
        nway_shot(5, 0.3, 0.0, 4096, true, 0)
      end
    end
  end
end
然后就只发我的脚本了...(@#%&*^#*@&%(!!...明明有脚本还要我发...那个SB说的!)复制代码#==============================================================================
# ■ 敵機弾タイプ1
#------------------------------------------------------------------------------
#  通常弾
#==============================================================================
class TShoot_EBullet1 < TShoot_EBullet
  def set_type
    self.blend_type = TSHOOT::EBULLET_BLEND
    self.bitmap = Cache.system("ebullet1")
    self.src_rect = Rect.new(@index * 12, 0, 12, 12)
  end
end
#==============================================================================
# ■ 敵機弾タイプ2
#------------------------------------------------------------------------------
#  大きい弾
#==============================================================================
class TShoot_EBullet2 < TShoot_EBullet
  def set_type
    self.blend_type = TSHOOT::EBULLET_BLEND
    self.bitmap = Cache.system("ebullet2")
    self.src_rect = Rect.new(@index * 32, 0, 32, 32)
  end
end
#==============================================================================
# ■ 敵機弾タイプ3
#------------------------------------------------------------------------------
#  レーザー用通常弾
#==============================================================================
class TShoot_EBullet3 < TShoot_EBullet
  def set_type
    self.blend_type = 1
    self.bitmap = Cache.system("ebullet1")
    self.src_rect = Rect.new(@index * 12, 0, 12, 12)
    @last_vx = [0, 0]
    @last_vy = [0, 0]
    Audio.se_play("Audio/SE/Thunder10.ogg", 70, 70)
  end
  def update
    if @vy != 0
      if $scene.player.y < self.y + self.width and $scene.player.y > self.y
        @vx = $scene.player.x > self.x ? 2048 : -2048
        @vy = 0
      end
    end
    @last_vx[1] = @last_vx[0]
    @last_vy[1] = @last_vy[0]
    @last_vx[0] = @vx
    @last_vy[0] = @vy
    super
  end
end
#==============================================================================
# ■ 敵機弾タイプ4
#------------------------------------------------------------------------------
#  レーザー用通常弾(ご主人様についていく)
#==============================================================================
class TShoot_EBullet4 < TShoot_EBullet
  def set_type
    self.blend_type = 1
    self.bitmap = Cache.system("ebullet1")
    self.src_rect = Rect.new(@index * 12, 0, 12, 12)
    @last_vx = [0, 0]
    @last_vy = [0, 0]
#~     @graze = false
  end
  def update
    @last_vx[1] = @last_vx[0]
    @last_vy[1] = @last_vy[0]
    @last_vx[0] = @vx
    @last_vy[0] = @vy
    @master = -1 if $scene.bullet[@master] == nil
    if @master >= 0
      @vx = $scene.bullet[@master].last_vx[1]
      @vy = $scene.bullet[@master].last_vy[1]
    end
    super
  end
end
#==============================================================================
# ■ 敵機弾タイプ5
#------------------------------------------------------------------------------
#  画面端で一度だけ跳ね返る弾
#==============================================================================
class TShoot_EBullet5 < TShoot_EBullet
  def set_type
    self.blend_type = TSHOOT::EBULLET_BLEND
    self.bitmap = Cache.system("ebullet1")
    self.src_rect = Rect.new(@index * 12, 0, 12, 12)
    @bound = true
  end
  def update
    if @bound
      if self.x < 16 or self.x > 324
        @vx = 0 - @vx
        @bound = false
      elsif self.y < 16 or self.y > 388
        @vy = 0 - @vy
        @bound = false
      end
    end
    super
  end
end
#==============================================================================
# ■ 敵機弾タイプ6
#------------------------------------------------------------------------------
#  一定時間後、自機狙いに変化する
#==============================================================================
class TShoot_EBullet6 < TShoot_EBullet
  def set_type
    self.blend_type = TSHOOT::EBULLET_BLEND
    self.bitmap = Cache.system("ebullet1")
    self.src_rect = Rect.new(@index * 12, 0, 12, 12)
    @cnt = 120
  end
  def update
    @cnt -= 1
    if @cnt == 60
      @vx = 0
      @vy = 0
    elsif @cnt == 0
      change_aim(1600)
    end
    super
  end
end
#==============================================================================
# ■ 敵機弾タイプ7
#------------------------------------------------------------------------------
#  一定時間後、自機狙いに変化する大きい弾
#==============================================================================
class TShoot_EBullet7 < TShoot_EBullet6
  def set_type
    self.blend_type = TSHOOT::EBULLET_BLEND
    self.bitmap = Cache.system("ebullet2")
    self.src_rect = Rect.new(@index * 32, 0, 32, 32)
    @cnt = 120
  end
end
#==============================================================================
# ■ TShoot_Enemy
#------------------------------------------------------------------------------
#  シューティングの敵機クラス
#==============================================================================
class TShoot_Enemy < Sprite
  #--------------------------------------------------------------------------
  # ● 基本移動(上から出現、左右移動しながら上へ戻る)
  #--------------------------------------------------------------------------
  def basic_move1
    @cnt_move += 1
    @vx += @vx > 0 ? -16 : 16 if @vx != 0
    @vy += @vy > 0 ? -16 : 16 if @vy != 0
    if @cnt_move == 192
      @vx = 1024
      @vy = -512
    elsif @cnt_move == 320
      @vx = -1024
      @vy = -512
      @cnt_move = 64
    end
  end
  #--------------------------------------------------------------------------
  # ● 基本移動(上から出現、しばらくとどまったあと上へ戻る)
  #--------------------------------------------------------------------------
  def basic_move2(stop_time = 300)
    @cnt_move += 1
    @vy -= 16 if @vy > 0
    @vy = -1024 if @cnt_move >= stop_time
  end
  #--------------------------------------------------------------------------
  # ● 自機狙いn連ショット
  #--------------------------------------------------------------------------
  def chain_shot(n, way, speed, index, type = 1)
    @cnt_shot -= 1
    @cnt_shot = @cnt_shot_reset if @cnt_shot <= 0
    for i in 0...n
      if @cnt_shot == i * 10 + 10
        nway_shot(way, 0.9 / way, 0.0, speed, true, index, type)
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 自機狙いn連全方位ショット
  #--------------------------------------------------------------------------
  def wide_shot(n, way, speed, index, type = 1)
    @cnt_shot -= 1
    @cnt_shot = @cnt_shot_reset if @cnt_shot <= 0
    for i in 0...n
      if @cnt_shot == i * 10 + 10
        nall_shot(way, 0.0, speed, true, index, type)
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● ワインダー
  #--------------------------------------------------------------------------
  def winder_shot(way, index, type = 1)
    @cnt_shot += 1
    @cnt_shot = 0 if @cnt_shot == 540
    if @cnt_shot % 4 == 0
      angle = (Math.sin(Math::PI * 2 * @cnt_shot / 540)) / 2 + Math::PI / 2
      nway_shot(way, 2.8 / way, angle, 4096, false, index, type)
    end
  end
  #--------------------------------------------------------------------------
  # ● 回転砲台
  # 位置が画面左側なら逆回転
  #--------------------------------------------------------------------------
  def whirl_shot(way, index, type = 1)
    @cnt_shot -= 1
    @cnt_shot = @cnt_shot_reset if @cnt_shot <= 0
    if @cnt_shot % 12 == 0
      @angle_shot += self.x < 144 ? -0.2 : 0.2
      nall_shot(way, @angle_shot, 1280, false, index, type)
    end
  end
  #--------------------------------------------------------------------------
  # ● 高速回転砲台
  # 位置が画面左側なら逆回転
  #--------------------------------------------------------------------------
  def whirl_shot2(way, index, type = 1)
    @cnt_shot -= 1
    @cnt_shot = @cnt_shot_reset if @cnt_shot <= 0
    if @cnt_shot % 4 == 0
      @angle_shot += self.x < 144 ? -0.5 : 0.5
      nall_shot(way, @angle_shot, 1280, false, index, type)
    end
  end
  #--------------------------------------------------------------------------
  # ● 直角に折れ曲がるレーザー
  #--------------------------------------------------------------------------
  def laser_shot(index)
    @cnt_shot -= 1
    @cnt_shot = @cnt_shot_reset if @cnt_shot <= 0
    if @cnt_shot == 10
      id = $scene.add_ebullet(@sx, @sy, 0, 2048, index, 3)
      for i in 0...19
        last_id = $scene.add_ebullet(@sx, @sy, 0, 0, index, 4)
        $scene.bullet[last_id].set_master(id)
        id = last_id
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 自機狙い鞭ショット
  #--------------------------------------------------------------------------
  def whip_shot(way, index, type = 1)
    @cnt_shot -= 1
    @cnt_shot = @cnt_shot_reset if @cnt_shot <= 0
    nway_shot(way, 0.9 / way, 0.0, 3072, true, index, type) if @cnt_shot == 10
    nway_shot(way, 0.9 / way, 0.0, 2048, true, index, type) if @cnt_shot == 20
    nway_shot(way, 0.9 / way, 0.0, 1536, true, index, type) if @cnt_shot == 30
    nway_shot(way, 0.9 / way, 0.0, 1280, true, index, type) if @cnt_shot == 40
    nway_shot(way, 0.9 / way, 0.0, 1024, true, index, type) if @cnt_shot == 50
  end
  #--------------------------------------------------------------------------
  # ● ばらまきショット
  #--------------------------------------------------------------------------
  def machine_shot(way, speed, index, type = 1)
    @cnt_shot -= 1
    @cnt_shot = @cnt_shot_reset if @cnt_shot <= 0
    if @cnt_shot >= 10 and @cnt_shot < 100
      if @cnt_shot % 5 == 0
        angle = rand(512) * (Math::PI / 4) / 512 + (Math::PI * 3 / 8)
        nway_shot(way, 0.9 / way, angle, speed, false, index, type)
      end
    end
  end
end
  Scripts.rvdata
(154.19 KB, 下载次数: 0) | 
 |