Project1
标题:
找个多状态显示脚本
[打印本页]
作者:
【紫雨】
时间:
2011-2-21 11:05
标题:
找个多状态显示脚本
找个多状态显示脚本,不是状态图标化。就是可以睡眠和混乱等等状态在一起的!
作者:
云心
时间:
2011-2-21 13:15
http://rpg.blue/forum.php?mod=vi ... 0929&highlight=
状态
http://rpg.blue/forum.php?mod=vi ... 0237&highlight=
状态
http://rpg.blue/forum.php?mod=vi ... 9954&highlight=
状态
作者:
【紫雨】
时间:
2011-2-21 21:05
本帖最后由 【紫雨】 于 2011-2-21 21:13 编辑
我用的是梦幻群侠的脚本,插入这个后发生了错误!
=begin
多状态动画 v 1.2
by 后知后觉 2009-6-6
=end
#以下部分为必须放到自己工程里
#设置【增加】显示的状态动画个数
HZHJ_STATE_ANIMATION_ADD_NUMBER = 5
class Game_Temp
attr_accessor :phase4step5
alias hzhj_ini initialize
def initialize
@phase4step5 = false
hzhj_ini
end
end
class Scene_Battle
alias hzhj_update_phase4_step2 update_phase4_step2
def update_phase4_step2
$game_temp.phase4step5 = false
hzhj_update_phase4_step2
end
alias hzhj_update_phase4_step5 update_phase4_step5
def update_phase4_step5
$game_temp.phase4step5 = true
hzhj_update_phase4_step5
end
end
#以下部分有严重的冲突性 修改过的地方已经做了标记
#拷贝到自己工程的对应位置即可
#稍微懂点脚本的还可以自己改改或删除些
#对自己的游戏来说没有必要的操作
#从而减轻对运行速度的压力。。。
#==============================================================================
# ■ Sprite_Battler
#==============================================================================
class Sprite_Battler < RPG::Sprite
attr_accessor :battler # 战斗者
def initialize(viewport, battler = nil)
super(viewport)
@battler = battler
@battler_visible = false
#####################################################################
# 多状态动画 1/8
@state_sprites = []
for i in 0...HZHJ_STATE_ANIMATION_ADD_NUMBER
@state_sprites.push(RPG::Sprite.new(viewport))
end
#####################################################################
end
def dispose
#####################################################################
# 多状态动画 2/8
for hzhj in @state_sprites
hzhj.dispose
end
#####################################################################
if self.bitmap != nil
self.bitmap.dispose
end
super
end
def update
super
#####################################################################
# 多状态动画 3/8
for hzhj in @state_sprites
hzhj.update
end
#####################################################################
# 战斗者为 nil 的情况下
if @battler == nil
self.bitmap = nil
loop_animation(nil)
#####################################################################
# 多状态动画 4/8
for hzhj in @state_sprites
hzhj.loop_animation(nil)
end
#####################################################################
return
end
# 文件名和色相与当前情况有差异的情况下
if @battler.battler_name != @battler_name or
@battler.battler_hue != @battler_hue
# 获取、设置位图
@battler_name = @battler.battler_name
@battler_hue = @battler.battler_hue
self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
@width = bitmap.width
@height = bitmap.height
self.ox = @width / 2
self.oy = @height
# 如果是战斗不能或者是隐藏状态就把透明度设置成 0
if @battler.dead? or @battler.hidden
self.opacity = 0
end
end
# 动画 ID 与当前的情况有差异的情况下
if @battler.damage == nil and
@battler.state_animation_id != @state_animation_id
@state_animation_id = @battler.state_animation_id
loop_animation($data_animations[@state_animation_id])
end
#####################################################################
# 多状态动画 5/8
if @battler.damage == nil and $game_temp.phase4step5
for i in 0...HZHJ_STATE_ANIMATION_ADD_NUMBER
if @battler.states[i+1] != nil
@state_sprites[i].loop_animation($data_animations[$data_states[@battler.states[i+1]].animation_id])
@state_sprites[i].x = self.x
@state_sprites[i].y = self.y
@state_sprites[i].z = self.z
@state_sprites[i].ox = self.ox
@state_sprites[i].oy = self.oy
@state_sprites[i].opacity = self.opacity
@state_sprites[i].visible = self.visible
@state_sprites[i].src_rect = self.src_rect
else
@state_sprites[i].loop_animation($data_animations[0])
end
end
end
#####################################################################
# 应该被显示的角色的情况下
if @battler.is_a?(Game_Actor) and @battler_visible
# 不是主状态的时候稍稍降低点透明度
if $game_temp.battle_main_phase
self.opacity += 3 if self.opacity < 255
else
self.opacity -= 3 if self.opacity > 207
end
end
# 明灭
if @battler.blink
blink_on
else
blink_off
end
# 不可见的情况下
unless @battler_visible
# 出现
if not @battler.hidden and not @battler.dead? and
(@battler.damage == nil or @battler.damage_pop)
#####################################################################
# 多状态动画 6/8
for i in 0...HZHJ_STATE_ANIMATION_ADD_NUMBER
if @battler.states[i+1] != nil
@state_sprites[i].loop_animation($data_animations[$data_states[@battler.states[i+1]].animation_id])
@state_sprites[i].x = self.x
@state_sprites[i].y = self.y
@state_sprites[i].z = self.z
@state_sprites[i].ox = self.ox
@state_sprites[i].oy = self.oy
@state_sprites[i].opacity = self.opacity
@state_sprites[i].visible = self.visible
@state_sprites[i].src_rect = self.src_rect
else
@state_sprites[i].loop_animation($data_animations[0])
end
end
#####################################################################
appear
@battler_visible = true
end
end
# 可见的情况下
if @battler_visible
# 逃跑
if @battler.hidden
$game_system.se_play($data_system.escape_se)
#####################################################################
# 多状态动画 7/8
for i in 0...HZHJ_STATE_ANIMATION_ADD_NUMBER
if @battler.states[i+1] != nil
@state_sprites[i].loop_animation($data_animations[$data_states[@battler.states[i+1]].animation_id])
@state_sprites[i].x = self.x
@state_sprites[i].y = self.y
@state_sprites[i].z = self.z
@state_sprites[i].ox = self.ox
@state_sprites[i].oy = self.oy
@state_sprites[i].opacity = self.opacity
@state_sprites[i].visible = self.visible
@state_sprites[i].src_rect = self.src_rect
else
@state_sprites[i].loop_animation($data_animations[0])
end
end
#####################################################################
escape
@battler_visible = false
end
# 白色闪烁
if @battler.white_flash
whiten
@battler.white_flash = false
end
# 动画
if @battler.animation_id != 0
animation = $data_animations[@battler.animation_id]
animation(animation, @battler.animation_hit)
@battler.animation_id = 0
end
# 伤害
if @battler.damage_pop
damage(@battler.damage, @battler.critical)
@battler.damage = nil
@battler.critical = false
@battler.damage_pop = false
end
# korapusu
if @battler.damage == nil and @battler.dead?
if @battler.is_a?(Game_Enemy)
$game_system.se_play($data_system.enemy_collapse_se)
else
$game_system.se_play($data_system.actor_collapse_se)
end
#####################################################################
# 多状态动画 8/8
for i in 0...HZHJ_STATE_ANIMATION_ADD_NUMBER
if @battler.states[i+1] != nil
@state_sprites[i].loop_animation($data_animations[$data_states[@battler.states[i+1]].animation_id])
@state_sprites[i].x = self.x
@state_sprites[i].y = self.y
@state_sprites[i].z = self.z
@state_sprites[i].ox = self.ox
@state_sprites[i].oy = self.oy
@state_sprites[i].opacity = self.opacity
@state_sprites[i].visible = self.visible
@state_sprites[i].src_rect = self.src_rect
else
@state_sprites[i].loop_animation($data_animations[0])
end
end
#####################################################################
collapse
@battler_visible = false
end
end
# 设置活动块的坐标
self.x = @battler.screen_x
self.y = @battler.screen_y
self.z = @battler.screen_z
end
end
复制代码
)K94IFE@@(}
[email protected]
(77.17 KB, 下载次数: 0)
下载附件
保存到相册
2011-2-21 21:12 上传
1个敌人变成了2个.....攻击的时候任务消失了!
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1