• 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.

[Custom Feature Question] Is it possible to have damage inflicted before the battle starts

  • 35
    Posts
    5
    Years
    • Seen Dec 25, 2022
    So I want an event where upon battling an opponent, the players team has several of their team members loose some (or all) their hp. Can this be done? I've tried the deal damage, and change hp commands but nothing happens.
     
    I didn't made this code. Credits to xPokejosex. Put this code in a new script above main.

    Code:
    def hurt_team(percentage) # Call an event with hurt_team(20) to make an 80% damage to the team, as an example.
      for i in 0...$Trainer.party.length
        calc = ($Trainer.party[i].hp * (percentage / 100.0)).floor
        $Trainer.party[i].hp = calc
      end
    end

    BONUS

    Code:
    def burn_team
      for i in 0...$Trainer.party.length
        $Trainer.party[i].status = PBStatuses::BURN
      end
    end

    You can use this code to inflict burn to your team with an event. Works the same way as the one for the damage. You can also poison, sleep or paralysis. The only thing that you have to change is the burn_team to sleep_team, poison_team or paralysis_team. And, of course, the PBStatuses::BURN to one of those statuses (SLEEP, POISON, PARALYSIS).

    Remember to call the event in the correct way for each other. (burn_team, sleep_team...)

    Again, credits tos xPokejosex
     
    Back
    Top