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

Project1

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

[RM脚本] 步行图脚本

 关闭 [复制链接]

Lv1.梦旅人

NewS-

梦石
0
星屑
50
在线时间
5 小时
注册时间
2005-10-23
帖子
3651

贵宾

跳转到指定楼层
1
发表于 2006-5-29 22:41:45 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
效果图:



[概要]
横向きの歩行グラフィックをバトルフィールドに表示し、
攻撃時に任意の歩数ぶん前へ移動します。
歩行グラフィックの設定をそのまま使用するので、
サイドビュー用のバトラーグラフィックを用意する必要がありません。

  1. #==============================================================================
  2. # ++ サイドビューバトル(歩行グラフィック版) ver. 1.14 ++
  3. #  Script by パラ犬
  4. #  http://para.j-mx.com/
  5. #------------------------------------------------------------------------------
  6. # バトルフィールドに歩行グラフィックを表示します。
  7. #==============================================================================

  8. module SDVA
  9.   
  10.   X_LINE = 500        # 横位置のバトラー表示座標
  11.   Y_LINE = 200        # 縦位置のバトラー表示座標
  12.   X_SPACE = 15        # 横位置のバトラー同士の間隔
  13.   Y_SPACE = 40        # 縦位置のバトラー同士の間隔
  14.   X_POSITION = 25     # 隊列[前衛・中衛・後衛]の横間隔
  15.   Y_POSITION = 0      # 隊列[前衛・中衛・後衛]の縦間隔
  16.   
  17.   ATTACK_MOVE = true  # 攻撃時に前へ踏み出すか( true / false )
  18.   SKILL_MOVE = true   # スキル使用時に前へ踏み出すか( true / false )
  19.   ITEM_MOVE = false   # アイテム使用時に前へ踏み出すか( true / false )
  20.   MOVE_STEP = 1       # 移動歩数
  21.   MOVE_PIXEL = 10     # 一歩あたりのピクセル数
  22.   
  23.   PARTY_POS = 1       # キャラクターの向き( 0:下 / 1:左 / 2:右 / 3:上 )

  24.   WINDOWPOS_CHANGE = true   # コマンドウインドウをバトラーの横に表示するか( true / false )

  25.   end
  26.   
  27. #==============================================================================
  28. # ■ Game_Actor
  29. #==============================================================================

  30. class Game_Actor < Game_Battler
  31.   #--------------------------------------------------------------------------
  32.   # ● バトル画面 X 座標の取得
  33.   #--------------------------------------------------------------------------
  34.   def screen_x
  35.     if self.index != nil
  36.       # 隊列を取得
  37.       pos = $data_classes[self.class_id].position
  38.       x_pos = pos * SDVA::X_POSITION
  39.       scr_x = self.index * SDVA::X_SPACE + SDVA::X_LINE + x_pos
  40.       # 移動アクションのとき
  41.       if self.current_action.move_action == true
  42.         # 横に移動
  43.         scr_x += @shift_x
  44.       end
  45.       return scr_x
  46.     else
  47.       return 0
  48.     end
  49.   end
  50.   #--------------------------------------------------------------------------
  51.   # ● バトル画面 Y 座標の取得
  52.   #--------------------------------------------------------------------------
  53.   def screen_y
  54.     if self.index != nil
  55.       # 隊列を取得
  56.       pos = $data_classes[self.class_id].position
  57.       y_pos = pos * SDVA::Y_POSITION
  58.       scr_y = self.index * SDVA::Y_SPACE + SDVA::Y_LINE + y_pos
  59.       # 移動アクションのとき
  60.       if self.current_action.move_action == true
  61.         # 縦に移動
  62.         scr_y += @shift_y
  63.       end
  64.       return scr_y
  65.     else
  66.       return 0
  67.     end
  68.   end
  69.   #--------------------------------------------------------------------------
  70.   # ● バトル画面 Z 座標の取得
  71.   #--------------------------------------------------------------------------
  72.   def screen_z
  73.     if self.index != nil
  74.       return self.index
  75.     else
  76.       return 0
  77.     end
  78.   end
  79. end

  80. #==============================================================================
  81. # ■ Game_Battler (分割定義 1)
  82. #==============================================================================

  83. class Game_Battler
  84.   #--------------------------------------------------------------------------
  85.   # ● 公開インスタンス変数
  86.   #--------------------------------------------------------------------------
  87.   attr_reader   :pattern        # 歩行パターン
  88.   attr_reader   :trans_x        # X方向の移動距離
  89.   attr_reader   :moving         # 移動中フラグ
  90.   #--------------------------------------------------------------------------
  91.   # ● オブジェクト初期化
  92.   #--------------------------------------------------------------------------
  93.   alias initialize_sdva initialize
  94.   def initialize
  95.     initialize_sdva
  96.     move_reset
  97.   end
  98.   #--------------------------------------------------------------------------
  99.   # ○ 移動カウント
  100.   #--------------------------------------------------------------------------
  101.   def move
  102.     @moving = 1
  103.       if @step < SDVA::MOVE_STEP
  104.         # 歩数を満たすまで移動
  105.         @pattern = (@pattern + 1) % 4
  106.         @step += 1
  107.         move_step
  108.       else
  109.         # 移動終了
  110.         @pattern = 1
  111.         @moving = 2
  112.       end
  113.   end
  114.   #--------------------------------------------------------------------------
  115.   # ○ 移動処理
  116.   #--------------------------------------------------------------------------
  117.   def move_step
  118.   # パーティの向きによって移動座標を変える
  119.   case SDVA::PARTY_POS
  120.     when 0
  121.       @shift_y = @step * SDVA::MOVE_PIXEL
  122.     when 1
  123.       @shift_x = -(@step * SDVA::MOVE_PIXEL)
  124.     when 2
  125.       @shift_x = @step * SDVA::MOVE_PIXEL
  126.     when 3
  127.       @shift_y = -(@step * SDVA::MOVE_PIXEL)
  128.     end      
  129.   end
  130.   #--------------------------------------------------------------------------
  131.   # ○ 移動のリセット
  132.   #--------------------------------------------------------------------------
  133.   def move_reset
  134.     @moving = 0
  135.     @pattern = 0
  136.     @step = 0
  137.     @shift_x = 0
  138.     @shift_y = 0
  139.   end
  140. end

  141. #==============================================================================
  142. # ■ Game_BattleAction
  143. #==============================================================================

  144. class Game_BattleAction
  145.   #--------------------------------------------------------------------------
  146.   # ● 公開インスタンス変数
  147.   #--------------------------------------------------------------------------
  148.   attr_accessor :move_action             # 移動するアクションか
  149.   #--------------------------------------------------------------------------
  150.   # ● クリア
  151.   #--------------------------------------------------------------------------
  152.   alias clear_sdva clear
  153.   def clear
  154.     clear_sdva
  155.     @move_action = false
  156.   end
  157. end

  158. #==============================================================================
  159. # ■ Sprite_Battler
  160. #==============================================================================

  161. class Sprite_Battler < RPG::Sprite
  162.   #--------------------------------------------------------------------------
  163.   # ● フレーム更新
  164.   #--------------------------------------------------------------------------
  165.   alias update_sdva update
  166.   def update
  167.     # バトラーがアクターに含まれるとき
  168.     if @battler.is_a?(Game_Actor)
  169.       # ファイル名か色相が現在のものと異なる場合
  170.       # 行動中の場合
  171.       if @battler.battler_name != @battler_name or
  172.          @battler.battler_hue != @battler_hue or
  173.          @battler.current_action.basic == 0 or
  174.          @battler.current_action.kind != 3
  175.         # ビットマップを取得、設定
  176.         @character_name = @battler.character_name
  177.         @character_hue = @battler.character_hue
  178.         # 歩行グラフィックを描画
  179.         self.bitmap = RPG::Cache.character(@character_name, @character_hue)
  180.         cw = self.bitmap.width / 4
  181.         ch = self.bitmap.height / 4
  182.         @width = cw
  183.         @height = ch
  184.         if @battler.current_action.move_action == true
  185.           # 歩かせる
  186.           @battler.move
  187.         else
  188.           @battler.move_reset
  189.         end
  190.         # 転送元の矩形を設定
  191.         sx = @battler.pattern * cw
  192.         sy = SDVA::PARTY_POS * ch
  193.         self.src_rect.set(sx, sy, cw, ch)
  194.         self.ox = @width / 2
  195.         self.oy = @height
  196.         # 隠れ状態なら不透明度を 0 にする
  197.         if @battler.hidden
  198.           self.opacity = 0
  199.         end
  200.       end
  201.     end
  202.     update_sdva
  203.   end
  204. end
  205.   
  206. #==============================================================================
  207. # ■ Scene_Battle
  208. #==============================================================================

  209. class Scene_Battle
  210.   #--------------------------------------------------------------------------
  211.   # ● アクターコマンドウィンドウのセットアップ
  212.   #--------------------------------------------------------------------------
  213.   alias phase3_setup_command_window_sdva phase3_setup_command_window
  214.   def phase3_setup_command_window
  215.     phase3_setup_command_window_sdva
  216.     if SDVA::WINDOWPOS_CHANGE
  217.       # アクターコマンドウィンドウの位置を設定
  218.       case SDVA::PARTY_POS
  219.         when 0
  220.           x_pos = @active_battler.screen_x - (@actor_command_window.width/2)
  221.           y_pos = @active_battler.screen_y
  222.         when 1
  223.           x_pos = @active_battler.screen_x - @actor_command_window.width - 16
  224.           y_pos = @active_battler.screen_y - @actor_command_window.height
  225.         when 2
  226.           x_pos = @active_battler.screen_x + 16
  227.           y_pos = @active_battler.screen_y - @actor_command_window.height
  228.         when 3
  229.           x_pos = @active_battler.screen_x - (@actor_command_window.width/2)
  230.           y_pos = @active_battler.screen_y - @actor_command_window.height - 48
  231.       end
  232.       @actor_command_window.x = x_pos >= 0 ? x_pos : 0
  233.       @actor_command_window.x = x_pos+@actor_command_window.width <= 640 ? x_pos : 640-@actor_command_window.width
  234.       @actor_command_window.y = y_pos >= 0 ? y_pos : 0
  235.       @actor_command_window.y = y_pos+@actor_command_window.height <= 480 ? y_pos : 480-@actor_command_window.height
  236.       # ステータスウインドウに隠れないように
  237.       @actor_command_window.z = 9999
  238.     end
  239.   end
  240.   #--------------------------------------------------------------------------
  241.   # ● フレーム更新 (メインフェーズ ステップ 3 : 行動側アニメーション)
  242.   #--------------------------------------------------------------------------
  243.   alias update_phase4_step3_sdva update_phase4_step3
  244.   def update_phase4_step3
  245.     if SDVA::ATTACK_MOVE
  246.       if @active_battler.current_action.basic == 0
  247.         @active_battler.current_action.move_action = true
  248.       end
  249.     end
  250.     if SDVA::SKILL_MOVE
  251.       if @active_battler.current_action.kind == 1
  252.         @active_battler.current_action.move_action = true
  253.       end
  254.     end
  255.     if SDVA::ITEM_MOVE
  256.       if @active_battler.current_action.kind == 2
  257.         @active_battler.current_action.move_action = true
  258.       end
  259.     end
  260.     # バトラーがアクターに含まれ、移動アクション中
  261.     if @active_battler.is_a?(Game_Actor) and
  262.      @active_battler.current_action.move_action
  263.       # 移動終了時
  264.       if @active_battler.moving == 2
  265.         update_phase4_step3_sdva
  266.       end
  267.     elsif @active_battler.moving == 0
  268.       update_phase4_step3_sdva
  269.     end
  270.   end
  271.   #--------------------------------------------------------------------------
  272.   # ● フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)
  273.   #--------------------------------------------------------------------------
  274.   alias update_phase4_step6_sdva update_phase4_step6
  275.   def update_phase4_step6
  276.     @active_battler.current_action.move_action = false
  277.     @active_battler.move_reset
  278.     update_phase4_step6_sdva
  279.   end
  280. end

  281. #==============================================================================
  282. # ■ Spriteset_Battle
  283. #==============================================================================

  284. class Spriteset_Battle
  285.   #--------------------------------------------------------------------------
  286.   # ● オブジェクト初期化
  287.   #--------------------------------------------------------------------------
  288.   alias initialize_sdva initialize
  289.   def initialize
  290.     initialize_sdva
  291.     @viewport2.z = 1
  292.   end
  293. end

  294. #==============================================================================
  295. # ■ Arrow_Actor
  296. #==============================================================================

  297. class Arrow_Actor < Arrow_Base
  298.   #--------------------------------------------------------------------------
  299.   # ● フレーム更新
  300.   #--------------------------------------------------------------------------
  301.   alias update_sdva update
  302.   def update
  303.     update_sdva
  304.     # カーソル下
  305.     if Input.repeat?(Input::DOWN)
  306.       $game_system.se_play($data_system.cursor_se)
  307.       @index += 1
  308.       @index %= $game_party.actors.size
  309.     end
  310.     # カーソル上
  311.     if Input.repeat?(Input::UP)
  312.       $game_system.se_play($data_system.cursor_se)
  313.       @index += $game_party.actors.size - 1
  314.       @index %= $game_party.actors.size
  315.     end
  316.   end
  317. end

  318. #==============================================================================
  319. # ■ Arrow_Enemy
  320. #==============================================================================

  321. class Arrow_Enemy < Arrow_Base
  322.   #--------------------------------------------------------------------------
  323.   # ● フレーム更新
  324.   #--------------------------------------------------------------------------
  325.   alias update_sdva update
  326.   def update
  327.     update_sdva
  328.     # カーソル下
  329.     if Input.repeat?(Input::DOWN)
  330.       $game_system.se_play($data_system.cursor_se)
  331.       $game_troop.enemies.size.times do
  332.         @index += 1
  333.         @index %= $game_troop.enemies.size
  334.         break if self.enemy.exist?
  335.       end
  336.     end
  337.     # カーソル上
  338.     if Input.repeat?(Input::UP)
  339.       $game_system.se_play($data_system.cursor_se)
  340.       $game_troop.enemies.size.times do
  341.         @index += $game_troop.enemies.size - 1
  342.         @index %= $game_troop.enemies.size
  343.         break if self.enemy.exist?
  344.       end
  345.     end
  346.   end
  347. end
