Project1

标题: [RM脚本] 脚本以及工程预留帖 [打印本页]

作者: frantice    时间: 2006-7-17 17:49
标题: [RM脚本] 脚本以及工程预留帖
7月17日更新
模仿FF7的制作群字幕
用事件做总觉得麻烦,现在提供一个已有的脚本(不是主站上那个)。动态效果不错。
来源  http://rpgcreative.free.fr/ (论坛里的,不知道能不能进去)
名字: - Final Fantasy VII opening Credits Script
  
#   使用方法:
#   调用场景:$scene = FFVII_Credits.new
#   脚本的后半部分就是自己设内容的,华文行楷是字体,其他的先看一遍效果,然后就知道怎么回事了。

  1. #  http://rpgcreative.free.fr/forum/viewtopic.php?p=50564#50564
  2. # - Final Fantasy VII opening Credits Script
  3. #  
  4. #   使用方法:
  5. #   调用场景:$scene = FFVII_Credits.new
  6. #   脚本的后半部分就是自己设内容的,华文行楷是字体,其他的先看一遍效果,然后就知道怎么回事了。
  7. #   除了最上面的出处,所有注释以及显示的汉字都是我加的........


  8.     class FFVII_Credits
  9.     def main
  10.     $data_system = load_data("Data/System.rxdata")
  11.     $game_system = Game_System.new
  12.     @Background = Sprite.new
  13. # 这个是背景图片,要放在pictures里#
  14.     @Background.bitmap = RPG::Cache.picture("001-Title01")
  15.     @Background.opacity = 255
  16.     @sprite1 = Window1.new
  17.     @sprite1.x =   120
  18.     @sprite1.y =   320
  19.     @sprite2 = Window2.new
  20.     @sprite2.x =   321
  21.     @sprite2.y = - 60
  22. # 这个是音乐,BGM里的.............#
  23.     Audio.bgm_play("Audio/BGM/" + "012-Theme01", 200, 100)
  24.     @sprite3 = Window3.new
  25.     @sprite3.x = - 200
  26.     @sprite3.y =   60
  27.     @sprite4 = Window4.new  
  28.     @sprite4.x =   20
  29.     @sprite4.y =   458
  30.     @sprite5 = Window5.new
  31.     @sprite5.x =   170
  32.     @sprite5.y = - 120
  33.     @sprite6 = Window6.new
  34.     @sprite6.x = - 120
  35.     @sprite6.y =   120
  36.     @sprite7 = Window7.new
  37.     @sprite7.x =   680
  38.     @sprite7.y =   110
  39.     @sprite8 = Window8.new
  40.     @sprite8.x =   450
  41.     @sprite8.y = - 90
  42.     @sprite9 = Window9.new
  43.     @sprite9.x = - 150
  44.     @sprite9.y =   400
  45.     @sprite10 = Window10.new
  46.     @sprite10.x =  30
  47.     @sprite10.y =  540
  48.     @sprite11 = Window11.new
  49.     @sprite11.x =  680
  50.     @sprite11.y =  90
  51.     @sprite12 = Window12.new
  52.     @sprite12.x =  460
  53.     @sprite12.y = - 90
  54.     @sprite13 = Window13.new
  55.     @sprite13.x =  - 142
  56.     @sprite13.y =   320
  57.     @sprite14 = Window14.new
  58.     @sprite14.x =   320
  59.     @sprite14.y = - 90
  60.     @Button = Window15.new
  61.     @Button.x = 220
  62.     @Button.y = 210
  63.     @Button.contents_opacity = 0
  64.     @Button.visible = false
  65.     Graphics.transition
  66.     loop do
  67.       Graphics.update
  68.       Input.update
  69.       update
  70.       if $scene != self
  71.         break
  72.       end
  73.     end
  74.     Graphics.freeze
  75.     @Background.dispose
  76.     @sprite1.dispose
  77.     @sprite2.dispose
  78.     @sprite3.dispose
  79.     @sprite4.dispose
  80.     @sprite5.dispose
  81.     @sprite6.dispose
  82.     @sprite7.dispose
  83.     @sprite8.dispose
  84.     @sprite9.dispose
  85.     @sprite10.dispose
  86.     @sprite11.dispose
  87.     @sprite12.dispose
  88.     @sprite13.dispose
  89.     @sprite14.dispose
  90.     @Button.dispose
  91.   end
  92.   def update
  93.     if @sprite1.x > 119
  94.        @sprite1.x += 2
  95.      end
  96.     if @sprite1.x > 319
  97.        @sprite1.x = 321
  98.      end
  99.     if @sprite1.x == 321
  100.        @sprite2.y += 2
  101.      end
  102.     if @sprite2.y > 298
  103.        @sprite2.y = 299
  104.      end
  105.     if @sprite2.y == 299 and
  106.        @sprite1.x == 321
  107.        @sprite1.contents_opacity -= 2
  108.        @sprite2.contents_opacity -= 2
  109.      end
  110.     if @sprite1.contents_opacity < 1
  111.        @sprite1.active = false
  112.        @sprite2.active = false
  113.        @sprite3.x += 1
  114.        @sprite4.y -= 2
  115.        if @sprite4.y < 40
  116.           @sprite4.y = 40
  117.        end
  118.      end
  119.      if @sprite3.x > 89
  120.         @sprite3.x = 90
  121.         @sprite3.contents_opacity -= 2
  122.         @sprite4.contents_opacity -= 2
  123.       end
  124.      if @sprite3.contents_opacity < 1
  125.         @sprite3.active = false
  126.         @sprite4.active = false
  127.         @sprite5.y += 1
  128.         @sprite6.x += 1
  129.         if @sprite5.y > 137 and
  130.            @sprite6.x > 137
  131.            @sprite5.y = 138
  132.            @sprite6.x = 138
  133.          end
  134.        end
  135.      if @sprite5.y == 138 and
  136.         @sprite6.x == 138
  137.         @sprite5.contents_opacity -= 2
  138.         @sprite6.contents_opacity -= 2
  139.       end
  140.      if @sprite5.contents_opacity < 1
  141.         @sprite7.x > 639
  142.         @sprite8.y < - 89
  143.         @sprite8.y += 1
  144.         @sprite7.x -= 1
  145.       end
  146.       if @sprite7.x < 461
  147.          @sprite7.x = 460
  148.          @sprite8.y = 130
  149.          @sprite7.contents_opacity -=2
  150.          @sprite8.contents_opacity -=2
  151.        end
  152.      if @sprite8.contents_opacity < 1
  153.         @sprite9.x += 1
  154.         @sprite10.y -= 1
  155.       end
  156.       if @sprite10.y < 381
  157.          @sprite10.y = 381
  158.          @sprite9.x = 10
  159.          @sprite9.contents_opacity -= 2
  160.          @sprite10.contents_opacity -= 2
  161.        end
  162.       if @sprite10.contents_opacity < 1
  163.         @sprite11.x > 639
  164.         @sprite12.y < - 89
  165.         @sprite12.y += 1
  166.         @sprite11.x -= 1
  167.       end
  168.       if @sprite11.x < 461
  169.          @sprite11.x = 460
  170.          @sprite12.y = 130
  171.          @sprite11.contents_opacity -=2
  172.          @sprite12.contents_opacity -=2
  173.        end
  174.            if @sprite12.contents_opacity < 1
  175.               @sprite13.x += 1
  176.               @sprite14.y += 1
  177.             end
  178.            if @sprite13.x > 300
  179.               @sprite13.x = 302
  180.               @sprite14.y = 341
  181.               @sprite13.contents_opacity -= 2
  182.               @sprite14.contents_opacity -= 2
  183.             end
  184.            if @sprite14.contents_opacity < 1
  185.               @Button.visible = true
  186.               @Button.contents_opacity +=1
  187.             end
  188.     if Input.trigger?(Input::C)
  189. ## 按决定键后回到标题画面##
  190.        $scene = Scene_Title.new
  191.      end
  192. end
  193. #==============================================
  194. # - Window_Text
  195. #==============================================
  196. class Your_Scene
  197.   
  198. def main

  199.     Graphics.freeze
  200.     @window1.dispose
  201.     @window2.dispose
  202.     @window3.dispose
  203.     @window4.dispose
  204.     @window5.dispose   
  205.     @window6.dispose   
  206.     @window7.dispose  
  207.     @window8.dispose
  208.     @window9.dispose
  209.     @window10.dispose
  210.   end
  211. end
  212. #==============================================
  213. # - Window Producer name text begins
  214. #==============================================

  215. class Window1 < Window_Base

  216.   def initialize
  217.     super(0, 0, 210,60)
  218.     self.contents = Bitmap.new(width - 32, height - 32)
  219.     self.contents.font.name = "华文行楷"
  220.     self.contents.font.size = 22
  221.     self.opacity = 0
  222.     self.contents.draw_text(0, 0, 110, 33, "66RPG")
  223.   end
  224. end
  225. #==============================================
  226. # - Window Producer Title Text Begins
  227. #==============================================

  228. class Window2 < Window_Base

  229.   def initialize
  230.     super(0, 0, 140,60)
  231.     self.contents = Bitmap.new(width - 32, height - 32)
  232.     self.contents.font.name = "华文行楷"
  233.     self.contents.font.size = 22
  234.     self.opacity = 0
  235.     self.contents.draw_text(0, 0, 133, 33, "伟大光荣的")
  236.   end
  237. end
  238. #==============================================
  239. # - Window Main Scripter Name text begins
  240. #==============================================

  241. class Window3 < Window_Base

  242.   def initialize
  243.     super(0, 0, 140,60)
  244.     self.contents = Bitmap.new(width - 32, height - 32)
  245.     self.contents.font.name = "华文行楷"
  246.     self.contents.font.size = 22
  247.     self.opacity = 0
  248.     self.contents.draw_text(0, 0, 133, 33, "九泪")
  249.   end
  250. end

  251. #==============================================
  252. # - Window Mian Scripter Title Text Begins
  253. #==============================================

  254. class Window4 < Window_Base

  255.   def initialize
  256.     super(0, 0, 290,60)
  257.     self.contents = Bitmap.new(width - 32, height - 32)
  258.     self.contents.font.name = "华文行楷"
  259.     self.contents.font.size = 22
  260.     self.opacity = 0
  261.     self.contents.draw_text(0, 0, 290, 33, "聪明漂亮的")
  262.   end
  263. end

  264. #==============================================
  265. # - Window Director Name Text Begins
  266. #==============================================

  267. class Window5 < Window_Base

  268.   def initialize
  269.     super(0, 0, 140,60)
  270.     self.contents = Bitmap.new(width - 32, height - 32)
  271.     self.contents.font.name = "华文行楷"
  272.     self.contents.font.size = 22
  273.     self.opacity = 0
  274.     self.contents.draw_text(0, 0, 133, 33, "某某")
  275.   end
  276. end

  277. #==============================================
  278. # - Window Director Name Title Begins
  279. #==============================================

  280. class Window6 < Window_Base

  281.   def initialize
  282.     super(0, 0, 140,60)
  283.     self.contents = Bitmap.new(width - 32, height - 32)
  284.     self.contents.font.name = "华文行楷"
  285.     self.contents.font.size = 22
  286.     self.opacity = 0
  287.     self.contents.draw_text(0, 0, 133, 33, "杀人眨眼的")
  288.   end
  289. end

  290. #==============================================
  291. # - Window Main Programmer Title Begins
  292. #==============================================

  293. class Window7 < Window_Base

  294.   def initialize
  295.     super(0, 0, 210,60)
  296.     self.contents = Bitmap.new(width - 32, height - 32)
  297.     self.contents.font.name = "华文行楷"
  298.     self.contents.font.size = 22
  299.     self.opacity = 0
  300.     self.contents.draw_text(0, 0, 210, 33, "世界杯冠军")
  301.   end
  302. end

  303. #==============================================
  304. # - Window Main Programmer Name Begins
  305. #==============================================

  306. class Window8 < Window_Base

  307.   def initialize
  308.     super(0, 0, 180,60)
  309.     self.contents = Bitmap.new(width - 32, height - 32)
  310.     self.contents.font.name = "华文行楷"
  311.     self.contents.font.size = 22
  312.     self.opacity = 0
  313.     self.contents.draw_text(0, 0, 178, 33, "阿根廷")
  314.   end
  315. end

  316. #==============================================
  317. # - Window Composer Title Begins
  318. #==============================================

  319. class Window9 < Window_Base

  320.   def initialize
  321.     super(0, 0, 240,60)
  322.     self.contents = Bitmap.new(width - 32, height - 32)
  323.     self.contents.font.name = "宋体"
  324.     self.contents.font.size = 22
  325.     self.opacity = 0
  326.     self.contents.draw_text(0, 0, 233, 33, "齐达内^0^")
  327.   end
  328. end

  329. #==============================================
  330. # - Window Composer name Begins
  331. #==============================================

  332. class Window10 < Window_Base

  333.   def initialize
  334.     super(0, 0, 240,60)
  335.     self.contents = Bitmap.new(width - 32, height - 32)
  336.     self.contents.font.name = "华文行楷"
  337.     self.contents.font.size = 22
  338.     self.opacity = 0
  339.     self.contents.draw_text(0, 0, 233, 33, "我的偶像")
  340.   end
  341. end

  342. #==============================================
  343. # - Window Battle Script designer Title Begins
  344. #==============================================

  345. class Window11 < Window_Base

  346.   def initialize
  347.     super(0, 0, 240,240)
  348.     self.contents = Bitmap.new(width - 32, height - 32)
  349.     self.contents.font.name = "华文行楷"
  350.     self.contents.font.size = 22
  351.     self.opacity = 0
  352.     self.contents.draw_text(0, 0, 133, 33, "伟大的阿根")
  353.     self.contents.draw_text(0, 0, 143, 63, "廷的左后卫")
  354.   end
  355. end

  356. #==============================================
  357. # - Window Battle Script Designer Name Begins
  358. #==============================================

  359. class Window12 < Window_Base

  360.   def initialize
  361.     super(0, 0, 240,60)
  362.     self.contents = Bitmap.new(width - 32, height - 32)
  363.     self.contents.font.name = "华文行楷"
  364.     self.contents.font.size = 22
  365.     self.opacity = 0
  366.     self.contents.draw_text(0, 0, 233, 33, "他不是one!")
  367.   end
  368. end
  369. #==============================================
  370. # - Window Special thanks Begins
  371. #==============================================

  372. class Window13 < Window_Base

  373.   def initialize
  374.     super(0, 0, 340,240)
  375.     self.contents = Bitmap.new(width - 32, height - 32)
  376.     self.contents.font.name = "华文行楷"
  377.     self.contents.font.size = 22
  378.     self.opacity = 0
  379.     self.contents.draw_text(0, 0, 333, 33, "莎士比亚说")
  380.     self.contents.draw_text(0, 20, 333, 33, "liao")
  381.   end
  382. end

  383. #==============================================
  384. # - Window Special Thanks Names begins
  385. #==============================================

  386. class Window14 < Window_Base

  387.   def initialize
  388.     super(0, 0, 240,60)
  389.     self.contents = Bitmap.new(width - 32, height - 32)
  390.     self.contents.font.name = "华文行楷"
  391.     self.contents.font.size = 22
  392.     self.opacity = 0
  393.     self.contents.draw_text(0, 0, 133, 33, "阿根廷!!")  
  394.   end
  395. end

  396. #==============================================
  397. # - This Creates the "Please Press Start" Screen -
  398. #  针对头上的话提出抗议,明明是按下去就回标题画面了,还"Start"个头啊=。=
  399. #  如果放在新游戏开始那里,先这个下,然后到新地图还说得过去....(跑题liao)
  400. #==============================================

  401. class Window15 < Window_Base

  402.   def initialize
  403.     super(0, 0, 440,360)
  404.     self.contents = Bitmap.new(width - 32, height - 32)
  405.     self.contents.font.name = "华文行楷"
  406.     self.contents.font.size = 28
  407.     self.opacity = 0
  408.     self.contents.draw_text(0, 0, 433, 33, "妈妈咪的 ")
  409.     self.contents.font.size = 24
  410.     self.contents.draw_text(0, 20, 433, 33, "想不出话了")
  411.     self.contents.draw_text(0, 40, 433, 33, "就这样了!!")
  412.   end
  413. end
  414. end
