Resistance Breaker

Kicklash

Warper
Member
Joined
Mar 24, 2012
Messages
4
Reaction score
0
First Language
English
Primarily Uses
Hi, first time poster, long time lurker. Yes, yes, get your groans out of the way. I completely accept my suckiness, and am unsure as to whether this is the right section or not for this post, but here goes.

So, I'm working on a game, obviously, and in it, I have a bonus boss in the form of the grim reaper.

I'm not going give its stats, as it's a work in progress, but I will say that as its stats are now, even the weaker characters at level 80 are ahead in regards to ATK, DEF, MAT and MDF. However, that's only in regards to stats. Factoring in features is another thing entirely.

In my game, I have divided physical attacks into five categories: Bullet, Arrow, Strike, Stab and Slash. The reaper is immune

to all of them, being a spirit. In addition, he is immune to Dark and Silver (Yes, Silver is its own element) and resistant by 50% to the great majority of the other elements. Oh, and his standard attack has a 5% chance of instant death.

The minority elements are Light, at normal rate, and Sound (YES) at 1000% weakness (ALSO YES). However, I'm planning for most of the enemies in the area you can find it to have varying resistances to light, and Sound spells are few in number and generally weaker than the standard Fire/Ice/Elec trio, with the only one with equal power planned to be difficult to get to, so I don't see anyone using these solutions anytime soon. Therefore, I have designed an alternate solution, and therin lies the problem.

I have designed 8 spells that are designed to remove an enemy's element variation, setting it back to 100%. This effect occurs by inflicting the appropriate state for the appropriate element. However, when I try it on the reaper, who inspired me to make the spell to begin with, it is still considered resistant, at 50%. And I know this because I'm using some of Yanfly's Scripts, which may be an issue, but I am not entirely sure.

If you need to try it out for yourself to see the problem, all the states have the following information:

  • Name: [Element] Break
  • No Restriction
  • Priority 50
  • Auto-Removal Timing: End Turn
  • Turn Duration: 4~1
  • Element Rate: [Element] * 100%
Those are all the variables, and only EleRate seems like changing it will do anything. If you can help me out, I would really appreciate it.
 
Last edited by a moderator:

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
Wow, this is a tricky one!

The problem is that applying a State with Element Rate * 100% doesn't really SET the Element Rate to 100%.  It adds an ER (Element Rate) 100% feature that's used, along with the other ERs that the battler already has.  So in your case, your (Fire or whatever) spell is being multiplied by 50%, then by 100%, meaning that, of course, it's doing 50% damage.

Now, assuming you want this spell to be available to use on any enemy and not just Reaper, you can't simply give "Fire Break" a 200% ER for Fire, because that would cause enemies with a standard 100% rate to now take double damage from Fire (and would cause enemies taking 5% damage to only take 10% when Fire Break'ed).  So how can we do it?

There are two ways.  The first only requires Troop Eventing, but it will be a TON of work.  The second requires scripting - it's much easier and cleaner, but I can only get you most of the way there (someone with more knowledge about the Attack States method will have to fill in the rest, or I can come back to it later once I've had more time to study the method's syntax).

How to Event it

The idea behind this approach is a setup that makes all "innate" resistances of battlers to elements into a State rather than a property of the battler itself.  For each possible resistance that an enemy can have, create a new State - for example, "25% damage from Fire", "50% damage from Fire", and "50% damage from Water".  You could probably give all of these states 0 Priority and no graphic - but be sure to set the appropriate ER.  Unless you're doing something wacky with elemental damage on from traps on the field map, you should have the State remove at the end of battle.

Now, inside each Troop, make an event that runs on Turn 0 to give them the appropriate Resistance State(s).  Now, for each "Break" state that you've created, have it grant a State Resist (be careful - this is NOT a State Rate or Element Rate; there is a specific feature called State Resist) to each of that element's resistances (e.g. Fire Break would have State Resist to "0% damage from Fire", "25% damage from Fire", and "50% damage from Fire").  When the Break state wears off, the State Resist will go with it so that the battler is now resistant to that element again.

