• 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] Ability that burns yourself

6
Posts
2
Years
    • Seen Apr 24, 2023
    Hello everyone.

    This is my first time ever posting on a forum.

    I just started my own Pokémon fangame and overall the experience's been nice.

    I was creating an ability for my Mega Typhlosion that boosts your fire type attacks but burns yourself upon mega-evolving

    This is the code I've written:

    BattleHandlers::AbilityOnSwitchIn.add(:FINALFLARE,
    proc { |ability, battler, battle|
    battle.pbShowAbilitySplash(battler)
    battler.pbBurn(nil,_INTL("Typhlosion was burned by it's own power!"))
    battle.pbHideAbilitySplash(battler)
    }
    )

    BattleHandlers::DamageCalcUserAbility.add(:FINALFLARE,
    proc { |ability,user,target,move,mults,baseDmg,type,battler,battle|
    mults[:base_damage_multiplier] *= 1.5 if type == :FIRE
    }
    )

    The obvious problem ? Mega Typhlosion burns itself every turn he comes in. I don't know how to make it so if you are already burned (or any other status effect) the ability doesn't proc (the status part, the damage boost stays always).

    Has anyone an idea ?

    Thanks for reading me.
     
    20
    Posts
    11
    Years
    • Seen Sep 11, 2022
    Give this a shot

    battler.pbBurn(nil,_INTL("Typhlosion was burned by it's own power!")) if battler.pbCanBurn?(battler,false,self)
     
    6
    Posts
    2
    Years
    • Seen Apr 24, 2023
    I've tried it and now the [battle.pbShowAbilitySplash(battler)] appears but Typhlosion doesn't get burned.

    Is it because [pbCanBurn?] detects that Typhlosion is a fire type and therefore immune to burn ?
     
    10
    Posts
    8
    Years
    • Seen yesterday
    Yep, since you are cheking if the battler can burn when activating the effect it wont trigger on typhlosion since it's a fire type. Instead try using "pbHasAnyStatus?"

    Code:
    battler.pbBurn(nil,_INTL("Typhlosion was burned by it's own power!")) if battler.pbHasAnyStatus?(battler,false,self)

    Where it would trigger only if the user has no status effect at all.

    You can also make it to overrite any other status to cause the burn if you want, to keep it in theme that it's power is greater than any other effect

    Code:
    if battler.status != :BURN
                 battler.pbCureStatus 
                 battler.pbBurn(nil,_INTL("Typhlosion was burned by it's own power!"))
    Can't test it rn but it should be something like this
     
    Back
    Top