Jump to content
Rpg²S Forum
  • 0

Problema in battaglia!!


Andre4e
 Share

Question

Allora io uso lo script x visualizzare gli hp dei mostri

Però uso anche quest'altro script:

XRXS's Full-View Battleback & Movable Camera

 

 

Cioè praticamente lo sfondo insieme ai mostri si muovono per fare in modo che il mostro selezionato sia al centro dello schermo, però in questo modo la barra degli hp rimane dove era prima e quindi alla fine succde questo

Vedi screenshot

 

Screenshot

 

 

 

Vi posto i due script

 

 

 

 

 

Vita Mostri

 

 

class Window_Base

#--------------------------------------------------------------------------

# œ ƒ‰ƒCƒ“•`‰æ by ÷‰ë Ý“y

#--------------------------------------------------------------------------

def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)

# •`ŽÊ‹——£‚ÌŒvŽZB‘å‚«‚߂ɒ¼ŠpŽž‚Ì’·‚³B

distance = (start_x - end_x).abs + (start_y - end_y).abs

# •`ŽÊŠJŽn

if end_color == start_color

for i in 1..distance

x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i

y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i

self.contents.fill_rect(x, y, width, width, start_color)

end

else

for i in 1..distance

x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i

y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i

r = start_color.red * (distance-i)/distance + end_color.red * i/distance

g = start_color.green * (distance-i)/distance + end_color.green * i/distance

b = start_color.blue * (distance-i)/distance + end_color.blue * i/distance

a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance

self.contents.fill_rect(x, y, width, width, Color.new(r, g, b, a))

end

end

end

end

class Window_Base < Window

#--------------------------------------------------------------------------

# * Draw Slant Bar(by SephirothSpawn)

#--------------------------------------------------------------------------

def draw_slant_bar(x, y, min, max, width = 152, height = 6,

bar_color = Color.new(150, 0, 0, 255), end_color = Color.new(255, 255, 60, 255))

# Draw Border

for i in 0..height

self.contents.fill_rect(x+i+3, y + height - i + 3, width+ 2,1, Color.new(0, 0, 0, 128))

#self.contents.fill_rect(x + i + 4, y + height - i + 4, width + 2, 1, Color.new(50, 50, 50, 255))

end

# Draw Background

for i in 1..(height - 1)

r = 100 * (height - i) / height + 0 * i / height

g = 100 * (height - i) / height + 0 * i / height

b = 100 * (height - i) / height + 0 * i / height

a = 255 * (height - i) / height + 255 * i / height

self.contents.fill_rect(x + i, y + height - i, width, 1, Color.new(r, b, g, a))

end

# Draws Bar

for i in 1..( (min / max.to_f) * width - 1)

for j in 1..(height - 1)

r = bar_color.red * (width - i) / width + end_color.red * i / width

g = bar_color.green * (width - i) / width + end_color.green * i / width

b = bar_color.blue * (width - i) / width + end_color.blue * i / width

a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width

self.contents.fill_rect(x + i + j, y + height - j, 1, 1, Color.new(r, g, b, a))

end

end

end

end

 

 

 

 

def draw_enemy_hp_meter_line(x, y, width = 356, height = 4)

w = width * @enemy.hp / @enemy.maxhp

hp_color_1 = Color.new(255, 0, 0, 192)

hp_color_2 = Color.new(255, 255, 0, 192)

self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))

draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)

x -= 1

y += (height/4).floor

self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))

draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)

x -= 1

y += (height/4).ceil

self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))

draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)

x -= 1

y += (height/4).ceil

self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))

draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)

end

 

 

 

def draw_enemy_sp_meter_line(x, y, width = 156, height = 4)

w = width * @enemy.sp / @enemy.maxsp

hp_color_1 = Color.new( 0, 0, 255, 192)

hp_color_2 = Color.new( 0, 255, 255, 192)

self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))

draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)

x -= 1

y += (height/4).floor

self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))

draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)

x -= 1

y += (height/4).ceil

self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))

draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)

x -= 1

y += (height/4).ceil

