Vai al contenuto

Rilevato Ad-Blocker. Per favore disabilita il tuo adblocker quando navighi su makerando.com - Non c'è nessun annuncio invasivo.

  • Chatbox

    You don't have permission to chat.
    Load More
Ally

Gameplay Multiple Fogs

Recommended Posts

Nome Script: Multiple Fogs
Versione: 1.0
Autore/i: Woratana

Informazioni:
Con questo script, è possibile utilizzare le Fog come nei tool precedenti (opzione eliminata in RMVX).

Istruzioni:
Inserite lo script sopra Main.
Le istruzioni sono all'interno dello script.

Script:

#===============================================================
# ● [VX] ◦ Multiple Fogs ◦ □
# * Use unlimited layers of fog *
#--------------------------------------------------------------
# ◦ by Woratana [[email protected]]
# ◦ Thaiware RPG Maker Community
# ◦ Released on: 13/05/2008
# ◦ Version: 1.0
#--------------------------------------------------------------

#==================================================================
# ** HOW TO USE **
# * use event command 'Script...' for the any script line below~
#-----------------------------------------------------------------
#
#---------------------------------------------------------------
# ** SETUP FOG PROPERTIES & SHOW FOG **
# * You have to setup fog properties, before show fog~
#-------------------------------------------------------------
# * There are 3 ways to setup fog properties:
# >> Setup Fog [Custom]:
# $fog.name = 'image_name' # Image file name, must be in fog image path (setup path below).
# $fog.hue = (integer) # Fog's hue. 0 - 360, 0 for no hue.
# $fog.tone = [red, green, blue, gray] # Fog's tone color.
# $fog.opacity = (integer) # Fog's opacity. 0 - 255, you will not see fog in 0.
# $fog.blend = (0, 1, or 2) # Fog's blend type. 0 for Normal, 1 for Add, 2 for Subtract.
# $fog.zoom = (integer) # Fog's size (in %). 100 for normal size.
# $fog.sx = (+ or - integer) # Fog's horizontal move speed.
# $fog.sy = (+ or - integer) # Fog's vertical move speed.
#
# >> Setup Fog [From Preset]:
# (You can setup fog presets, in part FOG PRESET SETUP below)
# $fog.load_preset(preset_id)
#
# >> Setup Fog [From Fog that showing]:
# $fog.load_fog(fog_id)
#
#--------------------------------------------------------------
# ** SHOW FOG **
#-------------------------------------------------------------
# After setup the fog, show fog by call script:
# $fog.show(fog_id)
#
# In case you want to show new fog on same ox, oy, tone as old fog. Call Script:
# $fog.show(old_fog_id, false)
#
# * fog_id: the ID number you want to put this fog in.
# (It can be any positive number or zero)
#
# After you show fog, the fog properties you've set will replace with default setting.
# (You can setup default setting, in part FOG DEFAULT SETTING below)
#
#--------------------------------------------------------------
# ** DELETE FOG **
#-------------------------------------------------------------
# You can delete 1 or more fog(s) at a time by call script:
# $fog.delete(fog_id, fog_id, fog_id, ...)
#
#---------------------------------------------------------------
# ** OLD FOG CONTROL EVENT COMMANDS **
#-------------------------------------------------------------
# Change Fog Tone:
# $game_map.fogtone(fog_id, [red, green, blue, gray], duration)
# e.g. $game_map.fogtone(1, [100,200,-100,0], 10)

# Change Fog Opacity:
# $game_map.fogopac(fog_id, new_opacity, duration)
# e.g. $game_map.fogopac(2, 200, 10)
#
#---------------------------------------------------------------
# ** ADDITIONAL SETTINGS **
#-------------------------------------------------------------
# Change Fog Image's Path:
# $game_map.fog_path = 'image_path'
# e.g. $game_map.fog_path = 'Graphics/Pictures/'

# Turn ON/OFF [Automatically clear all fogs when transfer player]:
# $game_map.fog_reset = (true / false)
#
#===============================================================

