[RMVX ACE] QUESTIONS GALORE. CAN I EVEN DO THIS WITHOUT A SCRIPT?

Posts

Pages: 1
I'd have named this something more relevant to the questions themselves, but I have too many questions for me to think of a conclusive title. Anywayyyys
Right, where to start? So basically, I've been trying to create a skill that does normal damage (like, normal attack sorta damage) or just plain low damage if the target doesn't have a certain ailment, but does a lot of damage if the target DOES. So, say I wanted the enemy to take more damage from this specific skill if they were afflicted with a negative status effect like Poison, Blind, Sleep, etc. How would I do this? Ideally, there would be two different damage formulas: one for the attack when the target has no ailment, and one for when the target DOES. I, however, have no idea how to do this. though the different damage formulas thing is cool, I'd be cool with just being able to have the attack have one damage formula, and just have the damage from that formula doubled or tripled with the conditions met.
Like I said, I haven't the slightest idea how to implement this. So I came up with a different idea: how about I give certain ailments like Blind, Stun, and Sleep Evasion penalties, and make the skill in question just be a skill with low accuracy? So you could have a skill that isn't great without the evasion penalty, but with the evasion penalty from certain ailments, the skill's great. The problem is... I'm not sure how to change the skill's accuracy. Now, I'm not talking the skill's Success rate, I'm familiar with that. I set it's success rate to 50%, and to test it out tried using it on a normal enemy, and a sleeping one, and a blinded one. It hit about as many times as you'd expect on a normal enemy, and though I was expecting it to hit the sleeping and blinded enemy every time, due to their evasion being lowered as low as it can go, the skill... still hit only half the time, which leads me to believe that success rate isn't affected by evasion (and presumably accuracy as well). So now I'd like to figure out how to change the skill's accuracy rather than it's success rate, but the only way I see is to change the user of the skill's accuracy, and obviously I don't want the user of the skill to only hit half the time with every attack.
Now, it seems like the latter of these two options would be easier to implement. It seems like something so obvious that I'm actually afraid I'm missing something stupidly obvious that would make this a cinch. But if I knew of that, I wouldn't be asking about this. So, to summarize, I'd like either a skill that does more damage when the enemy has at least one of certain states (like Poison, Paralyze, etc. states of my choosing) applied, OR I;d like a skill with low accuracy that's still affected by evasion, so if an enemy's evasion is set as low as it can go, the enemy will still be hit despite the skill's low accuracy. is there a way to implement either of these? Is a script needed for either of these, because if so I'm not against utilizing them. Also, just to check and make sure, if I want an enemy to get hit more, I most definitely need to lower the Ex-Parameter EVAsion, correct? That's a stupid question, but 'm just making sure.
That's a lot of stuff o.0;
Wait a jiff, I'll try to answer as best as I can... :)

ailment bonus - This one's easy. Just add a conditional check into your damage formula box. Say your base formula is a.atk * 4 - b.def / 2, and the ID of the certain state element is 42:
foo = a.atk * 4 - b.def / 2; b.state?(42) ? foo * 3 : foo
this will triple the damage if the target of the skill has state number 42, and deals the normal damage otherwise.

evasion - This one will likely need some scripting. You'll have to alter how hit and evasion rates are calculated. These should be the responsible methods:
class Game_Battler < Game_BattlerBase
  #--------------------------------------------------------------------------
  # * Calculate Hit Rate of Skill/Item (line 471)
  #--------------------------------------------------------------------------
  def item_hit(user, item)
    rate = item.success_rate * 0.01     # Get success rate
    rate *= user.hit if item.physical?  # Physical attack: Multiply hit rate
    return rate                         # Return calculated hit rate
  end
  #--------------------------------------------------------------------------
  # * Calculate Evasion Rate for Skill/Item
  #--------------------------------------------------------------------------
  def item_eva(user, item)
    return eva if item.physical?    # Return evasion if physical attack
    return mev if item.magical?     # Return magic evasion if magic attack
    return 0
  end
end
Maybe have it so that the hit-rate is influenced by evasion (or vice-versa).
class Game_Battler < Game_BattlerBase
  #--------------------------------------------------------------------------
  # * Calculate Hit Rate of Skill/Item (line 471)
  #--------------------------------------------------------------------------
  def item_hit(user, item)
    rate = item.success_rate * 0.01
    # increase hit rate by (1/eva). (the extra stuff is to make sure you don't get the ZeroDivisionError.
    rate *= user.hit + (1/([eva*100,1].max/100)) if item.physical?
    return rate
  end
  #--------------------------------------------------------------------------
  # * Calculate Evasion Rate for Skill/Item
  #--------------------------------------------------------------------------
  def item_eva(user, item)
    rate = (item.physical? ? eva : (item.magical? ? mev : 0))
    # subtract excess hit rate (if it exceeds 100%) from the evasion rate
    rate -= [item_hit(user, item) - 100, 0].max
    return rate
  end
end
This would effectively increase a skill's hit rate the lower the target's evasion is. The minimum added is 1% (if the target's evasion is 100%), and the maximum is 100% (if the target's evasion is 0%). Then, the excess hit rate is then subtracted to the target's evasion rate to further assure the skill's success. Though this will affect ALL skills not marked as Certain Hit, and might throw off game balance.

I'm sure there are other (better) ways to do the evasion thing...
Thanks a lot! the first option seems to work pretty perfectly. Though, I do have another question on it: how would you implement multiple different states? Say, wanting state 42, 43, 44, and 45 to all increase damage in the same way. I tried changing b.state?(42) to b.state?(2, 3, 5, 6, 7, 8), the desired states, however that just made the skill do no damage whatsoever, for some reason (course, putting just ONE state makes it work fine). ...Man, my knowledge on how to calculate damage formulas in VX Ace is apparently rather basic... So, would I have to put in b.state?(insert state ID here) multiple times, one for each state? Or something else?
Thanks for your help!
It'll have to be restructured for that...

I'm not sure if this is the best way to do it, but you can do a loop so you don't have to type b.state?() over and over again (make ace work for you).
b.states.each {|s| if [42,43,44,45].include?(s.id) then return <new_formula> end }; <base_formula>
What this does is take all states of the target (battler b), and compare each one with the contents of the given list {42,43,44,45} (with square brackets). If it finds a match, it will return <new_formula>. If it doesn't, then it'll keep searching until all states run out. If even then it still hasn't found a match, then it'll return <base_formula>. Well, at least it's supposed to do so...

Just replace <new_formula> and <old_formula> with the corresponding math-y stuff you want to use and it should do the trick.
YES
This works perfectly, thank you!
Pages: 1