赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 3004 |
最后登录 | 2015-4-6 |
在线时间 | 38 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 38 小时
- 注册时间
- 2013-3-7
- 帖子
- 11
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 RANDOM 于 2013-4-23 12:55 编辑
其实有好几个问题的,研究了好久脚本太长了日语注释也看不懂,于是还是来问了。。。
1,当己方一个成员的AT条满了行动的时候,我希望其他的队友AT条停止,脚本该怎么改?
2,如图,己方CP条的长度比较短,但是我设的宽度都是144.。。。这是怎么回事?(显示CP条的脚本在下面)
。。。
class Window_Base < Window #-------------------------------------------------------------------------- # ● CP 表的绘画 #-------------------------------------------------------------------------- # draw_actor_cp_original 和名字变更原创的 CP 绘画 alias :draw_actor_cp_original :draw_actor_cp def draw_actor_cp(actor, x, y, width = 144) # 变数 rate 在现在的 SP/MSP 代入 if actor.maxcp != 0 rate = actor.cp.to_f / actor.maxcp else rate = 1 end # plus_x: X 座标的位置补正 rate_x:X 座标的位置补正 (%) plus_y:Y 座标的位置补正 # plus_width: 宽度的补正 rate_width:宽度的补正 (%) height:纵宽度 # align1:描画タイプ10: 左装 1:中央聚集 2:右边装 # align2:描画タイプ20: 上装 1:中央聚集 2:下包装 # align3:ゲージタイプ0: 左装 1:右边装 plus_x = 0 rate_x = 0 plus_y = 25 plus_width = 0 rate_width = 100 height = 10 align1 = 1 align2 = 2 align3 = 0 # 浓淡法设定 grade1:空表 grade2:实际表 #(0:在横浓淡法 1:纵向地浓淡法 2:斜浓淡法 (激烈重 ) ) grade1 = 1 grade2 = 0 # 设定颜色。color1: 外范围,color2:整个范围 # color3: 空表黑的彩色,color4:空表右方彩色 # color5: 实际表黑的彩色,color6:实际表右方彩色 color1 = Color.new(0, 0, 0, 192) color2 = Color.new(255, 255, 192, 192) color3 = Color.new(0, 0, 0, 192) color4 = Color.new(0, 64, 0, 192) color5 = Color.new(14 * rate, 80 - 24 * rate, 80 * rate, 192) color6 = Color.new(0 * rate, 240 - 72 * rate, 0 * rate, 192) # 变数 cp 描绘表的宽度代入 if actor.maxcp != 0 cp = (width + plus_width) * actor.cp * rate_width / 100 / actor.maxcp else cp = (width + plus_width) * rate_width / 100 end # 表的绘画 gauge_rect(x + plus_x + width * rate_x / 100, y + plus_y, width, plus_width + width * rate_width / 100, height, cp, align1, align2, align3, color1, color2, color3, color4, color5, color6, grade1, grade2) # 叫出来原创的 SP 绘画处理 draw_actor_cp_original(actor, x, y, width) end #-------------------------------------------------------------------------- # ●表的绘画 #-------------------------------------------------------------------------- def gauge_rect(x, y, rect_width, width, height, gauge, align1, align2, align3, color1, color2, color3, color4, color5, color6, grade1, grade2) case align1 when 1 x += (rect_width - width) / 2 when 2 x += rect_width - width end case align2 when 1 y -= height / 2 when 2 y -= height end # 绘画范围 self.contents.fill_rect(x, y, width, height, color1) self.contents.fill_rect(x + 1, y + 1, width - 2, height - 2, color2) if align3 == 0 if grade1 == 2 grade1 = 3 end if grade2 == 2 grade2 = 3 end end if (align3 == 1 and grade1 == 0) or grade1 > 0 color = color3 color3 = color4 color4 = color end if (align3 == 1 and grade2 == 0) or grade2 > 0 color = color5 color5 = color6 color6 = color end # 空表的绘画 self.contents.gradation_rect(x + 2, y + 2, width - 4, height - 4, color3, color4, grade1) if align3 == 1 x += width - gauge end # 实际表的绘画 self.contents.gradation_rect(x + 2, y + 2, gauge - 4, height - 4, color5, color6, grade2) end end class Bitmap #-------------------------------------------------------------------------- # ●浓淡法表示长方形 # color1 : 开始彩色 # color2 : 终局彩色 # align : 0:横浓淡法 # 1:纵向地浓淡法 # 2:斜浓淡法(因激烈重注意) #-------------------------------------------------------------------------- def gradation_rect(x, y, width, height, color1, color2, align = 0) if align == 0 for i in x...x + width red = color1.red + (color2.red - color1.red) * (i - x) / (width - 1) green = color1.green + (color2.green - color1.green) * (i - x) / (width - 1) blue = color1.blue + (color2.blue - color1.blue) * (i - x) / (width - 1) alpha = color1.alpha + (color2.alpha - color1.alpha) * (i - x) / (width - 1) color = Color.new(red, green, blue, alpha) fill_rect(i, y, 1, height, color) end elsif align == 1 for i in y...y + height red = color1.red + (color2.red - color1.red) * (i - y) / (height - 1) green = color1.green + (color2.green - color1.green) * (i - y) / (height - 1) blue = color1.blue + (color2.blue - color1.blue) * (i - y) / (height - 1) alpha = color1.alpha + (color2.alpha - color1.alpha) * (i - y) / (height - 1) color = Color.new(red, green, blue, alpha) fill_rect(x, i, width, 1, color) end elsif align == 2 for i in x...x + width for j in y...y + height red = color1.red + (color2.red - color1.red) * ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 green = color1.green + (color2.green - color1.green) * ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 blue = color1.blue + (color2.blue - color1.blue) * ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 alpha = color1.alpha + (color2.alpha - color1.alpha) * ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 color = Color.new(red, green, blue, alpha) set_pixel(i, j, color) end end elsif align == 3 for i in x...x + width for j in y...y + height red = color1.red + (color2.red - color1.red) * ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 green = color1.green + (color2.green - color1.green) * ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 blue = color1.blue + (color2.blue - color1.blue) * ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 alpha = color1.alpha + (color2.alpha - color1.alpha) * ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 color = Color.new(red, green, blue, alpha) set_pixel(i, j, color) end end end end end
class Window_Base < Window
#--------------------------------------------------------------------------
# ● CP 表的绘画
#--------------------------------------------------------------------------
# draw_actor_cp_original 和名字变更原创的 CP 绘画
alias :draw_actor_cp_original :draw_actor_cp
def draw_actor_cp(actor, x, y, width = 144)
# 变数 rate 在现在的 SP/MSP 代入
if actor.maxcp != 0
rate = actor.cp.to_f / actor.maxcp
else
rate = 1
end
# plus_x: X 座标的位置补正 rate_x:X 座标的位置补正 (%) plus_y:Y 座标的位置补正
# plus_width: 宽度的补正 rate_width:宽度的补正 (%) height:纵宽度
# align1:描画タイプ10: 左装 1:中央聚集 2:右边装
# align2:描画タイプ20: 上装 1:中央聚集 2:下包装
# align3:ゲージタイプ0: 左装 1:右边装
plus_x = 0
rate_x = 0
plus_y = 25
plus_width = 0
rate_width = 100
height = 10
align1 = 1
align2 = 2
align3 = 0
# 浓淡法设定 grade1:空表 grade2:实际表
#(0:在横浓淡法 1:纵向地浓淡法 2:斜浓淡法 (激烈重 ) )
grade1 = 1
grade2 = 0
# 设定颜色。color1: 外范围,color2:整个范围
# color3: 空表黑的彩色,color4:空表右方彩色
# color5: 实际表黑的彩色,color6:实际表右方彩色
color1 = Color.new(0, 0, 0, 192)
color2 = Color.new(255, 255, 192, 192)
color3 = Color.new(0, 0, 0, 192)
color4 = Color.new(0, 64, 0, 192)
color5 = Color.new(14 * rate, 80 - 24 * rate, 80 * rate, 192)
color6 = Color.new(0 * rate, 240 - 72 * rate, 0 * rate, 192)
# 变数 cp 描绘表的宽度代入
if actor.maxcp != 0
cp = (width + plus_width) * actor.cp * rate_width / 100 / actor.maxcp
else
cp = (width + plus_width) * rate_width / 100
end
# 表的绘画
gauge_rect(x + plus_x + width * rate_x / 100, y + plus_y,
width, plus_width + width * rate_width / 100,
height, cp, align1, align2, align3,
color1, color2, color3, color4, color5, color6, grade1, grade2)
# 叫出来原创的 SP 绘画处理
draw_actor_cp_original(actor, x, y, width)
end
#--------------------------------------------------------------------------
# ●表的绘画
#--------------------------------------------------------------------------
def gauge_rect(x, y, rect_width, width, height, gauge, align1, align2, align3,
color1, color2, color3, color4, color5, color6, grade1, grade2)
case align1
when 1
x += (rect_width - width) / 2
when 2
x += rect_width - width
end
case align2
when 1
y -= height / 2
when 2
y -= height
end
# 绘画范围
self.contents.fill_rect(x, y, width, height, color1)
self.contents.fill_rect(x + 1, y + 1, width - 2, height - 2, color2)
if align3 == 0
if grade1 == 2
grade1 = 3
end
if grade2 == 2
grade2 = 3
end
end
if (align3 == 1 and grade1 == 0) or grade1 > 0
color = color3
color3 = color4
color4 = color
end
if (align3 == 1 and grade2 == 0) or grade2 > 0
color = color5
color5 = color6
color6 = color
end
# 空表的绘画
self.contents.gradation_rect(x + 2, y + 2, width - 4, height - 4,
color3, color4, grade1)
if align3 == 1
x += width - gauge
end
# 实际表的绘画
self.contents.gradation_rect(x + 2, y + 2, gauge - 4, height - 4,
color5, color6, grade2)
end
end
class Bitmap
#--------------------------------------------------------------------------
# ●浓淡法表示长方形
# color1 : 开始彩色
# color2 : 终局彩色
# align : 0:横浓淡法
# 1:纵向地浓淡法
# 2:斜浓淡法(因激烈重注意)
#--------------------------------------------------------------------------
def gradation_rect(x, y, width, height, color1, color2, align = 0)
if align == 0
for i in x...x + width
red = color1.red + (color2.red - color1.red) * (i - x) / (width - 1)
green = color1.green +
(color2.green - color1.green) * (i - x) / (width - 1)
blue = color1.blue +
(color2.blue - color1.blue) * (i - x) / (width - 1)
alpha = color1.alpha +
(color2.alpha - color1.alpha) * (i - x) / (width - 1)
color = Color.new(red, green, blue, alpha)
fill_rect(i, y, 1, height, color)
end
elsif align == 1
for i in y...y + height
red = color1.red +
(color2.red - color1.red) * (i - y) / (height - 1)
green = color1.green +
(color2.green - color1.green) * (i - y) / (height - 1)
blue = color1.blue +
(color2.blue - color1.blue) * (i - y) / (height - 1)
alpha = color1.alpha +
(color2.alpha - color1.alpha) * (i - y) / (height - 1)
color = Color.new(red, green, blue, alpha)
fill_rect(x, i, width, 1, color)
end
elsif align == 2
for i in x...x + width
for j in y...y + height
red = color1.red + (color2.red - color1.red) *
((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
green = color1.green + (color2.green - color1.green) *
((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
blue = color1.blue + (color2.blue - color1.blue) *
((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
alpha = color1.alpha + (color2.alpha - color1.alpha) *
((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
color = Color.new(red, green, blue, alpha)
set_pixel(i, j, color)
end
end
elsif align == 3
for i in x...x + width
for j in y...y + height
red = color1.red + (color2.red - color1.red) *
((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
green = color1.green + (color2.green - color1.green) *
((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
blue = color1.blue + (color2.blue - color1.blue) *
((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
alpha = color1.alpha + (color2.alpha - color1.alpha) *
((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
color = Color.new(red, green, blue, alpha)
set_pixel(i, j, color)
end
end
end
end
end
|
|