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

Project1

 找回密码
 注册会员
搜索
查看: 1992|回复: 4

[已经过期] 请教关于屏蔽部分技能的问题

[复制链接]

Lv2.观梦者

梦石
0
星屑
570
在线时间
172 小时
注册时间
2013-6-27
帖子
117
发表于 2020-2-18 06:13:24 | 显示全部楼层 |阅读模式

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

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

x
制作一个功能,技能栏中按下某个键可以屏蔽该技能,在战斗中不会出现这个技能
大概是用数组把要屏蔽的技能id装起来之类的,其他地方都做好了,就差最后一步把技能栏里同id的技能移除掉,不知道怎么弄,自己瞎捣鼓了几个地方也没用,求解

Lv5.捕梦者

梦石
0
星屑
37626
在线时间
5307 小时
注册时间
2006-11-10
帖子
6539
发表于 2020-2-18 10:24:16 | 显示全部楼层
@skills -= Array
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1433
在线时间
50 小时
注册时间
2020-2-16
帖子
103
发表于 2020-2-18 12:22:45 | 显示全部楼层
class Window_Skilled < Window_Selectable
  def initialize(actor)
    super(320, 128, 320, 352)
    @actor = actor
    refresh
    self.index = -1
  end
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    for i in 0...$game_variables[@actor.id * 10].size
      skill = $game_variables[@actor.id * 10][i]
      if skill != nil
        @data.push(skill)
      end
    end
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(self.width - 32, @item_max * 32 + 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 描绘项目
  #     index : 项目编号
  #--------------------------------------------------------------------------
  def draw_item(index)
    skill = @data[index]
    if @actor.skill_can_use?(skill.id)
      self.contents.font.color = normal_color
    else
      self.contents.font.color = disabled_color
    end
    x = 4
    y = index * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(skill.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
    self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)
  end
  #--------------------------------------------------------------------------
  # ● 刷新帮助文本
  #--------------------------------------------------------------------------
  def update_help
    @help_window.set_text(self.skill == nil ? "" : self.skill.description)
  end
end

新的被遗忘的技能窗口

在Scene_Skill 的 main 里加入这个窗口
@skilled_window = Window_Skilled.new(@actor)

在update_command 里面写入
    if Input.trigger?(Input::CTRL)
      $game_system.se_play($data_system.cursor_se)
      skill = @skill_window.skill
      @actor.forget_skill(skill.id)
      @skill_window.refresh
      $game_variables[@actor.id * 10].push(skill)
      @skilled_window.refresh
      return
    end
目前做了遗忘的技能,如何从遗忘技能中拿出来,留个你自己解决吧
流飘零半生,未逢明主。公若是不弃,流愿拜为义父
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
570
在线时间
172 小时
注册时间
2013-6-27
帖子
117
 楼主| 发表于 2020-2-18 15:17:29 | 显示全部楼层

呃,数组的加减我是会的,想问的是应该在哪个位置改来着,瞎捣鼓了几个地方都没用…是我问题不够详细抱歉

点评

装一个就扣一个嘛  发表于 2020-2-18 16:00
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-3-28 21:58

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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