赞 | 10 |
VIP | 0 |
好人卡 | 0 |
积分 | 7 |
经验 | 4125 |
最后登录 | 2023-2-19 |
在线时间 | 159 小时 |
Lv2.观梦者
- 梦石
- 0
- 星屑
- 655
- 在线时间
- 159 小时
- 注册时间
- 2012-3-24
- 帖子
- 104
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
刚学脚本,打算把如题两个脚本融合起来看看,到底没弄懂,插入则总是在277行出问题,有谁能够给讲讲吗?谢谢各位~{:2_270:}
class Game_Interpreter #-------------------------------------------------------------------------- # ● 增减金钱 #-------------------------------------------------------------------------- def command_125 value = operate_value(@params[0], @params[1], @params[2]) $game_party.gain_gold(value) if $window_tips_gold == true show_tips_window(0, value) end return true end #-------------------------------------------------------------------------- # ● 增减物品 #-------------------------------------------------------------------------- def command_126 value = operate_value(@params[1], @params[2], @params[3]) $game_party.gain_item($data_items[@params[0]], value) if $window_tips_item == true show_tips_window(1, value) end $game_map.need_refresh = true 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]) if $window_tips_weapon == true show_tips_window(2, value) end 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]) if $window_tips_armor == true show_tips_window(3, value) end return true end #-------------------------------------------------------------------------- # ● 显示增减提示窗口 #-------------------------------------------------------------------------- def show_tips_window(type, value) case type when 0 item_type = Vocab::currency_unit if value >= 0 Audio.se_play("Audio/SE/" + $SE_Gold_Gain, 100, 100) else Audio.se_play("Audio/SE/" + "Item1", 100, 100) end when 1 item_type = Vocab::item processed_items = $data_items[@params[0]] if value >= 0 Audio.se_play("Audio/SE/" + $SE_Item_Gain, 100, 100) else Audio.se_play("Audio/SE/" + $SE_Item_Loss, 100, 100) end when 2 item_type = Vocab::weapon processed_items = $data_weapons[@params[0]] if value >= 0 Audio.se_play("Audio/SE/" + $SE_Weapon_Gain, 100, 100) else Audio.se_play("Audio/SE/" + $SE_Weapon_Loss, 100, 100) end when 3 item_type = Vocab::armor processed_items = $data_armors[@params[0]] if value >= 0 Audio.se_play("Audio/SE/" + $SE_Armor_Gain, 100, 100) else Audio.se_play("Audio/SE/" + $SE_Armor_Loss, 100, 100) end end if value >= 0 tips_processed_text = "获得" else tips_processed_text = "失去" end if type != 0 text_value = "×" + value.abs.to_s bitmap = Bitmap.new(100, 100) itemwidth = bitmap.text_size(processed_items.name).width + 95 valuewidth = bitmap.text_size(text_value).width itempop_window = Window_Tips.new((544 - itemwidth - valuewidth) / 2, 128, itemwidth + valuewidth, 88) itempop_window.contents = Bitmap.new(itempop_window.width - 32, itempop_window.height - 32) itempop_window.contents.draw_text(0, 0, 160, 32, tips_processed_text + item_type+":") itempop_window.adv_draw_item_name(processed_items, 28, 32) itempop_window.contents.draw_text(0, 30, itemwidth, 32, "×" + value.abs.to_s, 2) else text_value = value.abs.to_s + " " + Vocab::currency_unit bitmap = Bitmap.new(100, 100) textwidth = bitmap.text_size(text_value).width + 95 itempop_window = Window_Tips.new(170, 128, textwidth, 88) itempop_window.contents = Bitmap.new(itempop_window.width - 32, itempop_window.height - 32) itempop_window.contents.draw_text(0, 0, 160, 32, tips_processed_text + item_type+":") itempop_window.contents.draw_text(32, 32, 240, 32, value.abs.to_s + " " + Vocab::currency_unit) end for i in 0..60 Graphics.update end for i in 0..10 itempop_window.opacity -= 30 itempop_window.contents_opacity -= 30 Graphics.update end itempop_window.dispose for i in 0..3 Graphics.update end end end
class Game_Interpreter
#--------------------------------------------------------------------------
# ● 增减金钱
#--------------------------------------------------------------------------
def command_125
value = operate_value(@params[0], @params[1], @params[2])
$game_party.gain_gold(value)
if $window_tips_gold == true
show_tips_window(0, value)
end
return true
end
#--------------------------------------------------------------------------
# ● 增减物品
#--------------------------------------------------------------------------
def command_126
value = operate_value(@params[1], @params[2], @params[3])
$game_party.gain_item($data_items[@params[0]], value)
if $window_tips_item == true
show_tips_window(1, value)
end
$game_map.need_refresh = true
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])
if $window_tips_weapon == true
show_tips_window(2, value)
end
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])
if $window_tips_armor == true
show_tips_window(3, value)
end
return true
end
#--------------------------------------------------------------------------
# ● 显示增减提示窗口
#--------------------------------------------------------------------------
def show_tips_window(type, value)
case type
when 0
item_type = Vocab::currency_unit
if value >= 0
Audio.se_play("Audio/SE/" + $SE_Gold_Gain, 100, 100)
else
Audio.se_play("Audio/SE/" + "Item1", 100, 100)
end
when 1
item_type = Vocab::item
processed_items = $data_items[@params[0]]
if value >= 0
Audio.se_play("Audio/SE/" + $SE_Item_Gain, 100, 100)
else
Audio.se_play("Audio/SE/" + $SE_Item_Loss, 100, 100)
end
when 2
item_type = Vocab::weapon
processed_items = $data_weapons[@params[0]]
if value >= 0
Audio.se_play("Audio/SE/" + $SE_Weapon_Gain, 100, 100)
else
Audio.se_play("Audio/SE/" + $SE_Weapon_Loss, 100, 100)
end
when 3
item_type = Vocab::armor
processed_items = $data_armors[@params[0]]
if value >= 0
Audio.se_play("Audio/SE/" + $SE_Armor_Gain, 100, 100)
else
Audio.se_play("Audio/SE/" + $SE_Armor_Loss, 100, 100)
end
end
if value >= 0
tips_processed_text = "获得"
else
tips_processed_text = "失去"
end
if type != 0
text_value = "×" + value.abs.to_s
bitmap = Bitmap.new(100, 100)
itemwidth = bitmap.text_size(processed_items.name).width + 95
valuewidth = bitmap.text_size(text_value).width
itempop_window = Window_Tips.new((544 - itemwidth - valuewidth) / 2, 128, itemwidth + valuewidth, 88)
itempop_window.contents = Bitmap.new(itempop_window.width - 32, itempop_window.height - 32)
itempop_window.contents.draw_text(0, 0, 160, 32, tips_processed_text + item_type+":")
itempop_window.adv_draw_item_name(processed_items, 28, 32)
itempop_window.contents.draw_text(0, 30, itemwidth, 32, "×" + value.abs.to_s, 2)
else
text_value = value.abs.to_s + " " + Vocab::currency_unit
bitmap = Bitmap.new(100, 100)
textwidth = bitmap.text_size(text_value).width + 95
itempop_window = Window_Tips.new(170, 128, textwidth, 88)
itempop_window.contents = Bitmap.new(itempop_window.width - 32, itempop_window.height - 32)
itempop_window.contents.draw_text(0, 0, 160, 32, tips_processed_text + item_type+":")
itempop_window.contents.draw_text(32, 32, 240, 32, value.abs.to_s + " " + Vocab::currency_unit)
end
for i in 0..60
Graphics.update
end
for i in 0..10
itempop_window.opacity -= 30
itempop_window.contents_opacity -= 30
Graphics.update
end
itempop_window.dispose
for i in 0..3
Graphics.update
end
end
end
|
|