复制代码



作者: frantice    时间: 2006-7-17 17:49
标题: [RM脚本] 脚本以及工程预留帖
7月17日更新
模仿FF7的制作群字幕
用事件做总觉得麻烦,现在提供一个已有的脚本(不是主站上那个)。动态效果不错。
来源  http://rpgcreative.free.fr/ (论坛里的,不知道能不能进去)
名字: - Final Fantasy VII opening Credits Script
  
#   使用方法:
#   调用场景:$scene = FFVII_Credits.new
#   脚本的后半部分就是自己设内容的,华文行楷是字体,其他的先看一遍效果,然后就知道怎么回事了。

  1. #  http://rpgcreative.free.fr/forum/viewtopic.php?p=50564#50564
  2. # - Final Fantasy VII opening Credits Script
  3. #  
  4. #   使用方法:
  5. #   调用场景:$scene = FFVII_Credits.new
  6. #   脚本的后半部分就是自己设内容的,华文行楷是字体,其他的先看一遍效果,然后就知道怎么回事了。
  7. #   除了最上面的出处,所有注释以及显示的汉字都是我加的........


  8.     class FFVII_Credits
  9.     def main
  10.     $data_system = load_data("Data/System.rxdata")
  11.     $game_system = Game_System.new
  12.     @Background = Sprite.new
  13. # 这个是背景图片,要放在pictures里#
  14.     @Background.bitmap = RPG::Cache.picture("001-Title01")
  15.     @Background.opacity = 255
  16.     @sprite1 = Window1.new
  17.     @sprite1.x =   120
  18.     @sprite1.y =   320
  19.     @sprite2 = Window2.new
  20.     @sprite2.x =   321
  21.     @sprite2.y = - 60
  22. # 这个是音乐,BGM里的.............#
  23.     Audio.bgm_play("Audio/BGM/" + "012-Theme01", 200, 100)
  24.     @sprite3 = Window3.new
  25.     @sprite3.x = - 200
  26.     @sprite3.y =   60
  27.     @sprite4 = Window4.new  
  28.     @sprite4.x =   20
  29.     @sprite4.y =   458
  30.     @sprite5 = Window5.new
  31.     @sprite5.x =   170
  32.     @sprite5.y = - 120
  33.     @sprite6 = Window6.new
  34.     @sprite6.x = - 120
  35.     @sprite6.y =   120
  36.     @sprite7 = Window7.new
  37.     @sprite7.x =   680
  38.     @sprite7.y =   110
  39.     @sprite8 = Window8.new
  40.     @sprite8.x =   450
  41.     @sprite8.y = - 90
  42.     @sprite9 = Window9.new
  43.     @sprite9.x = - 150
  44.     @sprite9.y =   400
  45.     @sprite10 = Window10.new
  46.     @sprite10.x =  30
  47.     @sprite10.y =  540
  48.     @sprite11 = Window11.new
  49.     @sprite11.x =  680
  50.     @sprite11.y =  90
  51.     @sprite12 = Window12.new
  52.     @sprite12.x =  460
  53.     @sprite12.y = - 90
  54.     @sprite13 = Window13.new
  55.     @sprite13.x =  - 142
  56.     @sprite13.y =   320
  57.     @sprite14 = Window14.new
  58.     @sprite14.x =   320
  59.     @sprite14.y = - 90
  60.     @Button = Window15.new
  61.     @Button.x = 220
  62.     @Button.y = 210
  63.     @Button.contents_opacity = 0
  64.     @Button.visible = false
  65.     Graphics.transition
  66.     loop do
  67.       Graphics.update
  68.       Input.update
  69.       update
  70.       if $scene != self
  71.         break
  72.       end
  73.     end
  74.     Graphics.freeze
  75.     @Background.dispose
  76.     @sprite1.dispose
  77.     @sprite2.dispose
  78.     @sprite3.dispose
  79.     @sprite4.dispose
  80.     @sprite5.dispose
  81.     @sprite6.dispose
  82.     @sprite7.dispose
  83.     @sprite8.dispose
  84.     @sprite9.dispose
  85.     @sprite10.dispose
  86.     @sprite11.dispose
  87.     @sprite12.dispose
  88.     @sprite13.dispose
  89.     @sprite14.dispose
  90.     @Button.dispose
  91.   end
  92.   def update
  93.     if @sprite1.x > 119
  94.        @sprite1.x += 2
  95.      end
  96.     if @sprite1.x > 319
  97.        @sprite1.x = 321
  98.      end
  99.     if @sprite1.x == 321
  100.        @sprite2.y += 2
  101.      end
  102.     if @sprite2.y > 298
  103.        @sprite2.y = 299
  104.      end
  105.     if @sprite2.y == 299 and
  106.        @sprite1.x == 321
  107.        @sprite1.contents_opacity -= 2
  108.        @sprite2.contents_opacity -= 2
  109.      end
  110.     if @sprite1.contents_opacity < 1
  111.        @sprite1.active = false
  112.        @sprite2.active = false
  113.        @sprite3.x += 1
  114.        @sprite4.y -= 2
  115.        if @sprite4.y < 40
  116.           @sprite4.y = 40
  117.        end
  118.      end
  119.      if @sprite3.x > 89
  120.         @sprite3.x = 90
  121.         @sprite3.contents_opacity -= 2
  122.         @sprite4.contents_opacity -= 2
  123.       end
  124.      if @sprite3.contents_opacity < 1
  125.         @sprite3.active = false
  126.         @sprite4.active = false
  127.         @sprite5.y += 1
  128.         @sprite6.x += 1
  129.         if @sprite5.y > 137 and
  130.            @sprite6.x > 137
  131.            @sprite5.y = 138
  132.            @sprite6.x = 138
  133.          end
  134.        end
  135.      if @sprite5.y == 138 and
  136.         @sprite6.x == 138
  137.         @sprite5.contents_opacity -= 2
  138.         @sprite6.contents_opacity -= 2
  139.       end
  140.      if @sprite5.contents_opacity < 1
  141.         @sprite7.x > 639
  142.         @sprite8.y < - 89
  143.         @sprite8.y += 1
  144.         @sprite7.x -= 1
  145.       end
  146.       if @sprite7.x < 461
  147.          @sprite7.x = 460
  148.          @sprite8.y = 130
  149.          @sprite7.contents_opacity -=2
  150.          @sprite8.contents_opacity -=2
  151.        end
  152.      if @sprite8.contents_opacity < 1
  153.         @sprite9.x += 1
  154.         @sprite10.y -= 1
  155.       end
  156.       if @sprite10.y < 381
  157.          @sprite10.y = 381
  158.          @sprite9.x = 10
  159.          @sprite9.contents_opacity -= 2
  160.          @sprite10.contents_opacity -= 2
  161.        end
  162.       if @sprite10.contents_opacity < 1
  163.         @sprite11.x > 639
  164.         @sprite12.y < - 89
  165.         @sprite12.y += 1
  166.         @sprite11.x -= 1
  167.       end
  168.       if @sprite11.x < 461
  169.          @sprite11.x = 460
  170.          @sprite12.y = 130
  171.          @sprite11.contents_opacity -=2
  172.          @sprite12.contents_opacity -=2
  173.        end
  174.            if @sprite12.contents_opacity < 1
  175.               @sprite13.x += 1
  176.               @sprite14.y += 1
  177.             end
  178.            if @sprite13.x > 300
  179.               @sprite13.x = 302
  180.               @sprite14.y = 341
  181.               @sprite13.contents_opacity -= 2
  182.               @sprite14.contents_opacity -= 2
  183.             end
  184.            if @sprite14.contents_opacity < 1
  185.               @Button.visible = true
  186.               @Button.contents_opacity +=1
  187.             end
  188.     if Input.trigger?(Input::C)
  189. ## 按决定键后回到标题画面##
  190.        $scene = Scene_Title.new
  191.      end
  192. end
  193. #==============================================
  194. # - Window_Text
  195. #==============================================
  196. class Your_Scene
  197.   
  198. def main

  199.     Graphics.freeze
  200.     @window1.dispose
  201.     @window2.dispose
  202.     @window3.dispose
  203.     @window4.dispose
  204.     @window5.dispose   
  205.     @window6.dispose   
  206.     @window7.dispose  
  207.     @window8.dispose
  208.     @window9.dispose
  209.     @window10.dispose
  210.   end
  211. end
  212. #==============================================
  213. # - Window Producer name text begins
  214. #==============================================

  215. class Window1 < Window_Base

  216.   def initialize
  217.     super(0, 0, 210,60)
  218.     self.contents = Bitmap.new(width - 32, height - 32)
  219.     self.contents.font.name = "华文行楷"
  220.     self.contents.font.size = 22
  221.     self.opacity = 0
  222.     self.contents.draw_text(0, 0, 110, 33, "66RPG")
  223.   end
  224. end
  225. #==============================================
  226. # - Window Producer Title Text Begins
  227. #==============================================

  228. class Window2 < Window_Base

  229.   def initialize
  230.     super(0, 0, 140,60)
  231.     self.contents = Bitmap.new(width - 32, height - 32)
  232.     self.contents.font.name = "华文行楷"
  233.     self.contents.font.size = 22
  234.     self.opacity = 0
  235.     self.contents.draw_text(0, 0, 133, 33, "伟大光荣的")
  236.   end
  237. end
  238. #==============================================
  239. # - Window Main Scripter Name text begins
  240. #==============================================

  241. class Window3 < Window_Base

  242.   def initialize
  243.     super(0, 0, 140,60)
  244.     self.contents = Bitmap.new(width - 32, height - 32)
  245.     self.contents.font.name = "华文行楷"
  246.     self.contents.font.size = 22
  247.     self.opacity = 0
  248.     self.contents.draw_text(0, 0, 133, 33, "九泪")
  249.   end
  250. end

  251. #==============================================
  252. # - Window Mian Scripter Title Text Begins
  253. #==============================================

  254. class Window4 < Window_Base

  255.   def initialize
  256.     super(0, 0, 290,60)
  257.     self.contents = Bitmap.new(width - 32, height - 32)
  258.     self.contents.font.name = "华文行楷"
  259.     self.contents.font.size = 22
  260.     self.opacity = 0
  261.     self.contents.draw_text(0, 0, 290, 33, "聪明漂亮的")
  262.   end
  263. end

  264. #==============================================
  265. # - Window Director Name Text Begins
  266. #==============================================

  267. class Window5 < Window_Base

  268.   def initialize
  269.     super(0, 0, 140,60)
  270.     self.contents = Bitmap.new(width - 32, height - 32)
  271.     self.contents.font.name = "华文行楷"
  272.     self.contents.font.size = 22
  273.     self.opacity = 0
  274.     self.contents.draw_text(0, 0, 133, 33, "某某")
  275.   end
  276. end

  277. #==============================================
  278. # - Window Director Name Title Begins
  279. #==============================================

  280. class Window6 < Window_Base

  281.   def initialize
  282.     super(0, 0, 140,60)
  283.     self.contents = Bitmap.new(width - 32, height - 32)
  284.     self.contents.font.name = "华文行楷"
  285.     self.contents.font.size = 22
  286.     self.opacity = 0
  287.     self.contents.draw_text(0, 0, 133, 33, "杀人眨眼的")
  288.   end
  289. end

  290. #==============================================
  291. # - Window Main Programmer Title Begins
  292. #==============================================

  293. class Window7 < Window_Base

  294.   def initialize
  295.     super(0, 0, 210,60)
  296.     self.contents = Bitmap.new(width - 32, height - 32)
  297.     self.contents.font.name = "华文行楷"
  298.     self.contents.font.size = 22
  299.     self.opacity = 0
  300.     self.contents.draw_text(0, 0, 210, 33, "世界杯冠军")
  301.   end
  302. end

  303. #==============================================
  304. # - Window Main Programmer Name Begins
  305. #==============================================

  306. class Window8 < Window_Base

  307.   def initialize
  308.     super(0, 0, 180,60)
  309.     self.contents = Bitmap.new(width - 32, height - 32)
  310.     self.contents.font.name = "华文行楷"
  311.     self.contents.font.size = 22
  312.     self.opacity = 0
  313.     self.contents.draw_text(0, 0, 178, 33, "阿根廷")
  314.   end
  315. end

  316. #==============================================
  317. # - Window Composer Title Begins
  318. #==============================================

  319. class Window9 < Window_Base

  320.   def initialize
  321.     super(0, 0, 240,60)
  322.     self.contents = Bitmap.new(width - 32, height - 32)
  323.     self.contents.font.name = "宋体"
  324.     self.contents.font.size = 22
  325.     self.opacity = 0
  326.     self.contents.draw_text(0, 0, 233, 33, "齐达内^0^")
  327.   end
  328. end

  329. #==============================================
  330. # - Window Composer name Begins
  331. #==============================================

  332. class Window10 < Window_Base

  333.   def initialize
  334.     super(0, 0, 240,60)
  335.     self.contents = Bitmap.new(width - 32, height - 32)
  336.     self.contents.font.name = "华文行楷"
  337.     self.contents.font.size = 22
  338.     self.opacity = 0
  339.     self.contents.draw_text(0, 0, 233, 33, "我的偶像")
  340.   end
  341. end

  342. #==============================================
  343. # - Window Battle Script designer Title Begins
  344. #==============================================

  345. class Window11 < Window_Base

  346.   def initialize
  347.     super(0, 0, 240,240)
  348.     self.contents = Bitmap.new(width - 32, height - 32)
  349.     self.contents.font.name = "华文行楷"
  350.     self.contents.font.size = 22
  351.     self.opacity = 0
  352.     self.contents.draw_text(0, 0, 133, 33, "伟大的阿根")
  353.     self.contents.draw_text(0, 0, 143, 63, "廷的左后卫")
  354.   end
  355. end

  356. #==============================================
  357. # - Window Battle Script Designer Name Begins
  358. #==============================================

  359. class Window12 < Window_Base

  360.   def initialize
  361.     super(0, 0, 240,60)
  362.     self.contents = Bitmap.new(width - 32, height - 32)
  363.     self.contents.font.name = "华文行楷"
  364.     self.contents.font.size = 22
  365.     self.opacity = 0
  366.     self.contents.draw_text(0, 0, 233, 33, "他不是one!")
  367.   end
  368. end
  369. #==============================================
  370. # - Window Special thanks Begins
  371. #==============================================

  372. class Window13 < Window_Base

  373.   def initialize
  374.     super(0, 0, 340,240)
  375.     self.contents = Bitmap.new(width - 32, height - 32)
  376.     self.contents.font.name = "华文行楷"
  377.     self.contents.font.size = 22
  378.     self.opacity = 0
  379.     self.contents.draw_text(0, 0, 333, 33, "莎士比亚说")
  380.     self.contents.draw_text(0, 20, 333, 33, "liao")
  381.   end
  382. end

  383. #==============================================
  384. # - Window Special Thanks Names begins
  385. #==============================================

  386. class Window14 < Window_Base

  387.   def initialize
  388.     super(0, 0, 240,60)
  389.     self.contents = Bitmap.new(width - 32, height - 32)
  390.     self.contents.font.name = "华文行楷"
  391.     self.contents.font.size = 22
  392.     self.opacity = 0
  393.     self.contents.draw_text(0, 0, 133, 33, "阿根廷!!")  
  394.   end
  395. end

  396. #==============================================
  397. # - This Creates the "Please Press Start" Screen -
  398. #  针对头上的话提出抗议,明明是按下去就回标题画面了,还"Start"个头啊=。=
  399. #  如果放在新游戏开始那里,先这个下,然后到新地图还说得过去....(跑题liao)
  400. #==============================================

  401. class Window15 < Window_Base

  402.   def initialize
  403.     super(0, 0, 440,360)
  404.     self.contents = Bitmap.new(width - 32, height - 32)
  405.     self.contents.font.name = "华文行楷"
  406.     self.contents.font.size = 28
  407.     self.opacity = 0
  408.     self.contents.draw_text(0, 0, 433, 33, "妈妈咪的 ")
  409.     self.contents.font.size = 24
  410.     self.contents.draw_text(0, 20, 433, 33, "想不出话了")
  411.     self.contents.draw_text(0, 40, 433, 33, "就这样了!!")
  412.   end
  413. end
  414. end
