/*
* ============================================================================
* What it Does:
* ============================================================================
*
* PHX Mod Plugin For LeTBS to add features and fixes for LeTBS
* Place Under all other LeTBS plugins in your plugin manager
*
*
* makes changes to getObjectSequenceData, makeScope, and adds support for YEP_WeaponUnleash
*
*
*
*
* ============================================================================
* getObjectSequenceData:
* ============================================================================
*
* This allows the use of e.function() in sequence calls, as well as handle functions with parameters
* This allows you to create skills that rely on a function to return which sequence should run.
* Example:
*
* sequence: e.vorpal();
* In my code, e.vorpal is a TBSEntity.prototype.vorpal = function () {} type function
* and checks a rate of 10% 3 times, and increases the number of hits for each success.
* this function returns "vorpal2" (the default) if none of the checks pass, and vorpal3, vorpal4 or vorpal5 based
* on how many "hits" the skill should make.
*
*
* ============================================================================
* makeScope:
* ============================================================================
*
* The changes made here are very simple.
* With these changes, LeTBS now handles support for calling functions like
* e.customSquare() and e.customSquare(param,goes,here) inside the scope.
* That return strings for scope size, so you can do things like:
* scope: square(e.customSquare())
* where e.customSquare is a TBSEntity function such as
*
* TBSEntity.prototype.customSquare = function () {
* if(this.getMovePoints()>2)
* {return 5;}
* else
* {return 3;}
* };
* This function returns 5 if the user's movement Points is greater than 2, otherwise it returns 3.
* This is just an example, but this shows that you can now, with my code, adjust scopes with functions
* based on states, or variables, etc.
* you could even use things like this.battler() to call the actual battler, then use
* this.battler().isStateAffected(id)
* this would allow you to adjust scope if the user is affected with a state.
*
* ============================================================================
* weaponUnleash:
* ============================================================================
*
* Requires Yanfly's YEP_WeaponUnleash.js plugin to work. comment it out if you do not want to use
*
* Function is called as a sequence like so:
*
* sequence: e.weaponUnleash("atk", true)
*
* This function takes in 2 parameters seq, and isWeapon.
*
* seq: this is the default sequence that should be used if weapon unleash fails
*
* isWeapon: this boolean is used to separate weapon-unleashes from guard-unleashes. If this is true,
* the unleash code checks for weapon unleash, if false, it checks guard unleash.
*
* How to Use:
*
* Weapon Notetag: normal Yanfly Weapon Unleash Tag
* <Weapon Unleash 100%: 1911>
* <Weapon Unleash chance: skillId>
*
*
* Skill Notetag: use the regular sequence: sequenceId line in <LeTBS></LeTBS> like you would normally
* "atk" is to be replaced by the sequence that should play normally, leave true for weapon skills and make it false for * * guard skills
* sequence: e.weaponUnleash("atk", true)
* sequence: e.weaponUnleash("dagger_attack", true)
*
* Setting Up "Unleash Skills"
*
* Weapon Unleashes this way end up using the new skill's sequence and the current one's damage formula
* This can be Problematic for some users, so creating a skill to handle the "Unleash" as an interim works best
*
* For Example: My Dragon Dagger can unleash "Accel Rave" which slashes the enemy 12 times. This skill however is
* skill 105, and I do not want to use the base dagger attack formula.
* Therefore, my Dragon Dagger instead unleashes skill 1911 - "Dagger Unleash"
*
* Dagger Unleash is set up like a regular skill, but no damage formula and it calls the sequence "dagger_unleash"
* via sequence: dagger_unleash
*
* dagger_unleash sequence is very simple, as all it does is force the user to use a different skill.
* by doing this, the user of the dragon dagger's unleash uses the forced skill's damage formula and sequence,
* thereby effectively Unleashing the Power of the Weapon
*
* Unleash Sequence:
* "dagger_unleash": [
* "use_skill: user, 105",
* ],
* All this does is force the user to use skill 105, which is my skill ID for Accel Rave.
*
* This may all seem unnecessarily complex, but Yanfly's Weapon Unleash, as is, is incompatible, but by modifying how
* LeTBS handles functions as sequences, we can do amazing things.
*
*
*
* ============================================================================
* Other Fixes:
* ============================================================================
*
*
* ===========
* Positioning
* ===========
* Added support for variable-based actor cells
* <Var Cell: x> / <Var Cell: 5>
* Loads the value stored in Variable x, and loads that actor. Useful for Battles where you "split"
* the party.
*
* Added support for switch-based actor cells
* <Switch Cell: x>
* Loads Switch x, and if it is on, pulls that actor in.
* Good for Permadeath and merc recruiting where you don't want mercenaries in the party, but want them
* in battle.
*
* Added support for leader-based actor cells (Party Leader auto-positioning
* <Leader Cell
* Loads the Party leader into the cell.
*
* Added support for neutral positioning cells that can be used by enemies or actors
* <Entity Cell>
* Denotes a "Neutral" cell, where an enemy or ally can begin. If left unoccupied by enemy positioning
* it allows the player to place a character there. Uses the Neutral Color Parameter
*
* Added custom color for neutral positioning
*
* Added logic to determine of all player entities are placed in the pre-positioning phase.
* If this is the case, the battle is immediately started, eliminating the need for the player
* to "Confirm" they are ready. Eliminates a bug where you could "Cancel" on a pre-placed unit.
* Causing the game to crash.
*
* Fixes issues when trying to use moveable events for positioning. Before it was using the Game Map event location,
* and not the actual event location.
* ===========
*
* Charmed
*
* Fixed "Charm" System.
* Lecode used isAlly and isEnemy to determine which side the enemy/
* target was on, rather than using isAlly to determine if the target
* was an actual Ally of the user.
*
* This resulted in crazy situations where the ally and enemy arrays
* for a confused user were identical, resulting in the AI getting confused.
* Any confused AI will continue to beat up their own allies, until the
* confusion wears off, the user dies, or all their allies are dead.
*
* In these cases, the user will then proceed to attack the actual enemy.
* I believe that if the confused enemy has healing skills, he will heal
* and/or resurrect their teammates. This can cause even more hilarious
* situations where an enemy kills/revives/kills again their teammates.
*
*
*
* //Scopes
* Added support for "exclude_free_cells" in the AOE. previously
* this boolean did exist, but there was never a function to filter
* out cells without an entity in it. This also greatly reduces lag
*
* Added support for Scope_Select if Actor is afflicted with a specific State
* scope_select: AstateId stateID
*
* Added support for Scope_Select if Enemy Unit is afflicted with a specific State*
* scope_select: EstateId stateID
*
* Added support for Scope_Select if A Team Member is afflicted with a specific State*
* scope_select: AllystateId stateID
*
* Added support for Scope_Select if An Enemy Team Member (enemies if player, player if enemies)*
* is afflicted with a specific State*
* scope_select: EnemystateId stateID
*
* Added support for Scope_Select if An Enemy Team Member (enemies if player, player if enemies)*
* is afflicted with a specific State*
* scope_select: StateId stateID
*
* Added support for Scope_Select if Actor Knows a specific Skill*
* scope_select: AskillId skillID
*
* Added support for Scope_Select if Enemy Knows a specific Skill*
* scope_select: EskillId skillID
*
*
* //Distance
* Added Support to keep track of distance between user and target. This allows you to create
* skills that get stronger/weaker the further/closer you are.
* When using advanced damage formulas, use a._cellDistance to pull in the distance between the
* user of the skill, and the targeted cell.
*/