View Single Post
  #1    
Old August 31st, 2012 (7:37 AM). Edited August 31st, 2012 by Black Temple Gaurdian.
Black Temple Gaurdian Black Temple Gaurdian is offline
 
Join Date: May 2010
Posts: 39
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
    [email protected](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
    [email protected](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
    [email protected](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
    [email protected](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
__________________
Reply With Quote