Project1
标题:
有没有物品得失提示一起显示的脚本
[打印本页]
作者:
丁晓
时间:
2013-4-29 14:58
标题:
有没有物品得失提示一起显示的脚本
有没有物品得失提示一起显示的脚本
不是一个一个提示,而是一起。比如
获得;
红药水
蓝药水
铁剑
失去;
苹果
好像记得以前有个。。
作者:
残雪落云
时间:
2013-4-30 17:44
这里
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
# 注意!!!在对话后得到物品,请在对话后先用事件等待3帧,否则对话框来不及消失。
# 开关定义:
$不显示金钱窗口 = 41
$不显示物品窗口 = 42
$不显示武器窗口 = 43
$不显示防具窗口 = 44
# ■■■■■ 升级提示 & 升级学会技能提示(使用46号开关,可改) ■■■■■
$不显示升级窗口 = 46
# ■■■■■■■■■■■■■■■■ END ■■■■■■■■■■■■■■■■■
# 以上开关,当打开的时候,获得物品将不会提示,比如默认打开41号开关,获得金钱不再提示
# ————————————————————————————————————
class Interpreter
#--------------------------------------------------------------------------
# ● 增减金钱
#--------------------------------------------------------------------------
def command_125
value = operate_value(@parameters[0], @parameters[1], @parameters[2])
$game_party.gain_gold(value)
if $game_switches[$不显示金钱窗口]==false
carol3_66RPG = Window_Base.new((654-160)/2,170,180,100)
carol3_66RPG.contents = Bitmap.new(carol3_66RPG.width - 32, carol3_66RPG.height - 32)
if value >= 0
carol3_66RPG.contents.draw_text(0,0,240,32,"获得金钱:")
#——声效,可以自己改
Audio.se_play("Audio/SE/"+"006-System06",80,100)
else
carol3_66RPG.contents.draw_text(0,0,240,32,"失去金钱:")
#——声效,可以自己改
Audio.se_play("Audio/SE/"+"005-System05",80,100)
end
carol3_66RPG.contents.draw_text(0,32,240,32,value.abs.to_s)
carol3_66RPG.contents.draw_text(0,32,140,32, $data_system.words.gold,2)
carol3_66RPG.opacity = 160
for i in 0..30
Graphics.update
end
for i in 0..10
carol3_66RPG.opacity -= 30
carol3_66RPG.contents_opacity -= 30
Graphics.update
end
carol3_66RPG.dispose
end
return true
end
#--------------------------------------------------------------------------
# ● 增减物品
#--------------------------------------------------------------------------
def command_126
value = operate_value(@parameters[1], @parameters[2], @parameters[3])
$game_party.gain_item(@parameters[0], value)
if $game_switches[$不显示物品窗口]==false
carol3_66RPG_item = $data_items[@parameters[0]]
carol3_66RPG = Window_Base.new((654-300)/2,170,300,100)
carol3_66RPG.contents = Bitmap.new(carol3_66RPG.width - 32, carol3_66RPG.height - 32)
if value >= 0
carol3_66RPG.contents.draw_text(0,0,240,32,"获得物品:")
#——声效,可以自己改
Audio.se_play("Audio/SE/"+"006-System06",80,100)
else
carol3_66RPG.contents.draw_text(0,0,240,32,"失去物品:")
#——声效,可以自己改
Audio.se_play("Audio/SE/"+"005-System05",80,100)
end
carol3_66RPG_bitmap = RPG::Cache.icon(carol3_66RPG_item.icon_name)
carol3_66RPG.contents.blt(0, 32, carol3_66RPG_bitmap, Rect.new(0, 0, 24, 24), 255)
carol3_66RPG.contents.draw_text(0 + 28, 32, 212, 32, carol3_66RPG_item.name, 0)
carol3_66RPG.contents.draw_text(0, 32, 268, 32, "×"+value.abs.to_s, 2)
carol3_66RPG.opacity = 160
for i in 0..30
Graphics.update
end
for i in 0..10
carol3_66RPG.opacity -= 30
carol3_66RPG.contents_opacity -= 30
Graphics.update
end
carol3_66RPG.dispose
end
return true
end
#--------------------------------------------------------------------------
# ● 增减武器
#--------------------------------------------------------------------------
def command_127
value = operate_value(@parameters[1], @parameters[2], @parameters[3])
$game_party.gain_weapon(@parameters[0], value)
if $game_switches[$不显示武器窗口]==false
carol3_66RPG_item = $data_weapons[@parameters[0]]
carol3_66RPG = Window_Base.new((654-300)/2,170,300,100)
carol3_66RPG.contents = Bitmap.new(carol3_66RPG.width - 32, carol3_66RPG.height - 32)
if value >= 0
carol3_66RPG.contents.draw_text(0,0,240,32,"获得武器:")
#——声效,可以自己改
Audio.se_play("Audio/SE/"+"006-System06",80,100)
else
carol3_66RPG.contents.draw_text(0,0,240,32,"失去武器:")
#——声效,可以自己改
Audio.se_play("Audio/SE/"+"005-System05",80,100)
end
carol3_66RPG_bitmap = RPG::Cache.icon(carol3_66RPG_item.icon_name)
carol3_66RPG.contents.blt(0, 32, carol3_66RPG_bitmap, Rect.new(0, 0, 24, 24), 255)
carol3_66RPG.contents.draw_text(0 + 28, 32, 212, 32, carol3_66RPG_item.name, 0)
carol3_66RPG.contents.draw_text(0, 32, 268, 32, "×"+value.abs.to_s, 2)
carol3_66RPG.opacity = 160
for i in 0..30
Graphics.update
end
for i in 0..10
carol3_66RPG.opacity -= 30
carol3_66RPG.contents_opacity -= 30
Graphics.update
end
carol3_66RPG.dispose
end
return true
end
#--------------------------------------------------------------------------
# ● 增减防具
#--------------------------------------------------------------------------
def command_128
value = operate_value(@parameters[1], @parameters[2], @parameters[3])
$game_party.gain_armor(@parameters[0], value)
if $game_switches[$不显示防具窗口]==false
carol3_66RPG_item = $data_armors[@parameters[0]]
carol3_66RPG = Window_Base.new((654-300)/2,170,300,100)
carol3_66RPG.contents = Bitmap.new(carol3_66RPG.width - 32, carol3_66RPG.height - 32)
if value >= 0
carol3_66RPG.contents.draw_text(0,0,240,32,"获得防具:")
#——声效,可以自己改
Audio.se_play("Audio/SE/"+"006-System06",80,100)
else
carol3_66RPG.contents.draw_text(0,0,240,32,"失去防具:")
#——声效,可以自己改
Audio.se_play("Audio/SE/"+"005-System05",80,100)
end
carol3_66RPG_bitmap = RPG::Cache.icon(carol3_66RPG_item.icon_name)
carol3_66RPG.contents.blt(0, 32, carol3_66RPG_bitmap, Rect.new(0, 0, 24, 24), 255)
carol3_66RPG.contents.draw_text(0 + 28, 32, 212, 32, carol3_66RPG_item.name, 0)
carol3_66RPG.contents.draw_text(0, 32, 268, 32, "×"+value.abs.to_s, 2)
carol3_66RPG.opacity = 160
for i in 0..30
Graphics.update
end
for i in 0..10
carol3_66RPG.opacity -= 30
carol3_66RPG.contents_opacity -= 30
Graphics.update
end
carol3_66RPG.dispose
end
return true
end
# ■■■■■ 升级提示 & 升级习得技能提示(使用46号变量,可改) ■■■■■
#--------------------------------------------------------------------------
# ● 增减 EXP
#--------------------------------------------------------------------------
def command_315
# 获取操作值
value = operate_value(@parameters[1], @parameters[2], @parameters[3])
# 如果 不显示升级窗口开关 关闭,则初始化纪录升级角色和纪录角色学会特级的变量
if $game_switches[$不显示升级窗口] == false
level_uper = []
learned_skill = ""
end
# 处理重复
iterate_actor(@parameters[0]) do |actor|
# 如果 不显示升级窗口开关 关闭
if $game_switches[$不显示升级窗口] == false
last_level = actor.level
# 更改角色 EXP
actor.exp += value
# 如果经验增加后角色升级
if actor.level > last_level
# 在纪录升级角色的变量里纪录升级角色
level_uper.push(actor.name.split(/·/)[0])
# 如果因升级学会特技
for level in last_level+1..actor.level
for j in $data_classes[actor.class_id].learnings
if j.level == level
# 把角色的升级学会技能信息记录入变量
learned_skill += actor.name.split(/·/)[0] + "学会了新特技“" + $data_skills[j.skill_id].name + "”。\n"
end
end
end
end
# 此外(如果 不显示升级窗口开关 开启)
else
actor.exp += value
end
end
# 如果 不显示升级窗口开关 关闭,且有角色升级
if $game_switches[$不显示升级窗口] == false and level_uper.size > 0
# 播放升级提示 SE,可以自己改
Audio.se_play("Audio/SE/"+"056-Right02",80,100)
# 等待 10 祯
for i in 0..10
Graphics.update
end
# 如果所有同伴都升级了
if level_uper.size == $game_party.actors.size
# 生成升级提示窗口
level_uper_window = Window_Base.new(215, 169, 234, 97)
level_uper_window.contents = Bitmap.new(200, 64)
level_uper_window.opacity = 160
# 描绘升级信息
level_uper_window.contents.draw_text(0, 16, 200, 32, " 全体同伴 LEVEL UP! ")
# 此外(如果只有部分角色升级)
else
# 生成升级提示窗口
height = level_uper.size * 32 + 33
level_uper_window = Window_Base.new(201, (435 - height) / 2, 262, height)
level_uper_window.contents = Bitmap.new(230, height - 32)
level_uper_window.opacity = 160
# 描绘升级信息
y = 0
for level_up_actor in level_uper
level_uper_window.contents.draw_text(10, y, 210, 32, level_up_actor)
level_uper_window.contents.draw_text(10, y, 210, 32, "LEVEL UP!", 2)
y += 32
end
end
# 显示 50 祯
for i in 0..50
Graphics.update
end
# 用 10 祯过渡消失升级提示窗口
for i in 0..10
level_uper_window.opacity -= 30
level_uper_window.contents_opacity -= 30
Graphics.update
end
# 释放升级提示窗口
level_uper_window.dispose
# 如果有角色因为升级而学会技能
if learned_skill != ""
# 播放学会技能 ME,可以自己改
Audio.me_play("Audio/ME/"+"010-Item01",100,100)
# 更改对话框各个选项
$game_system.message_position = 2
$game_system.message_frame = 0
$mes_id = nil
$mes_name = ""
# 显示学会技能信息
@message_waiting = true
$game_temp.message_proc = Proc.new { @message_waiting = false }
# message_text 设置为 1 行
$game_temp.message_text = "\\c[4]" + learned_skill + "\n"
end
end
# 继续
return true
end
#--------------------------------------------------------------------------
# ● 增减等级
#--------------------------------------------------------------------------
def command_316
# 获取操作值
value = operate_value(@parameters[1], @parameters[2], @parameters[3])
# 如果 不显示升级窗口开关 关闭,则初始化纪录升级角色和纪录角色学会特级的变量
if $game_switches[$不显示升级窗口] == false
level_uper = []
learned_skill = ""
end
# 处理重复
iterate_actor(@parameters[0]) do |actor|
# 如果 不显示升级窗口开关 关闭
if $game_switches[$不显示升级窗口] == false
last_level = actor.level
# 更改角色的等级
actor.level += value
# 如果是让角色升级
if actor.level > last_level
# 在纪录升级角色的变量里纪录升级角色
level_uper.push(actor.name.split(/·/)[0])
# 如果因升级学会特技
for level in last_level+1..actor.level
for j in $data_classes[actor.class_id].learnings
if j.level == level
# 把角色的升级学会技能信息记录入变量
#learned_skill.push(actor.name.split(/·/)[0] + "学会了新特技“" + $data_skills[j.skill_id].name + "”。")
learned_skill += actor.name.split(/·/)[0] + "学会了新特技“" + $data_skills[j.skill_id].name + "”。\n"
end
end
end
end
# 此外(如果 不显示升级窗口开关 开启)
else
# 更改角色的等级
actor.level += value
end
end
# 如果 不显示升级窗口开关 关闭,且有角色升级
if $game_switches[$不显示升级窗口] == false and level_uper.size > 0
# 播放升级提示 SE,可以自己改
Audio.se_play("Audio/SE/"+"056-Right02",80,100)
# 等待 10 祯
for i in 0..10
Graphics.update
end
# 如果所有同伴都升级了
if level_uper.size == $game_party.actors.size
# 生成升级提示窗口
level_uper_window = Window_Base.new(215, 169, 234, 97)
level_uper_window.contents = Bitmap.new(200, 64)
level_uper_window.opacity = 160
# 描绘升级信息
level_uper_window.contents.draw_text(0, 16, 200, 32, " 全体同伴 LEVEL UP! ")
# 此外(如果只有部分角色升级)
else
# 生成升级提示窗口
height = level_uper.size * 32 + 33
level_uper_window = Window_Base.new(201, (435 - height) / 2, 262, height)
level_uper_window.contents = Bitmap.new(230, height - 32)
level_uper_window.opacity = 160
# 描绘升级信息
y = 0
for level_up_actor in level_uper
level_uper_window.contents.draw_text(10, y, 210, 32, level_up_actor)
level_uper_window.contents.draw_text(10, y, 210, 32, "LEVEL UP!", 2)
y += 32
end
end
# 显示 50 祯
for i in 0..50
Graphics.update
end
# 用 10 祯过渡消失升级提示窗口
for i in 0..10
level_uper_window.opacity -= 30
level_uper_window.contents_opacity -= 30
Graphics.update
end
# 释放升级提示窗口
level_uper_window.dispose
# 如果有角色因为升级而学会技能
if learned_skill != ""
# 播放学会技能 ME,可以自己改
Audio.me_play("Audio/ME/"+"010-Item01",100,100)
# 更改各个选项
$game_system.message_position = 2
$game_system.message_frame = 0
$mes_id = nil
$mes_name = ""
# 显示学会技能信息
@message_waiting = true
$game_temp.message_proc = Proc.new { @message_waiting = false }
# message_text 设置为 1 行
$game_temp.message_text = "\\c[4]" + learned_skill + "\n"
end
end
# 继续
return true
end
# ■■■■■■■■■■■■■■ END ■■■■■■■■■■■■■■■■
end
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
复制代码
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1