设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1260|回复: 25
打印 上一主题 下一主题

[有事请教] [以解决]如何通过角色的名字获得角色的id

[复制链接]

Lv4.逐梦者

梦石
0
星屑
6296
在线时间
1104 小时
注册时间
2015-8-15
帖子
658
跳转到指定楼层
1
发表于 2023-8-15 08:34:11 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
本帖最后由 金芒芒 于 2023-8-15 19:55 编辑

模型角色data
data_id = 1
CHARACTER_NAME[data_id]= =  "甲"
#---------------------------------------------
模型角色data
data_id = 2
CHARACTER_NAME[data_id]= =  "乙"
#---------------------------------------------
模型角色data
data_id = 3
CHARACTER_NAME[data_id]= =  "丙"
#---------------------------------------------
模型角色data
data_id = 4
CHARACTER_NAME[data_id]= =  "丁"
#---------------------------------------------
模型角色data
data_id = 5
CHARACTER_NAME[data_id]= =  "戊"
#---------------------------------------------
模型角色data
data_id = 6
CHARACTER_NAME[data_id]= =  "己"
#---------------------------------------------
模型角色data
data_id = 7
CHARACTER_NAME[data_id]= =  "庚"
#---------------------------------------------
模型角色data
data_id = 8
CHARACTER_NAME[data_id]= =  "辛"
#---------------------------------------------
模型角色data
data_id = 9
CHARACTER_NAME[data_id]= =  "壬"
#---------------------------------------------
模型角色data
data_id = 10
CHARACTER_NAME[data_id]= =  "癸"
#---------------------------------------------

@all_fighters = a
a=[1,2,3,4,5,6,7,8,9,10]#所有角色的id 1名称=甲  2名称=乙 3名称=丙 4名称=丁 5名称=戊 6名称=己 7名称=庚 8名称=辛 9名称=壬 10名称=癸
team_selected_troops = b
b[[乙],[丙],[丁],[戊],[己]] # b 索引( index) a中 的名称 且b=5个小数组   
如何当c= b[[乙],[丙],[丁],[戊],[己]]  且c= [[a],[a],[a],[a],[a]]       c=a(id)       #c= [[2,[3],[4],[5],[6]]     


for i in 0...@all_fighters.size
name = Figter_data::CHARACTER_NAME[@all_fighters [ i ]  ]
end


        

Lv4.逐梦者

梦石
0
星屑
6296
在线时间
1104 小时
注册时间
2015-8-15
帖子
658
2
 楼主| 发表于 2023-8-15 11:24:03 | 只看该作者
a是所有角色的id,b是所有角色的名字的出战小队,c=b出战小队名字相关的aID
c=a
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
33193
在线时间
10491 小时
注册时间
2009-3-15
帖子
4756
3
发表于 2023-8-15 13:20:49 | 只看该作者
本帖最后由 soulsaga 于 2023-8-15 14:01 编辑

你怎么问问题的..?
标题连问题都不是
别连问题都省略了
还有我不知道你为什么要用二维数组..
没必要的话用一维数组就行
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
6296
在线时间
1104 小时
注册时间
2015-8-15
帖子
658
4
 楼主| 发表于 2023-8-15 13:52:34 | 只看该作者
soulsaga 发表于 2023-8-15 13:20
你怎么问问题的..?
标题连问题都不是
别连问题都省略了

如何通过角色的名字获得角色的id
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
33193
在线时间
10491 小时
注册时间
2009-3-15
帖子
4756
5
发表于 2023-8-15 14:02:47 | 只看该作者
金芒芒 发表于 2023-8-15 13:52
如何通过角色的名字获得角色的id


你得发完整脚本..这样没法判断
发脚本用高级回复右边的双向箭头那添加代码文字发
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
6296
在线时间
1104 小时
注册时间
2015-8-15
帖子
658
6
 楼主| 发表于 2023-8-15 14:24:10 | 只看该作者
soulsaga 发表于 2023-8-15 14:02
你得发完整脚本..这样没法判断
发脚本用高级回复右边的双向箭头那添加代码文字发 ...

链接: https://pan.baidu.com/s/1KJn_NAhSX7Nx5LnkL2w1zA?pwd=727z 提取码: 727z 复制这段内容后打开百度网盘手机App,操作更方便哦
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
6296
在线时间
1104 小时
注册时间
2015-8-15
帖子
658
7
 楼主| 发表于 2023-8-15 14:30:34 | 只看该作者
soulsaga 发表于 2023-8-15 14:02
你得发完整脚本..这样没法判断
发脚本用高级回复右边的双向箭头那添加代码文字发 ...

没有完整脚本,多是问过来自己写的
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
6296
在线时间
1104 小时
注册时间
2015-8-15
帖子
658
8
 楼主| 发表于 2023-8-15 14:32:52 | 只看该作者
本帖最后由 金芒芒 于 2023-8-15 14:36 编辑
soulsaga 发表于 2023-8-15 14:02
你得发完整脚本..这样没法判断
发脚本用高级回复右边的双向箭头那添加代码文字发 ...


你下在过去了吗被下载了3次了我晕 我q 343152012
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
33193
在线时间
10491 小时
注册时间
2009-3-15
帖子
4756
9
发表于 2023-8-15 15:05:46 | 只看该作者
本帖最后由 soulsaga 于 2023-8-15 15:08 编辑
金芒芒 发表于 2023-8-15 14:24
链接: https://pan.baidu.com/s/1KJn_NAhSX7Nx5LnkL2w1zA?pwd=727z 提取码: 727z 复制这段内容后打开百度 ...


假设甲的ID是2
甲是CHARACTER_NAME数组里第3个单元
这样写
RUBY 代码复制
  1. p Figter_data::CHARACTER_NAME.index("甲")#==>2
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
6296
在线时间
1104 小时
注册时间
2015-8-15
帖子
658
10
 楼主| 发表于 2023-8-15 15:55:29 | 只看该作者
本帖最后由 金芒芒 于 2023-8-15 16:42 编辑
soulsaga 发表于 2023-8-15 15:05
假设甲的ID是2
甲是CHARACTER_NAME数组里第3个单元
这样写


