查看: 1870|回复: 4

[已经过期] 求这种战斗框的脚本

[复制链接]
梦石
0
星屑
240
在线时间
2 小时
注册时间
2014-2-28
回帖
0
发表于 2014-3-2 09:33:20 | 显示全部楼层 |阅读模式

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

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

×
就像图片里一样
360截图20140302092926312.jpg
360截图20140302092953218.jpg
梦石
20
星屑
1840
在线时间
6925 小时
注册时间
2012-12-14
回帖
10960

短篇十战斗者组别冠军开拓者贵宾短篇九勇士组亚军

发表于 2014-3-2 14:51:54 | 显示全部楼层
这个是VX默认效果
当然要在XP使用的话
就要修改默认脚本了
大家好,这里是晨露的说。请多多指教。
刚入门RM软件制作,请大家多多帮助我哦。
落雪君的欢乐像素教程,欢迎查阅。

回复

使用道具 举报

梦石
0
星屑
9716
在线时间
2775 小时
注册时间
2008-9-5
回帖
3458

开拓者短篇八RM组冠军短篇九导演组亚军白银编剧

发表于 2014-3-2 15:49:20 | 显示全部楼层
用XP不久的话~
移步VX或者ACE如何?
要把XP的战斗系统改成这样很费劲唔……
回复

使用道具 举报

梦石
0
星屑
50
在线时间
41 小时
注册时间
2014-2-17
回帖
195
发表于 2014-3-2 20:17:19 | 显示全部楼层
这个是VX里的……最简单的方法就是换成用RMVX
回复

使用道具 举报

梦石
0
星屑
381
在线时间
238 小时
注册时间
2013-8-20
回帖
410
发表于 2014-3-4 13:45:35 | 显示全部楼层
[pre lang="ruby" line="1"]#==============================================================================
# ■ XP-RGSS-72 リッチアクターコマンド [Ver.1.0.0]      by Claimh
#------------------------------------------------------------------------------
#・戦闘時のコマンド表示方法を変更します。
#・戦闘コマンドごとにアイコン表示がつきます
#  - 攻撃 :装備武器のアイコン + 設定にある攻撃アイコン を描画する
#  - スキル・防御・アイテム :設定にあるアイコンのみ描画する
#・アクター個別のコマンド名を使うことができます
#------------------------------------------------------------------------------
#【再定義】  Scene_Battle#main
#==============================================================================

module RICH_ACTCMD
  #--------------------------------------------------------------------------
  # ● ファイル定義
  #--------------------------------------------------------------------------
  # Icon(Graphics/Icons)
  # ※nilにするとアイコン無し
  ATTACK    = "MI_attack.png"     # 攻撃のアイコン
  SKILL     = "MI_skill.png"      # スキルのアイコン
  DEFFENCE  = "MI_guard.png"      # 防御のアイコン
  ITEM      = "MI_item.png"       # アイテムのアイコン
  
  HAND      = "hand.png"          # 武器なし(素手)のアイコン

  # TEXT背景色
  BACK = Color.new(0,0,0,128)

  #--------------------------------------------------------------------------
  # ● 個別コマンド設定
  #--------------------------------------------------------------------------
  # 個別コマンド名を使用する
  USE_ACT_CMD = true

  # アクター別のコマンド名
  ACT_CMD_T = []  # ここは変更禁止
  # ACT_CMD_T[アクターID] = [攻撃, スキル, 防御, アイテム]
  # ※nilを入れるとシステム用語と同じ名称になります
  ACT_CMD_T[1] = ["斬撃",   "剣技",     nil, nil]
  ACT_CMD_T[2] = ["突撃",   "槍技",     nil, nil]
  ACT_CMD_T[3] = [ nil,     "精霊魔法", nil, nil]
  ACT_CMD_T[4] = ["なぐる", "暗黒魔法", nil, nil]

  # アクター別のコマンド用アイコン
  ACT_CMD_I = []  # ここは変更禁止
  # ACT_CMD_I[アクターID] = [攻撃, スキル, 防御, アイテム]
  # ※nilを入れるとファイル定義の設定と同じファイルになります
  ACT_CMD_I[1] = [nil, nil, nil, nil]
  ACT_CMD_I[2] = [nil, nil, nil, nil]
  ACT_CMD_I[3] = [nil, "MI_magic", nil, nil]
  ACT_CMD_I[4] = [nil, "MI_magic", nil, nil]
  
  #--------------------------------------------------------------------------
  # ● その他
  #--------------------------------------------------------------------------
  # 基準Y座標
  Y = 220
  # TEXT背景の描画幅W、高さH
  W = 140
  H = 32
  # 横幅のモーション速さ  [ 高速移動時、低速移動時 ]
  W_F = [40, 10]
  # 縦移動のモーション速さ[ 高速移動時、低速移動時 ]
  M_F = [40, 10]
  # 選択外コマンドの不透明度
  OP = 100

