All Implemented Interfaces:
UseListener, Killer, Cloneable, Iterable<String>, Serializable

public class GoldSource extends PlayerActivityEntity
A gold source is a spot where a player can prospect for gold nuggets. He needs a gold pan, time, and luck. Prospecting takes 7-11 seconds; during this time, the player keep standing next to the gold source. In fact, the player only has to be there when the prospecting action has finished. Therefore, make sure that two gold sources are always at least 5 sec of walking away from each other, so that the player can't prospect for gold at several sites simultaneously. Some karma is used to decide if the player was successful at the well or not.
Author:
daniel
  • Constructor Details

    • GoldSource

      public GoldSource()
      Create a gold source.
    • GoldSource

      public GoldSource(String itemName)
      Create a gold source.
      Parameters:
      itemName - The name of the item to be prospected.
  • Method Details

    • getName

      public String getName()
      source name.
      Specified by:
      getName in interface Killer
      Overrides:
      getName in class Entity
      Returns:
      name
    • generateRPClass

      public static void generateRPClass()
    • getDuration

      protected int getDuration()
      Get the time it takes to perform this activity.
      Specified by:
      getDuration in class PlayerActivityEntity
      Returns:
      The time to perform the activity (in seconds).
    • isPrepared

      protected boolean isPrepared(Player player)
      Decides if the activity can be done.
      Specified by:
      isPrepared in class PlayerActivityEntity
      Parameters:
      player - for whom to perform the activity
      Returns:
      true if successful.
    • isSuccessful

      protected boolean isSuccessful(Player player)
      Decides if the activity was successful.
      Specified by:
      isSuccessful in class PlayerActivityEntity
      Parameters:
      player - for whom to perform the activity
      Returns:
      true if successful.
    • onFinished

      protected void onFinished(Player player, boolean successful)
      Called when the activity has finished.
      Specified by:
      onFinished in class PlayerActivityEntity
      Parameters:
      player - The player that did the activity.
      successful - If the activity was successful.
    • onStarted

      protected void onStarted(Player player)
      Called when the activity has started.
      Specified by:
      onStarted in class PlayerActivityEntity
      Parameters:
      player - The player starting the activity.