# Persona 5 EX

This library includes all the functions already found in [Persona 5](https://docs.shrinefox.com/flowscript/library-functions/persona-5).\
However, you must be using the [P5EX library downloaded from here](https://github.com/DeathChaos25/p5_library_ex) with AtlusScriptCompiler to compile scripts that use the following functions. This will also make your mod require P5EX as a dependency, since the vanilla game won't recognize these functions and will probably crash.

* void SET\_HUMAN\_LV( int lv ) -- Restored Game function, sets Joker's level to the specified level, range 1 -> 99
* void SET\_PERSONA\_LV( int PlayerID, int targetLv, int unused ) -- Restored Game function, can only be used to raise party member levels, not lower, only updates unit stats and level, not skills (note: does not work on Joker)
* EX\_PRINTF( variable args ) -- printf implementation in flowscript
* int GET\_EQUIPPED\_PERSONA( int playerID ) -- Returns the currently equipped persona ID of the specified player character, range 1 to 10
* int GET\_ENCOUNTER\_ID( void ) -- Returns the encounter ID of the current encounter the function is used on.
* void PERSONA\_EVOLUTION2( int playerID, int personaID ) -- Enhanced game function, now allows setting a target Persona to evolve to.
* void AI\_ACT\_PERSONA\_SKILL( int personaID, int battleSkillID ) -- sets target persona for enemy AI to use on certain encounters ( requires additional custom patches ) .
* int GET\_SEQ\_ID( void ) -- returns the current sequence ID the game is runnning on
* int GET\_LEARNABLE\_SKILL( int PartyMember, int SkillSlotID, int targetLv ) -- returns the skill ID on the given slot from a party member's PERSONA tbl entry, will return a skill ID if the skill is higher than the party member's current level but lower/same level as the target level (note: Joker excluded for obvious reasons)
* int GET\_PLAYER\_LV ( int PartyMember ) -- returns a party member's current level
* void SET\_TACTICS\_STATE ( int PartyMember, int TacticsState ) -- sets a party member's tactics state (Joker included) to the target value
* void AI\_SET\_ENID\_TARGETABLE\_STATE( int enemyID, bool targetableState ) -- use from encounter script, toggles enemy's ability to be targetted by players
* void AI\_SET\_TARGETABLE\_STATE( bool targetableState ) -- use inside enemy BF script, toggles enemy's own ability to be targetted by players
* void AI\_ACT\_SUMMON\_UNITS( int EnemyID, int EnemyID, int EnemyID, int EnemyID, int customBED\_subID ) -- use inside enemy BF script, summons target amount of enemies, use id 0 to not summon an enemy on selected slot, use 0 to use normal summon visual effect (note: exceeding 5 total enemies in a battle will crash the game!)

Notes:

* GET\_LEARNABLE\_SKILL gets the learnset from the actual persona tbl section of party member personas, meaning this is NOT checking the learnset stored in the save, meaning its mod compatible, if you have a custom learnset it'll just work, this also means they can learn skills if you updated the skillset in the tbl but used an existing save that has old learnset