=begin
<note>
「高速移動」と「低速移動」はコマンド切替時の動作のことです。
- 高速移動 : 次に選択する項目のモーション
- 低速移動 : 前回選択した項目のモーション
=end
end


#==============================================================================
# ■ WindowBattleActorCmd
#------------------------------------------------------------------------------
# バトル画面で、アクターのコマンド一覧を表示するウィンドウ?です。
#==============================================================================
class WindowBattleActorCmd
  include RICH_ACTCMD
  #--------------------------------------------------------------------------
  # ● define
  #--------------------------------------------------------------------------
  M_WAIT   = 0   # 停止
  M_CUR_UP = 1   # ↑移動
  M_CUR_DW = 2   # ↓移動
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_accessor   :index
  attr_accessor   :active
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize
    # text
    @text = [
      $data_system.words.attack,
      $data_system.words.skill,
      $data_system.words.guard,
      $data_system.words.item
    ]
    @item_max = @text.size
    # icon
    @icon = [ATTACK, SKILL, DEFFENCE, ITEM]
    # create sprite
    @cmd_sprite = []
    for i in 0...@item_max
      @cmd_sprite = SpriteCmdIcon.new(@icon, @text)
    end
    #
    @base_y = Y
    self.index = 0
    @active = false
    self.visible = false
  end
  #--------------------------------------------------------------------------
  # ● オブジェクト開放
  #--------------------------------------------------------------------------
  def dispose
    for sprite in @cmd_sprite
      sprite.dispose
    end
  end
  #--------------------------------------------------------------------------
  # ● 表示/非表示 切り替え
  #--------------------------------------------------------------------------
  def visible=(flag)
    for sprite in @cmd_sprite
      sprite.visible = flag
    end
  end
  #--------------------------------------------------------------------------
  # ● X座標変更
  #--------------------------------------------------------------------------
  def x=(x)
    for sprite in @cmd_sprite
      sprite.set_x(x+8)
    end
  end
  #--------------------------------------------------------------------------
  # ● Y座標変更
  #--------------------------------------------------------------------------
  def y=(y)
    @base_y = y
    for i in 0...@item_max
      @cmd_sprite.set_y(y + real_i(i) * H)
    end
  end
  #--------------------------------------------------------------------------
  # ● Index変更
  #--------------------------------------------------------------------------
  def index=(i)
    @Index = (i + 1) % @item_max
    move(M_CUR_UP)
    reset
  end
  #--------------------------------------------------------------------------
  # ● RealIndex
  #--------------------------------------------------------------------------
  def real_i(i)
    return ((i - @index + @item_max + 1) % @item_max)
  end
  #--------------------------------------------------------------------------
  # ● アクター設定
  #--------------------------------------------------------------------------
  def set_actor(actor)
    attack_icon = actor.weapon_id == 0 ? HAND : $data_weapons[actor.weapon_id].icon_name
if USE_ACT_CMD
    unless ACT_CMD_I[actor.id].nil?
      for i in 0...@item_max
        @cmd_sprite.bitmap.clear
        @cmd_sprite.draw_icon(attack_icon) if i == 0
        icn = ACT_CMD_I[actor.id].nil? ? @icon : ACT_CMD_I[actor.id]
        @cmd_sprite.draw_icon(icn)
      end
    else
      draw_attack_icon(attack_icon)
    end
    cmds = ACT_CMD_T[actor.id].nil? ? @text : ACT_CMD_T[actor.id]
    for i in 0...@item_max
      txt = cmds.nil? ? @text : cmds
      @cmd_sprite.draw_text(txt)
    end
else
    draw_attack_icon(attack_icon)
