赞 | 12 |
VIP | 54 |
好人卡 | 19 |
积分 | 81 |
经验 | 33991 |
最后登录 | 2020-4-22 |
在线时间 | 334 小时 |
Lv4.逐梦者
- 梦石
- 7
- 星屑
- 1113
- 在线时间
- 334 小时
- 注册时间
- 2008-1-28
- 帖子
- 1566
|
可以修改,但是直接“改”不行,必须要新立天气系统覆盖原有的系统。
天气是内部的,不在脚本编辑器中,在“帮助”里 游戏库-RGSS内部类-RPG::weather 可以找到,如下:- module RPG
- class Weather
- def initialize(viewport = nil)
- @type = 0
- [url=home.php?mod=space&uid=25307]@Max[/url] = 0
- @ox = 0
- @oy = 0
- 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 = []
- for i in 1..40
- sprite = Sprite.new(viewport)
- sprite.z = 1000
- sprite.visible = false
- sprite.opacity = 0
- @sprites.push(sprite)
- end
- end
- def dispose
- for sprite in @sprites
- sprite.dispose
- end
- @rain_bitmap.dispose
- @storm_bitmap.dispose
- @snow_bitmap.dispose
- end
- def type=(type)
- return if @type == type
- @type = type
- case @type
- when 1
- bitmap = @rain_bitmap
- when 2
- bitmap = @storm_bitmap
- when 3
- bitmap = @snow_bitmap
- else
- bitmap = nil
- end
- for i in 1..40
- 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 @max == max;
- @max = [[max, 0].max, 40].min
- for i in 1..40
- 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
- sprite.x -= 2
- sprite.y += 16
- sprite.opacity -= 8
- end
- if @type == 2
- sprite.x -= 8
- sprite.y += 16
- sprite.opacity -= 12
- end
- if @type == 3
- sprite.x -= 2
- sprite.y += 8
- sprite.opacity -= 8
- 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
- attr_reader :type
- attr_reader :max
- attr_reader :ox
- attr_reader :oy
- end
- end
复制代码 |
评分
-
查看全部评分
|