#==================================================================
# START ** MULTIPLE FOG SETUP **
#==================================================================
class Game_Map
  alias wora_mulfog_gammap_ini initialize
  def initialize
    wora_mulfog_gammap_ini

    #==================================================================
    # ** MULTIPLE FOG SETUP ** SETTINGS
    #--------------------------------------------------------------
    @fog_path = 'Graphics/Pictures/'
    # Fog image's path
    @fog_reset = true # (true or false)
    # Automatically clear all multiple fogs when transfer player
    #==================================================================

    @mulfog_name = []
    @mulfog_hue = []
    @mulfog_opacity = []
    @mulfog_blend_type = []
    @mulfog_zoom = []
    @mulfog_sx = []
    @mulfog_sy = []
    @mulfog_ox = []
    @mulfog_oy = []
    @mulfog_tone = []
    @mulfog_tone_target = []
    @mulfog_tone_duration = []
    @mulfog_opacity_duration = []
    @mulfog_opacity_target = []
  end
end
class Wora_Multiple_Fog
  def set_default
    #==================================================================
    # ** MULTIPLE FOG SETUP ** FOG DEFAULT SETTING
    #--------------------------------------------------------------
    @name = ''
    @hue = 0
    @opacity = 64
    @blend = 0
    @zoom = 200
    @sx = 0
    @sy = 0
    @tone = [0,0,0,0]
    #==================================================================
  end

  def load_preset(preset_id)
    case preset_id
    #==================================================================
    # ** MULTIPLE FOG SETUP ** FOG PRESET SETUP
    #--------------------------------------------------------------
    when 1 # Preset ID 1
      @name = '001-Fog01'
      @hue = 0
      @tone = [100,-255,20,0]
      @opacity = 60
      @blend = 0
      @zoom = 200
      @sx = 10
      @sy = 0
    when 2 # Preset ID 2
      @name = '002-Clouds01'
      @hue = 0
      @tone = [0,0,0,0]
      @opacity = 200
      @blend = 1
      @zoom = 200
      @sx = -2
      @sy = -2
    #==================================================================
    end
  end
#==================================================================
# END ** MULTIPLE FOG SETUP **
# * Don't change anything below unless you know what you're doing.
#==================================================================

  attr_accessor :name, :hue, :opacity, :blend, :zoom, :sx, :sy, :tone
  def initialize
    set_default
  end

  def load_fog(id)
    @name = $game_map.mulfog_name[id].sub($game_map.fog_path, '')
    @hue = $game_map.mulfog_hue[id]
    @opacity = $game_map.mulfog_opacity[id]
    @blend = $game_map.mulfog_blend_type[id]
    @zoom = $game_map.mulfog_zoom[id]
    @sx = $game_map.mulfog_sx[id]
    @sy = $game_map.mulfog_sy[id]
    tn = $game_map.mulfog_tone[id]
    @tone = [tn.red, tn.blue, tn.green, tn.gray]
  end

  def show(id, reset_all = true)
    $game_map.mulfog_name[id] = $game_map.fog_path + @name
    $game_map.mulfog_hue[id] = @hue
    $game_map.mulfog_opacity[id] = @opacity
    $game_map.mulfog_blend_type[id] = @blend
    $game_map.mulfog_zoom[id] = @zoom
    $game_map.mulfog_sx[id] = @sx
    $game_map.mulfog_sy[id] = @sy
    $game_map.mulfog_tone[id] = Tone.new(@tone[0], @tone[1], @tone[2], @tone[3])
    if $game_map.mulfog_ox[id].nil? or reset_all
      $game_map.mulfog_ox[id] = 0
      $game_map.mulfog_oy[id] = 0
      $game_map.mulfog_tone_target[id] = Tone.new(0, 0, 0, 0)
      $game_map.mulfog_tone_duration[id] = 0
      $game_map.mulfog_opacity_duration[id] = 0
      $game_map.mulfog_opacity_target[id] = 0
    end
    set_default
  end

  def delete(*args)
    args.each do |id|
      $game_map.mulfog_name[id] = ''
    end
  end
end

class Game_Interpreter
  alias wora_mulfog_interpret_com201 command_201
  #--------------------------------------------------------------------------
  # * Transfer Player
  #--------------------------------------------------------------------------
  def command_201
    if $game_map.fog_reset
      if @params[0] == 0; id_map = @params[1]
      else; id_map = $game_variables[@params[1]]
      end
      $game_map.clear_mulfog if id_map != @map_id
    end
    wora_mulfog_interpret_com201
  end
end

