The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Creative Discussions > Game Development > Pokémon Essentials
Sign Up Rules/FAQ Live Battle Blogs Mark Forums Read

Notices

Pokémon Essentials All questions and discussion about Pokémon Essentials, the Pokémon game kit for RPG Maker XP, go in here. Also contains links to the latest downloads and the Essentials Wiki.

Reply
 
Thread Tools
  #1    
Old August 31st, 2012, 07:37 AM
Black Temple Gaurdian
Unhatched Egg
 
Join Date: May 2010
Spoiler:
Solved.
So I implimented a new weather type, which compiles nicely. However, the inducing move causes an error an compile attempt. What am I doing wrong?
Code:
class PokeBattle_Move_140 < PokeBattle_Move
  def pbEffect(attacker,opponent)
    if @battle.weather==PBWeather::DARKNESS
      @battle.pbDisplay(_INTL("But it failed!"))
      return -1
    if @battle.weather==PBWeather::GENTLEBREEZE
      @battle.pbDisplay(_INTL("{1} Does not want to disrupt the Gentle Breeze", attacker.pbThis))
      return -1
    else
      @battle.weather=PBWeather::DARKNESS
      @battle.weatherduration=5
      @battle.pbDisplay(_INTL("Darkness descended upon the field!"))
      return 0
    end
  end
end


Okay, four moves that share similar code, all of which crash. Something is wrong with them but what?
Code:
class PokeBattle_Move_135 < PokeBattle_Move
  def pbBaseDamage(basedmg,attacker,opponent)
    multiplier = 1
    moveIDs = Array.new
    moveIDs << attacker.moves[0].id
    moveIDs << attacker.moves[1].id
    moveIDs << attacker.moves[2].id
    moveIDs << attacker.moves[3].id
    if (moveIDs.include? 561&&564&&576&&591)
        multiplier = 2
      end
       return basedmg*multiplier
     end
     
def pbAdditionalEffect(attacker,opponent)
    multiplier = 1
    moveIDs = Array.new
    moveIDs << attacker.moves[0].id
    moveIDs << attacker.moves[1].id
    moveIDs << attacker.moves[2].id
    moveIDs << attacker.moves[3].id
    if (moveIDs.include? 561 && 564 && 576 && 591)
      multiplier = 2
    end
    rnd=@battle.pbRandom(10/multiplier)
    case rnd
      when 0
        return false if !opponent.pbCanParalyze?(false)
        opponent.pbParalyze(attacker)
        @battle.pbDisplay(_INTL("{1} is paralyzed!  It may be unable to move!",opponent.pbThis))
        return true
    end
    return false
  end
Code:
class PokeBattle_Move_136 < PokeBattle_Move
  def pbBaseDamage(basedmg,attacker,opponent)
    multiplier = 1
    moveIDs = Array.new
    moveIDs << attacker.moves[0].id
    moveIDs << attacker.moves[1].id
    moveIDs << attacker.moves[2].id
    moveIDs << attacker.moves[3].id
    if (moveIDs.include? 561&&564&&576&&591)
        multiplier = 2
      end
       return basedmg*multiplier
     end
     
def pbAdditionalEffect(attacker,opponent)
    multiplier = 1
    moveIDs = Array.new
    moveIDs << attacker.moves[0].id
    moveIDs << attacker.moves[1].id
    moveIDs << attacker.moves[2].id
    moveIDs << attacker.moves[3].id
    if (moveIDs.include? 561 && 564 && 576 && 591)
      multiplier = 2
    end
    rnd=@battle.pbRandom(10/multiplier)
    case rnd
      when 0
        return false if !opponent.pbCanBurn?(false)
        opponent.pbBurn(attacker)
        @battle.pbDisplay(_INTL("{1} was burned!",opponent.pbThis))
        return true
    end
    return false
  end
Code:
class PokeBattle_Move_137 < PokeBattle_Move
  def pbBaseDamage(basedmg,attacker,opponent)
    multiplier = 1
    moveIDs = Array.new
    moveIDs << attacker.moves[0].id
    moveIDs << attacker.moves[1].id
    moveIDs << attacker.moves[2].id
    moveIDs << attacker.moves[3].id
    if (moveIDs.include? 561&&564&&576&&591)
        multiplier = 2
      end
       return basedmg*multiplier
     end
     
