Mundo Maker
¡Bienvenid@ a Mundo Maker!

¿Quieres aprender todo sobre el RPG Maker?



Regístrate y forma parte de Mundo Maker.
Conectarse

Recuperar mi contraseña

Últimos temas
» Gameplay - Mansión Rybi - RMVXA.
por Miky Joe 2018-12-10, 08:36

» The Town of The Lost Witch [Horror/Suspense] - Enero 2019
por rstudios 2018-12-10, 01:20

» muchas dudas
por DiegoArancibia 2018-12-09, 16:55

» Galería Miky Art [Bocetos y más]
por Miky Joe 2018-12-09, 09:16

» Hemos vuelto
por alex1633 2018-12-08, 23:17

» [MV] Precognition
por franciscojapones 2018-12-08, 07:06

» (AJUDA) Conpatibilidade de 2 scripts simples
por orochii 2018-12-08, 03:14

» ("TCG") Que RPG Maker es el recomendado?
por orochii 2018-12-08, 03:03

» BOAS VINDAS
por orochii 2018-12-08, 02:58

» Script de mensaje de Wecoc
por orochii 2018-12-07, 23:43

Afiliados

(xp)(script) batalla lateral con gifs

Ver el tema anterior Ver el tema siguiente Ir abajo

(xp)(script) batalla lateral con gifs

Mensaje por jugito08 el 2010-01-29, 15:05

Aca les traigo este script.
Es para usar gifs en ves de imagenes para los personajes.

Código:
==============================================================================
# PR_CBS
#------------------------------------------------------------------------------
# Creador: PR_Soft
#==============================================================================

module PR_CBS

# Posición del grupo a la izquierda y derecha
PARTY_POSITIONS = [34, 35, 36]
# Lugares en los que se encuentran los personajes
DIRECTIONS = []
DIRECTIONS[0] = [6, 6, 6, 6] # En la Izquierda
DIRECTIONS[1] = [6, 4, 6, 4] # Distribuidos
DIRECTIONS[2] = [4, 4, 4, 4] # En la Derecha

# Número de frames por segundo de las animaciones
FRAMES_POR_SEGUNDO = 10
# Duración de las animaciones de:
# Atacado, Fallo, defensa, comienzo de batalla y final de batalla
ANIMATION_DURATION = Graphics.frame_rate

end

#==============================================================================
# Cache
#==============================================================================

module Cache

def self.pr_battler(filename, hue=0)
return load_bitmap("Graphics/PRBattlers/", filename, hue)
end

end

#==============================================================================
# RPG::Skill
#==============================================================================

class RPG::Skill

def cbs_center_screen?
if @cbs_center_screen.nil?
@cbs_center_screen = false
for elemend_id in @element_set
if $data_system.elements[elemend_id] == "CBSCenter"
@cbs_center_screen = true
break
end
end
end
return @cbs_center_screen
end

def cbs_all_targets_hit?
if @all_targets_hit.nil?
@all_targets_hit = false
for elemend_id in @element_set
if $data_system.elements[elemend_id] == "CBSATHit"
@all_targets_hit = true
break
end
end
end
return @all_targets_hit
end

def cbs_all_targets_hit_stopped?
if @all_targets_hit_stopped.nil?
@all_targets_hit_stopped = false
for elemend_id in @element_set
if $data_system.elements[elemend_id] == "CBSATHitStop"
@all_targets_hit_stopped = true
break
end
end
end
return @all_targets_hit_stopped
end

end

#==============================================================================
# RPG::Item
#==============================================================================

class RPG::Item

def cbs_center_screen?
if @cbs_center_screen.nil?
@cbs_center_screen = false
for elemend_id in @element_set
if $data_system.elements[elemend_id] == "CBSCenter"
@cbs_center_screen = true
break
end
end
end
return @cbs_center_screen
end

def cbs_all_targets_hit?
if @all_targets_hit.nil?
@all_targets_hit = false
for elemend_id in @element_set
if $data_system.elements[elemend_id] == "CBSATHit"
@all_targets_hit = true
break
end
end
end
return @all_targets_hit
end

