Merge branch 'dev' into ai

This commit is contained in:
Maruno17
2022-11-05 20:42:12 +00:00
33 changed files with 198 additions and 168 deletions

View File

@@ -42,6 +42,8 @@ module Game
end
$game_temp.common_event_id = 0 if $game_temp
$game_temp.begun_new_game = true
pbMapInterpreter&.clear
pbMapInterpreter&.setup(nil, 0, 0)
$scene = Scene_Map.new
SaveData.load_new_game_values
$stats.play_sessions += 1

View File

@@ -59,10 +59,9 @@ class Scene_Map
return if !playingBGM && !playingBGS
map = load_data(sprintf("Data/Map%03d.rxdata", mapid))
if playingBGM && map.autoplay_bgm
if (PBDayNight.isNight? && FileTest.audio_exist?("Audio/BGM/" + map.bgm.name + "_n") &&
playingBGM.name != map.bgm.name + "_n") || playingBGM.name != map.bgm.name
pbBGMFade(0.8)
end
test_filename = map.bgm.name
test_filename += "_n" if PBDayNight.isNight? && FileTest.audio_exist?("Audio/BGM/" + test_filename + "_n")
pbBGMFade(0.8) if playingBGM.name != test_filename
end
if playingBGS && map.autoplay_bgs && playingBGS.name != map.bgs.name
pbBGMFade(0.8)

View File

@@ -163,13 +163,13 @@ end
class HandlerHashSymbol
def initialize
@hash = {}
@add_ifs = []
@add_ifs = {}
end
def [](sym)
sym = sym.id if !sym.is_a?(Symbol) && sym.respond_to?("id")
return @hash[sym] if sym && @hash[sym]
@add_ifs.each do |add_if|
@add_ifs.each_value do |add_if|
return add_if[1] if add_if[0].call(sym)
end
return nil
@@ -182,11 +182,11 @@ class HandlerHashSymbol
@hash[sym] = handler || handlerBlock if sym
end
def addIf(conditionProc, handler = nil, &handlerBlock)
def addIf(sym, conditionProc, handler = nil, &handlerBlock)
if ![Proc, Hash].include?(handler.class) && !block_given?
raise ArgumentError, "addIf call for #{self.class.name} has no valid handler (#{handler.inspect} was given)"
raise ArgumentError, "addIf call for #{sym} in #{self.class.name} has no valid handler (#{handler.inspect} was given)"
end
@add_ifs.push([conditionProc, handler || handlerBlock])
@add_ifs[sym] = [conditionProc, handler || handlerBlock]
end
def copy(src, *dests)
@@ -271,13 +271,6 @@ class HandlerHashEnum
@hash[symbol] = handler || handlerBlock if symbol
end
def addIf(conditionProc, handler = nil, &handlerBlock)
if ![Proc, Hash].include?(handler.class) && !block_given?
raise ArgumentError, "addIf call for #{self.class.name} has no valid handler (#{handler.inspect} was given)"
end
@addIfs.push([conditionProc, handler || handlerBlock])
end
def copy(src, *dests)
handler = self[src]
return if !handler