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

TM shop with compatible icons

FL

Pokémon Island Creator
  • 2,545
    Posts
    14
    Years
    • Seen today
    Code:
    #===============================================================================
    # * TM shop with compatible icons - by FL (Credits will be apreciated)
    #===============================================================================
    #
    # This script is for Pokémon Essentials. It displays your current party icons
    # animated in shop screen and the pokémon that can learn a selected TM will be
    # colored and more animated.
    #
    #===============================================================================
    #
    # To this script works, put it above main, put a 160x128 background box for
    # pokémon icons in TMBOXPATH location and change the following lines in
    # PokémonMart Script (use Ctrl+F to find it):
    # 
    # -Change line 'def pbStartBuyOrSellScene(buying,stock,adapter)' to
    # 'def pbStartBuyOrSellScene(buying,stock,adapter,tmshop=false)'
    # -After line '@sprites["background"].setBitmap("Graphics/Pictures/martscreen")'
    # put 'initializeTMSprites(tmshop)'
    # -After each line 
    # '@sprites["icon"][email protected](itemwindow.item)' put 
    # 'checksTMs if @tmshop'
    # -Change line 'def pbBuyScreen' to 'def pbBuyScreen(tmshop=false)'
    # -Change line '@scene.pbStartBuyScene(@stock,@adapter)' to
    # '@scene.pbStartBuyScene(@stock,@adapter,tmshop)'
    # -Change line 'def pbPokemonMart(stock,speech=nil,cantsell=false)' to
    # 'def pbPokemonMart(stock,speech=nil,cantsell=false, tmshop=false)'
    # -Change line 'screen.pbBuyScreen' to 'screen.pbBuyScreen(tmshop)'
    #
    # To call it, use 'pbPokemonMart([ITEMS],nil,false,true)'
    # Ex: A 'pbPokemonMart([PBItems::TM01,PBItems::TM02,PBItems::TM03])' will be
    # 'pbPokemonMart([PBItems::TM01,PBItems::TM02,PBItems::TM03],nil,false,true)'  
    #
    #===============================================================================
    
    class PokemonMartScene
    
    TMBOXPATH="Graphics/Pictures/marttmbox" # You can change if you wish
    
    def initializeTMSprites(tmshop)
      @tmshop=tmshop
      if tmshop
        @sprites["tmbox"]=IconSprite.new(0,Graphics.height-224,@viewport)
        @sprites["tmbox"].setBitmap(TMBOXPATH)
        for i in 0...$Trainer.party.length
          next if $Trainer.party[i].isEgg? # Ignores eggs
          @sprites["pokemon#{i}"]=PokemonIconSprite.new($Trainer.party[i],@viewport) 
          @sprites["pokemon#{i}"].x=48*(i/2)
          @sprites["pokemon#{i}"].y=(Graphics.height-228)+56*(i%2)
        end
      end
    end  
    
    def checksTMs
      for i in 0...$Trainer.party.length
        next if $Trainer.party[i].isEgg?
        flag=false
        item=@sprites["itemwindow"].item
        if $ItemData[item][ITEMPOCKET]==4
          machine=$ItemData[item][ITEMMACHINE]
          flag=pbSpeciesCompatible?($Trainer.party[i].species,machine)
        end
        # If you don't wish the selected animation change
        # the below line for 'if false'
        if @sprites["pokemon#{i}"].selected!=flag
          @sprites["pokemon#{i}"].selected=flag
          (flag) ? @sprites["pokemon#{i}"].x-=8 : @sprites["pokemon#{i}"].x+=8
        end
        gray=0
        gray=255 if !flag # Comment this line if you didn't want the uncolored sprite
        @sprites["pokemon#{i}"].tone=Tone.new(0,0,0,gray)
      end
    end
    
    def pbStartBuyScene(stock,adapter,tmshop=false) #redefine
      pbStartBuyOrSellScene(true,stock,adapter,tmshop)
    end
      
    end
     

    Attachments

    • [PokeCommunity.com] TM shop with compatible icons
      tmshopscreen.png
      6.4 KB · Views: 257
    • [PokeCommunity.com] TM shop with compatible icons
      marttmbox.png
      1.4 KB · Views: 123
    Last edited:
    Clever idea! I like it... Um I can't post such a small reply apparently...
     
    Back
    Top