def cbs_all_targets_hit_stopped?
if @all_targets_hit_stopped.nil?
@all_targets_hit_stopped = false
for elemend_id in @element_set
if $data_system.elements[elemend_id] == "CBSATHitStop"
@all_targets_hit_stopped = true
break
end
end
end
return @all_targets_hit_stopped
end

end

#==============================================================================
# Game_System
#==============================================================================

class Game_System

attr_accessor :battlers_position

unless method_defined?("pr_cbs_gsystem_initialize")
alias pr_cbs_gsystem_initialize initialize
end

def initialize
@battlers_position = 0
pr_cbs_gsystem_initialize
end

end

#==============================================================================
# FileTest
#==============================================================================

module FileTest

@@cbs_cache = {}

def self.cbs_exist?(filename)
if @@cbs_cache[filename].nil?
folder = File.dirname(filename)
basename = File.basename(filename, ".*")
@@cbs_cache[filename] = false
for file in Dir.entries(folder)
next if file.nil?
next if file == "." or file == ".."
if File.basename(file, ".*") == basename
@@cbs_cache[filename] = true
break
end
end
end
return @@cbs_cache[filename]
end

end

#==============================================================================
# Game_Battler
#==============================================================================

class Game_Battler

attr_accessor :attack_animation
attr_accessor :skill_animation
attr_accessor :item_animation
attr_accessor :attacked_animation
attr_accessor :guard_animation
attr_accessor :avoided_animation
attr_accessor :start_animation
attr_accessor :victory_animation
attr_accessor :cbs_move_to
attr_accessor :spriteset_index_counter
attr_accessor :cbs_base_width
attr_accessor :cbs_base_height
attr_accessor :cbs_sprite_turn_left
attr_accessor :cbs_sprite_turn_right

unless method_defined?("pr_cbs_gbattler_initialize")
alias pr_cbs_gbattler_initialize initialize
end

def initialize(*args)
@attack_animation = false
@skill_animation = false
@item_animation = false
@attacked_animation = false
@guard_animation = false
@avoided_animation = false
@start_animation = false
@victory_animation = false
@cbs_move_to = nil
@spriteset_index_counter = -1
@cbs_base_width = 0
@cbs_base_height = 0
@cbs_sprite_turn_left = false
@cbs_sprite_turn_right = false
pr_cbs_gbattler_initialize
end

def cbs_original_direction
return 0
end

def cbs_turn_original_position
case self.cbs_original_direction
when 4
@cbs_sprite_turn_left = true
when 6
@cbs_sprite_turn_right = true
end
end

def cbs_animation_folder
return "Graphics/PRBattlers/#{self.cbs_name}/"
end

def cbs_base_filename
return "#{self.cbs_name}/Base"
end

def attack_animation_filename
return ""
end

def skill_animation_filename
filename = sprintf("Skills/%03d", @action.skill_id)
if FileTest.cbs_exist?(self.cbs_animation_folder + filename)
return filename
end
return "Skills/Default"
end

def normal_animation_filename
if self.guarding?
if FileTest.cbs_exist?(self.cbs_animation_folder + "Guard")
return "Guard"
end
end
for state in states
filename = sprintf("States/%02d", state.id)
if FileTest.cbs_exist?(self.cbs_animation_folder + filename)
return filename
end
end
if self.hp <= (self.maxhp / 4)
filename = "LowHP"
if FileTest.cbs_exist?(self.cbs_animation_folder + filename)
return filename
end
end
return "Stop"
end

def item_animation_filename
return ""
end

def enemy?
return false
end

def cbs_name
return self.name
end

def victory_filename
return "Stop"
end

end

#==============================================================================
# Game_Actor
#==============================================================================

class Game_Actor < Game_Battler

def attack_animation_filename
filename = sprintf("Attack/%02d", @weapon_id)
if FileTest.cbs_exist?(self.cbs_animation_folder + filename)
return filename
end
return "Attack/Default"
end

def item_animation_filename
return "Item"
end

