From a2af2c36f9ecae6a4b315c1ddba783ad50e17657 Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Mon, 1 Apr 2024 22:13:16 +0100 Subject: [PATCH] Added water ripple animation, removed second error message when the Compiler crashes --- Data/Scripts/001_Settings.rb | 3 +++ .../010_Data/001_Hardcoded data/011_TerrainTag.rb | 8 ++++++-- .../004_Scene/007_Battle_Scene_BaseAnimation.rb | 1 + Data/Scripts/012_Overworld/001_Overworld.rb | 12 ++++++++++++ .../001_Overworld_BattleStarting.rb | 4 ++-- Data/Scripts/021_Compiler/001_Compiler.rb | 1 + 6 files changed, 25 insertions(+), 4 deletions(-) diff --git a/Data/Scripts/001_Settings.rb b/Data/Scripts/001_Settings.rb index 9c8bcd1ad..399a8871c 100644 --- a/Data/Scripts/001_Settings.rb +++ b/Data/Scripts/001_Settings.rb @@ -400,6 +400,9 @@ module Settings # ID of the animation played when the player lands on the ground after hopping # over a ledge (shows a dust impact). DUST_ANIMATION_ID = 2 + # ID of the animation played when the player finishes taking a step onto still + # water (shows a water ripple). + WATER_RIPPLE_ANIMATION_ID = 8 # ID of the animation played when a trainer notices the player (an exclamation # bubble). EXCLAMATION_ANIMATION_ID = 3 diff --git a/Data/Scripts/010_Data/001_Hardcoded data/011_TerrainTag.rb b/Data/Scripts/010_Data/001_Hardcoded data/011_TerrainTag.rb index 52ec76c28..b1b72b993 100644 --- a/Data/Scripts/010_Data/001_Hardcoded data/011_TerrainTag.rb +++ b/Data/Scripts/010_Data/001_Hardcoded data/011_TerrainTag.rb @@ -10,6 +10,7 @@ module GameData attr_reader :can_dive attr_reader :deep_bush attr_reader :shows_grass_rustle + attr_reader :shows_water_ripple attr_reader :land_wild_encounters attr_reader :double_wild_encounters attr_reader :battle_environment @@ -50,6 +51,7 @@ module GameData @can_dive = hash[:can_dive] || false @deep_bush = hash[:deep_bush] || false @shows_grass_rustle = hash[:shows_grass_rustle] || false + @shows_water_ripple = hash[:shows_water_ripple] || false @land_wild_encounters = hash[:land_wild_encounters] || false @double_wild_encounters = hash[:double_wild_encounters] || false @battle_environment = hash[:battle_environment] @@ -118,7 +120,8 @@ GameData::TerrainTag.register({ :can_surf => true, :can_fish => true, :battle_environment => :StillWater, - :shows_reflections => true + :shows_reflections => true, + :shows_water_ripple => true }) GameData::TerrainTag.register({ @@ -195,7 +198,8 @@ GameData::TerrainTag.register({ :id => :Puddle, :id_number => 16, :battle_environment => :Puddle, - :shows_reflections => true + :shows_reflections => true, + :shows_water_ripple => true }) GameData::TerrainTag.register({ diff --git a/Data/Scripts/011_Battle/004_Scene/007_Battle_Scene_BaseAnimation.rb b/Data/Scripts/011_Battle/004_Scene/007_Battle_Scene_BaseAnimation.rb index 44508ddd1..a70978979 100644 --- a/Data/Scripts/011_Battle/004_Scene/007_Battle_Scene_BaseAnimation.rb +++ b/Data/Scripts/011_Battle/004_Scene/007_Battle_Scene_BaseAnimation.rb @@ -101,6 +101,7 @@ module Battle::Scene::Animation::BallAnimationMixin end def ballTracksHand(ball, traSprite, safariThrow = false) + raise _INTL("Trainer back sprite doesn't exist.") if !traSprite || !traSprite.bitmap # Back sprite isn't animated, no hand-tracking needed if traSprite.bitmap.width < traSprite.bitmap.height * 2 ball.setVisible(7, true) diff --git a/Data/Scripts/012_Overworld/001_Overworld.rb b/Data/Scripts/012_Overworld/001_Overworld.rb index 6b49ae5db..3a18274a1 100644 --- a/Data/Scripts/012_Overworld/001_Overworld.rb +++ b/Data/Scripts/012_Overworld/001_Overworld.rb @@ -154,6 +154,18 @@ EventHandlers.add(:on_step_taken, :grass_rustling, } ) +# Show water ripple animation +EventHandlers.add(:on_step_taken, :still_water_ripple, + proc { |event| + next if !$scene.is_a?(Scene_Map) + event.each_occupied_tile do |x, y| + next if !$map_factory.getTerrainTagFromCoords(event.map.map_id, x, y, true).shows_water_ripple + spriteset = $scene.spriteset(event.map_id) + spriteset&.addUserAnimation(Settings::WATER_RIPPLE_ANIMATION_ID, x, y, true, -1) + end + } +) + # Auto-move the player over waterfalls and ice EventHandlers.add(:on_step_taken, :auto_move_player, proc { |event| diff --git a/Data/Scripts/012_Overworld/002_Battle triggering/001_Overworld_BattleStarting.rb b/Data/Scripts/012_Overworld/002_Battle triggering/001_Overworld_BattleStarting.rb index a0cb644f4..7171e0a61 100644 --- a/Data/Scripts/012_Overworld/002_Battle triggering/001_Overworld_BattleStarting.rb +++ b/Data/Scripts/012_Overworld/002_Battle triggering/001_Overworld_BattleStarting.rb @@ -658,7 +658,7 @@ def pbDynamicItemList(*args) end # Common items to find via Pickup. Items from this list are added to the pool in -# order, starting from a point dependng on the Pokémon's level. The number of +# order, starting from a point depending on the Pokémon's level. The number of # items added is how many probabilities are in the PICKUP_COMMON_ITEM_CHANCES # array below. # There must be 9 + PICKUP_COMMON_ITEM_CHANCES.length number of items in this @@ -687,7 +687,7 @@ PICKUP_COMMON_ITEMS = [ # Chances to get each item added to the pool from the array above. PICKUP_COMMON_ITEM_CHANCES = [30, 10, 10, 10, 10, 10, 10, 4, 4] # Rare items to find via Pickup. Items from this list are added to the pool in -# order, starting from a point dependng on the Pokémon's level. The number of +# order, starting from a point depending on the Pokémon's level. The number of # items added is how many probabilities are in the PICKUP_RARE_ITEM_CHANCES # array below. # There must be 9 + PICKUP_RARE_ITEM_CHANCES.length number of items in this diff --git a/Data/Scripts/021_Compiler/001_Compiler.rb b/Data/Scripts/021_Compiler/001_Compiler.rb index 1dd5f3747..bbc5077bf 100644 --- a/Data/Scripts/021_Compiler/001_Compiler.rb +++ b/Data/Scripts/021_Compiler/001_Compiler.rb @@ -1111,6 +1111,7 @@ module Compiler end end raise Reset.new if e.is_a?(Hangup) + raise SystemExit.new if e.is_a?(RuntimeError) raise "Unknown exception when compiling." end end