class Game_Map
  attr_accessor :mulfog_name, :mulfog_hue, :mulfog_opacity, :mulfog_blend_type,
  :mulfog_zoom, :mulfog_sx, :mulfog_sy, :mulfog_ox, :mulfog_oy, :mulfog_tone,
  :mulfog_tone_target, :mulfog_tone_duration, :mulfog_opacity_duration,
  :mulfog_opacity_target, :fog_reset, :fog_path

  alias wora_mulfog_gammap_upd update
  def update
    wora_mulfog_gammap_upd
    @mulfog_name.each_index do |i|
      next if @mulfog_name[i].nil? or @mulfog_name[i] == ''
      # Manage fog scrolling
      @mulfog_ox[i] -= @mulfog_sx[i] / 8.0
      @mulfog_oy[i] -= @mulfog_sy[i] / 8.0
      # Manage change in fog color tone
      if @mulfog_tone_duration[i] >= 1
        d = @mulfog_tone_duration[i]
        target = @mulfog_tone_target[i]
        @mulfog_tone[i].red = (@mulfog_tone[i].red * (d - 1) + target.red) / d
        @mulfog_tone[i].green = (@mulfog_tone[i].green * (d - 1) + target.green) / d
        @mulfog_tone[i].blue = (@mulfog_tone[i].blue * (d - 1) + target.blue) / d
        @mulfog_tone[i].gray = (@mulfog_tone[i].gray * (d - 1) + target.gray) / d
        @mulfog_tone_duration[i] -= 1
      end
      # Manage change in fog opacity level
      if @mulfog_opacity_duration[i] >= 1
        d = @mulfog_opacity_duration[i]
        @mulfog_opacity[i] = (@mulfog_opacity[i] * (d - 1) + @mulfog_opacity_target[i]) / d
        @mulfog_opacity_duration[i] -= 1
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Start Changing Fog Color Tone
  #--------------------------------------------------------------------------
  def fogtone(i, tone, duration)
    duration = duration * 2
    tone = Tone.new(tone[0], tone[1], tone[2], tone[3])
    @mulfog_tone_target[i] = tone.clone
    @mulfog_tone_duration[i] = duration
    if @mulfog_tone_duration[i] == 0
      @mulfog_tone[i] = @mulfog_tone_target[i].clone
    end
  end
  #--------------------------------------------------------------------------
  # * Start Changing Fog Opacity Level
  #--------------------------------------------------------------------------
  def fogopac(i, opacity, duration)
    duration = duration * 2
    @mulfog_opacity_target[i] = opacity * 1.0
    @mulfog_opacity_duration[i] = duration
    if @mulfog_opacity_duration[i] == 0
      @mulfog_opacity[i] = @mulfog_opacity_target[i]
    end
  end

  def clear_mulfog
    @mulfog_name.each_index {|i| @mulfog_name[i] = '' }
  end
