查看: 3300|回复: 5

[已经过期] 请问一下,有没有什么简单的办法设置专属武器?

[复制链接]
梦石
0
星屑
25
在线时间
0 小时
注册时间
2019-6-30
回帖
2
发表于 2019-6-30 15:31:41 | 显示全部楼层 |阅读模式

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

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

×
简单说就是该武器只能由这个角色佩戴。
我试想过设置武器类型。但是武器雷兴国只能设置99种,我这边人物比较多,一个人一种武器类型,不够。
我又考虑过,先固定武器,然后用事件去更换武器,,但被固定武器了的角色,更换不了武器。

点评

噢,不是宠物脚本的原因,更换武器需要物品里面有这项武器,同时人物必须支持这个武器类型。也就是说,还是武器类型不够的问题。  发表于 2019-6-30 15:39
更正一下,不是固定武器无法更换。而是我用了“宠物脚本”可能是角色无法被判定吧。  发表于 2019-6-30 15:35
梦石
0
星屑
664
在线时间
101 小时
注册时间
2016-7-15
回帖
130
发表于 2019-6-30 20:09:08 | 显示全部楼层
既然固定不了武器要不固定一下角色,同一角色不同初始等级不同固定武器。或者呢,开关判定,开关几千上万个,开关变量这种来决定攻击力啊什么的
回复

使用道具 举报

梦石
0
星屑
8177
在线时间
1873 小时
注册时间
2017-10-23
回帖
351
发表于 2019-7-1 23:59:05 | 显示全部楼层

装备备注栏输入 actor.id == 1 角色, 所有属性要求,技能要求,等级要求都行。
例子: actor.atk >=100   acor.level >=10    actor.skill_have?(282)

【格式】装备备注栏
<start_custom_req>
actor.id == 4
<end_custom_req>









#__END__
=begin
==============================================================================

Custom Equip Conditions v1.01
by AdiktuzMiko
--- Date Created: 08/29/2014
--- Last Date Updated: 09/03/2014
--- Level: Easy

==============================================================================
Overview
==============================================================================

This script provides the ability to use RGSS3 methods/formulas as custom
requirements for equipping an item. Use it with the default RGSS3 scripts
or couple it with custom scripts (like custom stat systems) for more
custom requirement possibilities.

The actor must be able to equip the item under normal conditions (equip types)
before the custom requirement is even checked.

==============================================================================
Set-Up
==============================================================================

Just put this script into a blank slot above main but below materials
(see compatibility section) and start tagging and making your own formulas

==============================================================================
Tags
==============================================================================

<start_custom_req>
   formula
<end_custom_req>

Use the variable "actor" to denote the actor being checked

Example: The item is only equippable if the actor's level is greater
than 5

<start_custom_req>
   actor.level > 5
<end_custom_req>

==============================================================================
Compatibility
==============================================================================

This script aliases Game_Battler's equippable? method

==============================================================================
Terms and Conditions
==============================================================================

View it here: http://lescripts.wordpress.com/terms-and-conditions/

==============================================================================
=end

module ADIK
  module CUSTOM_EQUIP_REQUIREMENTS
    #the tag to use for setting custom requirements
    #modify if needed (i.e. conflict with another script)
    TAG = /<start_custom_req>(.*)<end_custom_req>/m
  end
end

# ==============================================================================
# DO NOT EDIT BELOW THIS LINE
# ==============================================================================

class RPG::BaseItem
  
  #attribute for the custom equip requirement
  attr_reader :custom_equip_requirement
  
  #reads the requirements if the item has the tag on the database
  def get_custom_equip_requirement
    @custom_equip_requirement = ""
    if self.note =~ ADIK::CUSTOM_EQUIP_REQUIREMENTS::TAG
      @custom_equip_requirement = $1.to_s
    end
  end
  
  #processes any custom requirement to determine
  #if the item is equippable
  def custom_requirement_process(actor)
    #sets the data if it doesn't exist
    get_custom_equip_requirement if @custom_equip_requirement.nil?
    #if there is no custom requirement, then all's good to go
    return true if @custom_equip_requirement == ""
    #evaluates the custom requirement
    return eval(@custom_equip_requirement)
  end
  
end

class Game_BattlerBase
  
  #Checks first if the item is equippable by normal settings
  alias equippable_adik? equippable?
  def equippable?(item)
    return false unless equippable_adik?(item)
    return item.custom_requirement_process(self)
  end
  
end
回复

使用道具 举报

梦石
0
星屑
1088
在线时间
141 小时
注册时间
2019-5-12
回帖
49
发表于 2019-7-2 23:15:48 | 显示全部楼层
本帖最后由 真の玛娜君 于 2019-7-2 23:22 编辑

人物又不是只能用一种武器,设定个独立的武器类型不行吗?99种也够你用了,中国也就十八般兵器,而且你是能设定99个可战斗角色?还是99个武器类型?99个武器类型光名字都和样子都够你想的了,除非你准备用类似皮卡丘的脚丫之类的来命名,而且这个宠物脚本是必须一个角色对应一个武器类型吗?如果不是那为什么不归为1类或多类?
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部