mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Applied most Rubocop-suggested layout fixes
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
class Spriteset_Global
|
||||
attr_reader :playersprite
|
||||
|
||||
@@viewport2 = Viewport.new(0, 0, Settings::SCREEN_WIDTH, Settings::SCREEN_HEIGHT)
|
||||
@@viewport2.z = 200
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ end
|
||||
|
||||
class Spriteset_Map
|
||||
attr_reader :map
|
||||
|
||||
@@viewport0 = Viewport.new(0, 0, Settings::SCREEN_WIDTH, Settings::SCREEN_HEIGHT) # Panorama
|
||||
@@viewport0.z = -100
|
||||
@@viewport1 = Viewport.new(0, 0, Settings::SCREEN_WIDTH, Settings::SCREEN_HEIGHT) # Map, events, player, fog
|
||||
|
||||
@@ -231,28 +231,28 @@ end
|
||||
def XPML_read(map,markup,event,max_param_number=0)
|
||||
parameter_list = nil
|
||||
return nil if !event || event.list == nil
|
||||
for i in 0...event.list.size
|
||||
if event.list[i].code == 108 &&
|
||||
event.list[i].parameters[0].downcase == "begin " + markup.downcase
|
||||
parameter_list = [] if parameter_list == nil
|
||||
for j in i+1...event.list.size
|
||||
if event.list[j].code == 108
|
||||
parts = event.list[j].parameters[0].split
|
||||
if parts.size != 1 && parts[0].downcase != "begin"
|
||||
if parts[1].to_i != 0 || parts[1] == "0"
|
||||
parameter_list.push(parts[1].to_i)
|
||||
else
|
||||
parameter_list.push(parts[1])
|
||||
end
|
||||
for i in 0...event.list.size
|
||||
if event.list[i].code == 108 &&
|
||||
event.list[i].parameters[0].downcase == "begin " + markup.downcase
|
||||
parameter_list = [] if parameter_list == nil
|
||||
for j in i+1...event.list.size
|
||||
if event.list[j].code == 108
|
||||
parts = event.list[j].parameters[0].split
|
||||
if parts.size != 1 && parts[0].downcase != "begin"
|
||||
if parts[1].to_i != 0 || parts[1] == "0"
|
||||
parameter_list.push(parts[1].to_i)
|
||||
else
|
||||
return parameter_list
|
||||
parameter_list.push(parts[1])
|
||||
end
|
||||
else
|
||||
return parameter_list
|
||||
end
|
||||
return parameter_list if max_param_number != 0 && j == i + max_param_number
|
||||
else
|
||||
return parameter_list
|
||||
end
|
||||
return parameter_list if max_param_number != 0 && j == i + max_param_number
|
||||
end
|
||||
end
|
||||
end
|
||||
return parameter_list
|
||||
end
|
||||
|
||||
@@ -366,7 +366,7 @@ class Particle_Engine::Fire < ParticleEffect_Event
|
||||
def initialize(event,viewport)
|
||||
super
|
||||
setParameters([0,0,1,20,40,0.5,-64,
|
||||
Graphics.height,-64,Graphics.width,0.5,0.10,-5,-13,30,0])
|
||||
Graphics.height,-64,Graphics.width,0.5,0.10,-5,-13,30,0])
|
||||
initParticles("particle",250)
|
||||
end
|
||||
end
|
||||
@@ -377,7 +377,7 @@ class Particle_Engine::Smoke < ParticleEffect_Event
|
||||
def initialize(event,viewport)
|
||||
super
|
||||
setParameters([0,0,0,80,20,0.5,-64,
|
||||
Graphics.height,-64,Graphics.width,0.5,0.10,-5,-15,5,80])
|
||||
Graphics.height,-64,Graphics.width,0.5,0.10,-5,-15,5,80])
|
||||
initParticles("smoke",250)
|
||||
end
|
||||
end
|
||||
@@ -388,7 +388,7 @@ class Particle_Engine::Teleport < ParticleEffect_Event
|
||||
def initialize(event,viewport)
|
||||
super
|
||||
setParameters([1,1,1,10,rand(360),1,-64,
|
||||
Graphics.height,-64,Graphics.width,0,3,-8,-15,20,0])
|
||||
Graphics.height,-64,Graphics.width,0,3,-8,-15,20,0])
|
||||
initParticles("wideportal",250)
|
||||
for i in 0...@maxparticless
|
||||
@particles[i].ox = 16
|
||||
@@ -403,7 +403,7 @@ class Particle_Engine::Spirit < ParticleEffect_Event
|
||||
def initialize(event,viewport)
|
||||
super
|
||||
setParameters([1,0,1,20,rand(360),0.5,-64,
|
||||
Graphics.height,-64,Graphics.width,0.5,0.10,-5,-13,30,0])
|
||||
Graphics.height,-64,Graphics.width,0.5,0.10,-5,-13,30,0])
|
||||
initParticles("particle",250)
|
||||
end
|
||||
end
|
||||
@@ -413,8 +413,8 @@ end
|
||||
class Particle_Engine::Explosion < ParticleEffect_Event
|
||||
def initialize(event,viewport)
|
||||
super
|
||||
setParameters([0,0,1,20,0,0.5,-64,
|
||||
Graphics.height,-64,Graphics.width,0.5,0.10,-5,-13,30,0])
|
||||
setParameters([0,0,1,20,0,0.5,-64,
|
||||
Graphics.height,-64,Graphics.width,0.5,0.10,-5,-13,30,0])
|
||||
initParticles("explosion",250)
|
||||
end
|
||||
end
|
||||
@@ -425,7 +425,7 @@ class Particle_Engine::Aura < ParticleEffect_Event
|
||||
def initialize(event,viewport)
|
||||
super
|
||||
setParameters([0,0,1,20,0,1,-64,
|
||||
Graphics.height,-64,Graphics.width,2,2,-5,-13,30,0])
|
||||
Graphics.height,-64,Graphics.width,2,2,-5,-13,30,0])
|
||||
initParticles("particle",250)
|
||||
end
|
||||
end
|
||||
@@ -436,7 +436,7 @@ class Particle_Engine::Soot < ParticleEffect_Event
|
||||
def initialize(event,viewport)
|
||||
super
|
||||
setParameters([0,0,0,20,0,0.5,-64,
|
||||
Graphics.height,-64,Graphics.width,0.5,0.10,-5,-15,5,80])
|
||||
Graphics.height,-64,Graphics.width,0.5,0.10,-5,-15,5,80])
|
||||
initParticles("smoke",100,0,2)
|
||||
end
|
||||
end
|
||||
@@ -447,7 +447,7 @@ class Particle_Engine::SootSmoke < ParticleEffect_Event
|
||||
def initialize(event,viewport)
|
||||
super
|
||||
setParameters([0,0,0,30,0,0.5,-64,
|
||||
Graphics.height,-64,Graphics.width,0.5,0.10,-5,-15,5,80])
|
||||
Graphics.height,-64,Graphics.width,0.5,0.10,-5,-15,5,80])
|
||||
initParticles("smoke",100,0)
|
||||
for i in 0...@maxparticless
|
||||
@particles[i].blend_type = rand(6) < 3 ? 1 : 2
|
||||
@@ -461,7 +461,7 @@ class Particle_Engine::Rocket < ParticleEffect_Event
|
||||
def initialize(event,viewport)
|
||||
super
|
||||
setParameters([0,0,0,60,0,0.5,-64,
|
||||
Graphics.height,-64,Graphics.width,0.5,0,-5,-15,5,80])
|
||||
Graphics.height,-64,Graphics.width,0.5,0,-5,-15,5,80])
|
||||
initParticles("smoke",100,-1)
|
||||
end
|
||||
end
|
||||
@@ -472,7 +472,7 @@ class Particle_Engine::FixedTeleport < ParticleEffect_Event
|
||||
def initialize(event,viewport)
|
||||
super
|
||||
setParameters([1,0,1,10,rand(360),1,
|
||||
-Graphics.height,Graphics.height,0,Graphics.width,0,3,-8,-15,20,0])
|
||||
-Graphics.height,Graphics.height,0,Graphics.width,0,3,-8,-15,20,0])
|
||||
initParticles("wideportal",250)
|
||||
for i in 0...@maxparticless
|
||||
@particles[i].ox = 16
|
||||
@@ -488,7 +488,7 @@ class Particle_Engine::StarTeleport < ParticleEffect_Event
|
||||
def initialize(event,viewport)
|
||||
super
|
||||
setParameters([0,0,1,10,0,1,
|
||||
-Graphics.height,Graphics.height,0,Graphics.width,0,3,-8,-15,10,0])
|
||||
-Graphics.height,Graphics.height,0,Graphics.width,0,3,-8,-15,10,0])
|
||||
initParticles("star",250)
|
||||
for i in 0...@maxparticless
|
||||
@particles[i].ox = 48
|
||||
@@ -503,7 +503,7 @@ class Particle_Engine::Smokescreen < ParticleEffect_Event
|
||||
def initialize(event,viewport)
|
||||
super
|
||||
setParameters([0,0,0,250,0,0.2,-64,
|
||||
Graphics.height,-64,Graphics.width,0.8,0.8,-5,-15,5,80])
|
||||
Graphics.height,-64,Graphics.width,0.8,0.8,-5,-15,5,80])
|
||||
initParticles(nil,100)
|
||||
for i in 0...@maxparticless
|
||||
rnd = rand(3)
|
||||
@@ -540,7 +540,7 @@ class Particle_Engine::Flare < ParticleEffect_Event
|
||||
def initialize(event,viewport)
|
||||
super
|
||||
setParameters([0,0,1,30,10,1,-64,
|
||||
Graphics.height,-64,Graphics.width,2,2,-5,-12,30,0])
|
||||
Graphics.height,-64,Graphics.width,2,2,-5,-12,30,0])
|
||||
initParticles("particle",255)
|
||||
end
|
||||
end
|
||||
@@ -551,7 +551,7 @@ class Particle_Engine::Splash < ParticleEffect_Event
|
||||
def initialize(event,viewport)
|
||||
super
|
||||
setParameters([0,0,1,30,255,1,-64,
|
||||
Graphics.height,-64,Graphics.width,4,2,-5,-12,30,0])
|
||||
Graphics.height,-64,Graphics.width,4,2,-5,-12,30,0])
|
||||
initParticles("smoke",50)
|
||||
end
|
||||
|
||||
|
||||
@@ -38,12 +38,11 @@ class Interpolator
|
||||
when OPACITY
|
||||
@tweensteps[item[0]] = [sprite.opacity,item[1]-sprite.opacity]
|
||||
when COLOR
|
||||
@tweensteps[item[0]] = [sprite.color.clone,Color.new(
|
||||
item[1].red-sprite.color.red,
|
||||
item[1].green-sprite.color.green,
|
||||
item[1].blue-sprite.color.blue,
|
||||
item[1].alpha-sprite.color.alpha
|
||||
)]
|
||||
@tweensteps[item[0]] = [sprite.color.clone,
|
||||
Color.new(item[1].red - sprite.color.red,
|
||||
item[1].green - sprite.color.green,
|
||||
item[1].blue - sprite.color.blue,
|
||||
item[1].alpha - sprite.color.alpha)]
|
||||
end
|
||||
end
|
||||
@tweening = true
|
||||
@@ -68,12 +67,10 @@ class Interpolator
|
||||
when OPACITY
|
||||
@sprite.opacity = item[0]+item[1]*t
|
||||
when COLOR
|
||||
@sprite.color = Color.new(
|
||||
item[0].red+item[1].red*t,
|
||||
item[0].green+item[1].green*t,
|
||||
item[0].blue+item[1].blue*t,
|
||||
item[0].alpha+item[1].alpha*t
|
||||
)
|
||||
@sprite.color = Color.new(item[0].red + item[1].red * t,
|
||||
item[0].green + item[1].green * t,
|
||||
item[0].blue + item[1].blue * t,
|
||||
item[0].alpha + item[1].alpha * t)
|
||||
end
|
||||
end
|
||||
@step += 1
|
||||
|
||||
Reference in New Issue
Block a user