end
$worale = {} if !$worale
$worale['MutipleFog'] = true
$fog = Wora_Multiple_Fog.new
class Spriteset_Map
  alias wora_mulfog_sprmap_crepal create_parallax
  alias wora_mulfog_sprmap_updpal update_parallax
  alias wora_mulfog_sprmap_dispal dispose_parallax

  def create_parallax
    @mulfog = []
    @mulfog_name = []
    @mulfog_hue = []
    wora_mulfog_sprmap_crepal
  end

  def update_parallax
    wora_mulfog_sprmap_updpal
    $game_map.mulfog_name.each_index do |i|
      next if $game_map.mulfog_name[i].nil?
      # If fog is different than current fog
      if @mulfog_name[i] != $game_map.mulfog_name[i] or @mulfog_hue[i] != $game_map.mulfog_hue[i]
        @mulfog_name[i] = $game_map.mulfog_name[i]
        @mulfog_hue[i] = $game_map.mulfog_hue[i]
        if @mulfog[i].nil?
          @mulfog[i] = Plane.new(@viewport1)
          @mulfog[i].z = 3000
        end
        if @mulfog[i].bitmap != nil
          @mulfog[i].bitmap.dispose
          @mulfog[i].bitmap = nil
        end
        if @mulfog_name[i] != ''
          @mulfog[i].bitmap = Cache.load_bitmap('', @mulfog_name[i], @mulfog_hue[i])
        end
        Graphics.frame_reset
      end
      next if @mulfog[i].bitmap.nil?
      # Update fog plane
      @mulfog[i].zoom_x = ($game_map.mulfog_zoom[i] / 100.0) if @mulfog[i].zoom_x != ($game_map.mulfog_zoom[i] / 100.0)
      @mulfog[i].zoom_y = ($game_map.mulfog_zoom[i] / 100.0) if @mulfog[i].zoom_y != ($game_map.mulfog_zoom[i] / 100.0)
      @mulfog[i].opacity = $game_map.mulfog_opacity[i] if @mulfog[i].opacity != $game_map.mulfog_opacity[i]
      @mulfog[i].blend_type = $game_map.mulfog_blend_type[i] if @mulfog[i].blend_type != $game_map.mulfog_blend_type[i]
      @mulfog[i].ox = ($game_map.display_x / 8.0 + $game_map.mulfog_ox[i]) if @mulfog[i].ox != ($game_map.display_x / 8.0 + $game_map.mulfog_ox[i])
      @mulfog[i].oy = ($game_map.display_y / 8.0 + $game_map.mulfog_oy[i]) if @mulfog[i].oy != ($game_map.display_y / 8.0 + $game_map.mulfog_oy[i])
      @mulfog[i].tone = $game_map.mulfog_tone[i] if @mulfog[i].tone != $game_map.mulfog_tone[i]
    end
  end

  def dispose_parallax
    @mulfog.each_index do |i|
      next if @mulfog[i].nil?
      @mulfog[i].bitmap.dispose if !@mulfog[i].bitmap.nil?
      @mulfog[i].dispose
    end
    wora_mulfog_sprmap_dispal
  end
end
#==================================================================
# [END] VX Multiple Fog by Woratana [[email protected]]
#==================================================================
Incompatibilità:
N/D

Condividi questo messaggio


Link di questo messaggio
Condividi su altri siti

Crea un account o accedi per lasciare un commento

You need to be a member in order to leave a comment

Crea un account

Iscriviti per un nuovo account nella nostra comunità. È facile!

Registra un nuovo account

Accedi

Sei già registrato? Accedi qui.

