#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Magica Scroll System
# Version: 1.0
# Type: Custom System
# Made by : Dark Dragon
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# ==================================================================
# Creat the window and animation methods..
# ===================================================================
class Window_BattelAttack < Window_Base
def initialize
super(0,0,600,450)
self.windowskin = Cache.system("Window")
self.opacity = 0
end
def fill_data(x,y,aa)
self.contents.font.name = "Arial"
self.contents.font.color = text_color(6)
self.contents.font.size = 30
self.contents.draw_text(x,y,400,32,aa)
self.contents.font.size = 18
end
def add_sprite(character)
@sprite = Sprite.new
@sprite.bitmap = Cache.face(character.name)
@sprite.opacity = 150
@sprite.x = -300
loop do
unless @sprite.x == 0
Graphics.wait(1)
@sprite.x +=20
else
break
end
end
# ===================================================================
# Weapon display
# ===================================================================
# If you want to remove the weapon display display all you have to do is remove this block
#and the other one in the "retreat_sprite method"
# ===================================================================
@sprite2 = Sprite.new
@sprite2.bitmap = Cache.face($data_weapons[character.weapon_id].name)
@sprite2.opacity = 150
@sprite2.x = 600
loop do
unless @sprite2.x == 100
Graphics.wait(1)
@sprite2.x -=20
else
break
end
end
# ===================================================================
end # Do not remove this line..
def retreat_sprite
loop do
unless @sprite.x == -300
Graphics.wait(1)
@sprite.x -=20
else
break
end
end
# ===================================================================
# Weapon Sprite Retreat
# ===================================================================
# If you removed the weapon display block above, then you should remove this one as well
# ===================================================================
loop do
unless @sprite2.x == 600
Graphics.wait(1)
@sprite2.x +=20
else
break
end
end
end
# ===================================================================
end # Do not remove this line..
# ==================================================================
# ==================================================================
# Edit of the Scene_Battle class, if you have any compability issues contact me through email
# ==================================================================
class Scene_Battle < Scene_Base
# Determine the flash animation ids through these two constants
FLASH_SCREEN_ID = 81
FLASH_TARGET_ID = 82
# ==================================================================
def start
super
$game_temp.in_battle = true
@spriteset = Spriteset_Battle.new
@message_window = Window_BattleMessage.new
@stats_window = Window_BattelAttack.new
@stats_window.visible = false
@action_battlers = []
create_info_viewport
end
def execute_action_attack
targets = @active_battler.action.make_targets
@stats_window.contents.clear
unless @active_battler.weapon_id == nil
screen_flash_animation(targets)
@stats_window.add_sprite(@active_battler)
@stats_window.fill_data(0,0,@active_battler.name)
@stats_window.fill_data(300,0, $data_weapons[@active_battler.weapon_id].name)
target_flash_animation(targets)
end
@stats_window.visible = true
wait(1)
text = sprintf(Vocab::DoAttack, @active_battler.name)
@message_window.add_instant_text(text)
display_attack_animation(targets)
wait(20)
for target in targets
target.attack_effect(@active_battler)
display_action_effects(target)
end
unless @active_battler.weapon_id == nil
@stats_window.retreat_sprite
end
@stats_window.contents.clear
end
def screen_flash_animation(targets)
if @active_battler.is_a?(Game_Enemy)
Sound.play_enemy_attack
wait(15, true)
else
aid1 = @active_battler.atk_animation_id
aid2 = @active_battler.atk_animation_id2
display_flash_screen_animation(targets, aid1, false)
display_flash_screen_animation(targets, aid2, true)
end
wait_for_animation
end
def target_flash_animation(targets)
if @active_battler.is_a?(Game_Enemy)
Sound.play_enemy_attack
wait(15, true)
else
aid1 = @active_battler.atk_animation_id
aid2 = @active_battler.atk_animation_id2
display_flash_target_animation(targets, aid1, false)
display_flash_target_animation(targets, aid2, true)
end
wait_for_animation
end
def display_flash_screen_animation(targets, animation_id, mirror = false)
animation = $data_animations[animation_id]
if animation != nil
to_screen = (animation.position == 3)
for target in targets.uniq
target.animation_id =FLASH_SCREEN_ID
target.animation_mirror = mirror
wait(20, true) unless to_screen
end
wait(20, true) if to_screen
end
end
def display_flash_target_animation(targets, animation_id, mirror = false)
animation = $data_animations[animation_id]
if animation != nil
to_screen = (animation.position == 3)
for target in targets.uniq
target.animation_id = FLASH_TARGET_ID
target.animation_mirror = mirror
wait(20, true) unless to_screen
end
wait(20, true) if to_screen
end
end
end
# ====================================================================
# Edit the Game_Enemy class so that it supports another attribute called weapon_id
# So that when the Scne_Battle checks on it it returns nil
# ====================================================================
class Game_Enemy < Game_Battler
attr_accessor :weapon_id
end
# ===================================================================
Comments (0)