def use_sprite?
return true
end

def hero_enemy_data
if self.index.nil?
return nil
end
return $data_troops[PR_CBS::PARTY_POSITIONS[$game_system.battlers_position]].members[self.index]
end

def cbs_original_direction
if self.index.nil?
return 4
end
return (PR_CBS::DIRECTIONS[$game_system.battlers_position].nil? ? 4 : PR_CBS::DIRECTIONS[$game_system.battlers_position][self.index].nil? ? 4 : PR_CBS::DIRECTIONS[$game_system.battlers_position][self.index])
end

def screen_x
if self.index.nil?
return 0
end
data = self.hero_enemy_data
if data.nil?
return 0
end
return data.x
end

def screen_y
if self.index.nil?
return 0
end
data = self.hero_enemy_data
if data.nil?
return 0
end
return data.y
end

def screen_z
return 100
end

def victory_filename
filenames = self.victories_filenames
return filenames[rand(filenames.size)]
end

def victories_filenames
if @victories_filenames.nil?
@victories_filenames = []
for i in 1..99
filename = sprintf("Victories/%02d", i)
if FileTest.cbs_exist?(self.cbs_animation_folder + filename)
@victories_filenames.push(filename)
end
end
if @victories_filenames.size <= 0
@victories_filenames = ["Stop"]
end
end
return @victories_filenames
end

end

#==============================================================================
# Game_Enemy
#==============================================================================

class Game_Enemy < Game_Battler

def attack_animation_filename
return "Attack"
end

def enemy?
return true
end

def cbs_name
return self.original_name
end

def cbs_original_direction
return 6
end

end

#==============================================================================
# PR_Sprite_Battler
#==============================================================================

class PR_Sprite_Battler < Sprite_Base

include PR_CBS

WHITEN = 1
BLINK = 2
APPEAR = 3
DISAPPEAR = 4
COLLAPSE = 5

attr_reader :battler
attr_reader :enemy_counter

#----------------------------------------------------------------------------
# Inicialização
#----------------------------------------------------------------------------

def initialize(viewport, battler = nil, counter = -1)
super(viewport)
@battler_hue = 0
@bitmap_duration = 0
@speed = 5
@moving = false
@direction = 0
@last_direction = 0
@loop_bitmap_animation_filename = ""
@battler_visible = false
@effect_type = 0
@effect_duration = 0
@animation2 = nil
@animation2_duration = 0
@animation2_mirror = false
@spriteset_index_counter = counter
self.battler = battler
end

#----------------------------------------------------------------------------
# Battler = (valor)
#----------------------------------------------------------------------------

def start_animation2(animation, duration, mirror = false)
@animation2 = animation
@animation2_duration = duration
@animation2_mirror = mirror
end

#----------------------------------------------------------------------------
# Battler = (valor)
#----------------------------------------------------------------------------

def battler=(valor)
return if @battler == valor
if valor.nil?
@battler = nil
self.bitmap = nil
return
end
@battler = valor
@battler.spriteset_index_counter = @spriteset_index_counter
@battler_hue = @battler.battler_hue
@base_bitmap = Cache.pr_battler(@battler.cbs_base_filename)
@base_width = @base_bitmap.width
@base_height = @base_bitmap.height
@battler.cbs_base_width = @base_width
@battler.cbs_base_height = @base_height
@battler.cbs_turn_original_position
self.ox = @base_bitmap.width / 2
self.oy = @base_bitmap.height
@enemy = @battler.enemy?
self.x = @battler.screen_x
self.y = @battler.screen_y
self.z = @battler.screen_z
end

#----------------------------------------------------------------------------
# Bitmap de animação (loop)
#----------------------------------------------------------------------------

