Project1
标题: 【已解决】脚本里加个条件分歧 包裹携带物品或开关做条件 [打印本页]
作者: 金芒芒 时间: 2023-3-31 13:37
标题: 【已解决】脚本里加个条件分歧 包裹携带物品或开关做条件
本帖最后由 金芒芒 于 2023-3-31 16:25 编辑
如果携带物品‘’战令1‘’=1 那么
enermy_selected_troops =[ [21,21],[21,21,21],[21,21],[21,21,21],[21,21,21,21,21] ]
如果携带物品‘’战令2‘’=1 那么
enermy_selected_troops =[ [5,5],[5,5,5],[5,5],[5,5,5],[5,5,5,5,5] ]
#--------------------------------------------------------------------------
# ● 命令 : 自定义战斗
#--------------------------------------------------------------------------
def command_custom_battle#定义命令_自定义战斗
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
#$游戏系统。se播放($数据系统。未指定文件或目录
choose_map_main#选择主地图
map_info = @map_info#地图信息=@地图信息
#如果选择随机地图随机士兵
if ! @force_back and map_info[0] == -1#如果!@强制返回并地图信息[0]==-1
make_random_efs_game#生成随机efs_game
return
end
#---------------------------------------------------- ↑↓
#如果@强制后退或@强制后退==无
if ! @force_back or @force_back == nil
#自定义主战场(0,@地图信息[1],@地图信息[2])
custom_battle_main(0,@map_info[1],@map_info[2])
#团队选定部队=@选定部队
team_selected_troops = @selected_units
#如果@强制后退或@强制后退==无
if ! @force_back or @force_back == nil
#自定义主战场(1,@地图信息[1],@地图信息[2])
custom_battle_main(1,@map_info[1],@map_info[2])
#敌人选定部队=@选定部队
enermy_selected_troops =[ [21,21],[21,21,21],[21,21],[21,21,21],[21,21,21,21,21] ] #@selected_units
enermy_selected_troops =[ [5,5],[5,5,5],[5,5],[5,5,5],[5,5,5,5,5] ]
#如果@强制后退或@强制后退==无
if ! @force_back or @force_back == nil
choose_hero_main#选择英雄主
selected_hero = @selected_hero#选定的英雄=@选定的英雄
if ! @force_back or @force_back == nil
team_army = Game_Army_Slg.new(0)
enermy_army = Game_Army_Slg.new(1)
team_army.create_empty_army
enermy_army.create_empty_army
team_army.load_twoD_Array(team_selected_troops,selected_hero)
enermy_army.load_twoD_Array(enermy_selected_troops)
# 切换地图画面
#
team_army.set_groups_name
$custom_battle_next_fighter_team = team_army
$custom_battle_next_fighter_enermy = enermy_army
$custom_battle_next_map_id = map_info[0]
$game_party.setup_starting_members
# 设置初期位置的地图##############1356622
$game_map.setup(19)
# 主角向初期位置移动
$game_player.moveto(0, 0)
# 刷新主角
$game_player.refresh
# 执行地图设置的 BGM 与 BGS 的自动切换
$game_map.autoplay
# 刷新地图 (执行并行事件)
$game_map.update
# 切换地图画面
$scene = Scene_Map.new
# $scene = Scene_Map.new
#efs_title_main
else # fourth
@force_back = false
Graphics.update
efs_title_update
end
else # third
@force_back = false
Graphics.update
efs_title_update
end
else # second
@force_back = false
Graphics.update
efs_title_update
end
else #1st
@force_back = false
Graphics.update
efs_title_update
end
end
#--------------------------------------------------------------------------
# ● 命令 : 自定义战斗
#--------------------------------------------------------------------------
def command_custom_battle#定义命令_自定义战斗
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
#$游戏系统。se播放($数据系统。未指定文件或目录
choose_map_main#选择主地图
map_info = @map_info#地图信息=@地图信息
#如果选择随机地图随机士兵
if ! @force_back and map_info[0] == -1#如果!@强制返回并地图信息[0]==-1
make_random_efs_game#生成随机efs_game
return
end
#---------------------------------------------------- ↑↓
#如果@强制后退或@强制后退==无
if ! @force_back or @force_back == nil
#自定义主战场(0,@地图信息[1],@地图信息[2])
custom_battle_main(0,@map_info[1],@map_info[2])
#团队选定部队=@选定部队
team_selected_troops = @selected_units
#如果@强制后退或@强制后退==无
if ! @force_back or @force_back == nil
#自定义主战场(1,@地图信息[1],@地图信息[2])
custom_battle_main(1,@map_info[1],@map_info[2])
#敌人选定部队=@选定部队
enermy_selected_troops =[ [21,21],[21,21,21],[21,21],[21,21,21],[21,21,21,21,21] ] #@selected_units
enermy_selected_troops =[ [5,5],[5,5,5],[5,5],[5,5,5],[5,5,5,5,5] ]
#如果@强制后退或@强制后退==无
if ! @force_back or @force_back == nil
choose_hero_main#选择英雄主
selected_hero = @selected_hero#选定的英雄=@选定的英雄
if ! @force_back or @force_back == nil
team_army = Game_Army_Slg.new(0)
enermy_army = Game_Army_Slg.new(1)
team_army.create_empty_army
enermy_army.create_empty_army
team_army.load_twoD_Array(team_selected_troops,selected_hero)
enermy_army.load_twoD_Array(enermy_selected_troops)
# 切换地图画面
#
team_army.set_groups_name
$custom_battle_next_fighter_team = team_army
$custom_battle_next_fighter_enermy = enermy_army
$custom_battle_next_map_id = map_info[0]
$game_party.setup_starting_members
# 设置初期位置的地图##############1356622
$game_map.setup(19)
# 主角向初期位置移动
$game_player.moveto(0, 0)
# 刷新主角
$game_player.refresh
# 执行地图设置的 BGM 与 BGS 的自动切换
$game_map.autoplay
# 刷新地图 (执行并行事件)
$game_map.update
# 切换地图画面
$scene = Scene_Map.new
# $scene = Scene_Map.new
#efs_title_main
else # fourth
@force_back = false
Graphics.update
efs_title_update
end
else # third
@force_back = false
Graphics.update
efs_title_update
end
else # second
@force_back = false
Graphics.update
efs_title_update
end
else #1st
@force_back = false
Graphics.update
efs_title_update
end
end
用开关也行
#--------------------------------------------------------------------------
# ● 命令 : 自定义战斗
#--------------------------------------------------------------------------
def command_custom_battle#定义命令_自定义战斗
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
#$游戏系统。se播放($数据系统。未指定文件或目录
choose_map_main#选择主地图
map_info = @map_info#地图信息=@地图信息
#如果选择随机地图随机士兵
if ! @force_back and map_info[0] == -1#如果!@强制返回并地图信息[0]==-1
make_random_efs_game#生成随机efs_game
return
end
#---------------------------------------------------- ↑↓
#如果@强制后退或@强制后退==无
if ! @force_back or @force_back == nil
#自定义主战场(0,@地图信息[1],@地图信息[2])
custom_battle_main(0,@map_info[1],@map_info[2])
#团队选定部队=@选定部队
team_selected_troops = @selected_units
#如果@强制后退或@强制后退==无
if ! @force_back or @force_back == nil
#自定义主战场(1,@地图信息[1],@地图信息[2])
custom_battle_main(1,@map_info[1],@map_info[2])
#敌人选定部队=@选定部队
if $game_switches[18] = true
#true是打开,false是关闭
enermy_selected_troops =[ [21,21],[21,21,21],[21,21],[21,21,21],[21,21,21,21,21] ] #@selected_units
end
if $game_switches[19] = true
enermy_selected_troops =[ [5,5],[5,5,5],[5,5],[5,5,5],[5,5,5,5,5] ]
end
#如果@强制后退或@强制后退==无
if ! @force_back or @force_back == nil
choose_hero_main#选择英雄主
selected_hero = @selected_hero#选定的英雄=@选定的英雄
if ! @force_back or @force_back == nil
team_army = Game_Army_Slg.new(0)
enermy_army = Game_Army_Slg.new(1)
team_army.create_empty_army
enermy_army.create_empty_army
team_army.load_twoD_Array(team_selected_troops,selected_hero)
enermy_army.load_twoD_Array(enermy_selected_troops)
# 切换地图画面
#
team_army.set_groups_name
$custom_battle_next_fighter_team = team_army
$custom_battle_next_fighter_enermy = enermy_army
$custom_battle_next_map_id = map_info[0]
$game_party.setup_starting_members
# 设置初期位置的地图##############1356622
$game_map.setup(19)
# 主角向初期位置移动
$game_player.moveto(0, 0)
# 刷新主角
$game_player.refresh
# 执行地图设置的 BGM 与 BGS 的自动切换
$game_map.autoplay
# 刷新地图 (执行并行事件)
$game_map.update
# 切换地图画面
$scene = Scene_Map.new
# $scene = Scene_Map.new
#efs_title_main
else # fourth
@force_back = false
Graphics.update
efs_title_update
end
else # third
@force_back = false
Graphics.update
efs_title_update
end
else # second
@force_back = false
Graphics.update
efs_title_update
end
else #1st
@force_back = false
Graphics.update
efs_title_update
end
end
#--------------------------------------------------------------------------
# ● 命令 : 自定义战斗
#--------------------------------------------------------------------------
def command_custom_battle#定义命令_自定义战斗
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
#$游戏系统。se播放($数据系统。未指定文件或目录
choose_map_main#选择主地图
map_info = @map_info#地图信息=@地图信息
#如果选择随机地图随机士兵
if ! @force_back and map_info[0] == -1#如果!@强制返回并地图信息[0]==-1
make_random_efs_game#生成随机efs_game
return
end
#---------------------------------------------------- ↑↓
#如果@强制后退或@强制后退==无
if ! @force_back or @force_back == nil
#自定义主战场(0,@地图信息[1],@地图信息[2])
custom_battle_main(0,@map_info[1],@map_info[2])
#团队选定部队=@选定部队
team_selected_troops = @selected_units
#如果@强制后退或@强制后退==无
if ! @force_back or @force_back == nil
#自定义主战场(1,@地图信息[1],@地图信息[2])
custom_battle_main(1,@map_info[1],@map_info[2])
#敌人选定部队=@选定部队
if $game_switches[18] = true
#true是打开,false是关闭
enermy_selected_troops =[ [21,21],[21,21,21],[21,21],[21,21,21],[21,21,21,21,21] ] #@selected_units
end
if $game_switches[19] = true
enermy_selected_troops =[ [5,5],[5,5,5],[5,5],[5,5,5],[5,5,5,5,5] ]
end
#如果@强制后退或@强制后退==无
if ! @force_back or @force_back == nil
choose_hero_main#选择英雄主
selected_hero = @selected_hero#选定的英雄=@选定的英雄
if ! @force_back or @force_back == nil
team_army = Game_Army_Slg.new(0)
enermy_army = Game_Army_Slg.new(1)
team_army.create_empty_army
enermy_army.create_empty_army
team_army.load_twoD_Array(team_selected_troops,selected_hero)
enermy_army.load_twoD_Array(enermy_selected_troops)
# 切换地图画面
#
team_army.set_groups_name
$custom_battle_next_fighter_team = team_army
$custom_battle_next_fighter_enermy = enermy_army
$custom_battle_next_map_id = map_info[0]
$game_party.setup_starting_members
# 设置初期位置的地图##############1356622
$game_map.setup(19)
# 主角向初期位置移动
$game_player.moveto(0, 0)
# 刷新主角
$game_player.refresh
# 执行地图设置的 BGM 与 BGS 的自动切换
$game_map.autoplay
# 刷新地图 (执行并行事件)
$game_map.update
# 切换地图画面
$scene = Scene_Map.new
# $scene = Scene_Map.new
#efs_title_main
else # fourth
@force_back = false
Graphics.update
efs_title_update
end
else # third
@force_back = false
Graphics.update
efs_title_update
end
else # second
@force_back = false
Graphics.update
efs_title_update
end
else #1st
@force_back = false
Graphics.update
efs_title_update
end
end
作者: 纯属小虫 时间: 2023-3-31 16:03
猫大有做过一个能让游戏开关或变量在被访问的时候根据某对象实时更新的脚本,你可以去看看
上链接——
自更新开关和变量(你用了会知道有多好用)
https://rpg.blue/forum.php?mod=v ... amp;fromuid=2717817
(出处: Project1)
作者: 金芒芒 时间: 2023-3-31 16:19
- if $game_switches[18] == true
- #true是打开,false是关闭
- enermy_selected_troops =[ [21,21],[21,21,21],[21,21],[21,21,21],[21,21,21,21,21] ] #@selected_units
- end
- if $game_switches[19] == true
- enermy_selected_troops =[ [5,5],[5,5,5],[5,5],[5,5,5],[5,5,5,5,5] ]
- end
复制代码
谢谢
作者: 纯属小虫 时间: 2023-3-31 16:36
本帖最后由 纯属小虫 于 2023-4-6 16:21 编辑
如果携带物品‘’战令1‘’=1
》》》》》》
$game_party.item_number(战令1物品ID) == 1
如果携带物品‘’战令2‘’=1
》》》》》》
$game_party.item_number(战令2物品ID) == 1
作者: 金芒芒 时间: 2023-3-31 16:49
这个可以有做任务最好了
欢迎光临 Project1 (https://rpg.blue/) |
Powered by Discuz! X3.1 |