赞 | 4 |
VIP | 0 |
好人卡 | 0 |
积分 | 78 |
经验 | 15725 |
最后登录 | 2024-11-21 |
在线时间 | 1343 小时 |
Lv4.逐梦者
- 梦石
- 0
- 星屑
- 7802
- 在线时间
- 1343 小时
- 注册时间
- 2015-8-15
- 帖子
- 752
|
本帖最后由 金芒芒 于 2023-8-15 16:42 编辑
我就想team_selected_troops = @selected_units
team_selected_troops = [[],[].[],[],[]]这[]里面的参数第三个脚本的20行
@selected_units是第2个脚本向第一脚本@all_fighters参数内容索引过去的(名称=图片=name = Figter_data::THE_NAME[item])[item=图片]item
第一个脚本86行@all_fighters = Figter_data::ALL_SOLDIER # 所有士兵=Figter_data::ALL_SOLDIER
@all_fighters这个是第4个脚本里面的参数[5,4,3,13,2,9,11,15,26,23,32,35,36,28,30,33,34,7,8,19,12,31,38,17, 27,6,10,14,16,18,21,22,29,39]
[5,4,3,13,2,9,11,15,26,23,32,35,36,28,30,33,34,7,8,19,12,31,38,17, 27,6,10,14,16,18,21,22,29,39]#所有英雄是第5个脚本的data_id(截图脚本)
- #==============================================================================
- # ■ Window_Item
- #------------------------------------------------------------------------------
- # 显示可以装备的回路。
- #==============================================================================
- class Window_Troops_List< Window_Base
- def blue_color
- return Color.new(141,157,180)
- end
- #--------------------------------------------------------------------------
- # ● 定义实例变量
- #--------------------------------------------------------------------------
- attr_reader :index # 光标位置
- attr_reader :help_window # 帮助窗口
- attr_reader :type # 种类
- attr_reader :able # 暗色
-
- def type=(type) # 定义类型=(类型)
- @type = type # @类型 = 类型
- end
- def type # 定义 类型
- return @type # 返回 @类型
- end
- #--------------------------------------------------------------------------
- # ● 设置光标的位置
- # index : 新的光标位置
- #--------------------------------------------------------------------------
- def index=(index) # 定义 索引 = (索引)
- @index = index # @索引 = 索引
- @column_max = 4 # 纵最大值 = 4
- # 刷新帮助文本 (update_help 定义了继承目标)
- #如果是自己。活动和@帮助窗口!=无
- if self.active and @help_window != nil
- update_help # 跟新帮组
- end
- # 刷新光标矩形
- update_cursor_rect
- end
- #--------------------------------------------------------------------------
- # ● 获取行数
- #--------------------------------------------------------------------------
- def row_max #定义行的最大值
- # 由项目数和列数计算出行数
- return @item_max #返回@项目最大值
- end
- #--------------------------------------------------------------------------
- # ● 获取开头行
- #--------------------------------------------------------------------------
- def top_row # 定义 开头行
- # 将窗口内容的传送源 Y 坐标、1 行的高 32 等分
- return self.oy / 120 #返回自己原点y/120 (每行的间隔是120)
- end
- #--------------------------------------------------------------------------
- # ● 设置开头行
- # row : 显示开头的行
- #--------------------------------------------------------------------------
- def top_row=(row) # 定义 开头行=(行)
- # row 未满 0 的场合更正为 0
- if row < 0 #如果行< 0
- row = 0 #行=0
- end
- # row 超过 row_max - 1 的情况下更正为 row_max - 1
- if row > row_max - 1 # 如果 行 > 行 最大值 - 1
- row = row_max - 1 # 行 = 行 最大值 - 1
- end
- # row 1 行高的 32 倍、窗口内容的传送源 Y 坐标
- self.oy = row * 120
- end
- #--------------------------------------------------------------------------
- # ● 获取 1 页可以显示的行数
- #--------------------------------------------------------------------------
- def page_row_max #定义页面行最大值
- # 窗口的高度,设置画面的高度减去 32 ,除以 1 行的高度 32
- return 3 #返回 3
- end
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # actor : 角色
- #--------------------------------------------------------------------------
- #定义初始化(类型=0,玩家或敌军=0)
- def initialize(type = 0,player_or_enermy = 0)
- # @all_fighters = [1]
- # if $game_switches[19] == true#(开关 开)
- # @all_fighters.push(2)
- # end
- @all_fighters = Figter_data::ALL_SOLDIER # 所有士兵=Figter_data::ALL_SOLDIER
-
- #右侧滚动条
- @right_back = Bar_Right.new("right_back", origin_x+344, origin_y+12, 120*3)
- @right_back.visible = false
- @right = Bar_Right.new("right", origin_x+342, origin_y+12, 0)
- @right.visible = false
- #变量更新
- @type = 0 #@类型= 0
- @index = 0 # 索引=0
- #背景
- @back = Sprite.new #@背景 = 新的精灵
- #背景位图 = RPG::Cache.menu("troopList-base")
- @back.bitmap = RPG::Cache.menu("troopList-base")
- # @back.x = origin_x
- # @back.y = origin_y
- #帮助窗口 = Window_Troop_Info.new #属性窗口
- @help_window = Window_Troop_Info.new #属性窗口
-
-
- @item_icon = [] #项目图标 = []
- @item_icon[0] = Sprite.new #@项目图标[0] = Sprite.new
- #初始化
- super(origin_x,origin_y,344+32,3*120+120)
- self.windowskin = RPG::Cache.menu("Blue") #自己窗花=RPG::缓存.菜单(“蓝色”)
- self.opacity = 0 #自己不透明度 =0
- self.active = false #自己活动=错误
- #刷新
- refresh(type) #刷新(类型)
- refresh(type) #刷新(类型)
- update_help #更新帮助
- end
- #--------------------------------------------------------------------------
- # ● 活动窗口用原始x y坐标
- #--------------------------------------------------------------------------
- def origin_x
- return 25
- end
- def origin_y
- return 100
- end
- #--------------------------------------------------------------------------
- # ● 定义用选择状态决定窗口颜色
- #--------------------------------------------------------------------------
- def able=(able)
- @able=able
- @right_back.able = able
- @right.able = able
- if active
- @back.color = Color.new(255,255,255,0)
- else
- @back.color = Color.new(0,0,0,128)
- end
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 一些方法的重载
- #--------------------------------------------------------------------------
- def active=(active) # 定义活动 =(活动)
- if active # 如果活动
- if @item_max <= 0 # 如果@项目最大值<= 0
- self.index = -1 # 自己索引=-1
- else # 否则
- self.index = 0 # 自己索引= 0
- end
- else # 否则
- self.index = -1 # 自己索引=-1
- end
- @ajsdgfshfajklshfa = nil #@阿拉伯联合酋长国=零
- #@帮助窗口。如果@帮助窗口!=设置文本(nil)无
- @help_window.set_text( nil ) if @help_window != nil
- super(active) #超级(活动)
- end
- def dispose #定义释放
- @back.dispose #@背景释放
- @right_back.dispose # 滚条背景释放
- @right.dispose # 滚条释放
- for i in 0...@item_icon.size #对于0中的i…@项目图标。大小
- @item_icon[i].dispose # @项目图标[i].释放
- end
- @help_window.dispose # 帮助窗口释放
-
- super
- end
- def x=(x)
- @back.x = x-origin_x #+ 15
- @right_back.x = x+344 #+30
- @right.x = x+342 #+30
- for i in 0...@item_icon.size
- @item_icon[i].x = 5+ i%4 *86 # +60 #14
- end
- super(x-16)
- end
- def x
- return super+16
- end
- def y=(y)
- @back.y = y-origin_y# + 60
- @right_back.y = y+12 #+ origin_y
- @right.y = y+12 #+ origin_y
- for i in 0...@item_icon.size
- @item_icon[i].y= y+16+ i/ 4 * 122 # + origin_y #+ 25 #14
- end
- super(y)
- end
- def z=(z)
- @back.z=z-5
- @right_back.z=z+3
- @right.z=z+4
- for i in 0...@item_icon.size
- @item_icon[i].z=z+2
- end
- super(z)
- end
- def visible=(visible) #def-visible=(可见)
- @back.visible=visible
- @right_back.visible=visible
- @right.visible=visible
- # @help_window.visible=visible
- super(visible)
- end
- def contents_opacity=(opacity) #def内容不透明度=(不透明度)
- @back.opacity=opacity
- @right_back.opacity=opacity
- @right.opacity=opacity
- # @help_window.opacity=opacity
- super(opacity)
- end
- def oy=(oy)
- #缩放图标时只显示当前页的项目
- for i in 0...@item_icon.size
- @item_icon[i].x= 25+i%4 *84
- # @item_icon[i].y = i/4*120
- @item_icon[i].y = i/ 4 * 120+self.y-oy+16#120*i+self.y-oy+16
- if @item_icon[i].y < self.y or @item_icon[i].y > self.y+120*self.page_row_max
- @item_icon[i].visible = false
- else
- @item_icon[i].visible = true
- end
- end
- super(oy)
- end
- #--------------------------------------------------------------------------
- # ● 获取物品
- #--------------------------------------------------------------------------
- def item #定义项目
- return @all_fighters[self.index] #返回 @所有士兵[自己索引]
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh(type=@type) # 定义刷新(类型=@类型) #all,1,2,3,4,5,6,7 RPPG::ARMOR_BEGIN
- if self.contents != nil # 如果是自己。内容!=无
- self.contents.dispose # 自己内容释放
- self.contents = nil # 自己内容=无
- end
-
- for i in 0...@item_icon.size # 对于0中的i…@项目图标。大小
- @item_icon[i].dispose # @项目图标[i].释放
- end
- @item_icon = [] # @项目图标 = []
- @item_icon[0] = Sprite.new # @项目图标[0] = 精灵新的
-
- for i in 0...@all_fighters.size # 对于0中的i…@所有士兵。大小
- @item_icon[i] = Sprite.new # @项目图标[0] = 精灵新的
- #名称= Figter_data::CHARACTER_NAME[@所有士兵[i]]
- name = Figter_data::CHARACTER_NAME[@all_fighters[i]]
- #@项目图标[i].位图= RPG::Cache.icon(名称) 如果名称 != 无
- @item_icon[i].bitmap = RPG::Cache.icon(name) if name != nil
-
- end
- #@项目最大值 = @所有士兵大小
- @item_max = @all_fighters.size
- #下标超过范围的时候往回退一格
- #如果是自己。最上面一行>@项目最大自我。最大页数
- if self.top_row > @item_max-self.page_row_max
- #自己。最上面一行=@项目最大自我。最大页数
- self.top_row = @item_max-self.page_row_max
- end
- if self.index >= @item_max
- self.index = @item_max-1
- end
-
- #右侧滚动条显示
- if @item_max > self.page_row_max
- @right_back.visible = true
- @right.visible = true
- else
- @right_back.visible = false
- @right.visible = false
- end
- #滚动条的更新
- if @right.visible
- @right.height = (3*120)*(3*120)/(@item_max.to_f*120)-24.0 > 0 ? (3*120)*(3*120)/(@item_max.to_f*120)-24.0 : 0
- end
-
- # 如果项目数不是 0 就生成位图、描绘全部项目
- if @item_max > 0
- self.contents = Bitmap.new(width - 32, @item_max*20)
- for i in 0...@item_max
- draw_item(i, 12, i*120)
- end
- else
- self.contents = Bitmap.new(width - 32, 20)
- end
- #缩放图标时只显示当前页的项目
- for i in 0...@item_icon.size
- @item_icon[i].x = 25+ i%4 *84
- @item_icon[i].y = i/ 4 * 120+self.y-oy+16#120*i+self.y-oy+16
-
- # @item_icon[i].y = i/4*120
- if @item_icon[i].y < self.y or @item_icon[i].y > self.y+120*self.page_row_max
- @item_icon[i].visible = false
- else
- @item_icon[i].visible = true
- end
- end
- #update_help
- end
- #--------------------------------------------------------------------------
- # ● 描绘物品
- #--------------------------------------------------------------------------
- def draw_item(index, x, y)
- item = @all_fighters[index]
-
-
-
-
- self.contents.font.size = 12
-
-
- #图标缩放显示专用
- icon_size = 100#图片缩放大小self.index%4 * (66 + 5)
- @item_icon[index].x = self.index%4 *86
- @item_icon[index].y = self.index/ 4 * 120
- # @item_icon[index].zoom_x = icon_size.to_f/@item_icon[index].bitmap.width
- # @item_icon[index].zoom_y = icon_size.to_f/@item_icon[index].bitmap.height
- @item_icon[index].z = self.z+2
- @item_icon[index].color = self.contents.font.color==normal_color ? Color.new(255,255,255,0):Color.new(0,0,0,128)
- #self.contents.font.color = Color.new(128,193,125,0)
- name = Figter_data::THE_NAME[item]#name=图形数据::名称[项目]
- self.contents.draw_text(x + icon_size.to_f, y + 4, 184, self.contents.font.size, name)
-
-
- end
- #--------------------------------------------------------------------------
- # ● 帮助窗口的设置
- # help_window : 新的帮助窗口
- #--------------------------------------------------------------------------
- def help_window=(help_window)
- @help_window = help_window
- # 刷新帮助文本 (update_help 定义了继承目标)
- if self.active and @help_window != nil
- update_help
- end
- end
- #--------------------------------------------------------------------------
- # ● 更新光标矩形
- #--------------------------------------------------------------------------
- def update_cursor_rect
- #@back.bitmap = RPG::Cache.menu("item_command"+type.to_s)
- # 光标位置不满 0 的情况下
- if @index < 0
- self.cursor_rect.empty
- return
- end
-
- # 获取当前的行
- row = @index/@column_max
- # 当前行被显示开头行前面的情况下
- if row < self.top_row
- # 从当前行向开头行滚动
- self.top_row = row
- end
- # 当前行被显示末尾行之后的情况下
- if row > self.top_row + (self.page_row_max - 1)
- # 从当前行向末尾滚动
- self.top_row = row - (self.page_row_max - 1)
- end
-
- @right.y = self.y+12+self.top_row.to_f*120.0*(3*120)/(@item_max.to_f*120)
-
- # 计算光标的宽度
- cursor_width = 240
- # 计算光标坐标
- x = @index%4*86+2
- y = @index/4-self.oy/120
- # 更新光标矩形
- self.cursor_rect.set(@index%4*84+2,(@index/4-self.oy/120)*120-1,85,120)
- #self.cursor_rect.set(x, y, 86, 120)
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update
- super
- # 可以移动光标的情况下
- if self.active and @item_max >= 0 and @index >= 0
- # 方向键下被按下的情况下
- if Input.repeat?(Input::LEFT)#DOWN上
- # 光标向下移动
- $game_system.se_play($data_system.cursor_se)
- @index = (@index-1+@item_max) % @item_max if @item_max != 0
- update_help
- end
- # 方向键上被按下的情况下
- if Input.repeat?(Input::RIGHT)#UP下
- # 光标向上移动
- $game_system.se_play($data_system.cursor_se)
- @index = (@index+1+@item_max) % @item_max if @item_max != 0
- update_help
- end
-
- end
- # 可以移动光标的情况下
- if self.active and @item_max > 0 and @item_max <= 40 #and @index >= 0
- # 方向键下被按下的情况下
- if Input.repeat?(Input::DOWN)#DOWN上
- # 光标向下移动
- $game_system.se_play($data_system.cursor_se)
- @index +=4 #(@index+1+@item_max) % @item_max if @item_max != 0
- update_help
- end
- end
- # 方向键上被按下的情况下
- if self.active and @item_max <= 43 and @index<=40#@item_max
- if Input.repeat?(Input::UP)#UP下
- # 光标向上移动
- $game_system.se_play($data_system.cursor_se)
- @index -=4 #(@index-1+@item_max) % @item_max if @item_max != 0
- update_help
- end
-
- end
- # --------------------------------------------------------------------------
- # 刷新帮助文本 (update_help 定义了继承目标)
-
-
- # def update_lrb
- # if RInput.trigger?(RInput::LEFT) and @caret_pos > 0
- # @caret_pos -= 1
- # return
- # end
- # if RInput.trigger?(RInput::RIGHT) and @caret_pos < @text.size
- # @caret_pos += 1
- # return
- # end
- # end
- #------------------------------------------------------------------------------
-
- if @help_window != nil and @ajsdgfshfajklshfa == nil
- update_help
- update_help
- @ajsdgfshfajklshfa = true
- end
- # 刷新光标矩形
- update_cursor_rect
- end
-
-
- def now_selected_troop
- return @all_fighters[@index]
- end
-
- #--------------------------------------------------------------------------
- # ● 刷新帮助文本
- #--------------------------------------------------------------------------
- def update_help
- #鲜辣煎鱼
- @help_window.set_text( @index>-1 ? self.item : nil )
-
- end
- end
复制代码
#============================================================================== # ■ Window_Title_Command #------------------------------------------------------------------------------ # 标题的主菜单。 #============================================================================== #类窗口自定义战斗<基础窗口 class Window_CustomBattle < Window_Base # attr_reader :index #属性读取器:索引 attr_reader :v_index #属性读取器:v_索引 attr_reader :slide_over #属性读取器:#滚动结束 attr_reader :item_max #属性阅读器:项目最大值 attr_reader :second_index #属性阅读器: 第二个索引 #start load option exit #-------------------------------------------------------------------------- # ● 初始化对像 # actor : 角色 #-------------------------------------------------------------------------- #定义初始化(索引=0,团队编号=5,点编号=10,玩家或敌人=0) def initialize(index=0,team_num = 5,spots_num = 10,player_or_enermy = 0) @index = index #@索引=索引 @v_index = 0 #@v_索引=0 #@玩家或敌人 = 玩家或敌人 @player_or_enermy = player_or_enermy #@file_name #选项背景 @button_base = Sprite.new #@按钮_底座=新的精灵 if player_or_enermy == 0 #@按钮_底座位图 = RPG::Cache.title("绿色背景图") @button_base.bitmap = RPG::Cache.title("selected-unites-base") else #@按钮_底座位图 = RPG::Cache.title("红色背景图") @button_base.bitmap = RPG::Cache.title("selected-unites-e-base") end @button_base.x = origin_x @button_base.y = origin_y @finish_button = Sprite.new #@完成按钮=精灵.new #if player_or_enermy == 0 #@完成按钮位图= RPG::Cache.title("完成") @finish_button.bitmap = RPG::Cache.title("bottom-button-1-basic") # else # @finish_button.bitmap = RPG::Cache.title("bottom-button-1-basic-e") # end @finish_button.x = origin_x + 16 @finish_button.y = origin_y + 187 @able = []#@表=[] @max_row = 2 #@最大行=2 @bottom_buttons = [] #@底部按钮=[] @max_item_row_2 = 3 #@最大项目行2=3 @delete_button = Sprite.new #@删除按钮=精灵新 #@删除按钮位图=RPG::Cache.title("删除按钮") @delete_button.bitmap = RPG::Cache.title("bottom-button-2-basic") @delete_button.x = origin_x @delete_button.y = origin_y # @清空按钮=精灵.new @empty_button = Sprite.new # @清空按钮位图= RPG::Cache.title("清空按钮") @empty_button.bitmap = RPG::Cache.title("bottom-button-3-basic") @empty_button.x = origin_x @empty_button.y = origin_y @bottom_buttons.push @finish_button# @底部按钮。按下完成按钮 @bottom_buttons.push @delete_button# @底部按钮。按下删除按钮 @bottom_buttons.push @empty_button # @底部按钮。按下清空按钮 @second_index = @index #@第二个索引=@索引 @cur_back = [] #选项背景 = [] @text_list = [] #@文本列表=[] @groups = [] #@组s=[] @group_text = [] #@组文本=[] @icons = [] #@图标 = [] @selected_units = [] #@选定的单位=[] for i in 0..team_num-1 #对于0中的我..团队编号-1 @selected_units[i]=[] #@选定单位[i]=[] end adj_x = 0 # 调整_x=0 adj_y = 0 # 调整_y=0 #光标 @group_max = 5 # @组最大值=5 @item_max = spots_num # @项目最大值=点数量 #========================================= for i in 0...@item_max # 对于0中的i…@项目最大值 @icons[i] = Sprite.new # @图标[i]=精灵.new @cur_back[i] = Sprite.new #@选项背景[i]= 精灵.new #if player_or_enermy == 0 小兵头像背景 #@选项背景[i].位图 = RPG::Cache.title("黑色小方块") @cur_back[i].bitmap = RPG::Cache.title("unit-base-highlight")#+i.to_s) #else # @cur_back[i].bitmap = RPG::Cache.title("unit-base-highlight")#+i.to_s) #end if i == 100 # 如果 i == 10 adj_y = 43 # 调整_x=0 adj_x = -10 # 调整_y=0 end #@选项背景[i].x = 原始_x+56+43*(i+调整_x) @cur_back[i].x = origin_x + 56+43*(i+adj_x) #@选项背景[i].y = 原始_y+98+调整_y @cur_back[i].y = origin_y + 98 + adj_y #@图标[i].x = 原始_x + 56+43*(i+调整_x) @icons[i].x = origin_x + 156+187*(i+adj_x) #@图标[i].y = 原始_y + 98 + 调整_y @icons[i].y = origin_y + 98 + adj_y end for i in 0...@item_max # 对于0中的i…@项目最大值 @icons[i] = Sprite.new # @图标[i]=精灵.new @cur_back[i] = Sprite.new #@选项背景[i]= 精灵.new #if player_or_enermy == 0 小兵头像背景 #@选项背景[i].位图 = RPG::Cache.title("黑色小方块") @cur_back[i].bitmap = RPG::Cache.title("unit-base-highlight")#+i.to_s) if i == 10 # 如果 i == 10 adj_y = 86 # 调整_x=0 adj_x = -10 # 调整_y=0 end #@选项背景[i].x = 原点_x + 56+43*(i+调整_x) @cur_back[i].x = origin_x + 56+43*(i+adj_x) #@选项背景[i].y = 原点_y + 141 + 调整_y @cur_back[i].y = origin_y + 141 + adj_y #@图标[i].x = 原点_x + 56+43*(i+调整_x) @icons[i].x = origin_x + 56+43*(i+adj_x) #@图标[i].y = 原点_y + 141 + 调整_y @icons[i].y = origin_y + 141 + adj_y end #teams for i in 0..@group_max-1 #对于0中的i..@组最大值-1 @groups[i]= Sprite.new #@组s[i]=精灵.new if @player_or_enermy == 0 #如果 @ 玩家 或 敌军 ==0 #@组s[i]位图 = RPG::Cache.title("小组按键绿底图") @groups[i].bitmap = RPG::Cache.title("team-basic")#+i.to_s) else#否则 #@组s[i]位图 = RPG::Cache.title("小组按键红底图") @groups[i].bitmap = RPG::Cache.title("enermy-basic")#+i.to_s) end ##@组s[i].x = 原点_x + 16 + i*(56+3) @groups[i].x = origin_x + 16 + i*(56+3) #@组s[i].y = 原点_y + 120 @groups[i].y = origin_y + 120 @group_text[i]= Sprite.new #组文本[i]= 新的精灵 # 组文本 [i]位图 = RPG::Cache.title("队伍1---5"+(i+1).to_s) @group_text[i].bitmap = RPG::Cache.title("group"+(i+1).to_s) # 组文本 [i].x = 原点_x + 16 + i*(56+3) @group_text[i].x = origin_x + 16 + i*(56+3) # 组文本 [i].y = 原点_y + 120 @group_text[i].y = origin_y + 120 #@暗色[i] = 真 @able[i] = true end #对于我在团队编号..@组最大值-1 for i in team_num..@group_max-1 disable_item(i) #禁用项目(i) end super(0, 0, 0, 0) #色调 self.opacity = 0 #自己不透明度=0 self.active = true #自己活动=真 end def origin_x # 定义原点x return 271 end def origin_y return 205 end #-------------------------------------------------------------------------- # ● 一些方法的重载 #-------------------------------------------------------------------------- def dispose #定义释放 @button_base.dispose # @按钮底座。释放 @delete_button.dispose # @删除_按钮.dispose @empty_button.dispose # @清空按钮丢弃 @finish_button.dispose # @完成按钮.展开 for i in 0...@item_max # 对于0中的i…@项目最大值 @cur_back[i].dispose # @选页背景[i].dispose @icons[i].dispose # @icons[i].dispose end for i in 0..@group_max-1 # 对于0中的i…@队组最大值 @groups[i].dispose # @队组s[i].释放 @group_text[i].dispose # @group_text[i].dispose end super end def z=(z) super(z) @delete_button.z=z+1 @empty_button.z=z+1 @button_base.z=z @finish_button.z=z+5 for i in 0...@item_max @cur_back[i].z=z+1 @icons[i].z=z+4 end for i in 0..@group_max-1 @groups[i].z=z+1 @group_text[i].z=z+2 end end def x=(x) super(x) adj_x = 0 @button_base.x=x+origin_x @delete_button.x=x+origin_x @empty_button.x=x+origin_x @finish_button.x=x+origin_x+15 for i in 0...@item_max #@cur_back[i].x=x+origin_x if i == 5 #adj_y = 43 adj_x = -5 end @cur_back[i].x = origin_x + 56+43*(i+adj_x) + x @icons[i].x = origin_x + 56+87*(i+adj_x) + x + 5 # end for i in 0..@group_max-1 @groups[i].x=x + 16 + i*(56+3) + origin_x @group_text[i].x=x + 16 + i*(56+3) + origin_x end end # def y=(y) super(y) adj_y = 0 @button_base.y=y @delete_button.y=y @empty_button.y=y @finish_button.y=y+origin_y-15 #+190 for i in 0...@item_max if i == 5 adj_y = 43 #adj_x = -5 end @cur_back[i].y = 98 + adj_y + y @icons[i].y = 98 + adj_y + y + 5 end for i in 0..@group_max-1 @groups[i].y=y + 49 @group_text[i].y=y + 49 end end def visible=(visible) super(visible) @button_base.visible = visible @delete_button.visible = visible @empty_button.visible = visible @finish_button.visible = visible for i in 0...@item_max @cur_back[i].visible = visible @icons[i].visible = visible end for i in 0..@group_max-1 @groups[i].visible = visible @group_text[i].visible = visible end end def contents_opacity=(opacity) super(opacity) @button_base.opacity = opacity @delete_button.opacity = opacity @empty_button.opacity = opacity @finish_button.opacity = opacity for i in 0...@item_max @cur_back[i].opacity = opacity @icons[i].opacity = opacity end for i in 0..@group_max-1 @groups[i].opacity = opacity @group_text[i].opacity = opacity end end def index=(index) @index=index end def disable_item(i) @able[i] = false if @player_or_enermy == 0 @groups[i].bitmap = RPG::Cache.title("team-disable")#+i.to_s) else @groups[i].bitmap = RPG::Cache.title("enermy-disable")#+i.to_s) end @group_text[i].bitmap = RPG::Cache.title("group"+(i+1).to_s+"-d") end def back_normal(index) #p index if @v_index == 0 if index != -1 if @player_or_enermy == 0 @groups[index].bitmap = RPG::Cache.title("team-basic")#+i.to_s) else @groups[index].bitmap = RPG::Cache.title("enermy-basic")#+i.to_s) end @group_text[index].bitmap = RPG::Cache.title("group"+(index+1).to_s) end @second_index = -1 for i in 0..@max_item_row_2-1 @bottom_buttons[i].bitmap = RPG::Cache.title("bottom-button-"+(i+1).to_s+"-basic")#+i.to_s) end else @bottom_buttons[index].bitmap = RPG::Cache.title("bottom-button-"+(index+1).to_s+"-basic")#+i.to_s) end end #-------------------------------------------------------------------------- # ● 更新光标矩形 #-------------------------------------------------------------------------- def update_cursor_rect if @v_index == 0 # 光标位置不满 0 的情况下 if @index < 0 for i in 0...@item_max back_normal(i) end return end if @player_or_enermy == 0 @groups[@index].bitmap = RPG::Cache.title("team-highlight")#+i.to_s) else @groups[@index].bitmap = RPG::Cache.title("enermy-highlight")#+i.to_s) end @group_text[@index].bitmap = RPG::Cache.title("group"+(index+1).to_s+"-l") else #level 2 if @second_index < 0 for i in 0..@max_item_row_2-1 back_normal(i) end return end #p @index,@second_index # @second_index%=2 完成 @bottom_buttons[@second_index].bitmap = RPG::Cache.title("bottom-button-"+(@second_index+1).to_s+"-l")#+i.to_s) end end #-------------------------------------------------------------------------- # ● 刷新画面 #-------------------------------------------------------------------------- def update if self.active if Input.repeat?(Input::DOWN) $game_system.se_play($data_system.cursor_se) @v_index = (@v_index+1)%@max_row #@last_index = @index if @v_index == 0 #back_normal(@second_index) @second_index = -1 for i in 0..@max_item_row_2-1 back_normal(i) end else #back_normal(@index) @second_index = 1 #@index%=@max_item_row_2 if @player_or_enermy == 0 @groups[@index].bitmap = RPG::Cache.title("team-basic")#+i.to_s) else @groups[@index].bitmap = RPG::Cache.title("enermy-basic")#+i.to_s) end end refresh end if Input.repeat?(Input::UP) $game_system.se_play($data_system.cursor_se) #back_normal(@index) @v_index = (@v_index-1)%@max_row # @last_index = @index if @v_index == 0 #back_normal(@second_index) @second_index = -1 for i in 0..@max_item_row_2-1 back_normal(i) end else #back_normal(@index) @second_index = 1 #@index%=@max_item_row_2 if @player_or_enermy == 0 #队伍1-5背景 @groups[@index].bitmap = RPG::Cache.title("team-basic")#+i.to_s) else # 敌人队伍1-5背景 @groups[@index].bitmap = RPG::Cache.title("enermy-basic")#+i.to_s) end end refresh end if @v_index == 0 # 方向键左被按下的情况下 if Input.repeat?(Input::RIGHT) $game_system.se_play($data_system.cursor_se) back_normal(@index) @index = (@index+1)%@group_max until @able[@index] @index = (@index+1)%@group_max end refresh end # 方向键右被按下的情况下 if Input.repeat?(Input::LEFT) $game_system.se_play($data_system.cursor_se) back_normal(@index) @index = (@index+@item_max-1)%@group_max until @able[@index] @index = (@index+@item_max-1)%@group_max end refresh end else # level 2 # 方向键左被按下的情况下 if Input.repeat?(Input::RIGHT) $game_system.se_play($data_system.cursor_se) back_normal(@second_index) @second_index = (@second_index+1)%@max_item_row_2 #p @second_index refresh end # 方向键右被按下的情况下 if Input.repeat?(Input::LEFT) $game_system.se_play($data_system.cursor_se) back_normal(@second_index) @second_index = (@second_index-1)%@max_item_row_2 refresh end end # @v_index == 0 end update_cursor_rect #if @slide_over end #-------------------------------------------------------------------------- # ● 获取东西 #-------------------------------------------------------------------------- def item_num(index = @index) # 定义项目 (索引=@索引) return @selected_units[@index].size end def set_units(a) @selected_units = a end #-------------------------------------------------------------------------- # ● 更新内容 #-------------------------------------------------------------------------- def refresh for i in 0...@item_max @icons[i].bitmap = nil end #对于i,单位为0..@选定的单位[@索引]。大小-1 for i in 0..@selected_units[@index].size-1 @icons[i].bitmap = RPG::Cache.icon(Figter_data::CHARACTER_NAME[@selected_units[@index][i]]) #p Figter_data::CHARACTER_NAME[twoArray[@index][i]] end end #-------------------------------------------------------------------------- # ● 删除士兵 #-------------------------------------------------------------------------- def delete_last_troop @selected_units[@index].pop refresh end #-------------------------------------------------------------------------- # ● 清空士兵 #-------------------------------------------------------------------------- def empty_troops @selected_units[@index]=[] refresh end end
#==============================================================================
# ■ Window_Title_Command
#------------------------------------------------------------------------------
# 标题的主菜单。
#==============================================================================
#类窗口自定义战斗<基础窗口
class Window_CustomBattle < Window_Base #
attr_reader :index #属性读取器:索引
attr_reader :v_index #属性读取器:v_索引
attr_reader :slide_over #属性读取器:#滚动结束
attr_reader :item_max #属性阅读器:项目最大值
attr_reader :second_index #属性阅读器: 第二个索引
#start load option exit
#--------------------------------------------------------------------------
# ● 初始化对像
# actor : 角色
#--------------------------------------------------------------------------
#定义初始化(索引=0,团队编号=5,点编号=10,玩家或敌人=0)
def initialize(index=0,team_num = 5,spots_num = 10,player_or_enermy = 0)
@index = index #@索引=索引
@v_index = 0 #@v_索引=0
#@玩家或敌人 = 玩家或敌人
@player_or_enermy = player_or_enermy
#@file_name
#选项背景
@button_base = Sprite.new #@按钮_底座=新的精灵
if player_or_enermy == 0
#@按钮_底座位图 = RPG::Cache.title("绿色背景图")
@button_base.bitmap = RPG::Cache.title("selected-unites-base")
else
#@按钮_底座位图 = RPG::Cache.title("红色背景图")
@button_base.bitmap = RPG::Cache.title("selected-unites-e-base")
end
@button_base.x = origin_x
@button_base.y = origin_y
@finish_button = Sprite.new #@完成按钮=精灵.new
#if player_or_enermy == 0
#@完成按钮位图= RPG::Cache.title("完成")
@finish_button.bitmap = RPG::Cache.title("bottom-button-1-basic")
# else
# @finish_button.bitmap = RPG::Cache.title("bottom-button-1-basic-e")
# end
@finish_button.x = origin_x + 16
@finish_button.y = origin_y + 187
@able = []#@表=[]
@max_row = 2 #@最大行=2
@bottom_buttons = [] #@底部按钮=[]
@max_item_row_2 = 3 #@最大项目行2=3
@delete_button = Sprite.new #@删除按钮=精灵新
#@删除按钮位图=RPG::Cache.title("删除按钮")
@delete_button.bitmap = RPG::Cache.title("bottom-button-2-basic")
@delete_button.x = origin_x
@delete_button.y = origin_y
# @清空按钮=精灵.new
@empty_button = Sprite.new
# @清空按钮位图= RPG::Cache.title("清空按钮")
@empty_button.bitmap = RPG::Cache.title("bottom-button-3-basic")
@empty_button.x = origin_x
@empty_button.y = origin_y
@bottom_buttons.push @finish_button# @底部按钮。按下完成按钮
@bottom_buttons.push @delete_button# @底部按钮。按下删除按钮
@bottom_buttons.push @empty_button # @底部按钮。按下清空按钮
@second_index = @index #@第二个索引=@索引
@cur_back = [] #选项背景 = []
@text_list = [] #@文本列表=[]
@groups = [] #@组s=[]
@group_text = [] #@组文本=[]
@icons = [] #@图标 = []
@selected_units = [] #@选定的单位=[]
for i in 0..team_num-1 #对于0中的我..团队编号-1
@selected_units[i]=[] #@选定单位[i]=[]
end
adj_x = 0 # 调整_x=0
adj_y = 0 # 调整_y=0
#光标
@group_max = 5 # @组最大值=5
@item_max = spots_num # @项目最大值=点数量 #=========================================
for i in 0...@item_max # 对于0中的i…@项目最大值
@icons[i] = Sprite.new # @图标[i]=精灵.new
@cur_back[i] = Sprite.new #@选项背景[i]= 精灵.new
#if player_or_enermy == 0 小兵头像背景
#@选项背景[i].位图 = RPG::Cache.title("黑色小方块")
@cur_back[i].bitmap = RPG::Cache.title("unit-base-highlight")#+i.to_s)
#else
# @cur_back[i].bitmap = RPG::Cache.title("unit-base-highlight")#+i.to_s)
#end
if i == 100 # 如果 i == 10
adj_y = 43 # 调整_x=0
adj_x = -10 # 调整_y=0
end
#@选项背景[i].x = 原始_x+56+43*(i+调整_x)
@cur_back[i].x = origin_x + 56+43*(i+adj_x)
#@选项背景[i].y = 原始_y+98+调整_y
@cur_back[i].y = origin_y + 98 + adj_y
#@图标[i].x = 原始_x + 56+43*(i+调整_x)
@icons[i].x = origin_x + 156+187*(i+adj_x)
#@图标[i].y = 原始_y + 98 + 调整_y
@icons[i].y = origin_y + 98 + adj_y
end
for i in 0...@item_max # 对于0中的i…@项目最大值
@icons[i] = Sprite.new # @图标[i]=精灵.new
@cur_back[i] = Sprite.new #@选项背景[i]= 精灵.new
#if player_or_enermy == 0 小兵头像背景
#@选项背景[i].位图 = RPG::Cache.title("黑色小方块")
@cur_back[i].bitmap = RPG::Cache.title("unit-base-highlight")#+i.to_s)
if i == 10 # 如果 i == 10
adj_y = 86 # 调整_x=0
adj_x = -10 # 调整_y=0
end
#@选项背景[i].x = 原点_x + 56+43*(i+调整_x)
@cur_back[i].x = origin_x + 56+43*(i+adj_x)
#@选项背景[i].y = 原点_y + 141 + 调整_y
@cur_back[i].y = origin_y + 141 + adj_y
#@图标[i].x = 原点_x + 56+43*(i+调整_x)
@icons[i].x = origin_x + 56+43*(i+adj_x)
#@图标[i].y = 原点_y + 141 + 调整_y
@icons[i].y = origin_y + 141 + adj_y
end
#teams
for i in 0..@group_max-1 #对于0中的i..@组最大值-1
@groups[i]= Sprite.new #@组s[i]=精灵.new
if @player_or_enermy == 0 #如果 @ 玩家 或 敌军 ==0
#@组s[i]位图 = RPG::Cache.title("小组按键绿底图")
@groups[i].bitmap = RPG::Cache.title("team-basic")#+i.to_s)
else#否则
#@组s[i]位图 = RPG::Cache.title("小组按键红底图")
@groups[i].bitmap = RPG::Cache.title("enermy-basic")#+i.to_s)
end
##@组s[i].x = 原点_x + 16 + i*(56+3)
@groups[i].x = origin_x + 16 + i*(56+3)
#@组s[i].y = 原点_y + 120
@groups[i].y = origin_y + 120
@group_text[i]= Sprite.new #组文本[i]= 新的精灵
# 组文本 [i]位图 = RPG::Cache.title("队伍1---5"+(i+1).to_s)
@group_text[i].bitmap = RPG::Cache.title("group"+(i+1).to_s)
# 组文本 [i].x = 原点_x + 16 + i*(56+3)
@group_text[i].x = origin_x + 16 + i*(56+3)
# 组文本 [i].y = 原点_y + 120
@group_text[i].y = origin_y + 120
#@暗色[i] = 真
@able[i] = true
end
#对于我在团队编号..@组最大值-1
for i in team_num..@group_max-1
disable_item(i) #禁用项目(i)
end
super(0, 0, 0, 0) #色调
self.opacity = 0 #自己不透明度=0
self.active = true #自己活动=真
end
def origin_x # 定义原点x
return 271
end
def origin_y
return 205
end
#--------------------------------------------------------------------------
# ● 一些方法的重载
#--------------------------------------------------------------------------
def dispose #定义释放
@button_base.dispose # @按钮底座。释放
@delete_button.dispose # @删除_按钮.dispose
@empty_button.dispose # @清空按钮丢弃
@finish_button.dispose # @完成按钮.展开
for i in 0...@item_max # 对于0中的i…@项目最大值
@cur_back[i].dispose # @选页背景[i].dispose
@icons[i].dispose # @icons[i].dispose
end
for i in 0..@group_max-1 # 对于0中的i…@队组最大值
@groups[i].dispose # @队组s[i].释放
@group_text[i].dispose # @group_text[i].dispose
end
super
end
def z=(z)
super(z)
@delete_button.z=z+1
@empty_button.z=z+1
@button_base.z=z
@finish_button.z=z+5
for i in 0...@item_max
@cur_back[i].z=z+1
@icons[i].z=z+4
end
for i in 0..@group_max-1
@groups[i].z=z+1
@group_text[i].z=z+2
end
end
def x=(x)
super(x)
adj_x = 0
@button_base.x=x+origin_x
@delete_button.x=x+origin_x
@empty_button.x=x+origin_x
@finish_button.x=x+origin_x+15
for i in 0...@item_max
#@cur_back[i].x=x+origin_x
if i == 5
#adj_y = 43
adj_x = -5
end
@cur_back[i].x = origin_x + 56+43*(i+adj_x) + x
@icons[i].x = origin_x + 56+87*(i+adj_x) + x + 5
#
end
for i in 0..@group_max-1
@groups[i].x=x + 16 + i*(56+3) + origin_x
@group_text[i].x=x + 16 + i*(56+3) + origin_x
end
end #
def y=(y)
super(y)
adj_y = 0
@button_base.y=y
@delete_button.y=y
@empty_button.y=y
@finish_button.y=y+origin_y-15 #+190
for i in 0...@item_max
if i == 5
adj_y = 43
#adj_x = -5
end
@cur_back[i].y = 98 + adj_y + y
@icons[i].y = 98 + adj_y + y + 5
end
for i in 0..@group_max-1
@groups[i].y=y + 49
@group_text[i].y=y + 49
end
end
def visible=(visible)
super(visible)
@button_base.visible = visible
@delete_button.visible = visible
@empty_button.visible = visible
@finish_button.visible = visible
for i in 0...@item_max
@cur_back[i].visible = visible
@icons[i].visible = visible
end
for i in 0..@group_max-1
@groups[i].visible = visible
@group_text[i].visible = visible
end
end
def contents_opacity=(opacity)
super(opacity)
@button_base.opacity = opacity
@delete_button.opacity = opacity
@empty_button.opacity = opacity
@finish_button.opacity = opacity
for i in 0...@item_max
@cur_back[i].opacity = opacity
@icons[i].opacity = opacity
end
for i in 0..@group_max-1
@groups[i].opacity = opacity
@group_text[i].opacity = opacity
end
end
def index=(index)
@index=index
end
def disable_item(i)
@able[i] = false
if @player_or_enermy == 0
@groups[i].bitmap = RPG::Cache.title("team-disable")#+i.to_s)
else
@groups[i].bitmap = RPG::Cache.title("enermy-disable")#+i.to_s)
end
@group_text[i].bitmap = RPG::Cache.title("group"+(i+1).to_s+"-d")
end
def back_normal(index)
#p index
if @v_index == 0
if index != -1
if @player_or_enermy == 0
@groups[index].bitmap = RPG::Cache.title("team-basic")#+i.to_s)
else
@groups[index].bitmap = RPG::Cache.title("enermy-basic")#+i.to_s)
end
@group_text[index].bitmap = RPG::Cache.title("group"+(index+1).to_s)
end
@second_index = -1
for i in 0..@max_item_row_2-1
@bottom_buttons[i].bitmap = RPG::Cache.title("bottom-button-"+(i+1).to_s+"-basic")#+i.to_s)
end
else
@bottom_buttons[index].bitmap = RPG::Cache.title("bottom-button-"+(index+1).to_s+"-basic")#+i.to_s)
end
end
#--------------------------------------------------------------------------
# ● 更新光标矩形
#--------------------------------------------------------------------------
def update_cursor_rect
if @v_index == 0
# 光标位置不满 0 的情况下
if @index < 0
for i in 0...@item_max
back_normal(i)
end
return
end
if @player_or_enermy == 0
@groups[@index].bitmap = RPG::Cache.title("team-highlight")#+i.to_s)
else
@groups[@index].bitmap = RPG::Cache.title("enermy-highlight")#+i.to_s)
end
@group_text[@index].bitmap = RPG::Cache.title("group"+(index+1).to_s+"-l")
else #level 2
if @second_index < 0
for i in 0..@max_item_row_2-1
back_normal(i)
end
return
end
#p @index,@second_index
# @second_index%=2 完成
@bottom_buttons[@second_index].bitmap = RPG::Cache.title("bottom-button-"+(@second_index+1).to_s+"-l")#+i.to_s)
end
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
if self.active
if Input.repeat?(Input::DOWN)
$game_system.se_play($data_system.cursor_se)
@v_index = (@v_index+1)%@max_row
#@last_index = @index
if @v_index == 0
#back_normal(@second_index)
@second_index = -1
for i in 0..@max_item_row_2-1
back_normal(i)
end
else
#back_normal(@index)
@second_index = 1
#@index%=@max_item_row_2
if @player_or_enermy == 0
@groups[@index].bitmap = RPG::Cache.title("team-basic")#+i.to_s)
else
@groups[@index].bitmap = RPG::Cache.title("enermy-basic")#+i.to_s)
end
end
refresh
end
if Input.repeat?(Input::UP)
$game_system.se_play($data_system.cursor_se)
#back_normal(@index)
@v_index = (@v_index-1)%@max_row
# @last_index = @index
if @v_index == 0
#back_normal(@second_index)
@second_index = -1
for i in 0..@max_item_row_2-1
back_normal(i)
end
else
#back_normal(@index)
@second_index = 1
#@index%=@max_item_row_2
if @player_or_enermy == 0 #队伍1-5背景
@groups[@index].bitmap = RPG::Cache.title("team-basic")#+i.to_s)
else # 敌人队伍1-5背景
@groups[@index].bitmap = RPG::Cache.title("enermy-basic")#+i.to_s)
end
end
refresh
end
if @v_index == 0
# 方向键左被按下的情况下
if Input.repeat?(Input::RIGHT)
$game_system.se_play($data_system.cursor_se)
back_normal(@index)
@index = (@index+1)%@group_max
until @able[@index]
@index = (@index+1)%@group_max
end
refresh
end
# 方向键右被按下的情况下
if Input.repeat?(Input::LEFT)
$game_system.se_play($data_system.cursor_se)
back_normal(@index)
@index = (@index+@item_max-1)%@group_max
until @able[@index]
@index = (@index+@item_max-1)%@group_max
end
refresh
end
else # level 2
# 方向键左被按下的情况下
if Input.repeat?(Input::RIGHT)
$game_system.se_play($data_system.cursor_se)
back_normal(@second_index)
@second_index = (@second_index+1)%@max_item_row_2
#p @second_index
refresh
end
# 方向键右被按下的情况下
if Input.repeat?(Input::LEFT)
$game_system.se_play($data_system.cursor_se)
back_normal(@second_index)
@second_index = (@second_index-1)%@max_item_row_2
refresh
end
end # @v_index == 0
end
update_cursor_rect #if @slide_over
end
#--------------------------------------------------------------------------
# ● 获取东西
#--------------------------------------------------------------------------
def item_num(index = @index) # 定义项目 (索引=@索引)
return @selected_units[@index].size
end
def set_units(a)
@selected_units = a
end
#--------------------------------------------------------------------------
# ● 更新内容
#--------------------------------------------------------------------------
def refresh
for i in 0...@item_max
@icons[i].bitmap = nil
end
#对于i,单位为0..@选定的单位[@索引]。大小-1
for i in 0..@selected_units[@index].size-1
@icons[i].bitmap = RPG::Cache.icon(Figter_data::CHARACTER_NAME[@selected_units[@index][i]])
#p Figter_data::CHARACTER_NAME[twoArray[@index][i]]
end
end
#--------------------------------------------------------------------------
# ● 删除士兵
#--------------------------------------------------------------------------
def delete_last_troop
@selected_units[@index].pop
refresh
end
#--------------------------------------------------------------------------
# ● 清空士兵
#--------------------------------------------------------------------------
def empty_troops
@selected_units[@index]=[]
refresh
end
end
class Scene_Map def command_custom_battle#定义命令_自定义战斗 # 演奏确定 SE $game_system.se_play($data_system.decision_se) #$游戏系统。se播放($数据系统。未指定文件或目录 choose_map_main#选择主地图 # map_info = $custom_battle_next_map_id#@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精选部队 enermy_selected_troops =[[5,21],[18,21,21],[19,21],[21,21,21],[16,21,21,21,21] ] #@selected_units # @group_one.x = 928 # @group_one.y = 544 # @group_two.x = 1248 # @group_two.y = 640 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 = nil #selected_hero = @selected_hero#选定的英雄=@选定的英雄 #如果@强制后退或@强制后退==无 if ! @force_back or @force_back == nil team_army = Game_Army_Slg.new(0) #enermy军队 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) 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 #$自定义战斗下一个地图ID=16 $custom_battle_next_map_id = 16#map_info[0] #if $game_switches[19] == true # a = [1, 2, 3, 5, 8] # $custom_battle_next_map_id = a[rand(a.size)] # end $game_party.setup_starting_members#游戏部分设置启动成员 # 设置初期位置的地图##############1356622 $game_map.setup(5) # 主角向初期位置移动 $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#EFS标题更新 end else # third @force_back = false#@强制后退=错误 Graphics.update#图形更新 efs_title_update#EFS标题更新 end else # second @force_back = false#@强制后退=错误 Graphics.update#图形更新 efs_title_update#EFS标题更新 end else #1st @force_back = false#@强制后退=错误 Graphics.update#图形更新 efs_title_update#EFS标题更新 end end end
class Scene_Map
def command_custom_battle#定义命令_自定义战斗
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
#$游戏系统。se播放($数据系统。未指定文件或目录
choose_map_main#选择主地图
# map_info = $custom_battle_next_map_id#@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精选部队
enermy_selected_troops =[[5,21],[18,21,21],[19,21],[21,21,21],[16,21,21,21,21] ] #@selected_units
# @group_one.x = 928
# @group_one.y = 544
# @group_two.x = 1248
# @group_two.y = 640
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 = nil
#selected_hero = @selected_hero#选定的英雄=@选定的英雄
#如果@强制后退或@强制后退==无
if ! @force_back or @force_back == nil
team_army = Game_Army_Slg.new(0)
#enermy军队
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)
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
#$自定义战斗下一个地图ID=16
$custom_battle_next_map_id = 16#map_info[0]
#if $game_switches[19] == true
# a = [1, 2, 3, 5, 8]
# $custom_battle_next_map_id = a[rand(a.size)]
# end
$game_party.setup_starting_members#游戏部分设置启动成员
# 设置初期位置的地图##############1356622
$game_map.setup(5)
# 主角向初期位置移动
$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#EFS标题更新
end
else # third
@force_back = false#@强制后退=错误
Graphics.update#图形更新
efs_title_update#EFS标题更新
end
else # second
@force_back = false#@强制后退=错误
Graphics.update#图形更新
efs_title_update#EFS标题更新
end
else #1st
@force_back = false#@强制后退=错误
Graphics.update#图形更新
efs_title_update#EFS标题更新
end
end
end
module Figter_data#::ALL_SOLDIER #所有士兵 ALL_SOLDIER =[5,4,3,13,2,9,11,15,26,23, #帝国 32,35,36,28,30,33,34, #诺尔森人 7,8,19,12,31,38,17, #雇佣兵 27,6,10,14,16,18,21,22,29,39] #野怪 #所有英雄 ALL_HERO = [ 20,24,25,37] end
module Figter_data#::ALL_SOLDIER
#所有士兵
ALL_SOLDIER =[5,4,3,13,2,9,11,15,26,23, #帝国
32,35,36,28,30,33,34, #诺尔森人
7,8,19,12,31,38,17, #雇佣兵
27,6,10,14,16,18,21,22,29,39] #野怪
#所有英雄
ALL_HERO = [ 20,24,25,37]
end
module Figter_data data_id = 4 #=====基本、模型信息========== CHARACTER_NAME[data_id] = "E_ManAtArm" #头像模型名字 ATK_SE[data_id] = "spearbasic_0" #攻击音效 (击中) ATK_SE_NUM[data_id] = 9 #攻击音效数量 DEF_SE[data_id] = "shield_wood_wood_0" DEF_SE_NUM[data_id] = 9 S_ATK_SE[data_id] = nil #远程攻击音效 (击中) S_ATK_SE_NUM[data_id] = nil #远程攻击音效数量 AMMO_NAME[data_id] = nil #弹药模型名字 AMMO_D_NAME[data_id] = nil #落地后的弹药模型名字 S_SHOOT_SE[data_id] = nil #射击音效 S_SHOOT_SE_NUM[data_id] = nil #射击音效数量 S_PASSBY_SE[data_id] = nil S_PASSBY_SE_NUM[data_id] = nil S_DROP_SE[data_id] = nil S_DROP_SE_NUM[data_id] = nil S_FLY_TYPE[data_id] = nil #=======类别================= THE_NAME[data_id] = "帝国军士" #显示名字 IS_CAL[data_id] = false #是骑兵吗 IS_ARC[data_id] = false #是远程兵吗 HEAVY[data_id] = false #是重装兵吗 LABEL[data_id] = 1 #兵种标签 DESCRIPTION[data_id] = "赫西帝国步兵,中装步兵,配有克制骑兵的长矛,制式盾牌" #==========属性============== HP_MAX[data_id] = 375 #血量上限 AMMOR_HP[data_id] = 30 #护甲值 SHD_HP[data_id] = 25 #盾甲值 BASE_ATK[data_id] = 65 #基本攻击力 BRO_ATK[data_id] = 10 #破甲攻击力 S_BASE_ATK[data_id] = 0 #远程基本攻击力 S_BRO_ATK[data_id] = 0 #远程破甲攻击力 ATK_SKILL[data_id] = 25 #攻击技巧 DEF_SKILL[data_id] = 35 #防御技巧 ANTI_CAV[data_id] = 75 #反骑兵伤害加成 ANTI_INF[data_id] = 0 #反步兵伤害加成 CHARGE_BOUN[data_id]=30 #冲锋加成 MORALE[data_id] = 50 #士气 (100max) CRITICAL_HIT[data_id] = 10 #暴击率 EXPLOSION_SETTINGS[data_id] = nil #伤害是否有爆破特效,若有则设置 #(中心X,中心Y,中心伤害,范围,施放者,队伍不受(0是所有人受)是否留垃圾 ATK_FR[data_id] = 30 #攻击频率 ATK_RANGE[data_id] = 1 #攻击范围 ENGAGE_RANGE[data_id] = 1 #交战范围 ENGAGE_RANGE_MIN[data_id] = 1 MOVEMENT_SPEED[data_id] = 3 #移动速度 ACCURATCY[data_id] = 100 #精确度 LIVE_CHANCE[data_id] = 20 #生还几率 AMMO_MAX[data_id] = 0 #弹药上线 ATK_CODE[data_id] = nil #特殊代码(攻击后执行) #===========战略用============= EXP[data_id] = 2 #击杀获得经验 PRICE[data_id] = 100 #价格 EXP_NEED[data_id] = 10 #升级所需经验 NEXT_LEVEL[data_id] = [9] #下一阶兵种 CAPTAIN_SKILL[data_id] = nil end
module Figter_data
data_id = 4
#=====基本、模型信息==========
CHARACTER_NAME[data_id] = "E_ManAtArm" #头像模型名字
ATK_SE[data_id] = "spearbasic_0" #攻击音效 (击中)
ATK_SE_NUM[data_id] = 9 #攻击音效数量
DEF_SE[data_id] = "shield_wood_wood_0"
DEF_SE_NUM[data_id] = 9
S_ATK_SE[data_id] = nil #远程攻击音效 (击中)
S_ATK_SE_NUM[data_id] = nil #远程攻击音效数量
AMMO_NAME[data_id] = nil #弹药模型名字
AMMO_D_NAME[data_id] = nil #落地后的弹药模型名字
S_SHOOT_SE[data_id] = nil #射击音效
S_SHOOT_SE_NUM[data_id] = nil #射击音效数量
S_PASSBY_SE[data_id] = nil
S_PASSBY_SE_NUM[data_id] = nil
S_DROP_SE[data_id] = nil
S_DROP_SE_NUM[data_id] = nil
S_FLY_TYPE[data_id] = nil
#=======类别=================
THE_NAME[data_id] = "帝国军士" #显示名字
IS_CAL[data_id] = false #是骑兵吗
IS_ARC[data_id] = false #是远程兵吗
HEAVY[data_id] = false #是重装兵吗
LABEL[data_id] = 1 #兵种标签
DESCRIPTION[data_id] = "赫西帝国步兵,中装步兵,配有克制骑兵的长矛,制式盾牌"
#==========属性==============
HP_MAX[data_id] = 375 #血量上限
AMMOR_HP[data_id] = 30 #护甲值
SHD_HP[data_id] = 25 #盾甲值
BASE_ATK[data_id] = 65 #基本攻击力
BRO_ATK[data_id] = 10 #破甲攻击力
S_BASE_ATK[data_id] = 0 #远程基本攻击力
S_BRO_ATK[data_id] = 0 #远程破甲攻击力
ATK_SKILL[data_id] = 25 #攻击技巧
DEF_SKILL[data_id] = 35 #防御技巧
ANTI_CAV[data_id] = 75 #反骑兵伤害加成
ANTI_INF[data_id] = 0 #反步兵伤害加成
CHARGE_BOUN[data_id]=30 #冲锋加成
MORALE[data_id] = 50 #士气 (100max)
CRITICAL_HIT[data_id] = 10 #暴击率
EXPLOSION_SETTINGS[data_id] = nil #伤害是否有爆破特效,若有则设置
#(中心X,中心Y,中心伤害,范围,施放者,队伍不受(0是所有人受)是否留垃圾
ATK_FR[data_id] = 30 #攻击频率
ATK_RANGE[data_id] = 1 #攻击范围
ENGAGE_RANGE[data_id] = 1 #交战范围
ENGAGE_RANGE_MIN[data_id] = 1
MOVEMENT_SPEED[data_id] = 3 #移动速度
ACCURATCY[data_id] = 100 #精确度
LIVE_CHANCE[data_id] = 20 #生还几率
AMMO_MAX[data_id] = 0 #弹药上线
ATK_CODE[data_id] = nil #特殊代码(攻击后执行)
#===========战略用=============
EXP[data_id] = 2 #击杀获得经验
PRICE[data_id] = 100 #价格
EXP_NEED[data_id] = 10 #升级所需经验
NEXT_LEVEL[data_id] = [9] #下一阶兵种
CAPTAIN_SKILL[data_id] = nil
end
|
|