Percentage Health States
Authors: Aqua
Version: 1.5
Type: Battle States Add-on
Key Term: Battle Add-on
IntroductionThis script makes it so that battlers will gain states when they are below a certain percentage of health. The states would be automatically lost when the battler's health is above the configured percentage.
Note: this affects all actors and enemies.
For example, you could have a state for when HP is critical and battlers gain more attack as a last effort to win.
Features
- Seperate percentages for each state
- Automatically gain/lose the configured states
- Very easy configuration
- Actor/Enemy specific states possible
ScreenshotsNot really needed.
Imagine that Arshes gains Sharp when his HP falls below 20%
DemoDon't think it'd be really necessary, but post if you do want one.
Script
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=#
# Percentage Health States Script by TerreAqua
# Version: 1.5
# Type: Battle States Add-on
# Key Term: Battle Add-on
# Date: 6/17/09
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=#
#===============================================================================
# Information
#-------------------------------------------------------------------------------
#
# This script makes it so that battlers will gain states when they are below a
# certain percentage of health. The states would be automatically lost when
# the battler's health is above the configured percentage.
# Note: this affects all actors and enemies.
#
# If you need to contact me about this script, please go to:
# http://forum.chaos-project.com
#
# You should have only gotten this script from http://chaos-project.com
# Please let me know if you have found it somewhere else.
#===============================================================================
module Aqua
module HealthStates
#:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~#
#:~:~:~:~:~:~:~:~:~:~::~:~:~: Instructions :~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~#
#:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~#
#===============================================================================
# Configure the below modules in the following format:
#
# MODULE = [[X, Y]]
#
# MODULE is the below modules. You don't change these, and they all follow the
# same format.
# X is the percent of health for the state to activate (can be a decimal).
# Y is the state id.
#
#===============================================================================
# HP States that affect all battlers
HP_STATES_ALL = [[25.0, 18]]
# HP States that only affect actors
HP_STATES_ACTORS = []
# Actor specific HP States
# Format is: when ACTOR_ID then return [[X, Y]]
def self.actor(id)
case id
when 1 then return [[95, 5], [70, 4]]
when 2 then return [[98, 4]]
end
return []
end
# HP States that only affect enemies
HP_STATES_ENEMIES = []
# Enemy specific HP States
# Format is: when ENEMY_ID then return [[X, Y]]
def self.enemy(id)
case id
when 1 then return [[99, 5]]
end
return []
end
#:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~#
#:~:~:~:~:~:~:~:~:~:~:~:~ End Configure Area :~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~#
#:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~#
end
end
#===============================================================================
# Credits:
# Aqua (aka TerreAqua) for making this.
# Subsonic_Noise for requesting that I release it.
# Starrodkirby86 for letting me rant to him.
#===============================================================================
#===============================================================================
# This work is protected by the following license:
# #-----------------------------------------------------------------------------
# #
# # Creative Commons - Attribution-NonCommercial-ShareAlike 3.0 Unported
# # ( http://creativecommons.org/licenses/by-nc-sa/3.0/ )
# #
# # You are free:
# #
# # to Share - to copy, distribute and transmit the work
# # to Remix - to adapt the work
# #
# # Under the following conditions:
# #
# # Attribution. You must attribute the work in the manner specified by the
# # author or licensor (but not in any way that suggests that they endorse you
# # or your use of the work).
# #
# # Noncommercial. You may not use this work for commercial purposes.
# #
# # Share alike. If you alter, transform, or build upon this work, you may
# # distribute the resulting work only under the same or similar license to
# # this one.
# #
# # - For any reuse or distribution, you must make clear to others the license
# # terms of this work. The best way to do this is with a link to this web
# # page.
# #
# # - Any of the above conditions can be waived if you get permission from the
# # copyright holder.
# #
# # - Nothing in this license impairs or restricts the author's moral rights.
# #
# #-----------------------------------------------------------------------------
#===============================================================================
class Game_Battler
def hp_percent_states(hp_percent, state_id)
aqhp = self.hp.to_f
aqmaxhp = self.maxhp.to_f
aqhpper = (aqhp / aqmaxhp) * 100
if aqhpper <= hp_percent
add_state(state_id)
else
remove_state(state_id)
end
end
def hp_percent_states_checker
if self.is_a?(Game_Actor)
for i in $game_party.actors
id = i.id
if self.id == id
e = Aqua::HealthStates.actor(id)
for q in e
hp_percent_states(q[0], q[1])
end
end
for i in Aqua::HealthStates::HP_STATES_ACTORS
hp_percent_states(i[0], i[1])
end
end
elsif self.is_a?(Game_Enemy)
for i in $game_troop.enemies
id = i.id
if self.id == id
e = Aqua::HealthStates.enemy(id)
for q in e
hp_percent_states(q[0], q[1])
end
end
for i in Aqua::HealthStates::HP_STATES_ENEMIES
hp_percent_states(i[0], i[1])
end
end
end
for i in Aqua::HealthStates::HP_STATES_ALL
hp_percent_states(i[0], i[1])
end
end
alias hp_percent_states_attack_effect attack_effect
def attack_effect(attacker)
if hp_percent_states_attack_effect(attacker)
hp_percent_states_checker
end
return
end
alias hp_percent_states_skill_effect skill_effect
def skill_effect(user, skill)
if hp_percent_states_skill_effect(user, skill)
hp_percent_states_checker
end
return
end
alias hp_percent_states_item_effect item_effect
def item_effect(item)
if hp_percent_states_item_effect(item)
hp_percent_states_checker
end
return
end
alias hp_percent_states_slip_damage_effect slip_damage_effect
def slip_damage_effect
if hp_percent_states_slip_damage_effect
hp_percent_states_checker
end
return
end
end
InstructionsNew script slot > Below RTP scripts > Above Main
# Configure the below modules in the following format:
#
# MODULE = [[X, Y]]
#
# MODULE is the below modules. You don't change these, and they all follow the
# same format.
# X is the percent of health for the state to activate (can be a decimal).
# Y is the state id.
CompatibilityMight not be compatible with exotic scripts.
Compatible with Blizz-ABS. Paste above if using with Blizz-ABS
Credits and Thanks
- Aqua for making it.
- Subsonic_Noise for requesting that I release it.
- Starrodkirby86 for letting me rant to him.
Author's NotesHope you enjoy this!
I might add Scene_Map checker later.