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.

Questions about the Advanced Fishing System by GoldenShadow

Ok I came across this script but I can't find anything that tells of what you need for it and how to use it. Anyone wanna help shine some light on this for me?

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

Thanks in advance.
 
Massive necropost and very silly question Ebonhold, you can't just comment out lines and not expect further errors. Thats not really how programming works. I'm sure a mod will come and lock this topic, by all means post your problem on the board and see what help you can get but not in an old topic like this.
 

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