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

Project1

 找回密码
 注册会员
搜索
查看: 1462|回复: 12
打印 上一主题 下一主题

[已经过期] 某装备装上自动附加某个状态,装备卸下后状态消除?

[复制链接]

Lv3.寻梦者

梦石
0
星屑
3642
在线时间
912 小时
注册时间
2017-1-19
帖子
269
跳转到指定楼层
1
发表于 2017-7-13 18:56:55 手机端发表。 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
请求好心人

点评

防具的话可以自动状态,武器的话要脚本  发表于 2017-7-14 08:29

Lv3.寻梦者

梦石
0
星屑
1345
在线时间
378 小时
注册时间
2015-6-16
帖子
571
2
发表于 2017-7-13 20:15:33 | 只看该作者
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - Passive States v1.02
  4. # -- Last Updated: 2012.01.23
  5. # -- Level: Normal
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================

  9. $imported = {} if $imported.nil?
  10. $imported["YEA-PassiveStates"] = true

  11. #==============================================================================
  12. # ▼ Updates
  13. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  14. # 2012.01.23 - Compatibility Update: Doppelganger
  15. # 2012.01.08 - Added passive state checks for adding/removing states.
  16. # 2011.12.14 - Started Script and Finished.
  17. #
  18. #==============================================================================
  19. # ▼ Introduction
  20. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  21. # This script allows for actors, classes, weapons, armours, and enemies to have
  22. # passives that are based off of states. Passive states will be active at all
  23. # times and are immune to restrictions and will only disappear if the battler
  24. # dies. Once the battler revives, the passives will return.
  25. #
  26. #==============================================================================
  27. # ▼ Instructions
  28. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  29. # To install this script, open up your script editor and copy/paste this script
  30. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  31. #
  32. # -----------------------------------------------------------------------------
  33. # Actor Notetags - These notetags go in the actors notebox in the database.
  34. # -----------------------------------------------------------------------------
  35. # <passive state: x>
  36. # <passive state: x, x>
  37. # This will cause state x to be always on (unless the battler is dead). To have
  38. # multiple passives, insert multiples of this notetag.
  39. #
  40. # -----------------------------------------------------------------------------
  41. # Class Notetags - These notetags go in the class notebox in the database.
  42. # -----------------------------------------------------------------------------
  43. # <passive state: x>
  44. # <passive state: x, x>
  45. # This will cause state x to be always on (unless the battler is dead). To have
  46. # multiple passives, insert multiples of this notetag.
  47. #
  48. # -----------------------------------------------------------------------------
  49. # Weapon Notetags - These notetags go in the weapons notebox in the database.
  50. # -----------------------------------------------------------------------------
  51. # <passive state: x>
  52. # <passive state: x, x>
  53. # This will cause state x to be always on (unless the battler is dead). To have
  54. # multiple passives, insert multiples of this notetag.
  55. #
  56. # -----------------------------------------------------------------------------
  57. # Armour Notetags - These notetags go in the armours notebox in the database.
  58. # -----------------------------------------------------------------------------
  59. # <passive state: x>
  60. # <passive state: x, x>
  61. # This will cause state x to be always on (unless the battler is dead). To have
  62. # multiple passives, insert multiples of this notetag.
  63. #
  64. # -----------------------------------------------------------------------------
  65. # Enemy Notetags - These notetags go in the enemies notebox in the database.
  66. # -----------------------------------------------------------------------------
  67. # <passive state: x>
  68. # <passive state: x, x>
  69. # This will cause state x to be always on (unless the battler is dead). To have
  70. # multiple passives, insert multiples of this notetag.
  71. #
  72. #==============================================================================
  73. # ▼ Compatibility
  74. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  75. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  76. # it will run with RPG Maker VX without adjusting.
  77. #
  78. #==============================================================================
  79. # ▼ Editting anything past this point may potentially result in causing
  80. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  81. # halitosis so edit at your own risk.
  82. #==============================================================================

  83. module YEA
  84.   module REGEXP
  85.   module BASEITEM
  86.    
  87.     PASSIVE_STATE =
  88.       /<(?:PASSIVE_STATE|passive state):[ ]*(\d+(?:\s*,\s*\d+)*)>/i
  89.    
  90.   end # BASEITEM
  91.   end # REGEXP
  92. end # YEA

  93. #==============================================================================
  94. # ■ DataManager
  95. #==============================================================================

  96. module DataManager
  97.   
  98.   #--------------------------------------------------------------------------
  99.   # alias method: load_database
  100.   #--------------------------------------------------------------------------
  101.   class <<self; alias load_database_pst load_database; end
  102.   def self.load_database
  103.     load_database_pst
  104.     load_notetags_pst
  105.   end
  106.   
  107.   #--------------------------------------------------------------------------
  108.   # new method: load_notetags_pst
  109.   #--------------------------------------------------------------------------
  110.   def self.load_notetags_pst
  111.     groups = [$data_actors, $data_classes, $data_weapons, $data_armors,
  112.       $data_enemies]
  113.     for group in groups
  114.       for obj in group
  115.         next if obj.nil?
  116.         obj.load_notetags_pst
  117.       end
  118.     end
  119.   end
  120.   
  121. end # DataManager

  122. #==============================================================================
  123. # ■ RPG::BaseItem
  124. #==============================================================================

  125. class RPG::BaseItem
  126.   
  127.   #--------------------------------------------------------------------------
  128.   # public instance variables
  129.   #--------------------------------------------------------------------------
  130.   attr_accessor :passive_states
  131.   
  132.   #--------------------------------------------------------------------------
  133.   # common cache: load_notetags_pst
  134.   #--------------------------------------------------------------------------
  135.   def load_notetags_pst
  136.     @passive_states = []
  137.     #---
  138.     self.note.split(/[\r\n]+/).each { |line|
  139.       case line
  140.       #---
  141.       when YEA::REGEXP::BASEITEM::PASSIVE_STATE
  142.         $1.scan(/\d+/).each { |num|
  143.         @passive_states.push(num.to_i) if num.to_i > 0 }
  144.       #---
  145.       end
  146.     } # self.note.split
  147.     #---
  148.   end
  149.   
  150. end # RPG::BaseItem

  151. #==============================================================================
  152. # ■ Game_BattlerBase
  153. #==============================================================================

  154. class Game_BattlerBase
  155.   
  156.   #--------------------------------------------------------------------------
  157.   # alias method: state?
  158.   #--------------------------------------------------------------------------
  159.   alias game_battlerbase_state_check_pst state?
  160.   def state?(state_id)
  161.     return true if passive_state?(state_id)
  162.     return game_battlerbase_state_check_pst(state_id)
  163.   end
  164.   
  165.   #--------------------------------------------------------------------------
  166.   # alias method: states
  167.   #--------------------------------------------------------------------------
  168.   alias game_battlerbase_states_pst states
  169.   def states
  170.     array = game_battlerbase_states_pst
  171.     array |= passive_states
  172.     return array
  173.   end
  174.   
  175.   #--------------------------------------------------------------------------
  176.   # new method: passive_state?
  177.   #--------------------------------------------------------------------------
  178.   def passive_state?(state_id)
  179.     @passive_states = [] if @passive_states.nil?
  180.     return @passive_states.include?(state_id)
  181.   end
  182.   
  183.   #--------------------------------------------------------------------------
  184.   # new method: passive_states
  185.   #--------------------------------------------------------------------------
  186.   def passive_states
  187.     array = []
  188.     if actor?
  189.       for state_id in self.actor.passive_states
  190.         array.push($data_states[state_id]) if passive_state_addable?(state_id)
  191.       end
  192. #~       for state_id in self.skills.passive_states
  193. #~         array.push($data_states[state_id]) if passive_state_addable?(state_id)
  194. #~       end
  195.       for state_id in self.class.passive_states
  196.         array.push($data_states[state_id]) if passive_state_addable?(state_id)
  197.       end
  198.       for equip in equips
  199.         next if equip.nil?
  200.         for state_id in equip.passive_states
  201.           array.push($data_states[state_id]) if passive_state_addable?(state_id)
  202.         end
  203.       end
  204.     else # enemy
  205.       for state_id in self.enemy.passive_states
  206.         array.push($data_states[state_id]) if passive_state_addable?(state_id)
  207.       end
  208.       if $imported["YEA-Doppelganger"] && !self.class.nil?
  209.         for state_id in self.class.passive_states
  210.           array.push($data_states[state_id]) if passive_state_addable?(state_id)
  211.         end
  212.       end
  213.     end
  214.     create_passive_state_array(array)
  215.     sort_passive_states(array)
  216.     set_passive_state_turns(array)
  217.     return array
  218.   end
  219.   
  220.   #--------------------------------------------------------------------------
  221.   # new method: create_passive_state_array
  222.   #--------------------------------------------------------------------------
  223.   def create_passive_state_array(array)
  224.     @passive_states = []
  225.     for state in array
  226.       @passive_states.push(state.id)
  227.     end
  228.   end
  229.   
  230.   #--------------------------------------------------------------------------
  231.   # new method: passive_state_addable?
  232.   #--------------------------------------------------------------------------
  233.   def passive_state_addable?(state_id)
  234.     return false if $data_states[state_id].nil?
  235.     return alive?
  236.   end
  237.   
  238.   #--------------------------------------------------------------------------
  239.   # new method: set_passive_state_turns
  240.   #--------------------------------------------------------------------------
  241.   def sort_passive_states(array)
  242.     array.sort! do |state_a, state_b|
  243.       if state_a.priority != state_b.priority
  244.         state_b.priority <=> state_a.priority
  245.       else
  246.         state_a.id <=> state_b.id
  247.       end
  248.     end
  249.     return array
  250.   end
  251.   
  252.   #--------------------------------------------------------------------------
  253.   # new method: set_passive_state_turns
  254.   #--------------------------------------------------------------------------
  255.   def set_passive_state_turns(array)
  256.     for state in array
  257.       @state_turns[state.id] = 0 unless @states.include?(state.id)
  258.       @state_steps[state.id] = 0 unless @states.include?(state.id)
  259.     end
  260.   end
  261.   
  262. end # Game_BattlerBase

  263. #==============================================================================
  264. # ■ Game_Battler
  265. #==============================================================================

  266. class Game_Battler < Game_BattlerBase
  267.   
  268.   #--------------------------------------------------------------------------
  269.   # alias method: state_addable?
  270.   #--------------------------------------------------------------------------
  271.   alias game_battler_state_addable_ps state_addable?
  272.   def state_addable?(state_id)
  273.     return false if passive_state?(state_id)
  274.     return game_battler_state_addable_ps(state_id)
  275.   end
  276.   
  277.   #--------------------------------------------------------------------------
  278.   # alias method: remove_state
  279.   #--------------------------------------------------------------------------
  280.   alias game_battler_remove_state_ps remove_state
  281.   def remove_state(state_id)
  282.     return if passive_state?(state_id)
  283.     game_battler_remove_state_ps(state_id)
  284.   end
  285.   
  286. end # Game_Battler

  287. #==============================================================================
  288. #
  289. # ▼ End of File
  290. #
  291. #==============================================================================
