设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1843|回复: 2
打印 上一主题 下一主题

[已经过期] 天气脚本、颜色的修改、

[复制链接]

Lv1.梦旅人

梦石
0
星屑
48
在线时间
773 小时
注册时间
2012-4-5
帖子
223
跳转到指定楼层
1
发表于 2012-6-10 09:28:20 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
  1. #===========================
  2. # ccoa's weather script
  3. # with ideas by ScriptKitty and Mr.DJ

  4. #===========================
  5. # Weather Types:类型
  6. # 1 - rain  雨
  7. # 2 - storm 风
  8. # 3 - snow 雪
  9. # 4 - hail  冰雹
  10. # 5 - rain with thunder and lightning  雷雨
  11. # 6 - falling leaves (autumn) 秋天的落叶
  12. # 7 - blowing leaves (autumn)         秋风扫落叶
  13. # 8 - swirling leaves (autumn) 旋转的树叶
  14. # 9 - falling leaves (green) 绿绿的落叶
  15. # 10 - cherry blossom (sakura) petals 樱花飞舞
  16. # 11 - rose petals 玫瑰花瓣雨
  17. # 12 - feathers 羽毛
  18. # 13 - blood rain 血雨
  19. # 14 - sparkles 闪烁
  20. # 15 - user defined 自己定义
  21. #
  22. # Weather Power:  强度 0-40  0为无天气
  23. # An integer from 0-40. 0 = no weather, 40 = 400 sprites
  24. #
  25. # Usage:使用方法
  26. # Create a call script with the following:
  27. # 调用这个脚本
  28. # $game_screen.weather(type, power, hue)
  29. # 比如:$game_screen.weather(14, 35, 0)
  30. #
  31. # Usage of user-defined weather:
  32. # Look at the following globals:
  33. # 自定义天气看下面的

  34. $WEATHER_UPDATE = false
  35. # the $WEATHER_IMAGES array has changed, please update天气图象改变请改为true
  36. $WEATHER_IMAGES = []
  37. # the array of picture names to use用到的图片名字,默认无,所以上面不用刷新(他不是小方块!)
  38. $WEATHER_X = 0
  39. # the number of pixels the image should move horizontally (positive = right, negative = left)水平移动,正为右,负为左
  40. $WEATHER_Y = 0
  41. # the number of pizels the image should move vertically (positive = down, negative = up)垂直运动,正为下,负为上
  42. $WEATHER_FADE = 0
  43. # how much the image should fade each update (0 = no fade, 255 = fade instantly)淡出淡入,0为无,255为马上
  44. $WEATHER_ANIMATED = false
  45. # whether or not the image should cycle through all the images是否环绕?

  46. module RPG
  47. class Weather
  48. def initialize(viewport = nil)
  49. @type = 0
  50. @max = 0
  51. @ox = 0
  52. @oy = 0
  53. @count = 0
  54. @current_pose = []
  55. @info = []
  56. @countarray = []

  57. make_bitmaps

  58. # **** ccoa ****
  59. for i in 1..500
  60. sprite = Sprite.new(viewport)
  61. #设天气为最高层
  62. sprite.z = 10000000
  63. sprite.visible = false
  64. sprite.opacity = 0
  65. @sprites.push(sprite)
  66. @current_pose.push(0)
  67. @info.push(rand(50))
  68. @countarray.push(rand(15))
  69. end
  70. end

  71. def dispose
  72. for sprite in @sprites
  73. sprite.dispose
  74. end
  75. @rain_bitmap.dispose
  76. @storm_bitmap.dispose
  77. @snow_bitmap.dispose
  78. @hail_bitmap.dispose
  79. @petal_bitmap.dispose
  80. @blood_rain_bitmap.dispose
  81. for image in @autumn_leaf_bitmaps
  82. image.dispose
  83. end
  84. for image in @green_leaf_bitmaps
  85. image.dispose
  86. end
  87. for image in @rose_bitmaps
  88. image.dispose
  89. end
  90. for image in @feather_bitmaps
  91. image.dispose
  92. end
  93. for image in @sparkle_bitmaps
  94. image.dispose
  95. end
  96. for image in @user_bitmaps
  97. image.dispose
  98. end
  99. $WEATHER_UPDATE = true
  100. end

  101. def type=(type)
  102. return if @type == type
  103. @type = type
  104. case @type
  105. when 1 # rain
  106. bitmap = @rain_bitmap
  107. when 2 # storm
  108. bitmap = @storm_bitmap
  109. when 3 # snow
  110. bitmap = @snow_bitmap
  111. when 4 # hail
  112. bitmap = @hail_bitmap
  113. when 5 # rain w/ thunder and lightning
  114. bitmap = @rain_bitmap
  115. @thunder = true
  116. when 6 # falling autumn leaves
  117. bitmap = @autumn_leaf_bitmaps[0]
  118. when 7 # blowing autumn leaves
  119. bitmap = @autumn_leaf_bitmaps[0]
  120. when 8 # swirling autumn leaves
  121. bitmap = @autumn_leaf_bitmaps[0]
  122. when 9 # falling green leaves
  123. bitmap = @green_leaf_bitmaps[0]
  124. when 10 # sakura petals
  125. bitmap = @petal_bitmap
  126. when 11 # rose petals
  127. bitmap = @rose_bitmaps[0]
  128. when 12 # feathers
  129. bitmap = @feather_bitmaps[0]
  130. when 13 # blood rain
  131. bitmap = @blood_rain_bitmap
  132. when 14 # sparkles
  133. bitmap = @sparkle_bitmaps[0]
  134. when 15 # user-defined
  135. bitmap = @user_bitmaps[rand(@user_bitmaps.size)]
  136. else
  137. bitmap = nil
  138. end
  139. if @type != 5
  140. @thunder = false
  141. end
  142. # **** ccoa ****
  143. for i in 1..500
  144. sprite = @sprites[i]
  145. if sprite != nil
  146. sprite.visible = (i <= @max)
  147. sprite.bitmap = bitmap
  148. end
  149. end
  150. end

  151. def ox=(ox)
  152. return if @ox == ox;
  153. @ox = ox
  154. for sprite in @sprites
  155. sprite.ox = @ox
  156. end
  157. end

  158. def oy=(oy)
  159. return if @oy == oy;
  160. @oy = oy
  161. for sprite in @sprites
  162. sprite.oy = @oy
  163. end
  164. end

  165. def max=(max)
  166. return if @max == max;
  167. # **** ccoa ****
  168. @max = [[max, 0].max, 500].min
  169. for i in 1..500
  170. sprite = @sprites[i]
  171. if sprite != nil
  172. sprite.visible = (i <= @max)
  173. end
  174. end
  175. end

  176. def update
  177. return if @type == 0
  178. for i in 1..@max
  179. sprite = @sprites[i]
  180. if sprite == nil
  181. break
  182. end
  183. if @type == 1 or @type == 5 or @type == 13 # rain
  184. sprite.x -= 2
  185. sprite.y += 16
  186. sprite.opacity -= 8
  187. if @thunder and (rand(8000 - @max) == 0)
  188. $game_screen.start_flash(Color.new(255, 255, 255, 255), 5)
  189. Audio.se_play("Audio/SE/061-Thunderclap01")
  190. end
  191. end
  192. if @type == 2 # storm
  193. sprite.x -= 8
  194. sprite.y += 16
  195. sprite.opacity -= 12
  196. end
  197. if @type == 3 # snow
  198. sprite.x -= 2
  199. sprite.y += 8
  200. sprite.opacity -= 8
  201. end
  202. if @type == 4 # hail
  203. sprite.x -= 1
  204. sprite.y += 18
  205. sprite.opacity -= 15
  206. end
  207. if @type == 6 # falling autumn leaves
  208. @count = rand(20)
  209. if @count == 0
  210. sprite.bitmap = @autumn_leaf_bitmaps[@current_pose[i]]
  211. @current_pose[i] = (@current_pose[i] + 1) % @autumn_leaf_bitmaps.size
  212. end
  213. sprite.x -= 1
  214. sprite.y += 1
  215. end
  216. if @type == 7 # blowing autumn leaves
  217. @count = rand(20)
  218. if @count == 0
  219. sprite.bitmap = @autumn_leaf_bitmaps[@current_pose[i]]
  220. @current_pose[i] = (@current_pose[i] + 1) % @autumn_leaf_bitmaps.size
  221. end
  222. sprite.x -= 10
  223. sprite.y += (rand(4) - 2)
  224. end
  225. if @type == 8 # swirling autumn leaves
  226. @count = rand(20)
  227. if @count == 0
  228. sprite.bitmap = @autumn_leaf_bitmaps[@current_pose[i]]
  229. @current_pose[i] = (@current_pose[i] + 1) % @autumn_leaf_bitmaps.size
  230. end
  231. if @info[i] != 0
  232. if @info[i] >= 1 and @info[i] <= 10
  233. sprite.x -= 3
  234. sprite.y -= 1
  235. elsif @info[i] >= 11 and @info[i] <= 16
  236. sprite.x -= 1
  237. sprite.y -= 2
  238. elsif @info[i] >= 17 and @info[i] <= 20
  239. sprite.y -= 3
  240. elsif @info[i] >= 21 and @info[i] <= 30
  241. sprite.y -= 2
  242. sprite.x += 1
  243. elsif @info[i] >= 31 and @info[i] <= 36
  244. sprite.y -= 1
  245. sprite.x += 3
  246. elsif @info[i] >= 37 and @info[i] <= 40
  247. sprite.x += 5
  248. elsif @info[i] >= 41 and @info[i] <= 46
  249. sprite.y += 1
  250. sprite.x += 3
  251. elsif @info[i] >= 47 and @info[i] <= 58
  252. sprite.y += 2
  253. sprite.x += 1
  254. elsif @info[i] >= 59 and @info[i] <= 64
  255. sprite.y += 3
  256. elsif @info[i] >= 65 and @info[i] <= 70
  257. sprite.x -= 1
  258. sprite.y += 2
  259. elsif @info[i] >= 71 and @info[i] <= 81
  260. sprite.x -= 3
  261. sprite.y += 1
  262. elsif @info[i] >= 82 and @info[i] <= 87
  263. sprite.x -= 5
  264. end
  265. @info[i] = (@info[i] + 1) % 88
  266. else
  267. if rand(200) == 0
  268. @info[i] = 1
  269. end
  270. sprite.x -= 5
  271. sprite.y += 1
  272. end
  273. end
  274. if @type == 9 # falling green leaves
  275. if @countarray[i] == 0
  276. @current_pose[i] = (@current_pose[i] + 1) % @green_leaf_bitmaps.size
  277. sprite.bitmap = @green_leaf_bitmaps[@current_pose[i]]
  278. @countarray[i] = rand(15)
  279. end
  280. @countarray[i] = (@countarray[i] + 1) % 15
  281. sprite.y += 1
  282. end
  283. if @type == 10 # sakura petals
  284. if @info[i] < 25
  285. sprite.x -= 1
  286. else
  287. sprite.x += 1
  288. end
  289. @info[i] = (@info[i] + 1) % 50
  290. sprite.y += 1
  291. end
  292. if @type == 11 # rose petals
  293. @count = rand(20)
  294. if @count == 0
  295. sprite.bitmap = @rose_bitmaps[@current_pose[i]]
  296. @current_pose[i] = (@current_pose[i] + 1) % @rose_bitmaps.size
  297. end
  298. if @info[i] % 2 == 0
  299. if @info[i] < 10
  300. sprite.x -= 1
  301. else
  302. sprite.x += 1
  303. end
  304. end
  305. sprite.y += 1
  306. end
  307. if @type == 12 # feathers
  308. if @countarray[i] == 0
  309. @current_pose[i] = (@current_pose[i] + 1) % @feather_bitmaps.size
  310. sprite.bitmap = @feather_bitmaps[@current_pose[i]]
  311. end
  312. @countarray[i] = (@countarray[i] + 1) % 15
  313. if rand(100) == 0
  314. sprite.x -= 1
  315. end
  316. if rand(100) == 0
  317. sprite.y -= 1
  318. end
  319. if @info[i] < 50
  320. if rand(2) == 0
  321. sprite.x -= 1
  322. else
  323. sprite.y -= 1
  324. end
  325. else
  326. if rand(2) == 0
  327. sprite.x += 1
  328. else
  329. sprite.y += 1
  330. end
  331. end
  332. @info[i] = (@info[i] + 1) % 100
  333. end
  334. if @type == 14 # sparkles
  335. if @countarray[i] == 0
  336. @current_pose[i] = (@current_pose[i] + 1) % @sparkle_bitmaps.size
  337. sprite.bitmap = @sparkle_bitmaps[@current_pose[i]]
  338. end
  339. @countarray[i] = (@countarray[i] + 1) % 15
  340. sprite.y += 1
  341. sprite.opacity -= 1
  342. end
  343. if @type == 15 # user-defined
  344. if $WEATHER_UPDATE
  345. update_user_defined
  346. $WEATHER_UPDATE = false
  347. end
  348. if $WEATHER_ANIMATED and @countarray[i] == 0
  349. @current_pose[i] = (@current_pose[i] + 1) % @user_bitmaps.size
  350. sprite.bitmap = @user_bitmaps[@current_pose[i]]
  351. end
  352. @countarray[i] = (@countarray[i] + 1) % 15
  353. sprite.x += $WEATHER_X
  354. sprite.y += $WEATHER_Y
  355. sprite.opacity -= $WEATHER_FADE
  356. end

  357. x = sprite.x - @ox
  358. y = sprite.y - @oy
  359. if sprite.opacity < 64 or x < -50 or x > 750 or y < -300 or y > 500
  360. sprite.x = rand(800) - 50 + @ox
  361. sprite.y = rand(800) - 200 + @oy
  362. sprite.opacity = 255
  363. end
  364. end
  365. end

  366. def make_bitmaps
  367. color1 = Color.new(255, 255, 255, 255)
  368. color2 = Color.new(255, 255, 255, 128)
  369. @rain_bitmap = Bitmap.new(7, 56)
  370. for i in 0..6
  371. @rain_bitmap.fill_rect(6-i, i*8, 1, 8, color1)
  372. end
  373. @storm_bitmap = Bitmap.new(34, 64)
  374. for i in 0..31
  375. @storm_bitmap.fill_rect(33-i, i*2, 1, 2, color2)
  376. @storm_bitmap.fill_rect(32-i, i*2, 1, 2, color1)
  377. @storm_bitmap.fill_rect(31-i, i*2, 1, 2, color2)
  378. end
  379. @snow_bitmap = Bitmap.new(6, 6)
  380. @snow_bitmap.fill_rect(0, 1, 6, 4, color2)
  381. @snow_bitmap.fill_rect(1, 0, 4, 6, color2)
  382. @snow_bitmap.fill_rect(1, 2, 4, 2, color1)
  383. @snow_bitmap.fill_rect(2, 1, 2, 4, color1)
  384. @sprites = []

  385. blueGrey = Color.new(215, 227, 227, 150)
  386. grey = Color.new(214, 217, 217, 150)
  387. lightGrey = Color.new(233, 233, 233, 250)
  388. lightBlue = Color.new(222, 239, 243, 250)
  389. @hail_bitmap = Bitmap.new(4, 4)
  390. @hail_bitmap.fill_rect(1, 0, 2, 1, blueGrey)
  391. @hail_bitmap.fill_rect(0, 1, 1, 2, blueGrey)
  392. @hail_bitmap.fill_rect(3, 1, 1, 2, grey)
  393. @hail_bitmap.fill_rect(1, 3, 2, 1, grey)
  394. @hail_bitmap.fill_rect(1, 1, 2, 2, lightGrey)
  395. @hail_bitmap.set_pixel(1, 1, lightBlue)


  396. color3 = Color.new(255, 167, 192, 255) # light pink
  397. color4 = Color.new(213, 106, 136, 255) # dark pink
  398. @petal_bitmap = Bitmap.new(4, 4) #This creates a new bitmap that is 4 x 4 pixels
  399. @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)
  400. @petal_bitmap.fill_rect(1, 2, 1, 1, color3)
  401. @petal_bitmap.fill_rect(2, 1, 1, 1, color3)
  402. @petal_bitmap.fill_rect(3, 0, 1, 1, color3)
  403. @petal_bitmap.fill_rect(1, 3, 1, 1, color4)
  404. @petal_bitmap.fill_rect(2, 2, 1, 1, color4)
  405. @petal_bitmap.fill_rect(3, 1, 1, 1, color4)


  406. brightOrange = Color.new(248, 88, 0, 255)
  407. orangeBrown = Color.new(144, 80, 56, 255)
  408. burntRed = Color.new(152, 0, 0, 255)
  409. paleOrange = Color.new(232, 160, 128, 255)
  410. darkBrown = Color.new(72, 40, 0, 255)
  411. @autumn_leaf_bitmaps = []
  412. @autumn_leaf_bitmaps.push(Bitmap.new(8, 8))
  413. # draw the first of the leaf1 bitmaps
  414. @autumn_leaf_bitmaps[0].set_pixel(5, 1, orangeBrown)
  415. @autumn_leaf_bitmaps[0].set_pixel(6, 1, brightOrange)
  416. @autumn_leaf_bitmaps[0].set_pixel(7, 1, paleOrange)
  417. @autumn_leaf_bitmaps[0].set_pixel(3, 2, orangeBrown)
  418. @autumn_leaf_bitmaps[0].fill_rect(4, 2, 2, 1, brightOrange)
  419. @autumn_leaf_bitmaps[0].set_pixel(6, 2, paleOrange)
  420. @autumn_leaf_bitmaps[0].set_pixel(2, 3, orangeBrown)
  421. @autumn_leaf_bitmaps[0].set_pixel(3, 3, brightOrange)
  422. @autumn_leaf_bitmaps[0].fill_rect(4, 3, 2, 1, paleOrange)
  423. @autumn_leaf_bitmaps[0].set_pixel(1, 4, orangeBrown)
  424. @autumn_leaf_bitmaps[0].set_pixel(2, 4, brightOrange)
  425. @autumn_leaf_bitmaps[0].set_pixel(3, 4, paleOrange)
  426. @autumn_leaf_bitmaps[0].set_pixel(1, 5, brightOrange)
  427. @autumn_leaf_bitmaps[0].set_pixel(2, 5, paleOrange)
  428. @autumn_leaf_bitmaps[0].set_pixel(0, 6, orangeBrown)
  429. @autumn_leaf_bitmaps[0].set_pixel(1, 6, paleOrange)
  430. @autumn_leaf_bitmaps[0].set_pixel(0, 7, paleOrange)

  431. # draw the 2nd of the leaf1 bitmaps
  432. @autumn_leaf_bitmaps.push(Bitmap.new(8, 8))
  433. @autumn_leaf_bitmaps[1].set_pixel(3, 0, brightOrange)
  434. @autumn_leaf_bitmaps[1].set_pixel(7, 0, brightOrange)
  435. @autumn_leaf_bitmaps[1].set_pixel(3, 1, orangeBrown)
  436. @autumn_leaf_bitmaps[1].set_pixel(4, 1, burntRed)
  437. @autumn_leaf_bitmaps[1].set_pixel(6, 1, brightOrange)
  438. @autumn_leaf_bitmaps[1].set_pixel(0, 2, paleOrange)
  439. @autumn_leaf_bitmaps[1].set_pixel(1, 2, brightOrange)
  440. @autumn_leaf_bitmaps[1].set_pixel(2, 2, orangeBrown)
  441. @autumn_leaf_bitmaps[1].set_pixel(3, 2, burntRed)
  442. @autumn_leaf_bitmaps[1].set_pixel(4, 2, orangeBrown)
  443. @autumn_leaf_bitmaps[1].set_pixel(5, 2, brightOrange)
  444. @autumn_leaf_bitmaps[1].fill_rect(1, 3, 3, 1, orangeBrown)
  445. @autumn_leaf_bitmaps[1].fill_rect(4, 3, 2, 1, brightOrange)
  446. @autumn_leaf_bitmaps[1].set_pixel(6, 3, orangeBrown)
  447. @autumn_leaf_bitmaps[1].set_pixel(2, 4, burntRed)
  448. @autumn_leaf_bitmaps[1].fill_rect(3, 4, 3, 1, brightOrange)
  449. @autumn_leaf_bitmaps[1].set_pixel(6, 4, burntRed)
  450. @autumn_leaf_bitmaps[1].set_pixel(7, 4, darkBrown)
  451. @autumn_leaf_bitmaps[1].set_pixel(1, 5, orangeBrown)
  452. @autumn_leaf_bitmaps[1].fill_rect(2, 5, 2, 1, brightOrange)
  453. @autumn_leaf_bitmaps[1].set_pixel(4, 5, orangeBrown)
  454. @autumn_leaf_bitmaps[1].set_pixel(5, 5, burntRed)
  455. @autumn_leaf_bitmaps[1].fill_rect(1, 6, 2, 1, brightOrange)
  456. @autumn_leaf_bitmaps[1].fill_rect(4, 6, 2, 1, burntRed)
  457. @autumn_leaf_bitmaps[1].set_pixel(0, 7, brightOrange)
  458. @autumn_leaf_bitmaps[1].set_pixel(5, 7, darkBrown)

  459. # draw the 3rd of the leaf1 bitmaps
  460. @autumn_leaf_bitmaps.push(Bitmap.new(8, 8))
  461. @autumn_leaf_bitmaps[2].set_pixel(7, 1, paleOrange)
  462. @autumn_leaf_bitmaps[2].set_pixel(6, 2, paleOrange)
  463. @autumn_leaf_bitmaps[2].set_pixel(7, 2, orangeBrown)
  464. @autumn_leaf_bitmaps[2].set_pixel(5, 3, paleOrange)
  465. @autumn_leaf_bitmaps[2].set_pixel(6, 3, brightOrange)
  466. @autumn_leaf_bitmaps[2].set_pixel(4, 4, paleOrange)
  467. @autumn_leaf_bitmaps[2].set_pixel(5, 4, brightOrange)
  468. @autumn_leaf_bitmaps[2].set_pixel(6, 4, orangeBrown)
  469. @autumn_leaf_bitmaps[2].fill_rect(2, 5, 2, 1, paleOrange)
  470. @autumn_leaf_bitmaps[2].set_pixel(4, 5, brightOrange)
  471. @autumn_leaf_bitmaps[2].set_pixel(5, 5, orangeBrown)
  472. @autumn_leaf_bitmaps[2].set_pixel(1, 6, paleOrange)
  473. @autumn_leaf_bitmaps[2].fill_rect(2, 6, 2, 1, brightOrange)
  474. @autumn_leaf_bitmaps[2].set_pixel(4, 6, orangeBrown)
  475. @autumn_leaf_bitmaps[2].set_pixel(0, 7, paleOrange)
  476. @autumn_leaf_bitmaps[2].set_pixel(1, 7, brightOrange)
  477. @autumn_leaf_bitmaps[2].set_pixel(2, 7, orangeBrown)

  478. # draw the 4th of the leaf1 bitmaps
  479. @autumn_leaf_bitmaps.push(Bitmap.new(8, 8))
  480. @autumn_leaf_bitmaps[3].set_pixel(3, 0, brightOrange)
  481. @autumn_leaf_bitmaps[3].set_pixel(7, 0, brightOrange)
  482. @autumn_leaf_bitmaps[3].set_pixel(3, 1, orangeBrown)
  483. @autumn_leaf_bitmaps[3].set_pixel(4, 1, burntRed)
  484. @autumn_leaf_bitmaps[3].set_pixel(6, 1, brightOrange)
  485. @autumn_leaf_bitmaps[3].set_pixel(0, 2, paleOrange)
  486. @autumn_leaf_bitmaps[3].set_pixel(1, 2, brightOrange)
  487. @autumn_leaf_bitmaps[3].set_pixel(2, 2, orangeBrown)
  488. @autumn_leaf_bitmaps[3].set_pixel(3, 2, burntRed)
  489. @autumn_leaf_bitmaps[3].set_pixel(4, 2, orangeBrown)
  490. @autumn_leaf_bitmaps[3].set_pixel(5, 2, brightOrange)
  491. @autumn_leaf_bitmaps[3].fill_rect(1, 3, 3, 1, orangeBrown)
  492. @autumn_leaf_bitmaps[3].fill_rect(4, 3, 2, 1, brightOrange)
  493. @autumn_leaf_bitmaps[3].set_pixel(6, 3, orangeBrown)
  494. @autumn_leaf_bitmaps[3].set_pixel(2, 4, burntRed)
  495. @autumn_leaf_bitmaps[3].fill_rect(3, 4, 3, 1, brightOrange)
  496. @autumn_leaf_bitmaps[3].set_pixel(6, 4, burntRed)
  497. @autumn_leaf_bitmaps[3].set_pixel(7, 4, darkBrown)
  498. @autumn_leaf_bitmaps[3].set_pixel(1, 5, orangeBrown)
  499. @autumn_leaf_bitmaps[3].fill_rect(2, 5, 2, 1, brightOrange)
  500. @autumn_leaf_bitmaps[3].set_pixel(4, 5, orangeBrown)
  501. @autumn_leaf_bitmaps[3].set_pixel(5, 5, burntRed)
  502. @autumn_leaf_bitmaps[3].fill_rect(1, 6, 2, 1, brightOrange)
  503. @autumn_leaf_bitmaps[3].fill_rect(4, 6, 2, 1, burntRed)
  504. @autumn_leaf_bitmaps[3].set_pixel(0, 7, brightOrange)
  505. @autumn_leaf_bitmaps[3].set_pixel(5, 7, darkBrown)

  506. @green_leaf_bitmaps = []
  507. darkGreen = Color.new(62, 76, 31, 255)
  508. midGreen = Color.new(76, 91, 43, 255)
  509. khaki = Color.new(105, 114, 66, 255)
  510. lightGreen = Color.new(128, 136, 88, 255)
  511. mint = Color.new(146, 154, 106, 255)

  512. # 1st leaf bitmap
  513. @green_leaf_bitmaps[0] = Bitmap.new(8, 8)
  514. @green_leaf_bitmaps[0].set_pixel(1, 0, darkGreen)
  515. @green_leaf_bitmaps[0].set_pixel(1, 1, midGreen)
  516. @green_leaf_bitmaps[0].set_pixel(2, 1, darkGreen)
  517. @green_leaf_bitmaps[0].set_pixel(2, 2, khaki)
  518. @green_leaf_bitmaps[0].set_pixel(3, 2, darkGreen)
  519. @green_leaf_bitmaps[0].set_pixel(4, 2, khaki)
  520. @green_leaf_bitmaps[0].fill_rect(2, 3, 3, 1, midGreen)
  521. @green_leaf_bitmaps[0].set_pixel(5, 3, khaki)
  522. @green_leaf_bitmaps[0].fill_rect(2, 4, 2, 1, midGreen)
  523. @green_leaf_bitmaps[0].set_pixel(4, 4, darkGreen)
  524. @green_leaf_bitmaps[0].set_pixel(5, 4, lightGreen)
  525. @green_leaf_bitmaps[0].set_pixel(6, 4, khaki)
  526. @green_leaf_bitmaps[0].set_pixel(3, 5, midGreen)
  527. @green_leaf_bitmaps[0].set_pixel(4, 5, darkGreen)
  528. @green_leaf_bitmaps[0].set_pixel(5, 5, khaki)
  529. @green_leaf_bitmaps[0].set_pixel(6, 5, lightGreen)
  530. @green_leaf_bitmaps[0].set_pixel(4, 6, midGreen)
  531. @green_leaf_bitmaps[0].set_pixel(5, 6, darkGreen)
  532. @green_leaf_bitmaps[0].set_pixel(6, 6, lightGreen)
  533. @green_leaf_bitmaps[0].set_pixel(6, 7, khaki)

  534. # 2nd leaf bitmap
  535. @green_leaf_bitmaps[1] = Bitmap.new(8, 8)
  536. @green_leaf_bitmaps[1].fill_rect(1, 1, 1, 2, midGreen)
  537. @green_leaf_bitmaps[1].fill_rect(2, 2, 2, 1, khaki)
  538. @green_leaf_bitmaps[1].set_pixel(4, 2, lightGreen)
  539. @green_leaf_bitmaps[1].fill_rect(2, 3, 2, 1, darkGreen)
  540. @green_leaf_bitmaps[1].fill_rect(4, 3, 2, 1, lightGreen)
  541. @green_leaf_bitmaps[1].set_pixel(2, 4, midGreen)
  542. @green_leaf_bitmaps[1].set_pixel(3, 4, darkGreen)
  543. @green_leaf_bitmaps[1].set_pixel(4, 4, khaki)
  544. @green_leaf_bitmaps[1].fill_rect(5, 4, 2, 1, lightGreen)
  545. @green_leaf_bitmaps[1].set_pixel(3, 5, midGreen)
  546. @green_leaf_bitmaps[1].set_pixel(4, 5, darkGreen)
  547. @green_leaf_bitmaps[1].set_pixel(5, 5, khaki)
  548. @green_leaf_bitmaps[1].set_pixel(6, 5, lightGreen)
  549. @green_leaf_bitmaps[1].set_pixel(5, 6, darkGreen)
  550. @green_leaf_bitmaps[1].fill_rect(6, 6, 2, 1, khaki)

  551. # 3rd leaf bitmap
  552. @green_leaf_bitmaps[2] = Bitmap.new(8, 8)
  553. @green_leaf_bitmaps[2].set_pixel(1, 1, darkGreen)
  554. @green_leaf_bitmaps[2].fill_rect(1, 2, 2, 1, midGreen)
  555. @green_leaf_bitmaps[2].set_pixel(2, 3, midGreen)
  556. @green_leaf_bitmaps[2].set_pixel(3, 3, darkGreen)
  557. @green_leaf_bitmaps[2].set_pixel(4, 3, midGreen)
  558. @green_leaf_bitmaps[2].fill_rect(2, 4, 2, 1, midGreen)
  559. @green_leaf_bitmaps[2].set_pixel(4, 4, darkGreen)
  560. @green_leaf_bitmaps[2].set_pixel(5, 4, lightGreen)
  561. @green_leaf_bitmaps[2].set_pixel(3, 5, midGreen)
  562. @green_leaf_bitmaps[2].set_pixel(4, 5, darkGreen)
  563. @green_leaf_bitmaps[2].fill_rect(5, 5, 2, 1, khaki)
  564. @green_leaf_bitmaps[2].fill_rect(4, 6, 2, 1, midGreen)
  565. @green_leaf_bitmaps[2].set_pixel(6, 6, lightGreen)
  566. @green_leaf_bitmaps[2].set_pixel(6, 7, khaki)

  567. # 4th leaf bitmap
  568. @green_leaf_bitmaps[3] = Bitmap.new(8, 8)
  569. @green_leaf_bitmaps[3].fill_rect(0, 3, 1, 2, darkGreen)
  570. @green_leaf_bitmaps[3].set_pixel(1, 4, midGreen)
  571. @green_leaf_bitmaps[3].set_pixel(2, 4, khaki)
  572. @green_leaf_bitmaps[3].set_pixel(3, 4, lightGreen)
  573. @green_leaf_bitmaps[3].set_pixel(4, 4, darkGreen)
  574. @green_leaf_bitmaps[3].set_pixel(7, 4, midGreen)
  575. @green_leaf_bitmaps[3].set_pixel(1, 5, darkGreen)
  576. @green_leaf_bitmaps[3].set_pixel(2, 5, midGreen)
  577. @green_leaf_bitmaps[3].set_pixel(3, 5, lightGreen)
  578. @green_leaf_bitmaps[3].set_pixel(4, 5, mint)
  579. @green_leaf_bitmaps[3].set_pixel(5, 5, lightGreen)
  580. @green_leaf_bitmaps[3].set_pixel(6, 5, khaki)
  581. @green_leaf_bitmaps[3].set_pixel(7, 5, midGreen)
  582. @green_leaf_bitmaps[3].fill_rect(2, 6, 2, 1, midGreen)
  583. @green_leaf_bitmaps[3].set_pixel(4, 6, lightGreen)
  584. @green_leaf_bitmaps[3].set_pixel(5, 6, khaki)
  585. @green_leaf_bitmaps[3].set_pixel(6, 6, midGreen)

  586. # 5th leaf bitmap
  587. @green_leaf_bitmaps[4] = Bitmap.new(8, 8)
  588. @green_leaf_bitmaps[4].set_pixel(6, 2, midGreen)
  589. @green_leaf_bitmaps[4].set_pixel(7, 2, darkGreen)
  590. @green_leaf_bitmaps[4].fill_rect(4, 3, 2, 1, midGreen)
  591. @green_leaf_bitmaps[4].set_pixel(6, 3, khaki)
  592. @green_leaf_bitmaps[4].set_pixel(2, 4, darkGreen)
  593. @green_leaf_bitmaps[4].fill_rect(3, 4, 2, 1, khaki)
  594. @green_leaf_bitmaps[4].set_pixel(5, 4, lightGreen)
  595. @green_leaf_bitmaps[4].set_pixel(6, 4, khaki)
  596. @green_leaf_bitmaps[4].set_pixel(1, 5, midGreen)
  597. @green_leaf_bitmaps[4].set_pixel(2, 5, khaki)
  598. @green_leaf_bitmaps[4].set_pixel(3, 5, lightGreen)
  599. @green_leaf_bitmaps[4].set_pixel(4, 5, mint)
  600. @green_leaf_bitmaps[4].set_pixel(5, 5, midGreen)
  601. @green_leaf_bitmaps[4].set_pixel(2, 6, darkGreen)
  602. @green_leaf_bitmaps[4].fill_rect(3, 6, 2, 1, midGreen)

  603. # 6th leaf bitmap
  604. @green_leaf_bitmaps[5] = Bitmap.new(8, 8)
  605. @green_leaf_bitmaps[5].fill_rect(6, 2, 2, 1, midGreen)
  606. @green_leaf_bitmaps[5].fill_rect(4, 3, 2, 1, midGreen)
  607. @green_leaf_bitmaps[5].set_pixel(6, 3, khaki)
  608. @green_leaf_bitmaps[5].set_pixel(3, 4, midGreen)
  609. @green_leaf_bitmaps[5].set_pixel(4, 4, khaki)
  610. @green_leaf_bitmaps[5].set_pixel(5, 4, lightGreen)
  611. @green_leaf_bitmaps[5].set_pixel(6, 4, mint)
  612. @green_leaf_bitmaps[5].set_pixel(1, 5, midGreen)
  613. @green_leaf_bitmaps[5].set_pixel(2, 5, khaki)
  614. @green_leaf_bitmaps[5].fill_rect(3, 5, 2, 1, mint)
  615. @green_leaf_bitmaps[5].set_pixel(5, 5, lightGreen)
  616. @green_leaf_bitmaps[5].set_pixel(2, 6, midGreen)
  617. @green_leaf_bitmaps[5].set_pixel(3, 6, khaki)
  618. @green_leaf_bitmaps[5].set_pixel(4, 6, lightGreen)

  619. # 7th leaf bitmap
  620. @green_leaf_bitmaps[6] = Bitmap.new(8, 8)
  621. @green_leaf_bitmaps[6].fill_rect(6, 1, 1, 2, midGreen)
  622. @green_leaf_bitmaps[6].fill_rect(4, 2, 2, 1, midGreen)
  623. @green_leaf_bitmaps[6].fill_rect(6, 2, 1, 2, darkGreen)
  624. @green_leaf_bitmaps[6].fill_rect(3, 3, 2, 1, midGreen)
  625. @green_leaf_bitmaps[6].set_pixel(5, 3, khaki)
  626. @green_leaf_bitmaps[6].set_pixel(2, 4, midGreen)
  627. @green_leaf_bitmaps[6].set_pixel(3, 4, khaki)
  628. @green_leaf_bitmaps[6].set_pixel(4, 4, lightGreen)
  629. @green_leaf_bitmaps[6].set_pixel(5, 4, midGreen)
  630. @green_leaf_bitmaps[6].set_pixel(1, 5, midGreen)
  631. @green_leaf_bitmaps[6].set_pixel(2, 5, khaki)
  632. @green_leaf_bitmaps[6].fill_rect(3, 5, 2, 1, midGreen)
  633. @green_leaf_bitmaps[6].set_pixel(1, 6, darkGreen)
  634. @green_leaf_bitmaps[6].set_pixel(2, 6, midGreen)

  635. # 8th leaf bitmap
  636. @green_leaf_bitmaps[7] = Bitmap.new(8, 8)
  637. @green_leaf_bitmaps[7].set_pixel(6, 1, midGreen)
  638. @green_leaf_bitmaps[7].fill_rect(4, 2, 3, 2, midGreen)
  639. @green_leaf_bitmaps[7].set_pixel(3, 3, darkGreen)
  640. @green_leaf_bitmaps[7].set_pixel(2, 4, darkGreen)
  641. @green_leaf_bitmaps[7].set_pixel(3, 4, midGreen)
  642. @green_leaf_bitmaps[7].fill_rect(4, 4, 2, 1, khaki)
  643. @green_leaf_bitmaps[7].set_pixel(1, 5, darkGreen)
  644. @green_leaf_bitmaps[7].set_pixel(2, 5, midGreen)
  645. @green_leaf_bitmaps[7].fill_rect(3, 5, 2, 1, lightGreen)
  646. @green_leaf_bitmaps[7].set_pixel(2, 6, midGreen)
  647. @green_leaf_bitmaps[7].set_pixel(3, 6, lightGreen)

  648. # 9th leaf bitmap
  649. @green_leaf_bitmaps[8] = Bitmap.new(8, 8)
  650. @green_leaf_bitmaps[8].fill_rect(6, 1, 1, 2, midGreen)
  651. @green_leaf_bitmaps[8].fill_rect(4, 2, 2, 1, midGreen)
  652. @green_leaf_bitmaps[8].fill_rect(6, 2, 1, 2, darkGreen)
  653. @green_leaf_bitmaps[8].fill_rect(3, 3, 2, 1, midGreen)
  654. @green_leaf_bitmaps[8].set_pixel(5, 3, khaki)
  655. @green_leaf_bitmaps[8].set_pixel(2, 4, midGreen)
  656. @green_leaf_bitmaps[8].set_pixel(3, 4, khaki)
  657. @green_leaf_bitmaps[8].set_pixel(4, 4, lightGreen)
  658. @green_leaf_bitmaps[8].set_pixel(5, 4, midGreen)
  659. @green_leaf_bitmaps[8].set_pixel(1, 5, midGreen)
  660. @green_leaf_bitmaps[8].set_pixel(2, 5, khaki)
  661. @green_leaf_bitmaps[8].fill_rect(3, 5, 2, 1, midGreen)
  662. @green_leaf_bitmaps[8].set_pixel(1, 6, darkGreen)
  663. @green_leaf_bitmaps[8].set_pixel(2, 6, midGreen)

  664. # 10th leaf bitmap
  665. @green_leaf_bitmaps[9] = Bitmap.new(8, 8)
  666. @green_leaf_bitmaps[9].fill_rect(6, 2, 2, 1, midGreen)
  667. @green_leaf_bitmaps[9].fill_rect(4, 3, 2, 1, midGreen)
  668. @green_leaf_bitmaps[9].set_pixel(6, 3, khaki)
  669. @green_leaf_bitmaps[9].set_pixel(3, 4, midGreen)
  670. @green_leaf_bitmaps[9].set_pixel(4, 4, khaki)
  671. @green_leaf_bitmaps[9].set_pixel(5, 4, lightGreen)
  672. @green_leaf_bitmaps[9].set_pixel(6, 4, mint)
  673. @green_leaf_bitmaps[9].set_pixel(1, 5, midGreen)
  674. @green_leaf_bitmaps[9].set_pixel(2, 5, khaki)
  675. @green_leaf_bitmaps[9].fill_rect(3, 5, 2, 1, mint)
  676. @green_leaf_bitmaps[9].set_pixel(5, 5, lightGreen)
  677. @green_leaf_bitmaps[9].set_pixel(2, 6, midGreen)
  678. @green_leaf_bitmaps[9].set_pixel(3, 6, khaki)
  679. @green_leaf_bitmaps[9].set_pixel(4, 6, lightGreen)

  680. # 11th leaf bitmap
  681. @green_leaf_bitmaps[10] = Bitmap.new(8, 8)
  682. @green_leaf_bitmaps[10].set_pixel(6, 2, midGreen)
  683. @green_leaf_bitmaps[10].set_pixel(7, 2, darkGreen)
  684. @green_leaf_bitmaps[10].fill_rect(4, 3, 2, 1, midGreen)
  685. @green_leaf_bitmaps[10].set_pixel(6, 3, khaki)
  686. @green_leaf_bitmaps[10].set_pixel(2, 4, darkGreen)
  687. @green_leaf_bitmaps[10].fill_rect(3, 4, 2, 1, khaki)
  688. @green_leaf_bitmaps[10].set_pixel(5, 4, lightGreen)
  689. @green_leaf_bitmaps[10].set_pixel(6, 4, khaki)
  690. @green_leaf_bitmaps[10].set_pixel(1, 5, midGreen)
  691. @green_leaf_bitmaps[10].set_pixel(2, 5, khaki)
  692. @green_leaf_bitmaps[10].set_pixel(3, 5, lightGreen)
  693. @green_leaf_bitmaps[10].set_pixel(4, 5, mint)
  694. @green_leaf_bitmaps[10].set_pixel(5, 5, midGreen)
  695. @green_leaf_bitmaps[10].set_pixel(2, 6, darkGreen)
  696. @green_leaf_bitmaps[10].fill_rect(3, 6, 2, 1, midGreen)



  697. # 12th leaf bitmap
  698. @green_leaf_bitmaps[11] = Bitmap.new(8, 8)
  699. @green_leaf_bitmaps[11].fill_rect(0, 3, 1, 2, darkGreen)
  700. @green_leaf_bitmaps[11].set_pixel(1, 4, midGreen)
  701. @green_leaf_bitmaps[11].set_pixel(2, 4, khaki)
  702. @green_leaf_bitmaps[11].set_pixel(3, 4, lightGreen)
  703. @green_leaf_bitmaps[11].set_pixel(4, 4, darkGreen)
  704. @green_leaf_bitmaps[11].set_pixel(7, 4, midGreen)
  705. @green_leaf_bitmaps[11].set_pixel(1, 5, darkGreen)
  706. @green_leaf_bitmaps[11].set_pixel(2, 5, midGreen)
  707. @green_leaf_bitmaps[11].set_pixel(3, 5, lightGreen)
  708. @green_leaf_bitmaps[11].set_pixel(4, 5, mint)
  709. @green_leaf_bitmaps[11].set_pixel(5, 5, lightGreen)
  710. @green_leaf_bitmaps[11].set_pixel(6, 5, khaki)
  711. @green_leaf_bitmaps[11].set_pixel(7, 5, midGreen)
  712. @green_leaf_bitmaps[11].fill_rect(2, 6, 2, 1, midGreen)
  713. @green_leaf_bitmaps[11].set_pixel(4, 6, lightGreen)
  714. @green_leaf_bitmaps[11].set_pixel(5, 6, khaki)
  715. @green_leaf_bitmaps[11].set_pixel(6, 6, midGreen)

  716. # 13th leaf bitmap
  717. @green_leaf_bitmaps[12] = Bitmap.new(8, 8)
  718. @green_leaf_bitmaps[12].set_pixel(1, 1, darkGreen)
  719. @green_leaf_bitmaps[12].fill_rect(1, 2, 2, 1, midGreen)
  720. @green_leaf_bitmaps[12].set_pixel(2, 3, midGreen)
  721. @green_leaf_bitmaps[12].set_pixel(3, 3, darkGreen)
  722. @green_leaf_bitmaps[12].set_pixel(4, 3, midGreen)
  723. @green_leaf_bitmaps[12].fill_rect(2, 4, 2, 1, midGreen)
  724. @green_leaf_bitmaps[12].set_pixel(4, 4, darkGreen)
  725. @green_leaf_bitmaps[12].set_pixel(5, 4, lightGreen)
  726. @green_leaf_bitmaps[12].set_pixel(3, 5, midGreen)
  727. @green_leaf_bitmaps[12].set_pixel(4, 5, darkGreen)
  728. @green_leaf_bitmaps[12].fill_rect(5, 5, 2, 1, khaki)
  729. @green_leaf_bitmaps[12].fill_rect(4, 6, 2, 1, midGreen)
  730. @green_leaf_bitmaps[12].set_pixel(6, 6, lightGreen)
  731. @green_leaf_bitmaps[12].set_pixel(6, 7, khaki)

  732. @rose_bitmaps = []
  733. brightRed = Color.new(255, 0, 0, 255)
  734. midRed = Color.new(179, 17, 17, 255)
  735. darkRed = Color.new(141, 9, 9, 255)

  736. # 1st rose petal bitmap
  737. @rose_bitmaps[0] = Bitmap.new(3, 3)
  738. @rose_bitmaps[0].fill_rect(1, 0, 2, 1, brightRed)
  739. @rose_bitmaps[0].fill_rect(0, 1, 1, 2, brightRed)
  740. @rose_bitmaps[0].fill_rect(1, 1, 2, 2, midRed)
  741. @rose_bitmaps[0].set_pixel(2, 2, darkRed)

  742. # 2nd rose petal bitmap
  743. @rose_bitmaps[1] = Bitmap.new(3, 3)
  744. @rose_bitmaps[1].set_pixel(0, 1, midRed)
  745. @rose_bitmaps[1].set_pixel(1, 1, brightRed)
  746. @rose_bitmaps[1].fill_rect(1, 2, 1, 2, midRed)

  747. @feather_bitmaps = []
  748. white = Color.new(255, 255, 255, 255)

  749. # 1st feather bitmap
  750. @feather_bitmaps[0] = Bitmap.new(3, 3)
  751. @feather_bitmaps[0].set_pixel(0, 2, white)
  752. @feather_bitmaps[0].set_pixel(1, 2, grey)
  753. @feather_bitmaps[0].set_pixel(2, 1, grey)

  754. # 2nd feather bitmap
  755. @feather_bitmaps[0] = Bitmap.new(3, 3)
  756. @feather_bitmaps[0].set_pixel(0, 0, white)
  757. @feather_bitmaps[0].set_pixel(0, 1, grey)
  758. @feather_bitmaps[0].set_pixel(1, 2, grey)

  759. # 3rd feather bitmap
  760. @feather_bitmaps[0] = Bitmap.new(3, 3)
  761. @feather_bitmaps[0].set_pixel(2, 0, white)
  762. @feather_bitmaps[0].set_pixel(1, 0, grey)
  763. @feather_bitmaps[0].set_pixel(0, 1, grey)

  764. # 4th feather bitmap
  765. @feather_bitmaps[0] = Bitmap.new(3, 3)
  766. @feather_bitmaps[0].set_pixel(2, 2, white)
  767. @feather_bitmaps[0].set_pixel(2, 1, grey)
  768. @feather_bitmaps[0].set_pixel(1, 0, grey)

  769. @blood_rain_bitmap = Bitmap.new(7, 56)
  770. for i in 0..6
  771. @blood_rain_bitmap.fill_rect(6-i, i*8, 1, 8, darkRed)
  772. end

  773. @sparkle_bitmaps = []

  774. lightBlue = Color.new(181, 244, 255, 255)
  775. midBlue = Color.new(126, 197, 235, 255)
  776. darkBlue = Color.new(77, 136, 225, 255)

  777. # 1st sparkle bitmap
  778. @sparkle_bitmaps[0] = Bitmap.new(7, 7)
  779. @sparkle_bitmaps[0].set_pixel(3, 3, darkBlue)

  780. # 2nd sparkle bitmap
  781. @sparkle_bitmaps[1] = Bitmap.new(7, 7)
  782. @sparkle_bitmaps[1].fill_rect(3, 2, 1, 3, darkBlue)
  783. @sparkle_bitmaps[1].fill_rect(2, 3, 3, 1, darkBlue)
  784. @sparkle_bitmaps[1].set_pixel(3, 3, midBlue)

  785. # 3rd sparkle bitmap
  786. @sparkle_bitmaps[2] = Bitmap.new(7, 7)
  787. @sparkle_bitmaps[2].set_pixel(1, 1, darkBlue)
  788. @sparkle_bitmaps[2].set_pixel(5, 1, darkBlue)
  789. @sparkle_bitmaps[2].set_pixel(2, 2, midBlue)
  790. @sparkle_bitmaps[2].set_pixel(4, 2, midBlue)
  791. @sparkle_bitmaps[2].set_pixel(3, 3, lightBlue)
  792. @sparkle_bitmaps[2].set_pixel(2, 4, midBlue)
  793. @sparkle_bitmaps[2].set_pixel(4, 4, midBlue)
  794. @sparkle_bitmaps[2].set_pixel(1, 5, darkBlue)
  795. @sparkle_bitmaps[2].set_pixel(5, 5, darkBlue)

  796. # 4th sparkle bitmap
  797. @sparkle_bitmaps[3] = Bitmap.new(7, 7)
  798. @sparkle_bitmaps[3].fill_rect(3, 1, 1, 5, darkBlue)
  799. @sparkle_bitmaps[3].fill_rect(1, 3, 5, 1, darkBlue)
  800. @sparkle_bitmaps[3].fill_rect(3, 2, 1, 3, midBlue)
  801. @sparkle_bitmaps[3].fill_rect(2, 3, 3, 1, midBlue)
  802. @sparkle_bitmaps[3].set_pixel(3, 3, lightBlue)

  803. # 5th sparkle bitmap
  804. @sparkle_bitmaps[4] = Bitmap.new(7, 7)
  805. @sparkle_bitmaps[4].fill_rect(2, 2, 3, 3, midBlue)
  806. @sparkle_bitmaps[4].fill_rect(3, 2, 1, 3, darkBlue)
  807. @sparkle_bitmaps[4].fill_rect(2, 3, 3, 1, darkBlue)
  808. @sparkle_bitmaps[4].set_pixel(3, 3, lightBlue)
  809. @sparkle_bitmaps[4].set_pixel(1, 1, darkBlue)
  810. @sparkle_bitmaps[4].set_pixel(5, 1, darkBlue)
  811. @sparkle_bitmaps[4].set_pixel(1, 5, darkBlue)
  812. @sparkle_bitmaps[4].set_pixel(5, 1, darkBlue)

  813. # 6th sparkle bitmap
  814. @sparkle_bitmaps[5] = Bitmap.new(7, 7)
  815. @sparkle_bitmaps[5].fill_rect(2, 1, 3, 5, darkBlue)
  816. @sparkle_bitmaps[5].fill_rect(1, 2, 5, 3, darkBlue)
  817. @sparkle_bitmaps[5].fill_rect(2, 2, 3, 3, midBlue)
  818. @sparkle_bitmaps[5].fill_rect(3, 1, 1, 5, midBlue)
  819. @sparkle_bitmaps[5].fill_rect(1, 3, 5, 1, midBlue)
  820. @sparkle_bitmaps[5].fill_rect(3, 2, 1, 3, lightBlue)
  821. @sparkle_bitmaps[5].fill_rect(2, 3, 3, 1, lightBlue)
  822. @sparkle_bitmaps[5].set_pixel(3, 3, white)

  823. # 7th sparkle bitmap
  824. @sparkle_bitmaps[6] = Bitmap.new(7, 7)
  825. @sparkle_bitmaps[6].fill_rect(2, 1, 3, 5, midBlue)
  826. @sparkle_bitmaps[6].fill_rect(1, 2, 5, 3, midBlue)
  827. @sparkle_bitmaps[6].fill_rect(3, 0, 1, 7, darkBlue)
  828. @sparkle_bitmaps[6].fill_rect(0, 3, 7, 1, darkBlue)
  829. @sparkle_bitmaps[6].fill_rect(2, 2, 3, 3, lightBlue)
  830. @sparkle_bitmaps[6].fill_rect(3, 2, 1, 3, midBlue)
  831. @sparkle_bitmaps[6].fill_rect(2, 3, 3, 1, midBlue)
  832. @sparkle_bitmaps[6].set_pixel(3, 3, white)

  833. @user_bitmaps = []
  834. update_user_defined
  835. end

  836. def update_user_defined
  837. for image in @user_bitmaps
  838. image.dispose
  839. end

  840. #user-defined bitmaps
  841. for name in $WEATHER_IMAGES
  842. @user_bitmaps.push(RPG::Cache.picture(name))
  843. end
  844. for sprite in @sprites
  845. sprite.bitmap = @user_bitmaps[rand(@user_bitmaps.size)]
  846. end
  847. end

  848. attr_reader :type
  849. attr_reader :max
  850. attr_reader :ox
  851. attr_reader :oy
  852. end
  853. end