复制代码



作者: frantice    时间: 2006-7-17 17:49

7月17日更新
14种天气效果
地址同上
作者: ccoa
#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 自己定义
其他自己看脚本前面注释
  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. sprite.z = 1000
  62. sprite.visible = false
  63. sprite.opacity = 0
  64. @sprites.push(sprite)
  65. @current_pose.push(0)
  66. @info.push(rand(50))
  67. @countarray.push(rand(15))
  68. end
  69. end

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

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

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

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

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

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

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

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

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


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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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



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

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

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

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

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

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

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

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

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

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

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

  772. @sparkle_bitmaps = []

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

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

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

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

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

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

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

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

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

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

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

  847. attr_reader :type
  848. attr_reader :max
  849. attr_reader :ox
  850. attr_reader :oy
  851. end
  852. end



复制代码



作者: frantice    时间: 2006-7-17 17:55
7月17日

StarOcean Battle Aerena


介绍:来源同上
作者:SephirothSpawn

一个类似打擂台的战斗。使用方法见范例工程。

截图自己看:
http://ftp2.66rpg.com/3/临时� ... Battle Arena/sh.jpg

范例工程:
http://ftp2.66rpg.com/3/临时� ... Arena/starocean.rar


作者: 千鸟    时间: 2006-7-17 17:57
好东西!!!(指天气的)
具体用法$game_screen.weather(14, 35, 0)
这个出现什么情况?
作者: frantice    时间: 2006-7-17 18:00
以下引用千鸟于2006-7-17 9:57:45的发言:

好东西!!!(指天气的)
具体用法$game_screen.weather(14, 35, 0)
这个出现什么情况?



出现14号天气(闪烁),强度为35,色调为基本色

个人认为雷雨,闪烁,以及血雨这三种比较好看
作者: 千鸟    时间: 2006-7-17 18:09
强度什么意思!
就是闪光的亮和暗吗?
作者: 千鸟    时间: 2006-7-17 18:10
不错不错!顶~~~~~~

又一个口袋的脚本,太好了!哈哈!
作者: king    时间: 2006-7-17 20:21
又有好东西了
作者: link006007    时间: 2006-7-17 20:33
{/se}
作者: 亿万星辰    时间: 2006-7-17 23:07
这几个点出来的小图不错~~{/dy}
作者: 忧郁    时间: 2006-7-17 23:26
好东西,特别是第二个,醒目一下~
作者: frantice    时间: 2006-7-18 16:55
7月18日更新第3楼

7月18日 更新
脚本名:自动战斗选项
作者:Thousand Dragoon Link 和 Sir_KnightDragoon
出处:同上
说明:一个很简单的脚本,就是在“战斗”“逃跑”指令旁边加上个“自动战斗”的选项,选择后全体队员自动普通攻击一回合。
用法:插入到Main前
补充:如果冲突了什么什么的,自己斟酌着整吧。^0^

  1. #==============================================================================
  2. # | Auto_Battle
  3. #------------------------------------------------------------------------------
  4. # 作者 Thousand Dragoon Link 和 Sir_KnightDragoon

  5. #==============================================================================
  6. class Scene_Battle
  7. #--------------------------------------------------------------------------
  8. # 刷新同伴指令
  9. #--------------------------------------------------------------------------
  10. def update_phase2
  11. if Input.trigger?(Input::C)
  12. case @party_command_window.index
  13. when 0 # 战斗
  14. # 是否播放SE
  15. $game_system.se_play($data_system.decision_se)
  16. start_phase3
  17. when 1 # 逃跑
  18. # 不能逃跑时
  19. if $game_temp.battle_can_escape == false
  20. $game_system.se_play($data_system.buzzer_se)
  21. return
  22. end
  23. $game_system.se_play($data_system.decision_se)
  24. update_phase2_escape
  25. when 2 #自动战斗
  26. $game_system.se_play($data_system.decision_se)
  27. update_phase2_auto
  28. end
  29. return
  30. end
  31. end
  32. #--------------------------------------------------------------------------
  33. # 自动战斗指令刷新
  34. #--------------------------------------------------------------------------
  35. def update_phase2_auto
  36. loop do
  37. if @actor_index == $game_party.actors.size-1
  38. start_phase4
  39. return
  40. end
  41. @actor_index += 1
  42. $game_party.actors[@actor_index].current_action.kind = 0
  43. $game_party.actors[@actor_index].current_action.basic = 0
  44. $game_party.actors[@actor_index].current_action.decide_random_target_for_actor
  45. end
  46. end
  47. end

  48. class Window_PartyCommand < Window_Selectable
  49. #--------------------------------------------------------------------------
  50. # 目标初始化
  51. #--------------------------------------------------------------------------
  52. def initialize
  53. super(0, 0, 640, 64)
  54. self.contents = Bitmap.new(width - 32, height - 32)
  55. self.back_opacity = 160
  56. self.contents.font.name = "黑体"
  57. self.contents.font.size = 18
  58. @commands = ["战斗", "逃跑", "自动战斗"]
  59. @item_max = 3
  60. @column_max = 3
  61. draw_item(0, normal_color)
  62. draw_item(1, $game_temp.battle_can_escape ? normal_color : disabled_color)
  63. draw_item(2, normal_color)
  64. self.active = false
  65. self.visible = false
  66. self.index = 0
  67. end
  68. #--------------------------------------------------------------------------
  69. def draw_item(index, color)
  70. self.contents.font.color = color
  71. rect = Rect.new(80 + index * 160 + 4, 0, 128 - 10, 32)
  72. self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  73. self.contents.draw_text(rect, @commands[index], 1)
  74. end
  75. #--------------------------------------------------------------------------
  76. # 刷新光标
  77. #--------------------------------------------------------------------------
  78. def update_cursor_rect
  79. self.cursor_rect.set(80 + index * 160, 0, 128, 32)
  80. end
  81. end

复制代码

作者: frantice    时间: 2006-7-18 16:56
7月18日更新

整合商店界面脚本
来源:同上
由于是多人合作的结果,所以明天一一把作者列出。
介绍:一个比较漂亮的商店界面,如果拓展下功能加入图片之类的话就能形成更灵活
      的界面(比如放进小2的图片什么之类的)
说明:脚本很长很长,事实上工作原理很简单。

PART1
  1. #==============================================================================
  2. # ■ Window_Base
  3. #------------------------------------------------------------------------------
  4. # 添加两种颜色
  5. #==============================================================================

  6. class Window_Base < Window
  7. # --------------------------------
  8. def up_color
  9.   return Color.new(74, 210, 74)
  10. end
  11. # --------------------------------
  12. def down_color
  13.   return Color.new(170, 170, 170)
  14. end
  15. end

  16. #==============================================================================
  17. # | Window_ShopCommand
  18. #------------------------------------------------------------------------------
  19. #==============================================================================

  20. class Window_ShopCommand < Window_Selectable
  21. #--------------------------------------------------------------------------
  22. # 初始化
  23. #--------------------------------------------------------------------------
  24. def initialize
  25.   super(0, 64, 428, 64)
  26.   self.contents = Bitmap.new(width - 32, height - 32)
  27.   self.contents.font.name = "宋体"
  28.   self.contents.font.size = 18
  29.   self.opacity = 130
  30.   @item_max = 4
  31.   @column_max = 4
  32.   @commands = ["购买", "卖出", "装备", "取消"]
  33.   refresh
  34.   self.index = 0
  35. end
  36. #--------------------------------------------------------------------------
  37. # 刷新
  38. #--------------------------------------------------------------------------
  39. def refresh
  40.   self.contents.clear
  41.   for i in 0...@item_max
  42.     draw_item(i)
  43.   end
  44. end
  45. #--------------------------------------------------------------------------
  46. # 描绘物品
  47. #     
  48. #--------------------------------------------------------------------------
  49. def draw_item(index)
  50.   x = 4 + index * 107
  51.   self.contents.draw_text(x, 0, 128, 32, @commands[index])
  52. end
  53. end

  54. #==============================================================================
  55. # ■ Window_Help
  56. #--------------------
  57. # 一个新的窗口
  58. #==============================================================================

  59. class Window_Help2 < Window_Base
  60. #--------------------------------------------------------------------------
  61. # ●初始化
  62. #--------------------------------------------------------------------------
  63. def initialize
  64.   super(80, 70, 480, 64)
  65.   self.contents = Bitmap.new(width - 32, height - 32)
  66.   self.contents.font.name = "宋体"
  67.   self.contents.font.size = 17
  68.   self.opacity = 130
  69. end
  70. #--------------------------------------------------------------------------
  71. def set_text(text, align = 0)
  72.   if text != @text or align != @align
  73.     self.contents.clear
  74.     self.contents.font.color = normal_color
  75.     self.contents.draw_text(4, 0, self.width - 40, 32, text, align)
  76.     @text = text
  77.     @align = align
  78.     @actor = nil
  79.   end
  80.   self.visible = true
  81. end

  82. #--------------------------------------------------------------------------
  83. def set_actor(actor)
  84.   if actor != @actor
  85.     self.contents.clear
  86.     draw_actor_name(actor, 4, 0)
  87.     draw_actor_state(actor, 140, 0)
  88.     draw_actor_hp(actor, 284, 0)
  89.     draw_actor_sp(actor, 460, 0)
  90.     @actor = actor
  91.     @text = nil
  92.     self.visible = true
  93.   end
  94. end

  95. #--------------------------------------------------------------------------
  96. def set_enemy(enemy)
  97.   text = enemy.name
  98.   state_text = make_battler_state_text(enemy, 112, false)
  99.   if state_text != ""
  100.     text += "  " + state_text
  101.   end
  102.   set_text(text, 1)
  103. end
  104. end

  105. #==============================================================================
  106. # ■ Window_Gold
  107. #------------------------------------------------------------------------------
  108. # 新的金钱窗口
  109. #==============================================================================

  110. class Window_Gold2 < Window_Base

  111. #--------------------------------------------------------------------------
  112. def initialize
  113.   super(0, 0, 160, 64)
  114.   self.contents = Bitmap.new(width - 32, height - 32)
  115.   self.contents.font.name = "宋体"
  116.   self.contents.font.size = 18
  117.   self.opacity = 130
  118.   refresh
  119. end

  120. #--------------------------------------------------------------------------
  121. def refresh
  122.   self.contents.clear
  123.   cx = contents.text_size($data_system.words.gold).width
  124.   self.contents.font.color = normal_color
  125.   self.contents.draw_text(4, 0, 120-cx-2, 32, $game_party.gold.to_s, 2)
  126.   self.contents.font.color = system_color
  127.   self.contents.draw_text(124-cx, 0, cx, 32, $data_system.words.gold, 2)
  128. end
  129. end

  130. #==============================================================================
  131. # ■ Window_Equipment
  132. #------------------------------------------------------------------------------
  133. # 强化装备窗口
  134. #==============================================================================

  135. class Window_Equipment < Window_Base

  136. #--------------------------------------------------------------------------
  137. def initialize
  138.   super(240, 8, 160, 64)
  139.   self.contents = Bitmap.new(width - 32, height - 32)
  140.   self.contents.font.name = "宋体"
  141.   self.contents.font.size = 17
  142.   self.opacity = 130
  143.   refresh
  144. end

  145. #--------------------------------------------------------------------------
  146. def refresh
  147.   self.contents.clear
  148.   self.contents.font.color = normal_color
  149.   self.contents.draw_text(28, 0, 96, 32, " 装备")   
  150. end
  151. end

  152. ############新的装备左窗口################

  153. class Window_EquipLeft2 < Window_Base
  154. # --------------------------------
  155. attr_accessor :mode
  156. attr_accessor :changes
  157. # --------------------------------
  158. def initialize(actor)
  159.   super(0, 130, 320, 260)
  160.   self.contents = Bitmap.new(width - 32, height - 32)
  161.   self.contents.font.name = "宋体"
  162.   self.contents.font.size = 17
  163.   self.opacity = 130
  164.   self.z += 100
  165.   @actor = actor
  166.   @mode = 0
  167.   @changes = [0, 0, 0, 0, 0, 0, 0, 0]
  168.   @elem_text = ""
  169.   @stat_text = ""
  170.   refresh
  171. end
  172. # --------------------------------
  173. def refresh
  174.   self.contents.clear
  175.   draw_actor_name(@actor, 4, 0)
  176.   draw_actor_level(@actor, 140, 0)
  177.   draw_actor_parameter(@actor, 4, 18, 0)
  178.   draw_actor_parameter(@actor, 4, 36, 1)
  179.   draw_actor_parameter(@actor, 4, 54, 2)
  180.   draw_actor_parameter(@actor, 4, 72, 3)

  181.   draw_actor_parameter(@actor, 4, 90, 4)
  182.   draw_actor_parameter(@actor, 4, 108, 5)
  183.   draw_actor_parameter(@actor, 4, 126, 6)
  184.   if @mode == 0
  185.     self.contents.font.color = up_color
  186.     self.contents.draw_text(4, 144, 200, 32, "攻击")
  187.   end
  188.   if @mode == 1
  189.     self.contents.font.color = up_color
  190.     self.contents.draw_text(4, 144, 200, 32, "防御")
  191.   end
  192.   self.contents.font.color = normal_color
  193.   self.contents.draw_text(12, 162, 220, 32, @elem_text)
  194.   self.contents.draw_text(12, 198, 220, 32, @stat_text)
  195.   if @new_atk != nil
  196.     self.contents.font.color = system_color
  197.     self.contents.draw_text(160, 18, 40, 32, "  =", 1)
  198.     if @changes[0] == 0
  199.       self.contents.font.color = normal_color
  200.     elsif @changes[0] == -1
  201.       self.contents.font.color = down_color
  202.     else
  203.       self.contents.font.color = up_color
  204.     end
  205.     self.contents.draw_text(200, 18, 36, 32, @new_atk.to_s, 2)
  206.   end
  207.   if @new_pdef != nil
  208.     self.contents.font.color = system_color
  209.     self.contents.draw_text(160, 36, 40, 32, "  =", 1)
  210.     if @changes[1] == 0
  211.       self.contents.font.color = normal_color
  212.     elsif @changes[1] == -1
  213.       self.contents.font.color = down_color
  214.     else
  215.       self.contents.font.color = up_color
  216.     end
  217.     self.contents.draw_text(200, 36, 36, 32, @new_pdef.to_s, 2)
  218.   end
  219.   if @new_mdef != nil
  220.     self.contents.font.color = system_color
  221.     self.contents.draw_text(160, 54, 40, 32, "  =", 1)
  222.     if @changes[2] == 0
  223.       self.contents.font.color = normal_color
  224.     elsif @changes[2] == -1
  225.       self.contents.font.color = down_color
  226.     else
  227.       self.contents.font.color = up_color
  228.     end
  229.     self.contents.draw_text(200, 54, 36, 32, @new_mdef.to_s, 2)
  230.   end
  231.   if @new_str != nil
  232.     self.contents.font.color = system_color
  233.     self.contents.draw_text(160, 72, 40, 32, "  =", 1)
  234.     if @changes[3] == 0
  235.       self.contents.font.color = normal_color
  236.     elsif @changes[3] == -1
  237.       self.contents.font.color = down_color
  238.     else
  239.       self.contents.font.color = up_color
  240.     end
  241.     self.contents.draw_text(200, 72, 36, 32, @new_str.to_s, 2)
  242.   end
  243.    if @new_dex != nil
  244.     self.contents.font.color = system_color
  245.     self.contents.draw_text(160, 90, 40, 32, "  =", 1)
  246.     if @changes[4] == 0
  247.       self.contents.font.color = normal_color
  248.     elsif @changes[4] == -1
  249.       self.contents.font.color = down_color
  250.     else
  251.       self.contents.font.color = up_color
  252.     end
  253.     self.contents.draw_text(200, 90, 36, 32, @new_dex.to_s, 2)
  254.   end
  255.     if @new_agi != nil
  256.     self.contents.font.color = system_color
  257.     self.contents.draw_text(160, 108, 40, 32, "  =", 1)
  258.     if @changes[5] == 0
  259.       self.contents.font.color = normal_color
  260.     elsif @changes[5] == -1
  261.       self.contents.font.color = down_color
  262.     else
  263.       self.contents.font.color = up_color
  264.     end
  265.     self.contents.draw_text(200, 108, 36, 32, @new_agi.to_s, 2)
  266.   end
  267.     if @new_int != nil
  268.     self.contents.font.color = system_color
  269.     self.contents.draw_text(160, 126, 40, 32, "  =", 1)
  270.     if @changes[6] == 0
  271.       self.contents.font.color = normal_color
  272.     elsif @changes[6] == -1
  273.       self.contents.font.color = down_color
  274.     else
  275.       self.contents.font.color = up_color
  276.     end
  277.     self.contents.draw_text(200, 126, 36, 32, @new_int.to_s, 2)
  278.   end
  279. end
  280. # --------------------------------
  281. def set_new_parameters(new_atk, new_pdef, new_mdef, new_str, new_dex,
  282.   new_agi, new_int, new_eva, elem_text, stat_text)
  283.   flag = false
  284.   if new_atk != @new_atk || new_pdef != @new_pdef || new_mdef != @new_mdef
  285.     flag = true
  286.   end
  287.   if new_str != @new_str || new_dex != @new_dex || new_agi != @new_agi
  288.     flag = true
  289.   end
  290.    if new_eva != @new_eva || elem_text != @elem_text || stat_text != @stat_text
  291.     flag = true
  292.   end
  293.     @new_atk = new_atk
  294.     @new_pdef = new_pdef
  295.     @new_mdef = new_mdef
  296.     @new_str = new_str
  297.     @new_dex = new_dex
  298.     @new_agi = new_agi
  299.     @new_int = new_int
  300.     @new_eva = new_eva
  301.     @elem_text = elem_text
  302.     @stat_text = stat_text
  303.     if flag
  304.       refresh
  305.     end
  306. end
  307. end

  308. #==============================================================================
  309. # ■ Window_EquipRight
  310. #------------------------------------------------------------------------------
  311. # 新的装备右窗口
  312. #==============================================================================

  313. class Window_EquipRight2 < Window_Selectable

  314. #--------------------------------------------------------------------------
  315. def initialize(actor)
  316.   super(320, 130, 320, 260)
  317.   self.contents = Bitmap.new(width - 32, height - 32)
  318.   self.contents.font.name = "宋体"
  319.   self.contents.font.size = 17
  320.   self.opacity = 130
  321.   @actor = actor
  322.   refresh
  323.   self.index = 0
  324. end

  325. #--------------------------------------------------------------------------
  326. def item
  327.   return @data[self.index]
  328. end

  329. #--------------------------------------------------------------------------
  330. def refresh
  331.   self.contents.clear
  332.   @data = []
  333.   @data.push($data_weapons[@actor.weapon_id])
  334.   @data.push($data_armors[@actor.armor1_id])
  335.   @data.push($data_armors[@actor.armor2_id])
  336.   @data.push($data_armors[@actor.armor3_id])
  337.   @data.push($data_armors[@actor.armor4_id])
  338.   @item_max = @data.size
  339.   self.contents.font.color = system_color
  340.   self.contents.draw_text(4, 32 * 0, 92, 32, $data_system.words.weapon)
  341.   self.contents.draw_text(4, 32 * 1, 92, 32, $data_system.words.armor1)
  342.   self.contents.draw_text(4, 32 * 2, 92, 32, $data_system.words.armor2)
  343.   self.contents.draw_text(4, 32 * 3, 92, 32, $data_system.words.armor3)
  344.   self.contents.draw_text(5, 32 * 4, 92, 32, $data_system.words.armor4)
  345.   draw_item_name(@data[0], 92, 32 * 0)
  346.   draw_item_name(@data[1], 92, 32 * 1)
  347.   draw_item_name(@data[2], 92, 32 * 2)
  348.   draw_item_name(@data[3], 92, 32 * 3)
  349.   draw_item_name(@data[4], 92, 32 * 4)
  350. end

  351. #--------------------------------------------------------------------------
  352. def update_help
  353.   @help_window.set_text(self.item == nil ? "" : self.item.description)
  354. end
  355. end

  356. ############新的装备物品窗口################3
  357. class Window_EquipItem2 < Window_Selectable
  358. # --------------------------------
  359. def initialize(actor, equip_type)
  360.   super(100, 390, 428, 64)
  361.   self.opacity = 130
  362.   @actor = actor
  363.   @equip_type = equip_type
  364.   @column_max = 2
  365.   refresh
  366.   self.active = false
  367.   self.index = -1
  368. end

  369. #--------------------------------------------------------------------------
  370. def item
  371.   return @data[self.index]
  372. end

  373. #--------------------------------------------------------------------------
  374. def refresh
  375.   if self.contents != nil
  376.     self.contents.dispose
  377.     self.contents = nil
  378.   end
  379.   @data = []

  380.   if @equip_type == 0
  381.     weapon_set = $data_classes[@actor.class_id].weapon_set
  382.     for i in 1...$data_weapons.size
  383.       if $game_party.weapon_number(i) > 0 and weapon_set.include?(i)
  384.         @data.push($data_weapons[i])
  385.       end
  386.     end
  387.   end

  388.   if @equip_type != 0
  389.     armor_set = $data_classes[@actor.class_id].armor_set
  390.     for i in 1...$data_armors.size
  391.       if $game_party.armor_number(i) > 0 and armor_set.include?(i)
  392.         if $data_armors[i].kind == @equip_type-1
  393.           @data.push($data_armors[i])
  394.         end
  395.       end
  396.     end
  397.   end

  398.   @data.push(nil)

  399.   @item_max = @data.size
  400.   self.contents = Bitmap.new(width - 32, row_max * 32)
  401.   self.contents.font.name = "宋体"
  402.   self.contents.font.size = 17
  403.   for i in 0...@item_max-1
  404.     draw_item(i)
  405.   end
  406. end

  407. #--------------------------------------------------------------------------
  408. def draw_item(index)
  409.   item = @data[index]
  410.   x = 4 + index % 2 * (182 + 32)
  411.   y = index / 2 * 32
  412.   case item
  413.   when RPG::Weapon
  414.     number = $game_party.weapon_number(item.id)
  415.   when RPG::Armor
  416.     number = $game_party.armor_number(item.id)
  417.   end
  418.   bitmap = RPG::Cache.icon(item.icon_name)
  419.   self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
  420.   self.contents.font.color = normal_color
  421.   self.contents.font.name = "宋体"
  422.   self.contents.font.size = 17
  423.   self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  424.   self.contents.draw_text(x + 132, y, 16, 32, ":", 1)
  425.   self.contents.draw_text(x + 140, y, 24, 32, number.to_s, 2)
  426. end

  427. #--------------------------------------------------------------------------
  428. def update_help
  429.   @help_window.set_text(self.item == nil ? "" : self.item.description)
  430. end
  431. end
