Chaos Project

RPG Maker => RPG Maker Scripts => RMXP Script Database => Topic started by: Blizzard on January 09, 2008, 04:06:12 pm

Title: [XP] Full Reflection System
Post by: Blizzard on January 09, 2008, 04:06:12 pm
Full Reflection System
Authors: Blizzard
Version: 3.1
Type: Game Experience Improvement
Key Term: Battle Add-on

Introduction

This script allows you to use a status effect that repells magical attacks.

This work is licensed under BSD License 2.0:
QuoteCopyright (c) Boris "Blizzard" Mikić
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1.  Redistributions of source code must retain the above copyright notice,
    this list of conditions and the following disclaimer.

2.  Redistributions in binary form must reproduce the above copyright notice,
    this list of conditions and the following disclaimer in the documentation
    and/or other materials provided with the distribution.

3.  Neither the name of the copyright holder nor the names of its contributors
    may be used to endorse or promote products derived from this software
    without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

You may use this script for both non-commercial and commercial products without limitations as long as you fulfill the conditions presented by the above license. The "complete" way to give credit is to include the license somewhere in your product (e.g. in the credits screen), but a "simple" way is also acceptable. The "simple" way to give credit is as follows:
QuoteFull Reflection System licensed under BSD License 2.0, Copyright (c) Boris "Blizzard" Mikić

Alternatively, if your font doesn't support diacritic characters, you may use this variant:
QuoteFull Reflection System licensed under BSD License 2.0, Copyright (c) Boris "Blizzard" Mikic

In general other similar variants are allowed as long as it is clear who the creator is (e.g. "Full Reflection System created by Blizzard" is acceptable). But if possible, prefer to use one of the two variants listed above.

If you fail to give credit and/or claim that this work was created by you, this may result in legal action and/or payment of damages even though this work is free of charge to use normally.


Features

v1.4
v2.0b
v2.1b
v2.2b
v3.0b
v3.01b
v3.1


Screenshots

N/A for this sort of script

Demo

N/A

Script