If you want enemies to be able to break party members' resistances as well, it gets even more complicated.  Create a "Set Resistances" common event that is called from that same Turn 0 event for each troop and give each party member the appropriate resistance states based on their natural affinities to elements.  If you have armor (etc.) that grants elemental resistances as well, you'll need to do a check for each one inside this common event as well: if the actor has that armor equipped, give that actor the approrpriate elemental resistance State.  This could take a while!

With all that being done correctly, your State Breaking should work perfectly.

How to Script it

Simply paste the following into the "Materials" section of the Script Editor, and adjust/add the "if" branches to fit your needs.  First of all, note that this is an overwrite method so it might not play well with any other custom script you're using that mess with Element Rates.  Secondly, note that this will currently work for all skills/magic/items, but as written, will not affect Attack Elements (for example, a sword that uses the Fire Element when it attacks will use the battler's innate fire resistance in the damage calculation and ignore the Break state).  I need to figure out the syntax inside elements_max_rate before I can update this scriptlet to allow Attack Elements to use the Break State - or, if someone else reading this knows how, that would be great.

IMPORTANT: Unless you want your Resistance Break states to do something else in addition to the "Break", these States should not have ANY features associated with them - they're basically "dummy states" that the following code checks to see whether to adjust the rate back to 1.0.  You can, of course, give them icons/messages, and have them remove themselves after (X) turns, if desired.

Adjust the Element ID and State numbers accordingly.  In the example below, Element ID #3 is Fire and State #30 is Fire Break.  You can check the Element IDs in the Terms tab of the database - Fire, Ice, and Thunder, by default, are 3, 4, and 5.

class Game_Battler  #--------------------------------------------------------------------------  # * Get Element Modifier for Skill/Item  #--------------------------------------------------------------------------  def item_element_rate(user, item)    if item.damage.element_id < 0      rate = user.atk_elements.empty? ? 1.0 : elements_max_rate(user.atk_elements)    else      rate = element_rate(item.damage.element_id)      if rate < 1.0        if (item.damage.element_id == 3 and self.state?(30))          rate = 1.0        end        if (item.damage.element_id == 4 and self.state?(31))          rate = 1.0        end        if (item.damage.element_id == 5 and self.state?(32))          rate = 1.0        end      end    end    return rate  end endOne last thing - I think this idea of "Resistance Breaking" is a cool idea and something I could probably make into a customizable script in the near future.  Since it's your topic that inspired me to think about how to script it, I want to ask you first - would it be alright with you if I made such a script?
 

Kicklash

Warper
Member
Joined
Mar 24, 2012
Messages
4
Reaction score
0
First Language
English
Primarily Uses
Go for it, bro! I'm glad to inspire people to make scripts, and I really appreciate your help! I'll give the script you've put in your post a try, and post how that works out for me.
 

Maliki79

Veteran
Veteran
Joined
Mar 13, 2012
Messages
797
Reaction score
350
First Language
English
Primarily Uses
N/A
Couldn't you just use a conditional in the damage formula to check b.element_rate and add a state if it's less than 1.0?

Then you make the state give the element a 300% damage output and boom!  Instant weakness.  (or so I'm guessing, anyway. :) )
 

Kicklash

Warper
Member
Joined
Mar 24, 2012
Messages
4
Reaction score
0
First Language
English
Primarily Uses
Hey, Wavelength, I got the script you posted to work just fine for me! I honestly can't think of anything to say that could accurately imply how appreciative I am, so, thank you. From the bottom of my heart.
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
Hey, Wavelength, I got the script you posted to work just fine for me! I honestly can't think of anything to say that could accurately imply how appreciative I am, so, thank you. From the bottom of my heart.
You're very welcome.  I'm glad that it worked for you, because your idea of breaking an enemy's resistance for a time is a very, very cool one.  Offhand I think I remember the mechanic in Persona 3, and it added a lot to the strategy of the game.

Look out over the next month or so for a full script, once I get around to figuring out the Attack State elements!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,865
Messages
1,017,059
Members
137,575
Latest member
akekaphol101
Top