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
# 脚本的后半部分就是自己设内容的,华文行楷是字体,其他的先看一遍效果,然后就知道怎么回事了。
# http://rpgcreative.free.fr/forum/viewtopic.php?p=50564#50564
# - Final Fantasy VII opening Credits Script
#
# 使用方法:
# 调用场景:$scene = FFVII_Credits.new
# 脚本的后半部分就是自己设内容的,华文行楷是字体,其他的先看一遍效果,然后就知道怎么回事了。
# 除了最上面的出处,所有注释以及显示的汉字都是我加的........
class FFVII_Credits
def main
$data_system = load_data("Data/System.rxdata")
$game_system = Game_System.new
@Background = Sprite.new
# 这个是背景图片,要放在pictures里#
@Background.bitmap = RPG::Cache.picture("001-Title01")
@Background.opacity = 255
@sprite1 = Window1.new
@sprite1.x = 120
@sprite1.y = 320
@sprite2 = Window2.new
@sprite2.x = 321
@sprite2.y = - 60
# 这个是音乐,BGM里的.............#
Audio.bgm_play("Audio/BGM/" + "012-Theme01", 200, 100)
@sprite3 = Window3.new
@sprite3.x = - 200
@sprite3.y = 60
@sprite4 = Window4.new
@sprite4.x = 20
@sprite4.y = 458
@sprite5 = Window5.new
@sprite5.x = 170
@sprite5.y = - 120
@sprite6 = Window6.new
@sprite6.x = - 120
@sprite6.y = 120
@sprite7 = Window7.new
@sprite7.x = 680
@sprite7.y = 110
@sprite8 = Window8.new
@sprite8.x = 450
@sprite8.y = - 90
@sprite9 = Window9.new
@sprite9.x = - 150
@sprite9.y = 400
@sprite10 = Window10.new
@sprite10.x = 30
@sprite10.y = 540
@sprite11 = Window11.new
@sprite11.x = 680
@sprite11.y = 90
@sprite12 = Window12.new
@sprite12.x = 460
@sprite12.y = - 90
@sprite13 = Window13.new
@sprite13.x = - 142
@sprite13.y = 320
@sprite14 = Window14.new
@sprite14.x = 320
@sprite14.y = - 90
@Button = Window15.new
@Button.x = 220
@Button.y = 210
@Button.contents_opacity = 0
@Button.visible = false
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@Background.dispose
@sprite1.dispose
@sprite2.dispose
@sprite3.dispose
@sprite4.dispose
@sprite5.dispose
@sprite6.dispose
@sprite7.dispose
@sprite8.dispose
@sprite9.dispose
@sprite10.dispose
@sprite11.dispose
@sprite12.dispose
@sprite13.dispose
@sprite14.dispose
@Button.dispose
end
def update
if @sprite1.x > 119
@sprite1.x += 2
end
if @sprite1.x > 319
@sprite1.x = 321
end
if @sprite1.x == 321
@sprite2.y += 2
end
if @sprite2.y > 298
@sprite2.y = 299
end
if @sprite2.y == 299 and
@sprite1.x == 321
@sprite1.contents_opacity -= 2
@sprite2.contents_opacity -= 2
end
if @sprite1.contents_opacity < 1
@sprite1.active = false
@sprite2.active = false
@sprite3.x += 1
@sprite4.y -= 2
if @sprite4.y < 40
@sprite4.y = 40
end
end
if @sprite3.x > 89
@sprite3.x = 90
@sprite3.contents_opacity -= 2
@sprite4.contents_opacity -= 2
end
if @sprite3.contents_opacity < 1
@sprite3.active = false
@sprite4.active = false
@sprite5.y += 1
@sprite6.x += 1
if @sprite5.y > 137 and
@sprite6.x > 137
@sprite5.y = 138
@sprite6.x = 138
end
end
if @sprite5.y == 138 and
@sprite6.x == 138
@sprite5.contents_opacity -= 2
@sprite6.contents_opacity -= 2
end
if @sprite5.contents_opacity < 1
@sprite7.x > 639
@sprite8.y < - 89
@sprite8.y += 1
@sprite7.x -= 1
end
if @sprite7.x < 461
@sprite7.x = 460
@sprite8.y = 130
@sprite7.contents_opacity -=2
@sprite8.contents_opacity -=2
end
if @sprite8.contents_opacity < 1
@sprite9.x += 1
@sprite10.y -= 1
end
if @sprite10.y < 381
@sprite10.y = 381
@sprite9.x = 10
@sprite9.contents_opacity -= 2
@sprite10.contents_opacity -= 2
end
if @sprite10.contents_opacity < 1
@sprite11.x > 639
@sprite12.y < - 89
@sprite12.y += 1
@sprite11.x -= 1
end
if @sprite11.x < 461
@sprite11.x = 460
@sprite12.y = 130
@sprite11.contents_opacity -=2
@sprite12.contents_opacity -=2
end
if @sprite12.contents_opacity < 1
@sprite13.x += 1
@sprite14.y += 1
end
if @sprite13.x > 300
@sprite13.x = 302
@sprite14.y = 341
@sprite13.contents_opacity -= 2
@sprite14.contents_opacity -= 2
end
if @sprite14.contents_opacity < 1
@Button.visible = true
@Button.contents_opacity +=1
end
if Input.trigger?(Input::C)
## 按决定键后回到标题画面##
$scene = Scene_Title.new
end
end
#==============================================
# - Window_Text
#==============================================
class Your_Scene
def main
Graphics.freeze
@window1.dispose
@window2.dispose
@window3.dispose
@window4.dispose
@window5.dispose
@window6.dispose
@window7.dispose
@window8.dispose
@window9.dispose
@window10.dispose
end
end
#==============================================
# - Window Producer name text begins
#==============================================
class Window1 < Window_Base
def initialize
super(0, 0, 210,60)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "华文行楷"
self.contents.font.size = 22
self.opacity = 0
self.contents.draw_text(0, 0, 110, 33, "66RPG")
end
end
#==============================================
# - Window Producer Title Text Begins
#==============================================
class Window2 < Window_Base
def initialize
super(0, 0, 140,60)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "华文行楷"
self.contents.font.size = 22
self.opacity = 0
self.contents.draw_text(0, 0, 133, 33, "伟大光荣的")
end
end
#==============================================
# - Window Main Scripter Name text begins
#==============================================
class Window3 < Window_Base
def initialize
super(0, 0, 140,60)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "华文行楷"
self.contents.font.size = 22
self.opacity = 0
self.contents.draw_text(0, 0, 133, 33, "九泪")
end
end
#==============================================
# - Window Mian Scripter Title Text Begins
#==============================================
class Window4 < Window_Base
def initialize
super(0, 0, 290,60)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "华文行楷"
self.contents.font.size = 22
self.opacity = 0
self.contents.draw_text(0, 0, 290, 33, "聪明漂亮的")
end
end
#==============================================
# - Window Director Name Text Begins
#==============================================
class Window5 < Window_Base
def initialize
super(0, 0, 140,60)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "华文行楷"
self.contents.font.size = 22
self.opacity = 0
self.contents.draw_text(0, 0, 133, 33, "某某")
end
end
#==============================================
# - Window Director Name Title Begins
#==============================================
class Window6 < Window_Base
def initialize
super(0, 0, 140,60)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "华文行楷"
self.contents.font.size = 22
self.opacity = 0
self.contents.draw_text(0, 0, 133, 33, "杀人眨眼的")
end
end
#==============================================
# - Window Main Programmer Title Begins
#==============================================
class Window7 < Window_Base
def initialize
super(0, 0, 210,60)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "华文行楷"
self.contents.font.size = 22
self.opacity = 0
self.contents.draw_text(0, 0, 210, 33, "世界杯冠军")
end
end
#==============================================
# - Window Main Programmer Name Begins
#==============================================
class Window8 < Window_Base
def initialize
super(0, 0, 180,60)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "华文行楷"
self.contents.font.size = 22
self.opacity = 0
self.contents.draw_text(0, 0, 178, 33, "阿根廷")
end
end
#==============================================
# - Window Composer Title Begins
#==============================================
class Window9 < Window_Base
def initialize
super(0, 0, 240,60)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "宋体"
self.contents.font.size = 22
self.opacity = 0
self.contents.draw_text(0, 0, 233, 33, "齐达内^0^")
end
end
#==============================================
# - Window Composer name Begins
#==============================================
class Window10 < Window_Base
def initialize
super(0, 0, 240,60)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "华文行楷"
self.contents.font.size = 22
self.opacity = 0
self.contents.draw_text(0, 0, 233, 33, "我的偶像")
end
end
#==============================================
# - Window Battle Script designer Title Begins
#==============================================
class Window11 < Window_Base
def initialize
super(0, 0, 240,240)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "华文行楷"
self.contents.font.size = 22
self.opacity = 0
self.contents.draw_text(0, 0, 133, 33, "伟大的阿根")
self.contents.draw_text(0, 0, 143, 63, "廷的左后卫")
end
end
#==============================================
# - Window Battle Script Designer Name Begins
#==============================================
class Window12 < Window_Base
def initialize
super(0, 0, 240,60)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "华文行楷"
self.contents.font.size = 22
self.opacity = 0
self.contents.draw_text(0, 0, 233, 33, "他不是one!")
end
end
#==============================================
# - Window Special thanks Begins
#==============================================
class Window13 < Window_Base
def initialize
super(0, 0, 340,240)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "华文行楷"
self.contents.font.size = 22
self.opacity = 0
self.contents.draw_text(0, 0, 333, 33, "莎士比亚说")
self.contents.draw_text(0, 20, 333, 33, "liao")
end
end
#==============================================
# - Window Special Thanks Names begins
#==============================================
class Window14 < Window_Base
def initialize
super(0, 0, 240,60)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "华文行楷"
self.contents.font.size = 22
self.opacity = 0
self.contents.draw_text(0, 0, 133, 33, "阿根廷!!")
end
end
#==============================================
# - This Creates the "Please Press Start" Screen -
# 针对头上的话提出抗议,明明是按下去就回标题画面了,还"Start"个头啊=。=
# 如果放在新游戏开始那里,先这个下,然后到新地图还说得过去....(跑题liao)
#==============================================
class Window15 < Window_Base
def initialize
super(0, 0, 440,360)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "华文行楷"
self.contents.font.size = 28
self.opacity = 0
self.contents.draw_text(0, 0, 433, 33, "妈妈咪的 ")
self.contents.font.size = 24
self.contents.draw_text(0, 20, 433, 33, "想不出话了")
self.contents.draw_text(0, 40, 433, 33, "就这样了!!")
end
end
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
# 脚本的后半部分就是自己设内容的,华文行楷是字体,其他的先看一遍效果,然后就知道怎么回事了。
# http://rpgcreative.free.fr/forum/viewtopic.php?p=50564#50564
# - Final Fantasy VII opening Credits Script
#
# 使用方法:
# 调用场景:$scene = FFVII_Credits.new
# 脚本的后半部分就是自己设内容的,华文行楷是字体,其他的先看一遍效果,然后就知道怎么回事了。
# 除了最上面的出处,所有注释以及显示的汉字都是我加的........
class FFVII_Credits
def main
$data_system = load_data("Data/System.rxdata")
$game_system = Game_System.new
@Background = Sprite.new
# 这个是背景图片,要放在pictures里#
@Background.bitmap = RPG::Cache.picture("001-Title01")
@Background.opacity = 255
@sprite1 = Window1.new
@sprite1.x = 120
@sprite1.y = 320
@sprite2 = Window2.new
@sprite2.x = 321
@sprite2.y = - 60
# 这个是音乐,BGM里的.............#
Audio.bgm_play("Audio/BGM/" + "012-Theme01", 200, 100)
@sprite3 = Window3.new
@sprite3.x = - 200
@sprite3.y = 60
@sprite4 = Window4.new
@sprite4.x = 20
@sprite4.y = 458
@sprite5 = Window5.new
@sprite5.x = 170
@sprite5.y = - 120
@sprite6 = Window6.new
@sprite6.x = - 120
@sprite6.y = 120
@sprite7 = Window7.new
@sprite7.x = 680
@sprite7.y = 110
@sprite8 = Window8.new
@sprite8.x = 450
@sprite8.y = - 90
@sprite9 = Window9.new
@sprite9.x = - 150
@sprite9.y = 400
@sprite10 = Window10.new
@sprite10.x = 30
@sprite10.y = 540
@sprite11 = Window11.new
@sprite11.x = 680
@sprite11.y = 90
@sprite12 = Window12.new
@sprite12.x = 460
@sprite12.y = - 90
@sprite13 = Window13.new
@sprite13.x = - 142
@sprite13.y = 320
@sprite14 = Window14.new
@sprite14.x = 320
@sprite14.y = - 90
@Button = Window15.new
@Button.x = 220
@Button.y = 210
@Button.contents_opacity = 0
@Button.visible = false
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@Background.dispose
@sprite1.dispose
@sprite2.dispose
@sprite3.dispose
@sprite4.dispose
@sprite5.dispose
@sprite6.dispose
@sprite7.dispose
@sprite8.dispose
@sprite9.dispose
@sprite10.dispose
@sprite11.dispose
@sprite12.dispose
@sprite13.dispose
@sprite14.dispose
@Button.dispose
end
def update
if @sprite1.x > 119
@sprite1.x += 2
end
if @sprite1.x > 319
@sprite1.x = 321
end
if @sprite1.x == 321
@sprite2.y += 2
end
if @sprite2.y > 298
@sprite2.y = 299
end
if @sprite2.y == 299 and
@sprite1.x == 321
@sprite1.contents_opacity -= 2
@sprite2.contents_opacity -= 2
end
if @sprite1.contents_opacity < 1
@sprite1.active = false
@sprite2.active = false
@sprite3.x += 1
@sprite4.y -= 2
if @sprite4.y < 40
@sprite4.y = 40
end
end
if @sprite3.x > 89
@sprite3.x = 90
@sprite3.contents_opacity -= 2
@sprite4.contents_opacity -= 2
end
if @sprite3.contents_opacity < 1
@sprite3.active = false
@sprite4.active = false
@sprite5.y += 1
@sprite6.x += 1
if @sprite5.y > 137 and
@sprite6.x > 137
@sprite5.y = 138
@sprite6.x = 138
end
end
if @sprite5.y == 138 and
@sprite6.x == 138
@sprite5.contents_opacity -= 2
@sprite6.contents_opacity -= 2
end
if @sprite5.contents_opacity < 1
@sprite7.x > 639
@sprite8.y < - 89
@sprite8.y += 1
@sprite7.x -= 1
end
if @sprite7.x < 461
@sprite7.x = 460
@sprite8.y = 130
@sprite7.contents_opacity -=2
@sprite8.contents_opacity -=2
end
if @sprite8.contents_opacity < 1
@sprite9.x += 1
@sprite10.y -= 1
end
if @sprite10.y < 381
@sprite10.y = 381
@sprite9.x = 10
@sprite9.contents_opacity -= 2
@sprite10.contents_opacity -= 2
end
if @sprite10.contents_opacity < 1
@sprite11.x > 639
@sprite12.y < - 89
@sprite12.y += 1
@sprite11.x -= 1
end
if @sprite11.x < 461
@sprite11.x = 460
@sprite12.y = 130
@sprite11.contents_opacity -=2
@sprite12.contents_opacity -=2
end
if @sprite12.contents_opacity < 1
@sprite13.x += 1
@sprite14.y += 1
end
if @sprite13.x > 300
@sprite13.x = 302
@sprite14.y = 341
@sprite13.contents_opacity -= 2
@sprite14.contents_opacity -= 2
end
if @sprite14.contents_opacity < 1
@Button.visible = true
@Button.contents_opacity +=1
end
if Input.trigger?(Input::C)
## 按决定键后回到标题画面##
$scene = Scene_Title.new
end
end
#==============================================
# - Window_Text
#==============================================
class Your_Scene
def main
Graphics.freeze
@window1.dispose
@window2.dispose
@window3.dispose
@window4.dispose
@window5.dispose
@window6.dispose
@window7.dispose
@window8.dispose
@window9.dispose
@window10.dispose
end
end
#==============================================
# - Window Producer name text begins
#==============================================
class Window1 < Window_Base
def initialize
super(0, 0, 210,60)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "华文行楷"
self.contents.font.size = 22
self.opacity = 0
self.contents.draw_text(0, 0, 110, 33, "66RPG")
end
end
#==============================================
# - Window Producer Title Text Begins
#==============================================
class Window2 < Window_Base
def initialize
super(0, 0, 140,60)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "华文行楷"
self.contents.font.size = 22
self.opacity = 0
self.contents.draw_text(0, 0, 133, 33, "伟大光荣的")
end
end
#==============================================
# - Window Main Scripter Name text begins
#==============================================
class Window3 < Window_Base
def initialize
super(0, 0, 140,60)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "华文行楷"
self.contents.font.size = 22
self.opacity = 0
self.contents.draw_text(0, 0, 133, 33, "九泪")
end
end
#==============================================
# - Window Mian Scripter Title Text Begins
#==============================================
class Window4 < Window_Base
def initialize
super(0, 0, 290,60)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "华文行楷"
self.contents.font.size = 22
self.opacity = 0
self.contents.draw_text(0, 0, 290, 33, "聪明漂亮的")
end
end
#==============================================
# - Window Director Name Text Begins
#==============================================
class Window5 < Window_Base
def initialize
super(0, 0, 140,60)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "华文行楷"
self.contents.font.size = 22
self.opacity = 0
self.contents.draw_text(0, 0, 133, 33, "某某")
end
end
#==============================================
# - Window Director Name Title Begins
#==============================================
class Window6 < Window_Base
def initialize
super(0, 0, 140,60)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "华文行楷"
self.contents.font.size = 22
self.opacity = 0
self.contents.draw_text(0, 0, 133, 33, "杀人眨眼的")
end
end
#==============================================
# - Window Main Programmer Title Begins
#==============================================
class Window7 < Window_Base
def initialize
super(0, 0, 210,60)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "华文行楷"
self.contents.font.size = 22
self.opacity = 0
self.contents.draw_text(0, 0, 210, 33, "世界杯冠军")
end
end
#==============================================
# - Window Main Programmer Name Begins
#==============================================
class Window8 < Window_Base
def initialize
super(0, 0, 180,60)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "华文行楷"
self.contents.font.size = 22
self.opacity = 0
self.contents.draw_text(0, 0, 178, 33, "阿根廷")
end
end
#==============================================
# - Window Composer Title Begins
#==============================================
class Window9 < Window_Base
def initialize
super(0, 0, 240,60)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "宋体"
self.contents.font.size = 22
self.opacity = 0
self.contents.draw_text(0, 0, 233, 33, "齐达内^0^")
end
end
#==============================================
# - Window Composer name Begins
#==============================================
class Window10 < Window_Base
def initialize
super(0, 0, 240,60)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "华文行楷"
self.contents.font.size = 22
self.opacity = 0
self.contents.draw_text(0, 0, 233, 33, "我的偶像")
end
end
#==============================================
# - Window Battle Script designer Title Begins
#==============================================
class Window11 < Window_Base
def initialize
super(0, 0, 240,240)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "华文行楷"
self.contents.font.size = 22
self.opacity = 0
self.contents.draw_text(0, 0, 133, 33, "伟大的阿根")
self.contents.draw_text(0, 0, 143, 63, "廷的左后卫")
end
end
#==============================================
# - Window Battle Script Designer Name Begins
#==============================================
class Window12 < Window_Base
def initialize
super(0, 0, 240,60)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "华文行楷"
self.contents.font.size = 22
self.opacity = 0
self.contents.draw_text(0, 0, 233, 33, "他不是one!")
end
end
#==============================================
# - Window Special thanks Begins
#==============================================
class Window13 < Window_Base
def initialize
super(0, 0, 340,240)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "华文行楷"
self.contents.font.size = 22
self.opacity = 0
self.contents.draw_text(0, 0, 333, 33, "莎士比亚说")
self.contents.draw_text(0, 20, 333, 33, "liao")
end
end
#==============================================
# - Window Special Thanks Names begins
#==============================================
class Window14 < Window_Base
def initialize
super(0, 0, 240,60)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "华文行楷"
self.contents.font.size = 22
self.opacity = 0
self.contents.draw_text(0, 0, 133, 33, "阿根廷!!")
end
end
#==============================================
# - This Creates the "Please Press Start" Screen -
# 针对头上的话提出抗议,明明是按下去就回标题画面了,还"Start"个头啊=。=
# 如果放在新游戏开始那里,先这个下,然后到新地图还说得过去....(跑题liao)
#==============================================
class Window15 < Window_Base
def initialize
super(0, 0, 440,360)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "华文行楷"
self.contents.font.size = 28
self.opacity = 0
self.contents.draw_text(0, 0, 433, 33, "妈妈咪的 ")
self.contents.font.size = 24
self.contents.draw_text(0, 20, 433, 33, "想不出话了")
self.contents.draw_text(0, 40, 433, 33, "就这样了!!")
end
end
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 自己定义
其他自己看脚本前面注释
#===========================
# ccoa's weather script
# with ideas by ScriptKitty and Mr.DJ
#===========================
# Weather Types:类型
# 1 - rain 雨
# 2 - storm 风
# 3 - snow 雪
# 4 - hail 冰雹
# 5 - rain with thunder and lightning 雷雨
# 6 - falling leaves (autumn) 秋天的落叶
# 7 - blowing leaves (autumn) 秋风扫落叶
# 8 - swirling leaves (autumn) 旋转的树叶
# 9 - falling leaves (green) 绿绿的落叶
# 10 - cherry blossom (sakura) petals 樱花飞舞
# 11 - rose petals 玫瑰花瓣雨
# 12 - feathers 羽毛
# 13 - blood rain 血雨
# 14 - sparkles 闪烁
# 15 - user defined 自己定义
#
# Weather Power: 强度 0-40 0为无天气
# An integer from 0-40. 0 = no weather, 40 = 400 sprites
#
# Usage:使用方法
# Create a call script with the following:
# 调用这个脚本
# $game_screen.weather(type, power, hue)
# 比如:$game_screen.weather(14, 35, 0)
#
# Usage of user-defined weather:
# Look at the following globals:
# 自定义天气看下面的
$WEATHER_UPDATE = false
# the $WEATHER_IMAGES array has changed, please update天气图象改变请改为true
$WEATHER_IMAGES = []
# the array of picture names to use用到的图片名字,默认无,所以上面不用刷新(他不是小方块!)
$WEATHER_X = 0
# the number of pixels the image should move horizontally (positive = right, negative = left)水平移动,正为右,负为左
$WEATHER_Y = 0
# the number of pizels the image should move vertically (positive = down, negative = up)垂直运动,正为下,负为上
$WEATHER_FADE = 0
# how much the image should fade each update (0 = no fade, 255 = fade instantly)淡出淡入,0为无,255为马上
$WEATHER_ANIMATED = false
# whether or not the image should cycle through all the images是否环绕?
module RPG
class Weather
def initialize(viewport = nil)
@type = 0
@max = 0
@ox = 0
@oy = 0
@count = 0
@current_pose = []
@info = []
@countarray = []
make_bitmaps
# **** ccoa ****
for i in 1..500
sprite = Sprite.new(viewport)
sprite.z = 1000
sprite.visible = false
sprite.opacity = 0
@sprites.push(sprite)
@current_pose.push(0)
@info.push(rand(50))
@countarray.push(rand(15))
end
end
def dispose
for sprite in @sprites
sprite.dispose
end
@rain_bitmap.dispose
@storm_bitmap.dispose
@snow_bitmap.dispose
@hail_bitmap.dispose
@petal_bitmap.dispose
@blood_rain_bitmap.dispose
for image in @autumn_leaf_bitmaps
image.dispose
end
for image in @green_leaf_bitmaps
image.dispose
end
for image in @rose_bitmaps
image.dispose
end
for image in @feather_bitmaps
image.dispose
end
for image in @sparkle_bitmaps
image.dispose
end
for image in @user_bitmaps
image.dispose
end
$WEATHER_UPDATE = true
end
def type=(type)
return if @type == type
@type = type
case @type
when 1 # rain
bitmap = @rain_bitmap
when 2 # storm
bitmap = @storm_bitmap
when 3 # snow
bitmap = @snow_bitmap
when 4 # hail
bitmap = @hail_bitmap
when 5 # rain w/ thunder and lightning
bitmap = @rain_bitmap
@thunder = true
when 6 # falling autumn leaves
bitmap = @autumn_leaf_bitmaps[0]
when 7 # blowing autumn leaves
bitmap = @autumn_leaf_bitmaps[0]
when 8 # swirling autumn leaves
bitmap = @autumn_leaf_bitmaps[0]
when 9 # falling green leaves
bitmap = @green_leaf_bitmaps[0]
when 10 # sakura petals
bitmap = @petal_bitmap
when 11 # rose petals
bitmap = @rose_bitmaps[0]
when 12 # feathers
bitmap = @feather_bitmaps[0]
when 13 # blood rain
bitmap = @blood_rain_bitmap
when 14 # sparkles
bitmap = @sparkle_bitmaps[0]
when 15 # user-defined
bitmap = @user_bitmaps[rand(@user_bitmaps.size)]
else
bitmap = nil
end
if @type != 5
@thunder = false
end
# **** ccoa ****
for i in 1..500
sprite = @sprites[i]
if sprite != nil
sprite.visible = (i <= @max)
sprite.bitmap = bitmap
end
end
end
def ox=(ox)
return if @ox == ox;
@ox = ox
for sprite in @sprites
sprite.ox = @ox
end
end
def oy=(oy)
return if @oy == oy;
@oy = oy
for sprite in @sprites
sprite.oy = @oy
end
end
def max=(max)
return if @max == max;
# **** ccoa ****
@max = [[max, 0].max, 500].min
for i in 1..500
sprite = @sprites[i]
if sprite != nil
sprite.visible = (i <= @max)
end
end
end
def update
return if @type == 0
for i in 1..@max
sprite = @sprites[i]
if sprite == nil
break
end
if @type == 1 or @type == 5 or @type == 13 # rain
sprite.x -= 2
sprite.y += 16
sprite.opacity -= 8
if @thunder and (rand(8000 - @max) == 0)
$game_screen.start_flash(Color.new(255, 255, 255, 255), 5)
Audio.se_play("Audio/SE/061-Thunderclap01")
end
end
if @type == 2 # storm
sprite.x -= 8
sprite.y += 16
sprite.opacity -= 12
end
if @type == 3 # snow
sprite.x -= 2
sprite.y += 8
sprite.opacity -= 8
end
if @type == 4 # hail
sprite.x -= 1
sprite.y += 18
sprite.opacity -= 15
end
if @type == 6 # falling autumn leaves
@count = rand(20)
if @count == 0
sprite.bitmap = @autumn_leaf_bitmaps[@current_pose[i]]
@current_pose[i] = (@current_pose[i] + 1) % @autumn_leaf_bitmaps.size
end
sprite.x -= 1
sprite.y += 1
end
if @type == 7 # blowing autumn leaves
@count = rand(20)
if @count == 0
sprite.bitmap = @autumn_leaf_bitmaps[@current_pose[i]]
@current_pose[i] = (@current_pose[i] + 1) % @autumn_leaf_bitmaps.size
end
sprite.x -= 10
sprite.y += (rand(4) - 2)
end
if @type == 8 # swirling autumn leaves
@count = rand(20)
if @count == 0
sprite.bitmap = @autumn_leaf_bitmaps[@current_pose[i]]
@current_pose[i] = (@current_pose[i] + 1) % @autumn_leaf_bitmaps.size
end
if @info[i] != 0
if @info[i] >= 1 and @info[i] <= 10
sprite.x -= 3
sprite.y -= 1
elsif @info[i] >= 11 and @info[i] <= 16
sprite.x -= 1
sprite.y -= 2
elsif @info[i] >= 17 and @info[i] <= 20
sprite.y -= 3
elsif @info[i] >= 21 and @info[i] <= 30
sprite.y -= 2
sprite.x += 1
elsif @info[i] >= 31 and @info[i] <= 36
sprite.y -= 1
sprite.x += 3
elsif @info[i] >= 37 and @info[i] <= 40
sprite.x += 5
elsif @info[i] >= 41 and @info[i] <= 46
sprite.y += 1
sprite.x += 3
elsif @info[i] >= 47 and @info[i] <= 58
sprite.y += 2
sprite.x += 1
elsif @info[i] >= 59 and @info[i] <= 64
sprite.y += 3
elsif @info[i] >= 65 and @info[i] <= 70
sprite.x -= 1
sprite.y += 2
elsif @info[i] >= 71 and @info[i] <= 81
sprite.x -= 3
sprite.y += 1
elsif @info[i] >= 82 and @info[i] <= 87
sprite.x -= 5
end
@info[i] = (@info[i] + 1) % 88
else
if rand(200) == 0
@info[i] = 1
end
sprite.x -= 5
sprite.y += 1
end
end
if @type == 9 # falling green leaves
if @countarray[i] == 0
@current_pose[i] = (@current_pose[i] + 1) % @green_leaf_bitmaps.size
sprite.bitmap = @green_leaf_bitmaps[@current_pose[i]]
@countarray[i] = rand(15)
end
@countarray[i] = (@countarray[i] + 1) % 15
sprite.y += 1
end
if @type == 10 # sakura petals
if @info[i] < 25
sprite.x -= 1
else
sprite.x += 1
end
@info[i] = (@info[i] + 1) % 50
sprite.y += 1
end
if @type == 11 # rose petals
@count = rand(20)
if @count == 0
sprite.bitmap = @rose_bitmaps[@current_pose[i]]
@current_pose[i] = (@current_pose[i] + 1) % @rose_bitmaps.size
end
if @info[i] % 2 == 0
if @info[i] < 10
sprite.x -= 1
else
sprite.x += 1
end
end
sprite.y += 1
end
if @type == 12 # feathers
if @countarray[i] == 0
@current_pose[i] = (@current_pose[i] + 1) % @feather_bitmaps.size
sprite.bitmap = @feather_bitmaps[@current_pose[i]]
end
@countarray[i] = (@countarray[i] + 1) % 15
if rand(100) == 0
sprite.x -= 1
end
if rand(100) == 0
sprite.y -= 1
end
if @info[i] < 50
if rand(2) == 0
sprite.x -= 1
else
sprite.y -= 1
end
else
if rand(2) == 0
sprite.x += 1
else
sprite.y += 1
end
end
@info[i] = (@info[i] + 1) % 100
end
if @type == 14 # sparkles
if @countarray[i] == 0
@current_pose[i] = (@current_pose[i] + 1) % @sparkle_bitmaps.size
sprite.bitmap = @sparkle_bitmaps[@current_pose[i]]
end
@countarray[i] = (@countarray[i] + 1) % 15
sprite.y += 1
sprite.opacity -= 1
end
if @type == 15 # user-defined
if $WEATHER_UPDATE
update_user_defined
$WEATHER_UPDATE = false
end
if $WEATHER_ANIMATED and @countarray[i] == 0
@current_pose[i] = (@current_pose[i] + 1) % @user_bitmaps.size
sprite.bitmap = @user_bitmaps[@current_pose[i]]
end
@countarray[i] = (@countarray[i] + 1) % 15
sprite.x += $WEATHER_X
sprite.y += $WEATHER_Y
sprite.opacity -= $WEATHER_FADE
end
x = sprite.x - @ox
y = sprite.y - @oy
if sprite.opacity < 64 or x < -50 or x > 750 or y < -300 or y > 500
sprite.x = rand(800) - 50 + @ox
sprite.y = rand(800) - 200 + @oy
sprite.opacity = 255
end
end
end
def make_bitmaps
color1 = Color.new(255, 255, 255, 255)
color2 = Color.new(255, 255, 255, 128)
@rain_bitmap = Bitmap.new(7, 56)
for i in 0..6
@rain_bitmap.fill_rect(6-i, i*8, 1, 8, color1)
end
@storm_bitmap = Bitmap.new(34, 64)
for i in 0..31
@storm_bitmap.fill_rect(33-i, i*2, 1, 2, color2)
@storm_bitmap.fill_rect(32-i, i*2, 1, 2, color1)
@storm_bitmap.fill_rect(31-i, i*2, 1, 2, color2)
end
@snow_bitmap = Bitmap.new(6, 6)
@snow_bitmap.fill_rect(0, 1, 6, 4, color2)
@snow_bitmap.fill_rect(1, 0, 4, 6, color2)
@snow_bitmap.fill_rect(1, 2, 4, 2, color1)
@snow_bitmap.fill_rect(2, 1, 2, 4, color1)
@sprites = []
blueGrey = Color.new(215, 227, 227, 150)
grey = Color.new(214, 217, 217, 150)
lightGrey = Color.new(233, 233, 233, 250)
lightBlue = Color.new(222, 239, 243, 250)
@hail_bitmap = Bitmap.new(4, 4)
@hail_bitmap.fill_rect(1, 0, 2, 1, blueGrey)
@hail_bitmap.fill_rect(0, 1, 1, 2, blueGrey)
@hail_bitmap.fill_rect(3, 1, 1, 2, grey)
@hail_bitmap.fill_rect(1, 3, 2, 1, grey)
@hail_bitmap.fill_rect(1, 1, 2, 2, lightGrey)
@hail_bitmap.set_pixel(1, 1, lightBlue)
color3 = Color.new(255, 167, 192, 255) # light pink
color4 = Color.new(213, 106, 136, 255) # dark pink
@petal_bitmap = Bitmap.new(4, 4) #This creates a new bitmap that is 4 x 4 pixels
@petal_bitmap.fill_rect(0, 3, 1, 1, color3) # this makes a 1x1 pixel "rectangle" at the 0, 3 pixel of the image (upper left corner is 0, 0)
@petal_bitmap.fill_rect(1, 2, 1, 1, color3)
@petal_bitmap.fill_rect(2, 1, 1, 1, color3)
@petal_bitmap.fill_rect(3, 0, 1, 1, color3)
@petal_bitmap.fill_rect(1, 3, 1, 1, color4)
@petal_bitmap.fill_rect(2, 2, 1, 1, color4)
@petal_bitmap.fill_rect(3, 1, 1, 1, color4)
brightOrange = Color.new(248, 88, 0, 255)
orangeBrown = Color.new(144, 80, 56, 255)
burntRed = Color.new(152, 0, 0, 255)
paleOrange = Color.new(232, 160, 128, 255)
darkBrown = Color.new(72, 40, 0, 255)
@autumn_leaf_bitmaps = []
@autumn_leaf_bitmaps.push(Bitmap.new(8, 8))
# draw the first of the leaf1 bitmaps
@autumn_leaf_bitmaps[0].set_pixel(5, 1, orangeBrown)
@autumn_leaf_bitmaps[0].set_pixel(6, 1, brightOrange)
@autumn_leaf_bitmaps[0].set_pixel(7, 1, paleOrange)
@autumn_leaf_bitmaps[0].set_pixel(3, 2, orangeBrown)
@autumn_leaf_bitmaps[0].fill_rect(4, 2, 2, 1, brightOrange)
@autumn_leaf_bitmaps[0].set_pixel(6, 2, paleOrange)
@autumn_leaf_bitmaps[0].set_pixel(2, 3, orangeBrown)
@autumn_leaf_bitmaps[0].set_pixel(3, 3, brightOrange)
@autumn_leaf_bitmaps[0].fill_rect(4, 3, 2, 1, paleOrange)
@autumn_leaf_bitmaps[0].set_pixel(1, 4, orangeBrown)
@autumn_leaf_bitmaps[0].set_pixel(2, 4, brightOrange)
@autumn_leaf_bitmaps[0].set_pixel(3, 4, paleOrange)
@autumn_leaf_bitmaps[0].set_pixel(1, 5, brightOrange)
@autumn_leaf_bitmaps[0].set_pixel(2, 5, paleOrange)
@autumn_leaf_bitmaps[0].set_pixel(0, 6, orangeBrown)
@autumn_leaf_bitmaps[0].set_pixel(1, 6, paleOrange)
@autumn_leaf_bitmaps[0].set_pixel(0, 7, paleOrange)
# draw the 2nd of the leaf1 bitmaps
@autumn_leaf_bitmaps.push(Bitmap.new(8, 8))
@autumn_leaf_bitmaps[1].set_pixel(3, 0, brightOrange)
@autumn_leaf_bitmaps[1].set_pixel(7, 0, brightOrange)
@autumn_leaf_bitmaps[1].set_pixel(3, 1, orangeBrown)
@autumn_leaf_bitmaps[1].set_pixel(4, 1, burntRed)
@autumn_leaf_bitmaps[1].set_pixel(6, 1, brightOrange)
@autumn_leaf_bitmaps[1].set_pixel(0, 2, paleOrange)
@autumn_leaf_bitmaps[1].set_pixel(1, 2, brightOrange)
@autumn_leaf_bitmaps[1].set_pixel(2, 2, orangeBrown)
@autumn_leaf_bitmaps[1].set_pixel(3, 2, burntRed)
@autumn_leaf_bitmaps[1].set_pixel(4, 2, orangeBrown)
@autumn_leaf_bitmaps[1].set_pixel(5, 2, brightOrange)
@autumn_leaf_bitmaps[1].fill_rect(1, 3, 3, 1, orangeBrown)
@autumn_leaf_bitmaps[1].fill_rect(4, 3, 2, 1, brightOrange)
@autumn_leaf_bitmaps[1].set_pixel(6, 3, orangeBrown)
@autumn_leaf_bitmaps[1].set_pixel(2, 4, burntRed)
@autumn_leaf_bitmaps[1].fill_rect(3, 4, 3, 1, brightOrange)
@autumn_leaf_bitmaps[1].set_pixel(6, 4, burntRed)
@autumn_leaf_bitmaps[1].set_pixel(7, 4, darkBrown)
@autumn_leaf_bitmaps[1].set_pixel(1, 5, orangeBrown)
@autumn_leaf_bitmaps[1].fill_rect(2, 5, 2, 1, brightOrange)
@autumn_leaf_bitmaps[1].set_pixel(4, 5, orangeBrown)
@autumn_leaf_bitmaps[1].set_pixel(5, 5, burntRed)
@autumn_leaf_bitmaps[1].fill_rect(1, 6, 2, 1, brightOrange)
@autumn_leaf_bitmaps[1].fill_rect(4, 6, 2, 1, burntRed)
@autumn_leaf_bitmaps[1].set_pixel(0, 7, brightOrange)
@autumn_leaf_bitmaps[1].set_pixel(5, 7, darkBrown)
# draw the 3rd of the leaf1 bitmaps
@autumn_leaf_bitmaps.push(Bitmap.new(8, 8))
@autumn_leaf_bitmaps[2].set_pixel(7, 1, paleOrange)
@autumn_leaf_bitmaps[2].set_pixel(6, 2, paleOrange)
@autumn_leaf_bitmaps[2].set_pixel(7, 2, orangeBrown)
@autumn_leaf_bitmaps[2].set_pixel(5, 3, paleOrange)
@autumn_leaf_bitmaps[2].set_pixel(6, 3, brightOrange)
@autumn_leaf_bitmaps[2].set_pixel(4, 4, paleOrange)
@autumn_leaf_bitmaps[2].set_pixel(5, 4, brightOrange)
@autumn_leaf_bitmaps[2].set_pixel(6, 4, orangeBrown)
@autumn_leaf_bitmaps[2].fill_rect(2, 5, 2, 1, paleOrange)
@autumn_leaf_bitmaps[2].set_pixel(4, 5, brightOrange)
@autumn_leaf_bitmaps[2].set_pixel(5, 5, orangeBrown)
@autumn_leaf_bitmaps[2].set_pixel(1, 6, paleOrange)
@autumn_leaf_bitmaps[2].fill_rect(2, 6, 2, 1, brightOrange)
@autumn_leaf_bitmaps[2].set_pixel(4, 6, orangeBrown)
@autumn_leaf_bitmaps[2].set_pixel(0, 7, paleOrange)
@autumn_leaf_bitmaps[2].set_pixel(1, 7, brightOrange)
@autumn_leaf_bitmaps[2].set_pixel(2, 7, orangeBrown)
# draw the 4th of the leaf1 bitmaps
@autumn_leaf_bitmaps.push(Bitmap.new(8, 8))
@autumn_leaf_bitmaps[3].set_pixel(3, 0, brightOrange)
@autumn_leaf_bitmaps[3].set_pixel(7, 0, brightOrange)
@autumn_leaf_bitmaps[3].set_pixel(3, 1, orangeBrown)
@autumn_leaf_bitmaps[3].set_pixel(4, 1, burntRed)
@autumn_leaf_bitmaps[3].set_pixel(6, 1, brightOrange)
@autumn_leaf_bitmaps[3].set_pixel(0, 2, paleOrange)
@autumn_leaf_bitmaps[3].set_pixel(1, 2, brightOrange)
@autumn_leaf_bitmaps[3].set_pixel(2, 2, orangeBrown)
@autumn_leaf_bitmaps[3].set_pixel(3, 2, burntRed)
@autumn_leaf_bitmaps[3].set_pixel(4, 2, orangeBrown)
@autumn_leaf_bitmaps[3].set_pixel(5, 2, brightOrange)
@autumn_leaf_bitmaps[3].fill_rect(1, 3, 3, 1, orangeBrown)
@autumn_leaf_bitmaps[3].fill_rect(4, 3, 2, 1, brightOrange)
@autumn_leaf_bitmaps[3].set_pixel(6, 3, orangeBrown)
@autumn_leaf_bitmaps[3].set_pixel(2, 4, burntRed)
@autumn_leaf_bitmaps[3].fill_rect(3, 4, 3, 1, brightOrange)
@autumn_leaf_bitmaps[3].set_pixel(6, 4, burntRed)
@autumn_leaf_bitmaps[3].set_pixel(7, 4, darkBrown)
@autumn_leaf_bitmaps[3].set_pixel(1, 5, orangeBrown)
@autumn_leaf_bitmaps[3].fill_rect(2, 5, 2, 1, brightOrange)
@autumn_leaf_bitmaps[3].set_pixel(4, 5, orangeBrown)
@autumn_leaf_bitmaps[3].set_pixel(5, 5, burntRed)
@autumn_leaf_bitmaps[3].fill_rect(1, 6, 2, 1, brightOrange)
@autumn_leaf_bitmaps[3].fill_rect(4, 6, 2, 1, burntRed)
@autumn_leaf_bitmaps[3].set_pixel(0, 7, brightOrange)
@autumn_leaf_bitmaps[3].set_pixel(5, 7, darkBrown)
@green_leaf_bitmaps = []
darkGreen = Color.new(62, 76, 31, 255)
midGreen = Color.new(76, 91, 43, 255)
khaki = Color.new(105, 114, 66, 255)
lightGreen = Color.new(128, 136, 88, 255)
mint = Color.new(146, 154, 106, 255)
# 1st leaf bitmap
@green_leaf_bitmaps[0] = Bitmap.new(8, 8)
@green_leaf_bitmaps[0].set_pixel(1, 0, darkGreen)
@green_leaf_bitmaps[0].set_pixel(1, 1, midGreen)
@green_leaf_bitmaps[0].set_pixel(2, 1, darkGreen)
@green_leaf_bitmaps[0].set_pixel(2, 2, khaki)
@green_leaf_bitmaps[0].set_pixel(3, 2, darkGreen)
@green_leaf_bitmaps[0].set_pixel(4, 2, khaki)
@green_leaf_bitmaps[0].fill_rect(2, 3, 3, 1, midGreen)
@green_leaf_bitmaps[0].set_pixel(5, 3, khaki)
@green_leaf_bitmaps[0].fill_rect(2, 4, 2, 1, midGreen)
@green_leaf_bitmaps[0].set_pixel(4, 4, darkGreen)
@green_leaf_bitmaps[0].set_pixel(5, 4, lightGreen)
@green_leaf_bitmaps[0].set_pixel(6, 4, khaki)
@green_leaf_bitmaps[0].set_pixel(3, 5, midGreen)
@green_leaf_bitmaps[0].set_pixel(4, 5, darkGreen)
@green_leaf_bitmaps[0].set_pixel(5, 5, khaki)
@green_leaf_bitmaps[0].set_pixel(6, 5, lightGreen)
@green_leaf_bitmaps[0].set_pixel(4, 6, midGreen)
@green_leaf_bitmaps[0].set_pixel(5, 6, darkGreen)
@green_leaf_bitmaps[0].set_pixel(6, 6, lightGreen)
@green_leaf_bitmaps[0].set_pixel(6, 7, khaki)
# 2nd leaf bitmap
@green_leaf_bitmaps[1] = Bitmap.new(8, 8)
@green_leaf_bitmaps[1].fill_rect(1, 1, 1, 2, midGreen)
@green_leaf_bitmaps[1].fill_rect(2, 2, 2, 1, khaki)
@green_leaf_bitmaps[1].set_pixel(4, 2, lightGreen)
@green_leaf_bitmaps[1].fill_rect(2, 3, 2, 1, darkGreen)
@green_leaf_bitmaps[1].fill_rect(4, 3, 2, 1, lightGreen)
@green_leaf_bitmaps[1].set_pixel(2, 4, midGreen)
@green_leaf_bitmaps[1].set_pixel(3, 4, darkGreen)
@green_leaf_bitmaps[1].set_pixel(4, 4, khaki)
@green_leaf_bitmaps[1].fill_rect(5, 4, 2, 1, lightGreen)
@green_leaf_bitmaps[1].set_pixel(3, 5, midGreen)
@green_leaf_bitmaps[1].set_pixel(4, 5, darkGreen)
@green_leaf_bitmaps[1].set_pixel(5, 5, khaki)
@green_leaf_bitmaps[1].set_pixel(6, 5, lightGreen)
@green_leaf_bitmaps[1].set_pixel(5, 6, darkGreen)
@green_leaf_bitmaps[1].fill_rect(6, 6, 2, 1, khaki)
# 3rd leaf bitmap
@green_leaf_bitmaps[2] = Bitmap.new(8, 8)
@green_leaf_bitmaps[2].set_pixel(1, 1, darkGreen)
@green_leaf_bitmaps[2].fill_rect(1, 2, 2, 1, midGreen)
@green_leaf_bitmaps[2].set_pixel(2, 3, midGreen)
@green_leaf_bitmaps[2].set_pixel(3, 3, darkGreen)
@green_leaf_bitmaps[2].set_pixel(4, 3, midGreen)
@green_leaf_bitmaps[2].fill_rect(2, 4, 2, 1, midGreen)
@green_leaf_bitmaps[2].set_pixel(4, 4, darkGreen)
@green_leaf_bitmaps[2].set_pixel(5, 4, lightGreen)
@green_leaf_bitmaps[2].set_pixel(3, 5, midGreen)
@green_leaf_bitmaps[2].set_pixel(4, 5, darkGreen)
@green_leaf_bitmaps[2].fill_rect(5, 5, 2, 1, khaki)
@green_leaf_bitmaps[2].fill_rect(4, 6, 2, 1, midGreen)
@green_leaf_bitmaps[2].set_pixel(6, 6, lightGreen)
@green_leaf_bitmaps[2].set_pixel(6, 7, khaki)
# 4th leaf bitmap
@green_leaf_bitmaps[3] = Bitmap.new(8, 8)
@green_leaf_bitmaps[3].fill_rect(0, 3, 1, 2, darkGreen)
@green_leaf_bitmaps[3].set_pixel(1, 4, midGreen)
@green_leaf_bitmaps[3].set_pixel(2, 4, khaki)
@green_leaf_bitmaps[3].set_pixel(3, 4, lightGreen)
@green_leaf_bitmaps[3].set_pixel(4, 4, darkGreen)
@green_leaf_bitmaps[3].set_pixel(7, 4, midGreen)
@green_leaf_bitmaps[3].set_pixel(1, 5, darkGreen)
@green_leaf_bitmaps[3].set_pixel(2, 5, midGreen)
@green_leaf_bitmaps[3].set_pixel(3, 5, lightGreen)
@green_leaf_bitmaps[3].set_pixel(4, 5, mint)
@green_leaf_bitmaps[3].set_pixel(5, 5, lightGreen)
@green_leaf_bitmaps[3].set_pixel(6, 5, khaki)
@green_leaf_bitmaps[3].set_pixel(7, 5, midGreen)
@green_leaf_bitmaps[3].fill_rect(2, 6, 2, 1, midGreen)
@green_leaf_bitmaps[3].set_pixel(4, 6, lightGreen)
@green_leaf_bitmaps[3].set_pixel(5, 6, khaki)
@green_leaf_bitmaps[3].set_pixel(6, 6, midGreen)
# 5th leaf bitmap
@green_leaf_bitmaps[4] = Bitmap.new(8, 8)
@green_leaf_bitmaps[4].set_pixel(6, 2, midGreen)
@green_leaf_bitmaps[4].set_pixel(7, 2, darkGreen)
@green_leaf_bitmaps[4].fill_rect(4, 3, 2, 1, midGreen)
@green_leaf_bitmaps[4].set_pixel(6, 3, khaki)
@green_leaf_bitmaps[4].set_pixel(2, 4, darkGreen)
@green_leaf_bitmaps[4].fill_rect(3, 4, 2, 1, khaki)
@green_leaf_bitmaps[4].set_pixel(5, 4, lightGreen)
@green_leaf_bitmaps[4].set_pixel(6, 4, khaki)
@green_leaf_bitmaps[4].set_pixel(1, 5, midGreen)
@green_leaf_bitmaps[4].set_pixel(2, 5, khaki)
@green_leaf_bitmaps[4].set_pixel(3, 5, lightGreen)
@green_leaf_bitmaps[4].set_pixel(4, 5, mint)
@green_leaf_bitmaps[4].set_pixel(5, 5, midGreen)
@green_leaf_bitmaps[4].set_pixel(2, 6, darkGreen)
@green_leaf_bitmaps[4].fill_rect(3, 6, 2, 1, midGreen)
# 6th leaf bitmap
@green_leaf_bitmaps[5] = Bitmap.new(8, 8)
@green_leaf_bitmaps[5].fill_rect(6, 2, 2, 1, midGreen)
@green_leaf_bitmaps[5].fill_rect(4, 3, 2, 1, midGreen)
@green_leaf_bitmaps[5].set_pixel(6, 3, khaki)
@green_leaf_bitmaps[5].set_pixel(3, 4, midGreen)
@green_leaf_bitmaps[5].set_pixel(4, 4, khaki)
@green_leaf_bitmaps[5].set_pixel(5, 4, lightGreen)
@green_leaf_bitmaps[5].set_pixel(6, 4, mint)
@green_leaf_bitmaps[5].set_pixel(1, 5, midGreen)
@green_leaf_bitmaps[5].set_pixel(2, 5, khaki)
@green_leaf_bitmaps[5].fill_rect(3, 5, 2, 1, mint)
@green_leaf_bitmaps[5].set_pixel(5, 5, lightGreen)
@green_leaf_bitmaps[5].set_pixel(2, 6, midGreen)
@green_leaf_bitmaps[5].set_pixel(3, 6, khaki)
@green_leaf_bitmaps[5].set_pixel(4, 6, lightGreen)
# 7th leaf bitmap
@green_leaf_bitmaps[6] = Bitmap.new(8, 8)
@green_leaf_bitmaps[6].fill_rect(6, 1, 1, 2, midGreen)
@green_leaf_bitmaps[6].fill_rect(4, 2, 2, 1, midGreen)
@green_leaf_bitmaps[6].fill_rect(6, 2, 1, 2, darkGreen)
@green_leaf_bitmaps[6].fill_rect(3, 3, 2, 1, midGreen)
@green_leaf_bitmaps[6].set_pixel(5, 3, khaki)
@green_leaf_bitmaps[6].set_pixel(2, 4, midGreen)
@green_leaf_bitmaps[6].set_pixel(3, 4, khaki)
@green_leaf_bitmaps[6].set_pixel(4, 4, lightGreen)
@green_leaf_bitmaps[6].set_pixel(5, 4, midGreen)
@green_leaf_bitmaps[6].set_pixel(1, 5, midGreen)
@green_leaf_bitmaps[6].set_pixel(2, 5, khaki)
@green_leaf_bitmaps[6].fill_rect(3, 5, 2, 1, midGreen)
@green_leaf_bitmaps[6].set_pixel(1, 6, darkGreen)
@green_leaf_bitmaps[6].set_pixel(2, 6, midGreen)
# 8th leaf bitmap
@green_leaf_bitmaps[7] = Bitmap.new(8, 8)
@green_leaf_bitmaps[7].set_pixel(6, 1, midGreen)
@green_leaf_bitmaps[7].fill_rect(4, 2, 3, 2, midGreen)
@green_leaf_bitmaps[7].set_pixel(3, 3, darkGreen)
@green_leaf_bitmaps[7].set_pixel(2, 4, darkGreen)
@green_leaf_bitmaps[7].set_pixel(3, 4, midGreen)
@green_leaf_bitmaps[7].fill_rect(4, 4, 2, 1, khaki)
@green_leaf_bitmaps[7].set_pixel(1, 5, darkGreen)
@green_leaf_bitmaps[7].set_pixel(2, 5, midGreen)
@green_leaf_bitmaps[7].fill_rect(3, 5, 2, 1, lightGreen)
@green_leaf_bitmaps[7].set_pixel(2, 6, midGreen)
@green_leaf_bitmaps[7].set_pixel(3, 6, lightGreen)
# 9th leaf bitmap
@green_leaf_bitmaps[8] = Bitmap.new(8, 8)
@green_leaf_bitmaps[8].fill_rect(6, 1, 1, 2, midGreen)
@green_leaf_bitmaps[8].fill_rect(4, 2, 2, 1, midGreen)
@green_leaf_bitmaps[8].fill_rect(6, 2, 1, 2, darkGreen)
@green_leaf_bitmaps[8].fill_rect(3, 3, 2, 1, midGreen)
@green_leaf_bitmaps[8].set_pixel(5, 3, khaki)
@green_leaf_bitmaps[8].set_pixel(2, 4, midGreen)
@green_leaf_bitmaps[8].set_pixel(3, 4, khaki)
@green_leaf_bitmaps[8].set_pixel(4, 4, lightGreen)
@green_leaf_bitmaps[8].set_pixel(5, 4, midGreen)
@green_leaf_bitmaps[8].set_pixel(1, 5, midGreen)
@green_leaf_bitmaps[8].set_pixel(2, 5, khaki)
@green_leaf_bitmaps[8].fill_rect(3, 5, 2, 1, midGreen)
@green_leaf_bitmaps[8].set_pixel(1, 6, darkGreen)
@green_leaf_bitmaps[8].set_pixel(2, 6, midGreen)
# 10th leaf bitmap
@green_leaf_bitmaps[9] = Bitmap.new(8, 8)
@green_leaf_bitmaps[9].fill_rect(6, 2, 2, 1, midGreen)
@green_leaf_bitmaps[9].fill_rect(4, 3, 2, 1, midGreen)
@green_leaf_bitmaps[9].set_pixel(6, 3, khaki)
@green_leaf_bitmaps[9].set_pixel(3, 4, midGreen)
@green_leaf_bitmaps[9].set_pixel(4, 4, khaki)
@green_leaf_bitmaps[9].set_pixel(5, 4, lightGreen)
@green_leaf_bitmaps[9].set_pixel(6, 4, mint)
@green_leaf_bitmaps[9].set_pixel(1, 5, midGreen)
@green_leaf_bitmaps[9].set_pixel(2, 5, khaki)
@green_leaf_bitmaps[9].fill_rect(3, 5, 2, 1, mint)
@green_leaf_bitmaps[9].set_pixel(5, 5, lightGreen)
@green_leaf_bitmaps[9].set_pixel(2, 6, midGreen)
@green_leaf_bitmaps[9].set_pixel(3, 6, khaki)
@green_leaf_bitmaps[9].set_pixel(4, 6, lightGreen)
# 11th leaf bitmap
@green_leaf_bitmaps[10] = Bitmap.new(8, 8)
@green_leaf_bitmaps[10].set_pixel(6, 2, midGreen)
@green_leaf_bitmaps[10].set_pixel(7, 2, darkGreen)
@green_leaf_bitmaps[10].fill_rect(4, 3, 2, 1, midGreen)
@green_leaf_bitmaps[10].set_pixel(6, 3, khaki)
@green_leaf_bitmaps[10].set_pixel(2, 4, darkGreen)
@green_leaf_bitmaps[10].fill_rect(3, 4, 2, 1, khaki)
@green_leaf_bitmaps[10].set_pixel(5, 4, lightGreen)
@green_leaf_bitmaps[10].set_pixel(6, 4, khaki)
@green_leaf_bitmaps[10].set_pixel(1, 5, midGreen)
@green_leaf_bitmaps[10].set_pixel(2, 5, khaki)
@green_leaf_bitmaps[10].set_pixel(3, 5, lightGreen)
@green_leaf_bitmaps[10].set_pixel(4, 5, mint)
@green_leaf_bitmaps[10].set_pixel(5, 5, midGreen)
@green_leaf_bitmaps[10].set_pixel(2, 6, darkGreen)
@green_leaf_bitmaps[10].fill_rect(3, 6, 2, 1, midGreen)
# 12th leaf bitmap
@green_leaf_bitmaps[11] = Bitmap.new(8, 8)
@green_leaf_bitmaps[11].fill_rect(0, 3, 1, 2, darkGreen)
@green_leaf_bitmaps[11].set_pixel(1, 4, midGreen)
@green_leaf_bitmaps[11].set_pixel(2, 4, khaki)
@green_leaf_bitmaps[11].set_pixel(3, 4, lightGreen)
@green_leaf_bitmaps[11].set_pixel(4, 4, darkGreen)
@green_leaf_bitmaps[11].set_pixel(7, 4, midGreen)
@green_leaf_bitmaps[11].set_pixel(1, 5, darkGreen)
@green_leaf_bitmaps[11].set_pixel(2, 5, midGreen)
@green_leaf_bitmaps[11].set_pixel(3, 5, lightGreen)
@green_leaf_bitmaps[11].set_pixel(4, 5, mint)
@green_leaf_bitmaps[11].set_pixel(5, 5, lightGreen)
@green_leaf_bitmaps[11].set_pixel(6, 5, khaki)
@green_leaf_bitmaps[11].set_pixel(7, 5, midGreen)
@green_leaf_bitmaps[11].fill_rect(2, 6, 2, 1, midGreen)
@green_leaf_bitmaps[11].set_pixel(4, 6, lightGreen)
@green_leaf_bitmaps[11].set_pixel(5, 6, khaki)
@green_leaf_bitmaps[11].set_pixel(6, 6, midGreen)
# 13th leaf bitmap
@green_leaf_bitmaps[12] = Bitmap.new(8, 8)
@green_leaf_bitmaps[12].set_pixel(1, 1, darkGreen)
@green_leaf_bitmaps[12].fill_rect(1, 2, 2, 1, midGreen)
@green_leaf_bitmaps[12].set_pixel(2, 3, midGreen)
@green_leaf_bitmaps[12].set_pixel(3, 3, darkGreen)
@green_leaf_bitmaps[12].set_pixel(4, 3, midGreen)
@green_leaf_bitmaps[12].fill_rect(2, 4, 2, 1, midGreen)
@green_leaf_bitmaps[12].set_pixel(4, 4, darkGreen)
@green_leaf_bitmaps[12].set_pixel(5, 4, lightGreen)
@green_leaf_bitmaps[12].set_pixel(3, 5, midGreen)
@green_leaf_bitmaps[12].set_pixel(4, 5, darkGreen)
@green_leaf_bitmaps[12].fill_rect(5, 5, 2, 1, khaki)
@green_leaf_bitmaps[12].fill_rect(4, 6, 2, 1, midGreen)
@green_leaf_bitmaps[12].set_pixel(6, 6, lightGreen)
@green_leaf_bitmaps[12].set_pixel(6, 7, khaki)
@rose_bitmaps = []
brightRed = Color.new(255, 0, 0, 255)
midRed = Color.new(179, 17, 17, 255)
darkRed = Color.new(141, 9, 9, 255)
# 1st rose petal bitmap
@rose_bitmaps[0] = Bitmap.new(3, 3)
@rose_bitmaps[0].fill_rect(1, 0, 2, 1, brightRed)
@rose_bitmaps[0].fill_rect(0, 1, 1, 2, brightRed)
@rose_bitmaps[0].fill_rect(1, 1, 2, 2, midRed)
@rose_bitmaps[0].set_pixel(2, 2, darkRed)
# 2nd rose petal bitmap
@rose_bitmaps[1] = Bitmap.new(3, 3)
@rose_bitmaps[1].set_pixel(0, 1, midRed)
@rose_bitmaps[1].set_pixel(1, 1, brightRed)
@rose_bitmaps[1].fill_rect(1, 2, 1, 2, midRed)
@feather_bitmaps = []
white = Color.new(255, 255, 255, 255)
# 1st feather bitmap
@feather_bitmaps[0] = Bitmap.new(3, 3)
@feather_bitmaps[0].set_pixel(0, 2, white)
@feather_bitmaps[0].set_pixel(1, 2, grey)
@feather_bitmaps[0].set_pixel(2, 1, grey)
# 2nd feather bitmap
@feather_bitmaps[0] = Bitmap.new(3, 3)
@feather_bitmaps[0].set_pixel(0, 0, white)
@feather_bitmaps[0].set_pixel(0, 1, grey)
@feather_bitmaps[0].set_pixel(1, 2, grey)
# 3rd feather bitmap
@feather_bitmaps[0] = Bitmap.new(3, 3)
@feather_bitmaps[0].set_pixel(2, 0, white)
@feather_bitmaps[0].set_pixel(1, 0, grey)
@feather_bitmaps[0].set_pixel(0, 1, grey)
# 4th feather bitmap
@feather_bitmaps[0] = Bitmap.new(3, 3)
@feather_bitmaps[0].set_pixel(2, 2, white)
@feather_bitmaps[0].set_pixel(2, 1, grey)
@feather_bitmaps[0].set_pixel(1, 0, grey)
@blood_rain_bitmap = Bitmap.new(7, 56)
for i in 0..6
@blood_rain_bitmap.fill_rect(6-i, i*8, 1, 8, darkRed)
end
@sparkle_bitmaps = []
lightBlue = Color.new(181, 244, 255, 255)
midBlue = Color.new(126, 197, 235, 255)
darkBlue = Color.new(77, 136, 225, 255)
# 1st sparkle bitmap
@sparkle_bitmaps[0] = Bitmap.new(7, 7)
@sparkle_bitmaps[0].set_pixel(3, 3, darkBlue)
# 2nd sparkle bitmap
@sparkle_bitmaps[1] = Bitmap.new(7, 7)
@sparkle_bitmaps[1].fill_rect(3, 2, 1, 3, darkBlue)
@sparkle_bitmaps[1].fill_rect(2, 3, 3, 1, darkBlue)
@sparkle_bitmaps[1].set_pixel(3, 3, midBlue)
# 3rd sparkle bitmap
@sparkle_bitmaps[2] = Bitmap.new(7, 7)
@sparkle_bitmaps[2].set_pixel(1, 1, darkBlue)
@sparkle_bitmaps[2].set_pixel(5, 1, darkBlue)
@sparkle_bitmaps[2].set_pixel(2, 2, midBlue)
@sparkle_bitmaps[2].set_pixel(4, 2, midBlue)
@sparkle_bitmaps[2].set_pixel(3, 3, lightBlue)
@sparkle_bitmaps[2].set_pixel(2, 4, midBlue)
@sparkle_bitmaps[2].set_pixel(4, 4, midBlue)
@sparkle_bitmaps[2].set_pixel(1, 5, darkBlue)
@sparkle_bitmaps[2].set_pixel(5, 5, darkBlue)
# 4th sparkle bitmap
@sparkle_bitmaps[3] = Bitmap.new(7, 7)
@sparkle_bitmaps[3].fill_rect(3, 1, 1, 5, darkBlue)
@sparkle_bitmaps[3].fill_rect(1, 3, 5, 1, darkBlue)
@sparkle_bitmaps[3].fill_rect(3, 2, 1, 3, midBlue)
@sparkle_bitmaps[3].fill_rect(2, 3, 3, 1, midBlue)
@sparkle_bitmaps[3].set_pixel(3, 3, lightBlue)
# 5th sparkle bitmap
@sparkle_bitmaps[4] = Bitmap.new(7, 7)
@sparkle_bitmaps[4].fill_rect(2, 2, 3, 3, midBlue)
@sparkle_bitmaps[4].fill_rect(3, 2, 1, 3, darkBlue)
@sparkle_bitmaps[4].fill_rect(2, 3, 3, 1, darkBlue)
@sparkle_bitmaps[4].set_pixel(3, 3, lightBlue)
@sparkle_bitmaps[4].set_pixel(1, 1, darkBlue)
@sparkle_bitmaps[4].set_pixel(5, 1, darkBlue)
@sparkle_bitmaps[4].set_pixel(1, 5, darkBlue)
@sparkle_bitmaps[4].set_pixel(5, 1, darkBlue)
# 6th sparkle bitmap
@sparkle_bitmaps[5] = Bitmap.new(7, 7)
@sparkle_bitmaps[5].fill_rect(2, 1, 3, 5, darkBlue)
@sparkle_bitmaps[5].fill_rect(1, 2, 5, 3, darkBlue)
@sparkle_bitmaps[5].fill_rect(2, 2, 3, 3, midBlue)
@sparkle_bitmaps[5].fill_rect(3, 1, 1, 5, midBlue)
@sparkle_bitmaps[5].fill_rect(1, 3, 5, 1, midBlue)
@sparkle_bitmaps[5].fill_rect(3, 2, 1, 3, lightBlue)
@sparkle_bitmaps[5].fill_rect(2, 3, 3, 1, lightBlue)
@sparkle_bitmaps[5].set_pixel(3, 3, white)
# 7th sparkle bitmap
@sparkle_bitmaps[6] = Bitmap.new(7, 7)
@sparkle_bitmaps[6].fill_rect(2, 1, 3, 5, midBlue)
@sparkle_bitmaps[6].fill_rect(1, 2, 5, 3, midBlue)
@sparkle_bitmaps[6].fill_rect(3, 0, 1, 7, darkBlue)
@sparkle_bitmaps[6].fill_rect(0, 3, 7, 1, darkBlue)
@sparkle_bitmaps[6].fill_rect(2, 2, 3, 3, lightBlue)
@sparkle_bitmaps[6].fill_rect(3, 2, 1, 3, midBlue)
@sparkle_bitmaps[6].fill_rect(2, 3, 3, 1, midBlue)
@sparkle_bitmaps[6].set_pixel(3, 3, white)
@user_bitmaps = []
update_user_defined
end
def update_user_defined
for image in @user_bitmaps
image.dispose
end
#user-defined bitmaps
for name in $WEATHER_IMAGES
@user_bitmaps.push(RPG::Cache.picture(name))
end
for sprite in @sprites
sprite.bitmap = @user_bitmaps[rand(@user_bitmaps.size)]
end
end
attr_reader :type
attr_reader :max
attr_reader :ox
attr_reader :oy
end
end
复制代码
作者:
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^
#==============================================================================
# | Auto_Battle
#------------------------------------------------------------------------------
# 作者 Thousand Dragoon Link 和 Sir_KnightDragoon
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# 刷新同伴指令
#--------------------------------------------------------------------------
def update_phase2
if Input.trigger?(Input::C)
case @party_command_window.index
when 0 # 战斗
# 是否播放SE
$game_system.se_play($data_system.decision_se)
start_phase3
when 1 # 逃跑
# 不能逃跑时
if $game_temp.battle_can_escape == false
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
update_phase2_escape
when 2 #自动战斗
$game_system.se_play($data_system.decision_se)
update_phase2_auto
end
return
end
end
#--------------------------------------------------------------------------
# 自动战斗指令刷新
#--------------------------------------------------------------------------
def update_phase2_auto
loop do
if @actor_index == $game_party.actors.size-1
start_phase4
return
end
@actor_index += 1
$game_party.actors[@actor_index].current_action.kind = 0
$game_party.actors[@actor_index].current_action.basic = 0
$game_party.actors[@actor_index].current_action.decide_random_target_for_actor
end
end
end
class Window_PartyCommand < Window_Selectable
#--------------------------------------------------------------------------
# 目标初始化
#--------------------------------------------------------------------------
def initialize
super(0, 0, 640, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = 160
self.contents.font.name = "黑体"
self.contents.font.size = 18
@commands = ["战斗", "逃跑", "自动战斗"]
@item_max = 3
@column_max = 3
draw_item(0, normal_color)
draw_item(1, $game_temp.battle_can_escape ? normal_color : disabled_color)
draw_item(2, normal_color)
self.active = false
self.visible = false
self.index = 0
end
#--------------------------------------------------------------------------
def draw_item(index, color)
self.contents.font.color = color
rect = Rect.new(80 + index * 160 + 4, 0, 128 - 10, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, @commands[index], 1)
end
#--------------------------------------------------------------------------
# 刷新光标
#--------------------------------------------------------------------------
def update_cursor_rect
self.cursor_rect.set(80 + index * 160, 0, 128, 32)
end
end
复制代码
作者:
frantice
时间:
2006-7-18 16:56
7月18日更新
整合商店界面脚本
来源:同上
由于是多人合作的结果,所以明天一一把作者列出。
介绍:一个比较漂亮的商店界面,如果拓展下功能加入图片之类的话就能形成更灵活
的界面(比如放进小2的图片什么之类的)
说明:脚本很长很长,事实上工作原理很简单。
PART1
#==============================================================================
# ■ Window_Base
#------------------------------------------------------------------------------
# 添加两种颜色
#==============================================================================
class Window_Base < Window
# --------------------------------
def up_color
return Color.new(74, 210, 74)
end
# --------------------------------
def down_color
return Color.new(170, 170, 170)
end
end
#==============================================================================
# | Window_ShopCommand
#------------------------------------------------------------------------------
#==============================================================================
class Window_ShopCommand < Window_Selectable
#--------------------------------------------------------------------------
# 初始化
#--------------------------------------------------------------------------
def initialize
super(0, 64, 428, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "宋体"
self.contents.font.size = 18
self.opacity = 130
@item_max = 4
@column_max = 4
@commands = ["购买", "卖出", "装备", "取消"]
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i)
end
end
#--------------------------------------------------------------------------
# 描绘物品
#
#--------------------------------------------------------------------------
def draw_item(index)
x = 4 + index * 107
self.contents.draw_text(x, 0, 128, 32, @commands[index])
end
end
#==============================================================================
# ■ Window_Help
#--------------------
# 一个新的窗口
#==============================================================================
class Window_Help2 < Window_Base
#--------------------------------------------------------------------------
# ●初始化
#--------------------------------------------------------------------------
def initialize
super(80, 70, 480, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "宋体"
self.contents.font.size = 17
self.opacity = 130
end
#--------------------------------------------------------------------------
def set_text(text, align = 0)
if text != @text or align != @align
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, self.width - 40, 32, text, align)
@text = text
@align = align
@actor = nil
end
self.visible = true
end
#--------------------------------------------------------------------------
def set_actor(actor)
if actor != @actor
self.contents.clear
draw_actor_name(actor, 4, 0)
draw_actor_state(actor, 140, 0)
draw_actor_hp(actor, 284, 0)
draw_actor_sp(actor, 460, 0)
@actor = actor
@text = nil
self.visible = true
end
end
#--------------------------------------------------------------------------
def set_enemy(enemy)
text = enemy.name
state_text = make_battler_state_text(enemy, 112, false)
if state_text != ""
text += " " + state_text
end
set_text(text, 1)
end
end
#==============================================================================
# ■ Window_Gold
#------------------------------------------------------------------------------
# 新的金钱窗口
#==============================================================================
class Window_Gold2 < Window_Base
#--------------------------------------------------------------------------
def initialize
super(0, 0, 160, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "宋体"
self.contents.font.size = 18
self.opacity = 130
refresh
end
#--------------------------------------------------------------------------
def refresh
self.contents.clear
cx = contents.text_size($data_system.words.gold).width
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 120-cx-2, 32, $game_party.gold.to_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(124-cx, 0, cx, 32, $data_system.words.gold, 2)
end
end
#==============================================================================
# ■ Window_Equipment
#------------------------------------------------------------------------------
# 强化装备窗口
#==============================================================================
class Window_Equipment < Window_Base
#--------------------------------------------------------------------------
def initialize
super(240, 8, 160, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "宋体"
self.contents.font.size = 17
self.opacity = 130
refresh
end
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(28, 0, 96, 32, " 装备")
end
end
############新的装备左窗口################
class Window_EquipLeft2 < Window_Base
# --------------------------------
attr_accessor :mode
attr_accessor :changes
# --------------------------------
def initialize(actor)
super(0, 130, 320, 260)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "宋体"
self.contents.font.size = 17
self.opacity = 130
self.z += 100
@actor = actor
@mode = 0
@changes = [0, 0, 0, 0, 0, 0, 0, 0]
@elem_text = ""
@stat_text = ""
refresh
end
# --------------------------------
def refresh
self.contents.clear
draw_actor_name(@actor, 4, 0)
draw_actor_level(@actor, 140, 0)
draw_actor_parameter(@actor, 4, 18, 0)
draw_actor_parameter(@actor, 4, 36, 1)
draw_actor_parameter(@actor, 4, 54, 2)
draw_actor_parameter(@actor, 4, 72, 3)
draw_actor_parameter(@actor, 4, 90, 4)
draw_actor_parameter(@actor, 4, 108, 5)
draw_actor_parameter(@actor, 4, 126, 6)
if @mode == 0
self.contents.font.color = up_color
self.contents.draw_text(4, 144, 200, 32, "攻击")
end
if @mode == 1
self.contents.font.color = up_color
self.contents.draw_text(4, 144, 200, 32, "防御")
end
self.contents.font.color = normal_color
self.contents.draw_text(12, 162, 220, 32, @elem_text)
self.contents.draw_text(12, 198, 220, 32, @stat_text)
if @new_atk != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 18, 40, 32, " =", 1)
if @changes[0] == 0
self.contents.font.color = normal_color
elsif @changes[0] == -1
self.contents.font.color = down_color
else
self.contents.font.color = up_color
end
self.contents.draw_text(200, 18, 36, 32, @new_atk.to_s, 2)
end
if @new_pdef != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 36, 40, 32, " =", 1)
if @changes[1] == 0
self.contents.font.color = normal_color
elsif @changes[1] == -1
self.contents.font.color = down_color
else
self.contents.font.color = up_color
end
self.contents.draw_text(200, 36, 36, 32, @new_pdef.to_s, 2)
end
if @new_mdef != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 54, 40, 32, " =", 1)
if @changes[2] == 0
self.contents.font.color = normal_color
elsif @changes[2] == -1
self.contents.font.color = down_color
else
self.contents.font.color = up_color
end
self.contents.draw_text(200, 54, 36, 32, @new_mdef.to_s, 2)
end
if @new_str != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 72, 40, 32, " =", 1)
if @changes[3] == 0
self.contents.font.color = normal_color
elsif @changes[3] == -1
self.contents.font.color = down_color
else
self.contents.font.color = up_color
end
self.contents.draw_text(200, 72, 36, 32, @new_str.to_s, 2)
end
if @new_dex != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 90, 40, 32, " =", 1)
if @changes[4] == 0
self.contents.font.color = normal_color
elsif @changes[4] == -1
self.contents.font.color = down_color
else
self.contents.font.color = up_color
end
self.contents.draw_text(200, 90, 36, 32, @new_dex.to_s, 2)
end
if @new_agi != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 108, 40, 32, " =", 1)
if @changes[5] == 0
self.contents.font.color = normal_color
elsif @changes[5] == -1
self.contents.font.color = down_color
else
self.contents.font.color = up_color
end
self.contents.draw_text(200, 108, 36, 32, @new_agi.to_s, 2)
end
if @new_int != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 126, 40, 32, " =", 1)
if @changes[6] == 0
self.contents.font.color = normal_color
elsif @changes[6] == -1
self.contents.font.color = down_color
else
self.contents.font.color = up_color
end
self.contents.draw_text(200, 126, 36, 32, @new_int.to_s, 2)
end
end
# --------------------------------
def set_new_parameters(new_atk, new_pdef, new_mdef, new_str, new_dex,
new_agi, new_int, new_eva, elem_text, stat_text)
flag = false
if new_atk != @new_atk || new_pdef != @new_pdef || new_mdef != @new_mdef
flag = true
end
if new_str != @new_str || new_dex != @new_dex || new_agi != @new_agi
flag = true
end
if new_eva != @new_eva || elem_text != @elem_text || stat_text != @stat_text
flag = true
end
@new_atk = new_atk
@new_pdef = new_pdef
@new_mdef = new_mdef
@new_str = new_str
@new_dex = new_dex
@new_agi = new_agi
@new_int = new_int
@new_eva = new_eva
@elem_text = elem_text
@stat_text = stat_text
if flag
refresh
end
end
end
#==============================================================================
# ■ Window_EquipRight
#------------------------------------------------------------------------------
# 新的装备右窗口
#==============================================================================
class Window_EquipRight2 < Window_Selectable
#--------------------------------------------------------------------------
def initialize(actor)
super(320, 130, 320, 260)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "宋体"
self.contents.font.size = 17
self.opacity = 130
@actor = actor
refresh
self.index = 0
end
#--------------------------------------------------------------------------
def item
return @data[self.index]
end
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@data = []
@data.push($data_weapons[@actor.weapon_id])
@data.push($data_armors[@actor.armor1_id])
@data.push($data_armors[@actor.armor2_id])
@data.push($data_armors[@actor.armor3_id])
@data.push($data_armors[@actor.armor4_id])
@item_max = @data.size
self.contents.font.color = system_color
self.contents.draw_text(4, 32 * 0, 92, 32, $data_system.words.weapon)
self.contents.draw_text(4, 32 * 1, 92, 32, $data_system.words.armor1)
self.contents.draw_text(4, 32 * 2, 92, 32, $data_system.words.armor2)
self.contents.draw_text(4, 32 * 3, 92, 32, $data_system.words.armor3)
self.contents.draw_text(5, 32 * 4, 92, 32, $data_system.words.armor4)
draw_item_name(@data[0], 92, 32 * 0)
draw_item_name(@data[1], 92, 32 * 1)
draw_item_name(@data[2], 92, 32 * 2)
draw_item_name(@data[3], 92, 32 * 3)
draw_item_name(@data[4], 92, 32 * 4)
end
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(self.item == nil ? "" : self.item.description)
end
end
############新的装备物品窗口################3
class Window_EquipItem2 < Window_Selectable
# --------------------------------
def initialize(actor, equip_type)
super(100, 390, 428, 64)
self.opacity = 130
@actor = actor
@equip_type = equip_type
@column_max = 2
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
def item
return @data[self.index]
end
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
if @equip_type == 0
weapon_set = $data_classes[@actor.class_id].weapon_set
for i in 1...$data_weapons.size
if $game_party.weapon_number(i) > 0 and weapon_set.include?(i)
@data.push($data_weapons[i])
end
end
end
if @equip_type != 0
armor_set = $data_classes[@actor.class_id].armor_set
for i in 1...$data_armors.size
if $game_party.armor_number(i) > 0 and armor_set.include?(i)
if $data_armors[i].kind == @equip_type-1
@data.push($data_armors[i])
end
end
end
end
@data.push(nil)
@item_max = @data.size
self.contents = Bitmap.new(width - 32, row_max * 32)
self.contents.font.name = "宋体"
self.contents.font.size = 17
for i in 0...@item_max-1
draw_item(i)
end
end
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
x = 4 + index % 2 * (182 + 32)
y = index / 2 * 32
case item
when RPG::Weapon
number = $game_party.weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
end
bitmap = RPG::Cache.icon(item.icon_name)
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
self.contents.font.color = normal_color
self.contents.font.name = "宋体"
self.contents.font.size = 17
self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
self.contents.draw_text(x + 132, y, 16, 32, ":", 1)
self.contents.draw_text(x + 140, y, 24, 32, number.to_s, 2)
end
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(self.item == nil ? "" : self.item.description)
end
end
复制代码
作者:
美兽
时间:
2006-7-18 17:17
那个天气非常不错,谢谢,收了。
作者:
小湖
时间:
2006-7-18 18:29
不错诶…………{/cy}{/cy}
天气那个能显示在图片之上吗?
作者:
frantice
时间:
2006-7-18 22:33
接上7月18日更新的商店整合脚本
PART2
#==============================================================================
# | Window_ShopBuy
#------------------------------------------------------------------------------
# 商店购买窗口
#==============================================================================
class Window_ShopBuy < Window_Selectable
#--------------------------------------------------------------------------
def initialize(shop_goods)
super(0, 130, 320, 260)
self.opacity = 130
@shop_goods = shop_goods
refresh
self.index = 0
end
#--------------------------------------------------------------------------
def item
return @data[self.index]
end
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
for goods_item in @shop_goods
case goods_item[0]
when 0
item = $data_items[goods_item[1]]
when 1
item = $data_weapons[goods_item[1]]
when 2
item = $data_armors[goods_item[1]]
end
if item != nil
@data.push(item)
end
end
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
self.contents.font.name = "宋体"
self.contents.font.size = 18
for i in 0...@item_max
draw_item(i)
end
end
end
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
case item
when RPG::Item
number = $game_party.item_number(item.id)
when RPG::Weapon
number = $game_party.weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
end
if item.price <= $game_party.gold and number < 99
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x = 4
y = index * 32
rect = Rect.new(x, y, self.width - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(item.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
self.contents.draw_text(x + 190, y, 88, 32, item.price.to_s, 2)
end
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(self.item == nil ? "" : self.item.description)
end
end
#==============================================================================
# | Window_ShopSell
#------------------------------------------------------------------------------
# 商店卖出窗口
#==============================================================================
class Window_ShopSell < Window_Selectable
#--------------------------------------------------------------------------
def initialize
super(320, 130, 320, 260)
self.opacity = 130
@column_max = 1
refresh
self.index = 0
end
#--------------------------------------------------------------------------
def item
return @data[self.index]
end
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
for i in 1...$data_items.size
if $game_party.item_number(i) > 0
@data.push($data_items[i])
end
end
for i in 1...$data_weapons.size
if $game_party.weapon_number(i) > 0
@data.push($data_weapons[i])
end
end
for i in 1...$data_armors.size
if $game_party.armor_number(i) > 0
@data.push($data_armors[i])
end
end
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
self.contents.font.name = "宋体"
self.contents.font.size = 18
for i in 0...@item_max
draw_item(i)
end
end
end
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
case item
when RPG::Item
number = $game_party.item_number(item.id)
when RPG::Weapon
number = $game_party.weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
end
if item.price > 0
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x = 4 + index % 1 * (288 + 32)
y = index / 1 * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(item.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
end
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(self.item == nil ? "" : self.item.description)
end
end
#==============================================================================
# | Window_ShopNumber
#------------------------------------------------------------------------------
# 商店数值输入窗口
#==============================================================================
class Window_ShopNumber < Window_Base
#--------------------------------------------------------------------------
def initialize
super(0, 130, 320, 260)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "宋体"
self.contents.font.size = 18
self.opacity = 130
@item = nil
@max = 1
@price = 0
@number = 1
end
#--------------------------------------------------------------------------
def set(item, max, price)
@item = item
@max = max
@price = price
@number = 1
refresh
end
#--------------------------------------------------------------------------
def number
return @number
end
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_item_name(@item, 4, 96)
self.contents.font.color = normal_color
self.contents.draw_text(182, 128, 32, 32, "×")
self.contents.draw_text(154, 128, 24, 32, @number.to_s, 2)
self.cursor_rect.set(304, 96, 32, 32)
domination = $data_system.words.gold
cx = contents.text_size(domination).width
total_price = @price * @number
self.contents.font.color = normal_color
self.contents.draw_text(-50, 160, 328-cx-2, 32, total_price.to_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(282-cx, 160, cx, 32, domination, 2)
end
#--------------------------------------------------------------------------
def update
super
if self.active
if Input.repeat?(Input::RIGHT) and @number < @max
$game_system.se_play($data_system.cursor_se)
@number += 1
refresh
end
if Input.repeat?(Input::LEFT) and @number > 1
$game_system.se_play($data_system.cursor_se)
@number -= 1
refresh
end
if Input.repeat?(Input::UP) and @number < @max
$game_system.se_play($data_system.cursor_se)
@number = [@number + 10, @max].min
refresh
end
if Input.repeat?(Input::DOWN) and @number > 1
$game_system.se_play($data_system.cursor_se)
@number = [@number - 10, 1].max
refresh
end
end
end
end
#==============================================================================
# | Window_ShopStatus
#------------------------------------------------------------------------------
# 商店状态窗口~这个在论坛上可以找到(一段不好的往事。)……
# 在人物行走的基础上强化了所有属性变化的显示(就是当时我当时说的应该强化的那
# 一部分,可惜在这个脚本发现之前我就已经拼出来这个效果了55555555……)
# 部分字没有翻译,自己搜索下是什么意思。
#==============================================================================
class Window_ShopStatus < Window_Base
#--------------------------------------------------------------------------
def initialize
super(320, 130, 320, 260)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "宋体"
self.contents.font.size = 18
self.opacity = 130
@sprite1 = nil
@sprite2 = nil
@sprite3 = nil
@sprite4 = nil
@walk = [false, false, false, false]
@count = 0
@item = nil
refresh
end
#--------------------------------------------------------------------------
def refresh
self.contents.clear
if @sprite1 != nil
@sprite1.dispose
@sprite1 = nil
end
if @sprite2 != nil
@sprite2.dispose
@sprite2 = nil
end
if @sprite3 != nil
@sprite3.dispose
@sprite3 = nil
end
if @sprite4 != nil
@sprite4.dispose
@sprite4 = nil
end
self.contents.font.name = "宋体"
self.contents.font.size = 18
if @item == nil
return
end
case @item
when RPG::Item
number = $game_party.item_number(@item.id)
when RPG::Weapon
number = $game_party.weapon_number(@item.id)
when RPG::Armor
number = $game_party.armor_number(@item.id)
end
self.contents.font.color = system_color
self.contents.draw_text(4, -8, 200, 32, "已装备:")
self.contents.font.color = normal_color
self.contents.draw_text(204, -8, 32, 32, number.to_s, 2)
if @item.is_a?(RPG::Item)
@walk = [false, false, false, false]
return
end
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
if @item.is_a?(RPG::Weapon)
item1 = $data_weapons[actor.weapon_id]
elsif @item.kind == 0
item1 = $data_armors[actor.armor1_id]
elsif @item.kind == 1
item1 = $data_armors[actor.armor2_id]
elsif @item.kind == 2
item1 = $data_armors[actor.armor3_id]
else
item1 = $data_armors[actor.armor4_id]
end
if not actor.equippable?(@item)
@walk[i] = false
draw_actor_graphic(actor, 330, 194 + 64 * i, i, 0)
self.contents.font.name = "宋体"
self.contents.font.size = 18
self.contents.font.color = normal_color
self.contents.draw_text(32, 26 + (54 * i), 150, 32, "无法装备")
end
if actor.equippable?(@item)
@walk[i] = true
draw_actor_graphic(actor, 330, 144 + 64 * i, i, 1)
atk1 = 0
atk2 = 0
eva1 = 0
eva2 = 0
str1 = 0
str2 = 0
dex1 = 0
dex2 = 0
agi1 = 0
agi2 = 0
int1 = 0
int2 = 0
pdf1 = 0
pdf2 = 0
mdf1 = 0
mdf2 = 0
eva1 = 0
eva2 = 0
str1 = item1 != nil ? item1.str_plus : 0
str2 = @item != nil ? @item.str_plus : 0
dex1 = item1 != nil ? item1.dex_plus : 0
dex2 = @item != nil ? @item.dex_plus : 0
agi1 = item1 != nil ? item1.agi_plus : 0
agi2 = @item != nil ? @item.agi_plus : 0
int1 = item1 != nil ? item1.int_plus : 0
int2 = @item != nil ? @item.int_plus : 0
pdf1 = item1 != nil ? item1.pdef : 0
pdf2 = @item != nil ? @item.pdef : 0
mdf1 = item1 != nil ? item1.mdef : 0
mdf2 = @item != nil ? @item.mdef : 0
if @item.is_a?(RPG::Weapon)
atk1 = item1 != nil ? item1.atk : 0
atk2 = @item != nil ? @item.atk : 0
end
if @item.is_a?(RPG::Armor)
eva1 = item1 != nil ? item1.eva : 0
eva2 = @item != nil ? @item.eva : 0
end
str_change = str2 - str1
dex_change = dex2 - dex1
agi_change = agi2 - agi1
int_change = int2 - int1
pdf_change = pdf2 - pdf1
mdf_change = mdf2 - mdf1
atk_change = atk2 - atk1
eva_change = eva2 - eva1
if item1 == nil
name1 = ""
else
name1 = item1.name
end
if @item == nil
name2 = ""
else
name2 = @item.name
end
if str_change == 0 && dex_change == 0 && agi_change == 0 &&
pdf_change == 0 && mdf_change == 0 && atk_change == 0 &&
eva_change == 0 && name1 != name2
self.contents.font.name = "宋体"
self.contents.font.size = 18
self.contents.font.color = normal_color
self.contents.draw_text(32, 26 + (54 * i), 150, 32, "没有改变")
end
if name1 == name2
self.contents.font.name = "宋体"
self.contents.font.size = 18
self.contents.font.color = normal_color
self.contents.draw_text(32, 26 + (54 * i), 200, 32, "已装备")
end
self.contents.font.name = "宋体"
self.contents.font.size = 16
self.contents.font.color = normal_color
if @item.is_a?(RPG::Weapon) && atk_change != 0
self.contents.draw_text(32, 10 + (54 * i), 32, 32, "ATK")
end
if @item.is_a?(RPG::Armor) && eva_change != 0
self.contents.draw_text(32, 10 + (54 * i), 32, 32, "EVA")
end
if pdf_change != 0
self.contents.draw_text(32, 26 + (54 * i), 32, 32, "PDF")
end
if mdf_change != 0
self.contents.draw_text(32, 42 + (54 * i), 32, 32, "MDF")
end
if str_change != 0
self.contents.draw_text(112, 10 + (54 * i), 32, 32, "STR")
end
if dex_change != 0
self.contents.draw_text(112, 26 + (54 * i), 32, 32, "DEX")
end
if agi_change != 0
self.contents.draw_text(112, 42 + (54 * i), 32, 32, "AGI")
end
if str_change != 0
self.contents.draw_text(192, 10 + (54 * i), 32, 32, "INT")
end
if @item.is_a?(RPG::Weapon) && atk_change > 0
self.contents.font.color = up_color
s = atk_change.abs.to_s
self.contents.draw_text(60, 10 + (54 * i), 4, 32, "+")
self.contents.draw_text(62, 10 + (54 * i), 24, 32, s, 2)
end
if @item.is_a?(RPG::Weapon) && atk_change < 0
self.contents.font.color = down_color
s = atk_change.abs.to_s
self.contents.draw_text(60, 10 + (54 * i), 4, 32, "-")
self.contents.draw_text(62, 10 + (54 * i), 24, 32, s, 2)
end
if @item.is_a?(RPG::Armor) && eva_change > 0
self.contents.font.color = up_color
s = eva_change.abs.to_s
self.contents.draw_text(60, 10 + (54 * i), 4, 32, "+")
self.contents.draw_text(62, 10 + (54 * i), 24, 32, s, 2)
end
if @item.is_a?(RPG::Armor) && eva_change < 0
self.contents.font.color = down_color
s = eva_change.abs.to_s
self.contents.draw_text(60, 10 + (54 * i), 4, 32, "-")
self.contents.draw_text(62, 10 + (54 * i), 24, 32, s, 2)
end
if pdf_change > 0
self.contents.font.color = up_color
s = pdf_change.abs.to_s
self.contents.draw_text(60, 26 + (54 * i), 4, 32, "+")
self.contents.draw_text(62, 26 + (54 * i), 24, 32, s, 2)
end
if pdf_change < 0
self.contents.font.color = down_color
s = pdf_change.abs.to_s
self.contents.draw_text(60, 26 + (54 * i), 4, 32, "-")
self.contents.draw_text(62, 26 + (54 * i), 24, 32, s, 2)
end
if mdf_change > 0
self.contents.font.color = up_color
s = mdf_change.abs.to_s
self.contents.draw_text(60, 42 + (54 * i), 4, 32, "+")
self.contents.draw_text(62, 42 + (54 * i), 24, 32, s, 2)
end
if mdf_change < 0
self.contents.font.color = down_color
s = mdf_change.abs.to_s
self.contents.draw_text(60, 42 + (54 * i), 4, 32, "-")
self.contents.draw_text(62, 42 + (54 * i), 24, 32, s, 2)
end
if str_change > 0
self.contents.font.color = up_color
s = str_change.abs.to_s
self.contents.draw_text(140, 10 + (54 * i), 4, 32, "+")
self.contents.draw_text(142, 10 + (54 * i), 24, 32, s, 2)
end
if str_change < 0
self.contents.font.color = down_color
s = str_change.abs.to_s
self.contents.draw_text(140, 10 + (54 * i), 4, 32, "-")
self.contents.draw_text(142, 10 + (54 * i), 24, 32, s, 2)
end
if dex_change > 0
self.contents.font.color = up_color
s = dex_change.abs.to_s
self.contents.draw_text(140, 26 + (54 * i), 4, 32, "+")
self.contents.draw_text(142, 26 + (54 * i), 24, 32, s, 2)
end
if dex_change < 0
self.contents.font.color = down_color
s = dex_change.abs.to_s
self.contents.draw_text(140, 26 + (54 * i), 4, 32, "-")
self.contents.draw_text(142, 26 + (54 * i), 24, 32, s, 2)
end
if agi_change > 0
self.contents.font.color = up_color
s = agi_change.abs.to_s
self.contents.draw_text(140, 42 + (54 * i), 4, 32, "+")
self.contents.draw_text(142, 42 + (54 * i), 24, 32, s, 2)
end
if agi_change < 0
self.contents.font.color = down_color
s = agi_change.abs.to_s
self.contents.draw_text(140, 42 + (54 * i), 4, 32, "-")
self.contents.draw_text(142, 42 + (54 * i), 24, 32, s, 2)
end
if int_change > 0
self.contents.font.color = up_color
s = int_change.abs.to_s
self.contents.draw_text(220, 10 + (54 * i), 4, 32, "+")
self.contents.draw_text(222, 10 + (54 * i), 24, 32, s, 2)
end
if int_change < 0
self.contents.font.color = down_color
s = int_change.abs.to_s
self.contents.draw_text(220, 10 + (54 * i), 4, 32, "-")
self.contents.draw_text(222, 10 + (54 * i), 24, 32, s, 2)
end
end
end
end
# ---------------------------------------
def item=(item)
if @item != item
@item = item
refresh
end
end
# ---------------------------------------
def draw_actor_graphic(actor, x, y, id, tone_id)
if id == 0
@v1 = Viewport.new(330, 164, 32, 48)
@v1.z = 9998
@sprite1 = Sprite.new(@v1)
@sprite1.bitmap = RPG::Cache.character(actor.character_name,
actor.character_hue)
if tone_id == 0
@sprite1.tone = Tone.new(0, 0, 0, 255)
else
@sprite1.tone = Tone.new(0, 0, 0, 0)
end
@sprite1.visible = true
end
if id == 1
@v2 = Viewport.new(330, 218, 32, 48)
@v2.z = 9999
@sprite2 = Sprite.new(@v2)
@sprite2.bitmap = RPG::Cache.character(actor.character_name,
actor.character_hue)
if tone_id == 0
@sprite2.tone = Tone.new(0, 0, 0, 255)
else
@sprite2.tone = Tone.new(0, 0, 0, 0)
end
@sprite2.visible = true
end
if id == 2
@v3 = Viewport.new(330, 272, 32, 48)
@v3.z = 9999
@sprite3 = Sprite.new(@v3)
@sprite3.bitmap = RPG::Cache.character(actor.character_name,
actor.character_hue)
if tone_id == 0
@sprite3.tone = Tone.new(0, 0, 0, 255)
else
@sprite3.tone = Tone.new(0, 0, 0, 0)
end
@sprite3.visible = true
end
if id == 3
@v4 = Viewport.new(330, 326, 32, 48)
@v4.z = 9999
@sprite4 = Sprite.new(@v4)
@sprite4.bitmap = RPG::Cache.character(actor.character_name,
actor.character_hue)
if tone_id == 0
@sprite4.tone = Tone.new(0, 0, 0, 255)
else
@sprite4.tone = Tone.new(0, 0, 0, 0)
end
@sprite4.visible = true
end
end
# ---------------------------------------
def update
super
@count += 1
for i in
[email protected]
if @walk[i] == false
case i
when 0
if @sprite1 != nil
@sprite1.ox = 0
end
when 1
if @sprite2 != nil
@sprite2.ox = 0
end
when 2
if @sprite3 != nil
@sprite3.ox = 0
end
when 3
if @sprite4 != nil
@sprite4.ox = 0
end
end
end
end
if @count == 0
for i in
[email protected]
if @walk[i] == true
case i
when 0
if @sprite1 != nil
@sprite1.ox = 0
end
when 1
if @sprite2 != nil
@sprite2.ox = 0
end
when 2
if @sprite3 != nil
@sprite3.ox = 0
end
when 3
if @sprite4 != nil
@sprite4.ox = 0
end
end
end
end
end
if @count == 5
for i in
[email protected]
if @walk[i] == true
case i
when 0
if @sprite1 != nil
@sprite1.ox = 32
end
when 1
if @sprite2 != nil
@sprite2.ox = 32
end
when 2
if @sprite3 != nil
@sprite3.ox = 32
end
when 3
if @sprite4 != nil
@sprite4.ox = 32
end
end
end
end
end
if @count == 10
for i in
[email protected]
if @walk[i] == true
case i
when 0
if @sprite1 != nil
@sprite1.ox = 64
end
when 1
if @sprite2 != nil
@sprite2.ox = 64
end
when 2
if @sprite3 != nil
@sprite3.ox = 64
end
when 3
if @sprite4 != nil
@sprite4.ox = 64
end
end
end
end
end
if @count == 15
@count = 0
end
end
end
#==============================================================================
# | Window_Help
#------------------------------------------------------------------------------
#==============================================================================
class Window_HelpShop < Window_Base
#--------------------------------------------------------------------------
def initialize
super(80, 70, 480, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "宋体"
self.contents.font.size = 18
self.opacity = 130
end
#--------------------------------------------------------------------------
def set_text(text, align = 1)
if text != @text or align != @align
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, self.width - 40, 32, text, align)
@text = text
@align = align
@actor = nil
end
self.visible = true
end
#--------------------------------------------------------------------------
def set_actor(actor)
if actor != @actor
self.contents.clear
draw_actor_name(actor, 4, 0)
draw_actor_state(actor, 140, 0)
draw_actor_hp(actor, 284, 0)
draw_actor_sp(actor, 460, 0)
@actor = actor
@text = nil
self.visible = true
end
end
#--------------------------------------------------------------------------
def set_enemy(enemy)
text = enemy.name
state_text = make_battler_state_text(enemy, 112, false)
if state_text != ""
text += " " + state_text
end
set_text(text, 1)
end
end
#==============================================================================
# | Scene_Shop
#------------------------------------------------------------------------------
# 对比下看看什么东西改变了~
#==============================================================================
class Scene_Shop
#--------------------------------------------------------------------------
def main
@spriteset = Spriteset_Map.new
@help_window = Window_HelpShop.new
@command_window = Window_ShopCommand.new
@command_window. x = 100
@command_window. y = 390
@gold_window = Window_Gold2.new
@gold_window.x = 240
@gold_window.y = 8
@buy_window = Window_ShopBuy.new($game_temp.shop_goods)
@buy_window.active = false
@buy_window.visible = false
@buy_window.help_window = @help_window
@sell_window = Window_ShopSell.new
@sell_window.active = false
@sell_window.visible = false
@sell_window.help_window = @help_window
@number_window = Window_ShopNumber.new
@number_window.active = false
@number_window.visible = false
@status_window = Window_ShopStatus.new
@status_window.visible = false
#command
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@spriteset.dispose
@help_window.dispose
@command_window.dispose
@gold_window.dispose
@buy_window.dispose
@sell_window.dispose
@number_window.dispose
@status_window.dispose
end
#--------------------------------------------------------------------------
def update
@help_window.update
@command_window.update
@gold_window.update
@buy_window.update
@sell_window.update
@number_window.update
@status_window.update
if @command_window.active
update_command
return
end
if @buy_window.active
update_buy
return
end
if @sell_window.active
update_sell
return
end
if @number_window.active
update_number
return
end
end
复制代码
作者:
frantice
时间:
2006-7-18 22:35
接上7月18日更新的商店整合脚本
用的时候3个部分连接在一起放一个脚本里,嗯。
PART3
#--------------------------------------------------------------------------
def update_command
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
if Input.trigger?(Input::C)
case @command_window.index
when 0
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@buy_window.active = true
@buy_window.visible = true
@buy_window.refresh
@status_window.visible = true
when 1
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@sell_window.active = true
@sell_window.visible = true
@sell_window.refresh
when 2
$game_system.se_play($data_system.decision_se)
# 这个加进去的装备界面
$scene = Scene_Equip2.new
when 3
$game_system.se_play($data_system.decision_se)
$scene = Scene_Map.new
end
return
end
end
#--------------------------------------------------------------------------
def update_buy
@status_window.item = @buy_window.item
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active = true
@buy_window.active = false
@buy_window.visible = false
@status_window.visible = false
@status_window.item = nil
@help_window.set_text("")
return
end
if Input.trigger?(Input::C)
@item = @buy_window.item
if @item == nil or @item.price > $game_party.gold
$game_system.se_play($data_system.buzzer_se)
return
end
case @item
when RPG::Item
number = $game_party.item_number(@item.id)
when RPG::Weapon
number = $game_party.weapon_number(@item.id)
when RPG::Armor
number = $game_party.armor_number(@item.id)
end
if number == 99
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
max = @item.price == 0 ? 99 : $game_party.gold / @item.price
max = [max, 99 - number].min
@buy_window.active = false
@buy_window.visible = false
@number_window.set(@item, max, @item.price)
@number_window.active = true
@number_window.visible = true
end
end
#--------------------------------------------------------------------------
def update_sell
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active = true
@sell_window.active = false
@sell_window.visible = false
@status_window.item = nil
##########下面这个没了##########
#@status_window.visible = false
@help_window.set_text("")
return
end
if Input.trigger?(Input::C)
@item = @sell_window.item
@status_window.item = @item
if @item == nil or @item.price == 0
$game_system.se_play($data_system.buzzer_se)
@status_window.item = nil
@status_window.item = @item
return
end
$game_system.se_play($data_system.decision_se)
case @item
when RPG::Item
number = $game_party.item_number(@item.id)
when RPG::Weapon
number = $game_party.weapon_number(@item.id)
when RPG::Armor
number = $game_party.armor_number(@item.id)
end
max = number
@sell_window.active = false
@sell_window.visible = false
@number_window.set(@item, max, @item.price / 2)
@number_window.active = true
@number_window.visible = true
@status_window.visible = true
end
end
#--------------------------------------------------------------------------
def update_number
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@number_window.active = false
@number_window.visible = false
case @command_window.index
when 0
@buy_window.active = true
@buy_window.visible = true
when 1
@sell_window.active = true
@sell_window.visible = true
@status_window.visible = false
@status_window.item = nil
end
return
end
if Input.trigger?(Input::C)
$game_system.se_play($data_system.shop_se)
@number_window.active = false
@number_window.visible = false
case @command_window.index
when 0
$game_party.lose_gold(@number_window.number * @item.price)
case @item
when RPG::Item
$game_party.gain_item(@item.id, @number_window.number)
when RPG::Weapon
$game_party.gain_weapon(@item.id, @number_window.number)
when RPG::Armor
$game_party.gain_armor(@item.id, @number_window.number)
end
@gold_window.refresh
@buy_window.refresh
@status_window.refresh
@buy_window.active = true
@buy_window.visible = true
when 1
$game_party.gain_gold(@number_window.number * (@item.price / 2))
case @item
when RPG::Item
$game_party.lose_item(@item.id, @number_window.number)
when RPG::Weapon
$game_party.lose_weapon(@item.id, @number_window.number)
when RPG::Armor
$game_party.lose_armor(@item.id, @number_window.number)
end
@gold_window.refresh
@sell_window.refresh
@status_window.refresh
@sell_window.active = true
@sell_window.visible = true
@status_window.visible = false
@status_window.item = nil
end
return
end
end
end
#==============================================================================
# ■ Scene_Equip2
#------------------------------------------------------------------------------
# 新的装备画面处理~对照原先的装备画面看看哪里变了
#==============================================================================
class Scene_Equip2
#--------------------------------------------------------------------------
def initialize(actor_index = 0, equip_index = 0)
@actor_index = actor_index
@equip_index = equip_index
end
#--------------------------------------------------------------------------
def main
@spriteset = Spriteset_Map.new
@actor = $game_party.actors[@actor_index]
@equipment_window = Window_Equipment.new
@help_window = Window_Help2.new
@left_window = Window_EquipLeft2.new(@actor)
@right_window = Window_EquipRight2.new(@actor)
@item_window1 = Window_EquipItem2.new(@actor, 0)
@item_window2 = Window_EquipItem2.new(@actor, 1)
@item_window3 = Window_EquipItem2.new(@actor, 2)
@item_window4 = Window_EquipItem2.new(@actor, 3)
@item_window5 = Window_EquipItem2.new(@actor, 4)
@right_window.help_window = @help_window
@item_window1.help_window = @help_window
@item_window2.help_window = @help_window
@item_window3.help_window = @help_window
@item_window4.help_window = @help_window
@item_window5.help_window = @help_window
@right_window.index = @equip_index
refresh
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@spriteset.dispose
@equipment_window.dispose
@help_window.dispose
@left_window.dispose
@right_window.dispose
@item_window1.dispose
@item_window2.dispose
@item_window3.dispose
@item_window4.dispose
@item_window5.dispose
end
#--------------------------------------------------------------------------
def refresh
@item_window1.visible = (@right_window.index == 0)
@item_window2.visible = (@right_window.index == 1)
@item_window3.visible = (@right_window.index == 2)
@item_window4.visible = (@right_window.index == 3)
@item_window5.visible = (@right_window.index == 4)
item1 = @right_window.item
case @right_window.index
when 0
@item_window = @item_window1
newmode = 0
when 1
@item_window = @item_window2
newmode = 1
when 2
@item_window = @item_window3
newmode = 1
when 3
@item_window = @item_window4
newmode = 1
when 4
@item_window = @item_window5
newmode = 1
end
if newmode != @left_window.mode
@left_window.mode = newmode
@left_window.refresh
end
if @right_window.active
##############我要全部都显示####################
@left_window.set_new_parameters(nil, nil, nil, nil, nil, nil, nil, nil,
"", "")
end
if @item_window.active
item2 = @item_window.item
last_hp = @actor.hp
last_sp = @actor.sp
old_atk = @actor.atk
old_pdef = @actor.pdef
old_mdef = @actor.mdef
old_str = @actor.str
old_dex = @actor.dex
old_agi = @actor.agi
old_int = @actor.int
old_eva = @actor.eva
@actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
new_atk = @actor.atk
new_pdef = @actor.pdef
new_mdef = @actor.mdef
new_str = @actor.str
new_dex = @actor.dex
new_agi = @actor.agi
new_int = @actor.int
new_eva = @actor.eva
@left_window.changes = [0, 0, 0, 0, 0, 0, 0, 0]
if new_atk > old_atk
@left_window.changes[0] = 1
end
if new_atk < old_atk
@left_window.changes[0] = -1
end
if new_pdef > old_pdef
@left_window.changes[1] = 1
end
if new_pdef < old_pdef
@left_window.changes[1] = -1
end
if new_mdef > old_mdef
@left_window.changes[2] = 1
end
if new_mdef < old_mdef
@left_window.changes[2] = -1
end
if new_str > old_str
@left_window.changes[3] = 1
end
if new_str < old_str
@left_window.changes[3] = -1
end
if new_dex > old_dex
@left_window.changes[4] = 1
end
if new_dex < old_dex
@left_window.changes[4] = -1
end
if new_agi > old_agi
@left_window.changes[5] = 1
end
if new_agi < old_agi
@left_window.changes[5] = -1
end
if new_int > old_int
@left_window.changes[6] = 1
end
if new_int < old_int
@left_window.changes[6] = -1
end
if new_eva > old_eva
@left_window.changes[7] = 1
end
if new_eva < old_eva
@left_window.changes[7] = -1
end
elem_text = make_elem_text(item2)
stat_text = make_stat_text(item2)
@actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)
@actor.hp = last_hp
@actor.sp = last_sp
@left_window.set_new_parameters(new_atk, new_pdef, new_mdef, new_str,
new_dex, new_agi, new_int, new_eva, elem_text, stat_text)
end
end
# --------------------------------
def make_elem_text(item)
text = ""
flag = false
if item.is_a?(RPG::Weapon)
for i in item.element_set
if flag
text += ", "
end
text += $data_system.elements[i]
flag = true
end
end
if item.is_a?(RPG::Armor)
for i in item.guard_element_set
if flag
text += ", "
end
text += $data_system.elements[i]
flag = true
end
end
return text
end
# --------------------------------
def make_stat_text(item)
text = ""
flag = false
if item.is_a?(RPG::Weapon)
for i in item.plus_state_set
if flag
text += ", "
end
text += $data_states[i].name
flag = true
end
end
if item.is_a?(RPG::Armor)
for i in item.guard_state_set
if flag
text += ", "
end
text += $data_states[i].name
flag = true
end
end
return text
end
#--------------------------------------------------------------------------
def update
@equipment_window.update
@left_window.update
@right_window.update
@item_window.update
refresh
if @right_window.active
update_right
return
end
if @item_window.active
update_item
return
end
end
def update_right
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
#########我要回到商店窗口#########
$scene = Scene_Shop.new
return
end
if Input.trigger?(Input::C)
if @actor.equip_fix?(@right_window.index)
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
@right_window.active = false
@item_window.active = true
@item_window.index = 0
return
end
if Input.trigger?(Input::R)
$game_system.se_play($data_system.cursor_se)
@actor_index += 1
@actor_index %= $game_party.actors.size
$scene = Scene_Equip2.new(@actor_index, @right_window.index)
return
end
if Input.trigger?(Input::L)
$game_system.se_play($data_system.cursor_se)
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
$scene = Scene_Equip2.new(@actor_index, @right_window.index)
return
end
end
#--------------------------------------------------------------------------
def update_item
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@right_window.active = true
@item_window.active = false
@item_window.index = -1
return
end
if Input.trigger?(Input::C)
$game_system.se_play($data_system.equip_se)
item = @item_window.item
@actor.equip(@right_window.index, item == nil ? 0 : item.id)
@right_window.active = true
@item_window.active = false
@item_window.index = -1
@right_window.refresh
@item_window.refresh
return
end
end
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但大于对方
差不多这样了,会这种牌的人指点下。。
=begin
-----------------------------------------------------------------
:A scr?pt brought to you by LanLanGames,
:www.LanLanGames.tk, its horrendousgusting
:made by lanlan
:special thanks to those who helped at the
:rmxp.net RGSS support thread
:and to the guy who envented blackjack
-----------------------------------------------------------------
=end
class Scene_Blackjack
def main
@help_window = Window_Help.new
@table_window = Window_Table.new
@bet_window = Window_Bet.new
@bet_window.index = 0
@money_window = Window_Money.new
@hitstay_window = Window_HitStay.new
@hitstay_window.active = false
@cards = []
@graphic = []
@card_used = 0
variable_init
shuffle2
val_graphic
shuffle
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@help_window.dispose
@table_window.dispose
@bet_window.dispose
@money_window.dispose
@hitstay_window.dispose
end
def update
@table_window.update
@bet_window.update
@help_window.update
@money_window.update
@hitstay_window.update
if @bet_window.active
update_bet
return
end
if @hitstay_window.active
update_hitstay
return
end
end
def update_bet
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@bet_window.index = 5
return
end
if Input.trigger?(Input::C)
case @bet_window.index
when 0
@bet = 25
if ($game_party.gold >= @bet) and ((@currentbet+@bet) <= 500)
$game_system.se_play($data_system.decision_se)
bet
else
$game_system.se_play($data_system.buzzer_se)
return
end
when 1
@bet = 50
if ($game_party.gold >= @bet) and ((@currentbet+@bet) <= 500)
$game_system.se_play($data_system.decision_se)
bet
else
$game_system.se_play($data_system.buzzer_se)
return
end
when 2
@bet = 100
if ($game_party.gold >= @bet) and ((@currentbet+@bet) <= 500)
$game_system.se_play($data_system.decision_se)
bet
else
$game_system.se_play($data_system.buzzer_se)
return
end
when 3
@bet = 500
if ($game_party.gold >= @bet) and ((@currentbet+@bet) <= 500)
$game_system.se_play($data_system.decision_se)
bet
else
$game_system.se_play($data_system.buzzer_se)
return
end
when 4
$game_system.se_play($data_system.decision_se)
start_blackjack
when 5
$game_system.se_play($data_system.cancel_se)
$game_party.gain_gold(@currentbet)
$scene = Scene_Map.new
end
end
end
def update_hitstay
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@hitstay_window.index = 1
return
end
if Input.trigger?(Input::C)
case @hitstay_window.index
when 0
hit
when 1
stay
end
end
end
def bet
$game_party.lose_gold(@bet)
@currentbet += @bet
@money_window.refresh(@currentbet)
end
def start_blackjack
@bet_window.active = false
@m_hand1 = @cards[@card_used]
@graphic1 = @graphic[@card_used]
check_cards
@card_used +=1
@m_hand2 = @cards[@card_used]
@graphic2 = @graphic[@card_used]
check_cards
@card_used +=1
@d_hand1 = @cards[@card_used]
@d_graphic1 = @graphic[@card_used]
check_cards
@card_used +=1
@d_hand2 = @cards[@card_used]
@d_graphic2 = @graphic[@card_used]
@m_total = @m_hand1+@m_hand2
@d_total = @d_hand1+@d_hand2
if @m_hand1 == 1
@m_ace =1
@m_hand1=@m_hand1+10
@m_total=@m_hand1 + @m_hand2
end
if @m_hand2 == 1
if @m_hand1 != 11
@m_ace = 1
@m_hand2 = @m_hand2+10
@m_total = @m_hand1+@m_hand2
else
@m_hand2 = 1
@m_total = @m_hand1+@m_hand2
end
end
if @d_hand1 == 1
@d_ace =1
@d_hand1=@d_hand1+10
@d_total=@d_hand1 + @d_hand2
end
if @d_hand2 == 1
if @d_hand1 != 11
@d_ace = 1
@d_hand2 = @d_hand2+10
@d_total = @d_hand1+@d_hand2
else
@d_card2 = 1
@d_total = @d_hand1+@d_hand2
end
end
draw_cards
check_win
end
def shuffle
j = 51
k = 0
temp = 0
temp2 = 0
while (j>=0)
k = rand(j)
temp = @cards[j]
temp2 = @graphic[j]
@cards[j] = @cards[k]
@graphic[j] = @graphic[k]
@cards[k] = temp
@graphic[k] = temp2
j-=1
end
end
def shuffle2
@cards = [1,2,3,4,5,6,7,8,9,10,10,10,10,
1,2,3,4,5,6,7,8,9,10,10,10,10,
1,2,3,4,5,6,7,8,9,10,10,10,10,
1,2,3,4,5,6,7,8,9,10,10,10,10,
0,0]
end
def val_graphic
for i in 0...53
@graphic[i] = i
end
end
def check_cards
if @card_used == 52
shuffle
@card_used = 0
end
end
def draw_cards
@table_window.refresh(@m_hand1,@graphic1,
@m_hand2,@graphic2,
@m_hand3,@graphic3,
@m_hand4,@graphic4,
@m_hand5,@graphic5,
@d_hand1,52,
@d_hand2,@d_graphic2,
@d_hand3,@d_graphic3,
@d_hand4,@d_graphic4,
@d_hand5,@d_graphic5,
@m_total)
end
def draw_real_cards
@table_window.refresh(@m_hand1,@graphic1,
@m_hand2,@graphic2,
@m_hand3,@graphic3,
@m_hand4,@graphic4,
@m_hand5,@graphic5,
@d_hand1,@d_graphic1,
@d_hand2,@d_graphic2,
@d_hand3,@d_graphic3,
@d_hand4,@d_graphic4,
@d_hand5,@d_graphic5,
@m_total)
end
def variable_init
@bet = 0
@currentbet = 0
@dummy_gold = 0
@m_hand1 = 0
@graphic1 = 53
@m_hand2 = 0
@graphic2 = 53
@m_hand3 = 0
@graphic3 = 53
@m_hand4 = 0
@graphic4 = 53
@m_hand5 = 0
@graphic5 = 53
@d_hand1 = 0
@d_graphic1 = 53
@d_hand2 = 0
@d_graphic2 = 53
@d_hand3 = 0
@d_graphic3 = 53
@d_hand4 = 0
@d_graphic4 = 53
@d_hand5 = 0
@d_graphic5 = 53
@m_ace = 0
@d_ace = 0
@test = 0
end
def hit
check_cards
@card_used +=1
if @m_hand3 == 0
@m_hand3 = @cards[@card_used]
@graphic3 = @graphic[@card_used]
elsif @m_hand4 == 0 and @m_hand3 != 0
@m_hand4 = @cards[@card_used]
@graphic4 = @graphic[@card_used]
elsif @m_hand5 == 0 and @m_hand4 != 0
@m_hand5 = @cards[@card_used]
@graphic5 = @graphic[@card_used]
end
if @cards[@card_used] == 1
if @m_total <=10
@m_ace = 1
@m_total += 11
else
@m_total += 1
end
else
@m_total += @cards[@card_used]
end
check_win2
end
def stay
while (@d_total<=@m_total)
check_cards
@card_used +=1
if @d_hand3 == 0
@d_hand3 = @cards[@card_used]
@d_graphic3 = @graphic[@card_used]
elsif @d_hand4 == 0 and @m_hand3 != 0
@d_hand4 = @cards[@card_used]
@d_graphic4 = @graphic[@card_used]
elsif @d_hand5 == 0 and @m_hand4 != 0
@d_hand5 = @cards[@card_used]
@d_graphic5 = @graphic[@card_used]
end
if @cards[@card_used] == 1
if @d_total <=10
@d_ace = 1
@d_total += 11
else
@d_total += 1
end
else
@d_total += @cards[@card_used]
end
end
check_win3
end
def check_win
if @test == 0
if @m_total == 21 and @d_total != 21
draw_real_cards
win
elsif @m_total != 21 and @d_total == 21
draw_real_cards
lose
elsif @m_total == 21 and @d_total == 21
draw_real_cards
tie
else
@test = 1
@hitstay_window.active = true
end
end
end
def check_win2
if @m_total >= 22 and @m_ace == 1
@m_total -= 10
@m_ace = 0
draw_cards
elsif @m_total >= 22
draw_real_cards
lose
elsif @m_total == 21
draw_real_cards
win
elsif @m_total <=20
draw_cards
@hitstay_window.active = true
end
end
def check_win3
if @d_total >= 22 and @d_ace == 1
@d_total -= 10
@d_ace = 0
draw_real_cards
elsif @d_total >= 22
draw_real_cards
win
elsif @d_total == 21
draw_real_cards
lose
elsif @d_total > @m_total and @d_total <= 20
draw_real_cards
lose
elsif @d_total == @m_total
draw_real_cards
tie
elsif @d_total < @m_total
draw_real_cards
win
end
end
def win
$game_party.gain_gold(@currentbet*2)
@help_window.set_text("Win!")
delay(3)
$scene = Scene_Map.new
end
def lose
@help_window.set_text("Lose!")
delay(3)
$scene = Scene_Map.new
end
def tie
$game_party.gain_gold(@currentbet)
@help_window.set_text("Tie!")
delay(3)
$scene = Scene_Map.new
end
def delay(seconds)
for i in 0...(seconds * 10)
sleep 0.1
Graphics.update
end
end
end
class Window_Table < Window_Base
def initialize
super(0, 64, 512, 416)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
refresh
end
#--------------------------------------------------------------------------
def refresh(hand1 = 0, graphic1 = 53,
hand2 = 0, graphic2 = 53,
hand3 = 0, graphic3 = 53,
hand4 = 0, graphic4 = 53,
hand5 = 0, graphic5 = 53,
d_hand1 = 0, d_graphic1 = 53,
d_hand2 = 0, d_graphic2 = 53,
d_hand3 = 0, d_graphic3 = 53,
d_hand4 = 0, d_graphic4 = 53,
d_hand5 = 0, d_graphic5 = 53,
total = 0)
@hand1 = hand1
@hand2 = hand2
@hand3 = hand3
@hand4 = hand4
@hand5 = hand5
@d_hand1 = d_hand1
@d_hand2 = d_hand2
@d_hand3 = d_hand3
@d_hand4 = d_hand4
@d_hand5 = d_hand5
@graphic1 = graphic1
@graphic2 = graphic2
@graphic3 = graphic3
@graphic4 = graphic4
@graphic5 = graphic5
@d_graphic1 = d_graphic1
@d_graphic2 = d_graphic2
@d_graphic3 = d_graphic3
@d_graphic4 = d_graphic4
@d_graphic5 = d_graphic5
@total = total
self.contents.clear
self.contents.draw_text(32, 320, 128, 32, "Your Hand: " + @total.to_s)
graphic
end
def graphic
x = 0
y = 0
@frame_width = 71
@frame_height = 96
if @graphic1 !=nil
@xpos1 = @graphic1*@frame_width
else
@xpos1 = 52
end
if @graphic2 !=nil
@xpos2 = @graphic2*@frame_width
else
@xpos2 = 52
end
if @graphic3 !=nil
@xpos3 = @graphic3*@frame_width
else
@xpos3 = 52
end
if @graphic4 !=nil
@xpos4 = @graphic4*@frame_width
else
@xpos4 = 52
end
if @graphic5 !=nil
@xpos5 = @graphic5*@frame_width
else
@xpos5 = 52
end
if @d_graphic1 !=nil
@xposd1 = @d_graphic1*@frame_width
else
@xposd1 = 52
end
if @graphic2 !=nil
@xposd2 = @d_graphic2*@frame_width
else
@xposd2 = 52
end
if @d_graphic3 !=nil
@xposd3 = @d_graphic3*@frame_width
else
@xposd3 = 52
end
if @graphic4 !=nil
@xposd4 = @d_graphic4*@frame_width
else
@xposd4 = 52
end
if @d_graphic5 !=nil
@xposd5 = @d_graphic5*@frame_width
else
@xposd5 = 52
end
bitmap = RPG::Cache.picture("cards")
src_rect_hand1 = Rect.new(@xpos1, 0, @frame_width, @frame_height)
src_rect_hand2 = Rect.new(@xpos2, 0, @frame_width, @frame_height)
src_rect_hand3 = Rect.new(@xpos3, 0, @frame_width, @frame_height)
src_rect_hand4 = Rect.new(@xpos4, 0, @frame_width, @frame_height)
src_rect_hand5 = Rect.new(@xpos5, 0, @frame_width, @frame_height)
src_rect_d_hand1 = Rect.new(@xposd1, 0, @frame_width, @frame_height)
src_rect_d_hand2 = Rect.new(@xposd2, 0, @frame_width, @frame_height)
src_rect_d_hand3 = Rect.new(@xposd3, 0, @frame_width, @frame_height)
src_rect_d_hand4 = Rect.new(@xposd4, 0, @frame_width, @frame_height)
src_rect_d_hand5 = Rect.new(@xposd5, 0, @frame_width, @frame_height)
self.contents.blt(0,192,bitmap,src_rect_hand1)
self.contents.blt(96,192,bitmap,src_rect_hand2)
self.contents.blt(96*2,192,bitmap,src_rect_hand3)
self.contents.blt(96*3,192,bitmap,src_rect_hand4)
self.contents.blt(96*4,192,bitmap,src_rect_hand5)
self.contents.blt(0,0,bitmap,src_rect_d_hand1)
self.contents.blt(96,0,bitmap,src_rect_d_hand2)
self.contents.blt(96*2,0,bitmap,src_rect_d_hand3)
self.contents.blt(96*3,0,bitmap,src_rect_d_hand4)
self.contents.blt(96*4,0,bitmap,src_rect_d_hand5)
end
end
class Window_Bet < Window_Selectable
# ------------------------------------
def initialize
super(512, 64, 128, 224)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
@column_max = 1
refresh
self.index = 0
end
# ------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
@item_max = 6
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max
draw_item(i)
end
end
end
# ------------------------------------
def draw_item(index)
x = 4
y = index * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
case index
when 0
self.contents.draw_text(x , y, 128, 32, "25", 0)
when 1
self.contents.draw_text(x , y, 128, 32, "50", 0)
when 2
self.contents.draw_text(x , y, 128, 32, "100", 0)
when 3
self.contents.draw_text(x , y, 128, 32, "500", 0)
when 4
self.contents.draw_text(x , y, 128, 32, "Done", 0)
when 5
self.contents.draw_text(x , y, 128, 32, "Quit", 0)
end
end
# ------------------------------------
def update_help
@help_window.set_text("" )
end
end
class Window_Money < Window_Base
# ------------------------------------
def initialize
super(512, 288, 128, 96)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
@bet = 0
refresh(@bet)
end
# ------------------------------------
def refresh(bet)
@bet = bet
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(0, 0, 96, 32, $game_party.gold.to_s,2)
self.contents.draw_text(0, 32, 96, 32, @bet.to_s, 2)
end
end
class Window_HitStay < Window_Selectable
# ------------------------------------
def initialize
super(512, 384, 128, 96)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name =$fontface
self.contents.font.size = $fontsize
@column_max = 1
refresh
self.index = 0
end
# ------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
@item_max = 2
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max
draw_item(i)
end
end
end
# ------------------------------------
def draw_item(index)
x = 4
y = index * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
case index
when 0
self.contents.draw_text(x , y, 128, 32, "Hit", 0)
when 1
self.contents.draw_text(x , y, 128, 32, "Stay", 0)
end
end
# ------------------------------------
def update_help
@help_window.set_text("" )
end
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