Skip to content

Commit

Permalink
Kurayami updated the mod
Browse files Browse the repository at this point in the history
  • Loading branch information
kurayamiblackheart committed Jul 8, 2023
1 parent 9a714c5 commit 9782f5f
Show file tree
Hide file tree
Showing 377 changed files with 108,468 additions and 124 deletions.
Binary file added Audio/BGM/BattleTrainerK - Copie.ogg
Binary file not shown.
Binary file added Audio/BGM/BattleWildK - Copie.ogg
Binary file not shown.
Binary file added Audio/BGM/Berry Forest.mp3
Binary file not shown.
Binary file added Audio/BGM/Celadon City - Copie.ogg
Binary file not shown.
Binary file added Audio/BGM/CeruleanCity - Copie.ogg
Binary file not shown.
Binary file added Audio/BGM/CeruleanCity.ogg
Binary file not shown.
Binary file added Audio/BGM/Champion - Copie.ogg
Binary file not shown.
Binary file added Audio/BGM/Champion.ogg
Binary file not shown.
Binary file added Audio/BGM/Mt. Moon.ogg
Binary file not shown.
Binary file not shown.
Binary file added Audio/BGM/PokeTech.ogg
Binary file not shown.
Binary file not shown.
Binary file added Audio/BGM/Pokemon HGSS - Route 1 Remastered.mp3
Binary file not shown.
Binary file added Audio/BGM/Pokemon HGSS- Vermilion City.mp3
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Audio/BGM/Pokemon Red-Blue Opening.wav
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Audio/BGM/Route 24.ogg
Binary file not shown.
Binary file added Audio/BGM/SSANNE.ogg
Binary file not shown.
Binary file added Audio/BGM/Safari Zone.ogg
Binary file not shown.
Binary file added Audio/BGM/VirdianPewterSaffron.ogg
Binary file not shown.
Binary file added Audio/BGM/Viridian Forest.ogg
Binary file not shown.
Binary file added Audio/BGM/underwater.mp3
Binary file not shown.
Binary file added Audio/removed/013-Gag02.mid
Binary file not shown.
Binary file added Audio/removed/Boss Battle 2.mid
Binary file not shown.
Binary file added Audio/removed/Boss02.mid
Binary file not shown.
Binary file added Audio/removed/Boss04.mid
Binary file not shown.
Binary file added Audio/removed/Cave.mid
Binary file not shown.
Binary file added Audio/removed/GSC Intro.mid
Binary file not shown.
Binary file added Audio/removed/Hall of Fame.mid
Binary file not shown.
Binary file added Audio/removed/Jingle - HMTM.mid
Binary file not shown.
Binary file added Audio/removed/Lab.mid
Binary file not shown.
Binary file added Audio/removed/Main Menu.mid
Binary file not shown.
Binary file added Audio/removed/Mom Theme.mid
Binary file not shown.
Binary file added Audio/removed/Mom Themen.mid
Binary file not shown.
Binary file added Audio/removed/PkmRS-BTower.mid
Binary file not shown.
Binary file added Audio/removed/PokeCenter.mid
Binary file not shown.
Binary file added Audio/removed/PokeMart.mid
Binary file not shown.
Binary file added Audio/removed/Pokemon Healing.mid
Binary file not shown.
Binary file added Audio/removed/Radio - March.mid
Binary file not shown.
Binary file added Audio/removed/Radio - Oak.mid
Binary file not shown.
Binary file added Audio/removed/Ship.mid
Binary file not shown.
Binary file added Audio/removed/Title.mid
Binary file not shown.
Binary file added Audio/removed/Victory - Trainer.mid
Binary file not shown.
Binary file added Audio/removed/Victory - Wild Pokemon.mid
Binary file not shown.
Binary file added Audio/removed/battle1.mid
Binary file not shown.
Binary file added Audio/removed/begin.mid
Binary file not shown.
Binary file added Audio/removed/blank.mid
Binary file not shown.
Binary file added Audio/removed/cinnabar.mid
Binary file not shown.
Binary file added Audio/removed/elite.mid
Binary file not shown.
Binary file added Audio/removed/evolv.mid
Binary file not shown.
Binary file added Audio/removed/fireleafbattle.mid
Binary file not shown.
Binary file added Audio/removed/gym.mid
Binary file not shown.
Binary file added Audio/removed/gymleader.mid
Binary file not shown.
Binary file added Audio/removed/rb_unused_music_remake.mid
Binary file not shown.
Binary file added Audio/removed/route.mid
Binary file not shown.
Binary file added Audio/removed/safari.mid
Binary file not shown.
Binary file added Audio/removed/uwater.mid
Binary file not shown.
Binary file added Data/CommonEvents.rxdata
Binary file not shown.
Binary file added Data/Map600.rxdata
Binary file not shown.
Binary file modified Data/MapInfos.rxdata
Binary file not shown.
40 changes: 40 additions & 0 deletions Data/Scripts/001_Technical/001_Debugging/001_PBDebug.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
module PBDebug
@@log = []