def pbAdditionalEffect(attacker,opponent)
    multiplier = 1
    moveIDs = Array.new
    moveIDs << attacker.moves[0].id
    moveIDs << attacker.moves[1].id
    moveIDs << attacker.moves[2].id
    moveIDs << attacker.moves[3].id
    if (moveIDs.include? 561 && 564 && 576 && 591)
      multiplier = 2
    end
    rnd=@battle.pbRandom(10/multiplier)
    case rnd
      when 0
        return false if !opponent.pbCanPoison?(false)
        opponent.pbPosion(attacker)
        @battle.pbDisplay(_INTL("{1} was poisoned!",opponent.pbThis))
        return true
    end
    return false
  end
Code:
class PokeBattle_Move_138 < PokeBattle_Move
  def pbBaseDamage(basedmg,attacker,opponent)
    multiplier = 1
    moveIDs = Array.new
    moveIDs << attacker.moves[0].id
    moveIDs << attacker.moves[1].id
    moveIDs << attacker.moves[2].id
    moveIDs << attacker.moves[3].id
    if (moveIDs.include? 561&&564&&576&&591)
        multiplier = 2
      end
       return basedmg*multiplier
     end
     
def pbAdditionalEffect(attacker,opponent)
    multiplier = 1
    moveIDs = Array.new
    moveIDs << attacker.moves[0].id
    moveIDs << attacker.moves[1].id
    moveIDs << attacker.moves[2].id
    moveIDs << attacker.moves[3].id
    if (moveIDs.include? 561 && 564 && 576 && 591)
      multiplier = 2
    end
    rnd=@battle.pbRandom(10/multiplier)
    case rnd
      when 0
        return false if !opponent.pbCanConfuse?(false)
        opponent.effects[PBEffects::Confusion]=[email protected](4)
        @battle.pbCommonAnimation("Confusion",attacker,opponent)
        @battle.pbDisplay(_INTL("{1} became confused!",opponent.pbThis))
        return true
    end
    return false
  end
__________________

Last edited by Black Temple Gaurdian; August 31st, 2012 at 01:54 PM.
Reply With Quote
  #2    
Old August 31st, 2012, 09:39 AM
Maruno's Avatar
Maruno
Lead Dev of Pokémon Essentials
 
Join Date: Jan 2008
Location: England
Quote:
Originally Posted by Black Temple Gaurdian View Post
So I implimented a new weather type, which compiles nicely. However, the inducing move causes an error an compile attempt. What am I doing wrong?
Code:
class PokeBattle_Move_140 < PokeBattle_Move
  def pbEffect(attacker,opponent)
    if @battle.weather==PBWeather::DARKNESS
      @battle.pbDisplay(_INTL("But it failed!"))
      return -1
    elsif @battle.weather==PBWeather::GENTLEBREEZE
      @battle.pbDisplay(_INTL("{1} Does not want to disrupt the Gentle Breeze", attacker.pbThis))
      return -1
    else
      @battle.weather=PBWeather::DARKNESS
      @battle.weatherduration=5
      @battle.pbDisplay(_INTL("Darkness descended upon the field!"))
      return 0
    end
  end
end
Three little missing letters.
__________________
Reply With Quote
  #3    
Old August 31st, 2012, 01:55 PM
Black Temple Gaurdian
Unhatched Egg
 
Join Date: May 2010
Thanks

Okay, one done, several to go. Next up a four-in-one situation. Updated OP to match.
__________________
Reply With Quote
  #4    
Old August 31st, 2012, 02:18 PM
Maruno's Avatar
Maruno
Lead Dev of Pokémon Essentials
 
Join Date: Jan 2008
Location: England
It's best not to edit earlier posts, because people aren't likely to notice. It's especially pointless if you make a new post anyway, because you can/should just put your new question in your new post instead.

Anyway, that include? business looks wrong. Replace every instance of this:

Code:
moveIDs = Array.new
moveIDs << attacker.moves[0].id
moveIDs << attacker.moves[1].id
moveIDs << attacker.moves[2].id
moveIDs << attacker.moves[3].id
if (moveIDs.include? 561&&564&&576&&591)
  multiplier = 2
end
...with this:

Code:
multiplier=2 if pbHasMove?(attacker,:TACKLE) &&
                pbHasMove?(attacker,:SANDATTACK) &&
                pbHasMove?(attacker,:TAILWHIP) &&
                pbHasMove?(attacker,:GROWL)
Simpler, more readable, and it works.

I swear I've answered this question before, many months ago. The same misuse of include?, the multiple moves with the same problem, everything.
__________________
Reply With Quote
  #5    
