Project1
标题:
如何设置使得踩地雷式野怪的战斗胜利时触发某一事件
[打印本页]
作者:
007007114
时间:
2012-10-6 06:27
标题:
如何设置使得踩地雷式野怪的战斗胜利时触发某一事件
我想做一个打野怪有概率掉落随机装备的东东 脚本啥的都弄好了 在数据库中敌人队伍设置里面找不到战斗胜利的条件,只有回合数敌人血量角色血量啥的条件,请问如何设置使得打赢之后触发某一个变量的更改?(PS 我试过把条件设置为敌人血量少于1% 但是如果直接把敌人秒杀的话并不会触发后续事件)
作者:
亿万星辰
时间:
2012-10-6 08:24
你可以在每个战斗事件页里设置一个在战斗开始时打开某个开关,然后把这个开关用于控制一个自动执行的公共事件的启动,然后做出你想要的事件操作,当然公共事件的结尾要关闭这个开关。
作者:
007007114
时间:
2012-10-6 10:56
亿万星辰 发表于 2012-10-6 08:24
你可以在每个战斗事件页里设置一个在战斗开始时打开某个开关,然后把这个开关用于控制一个自动执行的公共事 ...
可是我要提示玩家获得了一件装备 总不能战斗刚开始就说掉落了一件装备吧。。。有没有办法就像最后显示获取金钱经验那样 在战斗结束后触发这个事件?
作者:
凌驾乾坤
时间:
2012-10-6 15:23
把这个脚本复制在main前,获得物品会提示
当45号开关打开时,失去物品不提示
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
# 注意!!!在对话后得到物品,请在对话后先用事件等待3帧,否则对话框来不及消失。
# 开关定义:
$不显示金钱窗口 = 41
$不显示物品窗口 = 42
$不显示武器窗口 = 43
$不显示防具窗口 = 44
# 以上开关,当打开的时候,获得物品将不会提示,比如默认打开41号开关,获得金钱不再提示
$失去物品不提示 = 45
# ————————————————————————————————————
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((640-160)/2,128,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
if $game_switches[$失去物品不提示] and value < 0
else
carol3_66RPG_item = $data_items[@parameters[0]]
carol3_66RPG = Window_Base.new((640-300)/2,128,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
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((640-300)/2,128,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((640-300)/2,128,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
end
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
复制代码
作者:
kangxi0109
时间:
2012-10-6 17:30
试试这个,在Scene_Battle 2末尾战斗结束后用开关判定,然后运行公共事件:
执行公共事件:
$game_temp.common_event_id = 编号
复制代码
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1