Introduction This script allows you to add HP/MP Recovery percentiles to the battle guard/defend command. So basically whenever your characters (or your enemies) guard he/she/it will recover some HP/MP. The original script only had a global value for all characters. So all your characters did recover 5% of their HP. Now you can set the rates for each of your characters individually. Same goes for enemy HP/MP recovery values. And you can change these values during the game as well.
Features - Player characters can recover HP/MP through guarding - Enemies can recover HP/MP through guarding
Put the script into the "Materials" section and above "Main process".
The script has four configuration items: HP_RATE_ACTOR (for player character HP reg), MP_RATE_ACTOR (player MP reg), HP_RATE_ENEMY (enemy HP reg) and MP_RATE_ENEMY (enemy MP reg). It is recommended to change the standard values to whatever you need for your game. You probably don't want your 2nd hero to recover 100% of his/her HP during guarding.
CODE
# Guarding HP recovery rate in percent # Syntax: # Actor_ID => percent, # eg actor 2 recovers 100% of his/her HP # Actors you don't specify recover the value behind default # If you're fine with just the default value and don't want any settings for anything else, # remove all other stuff AND the "," in the default row # Some goes for the MP below and the enemy HP/MP recovery
# It is possible to change the recovery rates in the middle of the game # as well! So if one of your characters falls in the magical river of # magical recovery and you want him to recover 10% HP instead of 5% # create a script event and put this into it: # KGC::GuardRecover::HP_RATE_ACTOR[1] = 10 # This changes the HP recovery rate for actor 1 (Ralph in this demo) to 10% # Works with MP (use KGC::GuardRecover::MP_RATE_ACTOR[actor_id] ) and # the recovery rates of enemies as well: # KGC::GuardRecover::HP_RATE_ENEMY[enemy_id] and KGC::GuardRecover::MP_RATE_ENEMY[enemy_id]
HP_RATE_ACTOR = { "default" => 5, 1 => 10, 2 => 100, 3 => 5 } # Do not remove this line
# Guarding MP recovery rate in percent MP_RATE_ACTOR = { "default" => 5, 1 => 10, 2 => 5, 3 => 100 } # Do not remove this line
# ? Guarding Enemy HP Recovery Rate in percent HP_RATE_ENEMY = { "default" => 0, 1 => 5 } # Do not remove this line
# ? Guarding Enemy MP Recovery Rate in percent MP_RATE_ENEMY = { "default" => 0, 1 => 5 } # Do not remove this line
Demo The newest version of this script/demo can always be found here: http://www.digioso.org/KGC_GuardRec Just run around until you see a fight. Use the "Guard" command in battle to see what the script is capable of. Talk to Ralph in the game to change the recovery values for him during the game.
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_ #_/ ? Recover on Guard - KGC_GuardRecover Extended 1.1 ? VX ? #_/ ? Last Update: 08/10/2008 #_/ ? Written by TOMY #_/ ? Translation by Mr. Anonymous #_/ ? KGC Site: #_/ ? [url="http://ytomy.sakura.ne.jp/"]http://ytomy.sakura.ne.jp/[/url] #_/ ? Translator's Blog: #_/ ? [url="http://mraprojects.wordpress.com"]http://mraprojects.wordpress.com[/url] #_/ ? Edited by Digioso on 14.10.2011 so that you can now specify the recovery #_/ ? values for each actor/enemy seperately. If not specified a default value is used. #_/ ? [url="http://www.digioso.org"]http://www.digioso.org[/url] #_/ ? Updated documentation on 17.10.2011 #_/----------------------------------------------------------------------------- #_/ This script allows you to add HP/MP Recovery percentiles to the battle #_/ guard/defend command. #_/ * Note from the translator: I had previously ported this script myself, #_/ this official KGC port however, is a bit more cleanly coded. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
#============================================================================== # ? BEGIN Customization ? #==============================================================================
module KGC module GuardRecover
# Guarding HP recovery rate in percent # Syntax: # Actor_ID => percent, # eg actor 2 recovers 100% of his/her HP # Actors you don't specify recover the value behind default # If you're fine with just the default value and don't want any # settings for anything else, # remove all other stuff AND the "," in the default row # Some goes for the MP below and the enemy HP/MP recovery
# It is possible to change the recovery rates in the middle of the game # as well! So if one of your characters falls in the magical river of # magical recovery and you want him to recover 10% HP instead of 5% # create a script event and put this into it: # KGC::GuardRecover::HP_RATE_ACTOR[1] = 10 # This changes the HP recovery rate for actor 1 (Ralph in this demo) to 10% # Works with MP (use KGC::GuardRecover::MP_RATE_ACTOR[actor_id] ) and # the recovery rates of enemies as well: # KGC::GuardRecover::HP_RATE_ENEMY[enemy_id] and KGC::GuardRecover::MP_RATE_ENEMY[enemy_id]
HP_RATE_ACTOR = { "default" => 5, 1 => 10, 2 => 100, 3 => 5 } # Do not remove this line
# Guarding MP recovery rate in percent MP_RATE_ACTOR = { "default" => 5, 1 => 10, 2 => 5, 3 => 100 } # Do not remove this line
# ? Guarding Enemy HP Recovery Rate in percent HP_RATE_ENEMY = { "default" => 0, 1 => 5 } # Do not remove this line
# ? Guarding Enemy MP Recovery Rate in percent MP_RATE_ENEMY = { "default" => 0, 1 => 5 } # Do not remove this line end end
#============================================================================== # ? END Customization ? #==============================================================================
$imported = {} if $imported == nil $imported["GuardRecover"] = true
class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # ? Execute Battle Action: Guard #-------------------------------------------------------------------------- alias execute_action_guard_KGC_GuardRecover execute_action_guard def execute_action_guard execute_action_guard_KGC_GuardRecover
@active_battler.guard_recover_effect if @active_battler.hp_damage != 0 display_damage(@active_battler) elsif @active_battler.mp_damage != 0 display_mp_damage(@active_battler) end end end
FAQ Q: The demo won't open, how to open it? A: Download 7-zip and try again.
Terms and Conditions I'm not the original author I'd say it's free to use in non-commercial games. Since I only modified the script myself I don't have anything against other people modifying it further. Just give credit to everybody mentioned below.
Author's Notes These changes were requested by TheDrifter here. Well, he only wanted that his first actor recoverd 10% HP/MP while everyone else gets 5%. I took it a step further and made these customization options for all actors/enemies.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.