Old August 31st, 2012, 02:43 PM
Black Temple Gaurdian
Unhatched Egg
 
Join Date: May 2010
Yes it was the effect portion of the moves. I guess that's what I get from basing my work on other people (it was a previous programmer who left :/ ).

So I tried:
Code:
class PokeBattle_Move_135 < PokeBattle_Move
  def pbBaseDamage(basedmg,attacker,opponent)
    multiplier=2 if pbHasMove?(attacker,:ALPHASHOCK) &&
                    pbHasMove?(attacker,:BETAFLAME) &&
                    pbHasMove?(attacker,:GAMMASPORE) &&
                    pbHasMove?(attacker,:DELTAWAVE)
    else multiplier=1
    return basedmg*multiplier
  end
     
def pbAdditionalEffect(attacker,opponent)
    multiplier=2 if pbHasMove?(attacker,:ALPHASHOCK) &&
                    pbHasMove?(attacker,:BETAFLAME) &&
                    pbHasMove?(attacker,:GAMMASPORE) &&
                    pbHasMove?(attacker,:DELTAWAVE)
    else multiplier=1
    rnd=@battle.pbRandom(10/multiplier)
    case rnd
      when 0
        return false if !opponent.pbCanParalyze?(false)
        opponent.pbParalyze(attacker)
        @battle.pbDisplay(_INTL("{1} is paralyzed!  It may be unable to move!",opponent.pbThis))
        return true
    end
    return false
  end
But that doesn't work. What's wrong with it?
__________________
Reply With Quote
  #6    
Old August 31st, 2012, 03:17 PM
Maruno's Avatar
Maruno
Lead Dev of Pokémon Essentials
 
Join Date: Jan 2008
Location: England
What's wrong is the part where you didn't do as I said. I told you which specific lines to replace, yet you also deleted an extra one and added an (incorrect) extra one.

Code:
class PokeBattle_Move_135 < PokeBattle_Move
  def pbBaseDamage(basedmg,attacker,opponent)
    multiplier=1
    multiplier=2 if pbHasMove?(attacker,:ALPHASHOCK) &&
                    pbHasMove?(attacker,:BETAFLAME) &&
                    pbHasMove?(attacker,:GAMMASPORE) &&
                    pbHasMove?(attacker,:DELTAWAVE)
    else multiplier=1
    return basedmg*multiplier
  end
     
def pbAdditionalEffect(attacker,opponent)
    multiplier=1
    multiplier=2 if pbHasMove?(attacker,:ALPHASHOCK) &&
                    pbHasMove?(attacker,:BETAFLAME) &&
                    pbHasMove?(attacker,:GAMMASPORE) &&
                    pbHasMove?(attacker,:DELTAWAVE)
    else multiplier=1
    rnd=@battle.pbRandom(10/multiplier)
    case rnd
      when 0
        return false if !opponent.pbCanParalyze?(false)
        opponent.pbParalyze(attacker)
        @battle.pbDisplay(_INTL("{1} is paralyzed!  It may be unable to move!",opponent.pbThis))
        return true
    end
    return false
  end
Delete the red lines, and add the green lines back in.
__________________
Reply With Quote
  #7    
Old August 31st, 2012, 03:21 PM
Black Temple Gaurdian
Unhatched Egg
 
Join Date: May 2010
this also errors:
Code:
class PokeBattle_Move_135 < PokeBattle_Move
  def pbBaseDamage(basedmg,attacker,opponent)
    multiplier=1
    multiplier=2 if pbHasMove?(attacker,:ALPHASHOCK) &&
                    pbHasMove?(attacker,:BETAFLAME) &&
                    pbHasMove?(attacker,:GAMMASPORE) &&
                    pbHasMove?(attacker,:DELTAWAVE)
    return basedmg*multiplier
  end
     
def pbAdditionalEffect(attacker,opponent)
    multiplier=1
    multiplier=2 if pbHasMove?(attacker,:ALPHASHOCK) &&
                    pbHasMove?(attacker,:BETAFLAME) &&
                    pbHasMove?(attacker,:GAMMASPORE) &&
                    pbHasMove?(attacker,:DELTAWAVE)
    rnd=@battle.pbRandom(10/multiplier)
    case rnd
      when 0
        return false if !opponent.pbCanParalyze?(false)
        opponent.pbParalyze(attacker)
        @battle.pbDisplay(_INTL("{1} is paralyzed!  It may be unable to move!",opponent.pbThis))
        return true
    end
    return false
  end


