-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcrawli-weather.rb
More file actions
71 lines (62 loc) · 1.7 KB
/
crawli-weather.rb
File metadata and controls
71 lines (62 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Events.onStepTaken += proc {
playWeatherOrDiveBGS
}
WEATHER_BGS = {
Rain: "Weather- Rain",
Storm: "Weather- Storm",
HeavyRain: "Weather- Storm",
Winds: "Weather- Wind",
}
BLINDSTEP_WEATHER_BGS = {
Snow: "Weather- Snow (Blindstep)",
Blizzard: "Weather- Snow (Blindstep)",
Sandstorm: "Weather- Sandstorm (Blindstep)",
Sunny: "Weather- Sun (Blindstep)",
}
# Play BGS while over a dive spot
def playWeatherOrDiveBGS
# return unless Reborn
if BlindstepActive
if $game_player.terrain_tag == PBTerrain::DeepWater
pbAccessibilityBGSPlay("Ambient Depth")
return
end
if $PokemonGlobal.diving
divemap=nil
for i in 0...$cache.mapdata.length
if $cache.mapdata[i] && $cache.mapdata[i].DiveMap
if $cache.mapdata[i].DiveMap==$game_map.map_id
divemap=i
break
end
end
end
if !divemap.nil? && $MapFactory.getTerrainTag(divemap, $game_player.x, $game_player.y) == PBTerrain::DeepWater
pbAccessibilityBGSPlay("Ambient Light")
return
end
end
end
weatherBGS = WEATHER_BGS
weatherBGS.merge!(BLINDSTEP_WEATHER_BGS) if BlindstepActive
if weatherBGS[$game_screen.weather_type]
pbAccessibilityBGSPlay(weatherBGS[$game_screen.weather_type])
else
pbBGSStop(0.5)
end
playingBGS = $game_system.getPlayingBGS
if !playingBGS.nil? && ["Ambient Light", "Ambient Depth"].include?(playingBGS.name)
if $game_map.map.autoplay_bgs
pbBGSPlay($game_map.bgs)
else
pbBGSStop(0.5)
end
end
end
class Game_Map
alias :crawliweather_old_autoplay :autoplay
def autoplay(from_startup = false)
playWeatherOrDiveBGS
crawliweather_old_autoplay(from_startup)
end
end