Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #**Useless & Outdated...
- #**NRGSS is new edition.
- #**Copy modules you want..
- #**Use at own risk!
- #Sl by Upgrade Module 3.1
- #by Narzew - 30.03.11
- #USUŃ ADDONY NARZEWA, JEŚLI UŻYWASZ!
- #UM i SL ZASTĘPUJĄ WSZYSTKIE ICH FUNKCJE!
- #DELETE NARZEW ADDONS IF YOU USE!
- #UM and SL REPLACES ALL THIS FUNCTIONS!
- #WYMAGANA WERSJA UM: 3.16
- #VERSION CHECK (SL TOOLS < UPGRADE MODULE)
- #57 MODULES
- #Moduły 10-15 są wzięte z biblioteki ruby 1.9.1
- #Pozostałe moduły są mojego autorstwa
- #Moduł 28 jest dla użytkowników Autosave by Narzew
- #Moduł 50 jest dla użytkowników konsoli debugowania by ForeverZer0, Mod by Narzew
- #Script Loader
- if $upgrade_module_version == nil || $upgrade_module_version < 3.15
- raise('Zainstaluj Upgrade Module w wersji 3.16 lub większej.')
- end
- $slversion = 1.5
- $data_scripts_info = Set[]
- $data_scripts_info_disabled = Set[]
- $sl_parts = Set["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","48","49", "50", "51"]
- $sl_parts_disabled = Set[]
- module Sl
- def self.check(script)
- if $sl_parts.include?("1") and not $sl_parts_disabled.include?("1")
- if $data_scripts_info.include?(script) and not $data_scripts_info_disabled.include?(script)
- return true
- else
- return false
- end #if 1
- end # if 2
- end # def
- def self.add(script)
- if $sl_parts.include?("2") and not $sl_parts_disabled.include?("2")
- $data_scripts_info.add(script)
- end # if enabled
- end #def
- def self.c_check_s(version, required_version)
- if $sl_parts.include?("3") and not $sl_parts_disabled.include?("3")
- if version == nil || version < required_version
- return false
- else
- return true
- end #if version
- end #if enabled
- end #self.c_check_s
- def self.c_check(script, version, required_version, raise)
- if $sl_parts.include?("4") and not $sl_parts_disabled.include?("4")
- if version == nil || version < required_version
- if raise == nil || raise == 0
- return false
- elsif raise == 2
- raise("Unexpected Error!")
- else # else raise
- raise("#{script} jest wymagany do pracy.\n" +
- 'Zainstaluj go. [Wersja #{required_version} lub nowsza]')
- return false
- end #if raise
- else #if version
- return true
- end #if version
- end #if enabled
- end #def self.c_check
- def self.del(script)
- if $sl_parts.include?("5") and not $sl_parts_disabled.include?("5")
- $data_scripts_info.delete(script)
- end #if enabled
- end
- def self.delete(script)
- if $sl_parts.include?("6") and not $sl_parts_disabled.include?("6")
- $data_scripts_info.delete(script)
- end #if enabled
- end
- def self.disable(script)
- if $sl_parts.include?("7") and not $sl_parts_disabled.include?("7")
- $data_scripts_info_disabled.add(script)
- end #if enabled
- end
- def self.enable(script)
- if $sl_parts.include?("8") and not $sl_parts_disabled.include?("8")
- $data_scripts_info_disabled.delete(script)
- end #if enabled
- end
- def self.include?(script)
- if $sl_parts.include?("9") and not $sl_parts_disabled.include?("9")
- if $data_scripts_info.include?(script)
- return true
- else
- return false
- end
- end #if enabled
- end
- #String Decoder & Encoder
- def self.base64_string_encode(str)
- if $sl_parts.include?("10") and not $sl_parts_disabled.include?("10")
- string = [str].pack("m")
- return string
- end # if enabled
- end
- def self.base64_string_decode(str)
- if $sl_parts.include?("11") and not $sl_parts_disabled.include?("11")
- string = str.unpack("m").first
- return string
- end #if enabled
- end # def self.decode
- def self.base64_strict_encode(strict2)
- if $sl_parts.include?("12") and not $sl_parts_disabled.include?("12")
- strict = [strict2].pack("m0")
- return strict
- end # if enabled
- end
- def self.base64_strict_decode(strict2)
- if $sl_parts.include?("13") and not $sl_parts_disabled.include?("13")
- strict = strict2.unpack("m0").first
- return strict
- end # if enabled
- end # def self.decode
- def self.base64_urlsafe_encode(url)
- if $sl_parts.include?("14") and not $sl_parts_disabled.include?("14")
- url = Sl.base64_strict_encode(strict2).tr("+/", "-_")
- return url
- end # if enabled
- end
- def self.base64_urlsafe_decode(url)
- if $sl_parts.include?("15") and not $sl_parts_disabled.include?("15")
- url = Sl.base64_strict_decode(str.tr("-_", "+/"))
- return url
- end # if enabled
- end # def self.decode
- #Game Tools
- def self.game_new
- if $sl_parts.include?("16") and not $sl_parts_disabled.include?("16")
- if Sl.c_check("Addony Narzewa", $narzew_addons_version, 0.4, 0)
- $defaultfonttype = Narzew::Font
- $fontface = Narzew::Font
- $fontsize = Narzew::FontSize
- $defaultfontsize = Narzew::FontSize
- end
- $data_actors = load_data("Data/Actors.rxdata")
- $data_classes = load_data("Data/Classes.rxdata")
- $data_skills = load_data("Data/Skills.rxdata")
- $data_items = load_data("Data/Items.rxdata")
- $data_weapons = load_data("Data/Weapons.rxdata")
- $data_armors = load_data("Data/Armors.rxdata")
- $data_enemies = load_data("Data/Enemies.rxdata")
- $data_troops = load_data("Data/Troops.rxdata")
- $data_states = load_data("Data/States.rxdata")
- $data_animations = load_data("Data/Animations.rxdata")
- $data_tilesets = load_data("Data/Tilesets.rxdata")
- $data_common_events = load_data("Data/CommonEvents.rxdata")
- $data_system = load_data("Data/System.rxdata")
- $data_scripts = load_data("Data/Scripts.rxdata")
- $game_system = Game_System.new
- $game_system.se_play($data_system.decision_se)
- Audio.bgm_stop
- Graphics.frame_count = 0
- $game_temp = Game_Temp.new
- $game_system = Game_System.new
- $game_switches = Game_Switches.new
- $game_variables = Game_Variables.new
- $game_self_switches = Game_SelfSwitches.new
- $game_screen = Game_Screen.new
- $game_actors = Game_Actors.new
- $game_party = Game_Party.new
- $game_troop = Game_Troop.new
- $game_map = Game_Map.new
- $game_player = Game_Player.new
- $game_party.setup_starting_members
- $game_map.setup($data_system.start_map_id)
- $game_player.moveto($data_system.start_x, $data_system.start_y)
- $game_player.refresh
- $game_map.autoplay
- $game_map.update
- $scene = Scene_Map.new
- end # if enabled
- end #game_new
- def self.game_exit
- if $sl_parts.include?("17") and not $sl_parts_disabled.include?("17")
- Sl.exit
- end # if enabled
- end
- def self.game_data_load
- if $sl_parts.include?("18") and not $sl_parts_disabled.include?("18")
- $data_actors = load_data("Data/Actors.rxdata")
- $data_classes = load_data("Data/Classes.rxdata")
- $data_skills = load_data("Data/Skills.rxdata")
- $data_items = load_data("Data/Items.rxdata")
- $data_weapons = load_data("Data/Weapons.rxdata")
- $data_armors = load_data("Data/Armors.rxdata")
- $data_enemies = load_data("Data/Enemies.rxdata")
- $data_troops = load_data("Data/Troops.rxdata")
- $data_states = load_data("Data/States.rxdata")
- $data_animations = load_data("Data/Animations.rxdata")
- $data_tilesets = load_data("Data/Tilesets.rxdata")
- $data_common_events = load_data("Data/CommonEvents.rxdata")
- $data_system = load_data("Data/System.rxdata")
- $data_scripts = load_data("Data/Scripts.rxdata")
- end # if enabled
- end #def self.data_load
- def self.safe_encode(print)
- if $sl_parts.include?("19") and not $sl_parts_disabled.include?("19")
- Sl.game_data_load
- file = File.open("Game.rkh", "w")
- Marshal.dump($data_actors, file)
- Marshal.dump($data_classes, file)
- Marshal.dump($data_skills, file)
- Marshal.dump($data_items, file)
- Marshal.dump($data_weapons, file)
- Marshal.dump($data_armors, file)
- Marshal.dump($data_enemies, file)
- Marshal.dump($data_troops, file)
- Marshal.dump($data_states, file)
- Marshal.dump($data_animations, file)
- Marshal.dump($data_tilesets, file)
- Marshal.dump($data_common_events, file)
- Marshal.dump($data_system, file)
- Marshal.dump($data_scripts, file)
- if print = 1
- print("Zakodowano pomyślnie")
- end
- end # if enabled
- end
- def self.safe_decode
- if $sl_parts.include?("20") and not $sl_parts_disabled.include?("20")
- file = File.open("Game.rkh", "r")
- $data_actors = Marshal.load(file)
- $data_classes = Marshal.load(file)
- $data_skills = Marshal.load(file)
- $data_items = Marshal.load(file)
- $data_weapons = Marshal.load(file)
- $data_armors = Marshal.load(file)
- $data_enemies = Marshal.load(file)
- $data_troops = Marshal.load(file)
- $data_states = Marshal.load(file)
- $data_animations = Marshal.load(file)
- $data_tilesets = Marshal.load(file)
- $data_common_events = Marshal.load(file)
- $data_system = Marshal.load(file)
- $data_scripts = Marshal.load(file)
- end # if enabled
- end
- def self.safe_encrypt(print)
- if $sl_parts.include?("21") and not $sl_parts_disabled.include?("21")
- Sl.safe_encode(print)
- end # if enabled
- end
- def self.safe_decrypt
- if $sl_parts.include?("22") and not $sl_parts_disabled.include?("22")
- Sl.safe_decode
- end # if enabled
- end
- def self.safe_load
- if $sl_parts.include?("23") and not $sl_parts_disabled.include?("23")
- Sl.safe_decode
- end # if enabled
- end
- def self.load
- if $sl_parts.include?("24") and not $sl_parts_disabled.include?("24")
- Sl.data_load
- end # if enabled
- end
- def self.exit
- if $sl_parts.include?("25") and not $sl_parts_disabled.include?("25")
- $game_system.se_play($data_system.decision_se)
- Audio.bgm_fade(800)
- Audio.bgs_fade(800)
- Audio.me_fade(800)
- $scene = nil
- if $scene !=nil
- print("Dispose")
- exit
- else
- exit
- end #if
- end # if enabled
- end # def self.exit
- def self.game_open_load2
- if $sl_parts.include?("26") and not $sl_parts_disabled.include?("26")
- $scene = Scene_Load2.new
- end # if enabled
- end
- def self.game_title_remove
- if $sl_parts.include?("27") and not $sl_parts_disabled.include?("27")
- $scene = Scene_Title2.new
- end #if enabled
- end
- def self.game_load
- if $sl_parts.include?("28") and not $sl_parts_disabled.include?("28")
- if Sl.check("Autosave")
- Autoload.load
- end #if
- end # if enabled
- end #def self.game_load
- #File Tools
- def self.indentical?(file, file2, raise)
- if $sl_parts.include?("29") and not $sl_parts_disabled.include?("29")
- if File.identical?(file, file2)
- return true
- else #else identical
- if raise == nil || raise == 0
- raise("Plik #{file} nie jest identyczny z" +
- "plikiem #{file2}. Gra nie może działać.")
- return false
- elsif raise == 2
- raise("Unexpected Error!")
- else #else raise
- return false
- end #if raise
- end #if file.identical?
- end # if enabled
- end #def self.identical?
- def self.indentical3?(file, file2, file3, raise)
- if $sl_parts.include?("30") and not $sl_parts_disabled.include?("30")
- if File.identical?(file, file2) and File.identical?(file2, file3)
- return true
- else #else identical
- if raise == nil || raise == 0
- raise("Plik #{file} nie jest identyczny z" +
- "plikiem #{file2}. Gra nie może działać.")
- return false
- elsif raise == 2
- raise("Unexpected Error!")
- else #else raise
- return false
- end #if raise
- end #if file.identical?
- end # if enabled
- end #def self.identical3?
- def self.indentical4?(file, file2, file3, file4, raise)
- if $sl_parts.include?("31") and not $sl_parts_disabled.include?("31")
- if File.identical?(file, file2) and File.identical?(file2, file3) and File.identical?(file3, file4)
- return true
- else #else identical
- if raise == nil || raise == 0
- raise("Plik #{file} nie jest identyczny z" +
- "plikiem #{file2}. Gra nie może działać.")
- return false
- elsif raise == 2
- raise("Unexpected Error!")
- else #else raise
- return false
- end #if raise
- end #if file.identical?
- end # if enabled
- end #def self.identical4?
- #Logging
- #Classic Logger
- if $sl_parts.include?("32") and not $sl_parts_disabled.include?("32")
- $temp_sl_collected = Set[0,1,2,nil]
- end # if enabled
- def self.log(txt, function)
- if $sl_parts.include?("33") and not $sl_parts_disabled.include?("33")
- if function == nil || function == 0
- File.open("Data/Logs/log.txt", "a") do |log|
- log.puts(txt)
- end
- elsif function ==1
- File.open("Data/Logs/errorlog.txt", "a") do |errorlog|
- errorlog.puts(txt)
- end
- elsif function !=$temp_sl_collected
- File.open(function, "a") do |newlog|
- newlog.puts(txt)
- end
- end
- end # if enabled
- end #def end
- #Added log tools
- def self.error_log(txt)
- if $sl_parts.include?("34") and not $sl_parts_disabled.include?("34")
- File.open("Data/Logs/errorlog.txt", "a") do |errorlog|
- errorlog.puts(txt)
- end
- end # if enabled
- end
- def self.log_error(txt)
- if $sl_parts.include?("35") and not $sl_parts_disabled.include?("35")
- Sl.error_log(txt)
- end # if enabled
- end
- def self.free_log(txt, file, mode)
- if $sl_parts.include?("36") and not $sl_parts_disabled.include?("36")
- File.open(file, mode) do |freelog|
- freelog.puts(txt)
- end
- end # if enabled
- end
- #Game Speed Changer
- def self.change_game_speed(number, type, raise)
- if $sl_parts.include?("37") and not $sl_parts_disabled.include?("37")
- if type == nil || type == 0
- Graphics.frame_rate += number
- elsif type == 1
- Graphics.frame_rate -= number
- elsif type == 2
- Graphics.frame_rate = number
- elsif type == 3
- Graphics.frame_rate *=number
- elsif type == 4
- Graphics.frame_rate **=number
- end
- end # if enabled
- end
- def self.game_speed_change(number, type, raise)
- if $sl_parts.include?("38") and not $sl_parts_disabled.include?("38")
- Sl.change_game_speed(number, type, raise)
- end #if enabled
- end #def self.game_speed_change
- def self.calc_oppose(number, function, returned)
- if $sl_parts.include?("39") and not $sl_parts_disabled.include?("39")
- recalced2 = number - (number * 2)
- recalced = recalced2 / function
- if returned
- return recalced
- end #if
- end #if enabled
- end # def self.calc_oppose
- def self.save_to_variable(variable, save_data)
- if $sl_parts.include?("40") and not $sl_parts_disabled.include?("40")
- variable = Marshal.dump(save_data)
- end #if enabled
- end
- def self.load_from_variable(variable, load_data)
- if $sl_parts.include?("41") and not $sl_parts_disabled.include?("41")
- load_data = Marshal.load(variable)
- end #if enabled
- end
- def self.time_calc_start
- if $sl_parts.include?("42") and not $sl_parts_disabled.include?("42")
- start_time = Time.now
- end #if enabled
- end
- def self.time_calc_end(script, returned, print, time_save_variable)
- if $sl_parts.include?("43") and not $sl_parts_disabled.include?("43")
- progress_time = Time.now - start_time
- time_save_variable = progress_time
- if print > 0 and returned > 0
- print("#{script} \n Wykonano! \n Czas wykonywania skryptu: #{progress_time}")
- return progress_time
- end
- if print > 0 and not returned > 0
- print("#{script} \n Wykonano! \n Czas wykonywania skryptu: #{progress_time}")
- end
- if returned > 0 and not print > 0
- return progress_time
- end
- end #if enabled
- end #def self.time_calc_end
- def self.proccess_encrypt(variable, proccess,file2)
- if $sl_parts.include?("44") and not $sl_parts_disabled.include?("44")
- variable = proccess
- file = File.open(file2, "wb")
- Marshal.dump(variable, file)
- end # if enabled
- end # def self
- def self.proccess_load(variable, file2)
- if $sl_parts.include?("45") and not $sl_parts_disabled.include?("45")
- Marshal.load(variable, file)
- end #if enabled
- end # def self
- def self.return_trigger(triggerclass, trigger, value)
- if $sl_parts.include?("46") and not $sl_parts_disabled.include?("46")
- if triggerclass = 0
- return trigger
- elsif triggerclass = 1
- trigger = value
- elsif triggerclass = 2
- trigger = value
- return trigger
- end #if
- end #if enabled
- end # Def self.return trigger
- def self.encrypt_string(encryptor, compressor, rate)
- if $sl_parts.include?("47") and not $sl_parts_disabled.include?("47")
- $rate = rate
- $compressor = compressor
- $encryptor = encryptor
- $data_sl_encryptor.main_encr
- end #if enabled
- end #def self.encrypt_string
- def self.decrypt_string(encryptor, compressor, rate)
- if $sl_parts.include?("48") and not $sl_parts_disabled.include?("48")
- $rate = rate
- $compressor = compressor
- $encryptor = encryptor
- $data_sl_encryptor.main_decr
- end #if enabled
- end #def self.decrypt_string
- def self.load_string(encryptor, compressor, rate)
- if $sl_parts.include?("49") and not $sl_parts_disabled.include?("49")
- Sl.decrypt_string(encryptor, compressor, rate)
- end #if enabled
- end #def self.load_string
- def self.msg(msg)
- if $sl_parts.include?("50") and not $sl_parts_disabled.include("50")
- $console_text = msg
- Console.update
- end #enabled
- end #def self.msg
- def self.uniq(prefix)
- if $sl_parts.include?("51") and not $sl_parts_disabled.include?("51")
- return true if prefix.uniq!
- return false if !prefix.uniq!
- end #enabled
- end #def self.uniq
- end
- end #Sl module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement