blackspets
Member
http://#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Blizz-ABS by Blizzard
# Version: 1.73
# Type: Advanced Action Battle System
# Date v1.00: 19.04.2007
# Date v1.01: 30.04.2007
# Date v1.02: 17.07.2007
# Date v1.04: 25.07.2007
# Date v1.09: 25.07.2007
# Date v1.20: 29.07.2007
# Date v1.23: 30.07.2007
# Date v1.24: 05.08.2007
# Date v1.60: 05.09.2007
# Date v1.61: 06.09.2007
# Date v1.62: 07.09.2007
# Date v1.63: 11.09.2007
# Date v1.64: 11.09.2007
# Date v1.65: 12.09.2007
# Date v1.66: 10.10.2007
# Date v1.67: 16.10.2007
# Date v1.69: 31.10.2007
# Date v1.70: 13.11.2007
# Date v1.71: 22.11.2007
# Date v1.72: 10.12.2007
# Date v1.73: 11.12.2007
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# Explanation:
#
#Â This script will allow you to create games with an Action Battle System
#Â (ABS) (i.e. Zelda). Action Battle System means real time battle on the map.
#
#Â If you don't read the Manual, you will not be able to use many of the great
#Â features this ABS supports.
#
#Â You didn't get a Manual with the Blizz-ABS? Please e-mail me, tell me where
#Â you got this script from and I will give you a download link to the manual.
#Â Here is my e-mail:
#Â boris_blizzard@yahoo.de
#
#
# Compatibility:
#
#Â 80% compatible with SDK 1.x. 40% compatible with SDK 2.x. Compatible with
#Â any CMS. Mostly is not compatible with any battle add-ons for the normal
#Â turn based battle system. WILL corrupt your old save games. Incompatible
#Â with the RGSS100J.dll.
#
#
# IMPORTANT:
#
#Â Any CMS is being overriden, so put this script UNDER the CMS script if you
#Â are using a CMS script (CMS = Custom Menu System). This script overrides
#Â Tons of Add-ons and goes under it.
#
#
# Special Thanks for testing to:
#
#Â - Leonharts
#Â - modern algebra
#Â - NAMKCOR
#Â - Rune
#Â - Irockman1
#Â - blazinhandling
#Â - Zeph
#
#
# If you find any bugs, please report them here:
# http://www.chaosproject.co.nr
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#==============================================================================
# BlizzABS
#------------------------------------------------------------------------------
#Â This is the master control, configuration, utility and battle process
#Â module for Blizz-ABS.
#==============================================================================
module BlizzABS
Â
 #============================================================================
 # BlizzABS::Control
 #----------------------------------------------------------------------------
 # This module provides in-game control configurations.
 #============================================================================
Â
 module Control
 Â
  # using other controls instead of arrow keys
  CUSTOM_CONTROLS = false
  # RMXP default controls will be replaced completely with Blizz-ABS controls
  DISABLE_DEFAULT = true
  # you can skip this if you have set CUSTOM_CONTROLS to false
  # setup the controls as array, but with prefix and suffix "
  # i.e.: Let T and R be for cancel => CANCEL = "[Let['T'], Let['R']]"
  # for more info about read 1.1.1. of the manual
  UP   = "[Let['W']]" # move up
  LEFT  = "[Let['A']]" # move left
  DOWN  = "[Let['S']]" # move down
  RIGHT  = "[Let['D']]" # move right
  PREVPAGE = "[Let['Q']]" # previous page
  NEXTPAGE = "[Let['E']]" # next page
  CONFIRM = "[Let['H']]" # confirm selections / pick up items
  CANCEL = "[Let['F']]" # cancel selections
  ATTACK = "[Let['K']]" # attacking
  DEFEND = "[Let['L']]" # defending (hold)
  SKILL  = "[Let['J']]" # use skill
  ITEM  = "[Let['I']]" # use item
  SELECT = "[Let['O']]" # change leader
  HUD   = "[Let['Z']]" # HUD on/off if enabled
  HOTKEY = "[Let['X']]" # hotkey display on/off if enabled
  MINIMAP = "[Let['C']]" # toggle minimap mode if enabled
  RUN   = "[Let['M']]" # running (hold)
  SNEAK  = "[Dot]"   # sneaking (hold)
  JUMP  = "[Comma]"  # jumping
  TURN  = "[Let['U']]" # turning around without moving (hold)
 end
Â
 #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 # BlizzABS::Config
 #----------------------------------------------------------------------------
 # This module provides Blizz-ABS configurations.
 #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Â
 module Config
 Â
  # should party members follow the leader on the map
  CATERPILLAR = true
  # how many party member do you use
  MAX_PARTY = 4
  # include all actor IDs who are animated when standing
  ANIMATED_IDS = []
  # 0 -> 32 pixel tiles, 1 -> 16, 2 -> 8, 3 -> 4, 4 -> 2, 5 -> 1
  # careful anything higher than 1 will limit the max speed of char movement
  # 0 - max: 6, 1 - max: 6, 2 - max: 5, 3 - max: 4, 4 - max: 3, 5 - max: 2
  # I recommend using 2 if you have allies else you can use 3
  # note that this can also cause problems with running and sneaking
  PIXEL_MOVEMENT_RATE = 0
  # will make the force movement command ALWAYS work for 32 pixel tiles
  REPAIR_MOVEMENT = true
  # enable or disable moving in all 8 directions
  EIGHT_WAY_MOVEMENT = false
  # the normal moving speed (4 is default)
  NORMAL_SPEED = 4
  # the speed of running (set to 0 to disable)
  RUN_SPEED = 5
  # the speed of sneaking (set to 0 to disable)
  SNEAK_SPEED = 3
  # how many squares should the player jump (set to 0 to disable)
  JUMPING = 2
  # the terrain tag of tiles where the player can't jump over
  JUMP_TAG = 8
  # measured in map squares
  PERCEPTION_RANGE = 5
  # the terrain tag of "walls" (enemies can't see through walls, only hear)
  WALL_TAG = 8
  # turns HUD on or off
  HUD_ENABLED = true
  # 0, 1, or 2 (slightly different drawing method of the bars)
  HUD_TYPE = 0
  # 0 = upper left corner, 1 = upper right corner
  HUD_POSITION = 0
  # enables minimap
  MINIMAP = true
  # enables intelligent minimap to save map loading time
  INTELLIGENT_PASSABILTY = true
  # how much time will pass until an enemy respawns (0 for no respawn)
  RESPAWN_TIME = 10
  # the terrain tag of tiles where enemies can't respawn
  NO_ENEMY_TAG = 8
  # how many seconds will dropped stuff stay (0xFFFF for "infinite")
  ITEM_TIME = 30
  # sound played when picking up items ("NAME", VOLUME, PITCH)
  ITEM_PICKUP_SOUND_FILE = RPG::AudioFile.new('056-Right02', 80, 100)
  # makes enemies drop gold, specify an icon for display here
  DROP_GOLD = ''
  # map IDs where ABSEAL is disabled
  DISABLE_ANTI_LAG_IDS = []
  # strength of delag (1 is most powerful and not recommended)
  FACTOR = 3
  # stops update of events with no spriteset
  ABSEAL_AUTOKILL = true
  # restores the character's HP/SP/Status on Level Up
  HEAL_ON_LVLUP = true
  # displays LvUp on Level Up
  DISPLAY_LVLUP = true
  # animation ID of the animation shown when a player levels up
  LVLUP_ANIMATION_ID = 0
  # animation ID of the animation shown when an enemy is on the run
  FLEE_LOOP_ANIMATION_ID = 0
  # shows attack/skill/item animation
  ANIMATIONS = true
  # enables or disables the sprites during action of for actors
  ACTOR_ACTION_SPRITES = false
  # enables or disables the sprites during action of enemies
  ENEMY_ACTION_SPRITES = false
  # enables or disables the extra sprites for each weapon (actors only)
  WEAPON_SPRITES = false
  # enables or disables the sprites during running (player and allies)
  RUNNING_SPRITES = false
  # enables or disables the sprites during sneaking (player and allies)
  SNEAKING_SPRITES = false
  # enables or disables the sprites during sneaking (player and allies)
  JUMPING_SPRITES = false
  # small animations (set to true to size animations down to 50%)
  SMALL_ANIMATIONS = true
  # use also different tint colors for the pre-menu
  MENU_COLOR_TINT = 0
  # attack sprite (for actors), first row y offset if necessary
  ACTOR_SPRITE_Y_OFFSET = 0
  # attack sprite (for enemies), first row y offset if necessary
  ENEMY_SPRITE_Y_OFFSET = 0
  # 0 = never, 1 = no enemies, 2 = enemies dead, 3 = enemies within ABSEAL dead
  DISABLE_ABS_MODE = 1
  # [type, range], 0 = no data, 1 = in name, 2 = in description
  WEAPON_DATA_MODE = [0, 0]
  # [type, explode range, range] 0 = no data, 1 = in name, 2 = in description
  SKILL_DATA_MODE = [0, 0, 0]
  # [type, explode range, range] 0 = no data, 1 = in name, 2 = in description
  ITEM_DATA_MODE = [0, 0, 0]
 end
Â
 #============================================================================
 # BlizzABS::Weapons
 #----------------------------------------------------------------------------
 # This module provides weapon configurations.
 #============================================================================
Â
 module Weapons
 Â
  #--------------------------------------------------------------------------
  # type
  # id - weapon ID
  # This method serves as database for weapon types.
  # 0 = sword / axe / claws / unarmed / etc. (damages in close front)
  # 1 = spear / lance (damages only in front)
  # 2 = flail (distant weapon, does not damage close enemies, front)
  # 3 = boomerang (returning projectile weapon, front)
  # 4 = bow and arrows / gun / shuriken (non-returning projectile, NO consumption)
  # 5 = bow and arrows / gun (non-returning projectile, consumes AMMUNITION)
  # 6 = shuriken (non-returning projectile, consumes ITSELF)
  #--------------------------------------------------------------------------
  def self.type(id)
   case id
   # START set up weapon types (when ID then return TYPE)
   when 1 then return 0
   # END
   end
   return 0
  end
  #--------------------------------------------------------------------------
  # range
  # id - weapon ID
  # This method serves as database for weapon ranges. All ranges are
  # measured in map squares. Any decimal value WILL have its effect if
  # pixel movement is being used.
  #--------------------------------------------------------------------------
  def self.range(id)
   case id
   # START set up weapon ranges (when ID then return RANGE)
   when 1 then return 1.5
   # END
   end
   return 1.5
  end
  #--------------------------------------------------------------------------
  # consume
  # id - weapon ID
  # Lets your weapons consume items to work. You must have the item assigned
  # as your hot item for the weapon to work. One weapon can consumes
  # different items. If you don't have any items left, the attack will fail.
  # Allies' items for usage can be set up directly or over the AI menu.
  #--------------------------------------------------------------------------
  def self.consume(id)
   case id
   # START set up ammo consumption (when ID then return ID_ARRAY)
   when 1 then return []
   # END
   end
   return []
  end
 end
