Setting states as conditions using Yanfly's Lunatic Damage Script

● ARCHIVED · READ-ONLY
Started by Manofdusk 3 posts View original ↗
  1.  I have yanfly's Lunatic Damage script and I'm trying to figure out how to get it to recognize if the enemy has a state applied.

    ----

     I'm fond of setting passive states to enemies that react to skills differently. For example, certain skills may auto-crit against targets with a certain weakness (set as a state) or may have a separate state applied to them if they have a certain state (for example, you have to be wet before you can be frozen).

     The thing is that I'm using the luck stat directly in the formula to help determine whether or not the state is applied so I need a way to determine whether or not the target has a state on them before the formula applies.

     I've had 2 skills that I've been able to find a workaround for (by actually typing the formula in the damage box and using the NORMAL FORMULA tag). However, this new one is too long for that. What compounds things is that the Lunatic Damage script doesn't work quite like it does in the editor (like I said, I can get the editor to recognize states).

    ----

     here is my script. It's trying to determine whether the target will be frozen:

            when /MagFrozen/i
            value += c = 1+rand(100); d = ((a.luk * 2)- b.mdf);
            if b.state ?(29) ? && if d >= c; b.add_state(30); else; 0; end;

    I'm getting the error: unexpected tINTEGER, expecting keyword_then or ";" or '\n'

     I've also tried it this way:

            when /MagFrozen/i
            value += c = 1+rand(100); d = ((a.luk * 2)- b.mdf);
            if b.state ?(29) ? && if d >= c; b.add_state(30): 0; end;

    I'm pretty sure the error is coming from the 29 in b.state but I'm not sure how else to define it
  2. Well, I've figured out how to detect states using code. Not sure how I figured it out.... bit it's this:

    value += if b.state?(29)? b.add_state(30): 0; end;

    now I have a different problem. I don't want there to be a 100% probability of freezing a wet foe.

    I have this:

    value += c = 1+rand(100); d = ((a.luk * 2)- b.mdf); if d >= c; b.add_state(30); else; 0; end;

    but that doesn't do exactly what I want either (it grants the chance to freeze against non-wet foes)

     what I want is for it to detect that the target is wet and THEN give it a chance to freeze.

     Also, strangely enough, one of the two formulas are applying damage when they shouldn't be. The spell, with just those 2 components should be doing 0 damage. I'm using Yanfly's battle engine so I'm using the Weakpoint system.... but the damage varies quite a bit and really shouldn't be inflicting as much as it is.

     I think it's using the 1+rand(100) as a damage value.
  3.  I've been fiddling with the code and ended up with this:

            when/MagFrozen2/i
            if b.state?(29)?
              $game_variables[8] = ((a.luk * 2)- b.mdf):
              $game_variables[7] = 1+rand(100);
              if $game_variables[8] >= $game_variables[7];
              b.add_state(30); else; total_damage = 0; end;
              end;

     it does more or less what I want it to do.... BUT it inflicts  an insane amount of damage when this particular formula is supposed to inflict 0.

     so why is it inflicting so much damage and how can I get it to inflict 0?