Project1
标题:
我又有问题了.... >。
[打印本页]
作者:
幻影忧郁
时间:
2008-5-22 21:54
标题:
我又有问题了.... >。
得失物品提示脚本,物品的名字太长了,所以就:
应该怎么改啊? [LINE]1,#dddddd[/LINE]
版务信息:本贴由楼主自主结贴~
作者:
八云紫
时间:
2008-5-22 22:14
试试看这个吧,我用的还没出现问题。
class Game_Interpreter
UnShowSwitch = 100 #禁止显示提示开关
GainSe = "Audio/SE/Recovery.ogg"
LoseSe = "Audio/SE/Raise2.ogg"
#--------------------------------------------------------------------------
# ● 增减金钱
#--------------------------------------------------------------------------
def command_125
value = operate_value(@params[0], @params[1], @params[2])
$game_party.gain_gold(value)
show_window(0,value) unless $game_switches[UnShowSwitch]
return true
end
#--------------------------------------------------------------------------
# ● 增减物品
#--------------------------------------------------------------------------
def command_126
value = operate_value(@params[1], @params[2], @params[3])
$game_party.gain_item($data_items[@params[0]], value)
$game_map.need_refresh = true
show_window(1,value,@params[0]) unless $game_switches[UnShowSwitch]
return true
end
#--------------------------------------------------------------------------
# ● 增减武器
#--------------------------------------------------------------------------
def command_127
value = operate_value(@params[1], @params[2], @params[3])
$game_party.gain_item($data_weapons[@params[0]], value, @params[4])
show_window(2,value,@params[0]) unless $game_switches[UnShowSwitch]
return true
end
#--------------------------------------------------------------------------
# ● 增减防具
#--------------------------------------------------------------------------
def command_128
value = operate_value(@params[1], @params[2], @params[3])
$game_party.gain_item($data_armors[@params[0]], value, @params[4])
show_window(3,value,@params[0]) unless $game_switches[UnShowSwitch]
return true
end
def show_window(type,value,id = 0)
if type == 0
item = "gold"
else #物品,武器,防具
if type == 1
item = $data_items[id]
elsif type == 2
item = $data_weapons[id]
else
item = $data_armors[id]
end
end
width = 150 + (type == 0 ? value.to_s.size * 7 - 16 : item.name.size * 7)
w = Window_Base.new((640-width)/2 - 30 , 208, width, 64)
w.windowskin = Cache.system("Window")
w.contents = Bitmap.new(w.width - 32, w.height - 32)
w.contents.font.color = w.text_color(4)
#w.contents.fill_rect(w.contents.rect,w.text_color(1))
w.opacity = w.contents_opacity = 0
for i in 0..10
w.opacity += 26
w.contents_opacity += 26
w.x += 3
Graphics.update
end
if value >= 0
w.contents.draw_text(0,4,48,24,"得到")
Audio.se_play(GainSe)
else
w.contents.draw_text(0,4,48,24,"失去")
Audio.se_play(LoseSe)
end
if type != 0
w.draw_item_name_c(item,50, 4 ,type + 23)
w.opacity = w.back_opacity = 255
w.contents.font.color = w.text_color(14)
w.contents.draw_text(width - 72 , 4, 40, 24, "× " + value.abs.to_s ,2)
else
bitmap = Cache.system("gold")
w.contents.blt(50, 4 ,bitmap , bitmap.rect)
w.contents.font.color = w.text_color(2)
w.contents.draw_text(width - 112 , 4, 72, 24, " " + value.abs.to_s ,2)
end
for i in 0..30
Graphics.update
end
for i in 0..20
w.opacity -= 13
w.contents_opacity -= 13
w.x += 2
Graphics.update
end
w.dispose
end
end
class Window_Base
def draw_item_name_c(item, x, y , color)
if item != nil
draw_icon(item.icon_index, x, y, true)
self.contents.font.color = self.text_color(color)
self.contents.draw_text(x + 24, y, 172, WLH, item.name)
end
end
end
复制代码
[LINE]1,#dddddd[/LINE]
系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
作者:
幻影忧郁
时间:
2008-5-22 22:20
谢谢!!
本当にありがとうございました!!
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1