Difference between pages "Compiling from Source" and "Monster"

From Kolmafia
(Difference between pages)
Jump to navigation Jump to search
 
(→‎Related Functions: item_drops are now floats)
 
Line 1: Line 1:
=== GREAT BIG NEWS ===
+
{{DISPLAYTITLE:monster}}
  
==KoLmafia has migrated to the GitHub, GIT and gradle.==
+
{{TOCright}}
The Windows, Linux and macOS instructions have been updated, and might have been lightly tested
 
  
The good news is that the IDE setup is a lot easier.  The bad news is you'll need to take some steps to build anything.  In addition, we are discussing changing to a newer required JDK, so even these instructions will not be permanent.
+
This data type represents any monster you can encounter in KoL.
  
To contribute to the Mafia project, you'll need to be able to install the Java Development Kit, connect to the git repository, and be comfortable writing Java Code. Instructions for the first two are included below:
+
The full range, besides $monster[ none ], is too much to list and keep
 +
up with here: please see the Wiki {{kolwiki|Monster Compendium}} page for
 +
more information.
  
==Windows==
+
==Related Functions==
# Download Tools
 
## Download and install Java Development Kit 11 or newer, available from [https://adoptium.net/installation.html Adoption].  The current recommended version is Java 17.
 
## Download and install GIT following the instructions from [https://www.atlassian.com/git/tutorials/install-git#windows Atlassian's GIT install page.]
 
## Download and install Tortoise GIT (if needed) from https://tortoisegit.org
 
# Configure Windows Environment Variables[[File:Environment vars.jpg|thumb|Win 10 Environment Variable Editor]]
 
## Windows 10
 
### Go to settings
 
### type 'enviro' in the search
 
### click on the 'edit environment variables' suggestion
 
### add or edit JAVA_HOME, and PATH variables<br>''PATH should include JAVA_HOME''</br>If the JAVA installer has already set these variables, they can be updated or left alone.
 
# Open a new Command Prompt (or Powershell) window and navigate to the directory to which you wish to create kolmafia (e.g. <code>cd %USERPROFILE%\projects</code>, or some similar directory)
 
# Clone the source code for the KoLmafia Project.<br>
 
##''If you have a github account:''<syntaxhighlight lang="bash">
 
git clone git@github.com:kolmafia/kolmafia.git</syntaxhighlight>
 
##''If not:''<syntaxhighlight lang="bash">git clone https://github.com/kolmafia/kolmafia.git</syntaxhighlight>
 
# Compile KoLmafia with the Gradle wrapper ''<syntaxhighlight lang="bash">cd kolmafia && gradlew.bat runShadow</syntaxhighlight>''
 
  
=== Optional ===
+
{{Flink|float [monster]|appearance_rates|location|{{opt|boolean}}}}
If you intend to commit code to GitHub, you will need to follow GitHub's instructions for [https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token adding a Personal Access Token (PAT)]
+
{{Flink|boolean|can_faxbot|monster}}
==Linux==
+
{{Flink|float|elemental_resistance|{{opt|monster}}}}
 +
{{Flink|int|expected_damage|{{opt|monster}}}}
 +
{{Flink|boolean|faxbot|monster}}
 +
{{Flink|monster [int]|get_monsters|location}}
 +
{{Flink|monster|image_to_monster|strict_string}}
 +
{{Flink|boolean|is_banished|monster}}
 +
{{Flink|float [item]|item_drops|{{opt|monster}}}}
 +
{{Flink|record [int]|item_drops_array|{{opt|monster}}}}
 +
{{flink|int|jump_chance|{{opt|monster}}|{{opt|int}}|{{opt|int}}}}
 +
{{Flink|monster|last_monster}}
 +
{{Flink|int|meat_drop|{{opt|monster}}}}
 +
{{Flink|int|monster_attack|{{opt|monster}}}}
 +
{{Flink|int|monster_defense|{{opt|monster}}}}
 +
{{Flink|element|monster_element|{{opt|monster}}}}
 +
{{Flink|float|monster_eval|string}}
 +
{{Flink|int|monster_hp|{{opt|monster}}}}
 +
{{Flink|int|monster_initiative|{{opt|monster}}}}
 +
{{Flink|int|monster_level_adjustment}}
 +
{{Flink|phylum|monster_phylum|{{opt|monster}}}}
 +
{{Flink|monster|to_monster|strict_string}}
  
