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.

Y 65 Script Archive [Growing]

Status
Not open for further replies.

y 65

Member

Please Credit real owner of scripts if listed if not then noone to credit
Good luck script hunting  :lol:


Zelda Map Scroll
By Yeyinde
http://www.mediafire.com/?z00lsyj5uht

Animation On lvl up
By SG[Sand Golem]
http://www.mediafire.com/?pu39jktgeen

Call Map event
By SG[Sand Golem]
http://www.mediafire.com/?xwedwwp4umd

Ap Hud Advanced
By Gando
http://www.mediafire.com/?wt2ctxjzmwt

Action over game screen display
By Unknown
http://www.mediafire.com/?efhevnoenfu

Actor Customization 5.0
By Sythesize
http://www.mediafire.com/?ybudj313nah

Advanced Event triggers
By Near Fantastica
=begin
The below describes how you create additional triggers within events.  This is done by creating 'Comments' within the map event's 'Event Code' like below:

Comment: Event Trigger
Comment: Logic NUMBER
Comment: SCRIPT TEST
Comment: EndTrigger

Boolean Logic
NUMBER = 0 :: NO Logic
NUMBER = 1 :: AND Logic
NUMBER = 2 :: OR Logic
NUMBER = 3 :: NOR Logic
NUMBER = 4 :: NAND Logic
NUMBER = 5 :: XOR Logic
NUMBER = 6 :: XNOR Logic

SCRIPT TEST :: is the script you want to test

Take Care,
Near
=end



#================================
# ¦ Advanced Event Triggers
#================================
#  By: Near Fantastica
#    Date: 11.07.05
#    Version: 1
#================================

class Game_Event < Game_Character
   #--------------------------------------------------------------------------
   def script_trigger?(string)
      result = false
      begin
         result = eval(string)
         return true if result == true
         return false if result == false
      rescue SyntaxError, NameError => einterpreted
         print "String Can not be interpreted: " + einterpreted
      rescue StandardError => erun
         print "Error running script: " + erun
      end
   end
   #--------------------------------------------------------------------------
   def check_trigger?(list)
      triggers = []
      logic = 0
      for line in list
         index = list.index(line)
         next if not list[index].parameters[0].is_a?(String)
         next if list[index].parameters[0] != "Event Trigger"
         index += 1
         command = list[index].parameters[0]
         string = command.split
         logic = string[1].to_i
         loop do
            index += 1
            string = list[index].parameters[0]
            break if string == "End Trigger"
            triggers.push(true) if script_trigger?(string)
            triggers.push(false) if not script_trigger?(string)
         end
      end
      case logic
      when 0
         return false if triggers[0] == false
      when 1 # AND
         return false if triggers.include?(false)
      when 2 # OR
         array = triggers.uniq
         return false if array.size == 1 and array.include?(false)
      when 3 # NOR
         array = triggers.uniq
         return false if not (array.size == 1 and array.include?(false))
      when 4 # NAND
         array = triggers.uniq
         return false if (array.size == 1 and triggers.include?(true))
      when 5 # XOR
         return false if not (triggers.include?(false) and triggers.include?(true))
      when 6 # XNOR
         return false if triggers.include?(false) and triggers.include?(true)
      end
      return true
   end
   #--------------------------------------------------------------------------
   def refresh
      new_page = nil
      unless @erased
         for page in @event.pages.reverse
            c = page.condition
            if c.switch1_valid
               if $game_switches[c.switch1_id] == false
                  next
               end
            end
            if c.switch2_valid
               if $game_switches[c.switch2_id] == false
                  next
               end
            end
            if c.variable_valid
               if $game_variables[c.variable_id] < c.variable_value
                  next
               end
            end
            if c.self_switch_valid
               key = [@map_id, @event.id, c.self_switch_ch]
               if $game_self_switches[key] != true
                  next
               end
            end
            next if not check_trigger?(page.list)
            new_page = page
            break
         end
      end
      if new_page == @page
         return
      end
      @page = new_page
      clear_starting
      if @page == nil
         @tile_id = 0
         @character_name = ""
         @character_hue = 0
         @move_type = 0
         @through = true
         @trigger = nil
         @list = nil
         @interpreter = nil
         return
      end
      @tile_id = @page.graphic.tile_id
      @character_name = @page.graphic.character_name
      @character_hue = @page.graphic.character_hue
      if @original_direction != @page.graphic.direction
         @direction = @page.graphic.direction
         @original_direction = @direction
         @prelock_direction = 0
      end
      if @original_pattern != @page.graphic.pattern
         @pattern = @page.graphic.pattern
         @original_pattern = @pattern
      end
      @opacity = @page.graphic.opacity
      @blend_type = @page.graphic.blend_type
      @move_type = @page.move_type
      @move_speed = @page.move_speed
      @move_frequency = @page.move_frequency
      @move_route = @page.move_route
      @move_route_index = 0
      @move_route_forcing = false
      @walk_anime = @page.walk_anime
      @step_anime = @page.step_anime
      @direction_fix = @page.direction_fix
      @through = @page.through
      @always_on_top = @page.always_on_top
      @trigger = @page.trigger
      @list = @page.list
      @interpreter = nil
      if @trigger == 4
         @interpreter = Interpreter.new
      end
      check_event_trigger_auto
   end
end

class Game_CommonEvent
   #--------------------------------------------------------------------------
   def script_trigger?(string)
      result = false
      begin
         result = eval(string)
         return true if result == true
         return false if result == false
      rescue SyntaxError, NameError => einterpreted
         print "String Can not be interpreted: " + einterpreted
      rescue StandardError => erun
         print "Error running script: " + erun
      end
   end
   #--------------------------------------------------------------------------
   def check_trigger?(list)
      triggers = []
      logic = 0
      for line in list
         index = list.index(line)
         next if not list[index].parameters[0].is_a?(String)
         next if list[index].parameters[0] != "Event Trigger"
         index += 1
         command = list[index].parameters[0]
         string = command.split
         logic = string[1].to_i
         loop do
            index += 1
            string = list[index].parameters[0]
            break if string == "End Trigger"
            triggers.push(true) if script_trigger?(string)
            triggers.push(false) if not script_trigger?(string)
         end
      end
      case logic
      when 0
         return false if triggers[0] == false
      when 1 # AND
         return false if triggers.include?(false)
      when 2 # OR
         array = triggers.uniq
         return false if array.size == 1 and array.include?(false)
      when 3 # NOR
         array = triggers.uniq
         return false if not (array.size == 1 and array.include?(false))
      when 4 # NAND
         array = triggers.uniq
         return false if (array.size == 1 and triggers.include?(true))
      when 5 # XOR
         return false if not (triggers.include?(false) and triggers.include?(true))
      when 6 # XNOR
         return false if triggers.include?(false) and triggers.include?(true)
      end
      return true
   end
   #--------------------------------------------------------------------------
   def get_trigger
      return true if self.trigger == 2 and $game_switches[self.switch_id] == true
      temp = list
      return true if check_trigger?(temp) == true
      return false
   end
   #--------------------------------------------------------------------------
   def refresh
      if get_trigger == true
         if @interpreter == nil
            @interpreter = Interpreter.new
         end
      else
         @interpreter = nil
      end
   end
end
Actor move frame speed
By Uknown
class Game_Temp
  attr_accessor :new_frame_count

  alias more_frame_temp_init initialize

  def initialize
    more_frame_temp_init
    @new_frame_count = 10
  end
end