Accedi Ora

  • Contenuti simili

    • Da Ally
      Nome Script: Napoleon's Minimap V1.06a
      Versione: 1.06a
      Autore/i: Napoleon
       
      Informazioni:
      Mini-Map script molto bello e personalizzabile con varie opzioni =)
       
      Screenshots:
       
       
      Istruzioni:
      Istruzioni e script all'interno della demo.
       
      Demo:
      https://www.dropbox.com/s/jm92rbqb5eadryr/Napoleons%20Master%20Demo.zip
    • Da Ally
      Nome Script: Camminata 8 Direzioni
      Versione: N/D
      Autore/i: Raizen884
       
      Informazioni:
      Script che simula le 8 direzioni di camminata.
       
      Istruzioni:
      Inserite lo script sotto Material.
       
      Script:
       
      #=======================================================# Engine 8 direções.# Autor: Raizen884# Mude completamente o seu jogo de 4 direções, para# 8 direções. O script vai adicionar movimentos em 8# direções para o personagem e para todos os eventos# no jogo.#=======================================================class Game_Player < Game_Character def move_by_input return if !movable? || $game_map.interpreter.running? move_diagonal(4, 2) if Input.dir8 == 1 move_straight(2) if Input.dir8 == 2 move_diagonal(6, 2) if Input.dir8 == 3 move_straight(4) if Input.dir8 == 4 move_diagonal(6, 8) if Input.dir8 == 9 move_straight(6) if Input.dir8 == 6 move_diagonal(4, 8) if Input.dir8 == 7 move_straight(8) if Input.dir8 == 8 end def move_diagonal(horz, vert) @followers.move if diagonal_passable?(@x, @y, horz, vert) check_event_trigger_touch(@x+1, @y+1) if horz == 6 and vert == 2 check_event_trigger_touch(@x+1, @y-1) if horz == 6 and vert == 8 check_event_trigger_touch(@x-1, @y-1) if horz == 4 and vert == 8 check_event_trigger_touch(@x-1, @y+1) if horz == 4 and vert == 2 super endendclass Game_Character < Game_CharacterBase def move_toward_character(character) sx = distance_x_from(character.x) sy = distance_y_from(character.y) if sx.abs > sy.abs and sy == 0 move_straight(sx > 0 ? 4 : 6) move_straight(sy > 0 ? 8 : 2) if !@move_succeed && sy != 0 elsif sx.abs > sy.abs and sy > 0 if sx > 0 move_diagonal(4, 8) else move_diagonal(6, 8) end elsif sx.abs > sy.abs and sy < 0 if sx > 0 move_diagonal(4, 2) else move_diagonal(6, 2) end end if sx.abs <= sy.abs and sx == 0 move_straight(sy > 0 ? 8 : 2) move_straight(sx > 0 ? 4 : 6) if !@move_succeed && sx != 0 elsif sx.abs <= sy.abs and sx > 0 if sy > 0 move_diagonal(4, 8) else move_diagonal(4, 2) end elsif sx.abs <= sy.abs and sx < 0 if sy > 0 move_diagonal(6, 8) else move_diagonal(6, 2) end endend def move_random case rand(2) when 0 move_straight(2 + rand(4) * 2, false) when 1 move_diagonal(2 + rand(4) * 2, 2 + rand(4) * 2) end end def move_away_from_character(character) sx = distance_x_from(character.x) sy = distance_y_from(character.y) if sx.abs > sy.abs and sy == 0 move_straight(sx > 0 ? 6 : 4) move_straight(sy > 0 ? 2 : 8) if !@move_succeed && sy != 0 elsif sx.abs > sy.abs and sy < 0 if sx < 0 move_diagonal(4, 8) else move_diagonal(6, 8) end elsif sx.abs > sy.abs and sy > 0 if sx > 0 move_diagonal(6, 2) else move_diagonal(4, 2) end end if sx.abs <= sy.abs and sx == 0 move_straight(sy > 0 ? 2 : 8) move_straight(sx > 0 ? 6 : 4) if !@move_succeed && sx != 0 elsif sx.abs <= sy.abs and sx < 0 if sy > 0 move_diagonal(4, 2) else move_diagonal(4, 8) end elsif sx.abs <= sy.abs and sx > 0 if sy < 0 move_diagonal(6, 8) else move_diagonal(6, 2) end endendend
    • Da Ally
      Nome Script: Overlay Mapping
      Versione: del 16.04.2012
      Autore/i: Yami
       
      Informazioni:
      Questo script permette di poter utilizzare i vari livelli di parallasse per mappare all'interno del vostro progetto di RPG Maker VX Ace.
       
      Screenshots:

       
      Istruzioni:
      Create una cartella dentro "Graphics" chiamata Overlay (nome progetto/Graphic/Overlay).
      Potete creare fino a 4 tipi di immagini:
      • Ground (parte base della mappa - va SOTTO a tutto)
      • Par (parte alta della mappa - va SOPRA a tutto e copre gli eventi e il personaggio - vedi albero)
      • Light (crea effetti di luce statici)
      • Shadow (crea effetti di ombra statici)
       
      Le immagini della vostra mappa dovranno essere nominate in base alla loro funzione:
      • Il prato è un ground
      • Gli alberi e tutto quello che è sopra al livello dell'eroe è un par
      • Le luci e le ombre sono rispettivamente light e shadow
       
      Esempio:
      Io ho creato un prato con degli alberi come nell'immagine sopra.
      Tutto questo andrà inserito all'interno delle prima mappa del gioco (quindi ID:0001); di conseguenza chiamerò la mia immagine del prato cosi: Ground1_1 (il primo 1 è l'ID della mappa nel quale il prato verrà visualizzato; il secondo 1 è usato se, per esempio, nella stessa mappa volete creare più versioni: ground1_1 versione normale ground1_2 versione distruzione, per esempio); L'immagine deve essere in PNG.
      Gli alberi andranno salvati cosi: Par1_1 (i numeri seguono lo stesso principio spiegato sopra); L'immagine deve essere in PNG.
      Le luci e le ombre (se presenti) andranno salvate con lo stesso principio spiegato sopra (light1_1 e Shadow1_1); L'immagine deve essere in JPG.
       
      (se questo prato dovrà essere messo nell mappa con ID 23 le immagini saranno chiamate ground23_1, par23_1, light23_1 e shadow23_1)
       
      Spero di essere stato chiaro D:
       
      Script:
       
       
      F.A.Q:
      N/D
       
      Demo:
      N/D
       
      Incompatibilità:
      N/D
       
      Note dell'autore:
      N/D
    • Da Ally
      Nome Script: Lune Ultimate Anti-Lag
      Versione: N/D
      Autore/i: Raizen
       
      Informazioni:
      Lo script Anti-Lag ormai è un must have da inserire nei propri progetti.
      Infatti consente di migliorare le prestazioni nonostante i troppi eventi, script, etc...
       
      Istruzioni:
      Inserite lo script sotto Material e configuratelo se necessario...
       
      Script:
       
       
      #=======================================================# Lune Ultimate Anti-Lag# Author: Raizen# Compatible with: RMVXAce# Comunity: centrorpg.com# This script allows a very well balanced anti-lag, in which# considers the own PC of the player, using a smart frame-skipper# to slow lags,#========================================================#To update constantly the event, put a commentary on the first# command of the script written :update:module Anti_conf#==============================================================================# ** Configurations#------------------------------------------------------------------------------# Configure what is necessary for a better performance.#==============================================================================# Choose how the script will act.# <=====Quality============================Performance=====># 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20# Default = 10Fr = 10# Configure the FPS rate (default = 60)Fps = 60# Configure the minimum FPS rate (default = 25)Mini = 25# Quantity of frames the anti-lag will study,# the higher the time, the more precise the script,# but will take longer to load the anti-lagTime = 60end=beginFunctions on this Anti-Lag* Common event positioning bug fixed* Smart Frame Skipper* updates what is only necessary* helps to lower lags from visual system/scripts* Changes its behavior according to the players PC* Increases the RPG Maker priority over other programs=end#=================================================================##=================================================================##==================== Alias methods =============================## command_203 => Game_Interpreter# start => Scene_Map# update => Scene_Map# perform_transfer => Scene_Map#=================================================================##==================== Rewrite methods ===========================## update_events => Game_Map# update_one_event => Spriteset_Map#=================================================================##======================== New methods ===========================## need_to_update? => Game_Event# near_the_screen? => Sprite_Character# call_position_event => Scene_Map# skip_calculate => Scene_Map# update_one_event => Spriteset_Map#=================================================================##=================================================================##==============================================================================#============================ Início do Script! =============================#==============================================================================#==============================================================================# ** Scene_Map#------------------------------------------------------------------------------# Esta classe executa o processamento da tela de mapa.#==============================================================================class Scene_Map < Scene_Basealias lune_skip_start startalias lune_skip_update updatealias lune_perform perform_transfer #-------------------------------------------------------------------------- # * Inicialização do processo #-------------------------------------------------------------------------- def start Graphics.frame_rate = Anti_conf::Fps @update_skip = false @count_up = 0 lune_skip_start end #-------------------------------------------------------------------------- # * Execução da transferência #-------------------------------------------------------------------------- def perform_transfer $get_new_ids = Array.new Graphics.frame_rate = Anti_conf::Fps lune_perform @count_up = 0 @update_skip = false end #-------------------------------------------------------------------------- # * Atualização da tela #-------------------------------------------------------------------------- def update @update_skip ? lune_skip_update : skip_calculate end #-------------------------------------------------------------------------- # * Atualização de um personagem especifico #-------------------------------------------------------------------------- def call_position_event(id) @spriteset.update_one_event(id) end #-------------------------------------------------------------------------- # * Calcula o tempo necessário para rodar o update do Scene_Map #-------------------------------------------------------------------------- def skip_calculate @count_up += 1 return unless @count_up >= Anti_conf::Time auto_skip = Time.now lune_skip_update old_skip = Time.now get_skip = old_skip - auto_skip Graphics.frame_rate -= (get_skip * Graphics.frame_rate * 2 * Anti_conf::Fr - 1).to_i Graphics.frame_rate = [Graphics.frame_rate, Anti_conf::Mini].max @update_skip = true endend#==============================================================================# ** Scene_Base#------------------------------------------------------------------------------# Esta é a superclasse de todas as cenas do jogo.#==============================================================================class Scene_Basealias skipper_main main #-------------------------------------------------------------------------- # * Processamento principal #-------------------------------------------------------------------------- def main @fr_cont = 0 skipper_main end #-------------------------------------------------------------------------- # * Execução da transição #-------------------------------------------------------------------------- def perform_transition Graphics.transition(transition_speed * Graphics.frame_rate / 60) end #-------------------------------------------------------------------------- # * Atualização da tela (básico) #-------------------------------------------------------------------------- def update_basic if @fr_cont >= 60 Graphics.update @fr_cont -= 60 end @fr_cont += Graphics.frame_rate update_all_windows Input.update endend#==============================================================================# ** Aumento da prioridade do rpg maker#------------------------------------------------------------------------------Lune_high = Win32API.new("kernel32", "SetPriorityClass", "pi", "i")Lune_high.call(-1, 0x90)#==============================================================================#==============================================================================# ** Game_Event#------------------------------------------------------------------------------# Esta classe gerencia os eventos. Ela controla funções incluindo a mudança# de páginas de event por condições determinadas, e processos paralelos.# Esta classe é usada internamente pela classe Game_Map.#==============================================================================class Game_Event < Game_Character #-------------------------------------------------------------------------- # * necessário atualizar? #-------------------------------------------------------------------------- def need_to_update? ax = $game_map.adjust_x(@real_<img src='http://rpgmkr.net/forum/public/style_emoticons/<#EMO_DIR#>/sourirex.gif' class='bbc_emoticon' alt='X)' /> - 8 ay = $game_map.adjust_y(@real_y) - 6 ax.between?(-9, 9) && ay.between?(-7, 7) || @list[0].parameters.include?(':update:') endend#==============================================================================# ** Sprite_Character#------------------------------------------------------------------------------# Este sprite é usado para mostrar personagens. Ele observa uma instância# da classe Game_Character e automaticamente muda as condições do sprite.#==============================================================================class Sprite_Character < Sprite_Base #-------------------------------------------------------------------------- # * Evento próximo a tela? #-------------------------------------------------------------------------- def near_the_screen? ax = $game_map.adjust_x(@character.<img src='http://rpgmkr.net/forum/public/style_emoticons/<#EMO_DIR#>/sourirex.gif' class='bbc_emoticon' alt='X)' /> - 8 ay = $game_map.adjust_y(@character.y) - 6 ax.between?(-11, 11) && ay.between?(-8, 8) endend#==============================================================================# ** Game_Event#------------------------------------------------------------------------------# Esta classe gerencia os eventos. Ela controla funções incluindo a mudança# de páginas de event por condições determinadas, e processos paralelos.# Esta classe é usada internamente pela classe Game_Map.#==============================================================================class Game_Event < Game_Characteralias lune_ant_initialize initialize #-------------------------------------------------------------------------- # * Inicialização do objeto # event : RPG::Event #-------------------------------------------------------------------------- def initialize(*args, &block) lune_ant_initialize(*args, &block) $get_new_ids.push(@event.id) endend#==============================================================================# ** Game_Interpreter#------------------------------------------------------------------------------# Um interpretador para executar os comandos de evento. Esta classe é usada# internamente pelas classes Game_Map, Game_Troop e Game_Event.#==============================================================================class Game_Interpreteralias lune_lag_command_203 command_203 #-------------------------------------------------------------------------- # Definir posição do evento #-------------------------------------------------------------------------- def command_203 lune_lag_command_203 SceneManager.scene.call_position_event($get_new_ids.index(@event_id)) endend#==============================================================================# ** Game_Map#------------------------------------------------------------------------------# Esta classe gerencia o mapa. Inclui funções de rolagem e definição de# passagens. A instância desta classe é referenciada por $game_map.#==============================================================================class Game_Map #-------------------------------------------------------------------------- # * Atualização dos comandos dos eventos #-------------------------------------------------------------------------- def update_events @events.each_value {|event| event.update if event.need_to_update?} @common_events.each {|event| event.update} endend$get_new_ids = Array.new#==============================================================================# ** Spriteset_Map#------------------------------------------------------------------------------# Esta classe reune os sprites da tela de mapa e tilesets. Esta classe é# usada internamente pela classe Scene_Map.#==============================================================================class Spriteset_Map #-------------------------------------------------------------------------- # * Atualização dos personagens #-------------------------------------------------------------------------- def update_characters refresh_characters if @map_id != $game_map.map_id @character_sprites.each {|sprite| sprite.update if sprite.near_the_screen? } end #-------------------------------------------------------------------------- # * Atualização de algum personagem remoto #-------------------------------------------------------------------------- def update_one_event(id) @character_sprites[id].update endend
×