Do once:
+
==Proxy Record Fields==
# Install git - you probably already have this. If not, follow [https://www.atlassian.com/git/tutorials/install-git#linux this guide.]
 
# Get an appropriate JDK. If your package manager does not contain a sufficiently up-to-date version of Java, the safest and easiest way to do this is with [https://adoptium.net/installation.html#x64_linux-jdk Adoptium].
 
# Clone the repo:
 
## If you have a github account:<syntaxhighlight lang="bash">
 
git clone git@github.com:kolmafia/kolmafia.git
 
</syntaxhighlight>If not:<pre>git clone https://github.com/kolmafia/kolmafia.git</pre>
 
  
Do every session:
+
Here are the proxy record fields for monstersProxy records are discussed in more
# Set up your environment to use that JDK you just downloaded<pre> export PATH="/where/you/put/that/jdk/bin:${PATH}"</pre> (Optionally, put this in your ''.profile'' or ''.bashrc'' if you want to set and forget.)
+
detail [[Proxy Records|here]].
# Navigate to your cloned repository: <pre>cd /where/you/cloned/kolmafia</pre>
 
# Get new updates with <pre>git pull</pre> If you have local uncommitted changes, you may want to instead use ''git stash && git pull && git stash pop''.
 
# Build the new jar: <pre>./gradlew clean shadowJar</pre>
 
  
You have a KoLmafia jar file that can be invoked with <pre>java -jar dist/KoLmafia-*.jar</pre>
+
{| cellpadding="3" cellspacing="0" border="1px" class="sortable"
 +
|- | style="background-color: #F2F2F2"
 +
|-
 +
! Field
 +
! Data type
 +
! Default value
 +
! ASH Accessor Function / Notes
 +
|-
 +
| id
 +
| int
 +
| 0
 +
|
 +
|-
 +
| base_hp
 +
| int
 +
| 0
 +
| {{f|monster_hp}} (includes modifiers)
 +
|-
 +
| base_attack
 +
| int
 +
| 0
 +
| {{f|monster_attack}} (includes modifiers)
 +
|-
 +
| base_defense
 +
| int
 +
| 0
 +
| {{f|monster_defense}} (includes modifiers)
 +
|-
 +
| raw_hp
 +
| int
 +
| 0
 +
| (excludes modifiers)
 +
|-
 +
| raw_attack
 +
| int
 +
| 0
 +
| (excludes modifiers)
 +
|-
 +
| raw_defense
 +
| int
 +
| 0
 +
| (excludes modifiers)
 +
|-
 +
| base_initiative
 +
| int
 +
| 0
 +
| {{f|monster_initiative}} (includes modifiers)
 +
|-
 +
| raw_initiative
 +
| int
 +
| 0
 +
| (excludes modifiers)
 +
|-
 +
| element attack_element
 +
| element
 +
| none
 +
|
 +
|-
 +
| element defense_element
 +
| element
 +
| none
 +
| {{f|monster_element}}
 +
|-
 +
| physical_resistance
 +
| int
 +
| 0
 +
|
 +
|-
 +
| min_meat
 +
| int
 +
| 0
 +
| (excludes modifiers)
 +
|-
 +
| max_meat
 +
| int
 +
| 0
 +
| (excludes modifiers)
 +
|-
 +
| base_mainstat_exp
 +
| foat
 +
| 0.0
 +
| (includes bonus stats from +ML, but not from +stat effects)
 +
|-
 +
| phylum
 +
| phylum
 +
| none
 +
| {{f|monster_phylum}}
 +
|-
 +
| poison
 +
| effect
 +
| none
 +
|
 +
|-
 +
| boss
 +
| boolean
 +
| false
 +
|
 +
|-
 +
| dummy
 +
| boolean
 +
| false
 +
|
 +
|-
 +
| image
 +
| string
 +
| ""
 +
|
 +
|-
 +
| images
 +
| aggregate boolean [string]
 +
|
 +
|
 +
|-
 +
| attributes
 +
| string
 +
| ""
 +
| A compilation of attack, defense, initiative, element, meat drop, and phylum
 +
|-
 +
| random_modifiers
 +
| aggregate boolean [string]
 +
|
 +
| The monster's random modifiers - like those generated in the One Crazy Random Summer path
 +
|-
 +
| manuel_name
 +
| string
 +
| ""
 +
|
 +
|}
  