class Game_Character
  def update
    if jumping?
      update_jump
    elsif moving?
      update_move
    else
      update_stop
    end
    if @anime_count > 18 - @move_speed * 10
      if not @step_anime and @stop_count > 0
        @pattern = @original_pattern
      else
        if self.is_a?(Game_Event)
          @pattern = (@pattern + 1) % 4
        else
          @pattern = (@pattern + 1) % $game_temp.new_frame_count
        end
      end
      @anime_count = 0
    end
    if @wait_count > 0
      @wait_count -= 1
      return
    end
    if @move_route_forcing
      move_type_custom
      return
    end
    if @starting or lock?
      return
    end
    if @stop_count > (40 - @move_frequency * 2) * (6 - @move_frequency)
      case @move_type
      when 1
        move_type_random
      when 2
        move_type_toward_player
      when 3
        move_type_custom
      end
    end
  end
end

class Sprite_Character < RPG::Sprite
  def update
    super
    # If tile ID, file name, or hue are different from current ones
    if @tile_id != @character.tile_id or
       @character_name != @character.character_name or
       @character_hue != @character.character_hue
      # Remember tile ID, file name, and hue
      @tile_id = @character.tile_id
      @character_name = @character.character_name
      @character_hue = @character.character_hue
      # If tile ID value is valid
      if @tile_id >= 384
        self.bitmap = RPG::Cache.tile($game_map.tileset_name,
          @tile_id, @character.character_hue)
        self.src_rect.set(0, 0, 32, 32)
        self.ox = 16
        self.oy = 32
      # If tile ID value is invalid
      else
        self.bitmap = RPG::Cache.character(@character.character_name,
          @character.character_hue)
        if @character.is_a?(Game_Event)
          @cw = bitmap.width / 4
        else
          @cw = bitmap.width / $game_temp.new_frame_count
        end
        @ch = bitmap.height / 4
        self.ox = @cw / 2
        self.oy = @ch
      end
    end
    # Set visible situation
    self.visible = (not @character.transparent)
    # If graphic is character
    if @tile_id == 0
      # Set rectangular transfer
      sx = @character.pattern * @cw
      sy = (@character.direction - 2) / 2 * @ch
      self.src_rect.set(sx, sy, @cw, @ch)
    end
    # Set sprite coordinates
    self.x = @character.screen_x
    self.y = @character.screen_y
    self.z = @character.screen_z(@ch)
    # Set opacity level, blend method, and bush depth
    self.opacity = @character.opacity
    self.blend_type = @character.blend_type
    self.bush_depth = @character.bush_depth
    # Animation
    if @character.animation_id != 0
      animation = $data_animations[@character.animation_id]
      animation(animation, true)
      @character.animation_id = 0
    end
  end
end

class Interpreter
  def upgrade_frames
    $game_temp.new_frame_count = 6
  end

  def downgrade_frames
    $game_temp.new_frame_count = 4
  end
end

Analog input
By Near Fantastica
#==============================================================================
# ** Anlog Movment
#------------------------------------------------------------------------------
# Near Fantastica
# Version 1
# 01.03.06
#==============================================================================

#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log("Anlog Movment", "Near Fantastica", 1, "01.03.06")

#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.state("Anlog Movment") == true
 
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
#  This class performs map screen processing.
#==============================================================================

class Scene_Map
  #--------------------------------------------------------------------------
  alias nf_anlogmovement_scene_map_main_loop main_loop
  #--------------------------------------------------------------------------
  # * Main Loop
  #--------------------------------------------------------------------------
  def main_loop
    #Update Mouse
    Mouse.update
    nf_anlogmovement_scene_map_main_loop
  end
end

#==============================================================================
# ** Game_Character
#------------------------------------------------------------------------------
#  This class deals with characters. It's used as a superclass for the
#  Game_Player and Game_Event classes.
#==============================================================================

class Game_Character
  #--------------------------------------------------------------------------
  alias nf_anlogmovement_game_character_update_movement update_movement
  #--------------------------------------------------------------------------
  # * Update Movement
  #--------------------------------------------------------------------------
  def update_movement
    nf_anlogmovement_game_character_update_movement
    # If stop count exceeds a certain value (computed from move frequency)
    if @stop_count > (40 - @move_frequency * 2) * (6 - @move_frequency)
      # Branch by move type
      case @move_type
      when 4  # move_toward_target
        x,y = Mouse.grid
        return if x == nil or y == nil
        move_toward_target(x, y)
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Move object toward target
  #--------------------------------------------------------------------------
  def move_toward_target(x, y)
    # Get difference in player coordinates
    sx = @x - x
    sy = @y - y
    # If coordinates are equal
    if sx == 0 and sy == 0
      return
    end
    # Get absolute value of difference
    abs_sx = sx.abs
    abs_sy = sy.abs
    # If horizontal and vertical distances are equal
    if abs_sx == abs_sy
      # Increase one of them randomly by 1
      rand(2) == 0 ? abs_sx += 1 : abs_sy += 1
    end
    # If horizontal distance is longer
    if abs_sx > abs_sy
      # Move towards player, prioritize left and right directions
      sx > 0 ? move_left : move_right
      if not moving? and sy != 0
        sy > 0 ? move_up : move_down
      end
    # If vertical distance is longer
    else
      # Move towards player, prioritize up and down directions
      sy > 0 ? move_up : move_down
      if not moving? and sx != 0
        sx > 0 ? move_left : move_right
      end
    end
  end
end

#==============================================================================
# ** Game_Player
#------------------------------------------------------------------------------
#  This class handles the player. Its functions include event starting
#  determinants and map scrolling. Refer to "$game_player" for the one
#  instance of this class.
#==============================================================================

class Game_Player < Game_Character
  #--------------------------------------------------------------------------
  alias nf_anlogmovement_game_player_update_player_movement update_player_movement
  #--------------------------------------------------------------------------
  # * Player Movement Update
  #--------------------------------------------------------------------------
  def update_player_movement
    anlog_movement
    nf_anlogmovement_game_player_update_player_movement
  end
  #--------------------------------------------------------------------------
  # * Anlog Movement
  #--------------------------------------------------------------------------
  def anlog_movement
    @move_type = 4
    x,y = Mouse.grid
    return if x == nil or y == nil
    sx = @x - x
    sy = @y - y
    abs_sx = sx.abs
    abs_sy = sy.abs
    distance = (abs_sx + abs_sy) / 2
    case distance
    when 0..1
      @move_speed = 3
    when 2..8
      @move_speed = 4
    end 
  end
end

#------------------------------------------------------------------------------
# * End SDK Enable Test
#------------------------------------------------------------------------------
end

Mouse input Module
By Near Fantastica
#==============================================================================
# ** Mouse Input Module
#------------------------------------------------------------------------------
# Near Fantastica
# Version 5
# 01.03.06
#------------------------------------------------------------------------------
# This module defines mouse input
#==============================================================================

#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log("Mouse Input", "Near Fantastica", 5, "01.03.06")

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