复制代码





作者: 美兽    时间: 2006-7-18 17:17
那个天气非常不错,谢谢,收了。
作者: 小湖    时间: 2006-7-18 18:29
不错诶…………{/cy}{/cy}
天气那个能显示在图片之上吗?
作者: frantice    时间: 2006-7-18 22:33
接上7月18日更新的商店整合脚本

PART2
  1. #==============================================================================
  2. # | Window_ShopBuy
  3. #------------------------------------------------------------------------------
  4. # 商店购买窗口
  5. #==============================================================================

  6. class Window_ShopBuy < Window_Selectable

  7. #--------------------------------------------------------------------------
  8. def initialize(shop_goods)
  9.   super(0, 130, 320, 260)
  10.   self.opacity = 130
  11.   @shop_goods = shop_goods
  12.   refresh
  13.   self.index = 0
  14. end

  15. #--------------------------------------------------------------------------
  16. def item
  17.   return @data[self.index]
  18. end

  19. #--------------------------------------------------------------------------
  20. def refresh
  21.   if self.contents != nil
  22.     self.contents.dispose
  23.     self.contents = nil
  24.   end
  25.   @data = []
  26.   for goods_item in @shop_goods
  27.     case goods_item[0]
  28.     when 0
  29.       item = $data_items[goods_item[1]]
  30.     when 1
  31.       item = $data_weapons[goods_item[1]]
  32.     when 2
  33.       item = $data_armors[goods_item[1]]
  34.     end
  35.     if item != nil
  36.       @data.push(item)
  37.     end
  38.   end

  39.   @item_max = @data.size
  40.   if @item_max > 0
  41.     self.contents = Bitmap.new(width - 32, row_max * 32)
  42.     self.contents.font.name = "宋体"
  43.     self.contents.font.size = 18
  44.     for i in 0...@item_max
  45.       draw_item(i)
  46.     end
  47.   end
  48. end

  49. #--------------------------------------------------------------------------
  50. def draw_item(index)
  51.   item = @data[index]

  52.   case item
  53.   when RPG::Item
  54.     number = $game_party.item_number(item.id)
  55.   when RPG::Weapon
  56.     number = $game_party.weapon_number(item.id)
  57.   when RPG::Armor
  58.     number = $game_party.armor_number(item.id)
  59.   end

  60.   if item.price <= $game_party.gold and number < 99
  61.     self.contents.font.color = normal_color
  62.   else
  63.     self.contents.font.color = disabled_color
  64.   end
  65.   x = 4
  66.   y = index * 32
  67.   rect = Rect.new(x, y, self.width - 32, 32)
  68.   self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  69.   bitmap = RPG::Cache.icon(item.icon_name)
  70.   opacity = self.contents.font.color == normal_color ? 255 : 128
  71.   self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  72.   self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  73.   self.contents.draw_text(x + 190, y, 88, 32, item.price.to_s, 2)
  74. end

  75. #--------------------------------------------------------------------------
  76. def update_help
  77.   @help_window.set_text(self.item == nil ? "" : self.item.description)
  78. end
  79. end





  80. #==============================================================================
  81. # | Window_ShopSell
  82. #------------------------------------------------------------------------------
  83. # 商店卖出窗口
  84. #==============================================================================

  85. class Window_ShopSell < Window_Selectable

  86. #--------------------------------------------------------------------------
  87. def initialize
  88.   super(320, 130, 320, 260)
  89.   self.opacity = 130
  90.   @column_max = 1
  91.   refresh
  92.   self.index = 0
  93. end

  94. #--------------------------------------------------------------------------
  95. def item
  96.   return @data[self.index]
  97. end

  98. #--------------------------------------------------------------------------
  99. def refresh
  100.   if self.contents != nil
  101.     self.contents.dispose
  102.     self.contents = nil
  103.   end
  104.   @data = []
  105.   for i in 1...$data_items.size
  106.     if $game_party.item_number(i) > 0
  107.       @data.push($data_items[i])
  108.     end
  109.   end
  110.   for i in 1...$data_weapons.size
  111.     if $game_party.weapon_number(i) > 0
  112.       @data.push($data_weapons[i])
  113.     end
  114.   end
  115.   for i in 1...$data_armors.size
  116.     if $game_party.armor_number(i) > 0
  117.       @data.push($data_armors[i])
  118.     end
  119.   end

  120.   @item_max = @data.size
  121.   if @item_max > 0
  122.     self.contents = Bitmap.new(width - 32, row_max * 32)
  123.     self.contents.font.name = "宋体"
  124.     self.contents.font.size = 18
  125.     for i in 0...@item_max
  126.       draw_item(i)
  127.     end
  128.   end
  129. end

  130. #--------------------------------------------------------------------------
  131. def draw_item(index)
  132.   item = @data[index]
  133.   case item
  134.   when RPG::Item
  135.     number = $game_party.item_number(item.id)
  136.   when RPG::Weapon
  137.     number = $game_party.weapon_number(item.id)
  138.   when RPG::Armor
  139.     number = $game_party.armor_number(item.id)
  140. end

  141.   if item.price > 0
  142.     self.contents.font.color = normal_color
  143.   else
  144.     self.contents.font.color = disabled_color
  145.   end
  146.   x = 4 + index % 1 * (288 + 32)
  147.   y = index / 1 * 32
  148.   rect = Rect.new(x, y, self.width / @column_max - 32, 32)
  149.   self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  150.   bitmap = RPG::Cache.icon(item.icon_name)
  151.   opacity = self.contents.font.color == normal_color ? 255 : 128
  152.   self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  153.   self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  154.   self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
  155.   self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
  156. end

  157. #--------------------------------------------------------------------------
  158. def update_help
  159.   @help_window.set_text(self.item == nil ? "" : self.item.description)
  160. end

  161. end


  162. #==============================================================================
  163. # | Window_ShopNumber
  164. #------------------------------------------------------------------------------
  165. # 商店数值输入窗口
  166. #==============================================================================

  167. class Window_ShopNumber < Window_Base

  168. #--------------------------------------------------------------------------
  169. def initialize
  170.   super(0, 130, 320, 260)
  171.   self.contents = Bitmap.new(width - 32, height - 32)
  172.   self.contents.font.name = "宋体"
  173.   self.contents.font.size = 18
  174.   self.opacity = 130
  175.   @item = nil
  176.   @max = 1
  177.   @price = 0
  178.   @number = 1
  179. end

  180. #--------------------------------------------------------------------------
  181. def set(item, max, price)
  182.   @item = item
  183.   @max = max
  184.   @price = price
  185.   @number = 1
  186.   refresh
  187. end

  188. #--------------------------------------------------------------------------
  189. def number
  190.   return @number
  191. end

  192. #--------------------------------------------------------------------------
  193. def refresh
  194.   self.contents.clear
  195.   draw_item_name(@item, 4, 96)
  196.   self.contents.font.color = normal_color
  197.   self.contents.draw_text(182, 128, 32, 32, "×")
  198.   self.contents.draw_text(154, 128, 24, 32, @number.to_s, 2)
  199.   self.cursor_rect.set(304, 96, 32, 32)

  200.   domination = $data_system.words.gold
  201.   cx = contents.text_size(domination).width
  202.   total_price = @price * @number
  203.   self.contents.font.color = normal_color
  204.   self.contents.draw_text(-50, 160, 328-cx-2, 32, total_price.to_s, 2)
  205.   self.contents.font.color = system_color
  206.   self.contents.draw_text(282-cx, 160, cx, 32, domination, 2)
  207. end

  208. #--------------------------------------------------------------------------
  209. def update
  210.   super
  211.   if self.active

  212.     if Input.repeat?(Input::RIGHT) and @number < @max
  213.       $game_system.se_play($data_system.cursor_se)
  214.       @number += 1
  215.       refresh
  216.     end

  217.     if Input.repeat?(Input::LEFT) and @number > 1
  218.       $game_system.se_play($data_system.cursor_se)
  219.       @number -= 1
  220.       refresh
  221.     end

  222.     if Input.repeat?(Input::UP) and @number < @max
  223.       $game_system.se_play($data_system.cursor_se)
  224.       @number = [@number + 10, @max].min
  225.       refresh
  226.     end

  227.     if Input.repeat?(Input::DOWN) and @number > 1
  228.       $game_system.se_play($data_system.cursor_se)
  229.       @number = [@number - 10, 1].max
  230.       refresh
  231.     end
  232.   end
  233. end
  234. end

  235. #==============================================================================
  236. # | Window_ShopStatus
  237. #------------------------------------------------------------------------------
  238. #  商店状态窗口~这个在论坛上可以找到(一段不好的往事。)……
  239. #  在人物行走的基础上强化了所有属性变化的显示(就是当时我当时说的应该强化的那
  240. #  一部分,可惜在这个脚本发现之前我就已经拼出来这个效果了55555555……)
  241. #  部分字没有翻译,自己搜索下是什么意思。
  242. #==============================================================================

  243. class Window_ShopStatus < Window_Base

  244. #--------------------------------------------------------------------------
  245. def initialize
  246.   super(320, 130, 320, 260)
  247.   self.contents = Bitmap.new(width - 32, height - 32)
  248.   self.contents.font.name = "宋体"
  249.   self.contents.font.size = 18
  250.   self.opacity = 130
  251.   @sprite1 = nil
  252.   @sprite2 = nil
  253.   @sprite3 = nil
  254.   @sprite4 = nil
  255.   @walk = [false, false, false, false]
  256.   @count = 0
  257.   @item = nil
  258.   refresh
  259. end

  260. #--------------------------------------------------------------------------
  261. def refresh
  262.   self.contents.clear
  263.   if @sprite1 != nil
  264.     @sprite1.dispose
  265.     @sprite1 = nil
  266.   end
  267.   if @sprite2 != nil
  268.     @sprite2.dispose
  269.     @sprite2 = nil
  270.   end
  271.   if @sprite3 != nil
  272.     @sprite3.dispose
  273.     @sprite3 = nil
  274.   end
  275.   if @sprite4 != nil
  276.     @sprite4.dispose
  277.     @sprite4 = nil
  278.   end
  279.   self.contents.font.name = "宋体"
  280.   self.contents.font.size = 18
  281.   if @item == nil
  282.     return
  283.   end
  284.   case @item
  285.   when RPG::Item
  286.     number = $game_party.item_number(@item.id)
  287.   when RPG::Weapon
  288.     number = $game_party.weapon_number(@item.id)
  289.   when RPG::Armor
  290.     number = $game_party.armor_number(@item.id)
  291.   end
  292.   self.contents.font.color = system_color
  293.   self.contents.draw_text(4, -8, 200, 32, "已装备:")
  294.   self.contents.font.color = normal_color
  295.   self.contents.draw_text(204, -8, 32, 32, number.to_s, 2)
  296.   if @item.is_a?(RPG::Item)
  297.     @walk = [false, false, false, false]
  298.     return
  299.   end
  300.   for i in 0...$game_party.actors.size
  301.     actor = $game_party.actors[i]
  302.     if @item.is_a?(RPG::Weapon)
  303.       item1 = $data_weapons[actor.weapon_id]
  304.     elsif @item.kind == 0
  305.       item1 = $data_armors[actor.armor1_id]
  306.     elsif @item.kind == 1
  307.       item1 = $data_armors[actor.armor2_id]
  308.     elsif @item.kind == 2
  309.       item1 = $data_armors[actor.armor3_id]
  310.     else
  311.       item1 = $data_armors[actor.armor4_id]
  312.     end
  313.     if not actor.equippable?(@item)
  314.       @walk[i] = false
  315.       draw_actor_graphic(actor, 330, 194 + 64 * i, i, 0)
  316.       self.contents.font.name = "宋体"
  317.       self.contents.font.size = 18
  318.       self.contents.font.color = normal_color
  319.       self.contents.draw_text(32, 26 + (54 * i), 150, 32, "无法装备")
  320.     end
  321.     if actor.equippable?(@item)
  322.       @walk[i] = true
  323.       draw_actor_graphic(actor, 330, 144 + 64 * i, i, 1)
  324.         atk1 = 0
  325.         atk2 = 0
  326.         eva1 = 0
  327.         eva2 = 0
  328.         str1 = 0
  329.         str2 = 0
  330.         dex1 = 0
  331.         dex2 = 0
  332.         agi1 = 0
  333.         agi2 = 0
  334.         int1 = 0
  335.         int2 = 0
  336.         pdf1 = 0
  337.         pdf2 = 0
  338.         mdf1 = 0
  339.         mdf2 = 0
  340.         eva1 = 0
  341.         eva2 = 0
  342.         str1 = item1 != nil ? item1.str_plus : 0
  343.         str2 = @item != nil ? @item.str_plus : 0
  344.         dex1 = item1 != nil ? item1.dex_plus : 0
  345.         dex2 = @item != nil ? @item.dex_plus : 0
  346.         agi1 = item1 != nil ? item1.agi_plus : 0
  347.         agi2 = @item != nil ? @item.agi_plus : 0
  348.         int1 = item1 != nil ? item1.int_plus : 0
  349.         int2 = @item != nil ? @item.int_plus : 0
  350.         pdf1 = item1 != nil ? item1.pdef : 0
  351.         pdf2 = @item != nil ? @item.pdef : 0
  352.         mdf1 = item1 != nil ? item1.mdef : 0
  353.         mdf2 = @item != nil ? @item.mdef : 0
  354.       if @item.is_a?(RPG::Weapon)
  355.         atk1 = item1 != nil ? item1.atk : 0
  356.         atk2 = @item != nil ? @item.atk : 0
  357.       end
  358.       if @item.is_a?(RPG::Armor)
  359.         eva1 = item1 != nil ? item1.eva : 0
  360.         eva2 = @item != nil ? @item.eva : 0
  361.       end
  362.       str_change = str2 - str1
  363.       dex_change = dex2 - dex1
  364.       agi_change = agi2 - agi1
  365.       int_change = int2 - int1
  366.       pdf_change = pdf2 - pdf1
  367.       mdf_change = mdf2 - mdf1
  368.       atk_change = atk2 - atk1
  369.       eva_change = eva2 - eva1
  370.       if item1 == nil
  371.         name1 = ""
  372.       else
  373.         name1 = item1.name
  374.       end
  375.       if @item == nil
  376.         name2 = ""
  377.       else
  378.         name2 = @item.name
  379.       end
  380.       if str_change == 0 && dex_change == 0 && agi_change == 0 &&
  381.       pdf_change == 0 && mdf_change == 0 && atk_change == 0 &&
  382.       eva_change == 0 && name1 != name2
  383.         self.contents.font.name = "宋体"
  384.         self.contents.font.size = 18
  385.         self.contents.font.color = normal_color
  386.         self.contents.draw_text(32, 26 + (54 * i), 150, 32, "没有改变")
  387.       end
  388.       if name1 == name2
  389.         self.contents.font.name = "宋体"
  390.         self.contents.font.size = 18
  391.         self.contents.font.color = normal_color
  392.         self.contents.draw_text(32, 26 + (54 * i), 200, 32, "已装备")
  393.       end
  394.       self.contents.font.name = "宋体"
  395.       self.contents.font.size = 16
  396.       self.contents.font.color = normal_color
  397.       if @item.is_a?(RPG::Weapon) && atk_change != 0
  398.         self.contents.draw_text(32, 10 + (54 * i), 32, 32, "ATK")
  399.       end
  400.       if @item.is_a?(RPG::Armor) && eva_change != 0
  401.         self.contents.draw_text(32, 10 + (54 * i), 32, 32, "EVA")
  402.       end
  403.       if pdf_change != 0
  404.         self.contents.draw_text(32, 26 + (54 * i), 32, 32, "PDF")
  405.       end
  406.       if mdf_change != 0
  407.         self.contents.draw_text(32, 42 + (54 * i), 32, 32, "MDF")
  408.       end
  409.       if str_change != 0
  410.         self.contents.draw_text(112, 10 + (54 * i), 32, 32, "STR")
  411.       end
  412.       if dex_change != 0
  413.         self.contents.draw_text(112, 26 + (54 * i), 32, 32, "DEX")
  414.       end
  415.       if agi_change != 0
  416.         self.contents.draw_text(112, 42 + (54 * i), 32, 32, "AGI")
  417.       end
  418.       if str_change != 0
  419.         self.contents.draw_text(192, 10 + (54 * i), 32, 32, "INT")
  420.       end
  421.       if @item.is_a?(RPG::Weapon) && atk_change > 0
  422.         self.contents.font.color = up_color
  423.         s = atk_change.abs.to_s
  424.         self.contents.draw_text(60, 10 + (54 * i), 4, 32, "+")
  425.         self.contents.draw_text(62, 10 + (54 * i), 24, 32, s, 2)
  426.       end
  427.       if @item.is_a?(RPG::Weapon) && atk_change < 0
  428.         self.contents.font.color = down_color
  429.         s = atk_change.abs.to_s
  430.         self.contents.draw_text(60, 10 + (54 * i), 4, 32, "-")
  431.         self.contents.draw_text(62, 10 + (54 * i), 24, 32, s, 2)
  432.       end
  433.       if @item.is_a?(RPG::Armor) && eva_change > 0
  434.         self.contents.font.color = up_color
  435.         s = eva_change.abs.to_s
  436.         self.contents.draw_text(60, 10 + (54 * i), 4, 32, "+")
  437.         self.contents.draw_text(62, 10 + (54 * i), 24, 32, s, 2)
  438.       end
  439.       if @item.is_a?(RPG::Armor) && eva_change < 0
  440.         self.contents.font.color = down_color
  441.         s = eva_change.abs.to_s
  442.         self.contents.draw_text(60, 10 + (54 * i), 4, 32, "-")
  443.         self.contents.draw_text(62, 10 + (54 * i), 24, 32, s, 2)
  444.       end
  445.       if pdf_change > 0
  446.         self.contents.font.color = up_color
  447.         s = pdf_change.abs.to_s
  448.         self.contents.draw_text(60, 26 + (54 * i), 4, 32, "+")
  449.         self.contents.draw_text(62, 26 + (54 * i), 24, 32, s, 2)
  450.       end
  451.       if pdf_change < 0
  452.         self.contents.font.color = down_color
  453.         s = pdf_change.abs.to_s
  454.         self.contents.draw_text(60, 26 + (54 * i), 4, 32, "-")
  455.         self.contents.draw_text(62, 26 + (54 * i), 24, 32, s, 2)
  456.       end
  457.       if mdf_change > 0
  458.         self.contents.font.color = up_color
  459.         s = mdf_change.abs.to_s
  460.         self.contents.draw_text(60, 42 + (54 * i), 4, 32, "+")
  461.         self.contents.draw_text(62, 42 + (54 * i), 24, 32, s, 2)
  462.       end
  463.       if mdf_change < 0
  464.         self.contents.font.color = down_color
  465.         s = mdf_change.abs.to_s
  466.         self.contents.draw_text(60, 42 + (54 * i), 4, 32, "-")
  467.         self.contents.draw_text(62, 42 + (54 * i), 24, 32, s, 2)
  468.       end
  469.       if str_change > 0
  470.         self.contents.font.color = up_color
  471.         s = str_change.abs.to_s
  472.         self.contents.draw_text(140, 10 + (54 * i), 4, 32, "+")
  473.         self.contents.draw_text(142, 10 + (54 * i), 24, 32, s, 2)
  474.       end
  475.       if str_change < 0
  476.         self.contents.font.color = down_color
  477.         s = str_change.abs.to_s
  478.         self.contents.draw_text(140, 10 + (54 * i), 4, 32, "-")
  479.         self.contents.draw_text(142, 10 + (54 * i), 24, 32, s, 2)
  480.       end
  481.       if dex_change > 0
  482.         self.contents.font.color = up_color
  483.         s = dex_change.abs.to_s
  484.         self.contents.draw_text(140, 26 + (54 * i), 4, 32, "+")
  485.         self.contents.draw_text(142, 26 + (54 * i), 24, 32, s, 2)
  486.       end
  487.       if dex_change < 0
  488.         self.contents.font.color = down_color
  489.         s = dex_change.abs.to_s
  490.         self.contents.draw_text(140, 26 + (54 * i), 4, 32, "-")
  491.         self.contents.draw_text(142, 26 + (54 * i), 24, 32, s, 2)
  492.       end
  493.       if agi_change > 0
  494.         self.contents.font.color = up_color
  495.         s = agi_change.abs.to_s
  496.         self.contents.draw_text(140, 42 + (54 * i), 4, 32, "+")
  497.         self.contents.draw_text(142, 42 + (54 * i), 24, 32, s, 2)
  498.       end
  499.       if agi_change < 0
  500.         self.contents.font.color = down_color
  501.         s = agi_change.abs.to_s
  502.         self.contents.draw_text(140, 42 + (54 * i), 4, 32, "-")
  503.         self.contents.draw_text(142, 42 + (54 * i), 24, 32, s, 2)
  504.       end
  505.       if int_change > 0
  506.         self.contents.font.color = up_color
  507.         s = int_change.abs.to_s
  508.         self.contents.draw_text(220, 10 + (54 * i), 4, 32, "+")
  509.         self.contents.draw_text(222, 10 + (54 * i), 24, 32, s, 2)
  510.       end
  511.       if int_change < 0
  512.         self.contents.font.color = down_color
  513.         s = int_change.abs.to_s
  514.         self.contents.draw_text(220, 10 + (54 * i), 4, 32, "-")
  515.         self.contents.draw_text(222, 10 + (54 * i), 24, 32, s, 2)
  516.       end
  517.     end
  518.   end
  519. end
  520. # ---------------------------------------
  521. def item=(item)
  522.   if @item != item
  523.     @item = item
  524.     refresh
  525.   end
  526. end
  527. # ---------------------------------------
  528. def draw_actor_graphic(actor, x, y, id, tone_id)
  529.   if id == 0
  530.     @v1 = Viewport.new(330, 164, 32, 48)
  531.     @v1.z = 9998
  532.     @sprite1 = Sprite.new(@v1)
  533.     @sprite1.bitmap = RPG::Cache.character(actor.character_name,
  534.     actor.character_hue)
  535.     if tone_id == 0
  536.       @sprite1.tone = Tone.new(0, 0, 0, 255)
  537.     else
  538.       @sprite1.tone = Tone.new(0, 0, 0, 0)
  539.     end
  540.     @sprite1.visible = true
  541.   end
  542.    if id == 1
  543.     @v2 = Viewport.new(330, 218, 32, 48)
  544.     @v2.z = 9999
  545.     @sprite2 = Sprite.new(@v2)
  546.     @sprite2.bitmap = RPG::Cache.character(actor.character_name,
  547.     actor.character_hue)
  548.     if tone_id == 0
  549.       @sprite2.tone = Tone.new(0, 0, 0, 255)
  550.     else
  551.       @sprite2.tone = Tone.new(0, 0, 0, 0)
  552.     end
  553.     @sprite2.visible = true
  554.   end
  555.    if id == 2
  556.     @v3 = Viewport.new(330, 272, 32, 48)
  557.     @v3.z = 9999
  558.     @sprite3 = Sprite.new(@v3)
  559.     @sprite3.bitmap = RPG::Cache.character(actor.character_name,
  560.     actor.character_hue)
  561.     if tone_id == 0
  562.       @sprite3.tone = Tone.new(0, 0, 0, 255)
  563.     else
  564.       @sprite3.tone = Tone.new(0, 0, 0, 0)
  565.     end
  566.     @sprite3.visible = true
  567.   end
  568.   if id == 3
  569.     @v4 = Viewport.new(330, 326, 32, 48)
  570.     @v4.z = 9999
  571.     @sprite4 = Sprite.new(@v4)
  572.     @sprite4.bitmap = RPG::Cache.character(actor.character_name,
  573.     actor.character_hue)
  574.     if tone_id == 0
  575.       @sprite4.tone = Tone.new(0, 0, 0, 255)
  576.     else
  577.       @sprite4.tone = Tone.new(0, 0, 0, 0)
  578.     end
  579.     @sprite4.visible = true
  580.   end
  581. end
  582. # ---------------------------------------
  583. def update
  584.   super
  585.   @count += 1
  586.   for i in [email protected]
  587.       if @walk[i] == false
  588.       case i
  589.         when 0
  590.           if @sprite1 != nil
  591.           @sprite1.ox = 0
  592.           end
  593.         when 1
  594.           if @sprite2 != nil
  595.           @sprite2.ox = 0
  596.           end
  597.         when 2
  598.           if @sprite3 != nil
  599.           @sprite3.ox = 0
  600.           end
  601.         when 3
  602.           if @sprite4 != nil
  603.           @sprite4.ox = 0
  604.           end
  605.         end
  606.       end
  607.     end
  608.   if @count == 0
  609.     for i in [email protected]
  610.       if @walk[i] == true
  611.       case i
  612.       when 0
  613.         if @sprite1 != nil
  614.         @sprite1.ox = 0
  615.         end
  616.       when 1
  617.         if @sprite2 != nil
  618.         @sprite2.ox = 0
  619.         end
  620.       when 2
  621.         if @sprite3 != nil
  622.         @sprite3.ox = 0
  623.         end
  624.       when 3
  625.         if @sprite4 != nil
  626.         @sprite4.ox = 0
  627.           end
  628.         end
  629.       end
  630.     end
  631.   end
  632.   if @count == 5
  633.     for i in [email protected]
  634.       if @walk[i] == true
  635.       case i
  636.       when 0
  637.         if @sprite1 != nil
  638.         @sprite1.ox = 32
  639.         end
  640.       when 1
  641.         if @sprite2 != nil
  642.         @sprite2.ox = 32
  643.         end
  644.       when 2
  645.         if @sprite3 != nil
  646.         @sprite3.ox = 32
  647.         end
  648.       when 3
  649.         if @sprite4 != nil
  650.         @sprite4.ox = 32
  651.           end
  652.         end
  653.       end
  654.     end
  655.   end
  656.   if @count == 10
  657.     for i in [email protected]
  658.       if @walk[i] == true
  659.         case i
  660.       when 0
  661.         if @sprite1 != nil
  662.         @sprite1.ox = 64
  663.         end
  664.       when 1
  665.         if @sprite2 != nil
  666.         @sprite2.ox = 64
  667.         end
  668.       when 2
  669.         if @sprite3 != nil
  670.         @sprite3.ox = 64
  671.         end
  672.       when 3
  673.         if @sprite4 != nil
  674.         @sprite4.ox = 64
  675.           end
  676.         end
  677.       end
  678.     end
  679.   end
  680.   if @count == 15
  681.     @count = 0
  682.   end
  683. end
  684. end
  685. #==============================================================================
  686. # | Window_Help
  687. #------------------------------------------------------------------------------
  688. #==============================================================================

  689. class Window_HelpShop < Window_Base
  690. #--------------------------------------------------------------------------
  691. def initialize
  692.   super(80, 70, 480, 64)
  693. self.contents = Bitmap.new(width - 32, height - 32)
  694.   self.contents.font.name = "宋体"
  695.   self.contents.font.size = 18
  696.   self.opacity = 130
  697. end

  698. #--------------------------------------------------------------------------
  699. def set_text(text, align = 1)
  700.   if text != @text or align != @align
  701.     self.contents.clear
  702.     self.contents.font.color = normal_color
  703.     self.contents.draw_text(4, 0, self.width - 40, 32, text, align)
  704.     @text = text
  705.     @align = align
  706.     @actor = nil
  707.   end
  708.   self.visible = true
  709. end

  710. #--------------------------------------------------------------------------
  711. def set_actor(actor)
  712.   if actor != @actor
  713.     self.contents.clear
  714.     draw_actor_name(actor, 4, 0)
  715.     draw_actor_state(actor, 140, 0)
  716.     draw_actor_hp(actor, 284, 0)
  717.     draw_actor_sp(actor, 460, 0)
  718.     @actor = actor
  719.     @text = nil
  720.     self.visible = true
  721.   end
  722. end

  723. #--------------------------------------------------------------------------
  724. def set_enemy(enemy)
  725.   text = enemy.name
  726.   state_text = make_battler_state_text(enemy, 112, false)
  727.   if state_text != ""
  728.     text += "  " + state_text
  729.   end
  730.   set_text(text, 1)
  731. end
  732. end


  733. #==============================================================================
  734. # | Scene_Shop
  735. #------------------------------------------------------------------------------
  736. # 对比下看看什么东西改变了~
  737. #==============================================================================

  738. class Scene_Shop

  739. #--------------------------------------------------------------------------
  740. def main
  741.   @spriteset = Spriteset_Map.new
  742.   @help_window = Window_HelpShop.new
  743.   @command_window = Window_ShopCommand.new
  744.   @command_window. x = 100
  745.   @command_window. y = 390
  746.   @gold_window = Window_Gold2.new
  747.   @gold_window.x = 240
  748.   @gold_window.y = 8
  749.   @buy_window = Window_ShopBuy.new($game_temp.shop_goods)
  750.   @buy_window.active = false
  751.   @buy_window.visible = false
  752.   @buy_window.help_window = @help_window
  753.   @sell_window = Window_ShopSell.new
  754.   @sell_window.active = false
  755.   @sell_window.visible = false
  756.   @sell_window.help_window = @help_window
  757.   @number_window = Window_ShopNumber.new
  758.   @number_window.active = false
  759.   @number_window.visible = false
  760.   @status_window = Window_ShopStatus.new
  761.   @status_window.visible = false
  762.   #command
  763.   Graphics.transition
  764.   loop do
  765.     Graphics.update
  766.     Input.update
  767.     update
  768.     if $scene != self
  769.       break
  770.     end
  771.   end
  772.   Graphics.freeze
  773.   @spriteset.dispose
  774.   @help_window.dispose
  775.   @command_window.dispose
  776.   @gold_window.dispose
  777.   @buy_window.dispose
  778.   @sell_window.dispose
  779.   @number_window.dispose
  780.   @status_window.dispose
  781. end

  782. #--------------------------------------------------------------------------
  783. def update
  784.   @help_window.update
  785.   @command_window.update
  786.   @gold_window.update
  787.   @buy_window.update
  788.   @sell_window.update
  789.   @number_window.update
  790.   @status_window.update
  791.   
  792.   if @command_window.active
  793.     update_command
  794.     return
  795.   end
  796.   if @buy_window.active
  797.     update_buy
  798.     return
  799.   end
  800.   if @sell_window.active
  801.     update_sell
  802.     return
  803.   end
  804.   if @number_window.active
  805.     update_number
  806.     return
  807.   end
  808. end
