mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Fixed Database animations' position not moving the animation for exclamations
This commit is contained in:
@@ -49,9 +49,9 @@ module RPG
|
|||||||
array.push(anim)
|
array.push(anim)
|
||||||
end
|
end
|
||||||
|
|
||||||
def animation(animation, hit, height = 3)
|
def animation(animation, hit, height = 3, no_tone = false)
|
||||||
anim = SpriteAnimation.new(self)
|
anim = SpriteAnimation.new(self)
|
||||||
anim.animation(animation, hit, height)
|
anim.animation(animation, hit, height, no_tone)
|
||||||
pushAnimation(@animations, anim)
|
pushAnimation(@animations, anim)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,9 @@ class Game_Character
|
|||||||
attr_accessor :lock_pattern
|
attr_accessor :lock_pattern
|
||||||
attr_reader :move_route_forcing
|
attr_reader :move_route_forcing
|
||||||
attr_accessor :through
|
attr_accessor :through
|
||||||
attr_accessor :animation_id
|
attr_reader :animation_id
|
||||||
|
attr_accessor :animation_height
|
||||||
|
attr_accessor :animation_regular_tone
|
||||||
attr_accessor :transparent
|
attr_accessor :transparent
|
||||||
attr_reader :move_speed
|
attr_reader :move_speed
|
||||||
attr_reader :jump_speed
|
attr_reader :jump_speed
|
||||||
@@ -54,7 +56,7 @@ class Game_Character
|
|||||||
@lock_pattern = false
|
@lock_pattern = false
|
||||||
@move_route_forcing = false
|
@move_route_forcing = false
|
||||||
@through = false
|
@through = false
|
||||||
@animation_id = 0
|
animation_id = 0
|
||||||
@transparent = false
|
@transparent = false
|
||||||
@original_direction = 2
|
@original_direction = 2
|
||||||
@original_pattern = 0
|
@original_pattern = 0
|
||||||
@@ -86,6 +88,14 @@ class Game_Character
|
|||||||
@prelock_direction = 0
|
@prelock_direction = 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def animation_id=(value)
|
||||||
|
@animation_id = value
|
||||||
|
if value == 0
|
||||||
|
@animation_height = 3
|
||||||
|
@animation_regular_tone = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def x_offset; return @x_offset || 0; end
|
def x_offset; return @x_offset || 0; end
|
||||||
def y_offset; return @y_offset || 0; end
|
def y_offset; return @y_offset || 0; end
|
||||||
|
|
||||||
|
|||||||
@@ -176,9 +176,9 @@ class Sprite_Character < RPG::Sprite
|
|||||||
self.z = @character.screen_z(@ch)
|
self.z = @character.screen_z(@ch)
|
||||||
self.opacity = @character.opacity
|
self.opacity = @character.opacity
|
||||||
self.blend_type = @character.blend_type
|
self.blend_type = @character.blend_type
|
||||||
if @character.animation_id != 0
|
if @character.animation_id && @character.animation_id != 0
|
||||||
animation = $data_animations[@character.animation_id]
|
animation = $data_animations[@character.animation_id]
|
||||||
animation(animation, true)
|
animation(animation, true, @character.animation_height || 3, @character.animation_regular_tone || false)
|
||||||
@character.animation_id = 0
|
@character.animation_id = 0
|
||||||
end
|
end
|
||||||
@reflection&.update
|
@reflection&.update
|
||||||
|
|||||||
@@ -28,12 +28,13 @@ class SpriteAnimation
|
|||||||
dispose_loop_animation
|
dispose_loop_animation
|
||||||
end
|
end
|
||||||
|
|
||||||
def animation(animation, hit, height = 3)
|
def animation(animation, hit, height = 3, no_tone = false)
|
||||||
dispose_animation
|
dispose_animation
|
||||||
@_animation = animation
|
@_animation = animation
|
||||||
return if @_animation.nil?
|
return if @_animation.nil?
|
||||||
@_animation_hit = hit
|
@_animation_hit = hit
|
||||||
@_animation_height = height
|
@_animation_height = height
|
||||||
|
@_animation_no_tone = no_tone
|
||||||
@_animation_duration = @_animation.frame_max
|
@_animation_duration = @_animation.frame_max
|
||||||
@_animation_index = -1
|
@_animation_index = -1
|
||||||
fr = 20
|
fr = 20
|
||||||
@@ -207,7 +208,7 @@ class SpriteAnimation
|
|||||||
sprite.zoom_y = cell_data[i, 3] / 100.0
|
sprite.zoom_y = cell_data[i, 3] / 100.0
|
||||||
sprite.angle = cell_data[i, 4]
|
sprite.angle = cell_data[i, 4]
|
||||||
sprite.mirror = (cell_data[i, 5] == 1)
|
sprite.mirror = (cell_data[i, 5] == 1)
|
||||||
sprite.tone = self.tone
|
sprite.tone = self.tone if !@_animation_no_tone
|
||||||
sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
|
sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
|
||||||
sprite.blend_type = cell_data[i, 7]
|
sprite.blend_type = cell_data[i, 7]
|
||||||
end
|
end
|
||||||
@@ -301,6 +302,9 @@ class Spriteset_Map
|
|||||||
_animationSprite_initialize(map)
|
_animationSprite_initialize(map)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Used to display animations that remain in the same location on the map.
|
||||||
|
# Typically for grass rustling and dust clouds, and other animations that
|
||||||
|
# aren't relative to an event.
|
||||||
def addUserAnimation(animID, x, y, tinting = false, height = 3)
|
def addUserAnimation(animID, x, y, tinting = false, height = 3)
|
||||||
sprite = AnimationContainerSprite.new(animID, self.map, x, y, @@viewport1, tinting, height)
|
sprite = AnimationContainerSprite.new(animID, self.map, x, y, @@viewport1, tinting, height)
|
||||||
addUserSprite(sprite)
|
addUserSprite(sprite)
|
||||||
|
|||||||
@@ -46,7 +46,9 @@ def pbFishing(hasEncounter, rodType = 1)
|
|||||||
break
|
break
|
||||||
end
|
end
|
||||||
if hasEncounter && rand(100) < biteChance
|
if hasEncounter && rand(100) < biteChance
|
||||||
$scene.spriteset.addUserAnimation(Settings::EXCLAMATION_ANIMATION_ID, $game_player.x, $game_player.y, true, 3)
|
$game_player.animation_id = Settings::EXCLAMATION_ANIMATION_ID
|
||||||
|
$game_player.animation_height = 3
|
||||||
|
$game_player.animation_regular_tone = true
|
||||||
duration = rand(5..10) / 10.0 # 0.5-1 seconds
|
duration = rand(5..10) / 10.0 # 0.5-1 seconds
|
||||||
if !pbWaitForInput(msgWindow, message + "\n" + _INTL("Oh! A bite!"), duration)
|
if !pbWaitForInput(msgWindow, message + "\n" + _INTL("Oh! A bite!"), duration)
|
||||||
pbFishingEnd { pbMessageDisplay(msgWindow, _INTL("The Pokémon got away...")) }
|
pbFishingEnd { pbMessageDisplay(msgWindow, _INTL("The Pokémon got away...")) }
|
||||||
|
|||||||
@@ -268,9 +268,9 @@ class BerryPlantSprite
|
|||||||
end
|
end
|
||||||
if berry_plant.new_mechanics && @old_stage != berry_plant.growth_stage &&
|
if berry_plant.new_mechanics && @old_stage != berry_plant.growth_stage &&
|
||||||
@old_stage > 0 && berry_plant.growth_stage <= GameData::BerryPlant::NUMBER_OF_GROWTH_STAGES + 1
|
@old_stage > 0 && berry_plant.growth_stage <= GameData::BerryPlant::NUMBER_OF_GROWTH_STAGES + 1
|
||||||
spriteset = $scene.spriteset(@map.map_id)
|
@event.animation_id = Settings::PLANT_SPARKLE_ANIMATION_ID
|
||||||
spriteset&.addUserAnimation(Settings::PLANT_SPARKLE_ANIMATION_ID,
|
@event.animation_height = 1
|
||||||
@event.x, @event.y, false, 1)
|
@event.animation_regular_tone = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@old_stage = berry_plant.growth_stage
|
@old_stage = berry_plant.growth_stage
|
||||||
|
|||||||
@@ -191,25 +191,21 @@ def pbTimeEventValid(variableNumber)
|
|||||||
return ret
|
return ret
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbExclaim(event, id = Settings::EXCLAMATION_ANIMATION_ID, tinting = false)
|
def pbExclaim(events, anim = Settings::EXCLAMATION_ANIMATION_ID, tinting = false)
|
||||||
if event.is_a?(Array)
|
events = [events] if !events.is_a?(Array)
|
||||||
sprite = nil
|
events.each do |ev|
|
||||||
done = []
|
ev.animation_id = anim
|
||||||
event.each do |i|
|
ev.animation_height = 3
|
||||||
next if done.include?(i.id)
|
ev.animation_regular_tone = !tinting
|
||||||
spriteset = $scene.spriteset(i.map_id)
|
|
||||||
sprite ||= spriteset&.addUserAnimation(id, i.x, i.y, tinting, 2)
|
|
||||||
done.push(i.id)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
spriteset = $scene.spriteset(event.map_id)
|
|
||||||
sprite = spriteset&.addUserAnimation(id, event.x, event.y, tinting, 2)
|
|
||||||
end
|
end
|
||||||
until sprite.disposed?
|
anim_data = $data_animations[anim]
|
||||||
Graphics.update
|
frame_count = anim_data.frame_max
|
||||||
Input.update
|
frame_rate = 20
|
||||||
pbUpdateSceneMap
|
if anim_data.name[/\[\s*(\d+?)\s*\]\s*$/]
|
||||||
|
frame_rate = $~[1].to_i
|
||||||
end
|
end
|
||||||
|
pbWait(frame_count / frame_rate.to_f)
|
||||||
|
events.each { |i| i.animation_id = 0 }
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbNoticePlayer(event, always_show_exclaim = false)
|
def pbNoticePlayer(event, always_show_exclaim = false)
|
||||||
|
|||||||
Reference in New Issue
Block a user