• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Scripting Question] Electric pokemon paralyzed?

59
Posts
6
Years
    • Seen Jul 26, 2023
    Maybe i am wrong but Electric pokemon can´t be paralyzed now right?
    How do i implement this change?
    The thing that i want to do is make so that the Electric pokemon can not get paralyzed by electric moves but if they are of another type (the moves) yes.
     
    Last edited:
    172
    Posts
    7
    Years
    • Seen Sep 6, 2022
    Maybe i am wrong but Electric pokemon can´t be paralyzed now right?
    How do i implement this change?
    The thing that i want to do is make so that the Electric pokemon can not get paralyzed by electric moves but if they are of another type (the moves) yes.

    Not sure if you're trying to have the same effects as current games but I believe electric types can not be paralyzed by any means. Where ground types are the ones who can be paralyzed by other moves like glare and body slam.
     
    59
    Posts
    6
    Years
    • Seen Jul 26, 2023
    I guess you want to look at pbCanParalyze?
    Im looking at it... but im bad at scripting really.

    Not sure if you're trying to have the same effects as current games but I believe electric types can not be paralyzed by any means. Where ground types are the ones who can be paralyzed by other moves like glare and body slam.
    I want to change it a little. Because in my opinion, it doesn´t really make sense that electric pokemon can´t be paralyzed by spores for example. It okay for them to be immune to electric paralysis but there are other kinds of paralysis that should be able to affect them.
     
    1,403
    Posts
    10
    Years
    • Seen Apr 29, 2024
    Im looking at it... but im bad at scripting really.

    It okay for them to be immune to electric paralysis but there are other kinds of paralysis that should be able to affect them.

    Okay. So you have access to the move in pbCanParalyze?, can you see the part of the code that makes Electric Pokémon immune? Can you describe what it checks for, and what you want it to check for instead?
     
    172
    Posts
    7
    Years
    • Seen Sep 6, 2022
    Im looking at it... but im bad at scripting really.

    Pbcanparalyze is a check for whether or not mons can be paralyzed.
    I'm not sure off the top of my head, but if you look at the places where that effect is defined "def" it would have some kind of list of how it interacts with the game and should say something about electric types and how they cannot be paralyzed.
    I want to change it a little. Because in my opinion, it doesn´t really make sense that electric pokemon can´t be paralyzed by spores for example. It okay for them to be immune to electric paralysis but there are other kinds of paralysis that should be able to affect them.
    I see. That part may be a bit harder because usually things that paralyze all use the same move effect of its solely paralysis so you may have to do those move by move
     
    Last edited:
    59
    Posts
    6
    Years
    • Seen Jul 26, 2023
    I guess that i will abandon that idea if it's so complex, but now testing things i have realized that in my game electric pokemon can be paralyzed... but by electrical moves too. Not only that but pokemon with abilities like Flower vail will get paralyzed too. If they are ground or have electric absorbing abilities they won´t. What's wrong? This is the line i found:
    PD: I test the original Essentials 17.2 script and i can also paralyse electric pokemon... i thought that in there it was ok but no

    #===============================================================================
    # Paralyze
    #===============================================================================
    def pbCanParalyze?(attacker,showMessages,move=nil)
    return false if fainted?
    if status==PBStatuses::PARALYSIS
    @battle.pbDisplay(_INTL("{1} is already paralyzed!",pbThis)) if showMessages
    return false
    end
    if self.status!=0 ||
    (@effects[PBEffects::Substitute]>0 && (!move || !move.ignoresSubstitute?(attacker)))
    isConst?(ability,PBAbilities,:COMATOSE) ||
    pbShieldsUp?
    @battle.pbDisplay(_INTL("But it failed!")) if showMessages
    return false
    end
    if @battle.field.effects[PBEffects::MistyTerrain]>0 &&
    !self.isAirborne?(attacker && attacker.hasMoldBreaker)
    @battle.pbDisplay(_INTL("The Misty Terrain prevented {1} from being paralyzed!",pbThis(true))) if showMessages
    return false
    end
    if pbHasType?(:ELECTRIC) && !hasWorkingItem(:RINGTARGET) && USENEWBATTLEMECHANICS
    @battle.pbDisplay(_INTL("It doesn't affect {1}...",pbThis(true))) if showMessages
    return false
    end
    if !attacker || !attacker.hasMoldBreaker
    if hasWorkingAbility(:LIMBER) ||
    (hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS)) ||
    (hasWorkingAbility(:LEAFGUARD) && (@battle.pbWeather==PBWeather::SUNNYDAY ||
    @battle.pbWeather==PBWeather::HARSHSUN))
    @battle.pbDisplay(_INTL("{1}'s {2} prevents paralysis!",pbThis,PBAbilities.getName(self.ability))) if showMessages
    return false
    end
    if pbPartner.hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS)
    abilityname=PBAbilities.getName(pbPartner.ability)
    @battle.pbDisplay(_INTL("{1}'s partner's {2} prevents paralysis!",pbThis,abilityname)) if showMessages
    return false
    end
    end
    if pbOwnSide.effects[PBEffects::Safeguard]>0 &&
    (!attacker || !attacker.hasWorkingAbility(:INFILTRATOR))
    @battle.pbDisplay(_INTL("{1}'s team is protected by Safeguard!",pbThis)) if showMessages
    return false
    end
    return true
    end

    def pbCanParalyzeSynchronize?(opponent)
    return false if self.status!=0 || isConst?(ability,PBAbilities,:COMATOSE) || pbShieldsUp?
    return false if @battle.field.effects[PBEffects::MistyTerrain]>0 && !self.isAirborne?
    return false if pbHasType?(:ELECTRIC) && !hasWorkingItem(:RINGTARGET) && USENEWBATTLEMECHANICS
    if hasWorkingAbility(:LIMBER) ||
    (hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS)) ||
    (hasWorkingAbility(:LEAFGUARD) && (@battle.pbWeather==PBWeather::SUNNYDAY ||
    @battle.pbWeather==PBWeather::HARSHSUN))
    @battle.pbDisplay(_INTL("{1}'s {2} prevents {3}'s {4} from working!",
    pbThis,PBAbilities.getName(self.ability),
    opponent.pbThis(true),PBAbilities.getName(opponent.ability)))
    return false
    end
    if pbPartner.hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS)
    @battle.pbDisplay(_INTL("{1}'s {2} prevents {3}'s {4} from working!",
    pbPartner.pbThis,PBAbilities.getName(pbPartner.ability),
    opponent.pbThis(true),PBAbilities.getName(opponent.ability)))
    return false
    end
    return true
    end

    def pbParalyze(attacker=nil,msg=nil)
    self.status=PBStatuses::PARALYSIS
    self.statusCount=0
    @battle.pbCommonAnimation("Paralysis",self,nil)
    if msg && msg!=""
    @battle.pbDisplay(msg)
    else
    @battle.pbDisplay(_INTL("{1} is paralyzed! It may be unable to move!",pbThis))
    end
    PBDebug.log("[Status change] #{pbThis} was paralyzed")
    if attacker && self.index!=attacker.index &&
    self.hasWorkingAbility(:SYNCHRONIZE)
    if attacker.pbCanParalyzeSynchronize?(self)
    PBDebug.log("[Ability triggered] #{self.pbThis}'s Synchronize")
    attacker.pbParalyze(nil,_INTL("{1}'s {2} paralyzed {3}! It may be unable to move!",
    self.pbThis,PBAbilities.getName(self.ability),attacker.pbThis(true)))
    end
    end
    end
     
    Last edited:
    172
    Posts
    7
    Years
    • Seen Sep 6, 2022
    I guess that i will abandon that idea if it's so complex, but now testing things i have realized that in my game electric pokemon can be paralyzed... but by electrical moves too. Not only that but pokemon with abilities like Flower vail will get paralyzed too. If they are ground or have electric absorbing abilities they won´t. What's wrong? This is the line i found:

    #===============================================================================
    # Paralyze
    #===============================================================================
    def pbCanParalyze?(attacker,showMessages,move=nil)
    return false if fainted?
    if status==PBStatuses::PARALYSIS
    @battle.pbDisplay(_INTL("{1} is already paralyzed!",pbThis)) if showMessages
    return false
    end
    if self.status!=0 ||
    (@effects[PBEffects::Substitute]>0 && (!move || !move.ignoresSubstitute?(attacker)))
    isConst?(ability,PBAbilities,:COMATOSE) ||
    pbShieldsUp?
    @battle.pbDisplay(_INTL("But it failed!")) if showMessages
    return false
    end
    if @battle.field.effects[PBEffects::MistyTerrain]>0 &&
    !self.isAirborne?(attacker && attacker.hasMoldBreaker)
    @battle.pbDisplay(_INTL("The Misty Terrain prevented {1} from being paralyzed!",pbThis(true))) if showMessages
    return false
    end
    if pbHasType?(:ELECTRIC) && !hasWorkingItem(:RINGTARGET) && USENEWBATTLEMECHANICS
    @battle.pbDisplay(_INTL("It doesn't affect {1}...",pbThis(true))) if showMessages
    return false
    end
    if !attacker || !attacker.hasMoldBreaker
    if hasWorkingAbility(:LIMBER) ||
    (hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS)) ||
    (hasWorkingAbility(:LEAFGUARD) && (@battle.pbWeather==PBWeather::SUNNYDAY ||
    @battle.pbWeather==PBWeather::HARSHSUN))
    @battle.pbDisplay(_INTL("{1}'s {2} prevents paralysis!",pbThis,PBAbilities.getName(self.ability))) if showMessages
    return false
    end
    if pbPartner.hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS)
    abilityname=PBAbilities.getName(pbPartner.ability)
    @battle.pbDisplay(_INTL("{1}'s partner's {2} prevents paralysis!",pbThis,abilityname)) if showMessages
    return false
    end
    end
    if pbOwnSide.effects[PBEffects::Safeguard]>0 &&
    (!attacker || !attacker.hasWorkingAbility(:INFILTRATOR))
    @battle.pbDisplay(_INTL("{1}'s team is protected by Safeguard!",pbThis)) if showMessages
    return false
    end
    return true
    end

    def pbCanParalyzeSynchronize?(opponent)
    return false if self.status!=0 || isConst?(ability,PBAbilities,:COMATOSE) || pbShieldsUp?
    return false if @battle.field.effects[PBEffects::MistyTerrain]>0 && !self.isAirborne?
    return false if pbHasType?(:ELECTRIC) && !hasWorkingItem(:RINGTARGET) && USENEWBATTLEMECHANICS
    if hasWorkingAbility(:LIMBER) ||
    (hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS)) ||
    (hasWorkingAbility(:LEAFGUARD) && (@battle.pbWeather==PBWeather::SUNNYDAY ||
    @battle.pbWeather==PBWeather::HARSHSUN))
    @battle.pbDisplay(_INTL("{1}'s {2} prevents {3}'s {4} from working!",
    pbThis,PBAbilities.getName(self.ability),
    opponent.pbThis(true),PBAbilities.getName(opponent.ability)))
    return false
    end
    if pbPartner.hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS)
    @battle.pbDisplay(_INTL("{1}'s {2} prevents {3}'s {4} from working!",
    pbPartner.pbThis,PBAbilities.getName(pbPartner.ability),
    opponent.pbThis(true),PBAbilities.getName(opponent.ability)))
    return false
    end
    return true
    end

    def pbParalyze(attacker=nil,msg=nil)
    self.status=PBStatuses::PARALYSIS
    self.statusCount=0
    @battle.pbCommonAnimation("Paralysis",self,nil)
    if msg && msg!=""
    @battle.pbDisplay(msg)
    else
    @battle.pbDisplay(_INTL("{1} is paralyzed! It may be unable to move!",pbThis))
    end
    PBDebug.log("[Status change] #{pbThis} was paralyzed")
    if attacker && self.index!=attacker.index &&
    self.hasWorkingAbility(:SYNCHRONIZE)
    if attacker.pbCanParalyzeSynchronize?(self)
    PBDebug.log("[Ability triggered] #{self.pbThis}'s Synchronize")
    attacker.pbParalyze(nil,_INTL("{1}'s {2} paralyzed {3}! It may be unable to move!",
    self.pbThis,PBAbilities.getName(self.ability),attacker.pbThis(true)))
    end
    end
    end

    its actually not very complicated at all. you just need to take some time and look at what the code is saying. the part you found specifically discusses how paralysis affects everything. so youre in the right spot.

    as far as the flower veil thing its just mentioning another way which paralysis affects the game. in that part of the code its saying paralysis wont work if a pokemon has flower veil and its teammate is a grass type.

    think of this list not as a list of things that get paralyzed, but the exceptions of paralysis.
     
    Last edited:
    59
    Posts
    6
    Years
    • Seen Jul 26, 2023
    I found out that the problem it's not in there. I put that script in another project and paralysis works normally... what could it be that makes this happen?
    Electric-type it's the only problem here, i can´t burn fire types or poison poison types...
     
    1,403
    Posts
    10
    Years
    • Seen Apr 29, 2024
    Wait, wait, wait. You're reporting a bug?! I thought you wanted to make it possible to paralyze Electrics. Anyway, my guess is that you turned off USENEWBATTLEMECHANICS (or maybe never turned it on, I don't know what the default is).

    EminanE said:
    Code:
    if pbHasType?(:ELECTRIC) && !hasWorkingItem(:RINGTARGET) && USENEWBATTLEMECHANICS
      @battle.pbDisplay(_INTL("It doesn't affect {1}...",pbThis(true))) if showMessages
    return false
     
    Last edited:

    WolfPP

    Spriter/ Pixel Artist
    1,309
    Posts
    5
    Years
  • If you remove ' &&USENEWBATTLEMECHANICS' will works.

    I did have the same problem and i did remove.

    Bulbapedia:
    Code:
    Generation VI
    
    Electric-type Pokémon are now immune to paralysis. 
    
    Generation VI onward (Stun Spore)
    
    Grass-type and Electric-type Pokémon, Pokémon with Overcoat, and Pokémon holding the Safety Goggles are now immune to Stun Spore.
     
    Last edited:
    172
    Posts
    7
    Years
    • Seen Sep 6, 2022
    I found out that the problem it's not in there. I put that script in another project and paralysis works normally... what could it be that makes this happen?
    Electric-type it's the only problem here, i can´t burn fire types or poison poison types...

    Please just take a second to read the code. It is possible to achieve what you want, you're just not bothering to learn how it works. We've given you the answer, it's not an error. Your change can be done very simply just looking at the code Mgriffin copied from your post.
     
    59
    Posts
    6
    Years
    • Seen Jul 26, 2023
    If you remove ' &&USENEWBATTLEMECHANICS' will works.

    I did have the same problem and i did remove.

    Bulbapedia:
    Code:
    Generation VI
    
    Electric-type Pokémon are now immune to paralysis. 
    
    Generation VI onward (Stun Spore)
    
    Grass-type and Electric-type Pokémon, Pokémon with Overcoat, and Pokémon holding the Safety Goggles are now immune to Stun Spore.

    I went to settings and found that USENEWBATTLEMECHANICS was in false. So it was doing a mix of things. I turn it on so that electric can´t be paralyzed by electric moves at least.
    PD: Im testing the basic mechanics and it looks like soon i will finally be ready to start doing the actual game :). I'm not bumping into errors anymore at least. Now im looking to create a "Repel" Key item.
    Thanks for your help until now again and again haha.
     
    Last edited:

    WolfPP

    Spriter/ Pixel Artist
    1,309
    Posts
    5
    Years
  • Well, i put 'USENEWBATTLEMECHANICS = true' and edit script to Stun Spore:

    In PokeBattle_MoveEffects:
    Spoiler:


    EDIT: Nvm, because Electric-type Pokémon are now immune to paralysis (Stun Spore effect too).
     
    Last edited:
    172
    Posts
    7
    Years
    • Seen Sep 6, 2022
    Now im looking to create a "Repel" Key item.
    Thanks for your help until now again and again haha.
    Btw a repel key items should be super easy if I'm not mistaken. Just get rid of the bit of code that disposes the item after use, go into the pbs and change repel to a key item. That's pretty much it.
     
    115
    Posts
    9
    Years
    • Seen Nov 17, 2023
    Just a quick thing to note, ground-types can be paralyzed but only from alternate typed moves like Glare and Body Slam, because they're immune to electric moves (duh).

    But currently electric types are still immune to paralysis, even from alternate type moves. So Glare fails, and Body Slam only does damage to them.
     

    WolfPP

    Spriter/ Pixel Artist
    1,309
    Posts
    5
    Years
  • Just a quick thing to note, ground-types can be paralyzed but only from alternate typed moves like Glare and Body Slam, because they're immune to electric moves (duh).

    But currently electric types are still immune to paralysis, even from alternate type moves. So Glare fails, and Body Slam only does damage to them.

    If you put true to 'USENEWBATTLEMECHANICS = ' in 'Settings' script, will work like gen 6 mechanic.
     
    Back
    Top