赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 1515 |
最后登录 | 2013-6-20 |
在线时间 | 48 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 48 小时
- 注册时间
- 2006-12-10
- 帖子
- 51
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
今天研究“学习技能”脚本,本想拿来用,但是报错。请大家指点下```
(1)Window_Drug.new
--------------------------------------------------------------------------------------
class Scene_Drug
include Opacity_CS
def main
create_screen
@drug = Window_Drug.new
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene !=self
break
end
end
Graphics.freeze
@drug.dispose
dispose_screen
end
def update
@drug.refresh
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
if (Graphic.frame_count%10) == 0
if $game_variables[25] != 0
if $game_system.drug_min[$name]< $game_system.drug_max[$name]
$game_system.drug_min[$name] += 1
$game_variables[25] -= 1
else
$game_system.drug_name[$name] += 1
$game_system.drug_min[$name] = 0
$game_system.drug_max[$name] += $game_system.drug_name[$name] + 30
end
else
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
end
end
end
end
--------------------------------------------------------------------------------------
(2)Window_Drug
--------------------------------------------------------------------------------------
class Window_Drug < Window_Base
def initialize
super(160,120,320,120)
self.contents = Bitmap.new(width - 32,height - 32)
refresh
end
def refresh
self.contents.clear
width = 255
x = 0
y = 0
self.contents.font.color = Color.new(255,255,255,255)
self.contents.fill_rect(x-2+10,y+45,width+4,8,Color.new(255,255,255,255))
self.contents.fill_rect(x-1+10,y+46,width+2,6,Color.new(0,0,0,255))
w = width * $game_system.drug_min / $game_system.drug_max
self.contets.font.size = 18
self.contets.draw_text(x-20,y,160,32,"学习中.....",1)
self.contets.fill_rect(x+10,y+47,w,1,Color.new(255,141,0,255))
self.contets.fill_rect(x+10,y+48,w,1,Color.new(255,180,0,255))
self.contets.fill_rect(x+10,y+49,w,1,Color.new(157,87,0,255))
self.contets.fill_rect(x+10,y+49,w,1,Color.new(0,0,0,255))
self.contets.font.color = Color.new(255,255,255,255)
self.contets.draw_text(x+30,y+32,128,32,$game_system.drug_min.to_s,1)
self.contets.draw_text(x+96+20,y+32,12,32, "/",1)
self.contets.draw_text(x+120+20,y+32,48,32,$game_system.drug_mmax.to_s)
self.contets.draw_text(x+10,y+64,72,32,"剩余潜力:",1)
self.contets.draw_text(x+80,y+64,48,32,$game_variables[1].to_s,1)
self.contets.draw_text(x+142,y+64,72,32,"技能等级:",1)
self.contets.draw_text(x+205,y+64,48,32,$game_system.drug_name.to_s,1)
if $game_system.drug_min >= $game_system.drug_max
$game_system.drug_min = $game_system.drug_max
end
end
end
--------------------------------------------------------------------------------------
(3)opacity for map
--------------------------------------------------------------------------------------
module Opacity_CS
def create_screen
@back = Spriteset_Map.new
end
def dispose_screen
@back.dispose
end
end
--------------------------------------------------------------------------------------
整个脚本就以上3部分组成,但是我一运行就提示"SyntaxError",请大家指点下! 本贴由论坛斑竹九泪结贴,如楼主认为问题未解决,请重新将此贴编辑为“有事请教”,并回帖叙述疑点即可~ ^-^ |
|