Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #--------------------------------------------------------------------------
- # BFK CORE (BY RAVEN) - v1.0 -
- #--------------------------------------------------------------------------
- # * Arquivo com mas ferramentas para executar scripts BFK
- #--------------------------------------------------------------------------
- $registro = [] if $registro.nil?
- $registro << ["BFK Core",1.0]
- module BFK
- DEBUG = false
- SHOW_POPUPS = true
- attr_accessor :restext
- def self.modular(nome,version)
- modulo = $registro.collect{ |x| x[0] == nome && x[1]>= version}
- if !modulo.include?(true)
- msgbox("Não foi encontrado o Script #{nome} versão maior que #{version}")
- exit
- else
- return true
- end
- end
- def self.calc_porcent(quant,cem)
- porcento = (quant * 100)/cem
- end
- #--------------------------------------------------------------------------
- # * FUNÇÃO QUE AUXILIA NA BUSCA DE TAGS (ESTA FUNÇÃO SERÁ MODIFICADA PELAS ATUALIZAÇÕES
- #--------------------------------------------------------------------------
- def self.find_map_note(rgx)
- map = $game_map.get_map
- l_note = map.note.scan(rgx)
- l_note.each{ |off|
- return true if off
- }
- return false
- end
- def self.search_rgx(nota,rgxstart,rgxend)
- @notecontent = ""
- @rgx_start = false
- nota.split(/[\r\n]+/).each { |line|
- next if line.empty?
- case line
- when rgxstart
- @rgx_start = true
- when rgxend
- @rgx_start = false
- else
- if @rgx_start
- @notecontent += line
- end
- end
- }
- return @notecontent
- end
- #--------------------------------------------------------------------------
- # * Traduz uma string de acordo com uma matiz
- # qqvalue : texto a ser traduzido
- # index : matriz de tradução
- #--------------------------------------------------------------------------
- def self.trans(qqvalue,index=nil)
- return qqvalue.capitalize if !index[qqvalue] && Vocab.method_defined?(qqvalue) == false
- return index[qqvalue].capitalize if index[qqvalue]
- return Vocab::qqvalue.capitalize if Vocab::qqvalue
- end
- end
- #==============================================================================
- # ** Game_Map
- #------------------------------------------------------------------------------
- # Esta classe altera o comportamento da classe original sem modifica-la
- #==============================================================================
- class Game_Map
- attr_accessor :map
- def get_map
- @map
- end
- def set_map_steps(steps)
- @map.encounter_step = steps
- end
- def set_map_troop_freq(id,cent)
- @map.encounter_list[id].weight = cent
- end
- end
- #==============================================================================
- # ** Window_Base
- #------------------------------------------------------------------------------
- # This is a superclass of all windows in the game.
- #==============================================================================
- class Window_Base < Window
- #--------------------------------------------------------------------------
- # * Desenho do nome de itens
- # item : objeto
- # x : coordenada X
- # y : coordenada Y
- # enabled : habilitar flag, translucido quando false
- # width : largura
- #--------------------------------------------------------------------------
- alias draw_item_name_space draw_item_name
- def draw_item_name(item, x, y, enabled = true, width = 172)
- return unless item
- draw_icon(item.icon_index, x, y, enabled)
- change_color(normal_color, enabled)
- draw_text(x + 32, y, width, line_height, item.name)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement