Project1

标题: 请问一下,有没有什么简单的办法设置专属武器? [打印本页]

作者: 18683189991    时间: 2019-6-30 15:31
标题: 请问一下,有没有什么简单的办法设置专属武器?
简单说就是该武器只能由这个角色佩戴。
我试想过设置武器类型。但是武器雷兴国只能设置99种,我这边人物比较多,一个人一种武器类型,不够。
我又考虑过,先固定武器,然后用事件去更换武器,,但被固定武器了的角色,更换不了武器。
作者: 7112    时间: 2019-6-30 20:09
既然固定不了武器要不固定一下角色,同一角色不同初始等级不同固定武器。或者呢,开关判定,开关几千上万个,开关变量这种来决定攻击力啊什么的
作者: xiaohuangdi    时间: 2019-7-1 23:59

装备备注栏输入 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
作者: 真の玛娜君    时间: 2019-7-2 23:15
本帖最后由 真の玛娜君 于 2019-7-2 23:22 编辑

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




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