Difference between revisions of "Jump chance"

From Kolmafia
Jump to navigation Jump to search
imported>Darzil
(Created page with "{{ #vardefine:name|jump_chance}}{{ #vardefine:return_type|int [item]}}{{ #vardefine:aggregate|yes}}{{ FunctionPage| name={{#var:name}}| function1={{Function| name={{#var:nam...")
 
imported>Malibu Stacey
m (fix wrong return type)
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{{
 
{{
 
#vardefine:name|jump_chance}}{{
 
#vardefine:name|jump_chance}}{{
#vardefine:return_type|int [item]}}{{
+
#vardefine:return_type|int}}{{
 
#vardefine:aggregate|yes}}{{
 
#vardefine:aggregate|yes}}{{
  
Line 41: Line 41:
 
}}|
 
}}|
  
function_description=Returns the chance of successfully getting the jump against the monster, optionally at a particular initiative value and monster level.|
+
function5={{Function|
 +
name={{#var:name}}|
 +
aggregate={{#var:aggregate}}|
 +
parameter1={{Param|location|l}}|
 +
return_type={{#var:return_type}}|
 +
return_also={{#var:return_also}}
 +
}}|
 +
 
 +
function6={{Function|
 +
name={{#var:name}}|
 +
aggregate={{#var:aggregate}}|
 +
parameter1={{Param|location|l}}|
 +
parameter2={{Param|int|i}}|
 +
return_type={{#var:return_type}}|
 +
return_also={{#var:return_also}}
 +
}}|
 +
 
 +
function7={{Function|
 +
name={{#var:name}}|
 +
aggregate={{#var:aggregate}}|
 +
parameter1={{Param|location|l}}|
 +
parameter2={{Param|int|i}}|
 +
parameter3={{Param|int|ml}}|
 +
return_type={{#var:return_type}}|
 +
return_also={{#var:return_also}}
 +
}}|
 +
 
 +
function_description=Returns the chance of successfully getting the jump against the monster or in the location, optionally at a particular initiative value and monster level.|
 +
 
 +
code1={{CodeSample|
 +
title=Code Samples|
 +
description=The following example is a function that tells you the jump chance against the various enemies at a given location.|
 +
code=
 +
<syntaxhighlight>
 +
void location_jump (location place) {
 +
  print(""+place+" has the following enemies that you might get the jump on:", "purple");
 +
  foreach mob, freq in appearance_rates(place) //Appearance rates is used to weed out bosses/one time specials/etc
 +
      if (freq > 0)
 +
        print("The jump chance you have against "+mob+" is "+jump_chance(mob)+".", "blue");
 +
     
 +
}
 +
location_jump($location[The Black Forest]);
 +
</syntaxhighlight>|
 +
moreinfo= For more information on jump opponents visit KoL Wiki's [http://kol.coldfront.net/thekolwiki/index.php/Talk:Combat_Initiative Combat Initiative]
 +
}}|
 +
 
 
}}
 
}}

Latest revision as of 05:19, 9 April 2020

Function Syntax

int jump_chance()

int jump_chance(monster m )

int jump_chance(monster m ,int i )

int jump_chance(monster m ,int i ,int ml )

int jump_chance(location l )

Returns the chance of successfully getting the jump against the monster or in the location, optionally at a particular initiative value and monster level.

Code Samples

The following example is a function that tells you the jump chance against the various enemies at a given location.

void location_jump (location place) {
   print(""+place+" has the following enemies that you might get the jump on:", "purple");
   foreach mob, freq in appearance_rates(place) //Appearance rates is used to weed out bosses/one time specials/etc
      if (freq > 0) 
         print("The jump chance you have against "+mob+" is "+jump_chance(mob)+".", "blue");
      
}
location_jump($location[The Black Forest]);

For more information on jump opponents visit KoL Wiki's Combat Initiative