self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))

draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)

end

 

 

 

def draw_shadow_text_enemy(x, y, width, height, string, align = 0)

# Œ³‚ÌF‚ð•Û‘¶‚µ‚Ä‚¨‚

color = self.contents.font.color.dup

# •Žš‚ʼne•`‰æ

self.contents.font.color = Color.new(0, 0, 0)

self.contents.draw_text(x + 2, y + 2, width, height, string, align)

# Œ³‚ÌF‚É–ß‚µ‚Ä•`‰æ

self.contents.font.color = color

self.contents.draw_text(x, y, width, height, string, align)

end

 

 

 

def draw_enemy_cp_meter(x, y, width = 156, type = 0)

self.contents.font.color = system_color

self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))

if @enemy.cp == nil

@enemy.cp = 0

end

w = width * [@enemy.cp,65535].min / 65535

self.contents.fill_rect(x, y+28, w,1, Color.new(255, 255, 128, 255))

self.contents.fill_rect(x, y+29, w,1, Color.new(255, 255, 0, 255))

self.contents.fill_rect(x, y+30, w,1, Color.new(192, 192, 0, 255))

self.contents.fill_rect(x, y+31, w,1, Color.new(128, 128, 0, 255))

end

 

#alias xrxs_bp7_draw_enemy_state draw_enemy_state

#def draw_enemy_state(x, y, width = 120)

#xrxs_bp7_draw_enemy_state(x, y, width) if @draw_ban != true

#end

 

 

class Window_EnemyHP < Window_Base

 

def initialize

super(0, 0, 640, 480)

self.contents = Bitmap.new(width - 32, height - 32)

self.opacity = 0

refresh

end

 

def refresh

self.contents.clear

for i in 0...$game_troop.enemies.size

@enemy = $game_troop.enemies

 

#no# @percent = (@enemy.hp * 100) / @enemy.maxhp

unless @enemy.hp == 0

#per abilitare mp togliere astersico alle righe

#con scritto si e ad ogni parola sottostante

#e non soprastante sostituire sp con hp

#e viceversa

# @enemy.hp, @enemy.maxhp

#draw_slant_bar(@enemy.screen_x - 65, @enemy.screen_y - 60, @enemy.hp, @enemy.maxhp, width = 85, height = 12, bar_color = Color.new(150, 0, 0, 255), end_color = Color.new(255, 255, 60, 255))

#si# draw_enemy_sp_meter_line(@enemy.screen_x - 62, @enemy.screen_y - 120, width = 85, height = 8)

draw_enemy_hp_meter_line(@enemy.screen_x - 62, @enemy.screen_y - 90, width = 85, height = 8)

 

 

 

 

#no# draw_slant_bar(@enemy.screen_x - 65, @enemy.screen_y - 60, @enemy.hp, @enemy.maxhp, width = 85, height = 12, bar_color = Color.new(255, 0, 0, 192), end_color = Color.new(255, 255, 0, 192))

#no# self.contents.draw_text(@enemy.screen_x - 20, @enemy.screen_y - 75, 100, 32, "#{@enemy.hp}")

 

self.contents.font.size = 30 # HP/SP”’l‚Ì•¶Žš‚̑傫‚³

#si# self.contents.font.color = @enemy.sp == 0 ? knockout_color :

#si# @enemy.sp <= @enemy.maxsp / 4 ? crisis_color : normal_color

#si# draw_shadow_text_enemy(@enemy.screen_x - 80, @enemy.screen_y - 142, 100, 32, @enemy.sp.to_s, 2)

 

self.contents.font.color = @enemy.hp == 0 ? knockout_color :

@enemy.hp <= @enemy.maxhp / 4 ? crisis_color : normal_color

draw_shadow_text_enemy(@enemy.screen_x - 80, @enemy.screen_y - 112, 100, 32, @enemy.hp.to_s, 2)

self.contents.font.size = 12 # —pŒêuHP/SPv‚Ì•¶Žš‚̑傫‚³

self.contents.font.color = system_color # —pŒêuHP/SPv‚Ì•¶Žš‚ÌF

