[XP] Full Reflection System

Started by Blizzard, January 09, 2008, 04:06:12 pm

Previous topic - Next topic

Blizzard

January 09, 2008, 04:06:12 pm Last Edit: March 23, 2019, 08:25:12 am by Blizzard
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:
Quote
Copyright (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:
Quote
Full 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:
Quote
Full 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


  • a reflect status that finally works
  • fully compatible with Tons of Add-ons

v1.4

  • overworked code and fixed all the glitches
  • the power comes back X times stronger if it is reflected from X battlers (i.e. like in the Final Fantasy series)
  • spells now get reflected to anybody from the enemy party, not only the user (makes it possible to split damage from the FF feature mentioned above)
  • added a fix so it works with HP/SP Absorb

v2.0b

  • completely overworked and fixed

v2.1b

  • overworked and independent from Tons of Add-ons

v2.2b

  • added compatibility variable

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

v3.1

  • added new license
  • added usage and crediting instructions




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


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


  • Boris "Blizzard" Mikić



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
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Blizzard

July 13, 2008, 08:05:02 am #1 Last Edit: December 05, 2008, 07:26:12 am by Blizzard
Wow, it's been quite a while. Update to v3.0b.

EDIT: Update to v3.01b.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.


elmangakac

o_o This cant be compatible for BLIZZ ABS?

Aqua

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


elmangakac


Magus

:/ Odd... Can't get this thing to repell. I'll try moving it around a bit.
LEVEL ME DOWN. THE ANTI-BLIZZ GROUP IS AMONG YOU... Do it for the chick below...She watches..<br />

Fenriswolf

October 15, 2011, 12:22:41 pm #7 Last Edit: October 15, 2011, 12:47:34 pm by Fenriswolf
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.

Magus

Where'd you move it to get it to work?
LEVEL ME DOWN. THE ANTI-BLIZZ GROUP IS AMONG YOU... Do it for the chick below...She watches..<br />

Spaceman McConaughey

When you guys dig up the body, you aren't supposed to fuck it. :/

Blizzard

Fenriswolf and Magus had valid questions. This isn't considered necro-ing.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Fenriswolf

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.

Blizzard

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.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Magus

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 ^_^
LEVEL ME DOWN. THE ANTI-BLIZZ GROUP IS AMONG YOU... Do it for the chick below...She watches..<br />

Sin86

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.

KK20

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.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!