赞 | 792 |
VIP | 43 |
好人卡 | 0 |
积分 | 352 |
经验 | 76056 |
最后登录 | 2024-10-30 |
在线时间 | 4169 小时 |
Lv5.捕梦者
- 梦石
- 0
- 星屑
- 35180
- 在线时间
- 4169 小时
- 注册时间
- 2007-12-15
- 帖子
- 10066
|
可以实现,而且可以实现最后一个攻击的人播放胜利动画。不过我这个是依赖于全动画脚本的,可能没有全动画的默认战斗系统修改不一样。
具体请参考这个脚本,干洗呢FUX2大大和相关人员。
- #脚本作者 66RPG ID fux2 ,QQ 缄口不言 在下表示非常感谢。
- #脚本由66RPG ID 89444640 提出,愿意与大家分享~
- #胜利动画增加随机播放 在胜利动画文件名下加新的编号 第6第7个星星处
- #!为叹号 中文全角
- #例 角色名★9★10★11★12★13★123!124!125★621!622!623★最后一个星可以不加
- class Game_Battler
- def setup_battler_ani(battler_ani, once = 0,exflag = 0)
- case exflag
- when 1
- arr = battler_ani.split(/!/)
- if arr.size > 1
- @win_rnd_flag = rand(arr.size)
- battler_ani = arr[@win_rnd_flag]
- end
- when 2
- arr = battler_ani.split(/!/)
- if arr.size > 1
- @win_rnd_flag ||= 0
- battler_ani = arr[@win_rnd_flag]
- end
- end
- @battler_ani = battler_ani
- @once = once
- end
-
- alias _ini_fux initialize unless $@
- def initialize
- @states_source = {}
- _ini_fux
- end
-
- alias _ad_state_fux add_state unless $@
- def add_state(state_id, force = false)
- _ad_state_fux(state_id, force)
- if $game_temp.in_battle && $scene.active_battler
- user = $scene.active_battler
- if self.is_a?(Game_Enemy) && user.is_a?(Game_Actor)
- @states_source[state_id] = user if user
- end
- end
- end
- alias _rm_state_fux remove_state unless $@
- def remove_state(state_id, force = false)
- _rm_state_fux(state_id, force)
- if state?(state_id) == false
- @states_source.delete(state_id)
- end
- end
-
- alias _sde_fux slip_damage_effect unless $@
- def slip_damage_effect
- spk = nil
- if @states_source.size > 0
- spk = @states_source.values[0]
- end
- ret = _sde_fux
- if self.dead?
- if $game_temp.in_battle
- $scene.spec_killer = spk
- end
- end
- return ret
- end
-
- alias _hpp_fux hp= unless $@
- def hp=(hp)
- _hpp_fux(hp)
- if self.dead?
- if $game_temp.in_battle
- $scene.spec_killer = nil
- end
- end
- self.hp
- end
- end
- class Sprite_Battler < RPG::Sprite
-
- def update
- super
- if @battler == nil
- self.bitmap = nil
- loop_animation(nil)
- loop_animation1(nil)
- 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)
- if not @battler.hidden and not @battler.dead?
- @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
- end
- @width = bitmap.width
- @height = bitmap.height
- self.ox = @width / 2
- self.oy = @height
- end
- update_actor_animation
- update_enemy_animation
- if @battler.is_a?(Game_Enemy)
- if @once == 1 and @loop_animation_once == 1 and
- @battler.battler_dead_ani == 1
- @battler.setup_battler_ani(@battler.battler_name.split(/★/)[5])
- elsif @once == 1 and @loop_animation_once == 1 and $scene.phase != 5
- @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
- end
- end
- if @battler.is_a?(Game_Actor)
- if @once == 1 and @loop_animation_once == 1 and $scene.phase != 5 and
- @battler.battler_dead_ani == 1 and @battler.dead?
- @battler.setup_battler_ani(@battler.battler_name.split(/★/)[5])
- elsif @once == 1 and @loop_animation_once == 1 and $scene.phase != 5
- @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1]) if [6].include?($scene.phase4_step) and @battler.current_action.basic == 1 or @battler.current_action.basic != 1#SOULSAGA小改动修正防御动作
- $fangyu = 0
- @battler.setup_battler_dead_ani(0)
- elsif @once == 1 and @loop_animation_once == 1 and $scene.phase == 5 and
- not @battler.dead?
- @battler.setup_battler_ani(@battler.battler_name.split(/★/)[7],0,2)
- $fangyu = 0
- @battler.setup_battler_dead_ani(0)
- end
- end
- if @battler.damage == nil and
- @battler.state_animation_id != @state_animation_id
- @state_animation_id = @battler.state_animation_id
- loop_animation1($data_animations[@state_animation_id])
- end
- if @battler.battler_ani != @battler_ani
- @battler_ani = @battler.battler_ani
- @once = @battler.battler_ani_once
- loop_animation($data_animations[@battler_ani.to_i])
- 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)
- if @battler.is_a?(Game_Enemy)
- @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
- else
- @battler.setup_battler_ani(@battler.battler_name.split(/★/)[1])
- end
- @battler_visible = true
- end
- end
- if @battler_visible
- if @battler.hidden
- $game_system.se_play($data_system.escape_se)
- 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.damage, @battler.critical)
- @battler.animation_id = 0
- end
- if @battler.damage_pop
- @battler.damage = nil
- @battler.critical = false
- @battler.damage_pop = false
- end
- if @battler.dead? and $frame_index == $fanime2_frame_max-1 and $scene.phase4_step >= 4
- if @battler.is_a?(Game_Enemy)
- if @battler.battler_dead_ani != 1
- $game_system.se_play($data_system.enemy_collapse_se)
- @battler.setup_battler_ani(@battler.battler_name.split(/★/)[4], 1)
- @battler.setup_battler_dead_ani(1)
- end
- #p $fanime2_frame_max# if $frame_index == $fanime2_frame_max
- collapse# if @battler.animation_id == 0# and !$game_system.battle_interpreter.running?# if $frame_index == $fanime2_frame_max
- else
- if @battler.battler_dead_ani != 1
- $game_system.se_play($data_system.enemy_collapse_se)
- @battler.setup_battler_ani(@battler.battler_name.split(/★/)[4], 1)
- @battler.setup_battler_dead_ani(1)
- end
- end
- @battler_visible = false
- end
- end
- if @flash_shake_switch == true
- self.x = @battler.screen_x
- self.y = @battler.screen_y
- self.z = @battler.screen_z
- @flash_shake_switch = false
- end
- if @flash_shake != 0 and @battler.damage != nil and RPG::BATTLER_JUMP
- if @battler.is_a?(Game_Enemy)
- case @flash_shake
- when 9..10
- self.x -=4
- self.y -=4
- self.z = @battler.screen_z
- when 6..8
- self.x -=2
- self.y -=2
- self.z = @battler.screen_z
- when 3..5
- self.x +=2
- self.y +=2
- self.z = @battler.screen_z
- when 1..2
- self.x +=4
- self.y +=4
- self.z = @battler.screen_z
- end
- end
- if @battler.is_a?(Game_Actor)
- case @flash_shake
- when 9..10
- self.x +=4
- self.y +=4
- self.z = @battler.screen_z
- when 6..8
- self.x +=2
- self.y +=2
- self.z = @battler.screen_z
- when 3..5
- self.x -=2
- self.y -=2
- self.z = @battler.screen_z
- when 1..2
- self.x -=4
- self.y -=4
- self.z = @battler.screen_z
- end
- end
- @flash_shake -= 1
- end
- end
-
- def win
- if @battler_name != nil and not @battler.hidden and not @battler.dead?
- @battler.setup_battler_ani(@battler_name.split(/★/)[6], 1, 1)
- end
- end
-
- def update_actor_animation
- if @battler.is_a?(Game_Actor)
- if @battler.show_damage_value != nil
- self.damage(@battler.show_damage_value, false)
- @battler.show_damage(nil)
- @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
- @battler.setup_battler_hurt_ani(1)
- end
- # 防御的时候
- #p @battler.show_damage_value if @battler.damage.is_a?(Numeric)
- @last_frame = $fanime_frame_max if $fanime_frame_max > @last_frame
- if @battler.current_action.kind == 0 and @battler.current_action.basic == 1# and @battler.show_damage_value == nil
- @battler.setup_battler_ani(@battler.battler_name.split(/★/)[2], 1)
- @battler.setup_battler_hurt_ani(1)
- =begin
- if @hits > @temp_hits and not @battler.dead?
- @temp_hits+=1
- @battler.setup_battler_ani(@battler.battler_name.split(/★/)[2], 1)
- @battler.setup_battler_hurt_ani(1)
- elsif @last_hits == 1 and not @battler.dead?
- @last_hits = 0
- @battler.setup_battler_ani(@battler.battler_name.split(/★/)[2], 1)
- @battler.setup_battler_hurt_ani(1)
- elsif @frame_index != -1 and @frame_index != @last_frame and not @battler.dead? and [email protected]_a?(Numeric)
- @battler.setup_battler_ani(@battler.battler_name.split(/★/)[2], 1)
- @battler.setup_battler_hurt_ani(1)
- elsif @last_hits == 1 and not @battler.dead? and [email protected]_a?(Numeric)
- @last_hits = 0
- @battler.setup_battler_ani(@battler.battler_name.split(/★/)[2], 1)
- @battler.setup_battler_hurt_ani(1)
- end
- =end
- else
- if @last_hits == 1 and not @battler.dead? and @battler.damage.is_a?(Numeric) and @battler.damage > 0 and $fangyu != 1 and $scene.phase4_step == 5
- @last_hits = 0
- @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
- @battler.setup_battler_hurt_ani(1)
- elsif @hits > @temp_hits and @frame_index != @last_frame and not @battler.dead? and @battler.damage.is_a?(Numeric) and @battler.damage > 0 and
- $fangyu != 1
- @temp_hits+=1
- @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
- @battler.setup_battler_hurt_ani(1)
- elsif @hits > @temp_hits and @frame_index != @last_frame and @battler.damage.is_a?(Numeric) and @battler.damage > 0 and $fangyu != 1 and
- @battler.dead? and @battler.battler_dead_ani != 1
- @temp_hits+=1
- @battler.setup_battler_ani(@battler.battler_name.split(/★/)[3], 1)
- @battler.setup_battler_hurt_ani(1)
- elsif !@battler_damage.is_a?(Numeric) and @last_hits == 1 and @frame_index == @last_frame
- @last_hits = 0
- elsif @battler_damage.is_a?(Numeric) and @battler.damage == 0 and @last_hits == 1 and @frame_index == @last_frame
- @last_hits = 0
- elsif @last_hits == 1 and @frame_index == @last_frame and @battler.dead? and @battler.battler_dead_ani != 1
- @last_hits = 0
- @battler.setup_battler_ani(@battler.battler_name.split(/★/)[4], 1)
- @battler.setup_battler_dead_ani(1)
- elsif $scene.is_a?(Scene_Battle) and $scene.phase == 5 and @once == 0 and @battler_name != nil and not @battler.hidden and not @battler.dead? and $game_temp.battle_proc == nil
- @once = 1
- @battler.setup_battler_ani(@battler_name.split(/★/)[6], 1,1)
- end
- end
- end
- end
- end
- class Scene_Battle
- attr_reader :active_battler
- attr_accessor :spec_killer
- def initialize
- @spec_killer = nil
- end
-
- def get_real_killer
- if @spec_killer
- return @spec_killer
- end
- return $activebattler
- end
-
- def start_phase5
- @spriteset.win(get_real_killer)
- start_phase5101
- end
- end
- class Spriteset_Battle
- def win(winner)
- if winner
- @actor_sprites.find{|ac| ac.battler==winner}.win
- else
- for sprite in @actor_sprites
- sprite.win
- end
- end
- end
- end
- class Game_Actor < Game_Battler
- def screen_z
- case self.index
- when 0
- return 0
- when 1
- return 100
- when 2
- return 0
- when 3
- return 100
- else
- return 0
- end
- end
- end
- module RPG
- class Sprite < ::Sprite
- def animation_set_sprites(sprites, cell_data, position)
- for i in 0..15
- sprite = sprites[i]
- pattern = cell_data[i, 0]
- if sprite == nil or pattern == nil or pattern == -1
- sprite.visible = false if sprite != nil
- next
- end
- sprite.visible = true
- sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192)
- if position == 3
- if self.viewport != nil
- sprite.x = self.viewport.rect.width / 2
- sprite.y = self.viewport.rect.height - 160
- else
- sprite.x = 320
- sprite.y = 240
- end
- else
- sprite.x = self.x - self.ox + self.src_rect.width / 2
- sprite.y = self.y - self.oy + self.src_rect.height / 2
- sprite.y -= self.src_rect.height / 4 if position == 0
- sprite.y += self.src_rect.height / 4 if position == 2
- end
- sprite.x += cell_data[i, 1]
- sprite.y += cell_data[i, 2]
- sprite.z = 2000+self.z
- sprite.ox = 96
- sprite.oy = 96
- sprite.zoom_x = cell_data[i, 3] / 100.0
- sprite.zoom_y = cell_data[i, 3] / 100.0
- sprite.angle = cell_data[i, 4]
- sprite.mirror = (cell_data[i, 5] == 1)
- sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
- sprite.blend_type = cell_data[i, 7]
- end
- end
- end
- end
复制代码 |
|