An open library of RPG Maker MZ plugins, powered by the community.

PGMZ - The Community-Driven Plugin Library for RPG Maker MZ

MZ plugins

NRP Auto Heal - NRP_AutoHeal.js

Plugin desc : v1.03 It enables the "Auto Heal" command.

License :
・Copyright: Retained
・Commercial Use: Allowed
・Modification: Allowed
・Redistribution: Allowed
・Details: See Download Page / In-plugin documentation

Author : Takeshi Sunagawa (http://newrpg.seesaa.net/)

Website : https://github.com/NewRPGProject/MZMV_Plugin/blob/main/NRP_AutoHeal.js

Desc page : http://newrpg.seesaa.net/article/480069638.html

Download Page : https://raw.githubusercontent.com/NewRPGProject/MZMV_Plugin/main/NRP_AutoHeal.js

File name : NRP_AutoHeal.js

Help of plugin :

It enables the "Auto Heal" command.
 * When you run it from the menu screen, etc.,
 * your party members will automatically use the skill to heal.
 * 
 * -------------------------------------------------------------------
 * [Main Specifications]
 * -------------------------------------------------------------------
 * - The "Auto Heal" command can be added to the menu.
 * - It is also possible to call it from a plug-in command.
 * - Can also cure registered states.
 *   (In the initial state, this only applies to dead and poison)
 * - Automatically selects skills
 *   that consume as much energy as possible.
 * - You can change the conditions that determine
 *   who can use the healing skill.
 *  For example, those with high MP, those with efficient skills, etc.
 * - You can also set it to heal up to XX% of your maximum HP.
 * - You can choose how the message is displayed.
 * - You can choose whether or not to include reserve members.
 * 
 * -------------------------------------------------------------------
 * [Usage]
 * -------------------------------------------------------------------
 * Turning on this plugin will add "Auto Heal" command
 * to the menu commands.
 * It is also possible to call it from the plugin command
 * without displaying it in the menu.
 * You can also make finer adjustments than the plugin parameters.
 * 
 * -------------------------------------------------------------------
 * [Note of Skills]
 * -------------------------------------------------------------------
 * <ExceptAutoHeal>
 * Excludes the specified skill from "Auto Heal".
 * 
 * -------------------------------------------------------------------
 * [Plugin Command (MZ)]
 * -------------------------------------------------------------------
 * You can execute "Auto Heal" from the event.
 * "TargetHpRate", "SuccessSwitch",
 * and "FailureSwitch" can be specified.
 * The details are the same as for the plugin parameters,
 * so we will skip them.
 * 
 * -------------------------------------------------------------------
 * [Plugin Command (MV)]
 * -------------------------------------------------------------------
 * > nrp.autoHeal.start
 * You can execute "Auto Heal" from the event.
 * You can also specify options by specifying the following in advance.
 * 
 * > nrp.autoHeal.targetHpRate XX
 * If the HP is less than the specified value %,
 * it will perform a healing.
 * 
 * > nrp.autoHeal.successSwitch X
 * When healing is successful,
 * the switch with the specified number will be turned on.
 * 
 * > nrp.autoHeal.failureSwitch X
 * When healing is failed,
 * the switch with the specified number will be turned on.
 * 
 * The following is a running example of everything together.
 * ※Call it line by line.
 * 
 * nrp.autoHeal.targetHpRate 90
 * nrp.autoHeal.successSwitch 1
 * nrp.autoHeal.failureSwitch 2
 * nrp.autoHeal.start
 * 
 * -------------------------------------------------------------------
 * [About Displaying Messages]
 * -------------------------------------------------------------------
 * When "Auto Heal" is performed, the result is displayed as a message.
 * However, according to the RPG Maker specifications,
 * it is not possible to display messages on the menu screen.
 * Since this is a forced realization,
 * there is a possibility of conflicts and other problems.
 * In this case, please set the menu to close
 * after "Auto Heal" or turn off the message display.
 * 
 * Also, only when closing the menu, the common event can be called.
 * Please use this function for performance.
 * 
 * -------------------------------------------------------------------
 * [Algorithm Of "Auto Heal"]
 * -------------------------------------------------------------------
 * 1. Find the target with the lowest percentage of HP.
 * 2. Determine the user of the healing skill according to the settings.
 * 3. Find the most efficient skill for the target.
 *    ※The skill with the largest (healing amount / consumption).
 * 4. Execute the healing.
 * 5. Repeat the above.
 *    The process ends when no one's HP is reduced
 *    or no one can use the skill.
 * 
 * -------------------------------------------------------------------
 * [Other Detailed Specifications]
 * -------------------------------------------------------------------
 * - Only skills with the type "HP Recover" are targeted for healing.
 * 
 * - Also, the calculation of the efficiency is done by a formula.
 *  Even the amount of healing
 *   from the use effect is not taken into account.
 * 
 * - MP and TP are treated the same.
 *  In other words, if the amount of healing is the same,
 *   the efficiency of a skill that consumes 10 MP
 *   and a skill that consumes 10 TP are considered equal.
 * 
 * - To calculate the amount of healing, run the skill formula internally.
 *  Note that if you write the actual process inside the formula,
 *   it will also be executed.
 * 
 * - I do not guarantee complete efficiency.
 *  It is not very efficient, especially when it comes to curing states.
 *  For example, I did not calculate the difference in efficiency
 *   between a skill that can cure multiple states
 *   and a skill that can only cure one state.
 *  It was too complicated and the author gave up on it.
 * 
 * - I don't think there are many,
 *   but recovery skills with random targets are not covered.
 *  I can' t calculate the result, so I can' t help you.
 * 
 * For more information, please see below.
 * http://newrpg.seesaa.net/article/480069638.html
 * 
 * -------------------------------------------------------------------
 * [Terms]
 * -------------------------------------------------------------------
 * There are no restrictions.
 * Modification, redistribution freedom, commercial availability,
 * and rights indication are also optional.
 * The author is not responsible,
 * but will deal with defects to the extent possible.
 * 
 * @------------------------------------------------------------------
 * @ Plugin Parameters
 * @------------------------------------------------------------------
 * 
 * @param <Menu Command>
 * @desc This item is used to display the "Auto Heal" menu command.
 * 
 * @param ShowMenuCommand
 * @parent <Menu Command>
 * @type boolean
 * @default true
 * @desc Add the menu command "Auto Heal".
 * 
 * @param ShowMenuCommandPosition
 * @parent <Menu Command>
 * @type number
 * @default 5
 * @desc The position to insert the "Auto Heal" menu command.
 * 0 will be the first.
 * 
 * @param AutoHealName
 * @parent <Menu Command>
 * @type text
 * @default Auto Heal
 * @desc Set the display name for "Auto Heal".
 * 
 * @param AutoHealSymbol
 * @text [Advanced]AutoHealSymbol
 * @parent <Menu Command>
 * @type text
 * @default autoheal
 * @desc Set the "Auto Heal" symbol.
 * This value can be used when working with other plugins.
 * 
 * @param <Heal Setting>
 * @desc This item is related to the settings for the healing process.
 * 
 * @param CureStates
 * @parent <Heal Setting>
 * @type state[]
 * @default ["1","4"]
 * @desc This is a list of states that are targeted for treatment.
 * It takes precedence over HP recovery.
 * 
 * @param TargetHpRate
 * @parent <Heal Setting>
 * @type text
 * @default 100
 * @desc If the actor's HP% is less than this value, the actor will recover.
 * 
 * @param TargetHpRateVariable
 * @parent <Heal Setting>
 * @type variable
 * @desc It will recover if the value is less than the value of the specified variable. This setting has priority.
 * 
 * @param UserPriority
 * @parent <Heal Setting>
 * @type select
 * @option Remaining MP @value Mp
 * @option Back Of The Line @value Back
 * @option Low Cost @value Cost
 * @option Balance(Remaining MP + Low Cost) @value Balance
 * @default Balance
 * @desc This condition determines the priority of the user of the healing skill.
 * 
 * @param UseReserveMembers
 * @parent <Heal Setting>
 * @type boolean
 * @default false
 * @desc Even reserve members who do not participate in battle will use their healing skills.
 * 
 * @param TargetReserveMembers
 * @parent <Heal Setting>
 * @type boolean
 * @default false
 * @desc Reserve members who do not participate in battle are also subject to healing.
 * 
 * @param <Message>
 * @desc Message related items.
 * 
 * @param MessageType
 * @parent <Message>
 * @type select
 * @option 0:None @value 0
 * @option 1:Simple @value 1
 * @option 2:Displays Skill Usage @value 2
 * @option 3:Displays Skill Usage & Result @value 3
 * @default 3
 * @desc Sets the message display method.
 * The message in case of failure is the same in both cases.
 * 
 * @param MessageShowFast
 * @parent <Message>
 * @type boolean
 * @default true
 * @desc Instant message for skill usage and results.
 * 
 * @param MessageBackgroundType
 * @parent <Message>
 * @type select
 * @option Normal @value 0
 * @option Dimmer @value 1
 * @option Transparency @value 2
 * @default 0
 * @desc Message window background type.
 * 
 * @param MessageSuccess
 * @parent <Message>
 * @type text
 * @default You're all recovered!
 * @desc This is the message upon successful healing.
 * Only displayed when using "1:Simple".
 * 
 * @param MessageUnnecessary
 * @parent <Message>
 * @type text
 * @default You have no need for recovery!
 * @desc The message when healing is not required.
 * 
 * @param MessageFailure
 * @parent <Message>
 * @type text
 * @default You can't recover!
 * @desc The message when the healing process fails.
 * 
 * @param MessageWait
 * @parent <Message>
 * @type boolean
 * @default true
 * @desc Wait for the message to be processed until it is finished.
 * 
 * @param <Sound>
 * @desc This is an item related to sound effects.
 * 
 * @param SoundSuccess
 * @parent <Sound>
 * @type file
 * @dir audio/se
 * @default Recovery
 * @desc The sound effect that is played when you successfully recover.
 * 
 * @param SoundFailure
 * @parent <Sound>
 * @type file
 * @dir audio/se
 * @default Buzzer1
 * @desc The sound effect that is played when recovery fails.
 * 
 * @param <Close Menu>
 * @desc This item is related to closing the menu after "Auto Heal".
 * 
 * @param CloseMenu
 * @parent <Close Menu>
 * @type boolean
 * @default false
 * @desc Close the menu after "Auto Heal".
 * 
 * @param SuccessSwitch
 * @parent <Close Menu>
 * @type switch
 * @desc A switch that turns on when successful.
 * Can be used for flash and animation.
 * 
 * @param FailureSwitch
 * @parent <Close Menu>
 * @type switch
 * @desc A switch that turns on when failed.
 * 
 * @------------------------------------------------------------------
 * @ Plugin Commands
 * @------------------------------------------------------------------
 * 
 * @command CallAutoHeal
 * @desc Execute "Auto Heal".
 * 
 * @arg TargetHpRate
 * @desc If the actor's HP% is less than this value, the actor will recover.
 * @type number
 * @max 100
 * 
 * @arg SuccessSwitch
 * @desc A switch that turns on when successful.
 * Can be used for flash and animation.
 * @type switch
 * 
 * @arg FailureSwitch
 * @desc A switch that turns on when failed.
 * @type switch

スポンサードリンク

-MZ plugins

Copyright© PGMZ - The Community-Driven Plugin Library for RPG Maker MZ , 2026 All Rights Reserved.