我就想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(截图脚本)


  1. #==============================================================================
  2. # ■ Window_Item
  3. #------------------------------------------------------------------------------
  4. #  显示可以装备的回路。
  5. #==============================================================================
  6. class Window_Troops_List< Window_Base
  7.   def blue_color
  8.     return Color.new(141,157,180)
  9.   end
  10.   #--------------------------------------------------------------------------
  11.   # ● 定义实例变量
  12.   #--------------------------------------------------------------------------
  13.   attr_reader   :index                    # 光标位置
  14.   attr_reader   :help_window              # 帮助窗口
  15.   attr_reader   :type                     # 种类
  16.   attr_reader   :able                     # 暗色
  17.   
  18.   def type=(type)  # 定义类型=(类型)
  19.     @type = type   # @类型 = 类型
  20.   end
  21.   def type         # 定义 类型
  22.     return @type   # 返回 @类型
  23.   end
  24.   #--------------------------------------------------------------------------
  25.   # ● 设置光标的位置
  26.   #     index : 新的光标位置
  27.   #--------------------------------------------------------------------------
  28.   def index=(index) # 定义 索引 = (索引)
  29.     @index = index  # @索引 = 索引
  30.     @column_max = 4 # 纵最大值 = 4
  31.     # 刷新帮助文本 (update_help 定义了继承目标)
  32.     #如果是自己。活动和@帮助窗口!=无
  33.     if self.active and @help_window != nil
  34.       update_help  # 跟新帮组
  35.     end
  36.     # 刷新光标矩形
  37.     update_cursor_rect
  38.   end
  39. #--------------------------------------------------------------------------
  40.   # ● 获取行数
  41.   #--------------------------------------------------------------------------
  42.   def row_max #定义行的最大值
  43.     # 由项目数和列数计算出行数
  44.     return @item_max #返回@项目最大值
  45.   end
  46.   #--------------------------------------------------------------------------
  47.   # ● 获取开头行
  48.   #--------------------------------------------------------------------------
  49.   def top_row # 定义 开头行
  50.     # 将窗口内容的传送源 Y 坐标、1 行的高 32 等分
  51.     return self.oy / 120 #返回自己原点y/120 (每行的间隔是120)
  52.   end
  53.   #--------------------------------------------------------------------------
  54.   # ● 设置开头行
  55.   #     row : 显示开头的行
  56.   #--------------------------------------------------------------------------
  57.   def top_row=(row)  # 定义 开头行=(行)
  58.     # row 未满 0 的场合更正为 0
  59.     if row < 0 #如果行< 0
  60.       row = 0  #行=0
  61.     end
  62.     # row 超过 row_max - 1 的情况下更正为 row_max - 1
  63.     if row > row_max - 1 # 如果 行 > 行 最大值 - 1
  64.       row = row_max - 1  # 行 = 行 最大值 - 1
  65.     end
  66.     # row 1 行高的 32 倍、窗口内容的传送源 Y 坐标
  67.     self.oy = row * 120
  68.   end
  69.   #--------------------------------------------------------------------------
  70.   # ● 获取 1 页可以显示的行数
  71.   #--------------------------------------------------------------------------
  72.   def page_row_max #定义页面行最大值
  73.     # 窗口的高度,设置画面的高度减去 32 ,除以 1 行的高度 32
  74.     return 3 #返回 3
  75.   end  
  76.   #--------------------------------------------------------------------------
  77.   # ● 初始化对像
  78.   #     actor : 角色
  79.   #--------------------------------------------------------------------------
  80.   #定义初始化(类型=0,玩家或敌军=0)
  81.   def initialize(type = 0,player_or_enermy = 0)
  82. #    @all_fighters = [1]
  83. #    if $game_switches[19] == true#(开关 开)
  84. #   @all_fighters.push(2)  
  85. #    end  
  86.     @all_fighters = Figter_data::ALL_SOLDIER # 所有士兵=Figter_data::ALL_SOLDIER
  87.    
  88.     #右侧滚动条
  89.     @right_back = Bar_Right.new("right_back", origin_x+344, origin_y+12, 120*3)
  90.     @right_back.visible = false
  91.     @right = Bar_Right.new("right", origin_x+342, origin_y+12, 0)
  92.     @right.visible = false
  93.     #变量更新
  94.     @type = 0 #@类型= 0
  95.     @index = 0 # 索引=0
  96.     #背景
  97.     @back = Sprite.new #@背景 = 新的精灵
  98.     #背景位图 = RPG::Cache.menu("troopList-base")
  99.     @back.bitmap = RPG::Cache.menu("troopList-base")
  100.   #  @back.x = origin_x
  101.    # @back.y = origin_y
  102.     #帮助窗口    = Window_Troop_Info.new #属性窗口
  103.     @help_window = Window_Troop_Info.new #属性窗口
  104.    
  105.    
  106.     @item_icon = [] #项目图标 = []
  107.     @item_icon[0] = Sprite.new #@项目图标[0] = Sprite.new
  108.     #初始化
  109.     super(origin_x,origin_y,344+32,3*120+120)
  110.     self.windowskin  = RPG::Cache.menu("Blue") #自己窗花=RPG::缓存.菜单(“蓝色”)
  111.     self.opacity = 0    #自己不透明度 =0
  112.     self.active = false #自己活动=错误
  113.     #刷新
  114.     refresh(type) #刷新(类型)
  115.     refresh(type) #刷新(类型)
  116.     update_help   #更新帮助
  117.   end
  118.   #--------------------------------------------------------------------------
  119.   # ● 活动窗口用原始x y坐标
  120.   #--------------------------------------------------------------------------  
  121.   def origin_x
  122.     return 25
  123.   end
  124.   def origin_y
  125.     return 100
  126.   end
  127.   #--------------------------------------------------------------------------
  128.   # ● 定义用选择状态决定窗口颜色
  129.   #--------------------------------------------------------------------------  
  130.   def able=(able)
  131.     @able=able
  132.     @right_back.able = able
  133.     @right.able = able
  134.     if active
  135.       @back.color = Color.new(255,255,255,0)
  136.     else
  137.       @back.color = Color.new(0,0,0,128)
  138.     end
  139.     refresh
  140.   end
  141.   #--------------------------------------------------------------------------
  142.   # ● 一些方法的重载
  143.   #--------------------------------------------------------------------------  
  144.   def active=(active)      # 定义活动 =(活动)
  145.     if active              # 如果活动
  146.       if @item_max <= 0    # 如果@项目最大值<= 0
  147.         self.index = -1    # 自己索引=-1
  148.       else                 # 否则
  149.         self.index = 0     # 自己索引= 0
  150.       end                  
  151.     else                   # 否则
  152.       self.index = -1      # 自己索引=-1
  153.     end
  154.     @ajsdgfshfajklshfa = nil #@阿拉伯联合酋长国=零
  155.     #@帮助窗口。如果@帮助窗口!=设置文本(nil)无
  156.     @help_window.set_text( nil ) if @help_window != nil
  157.     super(active) #超级(活动)
  158.   end
  159.   def dispose #定义释放
  160.     @back.dispose  #@背景释放
  161.     @right_back.dispose # 滚条背景释放
  162.     @right.dispose      # 滚条释放
  163.     for i in 0...@item_icon.size #对于0中的i…@项目图标。大小
  164.       @item_icon[i].dispose # @项目图标[i].释放
  165.     end
  166.     @help_window.dispose    # 帮助窗口释放
  167.    
  168.     super
  169.   end
  170.   def x=(x)
  171.     @back.x = x-origin_x #+ 15
  172.     @right_back.x = x+344 #+30
  173.     @right.x = x+342 #+30
  174.     for i in 0...@item_icon.size
  175.       @item_icon[i].x = 5+ i%4 *86 #  +60        #14
  176.     end
  177.     super(x-16)
  178.   end
  179.   def x
  180.     return super+16
  181.   end
  182.   def y=(y)
  183.     @back.y = y-origin_y# + 60
  184.     @right_back.y = y+12 #+ origin_y
  185.     @right.y = y+12 #+ origin_y
  186.     for i in 0...@item_icon.size
  187.       @item_icon[i].y=  y+16+ i/ 4 * 122 # + origin_y #+ 25   #14
  188.     end
  189.     super(y)
  190.   end
  191.   def z=(z)
  192.     @back.z=z-5
  193.     @right_back.z=z+3
  194.     @right.z=z+4
  195.     for i in 0...@item_icon.size
  196.       @item_icon[i].z=z+2
  197.     end
  198.     super(z)
  199.   end
  200.   def visible=(visible)  #def-visible=(可见)
  201.     @back.visible=visible
  202.     @right_back.visible=visible
  203.     @right.visible=visible
  204.   #  @help_window.visible=visible
  205.     super(visible)
  206.   end
  207.   def contents_opacity=(opacity) #def内容不透明度=(不透明度)
  208.     @back.opacity=opacity
  209.     @right_back.opacity=opacity
  210.     @right.opacity=opacity
  211.    # @help_window.opacity=opacity
  212.     super(opacity)
  213.   end
  214.   def oy=(oy)
  215.     #缩放图标时只显示当前页的项目
  216.     for i in 0...@item_icon.size
  217.       @item_icon[i].x= 25+i%4 *84
  218.      # @item_icon[i].y = i/4*120
  219.       @item_icon[i].y = i/ 4 * 120+self.y-oy+16#120*i+self.y-oy+16
  220.       if @item_icon[i].y < self.y or @item_icon[i].y > self.y+120*self.page_row_max
  221.         @item_icon[i].visible = false
  222.       else
  223.         @item_icon[i].visible = true
  224.       end
  225.     end
  226.     super(oy)
  227.   end
  228.   #--------------------------------------------------------------------------
  229.   # ● 获取物品
  230.   #--------------------------------------------------------------------------  
  231.   def item #定义项目
  232.     return @all_fighters[self.index] #返回 @所有士兵[自己索引]
  233.   end
  234.   #--------------------------------------------------------------------------
  235.   # ● 刷新
  236.   #--------------------------------------------------------------------------  
  237.   def refresh(type=@type)   # 定义刷新(类型=@类型)       #all,1,2,3,4,5,6,7 RPPG::ARMOR_BEGIN
  238.     if self.contents != nil # 如果是自己。内容!=无
  239.       self.contents.dispose # 自己内容释放
  240.       self.contents = nil   # 自己内容=无
  241.     end
  242.    
  243.     for i in 0...@item_icon.size  # 对于0中的i…@项目图标。大小
  244.       @item_icon[i].dispose       # @项目图标[i].释放
  245.     end
  246.     @item_icon = []               # @项目图标 = []
  247.     @item_icon[0] = Sprite.new    # @项目图标[0] = 精灵新的

  248.    

  249.     for i in 0...@all_fighters.size # 对于0中的i…@所有士兵。大小
  250.      @item_icon[i] = Sprite.new     # @项目图标[0] = 精灵新的
  251.      #名称= Figter_data::CHARACTER_NAME[@所有士兵[i]]
  252.      name = Figter_data::CHARACTER_NAME[@all_fighters[i]]
  253.      #@项目图标[i].位图= RPG::Cache.icon(名称) 如果名称 != 无
  254.      @item_icon[i].bitmap = RPG::Cache.icon(name) if name != nil
  255.      
  256.     end
  257.     #@项目最大值 = @所有士兵大小
  258.     @item_max = @all_fighters.size
  259.     #下标超过范围的时候往回退一格
  260.     #如果是自己。最上面一行>@项目最大自我。最大页数
  261.     if self.top_row > @item_max-self.page_row_max
  262.       #自己。最上面一行=@项目最大自我。最大页数
  263.       self.top_row = @item_max-self.page_row_max
  264.           end
  265.     if self.index >= @item_max
  266.       self.index = @item_max-1
  267.     end
  268.       
  269.     #右侧滚动条显示
  270.     if @item_max > self.page_row_max
  271.       @right_back.visible = true
  272.       @right.visible = true
  273.     else
  274.       @right_back.visible = false
  275.       @right.visible = false
  276.     end
  277.     #滚动条的更新
  278.     if @right.visible
  279.       @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
  280.     end
  281.    
  282.     # 如果项目数不是 0 就生成位图、描绘全部项目
  283.     if @item_max > 0
  284.       self.contents = Bitmap.new(width - 32, @item_max*20)
  285.       for i in 0...@item_max
  286.         draw_item(i, 12, i*120)
  287.       end
  288.     else
  289.       self.contents = Bitmap.new(width - 32, 20)
  290.     end
  291.     #缩放图标时只显示当前页的项目
  292.     for i in 0...@item_icon.size
  293.       @item_icon[i].x = 25+ i%4 *84
  294.       @item_icon[i].y =  i/ 4 * 120+self.y-oy+16#120*i+self.y-oy+16
  295.       
  296.     #  @item_icon[i].y = i/4*120
  297.       if @item_icon[i].y < self.y or @item_icon[i].y > self.y+120*self.page_row_max
  298.         @item_icon[i].visible = false
  299.       else
  300.         @item_icon[i].visible = true
  301.       end
  302.     end
  303.    #update_help
  304.   end
  305.   #--------------------------------------------------------------------------
  306.   # ● 描绘物品
  307.   #--------------------------------------------------------------------------  
  308.   def draw_item(index, x, y)

  309.     item = @all_fighters[index]
  310.    
  311.    
  312.    
  313.    
  314.     self.contents.font.size = 12
  315.      
  316.       
  317.     #图标缩放显示专用
  318.     icon_size = 100#图片缩放大小self.index%4 * (66 + 5)
  319.     @item_icon[index].x = self.index%4 *86
  320.     @item_icon[index].y = self.index/ 4 * 120
  321. #   @item_icon[index].zoom_x = icon_size.to_f/@item_icon[index].bitmap.width
  322.   #  @item_icon[index].zoom_y = icon_size.to_f/@item_icon[index].bitmap.height
  323.     @item_icon[index].z = self.z+2
  324.     @item_icon[index].color = self.contents.font.color==normal_color ? Color.new(255,255,255,0):Color.new(0,0,0,128)
  325.     #self.contents.font.color = Color.new(128,193,125,0)
  326.     name = Figter_data::THE_NAME[item]#name=图形数据::名称[项目]
  327.     self.contents.draw_text(x + icon_size.to_f, y + 4, 184, self.contents.font.size, name)
  328.       
  329.    
  330.   end
  331.   #--------------------------------------------------------------------------
  332.   # ● 帮助窗口的设置
  333.   #     help_window : 新的帮助窗口
  334.   #--------------------------------------------------------------------------
  335.   def help_window=(help_window)
  336.     @help_window = help_window
  337.     # 刷新帮助文本 (update_help 定义了继承目标)
  338.     if self.active and @help_window != nil
  339.       update_help
  340.     end
  341.   end


  342.   #--------------------------------------------------------------------------
  343.   # ● 更新光标矩形
  344.   #--------------------------------------------------------------------------
  345.   def update_cursor_rect
  346.     #@back.bitmap = RPG::Cache.menu("item_command"+type.to_s)
  347.     # 光标位置不满 0 的情况下
  348.     if @index < 0
  349.       self.cursor_rect.empty
  350.       return
  351.     end
  352.    
  353.     # 获取当前的行
  354.     row = @index/@column_max
  355.     # 当前行被显示开头行前面的情况下
  356.     if row < self.top_row
  357.       # 从当前行向开头行滚动
  358.       self.top_row = row
  359.     end
  360.     # 当前行被显示末尾行之后的情况下
  361.     if row > self.top_row + (self.page_row_max - 1)
  362.       # 从当前行向末尾滚动
  363.       self.top_row = row - (self.page_row_max - 1)
  364.     end
  365.    
  366.     @right.y = self.y+12+self.top_row.to_f*120.0*(3*120)/(@item_max.to_f*120)
  367.    
  368.     # 计算光标的宽度
  369.     cursor_width = 240
  370.     # 计算光标坐标
  371.     x = @index%4*86+2
  372.     y = @index/4-self.oy/120
  373.     # 更新光标矩形
  374.     self.cursor_rect.set(@index%4*84+2,(@index/4-self.oy/120)*120-1,85,120)
  375.     #self.cursor_rect.set(x, y, 86, 120)
  376.   end
  377. #--------------------------------------------------------------------------
  378.   # ● 刷新画面
  379.   #--------------------------------------------------------------------------
  380.   def update
  381.     super

  382.     # 可以移动光标的情况下
  383.     if self.active and @item_max >= 0 and @index >= 0
  384.       # 方向键下被按下的情况下
  385.       if Input.repeat?(Input::LEFT)#DOWN上
  386.         # 光标向下移动
  387.         $game_system.se_play($data_system.cursor_se)
  388.         @index = (@index-1+@item_max) % @item_max if @item_max != 0
  389.         update_help
  390.       end
  391.       # 方向键上被按下的情况下
  392.       if Input.repeat?(Input::RIGHT)#UP下
  393.         # 光标向上移动
  394.         $game_system.se_play($data_system.cursor_se)
  395.         @index = (@index+1+@item_max) % @item_max if @item_max != 0
  396.         update_help
  397.       end
  398.       
  399.       end
  400.     # 可以移动光标的情况下
  401.      if self.active and @item_max > 0 and @item_max <= 40 #and @index >= 0
  402.       # 方向键下被按下的情况下
  403.       if Input.repeat?(Input::DOWN)#DOWN上
  404.         # 光标向下移动
  405.         $game_system.se_play($data_system.cursor_se)
  406.         @index +=4 #(@index+1+@item_max) % @item_max if @item_max != 0
  407.         update_help
  408.       end
  409.     end
  410.       # 方向键上被按下的情况下
  411.       if self.active and @item_max <= 43 and @index<=40#@item_max
  412.       if Input.repeat?(Input::UP)#UP下
  413.         # 光标向上移动
  414.         $game_system.se_play($data_system.cursor_se)
  415.         @index -=4 #(@index-1+@item_max) % @item_max if @item_max != 0
  416.         update_help
  417.       end
  418.       
  419.     end
  420.   #  --------------------------------------------------------------------------
  421.     # 刷新帮助文本 (update_help 定义了继承目标)
  422.   
  423.    
  424.   #  def update_lrb
  425.   #  if RInput.trigger?(RInput::LEFT) and @caret_pos > 0
  426.   #    @caret_pos -= 1
  427.   #    return
  428.   #  end
  429.    # if RInput.trigger?(RInput::RIGHT) and @caret_pos < @text.size
  430.   #    @caret_pos += 1
  431.   #    return
  432. #   end
  433. # end
  434.   #------------------------------------------------------------------------------  
  435.    
  436.     if @help_window != nil and @ajsdgfshfajklshfa == nil
  437.       update_help
  438.       update_help
  439.       @ajsdgfshfajklshfa = true
  440.     end

  441.     # 刷新光标矩形
  442.     update_cursor_rect
  443.   end
  444.   

  445.   
  446.   def now_selected_troop
  447.     return @all_fighters[@index]
  448.   end
  449.   
  450.   #--------------------------------------------------------------------------
  451.   # ● 刷新帮助文本
  452.   #--------------------------------------------------------------------------
  453.   def update_help
  454.     #鲜辣煎鱼
  455.     @help_window.set_text( @index>-1 ? self.item : nil )
  456.    
  457.   end
  458. end
