Added class GameData::Weather

This commit is contained in:
Maruno17
2021-03-27 19:47:34 +00:00
parent 8975d7a20c
commit b5c8c6ba26
12 changed files with 252 additions and 187 deletions

View File

@@ -223,18 +223,12 @@ class BerryPlantSprite
end
end
end
# Check auto-watering
if berryData[0]>0 && berryData[0]<5
# Reset watering
if $game_screen &&
($game_screen.weather_type==PBFieldWeather::Rain ||
$game_screen.weather_type==PBFieldWeather::HeavyRain ||
$game_screen.weather_type==PBFieldWeather::Storm)
# If raining, plant is already watered
if berryData[2]==false
berryData[2]=true
berryData[4]+=1
end
# If raining, automatically water the plant
if berryData[0] > 0 && berryData[0] < 5 && $game_screen &&
GameData::Weather.get($game_screen.weather_type).category == :Rain
if berryData[2] == false
berryData[2] = true
berryData[4] += 1
end
end
end