Project1

标题: 来个高手解决个天气脚本问题 [打印本页]

作者: f985047727    时间: 2017-4-21 19:33
标题: 来个高手解决个天气脚本问题
本帖最后由 hys111111 于 2017-5-4 12:27 编辑

RUBY 代码复制
  1. #===========================
  2. # ccoa's weather script
  3. # with ideas by ScriptKitty and Mr.DJ
  4.  
  5. #===========================
  6. # Weather Types:类型
  7. # 1 - rain  雨
  8. # 2 - storm 风
  9. # 3 - snow 雪
  10. # 4 - hail  冰雹
  11. # 5 - rain with thunder and lightning  雷雨
  12. # 6 - falling leaves (autumn) 秋天的落叶
  13. # 7 - blowing leaves (autumn)         秋风扫落叶
  14. # 8 - swirling leaves (autumn) 旋转的树叶
  15. # 9 - falling leaves (green) 绿绿的落叶
  16. # 10 - cherry blossom (sakura) petals 樱花飞舞
  17. # 11 - rose petals 玫瑰花瓣雨
  18. # 12 - feathers 羽毛
  19. # 13 - blood rain 血雨
  20. # 14 - sparkles 闪烁
  21. # 15 - user defined 自己定义
  22. #
  23. # Weather Power:  强度 0-40  0为无天气
  24. # An integer from 0-40. 0 = no weather, 40 = 400 sprites
  25. #
  26. # Usage:使用方法
  27. # Create a call script with the following:
  28. # 调用这个脚本
  29. # $game_screen.weather(type, power, hue)
  30. # 比如:$game_screen.weather(14, 35, 0)
  31. #
  32. # Usage of user-defined weather:
  33. # Look at the following globals:
  34. # 自定义天气看下面的
  35.  
  36. $WEATHER_UPDATE = false
  37. # the $WEATHER_IMAGES array has changed, please update天气图象改变请改为true
  38. $WEATHER_IMAGES = []
  39. # the array of picture names to use用到的图片名字,默认无,所以上面不用刷新(他不是小方块!)
  40. $WEATHER_X = 1
  41. # the number of pixels the image should move horizontally (positive = right, negative = left)水平移动,正为右,负为左
  42. $WEATHER_Y = 5
  43. # the number of pizels the image should move vertically (positive = down, negative = up)垂直运动,正为下,负为上
  44. $WEATHER_FADE = 255
  45. # how much the image should fade each update (0 = no fade, 255 = fade instantly)淡出淡入,0为无,255为马上
  46. $WEATHER_ANIMATED = false
  47. # whether or not the image should cycle through all the images是否环绕?
  48.  
  49. module RPG
  50. class Weather
  51. def initialize(viewport = nil)
  52. @type = 0
  53. @max = 0
  54. @ox = 0
  55. @oy = 0
  56. @count = 0
  57. @current_pose = []
  58. @info = []
  59. @countarray = []
  60.  
  61. make_bitmaps
  62.  
  63. # **** ccoa ****
  64. for i in 1..500
  65. sprite = Sprite.new(viewport)
  66. #设天气为最高层
  67. sprite.z = 10000000
  68. sprite.visible = false
  69. sprite.opacity = 0
  70. @sprites.push(sprite)
  71. @current_pose.push(0)
  72. @info.push(rand(50))
  73. @countarray.push(rand(15))
  74. end
  75. end
  76.  
  77. def dispose
  78. for sprite in @sprites
  79. sprite.dispose
  80. end
  81. @rain_bitmap.dispose
  82. @storm_bitmap.dispose
  83. @snow_bitmap.dispose
  84. @hail_bitmap.dispose
  85. @petal_bitmap.dispose
  86. @blood_rain_bitmap.dispose
  87. for image in @autumn_leaf_bitmaps
  88. image.dispose
  89. end
  90. for image in @green_leaf_bitmaps
  91. image.dispose
  92. end
  93. for image in @rose_bitmaps
  94. image.dispose
  95. end
  96. for image in @feather_bitmaps
  97. image.dispose
  98. end
  99. for image in @sparkle_bitmaps
  100. image.dispose
  101. end
  102. for image in @user_bitmaps
  103. image.dispose
  104. end
  105. $WEATHER_UPDATE = true
  106. end
  107.  
  108. def type=(type)
  109. return if @type == type
  110. @type = type
  111. case @type
  112. when 1 # rain
  113. bitmap = @rain_bitmap
  114. when 2 # storm
  115. bitmap = @storm_bitmap
  116. when 3 # snow
  117. bitmap = @snow_bitmap
  118. when 4 # hail
  119. bitmap = @hail_bitmap
  120. when 5 # rain w/ thunder and lightning
  121. bitmap = @rain_bitmap
  122. @thunder = true
  123. when 6 # falling autumn leaves
  124. bitmap = @autumn_leaf_bitmaps[0]
  125. when 7 # blowing autumn leaves
  126. bitmap = @autumn_leaf_bitmaps[0]
  127. when 8 # swirling autumn leaves
  128. bitmap = @autumn_leaf_bitmaps[0]
  129. when 9 # falling green leaves
  130. bitmap = @green_leaf_bitmaps[0]
  131. when 10 # sakura petals
  132. bitmap = @petal_bitmap
  133. when 11 # rose petals
  134. bitmap = @rose_bitmaps[0]
  135. when 12 # feathers
  136. bitmap = @feather_bitmaps[0]
  137. when 13 # blood rain
  138. bitmap = @blood_rain_bitmap
  139. when 14 # sparkles
  140. bitmap = @sparkle_bitmaps[0]
  141. when 15 # user-defined
  142. bitmap = @user_bitmaps[rand(@user_bitmaps.size)]
  143. else
  144. bitmap = nil
  145. end
  146. if @type != 5
  147. @thunder = false
  148. end
  149. # **** ccoa ****
  150. for i in 1..500
  151. sprite = @sprites[i]
  152. if sprite != nil
  153. sprite.visible = (i <= @max)
  154. sprite.bitmap = bitmap
  155. end
  156. end
  157. end
  158.  
  159. def ox=(ox)
  160. return if @ox == ox;
  161. @ox = ox
  162. for sprite in @sprites
  163. sprite.ox = @ox
  164. end
  165. end
  166.  
  167. def oy=(oy)
  168. return if @oy == oy;
  169. @oy = oy
  170. for sprite in @sprites
  171. sprite.oy = @oy
  172. end
  173. end
  174.  
  175. def max=(max)
  176. return if @max == max;
  177. # **** ccoa ****
  178. @max = [[max, 0].max, 500].min
  179. for i in 1..500
  180. sprite = @sprites[i]
  181. if sprite != nil
  182. sprite.visible = (i <= @max)
  183. end
  184. end
  185. end
  186.  
  187. def update
  188. return if @type == 0
  189. for i in 1..@max
  190. sprite = @sprites[i]
  191. if sprite == nil
  192. break
  193. end
  194. if @type == 1 or @type == 5 or @type == 13 # rain
  195. sprite.x -= 2
  196. sprite.y += 16
  197. sprite.opacity -= 8
  198. if @thunder and (rand(8000 - @max) == 0)
  199. $game_screen.start_flash(Color.new(255, 255, 255, 255), 5)
  200. Audio.se_play("Audio/SE/061-Thunderclap01")
  201. end
  202. end
  203. if @type == 2 # storm
  204. sprite.x -= 8
  205. sprite.y += 16
  206. sprite.opacity -= 12
  207. end
  208. if @type == 3 # snow
  209. sprite.x -= 2
  210. sprite.y += 8
  211. sprite.opacity -= 8
  212. end
  213. if @type == 4 # hail
  214. sprite.x -= 1
  215. sprite.y += 18
  216. sprite.opacity -= 15
  217. end
  218. if @type == 6 # falling autumn leaves
  219. @count = rand(20)
  220. if @count == 0
  221. sprite.bitmap = @autumn_leaf_bitmaps[@current_pose[i]]
  222. @current_pose[i] = (@current_pose[i] + 1) % @autumn_leaf_bitmaps.size
  223. end
  224. sprite.x -= 1
  225. sprite.y += 1
  226. end
  227. if @type == 7 # blowing autumn leaves
  228. @count = rand(20)
  229. if @count == 0
  230. sprite.bitmap = @autumn_leaf_bitmaps[@current_pose[i]]
  231. @current_pose[i] = (@current_pose[i] + 1) % @autumn_leaf_bitmaps.size
  232. end
  233. sprite.x -= 10
  234. sprite.y += (rand(4) - 2)
  235. end
  236. if @type == 8 # swirling autumn leaves
  237. @count = rand(20)
  238. if @count == 0
  239. sprite.bitmap = @autumn_leaf_bitmaps[@current_pose[i]]
  240. @current_pose[i] = (@current_pose[i] + 1) % @autumn_leaf_bitmaps.size
  241. end
  242. if @info[i] != 0
  243. if @info[i] >= 1 and @info[i] <= 10
  244. sprite.x -= 3
  245. sprite.y -= 1
  246. elsif @info[i] >= 11 and @info[i] <= 16
  247. sprite.x -= 1
  248. sprite.y -= 2
  249. elsif @info[i] >= 17 and @info[i] <= 20
  250. sprite.y -= 3
  251. elsif @info[i] >= 21 and @info[i] <= 30
  252. sprite.y -= 2
  253. sprite.x += 1
  254. elsif @info[i] >= 31 and @info[i] <= 36
  255. sprite.y -= 1
  256. sprite.x += 3
  257. elsif @info[i] >= 37 and @info[i] <= 40
  258. sprite.x += 5
  259. elsif @info[i] >= 41 and @info[i] <= 46
  260. sprite.y += 1
  261. sprite.x += 3
  262. elsif @info[i] >= 47 and @info[i] <= 58
  263. sprite.y += 2
  264. sprite.x += 1
  265. elsif @info[i] >= 59 and @info[i] <= 64
  266. sprite.y += 3
  267. elsif @info[i] >= 65 and @info[i] <= 70
  268. sprite.x -= 1
  269. sprite.y += 2
  270. elsif @info[i] >= 71 and @info[i] <= 81
  271. sprite.x -= 3
  272. sprite.y += 1
  273. elsif @info[i] >= 82 and @info[i] <= 87
  274. sprite.x -= 5
  275. end
  276. @info[i] = (@info[i] + 1) % 88
  277. else
  278. if rand(200) == 0
  279. @info[i] = 1
  280. end
  281. sprite.x -= 5
  282. sprite.y += 1
  283. end
  284. end
  285. if @type == 9 # falling green leaves
  286. if @countarray[i] == 0
  287. @current_pose[i] = (@current_pose[i] + 1) % @green_leaf_bitmaps.size
  288. sprite.bitmap = @green_leaf_bitmaps[@current_pose[i]]
  289. @countarray[i] = rand(15)
  290. end
  291. @countarray[i] = (@countarray[i] + 1) % 15
  292. sprite.y += 1
  293. end
  294. if @type == 10 # sakura petals
  295. if @info[i] < 25
  296. sprite.x -= 1
  297. else
  298. sprite.x += 1
  299. end
  300. @info[i] = (@info[i] + 1) % 50
  301. sprite.y += 1
  302. end
  303. if @type == 11 # rose petals
  304. @count = rand(20)
  305. if @count == 0
  306. sprite.bitmap = @rose_bitmaps[@current_pose[i]]
  307. @current_pose[i] = (@current_pose[i] + 1) % @rose_bitmaps.size
  308. end
  309. if @info[i] % 2 == 0
  310. if @info[i] < 10
  311. sprite.x -= 1
  312. else
  313. sprite.x += 1
  314. end
  315. end
  316. sprite.y += 1
  317. end
  318. if @type == 12 # feathers
  319. if @countarray[i] == 0
  320. @current_pose[i] = (@current_pose[i] + 1) % @feather_bitmaps.size
  321. sprite.bitmap = @feather_bitmaps[@current_pose[i]]
  322. end
  323. @countarray[i] = (@countarray[i] + 1) % 15
  324. if rand(100) == 0
  325. sprite.x -= 1
  326. end
  327. if rand(100) == 0
  328. sprite.y -= 1
  329. end
  330. if @info[i] < 50
  331. if rand(2) == 0
  332. sprite.x -= 1
  333. else
  334. sprite.y -= 1
  335. end
  336. else
  337. if rand(2) == 0
  338. sprite.x += 1
  339. else
  340. sprite.y += 1
  341. end
  342. end
  343. @info[i] = (@info[i] + 1) % 100
  344. end
  345. if @type == 14 # sparkles
  346. if @countarray[i] == 0
  347. @current_pose[i] = (@current_pose[i] + 1) % @sparkle_bitmaps.size
  348. sprite.bitmap = @sparkle_bitmaps[@current_pose[i]]
  349. end
  350. @countarray[i] = (@countarray[i] + 1) % 15
  351. sprite.y += 1
  352. sprite.opacity -= 1
  353. end
  354. if @type == 15 # user-defined
  355. if $WEATHER_UPDATE
  356. update_user_defined
  357. $WEATHER_UPDATE = false
  358. end
  359. if $WEATHER_ANIMATED and @countarray[i] == 0
  360. @current_pose[i] = (@current_pose[i] + 1) % @user_bitmaps.size
  361. sprite.bitmap = @user_bitmaps[@current_pose[i]]
  362. end
  363. @countarray[i] = (@countarray[i] + 1) % 15
  364. sprite.x += $WEATHER_X
  365. sprite.y += $WEATHER_Y
  366. sprite.opacity -= $WEATHER_FADE
  367. end
  368.  
  369. x = sprite.x - @ox
  370. y = sprite.y - @oy
  371. if sprite.opacity < 64 or x < -50 or x > 750 or y < -300 or y > 500
  372. sprite.x = rand(800) - 50 + @ox
  373. sprite.y = rand(800) - 200 + @oy
  374. sprite.opacity = 255
  375. end
  376. end
  377. end
  378.  
  379. def make_bitmaps
  380. color1 = Color.new(255, 255, 255, 255)
  381. color2 = Color.new(255, 255, 255, 128)
  382. @rain_bitmap = Bitmap.new(7, 56)
  383. for i in 0..6
  384. @rain_bitmap.fill_rect(6-i, i*8, 1, 8, color1)
  385. end
  386. @storm_bitmap = Bitmap.new(34, 64)
  387. for i in 0..31
  388. @storm_bitmap.fill_rect(33-i, i*2, 1, 2, color2)
  389. @storm_bitmap.fill_rect(32-i, i*2, 1, 2, color1)
  390. @storm_bitmap.fill_rect(31-i, i*2, 1, 2, color2)
  391. end
  392. @snow_bitmap = Bitmap.new(6, 6)
  393. @snow_bitmap.fill_rect(0, 1, 6, 4, color2)
  394. @snow_bitmap.fill_rect(1, 0, 4, 6, color2)
  395. @snow_bitmap.fill_rect(1, 2, 4, 2, color1)
  396. @snow_bitmap.fill_rect(2, 1, 2, 4, color1)
  397. @sprites = []
  398.  
  399. blueGrey = Color.new(215, 227, 227, 150)
  400. grey = Color.new(214, 217, 217, 150)
  401. lightGrey = Color.new(233, 233, 233, 250)
  402. lightBlue = Color.new(222, 239, 243, 250)
  403. @hail_bitmap = Bitmap.new(4, 4)
  404. @hail_bitmap.fill_rect(1, 0, 2, 1, blueGrey)
  405. @hail_bitmap.fill_rect(0, 1, 1, 2, blueGrey)
  406. @hail_bitmap.fill_rect(3, 1, 1, 2, grey)
  407. @hail_bitmap.fill_rect(1, 3, 2, 1, grey)
  408. @hail_bitmap.fill_rect(1, 1, 2, 2, lightGrey)
  409. @hail_bitmap.set_pixel(1, 1, lightBlue)
  410.  
  411.  
  412. color3 = Color.new(255, 167, 192, 255) # light pink
  413. color4 = Color.new(213, 106, 136, 255) # dark pink
  414. @petal_bitmap = Bitmap.new(4, 4) #This creates a new bitmap that is 4 x 4 pixels
  415. @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)
  416. @petal_bitmap.fill_rect(1, 2, 1, 1, color3)
  417. @petal_bitmap.fill_rect(2, 1, 1, 1, color3)
  418. @petal_bitmap.fill_rect(3, 0, 1, 1, color3)
  419. @petal_bitmap.fill_rect(1, 3, 1, 1, color4)
  420. @petal_bitmap.fill_rect(2, 2, 1, 1, color4)
  421. @petal_bitmap.fill_rect(3, 1, 1, 1, color4)
  422.  
  423.  
  424. brightOrange = Color.new(248, 88, 0, 255)
  425. orangeBrown = Color.new(144, 80, 56, 255)
  426. burntRed = Color.new(152, 0, 0, 255)
  427. paleOrange = Color.new(232, 160, 128, 255)
  428. darkBrown = Color.new(72, 40, 0, 255)
  429. @autumn_leaf_bitmaps = []
  430. @autumn_leaf_bitmaps.push(Bitmap.new(8, 8))
  431. # draw the first of the leaf1 bitmaps
  432. @autumn_leaf_bitmaps[0].set_pixel(5, 1, orangeBrown)
  433. @autumn_leaf_bitmaps[0].set_pixel(6, 1, brightOrange)
  434. @autumn_leaf_bitmaps[0].set_pixel(7, 1, paleOrange)
  435. @autumn_leaf_bitmaps[0].set_pixel(3, 2, orangeBrown)
  436. @autumn_leaf_bitmaps[0].fill_rect(4, 2, 2, 1, brightOrange)
  437. @autumn_leaf_bitmaps[0].set_pixel(6, 2, paleOrange)
  438. @autumn_leaf_bitmaps[0].set_pixel(2, 3, orangeBrown)
  439. @autumn_leaf_bitmaps[0].set_pixel(3, 3, brightOrange)
  440. @autumn_leaf_bitmaps[0].fill_rect(4, 3, 2, 1, paleOrange)
  441. @autumn_leaf_bitmaps[0].set_pixel(1, 4, orangeBrown)
  442. @autumn_leaf_bitmaps[0].set_pixel(2, 4, brightOrange)
  443. @autumn_leaf_bitmaps[0].set_pixel(3, 4, paleOrange)
  444. @autumn_leaf_bitmaps[0].set_pixel(1, 5, brightOrange)
  445. @autumn_leaf_bitmaps[0].set_pixel(2, 5, paleOrange)
  446. @autumn_leaf_bitmaps[0].set_pixel(0, 6, orangeBrown)
  447. @autumn_leaf_bitmaps[0].set_pixel(1, 6, paleOrange)
  448. @autumn_leaf_bitmaps[0].set_pixel(0, 7, paleOrange)
  449.  
  450. # draw the 2nd of the leaf1 bitmaps
  451. @autumn_leaf_bitmaps.push(Bitmap.new(8, 8))
  452. @autumn_leaf_bitmaps[1].set_pixel(3, 0, brightOrange)
  453. @autumn_leaf_bitmaps[1].set_pixel(7, 0, brightOrange)
  454. @autumn_leaf_bitmaps[1].set_pixel(3, 1, orangeBrown)
  455. @autumn_leaf_bitmaps[1].set_pixel(4, 1, burntRed)
  456. @autumn_leaf_bitmaps[1].set_pixel(6, 1, brightOrange)
  457. @autumn_leaf_bitmaps[1].set_pixel(0, 2, paleOrange)
  458. @autumn_leaf_bitmaps[1].set_pixel(1, 2, brightOrange)
  459. @autumn_leaf_bitmaps[1].set_pixel(2, 2, orangeBrown)
  460. @autumn_leaf_bitmaps[1].set_pixel(3, 2, burntRed)
  461. @autumn_leaf_bitmaps[1].set_pixel(4, 2, orangeBrown)
  462. @autumn_leaf_bitmaps[1].set_pixel(5, 2, brightOrange)
  463. @autumn_leaf_bitmaps[1].fill_rect(1, 3, 3, 1, orangeBrown)
  464. @autumn_leaf_bitmaps[1].fill_rect(4, 3, 2, 1, brightOrange)
  465. @autumn_leaf_bitmaps[1].set_pixel(6, 3, orangeBrown)
  466. @autumn_leaf_bitmaps[1].set_pixel(2, 4, burntRed)
  467. @autumn_leaf_bitmaps[1].fill_rect(3, 4, 3, 1, brightOrange)
  468. @autumn_leaf_bitmaps[1].set_pixel(6, 4, burntRed)
  469. @autumn_leaf_bitmaps[1].set_pixel(7, 4, darkBrown)
  470. @autumn_leaf_bitmaps[1].set_pixel(1, 5, orangeBrown)
  471. @autumn_leaf_bitmaps[1].fill_rect(2, 5, 2, 1, brightOrange)
  472. @autumn_leaf_bitmaps[1].set_pixel(4, 5, orangeBrown)
  473. @autumn_leaf_bitmaps[1].set_pixel(5, 5, burntRed)
  474. @autumn_leaf_bitmaps[1].fill_rect(1, 6, 2, 1, brightOrange)
  475. @autumn_leaf_bitmaps[1].fill_rect(4, 6, 2, 1, burntRed)
  476. @autumn_leaf_bitmaps[1].set_pixel(0, 7, brightOrange)
  477. @autumn_leaf_bitmaps[1].set_pixel(5, 7, darkBrown)
  478.  
  479. # draw the 3rd of the leaf1 bitmaps
  480. @autumn_leaf_bitmaps.push(Bitmap.new(8, 8))
  481. @autumn_leaf_bitmaps[2].set_pixel(7, 1, paleOrange)
  482. @autumn_leaf_bitmaps[2].set_pixel(6, 2, paleOrange)
  483. @autumn_leaf_bitmaps[2].set_pixel(7, 2, orangeBrown)
  484. @autumn_leaf_bitmaps[2].set_pixel(5, 3, paleOrange)
  485. @autumn_leaf_bitmaps[2].set_pixel(6, 3, brightOrange)
  486. @autumn_leaf_bitmaps[2].set_pixel(4, 4, paleOrange)
  487. @autumn_leaf_bitmaps[2].set_pixel(5, 4, brightOrange)
  488. @autumn_leaf_bitmaps[2].set_pixel(6, 4, orangeBrown)
  489. @autumn_leaf_bitmaps[2].fill_rect(2, 5, 2, 1, paleOrange)
  490. @autumn_leaf_bitmaps[2].set_pixel(4, 5, brightOrange)
  491. @autumn_leaf_bitmaps[2].set_pixel(5, 5, orangeBrown)
  492. @autumn_leaf_bitmaps[2].set_pixel(1, 6, paleOrange)
  493. @autumn_leaf_bitmaps[2].fill_rect(2, 6, 2, 1, brightOrange)
  494. @autumn_leaf_bitmaps[2].set_pixel(4, 6, orangeBrown)
  495. @autumn_leaf_bitmaps[2].set_pixel(0, 7, paleOrange)
  496. @autumn_leaf_bitmaps[2].set_pixel(1, 7, brightOrange)
  497. @autumn_leaf_bitmaps[2].set_pixel(2, 7, orangeBrown)
  498.  
  499. # draw the 4th of the leaf1 bitmaps
  500. @autumn_leaf_bitmaps.push(Bitmap.new(8, 8))
  501. @autumn_leaf_bitmaps[3].set_pixel(3, 0, brightOrange)
  502. @autumn_leaf_bitmaps[3].set_pixel(7, 0, brightOrange)
  503. @autumn_leaf_bitmaps[3].set_pixel(3, 1, orangeBrown)
  504. @autumn_leaf_bitmaps[3].set_pixel(4, 1, burntRed)
  505. @autumn_leaf_bitmaps[3].set_pixel(6, 1, brightOrange)
  506. @autumn_leaf_bitmaps[3].set_pixel(0, 2, paleOrange)
  507. @autumn_leaf_bitmaps[3].set_pixel(1, 2, brightOrange)
  508. @autumn_leaf_bitmaps[3].set_pixel(2, 2, orangeBrown)
  509. @autumn_leaf_bitmaps[3].set_pixel(3, 2, burntRed)
  510. @autumn_leaf_bitmaps[3].set_pixel(4, 2, orangeBrown)
  511. @autumn_leaf_bitmaps[3].set_pixel(5, 2, brightOrange)
  512. @autumn_leaf_bitmaps[3].fill_rect(1, 3, 3, 1, orangeBrown)
  513. @autumn_leaf_bitmaps[3].fill_rect(4, 3, 2, 1, brightOrange)
  514. @autumn_leaf_bitmaps[3].set_pixel(6, 3, orangeBrown)
  515. @autumn_leaf_bitmaps[3].set_pixel(2, 4, burntRed)
  516. @autumn_leaf_bitmaps[3].fill_rect(3, 4, 3, 1, brightOrange)
  517. @autumn_leaf_bitmaps[3].set_pixel(6, 4, burntRed)
  518. @autumn_leaf_bitmaps[3].set_pixel(7, 4, darkBrown)
  519. @autumn_leaf_bitmaps[3].set_pixel(1, 5, orangeBrown)
  520. @autumn_leaf_bitmaps[3].fill_rect(2, 5, 2, 1, brightOrange)
  521. @autumn_leaf_bitmaps[3].set_pixel(4, 5, orangeBrown)
  522. @autumn_leaf_bitmaps[3].set_pixel(5, 5, burntRed)
  523. @autumn_leaf_bitmaps[3].fill_rect(1, 6, 2, 1, brightOrange)
  524. @autumn_leaf_bitmaps[3].fill_rect(4, 6, 2, 1, burntRed)
  525. @autumn_leaf_bitmaps[3].set_pixel(0, 7, brightOrange)
  526. @autumn_leaf_bitmaps[3].set_pixel(5, 7, darkBrown)
  527.  
  528. @green_leaf_bitmaps = []
  529. darkGreen = Color.new(62, 76, 31, 255)
  530. midGreen = Color.new(76, 91, 43, 255)
  531. khaki = Color.new(105, 114, 66, 255)
  532. lightGreen = Color.new(128, 136, 88, 255)
  533. mint = Color.new(146, 154, 106, 255)
  534.  
  535. # 1st leaf bitmap
  536. @green_leaf_bitmaps[0] = Bitmap.new(8, 8)
  537. @green_leaf_bitmaps[0].set_pixel(1, 0, darkGreen)
  538. @green_leaf_bitmaps[0].set_pixel(1, 1, midGreen)
  539. @green_leaf_bitmaps[0].set_pixel(2, 1, darkGreen)
  540. @green_leaf_bitmaps[0].set_pixel(2, 2, khaki)
  541. @green_leaf_bitmaps[0].set_pixel(3, 2, darkGreen)
  542. @green_leaf_bitmaps[0].set_pixel(4, 2, khaki)
  543. @green_leaf_bitmaps[0].fill_rect(2, 3, 3, 1, midGreen)
  544. @green_leaf_bitmaps[0].set_pixel(5, 3, khaki)
  545. @green_leaf_bitmaps[0].fill_rect(2, 4, 2, 1, midGreen)
  546. @green_leaf_bitmaps[0].set_pixel(4, 4, darkGreen)
  547. @green_leaf_bitmaps[0].set_pixel(5, 4, lightGreen)
  548. @green_leaf_bitmaps[0].set_pixel(6, 4, khaki)
  549. @green_leaf_bitmaps[0].set_pixel(3, 5, midGreen)
  550. @green_leaf_bitmaps[0].set_pixel(4, 5, darkGreen)
  551. @green_leaf_bitmaps[0].set_pixel(5, 5, khaki)
  552. @green_leaf_bitmaps[0].set_pixel(6, 5, lightGreen)
  553. @green_leaf_bitmaps[0].set_pixel(4, 6, midGreen)
  554. @green_leaf_bitmaps[0].set_pixel(5, 6, darkGreen)
  555. @green_leaf_bitmaps[0].set_pixel(6, 6, lightGreen)
  556. @green_leaf_bitmaps[0].set_pixel(6, 7, khaki)
  557.  
  558. # 2nd leaf bitmap
  559. @green_leaf_bitmaps[1] = Bitmap.new(8, 8)
  560. @green_leaf_bitmaps[1].fill_rect(1, 1, 1, 2, midGreen)
  561. @green_leaf_bitmaps[1].fill_rect(2, 2, 2, 1, khaki)
  562. @green_leaf_bitmaps[1].set_pixel(4, 2, lightGreen)
  563. @green_leaf_bitmaps[1].fill_rect(2, 3, 2, 1, darkGreen)
  564. @green_leaf_bitmaps[1].fill_rect(4, 3, 2, 1, lightGreen)
  565. @green_leaf_bitmaps[1].set_pixel(2, 4, midGreen)
  566. @green_leaf_bitmaps[1].set_pixel(3, 4, darkGreen)
  567. @green_leaf_bitmaps[1].set_pixel(4, 4, khaki)
  568. @green_leaf_bitmaps[1].fill_rect(5, 4, 2, 1, lightGreen)
  569. @green_leaf_bitmaps[1].set_pixel(3, 5, midGreen)
  570. @green_leaf_bitmaps[1].set_pixel(4, 5, darkGreen)
  571. @green_leaf_bitmaps[1].set_pixel(5, 5, khaki)
  572. @green_leaf_bitmaps[1].set_pixel(6, 5, lightGreen)
  573. @green_leaf_bitmaps[1].set_pixel(5, 6, darkGreen)
  574. @green_leaf_bitmaps[1].fill_rect(6, 6, 2, 1, khaki)
  575.  
  576. # 3rd leaf bitmap
  577. @green_leaf_bitmaps[2] = Bitmap.new(8, 8)
  578. @green_leaf_bitmaps[2].set_pixel(1, 1, darkGreen)
  579. @green_leaf_bitmaps[2].fill_rect(1, 2, 2, 1, midGreen)
  580. @green_leaf_bitmaps[2].set_pixel(2, 3, midGreen)
  581. @green_leaf_bitmaps[2].set_pixel(3, 3, darkGreen)
  582. @green_leaf_bitmaps[2].set_pixel(4, 3, midGreen)
  583. @green_leaf_bitmaps[2].fill_rect(2, 4, 2, 1, midGreen)
  584. @green_leaf_bitmaps[2].set_pixel(4, 4, darkGreen)
  585. @green_leaf_bitmaps[2].set_pixel(5, 4, lightGreen)
  586. @green_leaf_bitmaps[2].set_pixel(3, 5, midGreen)
  587. @green_leaf_bitmaps[2].set_pixel(4, 5, darkGreen)
  588. @green_leaf_bitmaps[2].fill_rect(5, 5, 2, 1, khaki)
  589. @green_leaf_bitmaps[2].fill_rect(4, 6, 2, 1, midGreen)
  590. @green_leaf_bitmaps[2].set_pixel(6, 6, lightGreen)
  591. @green_leaf_bitmaps[2].set_pixel(6, 7, khaki)
  592.  
  593. # 4th leaf bitmap
  594. @green_leaf_bitmaps[3] = Bitmap.new(8, 8)
  595. @green_leaf_bitmaps[3].fill_rect(0, 3, 1, 2, darkGreen)
  596. @green_leaf_bitmaps[3].set_pixel(1, 4, midGreen)
  597. @green_leaf_bitmaps[3].set_pixel(2, 4, khaki)
  598. @green_leaf_bitmaps[3].set_pixel(3, 4, lightGreen)
  599. @green_leaf_bitmaps[3].set_pixel(4, 4, darkGreen)
  600. @green_leaf_bitmaps[3].set_pixel(7, 4, midGreen)
  601. @green_leaf_bitmaps[3].set_pixel(1, 5, darkGreen)
  602. @green_leaf_bitmaps[3].set_pixel(2, 5, midGreen)
  603. @green_leaf_bitmaps[3].set_pixel(3, 5, lightGreen)
  604. @green_leaf_bitmaps[3].set_pixel(4, 5, mint)
  605. @green_leaf_bitmaps[3].set_pixel(5, 5, lightGreen)
  606. @green_leaf_bitmaps[3].set_pixel(6, 5, khaki)
  607. @green_leaf_bitmaps[3].set_pixel(7, 5, midGreen)
  608. @green_leaf_bitmaps[3].fill_rect(2, 6, 2, 1, midGreen)
  609. @green_leaf_bitmaps[3].set_pixel(4, 6, lightGreen)
  610. @green_leaf_bitmaps[3].set_pixel(5, 6, khaki)
  611. @green_leaf_bitmaps[3].set_pixel(6, 6, midGreen)
  612.  
  613. # 5th leaf bitmap
  614. @green_leaf_bitmaps[4] = Bitmap.new(8, 8)
  615. @green_leaf_bitmaps[4].set_pixel(6, 2, midGreen)
  616. @green_leaf_bitmaps[4].set_pixel(7, 2, darkGreen)
  617. @green_leaf_bitmaps[4].fill_rect(4, 3, 2, 1, midGreen)
  618. @green_leaf_bitmaps[4].set_pixel(6, 3, khaki)
  619. @green_leaf_bitmaps[4].set_pixel(2, 4, darkGreen)
  620. @green_leaf_bitmaps[4].fill_rect(3, 4, 2, 1, khaki)
  621. @green_leaf_bitmaps[4].set_pixel(5, 4, lightGreen)
  622. @green_leaf_bitmaps[4].set_pixel(6, 4, khaki)
  623. @green_leaf_bitmaps[4].set_pixel(1, 5, midGreen)
  624. @green_leaf_bitmaps[4].set_pixel(2, 5, khaki)
  625. @green_leaf_bitmaps[4].set_pixel(3, 5, lightGreen)
  626. @green_leaf_bitmaps[4].set_pixel(4, 5, mint)
  627. @green_leaf_bitmaps[4].set_pixel(5, 5, midGreen)
  628. @green_leaf_bitmaps[4].set_pixel(2, 6, darkGreen)
  629. @green_leaf_bitmaps[4].fill_rect(3, 6, 2, 1, midGreen)
  630.  
  631. # 6th leaf bitmap
  632. @green_leaf_bitmaps[5] = Bitmap.new(8, 8)
  633. @green_leaf_bitmaps[5].fill_rect(6, 2, 2, 1, midGreen)
  634. @green_leaf_bitmaps[5].fill_rect(4, 3, 2, 1, midGreen)
  635. @green_leaf_bitmaps[5].set_pixel(6, 3, khaki)
  636. @green_leaf_bitmaps[5].set_pixel(3, 4, midGreen)
  637. @green_leaf_bitmaps[5].set_pixel(4, 4, khaki)
  638. @green_leaf_bitmaps[5].set_pixel(5, 4, lightGreen)
  639. @green_leaf_bitmaps[5].set_pixel(6, 4, mint)
  640. @green_leaf_bitmaps[5].set_pixel(1, 5, midGreen)
  641. @green_leaf_bitmaps[5].set_pixel(2, 5, khaki)
  642. @green_leaf_bitmaps[5].fill_rect(3, 5, 2, 1, mint)
  643. @green_leaf_bitmaps[5].set_pixel(5, 5, lightGreen)
  644. @green_leaf_bitmaps[5].set_pixel(2, 6, midGreen)
  645. @green_leaf_bitmaps[5].set_pixel(3, 6, khaki)
  646. @green_leaf_bitmaps[5].set_pixel(4, 6, lightGreen)
  647.  
  648. # 7th leaf bitmap
  649. @green_leaf_bitmaps[6] = Bitmap.new(8, 8)
  650. @green_leaf_bitmaps[6].fill_rect(6, 1, 1, 2, midGreen)
  651. @green_leaf_bitmaps[6].fill_rect(4, 2, 2, 1, midGreen)
  652. @green_leaf_bitmaps[6].fill_rect(6, 2, 1, 2, darkGreen)
  653. @green_leaf_bitmaps[6].fill_rect(3, 3, 2, 1, midGreen)
  654. @green_leaf_bitmaps[6].set_pixel(5, 3, khaki)
  655. @green_leaf_bitmaps[6].set_pixel(2, 4, midGreen)
  656. @green_leaf_bitmaps[6].set_pixel(3, 4, khaki)
  657. @green_leaf_bitmaps[6].set_pixel(4, 4, lightGreen)
  658. @green_leaf_bitmaps[6].set_pixel(5, 4, midGreen)
  659. @green_leaf_bitmaps[6].set_pixel(1, 5, midGreen)
  660. @green_leaf_bitmaps[6].set_pixel(2, 5, khaki)
  661. @green_leaf_bitmaps[6].fill_rect(3, 5, 2, 1, midGreen)
  662. @green_leaf_bitmaps[6].set_pixel(1, 6, darkGreen)
  663. @green_leaf_bitmaps[6].set_pixel(2, 6, midGreen)
  664.  
  665. # 8th leaf bitmap
  666. @green_leaf_bitmaps[7] = Bitmap.new(8, 8)
  667. @green_leaf_bitmaps[7].set_pixel(6, 1, midGreen)
  668. @green_leaf_bitmaps[7].fill_rect(4, 2, 3, 2, midGreen)
  669. @green_leaf_bitmaps[7].set_pixel(3, 3, darkGreen)
  670. @green_leaf_bitmaps[7].set_pixel(2, 4, darkGreen)
  671. @green_leaf_bitmaps[7].set_pixel(3, 4, midGreen)
  672. @green_leaf_bitmaps[7].fill_rect(4, 4, 2, 1, khaki)
  673. @green_leaf_bitmaps[7].set_pixel(1, 5, darkGreen)
  674. @green_leaf_bitmaps[7].set_pixel(2, 5, midGreen)
  675. @green_leaf_bitmaps[7].fill_rect(3, 5, 2, 1, lightGreen)
  676. @green_leaf_bitmaps[7].set_pixel(2, 6, midGreen)
  677. @green_leaf_bitmaps[7].set_pixel(3, 6, lightGreen)
  678.  
  679. # 9th leaf bitmap
  680. @green_leaf_bitmaps[8] = Bitmap.new(8, 8)
  681. @green_leaf_bitmaps[8].fill_rect(6, 1, 1, 2, midGreen)
  682. @green_leaf_bitmaps[8].fill_rect(4, 2, 2, 1, midGreen)
  683. @green_leaf_bitmaps[8].fill_rect(6, 2, 1, 2, darkGreen)
  684. @green_leaf_bitmaps[8].fill_rect(3, 3, 2, 1, midGreen)
  685. @green_leaf_bitmaps[8].set_pixel(5, 3, khaki)
  686. @green_leaf_bitmaps[8].set_pixel(2, 4, midGreen)
  687. @green_leaf_bitmaps[8].set_pixel(3, 4, khaki)
  688. @green_leaf_bitmaps[8].set_pixel(4, 4, lightGreen)
  689. @green_leaf_bitmaps[8].set_pixel(5, 4, midGreen)
  690. @green_leaf_bitmaps[8].set_pixel(1, 5, midGreen)
  691. @green_leaf_bitmaps[8].set_pixel(2, 5, khaki)
  692. @green_leaf_bitmaps[8].fill_rect(3, 5, 2, 1, midGreen)
  693. @green_leaf_bitmaps[8].set_pixel(1, 6, darkGreen)
  694. @green_leaf_bitmaps[8].set_pixel(2, 6, midGreen)
  695.  
  696. # 10th leaf bitmap
  697. @green_leaf_bitmaps[9] = Bitmap.new(8, 8)
  698. @green_leaf_bitmaps[9].fill_rect(6, 2, 2, 1, midGreen)
  699. @green_leaf_bitmaps[9].fill_rect(4, 3, 2, 1, midGreen)
  700. @green_leaf_bitmaps[9].set_pixel(6, 3, khaki)
  701. @green_leaf_bitmaps[9].set_pixel(3, 4, midGreen)
  702. @green_leaf_bitmaps[9].set_pixel(4, 4, khaki)
  703. @green_leaf_bitmaps[9].set_pixel(5, 4, lightGreen)
  704. @green_leaf_bitmaps[9].set_pixel(6, 4, mint)
  705. @green_leaf_bitmaps[9].set_pixel(1, 5, midGreen)
  706. @green_leaf_bitmaps[9].set_pixel(2, 5, khaki)
  707. @green_leaf_bitmaps[9].fill_rect(3, 5, 2, 1, mint)
  708. @green_leaf_bitmaps[9].set_pixel(5, 5, lightGreen)
  709. @green_leaf_bitmaps[9].set_pixel(2, 6, midGreen)
  710. @green_leaf_bitmaps[9].set_pixel(3, 6, khaki)
  711. @green_leaf_bitmaps[9].set_pixel(4, 6, lightGreen)
  712.  
  713. # 11th leaf bitmap
  714. @green_leaf_bitmaps[10] = Bitmap.new(8, 8)
  715. @green_leaf_bitmaps[10].set_pixel(6, 2, midGreen)
  716. @green_leaf_bitmaps[10].set_pixel(7, 2, darkGreen)
  717. @green_leaf_bitmaps[10].fill_rect(4, 3, 2, 1, midGreen)
  718. @green_leaf_bitmaps[10].set_pixel(6, 3, khaki)
  719. @green_leaf_bitmaps[10].set_pixel(2, 4, darkGreen)
  720. @green_leaf_bitmaps[10].fill_rect(3, 4, 2, 1, khaki)
  721. @green_leaf_bitmaps[10].set_pixel(5, 4, lightGreen)
  722. @green_leaf_bitmaps[10].set_pixel(6, 4, khaki)
  723. @green_leaf_bitmaps[10].set_pixel(1, 5, midGreen)
  724. @green_leaf_bitmaps[10].set_pixel(2, 5, khaki)
  725. @green_leaf_bitmaps[10].set_pixel(3, 5, lightGreen)
  726. @green_leaf_bitmaps[10].set_pixel(4, 5, mint)
  727. @green_leaf_bitmaps[10].set_pixel(5, 5, midGreen)
  728. @green_leaf_bitmaps[10].set_pixel(2, 6, darkGreen)
  729. @green_leaf_bitmaps[10].fill_rect(3, 6, 2, 1, midGreen)
  730.  
  731.  
  732.  
  733. # 12th leaf bitmap
  734. @green_leaf_bitmaps[11] = Bitmap.new(8, 8)
  735. @green_leaf_bitmaps[11].fill_rect(0, 3, 1, 2, darkGreen)
  736. @green_leaf_bitmaps[11].set_pixel(1, 4, midGreen)
  737. @green_leaf_bitmaps[11].set_pixel(2, 4, khaki)
  738. @green_leaf_bitmaps[11].set_pixel(3, 4, lightGreen)
  739. @green_leaf_bitmaps[11].set_pixel(4, 4, darkGreen)
  740. @green_leaf_bitmaps[11].set_pixel(7, 4, midGreen)
  741. @green_leaf_bitmaps[11].set_pixel(1, 5, darkGreen)
  742. @green_leaf_bitmaps[11].set_pixel(2, 5, midGreen)
  743. @green_leaf_bitmaps[11].set_pixel(3, 5, lightGreen)
  744. @green_leaf_bitmaps[11].set_pixel(4, 5, mint)
  745. @green_leaf_bitmaps[11].set_pixel(5, 5, lightGreen)
  746. @green_leaf_bitmaps[11].set_pixel(6, 5, khaki)
  747. @green_leaf_bitmaps[11].set_pixel(7, 5, midGreen)
  748. @green_leaf_bitmaps[11].fill_rect(2, 6, 2, 1, midGreen)
  749. @green_leaf_bitmaps[11].set_pixel(4, 6, lightGreen)
  750. @green_leaf_bitmaps[11].set_pixel(5, 6, khaki)
  751. @green_leaf_bitmaps[11].set_pixel(6, 6, midGreen)
  752.  
  753. # 13th leaf bitmap
  754. @green_leaf_bitmaps[12] = Bitmap.new(8, 8)
  755. @green_leaf_bitmaps[12].set_pixel(1, 1, darkGreen)
  756. @green_leaf_bitmaps[12].fill_rect(1, 2, 2, 1, midGreen)
  757. @green_leaf_bitmaps[12].set_pixel(2, 3, midGreen)
  758. @green_leaf_bitmaps[12].set_pixel(3, 3, darkGreen)
  759. @green_leaf_bitmaps[12].set_pixel(4, 3, midGreen)
  760. @green_leaf_bitmaps[12].fill_rect(2, 4, 2, 1, midGreen)
  761. @green_leaf_bitmaps[12].set_pixel(4, 4, darkGreen)
  762. @green_leaf_bitmaps[12].set_pixel(5, 4, lightGreen)
  763. @green_leaf_bitmaps[12].set_pixel(3, 5, midGreen)
  764. @green_leaf_bitmaps[12].set_pixel(4, 5, darkGreen)
  765. @green_leaf_bitmaps[12].fill_rect(5, 5, 2, 1, khaki)
  766. @green_leaf_bitmaps[12].fill_rect(4, 6, 2, 1, midGreen)
  767. @green_leaf_bitmaps[12].set_pixel(6, 6, lightGreen)
  768. @green_leaf_bitmaps[12].set_pixel(6, 7, khaki)
  769.  
  770. @rose_bitmaps = []
  771. brightRed = Color.new(255, 0, 0, 255)
  772. midRed = Color.new(179, 17, 17, 255)
  773. darkRed = Color.new(141, 9, 9, 255)
  774.  
  775. # 1st rose petal bitmap
  776. @rose_bitmaps[0] = Bitmap.new(3, 3)
  777. @rose_bitmaps[0].fill_rect(1, 0, 2, 1, brightRed)
  778. @rose_bitmaps[0].fill_rect(0, 1, 1, 2, brightRed)
  779. @rose_bitmaps[0].fill_rect(1, 1, 2, 2, midRed)
  780. @rose_bitmaps[0].set_pixel(2, 2, darkRed)
  781.  
  782. # 2nd rose petal bitmap
  783. @rose_bitmaps[1] = Bitmap.new(3, 3)
  784. @rose_bitmaps[1].set_pixel(0, 1, midRed)
  785. @rose_bitmaps[1].set_pixel(1, 1, brightRed)
  786. @rose_bitmaps[1].fill_rect(1, 2, 1, 2, midRed)
  787.  
  788. @feather_bitmaps = []
  789. white = Color.new(255, 255, 255, 255)
  790.  
  791. # 1st feather bitmap
  792. @feather_bitmaps[0] = Bitmap.new(3, 3)
  793. @feather_bitmaps[0].set_pixel(0, 2, white)
  794. @feather_bitmaps[0].set_pixel(1, 2, grey)
  795. @feather_bitmaps[0].set_pixel(2, 1, grey)
  796.  
  797. # 2nd feather bitmap
  798. @feather_bitmaps[0] = Bitmap.new(3, 3)
  799. @feather_bitmaps[0].set_pixel(0, 0, white)
  800. @feather_bitmaps[0].set_pixel(0, 1, grey)
  801. @feather_bitmaps[0].set_pixel(1, 2, grey)
  802.  
  803. # 3rd feather bitmap
  804. @feather_bitmaps[0] = Bitmap.new(3, 3)
  805. @feather_bitmaps[0].set_pixel(2, 0, white)
  806. @feather_bitmaps[0].set_pixel(1, 0, grey)
  807. @feather_bitmaps[0].set_pixel(0, 1, grey)
  808.  
  809. # 4th feather bitmap
  810. @feather_bitmaps[0] = Bitmap.new(3, 3)
  811. @feather_bitmaps[0].set_pixel(2, 2, white)
  812. @feather_bitmaps[0].set_pixel(2, 1, grey)
  813. @feather_bitmaps[0].set_pixel(1, 0, grey)
  814.  
  815. @blood_rain_bitmap = Bitmap.new(7, 56)
  816. for i in 0..6
  817. @blood_rain_bitmap.fill_rect(6-i, i*8, 1, 8, darkRed)
  818. end
  819.  
  820. @sparkle_bitmaps = []
  821.  
  822. lightBlue = Color.new(181, 244, 255, 255)
  823. midBlue = Color.new(126, 197, 235, 255)
  824. darkBlue = Color.new(77, 136, 225, 255)
  825.  
  826. # 1st sparkle bitmap
  827. @sparkle_bitmaps[0] = Bitmap.new(7, 7)
  828. @sparkle_bitmaps[0].set_pixel(3, 3, darkBlue)
  829.  
  830. # 2nd sparkle bitmap
  831. @sparkle_bitmaps[1] = Bitmap.new(7, 7)
  832. @sparkle_bitmaps[1].fill_rect(3, 2, 1, 3, darkBlue)
  833. @sparkle_bitmaps[1].fill_rect(2, 3, 3, 1, darkBlue)
  834. @sparkle_bitmaps[1].set_pixel(3, 3, midBlue)
  835.  
  836. # 3rd sparkle bitmap
  837. @sparkle_bitmaps[2] = Bitmap.new(7, 7)
  838. @sparkle_bitmaps[2].set_pixel(1, 1, darkBlue)
  839. @sparkle_bitmaps[2].set_pixel(5, 1, darkBlue)
  840. @sparkle_bitmaps[2].set_pixel(2, 2, midBlue)
  841. @sparkle_bitmaps[2].set_pixel(4, 2, midBlue)
  842. @sparkle_bitmaps[2].set_pixel(3, 3, lightBlue)
  843. @sparkle_bitmaps[2].set_pixel(2, 4, midBlue)
  844. @sparkle_bitmaps[2].set_pixel(4, 4, midBlue)
  845. @sparkle_bitmaps[2].set_pixel(1, 5, darkBlue)
  846. @sparkle_bitmaps[2].set_pixel(5, 5, darkBlue)
  847.  
  848. # 4th sparkle bitmap
  849. @sparkle_bitmaps[3] = Bitmap.new(7, 7)
  850. @sparkle_bitmaps[3].fill_rect(3, 1, 1, 5, darkBlue)
  851. @sparkle_bitmaps[3].fill_rect(1, 3, 5, 1, darkBlue)
  852. @sparkle_bitmaps[3].fill_rect(3, 2, 1, 3, midBlue)
  853. @sparkle_bitmaps[3].fill_rect(2, 3, 3, 1, midBlue)
  854. @sparkle_bitmaps[3].set_pixel(3, 3, lightBlue)
  855.  
  856. # 5th sparkle bitmap
  857. @sparkle_bitmaps[4] = Bitmap.new(7, 7)
  858. @sparkle_bitmaps[4].fill_rect(2, 2, 3, 3, midBlue)
  859. @sparkle_bitmaps[4].fill_rect(3, 2, 1, 3, darkBlue)
  860. @sparkle_bitmaps[4].fill_rect(2, 3, 3, 1, darkBlue)
  861. @sparkle_bitmaps[4].set_pixel(3, 3, lightBlue)
  862. @sparkle_bitmaps[4].set_pixel(1, 1, darkBlue)
  863. @sparkle_bitmaps[4].set_pixel(5, 1, darkBlue)
  864. @sparkle_bitmaps[4].set_pixel(1, 5, darkBlue)
  865. @sparkle_bitmaps[4].set_pixel(5, 1, darkBlue)
  866.  
  867. # 6th sparkle bitmap
  868. @sparkle_bitmaps[5] = Bitmap.new(7, 7)
  869. @sparkle_bitmaps[5].fill_rect(2, 1, 3, 5, darkBlue)
  870. @sparkle_bitmaps[5].fill_rect(1, 2, 5, 3, darkBlue)
  871. @sparkle_bitmaps[5].fill_rect(2, 2, 3, 3, midBlue)
  872. @sparkle_bitmaps[5].fill_rect(3, 1, 1, 5, midBlue)
  873. @sparkle_bitmaps[5].fill_rect(1, 3, 5, 1, midBlue)
  874. @sparkle_bitmaps[5].fill_rect(3, 2, 1, 3, lightBlue)
  875. @sparkle_bitmaps[5].fill_rect(2, 3, 3, 1, lightBlue)
  876. @sparkle_bitmaps[5].set_pixel(3, 3, white)
  877.  
  878. # 7th sparkle bitmap
  879. @sparkle_bitmaps[6] = Bitmap.new(7, 7)
  880. @sparkle_bitmaps[6].fill_rect(2, 1, 3, 5, midBlue)
  881. @sparkle_bitmaps[6].fill_rect(1, 2, 5, 3, midBlue)
  882. @sparkle_bitmaps[6].fill_rect(3, 0, 1, 7, darkBlue)
  883. @sparkle_bitmaps[6].fill_rect(0, 3, 7, 1, darkBlue)
  884. @sparkle_bitmaps[6].fill_rect(2, 2, 3, 3, lightBlue)
  885. @sparkle_bitmaps[6].fill_rect(3, 2, 1, 3, midBlue)
  886. @sparkle_bitmaps[6].fill_rect(2, 3, 3, 1, midBlue)
  887. @sparkle_bitmaps[6].set_pixel(3, 3, white)
  888.  
  889. @user_bitmaps = []
  890. update_user_defined
  891. end
  892.  
  893. def update_user_defined
  894. for image in @user_bitmaps
  895. image.dispose
  896. end
  897.  
  898. #user-defined bitmaps
  899. for name in $WEATHER_IMAGES
  900. @user_bitmaps.push(RPG::Cache.picture(name))
  901. end
  902. for sprite in @sprites
  903. sprite.bitmap = @user_bitmaps[rand(@user_bitmaps.size)]
  904. end
  905. end
  906.  
  907. attr_reader :type
  908. attr_reader :max
  909. attr_reader :ox
  910. attr_reader :oy
  911. end
  912. end



作者: f985047727    时间: 2017-4-21 19:34
自定义天气问题。脚本菜鸟,帮帮忙....
作者: guoxiaomi    时间: 2017-5-2 00:38
帮你把代码框加上了,详细说一下在使用这个脚本的有什么问题吧?




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1