1. function pokemonreturn takes integer playerslot, integer pkcondition returns nothing
  2. //if condition is 0 no one cares. If its 1, both players return pkmn.
  3. //Timer defeat for wild pokemon cannot happen here because endbattle deals with that.
  4. //Timer defeat for pokemontrainer fights however, is dealt with, here.
  5. set udg_TempInt3=playernumberid(udg_Playerhero[playerslot])
  6. call DisplayTextToForce( GetPlayersAll(), ("TempInt3 is " + I2S(udg_TempInt3)) )
  7. if ((udg_Playerhero[playerslot] == udg_PokemonTrainer[playerslot]) and (pkcondition !=1)) then//Should never get here, even by timer defeat.
  8. call DisplayTextToForce( GetPlayersAll(), "Map error 8")
  9. endif
  10. if((udg_ReturnPreventerCondition[playerslot] == false) or (pkcondition ==1) ) then//this bool is to prevent retarded/abuse esc spams.
  11. if(udg_Playerhero[playerslot] == udg_PokemonTeam[udg_Activepokemon[playerslot]]) then
  12. //Timerdefeat for VersusPlayerslot[playerslot], but playerslot player may also have not an pokemon outside. This is done so it doesnt bug.
  13. if (udg_HP[AIslot(playerslot)] != 0) then //detects wild pkmn fight
  14. call UnitRemoveAbilityBJ( 'A01R', udg_Playerhero[playerslot])//removes catch pokemon skill
  15. endif
  16. set udg_TempRect = playeritemrects(playerslot)
  17. set udg_TempX = GetRectCenterX(udg_TempRect)
  18. set udg_TempY = GetRectCenterY(udg_TempRect)
  19. call SetUnitX(udg_Playerhero[playerslot],udg_TempX)
  20. call SetUnitY(udg_Playerhero[playerslot],udg_TempY)//puts the pokemon "back to its ball"up to here
  21. set udg_NoPokemon[playerslot]=true
  22. set udg_NoPokemonInt[playerslot] = 10
  23. call SetTextTagPosUnitBJ( udg_NoPokemonText[playerslot], udg_Playerhero[playerslot], 0 )//moves dat floating text
  24. call SetTextTagTextBJ( udg_NoPokemonText[playerslot], I2S(udg_NoPokemonInt[playerslot]), 10 )//gives text: nopokemonint, converted from into to string
  25. call ShowTextTagForceBJ( true, udg_NoPokemonText[playerslot], GetPlayersAll() )//show floating text, cuz hidden
  26. // BELOW LIES THE THORN, DESTROYER OF IMAGINARY BEATIFUL WORLDS!(It is safe to put /* here and right after local multiboard.
  27. //If I display tempint3 here, it returns 24. Then it goes to assign player 24. ggwp
  28. call DisplayTextToForce( GetPlayersAll(), ("But after it becomes " + I2S(udg_TempInt3)) )

goto line:
Compare with:
text copy window edit this code post new code