module Mouse
  @position
  GSM = Win32API.new('user32', 'GetSystemMetrics', 'i', 'i')
  Cursor_Pos= Win32API.new('user32', 'GetCursorPos', 'p', 'i')
  Scr2cli = Win32API.new('user32', 'ScreenToClient', %w(l p), 'i')
  Client_rect = Win32API.new('user32', 'GetClientRect', %w(l p), 'i')
  Readini = Win32API.new('kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l')
  Findwindow = Win32API.new('user32', 'FindWindowA', %w(p p), 'l')
  #-------------------------------------------------------------------------- 
  def Mouse.grid
    return nil if @pos == nil
    offsetx = $game_map.display_x / 4
    offsety = $game_map.display_y / 4
    x = (@pos[0] + offsetx) / 32
    y = (@pos[1] + offsety) / 32
    return [x, y]
  end
  #-------------------------------------------------------------------------- 
  def Mouse.position
    return @pos == nil ? [0, 0] : @pos
  end
  #-------------------------------------------------------------------------- 
  def Mouse.global_pos
    pos = [0, 0].pack('ll')
    if Cursor_Pos.call(pos) != 0
      return pos.unpack('ll')
    else
      return nil
    end
  end
  #-------------------------------------------------------------------------- 
  def Mouse.pos
    x, y = Mouse.screen_to_client(*Mouse.global_pos)
    width, height = Mouse.client_size
    begin
      if (x >= 0 and y >= 0 and x < width and y < height)
        return x, y
      else
        return nil
      end
    rescue
      return nil
    end
  end
  #-------------------------------------------------------------------------- 
  def Mouse.update
    @pos = Mouse.pos
  end
  #-------------------------------------------------------------------------- 
  def Mouse.screen_to_client(x, y)
    return nil unless x and y
    pos = [x, y].pack('ll')
    if Scr2cli.call(Mouse.hwnd, pos) != 0
      return pos.unpack('ll')
    else
      return nil
    end
  end
  #-------------------------------------------------------------------------- 
  def Mouse.hwnd
    game_name = "\0" * 256
    Readini.call('Game','Title','',game_name,255,".\\Game.ini")
    game_name.delete!("\0")
    return Findwindow.call('RGSS Player',game_name)
  end
  #-------------------------------------------------------------------------- 
  def Mouse.client_size
    rect = [0, 0, 0, 0].pack('l4')
    Client_rect.call(Mouse.hwnd, rect)
    right, bottom = rect.unpack('l4')[2..3]
    return right, bottom
  end
end

#------------------------------------------------------------------------------
# * End SDK Enable Test
#------------------------------------------------------------------------------
end

Cone of view
By unkown
#the switch to be activated when the event see the hero. false if none
SWITCH = false

class Game_Character
  attr_reader :cone
  attr_reader :prev_x
  attr_reader :prev_y
  attr_reader :prev_dir
  attr_accessor :sight

  alias conesys_gamecharacter_initialize initialize
 
  def initialize
    @cone = []
    @sight = 0
    conesys_gamecharacter_initialize
  end
 
  def get_cone(sight = 7)
    cone = []
    @sight = sight
    #This algorithim makes the cone using a 2d array
    case self.direction
    when 2 #down
      #adds the first square
      line = 1
      cone.push([self.x,self.y + 1])
      factor = 1
      #now comes the routine to make the cone
      while line < sight
        line += 1
        cone.push([self.x,self.y + line])
        1.upto(factor) do |a|
          cone.push([self.x - a,self.y + line])
          cone.push([self.x + a,self.y + line])
        end
        factor += 1
      end
    when 4 #left
      line = 1
      cone.push([self.x - 1,self.y])
      factor = 1
      #now comes the routine to make the cone
      while line < sight
        line += 1
        cone.push([self.x - line,self.y])
        1.upto(factor) do |a|
          cone.push([self.x - line,self.y - a])
          cone.push([self.x - line,self.y + a])
        end
        factor += 1
      end
      when 6 #right
      line = 1
      cone.push([self.x + 1,self.y])
      factor = 1
      #now comes the routine to make the cone
      while line < sight
        line += 1
        cone.push([self.x + line,self.y])
        1.upto(factor) do |a|
          cone.push([self.x + line,self.y - a])
          cone.push([self.x + line,self.y + a])
        end
        factor += 1
      end
    when 8 #up
      #adds the first square
      line = 1
      cone.push([self.x,self.y + 1])
      factor = 1
      #now comes the routine to make the cone
      while line < sight
        line += 1
        cone.push([self.x,self.y - line])
        1.upto(factor) do |a|
          cone.push([self.x - a,self.y - line])
          cone.push([self.x + a,self.y - line])
        end
        factor += 1
      end
    end

    cone_obstacles(cone)
  end
  #here any tile that is covered by an obstacle is removed
  #from the cone
  def cone_obstacles(cone)
    for i in 0..cone.length
      if cone != nil
        if !$game_map.passable?(cone[0], cone[1], 0)
          case self.direction
          when 2 #down
            #the diference between the sight and the obstacle position
            limit = self.sight - (cone[1] - self.y)
            position = 1
            #to make the read easier
            index = cone.index([cone[0],cone[1] + 1])
            cone[index] = nil if index != nil
            factor = 1
            #now comes the routine to remove the bloked tiles
              while position < limit
              position += 1
              index = cone.index([cone[0],cone[1] + position])
              cone[index] = nil if index != nil
                1.upto(factor) do |a|
                  index = cone.index([cone[0] - a,cone[1] + position])
                  cone[index] = nil if index != nil
                  index = cone.index([cone[0] + a,cone[1] + position])
                  cone[index] = nil if index != nil
                end
              factor += 1
            end
          when 4 #left
            #the diference between the sight and the obstacle position
            limit = self.sight - (self.x - cone[0])
            position = 1
            #to make the read easier
            index = cone.index([cone[0] - 1,cone[1]])
            cone[index] = nil if index != nil
            factor = 1
            #now comes the routine to remove the bloked tiles
            while position < limit
              position += 1
              index = cone.index([cone[0] - position,cone[1]])
              cone[index] = nil if index != nil
                1.upto(factor) do |a|
                  index = cone.index([cone[0] - position,cone[1] - a])
                  cone[index] = nil if index != nil
                  index = cone.index([cone[0] - position,cone[1] + a])
                  cone[index] = nil if index != nil
                end
              factor += 1
            end
          when 6 #right
            #the diference between the sight and the obstacle position
            limit = self.sight - (cone[0] - self.x)
            position = 1
            #to make the read easier
            index = cone.index([cone[0] + 1,cone[1]])
            cone[index] = nil if index != nil
            factor = 1
            #now comes the routine to remove the bloked tiles
              while position < limit
              position += 1
              index = cone.index([cone[0] + position,cone[1]])
              cone[index] = nil if index != nil
                1.upto(factor) do |a|
                  index = cone.index([cone[0] + position,cone[1] - a])
                  cone[index] = nil if index != nil
                  index = cone.index([cone[0] + position,cone[1] + a])
                  cone[index] = nil if index != nil
                end
            factor += 1
            end
          when 8 #up
            #the diference between the sight and the obstacle position
            limit = self.sight - (self.y - cone[1])
            position = 1
            #to make the read easier
            index = cone.index([cone[0],cone[1] - 1])
            cone[index] = nil if index != nil
            factor = 1
            #now comes the routine to remove the bloked tiles
              while position < limit
              position += 1
              index = cone.index([cone[0],cone[1] - position])
              cone[index] = nil if index != nil
                1.upto(factor) do |a|
                  index = cone.index([cone[0] - a,cone[1] - position])
                  cone[index] = nil if index != nil
                  index = cone.index([cone[0] + a,cone[1] - position])
                  cone[index] = nil if index != nil
                end
              factor += 1
            end
          end
        end
      end
    end
    #update the variables used to check the need of a refresh
    @prev_x = self.x
    @prev_y = self.y
    @prev_dir = self.direction
    @cone = cone
  end

  def in_cone
    #return false if the event do not have a cone
    if cone != []
      #now it checks if the actual position of the hero is inside the cone
      for i in 0...cone.length
        if cone != nil
          if $game_player.x == cone[0] && $game_player.y == cone[1]
            $game_switches[SWITCH] = true if SWITCH
            $game_map.need_refresh = true
            move_toward_player
          end
        end
      end
    end
  end
 
  def move_toward_player
    # Get difference in player coordinates
    sx = @x - $game_player.x
    sy = @y - $game_player.y
    # If coordinates are equal
    if sx == 0 and sy == 0
      return
    end
    #Now the 8-direction following
      #diagonal movements
    if sx > 0 && sy > 0;  move_upper_left
    elsif sx > 0 && sy < 0;  move_lower_left
    elsif sx < 0 && sy > 0;  move_upper_right
    elsif sx < 0 && sy < 0;  move_lower_right
      #normal movement
    elsif sx < 0 && sy == 0; move_right
    elsif sx > 0 && sy == 0; move_left
    elsif sx == 0 && sy < 0; move_down
    elsif sx == 0 && sy > 0; move_up
    end
  end
 
  #these modifications make the "hero touch" work better
  #thanks Linkin_T for the help
  def check_event_trigger_touch(x, y)
    return if not @stop_count > (40 - @move_frequency * 2) * (6 - @move_frequency)
    old_touch(x, y)
  end
  def check_event_trigger_auto
    return if not @stop_count > (40 - @move_frequency * 2) * (6 - @move_frequency)
    old_auto
  end