Â
 #============================================================================
 # BlizzABS::Skills
 #----------------------------------------------------------------------------
 # This module provides skill configurations.
 #============================================================================
Â
 module Skills
 Â
  #--------------------------------------------------------------------------
  # type
  # id - skill ID
  # Lets you define how skills will be executed.
  # 0 = shooting skill (projectile skill, hits first target it encounters)
  # 1 = homing skill (projectile skill, finds a target you specify)
  # 2 = direct skill (hits the target instantly, you select the target)
  # 3 = beam skill (hits every target it goes through instantly)
  # If a skill targets all enemies/allies, the skill will turn into:
  # 0 => thrusting skill (projectile skill, hits every target it goes through)
  # 1 => super homing skill (projectiles hit all targets in range)
  # 2 => shockwave skill (circular shockwave hits all targets in range)
  # 3 => fullscreen skill (targets all allies/enemies on the screen)
  # Set the exploding range to 0 if you don't want anybody around to be
  # affected by this skill. A skill explosion does not differ between ally
  # and enemy. The animation ID can be skipped if no explosion range was
  # defined.
  #--------------------------------------------------------------------------
  def self.type(id)
   case id
   # START set up skill types (when ID then return [TYPE, EXPLODING_RANGE, ANIMATION_ID])
   when 1 then return [2, 0]
   # END
   end
   return [2, 0]
  end
  #--------------------------------------------------------------------------
  # range
  # id - skill ID
  # This method serves as database for skill ranges. All ranges are
  # measured in map squares. Any decimal value WILL have its effect if
  # pixel movement is being used. If the skill is a summon skill, this will
  # define the time in seconds how long the summoned ally will prevail.
  #--------------------------------------------------------------------------
  def self.range(id)
   case id
   # START set up skill ranges (when ID then return RANGE)
   when 1 then return 5.5
   # END
   end
   return 5.5
  end
 end
Â
 #============================================================================
 # BlizzABS::Items
 #----------------------------------------------------------------------------
 # This module provides item configurations.
 #============================================================================
Â
 module Items
 Â
  #--------------------------------------------------------------------------
  # type
  # id - item ID
  # 0 = shooting item (projectile item, hits first target it encounters)
  # 1 = homing item (projectile item, finds a target you specify)
  # 2 = direct item (hits the target instantly, you select the target)
  # 3 = beam item (hits every target it goes through instantly)
  # If a item targets all enemies/allies, the item will turn into:
  # 0 => thrusting item (projectile item, hits every target it goes through)
  # 1 => super homing item (projectiles hit all targets in range)
  # 2 => shockwave item (circular shockwave hits all targets in range)
  # 3 => fullscreen item (targets all allies/enemies on the screen)
  # Set the exploding range to 0 if you don't want anybody around to be
  # affected by this item. An item explosion does not differ between ally
  # and enemy.
  #--------------------------------------------------------------------------
  def self.type(id)
   case id
   # START set up skill types (when ID then return [TYPE, EXPLODING_RANGE, ANIMATION_ID])
   when 1 then return [2, 0]
   # END
   end
   return [2, 0]
  end
  #--------------------------------------------------------------------------
  # range
  # id - item ID
  # This method serves as database for item ranges. All ranges are
  # measured in map squares. Any decimal value WILL have its effect if
  # pixel movement is being used. If the item is a summon item, this will
  # define the time in seconds how long the summoned ally will prevail.
  #--------------------------------------------------------------------------
  def self.range(id)
   case id
   # START set up item ranges (when ID then return RANGE)
   when 1 then return 5.5
   # END
   end
   return 5.5
  end
 end
Â
 #============================================================================
 # BlizzABS::Enemies
 #----------------------------------------------------------------------------
 # This module provides special enemy configurations.
 #============================================================================
Â
 module Enemies
 Â
  #--------------------------------------------------------------------------
  # type
  # id - enemy ID
  # This method serves as database for enemy attack types.
  # 0 = damages in close front
  # 1 = damages only in front
  # 2 = distant weapon, does not damage close enemies, front
  # 3 = returning projectile weapon, front
  # 4 = projectile weapon
  #--------------------------------------------------------------------------
  def self.type(id)
   case id
   # START set up enemy attack types (when ID then return TYPE)
   when 1 then return 0
   # END
   end
   return 0
  end
  #--------------------------------------------------------------------------
  # range
  # id - enemy ID
  # This method serves as database for enemy attack ranges. All ranges are
  # measured in map squares. Any decimal value WILL have its effect if
  # pixel movement is being used.
  #--------------------------------------------------------------------------
  def self.range(id)
   case id
   # START set up enemy attack ranges (when ID then return RANGE)
   when 1 then return 1.5
   # END
   end
   return 1.5
  end
  #--------------------------------------------------------------------------
  # enemy_set
  # id - enemy ID
  # Specify spritesets for enemy projectile attacks. Spritesets are
  # auto-animated all the time.
  #--------------------------------------------------------------------------
  def self.enemy_set(id)
   case id
   # START set up enemy attack spritesets (when ID then return SPRITESET_NAME)
   when 1 then return ''
   # END
   end
   return ''
  end
  #--------------------------------------------------------------------------
  # destruct
  # id - enemy ID
  # Specify animation IDs for enemies to have a custom destruction sequence.
  # For any enemy that is not specified here the default Blizz-ABS fade out
  # will be displayed.
  #--------------------------------------------------------------------------
  def self.destruct(id)
   case id
   # START set up enemy destruct animations (when ID then return ANIMATION_ID)
   when 1 then return 0
   # END
   end
   return 0
  end
 end
Â
 #============================================================================
 # BlizzABS::Cache
 #----------------------------------------------------------------------------
 # This module holds a few bitmaps, so they don't need to be drawn each time
 # which improves speed and reduces lag. It also holds damage sprites and
 # Projectile Characters.
 #============================================================================