end
  end
  # 個別を使わなかった時用のメソッド
  def draw_attack_icon(attack_icon)
    @cmd_sprite[0].bitmap.clear
    @cmd_sprite[0].draw_icon(attack_icon)
    @cmd_sprite[0].draw_icon(ATTACK)
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
    return unless @active
    # 方向ボタンの下が押された場合
    if Input.repeat?(Input::DOWN)
      $game_system.se_play($data_system.cursor_se)
      move(M_CUR_DW)
    end
    # 方向ボタンの上が押された場合
    if Input.repeat?(Input::UP)
      $game_system.se_play($data_system.cursor_se)
      move(M_CUR_UP)
    end
    update_motion
  end
  #--------------------------------------------------------------------------
  # ● モーション設定
  #--------------------------------------------------------------------------
  def move(mode)
    case mode
    when M_CUR_UP
      @index = (@index - 1 + @item_max) % @item_max
      fast_index = (@index - 1 + @item_max) % @item_max
    when M_CUR_DW
      fast_index = (@index - 1 + @item_max) % @item_max
      @index = (@index + 1) % @item_max
    else; return
    end
    @mode = mode
    for i in 0...@item_max
      @cmd_sprite.target(@base_y + real_i(i) * H, i == @index, i == fast_index)
    end
  end
  #--------------------------------------------------------------------------
  # ● モーション動作
  #--------------------------------------------------------------------------
  def update_motion
    return if @mode == M_WAIT
    moving = false
    for sprite in @cmd_sprite
      moving |= sprite.update
    end
    @mode = M_WAIT unless moving
  end
  #--------------------------------------------------------------------------
  # ● モーションリセット
  #--------------------------------------------------------------------------
  def reset
    for sprite in @cmd_sprite
      sprite.reset
    end
    @mode = M_WAIT
  end
end

class SpriteCmdIcon < Sprite
  OPLUS = 25
  include RICH_ACTCMD
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize(icon, text)
    super(nil)
    self.bitmap = Bitmap.new(28, H)
    @view = Viewport.new(20, Y, W, H)
    @t_sprite = Sprite.new(@view)
    @t_sprite.bitmap = Bitmap.new(W, H)
    self.z = 1001
    @t_sprite.viewport.z = 1000
    #
    draw_icon(icon)
    draw_text(text)
  end
  #--------------------------------------------------------------------------
  # ● オブジェクト開放
  #--------------------------------------------------------------------------
  def dispose
    self.bitmap.dispose
    super
    @t_sprite.bitmap.dispose
    @t_sprite.dispose
    @view.dispose
  end
  #--------------------------------------------------------------------------
  # ● アイコン描画
  #--------------------------------------------------------------------------
  def draw_icon(icon)
    return if icon == nil
    bit = RPG::Cache.icon(icon)
    self.bitmap.blt(4, (H-24)/2, bit, Rect.new(0, 0, bit.width, bit.height))
  end
  #--------------------------------------------------------------------------
  # ● テキスト描画
  #--------------------------------------------------------------------------
  def draw_text(text)
    @t_sprite.bitmap.clear
    @t_sprite.bitmap.fill_rect(0,0,W,H, RICH_ACTCMD::BACK)
    @t_sprite.bitmap.draw_text(34, 0, W-34, H, text)
  end
  #--------------------------------------------------------------------------
  # ● X座標変更
  #--------------------------------------------------------------------------
  def set_x(x)
    self.x = x
    r = @t_sprite.viewport.rect
    @t_sprite.viewport.rect.set(x, r.y, r.width, r.height)
  end
  #--------------------------------------------------------------------------
  # ● Y座標変更
  #--------------------------------------------------------------------------
  def set_y(y)
    self.y = y
    r = @t_sprite.viewport.rect
    @t_sprite.viewport.rect.set(r.x, y, r.width, r.height)
  end
  #--------------------------------------------------------------------------
  # ● Y座標、幅変更
  #--------------------------------------------------------------------------
  def change(y, w)
    self.y = y
    r = @t_sprite.viewport.rect
    @t_sprite.viewport.rect.set(r.x, y, w, r.height)
  end
  #--------------------------------------------------------------------------
  # ● 不透明度変更
  #--------------------------------------------------------------------------
  def opacity=(o)
    super(o)
    @t_sprite.opacity = o
  end
  #--------------------------------------------------------------------------
  # ● 可視状態変更
  #--------------------------------------------------------------------------
  def visible=(flag)
    super(flag)
    @t_sprite.visible = flag
  end
  #--------------------------------------------------------------------------
  # ● 座標目標設定
  #--------------------------------------------------------------------------
  def target(y, enable=true, fast=false)
    @target_y = y
    @target_opacity = enable ? 255 : OP
    @target_w = enable ? W : 32
    @m_f = fast ? M_F[0] : M_F[1]
    @w_f = enable ? W_F[0] : W_F[1]
  end
  #--------------------------------------------------------------------------
  # ● 座標確定
  #--------------------------------------------------------------------------
  def reset
    change(@target_y, @target_w)
    self.opacity = @target_opacity
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
    moving = false
    if self.y != @target_y or @t_sprite.viewport.rect.width != @target_w
      y = calc_diff(self.y, @target_y, @m_f)
      w = calc_diff(@t_sprite.viewport.rect.width, @target_w, @w_f)
      change(y, w)
      moving = true
    end
    if self.opacity != @target_opacity
      self.opacity = calc_diff(self.opacity, @target_opacity, OPLUS)
      moving = true
    end
    return moving
  end
  #--------------------------------------------------------------------------
  # ● 目標との差を計算
  #--------------------------------------------------------------------------
  def calc_diff(org, target, step)
    plus = org < target ? step : -step
    return ( (org - target).abs > step ? (org + plus) : target )
  end