#si# draw_shadow_text_enemy(@enemy.screen_x - 63 , @enemy.screen_y - 132, 96, 12, $data_system.words.sp)

draw_shadow_text_enemy(@enemy.screen_x - 63 , @enemy.screen_y - 102, 96, 12, $data_system.words.hp)

#si# draw_enemy_cp_meter(@enemy.screen_x - 70, @enemy.screen_y - 65, 120, 0)

#no# draw_enemy_state(@enemy.screen_x - 68, @enemy.screen_y - 56)

 

end

 

end

end

end

 

 

 

 

 

 

 

class Scene_Battle

 

alias raz_update update

alias raz_update_phase5 update_phase5

alias raz_update_phase4_step1 update_phase4_step1

alias raz_update_phase4_step5 update_phase4_step5

alias raz_enemy_hp_main main

 

 

def main

@troop_id = $game_temp.battle_troop_id

$game_troop.setup(@troop_id)

@enemy_window = Window_EnemyHP.new

@enemy_window.z = 95

raz_enemy_hp_main

 

@enemy_window.dispose

end

 

 

def update

@enemy_window.update

raz_update

end

 

def update_phase5

# If wait count is larger than 0

if @phase5_wait_count > 0

# Decrease wait count

@phase5_wait_count -= 1

# If wait count reaches 0

if @phase5_wait_count == 0

@enemy_window.visible = false

# Show result window

@result_window.visible = true

# Clear main phase flag

$game_temp.battle_main_phase = false

# Refresh status window

@status_window.refresh

@enemy_window.refresh

end

return

end

raz_update_phase5

end

 

def update_phase4_step1

raz_update_phase4_step1

@enemy_window.refresh

end

 

def update_phase4_step5

# Hide help window

@help_window.visible = false

# Refresh status window

@status_window.refresh

@enemy_window.refresh

raz_update_phase4_step5

end

end

 

 

 

=begin

class Window_BattleStatus < Window_Base

#--------------------------------------------------------------------------

# * Object Initialization

#--------------------------------------------------------------------------

def initialize

super(0, 320, 640, 160)

self.contents = Bitmap.new(width - 32, height - 32)

@level_up_flags = [false, false, false, false]

refresh

end

#--------------------------------------------------------------------------

# * Dispose

#--------------------------------------------------------------------------

def dispose

super

end

#--------------------------------------------------------------------------

# * Set Level Up Flag

# actor_index : actor index

#--------------------------------------------------------------------------

def level_up(actor_index)

@level_up_flags[actor_index] = true

end

#--------------------------------------------------------------------------

# * Refresh

#--------------------------------------------------------------------------

def refresh

self.contents.clear

@item_max = $game_party.actors.size

for i in 0...$game_party.actors.size

actor = $game_party.actors

actor_x = i * 160 + 4

draw_slant_bar(actor_x, 55, actor.hp, actor.maxhp, 120)

draw_slant_bar(actor_x, 88, actor.sp, actor.maxsp, 120, 6, bar_color = Color.new(150, 0, 150, 255), end_color = Color.new(0, 0, 255, 255))

draw_actor_name(actor, actor_x, 0)

draw_actor_hp(actor, actor_x, 32, 120)

draw_actor_sp(actor, actor_x, 64, 120)

if @level_up_flags

self.contents.font.color = normal_color

self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")

else

draw_actor_state(actor, actor_x, 96)

end

end

end

#--------------------------------------------------------------------------

# * Frame Update

#--------------------------------------------------------------------------

def update

super

# Slightly lower opacity level during main phase

if $game_temp.battle_main_phase

self.contents_opacity -= 4 if self.contents_opacity > 191

else

self.contents_opacity += 4 if self.contents_opacity < 255

end

end

end

=end

 

 

 

 

 

 

 

XRXS's Full-View Battleback & Movable Camera

 

 

# *** XRXS's Full-View Battleback & Movable Camera ver.2 *** built 221612

# by XRXS

 

#==============================================================================

# ** Customization point

#==============================================================================