end

class Game_Event < Game_Character

  attr_reader :has_cone
  alias conesys_gameevent_initialize initialize
  alias old_touch check_event_trigger_touch
  alias old_auto check_event_trigger_auto
     
  def initialize(map_id, event)
    #a flag that tells if the event is cone-following-enabled or not
    @has_cone = false
    conesys_gameevent_initialize(map_id, event)
  end
 
    #start the cone routine.
  def add_cone(sight = 7)
    @has_cone = true
    get_cone(sight)
  end
    #stop the "cone following"
  def stop_cone
    @has_cone = false
  end
end

class Game_Player < Game_Character
 
  alias conesys_gameplayer_update update
 
  def update
    check_cone
    conesys_gameplayer_update
  end
 
  def check_cone
    #check if the event has a cone
    for i in $game_map.events.keys
      event = $game_map.events
      if event.has_cone && $scene.is_a?(Scene_Map)
        #check if the player is inside the cone of vision and make the
        #event follow him
        event.in_cone
        #update the cone if the event moved or the direction is different
        if event.x != event.prev_x || event.y != event.prev_y || event.direction != event.prev_dir
          event.get_cone(event.sight)
        end
      end
    end
  end
end
=begin
Instructions

To make an event use the cone to follow you, all you gotta do is set this in an "call script".
Code:$game_map.events[event id].add_cone(sight)
The default sight is 7, if you want to use this, just use "add_cone".
to make him stop, use
Code:$game_map.events[event id].stop_cone
You can activate a switch too, set the SWITCH constant in the top of the code to the switch ID that you want to be activated

=end


Custom Pause animation
By SlipKnot
MessagePause_Image: Filename of the picture, must be in the Pictures folder, its dimensions are: 64x16 (16x16 per frame)
MessagePause_x: x position of the graphic. Based on this formula: message x + message width - pause x
MessagePause_y: y position of the graphic. Based on this formula: message y + message height - pause y
MessagePause_Frames: Total frames for each animation frame.

#==============================================================================
# ** Custom Message Pause
#------------------------------------------------------------------------------
# Slipknot (dubealex.com/asylum)
# Version 1.0
# September 19, 2006
#==============================================================================

class Window_Message < Window_Selectable
  #--------------------------------------------------------------------------
  # * Constants
  #--------------------------------------------------------------------------
  MessagePause_Image = 'mes_but'
  MessagePause_x = 32
  MessagePause_y = 32
  MessagePause_Frames = 20
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias slipknot_messagepause_init initialize
  alias slipknot_messagepause_upd update
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    slipknot_messagepause_init
    @pause_g = Sprite.new
    @pause_g.bitmap = RPG::Cache.picture(MessagePause_Image)
    @pause_g.src_rect.set(0, 0, 16, 16)
    @pause_g.visible = false
    @pause_g.z = z + 3
    @pause_g_frame = 0
  end
  #--------------------------------------------------------------------------
  # * Set Pause
  #--------------------------------------------------------------------------
  def pause=(arg)
    @pause_g.visible = arg
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    if @pause_g.visible
      @pause_g.x = x + width - MessagePause_x
      @pause_g.y = y + height - MessagePause_y
      f = MessagePause_Frames / 4
      case @pause_g_frame
      when 0..(f - 1)
        @pause_g.src_rect.set(0, 0, 16, 16)
      when f..(f * 2 - 1)
        @pause_g.src_rect.set(16, 0, 16, 16)
      when (f * 2)..(f * 3 - 1)
        @pause_g.src_rect.set(32, 0, 16, 16)
      else
        @pause_g.src_rect.set(48, 0, 16, 16)
      end
      @pause_g_frame += 1
      @pause_g_frame %= MessagePause_Frames
    end
    slipknot_messagepause_upd
  end
end
http://i129.photobucket.com/albums/p240 ... es_but.png[/img]
I Dont remember were you put the picture so expiriment
 

y 65

Member

Advanced Fishing System
By GoldenShadow
#==============================================================================
# ** Advanced Fishing System
#------------------------------------------------------------------------------
# GoldenShadow
# Version 1.8
# 2005-07-29
#==============================================================================
#  <> Fishing Script Advanced v1.8dca
#  ==> You can delete all the comments except the copyright and creator info
#  ==> Do not rip, repost or any other way of reproducing without proper credit
#  ShadowClan Technologies © 2003-2005 - All rights reserved.
#-----------------------------------------------------------------------------
# * Help? Info?
#  There's been a change of plan.
#  Help is located to original place of posting of this script.
#
# * History
# 8/6/2005 22:22 - Made Fish Class [inits, defs]
# 24/7/2005 13:40 - Made scene and windows for script
# 24/7/2005 15:52 - Fixed errors
# 24/7/2005 23:51 - Completion of beta version 0.21ß + Info
# 26/7/2005 14:21 - Added new definitions and created equip scene
# 26/7/2005 14:40 - Fixed some more problems when equipping.
#                   Status window complete.
# 26/7/2005 15:19 - Added Attraction? definition.
#                   You can use this. I didn't.
# 27/7/2005 13:47 - Fixed some bugs
# 28/7/2005 14:44 - Added harpoons
# 28/7/2005 16:00 - Added nets
# 29/7/2005 14:10 - Modified result window to net catching
# 29/7/2005 23:33 - Result scene for net Game_Fishing. Few bugs though...
#
# That would end the little explaining for now.
# I -really- hope you like this script.
#-------------------------------------------------------------------------------------------
# * Created by: GoldenShadow & Nick
# * Credits REGIX & makeamidget
#==============================================================================

#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log('Advanced Fishing System', 'GoldenShadow', 1, '2005-07-29')

#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.state('Advanced Fishing System') == true
 
#==============================================================================
# ** Shadow Clan Module
#==============================================================================

module SC
  #--------------------------------------------------------------------------
  # * Advanced Fishing System Log
  #--------------------------------------------------------------------------
  RXSC_FISH = "Fishing Script ENHANCED: Ver. 1.8dca"
  KEEP_FISH = true
  LOSE_BAIT = false
  MULTI_POOL = true
  USE_POINTS = true
  FISH_SPEED = Graphics.frame_rate
end

#==============================================================================
# ** Game_Fish
#==============================================================================