复制代码

RUBY 代码复制
  1. #==============================================================================
  2. # ■ Window_Title_Command
  3. #------------------------------------------------------------------------------
  4. #  标题的主菜单。
  5. #==============================================================================
  6. #类窗口自定义战斗<基础窗口
  7. class Window_CustomBattle < Window_Base  #
  8.   attr_reader   :index           #属性读取器:索引
  9.   attr_reader   :v_index         #属性读取器:v_索引
  10.   attr_reader   :slide_over      #属性读取器:#滚动结束
  11.   attr_reader   :item_max        #属性阅读器:项目最大值
  12.   attr_reader   :second_index    #属性阅读器: 第二个索引
  13.   #start load option exit
  14.   #--------------------------------------------------------------------------
  15.   # ● 初始化对像
  16.   #     actor : 角色
  17.   #--------------------------------------------------------------------------
  18.   #定义初始化(索引=0,团队编号=5,点编号=10,玩家或敌人=0)
  19.   def initialize(index=0,team_num = 5,spots_num = 10,player_or_enermy = 0)
  20.     @index = index #@索引=索引
  21.     @v_index = 0   #@v_索引=0
  22.     #@玩家或敌人 = 玩家或敌人
  23.     @player_or_enermy = player_or_enermy
  24.  
  25.     #@file_name
  26.  
  27.     #选项背景
  28.     @button_base = Sprite.new #@按钮_底座=新的精灵
  29.       if player_or_enermy == 0
  30.        #@按钮_底座位图 = RPG::Cache.title("绿色背景图")
  31.        @button_base.bitmap = RPG::Cache.title("selected-unites-base")
  32.      else
  33.        #@按钮_底座位图 = RPG::Cache.title("红色背景图")
  34.       @button_base.bitmap = RPG::Cache.title("selected-unites-e-base")
  35.       end        
  36.  
  37.     @button_base.x = origin_x
  38.     @button_base.y = origin_y
  39.  
  40.     @finish_button = Sprite.new #@完成按钮=精灵.new
  41.       #if player_or_enermy == 0
  42.     #@完成按钮位图= RPG::Cache.title("完成")
  43.     @finish_button.bitmap = RPG::Cache.title("bottom-button-1-basic")
  44.      # else
  45.     #  @finish_button.bitmap = RPG::Cache.title("bottom-button-1-basic-e")
  46.      # end        
  47.  
  48.     @finish_button.x = origin_x + 16
  49.     @finish_button.y = origin_y + 187
  50.  
  51.     @able = []#@表=[]
  52.  
  53.     @max_row = 2 #@最大行=2
  54.     @bottom_buttons = [] #@底部按钮=[]
  55.     @max_item_row_2 = 3 #@最大项目行2=3
  56.     @delete_button = Sprite.new #@删除按钮=精灵新
  57.     #@删除按钮位图=RPG::Cache.title("删除按钮")
  58.     @delete_button.bitmap = RPG::Cache.title("bottom-button-2-basic")
  59.     @delete_button.x = origin_x
  60.     @delete_button.y = origin_y
  61.     # @清空按钮=精灵.new
  62.     @empty_button = Sprite.new
  63.     # @清空按钮位图=  RPG::Cache.title("清空按钮")
  64.     @empty_button.bitmap = RPG::Cache.title("bottom-button-3-basic")
  65.     @empty_button.x = origin_x
  66.     @empty_button.y = origin_y
  67.  
  68.     @bottom_buttons.push @finish_button# @底部按钮。按下完成按钮
  69.     @bottom_buttons.push @delete_button# @底部按钮。按下删除按钮
  70.     @bottom_buttons.push @empty_button # @底部按钮。按下清空按钮
  71.  
  72.     @second_index = @index #@第二个索引=@索引
  73.  
  74.     @cur_back = []                  #选项背景 = []
  75.     @text_list = []                 #@文本列表=[]
  76.  
  77.     @groups = []                    #@组s=[]
  78.     @group_text = []                #@组文本=[]
  79.  
  80.     @icons = []                     #@图标 = []
  81.     @selected_units = []            #@选定的单位=[]
  82.     for i in 0..team_num-1          #对于0中的我..团队编号-1
  83.       @selected_units[i]=[]         #@选定单位[i]=[]
  84.     end
  85.  
  86.     adj_x = 0                       # 调整_x=0
  87.     adj_y = 0                       # 调整_y=0
  88.     #光标
  89.  
  90.     @group_max = 5                  # @组最大值=5
  91.     @item_max = spots_num           # @项目最大值=点数量 #=========================================
  92.     for i in 0...@item_max          # 对于0中的i…@项目最大值
  93.       @icons[i] = Sprite.new        # @图标[i]=精灵.new
  94.       @cur_back[i] = Sprite.new     #@选项背景[i]= 精灵.new
  95.       #if player_or_enermy == 0                小兵头像背景
  96.       #@选项背景[i].位图 = RPG::Cache.title("黑色小方块")
  97.        @cur_back[i].bitmap = RPG::Cache.title("unit-base-highlight")#+i.to_s)
  98.       #else
  99.       # @cur_back[i].bitmap = RPG::Cache.title("unit-base-highlight")#+i.to_s)
  100.       #end
  101.       if i == 100  # 如果 i == 10
  102.       adj_y = 43  # 调整_x=0
  103.       adj_x = -10 # 调整_y=0
  104.     end
  105.         #@选项背景[i].x = 原始_x+56+43*(i+调整_x)
  106.         @cur_back[i].x = origin_x + 56+43*(i+adj_x)
  107.         #@选项背景[i].y = 原始_y+98+调整_y
  108.         @cur_back[i].y = origin_y + 98 + adj_y
  109.         #@图标[i].x = 原始_x + 56+43*(i+调整_x)
  110.         @icons[i].x = origin_x + 156+187*(i+adj_x)
  111.         #@图标[i].y = 原始_y   + 98 + 调整_y
  112.         @icons[i].y = origin_y + 98 + adj_y
  113.       end
  114.      for i in 0...@item_max        # 对于0中的i…@项目最大值         
  115.       @icons[i] = Sprite.new       # @图标[i]=精灵.new
  116.       @cur_back[i] = Sprite.new    #@选项背景[i]= 精灵.new
  117.       #if player_or_enermy == 0                小兵头像背景
  118.        #@选项背景[i].位图 = RPG::Cache.title("黑色小方块")
  119.        @cur_back[i].bitmap = RPG::Cache.title("unit-base-highlight")#+i.to_s)
  120.  
  121.       if i == 10  # 如果 i == 10
  122.       adj_y = 86  # 调整_x=0
  123.       adj_x = -10 # 调整_y=0
  124.     end
  125.         #@选项背景[i].x = 原点_x + 56+43*(i+调整_x)
  126.         @cur_back[i].x = origin_x + 56+43*(i+adj_x)
  127.         #@选项背景[i].y = 原点_y + 141 + 调整_y
  128.         @cur_back[i].y = origin_y + 141 + adj_y
  129.         #@图标[i].x = 原点_x + 56+43*(i+调整_x)
  130.         @icons[i].x = origin_x + 56+43*(i+adj_x)
  131.         #@图标[i].y = 原点_y + 141 +    调整_y
  132.         @icons[i].y = origin_y + 141 + adj_y
  133.       end
  134.  
  135.       #teams
  136.     for i in 0..@group_max-1 #对于0中的i..@组最大值-1
  137.     @groups[i]= Sprite.new   #@组s[i]=精灵.new
  138.       if @player_or_enermy == 0 #如果 @ 玩家 或 敌军 ==0
  139.        #@组s[i]位图 = RPG::Cache.title("小组按键绿底图")
  140.        @groups[i].bitmap = RPG::Cache.title("team-basic")#+i.to_s)
  141.      else#否则
  142.       #@组s[i]位图 = RPG::Cache.title("小组按键红底图")
  143.        @groups[i].bitmap = RPG::Cache.title("enermy-basic")#+i.to_s)
  144.       end   
  145.     ##@组s[i].x = 原点_x + 16 + i*(56+3)
  146.     @groups[i].x = origin_x + 16 + i*(56+3)
  147.     #@组s[i].y = 原点_y + 120
  148.     @groups[i].y = origin_y + 120
  149.     @group_text[i]= Sprite.new #组文本[i]= 新的精灵
  150.     # 组文本 [i]位图 = RPG::Cache.title("队伍1---5"+(i+1).to_s)
  151.     @group_text[i].bitmap = RPG::Cache.title("group"+(i+1).to_s)
  152.      # 组文本 [i].x = 原点_x + 16 + i*(56+3)
  153.     @group_text[i].x = origin_x + 16 + i*(56+3)
  154.     # 组文本 [i].y = 原点_y + 120
  155.     @group_text[i].y = origin_y + 120
  156.     #@暗色[i] = 真
  157.     @able[i] = true
  158.     end  
  159.  
  160.     #对于我在团队编号..@组最大值-1
  161.     for i in team_num..@group_max-1
  162.       disable_item(i) #禁用项目(i)
  163.     end  
  164.  
  165.     super(0, 0, 0, 0)  #色调
  166.     self.opacity = 0   #自己不透明度=0
  167.     self.active = true #自己活动=真
  168.   end
  169.   def origin_x        # 定义原点x
  170.     return 271
  171.   end
  172.   def origin_y
  173.     return 205
  174.   end
  175.   #--------------------------------------------------------------------------
  176.   # ● 一些方法的重载
  177.   #--------------------------------------------------------------------------  
  178.   def dispose #定义释放
  179.     @button_base.dispose       # @按钮底座。释放
  180.     @delete_button.dispose     # @删除_按钮.dispose
  181.     @empty_button.dispose      # @清空按钮丢弃
  182.     @finish_button.dispose     # @完成按钮.展开
  183.     for i in 0...@item_max     # 对于0中的i…@项目最大值
  184.       @cur_back[i].dispose     # @选页背景[i].dispose
  185.       @icons[i].dispose        # @icons[i].dispose
  186.     end
  187.     for i in 0..@group_max-1   # 对于0中的i…@队组最大值
  188.     @groups[i].dispose         # @队组s[i].释放
  189.     @group_text[i].dispose     # @group_text[i].dispose
  190.     end
  191.     super
  192.   end
  193.  
  194.   def z=(z)
  195.     super(z)
  196.     @delete_button.z=z+1
  197.     @empty_button.z=z+1
  198.     @button_base.z=z
  199.     @finish_button.z=z+5
  200.     for i in 0...@item_max
  201.       @cur_back[i].z=z+1
  202.       @icons[i].z=z+4
  203.     end
  204.     for i in 0..@group_max-1
  205.     @groups[i].z=z+1
  206.     @group_text[i].z=z+2
  207.     end  
  208.   end
  209.   def x=(x)
  210.     super(x)
  211.     adj_x = 0
  212.     @button_base.x=x+origin_x
  213.     @delete_button.x=x+origin_x
  214.     @empty_button.x=x+origin_x
  215.     @finish_button.x=x+origin_x+15
  216.     for i in 0...@item_max
  217.       #@cur_back[i].x=x+origin_x
  218.       if i == 5
  219.       #adj_y = 43
  220.       adj_x = -5
  221.       end
  222.         @cur_back[i].x = origin_x + 56+43*(i+adj_x) + x
  223.         @icons[i].x = origin_x + 56+87*(i+adj_x) + x + 5
  224.         #
  225.     end
  226.     for i in 0..@group_max-1
  227.     @groups[i].x=x + 16 + i*(56+3) + origin_x
  228.     @group_text[i].x=x + 16 + i*(56+3) + origin_x
  229.     end  
  230.   end #
  231.  
  232.   def y=(y)
  233.     super(y)
  234.     adj_y = 0
  235.     @button_base.y=y
  236.     @delete_button.y=y
  237.     @empty_button.y=y
  238.     @finish_button.y=y+origin_y-15 #+190
  239.     for i in 0...@item_max
  240.       if i == 5
  241.       adj_y = 43
  242.       #adj_x = -5
  243.       end
  244.         @cur_back[i].y = 98 + adj_y + y
  245.         @icons[i].y = 98 + adj_y + y + 5
  246.     end
  247.     for i in 0..@group_max-1
  248.  
  249.     @groups[i].y=y + 49
  250.     @group_text[i].y=y + 49
  251.     end  
  252.   end  
  253.   def visible=(visible)
  254.     super(visible)
  255.     @button_base.visible = visible
  256.     @delete_button.visible = visible
  257.     @empty_button.visible = visible
  258.     @finish_button.visible = visible
  259.     for i in 0...@item_max
  260.       @cur_back[i].visible = visible
  261.        @icons[i].visible = visible
  262.     end
  263.     for i in 0..@group_max-1
  264.     @groups[i].visible = visible
  265.     @group_text[i].visible = visible
  266.     end  
  267.   end
  268.   def contents_opacity=(opacity)
  269.     super(opacity)
  270.     @button_base.opacity = opacity
  271.     @delete_button.opacity = opacity
  272.     @empty_button.opacity = opacity
  273.     @finish_button.opacity = opacity
  274.     for i in 0...@item_max
  275.       @cur_back[i].opacity = opacity
  276.       @icons[i].opacity = opacity
  277.     end
  278.     for i in 0..@group_max-1
  279.     @groups[i].opacity = opacity
  280.     @group_text[i].opacity = opacity
  281.     end  
  282.   end
  283.   def index=(index)
  284.     @index=index
  285.   end
  286.   def disable_item(i)
  287.     @able[i] = false
  288.       if @player_or_enermy == 0
  289.        @groups[i].bitmap = RPG::Cache.title("team-disable")#+i.to_s)
  290.       else
  291.        @groups[i].bitmap = RPG::Cache.title("enermy-disable")#+i.to_s)
  292.       end      
  293.  
  294.     @group_text[i].bitmap = RPG::Cache.title("group"+(i+1).to_s+"-d")
  295.   end
  296.  
  297.   def back_normal(index)
  298.     #p index
  299.    if @v_index == 0
  300.       if index != -1
  301.         if @player_or_enermy == 0
  302.          @groups[index].bitmap = RPG::Cache.title("team-basic")#+i.to_s)
  303.         else
  304.          @groups[index].bitmap = RPG::Cache.title("enermy-basic")#+i.to_s)
  305.         end              
  306.  
  307.        @group_text[index].bitmap = RPG::Cache.title("group"+(index+1).to_s)
  308.       end
  309.      @second_index = -1
  310.      for i in 0..@max_item_row_2-1
  311.         @bottom_buttons[i].bitmap = RPG::Cache.title("bottom-button-"+(i+1).to_s+"-basic")#+i.to_s)
  312.      end
  313.     else
  314.      @bottom_buttons[index].bitmap = RPG::Cache.title("bottom-button-"+(index+1).to_s+"-basic")#+i.to_s)
  315.     end
  316.   end
  317.   #--------------------------------------------------------------------------
  318.   # ● 更新光标矩形
  319.   #--------------------------------------------------------------------------
  320.   def update_cursor_rect
  321.     if @v_index == 0
  322.       # 光标位置不满 0 的情况下
  323.       if @index < 0
  324.         for i in 0...@item_max
  325.           back_normal(i)
  326.         end
  327.         return
  328.       end
  329.         if @player_or_enermy == 0
  330.          @groups[@index].bitmap = RPG::Cache.title("team-highlight")#+i.to_s)
  331.         else
  332.          @groups[@index].bitmap = RPG::Cache.title("enermy-highlight")#+i.to_s)
  333.         end        
  334.  
  335.       @group_text[@index].bitmap = RPG::Cache.title("group"+(index+1).to_s+"-l")
  336.     else #level 2
  337.  
  338.       if @second_index < 0
  339.         for i in 0..@max_item_row_2-1
  340.           back_normal(i)
  341.         end
  342.         return
  343.       end
  344.       #p @index,@second_index                                 
  345.      # @second_index%=2                                            完成
  346.       @bottom_buttons[@second_index].bitmap = RPG::Cache.title("bottom-button-"+(@second_index+1).to_s+"-l")#+i.to_s)
  347.  
  348.  
  349.  
  350.  
  351.  
  352.     end
  353.   end
  354.   #--------------------------------------------------------------------------
  355.   # ● 刷新画面
  356.   #--------------------------------------------------------------------------
  357.   def update
  358.     if self.active
  359.       if Input.repeat?(Input::DOWN)
  360.         $game_system.se_play($data_system.cursor_se)
  361.  
  362.         @v_index = (@v_index+1)%@max_row
  363.         #@last_index = @index
  364.         if @v_index == 0
  365.            #back_normal(@second_index)
  366.           @second_index = -1
  367.           for i in 0..@max_item_row_2-1
  368.           back_normal(i)
  369.           end
  370.         else
  371.           #back_normal(@index)
  372.           @second_index = 1
  373.           #@index%=@max_item_row_2
  374.            if @player_or_enermy == 0
  375.            @groups[@index].bitmap = RPG::Cache.title("team-basic")#+i.to_s)
  376.           else
  377.            @groups[@index].bitmap = RPG::Cache.title("enermy-basic")#+i.to_s)
  378.           end         
  379.         end  
  380.         refresh
  381.       end
  382.  
  383.       if Input.repeat?(Input::UP)
  384.         $game_system.se_play($data_system.cursor_se)
  385.         #back_normal(@index)
  386.         @v_index = (@v_index-1)%@max_row
  387.        # @last_index = @index
  388.         if @v_index == 0
  389.            #back_normal(@second_index)
  390.           @second_index = -1
  391.           for i in 0..@max_item_row_2-1
  392.           back_normal(i)
  393.           end
  394.         else
  395.           #back_normal(@index)
  396.           @second_index = 1
  397.           #@index%=@max_item_row_2
  398.            if @player_or_enermy == 0               #队伍1-5背景
  399.            @groups[@index].bitmap = RPG::Cache.title("team-basic")#+i.to_s)
  400.           else                                    # 敌人队伍1-5背景
  401.            @groups[@index].bitmap = RPG::Cache.title("enermy-basic")#+i.to_s)
  402.           end              
  403.         end  
  404.         refresh
  405.       end
  406.     if @v_index == 0
  407.       # 方向键左被按下的情况下
  408.       if Input.repeat?(Input::RIGHT)
  409.         $game_system.se_play($data_system.cursor_se)
  410.         back_normal(@index)
  411.         @index = (@index+1)%@group_max
  412.         until @able[@index]
  413.           @index = (@index+1)%@group_max
  414.         end
  415.         refresh
  416.       end
  417.       # 方向键右被按下的情况下
  418.       if Input.repeat?(Input::LEFT)
  419.         $game_system.se_play($data_system.cursor_se)
  420.         back_normal(@index)
  421.         @index = (@index+@item_max-1)%@group_max
  422.         until @able[@index]
  423.           @index = (@index+@item_max-1)%@group_max
  424.         end
  425.         refresh
  426.       end
  427.     else # level 2
  428.       # 方向键左被按下的情况下
  429.       if Input.repeat?(Input::RIGHT)
  430.         $game_system.se_play($data_system.cursor_se)
  431.         back_normal(@second_index)
  432.         @second_index = (@second_index+1)%@max_item_row_2
  433.         #p @second_index
  434.         refresh
  435.       end
  436.       # 方向键右被按下的情况下
  437.       if Input.repeat?(Input::LEFT)
  438.         $game_system.se_play($data_system.cursor_se)
  439.         back_normal(@second_index)
  440.         @second_index = (@second_index-1)%@max_item_row_2
  441.         refresh
  442.       end
  443.     end   # @v_index == 0
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.     end   
  451.  
  452.       update_cursor_rect #if @slide_over
  453.   end
  454.   #--------------------------------------------------------------------------
  455.   # ● 获取东西
  456.   #--------------------------------------------------------------------------
  457.   def item_num(index = @index) # 定义项目 (索引=@索引)
  458.     return @selected_units[@index].size
  459.   end
  460.   def set_units(a)
  461.     @selected_units = a
  462.   end  
  463.   #--------------------------------------------------------------------------
  464.   # ● 更新内容
  465.   #--------------------------------------------------------------------------
  466.   def refresh
  467.     for i in 0...@item_max
  468.       @icons[i].bitmap = nil
  469.     end
  470.     #对于i,单位为0..@选定的单位[@索引]。大小-1
  471.     for i in 0..@selected_units[@index].size-1
  472.       @icons[i].bitmap = RPG::Cache.icon(Figter_data::CHARACTER_NAME[@selected_units[@index][i]])
  473.       #p Figter_data::CHARACTER_NAME[twoArray[@index][i]]
  474.     end
  475.  
  476.   end
  477.  
  478.   #--------------------------------------------------------------------------
  479.   # ● 删除士兵
  480.   #--------------------------------------------------------------------------
  481.   def delete_last_troop
  482.     @selected_units[@index].pop
  483.     refresh
  484.   end
  485.   #--------------------------------------------------------------------------
  486.   # ● 清空士兵
  487.   #--------------------------------------------------------------------------  
  488.   def empty_troops
  489.     @selected_units[@index]=[]
  490.     refresh
  491.   end
  492.  
  493.  
  494.  
  495. end

