mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
release 6.2
This commit is contained in:
23
Data/Scripts/051_AddOns/WaterEffect.rb
Normal file
23
Data/Scripts/051_AddOns/WaterEffect.rb
Normal file
@@ -0,0 +1,23 @@
|
||||
PUDDLE_ANIMATION_ID = 22
|
||||
Events.onStepTakenFieldMovement += proc { |_sender, e|
|
||||
event = e[0] # Get the event affected by field movement
|
||||
if $scene.is_a?(Scene_Map)
|
||||
event.each_occupied_tile do |x, y|
|
||||
mapTerrainTag = $MapFactory.getTerrainTag(event.map.map_id, x, y, false)
|
||||
if $PokemonGlobal.surfing
|
||||
if isWaterTerrain?(mapTerrainTag)
|
||||
$scene.spriteset.addUserAnimation(PUDDLE_ANIMATION_ID, event.x, event.y, true, 0)
|
||||
end
|
||||
else
|
||||
if mapTerrainTag == 16 #puddle
|
||||
pbSEPlay("puddle", 100) if event == $game_player && !$PokemonGlobal.surfing #only play sound effect in puddle
|
||||
$scene.spriteset.addUserAnimation(PUDDLE_ANIMATION_ID, event.x, event.y, true, 0)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
}
|
||||
|
||||
def isWaterTerrain?(tag)
|
||||
return [5, 6, 17, 7, 9, 16].include?(tag)
|
||||
end
|
||||
Reference in New Issue
Block a user