Do other installation steps as you wish.
+
[[Category:Scripting]] [[Category:Data Types]]
 
 
==macOS==
 
# Verify required packages
 
## <code>''java --version''</code>
 
##* if not found or less than Java 11...  Install Java Development Kit version 17 from [https://adoptium.net Adoptium Temurin]
 
## <code>''git --version''</code>
 
##* If not found ...  Install git:  Atlassian has a great document on [https://www.atlassian.com/git/tutorials/install-git the various ways to install Git]
 
# Configure development environment<br>Most of these steps can be included in ''<code>.profile</code>'' or the equivalent for your shell of choice.
 
## In the terminal set JAVA_HOME to the java home directory. <br>''<code>/usr/libexec/java_home -V</code>'' will list all known values for java_home.<br>If you have multiple copies of java, choose the version you want to use''.'' <code>''export JAVA_HOME=`/usr/libexec/java_home -v17''</code>
 
# Open a new terminal window and navigate to the directory to which you wish to create kolmafia (e.g. <code>cd ~/projects</code>, or some similar directory)
 
# Clone the source code for the KoLmafia Project.<br>
 
##''If you have a github account:''<syntaxhighlight lang="bash">
 
git clone git@github.com:kolmafia/kolmafia.git</syntaxhighlight>
 
##''If not:''<syntaxhighlight lang="bash">git clone https://github.com/kolmafia/kolmafia.git</syntaxhighlight>
 
 
 
Do every session:
 
 
 
# Navigate to your cloned repository: <pre>cd ~/projects/kolmafia</pre>
 
# Get new updates with <pre>git pull</pre> If you have local uncommitted changes, you may want to instead use ''git stash && git pull && git stash pop''.
 
# Compile KoLmafia with the Gradle wrapper: ''<syntaxhighlight lang="bash">./gradlew runShadow</syntaxhighlight>''
 
 
 
=== Optional ===
 
If you intend to commit code to GitHub, you will need to follow GitHub's instructions for [https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token adding a Personal Access Token (PAT)]
 
''[[Category:Tech Support]]''
 

Latest revision as of 20:08, 26 December 2023


This data type represents any monster you can encounter in KoL.

The full range, besides $monster[ none ], is too much to list and keep up with here: please see the Wiki Monster Compendium page for more information.

Related Functions

float [monster] appearance_rates( location, [boolean] )

boolean can_faxbot( monster )

float elemental_resistance( [monster] )

int expected_damage( [monster] )

boolean faxbot( monster )

monster [int] get_monsters( location )

monster image_to_monster( strict_string )

boolean is_banished( monster )

float [item] item_drops( [monster] )

record [int] item_drops_array( [monster] )

int jump_chance( [monster], [int], [int] )

monster last_monster()

int meat_drop( [monster] )

int monster_attack( [monster] )

int monster_defense( [monster] )

element monster_element( [monster] )

float monster_eval( string )

int monster_hp( [monster] )

int monster_initiative( [monster] )

int monster_level_adjustment()

phylum monster_phylum( [monster] )

monster to_monster( strict_string )


Proxy Record Fields

Here are the proxy record fields for monsters. Proxy records are discussed in more detail here.

Field Data type Default value ASH Accessor Function / Notes
id int 0
base_hp int 0 monster_hp() (includes modifiers)
base_attack int 0 monster_attack() (includes modifiers)
base_defense int 0 monster_defense() (includes modifiers)
raw_hp int 0 (excludes modifiers)
raw_attack int 0 (excludes modifiers)
raw_defense int 0 (excludes modifiers)
base_initiative int 0 monster_initiative() (includes modifiers)
raw_initiative int 0 (excludes modifiers)
element attack_element element none
element defense_element element none monster_element()
physical_resistance int 0
min_meat int 0 (excludes modifiers)
max_meat int 0 (excludes modifiers)
base_mainstat_exp foat 0.0 (includes bonus stats from +ML, but not from +stat effects)
phylum phylum none monster_phylum()
poison effect none
boss boolean false
dummy boolean false
image string ""
images aggregate boolean [string]
attributes string "" A compilation of attack, defense, initiative, element, meat drop, and phylum
random_modifiers aggregate boolean [string] The monster's random modifiers - like those generated in the One Crazy Random Summer path
manuel_name string ""