0.0/5 rating (0 votes)
Hits: 3363

Blitz

Saturday, 11 April 2009
  • Author: Dargor
  • Version: 1.1
  • Release Date: 08/06/08

Introduction

I originally made this script for my Final Fantasy VI SDK and I felt like I had to to it for VX. "Blitz" is a battle command also called "Deathblows" in FF6J. You guessed it, It requires my Custom Commands script!

Custom Commands Script

How does it works? When selecting the Blitz command, you must Input a series of keys, like UP-Down-Up-L-R, to cast a skill. Obviously, the actor must have learned the skill before casting it and the input must be right. No Timing is required but if the input is wrong, nothing will happen and the actor will lose it's turn.

Screenshots

Script Download

  • Hits: 11

The Script

 #==============================================================================
# ** Blitz
#------------------------------------------------------------------------------
#  © Dargor, 2008
#  08/06/08
#  Version 1.1
#------------------------------------------------------------------------------
#  VERSION HISTORY:
#   - 1.0 (27/05/08), Initial release
#   - 1.1 (08/06/08), Updated to work with Custom Commands 1.5+
#------------------------------------------------------------------------------
#  INSTRUCTIONS:
#   - Paste this above main
#   - Edit the constants in Blitz module  
#------------------------------------------------------------------------------
#  INPUT KEYS:
#     12 keys are available. Here's the list of the 12 different keys
#     with their code.
#       - DOWN:         '2'
#       - LEFT:         '4'
#       - RIGHT:        '6'
#       - UP:           '8'
#       - DOWN-LEFT:    '1'
#       - UP-LEFT:      '3'
#       - UP-RIGHT:     '7'
#       - DOWN-RIGHT:   '9'
#       - PageUP(L):    'L'
#       - PageDOWN(R):  'R'
#       - SHIFT(A):     'A'
#       - X(X):         'X'
#==============================================================================

# Command name
Vocab::CommandBlitz = 'Blitz'
Vocab::IncorrectBlitz = 'Incorrect Blitz input!'

#==============================================================================
# ** Blitz Customization Module
#==============================================================================

module Blitz
 # Inputs Code
 # SYNTAX: Skill_ID => [CODE]
 Inputs = {
           75 => ['4','6','4'],
           76 => ['2','1','4'],
           77 => ['L','R','2','8'],
           78 => ['4','1','2','3','6'],
           79 => ['R','L','R','L','A','X'],
           80 => ['8','9','6','3','2','1','4'],
           81 => ['R','L','A','X','6','4'],
           82 => ['4','7','8','9','6','3','2','1','4',]
          }
 Actors = [1,2]
end

#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#  This class handles actors. It's used within the Game_Actors class
# ($game_actors) and referenced by the Game_Party class ($game_party).
#==============================================================================

class Game_Actor < Game_Battler
 #--------------------------------------------------------------------------
 # * Alias Listing
 #--------------------------------------------------------------------------
 alias dargor_vx_blitz_actor_setup setup
 #--------------------------------------------------------------------------
 # * Setup
 #     actor_id : actor ID
 #--------------------------------------------------------------------------
 def setup(actor_id)
   dargor_vx_blitz_actor_setup(actor_id)
   # Add battle commands
   if Blitz::Actors.include?(@actor_id)
     # Add 'Burst' to actor 1
     add_command(0, self.class.command_name(Vocab::CommandBlitz))
   end
 end
end

#==============================================================================
# ** Game_BattleAction
#------------------------------------------------------------------------------
#  This class handles battle actions. This class is used within the
# Game_Battler class.
#==============================================================================

class Game_BattleAction
 #--------------------------------------------------------------------------
 # * Alias Listing
 #--------------------------------------------------------------------------
 alias dargor_vx_blitz_action_clear clear
 #--------------------------------------------------------------------------
 # * Clear
 #--------------------------------------------------------------------------
 def clear
   dargor_vx_blitz_action_clear
   @blitz = false
   @incorrect_blitz = false
 end
 #--------------------------------------------------------------------------
 # * Set Blitz
 #     skill_id : skill ID
 #--------------------------------------------------------------------------
 def set_blitz(skill_id)
   @kind = 1
   @skill_id = skill_id
   @blitz = true
   @incorrect_blitz = false
 end
 #--------------------------------------------------------------------------
 # * Set Blitz
 #     skill_id : skill ID
 #--------------------------------------------------------------------------
 def set_incorrect_blitz(skill_id)
   set_blitz(skill_id)
   @incorrect_blitz = true
 end
 #--------------------------------------------------------------------------
 # * Blitz Determination
 #--------------------------------------------------------------------------
 def blitz?
   return @kind == 1 && @blitz
 end
 #--------------------------------------------------------------------------
 # * Incorrect Blitz Determination
 #--------------------------------------------------------------------------
 def incorrect_blitz?
   return @kind == 1 && @blitz && @incorrect_blitz
 end
