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)
|
||||
end
|
||||
|
||||
def animation(animation, hit, height = 3)
|
||||
def animation(animation, hit, height = 3, no_tone = false)
|
||||
anim = SpriteAnimation.new(self)
|
||||
anim.animation(animation, hit, height)
|
||||
anim.animation(animation, hit, height, no_tone)
|
||||
pushAnimation(@animations, anim)
|
||||
end
|
||||
|
||||
|
||||
@@ -22,7 +22,9 @@ class Game_Character
|
||||
attr_accessor :lock_pattern
|
||||
attr_reader :move_route_forcing
|
||||
attr_accessor :through
|
||||
attr_accessor :animation_id
|
||||
attr_reader :animation_id
|
||||
attr_accessor :animation_height
|
||||
attr_accessor :animation_regular_tone
|
||||
attr_accessor :transparent
|
||||
attr_reader :move_speed
|
||||
attr_reader :jump_speed
|
||||
@@ -54,7 +56,7 @@ class Game_Character
|
||||
@lock_pattern = false
|
||||
@move_route_forcing = false
|
||||
@through = false
|
||||
@animation_id = 0
|
||||
animation_id = 0
|
||||
@transparent = false
|
||||
@original_direction = 2
|
||||
@original_pattern = 0
|
||||
@@ -86,6 +88,14 @@ class Game_Character
|
||||
@prelock_direction = 0
|
||||
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 y_offset; return @y_offset || 0; end
|
||||
|
||||
|
||||
@@ -176,9 +176,9 @@ class Sprite_Character < RPG::Sprite
|
||||
self.z = @character.screen_z(@ch)
|
||||
self.opacity = @character.opacity
|
||||
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(animation, true)
|
||||
animation(animation, true, @character.animation_height || 3, @character.animation_regular_tone || false)
|
||||
@character.animation_id = 0
|
||||
end
|
||||
@reflection&.update
|
||||
|
||||
@@ -28,12 +28,13 @@ class SpriteAnimation
|
||||
dispose_loop_animation
|
||||
end
|
||||
|
||||
def animation(animation, hit, height = 3)
|
||||
def animation(animation, hit, height = 3, no_tone = false)
|
||||
dispose_animation
|
||||
@_animation = animation
|
||||
return if @_animation.nil?
|
||||
@_animation_hit = hit
|
||||
@_animation_height = height
|
||||
@_animation_no_tone = no_tone
|
||||
@_animation_duration = @_animation.frame_max
|
||||
@_animation_index = -1
|
||||
fr = 20
|
||||
@@ -207,7 +208,7 @@ class SpriteAnimation
|
||||
sprite.zoom_y = cell_data[i, 3] / 100.0
|
||||
sprite.angle = cell_data[i, 4]
|
||||
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.blend_type = cell_data[i, 7]
|
||||
end
|
||||
@@ -301,6 +302,9 @@ class Spriteset_Map
|
||||
_animationSprite_initialize(map)
|
||||
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)
|
||||
sprite = AnimationContainerSprite.new(animID, self.map, x, y, @@viewport1, tinting, height)
|
||||
addUserSprite(sprite)
|
||||
|
||||
@@ -46,7 +46,9 @@ def pbFishing(hasEncounter, rodType = 1)
|
||||
break
|
||||
end
|
||||
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
|
||||
if !pbWaitForInput(msgWindow, message + "\n" + _INTL("Oh! A bite!"), duration)
|
||||
pbFishingEnd { pbMessageDisplay(msgWindow, _INTL("The Pokémon got away...")) }
|
||||
|
||||
@@ -268,9 +268,9 @@ class BerryPlantSprite
|
||||
end
|
||||
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
|
||||
spriteset = $scene.spriteset(@map.map_id)
|
||||
spriteset&.addUserAnimation(Settings::PLANT_SPARKLE_ANIMATION_ID,
|
||||
@event.x, @event.y, false, 1)
|
||||
@event.animation_id = Settings::PLANT_SPARKLE_ANIMATION_ID
|
||||
@event.animation_height = 1
|
||||
@event.animation_regular_tone = true
|
||||
end
|
||||
end
|
||||
@old_stage = berry_plant.growth_stage
|
||||
|
||||
@@ -191,25 +191,21 @@ def pbTimeEventValid(variableNumber)
|
||||
return ret
|
||||
end
|
||||
|
||||
def pbExclaim(event, id = Settings::EXCLAMATION_ANIMATION_ID, tinting = false)
|
||||
if event.is_a?(Array)
|
||||
sprite = nil
|
||||
done = []
|
||||
event.each do |i|
|
||||
next if done.include?(i.id)
|
||||
spriteset = $scene.spriteset(i.map_id)
|
||||
sprite ||= spriteset&.addUserAnimation(id, i.x, i.y, tinting, 2)
|
||||
done.push(i.id)
|
||||
def pbExclaim(events, anim = Settings::EXCLAMATION_ANIMATION_ID, tinting = false)
|
||||
events = [events] if !events.is_a?(Array)
|
||||
events.each do |ev|
|
||||
ev.animation_id = anim
|
||||
ev.animation_height = 3
|
||||
ev.animation_regular_tone = !tinting
|
||||
end
|
||||
else
|
||||
spriteset = $scene.spriteset(event.map_id)
|
||||
sprite = spriteset&.addUserAnimation(id, event.x, event.y, tinting, 2)
|
||||
end
|
||||
until sprite.disposed?
|
||||
Graphics.update
|
||||
Input.update
|
||||
pbUpdateSceneMap
|
||||
anim_data = $data_animations[anim]
|
||||
frame_count = anim_data.frame_max
|
||||
frame_rate = 20
|
||||
if anim_data.name[/\[\s*(\d+?)\s*\]\s*$/]
|
||||
frame_rate = $~[1].to_i
|
||||
end
|
||||
pbWait(frame_count / frame_rate.to_f)
|
||||
events.each { |i| i.animation_id = 0 }
|
||||
end
|
||||
|
||||
def pbNoticePlayer(event, always_show_exclaim = false)
|
||||
|
||||
Reference in New Issue
Block a user