复制代码



作者: frantice    时间: 2006-7-18 22:35
接上7月18日更新的商店整合脚本

用的时候3个部分连接在一起放一个脚本里,嗯。

PART3
  1. #--------------------------------------------------------------------------
  2. def update_command
  3.   if Input.trigger?(Input::B)
  4.     $game_system.se_play($data_system.cancel_se)
  5.     $scene = Scene_Map.new
  6.     return
  7.   end
  8.   if Input.trigger?(Input::C)
  9.     case @command_window.index
  10.     when 0
  11.       $game_system.se_play($data_system.decision_se)
  12.       @command_window.active = false
  13.       @buy_window.active = true
  14.       @buy_window.visible = true
  15.       @buy_window.refresh
  16.       @status_window.visible = true
  17.     when 1
  18.       $game_system.se_play($data_system.decision_se)
  19.       @command_window.active = false
  20.       @sell_window.active = true
  21.       @sell_window.visible = true
  22.       @sell_window.refresh
  23.     when 2
  24.       $game_system.se_play($data_system.decision_se)
  25.       # 这个加进去的装备界面
  26.       $scene = Scene_Equip2.new
  27.     when 3  
  28.       $game_system.se_play($data_system.decision_se)
  29.       $scene = Scene_Map.new
  30.     end
  31.     return
  32.   end
  33. end

  34. #--------------------------------------------------------------------------
  35. def update_buy

  36.   @status_window.item = @buy_window.item

  37.   if Input.trigger?(Input::B)

  38.     $game_system.se_play($data_system.cancel_se)
  39.     @command_window.active = true
  40.     @buy_window.active = false
  41.     @buy_window.visible = false
  42.     @status_window.visible = false
  43.     @status_window.item = nil
  44.     @help_window.set_text("")
  45.     return
  46.   end

  47.   if Input.trigger?(Input::C)
  48.     @item = @buy_window.item
  49.      if @item == nil or @item.price > $game_party.gold
  50.       $game_system.se_play($data_system.buzzer_se)
  51.       return
  52.     end
  53.     case @item
  54.     when RPG::Item
  55.       number = $game_party.item_number(@item.id)
  56.     when RPG::Weapon
  57.       number = $game_party.weapon_number(@item.id)
  58.     when RPG::Armor
  59.       number = $game_party.armor_number(@item.id)
  60.     end
  61.     if number == 99
  62.       $game_system.se_play($data_system.buzzer_se)
  63.       return
  64.     end
  65.     $game_system.se_play($data_system.decision_se)
  66.     max = @item.price == 0 ? 99 : $game_party.gold / @item.price
  67.     max = [max, 99 - number].min
  68.     @buy_window.active = false
  69.     @buy_window.visible = false
  70.     @number_window.set(@item, max, @item.price)
  71.     @number_window.active = true
  72.     @number_window.visible = true
  73.   end
  74. end

  75. #--------------------------------------------------------------------------
  76. def update_sell
  77.   
  78.   if Input.trigger?(Input::B)
  79.    $game_system.se_play($data_system.cancel_se)
  80.    @command_window.active = true
  81.    @sell_window.active = false
  82.    @sell_window.visible = false
  83.    @status_window.item = nil
  84.    ##########下面这个没了##########
  85.    #@status_window.visible = false
  86.    @help_window.set_text("")
  87.    return
  88. end

  89. if Input.trigger?(Input::C)
  90.    @item = @sell_window.item
  91.    @status_window.item = @item
  92.    if @item == nil or @item.price == 0
  93.      $game_system.se_play($data_system.buzzer_se)
  94.      @status_window.item = nil
  95.      @status_window.item =  @item
  96.      return
  97.    end
  98.    $game_system.se_play($data_system.decision_se)
  99.    case @item
  100.    when RPG::Item
  101.      number = $game_party.item_number(@item.id)
  102.    when RPG::Weapon
  103.      number = $game_party.weapon_number(@item.id)
  104.    when RPG::Armor
  105.      number = $game_party.armor_number(@item.id)
  106.    end
  107.    max = number
  108.    @sell_window.active = false
  109.    @sell_window.visible = false
  110.    @number_window.set(@item, max, @item.price / 2)
  111.    @number_window.active = true
  112.    @number_window.visible = true
  113.    @status_window.visible = true
  114. end
  115. end
  116. #--------------------------------------------------------------------------
  117. def update_number
  118. if Input.trigger?(Input::B)
  119.    $game_system.se_play($data_system.cancel_se)
  120.    @number_window.active = false
  121.    @number_window.visible = false
  122.    case @command_window.index
  123.    when 0
  124.      @buy_window.active = true
  125.      @buy_window.visible = true
  126.    when 1  
  127.      @sell_window.active = true
  128.      @sell_window.visible = true
  129.      @status_window.visible = false
  130.      @status_window.item = nil
  131.    end
  132.    return
  133. end

  134. if Input.trigger?(Input::C)
  135.    $game_system.se_play($data_system.shop_se)
  136.    @number_window.active = false
  137.    @number_window.visible = false
  138.    case @command_window.index
  139.    when 0
  140.      $game_party.lose_gold(@number_window.number * @item.price)
  141.      case @item
  142.      when RPG::Item
  143.        $game_party.gain_item(@item.id, @number_window.number)
  144.      when RPG::Weapon
  145.        $game_party.gain_weapon(@item.id, @number_window.number)
  146.      when RPG::Armor
  147.        $game_party.gain_armor(@item.id, @number_window.number)
  148.      end
  149.      @gold_window.refresh
  150.      @buy_window.refresh
  151.      @status_window.refresh
  152.      @buy_window.active = true
  153.      @buy_window.visible = true
  154.    when 1
  155.      $game_party.gain_gold(@number_window.number * (@item.price / 2))
  156.      case @item
  157.      when RPG::Item
  158.        $game_party.lose_item(@item.id, @number_window.number)
  159.      when RPG::Weapon
  160.        $game_party.lose_weapon(@item.id, @number_window.number)
  161.      when RPG::Armor
  162.        $game_party.lose_armor(@item.id, @number_window.number)
  163.      end
  164.      @gold_window.refresh
  165.      @sell_window.refresh
  166.      @status_window.refresh
  167.      @sell_window.active = true
  168.      @sell_window.visible = true
  169.      @status_window.visible = false
  170.      @status_window.item = nil
  171.    end
  172.    return
  173. end
  174. end
  175. end


  176. #==============================================================================
  177. # ■ Scene_Equip2
  178. #------------------------------------------------------------------------------
  179. #  新的装备画面处理~对照原先的装备画面看看哪里变了
  180. #==============================================================================

  181. class Scene_Equip2

  182. #--------------------------------------------------------------------------
  183. def initialize(actor_index = 0, equip_index = 0)
  184.   @actor_index = actor_index
  185.   @equip_index = equip_index
  186. end

  187. #--------------------------------------------------------------------------
  188. def main
  189.   @spriteset = Spriteset_Map.new
  190.   @actor = $game_party.actors[@actor_index]
  191.   @equipment_window = Window_Equipment.new
  192.   @help_window = Window_Help2.new
  193.   @left_window = Window_EquipLeft2.new(@actor)
  194.   @right_window = Window_EquipRight2.new(@actor)
  195.   @item_window1 = Window_EquipItem2.new(@actor, 0)
  196.   @item_window2 = Window_EquipItem2.new(@actor, 1)
  197.   @item_window3 = Window_EquipItem2.new(@actor, 2)
  198.   @item_window4 = Window_EquipItem2.new(@actor, 3)
  199.   @item_window5 = Window_EquipItem2.new(@actor, 4)
  200.   @right_window.help_window = @help_window
  201.   @item_window1.help_window = @help_window
  202.   @item_window2.help_window = @help_window
  203.   @item_window3.help_window = @help_window
  204.   @item_window4.help_window = @help_window
  205.   @item_window5.help_window = @help_window
  206.   @right_window.index = @equip_index
  207.   refresh
  208.   Graphics.transition
  209.   loop do
  210.     Graphics.update
  211.     Input.update
  212.     update
  213.     if $scene != self
  214.       break
  215.     end
  216.   end
  217.   Graphics.freeze
  218.   @spriteset.dispose
  219.   @equipment_window.dispose
  220.   @help_window.dispose
  221.   @left_window.dispose
  222.   @right_window.dispose
  223.   @item_window1.dispose
  224.   @item_window2.dispose
  225.   @item_window3.dispose
  226.   @item_window4.dispose
  227.   @item_window5.dispose
  228. end
  229. #--------------------------------------------------------------------------
  230. def refresh
  231.   @item_window1.visible = (@right_window.index == 0)
  232.   @item_window2.visible = (@right_window.index == 1)
  233.   @item_window3.visible = (@right_window.index == 2)
  234.   @item_window4.visible = (@right_window.index == 3)
  235.   @item_window5.visible = (@right_window.index == 4)
  236.   item1 = @right_window.item
  237.   case @right_window.index
  238.   when 0
  239.     @item_window = @item_window1
  240.     newmode = 0
  241.   when 1
  242.     @item_window = @item_window2
  243.     newmode = 1
  244.   when 2
  245.     @item_window = @item_window3
  246.     newmode = 1
  247.   when 3
  248.     @item_window = @item_window4
  249.     newmode = 1
  250.   when 4
  251.     @item_window = @item_window5
  252.     newmode = 1
  253.   end
  254.   if newmode != @left_window.mode
  255.     @left_window.mode = newmode
  256.     @left_window.refresh
  257.   end
  258.   if @right_window.active
  259. ##############我要全部都显示####################   
  260.     @left_window.set_new_parameters(nil, nil, nil, nil, nil, nil, nil, nil,
  261.     "", "")
  262.   end
  263.   if @item_window.active
  264.     item2 = @item_window.item
  265.     last_hp = @actor.hp
  266.     last_sp = @actor.sp
  267.     old_atk = @actor.atk
  268.     old_pdef = @actor.pdef
  269.     old_mdef = @actor.mdef
  270.     old_str = @actor.str
  271.     old_dex = @actor.dex
  272.     old_agi = @actor.agi
  273.     old_int = @actor.int
  274.     old_eva = @actor.eva
  275.     @actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
  276.     new_atk = @actor.atk
  277.     new_pdef = @actor.pdef
  278.     new_mdef = @actor.mdef
  279.     new_str = @actor.str
  280.     new_dex = @actor.dex
  281.     new_agi = @actor.agi
  282.     new_int = @actor.int
  283.     new_eva = @actor.eva
  284.     @left_window.changes = [0, 0, 0, 0, 0, 0, 0, 0]
  285.     if new_atk > old_atk
  286.       @left_window.changes[0] = 1
  287.     end
  288.     if new_atk < old_atk
  289.       @left_window.changes[0] = -1
  290.     end
  291.     if new_pdef > old_pdef
  292.       @left_window.changes[1] = 1
  293.     end
  294.     if new_pdef < old_pdef
  295.       @left_window.changes[1] = -1
  296.     end
  297.     if new_mdef > old_mdef
  298.       @left_window.changes[2] = 1
  299.     end
  300.     if new_mdef < old_mdef
  301.       @left_window.changes[2] = -1
  302.     end
  303.      if new_str > old_str
  304.       @left_window.changes[3] = 1
  305.     end
  306.     if new_str < old_str
  307.       @left_window.changes[3] = -1
  308.     end
  309.       if new_dex > old_dex
  310.       @left_window.changes[4] = 1
  311.     end
  312.     if new_dex < old_dex
  313.       @left_window.changes[4] = -1
  314.     end
  315.     if new_agi > old_agi
  316.       @left_window.changes[5] = 1
  317.     end
  318.     if new_agi < old_agi
  319.       @left_window.changes[5] = -1
  320.     end
  321.     if new_int > old_int
  322.       @left_window.changes[6] = 1
  323.     end
  324.     if new_int < old_int
  325.       @left_window.changes[6] = -1
  326.     end
  327.     if new_eva > old_eva
  328.       @left_window.changes[7] = 1
  329.     end
  330.     if new_eva < old_eva
  331.       @left_window.changes[7] = -1
  332.     end
  333.     elem_text = make_elem_text(item2)
  334.     stat_text = make_stat_text(item2)
  335.     @actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)
  336.     @actor.hp = last_hp
  337.     @actor.sp = last_sp
  338.     @left_window.set_new_parameters(new_atk, new_pdef, new_mdef, new_str,
  339.     new_dex, new_agi, new_int, new_eva, elem_text, stat_text)
  340.   end
  341. end
  342. # --------------------------------
  343. def make_elem_text(item)
  344.   text = ""
  345.   flag = false
  346.   if item.is_a?(RPG::Weapon)
  347.     for i in item.element_set
  348.       if flag
  349.         text += ", "
  350.       end
  351.       text += $data_system.elements[i]
  352.       flag = true
  353.     end
  354.   end
  355.   if item.is_a?(RPG::Armor)
  356.     for i in item.guard_element_set
  357.       if flag
  358.         text += ", "
  359.       end
  360.       text += $data_system.elements[i]
  361.       flag = true
  362.     end
  363.   end
  364.   return text
  365. end
  366. # --------------------------------
  367. def make_stat_text(item)
  368.   text = ""
  369.   flag = false
  370.   if item.is_a?(RPG::Weapon)
  371.     for i in item.plus_state_set
  372.       if flag
  373.         text += ", "
  374.       end
  375.       text += $data_states[i].name
  376.       flag = true
  377.     end
  378.   end
  379.   if item.is_a?(RPG::Armor)
  380.     for i in item.guard_state_set
  381.       if flag
  382.         text += ", "
  383.       end
  384.       text += $data_states[i].name
  385.       flag = true
  386.     end
  387.   end
  388.   return text
  389. end

  390. #--------------------------------------------------------------------------
  391. def update
  392.   @equipment_window.update
  393.   @left_window.update
  394.   @right_window.update
  395.   @item_window.update
  396.   refresh
  397.   if @right_window.active
  398.     update_right
  399.     return
  400.   end
  401.   if @item_window.active
  402.     update_item
  403.     return
  404.   end
  405. end

  406. def update_right
  407.   if Input.trigger?(Input::B)
  408.     $game_system.se_play($data_system.cancel_se)
  409. #########我要回到商店窗口#########
  410.     $scene = Scene_Shop.new
  411.     return
  412.   end
  413.   if Input.trigger?(Input::C)
  414.     if @actor.equip_fix?(@right_window.index)
  415.       $game_system.se_play($data_system.buzzer_se)
  416.       return
  417.     end
  418.     $game_system.se_play($data_system.decision_se)
  419.     @right_window.active = false
  420.     @item_window.active = true
  421.     @item_window.index = 0
  422.     return
  423.   end
  424.   
  425.   if Input.trigger?(Input::R)
  426.     $game_system.se_play($data_system.cursor_se)
  427.     @actor_index += 1
  428.     @actor_index %= $game_party.actors.size
  429.     $scene = Scene_Equip2.new(@actor_index, @right_window.index)
  430.     return
  431.   end
  432.   
  433.   if Input.trigger?(Input::L)
  434.     $game_system.se_play($data_system.cursor_se)
  435.     @actor_index += $game_party.actors.size - 1
  436.     @actor_index %= $game_party.actors.size
  437.     $scene = Scene_Equip2.new(@actor_index, @right_window.index)
  438.     return
  439.   end
  440. end
  441. #--------------------------------------------------------------------------
  442. def update_item
  443.   if Input.trigger?(Input::B)
  444.     $game_system.se_play($data_system.cancel_se)
  445.     @right_window.active = true
  446.     @item_window.active = false
  447.     @item_window.index = -1
  448.     return
  449.   end
  450.   if Input.trigger?(Input::C)
  451.     $game_system.se_play($data_system.equip_se)
  452.     item = @item_window.item
  453.     @actor.equip(@right_window.index, item == nil ? 0 : item.id)
  454.     @right_window.active = true
  455.     @item_window.active = false
  456.     @item_window.index = -1
  457.     @right_window.refresh
  458.     @item_window.refresh
  459.     return
  460.   end
  461. end
  462. end