def self.logonerr
begin
yield
rescue
PBDebug.log("")
PBDebug.log("**Exception: #{$!.message}")
PBDebug.log("#{$!.backtrace.inspect}")
PBDebug.log("")
# if $INTERNAL
pbPrintException($!)
# end
PBDebug.flush
end
end

def self.flush
if $DEBUG && $INTERNAL && @@log.length>0
File.open("Data/debuglog.txt", "a+b") { |f| f.write("#{@@log}") }
end
@@log.clear
end

def self.log(msg)
if $DEBUG && $INTERNAL
@@log.push("#{msg}\r\n")
# if @@log.length>1024
PBDebug.flush
# end
end
end

def self.dump(msg)
if $DEBUG && $INTERNAL
File.open("Data/dumplog.txt", "a+b") { |f| f.write("#{msg}\r\n") }
end
end
end
51 changes: 51 additions & 0 deletions Data/Scripts/001_Technical/001_Debugging/002_DebugConsole.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# To use the console, use the executable explicitly built
# with the console enabled on Windows. On Linux and macOS,
# just launch the executable directly from a terminal.
module Console
def self.setup_console
return unless $DEBUG
echoln "--------------------------------"
echoln "#{System.game_title} Output Window"
echoln "--------------------------------"
echoln "If you are seeing this window, you are running"
echoln "#{System.game_title} in Debug Mode. This means"
echoln "that you're either playing a Debug Version, or"
echoln "you are playing from within RPG Maker XP."
echoln ""
echoln "Closing this window will close the game. If"
echoln "you want to get rid of this window, run the"
echoln "program from the Shell, or download a Release"
echoln "version."
echoln ""
echoln "--------------------------------"
echoln "Debug Output:"
echoln "--------------------------------"
echoln ""
end

def self.readInput
return gets.strip
end

def self.readInput2
return self.readInput
end

def self.get_input
echo self.readInput2
end
end

module Kernel
def echo(string)
return unless $DEBUG
printf(string.is_a?(String) ? string : string.inspect)
end

def echoln(string)
echo(string)
echo("\r\n")
end
end

Console.setup_console
93 changes: 93 additions & 0 deletions Data/Scripts/001_Technical/001_Debugging/003_Errors.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
#===============================================================================
# Exceptions and critical code
#===============================================================================
class Reset < Exception
end

def pbGetExceptionMessage(e,_script="")
emessage = e.message.dup
emessage.force_encoding(Encoding::UTF_8)
if e.is_a?(Hangup)
emessage = "The script is taking too long. The game will restart."
elsif e.is_a?(Errno::ENOENT)
filename = emessage.sub("No such file or directory - ", "")
emessage = "File #{filename} not found."
end
emessage.gsub!(/Section(\d+)/) { $RGSS_SCRIPTS[$1.to_i][1] } rescue nil
return emessage
end

def pbPrintException(e)
emessage = ""
if $EVENTHANGUPMSG && $EVENTHANGUPMSG!=""
emessage = $EVENTHANGUPMSG # Message with map/event ID generated elsewhere
$EVENTHANGUPMSG = nil
else
emessage = pbGetExceptionMessage(e)
end
# begin message formatting
message = "[Infinite Fusion version #{Settings::GAME_VERSION_NUMBER}]\r\n"
if $game_switches
message += "Randomized trainers, " if $game_switches[SWITCH_RANDOM_TRAINERS]
message += "Randomized gym trainers, " if $game_switches[SWITCH_RANDOMIZE_GYMS_SEPARATELY]
message += "Randomized wild Pokemon (global), " if $game_switches[SWITCH_WILD_RANDOM_GLOBAL]
message += "Randomized wild Pokemon (area), " if $game_switches[RandomizerWildPokemonOptionsScene::RANDOM_WILD_AREA]
message += "All fused, " if $game_switches[SWITCH_RANDOM_TRAINERS]
message += "Randomized trainers, " if $game_switches[RandomizerWildPokemonOptionsScene::REGULAR_TO_FUSIONS]
end
message += "#{Essentials::ERROR_TEXT}\r\n" # For third party scripts to add to
message += "Exception: #{e.class}\r\n"
message += "Message: #{emessage}\r\n"
# show last 10/25 lines of backtrace
message += "\r\nBacktrace:\r\n"
btrace = ""
if e.backtrace
maxlength = ($INTERNAL) ? 25 : 10
e.backtrace[0, maxlength].each { |i| btrace += "#{i}\r\n" }
end
btrace.gsub!(/Section(\d+)/) { $RGSS_SCRIPTS[$1.to_i][1] } rescue nil
message += btrace
# output to log
errorlog = "errorlog.txt"
errorlog = RTP.getSaveFileName("errorlog.txt") if (Object.const_defined?(:RTP) rescue false)
File.open(errorlog, "ab") do |f|
f.write("\r\n=================\r\n\r\n[#{Time.now}]\r\n")
f.write(message)
end
# format/censor the error log directory
errorlogline = errorlog.gsub("/", "\\")
errorlogline.sub!(Dir.pwd + "\\", "")
errorlogline.sub!(pbGetUserName, "USERNAME")
errorlogline = "\r\n" + errorlogline if errorlogline.length > 20
# output message
print("#{message}\r\nThis exception was logged in #{errorlogline}.\r\nHold Ctrl when closing this message to copy it to the clipboard.")
# Give a ~500ms coyote time to start holding Control
t = System.delta
until (System.delta - t) >= 500000
Input.update
if Input.press?(Input::CTRL)
Input.clipboard = message
break
end
end
end

