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

Adjustable Dark Circle (like Dewford Gym)

1,224
Posts
10
Years
  • Simply insert this code into a new section above the Main

    Code:
    DEFAULTDARKCIRCLERAD = 64
    $DarknessSprite = nil
    
    class PokeBattle_Trainer
      attr_writer :beginDarkCircle
      def beginDarkCircle
        @beginDarkCircle = false if !@beginDarkCircle
        return @beginDarkCircle
      end
      
      attr_writer :darkCircleRadius
      def darkCircleRadius
        if !@darkCircleRadius
          @darkCircleRadius = DEFAULTDARKCIRCLERAD
        end
        return @darkCircleRadius
      end  
    end
    
    def beginDarkCircle
      $DarknessSprite = DarknessSprite.new
      $DarknessSprite.radius = $Trainer.darkCircleRadius
      $Trainer.beginDarkCircle = true
    end
    
    def endDarkCircle
      return if !$Trainer.beginDarkCircle
      $DarknessSprite.dispose
      $DarknessSprite = nil
      $Trainer.beginDarkCircle = false
      $Trainer.darkCircleRadius = DEFAULTDARKCIRCLERAD
    end
    
    def changeDarkCircleRadius(newRadius)
      return if $DarknessSprite == nil
      $Trainer.darkCircleRadius = newRadius
      $DarknessSprite.radius = $Trainer.darkCircleRadius
    end
    
    def changeDarkCircleRadiusSlowly(newRadius)
      return if $DarknessSprite == nil
      $Trainer.darkCircleRadius = newRadius
      changeRate = (newRadius - $DarknessSprite.radius)/12
      return if changeRate == 0
      for i in 0...12
        $DarknessSprite.radius += changeRate
        pbWait(1)
      end
      $DarknessSprite.radius = $Trainer.darkCircleRadius
    end
    
    
    Events.onMapSceneChange+=proc{|sender,e|
      scene=e[0]
      mapChanged=e[1]
      return if !$Trainer
      beginDarkCircle if $Trainer.beginDarkCircle && $DarknessSprite == nil
      if $Trainer.beginDarkCircle && $PokemonTemp.darknessSprite
        $PokemonTemp.darknessSprite.dispose
        $PokemonTemp.darknessSprite = nil
      end
    }

    Available scripts you should use:
    beginDarkCircle # Initially draw the circle, don't have to do this again unless you get rid of it
    endDarkCircle # Permanently get rid of the circle
    changeDarkCircleRadius(newRadius) #Instantly change the radius of the circle
    changeDarkCircleRadiusSlowly(newRadius) #Slowly change the radius of the circle (smooth animation)

    Script in action
    f63335b4454ad47e2150f47fed426881.gif
     
    Last edited:

    SpartaLazor

    Doofus Lunarius
    184
    Posts
    8
    Years
  • I'm really loving this so far. You did a good job on it!

    Just one question though. Is there a way to add to the current radius without immediately expanding/contracting to the next size? For example, if someone whose circle is currently at a width of 32 interacts with an object, it increases their radius to 64, but if someone with a radius of 64 interacts with it, it'd increase it to 96, If that makes sense.
     
    12
    Posts
    7
    Years
    • Seen Dec 26, 2017
    I followed the instructions however sadly this script did not work for me.
    Any specific version or place to put the new script?
     
    Back
    Top