end

#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
#  This class performs battle screen processing.
#==============================================================================

class Scene_Battle < Scene_Base
 #--------------------------------------------------------------------------
 # * Alias Listing
 #--------------------------------------------------------------------------
 alias dargor_vx_blitz_update_actor_command_selection update_actor_command_selection
 alias dargor_vx_blitz_update update
 alias dargor_vx_blitz_execute_action_skill execute_action_skill
 #--------------------------------------------------------------------------
 # * Update Actor Command Selection
 #--------------------------------------------------------------------------
 def update_actor_command_selection
   dargor_vx_blitz_update_actor_command_selection
   if Input.trigger?(Input::C)
     case @actor_command_window.commands[@actor_command_window.index]
     when @active_battler.class.command_name(Vocab::CommandBlitz)
       Sound.play_decision
       start_blitz_selection
     end
   end
 end
 #--------------------------------------------------------------------------
 # * Frame Update
 #--------------------------------------------------------------------------
 def update
   if @blitz_window.nil?
     dargor_vx_blitz_update
   else
     super
     update_basic(true)
     update_info_viewport                  # Update information viewport
     if $game_message.visible
       @info_viewport.visible = false
       @message_window.visible = true
     end
     unless $game_message.visible          # Unless displaying a message
       return if judge_win_loss            # Determine win/loss results
       update_scene_change
       if @blitz_window.active
         update_blitz_selection            # Select party changer command
       end
     end
   end
 end
 #--------------------------------------------------------------------------
 # * Start Blits Selection
 #--------------------------------------------------------------------------
 def start_blitz_selection
   @input = []
   @actor_command_window.active = false
   @help_window = Window_Help.new
   @help_window.set_text('Blitz Input...',1)
   @help_window.pause = true
   @blitz_window = Window_Command.new(128,[''],1,1)
   @blitz_window.visible = false
   @blitz_window.active = true
 end
 #--------------------------------------------------------------------------
 # * Update Blitz Selection
 #--------------------------------------------------------------------------
 def update_blitz_selection
   @help_window.update
   if Input.trigger?(Input::B)
     Sound.play_cancel
     end_blitz_selection
     return
   end
   if Input.trigger?(Input::C)
     Sound.play_decision
     if Blitz::Inputs.has_value?(@input)
       skill_id = Blitz::Inputs.index(@input)
       if @active_battler.skill_learn?($data_skills[skill_id])
         @active_battler.action.set_blitz(skill_id)
         @active_battler.action.forcing = true
       else
         @active_battler.action.set_incorrect_blitz(1)
         @active_battler.action.forcing = true
       end
     else
       @active_battler.action.set_incorrect_blitz(1)
       @active_battler.action.forcing = true
     end
     end_blitz_selection
     next_actor
     return
   end
   update_blitz_input
 end
 #--------------------------------------------------------------------------
 # * End Blitz Selection
 #--------------------------------------------------------------------------
 def end_blitz_selection
   @blitz_window.dispose
   @blitz_window = nil
   @help_window.dispose
   @help_window = nil
   @input = []
 end
 #--------------------------------------------------------------------------
 # * Update Blitz Input
 #--------------------------------------------------------------------------
 def update_blitz_input
   return if @input.nil?
   case Input.dir8
   when 1,2,3,4,6,7,8,9
     unless @input[@input.size-1] == "#{Input.dir8}"
       Sound.play_cursor
       @input << "#{Input.dir8}"
     end
   end
   if Input.trigger?(Input::X) or Input.press?(Input::X)
     unless @input[@input.size-1] == 'X'
       Sound.play_cursor
       @input << 'X'
     end
   end
   if Input.trigger?(Input::A) or Input.press?(Input::A)
     unless @input[@input.size-1] == 'A'
       Sound.play_cursor
       @input << 'A'
     end
   end
   if Input.trigger?(Input::L) or Input.press?(Input::L)
     unless @input[@input.size-1] == 'L'
       Sound.play_cursor
       @input << 'L'
     end
   end
   if Input.trigger?(Input::R) or Input.press?(Input::R)
     unless @input[@input.size-1] == 'R'
       Sound.play_cursor
       @input << 'R'
     end
   end
 end
 #--------------------------------------------------------------------------
 # * Execute Battle Action: Skill
 #--------------------------------------------------------------------------
 def execute_action_skill
   if @active_battler.action.incorrect_blitz?
     text = Vocab::IncorrectBlitz
     wait(10)
     @message_window.add_instant_text(text)
     wait(60)
     return
   else
     dargor_vx_blitz_execute_action_skill
   end
 end
end 

Author Notes

If a key is not working, try changing it by pressing F1 while in game, in the Keyboard tab. Don't forget to credit me!

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