module XRXS_BP8

#

# Camera Drift Speed

# ( SPEED1 : Distance number of partitions. Smaller values give quicker moves.

# SPEED2 : Lowest drift speed [ unit: Px/F ]

#

SPEED1 = 8

SPEED2 = 8

#

# Setting the width size of the GA

# ( 1024:XGA Size, 640:VGA Size )

GA_W = 1024

end

 

 

#==============================================================================

# ** Scene_Battle (part 1)

#------------------------------------------------------------------------------

# This class performs battle screen processing.

#==============================================================================

 

class Scene_Battle

#--------------------------------------------------------------------------

# * Start Party Command Phase

#--------------------------------------------------------------------------

alias xrxs_bp8_start_phase2 start_phase2

def start_phase2

# Camera: Centering

$xcam.centering

# Original Call

xrxs_bp8_start_phase2

end

#--------------------------------------------------------------------------

# * Frame Updat (actor command phase : enemy selection)

#--------------------------------------------------------------------------

alias xrxs_bp8_update_phase3_enemy_select update_phase3_enemy_select

def update_phase3_enemy_select

# Acquiring the enemy which currently being selected

enemy = $game_troop.enemies[@enemy_arrow.index]

# Camera: Attention

if @last_enemy_arrow != enemy

$xcam.watch(enemy)

@last_enemy_arrow = enemy

end

# Reset Call

xrxs_bp8_update_phase3_enemy_select

end

#--------------------------------------------------------------------------

# * End Enemy Selection

#--------------------------------------------------------------------------

alias xrxs_bp8_end_enemy_select end_enemy_select

def end_enemy_select

# Camera: Centering

$xcam.centering

@last_enemy_arrow = nil

# Original Call

xrxs_bp8_end_enemy_select

end

#--------------------------------------------------------------------------

# * Frame Update (main phase step 2 : start action)

#--------------------------------------------------------------------------

alias xrxs_bp8_update_phase4_step2 update_phase4_step2

def update_phase4_step2

# Reset Call

xrxs_bp8_update_phase4_step2

# In the system is changing to step 3

if @phase4_step == 3

# If the current battler is still on the field

if @active_battler.in_battlefield?

# Camera: Attention

$xcam.watch(@active_battler)

end

end

end

#--------------------------------------------------------------------------

# * Frame Update (main phase step 3 : animation for action performer)

#--------------------------------------------------------------------------

alias xrxs_bp8_update_phase4_step3 update_phase4_step3

def update_phase4_step3

# Reset Call

xrxs_bp8_update_phase4_step3

# Calculating the average X value of the target to set the camera

x_average = 0

number = 0

cam_target = nil

for target in @target_battlers

if target.in_battlefield?

x_average += target.x

number += 1

cam_target = target

end

end

# If the camera target is found

if number > 0

# Set the object animation's position

animation = $data_animations[@animation2_id]

if animation != nil and animation.position == 3

# Camera: Centering

$xcam.centering

# Camera: Zoom Out

$xcam.zoomout

elsif number == 1

# Camera: Attention

$xcam.watch(cam_target)

else

# Camera: Using the designated X position

$xcam.watch_at(x_average / number)

end

end

end

#--------------------------------------------------------------------------

# * Start After Battle Phase

#--------------------------------------------------------------------------

alias xrxs_bp8_start_phase5 start_phase5

def start_phase5

# Camera: Centering

$xcam.centering

# Original Call

xrxs_bp8_start_phase5

end

end

#------------------------------------------------------------------------------

# To customization point here

#==============================================================================

 

 

#------------------------------------------------------------------------------

#

# * Movable camera system *

#

#==============================================================================

# ** XCam

#------------------------------------------------------------------------------

# This class handles the movable camera.

#==============================================================================

 

class XCam

#--------------------------------------------------------------------------

# * Public Instance Variables

#--------------------------------------------------------------------------

attr_reader :x

attr_reader :y

attr_reader :z

attr_accessor :x_destination

attr_accessor :y_destination

attr_accessor :z_destination

attr_accessor :watch_battler

