Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

2 Pages V   1 2 >  
Closed TopicStart new topic
> Side View Battle System I found on Youtube, I dont think anyones posted this?
Achilles
post Sep 26 2008, 01:12 PM
Post #1


I can (usually) answer any event based question!
Group Icon

Group: Revolutionary
Posts: 381
Type: Scripter
RM Skill: Masterful




I found and have been using a side view battle system from a Youtube video, it works pretty nice, and its compatible with the script that allows more than 4 actors in the party (thats the only one Ive tested with it). It uses the sprites that come with RPGMXP, so you don't need to find your own sprites.
Some screenies:





As you can see the hp bar does not move with you or the enemies. If you're doing a basic attack (non-skill), then the actor doing the attack will walk over to the enemies to do the attack instead of standing in the same spot (thank goodness). When using the skill, they take a few steps out.
When using this script, never have the first actor in your database in the party while you're in a battle. For some reason, the #1 actor always freezes the game when he starts his attack. The simple fix is to simply leave slot 1 in your database blank, and add an actor farther down the list with the same attributes as the slot 1 actor.
The script that I submitted is slightly edited by me. 2 things; in the original script, when you used the arrow keys to select an enemy, pressing up selected the enemy below, and pressing down selected the enemy above. I changed it so that down = down and up = up. Left and right can be used to select enemies as well. The second thing was the actors speed when they went to attack enemies. They were set at 10 move speed, which was insane when I play tested it (you couldn't see them moving), so I lowered it to the default speed when walking, which is 4.

[Show/Hide] Script:

CODE
class Bitmap
if not method_defined?('original_draw_text')
alias original_draw_text draw_text
def draw_text(*arg)

original_color = self.font.color.dup
self.font.color = Color.new(0, 0, 0, 128)

if arg[0].is_a?(Rect)
arg[0].x += 2
arg[0].y += 2
self.original_draw_text(*arg)
arg[0].x -= 2
arg[0].y -= 2
else
arg[0] += 2
arg[1] += 2
self.original_draw_text(*arg)
arg[0] -= 2
arg[1] -= 2
end

self.font.color = original_color
self.original_draw_text(*arg)

end
end
def gradation_rect(x, y, width, height, color1, color2, align = 0)
if align == 0
for i in x...x + width
red = color1.red + (color2.red - color1.red) * (i - x) / (width - 1)
green = color1.green +
(color2.green - color1.green) * (i - x) / (width - 1)
blue = color1.blue +
(color2.blue - color1.blue) * (i - x) / (width - 1)
alpha = color1.alpha +
(color2.alpha - color1.alpha) * (i - x) / (width - 1)
color = Color.new(red, green, blue, alpha)
fill_rect(i, y, 1, height, color)
end
elsif align == 1
for i in y...y + height
red = color1.red +
(color2.red - color1.red) * (i - y) / (height - 1)
green = color1.green +
(color2.green - color1.green) * (i - y) / (height - 1)
blue = color1.blue +
(color2.blue - color1.blue) * (i - y) / (height - 1)
alpha = color1.alpha +
(color2.alpha - color1.alpha) * (i - y) / (height - 1)
color = Color.new(red, green, blue, alpha)
fill_rect(x, i, width, 1, color)
end
elsif align == 2
for i in x...x + width
for j in y...y + height
red = color1.red + (color2.red - color1.red) *
((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
green = color1.green + (color2.green - color1.green) *
((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
blue = color1.blue + (color2.blue - color1.blue) *
((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
alpha = color1.alpha + (color2.alpha - color1.alpha) *
((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
color = Color.new(red, green, blue, alpha)
set_pixel(i, j, color)
end
end
elsif align == 3
for i in x...x + width
for j in y...y + height
red = color1.red + (color2.red - color1.red) *
((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
green = color1.green + (color2.green - color1.green) *
((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
blue = color1.blue + (color2.blue - color1.blue) *
((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
alpha = color1.alpha + (color2.alpha - color1.alpha) *
((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
color = Color.new(red, green, blue, alpha)
set_pixel(i, j, color)
end
end
end
end
end

module RPG
class Sprite < ::Sprite
def damage(value, critical)
dispose_damage
if value.is_a?(Numeric)
damage_string = value.abs.to_s
else
damage_string = value.to_s
end
bitmap = Bitmap.new(160, 48)
bitmap.font.name = "Arial Black"
bitmap.font.size = 32
bitmap.font.color.set(0, 0, 0)
bitmap.draw_text(-1, 12-1, 160, 36, damage_string, 1)
bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1)
bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1)
bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1)
if value.is_a?(Numeric) and value < 0
bitmap.font.color.set(176, 255, 144)
else
bitmap.font.color.set(255, 255, 255)
end
bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
if critical
bitmap.font.size = 20
bitmap.font.color.set(0, 0, 0)
bitmap.draw_text(-1, -1, 160, 20, "CRITICAL", 1)
bitmap.draw_text(+1, -1, 160, 20, "CRITICAL", 1)
bitmap.draw_text(-1, +1, 160, 20, "CRITICAL", 1)
bitmap.draw_text(+1, +1, 160, 20, "CRITICAL", 1)
bitmap.font.color.set(255, 255, 255)
bitmap.draw_text(0, 0, 160, 20, "CRITICAL", 1)
end
@_damage_sprite = ::Sprite.new
@_damage_sprite.bitmap = bitmap
@_damage_sprite.ox = 80 + self.viewport.ox
@_damage_sprite.oy = 20 + self.viewport.oy
@_damage_sprite.x = self.x + self.viewport.rect.x
@_damage_sprite.y = self.y - self.oy / 2 + self.viewport.rect.y
@_damage_sprite.z = 3000
@_damage_duration = 40
end
def animation(animation, hit)
dispose_animation
@_animation = animation
return if @_animation == nil
@_animation_hit = hit
@_animation_duration = @_animation.frame_max
animation_name = @_animation.animation_name
animation_hue = @_animation.animation_hue
bitmap = RPG::Cache.animation(animation_name, animation_hue)
if @@_reference_count.include?(bitmap)
@@_reference_count[bitmap] += 1
else
@@_reference_count[bitmap] = 1
end
@_animation_sprites = []
if @_animation.position != 3 or not @@_animations.include?(animation)
for i in 0..15
sprite = ::Sprite.new
sprite.bitmap = bitmap
sprite.visible = false
@_animation_sprites.push(sprite)
end
unless @@_animations.include?(animation)
@@_animations.push(animation)
end
end
update_animation
end
def loop_animation(animation)
return if animation == @_loop_animation
dispose_loop_animation
@_loop_animation = animation
return if @_loop_animation == nil
@_loop_animation_index = 0
animation_name = @_loop_animation.animation_name
animation_hue = @_loop_animation.animation_hue
bitmap = RPG::Cache.animation(animation_name, animation_hue)
if @@_reference_count.include?(bitmap)
@@_reference_count[bitmap] += 1
else
@@_reference_count[bitmap] = 1
end
@_loop_animation_sprites = []
for i in 0..15
sprite = ::Sprite.new
sprite.bitmap = bitmap
sprite.visible = false
@_loop_animation_sprites.push(sprite)
end
update_loop_animation
end
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.viewport.rect.x -
self.ox + self.src_rect.width / 2
sprite.y = self.y + self.viewport.rect.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
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

class Game_Actor < Game_Battler
def screen_x
if self.index != nil
n_split = [($game_party.actors.length * 0.5).ceil, 4].min
case n_split
when 1
n_index = self.index * 2
when 2
if self.index < ($game_party.actors.length - 2)
n_index = 0.5 + (2 * self.index)
else
if $game_party.actors.length == 3 then
n_index = (self.index * 2) + 2
elsif $game_party.actors.length == 4 then
n_index = self.index * 2
end
end
when 3
n_index = self.index + (0.25 * (self.index + 1))
if $game_party.actors.length == 5
if self.index < 2
n_index = self.index + (0.25 * (self.index + 1))
else
n_index = self.index + (0.25 * (self.index + 2)) + 1
end
end
when 4
n_index = self.index
if $game_party.actors.length == 7
if self.index < 3
n_index = self.index
else
n_index = self.index + 1
end
end
end
return (n_index - ((n_index / 4).floor) * 4) * ((160 / (4)) / 5) + 480 + ((n_index / 4).floor * 60)
else
return 0
end
end
#--------------------------------------------------------------------------
# ? ????? Y ?????
#--------------------------------------------------------------------------
def screen_y
n_split = [($game_party.actors.length * 0.5).ceil, 4].min
case n_split
when 1
n_index = self.index * 2
when 2
if self.index < ($game_party.actors.length - 2)
n_index = 0.5 + (2 * self.index)
else
if $game_party.actors.length == 3 then
n_index = (self.index * 2) + 2
elsif $game_party.actors.length == 4 then
n_index = self.index * 2
end
end
when 3
n_index = self.index + (0.25 * (self.index + 1))
if $game_party.actors.length == 5
if self.index < 2
n_index = self.index + (0.25 * (self.index + 1))
else
n_index = self.index + (0.25 * (self.index + 2)) + 1
end
end
when 4
n_index = self.index
if $game_party.actors.length == 7
if self.index < 3
n_index = self.index
else
n_index = self.index + 1
end
end
end
return (n_index - ((n_index / 4).floor) * 4) * ((160 / (4)) * 1.6) + 270 - ((n_index / 4).floor * (110 - (4 * 20)))
end
#--------------------------------------------------------------------------
# ? ????? Z ?????
#--------------------------------------------------------------------------
def screen_z
# ??????????? Z ?????????
if self.index != nil
return self.index
else
return 0
end
end
end

class Game_Enemy < Game_Battler
def screen_x
n_split = [($game_troop.enemies.length * 0.5).ceil, 4].min
case n_split
when 1
n_index = self.index * 2
when 2
if self.index < ($game_troop.enemies.length - 2)
n_index = 0.5 + (2 * self.index)
else
if $game_troop.enemies.length == 3 then
n_index = (self.index * 2) + 2
elsif $game_troop.enemies.length == 4 then
n_index = self.index * 2
end
end
when 3
n_index = self.index + (0.25 * (self.index + 1))
if $game_troop.enemies.length == 5
if self.index < 2
n_index = self.index + (0.25 * (self.index + 1))
else
n_index = self.index + (0.25 * (self.index + 2)) + 2
end
end
when 4
n_index = self.index
if $game_troop.enemies.length == 7
if self.index < 3
n_index = self.index
else
n_index = self.index + 1
end
end
end
return (n_index - ((n_index / 4).floor) * 4) * ((-160 / (4)) / 5) + 160 - ((n_index / 4).floor * 60)
end
#--------------------------------------------------------------------------
# ? ????? Y ?????
#--------------------------------------------------------------------------
def screen_y
n_split = [($game_troop.enemies.length * 0.5).ceil, 4].min
case n_split
when 1
n_index = self.index * 2
when 2
if self.index < ($game_troop.enemies.length - 2)
n_index = 0.5 + (2 * self.index)
else
if $game_troop.enemies.length == 3 then
n_index = (self.index * 2) + 2
elsif $game_troop.enemies.length == 4 then
n_index = self.index * 2
end
end
when 3
n_index = self.index + (0.25 * (self.index + 1))
if $game_troop.enemies.length == 5
if self.index < 2
n_index = self.index + (0.25 * (self.index + 1))
else
n_index = self.index + (0.25 * (self.index + 2)) + 1
end
end
when 4
n_index = self.index
if $game_troop.enemies.length == 7
if self.index < 3
n_index = self.index
else
n_index = self.index + 1
end
end
end
return (n_index - ((n_index / 4).floor) * 4) * ((160 / (4)) * 1.6) + 270 - ((n_index / 4).floor * (110 - (4 * 20)))
end
#--------------------------------------------------------------------------
# ? ????? Z ?????
#--------------------------------------------------------------------------
def screen_z
return @member_index + 1
end
end

#==============================================================================
# ヲ Sprite_Battler
#------------------------------------------------------------------------------
# ????????????????Game_Battler ???????????????
# ????????????????????
#==============================================================================

class Sprite_Battler < RPG::Sprite
#--------------------------------------------------------------------------
# ? ??????????
#--------------------------------------------------------------------------
attr_accessor :battler # ????
attr_accessor :moving # Is the sprite moving?
attr_reader :index
attr_accessor :target_index
attr_accessor :direction
attr_accessor :pattern
#--------------------------------------------------------------------------
# ? ?????????
# viewport : ??????
# battler : ???? (Game_Battler)
#--------------------------------------------------------------------------
def initialize(viewport, battler = nil)
super(viewport)
change
@old = Graphics.frame_count # For the delay method
@goingup = true # Increasing animation? (if @rm2k_mode is true)
@once = false # Is the animation only played once?
@animated = true # Used to stop animation when @once is true
self.opacity = 0
@index = 0
@pattern_b = 0
@counter_b = 0
@trans_sprite = Sprite.new
@trans_sprite.opacity = 0
@bar_hp_sprite = Sprite.new
@bar_hp_sprite.bitmap = Bitmap.new(64, 10)
@bar_sp_sprite = Sprite.new
@bar_sp_sprite.bitmap = Bitmap.new(64, 10)
@color1 = Color.new(0, 0, 0, 192)
@color2 = Color.new(255, 255, 192, 192)
@color3 = Color.new(0, 0, 0, 192)
@color4 = Color.new(64, 0, 0, 192)
@old_hp = -1
@old_sp = -1
@battler = battler
@battler_visible = false
@first = true
@pattern = 0
if $target_index == nil
$target_index = 0
end
@battler.is_a?(Game_Enemy) ? enemy_pose(0, 1) : pose(0, 1)
end
#--------------------------------------------------------------------------
# ? ??
#--------------------------------------------------------------------------
def dispose
if self.bitmap != nil
self.bitmap.dispose
end
if @trans_sprite.bitmap != nil
@trans_sprite.bitmap.dispose
end
@trans_sprite.dispose
@bar_hp_sprite.bitmap.dispose
@bar_hp_sprite.dispose
@bar_sp_sprite.bitmap.dispose
@bar_sp_sprite.dispose
super
end

def change(frames = 0, delay = 0, offx = 0, offy = 0, startf = 0, once = false)
@frames = frames
@delay = delay
@offset_x, @offset_y = offx, offy
@current_frame = startf
@once = once
@goingup = true
@animated = true
end
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
def update
bar_check = true if @_damage_duration == 1
super
@trans_sprite.blend_type = self.blend_type
@trans_sprite.color = self.color
if @_collapse_duration > 0
@trans_sprite.opacity = self.opacity
else
@trans_sprite.opacity = [self.opacity, 160].min
end
if (@_damage_duration == 0 and bar_check == true) or @first == true
@first = false if @first == true
bar_check = false
@bar_must_change = true
end
@bar_hp_sprite.opacity = self.opacity
@bar_sp_sprite.opacity = self.opacity
# ????? nil ???
if @battler == nil
self.bitmap = nil
@trans_sprite.bitmap = nil
loop_animation(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
if @battler.is_a?(Game_Actor)
@battler_name = @battler.character_name
@battler_hue = @battler.character_hue
@direction = 4
else
@direction = 6
end
self.bitmap = RPG::Cache.character(@battler_name, @battler_hue)
@width = bitmap.width / 4
@height = bitmap.height / 4
@frame_width = @width
@frame_height = @height
self.ox = @width / 2
self.oy = @height
@pattern = @current_frame
@direction = @offset_y
sx = @pattern * @width
sy = (@direction - 2) / 2 * @height
self.src_rect.set(sx, sy, @width, @height)
@current_frame = (@current_frame + 1) unless @frames == 0
@animated = false if @current_frame == @frames and @once
@current_frame %= @frames
@trans_sprite.bitmap = self.bitmap
@trans_sprite.ox = self.ox
@trans_sprite.oy = self.oy
@trans_sprite.src_rect.set(sx, sy, @width, @height)
# ?????????????????? 0 ???
if @battler.dead? or @battler.hidden
self.opacity = 0
@trans_sprite.opacity = 0
@bar_hp_sprite.opacity = 0
@bar_sp_sprite.opacity = 0
end
self.x = @battler.screen_x
self.y = @battler.screen_y
self.z = @battler.screen_z
end
change_sp_bar if @old_sp != @battler.sp
if delay(@delay) and @animated
@pattern = @current_frame
@direction = @offset_y
sx = @pattern * @width
sy = (@direction - 2) / 2 * @height
self.src_rect.set(sx, sy, @width, @height)
@current_frame = (@current_frame + 1) unless @frames == 0
@animated = false if @current_frame == @frames and @once
@current_frame %= @frames
@trans_sprite.ox = self.ox
@trans_sprite.oy = self.oy
@trans_sprite.src_rect.set(sx, sy, @width, @height)
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
# ??????????????
#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)
appear
@battler_visible = true
end
end
# ?????
if @battler_visible
# ??
if @battler.hidden
$game_system.se_play($data_system.escape_se)
escape
@trans_sprite.opacity = 0
@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
if @bar_must_change == true
@bar_must_change = false
if @old_hp != @battler.hp
change_hp_bar
end
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
collapse
@battler_visible = false
end
end
end
# ???????????
@trans_sprite.x = self.x
@trans_sprite.y = self.y
@trans_sprite.z = self.z
@bar_hp_sprite.x = @battler.screen_x - 32
@bar_hp_sprite.y = @battler.screen_y - (@height +18) if @height != nil
@bar_hp_sprite.z = 100
@bar_sp_sprite.x = @battler.screen_x - 32
@bar_sp_sprite.y = @battler.screen_y - (@height + 8) if @height != nil
@bar_sp_sprite.z = 100
end

#--------------------------------------------------------------------------
# - Move the sprite
# x : X coordinate of the destination point
# y : Y coordinate of the destination point
# speed : Speed of movement (0 = delayed, 1+ = faster)
# delay : Movement delay if speed is at 0
#--------------------------------------------------------------------------
def move(x, y, speed = 1, delay = 0)
@destx = x
@desty = y
@move_speed = speed
@move_delay = delay
@move_old = Graphics.frame_count
@moving = true
end

#--------------------------------------------------------------------------
# - Move sprite to destx and desty
#--------------------------------------------------------------------------
def update_move
return unless @moving
movinc = @move_speed == 0 ? 1 : @move_speed
if Graphics.frame_count - @move_old > @move_delay or @move_speed != 0
self.x += movinc if self.x < @destx
self.x -= movinc if self.x > @destx
self.y += movinc if self.y < @desty
self.y -= movinc if self.y > @desty
@move_old = Graphics.frame_count
end
if @move_speed > 1 # Check if sprite can't reach that point
self.x = @destx if (@destx - self.x).abs % @move_speed != 0 and
(@destx - self.x).abs <= @move_speed
self.y = @desty if (@desty - self.y).abs % @move_speed != 0 and
(@desty - self.y).abs <= @move_speed
end
if self.x == @destx and self.y == @desty
@moving = false
end
end

#--------------------------------------------------------------------------
# - Pause animation, but still updates movement
# frames : Number of frames
#--------------------------------------------------------------------------
def delay(frames)
update_move
if (Graphics.frame_count - @old >= frames)
@old = Graphics.frame_count
return true
end
return false
end

def change_hp_bar
j = false
@old_hp = @battler.hp if @old_hp == -1
i = @old_hp
loop do
i -= 10
if i < @battler.hp
i = @battler.hp
j = true
end
rate = i.to_f / @battler.maxhp
@color5 = Color.new(80 - 24 * rate, 80 * rate, 14 * rate, 192)
@color6 = Color.new(240 - 72 * rate, 240 * rate, 62 * rate, 192)
@bar_hp_sprite.bitmap.clear
@bar_hp_sprite.bitmap.fill_rect(0, 0, 64, 10, @color1)
@bar_hp_sprite.bitmap.fill_rect(1, 1, 62, 8, @color2)
@bar_hp_sprite.bitmap.gradation_rect(2, 2, 60, 6, @color3, @color4, 1)
#@bar_hp_sprite.bitmap.fill_rect(2, 2, 60, 6, @color3)
@bar_hp_sprite.bitmap.gradation_rect(2, 2, 64 * rate - 4, 6, @color5, @color6, 2)
#@bar_hp_sprite.bitmap.fill_rect(2, 2, 64 * rate - 4, 6, @color5)
@bar_hp_sprite.opacity = self.opacity
Graphics.update
if j == true
j = false
break
end
end
@old_hp = @battler.hp
end

def change_sp_bar
j = false
@old_sp = @battler.sp if @old_sp == -1
i = @old_sp
loop do
i -= 10
if i < @battler.sp
i = @battler.sp
j = true
end
rate = i.to_f / @battler.maxsp
@color7 = Color.new(14 * rate, 80 - 24 * rate, 80 * rate, 192)
@color8 = Color.new(62 * rate, 240 - 72 * rate, 240 * rate, 192)
@bar_sp_sprite.bitmap.clear
@bar_sp_sprite.bitmap.fill_rect(0, 0, 64, 10, @color1)
@bar_sp_sprite.bitmap.fill_rect(1, 1, 62, 8, @color2)
@bar_sp_sprite.bitmap.gradation_rect(2, 2, 60, 6, @color3, @color4, 1)
#@bar_hp_sprite.bitmap.fill_rect(2, 2, 60, 6, @color3)
@bar_sp_sprite.bitmap.gradation_rect(2, 2, 64 * rate - 4, 6, @color7, @color8, 0)
#@bar_hp_sprite.bitmap.fill_rect(2, 2, 64 * rate - 4, 6, @color5)
@bar_sp_sprite.opacity = self.opacity
Graphics.update
if j == true
j = false
break
end
end
@old_sp = @battler.sp
end

def enemy #
$target_index += $game_troop.enemies.size
$target_index %= $game_troop.enemies.size
return $game_troop.enemies[$target_index] #
end #

def actor #
$target_index += $game_party.actors.size
$target_index %= $game_party.actors.size
return $game_party.actors[$target_index] #
end

def index=(index)
@index = index
update
end

def pose(number, frames = 4)
case number
when 0
change(frames, 4, 0, 4, 0)
when 1
change(frames, 4, 0, 4)
when 2
change(frames, 4, 0, 6)
else
change(frames, 4, 0, 0, 0)
end
end

def enemy_pose(number ,enemy_frames = 4)
case number
when 0
change(enemy_frames, 4, 0, 6, 0)
when 1
change(enemy_frames, 4, 0, 4)
when 2
change(enemy_frames, 4, 0, 6)
else
change(enemy_frames, 4, 0, 0, 0)
end
end

def default_pose
pose(0, 1)
end
end

#==============================================================================
# ヲ Spriteset_Battle
#------------------------------------------------------------------------------
# ???????????????????????????? Scene_Battle ??
# ????????????
#==============================================================================

class Spriteset_Battle
#--------------------------------------------------------------------------
# ? ??????????
#--------------------------------------------------------------------------
attr_reader :viewport1 # ????????????
attr_reader :viewport2 # ????????????
attr_accessor :actor_sprites
attr_accessor :enemy_sprites
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
def initialize
# ?????????
@viewport1 = Viewport.new(0, 0, 640, 480)
@viewport2 = Viewport.new(0, 0, 640, 480)
@viewport3 = Viewport.new(0, 0, 640, 480)
@viewport4 = Viewport.new(0, 0, 640, 480)
@viewport2.z = 101
@viewport3.z = 200
@viewport4.z = 5000
if $game_temp.battleback_name == ""
@battleback_sprite = nil
@tilemap = Tilemap.new(@viewport1)
@tilemap.tileset = RPG::Cache.tileset($game_map.tileset_name)
for i in 0..6
autotile_name = $game_map.autotile_names[i]
@tilemap.autotiles[i] = RPG::Cache.autotile(autotile_name)
end
@tilemap.map_data = $game_map.data
@tilemap.priorities = $game_map.priorities
else
# ??????????????
@tilemap = nil
@battleback_sprite = Sprite.new(@viewport1)
end
# ????????????
@enemy_sprites = []
for enemy in $game_troop.enemies#.reverse
@enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))
end
# ????????????
@actor_sprites = []
for j in 0..7
# アクタースプライトを追加
@actor_sprites.push(Sprite_Battler.new(@viewport1, $game_party.actors[j]))
end
# ?????
@weather = RPG::Weather.new(@viewport1)
# ????????????
@picture_sprites = []
for i in 51..100
@picture_sprites.push(Sprite_Picture.new(@viewport3,
$game_screen.pictures[i]))
end
# ????????????
@timer_sprite = Sprite_Timer.new
# ??????
update
end
#--------------------------------------------------------------------------
# ? ??
#--------------------------------------------------------------------------
def dispose
if @tilemap != nil
# ?????????
@tilemap.tileset.dispose
for i in 0..6
@tilemap.autotiles[i].dispose
end
@tilemap.dispose
end
# ??????????????
if @battleback_sprite != nil
# ??????????????????????
if @battleback_sprite.bitmap != nil
@battleback_sprite.bitmap.dispose
end
@battleback_sprite.dispose
end
# ??????????????????????
for sprite in @enemy_sprites + @actor_sprites
sprite.dispose
end
# ?????
@weather.dispose
# ????????????
for sprite in @picture_sprites
sprite.dispose
end
# ????????????
@timer_sprite.dispose
# ?????????
@viewport1.dispose
@viewport2.dispose
@viewport3.dispose
@viewport4.dispose
end
#--------------------------------------------------------------------------
# ? ??????????
#--------------------------------------------------------------------------
def effect?
# ??????????????? true ???
for sprite in @enemy_sprites + @actor_sprites
return true if sprite.effect?
end
return false
end
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
def update
# ???????????????????????
if @battleback_sprite != nil
if @battleback_name != $game_temp.battleback_name
@battleback_name = $game_temp.battleback_name
if @battleback_sprite.bitmap != nil
@battleback_sprite.bitmap.dispose
end
bg_bitmap = RPG::Cache.battleback(@battleback_name)
bg_bitmap_stretch = Bitmap.new(640, 480)
bg_bitmap_stretch.stretch_blt(Rect.new(0, 0, 640, 480), bg_bitmap, bg_bitmap.rect)
@battleback_sprite.bitmap = bg_bitmap_stretch
end
end
if @tilemap != nil
@tilemap.ox = $game_map.display_x / 4
@tilemap.oy = $game_map.display_y / 4
@tilemap.update
end
# ????????????
for sprite in @enemy_sprites + @actor_sprites
sprite.update
end
# ???????????
@weather.type = $game_screen.weather_type
@weather.max = $game_screen.weather_max
@weather.update
# ????????????
for sprite in @picture_sprites
sprite.update
end
# ????????????
@timer_sprite.update
# ???????????????
@viewport1.tone = $game_screen.tone
@viewport1.ox = $game_screen.shake
# ????????????
@viewport4.color = $game_screen.flash_color
# ?????????
@viewport1.update
@viewport2.update
@viewport4.update
end
end

#==============================================================================
# ヲ Window_Command
#------------------------------------------------------------------------------
# ?????????????????????
#==============================================================================

class Window_Command < Window_Selectable
#--------------------------------------------------------------------------
# ? ?????????
# width : ???????
# commands : ??????????
#--------------------------------------------------------------------------
def initialize(width, commands, column_max = 1, style = 0, inf_scroll = 1)
# ????????????????????
super(0, 0, width, (commands.size * 1.0 / column_max).ceil * 32 + 32)
@inf_scroll = inf_scroll
@item_max = commands.size
@commands = commands
@column_max = column_max
@style = style
self.contents = Bitmap.new(width - 32, (@item_max * 1.0 / @column_max).ceil * 32)
self.contents.font.name = "Tahoma"
self.contents.font.size = 22
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i, normal_color)
end
end
#--------------------------------------------------------------------------
# ? ?????
# index : ????
# color : ???
#--------------------------------------------------------------------------
def draw_item(index, color)
self.contents.font.color = color
rect = Rect.new(index%@column_max * (self.width / @column_max) + 4, 32 * (index/@column_max), self.width / @column_max - 40, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, @commands[index], @style)
end
#--------------------------------------------------------------------------
# ? ??????
# index : ????
#--------------------------------------------------------------------------
def disable_item(index)
draw_item(index, disabled_color)
end

def update_help
@help_window.set_actor($game_party.actors[$scene.actor_index])
end
end

#==============================================================================
# ヲ Arrow_Enemy
#------------------------------------------------------------------------------
# ????????????????????????????? Arrow_Base ??
# ????????
#==============================================================================

class Arrow_Enemy < Arrow_Base
#--------------------------------------------------------------------------
# ? ?????????????????
#--------------------------------------------------------------------------
def enemy
return $game_troop.enemies[@index]
end
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
def update
super
# ???????????????????
$game_troop.enemies.size.times do
break if self.enemy.exist?
@index += 1
@index %= $game_troop.enemies.size
end
# ?????
if Input.repeat?(Input::UP)
$game_system.se_play($data_system.cursor_se)
$game_troop.enemies.size.times do
@index += 1
@index %= $game_troop.enemies.size
break if self.enemy.exist?
end
end
# ?????
if Input.repeat?(Input::DOWN)
$game_system.se_play($data_system.cursor_se)
$game_troop.enemies.size.times do
@index += $game_troop.enemies.size - 1
@index %= $game_troop.enemies.size
break if self.enemy.exist?
end
end
if Input.repeat?(Input::RIGHT)
$game_system.se_play($data_system.cursor_se)
$game_troop.enemies.size.times do
@index += ((($game_troop.enemies.length) * 0.5).ceil)
@index %= $game_troop.enemies.size
break if self.enemy.exist?
end
end
if Input.repeat?(Input::LEFT)
$game_system.se_play($data_system.cursor_se)
$game_troop.enemies.size.times do
@index += $game_troop.enemies.size - ((($game_troop.enemies.length) * 0.5).ceil)
@index %= $game_troop.enemies.size
break if self.enemy.exist?
end
end
# ???????????
if self.enemy != nil
self.x = self.enemy.screen_x + 4
self.y = self.enemy.screen_y + 36
self.z = self.enemy.screen_z + 1
end
end
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
def update_help
# ????????????????????????
@help_window.set_enemy(self.enemy)
end
end

#==============================================================================
# ヲ Arrow_Actor
#------------------------------------------------------------------------------
# ????????????????????????????? Arrow_Base ??
# ????????
#==============================================================================

class Arrow_Actor < Arrow_Base
#--------------------------------------------------------------------------
# ? ?????????????????
#--------------------------------------------------------------------------
def actor
return $game_party.actors[@index]
end
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
def update
super
# ?????
if Input.repeat?(Input::DOWN)
$game_system.se_play($data_system.cursor_se)
@index += 1
@index %= $game_party.actors.size
end
# ?????
if Input.repeat?(Input::UP)
$game_system.se_play($data_system.cursor_se)
@index += $game_party.actors.size - 1
@index %= $game_party.actors.size
end
if Input.repeat?(Input::RIGHT)
$game_system.se_play($data_system.cursor_se)
@index += ($game_party.actors.length * 0.5).ceil
@index %= $game_party.actors.size
end
# ?????
if Input.repeat?(Input::LEFT)
$game_system.se_play($data_system.cursor_se)
@index += $game_party.actors.size - (($game_party.actors.length * 0.5).ceil)
@index %= $game_party.actors.size
end
# ???????????
if self.actor != nil
self.x = self.actor.screen_x
self.y = self.actor.screen_y + 36
self.z = self.actor.screen_z + 1
end
end
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
def update_help
# ??????????????????????
@help_window.set_actor(self.actor)
end
end

class Scene_Battle
attr_accessor :actor_index
def main
# ???????????????
$game_temp.in_battle = true
$game_temp.battle_turn = 0
$game_temp.battle_event_flags.clear
$game_temp.battle_abort = false
$game_temp.battle_main_phase = false
$game_temp.battleback_name = $game_map.battleback_name
$game_temp.forcing_battler = nil
# ??????????????????
$game_system.battle_interpreter.setup(nil, 0)
# ???????
@troop_id = $game_temp.battle_troop_id
$game_troop.setup(@troop_id)
# ????????????????
s1 = $data_system.words.attack
s1 = $data_system.words.attack
s2 = $data_system.words.skill
s3 = $data_system.words.guard
s4 = $data_system.words.item
@actor_command_window = Window_Command.new(640, [s1, s2, s3, s4], 4)
@actor_command_window.y = 64
@actor_command_window.back_opacity = 160
@actor_command_window.active = false
@actor_command_window.visible = false
# ????????????
@party_command_window = Window_PartyCommand.new
@help_window = Window_Help.new
@help_window.back_opacity = 160
@help_window.visible = false
#@status_window = Window_BattleStatus.new
@message_window = Window_Message.new
# ???????????
@spriteset = Spriteset_Battle.new
# ????????????
@wait_count = 0
# ?????????
if $data_system.battle_transition == ""
Graphics.transition(20)
else
Graphics.transition(40, "Graphics/Transitions/" +
$data_system.battle_transition)
end
# ???????????
start_phase1
# ??????
loop do
# ????????
Graphics.update
# ???????
Input.update
# ??????
update
# ????????????????
if $scene != self
break
end
end
# ??????????
$game_map.refresh
# ?????????
Graphics.freeze
# ????????
@actor_command_window.dispose
@party_command_window.dispose
@help_window.dispose
#@status_window.dispose
@message_window.dispose
if @skill_window != nil
@skill_window.dispose
end
if @item_window != nil
@item_window.dispose
end
if @result_window != nil
@result_window.dispose
end
# ???????????
@spriteset.dispose
# ???????????????
if $scene.is_a?(Scene_Title)
# ??????????
Graphics.transition
Graphics.freeze
end
# ???????????????????????????
if $BTEST and not $scene.is_a?(Scene_Gameover)
$scene = nil
end
end

def update
# ?????????????
if $game_system.battle_interpreter.running?
# ?????????
$game_system.battle_interpreter.update
# ?????????????????????????
if $game_temp.forcing_battler == nil
# ?????????????????
unless $game_system.battle_interpreter.running?
# ??????????????????????????
unless judge
setup_battle_event
end
end
# ????????????????
if @phase != 5
# ?????????????????
#@status_window.refresh
end
end
end
# ???? (????)??????
$game_system.update
$game_screen.update
# ????? 0 ??????
if $game_system.timer_working and $game_system.timer == 0
# ?????
$game_temp.battle_abort = true
end
# ????????
@help_window.update
@party_command_window.update
@actor_command_window.update
#@status_window.update
@message_window.update
# ???????????
@spriteset.update
# ?????????????
if $game_temp.transition_processing
# ?????????????????
$game_temp.transition_processing = false
# ?????????
if $game_temp.transition_name == ""
Graphics.transition(20)
else
Graphics.transition(40, "Graphics/Transitions/" +
$game_temp.transition_name)
end
end
# ????????????????
if $game_temp.message_window_showing
return
end
# ???????????
if @spriteset.effect?
return
end
# ??????????
if $game_temp.gameover
# ??????????????
$scene = Scene_Gameover.new
return
end
# ???????????
if $game_temp.to_title
# ???????????
$scene = Scene_Title.new
return
end
# ????????
if $game_temp.battle_abort
# ??????? BGM ???
$game_system.bgm_play($game_temp.map_bgm)
# ?????
battle_end(1)
return
end
# ????????
if @wait_count > 0
# ????????????
@wait_count -= 1
return
end

# this one holds the battle while the player moves
for actor in @spriteset.actor_sprites
if actor.moving
return
end
end
# and this one is for the enemy...
for enemy in @spriteset.enemy_sprites
if enemy.moving# and $game_system.animated_enemy
return
end
end
# ???????????????????????
# ????????????????
if $game_temp.forcing_battler == nil and
$game_system.battle_interpreter.running?
return
end
# ??????????
case @phase
when 1 # ?????????
update_phase1
when 2 # ????????????
update_phase2
when 3 # ????????????
update_phase3
when 4 # ???????
update_phase4
when 5 # ???????????
update_phase5
end
end

def start_phase2
# ???? 2 ???
@phase = 2
# ?????????????
@actor_index = -1
@active_battler = nil
# ?????????????????
@party_command_window.active = true
@party_command_window.visible = true
# ?????????????????
@actor_command_window.active = false
@actor_command_window.visible = false
@help_window.visible = false
# ??????????????
$game_temp.battle_main_phase = false
# ????????????????
$game_party.clear_actions
# ????????????
unless $game_party.inputable?
# ?????????
start_phase4
end
end

def update_phase2_escape
# ??????????????
enemies_agi = 0
enemies_number = 0
for enemy in $game_troop.enemies
if enemy.exist?
enemies_agi += enemy.agi
enemies_number += 1
end
end
if enemies_number > 0
enemies_agi /= enemies_number
end
# ??????????????
actors_agi = 0
actors_number = 0
for actor in $game_party.actors
if actor.exist?
actors_agi += actor.agi
actors_number += 1
end
end
if actors_number > 0
actors_agi /= actors_number
end
# ??????
success = rand(100) < 50 * actors_agi / enemies_agi
# ???????
if success
# ?? SE ???
$game_system.se_play($data_system.escape_se)
for actor in $game_party.actors
@spriteset.actor_sprites[actor.index].pose(2)
@spriteset.actor_sprites[actor.index].move(660, actor.screen_y, 10)
end
check = escape_move
until check == false
@spriteset.update

Graphics.update
check = escape_move
end
# ??????? BGM ???
$game_system.bgm_play($game_temp.map_bgm)
# ?????
battle_end(1)
# ???????
else
# ????????????????
$game_party.clear_actions
# ?????????
start_phase4
end
end

def escape_move
for actor in @spriteset.actor_sprites
if actor.moving
return true
end
end
return false
end

def start_phase5
# ???? 5 ???
@phase = 5
# ????? ME ???
$game_system.me_play($game_system.battle_end_me)
# ??????? BGM ???
$game_system.bgm_play($game_temp.map_bgm)
# EXP???????????????
exp = 0
gold = 0
treasures = []
# ???
for enemy in $game_troop.enemies
# ??????????????
unless enemy.hidden
# ?? EXP????????
exp += enemy.exp
gold += enemy.gold
# ?????????
if rand(100) < enemy.treasure_prob
if enemy.item_id > 0
treasures.push($data_items[enemy.item_id])
end
if enemy.weapon_id > 0
treasures.push($data_weapons[enemy.weapon_id])
end
if enemy.armor_id > 0
treasures.push($data_armors[enemy.armor_id])
end
end
end
end
# ???????? 6 ??????
treasures = treasures[0..5]
# EXP ??
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
if actor.cant_get_exp? == false
last_level = actor.level
actor.exp += exp
if actor.level > last_level
#@status_window.level_up(i)
end
end
end
# ??????
$game_party.gain_gold(gold)
# ???????
for item in treasures
case item
when RPG::Item
$game_party.gain_item(item.id, 1)
when RPG::Weapon
$game_party.gain_weapon(item.id, 1)
when RPG::Armor
$game_party.gain_armor(item.id, 1)
end
end
# ???????????????
@result_window = Window_BattleResult.new(exp, gold, treasures)
# ???????????
@phase5_wait_count = 100
end

#--------------------------------------------------------------------------
# ? ?????? (???????????)
#--------------------------------------------------------------------------
def update_phase5
# ????????? 0 ???????
if @phase5_wait_count > 0
# ????????????
@phase5_wait_count -= 1
# ????????? 0 ??????
if @phase5_wait_count == 0
# ????????????
@result_window.visible = true
# ??????????????
$game_temp.battle_main_phase = false
# ?????????????????
#@status_window.refresh
end
return
end
# C ??????????
if Input.trigger?(Input::C)
# ?????
battle_end(0)
end
end

def phase3_setup_command_window
# ?????????????????
@party_command_window.active = false
@party_command_window.visible = false
# ?????????????????
@actor_command_window.active = true
@actor_command_window.visible = true
@help_window.visible = true
# ???????????????????
if @actor_command_window.help_window == nil
@actor_command_window.help_window = @help_window
end
@actor_command_window.update_help
#@actor_command_window.x = @actor_index * 160
# ??????? 0 ???
@actor_command_window.index = 0
end
def start_enemy_select
# ??????????
@enemy_arrow = Arrow_Enemy.new(@spriteset.viewport2)
# ?????????????
@enemy_arrow.help_window = @help_window
# ?????????????????
@actor_command_window.active = false
@actor_command_window.visible = false
end

def update_phase4
case @phase4_step
when 1
update_phase4_step1
when 2
update_phase4_step2
when 3
update_phase4_step3
when 4
update_phase4_step4
when 5
update_phase4_step5
when 6
update_phase4_step6
when 7
update_phase4_step7
end
end

def update_phase4_step1

# Change actor poses to default
#if @active_battler.is_a?(Game_Actor)
# @spriteset.actor_sprites[@active_battler.index].default_pose
#end
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
@spriteset.actor_sprites[i].default_pose
end

@help_window.visible = false
if judge
return
end
if $game_temp.forcing_battler == nil
setup_battle_event
if $game_system.battle_interpreter.running?
return
end
end
if $game_temp.forcing_battler != nil
@action_battlers.delete($game_temp.forcing_battler)
@action_battlers.unshift($game_temp.forcing_battler)
end
if @action_battlers.size == 0
start_phase2
return
end
@animation1_id = 0
@animation2_id = 0
@common_event_id = 0
@active_battler = @action_battlers.shift
if @active_battler.index == nil
return
end
if @active_battler.hp > 0 and @active_battler.slip_damage?
@active_battler.slip_damage_effect
@active_battler.damage_pop = true
end
@active_battler.remove_states_auto
#@status_window.refresh
@phase4_step = 2
end

def make_basic_action_result

if @active_battler.is_a?(Game_Actor)
$actor_on_top = true
elsif @active_battler.is_a?(Game_Enemy)
$actor_on_top = false
end
if @active_battler.current_action.basic == 0
@animation1_id = @active_battler.animation1_id
@animation2_id = @active_battler.animation2_id
if @active_battler.is_a?(Game_Enemy)
if @active_battler.restriction == 3
target = $game_troop.random_target_enemy
elsif @active_battler.restriction == 2
target = $game_party.random_target_actor
else
index = @active_battler.current_action.target_index
target = $game_party.smooth_target_actor(index)
end
#======== here is the setting for the movement & animation...
x = target.screen_x - 32
@spriteset.enemy_sprites[@active_battler.index].enemy_pose(2)
@spriteset.enemy_sprites[@active_battler.index].move(x, target.screen_y, 4)
#========= here if you look at the RPG's movement settings you'll see
#========= that he takes the number 40 for the speed of the animation...
#========= i thing thats too fast so i settet it down to 10 so looks smoother...
end
if @active_battler.is_a?(Game_Actor)
weapon = $data_weapons[@active_battler.weapon_id]
range = false
if weapon != nil
for id in weapon.element_set
if $data_system.elements[23] == "Range"
range = true
break
end
end
end
if @active_battler.restriction == 3
target = $game_party.random_target_actor
elsif @active_battler.restriction == 2
target = $game_troop.random_target_enemy
else
index = @active_battler.current_action.target_index
target = $game_troop.smooth_target_enemy(index)
end
#======= the same thing for the player... ^-^
x = target.screen_x + 32
@spriteset.actor_sprites[@active_battler.index].pose(1)
@spriteset.actor_sprites[@active_battler.index].move(x * (range ? 2 : 1), target.screen_y, 4)
range = false
end
@target_battlers = [target]
for target in @target_battlers
target.attack_effect(@active_battler)
end
return
end
if @active_battler.current_action.basic == 1
if @active_battler.is_a?(Game_Actor)
@spriteset.actor_sprites[@active_battler.index].pose(0, 1) #defence
else
@spriteset.enemy_sprites[@active_battler.index].enemy_pose(0, 1) #defence
end
@help_window.set_text($data_system.words.guard, 1)
return
end
if @active_battler.is_a?(Game_Enemy) and
@active_battler.current_action.basic == 2
@help_window.set_text("Escape", 1)
@active_battler.escape
return
end
if @active_battler.current_action.basic == 3
$game_temp.forcing_battler = nil
@phase4_step = 1
return
end

if @active_battler.current_action.basic == 4
if $game_temp.battle_can_escape == false
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
update_phase2_escape
return
end
end

def make_skill_action_result

@skill = $data_skills[@active_battler.current_action.skill_id]
unless @active_battler.current_action.forcing
unless @active_battler.skill_can_use?(@skill.id)
$game_temp.forcing_battler = nil
@phase4_step = 1
return
end
end
@active_battler.sp -= @skill.sp_cost
#@status_window.refresh
@help_window.set_text(@skill.name, 1)
@animation1_id = @skill.animation1_id
@animation2_id = @skill.animation2_id
if @active_battler.is_a?(Game_Enemy)
#@spriteset.enemy_sprites[@active_battler.index].change_sp_bar
x = @active_battler.screen_x + 48
@spriteset.enemy_sprites[@active_battler.index].enemy_pose(2)
@spriteset.enemy_sprites[@active_battler.index].move(x, @active_battler.screen_y, 5)
@spriteset.enemy_sprites[@active_battler.index].enemy_pose(0, 1)
end
if @active_battler.is_a?(Game_Actor)
#@spriteset.actor_sprites[@active_battler.index].change_sp_bar
x = @active_battler.screen_x - 48
@spriteset.actor_sprites[@active_battler.index].pose(1)
@spriteset.actor_sprites[@active_battler.index].move(x, @active_battler.screen_y, 5)
@spriteset.actor_sprites[@active_battler.index].pose(0, 1)
end
@common_event_id = @skill.common_event_id
set_target_battlers(@skill.scope)
for target in @target_battlers
target.skill_effect(@active_battler, @skill)
end
end

def make_item_action_result

# sorry i didnt work on this...
# couse i dont have a sprite that uses items....
# so i just added the standby sprite here...
# when i get more time for this i'll try what i can do for this one... ^-^
# its the same as the ones above...
if @active_battler.is_a?(Game_Actor)
@spriteset.actor_sprites[@active_battler.index].pose(0, 1)
else
@spriteset.enemy_sprites[@active_battler.index].enemy_pose(0, 1)
end

@item = $data_items[@active_battler.current_action.item_id]
unless $game_party.item_can_use?(@item.id)
@phase4_step = 1
return
end
if @item.consumable
$game_party.lose_item(@item.id, 1)
end
@help_window.set_text(@item.name, 1)
@animation1_id = @item.animation1_id
@animation2_id = @item.animation2_id
@common_event_id = @item.common_event_id
index = @active_battler.current_action.target_index
target = $game_party.smooth_target_actor(index)
set_target_battlers(@item.scope)
for target in @target_battlers
target.item_effect(@item)
end
end

def update_phase4_step3
if @active_battler.current_action.kind == 0 and
@active_battler.current_action.basic == 0
# in this one... we have our weapon animations... for player and monster
if @active_battler.is_a?(Game_Actor)
@spriteset.actor_sprites[@active_battler.index].pose(0,1)
elsif @active_battler.is_a?(Game_Enemy)
@spriteset.enemy_sprites[@active_battler.index].enemy_pose(0,1)
end
end
if @animation1_id == 1
@active_battler.white_flash = true
else
@active_battler.animation_id = @animation1_id
@active_battler.animation_hit = true
end
@phase4_step = 4
end

def update_phase4_step4
# this here is for the hit animation...
for target in @target_battlers
target.animation_id = @animation2_id
target.animation_hit = (target.damage != "Miss")
end
@wait_count = 8
@phase4_step = 5
end

def update_phase4_step5
if @active_battler.hp > 0 and @active_battler.slip_damage?
@active_battler.slip_damage_effect
@active_battler.damage_pop = true
end
# ???????????
@help_window.visible = false
# ?????????????????
#@status_window.refresh
# ??????

if @active_battler.is_a?(Game_Actor)
@spriteset.actor_sprites[@active_battler.index].pose(0, 1)
else
@spriteset.enemy_sprites[@active_battler.index].enemy_pose(0, 1)
end
for target in @target_battlers
if target.damage != nil
target.damage_pop = true
if @active_battler.is_a?(Game_Actor)
@spriteset.actor_sprites[@active_battler.index].pose(0, 1)
else
@spriteset.enemy_sprites[@active_battler.index].enemy_pose(0, 1)
end
end
end
# ???? 6 ???
@phase4_step = 6
end

def update_phase4_step6

# here we are asking if the player is dead and is a player or an enemy...
# these lines are for the running back and standby animation....
if @active_battler.is_a?(Game_Actor)
if @active_battler.current_action.basic == 1
@spriteset.actor_sprites[@active_battler.index].pose(0, 1)
else
@spriteset.actor_sprites[@active_battler.index].move(@active_battler.screen_x, @active_battler.screen_y, 5)
@spriteset.actor_sprites[@active_battler.index].pose(2)
end
else
if @active_battler.current_action.basic == 1
@spriteset.enemy_sprites[@active_battler.index].enemy_pose(0, 1)
else
@spriteset.enemy_sprites[@active_battler.index].move(@active_battler.screen_x, @active_battler.screen_y, 5)
@spriteset.enemy_sprites[@active_battler.index].enemy_pose(1)
end
end
for target in @target_battlers
if target.is_a?(Game_Actor)
@spriteset.actor_sprites[target.index].pose(0, 1)
else
@spriteset.enemy_sprites[target.index].enemy_pose(0, 1)
end
end
$game_temp.forcing_battler = nil
if @common_event_id > 0
common_event = $data_common_events[@common_event_id]
$game_system.battle_interpreter.setup(common_event.list, 0)
end
@phase4_step = 7
end

def update_phase4_step7

# here we are asking if the player is dead and is a player or an enemy...
# these lines are for the running back and standby animation....
if @active_battler.is_a?(Game_Actor)
@spriteset.actor_sprites[@active_battler.index].pose(0, 1)
else
@spriteset.enemy_sprites[@active_battler.index].enemy_pose(0, 1)
end

$game_temp.forcing_battler = nil
if @common_event_id > 0
common_event = $data_common_events[@common_event_id]
$game_system.battle_interpreter.setup(common_event.list, 0)
end
@phase4_step = 1
end
end



Simply go to Main, and then paste that above the default stuff in main. I know thats not were people usually put code, but hey, worked for me.


__________________________
Go to the top of the page
 
+Quote Post
   
toutoua
post Sep 27 2008, 10:55 AM
Post #2



Group Icon

Group: Member
Posts: 1
Type: None
RM Skill: Undisclosed




this is a nice script but i tryed it and my sprites can't move once it enter's into the battle mode
Go to the top of the page
 
+Quote Post
   
Kuma-san
post Sep 27 2008, 11:08 AM
Post #3


縲祁OIDVOIDVOID縲
Group Icon

Group: Revolutionary
Posts: 291
Type: Writer
RM Skill: Skilled




Finally! I battle system that doest require the use of Minkoff battlers!

But for some reason this reminds me of the RPG Tanketai Sideview Battle System Script for VX.... confused.gif


__________________________
[Show/Hide] Signature.
[Show/Hide] Best real-life quote. Ever
Teacher- Do you think your cute? Do you think your funny?
Student- I think I'm SEXY.

[Show/Hide] Userbars






[Show/Hide] My Tarot Card.

"Prudence, Caution, Deliberation.

The Hermit points to all things hidden, such as knowledge and inspiration,hidden enemies. The illumination is from within, and retirement from participation in current events.

The Hermit is a card of introspection, analysis and, well, virginity. You do not desire to socialize; the card indicates, instead, a desire for peace and solitude. You prefer to take the time to think, organize, ruminate, take stock. There may be feelings of frustration and discontent but these feelings eventually lead to enlightenment, illumination, clarity.

The Hermit represents a wise, inspirational person, friend, teacher, therapist. This a person who can shine a light on things that were previously mysterious and confusing.
"
Go to the top of the page
 
+Quote Post
   
Achilles
post Sep 27 2008, 04:30 PM
Post #4


I can (usually) answer any event based question!
Group Icon

Group: Revolutionary
Posts: 381
Type: Scripter
RM Skill: Masterful




QUOTE (toutoua @ Sep 27 2008, 10:17 AM) *
this is a nice script but i tryed it and my sprites can't move once it enter's into the battle mode


Check to make sure the very first actor in your database ISNT in your party. For some reason, no matter what sprite is used in that slot, it simply will not work, but any other will.


__________________________
Go to the top of the page
 
+Quote Post
   
Achilles
post Sep 27 2008, 07:59 PM
Post #5


I can (usually) answer any event based question!
Group Icon

Group: Revolutionary
Posts: 381
Type: Scripter
RM Skill: Masterful




Sorry to double post, but I might add;
What I would really appreciate is if someone whos skilled at programming could further edit the script so that
1. The hp/sp bars move with the actors/enemies
2. The hp/sp bars go down faster when they take damage (on high hp enemies and actors it takes FORVER to go down)
3. When multiple enemies are killed at once, their health bars all go down at the same time (currently they go down one by one, freakin annoying)

If someone could implement those, that would truly make this a wonderful battle system.


__________________________
Go to the top of the page
 
+Quote Post
   
sirSLR
post Oct 10 2008, 10:54 AM
Post #6


Level 4
Group Icon

Group: Member
Posts: 57
Type: None
RM Skill: Undisclosed




a

This post has been edited by sirSLR: Oct 10 2008, 11:18 AM


__________________________
Working on a Bleach Game
My Sprites

IM GONNA BEAT UP YOU ALL
Go to the top of the page
 
+Quote Post
   
Starscream
post Oct 13 2008, 09:33 PM
Post #7


Princess of Darkness <3
Group Icon

Group: +Gold Member
Posts: 4,745
Type: Artist
RM Skill: Undisclosed




QUOTE (sirSLR @ Oct 10 2008, 11:54 AM) *
a


May I ask why you're spamming?


__________________________



Go to the top of the page
 
+Quote Post
   
Apocrifis
post Oct 19 2008, 02:35 AM
Post #8


Level 1
Group Icon

Group: Member
Posts: 5
Type: Developer
RM Skill: Undisclosed




I used this battle system.
i don't know where I found it, and who make it, but i post it for you.

[Show/Hide] Side view battle script walking graphic version
#--------------------------------------------------------------------------
# ツ≫┐Sideview battle simple English version
#
# © copyright by http://rye.jp/ Date 2007/01/12 Ver alpha
#--------------------------------------------------------------------------
# Side view battle script walking graphic version Special Thanks by blz
#--------------------------------------------------------------------------

#--------------------------------------------------------------------------
# Standard of graphic file
#--------------------------------------------------------------------------
# battler graphics
#
# ツ Walking graphic is used as it is.
# ツ 
# weapon graphics
#
# ツ The icon graphic of arms is used as it is.
#


module Side_view
#--------------------------------------------------------------------------
# ツナ Using together RTABツ ツ≫┐Automatic recognition
#--------------------------------------------------------------------------
if Scene_Battle.method_defined?("synthe?")
RTAB = true
else
RTAB = false
end
#--------------------------------------------------------------------------
# ツナ Using together RTAB cam ツ≫┐Automatic recognition
#--------------------------------------------------------------------------
def camera_correctness
return false if !RTAB
begin
return $scene.drive
rescue
return false
end
end
#--------------------------------------------------------------------------
# ツナ The maximum number of parties
#--------------------------------------------------------------------------
Party_max = 4
#--------------------------------------------------------------------------
# ツナ Expansion rate of Battler graphic(actor exclusive use)
#--------------------------------------------------------------------------
CHAR_ZOOM = 1.0
#--------------------------------------------------------------------------
# ツナ Arrow cursor position correction
#--------------------------------------------------------------------------
ARROW_OX = 0
ARROW_OY = 64
#--------------------------------------------------------------------------
# ツナ State name treated as flight (Array)
#--------------------------------------------------------------------------
FLY_STATES = ["Flying"]
#--------------------------------------------------------------------------
# ツナ Positional correction of combat screen party
#--------------------------------------------------------------------------
PARTY_X = 480 # X position of party
PARTY_Y = 200 # Y position of party
FORMATION_X = 32 # actor's interval X
FORMATION_Y = 38 # actor's interval Y
#--------------------------------------------------------------------------
# ツナ ニ谷ニ湛ニ耽ニ筑ニ辰ニ炭窶凖ィツ絶
#--------------------------------------------------------------------------
NORMAL = "NORMAL"
WALK_R = "WALK_R"
WALK_L = "WALK_L"
ATTACK = "ATTACK"
ATTACK_R = "ATTACK_R"
ATTACK_L = "ATTACK_L"
MAGIC = "MAGIC"
ITEM = "ITEM"
# ニ但ニ男ニ陳≫堙個静昶凖ィ
ANIME = {
# [id,Loop?,speed,weapon visible,pattern freeze,Weapon Right or Left(using RTAB)]
NORMAL => [1,true , 0,false, true ,"" ], # Standby usually
WALK_R => [2,true , 6,false, false,"" ], # move Right
WALK_L => [1,true , 6,false, false,"" ], # move Left
ATTACK_R => [1,false, 6,true , false,"Right"],# attack by Right hand
ATTACK_L => [1,false, 6,true , false,"Left"], # attack by Left hand
MAGIC => [1,false, 6,false, false,"" ], # spell Magic
ITEM => [1,false, 6,false, false,"" ], # using Item
}

# default (Do not change it)
ANIME.default = [1,false,12,false,"",""]

# ニ但ニ誰ニ歎ニ停。ニ停慊静昶凖ィ窶堙固テ麺廣窶「t窶堋ッ
ACTION_LIB = {
"Hero Move" => "moving_setup",
"Hero Graphic Change" => "change",
"Throw Animation" => "flying",
"main phase step 3" => "animation1",
"main phase step 4" => "animation2",
"Waiting" => "wait",
"Graphic Reverse" => "reverse",
"Afterimage ON" => "shadow_on",
"Afterimage OFF" => "shadow_off",
"Freeze ON" => "freeze",
"Freeze OFF" => "freeze_lifting",
"Display Animation" => "animation_start",
"Play Sound Effect" => "play_se",
}
ACTION_LIB.default = "finish"

# (Do not change it)
DUAL_WEAPONS_ANIME = [ATTACK]



# Arms display X coordinates
BLZ_X = {
0=>[0,0,0,0], # NO MOTION
1=>[2,2,2,2], # Shake lowering
2=>[15,10,0,0], # Piercing
3=>[2,2,2,2], # Raising
4=>[0,0,3,3], # Bow and gun
5=>[0,0,0,0], # For addition
6=>[0,0,0,0], # For addition
7=>[0,0,0,0], # For addition
8=>[0,0,0,0], # For addition
}
# Arms display Y coordinates
BLZ_Y = {
0=>[0,0,0,0], # NO MOTION
1=>[6,6,6,6], # Shake lowering
2=>[6,6,6,6], # Piercing
3=>[6,6,6,6], # Raising
4=>[8,8,8,8], # Bow and gun
5=>[0,0,0,0], # For addition
6=>[0,0,0,0], # For addition
7=>[0,0,0,0], # For addition
8=>[0,0,0,0], # For addition
}
# Arms display Angle
BLZ_ANGLE = {
0=>[0,0,0,0], # NO MOTION
1=>[75-45*3,75-45*2,75-45*1,75-45*1], # Shake lowering
2=>[45,45,45,45], # Piercing
3=>[100-45*1,100-45*2,100-45*3,00-45*4], # Raising
4=>[45,45,45,45], # Bow and gun
5=>[0,0,0,0], # For addition
6=>[0,0,0,0], # For addition
7=>[0,0,0,0], # For addition
8=>[0,0,0,0], # For addition
}

#--------------------------------------------------------------------------
# ツナ SHAKE
#--------------------------------------------------------------------------
SHAKE_FILE = "SHAKE" # filename
SHAKE_POWER = 5 # POWER
SHAKE_SPEED = 5 # SPEED
SHAKE_DURATION = 5 # DURATION
#--------------------------------------------------------------------------
# ツナ UPSIDE_DOWN
#--------------------------------------------------------------------------
UPSIDE_DOWN_FILE = "UPSIDE_DOWN" # filename
#--------------------------------------------------------------------------
# ツナ REVERSE
#--------------------------------------------------------------------------
REVERSE_FILE = "REVERSE" # filename
#--------------------------------------------------------------------------
# ツナ 窶ーテア窶彎窶堙個静昶凖ィ
#--------------------------------------------------------------------------
TURNING_FILE = "ROTATION" # filename
TURNING_DIRECTION = 1 # Directionツ(1.Anti-clockwise, -1.clockwise)
TURNING_SPEED = 40 # Speed
TURNING_DURATION = 1 # Rotation frequency
#--------------------------------------------------------------------------
# ツナ ヒテ壺慊ョ窶堙個静昶凖ィ
#--------------------------------------------------------------------------
MOVE_FILE = "MOVE" # filename
MOVE_RETURN = 1 # Do you return to former position?
MOVE_SPEED = 32 # Speed
MOVE_COORDINATES = [0,-640] # Relative coordinates from former position
#--------------------------------------------------------------------------
# ツナ Add Animation (using RTAB)
#--------------------------------------------------------------------------
ADD_ANIME_FILE = "Add_ANIME" # filename
ADD_ANIME_ID = 0 # Animation ID
#--------------------------------------------------------------------------
# ツナ using RTAB (Do not change it)
#--------------------------------------------------------------------------
def convert_battler
return RTAB ? @active_actor : @active_battler
end
#--------------------------------------------------------------------------
# ツナ using RTAB (Do not change it)
#--------------------------------------------------------------------------
def convert_battler2(*arg)
return RTAB ? arg[0] : @active_battler
end
end

#--------------------------------------------------------------------------
# ツナ action performer
#--------------------------------------------------------------------------
module BattleActions

# Because the one below is one example to the last
# Please make it originally.

Actions = {

"Normal Attack" => [

"main phase step 3",
"Hero Graphic Change#WALK_L",
"Hero Move#target,32,0,64,0",
"Hero Graphic Change#NORMAL",
"Waiting#5",
"Hero Graphic Change#ATTACK",
"Throw Animation",
"main phase step 4",
"Hero Graphic Change#WALK_L",
"Play Sound Effect#016-Jump02,80,100",
"Hero Move#self,0,0,18,4",
"end"
],


"One step advancement Attack" => [

"main phase step 3",
"Hero Graphic Change#WALK_L",
"Hero Move#self,-32,0,12,0",
"Hero Graphic Change#NORMAL",
"Waiting#5",
"Hero Graphic Change#ATTACK",
"Throw Animation",
"main phase step 4",
"Hero Graphic Change#WALK_L",
"Play Sound Effect#016-Jump02,80,100",
"Hero Move#self,0,0,12,0",
"end"
],

"Enemy Attack" => [

"main phase step 3",
"Hero Graphic Change#WALK_L",
"Hero Move#self,-36,0,12,0",
"Hero Graphic Change#NORMAL",
"Waiting#5",
"Hero Graphic Change#ATTACK",
"Throw Animation",
"main phase step 4",
"Hero Graphic Change#WALK_L",
"Hero Move#self,0,0,12,0",
"end"
],


"Spell Magic" => [

"main phase step 3",
"Hero Graphic Change#WALK_L",
"Hero Move#self,-32,0,4,0",
"Hero Graphic Change#MAGIC",
"Waiting#15",
"Throw Animation",
"main phase step 4",
"Hero Graphic Change#WALK_L",
"Hero Move#self,0,0,4,2",
"end"
],

"Using Item" => [

"Hero Graphic Change#WALK_L",
"Hero Move#self,-32,0,4,0",
"main phase step 3",
"Hero Graphic Change#ITEM",
"Waiting#15",
"Throw Animation",
"main phase step 4",
"Hero Graphic Change#WALK_L",
"Hero Move#self,0,0,4,2",
"end"
],

"Using Skill" => [

"Hero Graphic Change#WALK_L",
"Hero Move#target_near,50,0,48,6",
"Graphic Reverse",
"Freeze ON#ATTACK#3",
"main phase step 3",
"Play Sound Effect#135-Light01,100,100",
"Display Animation#self,42",
"Waiting#15",
"Graphic Reverse",
"Afterimage ON",
"Hero Move#target_far,-50,0,48,0",
"main phase step 4",
"Afterimage OFF",
"Freeze OFF",
"Hero Graphic Change#WALK_L",
"Hero Move#self,0,0,48,1,0",
"end"
],
}

end

module RPG

# Because the one below is one example to the last
# Please make it originally.

class Weapon
#--------------------------------------------------------------------------
# Weapon sctions. Set what weapons are a stand still weapon.
#--------------------------------------------------------------------------
def battle_actions
case @id
when 21 # Bronze Gun
return BattleActions::Actions["One step advancement Attack"]
end
return BattleActions::Actions["Normal Attack"] # default
end
end
class Skill
#--------------------------------------------------------------------------
# ツナ action performer
#--------------------------------------------------------------------------
def battle_actions
if self.magic?
return BattleActions::Actions["Spell Magic"] # default
else
return BattleActions::Actions["Using Skill"] # default
end
end
end
class Item
#--------------------------------------------------------------------------
# ツナ action performer
#--------------------------------------------------------------------------
def battle_actions
return BattleActions::Actions["Using Item"] # default
end
end
end
class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# ツナ action performer
#--------------------------------------------------------------------------
def battle_actions
return BattleActions::Actions["Enemy Attack"] # default
end
end
module RPG
=begin

ツナ Setting of arms type

The attribute of the name "WeaponType" is made, and it is applied to arms.
The figure is written behind "WeaponType".
ツ ツ 
Example.ツ WeaponType1ツ 

=end
class Weapon
#--------------------------------------------------------------------------
# ツナ WeaponType
#--------------------------------------------------------------------------
def anime
# Elemental
element_name = "WeaponType"
for i in @element_set
if $data_system.elements[i] =~ /#{element_name}([+-]?[0-9]+)?(%)?/
return $1.to_i
end
end
# Weapon ID

# Because the one below is one example to the last
# Please make it originally.

case @id
when 1,2,3,4
return 1 # (WeaponType) Refer from the 115th line to the 150th line.
when 5,6,7,8
return 2 # (WeaponType) Refer from the 115th line to the 150th line.
end
return 1 # defaut
end
end
end
=begin
#--------------------------------------------------------------------------
# ツナ Throw Animation
#--------------------------------------------------------------------------

ツ  Animation is thrown out from performar to target.
Please make animation from the data base.

[ Animation ID, Speed, Do you shuttle?, Straight line (false) or curve(true)]
=end
module RPG
class Weapon
#--------------------------------------------------------------------------
# ツナ Throw Animation
#--------------------------------------------------------------------------
def flying_anime
# Example
#case @id
#when 34 # Boomerang
# return [10,32,true,true]
#when 17,18,19,20 # Arrow
# return [40,32,false,false]
#end
return [0,0,false,false] # No throw
end
end
class Skill
#--------------------------------------------------------------------------
# ツナ Throw Animation
#--------------------------------------------------------------------------
def flying_anime
# Example
#case @id
#when 34 # Boomerang
# return [10,32,true,true]
#when 17,18,19,20 # Arrow
# return [40,32,false,false]
#end
return [0,0,false,false] # No throw
end
end
class Item
#--------------------------------------------------------------------------
# ツナ Throw Animation
#--------------------------------------------------------------------------
def flying_anime
# Example
#case @id
#when 34 # Boomerang
# return [10,32,true,true]
#when 17,18,19,20 # Arrow
# return [40,32,false,false]
#end
return [0,0,false,false] # No throw
end
end
end

class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# ツナ Throw Animation
#--------------------------------------------------------------------------
def flying_anime
# Example
#case @id
#when 34 # Boomerang
# return [10,32,true,true]
#when 17,18,19,20 # Arrow
# return [40,32,false,false]
#end
return [0,0,false,false] # No throw
end
end
#==============================================================================
# ツツ。 Game_Battler
#==============================================================================
class Game_Battler
include Side_view
#--------------------------------------------------------------------------
# ツナ 窶凖窶ーテツ・ナ津カナJニ辰ニ停愴湛ニ耽ニ停愴湛窶「テ渉絶
#--------------------------------------------------------------------------
attr_accessor :height # 窶ーテヲ窶佛凪堙個坂壺堋ウ
attr_accessor :real_x # Xツ催窶「W窶「テ「ツ青ウ
attr_accessor :real_y # Yツ催窶「W窶「テ「ツ青ウ
attr_accessor :real_zoom # ナg窶佚・窶板ヲ
attr_accessor :wait_count # ニ但ニ男ニ陳ツーニ歎ニ停。ニ停 窶佚停堋ソナスナセナテ
attr_accessor :wait_count2 # ニ但ニ男ニ陳ツーニ歎ニ停。ニ停 窶佚停堋ソナスナセナテ2
attr_accessor :pattern # ニ但ニ男ニ陳ツーニ歎ニ停。ニ停 ニ谷ニ脱ニ停愴暖ツ(ニ鱈ニ槌槌停ー)
attr_accessor :shake # ニ歎ニ巽ニ辰ニ誰ナJナスnニ稚ニ停ーニ鍛ニ丹
attr_accessor :reverse # ツ債カ窶ーE窶敖ス窶彎ニ稚ニ停ーニ鍛ニ丹
attr_accessor :shadow # ナスc窶佛独稚ニ停ーニ鍛ニ丹
attr_accessor :flash_flag # 窶弄窶堋ォニ稚ニ停ーニ鍛ニ丹
attr_reader ohmy.gifx # Xツ催窶「W窶「テ「ツ青ウ
attr_reader ohmy.gify # Yツ催窶「W窶「テ「ツ青ウ
attr_reader :flying_x # 窶ー窶懌ケ窶披板」ニ但ニ男ニ陳々ツ催窶「W
attr_reader :flying_y # 窶ー窶懌ケ窶披板」ニ但ニ男ニ陳〆ツ催窶「W
attr_reader :flying_anime # 窶ー窶懌ケ窶披板」ニ但ニ男ニ陳
attr_reader :animation1_on # ツ行窶慊ョニ但ニ男ニ陳ナJナスnニ稚ニ停ーニ鍛ニ丹
attr_reader :animation2_on # 窶佚篠湘嵌但ニ男ニ陳ナJナスnニ稚ニ停ーニ鍛ニ丹
#--------------------------------------------------------------------------
# ツナ ニ断ニ稚ニ辿ニ停ケニ暖窶堙姑但ニ男ニ陳ツーニ歎ニ停。ニ停懌佚停堋ソナスナセナテ披堙ーナステヲ窶慊セ
#--------------------------------------------------------------------------
def animation_duration=(animation_duration)
@_animation_duration = animation_duration
end
#--------------------------------------------------------------------------
# ツナ ニ弛ニ暖ニ停ケナJナスnナスナセ窶堙姑短ニ鍛ニ暖ニ但ニ鍛ニ致
#--------------------------------------------------------------------------
def start_battle
@height = 0
@real_x = 0
@real_y = 0
@real_zoom = 1.0
@battler_condition = ""
@action = nil
@battle_actions = []
@battler_action = false
@step = 0
@anime_on = false
@wait_count = 0
@wait_count2 = 0
@ox = 0
@oy = 0
@pattern = 0
@pattern_log = true
@pattern_freeze = false
@condition_freeze = false
@active = false
@move_distance = nil
@move_wait = 0
@move_coordinates = [0,0,0,0]
@flying_distance = nil
@flying_wait = 0
@flying_x = 0
@flying_y = 0
@flash_flag = {}
self.flying_clear
end
#--------------------------------------------------------------------------
# ツナ ヒテ壺慊ョ窶吮窶敖サ窶凖ィ
#--------------------------------------------------------------------------
def moving?
# Xツ催窶「W窶「テ「ツ青ウ窶堙懌堋ス窶堙債、Yツ催窶「W窶「テ「ツ青ウ窶堋ェ0窶堙窶堙遺堋ッ窶堙ェ
窶堙篠、ヒテ壺慊ョ窶吮
return (@ox != 0 or @oy != 0)
end
#--------------------------------------------------------------------------
# ツナ ヒテ壺慊ョツ終窶板ケ窶敖サ窶凖ィ
#--------------------------------------------------------------------------
def move_end?
return (@ox == @move_coordinates[0] and @oy == @move_coordinates[1])
end
#--------------------------------------------------------------------------
# ツナ ニ但ニ誰ニ歎ニ停。ニ停愬Jナスnツ静昶凖ィ
#--------------------------------------------------------------------------
def action(flag = true)
@battler_action = flag
@animation1_on = false
@animation2_on = false
@step = "setup"
end
#--------------------------------------------------------------------------
# ツナ ニ但ニ誰ニ歎ニ停。ニ停懌吮窶敖サ窶凖ィ
#--------------------------------------------------------------------------
def action?
return @battler_action
end
#--------------------------------------------------------------------------
# ツナ 窶弄窶堋ォ窶敖サ窶凖ィ
#--------------------------------------------------------------------------
def flash?
return @flash_flg
end
#--------------------------------------------------------------------------
# ツナ ツ静ュ窶慊ャ窶「s窶\窶敖サ窶凖ィ
#--------------------------------------------------------------------------
def anime_dead?
if $game_temp.in_battle and !RTAB
if [2,3,4,5].include?($scene.phase4_step)
return @last_dead
end
end
return @last_dead = self.dead?
end
#--------------------------------------------------------------------------
# ツナ ニ痴ニ停愴`ツ湘ウ窶佚披敖サ窶凖ィ
#--------------------------------------------------------------------------
def crisis?
if $game_temp.in_battle and !RTAB
if [2,3,4,5].include?($scene.phase4_step)
return @last_crisis
end
end
return @last_crisis = (self.hp <= self.maxhp / 4 or badstate?)
end
#--------------------------------------------------------------------------
# ツナ ニ弛ニ鍛ニ檀ニ湛ニ弾ツーニ暖窶敖サ窶凖ィ
#--------------------------------------------------------------------------
def badstate?
for i in @states
unless $data_states[i].nonresistance
return true
end
end
return false
end
#--------------------------------------------------------------------------
# ツナ 窶敕イツ行
#--------------------------------------------------------------------------
def fly
if @fly != nil
return @fly
end
for id in @states
if FLY_STATES.include?($data_states[id].name)
return 60
end
end
return 0
end
#--------------------------------------------------------------------------
# ツナ 窶ー窶懌ケ窶披板」ニ但ニ男ニ陳≫禿壺「Wツ催窶「W窶堙固致ナスZ
#--------------------------------------------------------------------------
def flying_setup
# 窶愿ア窶忸窶禿壺堙最ステツ行窶堋オ窶堙遺堋「
return if @flying_distance != nil && !camera_correctness
if RTAB
targets = @target
else
targets = $scene.target_battlers
end
# 窶禿壺廬ツ催窶「W窶堙ーナ致ナスZ
@f_target_x = 0
@f_target_y = 0
for t in targets
@f_target_x += t.screen_x
@f_target_y += t.screen_y
end
if targets != []
@f_target_x /= targets.size
@f_target_y /= targets.size
else
@flying_distance = 0
return
end
# 窶ケ窶披板」窶堙固致ナスZ
@flying_distance = (self.screen_x - @f_target_x).abs + (self.screen_y - @f_target_y).abs
@flying_end = false
end
#--------------------------------------------------------------------------
# ツナ 窶ー窶懌ケ窶披板」ニ但ニ男ニ陳
#--------------------------------------------------------------------------
def flying_animation
# 窶禿溪堙ゥ
if @step != "flying" or @flying_distance.nil?
return [false,true]
end
# 窶 窶堙ァ窶堋ゥ窶堋カ窶堙淒致ナスZ
self_x = self.screen_x
self_y = self.screen_y
@flying_distance = @flying_distance == 0 ? 1 : @flying_distance
n1 = @flying_wait / @flying_distance.to_f
if @flying_distance - @flying_wait > @flying_distance / 2
n2 = 1.0 + 10.0 * @flying_wait / @flying_distance.to_f
else
n2 = 1.0 + 10.0 * (@flying_distance - @flying_wait) / @flying_distance.to_f
end
if !@flying_anime[4]
# 窶卍シツ静シヒテ壺慊ョ
x = (self_x + 1.0 * (@f_target_x - self_x) * n1).to_i
y = (self_y + 1.0 * (@f_target_y - self_y) * n1).to_i
else
# 窶ケテ按静シヒテ壺慊ョ
if !@flying_proceed_end
x = (self_x + 1.0 * (@f_target_x - self_x) * n1).to_i
y = (self_y + 1.0 * (@f_target_y - self_y) * n1 - n2**2).to_i
else
x = (self_x + 1.0 * (@f_target_x - self_x) * n1).to_i
y = (self_y + 1.0 * (@f_target_y - self_y) * n1 + n2**2).to_i
end
end
# ツ催窶「W窶佚」窶愿シ
@flying_x = x
@flying_y = y
# ニ脱ニ竪ニ辰ニ暖
if !@flying_proceed_end
# ナJナスn
@flying_proceed_start = @flying_wait == 0
@flying_wait += @flying_anime[1]
@flying_wait = [@flying_wait,@flying_distance].min
@flying_proceed_end = @flying_wait == @flying_distance
else
# ナJナスn
@flying_return_start = @flying_wait == @flying_distance
@flying_wait -= @flying_anime[1]
@flying_wait = [@flying_wait,0].max
@flying_return_end = @flying_wait == 0
end
if @flying_anime[1] == 0
@flying_end = true
elsif !@flying_anime[2]
@flying_end = @flying_proceed_end
else
@flying_end = @flying_return_end
end
# 窶冤窶堙ー窶「テ披堋キツ(ニ但ニ男ニ陳ナJナスn,ニ但ニ男ニ陳ツ終窶板ケ)
return [@flying_proceed_start,@flying_end]
end
#--------------------------------------------------------------------------
# ツナ 窶ー窶懌ケ窶披板」ニ但ニ男ニ陳ツ鞘ーナテコ窶ーツサ
#--------------------------------------------------------------------------
def flying_clear
@flying_proceed_start = false
@flying_proceed_end = false
@flying_return_start = false
@flying_return_end = false
@flying_end = true
@flying_anime = [0,0,false,false]
end
#--------------------------------------------------------------------------
# ツナ ヒテ壺慊ョ
#--------------------------------------------------------------------------
def move
# 窶ケ窶披板」窶堙固致ナスZ
@move_distance = (@move_coordinates[2] - @move_coordinates[0]).abs +
(@move_coordinates[3] - @move_coordinates[1]).abs
if @move_distance > 0
return if @ox == @move_coordinates[0] and @oy == @move_coordinates[1]
array = @move_coordinates
# ニ淡ニ槌槌停愴致窶「テ「ツ青ウ窶冤窶堙固致ナスZ
n = 100.0 * @move_wait / @move_distance
jump = -@move_action[4] * n * (100 - n) / 100.0
@ox = (array[2] + 1.0 * (array[0] - array[2]) * (@move_distance - @move_wait) / @move_distance.to_f).to_i
@oy = (array[3] + 1.0 * (array[1] - array[3]) * (@move_distance - @move_wait) / @move_distance.to_f + jump).to_i
# ニ脱ニ竪ニ辰ニ暖
@move_wait -= @move_action[3]
@move_wait = [@move_wait,0].max
end
end
#--------------------------------------------------------------------------
# ツナ ヒテ壺慊ョニ但ニ誰ニ歎ニ停。ニ停懌堙固ステヲ窶慊セ
#--------------------------------------------------------------------------
def get_move_action
string = @action.split(/#/)[1]
string = string.split(/,/)
@move_action = [string[0],string[1].to_i,string[2].to_i,string[3].to_i,string[4].to_i,string[5]
.to_i]
end
#--------------------------------------------------------------------------
# ツナ ニ但ニ誰ニ歎ニ停。ニ停懌堙固ステヲ窶慊セ
#--------------------------------------------------------------------------
def get_step
if @action.nil?
@step = "finish"
return
end
return ACTION_LIB[@action.split(/#/)[0]]
end
#--------------------------------------------------------------------------
# ツナ ニ稚ニ椎陳ーニ停ぎツ更ツ新 (ナスナク窶堙姑但ニ誰ニ歎ニ停。ニ停懌堙)
#--------------------------------------------------------------------------
def update_next
@action = @battle_actions.shift
@step = get_step
end
#--------------------------------------------------------------------------
# ツナ ニ稚ニ椎陳ーニ停ぎツ更ツ新 (窶慊ョツ催ャナステヲ窶慊セ)
#--------------------------------------------------------------------------
def update_setup
# ニ但ニ誰ニ歎ニ停。ニ停懌堙固ステヲ窶慊セ
self.get_actions
update_next
end
#--------------------------------------------------------------------------
# ツナ ニ稚ニ椎陳ーニ停ぎツ更ツ新 (ヒテ壺慊ョナステヲ窶慊セ)
#--------------------------------------------------------------------------
def update_moving_setup
# ヒテ壺慊ョニ但ニ誰ニ歎ニ停。ニ停懌堙固ステヲ窶慊セ
self.get_move_action
# ヒテ壺慊ョ窶禿壺「W窶堙個静昶凖ィ
self.move_setup
@step = "moving"
end
#--------------------------------------------------------------------------
# ツナ ニ稚ニ椎陳ーニ停ぎツ更ツ新 (ヒテ壺慊ョ)
#--------------------------------------------------------------------------
def update_moving
# ヒテ壺慊ョ
self.move
self.condition = @battler_condition
# ヒテ壺慊ョナツョ窶板ケ窶堋オ窶堋ス窶堙ァナスナク窶堙姑湛ニ弾ニ鍛ニ致窶堙
if move_end?
update_next
end
end
#--------------------------------------------------------------------------
# ツナ ニ稚ニ椎陳ーニ停ぎツ更ツ新 (ニ但ニ男ニ陳ナステツ行)
#--------------------------------------------------------------------------
def update_action
con = @action.split(/#/)[1]
# 窶ーEナスティツ・ツ債カナスティ窶堙ー窶「ツェ窶堋ッ窶堙ゥ
if DUAL_WEAPONS_ANIME.include?(con)
if !@first_weapon and @second_weapon
con = con + "_L"
else
con = con + "_R"
end
end
# ニ但ニ男ニ陳≫「テ渉更
self.condition = con
# ニ停ケツーニ致窶堋ゥ窶敕帚堋ゥ
if !ANIME[@battler_condition][1]
self.anime_on
end
update_next
end
#--------------------------------------------------------------------------
# ツナ ニ稚ニ椎陳ーニ停ぎツ更ツ新 (窶ー窶懌ケ窶披板」ニ但ニ男ニ陳)
#--------------------------------------------------------------------------
def update_flying
# 窶禿壺「W窶堙個静昶凖ィ
self.flying_setup
# 窶ー窶懌ケ窶披板」ニ但ニ男ニ陳ツ終窶板ケ
if @flying_end or @flying_anime == [0,0,false,false]
self.flying_clear
update_next
end
end
#--------------------------------------------------------------------------
# ツナ ニ稚ニ椎陳ーニ停ぎツ更ツ新 (ニ但ニ男ニ陳≫「テ渉更)
#--------------------------------------------------------------------------
def update_change
con = @action.split(/#/)[1]
# 窶ーEナスティツ・ツ債カナスティ窶堙ー窶「ツェ窶堋ッ窶堙ゥ
if DUAL_WEAPONS_ANIME.include?(con)
if !@first_weapon and @second_weapon
con = con + "_L"
else
con = con + "_R"
end
end
# ニ但ニ男ニ陳≫「テ渉更
self.condition = con
# ニ停ケツーニ致窶堋ゥ窶敕帚堋ゥ
if !ANIME[@battler_condition][1]
self.anime_on
end
update_next
end
#--------------------------------------------------------------------------
# ツナ ニ稚ニ椎陳ーニ停ぎツ更ツ新 (ツ行窶慊ョニ但ニ男ニ陳)
#--------------------------------------------------------------------------
def update_animation1
@animation1_on = true
# ツ行窶慊ョニ但ニ男ニ陳≫堙固津」窶堙可行窶慊ョ窶堙ーナJナスn窶堋キ窶堙ゥ
if $scene.phase4_step == 3
id = RTAB ? @anime1 : $scene.animation1_id
animation = $data_animations[id]
frame_max = animation != nil ? animation.frame_max : 0
@wait_count2 = frame_max * 2
return
end
update_next
end
#--------------------------------------------------------------------------
# ツナ ニ稚ニ椎陳ーニ停ぎツ更ツ新 (窶佚篠湘嵌但ニ男ニ陳)
#--------------------------------------------------------------------------
def update_animation2
@animation2_on = true
# ツ行窶慊ョニ但ニ男ニ陳≫堙固津」窶堙可行窶慊ョ窶堙ーナJナスn窶堋キ窶堙ゥ
if $scene.phase4_step == 4
id = RTAB ? @anime2 : $scene.animation2_id
animation = $data_animations[id]
frame_max = animation != nil ? animation.frame_max : 0
@wait_count2 = frame_max * 2
return
end
update_next
end
#--------------------------------------------------------------------------
# ツナ ニ稚ニ椎陳ーニ停ぎツ更ツ新 (ニ脱ニ竪ニ辰ニ暖)
#--------------------------------------------------------------------------
def update_wait
@wait_count2 = @action.split(/#/)[1].to_i
update_next
end
#--------------------------------------------------------------------------
# ツナ ニ稚ニ椎陳ーニ停ぎツ更ツ新 (ナスc窶佛凪「\ナスツヲ)
#--------------------------------------------------------------------------
def update_shadow_on
@shadow = true
update_next
end
#--------------------------------------------------------------------------
# ツナ ニ稚ニ椎陳ーニ停ぎツ更ツ新 (ナスc窶佛督湘≫ケナス)
#--------------------------------------------------------------------------
def update_shadow_off
@shadow = false
update_next
end
#--------------------------------------------------------------------------
# ツナ ニ稚ニ椎陳ーニ停ぎツ更ツ新 (ツ債カ窶ーE窶敖ス窶彎)
#--------------------------------------------------------------------------
def update_reverse
@reverse = @reverse ? false : true
update_next
end
#--------------------------------------------------------------------------
# ツナ ニ稚ニ椎陳ーニ停ぎツ更ツ新 (窶弄窶堋ォニ但ニ男ニ陳)
#--------------------------------------------------------------------------
def update_flash
# 窶弄窶堋ォニ但ニ男ニ陳≫堙固津」窶堙可行窶慊ョ窶堙ーナJナスn窶堋キ窶堙ゥ
if @flash_flag["normal"]
@wait_count = $scene.flash_duration
@flash_flag["normal"] = false
return
end
update_next
end
#--------------------------------------------------------------------------
# ツナ ニ稚ニ椎陳ーニ停ぎツ更ツ新 (SE窶堙娯ー窶ー窶t)
#--------------------------------------------------------------------------
def update_play_se
data = @action.split(/#/)[1]
data = data.split(/,/)
# SE 窶堙ー窶ー窶ー窶t
Audio.se_play("Audio/SE/" + data[0], data[1].to_i, data[2].to_i)
update_next
end
#--------------------------------------------------------------------------
# ツナ ニ稚ニ椎陳ーニ停ぎツ更ツ新 (ニ但ニ誰ニ耽ツーニ但ニ男ニ陳ナ津窶凖ィ)
#--------------------------------------------------------------------------
def update_freeze
con = @action.split(/#/)[1]
# 窶ーEナスティツ・ツ債カナスティ窶堙ー窶「ツェ窶堋ッ窶堙ゥ
if DUAL_WEAPONS_ANIME.include?(con)
if !@first_weapon and @second_weapon
con = con + "_L"
else
con = con + "_R"
end
end
# ニ但ニ男ニ陳≫「テ渉更
self.condition = con
@pattern = @action.split(/#/)[2].to_i
@pattern_freeze = true
@condition_freeze = true
update_next
end
#--------------------------------------------------------------------------
# ツナ ニ稚ニ椎陳ーニ停ぎツ更ツ新 (ニ但ニ誰ニ耽ツーニ但ニ男ニ陳ナ津窶凖ィ窶ーテーツ焦)
#--------------------------------------------------------------------------
def update_freeze_lifting
@pattern_freeze = false
@condition_freeze = false
update_next
end
#--------------------------------------------------------------------------
# ツナ ニ稚ニ椎陳ーニ停ぎツ更ツ新 (ニ但ニ男ニ陳ツーニ歎ニ停。ニ停懌堙娯「\ナスツヲ)
#--------------------------------------------------------------------------
def update_animation_start
data = @action.split(/#/)[1]
data = data.split(/,/)
target = data[0]
animation_id = data[1].to_i
if RTAB
case target
when "self"
@animation.push([animation_id,true])
when "target"
for tar in @target
tar.animation.push([animation_id, true])
end
end
else
case target
when "self"
@animation_id = animation_id
@animation_hit = true
when "target"
for tar in $scene.target_battlers
tar.animation_id = animation_id
tar.animation_hit = true
end
end
end
update_next
end
#--------------------------------------------------------------------------
# ツナ ニ稚ニ椎陳ーニ停ぎツ更ツ新 (窶慊ョツ催ャツ終窶板ケ)
#--------------------------------------------------------------------------
def update_finish
# 窶慊ョツ催ャツ終窶板ケ
@battler_action = false
@step = "setup"
end
#--------------------------------------------------------------------------
# ツナ ニ弛ニ暖ニ停ーツー窶堙個湘ウ窶佚板(ニ弛ニ暖ニ停ーツーニ丹ニ停ーニ稚ニ達ニ鍛ニ誰窶堙姑耽ニ辰ニ致)
#--------------------------------------------------------------------------
def condition
return @battler_condition
end
#--------------------------------------------------------------------------
# ツナ ニ弛ニ暖ニ停ーツー窶堙個湘ウ窶佚 窶「テ渉更ツ(ニ弛ニ暖ニ停ーツーニ丹ニ停ーニ稚ニ達ニ鍛ニ誰窶堙姑耽ニ辰ニ致)
#--------------------------------------------------------------------------
def condition=(condition)
return if @condition_freeze
if @battler_condition != condition
@wait_count = ANIME[condition][2]
@pattern = 0
end
@battler_condition = condition
end
#--------------------------------------------------------------------------
# ツナ ニ稚ニ椎陳ーニ停ぎツ更ツ新
#--------------------------------------------------------------------------
def update
# ニ脱ニ巽ニ辰ニ暖窶吮窶堙個湘ェツ坂。
if @wait_count == 0
# ニ恥ニ耽ツーニ停慊更ツ新
self.char_animation
@wait_count = ANIME[@battler_condition][2]
end
# ニ恥ニ耽ツーニ停慊更ツ新
self.char_animation
# ニ脱ニ巽ニ辰ニ暖窶吮窶堙個湘ェツ坂。
if @wait_count2 > 0
return
end

# ツ行窶慊ョニ但ニ男ニ陳ツーニ歎ニ停。ニ停
if @battler_action
method("update_" + @step).call
return
end

# ニ断ツーニ耽ツ鞘ーナテコ窶ーツサ
@animation1_on = false
@animation2_on = false
@action = nil
@battle_actions = []
@move_wait = 0
@move_distance = nil
@flying_wait = 0
@flying_distance = nil
@flash = false

# 窶凖環湘ュツ・窶佚停ケ@
return self.condition = NORMAL
end
#--------------------------------------------------------------------------
# ツナ ニ但ニ誰ニ歎ニ停。ニ停懌堙固ステヲ窶慊セ
#--------------------------------------------------------------------------
def get_actions
skill = $data_skills[self.current_action.skill_id]
item = $data_items[self.current_action.item_id]
kind = self.current_action.kind
# 窶慊ョツ催ャナステヲ窶慊セ
@battle_actions = []
# ニ湛ニ鱈ニ停ケ
if skill != nil && kind == 1
@battle_actions = skill.battle_actions.dup
@flying_anime = skill.flying_anime
# ニ但ニ辰ニ弾ニ停ぎ
elsif item != nil && kind == 2
@battle_actions = item.battle_actions.dup
@flying_anime = item.flying_anime
# ツ債カナスティツ攻ナ停
elsif !@first_weapon and @second_weapon and self.is_a?(Game_Actor)
@battle_actions = self.battle_actions2.dup
@flying_anime = self.flying_anime2
# 窶ーEナスティツ攻ナ停
elsif self.current_action.basic == 0 and
self.is_a?(Game_Actor) and self.current_action.kind == 0
@battle_actions = self.battle_actions1.dup
@flying_anime = self.flying_anime1
# 窶凖環湘ュツ攻ナ停
elsif self.current_action.basic == 0 and self.current_action.kind == 0
@battle_actions = self.battle_actions.dup
@flying_anime = self.flying_anime
else
@battle_actions = ["ツ終窶板ケ"]
@flying_anime = [0,0,false,false]
end
end
#--------------------------------------------------------------------------
# ツナ ニ停ケツーニ致窶堋オ窶堙遺堋「ニ但ニ男ニ陳≫堙姑短ニ鍛ニ暖
#--------------------------------------------------------------------------
def anime_on
@pattern = 0
@pattern_log = true
return
end
#--------------------------------------------------------------------------
# ツナ ニ恥ニ耽ツーニ停慊更ツ新
#--------------------------------------------------------------------------
def char_animation
# ニ恥ニ耽ニ停愬津窶凖ィ窶堙個湘ェツ坂。窶堙窶堙窶堙ゥ
return if @pattern_freeze
# ニ停ケツーニ致窶堋オ窶堙遺堋「ニ但ニ男ニ陳≫堙個湘ェツ坂。 1234 窶堙ナス~窶堙懌堙ゥ
if !ANIME[@battler_condition][1] && @pattern == 3
return
end
# ニ但ニ男ニ陳≫堋ウ窶堋ケ窶堙遺堋「ツ湘ェツ坂。 1 窶堙ナス~窶堙懌堙ゥ
if ANIME[@battler_condition][4]
@pattern = 0
return
end
@pattern = (@pattern + 1) % 4
end
#--------------------------------------------------------------------------
# ツナ ニ但ニ男ニ陳ニ耽ニ辰ニ致
#--------------------------------------------------------------------------
def anime_type
return ANIME[@battler_condition] != nil ? ANIME[@battler_condition][0] : 0
end
end
#==============================================================================
# ツツ。 Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
include Side_view
#--------------------------------------------------------------------------
# ツナ ニ短ニ鍛ニ暖ニ但ニ鍛ニ致
#--------------------------------------------------------------------------
alias side_view_setup setup
def setup(actor_id)
side_view_setup(actor_id)
start_battle
end
#--------------------------------------------------------------------------
# ツナ 窶愿ア窶慊≫「ツ税テュ窶堙栗Dナステヲ窶慊セツ ツツヲニ竪ニ停ーツー窶ーテア窶敕ー窶廃
#--------------------------------------------------------------------------
def weapon2_id
return @weapon2_id != nil ? @weapon2_id : 0
end
#--------------------------------------------------------------------------
# ツナ X窶「テサナ津シ ニ竹ニ淡ニ歎ニ停。ニ停 ナステヲ窶慊セ
#--------------------------------------------------------------------------
def position
return $data_classes[@class_id].position
end
#--------------------------------------------------------------------------
# ツナ Y窶「テサナ津シ ニ竹ニ淡ニ歎ニ停。ニ停 ナステヲ窶慊セ
#--------------------------------------------------------------------------
def position2
return self.index
end
#--------------------------------------------------------------------------
# ツナ 窶「ツ税テュニ但ニ男ニ陳ニ耽ニ辰ニ致
#--------------------------------------------------------------------------
def weapon_anime_type(type = @battler_condition)
file_name = weapon_anime_type0(type)
visible = weapon_anime_type1(type)
z = weapon_anime_type2(type)
motion = weapon_anime_type3(type)
return [file_name,visible,z,motion]
end
# 窶「ツ税テュニ但ニ辰ニ坦ニ停愬ステヲ窶慊セ
def weapon_anime_type0(type = @battler_condition)
type = ANIME[type][5]
return weapon_anime1 if type == "Right"
return weapon_anime2 if type == "Left"
return nil
end
# 窶「\ナスツヲツ・窶敕ア窶「\ナスツヲ窶堙固ステヲ窶慊セ
def weapon_anime_type1(type = @battler_condition)
return ANIME[type][3]
end
# ニ弛ニ暖ニ停ーツー窶堙ヲ窶堙ィツ湘」窶堙俄「\ナスツヲ窶堋キ窶堙ゥ窶堋ゥ窶堙窶堋、窶堋ゥ
def weapon_anime_type2(type = @battler_condition)
type = ANIME[type][5]
return true if type == "Left"
return false
end
# 窶「ツ税テュ窶堙娯慊ョツ催ャNoツ.ナステヲ窶慊セ
def weapon_anime_type3(type = @battler_condition)
type = ANIME[type][5]
return extend_weapon_anime1 if type == "Right"
return extend_weapon_anime2 if type == "Left"
return 0
end
#--------------------------------------------------------------------------
# ツナ ニ弛ニ暖ニ停ケ窶ーテヲ窶禿 X ツ催窶「W窶堙固ステヲ窶慊セ(ニ谷ニ陳ニ停ー窶「テ「ツ青ウ窶督ウ窶堋オ)
#--------------------------------------------------------------------------
def true_x
return PARTY_X + position * FORMATION_X + @ox
end
#--------------------------------------------------------------------------
# ツナ ニ弛ニ暖ニ停ケ窶ーテヲ窶禿 Y ツ催窶「W窶堙固ステヲ窶慊セ(ニ谷ニ陳ニ停ー窶「テ「ツ青ウ窶督ウ窶堋オ)
#--------------------------------------------------------------------------
def true_y
# ニ恥ツーニ弾ニ達窶愿窶堙娯「テ窶堙堕鞘。窶堋ゥ窶堙ァ Y ツ催窶「W窶堙ーナ致ナスZ窶堋オ窶堙窶「テ披堋キ
if self.index != nil
y = position2 * FORMATION_Y + PARTY_Y + @oy - @height / 2
return y
else
return 0
end
end
#--------------------------------------------------------------------------
# ツナ ニ弛ニ暖ニ停ケ窶ーテヲ窶禿 X ツ催窶「W窶堙固ステヲ窶慊セ
#--------------------------------------------------------------------------
def screen_x(true_x = self.true_x)
return 320 + (true_x - 320) * @real_zoom + @real_x
end
#--------------------------------------------------------------------------
# ツナ ニ弛ニ暖ニ停ケ窶ーテヲ窶禿 Y ツ催窶「W窶堙固ステヲ窶慊セ
#--------------------------------------------------------------------------
def screen_y(true_y = self.true_y)
return true_y * @real_zoom + @real_y
end
#--------------------------------------------------------------------------
# ツナ ニ弛ニ暖ニ停ケ窶ーテヲ窶禿 Z ツ催窶「W窶堙固ステヲ窶慊セ
#--------------------------------------------------------------------------
def screen_z
return screen_y + 1000
end
#--------------------------------------------------------------------------
# ツナ ニ弛ニ暖ニ停ケ窶ーテヲ窶禿 X ツ催窶「W窶堙固ステヲ窶慊セ(ヒテ壺慊ョ窶堙遺堙窶堋オ窶堙窶堋「窶堙遺堋「ツ湘ェツ坂。)
#--------------------------------------------------------------------------
def base_x
return 320 + (true_x - @ox - 320) * @real_zoom + @real_x
end
#--------------------------------------------------------------------------
# ツナ ニ弛ニ暖ニ停ケ窶ーテヲ窶禿 Y ツ催窶「W窶堙固ステヲ窶慊セ
#--------------------------------------------------------------------------
def base_y
return (true_y - @oy) * @real_zoom + @real_y
end
#--------------------------------------------------------------------------
# ツナ ニ弛ニ暖ニ停ケ窶ーテヲ窶禿 ナg窶佚・窶板ヲ窶堙固ステヲ窶慊セ
#--------------------------------------------------------------------------
def zoom
return ($scene.zoom_rate[1] - $scene.zoom_rate[0]) *
(true_x + @fly) / 480 + $scene.zoom_rate[0]
end
#--------------------------------------------------------------------------
# ツナ ツ攻ナ停壺廃ツ、ニ弛ニ暖ニ停ケ窶ーテヲ窶禿 X ツ催窶「W窶堙固ステヲ窶慊セ
#--------------------------------------------------------------------------
def attack_x(z)
return (320 - true_x) * z * 0.75
end
#--------------------------------------------------------------------------
# ツナ ツ攻ナ停壺廃ツ、ニ弛ニ暖ニ停ケ窶ーテヲ窶禿 Y ツ催窶「W窶堙固ステヲ窶慊セ
#--------------------------------------------------------------------------
def attack_y(z)
return (160 - (true_y + fly / 4) * z + @height * zoom * z / 2) * 0.75
end
#--------------------------------------------------------------------------
# ツナ 窶弄窶堋ォ窶佚停堋ソナスナセナテ
#--------------------------------------------------------------------------
def flash_duration
return $scene.flash_duration
end
#--------------------------------------------------------------------------
# ツナ ニ但ニ男ニ陳ツーニ歎ニ停。ニ停愬ステヲ窶慊セ
#--------------------------------------------------------------------------
def battle_actions1
weapon = $data_weapons[@weapon_id]
return weapon != nil ? weapon.battle_actions : BattleActions::Actions["窶凖環湘ュツ攻ナ停"]
end
#--------------------------------------------------------------------------
# ツナ ニ但ニ男ニ陳ツーニ歎ニ停。ニ停愬ステヲ窶慊セ
#--------------------------------------------------------------------------
def battle_actions2
weapon = $data_weapons[@weapon2_id]
return weapon != nil ? weapon.battle_actions : BattleActions::Actions["窶凖環湘ュツ攻ナ停"]
end
#--------------------------------------------------------------------------
# ツナ 窶「ツ税テュニ但ニ男ニ陳ツーニ歎ニ停。ニ停 窶慊ョ窶堋ォ窶「テサ ナステヲ窶慊セ
#--------------------------------------------------------------------------
def extend_weapon_anime1
weapon = $data_weapons[@weapon_id]
return weapon != nil ? weapon.anime : 0
end
#--------------------------------------------------------------------------
# ツナ 窶「ツ税テュニ但ニ男ニ陳ツーニ歎ニ停。ニ停 窶慊ョ窶堋ォ窶「テサ ナステヲ窶慊セ
#--------------------------------------------------------------------------
def extend_weapon_anime2
weapon = $data_weapons[@weapon2_id]
return weapon != nil ? weapon.anime : 0
end
#--------------------------------------------------------------------------
# ツナ 窶「ツ税テュニ但ニ男ニ陳ツーニ歎ニ停。ニ停愬ステヲ窶慊セ
#--------------------------------------------------------------------------
def weapon_anime1
weapon = $data_weapons[@weapon_id]
return weapon != nil ? weapon.icon_name : ""
end
#--------------------------------------------------------------------------
# ツナ 窶「ツ税テュニ但ニ男ニ陳ツーニ歎ニ停。ニ停愬ステヲ窶慊セ
#--------------------------------------------------------------------------
def weapon_anime2
weapon = $data_weapons[@weapon2_id]
return weapon != nil ? weapon.icon_name : ""
end
#--------------------------------------------------------------------------
# ツナ 窶ー窶懌ケ窶披板」ニ但ニ男ニ陳ツーニ歎ニ停。ニ停愬ステヲ窶慊セ
#--------------------------------------------------------------------------
def flying_anime1
weapon = $data_weapons[@weapon_id]
return weapon != nil ? weapon.flying_anime : [0,0,false,false]
end
#--------------------------------------------------------------------------
# ツナ 窶ー窶懌ケ窶披板」ニ但ニ男ニ陳ツーニ歎ニ停。ニ停愬ステヲ窶慊セ
#--------------------------------------------------------------------------
def flying_anime2
weapon = $data_weapons[@weapon2_id]
return weapon != nil ? weapon.flying_anime : [0,0,false,false]
end
#--------------------------------------------------------------------------
# ツナ ヒテ壺慊ョ窶禿壺「Wツ催窶「W窶堙固致ナスZ
#--------------------------------------------------------------------------
def move_setup
if RTAB
targets = @target
else
targets = $scene.target_battlers
end
case @move_action[0]
when "self" # ナスツゥ窶「ツェ
@target_x = self.base_x
@target_y = self.base_y
when "target_near" # ヒテェ窶敕披ケテ溪堋ュ窶堙姑耽ツーニ嘆ニ鍛ニ暖
targets.sort!{|a,b| a.screen_x<=>b.screen_x }
targets.reverse!
if targets != []
@target_x = targets[0].screen_x
@target_y = targets[0].screen_y
else
@target_x = self.base_x
@target_y = self.base_y
end
when "target_far" # ヒテェ窶敕披ー窶懌堋ュ窶堙姑耽ツーニ嘆ニ鍛ニ暖
targets.sort!{|a,b| a.screen_x<=>b.screen_x }
if targets != []
@target_x = targets[0].screen_x
@target_y = targets[0].screen_y
else
@target_x = self.base_x
@target_y = self.base_y
end
when "target" # ニ耽ツーニ嘆ニ鍛ニ暖窶吮窶ー窶コ
@target_x = 0
@target_y = 0
for t in targets
@target_x += t.screen_x
@target_y += t.screen_y
end
if targets != []
@target_x /= targets.size
@target_y /= targets.size
end
when "troop" # "ニ暖ニ停ケツーニ致窶吮窶ー窶コ"
@target_x = 0
@target_y = 0
for t in $game_troop.enemies
@target_x += t.screen_x
@target_y += t.screen_y
end
if $game_troop.enemies != []
@target_x /= $game_troop.enemies.size
@target_y /= $game_troop.enemies.size
end
when "party" # "ニ恥ツーニ弾ニ達窶吮窶ー窶コ"
@target_x = 0
@target_y = 0
for t in $game_party.actors
@target_x += t.screen_x
@target_y += t.screen_y
end
if $game_party.actors != []
@target_x /= $game_party.actors.size
@target_y /= $game_party.actors.size
end
when "screen" # "窶ーテヲ窶禿"
@target_x = self.base_x
@target_y = self.base_y
end
# 窶「テ「ツ青ウ
@target_x += @move_action[1] - self.base_x
@target_y += @move_action[2] - self.base_y
# ヒテ壺慊ョ窶禿壺「W窶堙個催窶「W窶堙ーニ短ニ鍛ニ暖
@move_coordinates = [@target_x.to_i,@target_y.to_i,@move_coordinates[0],@move_coordinates[1]]
# 窶ケ窶披板」窶堙固致ナスZ(ニ脱ニ竪ニ辰ニ暖窶堙個静昶凖ィ)
@move_wait = (@move_coordinates[2] - @move_coordinates[0]).abs +
(@move_coordinates[3] - @move_coordinates[1]).abs
end
end
#==============================================================================
# ツツ。 Game_Enemy
#==============================================================================
class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# ツナ ニ短ニ鍛ニ暖ニ但ニ鍛ニ致
#--------------------------------------------------------------------------
alias side_view_initialize initialize
def initialize(troop_id, member_index)
side_view_initialize(troop_id, member_index)
start_battle
end
def character_name
return battler_name
end
def character_hue
return battler_hue
end
def reverse
return !@reverse
end
#--------------------------------------------------------------------------
# ツナ ヒテ壺慊ョ
#--------------------------------------------------------------------------
def move
# 窶ケ窶披板」窶堙固致ナスZ
@move_distance = (@move_coordinates[2] - @move_coordinates[0]).abs +
(@move_coordinates[3] - @move_coordinates[1]).abs
if @move_distance > 0
return if @ox == @move_coordinates[0] and @oy == @move_coordinates[1]
array = @move_coordinates
# ニ淡ニ槌槌停愴致窶「テ「ツ青ウ窶冤窶堙固致ナスZ
n = 100.0 * @move_wait / @move_distance
jump = -@move_action[4] * n * (100 - n) / 100.0
@ox = (array[2] + 1.0 * (array[0] - array[2]) * (@move_distance - @move_wait) / @move_distance.to_f).to_i
@oy = (array[3] + 1.0 * (array[1] - array[3]) * (@move_distance - @move_wait) / @move_distance.to_f + jump).to_i
# ニ脱ニ竪ニ辰ニ暖
@move_wait -= @move_action[3]
@move_wait = [@move_wait,0].max
end
end
#--------------------------------------------------------------------------
# ツナ ヒテ壺慊ョ窶禿壺「Wツ催窶「W窶堙固致ナスZ
#--------------------------------------------------------------------------
def move_setup
if RTAB
targets = @target
else
targets = $scene.target_battlers
end
case @move_action[0]
when "self" # ナスツゥ窶「ツェ
@target_x = self.base_x
@target_y = self.base_y
when "target_near" # ヒテェ窶敕披ケテ溪堋ュ窶堙姑耽ツーニ嘆ニ鍛ニ暖
targets.sort!{|a,b| a.screen_x<=>b.screen_x }
if targets != []
@target_x = targets[0].screen_x
@target_y = targets[0].screen_y
else
@target_x = self.base_x
@target_y = self.base_y
end
when "target_far" # ヒテェ窶敕披ー窶懌堋ュ窶堙姑耽ツーニ嘆ニ鍛ニ暖
targets.sort!{|a,b| a.screen_x<=>b.screen_x }
targets.reverse!
if targets != []
@target_x = targets[0].screen_x
@target_y = targets[0].screen_y
else
@target_x = self.base_x
@target_y = self.base_y
end
when "target" # ニ耽ツーニ嘆ニ鍛ニ暖窶吮窶ー窶コ
@target_x = 0
@target_y = 0
for t in targets
@target_x += t.screen_x
@target_y += t.screen_y
end
if targets != []
@target_x /= targets.size
@target_y /= targets.size
end
when "party" # "ニ暖ニ停ケツーニ致窶吮窶ー窶コ"
@target_x = 0
@target_y = 0
for t in $game_troop.enemies
@target_x += t.screen_x
@target_y += t.screen_y
end
if $game_troop.enemies != []
@target_x /= $game_troop.enemies.size
@target_y /= $game_troop.enemies.size
end
when "troop" # "ニ恥ツーニ弾ニ達窶吮窶ー窶コ"
@target_x = 0
@target_y = 0
for t in $game_party.actors
@target_x += t.screen_x
@target_y += t.screen_y
end
if $game_party.actors != []
@target_x /= $game_party.actors.size
@target_y /= $game_party.actors.size
end
when "screen" # "窶ーテヲ窶禿"
@target_x = self.base_x
@target_y = self.base_y
end
# 窶「テ「ツ青ウ
@target_x -= @move_action[1] + self.base_x
@target_y -= @move_action[2] + self.base_y
# ヒテ壺慊ョ窶禿壺「W窶堙個催窶「W窶堙ーニ短ニ鍛ニ暖
@move_coordinates = [@target_x.to_i,@target_y.to_i,@move_coordinates[0],@move_coordinates[1]]
# 窶ケ窶披板」窶堙固致ナスZ(ニ脱ニ竪ニ辰ニ暖窶堙個静昶凖ィ)
@move_wait = (@move_coordinates[2] - @move_coordinates[0]).abs +
(@move_coordinates[3] - @move_coordinates[1]).abs
end
if RTAB
alias original_x true_x
alias original_y true_y
else
alias original_x screen_x
alias original_y screen_y
end
#--------------------------------------------------------------------------
# ツナ ニ弛ニ暖ニ停ケ窶ーテヲ窶禿 X ツ催窶「W窶堙固ステヲ窶慊セ(ニ谷ニ陳ニ停ー窶「テ「ツ青ウ窶督ウ窶堋オ)
#--------------------------------------------------------------------------
def true_x
return original_x + @ox
end
#--------------------------------------------------------------------------
# ツナ ニ弛ニ暖ニ停ケ窶ーテヲ窶禿 Y ツ催窶「W窶堙固ステヲ窶慊セ(ニ谷ニ陳ニ停ー窶「テ「ツ青ウ窶督ウ窶堋オ)
#--------------------------------------------------------------------------
def true_y
return original_y - @height / 2 + @oy
end
#--------------------------------------------------------------------------
# ツナ ニ弛ニ暖ニ停ケ窶ーテヲ窶禿 X ツ催窶「W窶堙固ステヲ窶慊セ
#--------------------------------------------------------------------------
def screen_x(true_x = self.true_x)
return true_x * @real_zoom + @real_x
end
#--------------------------------------------------------------------------
# ツナ ニ弛ニ暖ニ停ケ窶ーテヲ窶禿 Y ツ催窶「W窶堙固ステヲ窶慊セ
#--------------------------------------------------------------------------
def screen_y(true_y = self.true_y)
return true_y * @real_zoom + @real_y
end
#--------------------------------------------------------------------------
# ツナ ニ弛ニ暖ニ停ケ窶ーテヲ窶禿 X ツ催窶「W窶堙固ステヲ窶慊セ(ヒテ壺慊ョ窶堙遺堙窶堋オ窶堙窶堋「窶堙遺堋「ツ湘ェツ坂。)
#--------------------------------------------------------------------------
def base_x(true_x = self.true_x)
return (true_x - @ox) * @real_zoom + @real_x
end
#--------------------------------------------------------------------------
# ツナ ニ弛ニ暖ニ停ケ窶ーテヲ窶禿 Y ツ催窶「W窶堙固ステヲ窶慊セ(ヒテ壺慊ョ窶堙遺堙窶堋オ窶堙窶堋「窶堙遺堋「ツ湘ェツ坂。)
#--------------------------------------------------------------------------
def base_y(true_y = self.true_y)
return (true_y - @oy) * @real_zoom + @real_y
end
end
#==============================================================================
# ツツ。 Game_Party
#==============================================================================
class Game_Party
#--------------------------------------------------------------------------
# ツナ ニ但ニ誰ニ耽ツー窶堙ー窶ーテ≫堋ヲ窶堙ゥ
# actor_id : ニ但ニ誰ニ耽ツー ID
#--------------------------------------------------------------------------
alias side_view_add_actor add_actor
def add_actor(actor_id)
# ニ但ニ誰ニ耽ツー窶堙ーナステヲ窶慊セ
actor = $game_actors[actor_id]
# ニ探ニ辰ニ檀ニ池ニ停ヲツーニ断ツーニ耽窶堙個鞘ーナテコ窶ーツサ
actor.start_battle
# 窶禿溪堋キ
side_view_add_actor(actor_id)
end
end
#==============================================================================
# ツツ。 Scene_Battle
#==============================================================================
class Scene_Battle
include Side_view
#--------------------------------------------------------------------------
# ツナ ナ津カナJニ辰ニ停愴湛ニ耽ニ停愴湛窶「テ渉絶
#--------------------------------------------------------------------------
attr_reader :phase # ニ稚ニ巽ツーニ炭
attr_reader :phase4_step # ニ稚ニ巽ツーニ炭窶售ニ湛ニ弾ニ鍛ニ致
attr_reader :active_battler # 窶佚篠湘帚堙娯掏窶氾ア
attr_reader :target_battlers # 窶佚篠湘帚堙娯掏窶氾ア
attr_reader :animation1_id # ツ行窶慊ョニ但ニ男ニ陳!D
attr_reader :animation2_id # 窶佚篠湘嵌但ニ男ニ陳!D
#--------------------------------------------------------------------------
# ツナ ニ陳ニ辰ニ停慊祥窶板
#--------------------------------------------------------------------------
alias side_view_main main
def main
# ニ弛ニ暖ニ停ーツーツ鞘ーナテコ窶ーツサ
for battler in $game_party.actors + $game_troop.enemies
battler.start_battle
end
# 窶禿溪堋キ
side_view_main
end
#--------------------------------------------------------------------------
# ツナ 窶弄窶堋ォ窶敖サ窶凖ィ
#--------------------------------------------------------------------------
def flash?
return @flash_flag ? true : false
end
#--------------------------------------------------------------------------
# ツナ 窶弄窶堋ォニ但ニ男ニ陳≫佚停堋ソナスナセナテ版ステヲ窶慊セ
#--------------------------------------------------------------------------
def flash_duration
animation = nil
if FLASH_ANIME
animation = $data_animations[FLASH_ANIMATION_ID]
end
return animation != nil ? animation.frame_max * 2 + 2 : 0
end
#--------------------------------------------------------------------------
# ツナ ニ稚ニ椎陳ーニ停ぎツ更ツ新 (ニ陳ニ辰ニ停愴稚ニ巽ツーニ炭 ニ湛ニ弾ニ鍛ニ致 2 : ニ但ニ誰ニ歎ニ停。ニ停愬Jナスn)
#--------------------------------------------------------------------------
alias side_view_update_phase4_step2 update_phase4_step2
def update_phase4_step2(*arg)
battler = convert_battler2(*arg)
battler.action
side_view_update_phase4_step2(*arg)
end
#--------------------------------------------------------------------------
# ツナ ニ稚ニ椎陳ーニ停ぎツ更ツ新 (ニ陳ニ辰ニ停愴稚ニ巽ツーニ炭 ニ湛ニ弾ニ鍛ニ致 3 : ツ行窶慊ョ窶伉、ニ但ニ男ニ陳ツーニ歎ニ停。ニ停)
#--------------------------------------------------------------------------
alias side_view_update_phase4_step3 update_phase4_step3
def update_phase4_step3(*arg)
battler = convert_battler2(*arg)
return if !battler.animation1_on and battler.action? and !battler.flash?
if battler.flash? and FLASH_ANIME
battler.flash_flag["normal"] = true
end
side_view_update_phase4_step3(*arg)
end
#--------------------------------------------------------------------------
# ツナ ニ稚ニ椎陳ーニ停ぎツ更ツ新 (ニ陳ニ辰ニ停愴稚ニ巽ツーニ炭 ニ湛ニ弾ニ鍛ニ致 4 : 窶佚篠湘帚伉、ニ但ニ男ニ陳ツーニ歎ニ停。ニ停)
#--------------------------------------------------------------------------
alias side_view_update_phase4_step4 update_phase4_step4
def update_phase4_step4(*arg)
battler = convert_battler2(*arg)
targets = RTAB ? battler.target : @target_battlers
return if !battler.animation2_on and battler.action?
side_view_update_phase4_step4(*arg)
for target in targets
if RTAB
value = nil
if target.damage_sp.include?(battler)
value = target.damage_sp[battler]
end
if target.damage.include?(battler)
if value == nil or value == "Miss"
value = target.damage[battler]
elsif value.is_a?(Numeric) && value > 0
value = target.damage[battler] == "Miss" ? value : target.damage[battler]
end
end
else
value = target.damage
end
if target.is_a?(Game_Actor)
# ニ胆ニ陳ツーニ淡窶堙個湘ェツ坂。
if value.is_a?(Numeric) && value > 0
# ニ歎ニ巽ニ辰ニ誰窶堙ーナJナスn
target.shake = true
end
elsif target.is_a?(Game_Enemy)
# ニ胆ニ陳ツーニ淡窶堙個湘ェツ坂。
if value.is_a?(Numeric) && value > 0
# ニ歎ニ巽ニ辰ニ誰窶堙ーナJナスn
target.shake = true
end
end
end
end
#--------------------------------------------------------------------------
# ツナ ニ致ニ椎槌弛ニ暖ニ停ケニ稚ニ巽ツーニ炭ナJナスn
#--------------------------------------------------------------------------
alias start_phase1_correct start_phase1
def start_phase1
# ニ谷ニ陳ニ停ー窶堙個静昶凖ィ
# ナ陳ウツ々ニ稚ニ陳哉停愴暖ニ池ニ停ヲツーナ津シ窶堋ッ窶堙個絶昶冤窶堙俄堙遺堙≫堙窶堋
「窶堙ゥ窶堋ス窶堙
@zoom_rate = [1.0, 1.0]
start_phase1_correct
end
#--------------------------------------------------------------------------
# ツナ ニ但ニ誰ニ耽ツーニ坦ニ筑ニ停愴檀ニ稚ニ巽ツーニ炭ナJナスn
#--------------------------------------------------------------------------
alias start_phase3_correct start_phase3
def start_phase3
battler = convert_battler
start_phase3_correct
if RTAB
# ニ谷ニ陳ニ停ー窶堙個静昶凖ィ
# ナ陳ウツ々ニ稚ニ陳哉停愴暖ニ池ニ停ヲツーナ津シ窶堋ッ窶堙個絶昶冤窶堙俄堙遺堙≫堙窶堋
「窶堙ゥ窶堋ス窶堙
@camera = "command"
@spriteset.screen_target(0, 0, 1.0)
end
end
end

class Spriteset_Battle
include Side_view
#--------------------------------------------------------------------------
# ツナ ニ棚ニ置ニ淡ニ巽ニ誰ニ暖ツ鞘ーナテコ窶ーツサ
#--------------------------------------------------------------------------
alias side_veiw_initialize initialize
def initialize
side_veiw_initialize
# ニ但ニ誰ニ耽ツーニ湛ニ致ニ停ーニ辰ニ暖窶堙ー窶ーテー窶「テコ
for sprite in @actor_sprites
sprite.dispose
end
# ニ但ニ誰ニ耽ツーニ湛ニ致ニ停ーニ辰ニ暖窶堙ーツ催ャツ青ャ
@actor_sprites = []
for i in 1..Party_max
@actor_sprites.push(Sprite_Battler.new(@viewport1))
end
update
end
#--------------------------------------------------------------------------
# ツナ 窶ーテヲ窶禿岩堙姑湛ニ誰ニ陳債ーニ停ケ
#--------------------------------------------------------------------------
if method_defined?("screen_scroll")
alias side_view_screen_scroll screen_scroll
def screen_scroll
side_view_screen_scroll
# ニ但ニ誰ニ耽ツー窶堙戸テ岩冰窶「テ「ツ青ウ
for actor in $game_party.actors
actor.real_x = @real_x
actor.real_y = @real_y
actor.real_zoom = @real_zoom
end
end
end
end

class Sprite_Battler < RPG::Sprite
include Side_view
#--------------------------------------------------------------------------
# ツナ ニ棚ニ置ニ淡ニ巽ニ誰ニ暖ツ鞘ーナテコ窶ーツサ
# viewport : ニ池ニ停ヲツーニ竹ツーニ暖
# battler : ニ弛ニ暖ニ停ーツー (Game_Battler)
#--------------------------------------------------------------------------
def initialize(viewport, battler = nil)
super(viewport)
@battler = battler
@battler_visible = false
@weapon = Sprite_Weapon.new(viewport, battler)
@flying = Sprite_Flying.new(viewport, battler)
@shadow = []
@fly = 0
@fly_direction = 1
@rand = rand(10)
@bitmaps = {}
self.effect_clear
end
#--------------------------------------------------------------------------
# ツナ 窶ーテー窶「テコ
#--------------------------------------------------------------------------
alias side_view_dispose dispose
def dispose
side_view_dispose
@weapon.dispose if @weapon != nil
@flying.dispose if @flying != nil
if @_target_sprite != nil
@_target_sprite.bitmap.dispose
@_target_sprite.dispose
@_target_sprite = nil
end
end
#--------------------------------------------------------------------------
# ツナ ニ稚ニ椎陳ーニ停ぎツ更ツ新
#--------------------------------------------------------------------------
def update
super
# ニ弛ニ暖ニ停ーツー窶堋ェ nil 窶堙個湘ェツ坂。
if @battler == nil
self.bitmap = nil
@weapon.bitmap = nil
loop_animation(nil)
return
end
# ニ弛ニ暖ニ停ーツーツ更ツ新
@battler.update
# ニ弛ニ暖ニ停ーツーニ但ニ男ニ陳≫堙姑断ツーニ耽ナステヲ窶慊セ
@anime_type = @battler.anime_type
# bitmap 窶堙ーニ鱈ニ槌槌鍛ニ歎ニ停ヲ窶ーツサ
path = @anime_type[0].to_s + "#" + @battler.pattern.to_s
if not @bitmaps.include?(path) or @bitmaps[path].disposed?
# ニ稚ニ叩ニ辰ニ停ケ窶督シ窶堋ゥツ色窶佛窶堋ェナ陳サツ催昶堙娯堙窶堙娯堙ヒテ吮堙遺堙ゥツ
湘ェツ坂。
change = (@battler.character_name != @battler_name or @battler.character_hue != @battler_hue)
if change
# ニ池ニ鍛ニ暖ニ筑ニ鍛ニ致窶堙ーナステヲ窶慊セツ、ツ静昶凖ィ
@battler_name = @battler.character_name
@battler_hue = @battler.character_hue
@bitmap = RPG::Cache.character(@battler_name, @battler_hue)
@width = @bitmap.width / 4
@height = @bitmap.height / 4
self.ox = @width / 2
self.oy = @height / 2
@battler.height = @height
@flag = true
# ツ静ュ窶慊ャ窶「s窶\窶堙懌堋ス窶堙坂ーB窶堙ェツ湘ウ窶佚披堙遺堙ァ窶「s窶慊ァ窶督セ窶忸窶堙ー 0 窶堙俄堋キ窶堙ゥ
if @battler.dead? or @battler.hidden
self.opacity = 0
end
end
if (@anime_type[0] != @battler_condition or
@battler.pattern != @battler_pattern or flag)
# ニ池ニ鍛ニ暖ニ筑ニ鍛ニ致窶堙ーナステヲ窶慊セツ、ツ静昶凖ィ
@battler_condition = @anime_type[0]
@battler_pattern = @battler.pattern
@sx = @battler.pattern * @width
@sy = @anime_type[0] % 4 * @height
self.bitmap = Bitmap.new(@width,@height)
self.bitmap.blt(0,0, @bitmap,Rect.new(@sx, @sy, @width, @height))
@bitmaps[path] = self.bitmap
flag = false
end
end
self.bitmap = @bitmaps[path]
# 窶敕イツ行
update_fly
# ニ歎ニ巽ニ辰ニ誰
update_shake
# 窶ーテア窶彎
update_turning
# 窶敖ス窶彎
update_reverse
# ヒテ壺慊ョ
update_moving
# 窶凖窶ーテニ但ニ男ニ陳
update_add_anime
# ニ竪ニ稚ニ巽ニ誰ニ暖ナ津ク窶ーテ岩堙娯廳窶廃
update_effect
# ニ但ニ男ニ陳ツーニ歎ニ停。ニ停 ID 窶堋ェナ陳サツ催昶堙娯堙窶堙娯堙ヒテ吮堙遺堙ゥツ湘ェツ坂。
flag = RTAB ? true : @battler.damage == nil
if flag and @battler.state_animation_id != @state_animation_id
@state_animation_id = @battler.state_animation_id
loop_animation($data_animations[@state_animation_id])
end
# ニ歎ニ巽ニ辰ニ誰
if @battler.shake
self.start_shake(5, 5, 5)
@battler.shake = false
end
# 窶督セ窶禿
if @battler.blink
blink_on
else
blink_off
end
# 窶「s窶ーテでス窶ケ窶堙個湘ェツ坂。
unless @battler_visible
flag = RTAB ? (@battler.damage.size < 2 or @battler.damage_pop.size < 2) :
(@battler.damage == nil or @battler.damage_pop)
# ツ出ナ陳サ
if not @battler.hidden and not @battler.dead? and flag
appear
@battler_visible = true
end
end
if RTAB
# ニ胆ニ陳ツーニ淡
for battler in @battler.damage_pop
if battler[0].class == Array
if battler[0][1] >= 0
$scene.skill_se
else
$scene.levelup_se
end
damage(@battler.damage[battler[0]], false, 2)
else
damage(@battler.damage[battler[0]], @battler.critical[battler[0]])
end
if @battler.damage_sp.include?(battler[0])
damage(@battler.damage_sp[battler[0]],
@battler.critical[battler[0]], 1)
@battler.damage_sp.delete(battler[0])
end
@battler.damage_pop.delete(battler[0])
@battler.damage.delete(battler[0])
@battler.critical.delete(battler[0])
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 RTAB
# ニ但ニ男ニ陳ツーニ歎ニ停。ニ停
if !@battler.animation.empty?
for animation in @battler.animation.reverse
if animation[2]
animation($data_animations[animation[0]], animation[1], true)
else
animation($data_animations[animation[0]], animation[1])
end
@battler.animation.delete(animation)
end
end
else
# ニ但ニ男ニ陳ツーニ歎ニ停。ニ停
if @battler.animation_id != 0
animation = $data_animations[@battler.animation_id]
animation(animation, @battler.animation_hit)
@battler.animation_id = 0
end
end
# ニ胆ニ陳ツーニ淡
if !RTAB and @battler.damage_pop
damage(@battler.damage, @battler.critical)
@battler.damage = nil
@battler.critical = false
@battler.damage_pop = false
end
flag = RTAB ? (@battler.damage.empty? and $scene.dead_ok?(@battler)) :
@battler.damage == nil
# ニ坦ニ停ーニ致ニ湛
if flag and @battler.dead?
if @battler.is_a?(Game_Actor)
$game_system.se_play($data_system.actor_collapse_se)
elsif @battler.is_a?(Game_Enemy)
$game_system.se_play($data_system.enemy_collapse_se)
end
collapse
@battler_visible = false
end
end
# ニ湛ニ致ニ停ーニ辰ニ暖窶堙個催窶「W窶堙ーツ静昶凖ィ
self.x = @battler.screen_x + @effect_ox
self.y = @battler.screen_y + @effect_oy
self.z = @battler.screen_z
self.zoom_x = @battler.real_zoom
self.zoom_y = @battler.real_zoom
# ニ脱ニ巽ニ辰ニ暖ニ谷ニ脱ニ停愴暖窶堙ーナ陳ク窶堙ァ窶堋キ
@battler.wait_count -= 1
@battler.wait_count2 -= 1
# ニ但ニ男ニ陳ツーニ歎ニ停。ニ停懌佚停堋ソナスナセナテ版ステヲ窶慊セ
@battler.animation_duration = @_animation_duration
if @battler.is_a?(Game_Actor)
self.zoom_x *= CHAR_ZOOM
self.zoom_y *= CHAR_ZOOM
end
# 窶ー窶懌ケ窶披板」ニ但ニ男ニ陳
if @battler.flying_anime != [0,0,false,false] and @flying.nil?
@flying = Sprite_Flying.new(self.viewport, @battler)
elsif @battler.flying_anime == [0,0,false,false] and !@flying.nil?
@flying.dispose
@flying = nil
end
if @flying != nil
@flying.battler = @battler
@flying.update
end
if @battler.is_a?(Game_Actor)
# 窶「ツ税テュニ但ニ男ニ陳
if @battler.weapon_anime_type1 and @weapon.nil?
@weapon = Sprite_Weapon.new(self.viewport, @battler)
elsif !@battler.weapon_anime_type1 and !@weapon.nil?
@weapon.dispose
@weapon = nil
end
if @weapon != nil
@weapon.battler = @battler
@weapon.update
@weapon.opacity = self.opacity
@weapon.x = self.x + BLZ_X[@battler.weapon_anime_type3][@battler.pattern]
@weapon.y = self.y + BLZ_Y[@battler.weapon_anime_type3][@battler.pattern]
@weapon.angle = BLZ_ANGLE[@battler.weapon_anime_type3][@battler.pattern]
if self.mirror
@weapon.angle += @weapon.angle - 180
end
end
end
# ナスc窶佛
if @battler.shadow
if Graphics.frame_count % 2 == 0
shadow = ::Sprite.new(self.viewport)
shadow.bitmap = self.bitmap.dup
shadow.x = self.x
shadow.y = self.y
shadow.ox = self.ox
shadow.oy = self.oy
shadow.mirror = self.mirror
shadow.angle = self.angle
shadow.opacity = 160
shadow.zoom_x = self.zoom_x
shadow.zoom_y = self.zoom_y
if @battler.is_a?(Game_Actor)
shadow.src_rect.set(@sx, @sy, @width, @height)
else
shadow.src_rect.set(0, 0, @width, @height)
end
@shadow.push([shadow,duration = 10,@battler.true_x + @effect_ox,@battler.true_y + @effect_oy])
end
end
for s in @shadow
if !s[0].disposed?
s[0].update
s[1] -= 1
if s[1] < 1
if s[0].bitmap != nil
s[0].bitmap.dispose
end
s[0].dispose
else
s[0].x = @battler.screen_x(s[2])
s[0].y = @battler.screen_y(s[3])
end
else
s = nil
end
end
@shadow.compact!
end
#--------------------------------------------------------------------------
# ツナ ニ竪ニ稚ニ巽ニ誰ニ暖窶堙俄堙ヲ窶堙ゥツ催窶「Wナ地窶堙個更ツ新
#--------------------------------------------------------------------------
def update_effect
# ナp窶忸窶堙個修ツ青ウ
if @_upside_down
self.angle = (@_turning + 180) % 360
else
self.angle = @_turning
end
# X ツ催窶「W窶堙個修ツ青ウ窶冤
@effect_ox = @_shake + @_moving[0]
# Y ツ催窶「W窶堙個修ツ青ウ窶冤
@effect_oy = -@fly + @_moving[1]
if @_animation == nil or (RTAB and @_animation.empty?)
self.effect_clear
end
end
#--------------------------------------------------------------------------
# ツナ ニ歎ニ巽ニ辰ニ誰ツ更ツ新
#--------------------------------------------------------------------------
def update_shake
if @_shake_duration >= 1 or @_shake != 0
delta = (@_shake_power * @_shake_speed * @_shake_direction) / 10.0
if @_shake_duration <= 1 and @_shake * (@_shake + delta) < 0
@_shake = 0
else
@_shake += delta
end
if @_shake > @_shake_power * 2
@_shake_direction = -1
end
if @_shake < - @_shake_power * 2
@_shake_direction = 1
end
if @_shake_duration >= 1
@_shake_duration -= 1
end
end
end
#--------------------------------------------------------------------------
# ツナ 窶敕イツ行ツ更ツ新
#--------------------------------------------------------------------------
def update_fly
if @rand > 0
@rand -= 1
return
end
if @battler.fly != 0
if @fly < @battler.fly / 4
@fly_direction = 1
elsif @fly > @battler.fly / 2
@fly_direction = -1
end
@fly += 0.5 * @fly_direction
end
end
#--------------------------------------------------------------------------
# ツナ 窶ーテア窶彎ツ更ツ新
#--------------------------------------------------------------------------
def update_turning
if @_turning_duration > 0 or @_turning != 0
@_turning += @_turning_direction * @_turning_speed / 2.0
# ナスc窶堙ィ窶ーテア窶彎ツ絶昶堙ーナ陳ク窶堙ァ窶堋キ
if @_turning_direction == -1
if @_turning_duration > 0 and @_turning < 0
@_turning_duration -= 1
end
elsif @_turning_direction == 1
if @_turning_duration > 0 and @_turning >= 360
@_turning_duration -= 1
end
end
# ヒテ遺ーツコ窶「テ「ツ青ウ
while @_turning < 0
@_turning += 360
end
if @_turning_duration <= 0
@_turning = 0
end
@_turning %= 360
end
end
#--------------------------------------------------------------------------
# ツナ ツ債カ窶ーE窶敖ス窶彎ツ更ツ新
#--------------------------------------------------------------------------
def update_reverse
if @last_reverse != (@_reverse or @battler.reverse)
self.mirror = (@_reverse or @battler.reverse)
@last_reverse = (@_reverse or @battler.reverse)
end
end
#--------------------------------------------------------------------------
# ツナ ヒテ壺慊ョツ更ツ新
#--------------------------------------------------------------------------
def update_moving
@move_distance = (@_move_coordinates[2] - @_move_coordinates[0]).abs +
(@_move_coordinates[3] - @_move_coordinates[1]).abs
if @move_distance > 0
return if @_moving[0] == @_move_coordinates[0] and @_moving[1] == @_move_coordinates[1]
array = @_move_coordinates
x = (array[2] + 1.0 * (array[0] - array[2]) * (@move_distance - @_move_duration) / @move_distance.to_f).to_i
y = (array[3] + 1.0 * (array[1] - array[3]) * (@move_distance - @_move_duration) / @move_distance.to_f).to_i
@_moving = [x, y]
if @_move_quick_return and @_move_duration == 0
@_move_coordinates = [0,0,array[0],array[1]]
@_move_duration = @move_distance
end
@_move_duration -= @_move_speed
@_move_duration = [@_move_duration, 0].max
end
end
#--------------------------------------------------------------------------
# ツナ 窶凖窶ーテニ但ニ男ニ陳ツ更ツ新 (RTABナ津窶凖ィ窶ケ@窶\)
#--------------------------------------------------------------------------
def update_add_anime
if RTAB
# ニ但ニ男ニ陳ツーニ歎ニ停。ニ停
if @_add_anime_id != 0
animation = $data_animations[@_add_anime_id]
animation(animation, true)
@_add_anime_id = 0
end
end
end
#--------------------------------------------------------------------------
# ツナ ニ竪ニ稚ニ巽ニ誰ニ暖ツ鞘ーナテコ窶ーツサ
#--------------------------------------------------------------------------
def effect_clear
@_effect_ox = 0
@_effect_oy = 0
@_shake_power = 0
@_shake_speed = 0
@_shake_duration = 0
@_shake_direction = 1
@_shake = 0
@_upside_down = false
@_reverse = false
@_turning_direction = 1
@_turning_speed = 0
@_turning_duration = 0
@_turning = 0
@_move_quick_return = true
@_move_speed = 0
@_move_coordinates = [0,0,0,0]
@_move_jump = false
@_move_duration = 0
@_moving = [0,0]
@_add_anime_id = 0
end
#--------------------------------------------------------------------------
# ツナ ニ歎ニ巽ニ辰ニ誰窶堙固Jナスn
# power : 窶ケツュ窶堋ウ
# speed : 窶伉ャ窶堋ウ
# duration : ナスナセナテ
#--------------------------------------------------------------------------
def start_shake(power, speed, duration)
@_shake_power = power
@_shake_speed = speed
@_shake_duration = duration
end
#--------------------------------------------------------------------------
# ツナ ツ湘」窶ーツコ窶敖ス窶彎窶堙ーナJナスn
#--------------------------------------------------------------------------
def start_upside_down
@_upside_down = @_upside_down ? false : true
end
#--------------------------------------------------------------------------
# ツナ ツ債カ窶ーE窶敖ス窶彎窶堙ーナJナスn
#--------------------------------------------------------------------------
def start_reverse
@_reverse = @_reverse ? false : true
end
#--------------------------------------------------------------------------
# ツナ 窶ーテア窶彎窶堙ーナJナスn
# direction: 窶「テサナ津シ
# speed : 窶伉ャ窶堋ウ
# duration : ナスナセナテ
#--------------------------------------------------------------------------
def start_turning(direction, speed, duration)
@_turning_direction = direction
@_turning_speed = speed
@_turning_duration = duration
@_turning = @_turning_direction == 1 ? 0 : 360
end
#--------------------------------------------------------------------------
# ツナ ヒテ壺慊ョ窶堙ーナJナスn
# quick_return : 窶禿溪堙ゥ窶堋ゥ窶堙窶堋、窶堋ゥ
# speed : 窶伉ャ窶堋ウ
# x : X ツ催窶「W
# y : Y ツ催窶「W
#--------------------------------------------------------------------------
def start_moving(quick_return, speed, x, y)
@_move_quick_return = quick_return == 0 ? false : true
@_move_speed = speed
@_move_coordinates = [x,y,@_move_coordinates[0],@_move_coordinates[1]]
distance = (@_move_coordinates[2] - @_move_coordinates[0]).abs +
(@_move_coordinates[3] - @_move_coordinates[1]).abs
@_move_duration = distance
end
#--------------------------------------------------------------------------
# ツナ ニ但ニ男ニ陳≫凖窶ーテ≫堙ーナJナスn
# id : ID
# hit : 窶督ス窶吮ニ稚ニ停ーニ鍛ニ丹
#--------------------------------------------------------------------------
def start_add_anime(id)
@_add_anime_id = id
end
#--------------------------------------------------------------------------
# ツナ ナeナステュニ竪ニ稚ニ巽ニ誰ニ暖窶堙固Jナスn窶敖サ窶凖ィ
#--------------------------------------------------------------------------
if !method_defined?("side_view_animation_process_timing")
alias side_view_animation_process_timing animation_process_timing
end
def animation_process_timing(timing, hit)
side_view_animation_process_timing(timing, hit)
if (timing.condition == 0) or
(timing.condition == 1 and hit == true) or
(timing.condition == 2 and hit == false)
if timing.se.name =~ SHAKE_FILE
names = timing.se.name.split(/#/)
power = names[1].nil? ? SHAKE_POWER : names[1].to_i
speed = names[2].nil? ? SHAKE_SPEED : names[2].to_i
duration = names[3].nil? ? SHAKE_DURATION : names[3].to_i
# ニ歎ニ巽ニ辰ニ誰窶堙ーナJナスn
self.start_shake(power, speed, duration)
end
if timing.se.name == UPSIDE_DOWN_FILE
# ツ湘」窶ーツコ窶敖ス窶彎窶堙ーナJナスn
self.start_upside_down
end
if timing.se.name == REVERSE_FILE
# ツ債カ窶ーE窶敖ス窶彎窶堙ーナJナスn
self.start_reverse
end
if timing.se.name =~ TURNING_FILE
names = timing.se.name.split(/#/)
direction = names[1].nil? ? TURNING_DIRECTION : names[1].to_i
speed = names[2].nil? ? TURNING_SPEED : names[2].to_i
duration = names[3].nil? ? TURNING_DURATION : names[3].to_i
# 窶ーテア窶彎窶堙ーナJナスn
self.start_turning(direction, speed, duration)
end
if timing.se.name =~ MOVE_FILE
names = timing.se.name.split(/#/)
quick_return= names[1].nil? ? MOVE_RETURN : names[1].to_i
speed = names[2].nil? ? MOVE_SPEED : names[2].to_i
x = names[3].nil? ? MOVE_COORDINATES[0] : names[3].to_i
y = names[3].nil? ? MOVE_COORDINATES[1] : names[4].to_i
# ヒテ壺慊ョ窶堙ーナJナスn
self.start_moving(quick_return, speed, x, y)
end
if timing.se.name =~ ADD_ANIME_FILE
names = timing.se.name.split(/#/)
id = names[1].nil? ? ADD_ANIME_ID : names[1].to_i
# ニ但ニ男ニ陳≫凖窶ーテ≫堙ーナJナスn
self.start_add_anime(id)
end
end
end
end
#==============================================================================
# ツツ。 Sprite_Weapon
#------------------------------------------------------------------------------
# ツ ニ弛ニ暖ニ停ーツー窶「\ナスツヲ窶廃窶堙姑湛ニ致ニ停ーニ辰ニ暖窶堙窶堋キツ。Game_Battler ニ誰ニ停ーニ湛窶堙姑辰ニ停愴湛ニ耽ニ停愴湛窶堙ーナテナス窶ケ窶堋オツ、
# ニ湛ニ致ニ停ーニ辰ニ暖窶堙個湘ウ窶佚披堙ーナスツゥ窶慊ョ窶廬窶堙俄「テ鞘ーツサ窶堋ウ窶堋ケ窶堙懌
堋キツ。
#==============================================================================

class Sprite_Weapon < ::Sprite
include Side_view
#--------------------------------------------------------------------------
# ツナ ナ津カナJニ辰ニ停愴湛ニ耽ニ停愴湛窶「テ渉絶
#--------------------------------------------------------------------------
attr_accessor :battler # ニ弛ニ暖ニ停ーツー
attr_reader :cw # ニ丹ニ停ーニ稚ニ達ニ鍛ニ誰窶堙娯「ツ
attr_reader :ch # ニ丹ニ停ーニ稚ニ達ニ鍛ニ誰窶堙個坂壺堋ウ
#--------------------------------------------------------------------------
# ツナ ニ棚ニ置ニ淡ニ巽ニ誰ニ暖ツ鞘ーナテコ窶ーツサ
# viewport : ニ池ニ停ヲツーニ竹ツーニ暖
# battler : ニ弛ニ暖ニ停ーツー (Game_Battler)
#--------------------------------------------------------------------------
def initialize(viewport, battler = nil)
super(viewport)
@battler = battler
@battler_visible = false
end
#--------------------------------------------------------------------------
# ツナ 窶ーテー窶「テコ
#--------------------------------------------------------------------------
def dispose
if self.bitmap != nil
self.bitmap.dispose
end
super
end
#--------------------------------------------------------------------------
# ツナ ニ稚ニ椎陳ーニ停ぎツ更ツ新
#--------------------------------------------------------------------------
def update
super
# ニ弛ニ暖ニ停ーツー窶堋ェ nil 窶堙個湘ェツ坂。
if @battler == nil or !@battler.is_a?(Game_Actor)
self.bitmap = nil
return
end
# ニ脱ニ竪ニ竹ニ停愴但ニ男ニ陳≫堙姑断ツーニ耽ナステヲ窶慊セ
@weapon_anime_type = @battler.weapon_anime_type
# ツ静昶凖ィ窶堋ェツ「窶敕ア窶「\ナスツヲツ」窶堙個湘ェツ坂。
if !@weapon_anime_type[1] or @weapon_anime_type[0].nil?
self.visible = false
return
else
self.visible = true
end
# ニ稚ニ叩ニ辰ニ停ケ窶督シ窶堋ェナ陳サツ催昶堙娯堙窶堙娯堙ヒテ吮堙遺堙ゥツ湘ェツ坂。
if @weapon_anime_type[0] != @weapon_name
@weapon_name = @weapon_anime_type[0]
# ニ池ニ鍛ニ暖ニ筑ニ鍛ニ致窶堙ーナステヲ窶慊セツ、ツ静昶凖ィ
self.bitmap = RPG::Cache.icon(@weapon_name)
@width = bitmap.width
@height = bitmap.height
@flag = true
end
# ナ陳サツ催敞但ニ男ニ陳ニ恥ニ耽ツーニ停懌堋ェナ陳サツ催昶堙娯堙窶堙娯堙ヒテ吮堙遺堙ゥツ
湘ェツ坂。
if @pattern != @battler.pattern or @flag or @condition != @battler.condition
@pattern = @battler.pattern
@condition = @battler.condition
self.ox = @width
self.oy = @height
self.z = battler.screen_z
self.zoom_x = @battler.real_zoom * CHAR_ZOOM
self.zoom_y = @battler.real_zoom * CHAR_ZOOM
self.src_rect.set(0, 0, @width, @height)
self.opacity = 255
# ニ弛ニ暖ニ停ーツー窶堙ヲ窶堙ィナスティ窶楼窶堙俄「\ナスツヲ
if @weapon_anime_type[2]
self.z += 10
# ニ弛ニ暖ニ停ーツー窶堙ヲ窶堙ィ窶ーナ凪堙俄「\ナスツヲ
else
self.z -= 10
end
@flag = false
end
end
end

#==============================================================================
# ツツ。 Sprite_Flying
#------------------------------------------------------------------------------
# ツ ニ弛ニ暖ニ停ーツー窶「\ナスツヲ窶廃窶堙姑湛ニ致ニ停ーニ辰ニ暖窶堙窶堋キツ。Game_Battler ニ誰ニ停ーニ湛窶堙姑辰ニ停愴湛ニ耽ニ停愴湛窶堙ーナテナス窶ケ窶堋オツ、
# ニ湛ニ致ニ停ーニ辰ニ暖窶堙個湘ウ窶佚披堙ーナスツゥ窶慊ョ窶廬窶堙俄「テ鞘ーツサ窶堋ウ窶堋ケ窶堙懌
堋キツ。
#==============================================================================

class Sprite_Flying < RPG::Sprite
include Side_view
LATE_COUNT = 20
#--------------------------------------------------------------------------
# ツナ ナ津カナJニ辰ニ停愴湛ニ耽ニ停愴湛窶「テ渉絶
#--------------------------------------------------------------------------
attr_accessor :battler # ニ弛ニ暖ニ停ーツー
#--------------------------------------------------------------------------
# ツナ ニ棚ニ置ニ淡ニ巽ニ誰ニ暖ツ鞘ーナテコ窶ーツサ
# viewport : ニ池ニ停ヲツーニ竹ツーニ暖
# battler : ニ弛ニ暖ニ停ーツー (Game_Battler)
#--------------------------------------------------------------------------
def initialize(viewport, battler = nil)
super(viewport)
@battler = battler
@battler_visible = false
@later = LATE_COUNT
end
#--------------------------------------------------------------------------
# ツナ ニ稚ニ椎陳ーニ停ぎツ更ツ新
#--------------------------------------------------------------------------
def update
super
# ニ弛ニ暖ニ停ーツー窶堋ェ nil 窶堙個湘ェツ坂。
if @battler == nil
self.bitmap = nil
loop_animation(nil)
return
end
# 窶ー窶懌ケ窶披板」ニ但ニ男ニ陳
flying_animation = @battler.flying_animation
flying_start = flying_animation[0]
flying_end = flying_animation[1]
# ニ但ニ男ニ陳ツーニ歎ニ停。ニ停 ID 窶堋ェナ陳サツ催昶堙娯堙窶堙娯堙ヒテ吮堙遺堙ゥツ湘ェツ坂。
if @anime_id != @battler.flying_anime[0]
@anime_id = @battler.flying_anime[0]
@animation = $data_animations[@anime_id]
end
# ニ但ニ男ニ陳ツーニ歎ニ停。ニ停 ナJナスn
if flying_start
animation(@animation,true)
elsif flying_end
# ツ湘≫ケナス窶堙ー窶凅窶堙ァ窶堋ケ窶堙窶堙昶堋ス窶堙ィ窶堋キ窶堙ゥ
@later -= 1
if @later < 0
animation(nil, true)
@later = LATE_COUNT
end
end
self.x = @battler.flying_x
self.y = @battler.flying_y
self.z = @battler.screen_z + 1000
end
end
module RPG
class Skill
#--------------------------------------------------------------------------
# ツナ 窶凪壺邸窶堋ゥ窶堙窶堋、窶堋ゥ窶堙娯敖サ窶冉
#--------------------------------------------------------------------------
def magic?
if @atk_f == 0
return true
else
return false
end
end
end
end

# ニ但ニ陳債ーニ谷ツーニ\ニ停ケ窶堙戸テ岩冰ツ修ツ青ウ

class Arrow_Actor < Arrow_Base
include Side_view
#--------------------------------------------------------------------------
# ツナ ニ稚ニ椎陳ーニ停ぎツ更ツ新
#--------------------------------------------------------------------------
alias side_view_update update
def update
side_view_update
# ニ湛ニ致ニ停ーニ辰ニ暖窶堙個催窶「W窶堙ーツ静昶凖ィ
if self.actor != nil && (self.x != self.actor.screen_x + ARROW_OX or self.y != self.actor.screen_y + ARROW_OY)
self.x = self.actor.screen_x + ARROW_OX
self.y = self.actor.screen_y + ARROW_OY
end
end
end
class Arrow_Enemy < Arrow_Base
include Side_view
#--------------------------------------------------------------------------
# ツナ ニ稚ニ椎陳ーニ停ぎツ更ツ新
#--------------------------------------------------------------------------
alias side_view_update update
def update
side_view_update
# ニ湛ニ致ニ停ーニ辰ニ暖窶堙個催窶「W窶堙ーツ静昶凖ィ
if self.enemy != nil && (self.x != self.enemy.screen_x + ARROW_OX or self.y != self.enemy.screen_y + ARROW_OY)
self.x = self.enemy.screen_x + ARROW_OX
self.y = self.enemy.screen_y + ARROW_OY
end
end
end
Go to the top of the page
 
+Quote Post
   
Achilles
post Oct 19 2008, 10:40 AM
Post #9


I can (usually) answer any event based question!
Group Icon

Group: Revolutionary
Posts: 381
Type: Scripter
RM Skill: Masterful




Theres a lot of things wrong with that script....I repeatedly got syntax errors.


__________________________
Go to the top of the page
 
+Quote Post
   
efeplaya35
post Oct 29 2008, 12:41 PM
Post #10


Level 1
Group Icon

Group: Member
Posts: 5
Type: None
RM Skill: Beginner




Help me pls! My problem to this system:


After from press to Skill:



???

Go to the top of the page
 
+Quote Post
   
Charlie Fleed
post Oct 29 2008, 02:51 PM
Post #11


Charlie Fleed
Group Icon

Group: Revolutionary
Posts: 405
Type: Scripter
RM Skill: Undisclosed




QUOTE (Junkexx @ Sep 27 2008, 09:08 PM) *
Finally! I battle system that doest require the use of Minkoff battlers!


Just wanted to clarify that all the BSs that use Animated Battlers Enhanced DO NOT NEED the so called Minkoff battlers, they can use pretty much everything: character sets, static pics...
This is a widespread misconception.
And, guys, there is better stuff than this around. wink.gif


__________________________
Get CTB v3.2 and all the latest versions of my scripts at Planet Fleed and Save-Point

Go to the top of the page
 
+Quote Post
   
Sigy4ever
post Nov 2 2008, 09:25 PM
Post #12


Level 1
Group Icon

Group: Member
Posts: 14
Type: Developer
RM Skill: Beginner




EDIT:Fixed
Problem was:people walking on spot
Fix:Battlers and walking around people need to be the same E.G. Fighter01 and Fighter02(battler) dont work needs to be Fighter01 and Fighter 01 (battler)

Me not so good at Explaining 8(

This post has been edited by Sigy4ever: Nov 6 2008, 03:21 AM


__________________________
Current Projects

Adventures of Block (7.6%) in RPGVX
Davids Journey (98%) in RPG2k3 (Hiatus)
How little i know-The Prince 5% In RPGVX (Hiatus)
How Little i Know-The Slave 4.7% In RPGVX (Hiatus)
Adventures of Block-The Nine Rings of Block (vaporware) Reason Deleted accidently


Dreamer/Writer-Me Skill getting better
Scripter-Sigman Skill Begginer
Spriter-None
Other-None

Favorite Engines
Rpg Maker VX skill Begginer
Rpg Maker Xp skill Begginer
Rpg Maker 2003 skill Fairly Good
Sim Maker 95 skill Begginer
Go to the top of the page
 
+Quote Post
   
sirSLR
post Nov 5 2008, 06:33 AM
Post #13


Level 4
Group Icon

Group: Member
Posts: 57
Type: None
RM Skill: Undisclosed




you make shure that character and battler have same name

i got this information from Kieara and it worked


and sorry for that "a" i did something wrong


__________________________
Working on a Bleach Game
My Sprites

IM GONNA BEAT UP YOU ALL
Go to the top of the page
 
+Quote Post
   
Sigy4ever
post Nov 6 2008, 03:18 AM
Post #14


Level 1
Group Icon

Group: Member
Posts: 14
Type: Developer
RM Skill: Beginner




Any way to speed up the Health bar taking Really long to go down?? it takes 5 mins to get the hp bar 1/4 of the way down!!!

This post has been edited by Sigy4ever: Nov 7 2008, 02:55 PM


__________________________
Current Projects

Adventures of Block (7.6%) in RPGVX
Davids Journey (98%) in RPG2k3 (Hiatus)
How little i know-The Prince 5% In RPGVX (Hiatus)
How Little i Know-The Slave 4.7% In RPGVX (Hiatus)
Adventures of Block-The Nine Rings of Block (vaporware) Reason Deleted accidently


Dreamer/Writer-Me Skill getting better
Scripter-Sigman Skill Begginer
Spriter-None
Other-None

Favorite Engines
Rpg Maker VX skill Begginer
Rpg Maker Xp skill Begginer
Rpg Maker 2003 skill Fairly Good
Sim Maker 95 skill Begginer
Go to the top of the page
 
+Quote Post
   
Rhainn
post Dec 7 2008, 11:07 AM
Post #15


Level 1
Group Icon

Group: Member
Posts: 12
Type: Writer
RM Skill: Intermediate




Sorry... I'm new to the site. I've only experimented with the systems that come default in rpgmakerxp. I've been playing with it for a while, and wanted to get into scripting, and I was wondering if the code above actually works. Pardon my ignorance, but I'm little more than a storyteller and artist.
Go to the top of the page
 
+Quote Post
   
dummy1234
post Dec 8 2008, 11:07 AM
Post #16


Level 8
Group Icon

Group: Revolutionary
Posts: 128
Type: Developer
RM Skill: Skilled




I just wanted to say...
A sideview battle script with health/mana bar and withouth need of extra sprites? YEAH! Now this is something people like me (that cant make sprites) are (well at least I am) really greatful for!
Thanks a lot for posting it.


__________________________
Given the choice - whether to rule a corrupt and failing empire, or to challenge the Fates for another throw, a better throw against one's destiny - what was a king to do?
Go to the top of the page
 
+Quote Post
   
post Dec 9 2008, 04:52 PM
Post #17





Group:
Posts: 0
Type: Writer
RM Skill: Undisclosed




I would have definitely used this although not being able to use the first character is such a pain because I've created too many events editing the \n[1] hero now. It seems really good though otherwise. If anyone can fix this so it works with the first hero please do.
Go to the top of the page
 
+Quote Post
   
MyraofGreyshire
post Dec 20 2008, 09:30 PM
Post #18


Level 2
Group Icon

Group: Member
Posts: 27
Type: Developer
RM Skill: Masterful




QUOTE (SkyGuardian @ Dec 9 2008, 07:52 PM) *
I would have definitely used this although not being able to use the first character is such a pain because I've created too many events editing the \n[1] hero now. It seems really good though otherwise. If anyone can fix this so it works with the first hero please do.


I absolutely love this script! But, I've been having an issue with it as of late. Whenever I am running a test battle and my characters go to attack (whether it be a weapon swing or a special) they just kind of run in place. The game isn't stalled or anything, no error message while it's running and nothing when I close it. I made sure also that the first character in my line up was not in the group. I'm not really sure what I'm doing wrong, and I would -love- for this to work so I can move on and do more advanced things on the project.

If anyone has any idea, I would be deeply appreciative smile.gif Thank you so much!

Edit: Ok, I figured out what happened. I couldn't understand this:

QUOTE
EDIT:Fixed
Problem was:people walking on spot
Fix:Battlers and walking around people need to be the same E.G. Fighter01 and Fighter02(battler) dont work needs to be Fighter01 and Fighter 01 (battler)

Me not so good at Explaining 8(


What it basically meant was that the 'Battler' graphic had to be the same name as the characters walking graphic- hence why it worked perfect for a brand new project, and not so great for the one I had already pre-established the graphics for. Renaming the walk graphic and the battler graphic to the same thing stopped the 'walk in one spot' issue. Thanks man! Sorry I didn't understand that : /

I guess the answer was sitting right in front of me XD

This post has been edited by MyraofGreyshire: Dec 20 2008, 09:43 PM


__________________________
Go to the top of the page
 
+Quote Post
   
PokemonSprite200...
post Jan 10 2009, 12:06 PM
Post #19


Level 2
Group Icon

Group: Member
Posts: 22
Type: Artist
RM Skill: Advanced




This looks awesome, but would I be able to use my own custom sprites?
Like this one for example:


__________________________
A.K.A. Mech VX on RPG Crisis.
Go to the top of the page
 
+Quote Post
   
Capt. Malboro
post Jan 10 2009, 04:52 PM
Post #20


Level 4
Group Icon

Group: Member
Posts: 45
Type: Developer
RM Skill: Advanced




@PokemonSprite2000:

Yes, you can. I used that battle system years ago and the only thing you actually have to do is absolutely make sure that both the Chatacter Set graphic and the Battler have the same name. Else, it won't work.

So if the Character Set (the file name) is Green_Dude, therefore the Battler graphic's file name should be Green_Dude.

Just make sure you do that and it will be just fine.

@All

About the HP bar going down really slow... Sometime ago I fixed that thing while playing with the numbers related to the HP and SP in the script itself. But right now I can't remember (plus I have a headache).

EDIT:

Alright, went quick through my archive and found out what I did. Open up the script editor and go to the script of this battle system. Find this method (use the search function to get there faster):

CODE
def change_hp_bar


Just lines below that 'def' (method) there's a line that states the following:

CODE
i -= 10


That 10 represents the time it takes for the bar to go down. The trick here is to get that number UP. How I have it... I have it in 50. Goes down pretty fast.

The same thing goes for the SP bar. Just find this method:

CODE
def change_sp_bar


Again, find this line (just lines below that 'def'):

CODE
i -= 10


And make it a bigger number. I have it in 30.

So, anyways, hope that helped out.

This post has been edited by Capt. Malboro: Jan 10 2009, 05:46 PM


__________________________

窶廩appy are those who dream dreams and are ready to pay the price to make them come true.窶
~ Leon Joseph Cardinal Suenens
Go to the top of the page
 
+Quote Post
   

2 Pages V   1 2 >
Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 17th June 2013 - 11:25 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker