Fixed field animations relating to events and followers not showing if they're on a connected map, fixed grass not rustling if the player walks onto it directly from a connected map, fixed grass rustling appearing beneath the player

This commit is contained in:
Maruno17
2022-01-29 18:05:11 +00:00
parent 2372322c24
commit 7c7a6d91bd
5 changed files with 16 additions and 9 deletions

View File

@@ -204,7 +204,7 @@ class SpriteAnimation
sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192) sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192)
case @_animation_height case @_animation_height
when 0 then sprite.z = 1 when 0 then sprite.z = 1
when 1 then sprite.z = sprite.y + 32 + 15 when 1 then sprite.z = sprite.y + 32 + 17
when 2 then sprite.z = sprite.y + 32 + 32 + 17 when 2 then sprite.z = sprite.y + 32 + 32 + 17
else sprite.z = 2000 else sprite.z = 2000
end end

View File

@@ -27,6 +27,10 @@ class Game_Player < Game_Character
return $game_map return $game_map
end end
def map_id
return $game_map.map_id
end
def screen_z(height = 0) def screen_z(height = 0)
ret = super ret = super
return ret + 1 return ret + 1

View File

@@ -151,7 +151,8 @@ class Game_Follower < Game_Event
was_jumping = jumping? was_jumping = jumping?
super super
if was_jumping && !jumping? if was_jumping && !jumping?
$scene.spriteset.addUserAnimation(Settings::DUST_ANIMATION_ID, self.x, self.y, true, 1) spriteset = $scene.spriteset(map_id)
spriteset&.addUserAnimation(Settings::DUST_ANIMATION_ID, self.x, self.y, true, 1)
end end
end end

View File

@@ -151,8 +151,9 @@ EventHandlers.add(:on_step_taken, :grass_rustling,
proc { |event| proc { |event|
next if !$scene.is_a?(Scene_Map) next if !$scene.is_a?(Scene_Map)
event.each_occupied_tile do |x, y| event.each_occupied_tile do |x, y|
next if !$map_factory.getTerrainTag(event.map.map_id, x, y, true).shows_grass_rustle next if !$map_factory.getTerrainTagFromCoords(event.map.map_id, x, y, true).shows_grass_rustle
$scene.spriteset.addUserAnimation(Settings::GRASS_ANIMATION_ID, x, y, true, 1) spriteset = $scene.spriteset(event.map_id)
spriteset&.addUserAnimation(Settings::GRASS_ANIMATION_ID, x, y, true, 1)
end end
} }
) )

View File

@@ -172,13 +172,14 @@ def pbExclaim(event, id = Settings::EXCLAMATION_ANIMATION_ID, tinting = false)
sprite = nil sprite = nil
done = [] done = []
event.each do |i| event.each do |i|
if !done.include?(i.id) next if done.include?(i.id)
sprite = $scene.spriteset.addUserAnimation(id, i.x, i.y, tinting, 2) spriteset = $scene.spriteset(i.map_id)
done.push(i.id) sprite ||= spriteset&.addUserAnimation(id, i.x, i.y, tinting, 2)
end done.push(i.id)
end end
else else
sprite = $scene.spriteset.addUserAnimation(id, event.x, event.y, tinting, 2) spriteset = $scene.spriteset(event.map_id)
sprite = spriteset&.addUserAnimation(id, event.x, event.y, tinting, 2)
end end
until sprite.disposed? until sprite.disposed?
Graphics.update Graphics.update