0.0/5 rating (0 votes)
Hits: 2577

Attack Face Add-on to the main Battle System

Monday, 13 April 2009
  • Author: Dark Dragon
  • Version: 1.0

Introduction

This script makes the battle scene show the characters whole body in a smooth slide in with a flash to add some chunky flavor of action to your battle system, I cant explain you'll have to download the demo =3

Screenshots

Video

Get Adobe Flash player

Script Download

  • Hits: 14

The Script

 #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# 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
# =================================================================== 

Instructions

Post the script above main and under the Battle Scene..
Don't forget to make two animations one for the screen flash and one for the target flash
don't forget to add the battler sprite of all the battlers in the "Faces" folder with the same character name.

Credits & Thanks

Me =P

Author Notes

My MSN : denarto0o0@hotmail.com
contact me if you need anything through that, this is probably my last thing with the RPG Maker series
I'm quitting and going for the Torque Game Engine now =3

Comments (0)

Leave a comment

Please login to leave a comment.

Archive Stats

Login to remove our Sponsored Links.

Latest Comments

  • I added screens. Everytime you test run the game, your data is backed up. Prevents the error you get when you open your game and it says...
    Marked

    Marked

    26. August, 2010 |

  • I did't understood what does this script ?
    chinas

    chinas

    25. August, 2010 |

Affiliates