赞 | 0 |
VIP | 0 |
好人卡 | 2 |
积分 | 2 |
经验 | 3063 |
最后登录 | 2016-7-20 |
在线时间 | 54 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 185
- 在线时间
- 54 小时
- 注册时间
- 2012-12-28
- 帖子
- 31
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 wai781300 于 2013-9-10 09:46 编辑
近來使用了一個ATB系統腳本
ATB系統腳本傳送門
得出了如下效果
見到敵人的AP顯示條蓋上了
MOG_Hunter的立繪顯示腳本上
我去修改過mog_hunter裡立繪腳本的z值,可是不論改多高, ap條還是蓋過了立繪
求解答方法...爬過文也不懂如何自己修改...求賜教
以下是AP描畫的腳本(由於整個ATB系統涉及的腳本數太多,全部貼上會很可怕,所以揀取兩個看上去最大關連的)
#============================================================================== # ■ Sprite_Battler #============================================================================== class Sprite_Battler < Sprite_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- alias :atb_initialize :initialize def initialize(viewport, battler = nil) atb_initialize(viewport, battler) @gauge_sprite = Spriteset_Enemy_Gauge.new(battler, viewport) if battler and battler.enemy? end #-------------------------------------------------------------------------- # ● 解放 #-------------------------------------------------------------------------- alias :atb_dispose :dispose def dispose @gauge_sprite.dispose if @gauge_sprite atb_dispose end #-------------------------------------------------------------------------- # ● 位置の更新 #-------------------------------------------------------------------------- alias :atb_update_position :update_position def update_position atb_update_position @gauge_sprite.update_rect(self.x, self.y, self.z) if @gauge_sprite end end #============================================================================== # ■ Spriteset_Enemy_Gauge #============================================================================== class Spriteset_Enemy_Gauge def initialize(battler, viewport) @sprites = Array.new(4) {|i| Sprite_Enemy_Gauge.new(battler, viewport, i)} end def refresh_status @sprites.each {|sprite| sprite.refresh} end def refresh_ap @sprites[3].refresh end def dispose @sprites.each {|sprite| sprite.dispose} end def update_rect(x, y, z) @sprites.each {|sprite| sprite.update_rect(x, y, z)} end end #============================================================================== # ■ Sprite_Enemy_Gauge #============================================================================== class Sprite_Enemy_Gauge < Sprite_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(battler, viewport, gauge_number = nil) super(Viewport.new(0, 0, Graphics.width, Graphics.height)) self.viewport.z = 0 self.bitmap = Bitmap.new(Graphics.width, Graphics.height) @gauge_number = gauge_number [url=home.php?mod=space&uid=133701]@battler[/url] = battler if battler.is_a?(Game_Enemy) @gauge_width = battler.gauge_width(@gauge_number) @gauge_high = battler.gauge_high else @gauge_width = 100 @gauge_high = 0 end end #-------------------------------------------------------------------------- # ● APゲージ表示位置を更新 #-------------------------------------------------------------------------- def update_rect(x, y, z) self.viewport.rect.x = x - @gauge_width / 2 self.viewport.rect.y = y - @gauge_high self.viewport.rect.y += ATB::ENEMY_GAUGE_POS_DATA[@gauge_number] end #-------------------------------------------------------------------------- # ● APゲージ消去 #-------------------------------------------------------------------------- def clear self.bitmap.clear end #-------------------------------------------------------------------------- # ● ゲージの描画 #-------------------------------------------------------------------------- def refresh if @battler.draw_gauge?(@gauge_number) draw_gauge else clear end end #-------------------------------------------------------------------------- # ● APゲージの描画 #-------------------------------------------------------------------------- def draw_gauge data = gauge_data rate = data[0] color = data[1] rate = 0.0 if rate < 0.0 or rate.nan? rate = 1.0 if rate > 1.0 fill_w = (@gauge_width * rate).to_i color[0].alpha = ATB::ENEMY_AP_GAUGE_ALPHA color[1].alpha = ATB::ENEMY_AP_GAUGE_ALPHA self.bitmap.fill_rect(0, 0, @gauge_width, 6, color[0]) self.bitmap.gradient_fill_rect(0, 0, fill_w, 6,color[1], color[2]) end #-------------------------------------------------------------------------- # ● ゲージの内容 #-------------------------------------------------------------------------- def gauge_data case @gauge_number when 0; rate = @battler.hp / @battler.mhp.to_f when 1; rate = @battler.mp / @battler.mmp.to_f when 2; rate = @battler.tp / @battler.max_tp.to_f when 3; return [@battler.ap_rate, @battler.ap_gauge_color] end return [rate, ATB::ENEMY_GAUGE_COLOR_DATA[@gauge_number]] end end #============================================================================== # ■ Game_Enemy #============================================================================== class Game_Enemy < Game_Battler #-------------------------------------------------------------------------- # ● ゲージを描画するか #-------------------------------------------------------------------------- def draw_gauge?(gauge_number) return false if not alive? return false if $game_switches[ATB::ENEMY_AP_GAUGE_HIDE_SWITCH] == true return false if ATB::ENEMY_AP_GAUGE_HIDE_IN_TURN and BattleManager.in_turn? return false if $game_temp.ap_gauge_hide_by_anime != [] feature_objects.each do |obj| return !ATB::ENEMY_GAUGE_DRAW_DATA[gauge_number] if obj.no_draw_gauge(gauge_number) end return ATB::ENEMY_GAUGE_DRAW_DATA[gauge_number] end #-------------------------------------------------------------------------- # ● ゲージの長さ #-------------------------------------------------------------------------- def gauge_width(gauge_number) case gauge_number when 0; return $1.to_i if enemy.note =~ /<HPゲージ長さ=(\d+)>/ when 1; return $1.to_i if enemy.note =~ /<MPゲージ長さ=(\d+)>/ when 2; return $1.to_i if enemy.note =~ /<TPゲージ長さ=(\d+)>/ when 3; return $1.to_i if enemy.note =~ /<APゲージ長さ=(\d+)>/ end return ATB::ENEMY_GAUGE_WIDTH_DATA[gauge_number] end #-------------------------------------------------------------------------- # ● ゲージのy座標(縦の位置) #-------------------------------------------------------------------------- def gauge_high return enemy.note =~ /<ゲージ高さ=(\-*\d+)>/ ? $1.to_i : 0 end end class RPG::BaseItem def no_draw_gauge(gauge_number) unless @no_draw_gauge @no_draw_gauge = [] for i in 0..3 case i when 0; match = /<HPゲージ表示>/ when 1; match = /<MPゲージ表示>/ when 2; match = /<TPゲージ表示>/ when 3; match = /<APゲージ表示>/ end @no_draw_gauge[i] = @note =~ match ? true : false end end return @no_draw_gauge[gauge_number] end end
#==============================================================================
# ■ Sprite_Battler
#==============================================================================
class Sprite_Battler < Sprite_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
alias :atb_initialize :initialize
def initialize(viewport, battler = nil)
atb_initialize(viewport, battler)
@gauge_sprite = Spriteset_Enemy_Gauge.new(battler, viewport) if
battler and battler.enemy?
end
#--------------------------------------------------------------------------
# ● 解放
#--------------------------------------------------------------------------
alias :atb_dispose :dispose
def dispose
@gauge_sprite.dispose if @gauge_sprite
atb_dispose
end
#--------------------------------------------------------------------------
# ● 位置の更新
#--------------------------------------------------------------------------
alias :atb_update_position :update_position
def update_position
atb_update_position
@gauge_sprite.update_rect(self.x, self.y, self.z) if @gauge_sprite
end
end
#==============================================================================
# ■ Spriteset_Enemy_Gauge
#==============================================================================
class Spriteset_Enemy_Gauge
def initialize(battler, viewport)
@sprites = Array.new(4) {|i| Sprite_Enemy_Gauge.new(battler, viewport, i)}
end
def refresh_status
@sprites.each {|sprite| sprite.refresh}
end
def refresh_ap
@sprites[3].refresh
end
def dispose
@sprites.each {|sprite| sprite.dispose}
end
def update_rect(x, y, z)
@sprites.each {|sprite| sprite.update_rect(x, y, z)}
end
end
#==============================================================================
# ■ Sprite_Enemy_Gauge
#==============================================================================
class Sprite_Enemy_Gauge < Sprite_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(battler, viewport, gauge_number = nil)
super(Viewport.new(0, 0, Graphics.width, Graphics.height))
self.viewport.z = 0
self.bitmap = Bitmap.new(Graphics.width, Graphics.height)
@gauge_number = gauge_number
[url=home.php?mod=space&uid=133701]@battler[/url] = battler
if battler.is_a?(Game_Enemy)
@gauge_width = battler.gauge_width(@gauge_number)
@gauge_high = battler.gauge_high
else
@gauge_width = 100
@gauge_high = 0
end
end
#--------------------------------------------------------------------------
# ● APゲージ表示位置を更新
#--------------------------------------------------------------------------
def update_rect(x, y, z)
self.viewport.rect.x = x - @gauge_width / 2
self.viewport.rect.y = y - @gauge_high
self.viewport.rect.y += ATB::ENEMY_GAUGE_POS_DATA[@gauge_number]
end
#--------------------------------------------------------------------------
# ● APゲージ消去
#--------------------------------------------------------------------------
def clear
self.bitmap.clear
end
#--------------------------------------------------------------------------
# ● ゲージの描画
#--------------------------------------------------------------------------
def refresh
if @battler.draw_gauge?(@gauge_number)
draw_gauge
else
clear
end
end
#--------------------------------------------------------------------------
# ● APゲージの描画
#--------------------------------------------------------------------------
def draw_gauge
data = gauge_data
rate = data[0]
color = data[1]
rate = 0.0 if rate < 0.0 or rate.nan?
rate = 1.0 if rate > 1.0
fill_w = (@gauge_width * rate).to_i
color[0].alpha = ATB::ENEMY_AP_GAUGE_ALPHA
color[1].alpha = ATB::ENEMY_AP_GAUGE_ALPHA
self.bitmap.fill_rect(0, 0, @gauge_width, 6, color[0])
self.bitmap.gradient_fill_rect(0, 0, fill_w, 6,color[1], color[2])
end
#--------------------------------------------------------------------------
# ● ゲージの内容
#--------------------------------------------------------------------------
def gauge_data
case @gauge_number
when 0; rate = @battler.hp / @battler.mhp.to_f
when 1; rate = @battler.mp / @battler.mmp.to_f
when 2; rate = @battler.tp / @battler.max_tp.to_f
when 3; return [@battler.ap_rate, @battler.ap_gauge_color]
end
return [rate, ATB::ENEMY_GAUGE_COLOR_DATA[@gauge_number]]
end
end
#==============================================================================
# ■ Game_Enemy
#==============================================================================
class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# ● ゲージを描画するか
#--------------------------------------------------------------------------
def draw_gauge?(gauge_number)
return false if not alive?
return false if $game_switches[ATB::ENEMY_AP_GAUGE_HIDE_SWITCH] == true
return false if ATB::ENEMY_AP_GAUGE_HIDE_IN_TURN and BattleManager.in_turn?
return false if $game_temp.ap_gauge_hide_by_anime != []
feature_objects.each do |obj|
return !ATB::ENEMY_GAUGE_DRAW_DATA[gauge_number] if obj.no_draw_gauge(gauge_number)
end
return ATB::ENEMY_GAUGE_DRAW_DATA[gauge_number]
end
#--------------------------------------------------------------------------
# ● ゲージの長さ
#--------------------------------------------------------------------------
def gauge_width(gauge_number)
case gauge_number
when 0; return $1.to_i if enemy.note =~ /<HPゲージ長さ=(\d+)>/
when 1; return $1.to_i if enemy.note =~ /<MPゲージ長さ=(\d+)>/
when 2; return $1.to_i if enemy.note =~ /<TPゲージ長さ=(\d+)>/
when 3; return $1.to_i if enemy.note =~ /<APゲージ長さ=(\d+)>/
end
return ATB::ENEMY_GAUGE_WIDTH_DATA[gauge_number]
end
#--------------------------------------------------------------------------
# ● ゲージのy座標(縦の位置)
#--------------------------------------------------------------------------
def gauge_high
return enemy.note =~ /<ゲージ高さ=(\-*\d+)>/ ? $1.to_i : 0
end
end
class RPG::BaseItem
def no_draw_gauge(gauge_number)
unless @no_draw_gauge
@no_draw_gauge = []
for i in 0..3
case i
when 0; match = /<HPゲージ表示>/
when 1; match = /<MPゲージ表示>/
when 2; match = /<TPゲージ表示>/
when 3; match = /<APゲージ表示>/
end
@no_draw_gauge[i] = @note =~ match ? true : false
end
end
return @no_draw_gauge[gauge_number]
end
end
以下是設定
module ATB #-------------------------------------------------------------------------- # ● 設定項目 #-------------------------------------------------------------------------- #軽量化設定 #AP増加処理を頻繁に行うと動作環境によっては処理落ちする #REFRESH_FRAMEの値を大きくすると、AP増加処理の間隔を長くして処理を軽くする #AP増加処理の間隔 3にすると3フレームに一回処理を行う REFRESH_FRAME = 3 #味方AP情報に"AP"の文字を表示するか AP_GAUGE_NAME = true AP_GAUGE_NAME_TEXT_COLOR = Color.new(132, 170, 255) #文字色 #味方AP情報にAPの溜まり具合(パーセンテージ)を表示するか AP_GAUGE_PERCENT = true #AP_GAUGE_PERCENTをtrueにした場合のみ APの溜まり具合に"%"を付けるかどうか AP_GAUGE_SIGN = true AP_GAUGE_MAIN_TEXT_COLOR = Color.new(255, 255, 255) #文字色 #敵ゲージの不透明度 255で完全に不透明 0で透明 ENEMY_AP_GAUGE_ALPHA = 128 #敵ゲージの設定 [HP, MP, TP, AP] の順番 ENEMY_GAUGE_DRAW_DATA = [false, false, false, true] # 表示するかどうか ENEMY_GAUGE_POS_DATA = [-18, -2, 8, -10] # y座標(縦の位置)補正値 ENEMY_GAUGE_WIDTH_DATA = [100, 100, 80, 100] # 長さデフォルト値 #敵HP、MP、TPゲージの色 [背景,左側,右側] ENEMY_HP_GAUGE_COLOR = [Color.new( 32, 32, 64), # text_color(19)と同じ Color.new(224, 128, 64), # text_color(20) Color.new(240, 192, 64)] # text_color(21) ENEMY_MP_GAUGE_COLOR = [Color.new( 32, 32, 64), # text_color(19) Color.new( 64, 128, 192), # text_color(22) Color.new( 64, 192, 240)] # text_color(23) ENEMY_TP_GAUGE_COLOR = [Color.new( 32, 32, 64), # text_color(19) Color.new( 0, 160, 64), # text_color(28) Color.new( 0, 224, 96)] # text_color(29) #敵ゲージ非表示設定 ENEMY_AP_GAUGE_HIDE_SWITCH = 91 #スイッチがオンになっている間 ENEMY_AP_GAUGE_HIDE_IN_TURN = true #ターン中 ENEMY_AP_GAUGE_HIDE_ANIMATION = #アニメーション表示中 [7, 13] # 7:斬撃/物理 13:刺突/物理 end
module ATB
#--------------------------------------------------------------------------
# ● 設定項目
#--------------------------------------------------------------------------
#軽量化設定
#AP増加処理を頻繁に行うと動作環境によっては処理落ちする
#REFRESH_FRAMEの値を大きくすると、AP増加処理の間隔を長くして処理を軽くする
#AP増加処理の間隔 3にすると3フレームに一回処理を行う
REFRESH_FRAME = 3
#味方AP情報に"AP"の文字を表示するか
AP_GAUGE_NAME = true
AP_GAUGE_NAME_TEXT_COLOR = Color.new(132, 170, 255) #文字色
#味方AP情報にAPの溜まり具合(パーセンテージ)を表示するか
AP_GAUGE_PERCENT = true
#AP_GAUGE_PERCENTをtrueにした場合のみ APの溜まり具合に"%"を付けるかどうか
AP_GAUGE_SIGN = true
AP_GAUGE_MAIN_TEXT_COLOR = Color.new(255, 255, 255) #文字色
#敵ゲージの不透明度 255で完全に不透明 0で透明
ENEMY_AP_GAUGE_ALPHA = 128
#敵ゲージの設定 [HP, MP, TP, AP] の順番
ENEMY_GAUGE_DRAW_DATA = [false, false, false, true] # 表示するかどうか
ENEMY_GAUGE_POS_DATA = [-18, -2, 8, -10] # y座標(縦の位置)補正値
ENEMY_GAUGE_WIDTH_DATA = [100, 100, 80, 100] # 長さデフォルト値
#敵HP、MP、TPゲージの色 [背景,左側,右側]
ENEMY_HP_GAUGE_COLOR = [Color.new( 32, 32, 64), # text_color(19)と同じ
Color.new(224, 128, 64), # text_color(20)
Color.new(240, 192, 64)] # text_color(21)
ENEMY_MP_GAUGE_COLOR = [Color.new( 32, 32, 64), # text_color(19)
Color.new( 64, 128, 192), # text_color(22)
Color.new( 64, 192, 240)] # text_color(23)
ENEMY_TP_GAUGE_COLOR = [Color.new( 32, 32, 64), # text_color(19)
Color.new( 0, 160, 64), # text_color(28)
Color.new( 0, 224, 96)] # text_color(29)
#敵ゲージ非表示設定
ENEMY_AP_GAUGE_HIDE_SWITCH = 91 #スイッチがオンになっている間
ENEMY_AP_GAUGE_HIDE_IN_TURN = true #ターン中
ENEMY_AP_GAUGE_HIDE_ANIMATION = #アニメーション表示中
[7, 13] # 7:斬撃/物理 13:刺突/物理
end
MOG_HUNTER的立繪腳本
#============================================================================== # +++ MOG - ACTOR PICTURE CM (v1.2) +++ #============================================================================== # By Moghunter # [url]http://www.atelier-rgss.com/[/url] #============================================================================== # Apresenta a imagem do personagem durante a seleção de comandos, com efeitos # animados. #============================================================================== # ● Definindo o nome das imagens dos battlers. #============================================================================== # 1 - As imagens devem ser gravadas na pasta # # GRAPHICS/PICTURES # # 2 - Nomeie os arquivos de imagens da seguinte forma. # # # ACTOR + ID # # EG # # ACTOR1.png # #============================================================================== #============================================================================== # ● Histórico (Version History) #============================================================================== # v 1.2 - Ajuste automático da imagem do battler. # v 1.1 - Correção do bug de não apagar a imagem quando o battler usa # ações de que acertam todos os alvos. #============================================================================== module MOG_ACTOR_PICTURE_CM #Posição da imagem do battler. (Para fazer ajustes) PICTURE_POSITION = [45, -10] #Definição da opacidade da imagem. PICTURE_OPACITY = 255 #Velocidade de deslize SLIDE_SPEED = 30 #Ativar o efeito da imagem respirando. BREATH_EFFECT = true #Definição da prioridade da imagem na tela. PICTURE_PRIORITY_Z = 100 end #=============================================================================== # ■ Sprite_Battler_CM #=============================================================================== class Sprite_Battler_CM < Sprite include MOG_ACTOR_PICTURE_CM #-------------------------------------------------------------------------- # ● Initialize #-------------------------------------------------------------------------- def initialize(viewport = nil,battler_id = -1) super(viewport) filename = "Actor" + battler_id.to_s self.bitmap = Cache.picture(filename) rescue nil self.bitmap = Cache.picture("") if self.bitmap == nil sc = (544 / 2) - (self.bitmap.width / 2) + PICTURE_POSITION[0] @size = [self.bitmap.width + PICTURE_POSITION[0] ,sc] self.visible = false self.opacity = 0 self.z = PICTURE_PRIORITY_Z self.ox = 0 self.oy = self.bitmap.height self.x = -@size[0] self.y = (Graphics.height + 10) + PICTURE_POSITION[1] @breach_effect = [1.0,0] @battler_id = battler_id @active = false @cm_visible = false end #-------------------------------------------------------------------------- # ● Dispose #-------------------------------------------------------------------------- def dispose super self.bitmap.dispose end #-------------------------------------------------------------------------- # ● Update #-------------------------------------------------------------------------- def update super update_slide end #-------------------------------------------------------------------------- # ● Active Battler #-------------------------------------------------------------------------- def active_battler(battler_id) @active = @battler_id == battler_id ? true : false self.visible = true if @active @cm_visible = false if !@active end #-------------------------------------------------------------------------- # ● Refresh Battler CM #-------------------------------------------------------------------------- def refresh_battler(cm_visible, battler_index) @cm_visible = cm_visible active_battler(battler_index) end #-------------------------------------------------------------------------- # ● Update Slide #-------------------------------------------------------------------------- def update_slide if !@cm_visible self.x -= SLIDE_SPEED if self.x > -@size[0] self.opacity -= 25 if self.x <= -@size[0] or self.opacity == 0 self.visible = false self.opacity = 0 self.x = -@size[0] end else self.x += SLIDE_SPEED if self.x < @size[1] self.x = @size[1] if self.x > @size[1] self.opacity += 10 if self.opacity < PICTURE_OPACITY self.opacity = PICTURE_OPACITY if self.opacity > PICTURE_OPACITY update_breath_effect end end #-------------------------------------------------------------------------- # ● Update Breath Effect #-------------------------------------------------------------------------- def update_breath_effect return if !BREATH_EFFECT @breach_effect[1] += 1 case @breach_effect[1] when 0..30 @breach_effect[0] += 0.0004 when 31..50 @breach_effect[0] -= 0.0004 else @breach_effect[1] = 0 @breach_effect[0] = 1.truncate end self.zoom_y = @breach_effect[0] end end #=============================================================================== # ■ Spriteset_Battle #=============================================================================== class Spriteset_Battle #-------------------------------------------------------------------------- # ● Create Actors #-------------------------------------------------------------------------- alias mog_battler_cm_create_actors create_actors def create_actors mog_battler_cm_create_actors create_battler_pictures end #-------------------------------------------------------------------------- # ● Dispose #-------------------------------------------------------------------------- alias mog_battler_cm_dispose dispose def dispose mog_battler_cm_dispose dispose_battler_cm end #-------------------------------------------------------------------------- # ● Update #-------------------------------------------------------------------------- alias mog_battler_cm_update update def update mog_battler_cm_update update_battler_cm end #-------------------------------------------------------------------------- # ● Create Battler Pictures #-------------------------------------------------------------------------- def create_battler_pictures size = 0 @battler_pictures = [] for i in $game_party.members @battler_pictures.push(Sprite_Battler_CM.new(@viewport1,i.id)) size += 1 break if size > 3 end end #-------------------------------------------------------------------------- # ● Dispose Battler CM #-------------------------------------------------------------------------- def dispose_battler_cm return if @battler_pictures == nil @battler_pictures.each {|sprite| sprite.dispose } end #-------------------------------------------------------------------------- # ● Update Battler CM #-------------------------------------------------------------------------- def update_battler_cm return if @battler_pictures == nil @battler_pictures.each {|sprite| sprite.update } end #-------------------------------------------------------------------------- # ● Update CM Pictures #-------------------------------------------------------------------------- def update_cm_picture(cm_visible, battler_index) return if @battler_pictures == nil @battler_pictures.each {|sprite| sprite.refresh_battler(cm_visible, battler_index) } end end #=============================================================================== # ■ Scene_Battle #=============================================================================== class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # ● Update #-------------------------------------------------------------------------- alias mog_cm_picture_update update def update mog_cm_picture_update update_picture_visible end #-------------------------------------------------------------------------- # ● Update Battler CM Active #-------------------------------------------------------------------------- def update_picture_visible return if @actor_command_window == nil cm_visible = can_cm_picture_visible? cm_id = BattleManager.actor.id rescue -1 @spriteset.update_cm_picture(cm_visible, cm_id) end #-------------------------------------------------------------------------- # ● Can CM Picture Visible #-------------------------------------------------------------------------- def can_cm_picture_visible? return false if (@actor_window.active or @enemy_window.active) rescue return return false if BattleManager.actor == nil return true end #-------------------------------------------------------------------------- # ● Execute Action #-------------------------------------------------------------------------- alias mog_cm_picture_execute_action execute_action def execute_action @spriteset.update_cm_picture(false, -1) if @spriteset != nil mog_cm_picture_execute_action end end $mog_rgss3_actor_picture_cm = true
#==============================================================================
# +++ MOG - ACTOR PICTURE CM (v1.2) +++
#==============================================================================
# By Moghunter
# [url]http://www.atelier-rgss.com/[/url]
#==============================================================================
# Apresenta a imagem do personagem durante a seleção de comandos, com efeitos
# animados.
#==============================================================================
# ● Definindo o nome das imagens dos battlers.
#==============================================================================
# 1 - As imagens devem ser gravadas na pasta
#
# GRAPHICS/PICTURES
#
# 2 - Nomeie os arquivos de imagens da seguinte forma.
#
#
# ACTOR + ID
#
# EG
#
# ACTOR1.png
#
#==============================================================================
#==============================================================================
# ● Histórico (Version History)
#==============================================================================
# v 1.2 - Ajuste automático da imagem do battler.
# v 1.1 - Correção do bug de não apagar a imagem quando o battler usa
# ações de que acertam todos os alvos.
#==============================================================================
module MOG_ACTOR_PICTURE_CM
#Posição da imagem do battler. (Para fazer ajustes)
PICTURE_POSITION = [45, -10]
#Definição da opacidade da imagem.
PICTURE_OPACITY = 255
#Velocidade de deslize
SLIDE_SPEED = 30
#Ativar o efeito da imagem respirando.
BREATH_EFFECT = true
#Definição da prioridade da imagem na tela.
PICTURE_PRIORITY_Z = 100
end
#===============================================================================
# ■ Sprite_Battler_CM
#===============================================================================
class Sprite_Battler_CM < Sprite
include MOG_ACTOR_PICTURE_CM
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
def initialize(viewport = nil,battler_id = -1)
super(viewport)
filename = "Actor" + battler_id.to_s
self.bitmap = Cache.picture(filename) rescue nil
self.bitmap = Cache.picture("") if self.bitmap == nil
sc = (544 / 2) - (self.bitmap.width / 2) + PICTURE_POSITION[0]
@size = [self.bitmap.width + PICTURE_POSITION[0] ,sc]
self.visible = false
self.opacity = 0
self.z = PICTURE_PRIORITY_Z
self.ox = 0
self.oy = self.bitmap.height
self.x = -@size[0]
self.y = (Graphics.height + 10) + PICTURE_POSITION[1]
@breach_effect = [1.0,0]
@battler_id = battler_id
@active = false
@cm_visible = false
end
#--------------------------------------------------------------------------
# ● Dispose
#--------------------------------------------------------------------------
def dispose
super
self.bitmap.dispose
end
#--------------------------------------------------------------------------
# ● Update
#--------------------------------------------------------------------------
def update
super
update_slide
end
#--------------------------------------------------------------------------
# ● Active Battler
#--------------------------------------------------------------------------
def active_battler(battler_id)
@active = @battler_id == battler_id ? true : false
self.visible = true if @active
@cm_visible = false if !@active
end
#--------------------------------------------------------------------------
# ● Refresh Battler CM
#--------------------------------------------------------------------------
def refresh_battler(cm_visible, battler_index)
@cm_visible = cm_visible
active_battler(battler_index)
end
#--------------------------------------------------------------------------
# ● Update Slide
#--------------------------------------------------------------------------
def update_slide
if !@cm_visible
self.x -= SLIDE_SPEED if self.x > -@size[0]
self.opacity -= 25
if self.x <= -@size[0] or self.opacity == 0
self.visible = false
self.opacity = 0
self.x = -@size[0]
end
else
self.x += SLIDE_SPEED if self.x < @size[1]
self.x = @size[1] if self.x > @size[1]
self.opacity += 10 if self.opacity < PICTURE_OPACITY
self.opacity = PICTURE_OPACITY if self.opacity > PICTURE_OPACITY
update_breath_effect
end
end
#--------------------------------------------------------------------------
# ● Update Breath Effect
#--------------------------------------------------------------------------
def update_breath_effect
return if !BREATH_EFFECT
@breach_effect[1] += 1
case @breach_effect[1]
when 0..30
@breach_effect[0] += 0.0004
when 31..50
@breach_effect[0] -= 0.0004
else
@breach_effect[1] = 0
@breach_effect[0] = 1.truncate
end
self.zoom_y = @breach_effect[0]
end
end
#===============================================================================
# ■ Spriteset_Battle
#===============================================================================
class Spriteset_Battle
#--------------------------------------------------------------------------
# ● Create Actors
#--------------------------------------------------------------------------
alias mog_battler_cm_create_actors create_actors
def create_actors
mog_battler_cm_create_actors
create_battler_pictures
end
#--------------------------------------------------------------------------
# ● Dispose
#--------------------------------------------------------------------------
alias mog_battler_cm_dispose dispose
def dispose
mog_battler_cm_dispose
dispose_battler_cm
end
#--------------------------------------------------------------------------
# ● Update
#--------------------------------------------------------------------------
alias mog_battler_cm_update update
def update
mog_battler_cm_update
update_battler_cm
end
#--------------------------------------------------------------------------
# ● Create Battler Pictures
#--------------------------------------------------------------------------
def create_battler_pictures
size = 0
@battler_pictures = []
for i in $game_party.members
@battler_pictures.push(Sprite_Battler_CM.new(@viewport1,i.id))
size += 1
break if size > 3
end
end
#--------------------------------------------------------------------------
# ● Dispose Battler CM
#--------------------------------------------------------------------------
def dispose_battler_cm
return if @battler_pictures == nil
@battler_pictures.each {|sprite| sprite.dispose }
end
#--------------------------------------------------------------------------
# ● Update Battler CM
#--------------------------------------------------------------------------
def update_battler_cm
return if @battler_pictures == nil
@battler_pictures.each {|sprite| sprite.update }
end
#--------------------------------------------------------------------------
# ● Update CM Pictures
#--------------------------------------------------------------------------
def update_cm_picture(cm_visible, battler_index)
return if @battler_pictures == nil
@battler_pictures.each {|sprite| sprite.refresh_battler(cm_visible, battler_index) }
end
end
#===============================================================================
# ■ Scene_Battle
#===============================================================================
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# ● Update
#--------------------------------------------------------------------------
alias mog_cm_picture_update update
def update
mog_cm_picture_update
update_picture_visible
end
#--------------------------------------------------------------------------
# ● Update Battler CM Active
#--------------------------------------------------------------------------
def update_picture_visible
return if @actor_command_window == nil
cm_visible = can_cm_picture_visible?
cm_id = BattleManager.actor.id rescue -1
@spriteset.update_cm_picture(cm_visible, cm_id)
end
#--------------------------------------------------------------------------
# ● Can CM Picture Visible
#--------------------------------------------------------------------------
def can_cm_picture_visible?
return false if (@actor_window.active or @enemy_window.active) rescue return
return false if BattleManager.actor == nil
return true
end
#--------------------------------------------------------------------------
# ● Execute Action
#--------------------------------------------------------------------------
alias mog_cm_picture_execute_action execute_action
def execute_action
@spriteset.update_cm_picture(false, -1) if @spriteset != nil
mog_cm_picture_execute_action
end
end
$mog_rgss3_actor_picture_cm = true
PS:我知道可以關掉敵人的AP條,可是覺得這樣失去了ATB系統的意義...所以不太希望就是...希望提供解決方法 謝謝 |
|