def loop_bitmap_animation(duration, filename)
return if @loop_bitmap_animation_filename == filename
if filename == ""
@loop_bitmap_animation_filename = filename
@loop_bitmap_animation = false
@need_refresh_loop_bitmap_animation = false
return
end
@loop_bitmap_animation = true
@need_refresh_loop_bitmap_animation = false
@loop_bitmap_animation_filename = filename
@loop_bitmap_animation_file = Cache.pr_battler(@battler.cbs_name + "/" + filename, @battler_hue)
if @bitmap_duration <= 0
self.bitmap = @loop_bitmap_animation_file
self.src_rect.set(0, 0, @base_width, @base_height)
end
@loop_bitmap_animation_frames = (@loop_bitmap_animation_file.width / @base_width)
if duration.nil?
duration = @loop_bitmap_animation_frames * FRAMES_POR_SEGUNDO
end
@loop_bitmap_duration = duration
@max_loop_bitmap_duration = duration
@loop_bitmap_frame = 0
end

#----------------------------------------------------------------------------
# Atualização do Bitmap de animação (loop)
#----------------------------------------------------------------------------

def update_loop_bitmap_animation
@loop_bitmap_duration -= 1
c = @loop_bitmap_duration % [(@max_loop_bitmap_duration / @loop_bitmap_animation_frames), 1].max
if ((c == 0) or @need_refresh_loop_bitmap_animation)
self.bitmap = @loop_bitmap_animation_file
self.src_rect.set(@loop_bitmap_frame * @base_width, 0, @base_width, @base_height)
if @need_refresh_loop_bitmap_animation
@need_refresh_loop_bitmap_animation = false
else
@loop_bitmap_frame += 1
end
end
if @loop_bitmap_duration <= 0
@loop_bitmap_duration = @max_loop_bitmap_duration
@loop_bitmap_frame = 0
end
end

#----------------------------------------------------------------------------
# Bitmap de animação
#----------------------------------------------------------------------------

def bitmap_animation(duration, filename)
if filename == ""
@bitmap_duration = 0
return
end
@need_refresh_loop_bitmap_animation = true
self.bitmap = Cache.pr_battler(@battler.cbs_name + "/" + filename, @battler_hue)
self.src_rect.set(0, 0, @base_width, @base_height)
@bitmap_animation_frames = [(self.bitmap.width / @base_width), 1].max
@bitmap_frame = 0
if duration.nil?
duration = @bitmap_animation_frames * FRAMES_POR_SEGUNDO
end
@bitmap_duration = duration
@max_bitmap_duration = duration
end

#----------------------------------------------------------------------------
# Atualização do Bitmap de animação
#----------------------------------------------------------------------------

def update_bitmap_animation
@bitmap_duration -= 1
c = @bitmap_duration % [(@max_bitmap_duration / @bitmap_animation_frames), 1].max
if (c == 0)
@bitmap_frame = [@bitmap_frame + 1, @bitmap_animation_frames - 1].min
self.src_rect.set(@bitmap_frame * @base_width, 0, @base_width, @base_height)
end
end

#----------------------------------------------------------------------------
# Move Para
#----------------------------------------------------------------------------

def move_to(x, y)
@destiny_x = x
@destiny_y = y
@moving = true
if @destiny_x > self.x
@last_direction = 6
elsif @destiny_x < self.x
@last_direction = 4
end
end

#----------------------------------------------------------------------------
# Atualização
#----------------------------------------------------------------------------

def update
super
update_battler
update_cbs_animations
end

#----------------------------------------------------------------------------
# Atualização das animações
#----------------------------------------------------------------------------

def update_cbs_animations
if @bitmap_duration > 0
update_bitmap_animation
if self.mirror != (@last_direction == (@enemy ? 4 : 6))
self.mirror = (@last_direction == (@enemy ? 4 : 6))
end
elsif @loop_bitmap_animation
update_loop_bitmap_animation
if moving? and self.mirror
self.mirror = false
end
end
if moving?
if @destiny_x > self.x
self.x = [self.x + @speed, @destiny_x].min
else
self.x = [self.x - @speed, @destiny_x].max
end
if @destiny_y > self.y
self.y = [self.y + @speed, @destiny_y].min
else
self.y = [self.y - @speed, @destiny_y].max
end
if (@last_direction == 6)
loop_bitmap_animation(20, "MoveRight")
else
loop_bitmap_animation(20, "MoveLeft")
end
if @destiny_x == self.x and @destiny_y == self.y
@destiny_x = nil
@destiny_y = nil
@moving = false
self.mirror = (@last_direction == (@enemy ? 4 : 6))
end
end
end