RUBY 代码复制
  1. class Scene_Map
  2. def command_custom_battle#定义命令_自定义战斗
  3.     # 演奏确定 SE
  4.     $game_system.se_play($data_system.decision_se)
  5.      #$游戏系统。se播放($数据系统。未指定文件或目录
  6.  
  7.     choose_map_main#选择主地图
  8. # map_info = $custom_battle_next_map_id#@map_info#地图信息=@地图信息
  9.   #如果选择随机地图随机士兵
  10. # if ! @force_back and map_info[0] == -1#如果!@强制返回并地图信息[0]==-1
  11. #   make_random_efs_game#生成随机efs_game
  12. #   return
  13. # end
  14. #---------------------------------------------------- ↑↓   
  15.     #如果@强制后退或@强制后退==无
  16.     if ! @force_back or @force_back == nil
  17.     #自定义主战场(0,@地图信息[1],@地图信息[2])
  18.     custom_battle_main(0,@map_info[1],@map_info[2])
  19.     #团队选定部队=@选定部队
  20.     team_selected_troops = @selected_units
  21.  
  22.     #如果@强制后退或@强制后退==无
  23.     if ! @force_back or @force_back == nil
  24.       #自定义主战场(1,@地图信息[1],@地图信息[2])
  25.       custom_battle_main(1,@map_info[1],@map_info[2])
  26.       #敌人选定部队=@选定部队
  27.       if $game_switches[18] == true
  28.       #true是打开,false是关闭
  29.       #敌军enermy精选部队
  30.  
  31.       enermy_selected_troops =[[5,21],[18,21,21],[19,21],[21,21,21],[16,21,21,21,21] ] #@selected_units
  32.  
  33.  
  34.       # @group_one.x = 928
  35.  
  36.     #  @group_one.y = 544
  37.     #  @group_two.x = 1248
  38.     #  @group_two.y = 640
  39.  
  40.       end
  41.       if $game_switches[19] == true
  42.       enermy_selected_troops =[ [5,5],[5,5,5],[5,5],[5,5,5],[5,5,5,5,5] ]
  43.       end
  44.       #如果@强制后退或@强制后退==无
  45.       if ! @force_back or @force_back == nil
  46.         choose_hero_main#选择英雄主
  47.         selected_hero = nil
  48.         #selected_hero = @selected_hero#选定的英雄=@选定的英雄
  49.         #如果@强制后退或@强制后退==无
  50.         if ! @force_back or @force_back == nil
  51.  
  52.         team_army = Game_Army_Slg.new(0)
  53.         #enermy军队
  54.         enermy_army = Game_Army_Slg.new(1)
  55.         team_army.create_empty_army
  56.         enermy_army.create_empty_army
  57.         #team_army.load_twoD_Array(team_selected_troops,selected_hero)
  58.         team_army.load_twoD_Array(team_selected_troops,selected_hero)
  59.         enermy_army.load_twoD_Array(enermy_selected_troops)
  60.        # 切换地图画面
  61.       #
  62.         team_army.set_groups_name#团队军队。设置团队名称
  63.  
  64.         #$自定义战斗下一个战斗者团队=团队军队
  65.         $custom_battle_next_fighter_team = team_army
  66.         #$自定义战斗下一个战斗者敌军=敌军军队
  67.         $custom_battle_next_fighter_enermy = enermy_army
  68.         #$自定义战斗下一个地图ID=16
  69.         $custom_battle_next_map_id = 16#map_info[0]
  70.        #if $game_switches[19] == true
  71.        # a = [1, 2, 3, 5, 8]
  72.        # $custom_battle_next_map_id  = a[rand(a.size)]
  73.        # end
  74.         $game_party.setup_starting_members#游戏部分设置启动成员
  75.  
  76.  
  77.  
  78.     # 设置初期位置的地图##############1356622
  79.        $game_map.setup(5)
  80.     # 主角向初期位置移动
  81.         $game_player.moveto(0, 0)
  82.  
  83.  
  84.     # 刷新主角
  85.         $game_player.refresh
  86.     # 执行地图设置的 BGM 与 BGS 的自动切换
  87.         $game_map.autoplay
  88.  
  89.  
  90.  
  91.  
  92.     # 刷新地图 (执行并行事件)
  93.         $game_map.update
  94.     # 切换地图画面
  95.         $scene = Scene_Map.new
  96.  
  97.          # $scene = Scene_Map.new
  98.           #efs_title_main
  99.  
  100.          else # fourth
  101.         @force_back = false#@强制后退=错误
  102.         Graphics.update #图形更新
  103.         efs_title_update#EFS标题更新
  104.         end   
  105.  
  106.  
  107.       else # third
  108.       @force_back = false#@强制后退=错误
  109.       Graphics.update#图形更新
  110.       efs_title_update#EFS标题更新
  111.       end   
  112.     else # second
  113.     @force_back = false#@强制后退=错误
  114.     Graphics.update#图形更新
  115.     efs_title_update#EFS标题更新
  116.     end
  117.  
  118.    else #1st
  119.      @force_back = false#@强制后退=错误
  120.      Graphics.update#图形更新
  121.      efs_title_update#EFS标题更新
  122.    end
  123.  
  124.   end
  125. end

