Advertisement
Caeles

Untitled

Apr 1st, 2020
793
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.73 KB | None | 0 0
  1. Demostración de la mecánica: https://imgur.com/UNaAm9s
  2.  
  3. Scripts:
  4.  
  5. Se define en PBTerrains los tags isLuz? y isSombra?
  6. Se define F como input en Controls
  7. Se definen las formas en MultipleForms
  8.  
  9. ---En Scene Map---
  10.    #Cambio de forma 802
  11.     if Input.trigger?(Input::F) && !pbMapInterpreterRunning? && $game_switches[101]
  12.           for i in $Trainer.party
  13.             if i.species==802
  14.               if  $game_variables[101]==1 #si es luz, pasa a sombra
  15.                if PBTerrain.isLuz?(pbGetTerrainTag)
  16.                  Kernel.pbMessage(_INTL("¡No puedes transformarte aquí!"))
  17.                  break
  18.                end
  19.                i.resetMovesOddish(0)
  20.                i.form=0
  21.                $Trainer.outfit=0
  22.                $game_variables[101]=0
  23.              else #si es sombra, pasa a luz
  24.                 if PBTerrain.isSombra?(pbGetTerrainTag)
  25.                    Kernel.pbMessage(_INTL("¡No puedes transformarte aquí!"))
  26.                    break
  27.                 end
  28.                 i.resetMovesOddish(1)
  29.                 i.form=1
  30.                 $Trainer.outfit=1
  31.                 $game_variables[101]=1
  32.               end  
  33.             $game_map.refresh
  34.             pbSEPlay("expfull")
  35.             break
  36.           end
  37.          end
  38.         end
  39.  
  40.  
  41. ----En Game_Map----
  42.   #Sombra y luz comprobaciones
  43.       elsif PBTerrain.isLuz?(@terrain_tags[tile_id]) && $globalluz==0
  44.         Kernel.pbStartOver
  45.       elsif PBTerrain.isSombra?(@terrain_tags[tile_id]) && $globalsombra==0
  46.         Kernel.pbStartOver
  47.       elsif PBTerrain.isLuz?(@terrain_tags[tile_id]) && $game_variables[101]==0
  48.           return false
  49.       elsif PBTerrain.isSombra?(@terrain_tags[tile_id]) && $game_variables[101]==1
  50.           return false      
  51.  
  52. ------En PBField_Field, bajo field_movement------
  53. $globalluz=250
  54. $globalsombra=250
  55.  
  56. Events.onStepTaken+=proc{
  57.   if PBTerrain.isLuz?(pbGetTerrainTag)
  58.     $globalluz-=5
  59.   elsif PBTerrain.isSombra?(pbGetTerrainTag)
  60.     $globalsombra-=5
  61.   end    
  62. }
  63.  
  64. --------En el script de Simple Hud de FL, en Coded Blue Bar-----------
  65.  if USEBAR
  66.       bar=IconSprite.new(0,yposition,@viewport1)
  67.       bar.bitmap=Bitmap.new(Graphics.width,Graphics.height)
  68.  
  69.         colors=[
  70.         Color.new(255,255,255),Color.new(160,160,160),     # Luz
  71.         Color.new(0,0,0),Color.new(160,160,160),      # Sombra
  72.      ]
  73.     if $game_switches[101]==true
  74.     #Luz
  75.     bar.bitmap.fill_rect(Rect.new(10,40,250*10/20,6),colors[1])
  76.     bar.bitmap.fill_rect(Rect.new(10,40,$globalluz*10/20,6),colors[0])
  77.     end
  78.     #Sombra
  79.     bar.bitmap.fill_rect(Rect.new(10,50,250*10/20,6),colors[3])
  80.     bar.bitmap.fill_rect(Rect.new(10,50,$globalsombra*10/20,6),colors[2])      
  81.    
  82.     bar.z = 1000
  83.     @hud.push(bar)
  84.    
  85.  end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement