Project1
标题:
得失物品脚本的暂停问题
[打印本页]
作者:
zh99998
时间:
2008-8-28 01:09
标题:
得失物品脚本的暂停问题
柳柳和雪流星的得失物品脚本在得失物品的时候游戏暂停,这样当画面内有动态物件(比如喷泉)的时候效果会很差,能不能改一下使弹出window的时候游戏能继续运行
66的
#==============================================================================
# ■ Game_Interpreter
#------------------------------------------------------------------------------
# 执行事件命令的解释器。本类在 Game_System 类
# 与 Game_Event 类的内部使用。
#==============================================================================
class Game_Interpreter
#--------------------------------------------------------------------------
# ● 得失物品自动提示的刷新时间控制
#--------------------------------------------------------------------------
def call_6RgetItem(para1, para2 = nil, para3 = nil)
temp_window = Window_Gain_Item.new(para1, para2, para3)
Sound.play_shop
for i in 0..120
Graphics.update
Input.update
if Input.trigger?(Input::C) or Input.trigger?(Input::B)
Sound.play_cancel
break
end
end
for i in 0..15
temp_window.opacity -= 20
temp_window.contents_opacity -= 16
temp_window.update
Graphics.update
end
temp_window.dispose
temp_window = nil
end
#--------------------------------------------------------------------------
# ● 增减金钱
#--------------------------------------------------------------------------
def command_125
value = operate_value(@params[0], @params[1], @params[2])
$game_party.gain_gold(value)
call_6RgetItem("gold", value)
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
call_6RgetItem("item", $data_items[@params[0]], value)
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])
call_6RgetItem("item", $data_weapons[@params[0]], value)
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])
call_6RgetItem("item", $data_armors[@params[0]], value)
return true
end
end
#==============================================================================
# ■ Window_Gain_Item
#------------------------------------------------------------------------------
# 显示获得物品的窗口。
#==============================================================================
class Window_Gain_Item < Window_Base
#--------------------------------------------------------------------------
# ● 初始化窗口
#--------------------------------------------------------------------------
def initialize(para1, para2 = nil, para3 = nil)
super(0, 0, 160, WLH + 32)
self.z = 10000
case para1
when "item"
str = "获得"
if para3 < 0 then
str = "失去"
para3 = - para3
end
winwidth = contents.text_size(" 你获得了: ? " + para3.to_s).width + 24 + contents.text_size(para2.name).width
self.width = winwidth + 64
self.height = 64
self.x = (Graphics.width - self.width) / 2
self.y = (Graphics.height - self.height) / 2
create_contents
self.contents.draw_text(0, 0, self.width, 32, " 你" + str + "了: ")
tx = contents.text_size(" 你" + str + "了:").width
draw_item_name(para2, tx , 0, true)
self.contents.draw_text(tx + 24, 0, self.width, 32, para2.name)
tx = contents.text_size(" 你" + str + "了: ").width + 24 + contents.text_size(para2.name).width
self.contents.draw_text(tx, 0, self.width, 32, "×" + para3.to_s)
when "gold"
str = "获得"
if para2 < 0 then
str = "失去"
para2 = - para2
end
winwidth = contents.text_size(" 你获得了: " + Vocab.gold.to_s).width + contents.text_size(para2).width
self.width = winwidth + 64
self.height = 64
self.x = (Graphics.width - self.width) / 2
self.y = (Graphics.height - self.height) / 2
create_contents
self.contents.draw_text(0, 0, self.width, 32, " 你" + str + "了: #{para2} " + Vocab.gold.to_s)
end
end
#--------------------------------------------------------------------------
# ● 物品名的描画
# item : 物品(特技、武器、防具可)
# x : 描画目标 X 坐标
# y : 描画目标 Y 坐标
# enabled : 有效标记录。是false 的时候半透明绘画
#--------------------------------------------------------------------------
def draw_item_name(item, x, y, enabled = true)
if item != nil
draw_icon(item.icon_index, x, y, enabled)
self.contents.font.color = normal_color
self.contents.font.color.alpha = enabled ? 255 : 128
end
end
end
复制代码
雪流星的
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
# 注意!!!在对话后得到物品,请在对话后先用事件等待3帧,否则对话框来不及消失。
# 开关定义:
$noshowgold = 41 # 不显示金钱得失
$noshowitem = 42 # 不显示物品得失
$noshowweapon = 43 # 不显示武器得失
$noshowarmor = 44 # 不显示防具得失
# 以上开关,当打开的时候,获得物品将不会提示,比如默认打开41号开关,获得金钱不再提示
# 不想提示等级升降时,就在事件命令直接选择是否显示就行了。
#——声效,可以自己改
folder = "Audio/SE/"
$gain_gold_se = folder +"Shop" # 获得金钱声效
$loss_gold_se = folder +"Blow2" # 失去金钱声效
$gain_item_se = folder +"Item1" # 获得物品声效
$loss_item_se = folder +"Blow2" # 失去物品声效
$gain_weapon_se = folder +"Item1" # 获得武器声效
$loss_weapon_se = folder +"Blow2" # 失去武器声效
$gain_armor_se = folder +"Item1" # 获得防具声效
$loss_armor_se = folder +"Blow2" # 失去防具声效
$gain_lv_se = folder +"Item1" # 提升等级声效
$loss_lv_se = folder +"Blow2" # 降低等级声效
# ————————————————————————————————————
class Game_Interpreter
#--------------------------------------------------------------------------
# ● 增减金钱
#--------------------------------------------------------------------------
def command_125
value = operate_value(@params[0], @params[1], @params[2])
$game_party.gain_gold(value)
if $game_switches[$noshowgold]==false
show_gain_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 $game_switches[$noshowitem]==false
show_gain_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 $game_switches[$noshowweapon]==false
show_gain_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 $game_switches[$noshowarmor]==false
show_gain_window(3, value)
end
return true
end
#--------------------------------------------------------------------------
# ● 等级増减
#--------------------------------------------------------------------------
def command_316
value = operate_value(@params[1], @params[2], @params[3])
iterate_actor_id(@params[0]) do |actor|
actor.change_level(actor.level + value, false)
if @params[4]
show_gain_level_window(actor,value)
end
end
return true
end
def show_gain_window(type, value)
snstar2006_66rpg_item = $data_armors[@params[0]]
snstar2006_66rpg = Window_Base.new((640-300)/2,128,200,100)
snstar2006_66rpg.contents = Bitmap.new(snstar2006_66rpg.width - 32, snstar2006_66rpg.height - 32)
if value >= 0
gain_text = "获得"
else
gain_text = "失去"
end
case type
when 0
gain_type = "金钱"
if value >=0
Audio.se_play($gain_gold_se,80,100)
else
Audio.se_play("Audio/SE/"+"Item1",80,100)
end
when 1
gain_type = "物品"
string = $data_items[@params[0]]
if value >=0
Audio.se_play($gain_item_se,80,100)
else
Audio.se_play($loss_item_se,80,100)
end
when 2
gain_type = "武器"
string = $data_weapons[@params[0]]
if value >=0
Audio.se_play($gain_weapon_se,80,100)
else
Audio.se_play($loss_weapon_se,80,100)
end
when 3
gain_type = "防具"
string = $data_armors[@params[0]]
if value >=0
Audio.se_play($gain_armor_se,80,100)
else
Audio.se_play($loss_armor_se,80,100)
end
end
snstar2006_66rpg.contents.draw_text(0,0,160,32,gain_text+gain_type+":")
unless type == 0
snstar2006_66rpg.draw_item_name(string, 28, 32, true)
snstar2006_66rpg.contents.draw_text(0, 32, 150, 32, "×"+value.abs.to_s, 2)
else
snstar2006_66rpg.contents.draw_text(32,32,240,32,value.abs.to_s + " "+ Vocab::gold)
end
snstar2006_66rpg.opacity = 160
for i in 0..30
Graphics.update
end
for i in 0..10
snstar2006_66rpg.opacity -= 30
snstar2006_66rpg.contents_opacity -= 30
Graphics.update
end
snstar2006_66rpg.dispose
end
def show_gain_level_window(actor,value)
lvstring = Vocab::level
snstar2006_66rpg = Window_Base.new((640-300)/2,128,200,100)
snstar2006_66rpg.contents = Bitmap.new(snstar2006_66rpg.width - 32, snstar2006_66rpg.height - 32)
if value >= 0
gain_text = "提升"
Audio.se_play($gain_lv_se,80,100)
else
gain_text = "降低"
Audio.se_play($loss_lv_se,80,100)
end
snstar2006_66rpg.contents.draw_text(0, 0, 108, 32, actor.name)
string = lvstring+gain_text+value.abs.to_s+"级"
snstar2006_66rpg.contents.draw_text(32,32,160,32,string)
snstar2006_66rpg.opacity = 160
for i in 0..30
Graphics.update
end
for i in 0..10
snstar2006_66rpg.opacity -= 30
snstar2006_66rpg.contents_opacity -= 30
Graphics.update
end
snstar2006_66rpg.dispose
end
end
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
复制代码
[LINE]1,#dddddd[/LINE]
版务信息:本贴由楼主自主结贴~
作者:
雪流星
时间:
2008-8-30 20:42
我再看看
或许可以用默认窗口中带有的功能解决...
顺便美化一下
作者:
zh99998
时间:
2008-8-30 20:45
thx,还有这个脚本里附带的等级升降提示似乎没有效果,需要开关控制?
作者:
雪流星
时间:
2008-8-30 20:48
这个升级提示是事件指令里的「增减等级」用的
开关就是该指令的选项「显示升级讯息」
作者:
zh99998
时间:
2008-8-30 20:51
= =|||
战斗升级无效的话……似乎用处就不大了……
作者:
沉影不器
时间:
2008-8-31 06:43
提示:
作者被禁止或删除 内容自动屏蔽
作者:
zh99998
时间:
2008-8-31 20:41
不懂不懂……
作者:
龙轩
时间:
2008-8-31 20:44
提示:
作者被禁止或删除 内容自动屏蔽
作者:
zh99998
时间:
2008-8-31 20:49
LS又来提问区灌水…………
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1