复制代码

除了技能不行,其他都可以,不知道为什么,技能难做还是怎么的,故意没有技能。
<passive state: x>写在除了技能以外的备注栏里面。<passive state: x,y,z>可多写的。随你写多少。
P1不太上了,有问题加个Q1286124843,不管是脚本还是游戏问题都可以来找我
回复 支持 1 反对 0

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
3642
在线时间
912 小时
注册时间
2017-1-19
帖子
269
3
 楼主| 发表于 2017-7-13 20:21:58 手机端发表。 | 只看该作者
Ⅹ是不是代表状态的编号

点评

"Ⅹ是不是代表状态的编号"。这个是废话。如果不是那请问是什么意思。 再说自己试试看不就知道了,又不会让你死机。自己问的问题我肯定是这样   发表于 2017-7-14 18:09
角色备注,职业备注,装备备注,敌人备注。这四个都可以 <passive state: x>角色写上就是一不管什么时候自动拥有这个状态。  发表于 2017-7-14 18:07
某装备装上自动附加某个状态,装备卸下后状态消除?你自己说的啊! 装备写上这个,自动附加这个状态,否则会消失。你说了一个很呆萌的话题  发表于 2017-7-14 18:06
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
1089 小时
注册时间
2014-5-9
帖子
504
4
发表于 2017-7-14 09:38:45 | 只看该作者
本帖最后由 15968715431 于 2017-7-14 09:40 编辑

