Author Topic: [XP] Full Reflection System  (Read 15709 times)

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20013
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
[XP] Full Reflection System
« on: January 09, 2008, 11: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:
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
« Last Edit: March 23, 2019, 03:25:12 PM by Blizzard »
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


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

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

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20013
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: [XP] Full Reflection System
« Reply #1 on: July 13, 2008, 02:05:02 PM »
Wow, it's been quite a while. Update to v3.0b.

EDIT: Update to v3.01b.
« Last Edit: December 05, 2008, 02:26:12 PM by Blizzard »
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


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

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

Offline Reno-s--Joker

  • Astral Trancist
  • *****
  • Posts: 674
  • LV: 34
  • Gender: Female
  • Zombie account.
    • View Profile
    • My DeviantART
Re: [XP] Full Reflection System
« Reply #2 on: February 14, 2009, 12:25:00 PM »
Geez, why are there no comments on this? :^_^':

...
*powers up*

Offline elmangakac

  • Transcended Spirit
  • ***
  • Posts: 171
  • LV: -3
    • View Profile
    • Cesar&Friends (My Manga in Spanish)
Re: [XP] Full Reflection System
« Reply #3 on: August 17, 2009, 04:23:39 AM »
o_o This cant be compatible for BLIZZ ABS?

Offline Aqua

  • Lexima Warrior
  • *******
  • Posts: 2554
  • LV: 118
  • Gender: Female
  • Quack!
    • View Profile
Re: [XP] Full Reflection System
« Reply #4 on: August 17, 2009, 04:29:54 AM »
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

Offline elmangakac

  • Transcended Spirit
  • ***
  • Posts: 171
  • LV: -3
    • View Profile
    • Cesar&Friends (My Manga in Spanish)
Re: [XP] Full Reflection System
« Reply #5 on: August 17, 2009, 05:36:27 AM »
 :^_^': Ouch! Sorry

Offline Magus

  • Astral Trancist
  • *****
  • Posts: 545
  • LV: -20
  • Gender: Male
  • Writer of Destiny
    • View Profile
Re: [XP] Full Reflection System
« Reply #6 on: October 12, 2011, 08:28:50 PM »
:/ 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 />

Offline Fenriswolf

  • Awakened Visionist
  • **
  • Posts: 81
  • LV: 2
  • Gender: Male
    • View Profile
Re: [XP] Full Reflection System
« Reply #7 on: October 15, 2011, 06: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.
« Last Edit: October 15, 2011, 06:47:34 PM by Fenriswolf »

Offline Magus

  • Astral Trancist
  • *****
  • Posts: 545
  • LV: -20
  • Gender: Male
  • Writer of Destiny
    • View Profile
Re: [XP] Full Reflection System
« Reply #8 on: October 16, 2011, 12:13:41 AM »
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 />

Offline Spaceman McConaughey

  • Legit Poo Poo Man
  • Lexima Warrior
  • *******
  • Posts: 2002
  • LV: 46
  • Gender: Male
  • muh murph
    • View Profile
    • Titties, titties, and more titties!
Re: [XP] Full Reflection System
« Reply #9 on: October 16, 2011, 01:58:08 AM »
When you guys dig up the body, you aren't supposed to fuck it. :/

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20013
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: [XP] Full Reflection System
« Reply #10 on: October 16, 2011, 04:51:54 AM »
Fenriswolf and Magus had valid questions. This isn't considered necro-ing.
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


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

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

Offline Fenriswolf

  • Awakened Visionist
  • **
  • Posts: 81
  • LV: 2
  • Gender: Male
    • View Profile
Re: [XP] Full Reflection System
« Reply #11 on: October 16, 2011, 02:45:47 PM »
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.

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20013
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: [XP] Full Reflection System
« Reply #12 on: October 16, 2011, 03:26:17 PM »
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      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


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

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

Offline Magus

  • Astral Trancist
  • *****
  • Posts: 545
  • LV: -20
  • Gender: Male
  • Writer of Destiny
    • View Profile
Re: [XP] Full Reflection System
« Reply #13 on: October 18, 2011, 06:57:14 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 />

Offline Sin86

  • Transcended Spirit
  • ***
  • Posts: 190
  • LV: 3
    • View Profile
Re: [XP] Full Reflection System
« Reply #14 on: December 18, 2017, 12:57:57 AM »
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.

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3197
  • LV: 385
  • Gender: Male
  • Choco Octo <3
    • View Profile
Re: [XP] Full Reflection System
« Reply #15 on: December 18, 2017, 06:27:27 AM »
Not sure how Fenris claimed to have this working. I get an error with default settings.

First point of the problem was this method:
Code: [Select]
  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):
Code: [Select]
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
Code: [Select]
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:
Code: [Select]
      # 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 AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!


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

Join the CP Discord Server!