The PokéCommunity Forums Fan Games Game Development Scripts, Tutorials & Tools
Essentials Script Gen VII Scripts (Z-Moves, Abilities and Moves,)

Scripts, Tutorials & Tools This forum is for scripts and code, as well as all kinds of tutorials, software, tools and so forth. Remember to give credit!
The thread revival limit does not apply here.

Reply
 
Thread Tools
  #26    
Old November 30th, 2016 (9:20 AM).
Rot8er_ConeX's Avatar
Rot8er_ConeX Rot8er_ConeX is offline
     
    Join Date: May 2015
    Location: The Dissa Region
    Gender: Male
    Posts: 822
    Quote:
    Originally Posted by PIMOC View Post
    When I made burn up (using soak as a base), it seems to work perfectly for arcanine and typhlosion. However, for moltres, there is a problemas. Judging by the description of the move on serebii.net, it was supposed to remove only the fire type, which means moltres would become pure flying. But using my code it becomes "qmark" just like arcanine and typhlosion. Does your code solves that problem? Thanks for your hardwork.
    Yes, my code solves that problem. It only makes it QMark type if both type1 and type2 are Fire type. If one isn't Fire, than it sets the one that is Fire to be the same as the one that isn't. (It also removes Fire as the third type.)
    __________________
    Features of Pokemon Entropy

    The black circular "doodles" in the lower right corner of my avatar are actually my username written in Gallifreyan. Yes I'm a Whovian.
    Reply With Quote
      #27    
    Old November 30th, 2016 (4:04 PM). Edited November 30th, 2016 by Rot8er_ConeX.
    Rot8er_ConeX's Avatar
    Rot8er_ConeX Rot8er_ConeX is offline
       
      Join Date: May 2015
      Location: The Dissa Region
      Gender: Male
      Posts: 822
      Purify
      Code:
      ################################################################################
      # User heals target's status condition
      # If successful, user heals itself by 50% of its max HP.
      ################################################################################
      class PokeBattle_Move_1BB < PokeBattle_Move
        def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
          return -1 if opponent.status==0
          case opponent.status
          when PBStatuses::PARALYSIS
            @battle.pbDisplay(_INTL("{1} was cured of its paralysis.",opponent.pbThis))
          when PBStatuses::SLEEP
            @battle.pbDisplay(_INTL("{1} was woken from its sleep.",opponent.pbThis))
          when PBStatuses::POISON
            @battle.pbDisplay(_INTL("{1} was cured of its poisoning.",opponent.pbThis))
          when PBStatuses::BURN
            @battle.pbDisplay(_INTL("{1} was cured of its burn.",opponent.pbThis))
          when PBStatuses::FROZEN
            @battle.pbDisplay(_INTL("{1} was defrosted.",opponent.pbThis))
          end
          opponent.status=0
          opponent.statusCount=0
          if attacker.effects[PBEffects::HealBlock]>0
            @battle.pbDisplay(_INTL("{1} can't heal because of Heal Block!",attacker.pbThis))
          elsif attacker.hp==attacker.totalhp
            @battle.pbDisplay(_INTL("{1}'s HP is full!",attacker.pbThis))
          else
            attacker.pbRecoverHP(((attacker.totalhp+1)/2).floor,true)
            @battle.pbDisplay(_INTL("{1}'s HP was restored.",attacker.pbThis))
          end
        end
      end




      Shell Trap and Beak Blast are interesting to code. I will be grouping them together.

      1.) The main effect codes. These go in PokeBattle_MoveEffects
      Code:
      ################################################################################
      # Shell Trap
      ################################################################################
      class PokeBattle_Move_193 < PokeBattle_Move
        def pbMoveFailed(attacker,opponent)
          return !attacker.effects[PBEffects::ShellTrap]
        end
      end
      
      ################################################################################
      # (handled elsewhere) If anyone makes contact with the Pokemon while they are
      #    charging this move, they will be inflicted with a burn
      ################################################################################
      class PokeBattle_Move_1BC < PokeBattle_Move
      end
      2.) In PokeBattle_Battler (with the R), search for the following code and add the red stuff below it:
      Code:
              if target.hasWorkingItem(:ROCKYHELMET,true) && !user.isFainted? && 
                  move.function != 0xC1
                PBDebug.log("[#{user.pbThis} hurt by Rocky Helmet]")
                @battle.scene.pbDamageAnimation(user,0)
                user.pbReduceHP((user.totalhp/6).floor)
                @battle.pbDisplay(_INTL("{1} was hurt by the {2}!",user.pbThis,
                   PBItems.getName(target.item)))
              end
              [email protected][target.index][2]
              if movex.function==0x192 && # Shell Trap
                   move.pbisPhysical?(move.type,user,target)
                target.effects[PBEffects::ShellTrap]=true
              end
              if movex.function==0x1BC && # Beak Blast
                   move.isContactMove? && user.pbCanBurn?(false,movex,target)
                user.pbBurn(target)
              end
      3.) In PokeBattle_Battle (without the R), search for the following code and add the red stuff below it:
      Code:
          for i in priority
            if pbChoseMoveFunctionCode?(i.index,0x115) # Focus Punch
              pbCommonAnimation("FocusPunch",i,nil)
              pbDisplay(_INTL("{1} is tightening its focus!",i.pbThis))
            elsif pbChoseMoveFunctionCode?(i.index,0x1BC) # Beak Blast
              pbCommonAnimation("Burn",i,nil)
              pbDisplay(_INTL("{1} started heating up its beak!",i.pbThis))
            end
          end
      4a.) You still need to initialize the Shell Trap effect. In PBEffects, in with all the other variables, add this line:
      Code:
          ShellTrap         = 121
      4b.) In PokeBattle_Battler (with the R), find the function pbInitEffects, add this line:
      Code:
            @effects[PBEffects::ShellTrap]      = false
      4c.) In PokeBattle_Battle (without the R), find the following code and add the red line:
      Code:
            @battlers[i].effects[PBEffects::ShellTrap]=false
            @battlers[i].effects[PBEffects::Flinch]=false
            @battlers[i].effects[PBEffects::FollowMe]=false
            @battlers[i].effects[PBEffects::HelpingHand]=false
            @battlers[i].effects[PBEffects::MagicCoat]=false
            @battlers[i].effects[PBEffects::Snatch]=false
            @battlers[i].effects[PBEffects::Charge]-=1 if @battlers[i].effects[PBEffects::Charge]>0
            @battlers[i].lastHPLost=0
            @battlers[i].lastAttacker=-1
            @battlers[i].effects[PBEffects::Counter]=-1
            @battlers[i].effects[PBEffects::CounterTarget]=-1
            @battlers[i].effects[PBEffects::MirrorCoat]=-1
            @battlers[i].effects[PBEffects::MirrorCoatTarget]=-1
      __________________
      Features of Pokemon Entropy

      The black circular "doodles" in the lower right corner of my avatar are actually my username written in Gallifreyan. Yes I'm a Whovian.
      Reply With Quote
        #28    
      Old November 30th, 2016 (10:41 PM).
      TheJawsOfDeath TheJawsOfDeath is offline
         
        Join Date: Jul 2016
        Gender: Male
        Posts: 6
        Quote:
        Originally Posted by Rot8er_ConeX View Post
        Purify
        Code:
        ################################################################################
        # User heals target's status condition
        # If successful, user heals itself by 50% of its max HP.
        ################################################################################
        class PokeBattle_Move_1BB < PokeBattle_Move
          def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
            return -1 if opponent.status==0
            case opponent.status
            when PBStatuses::PARALYSIS
              @battle.pbDisplay(_INTL("{1} was cured of its paralysis.",opponent.pbThis))
            when PBStatuses::SLEEP
              @battle.pbDisplay(_INTL("{1} was woken from its sleep.",opponent.pbThis))
            when PBStatuses::POISON
              @battle.pbDisplay(_INTL("{1} was cured of its poisoning.",opponent.pbThis))
            when PBStatuses::BURN
              @battle.pbDisplay(_INTL("{1} was cured of its burn.",opponent.pbThis))
            when PBStatuses::FROZEN
              @battle.pbDisplay(_INTL("{1} was defrosted.",opponent.pbThis))
            end
            opponent.status=0
            opponent.statusCount=0
            if attacker.effects[PBEffects::HealBlock]>0
              @battle.pbDisplay(_INTL("{1} can't heal because of Heal Block!",attacker.pbThis))
            elsif attacker.hp==attacker.totalhp
              @battle.pbDisplay(_INTL("{1}'s HP is full!",attacker.pbThis))
            else
              attacker.pbRecoverHP(((attacker.totalhp+1)/2).floor,true)
              @battle.pbDisplay(_INTL("{1}'s HP was restored.",attacker.pbThis))
            end
          end
        end




        Shell Trap and Beak Blast are interesting to code. I will be grouping them together.

        1.) The main effect codes. These go in PokeBattle_MoveEffects
        Code:
        ################################################################################
        # Shell Trap
        ################################################################################
        class PokeBattle_Move_193 < PokeBattle_Move
          def pbMoveFailed(attacker,opponent)
            return !attacker.effects[PBEffects::ShellTrap]
          end
        end
        
        ################################################################################
        # (handled elsewhere) If anyone makes contact with the Pokemon while they are
        #    charging this move, they will be inflicted with a burn
        ################################################################################
        class PokeBattle_Move_1BC < PokeBattle_Move
        end
        2.) In PokeBattle_Battler (with the R), search for the following code and add the red stuff below it:
        Code:
                if target.hasWorkingItem(:ROCKYHELMET,true) && !user.isFainted? && 
                    move.function != 0xC1
                  PBDebug.log("[#{user.pbThis} hurt by Rocky Helmet]")
                  @battle.scene.pbDamageAnimation(user,0)
                  user.pbReduceHP((user.totalhp/6).floor)
                  @battle.pbDisplay(_INTL("{1} was hurt by the {2}!",user.pbThis,
                     PBItems.getName(target.item)))
                end
                [email protected][target.index][2]
                if movex.function==0x192 && # Shell Trap
                     move.pbisPhysical?(move.type,user,target)
                  target.effects[PBEffects::ShellTrap]=true
                end
                if movex.function==0x1BC && # Beak Blast
                     move.isContactMove? && user.pbCanBurn?(false,movex,target)
                  user.pbBurn(target)
                end
        3.) In PokeBattle_Battle (without the R), search for the following code and add the red stuff below it:
        Code:
            for i in priority
              if pbChoseMoveFunctionCode?(i.index,0x115) # Focus Punch
                pbCommonAnimation("FocusPunch",i,nil)
                pbDisplay(_INTL("{1} is tightening its focus!",i.pbThis))
              elsif pbChoseMoveFunctionCode?(i.index,0x1BC) # Beak Blast
                pbCommonAnimation("Burn",i,nil)
                pbDisplay(_INTL("{1} started heating up its beak!",i.pbThis))
              end
            end
        4a.) You still need to initialize the Shell Trap effect. In PBEffects, in with all the other variables, add this line:
        Code:
            ShellTrap         = 121
        4b.) In PokeBattle_Battler (with the R), find the function pbInitEffects, add this line:
        Code:
              @effects[PBEffects::ShellTrap]      = false
        4c.) In PokeBattle_Battle (without the R), find the following code and add the red line:
        Code:
              @battlers[i].effects[PBEffects::ShellTrap]=false
              @battlers[i].effects[PBEffects::Flinch]=false
              @battlers[i].effects[PBEffects::FollowMe]=false
              @battlers[i].effects[PBEffects::HelpingHand]=false
              @battlers[i].effects[PBEffects::MagicCoat]=false
              @battlers[i].effects[PBEffects::Snatch]=false
              @battlers[i].effects[PBEffects::Charge]-=1 if @battlers[i].effects[PBEffects::Charge]>0
              @battlers[i].lastHPLost=0
              @battlers[i].lastAttacker=-1
              @battlers[i].effects[PBEffects::Counter]=-1
              @battlers[i].effects[PBEffects::CounterTarget]=-1
              @battlers[i].effects[PBEffects::MirrorCoat]=-1
              @battlers[i].effects[PBEffects::MirrorCoatTarget]=-1
        Can you help me with Emergency Exit? I'm having trouble with that.
        Reply With Quote
          #29    
        Old November 30th, 2016 (10:53 PM).
        Rot8er_ConeX's Avatar
        Rot8er_ConeX Rot8er_ConeX is offline
           
          Join Date: May 2015
          Location: The Dissa Region
          Gender: Male
          Posts: 822
          Quote:
          Originally Posted by TheJawsOfDeath View Post
          Can you help me with Emergency Exit? I'm having trouble with that.
          1.) Add this function anywhere in PokeBattle_Battler (with the R) :
          Code:
            def pbEffectsOnMoveEnd(move,user,target,damage)
              damage=0 if damage==nil
              if damage>0
                if !target.damagestate.substitute
                  if target.hasWorkingAbility(:WIMPOUT) &&
                      target.hp<target.totalhp/2 && target.hp+damage>target.totalhp/2
                    PBDebug.log("[#{target.pbThis}'s #{PBAbilities.getName(target.ability)} triggered]")
                    choices=[]
                    [email protected](target.index)
                    for i in 0...party.length
                      choices[choices.length]=i if @battle.pbCanSwitchLax?(target.index,i,false)
                    end
                    if choices.length>0
                      newpoke=choices[@battle.pbRandom(choices.length)]
                      target.pbResetForm
                      @battle.pbReplace(target.index,newpoke,false)
                      @battle.pbDisplay(_INTL("{1} was dragged out!",target.pbThis))
                      @battle.pbOnActiveOne(target)
                      target.pbAbilitiesOnSwitchIn(true)
                    elsif [email protected]
                      @battle.decision=3
                    end
                  elsif target.hasWorkingAbility(:EMERGENCYEXIT) &&
                      target.hp<target.totalhp/2 && target.hp+damage>target.totalhp/2
                    PBDebug.log("[#{target.pbThis}'s #{PBAbilities.getName(target.ability)} triggered]")
                    choices=[]
                    [email protected](target.index)
                    for i in 0...party.length
                      choices[choices.length]=i if @battle.pbCanSwitchLax?(target.index,i,false)
                    end
                    if choices.length>0
                      newpoke=choices[@battle.pbRandom(choices.length)]
                      target.pbResetForm
                      @battle.pbReplace(target.index,newpoke,false)
                      @battle.pbDisplay(_INTL("{1} was dragged out!",target.pbThis))
                      @battle.pbOnActiveOne(target)
                      target.pbAbilitiesOnSwitchIn(true)
                    elsif [email protected]
                      @battle.decision=3
                    end
                  end
                end
              end
            end
          (note that the two abilities were programmed as two separate entities when I was under the impression that Emergency Exit had a Baton Pass effect. But nope, EE is literally a direct copy of WO.)

          2.) Search for this code, still in PokeBattle_Battler, and add the red part:
          Code:
                      elsif user.hasWorkingAbility(:STENCH) &&
                            thismove.function != 0x09 && # Thunder Fang
                            thismove.function != 0x0B && # Fire Fang
                            thismove.function != 0x0E && # Ice Fang
                            thismove.function != 0x0F && # flinch-inducing moves
                            thismove.function != 0x10 && # Stomp
                            thismove.function != 0x11 && # Snore
                            thismove.function != 0x12 && # Fake Out
                            thismove.function != 0x78 && # Twister
                            thismove.function != 0xC7    # Sky Attack
                        if @battle.pbRandom(10)==0
                          target.effects[PBEffects::Flinch]=true
                          PBDebug.log("[#{user.pbThis}'s Stench triggered]")
                        end
                      end
                    end
                  end
                end
                pbEffectsOnMoveEnd(thismove,user,target,damage)
                break if user.isFainted?
                break if target.isFainted?
          3.) In PokeBattle_Battle (without the R), find this function and add the red lines of code:
          Code:
            def pbCanRun?(idxPokemon)
              return false if @opponent
              [email protected][idxPokemon]
              return true if thispkmn.hasWorkingItem(:SMOKEBALL)
              return true if thispkmn.hasWorkingAbility(:RUNAWAY)
              return true if thispkmn.hasWorkingAbility(:EMERGENCYEXIT) && thispkmn.hp<=thispkmn.totalhp/2
              return true if thispkmn.hasWorkingAbility(:WIMPOUT) && thispkmn.hp<=thispkmn.totalhp/2
              return pbCanSwitch?(idxPokemon,-1,false)
            end
          4.) Still in PokeBattle_Battle, find this line of code - should be in the function just below the one in the previous step - and add the red.
          Code:
              if thispkmn.hasWorkingAbility(:RUNAWAY)
                if duringBattle
                  pbDisplayPaused(_INTL("Got away safely!"))
                else
                  pbDisplayEffect(thispkmn)
                  pbDisplayPaused(_INTL("{1} fled using Run Away!",thispkmn.pbThis))
                end
                @decision=3
                return 1
              end
              if thispkmn.hasWorkingAbility(:WIMPOUT) && thispkmn.hp<=thispkmn.totalhp/2
                if duringBattle
                  pbDisplayPaused(_INTL("Got away safely!"))
                else
                  pbDisplayEffect(thispkmn)
                  pbDisplayPaused(_INTL("{1} Wimped Out!",thispkmn.pbThis))
                end
                @decision=3
                return 1
              end
              if thispkmn.hasWorkingAbility(:EMERGENCYEXIT) && thispkmn.hp<=thispkmn.totalhp/2
                if duringBattle
                  pbDisplayPaused(_INTL("Got away safely!"))
                else
                  pbDisplayEffect(thispkmn)
                  pbDisplayPaused(_INTL("{1} took an Emergency Exit!",thispkmn.pbThis))
                end
                @decision=3
                return 1
              end
          __________________
          Features of Pokemon Entropy

          The black circular "doodles" in the lower right corner of my avatar are actually my username written in Gallifreyan. Yes I'm a Whovian.
          Reply With Quote
            #30    
          Old November 30th, 2016 (11:09 PM).
          TheJawsOfDeath TheJawsOfDeath is offline
             
            Join Date: Jul 2016
            Gender: Male
            Posts: 6
            Quote:
            Originally Posted by Rot8er_ConeX View Post
            1.) Add this function anywhere in PokeBattle_Battler (with the R) :
            Code:
              def pbEffectsOnMoveEnd(move,user,target,damage)
                damage=0 if damage==nil
                if damage>0
                  if !target.damagestate.substitute
                    if target.hasWorkingAbility(:WIMPOUT) &&
                        target.hp<target.totalhp/2 && target.hp+damage>target.totalhp/2
                      PBDebug.log("[#{target.pbThis}'s #{PBAbilities.getName(target.ability)} triggered]")
                      choices=[]
                      [email protected](target.index)
                      for i in 0...party.length
                        choices[choices.length]=i if @battle.pbCanSwitchLax?(target.index,i,false)
                      end
                      if choices.length>0
                        newpoke=choices[@battle.pbRandom(choices.length)]
                        target.pbResetForm
                        @battle.pbReplace(target.index,newpoke,false)
                        @battle.pbDisplay(_INTL("{1} was dragged out!",target.pbThis))
                        @battle.pbOnActiveOne(target)
                        target.pbAbilitiesOnSwitchIn(true)
                      elsif [email protected]
                        @battle.decision=3
                      end
                    elsif target.hasWorkingAbility(:EMERGENCYEXIT) &&
                        target.hp<target.totalhp/2 && target.hp+damage>target.totalhp/2
                      PBDebug.log("[#{target.pbThis}'s #{PBAbilities.getName(target.ability)} triggered]")
                      choices=[]
                      [email protected](target.index)
                      for i in 0...party.length
                        choices[choices.length]=i if @battle.pbCanSwitchLax?(target.index,i,false)
                      end
                      if choices.length>0
                        newpoke=choices[@battle.pbRandom(choices.length)]
                        target.pbResetForm
                        @battle.pbReplace(target.index,newpoke,false)
                        @battle.pbDisplay(_INTL("{1} was dragged out!",target.pbThis))
                        @battle.pbOnActiveOne(target)
                        target.pbAbilitiesOnSwitchIn(true)
                      elsif [email protected]
                        @battle.decision=3
                      end
                    end
                  end
                end
              end
            (note that the two abilities were programmed as two separate entities when I was under the impression that Emergency Exit had a Baton Pass effect. But nope, EE is literally a direct copy of WO.)

            2.) Search for this code, still in PokeBattle_Battler, and add the red part:
            Code:
                        elsif user.hasWorkingAbility(:STENCH) &&
                              thismove.function != 0x09 && # Thunder Fang
                              thismove.function != 0x0B && # Fire Fang
                              thismove.function != 0x0E && # Ice Fang
                              thismove.function != 0x0F && # flinch-inducing moves
                              thismove.function != 0x10 && # Stomp
                              thismove.function != 0x11 && # Snore
                              thismove.function != 0x12 && # Fake Out
                              thismove.function != 0x78 && # Twister
                              thismove.function != 0xC7    # Sky Attack
                          if @battle.pbRandom(10)==0
                            target.effects[PBEffects::Flinch]=true
                            PBDebug.log("[#{user.pbThis}'s Stench triggered]")
                          end
                        end
                      end
                    end
                  end
                  pbEffectsOnMoveEnd(thismove,user,target,damage)
                  break if user.isFainted?
                  break if target.isFainted?
            3.) In PokeBattle_Battle (without the R), find this function and add the red lines of code:
            Code:
              def pbCanRun?(idxPokemon)
                return false if @opponent
                [email protected][idxPokemon]
                return true if thispkmn.hasWorkingItem(:SMOKEBALL)
                return true if thispkmn.hasWorkingAbility(:RUNAWAY)
                return true if thispkmn.hasWorkingAbility(:EMERGENCYEXIT) && thispkmn.hp<=thispkmn.totalhp/2
                return true if thispkmn.hasWorkingAbility(:WIMPOUT) && thispkmn.hp<=thispkmn.totalhp/2
                return pbCanSwitch?(idxPokemon,-1,false)
              end
            4.) Still in PokeBattle_Battle, find this line of code - should be in the function just below the one in the previous step - and add the red.
            Code:
                if thispkmn.hasWorkingAbility(:RUNAWAY)
                  if duringBattle
                    pbDisplayPaused(_INTL("Got away safely!"))
                  else
                    pbDisplayEffect(thispkmn)
                    pbDisplayPaused(_INTL("{1} fled using Run Away!",thispkmn.pbThis))
                  end
                  @decision=3
                  return 1
                end
                if thispkmn.hasWorkingAbility(:WIMPOUT) && thispkmn.hp<=thispkmn.totalhp/2
                  if duringBattle
                    pbDisplayPaused(_INTL("Got away safely!"))
                  else
                    pbDisplayEffect(thispkmn)
                    pbDisplayPaused(_INTL("{1} Wimped Out!",thispkmn.pbThis))
                  end
                  @decision=3
                  return 1
                end
                if thispkmn.hasWorkingAbility(:EMERGENCYEXIT) && thispkmn.hp<=thispkmn.totalhp/2
                  if duringBattle
                    pbDisplayPaused(_INTL("Got away safely!"))
                  else
                    pbDisplayEffect(thispkmn)
                    pbDisplayPaused(_INTL("{1} took an Emergency Exit!",thispkmn.pbThis))
                  end
                  @decision=3
                  return 1
                end
            break if user.isFainted?
            break if target.isFainted?

            This part is missing under the stench part.

            Edit. Nvm found it but for some reason the pokemon that comes in gets to attack.
            Reply With Quote
              #31    
            Old November 30th, 2016 (11:27 PM).
            Rot8er_ConeX's Avatar
            Rot8er_ConeX Rot8er_ConeX is offline
               
              Join Date: May 2015
              Location: The Dissa Region
              Gender: Male
              Posts: 822
              Quote:
              Originally Posted by TheJawsOfDeath View Post
              break if user.isFainted?
              break if target.isFainted?

              This part is missing under the stench part.

              Edit. Nvm found it but for some reason the pokemon that comes in gets to attack.
              Fixing that requires an effect that Maruno added in v16 that I don't know off the top of my head.
              __________________
              Features of Pokemon Entropy

              The black circular "doodles" in the lower right corner of my avatar are actually my username written in Gallifreyan. Yes I'm a Whovian.
              Reply With Quote
                #32    
              Old December 1st, 2016 (9:02 AM).
              PIMOC PIMOC is offline
                 
                Join Date: Jul 2016
                Gender: Male
                Posts: 15
                Last question, I swear! I ended up creating a Laser Focus using Focus Energy and Lock-on as a base, but I noticed your code is way more simple. However, when I was creating mine, I remember that I had to modify some section (battler or battle) in order to subtract -1 on "Laser Focus" effect at the start/end of each round in battle. Otherwise, moves would land critical hits on EVERY turn. I haven't tried your code, but in case there are other people using it, does he works just like it is or it requires that modification as well?
                Reply With Quote
                  #33    
                Old December 2nd, 2016 (10:02 AM). Edited December 2nd, 2016 by Mutant Yoshi.
                Mutant Yoshi Mutant Yoshi is offline
                   
                  Join Date: May 2014
                  Gender: Male
                  Nature: Timid
                  Posts: 150
                  Just tested Wimp Out on Version 16. It works, but not as intended. When battling a wild Ekans, the Pokemon with Wimp Out ended up switching out rather than running away from the battle. Unless that only happens with wild Pokemon who have Wimp Out.

                  Edit: Beak Blast and Shell Trap don't exactly work in 16.2 either. When using Beak Blast in battle, it just skips the move entirely. Also, whenever a Pokemon takes damage after switching out, this error pops up:
                  Code:
                  Exception: NoMethodError
                  Message: undefined method `function' for nil:NilClass
                  PokeBattle_Battler:1530:in `pbEffectsOnDealingDamage'
                  PokeBattle_Battler:3160:in `pbProcessMoveAgainstTarget'
                  PokeBattle_Battler:3079:in `each'
                  PokeBattle_Battler:3079:in `pbProcessMoveAgainstTarget'
                  PokeBattle_Battler:3604:in `pbUseMove'
                  PokeBattle_Battler:3584:in `loop'
                  PokeBattle_Battler:3607:in `pbUseMove'
                  PokeBattle_Battler:3805:in `pbProcessTurn'
                  PokeBattle_Battler:3804:in `logonerr'
                  PokeBattle_Battler:3804:in `pbProcessTurn'
                  Reply With Quote
                    #34    
                  Old December 3rd, 2016 (10:08 AM).
                  BlackOutG5's Avatar
                  BlackOutG5 BlackOutG5 is offline
                     
                    Join Date: Jul 2015
                    Gender: Male
                    Nature: Bold
                    Posts: 77
                    Quote:
                    Originally Posted by Rot8er_ConeX View Post
                    Purify
                    Code:
                    ################################################################################
                    # User heals target's status condition
                    # If successful, user heals itself by 50% of its max HP.
                    ################################################################################
                    class PokeBattle_Move_1BB < PokeBattle_Move
                      def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
                        return -1 if opponent.status==0
                        case opponent.status
                        when PBStatuses::PARALYSIS
                          @battle.pbDisplay(_INTL("{1} was cured of its paralysis.",opponent.pbThis))
                        when PBStatuses::SLEEP
                          @battle.pbDisplay(_INTL("{1} was woken from its sleep.",opponent.pbThis))
                        when PBStatuses::POISON
                          @battle.pbDisplay(_INTL("{1} was cured of its poisoning.",opponent.pbThis))
                        when PBStatuses::BURN
                          @battle.pbDisplay(_INTL("{1} was cured of its burn.",opponent.pbThis))
                        when PBStatuses::FROZEN
                          @battle.pbDisplay(_INTL("{1} was defrosted.",opponent.pbThis))
                        end
                        opponent.status=0
                        opponent.statusCount=0
                        if attacker.effects[PBEffects::HealBlock]>0
                          @battle.pbDisplay(_INTL("{1} can't heal because of Heal Block!",attacker.pbThis))
                        elsif attacker.hp==attacker.totalhp
                          @battle.pbDisplay(_INTL("{1}'s HP is full!",attacker.pbThis))
                        else
                          attacker.pbRecoverHP(((attacker.totalhp+1)/2).floor,true)
                          @battle.pbDisplay(_INTL("{1}'s HP was restored.",attacker.pbThis))
                        end
                      end
                    end




                    Shell Trap and Beak Blast are interesting to code. I will be grouping them together.

                    1.) The main effect codes. These go in PokeBattle_MoveEffects
                    Code:
                    ################################################################################
                    # Shell Trap
                    ################################################################################
                    class PokeBattle_Move_193 < PokeBattle_Move
                      def pbMoveFailed(attacker,opponent)
                        return !attacker.effects[PBEffects::ShellTrap]
                      end
                    end
                    
                    ################################################################################
                    # (handled elsewhere) If anyone makes contact with the Pokemon while they are
                    #    charging this move, they will be inflicted with a burn
                    ################################################################################
                    class PokeBattle_Move_1BC < PokeBattle_Move
                    end
                    2.) In PokeBattle_Battler (with the R), search for the following code and add the red stuff below it:
                    Code:
                            if target.hasWorkingItem(:ROCKYHELMET,true) && !user.isFainted? && 
                                move.function != 0xC1
                              PBDebug.log("[#{user.pbThis} hurt by Rocky Helmet]")
                              @battle.scene.pbDamageAnimation(user,0)
                              user.pbReduceHP((user.totalhp/6).floor)
                              @battle.pbDisplay(_INTL("{1} was hurt by the {2}!",user.pbThis,
                                 PBItems.getName(target.item)))
                            end
                            [email protected][target.index][2]
                            if movex.function==0x192 && # Shell Trap
                                 move.pbisPhysical?(move.type,user,target)
                              target.effects[PBEffects::ShellTrap]=true
                            end
                            if movex.function==0x1BC && # Beak Blast
                                 move.isContactMove? && user.pbCanBurn?(false,movex,target)
                              user.pbBurn(target)
                            end
                    3.) In PokeBattle_Battle (without the R), search for the following code and add the red stuff below it:
                    Code:
                        for i in priority
                          if pbChoseMoveFunctionCode?(i.index,0x115) # Focus Punch
                            pbCommonAnimation("FocusPunch",i,nil)
                            pbDisplay(_INTL("{1} is tightening its focus!",i.pbThis))
                          elsif pbChoseMoveFunctionCode?(i.index,0x1BC) # Beak Blast
                            pbCommonAnimation("Burn",i,nil)
                            pbDisplay(_INTL("{1} started heating up its beak!",i.pbThis))
                          end
                        end
                    4a.) You still need to initialize the Shell Trap effect. In PBEffects, in with all the other variables, add this line:
                    Code:
                        ShellTrap         = 121
                    4b.) In PokeBattle_Battler (with the R), find the function pbInitEffects, add this line:
                    Code:
                          @effects[PBEffects::ShellTrap]      = false
                    4c.) In PokeBattle_Battle (without the R), find the following code and add the red line:
                    Code:
                          @battlers[i].effects[PBEffects::ShellTrap]=false
                          @battlers[i].effects[PBEffects::Flinch]=false
                          @battlers[i].effects[PBEffects::FollowMe]=false
                          @battlers[i].effects[PBEffects::HelpingHand]=false
                          @battlers[i].effects[PBEffects::MagicCoat]=false
                          @battlers[i].effects[PBEffects::Snatch]=false
                          @battlers[i].effects[PBEffects::Charge]-=1 if @battlers[i].effects[PBEffects::Charge]>0
                          @battlers[i].lastHPLost=0
                          @battlers[i].lastAttacker=-1
                          @battlers[i].effects[PBEffects::Counter]=-1
                          @battlers[i].effects[PBEffects::CounterTarget]=-1
                          @battlers[i].effects[PBEffects::MirrorCoat]=-1
                          @battlers[i].effects[PBEffects::MirrorCoatTarget]=-1
                    Why set-up Shell trap that way when it can easily be a counter?
                    For example: In the PBS set it up as 01 instead of 00 for No Target,

                    Under the Blast Beak message
                    Code:
                    elsif pbChoseMoveFunctionCode?(i.index,0x1AE) # Shell Trap
                            pbDisplay(_INTL("{1} set up a Shell-Trap!",i.pbThis))
                    Then search for opponent.effects[PBEffects::CounterTarget]=attacker.index and under add opponent.effects[PBEffects::ShellTrap]=attacker.index
                    and in PBEffects have it modified like Counter. Then for the actualy script function.

                    Code:
                    ################################################################################
                    # Counters a physical move used against the user this round, with an explosion.
                    ################################################################################
                    class PokeBattle_Move_1AE < PokeBattle_Move
                      def pbAddTarget(targets,attacker)
                        if attacker.effects[PBEffects::ShellTrap]>=0 &&
                           attacker.pbIsOpposing?(attacker.effects[PBEffects::ShellTrap])
                          if !attacker.pbAddTarget(targets,@battle.battlers[attacker.effects[PBEffects::ShellTrap]])
                            attacker.pbRandomTarget(targets)
                          end
                        end
                      end
                    
                      def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
                        if attacker.effects[PBEffects::Counter]<=0 || !opponent
                          @battle.pbDisplay(_INTL("Shell Trap failed!"))
                          return -1
                        end
                        ret=pbEffectFixedDamage(150,attacker,opponent,hitnum,alltargets,showanimation)
                        return ret
                      end
                    end
                    Reply With Quote
                      #35    
                    Old December 3rd, 2016 (6:48 PM).
                    TheShinyMew's Avatar
                    TheShinyMew TheShinyMew is offline
                    Ravioli ravioli, give me the formuoli.
                       
                      Join Date: May 2010
                      Location: Unknown
                      Age: 28
                      Gender: Female
                      Nature: Hardy
                      Posts: 110
                      You do not have to use Soak as a base. You have to use Roost as a base.
                      Here:
                      Code:
                      ################################################################################
                      # User attacks, and its Fire type is ignored for attacks used against it.
                      # (Burn Up)
                      ################################################################################
                      class PokeBattle_Move_169 < PokeBattle_Move
                        def pbEffectAfterHit(attacker,opponent,turneffects)
                          if !opponent.isFainted? && opponent.damagestate.calcdamage>0 &&
                             !opponent.damagestate.substitute
                            attacker.effects[PBEffects::BurnUp]=true
                          end
                        end
                      end
                      Add the BurnUp effect first in PBEffects, then in PokeBattle_Battler, put "@effects[PBEffects::BurnUp] = false" under "@effects[PBEffects::Roost] = false"

                      In PokeBattle_Move, in the def pbTypeModifier put this code after the Roost effect.
                      Code:
                          # Burn Up
                          if isConst?(otype1,PBTypes,:FIRE) && opponent.effects[PBEffects::BurnUp]
                            if isConst?(otype2,PBTypes,:FIRE) && isConst?(otype3,PBTypes,:FIRE)
                              otype1=getConst(PBTypes,:NORMAL) || 0
                            else
                              otype1=otype2
                            end
                          end
                          if isConst?(otype2,PBTypes,:FIRE) && opponent.effects[PBEffects::BurnUp]
                            otype2=otype1
                          end
                      I'm guarantee that you can use Roost as a base, not Soak!
                      __________________

                      Necrozma is my ultimate savior.
                      Reply With Quote
                        #36    
                      Old December 4th, 2016 (1:48 PM).
                      PIMOC PIMOC is offline
                         
                        Join Date: Jul 2016
                        Gender: Male
                        Posts: 15
                        Quote:
                        Originally Posted by TheShinyMew View Post
                        You do not have to use Soak as a base. You have to use Roost as a base.
                        Here:
                        Code:
                        ################################################################################
                        # User attacks, and its Fire type is ignored for attacks used against it.
                        # (Burn Up)
                        ################################################################################
                        class PokeBattle_Move_169 < PokeBattle_Move
                          def pbEffectAfterHit(attacker,opponent,turneffects)
                            if !opponent.isFainted? && opponent.damagestate.calcdamage>0 &&
                               !opponent.damagestate.substitute
                              attacker.effects[PBEffects::BurnUp]=true
                            end
                          end
                        end
                        Add the BurnUp effect first in PBEffects, then in PokeBattle_Battler, put "@effects[PBEffects::BurnUp] = false" under "@effects[PBEffects::Roost] = false"

                        In PokeBattle_Move, in the def pbTypeModifier put this code after the Roost effect.
                        Code:
                            # Burn Up
                            if isConst?(otype1,PBTypes,:FIRE) && opponent.effects[PBEffects::BurnUp]
                              if isConst?(otype2,PBTypes,:FIRE) && isConst?(otype3,PBTypes,:FIRE)
                                otype1=getConst(PBTypes,:NORMAL) || 0
                              else
                                otype1=otype2
                              end
                            end
                            if isConst?(otype2,PBTypes,:FIRE) && opponent.effects[PBEffects::BurnUp]
                              otype2=otype1
                            end
                        I'm guarantee that you can use Roost as a base, not Soak!
                        Thanks for the reply! I had forgotten completely about roost. Your code is miles better than mine, no doubt about it. But, just for the record, it seems burn up changes the user type to "???" And not to "Normal". I suppose you have to put "QMARKS" instead of "NORMAL" in your code.
                        Reply With Quote
                          #37    
                        Old December 5th, 2016 (9:21 PM).
                        TheShinyMew's Avatar
                        TheShinyMew TheShinyMew is offline
                        Ravioli ravioli, give me the formuoli.
                           
                          Join Date: May 2010
                          Location: Unknown
                          Age: 28
                          Gender: Female
                          Nature: Hardy
                          Posts: 110
                          Yes, change QMARKS to NORMAL. It'll be great to have one.
                          __________________

                          Necrozma is my ultimate savior.
                          Reply With Quote
                            #38    
                          Old December 6th, 2016 (1:15 PM).
                          Rot8er_ConeX's Avatar
                          Rot8er_ConeX Rot8er_ConeX is offline
                             
                            Join Date: May 2015
                            Location: The Dissa Region
                            Gender: Male
                            Posts: 822
                            There's no need to base it on Roost. Just change the type in the effect code. Unlike Roost, Burn Up's type change lasts the entire battle until you switch out.
                            __________________
                            Features of Pokemon Entropy

                            The black circular "doodles" in the lower right corner of my avatar are actually my username written in Gallifreyan. Yes I'm a Whovian.
                            Reply With Quote
                              #39    
                            Old December 9th, 2016 (6:43 PM).
                            Maicerochico Maicerochico is offline
                               
                              Join Date: Feb 2016
                              Gender: Male
                              Posts: 54
                              Has anybody figured out how to code the following abilities?

                              - the terrain Surges
                              - Dazzling
                              - Stamina
                              - Triage
                              - Merciless

                              Thanks.
                              Reply With Quote
                                #40    
                              Old December 9th, 2016 (9:52 PM).
                              Rot8er_ConeX's Avatar
                              Rot8er_ConeX Rot8er_ConeX is offline
                                 
                                Join Date: May 2015
                                Location: The Dissa Region
                                Gender: Male
                                Posts: 822
                                Quote:
                                Originally Posted by Maicerochico View Post
                                Has anybody figured out how to code the following abilities?

                                - the terrain Surges
                                - Dazzling
                                - Stamina
                                - Triage
                                - Merciless

                                Thanks.
                                Terrain Surges - Includes the Terrain Seeds. Assumes that you have already created a PsychicTerrain effect:
                                Code:
                                      if self.hasWorkingItem(:ELECTRICSEED) && !self.pbTooHigh?(PBStats::DEFENSE) &&
                                            @battle.field.effects[PBEffects::ElectricTerrain]>0
                                        pbIncreaseStatBasic(PBStats::DEFENSE,1)
                                        @battle.pbDisplay(_INTL("{1}'s {2} boosted its Defense!",
                                              pbThis,PBItems.getName(@item)))
                                      end
                                      if self.hasWorkingItem(:GRASSYSEED) && !self.pbTooHigh?(PBStats::DEFENSE) &&
                                            @battle.field.effects[PBEffects::GrassyTerrain]>0
                                        pbIncreaseStatBasic(PBStats::DEFENSE,1)
                                        @battle.pbDisplay(_INTL("{1}'s {2} boosted its Defense!",
                                              pbThis,PBItems.getName(@item)))
                                      end
                                      if self.hasWorkingItem(:PSYCHICSEED) && !self.pbTooHigh?(PBStats::SPDEF) &&
                                            @battle.field.effects[PBEffects::PsychicTerrain]>0
                                        pbIncreaseStatBasic(PBStats::SPDEF,1)
                                        @battle.pbDisplay(_INTL("{1}'s {2} boosted its Special Defense!",
                                              pbThis,PBItems.getName(@item)))
                                      end
                                      if self.hasWorkingItem(:MISTYSEED) && !self.pbTooHigh?(PBStats::SPDEF) &&
                                            @battle.field.effects[PBEffects::MistyTerrain]>0
                                        pbIncreaseStatBasic(PBStats::SPDEF,1)
                                        @battle.pbDisplay(_INTL("{1}'s {2} boosted its Special Defense!",
                                              pbThis,PBItems.getName(@item)))
                                      end
                                      # Surge abilities
                                      if self.hasWorkingAbility(:ELECTRICSURGE) && @battle.field.effects[PBEffects::ElectricTerrain]<=0
                                        @battle.field.effects[PBEffects::ElectricTerrain]=5
                                        @battle.field.effects[PBEffects::ElectricTerrain]=8 if self.hasWorkingItem(:TERRAINEXTENDER)
                                       # @battle.pbDisplayEffect(self,false)
                                       # @battle.pbHideEffect(self)
                                        @battle.pbDisplay(_INTL("An electric current runs across the battlefield!"))
                                        PBDebug.log("[#{pbThis}: Elekimaker made Electric Terrain]") # Kept Japanese name in Debug log
                                        for i in 0...4
                                          [email protected][i]
                                          if user.hasWorkingItem(:ELECTRICSEED) && !user.pbTooHigh?(PBStats::DEFENSE)
                                            user.pbIncreaseStatBasic(PBStats::DEFENSE,1)
                                            @battle.pbDisplay(_INTL("{1}'s {2} boosted its Defense!",
                                                 user.pbThis,PBItems.getName(user.item)))
                                          end
                                        end
                                      end
                                      if self.hasWorkingAbility(:PSYCHICSURGE) && @battle.field.effects[PBEffects::PsychicTerrain]<=0
                                        @battle.field.effects[PBEffects::PsychicTerrain]=5
                                        @battle.field.effects[PBEffects::PsychicTerrain]=8 if self.hasWorkingItem(:TERRAINEXTENDER)
                                       # @battle.pbDisplayEffect(self,false)
                                       # @battle.pbHideEffect(self)
                                        @battle.pbDisplay(_INTL("The battlefield got weird!"))
                                        PBDebug.log("[#{pbThis}: Psychic Surge made Psychic Terrain]")
                                        for i in 0...4
                                          [email protected][i]
                                          if user.hasWorkingItem(:PSYCHICSEED) && !user.pbTooHigh?(PBStats::SPDEF)
                                            user.pbIncreaseStatBasic(PBStats::SPDEF,1)
                                            @battle.pbDisplay(_INTL("{1}'s {2} boosted its Special Defense!",
                                                 user.pbThis,PBItems.getName(user.item)))
                                          end
                                        end
                                      end
                                      if self.hasWorkingAbility(:GRASSYSURGE) && @battle.field.effects[PBEffects::GrassyTerrain]<=0
                                        @battle.field.effects[PBEffects::GrassyTerrain]=5
                                        @battle.field.effects[PBEffects::GrassyTerrain]=8 if self.hasWorkingItem(:TERRAINEXTENDER)
                                       # @battle.pbDisplayEffect(self,false)
                                       # @battle.pbHideEffect(self)
                                        @battle.pbDisplay(_INTL("Grass grew to cover the battlefield!"))
                                        PBDebug.log("[#{pbThis}: Grassy Surge made Grassy Terrain]")
                                        for i in 0...4
                                          [email protected][i]
                                          if user.hasWorkingItem(:GRASSYSEED) && !user.pbTooHigh?(PBStats::DEFENSE)
                                            user.pbIncreaseStatBasic(PBStats::DEFENSE,1)
                                            @battle.pbDisplay(_INTL("{1}'s {2} boosted its Defense!",
                                                 user.pbThis,PBItems.getName(user.item)))
                                          end
                                        end
                                      end
                                      if self.hasWorkingAbility(:MISTYSURGE) && @battle.field.effects[PBEffects::MistyTerrain]<=0
                                        @battle.field.effects[PBEffects::MistyTerrain]=5
                                        @battle.field.effects[PBEffects::MistyTerrain]=8 if self.hasWorkingItem(:TERRAINEXTENDER)
                                       # @battle.pbDisplayEffect(self,false)
                                       # @battle.pbHideEffect(self)
                                        @battle.pbDisplay(_INTL("Mist swirls around the battlefield!"))
                                        PBDebug.log("[#{pbThis}: Misty Surge made Misty Terrain]")
                                        for i in 0...4
                                          [email protected][i]
                                          if user.hasWorkingItem(:MISTYSEED) && !user.pbTooHigh?(PBStats::SPDEF)
                                            user.pbIncreaseStatBasic(PBStats::SPDEF,1)
                                            @battle.pbDisplay(_INTL("{1}'s {2} boosted its Special Defense!",
                                                 user.pbThis,PBItems.getName(user.item)))
                                          end
                                        end
                                      end
                                Add this just above the Pressure message, in PokeBattle_Battler (with the R).


                                Stamina
                                Code:
                                        if target.hasWorkingAbility(:STAMINA)
                                          if target.pbCanIncreaseStatStage?(PBStats::DEFENSE)
                                            @battle.pbDisplayEffect(target)
                                            target.pbIncreaseStatBasic(PBStats::DEFENSE,1)
                                          end
                                          PBDebug.log("[#{target.pbThis}'s #{PBAbilities.getName(target.ability)} triggered]")
                                          @battle.pbDisplay(_INTL("{1}'s {2} raised its Defense!",target.pbThis,
                                                PBAbilities.getName(target.ability)))
                                        end
                                        if target.hasWorkingAbility(:BERSERK) &&
                                            target.hp+damage>target.totalhp/2 &&
                                            target.hp<target.totalhp/2
                                          if target.pbCanIncreaseStatStage?(PBStats::SPATK)
                                            @battle.pbDisplayEffect(target)
                                            target.pbIncreaseStatBasic(PBStats::SPATK,1)
                                          end
                                          PBDebug.log("[#{target.pbThis}'s #{PBAbilities.getName(target.ability)} triggered]")
                                          target.effects[PBEffects::Berserk]==true
                                          @battle.pbDisplay(_INTL("{1}'s {2} raised its Special Attack!",target.pbThis,
                                                PBAbilities.getName(target.ability)))
                                        end
                                Add that just above the Cursed Body effects, in PokeBattle_Battle (without the R)


                                Triage:
                                Add this above the code for type effectiveness, found in PokeBattle_Move:
                                Code:
                                  def isTriageBoosted?
                                    healingfunctions=[0x0D5,0x0D6,0x0D7,0x0D8,0x0D9,0x0DD,0x0DE,0x114,0x138,
                                                      0x171,0x179,0x1A3,0x1B5,0x1BB,0x1B4,0x0E3,0x0E4,0x0DF]
                                    return healingfunctions.include?(@function)
                                  end
                                Add this above the code for Prankster, found in PokeBattle_Battle (without the R) :
                                Code:
                                        pri+=3 if @battlers[i].hasWorkingAbility(:TRIAGE) &&
                                                  @choices[i][2].isTriageBoosted?

                                Merciless
                                In PokeBattle_Move, the function "pbIsCritical?" looks like this. Add the red line:
                                Code:
                                  def pbIsCritical?(attacker,opponent)
                                    return false if opponent.hasWorkingAbility(:SHELLARMOR) && !attacker.hasBypassingAbility
                                    return false if opponent.pbOwnSide.effects[PBEffects::LuckyChant]>0
                                    return true if @function==0xA0 # Frost Breath
                                    return true if attacker.hasWorkingAbility(:MERCILESS) && opponent.status==PBStatus::POISON
                                    return true if attacker.effects[PBEffects::LaserFocus]>0
                                    c=0
                                    ratios=[16,8,2,1]
                                    c+=attacker.effects[PBEffects::FocusEnergy]
                                    c+=1 if hasHighCriticalRate?
                                    c+=1 if attacker.hasWorkingAbility(:SUPERLUCK)
                                    if attacker.hasWorkingItem(:STICK) &&
                                       isConst?(attacker.species,PBSpecies,:FARFETCHD)
                                      c+=2
                                    end
                                    if attacker.hasWorkingItem(:LUCKYPUNCH) &&
                                       isConst?(attacker.species,PBSpecies,:CHANSEY)
                                      c+=2
                                    end
                                    c+=1 if attacker.hasWorkingItem(:RAZORCLAW)
                                    c+=1 if attacker.hasWorkingItem(:SCOPELENS)
                                    c=3 if c>3
                                    return @battle.pbRandom(ratios[c])==0
                                  end
                                __________________
                                Features of Pokemon Entropy

                                The black circular "doodles" in the lower right corner of my avatar are actually my username written in Gallifreyan. Yes I'm a Whovian.
                                Reply With Quote
                                  #41    
                                Old December 10th, 2016 (8:55 AM).
                                Maicerochico Maicerochico is offline
                                   
                                  Join Date: Feb 2016
                                  Gender: Male
                                  Posts: 54
                                  Much appreciated. :-)

                                  I've not yet figured out how to add Psychic Terrain. How would I do that?
                                  Reply With Quote
                                    #42    
                                  Old December 10th, 2016 (11:17 AM).
                                  Maicerochico Maicerochico is offline
                                     
                                    Join Date: Feb 2016
                                    Gender: Male
                                    Posts: 54
                                    Okay, so I tested Merciless on clean Essentials V16, and I get these errors:

                                    (Merciless script pasted on line 534, under Lucky Chant in PokeBattle_Move.)

                                    ---------------------------
                                    Pokemon Essentials
                                    ---------------------------
                                    Exception: NoMethodError

                                    Message: private method `gsub' called for true:TrueClass

                                    DrawText:215:in `toUnformattedText'

                                    DrawText:225:in `unformattedTextLength'

                                    SpriteWindow:3558:in `setText'

                                    SpriteWindow:3531:in `text='

                                    PokeBattle_Scene:1422:in `pbDisplayMessage'

                                    PokeBattle_Battle:2422:in `pbDisplay'

                                    PokeBattle_BattlerEffects:208:in `pbPoison'

                                    PokeBattle_MoveEffects:230:in `pbEffect'

                                    PokeBattle_Battler:2705:in `pbProcessMoveAgainstTarget'

                                    PokeBattle_Battler:2661:in `each'


                                    ---------------------------
                                    Pokemon Essentials
                                    ---------------------------
                                    Exception: NameError

                                    Message: uninitialized constant PokeBattle_Move::PBStatus

                                    PokeBattle_Move:534:in `pbIsCritical?'

                                    PokeBattle_Move:584:in `pbCalcDamage'

                                    PokeBattle_Move:1265:in `pbEffect'

                                    PokeBattle_Battler:2705:in `pbProcessMoveAgainstTarget'

                                    PokeBattle_Battler:2661:in `each'

                                    PokeBattle_Battler:2661:in `pbProcessMoveAgainstTarget'

                                    PokeBattle_Battler:3151:in `pbUseMove'

                                    PokeBattle_Battler:3131:in `loop'

                                    PokeBattle_Battler:3154:in `pbUseMove'

                                    PokeBattle_Battler:3350:in `pbProcessTurn'


                                    I did the following:

                                    1) Used Beedrill against one of the trainer characters.
                                    2) Used Toxic on opponent.
                                    3) Get 1st error.
                                    4) Toxic repeats once.
                                    5) Used Pursuit
                                    6) Get 2nd error.
                                    7) Battle loops continually.
                                    8) Retry.
                                    9) Used Twineddle
                                    10) Get 2nd error.
                                    11) Battle loops continually.
                                    Reply With Quote
                                      #43    
                                    Old December 10th, 2016 (4:49 PM).
                                    Rot8er_ConeX's Avatar
                                    Rot8er_ConeX Rot8er_ConeX is offline
                                       
                                      Join Date: May 2015
                                      Location: The Dissa Region
                                      Gender: Male
                                      Posts: 822
                                      Why are you treating a Boolean as a string? Is there a change since 16.2 that makes the Critical hit function return a string instead of a Boolean?
                                      __________________
                                      Features of Pokemon Entropy

                                      The black circular "doodles" in the lower right corner of my avatar are actually my username written in Gallifreyan. Yes I'm a Whovian.
                                      Reply With Quote
                                        #44    
                                      Old December 10th, 2016 (6:43 PM).
                                      Maicerochico Maicerochico is offline
                                         
                                        Join Date: Feb 2016
                                        Gender: Male
                                        Posts: 54
                                        Quote:
                                        Originally Posted by Rot8er_ConeX View Post
                                        Why are you treating a Boolean as a string? Is there a change since 16.2 that makes the Critical hit function return a string instead of a Boolean?
                                        All I did was copy and paste the Merciless code (along with the PBS stuff). I didn't change anything else from the clean Essentials. If the program is running strangely, it's not because of anything that I've modified.

                                        Clean V16.2 does the same thing.
                                        Reply With Quote
                                          #45    
                                        Old December 11th, 2016 (10:52 AM). Edited December 11th, 2016 by Maicerochico.
                                        Maicerochico Maicerochico is offline
                                           
                                          Join Date: Feb 2016
                                          Gender: Male
                                          Posts: 54
                                          I tested Stamina, and it gives me an error too.

                                          Code:
                                          Exception: NameErrorMessage: undefined local variable or method `target' for
                                          #<PokeBattle_Battle:0x883a6b8>PokeBattle_Battle:3480:in
                                          `__clauses__pbEndOfRoundPhase'PokeBattle_Clauses:42:in
                                          `pbEndOfRoundPhase'PokeBattle_Battle:2591:in
                                          `pbStartBattleCore'PokeBattle_Battle:2590:in `logonerr'PokeBattle_Battle:2590:in
                                          `pbStartBattleCore'PokeBattle_Battle:2572:in `loop'PokeBattle_Battle:2595:in
                                          `pbStartBattleCore'PokeBattle_Battle:2395:in `pbStartBattle'PTrainer_NPCTrainers:345:in
                                          `pbTrainerBattle'PTrainer_NPCTrainers:344:in `pbSceneStandby'
                                          Reply With Quote
                                            #46    
                                          Old December 11th, 2016 (1:11 PM).
                                          Rot8er_ConeX's Avatar
                                          Rot8er_ConeX Rot8er_ConeX is offline
                                             
                                            Join Date: May 2015
                                            Location: The Dissa Region
                                            Gender: Male
                                            Posts: 822
                                            Quote:
                                            Originally Posted by Maicerochico View Post
                                            I tested Stamina, and it gives me an error too.

                                            Code:
                                            Exception: NameErrorMessage: undefined local variable or method `target' for
                                            #<PokeBattle_Battle:0x883a6b8>PokeBattle_Battle:3480:in
                                            `__clauses__pbEndOfRoundPhase'PokeBattle_Clauses:42:in
                                            `pbEndOfRoundPhase'PokeBattle_Battle:2591:in
                                            `pbStartBattleCore'PokeBattle_Battle:2590:in `logonerr'PokeBattle_Battle:2590:in
                                            `pbStartBattleCore'PokeBattle_Battle:2572:in `loop'PokeBattle_Battle:2595:in
                                            `pbStartBattleCore'PokeBattle_Battle:2395:in `pbStartBattle'PTrainer_NPCTrainers:345:in
                                            `pbTrainerBattle'PTrainer_NPCTrainers:344:in `pbSceneStandby'
                                            Assuming you put my code in the right place, the variable "target" should be defined. Unless, again, this is something in v16 that I'm unaware of.
                                            __________________
                                            Features of Pokemon Entropy

                                            The black circular "doodles" in the lower right corner of my avatar are actually my username written in Gallifreyan. Yes I'm a Whovian.
                                            Reply With Quote
                                              #47    
                                            Old December 11th, 2016 (7:13 PM). Edited December 11th, 2016 by Maicerochico.
                                            Maicerochico Maicerochico is offline
                                               
                                              Join Date: Feb 2016
                                              Gender: Male
                                              Posts: 54
                                              Quote:
                                              Originally Posted by Rot8er_ConeX View Post
                                              Assuming you put my code in the right place, the variable "target" should be defined. Unless, again, this is something in v16 that I'm unaware of.
                                              I managed to make Stamina function in V16.2 by modifying the script for Justified. Placing this code above the Justified script in PokeBattle_Battler seemed to work for me:

                                              Code:
                                              if target.hasWorkingAbility(:STAMINA)
                                                        if target.pbIncreaseStatWithCause(PBStats::DEFENSE,1,target,PBAbilities.getName(target.ability))
                                                          PBDebug.log("[Ability triggered] #{target.pbThis}'s Stamina")
                                                        end
                                                      end
                                              I reloaded a clean Essentials V16.2, and Merciless still doesn't function for whatever reason. The aforementioned errors continue to pop up. I don't know if it makes any difference, but I noticed that in the code that you provided for Merciless, you have Frost Breath in that section. In V16.2, that bit of code for Frost Breath is not present there, but the move still works perfectly fine. (I'm a coding noob, so I don't know if that little detail makes any difference. I just figured that I would point it out.)
                                              Reply With Quote
                                                #48    
                                              Old December 11th, 2016 (11:02 PM). Edited December 12th, 2016 by Maicerochico.
                                              Maicerochico Maicerochico is offline
                                                 
                                                Join Date: Feb 2016
                                                Gender: Male
                                                Posts: 54
                                                Shell Trap doesn't work for me. I've tried fiddling around with it as much as I can, but the move always fails.

                                                When the provided code is copied directly into V16.2, I get this error:


                                                Code:
                                                Exception: ArgumentError
                                                
                                                Message: wrong number of arguments(3 for 1)
                                                
                                                PokeBattle_Battler:1279:in `pbIsPhysical?'
                                                
                                                PokeBattle_Battler:1279:in `pbEffectsOnDealingDamage'
                                                
                                                PokeBattle_Battler:2780:in `pbProcessMoveAgainstTarget'
                                                
                                                PokeBattle_Battler:2699:in `each'
                                                
                                                PokeBattle_Battler:2699:in `pbProcessMoveAgainstTarget'
                                                
                                                PokeBattle_Battler:3175:in `pbUseMove'
                                                
                                                PokeBattle_Battler:3155:in `loop'
                                                
                                                PokeBattle_Battler:3178:in `pbUseMove'
                                                
                                                PokeBattle_Battler:3376:in `pbProcessTurn'
                                                
                                                PokeBattle_Battler:3375:in `logonerr'
                                                I can edit the code so that the error does not appear, but, again, the move still fails.

                                                For the Move_Effects section, could one use a modified Counter code (minus the "fixed damage" line)?

                                                Edit:

                                                I overlooked the fact that one user above already tried to set up Shell Trap as a modified Counter. Shell Trap isn't a fixed 150 damage though, is it? Rather, I thought that the move had 150 base power? If you listen closely to the Turtonator reveal video, when it uses Shell Trap against a Torkoal and a Carracosta, there is a "Not Very Effective" sound.
                                                Reply With Quote
                                                  #49    
                                                Old December 12th, 2016 (2:17 PM).
                                                Maicerochico Maicerochico is offline
                                                   
                                                  Join Date: Feb 2016
                                                  Gender: Male
                                                  Posts: 54
                                                  Floral Healing, Shore Up, and Burn Up function properly, but I'm having issues with Toxic Thread and Speed Swap.

                                                  For the provided Toxic Thread code, when I use it, I get this error:


                                                  Code:
                                                  Exception: NoMethodError
                                                  
                                                  Message: undefined method `index' for true:TrueClass
                                                  
                                                  PokeBattle_BattlerEffects:747:in `pbCanReduceStatStage?'
                                                  
                                                  PokeBattle_MoveEffects:1592:in `pbEffect'
                                                  
                                                  PokeBattle_Battler:2881:in `pbProcessMoveAgainstTarget'
                                                  
                                                  PokeBattle_Battler:2837:in `each'
                                                  
                                                  PokeBattle_Battler:2837:in `pbProcessMoveAgainstTarget'
                                                  
                                                  PokeBattle_Battler:3313:in `pbUseMove'
                                                  
                                                  PokeBattle_Battler:3293:in `loop'
                                                  
                                                  PokeBattle_Battler:3316:in `pbUseMove'
                                                  
                                                  PokeBattle_Battler:3514:in `pbProcessTurn'
                                                  
                                                  PokeBattle_Battler:3513:in `logonerr'
                                                  For Speed Swap: in double battles, when the move is used on an ally, the teammates' Speed stats revert back to normal when the opponent sends in a replacement Pokemon after a K.O. I tested with an Aggron (fully divested of Speed) and a Beedrill (fully invested) on a team, and their stats remained switched until I KO'd any of the opponent's 'mons, at which point Aggron became slower again.
                                                  Reply With Quote
                                                    #50    
                                                  Old December 22nd, 2016 (11:08 AM).
                                                  Marin's Avatar
                                                  Marin Marin is offline
                                                  Not Bored
                                                   
                                                  Join Date: Nov 2016
                                                  Age: 16
                                                  Gender: Other
                                                  Posts: 792
                                                  Quote:
                                                  Originally Posted by Rot8er_ConeX View Post
                                                  I haven't done Pollen Puff yet, but here's Spectral Thief:

                                                  Code:
                                                  ################################################################################
                                                  # Steals target's stat boosts, then attacks
                                                  ################################################################################
                                                  class PokeBattle_Move_1A1 < PokeBattle_Move
                                                    def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
                                                      if opponent.stages[1]>0 || opponent.stages[2]>0 || opponent.stages[3]>0 ||
                                                         opponent.stages[4]>0 || opponent.stages[5]>0 || opponent.stages[6]>0 ||
                                                         opponent.stages[7]>0
                                                        stolenstats=[0,0,0,0,0,0,0,0]
                                                        for i in 0...8
                                                          stolenstats[i]=opponent.stages[i]*1 if opponent.stages[i]>0
                                                          opponent.stages[i]=0 if opponent.stages[i]>0
                                                        end
                                                        @battle.pbDisplay(_INTL("{1} stole {2}'s stat boosts!",attacker.pbThis,opponent.pbThis(true)))
                                                        showanim=true
                                                        for i in 0...6
                                                          if attacker.pbCanIncreaseStatStage?(i,true,attacker) && stolenstats[i]>0
                                                            attacker.pbIncreaseStat(i,stolenstats[i],true,showanim,attacker)
                                                            showanim=false
                                                          end
                                                        end
                                                      end
                                                      # actually attack now
                                                      ret=super(attacker,opponent,hitnum,alltargets,showanimation)
                                                      return ret
                                                    end
                                                  end
                                                  I'm not so sure how relevant this is, but this script isn't working for me. I've been trying desperately to make something myself, but don't have any luck. Your script tells me it doesn't understand ">".
                                                  Reply With Quote
                                                  Reply

                                                  Quick Reply

                                                  Join the conversation!

                                                  Create an account to post a reply in this thread, participate in other discussions, and more!

                                                  Create a PokéCommunity Account
                                                  Thread Tools

                                                  Posting Rules
                                                  You may not post new threads
                                                  You may not post replies
                                                  You may not post attachments
                                                  You may not edit your posts

                                                  BB code is On
                                                  Smilies are On
                                                  [IMG] code is On
                                                  HTML code is Off

                                                  Forum Jump


                                                  All times are GMT -8. The time now is 4:45 AM.