Reverse Damage Effect
Version: 1
Author: Soulpour777
Date: March 2, 2015
Description
A script that reverses the attack into recovery instead. When you are being attacked by the enemy, you will be able to nullify the damage and reverse it through the effort of a state.
Features
- Reverses damage as healing.
Instructions
Note Tags:
<reverse_effect>
put this on your State Note box to have the reverse effect. The state that has this note tag allows you to reverse the damage.
Script
# ============================================================================ #
# ◆ Reverse Damage Effect ◆
# Author: Soulpour777
# ---------------------------------------------------------------------------- #
# Description: A script that reverses the attack into recovery instead. When
# you are being attacked by the enemy, you will be able to nullify the damage
# and reverse it through the effort of a state.
# ---------------------------------------------------------------------------- #
# Note Tags:
# <reverse_effect>
# ^ put this on your State Note box to have the reverse effect. The state that
# has this note tag allows you to reverse the damage.
# ---------------------------------------------------------------------------- #
# Terms of Use:
# You are free to SHARE and REMIX the script as long as its for a
# Non-Commercial script. If you are going / planning to use it for a commercial
# use, please contact me for more information.
# ============================================================================ #
($imported ||= {})[:soulpour_reverse_damage] = {
:name => 'Reverse Damage Effect',
:version => '1.0.0',
:author => ['Soulpour777'],
:date => '2015-02-27',
:id => :soulpour_reverse_damage,
:enabled => true
}
($imported[:SCRIPT_LIST] ||= []) << $imported[:soulpour_reverse_damage]
module Soul
module ReverseDamageEffect
State_RegEx = /<(?:REVERSE_EFFECT|reverse_effect)>/i
Nullify_HP = 1000
Nullify_MP = 1000
Nullify_TP = 100
end
end
class RPG::State
#--------------------------------------------------------------------------
# * Reverse Damage Effect
#--------------------------------------------------------------------------
def create_reverse_effect
@damage_effect = false
self.note.each_line { |line|
case line
when Soul::ReverseDamageEffect::State_RegEx
@damage_effect = true
puts @damage_effect
end
}
end
#--------------------------------------------------------------------------
# * Reverse Damage?
#--------------------------------------------------------------------------
def reverse_dmg?
create_reverse_effect if @damage_effect == nil
return @damage_effect
end
end
class Game_ActionResult
#--------------------------------------------------------------------------
# * Alias Listing
#--------------------------------------------------------------------------
alias soul_reverse_dmg_action_result make_damage
#--------------------------------------------------------------------------
# * Reversed?
#--------------------------------------------------------------------------
def reversed?
$game_party.members.each do |member|
member.states.each{ |state| return true if state.reverse_dmg?}
end
return false
end
#--------------------------------------------------------------------------
# * Create Damage
#--------------------------------------------------------------------------
def make_damage(value, item)
soul_reverse_dmg_action_result(value, item)
if reversed?
$game_party.members.each do |member|
@mp_damage += -Soul::ReverseDamageEffect::Nullify_MP
@hp_damage += -Soul::ReverseDamageEffect::Nullify_HP
@tp_damage += -Soul::ReverseDamageEffect::Nullify_TP
end
end
end
end
Credit
Support
Please PM or comment for any questions.
Known Compatibility Issues
N / A
Terms of Use