Project1

标题: 数组a=场景组(group)-1的角色ID=Figter_data::data_id值 [打印本页]

作者: 金芒芒    时间: 2023-7-5 10:53
标题: 数组a=场景组(group)-1的角色ID=Figter_data::data_id值
本帖最后由 金芒芒 于 2023-7-5 11:14 编辑

重点  角色ID=Figter_data::data_id

RUBY 代码复制
  1. def efs_team_show_character_name
  2.  
  3.     return false if @character.is_a?(Game_Player)
  4.      #如果@角色.是_a?则返回假的?(EFS英雄)
  5.     return false if @character.is_a?(EFS_Hero)
  6.     #如果$场景可以用的队组 == 无     则返回假的
  7.     return false if $scene.group_lisenter == nil
  8.     #挑选选着=$场景。小组成员。包括?(@角色队组)
  9.     selected = $scene.group_lisenter.include?(@character.group)
  10.    # cp队长=场景。小组[@角色.队组-1].队长
  11.     cp = $scene.team_groups[@character.group-1].captain
  12.     if cp == @character #如果队长==@角色
  13. ---------------------------------------------------------------------------------
  14. a=[]
  15. x = 443
  16. 如果cp(角色)ID包括2
  17. a添加2
  18. 如果cp(角色)ID包括5
  19. a添加5
  20. for i in a
  21. $game_screen.pictures[i].show("头像#{i}", 0,
  22. x, 550, 100, 100, 255, 0)
  23. x-=87
  24.    end

ID.png (14.18 KB, 下载次数: 16)

ID.png

作者: soulsaga    时间: 2023-7-5 14:12
重点  角色ID=Figter_data::data_id

你知道是2直接==2就好啦..根本不用这么麻烦
作者: 金芒芒    时间: 2023-7-5 14:19
本帖最后由 金芒芒 于 2023-7-5 14:33 编辑
soulsaga 发表于 2023-7-5 14:12
重点  角色ID=Figter_data::data_id

你知道是2直接==2就好啦..根本不用这么麻烦


因为每次战斗角色多不一样
下面我自己写的不知道错在那里了还是定义错了
team_groups=5个group,每个组都有一个队长,队长的数组是a  a=[] 根据队长=角色  角色的ID a的数组就=5个队长(角色)的ID




  def efs_team_show_character_name
   
    return false if @character.is_a?(Game_Player)
     #如果@角色.是_a?则返回假的?(EFS英雄)
    return false if @character.is_a?(EFS_Hero)
    #如果$场景可以用的队组 == 无     则返回假的
    return false if $scene.group_lisenter == nil
    #挑选选着=$场景。小组成员。包括?(@角色队组)
    selected = $scene.group_lisenter.include?(@character.group)
   # cp队长=场景。小组[@角色.队组-1].队长
    cp = $scene.team_groups[@character.group-1].captain
    if cp == @character #如果队长==@角色
    a = []
    x = 443
    @character.id= Figter_data::data_id
    end
    [email protected] = 2
    a.add (2)
    end
    [email protected] = 3
    a.add (3)
    end  
    [email protected] = 4
    a.add (4)
    end
    [email protected] = 5
    a.add (5)
    end
    [email protected] = 6
    a.add (6)
    end
    [email protected] = 7
    a.add (7)
    end
    [email protected] = 8
    a.add (8)
    end
    [email protected] = 9
    a.add (9)
    end
    [email protected] = 10
    a.add (10)
    end
    [email protected] = 11
    a.add (11)
  end
    for i in a
    $game_screen.pictures.show("头像#{i}", 0, x, 550, 100, 100, 255, 0)
   x-=87
   end  
end   
作者: soulsaga    时间: 2023-7-5 18:27
本帖最后由 soulsaga 于 2023-7-5 18:39 编辑
金芒芒 发表于 2023-7-5 14:19
因为每次战斗角色多不一样
下面我自己写的不知道错在那里了还是定义错了
team_groups=5个group,每个组都 ...


哪里不一样?你就写了一个2吧..还有其他吗?不要吓我
我说了多少次等於是写作==你用够=没
数组往后加元素是push不是add去F1查一下行不行
作者: 金芒芒    时间: 2023-7-6 07:30
soulsaga 发表于 2023-7-5 18:27
哪里不一样?你就写了一个2吧..还有其他吗?不要吓我
我说了多少次等於是写作==你用够=没
数组往后加元素是 ...

收到 老师的纠正




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1