Class CreatureInfo
java.lang.Object
games.stendhal.server.maps.semos.plains.CreatureInfo
-
Constructor Summary
ConstructorsConstructorDescriptionCreatureInfo(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. -
Method Summary
Modifier and TypeMethodDescriptiongetCreatureBasicInfo(Player player, DefaultCreature creature) Get basic information of the creature: initial string + how dangerous the creature is.getCreatureInfo(Player player, DefaultCreature creature, int maxLocations, int maxDrops, boolean respawn) get information on a creature.getCreatureZoneCounts(String creatureName) get the count of specified creature for all zones.getHowDangerous(Player player, DefaultCreature creature, Map<Double, String> dangerLiterals) Get verbal presentation of how dangerous the creature is to the player.
-
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 namedangerLiterals- templates for how dangerous a creature is based on the percentual difference to player level. %s is replaced with singular creature name, %S with plurallineStartTexts- templates for line starts. %s is replaced with singular creature name, %S pluralrespawnTexts- 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 locationslocationUnknownTexts- 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 listedmaxDrops-respawn-- Returns:
- string containing creature information
-
getCreatureZoneCounts
get the count of specified creature for all zones.- Parameters:
creatureName-- Returns:
- map of zonenames with creature counts
-
getCreatureBasicInfo
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.
-