https://rpg.blue/thread-343892-1-1.html
   可以用这个。光环技能。  战斗开始直接附加状态。  对敌人、角色都有效果。 全体。

只要学会指定技能。就会施放。

点评

battel里面有个HP MP TP自动回复,那边设置判定即可self是否装备此装备,是就加否则解除 下面还有战斗开始的也弄一次。那么只要6条即可  发表于 2017-7-16 16:09
三十个角色要90条,再说RUBY你这样一弄会卡顿。这样90条还是一个装备,你弄个10这样不疯了。  发表于 2017-7-16 16:08
那你要这么想:一个角色判定一个。我这边三十个,你说怎么弄,一个个去判定不可能。工程量也是很大的。 判定,附加,解除这样就三条了  发表于 2017-7-16 16:07
那可以用公共事件。 判定装备是否装备。 装备上就添加状态。否则解除。  发表于 2017-7-14 18:51
他要装备单人状态的,你给了光环。意思不符合。 其实在battles那边可以弄,设置回合刷新和开场附加就行  发表于 2017-7-14 18:46
已填坑作品:唤灵师1,唤灵师2-魔灵大陆,唤灵师3-莉娜丝的吊坠。破晓,傲歌。
填坑中作品:三国梦,罗亚大陆之雇佣兵团
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-17 13:54

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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