复制代码

作者: frantice    时间: 2006-7-18 22:36
7月19日更新

脚本名:Blackjack纸牌游戏
作者:lanlan  还有发明Blackjack的人=v=
来源:同上

使用方法:pictures里放入下面那张图(原来我已经放上去liao =。=),名字为cards
          使用时调用$scene = Scene_Blackjack.new

胜利条件(我自己看脚本得出的,不知道对不对,原版没有任何说明-  -):
1 我方持数为21,对方没有
2 对方大于22
3 我方小于20但大于对方
差不多这样了,会这种牌的人指点下。。







  1. =begin
  2. -----------------------------------------------------------------
  3. :A scr?pt brought to you by LanLanGames,
  4. :www.LanLanGames.tk, its horrendousgusting

  5. :made by lanlan
  6. :special thanks to those who helped at the
  7. :rmxp.net RGSS support thread
  8. :and to the guy who envented blackjack
  9. -----------------------------------------------------------------
  10. =end

  11. class Scene_Blackjack

  12. def main
  13. @help_window = Window_Help.new
  14. @table_window = Window_Table.new
  15. @bet_window = Window_Bet.new
  16. @bet_window.index = 0
  17. @money_window = Window_Money.new
  18. @hitstay_window = Window_HitStay.new
  19. @hitstay_window.active = false
  20. @cards = []
  21. @graphic = []
  22. @card_used = 0
  23. variable_init
  24. shuffle2
  25. val_graphic
  26. shuffle
  27. Graphics.transition
  28. loop do
  29. Graphics.update
  30. Input.update
  31. update
  32. if $scene != self
  33. break
  34. end
  35. end
  36. Graphics.freeze

  37. @help_window.dispose
  38. @table_window.dispose
  39. @bet_window.dispose
  40. @money_window.dispose
  41. @hitstay_window.dispose
  42. end

  43. def update
  44. @table_window.update
  45. @bet_window.update
  46. @help_window.update
  47. @money_window.update
  48. @hitstay_window.update
  49. if @bet_window.active
  50. update_bet
  51. return
  52. end
  53. if @hitstay_window.active
  54. update_hitstay
  55. return
  56. end
  57. end

  58. def update_bet
  59. if Input.trigger?(Input::B)
  60. $game_system.se_play($data_system.cancel_se)
  61. @bet_window.index = 5
  62. return
  63. end
  64. if Input.trigger?(Input::C)
  65. case @bet_window.index
  66. when 0
  67. @bet = 25
  68. if ($game_party.gold >= @bet) and ((@currentbet+@bet) <= 500)
  69. $game_system.se_play($data_system.decision_se)
  70. bet
  71. else
  72. $game_system.se_play($data_system.buzzer_se)
  73. return
  74. end
  75. when 1
  76. @bet = 50
  77. if ($game_party.gold >= @bet) and ((@currentbet+@bet) <= 500)
  78. $game_system.se_play($data_system.decision_se)
  79. bet
  80. else
  81. $game_system.se_play($data_system.buzzer_se)
  82. return
  83. end
  84. when 2
  85. @bet = 100
  86. if ($game_party.gold >= @bet) and ((@currentbet+@bet) <= 500)
  87. $game_system.se_play($data_system.decision_se)
  88. bet
  89. else
  90. $game_system.se_play($data_system.buzzer_se)
  91. return
  92. end
  93. when 3
  94. @bet = 500
  95. if ($game_party.gold >= @bet) and ((@currentbet+@bet) <= 500)
  96. $game_system.se_play($data_system.decision_se)
  97. bet
  98. else
  99. $game_system.se_play($data_system.buzzer_se)
  100. return
  101. end
  102. when 4
  103. $game_system.se_play($data_system.decision_se)
  104. start_blackjack
  105. when 5
  106. $game_system.se_play($data_system.cancel_se)
  107. $game_party.gain_gold(@currentbet)
  108. $scene = Scene_Map.new
  109. end
  110. end
  111. end

  112. def update_hitstay
  113. if Input.trigger?(Input::B)
  114. $game_system.se_play($data_system.cancel_se)
  115. @hitstay_window.index = 1
  116. return
  117. end
  118. if Input.trigger?(Input::C)
  119. case @hitstay_window.index
  120. when 0
  121. hit
  122. when 1
  123. stay
  124. end
  125. end

  126. end

  127. def bet
  128. $game_party.lose_gold(@bet)
  129. @currentbet += @bet
  130. @money_window.refresh(@currentbet)
  131. end

  132. def start_blackjack
  133. @bet_window.active = false
  134. @m_hand1 = @cards[@card_used]
  135. @graphic1 = @graphic[@card_used]
  136. check_cards
  137. @card_used +=1
  138. @m_hand2 = @cards[@card_used]
  139. @graphic2 = @graphic[@card_used]
  140. check_cards
  141. @card_used +=1
  142. @d_hand1 = @cards[@card_used]
  143. @d_graphic1 = @graphic[@card_used]
  144. check_cards
  145. @card_used +=1
  146. @d_hand2 = @cards[@card_used]
  147. @d_graphic2 = @graphic[@card_used]
  148. @m_total = @m_hand1+@m_hand2
  149. @d_total = @d_hand1+@d_hand2
  150. if @m_hand1 == 1
  151. @m_ace =1
  152. @m_hand1=@m_hand1+10
  153. @m_total=@m_hand1 + @m_hand2
  154. end
  155. if @m_hand2 == 1
  156. if @m_hand1 != 11
  157. @m_ace = 1
  158. @m_hand2 = @m_hand2+10
  159. @m_total = @m_hand1+@m_hand2
  160. else
  161. @m_hand2 = 1
  162. @m_total = @m_hand1+@m_hand2
  163. end
  164. end

  165. if @d_hand1 == 1
  166. @d_ace =1
  167. @d_hand1=@d_hand1+10
  168. @d_total=@d_hand1 + @d_hand2
  169. end
  170. if @d_hand2 == 1
  171. if @d_hand1 != 11
  172. @d_ace = 1
  173. @d_hand2 = @d_hand2+10
  174. @d_total = @d_hand1+@d_hand2
  175. else
  176. @d_card2 = 1
  177. @d_total = @d_hand1+@d_hand2
  178. end
  179. end
  180. draw_cards

  181. check_win

  182. end

  183. def shuffle
  184. j = 51
  185. k = 0
  186. temp = 0
  187. temp2 = 0

  188. while (j>=0)
  189. k = rand(j)

  190. temp = @cards[j]
  191. temp2 = @graphic[j]
  192. @cards[j] = @cards[k]
  193. @graphic[j] = @graphic[k]
  194. @cards[k] = temp
  195. @graphic[k] = temp2

  196. j-=1

  197. end

  198. end

  199. def shuffle2
  200. @cards = [1,2,3,4,5,6,7,8,9,10,10,10,10,
  201. 1,2,3,4,5,6,7,8,9,10,10,10,10,
  202. 1,2,3,4,5,6,7,8,9,10,10,10,10,
  203. 1,2,3,4,5,6,7,8,9,10,10,10,10,
  204. 0,0]
  205. end

  206. def val_graphic
  207. for i in 0...53
  208. @graphic[i] = i
  209. end
  210. end

  211. def check_cards
  212. if @card_used == 52
  213. shuffle
  214. @card_used = 0
  215. end
  216. end

  217. def draw_cards
  218. @table_window.refresh(@m_hand1,@graphic1,
  219. @m_hand2,@graphic2,
  220. @m_hand3,@graphic3,
  221. @m_hand4,@graphic4,
  222. @m_hand5,@graphic5,
  223. @d_hand1,52,
  224. @d_hand2,@d_graphic2,
  225. @d_hand3,@d_graphic3,
  226. @d_hand4,@d_graphic4,
  227. @d_hand5,@d_graphic5,
  228. @m_total)
  229. end

  230. def draw_real_cards
  231. @table_window.refresh(@m_hand1,@graphic1,
  232. @m_hand2,@graphic2,
  233. @m_hand3,@graphic3,
  234. @m_hand4,@graphic4,
  235. @m_hand5,@graphic5,
  236. @d_hand1,@d_graphic1,
  237. @d_hand2,@d_graphic2,
  238. @d_hand3,@d_graphic3,
  239. @d_hand4,@d_graphic4,
  240. @d_hand5,@d_graphic5,
  241. @m_total)
  242. end

  243. def variable_init
  244. @bet = 0
  245. @currentbet = 0
  246. @dummy_gold = 0
  247. @m_hand1 = 0
  248. @graphic1 = 53
  249. @m_hand2 = 0
  250. @graphic2 = 53
  251. @m_hand3 = 0
  252. @graphic3 = 53
  253. @m_hand4 = 0
  254. @graphic4 = 53
  255. @m_hand5 = 0
  256. @graphic5 = 53
  257. @d_hand1 = 0
  258. @d_graphic1 = 53
  259. @d_hand2 = 0
  260. @d_graphic2 = 53
  261. @d_hand3 = 0
  262. @d_graphic3 = 53
  263. @d_hand4 = 0
  264. @d_graphic4 = 53
  265. @d_hand5 = 0
  266. @d_graphic5 = 53
  267. @m_ace = 0
  268. @d_ace = 0
  269. @test = 0
  270. end

  271. def hit
  272. check_cards
  273. @card_used +=1
  274. if @m_hand3 == 0
  275. @m_hand3 = @cards[@card_used]
  276. @graphic3 = @graphic[@card_used]
  277. elsif @m_hand4 == 0 and @m_hand3 != 0
  278. @m_hand4 = @cards[@card_used]
  279. @graphic4 = @graphic[@card_used]
  280. elsif @m_hand5 == 0 and @m_hand4 != 0
  281. @m_hand5 = @cards[@card_used]
  282. @graphic5 = @graphic[@card_used]
  283. end

  284. if @cards[@card_used] == 1
  285. if @m_total <=10
  286. @m_ace = 1
  287. @m_total += 11
  288. else
  289. @m_total += 1
  290. end
  291. else
  292. @m_total += @cards[@card_used]
  293. end

  294. check_win2


  295. end

  296. def stay
  297. while (@d_total<=@m_total)
  298. check_cards
  299. @card_used +=1
  300. if @d_hand3 == 0
  301. @d_hand3 = @cards[@card_used]
  302. @d_graphic3 = @graphic[@card_used]
  303. elsif @d_hand4 == 0 and @m_hand3 != 0
  304. @d_hand4 = @cards[@card_used]
  305. @d_graphic4 = @graphic[@card_used]
  306. elsif @d_hand5 == 0 and @m_hand4 != 0
  307. @d_hand5 = @cards[@card_used]
  308. @d_graphic5 = @graphic[@card_used]
  309. end

  310. if @cards[@card_used] == 1
  311. if @d_total <=10
  312. @d_ace = 1
  313. @d_total += 11
  314. else
  315. @d_total += 1
  316. end
  317. else
  318. @d_total += @cards[@card_used]
  319. end
  320. end
  321. check_win3
  322. end

  323. def check_win
  324. if @test == 0
  325. if @m_total == 21 and @d_total != 21
  326. draw_real_cards
  327. win
  328. elsif @m_total != 21 and @d_total == 21
  329. draw_real_cards
  330. lose
  331. elsif @m_total == 21 and @d_total == 21
  332. draw_real_cards
  333. tie
  334. else
  335. @test = 1
  336. @hitstay_window.active = true
  337. end
  338. end
  339. end

  340. def check_win2
  341. if @m_total >= 22 and @m_ace == 1
  342. @m_total -= 10
  343. @m_ace = 0
  344. draw_cards
  345. elsif @m_total >= 22
  346. draw_real_cards
  347. lose
  348. elsif @m_total == 21
  349. draw_real_cards
  350. win
  351. elsif @m_total <=20
  352. draw_cards
  353. @hitstay_window.active = true
  354. end
  355. end

  356. def check_win3
  357. if @d_total >= 22 and @d_ace == 1
  358. @d_total -= 10
  359. @d_ace = 0
  360. draw_real_cards
  361. elsif @d_total >= 22
  362. draw_real_cards
  363. win
  364. elsif @d_total == 21
  365. draw_real_cards
  366. lose
  367. elsif @d_total > @m_total and @d_total <= 20
  368. draw_real_cards
  369. lose
  370. elsif @d_total == @m_total
  371. draw_real_cards
  372. tie
  373. elsif @d_total < @m_total
  374. draw_real_cards
  375. win
  376. end
  377. end

  378. def win
  379. $game_party.gain_gold(@currentbet*2)
  380. @help_window.set_text("Win!")
  381. delay(3)
  382. $scene = Scene_Map.new
  383. end

  384. def lose
  385. @help_window.set_text("Lose!")
  386. delay(3)
  387. $scene = Scene_Map.new
  388. end

  389. def tie
  390. $game_party.gain_gold(@currentbet)
  391. @help_window.set_text("Tie!")
  392. delay(3)
  393. $scene = Scene_Map.new
  394. end

  395. def delay(seconds)
  396. for i in 0...(seconds * 10)
  397. sleep 0.1
  398. Graphics.update
  399. end
  400. end

  401. end



  402. class Window_Table < Window_Base

  403. def initialize
  404. super(0, 64, 512, 416)
  405. self.contents = Bitmap.new(width - 32, height - 32)
  406. self.contents.font.name = $fontface
  407. self.contents.font.size = $fontsize
  408. refresh
  409. end
  410. #--------------------------------------------------------------------------
  411. def refresh(hand1 = 0, graphic1 = 53,
  412. hand2 = 0, graphic2 = 53,
  413. hand3 = 0, graphic3 = 53,
  414. hand4 = 0, graphic4 = 53,
  415. hand5 = 0, graphic5 = 53,
  416. d_hand1 = 0, d_graphic1 = 53,
  417. d_hand2 = 0, d_graphic2 = 53,
  418. d_hand3 = 0, d_graphic3 = 53,
  419. d_hand4 = 0, d_graphic4 = 53,
  420. d_hand5 = 0, d_graphic5 = 53,
  421. total = 0)

  422. @hand1 = hand1
  423. @hand2 = hand2
  424. @hand3 = hand3
  425. @hand4 = hand4
  426. @hand5 = hand5
  427. @d_hand1 = d_hand1
  428. @d_hand2 = d_hand2
  429. @d_hand3 = d_hand3
  430. @d_hand4 = d_hand4
  431. @d_hand5 = d_hand5
  432. @graphic1 = graphic1
  433. @graphic2 = graphic2
  434. @graphic3 = graphic3
  435. @graphic4 = graphic4
  436. @graphic5 = graphic5
  437. @d_graphic1 = d_graphic1
  438. @d_graphic2 = d_graphic2
  439. @d_graphic3 = d_graphic3
  440. @d_graphic4 = d_graphic4
  441. @d_graphic5 = d_graphic5
  442. @total = total

  443. self.contents.clear

  444. self.contents.draw_text(32, 320, 128, 32, "Your Hand: " + @total.to_s)

  445. graphic
  446. end

  447. def graphic
  448. x = 0
  449. y = 0
  450. @frame_width = 71
  451. @frame_height = 96
  452. if @graphic1 !=nil
  453. @xpos1 = @graphic1*@frame_width
  454. else
  455. @xpos1 = 52
  456. end
  457. if @graphic2 !=nil
  458. @xpos2 = @graphic2*@frame_width
  459. else
  460. @xpos2 = 52
  461. end
  462. if @graphic3 !=nil
  463. @xpos3 = @graphic3*@frame_width
  464. else
  465. @xpos3 = 52
  466. end
  467. if @graphic4 !=nil
  468. @xpos4 = @graphic4*@frame_width
  469. else
  470. @xpos4 = 52
  471. end
  472. if @graphic5 !=nil
  473. @xpos5 = @graphic5*@frame_width
  474. else
  475. @xpos5 = 52
  476. end
  477. if @d_graphic1 !=nil
  478. @xposd1 = @d_graphic1*@frame_width
  479. else
  480. @xposd1 = 52
  481. end
  482. if @graphic2 !=nil
  483. @xposd2 = @d_graphic2*@frame_width
  484. else
  485. @xposd2 = 52
  486. end
  487. if @d_graphic3 !=nil
  488. @xposd3 = @d_graphic3*@frame_width
  489. else
  490. @xposd3 = 52
  491. end
  492. if @graphic4 !=nil
  493. @xposd4 = @d_graphic4*@frame_width
  494. else
  495. @xposd4 = 52
  496. end
  497. if @d_graphic5 !=nil
  498. @xposd5 = @d_graphic5*@frame_width
  499. else
  500. @xposd5 = 52
  501. end
  502. bitmap = RPG::Cache.picture("cards")
  503. src_rect_hand1 = Rect.new(@xpos1, 0, @frame_width, @frame_height)
  504. src_rect_hand2 = Rect.new(@xpos2, 0, @frame_width, @frame_height)
  505. src_rect_hand3 = Rect.new(@xpos3, 0, @frame_width, @frame_height)
  506. src_rect_hand4 = Rect.new(@xpos4, 0, @frame_width, @frame_height)
  507. src_rect_hand5 = Rect.new(@xpos5, 0, @frame_width, @frame_height)
  508. src_rect_d_hand1 = Rect.new(@xposd1, 0, @frame_width, @frame_height)
  509. src_rect_d_hand2 = Rect.new(@xposd2, 0, @frame_width, @frame_height)
  510. src_rect_d_hand3 = Rect.new(@xposd3, 0, @frame_width, @frame_height)
  511. src_rect_d_hand4 = Rect.new(@xposd4, 0, @frame_width, @frame_height)
  512. src_rect_d_hand5 = Rect.new(@xposd5, 0, @frame_width, @frame_height)
  513. self.contents.blt(0,192,bitmap,src_rect_hand1)
  514. self.contents.blt(96,192,bitmap,src_rect_hand2)
  515. self.contents.blt(96*2,192,bitmap,src_rect_hand3)
  516. self.contents.blt(96*3,192,bitmap,src_rect_hand4)
  517. self.contents.blt(96*4,192,bitmap,src_rect_hand5)
  518. self.contents.blt(0,0,bitmap,src_rect_d_hand1)
  519. self.contents.blt(96,0,bitmap,src_rect_d_hand2)
  520. self.contents.blt(96*2,0,bitmap,src_rect_d_hand3)
  521. self.contents.blt(96*3,0,bitmap,src_rect_d_hand4)
  522. self.contents.blt(96*4,0,bitmap,src_rect_d_hand5)

  523. end


  524. end


  525. class Window_Bet < Window_Selectable
  526. # ------------------------------------
  527. def initialize
  528. super(512, 64, 128, 224)
  529. self.contents = Bitmap.new(width - 32, height - 32)
  530. self.contents.font.name = $fontface
  531. self.contents.font.size = $fontsize
  532. @column_max = 1
  533. refresh
  534. self.index = 0
  535. end
  536. # ------------------------------------

  537. def refresh
  538. if self.contents != nil
  539. self.contents.dispose
  540. self.contents = nil
  541. end
  542. @data = []
  543. @item_max = 6
  544. if @item_max > 0
  545. self.contents = Bitmap.new(width - 32, row_max * 32)
  546. for i in 0...@item_max
  547. draw_item(i)
  548. end
  549. end
  550. end
  551. # ------------------------------------
  552. def draw_item(index)
  553. x = 4
  554. y = index * 32
  555. rect = Rect.new(x, y, self.width / @column_max - 32, 32)
  556. self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  557. case index
  558. when 0
  559. self.contents.draw_text(x , y, 128, 32, "25", 0)
  560. when 1
  561. self.contents.draw_text(x , y, 128, 32, "50", 0)
  562. when 2
  563. self.contents.draw_text(x , y, 128, 32, "100", 0)
  564. when 3
  565. self.contents.draw_text(x , y, 128, 32, "500", 0)
  566. when 4
  567. self.contents.draw_text(x , y, 128, 32, "Done", 0)
  568. when 5
  569. self.contents.draw_text(x , y, 128, 32, "Quit", 0)
  570. end
  571. end
  572. # ------------------------------------
  573. def update_help
  574. @help_window.set_text("" )
  575. end
  576. end


  577. class Window_Money < Window_Base
  578. # ------------------------------------
  579. def initialize
  580. super(512, 288, 128, 96)
  581. self.contents = Bitmap.new(width - 32, height - 32)
  582. self.contents.font.name = $fontface
  583. self.contents.font.size = $fontsize
  584. @bet = 0
  585. refresh(@bet)
  586. end
  587. # ------------------------------------
  588. def refresh(bet)
  589. @bet = bet
  590. self.contents.clear
  591. self.contents.font.color = normal_color
  592. self.contents.draw_text(0, 0, 96, 32, $game_party.gold.to_s,2)
  593. self.contents.draw_text(0, 32, 96, 32, @bet.to_s, 2)
  594. end
  595. end


  596. class Window_HitStay < Window_Selectable
  597. # ------------------------------------
  598. def initialize
  599. super(512, 384, 128, 96)
  600. self.contents = Bitmap.new(width - 32, height - 32)
  601. self.contents.font.name =$fontface
  602. self.contents.font.size = $fontsize
  603. @column_max = 1
  604. refresh
  605. self.index = 0
  606. end
  607. # ------------------------------------

  608. def refresh
  609. if self.contents != nil
  610. self.contents.dispose
  611. self.contents = nil
  612. end
  613. @data = []
  614. @item_max = 2
  615. if @item_max > 0
  616. self.contents = Bitmap.new(width - 32, row_max * 32)
  617. for i in 0...@item_max
  618. draw_item(i)
  619. end
  620. end
  621. end
  622. # ------------------------------------
  623. def draw_item(index)
  624. x = 4
  625. y = index * 32
  626. rect = Rect.new(x, y, self.width / @column_max - 32, 32)
  627. self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  628. case index
  629. when 0
  630. self.contents.draw_text(x , y, 128, 32, "Hit", 0)
  631. when 1
  632. self.contents.draw_text(x , y, 128, 32, "Stay", 0)
  633. end
  634. end
  635. # ------------------------------------
  636. def update_help
  637. @help_window.set_text("" )
  638. end
  639. end