EDIT: Just noticed a new version was released. I think this is in V8 (the 15/5/12 release at least), could that be the cause? If so, is there an easy way to port from one to the other?
__________________

Last edited by Black Temple Gaurdian; August 31st, 2012 at 03:54 PM.
Reply With Quote
  #8    
Old August 31st, 2012, 04:41 PM
Maruno's Avatar
Maruno
Lead Dev of Pokémon Essentials
 
Join Date: Jan 2008
Location: England
Make sure you've got enough ends in there. The code you've provided is missing one at the bottom of it to close off the class (that applies to each of the four lots of code you provided).

In future, try telling us what the problem actually is, rather than saying it's an "error". We figured that part out already. There will always be some kind of message that pops up telling you something's gone wrong, and the trick is to read it and tell us what it said.

What do you mean, patronising?
__________________
Reply With Quote
  #9    
Old August 31st, 2012, 05:05 PM
Black Temple Gaurdian
Unhatched Egg
 
Join Date: May 2010
Oh that explains it! I thought it was odd that I kept pointing to the last line of the entire script each time >.<

EDIT: Thanks, that works now!
__________________
Reply With Quote
  #10    
Old September 2nd, 2012, 05:28 AM
Black Temple Gaurdian
Unhatched Egg
 
Join Date: May 2010
Okay, it seems the weather is having problems somewhere. When the weather is in effect, moves that target others don't work, it just says "X used Y." and moves on.
This is what's under pbAccuracyCheck (literally right under):
Code:
    if @battle.pbWeather==PBWeather::DARKNESS &&
       !attacker.pbHasType(:DARK) && !attacker.pbHasType(:LIGHT) &&
       !isConst?(attacker.ability,PBAbilities,:NIGHTVISION)
      accuracy=(accuracy*9/10).floor
    elsif @battle.pbWeather==PBWeather::DARKNESS &&
       isConst?(attacker.ability,PBAbilities,:NIGHTVISION)
      accuracy=(accuracy*1.3).floor
    end
I think that's the culprit, but if not say and I'll root through for the other darkness-related stuff.
__________________
Reply With Quote
  #11    
Old September 5th, 2012, 02:36 AM
Black Temple Gaurdian
Unhatched Egg
 
Join Date: May 2010
So this is one of my earlier moves that will probably make a lot of people cringe. Problem is, when used ingame, it doesn't appear to raise stats. It's supposed to raise all stats then have to recharge.
Code:
class PokeBattle_Move_141 < PokeBattle_Move
  def pbEffect(attacker,opponent)
    ret=super(attacker,opponent)
    if opponent.damagestate.calcdamage>0
      attacker.effects[PBEffects::HyperBeam]=2
      attacker.currentMove=@id
    end
    return ret
    if !attacker.pbTooHigh?(PBStats::ATTACK)
      attacker.stages[PBStats::ATTACK]+=1
      @battle.pbCommonAnimation("StatUp",attacker,nil) if !haveanim; haveanim=true
      @battle.pbDisplay(_INTL("{1}'s Attack rose!",attacker.pbThis))
    end
    if !attacker.pbTooHigh?(PBStats::DEFENSE)
      attacker.stages[PBStats::DEFENSE]+=1
      @battle.pbCommonAnimation("StatUp",attacker,nil) if !haveanim; haveanim=true
      @battle.pbDisplay(_INTL("{1}'s Defense rose!",attacker.pbThis))
    end
    if !attacker.pbTooHigh?(PBStats::SPEED)
      attacker.stages[PBStats::SPEED]+=1
      @battle.pbCommonAnimation("StatUp",attacker,nil) if !haveanim; haveanim=true
      @battle.pbDisplay(_INTL("{1}'s Speed rose!",attacker.pbThis))
    end
    if !attacker.pbTooHigh?(PBStats::SPATK)
      attacker.stages[PBStats::SPATK]+=1
      @battle.pbCommonAnimation("StatUp",attacker,nil) if !haveanim; haveanim=true
      @battle.pbDisplay(_INTL("{1}'s Special Attack rose!",attacker.pbThis))
    end
    if !attacker.pbTooHigh?(PBStats::SPDEF)
      attacker.stages[PBStats::SPDEF]+=1
      @battle.pbCommonAnimation("StatUp",attacker,nil) if !haveanim; haveanim=true
      @battle.pbDisplay(_INTL("{1}'s Special Defense rose!",attacker.pbThis))
    end
    if !attacker.pbTooHigh?(PBStats::ACCURACY)
      attacker.stages[PBStats::ACCURACY]+=1
      @battle.pbCommonAnimation("StatUp",attacker,nil) if !haveanim; haveanim=true
      @battle.pbDisplay(_INTL("{1}'s Accuracy rose!",attacker.pbThis))
    end
    if !attacker.pbTooHigh?(PBStats::EVASION)
      attacker.stages[PBStats::EVASION]+=1
      @battle.pbCommonAnimation("StatUp",attacker,nil) if !haveanim; haveanim=true
      @battle.pbDisplay(_INTL("{1}'s Evasion rose!",attacker.pbThis))
    end
    return true
  end
