mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Added decent spacing to all scripts thanks to Rubocop
This commit is contained in:
@@ -2,13 +2,13 @@ class Sprite_Reflection
|
||||
attr_reader :visible
|
||||
attr_accessor :event
|
||||
|
||||
def initialize(sprite,event,viewport = nil)
|
||||
def initialize(sprite, event, viewport = nil)
|
||||
@rsprite = sprite
|
||||
@sprite = nil
|
||||
@event = event
|
||||
@height = 0
|
||||
@fixedheight = false
|
||||
if @event && @event!=$game_player
|
||||
if @event && @event != $game_player
|
||||
if @event.name[/reflection\((\d+)\)/i]
|
||||
@height = $~[1].to_i || 0
|
||||
@fixedheight = true
|
||||
@@ -50,35 +50,35 @@ class Sprite_Reflection
|
||||
# Just-in-time creation of sprite
|
||||
@sprite = Sprite.new(@viewport) if !@sprite
|
||||
if @sprite
|
||||
x = @rsprite.x-@rsprite.ox
|
||||
y = @rsprite.y-@rsprite.oy
|
||||
x = @rsprite.x - @rsprite.ox
|
||||
y = @rsprite.y - @rsprite.oy
|
||||
y -= 32 if @rsprite.character.character_name[/offset/i]
|
||||
@height = $PokemonGlobal.bridge if !@fixedheight
|
||||
y += @height*16
|
||||
y += @height * 16
|
||||
width = @rsprite.src_rect.width
|
||||
height = @rsprite.src_rect.height
|
||||
@sprite.x = x+width/2
|
||||
@sprite.y = y+height+height/2
|
||||
@sprite.ox = width/2
|
||||
@sprite.oy = height/2-2 # Hard-coded 2 pixel shift up
|
||||
@sprite.oy -= @rsprite.character.bob_height*2
|
||||
@sprite.x = x + width / 2
|
||||
@sprite.y = y + height + height / 2
|
||||
@sprite.ox = width / 2
|
||||
@sprite.oy = height / 2 - 2 # Hard-coded 2 pixel shift up
|
||||
@sprite.oy -= @rsprite.character.bob_height * 2
|
||||
@sprite.z = -50 # Still water is -100, map is 0 and above
|
||||
@sprite.z += 1 if @event == $game_player
|
||||
@sprite.zoom_x = @rsprite.zoom_x
|
||||
@sprite.zoom_y = @rsprite.zoom_y
|
||||
frame = (Graphics.frame_count%40)/10
|
||||
frame = (Graphics.frame_count % 40) / 10
|
||||
@sprite.zoom_x *= [1.0, 0.95, 1.0, 1.05][frame]
|
||||
@sprite.angle = 180.0
|
||||
@sprite.mirror = true
|
||||
@sprite.bitmap = @rsprite.bitmap
|
||||
@sprite.tone = @rsprite.tone
|
||||
if @height>0
|
||||
@sprite.color = Color.new(48,96,160,255) # Dark still water
|
||||
if @height > 0
|
||||
@sprite.color = Color.new(48, 96, 160, 255) # Dark still water
|
||||
@sprite.opacity = @rsprite.opacity
|
||||
@sprite.visible = !Settings::TIME_SHADING # Can't time-tone a colored sprite
|
||||
else
|
||||
@sprite.color = Color.new(224,224,224,96)
|
||||
@sprite.opacity = @rsprite.opacity*3/4
|
||||
@sprite.color = Color.new(224, 224, 224, 96)
|
||||
@sprite.opacity = @rsprite.opacity * 3 / 4
|
||||
@sprite.visible = true
|
||||
end
|
||||
@sprite.src_rect = @rsprite.src_rect
|
||||
|
||||
Reference in New Issue
Block a user