Seen 1 Week Ago
Posted 1 Week Ago
7 posts
192 Days
I'm trying to script in Terrain Pulse, but it's not working at all.
First I tried with this:

class PokeBattle_Move_219 < PokeBattle_Move
  def pbBaseDamage(basedmg,attacker,opponent)
    if  @battle.field.effects!=0
      return basedmg*2
    end
    return basedmg
  end

  def pbModifyType(type,attacker,opponent)
    type=getConst(PBTypes,:NORMAL) || 0
    case @battle.field.effects
    when PBEffects::GrassyTerrain
      type=(getConst(PBTypes,:GRASS) || type)
    when PBEffects::PsychicTerrain
      type=(getConst(PBTypes,:PSYCHIC) || type)
    when PBEffects::MistyTerrain
      type=(getConst(PBTypes,:FAIRY) || type)
    when PBEffects::ElectricTerrain
      type=(getConst(PBTypes,:ELECTRIC) || type)
    when PBEffects::WarTerrain
      type=(getConst(PBTypes,:FIGHTING) || type)
    end
    return type
  end
end
But it didn't work, so under another user's suggestions I tried changing the first part of the script to this:

class PokeBattle_Move_219 < PokeBattle_Move
  def pbBaseDamage(basedmg,attacker,opponent)
    if  @battle.field.effects[PBEffects::ElectricTerrain]>0 ||
        @battle.field.effects[PBEffects::GrassyTerrain]>0 ||
        @battle.field.effects[PBEffects::MistyTerrain]>0 ||
        @battle.field.effects[PBEffects::PsychicTerrain]>0 ||
        @battle.field.effects[PBEffects::WarTerrain]>0 
      return basedmg*2
    end
    return basedmg
  end
And it still doesn't work. Any idea why?

I'm also trying to get Scale shot and Grassy glide to work but neither do, so...
Seen 1 Week Ago
Posted 1 Week Ago
7 posts
192 Days
Update: with the help of WolfPP from the Discord server I got it to work, here's the proper code:
class PokeBattle_Move_219 < PokeBattle_Move
  def pbBaseDamage(basedmg,attacker,opponent)
    if (@battle.field.effects[PBEffects::GrassyTerrain]   ||
        @battle.field.effects[PBEffects::ElectricTerrain] ||
        @battle.field.effects[PBEffects::MistyTerrain]    ||
        @battle.field.effects[PBEffects::PsychicTerrain])>0
      return basedmg*2
    else
      return basedmg
    end
  end
  
  def pbModifyType(type,attacker,opponent)
    type=getConst(PBTypes,:NORMAL) || 0
    type=(getConst(PBTypes,:GRASS) || type) if @battle.field.effects[PBEffects::GrassyTerrain]>0
    type=(getConst(PBTypes,:ELECTRIC) || type) if @battle.field.effects[PBEffects::ElectricTerrain]>0
    type=(getConst(PBTypes,:FAIRY) || type) if @battle.field.effects[PBEffects::MistyTerrain]>0
    type=(getConst(PBTypes,:PSYCHIC) || type) if @battle.field.effects[PBEffects::PsychicTerrain]>0
    return type
  end
end

HM100

HM100 the Techno

Male
Seen 11 Hours Ago
Posted 1 Week Ago
112 posts
3.6 Years
Or you can use my own:
################################################################################
# Type varies between terrains. Power is doubled when executed within an active
# terrain (Terrain Pulse)
################################################################################
class PokeBattle_Move_219 < PokeBattle_Move
  def pbModifyDamage(damagemult,attacker,opponent)
    if @battle.field.effects[PBEffects::GrassyTerrain]==0 &&
       @battle.field.effects[PBEffects::ElectricTerrain]==0 &&
       @battle.field.effects[PBEffects::MistyTerrain]==0 &&
       @battle.field.effects[PBEffects::PsychicTerrain]==0 &&
      return damagemult
    end
    return (damagemult*2.0).round
  end

  def pbModifyType(type,attacker,opponent)
    type=getConst(PBTypes,:NORMAL) || 0
    if @battle.field.effects[PBEffects::ElectricTerrain]>0
      type=getConst(PBTypes,:ELECTRIC) if hasConst?(PBTypes,:ELECTRIC)
    elsif @battle.field.effects[PBEffects::GrassyTerrain]>0
      type=getConst(PBTypes,:GRASS) if hasConst?(PBTypes,:GRASS)
    elsif @battle.field.effects[PBEffects::MistyTerrain]>0
      type=getConst(PBTypes,:FAIRY) if hasConst?(PBTypes,:FAIRY)
    elsif @battle.field.effects[PBEffects::PsychicTerrain]>0
      type=getConst(PBTypes,:PSYCHIC) if hasConst?(PBTypes,:PSYCHIC)
    end
    return type
  end
end
You can tell me if this code works for you but I assume it will
ΚΟΡΑ ΚΟΡΕ RPG MAKER XP
http://el.poke-kore.wikia.com/wiki/Qora#Λήψη - Download
http://el.poke-kore.wikia.com/wiki/Qora or just read the greek documentation (Note: May require google translator to read this in English)

My favorite Pokémon from the official games are Alcremie and Keklneon.

My favorite own self made Pokémon are Wikimedia and Frikipaideia