end
EDIT: Grr, this one won't work either. It's *supposed* to inflict a random status ailment.
Code:
class PokeBattle_Move_148 < PokeBattle_Move
  def pbAdditionalEffect(attacker,opponent)
    rnd=@battle.pbRandom(10)
    case rnd
      when 0
        return false if !opponent.pbCanBurn?(true)
        opponent.pbBurn(attacker)
        @battle.pbDisplay(_INTL("{1} was burned!",opponent.pbThis))
      when 1
        return false if !opponent.pbCanFreeze?(true)
        opponent.pbFreeze
        @battle.pbDisplay(_INTL("{1} was frozen solid!",opponent.pbThis))
      when 2
        return false if !opponent.pbCanParalyze?(true)
        opponent.pbParalyze(attacker)
        @battle.pbDisplay(_INTL("{1} is paralyzed!  It may be unable to move!",opponent.pbThis))
      when 3
        return false if !opponent.pbCanPoison?(true)
        opponent.pbPoison(attacker)
        @battle.pb.Display(_INTL("{1} was poisoned!",opponent.pbThis))
      when 4
        return false if !opponent.pbCanSleep?(true)
        opponent.pbSleep
        @battle.pbDisplay(_INTL("{1} went to sleep!",opponent.pbThis))
      when 5
        return false if !opponent.pbCanBurn?(true)
        opponent.pbBurn(attacker)
        @battle.pbDisplay(_INTL("{1} was burned!",opponent.pbThis))
      when 6
        return false if !opponent.pbCanSleep?(true)
        opponent.pbSleep
        @battle.pbDisplay(_INTL("{1} went to sleep!",opponent.pbThis))
      when 7
        return false if !opponent.pbCanParalyze?(true)
        opponent.pbParalyze(attacker)
        @battle.pbDisplay(_INTL("{1} is paralyzed!  It may be unable to move!",opponent.pbThis))
      when 8
        return false if !opponent.pbCanPoison?(true)
        opponent.pbPoison(attacker)
        @battle.pb.Display(_INTL("{1} was poisoned!",opponent.pbThis))
      when 9
        return false if !opponent.pbCanSleep?(true)
        opponent.pbSleep
        @battle.pbDisplay(_INTL("{1} went to sleep!",opponent.pbThis))
    end
    return true
  end
end
__________________

Last edited by Black Temple Gaurdian; September 5th, 2012 at 03:02 AM.
Reply With Quote
  #12    
Old September 5th, 2012, 04:18 AM
Maruno's Avatar
Maruno
Lead Dev of Pokémon Essentials
 