#----------------------------------------------------------------------------
# Atualização do Battler
#----------------------------------------------------------------------------

def update_battler
if @battler.nil?
self.bitmap = nil
return
end
if @battler.cbs_sprite_turn_left
@last_direction = 4
self.mirror = (@last_direction == (@enemy ? 4 : 6))
@battler.cbs_sprite_turn_left = false
end
if @battler.cbs_sprite_turn_right
@last_direction = 6
self.mirror = (@last_direction == (@enemy ? 4 : 6))
@battler.cbs_sprite_turn_right = false
end
@use_sprite = @battler.use_sprite?
setup_new_effect
update_effect
if @battler.dead?
bitmap_animation(nil, "")
if @battler.is_a?(Game_Actor)
loop_bitmap_animation(nil, "Dead")
end
return
end
if @battler.cbs_move_to != nil
self.move_to(*@battler.cbs_move_to)
@battler.cbs_move_to = nil
end
return if @moving
if @battler.attack_animation
bitmap_animation(nil, @battler.attack_animation_filename)
@battler.attack_animation = false
elsif @battler.skill_animation
bitmap_animation(nil, @battler.skill_animation_filename)
@battler.skill_animation = false
elsif @battler.item_animation
bitmap_animation(nil, @battler.item_animation_filename)
@battler.item_animation = false
elsif @battler.attacked_animation
if @battler.guarding?
bitmap_animation(ANIMATION_DURATION, "Guard")
else
bitmap_animation(ANIMATION_DURATION, "Attacked")
end
@battler.attacked_animation = false
elsif @battler.guard_animation
bitmap_animation(ANIMATION_DURATION, "Guard")
@battler.guard_animation = false
elsif @battler.avoided_animation
bitmap_animation(ANIMATION_DURATION, "Miss")
@battler.avoided_animation = false
elsif @battler.start_animation
bitmap_animation(ANIMATION_DURATION, "Start")
@battler.start_animation = false
elsif @battler.victory_animation
bitmap_animation(ANIMATION_DURATION, @battler.victory_filename)
@battler.victory_animation = false
else
loop_bitmap_animation(nil, @battler.normal_animation_filename)
end
end

#----------------------------------------------------------------------------
# Movendo?
#----------------------------------------------------------------------------

def moving?
return @moving
end

#----------------------------------------------------------------------------
# Está na animação?
#----------------------------------------------------------------------------

def animation?
return true if @moving
return true if @bitmap_duration > 0
return false
end

#--------------------------------------------------------------------------
# Novo efeito
#--------------------------------------------------------------------------

def setup_new_effect
if @battler.white_flash
@effect_type = WHITEN
@effect_duration = 16
@battler.white_flash = false
end
if @battler.blink
@effect_type = BLINK
@effect_duration = 20
@battler.blink = false
end
if not @battler_visible and @battler.exist?
@effect_type = APPEAR
@effect_duration = 16
@battler_visible = true
end
if @battler_visible and @battler.hidden
@effect_type = DISAPPEAR
@effect_duration = 32
@battler_visible = false
end
if @battler.collapse
@effect_type = COLLAPSE
@effect_duration = 48
@battler.collapse = false
@battler_visible = false
end
if @battler.animation_id != 0
animation = $data_animations[@battler.animation_id]
mirror = @battler.animation_mirror
start_animation(animation, mirror)
@battler.animation_id = 0
end
end

#--------------------------------------------------------------------------
# Atualiza o efeito
#--------------------------------------------------------------------------

def update_effect
if @animation2 != nil
if @animation2_duration > 0
@animation2_duration -= 1
else
@animation2_duration = 0
start_animation(@animation2, @animation2_mirror)
@animation2 = nil
end
end
if @effect_duration > 0
@effect_duration -= 1
case @effect_type
when WHITEN
update_whiten
when BLINK
update_blink
when APPEAR
update_appear
when DISAPPEAR
update_disappear
when COLLAPSE
update_collapse
end
end
end

