Some battle method refactoring, fixed typo

This commit is contained in:
Maruno17
2021-11-17 20:40:19 +00:00
parent 1c4819e5f0
commit 7ec8f30f0e
16 changed files with 399 additions and 445 deletions

View File

@@ -683,7 +683,7 @@ class Battle
end
#=============================================================================
# Weather and terrain
# Weather
#=============================================================================
def defaultWeather=(value)
@field.defaultWeather = value
@@ -753,6 +753,23 @@ class Battle
end
end
def pbStartWeatherAbility(new_weather, battler, ignore_primal = false)
return if !ignore_primal && [:HarshSun, :HeavyRain, :StrongWinds].include?(@field.weather)
return if @field.weather == new_weather
battle.pbShowAbilitySplash(battler)
if !Scene::USE_ABILITY_SPLASH
pbDisplay(_INTL("{1}'s {2} activated!", battler.pbThis, battler.abilityName))
end
fixed_duration = false
fixed_duration = true if Settings::FIXED_DURATION_WEATHER_FROM_ABILITY &&
![:HarshSun, :HeavyRain, :StrongWinds].include?(new_weather)
pbStartWeather(battler, new_weather, fixed_duration)
# NOTE: The ability splash is hidden again in def pbStartWeather.
end
#=============================================================================
# Terrain
#=============================================================================
def defaultTerrain=(value)
@field.defaultTerrain = value
@field.terrain = value