This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.
Features
You can set any enemies to reflect any elements from database.
Easy to customize
You can create armors that help reflect any elements.
You can create status that reflect any elements.
You can even reflect any magic or any physical damage.
Basic attack with element will also be reflected, if that element reflector is activated.
Screenshots
Cast "Fire" to that stupid Ghost!
Uh-oh! Reflected!?
And look what happened...
I just dealt 300 damage to myself :'(
Script
Script
Code:
#==============================================================================
# * Hima's Elemental Reflector v. 1.3
#------------------------------------------------------------------------------
# This script will allow you to set your character or enemies to reflect any element
# you want. You can also create armors or skills that create elemental reflector.
#
# Version History
# ---------------------------------------------------------
# 1.0 - First Released
# 1.1 - Fixed infinite reflect problem
# 1.2 - More features added
# a.) You can now choose to reflect any physical or magical skill.
# b.) Physical reflect will also reflect any basic attack.
# c.) Basic attack with element will also be reflected from elemental reflector.
# 1.3 - Fixed some bugs that occur when you don't put all the ELEMENTS you defined into the database.
# ---------------------------------------------------------
# contact : ninomiya_mako@hotmail.com
#==============================================================================
module HIMA_REFLECT
#--------------------------------------------------------------------------
# - Customize Point -
# ELEMENTS - This is where you create the name of element you want to reflect. This is how it works
# {Name => Reflected Element ID, Name => Reflected Element ID, ...}
# The name can be anything, and ID is ID of the element that this will reflect. You have to
# create a new element that match what you input here.
# Special Elment ID are as follows :
#
# "Physical" -> For any physical skill, with atk_f greater than 0
# "Magic" -> For any magic skill, with int_f (mind_f) greater than 0
#
# WORD - Message that will pop up when reflection occurs.
#--------------------------------------------------------------------------
ELEMENTS = {"Reflect Fire" => 1,"Reflect Ice" => 2,"Deflector" => "Physical", "Reflector" => "Magic"}
WORD = "Reflect"
end
module RPG
class Skill
def type_of_skill
if @int_f > 0
return "Magic"
elsif @atk_f > 0
return "Physical"
else
return nil
end
end
end
end
class Game_Battler
attr_accessor :reflect # Reflect Flag
alias hima_reflect_init initialize
def initialize
@reflect = 0 #0 = no reflect, 1 = basic_attack, 2 = skill_effect
hima_reflect_init
end
alias hima_reflect_attack_effect attack_effect
def attack_effect(attacker)
# Check for reflect basic attack
element_to_reflect = HIMA_REFLECT::ELEMENTS.index("Physical")
reflect_id = $data_system.elements.index(element_to_reflect)
if reflect_id != nil
if self.element_reflect(reflect_id) == 1
if attacker.element_reflect(reflect_id) == 1
self.damage = "Block"
self.reflect = 0
else
self.damage = HIMA_REFLECT::WORD
self.reflect = 1
end
return false
end
end
# End of reflect basic attack
# Check for reflect element of basic attack
for q in 0...attacker.element_set.size
element_id = attacker.element_set[q]
element_to_reflect = HIMA_REFLECT::ELEMENTS.index(element_id)
if element_to_reflect != nil
reflect_id = $data_system.elements.index(element_to_reflect)
if self.element_reflect(reflect_id) == 1
if attacker.element_reflect(reflect_id) == 1
self.damage = "Block"
self.reflect = 0
else
self.damage = HIMA_REFLECT::WORD
self.reflect = 1
end
return false
end
end
end #end for
# End of reflect element of basic attack
hima_reflect_attack_effect(attacker)
end
alias hima_reflect_skill_effect skill_effect
def skill_effect(user, skill)
# Reflect physical or magic skill
if skill.type_of_skill != nil
element_id = skill.type_of_skill
element_to_reflect = HIMA_REFLECT::ELEMENTS.index(element_id)
if element_to_reflect != nil
reflect_id = $data_system.elements.index(element_to_reflect)
if reflect_id != nil
if self.element_reflect(reflect_id) == 1
if user.element_reflect(reflect_id) == 1
self.damage = "Block"
self.reflect = 0
else
self.damage = HIMA_REFLECT::WORD
self.reflect = 2
end
return false
end
end
end
end
# Reflect specific element
for q in 0...skill.element_set.size
element_id = skill.element_set[q]
element_to_reflect = HIMA_REFLECT::ELEMENTS.index(element_id)
if element_to_reflect != nil
reflect_id = $data_system.elements.index(element_to_reflect)
if reflect_id != nil
if self.element_reflect(reflect_id) == 1
if user.element_reflect(reflect_id) == 1
self.damage = "Block"
self.reflect = 0
else
self.damage = HIMA_REFLECT::WORD
self.reflect = 2
end
return false
end
end
end
end #end for
hima_reflect_skill_effect(user,skill)
end
def element_reflect(element_id)
if self.is_a?(Game_Actor)
result = $data_classes[self.class_id].element_ranks[element_id]
for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id]
armor = $data_armors[i]
if armor != nil and armor.guard_element_set.include?(element_id)
result = 1
end
end
for i in @states
if $data_states[i].guard_element_set.include?(element_id)
result = 1
end
end
else
result = $data_enemies[self.enemy_id].element_ranks[element_id]
for i in @states
if $data_states[i].guard_element_set.include?(element_id)
result = 1
end
end
end
# Method end
return result
end
end
class Game_Enemy < Game_Battler
attr_accessor :enemy_id
end
class Scene_Battle
alias hima_update_phase4_step5 update_phase4_step5
def update_phase4_step5
hima_update_phase4_step5
reflect = 0
for target in @target_battlers
if target.reflect != 0
reflect = target.reflect
target.reflect = 0
end
end
if reflect > 0
@target_battlers = []
@target_battlers.push(@active_battler)
case reflect
when 1
@active_battler.attack_effect(@active_battler)
when 2
@active_battler.skill_effect(@active_battler,@skill)
end #case
@phase4_step = 4
else
@phase4_step = 6
end
end
end
Instructions
- Copy this script and paste it below other scripts but above Main, named it "Hima_Element_Reflector"
- ELEMENTS is an array of attribute names that will be used to reflect another attributes.
Code:
ELEMENTS =
{"New attribute name" => ID of attribute that this name will reflect, "New attribute name" => ID of attribute that this name will reflect, ...}
In "ID of attribute that this name will reflect", you can enter these two specials input.
"Physical" -> For basic attack or any skills with atk_f >0
"Magic" -> For any skills with int_f > 0
- Now go to database, and create new attributes that has the same name with what you put in the script
- To activate the reflect attribute, change that attribute into rate "A". For example, In script I put
Code:
Reflect Fire -> 1
that means new attribute with a name "Reflect Fire" will reflect an attribute with ID of 1, which is "Fire"
I want "Ghost" to activate this reflector, so I set "Reflect Fire" to be 'A'
- If you want to create a status that create reflector effect, just mark the new attribute you just created.
- And this also apply to create an armor with reflect status.
Terms and Conditions
If you use this script, please give me credit. Also, it would be nice if you show me your game, because I would really like to play try a game with my script in it :P