attr_accessor :freeze_count

#--------------------------------------------------------------------------

# * Object Initialization

#--------------------------------------------------------------------------

def initialize

# Camera initial position

@x = 320

@y = 240

@z = 296

# Calculation of largest range

@x_max = 0

@y_max = 0

@z_max = XRXS_BP8::GA_W * 37 / 128

# The largest restriction of Z

@z = @z_max if @z > @z_max

# Camera: Centering

self.centering

# Initialization

@freeze_count = 0

end

#--------------------------------------------------------------------------

# * Frame Update

#--------------------------------------------------------------------------

def update

@moved = false

# Renew of camera position

if @freeze_count > 0

# Freezing count is decreased

@freeze_count -= 1

return

end

# Coordinate acquisition

z_dest = @z_destination

x_dest = @watch_battler == nil ? @x_destination : @watch_battler.x

y_dest = @watch_battler == nil ? @y_destination : 88 + @watch_battler.y/2

# Camera: Z coordinate (priority)

if @z != z_dest

@z = slide(@z, z_dest, @z_speed, 37, @z_max)

@x_max = (@z_max - @z) * 64 / 37

@y_max = (@z_max - @z) * 48 / 37

@moved = true

end

# Camera: X coordinate

if @x != x_dest or @moved

@x = slide(@x, x_dest, @x_speed, 320 - @x_max, 320 + @x_max)

@moved = true

end

# Camera: Y coordinate

if @y != y_dest or @moved

@y = slide(@y, y_dest, @y_speed, 240 - @y_max, 240 + @y_max)

@moved = true

end

end

#--------------------------------------------------------------------------

# * Sliding (Action returned = 'current location' to 'destination location')

#--------------------------------------------------------------------------

def slide(from, to, move_speed, to_min, to_max)

# Distinguishing the result

if (to - from).abs < move_speed

result = to

else

sign = from > to ? -1 : 1

result = from + sign * move_speed

end

# Return with the range

return [[result, to_min].max, to_max].min

end

#--------------------------------------------------------------------------

# * Moved?

#--------------------------------------------------------------------------

def moved?

return @moved

end

#--------------------------------------------------------------------------

# * Set Speed

#--------------------------------------------------------------------------

def set_speed

x_dest = @watch_battler == nil ? @x_destination : @watch_battler.x

y_dest = @watch_battler == nil ? @y_destination : 88 + @watch_battler.y/2

z_dest = @z_destination

@x_speed = [[(x_dest - @x).abs / XRXS_BP8::SPEED1, 1].max, XRXS_BP8::SPEED2].min

@y_speed = [[(y_dest - @y).abs / XRXS_BP8::SPEED1, 1].max, XRXS_BP8::SPEED2].min

@z_speed = [[(z_dest - @z).abs / XRXS_BP8::SPEED1, 1].max, XRXS_BP8::SPEED2].min

end

#--------------------------------------------------------------------------

# * Centering

#--------------------------------------------------------------------------

def centering

@watch_battler = nil

@x_destination = 320

@y_destination = 240

@z_destination = 185

set_speed

end

#--------------------------------------------------------------------------

# * Zoom Out

#--------------------------------------------------------------------------

def zoomout

@z_destination = 222

set_speed

end

#--------------------------------------------------------------------------

# * Watch

#--------------------------------------------------------------------------

def watch(battler)

@watch_battler = battler

@z_destination = 180

set_speed

end

#--------------------------------------------------------------------------

# * Watch At

#--------------------------------------------------------------------------

def watch_at(x)

@watch_battler = nil

@x_destination = x

@y_destination = 240

@z_destination = 185

set_speed

end

#--------------------------------------------------------------------------

# * Zoom

#--------------------------------------------------------------------------

def zoom

return 185.00 / self.z

end

end

 

 

#==============================================================================

# ** Game_Battler

#------------------------------------------------------------------------------

# This class deals with battlers. It's used as a superclass for the Game_Actor

# and Game_Enemy classes.

#==============================================================================

class Game_Battler

 

#--------------------------------------------------------------------------