复制代码


[設定例]
設定項目を書き換えることで、パーティ位置を右側以外にも設定できます。

例:フロントビュー
 (横向きのモンスターグラフィックがなくてもサイドビュー気分)


  X_LINE = 140   # 横位置のバトラー表示座標
  Y_LINE = 290   # 縦位置のバトラー表示座標
  X_SPACE = 120   # 横位置のバトラー同士の間隔
  Y_SPACE = 0   # 縦位置のバトラー同士の間隔
  X_POSITION = 0   # 隊列[前衛・中衛・後衛]の横間隔
  Y_POSITION = 10   # 隊列[前衛・中衛・後衛]の縦間隔
  PARTY_POS = 3   # キャラクターの向き( 0:下 / 1:左 / 2:右 / 3:上 )

66RPG,这几个简单字符,之于我代表了什么?泪泪博客:http://hi.baidu.com/rpgmakerxp

Lv1.梦旅人

NewS-

梦石
0
星屑
50
在线时间
5 小时
注册时间
2005-10-23
帖子
3651

贵宾

2
 楼主| 发表于 2006-5-29 22:41:45 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
效果图:



[概要]
横向きの歩行グラフィックをバトルフィールドに表示し、
攻撃時に任意の歩数ぶん前へ移動します。
歩行グラフィックの設定をそのまま使用するので、
サイドビュー用のバトラーグラフィックを用意する必要がありません。

  1. #==============================================================================
  2. # ++ サイドビューバトル(歩行グラフィック版) ver. 1.14 ++
  3. #  Script by パラ犬
  4. #  http://para.j-mx.com/
  5. #------------------------------------------------------------------------------
  6. # バトルフィールドに歩行グラフィックを表示します。
  7. #==============================================================================

  8. module SDVA
  9.   
  10.   X_LINE = 500        # 横位置のバトラー表示座標
  11.   Y_LINE = 200        # 縦位置のバトラー表示座標
  12.   X_SPACE = 15        # 横位置のバトラー同士の間隔
  13.   Y_SPACE = 40        # 縦位置のバトラー同士の間隔
  14.   X_POSITION = 25     # 隊列[前衛・中衛・後衛]の横間隔
  15.   Y_POSITION = 0      # 隊列[前衛・中衛・後衛]の縦間隔
  16.   
  17.   ATTACK_MOVE = true  # 攻撃時に前へ踏み出すか( true / false )
  18.   SKILL_MOVE = true   # スキル使用時に前へ踏み出すか( true / false )
  19.   ITEM_MOVE = false   # アイテム使用時に前へ踏み出すか( true / false )
  20.   MOVE_STEP = 1       # 移動歩数
  21.   MOVE_PIXEL = 10     # 一歩あたりのピクセル数
  22.   
  23.   PARTY_POS = 1       # キャラクターの向き( 0:下 / 1:左 / 2:右 / 3:上 )

  24.   WINDOWPOS_CHANGE = true   # コマンドウインドウをバトラーの横に表示するか( true / false )

  25.   end
  26.   
  27. #==============================================================================
  28. # ■ Game_Actor
  29. #==============================================================================

  30. class Game_Actor < Game_Battler
  31.   #--------------------------------------------------------------------------
  32.   # ● バトル画面 X 座標の取得
  33.   #--------------------------------------------------------------------------
  34.   def screen_x
  35.     if self.index != nil
  36.       # 隊列を取得
  37.       pos = $data_classes[self.class_id].position
  38.       x_pos = pos * SDVA::X_POSITION
  39.       scr_x = self.index * SDVA::X_SPACE + SDVA::X_LINE + x_pos
  40.       # 移動アクションのとき
  41.       if self.current_action.move_action == true
  42.         # 横に移動
  43.         scr_x += @shift_x
  44.       end
  45.       return scr_x
  46.     else
  47.       return 0
  48.     end
  49.   end
  50.   #--------------------------------------------------------------------------
  51.   # ● バトル画面 Y 座標の取得
  52.   #--------------------------------------------------------------------------
  53.   def screen_y
  54.     if self.index != nil
  55.       # 隊列を取得
  56.       pos = $data_classes[self.class_id].position
  57.       y_pos = pos * SDVA::Y_POSITION
  58.       scr_y = self.index * SDVA::Y_SPACE + SDVA::Y_LINE + y_pos
  59.       # 移動アクションのとき
  60.       if self.current_action.move_action == true
  61.         # 縦に移動
  62.         scr_y += @shift_y
  63.       end
  64.       return scr_y
  65.     else
  66.       return 0
  67.     end
  68.   end
  69.   #--------------------------------------------------------------------------
  70.   # ● バトル画面 Z 座標の取得
  71.   #--------------------------------------------------------------------------
  72.   def screen_z
  73.     if self.index != nil
  74.       return self.index
  75.     else
  76.       return 0
  77.     end
  78.   end
  79. end

  80. #==============================================================================
  81. # ■ Game_Battler (分割定義 1)
  82. #==============================================================================

  83. class Game_Battler
  84.   #--------------------------------------------------------------------------
  85.   # ● 公開インスタンス変数
  86.   #--------------------------------------------------------------------------
  87.   attr_reader   :pattern        # 歩行パターン
  88.   attr_reader   :trans_x        # X方向の移動距離
  89.   attr_reader   :moving         # 移動中フラグ
  90.   #--------------------------------------------------------------------------
  91.   # ● オブジェクト初期化
  92.   #--------------------------------------------------------------------------
  93.   alias initialize_sdva initialize
  94.   def initialize
  95.     initialize_sdva
  96.     move_reset
  97.   end
  98.   #--------------------------------------------------------------------------
  99.   # ○ 移動カウント
  100.   #--------------------------------------------------------------------------
  101.   def move
  102.     @moving = 1
  103.       if @step < SDVA::MOVE_STEP
  104.         # 歩数を満たすまで移動
  105.         @pattern = (@pattern + 1) % 4
  106.         @step += 1
  107.         move_step
  108.       else
  109.         # 移動終了
  110.         @pattern = 1
  111.         @moving = 2
  112.       end
  113.   end
  114.   #--------------------------------------------------------------------------
  115.   # ○ 移動処理
  116.   #--------------------------------------------------------------------------
  117.   def move_step
  118.   # パーティの向きによって移動座標を変える
  119.   case SDVA::PARTY_POS
  120.     when 0
  121.       @shift_y = @step * SDVA::MOVE_PIXEL
  122.     when 1
  123.       @shift_x = -(@step * SDVA::MOVE_PIXEL)
  124.     when 2
  125.       @shift_x = @step * SDVA::MOVE_PIXEL
  126.     when 3
  127.       @shift_y = -(@step * SDVA::MOVE_PIXEL)
  128.     end      
  129.   end
  130.   #--------------------------------------------------------------------------
  131.   # ○ 移動のリセット
  132.   #--------------------------------------------------------------------------
  133.   def move_reset
  134.     @moving = 0
  135.     @pattern = 0
  136.     @step = 0
  137.     @shift_x = 0
  138.     @shift_y = 0
  139.   end
  140. end

  141. #==============================================================================
  142. # ■ Game_BattleAction
  143. #==============================================================================

  144. class Game_BattleAction
  145.   #--------------------------------------------------------------------------
  146.   # ● 公開インスタンス変数
  147.   #--------------------------------------------------------------------------
  148.   attr_accessor :move_action             # 移動するアクションか
  149.   #--------------------------------------------------------------------------
  150.   # ● クリア
  151.   #--------------------------------------------------------------------------
  152.   alias clear_sdva clear
  153.   def clear
  154.     clear_sdva
  155.     @move_action = false
  156.   end
  157. end

  158. #==============================================================================
  159. # ■ Sprite_Battler
  160. #==============================================================================

  161. class Sprite_Battler < RPG::Sprite
  162.   #--------------------------------------------------------------------------
  163.   # ● フレーム更新
  164.   #--------------------------------------------------------------------------
  165.   alias update_sdva update
  166.   def update
  167.     # バトラーがアクターに含まれるとき
  168.     if @battler.is_a?(Game_Actor)
  169.       # ファイル名か色相が現在のものと異なる場合
  170.       # 行動中の場合
  171.       if @battler.battler_name != @battler_name or
  172.          @battler.battler_hue != @battler_hue or
  173.          @battler.current_action.basic == 0 or
  174.          @battler.current_action.kind != 3
  175.         # ビットマップを取得、設定
  176.         @character_name = @battler.character_name
  177.         @character_hue = @battler.character_hue
  178.         # 歩行グラフィックを描画
  179.         self.bitmap = RPG::Cache.character(@character_name, @character_hue)
  180.         cw = self.bitmap.width / 4
  181.         ch = self.bitmap.height / 4
  182.         @width = cw
  183.         @height = ch
  184.         if @battler.current_action.move_action == true
  185.           # 歩かせる
  186.           @battler.move
  187.         else
  188.           @battler.move_reset
  189.         end
  190.         # 転送元の矩形を設定
  191.         sx = @battler.pattern * cw
  192.         sy = SDVA::PARTY_POS * ch
  193.         self.src_rect.set(sx, sy, cw, ch)
  194.         self.ox = @width / 2
  195.         self.oy = @height
  196.         # 隠れ状態なら不透明度を 0 にする
  197.         if @battler.hidden
  198.           self.opacity = 0
  199.         end
  200.       end
  201.     end
  202.     update_sdva
  203.   end
  204. end
  205.   
  206. #==============================================================================
  207. # ■ Scene_Battle
  208. #==============================================================================

  209. class Scene_Battle
  210.   #--------------------------------------------------------------------------
  211.   # ● アクターコマンドウィンドウのセットアップ
  212.   #--------------------------------------------------------------------------
  213.   alias phase3_setup_command_window_sdva phase3_setup_command_window
  214.   def phase3_setup_command_window
  215.     phase3_setup_command_window_sdva
  216.     if SDVA::WINDOWPOS_CHANGE
  217.       # アクターコマンドウィンドウの位置を設定
  218.       case SDVA::PARTY_POS
  219.         when 0
  220.           x_pos = @active_battler.screen_x - (@actor_command_window.width/2)
  221.           y_pos = @active_battler.screen_y
  222.         when 1
  223.           x_pos = @active_battler.screen_x - @actor_command_window.width - 16
  224.           y_pos = @active_battler.screen_y - @actor_command_window.height
  225.         when 2
  226.           x_pos = @active_battler.screen_x + 16
  227.           y_pos = @active_battler.screen_y - @actor_command_window.height
  228.         when 3
  229.           x_pos = @active_battler.screen_x - (@actor_command_window.width/2)
  230.           y_pos = @active_battler.screen_y - @actor_command_window.height - 48
  231.       end
  232.       @actor_command_window.x = x_pos >= 0 ? x_pos : 0
  233.       @actor_command_window.x = x_pos+@actor_command_window.width <= 640 ? x_pos : 640-@actor_command_window.width
  234.       @actor_command_window.y = y_pos >= 0 ? y_pos : 0
  235.       @actor_command_window.y = y_pos+@actor_command_window.height <= 480 ? y_pos : 480-@actor_command_window.height
  236.       # ステータスウインドウに隠れないように
  237.       @actor_command_window.z = 9999
  238.     end
  239.   end
  240.   #--------------------------------------------------------------------------
  241.   # ● フレーム更新 (メインフェーズ ステップ 3 : 行動側アニメーション)
  242.   #--------------------------------------------------------------------------
  243.   alias update_phase4_step3_sdva update_phase4_step3
  244.   def update_phase4_step3
  245.     if SDVA::ATTACK_MOVE
  246.       if @active_battler.current_action.basic == 0
  247.         @active_battler.current_action.move_action = true
  248.       end
  249.     end
  250.     if SDVA::SKILL_MOVE
  251.       if @active_battler.current_action.kind == 1
  252.         @active_battler.current_action.move_action = true
  253.       end
  254.     end
  255.     if SDVA::ITEM_MOVE
  256.       if @active_battler.current_action.kind == 2
  257.         @active_battler.current_action.move_action = true
  258.       end
  259.     end
  260.     # バトラーがアクターに含まれ、移動アクション中
  261.     if @active_battler.is_a?(Game_Actor) and
  262.      @active_battler.current_action.move_action
  263.       # 移動終了時
  264.       if @active_battler.moving == 2
  265.         update_phase4_step3_sdva
  266.       end
  267.     elsif @active_battler.moving == 0
  268.       update_phase4_step3_sdva
  269.     end
  270.   end
  271.   #--------------------------------------------------------------------------
  272.   # ● フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)
  273.   #--------------------------------------------------------------------------
  274.   alias update_phase4_step6_sdva update_phase4_step6
  275.   def update_phase4_step6
  276.     @active_battler.current_action.move_action = false
  277.     @active_battler.move_reset
  278.     update_phase4_step6_sdva
  279.   end
  280. end

  281. #==============================================================================
  282. # ■ Spriteset_Battle
  283. #==============================================================================

  284. class Spriteset_Battle
  285.   #--------------------------------------------------------------------------
  286.   # ● オブジェクト初期化
  287.   #--------------------------------------------------------------------------
  288.   alias initialize_sdva initialize
  289.   def initialize
  290.     initialize_sdva
  291.     @viewport2.z = 1
  292.   end
  293. end

  294. #==============================================================================
  295. # ■ Arrow_Actor
  296. #==============================================================================

  297. class Arrow_Actor < Arrow_Base
  298.   #--------------------------------------------------------------------------
  299.   # ● フレーム更新
  300.   #--------------------------------------------------------------------------
  301.   alias update_sdva update
  302.   def update
  303.     update_sdva
  304.     # カーソル下
  305.     if Input.repeat?(Input::DOWN)
  306.       $game_system.se_play($data_system.cursor_se)
  307.       @index += 1
  308.       @index %= $game_party.actors.size
  309.     end
  310.     # カーソル上
  311.     if Input.repeat?(Input::UP)
  312.       $game_system.se_play($data_system.cursor_se)
  313.       @index += $game_party.actors.size - 1
  314.       @index %= $game_party.actors.size
  315.     end
  316.   end
  317. end

  318. #==============================================================================
  319. # ■ Arrow_Enemy
  320. #==============================================================================

  321. class Arrow_Enemy < Arrow_Base
  322.   #--------------------------------------------------------------------------
  323.   # ● フレーム更新
  324.   #--------------------------------------------------------------------------
  325.   alias update_sdva update
  326.   def update
  327.     update_sdva
  328.     # カーソル下
  329.     if Input.repeat?(Input::DOWN)
  330.       $game_system.se_play($data_system.cursor_se)
  331.       $game_troop.enemies.size.times do
  332.         @index += 1
  333.         @index %= $game_troop.enemies.size
  334.         break if self.enemy.exist?
  335.       end
  336.     end
  337.     # カーソル上
  338.     if Input.repeat?(Input::UP)
  339.       $game_system.se_play($data_system.cursor_se)
  340.       $game_troop.enemies.size.times do
  341.         @index += $game_troop.enemies.size - 1
  342.         @index %= $game_troop.enemies.size
  343.         break if self.enemy.exist?
  344.       end
  345.     end
  346.   end
  347. end
复制代码


[設定例]
設定項目を書き換えることで、パーティ位置を右側以外にも設定できます。

例:フロントビュー
 (横向きのモンスターグラフィックがなくてもサイドビュー気分)


  X_LINE = 140   # 横位置のバトラー表示座標
  Y_LINE = 290   # 縦位置のバトラー表示座標
  X_SPACE = 120   # 横位置のバトラー同士の間隔
  Y_SPACE = 0   # 縦位置のバトラー同士の間隔
  X_POSITION = 0   # 隊列[前衛・中衛・後衛]の横間隔
  Y_POSITION = 10   # 隊列[前衛・中衛・後衛]の縦間隔
  PARTY_POS = 3   # キャラクターの向き( 0:下 / 1:左 / 2:右 / 3:上 )

66RPG,这几个简单字符,之于我代表了什么?泪泪博客:http://hi.baidu.com/rpgmakerxp
头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2006-5-17
帖子
26
3
发表于 2006-6-11 01:22:16 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

鬼隐

梦石
0
星屑
50
在线时间
0 小时
注册时间
2005-10-23
帖子
168
4
发表于 2006-6-11 02:28:11 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-3-4
帖子
22
5
发表于 2008-3-5 03:23:09 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-29 00:04

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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