复制代码




图片:
http://ftp2.66rpg.com/3/临时� ... tle Arena/cards.png


作者: 面粉    时间: 2006-7-18 23:57
天气那个咚咚实在是太好了~~赞一个嘎~
作者: kira    时间: 2006-7-19 00:07
天气那个收了~{/dy}
作者: 雷欧纳德    时间: 2006-7-19 01:31
天气效果超好~~~赞{/qiang}
作者: frantice    时间: 2006-7-19 16:33
7月19日已更新纸牌游戏

原本预发的工程没注意到字体问题,结果了。

此楼做废。。。
作者: 美兽    时间: 2006-7-19 17:19
最好帖一些RM小游戏的思路,就算仅仅是一张图片也足够了,
只要有创新,程序可以慢慢解决。
作者: frantice    时间: 2006-7-19 17:48
终于想起蜘蛛纸牌要鼠标操作。
知难而退了…………

作者: 雷欧纳德    时间: 2006-7-20 09:00
可以用全鼠标脚本啊
作者: 诗酒    时间: 2006-7-20 10:03
睡不着,爬起看看,居然发现这些好东西{/se}
作者: tangtang3x    时间: 2006-7-20 19:28
很多实用的东东啊,{/ll}狂收啊,fran辛苦拉
作者: frantice    时间: 2006-7-21 00:00
不辛苦……

有人看就行(怎么说得我酸酸的)
作者: 忧郁    时间: 2006-7-21 02:18
我加精了..没人有意见吧...
作者: microhard    时间: 2006-7-23 02:46
提示: 作者被禁止或删除 内容自动屏蔽




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