赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 8559 |
最后登录 | 2015-8-26 |
在线时间 | 439 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 439 小时
- 注册时间
- 2013-3-2
- 帖子
- 710
|
本帖最后由 guoyq1988 于 2013-9-14 22:32 编辑
第一个问题,论坛搜索有
第二个问题,论坛搜索也有
第三个问题,论坛搜索还是有
你就不能搜索下在问么?还三连呀!
看在是新人的份上就帮你一把
天气- #===========================
- # 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
- [url=home.php?mod=space&uid=25307]@Max[/url] = 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
- [url=home.php?mod=space&uid=34616]@thunder[/url] = 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
- [url=home.php?mod=space&uid=34616]@thunder[/url] = false
- end
- # **** ccoa ****
- for i in 1..500
- sprite = @sprites[i]
- 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 [url=home.php?mod=space&uid=25307]@Max[/url] == max;
- # **** ccoa ****
- @max = [[max, 0].max, 500].min
- for i in 1..500
- sprite = @sprites[i]
- if sprite != nil
- sprite.visible = (i <= @max)
- end
- end
- end
- def update
- return if @type == 0
- for i in 1..@max
- sprite = @sprites[i]
- 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[i]]
- @current_pose[i] = (@current_pose[i] + 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[i]]
- @current_pose[i] = (@current_pose[i] + 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[i]]
- @current_pose[i] = (@current_pose[i] + 1) % @autumn_leaf_bitmaps.size
- end
- if @info[i] != 0
- if @info[i] >= 1 and @info[i] <= 10
- sprite.x -= 3
- sprite.y -= 1
- elsif @info[i] >= 11 and @info[i] <= 16
- sprite.x -= 1
- sprite.y -= 2
- elsif @info[i] >= 17 and @info[i] <= 20
- sprite.y -= 3
- elsif @info[i] >= 21 and @info[i] <= 30
- sprite.y -= 2
- sprite.x += 1
- elsif @info[i] >= 31 and @info[i] <= 36
- sprite.y -= 1
- sprite.x += 3
- elsif @info[i] >= 37 and @info[i] <= 40
- sprite.x += 5
- elsif @info[i] >= 41 and @info[i] <= 46
- sprite.y += 1
- sprite.x += 3
- elsif @info[i] >= 47 and @info[i] <= 58
- sprite.y += 2
- sprite.x += 1
- elsif @info[i] >= 59 and @info[i] <= 64
- sprite.y += 3
- elsif @info[i] >= 65 and @info[i] <= 70
- sprite.x -= 1
- sprite.y += 2
- elsif @info[i] >= 71 and @info[i] <= 81
- sprite.x -= 3
- sprite.y += 1
- elsif @info[i] >= 82 and @info[i] <= 87
- sprite.x -= 5
- end
- @info[i] = (@info[i] + 1) % 88
- else
- if rand(200) == 0
- @info[i] = 1
- end
- sprite.x -= 5
- sprite.y += 1
- end
- end
- if @type == 9 # falling green leaves
- if @countarray[i] == 0
- @current_pose[i] = (@current_pose[i] + 1) % @green_leaf_bitmaps.size
- sprite.bitmap = @green_leaf_bitmaps[@current_pose[i]]
- @countarray[i] = rand(15)
- end
- @countarray[i] = (@countarray[i] + 1) % 15
- sprite.y += 1
- end
- if @type == 10 # sakura petals
- if @info[i] < 25
- sprite.x -= 1
- else
- sprite.x += 1
- end
- @info[i] = (@info[i] + 1) % 50
- sprite.y += 1
- end
- if @type == 11 # rose petals
- @count = rand(20)
- if @count == 0
- sprite.bitmap = @rose_bitmaps[@current_pose[i]]
- @current_pose[i] = (@current_pose[i] + 1) % @rose_bitmaps.size
- end
- if @info[i] % 2 == 0
- if @info[i] < 10
- sprite.x -= 1
- else
- sprite.x += 1
- end
- end
- sprite.y += 1
- end
- if @type == 12 # feathers
- if @countarray[i] == 0
- @current_pose[i] = (@current_pose[i] + 1) % @feather_bitmaps.size
- sprite.bitmap = @feather_bitmaps[@current_pose[i]]
- end
- @countarray[i] = (@countarray[i] + 1) % 15
- if rand(100) == 0
- sprite.x -= 1
- end
- if rand(100) == 0
- sprite.y -= 1
- end
- if @info[i] < 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[i] = (@info[i] + 1) % 100
- end
- if @type == 14 # sparkles
- if @countarray[i] == 0
- @current_pose[i] = (@current_pose[i] + 1) % @sparkle_bitmaps.size
- sprite.bitmap = @sparkle_bitmaps[@current_pose[i]]
- end
- @countarray[i] = (@countarray[i] + 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[i] == 0
- @current_pose[i] = (@current_pose[i] + 1) % @user_bitmaps.size
- sprite.bitmap = @user_bitmaps[@current_pose[i]]
- end
- @countarray[i] = (@countarray[i] + 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(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 :ox
- attr_reader :oy
- end
- end
-
复制代码 队员跟随- #===================================================================
- # 本脚本来自http://www.66rpg.com/,使用和转载请保留此信息
- #===================================================================
- # ————————————————————————————————————
- # ▼▲▼ XRXS13. パーティ列車移動 ver.1.02 ▼▲▼
- # by fukuyama
- #
- # Train_Actor
- #
- # [email protected]
- # http://web.archive.org/web/20080410051340/http://www4.big.or.jp/~fukuyama/rgss/Train_Actor.txt
- #
- module Train_Actor
- #是否使用停止跟随的方法,也就是说,这里false改为true的时候,如果TRANSPARENT_SWITCHES_INDEX
- #开关打开,跟随的人物就消失了(其实只是变成透明而已)
- TRANSPARENT_SWITCH = false
- TRANSPARENT_SWITCHES_INDEX = 20
- #举例:第一个为true,第二个为20,则打开20号开关,后面的人都没了。
- #跟随人数的最大数目,可以更改为2、3什么的。
- TRAIN_ACTOR_SIZE_MAX = 5
- # 定数
- #Input::DOWN = 2
- #Input::LEFT = 4
- #Input::RIGHT = 6
- #Input::UP = 6
- DOWN_LEFT = 1
- DOWN_RIGHT = 3
- UP_LEFT = 7
- UP_RIGHT = 9
- JUMP = 5
- class Game_Party_Actor < Game_Character
- def initialize
- super()
- @through = true
- end
- def setup(actor)
- # キャラクターのファイル名と色相を設定
- if actor != nil
- @character_name = actor.character_name
- @character_hue = actor.character_hue
- @tempneme = actor.name
- else
- @character_name = ""
- @character_hue = 0
- @tempneme = ""
- end
- # 不透明度と合成方法を初期化
- @opacity = 255
- @blend_type = 0
- end
- def screen_z(height = 0)
- if $game_player.x == @x and $game_player.y == @y
- return $game_player.screen_z(height) - 1
- end
- super(height)
- end
- def name
- return @tempneme
- end
- #--------------------------------------------------------------------------
- # ● 下に移動
- # turn_enabled : その場での向き変更を許可するフラグ
- #--------------------------------------------------------------------------
- def move_down(turn_enabled = true)
- # 下を向く
- if turn_enabled
- turn_down
- end
- # 通行可能な場合
- if passable?(@x, @y, Input::DOWN)
- # 下を向く
- turn_down
- # 座標を更新
- @y += 1
- end
- end
- #--------------------------------------------------------------------------
- # ● 左に移動
- # turn_enabled : その場での向き変更を許可するフラグ
- #--------------------------------------------------------------------------
- def move_left(turn_enabled = true)
- # 左を向く
- if turn_enabled
- turn_left
- end
- # 通行可能な場合
- if passable?(@x, @y, Input::LEFT)
- # 左を向く
- turn_left
- # 座標を更新
- @x -= 1
- end
- end
- #--------------------------------------------------------------------------
- # ● 右に移動
- # turn_enabled : その場での向き変更を許可するフラグ
- #--------------------------------------------------------------------------
- def move_right(turn_enabled = true)
- # 右を向く
- if turn_enabled
- turn_right
- end
- # 通行可能な場合
- if passable?(@x, @y, Input::RIGHT)
- # 右を向く
- turn_right
- # 座標を更新
- @x += 1
- end
- end
- #--------------------------------------------------------------------------
- # ● 上に移動
- # turn_enabled : その場での向き変更を許可するフラグ
- #--------------------------------------------------------------------------
- def move_up(turn_enabled = true)
- # 上を向く
- if turn_enabled
- turn_up
- end
- # 通行可能な場合
- if passable?(@x, @y, Input::UP)
- # 上を向く
- turn_up
- # 座標を更新
- @y -= 1
- end
- end
- #--------------------------------------------------------------------------
- # ● 左下に移動
- #--------------------------------------------------------------------------
- def move_lower_left
- # 向き固定でない場合
- unless @direction_fix
- # 右向きだった場合は左を、上向きだった場合は下を向く
- @direction = (@direction == Input::RIGHT ? Input::LEFT : @direction == Input::UP ? Input::DOWN : @direction)
- end
- # 下→左、左→下 のどちらかのコースが通行可能な場合
- if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1, Input::LEFT)) or
- (passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y, Input::DOWN))
- # 座標を更新
- @x -= 1
- @y += 1
- end
- end
- #--------------------------------------------------------------------------
- # ● 右下に移動
- #--------------------------------------------------------------------------
- def move_lower_right
- # 向き固定でない場合
- unless @direction_fix
- # 左向きだった場合は右を、上向きだった場合は下を向く
- @direction = (@direction == Input::LEFT ? Input::RIGHT : @direction == Input::UP ? Input::DOWN : @direction)
- end
- # 下→右、右→下 のどちらかのコースが通行可能な場合
- if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1, Input::RIGHT)) or
- (passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y, Input::DOWN))
- # 座標を更新
- @x += 1
- @y += 1
- end
- end
- #--------------------------------------------------------------------------
- # ● 左上に移動
- #--------------------------------------------------------------------------
- def move_upper_left
- # 向き固定でない場合
- unless @direction_fix
- # 右向きだった場合は左を、下向きだった場合は上を向く
- @direction = (@direction == Input::RIGHT ? Input::LEFT : @direction == Input::DOWN ? Input::UP : @direction)
- end
- # 上→左、左→上 のどちらかのコースが通行可能な場合
- if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1, Input::LEFT)) or
- (passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y, Input::UP))
- # 座標を更新
- @x -= 1
- @y -= 1
- end
- end
- #--------------------------------------------------------------------------
- # ● 右上に移動
- #--------------------------------------------------------------------------
- def move_upper_right
- # 向き固定でない場合
- unless @direction_fix
- # 左向きだった場合は右を、下向きだった場合は上を向く
- @direction = (@direction == Input::LEFT ? Input::RIGHT : @direction == Input::DOWN ? Input::UP : @direction)
- end
- # 上→右、右→上 のどちらかのコースが通行可能な場合
- if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1, Input::RIGHT)) or
- (passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y, Input::UP))
- # 座標を更新
- @x += 1
- @y -= 1
- end
- end
- attr_writer :move_speed
- attr_writer :step_anime
- end
- module Spriteset_Map_Module
- def setup_actor_character_sprites?
- return @setup_actor_character_sprites_flag != nil
- end
- def setup_actor_character_sprites(characters)
- if !setup_actor_character_sprites?
- index_game_player = 0
- @character_sprites.each_index do |i|
- if @character_sprites[i].character.instance_of?(Game_Player)
- index_game_player = i
- break
- end
- end
- for character in characters.reverse
- @character_sprites.unshift(
- Sprite_Character.new(@viewport1, character)
- )
- end
- @setup_actor_character_sprites_flag = true
- end
- end
- end
- module Scene_Map_Module
- def setup_actor_character_sprites(characters)
- @spriteset.setup_actor_character_sprites(characters)
- end
- end
- module Game_Party_Module
- def set_transparent_actors(transparent)
- @transparent = transparent
- end
- def setup_actor_character_sprites
- if @characters == nil
- @characters = []
- for i in 1 ... TRAIN_ACTOR_SIZE_MAX
- @characters.push(Game_Party_Actor.new)
- end
- end
- for i in 1 ... TRAIN_ACTOR_SIZE_MAX
- @characters[i - 1].setup(actors[i])
- end
- if $scene.class.method_defined?('setup_actor_character_sprites')
- $scene.setup_actor_character_sprites(@characters)
- end
- end
- def update_party_actors
- setup_actor_character_sprites
- transparent = $game_player.transparent
- if transparent == false
- if TRANSPARENT_SWITCH
- transparent = $game_switches[TRANSPARENT_SWITCHES_INDEX]
- end
- end
- for character in @characters
- character.transparent = transparent
- character.move_speed = $game_player.move_speed
- character.step_anime = $game_player.step_anime
- character.update
- end
- end
- def moveto_party_actors( x, y )
- setup_actor_character_sprites
- for character in @characters
- character.moveto( x, y )
- end
- if @move_list == nil
- @move_list = []
- end
- move_list_setup
- end
- def move_party_actors
- if @move_list == nil
- @move_list = []
- move_list_setup
- end
- @move_list.each_index do |i|
- if @characters[i] != nil
- case @move_list[i].type
- when Input::DOWN
- @characters[i].move_down(@move_list[i].args[0])
- when Input::LEFT
- @characters[i].move_left(@move_list[i].args[0])
- when Input::RIGHT
- @characters[i].move_right(@move_list[i].args[0])
- when Input::UP
- @characters[i].move_up(@move_list[i].args[0])
- when DOWN_LEFT
- @characters[i].move_lower_left
- when DOWN_RIGHT
- @characters[i].move_lower_right
- when UP_LEFT
- @characters[i].move_upper_left
- when UP_RIGHT
- @characters[i].move_upper_right
- when JUMP
- @characters[i].jump(@move_list[i].args[0],@move_list[i].args[1])
- end
- end
- end
- end
- class Move_List_Element
- def initialize(type,args)
- @type = type
- @args = args
- end
- def type() return @type end
- def args() return @args end
- end
- def move_list_setup
- for i in 0 .. TRAIN_ACTOR_SIZE_MAX
- @move_list[i] = nil
- end
- end
- def add_move_list(type,*args)
- @move_list.unshift(Move_List_Element.new(type,args)).pop
- end
- def move_down_party_actors(turn_enabled = true)
- move_party_actors
- add_move_list(Input::DOWN,turn_enabled)
- end
- def move_left_party_actors(turn_enabled = true)
- move_party_actors
- add_move_list(Input::LEFT,turn_enabled)
- end
- def move_right_party_actors(turn_enabled = true)
- move_party_actors
- add_move_list(Input::RIGHT,turn_enabled)
- end
- def move_up_party_actors(turn_enabled = true)
- move_party_actors
- add_move_list(Input::UP,turn_enabled)
- end
- def move_lower_left_party_actors
- move_party_actors
- add_move_list(DOWN_LEFT)
- end
- def move_lower_right_party_actors
- move_party_actors
- add_move_list(DOWN_RIGHT)
- end
- def move_upper_left_party_actors
- move_party_actors
- add_move_list(UP_LEFT)
- end
- def move_upper_right_party_actors
- move_party_actors
- add_move_list(UP_RIGHT)
- end
- def jump_party_actors(x_plus, y_plus)
- move_party_actors
- add_move_list(JUMP,x_plus, y_plus)
- end
- end
- module Game_Player_Module
- def update
- $game_party.update_party_actors
- super
- end
- def moveto( x, y )
- $game_party.moveto_party_actors( x, y )
- super( x, y )
- end
- def move_down(turn_enabled = true)
- if passable?(@x, @y, Input::DOWN)
- $game_party.move_down_party_actors(turn_enabled)
- end
- super(turn_enabled)
- end
- def move_left(turn_enabled = true)
- if passable?(@x, @y, Input::LEFT)
- $game_party.move_left_party_actors(turn_enabled)
- end
- super(turn_enabled)
- end
- def move_right(turn_enabled = true)
- if passable?(@x, @y, Input::RIGHT)
- $game_party.move_right_party_actors(turn_enabled)
- end
- super(turn_enabled)
- end
- def move_up(turn_enabled = true)
- if passable?(@x, @y, Input::UP)
- $game_party.move_up_party_actors(turn_enabled)
- end
- super(turn_enabled)
- end
- def move_lower_left
- # 下→左、左→下 のどちらかのコースが通行可能な場合
- if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1, Input::LEFT)) or
- (passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y, Input::DOWN))
- $game_party.move_lower_left_party_actors
- end
- super
- end
- def move_lower_right
- # 下→右、右→下 のどちらかのコースが通行可能な場合
- if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1, Input::RIGHT)) or
- (passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y, Input::DOWN))
- $game_party.move_lower_right_party_actors
- end
- super
- end
- def move_upper_left
- # 上→左、左→上 のどちらかのコースが通行可能な場合
- if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1, Input::LEFT)) or
- (passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y, Input::UP))
- $game_party.move_upper_left_party_actors
- end
- super
- end
- def move_upper_right
- # 上→右、右→上 のどちらかのコースが通行可能な場合
- if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1, Input::RIGHT)) or
- (passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y, Input::UP))
- $game_party.move_upper_right_party_actors
- end
- super
- end
- def jump(x_plus, y_plus)
- # 新しい座標を計算
- new_x = @x + x_plus
- new_y = @y + y_plus
- # 加算値が (0,0) の場合か、ジャンプ先が通行可能な場合
- if (x_plus == 0 and y_plus == 0) or passable?(new_x, new_y, 0)
- $game_party.jump_party_actors(x_plus, y_plus)
- end
- super(x_plus, y_plus)
- end
- attr_reader :move_speed
- attr_reader :step_anime
- end
- end # module Train_Actor
- class Game_Party
- include Train_Actor::Game_Party_Module
- end
- class Game_Player
- include Train_Actor::Game_Player_Module
- end
- class Spriteset_Map
- include Train_Actor::Spriteset_Map_Module
- end
- class Scene_Map
- include Train_Actor::Scene_Map_Module
- end
- #==================================================================
- # 本脚本来自http://www.66rpg.com/,使用和转载请保留此信息
- #==================================================================
复制代码 顺便 @弗雷德 。。。。 |
评分
-
查看全部评分
|