赞 | 0 |
VIP | 2 |
好人卡 | 1 |
积分 | 1 |
经验 | 9236 |
最后登录 | 2020-2-13 |
在线时间 | 327 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 55
- 在线时间
- 327 小时
- 注册时间
- 2011-9-29
- 帖子
- 315
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
如下图,圈起来的只能左右移动,找不到上下移动
这是左右移动的脚本位置,129行修改160就可以左右移动,当然也限于移动 = =- @actor_window.push(Window_ActorStatus.new(i, x + i * 160))
复制代码 这是5人战斗完整脚本- #==============================================================================
- # ■ Game_Party
- #------------------------------------------------------------------------------
- # 处理同伴的类。包含金钱以及物品的信息。本类的实例
- # 请参考 $game_party。
- #==============================================================================
- class Game_Party
- #--------------------------------------------------------------------------
- # ● 加入同伴
- # actor_id : 角色 ID
- #--------------------------------------------------------------------------
- def add_actor(actor_id)
- # 获取角色
- actor = $game_actors[actor_id]
- # 同伴人数未满 5 人、本角色不在队伍中的情况下
- if @actors.size < 5 and not @actors.include?(actor)
- # 添加角色
- @actors.push(actor)
- # 还原主角
- $game_player.refresh
- end
- end
- end
- #==============================================================================
- # ■ Window_MenuStatus
- #------------------------------------------------------------------------------
- # 显示菜单画面和同伴状态的窗口。
- #==============================================================================
- class Window_MenuStatus
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- @item_max = $game_party.actors.size
- for i in 0...$game_party.actors.size
- x = 64
- y = i * 86
- actor = $game_party.actors[i]
- draw_actor_graphic(actor, x - 40, y + 70)
- draw_actor_name(actor, x, y)
- draw_actor_class(actor, x + 144, y)
- draw_actor_level(actor, x, y + 24)
- draw_actor_state(actor, x + 90, y + 24)
- draw_actor_exp(actor, x, y + 48)
- draw_actor_hp(actor, x + 236, y + 24)
- draw_actor_sp(actor, x + 236, y + 48)
- end
- end
- #--------------------------------------------------------------------------
- # ● 刷新光标矩形
- #--------------------------------------------------------------------------
- def update_cursor_rect
- if @index < 0
- self.cursor_rect.empty
- else
- self.cursor_rect.set(0, @index * 86, self.width - 32, 76)
- end
- end
- end
- #==============================================================================
- # ■ Window_BattleStatus
- #------------------------------------------------------------------------------
- # 显示战斗画面同伴状态的窗口。
- #==============================================================================
- 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]
- actor_x = i * 120 + 4
- draw_actor_name(actor, actor_x, 0)
- draw_actor_hp(actor, actor_x, 32, 120)
- draw_actor_sp(actor, actor_x, 64, 120)
- draw_actor_tp(actor, actor_x, 96, 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, 128)
- end
- end
- end
- end
- class Window_BattleStatus < Window_Base
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- def initialize
- x = (5 - $game_party.actors.size) * 120
- width = $game_party.actors.size * 200
- super(x, 408, width, 192)
- self.back_opacity = 160
- @actor_window = []
- for i in 0...$game_party.actors.size
- @actor_window.push(Window_ActorStatus.new(i, x + i * 160))
- end
- @level_up_flags = [false, false, false, false]
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 解放
- #--------------------------------------------------------------------------
- def dispose
- for window in @actor_window
- window.dispose
- end
- super
- end
- #--------------------------------------------------------------------------
- # ● リフレッシュ
- #--------------------------------------------------------------------------
- def refresh(number = 0)
- if number == 0
- cnt = 0
- for window in @actor_window
- window.refresh(@level_up_flags[cnt])
- cnt += 1
- end
- else
- @actor_window[number - 1].refresh(@level_up_flags[number - 1])
- end
- end
- #--------------------------------------------------------------------------
- # ● ATゲージリフレッシュ
- #--------------------------------------------------------------------------
- def at_refresh(number = 0)
- if number == 0
- for window in @actor_window
- window.at_refresh
- end
- else
- @actor_window[number - 1].at_refresh
- end
- end
- #--------------------------------------------------------------------------
- # ● フレーム更新
- #--------------------------------------------------------------------------
- def update
- super
- if self.x != (5 - $game_party.actors.size) * 80
- self.x = (5 - $game_party.actors.size) * 80
- self.width = $game_party.actors.size * 160
- for window in @actor_window
- window.dispose
- end
- @actor_window = []
- for i in 0...$game_party.actors.size
- @actor_window.push(Window_ActorStatus.new(i, x + i * 160))
- end
- refresh
- end
- for window in @actor_window
- window.update
- end
- end
- end
- #==============================================================================
- # ■ Scene_Battle
- #------------------------------------------------------------------------------
- # 处理战斗画面的类。
- #==============================================================================
- class Scene_Battle
- #--------------------------------------------------------------------------
- # ● 设置角色指令窗口
- #--------------------------------------------------------------------------
- def phase3_setup_command_window
- # 同伴指令窗口无效化
- @party_command_window.active = false
- @party_command_window.visible = false
- # 角色指令窗口无效化
- @actor_command_window.active = true
- @actor_command_window.visible = true
- # 设置角色指令窗口的位置
- @actor_command_window.x = @actor_index * 120
- # 设置索引为 0
- @actor_command_window.index = 0
- end
- def phase3_setup_command_window
- #------------------------------------------------------------------------------
- #RTAB观光游第一站,去除“战斗/逃跑”选项部分
- # パーティコマンドウィンドウを無効化
- # @party_command_window.active = false
- # @party_command_window.visible = false
- #------------------------------------------------------------------------------
- # アクターコマンドウィンドウを有効化
- @actor_command_window.active = true
- @actor_command_window.visible = true
- # アクターコマンドウィンドウの位置を設定
- @actor_command_window.x = @actor_index * 160 +
- (5 - $game_party.actors.size) * 80
- # インデックスを 0 に設定
- @actor_command_window.index = 0
- end
- end
- #==============================================================================
- # ■ Game_Actor
- #------------------------------------------------------------------------------
- # 处理角色的类。本类在 Game_Actors 类 ($game_actors)
- # 的内部使用、Game_Party 类请参考 ($game_party) 。
- #==============================================================================
- class Game_Actor < Game_Battler
- #--------------------------------------------------------------------------
- # ● 取得战斗画面的 X 坐标
- #--------------------------------------------------------------------------
- def screen_x
- # 返回计算后的队伍 X 坐标的排列顺序
- if self.index != nil
- return self.index * 150 + 80
- else
- return 0
- end
- end
- end
- #==============================================================================
- # ■ Sprite_Battler
- #------------------------------------------------------------------------------
- # 战斗显示用活动块。Game_Battler 类的实例监视、
- # 活动块的状态的监视。
- #==============================================================================
- =begin
- class Spriteset_Battle
- #--------------------------------------------------------------------------
- # ● 初始化变量
- #--------------------------------------------------------------------------
- def initialize
- # 生成显示端口
- @viewport1 = Viewport.new(0, 0, 640, 320)
- @viewport2 = Viewport.new(0, 0, 640, 480)
- @viewport3 = Viewport.new(0, 0, 640, 480)
- @viewport4 = Viewport.new(0, 0, 640, 480)
- @viewport2.z = 101
- @viewport3.z = 200
- @viewport4.z = 5000
- # 生成战斗背景活动块
- @battleback_sprite = Sprite.new(@viewport1)
- # 生成敌人活动块
- @enemy_sprites = []
- for enemy in $game_troop.enemies.reverse
- @enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))
- end
- # 生成敌人活动块 ★★修改了这里
- @actor_sprites = []
- @actor_sprites.push(Sprite_Battler.new(@viewport2))
- @actor_sprites.push(Sprite_Battler.new(@viewport2))
- @actor_sprites.push(Sprite_Battler.new(@viewport2))
- @actor_sprites.push(Sprite_Battler.new(@viewport2))
- @actor_sprites.push(Sprite_Battler.new(@viewport2))
- # 生成天候
- @weather = RPG::Weather.new(@viewport1)
- # 生成图片活动块
- @picture_sprites = []
- for i in 51..100
- @picture_sprites.push(Sprite_Picture.new(@viewport3,
- $game_screen.pictures[i]))
- end
- # 生成计时器块
- @timer_sprite = Sprite_Timer.new
- # 刷新画面
- update
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update
- # 刷新角色的活动块 (对应角色的替换) ★修改了这里
- @actor_sprites[0].battler = $game_party.actors[0]
- @actor_sprites[1].battler = $game_party.actors[1]
- @actor_sprites[2].battler = $game_party.actors[2]
- @actor_sprites[3].battler = $game_party.actors[3]
- @actor_sprites[4].battler = $game_party.actors[4]
- # 战斗背景的文件名与现在情况有差异的情况下
- if @battleback_name != $game_temp.battleback_name
- @battleback_name = $game_temp.battleback_name
- if @battleback_sprite.bitmap != nil
- @battleback_sprite.bitmap.dispose
- end
- @battleback_sprite.bitmap = RPG::Cache.battleback(@battleback_name)
- @battleback_sprite.src_rect.set(0, 0, 640, 320)
- end
- # 刷新战斗者的活动块
- for sprite in @enemy_sprites + @actor_sprites
- sprite.update
- end
- # 刷新天气图形
- @weather.type = $game_screen.weather_type
- @weather.max = $game_screen.weather_max
- @weather.update
- # 刷新图片活动块
- for sprite in @picture_sprites
- sprite.update
- end
- # 刷新计时器活动块
- @timer_sprite.update
- # 设置画面的色调与震动位置
- @viewport1.tone = $game_screen.tone
- @viewport1.ox = $game_screen.shake
- # 设置画面的闪烁色
- @viewport4.color = $game_screen.flash_color
- # 刷新显示端口
- @viewport1.update
- @viewport2.update
- @viewport4.update
- end
- end
- =end
复制代码 |
|