#--------------------------------------------------------------------------
# Whiten
#--------------------------------------------------------------------------

def update_whiten
self.blend_type = 0
self.color.set(255, 255, 255, 128)
self.opacity = 255
self.color.alpha = 128 - (16 - @effect_duration) * 10
end

#--------------------------------------------------------------------------
# Blink
#--------------------------------------------------------------------------
def update_blink
self.blend_type = 0
self.color.set(0, 0, 0, 0)
self.opacity = 255
self.visible = (@effect_duration % 10 < 5)
end

#--------------------------------------------------------------------------
# Appear
#--------------------------------------------------------------------------

def update_appear
self.blend_type = 0
self.color.set(0, 0, 0, 0)
self.opacity = (16 - @effect_duration) * 16
end

#--------------------------------------------------------------------------
# Disappear
#--------------------------------------------------------------------------

def update_disappear
self.blend_type = 0
self.color.set(0, 0, 0, 0)
self.opacity = 256 - (32 - @effect_duration) * 10
end

#--------------------------------------------------------------------------
# Collapse
#--------------------------------------------------------------------------

def update_collapse
self.blend_type = 1
self.color.set(255, 128, 128, 128)
self.opacity = 256 - (48 - @effect_duration) * 6
end

end

#==============================================================================
# Spriteset_Battle
#==============================================================================

class Spriteset_Battle

attr_reader :actor_sprites
attr_reader :enemy_sprites

#--------------------------------------------------------------------------
# ● Cria os inimigos
#--------------------------------------------------------------------------

def create_enemies
@enemy_sprites = []
i = 0
for enemy in $game_troop.members.reverse
@enemy_sprites.push(PR_Sprite_Battler.new(@viewport1, enemy, i))
i += 1
end
end

#--------------------------------------------------------------------------
# Cria os inimigos
#--------------------------------------------------------------------------

def create_actors
@actor_sprites = []
@actor_sprites.push(PR_Sprite_Battler.new(@viewport1, nil, 0))
@actor_sprites.push(PR_Sprite_Battler.new(@viewport1, nil, 1))
@actor_sprites.push(PR_Sprite_Battler.new(@viewport1, nil, 2))
@actor_sprites.push(PR_Sprite_Battler.new(@viewport1, nil, 3))
end

def setup_start_battle
@actor_sprites[0].battler = $game_party.members[0]
@actor_sprites[1].battler = $game_party.members[1]
@actor_sprites[2].battler = $game_party.members[2]
@actor_sprites[3].battler = $game_party.members[3]
sprites = []
for i in 0...$game_party.members.size
actor = $game_party.members[i]
next if actor.nil?
actor.start_animation = true
sprites.push(@actor_sprites[i])
end
return sprites
end

def setup_victory_battle
sprites = []
for i in 0...$game_party.members.size
actor = $game_party.members[i]
next if actor.nil?
actor.victory_animation = true
sprites.push(@actor_sprites[i])
end
return sprites
end


end

#==============================================================================
# Scene_Battle
#==============================================================================

class Scene_Battle < Scene_Base

alias pr_cbs_scbattler_process_battle_start process_battle_start
alias pr_cbs_scbattler_process_victory process_victory

def process_battle_start
sprites = @spriteset.setup_start_battle
loop_cbs_spriteset_update_array(sprites)
wait(10)
pr_cbs_scbattler_process_battle_start
end

def process_victory
sprites = @spriteset.setup_victory_battle
loop_cbs_spriteset_update_array(sprites)
pr_cbs_scbattler_process_victory
end

def loop_cbs_spriteset_update(sprite)
@spriteset.update
while (sprite.animation?)
Graphics.update
@spriteset.update
end
end

def loop_cbs_spriteset_update_array(sprites)
return if sprites.size <= 0
@spriteset.update
while (sprites.any? {|n| n.animation?})
Graphics.update
@spriteset.update
end
end

