赞 | 0 |
VIP | 2 |
好人卡 | 1 |
积分 | 1 |
经验 | 9236 |
最后登录 | 2020-2-13 |
在线时间 | 327 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 55
- 在线时间
- 327 小时
- 注册时间
- 2011-9-29
- 帖子
- 315
|
再次发现了
是一个脚本的问题,可奇异的是,在我的原本里,加上它就会出错
但在新建的工程里,我把所有的脚本都复制过去了,没有少任何一个却不会出错
这次真的晕了,下面是哪个脚本
<=begin
■ 区域遇敌-脚本版 By 茄子
联系QQ 9244579
轻松设置某个区域遇敌的敌人ID
在每个地图上放一个并行事件
事件内容为脚本(也就是设置该地图的敌人)
如:
Control_Enemys::RANGS = [
[1,[0,3],[0,3]],
数据分别为
[数据库里敌人队伍1,[起始X坐标0,目的X坐标3],[起始Y坐标0,目的Y坐标3]]
==>该敌人ID=1)<== ================>该敌人遇到的范围<=============
该ID是数据库中队伍的ID,不是敌人的ID。
遇敌概率还是在地图上设置
如果不需要区域遇敌,类型 0 = 单独区域遇敌, 1 = 区域遇敌+普通遇敌 , 2 = 普通遇敌
普通遇敌遇到的就是你原来在地图上设置的敌人了。
Control_Enemys::TYPE = 2
]
设置完后在最后需要设置现在地图原来的敌人编号
如:
原来地图设置敌人两个编号为 1 2 都是幽灵
Control_Enemys::OLD_ENEMYS = [1,2] 这样以便返回以前的敌人。
=end
module Control_Enemys
OLD_ENEMYS = [1,2]
RANGS = [
[1,[0,3],[0,3]],
[4,[16,19],[0,3]]
]
TYPE = 0
end
class Game_Player
attr_writer :encounter_count
end
class Game_Map
attr_writer :encounter_list
end
class Scene_Map
def update
loop do
$game_map.update
$game_system.map_interpreter.update
$game_player.update
$game_system.update
$game_screen.update
unless $game_temp.player_transferring
break
end
transfer_player
if $game_temp.transition_processing
break
end
end
@spriteset.update
@message_window.update
if $game_temp.gameover
$scene = Scene_Gameover.new
return
end
if $game_temp.to_title
$scene = Scene_Title.new
return
end
if $game_temp.transition_processing
$game_temp.transition_processing = false
if $game_temp.transition_name == ""
Graphics.transition(20)
else
Graphics.transition(40, "Graphics/Transitions/" +
$game_temp.transition_name)
end
end
if $game_temp.message_window_showing
return
end
if Control_Enemys::TYPE == 1
if $game_player.encounter_count == 0 and Control_Enemys::OLD_ENEMYS != []
unless $game_system.map_interpreter.running? or
$game_system.encounter_disabled
n = rand(Control_Enemys::OLD_ENEMYS.size)
troop_id = Control_Enemys::OLD_ENEMYS[n]
if $data_troops[troop_id] != nil
$game_temp.battle_calling = true
$game_temp.battle_troop_id = troop_id
$game_temp.battle_can_escape = true
$game_temp.battle_can_lose = false
$game_temp.battle_proc = nil
end
end
end
end
else
for i in Control_Enemys::RANGS
if $game_player.x >= i[1][0] and $game_player.x <= i[1][1] and
$game_player.y >= i[2][0] and $game_player.y <= i[2][1]
if $game_player.encounter_count == 0 and i[0] != []
unless $game_system.map_interpreter.running? or
$game_system.encounter_disabled
enemys = []
enemys.push(i[0])
n = rand(enemys.size)
troop_id = enemys[n]
if $data_troops[troop_id] != nil
$game_temp.battle_calling = true
$game_temp.battle_troop_id = troop_id
$game_temp.battle_can_escape = true
$game_temp.battle_can_lose = false
$game_temp.battle_proc = nil
end
end
end
end
end
if Control_Enemys::TYPE == 2
if $game_player.encounter_count == 0 and $game_map.encounter_list != []
unless $game_system.map_interpreter.running? or
$game_system.encounter_disabled
n = rand($game_map.encounter_list.size)
troop_id = $game_map.encounter_list[n]
if $data_troops[troop_id] != nil
$game_temp.battle_calling = true
$game_temp.battle_troop_id = troop_id
$game_temp.battle_can_escape = true
$game_temp.battle_can_lose = false
$game_temp.battle_proc = nil
end
end
end
end
if Input.trigger?(Input::B)
unless $game_system.map_interpreter.running? or
$game_system.menu_disabled
$game_temp.menu_calling = true
$game_temp.menu_beep = true
end
end
if $DEBUG and Input.press?(Input::F9)
$game_temp.debug_calling = true
end
unless $game_player.moving?
if $game_temp.battle_calling
call_battle
elsif $game_temp.shop_calling
call_shop
elsif $game_temp.name_calling
call_name
elsif $game_temp.menu_calling
call_menu
elsif $game_temp.save_calling
call_save
elsif $game_temp.debug_calling
call_debug
end
end
end
end> |
|