DoubleX_RMMZ_Confusion_Edit

Purpose
Lets you set some confusion states to not be restricted to attacks only

Introduction
Code:
*      1. The default RMMZ confusion causes the battler to only use attack
*         and nothing else
*      2. This plugin lets you set some confusion states to cause the
*         battlers to behave like autobattle ones, with the definitions of
*         friends and opponents being reversed

Video


Games using this plugin
None so far

Spoiler: Todo
Code:
 *      1. Makes the reverse notetag works with substitute as well

Spoiler: Notetags
Code:
*    ## Notetag Info
*       1. Among all the same notetag types in the same data, only the 1st
*          one can be effective
*       2. Each line can only have at most 1 notetag
*       3. The following is the structure of all notetags in this plugin:
*          - <doublex rmmz confusion edit contents>
*          - <confusion edit contents>
*          Where contents are in the form of type suffixes: entries
*          Either of the above can be used, but the 1st one reduce the chance
*          of causing other plugins to treat the notetags of this plugin as
*          theirs, while the 2nd one is more user-friendly
*          - type is one of the following:
*            1. reverse
*            2. excludeSelf
*            (Search tag: NOTE_TYPE)
*          - suffixes is the list of suffixes in the form of:
*            suffix1 suffix2 suffix3 ... suffixn
*            Where each suffix is either of the following:
*            val(The notetag value will be used as-is)
*            switch(The value of the game switch with id as the notetag value
*                   will be used)
*            var(The value of the game variable with id as the notetag value
*                will be used)
*            (Advanced)script(The value of the game variable with id as the
*                            notetag value will be used as the contents of
*                            the functions to be called upon using the
*                            notetag)
*          - The this pointer of the script suffix is the action involved
*            (Game_Action.prototype)
*          - entries is the list of entries in the form of:
*            entry1, entry2, entry3, ..., entryn
*            Where entryi must conform with the suffixi specifications
*----------------------------------------------------------------------------
*    # State Notetags
*      1. reverse condSuffix: condEntry
*         - Reverses the definitions of friends and opponents instead of
*           using the default confusion behaviors when condEntry returns a
*           truthy result
*         - condSuffix can be val, switch or script
*         - The result of condEntry can be anything as only whether it's
*           truthy matters
*         - Reversal will never take place for state Restriction as Attack an
*           Enemy nor skill/item scope as The User
*         - Reversal will have 50% chance to take place for state Restriction
*           as Attack Anyone
*         - Reversal will always take place for state Restriction as Attack
*           an Ally
*         - E.g.:
*           <confusion edit reverse switch: 1> will reverse the definitions
*           of friends and opponents if the game switch with id 1 is on
*      2. excludeSelf condSuffix: condEntry
*         - Ensures the battler won't target self when condEntry returns a
*           truthy result and the actions aren't forced
*         - This only applies to skills/items with Number as One in Scope
*         - This won't apply if self is the only possible target
*         - condSuffix can be val, switch or script
*         - The result of condEntry can be anything as only whether it's
*           truthy matters
*         - E.g.:
*           <confusion edit excludeSelf val: true> will always ensure the
*           battler won't target self when the actions aren't forced

Spoiler: Prerequisites
Plugins:
1. DoubleX RMMZ Enhanced Codebase
Abilities:
1. Nothing special for most ordinary cases
2. Little RMMZ plugin development proficiency to fully utilize this
(Elementary Javascript exposures being able to write beginner codes up to 300LoC scale)

Spoiler: Terms Of Use
Code:
*      1. Commercial use's always allowed and crediting me's always optional.
*      2. You shall keep this plugin's Plugin Info part's contents intact.
*      3. You shalln't claim that this plugin's written by anyone other than
*         DoubleX or my aliases. I always reserve the right to deny you from
*         using any of my plugins anymore if you've violated this.
*      4. If you repost this plugin directly(rather than just linking back),
*         you shall inform me of these direct repostings. I always reserve
*         the right to request you to edit those direct repostings.
*      5. CC BY 4.0, except those conflicting with any of the above, applies
*         to this plugin, unless you've my permissions not needing follow so.
*      6. I always reserve the right to deny you from using this plugin
*         anymore if you've violated any of the above.

Spoiler: Contributors
Code:
*      Authors:
*      1. DoubleX
*      Plugin Development Collaborators:
*      - None So Far
*      Bug Reporters:
*      - None So Far
*      Compatibility Issue Raisers:
*      - None So Far
*      Feature Requesters:
*      - None So Far

Spoiler: Changelog
Code:
*      { codebase: "1.0.2", plugin: "v1.00a" }(2020 Sep 27 GMT 1600):
*      1. 1st version of this plugin finished

Download Link
Demo Link

Original thread: https://forums.rpgmakerweb.com/threads/doublex_rmmz_confusion_edit.127953/