#--------------------------------------------------------------------------
# Pega o sprite
#--------------------------------------------------------------------------

def get_cbs_sprite(user)
if user.is_a?(Game_Actor)
sprite = @spriteset.actor_sprites[user.spriteset_index_counter]
elsif user != nil
sprite = @spriteset.enemy_sprites[user.spriteset_index_counter]
else
sprite = nil
end
return sprite
end

#--------------------------------------------------------------------------
# Move em direção ao alvo
#--------------------------------------------------------------------------

def move_to_target(user, target)
if target.screen_x > user.screen_x
user.cbs_move_to = [target.screen_x - target.cbs_base_width / 2, target.screen_y]
left = false
else
user.cbs_move_to = [target.screen_x + target.cbs_base_width / 2, target.screen_y]
left = true
end
sprite = get_cbs_sprite(user)
loop_cbs_spriteset_update(sprite)
if left
user.cbs_sprite_turn_left = true
else
user.cbs_sprite_turn_right = true
end
wait(10)
end

#--------------------------------------------------------------------------
# Animação de ataque
#--------------------------------------------------------------------------

def cbs_attack_animation(user, target)
user.attack_animation = true
target.attack_effect(user)
if target.missed or target.evaded
target.avoided_animation = true
else
target.attacked_animation = true
end
sprite = get_cbs_sprite(user)
sprite_target = get_cbs_sprite(target)
if user.is_a?(Game_Enemy)
Sound.play_enemy_attack
wait(15, true)
loop_cbs_spriteset_update_array([sprite, sprite_target])
else
target.animation_id = user.atk_animation_id
target.animation_mirror = false
if user.is_a?(Game_Actor)
aid2 = user.atk_animation_id2
if $data_animations[aid2] != nil
sprite_target.start_animation2($data_animations[aid2], 10, true)
end
end
loop_cbs_spriteset_update_array([sprite, sprite_target])
wait(10)
end
display_action_effects(target)
wait(20)
end

#--------------------------------------------------------------------------
# Animação de Skill
#--------------------------------------------------------------------------

def cbs_skill_cast_animation(user, targets, skill)
if skill.cbs_all_targets_hit? or skill.cbs_all_targets_hit_stopped?
for target in targets
if skill.cbs_all_targets_hit? and target != user
move_to_target(user, target)
wait(2)
end
user.skill_animation = true
if skill.animation_id < 0
target.skill_effect(user, skill)
if target.missed or target.evaded
target.avoided_animation = true
else
target.attacked_animation = true
end
display_action_effects(target, skill)
loop_cbs_spriteset_update_array([get_cbs_sprite(user), get_cbs_sprite(target)])
else
loop_cbs_spriteset_update(get_cbs_sprite(user))
target.skill_effect(user, skill)
if target.missed or target.evaded
target.avoided_animation = true
else
target.attacked_animation = true
end
display_animation([target], skill.animation_id)
wait(5)
display_action_effects(target, skill)
wait(10)
end
end
return_to_position(user)
return
elsif skill.cbs_center_screen?
user.cbs_move_to = [544 / 2, 416 / 2]
user.skill_animation = true
loop_cbs_spriteset_update(get_cbs_sprite(user))
wait(5)
display_animation(targets, skill.animation_id)
wait(5)
for target in targets
target.skill_effect(@active_battler, skill)
display_action_effects(target, skill)
end
wait(5)
return_to_position(user)
return
else
user.skill_animation = true
loop_cbs_spriteset_update(get_cbs_sprite(user))
wait(5)
display_animation(targets, skill.animation_id)
for target in targets
target.skill_effect(@active_battler, skill)
display_action_effects(target, skill)
end
end
end

#--------------------------------------------------------------------------
# Animação de ataque
#--------------------------------------------------------------------------

