Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Request A HUD

Status
Not open for further replies.
http://i12.photobucket.com/albums/a229/meismeofcourse/RequestAHUDToday.png[/IMG]


This is a special script request station for HUDs(Heads Up Display). For a short time, I will script HUDs requested one at a time.

No more requests will be accepted from now on.

Current Requests:
MistTribe(Post #23) - Standby(Too vague)
zealex(Post #28) - Standby(Waiting for MistTribe's HUD)

Completed HUDs:
Code:
#==============================================================================
#  ** HUD for Sasame_Kiryu
#   * Made by MeisMe
#     September 2006
#==============================================================================

class Window_MapActor < Window_Base
  def initialize
    super(-16, 272, 672, 224)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.opacity = 0
    self.contents_opacity = $game_player.screen_y >= 292 ? 90 : 255
    @wait_count = Graphics.frame_rate * 3
    refresh
  end
  def refresh
    self.contents.clear
    for i in 0...8
      x = (i % 4) * 160
      y = (i / 4) * 96
      bitmap = RPG::Cache.picture('HUD Window')
      self.contents.blt(x, y, bitmap, Rect.new(0, 0, 160, 96))
      x += 4
      actor = $game_party.actors[i]
      if actor
        draw_actor_graphic(actor, x + 12, y + 92)
        draw_actor_state(actor, x, y, 156)
        draw_actor_hp(actor, x, y + 32, 156)
        draw_actor_sp(actor, x, y + 64, 156)
      else
        self.contents.draw_text(x, y + 32, 160, 32, 'No data', 1)
      end
    end
  end
  def update
    super
    if @wait_count == 0
      self.contents_opacity -= 16 if self.contents_opacity > 0
    else
      @wait_count -= 1
      if $game_player.screen_y >= 292
        self.contents_opacity -= 15 if self.contents_opacity > 90
      else
        self.contents_opacity += 15 if self.contents_opacity < 255
      end
    end
  end
end

class Scene_Map
  alias old_main main
  alias old_update update
  def main
    @mapactor_window = Window_MapActor.new
    old_main
    @mapactor_window.dispose
  end
  def update
    @mapactor_window.update
    old_update
  end
end
Required picture:
http://i12.photobucket.com/albums/a229/ ... Holder.png[/IMG]
Code:
#==============================================================================
#  ** HUD for Immortal
#   * Made by MeisMe
#     September 2006
#==============================================================================

#--------------------------------------------------------------------------
# * SDK Log Script
#--------------------------------------------------------------------------
SDK.log("ABS HUD", "MeisMe", 1, "Septemver 2006")

#--------------------------------------------------------------------------
# * Begin SDK Enable Test
#--------------------------------------------------------------------------
if (SDK.state("ABS") == true && SDK.state("ABS HUD") == true)

  class Game_Actor
    #--------------------------------------------------------------------------
    # * Get the current EXP
    #--------------------------------------------------------------------------
    def now_exp
      return @level != $data_actors[@actor_id].final_level ? @exp - 
        @exp_list[@level] : 1
    end
    #--------------------------------------------------------------------------
    # * Get the next level's EXP
    #--------------------------------------------------------------------------
    def next_exp
      return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - 
        @exp_list[@level] : 1
    end
  end
  
  class Window_HUD < Window_Base
    def initialize
      super(-16, -16, 672, 128)
      self.contents = Bitmap.new(width - 32, height - 32)
      self.opacity = 0
      self.contents_opacity = $game_player.screen_y <= 112 ? 90 : 255
      self.contents.font.size = 14
      refresh
    end
    def refresh
      reset_variables
      self.contents.clear
      return if !@actor
      draw_actor_graphic(@actor, 16, 64)
      draw_actor_hpbar(@actor, 32, 0, 100, 6)
      draw_actor_spbar(@actor, 32, 24, 100, 6)
      draw_actor_expbar(@actor, 32, 48, 100, 6)
      bitmap = RPG::Cache.picture('Skill Holder')
      self.contents.blt(320, 0, bitmap, Rect.new(0, 0, 320, 32))
      for i in 0...$ABS.skills.size
        next if !$ABS.skills[i]
        if i == 0
          x = 608
        else
          x = (i - 1) * 32 + 320
        end
        y = 0
        skill = $data_skills[$ABS.skills[i]]
        bitmap = RPG::Cache.icon(skill.icon_name)
        self.contents.blt(x + 5, y + 5, bitmap, Rect.new(0, 0, 24, 24))
      end
    end
    def reset_variables
      @actor = $game_party.actors[0]
      @skills = $ABS.skills
      @old_hp = @actor ? @actor.hp : 0
      @old_mhp = @actor ? @actor.maxhp : 0
      @old_sp = @actor ? @actor.sp : 0
      @old_msp = @actor ? @actor.maxsp : 0
      @old_exp = @actor ? @actor.now_exp : 0
      @old_nextexp = @actor ? @actor.next_exp : 0
    end
    def draw_actor_hpbar(actor, x, y, length, height)
      percent = actor.hp * length / actor.maxhp
      self.contents.fill_rect(x, y + 14, length + 2, height + 2, 
        Color.new(255, 246, 229))
      self.contents.fill_rect(x + 1, y + 15, length, height,
        Color.new(0, 0, 0))
      self.contents.fill_rect(x + 1, y + 15, percent, height, 
        Color.new(200, 0, 0))
      self.contents.font.color = system_color
      self.contents.draw_text(x, y, 32, 16, $data_system.words.hp)
      self.contents.font.color = normal_color
      text = "#{actor.hp}/#{actor.maxhp}"
      self.contents.draw_text(x, y, length + 2, 16, text, 2)
    end
    def draw_actor_spbar(actor, x, y, length, height)
      percent = actor.sp * length / actor.maxsp
      self.contents.fill_rect(x, y + 14, length + 2, height + 2, 
        Color.new(255, 246, 229))
      self.contents.fill_rect(x + 1, y + 15, length, height,
        Color.new(0, 0, 0))
      self.contents.fill_rect(x + 1, y + 15, percent, height, 
        Color.new(0, 0, 200))
      self.contents.font.color = system_color
      self.contents.draw_text(x, y, 32, 16, $data_system.words.sp)
      self.contents.font.color = normal_color
      text = "#{actor.sp}/#{actor.maxsp}"
      self.contents.draw_text(x, y, length + 2, 16, text, 2)
    end
    def draw_actor_expbar(actor, x, y, length, height)
      percent = actor.now_exp * length / actor.next_exp
      self.contents.fill_rect(x, y + 14, length + 2, height + 2, 
        Color.new(255, 246, 229))
      self.contents.fill_rect(x + 1, y + 15, length, height,
        Color.new(0, 0, 0))
      self.contents.fill_rect(x + 1, y + 15, percent, height, 
        Color.new(0, 200, 0))
      self.contents.font.color = system_color
      self.contents.draw_text(x, y, 32, 16, 'EXP')
      self.contents.font.color = normal_color
      text = "#{actor.now_exp}/#{actor.next_exp}"
      self.contents.draw_text(x, y, length + 2, 16, text, 2)
    end
    def update
      super
      refresh if state_change?
      if $game_player.screen_y <= 112
        self.contents_opacity -= 15 if self.contents_opacity > 90
      else
        self.contents_opacity += 15 if self.contents_opacity < 255
      end
    end
    def state_change?
      if (@actor != $game_party.actors[0] or
          @skills != $ABS.skills or
          @old_hp != @actor ? @actor.hp : 0 or
          @old_mhp != @actor ? @actor.maxhp : 0 or
          @old_sp != @actor ? @actor.sp : 0 or
          @old_msp != @actor ? @actor.maxsp : 0 or
          @old_exp != @actor ? @actor.now_exp : 0 or
          @old_nextexp = @actor ? @actor.next_exp : 0)
        return true
      end
      return false
    end
  end
  
  class Scene_Map
    alias hud_main_draw main_draw
    def main_draw
      @HUD = Window_HUD.new
      hud_main_draw
    end
    alias hud_update_graphics update_graphics
    def update_graphics
      @HUD.update
      hud_update_graphics
    end
  end
  
#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end
Required Picture:
http://i12.photobucket.com/albums/a229/ ... eonHUD.png[/img]
Code:
#==============================================================================
#  ** HUD for Deon204
#   * Scripted by MeisMe
#     September 2006
#==============================================================================

class Game_Actor
  #--------------------------------------------------------------------------
  # * Get the current EXP
  #--------------------------------------------------------------------------
  def now_exp
    return @level != $data_actors[@actor_id].final_level ? @exp - 
      @exp_list[@level] : 1
  end
  #--------------------------------------------------------------------------
  # * Get the next level's EXP
  #--------------------------------------------------------------------------
  def next_exp
    return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - 
      @exp_list[@level] : 1
  end
end

class Window_HUDMain < Window_Base
  def initialize
    super(-16, 358, 672, 138)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.opacity = 0
    self.contents.font.size = 16
    if (($game_player.screen_y >= 368 && $game_player.screen_x <= 288) ||
        ($game_player.screen_y >= 400 && $game_player.screen_x >= 480))
      self.contents_opacity = 90
    end
    refresh
  end
  def refresh
    reset_variables
    self.contents.clear
    background = RPG::Cache.picture('DeonHUD')
    self.contents.blt(0, 0, background, Rect.new(0, 0, 640, 106))
    if @actor
      bitmap = RPG::Cache.hudface(@actor.name)
      self.contents.blt(17, 15, bitmap, Rect.new(0, 0, 61, 74))
      draw_actor_hpbar(@actor, 85, 32, 75, 9)
      draw_actor_spbar(@actor, 85, 74, 75, 9)
      self.contents.draw_text(81, 5, 21, 27, $data_system.words.hp)
      text = "#{@actor.hp}/#{@actor.maxhp}"
      self.contents.draw_text(100, 5, 60, 27, text, 2)
      self.contents.draw_text(81, 47, 21, 27, $data_system.words.sp)
      text = "#{@actor.sp}/#{@actor.maxsp}"
      self.contents.draw_text(100, 47, 60, 27, text, 2)
      self.contents.draw_text(176, 15, 40, 27, 'Time:')
      self.contents.draw_text(176, 67, 40, 27, 'Status:')
      self.contents.draw_text(494, 39, 40, 27, $data_system.words.gold + ':')
      self.contents.draw_text(494, 39, 138, 27, @gold.to_s, 2)
      self.contents.draw_text(494, 77, 40, 24, 'EXP:')
      text = "#{@actor.now_exp}/#{@actor.next_exp}"
      self.contents.draw_text(494, 77, 138, 24, text, 2)
    end
  end
  def reset_variables
    @actor = $game_party.actors[0]
    @gold = $game_party.gold
    @hp = @actor ? @actor.hp : 0
    @mhp = @actor ? @actor.maxhp : 0
    @sp = @actor ? @actor.sp : 0
    @msp = @actor ? @actor.maxsp : 0
    @nowexp = @actor ? @actor.now_exp : 0
    @nextexp = @actor ? @actor.next_exp : 0
  end
  def draw_actor_hpbar(actor, x, y, width, height)
    percent = actor.hp * (width - 4) / actor.maxhp
    self.contents.fill_rect(x, y, width, height, Color.new(0, 0, 0))
    self.contents.fill_rect(x + 2, y + 2, percent, height - 4,
      Color.new(255, 0, 0))
  end
  def draw_actor_spbar(actor, x, y, width, height)
    percent = actor.sp * (width - 4) / actor.maxsp
    self.contents.fill_rect(x, y, width, height, Color.new(0, 0, 0))
    self.contents.fill_rect(x + 2, y + 2, percent, height - 4,
      Color.new(0, 0, 255))
  end
  def update
    super
    if (@actor != $game_party.actors[0] or
        @gold != $game_party.gold or
        @hp != @actor ? @actor.hp : 0 or
        @mhp != @actor ? @actor.maxhp : 0 or
        @sp != @actor ? @actor.sp : 0 or
        @msp != @actor ? @actor.maxsp : 0 or
        @nowexp != @actor ? @actor.now_exp : 0 or
        @nextexp != @actor ? @actor.next_exp : 0)
      refresh
    end
    if (($game_player.screen_y >= 368 && $game_player.screen_x <= 288) ||
        ($game_player.screen_y >= 400 && $game_player.screen_x >= 480))
      self.contents_opacity -= 15 if self.contents_opacity > 90
    else
      self.contents_opacity += 15 if self.contents_opacity < 255
    end
  end
end

class Window_HUDTS < Window_Base
  def initialize
    super(-16, 358, 672, 138)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.opacity = 0
    self.contents.font.size = 16
    @blink = 0
    if (($game_player.screen_y >= 368 && $game_player.screen_x <= 288) ||
        ($game_player.screen_y >= 400 && $game_player.screen_x >= 480))
      self.contents_opacity = 90
    end
    refresh
  end
  def refresh
    reset_variables
    self.contents.clear
    self.contents.font.color = normal_color
    self.contents.draw_text(176, 15, 96, 27, @time, 2)
    self.contents.font.color = status_color
    text = @state ? $data_states[@state].name : 'Normal'
    self.contents.draw_text(176, 67, 96, 27, text, 2)
  end
  def reset_variables
    @actor = $game_party.actors[0]
    @time = $ats.clock
    @state = @actor ? @actor.states[0] : ''
  end
  def status_color
    case @state
    when 1
      return Color.new(255, 0, 0)
    when 2
      return Color.new(255, 0, 255)
    when 3
      return Color.new(160, 160, 160)
    when 4
      if @blink > 5
        return Color.new(255, 255, 255)
      else
        return Color.new(160, 160, 160)
      end
    when 5
      return Color.new(255, 255, 0)
    when 6
      return Color.new(160, 0, 0)
    end
    return Color.new(0, 255, 0)
  end
  def update
    super
    if (@actor != $game_party.actors[0] or
        @time != $ats.clock or
        @state != @actor ? @actor.states[@actor.states.size - 1] : '')
      refresh
    end
    if @state == 4
      @blink = (@blink + 1) % 10
      refresh if @blink == 0 or @blink == 5
    else
      @blink = 0
    end
    if (($game_player.screen_y >= 368 && $game_player.screen_x <= 288) ||
        ($game_player.screen_y >= 400 && $game_player.screen_x >= 480))
      self.contents_opacity -= 15 if self.contents_opacity > 90
    else
      self.contents_opacity += 15 if self.contents_opacity < 255
    end
  end
end

class Scene_Map
  alias hud_main main
  alias hud_update update
  def main
    @HUD = Window_HUDMain.new
    @HUD2 = Window_HUDTS.new
    hud_main
    @HUD.dispose
    @HUD2.dispose
  end
  def update
    @HUD.update
    @HUD2.update
    hud_update
  end
end

module RPG
  module Cache
    def self.hudface(filename)
      self.load_bitmap("Graphics/Characters/Hudface/", filename)
    end
  end
end
Sent by PM on a special request. HUD will be availiable from his Zombie Starter Pack
Code:
#==============================================================================
#  ** HUD for Zavoria
#   * Scripted by MeisMe
#     September 2006
#==============================================================================

class Game_Player
  attr_reader :sanity
  def initialize
    super
    @sanity = 100
    @frame_count = 0
  end
  def increase_steps
    super
    # If move route is not forcing
    unless @move_route_forcing
      # Increase steps
      $game_party.increase_steps
      # Number of steps are an even number
      if $game_party.steps % 2 == 0
        # Slip damage check
        $game_party.check_map_slip_damage
        @sanity -= 2 if @sanity > 0
        @sanity = 0 if @sanity < 0
      end
    end
  end
  def update
    @frame_count += 1
    # Remember whether or not moving in local variables
    last_moving = moving?
    # If moving, event running, move route forcing, and message window
    # display are all not occurring
    unless moving? or $game_system.map_interpreter.running? or
           @move_route_forcing or $game_temp.message_window_showing
      if (@frame_count % (Graphics.frame_rate / 2) == 0) && (@sanity < 100)
        @sanity += 1
      end
      # Move player in the direction the directional button is being pressed
      case Input.dir4
      when 2
        if @sanity != 0
          move_down
          @frame_count = 0
        end
      when 4
        if @sanity != 0
          move_left
          @frame_count = 0
        end
      when 6
        if @sanity != 0
          move_right
          @frame_count = 0
        end
      when 8
        if @sanity != 0
          move_up
          @frame_count = 0
        end
      end
    end
    # Remember coordinates in local variables
    last_real_x = @real_x
    last_real_y = @real_y
    super
    # If character moves down and is positioned lower than the center
    # of the screen
    if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
      # Scroll map down
      $game_map.scroll_down(@real_y - last_real_y)
    end
    # If character moves left and is positioned more let on-screen than
    # center
    if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X
      # Scroll map left
      $game_map.scroll_left(last_real_x - @real_x)
    end
    # If character moves right and is positioned more right on-screen than
    # center
    if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X
      # Scroll map right
      $game_map.scroll_right(@real_x - last_real_x)
    end
    # If character moves up and is positioned higher than the center
    # of the screen
    if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y
      # Scroll map up
      $game_map.scroll_up(last_real_y - @real_y)
    end
    # If not moving
    unless moving?
      # If player was moving last time
      if last_moving
        # Event determinant is via touch of same position event
        result = check_event_trigger_here([1,2])
        # If event which started does not exist
        if result == false
          # Disregard if debug mode is ON and ctrl key was pressed
          unless $DEBUG and Input.press?(Input::CTRL)
            # Encounter countdown
            if @encounter_count > 0
              @encounter_count -= 1
            end
          end
        end
      end
      # If C button was pressed
      if Input.trigger?(Input::C)
        # Same position and front event determinant
        check_event_trigger_here([0])
        check_event_trigger_there([0,1,2])
      end
    end
  end    
  def update_sanity?
  end
end

class Window_HUD < Window_Base
  def initialize
    super(-16, -16, 128, 96)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.size = 18
    self.opacity = 0
    refresh
  end
  def refresh
    reset_variables
    self.contents.clear
    self.contents.draw_text(5, 0, 64, 32, $data_system.words.hp)
    self.contents.draw_text(5, 32, 64, 32, 'Sanity')
    self.contents.fill_rect(5, 24, 64, 4, Color.new(0, 0, 0))
    p = @hp * 64 / @mhp
    self.contents.fill_rect(5, 24, p, 4, Color.new(255, 0, 0))
    self.contents.fill_rect(5, 56, 64, 4, Color.new(0, 0, 0))
    p = @sanity * 64 / 100
    self.contents.fill_rect(5, 56, p, 4, Color.new(128, 0, 128))
    draw_actor_graphic(@actor, 84, 64)
  end
  def reset_variables
    @actor = $game_party.actors[0]
    @hp = @actor ? @actor.hp : 0
    @mhp = @actor ? @actor.maxhp : 0
    @sanity = $game_player.sanity
  end
  def update
    super
    if (@actor = $game_party.actors[0] or
        @hp = @actor ? @actor.hp : 0 or
        @mhp = @actor ? @actor.maxhp : 0 or
        @sanity = $game_player.sanity)
      refresh
    end
  end
end

class Scene_Map
  alias hud_main main
  alias hud_update update
  def main
    @HUD = Window_HUD.new
    hud_main
    @HUD.dispose
  end
  def update
    @HUD.update
    hud_update
  end
end
Too vague of a description
Code:
#---------------
# Skills Window
#---------------
class Window_HudSkills < Window_Base
  def initialize
    super(8, 8, 80, 285)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.back_opacity = 180
    self.opacity = 0
    refresh
  end
  def refresh
    self.contents.clear
    @bitmap1 = RPG::Cache.picture("skillsback.png")
    self.contents.blt(0, 0, @bitmap1, Rect.new(0, 0, @bitmap1.width, 
                      @bitmap1.height))
    @bitmap2 = RPG::Cache.picture("skillnums.png")
    self.contents.blt(0, 0, @bitmap2, Rect.new(0, 0, @bitmap2.width, 
                      @bitmap2.height))
    for i in 1..5
      next if !$ABS.skills[i]
      x = 12
      y = 12 + (i * 27)
      skill = $data_skills[$ABS.skills[i]]
      bitmap = RPG::Cache.icon(skill.icon_name)
      self.contents.blt(x, y, bitmap, Rect.new(0, 0, 24, 24))
    end
  end
end

Please note that ALL HUds that I make will be open source. Feel free to make edits to them as you please, as long as you credit the original version. If you don't like this, go and make your own HUD!
 
Hi there! I'd like to request a HUD plz ^_^!

It doesn't have to have much. I just need the charset of the main character in the top left-hand corner (the player can decide their characters appearance, so I can't give you a preset image :()! I also need a HP, SP and EXP bar on the right of the charaset. Also, plz, on the top right hand corner could there be 5 dark blue circles. These will be empty unless they assign a skill (on the keys 1 - 5) using Near Fantasia's ABS Version 4. So, if they assign a skill to number key 2, the second blue circle would show the symbol of that skills. If you need any more info, let me now! Oh, and my game does use the SDK. Thanks in advance :D!

(You'll get credit)!
 
I want something simple that'll display the parties HP, SP, and state when the parties finishes a battle. Not in the battle status window, on the map ;P (It's a HUD, right? XD) Anyways, I want it so that it displays that for about 3 seconds after a battle. Simple and sleek X3

I have an 8 person CMS, so I want it so that it's displayed like so:

http://i22.photobucket.com/albums/b335/JohnerX/HUD.png[/IMG]

There should be text in there, and the windows should be seperated, but that's just something for you to see how much of the screen I want this to take up. I'd also like for the windows to be semi-transparent.

Use this picture for the status window:

http://i22.photobucket.com/albums/b335/ ... indow2.png[/IMG]

If you display the HP and SP, plug and play bars should display automatically, right?

Anyways, that's my request. Not sure if it's a HUD or not =\, but you get the idea. I'll credit you, of course ;P
 
Here..

Code:
#==============================================================================
# â–  Action Battle System
#==============================================================================
# By Near Fantastica
# Version 4
# 29.11.05
#==============================================================================
# â–  ABS Key Commands
#==============================================================================
#   A    ● Dash
#   S    ● Sneak
#   D    ● Attack
#   1    ● Skill Key 1
#   2    ● Skill Key 2
#   3    ● Skill Key 3
#   4    ● Skill Key 4
#   5    ● Skill Key 5
#   6    ● Skill Key 6
#   7    ● Skill Key 7
#   8    ● Skill Key 8
#   9    ● Skill Key 9
#   0    ● Skill Key 0
#==============================================================================
# â–  ABS Enemy Ai List
#==============================================================================
#   Name
#   Name Of the Enemy in The Data Base
#---------------------------------------------------------------------------
#   Behavior
#   Passive = 0 ● The Event (Enemy) will only attack when attacked
#   Aggressive = 1 ● The Event will attack when one of its Detection level are set true
#   Linking = 2 ● Event will only attack when another Event is attacked with in its Detection level
#   Aggressive Linking = 3 ● Event will attack when either Aggressive or Linking is true
#---------------------------------------------------------------------------
#   Detection
#   Sound = range ● The range of sound the enemy can hear inactive if set to zero
#   Sight = range ● The range of sightthe enemy can see inactive if set to zero
#---------------------------------------------------------------------------
#   Aggressiveness
#   Aggressiveness = Level ● The high number the less Aggressive the Event
#---------------------------------------------------------------------------
#   Movement
#   Speed = Level ● The movment Speed of the event when engaged
#   Frequency = Level  ● The movment Frequency of the event when engaged 
#---------------------------------------------------------------------------
#   Trigger
#   Erased = 0  ● The event will be erased on death
#   Switch = 1  ● The event will be trigger Switch[ID] on death
#   Varible = 2  ● The event will be set the Varible[ID] = VALUE on death
#   Local Switch = 3 ● The event will trigger Local_Switch[ID] on death
#==============================================================================
# â–  ABS Range Constant
#==============================================================================
#   RANGE_WEAPONS[Weapon Id] = 
#   ["Character Set Name", Ammo Speed, Anmiation Id, Ammo Item Id, Range]
#   RANGE_SKILLS[Skill Id] = 
#   [Range, Ammo Speed, "Character Set Name"]
#==============================================================================

#--------------------------------------------------------------------------
# * SDK Log Script
#--------------------------------------------------------------------------
SDK.log("ABS", "Near Fantastica", 4, "29.11.05")

if SDK.state("Input") == nil or SDK.state("Input") == false
p "Input Addition Not Found"
SDK.disable("ABS")
end

#--------------------------------------------------------------------------
# * Begin SDK Enable Test
#--------------------------------------------------------------------------
if SDK.state("ABS") == true

class ABS
  #--------------------------------------------------------------------------
  RANGE_WEAPONS = {}
  RANGE_WEAPONS[17] = ["Arrow", 5, 4, 35, 10]
  RANGE_WEAPONS[18] = ["Arrow", 5, 4, 35, 10]
  RANGE_WEAPONS[19] = ["Arrow", 5, 4, 35, 10]
  RANGE_WEAPONS[20] = ["Arrow", 5, 4, 35, 10]
  #--------------------------------------------------------------------------
  RANGE_SKILLS = {}
  RANGE_SKILLS[7] = [10, 5, "Magic Balls"]
  RANGE_SKILLS[8] = [10, 5, "Magic Balls"]
  RANGE_SKILLS[10] = [10, 5, "Magic Balls"]
  RANGE_SKILLS[11] = [10, 5, "Magic Balls"]
  RANGE_SKILLS[13] = [10, 5, "Magic Balls"]
  RANGE_SKILLS[14] = [10, 5, "Magic Balls"]
  RANGE_SKILLS[16] = [10, 5, "Magic Balls"]
  RANGE_SKILLS[17] = [10, 5, "Magic Balls"]
  RANGE_SKILLS[19] = [10, 5, "Magic Balls"]
  RANGE_SKILLS[20] = [10, 5, "Magic Balls"]
  RANGE_SKILLS[22] = [10, 5, "Magic Balls"]
  RANGE_SKILLS[23] = [10, 5, "Magic Balls"]
  RANGE_SKILLS[25] = [10, 5, "Magic Balls"]
  RANGE_SKILLS[26] = [10, 5, "Magic Balls"]
  RANGE_SKILLS[28] = [10, 5, "Magic Balls"]
  RANGE_SKILLS[29] = [10, 5, "Magic Balls"]
  RANGE_SKILLS[31] = [10, 5, "Magic Balls"]
  RANGE_SKILLS[33] = [10, 5, "Magic Balls"]
  RANGE_SKILLS[35] = [10, 5, "Magic Balls"]
  RANGE_SKILLS[37] = [10, 5, "Magic Balls"]
  RANGE_SKILLS[39] = [10, 5, "Magic Balls"]
  RANGE_SKILLS[41] = [10, 5, "Magic Balls"]
  RANGE_SKILLS[43] = [10, 5, "Magic Balls"]
  RANGE_SKILLS[45] = [10, 5, "Magic Balls"]
  RANGE_SKILLS[47] = [10, 5, "Magic Balls"]
  RANGE_SKILLS[49] = [10, 5, "Magic Balls"]
  RANGE_SKILLS[51] = [10, 5, "Magic Balls"]
  RANGE_SKILLS[57] = [1, 5, "Magic Balls"]
  RANGE_SKILLS[58] = [1, 5, "Magic Balls"]
  RANGE_SKILLS[59] = [1, 5, "Magic Balls"]
  RANGE_SKILLS[60] = [1, 5, "Magic Balls"]
  RANGE_SKILLS[61] = [1, 5, "Magic Balls"]
  RANGE_SKILLS[62] = [1, 5, "Magic Balls"]
  RANGE_SKILLS[63] = [1, 5, "Magic Balls"]
  RANGE_SKILLS[64] = [1, 5, "Magic Balls"]
  RANGE_SKILLS[65] = [1, 5, "Magic Balls"]
  RANGE_SKILLS[66] = [1, 5, "Magic Balls"]
  RANGE_SKILLS[67] = [1, 5, "Magic Balls"]
  RANGE_SKILLS[68] = [1, 5, "Magic Balls"]
  RANGE_SKILLS[69] = [1, 5, "Magic Balls"]
  RANGE_SKILLS[70] = [1, 5, "Magic Balls"]
  RANGE_SKILLS[71] = [1, 5, "Magic Balls"]
  RANGE_SKILLS[72] = [1, 5, "Magic Balls"]
  RANGE_SKILLS[73] = [1, 5, "Magic Balls"]
  RANGE_SKILLS[74] = [1, 5, "Magic Balls"]
  RANGE_SKILLS[75] = [1, 5, "Magic Balls"]
  RANGE_SKILLS[76] = [1, 5, "Magic Balls"]
  RANGE_SKILLS[77] = [1, 5, "Magic Balls"]
  RANGE_SKILLS[78] = [1, 5, "Magic Balls"]
  RANGE_SKILLS[79] = [1, 5, "Magic Balls"]
  RANGE_SKILLS[80] = [1, 5, "Magic Balls"]
  #--------------------------------------------------------------------------
  DASH_KEY = Input::Letters["A"]
  SNEAK_KEY = Input::Letters["S"]
  ATTACK_KEY = Input::Letters["D"]
  SKILL_KEYS = Input::Numberkeys
  #--------------------------------------------------------------------------
  attr_accessor :enemies
  attr_accessor :range
  attr_accessor :skills
  attr_accessor :dash_level
  attr_accessor :sneak_level
  attr_accessor :p_animations
  attr_accessor :e_animations
  #--------------------------------------------------------------------------
  def initialize
    # Enemies
    @enemies = {}
    # Range
    @range = []
    # Skills
    @skills = []
    # Dashing
    @dashing = false
    @dash_restore = false
    @dash_reduce= false
    @dash_timer = 0
    @dash_level = 5
    @dash_sec = 0
    # Sneaking
    @sneaking = false
    @sneak_restore = false
    @sneak_reduce= false
    @sneak_timer = 0
    @sneak_level = 5
    @sneak_sec = 0
    # Button Mashing
    @mash_bar = 0
    #Animation
    @p_animations = false 
    @e_animations = false
  end
  #--------------------------------------------------------------------------
  def ATTACK_KEY
    return ATTACK_KEY
  end
  #--------------------------------------------------------------------------
  def SKILL_KEYS
    return SKILL_KEYS
  end
  #--------------------------------------------------------------------------
  def RANGE_WEAPONS
    return RANGE_WEAPONS
  end
  #--------------------------------------------------------------------------
  def RANGE_SKILLS
    return RANGE_SKILLS
  end
  #--------------------------------------------------------------------------
  # * ABS Animation Engine Functions
  #--------------------------------------------------------------------------
  # Handles animating map sprites for a wide variety of uses
  #--------------------------------------------------------------------------
  def animate(object, animation_name, position, wait = 8, frames = 0, repeat = 0)
    if object != nil
      object.animate(animation_name, position, frames, wait, repeat)
    end
  end
  #--------------------------------------------------------------------------
  def refresh(event, list, character_name)
    @enemies.delete(event.id)
    return if character_name == ""
    return if list == nil
    parameters = SDK.event_comment_input(event, 9, "ABS Event Command List")
    return if parameters.nil?
    name = parameters[0].split
    for x in 1...$data_enemies.size
      enemy = $data_enemies[x]
      if name[1].upcase == enemy.name.upcase
        @enemies[event.id] = Game_ABS_Enemy.new(enemy.id)
        @enemies[event.id].event_id = event.id
        default_setup(event.id)
        level = parameters[1].split
        @enemies[event.id].level = level[1].to_i
        behavior = parameters[2].split
        @enemies[event.id].behavior = behavior[1].to_i
        sound = parameters[3].split
        @enemies[event.id].detection_sound = sound[1].to_i
        sight = parameters[4].split
        @enemies[event.id].detection_sight = sight[1].to_i
        aggressiveness = parameters[5].split
        @enemies[event.id].aggressiveness = aggressiveness[1].to_i
        speed = parameters[6].split
        @enemies[event.id].speed = speed[1].to_i
        frequency = parameters[7].split
        @enemies[event.id].frequency = frequency[1].to_i
        trigger = parameters[8].split
        @enemies[event.id].trigger= [trigger[1].to_i, trigger[2].to_i, trigger[3].to_i]
      end
    end
  end
  #--------------------------------------------------------------------------
  def default_setup(id)
    @enemies[id].level = 1
    @enemies[id].behavior = 1
    @enemies[id].detection_sight = 1
    @enemies[id].detection_sound = 4
    @enemies[id].aggressiveness = 2
    @enemies[id].engaged = false
    @enemies[id].speed = 4
    @enemies[id].frequency = 5
  end
  #--------------------------------------------------------------------------
  def update
    update_dash if @sneaking == false 
    update_sneak if @dashing == false
    update_enemies if @enemies != {}
    update_player
    update_range
    Graphics.frame_reset
  end
  #--------------------------------------------------------------------------
  def update_range
    for range in @range
      range.update
    end
  end
  #--------------------------------------------------------------------------
  def update_player
    actor = $game_party.actors[0]
    @mash_bar = 100 if @mash_bar >= 100
    @mash_bar += 10
  end
  #--------------------------------------------------------------------------
  def update_dash
    if Input.pressed?(DASH_KEY)
      if $game_player.moving?
        @dashing = true
        $game_player.move_speed = 5
        @dash_restore = false
        if @dash_reduce == false
          @dash_timer = 50 # Initial time off set
          @dash_reduce = true
        else
          @dash_timer-= 1
        end
        @dash_sec = (@dash_timer / Graphics.frame_rate)%60
        if @dash_sec == 0
          if @dash_level != 0
            @dash_level -= 1
            @dash_timer = 50 # Timer Count
          end
        end
        if @dash_level == 0
          @dashing = false
          $game_player.move_speed = 4
        end
      end
    else
      @dashing = false
      $game_player.move_speed = 4
      @dash_reduce = false
      if @dash_restore == false
        @dash_timer = 80 # Initial time off set
        @dash_restore = true
      else
        @dash_timer-= 1
      end
      @dash_sec = (@dash_timer / Graphics.frame_rate)%60
      if @dash_sec == 0
        if @dash_level != 5
          @dash_level+= 1
          @dash_timer = 60
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def update_sneak
    if Input.pressed?(SNEAK_KEY)
      if $game_player.moving?
        @sneaking = true
        $game_player.move_speed = 3
        @sneak_restore = false
        if @sneak_reduce == false
          @sneak_timer = 50 # Initial time off set
          @sneak_reduce = true
        else
          @sneak_timer-= 1
        end
        @sneak_sec = (@sneak_timer / Graphics.frame_rate)%60
        if @sneak_sec == 0
          if @sneak_level != 0
            @sneak_level -= 1
            @sneak_timer = 100 # Timer Count
          end
        end
        if @sneak_level == 0
          @sneaking = false
          $game_player.move_speed = 4
        end
      end
    else
      @sneaking = false
      $game_player.move_speed = 4
      @sneak_reduce = false
      if @sneak_restore == false
        @sneak_timer = 80 # Initial time off set
        @sneak_restore = true
      else
        @sneak_timer-= 1
      end
      @sneak_sec = (@sneak_timer / Graphics.frame_rate)%60
      if @sneak_sec == 0
        if @sneak_level != 5
          @sneak_level+= 1
          @sneak_timer = 60 # Timer Count
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def update_enemies
    for enemy in @enemies.values
      case enemy.behavior
      when 0
        if enemy.engaged == true
          next if engaged_enemy_detection_sight?(enemy) == true
          next if engaged_enemy_detection_sound?(enemy) == true
        end
      when 1
        if enemy.engaged == true
          next if engaged_enemy_detection_sight?(enemy) == true
          next if engaged_enemy_detection_sound?(enemy) == true
        else
          next if enemy_detection_sight?(enemy) == true
          next if enemy_detection_sound?(enemy) == true
        end
      when 2
        if enemy.engaged == true
          next if engaged_enemy_linking_sight?(enemy) == true
          next if engaged_enemy_linking_sound?(enemy) == true
        else
          next if enemy_linking?(enemy) == true
        end
      when 3
        if enemy.engaged == true
          next if engaged_enemy_linking_sight?(enemy) == true
          next if engaged_enemy_linking_sound?(enemy) == true
        else
          next if enemy_detection_sight?(enemy) == true
          next if enemy_detection_sound?(enemy) == true
          next if enemy_linking?(enemy) == true
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_event_movement(enemy)
    event = $game_map.events[enemy.event_id]
    enemy.move_type = event.move_type
    enemy.move_frequency = event.move_frequency
    enemy.move_speed = event.move_speed
    enemy.engaged = true
    event.move_type = 2
    event.move_frequency = enemy.frequency 
    event.move_speed = enemy.speed
  end
  #--------------------------------------------------------------------------
  def return_event_movement(enemy)
    enemy.engaged = false
    event = $game_map.events[enemy.event_id]
    return if event == nil
    event.move_type = enemy.move_type
    event.move_frequency = enemy.move_frequency
    event.move_speed = enemy.move_speed
  end
  #--------------------------------------------------------------------------
  def engaged_enemy_linking_sight?(enemy)
    if enemy.detection_sight != 0
      if in_range?($game_map.events[enemy.event_id], $game_player, enemy.detection_sight)
        enemy.linking = false
        enemy_attack(enemy)
        return true
      else
        if enemy.linking == false
          return_event_movement(enemy)
          return false
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def engaged_enemy_linking_sound?(enemy)
    if enemy.detection_sound != 0
      if in_range?($game_map.events[enemy.event_id], $game_player, enemy.detection_sound)
        enemy.linking = false
        enemy_attack(enemy)
        return true
      else
        if enemy.linking == false
          return_event_movement(enemy)
          return false
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def enemy_linking?(enemy)
    for key in @enemies.keys
      if in_range?($game_map.events[enemy.event_id], $game_map.events[key], enemy.detection_sight)
        if enemy.engaged == true
          enemy.linking = true
          set_event_movement(enemy)
          return true
        end
      end
    end
    return false
  end
  #--------------------------------------------------------------------------
  def enemy_detection_sound?(enemy)
    if enemy.detection_sound != 0
      return false if enemy.level < $game_party.actors[0].level
      if in_range?($game_map.events[enemy.event_id], $game_player, enemy.detection_sound)
        if @sneaking == true
          return false
        end
        set_event_movement(enemy)
        return true
      end
    end
    return false
  end
  #--------------------------------------------------------------------------
  def enemy_detection_sight?(enemy)
    if enemy.detection_sight != 0
      return false if enemy.level < $game_party.actors[0].level
      if in_range?($game_map.events[enemy.event_id], $game_player, enemy.detection_sight)
        if facing?($game_map.events[enemy.event_id], $game_player)
          set_event_movement(enemy)
          return true
        end
      end
    end
    return false
  end
  #--------------------------------------------------------------------------
  def engaged_enemy_detection_sight?(enemy)
    if enemy.detection_sight != 0
      if in_range?($game_map.events[enemy.event_id], $game_player, enemy.detection_sight)
        enemy_attack(enemy)
        return true
      else
        return_event_movement(enemy)
        return false
      end
    end
  end
  #--------------------------------------------------------------------------
  def engaged_enemy_detection_sound?(enemy)
    if enemy.detection_sound != 0
      if in_range?($game_map.events[enemy.event_id], $game_player, enemy.detection_sound)
        enemy_attack(enemy)
        return true
      else
        return_event_movement(enemy)
        return false
      end
    end
  end
  #--------------------------------------------------------------------------
  def in_range?(element, object, range)
    return if element == nil or object == nil or range == nil
    x = (element.x - object.x) * (element.x - object.x)
    y = (element.y - object.y) * (element.y - object.y)
    r = x + y
    return true  if r <= (range * range)
    return false
  end
  #--------------------------------------------------------------------------
  def in_range(element, range)
    return if element == nil or range == nil
    objects = []
    x = (element.x - $game_player.x) * (element.x - $game_player.x)
    y = (element.y - $game_player.y) * (element.y - $game_player.y)
    r = x + y
    objects.push($game_party.actors[0]) if r <= (range * range)
    return objects
  end
  #--------------------------------------------------------------------------
  def facing?(element, object)
     return if element == nil or object == nil
    if element.direction == 2
      return true if object.y >= element.y
    end
    if element.direction == 4
      return true if object.x <= element.x
    end
    if element.direction == 6
      return true if object.x  >= element.x
    end
    if element.direction == 8
      return true if object.y <= element.y
    end
    return false
  end
  #--------------------------------------------------------------------------
  def in_line?(element, object)
    return if element == nil or object == nil
    if element.direction == 2
      return true if object.x == element.x
    end
    if element.direction == 4
      return true if object.y == element.y
    end
    if element.direction == 6
      return true if object.y == element.y
    end
    if element.direction == 8
      return true if object.x == element.x
    end
    return false
  end
  #--------------------------------------------------------------------------
  def enemy_pre_attack(enemy, actions)
    return true if enemy.hp * 100.0 / enemy.maxhp > actions.condition_hp
    return true if $game_party.max_level < actions.condition_level
    switch_id = actions.condition_switch_id
    if actions.condition_switch_id > 0 and $game_switches[switch_id] == false
      return true
    end
    n = rand(11) 
    return true if actions.rating < n
    return false
  end
  #--------------------------------------------------------------------------
  def hit_player(enemy)
    animate($game_player, $game_player.character_name + '-hit',
    $game_player.direction/2, 4, 3) if @p_animations
    $game_player.jump(0, 0)
    $game_player.animation_id = enemy.animation2_id
  end
  #--------------------------------------------------------------------------
  def actor_non_dead?(actor, enemy)
    if actor.dead?
      if not enemy.is_a?(Game_Actor)
        return_event_movement(enemy)
        enemy.engaged = false
      end
      $game_temp.gameover = true
      return false
    end
    return true
  end
  #--------------------------------------------------------------------------
  def enemy_attack(enemy)
    for actions in enemy.actions
      next if enemy_pre_attack(enemy, actions) == true
      case actions.kind
      when 0 #Basic
        if Graphics.frame_count % (enemy.aggressiveness * 30) == 0          
          case actions.basic
          when 0 #Attack
            if in_range?($game_map.events[enemy.event_id], $game_player, 1) and 
            facing?($game_map.events[enemy.event_id], $game_player)
              actor = $game_party.actors[0]
              actor.attack_effect(enemy)
              event = $game_map.events[enemy.event_id]
              animate(event, event.page.graphic.character_name + '-atk',
              event.direction/2, 4, 3, 0) if @e_animations and actor.damage != "Miss" and actor.damage != 0
              if $game_party.actors[0].damage != "Miss" and $game_party.actors[0].damage != 0
                hit_player(enemy)
              end
              actor_non_dead?(actor, enemy)
              return
            end
          when 1..3 #Nothing
            return
          end
        end
      when 1..2#Skill
        skill = $data_skills[actions.skill_id]
        case skill.scope
        when 1 # One Enemy
          if Graphics.frame_count % (enemy.aggressiveness * 30) == 0
            if in_line?($game_map.events[enemy.event_id], $game_player)
              next if enemy.can_use_skill?(skill) == false
              event = $game_map.events[enemy.event_id]
              animate(event, event.page.graphic.character_name + '-cast',
              event.direction/2, 4, 3, 0) if @e_animations
              @range.push(Game_Ranged_Skill.new($game_map.events[enemy.event_id], enemy, skill))
              enemy.sp -= skill.sp_cost
            end
          end
        when 3..4, 7 # User          
          if Graphics.frame_count % (enemy.aggressiveness * 100) == 0
            if enemy.hp < skill.power.abs
              enemy.effect_skill(enemy, skill)
              event = $game_map.events[enemy.event_id]
              animate(event, event.page.graphic.character_name + '-cast',
              event.direction/2, 4, 3, 0) if @e_animations
              enemy.sp -= skill.sp_cost
              $game_map.events[enemy.event_id].animation_id = skill.animation2_id
            end
            return
          end
        end
        return
      end
    end
  else
    return
  end
  #--------------------------------------------------------------------------
  def hit_event(event, animation)
    animate(event, event.page.graphic.character_name + '-hit',
    event.direction/2, 4, 3, 0) if @e_animations
    event.jump(0, 0)
    return if animation == 0
    event.animation_id = animation
  end
  #--------------------------------------------------------------------------
  def event_non_dead?(enemy, actor = 0)
    if enemy.dead?
      treasure(enemy) if actor = 0
      id = enemy.event_id
      @enemies.delete(id)
      event = $game_map.events[enemy.event_id]
      event.character_name = ""
      case enemy.trigger[0]
      when 0
        event.erase
      when 1
        print "EVENT " + event.id.to_s + "Trigger Not Set Right ~!" if enemy.trigger[1] == 0
        $game_switches[enemy.trigger[1]] = true
        $game_map.need_refresh = true
      when 2
        print "EVENT " + event.id.to_s + "Trigger Not Set Right ~!" if enemy.trigger[1] == 0
         if enemy.trigger[2] == 0
           $game_variables[enemy.trigger[1]] += 1
          $game_map.need_refresh = true
        else
          $game_variables[enemy.trigger[1]] = enemy.trigger[2]
          $game_map.need_refresh = true
        end
      when 3
        value = "A" if enemy.trigger[1] == 1
        value = "B" if enemy.trigger[1] == 2
        value = "C" if enemy.trigger[1] == 3
        value = "D" if enemy.trigger[1] == 4
        print "EVENT " + event.id.to_s + "Trigger Not Set Right ~!" if value == 0
        key = [$game_map.map_id, event.id, value]
        $game_self_switches[key] = true
        $game_map.need_refresh = true
      end
      return false
    end
    return true
  end
  #--------------------------------------------------------------------------
  def treasure(enemy)
    exp = 0
    gold = 0
    treasures = []
    unless enemy.hidden
      exp += enemy.exp
      gold += enemy.gold
      if rand(100) < enemy.treasure_prob
        if enemy.item_id > 0
          treasures.push($data_items[enemy.item_id])
        end
        if enemy.weapon_id > 0
          treasures.push($data_weapons[enemy.weapon_id])
        end
        if enemy.armor_id > 0
          treasures.push($data_armors[enemy.armor_id])
        end
      end
    end
    treasures = treasures[0..5]
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      if actor.cant_get_exp? == false
        last_level = actor.level
        actor.exp += exp
        if actor.level > last_level
          actor.hp = actor.maxhp
          actor.sp = actor.maxsp
        end
      end
    end
    $game_party.gain_gold(gold)
    for item in treasures
      case item
      when RPG::Item
        $game_party.gain_item(item.id, 1)
      when RPG::Weapon
        $game_party.gain_weapon(item.id, 1)
      when RPG::Armor
        $game_party.gain_armor(item.id, 1)
      end
    end
  end
  #--------------------------------------------------------------------------
  def player_attack
    actor = $game_party.actors[0]
    if RANGE_WEAPONS.has_key?(actor.weapon_id) 
      # Range Attack
      range_weapon = RANGE_WEAPONS[actor.weapon_id]
      return if $game_party.item_number(range_weapon[3]) == 0
      $game_party.lose_item(range_weapon[3], 1)
      @range.push(Game_Ranged_Weapon.new($game_player, actor, actor.weapon_id))
      animate($game_player, $game_player.character_name + '-ranged',
      $game_player.direction/2, 4, 3) if @p_animations
    else
      # Test Button Mash
      hit = rand(30) + 10
      if hit > @mash_bar
        @mash_bar = 0
        return
      end
      @mash_bar = 0
      # Melee Attack
      for enemy in @enemies.values
        event = $game_map.events[enemy.event_id]
        if facing?($game_player, event) and in_range?($game_player, event, 1)
          actor = $game_party.actors[0]
          enemy.attack_effect(actor)
          animate($game_player, $game_player.character_name + '-atk',
          $game_player.direction/2, 4, 3) if @p_animations
          hit_event(event, $data_weapons[actor.weapon_id].animation2_id) if enemy.damage != "Miss" and enemy.damage != 0
          if event_non_dead?(enemy)
            if enemy.engaged == false
              enemy.engaged = true
              set_event_movement(enemy)
            end
          end
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def player_skill(key)
    return if @skills[key] == nil
    skill = $data_skills[@skills[key]]
    return if skill == nil
    actor = $game_party.actors[0]
    return if not actor.skills.include?(skill.id)
    return if actor.can_use_skill?(skill) == false
    case skill.scope
    when 1 # One Enemy
      @range.push(Game_Ranged_Skill.new($game_player, actor, skill))
      actor.sp -= skill.sp_cost
        animate($game_player, $game_player.character_name + '-cast',
        $game_player.direction/2, 4, 3) if @p_animations
    when 2 # All Emenies
      $game_player.animation_id = skill.animation2_id
      actor.sp -= skill.sp_cost
      for enemy in @enemies.values
        next if enemy == nil
        enemy.effect_skill(actor, skill)
        animate($game_player, $game_player.character_name + '-cast',
        $game_player.direction/2, 4, 3) if @p_animations

        if enemy.damage != "Miss" and enemy.damage != 0
          event = $game_map.events[enemy.event_id]
          hit_event(event, 0)
        end
        if event_non_dead?(enemy)
          if enemy.engaged == false
            enemy.behavior = 3
            enemy.linking = true
            enemy.engaged = true
            set_event_movement(enemy)
          end
        end
      end
      return
    when 3..4, 7 # User
      return if actor.can_use_skill?(skill) == false
      actor.effect_skill(actor, skill)
      actor.sp -= skill.sp_cost
        animate($game_player, $game_player.character_name + '-cast',
        $game_player.direction/2, 4, 3) if @p_animations
      $game_player.animation_id = skill.animation2_id
      return
    end
  end
end

#============================================================================
# â–  Game ABS Enemy
#============================================================================

class Game_ABS_Enemy < Game_Battler
  #--------------------------------------------------------------------------
  attr_accessor :event_id
  attr_accessor :level
  attr_accessor :behavior
  attr_accessor :detection_sight
  attr_accessor :detection_sound
  attr_accessor :aggressiveness
  attr_accessor :trigger
  attr_accessor :speed
  attr_accessor :frequency
  attr_accessor :engaged
  attr_accessor :linking
  attr_accessor :move_type
  attr_accessor :move_frequency
  attr_accessor :move_speed
  attr_accessor :ranged
  #--------------------------------------------------------------------------
  def initialize(enemy_id)
    super()
    @event_id= 0
    @level = 0
    @behavior = 0
    @detection_sight = 0
    @detection_sound = 0
    @aggressiveness = 1
    @trigger = []
    @enemy_id = enemy_id
    @engaged = false
    @linking = false
    @speed = 0
    @frequency = 0
    @move_type = 0
    @move_frequency = 0
    @move_speed = 0
    @hp = maxhp
    @sp = maxsp
  end
  #--------------------------------------------------------------------------
  def id
    return @enemy_id
  end
  #--------------------------------------------------------------------------
  def index
    return @member_index
  end
  #--------------------------------------------------------------------------
  def name
    return $data_enemies[@enemy_id].name
  end
  #--------------------------------------------------------------------------
  def base_maxhp
    return $data_enemies[@enemy_id].maxhp
  end
  #--------------------------------------------------------------------------
  def base_maxsp
    return $data_enemies[@enemy_id].maxsp
  end
  #--------------------------------------------------------------------------
  def base_str
    return $data_enemies[@enemy_id].str
  end
  #--------------------------------------------------------------------------
  def base_dex
    return $data_enemies[@enemy_id].dex
  end
  #--------------------------------------------------------------------------
  def base_agi
    return $data_enemies[@enemy_id].agi
  end
  #--------------------------------------------------------------------------
  def base_int
    return $data_enemies[@enemy_id].int
  end
  #--------------------------------------------------------------------------
  def base_atk
    return $data_enemies[@enemy_id].atk
  end
  #--------------------------------------------------------------------------
  def base_pdef
    return $data_enemies[@enemy_id].pdef
  end
  #--------------------------------------------------------------------------
  def base_mdef
    return $data_enemies[@enemy_id].mdef
  end
  #--------------------------------------------------------------------------
  def base_eva
    return $data_enemies[@enemy_id].eva
  end
  #--------------------------------------------------------------------------
  def animation1_id
    return $data_enemies[@enemy_id].animation1_id
  end
  #--------------------------------------------------------------------------
  def animation2_id
    return $data_enemies[@enemy_id].animation2_id
  end
  #--------------------------------------------------------------------------
  def element_rate(element_id)
    table = [0,200,150,100,50,0,-100]
    result = table[$data_enemies[@enemy_id].element_ranks[element_id]]
    for i in @states
      if $data_states[i].guard_element_set.include?(element_id)
        result /= 2
      end
    end
    return result
  end
  #--------------------------------------------------------------------------
  def state_ranks
    return $data_enemies[@enemy_id].state_ranks
  end
  #--------------------------------------------------------------------------
  def state_guard?(state_id)
    return false
  end
  #--------------------------------------------------------------------------
  def element_set
    return []
  end
  #--------------------------------------------------------------------------
  def plus_state_set
    return []
  end
  #--------------------------------------------------------------------------
  def minus_state_set
    return []
  end
  #--------------------------------------------------------------------------
  def actions
    return $data_enemies[@enemy_id].actions
  end
  #--------------------------------------------------------------------------
  def exp
    return $data_enemies[@enemy_id].exp
  end
  #--------------------------------------------------------------------------
  def gold
    return $data_enemies[@enemy_id].gold
  end
  #--------------------------------------------------------------------------
  def item_id
    return $data_enemies[@enemy_id].item_id
  end
  #--------------------------------------------------------------------------
  def weapon_id
    return $data_enemies[@enemy_id].weapon_id
  end
  #--------------------------------------------------------------------------
  def armor_id
    return $data_enemies[@enemy_id].armor_id
  end
  #--------------------------------------------------------------------------
  def treasure_prob
    return $data_enemies[@enemy_id].treasure_prob
  end
end

#============================================================================
# â–  Game Battler
#============================================================================

class Game_Battler
  #--------------------------------------------------------------------------
  def can_use_skill?(skill)
    if skill.sp_cost > self.sp
      return false
    end
    if dead?
      return false
    end
    if skill.atk_f == 0 and self.restriction == 1
      return false
    end
    occasion = skill.occasion
    case occasion
    when 0..1
      return true
    when 2..3
      return false
    end
  end
  #--------------------------------------------------------------------------
  def effect_skill(user, skill)
    self.critical = false
    if ((skill.scope == 3 or skill.scope == 4) and self.hp == 0) or
       ((skill.scope == 5 or skill.scope == 6) and self.hp >= 1)
      return false
    end
    effective = false
    effective |= skill.common_event_id > 0
    hit = skill.hit
    if skill.atk_f > 0
      hit *= user.hit / 100
    end
    hit_result = (rand(100) < hit)
    effective |= hit < 100
    if hit_result == true
      power = skill.power + user.atk * skill.atk_f / 100
      if power > 0
        power -= self.pdef * skill.pdef_f / 200
        power -= self.mdef * skill.mdef_f / 200
        power = [power, 0].max
      end
      rate = 20
      rate += (user.str * skill.str_f / 100)
      rate += (user.dex * skill.dex_f / 100)
      rate += (user.agi * skill.agi_f / 100)
      rate += (user.int * skill.int_f / 100)
      self.damage = power * rate / 20
      self.damage *= elements_correct(skill.element_set)
      self.damage /= 100
      if self.damage > 0
        if self.guarding?
          self.damage /= 2
        end
      end
      if skill.variance > 0 and self.damage.abs > 0
        amp = [self.damage.abs * skill.variance / 100, 1].max
        self.damage += rand(amp+1) + rand(amp+1) - amp
      end
      eva = 8 * self.agi / user.dex + self.eva
      hit = self.damage < 0 ? 100 : 100 - eva * skill.eva_f / 100
      hit = self.cant_evade? ? 100 : hit
      hit_result = (rand(100) < hit)
      effective |= hit < 100
    end
    if hit_result == true
      if skill.power != 0 and skill.atk_f > 0
        remove_states_shock
        effective = true
      end
      last_hp = self.hp
      self.hp -= self.damage
      effective |= self.hp != last_hp
      @state_changed = false
      effective |= states_plus(skill.plus_state_set)
      effective |= states_minus(skill.minus_state_set)
      if skill.power == 0
        self.damage = ""
        unless @state_changed
          self.damage = "Miss"
        end
      end
    else
      self.damage = "Miss"
    end
    return effective
  end
end

#============================================================================
# â–  Game Character
#============================================================================

class Game_Character
  attr_accessor   :move_type
  attr_accessor   :move_frequency
  attr_accessor   :move_speed
  attr_accessor   :character_name
  attr_accessor   :wait
  attr_accessor   :old_chr_name
  attr_accessor   :old_dir
  attr_accessor   :animating
  #------------------------------------------------------------------------
  alias animation_engine_game_character_initialize initialize
  #------------------------------------------------------------------------
  def initialize
    animation_engine_game_character_initialize
    @animating = false
    @wait = false
    @old_chr_name = @character_name
    @old_dir = @direction
  end
  #------------------------------------------------------------------------
  def animate(animation_name, position, frames, wait, repeat)
    @character_name = animation_name if @animating == false
    @pattern = 0
    @count = 0
    @repeat = repeat
    @direction_fix = true
    @old_dir = @direction
    @direction = position * 2
    @frames = frames
    lock
    @animating = true
    @wait = wait
    @anim_wait_count = @wait
    update
    return
  end
  #------------------------------------------------------------------------
  def update_animate
    if @anim_wait_count > 0
      @anim_wait_count -= 1
      return
    end
    if @pattern >= @frames or moving?
      if !moving?
        if @count < @repeat
          @pattern = 0
          @count += 1
          @anim_wait_count = @wait
          update
          return
        end
      end
      unlock
      @animating = false
      @pattern = 0
      @direction_fix = false
      @direction = @old_dir
      if self.is_a?(Game_Event)
        @character_name = @page != nil ? @page.graphic.character_name : ''
      else
        @character_name = @old_chr_name
      end
      $game_player.refresh
      $game_map.refresh
      return
    end
    @pattern += 1
    @anim_wait_count = @wait
    update
  end
  #------------------------------------------------------------------------
  def update_movement_type
    if @animating == true
      update_animate
      return
    end
    if jumping?
      update_jump
    elsif moving?
      update_move
    else
      update_stop
    end
  end
  #------------------------------------------------------------------------
  def update_movement
    if @stop_count > (40 - @move_frequency * 2) * (6 - @move_frequency)
      case @move_type
      when 1 # Random
        move_type_random
      when 2
        if @runpath
          run_path
        else
          move_type_toward_player
        end
      when 3
        move_type_custom
      when 4
        move_type_escape_player
      end
    end
  end
  #------------------------------------------------------------------------
  # * Move Type : Escape
  #------------------------------------------------------------------------
  def move_type_escape_player
    sx = @x - $game_player.x
    sy = @y - $game_player.y
    abs_sx = sx > 0 ? sx : -sx
    abs_sy = sy > 0 ? sy : -sy
    if sx + sy >= 20
      move_random
      return
    end
    move_away_from_player
  end
  #------------------------------------------------------------------------
  # * Move Type : Approach
  #------------------------------------------------------------------------
  def move_type_toward_player
    sx = @x - $game_player.x
    sy = @y - $game_player.y
    abs_sx = sx > 0 ? sx : -sx
    abs_sy = sy > 0 ? sy : -sy
    if sx + sy >= 20
      move_random
      return
    end
    move_toward_player
  end
  #------------------------------------------------------------------------
  # * Move away from Player
  #------------------------------------------------------------------------
  def move_away_from_player
    sx = @x - $game_player.x
    sy = @y - $game_player.y
    if sx == 0 and sy == 0
      return
    end
    abs_sx = sx.abs
    abs_sy = sy.abs
    if abs_sx == abs_sy
      rand(2) == 0 ? abs_sx += 1 : abs_sy += 1
    end
    if abs_sx > abs_sy
      sx > 0 ? move_right : move_left
      if not moving?
        rand(2) == 1 ? move_down : move_up
      end
    else
      sy > 0 ? move_down : move_up
      if not moving?
        rand(2) == 1 ? move_right : move_left
      end
    end
  end
end

#============================================================================
# â–  Game Ranged Weapon
#============================================================================

class Game_Ranged_Weapon < Game_Character
  #--------------------------------------------------------------------------
  attr_accessor :draw
  attr_accessor :dead
  #--------------------------------------------------------------------------
  def initialize(parent, actor, attack)
    @range = 0
    @step = 0
    @parent = parent
    @actor = actor
    @draw = true
    @dead  = false
    @range_wepaon = $ABS.RANGE_WEAPONS[attack]
    super()
    refresh
  end
  #--------------------------------------------------------------------------
  def refresh
    @move_direction = @parent.direction
    moveto(@parent.x, @parent.y)
    @character_name = @range_wepaon[0]
    @move_speed = @range_wepaon[1]
    @range = @range_wepaon[4]
  end
  #--------------------------------------------------------------------------
  def check_event_trigger_touch(x, y)
    hit_player if x == $game_player.x and y == $game_player.y
    for event in $game_map.events.values
      if event.x == x and event.y == y
        if event.character_name == ""
          froce_movement
        else
          hit_event(event.id)
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def froce_movement
    case @move_direction
    when 2
      @y += 1
    when 4
      @x -= 1
    when 6
      @x += 1
    when 8
      @y -= 1
    end
  end
  #--------------------------------------------------------------------------
  def update
    super
    return if moving?
    case @move_direction
    when 2
      move_down
    when 4
      move_left
    when 6
      move_right
    when 8
      move_up
    end
    update_step
  end
  #--------------------------------------------------------------------------
  def update_step
    kill if @step >= @range
    @step += 1
  end
  #--------------------------------------------------------------------------
  def hit_player
    actor = $game_party.actors[0]
    enemy = @actor
    $ABS.animate($game_player, $game_player.character_name + '-hit',
    $game_player.direction/2, 4, 3) if $ABS.p_animations
    actor.attack_effect(enemy)
    $game_player.animation_id = @range_wepaon[2] if actor.damage != "Miss" and actor.damage != 0
    $ABS.actor_non_dead?(actor, enemy)
    kill
  end
  #--------------------------------------------------------------------------
  def hit_event(id)
    actor = $ABS.enemies[id]
    return if actor == nil
    if @parent.is_a?(Game_Player)
      enemy = $game_party.actors[0]
      actor.attack_effect(enemy)
      $game_map.events[id].animation_id = @range_wepaon[2] if actor.damage != "Miss" and actor.damage != 0
      if $ABS.event_non_dead?(actor)
        if actor.engaged == false
          actor.behavior = 3
          actor.linking = true
          actor.engaged = true
          $ABS.set_event_movement(actor)
        end
      end
    else
      enemy = $ABS.enemies[@parent.id]
      actor.attack_effect(enemy)
      event = $game_map.events[id]
      $ABS.animate(event, event.page.graphic.character_name + '-hit',
      event.direction/2, 4, 3, 0) if $ABS.e_animations and actor.damage != "Miss" and actor.damage != 0
      $game_map.events[id].animation_id = @range_wepaon[2] if actor.damage != "Miss" and actor.damage != 0
      $ABS.event_non_dead?(actor, enemy)
    end
    kill
  end
  #--------------------------------------------------------------------------
  def kill
    @dead = true
  end
end

#============================================================================
# â–  Game Ranged Skill
#============================================================================

class Game_Ranged_Skill < Game_Character
  #--------------------------------------------------------------------------
  attr_accessor :draw
  attr_accessor :dead
  #--------------------------------------------------------------------------
  def initialize(parent, actor, skill)
    @range = 0
    @step = 0
    @parent = parent
    @skill = skill
    @actor = actor
    @range_skill = $ABS.RANGE_SKILLS[skill.id]
    @draw = true
    @dead  = false
    super()
    refresh
  end
  #--------------------------------------------------------------------------
  def refresh
    @move_direction = @parent.direction
    moveto(@parent.x, @parent.y)
    @range = @range_skill[0]
    @opacity = 10 if @range == 1
    @move_speed = @range_skill[1]
    @character_name = @range_skill[2]
  end
  #--------------------------------------------------------------------------
  def check_event_trigger_touch(x, y)
    hit_player if x == $game_player.x and y == $game_player.y
    for event in $game_map.events.values
      if event.x == x and event.y == y
        if event.character_name == ""
          froce_movement
        else
          hit_event(event.id)
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def froce_movement
    case @move_direction
    when 2
      @y += 1
    when 4
      @x -= 1
    when 6
      @x += 1
    when 8
      @y -= 1
    end
  end
  #--------------------------------------------------------------------------
  def update
    super
    return if moving?
    case @move_direction
    when 2
      move_down
    when 4
      move_left
    when 6
      move_right
    when 8
      move_up
    end
    update_step
  end
  #--------------------------------------------------------------------------
  def update_step
    kill if @step >= @range
    @step += 1
  end
  #--------------------------------------------------------------------------
  def hit_player
    actor = $game_party.actors[0]
    enemy = @actor
    actor.effect_skill(enemy, @skill)
    $ABS.animate($game_player, $game_player.character_name + '-hit',
    $game_player.direction/2, 4, 3) if $ABS.p_animations and actor.damage != "Miss" and actor.damage != 0
    $game_player.animation_id = @skill.animation2_id if actor.damage != "Miss" and actor.damage != 0
    $ABS.actor_non_dead?(actor, enemy)
  end
  #--------------------------------------------------------------------------
  def hit_event(id)
    actor = $ABS.enemies[id]
    return if actor == nil
    if @parent.is_a?(Game_Player)
      enemy = $game_party.actors[0]
      actor.effect_skill(enemy, @skill)
      $game_map.events[id].animation_id = @skill.animation2_id if actor.damage != "Miss" and actor.damage != 0
      if $ABS.event_non_dead?(actor, enemy)
        if actor.engaged == false
          actor.behavior = 3
          actor.linking = true
          actor.engaged = true
          $ABS.set_event_movement(actor)
        end
      end
    else
      enemy = $ABS.enemies[@parent.id]
      actor.effect_skill(enemy, @skill)
      $ABS.animate(event, event.page.graphic.character_name + '-hit',
      event.direction/2, 4, 3, 0) if $ABS.e_animations and actor.damage != "Miss" and actor.damage != 0
      $game_map.events[id].animation_id = @skill.animation2_id if actor.damage != "Miss" and actor.damage != 0
      $ABS.event_non_dead?(actor, enemy)
    end
  end
  #--------------------------------------------------------------------------
  def kill
    @dead = true
  end
end

#============================================================================
# â–  Game Event
#============================================================================

class Game_Event < Game_Character
  #--------------------------------------------------------------------------
  alias nf_abs_game_event_refresh_set_page refresh_set_page
  #--------------------------------------------------------------------------
  def name
    return @event.name
  end
  #--------------------------------------------------------------------------
  def id
    return @id
  end
  #--------------------------------------------------------------------------
  def refresh_set_page
    nf_abs_game_event_refresh_set_page
    $ABS.refresh(self, @list, @character_name)
  end
end

#============================================================================
# â–  Spriteset Map
#============================================================================

class Spriteset_Map
  #--------------------------------------------------------------------------
  alias nf_abs_spriteset_map_initialize initialize
  alias nf_abs_spriteset_map_dispose dispose
  alias nf_abs_spriteset_map_update update
  #--------------------------------------------------------------------------
  def initialize
    @ranged = []
    for range in $ABS.range
      sprite = Sprite_Character.new(@viewport1, range)
      @ranged.push(sprite)
    end
    nf_abs_spriteset_map_initialize
  end
  #--------------------------------------------------------------------------
  def dispose
    for range in @ranged
      range.dispose
    end
    nf_abs_spriteset_map_dispose
  end
  #--------------------------------------------------------------------------
  def update
    for range in $ABS.range
      if range.draw == true
        sprite = Sprite_Character.new(@viewport1, range)
        @ranged.push(sprite)
        range.draw = false
      end
    end
    for range in @ranged
      if range.character.dead == true
        $ABS.range.delete(range.character)
        @ranged.delete(range)
        range.dispose
      else
        range.update
      end
    end
    nf_abs_spriteset_map_update
  end
end

#============================================================================
# â–  Scene Title
#============================================================================

class Scene_Title
  #--------------------------------------------------------------------------
  alias nf_abs_scene_title_cng command_new_game
  #--------------------------------------------------------------------------
  def command_new_game
    $ABS = ABS.new
    nf_abs_scene_title_cng
  end
end

#============================================================================
# â–  Scene Map
#============================================================================

class Scene_Map
  #--------------------------------------------------------------------------
  alias nf_abs_scene_map_update update
  #--------------------------------------------------------------------------
  #--------------------------------------------------------------------------
  def update
    $ABS.update
    $ABS.player_attack if Input.triggerd?($ABS.ATTACK_KEY)
    for i in 0..9
      $ABS.player_skill(i) if Input.triggerd?($ABS.SKILL_KEYS[i])
    end
    nf_abs_scene_map_update
  end
end

#============================================================================
# â–  Scene Skill
#============================================================================

class Scene_Skill
  #--------------------------------------------------------------------------
  alias nf_abs_scene_skill_main main
  alias nf_abs_scene_skill_update update
  alias nf_abs_scene_skill_update_skill update_skill
  #--------------------------------------------------------------------------
  def main
    @shk_window = Window_Command.new(250, ["Skill Assigned to Hot Key"])
    @shk_window.visible = false
    @shk_window.active = false
    @shk_window.x = 200
    @shk_window.y = 250
    @shk_window.z = 1500
    nf_abs_scene_skill_main  
    @shk_window.dispose
  end
  #--------------------------------------------------------------------------
  def update
    @shk_window.update
    nf_abs_scene_skill_update
    if @shk_window.active
      update_shk
      return
    end
  end
  #--------------------------------------------------------------------------
  def update_skill
    nf_abs_scene_skill_update_skill
    for i in 0..9
      if Input.triggerd?($ABS.SKILL_KEYS[i])
        $game_system.se_play($data_system.decision_se)
        @skill_window.active = false
        @shk_window.active = true
        @shk_window.visible = true
        $ABS.skills[i] = @skill_window.skill.id 
      end
    end
  end
 #--------------------------------------------------------------------------
 def update_shk
   if Input.trigger?(Input::C)
     $game_system.se_play($data_system.decision_se)
     @shk_window.active = false
     @shk_window.visible = false
     @skill_window.active = true
     $scene = Scene_Skill.new(@actor_index)
     return
   end
 end
end

#============================================================================
# â–  Scene Load
#============================================================================

class Scene_Load < Scene_File
  #--------------------------------------------------------------------------
  alias nf_abs_scene_load_read_data read_data
  #--------------------------------------------------------------------------
    def read_data(file)
    nf_abs_scene_load_read_data(file)
    $ABS = Marshal.load(file)
  end
end
#============================================================================
# â–  Scene Save
#============================================================================

class Scene_Save < Scene_File
  #--------------------------------------------------------------------------
  alias nf_abs_scene_save_write_data write_data
  #--------------------------------------------------------------------------
  def write_data(file)
    nf_abs_scene_save_write_data(file)
    Marshal.dump($ABS, file)
  end
end

#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end
 
heres a simple hud (i think)
http://img67.imageshack.us/img67/1631/request2lf3.png[/IMG]

extra info:
hud face depends on hero graphic and goes into /character/hudface folder
hud turns translucent when player is under it
gradient hp/mp bars
ATS system

status colors:
normal - green
poisoned - purple
sleep -grey
dizzy - grey *blinking grey-white
Paralyzed - yellow
weak - dark red

(leave the rest to me)

heres the ATS script
Code:
#===================================================
# â–  ATS - Advanced Time System
#===================================================
# Rewiten by Near Fantastica
# Date: 23.07.05
# Version: 1
#
# Written by Dubealex
# Date: 26.11.04
#
# Thanks to Satana_81 for the test tilesets
#===================================================

#===================================================
# â–¼ CLASS Advanced_Time Begins
#===================================================
class Advanced_Time
  
    attr_reader :define_start_sec
    attr_reader :weather_type
    attr_reader :weather_strength

   def initialize
     @weather_pattern = []
     @cycle_period=[]
     @tint_period=[]
     @cycle_season=[]
     @name_period=[]
     @name_season=[]
     @name_month=[]
     @name_day=[]
     @start_clock=[]
     @start_date=[]

=begin -----------------------------------------------------------------------------------------------------
      â–  Advanced Time System Settings:
      ---------------------------------------------------------------------------------------------------------
      â–¼ Day Night System Transitioning :
      
      The DNS is built in to the time system and therefore any map you want to have the DNS
      active on place a "*" in the name of the map.
      ---------------------------------------------------------------------------------------------------------
      â–¼ Method of Season Transitioning :
       
      ●  Titleset Transitioning = The tileset its replaced
          When Titleset Transitioning is set the script will pull the tileset and autotiles used 
          set to the season ID. For exmaple "Plains 1" for tileset or "Water 1" for autotiles. 
          The script will then automaticly change the 1 to the season ID which will load the 
          new tileset. Maps that the developer wishes to have the tileset changing place 
          a "~" in the name. 
          
      ●  Map Transitioning = The Map is replaced
          When Map Transitioning is set the script changes the whole map. It will transport the
          player to the same x,y on a map with the same name and the matching season ID.
          For example "Town [1]". The script will then automaticaly change the 1 to the 
          season ID which will load the new map. Maps that the developer wishes to have 
          the map changing place "[Season ID]"  in the map name where Season ID is the ID 
          of the season of that map.
=end #----------------------------------------------------------------------------------------------------

=begin -----------------------------------------------------------------------------------------------------
      â–  Advanced Weather System Settings:
      ---------------------------------------------------------------------------------------------------------
      â–¼ Weather Patterns :
      
      With the Advanced Weather System by Ccoa the Advanced Time System and keep track
      and change weather depending on season. The flag $aws must be set true if the weather
      script is to be used.
      
      1 - rain                    5 - rain with thunder and lightning
      2 - storm                 6 - falling leaves (autumn)
      3 - snow                  7 - blowing leaves (autumn)
      4 - hail                    8 - swirling leaves (autumn)
      
      The script randomly picks bettween having weather and no weather.
      Then the script randomly picks the weather if there is going to be weather.
      If the same weather is added more then once it will add to % chnage that weather 
      will be picked. If the same weather is picked again its power is inceased. The
      range of power is 10 - 40. @weather_cycle is the % of weather for the game.
      0 = very little and 10 = a lot of weather. @weather_period is the amount 
      of time in mintues till the next weather cycle range  = 1-59. @bgs_control is 
      a flag that tells the script to inculde BGS with Dynamic Weather 
=end #----------------------------------------------------------------------------------------------------

      @aws = true
      @bgs_control = true
      @active_weather = false
      @weather_type = 0
      @weather_strength = 0
      @weather_cycle = 5
      @weather_period = 30
      @weather_pattern[1] = [3]
      @weather_pattern[2] = [1,1,2,3]
      @weather_pattern[3] = [1,1,2,5]
      @weather_pattern[4] = [1,2,4,5]
      @weather_pattern[5] = [1,1,2,6]
      @weather_pattern[5] = [1,1,3,7,8]

=begin -----------------------------------------------------------------------------------------------------
      â–  ATS Settings Configuration:
      ---------------------------------------------------------------------------------------------------------
      â–¼ LENGTH AND SPEED OF TIME:
       
      Those variables defines the speed and length of every aspect of the ATS.
      @time_speed define how fast a seconds last. Setting it to 0 makes a real time system.
      Below 0 is a slower time than normal, and higher than 0 will accelerate the time.
      The length value are used to customize the length of every component of the ATS.
      Remember that since it is the SPEED setting that defines how fast the time goes,
      you don't have to say that a minute last 30 sec to make it faster. You can leave it
      as real-time, and just accelerate the length of a second with @time_speed !
=end #----------------------------------------------------------------------------------------------------
      
      @ats_time_speed = 60             # 0 is a Real Time System
      @minutes_length = 60               # Seconds
      @hour_length = 60                    # Minutes
      @day_length = 24                     # Hours
      @week_length = 7                     # Days
      @month_length = 30                # Days
      @year_length = 12                   # Months
      @decade_length = 10                # Years
      @century_length = 100              # Years
      @millenium_length = 1000        # Years
      
=begin ----------------------------------------------------------------------------------------------------
       â–¼ GAME DEFAULT START-UP VALUES:
      
       Here you can define the default start-up values for each components. The data
       you enter here will be taken into consideration at each new game started. So if you want
       your game to begin at 2:12 pm, you can adjust all that in here. You can also set some
       basic default options you have, like trigger the AM/PM time format ON/OFF.
       You don't have to set the start-up season and period, since it will be set automatically
       with the date and the clock.
=end #-----------------------------------------------------------------------------------------------------
      
     @clock_mode = 1               # 1= 24 hours format / 2= AM/PM flag format
     @start_clock   = [21,50,10]     # [hour, min, sec] -> Write in 24 hours format.
     @start_date    = [3,29,2004] # [month, day, year]  
      
=begin -----------------------------------------------------------------------------------------------------
       â–¼ ATS PERIODS CYCLE SETTINGS:
      
      An ATS Period works just as my old NDS Period.
      Periods defines a 24 hours loop - Example: Morning>Day>Evening>Night
      Here you can defines what is the cycle (in hours) for each periods.
      You can have as much period as you desire, I created the 4 main one, as shown
      in the example above. To add period, simply copy a line and replace the ID of the
      period by the next in line. DO NOT skip numbers.
      Syntax: @cycle_period[ID] --> Don't use ID0. (You can name them later).
      Example: @cycle_period[1] = (5..11) Will make the period ID#1  begins at 5am
      and ends at 11am. Use the 24 hours clock format to defines the period length.
=end #-----------------------------------------------------------------------------------------------------
      
      @cycle_period[1] = (5..11)  #Defined as (start_hour..end_hour)
      @cycle_period[2] = (12..18)
      @cycle_period[3] = (19..22)
      @cycle_period[4] = (23..24)
      @cycle_period[5] = (0..4)

=begin ----------------------------------------------------------------------------------------------------
      â–¼ ATS PERIODS COLOR TONE (TINT) SETTINGS:
      
      Here you can define what will be the color tone used for each periods.
      Use the same period ID defined above. Example: @tint_period[1] is the tint used
      with the @cycle_period[1] settings.
      Syntax: @tint_period[1] = [red, green, blue, gray, transition_time]  
      To know the number you want for your tint, simply opens a RPG Maker Project, and
      create an event, choose "Tint Screen" and test the values you want, then enter them
      in here.
=end #-----------------------------------------------------------------------------------------------------
      
      @tint_period[1] = [17, -51, -102, 0, 600]
      @tint_period[2] = [0, 0, 0, 0, 600]
      @tint_period[3] = [-68, -136, -34, 0, 600]
      @tint_period[4] = [-187, -119, -17, 68, 600]  
      @tint_period[5] = [-187, -119, -17, 68, 600]
      
=begin -----------------------------------------------------------------------------------------------------
      â–¼ SEASONS CYCLE SETTINGS:
      
      Here you can define how much time last every season. This is an "optional" feature.
      You can just leave it alone if you aren't using it. This work as the periods, but seasons
      are defined using months instead of hours. To know how it works, read the periods comments.
      Example: @cycle_season[1] = (6..8) Will make the season ID#1  begins on the
      6th month of the year, and end on the last day of the 8th month of the year.
=end #-----------------------------------------------------------------------------------------------------
       
      @cycle_season[1] = (1..2) #Defined as (start_month..end_month)
      @cycle_season[2] = (3..4)
      @cycle_season[3] = (5..6)
      @cycle_season[4] = (7..8)
      @cycle_season[5] = (9..10)
      @cycle_season[6] = (11..12)
      
      
=begin ----------------------------------------------------------------------------------------------------
      â–¼ ATS COMPONENT'S NAMES SETTINGS:
      
      Here you can choose the name tagged to every relevant component of the ATS.
      The words you defined here will be used in window and menus in your game.
      It make it easy to configure and customize that way. You can also refer to those variables
      names if you need to access any component's names. That way, if you make a mistake or 
      want to change something in the middle of your development, you can easily do it.
      If you added/deleted periods/seasons, just adjust this section too. So if you created a season
      ID#6, you can copy a line from here and add the 6 where it belongs. (Between [ ])
      This is also were you define all your Months and Days name. It work the same way.
      @name_month[1] will refer to the first month of your year. By default, it's January.
=end #----------------------------------------------------------------------------------------------------
      
      @name_period[1] = "Morning"
      @name_period[2] = "Day"
      @name_period[3] = "Evening"
      @name_period[4] = "Night"
      @name_period[5] = "Night"
      
      @name_season[1] = "Winter"
      @name_season[2] = "Spring"
      @name_season[3] = "Summer"
      @name_season[4] = "Summer"
      @name_season[5] = "Autumn"
      @name_season[6] = "Autumn"
      
      @name_month[1]  = "January"
      @name_month[2]  = "February"
      @name_month[3]  = "March"
      @name_month[4]  = "April"
      @name_month[5]  = "May"
      @name_month[6]  = "June"
      @name_month[7]  = "July"
      @name_month[8]  = "August"
      @name_month[9]  = "September"
      @name_month[10]= "October"
      @name_month[11]= "November"
      @name_month[12]= "December"
      
      @name_day[1] = "Monday"
      @name_day[2] = "Tuesday"
      @name_day[3] = "Wednesday"
      @name_day[4] = "Thursday"
      @name_day[5] = "Friday"
      @name_day[6] = "Saturday"
      @name_day[7] = "Sunday"      
      
#--- â–  END OF SETTINGS (No Need To Edit Further)-------------------------------------------
           
      @speed_restore = 0
      if @ats_time_speed >= Graphics.frame_rate
         @ats_time_speed=Graphics.frame_rate-1
       end
      @year_length+=1 
      @month_length+=1
      if @start_clock[0] >= 12 : @am=false else @am=true end
      define_start_sec_in_hours= @start_clock[0] * @minutes_length * @hour_length
      define_start_sec_in_min= @start_clock[1] * @minutes_length
      @define_start_sec= define_start_sec_in_hours+define_start_sec_in_min+@start_clock[2] 
   end

# â–  WRITE ATTRIBUTE (Modify ATS Data) (No Need To Edit)----------------------------------  
  def sec(sec=0)
    @define_start_sec+=sec
  end

#--------------------------------------------------------------------------------------------------------
  def min(min=0)
    @define_start_sec+=min*@minutes_length
  end

#--------------------------------------------------------------------------------------------------------
  def hours(hours=0)
    @define_start_sec+=hours*@minutes_length*@hour_length
  end  
  
#--------------------------------------------------------------------------------------------------------  
  def days(days=0)
    if days<0 : @rewind=true end
    @define_start_sec+=days*@minutes_length*@hour_length*@day_length
  end  
  
#--------------------------------------------------------------------------------------------------------  
  def months(months=0)
     if months<0 : @rewind=true end
    @define_start_sec+=months*@minutes_length*@hour_length*@day_length*@month_length
  end 
  
#--------------------------------------------------------------------------------------------------------     
  def speed(speed=0)
    @speed_restore = @ats_time_speed
    @ats_time_speed = speed
  end

#--------------------------------------------------------------------------------------------------------     
  def speed_restore
    @ats_time_speed = @speed_restore
  end 
    
# â–  READ ATTRIBUTE (Fetch ATS Data) (No Need To Edit)-------------------------------------  
  def full_date
    day_name=@name_day[week_day_is]
    month_name=@name_month[months_is] 
    month_day=month_day_is
    year= total_years_is
    full_date= day_name + ", " + month_name + " " + month_day.to_s  + " " +  year.to_s
    return full_date
  end

#--------------------------------------------------------------------------------------------------------     
  def speed_is
    return @ats_time_speed
  end 
  
#--------------------------------------------------------------------------------------------------------     
   def total_sec_is
     ats_total_sec = (Graphics.frame_count / (Graphics.frame_rate-@ats_time_speed))+@define_start_sec
     return ats_total_sec
   end 

#--------------------------------------------------------------------------------------------------------     
   def total_years_is
      total_years=(total_months_is / @year_length) + @start_date[2] 
     return total_years
   end 
 
#--------------------------------------------------------------------------------------------------------     
   def total_months_is
     total_months=(total_days_is / @month_length) + @start_date[0] 
     return total_months
   end 

#--------------------------------------------------------------------------------------------------------       
   def total_decades_is
     total_decades=total_years_is / @decade_length
     return total_decades
   end 

#--------------------------------------------------------------------------------------------------------       
   def total_centuries_is
     total_centuries=total_years_is / @century_length
     return total_centuries
   end 

#--------------------------------------------------------------------------------------------------------       
   def total_millenium_is
      total_millenium=total_years_is/@millenium_length
     return total_millenium
   end 
      
#--------------------------------------------------------------------------------------------------------       
   def total_weeks_is
     total_weeks= total_days_is / @week_length
     return total_weeks
   end 
        
#--------------------------------------------------------------------------------------------------------        
   def total_hours_is
     total_hours= total_sec_is / @minutes_length / @hour_length
     return total_hours
   end 
   
#--------------------------------------------------------------------------------------------------------        
   def total_min_is
     total_min = total_sec_is / @minutes_length
     return total_min
   end   
   
#--------------------------------------------------------------------------------------------------------     
   def date
     month=months_is
     month_day=month_day_is
     year=total_years_is
     date=sprintf("%02d/%02d/%04d", month, month_day, year)
     return date
   end 

#--------------------------------------------------------------------------------------------------------     
   def clock
     
     hour=hours_is
     min=min_is
     sec=secs_is
     
     if @clock_mode == 1
        clock=sprintf("%02d:%02d:%02d", hour, min, sec)
        return clock
      else
        if @am==true : am_pm=AM" else am_pm="PM" end
        clock=sprintf("%02d:%02d:%02d %s", hour, min, sec, am_pm)
        return clock
    end
   end
    
#--------------------------------------------------------------------------------------------------------      
   def hours_is
     hour=real_hour=real_hours
      if @clock_mode == 2
        if @am==false and real_hour !=12 : hour-=(@day_length/2) end
        hour %= (@day_length/2)+1
        if real_hour < (@day_length/2) : @am=true else @am=false end
         if hour==0 : hour=1 end
         if real_hour==0 : hour=12 end
         end   
     return hour
   end
   
#--------------------------------------------------------------------------------------------------------      
   def real_hours
     real_hour = total_sec_is / @minutes_length / @hour_length % @day_length
     return real_hour
   end 
   
#--------------------------------------------------------------------------------------------------------     
   def secs_is
     sec = total_sec_is % @minutes_length
     return sec
   end 

#--------------------------------------------------------------------------------------------------------     
   def min_is
     mins = total_sec_is / @minutes_length % @hour_length
     return mins
   end 

#--------------------------------------------------------------------------------------------------------     
   def total_days_is
     total_days = (total_sec_is / @minutes_length / @hour_length / @day_length) + @start_date[1] 
     return total_days
   end 
    
#--------------------------------------------------------------------------------------------------------     
   def week_day_is
     week_day= total_days_is % @week_length 
     if week_day==0 : week_day=@week_length end
     return week_day
   end 

#--------------------------------------------------------------------------------------------------------     
   def week_name
     return @name_day[week_day_is]
   end 
    
#--------------------------------------------------------------------------------------------------------     
   def month_name
     return @name_month[months_is] 
   end 

#--------------------------------------------------------------------------------------------------------     
    def months_is
       month=total_months_is % @year_length
       if @rewind==true
        if month==0 : months(-1) end
          @rewind=false  
      else
        if month==0 : months(1) end
      end    
      return month
    end 

#--------------------------------------------------------------------------------------------------------     
   def month_day_is
     month_day=total_days_is % @month_length
     if @rewind==true
       if month_day==0 : days(-1) end
         @rewind=false  
     else
       if month_day==0 : days(1) end
     end    
     return month_day
   end 
       
#--------------------------------------------------------------------------------------------------------     
   def period_id
     for i in 1...@cycle_period.size
       if @cycle_period[i] === $ats.real_hours
        return i
        break
       end  
     end  
   end 
   
#--------------------------------------------------------------------------------------------------------     
   def period
     for i in 1...@cycle_period.size
       if @cycle_period[i] === real_hours
        if i==0 : i=1 end
        return @name_period[i]
        break
       end  
     end  
   end 

#--------------------------------------------------------------------------------------------------------   
def period_tint
     for i in 1...@cycle_period.size
       if @cycle_period[i] === real_hours
        return [-50, -50, -50, 50, 100] if i == 2 and $game_screen.weather_type != 0
        return @tint_period[i]
        break
       end  
     end  
   end 
 
#--------------------------------------------------------------------------------------------------------     
   def season
     for i in 1...@cycle_season.size
       if @cycle_season[i] === months_is
        return @name_season[i]
        break
       end  
     end  
   end 
 
#--------------------------------------------------------------------------------------------------------     
   def season_id
     for i in 1...@cycle_season.size
       if @cycle_season[i] === months_is
        if i==0 : i=1 end
        return i
        break
       end  
     end  
   end 

#--------------------------------------------------------------------------------------------------------     
   def start_seconds
     return @define_start_sec
   end
   
#--------------------------------------------------------------------------------------------------------     
  def weather_active(flag)
    @aws = flag
  end
  
#--------------------------------------------------------------------------------------------------------     
  def weather_bgs(flag)
    @bgs_control = flag
  end

#--------------------------------------------------------------------------------------------------------     
  def stop_weather
    $game_screen.weather(0, 0, 0)
    set_weather_bgs(0)
  end
  
#--------------------------------------------------------------------------------------------------------     
  def weather_is
    case $game_screen.weather_type
    when 0
      return "Clear"
    when 1
      return "Rain"
    when 2
      return "Storm"
    when 3
      return "Snow"
    when 4..5
      return "Gale"
    when 6..8
      return "Windy"
    end
  end
  
#--------------------------------------------------------------------------------------------------------     
  def set_weather_bgs(type)
    return if @bgs_control == false
    bgs = BGS.new
    bgs.volume = 80
    bgs.pitch = 100
    case type
    when 0
      $game_system.bgs_fade(10)
    when 1
      bgs.name = "005-Rain01"
      $game_system.bgs_play(bgs)
    when 2
      bgs.name = "006-Rain02"
      $game_system.bgs_play(bgs)
    when 3
      $game_system.bgs_fade(10)
    when 4..5
      bgs.name = "007-Rain03"
      $game_system.bgs_play(bgs)
    when 6
      bgs.name = "001-Wind01"
      $game_system.bgs_play(bgs)
    when 7
      bgs.name = "002-Wind02"
      $game_system.bgs_play(bgs)
    when 8
      bgs.name = "003-Wind03"
      $game_system.bgs_play(bgs)
    end
  end
  
#--------------------------------------------------------------------------------------------------------     
  def weather
    return if @aws == false
    return if $game_map.weather_active == false
    if min_is % @weather_period == 0 and @active_weather == false
      @active_weather = true
      if rand(10).between?(0, @weather_cycle)
        pattern = @weather_pattern[season_id]
        size = pattern.size - 1
        type = pattern[rand(size).to_i]
        if @weather_type == type
          if @weather_strength.between?(0, 40)
            @weather_strength += 10 
            else
            @weather_strength = 40
          end
        else
          @weather_strength = 10
        end
        @weather_type = type
        $game_screen.weather(@weather_type, @weather_strength, 0)
        set_weather_bgs(@weather_type)
      else
        @active_weather = true
        @weather_strength = 0
        $game_screen.weather(0, 0, 0)
        set_weather_bgs(0)
      end
    else
      @active_weather = false if min_is % @weather_period != 0
    end
  end
   
end
#===================================================
# â–² CLASS Advanced_Time Ends
#===================================================


#===================================================
# â–¼ CLASS Scene_Map Additional Code Begins
#===================================================
class Scene_Map

alias ats_scene_map_main main
alias ats_scene_map_update update
   
   def main
     if $game_map.dns_active
       tone = $ats.period_tint
       $game_screen.start_tone_change(Tone.new(tone[0],tone[1],tone[2],tone[3]),0)
     end
     #@alex_ats_window = ATS_TimeTest_Window.new
     ats_scene_map_main
     #@alex_ats_window.dispose
   end
   
   def update
     ats_scene_map_update
     #@alex_ats_window.update
     $ats.weather
     if $game_map.dns_active
       tone = $ats.period_tint
       $game_screen.start_tone_change(Tone.new(tone[0],tone[1],tone[2],tone[3]),tone[4])
     end
   end  
   
end
#===================================================
# â–² CLASS Scene_Map Additional Code Ends
#===================================================


#===================================================
# â–¼ CLASS ATS_TimeTest_Window Begins
#===================================================
class ATS_TimeTest_Window < Window_Base
  
  def initialize
    super(0,0,250,400)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = "Tahoma"
    self.contents.font.size =16
    self.opacity = 100
    update   
  end  

  def update #testing and debugging window
    return if Graphics.frame_count % 10 != 0
    self.contents.clear
    self.contents.font.color = text_color(0) 
    self.contents.draw_text(0, 0, 400, 32, "Current Full Clock: " +$ats.clock)
    self.contents.draw_text(0, 16, 400, 32, "Small Date: " +$ats.date)
    self.contents.draw_text(0, 32, 400, 32, "Full Date: " +$ats.full_date)
    self.contents.draw_text(0, 60, 400, 32, "Week ID#: " + $ats.week_day_is.to_s)

    self.contents.draw_text(0, 80, 400, 32, "Period: " + $ats.period)
    self.contents.draw_text(0, 100, 400, 32, "Season: " + $ats.season)
    self.contents.draw_text(0, 120, 400, 32, "Month ID#: " + $ats.months_is.to_s)
    self.contents.draw_text(0, 140, 400, 32, "Map Name#: " + $game_map.map_name)
    self.contents.draw_text(0, 160, 400, 32, "Weather: " + $ats.weather_is)
  end
end 
#===================================================
# â–² CLASS ATS_TimeTest_Window Ends
#===================================================

#===================================================
# â–¼ CLASS Scene_Title Additional Code Begins
#===================================================
class Scene_Title
  $ats=Advanced_Time.new
end  
#===================================================
# â–² CLASS Scene_Title Additional Code Ends
#===================================================


#===================================================
# â–¼ CLASS Game_Map Additional Code Begins
#===================================================
class Game_Map

  attr_accessor :tileset_refresh
  attr_accessor :tileset_transition
  attr_accessor :map_transition
  attr_accessor :dns_active
  attr_accessor :weather_active
  attr_accessor :lights_refresh
  attr_accessor :shadows_refresh
  attr_accessor :shadows_redraw

  alias ats_game_map_update update
  alias ats_game_map_setup setup
  alias ats_game_map_initialize initialize

  def initialize
    ats_game_map_initialize
    @tileset_refresh = false
    @season = $ats.season_id
    @tileset_transition = false
    @map_transition = false
    @dns_active = false
    @weather_active = false
    @lights_refresh = false
    @shadows_refresh = false
    @shadows_redraw = false
    @map_transition_id = 0
  end

  def setup(map_id)
    ats_game_map_setup(map_id)
    # Setup
    @dns_active = false
    @weather_active = false
    @tileset_transition = false
    @map_transition = false
    
    map_infos = load_data("Data/MapInfos.rxdata")
    # DNS
    if map_infos[map_id].name.include?("*")
      map_infos[map_id].name.delete!("*")
      @dns_active = true
      tone = $ats.period_tint
      $game_screen.start_tone_change(Tone.new(tone[0],tone[1],tone[2],tone[3]),0)
    else
      $game_screen.start_tone_change(Tone.new(0,0,0,0),0)
    end
    # Dynamic Weather
    if map_infos[map_id].name.include?("^")
      map_infos[map_id].name.delete!("^")
      @weather_active = true
      $game_screen.weather($ats.weather_type, $ats.weather_strength, 0)
      $ats.set_weather_bgs($ats.weather_type)
    else
      $game_screen.weather(0, 0, 0)
      $ats.set_weather_bgs(0)
    end
    # Tileset Transition
    if map_infos[map_id].name.include?("&")
      map_infos[map_id].name.delete!("&")
      @tileset_transition = true
    end
    # Map Transition
    if map_infos[map_id].name.include?("[") and map_infos[map_id].name.include?(]")
      index = map_infos[map_id].name.index("[")
      temp = map_infos[map_id].name[index+1].chr
      map_infos[map_id].name.delete!(temp)
      map_infos[map_id].name.delete!("[")
      map_infos[map_id].name.delete!("]")
      @map_transition = true
    end
    @map_name = map_infos[map_id].name
    # Tileset Transition
    if @tileset_transition
      name = $game_map.tileset_name.split
      @tileset_name = name[0] + " " + $ats.season_id.to_s
      for i in 0..6
        autotile_name = @autotile_names[i].split
        next if autotile_name[0] == nil
        if autotile_name[1] == nil
          @autotile_names[i] = autotile_name[0]
        else
          @autotile_names[i] = autotile_name[0] + " " + $ats.season_id.to_s
        end
      end
    end
  end

  def map_name
    return @map_name
  end

  def update
    # Map Transition
    if @map_transition
      transition_id = "["+$ats.season_id.to_s+"]"
      map_infos = load_data("Data/MapInfos.rxdata")
      for key in map_infos.keys
        if map_infos[key].name.include?(@map_name) and map_infos[key].name.include?(transition_id)
          next if key == @map_id
          setup(key)
          @tileset_refresh = true
          return
        end
      end
    end
    # Tileset Transition
    if @tileset_transition
      if @season != $ats.season_id
        @tileset_refresh = true
        @season = $ats.season_id
        tileset_name = $game_map.tileset_name.split
        @tileset_name = tileset_name[0] + " " + $ats.season_id.to_s
        for i in 0..6
          autotile_name = $game_map.autotile_names[i].split
          next if autotile_name[0] == nil
          if autotile_name[1] == nil
            @autotile_names[i] = autotile_name[0]
          else
            @autotile_names[i] = autotile_name[0] + " " + $ats.season_id.to_s
          end
        end
      end
    end
    $game_map.need_refresh = true
    ats_game_map_update
  end
  
end
#===================================================
# â–² CLASS Game_Map Additional Code Ends
#===================================================


#===================================================
# â–¼ CLASS Spriteset_Map Additional Code Begins
#===================================================
class Spriteset_Map

  alias ats_spriteset_map_update update

  def update
    if $game_map.tileset_refresh
      $game_map.tileset_refresh = false
      Graphics.freeze
      dispose
      initialize
      Graphics.transition(20)
    end
    ats_spriteset_map_update
  end
  
end
#===================================================
# â–² CLASS Spriteset_Map Additional Code Ends
#===================================================


#===================================================
# â–¼ CLASS BGS Additional Code Begins
#===================================================

class BGS
  #--------------------------------------------------------------------------
  attr_accessor :name
  attr_accessor :volume
  attr_accessor :pitch
  #--------------------------------------------------------------------------
  def initialize
    @name = ""
    @volume = 80
    @pitch = 100
  end
end
#===================================================
# â–² CLASS BGS Additional Code Ends
#===================================================

wow..
that doesn't sound easy.. :/
good luck and thanks MeisMe! ^_^
 
Input System? I think this is it:

Code:
#===============================================================================
# ** Input Script v2 - This script was first created by Cybersam and she 
#                         deserves most of the credit, all I did was add a few 
#                         functions. (Astro_Mech says)
#-------------------------------------------------------------------------------
# Author    Cybersam
# Version   2.0
# Date      11-04-06
# Edit      Astro_mech and Shark_Tooth
#===============================================================================
SDK.log("Input", "Astro_mech and Shark_Tooth", "2.0", " 13-04-06")
#-------------------------------------------------------------------------------
# Begin SDK Enabled Check
#-------------------------------------------------------------------------------
if SDK.state('Input')
module Input
  #--------------------------------------------------------------------------
  # * Variable Setup
  #-------------------------------------------------------------------------- 
    @keys = []
    @pressed = []
    Mouse_Left = 1
    Mouse_Right = 2
    Mouse_Middle = 4
    Back= 8
    Tab = 9
    Enter = 13
    Shift = 16
    Ctrl = 17
    Alt = 18
    Esc = 0x1B
    LT = 0x25
    UPs = 0x26  
    RT = 0x27 
    DN = 0x28
    Space = 32
    Numberkeys = {}
    Numberkeys[0] = 48        # => 0
    Numberkeys[1] = 49        # => 1
    Numberkeys[2] = 50        # => 2
    Numberkeys[3] = 51        # => 3
    Numberkeys[4] = 52        # => 4
    Numberkeys[5] = 53        # => 5
    Numberkeys[6] = 54        # => 6
    Numberkeys[7] = 55        # => 7
    Numberkeys[8] = 56        # => 8
    Numberkeys[9] = 57        # => 9
   # NumberUpKeys = {}
   # NumberUpKeys[0] = "!"
   # NumberUpKeys[1] = "@"
   # NumberUpKeys[2] = "#"
   # NumberUpKeys[3] = "$"
   # NumberUpKeys[4] = "%"
   # NumberUpKeys[5] = "^"
   # NumberUpKeys[6] = "&"
   # NumberUpKeys[7] = "*"
   # NumberUpKeys[8] = "("
   # NumberUpKeys[9] = ")"
    Numberpad = {}
    Numberpad[0] = 45
    Numberpad[1] = 35
    Numberpad[2] = 40
    Numberpad[3] = 34
    Numberpad[4] = 37
    Numberpad[5] = 12
    Numberpad[6] = 39
    Numberpad[7] = 36
    Numberpad[8] = 38
    Numberpad[9] = 33
    Letters = {}
    Letters["A"] = 65
    Letters["B"] = 66
    Letters["C"] = 67
    Letters["D"] = 68
    Letters["E"] = 69
    Letters["F"] = 70
    Letters["G"] = 71
    Letters["H"] = 72
    Letters["I"] = 73
    Letters["J"] = 74
    Letters["K"] = 75
    Letters["L"] = 76
    Letters["M"] = 77
    Letters["N"] = 78
    Letters["O"] = 79
    Letters["P"] = 80
    Letters["Q"] = 81
    Letters["R"] = 82
    Letters["S"] = 83
    Letters["T"] = 84
    Letters["U"] = 85
    Letters["V"] = 86
    Letters["W"] = 87
    Letters["X"] = 88
    Letters["Y"] = 89
    Letters["Z"] = 90
    Fkeys = {}
    Fkeys[1] = 112
    Fkeys[2] = 113
    Fkeys[3] = 114
    Fkeys[4] = 115
    Fkeys[5] = 116
    Fkeys[6] = 117
    Fkeys[7] = 118
    Fkeys[8] = 119
    Fkeys[9] = 120
    Fkeys[10] = 121
    Fkeys[11] = 122
    Fkeys[12] = 123
    Collon = 186        # => \ |
    Equal = 187         # => = +
    Comma = 188         # => , <
    Underscore = 189    # => - _
    Dot = 190           # => . >
    Backslash = 191     # => / ?
    Lb = 219
    Rb = 221
    Quote = 222         # => '"
    State = Win32API.new('user32','GetKeyState',['i'],'i')
    Key = Win32API.new('user32','GetAsyncKeyState',['i'],'i')
#-------------------------------------------------------------------------------
    USED_KEYS = [Mouse_Left, Mouse_Right, Mouse_Middle] 
#-------------------------------------------------------------------------------
  module_function
    #--------------------------------------------------------------------------  
    def Input.getstate(key)
      return true unless State.call(key).between?(0, 1)
      return false
    end
    #--------------------------------------------------------------------------
    def Input.testkey(key)
      Key.call(key) & 0x01 == 1
    end
    #--------------------------------------------------------------------------
    def Input.update
      @keys = []
      @keys.push(Input::Mouse_Left) if Input.testkey(Input::Mouse_Left)
      @keys.push(Input::Mouse_Right) if Input.testkey(Input::Mouse_Right)
      @keys.push(Input::Back) if Input.testkey(Input::Back)
      @keys.push(Input::Tab) if Input.testkey(Input::Tab)
      @keys.push(Input::Enter) if Input.testkey(Input::Enter)
      @keys.push(Input::Shift) if Input.testkey(Input::Shift)
      @keys.push(Input::Ctrl) if Input.testkey(Input::Ctrl)
      @keys.push(Input::Alt) if Input.testkey(Input::Alt)
      @keys.push(Input::Esc) if Input.testkey(Input::Esc)
      for key in Input::Letters.values
        @keys.push(key) if Input.testkey(key)
      end
      for key in Input::Numberkeys.values
        @keys.push(key) if Input.testkey(key)
      end
      for key in Input::Numberpad.values
        @keys.push(key) if Input.testkey(key)
      end
      for key in Input::Fkeys.values
        @keys.push(key) if Input.testkey(key)
      end
      @keys.push(Input::Collon) if Input.testkey(Input::Collon)
      @keys.push(Input::Equal) if Input.testkey(Input::Equal)
      @keys.push(Input::Comma) if Input.testkey(Input::Comma)
      @keys.push(Input::Underscore) if Input.testkey(Input::Underscore)
      @keys.push(Input::Dot) if Input.testkey(Input::Dot)
      @keys.push(Input::Backslash) if Input.testkey(Input::Backslash)
      @keys.push(Input::Lb) if Input.testkey(Input::Lb)
      @keys.push(Input::Rb) if Input.testkey(Input::Rb)
      @keys.push(Input::Quote) if Input.testkey(Input::Quote)
      @keys.push(Input::Space) if Input.testkey(Input::Space)
      @keys.push(Input::LT) if Input.testkey(Input::LT)
      @keys.push(Input::UPs) if Input.testkey(Input::UPs)
      @keys.push(Input::RT) if Input.testkey(Input::RT)
      @keys.push(Input::DN) if Input.testkey(Input::DN)
      @pressed = []
      @pressed.push(Input::Space) if Input.getstate(Input::Space)
      @pressed.push(Input::Mouse_Left) if Input.getstate(Input::Mouse_Left)
      @pressed.push(Input::Mouse_Right) if Input.getstate(Input::Mouse_Right)
      @pressed.push(Input::Back) if Input.getstate(Input::Back)
      @pressed.push(Input::Tab) if Input.getstate(Input::Tab)
      @pressed.push(Input::Enter) if Input.getstate(Input::Enter)
      @pressed.push(Input::Shift) if Input.getstate(Input::Shift)
      @pressed.push(Input::Ctrl) if Input.getstate(Input::Ctrl)
      @pressed.push(Input::Alt) if Input.getstate(Input::Alt)
      @pressed.push(Input::Esc) if Input.getstate(Input::Esc)
      @pressed.push(Input::LT) if Input.getstate(Input::LT)
      @pressed.push(Input::UPs) if Input.getstate(Input::UPs)
      @pressed.push(Input::RT) if Input.getstate(Input::RT)
      @pressed.push(Input::DN) if Input.getstate(Input::DN)
      for key in Input::Numberkeys.values
        @pressed.push(key) if Input.getstate(key)
      end
      for key in Input::Numberpad.values
        @pressed.push(key) if Input.getstate(key)
      end
      for key in Input::Letters.values
        @pressed.push(key) if Input.getstate(key)
      end
      for key in Input::Fkeys.values
        @pressed.push(key) if Input.getstate(key)
      end
      @pressed.push(Input::Collon) if Input.getstate(Input::Collon)
      @pressed.push(Input::Equal) if Input.getstate(Input::Equal)
      @pressed.push(Input::Comma) if Input.getstate(Input::Comma)
      @pressed.push(Input::Underscore) if Input.getstate(Input::Underscore)
      @pressed.push(Input::Dot) if Input.getstate(Input::Dot)
      @pressed.push(Input::Backslash) if Input.getstate(Input::Backslash)
      @pressed.push(Input::Lb) if Input.getstate(Input::Lb)
      @pressed.push(Input::Rb) if Input.getstate(Input::Rb)
      @pressed.push(Input::Quote) if Input.getstate(Input::Quote)  
    end
    #--------------------------------------------------------------------------
    def Input.triggerd?(key)
      return true if @keys.include?(key)
      return false
    end
    #--------------------------------------------------------------------------
    def Input.pressed?(key)
      return true if @pressed.include?(key)
      return false
    end
  #--------------------------------------------------------------------------
  # * 4 Diraction
  #--------------------------------------------------------------------------
  def Input.dir4
    return 2 if Input.pressed?(Input::DN)
    return 4 if Input.pressed?(Input::LT)
    return 6 if Input.pressed?(Input::RT)
    return 8 if Input.pressed?(Input::UPs)
  end
  #--------------------------------------------------------------------------
  # * Trigger (key)
  #-------------------------------------------------------------------------- 
  def trigger?(key)
    keys = []
    case key
    when Input::DOWN
      keys.push(Input::DN)
    when Input::UP
      keys.push(Input::UPs)
    when Input::LEFT
      keys.push(Input::LT)
    when Input::RIGHT
      keys.push(Input::RT)
    when Input::C
      keys.push(Input::Space, Input::Enter, Input::Letters['C'])
    when Input::B
      keys.push(Input::Esc, Input::Letters["X"], Input::Numberpad[0])
    when Input::X
      keys.push(Input::Letters["A"])
    when Input::L
      keys.push(Input::Letters["Q"])
    when Input::R
      keys.push(Input::Letters["W"])
    when Input::Y
      keys.push(Input::Letters["R"])
    when Input::F5
      keys.push(Input::Fkeys[5])
    when Input::F6
      keys.push(Input::Fkeys[6])
    when Input::F7
      keys.push(Input::Fkeys[7])
    when Input::F8
      keys.push(Input::Fkeys[8])
    when Input::F9
      keys.push(Input::Fkeys[9])
    when Input::SHIFT
      keys.push(Input::Shift)
    when Input::CTRL
      keys.push(Input::Ctrl)
    when Input::ALT
      keys.push(Input::Alt)
    end
    for k in keys
     if Input.triggerd?(k)
       return true
     end
   end
   return false
 end
  #--------------------------------------------------------------------------
  # * Repeat (key)
  #-------------------------------------------------------------------------- 
  def repeat?(key)
    keys = []
    case key
    when Input::DOWN
      keys.push(Input::DN)
    when Input::UP
      keys.push(Input::UPs)
    when Input::LEFT
      keys.push(Input::LT)
    when Input::RIGHT
      keys.push(Input::RT)
    when Input::C
      keys.push(Input::Space, Input::Enter, Input::Letters['C'])
    when Input::B
      keys.push(Input::Esc, Input::Letters["X"], Input::Numberpad[0])
    when Input::X
      keys.push(Input::Letters["A"])
    when Input::L
      keys.push(Input::Letters["Q"])
    when Input::R
      keys.push(Input::Letters["W"])
    when Input::Y
      keys.push(Input::Letters["R"])
    when Input::F5
      keys.push(Input::Fkeys[5])
    when Input::F6
      keys.push(Input::Fkeys[6])
    when Input::F7
      keys.push(Input::Fkeys[7])
    when Input::F8
      keys.push(Input::Fkeys[8])
    when Input::F9
      keys.push(Input::Fkeys[9])
    when Input::SHIFT
      keys.push(Input::Shift)
    when Input::CTRL
      keys.push(Input::Ctrl)
    when Input::ALT
      keys.push(Input::Alt)
    end
    for k in keys
     if Input.triggerd?(k)
       return true
     end
   end
   return false
  end     
  #--------------------------------------------------------------------------
  # * Check (key)
  #-------------------------------------------------------------------------- 
  def check(key)
    Win32API.new("user32","GetAsyncKeyState",['i'],'i').call(key) & 0x01 == 1  # key 0
  end
  #--------------------------------------------------------------------------
  # * Mouse Update
  #-------------------------------------------------------------------------- 
  def mouse_update
    @used_i = []
    for i in USED_KEYS
      x = check(i)
      if x == true
        @used_i.push(i)
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Short Write C
  #-------------------------------------------------------------------------- 
  def Input.C
    Input.trigger?(C)
  end
  #--------------------------------------------------------------------------
  # * Short Write B
  #-------------------------------------------------------------------------- 
  def Input.B
    Input.trigger?(B)
  end
  #--------------------------------------------------------------------------
  # * Short Write A
  #-------------------------------------------------------------------------- 
  def Input.A
    Input.trigger?(A)
  end
  #--------------------------------------------------------------------------
  # * Short Write Down
  #-------------------------------------------------------------------------- 
  def Input.Down
    Input.trigger?(DOWN)
  end
  #--------------------------------------------------------------------------
  # * Short Write Up
  #-------------------------------------------------------------------------- 
  def Input.Up
    Input.trigger?(UP)
  end
  #--------------------------------------------------------------------------
  # * Short Write Right
  #-------------------------------------------------------------------------- 
  def Input.Right
    Input.trigger?(RIGHT)
  end
  #--------------------------------------------------------------------------
  # * Short Write Left
  #-------------------------------------------------------------------------- 
  def Input.Left
    Input.trigger?(LEFT)
  end
  #--------------------------------------------------------------------------
  # * Anykey pressed?  ( A or B or C or Down or Up or Right or Left )
  #-------------------------------------------------------------------------- 
  def Input.Anykey
    if A or B or C or Down or Up or Right or Left
      return true
    else
      return false
    end
  end
end
end
#-------------------------------------------------------------------------------
# End SDK Enabled Check
#-------------------------------------------------------------------------------
 
Status
Not open for further replies.

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top