复制代码
帮忙把第八种天气的秋叶 改成绿叶、并且吹动效果不能去掉……、

Lv3.寻梦者

双子人

梦石
0
星屑
3190
在线时间
3618 小时
注册时间
2009-4-4
帖子
4154

开拓者

2
发表于 2012-6-10 09:49:39 | 只看该作者
本帖最后由 hys111111 于 2012-6-10 09:50 编辑

  1. #天气列表:
  2. #123默认
  3. #4道拉基
  4. #5沙尘暴
  5. #6雷阵雨

  6. module RPG
  7.   class Weather
  8.     def initialize(viewport = nil)
  9.       @type = 0
  10.       @max = 0
  11.       @ox = 0
  12.       @oy = 0
  13.       color1 = Color.new(255, 255, 255, 255)
  14.       color2 = Color.new(255, 255, 255, 128)
  15.       @rain_bitmap = Bitmap.new(7, 56)
  16.       for i in 0..6
  17.         @rain_bitmap.fill_rect(6-i, i*8, 1, 8, color1)
  18.       end
  19.       @storm_bitmap = Bitmap.new(34, 64)
  20.       for i in 0..31
  21.         @storm_bitmap.fill_rect(33-i, i*2, 1, 2, color2)
  22.         @storm_bitmap.fill_rect(32-i, i*2, 1, 2, color1)
  23.         @storm_bitmap.fill_rect(31-i, i*2, 1, 2, color2)
  24.       end
  25.       @snow_bitmap = Bitmap.new(6, 6)
  26.       @snow_bitmap.fill_rect(0, 1, 6, 4, color2)
  27.       @snow_bitmap.fill_rect(1, 0, 4, 6, color2)
  28.       @snow_bitmap.fill_rect(1, 2, 4, 2, color1)
  29.       @snow_bitmap.fill_rect(2, 1, 2, 4, color1)
  30.       
  31.       #————————————————————添加部分↓
  32.       @balloon_flower_bitmap = Bitmap.new("Graphics/Pictures/道拉基-紫色.png")
  33.       
  34.       color3 = Color.new(255,200,-255,255)
  35.       color4 = Color.new(200,255,-255,255)
  36.       @sand_bitmap = Bitmap.new(64, 34)
  37.       for i in 0..31
  38.         @sand_bitmap.fill_rect(i*2,33-i,  1, 2, color3)
  39.         @sand_bitmap.fill_rect(i*2,32-i,  1, 2, color2)
  40.         @sand_bitmap.fill_rect(i*2,31-i,  1, 2, color4)
  41.       end
  42.       #————————————————————添加部分↑
  43.       
  44.       @sprites = []
  45.       for i in 1..40
  46.         sprite = Sprite.new(viewport)
  47.         sprite.z = 1000
  48.         sprite.visible = false
  49.         sprite.opacity = 0
  50.         @sprites.push(sprite)
  51.       end
  52.     end
  53.     def dispose
  54.       for sprite in @sprites
  55.         sprite.dispose
  56.       end
  57.       @rain_bitmap.dispose
  58.       @storm_bitmap.dispose
  59.       @snow_bitmap.dispose
  60.       #————————————————————添加部分↓
  61.       @balloon_flower_bitmap.dispose
  62.       @sand_bitmap.dispose
  63.       #————————————————————添加部分↑
  64.     end
  65.     def type=(type)
  66.       return if @type == type
  67.       @type = type
  68.       case @type
  69.       when 1
  70.         bitmap = @rain_bitmap
  71.       when 2
  72.         bitmap = @storm_bitmap
  73.       when 3
  74.         bitmap = @snow_bitmap
  75.       when 4 #添加部分(道拉基)
  76.         bitmap = @balloon_flower_bitmap
  77.       when 5 #添加部分(沙尘暴)
  78.         bitmap = @sand_bitmap
  79.       when 6 #添加部分(雷阵雨)
  80.         bitmap = @rain_bitmap
  81.         @thunder = true
  82.       else
  83.         bitmap = nil
  84.       end
  85.       
  86.       if @type != 6#(——添加——)
  87.         @thunder = false
  88.       end
  89.       
  90.       for i in 1..40
  91.         sprite = @sprites[i]
  92.         if sprite != nil
  93.           sprite.visible = (i <= @max)
  94.           sprite.bitmap = bitmap
  95.         end
  96.       end
  97.     end
  98.     def ox=(ox)
  99.       return if @ox == ox;
  100.       @ox = ox
  101.       for sprite in @sprites
  102.         sprite.ox = @ox
  103.       end
  104.     end
  105.     def oy=(oy)
  106.       return if @oy == oy;
  107.       @oy = oy
  108.       for sprite in @sprites
  109.         sprite.oy = @oy
  110.       end
  111.     end
  112.     def max=(max)
  113.       return if @max == max;
  114.       @max = [[max, 0].max, 40].min
  115.       for i in 1..40
  116.         sprite = @sprites[i]
  117.         if sprite != nil
  118.           sprite.visible = (i <= @max)
  119.         end
  120.       end
  121.     end
  122.     def update
  123.       return if @type == 0
  124.       for i in 1..@max
  125.         sprite = @sprites[i]
  126.         if sprite == nil
  127.           break
  128.         end
  129.         if @type == 1 or @type == 6#or @type == 6是添加的
  130.           sprite.x -= 2
  131.           sprite.y += 16
  132.           sprite.opacity -= 8
  133.           if @thunder and (rand(8000 - @max) == 0)#这个if是添加的
  134.             $game_screen.start_flash(Color.new(255, 255, 255, 255), 5)
  135.             Audio.se_play("Audio/SE/061-Thunderclap01")
  136.           end
  137.         end
  138.         if @type == 2
  139.           sprite.x -= 8
  140.           sprite.y += 16
  141.           sprite.opacity -= 12
  142.         end
  143.         if @type == 3
  144.           sprite.x -= 2
  145.           sprite.y += 8
  146.           sprite.opacity -= 8
  147.         end
  148.         #————————————————————添加部分↓
  149.         if @type == 4
  150.           sprite.x -= 16
  151.           sprite.y += 4
  152.           sprite.opacity -= 2
  153.         end
  154.         if @type == 5
  155.           zzz = rand(1.1)+1
  156.           zoom_x = zzz
  157.           zoom_y = zzz
  158.           sprite.x -= 32
  159.           sprite.y += 4
  160.           sprite.opacity -= 64
  161.         end
  162.         #————————————————————添加部分↑
  163.         x = sprite.x - @ox
  164.         y = sprite.y - @oy
  165.         if sprite.opacity < 64 or x < -50 or x > 750 or y < -300 or y > 500
  166.           sprite.x = rand(800) - 50 + @ox
  167.           sprite.y = rand(800) - 200 + @oy
  168.           sprite.opacity = 255
  169.         end
  170.       end
  171.     end
  172.     attr_reader :type
  173.     attr_reader :max
  174.     attr_reader :ox
  175.     attr_reader :oy
  176.   end
  177. end

复制代码
可以用bitmap(注意33行道拉基的设置那里),像我这样,在picture里面准备一张名叫“道拉基-紫色”的图片。
您也可以改成绿叶什么的。

点评

这个不是我的那个天气脚本吧、但是那个天气脚本其他天气我还要用、所以不能去替换、  发表于 2012-6-10 10:10

评分

参与人数 1星屑 +132 收起 理由
hcm + 132 感谢回答

查看全部评分

回复

使用道具 举报

Lv2.观梦者

虚構歪曲

梦石
0
星屑
364
在线时间
1198 小时
注册时间
2010-12-18
帖子
3928

贵宾

3
发表于 2012-6-10 10:33:07 | 只看该作者
本帖最后由 忧雪の伤 于 2012-6-10 10:33 编辑

UI> 题目表达不清晰啊,回到问题。
请在 make_bitmaps 这个方法里面自己修改每个你想改的 Color.new 后面的参数进行调试。

点评

嗯…………完全不懂脚本、  发表于 2012-6-10 17:24
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-11-30 13:04

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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