幻想森林

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 1625|回复: 8

还是老外强。。。。。。。。

[复制链接]

89

主题

2333

帖子

3273万

积分

⑧专业

Xavier on Rails

积分
32739794
QQ
发表于 2005-10-7 20:31:56 | 显示全部楼层 |阅读模式

。。。。。。。。。。
#===========================
# 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:
# 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)
#
# 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 = 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 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(248, 88, 0, 255)
orangeBrown = Color.new(144, 80, 56, 255)
burntRed = Color.new(152, 0, 0, 255)
paleOrange = Color.new(232, 160, 128, 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, 2, 2, 1, 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 x
attr_reader y
end
end



像是用语言生写出来的。。。。。
回复

使用道具 举报

6

主题

104

帖子

1936

积分

⑥精研

积分
1936
发表于 2005-10-7 20:48:48 | 显示全部楼层
米必要撒,天气不是有自带的吗
回复 支持 反对

使用道具 举报

50

主题

994

帖子

6699

积分

管理员

爱干啥干啥!

Rank: 9Rank: 9Rank: 9

积分
6699
发表于 2005-10-7 21:49:19 | 显示全部楼层
脚本写的蛮有个性的。树叶不是帖图,而是描点画上去的。为了表现树叶飘落的效果吧~~

表现力大赞,呵呵。

PS:帖就帖,干嘛起个这种题目哈-_-bb,看得胸闷-_-b

“放下屠刀,立地成佛” 故应先杀生,然后再成佛。

(\\_/) (-_-) ()+() this is bunny priest.
回复 支持 反对

使用道具 举报

50

主题

994

帖子

6699

积分

管理员

爱干啥干啥!

Rank: 9Rank: 9Rank: 9

积分
6699
发表于 2005-10-7 21:58:52 | 显示全部楼层
下面是引用左赞于2005-10-07 20:48发表的:
米必要撒,天气不是有自带的吗

[s:8] 不一样的呀。请不要根据类名来给脚本分类。

“放下屠刀,立地成佛” 故应先杀生,然后再成佛。

(\\_/) (-_-) ()+() this is bunny priest.
回复 支持 反对

使用道具 举报

89

主题

2333

帖子

3273万

积分

⑧专业

Xavier on Rails

积分
32739794
QQ
 楼主| 发表于 2005-10-8 11:25:47 | 显示全部楼层
一点一点生成出树叶来。他还真有耐心阿。。。。。。
回复 支持 反对

使用道具 举报

113

主题

866

帖子

7004

积分

⑦老手

pliskin

积分
7004
发表于 2005-10-14 11:52:39 | 显示全部楼层
回去用用
最近,迷上八云紫大婶了
回复 支持 反对

使用道具 举报

40

主题

609

帖子

2170万

积分

⑧专业

幻森失踪人口

积分
21703438
QQ
发表于 2005-10-14 13:09:52 | 显示全部楼层
我用这个脚本就提示出错,用不了啊~
我蛮想用那些花瓣的效果的
哈利引擎游戏网http://www.HSGAME.net HSG-在线游戏http://web.HSGAME.net 本人所有作品会保证链接在1年内有效,并保证永久在www.HSGAME.net提供最新的下载及更新
回复 支持 反对

使用道具 举报

1

主题

132

帖子

5367

积分

⑦老手

分数身外物

积分
5367
发表于 2005-10-15 13:41:34 | 显示全部楼层
竟然没有用图片直接绘点,汗!
你的微笑犹如玫瑰色的锁……
回复 支持 反对

使用道具 举报

5

主题

12

帖子

1329

积分

⑥精研

积分
1329
发表于 2005-10-15 14:22:56 | 显示全部楼层
这个脚本到底该怎么用?
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|幻想森林

GMT+8, 2024-5-17 11:28 , Processed in 0.039758 second(s), 21 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表