- 注册时间
- 2006-7-25
- 最后登录
- 2019-5-18
②入门
- 积分
- 90
|
发表于 2006-7-25 08:41:24
|
显示全部楼层
初学者运气,偶从日本网站扒来的[战斗位置调整]
原文是4人队伍的,偶改成最大5人了
配合上面的脚本运行,这个脚本要先于上面的执行,就是说插入上面的5人脚本和main之间- #==============================================================================
- # ■ 戦闘位置調整 by Claimh
- #------------------------------------------------------------------------------
- # ・戦闘時のバトラーの表示位置を自動的に修正します。
- # ・1~5人まで対応。
- #==============================================================================
- # HPなどのテキスト修正
- class Window_BattleStatus < Window_Base
- #--------------------------------------------------------------------------
- # ● リフレッシュ(再定義)
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- @item_max = $game_party.actors.size
- for i in 0...$game_party.actors.size
- actor = $game_party.actors[i]
- #------
- case $game_party.actors.size
- when 1
- actor_x = 240
- when 2
- actor_x = i * 240 + 120 + 4
- when 3
- actor_x = i * 200 + 40 + 4
- when 4
- actor_x = i * 160 + 4
- when 5
- actor_x = i * 120 + 4
- end
- #------
- draw_actor_name(actor, actor_x, 0)
- draw_actor_hp(actor, actor_x, 32, 120)
- draw_actor_sp(actor, actor_x, 64, 120)
- if @level_up_flags[i]
- self.contents.font.color = normal_color
- self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
- else
- draw_actor_state(actor, actor_x, 96)
- end
- end
- end
- end
- # バトルコマンド
- class Scene_Battle
- #--------------------------------------------------------------------------
- # ● アクターコマンドウィンドウのセットアップ
- #--------------------------------------------------------------------------
- alias phase3_setup_command_window_cc phase3_setup_command_window
- def phase3_setup_command_window
- phase3_setup_command_window_cc
- case $game_party.actors.size
- when 1
- actor_x = 240
- when 2
- actor_x = @actor_index * 240 + 120
- when 3
- actor_x = @actor_index * 200 + 40
- when 4
- actor_x = @actor_index * 160
- when 5
- actor_x = @actor_index * 120
- end
- # アクターコマンドウィンドウの位置を設定
- @actor_command_window.x = actor_x
- end
- end
- # バトラー
- class Game_Actor < Game_Battler
- #--------------------------------------------------------------------------
- # ● バトル画面 X 座標の取得
- #--------------------------------------------------------------------------
- alias screen_x_cc screen_x
- def screen_x
- # パーティ内の並び順から X 座標を計算して返す
- if self.index != nil
- case $game_party.actors.size
- when 1
- actor_x = 320
- when 2
- actor_x = self.index * 240 + 200
- when 3
- actor_x = self.index * 200 + 120
- when 4
- actor_x = self.index * 160 + 80
- when 5
- actor_x = self.index * 120 + 80
- end
- return actor_x
- else
- return 0
- end
- end
- end
复制代码 |
|