Class CreatureInfo

java.lang.Object
games.stendhal.server.maps.semos.plains.CreatureInfo

public class CreatureInfo extends Object
  • Constructor Details

    • CreatureInfo

      public CreatureInfo(Map<Double,​String> probabilityLiterals, Map<Integer,​String> amountLiterals, Map<Double,​String> dangerLiterals, String[] lineStartTexts, String[] respawnTexts, String[] carryTexts, String[] carryNothingTexts, String[] locationTexts, String[] locationUnknownTexts)
      Create an instance of creatureInfo.
      Parameters:
      probabilityLiterals - templates for probabilities. %s is replaced with item description (name and amount)
      amountLiterals - templates for item amounts. %s is replaced with singular item name, %a with "a/an item name" depending on the item name
      dangerLiterals - templates for how dangerous a creature is based on the percentual difference to player level. %s is replaced with singular creature name, %S with plural
      lineStartTexts - templates for line starts. %s is replaced with singular creature name, %S plural
      respawnTexts - templates for respawn texts. %1 = time to respawn.
      carryTexts - templates for drops. %1 = list of items dropped.
      carryNothingTexts - templates for no drops.
      locationTexts - templates for creature locations. %1 = list of locations
      locationUnknownTexts - templates for unknown location. %1 = name of the creature
  • Method Details

    • getCreatureInfo

      public String getCreatureInfo(Player player, DefaultCreature creature, int maxLocations, int maxDrops, boolean respawn)
      get information on a creature.
      Parameters:
      player -
      creature -
      maxLocations - max number of locations listed
      maxDrops -
      respawn -
      Returns:
      string containing creature information
    • getCreatureZoneCounts

      public Map<String,​Integer> getCreatureZoneCounts(String creatureName)
      get the count of specified creature for all zones.
      Parameters:
      creatureName -
      Returns:
      map of zonenames with creature counts
    • getCreatureBasicInfo

      public String getCreatureBasicInfo(Player player, DefaultCreature creature)
      Get basic information of the creature: initial string + how dangerous the creature is.
      Parameters:
      player -
      creature -
      Returns:
      basic information about the creature.
    • getHowDangerous

      public String getHowDangerous(Player player, DefaultCreature creature, Map<Double,​String> dangerLiterals)
      Get verbal presentation of how dangerous the creature is to the player.
      Parameters:
      player -
      creature -
      dangerLiterals - lookup table (map) for texts: formula for key value is creature level / player level. Text replacements: %s is replaced with creature name; %S is replaced with plural creature name.
      Returns:
      verbal presentation of how dangerous the creature is to player.