# * Public Instance Variables

#--------------------------------------------------------------------------

attr_reader :x # Battlefield side position (+ to the right)

attr_reader :y # Battlefield height position (+ lower)

attr_reader :z # Battlefield depth position (+ forewards)

#--------------------------------------------------------------------------

# * In Battlefield?

#--------------------------------------------------------------------------

def in_battlefield?

return false

end

end

 

 

#==============================================================================

# ** Game_Enemy

#------------------------------------------------------------------------------

# This class handles enemies. It's used within the Game_Troop class

# ($game_troop).

#==============================================================================

class Game_Enemy < Game_Battler

 

#--------------------------------------------------------------------------

# * In Battlefield

#--------------------------------------------------------------------------

def in_battlefield?

return true

end

#--------------------------------------------------------------------------

# * Object Initialization

# troop_id : troop ID

# member_index : troop member index

#--------------------------------------------------------------------------

alias xrxs_bp8_initialize initialize

def initialize(troop_id, member_index)

@z = 0

xrxs_bp8_initialize(troop_id, member_index)

end

#--------------------------------------------------------------------------

# * Get Battle Screen X-Coordinate

#--------------------------------------------------------------------------

alias x screen_x

def screen_x

return self.x if $xcam == nil

return 320 + (self.x - $xcam.x) * 185 / $xcam.z

end

#--------------------------------------------------------------------------

# * Get Battle Screen Y-Coordinate

#--------------------------------------------------------------------------

alias y screen_y

def screen_y

return self.y if $xcam == nil

return 240 + (self.y - $xcam.y) * 185 / $xcam.z

end

end

 

 

#==============================================================================

# ** Spriteset_Battle

#------------------------------------------------------------------------------

# This class brings together battle screen sprites. It's used within

# the Scene_Battle class.

#==============================================================================

class Spriteset_Battle

 

#--------------------------------------------------------------------------

# ○ Frame Update (movable camera)

#--------------------------------------------------------------------------

def update_xcam

# If the camera position moved

if $xcam.moved?

# Calculating zoom rate from camera position

zoom = 185.00 / $xcam.z

w = XRXS_BP8::GA_W / 2

h = w * 3 / 4

# Setting renewal of background

@battleback_sprite.zoom_x = zoom

@battleback_sprite.zoom_y = zoom

@battleback_sprite.x = (320 - $xcam.x) * zoom - w * (zoom - 1)

@battleback_sprite.y = (240 - $xcam.y) * zoom - h * (zoom - 1)

end

end

end

 

 

#==============================================================================

# --- Battle Sprite movable camera application ---

#==============================================================================

module XRXS_Cam_Deal

def update

# Recalls

super

# Return if the battler is not in the battlefield

return if @battler == nil or not @battler.in_battlefield?

# Return if the bitmap is empty

return if self.bitmap == nil

# Modifies the zoom rate (the sprite coordinate & camera zoom)

zoom = 1.00 * 185 / (185 - @battler.z)

self.zoom_x = zoom * $xcam.zoom

self.zoom_y = zoom * $xcam.zoom

end

end

 

class Sprite_Battler < RPG::Sprite

include XRXS_Cam_Deal

end

 

#==============================================================================

# --- Damage following module ---

#==============================================================================

module XRXS_DamageFollow

def update

# Recalls

super

# Return if no camera

return if $xcam == nil

# Return if no battler sprite or battler not in the battlefield

return if @battler == nil or not @battler.in_battlefield?

# Calculate the moving values

x_moved = @last_cam_x == nil ? 0 : $xcam.x - @last_cam_x

y_moved = @last_cam_y == nil ? 0 : $xcam.y - @last_cam_y

# Compile thef damage sprite arrangement

damage_sprites = [@_damage_sprite]

damage_sprites += @damage_sprites if @damage_sprites != nil

# Following camera

for sprite in damage_sprites

next if sprite == nil

next if sprite.disposed?

sprite.x -= x_moved

sprite.y -= y_moved

end

# Retain the original camera position

@last_cam_x = $xcam.x

@last_cam_y = $xcam.y