Â
 module Cache
 Â
  #--------------------------------------------------------------------------
  # load
  # Loads the cache images.
  #--------------------------------------------------------------------------
  def self.load
   # initialize image, damage sprite and projectile buffers
   @data, @damages, @projectiles = [], [], []
   # add image
   @data.push(self._minimap_autotile)
   # prevent "Script is hanging" error
   Graphics.update
   # add image
   @data.push(self._arrow)
   # prevent "Script is hanging" error
   Graphics.update
   # add image
   @data.push(self._white_arrow)
   # prevent "Script is hanging" error
   Graphics.update
   # add image
   @data.push(self._green_arrow)
   # prevent "Script is hanging" error
   Graphics.update
   # create 4 clones of the green arrow
   4.times {@data.push(@data[3].clone)}
   # temporary array for hue change
   tmp = [120, -120, -60, 150]
   # change the hues to blue, red, yellow and violet
   (0..3).each {|i| @data[i+4].hue_change(tmp)}
   # prevent "Script is hanging" error
   Graphics.update
  end
  #--------------------------------------------------------------------------
  # damages
  # Returns all currently displayed damage sprites.
  #--------------------------------------------------------------------------
  def self.damages
   return @damages
  end
  #--------------------------------------------------------------------------
  # projectiles
  # Returns all currently active projectiles.
  #--------------------------------------------------------------------------
  def self.projectiles
   return @projectiles
  end
  #--------------------------------------------------------------------------
  # clean
  # Cleans the cache from projectiles and damage sprites.
  #--------------------------------------------------------------------------
  def self.clean
   # disposes all damage sprites
   @damages.each {|ary| ary[0].dispose}
   # create new damage sprite buffer and new projectile buffer
   @damages, @projectiles = [], []
   # unfreeze all actor's actions
   BlizzABS.player.actors.each {|actor| actor.freeze_action = false}
  end
  #--------------------------------------------------------------------------
  # image
  # index - index of the image in the cache
  # Returns a copy of the image.
  #--------------------------------------------------------------------------
  def self.image(index)
   return @data[index].clone
  end
  #--------------------------------------------------------------------------
  # _green_arrow
  # Creates the minimap icon for events.
  #--------------------------------------------------------------------------
  def self._green_arrow
   b = Bitmap.new(56, 14)
   c1 = Color.new(0, 0, 0)
   c2 = Color.new(255, 255, 255)
   c3 = Color.new(0, 255, 0)
   b.set_pixel(23, 0, c1)
   b.set_pixel(32, 0, c1)
   b.set_pixel(22, 1, c1)
   b.fill_rect(23, 1, 1, 12, c3)
   b.fill_rect(24, 1, 1, 12, c1)
   b.fill_rect(31, 1, 1, 12, c1)
   b.fill_rect(32, 1, 1, 12, c3)
   b.set_pixel(33, 1, c1)
   b.set_pixel(21, 2, c1)
   b.fill_rect(22, 2, 1, 10, c3)
   b.fill_rect(33, 2, 1, 10, c3)
   b.set_pixel(34, 2, c1)
   b.fill_rect(1, 3, 12, 1, c1)
   b.set_pixel(20, 3, c1)
   b.fill_rect(21, 3, 1, 8, c3)
   b.fill_rect(34, 3, 1, 8, c3)
   b.set_pixel(35, 3, c1)
   b.fill_rect(48, 3, 2, 1, c1)
   b.set_pixel(0, 4, c1)
   b.fill_rect(1, 4, 12, 1, c3)
   b.set_pixel(13, 4, c1)
   b.set_pixel(19, 4, c1)
   b.fill_rect(20, 4, 1, 6, c3)
   b.fill_rect(35, 4, 1, 6, c3)
   b.set_pixel(36, 4, c1)
   b.set_pixel(47, 4, c1)
   b.fill_rect(48, 4, 2, 6, c3)
   b.set_pixel(50, 4, c1)
   b.set_pixel(1, 5, c1)
   b.fill_rect(2, 5, 10, 1, c3)
   b.set_pixel(12, 5, c1)
   b.set_pixel(18, 5, c1)
   b.fill_rect(19, 5, 1, 4, c3)
   b.fill_rect(36, 5, 1, 4, c3)
   b.set_pixel(37, 5, c1)
   b.set_pixel(46, 5, c1)
   b.fill_rect(47, 5, 1, 5, c3)
   b.fill_rect(50, 5, 1, 5, c3)
   b.set_pixel(51, 5, c1)
   b.set_pixel(2, 6, c1)
   b.fill_rect(3, 6, 8, 1, c3)
   b.set_pixel(11, 6, c1)
   b.fill_rect(17, 6, 1, 2, c1)
   b.fill_rect(18, 6, 1, 2, c3)
   b.fill_rect(37, 6, 1, 2, c3)
   b.fill_rect(38, 6, 1, 2, c1)
   b.set_pixel(45, 6, c1)
   b.fill_rect(46, 6, 1, 4, c3)
   b.fill_rect(51, 6, 1, 4, c3)
   b.set_pixel(52, 6, c1)
   b.set_pixel(3, 7, c1)
   b.fill_rect(4, 7, 6, 1, c3)
   b.set_pixel(10, 7, c1)
   b.set_pixel(44, 7, c1)
   b.fill_rect(45, 7, 1, 3, c3)
   b.fill_rect(52, 7, 1, 3, c3)
   b.set_pixel(53, 7, c1)
   b.set_pixel(4, 8, c1)
   b.fill_rect(5, 8, 4, 1, c3)
   b.set_pixel(9, 8, c1)
   b.set_pixel(18, 8, c1)
   b.set_pixel(37, 8, c1)
   b.set_pixel(43, 8, c1)
   b.fill_rect(44, 8, 1, 2, c3)
   b.fill_rect(53, 8, 1, 2, c3)
   b.set_pixel(54, 8, c1)
   b.set_pixel(5, 9, c1)
   b.fill_rect(6, 9, 2, 1, c3)
   b.set_pixel(8, 9, c1)
   b.set_pixel(19, 9, c1)
   b.set_pixel(36, 9, c1)
   b.set_pixel(42, 9, c1)
   b.set_pixel(43, 9, c3)
   b.set_pixel(54, 9, c3)
   b.set_pixel(55, 9, c1)
   b.fill_rect(6, 10, 2, 1, c1)
   b.set_pixel(20, 10, c1)
   b.set_pixel(35, 10, c1)
   b.fill_rect(43, 10, 12, 1, c1)
   b.set_pixel(21, 11, c1)
   b.set_pixel(34, 11, c1)
   b.set_pixel(22, 12, c1)
   b.set_pixel(33, 12, c1)
   b.set_pixel(23, 13, c1)
   b.set_pixel(32, 13, c1)
   return b
  end
  #--------------------------------------------------------------------------
  # _white_arrow
  # Creates the minimap icon for other events.
  #--------------------------------------------------------------------------
  def self._white_arrow
   b = Bitmap.new(56, 14)
   c1 = Color.new(0, 0, 0)
   c2 = Color.new(255, 255, 255)
   b.set_pixel(23, 0, c1)
   b.set_pixel(32, 0, c1)
   b.set_pixel(22, 1, c1)
   b.fill_rect(23, 1, 1, 12, c2)
   b.fill_rect(24, 1, 1, 12, c1)
   b.fill_rect(31, 1, 1, 12, c1)
   b.fill_rect(32, 1, 1, 12, c2)
   b.set_pixel(33, 1, c1)
   b.set_pixel(21, 2, c1)
   b.fill_rect(22, 2, 1, 10, c2)
   b.fill_rect(33, 2, 1, 10, c2)
   b.set_pixel(34, 2, c1)
   b.fill_rect(1, 3, 12, 1, c1)
   b.set_pixel(20, 3, c1)
   b.fill_rect(21, 3, 1, 8, c2)
   b.fill_rect(34, 3, 1, 8, c2)
   b.set_pixel(35, 3, c1)
   b.fill_rect(48, 3, 2, 1, c1)
   b.set_pixel(0, 4, c1)
   b.fill_rect(1, 4, 12, 1, c2)
   b.set_pixel(13, 4, c1)
   b.set_pixel(19, 4, c1)
   b.fill_rect(20, 4, 1, 6, c2)
   b.fill_rect(35, 4, 1, 6, c2)
   b.set_pixel(36, 4, c1)
   b.set_pixel(47, 4, c1)
   b.fill_rect(48, 4, 2, 6, c2)
   b.set_pixel(50, 4, c1)
   b.set_pixel(1, 5, c1)
   b.fill_rect(2, 5, 10, 1, c2)
   b.set_pixel(12, 5, c1)
   b.set_pixel(18, 5, c1)
   b.fill_rect(19, 5, 1, 4, c2)
   b.fill_rect(36, 5, 1, 4, c2)
   b.set_pixel(37, 5, c1)
   b.set_pixel(46, 5, c1)
   b.fill_rect(47, 5, 1, 5, c2)
   b.fill_rect(50, 5, 1, 5, c2)
   b.set_pixel(51, 5, c1)
   b.set_pixel(2, 6, c1)
   b.fill_rect(3, 6, 8, 1, c2)
   b.set_pixel(11, 6, c1)
   b.fill_rect(17, 6, 1, 2, c1)
   b.fill_rect(18, 6, 1, 2, c2)
   b.fill_rect(37, 6, 1, 2, c2)
   b.fill_rect(38, 6, 1, 2, c1)
   b.set_pixel(45, 6, c1)
   b.fill_rect(46, 6, 1, 4, c2)
   b.fill_rect(51, 6, 1, 4, c2)
   b.set_pixel(52, 6, c1)
   b.set_pixel(3, 7, c1)
   b.fill_rect(4, 7, 6, 1, c2)
   b.set_pixel(10, 7, c1)
   b.set_pixel(44, 7, c1)
   b.fill_rect(45, 7, 1, 3, c2)
   b.fill_rect(52, 7, 1, 3, c2)
   b.set_pixel(53, 7, c1)
   b.set_pixel(4, 8, c1)
   b.fill_rect(5, 8, 4, 1, c2)
   b.set_pixel(9, 8, c1)
   b.set_pixel(18, 8, c1)
   b.set_pixel(37, 8, c1)
   b.set_pixel(43, 8, c1)
   b.fill_rect(44, 8, 1, 2, c2)
   b.fill_rect(53, 8, 1, 2, c2)
   b.set_pixel(54, 8, c1)
   b.set_pixel(5, 9, c1)
   b.fill_rect(6, 9, 2, 1, c2)
   b.set_pixel(8, 9, c1)
   b.set_pixel(19, 9, c1)
   b.set_pixel(36, 9, c1)
   b.set_pixel(42, 9, c1)
   b.set_pixel(43, 9, c2)
   b.set_pixel(54, 9, c2)
   b.set_pixel(55, 9, c1)
   b.fill_rect(6, 10, 2, 1, c1)
   b.set_pixel(20, 10, c1)
   b.set_pixel(35, 10, c1)
   b.fill_rect(43, 10, 12, 1, c1)
   b.set_pixel(21, 11, c1)
   b.set_pixel(34, 11, c1)
   b.set_pixel(22, 12, c1)
   b.set_pixel(33, 12, c1)
   b.set_pixel(23, 13, c1)
   b.set_pixel(32, 13, c1)
   return b
  end
  #--------------------------------------------------------------------------
  # _arrow
  # Creates the arrow displayed in the hotkey assignment menu.
  #--------------------------------------------------------------------------
  def self._arrow
   b = Bitmap.new(16, 9)
   c1 = Color.new(0, 0, 0)
   c2 = Color.new(255, 255, 255)
   c3 = Color.new(127, 127, 127)
   b.fill_rect(7, 0, 2, 1, c2)
   b.set_pixel(6, 1, c2)
   b.fill_rect(7, 1, 1, 7, c3)
   b.fill_rect(8, 1, 1, 7, c1)
   b.set_pixel(9, 1, c2)
   b.set_pixel(5, 2, c2)
   b.fill_rect(6, 2, 1, 6, c3)
   b.fill_rect(9, 2, 1, 6, c1)
   b.set_pixel(10, 2, c2)
   b.set_pixel(4, 3, c2)
   b.fill_rect(5, 3, 1, 5, c3)
   b.fill_rect(10, 3, 1, 5, c1)
   b.set_pixel(11, 3, c2)
   b.set_pixel(3, 4, c2)
   b.fill_rect(4, 4, 1, 4, c3)
   b.fill_rect(11, 4, 1, 4, c1)
   b.set_pixel(12, 4, c2)
   b.set_pixel(2, 5, c2)
   b.fill_rect(3, 5, 1, 3, c3)
   b.fill_rect(12, 5, 1, 3, c1)
   b.set_pixel(13, 5, c2)
   b.set_pixel(1, 6, c2)
   b.fill_rect(2, 6, 1, 2, c3)
   b.fill_rect(13, 6, 1, 2, c1)
   b.set_pixel(14, 6, c2)
   b.set_pixel(0, 7, c2)
   b.set_pixel(1, 7, c3)
   b.set_pixel(14, 7, c1)
   b.set_pixel(15, 7, c2)
   b.fill_rect(1, 8, 14, 1, c2)
   return b
  end
  #--------------------------------------------------------------------------
  # _minimap_autotile
  # Creates the minimap autotile for passability.
  #--------------------------------------------------------------------------
  def self._minimap_autotile
   b = Bitmap.new(24, 32)
   c1 = Color.new(191, 191, 191)
   c2 = Color.new(255, 255, 255)
   b.fill_rect(2, 0, 4, 1, c2)
   b.set_pixel(1, 1, c2)
   b.fill_rect(2, 1, 4, 6, c1)
   b.set_pixel(6, 1, c2)
   b.fill_rect(0, 2, 1, 4, c2)
   b.fill_rect(1, 2, 1, 4, c1)
   b.fill_rect(6, 2, 1, 4, c1)
   b.fill_rect(7, 2, 1, 4, c2)
   b.set_pixel(1, 6, c2)
   b.set_pixel(6, 6, c2)
   b.fill_rect(2, 7, 4, 1, c2)
   b.fill_rect(7, 8, 10, 1, c2)
   b.set_pixel(6, 9, c2)
   b.fill_rect(7, 9, 10, 22, c1)
   b.set_pixel(17, 9, c2)
   b.set_pixel(5, 10, c2)
   b.fill_rect(6, 10, 1, 20, c1)
   b.fill_rect(17, 10, 1, 20, c1)
   b.set_pixel(18, 10, c2)
   b.set_pixel(4, 11, c2)
   b.fill_rect(5, 11, 1, 18, c1)
   b.fill_rect(18, 11, 1, 18, c1)
   b.set_pixel(19, 11, c2)
   b.set_pixel(3, 12, c2)
   b.fill_rect(4, 12, 1, 16, c1)
   b.fill_rect(19, 12, 1, 16, c1)
   b.set_pixel(20, 12, c2)
   b.set_pixel(2, 13, c2)
   b.fill_rect(3, 13, 1, 14, c1)
   b.fill_rect(20, 13, 1, 14, c1)
   b.set_pixel(21, 13, c2)
   b.set_pixel(1, 14, c2)
   b.fill_rect(2, 14, 1, 12, c1)
   b.fill_rect(21, 14, 1, 12, c1)
   b.set_pixel(22, 14, c2)
   b.fill_rect(0, 15, 1, 10, c2)
   b.fill_rect(1, 15, 1, 10, c1)
   b.fill_rect(22, 15, 1, 10, c1)
   b.fill_rect(23, 15, 1, 10, c2)
   b.set_pixel(1, 25, c2)
   b.set_pixel(22, 25, c2)
   b.set_pixel(2, 26, c2)
   b.set_pixel(21, 26, c2)
   b.set_pixel(3, 27, c2)
   b.set_pixel(20, 27, c2)
   b.set_pixel(4, 28, c2)
   b.set_pixel(19, 28, c2)
   b.set_pixel(5, 29, c2)
   b.set_pixel(18, 29, c2)
   b.set_pixel(6, 30, c2)
   b.set_pixel(17, 30, c2)
   b.fill_rect(7, 31, 10, 1, c2)
   return b
  end
 end
