Jump to content
Sign in to follow this  
silverlime

Problem with pinch abilities (Overgrow, Blaze, etc.) and AI

Recommended Posts

Comparing the actual damage multiplier with the one the AI uses, it seems like there's a discrepancy.

 

Actual:

if attacker.hp<=(attacker.totalhp/3).floor
      if (attacker.hasWorkingAbility(:OVERGROW) && isConst?(type,PBTypes,:GRASS)) ||
       (attacker.hasWorkingAbility(:BLAZE) && isConst?(type,PBTypes,:FIRE)) ||
       (attacker.hasWorkingAbility(:TORRENT) && isConst?(type,PBTypes,:WATER)) ||
       (attacker.hasWorkingAbility(:SWARM) && isConst?(type,PBTypes,:BUG))
        atkmult=(atkmult*1.5).round
      end
    elsif $fefieldeffect == 7 && (attacker.hasWorkingAbility(:BLAZE) &&
      isConst?(type,PBTypes,:FIRE))
      atkmult=(atkmult*1.5).round
    elsif $fefieldeffect == 15 && (attacker.hasWorkingAbility(:OVERGROW) &&
      isConst?(type,PBTypes,:GRASS))
      atkmult=(atkmult*1.5).round
    elsif $fefieldeffect == 15 && (attacker.hasWorkingAbility(:SWARM) &&
      isConst?(type,PBTypes,:BUG))
      atkmult=(atkmult*1.5).round
    elsif ($fefieldeffect == 21 || $fefieldeffect == 22) &&
     (attacker.hasWorkingAbility(:TORRENT) && isConst?(type,PBTypes,:WATER))
      atkmult=(atkmult*1.5).round
    elsif $fefieldeffect == 33 && (attacker.hasWorkingAbility(:SWARM) &&
      isConst?(type,PBTypes,:BUG))
      atkmult=(atkmult*1.5).round if $fecounter == 0 || $fecounter == 1
      atkmult=(atkmult*2).round if $fecounter == 2 || $fecounter == 3
      atkmult=(atkmult*3).round if $fecounter == 4
    elsif $fefieldeffect == 33 && (attacker.hasWorkingAbility(:OVERGROW) &&
      isConst?(type,PBTypes,:GRASS))
      case $fecounter
        when 1
          if attacker.hp<=(attacker.totalhp*0.67).floor
            atkmult=(atkmult*1.5).round
          end
        when 2
            atkmult=(atkmult*1.5).round
        when 3
            atkmult=(atkmult*2).round
        when 4
            atkmult=(atkmult*3).round
      end
    end

 

AI:

    # Pinch abilities
    if skill>=PBTrainerAI.mediumSkill
      if attacker.hp<=(attacker.totalhp/3).floor
        if (attacker.hasWorkingAbility(:OVERGROW) && isConst?(type,PBTypes,:GRASS)) ||
           (attacker.hasWorkingAbility(:BLAZE) && isConst?(type,PBTypes,:FIRE)) ||
           (attacker.hasWorkingAbility(:TORRENT) && isConst?(type,PBTypes,:WATER)) ||
           (attacker.hasWorkingAbility(:SWARM) && isConst?(type,PBTypes,:BUG))
          atk=(atk*1.5).round
        end
      end
    end
    if skill>=PBTrainerAI.bestSkill
      if $fefieldeffect == 7 && (attacker.hasWorkingAbility(:BLAZE) &&
        isConst?(type,PBTypes,:FIRE))
        atk=(atk*1.5).round
      elsif $fefieldeffect == 15 && (attacker.hasWorkingAbility(:OVERGROW) &&
        isConst?(type,PBTypes,:GRASS))
        atk=(atk*1.5).round
      elsif $fefieldeffect == 15 && (attacker.hasWorkingAbility(:SWARM) &&
        isConst?(type,PBTypes,:BUG))
        atk=(atk*1.5).round
      elsif ($fefieldeffect == 21 || $fefieldeffect == 22) &&
       (attacker.hasWorkingAbility(:TORRENT) && isConst?(type,PBTypes,:WATER))
        atk=(atk*1.5).round
      elsif $fefieldeffect == 33 && (attacker.hasWorkingAbility(:SWARM) &&
        isConst?(type,PBTypes,:BUG))
        atk=(atk*1.5).round if $fecounter == 0 || $fecounter == 1
        atk=(atk*2).round if $fecounter == 2 || $fecounter == 3
        atk=(atk*3).round if $fecounter == 4
      elsif $fefieldeffect == 33 && (attacker.hasWorkingAbility(:OVERGROW) &&
        isConst?(type,PBTypes,:GRASS))
        case $fecounter
          when 1
            if attacker.hp<=(attacker.totalhp*0.67).floor
              atk=(atk*1.5).round
            end
          when 2
              atk=(atk*1.5).round
          when 3
              atk=(atk*2).round
          when 4
              atk=(atk*3).round
        end
      end
    end    

 

Notice how the AI (at best skill) will think there are 2 damage boosts if the user is at low HP and has a field that activates the ability (in actuality, only 1 damage boost can be applied even if both HP and field conditions are met)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...