查看: 2973|回复: 9

[已经解决] 如何设置限定对某人/职业才能使用的物品/技能?

[复制链接]
梦石
0
星屑
124
在线时间
900 小时
注册时间
2012-11-13
回帖
845
发表于 2014-3-10 20:31:02 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 3106345123 于 2014-3-12 18:32 编辑

如何设置限定对某人/职业才能使用的物品/技能?(战斗时与平时都要)
举几个例子:
    治疗,净化,心肺复苏,药水 只可对人有效;
    修车,装甲包 只可对车有效。

只搜索到这个:http://rpg.blue/forum.php?mod=redirect&goto=findpost&ptid=276977&pid=2086448
废弃
梦石
0
星屑
60
在线时间
936 小时
注册时间
2008-2-14
回帖
930

开拓者

发表于 2014-3-10 20:37:20 | 显示全部楼层
搜索“状态法”
接稿,UI(已接)/立绘(已接)
无偿/有偿皆可,有偿速度会更快^q^
作品请见相册,有意请发私信:)
回复

使用道具 举报

梦石
0
星屑
22879
在线时间
8598 小时
注册时间
2011-12-31
回帖
3270
发表于 2014-3-10 21:54:20 | 显示全部楼层
装備制限(RPGツクールVX Ace)
http://tycoon511.m2.coreserver.jp/rgss/material/rgss3/019.html
回复

使用道具 举报

梦石
0
星屑
124
在线时间
900 小时
注册时间
2012-11-13
回帖
845
 楼主| 发表于 2014-3-12 18:31:32 | 显示全部楼层
好吧看来要举几个例子:
          治疗,净化,心肺复苏,药水 只可对人有效;
          修车,装甲包 只可对车有效。

点评

那个有空再看看  发表于 2014-3-30 19:25
废弃
回复

使用道具 举报

梦石
0
星屑
266
在线时间
2355 小时
注册时间
2009-3-13
回帖
2257

贵宾

发表于 2014-3-27 18:36:30 | 显示全部楼层
你是怎么定义人跟车的?

点评

职业id  发表于 2014-3-27 20:19
回复

使用道具 举报

梦石
0
星屑
266
在线时间
2355 小时
注册时间
2009-3-13
回帖
2257

贵宾

发表于 2014-3-27 21:03:40 | 显示全部楼层
本帖最后由 Sion 于 2014-3-29 17:55 编辑

点评

战斗时物品与技能没用  发表于 2014-3-29 10:23
平时物品有用  发表于 2014-3-29 10:22
回复

使用道具 举报

梦石
0
星屑
266
在线时间
2355 小时
注册时间
2009-3-13
回帖
2257

贵宾

发表于 2014-3-29 18:13:27 | 显示全部楼层
本帖最后由 Sion 于 2014-3-29 18:30 编辑
  1. # <ForClass2> 限定只有2号职业能用
  2. # <ForActor1> 限定只有1号角色能用
  3. # 可以限定多个职业与角色,但是限定了职业就不要限定角色了,这里是只能判断其中一个。

  4. class RPG::UsableItem
  5.   def can_this_actor_use?(actor)
  6.     return @note.include?("<ForActor#{actor.id}>") if @note.include?("<ForActor")
  7.     return @note.include?("<ForClass#{actor.class_id}>") if\
  8.       @note.include?("<ForClass")
  9.     return true
  10.   end
  11. end

  12. class Game_Battler
  13.   def item_test(user, item)
  14.     return false if item.for_dead_friend? != dead?
  15.     return true if $game_party.in_battle
  16.     return true if item.for_opponent?
  17.     return true if item.damage.recover? && item.damage.to_hp? && hp < mhp
  18.     return true if item.damage.recover? && item.damage.to_mp? && mp < mmp
  19.     return true if item_has_any_valid_effects?(user, item) &&
  20.       item.can_this_actor_use?(self)
  21.     return false
  22.   end
  23. end


  24. class Window_BattleActor
  25.   def item=(item)
  26.     return if @item== item
  27.     @item= item
  28.     refresh
  29.   end
  30.   def current_item_enabled?(i=index)
  31.     !@item || @item.can_this_actor_use?($game_party.battle_members[i])
  32.   end
  33.   #
  34.   alias_method :s20140329_draw_item, :draw_item
  35.   def draw_item(index)
  36.     @tmpindex = index
  37.     s20140329_draw_item(index)
  38.     @tmpindex = nil
  39.   end
  40.   def change_color(*args)
  41.     super
  42.     contents.font.color.alpha = translucent_alpha unless
  43.       current_item_enabled?(@tmpindex)
  44.   end
  45. end

  46. class Window_BattleItem
  47.   def process_ok
  48.     super
  49.     item_ = item
  50.     SceneManager.scene.instance_eval { @actor_window.item = item_ }
  51.   end
  52. end
  53. class Window_BattleSkill
  54.   def process_ok
  55.     super
  56.     item_ = item
  57.     SceneManager.scene.instance_eval { @actor_window.item = item_ }
  58.   end
  59. end
复制代码

点评

终于实现了物品,谢谢。 虽然没实现技能  发表于 2014-3-30 07:25

评分

参与人数 2星屑 +24 梦石 +1 收起 理由
迷糊的安安 + 1 认可答案
3106345123 + 24 认可答案

查看全部评分

回复

使用道具 举报

梦石
0
星屑
125
在线时间
486 小时
注册时间
2007-5-27
回帖
788
发表于 2014-3-30 13:55:12 | 显示全部楼层
3106345123 发表于 2014-3-12 18:31
好吧看来要举几个例子:
          治疗,净化,心肺复苏,药水 只可对人有效;
          修车,装甲包 只可 ...

……
学一学年代记里的方法吧,修车技能拿来修人是伤害……

点评

怎么可能,要多2B才会用扳手去修理人类啊……  发表于 2014-3-30 14:28
不过我会考虑的  发表于 2014-3-30 14:18
然后玩家就点右上角了  发表于 2014-3-30 14:17

评分

参与人数 1星屑 +2 收起 理由
3106345123 + 2 我很赞同

查看全部评分

回复

使用道具 举报

梦石
0
星屑
125
在线时间
486 小时
注册时间
2007-5-27
回帖
788
发表于 2014-3-30 14:34:41 | 显示全部楼层
本帖最后由 紫苍焰 于 2014-3-30 14:37 编辑

……
好吧,参考某帖子,可以在技能公式里加个条件判断,并且给特定的种族附加不同的常驻状态……
表示图书馆里有相关帖子……
物品的话我在实验……

评分

参与人数 1星屑 +2 收起 理由
3106345123 + 2 我很赞同

查看全部评分

回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部