Just make a new script above main and paste this code into it.
Script Download (https://downloads.chaos-project.com/scripts/Full Reflection System.txt)

Instructions

Inside the script in the first comment.

Compatibility

97% compatible with SDK v1.x. 60% compatible with SDK v2.x. You might experience problems with exotic CBS-es.

Credits and Thanks


Author's Notes

A magical skill is considered a skill that has a either INT-F greater than zero or MDEF-F greater than zero. Please note that skills that can disable the reflection status break through the reflection automatically. Also, it is better if you don't use sounds and screen/target flashing in the animation for the reflecting effect.

If you find any bugs, please report them here:
http://forum.chaos-project.com

That's it! N-Joy! =D
Title: Re: [XP] Full Reflection System
Post by: Blizzard on July 13, 2008, 08:05:02 am
Wow, it's been quite a while. Update to v3.0b.

EDIT: Update to v3.01b.
Title: Re: [XP] Full Reflection System
Post by: Reno-s--Joker on February 14, 2009, 05:25:00 am
Geez, why are there no comments on this? :^_^':

...
*powers up*
Title: Re: [XP] Full Reflection System
Post by: elmangakac on August 16, 2009, 10:23:39 pm
o_o This cant be compatible for BLIZZ ABS?
Title: Re: [XP] Full Reflection System
Post by: Aqua on August 16, 2009, 10:29:54 pm
Quote from: Blizzard on January 09, 2008, 04:06:12 pm
v3.0b

  • fixed a little bug based on HP/SP Absorb Skills
  • better coding
  • commented code
  • now compatible with Blizz-ABS 1.99 or higher

v3.01b

  • now compatible with Blizz-ABS 2.11 or higher

Title: Re: [XP] Full Reflection System
Post by: elmangakac on August 16, 2009, 11:36:27 pm
 :^_^': Ouch! Sorry
Title: Re: [XP] Full Reflection System
Post by: Magus on October 12, 2011, 02:28:50 pm
:/ Odd... Can't get this thing to repell. I'll try moving it around a bit.
Title: Re: [XP] Full Reflection System
Post by: Fenriswolf on October 15, 2011, 12:22:41 pm
I'm having the same problem, have you managed to get it to work Magus?

EDIT: it's one of my scripts, now the trick to find out which one  :uhm:
EDIT: got it to work, moving the script around was enough.
Title: Re: [XP] Full Reflection System
Post by: Magus on October 15, 2011, 06:13:41 pm
Where'd you move it to get it to work?
Title: Re: [XP] Full Reflection System
Post by: Spaceman McConaughey on October 15, 2011, 07:58:08 pm
When you guys dig up the body, you aren't supposed to fuck it. :/
Title: Re: [XP] Full Reflection System
Post by: Blizzard on October 15, 2011, 10:51:54 pm
Fenriswolf and Magus had valid questions. This isn't considered necro-ing.
Title: Re: [XP] Full Reflection System
Post by: Fenriswolf on October 16, 2011, 08:45:47 am
Magus, try moving the script between each battle-related script, and test it after every shift.
Did the trick for me.

My apologies for the necrobump.
Title: Re: [XP] Full Reflection System
Post by: Blizzard on October 16, 2011, 09:26:17 am
As I said, there is no need to apologize. Necrobumps are fine if you have something relevant to say or if you are having a problem.
Title: Re: [XP] Full Reflection System
Post by: Magus on October 18, 2011, 12:57:14 am
Quote from: Fenriswolf on October 16, 2011, 08:45:47 am
Magus, try moving the script between each battle-related script, and test it after every shift.
Did the trick for me.

My apologies for the necrobump.


Okay, I'll give that a try and see what happens ^_^
Title: Re: [XP] Full Reflection System
Post by: Sin86 on December 17, 2017, 05:57:57 pm
So I too have done everything yet I still can't get it to work. I have the latest version of Blizz ABS and I've even moved the script around. I set everything correctly in the script but what all do I need to do to get this running. I even set up an event to trigger the reflect status and then go get hit with a magic attack but still nothing from this script done.
Title: Re: [XP] Full Reflection System
Post by: KK20 on December 17, 2017, 11:27:27 pm
Not sure how Fenris claimed to have this working. I get an error with default settings.

First point of the problem was this method:

  def self.swap_target_blizzabs(b1, b2, other, skill)
    # find all targets that are negative aligned from the targeted battler
    bs = other.find_all {|b| b2.ai.negative.include?(b.ai.basic)}

I was getting an error stating that there is no method basic defined for AI::Data_Enemy. I felt the logical fix was to replace it with group since you are finding the battlers' (with reflect on) enemy groups. This worked initially for the first attack.

The second attack however did not work anymore. I threw in a bunch of print statements to pinpoint the issue and found that the default Enemy alignment group (ID 2) saw groups [1, 3, 5, 6, 2] as negative. I added another enemy and, sure enough, the two monsters started fighting each other if an actor reflected. The cause for this is at line 942 in Part 3 (Map_Battler#skill_effect):

alignment_effect(character.ai.group) if self.damage_done?

So when the enemy gets hit by the reflected attack, they immediately see other enemies as a threat. Now I don't know if this was intentionally designed for scenarios like Confusion, but I'm not aware if there's anything defined to undo this change.

I just changed it to

alignment_effect(character.ai.group) if self.damage_done? && self.ai.group != character.ai.group

and things look much better now.

There's also some extra information regarding what types of skills can be reflected. In Part 2, you have this check:

      # if Full Reflection System is being used and not breaking reflection skill
      if $full_reflection_system != nil && $full_reflection_system >= 3.01 &&
          targets[0].is_a?(Map_Battler) && skill && !beam &&
          !BlizzCFG::BREAK_REFLECT.include?(object.id) &&
          projectype != REMTrapSkill && projectype != REMTrapItem &&
          projectype != REMTimedSkill && projectype != REMTimedItem

The skill will only reflect if it is NOT a beam-type, a trap, or a timed trap. I did my testings using a Direct-type.