end




#==============================================================================
# ■ Scene_Battle (分割定義 1)
#==============================================================================
class Scene_Battle
  #--------------------------------------------------------------------------
  # ● メイン処理
  #--------------------------------------------------------------------------
  def main
    # 戦闘用の各種一時データを初期化
    $game_temp.in_battle = true
    $game_temp.battle_turn = 0
    $game_temp.battle_event_flags.clear
    $game_temp.battle_abort = false
    $game_temp.battle_main_phase = false
    $game_temp.battleback_name = $game_map.battleback_name
    $game_temp.forcing_battler = nil
    # バトルイベント用インタプリタを初期化
    $game_system.battle_interpreter.setup(nil, 0)
    # トループを準備
    @troop_id = $game_temp.battle_troop_id
    $game_troop.setup(@troop_id)
    # アクターコマンドウィンドウを作成
    @actor_command_window = WindowBattleActorCmd.new
=begin
    s1 = $data_system.words.attack
    s2 = $data_system.words.skill
    s3 = $data_system.words.guard
    s4 = $data_system.words.item
    @actor_command_window = Window_Command.new(160, [s1, s2, s3, s4])
    @actor_command_window.y = 160
    @actor_command_window.back_opacity = 160
=end
    @actor_command_window.active = false
    @actor_command_window.visible = false
    # その他のウィンドウを作成
    @party_command_window = Window_PartyCommand.new
    @help_window = Window_Help.new
    @help_window.back_opacity = 160
    @help_window.visible = false
    @status_window = Window_BattleStatus.new
    @message_window = Window_Message.new
    # スプライトセットを作成
    @spriteset = Spriteset_Battle.new
    # ウェイトカウントを初期化
    @wait_count = 0
    # トランジション実行
    if $data_system.battle_transition == ""
      Graphics.transition(20)
    else
      Graphics.transition(40, "Graphics/Transitions/" +
        $data_system.battle_transition)
    end
    # プレバトルフェーズ開始
    start_phase1
    # メインループ
    loop do
      # ゲーム画面を更新
      Graphics.update
      # 入力情報を更新
      Input.update
      # フレーム更新
      update
      # 画面が切り替わったらループを中断
      if $scene != self
        break
      end
    end
    # マップをリフレッシュ
    $game_map.refresh
    # トランジション準備
    Graphics.freeze
    # ウィンドウを解放
    @actor_command_window.dispose
    @party_command_window.dispose
    @help_window.dispose
    @status_window.dispose
    @message_window.dispose
    if @skill_window != nil
      @skill_window.dispose
    end
    if @item_window != nil
      @item_window.dispose
    end
    if @result_window != nil
      @result_window.dispose
    end
    # スプライトセットを解放
    @spriteset.dispose
    # タイトル画面に切り替え中の場合
    if $scene.is_a?(Scene_Title)
      # 画面をフェードアウト
      Graphics.transition
      Graphics.freeze
    end
    # 戦闘テストからゲームオーバー画面以外に切り替え中の場合
    if $BTEST and not $scene.is_a?(Scene_Gameover)
      $scene = nil
    end
    $game_system.check_cache
  end
  #--------------------------------------------------------------------------
  # ● アクターコマンドウィンドウのセットアップ
  #--------------------------------------------------------------------------
  alias phase3_setup_command_window_rich phase3_setup_command_window
  def phase3_setup_command_window
    @actor_command_window.set_actor(@active_battler)
    phase3_setup_command_window_rich
  end