Â
 #============================================================================
 # Player_Controller
 #----------------------------------------------------------------------------
 # This class is a special controller that controls the party leader.
 #============================================================================
Â
 class Player_Controller
 Â
  # Center screen x-coordinate * 4
  CX = (320 - 16) * 4
  # Center screen y-coordinate * 4
  CY = (240 - 16) * 4
 Â
  # set all accessable variables
  attr_accessor :normal_speed
  attr_accessor :actors
  attr_accessor :encounter_count
  #--------------------------------------------------------------------------
  # Initialization
  #--------------------------------------------------------------------------
  def initialize
   # set event trigger escape counter
   @evented = 0
   # set actor characters
   @actors = []
   # set memory jump
   @memory_jump = false
   # set normal speed
   @normal_speed = BlizzABS::Config::NORMAL_SPEED
  end
  #--------------------------------------------------------------------------
  # player
  # This method is used to make the code easier to read.
  #--------------------------------------------------------------------------
  def player
   return @actors[0]
  end
  #--------------------------------------------------------------------------
  # update_control
  # Processes player control.
  #--------------------------------------------------------------------------
  def update_control
   # get pixel movement rate
   pix = BlizzABS.pixel
   # reset move speed
   player.move_speed = @normal_speed
   # reset spriteset name
   player.character_name = player.character_name_org
   # if allowed to change speed
   unless $game_system.map_interpreter.running? ||
     player.move_route_forcing || $game_temp.message_window_showing
    # if run button works and running
    if Input.press?(Input::Run) && BlizzABS::Config::RUN_SPEED != 0
     # set running speed
     player.move_speed = BlizzABS::Config::RUN_SPEED
    # if sneak button works and sneaking
    elsif Input.press?(Input::Sneak) && BlizzABS::Config::SNEAK_SPEED != 0
     # set sneaking speed
     player.move_speed = BlizzABS::Config::SNEAK_SPEED
    end
   end
   # if battler exists and either dead or select triggered
   if player.battler != nil && (Input.trigger?(Input::Select) ||
     player.battler.dead?)
    # iterate "number of party members" times
    $game_party.actors.size.times {
      # change party leader
      $game_party.add_actor($game_party.actors.shift.id)
      # until finding one who's not dead
      break if $game_party.actors[0] != nil && !$game_party.actors[0].dead?}
    # center screen display on new player controlled character
    center(player.x, player.y, true)
    # enforce emptying moving buffer and add special command
    update_buffer(false)
    # set flag for HUD update
    $game_temp.hud_refresh = true
   end
   # update spriteset animation
   player.sprite_update
   # decrease event trigger escape counter if no interpreter running
   @evented -= 1 if @evented > 0 && !$game_system.map_interpreter.running?
   # if allowed to turn and pressed turning button or defending
   if ((player.defending && player.attacked == 0 &&
      player.in_action == 0) || Input.press?(Input::Turn)) &&
      !player.moving? && !$game_system.map_interpreter.running? &&
      !player.move_route_forcing && !$game_temp.message_window_showing
    # straighten
    player.straighten
    # depending on input turn
    case Input.dir4
    when 2 then player.turn_down
    when 4 then player.turn_left
    when 6 then player.turn_right
    when 8 then player.turn_up
    end
    # updates any attack action
    player.update_attacked
    # abort method
    return nil
   end
   # updates any attack action
   player.update_attacked
   # if acting
   if player.in_action > 0
    # decrease action counter if in_action is greater than 0
    player.in_action -= 1 if player.in_action > 0
    # return data
    return [player.moving?, player.real_x, player.real_y]
   end
   # if allowed to move
   unless $game_system.map_interpreter.running? ||
     player.move_route_forcing || $game_temp.message_window_showing
    # if jump button was pressed and not already jumping
    @memory_jump = true if Input.trigger?(Input::Jump) && !player.jumping?
    # if not moving
    unless player.moving?
     # get jumping range
     range = BlizzABS::Config::JUMPING
     # if jumping turned on and not jumping and jumped
     if range > 0 && !player.jumping? && @memory_jump
      # if sneaking or running is possible
      if BlizzABS::Config::RUN_SPEED > 0 || BlizzABS::Config::SNEAK_SPEED > 0
       # get difference between current speed and normal speed
       dplus = player.move_speed - @normal_speed
      else
       # difference is 0
       dplus = 0
      end
      # check input
      direction = ($game_system._8_way ? Input.dir8 : Input.dir4)
      # set jumping direction
      case direction
      when 1 then x, y = -1, 1
      when 2 then x, y = 0, 1
      when 3 then x, y = 1, 1
      when 4 then x, y = -1, 0
      when 6 then x, y = 1, 0
      when 7 then x, y = -1, -1
      when 8 then x, y = 0, -1
      when 9 then x, y = 1, -1
      else
       x, y = 0, 0
      end
      # jump into direction with considering running/sneaking
      player.jump(x*range + x*dplus, y*range + y*dplus, direction)
     elsif !player.jumping?
      # check input and attempt to move
      case ($game_system._8_way ? Input.dir8 : Input.dir4)
      when 1 then move(4) if !move(1) && !move(2)
      when 2 then move(2)
      when 3 then move(6) if !move(3) && !move(2)
      when 4 then move(4)
      when 6 then move(6)
      when 7 then move(4) if !move(7) && !move(8)
      when 8 then move(8)
      when 9 then move(6) if !move(9) && !move(8)
      end
     end
     # not jumping anymore
     @memory_jump = false
    end
   end
   # return data
   return [player.moving?, player.real_x, player.real_y]
  end
  #--------------------------------------------------------------------------
  # move
  # dir - direction
  # This method is used to make the code easier to read. It moves the player
  #--------------------------------------------------------------------------
  def move(dir)
   return case dir
   when 1 then player.move_lower_left
   when 2 then player.move_down
   when 3 then player.move_lower_right
   when 4 then player.move_left
   when 6 then player.move_right
   when 7 then player.move_upper_left
   when 8 then player.move_up
   when 9 then player.move_upper_right
   end
  end
  #--------------------------------------------------------------------------
  # update_move
  # Processes player control.
  #--------------------------------------------------------------------------
  def update_move(data)
   # if control update was not aborted
   if data != nil
    # if moved down
    if player.real_y > data[2] && player.real_y - $game_map.display_y > CY
     # scroll screen down
     $game_map.scroll_down(player.real_y - data[2])
    end
    # if moved left
    if player.real_x < data[1] && player.real_x - $game_map.display_x < CX
     # scroll screen left
     $game_map.scroll_left(data[1] - player.real_x)
    end
    # if moved right
    if player.real_x > data[1] && player.real_x - $game_map.display_x > CX
     # scroll screen right
     $game_map.scroll_right(player.real_x - data[1])
    end
    # if moved up
    if player.real_y < data[2] && player.real_y - $game_map.display_y < CY
     # scroll screen up
     $game_map.scroll_up(data[2] - player.real_y)
    end
    # if not moving
    unless player.moving?
     # if last moving
     if data[0]
      # if event triggered
      if @evented == 0 && check_event_trigger_here([1, 2])
       # set escape counter if moving before and event escape expired
       @evented = 40
      # if not override and countdown greater than 0
      elsif !($DEBUG && Input.press?(Input::CTRL)) && @encounter_count > 0
       # temporary variable
       count = @encounter_count - 2 ** (5 - $game_system.pixel_rate)
       # set battle-encounter countdown
       @encounter_count = [count, 0].max
      end
     end
     # if pressed C button
     if Input.trigger?(Input::C)
      # check event here
      check_event_trigger_here([0])
      # check event there
      check_event_trigger_there([0, 1, 2])
     end
    end
   end
   # update actors' characters
   update_actors
   # update ABS controls
   $game_system.controls.update
  end
  #--------------------------------------------------------------------------
  # update_buffer
  # move - new command
  # Updates the buffer of the last moving commands.
  #--------------------------------------------------------------------------
  def update_buffer(move)
   # empty each actor's buffer if new command requires so
   @actors.each {|actor| actor.buffer = []} if [nil, false].include?(move)
   # add new command or enforce emptying whether move is reset for each actor
   @actors.each {|actor| actor.update_buffer(move == 'reset' ? nil : move)}
  end
  #--------------------------------------------------------------------------
  # update_actors
  # Updates all the actors on the map.
  #--------------------------------------------------------------------------
  def update_actors
   # update each other actor except the player
   @actors[1, @actors.size-1].each {|actor| actor.update}
   # set stopped animation flag if player's character is animated
   @step_anime = true if BlizzABS::Config::ANIMATED_IDS.include?(player.battler.id)
  end
  #--------------------------------------------------------------------------
  # refresh
  # Refreshes the character.
  #--------------------------------------------------------------------------
  def refresh
   # if CATERPILLAR is active
   if Config::CATERPILLAR
    # test on changes in the inner structure of $game_party.actors
    if @actors.any? {|actor|
      actor.battler == nil && $game_party.actors[actor.index] != nil ||
      actor.battler != $game_party.actors[actor.index]}
     # store old array and create new array
     old, @actors = @actors, []
     # for each old actor
     old.each {|a|
       # if battler exists and in party
       if a.battler != nil && a.battler.index != nil
        # add actor on position
        @actors[a.battler.index] = a
       end}
     # for each old actor
     old.each {|a|
       # remove battler if not in party
       a.battler = nil if a.battler != nil && a.battler.index == nil
       # add actor if battler doesn't exist
       @actors.push(a) if a.battler == nil}
     # for each actor
     @actors.each {|a|
       # if no battler assigned, but in the party is a battler
       if a.battler == nil && $game_party.actors[a.index] != nil
        
# Blizz-ABS by Blizzard
# Version: 1.73
# Type: Advanced Action Battle System
# Date v1.00: 19.04.2007
# Date v1.01: 30.04.2007
# Date v1.02: 17.07.2007
# Date v1.04: 25.07.2007
# Date v1.09: 25.07.2007
# Date v1.20: 29.07.2007
# Date v1.23: 30.07.2007
# Date v1.24: 05.08.2007
# Date v1.60: 05.09.2007
# Date v1.61: 06.09.2007
# Date v1.62: 07.09.2007
# Date v1.63: 11.09.2007
# Date v1.64: 11.09.2007
# Date v1.65: 12.09.2007
# Date v1.66: 10.10.2007
# Date v1.67: 16.10.2007
# Date v1.69: 31.10.2007
# Date v1.70: 13.11.2007
# Date v1.71: 22.11.2007
# Date v1.72: 10.12.2007
# Date v1.73: 11.12.2007
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# Explanation:
#
#Â This script will allow you to create games with an Action Battle System
#Â (ABS) (i.e. Zelda). Action Battle System means real time battle on the map.
#
#Â If you don't read the Manual, you will not be able to use many of the great
#Â features this ABS supports.
#
#Â You didn't get a Manual with the Blizz-ABS? Please e-mail me, tell me where
#Â you got this script from and I will give you a download link to the manual.
#Â Here is my e-mail:
#Â boris_blizzard@yahoo.de
#
#
# Compatibility:
#
#Â 80% compatible with SDK 1.x. 40% compatible with SDK 2.x. Compatible with
#Â any CMS. Mostly is not compatible with any battle add-ons for the normal
#Â turn based battle system. WILL corrupt your old save games. Incompatible
#Â with the RGSS100J.dll.
#
#
# IMPORTANT:
#
#Â Any CMS is being overriden, so put this script UNDER the CMS script if you
#Â are using a CMS script (CMS = Custom Menu System). This script overrides
#Â Tons of Add-ons and goes under it.
#
#
# Special Thanks for testing to:
#
#Â - Leonharts
#Â - modern algebra
#Â - NAMKCOR
#Â - Rune
#Â - Irockman1
#Â - blazinhandling
#Â - Zeph
#
#
# If you find any bugs, please report them here:
# http://www.chaosproject.co.nr
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#==============================================================================
# BlizzABS
#------------------------------------------------------------------------------
#Â This is the master control, configuration, utility and battle process
#Â module for Blizz-ABS.
#==============================================================================
module BlizzABS
Â
 #============================================================================
 # BlizzABS::Control
 #----------------------------------------------------------------------------
 # This module provides in-game control configurations.
 #============================================================================
Â
 module Control
 Â
  # using other controls instead of arrow keys
  CUSTOM_CONTROLS = false
  # RMXP default controls will be replaced completely with Blizz-ABS controls
  DISABLE_DEFAULT = true
  # you can skip this if you have set CUSTOM_CONTROLS to false
  # setup the controls as array, but with prefix and suffix "
  # i.e.: Let T and R be for cancel => CANCEL = "[Let['T'], Let['R']]"
  # for more info about read 1.1.1. of the manual
  UP   = "[Let['W']]" # move up
  LEFT  = "[Let['A']]" # move left
  DOWN  = "[Let['S']]" # move down
  RIGHT  = "[Let['D']]" # move right
  PREVPAGE = "[Let['Q']]" # previous page
  NEXTPAGE = "[Let['E']]" # next page
  CONFIRM = "[Let['H']]" # confirm selections / pick up items
  CANCEL = "[Let['F']]" # cancel selections
  ATTACK = "[Let['K']]" # attacking
  DEFEND = "[Let['L']]" # defending (hold)
  SKILL  = "[Let['J']]" # use skill
  ITEM  = "[Let['I']]" # use item
  SELECT = "[Let['O']]" # change leader
  HUD   = "[Let['Z']]" # HUD on/off if enabled
  HOTKEY = "[Let['X']]" # hotkey display on/off if enabled
  MINIMAP = "[Let['C']]" # toggle minimap mode if enabled
  RUN   = "[Let['M']]" # running (hold)
  SNEAK  = "[Dot]"   # sneaking (hold)
  JUMP  = "[Comma]"  # jumping
  TURN  = "[Let['U']]" # turning around without moving (hold)
 end
Â
 #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 # BlizzABS::Config
 #----------------------------------------------------------------------------
 # This module provides Blizz-ABS configurations.
 #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Â
 module Config
 Â
  # should party members follow the leader on the map
  CATERPILLAR = true
  # how many party member do you use
  MAX_PARTY = 4
  # include all actor IDs who are animated when standing
  ANIMATED_IDS = []
  # 0 -> 32 pixel tiles, 1 -> 16, 2 -> 8, 3 -> 4, 4 -> 2, 5 -> 1
  # careful anything higher than 1 will limit the max speed of char movement
  # 0 - max: 6, 1 - max: 6, 2 - max: 5, 3 - max: 4, 4 - max: 3, 5 - max: 2
  # I recommend using 2 if you have allies else you can use 3
  # note that this can also cause problems with running and sneaking
  PIXEL_MOVEMENT_RATE = 0
  # will make the force movement command ALWAYS work for 32 pixel tiles
  REPAIR_MOVEMENT = true
  # enable or disable moving in all 8 directions
  EIGHT_WAY_MOVEMENT = false
  # the normal moving speed (4 is default)
  NORMAL_SPEED = 4
  # the speed of running (set to 0 to disable)
  RUN_SPEED = 5
  # the speed of sneaking (set to 0 to disable)
  SNEAK_SPEED = 3
  # how many squares should the player jump (set to 0 to disable)
  JUMPING = 2
  # the terrain tag of tiles where the player can't jump over
  JUMP_TAG = 8
  # measured in map squares
  PERCEPTION_RANGE = 5
  # the terrain tag of "walls" (enemies can't see through walls, only hear)
  WALL_TAG = 8
  # turns HUD on or off
  HUD_ENABLED = true
  # 0, 1, or 2 (slightly different drawing method of the bars)
  HUD_TYPE = 0
  # 0 = upper left corner, 1 = upper right corner
  HUD_POSITION = 0
  # enables minimap
  MINIMAP = true
  # enables intelligent minimap to save map loading time
  INTELLIGENT_PASSABILTY = true
  # how much time will pass until an enemy respawns (0 for no respawn)
  RESPAWN_TIME = 10
  # the terrain tag of tiles where enemies can't respawn
  NO_ENEMY_TAG = 8
  # how many seconds will dropped stuff stay (0xFFFF for "infinite")
  ITEM_TIME = 30
  # sound played when picking up items ("NAME", VOLUME, PITCH)
  ITEM_PICKUP_SOUND_FILE = RPG::AudioFile.new('056-Right02', 80, 100)
  # makes enemies drop gold, specify an icon for display here
  DROP_GOLD = ''
  # map IDs where ABSEAL is disabled
  DISABLE_ANTI_LAG_IDS = []
  # strength of delag (1 is most powerful and not recommended)
  FACTOR = 3
  # stops update of events with no spriteset
  ABSEAL_AUTOKILL = true
  # restores the character's HP/SP/Status on Level Up
  HEAL_ON_LVLUP = true
  # displays LvUp on Level Up
  DISPLAY_LVLUP = true
  # animation ID of the animation shown when a player levels up
  LVLUP_ANIMATION_ID = 0
  # animation ID of the animation shown when an enemy is on the run
  FLEE_LOOP_ANIMATION_ID = 0
  # shows attack/skill/item animation
  ANIMATIONS = true
  # enables or disables the sprites during action of for actors
  ACTOR_ACTION_SPRITES = false
  # enables or disables the sprites during action of enemies
  ENEMY_ACTION_SPRITES = false
  # enables or disables the extra sprites for each weapon (actors only)
  WEAPON_SPRITES = false
  # enables or disables the sprites during running (player and allies)
  RUNNING_SPRITES = false
  # enables or disables the sprites during sneaking (player and allies)
  SNEAKING_SPRITES = false
  # enables or disables the sprites during sneaking (player and allies)
  JUMPING_SPRITES = false
  # small animations (set to true to size animations down to 50%)
  SMALL_ANIMATIONS = true
  # use also different tint colors for the pre-menu
  MENU_COLOR_TINT = 0
  # attack sprite (for actors), first row y offset if necessary
  ACTOR_SPRITE_Y_OFFSET = 0
  # attack sprite (for enemies), first row y offset if necessary
  ENEMY_SPRITE_Y_OFFSET = 0
  # 0 = never, 1 = no enemies, 2 = enemies dead, 3 = enemies within ABSEAL dead
  DISABLE_ABS_MODE = 1
  # [type, range], 0 = no data, 1 = in name, 2 = in description
  WEAPON_DATA_MODE = [0, 0]
  # [type, explode range, range] 0 = no data, 1 = in name, 2 = in description
  SKILL_DATA_MODE = [0, 0, 0]
  # [type, explode range, range] 0 = no data, 1 = in name, 2 = in description
  ITEM_DATA_MODE = [0, 0, 0]
 end
Â
 #============================================================================
 # BlizzABS::Weapons
 #----------------------------------------------------------------------------
 # This module provides weapon configurations.
 #============================================================================
Â
 module Weapons
 Â
  #--------------------------------------------------------------------------
  # type
  # id - weapon ID
  # This method serves as database for weapon types.
  # 0 = sword / axe / claws / unarmed / etc. (damages in close front)
  # 1 = spear / lance (damages only in front)
  # 2 = flail (distant weapon, does not damage close enemies, front)
  # 3 = boomerang (returning projectile weapon, front)
  # 4 = bow and arrows / gun / shuriken (non-returning projectile, NO consumption)
  # 5 = bow and arrows / gun (non-returning projectile, consumes AMMUNITION)
  # 6 = shuriken (non-returning projectile, consumes ITSELF)
  #--------------------------------------------------------------------------
  def self.type(id)
   case id
   # START set up weapon types (when ID then return TYPE)
   when 1 then return 0
   # END
   end
   return 0
  end
  #--------------------------------------------------------------------------
  # range
  # id - weapon ID
  # This method serves as database for weapon ranges. All ranges are
  # measured in map squares. Any decimal value WILL have its effect if
  # pixel movement is being used.
  #--------------------------------------------------------------------------
  def self.range(id)
   case id
   # START set up weapon ranges (when ID then return RANGE)
   when 1 then return 1.5
   # END
   end
   return 1.5
  end
  #--------------------------------------------------------------------------
  # consume
  # id - weapon ID
  # Lets your weapons consume items to work. You must have the item assigned
  # as your hot item for the weapon to work. One weapon can consumes
  # different items. If you don't have any items left, the attack will fail.
  # Allies' items for usage can be set up directly or over the AI menu.
  #--------------------------------------------------------------------------
  def self.consume(id)
   case id
   # START set up ammo consumption (when ID then return ID_ARRAY)
   when 1 then return []
   # END
   end
   return []
  end
 end
Â
 #============================================================================
 # BlizzABS::Skills
 #----------------------------------------------------------------------------
 # This module provides skill configurations.
 #============================================================================
Â
 module Skills
 Â
  #--------------------------------------------------------------------------
  # type
  # id - skill ID
  # Lets you define how skills will be executed.
  # 0 = shooting skill (projectile skill, hits first target it encounters)
  # 1 = homing skill (projectile skill, finds a target you specify)
  # 2 = direct skill (hits the target instantly, you select the target)
  # 3 = beam skill (hits every target it goes through instantly)
  # If a skill targets all enemies/allies, the skill will turn into:
  # 0 => thrusting skill (projectile skill, hits every target it goes through)
  # 1 => super homing skill (projectiles hit all targets in range)
  # 2 => shockwave skill (circular shockwave hits all targets in range)
  # 3 => fullscreen skill (targets all allies/enemies on the screen)
  # Set the exploding range to 0 if you don't want anybody around to be
  # affected by this skill. A skill explosion does not differ between ally
  # and enemy. The animation ID can be skipped if no explosion range was
  # defined.
  #--------------------------------------------------------------------------
  def self.type(id)
   case id
   # START set up skill types (when ID then return [TYPE, EXPLODING_RANGE, ANIMATION_ID])
   when 1 then return [2, 0]
   # END
   end
   return [2, 0]
  end
  #--------------------------------------------------------------------------
  # range
  # id - skill ID
  # This method serves as database for skill ranges. All ranges are
  # measured in map squares. Any decimal value WILL have its effect if
  # pixel movement is being used. If the skill is a summon skill, this will
  # define the time in seconds how long the summoned ally will prevail.
  #--------------------------------------------------------------------------
  def self.range(id)
   case id
   # START set up skill ranges (when ID then return RANGE)
   when 1 then return 5.5
   # END
   end
   return 5.5
  end
 end
Â
 #============================================================================
 # BlizzABS::Items
 #----------------------------------------------------------------------------
 # This module provides item configurations.
 #============================================================================
Â
 module Items
 Â
  #--------------------------------------------------------------------------
  # type
  # id - item ID
  # 0 = shooting item (projectile item, hits first target it encounters)
  # 1 = homing item (projectile item, finds a target you specify)
  # 2 = direct item (hits the target instantly, you select the target)
  # 3 = beam item (hits every target it goes through instantly)
  # If a item targets all enemies/allies, the item will turn into:
  # 0 => thrusting item (projectile item, hits every target it goes through)
  # 1 => super homing item (projectiles hit all targets in range)
  # 2 => shockwave item (circular shockwave hits all targets in range)
  # 3 => fullscreen item (targets all allies/enemies on the screen)
  # Set the exploding range to 0 if you don't want anybody around to be
  # affected by this item. An item explosion does not differ between ally
  # and enemy.
  #--------------------------------------------------------------------------
  def self.type(id)
   case id
   # START set up skill types (when ID then return [TYPE, EXPLODING_RANGE, ANIMATION_ID])
   when 1 then return [2, 0]
   # END
   end
   return [2, 0]
  end
  #--------------------------------------------------------------------------
  # range
  # id - item ID
  # This method serves as database for item ranges. All ranges are
  # measured in map squares. Any decimal value WILL have its effect if
  # pixel movement is being used. If the item is a summon item, this will
  # define the time in seconds how long the summoned ally will prevail.
  #--------------------------------------------------------------------------
  def self.range(id)
   case id
   # START set up item ranges (when ID then return RANGE)
   when 1 then return 5.5
   # END
   end
   return 5.5
  end
 end
Â
 #============================================================================
 # BlizzABS::Enemies
 #----------------------------------------------------------------------------
 # This module provides special enemy configurations.
 #============================================================================
Â
 module Enemies
 Â
  #--------------------------------------------------------------------------
  # type
  # id - enemy ID
  # This method serves as database for enemy attack types.
  # 0 = damages in close front
  # 1 = damages only in front
  # 2 = distant weapon, does not damage close enemies, front
  # 3 = returning projectile weapon, front
  # 4 = projectile weapon
  #--------------------------------------------------------------------------
  def self.type(id)
   case id
   # START set up enemy attack types (when ID then return TYPE)
   when 1 then return 0
   # END
   end
   return 0
  end
  #--------------------------------------------------------------------------
  # range
  # id - enemy ID
  # This method serves as database for enemy attack ranges. All ranges are
  # measured in map squares. Any decimal value WILL have its effect if
  # pixel movement is being used.
  #--------------------------------------------------------------------------
  def self.range(id)
   case id
   # START set up enemy attack ranges (when ID then return RANGE)
   when 1 then return 1.5
   # END
   end
   return 1.5
  end
  #--------------------------------------------------------------------------
  # enemy_set
  # id - enemy ID
  # Specify spritesets for enemy projectile attacks. Spritesets are
  # auto-animated all the time.
  #--------------------------------------------------------------------------
  def self.enemy_set(id)
   case id
   # START set up enemy attack spritesets (when ID then return SPRITESET_NAME)
   when 1 then return ''
   # END
   end
   return ''
  end
  #--------------------------------------------------------------------------
  # destruct
  # id - enemy ID
  # Specify animation IDs for enemies to have a custom destruction sequence.
  # For any enemy that is not specified here the default Blizz-ABS fade out
  # will be displayed.
  #--------------------------------------------------------------------------
  def self.destruct(id)
   case id
   # START set up enemy destruct animations (when ID then return ANIMATION_ID)
   when 1 then return 0
   # END
   end
   return 0
  end
 end
Â
 #============================================================================
 # BlizzABS::Cache
 #----------------------------------------------------------------------------
 # This module holds a few bitmaps, so they don't need to be drawn each time
 # which improves speed and reduces lag. It also holds damage sprites and
 # Projectile Characters.
 #============================================================================
Â
 module Cache
 Â
  #--------------------------------------------------------------------------
  # load
  # Loads the cache images.
  #--------------------------------------------------------------------------
  def self.load
   # initialize image, damage sprite and projectile buffers
   @data, @damages, @projectiles = [], [], []
   # add image
   @data.push(self._minimap_autotile)
   # prevent "Script is hanging" error
   Graphics.update
   # add image
   @data.push(self._arrow)
   # prevent "Script is hanging" error
   Graphics.update
   # add image
   @data.push(self._white_arrow)
   # prevent "Script is hanging" error
   Graphics.update
   # add image
   @data.push(self._green_arrow)
   # prevent "Script is hanging" error
   Graphics.update
   # create 4 clones of the green arrow
   4.times {@data.push(@data[3].clone)}
   # temporary array for hue change
   tmp = [120, -120, -60, 150]
   # change the hues to blue, red, yellow and violet
   (0..3).each {|i| @data[i+4].hue_change(tmp)}
   # prevent "Script is hanging" error
   Graphics.update
  end
  #--------------------------------------------------------------------------
  # damages
  # Returns all currently displayed damage sprites.
  #--------------------------------------------------------------------------
  def self.damages
   return @damages
  end
  #--------------------------------------------------------------------------
  # projectiles
  # Returns all currently active projectiles.
  #--------------------------------------------------------------------------
  def self.projectiles
   return @projectiles
  end
  #--------------------------------------------------------------------------
  # clean
  # Cleans the cache from projectiles and damage sprites.
  #--------------------------------------------------------------------------
  def self.clean
   # disposes all damage sprites
   @damages.each {|ary| ary[0].dispose}
   # create new damage sprite buffer and new projectile buffer
   @damages, @projectiles = [], []
   # unfreeze all actor's actions
   BlizzABS.player.actors.each {|actor| actor.freeze_action = false}
  end
  #--------------------------------------------------------------------------
  # image
  # index - index of the image in the cache
  # Returns a copy of the image.
  #--------------------------------------------------------------------------
  def self.image(index)
   return @data[index].clone
  end
  #--------------------------------------------------------------------------
  # _green_arrow
  # Creates the minimap icon for events.
  #--------------------------------------------------------------------------
  def self._green_arrow
   b = Bitmap.new(56, 14)
   c1 = Color.new(0, 0, 0)
   c2 = Color.new(255, 255, 255)
   c3 = Color.new(0, 255, 0)
   b.set_pixel(23, 0, c1)
   b.set_pixel(32, 0, c1)
   b.set_pixel(22, 1, c1)
   b.fill_rect(23, 1, 1, 12, c3)
   b.fill_rect(24, 1, 1, 12, c1)
   b.fill_rect(31, 1, 1, 12, c1)
   b.fill_rect(32, 1, 1, 12, c3)
   b.set_pixel(33, 1, c1)
   b.set_pixel(21, 2, c1)
   b.fill_rect(22, 2, 1, 10, c3)
   b.fill_rect(33, 2, 1, 10, c3)
   b.set_pixel(34, 2, c1)
   b.fill_rect(1, 3, 12, 1, c1)
   b.set_pixel(20, 3, c1)
   b.fill_rect(21, 3, 1, 8, c3)
   b.fill_rect(34, 3, 1, 8, c3)
   b.set_pixel(35, 3, c1)
   b.fill_rect(48, 3, 2, 1, c1)
   b.set_pixel(0, 4, c1)
   b.fill_rect(1, 4, 12, 1, c3)
   b.set_pixel(13, 4, c1)
   b.set_pixel(19, 4, c1)
   b.fill_rect(20, 4, 1, 6, c3)
   b.fill_rect(35, 4, 1, 6, c3)
   b.set_pixel(36, 4, c1)
   b.set_pixel(47, 4, c1)
   b.fill_rect(48, 4, 2, 6, c3)
   b.set_pixel(50, 4, c1)
   b.set_pixel(1, 5, c1)
   b.fill_rect(2, 5, 10, 1, c3)
   b.set_pixel(12, 5, c1)
   b.set_pixel(18, 5, c1)
   b.fill_rect(19, 5, 1, 4, c3)
   b.fill_rect(36, 5, 1, 4, c3)
   b.set_pixel(37, 5, c1)
   b.set_pixel(46, 5, c1)
   b.fill_rect(47, 5, 1, 5, c3)
   b.fill_rect(50, 5, 1, 5, c3)
   b.set_pixel(51, 5, c1)
   b.set_pixel(2, 6, c1)
   b.fill_rect(3, 6, 8, 1, c3)
   b.set_pixel(11, 6, c1)
   b.fill_rect(17, 6, 1, 2, c1)
   b.fill_rect(18, 6, 1, 2, c3)
   b.fill_rect(37, 6, 1, 2, c3)
   b.fill_rect(38, 6, 1, 2, c1)
   b.set_pixel(45, 6, c1)
   b.fill_rect(46, 6, 1, 4, c3)
   b.fill_rect(51, 6, 1, 4, c3)
   b.set_pixel(52, 6, c1)
   b.set_pixel(3, 7, c1)
   b.fill_rect(4, 7, 6, 1, c3)
   b.set_pixel(10, 7, c1)
   b.set_pixel(44, 7, c1)
   b.fill_rect(45, 7, 1, 3, c3)
   b.fill_rect(52, 7, 1, 3, c3)
   b.set_pixel(53, 7, c1)
   b.set_pixel(4, 8, c1)
   b.fill_rect(5, 8, 4, 1, c3)
   b.set_pixel(9, 8, c1)
   b.set_pixel(18, 8, c1)
   b.set_pixel(37, 8, c1)
   b.set_pixel(43, 8, c1)
   b.fill_rect(44, 8, 1, 2, c3)
   b.fill_rect(53, 8, 1, 2, c3)
   b.set_pixel(54, 8, c1)
   b.set_pixel(5, 9, c1)
   b.fill_rect(6, 9, 2, 1, c3)
   b.set_pixel(8, 9, c1)
   b.set_pixel(19, 9, c1)
   b.set_pixel(36, 9, c1)
   b.set_pixel(42, 9, c1)
   b.set_pixel(43, 9, c3)
   b.set_pixel(54, 9, c3)
   b.set_pixel(55, 9, c1)
   b.fill_rect(6, 10, 2, 1, c1)
   b.set_pixel(20, 10, c1)
   b.set_pixel(35, 10, c1)
   b.fill_rect(43, 10, 12, 1, c1)
   b.set_pixel(21, 11, c1)
   b.set_pixel(34, 11, c1)
   b.set_pixel(22, 12, c1)
   b.set_pixel(33, 12, c1)
   b.set_pixel(23, 13, c1)
   b.set_pixel(32, 13, c1)
   return b
  end
  #--------------------------------------------------------------------------
  # _white_arrow
  # Creates the minimap icon for other events.
  #--------------------------------------------------------------------------
  def self._white_arrow
   b = Bitmap.new(56, 14)
   c1 = Color.new(0, 0, 0)
   c2 = Color.new(255, 255, 255)
   b.set_pixel(23, 0, c1)
   b.set_pixel(32, 0, c1)
   b.set_pixel(22, 1, c1)
   b.fill_rect(23, 1, 1, 12, c2)
   b.fill_rect(24, 1, 1, 12, c1)
   b.fill_rect(31, 1, 1, 12, c1)
   b.fill_rect(32, 1, 1, 12, c2)
   b.set_pixel(33, 1, c1)
   b.set_pixel(21, 2, c1)
   b.fill_rect(22, 2, 1, 10, c2)
   b.fill_rect(33, 2, 1, 10, c2)
   b.set_pixel(34, 2, c1)
   b.fill_rect(1, 3, 12, 1, c1)
   b.set_pixel(20, 3, c1)
   b.fill_rect(21, 3, 1, 8, c2)
   b.fill_rect(34, 3, 1, 8, c2)
   b.set_pixel(35, 3, c1)
   b.fill_rect(48, 3, 2, 1, c1)
   b.set_pixel(0, 4, c1)
   b.fill_rect(1, 4, 12, 1, c2)
   b.set_pixel(13, 4, c1)
   b.set_pixel(19, 4, c1)
   b.fill_rect(20, 4, 1, 6, c2)
   b.fill_rect(35, 4, 1, 6, c2)
   b.set_pixel(36, 4, c1)
   b.set_pixel(47, 4, c1)
   b.fill_rect(48, 4, 2, 6, c2)
   b.set_pixel(50, 4, c1)
   b.set_pixel(1, 5, c1)
   b.fill_rect(2, 5, 10, 1, c2)
   b.set_pixel(12, 5, c1)
   b.set_pixel(18, 5, c1)
   b.fill_rect(19, 5, 1, 4, c2)
   b.fill_rect(36, 5, 1, 4, c2)
   b.set_pixel(37, 5, c1)
   b.set_pixel(46, 5, c1)
   b.fill_rect(47, 5, 1, 5, c2)
   b.fill_rect(50, 5, 1, 5, c2)
   b.set_pixel(51, 5, c1)
   b.set_pixel(2, 6, c1)
   b.fill_rect(3, 6, 8, 1, c2)
   b.set_pixel(11, 6, c1)
   b.fill_rect(17, 6, 1, 2, c1)
   b.fill_rect(18, 6, 1, 2, c2)
   b.fill_rect(37, 6, 1, 2, c2)
   b.fill_rect(38, 6, 1, 2, c1)
   b.set_pixel(45, 6, c1)
   b.fill_rect(46, 6, 1, 4, c2)
   b.fill_rect(51, 6, 1, 4, c2)
   b.set_pixel(52, 6, c1)
   b.set_pixel(3, 7, c1)
   b.fill_rect(4, 7, 6, 1, c2)
   b.set_pixel(10, 7, c1)
   b.set_pixel(44, 7, c1)
   b.fill_rect(45, 7, 1, 3, c2)
   b.fill_rect(52, 7, 1, 3, c2)
   b.set_pixel(53, 7, c1)
   b.set_pixel(4, 8, c1)
   b.fill_rect(5, 8, 4, 1, c2)
   b.set_pixel(9, 8, c1)
   b.set_pixel(18, 8, c1)
   b.set_pixel(37, 8, c1)
   b.set_pixel(43, 8, c1)
   b.fill_rect(44, 8, 1, 2, c2)
   b.fill_rect(53, 8, 1, 2, c2)
   b.set_pixel(54, 8, c1)
   b.set_pixel(5, 9, c1)
   b.fill_rect(6, 9, 2, 1, c2)
   b.set_pixel(8, 9, c1)
   b.set_pixel(19, 9, c1)
   b.set_pixel(36, 9, c1)
   b.set_pixel(42, 9, c1)
   b.set_pixel(43, 9, c2)
   b.set_pixel(54, 9, c2)
   b.set_pixel(55, 9, c1)
   b.fill_rect(6, 10, 2, 1, c1)
   b.set_pixel(20, 10, c1)
   b.set_pixel(35, 10, c1)
   b.fill_rect(43, 10, 12, 1, c1)
   b.set_pixel(21, 11, c1)
   b.set_pixel(34, 11, c1)
   b.set_pixel(22, 12, c1)
   b.set_pixel(33, 12, c1)
   b.set_pixel(23, 13, c1)
   b.set_pixel(32, 13, c1)
   return b
  end
  #--------------------------------------------------------------------------
  # _arrow
  # Creates the arrow displayed in the hotkey assignment menu.
  #--------------------------------------------------------------------------
  def self._arrow
   b = Bitmap.new(16, 9)
   c1 = Color.new(0, 0, 0)
   c2 = Color.new(255, 255, 255)
   c3 = Color.new(127, 127, 127)
   b.fill_rect(7, 0, 2, 1, c2)
   b.set_pixel(6, 1, c2)
   b.fill_rect(7, 1, 1, 7, c3)
   b.fill_rect(8, 1, 1, 7, c1)
   b.set_pixel(9, 1, c2)
   b.set_pixel(5, 2, c2)
   b.fill_rect(6, 2, 1, 6, c3)
   b.fill_rect(9, 2, 1, 6, c1)
   b.set_pixel(10, 2, c2)
   b.set_pixel(4, 3, c2)
   b.fill_rect(5, 3, 1, 5, c3)
   b.fill_rect(10, 3, 1, 5, c1)
   b.set_pixel(11, 3, c2)
   b.set_pixel(3, 4, c2)
   b.fill_rect(4, 4, 1, 4, c3)
   b.fill_rect(11, 4, 1, 4, c1)
   b.set_pixel(12, 4, c2)
   b.set_pixel(2, 5, c2)
   b.fill_rect(3, 5, 1, 3, c3)
   b.fill_rect(12, 5, 1, 3, c1)
   b.set_pixel(13, 5, c2)
   b.set_pixel(1, 6, c2)
   b.fill_rect(2, 6, 1, 2, c3)
   b.fill_rect(13, 6, 1, 2, c1)
   b.set_pixel(14, 6, c2)
   b.set_pixel(0, 7, c2)
   b.set_pixel(1, 7, c3)
   b.set_pixel(14, 7, c1)
   b.set_pixel(15, 7, c2)
   b.fill_rect(1, 8, 14, 1, c2)
   return b
  end
  #--------------------------------------------------------------------------
  # _minimap_autotile
  # Creates the minimap autotile for passability.
  #--------------------------------------------------------------------------
  def self._minimap_autotile
   b = Bitmap.new(24, 32)
   c1 = Color.new(191, 191, 191)
   c2 = Color.new(255, 255, 255)
   b.fill_rect(2, 0, 4, 1, c2)
   b.set_pixel(1, 1, c2)
   b.fill_rect(2, 1, 4, 6, c1)
   b.set_pixel(6, 1, c2)
   b.fill_rect(0, 2, 1, 4, c2)
   b.fill_rect(1, 2, 1, 4, c1)
   b.fill_rect(6, 2, 1, 4, c1)
   b.fill_rect(7, 2, 1, 4, c2)
   b.set_pixel(1, 6, c2)
   b.set_pixel(6, 6, c2)
   b.fill_rect(2, 7, 4, 1, c2)
   b.fill_rect(7, 8, 10, 1, c2)
   b.set_pixel(6, 9, c2)
   b.fill_rect(7, 9, 10, 22, c1)
   b.set_pixel(17, 9, c2)
   b.set_pixel(5, 10, c2)
   b.fill_rect(6, 10, 1, 20, c1)
   b.fill_rect(17, 10, 1, 20, c1)
   b.set_pixel(18, 10, c2)
   b.set_pixel(4, 11, c2)
   b.fill_rect(5, 11, 1, 18, c1)
   b.fill_rect(18, 11, 1, 18, c1)
   b.set_pixel(19, 11, c2)
   b.set_pixel(3, 12, c2)
   b.fill_rect(4, 12, 1, 16, c1)
   b.fill_rect(19, 12, 1, 16, c1)
   b.set_pixel(20, 12, c2)
   b.set_pixel(2, 13, c2)
   b.fill_rect(3, 13, 1, 14, c1)
   b.fill_rect(20, 13, 1, 14, c1)
   b.set_pixel(21, 13, c2)
   b.set_pixel(1, 14, c2)
   b.fill_rect(2, 14, 1, 12, c1)
   b.fill_rect(21, 14, 1, 12, c1)
   b.set_pixel(22, 14, c2)
   b.fill_rect(0, 15, 1, 10, c2)
   b.fill_rect(1, 15, 1, 10, c1)
   b.fill_rect(22, 15, 1, 10, c1)
   b.fill_rect(23, 15, 1, 10, c2)
   b.set_pixel(1, 25, c2)
   b.set_pixel(22, 25, c2)
   b.set_pixel(2, 26, c2)
   b.set_pixel(21, 26, c2)
   b.set_pixel(3, 27, c2)
   b.set_pixel(20, 27, c2)
   b.set_pixel(4, 28, c2)
   b.set_pixel(19, 28, c2)
   b.set_pixel(5, 29, c2)
   b.set_pixel(18, 29, c2)
   b.set_pixel(6, 30, c2)
   b.set_pixel(17, 30, c2)
   b.fill_rect(7, 31, 10, 1, c2)
   return b
  end
 end
Â
 #============================================================================
 # Player_Controller
 #----------------------------------------------------------------------------
 # This class is a special controller that controls the party leader.
 #============================================================================
Â
 class Player_Controller
 Â
  # Center screen x-coordinate * 4
  CX = (320 - 16) * 4
  # Center screen y-coordinate * 4
  CY = (240 - 16) * 4
 Â
  # set all accessable variables
  attr_accessor :normal_speed
  attr_accessor :actors
  attr_accessor :encounter_count
  #--------------------------------------------------------------------------
  # Initialization
  #--------------------------------------------------------------------------
  def initialize
   # set event trigger escape counter
   @evented = 0
   # set actor characters
   @actors = []
   # set memory jump
   @memory_jump = false
   # set normal speed
   @normal_speed = BlizzABS::Config::NORMAL_SPEED
  end
  #--------------------------------------------------------------------------
  # player
  # This method is used to make the code easier to read.
  #--------------------------------------------------------------------------
  def player
   return @actors[0]
  end
  #--------------------------------------------------------------------------
  # update_control
  # Processes player control.
  #--------------------------------------------------------------------------
  def update_control
   # get pixel movement rate
   pix = BlizzABS.pixel
   # reset move speed
   player.move_speed = @normal_speed
   # reset spriteset name
   player.character_name = player.character_name_org
   # if allowed to change speed
   unless $game_system.map_interpreter.running? ||
     player.move_route_forcing || $game_temp.message_window_showing
    # if run button works and running
    if Input.press?(Input::Run) && BlizzABS::Config::RUN_SPEED != 0
     # set running speed
     player.move_speed = BlizzABS::Config::RUN_SPEED
    # if sneak button works and sneaking
    elsif Input.press?(Input::Sneak) && BlizzABS::Config::SNEAK_SPEED != 0
     # set sneaking speed
     player.move_speed = BlizzABS::Config::SNEAK_SPEED
    end
   end
   # if battler exists and either dead or select triggered
   if player.battler != nil && (Input.trigger?(Input::Select) ||
     player.battler.dead?)
    # iterate "number of party members" times
    $game_party.actors.size.times {
      # change party leader
      $game_party.add_actor($game_party.actors.shift.id)
      # until finding one who's not dead
      break if $game_party.actors[0] != nil && !$game_party.actors[0].dead?}
    # center screen display on new player controlled character
    center(player.x, player.y, true)
    # enforce emptying moving buffer and add special command
    update_buffer(false)
    # set flag for HUD update
    $game_temp.hud_refresh = true
   end
   # update spriteset animation
   player.sprite_update
   # decrease event trigger escape counter if no interpreter running
   @evented -= 1 if @evented > 0 && !$game_system.map_interpreter.running?
   # if allowed to turn and pressed turning button or defending
   if ((player.defending && player.attacked == 0 &&
      player.in_action == 0) || Input.press?(Input::Turn)) &&
      !player.moving? && !$game_system.map_interpreter.running? &&
      !player.move_route_forcing && !$game_temp.message_window_showing
    # straighten
    player.straighten
    # depending on input turn
    case Input.dir4
    when 2 then player.turn_down
    when 4 then player.turn_left
    when 6 then player.turn_right
    when 8 then player.turn_up
    end
    # updates any attack action
    player.update_attacked
    # abort method
    return nil
   end
   # updates any attack action
   player.update_attacked
   # if acting
   if player.in_action > 0
    # decrease action counter if in_action is greater than 0
    player.in_action -= 1 if player.in_action > 0
    # return data
    return [player.moving?, player.real_x, player.real_y]
   end
   # if allowed to move
   unless $game_system.map_interpreter.running? ||
     player.move_route_forcing || $game_temp.message_window_showing
    # if jump button was pressed and not already jumping
    @memory_jump = true if Input.trigger?(Input::Jump) && !player.jumping?
    # if not moving
    unless player.moving?
     # get jumping range
     range = BlizzABS::Config::JUMPING
     # if jumping turned on and not jumping and jumped
     if range > 0 && !player.jumping? && @memory_jump
      # if sneaking or running is possible
      if BlizzABS::Config::RUN_SPEED > 0 || BlizzABS::Config::SNEAK_SPEED > 0
       # get difference between current speed and normal speed
       dplus = player.move_speed - @normal_speed
      else
       # difference is 0
       dplus = 0
      end
      # check input
      direction = ($game_system._8_way ? Input.dir8 : Input.dir4)
      # set jumping direction
      case direction
      when 1 then x, y = -1, 1
      when 2 then x, y = 0, 1
      when 3 then x, y = 1, 1
      when 4 then x, y = -1, 0
      when 6 then x, y = 1, 0
      when 7 then x, y = -1, -1
      when 8 then x, y = 0, -1
      when 9 then x, y = 1, -1
      else
       x, y = 0, 0
      end
      # jump into direction with considering running/sneaking
      player.jump(x*range + x*dplus, y*range + y*dplus, direction)
     elsif !player.jumping?
      # check input and attempt to move
      case ($game_system._8_way ? Input.dir8 : Input.dir4)
      when 1 then move(4) if !move(1) && !move(2)
      when 2 then move(2)
      when 3 then move(6) if !move(3) && !move(2)
      when 4 then move(4)
      when 6 then move(6)
      when 7 then move(4) if !move(7) && !move(8)
      when 8 then move(8)
      when 9 then move(6) if !move(9) && !move(8)
      end
     end
     # not jumping anymore
     @memory_jump = false
    end
   end
   # return data
   return [player.moving?, player.real_x, player.real_y]
  end
  #--------------------------------------------------------------------------
  # move
  # dir - direction
  # This method is used to make the code easier to read. It moves the player
  #--------------------------------------------------------------------------
  def move(dir)
   return case dir
   when 1 then player.move_lower_left
   when 2 then player.move_down
   when 3 then player.move_lower_right
   when 4 then player.move_left
   when 6 then player.move_right
   when 7 then player.move_upper_left
   when 8 then player.move_up
   when 9 then player.move_upper_right
   end
  end
  #--------------------------------------------------------------------------
  # update_move
  # Processes player control.
  #--------------------------------------------------------------------------
  def update_move(data)
   # if control update was not aborted
   if data != nil
    # if moved down
    if player.real_y > data[2] && player.real_y - $game_map.display_y > CY
     # scroll screen down
     $game_map.scroll_down(player.real_y - data[2])
    end
    # if moved left
    if player.real_x < data[1] && player.real_x - $game_map.display_x < CX
     # scroll screen left
     $game_map.scroll_left(data[1] - player.real_x)
    end
    # if moved right
    if player.real_x > data[1] && player.real_x - $game_map.display_x > CX
     # scroll screen right
     $game_map.scroll_right(player.real_x - data[1])
    end
    # if moved up
    if player.real_y < data[2] && player.real_y - $game_map.display_y < CY
     # scroll screen up
     $game_map.scroll_up(data[2] - player.real_y)
    end
    # if not moving
    unless player.moving?
     # if last moving
     if data[0]
      # if event triggered
      if @evented == 0 && check_event_trigger_here([1, 2])
       # set escape counter if moving before and event escape expired
       @evented = 40
      # if not override and countdown greater than 0
      elsif !($DEBUG && Input.press?(Input::CTRL)) && @encounter_count > 0
       # temporary variable
       count = @encounter_count - 2 ** (5 - $game_system.pixel_rate)
       # set battle-encounter countdown
       @encounter_count = [count, 0].max
      end
     end
     # if pressed C button
     if Input.trigger?(Input::C)
      # check event here
      check_event_trigger_here([0])
      # check event there
      check_event_trigger_there([0, 1, 2])
     end
    end
   end
   # update actors' characters
   update_actors
   # update ABS controls
   $game_system.controls.update
  end
  #--------------------------------------------------------------------------
  # update_buffer
  # move - new command
  # Updates the buffer of the last moving commands.
  #--------------------------------------------------------------------------
  def update_buffer(move)
   # empty each actor's buffer if new command requires so
   @actors.each {|actor| actor.buffer = []} if [nil, false].include?(move)
   # add new command or enforce emptying whether move is reset for each actor
   @actors.each {|actor| actor.update_buffer(move == 'reset' ? nil : move)}
  end
  #--------------------------------------------------------------------------
  # update_actors
  # Updates all the actors on the map.
  #--------------------------------------------------------------------------
  def update_actors
   # update each other actor except the player
   @actors[1, @actors.size-1].each {|actor| actor.update}
   # set stopped animation flag if player's character is animated
   @step_anime = true if BlizzABS::Config::ANIMATED_IDS.include?(player.battler.id)
  end
  #--------------------------------------------------------------------------
  # refresh
  # Refreshes the character.
  #--------------------------------------------------------------------------
  def refresh
   # if CATERPILLAR is active
   if Config::CATERPILLAR
    # test on changes in the inner structure of $game_party.actors
    if @actors.any? {|actor|
      actor.battler == nil && $game_party.actors[actor.index] != nil ||
      actor.battler != $game_party.actors[actor.index]}
     # store old array and create new array
     old, @actors = @actors, []
     # for each old actor
     old.each {|a|
       # if battler exists and in party
       if a.battler != nil && a.battler.index != nil
        # add actor on position
        @actors[a.battler.index] = a
       end}
     # for each old actor
     old.each {|a|
       # remove battler if not in party
       a.battler = nil if a.battler != nil && a.battler.index == nil
       # add actor if battler doesn't exist
       @actors.push(a) if a.battler == nil}
     # for each actor
     @actors.each {|a|
       # if no battler assigned, but in the party is a battler
       if a.battler == nil && $game_party.actors[a.index] != nil
      Â