RUBY 代码复制
  1. module Figter_data#::ALL_SOLDIER
  2.  
  3.   #所有士兵
  4.   ALL_SOLDIER =[5,4,3,13,2,9,11,15,26,23,   #帝国
  5.  
  6.   32,35,36,28,30,33,34, #诺尔森人
  7.  
  8.   7,8,19,12,31,38,17, #雇佣兵
  9.   27,6,10,14,16,18,21,22,29,39] #野怪
  10.   #所有英雄
  11.   ALL_HERO = [ 20,24,25,37]
  12.  
  13.  
  14.  
  15.  
  16.  
  17. end

RUBY 代码复制
  1. module Figter_data
  2.  
  3. data_id = 4
  4. #=====基本、模型信息==========
  5. CHARACTER_NAME[data_id]  =  "E_ManAtArm"    #头像模型名字
  6. ATK_SE[data_id]  = "spearbasic_0"     #攻击音效 (击中)
  7. ATK_SE_NUM[data_id]  = 9              #攻击音效数量
  8. DEF_SE[data_id] = "shield_wood_wood_0"
  9. DEF_SE_NUM[data_id] = 9
  10. S_ATK_SE[data_id]  = nil              #远程攻击音效 (击中)
  11. S_ATK_SE_NUM[data_id]  = nil          #远程攻击音效数量
  12. AMMO_NAME[data_id]  =    nil          #弹药模型名字
  13. AMMO_D_NAME[data_id]  = nil           #落地后的弹药模型名字
  14. S_SHOOT_SE[data_id] = nil             #射击音效
  15. S_SHOOT_SE_NUM[data_id] = nil         #射击音效数量
  16. S_PASSBY_SE[data_id] = nil
  17. S_PASSBY_SE_NUM[data_id] = nil
  18. S_DROP_SE[data_id] = nil
  19. S_DROP_SE_NUM[data_id] = nil
  20. S_FLY_TYPE[data_id] = nil
  21. #=======类别=================
  22. THE_NAME[data_id]  = "帝国军士"       #显示名字
  23. IS_CAL[data_id]  =   false            #是骑兵吗
  24. IS_ARC[data_id]  =   false            #是远程兵吗
  25. HEAVY[data_id]  =    false            #是重装兵吗
  26. LABEL[data_id] = 1                    #兵种标签
  27. DESCRIPTION[data_id] = "赫西帝国步兵,中装步兵,配有克制骑兵的长矛,制式盾牌"
  28. #==========属性==============
  29. HP_MAX[data_id]  =   375              #血量上限
  30. AMMOR_HP[data_id]  = 30               #护甲值
  31. SHD_HP[data_id]  =   25               #盾甲值
  32. BASE_ATK[data_id]  = 65               #基本攻击力
  33. BRO_ATK[data_id]  =  10               #破甲攻击力
  34. S_BASE_ATK[data_id] = 0               #远程基本攻击力
  35. S_BRO_ATK[data_id]  = 0               #远程破甲攻击力
  36. ATK_SKILL[data_id] = 25               #攻击技巧
  37. DEF_SKILL[data_id] = 35               #防御技巧
  38. ANTI_CAV[data_id]  = 75               #反骑兵伤害加成
  39. ANTI_INF[data_id]  = 0                #反步兵伤害加成
  40. CHARGE_BOUN[data_id]=30               #冲锋加成
  41. MORALE[data_id]  =   50               #士气 (100max)
  42. CRITICAL_HIT[data_id] = 10            #暴击率
  43. EXPLOSION_SETTINGS[data_id] = nil     #伤害是否有爆破特效,若有则设置
  44.                                       #(中心X,中心Y,中心伤害,范围,施放者,队伍不受(0是所有人受)是否留垃圾
  45. ATK_FR[data_id] = 30                  #攻击频率
  46. ATK_RANGE[data_id]  =  1              #攻击范围
  47. ENGAGE_RANGE[data_id]  =  1           #交战范围
  48. ENGAGE_RANGE_MIN[data_id]  =  1
  49. MOVEMENT_SPEED[data_id]  =  3         #移动速度
  50. ACCURATCY[data_id]  = 100             #精确度
  51.  
  52. LIVE_CHANCE[data_id]  = 20            #生还几率
  53. AMMO_MAX[data_id] = 0                 #弹药上线
  54.  
  55. ATK_CODE[data_id] = nil               #特殊代码(攻击后执行)
  56.  
  57. #===========战略用=============
  58. EXP[data_id]  =      2                #击杀获得经验
  59. PRICE[data_id]  =    100              #价格
  60. EXP_NEED[data_id]  = 10               #升级所需经验
  61. NEXT_LEVEL[data_id]  = [9]            #下一阶兵种
  62. CAPTAIN_SKILL[data_id]  = nil
  63.  
  64. end

人物模型.png (55.33 KB, 下载次数: 10)

人物模型.png
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-29 12:31

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表