def pbCriticalCode
ret = 0
begin
yield
ret = 1
rescue Exception
e = $!
if e.is_a?(Reset) || e.is_a?(SystemExit)
raise
else
pbPrintException(e)
if e.is_a?(Hangup)
ret = 2
raise Reset.new
end
end
end
return ret
end
31 changes: 31 additions & 0 deletions Data/Scripts/001_Technical/001_Debugging/004_Validation.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# The Kernel module is extended to include the validate method.
module Kernel
private

# Used to check whether method arguments are of a given class or respond to a method.
# @param value_pairs [Hash{Object => Class, Array<Class>, Symbol}] value pairs to validate
# @example Validate a class or method
# validate foo => Integer, baz => :to_s # raises an error if foo is not an Integer or if baz doesn't implement #to_s
# @example Validate a class from an array
# validate foo => [Sprite, Bitmap, Viewport] # raises an error if foo isn't a Sprite, Bitmap or Viewport
# @raise [ArgumentError] if validation fails
def validate(value_pairs)
unless value_pairs.is_a?(Hash)
raise ArgumentError, "Non-hash argument #{value_pairs.inspect} passed into validate."
end
errors = value_pairs.map do |value, condition|
if condition.is_a?(Array)
unless condition.any? { |klass| value.is_a?(klass) }
next "Expected #{value.inspect} to be one of #{condition.inspect}, but got #{value.class.name}."
end
elsif condition.is_a?(Symbol)
next "Expected #{value.inspect} to respond to #{condition}." unless value.respond_to?(condition)
elsif !value.is_a?(condition)
next "Expected #{value.inspect} to be a #{condition.name}, but got #{value.class.name}."
end
end
errors.compact!
return if errors.empty?
raise ArgumentError, "Invalid argument passed to method.\r\n" + errors.join("\r\n")
end
end
53 changes: 53 additions & 0 deletions Data/Scripts/001_Technical/001_Debugging/005_Deprecation.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# The Deprecation module is used to warn game & plugin creators of deprecated
# methods.
module Deprecation
module_function

# Sends a warning of a deprecated method into the debug console.
# @param method_name [String] name of the deprecated method
# @param removal_version [String] version the method is removed in
# @param alternative [String] preferred alternative method
def warn_method(method_name, removal_version = nil, alternative = nil)
text = _INTL('WARN: usage of deprecated method "{1}" or its alias.', method_name)
unless removal_version.nil?
text += _INTL("\nThe method is slated to be"\
" removed in Essentials {1}.", removal_version)
end
unless alternative.nil?
text += _INTL("\nUse \"{1}\" instead.", alternative)
end
echoln text
end
end

# The Module class is extended to allow easy deprecation of instance and class methods.
class Module
private

# Creates a deprecated alias for a method.
# Using it sends a warning to the debug console.
# @param name [Symbol] name of the new alias
# @param aliased_method [Symbol] name of the aliased method
# @param removal_in [String] version the alias is removed in
# @param class_method [Boolean] whether the method is a class method
def deprecated_method_alias(name, aliased_method, removal_in: nil, class_method: false)
validate name => Symbol, aliased_method => Symbol, removal_in => [NilClass, String],
class_method => [TrueClass, FalseClass]

target = class_method ? self.class : self
class_name = self.name

unless target.method_defined?(aliased_method)
raise ArgumentError, "#{class_name} does not have method #{aliased_method} defined"
end

delimiter = class_method ? '.' : '#'

target.define_method(name) do |*args, **kvargs|
alias_name = format('%s%s%s', class_name, delimiter, name)
aliased_method_name = format('%s%s%s', class_name, delimiter, aliased_method)
Deprecation.warn_method(alias_name, removal_in, aliased_method_name)
method(aliased_method).call(*args, **kvargs)
end
end
end
Loading

0 comments on commit 9782f5f

Please sign in to comment.