mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2026-11-03 08:15:47 +00:00
Release 6.9.0
This commit is contained in:
@@ -21,7 +21,7 @@ class PokemonEncounters
|
||||
return pokemonEssentials_PokemonEncounter_choose_wild_pokemon(enc_type, *args)
|
||||
end
|
||||
|
||||
SUBSTITUTABLE_ENCOUNTER_TYPES = [:LandDay, :LandNight, :LandMorning, :Land, :Land1, :Land2, :Land3, :TallGrass, :Water]
|
||||
SUBSTITUTABLE_ENCOUNTER_TYPES = [:LandDay, :LandNight, :LandMorning, :Land, :Land1, :Land2, :Land3, :Land4, :TallGrass, :TallGrassNight, :Water]
|
||||
|
||||
def can_substitute_for_weather_encounter(encounter_type, current_weather)
|
||||
return false if Settings::GAME_ID != :IF_HOENN
|
||||
|
||||
@@ -77,6 +77,12 @@ GameData::EncounterType.register({
|
||||
:old_slots => [30,30,10,15,5,10],
|
||||
})
|
||||
|
||||
GameData::EncounterType.register({
|
||||
:id => :TallGrassNight,
|
||||
:type => :land,
|
||||
:old_slots => [30,30,10,15,5,10],
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -88,8 +88,10 @@ def generate_neighbor_map_from_connections
|
||||
return neighbor_map
|
||||
end
|
||||
|
||||
def is_indoor_map?(map_id)
|
||||
return false
|
||||
def is_outdoor_map?(map_id = $game_map.map_id)
|
||||
return !is_indoor_map?(map_id)
|
||||
end
|
||||
def is_indoor_map?(map_id = $game_map.map_id)
|
||||
mapMetadata = GameData::MapMetadata.try_get(map_id)
|
||||
return true if !mapMetadata
|
||||
return !mapMetadata.outdoor_map
|
||||
|
||||
@@ -24,7 +24,9 @@ def clear_current_map_weather
|
||||
$game_screen.weather(:None,0,0)
|
||||
end
|
||||
|
||||
|
||||
def update_overworld_weather(current_map)
|
||||
return unless $game_weather
|
||||
return if current_map.nil?
|
||||
return if !$game_weather.current_weather
|
||||
|
||||
@@ -35,6 +37,28 @@ def update_overworld_weather(current_map)
|
||||
current_weather_type = :None if !current_weather_type
|
||||
current_weather_intensity=0 if !current_weather_intensity
|
||||
current_weather_type = :None if PBDayNight.isNight? && current_weather_type == :Sunny
|
||||
|
||||
set_weather_ambient_sounds(current_weather_type,current_weather_intensity)
|
||||
$game_screen.weather(current_weather_type,current_weather_intensity,0)
|
||||
end
|
||||
end
|
||||
|
||||
def restore_weather_ambient_sounds()
|
||||
return unless $game_weather
|
||||
current_map = $game_map.map_id
|
||||
return if !$game_weather.current_weather
|
||||
current_weather_array = $game_weather.current_weather[current_map]
|
||||
return if current_weather_array.nil?
|
||||
current_weather_type = current_weather_array[0]
|
||||
current_weather_intensity = current_weather_array[1]
|
||||
set_weather_ambient_sounds(current_weather_type,current_weather_intensity)
|
||||
end
|
||||
|
||||
def set_weather_ambient_sounds(weather_type,intensity)
|
||||
base_volume = 60 #At intensity 1
|
||||
volume = [base_volume + base_volume * (intensity/2),10].min #Intensity at 10: volume 100
|
||||
case weather_type
|
||||
when :Rain, :Storm
|
||||
pbBGSPlay("ambient/rain",volume)
|
||||
when :Wind, :Blizzard, :StrongWind, :Storm
|
||||
pbBGSPlay("ambient/wind",volume)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,46 +1,51 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
|
||||
def isRaining?()
|
||||
return isWeatherRain? || isWeatherStorm?
|
||||
def isRaining?(map_id=$game_map.map_id)
|
||||
return isWeatherRain?(map_id) || isWeatherStorm?(map_id)
|
||||
end
|
||||
|
||||
def isWeatherRain?()
|
||||
def isWeatherRain?(map_id=$game_map.map_id)
|
||||
return true if GameData::Weather.get($game_screen.weather_type).category == :Rain
|
||||
return $game_weather.get_map_weather_type($game_map.map_id) == :Rain || $game_weather.get_map_weather_type($game_map.map_id) == :HeavyRain
|
||||
return $game_weather.get_map_weather_type(map_id) == :Rain || $game_weather.get_map_weather_type($game_map.map_id) == :HeavyRain
|
||||
end
|
||||
|
||||
def isWeatherSunny?()
|
||||
def isWeatherSunny?(map_id=$game_map.map_id)
|
||||
return true if GameData::Weather.get($game_screen.weather_type).category == :Sunny
|
||||
return $game_weather.get_map_weather_type($game_map.map_id) == :Sunny || $game_weather.get_map_weather_type($game_map.map_id) == :HarshSun
|
||||
return $game_weather.get_map_weather_type(map_id) == :Sunny || $game_weather.get_map_weather_type(map_id) == :HarshSun
|
||||
end
|
||||
|
||||
def isWeatherStorm?()
|
||||
def isWeatherStorm?(map_id=$game_map.map_id)
|
||||
return true if GameData::Weather.get($game_screen.weather_type).category == :Storm
|
||||
return $game_weather.get_map_weather_type($game_map.map_id) == :Storm
|
||||
return $game_weather.get_map_weather_type(map_id) == :Storm
|
||||
end
|
||||
|
||||
def isWeatherWind?()
|
||||
def isWeatherWind?(map_id=$game_map.map_id)
|
||||
return true if GameData::Weather.get($game_screen.weather_type).category == :Wind
|
||||
return $game_weather.get_map_weather_type($game_map.map_id) == :Wind || $game_weather.get_map_weather_type($game_map.map_id) == :StrongWinds
|
||||
return $game_weather.get_map_weather_type(map_id) == :Wind || $game_weather.get_map_weather_type(map_id) == :StrongWinds
|
||||
end
|
||||
|
||||
def isWeatherFog?()
|
||||
def isWeatherFog?(map_id=$game_map.map_id)
|
||||
return true if GameData::Weather.get($game_screen.weather_type).category == :Fog
|
||||
return $game_weather.get_map_weather_type($game_map.map_id) == :Fog
|
||||
return $game_weather.get_map_weather_type(map_id) == :Fog
|
||||
end
|
||||
|
||||
def isWeatherSnow?()
|
||||
def isWeatherAsh?(map_id=$game_map.map_id)
|
||||
return true if GameData::Weather.get($game_screen.weather_type).category == :Ash
|
||||
return $game_weather.get_map_weather_type(map_id) == :Ash
|
||||
end
|
||||
|
||||
def isWeatherSnow?(map_id=$game_map.map_id)
|
||||
return true if GameData::Weather.get($game_screen.weather_type).category == :Snow
|
||||
return $game_weather.get_map_weather_type($game_map.map_id) == :Snow
|
||||
return $game_weather.get_map_weather_type(map_id) == :Snow
|
||||
end
|
||||
|
||||
|
||||
def changeCurrentWeather(weatherType,intensity)
|
||||
def changeCurrentWeather(weatherType,intensity,force=false)
|
||||
new_map_id = $game_map.map_id
|
||||
mapMetadata = GameData::MapMetadata.try_get(new_map_id)
|
||||
return nil if mapMetadata.nil?
|
||||
return nil if !mapMetadata.outdoor_map
|
||||
return nil if !mapMetadata.outdoor_map && !force
|
||||
if $game_weather
|
||||
$game_weather.set_map_weather($game_map.map_id,weatherType,intensity)
|
||||
$game_weather.update_overworld_weather($game_map.map_id)
|
||||
|
||||
@@ -40,17 +40,23 @@ class GameWeather
|
||||
BASE_CHANCES_OF_WEATHER_MOVE = 10
|
||||
DEBUG_PROPAGATION = false
|
||||
|
||||
NO_WEATHER_MAPS = [MAP_DESERT_UNDERPASS] #For outdoor maps that shouldn't get weather
|
||||
|
||||
COLD_MAPS = [MAP_SHOAL_CAVE] # Rain is snow on that map (shoal cave)
|
||||
SNOW_LIMITS = [MAP_ROUTE_121,MAP_PACIFIDLOG] #Snow turns to rain if it reaches these maps
|
||||
NO_SNOW_MAPS = [MAP_ROUTE_121, MAP_FORTREE, MAP_ROUTE_120] #Maps where it's too warm to snow
|
||||
|
||||
SOOT_LIMITS = [MAP_ROUTE_113,MAP_FALLARBOR, MAP_ROUTE_111] #Can't let it propagate too much because then the grass would have to be covered in soot in those maps too....
|
||||
|
||||
SANDSTORM_MAPS = [MAP_DESERT] # Always sandstorm, doesn't spread
|
||||
NO_WIND_MAPS = [MAP_SOOTOPOLIS]
|
||||
NO_RAIN_MAPS = [MAP_MT_CHIMNEY,MAP_DESERT]
|
||||
|
||||
FREQUENT_WEATHER = [MAP_ROUTE_113,MAP_ROUTE_120] #More likely to spawn a new weather
|
||||
#Maps where it's likely to spawn a new weather. Value is the number of weather re-rolls.
|
||||
FREQUENT_WEATHER = {MAP_ROUTE_113=> 3,
|
||||
MAP_ROUTE_120 => 2}
|
||||
WINDY_MAPS = [MAP_MT_CHIMNEY,MAP_MT_PYRE] #More likely to be windy
|
||||
RAINY_MAPS = [MAP_ROUTE_113,MAP_ROUTE_119,MAP_ROUTE_120] #More likely to be raining,
|
||||
RAINY_MAPS = [MAP_ROUTE_113, MAP_ROUTE_119_SOUTH, MAP_ROUTE_120] #More likely to be raining,
|
||||
# 113 is in there because rain turns into soot there
|
||||
|
||||
SOOT_MAPS = [MAP_ROUTE_113]
|
||||
@@ -155,7 +161,10 @@ class GameWeather
|
||||
def try_spawn_new_weather(map_id,map_weather_type,spawn_chance=nil)
|
||||
return if map_weather_type != :None
|
||||
spawn_chance = CHANCE_OF_NEW_WEATHER unless spawn_chance
|
||||
spawn_chance*=2 if FREQUENT_WEATHER.include?(map_id)
|
||||
if FREQUENT_WEATHER.include?(map_id)
|
||||
nb_rerolls =FREQUENT_WEATHER[map_id]
|
||||
spawn_chance*=nb_rerolls
|
||||
end
|
||||
new_weather = select_new_weather_spawn(spawn_chance, map_id)
|
||||
@current_weather[map_id] = adjust_weather_for_map(new_weather,map_id)
|
||||
end
|
||||
@@ -233,6 +242,9 @@ class GameWeather
|
||||
end
|
||||
|
||||
def get_updated_weather(type, intensity, map_id)
|
||||
if NO_WEATHER_MAPS.include?(map_id)
|
||||
return [:None,0]
|
||||
end
|
||||
if COLD_MAPS.include?(map_id) || Settings::SNOW_DAY
|
||||
type = :Snow if type == :Rain
|
||||
type = :Blizzard if type == :Storm
|
||||
@@ -260,6 +272,7 @@ class GameWeather
|
||||
type = :Sandstorm
|
||||
intensity = 9
|
||||
end
|
||||
|
||||
if (PBDayNight.isNight? || PBDayNight.isEvening?) && type == :Sunny
|
||||
type = :None
|
||||
intensity = 0
|
||||
|
||||
Reference in New Issue
Block a user