def cbs_item_cast_animation(user, targets, item)
if item.cbs_all_targets_hit? or item.cbs_all_targets_hit_stopped?
for target in targets
if item.cbs_all_targets_hit? and target != user
move_to_target(user, target)
end
user.item_animation = true
if item.animation_id < 0
target.item_effect(user, item)
display_action_effects(target, item)
loop_cbs_spriteset_update_array([get_cbs_sprite(user), get_cbs_sprite(target)])
else
loop_cbs_spriteset_update(get_cbs_sprite(user))
target.item_effect(user, item)
display_animation([target], item.animation_id)
display_action_effects(target, item)
end
end
return_to_position(user)
return
elsif item.cbs_center_screen?
user.cbs_move_to = [544 / 2, 416 / 2]
user.item_animation = true
loop_cbs_spriteset_update(get_cbs_sprite(user))
wait(5)
display_animation(targets, item.animation_id)
wait(5)
for target in targets
target.item_effect(@active_battler, item)
display_action_effects(target, item)
end
wait(5)
return_to_position(user)
return
else
user.item_animation = true
loop_cbs_spriteset_update(get_cbs_sprite(user))
wait(5)
display_animation(targets, item.animation_id)
for target in targets
target.item_effect(@active_battler, item)
display_action_effects(target, item)
end
end
end

#--------------------------------------------------------------------------
# Retorna a posição Inicial
#--------------------------------------------------------------------------

def return_to_position(user)
user.cbs_move_to = [user.screen_x, user.screen_y]
sprite = get_cbs_sprite(user)
loop_cbs_spriteset_update(sprite)
user.cbs_turn_original_position
@spriteset.update
Graphics.update
wait(10)
end

#--------------------------------------------------------------------------
# Ataque
#--------------------------------------------------------------------------

def execute_action_attack
text = sprintf(Vocab::DoAttack, @active_battler.name)
@message_window.add_instant_text(text)
targets = @active_battler.action.make_targets
for target in targets
move_to_target(@active_battler, target)
cbs_attack_animation(@active_battler, target)
return_to_position(@active_battler)
end
end

#--------------------------------------------------------------------------
# Skill
#--------------------------------------------------------------------------

def execute_action_skill
skill = @active_battler.action.skill
text = @active_battler.name + skill.message1
@message_window.add_instant_text(text)
unless skill.message2.empty?
wait(10)
@message_window.add_instant_text(skill.message2)
end
targets = @active_battler.action.make_targets
@active_battler.mp -= @active_battler.calc_mp_cost(skill)
cbs_skill_cast_animation(@active_battler, targets, skill)
$game_temp.common_event_id = skill.common_event_id
end

#--------------------------------------------------------------------------
# Item
#--------------------------------------------------------------------------

def execute_action_item
item = @active_battler.action.item
text = sprintf(Vocab::UseItem, @active_battler.name, item.name)
@message_window.add_instant_text(text)
targets = @active_battler.action.make_targets
display_animation(targets, item.animation_id)
$game_party.consume_item(item)
cbs_item_cast_animation(@active_battler, targets, item)
$game_temp.common_event_id = item.common_event_id
end

end

Bueno eso es todo.
ADIOS
avatar
jugito08
Iniciado
Iniciado

0/3

Créditos 46

Gracias : 3

Volver arriba Ir abajo

Re: (xp)(script) batalla lateral con gifs

Mensaje por caphiphopstudio el 2014-09-11, 14:42

Funciona con VX ACE??
avatar
caphiphopstudio
Novato
Novato

0/3

Créditos 79

Gracias : 2

Volver arriba Ir abajo

Re: (xp)(script) batalla lateral con gifs

Mensaje por newold el 2014-09-11, 21:50

no he probado ese script, pero un vistazo por encima me indica que no tiene nada para leer archivos gif animados
avatar
newold
Principiante
Principiante

0/3

Créditos 1279

Gracias : 138

Volver arriba Ir abajo

Re: (xp)(script) batalla lateral con gifs

Mensaje por Contenido patrocinado


Contenido patrocinado


Volver arriba Ir abajo

Ver el tema anterior Ver el tema siguiente Volver arriba


Permisos de este foro:
No puedes responder a temas en este foro.