end

end

 

class Sprite_Battler < RPG::Sprite

include XRXS_DamageFollow

end

 

#==============================================================================

# ** Scene_Battle (part 1)

#------------------------------------------------------------------------------

# This class performs battle screen processing.

#==============================================================================

class Scene_Battle

#--------------------------------------------------------------------------

# * Main Processing

#--------------------------------------------------------------------------

alias xrxs_bp8_main main

def main

# Formation of movable camera

$xcam = XCam.new

# Original Call

xrxs_bp8_main

# Release the movable camera

$xcam = nil

end

#--------------------------------------------------------------------------

# * Frame Update

#--------------------------------------------------------------------------

alias xrxs_bp8_update update

def update

# Update the movable camera

$xcam.update

# Original Call

xrxs_bp8_update

end

end

 

 

#------------------------------------------------------------------------------

#

# * Full-View System *

#

#==============================================================================

# ** Spriteset_Battle

#------------------------------------------------------------------------------

# This class brings together battle screen sprites. It's used within

# the Scene_Battle class.

#==============================================================================

 

class Spriteset_Battle

#--------------------------------------------------------------------------

# * Object Initialization

#--------------------------------------------------------------------------

alias xrxs_bp8_initialize initialize

def initialize

# Original Call

xrxs_bp8_initialize

# Acquiring graphic array

# Drawing up viewport 0

w = XRXS_BP8::GA_W

h = w * 3 / 4

x = 320 - w / 2

y = 240 - h / 2

@viewport0 = Viewport.new(x, y, w, h)

@viewport0.z = 0

# Modifying viewport 1

@viewport1.z += 1

@viewport1.rect.height = 480

# Battleback Recompilation (viewport 0 use)

@battleback_sprite.dispose

@battleback_sprite = Sprite.new(@viewport0)

@battleback_name = ""

# Update Battleback

update_battleback

end

#--------------------------------------------------------------------------

# * Dispose

#--------------------------------------------------------------------------

alias xrxs_bp8_dispose dispose

def dispose

# Original Call

xrxs_bp8_dispose

# Dispose viewport

@viewport0.dispose

end

#--------------------------------------------------------------------------

# * Frame Update

#--------------------------------------------------------------------------

alias xrxs_bp8_update update

def update

# Frame Renewal (battle back)

update_battleback

# If camera exists, Frame renewal (movable camera)

update_xcam if defined? update_xcam

# Original Call

xrxs_bp8_update

# Setting the shake position of the picture

@viewport0.ox = $game_screen.shake if @viewport0 != nil

end

#--------------------------------------------------------------------------

# * Update Battleback

#--------------------------------------------------------------------------

def update_battleback

# If file name is different from the current one

if @battleback_name != $game_temp.battleback_name

@battleback_name = $game_temp.battleback_name

if @battleback_sprite.bitmap != nil

@battleback_sprite.bitmap.dispose

end

# Acquiring graphic array

w = XRXS_BP8::GA_W

h = w * 3 / 4

# Obtain and resize the battleback

bg = RPG::Cache.battleback(@battleback_name)

xga = Bitmap.new(w, h)

xga.stretch_blt(xga.rect, bg, bg.rect)

# Apply the settings to the battleback

@battleback_sprite.bitmap = xga

end

end

end

 

#==============================================================================

# ---"If fighting," position correction module of picture "animation" ---

#==============================================================================

module XRXS_FullScreen_AnimationOffset

def animation_set_sprites(sprites, cell_data, position)

super

for i in 0..15

sprite = sprites

pattern = cell_data[i, 0]

if sprite == nil or pattern == nil or pattern == -1

next

end

if position == 3

if self.viewport != nil

sprite.y = 160 # Just this one line modification

sprite.y += cell_data[i, 2]

end

end

end

end

end

 

class Sprite_Battler < RPG::Sprite

include XRXS_FullScreen_AnimationOffset

end

 

 

 

 

 

http://files.nireblog.com/blogs4/narutozorro9kolas/files/firma-naruto-y-yondaime.gif

 

 

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...