Project1
标题: 关于天气系统 [打印本页]
作者: xusheng1994xq 时间: 2014-3-29 13:30
标题: 关于天气系统
本帖最后由 xusheng1994xq 于 2014-3-29 13:32 编辑
以前下了个RPG制作社的整合系统
发现里面有个加强版的天气系统
里面有什么落叶效果、樱花效果
我想把其中的7号或8号效果改一下,把叶子改成颗粒状的效果
让整体看起来像沙尘暴的感觉,但不知道该怎么改
请问具体应该怎么修改
#===========================
# ccoa's weather script
# with ideas by ScriptKitty and Mr.DJ
#===========================
# Weather Types:类型
# 1 - rain 雨
# 2 - storm 风
# 3 - snow 雪
# 4 - hail 冰雹
# 5 - rain with thunder and lightning 雷雨
# 6 - falling leaves (autumn) 秋天的落叶
# 7 - blowing leaves (autumn) 秋风扫落叶
# 8 - swirling leaves (autumn) 旋转的树叶
# 9 - falling leaves (green) 绿绿的落叶
# 10 - cherry blossom (sakura) petals 樱花飞舞
# 11 - rose petals 玫瑰花瓣雨
# 12 - feathers 羽毛
# 13 - blood rain 血雨
# 14 - sparkles 闪烁
# 15 - user defined 自己定义
#
# Weather Power: 强度 0-40 0为无天气
# An integer from 0-40. 0 = no weather, 40 = 400 sprites
#
# Usage:使用方法
# Create a call script with the following:
# 调用这个脚本
# $game_screen.weather(type, power, hue)
# 比如:$game_screen.weather(14, 35, 0)
#
# Usage of user-defined weather:
# Look at the following globals:
# 自定义天气看下面的
$WEATHER_UPDATE = false
# the $WEATHER_IMAGES array has changed, please update天气图象改变请改为true
$WEATHER_IMAGES = []
# the array of picture names to use用到的图片名字,默认无,所以上面不用刷新(他不是小方块!)
$WEATHER_X = 0
# the number of pixels the image should move horizontally (positive = right, negative = left)水平移动,正为右,负为左
$WEATHER_Y = 0
# the number of pizels the image should move vertically (positive = down, negative = up)垂直运动,正为下,负为上
$WEATHER_FADE = 0
# how much the image should fade each update (0 = no fade, 255 = fade instantly)淡出淡入,0为无,255为马上
$WEATHER_ANIMATED = false
# whether or not the image should cycle through all the images是否环绕?
module RPG
class Weather
def initialize(viewport = nil)
@type = 0
@max = 0
@ox = 0
@oy = 0
@count = 0
@current_pose = []
@info = []
@countarray = []
make_bitmaps
# **** ccoa ****
for i in 1..500
sprite = Sprite.new(viewport)
sprite.z = 1000
sprite.visible = false
sprite.opacity = 0
@sprites.push(sprite)
@current_pose.push(0)
@info.push(rand(50))
@countarray.push(rand(15))
end
end
def dispose
for sprite in @sprites
sprite.dispose
end
@rain_bitmap.dispose
@storm_bitmap.dispose
@snow_bitmap.dispose
@hail_bitmap.dispose
@petal_bitmap.dispose
@blood_rain_bitmap.dispose
for image in @autumn_leaf_bitmaps
image.dispose
end
for image in @green_leaf_bitmaps
image.dispose
end
for image in @rose_bitmaps
image.dispose
end
for image in @feather_bitmaps
image.dispose
end
for image in @sparkle_bitmaps
image.dispose
end
for image in @user_bitmaps
image.dispose
end
$WEATHER_UPDATE = true
end
def type=(type)
return if @type == type
@type = type
case @type
when 1 # rain
bitmap = @rain_bitmap
when 2 # storm
bitmap = @storm_bitmap
when 3 # snow
bitmap = @snow_bitmap
when 4 # hail
bitmap = @hail_bitmap
when 5 # rain w/ thunder and lightning
bitmap = @rain_bitmap
@thunder = true
when 6 # falling autumn leaves
bitmap = @autumn_leaf_bitmaps[0]
when 7 # blowing autumn leaves
bitmap = @autumn_leaf_bitmaps[0]
when 8 # swirling autumn leaves
bitmap = @autumn_leaf_bitmaps[0]
when 9 # falling green leaves
bitmap = @green_leaf_bitmaps[0]
when 10 # sakura petals
bitmap = @petal_bitmap
when 11 # rose petals
bitmap = @rose_bitmaps[0]
when 12 # feathers
bitmap = @feather_bitmaps[0]
when 13 # blood rain
bitmap = @blood_rain_bitmap
when 14 # sparkles
bitmap = @sparkle_bitmaps[0]
when 15 # user-defined
bitmap = @user_bitmaps[rand(@user_bitmaps.size)]
else
bitmap = nil
end
if @type != 5
@thunder = false
end
# **** ccoa ****
for i in 1..500
sprite = @sprites
if sprite != nil
sprite.visible = (i <= @max)
sprite.bitmap = bitmap
end
end
end
def ox=(ox)
return if @ox == ox;
@ox = ox
for sprite in @sprites
sprite.ox = @ox
end
end
def oy=(oy)
return if @oy == oy;
@oy = oy
for sprite in @sprites
sprite.oy = @oy
end
end
def max=(max)
return if @max == max;
# **** ccoa ****
@max = [[max, 0].max, 500].min
for i in 1..500
sprite = @sprites
if sprite != nil
sprite.visible = (i <= @max)
end
end
end
def update
return if @type == 0
for i in 1..@max
sprite = @sprites
if sprite == nil
break
end
if @type == 1 or @type == 5 or @type == 13 # rain
sprite.x -= 2
sprite.y += 16
sprite.opacity -= 8
if @thunder and (rand(8000 - @max) == 0)
$game_screen.start_flash(Color.new(255, 255, 255, 255), 5)
Audio.se_play("Audio/SE/061-Thunderclap01")
end
end
if @type == 2 # storm
sprite.x -= 8
sprite.y += 16
sprite.opacity -= 12
end
if @type == 3 # snow
sprite.x -= 2
sprite.y += 8
sprite.opacity -= 8
end
if @type == 4 # hail
sprite.x -= 1
sprite.y += 18
sprite.opacity -= 15
end
if @type == 6 # falling autumn leaves
@count = rand(20)
if @count == 0
sprite.bitmap = @autumn_leaf_bitmaps[@current_pose]
@current_pose = (@current_pose + 1) % @autumn_leaf_bitmaps.size
end
sprite.x -= 1
sprite.y += 1
end
if @type == 7 # blowing autumn leaves
@count = rand(20)
if @count == 0
sprite.bitmap = @autumn_leaf_bitmaps[@current_pose]
@current_pose = (@current_pose + 1) % @autumn_leaf_bitmaps.size
end
sprite.x -= 10
sprite.y += (rand(4) - 2)
end
if @type == 8 # swirling autumn leaves
@count = rand(20)
if @count == 0
sprite.bitmap = @autumn_leaf_bitmaps[@current_pose]
@current_pose = (@current_pose + 1) % @autumn_leaf_bitmaps.size
end
if @info != 0
if @info >= 1 and @info <= 10
sprite.x -= 3
sprite.y -= 1
elsif @info >= 11 and @info <= 16
sprite.x -= 1
sprite.y -= 2
elsif @info >= 17 and @info <= 20
sprite.y -= 3
elsif @info >= 21 and @info <= 30
sprite.y -= 2
sprite.x += 1
elsif @info >= 31 and @info <= 36
sprite.y -= 1
sprite.x += 3
elsif @info >= 37 and @info <= 40
sprite.x += 5
elsif @info >= 41 and @info <= 46
sprite.y += 1
sprite.x += 3
elsif @info >= 47 and @info <= 58
sprite.y += 2
sprite.x += 1
elsif @info >= 59 and @info <= 64
sprite.y += 3
elsif @info >= 65 and @info <= 70
sprite.x -= 1
sprite.y += 2
elsif @info >= 71 and @info <= 81
sprite.x -= 3
sprite.y += 1
elsif @info >= 82 and @info <= 87
sprite.x -= 5
end
@info = (@info + 1) % 88
else
if rand(200) == 0
@info = 1
end
sprite.x -= 5
sprite.y += 1
end
end
if @type == 9 # falling green leaves
if @countarray == 0
@current_pose = (@current_pose + 1) % @green_leaf_bitmaps.size
sprite.bitmap = @green_leaf_bitmaps[@current_pose]
@countarray = rand(15)
end
@countarray = (@countarray + 1) % 15
sprite.y += 1
end
if @type == 10 # sakura petals
if @info < 25
sprite.x -= 1
else
sprite.x += 1
end
@info = (@info + 1) % 50
sprite.y += 1
end
if @type == 11 # rose petals
@count = rand(20)
if @count == 0
sprite.bitmap = @rose_bitmaps[@current_pose]
@current_pose = (@current_pose + 1) % @rose_bitmaps.size
end
if @info % 2 == 0
if @info < 10
sprite.x -= 1
else
sprite.x += 1
end
end
sprite.y += 1
end
if @type == 12 # feathers
if @countarray == 0
@current_pose = (@current_pose + 1) % @feather_bitmaps.size
sprite.bitmap = @feather_bitmaps[@current_pose]
end
@countarray = (@countarray + 1) % 15
if rand(100) == 0
sprite.x -= 1
end
if rand(100) == 0
sprite.y -= 1
end
if @info < 50
if rand(2) == 0
sprite.x -= 1
else
sprite.y -= 1
end
else
if rand(2) == 0
sprite.x += 1
else
sprite.y += 1
end
end
@info = (@info + 1) % 100
end
if @type == 14 # sparkles
if @countarray == 0
@current_pose = (@current_pose + 1) % @sparkle_bitmaps.size
sprite.bitmap = @sparkle_bitmaps[@current_pose]
end
@countarray = (@countarray + 1) % 15
sprite.y += 1
sprite.opacity -= 1
end
if @type == 15 # user-defined
if $WEATHER_UPDATE
update_user_defined
$WEATHER_UPDATE = false
end
if $WEATHER_ANIMATED and @countarray == 0
@current_pose = (@current_pose + 1) % @user_bitmaps.size
sprite.bitmap = @user_bitmaps[@current_pose]
end
@countarray = (@countarray + 1) % 15
sprite.x += $WEATHER_X
sprite.y += $WEATHER_Y
sprite.opacity -= $WEATHER_FADE
end
x = sprite.x - @ox
y = sprite.y - @oy
if sprite.opacity < 64 or x < -50 or x > 750 or y < -300 or y > 500
sprite.x = rand(800) - 50 + @ox
sprite.y = rand(800) - 200 + @oy
sprite.opacity = 255
end
end
end
def make_bitmaps
color1 = Color.new(255, 255, 255, 255)
color2 = Color.new(255, 255, 255, 128)
@rain_bitmap = Bitmap.new(7, 56)
for i in 0..6
@rain_bitmap.fill_rect(6-i, i*8, 1, 8, color1)
end
@storm_bitmap = Bitmap.new(34, 64)
for i in 0..31
@storm_bitmap.fill_rect(33-i, i*2, 1, 2, color2)
@storm_bitmap.fill_rect(32-i, i*2, 1, 2, color1)
@storm_bitmap.fill_rect(31-i, i*2, 1, 2, color2)
end
@snow_bitmap = Bitmap.new(6, 6)
@snow_bitmap.fill_rect(0, 1, 6, 4, color2)
@snow_bitmap.fill_rect(1, 0, 4, 6, color2)
@snow_bitmap.fill_rect(1, 2, 4, 2, color1)
@snow_bitmap.fill_rect(2, 1, 2, 4, color1)
@sprites = []
blueGrey = Color.new(215, 227, 227, 150)
grey = Color.new(214, 217, 217, 150)
lightGrey = Color.new(233, 233, 233, 250)
lightBlue = Color.new(222, 239, 243, 250)
@hail_bitmap = Bitmap.new(4, 4)
@hail_bitmap.fill_rect(1, 0, 2, 1, blueGrey)
@hail_bitmap.fill_rect(0, 1, 1, 2, blueGrey)
@hail_bitmap.fill_rect(3, 1, 1, 2, grey)
@hail_bitmap.fill_rect(1, 3, 2, 1, grey)
@hail_bitmap.fill_rect(1, 1, 2, 2, lightGrey)
@hail_bitmap.set_pixel(1, 1, lightBlue)
color3 = Color.new(255, 167, 192, 255) # light pink
color4 = Color.new(213, 106, 136, 255) # dark pink
@petal_bitmap = Bitmap.new(4, 4) #This creates a new bitmap that is 4 x 4 pixels
@petal_bitmap.fill_rect(0, 3, 1, 1, color3) # this makes a 1x1 pixel "rectangle" at the 0, 3 pixel of the image (upper left corner is 0, 0)
@petal_bitmap.fill_rect(1, 2, 1, 1, color3)
@petal_bitmap.fill_rect(2, 1, 1, 1, color3)
@petal_bitmap.fill_rect(3, 0, 1, 1, color3)
@petal_bitmap.fill_rect(1, 3, 1, 1, color4)
@petal_bitmap.fill_rect(2, 2, 1, 1, color4)
@petal_bitmap.fill_rect(3, 1, 1, 1, color4)
brightOrange = Color.new(200, 160, 30, 255)
orangeBrown = Color.new(170, 180, 20, 255)
burntRed = Color.new(220, 160, 15, 255)
paleOrange = Color.new(160, 150, 10, 255)
darkBrown = Color.new(72, 40, 0, 255)
@autumn_leaf_bitmaps = []
@autumn_leaf_bitmaps.push(Bitmap.new(8, 8))
# draw the first of the leaf1 bitmaps
@autumn_leaf_bitmaps[0].set_pixel(5, 1, orangeBrown)
@autumn_leaf_bitmaps[0].set_pixel(6, 1, brightOrange)
@autumn_leaf_bitmaps[0].set_pixel(7, 1, paleOrange)
@autumn_leaf_bitmaps[0].set_pixel(3, 2, orangeBrown)
@autumn_leaf_bitmaps[0].fill_rect(4, 4, 4, 4, brightOrange)
@autumn_leaf_bitmaps[0].set_pixel(6, 2, paleOrange)
@autumn_leaf_bitmaps[0].set_pixel(2, 3, orangeBrown)
@autumn_leaf_bitmaps[0].set_pixel(3, 3, brightOrange)
@autumn_leaf_bitmaps[0].fill_rect(4, 3, 2, 1, paleOrange)
@autumn_leaf_bitmaps[0].set_pixel(1, 4, orangeBrown)
@autumn_leaf_bitmaps[0].set_pixel(2, 4, brightOrange)
@autumn_leaf_bitmaps[0].set_pixel(3, 4, paleOrange)
@autumn_leaf_bitmaps[0].set_pixel(1, 5, brightOrange)
@autumn_leaf_bitmaps[0].set_pixel(2, 5, paleOrange)
@autumn_leaf_bitmaps[0].set_pixel(0, 6, orangeBrown)
@autumn_leaf_bitmaps[0].set_pixel(1, 6, paleOrange)
@autumn_leaf_bitmaps[0].set_pixel(0, 7, paleOrange)
# draw the 2nd of the leaf1 bitmaps
@autumn_leaf_bitmaps.push(Bitmap.new(8, 8))
@autumn_leaf_bitmaps[1].set_pixel(3, 0, brightOrange)
@autumn_leaf_bitmaps[1].set_pixel(7, 0, brightOrange)
@autumn_leaf_bitmaps[1].set_pixel(3, 1, orangeBrown)
@autumn_leaf_bitmaps[1].set_pixel(4, 1, burntRed)
@autumn_leaf_bitmaps[1].set_pixel(6, 1, brightOrange)
@autumn_leaf_bitmaps[1].set_pixel(0, 2, paleOrange)
@autumn_leaf_bitmaps[1].set_pixel(1, 2, brightOrange)
@autumn_leaf_bitmaps[1].set_pixel(2, 2, orangeBrown)
@autumn_leaf_bitmaps[1].set_pixel(3, 2, burntRed)
@autumn_leaf_bitmaps[1].set_pixel(4, 2, orangeBrown)
@autumn_leaf_bitmaps[1].set_pixel(5, 2, brightOrange)
@autumn_leaf_bitmaps[1].fill_rect(1, 3, 3, 1, orangeBrown)
@autumn_leaf_bitmaps[1].fill_rect(4, 3, 2, 1, brightOrange)
@autumn_leaf_bitmaps[1].set_pixel(6, 3, orangeBrown)
@autumn_leaf_bitmaps[1].set_pixel(2, 4, burntRed)
@autumn_leaf_bitmaps[1].fill_rect(3, 4, 3, 1, brightOrange)
@autumn_leaf_bitmaps[1].set_pixel(6, 4, burntRed)
@autumn_leaf_bitmaps[1].set_pixel(7, 4, darkBrown)
@autumn_leaf_bitmaps[1].set_pixel(1, 5, orangeBrown)
@autumn_leaf_bitmaps[1].fill_rect(2, 5, 2, 1, brightOrange)
@autumn_leaf_bitmaps[1].set_pixel(4, 5, orangeBrown)
@autumn_leaf_bitmaps[1].set_pixel(5, 5, burntRed)
@autumn_leaf_bitmaps[1].fill_rect(1, 6, 2, 1, brightOrange)
@autumn_leaf_bitmaps[1].fill_rect(4, 6, 2, 1, burntRed)
@autumn_leaf_bitmaps[1].set_pixel(0, 7, brightOrange)
@autumn_leaf_bitmaps[1].set_pixel(5, 7, darkBrown)
# draw the 3rd of the leaf1 bitmaps
@autumn_leaf_bitmaps.push(Bitmap.new(8, 8))
@autumn_leaf_bitmaps[2].set_pixel(7, 1, paleOrange)
@autumn_leaf_bitmaps[2].set_pixel(6, 2, paleOrange)
@autumn_leaf_bitmaps[2].set_pixel(7, 2, orangeBrown)
@autumn_leaf_bitmaps[2].set_pixel(5, 3, paleOrange)
@autumn_leaf_bitmaps[2].set_pixel(6, 3, brightOrange)
@autumn_leaf_bitmaps[2].set_pixel(4, 4, paleOrange)
@autumn_leaf_bitmaps[2].set_pixel(5, 4, brightOrange)
@autumn_leaf_bitmaps[2].set_pixel(6, 4, orangeBrown)
@autumn_leaf_bitmaps[2].fill_rect(2, 5, 2, 1, paleOrange)
@autumn_leaf_bitmaps[2].set_pixel(4, 5, brightOrange)
@autumn_leaf_bitmaps[2].set_pixel(5, 5, orangeBrown)
@autumn_leaf_bitmaps[2].set_pixel(1, 6, paleOrange)
@autumn_leaf_bitmaps[2].fill_rect(2, 6, 2, 1, brightOrange)
@autumn_leaf_bitmaps[2].set_pixel(4, 6, orangeBrown)
@autumn_leaf_bitmaps[2].set_pixel(0, 7, paleOrange)
@autumn_leaf_bitmaps[2].set_pixel(1, 7, brightOrange)
@autumn_leaf_bitmaps[2].set_pixel(2, 7, orangeBrown)
# draw the 4th of the leaf1 bitmaps
@autumn_leaf_bitmaps.push(Bitmap.new(8, 8))
@autumn_leaf_bitmaps[3].set_pixel(3, 0, brightOrange)
@autumn_leaf_bitmaps[3].set_pixel(7, 0, brightOrange)
@autumn_leaf_bitmaps[3].set_pixel(3, 1, orangeBrown)
@autumn_leaf_bitmaps[3].set_pixel(4, 1, burntRed)
@autumn_leaf_bitmaps[3].set_pixel(6, 1, brightOrange)
@autumn_leaf_bitmaps[3].set_pixel(0, 2, paleOrange)
@autumn_leaf_bitmaps[3].set_pixel(1, 2, brightOrange)
@autumn_leaf_bitmaps[3].set_pixel(2, 2, orangeBrown)
@autumn_leaf_bitmaps[3].set_pixel(3, 2, burntRed)
@autumn_leaf_bitmaps[3].set_pixel(4, 2, orangeBrown)
@autumn_leaf_bitmaps[3].set_pixel(5, 2, brightOrange)
@autumn_leaf_bitmaps[3].fill_rect(1, 3, 3, 1, orangeBrown)
@autumn_leaf_bitmaps[3].fill_rect(4, 3, 2, 1, brightOrange)
@autumn_leaf_bitmaps[3].set_pixel(6, 3, orangeBrown)
@autumn_leaf_bitmaps[3].set_pixel(2, 4, burntRed)
@autumn_leaf_bitmaps[3].fill_rect(3, 4, 3, 1, brightOrange)
@autumn_leaf_bitmaps[3].set_pixel(6, 4, burntRed)
@autumn_leaf_bitmaps[3].set_pixel(7, 4, darkBrown)
@autumn_leaf_bitmaps[3].set_pixel(1, 5, orangeBrown)
@autumn_leaf_bitmaps[3].fill_rect(2, 5, 2, 1, brightOrange)
@autumn_leaf_bitmaps[3].set_pixel(4, 5, orangeBrown)
@autumn_leaf_bitmaps[3].set_pixel(5, 5, burntRed)
@autumn_leaf_bitmaps[3].fill_rect(1, 6, 2, 1, brightOrange)
@autumn_leaf_bitmaps[3].fill_rect(4, 6, 2, 1, burntRed)
@autumn_leaf_bitmaps[3].set_pixel(0, 7, brightOrange)
@autumn_leaf_bitmaps[3].set_pixel(5, 7, darkBrown)
@green_leaf_bitmaps = []
darkGreen = Color.new(62, 76, 31, 255)
midGreen = Color.new(76, 91, 43, 255)
khaki = Color.new(105, 114, 66, 255)
lightGreen = Color.new(128, 136, 88, 255)
mint = Color.new(146, 154, 106, 255)
# 1st leaf bitmap
@green_leaf_bitmaps[0] = Bitmap.new(8, 8)
@green_leaf_bitmaps[0].set_pixel(1, 0, darkGreen)
@green_leaf_bitmaps[0].set_pixel(1, 1, midGreen)
@green_leaf_bitmaps[0].set_pixel(2, 1, darkGreen)
@green_leaf_bitmaps[0].set_pixel(2, 2, khaki)
@green_leaf_bitmaps[0].set_pixel(3, 2, darkGreen)
@green_leaf_bitmaps[0].set_pixel(4, 2, khaki)
@green_leaf_bitmaps[0].fill_rect(2, 3, 3, 1, midGreen)
@green_leaf_bitmaps[0].set_pixel(5, 3, khaki)
@green_leaf_bitmaps[0].fill_rect(2, 4, 2, 1, midGreen)
@green_leaf_bitmaps[0].set_pixel(4, 4, darkGreen)
@green_leaf_bitmaps[0].set_pixel(5, 4, lightGreen)
@green_leaf_bitmaps[0].set_pixel(6, 4, khaki)
@green_leaf_bitmaps[0].set_pixel(3, 5, midGreen)
@green_leaf_bitmaps[0].set_pixel(4, 5, darkGreen)
@green_leaf_bitmaps[0].set_pixel(5, 5, khaki)
@green_leaf_bitmaps[0].set_pixel(6, 5, lightGreen)
@green_leaf_bitmaps[0].set_pixel(4, 6, midGreen)
@green_leaf_bitmaps[0].set_pixel(5, 6, darkGreen)
@green_leaf_bitmaps[0].set_pixel(6, 6, lightGreen)
@green_leaf_bitmaps[0].set_pixel(6, 7, khaki)
# 2nd leaf bitmap
@green_leaf_bitmaps[1] = Bitmap.new(8, 8)
@green_leaf_bitmaps[1].fill_rect(1, 1, 1, 2, midGreen)
@green_leaf_bitmaps[1].fill_rect(2, 2, 2, 1, khaki)
@green_leaf_bitmaps[1].set_pixel(4, 2, lightGreen)
@green_leaf_bitmaps[1].fill_rect(2, 3, 2, 1, darkGreen)
@green_leaf_bitmaps[1].fill_rect(4, 3, 2, 1, lightGreen)
@green_leaf_bitmaps[1].set_pixel(2, 4, midGreen)
@green_leaf_bitmaps[1].set_pixel(3, 4, darkGreen)
@green_leaf_bitmaps[1].set_pixel(4, 4, khaki)
@green_leaf_bitmaps[1].fill_rect(5, 4, 2, 1, lightGreen)
@green_leaf_bitmaps[1].set_pixel(3, 5, midGreen)
@green_leaf_bitmaps[1].set_pixel(4, 5, darkGreen)
@green_leaf_bitmaps[1].set_pixel(5, 5, khaki)
@green_leaf_bitmaps[1].set_pixel(6, 5, lightGreen)
@green_leaf_bitmaps[1].set_pixel(5, 6, darkGreen)
@green_leaf_bitmaps[1].fill_rect(6, 6, 2, 1, khaki)
# 3rd leaf bitmap
@green_leaf_bitmaps[2] = Bitmap.new(8, 8)
@green_leaf_bitmaps[2].set_pixel(1, 1, darkGreen)
@green_leaf_bitmaps[2].fill_rect(1, 2, 2, 1, midGreen)
@green_leaf_bitmaps[2].set_pixel(2, 3, midGreen)
@green_leaf_bitmaps[2].set_pixel(3, 3, darkGreen)
@green_leaf_bitmaps[2].set_pixel(4, 3, midGreen)
@green_leaf_bitmaps[2].fill_rect(2, 4, 2, 1, midGreen)
@green_leaf_bitmaps[2].set_pixel(4, 4, darkGreen)
@green_leaf_bitmaps[2].set_pixel(5, 4, lightGreen)
@green_leaf_bitmaps[2].set_pixel(3, 5, midGreen)
@green_leaf_bitmaps[2].set_pixel(4, 5, darkGreen)
@green_leaf_bitmaps[2].fill_rect(5, 5, 2, 1, khaki)
@green_leaf_bitmaps[2].fill_rect(4, 6, 2, 1, midGreen)
@green_leaf_bitmaps[2].set_pixel(6, 6, lightGreen)
@green_leaf_bitmaps[2].set_pixel(6, 7, khaki)
# 4th leaf bitmap
@green_leaf_bitmaps[3] = Bitmap.new(8, 8)
@green_leaf_bitmaps[3].fill_rect(0, 3, 1, 2, darkGreen)
@green_leaf_bitmaps[3].set_pixel(1, 4, midGreen)
@green_leaf_bitmaps[3].set_pixel(2, 4, khaki)
@green_leaf_bitmaps[3].set_pixel(3, 4, lightGreen)
@green_leaf_bitmaps[3].set_pixel(4, 4, darkGreen)
@green_leaf_bitmaps[3].set_pixel(7, 4, midGreen)
@green_leaf_bitmaps[3].set_pixel(1, 5, darkGreen)
@green_leaf_bitmaps[3].set_pixel(2, 5, midGreen)
@green_leaf_bitmaps[3].set_pixel(3, 5, lightGreen)
@green_leaf_bitmaps[3].set_pixel(4, 5, mint)
@green_leaf_bitmaps[3].set_pixel(5, 5, lightGreen)
@green_leaf_bitmaps[3].set_pixel(6, 5, khaki)
@green_leaf_bitmaps[3].set_pixel(7, 5, midGreen)
@green_leaf_bitmaps[3].fill_rect(2, 6, 2, 1, midGreen)
@green_leaf_bitmaps[3].set_pixel(4, 6, lightGreen)
@green_leaf_bitmaps[3].set_pixel(5, 6, khaki)
@green_leaf_bitmaps[3].set_pixel(6, 6, midGreen)
# 5th leaf bitmap
@green_leaf_bitmaps[4] = Bitmap.new(8, 8)
@green_leaf_bitmaps[4].set_pixel(6, 2, midGreen)
@green_leaf_bitmaps[4].set_pixel(7, 2, darkGreen)
@green_leaf_bitmaps[4].fill_rect(4, 3, 2, 1, midGreen)
@green_leaf_bitmaps[4].set_pixel(6, 3, khaki)
@green_leaf_bitmaps[4].set_pixel(2, 4, darkGreen)
@green_leaf_bitmaps[4].fill_rect(3, 4, 2, 1, khaki)
@green_leaf_bitmaps[4].set_pixel(5, 4, lightGreen)
@green_leaf_bitmaps[4].set_pixel(6, 4, khaki)
@green_leaf_bitmaps[4].set_pixel(1, 5, midGreen)
@green_leaf_bitmaps[4].set_pixel(2, 5, khaki)
@green_leaf_bitmaps[4].set_pixel(3, 5, lightGreen)
@green_leaf_bitmaps[4].set_pixel(4, 5, mint)
@green_leaf_bitmaps[4].set_pixel(5, 5, midGreen)
@green_leaf_bitmaps[4].set_pixel(2, 6, darkGreen)
@green_leaf_bitmaps[4].fill_rect(3, 6, 2, 1, midGreen)
# 6th leaf bitmap
@green_leaf_bitmaps[5] = Bitmap.new(8, 8)
@green_leaf_bitmaps[5].fill_rect(6, 2, 2, 1, midGreen)
@green_leaf_bitmaps[5].fill_rect(4, 3, 2, 1, midGreen)
@green_leaf_bitmaps[5].set_pixel(6, 3, khaki)
@green_leaf_bitmaps[5].set_pixel(3, 4, midGreen)
@green_leaf_bitmaps[5].set_pixel(4, 4, khaki)
@green_leaf_bitmaps[5].set_pixel(5, 4, lightGreen)
@green_leaf_bitmaps[5].set_pixel(6, 4, mint)
@green_leaf_bitmaps[5].set_pixel(1, 5, midGreen)
@green_leaf_bitmaps[5].set_pixel(2, 5, khaki)
@green_leaf_bitmaps[5].fill_rect(3, 5, 2, 1, mint)
@green_leaf_bitmaps[5].set_pixel(5, 5, lightGreen)
@green_leaf_bitmaps[5].set_pixel(2, 6, midGreen)
@green_leaf_bitmaps[5].set_pixel(3, 6, khaki)
@green_leaf_bitmaps[5].set_pixel(4, 6, lightGreen)
# 7th leaf bitmap
@green_leaf_bitmaps[6] = Bitmap.new(8, 8)
@green_leaf_bitmaps[6].fill_rect(6, 1, 1, 2, midGreen)
@green_leaf_bitmaps[6].fill_rect(4, 2, 2, 1, midGreen)
@green_leaf_bitmaps[6].fill_rect(6, 2, 1, 2, darkGreen)
@green_leaf_bitmaps[6].fill_rect(3, 3, 2, 1, midGreen)
@green_leaf_bitmaps[6].set_pixel(5, 3, khaki)
@green_leaf_bitmaps[6].set_pixel(2, 4, midGreen)
@green_leaf_bitmaps[6].set_pixel(3, 4, khaki)
@green_leaf_bitmaps[6].set_pixel(4, 4, lightGreen)
@green_leaf_bitmaps[6].set_pixel(5, 4, midGreen)
@green_leaf_bitmaps[6].set_pixel(1, 5, midGreen)
@green_leaf_bitmaps[6].set_pixel(2, 5, khaki)
@green_leaf_bitmaps[6].fill_rect(3, 5, 2, 1, midGreen)
@green_leaf_bitmaps[6].set_pixel(1, 6, darkGreen)
@green_leaf_bitmaps[6].set_pixel(2, 6, midGreen)
# 8th leaf bitmap
@green_leaf_bitmaps[7] = Bitmap.new(8, 8)
@green_leaf_bitmaps[7].set_pixel(6, 1, midGreen)
@green_leaf_bitmaps[7].fill_rect(4, 2, 3, 2, midGreen)
@green_leaf_bitmaps[7].set_pixel(3, 3, darkGreen)
@green_leaf_bitmaps[7].set_pixel(2, 4, darkGreen)
@green_leaf_bitmaps[7].set_pixel(3, 4, midGreen)
@green_leaf_bitmaps[7].fill_rect(4, 4, 2, 1, khaki)
@green_leaf_bitmaps[7].set_pixel(1, 5, darkGreen)
@green_leaf_bitmaps[7].set_pixel(2, 5, midGreen)
@green_leaf_bitmaps[7].fill_rect(3, 5, 2, 1, lightGreen)
@green_leaf_bitmaps[7].set_pixel(2, 6, midGreen)
@green_leaf_bitmaps[7].set_pixel(3, 6, lightGreen)
# 9th leaf bitmap
@green_leaf_bitmaps[8] = Bitmap.new(8, 8)
@green_leaf_bitmaps[8].fill_rect(6, 1, 1, 2, midGreen)
@green_leaf_bitmaps[8].fill_rect(4, 2, 2, 1, midGreen)
@green_leaf_bitmaps[8].fill_rect(6, 2, 1, 2, darkGreen)
@green_leaf_bitmaps[8].fill_rect(3, 3, 2, 1, midGreen)
@green_leaf_bitmaps[8].set_pixel(5, 3, khaki)
@green_leaf_bitmaps[8].set_pixel(2, 4, midGreen)
@green_leaf_bitmaps[8].set_pixel(3, 4, khaki)
@green_leaf_bitmaps[8].set_pixel(4, 4, lightGreen)
@green_leaf_bitmaps[8].set_pixel(5, 4, midGreen)
@green_leaf_bitmaps[8].set_pixel(1, 5, midGreen)
@green_leaf_bitmaps[8].set_pixel(2, 5, khaki)
@green_leaf_bitmaps[8].fill_rect(3, 5, 2, 1, midGreen)
@green_leaf_bitmaps[8].set_pixel(1, 6, darkGreen)
@green_leaf_bitmaps[8].set_pixel(2, 6, midGreen)
# 10th leaf bitmap
@green_leaf_bitmaps[9] = Bitmap.new(8, 8)
@green_leaf_bitmaps[9].fill_rect(6, 2, 2, 1, midGreen)
@green_leaf_bitmaps[9].fill_rect(4, 3, 2, 1, midGreen)
@green_leaf_bitmaps[9].set_pixel(6, 3, khaki)
@green_leaf_bitmaps[9].set_pixel(3, 4, midGreen)
@green_leaf_bitmaps[9].set_pixel(4, 4, khaki)
@green_leaf_bitmaps[9].set_pixel(5, 4, lightGreen)
@green_leaf_bitmaps[9].set_pixel(6, 4, mint)
@green_leaf_bitmaps[9].set_pixel(1, 5, midGreen)
@green_leaf_bitmaps[9].set_pixel(2, 5, khaki)
@green_leaf_bitmaps[9].fill_rect(3, 5, 2, 1, mint)
@green_leaf_bitmaps[9].set_pixel(5, 5, lightGreen)
@green_leaf_bitmaps[9].set_pixel(2, 6, midGreen)
@green_leaf_bitmaps[9].set_pixel(3, 6, khaki)
@green_leaf_bitmaps[9].set_pixel(4, 6, lightGreen)
# 11th leaf bitmap
@green_leaf_bitmaps[10] = Bitmap.new(8, 8)
@green_leaf_bitmaps[10].set_pixel(6, 2, midGreen)
@green_leaf_bitmaps[10].set_pixel(7, 2, darkGreen)
@green_leaf_bitmaps[10].fill_rect(4, 3, 2, 1, midGreen)
@green_leaf_bitmaps[10].set_pixel(6, 3, khaki)
@green_leaf_bitmaps[10].set_pixel(2, 4, darkGreen)
@green_leaf_bitmaps[10].fill_rect(3, 4, 2, 1, khaki)
@green_leaf_bitmaps[10].set_pixel(5, 4, lightGreen)
@green_leaf_bitmaps[10].set_pixel(6, 4, khaki)
@green_leaf_bitmaps[10].set_pixel(1, 5, midGreen)
@green_leaf_bitmaps[10].set_pixel(2, 5, khaki)
@green_leaf_bitmaps[10].set_pixel(3, 5, lightGreen)
@green_leaf_bitmaps[10].set_pixel(4, 5, mint)
@green_leaf_bitmaps[10].set_pixel(5, 5, midGreen)
@green_leaf_bitmaps[10].set_pixel(2, 6, darkGreen)
@green_leaf_bitmaps[10].fill_rect(3, 6, 2, 1, midGreen)
# 12th leaf bitmap
@green_leaf_bitmaps[11] = Bitmap.new(8, 8)
@green_leaf_bitmaps[11].fill_rect(0, 3, 1, 2, darkGreen)
@green_leaf_bitmaps[11].set_pixel(1, 4, midGreen)
@green_leaf_bitmaps[11].set_pixel(2, 4, khaki)
@green_leaf_bitmaps[11].set_pixel(3, 4, lightGreen)
@green_leaf_bitmaps[11].set_pixel(4, 4, darkGreen)
@green_leaf_bitmaps[11].set_pixel(7, 4, midGreen)
@green_leaf_bitmaps[11].set_pixel(1, 5, darkGreen)
@green_leaf_bitmaps[11].set_pixel(2, 5, midGreen)
@green_leaf_bitmaps[11].set_pixel(3, 5, lightGreen)
@green_leaf_bitmaps[11].set_pixel(4, 5, mint)
@green_leaf_bitmaps[11].set_pixel(5, 5, lightGreen)
@green_leaf_bitmaps[11].set_pixel(6, 5, khaki)
@green_leaf_bitmaps[11].set_pixel(7, 5, midGreen)
@green_leaf_bitmaps[11].fill_rect(2, 6, 2, 1, midGreen)
@green_leaf_bitmaps[11].set_pixel(4, 6, lightGreen)
@green_leaf_bitmaps[11].set_pixel(5, 6, khaki)
@green_leaf_bitmaps[11].set_pixel(6, 6, midGreen)
# 13th leaf bitmap
@green_leaf_bitmaps[12] = Bitmap.new(8, 8)
@green_leaf_bitmaps[12].set_pixel(1, 1, darkGreen)
@green_leaf_bitmaps[12].fill_rect(1, 2, 2, 1, midGreen)
@green_leaf_bitmaps[12].set_pixel(2, 3, midGreen)
@green_leaf_bitmaps[12].set_pixel(3, 3, darkGreen)
@green_leaf_bitmaps[12].set_pixel(4, 3, midGreen)
@green_leaf_bitmaps[12].fill_rect(2, 4, 2, 1, midGreen)
@green_leaf_bitmaps[12].set_pixel(4, 4, darkGreen)
@green_leaf_bitmaps[12].set_pixel(5, 4, lightGreen)
@green_leaf_bitmaps[12].set_pixel(3, 5, midGreen)
@green_leaf_bitmaps[12].set_pixel(4, 5, darkGreen)
@green_leaf_bitmaps[12].fill_rect(5, 5, 2, 1, khaki)
@green_leaf_bitmaps[12].fill_rect(4, 6, 2, 1, midGreen)
@green_leaf_bitmaps[12].set_pixel(6, 6, lightGreen)
@green_leaf_bitmaps[12].set_pixel(6, 7, khaki)
@rose_bitmaps = []
brightRed = Color.new(255, 0, 0, 255)
midRed = Color.new(179, 17, 17, 255)
darkRed = Color.new(141, 9, 9, 255)
# 1st rose petal bitmap
@rose_bitmaps[0] = Bitmap.new(3, 3)
@rose_bitmaps[0].fill_rect(1, 0, 2, 1, brightRed)
@rose_bitmaps[0].fill_rect(0, 1, 1, 2, brightRed)
@rose_bitmaps[0].fill_rect(1, 1, 2, 2, midRed)
@rose_bitmaps[0].set_pixel(2, 2, darkRed)
# 2nd rose petal bitmap
@rose_bitmaps[1] = Bitmap.new(3, 3)
@rose_bitmaps[1].set_pixel(0, 1, midRed)
@rose_bitmaps[1].set_pixel(1, 1, brightRed)
@rose_bitmaps[1].fill_rect(1, 2, 1, 2, midRed)
@feather_bitmaps = []
white = Color.new(255, 255, 255, 255)
# 1st feather bitmap
@feather_bitmaps[0] = Bitmap.new(3, 3)
@feather_bitmaps[0].set_pixel(0, 2, white)
@feather_bitmaps[0].set_pixel(1, 2, grey)
@feather_bitmaps[0].set_pixel(2, 1, grey)
# 2nd feather bitmap
@feather_bitmaps[0] = Bitmap.new(3, 3)
@feather_bitmaps[0].set_pixel(0, 0, white)
@feather_bitmaps[0].set_pixel(0, 1, grey)
@feather_bitmaps[0].set_pixel(1, 2, grey)
# 3rd feather bitmap
@feather_bitmaps[0] = Bitmap.new(3, 3)
@feather_bitmaps[0].set_pixel(2, 0, white)
@feather_bitmaps[0].set_pixel(1, 0, grey)
@feather_bitmaps[0].set_pixel(0, 1, grey)
# 4th feather bitmap
@feather_bitmaps[0] = Bitmap.new(3, 3)
@feather_bitmaps[0].set_pixel(2, 2, white)
@feather_bitmaps[0].set_pixel(2, 1, grey)
@feather_bitmaps[0].set_pixel(1, 0, grey)
@blood_rain_bitmap = Bitmap.new(7, 56)
for i in 0..6
@blood_rain_bitmap.fill_rect(6-i, i*8, 1, 8, darkRed)
end
@sparkle_bitmaps = []
lightBlue = Color.new(181, 244, 255, 255)
midBlue = Color.new(126, 197, 235, 255)
darkBlue = Color.new(77, 136, 225, 255)
# 1st sparkle bitmap
@sparkle_bitmaps[0] = Bitmap.new(7, 7)
@sparkle_bitmaps[0].set_pixel(3, 3, darkBlue)
# 2nd sparkle bitmap
@sparkle_bitmaps[1] = Bitmap.new(7, 7)
@sparkle_bitmaps[1].fill_rect(3, 2, 1, 3, darkBlue)
@sparkle_bitmaps[1].fill_rect(2, 3, 3, 1, darkBlue)
@sparkle_bitmaps[1].set_pixel(3, 3, midBlue)
# 3rd sparkle bitmap
@sparkle_bitmaps[2] = Bitmap.new(7, 7)
@sparkle_bitmaps[2].set_pixel(1, 1, darkBlue)
@sparkle_bitmaps[2].set_pixel(5, 1, darkBlue)
@sparkle_bitmaps[2].set_pixel(2, 2, midBlue)
@sparkle_bitmaps[2].set_pixel(4, 2, midBlue)
@sparkle_bitmaps[2].set_pixel(3, 3, lightBlue)
@sparkle_bitmaps[2].set_pixel(2, 4, midBlue)
@sparkle_bitmaps[2].set_pixel(4, 4, midBlue)
@sparkle_bitmaps[2].set_pixel(1, 5, darkBlue)
@sparkle_bitmaps[2].set_pixel(5, 5, darkBlue)
# 4th sparkle bitmap
@sparkle_bitmaps[3] = Bitmap.new(7, 7)
@sparkle_bitmaps[3].fill_rect(3, 1, 1, 5, darkBlue)
@sparkle_bitmaps[3].fill_rect(1, 3, 5, 1, darkBlue)
@sparkle_bitmaps[3].fill_rect(3, 2, 1, 3, midBlue)
@sparkle_bitmaps[3].fill_rect(2, 3, 3, 1, midBlue)
@sparkle_bitmaps[3].set_pixel(3, 3, lightBlue)
# 5th sparkle bitmap
@sparkle_bitmaps[4] = Bitmap.new(7, 7)
@sparkle_bitmaps[4].fill_rect(2, 2, 3, 3, midBlue)
@sparkle_bitmaps[4].fill_rect(3, 2, 1, 3, darkBlue)
@sparkle_bitmaps[4].fill_rect(2, 3, 3, 1, darkBlue)
@sparkle_bitmaps[4].set_pixel(3, 3, lightBlue)
@sparkle_bitmaps[4].set_pixel(1, 1, darkBlue)
@sparkle_bitmaps[4].set_pixel(5, 1, darkBlue)
@sparkle_bitmaps[4].set_pixel(1, 5, darkBlue)
@sparkle_bitmaps[4].set_pixel(5, 1, darkBlue)
# 6th sparkle bitmap
@sparkle_bitmaps[5] = Bitmap.new(7, 7)
@sparkle_bitmaps[5].fill_rect(2, 1, 3, 5, darkBlue)
@sparkle_bitmaps[5].fill_rect(1, 2, 5, 3, darkBlue)
@sparkle_bitmaps[5].fill_rect(2, 2, 3, 3, midBlue)
@sparkle_bitmaps[5].fill_rect(3, 1, 1, 5, midBlue)
@sparkle_bitmaps[5].fill_rect(1, 3, 5, 1, midBlue)
@sparkle_bitmaps[5].fill_rect(3, 2, 1, 3, lightBlue)
@sparkle_bitmaps[5].fill_rect(2, 3, 3, 1, lightBlue)
@sparkle_bitmaps[5].set_pixel(3, 3, white)
# 7th sparkle bitmap
@sparkle_bitmaps[6] = Bitmap.new(7, 7)
@sparkle_bitmaps[6].fill_rect(2, 1, 3, 5, midBlue)
@sparkle_bitmaps[6].fill_rect(1, 2, 5, 3, midBlue)
@sparkle_bitmaps[6].fill_rect(3, 0, 1, 7, darkBlue)
@sparkle_bitmaps[6].fill_rect(0, 3, 7, 1, darkBlue)
@sparkle_bitmaps[6].fill_rect(2, 2, 3, 3, lightBlue)
@sparkle_bitmaps[6].fill_rect(3, 2, 1, 3, midBlue)
@sparkle_bitmaps[6].fill_rect(2, 3, 3, 1, midBlue)
@sparkle_bitmaps[6].set_pixel(3, 3, white)
@user_bitmaps = []
update_user_defined
end
def update_user_defined
for image in @user_bitmaps
image.dispose
end
#user-defined bitmaps
for name in $WEATHER_IMAGES
@user_bitmaps.push(RPG::Cache.picture(name))
end
for sprite in @sprites
sprite.bitmap = @user_bitmaps[rand(@user_bitmaps.size)]
end
end
attr_reader :type
attr_reader :max
attr_reader :ox
attr_reader :oy
end
end
作者: xusheng1994xq 时间: 2014-3-30 07:45
...没有人知道吗
我现在已经把颜色改成需要的颜色了,但还是不知道形状在哪改
真心求教
作者: 635132595 时间: 2014-4-1 16:53
建议找相似,有什么天气是颗粒的,稍微动动。
不过最好先备份……
新人回复,
作者: xusheng1994xq 时间: 2014-4-1 17:04
635132595 发表于 2014-4-1 16:53 
建议找相似,有什么天气是颗粒的,稍微动动。
不过最好先备份……
新人回复, ...
颗粒的都是下落的,只有那个落叶是横向的
下落的颗粒怎么看都不像沙尘暴吧
备份很早就备份好了
作者: 736248591 时间: 2014-7-11 12:54
有下载地址吗? 能否发一个给我?
作者: SherryX 时间: 2014-7-11 13:26
本帖最后由 SherryX 于 2014-7-11 13:27 编辑
736248591 发表于 2014-7-11 12:54 
有下载地址吗? 能否发一个给我?
脚本
#screen.change_weather(13,7,0)
#-------------------------------------------------------------------------------
# MAWS - Modified Advanced Weather Script for RPG Maker VX
# Version: 1.1.
# Based on Advanced Weather Script VX by Ccoa
# Modifications created by Agckuu Coceg
#-------------------------------------------------------------------------------
# Thanks DerWulfman to his help with VX version of script.
#-------------------------------------------------------------------------------
# Weather Types:
# 1 - 雨 (Ccoa)
# 2 - 风暴 (Ccoa)
# 3 - 雪 (Ccoa)
# 4 - 冰雹 (Ccoa)
# 5 - 雷阵雨 (Ccoa)
# 6 - 下降棕色叶子 (Ccoa)
# 7 - 吹棕色叶子 (Ccoa)
# 8 - 袅袅棕色叶子 (Ccoa)
# 9 - 下降绿色叶子 (Ccoa)
# 10 - 樱花(樱)花瓣 (Ccoa)
# 11 - 玫瑰花瓣 (Ccoa)
# 12 - 羽毛 (Ccoa)
# 13 - 血雨 (Ccoa)
# 14 - 火花 (Ccoa)
# 15 - 用户自定义
# 16 - 吹雪 (Ccoa)
# 17 - 流星雨 (Ccoa)
# 18 - 落灰 (Ccoa)
# 19 - 气泡 (Ccoa)
# 20 - 气泡 2 (Ccoa)
# 21 - 火花上升 (Ccoa)
#-------------------------------------------------------------------------------
# Version 1.0 addons
#-------------------------------------------------------------------------------
# Leaves effects:
# 22 - 吹绿叶 (Agckuu Coceg)
# 23 - 袅袅的绿叶 (Agckuu Coceg)
# 24 - 下降的黄叶 (Agckuu Coceg)
# 25 - 吹黄叶 (Agckuu Coceg)
# 26 - 袅袅的黄叶 (Agckuu Coceg)
# Rain effects:
# 27 - 石油雨 (Agckuu Coceg)
# 28 - 金雨 (Agckuu Coceg)
# Special effects:
# 29 - 火焰流星雨 (Agckuu Coceg)
#-------------------------------------------------------------------------------
# Version 1.1 addons
#-------------------------------------------------------------------------------
# Starburst effects addons:
# 30 - 彩色星暴 v.2 (replaced Color Starburst)(Agckuu Coceg)
# 31 - 升级版彩色星暴 v.2 (replaced Uprising color Starburst)
# (Agckuu Coceg)
# 32 - 彩色星暴雨 v.2 (replaced Color Starburst rain)(Agckuu Coceg)
# 33 - 单色暴 (Agckuu Coceg)
# 34 - 升级版单色暴 (Agckuu Coceg)
# 35 - 单色暴雨 (Agckuu Coceg)
# Rain effects:
# 36 - 金雨雷电和闪光 (Agckuu Coceg)
# 37 - 金色风暴 (Agckuu Coceg)
# 38 - 石油风暴 (Agckuu Coceg)
# 39 - 酸雨 (Agckuu Coceg)
# 40 - 酸雨闪电和闪光 (Agckuu Coceg)
# 41 - 酸雨风暴 (Agckuu Coceg)
# 42 - 棕褐色雨 (Agckuu Coceg)
# 43 - 棕褐色雨闪电和闪光 (Agckuu Coceg)
# 44 - 棕褐色雨风暴 (Agckuu Coceg)
# 45 - 现实风暴 (Agckuu Coceg)
# 46 - 血雨赤红的闪电和雷声 (Agckuu Coceg)
# 47 - 血雨风暴 (Agckuu Coceg)
# 48 - 血暴雪 (Agckuu Coceg)
# New leaves effects:
# 49 - 下降红枫叶 (Agckuu Coceg)
# 50 - 吹红枫叶 (Agckuu Coceg)
# 51 - 袅袅的红枫叶 (Agckuu Coceg)
# Special effects:
# 52 - 水弹 (Agckuu Coceg)
# 53 - 冰弹 (Agckuu Coceg)
# 54 - 照明弹 (Agckuu Coceg)
#-------------------------------------------------------------------------------
# Weather Power:
# An integer from 0-40. 0 = no weather, 40 = 400 sprites
#-------------------------------------------------------------------------------
# Usage:
# Create a call script with the following: screen.weather(type, power, hue)
#-------------------------------------------------------------------------------
# Usage of user-defined weather. Look at the following globals:
$WEATHER_UPDATE = false # the $WEATHER_IMAGES array has changed, please update
$WEATHER_IMAGES = [] # the array of picture names to use
$WEATHER_X = 0 # the number of pixels the image should move horizontally (positive = right, negative = left)
$WEATHER_Y = 0 # the number of pizels the image should move vertically (positive = down, negative = up)
$WEATHER_FADE = 0 # how much the image should fade each update (0 = no fade, 255 = fade instantly)
$WEATHER_ANIMATED = true # whether or not the image should cycle through all the images
# Take these out if you are using screen resolution script of Ccoa.
HEIGHT = 416
WIDTH = 544
#==============================================================================
# ** Spriteset_Weather
#------------------------------------------------------------------------------
class Spriteset_Weather
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :type
attr_reader :power
attr_reader :ox
attr_reader :oy
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(viewport = nil)
@type = 0
@power = 0
@ox = 0
@oy = 0
@count = 0
@current_pose = []
@info = []
@countarray = []
make_bitmaps
@sprites = []
for i in 1..500
sprite = Sprite.new(viewport)
sprite.visible = false
sprite.opacity = 0
@sprites.push(sprite)
@current_pose.push(0)
@info.push(rand(50))
@countarray.push(rand(15))
end
end
#--------------------------------------------------------------------------
# * Dispose
#--------------------------------------------------------------------------
def dispose
for sprite in @sprites
sprite.dispose
end
@rain_bitmap.dispose
@storm_bitmap.dispose
@snow_bitmap.dispose
@hail_bitmap.dispose
@petal_bitmap.dispose
@blood_rain_bitmap.dispose
@oil_rain_bitmap.dispose
@golden_rain_bitmap.dispose
@golden_storm_bitmap.dispose
@acid_rain_bitmap.dispose
@acid_storm_bitmap.dispose
@sepia_rain_bitmap.dispose
@sepia_storm_bitmap.dispose
@blood_storm_bitmap.dispose
@bloodblizz_bitmap.dispose
@meteor_bitmap.dispose
@flame_meteor_bitmap.dispose
@waterbomb_bitmap.dispose
@icybomb_bitmap.dispose
@flarebomb_bitmap.dispose
for image in @autumn_leaf_bitmaps
image.dispose
end
for image in @green_leaf_bitmaps
image.dispose
end
for image in @yellow_leaf_bitmaps
image.dispose
end
for image in @redmaple_leaf_bitmaps
image.dispose
end
for image in @rose_bitmaps
image.dispose
end
for image in @feather_bitmaps
image.dispose
end
for image in @sparkle_bitmaps
image.dispose
end
for image in @starburst_bitmaps
image.dispose
end
for image in @monostarburst_bitmaps
image.dispose
end
for image in @user_bitmaps
image.dispose
end
$WEATHER_UPDATE = true
end
#--------------------------------------------------------------------------
# * Set weather type
# type : new weather type
#--------------------------------------------------------------------------
def type=(type)
return if @type == type
@type = type
case @type
when 1 # rain
bitmap = @rain_bitmap
when 2 # storm
bitmap = @storm_bitmap
when 3 # snow
bitmap = @snow_bitmap
when 4 # hail
bitmap = @hail_bitmap
when 5 # rain w/ thunder and lightning
bitmap = @rain_bitmap
@thunder = true
when 6 # falling autumn leaves
bitmap = @autumn_leaf_bitmaps[0]
when 7 # blowing autumn leaves
bitmap = @autumn_leaf_bitmaps[0]
when 8 # swirling autumn leaves
bitmap = @autumn_leaf_bitmaps[0]
when 9 # falling green leaves
bitmap = @green_leaf_bitmaps[0]
when 10 # sakura petals
bitmap = @petal_bitmap
when 11 # rose petals
bitmap = @rose_bitmaps[0]
when 12 # feathers
bitmap = @feather_bitmaps[0]
when 13 # blood rain
bitmap = @blood_rain_bitmap
when 14 # sparkles
bitmap = @sparkle_bitmaps[0]
when 15 # user-defined
bitmap = @user_bitmaps[rand(@user_bitmaps.size)]
when 16 # blowing snow
bitmap = @snow_bitmap
when 17 # meteors
bitmap = @meteor_bitmap
when 18 # falling ash
bitmap = @ash_bitmaps[rand(@ash_bitmaps.size)]
when 19 # bubbles
bitmap = @bubble_bitmaps[rand(@bubble_bitmaps.size)]
when 21 # sparkles up
bitmap = @sparkle_bitmaps[0]
when 22 # blowing green leaves
bitmap = @green_leaf_bitmaps[0]
when 23 # swirling green leaves
bitmap = @green_leaf_bitmaps[0]
when 24 # falling yellow leaves
bitmap = @yellow_leaf_bitmaps[0]
when 25 # blowing yellow leaves
bitmap = @yellow_leaf_bitmaps[0]
when 26 # swirling yellow leaves
bitmap = @yellow_leaf_bitmaps[0]
when 27 # oil rain
bitmap = @oil_rain_bitmap
when 28 # golden rain
bitmap = @golden_rain_bitmap
when 29 # flame meteors
bitmap = @flame_meteor_bitmap
when 30 # starburst
bitmap = @starburst_bitmaps[0]
when 31 # uprising starburst
bitmap = @starburst_bitmaps[0]
when 32 # starburst rain
bitmap = @starburst_bitmaps[0]
when 33 # mono-starburst
bitmap = @monostarburst_bitmaps[0]
when 34 # uprising mono-starburst
bitmap = @monostarburst_bitmaps[0]
when 35 # mono-starburst rain
bitmap = @monostarburst_bitmaps[0]
when 36 # Golden rain w\ thunder and ligthning
bitmap = @golden_rain_bitmap
@golden_thunder = true
when 37 # Golden storm
bitmap = @golden_storm_bitmap
when 38 # Oil storm
bitmap = @oil_storm_bitmap
when 39 # # Acid rain
bitmap = @acid_rain_bitmap
when 40 # Acid rain w\thunder and lightning
bitmap = @acid_rain_bitmap
@acid_thunder = true
when 41 # Acid storm
bitmap = @acid_storm_bitmap
when 42 # Sepia rain
bitmap = @sepia_rain_bitmap
when 43 # Sepia rain w\ thunder and lightning
bitmap = @sepia_rain_bitmap
@sepia_thunder = true
when 44 # Sepia storm
bitmap = @sepia_storm_bitmap
when 45 # Realistic storm
bitmap = @storm_bitmap
@real_storm = true
when 46 # Blood rain w\ thunder and lightning
bitmap = @blood_rain_bitmap
@crimson_thunder = true
when 47 # Blood storm
bitmap = @blood_storm_bitmap
when 48 # Blood blizzard
bitmap = @bloodblizz_bitmap
when 49 # Falling red maple leaves
bitmap = @redmaple_leaf_bitmaps[0]
when 50 # Blowing red maple leaves
bitmap = @redmaple_leaf_bitmaps[0]
when 51 # Swirling red maple leaves
bitmap = @redmaple_leaf_bitmaps[0]
when 52
bitmap = @waterbomb_bitmaps
when 53
bitmap = @icybomb_bitmaps
when 54
bitmap = @flarebomb_bitmaps
else
bitmap = nil
end
if @type != 5
@thunder = false
end
if @type != 36
@golden_thunder = false
end
if @type != 40
@acid_thunder = false
end
if @type != 43
@sepia_thunder = false
end
if @type != 45
@real_storm = false
end
if @type != 46
@crimson_thunder = false
end
for i in [email protected]
sprite = @sprites
sprite.visible = (i <= @power)
if @type == 19
sprite.bitmap = @bubble_bitmaps[rand(@bubble_bitmaps.size)]
elsif @type == 20
sprite.bitmap = @bubble2_bitmaps[rand(@bubble2_bitmaps.size)]
elsif @type == 3
r = rand(@snow_bitmaps.size)
@info = r
sprite.bitmap = @snow_bitmaps[r]
else
sprite.bitmap = bitmap
end
end
end
#--------------------------------------------------------------------------
# * Set starting point X coordinate
# ox : starting point X coordinate
#--------------------------------------------------------------------------
def ox=(ox)
return if @ox == ox;
@ox = ox
for sprite in @sprites
sprite.ox = @ox
end
end
#--------------------------------------------------------------------------
# * Set starting point Y coordinate
# oy : starting point Y coordinate
#--------------------------------------------------------------------------
def oy=(oy)
return if @oy == oy;
@oy = oy
for sprite in @sprites
sprite.oy = @oy
end
end
#--------------------------------------------------------------------------
# * Set maximum number of sprites
# max : maximum number of sprites
#--------------------------------------------------------------------------
def power=(power)
@power = power
for i in 1..40
sprite = @sprites
sprite.visible = (i <= @power) if sprite != nil
if @type == 19
sprite.bitmap = @bubble_bitmaps[rand(@bubble_bitmaps.size)]
elsif @type == 20
sprite.bitmap = @bubble2_bitmaps[rand(@bubble2_bitmaps.size)]
elsif @type == 3
r = rand(@snow_bitmaps.size)
@info = r
sprite.bitmap = @snow_bitmaps[r]
end
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
return if @type == 0
for i in 1..@power
sprite = @sprites
if @type == 1 or @type == 5 or @type == 13 or @type == 27 or @type == 28 or @type == 36 or @type == 39 or @type == 40 or @type == 42 or @type == 43 or @type == 46 #rain
if sprite.opacity <= 150
if @current_pose == 0
sprite.y += @rain_bitmap.height
sprite.x -= @rain_bitmap.width
if @type == 1 or @type == 5
sprite.bitmap = @rain_splash
else
sprite.bitmap = @blood_rain_splash
end
if @type == 27
sprite.bitmap = @oil_rain_splash
end
if @type == 28
sprite.bitmap = @golden_rain_splash
end
if @type == 36
sprite.bitmap = @golden_rain_splash
end
if @type == 39
sprite.bitmap = @acid_rain_splash
end
if @type == 40
sprite.bitmap = @acid_rain_splash
end
if @type == 42
sprite.bitmap = @sepia_rain_splash
end
if @type == 43
sprite.bitmap = @sepia_rain_splash
end
if @type == 46
sprite.bitmap = @blood_rain_splash
end
@current_pose = 1
end
else
if @current_pose == 1
if @type == 1 or @type == 5
sprite.bitmap = @rain_bitmap
else
sprite.bitmap = @blood_rain_bitmap
end
if @type == 27
sprite.bitmap = @oil_rain_bitmap
end
if @type == 28
sprite.bitmap = @golden_rain_bitmap
end
if @type == 36
sprite.bitmap = @golden_rain_bitmap
end
if @type == 39
sprite.bitmap = @acid_rain_bitmap
end
if @type == 40
sprite.bitmap = @acid_rain_bitmap
end
if @type == 42
sprite.bitmap = @sepia_rain_bitmap
end
if @type == 43
sprite.bitmap = @sepia_rain_bitmap
end
if @type == 46
sprite.bitmap = @blood_rain_bitmap
end
@current_pose = 0
end
sprite.x -= 2
sprite.y += 16
if @thunder and (rand(8000 - @power) == 0)
$game_map.screen.start_flash(Color.new(255, 255, 255, 255), 5)
Audio.se_play("Audio/SE/Thunder1")
end
if @golden_thunder and (rand(8000 - @power) == 0)
$game_map.screen.start_flash(Color.new(255, 255, 255, 255), 5)
Audio.se_play("Audio/SE/Thunder1")
end
if @acid_thunder and (rand(5000 - @power) == 0)
$game_map.screen.start_flash(Color.new(255, 255, 255, 255), 5)
Audio.se_play("Audio/SE/Thunder1")
end
if @sepia_thunder and (rand(8000 - @power) == 0)
$game_map.screen.start_flash(Color.new(169, 152, 142, 255), 5)
Audio.se_play("Audio/SE/Thunder1")
end
if @sepia_thunder and (rand(8000 - @power) == 0)
$game_map.screen.start_flash(Color.new(169, 152, 142, 255), 5)
Audio.se_play("Audio/SE/Thunder1")
end
if @crimson_thunder and (rand(8000 - @power) == 0)
$game_map.screen.start_flash(Color.new(141, 9, 9, 255), 5)
Audio.se_play("Audio/SE/Thunder1")
end
end
sprite.opacity -= 8
end
if @type == 2 or @type == 37 or @type == 38 or @type == 41 or @type == 44 or @type == 45 or @type == 47 # storm
sprite.x -= 8
sprite.y += 16
sprite.opacity -= 12
end
if @real_storm and (rand(5000 - @power) == 0)
$game_map.screen.start_flash(Color.new(255, 255, 255, 255), 5)
$game_map.screen.start_shake(9, 4, 5)
Audio.se_play("Audio/SE/Thunder9")
end
if @type == 3 # snow
case @info
when 0 # smallest flake, fall the slowest
sprite.y += 1
when 1
sprite.y += 3
when 2
sprite.y += 5
when 3
sprite.y += 7
end
sprite.opacity -= 3
end
if @type == 4 # hail
sprite.x -= 1
sprite.y += 18
sprite.opacity -= 15
end
if @type == 6 # falling autumn leaves
@count = rand(20)
if @count == 0
sprite.bitmap = @autumn_leaf_bitmaps[@current_pose]
@current_pose = (@current_pose + 1) % @autumn_leaf_bitmaps.size
end
sprite.x -= 1
sprite.y += 1
end
if @type == 7 # blowing autumn leaves
@count = rand(20)
if @count == 0
sprite.bitmap = @autumn_leaf_bitmaps[@current_pose]
@current_pose = (@current_pose + 1) % @autumn_leaf_bitmaps.size
end
sprite.x -= 10
sprite.y += (rand(4) - 2)
end
if @type == 8 # swirling autumn leaves
@count = rand(20)
if @count == 0
sprite.bitmap = @autumn_leaf_bitmaps[@current_pose]
@current_pose = (@current_pose + 1) % @autumn_leaf_bitmaps.size
end
if @info != 0
if @info >= 1 and @info <= 10
sprite.x -= 3
sprite.y -= 1
elsif @info >= 11 and @info <= 16
sprite.x -= 1
sprite.y -= 2
elsif @info >= 17 and @info <= 20
sprite.y -= 3
elsif @info >= 21 and @info <= 30
sprite.y -= 2
sprite.x += 1
elsif @info >= 31 and @info <= 36
sprite.y -= 1
sprite.x += 3
elsif @info >= 37 and @info <= 40
sprite.x += 5
elsif @info >= 41 and @info <= 46
sprite.y += 1
sprite.x += 3
elsif @info >= 47 and @info <= 58
sprite.y += 2
sprite.x += 1
elsif @info >= 59 and @info <= 64
sprite.y += 3
elsif @info >= 65 and @info <= 70
sprite.x -= 1
sprite.y += 2
elsif @info >= 71 and @info <= 81
sprite.x -= 3
sprite.y += 1
elsif @info >= 82 and @info <= 87
sprite.x -= 5
end
@info = (@info + 1) % 88
else
if rand(200) == 0
@info = 1
end
sprite.x -= 5
sprite.y += 1
end
end
if @type == 49 # falling red maple leaves
@count = rand(20)
if @count == 0
sprite.bitmap = @redmaple_leaf_bitmaps[@current_pose]
@current_pose = (@current_pose + 1) % @redmaple_leaf_bitmaps.size
end
sprite.x -= 1
sprite.y += 1
end
if @type == 50 # blowing red maple leaves
@count = rand(20)
if @count == 0
sprite.bitmap = @redmaple_leaf_bitmaps[@current_pose]
@current_pose = (@current_pose + 1) % @redmaple_leaf_bitmaps.size
end
sprite.x -= 10
sprite.y += (rand(4) - 2)
end
if @type == 51 # swirling red maple leaves
@count = rand(20)
if @count == 0
sprite.bitmap = @redmaple_leaf_bitmaps[@current_pose]
@current_pose = (@current_pose + 1) % @redmaple_leaf_bitmaps.size
end
if @info != 0
if @info >= 1 and @info <= 10
sprite.x -= 3
sprite.y -= 1
elsif @info >= 11 and @info <= 16
sprite.x -= 1
sprite.y -= 2
elsif @info >= 17 and @info <= 20
sprite.y -= 3
elsif @info >= 21 and @info <= 30
sprite.y -= 2
sprite.x += 1
elsif @info >= 31 and @info <= 36
sprite.y -= 1
sprite.x += 3
elsif @info >= 37 and @info <= 40
sprite.x += 5
elsif @info >= 41 and @info <= 46
sprite.y += 1
sprite.x += 3
elsif @info >= 47 and @info <= 58
sprite.y += 2
sprite.x += 1
elsif @info >= 59 and @info <= 64
sprite.y += 3
elsif @info >= 65 and @info <= 70
sprite.x -= 1
sprite.y += 2
elsif @info >= 71 and @info <= 81
sprite.x -= 3
sprite.y += 1
elsif @info >= 82 and @info <= 87
sprite.x -= 5
end
@info = (@info + 1) % 88
else
if rand(200) == 0
@info = 1
end
sprite.x -= 5
sprite.y += 1
end
end
if @type == 9 # falling green leaves
if @countarray == 0
@current_pose = (@current_pose + 1) % @green_leaf_bitmaps.size
sprite.bitmap = @green_leaf_bitmaps[@current_pose]
@countarray = rand(15)
end
@countarray = (@countarray + 1) % 15
sprite.y += 1
end
if @type == 10 # sakura petals
if @info < 25
sprite.x -= 1
else
sprite.x += 1
end
@info = (@info + 1) % 50
sprite.y += 1
end
if @type == 11 # rose petals
@count = rand(20)
if @count == 0
sprite.bitmap = @rose_bitmaps[@current_pose]
@current_pose = (@current_pose + 1) % @rose_bitmaps.size
end
if @info % 2 == 0
if @info < 10
sprite.x -= 1
elsif
sprite.x += 1
end
end
sprite.y += 1
end
if @type == 12 # feathers
if @countarray == 0
@current_pose = (@current_pose + 1) % @feather_bitmaps.size
sprite.bitmap = @feather_bitmaps[@current_pose]
end
@countarray = (@countarray + 1) % 15
if rand(100) == 0
sprite.x -= 1
end
if rand(100) == 0
sprite.y -= 1
end
if @info < 50
if rand(2) == 0
sprite.x -= 1
else
sprite.y -= 1
end
else
if rand(2) == 0
sprite.x += 1
else
sprite.y += 1
end
end
@info = (@info + 1) % 100
end
if @type == 30 # starburst
if @countarray == 0
@current_pose = (@current_pose + 1) % @starburst_bitmaps.size
sprite.bitmap = @starburst_bitmaps[@current_pose]
end
@countarray = (@countarray + 1) % 15
sprite.y += 1
sprite.opacity -= 1
end
if @type == 31 # starburst up
if @countarray == 0
@current_pose = (@current_pose + 1) % @starburst_bitmaps.size
sprite.bitmap = @starburst_bitmaps[@current_pose]
end
@countarray = (@countarray + 1) % 15
sprite.y -= 1
sprite.opacity -= 1
end
if @type == 32 # starburst up
if @countarray == 0
@current_pose = (@current_pose + 1) % @starburst_bitmaps.size
sprite.bitmap = @starburst_bitmaps[@current_pose]
end
@countarray = (@countarray + 1) % 15
sprite.x -= 2
sprite.y += 8
sprite.opacity -= 1
end
if @type == 33 # mono-starburst
if @countarray == 0
@current_pose = (@current_pose + 1) % @monostarburst_bitmaps.size
sprite.bitmap = @monostarburst_bitmaps[@current_pose]
end
@countarray = (@countarray + 1) % 15
sprite.y += 1
sprite.opacity -= 1
end
if @type == 34 # mono-starburst up
if @countarray == 0
@current_pose = (@current_pose + 1) % @monostarburst_bitmaps.size
sprite.bitmap = @monostarburst_bitmaps[@current_pose]
end
@countarray = (@countarray + 1) % 15
sprite.y -= 1
sprite.opacity -= 1
end
if @type == 35 # mono-starburst rain
if @countarray == 0
@current_pose = (@current_pose + 1) % @monostarburst_bitmaps.size
sprite.bitmap = @monostarburst_bitmaps[@current_pose]
end
@countarray = (@countarray + 1) % 15
sprite.x -= 2
sprite.y += 8
sprite.opacity -= 1
end
if @type == 29 # meteors
if @countarray > 0
if rand(20) == 0
sprite.bitmap = @flame_impact_bitmap
@countarray = -5
else
sprite.x -= 6
sprite.y += 10
end
else
@countarray += 1
if @countarray == 0
sprite.bitmap = @flame_meteor_bitmap
sprite.opacity = 0
@count_array = 1
end
end
end
if @type == 18 # ash
sprite.y += 2
case @countarray % 3
when 0
sprite.x -= 1
when 1
sprite.x += 1
end
end
if @type == 14 # sparkles
if @countarray == 0
@current_pose = (@current_pose + 1) % @sparkle_bitmaps.size
sprite.bitmap = @sparkle_bitmaps[@current_pose]
end
@countarray = (@countarray + 1) % 15
sprite.y += 1
sprite.opacity -= 1
end
if @type == 15 # user-defined
if $WEATHER_UPDATE
update_user_defined
$WEATHER_UPDATE = false
end
if $WEATHER_ANIMATED and @countarray == 0
@current_pose = (@current_pose + 1) % @user_bitmaps.size
sprite.bitmap = @user_bitmaps[@current_pose]
end
sprite.x += $WEATHER_X
sprite.y += $WEATHER_Y
sprite.opacity -= $WEATHER_FADE
end
if @type == 16 # blowing snow
sprite.x -= 10
sprite.y += 6
sprite.opacity -= 4
end
if @type == 48 # blood blizzard
sprite.x -= 10
sprite.y += 6
sprite.opacity -= 4
end
if @type == 52 # water bombs
if @countarray > 0
if rand(20) == 0
sprite.bitmap = @waterbomb_impact_bitmap
@countarray = -5
else
sprite.x -= 3
sprite.y += 5
end
else
@countarray += 1
if @countarray == 0
sprite.bitmap = @waterbomb_bitmap
sprite.opacity = 0
@count_array = 1
end
end
end
if @type == 53 # icy bombs
if @countarray > 0
if rand(20) == 0
sprite.bitmap = @icybomb_impact_bitmap
@countarray = -5
else
sprite.x -= 3
sprite.y += 5
end
else
@countarray += 1
if @countarray == 0
sprite.bitmap = @icybomb_bitmap
sprite.opacity = 0
@count_array = 1
end
end
end
if @type == 54 # flare bombs
if @countarray > 0
if rand(20) == 0
sprite.bitmap = @flarebomb_impact_bitmap
@countarray = -5
else
sprite.x -= 3
sprite.y += 5
end
else
@countarray += 1
if @countarray == 0
sprite.bitmap = @flarebomb_bitmap
sprite.opacity = 0
@count_array = 1
end
end
end
if @type == 17 # meteors
if @countarray > 0
if rand(20) == 0
sprite.bitmap = @impact_bitmap
@countarray = -5
else
sprite.x -= 6
sprite.y += 10
end
else
@countarray += 1
if @countarray == 0
sprite.bitmap = @meteor_bitmap
sprite.opacity = 0
@count_array = 1
end
end
end
if @type == 18 # ash
sprite.y += 2
case @countarray % 3
when 0
sprite.x -= 1
when 1
sprite.x += 1
end
end
if @type == 19 or @type == 20 # bubbles
switch = rand(75) + rand(75) + 1
if @info < switch / 2
sprite.x -= 1
else
sprite.x += 1
end
@info = (@info + 1) % switch
sprite.y -= 1
if switch % 2 == 0
sprite.opacity -= 1
end
end
if @type == 21 # sparkles up
if @countarray == 0
@current_pose = (@current_pose + 1) % @sparkle_bitmaps.size
sprite.bitmap = @sparkle_bitmaps[@current_pose]
end
@countarray = (@countarray + 1) % 15
sprite.y -= 1
sprite.opacity -= 1
end
if @type == 24 # falling yellow leaves
@count = rand(20)
if @count == 0
sprite.bitmap = @yellow_leaf_bitmaps[@current_pose]
@current_pose = (@current_pose + 1) % @yellow_leaf_bitmaps.size
end
sprite.x -= 1
sprite.y += 1
end
if @type == 22 # blowing green leaves
@count = rand(20)
if @count == 0
sprite.bitmap = @green_leaf_bitmaps[@current_pose]
@current_pose = (@current_pose + 1) % @green_leaf_bitmaps.size
end
sprite.x -= 10
sprite.y += (rand(4) - 2)
end
if @type == 23 # swirling green leaves
@count = rand(20)
if @count == 0
sprite.bitmap = @green_leaf_bitmaps[@current_pose]
@current_pose = (@current_pose + 1) % @green_leaf_bitmaps.size
end
if @info != 0
if @info >= 1 and @info <= 10
sprite.x -= 3
sprite.y -= 1
elsif @info >= 11 and @info <= 16
sprite.x -= 1
sprite.y -= 2
elsif @info >= 17 and @info <= 20
sprite.y -= 3
elsif @info >= 21 and @info <= 30
sprite.y -= 2
sprite.x += 1
elsif @info >= 31 and @info <= 36
sprite.y -= 1
sprite.x += 3
elsif @info >= 37 and @info <= 40
sprite.x += 5
elsif @info >= 41 and @info <= 46
sprite.y += 1
sprite.x += 3
elsif @info >= 47 and @info <= 58
sprite.y += 2
sprite.x += 1
elsif @info >= 59 and @info <= 64
sprite.y += 3
elsif @info >= 65 and @info <= 70
sprite.x -= 1
sprite.y += 2
elsif @info >= 71 and @info <= 81
sprite.x -= 3
sprite.y += 1
elsif @info >= 82 and @info <= 87
sprite.x -= 5
end
@info = (@info + 1) % 88
else
if rand(200) == 0
@info = 1
end
sprite.x -= 5
sprite.y += 1
end
end
if @type == 24 # falling yellow leaves
@count = rand(20)
if @count == 0
sprite.bitmap = @yellow_leaf_bitmaps[@current_pose]
@current_pose = (@current_pose + 1) % @yellow_leaf_bitmaps.size
end
sprite.x -= 1
sprite.y += 1
end
if @type == 25 # blowing yellow leaves
@count = rand(20)
if @count == 0
sprite.bitmap = @yellow_leaf_bitmaps[@current_pose]
@current_pose = (@current_pose + 1) % @yellow_leaf_bitmaps.size
end
sprite.x -= 10
sprite.y += (rand(4) - 2)
end
if @type == 26 # swirling yellow leaves
@count = rand(20)
if @count == 0
sprite.bitmap = @yellow_leaf_bitmaps[@current_pose]
@current_pose = (@current_pose + 1) % @yellow_leaf_bitmaps.size
end
if @info != 0
if @info >= 1 and @info <= 10
sprite.x -= 3
sprite.y -= 1
elsif @info >= 11 and @info <= 16
sprite.x -= 1
sprite.y -= 2
elsif @info >= 17 and @info <= 20
sprite.y -= 3
elsif @info >= 21 and @info <= 30
sprite.y -= 2
sprite.x += 1
elsif @info >= 31 and @info <= 36
sprite.y -= 1
sprite.x += 3
elsif @info >= 37 and @info <= 40
sprite.x += 5
elsif @info >= 41 and @info <= 46
sprite.y += 1
sprite.x += 3
elsif @info >= 47 and @info <= 58
sprite.y += 2
sprite.x += 1
elsif @info >= 59 and @info <= 64
sprite.y += 3
elsif @info >= 65 and @info <= 70
sprite.x -= 1
sprite.y += 2
elsif @info >= 71 and @info <= 81
sprite.x -= 3
sprite.y += 1
elsif @info >= 82 and @info