end[/pre]
[pre lang="ruby" line="1"]=begin
★サイドビュー戦闘用 アクター位置追従パッチ
  [順番]
    サイドビュー戦闘
    リッチアクターコマンド
    このパッチ
=end

if defined?(SideView) and defined?(RICH_ACTCMD)

class Scene_Battle
  #--------------------------------------------------------------------------
  # ● メイン処理  [再定義]
  #--------------------------------------------------------------------------
  def main
    # 戦闘用の各種一時データを初期化
    $game_temp.in_battle = true
    $game_temp.battle_turn = 0
    $game_temp.battle_event_flags.clear
    $game_temp.battle_abort = false
    $game_temp.battle_main_phase = false
    $game_temp.battleback_name = $game_map.battleback_name
    $game_temp.forcing_battler = nil
    # バトルイベント用インタプリタを初期化
    $game_system.battle_interpreter.setup(nil, 0)
    # トループを準備
    @troop_id = $game_temp.battle_troop_id
    $game_troop.setup(@troop_id)
    # トループウィンドウを作成
    @troop_window = Window_EnemyList.new
    # アクターコマンドウィンドウを作成
    @actor_command_window = WindowBattleActorCmd.new
=begin
    s1 = $data_system.words.attack
    s2 = $data_system.words.skill
    s3 = $data_system.words.guard
    s4 = $data_system.words.item
    @actor_command_window = Window_Command.new(160, [s1, s2, s3, s4])
    @actor_command_window.y = 160
    @actor_command_window.back_opacity = 160
=end
    @actor_command_window.active = false
    @actor_command_window.visible = false
    # その他のウィンドウを作成
    @party_command_window = Window_PartyCommand.new
    @help_window = Window_Help.new
    @help_window.back_opacity = 160
    @help_window.visible = false
    @status_window = Window_BattleStatus.new
    @message_window = Window_Message.new
    # スプライトセットを作成
    @spriteset = Spriteset_Battle.new
    # ウェイトカウントを初期化
    @wait_count = 0
    # トランジション実行
    if $data_system.battle_transition == ""
      Graphics.transition(20)
    else
      Graphics.transition(40, "Graphics/Transitions/" +
        $data_system.battle_transition)
    end
    # プレバトルフェーズ開始
    start_phase1
    # メインループ
    loop do
      # ゲーム画面を更新
      Graphics.update
      # 入力情報を更新
      Input.update
      # フレーム更新
      update
      # 画面が切り替わったらループを中断
      if $scene != self
        break
      end
    end
    # マップをリフレッシュ
    $game_map.refresh
    # トランジション準備
    Graphics.freeze
    # ウィンドウを解放
    @troop_window.dispose
    @actor_command_window.dispose
    @party_command_window.dispose
    @help_window.dispose
    @status_window.dispose
    @message_window.dispose
    if @skill_window != nil
      @skill_window.dispose
    end
    if @item_window != nil
      @item_window.dispose
    end
    if @result_window != nil
      @result_window.dispose
    end
    # スプライトセットを解放
    @spriteset.dispose
    # タイトル画面に切り替え中の場合
    if $scene.is_a?(Scene_Title)
      # 画面をフェードアウト
      Graphics.transition
      Graphics.freeze
    end
    # 戦闘テストからゲームオーバー画面以外に切り替え中の場合
    if $BTEST and not $scene.is_a?(Scene_Gameover)
      $scene = nil
    end
  end
  #--------------------------------------------------------------------------
  # ● アクターコマンドウィンドウのセットアップ
  #--------------------------------------------------------------------------
  alias phase3_setup_command_window_sdv_rich phase3_setup_command_window
  def phase3_setup_command_window
    phase3_setup_command_window_sdv_rich
    # アクターコマンドウィンドウの位置を設定
    @actor_command_window.x = @active_battler.screen_x - (RICH_ACTCMD::W / 2)
    @actor_command_window.y = @active_battler.screen_y - (RICH_ACTCMD::H * 4)
  end
end


end # defined?(SideView) and defined?(RICH_ACTCMD)[/pre]
以上{:7_298:}

评分

参与人数 1星屑 +90 收起 理由
myownroc + 90 塞糖

查看全部评分

不定期回来6R玩。
↓下方广告帖,欢迎点击
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部