加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
偶然发现一个脚本,可以实现轮到谁就显示对应的大号立绘,而且还会根据生命变
我想改成根据状态变
另外我还有个脚本可以根据状态自动改变战斗图,不知道这两个脚本怎么联动
这是自动根据状态找战斗图的
#============================================================================== # ■ 我方显示战斗图 by:celica #------------------------------------------------------------------------------ #============================================================================== #============================================================================== class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # ● 取得画面 X 坐标 #-------------------------------------------------------------------------- def screen_x (3-index) * Graphics.width / 4 + Graphics.width / 8 end #-------------------------------------------------------------------------- # ● 取得画面 Y 坐标 #-------------------------------------------------------------------------- def screen_y Graphics.height end #-------------------------------------------------------------------------- # ● 取得画面 Z 坐标 #-------------------------------------------------------------------------- def screen_z screen_y end #-------------------------------------------------------------------------- # ● 自动获得战斗图 #-------------------------------------------------------------------------- def battler_name name = @name states.each {|s| name = name + "_" + s.name if s.show_lihui? } #name = @name unless FileTest.exists?("Graphics/Battlers/" + name + ".png") return name end #-------------------------------------------------------------------------- # ● 是否使用活动块 #-------------------------------------------------------------------------- def use_sprite? true end end #============================================================================== #============================================================================== class Spriteset_Battle #-------------------------------------------------------------------------- # ● 生成角色活动块 #-------------------------------------------------------------------------- def create_actors @actor_sprites = $game_party.members.reverse.collect do |actor| Sprite_Battler.new(@viewport1, actor) end end end
#==============================================================================
# ■ 我方显示战斗图 by:celica
#------------------------------------------------------------------------------
#==============================================================================
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● 取得画面 X 坐标
#--------------------------------------------------------------------------
def screen_x
(3-index) * Graphics.width / 4 + Graphics.width / 8
end
#--------------------------------------------------------------------------
# ● 取得画面 Y 坐标
#--------------------------------------------------------------------------
def screen_y
Graphics.height
end
#--------------------------------------------------------------------------
# ● 取得画面 Z 坐标
#--------------------------------------------------------------------------
def screen_z
screen_y
end
#--------------------------------------------------------------------------
# ● 自动获得战斗图
#--------------------------------------------------------------------------
def battler_name
name = @name
states.each {|s| name = name + "_" + s.name if s.show_lihui? }
#name = @name unless FileTest.exists?("Graphics/Battlers/" + name + ".png")
return name
end
#--------------------------------------------------------------------------
# ● 是否使用活动块
#--------------------------------------------------------------------------
def use_sprite?
true
end
end
#==============================================================================
#==============================================================================
class Spriteset_Battle
#--------------------------------------------------------------------------
# ● 生成角色活动块
#--------------------------------------------------------------------------
def create_actors
@actor_sprites = $game_party.members.reverse.collect do |actor|
Sprite_Battler.new(@viewport1, actor)
end
end
end
这是显示大号立绘的,我想改的应该就在11行,但是不会写。。。
class Window_BattlePicture < Window_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(15, 10, 640, 480) end #-------------------------------------------------------------------------- # ● 立ち絵のセット #-------------------------------------------------------------------------- def set(face_name, actor = nil) self.contents.clear if actor != nil case ((actor.hp * 100) / actor.mhp) when 31...60 bitmap1 = Cache.picture(face_name + "-2") when 0...30 bitmap1 = Cache.picture(face_name + "-3") else bitmap1 = Cache.picture(face_name) end end rect1 = Rect.new(0, 0, bitmap1.width, bitmap1.height) x = 570-bitmap1.width/2 + 0 y = 480-bitmap1.height + 0 self.contents.blt(x, y, bitmap1, rect1) end end class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # ● 情報表示ビューポートの作成 #-------------------------------------------------------------------------- alias wd_orig_create_info_viewport_009 create_info_viewport def create_info_viewport @battle_picture_window = Window_BattlePicture.new @battle_picture_window.hide @battle_picture_window.opacity = 0 wd_orig_create_info_viewport_009 end #-------------------------------------------------------------------------- # ● 次のコマンド入力へ #-------------------------------------------------------------------------- alias wd_orig_next_command_009 next_command def next_command @battle_picture_window.hide wd_orig_next_command_009 end #-------------------------------------------------------------------------- # ● 前のコマンド入力へ #-------------------------------------------------------------------------- alias wd_orig_prior_command_009 prior_command def prior_command @battle_picture_window.hide wd_orig_prior_command_009 end #-------------------------------------------------------------------------- # ● アクターコマンド選択の開始 #-------------------------------------------------------------------------- alias wd_orig_start_actor_command_selection_009 start_actor_command_selection def start_actor_command_selection wd_orig_start_actor_command_selection_009 actor = BattleManager.actor @battle_picture_window.show @battle_picture_window.set(actor.face_name, actor) end end
class Window_BattlePicture < Window_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
super(15, 10, 640, 480)
end
#--------------------------------------------------------------------------
# ● 立ち絵のセット
#--------------------------------------------------------------------------
def set(face_name, actor = nil)
self.contents.clear
if actor != nil
case ((actor.hp * 100) / actor.mhp)
when 31...60
bitmap1 = Cache.picture(face_name + "-2")
when 0...30
bitmap1 = Cache.picture(face_name + "-3")
else
bitmap1 = Cache.picture(face_name)
end
end
rect1 = Rect.new(0, 0, bitmap1.width, bitmap1.height)
x = 570-bitmap1.width/2 + 0
y = 480-bitmap1.height + 0
self.contents.blt(x, y, bitmap1, rect1)
end
end
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# ● 情報表示ビューポートの作成
#--------------------------------------------------------------------------
alias wd_orig_create_info_viewport_009 create_info_viewport
def create_info_viewport
@battle_picture_window = Window_BattlePicture.new
@battle_picture_window.hide
@battle_picture_window.opacity = 0
wd_orig_create_info_viewport_009
end
#--------------------------------------------------------------------------
# ● 次のコマンド入力へ
#--------------------------------------------------------------------------
alias wd_orig_next_command_009 next_command
def next_command
@battle_picture_window.hide
wd_orig_next_command_009
end
#--------------------------------------------------------------------------
# ● 前のコマンド入力へ
#--------------------------------------------------------------------------
alias wd_orig_prior_command_009 prior_command
def prior_command
@battle_picture_window.hide
wd_orig_prior_command_009
end
#--------------------------------------------------------------------------
# ● アクターコマンド選択の開始
#--------------------------------------------------------------------------
alias wd_orig_start_actor_command_selection_009 start_actor_command_selection
def start_actor_command_selection
wd_orig_start_actor_command_selection_009
actor = BattleManager.actor
@battle_picture_window.show
@battle_picture_window.set(actor.face_name, actor)
end
end
|