class Game_Fish
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :meter_player   # The meter to built up while you press buttons
  attr_accessor :meter_fish     # This the fish meter that also builts up.
  attr_accessor :active_fish_id # The active fish, random calculated
  attr_accessor :net_fish_ids   # Contains more fishes for in nets
  attr_accessor :fish_party     # Contains party info
  attr_accessor :fish_caught    # array for fish caught (true/false)
  attr_accessor :fish_size      # array for fish size
  attr_accessor :fish_weight    # array for fish weight
  attr_accessor :fish_name
  attr_accessor :fish_life
  attr_accessor :fish_resist
  attr_accessor :max_fish
  attr_accessor :rod_power
  attr_accessor :phase
  attr_accessor :rods
  attr_accessor :bait
  attr_accessor :equipped_rod
  attr_accessor :equipped_bait
  attr_accessor :fish_point
  attr_accessor :total_points
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    $data_items = load_data("Data/Items.rxdata") # in case
    @meter_player = 0
    @meter_fish = 0
    @active_fish_id = 1
    @net_fish_ids = []
    @fish_party = []
    # the hash with data (true if caught)
    @fish_caught = {}
    # fish id with fish size (in whichever method [cm, inch etc])
    @fish_size = []
    # fish id with fish weight (in whichever method [kg, lbs etc])
    @fish_weight =  []
    # fish id with fish name
    @fish_name = {}
    @fish_life = []
    @fish_resist = []
    # max fish to be caught (look at item database)
    @max_fish = $data_items.size
    @rod_power = 1
    @phase = 0
    @rods = []
    @bait = []
    # ID of equipped rod
    @equipped_rod = 0
    # ID of equipped bait
    @equipped_bait = 0
    @fish_point = []
    @total_points = 0
    get_data
    get_rod_power
    get_harpoon_range
    get_net_time
    get_net_range
    get_net_max
    get_net_power
  end
  #--------------------------------------------------------------------------
  # * Get Data
  #--------------------------------------------------------------------------
  def get_data
    for id in 1...@max_fish
       @fish_caught[id] = false
       @fish_size[id] = 0
       @fish_weight[id] = 0
       @fish_name[id] = "????"
       @fish_life[id] = 100
       @fish_resist[id] = ($data_items[id].hit.to_f) / 2.0
       @fish_point[id] = ($data_items[id].price.to_i / 2)
    end
  end
  #--------------------------------------------------------------------------
  # * Points
  #--------------------------------------------------------------------------
  def points
    return @total_points
  end
  #--------------------------------------------------------------------------
  # * Add Points
  #--------------------------------------------------------------------------
  def add_points(n)
    if n.is_a?(Numeric)
       @total_points += n
    else
       return
    end
  end
  #--------------------------------------------------------------------------
  # * Rod Power
  #--------------------------------------------------------------------------
  def get_rod_power
    # Rod ID for fishing
    if @equipped_rod == 33
      return @rod_power = 1
    # Rod ID for fishing
    elsif @equipped_rod == 34
      return @rod_power = 2
    # Rod ID for fishing
    elsif @equipped_rod == 35
      return @rod_power = 3
    # Default
    else
      return @rod_power = 1
    end
  end
  #--------------------------------------------------------------------------
  # * Harpoon Range
  #--------------------------------------------------------------------------
  def get_harpoon_range
    # Harpoon ID in item database
    if @equipped_rod == 37
      range = [40, 60]
    # Range to catch fish in %.
    elsif @equipped_rod == 38
      range = [10, 30]
    # If harpoon ID is not defined, uses default range
    else
      range = [45, 55]
    end
    return range
  end
  #--------------------------------------------------------------------------
  # * Net Data
  #--------------------------------------------------------------------------
  def get_net_data(type = 0)
    if @equipped_rod == 39 # ID of net
      @net_time = 2 # seconds to hold
      @net_range = [1, 99]#[44, 50] # what range to keep
      @net_power = 5 #net power
      @net_max = 10 #max fish
    elsif @equipped_rod == 40
      @net_time = 10
      @net_range = [55, 60]
      @net_power = 3
      @net_max = 4
    elsif @equipped_rod == 33
      @net_time = 2
      @net_range = [1,99]
      @net_power = 3
      @net_max = 5
    else # if ID not defined
      @net_time = 10 # seconds to hold (default)
      @net_range = [20, 25] #range (default)
      @net_power = 3 #max power (default)
      @net_max = 3 #max fish (default)
    end
    # Return Net Value
    case type
    when 0
       return
    when 1
       return @net_time
    when 2
       return @net_range
    when 3
       return @net_power
    when 4
       return @net_max
    end
  end
  #--------------------------------------------------------------------------
  # * Net Time
  #--------------------------------------------------------------------------
  def get_net_time
    return get_net_data(1)
  end
  #--------------------------------------------------------------------------
  # * Net Range
  #--------------------------------------------------------------------------
  def get_net_range
    return get_net_data(2)
  end
  #--------------------------------------------------------------------------
  # * Net Power
  #--------------------------------------------------------------------------
  def get_net_power
    return get_net_data(3)
  end
  #--------------------------------------------------------------------------
  # * Net Max
  #--------------------------------------------------------------------------
  def get_net_max
    return get_net_data(4)
  end
  #--------------------------------------------------------------------------
  # * Record Data
  #--------------------------------------------------------------------------
  def caught(id)
    if id == nil
       print "Unable to add fish: Missing Parameters (ERR01)"
       return
    elsif id > @max_fish or id == 0
       print "Unable to add fish: Range beyond MAX or NIL (ERR02)"
       return
    else
       @fish_caught[id] = true
       @fish_size[id] = $data_items[id].pdef_f
       @fish_weight[id] = $data_items[id].mdef_f
       @fish_name[id] = $data_items[id].name
    end
  end
  #--------------------------------------------------------------------------
  # * Record Data
  #--------------------------------------------------------------------------
  def attraction?(bait)
    # IDs for fish to be attracted to some bait
    if @active_fish_id.include(1,2)
      # ID for equipped bait
      if @equipped_bait == 36
        # they are attracted and will bite
        return true
      else
        return false
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Pick Fish
  #--------------------------------------------------------------------------
  def pick_fish # randomly choice
    if SC::MULTI_POOL == true
      if @fish_party.size == 0
        @active_fish_id = @fish_party[0]
      else
        r = rand(@fish_party.size)
        @active_fish_id = @fish_party[r]
      end
    else
      @active_fish_id = @fish_party[0]
    end
  end
  #--------------------------------------------------------------------------
  # * Pick New Fish
  #--------------------------------------------------------------------------
  def pick_net_fish
    if SC::MULTI_POOL == true
      if @fish_party.size == 0
        @net_fish_ids[0] = @fish_party[0]
      else
        @net_fish_ids.clear
        maxr = rand($game_fish.get_net_max)
        for i in 0..maxr
          r = rand(@fish_party.size)
          @net_fish_ids = @fish_party[r]
        end
      end
    end
  end
end

#==============================================================================
# ** Window_Versus
#==============================================================================