Join Date: Jan 2008
Location: England
Code:
class PokeBattle_Move_141 < PokeBattle_Move
  def pbEffect(attacker,opponent)
    ret=super(attacker,opponent)
    if opponent.damagestate.calcdamage>0
      attacker.effects[PBEffects::HyperBeam]=2
      attacker.currentMove=@id
    end
    return ret
    haveanim=false
    if !attacker.pbTooHigh?(PBStats::ATTACK)
      attacker.stages[PBStats::ATTACK]+=1
      @battle.pbCommonAnimation("StatUp",attacker,nil) if !haveanim; haveanim=true
      @battle.pbDisplay(_INTL("{1}'s Attack rose!",attacker.pbThis))
    end
    if !attacker.pbTooHigh?(PBStats::DEFENSE)
      attacker.stages[PBStats::DEFENSE]+=1
      @battle.pbCommonAnimation("StatUp",attacker,nil) if !haveanim; haveanim=true
      @battle.pbDisplay(_INTL("{1}'s Defense rose!",attacker.pbThis))
    end
    if !attacker.pbTooHigh?(PBStats::SPEED)
      attacker.stages[PBStats::SPEED]+=1
      @battle.pbCommonAnimation("StatUp",attacker,nil) if !haveanim; haveanim=true
      @battle.pbDisplay(_INTL("{1}'s Speed rose!",attacker.pbThis))
    end
    if !attacker.pbTooHigh?(PBStats::SPATK)
      attacker.stages[PBStats::SPATK]+=1
      @battle.pbCommonAnimation("StatUp",attacker,nil) if !haveanim; haveanim=true
      @battle.pbDisplay(_INTL("{1}'s Special Attack rose!",attacker.pbThis))
    end
    if !attacker.pbTooHigh?(PBStats::SPDEF)
      attacker.stages[PBStats::SPDEF]+=1
      @battle.pbCommonAnimation("StatUp",attacker,nil) if !haveanim; haveanim=true
      @battle.pbDisplay(_INTL("{1}'s Special Defense rose!",attacker.pbThis))
    end
    if !attacker.pbTooHigh?(PBStats::ACCURACY)
      attacker.stages[PBStats::ACCURACY]+=1
      @battle.pbCommonAnimation("StatUp",attacker,nil) if !haveanim; haveanim=true
      @battle.pbDisplay(_INTL("{1}'s Accuracy rose!",attacker.pbThis))
    end
    if !attacker.pbTooHigh?(PBStats::EVASION)
      attacker.stages[PBStats::EVASION]+=1
      @battle.pbCommonAnimation("StatUp",attacker,nil) if !haveanim; haveanim=true
      @battle.pbDisplay(_INTL("{1}'s Evasion rose!",attacker.pbThis))
    end
    return true
  end
end
Delete the red line, add the green line.


Code:
class PokeBattle_Move_148 < PokeBattle_Move
  def pbAdditionalEffect(attacker,opponent)
    rnd=@battle.pbRandom(10)
    case rnd
      when 0
        return false if !opponent.pbCanBurn?(true)
        opponent.pbBurn(attacker)
        @battle.pbDisplay(_INTL("{1} was burned!",opponent.pbThis))
      when 1
        return false if !opponent.pbCanFreeze?(true)
        opponent.pbFreeze
        @battle.pbDisplay(_INTL("{1} was frozen solid!",opponent.pbThis))
      when 2
        return false if !opponent.pbCanParalyze?(true)
        opponent.pbParalyze(attacker)
        @battle.pbDisplay(_INTL("{1} is paralyzed!  It may be unable to move!",opponent.pbThis))
      when 3
        return false if !opponent.pbCanPoison?(true)
        opponent.pbPoison(attacker)
        @battle.pb.Display(_INTL("{1} was poisoned!",opponent.pbThis))
      when 4
        return false if !opponent.pbCanSleep?(true)
        opponent.pbSleep
        @battle.pbDisplay(_INTL("{1} went to sleep!",opponent.pbThis))
      when 5
        return false if !opponent.pbCanBurn?(true)
        opponent.pbBurn(attacker)
        @battle.pbDisplay(_INTL("{1} was burned!",opponent.pbThis))
      when 6
        return false if !opponent.pbCanSleep?(true)
        opponent.pbSleep
        @battle.pbDisplay(_INTL("{1} went to sleep!",opponent.pbThis))
      when 7
        return false if !opponent.pbCanParalyze?(true)
        opponent.pbParalyze(attacker)
        @battle.pbDisplay(_INTL("{1} is paralyzed!  It may be unable to move!",opponent.pbThis))
      when 8
        return false if !opponent.pbCanPoison?(true)
        opponent.pbPoison(attacker)
        @battle.pb.Display(_INTL("{1} was poisoned!",opponent.pbThis))
      when 9
        return false if !opponent.pbCanSleep?(true)
        opponent.pbSleep
        @battle.pbDisplay(_INTL("{1} went to sleep!",opponent.pbThis))
    end
    return true
  end
end
Fix the extraneous dot in the red part. Other than that, though, the code itself is correct. Make sure the move as defined in moves.txt has an additional effect probability of [whatever] rather than 0 (maybe 30?).
__________________
Reply With Quote
Reply
Quick Reply

Sponsored Links
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
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 04:33 AM.


Style by Nymphadora, artwork by Sa-Dui.
Like our Facebook Page Follow us on Twitter © 2002 - 2014 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2014 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.