• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Trading Card Game 2 protagonist in the poll by clicking here.
  • 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
    3
    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.
     
    Give this a shot

    battler.pbBurn(nil,_INTL("Typhlosion was burned by it's own power!")) if battler.pbCanBurn?(battler,false,self)
     
    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 ?
     
    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