class Window_Versus < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(16,16,260, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.z = 9999
    if $game_fish == nil
      $game_fish = Game_Fish.new
    end
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    inc = $data_items[$game_fish.equipped_rod].name
    if inc.include?("Harpoon") == false and inc.include?("Net") == false
       rect = Rect.new(63, 9, 102, 6)
       self.contents.fill_rect(rect, Color.new(0, 0, 0))
       rect = Rect.new(63, 25, 102, 6)
       self.contents.fill_rect(rect, Color.new(0, 0, 0))
       self.contents.font.size = 18
       self.contents.draw_text(0,-6,self.width-40,32,"Player")
       rect = Rect.new(64, 10, $game_fish.meter_player, 4)
       self.contents.fill_rect(rect, Color.new(0, 0, 255))
       self.contents.draw_text(0,10,self.width-40,32,"Fish")
       rect = Rect.new(64, 26, $game_fish.meter_fish, 4)
       self.contents.fill_rect(rect, Color.new(255, 0, 0))
       self.contents.draw_text(170, -6, self.width-40, 32,
         $game_fish.meter_player.round.to_s + " %")
       self.contents.draw_text(170, 10, self.width-40, 32,
         $game_fish.meter_fish.round.to_s + " %")
    elsif inc.include?("Harpoon")
       rect = Rect.new(63, 9, 102, 6)
       self.contents.fill_rect(rect, Color.new(0, 0, 0))
       self.contents.font.size = 18
       self.contents.draw_text(0,-6,self.width-40,32,"Player")
       rect = Rect.new(64, 10, $game_fish.meter_fish, 4)
       self.contents.fill_rect(rect, Color.new(0, 0, 255))
       self.contents.draw_text(0, 10, self.width-40 ,32,
         "HARPOON vs FISH", 1)
       self.contents.draw_text(170,-6,self.width-40,32,
         $game_fish.meter_fish.round.to_s + " %")
    elsif inc.include?("Net")
       rect = Rect.new(63, 9, 102, 6)
       self.contents.fill_rect(rect, Color.new(0, 0, 0))
       self.contents.font.size = 18
       self.contents.draw_text(0,-6,self.width-40,32,"Net")
       rect = Rect.new(64, 10, $game_fish.meter_fish, 4)
       self.contents.fill_rect(rect, Color.new(0, 0, 255))
       self.contents.draw_text(0, 10, self.width-40, 32,
         "NET vs FISHES!", 1)
       self.contents.draw_text(170, -6, self.width-40 ,32,
         $game_fish.meter_fish.round.to_s + " %")
    end
  end
end

#==============================================================================
# ** Window_Fish
#==============================================================================

class Window_Fish < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(fish, start = 0)
    super(320, 240, 320, 240)
    self.contents = Bitmap.new(width - 32, height - 32)
    @fish = fish
    @points = $game_fish.fish_point[@fish]
    refresh
  end
  #--------------------------------------------------------------------------
  # * Get Points
  #--------------------------------------------------------------------------
  def get_points
    @points = 0
    unless $game_fish.equipped_rod == nil or $game_fish.equipped_rod == 0
      if $data_items[$game_fish.equipped_rod].name.include?("Net")
        for id in $game_fish.fish_party
          @points += $game_fish.fish_point[id]
        end
      else
        @points = $game_fish.fish_point[$game_fish.active_fish_id]
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Get Average Str
  #--------------------------------------------------------------------------
  def get_avarage_str
    @avarage1 = 0
    @amount1 = 0
    for id in 0...@size
      @amount1 += $game_fish.fish_resist[id].to_i
    end
    @avarage1 = @amount1 / @size
  end
  #--------------------------------------------------------------------------
  # * Get Average Pnt
  #--------------------------------------------------------------------------
  def get_avarage_pnt
    @avarage2 = 0
    @amount2 = 0
    for id in 0...@size
      @amount2 += $game_fish.fish_point[id].to_i
    end
    @avarage2 = @amount2 / @size
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    get_points
    if $game_fish.phase == 0
      $game_fish.caught(@fish)
      self.contents.clear
      if $data_items[$game_fish.equipped_rod].name.include?("Net")
        @size = $game_fish.net_fish_ids.size
        get_avarage_str
        get_avarage_pnt
        self.contents.draw_text(0, 0, self.width - 40, 32,
          "#{@size} Kinds of fish caught! #{@points} Points!", 1)
        self.contents.draw_text(0, 64, self.width - 40, 32,
          "Avarage points: #{@avarage2}")
        self.contents.draw_text(0, 96, self.width - 40, 32,
          "Avarage strentgh: #{@avarage1}")
        self.contents.draw_text(0, 128, self.width - 40, 32,
          'More info, press A button', 1)
        self.contents.draw_text(0, 160, self.width - 40, 32,
          "Congrats! Total points: #{$game_fish.points}", 1)
      else
        self.contents.draw_text(0, 0, self.width - 40, 32,
          "Fish caught! #{@points} Points!", 1)
        bitmap = RPG::Cache.icon($data_items[@fish].icon_name)
        self.contents.blt(0, 32 + 4, bitmap, Rect.new(0, 0, 24, 24))
        self.contents.font.color = normal_color
        self.contents.draw_text(28, 32, 212, 32,
          $data_items[@fish].name)
        self.contents.draw_text(0, 64, self.width - 40, 32,
          "Size: " + $game_fish.fish_size[@fish].to_s + " cm.")
        self.contents.draw_text(0, 96, self.width - 40, 32,
          "Weight: " + $game_fish.fish_weight[@fish].to_s + " kg.")
        self.contents.draw_text(0, 128, self.width - 40, 32,
          "Power: " + $game_fish.fish_resist[@fish].to_s + " fpwr.")
        self.contents.draw_text(0, 160, self.width - 40, 32,
          "Congratulations. Total points: #{$game_fish.points}", 1)
      end
      $game_fish.total_points += @points
    elsif $game_fish.phase == 1
      self.contents.draw_text(0, 90, self.width - 40, 32,
        "The fish got away!", 1)
      if SC::LOSE_BAIT == true
        self.contents.draw_text(0, 64, self.width - 40, 32,
          "You lost your bait...")
          $game_party.lose_item($game_fish.equipped_bait, 1)
      end
    elsif $game_fish.phase == -1 and @fish == 0
      self.contents.draw_text(0, 90, self.width - 40, 32,
        "No equipment!", 1)
    end
  end
end

#==============================================================================
# ** Window_FishGear
#--------------------------------------------------------------------------
# Okay now, this is the stuff where you equip your fishing rod and bait to use.
# Rods must have a element called "Rod" and baits must have element called "Bait".
# You can make them in the item database. Anywhere you want as this script
# will only search for elements that are "Rod" and/or "Bait".
#==============================================================================

class Window_FishGear < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(type = 0)
    super(0, 64, 320, 416)
    @column_max = 1
    @type = nil
    @type = type
    refresh
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # * Item
  #--------------------------------------------------------------------------
  def item
    return @data[self.index]
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
       self.contents.dispose
       self.contents = nil
    end
    @data = []
    if @type == 1
      for i in 1...$data_items.size
        if $data_items.element_set.include?($data_system.elements.index("Rod"))
          if $game_party.item_number(i) > 0
            @data.push($data_items)
          end
        end
      end
    elsif @type == 2
      for i in 1...$data_items.size
        if $data_items.element_set.include?($data_system.elements.index("Bait"))
          if $game_party.item_number(i) > 0
            @data.push($data_items)
          end
        end
      end
    elsif @type == 0
      return
    end
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    case item
    when RPG::Item
       number = $game_party.item_number(item.id)
    end
    self.contents.font.color = normal_color
    x = 4
    y = index * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(item.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
    self.contents.draw_text(x + 234, y, 16, 32, "x", 1)
    self.contents.draw_text(x + 248, y, 24, 32, number.to_s, 2)
  end
  #--------------------------------------------------------------------------
  # * Update Help
  #--------------------------------------------------------------------------
  def update_help
    if @type == 1
       @help_window.set_text(self.item == nil ?
         "Rod: No Info" : "Rod: #{self.item.description}")
    elsif @type == 2
       @help_window.set_text(self.item == nil ?
         "Bait: No Info" : "Bait: #{self.item.description}")
    elsif @type == 0
       @help_window.set_text(
         "Welcome to the equip scene for your fishing gear.")
    end
  end
end

#==============================================================================
# ** Window_FishStatus
#==============================================================================

class Window_FishStatus < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(320, 64, 320, 416)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.draw_text(0, 0, self.width - 40, 32, "Equipment", 1)
    if $game_fish.equipped_rod == nil or $game_fish.equipped_rod == 0
       self.contents.draw_text(4, 64, self.width - 40, 32,
         "No fishing pool is equipped!")
    else
       self.contents.draw_text(4, 64, self.width - 40, 32,
         "Rod: " + $data_items[$game_fish.equipped_rod].name.to_s)
    end
    if $game_fish.equipped_bait == nil or $game_fish.equipped_bait == 0
       self.contents.draw_text(4, 128, self.width - 40, 32,
         "No fish bait is equipped!")
    else
       self.contents.draw_text(4, 128, self.width - 40, 32,
         "Bait: " + $data_items[$game_fish.equipped_bait].name.to_s)
    end
    self.contents.draw_text(4, 196, self.width - 40, 32,
      "Press A to equip rods")
    self.contents.draw_text(4, 228, self.width - 40, 32,
      "Press S to equip bait")
    self.contents.draw_text(4, 260, self.width - 40, 32,
      "Press D to de-equip active")
  end
end

#==============================================================================
# ** Window_FishList
#==============================================================================

class Window_FishList < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 64, 320, 416)
    @column_max = 1
    refresh
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # * Item
  #--------------------------------------------------------------------------
  def item
    return @data[self.index]
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    for i in 0...$game_fish.net_fish_ids.size
      @data.push($data_items[i.id])
    end
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    case item
    when RPG::Item
      number = $game_party.item_number(item.id)
      self.contents.font.color = normal_color
    end
    x = 4
    y = index * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(item.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  end
  #--------------------------------------------------------------------------
  # * Update Help
  #--------------------------------------------------------------------------
  def update_help
    @help_window.set_text(self.item == nil ? "" : self.item.description)
  end
end

#==============================================================================
# ** Window_FishDetail
#==============================================================================

class Window_FishDetail < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(320, 64, 320, 416)
    self.contents = Bitmap.new(width - 32, height - 32)
  end
  #--------------------------------------------------------------------------
  # * Update Help
  #--------------------------------------------------------------------------
  def show_detail(fish)
    if @fish != $data_items[fish]
      self.contents.clear
      @fish = $data_items[fish]
      self.contents.draw_text(0, 16, self.width - 40, 32, "Information", 1)
      self.contents.draw_text(0, 96, self.width - 40, 32, "Size: " + $game_fish.fish_size[@fish.id].to_s)
      self.contents.draw_text(0, 128, self.width - 40, 32, "Weight: " + $game_fish.fish_weight[@fish.id].to_s)
      self.contents.draw_text(0, 160, self.width - 40, 32, "Strength: " + $game_fish.fish_resist[@fish.id].to_s)
      self.contents.draw_text(0, 232, self.width - 40, 32, "Cancel to go to map.", 1)
   end
  end
end

#==============================================================================
# ** Scene_FishFight
#==============================================================================

class Scene_FishFight
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    if $game_fish.equipped_rod == nil or $game_fish.equipped_rod == 0
       $game_fish.phase = -1
       @catch = Window_Fish.new(0)
       @catch.x = 320 - @catch.width / 2
       @catch.y = 240 - @catch.height / 2
       @catch.z = 9999
       @block = true
    end
    @spriteset_map = Spriteset_Map.new
    unless @block == true
      if $data_items[$game_fish.equipped_rod].name.include?("Net")
        starting = $game_fish.get_net_range[0] + $game_fish.get_net_range[1]
        $game_fish.meter_fish = starting / 2
        @timer = 0
        @resist = 0
        $game_fish.pick_net_fish
        for i in 0...$game_fish.net_fish_ids.size
          @resist += $game_fish.fish_resist[$game_fish.net_fish_ids] / SC::FISH_SPEED
        end
        @startingsec = Graphics.frame_count / Graphics.frame_rate
      else
        $game_fish.pick_fish
      end
      @bar = Window_Versus.new
      @bar.z = 9999
      @catch = Window_Fish.new($game_fish.active_fish_id)
      @catch.x = 320 - @catch.width / 2
      @catch.y = 240 - @catch.height / 2
      @catch.z = 9999
      @catch.active = false
      @catch.visible = false
      @str = 0
      @stop = false
    end
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @spriteset_map.dispose
    unless @block == true
       @bar.dispose
    end
    @catch.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    @spriteset_map.update
    unless @block == true
      @bar.update
      @bar.refresh
    end
    @catch.update
    if @catch.active
      update_catch
      return
    end
    if Input.trigger?(Input::B) # cancel, loses bait
      $game_system.se_play($data_system.cancel_se)
      $game_fish.meter_player = 0
      $game_fish.meter_fish = 0
      $game_party.lose_item($game_fish.equipped_bait, 1)
      $scene = Scene_Map.new
    end
    inc = $data_items[$game_fish.equipped_rod].name
    if Input.trigger?(Input::C) and @stop != true # tab this!
      if inc.include?("Harpoon") == false and inc.include?("Net") == false
        $game_fish.meter_player += $game_fish.get_rod_power
      elsif inc.include?("Harpoon")
        rangemin = $game_fish.get_harpoon_range[0]
        rangemax = $game_fish.get_harpoon_range[1]
        if $game_fish.meter_fish > rangemin and $game_fish.meter_fish < rangemax
          @stop = true
          if SC::KEEP_FISH == true
            $game_party.gain_item($game_fish.active_fish_id, 1)
          end
          $game_fish.phase = 0
          @catch.refresh
          @catch.active = true
          @catch.visible = true
        else
          @stop = true
          $game_fish.phase = 1
          @catch.refresh
          @catch.active = true
          @catch.visible = true
        end
      elsif inc.include?("Net")
         # Nothing
      end
    end
    if inc.include?("Net")
      @currentsec = Graphics.frame_count / Graphics.frame_rate
      @secdiff = @currentsec - @startingsec
      if @secdiff >= $game_fish.get_net_time
        @stop = true
        if SC::KEEP_FISH == true
          for i in 0...$game_fish.net_fish_ids.size
            $game_party.gain_item($game_fish.net_fish_ids, 1)
          end
        end
        $game_fish.phase = 0
        @catch.refresh
        @catch.active = true
        @catch.visible = true
      end
      if $game_fish.get_net_range[0] > $game_fish.meter_fish or $game_fish.get_net_range[1] < $game_fish.meter_fish
        @stop = true
        $game_fish.phase = 1
        @catch.refresh
        @catch.active = true
        @catch.visible = true
      end
    end
    if Input.trigger?(Input::X) and inc.include?("Net")
      $game_fish.meter_fish -= $game_fish.get_net_power
    elsif Input.trigger?(Input::Y) and inc.include?("Net")
      $game_fish.meter_fish += $game_fish.get_net_power
    end
    unless @block == true
      update_fish
      if $game_fish.meter_player >= 100
        $game_fish.meter_player = 100
        @stop = true
        if SC::KEEP_FISH == true
          $game_party.gain_item($game_fish.active_fish_id, 1)
        end
        $game_fish.phase = 0
        @catch.refresh
        @catch.active = true
        @catch.visible = true
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Update Fish
  #--------------------------------------------------------------------------
  def update_fish
    inc = $data_items[$game_fish.equipped_rod].name
    if inc.include?("Net") == false and inc.include?("Harpoon") == false
      if @str >= $game_fish.fish_life[$game_fish.active_fish_id] and $game_fish.meter_player < 100
        $game_fish.meter_fish = 100
        @stop = true
        $game_fish.phase = 1
        @catch.refresh
        @catch.active = true
        @catch.visible = true
      elsif @stop == true
         #
      elsif @str <= $game_fish.fish_life[$game_fish.active_fish_id]
        @add = $game_fish.fish_resist[$game_fish.active_fish_id] / SC::FISH_SPEED
        @str += @add
        $game_fish.meter_fish += @add
      end
    elsif inc.include?("Harpoon")
      if @str >= 100
        @str = 0
        $game_fish.meter_fish = 0
      end
      @add = $game_fish.fish_resist[$game_fish.active_fish_id] * 5 / SC::FISH_SPEED
      @str += @add
      $game_fish.meter_fish += @add
    elsif inc.include?("Net")
      @timer += 1
      if @timer > 3
        @timer = 0
      end
      if @stop == true
        #
      elsif @timer == 3
        phase = rand(7)
        case phase
        when 0
          unless $game_fish.meter_fish > 100
            $game_fish.meter_fish += @resist + 1
          else
            $game_fish.meter_fish -= @resist + 1
          end
        when 1
          unless $game_fish.meter_fish > 100
            $game_fish.meter_fish += @resist - 1
          else
            $game_fish.meter_fish -= @resist - 1
          end
        when 2
          unless $game_fish.meter_fish > 100
            $game_fish.meter_fish += @resist
          else
            $game_fish.meter_fish -= @resist
          end
        when 3
          unless $game_fish.meter_fish > 100
            $game_fish.meter_fish += @resist / 2
          else
            $game_fish.meter_fish -= @resist / 2
          end
        when 4
          unless $game_fish.meter_fish < 0
            $game_fish.meter_fish -= @resist + 1
          else
            $game_fish.meter_fish += @resist + 1
          end
        when 5
          unless $game_fish.meter_fish < 0
            $game_fish.meter_fish -= @resist - 1
          else
            $game_fish.meter_fish += @resist - 1
          end
        when 6
          unless $game_fish.meter_fish < 0
            $game_fish.meter_fish -= @resist
          else
            $game_fish.meter_fish += @resist
          end
        when 7
          unless $game_fish.meter_fish < 0
            $game_fish.meter_fish -= @resist / 2
          else
            $game_fish.meter_fish += @resist / 2
          end
        end
        if $game_fish.meter_fish < 0
          $game_fish.meter_fish = 1
        elsif $game_fish.meter_fish > 100
          $game_fish.meter_fish = 99
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Update Catch
  #--------------------------------------------------------------------------
  def update_catch
    unless $data_items[$game_fish.equipped_rod].nil?
      inc = $data_items[$game_fish.equipped_rod].name
    end
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $game_fish.phase = 1
      $game_fish.meter_player = 0
      $game_fish.meter_fish = 0
      @str = 0
      $scene = Scene_Map.new
    elsif Input.trigger?(Input::X) and inc.include?("Net")
      for id in 0...$game_fish.net_fish_ids.size
        $game_party.gain_item($data_items[id].id, 1)
      end
      $game_system.se_play($data_system.decision_se)
      $scene = Scene_FishResult.new
    end
  end
end

#==============================================================================
# ** Scene_FishEquip
#==============================================================================

class Scene_FishEquip
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    @help_window = Window_Help.new
    @gear = Window_FishGear.new(0)
    @gear.index = -1
    @gear.help_window = @help_window
    @status = Window_FishStatus.new
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @help_window.dispose
    @gear.dispose
    @status.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    @help_window.update
    @gear.update
    @status.update
    if @gear.active
      update_gear
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update : Gear
  #--------------------------------------------------------------------------
  def update_gear
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Map.new
      return
    elsif Input.trigger?(Input::X)
      if @phase == 2 or @phase == nil
        @phase = 1
        @gear.dispose
        @gear = Window_FishGear.new(1)
        @gear.help_window = @help_window
        @gear.active = true
        @help_window.update
      end
      return
    elsif Input.trigger?(Input::Y)
      if @phase == 1 or @phase == nil
        @phase = 2
        @gear.dispose
        @gear = Window_FishGear.new(2)
        @gear.help_window = @help_window
        @gear.active = true
        @help_window.update
      end
      return
    elsif Input.trigger?(Input::C) and @gear.index != nil
      if @phase == 1
        @gear.refresh
        $game_system.se_play($data_system.equip_se)
        $game_fish.equipped_rod = @gear.item.id
        unless $game_fish.equipped_rod == nil or $game_fish.equipped_rod == 0
          inc = $data_items[$game_fish.equipped_rod].name
          if inc.include?("Harpoon") or inc.include?("Net")
            $game_fish.equipped_bait = 0
          end
        end
        @status.refresh
      elsif @phase == 2
        @gear.refresh
        unless $game_fish.equipped_rod == nil or $game_fish.equipped_rod == 0
          inc = $data_items[$game_fish.equipped_rod].name
          unless inc.include?("Harpoon") or inc.include?("Net")
            $game_system.se_play($data_system.equip_se)
            $game_fish.equipped_bait = @gear.item.id
          end
        end
        @status.refresh
      end
    elsif Input.trigger?(Input::Z)
      $game_system.se_play($data_system.equip_se)
      if @phase == 1
        $game_fish.equipped_rod = 0
        @status.refresh
      elsif @phase == 2
        $game_fish.equipped_bait = 0
        @status.refresh
      else
        return
      end
    end
  end
end

#==============================================================================
# ** Scene_FishResult
#==============================================================================

class Scene_FishResult
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    @help_window = Window_Help.new
    @command_window = Window_FishList.new
    @command_window.help_window = @help_window
    @info_window = Window_FishDetail.new
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @help_window.dispose
    @command_window.dispose
    @info_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    @help_window.update
    @command_window.update
    @info_window.update
    if @command_window.active
      update_command
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Command
  #--------------------------------------------------------------------------
  def update_command
    @info_window.show_detail(@command_window.item.id)
    if Input.trigger?(Input::B) or Input.trigger?(Input::C)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Map.new
      return
    end
  end
end
 
#==============================================================================
# ** Scene_Title
#==============================================================================

class Scene_Title
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias gs_fish_scntitle_cng command_new_game
  #--------------------------------------------------------------------------
  # * Command : New Game
  #--------------------------------------------------------------------------
  def command_new_game
    gs_fish_scntitle_cng
    $game_fish = Game_Fish.new
  end
end

#==============================================================================
# ** Scene_Save
#==============================================================================

class Scene_Save < Scene_File
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias gs_fish_scnsave_wd write_data
  #--------------------------------------------------------------------------
  # * Write Data
  #--------------------------------------------------------------------------
  def write_data(file)
    gs_fish_scnsave_wd(file)
    Marshal.dump($game_fish, file)
  end
end

#==============================================================================
# ** Scene_Load
#==============================================================================

class Scene_Load < Scene_File
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias gs_fish_scnload_rd read_data
  #--------------------------------------------------------------------------
  # * Read Data
  #--------------------------------------------------------------------------
  def read_data(filename)
    gs_fish_scnload_rd(filename)
    $game_fish = Marshal.load(filename)
  end
end

#------------------------------------------------------------------------------
# * End SDK Enable Test
#------------------------------------------------------------------------------
end
 
What? This is stupid. If people want scripts they search the forum or use the script listing (do they even still work i dunno) or even request it. Reported for a removal.
 
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